From: Linus Torvalds Date: Fri, 15 Sep 2017 01:54:01 +0000 (-0700) Subject: Merge branch 'work.mount' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs X-Git-Tag: v6.6-pxa1908~15779 X-Git-Url: https://git.dujemihanovic.xyz/?a=commitdiff_plain;h=0f0d12728e56c94d3289c6831243b6faeae8a19d;p=linux.git Merge branch 'work.mount' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs 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/\/SB_RDONLY/g' \ -e 's/\/SB_NOSUID/g' \ -e 's/\/SB_NODEV/g' \ -e 's/\/SB_NOEXEC/g' \ -e 's/\/SB_SYNCHRONOUS/g' \ -e 's/\/SB_MANDLOCK/g' \ -e 's/\/SB_DIRSYNC/g' \ -e 's/\/SB_NOATIME/g' \ -e 's/\/SB_NODIRATIME/g' \ -e 's/\/SB_SILENT/g' \ -e 's/\/SB_POSIXACL/g' \ -e 's/\/SB_KERNMOUNT/g' \ -e 's/\/SB_I_VERSION/g' \ -e 's/\/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 --- 0f0d12728e56c94d3289c6831243b6faeae8a19d diff --cc fs/btrfs/disk-io.c index b6dc1d179d23,4a9b40f604fa..487bbe4fb3c6 --- a/fs/btrfs/disk-io.c +++ b/fs/btrfs/disk-io.c @@@ -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; } diff --cc include/linux/fs.h index 6e187cba94c3,3d6ee0c0ebb0..b4ae080f41a6 --- a/include/linux/fs.h +++ b/include/linux/fs.h @@@ -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 */