Merge branch 'work.mount' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs
authorLinus Torvalds <torvalds@linux-foundation.org>
Fri, 15 Sep 2017 01:54:01 +0000 (18:54 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Fri, 15 Sep 2017 01:54:01 +0000 (18:54 -0700)
Pull mount flag updates from Al Viro:
 "Another chunk of fmount preparations from dhowells; only trivial
  conflicts for that part. It separates MS_... bits (very grotty
  mount(2) ABI) from the struct super_block ->s_flags (kernel-internal,
  only a small subset of MS_... stuff).

  This does *not* convert the filesystems to new constants; only the
  infrastructure is done here. The next step in that series is where the
  conflicts would be; that's the conversion of filesystems. It's purely
  mechanical and it's better done after the merge, so if you could run
  something like

list=$(for i in MS_RDONLY MS_NOSUID MS_NODEV MS_NOEXEC MS_SYNCHRONOUS MS_MANDLOCK MS_DIRSYNC MS_NOATIME MS_NODIRATIME MS_SILENT MS_POSIXACL MS_KERNMOUNT MS_I_VERSION MS_LAZYTIME; do git grep -l $i fs drivers/staging/lustre drivers/mtd ipc mm include/linux; done|sort|uniq|grep -v '^fs/namespace.c$')

sed -i -e 's/\<MS_RDONLY\>/SB_RDONLY/g' \
        -e 's/\<MS_NOSUID\>/SB_NOSUID/g' \
        -e 's/\<MS_NODEV\>/SB_NODEV/g' \
        -e 's/\<MS_NOEXEC\>/SB_NOEXEC/g' \
        -e 's/\<MS_SYNCHRONOUS\>/SB_SYNCHRONOUS/g' \
        -e 's/\<MS_MANDLOCK\>/SB_MANDLOCK/g' \
        -e 's/\<MS_DIRSYNC\>/SB_DIRSYNC/g' \
        -e 's/\<MS_NOATIME\>/SB_NOATIME/g' \
        -e 's/\<MS_NODIRATIME\>/SB_NODIRATIME/g' \
        -e 's/\<MS_SILENT\>/SB_SILENT/g' \
        -e 's/\<MS_POSIXACL\>/SB_POSIXACL/g' \
        -e 's/\<MS_KERNMOUNT\>/SB_KERNMOUNT/g' \
        -e 's/\<MS_I_VERSION\>/SB_I_VERSION/g' \
        -e 's/\<MS_LAZYTIME\>/SB_LAZYTIME/g' \
        $list

  and commit it with something along the lines of 'convert filesystems
  away from use of MS_... constants' as commit message, it would save a
  quite a bit of headache next cycle"

* 'work.mount' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs:
  VFS: Differentiate mount flags (MS_*) from internal superblock flags
  VFS: Convert sb->s_flags & MS_RDONLY to sb_rdonly(sb)
  vfs: Add sb_rdonly(sb) to query the MS_RDONLY flag on s_flags

34 files changed:
1  2 
drivers/staging/lustre/lustre/llite/llite_lib.c
drivers/staging/lustre/lustre/llite/namei.c
fs/btrfs/dev-replace.c
fs/btrfs/disk-io.c
fs/btrfs/extent_io.c
fs/btrfs/inode.c
fs/btrfs/ioctl.c
fs/btrfs/root-tree.c
fs/btrfs/super.c
fs/btrfs/sysfs.c
fs/btrfs/volumes.c
fs/ext2/super.c
fs/ext4/file.c
fs/ext4/ialloc.c
fs/ext4/mmp.c
fs/ext4/super.c
fs/gfs2/glops.c
fs/gfs2/ops_fstype.c
fs/gfs2/quota.c
fs/gfs2/super.c
fs/isofs/inode.c
fs/jffs2/wbuf.c
fs/jfs/super.c
fs/namei.c
fs/namespace.c
fs/nfs/super.c
fs/ocfs2/super.c
fs/overlayfs/super.c
fs/reiserfs/journal.c
fs/super.c
fs/sync.c
fs/udf/super.c
fs/xfs/xfs_super.c
include/linux/fs.h

Simple merge
index b6dc1d179d23163fade309e146cbaad8a2415362,4a9b40f604fa49e04e071feb26b1e3c2a57e2f94..487bbe4fb3c6e7a92156aec7060dd84e3c2525a0
@@@ -3037,10 -3035,15 +3037,10 @@@ retry_root_backup
                btrfs_err(fs_info, "failed to read block groups: %d", ret);
                goto fail_sysfs;
        }
 -      fs_info->num_tolerated_disk_barrier_failures =
 -              btrfs_calc_num_tolerated_disk_barrier_failures(fs_info);
 -      if (fs_info->fs_devices->missing_devices >
 -           fs_info->num_tolerated_disk_barrier_failures &&
 -          !sb_rdonly(sb)) {
 +
-       if (!(sb->s_flags & MS_RDONLY) && !btrfs_check_rw_degradable(fs_info)) {
++      if (!sb_rdonly(sb) && !btrfs_check_rw_degradable(fs_info)) {
                btrfs_warn(fs_info,
 -"missing devices (%llu) exceeds the limit (%d), writeable mount is not allowed",
 -                      fs_info->fs_devices->missing_devices,
 -                      fs_info->num_tolerated_disk_barrier_failures);
 +              "writeable mount is not allowed due to too many missing devices");
                goto fail_sysfs;
        }
  
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
diff --cc fs/ext2/super.c
Simple merge
diff --cc fs/ext4/file.c
Simple merge
Simple merge
diff --cc fs/ext4/mmp.c
Simple merge
diff --cc fs/ext4/super.c
Simple merge
diff --cc fs/gfs2/glops.c
Simple merge
Simple merge
diff --cc fs/gfs2/quota.c
Simple merge
diff --cc fs/gfs2/super.c
Simple merge
Simple merge
diff --cc fs/jffs2/wbuf.c
Simple merge
diff --cc fs/jfs/super.c
Simple merge
diff --cc fs/namei.c
Simple merge
diff --cc fs/namespace.c
Simple merge
diff --cc fs/nfs/super.c
Simple merge
Simple merge
Simple merge
Simple merge
diff --cc fs/super.c
Simple merge
diff --cc fs/sync.c
Simple merge
diff --cc fs/udf/super.c
Simple merge
Simple merge
index 6e187cba94c3f44669f675a318d10826da235a01,3d6ee0c0ebb06422ff723b450558bae455c43198..b4ae080f41a6db8e379f7180c93ef711cf51a7cb
@@@ -1270,6 -1267,35 +1270,33 @@@ extern void f_delown(struct file *filp)
  extern pid_t f_getown(struct file *filp);
  extern int send_sigurg(struct fown_struct *fown);
  
 -struct mm_struct;
 -
+ /*
+  * sb->s_flags.  Note that these mirror the equivalent MS_* flags where
+  * represented in both.
+  */
+ #define SB_RDONLY      1      /* Mount read-only */
+ #define SB_NOSUID      2      /* Ignore suid and sgid bits */
+ #define SB_NODEV       4      /* Disallow access to device special files */
+ #define SB_NOEXEC      8      /* Disallow program execution */
+ #define SB_SYNCHRONOUS        16      /* Writes are synced at once */
+ #define SB_MANDLOCK   64      /* Allow mandatory locks on an FS */
+ #define SB_DIRSYNC    128     /* Directory modifications are synchronous */
+ #define SB_NOATIME    1024    /* Do not update access times. */
+ #define SB_NODIRATIME 2048    /* Do not update directory access times */
+ #define SB_SILENT     32768
+ #define SB_POSIXACL   (1<<16) /* VFS does not apply the umask */
+ #define SB_KERNMOUNT  (1<<22) /* this is a kern_mount call */
+ #define SB_I_VERSION  (1<<23) /* Update inode I_version field */
+ #define SB_LAZYTIME   (1<<25) /* Update the on-disk [acm]times lazily */
+ /* These sb flags are internal to the kernel */
+ #define SB_SUBMOUNT     (1<<26)
+ #define SB_NOREMOTELOCK       (1<<27)
+ #define SB_NOSEC      (1<<28)
+ #define SB_BORN               (1<<29)
+ #define SB_ACTIVE     (1<<30)
+ #define SB_NOUSER     (1<<31)
  /*
   *    Umount options
   */