public inbox for linux-xfs@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] xfs: short circuit xfs_get_acl() if no acl is possible
@ 2019-05-08 19:28 Eric Sandeen
  2019-05-08 20:10 ` Darrick J. Wong
  0 siblings, 1 reply; 7+ messages in thread
From: Eric Sandeen @ 2019-05-08 19:28 UTC (permalink / raw)
  To: linux-xfs; +Cc: David Valin

If there are no attributes on the inode, don't go through the
cost of memory allocation and callling xfs_attr_get when we
already know we'll just get -ENOATTR.

Reported-by: David Valin <dvalin@redhat.com>
Suggested-by: Dave Chinner <david@fromorbit.com>
Signed-off-by: Eric Sandeen <sandeen@redhat.com>
---

diff --git a/fs/xfs/xfs_acl.c b/fs/xfs/xfs_acl.c
index 8039e35147dd..b469b44e9e71 100644
--- a/fs/xfs/xfs_acl.c
+++ b/fs/xfs/xfs_acl.c
@@ -132,6 +132,9 @@ xfs_get_acl(struct inode *inode, int type)
 		BUG();
 	}
 
+	if (!xfs_inode_hasattr(ip))
+		return NULL;
+
 	/*
 	 * If we have a cached ACLs value just return it, not need to
 	 * go out to the disk.

^ permalink raw reply related	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2019-07-03  0:41 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-05-08 19:28 [PATCH] xfs: short circuit xfs_get_acl() if no acl is possible Eric Sandeen
2019-05-08 20:10 ` Darrick J. Wong
2019-05-09 13:05   ` Brian Foster
2019-06-26 18:12     ` Darrick J. Wong
2019-06-26 18:16       ` Eric Sandeen
2019-07-01 18:52         ` Brian Foster
2019-07-02 22:31           ` Dave Chinner

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox