linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Trond Myklebust <trond.myklebust@primarydata.com>
To: Russell King - ARM Linux <linux@arm.linux.org.uk>
Cc: Christoph Hellwig <hch@infradead.org>,
	linux-nfs@vger.kernel.org, linux-kernel@vger.kernel.org,
	Al Viro <viro@zeniv.linux.org.uk>, Christoph Hellwig <hch@lst.de>,
	linux-arm-kernel@lists.infradead.org
Subject: Re: NFS client broken in Linus' tip
Date: Fri, 31 Jan 2014 15:59:30 -0500	[thread overview]
Message-ID: <1391201970.6978.1.camel@leira.trondhjem.org> (raw)
In-Reply-To: <20140130153812.GA15937@n2100.arm.linux.org.uk>

On Thu, 2014-01-30 at 15:38 +0000, Russell King - ARM Linux wrote:
> On Thu, Jan 30, 2014 at 06:32:08AM -0800, Christoph Hellwig wrote:
> > On Thu, Jan 30, 2014 at 02:27:52PM +0000, Russell King - ARM Linux wrote:
> > > Yes and no.  I still end up with an empty /etc/mtab, but the file now
> > > exists.  However, I can create and echo data into /etc/mtab, but it seems
> > > that can't happen at boot time.
> > 
> > Odd.  Can you disable CONFIG_NFSD_V3_ACL for now to isolate the issue?
> 
> Unfortunately, that results in some problem at boot time, which
> ultimately ends up with the other three CPUs being stopped, and
> hence the original reason scrolls off the screen before it can be
> read... even at 1920p.
> 
Hi Russell,

The following patch fixes the issue for me.

Cheers
  Trond

8<-------------------------------------------------------------
>From 59bc20fe862bd85fcad61427e8669603e789d163 Mon Sep 17 00:00:00 2001
From: Trond Myklebust <trond.myklebust@primarydata.com>
Date: Fri, 31 Jan 2014 14:25:19 -0500
Subject: [PATCH] fs: get_acl() must be allowed to return EOPNOTSUPP

posix_acl_xattr_get requires get_acl() to return EOPNOTSUPP if the
filesystem cannot support acls. This is needed for NFS, which can't
know whether or not the server supports acls until it tries to get/set
one.
This patch converts posix_acl_chmod and posix_acl_create to deal with
EOPNOTSUPP return values from get_acl().

Reported-by: Russell King <linux@arm.linux.org.uk>
Link: http://lkml.kernel.org/r/20140130140834.GW15937@n2100.arm.linux.org.uk
Cc: Christoph Hellwig <hch@lst.de>
Cc: Al Viro viro@zeniv.linux.org.uk>
Signed-off-by: Trond Myklebust <trond.myklebust@primarydata.com>
---
 fs/posix_acl.c | 18 ++++++++++++------
 1 file changed, 12 insertions(+), 6 deletions(-)

diff --git a/fs/posix_acl.c b/fs/posix_acl.c
index 38bae5a0ea25..11c54fd51e16 100644
--- a/fs/posix_acl.c
+++ b/fs/posix_acl.c
@@ -521,8 +521,11 @@ posix_acl_chmod(struct inode *inode, umode_t mode)
 		return -EOPNOTSUPP;
 
 	acl = get_acl(inode, ACL_TYPE_ACCESS);
-	if (IS_ERR_OR_NULL(acl))
+	if (IS_ERR_OR_NULL(acl)) {
+		if (acl == ERR_PTR(-EOPNOTSUPP))
+			return 0;
 		return PTR_ERR(acl);
+	}
 
 	ret = __posix_acl_chmod(&acl, GFP_KERNEL, mode);
 	if (ret)
@@ -544,14 +547,15 @@ posix_acl_create(struct inode *dir, umode_t *mode,
 		goto no_acl;
 
 	p = get_acl(dir, ACL_TYPE_DEFAULT);
-	if (IS_ERR(p))
+	if (IS_ERR(p)) {
+		if (p == ERR_PTR(-EOPNOTSUPP))
+			goto apply_umask;
 		return PTR_ERR(p);
-
-	if (!p) {
-		*mode &= ~current_umask();
-		goto no_acl;
 	}
 
+	if (!p)
+		goto apply_umask;
+
 	*acl = posix_acl_clone(p, GFP_NOFS);
 	if (!*acl)
 		return -ENOMEM;
@@ -575,6 +579,8 @@ posix_acl_create(struct inode *dir, umode_t *mode,
 	}
 	return 0;
 
+apply_umask:
+	*mode &= ~current_umask();
 no_acl:
 	*default_acl = NULL;
 	*acl = NULL;
-- 
1.8.5.3



-- 
Trond Myklebust
Linux NFS client maintainer


  reply	other threads:[~2014-01-31 20:59 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-01-30 14:08 NFS client broken in Linus' tip Russell King - ARM Linux
2014-01-30 14:14 ` Christoph Hellwig
2014-01-30 14:27   ` Russell King - ARM Linux
2014-01-30 14:32     ` Christoph Hellwig
2014-01-30 15:38       ` Russell King - ARM Linux
2014-01-31 20:59         ` Trond Myklebust [this message]
2014-02-01  1:03           ` Russell King - ARM Linux
2014-02-02 12:27             ` Russell King - ARM Linux
2014-02-02 22:04               ` Trond Myklebust
2014-02-03  9:43                 ` Takashi Iwai
2014-02-03 14:21                   ` Trond Myklebust
2014-02-03 14:24                     ` Takashi Iwai
2014-02-03  8:03           ` Christoph Hellwig
2014-02-03 14:17             ` Trond Myklebust
2014-02-03 14:57               ` Christoph Hellwig
2014-02-03 15:45                 ` Trond Myklebust
2014-02-03 20:22                   ` Trond Myklebust
2014-02-03 20:25                     ` Russell King - ARM Linux
2014-02-03 20:25                     ` Christoph Hellwig
2014-02-03 20:32                       ` Trond Myklebust
2014-02-03 20:54           ` Christoph Hellwig
2014-01-30 14:17 ` Trond Myklebust
2014-01-30 14:30   ` Russell King - ARM Linux
2014-01-30 14:45     ` Trond Myklebust
2014-01-30 15:17 ` Root NFS panicing on Linus' tip (Re: NFS client broken in Linus' tip) Ezequiel Garcia
2014-01-30 16:08   ` Russell King - ARM Linux

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1391201970.6978.1.camel@leira.trondhjem.org \
    --to=trond.myklebust@primarydata.com \
    --cc=hch@infradead.org \
    --cc=hch@lst.de \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-nfs@vger.kernel.org \
    --cc=linux@arm.linux.org.uk \
    --cc=viro@zeniv.linux.org.uk \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).