lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Tue, 29 Apr 2014 08:16:35 -0400
From:	Matthew Wilcox <willy@...ux.intel.com>
To:	Dave Chinner <david@...morbit.com>
Cc:	"Aneesh Kumar K.V" <aneesh.kumar@...ux.vnet.ibm.com>,
	agruen@...nel.org, bfields@...ldses.org, akpm@...ux-foundation.org,
	viro@...iv.linux.org.uk, dhowells@...hat.com,
	linux-fsdevel@...r.kernel.org, linux-nfs@...r.kernel.org,
	linux-kernel@...r.kernel.org
Subject: Re: [PATCH -V1 19/22] vfs: Cache richacl in struct inode

On Tue, Apr 29, 2014 at 10:52:04AM +1000, Dave Chinner wrote:
> >  #ifdef CONFIG_FSNOTIFY
> > @@ -240,10 +246,19 @@ void __destroy_inode(struct inode *inode)
> >  	}
> >  
> >  #ifdef CONFIG_FS_POSIX_ACL
> > -	if (inode->i_acl && inode->i_acl != ACL_NOT_CACHED)
> > -		posix_acl_release(inode->i_acl);
> > -	if (inode->i_default_acl && inode->i_default_acl != ACL_NOT_CACHED)
> > -		posix_acl_release(inode->i_default_acl);
> > +	if (IS_POSIXACL(inode)) {
> > +		if (inode->i_acl && inode->i_acl != ACL_NOT_CACHED)
> > +			posix_acl_release(inode->i_acl);
> > +		if (inode->i_default_acl &&
> > +		    inode->i_default_acl != ACL_NOT_CACHED)
> > +			posix_acl_release(inode->i_default_acl);
> > +	}
> > +#endif
> > +#ifdef CONFIG_FS_RICHACL
> > +	if (IS_RICHACL(inode)) {
> > +		if (inode->i_richacl && inode->i_richacl != ACL_NOT_CACHED)
> > +			richacl_put(inode->i_richacl);
> > +	}
> >  #endif
> 
> 	if (inode->i_acl && inode->i_acl != ACL_NOT_CACHED)
> 		acl_release(inode->i_acl);
> 
> And all the mess of working out what acl needs releasing get taken
> out of of this code.

Let's go further and have the API simply:

	inode_acl_release(inode);

with inode_acl_release looking something like:

	if (inode->i_acl && inode->i_acl != ACL_NOT_CACHED)
		acl_release(inode->i_acl);
	if (inode->i_default_acl && inode->i_default_acl != ACL_NOT_CACHED)
		acl_release(inode->i_default_acl);
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