All of lore.kernel.org
 help / color / mirror / Atom feed
From: Wei Yongjun <yjwei@cn.fujitsu.com>
To: nfsv4@linux-nfs.org
Cc: hch@infradead.org, nfs@lists.sourceforge.net
Subject: Re: [PATCH] knfsd : export : Fix bug of svc_export_parse()
Date: Tue, 27 Mar 2007 09:36:47 +0800	[thread overview]
Message-ID: <4608752F.1010205@cn.fujitsu.com> (raw)
In-Reply-To: <45FFA8E2.5000902@cn.fujitsu.com>

Nobody replied yet, but I think this is really a BUG of exportfs.
exportfs command does not check so strictly, so maybe some unreasonable
fh.key can be add to /proc/net/rpc/nfsd.fh/channel, but used this key to
find fh.handle, this always be fail and still retry.

It's this correct?

> When I export /dev/null as root, and mount it from client, mount ntf4 command will frozen.
>
> You can test it by following command:
> #exportfs -i -o fsid=0,no_root_squash,insecure,rw,async *:/dev/null
> #mount -t nfs4 127.0.0.1:/ /tmp
>
> This is because in svc_export_parse() function, if check_export return 
> false, after we reject the file handle, we must do cleanup the cache, 
> which is not a format error of file handle.
>
> Signed-off-by: Wei Yongjun <yjwei@cn.fujitsu.com>
>
> --- fs/nfsd/export.c.orig	2007-02-20 20:59:22.000000000 -0500
> +++ fs/nfsd/export.c	2007-03-16 01:04:16.000000000 -0400
> @@ -543,12 +543,13 @@ static int svc_export_parse(struct cache
>  		if (err) goto out;
>  		exp.ex_fsid = an_int;
>  
> -		err = check_export(nd.dentry->d_inode, exp.ex_flags);
> -		if (err) goto out;
> -
>  		err = fsloc_parse(&mesg, buf, &exp.ex_fslocs);
>  		if (err)
>  			goto out;
> +
> +		err = check_export(nd.dentry->d_inode, exp.ex_flags);
> +		if (err)
> +			set_bit(CACHE_NEGATIVE, &exp.h.flags);
>  	}
>  
>  	expp = svc_export_lookup(&exp);
>   


-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
NFS maillist  -  NFS@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/nfs

  reply	other threads:[~2007-03-27  1:42 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-03-20  9:26 [PATCH] knfsd : export : Fix bug of svc_export_parse() Wei Yongjun
2007-03-27  1:36 ` Wei Yongjun [this message]
2007-03-27  2:16   ` Neil Brown
2007-03-27  4:36     ` Wei Yongjun

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=4608752F.1010205@cn.fujitsu.com \
    --to=yjwei@cn.fujitsu.com \
    --cc=hch@infradead.org \
    --cc=nfs@lists.sourceforge.net \
    --cc=nfsv4@linux-nfs.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.