[PATCH] Fix reference counting in __find_device_hash_cell()

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

 



When the device is created but it hasn't yet been inserted into the hash list
a concurrent call to __find_device_hash_cell() was failing to release the
reference to the mapped device.

Signed-off-by: Jan Blunck <jblunck@xxxxxxx>
---
 drivers/md/dm-ioctl.c |    2 ++
 1 file changed, 2 insertions(+)

Index: linux-2.6.18/drivers/md/dm-ioctl.c
===================================================================
--- linux-2.6.18.orig/drivers/md/dm-ioctl.c
+++ linux-2.6.18/drivers/md/dm-ioctl.c
@@ -608,6 +608,8 @@ static struct hash_cell *__find_device_h
 	md = dm_get_md(huge_decode_dev(param->dev));
 	if (md)
 		mdptr = dm_get_mdptr(md);
+	if (md && !mdptr)
+		dm_put(md);
 
 	return mdptr;
 }

--
dm-devel mailing list
dm-devel@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/dm-devel

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

  Powered by Linux