DMF_FREEING flag checking

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

 



Hi,

I think we need to check, in __get_uuid_cell() , DMF_FREEING flag, to cover the race condition that we are trying to get the device while others is freeing (or have freed) it, same check is needed in __get_name_cell()...

I noticed that the latest code does NOT check for this, does anyone know the reason for this? Or this is a potential bug?

static struct hash_cell *__get_uuid_cell(const char *str)
{
        + struct mapped_device *md = NULL;

        list_for_each_entry (hc, _uuid_buckets + h, uuid_list)
                + md = hc->md; 
                + if ((!strcmp(hc->uuid, str)) &&
                +   (md) && (!(test_bit(DMF_FREEING, &md->flags)))) {

                - if (!strcmp(hc->uuid, str)) {
                        dm_get(hc->md);
}

Thanks for the information
Mai


Looking for last minute shopping deals? Find them fast with Yahoo! Search.
--
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