From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755032AbcEXUiX (ORCPT ); Tue, 24 May 2016 16:38:23 -0400 Received: from casper.infradead.org ([85.118.1.10]:57801 "EHLO casper.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753306AbcEXUiV (ORCPT ); Tue, 24 May 2016 16:38:21 -0400 Date: Tue, 24 May 2016 21:38:19 +0100 (BST) From: James Simmons To: =?ISO-8859-15?Q?Andreas_Gr=FCnbacher?= cc: Greg Kroah-Hartman , devel@driverdev.osuosl.org, Andreas Dilger , Oleg Drokin , Andreas Gruenbacher , Linux Kernel Mailing List , Lustre Development List Subject: Re: [PATCH] staging: lustre: llite: drop acl from cache In-Reply-To: Message-ID: References: <1464050108-28015-1-git-send-email-jsimmons@infradead.org> User-Agent: Alpine 2.20 (LFD 67 2015-01-07) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20160524_213820_050757_18BC2890 X-CRM114-Status: GOOD ( 18.70 ) X-Spam-Score: -1.9 (-) X-Spam-Report: SpamAssassin version 3.4.0 on casper.infradead.org summary: Content analysis details: (-1.9 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 NO_RELAYS Informational: message was not relayed via SMTP -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org > 2016-05-24 2:35 GMT+02:00 James Simmons : > > 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? > > Since forget_cached_acl() was not called Lustre started to complain. > > This patch changes ll_get_acl() to call forget_cached_acl(). > > > > Signed-off-by: James Simmons > > Reviewed-by: Andreas Gruenbacher > > > --- > > drivers/staging/lustre/lustre/llite/file.c | 1 + > > 1 files changed, 1 insertions(+), 0 deletions(-) > > > > diff --git a/drivers/staging/lustre/lustre/llite/file.c b/drivers/staging/lustre/lustre/llite/file.c > > index f47f2ac..0191945 100644 > > --- a/drivers/staging/lustre/lustre/llite/file.c > > +++ b/drivers/staging/lustre/lustre/llite/file.c > > @@ -3124,6 +3124,7 @@ struct posix_acl *ll_get_acl(struct inode *inode, int type) > > spin_lock(&lli->lli_lock); > > /* VFS' acl_permission_check->check_acl will release the refcount */ > > acl = posix_acl_dup(lli->lli_posix_acl); > > + forget_cached_acl(inode, type); > > spin_unlock(&lli->lli_lock); > > > > return acl; > > -- > > 1.7.1 > > >