public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: "J. Bruce Fields" <bfields@fieldses.org>
To: Aditya Pakki <pakki001@umn.edu>
Cc: kjlu@umn.edu, Chuck Lever <chuck.lever@oracle.com>,
	linux-nfs@vger.kernel.org, linux-kernel@vger.kernel.org,
	Christoph Hellwig <hch@lst.de>
Subject: Re: [PATCH] nfsd: remove unnecessary assertion in nfsd4_layout_setlease
Date: Fri, 3 Jan 2020 10:43:09 -0500	[thread overview]
Message-ID: <20200103154309.GA23945@fieldses.org> (raw)
In-Reply-To: <20191226203733.27808-1-pakki001@umn.edu>

It took me a minute to see how fl can even fail to be NULL, since we
just accessed fields of fl.

OK, I see, &fl is passed to vfs_setlease, so it can change the value of
fl.

Looks like generic_addlease() clears flp on success, unless it finds an
existing non-conflicting lease?  I'm not clear why nfsd4_layout_setlease
knows it can't hit that case.

In any case, I don't see why this assertion is redundant; leaving it
there.

--b.

On Thu, Dec 26, 2019 at 02:37:33PM -0600, Aditya Pakki wrote:
> In nfsd4_layout_setlease, checking for a valid file lock is
> redundant and can be removed. This patch eliminates such a
> BUG_ON check.
> 
> Signed-off-by: Aditya Pakki <pakki001@umn.edu>
> ---
>  fs/nfsd/nfs4layouts.c | 1 -
>  1 file changed, 1 deletion(-)
> 
> diff --git a/fs/nfsd/nfs4layouts.c b/fs/nfsd/nfs4layouts.c
> index 2681c70283ce..ef5f8e645f4f 100644
> --- a/fs/nfsd/nfs4layouts.c
> +++ b/fs/nfsd/nfs4layouts.c
> @@ -204,7 +204,6 @@ nfsd4_layout_setlease(struct nfs4_layout_stateid *ls)
>  		locks_free_lock(fl);
>  		return status;
>  	}
> -	BUG_ON(fl != NULL);
>  	return 0;
>  }
>  
> -- 
> 2.20.1

      reply	other threads:[~2020-01-03 15:43 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-12-26 20:37 [PATCH] nfsd: remove unnecessary assertion in nfsd4_layout_setlease Aditya Pakki
2020-01-03 15:43 ` J. Bruce Fields [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=20200103154309.GA23945@fieldses.org \
    --to=bfields@fieldses.org \
    --cc=chuck.lever@oracle.com \
    --cc=hch@lst.de \
    --cc=kjlu@umn.edu \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-nfs@vger.kernel.org \
    --cc=pakki001@umn.edu \
    /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