Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1359426

Re: [PATCH v18 21/22] ext4: Add richacl support

From Andreas Gruenbacher <agruenba@redhat.com>
Newsgroups linux.kernel
Subject Re: [PATCH v18 21/22] ext4: Add richacl support
Date 2016-03-16 23:40 +0100
Message-ID <rdsgF-71y-5@gated-at.bofh.it> (permalink)
References <r7rdD-tJ-3@gated-at.bofh.it> <r7rdD-tJ-7@gated-at.bofh.it> <rbweK-7tE-3@gated-at.bofh.it> <rcnj3-3Oo-5@gated-at.bofh.it> <rcRqO-7hA-5@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


On Tue, Mar 15, 2016 at 8:17 AM, Christoph Hellwig <hch@infradead.org> wrote:
> On Mon, Mar 14, 2016 at 12:08:31AM +0100, Andreas Gruenbacher wrote:
>> The xattr representation is the same on disk and at the xattr syscall
>> layer, and so richacl_from_xattr is used for converting into the
>> in-memory representation in both cases. The error codes are not the
>> same when a user supplies an invalid value via setxattr or NFS and
>> when an invalid xattr is read from disk though. I'll add a parameter
>> to richacl_from_xattr to make this more explicit.
>
> Better add a wrapper instead of a parameter.
>
>>
>> >> +static int
>> >> +__ext4_set_richacl(handle_t *handle, struct inode *inode, struct richacl *acl)
>> >> +{
>> >> +     const int name_index = EXT4_XATTR_INDEX_RICHACL;
>> >> +     umode_t mode = inode->i_mode;
>> >> +     int retval, size;
>> >> +     void *value;
>> >> +
>> >> +     if (richacl_equiv_mode(acl, &mode) == 0) {
>> >> +             inode->i_ctime = ext4_current_time(inode);
>> >> +             inode->i_mode = mode;
>> >> +             ext4_mark_inode_dirty(handle, inode);
>> >> +             return __ext4_remove_richacl(handle, inode);
>> >> +     }
>> >
>> > Should this check for a NULL acl instead of special casing that
>> > in ext4_set_richacl?
>>
>> I'm not sure I understand what you mean. When the
>
> ext4_set_richacl checks for a NULL acl pointer and then calls into
> __ext4_remove_richacl.  I'd rather have that special casing in one
> place.

Those are two different cases: the first is where ext4_set_richacl is
called with a NULL acl to remove an existing ACL; the second is where
ext4_set_richacl is called with a mode-equivalent ACL to set the mode
and remove any existing ACL.

The check for mode-equivalent ACLs is in __ext4_set_richacl and not in
ext4_set_richacl because an inherited ACL (ext4_init_acl) can also be
mode-equivalent.

Andreas

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

Re: [PATCH v18 21/22] ext4: Add richacl support Christoph Hellwig <hch@infradead.org> - 2016-03-11 15:30 +0100
  Re: [PATCH v18 21/22] ext4: Add richacl support Andreas Gruenbacher <agruenba@redhat.com> - 2016-03-14 00:10 +0100
    Re: [PATCH v18 21/22] ext4: Add richacl support Christoph Hellwig <hch@infradead.org> - 2016-03-15 08:20 +0100
      Re: [PATCH v18 21/22] ext4: Add richacl support Andreas Gruenbacher <agruenba@redhat.com> - 2016-03-16 23:40 +0100
  Re: [PATCH v18 21/22] ext4: Add richacl support Andreas Gruenbacher <agruenba@redhat.com> - 2016-03-14 01:00 +0100
  Re: [PATCH v18 21/22] ext4: Add richacl support Andreas Gruenbacher <agruenba@redhat.com> - 2016-03-14 14:10 +0100
    Re: [PATCH v18 21/22] ext4: Add richacl support Christoph Hellwig <hch@infradead.org> - 2016-03-15 08:30 +0100

csiph-web