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


Groups > linux.kernel > #1406471

Re: [PATCH] staging: lustre: llite: drop acl from cache

From Andreas Gruenbacher <agruenba@redhat.com>
Newsgroups linux.kernel
Subject Re: [PATCH] staging: lustre: llite: drop acl from cache
Date 2016-05-25 00:10 +0200
Message-ID <rCsGt-Hw-1@gated-at.bofh.it> (permalink)
References <rC8y6-4qB-17@gated-at.bofh.it> <rC9Xb-5mO-1@gated-at.bofh.it> <rCrho-8ax-27@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


On Tue, May 24, 2016 at 10:38 PM, James Simmons <jsimmons@infradead.org> wrote:
>> 2016-05-24 2:35 GMT+02:00 James Simmons <jsimmons@infradead.org>:
>> > Commit b8a7a3a6 change get_acl() for posix xattr to always cache
>> > the ACL which increases the reference count. That reference count
>> > can be reduced by have ll_get_acl() call forget_cached_acl() which
>> > it wasn't. When an inode gets deleted by Lustre the POSIX ACL
>> > reference count is tested to ensure its 1 and if not produces an error.
>>
>> Lustre shouldn't assume that the VFS immediately drops the reference
>> it is passed. Please remove that check as well.
>
> The piece of code in question from ll_delete_inode() is
>
> #ifdef CONFIG_FS_POSIX_ACL
>         else if (lli->lli_posix_acl) {
>                 LASSERT(atomic_read(&lli->lli_posix_acl->a_refcount) ==
> 1);
>                 LASSERT(!lli->lli_remote_perms);
>                 posix_acl_release(lli->lli_posix_acl);
>                 lli->lli_posix_acl = NULL;
>         }
> #endif
>
> So we want to prevent a leak should I do a
>
> while (atomic_read(&lli->lli_posix_acl->a_refcount))
>         posix_acl_release(lli->lli_posix_acl);
> lli->lli_posix_acl = NULL;
>
> Or does the VFS do this cleanup for us?

This conversation is unreal. Just remove the misguided assert and
you're good. After that, please have someone explain basic reference
counting to you.

Thanks,
Andreas

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


Thread

[PATCH] staging: lustre: llite: drop acl from cache James Simmons <jsimmons@infradead.org> - 2016-05-24 02:40 +0200
  Re: [PATCH] staging: lustre: llite: drop acl from cache Andreas Grünbacher <andreas.gruenbacher@gmail.com> - 2016-05-24 04:10 +0200
    Re: [PATCH] staging: lustre: llite: drop acl from cache James Simmons <jsimmons@infradead.org> - 2016-05-24 22:40 +0200
      Re: [PATCH] staging: lustre: llite: drop acl from cache Andreas Gruenbacher <agruenba@redhat.com> - 2016-05-25 00:10 +0200

csiph-web