aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKelly Anderson <kelly@xilka.com>2013-10-06 22:36:20 -0400
committerJaegeuk Kim <jaegeuk.kim@samsung.com>2013-10-06 22:38:13 -0400
commit4058c5117d6d8a94002fb308615c7442ed3a3896 (patch)
tree6d7314e4b6ce0459ea1661f149a63dd045451762
parente479556bfdd136669854292eb57ed0139d7253d5 (diff)
f2fs: handle remount options correctly
The current f2fs code errors if the xattr or acl options are passed when remounting. This is important in a typical scenario where f2fs is mounted as a "ro" root file-system by the boot loader and then the init process wants to remount it "rw" with the "remount,rw" option. Signed-off-by: Kelly Anderson <kelly@xilka.com> Signed-off-by: Jaegeuk Kim <jaegeuk.kim@samsung.com>
-rw-r--r--fs/f2fs/super.c17
1 files changed, 17 insertions, 0 deletions
diff --git a/fs/f2fs/super.c b/fs/f2fs/super.c
index 347d70049288..fde8e6aca9be 100644
--- a/fs/f2fs/super.c
+++ b/fs/f2fs/super.c
@@ -43,7 +43,9 @@ enum {
43 Opt_disable_roll_forward, 43 Opt_disable_roll_forward,
44 Opt_discard, 44 Opt_discard,
45 Opt_noheap, 45 Opt_noheap,
46 Opt_user_xattr,
46 Opt_nouser_xattr, 47 Opt_nouser_xattr,
48 Opt_acl,
47 Opt_noacl, 49 Opt_noacl,
48 Opt_active_logs, 50 Opt_active_logs,
49 Opt_disable_ext_identify, 51 Opt_disable_ext_identify,
@@ -56,7 +58,9 @@ static match_table_t f2fs_tokens = {
56 {Opt_disable_roll_forward, "disable_roll_forward"}, 58 {Opt_disable_roll_forward, "disable_roll_forward"},
57 {Opt_discard, "discard"}, 59 {Opt_discard, "discard"},
58 {Opt_noheap, "no_heap"}, 60 {Opt_noheap, "no_heap"},
61 {Opt_user_xattr, "user_xattr"},
59 {Opt_nouser_xattr, "nouser_xattr"}, 62 {Opt_nouser_xattr, "nouser_xattr"},
63 {Opt_acl, "acl"},
60 {Opt_noacl, "noacl"}, 64 {Opt_noacl, "noacl"},
61 {Opt_active_logs, "active_logs=%u"}, 65 {Opt_active_logs, "active_logs=%u"},
62 {Opt_disable_ext_identify, "disable_ext_identify"}, 66 {Opt_disable_ext_identify, "disable_ext_identify"},
@@ -237,6 +241,9 @@ static int parse_options(struct super_block *sb, char *options)
237 set_opt(sbi, NOHEAP); 241 set_opt(sbi, NOHEAP);
238 break; 242 break;
239#ifdef CONFIG_F2FS_FS_XATTR 243#ifdef CONFIG_F2FS_FS_XATTR
244 case Opt_user_xattr:
245 set_opt(sbi, XATTR_USER);
246 break;
240 case Opt_nouser_xattr: 247 case Opt_nouser_xattr:
241 clear_opt(sbi, XATTR_USER); 248 clear_opt(sbi, XATTR_USER);
242 break; 249 break;
@@ -244,6 +251,10 @@ static int parse_options(struct super_block *sb, char *options)
244 set_opt(sbi, INLINE_XATTR); 251 set_opt(sbi, INLINE_XATTR);
245 break; 252 break;
246#else 253#else
254 case Opt_user_xattr:
255 f2fs_msg(sb, KERN_INFO,
256 "user_xattr options not supported");
257 break;
247 case Opt_nouser_xattr: 258 case Opt_nouser_xattr:
248 f2fs_msg(sb, KERN_INFO, 259 f2fs_msg(sb, KERN_INFO,
249 "nouser_xattr options not supported"); 260 "nouser_xattr options not supported");
@@ -254,10 +265,16 @@ static int parse_options(struct super_block *sb, char *options)
254 break; 265 break;
255#endif 266#endif
256#ifdef CONFIG_F2FS_FS_POSIX_ACL 267#ifdef CONFIG_F2FS_FS_POSIX_ACL
268 case Opt_acl:
269 set_opt(sbi, POSIX_ACL);
270 break;
257 case Opt_noacl: 271 case Opt_noacl:
258 clear_opt(sbi, POSIX_ACL); 272 clear_opt(sbi, POSIX_ACL);
259 break; 273 break;
260#else 274#else
275 case Opt_acl:
276 f2fs_msg(sb, KERN_INFO, "acl options not supported");
277 break;
261 case Opt_noacl: 278 case Opt_noacl:
262 f2fs_msg(sb, KERN_INFO, "noacl options not supported"); 279 f2fs_msg(sb, KERN_INFO, "noacl options not supported");
263 break; 280 break;