lkml.org 
[lkml]   [2003]   [Jan]   [8]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
Subject[PATCH 3/10] dm: Correct target_type reference counting
From
ti->use was only getting incremented the first time a target type was
retrieved (bug introduced by recent hch patch).
--- diff/drivers/md/dm-target.c 2003-01-02 10:43:06.000000000 +0000
+++ source/drivers/md/dm-target.c 2003-01-02 11:16:16.000000000 +0000
@@ -43,15 +43,16 @@
struct tt_internal *ti;

read_lock(&_lock);
+
ti = __find_target_type(name);
- if (ti && ti->use == 0) {
- if (try_module_get(ti->tt.module))
- ti->use++;
- else
+ if (ti) {
+ if ((ti->use == 0) && !try_module_get(ti->tt.module))
ti = NULL;
+ else
+ ti->use++;
}
- read_unlock(&_lock);

+ read_unlock(&_lock);
return ti;
}

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
\
 
 \ /
  Last update: 2005-03-22 13:32    [from the cache]
©2003-2011 Jasper Spaans