X-Git-Url: https://git.whamcloud.com/?p=fs%2Flustre-release.git;a=blobdiff_plain;f=ldiskfs%2Fkernel_patches%2Fpatches%2Fubuntu14%2B16%2Fext4-pdirop.patch;h=81ee18060ae085f09908cfd83e16a6defc410aef;hp=71b27381df60fae5966d92e29473d5f8953bbdaa;hb=892f62c7a20d87954744c6c8937960379a870992;hpb=3e9fedfa7ea52a03a1975572ab37cc1ae9344a8a diff --git a/ldiskfs/kernel_patches/patches/ubuntu14+16/ext4-pdirop.patch b/ldiskfs/kernel_patches/patches/ubuntu14+16/ext4-pdirop.patch index 71b2738..81ee180 100644 --- a/ldiskfs/kernel_patches/patches/ubuntu14+16/ext4-pdirop.patch +++ b/ldiskfs/kernel_patches/patches/ubuntu14+16/ext4-pdirop.patch @@ -126,7 +126,7 @@ new file mode 100644 index 0000000..99e7375 --- /dev/null +++ b/fs/ext4/htree_lock.c -@@ -0,0 +1,880 @@ +@@ -0,0 +1,891 @@ +/* + * fs/ext4/htree_lock.c + * @@ -768,12 +768,23 @@ index 0000000..99e7375 + lck->lk_task = current; + list_add_tail(&lck->lk_blocked_list, &lhead->lh_blocked_list); + ++retry: + set_current_state(TASK_UNINTERRUPTIBLE); + htree_spin_unlock(lhead, HTREE_DEP_ROOT); + /* wait to be given the lock */ + if (lck->lk_task != NULL) + schedule(); -+ /* granted, no doubt. wake up will set me RUNNING */ ++ /* granted, no doubt. wake up will set me RUNNING. ++ * Since thread would be waken up accidentally, ++ * so we need check lock whether granted or not again. */ ++ if (!list_empty(&lck->lk_blocked_list)) { ++ htree_spin_lock(lhead, HTREE_DEP_ROOT); ++ if (list_empty(&lck->lk_blocked_list)) { ++ htree_spin_unlock(lhead, HTREE_DEP_ROOT); ++ return 0; ++ } ++ goto retry; ++ } + return 0; /* without lh_lock */ + } + lhead->lh_ngranted[lck->lk_mode]++;