linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [patch] fs: add a remount,ro coherency point
@ 2009-03-30 11:33 Nick Piggin
  2009-03-30 12:19 ` Jorge Boncompte [DTI2]
  2009-03-30 12:55 ` Wu Fengguang
  0 siblings, 2 replies; 5+ messages in thread
From: Nick Piggin @ 2009-03-30 11:33 UTC (permalink / raw)
  To: viro; +Cc: Jorge Boncompte [DTI2], linux-fsdevel, Andrew Morton


fs: invalidate sb->s_bdev on remount,ro

Fixes a problem reported by "Jorge Boncompte [DTI2]" <jorge@dti2.net>
who is trying to snapshot a minix filesystem image.

Signed-off-by: Nick Piggin <npiggin@suse.de>

---
 fs/super.c |    8 ++++++++
 1 file changed, 8 insertions(+)

Index: linux-2.6/fs/super.c
===================================================================
--- linux-2.6.orig/fs/super.c
+++ linux-2.6/fs/super.c
@@ -647,6 +647,14 @@ int do_remount_sb(struct super_block *sb
 		acct_auto_close(sb);
 	shrink_dcache_sb(sb);
 	fsync_super(sb);
+	 /* Some filesystems modify their metadata via some other path
+	    than the bdev buffer cache (eg. use a private mapping, or
+	    directories in pagecache, etc). Also file data modifications
+	    go via their own mappings. So If we try to mount readonly
+	    then copy the filesystem from bdev, we could get stale data,
+	    so invalidate it to give a best effort at coherency. */
+	if (flags & MS_RDONLY && sb->s_bdev)
+		invalidate_bdev(sb->s_bdev);
 
 	/* If we are remounting RDONLY and current sb is read/write,
 	   make sure there are no rw files opened */

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2009-03-30 13:23 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-03-30 11:33 [patch] fs: add a remount,ro coherency point Nick Piggin
2009-03-30 12:19 ` Jorge Boncompte [DTI2]
2009-03-30 12:55 ` Wu Fengguang
2009-03-30 13:09   ` Nick Piggin
2009-03-30 13:22     ` Wu Fengguang

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).