[dm-devel] [patch] dm-raid1.c a race bug in rh_dec()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



patch here to avoid race condition:
 
[root@darkstar md]# diff -u dm-raid1.orig.c dm-raid1.c
--- dm-raid1.orig.c     2005-06-16 14:17:04.000000000 +0800
+++ dm-raid1.c  2005-06-16 14:18:25.000000000 +0800
@@ -404,7 +404,6 @@
 
        read_lock(&rh->hash_lock);
        reg = __rh_lookup(rh, region);
-       read_unlock(&rh->hash_lock);
 
        if (atomic_dec_and_test(&reg->pending)) {
                spin_lock_irqsave(&rh->region_lock, flags);
@@ -418,6 +417,7 @@
                should_wake = 1;
        }
 
+       read_unlock(&rh->hash_lock);
        if (should_wake)
                wake();
 }
 
 
 
Sincerely,
    AiM9 <zhaoqian@xxxxxxxxxxx>

[Index of Archives]     [DM Crypt]     [Fedora Desktop]     [ATA RAID]     [Fedora Marketing]     [Fedora Packaging]     [Fedora SELinux]     [Yosemite Discussion]     [KDE Users]     [Fedora Docs]

  Powered by Linux