From: phil Date: Wed, 13 Aug 2003 18:19:25 +0000 (+0000) Subject: b=1592 X-Git-Tag: 0.9.1~368 X-Git-Url: https://git.whamcloud.com/?a=commitdiff_plain;h=374e8d1e867ee9a9c21b9835cd135271a299089d;p=fs%2Flustre-release.git b=1592 Read past EOF would clear res->dentry in preprw; we would oops trying to dput it in commitrw. Fixed. --- diff --git a/lustre/obdfilter/filter_io.c b/lustre/obdfilter/filter_io.c index c4754ae..c13b986 100644 --- a/lustre/obdfilter/filter_io.c +++ b/lustre/obdfilter/filter_io.c @@ -301,7 +301,6 @@ static int filter_preprw_read(int cmd, struct obd_export *exp, struct obdo *oa, /* If there's no more data, abort early. * lnb->page == NULL and lnb->rc == 0, so it's * easy to detect later. */ - lnb->dentry = NULL; break; } else { rc = filter_start_page_read(inode, lnb); @@ -352,7 +351,11 @@ static int filter_preprw_read(int cmd, struct obd_export *exp, struct obdo *oa, if (lnb->page) page_cache_release(lnb->page); } - f_dput(res->dentry); + if (res->dentry != NULL) + f_dput(res->dentry); + else + CERROR("NULL dentry in cleanup -- tell CFS\n"); + res->dentry = NULL; case 0: OBD_FREE(fso, objcount * sizeof(*fso)); pop_ctxt(&saved, &exp->exp_obd->u.filter.fo_ctxt, NULL); @@ -613,7 +616,8 @@ static int filter_commitrw_read(struct obd_export *exp, int objcount, page_cache_release(lnb->page); } } - f_dput(res->dentry); + if (res->dentry != NULL) + f_dput(res->dentry); RETURN(0); }