[2/2] btrfs: better error handling in xattr.c
diff mbox

Message ID 20100903000642.GC4364@wotan.suse.de
State New, archived
Headers show

Commit Message

Mark Fasheh Sept. 3, 2010, 12:06 a.m. UTC
None

Patch
diff mbox

diff --git a/fs/btrfs/xattr.c b/fs/btrfs/xattr.c
index 0b4f7e6..109fdc3 100644
--- a/fs/btrfs/xattr.c
+++ b/fs/btrfs/xattr.c
@@ -119,11 +119,10 @@  static int do_setxattr(struct btrfs_trans_handle *trans,
 		}
 
 		ret = btrfs_delete_one_dir_name(trans, root, path, di);
-		btrfs_fixable_bug_on(ret);
 		btrfs_release_path(root, path);
 
 		/* if we don't have a value then we are removing the xattr */
-		if (!value)
+		if (ret || !value)
 			goto out;
 	} else {
 		btrfs_release_path(root, path);
@@ -138,7 +137,6 @@  static int do_setxattr(struct btrfs_trans_handle *trans,
 	/* ok we have to create a completely new xattr */
 	ret = btrfs_insert_xattr_item(trans, root, path, inode->i_ino,
 				      name, name_len, value, size);
-	btrfs_fixable_bug_on(ret);
 out:
 	btrfs_free_path(path);
 	return ret;
@@ -166,7 +164,7 @@  int __btrfs_setxattr(struct btrfs_trans_handle *trans,
 
 	inode->i_ctime = CURRENT_TIME;
 	ret = btrfs_update_inode(trans, root, inode);
-	btrfs_fixable_bug_on(ret);
+
 out:
 	btrfs_end_transaction_throttle(trans, root);
 	return ret;