linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Neil Brown <neilb@suse.de>
To: "J. Bruce Fields" <bfields@fieldses.org>
Cc: "Luiz Fernando N. Capitulino" <lcapitulino@gmail.com>,
	Nick Piggin <npiggin@suse.de>,
	Andrew Morton <akpm@linux-foundation.org>,
	Linus Torvalds <torvalds@linux-foundation.org>,
	Hugh Dickins <hugh@veritas.com>,
	Andrea Arcangeli <andrea@suse.de>,
	Linux Memory Management List <linux-mm@kvack.org>,
	lcapitulino@mandriva.com.br
Subject: Re: [patch][rfc] remove ZERO_PAGE?
Date: Fri, 3 Aug 2007 11:40:38 +1000	[thread overview]
Message-ID: <18098.34710.118531.660512@notabene.brown> (raw)
In-Reply-To: message from J. Bruce Fields on Thursday August 2

On Thursday August 2, bfields@fieldses.org wrote:
> On Tue, Jul 31, 2007 at 11:19:00PM -0300, Luiz Fernando N. Capitulino wrote:
> > On 7/31/07, J. Bruce Fields <bfields@fieldses.org> wrote:
> > > On Wed, Aug 01, 2007 at 03:47:39AM +0200, Nick Piggin wrote:
> > > > On Mon, Jul 30, 2007 at 06:39:12PM -0400, J. Bruce Fields wrote:
> > > > > It looks to me like it's oopsing at the deference of
> > > > > fhp->fh_export->ex_uuid in encode_fsid(), which is exactly the case
> > > > > commit b41eeef14d claims to fix.  Looks like that's been in since
> > > > > v2.6.22-rc1; what kernel is this?
> > > >
> > > > Any progress with this? I'm fairly sure ZERO_PAGE removal wouldn't
> > > > have triggered it.
> > >
> > > I agree that it's most likely an nfsd bug.  I'll take another look, but
> > > it probably won't be till tommorow afternoon.
> > 
> >  Bruce, is there a way to reproduce the bug b41eeef14d claims to fix?
> 
> OK, sorry, it's taking me a little time to figure out what's going on.
> 
> But fh_verify() was responsible for checking and filling in the fhp that
> is wrong here, and I don't see the safeguards in fh_verify() (or in the
> export-lookup process) that would ensure that the export associated with
> a filehandle has a non-NULL ex_uuid whenever the filehandle has a uuid
> fsid type.  But I can't create a test case yet.

I have seen this bug already.  Here is the patch I made.

But I'm not really sure how it happens.  I think you would need a
buggy mounted, and I don't think one of those has escaped.

I'll ponder a some more see what I can find.

But I'm certain this has nothing to do with ZERO_PAGE, so maybe future
followups should trim the cc list a bit.

NeilBrown

-------------------------------------
Validate filehandle type in fsid_source

fsid_source decided where to get the 'fsid' number to
return for a GETATTR based on the type of filehandle.
It can be from the device, from the fsid, or from the
UUID.

It is possible for the filehandle to be inconsistent
with the export information, so make sure the export information
actually has the info implied by the value returned by
fsid_source.


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

### Diffstat output
 ./fs/nfsd/nfsfh.c |   20 +++++++++++++++-----
 1 file changed, 15 insertions(+), 5 deletions(-)

diff .prev/fs/nfsd/nfsfh.c ./fs/nfsd/nfsfh.c
--- .prev/fs/nfsd/nfsfh.c	2007-07-31 11:19:20.000000000 +1000
+++ ./fs/nfsd/nfsfh.c	2007-08-03 11:31:40.000000000 +1000
@@ -566,13 +566,23 @@ enum fsid_source fsid_source(struct svc_
 	case FSID_DEV:
 	case FSID_ENCODE_DEV:
 	case FSID_MAJOR_MINOR:
-		return FSIDSOURCE_DEV;
+		if (fhp->fh_export->ex_dentry->d_inode->i_sb->s_type->fs_flags
+		    & FS_REQUIRES_DEV)
+			return FSIDSOURCE_DEV;
+		break;
 	case FSID_NUM:
-		return FSIDSOURCE_FSID;
-	default:
 		if (fhp->fh_export->ex_flags & NFSEXP_FSID)
 			return FSIDSOURCE_FSID;
-		else
-			return FSIDSOURCE_UUID;
+		break;
+	default:
+		break;
 	}
+	/* either a UUID type filehandle, or the filehandle doesn't
+	 * match the export.
+	 */
+	if (fhp->fh_export->ex_flags & NFSEXP_FSID)
+		return FSIDSOURCE_FSID;
+	if (fhp->fh_export->ex_uuid)
+		return FSIDSOURCE_UUID;
+	return FSIDSOURCE_DEV;
 }

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

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

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-07-27  2:19 Nick Piggin
2007-07-27  5:29 ` Linus Torvalds
2007-07-27  5:54   ` Nick Piggin
2007-07-27 15:21     ` Linus Torvalds
2007-07-30  3:08       ` Nick Piggin
2007-07-30  3:45         ` Linus Torvalds
2007-07-30  3:56           ` Linus Torvalds
2007-07-30  4:35             ` Nick Piggin
2007-07-30  4:30           ` Nick Piggin
2007-07-27 15:59 ` Hugh Dickins
2007-07-30 13:52 ` Luiz Fernando N. Capitulino
2007-07-30 18:57   ` Andrew Morton
2007-07-30 22:39     ` J. Bruce Fields
2007-07-30 23:09       ` Andrew Morton
2007-07-31  0:03         ` Luiz Fernando N. Capitulino
2007-08-01  1:47       ` Nick Piggin
2007-08-01  1:53         ` J. Bruce Fields
2007-08-01  2:19           ` Luiz Fernando N. Capitulino
2007-08-01  3:03             ` J. Bruce Fields
2007-08-02  4:37             ` J. Bruce Fields
2007-08-03  1:40               ` Neil Brown [this message]
2007-08-01  2:17         ` Luiz Fernando N. Capitulino

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=18098.34710.118531.660512@notabene.brown \
    --to=neilb@suse.de \
    --cc=akpm@linux-foundation.org \
    --cc=andrea@suse.de \
    --cc=bfields@fieldses.org \
    --cc=hugh@veritas.com \
    --cc=lcapitulino@gmail.com \
    --cc=lcapitulino@mandriva.com.br \
    --cc=linux-mm@kvack.org \
    --cc=npiggin@suse.de \
    --cc=torvalds@linux-foundation.org \
    /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