LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
From: Neil Brown <neilb@suse.de>
To: "Phy Prabab" <phyprabab@gmail.com>,
	"Adrian Bunk" <bunk@stusta.de>,
	linux-kernel@vger.kernel.org, nfs@lists.sourceforge.net
Subject: Re: Opps in 2.6.21-rc4 nfsd
Date: Mon, 26 Mar 2007 11:08:06 +1000	[thread overview]
Message-ID: <17927.7414.722426.438730@notabene.brown> (raw)
In-Reply-To: message from Neil Brown on Monday March 26

On Monday March 26, neilb@suse.de wrote:
> 
> I'll try to have a patch for you to try on 2.6.21rc4 shortly.
> 

This patch should remove the Oops, but I have a suspicion that
something else is wrong, so I'd be very interested if you could run
with this for a few days and report the results.

NeilBrown

Signed-off-by: Neil Brown <neilb@suse.de>

### Diffstat output
 ./fs/nfsd/nfsfh.c |   37 +++++++++++++++++++++++++++++++++++--
 1 file changed, 35 insertions(+), 2 deletions(-)

diff .prev/fs/nfsd/nfsfh.c ./fs/nfsd/nfsfh.c
--- .prev/fs/nfsd/nfsfh.c	2007-03-26 10:51:01.000000000 +1000
+++ ./fs/nfsd/nfsfh.c	2007-03-26 11:04:20.000000000 +1000
@@ -324,7 +324,7 @@ fh_compose(struct svc_fh *fhp, struct sv
 	 *
 	 */
 
-	u8 version = 1;
+	u8 version;
 	u8 fsid_type = 0;
 	struct inode * inode = dentry->d_inode;
 	struct dentry *parent = dentry->d_parent;
@@ -342,12 +342,45 @@ fh_compose(struct svc_fh *fhp, struct sv
 	 * the reference filehandle (if it is in the same export)
 	 * or the export options.
 	 */
+ retry:
+	version = 1;
 	if (ref_fh && ref_fh->fh_export == exp) {
 		version = ref_fh->fh_handle.fh_version;
 		if (version == 0xca)
 			fsid_type = FSID_DEV;
-		else
+		else {
 			fsid_type = ref_fh->fh_handle.fh_fsid_type;
+			/* need to check that this type works for this
+			 * export point.  As the lookup was done with
+			 * help from user-space, there is no guarantee
+			 */
+			if (ref_fh == fhp)
+				fh_put(ref_fh);
+			ref_fh = NULL;
+			switch(fsid_type) {
+			case FSID_DEV:
+				if (!old_valid_dev(ex_dev))
+					goto retry;
+				break;
+			case FSID_NUM:
+				if (! (exp->ex_flags & NFSEXP_FSID))
+					goto retry;
+				break;
+			case FSID_MAJOR_MINOR:
+			case FSID_ENCODE_DEV:
+				break;
+			case FSID_UUID8:
+			case FSID_UUID16:
+				if (!root_export)
+					goto retry;
+				/* fall through */
+			case FSID_UUID4_INUM:
+			case FSID_UUID16_INUM:
+				if (exp->ex_uuid == NULL)
+					goto retry;
+				break;
+			}
+		}
 		/* We know this version/type works for this export
 		 * so there is no need for further checks.
 		 */

  reply	other threads:[~2007-03-26  1:08 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-03-22 19:24 Phy Prabab
2007-03-23 15:29 ` Adrian Bunk
2007-03-23 15:45   ` Phy Prabab
2007-03-26  0:50     ` Neil Brown
2007-03-26  1:08       ` Neil Brown [this message]
2007-03-26  7:07         ` Phy Prabab
2007-03-23 17:47 ` Chuck Ebbert

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=17927.7414.722426.438730@notabene.brown \
    --to=neilb@suse.de \
    --cc=bunk@stusta.de \
    --cc=linux-kernel@vger.kernel.org \
    --cc=nfs@lists.sourceforge.net \
    --cc=phyprabab@gmail.com \
    --subject='Re: Opps in 2.6.21-rc4 nfsd' \
    /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

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).