diff mbox

[RFC,v3,4/5] UBIFS: ACL: introduce ACL mount options

Message ID 1441962597-13543-5-git-send-email-shengyong1@huawei.com (mailing list archive)
State New, archived
Headers show

Commit Message

Sheng Yong Sept. 11, 2015, 9:09 a.m. UTC
This patch introduces `acl' and `noacl' mount options for ACL.

Signed-off-by: Sheng Yong <shengyong1@huawei.com>
---
 fs/ubifs/super.c | 15 +++++++++++++++
 1 file changed, 15 insertions(+)

Comments

Yang Dongsheng Sept. 11, 2015, 5:03 a.m. UTC | #1
On 09/11/2015 05:09 PM, Sheng Yong wrote:
> This patch introduces `acl' and `noacl' mount options for ACL.
>
> Signed-off-by: Sheng Yong <shengyong1@huawei.com>
> ---
>   fs/ubifs/super.c | 15 +++++++++++++++
>   1 file changed, 15 insertions(+)
>
> diff --git a/fs/ubifs/super.c b/fs/ubifs/super.c
> index 9547a278..52baad1 100644
> --- a/fs/ubifs/super.c
> +++ b/fs/ubifs/super.c
> @@ -441,6 +441,9 @@ static int ubifs_show_options(struct seq_file *s, struct dentry *root)
>   			   ubifs_compr_name(c->mount_opts.compr_type));
>   	}
>
> +	if (c->vfs_sb->s_flags & MS_POSIXACL)
> +		seq_printf(s, ",acl");
> +
>   	return 0;
>   }
>
> @@ -926,6 +929,8 @@ enum {
>   	Opt_chk_data_crc,
>   	Opt_no_chk_data_crc,
>   	Opt_override_compr,
> +	Opt_acl,
> +	Opt_noacl,
>   	Opt_err,
>   };
>
> @@ -937,6 +942,8 @@ static const match_table_t tokens = {
>   	{Opt_chk_data_crc, "chk_data_crc"},
>   	{Opt_no_chk_data_crc, "no_chk_data_crc"},
>   	{Opt_override_compr, "compr=%s"},
> +	{Opt_acl, "acl"},
> +	{Opt_noacl, "noacl"},
>   	{Opt_err, NULL},
>   };
>
> @@ -1037,6 +1044,14 @@ static int ubifs_parse_options(struct ubifs_info *c, char *options,
>   			c->default_compr = c->mount_opts.compr_type;
>   			break;
>   		}
> +#ifdef CONFIG_UBIFS_FS_POSIX_ACL
> +		case Opt_acl:
> +			c->vfs_sb->s_flags |= MS_POSIXACL;
> +			break;

I think we can error out if CONFIG_UBIFS_FS_POSIX_ACL=n && Opt_acl is 
specified. I think you missed my comment again, I mentioned it in your 
V2 patch.

Yang
> +		case Opt_noacl:
> +			c->vfs_sb->s_flags &= ~MS_POSIXACL;
> +			break;
> +#endif
>   		default:
>   		{
>   			unsigned long flag;
>

--
To unsubscribe from this list: send the line "unsubscribe linux-fsdevel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Sheng Yong Sept. 11, 2015, 8:25 a.m. UTC | #2
On 9/11/2015 1:03 PM, Dongsheng Yang wrote:
> On 09/11/2015 05:09 PM, Sheng Yong wrote:
>> This patch introduces `acl' and `noacl' mount options for ACL.
>>
>> Signed-off-by: Sheng Yong <shengyong1@huawei.com>
>> ---
>>   fs/ubifs/super.c | 15 +++++++++++++++
>>   1 file changed, 15 insertions(+)
>>
>> diff --git a/fs/ubifs/super.c b/fs/ubifs/super.c
>> index 9547a278..52baad1 100644
>> --- a/fs/ubifs/super.c
>> +++ b/fs/ubifs/super.c
>> @@ -441,6 +441,9 @@ static int ubifs_show_options(struct seq_file *s, struct dentry *root)
>>                  ubifs_compr_name(c->mount_opts.compr_type));
>>       }
>>
>> +    if (c->vfs_sb->s_flags & MS_POSIXACL)
>> +        seq_printf(s, ",acl");
>> +
>>       return 0;
>>   }
>>
>> @@ -926,6 +929,8 @@ enum {
>>       Opt_chk_data_crc,
>>       Opt_no_chk_data_crc,
>>       Opt_override_compr,
>> +    Opt_acl,
>> +    Opt_noacl,
>>       Opt_err,
>>   };
>>
>> @@ -937,6 +942,8 @@ static const match_table_t tokens = {
>>       {Opt_chk_data_crc, "chk_data_crc"},
>>       {Opt_no_chk_data_crc, "no_chk_data_crc"},
>>       {Opt_override_compr, "compr=%s"},
>> +    {Opt_acl, "acl"},
>> +    {Opt_noacl, "noacl"},
>>       {Opt_err, NULL},
>>   };
>>
>> @@ -1037,6 +1044,14 @@ static int ubifs_parse_options(struct ubifs_info *c, char *options,
>>               c->default_compr = c->mount_opts.compr_type;
>>               break;
>>           }
>> +#ifdef CONFIG_UBIFS_FS_POSIX_ACL
>> +        case Opt_acl:
>> +            c->vfs_sb->s_flags |= MS_POSIXACL;
>> +            break;
> 
> I think we can error out if CONFIG_UBIFS_FS_POSIX_ACL=n && Opt_acl is specified. I think you missed my comment again, I mentioned it in your V2 patch.

