patch-2.1.59 linux/fs/super.c
Next file: linux/include/linux/ioport.h
Previous file: linux/fs/nfs/write.c
Back to the patch index
Back to the overall index
- Lines: 30
- Date:
Thu Oct 16 08:11:24 1997
- Orig file:
v2.1.58/linux/fs/super.c
- Orig date:
Wed Oct 15 16:04:23 1997
diff -u --recursive --new-file v2.1.58/linux/fs/super.c linux/fs/super.c
@@ -840,6 +840,13 @@
int retval;
struct vfsmount *vfsmnt;
+ /*
+ * Invalidate the inodes, as some mount options may be changed.
+ * N.B. If we are changing media, we should check the return
+ * from invalidate_inodes ... can't allow _any_ open files.
+ */
+ invalidate_inodes(sb);
+
if (!(flags & MS_RDONLY) && sb->s_dev && is_read_only(sb->s_dev))
return -EACCES;
/*flags |= MS_RDONLY;*/
@@ -870,8 +877,14 @@
struct super_block * sb = dentry->d_inode->i_sb;
retval = -EINVAL;
- if (dentry == sb->s_root)
+ if (dentry == sb->s_root) {
+ /*
+ * Shrink the dcache and sync the device.
+ */
+ shrink_dcache_sb(sb);
+ fsync_dev(sb->s_dev);
retval = do_remount_sb(sb, flags, data);
+ }
dput(dentry);
}
return retval;
FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen, slshen@lbl.gov