From b99bd82f6b3bd64aefac8358569bf59c3dcca4b9 Mon Sep 17 00:00:00 2001 From: "Alexander.Zarochentev" Date: Thu, 11 Feb 2010 20:28:08 +0300 Subject: [PATCH] b=18030 dealock fix start the transaction earlier in llog_lvfs_destroy to get transaction start and inode mutex lock nested properly. i=adilger i=alex.zhuravlev --- lustre/obdclass/llog_lvfs.c | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/lustre/obdclass/llog_lvfs.c b/lustre/obdclass/llog_lvfs.c index d7f2c08..43d88a3 100644 --- a/lustre/obdclass/llog_lvfs.c +++ b/lustre/obdclass/llog_lvfs.c @@ -708,7 +708,9 @@ static int llog_lvfs_destroy(struct llog_handle *handle) struct obdo *oa; struct obd_device *obd = handle->lgh_ctxt->loc_exp->exp_obd; char *dir; - int rc; + void *th; + struct inode *inode; + int rc, rc1; ENTRY; /* COMPAT_146 */ @@ -719,8 +721,8 @@ static int llog_lvfs_destroy(struct llog_handle *handle) dir = MOUNT_CONFIGS_DIR; fdentry = handle->lgh_file->f_dentry; + inode = fdentry->d_parent->d_inode; if (strcmp(fdentry->d_parent->d_name.name, dir) == 0) { - struct inode *inode = fdentry->d_parent->d_inode; struct lvfs_run_ctxt saved; struct vfsmount *mnt = mntget(handle->lgh_file->f_vfsmnt); @@ -753,7 +755,17 @@ static int llog_lvfs_destroy(struct llog_handle *handle) if (rc) GOTO(out, rc); + th = fsfilt_start_log(obd, inode, FSFILT_OP_UNLINK, NULL, 1); + if (IS_ERR(th)) { + CERROR("fsfilt_start failed: %ld\n", PTR_ERR(th)); + GOTO(out, rc = PTR_ERR(th)); + } + rc = obd_destroy(handle->lgh_ctxt->loc_exp, oa, NULL, NULL, NULL); + + rc1 = fsfilt_commit(obd, inode, th, 0); + if (rc == 0 && rc1 != 0) + rc = rc1; out: OBDO_FREE(oa); RETURN(rc); -- 1.8.3.1