dm space map common: remove check for impossible sm_find_free() return value
authorZhangXiaoxu <zhangxiaoxu5@huawei.com>
Sun, 9 Jun 2019 07:52:00 +0000 (15:52 +0800)
committerMike Snitzer <snitzer@redhat.com>
Mon, 26 Aug 2019 19:39:53 +0000 (15:39 -0400)
The function sm_find_free() just returns -ENOSPC and 0.
So remove lone caller's check for some other error.

Signed-off-by: ZhangXiaoxu <zhangxiaoxu5@huawei.com>
Signed-off-by: Mike Snitzer <snitzer@redhat.com>
drivers/md/persistent-data/dm-space-map-common.c

index b8a62188f6be5906630983ef8fe183c9ba68ef2f..bd68f6fef69482e914cf71f043f8eb198414454f 100644 (file)
@@ -369,10 +369,6 @@ int sm_ll_find_free_block(struct ll_disk *ll, dm_block_t begin,
                         */
                        dm_tm_unlock(ll->tm, blk);
                        continue;
-
-               } else if (r < 0) {
-                       dm_tm_unlock(ll->tm, blk);
-                       return r;
                }
 
                dm_tm_unlock(ll->tm, blk);