lkml.org 
[lkml]   [2001]   [Jan]   [4]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] fsync on unmounting root


On Thu, 4 Jan 2001, Chris Mason wrote:

> Hi guys,
>
> Looks like the prerelease, and at least test13 don't fsync the device when
> someone does an unmount on /
>
> mount -o remount works, just unmounting the root misses the fsync.
>
> This patch works for me:
>
> -chris
>
> --- linux/fs/super.c.1 Thu Jan 4 13:38:55 2001
> +++ linux/fs/super.c Thu Jan 4 13:38:39 2001
> @@ -1031,8 +1031,12 @@
> * we just try to remount it readonly.
> */
> mntput(mnt);
> - if (!(sb->s_flags & MS_RDONLY))
> + if (!(sb->s_flags & MS_RDONLY)) {
> + shrink_dcache_sb(sb);
> + fsync_dev(sb->s_dev);
> + acct_auto_close(sb->s_dev);
> retval = do_remount_sb(sb, MS_RDONLY, 0);
> + }

I have a better suggestion:

if (mnt == current->fs->rootmnt && !umount_root) {
mntput(mnt);
return do_remount("/", 0, NULL);
}

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2005-03-22 12:52    [W:0.026 / U:0.060 seconds]
©2003-2018 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site