From faed8cc6579ca73e64af753f6d110340acbf499c Mon Sep 17 00:00:00 2001 From: Anton Altaparmakov Date: Sun, 10 Oct 2004 23:13:46 +0100 Subject: [PATCH] NTFS: Update fs/ntfs/inode.c::ntfs_write_inode() to also use the helper mark_ntfs_record_dirty() and thus to set the buffers belonging to the mft record dirty as well as the page itself. Signed-off-by: Anton Altaparmakov --- fs/ntfs/ChangeLog | 3 +++ fs/ntfs/inode.c | 11 +++++++++-- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/fs/ntfs/ChangeLog b/fs/ntfs/ChangeLog index 3722d0802626e..f532f388ea3d1 100644 --- a/fs/ntfs/ChangeLog +++ b/fs/ntfs/ChangeLog @@ -65,6 +65,9 @@ ToDo/Notes: 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. + - Update fs/ntfs/inode.c::ntfs_write_inode() to also use the helper + mark_ntfs_record_dirty() and thus to set the buffers belonging to the + mft record dirty as well as the page itself. 2.1.20 - Fix two stupid bugs introduced in 2.1.18 release. diff --git a/fs/ntfs/inode.c b/fs/ntfs/inode.c index a592f57b5dbb4..e8354aa419710 100644 --- a/fs/ntfs/inode.c +++ b/fs/ntfs/inode.c @@ -2271,7 +2271,7 @@ int ntfs_show_options(struct seq_file *sf, struct vfsmount *mnt) * ntfs_truncate - called when the i_size of an ntfs inode is changed * @vi: inode for which the i_size was changed * - * We don't support i_size changes yet. + * We do not support i_size changes yet. * * The kernel guarantees that @vi is a regular file (S_ISREG() is true) and * that the change is allowed. @@ -2505,9 +2505,16 @@ int ntfs_write_inode(struct inode *vi, int sync) * dirty, since we are going to write this mft record below in any case * and the base mft record may actually not have been modified so it * might not need to be written out. + * NOTE: It is not a problem when the inode for $MFT itself is being + * written out as mark_ntfs_record_dirty() will only set I_DIRTY_PAGES + * on the $MFT inode and hence ntfs_write_inode() will not be + * re-invoked because of it which in turn is ok since the dirtied mft + * record will be cleaned and written out to disk below, i.e. before + * this function returns. */ if (modified && !NInoTestSetDirty(ctx->ntfs_ino)) - __set_page_dirty_nobuffers(ctx->ntfs_ino->page); + mark_ntfs_record_dirty(ctx->ntfs_ino, ctx->ntfs_ino->page, + ctx->ntfs_ino->page_ofs); ntfs_attr_put_search_ctx(ctx); /* Now the access times are updated, write the base mft record. */ if (NInoDirty(ni)) -- 2.53.0