From: ericm Date: Thu, 15 Jan 2004 11:48:18 +0000 (+0000) Subject: liblustre: X-Git-Tag: v1_7_0_51~2^7~117 X-Git-Url: https://git.whamcloud.com/?a=commitdiff_plain;h=f9510a4b94c064dc5b99c3dd4f58be6fb7a472d4;p=fs%2Flustre-release.git liblustre: - forward fix #2451 - other minor fix --- diff --git a/lustre/liblustre/namei.c b/lustre/liblustre/namei.c index f19a342..1c00634 100644 --- a/lustre/liblustre/namei.c +++ b/lustre/liblustre/namei.c @@ -42,25 +42,31 @@ #include "llite_lib.h" -static void ll_intent_release(struct lookup_intent *it) +static void ll_intent_drop_lock(struct lookup_intent *it) { struct lustre_handle *handle; - ENTRY; - if (it->d.lustre.it_lock_mode) { + if (it->it_op && it->d.lustre.it_lock_mode) { handle = (struct lustre_handle *)&it->d.lustre.it_lock_handle; CDEBUG(D_DLMTRACE, "releasing lock with cookie "LPX64 - " from it %p\n", - handle->cookie, it); + " from it %p\n", handle->cookie, it); ldlm_lock_decref(handle, it->d.lustre.it_lock_mode); - /* intent_release may be called multiple times, from - this thread and we don't want to double-decref this - lock (see bug 494) */ + /* bug 494: intent_release may be called multiple times, from + * this thread and we don't want to double-decref this lock */ it->d.lustre.it_lock_mode = 0; } +} + +static void ll_intent_release(struct lookup_intent *it) +{ + ENTRY; + + ll_intent_drop_lock(it); it->it_magic = 0; it->it_op_release = 0; + it->d.lustre.it_disposition = 0; + it->d.lustre.it_data = NULL; EXIT; } @@ -343,6 +349,9 @@ static int lookup_it_finish(struct ptlrpc_request *request, int offset, LASSERT(lsm->lsm_object_id != 0); + /* bug 2334: drop MDS lock before acquiring OST lock */ + ll_intent_drop_lock(it); + rc = llu_extent_lock(NULL, inode, lsm, LCK_PR, &extent, &lockh); if (rc != ELDLM_OK) { diff --git a/lustre/liblustre/tests/sanity.c b/lustre/liblustre/tests/sanity.c index 5713e4b..391dd3d 100644 --- a/lustre/liblustre/tests/sanity.c +++ b/lustre/liblustre/tests/sanity.c @@ -426,7 +426,6 @@ int main(int argc, char * const argv[]) while ((c = getopt_long(argc, argv, "", long_opts, &opt_index)) != -1) { switch (c) { case 0: { - printf("optindex %d\n", opt_index); if (!optarg[0]) usage(argv[0]);