Project

General

Profile

Bug #583

dsl_dataset_clone_swap's recursive locking prevention is a hack

Added by Albert Lee almost 10 years ago. Updated almost 10 years ago.

Status:
New
Priority:
Low
Assignee:
-
Category:
kernel
Start date:
2010-12-29
Due date:
% Done:

0%

Estimated time:
Difficulty:
Tags:
Gerrit CR:

Description

dsl_dataset_clone_swap tries to prevent recursive locking attempts but use the assumption (fortunately correct) that the current thread is the only owner for writes. The lock order is also sketchy.
Gordon Ross says:

Using RW_WRITE_HELD here could easily mask other bugs.
Also, trying for the two locks first in one order, and then in the reverse order is sloppy.
Would be better to always take these two locks in order of memory address.
(That's a trick used elsewhere in fs code, i.e. in NFS.)

Also available in: Atom PDF