From: Mark Fasheh <mfasheh@suse.com>
To: linux-btrfs@vger.kernel.org
Cc: Chris Mason <chris.mason@oracle.com>
Subject: [PATCH 2/2] btrfs: better error handling in xattr.c
Date: Thu, 2 Sep 2010 17:06:42 -0700 [thread overview]
Message-ID: <20100903000642.GC4364@wotan.suse.de> (raw)
This was quite trivial - there's only 3 places I counted where we weren't
handling errors. None of the sites looked like they needed any additional
unrolling either.
Signed-off-by: Mark Fasheh <mfasheh@suse.com>
---
fs/btrfs/xattr.c | 6 ++----
1 files changed, 2 insertions(+), 4 deletions(-)
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;
--
1.6.4.2
reply other threads:[~2010-09-03 0:06 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20100903000642.GC4364@wotan.suse.de \
--to=mfasheh@suse.com \
--cc=chris.mason@oracle.com \
--cc=linux-btrfs@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).