[2.6-BK-URL] Another urgent NTFS bug fix!

From: Anton Altaparmakov
Date: Tue Aug 16 2005 - 14:42:54 EST


Hi again Linus, please pull from

rsync://rsync.kernel.org/pub/scm/linux/kernel/git/aia21/ntfs-2.6.git/HEAD

This is another urgent NTFS bug fix which fixes an analogous problem to
the previous one. In the rush of getting out the previous patch I
completely forgot there are two different code paths that lead to mft
records being written out. The previous patch addressed the inode dirty
based writeout while this one addresses the page dirty based writeout.

Please apply before you release 2.6.13. Many thanks and apologies for
sending two merge requests in a row like this!

The diff style patch produced with git format-patch linux-2.6 is below.

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/

[PATCH] NTFS: Complete the previous fix for the unset device when mapping
buffers for mft record writing. I had missed the writepage based mft
record write code path.

Signed-off-by: Anton Altaparmakov <aia21@xxxxxxxxxx>
---

fs/ntfs/ChangeLog | 2 +-
fs/ntfs/aops.c | 1 +
2 files changed, 2 insertions(+), 1 deletions(-)

481d0374217f3fefaf98efbd8d21d73c138dd928
diff --git a/fs/ntfs/ChangeLog b/fs/ntfs/ChangeLog
--- a/fs/ntfs/ChangeLog
+++ b/fs/ntfs/ChangeLog
@@ -175,7 +175,7 @@ ToDo/Notes:
the ntfs inode in memory if present. Also, the ntfs inode has its
own locking so it does not matter if the vfs inode is locked.
- Fix bug in mft record writing where we forgot to set the device in
- the buffers when mapping them after the VM had discarded them
+ the buffers when mapping them after the VM had discarded them.
Thanks to Martin MOKREJÅ  for the bug report.

2.1.22 - Many bug and race fixes and error handling improvements.
diff --git a/fs/ntfs/aops.c b/fs/ntfs/aops.c
--- a/fs/ntfs/aops.c
+++ b/fs/ntfs/aops.c
@@ -924,6 +924,7 @@ static int ntfs_write_mst_block(struct p
LCN lcn;
unsigned int vcn_ofs;

+ bh->b_bdev = vol->sb->s_bdev;
/* Obtain the vcn and offset of the current block. */
vcn = (VCN)block << bh_size_bits;
vcn_ofs = vcn & vol->cluster_size_mask;