All of lore.kernel.org
 help / color / mirror / Atom feed
From: "J. Bruce Fields" <bfields@fieldses.org>
To: Jeff Layton <jlayton@poochiereds.net>
Cc: steved@redhat.com, neilb@suse.de, linux-nfs@vger.kernel.org
Subject: Re: [RFC PATCH 2/2] exportfs: vet exports for subtree checking when testing the export fails
Date: Wed, 18 Nov 2015 13:05:07 -0500	[thread overview]
Message-ID: <20151118180507.GC32424@fieldses.org> (raw)
In-Reply-To: <1447865430-28434-2-git-send-email-jeff.layton@primarydata.com>

On Wed, Nov 18, 2015 at 11:50:30AM -0500, Jeff Layton wrote:
> I have a proposed kernel patch that would allow filesystems (such as
> NFS) to opt out of subtree checking when they are exported. We do want
> to warn people at export time however if that doesn't work. If we issued
> a test_export that fails and don't have NFSEXP_NOSUBTREECHECK already set
> in it, then try it again with that set. If that works then we know that
> the filesystem requires NFSEXP_NOSUBTREECHECK be set.

Makes sense to me, ACK.--b.

> 
> Cc: Neil Brown <neilb@suse.de>
> Signed-off-by: Jeff Layton <jeff.layton@primarydata.com>
> ---
>  utils/exportfs/exportfs.c | 25 ++++++++++++++++++-------
>  1 file changed, 18 insertions(+), 7 deletions(-)
> 
> diff --git a/utils/exportfs/exportfs.c b/utils/exportfs/exportfs.c
> index cac01fc25f9a..1b704e85c024 100644
> --- a/utils/exportfs/exportfs.c
> +++ b/utils/exportfs/exportfs.c
> @@ -557,6 +557,20 @@ static int test_export(char *path, int opts)
>  }
>  
>  static void
> +validate_subtree_check(nfs_export *exp)
> +{
> +	char *path = exp->m_export.e_path;
> +
> +	if (!(exp->m_export.e_flags & NFSEXP_NOSUBTREECHECK)) {
> +		if (test_export(path, exp->m_export.e_flags | NFSEXP_NOSUBTREECHECK)) {
> +			xlog(L_ERROR, "%s does not support subtree checking", path);
> +			return;
> +		}
> +	}
> +	xlog(L_ERROR, "%s does not support NFS export", path);
> +}
> +
> +static void
>  validate_export(nfs_export *exp)
>  {
>  	/* Check that the given export point is potentially exportable.
> @@ -587,16 +601,13 @@ validate_export(nfs_export *exp)
>  
>  	if ((exp->m_export.e_flags & NFSEXP_FSID) || exp->m_export.e_uuid ||
>  	    fs_has_fsid) {
> -		if ( !test_export(path, exp->m_export.e_flags)) {
> -			xlog(L_ERROR, "%s does not support NFS export", path);
> -			return;
> -		}
> -	} else if ( ! test_export(path, exp->m_export.e_flags)) {
> +		if (!test_export(path, exp->m_export.e_flags))
> +			validate_subtree_check(exp);
> +	} else if (!test_export(path, exp->m_export.e_flags)) {
>  		if (test_export(path, exp->m_export.e_flags & NFSEXP_FSID))
>  			xlog(L_ERROR, "%s requires fsid= for NFS export", path);
>  		else
> -			xlog(L_ERROR, "%s does not support NFS export", path);
> -		return;
> +			validate_subtree_check(exp);
>  
>  	}
>  }
> -- 
> 2.4.3

  reply	other threads:[~2015-11-18 18:05 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-11-18 16:50 [RFC PATCH 1/2] exportfs: pass export option flags to the kernel when testing export Jeff Layton
2015-11-18 16:50 ` [RFC PATCH 2/2] exportfs: vet exports for subtree checking when testing the export fails Jeff Layton
2015-11-18 18:05   ` J. Bruce Fields [this message]
2015-11-18 19:16 ` [RFC PATCH 1/2] exportfs: pass export option flags to the kernel when testing export Jeff Layton
2015-11-18 19:19   ` Steve Dickson

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=20151118180507.GC32424@fieldses.org \
    --to=bfields@fieldses.org \
    --cc=jlayton@poochiereds.net \
    --cc=linux-nfs@vger.kernel.org \
    --cc=neilb@suse.de \
    --cc=steved@redhat.com \
    /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.