All of lore.kernel.org
 help / color / mirror / Atom feed
From: Benny Halevy <bhalevy@panasas.com>
To: andros@netapp.com
Cc: bfields@fieldses.org, linux-nfs@vger.kernel.org, pnfs@linux-nfs.org
Subject: Re: [pnfs] [PATCH 1/1] pnfsd: fix ex_pnfs check_export bug
Date: Thu, 10 Dec 2009 00:32:24 +0200	[thread overview]
Message-ID: <4B202578.80701@panasas.com> (raw)
In-Reply-To: <1260392673-4971-1-git-send-email-andros@netapp.com>

Merged.  Thanks!

Benny

On Dec. 09, 2009, 23:04 +0200, andros@netapp.com wrote:
> From: Andy Adamson <andros@netapp.com>
> 
> Export option strings are not guaranteed to be present in every call to
> svc_export_parse. For example, nfs-utils-1.1.2 exportfs validates the export
> with a test call that does not include the 'pnfs' export option even though
> it is set in /etc/exports.
> 
> nfsd4_layout_verify() checks if ex_pnfs is set so the ex_pnfs check in
> check_export is not needed.
> 
> Furthermore,the pnfs_export_operations super block pointer should not be
> changed because a) it is a const and b) the exports options can be changed
> while the file system is mounted.
> 
> Remove the ex_pnfs check from check_export to prevent the pnfs_export_operations
> superblock pointer from being set to NULL.
> 
> Signed-off-by: Andy Adamson <andros@netapp.com>
> ---
>  fs/nfsd/export.c |   15 +++------------
>  1 files changed, 3 insertions(+), 12 deletions(-)
> 
> diff --git a/fs/nfsd/export.c b/fs/nfsd/export.c
> index ddd12d8..8243f2d 100644
> --- a/fs/nfsd/export.c
> +++ b/fs/nfsd/export.c
> @@ -382,8 +382,7 @@ static struct svc_export *svc_export_update(struct svc_export *new,
>  					    struct svc_export *old);
>  static struct svc_export *svc_export_lookup(struct svc_export *);
>  
> -static int check_export(struct inode *inode, int flags, unsigned char *uuid,
> -			bool ex_pnfs)
> +static int check_export(struct inode *inode, int flags, unsigned char *uuid)
>  {
>  
>  	/* We currently export only dirs and regular files.
> @@ -413,14 +412,6 @@ static int check_export(struct inode *inode, int flags, unsigned char *uuid,
>  		return -EINVAL;
>  	}
>  
> -	dprintk("%s: s_pnfs_op %p ex_pnfs %d\n", __func__,
> -		inode->i_sb->s_pnfs_op, ex_pnfs);
> -
> -	if (!ex_pnfs) {
> -		inode->i_sb->s_pnfs_op = NULL;
> -		return 0;
> -	}
> -
>  	if (inode->i_sb->s_pnfs_op &&
>  	    (!inode->i_sb->s_pnfs_op->layout_type ||
>  	     !inode->i_sb->s_pnfs_op->get_device_info ||
> @@ -635,7 +626,7 @@ static int svc_export_parse(struct cache_detail *cd, char *mesg, int mlen)
>  		}
>  
>  		err = check_export(exp.ex_path.dentry->d_inode, exp.ex_flags,
> -				   exp.ex_uuid, exp.ex_pnfs);
> +				   exp.ex_uuid);
>  		if (err)
>  			goto out4;
>  	}
> @@ -1077,7 +1068,7 @@ exp_export(struct nfsctl_export *nxp)
>  		goto finish;
>  	}
>  
> -	err = check_export(path.dentry->d_inode, nxp->ex_flags, NULL, false);
> +	err = check_export(path.dentry->d_inode, nxp->ex_flags, NULL);
>  	if (err) goto finish;
>  
>  	err = -ENOMEM;

      reply	other threads:[~2009-12-09 22:32 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-12-09 21:04 [PATCH 1/1] pnfsd: fix ex_pnfs check_export bug andros
2009-12-09 22:32 ` Benny Halevy [this message]

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=4B202578.80701@panasas.com \
    --to=bhalevy@panasas.com \
    --cc=andros@netapp.com \
    --cc=bfields@fieldses.org \
    --cc=linux-nfs@vger.kernel.org \
    --cc=pnfs@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.