[dm-devel] DMF_FREEING flag checking

Mai N thumai9999 at yahoo.com
Mon Mar 10 04:23:09 UTC 2008


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.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://listman.redhat.com/archives/dm-devel/attachments/20080309/93181fb4/attachment.htm>


More information about the dm-devel mailing list