diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2017-09-14 21:54:01 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2017-09-14 21:54:01 -0400 |
commit | 0f0d12728e56c94d3289c6831243b6faeae8a19d (patch) | |
tree | bd52fd4ed6fba2a0d8bb95e7fc33f51ac299001d /fs/ocfs2 | |
parent | 581bfce969cbfc7ce43ee92273be9cb7c3fdfa61 (diff) | |
parent | e462ec50cb5fad19f6003a3d8087f4a0945dd2b1 (diff) |
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/\<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
Diffstat (limited to 'fs/ocfs2')
-rw-r--r-- | fs/ocfs2/super.c | 15 |
1 files changed, 6 insertions, 9 deletions
diff --git a/fs/ocfs2/super.c b/fs/ocfs2/super.c index 3f936be379a9..80733496b22a 100644 --- a/fs/ocfs2/super.c +++ b/fs/ocfs2/super.c | |||
@@ -675,7 +675,7 @@ static int ocfs2_remount(struct super_block *sb, int *flags, char *data) | |||
675 | } | 675 | } |
676 | 676 | ||
677 | /* We're going to/from readonly mode. */ | 677 | /* We're going to/from readonly mode. */ |
678 | if ((*flags & MS_RDONLY) != (sb->s_flags & MS_RDONLY)) { | 678 | if ((bool)(*flags & MS_RDONLY) != sb_rdonly(sb)) { |
679 | /* Disable quota accounting before remounting RO */ | 679 | /* Disable quota accounting before remounting RO */ |
680 | if (*flags & MS_RDONLY) { | 680 | if (*flags & MS_RDONLY) { |
681 | ret = ocfs2_susp_quotas(osb, 0); | 681 | ret = ocfs2_susp_quotas(osb, 0); |
@@ -1063,7 +1063,7 @@ static int ocfs2_fill_super(struct super_block *sb, void *data, int silent) | |||
1063 | /* Hard readonly mode only if: bdev_read_only, MS_RDONLY, | 1063 | /* Hard readonly mode only if: bdev_read_only, MS_RDONLY, |
1064 | * heartbeat=none */ | 1064 | * heartbeat=none */ |
1065 | if (bdev_read_only(sb->s_bdev)) { | 1065 | if (bdev_read_only(sb->s_bdev)) { |
1066 | if (!(sb->s_flags & MS_RDONLY)) { | 1066 | if (!sb_rdonly(sb)) { |
1067 | status = -EACCES; | 1067 | status = -EACCES; |
1068 | mlog(ML_ERROR, "Readonly device detected but readonly " | 1068 | mlog(ML_ERROR, "Readonly device detected but readonly " |
1069 | "mount was not specified.\n"); | 1069 | "mount was not specified.\n"); |
@@ -1098,7 +1098,7 @@ static int ocfs2_fill_super(struct super_block *sb, void *data, int silent) | |||
1098 | } | 1098 | } |
1099 | 1099 | ||
1100 | if (!ocfs2_is_hard_readonly(osb)) { | 1100 | if (!ocfs2_is_hard_readonly(osb)) { |
1101 | if (sb->s_flags & MS_RDONLY) | 1101 | if (sb_rdonly(sb)) |
1102 | ocfs2_set_ro_flag(osb, 0); | 1102 | ocfs2_set_ro_flag(osb, 0); |
1103 | } | 1103 | } |
1104 | 1104 | ||
@@ -1179,7 +1179,7 @@ static int ocfs2_fill_super(struct super_block *sb, void *data, int silent) | |||
1179 | /* Now we can initialize quotas because we can afford to wait | 1179 | /* Now we can initialize quotas because we can afford to wait |
1180 | * for cluster locks recovery now. That also means that truncation | 1180 | * for cluster locks recovery now. That also means that truncation |
1181 | * log recovery can happen but that waits for proper quota setup */ | 1181 | * log recovery can happen but that waits for proper quota setup */ |
1182 | if (!(sb->s_flags & MS_RDONLY)) { | 1182 | if (!sb_rdonly(sb)) { |
1183 | status = ocfs2_enable_quotas(osb); | 1183 | status = ocfs2_enable_quotas(osb); |
1184 | if (status < 0) { | 1184 | if (status < 0) { |
1185 | /* We have to err-out specially here because | 1185 | /* We have to err-out specially here because |
@@ -2180,8 +2180,7 @@ static int ocfs2_initialize_super(struct super_block *sb, | |||
2180 | status = -EINVAL; | 2180 | status = -EINVAL; |
2181 | goto bail; | 2181 | goto bail; |
2182 | } | 2182 | } |
2183 | if (!(osb->sb->s_flags & MS_RDONLY) && | 2183 | if (!sb_rdonly(osb->sb) && (i = OCFS2_HAS_RO_COMPAT_FEATURE(osb->sb, ~OCFS2_FEATURE_RO_COMPAT_SUPP))) { |
2184 | (i = OCFS2_HAS_RO_COMPAT_FEATURE(osb->sb, ~OCFS2_FEATURE_RO_COMPAT_SUPP))) { | ||
2185 | mlog(ML_ERROR, "couldn't mount RDWR because of " | 2184 | mlog(ML_ERROR, "couldn't mount RDWR because of " |
2186 | "unsupported optional features (%x).\n", i); | 2185 | "unsupported optional features (%x).\n", i); |
2187 | status = -EINVAL; | 2186 | status = -EINVAL; |
@@ -2567,9 +2566,7 @@ static int ocfs2_handle_error(struct super_block *sb) | |||
2567 | rv = -EIO; | 2566 | rv = -EIO; |
2568 | } else { /* default option */ | 2567 | } else { /* default option */ |
2569 | rv = -EROFS; | 2568 | rv = -EROFS; |
2570 | if (sb->s_flags & MS_RDONLY && | 2569 | if (sb_rdonly(sb) && (ocfs2_is_soft_readonly(osb) || ocfs2_is_hard_readonly(osb))) |
2571 | (ocfs2_is_soft_readonly(osb) || | ||
2572 | ocfs2_is_hard_readonly(osb))) | ||
2573 | return rv; | 2570 | return rv; |
2574 | 2571 | ||
2575 | pr_crit("OCFS2: File system is now read-only.\n"); | 2572 | pr_crit("OCFS2: File system is now read-only.\n"); |