diff mbox

[v5,11/10] nfsd: set fl->fl_file properly in nfs4_setlease

Message ID 1405971973-10029-1-git-send-email-jlayton@primarydata.com (mailing list archive)
State New, archived
Headers show

Commit Message

Jeff Layton July 21, 2014, 7:46 p.m. UTC
We must set the fl->fl_file properly for the lease, or there will be
trouble when the lease gets removed.

Longer term, it would probably make sense to set fl_file during the
setlease call, since we pass it in, but this should work around the
immediate oops that I've been seeing.

Signed-off-by: Jeff Layton <jlayton@primarydata.com>
---
 fs/nfsd/nfs4state.c | 1 +
 1 file changed, 1 insertion(+)

Comments

Jeff Layton July 21, 2014, 7:54 p.m. UTC | #1
On Mon, 21 Jul 2014 15:46:13 -0400
Jeff Layton <jlayton@primarydata.com> wrote:

> We must set the fl->fl_file properly for the lease, or there will be
> trouble when the lease gets removed.
> 
> Longer term, it would probably make sense to set fl_file during the
> setlease call, since we pass it in, but this should work around the
> immediate oops that I've been seeing.
> 
> Signed-off-by: Jeff Layton <jlayton@primarydata.com>
> ---
>  fs/nfsd/nfs4state.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/fs/nfsd/nfs4state.c b/fs/nfsd/nfs4state.c
> index 3946a5a9459c..b21319816b89 100644
> --- a/fs/nfsd/nfs4state.c
> +++ b/fs/nfsd/nfs4state.c
> @@ -3514,6 +3514,7 @@ static int nfs4_setlease(struct nfs4_delegation *dp)
>  		WARN_ON_ONCE(1);
>  		return -EBADF;
>  	}
> +	fl->fl_file = filp;
>  	status = vfs_setlease(filp, fl->fl_type, &fl);
>  	if (status) {
>  		locks_free_lock(fl);

Obviously, this should ideally be squashed into patch #1 in the series
I sent this morning to prevent regressions. Bruce, can you fix that up
or do I need to resend?

Thanks,
J. Bruce Fields July 21, 2014, 8 p.m. UTC | #2
On Mon, Jul 21, 2014 at 03:54:42PM -0400, Jeff Layton wrote:
> On Mon, 21 Jul 2014 15:46:13 -0400
> Jeff Layton <jlayton@primarydata.com> wrote:
> 
> > We must set the fl->fl_file properly for the lease, or there will be
> > trouble when the lease gets removed.
> > 
> > Longer term, it would probably make sense to set fl_file during the
> > setlease call, since we pass it in, but this should work around the
> > immediate oops that I've been seeing.
> > 
> > Signed-off-by: Jeff Layton <jlayton@primarydata.com>
> > ---
> >  fs/nfsd/nfs4state.c | 1 +
> >  1 file changed, 1 insertion(+)
> > 
> > diff --git a/fs/nfsd/nfs4state.c b/fs/nfsd/nfs4state.c
> > index 3946a5a9459c..b21319816b89 100644
> > --- a/fs/nfsd/nfs4state.c
> > +++ b/fs/nfsd/nfs4state.c
> > @@ -3514,6 +3514,7 @@ static int nfs4_setlease(struct nfs4_delegation *dp)
> >  		WARN_ON_ONCE(1);
> >  		return -EBADF;
> >  	}
> > +	fl->fl_file = filp;
> >  	status = vfs_setlease(filp, fl->fl_type, &fl);
> >  	if (status) {
> >  		locks_free_lock(fl);
> 
> Obviously, this should ideally be squashed into patch #1 in the series
> I sent this morning to prevent regressions. Bruce, can you fix that up
> or do I need to resend?

I'll take care of it, thanks!

--b.
--
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
diff mbox

Patch

diff --git a/fs/nfsd/nfs4state.c b/fs/nfsd/nfs4state.c
index 3946a5a9459c..b21319816b89 100644
--- a/fs/nfsd/nfs4state.c
+++ b/fs/nfsd/nfs4state.c
@@ -3514,6 +3514,7 @@  static int nfs4_setlease(struct nfs4_delegation *dp)
 		WARN_ON_ONCE(1);
 		return -EBADF;
 	}
+	fl->fl_file = filp;
 	status = vfs_setlease(filp, fl->fl_type, &fl);
 	if (status) {
 		locks_free_lock(fl);