mirror of
https://git.proxmox.com/git/mirror_zfs.git
synced 2026-05-22 18:40:43 +03:00
Fix race in rwlock implementation which can occur when
your task is rescheduled to a different cpu after you've taken the lock but before calling RW_LOCK_HELD is called. We need the spinlock to ensure there is a wmb() there. git-svn-id: https://outreach.scidac.gov/svn/spl/trunk@68 7e1ea52c-4ff2-0310-8f11-9dd32ca42a1c
This commit is contained in:
@@ -163,6 +163,8 @@ rw_tryenter(krwlock_t *rwlp, krw_t rw)
|
||||
rwlp->rw_owner = current;
|
||||
}
|
||||
break;
|
||||
default:
|
||||
BUG_ON(1);
|
||||
}
|
||||
|
||||
return result;
|
||||
@@ -193,6 +195,8 @@ rw_enter(krwlock_t *rwlp, krw_t rw)
|
||||
BUG_ON(rwlp->rw_owner != NULL);
|
||||
rwlp->rw_owner = current;
|
||||
break;
|
||||
default:
|
||||
BUG_ON(1);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user