2006-02-24 17:26:17

by Junichi Nomura

[permalink] [raw]
Subject: [PATCH] dm free minor after unlink gendisk

Hello,

free_dev() releases minor number before unregistering gendisk.
It creates a window where two registered gendisk with same number
exist, which will cause problem.

Typically, if you run the following script,
you will hit WARN_ON() in kref_get().

#!/bin/sh
(while dmsetup create a --notable; do dmsetup remove a; done) &
(while dmsetup create b --notable; do dmsetup remove b; done) &

Attached patch fixes this problem.

--
Jun'ichi Nomura, NEC Solutions (America), Inc.


Attachments:
dm-free-minor-after-del_gendisk.patch (813.00 B)