From: adilger Date: Fri, 8 Mar 2002 20:30:34 +0000 (+0000) Subject: Don't try to close file pointer if there was an error opening it. X-Git-Tag: 0.4.2~551 X-Git-Url: https://git.whamcloud.com/?a=commitdiff_plain;h=ff9f3b681a021f2e6ef2b23bcca9c708a5a29945;p=fs%2Flustre-release.git Don't try to close file pointer if there was an error opening it. --- diff --git a/lustre/obdfilter/filter.c b/lustre/obdfilter/filter.c index 7e8cf22..bc0570e 100644 --- a/lustre/obdfilter/filter.c +++ b/lustre/obdfilter/filter.c @@ -550,15 +550,17 @@ static int filter_destroy(struct obd_conn *conn, struct obdo *oa) filter_id(id, oa->o_id, oa->o_mode); push_ctxt(&saved, &obddev->u.filter.fo_ctxt); - dir = filter_parent(oa->o_id, oa->o_mode); - if (!dir || IS_ERR(dir)) { + dir = filter_parent(oa->o_id, oa->o_mode); + if (IS_ERR(dir)) { + rc = PTR_ERR(dir); + EXIT; goto out; } rc = simple_unlink(dir->f_dentry, id); - - out: - filp_close(dir, 0); + + filp_close(dir, 0); +out: pop_ctxt(&saved); EXIT; return rc;