Message ID | 559672B7.4010802@gmail.com (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
On Fri, Jul 03, 2015 at 07:32:07PM +0800, Kinglong Mee wrote: > If nfsd4_layout_setlease fail, nfsd will not put ls->ls_file. > > Fix commit c5c707f96f "nfsd: implement pNFS layout recalls". > > Signed-off-by: Kinglong Mee <kinglongmee@gmail.com> > --- > fs/nfsd/nfs4layouts.c | 3 +-- > 1 file changed, 1 insertion(+), 2 deletions(-) > > diff --git a/fs/nfsd/nfs4layouts.c b/fs/nfsd/nfs4layouts.c > index 6904213..367a65a 100644 > --- a/fs/nfsd/nfs4layouts.c > +++ b/fs/nfsd/nfs4layouts.c > @@ -212,8 +212,7 @@ nfsd4_alloc_layout_stateid(struct nfsd4_compound_state *cstate, > BUG_ON(!ls->ls_file); > > if (nfsd4_layout_setlease(ls)) { > - put_nfs4_file(fp); > - kmem_cache_free(nfs4_layout_stateid_cache, ls); > + nfs4_put_stid(stp); Hm, is the stateid really completely enough set up that this is safe? Looking at nfsd4_free_layout_stateid.... OK, the unnecessary lease unlock and tracepoint are a bit ugly bug I guess we can live with those. --b. > return NULL; > } > > -- > 2.4.3 -- 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
On Wed, Jul 08, 2015 at 05:30:15PM -0400, J. Bruce Fields wrote:
> Hm, is the stateid really completely enough set up that this is safe?
It's not. nfsd4_free_layout_stateid unconditionally deletes
from the per-client and per-file lists which are empty at this
point. Just adding an explicit fput would be the better fix.
--
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
On 7/9/2015 16:12, Christoph Hellwig wrote: > On Wed, Jul 08, 2015 at 05:30:15PM -0400, J. Bruce Fields wrote: >> Hm, is the stateid really completely enough set up that this is safe? > > It's not. nfsd4_free_layout_stateid unconditionally deletes > from the per-client and per-file lists which are empty at this > point. Just adding an explicit fput would be the better fix. > Got it. thanks, Kinglong Mee -- 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/nfs4layouts.c b/fs/nfsd/nfs4layouts.c index 6904213..367a65a 100644 --- a/fs/nfsd/nfs4layouts.c +++ b/fs/nfsd/nfs4layouts.c @@ -212,8 +212,7 @@ nfsd4_alloc_layout_stateid(struct nfsd4_compound_state *cstate, BUG_ON(!ls->ls_file); if (nfsd4_layout_setlease(ls)) { - put_nfs4_file(fp); - kmem_cache_free(nfs4_layout_stateid_cache, ls); + nfs4_put_stid(stp); return NULL; }
If nfsd4_layout_setlease fail, nfsd will not put ls->ls_file. Fix commit c5c707f96f "nfsd: implement pNFS layout recalls". Signed-off-by: Kinglong Mee <kinglongmee@gmail.com> --- fs/nfsd/nfs4layouts.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)