diff options
author | Tsutomu Itoh <t-itoh@jp.fujitsu.com> | 2011-01-20 01:19:37 -0500 |
---|---|---|
committer | Chris Mason <chris.mason@oracle.com> | 2011-02-01 07:17:27 -0500 |
commit | 98d5dc13e7e74b77ca3b4c3cbded9f48d2dbbbb7 (patch) | |
tree | 8e75f67b28b5b0d909483a06bb5258e0ba0c9789 /fs/btrfs/ioctl.c | |
parent | 5df67083488ccbad925f583b698ab38f8629a016 (diff) |
btrfs: fix return value check of btrfs_start_transaction()
The error check of btrfs_start_transaction() is added, and the mistake
of the error check on several places is corrected.
Signed-off-by: Tsutomu Itoh <t-itoh@jp.fujitsu.com>
Signed-off-by: Chris Mason <chris.mason@oracle.com>
Diffstat (limited to 'fs/btrfs/ioctl.c')
-rw-r--r-- | fs/btrfs/ioctl.c | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/fs/btrfs/ioctl.c b/fs/btrfs/ioctl.c index 12dabe28cf54..02d224e8c83f 100644 --- a/fs/btrfs/ioctl.c +++ b/fs/btrfs/ioctl.c | |||
@@ -907,6 +907,10 @@ static noinline int btrfs_ioctl_resize(struct btrfs_root *root, | |||
907 | 907 | ||
908 | if (new_size > old_size) { | 908 | if (new_size > old_size) { |
909 | trans = btrfs_start_transaction(root, 0); | 909 | trans = btrfs_start_transaction(root, 0); |
910 | if (IS_ERR(trans)) { | ||
911 | ret = PTR_ERR(trans); | ||
912 | goto out_unlock; | ||
913 | } | ||
910 | ret = btrfs_grow_device(trans, device, new_size); | 914 | ret = btrfs_grow_device(trans, device, new_size); |
911 | btrfs_commit_transaction(trans, root); | 915 | btrfs_commit_transaction(trans, root); |
912 | } else { | 916 | } else { |
@@ -2141,9 +2145,9 @@ static long btrfs_ioctl_default_subvol(struct file *file, void __user *argp) | |||
2141 | path->leave_spinning = 1; | 2145 | path->leave_spinning = 1; |
2142 | 2146 | ||
2143 | trans = btrfs_start_transaction(root, 1); | 2147 | trans = btrfs_start_transaction(root, 1); |
2144 | if (!trans) { | 2148 | if (IS_ERR(trans)) { |
2145 | btrfs_free_path(path); | 2149 | btrfs_free_path(path); |
2146 | return -ENOMEM; | 2150 | return PTR_ERR(trans); |
2147 | } | 2151 | } |
2148 | 2152 | ||
2149 | dir_id = btrfs_super_root_dir(&root->fs_info->super_copy); | 2153 | dir_id = btrfs_super_root_dir(&root->fs_info->super_copy); |
@@ -2337,6 +2341,8 @@ static noinline long btrfs_ioctl_start_sync(struct file *file, void __user *argp | |||
2337 | u64 transid; | 2341 | u64 transid; |
2338 | 2342 | ||
2339 | trans = btrfs_start_transaction(root, 0); | 2343 | trans = btrfs_start_transaction(root, 0); |
2344 | if (IS_ERR(trans)) | ||
2345 | return PTR_ERR(trans); | ||
2340 | transid = trans->transid; | 2346 | transid = trans->transid; |
2341 | btrfs_commit_transaction_async(trans, root, 0); | 2347 | btrfs_commit_transaction_async(trans, root, 0); |
2342 | 2348 | ||