Message ID | 1374094217-31493-15-git-send-email-bfields@redhat.com (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
On Wed, 17 Jul 2013 16:50:14 -0400 "J. Bruce Fields" <bfields@redhat.com> wrote: > From: "J. Bruce Fields" <bfields@redhat.com> > > As far as I can tell, this list is used only under the state lock, so we > may as well do this in the simpler order. > > Signed-off-by: J. Bruce Fields <bfields@redhat.com> > --- > fs/nfsd/nfs4state.c | 12 ++++++------ > 1 file changed, 6 insertions(+), 6 deletions(-) > > diff --git a/fs/nfsd/nfs4state.c b/fs/nfsd/nfs4state.c > index 1698816..7c91b6c 100644 > --- a/fs/nfsd/nfs4state.c > +++ b/fs/nfsd/nfs4state.c > @@ -3028,18 +3028,18 @@ static int nfs4_setlease(struct nfs4_delegation *dp) > if (!fl) > return -ENOMEM; > fl->fl_file = find_readable_file(fp); > - list_add(&dp->dl_perclnt, &dp->dl_stid.sc_client->cl_delegations); > status = vfs_setlease(fl->fl_file, fl->fl_type, &fl); > - if (status) { > - list_del_init(&dp->dl_perclnt); > - locks_free_lock(fl); > - return -ENOMEM; > - } > + if (status) > + goto out_free; > + list_add(&dp->dl_perclnt, &dp->dl_stid.sc_client->cl_delegations); > fp->fi_lease = fl; > fp->fi_deleg_file = get_file(fl->fl_file); > atomic_set(&fp->fi_delegees, 1); > list_add(&dp->dl_perfile, &fp->fi_delegations); > return 0; > +out_free: > + locks_free_lock(fl); > + return -ENOMEM; > } > > static int nfs4_set_delegation(struct nfs4_delegation *dp) Acked-by: Jeff Layton <jlayton@redhat.com> -- 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 --git a/fs/nfsd/nfs4state.c b/fs/nfsd/nfs4state.c index 1698816..7c91b6c 100644 --- a/fs/nfsd/nfs4state.c +++ b/fs/nfsd/nfs4state.c @@ -3028,18 +3028,18 @@ static int nfs4_setlease(struct nfs4_delegation *dp) if (!fl) return -ENOMEM; fl->fl_file = find_readable_file(fp); - list_add(&dp->dl_perclnt, &dp->dl_stid.sc_client->cl_delegations); status = vfs_setlease(fl->fl_file, fl->fl_type, &fl); - if (status) { - list_del_init(&dp->dl_perclnt); - locks_free_lock(fl); - return -ENOMEM; - } + if (status) + goto out_free; + list_add(&dp->dl_perclnt, &dp->dl_stid.sc_client->cl_delegations); fp->fi_lease = fl; fp->fi_deleg_file = get_file(fl->fl_file); atomic_set(&fp->fi_delegees, 1); list_add(&dp->dl_perfile, &fp->fi_delegations); return 0; +out_free: + locks_free_lock(fl); + return -ENOMEM; } static int nfs4_set_delegation(struct nfs4_delegation *dp)