All of lore.kernel.org
 help / color / mirror / Atom feed
From: David Sterba <dsterba@suse.com>
To: linux-btrfs@vger.kernel.org
Cc: David Sterba <dsterba@suse.com>
Subject: [PATCH 2/3] btrfs: handle allocation error in update_dev_stat_item
Date: Mon, 20 Feb 2017 19:25:04 +0100	[thread overview]
Message-ID: <b5cd1b62a67b7ee96ae495628aef097294f7797d.1487614974.git.dsterba@suse.com> (raw)
In-Reply-To: <cover.1487614974.git.dsterba@suse.com>

Signed-off-by: David Sterba <dsterba@suse.com>
---
 fs/btrfs/volumes.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/fs/btrfs/volumes.c b/fs/btrfs/volumes.c
index 1fac98728814..64d6665f6eda 100644
--- a/fs/btrfs/volumes.c
+++ b/fs/btrfs/volumes.c
@@ -6954,7 +6954,8 @@ static int update_dev_stat_item(struct btrfs_trans_handle *trans,
 	key.offset = device->devid;
 
 	path = btrfs_alloc_path();
-	BUG_ON(!path);
+	if (!path)
+		return -ENOMEM;
 	ret = btrfs_search_slot(trans, dev_root, &key, path, -1, 1);
 	if (ret < 0) {
 		btrfs_warn_in_rcu(fs_info,
-- 
2.10.1


  parent reply	other threads:[~2017-02-20 18:25 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-02-20 18:24 [PATCH 0/3] Remove some BUG_ONs David Sterba
2017-02-20 18:25 ` [PATCH 1/3] btrfs: remove BUG_ON from __tree_mod_log_insert David Sterba
2017-02-22  5:31   ` Liu Bo
2017-02-20 18:25 ` David Sterba [this message]
2017-02-22  5:33   ` [PATCH 2/3] btrfs: handle allocation error in update_dev_stat_item Liu Bo
2017-02-20 18:25 ` [PATCH 3/3] btrfs: do proper error handling in btrfs_insert_xattr_item David Sterba
2017-02-22  5:39   ` Liu Bo
2017-02-28 10:41     ` David Sterba

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=b5cd1b62a67b7ee96ae495628aef097294f7797d.1487614974.git.dsterba@suse.com \
    --to=dsterba@suse.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.