From patchwork Fri Sep 3 00:06:42 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mark Fasheh X-Patchwork-Id: 151611 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter1.kernel.org (8.14.4/8.14.3) with ESMTP id o8307MOH022607 for ; Fri, 3 Sep 2010 00:07:22 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757392Ab0ICAG4 (ORCPT ); Thu, 2 Sep 2010 20:06:56 -0400 Received: from cantor.suse.de ([195.135.220.2]:38903 "EHLO mx1.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755986Ab0ICAGn (ORCPT ); Thu, 2 Sep 2010 20:06:43 -0400 Received: from relay2.suse.de (charybdis-ext.suse.de [195.135.221.2]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.suse.de (Postfix) with ESMTP id C1FB294109; Fri, 3 Sep 2010 02:06:42 +0200 (CEST) Date: Thu, 2 Sep 2010 17:06:42 -0700 From: Mark Fasheh To: linux-btrfs@vger.kernel.org Cc: Chris Mason Subject: [PATCH 2/2] btrfs: better error handling in xattr.c Message-ID: <20100903000642.GC4364@wotan.suse.de> Reply-To: Mark Fasheh Mime-Version: 1.0 Content-Disposition: inline Organization: SUSE Labs, Novell, Inc User-Agent: Mutt/1.5.9i Sender: linux-btrfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-btrfs@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.3 (demeter1.kernel.org [140.211.167.41]); Fri, 03 Sep 2010 00:07:23 +0000 (UTC) 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;