Re: [RFC PATCH 4/5] ubifs: Introduce ACLs mount options

From: Zhihao Cheng
Date: Fri Mar 22 2024 - 08:10:29 EST


在 2024/3/22 20:05, Li Zetao 写道:
Hi,

On 2024/3/21 14:49, Zhihao Cheng wrote:
在 2024/3/20 0:16, Li Zetao 写道:
Implement the ability to enable or disable the ACLs feature through
mount options. "-o acl" option means enable and "-o noacl" means disable
and it is enable by default.

Signed-off-by: Li Zetao <lizetao1@xxxxxxxxxx>

[...]
@@ -2011,12 +2041,17 @@ static int ubifs_remount_fs(struct super_block *sb, int *flags, char *data)
      sync_filesystem(sb);
      dbg_gen("old flags %#lx, new flags %#x", sb->s_flags, *flags);
+    c->mount_opts.acl = 0;
      err = ubifs_parse_options(c, data, 1);

1. mount -onoacl /dev/ubi0_0 /mnt # After that, mount will show 'noacl' option
2. mount -oremount,xxx /dev/ubi0_0 /mnt
If 'xxx' has nothing to do with acl, c->mount_opts.acl is set as '0'. Then superblock flag is assigned with 'SB_POSIXACL' and mount will not display 'nocal'. Will it make user confused?
I have tested this use case and it works fine. This is because the mount options will be re-parsed during remount, just like the last mount. But this is indeed redundant. I adjusted it to make it more reasonable.

Yes, parameter 'data' carries old mount information. Removing the redundant assignment is fine.