diff options
author | Chris Mason <chris.mason@oracle.com> | 2011-10-14 06:31:20 -0400 |
---|---|---|
committer | Chris Mason <chris.mason@oracle.com> | 2011-11-06 03:03:47 -0500 |
commit | 1eae31e918972bbeefc119d23c1d67674f49a301 (patch) | |
tree | b6c1df4d25699812a83f107187b407d53abeb82e | |
parent | cd354ad613a393424f85333ceed6b15e07fb94ae (diff) |
Btrfs: make sure btrfs_remove_free_space doesn't leak EAGAIN
btrfs_remove_free_space needs to make sure to set ret back to a
valid return value after setting it to EAGAIN, otherwise we return
it to the callers.
Signed-off-by: Chris Mason <chris.mason@oracle.com>
-rw-r--r-- | fs/btrfs/free-space-cache.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/fs/btrfs/free-space-cache.c b/fs/btrfs/free-space-cache.c index de205d59b74b..f49475dfa954 100644 --- a/fs/btrfs/free-space-cache.c +++ b/fs/btrfs/free-space-cache.c | |||
@@ -1868,6 +1868,7 @@ again: | |||
1868 | ctl->total_bitmaps--; | 1868 | ctl->total_bitmaps--; |
1869 | } | 1869 | } |
1870 | kmem_cache_free(btrfs_free_space_cachep, info); | 1870 | kmem_cache_free(btrfs_free_space_cachep, info); |
1871 | ret = 0; | ||
1871 | goto out_lock; | 1872 | goto out_lock; |
1872 | } | 1873 | } |
1873 | 1874 | ||
@@ -1875,7 +1876,8 @@ again: | |||
1875 | unlink_free_space(ctl, info); | 1876 | unlink_free_space(ctl, info); |
1876 | info->offset += bytes; | 1877 | info->offset += bytes; |
1877 | info->bytes -= bytes; | 1878 | info->bytes -= bytes; |
1878 | link_free_space(ctl, info); | 1879 | ret = link_free_space(ctl, info); |
1880 | WARN_ON(ret); | ||
1879 | goto out_lock; | 1881 | goto out_lock; |
1880 | } | 1882 | } |
1881 | 1883 | ||