[PATCH 19/37] Re: [2.6-BK-URL] NTFS: 2.1.21 - Big update with race/bugfixes

From: Anton Altaparmakov
Date: Tue Oct 19 2004 - 06:11:04 EST


This is patch 19/37 in the series. It contains the following ChangeSet:

<aia21@xxxxxxxxxx> (04/10/07 1.2031)
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 <aia21@xxxxxxxxxx>

Best regards,

Anton
--
Anton Altaparmakov <aia21 at cam.ac.uk> (replace at with @)
Unix Support, Computing Service, University of Cambridge, CB2 3QH, UK
Linux NTFS maintainer / IRC: #ntfs on irc.freenode.net
WWW: http://linux-ntfs.sf.net/, http://www-stu.christs.cam.ac.uk/~aia21/

===================================================================

diff -Nru a/fs/ntfs/ChangeLog b/fs/ntfs/ChangeLog
--- a/fs/ntfs/ChangeLog 2004-10-19 10:14:15 +01:00
+++ b/fs/ntfs/ChangeLog 2004-10-19 10:14:15 +01:00
@@ -59,6 +59,12 @@
- 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 -Nru a/fs/ntfs/mft.c b/fs/ntfs/mft.c
--- a/fs/ntfs/mft.c 2004-10-19 10:14:15 +01:00
+++ b/fs/ntfs/mft.c 2004-10-19 10:14:15 +01:00
@@ -407,19 +407,11 @@
*/
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 @@
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 @@
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 "
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/