linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] tmpfs: Fix simple_set_acl()
@ 2014-04-22 22:08 Chuck Lever
  2014-05-04 12:42 ` J. Bruce Fields
  0 siblings, 1 reply; 4+ messages in thread
From: Chuck Lever @ 2014-04-22 22:08 UTC (permalink / raw)
  To: linux-fsdevel

Ben Greear <greearb@candelatech.com> reports that NFSD panics in
posix_acl_equiv_mode() during an NFSv3 SETACL operation. I have
reproduced this using an exported tmpfs and cthon04 with NFSv3.

A survey of .set_acl methods suggests that simple_set_acl() must
tolerate a NULL "acl" argument.

Fixes: feda821e76f3bbbba4bd54d30b4d4005a7848aa5
Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
---

 fs/posix_acl.c |   12 +++++++-----
 1 files changed, 7 insertions(+), 5 deletions(-)

diff --git a/fs/posix_acl.c b/fs/posix_acl.c
index 9e363e4..0b25aae 100644
--- a/fs/posix_acl.c
+++ b/fs/posix_acl.c
@@ -863,11 +863,13 @@ int simple_set_acl(struct inode *inode, struct posix_acl *acl, int type)
 	int error;
 
 	if (type == ACL_TYPE_ACCESS) {
-		error = posix_acl_equiv_mode(acl, &inode->i_mode);
-		if (error < 0)
-			return 0;
-		if (error == 0)
-			acl = NULL;
+		if (acl) {
+			error = posix_acl_equiv_mode(acl, &inode->i_mode);
+			if (error < 0)
+				return 0;
+			if (error == 0)
+				acl = NULL;
+		}
 	}
 
 	inode->i_ctime = CURRENT_TIME;


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

end of thread, other threads:[~2014-05-05 14:29 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-04-22 22:08 [PATCH] tmpfs: Fix simple_set_acl() Chuck Lever
2014-05-04 12:42 ` J. Bruce Fields
2014-05-04 19:08   ` Chuck Lever
2014-05-05 14:29     ` J.;Bruce Fields

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).