linux-nfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "J. Bruce Fields" <bfields@fieldses.org>
To: Chuck Lever <chuck.lever@oracle.com>
Cc: linux-nfs@vger.kernel.org
Subject: Re: [PATCH 3/3] NFSD: Add a cache for fs_locations information
Date: Thu, 8 Sep 2011 14:21:49 -0400	[thread overview]
Message-ID: <20110908182149.GC16740@fieldses.org> (raw)
In-Reply-To: <20110902163842.32190.52896.stgit@matisse.1015granger.net>

On Fri, Sep 02, 2011 at 12:38:42PM -0400, Chuck Lever wrote:
> From: Trond Myklebust <Trond.Myklebust@netapp.com>
> 
> Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
> [ cel: since this is server-side, use nfsd4_ prefix instead of nfs4_ prefix. ]
> [ cel: implement S_ISVTX filter in bfields-normal form ]
> Signed-off-by: Chuck Lever <chuck.lever@oracle.com>

OK, and this is all it takes to get entries for these added to the
export cache, so we're done?

--b.

> ---
> 
>  fs/nfsd/nfsd.h |    7 +++++++
>  fs/nfsd/vfs.c  |   16 ++++++++++++++++
>  2 files changed, 23 insertions(+), 0 deletions(-)
> 
> diff --git a/fs/nfsd/nfsd.h b/fs/nfsd/nfsd.h
> index 7ecfa24..d314812 100644
> --- a/fs/nfsd/nfsd.h
> +++ b/fs/nfsd/nfsd.h
> @@ -335,6 +335,13 @@ static inline u32 nfsd_suppattrs2(u32 minorversion)
>  #define NFSD_SUPPATTR_EXCLCREAT_WORD2 \
>  	NFSD_WRITEABLE_ATTRS_WORD2
>  
> +extern int nfsd4_is_junction(struct dentry *dentry);
> +#else
> +static inline int nfsd4_is_junction(struct dentry *dentry)
> +{
> +	return 0;
> +}
> +
>  #endif /* CONFIG_NFSD_V4 */
>  
>  #endif /* LINUX_NFSD_NFSD_H */
> diff --git a/fs/nfsd/vfs.c b/fs/nfsd/vfs.c
> index fd0acca..1f2d5bf 100644
> --- a/fs/nfsd/vfs.c
> +++ b/fs/nfsd/vfs.c
> @@ -168,6 +168,8 @@ int nfsd_mountpoint(struct dentry *dentry, struct svc_export *exp)
>  {
>  	if (d_mountpoint(dentry))
>  		return 1;
> +	if (nfsd4_is_junction(dentry))
> +		return 1;
>  	if (!(exp->ex_flags & NFSEXP_V4ROOT))
>  		return 0;
>  	return dentry->d_inode != NULL;
> @@ -592,6 +594,20 @@ nfsd4_get_nfs4_acl(struct svc_rqst *rqstp, struct dentry *dentry, struct nfs4_ac
>  	return error;
>  }
>  
> +#define NFSD_XATTR_JUNCTION_PREFIX XATTR_TRUSTED_PREFIX "junction."
> +#define NFSD_XATTR_JUNCTION_TYPE NFSD_XATTR_JUNCTION_PREFIX "type"
> +int nfsd4_is_junction(struct dentry *dentry)
> +{
> +	struct inode *inode = dentry->d_inode;
> +
> +	if (inode == NULL)
> +		return 0;
> +	if (!(inode->i_mode & S_ISVTX))
> +		return 0;
> +	if (vfs_getxattr(dentry, NFSD_XATTR_JUNCTION_TYPE, NULL, 0) <= 0)
> +		return 0;
> +	return 1;
> +}
>  #endif /* defined(CONFIG_NFSD_V4) */
>  
>  #ifdef CONFIG_NFSD_V3
> 
> --
> To unsubscribe from this list: send the line "unsubscribe linux-nfs" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html

  reply	other threads:[~2011-09-08 23:21 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-09-02 16:38 [PATCH 0/3] NFSD patches to support junctions Chuck Lever
2011-09-02 16:38 ` [PATCH 1/3] NFSD: Cleanup for nfsd4_path() Chuck Lever
2011-09-08 18:20   ` J. Bruce Fields
2011-09-02 16:38 ` [PATCH 2/3] NFSD: Remove the ex_pathname field from struct svc_export Chuck Lever
2011-09-02 16:38 ` [PATCH 3/3] NFSD: Add a cache for fs_locations information Chuck Lever
2011-09-08 18:21   ` J. Bruce Fields [this message]
2011-09-08 18:59     ` Chuck Lever
2011-09-08 17:59 ` [PATCH 0/3] NFSD patches to support junctions J. Bruce Fields
2011-09-08 18:24   ` J. Bruce Fields
2011-09-08 19:03     ` Chuck Lever
2011-09-08 19:21       ` J. Bruce Fields
2011-09-09  4:47         ` Chuck Lever
2011-09-09 12:06           ` J. Bruce Fields
  -- strict thread matches above, loose matches on Subject: below --
2011-09-12 23:36 [PATCH 0/3] NFSD support for FedFS junctions [v3] Chuck Lever
2011-09-12 23:37 ` [PATCH 3/3] NFSD: Add a cache for fs_locations information Chuck Lever
2011-09-13 13:16   ` Jeff Layton
2011-09-13 15:48     ` Jeff Layton
     [not found]       ` <20110913114830.7d163bab-9yPaYZwiELC+kQycOl6kW4xkIHaj4LzF@public.gmane.org>
2011-09-14  2:45         ` J. Bruce Fields
     [not found]   ` <20110912233726.5080.20512.stgit-RytpoXr2tKZ9HhUboXbp9zCvJB+x5qRC@public.gmane.org>
2011-09-14  2:44     ` J. Bruce Fields

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=20110908182149.GC16740@fieldses.org \
    --to=bfields@fieldses.org \
    --cc=chuck.lever@oracle.com \
    --cc=linux-nfs@vger.kernel.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;
as well as URLs for NNTP newsgroup(s).