Repeatable remount problem.

From: Richard B. Johnson (root@chaos.analogic.com)
Date: Mon Jul 15 2002 - 13:29:28 EST


Last week I reported a remount problem on 2.4.18 where a remounting
an already-mounted file-system, with new flags (like noatime), results
in a fsck upon reboot.

Here is a fix. Standard disclaimer: (works-for-me).

--- linux-2.4.18/fs/super.c.orig Mon Feb 25 14:38:09 2002
+++ linux-2.4.18/fs/super.c Mon Jul 15 14:18:55 2002
@@ -829,22 +829,14 @@
         if ((flags & MS_RDONLY) && !(sb->s_flags & MS_RDONLY))
                 if (!fs_may_remount_ro(sb))
                         return -EBUSY;
+ retval = 0;
         if (sb->s_op && sb->s_op->remount_fs) {
                 lock_super(sb);
- retval = sb->s_op->remount_fs(sb, &flags, data);
+ if(!(retval = sb->s_op->remount_fs(sb, &flags, data)));
+ sb->s_flags = (sb->s_flags & ~MS_RMT_MASK) | (flags & MS_RMT_MASK);
                 unlock_super(sb);
- if (retval)
- return retval;
         }
- sb->s_flags = (sb->s_flags & ~MS_RMT_MASK) | (flags & MS_RMT_MASK);
-
- /*
- * We can't invalidate inodes as we can loose data when remounting
- * (someone might manage to alter data while we are waiting in lock_super()
- * or in foo_remount_fs()))
- */
-
- return 0;
+ return retval;
 }
 
 struct vfsmount *do_kern_mount(char *type, int flags, char *name, void *data)

Cheers,
Dick Johnson

Penguin : Linux version 2.4.18 on an i686 machine (797.90 BogoMips).

                 Windows-2000/Professional isn't.

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



This archive was generated by hypermail 2b29 : Mon Jul 15 2002 - 22:00:31 EST