Commit 6ca3ba60 authored by Anton Altaparmakov's avatar Anton Altaparmakov Committed by Richard Russon

NTFS: - Modify fs/ntfs/mft.c::__mark_mft_record_dirty() to use the helper

        mark_ntfs_record_dirty() which also changes the behaviour in that we
        now set the buffers belonging to the mft record dirty as well as the
        page itself.
      - Update fs/ntfs/mft.c::write_mft_record_nolock() and sync_mft_mirror()
        to cope with the fact that there now are dirty buffers in mft pages.
Signed-off-by: default avatarAnton Altaparmakov <aia21@cantab.net>
parent e91bcb8b
......@@ -59,6 +59,12 @@ ToDo/Notes:
- Move the typedefs for runlist_element and runlist from types.h to
runlist.h and fix resulting include errors.
- Remove unused {__,}format_mft_record() from fs/ntfs/mft.c.
- Modify fs/ntfs/mft.c::__mark_mft_record_dirty() to use the helper
mark_ntfs_record_dirty() which also changes the behaviour in that we
now set the buffers belonging to the mft record dirty as well as the
page itself.
- Update fs/ntfs/mft.c::write_mft_record_nolock() and sync_mft_mirror()
to cope with the fact that there now are dirty buffers in mft pages.
2.1.20 - Fix two stupid bugs introduced in 2.1.18 release.
......
......@@ -407,19 +407,11 @@ MFT_RECORD *map_extent_mft_record(ntfs_inode *base_ni, MFT_REF mref,
*/
void __mark_mft_record_dirty(ntfs_inode *ni)
{
struct page *page = ni->page;
ntfs_inode *base_ni;
ntfs_debug("Entering for inode 0x%lx.", ni->mft_no);
BUG_ON(!page);
BUG_ON(NInoAttr(ni));
/*
* Set the page containing the mft record dirty. This also marks the
* $MFT inode dirty (I_DIRTY_PAGES).
*/
__set_page_dirty_nobuffers(page);
mark_ntfs_record_dirty(ni, ni->page, ni->page_ofs);
/* Determine the base vfs inode and mark it dirty, too. */
down(&ni->extent_lock);
if (likely(ni->nr_extents >= 0))
......@@ -541,20 +533,9 @@ static int sync_mft_mirror(ntfs_inode *ni, MFT_RECORD *m, int sync)
m_end = m_start + vol->mft_record_size;
do {
block_end = block_start + blocksize;
/*
* If the buffer is outside the mft record, just skip it,
* clearing it if it is dirty to make sure it is not written
* out. It should never be marked dirty but better be safe.
*/
if ((block_end <= m_start) || (block_start >= m_end)) {
if (buffer_dirty(bh)) {
ntfs_warning(vol->sb, "Clearing dirty mft "
"record page buffer. %s",
ntfs_please_email);
clear_buffer_dirty(bh);
}
/* If the buffer is outside the mft record, skip it. */
if ((block_end <= m_start) || (block_start >= m_end))
continue;
}
if (!buffer_mapped(bh)) {
ntfs_error(vol->sb, "Writing mft mirror records "
"without existing mapped buffers is "
......@@ -706,20 +687,9 @@ int write_mft_record_nolock(ntfs_inode *ni, MFT_RECORD *m, int sync)
m_end = m_start + vol->mft_record_size;
do {
block_end = block_start + blocksize;
/*
* If the buffer is outside the mft record, just skip it,
* clearing it if it is dirty to make sure it is not written
* out. It should never be marked dirty but better be safe.
*/
if ((block_end <= m_start) || (block_start >= m_end)) {
if (buffer_dirty(bh)) {
ntfs_warning(vol->sb, "Clearing dirty mft "
"record page buffer. %s",
ntfs_please_email);
clear_buffer_dirty(bh);
}
/* If the buffer is outside the mft record, skip it. */
if ((block_end <= m_start) || (block_start >= m_end))
continue;
}
if (!buffer_mapped(bh)) {
ntfs_error(vol->sb, "Writing mft records without "
"existing mapped buffers is not "
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment