diff options
author | Josef Bacik <josef@redhat.com> | 2011-01-24 16:43:18 -0500 |
---|---|---|
committer | Chris Mason <chris.mason@oracle.com> | 2011-01-28 16:40:37 -0500 |
commit | dedefd7215d3ec451291ca393e5c8e4c1882c8c6 (patch) | |
tree | 45ab482f3fa6896fc63051c356399d45e5ea8140 /fs | |
parent | abd30bb0af9d4671506502278e8631bed9e3c35c (diff) |
Btrfs: fix check_path_shared so it returns the right value
When running xfstests 224 I kept getting ENOSPC when trying to remove the files,
and this is because we were returning ret from check_path_shared while it was
uninitalized, which isn't right. Fix this to return 0 properly, and now
xfstests 224 doesn't freak out when it tries to clean itself up. Thanks,
Signed-off-by: Josef Bacik <josef@redhat.com>
Signed-off-by: Chris Mason <chris.mason@oracle.com>
Diffstat (limited to 'fs')
-rw-r--r-- | fs/btrfs/inode.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/fs/btrfs/inode.c b/fs/btrfs/inode.c index 40fee137dd1..5621818921f 100644 --- a/fs/btrfs/inode.c +++ b/fs/btrfs/inode.c | |||
@@ -2718,9 +2718,10 @@ static int check_path_shared(struct btrfs_root *root, | |||
2718 | struct extent_buffer *eb; | 2718 | struct extent_buffer *eb; |
2719 | int level; | 2719 | int level; |
2720 | u64 refs = 1; | 2720 | u64 refs = 1; |
2721 | int uninitialized_var(ret); | ||
2722 | 2721 | ||
2723 | for (level = 0; level < BTRFS_MAX_LEVEL; level++) { | 2722 | for (level = 0; level < BTRFS_MAX_LEVEL; level++) { |
2723 | int ret; | ||
2724 | |||
2724 | if (!path->nodes[level]) | 2725 | if (!path->nodes[level]) |
2725 | break; | 2726 | break; |
2726 | eb = path->nodes[level]; | 2727 | eb = path->nodes[level]; |
@@ -2731,7 +2732,7 @@ static int check_path_shared(struct btrfs_root *root, | |||
2731 | if (refs > 1) | 2732 | if (refs > 1) |
2732 | return 1; | 2733 | return 1; |
2733 | } | 2734 | } |
2734 | return ret; /* XXX callers? */ | 2735 | return 0; |
2735 | } | 2736 | } |
2736 | 2737 | ||
2737 | /* | 2738 | /* |