Tsutomu Itoh
2012-Jun-26 03:25 UTC
[PATCH] Btrfs: return error of btrfs_update_inode() to caller
We didn''t check error of btrfs_update_inode(), but that error looks
easy to bubble back up.
Signed-off-by: Tsutomu Itoh <t-itoh@jp.fujitsu.com>
---
fs/btrfs/inode.c | 2 +-
fs/btrfs/tree-log.c | 4 ++--
2 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/fs/btrfs/inode.c b/fs/btrfs/inode.c
index 4a4f2d5..7a5d42e 100644
--- a/fs/btrfs/inode.c
+++ b/fs/btrfs/inode.c
@@ -2833,7 +2833,7 @@ err:
inode_inc_iversion(inode);
inode_inc_iversion(dir);
inode->i_ctime = dir->i_mtime = dir->i_ctime = CURRENT_TIME;
- btrfs_update_inode(trans, root, dir);
+ ret = btrfs_update_inode(trans, root, dir);
out:
return ret;
}
diff --git a/fs/btrfs/tree-log.c b/fs/btrfs/tree-log.c
index 2017d0f..6551ed4 100644
--- a/fs/btrfs/tree-log.c
+++ b/fs/btrfs/tree-log.c
@@ -637,7 +637,7 @@ static noinline int replay_one_extent(struct
btrfs_trans_handle *trans,
}
inode_set_bytes(inode, saved_nbytes);
- btrfs_update_inode(trans, root, inode);
+ ret = btrfs_update_inode(trans, root, inode);
out:
if (inode)
iput(inode);
@@ -1130,7 +1130,7 @@ static noinline int link_to_fixup_dir(struct
btrfs_trans_handle *trans,
btrfs_release_path(path);
if (ret == 0) {
btrfs_inc_nlink(inode);
- btrfs_update_inode(trans, root, inode);
+ ret = btrfs_update_inode(trans, root, inode);
} else if (ret == -EEXIST) {
ret = 0;
} else {
--
To unsubscribe from this list: send the line "unsubscribe linux-btrfs"
in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
David Sterba
2012-Jun-26 12:33 UTC
Re: [PATCH] Btrfs: return error of btrfs_update_inode() to caller
On Tue, Jun 26, 2012 at 12:25:22PM +0900, Tsutomu Itoh wrote:> We didn''t check error of btrfs_update_inode(), but that error looks > easy to bubble back up.Yep, the callers check for the retvals, and the one missed in __btrfs_unlink_inode seems serious, as unlink_inode and rename would not see the error (probably ENOSPC). Reviewed-by: David Sterba <dsterba@suse.cz> -- To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html