From mboxrd@z Thu Jan 1 00:00:00 1970 From: Christoph Hellwig Subject: [PATCH 3/4] reiserfs: cache negative ACLs for v1 stat format Date: Sat, 23 Jul 2011 17:37:03 +0200 Message-ID: <20110723153703.GC10887@lst.de> References: <20110723153621.GA10832@lst.de> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: linux-fsdevel To: Al Viro , Linus Torvalds Return-path: Received: from verein.lst.de ([213.95.11.211]:33441 "EHLO newverein.lst.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752876Ab1GWPhD (ORCPT ); Sat, 23 Jul 2011 11:37:03 -0400 Content-Disposition: inline In-Reply-To: <20110723153621.GA10832@lst.de> Sender: linux-fsdevel-owner@vger.kernel.org List-ID: Always set up a negative ACL cache entry if the inode can't have ACLs. That behaves much better than doing this check inside ->check_acl. Also remove the left over MAY_NOT_BLOCK check. Signed-off-by: Christoph Hellwig Index: linux-2.6/fs/reiserfs/inode.c =================================================================== --- linux-2.6.orig/fs/reiserfs/inode.c 2011-07-23 16:39:07.214083201 +0200 +++ linux-2.6/fs/reiserfs/inode.c 2011-07-23 16:39:41.154082998 +0200 @@ -1475,6 +1475,11 @@ void reiserfs_read_locked_inode(struct i reiserfs_check_path(&path_to_sd); /* init inode should be relsing */ + /* + * Stat data v1 doesn't support ACLs. + */ + if (get_inode_sd_version(inode) == STAT_DATA_V1) + cache_no_acl(inode); } /** Index: linux-2.6/fs/reiserfs/xattr.c =================================================================== --- linux-2.6.orig/fs/reiserfs/xattr.c 2011-07-23 16:39:07.230749867 +0200 +++ linux-2.6/fs/reiserfs/xattr.c 2011-07-23 16:39:41.157416331 +0200 @@ -872,15 +872,6 @@ int reiserfs_check_acl(struct inode *ino struct posix_acl *acl; int error = -EAGAIN; /* do regular unix permission checks by default */ - /* - * Stat data v1 doesn't support ACLs. - */ - if (get_inode_sd_version(inode) == STAT_DATA_V1) - return -EAGAIN; - - if (mask & MAY_NOT_BLOCK) - return -ECHILD; - acl = reiserfs_get_acl(inode, ACL_TYPE_ACCESS); if (acl) {