Whamcloud - gitweb
Branch HEAD
authorbobijam <bobijam>
Wed, 9 Jul 2008 01:27:06 +0000 (01:27 +0000)
committerbobijam <bobijam>
Wed, 9 Jul 2008 01:27:06 +0000 (01:27 +0000)
b=15825
o=green
i=shadow, bobijam

Description: Kernel BUG tries to release flock
Details    : Lustre does not destroy flock lock before last reference goes
             away. So always drop flock locks when client is evicted and
             perform unlock regardless of successfulness of speaking to MDS.

lustre/ChangeLog
lustre/ldlm/ldlm_lock.c
lustre/llite/file.c

index e024b38..1cc6c48 100644 (file)
@@ -13,6 +13,13 @@ tbd  Sun Microsystems, Inc.
         removed cwd "./" (refer to Bugzilla 14399).
 
 Severity   : normal
         removed cwd "./" (refer to Bugzilla 14399).
 
 Severity   : normal
+Bugzilla   : 15825
+Description: Kernel BUG tries to release flock
+Details    : Lustre does not destroy flock lock before last reference goes
+             away. So always drop flock locks when client is evicted and 
+            perform unlock regardless of successfulness of speaking to MDS.
+
+Severity   : normal
 Bugzilla   : 15210
 Description: add recount protection for osc callbacks, so avoid panic on shutdown
 
 Bugzilla   : 15210
 Description: add recount protection for osc callbacks, so avoid panic on shutdown
 
index bb29ae3..dfe1a17 100644 (file)
@@ -193,6 +193,7 @@ void ldlm_lock_add_to_lru_nolock(struct ldlm_lock *lock)
         struct ldlm_namespace *ns = lock->l_resource->lr_namespace;
         lock->l_last_used = cfs_time_current();
         LASSERT(list_empty(&lock->l_lru));
         struct ldlm_namespace *ns = lock->l_resource->lr_namespace;
         lock->l_last_used = cfs_time_current();
         LASSERT(list_empty(&lock->l_lru));
+        LASSERT(lock->l_resource->lr_type != LDLM_FLOCK);
         list_add_tail(&lock->l_lru, &ns->ns_unused_list);
         LASSERT(ns->ns_nr_unused >= 0);
         ns->ns_nr_unused++;
         list_add_tail(&lock->l_lru, &ns->ns_unused_list);
         LASSERT(ns->ns_nr_unused >= 0);
         ns->ns_nr_unused++;
index 82f78c7..41f2723 100644 (file)
@@ -2662,10 +2662,12 @@ int ll_file_flock(struct file *file, int cmd, struct file_lock *file_lock)
 
         rc = ldlm_cli_enqueue(sbi->ll_md_exp, NULL, &einfo, &res_id,
                               &flock, &flags, NULL, 0, NULL, &lockh, 0);
 
         rc = ldlm_cli_enqueue(sbi->ll_md_exp, NULL, &einfo, &res_id,
                               &flock, &flags, NULL, 0, NULL, &lockh, 0);
-        if ((file_lock->fl_flags & FL_FLOCK) && (rc == 0))
+        if ((file_lock->fl_flags & FL_FLOCK) &&
+            (rc == 0 || file_lock->fl_type == F_UNLCK))
                 ll_flock_lock_file_wait(file, file_lock, (cmd == F_SETLKW));
 #ifdef HAVE_F_OP_FLOCK
                 ll_flock_lock_file_wait(file, file_lock, (cmd == F_SETLKW));
 #ifdef HAVE_F_OP_FLOCK
-        if ((file_lock->fl_flags & FL_POSIX) && (rc == 0) &&
+        if ((file_lock->fl_flags & FL_POSIX) &&
+            (rc == 0 || file_lock->fl_type == F_UNLCK) &&
             !(flags & LDLM_FL_TEST_LOCK))
                 posix_lock_file_wait(file, file_lock);
 #endif
             !(flags & LDLM_FL_TEST_LOCK))
                 posix_lock_file_wait(file, file_lock);
 #endif