From 6ca3ba608bfd0f1df6dabd7f3e976ab4f5dc531b Mon Sep 17 00:00:00 2001 From: Anton Altaparmakov Date: Thu, 7 Oct 2004 13:28:53 +0100 Subject: [PATCH] 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: Anton Altaparmakov --- fs/ntfs/ChangeLog | 6 ++++++ fs/ntfs/mft.c | 40 +++++----------------------------------- 2 files changed, 11 insertions(+), 35 deletions(-) diff --git a/fs/ntfs/ChangeLog b/fs/ntfs/ChangeLog index 18a423149b0ff..3722d0802626e 100644 --- a/fs/ntfs/ChangeLog +++ b/fs/ntfs/ChangeLog @@ -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. diff --git a/fs/ntfs/mft.c b/fs/ntfs/mft.c index 1bacb34022f6b..c74ae7d72c3fa 100644 --- a/fs/ntfs/mft.c +++ b/fs/ntfs/mft.c @@ -407,19 +407,11 @@ unm_err_out: */ 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 @@ no_buffers_err_out: 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 @@ no_buffers_err_out: 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 " -- 2.53.0