From: yury Date: Wed, 8 Nov 2006 08:30:42 +0000 (+0000) Subject: - fixed pssibly using freed och in ll_close_inode_openhandle(). X-Git-Tag: v1_8_0_110~486^2~209 X-Git-Url: https://git.whamcloud.com/?a=commitdiff_plain;h=116d68a3ea383db23e47c72156a1bfe10e7193ef;p=fs%2Flustre-release.git - fixed pssibly using freed och in ll_close_inode_openhandle(). --- diff --git a/lustre/llite/file.c b/lustre/llite/file.c index 585cefb..8307409 100644 --- a/lustre/llite/file.c +++ b/lustre/llite/file.c @@ -92,8 +92,8 @@ static int ll_close_inode_openhandle(struct obd_export *md_exp, struct md_op_data *op_data; struct ptlrpc_request *req = NULL; struct obd_device *obd; + int rc, clear_ord = 0; int epoch_close = 1; - int rc; ENTRY; obd = class_exp2obd(ll_i2mdexp(inode)); @@ -142,8 +142,11 @@ static int ll_close_inode_openhandle(struct obd_export *md_exp, inode->i_ino, rc); } - if (!epoch_close && (och->och_flags & FMODE_WRITE)) + if (!epoch_close && (och->och_flags & FMODE_WRITE)) { ll_queue_done_writing(inode, LLIF_DONE_WRITING); + md_clear_open_replay_data(md_exp, och); + clear_ord = 1; + } if (rc == 0) { rc = ll_objects_destroy(req, inode); @@ -155,7 +158,9 @@ static int ll_close_inode_openhandle(struct obd_export *md_exp, ptlrpc_req_finished(req); /* This is close request */ EXIT; out: - md_clear_open_replay_data(md_exp, och); + if (!clear_ord) + md_clear_open_replay_data(md_exp, och); + if (epoch_close || !(och->och_flags & FMODE_WRITE)) och->och_fh.cookie = DEAD_HANDLE_MAGIC; return rc; diff --git a/lustre/lmv/lmv_obd.c b/lustre/lmv/lmv_obd.c index 7982adb..d2b33e8 100644 --- a/lustre/lmv/lmv_obd.c +++ b/lustre/lmv/lmv_obd.c @@ -2534,7 +2534,8 @@ int lmv_clear_open_replay_data(struct obd_export *exp, RETURN(md_clear_open_replay_data(tgt_exp, och)); } -static int lmv_get_remote_perm(struct obd_export *exp, const struct lu_fid *fid, +static int lmv_get_remote_perm(struct obd_export *exp, + const struct lu_fid *fid, struct obd_capa *oc, struct ptlrpc_request **request) {