diff options
author | Josef Bacik <josef@redhat.com> | 2011-01-31 16:22:42 -0500 |
---|---|---|
committer | Josef Bacik <josef@redhat.com> | 2011-03-17 14:21:26 -0400 |
commit | 66b4ffd110f9b48b8d8c1319ee446b53b8d073bf (patch) | |
tree | 690b14cda46b47c0d71be15a82019c35729afa75 /fs/btrfs/ioctl.c | |
parent | 3893e33b0bebee2f67d96b6c15259dc884523c20 (diff) |
Btrfs: handle errors in btrfs_orphan_cleanup
If we cannot truncate an inode for some reason we will never delete the orphan
item associated with that inode, which means that we will loop forever in
btrfs_orphan_cleanup. Instead of doing this just return error so we fail to
mount. It sucks, but hey it's better than hanging. Thanks,
Signed-off-by: Josef Bacik <josef@redhat.com>
Diffstat (limited to 'fs/btrfs/ioctl.c')
-rw-r--r-- | fs/btrfs/ioctl.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/fs/btrfs/ioctl.c b/fs/btrfs/ioctl.c index 5fdb2abc4fa7..ad9b8c0e930b 100644 --- a/fs/btrfs/ioctl.c +++ b/fs/btrfs/ioctl.c | |||
@@ -409,7 +409,9 @@ static int create_snapshot(struct btrfs_root *root, struct dentry *dentry, | |||
409 | if (ret) | 409 | if (ret) |
410 | goto fail; | 410 | goto fail; |
411 | 411 | ||
412 | btrfs_orphan_cleanup(pending_snapshot->snap); | 412 | ret = btrfs_orphan_cleanup(pending_snapshot->snap); |
413 | if (ret) | ||
414 | goto fail; | ||
413 | 415 | ||
414 | parent = dget_parent(dentry); | 416 | parent = dget_parent(dentry); |
415 | inode = btrfs_lookup_dentry(parent->d_inode, dentry); | 417 | inode = btrfs_lookup_dentry(parent->d_inode, dentry); |