I don't think the else is needed. I think the `default' could handle this.

thanks,
Sheng
> 
> Yang
>> +        case Opt_noacl:
>> +            c->vfs_sb->s_flags &= ~MS_POSIXACL;
>> +            break;
>> +#endif
>>           default:
>>           {
>>               unsigned long flag;
>>
> 
> 
> .
> 

--
To unsubscribe from this list: send the line "unsubscribe linux-fsdevel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Yang Dongsheng Sept. 11, 2015, 8:25 a.m. UTC | #3
On 09/11/2015 04:25 PM, Sheng Yong wrote:
>
>
> On 9/11/2015 1:03 PM, Dongsheng Yang wrote:
>> On 09/11/2015 05:09 PM, Sheng Yong wrote:
>>> This patch introduces `acl' and `noacl' mount options for ACL.
>>>
>>> Signed-off-by: Sheng Yong <shengyong1@huawei.com>
>>> ---
>>>    fs/ubifs/super.c | 15 +++++++++++++++
>>>    1 file changed, 15 insertions(+)
>>>
>>> diff --git a/fs/ubifs/super.c b/fs/ubifs/super.c
>>> index 9547a278..52baad1 100644
>>> --- a/fs/ubifs/super.c
>>> +++ b/fs/ubifs/super.c
>>> @@ -441,6 +441,9 @@ static int ubifs_show_options(struct seq_file *s, struct dentry *root)
>>>                   ubifs_compr_name(c->mount_opts.compr_type));
>>>        }
>>>
>>> +    if (c->vfs_sb->s_flags & MS_POSIXACL)
>>> +        seq_printf(s, ",acl");
>>> +
>>>        return 0;
>>>    }
>>>
>>> @@ -926,6 +929,8 @@ enum {
>>>        Opt_chk_data_crc,
>>>        Opt_no_chk_data_crc,
>>>        Opt_override_compr,
>>> +    Opt_acl,
>>> +    Opt_noacl,
>>>        Opt_err,
>>>    };
>>>
>>> @@ -937,6 +942,8 @@ static const match_table_t tokens = {
>>>        {Opt_chk_data_crc, "chk_data_crc"},
>>>        {Opt_no_chk_data_crc, "no_chk_data_crc"},
>>>        {Opt_override_compr, "compr=%s"},
>>> +    {Opt_acl, "acl"},
>>> +    {Opt_noacl, "noacl"},
>>>        {Opt_err, NULL},
>>>    };
>>>
>>> @@ -1037,6 +1044,14 @@ static int ubifs_parse_options(struct ubifs_info *c, char *options,
>>>                c->default_compr = c->mount_opts.compr_type;
>>>                break;
>>>            }
>>> +#ifdef CONFIG_UBIFS_FS_POSIX_ACL
>>> +        case Opt_acl:
>>> +            c->vfs_sb->s_flags |= MS_POSIXACL;
>>> +            break;
>>
>> I think we can error out if CONFIG_UBIFS_FS_POSIX_ACL=n && Opt_acl is specified. I think you missed my comment again, I mentioned it in your V2 patch.
>
> I don't think the else is needed. I think the `default' could handle this.

Oh, yes, good. My bad. default would handle it.

Thanx
Yang
>
> thanks,
> Sheng
>>
>> Yang
>>> +        case Opt_noacl:
>>> +            c->vfs_sb->s_flags &= ~MS_POSIXACL;
>>> +            break;
>>> +#endif
>>>            default:
>>>            {
>>>                unsigned long flag;
>>>
>>
>>
>> .
>>
>
> .
>

--
To unsubscribe from this list: send the line "unsubscribe linux-fsdevel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/fs/ubifs/super.c b/fs/ubifs/super.c
index 9547a278..52baad1 100644
--- a/fs/ubifs/super.c
+++ b/fs/ubifs/super.c
@@ -441,6 +441,9 @@  static int ubifs_show_options(struct seq_file *s, struct dentry *root)
 			   ubifs_compr_name(c->mount_opts.compr_type));
 	}
 
+	if (c->vfs_sb->s_flags & MS_POSIXACL)
+		seq_printf(s, ",acl");
+
 	return 0;
 }
 
@@ -926,6 +929,8 @@  enum {
 	Opt_chk_data_crc,
 	Opt_no_chk_data_crc,
 	Opt_override_compr,
+	Opt_acl,
+	Opt_noacl,
 	Opt_err,
 };
 
@@ -937,6 +942,8 @@  static const match_table_t tokens = {
 	{Opt_chk_data_crc, "chk_data_crc"},
 	{Opt_no_chk_data_crc, "no_chk_data_crc"},
 	{Opt_override_compr, "compr=%s"},
+	{Opt_acl, "acl"},
+	{Opt_noacl, "noacl"},
 	{Opt_err, NULL},
 };
 
@@ -1037,6 +1044,14 @@  static int ubifs_parse_options(struct ubifs_info *c, char *options,
 			c->default_compr = c->mount_opts.compr_type;
 			break;
 		}
+#ifdef CONFIG_UBIFS_FS_POSIX_ACL
+		case Opt_acl:
+			c->vfs_sb->s_flags |= MS_POSIXACL;
+			break;
+		case Opt_noacl:
+			c->vfs_sb->s_flags &= ~MS_POSIXACL;
+			break;
+#endif
 		default:
 		{
 			unsigned long flag;