Re: 2.0.31-pre6 and noatime

Kelly French (targon@hazmat.com)
Mon, 18 Aug 1997 11:09:24 -0400 (EDT)


On Sun, 17 Aug 1997, Jon Lewis wrote:

> Ok...I've compiled mount-2.6g with noatime support, played around a bit,
> and found the following. The state of noatime/atime cannot be changed via
> mount -o remount. To change the noatime/atime state, you must umount and
> then mount the partition again.

Unfortunately, this bug is a little worse than just noatime. What happens
is that remount flags other than read-only and mandatory lock get ignored.
BUT, when you type 'mount' afterwards, it looks like they stuck. This is
important if you do nodev/noexec for security reasons. It's not normally
a problem because these flags aren't usually done in a remount.

Here's a fix for that (BTW, a similar fix by me was put into 2.1.20ish).
Sorry for not having a perfect patch file. This is a patch for
linux/fs/super.c.

--- super-old.c Mon Aug 18 10:49:57 1997
+++ super.c Mon Aug 18 10:50:13 1997
@@ -764,8 +764,8 @@
if (retval)
return retval;
}
- sb->s_flags = (sb->s_flags & ~MS_RMT_MASK) |
- (flags & MS_RMT_MASK);
+ sb->s_flags = (sb->s_flags & MS_RMT_MASK) |
+ (flags & ~MS_RMT_MASK);
vfsmnt = lookup_vfsmnt(sb->s_dev);
if (vfsmnt)
vfsmnt->mnt_flags = sb->s_flags;

Here's the same fix applied to 2.1.x. ***NOTE*** The patch for 2.1.x
just makes the 2.1.x fix consistent with the 2.0.x fix. The first patch I
submitted for this added a line where I should have change the existing
one.

--- super-old.c Mon Aug 18 10:54:42 1997
+++ super.c Mon Aug 18 10:54:50 1997
@@ -762,14 +762,13 @@
if ((flags & MS_RDONLY) && !(sb->s_flags & MS_RDONLY))
if (!fs_may_remount_ro(sb->s_dev))
return -EBUSY;
- sb->s_flags = (flags & ~MS_RDONLY) | (sb->s_flags & MS_RDONLY);
if (sb->s_op && sb->s_op->remount_fs) {
retval = sb->s_op->remount_fs(sb, &flags, data);
if (retval)
return retval;
}
- sb->s_flags = (sb->s_flags & ~MS_RMT_MASK) |
- (flags & MS_RMT_MASK);
+ sb->s_flags = (sb->s_flags & MS_RMT_MASK) |
+ (flags & ~MS_RMT_MASK);
vfsmnt = lookup_vfsmnt(sb->s_dev);
if (vfsmnt)
vfsmnt->mnt_flags = sb->s_flags;

-Kelly French