From patchwork Thu Sep 6 09:08:59 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tsutomu Itoh X-Patchwork-Id: 1412591 Return-Path: X-Original-To: patchwork-linux-btrfs@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork1.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork1.kernel.org (Postfix) with ESMTP id 573EE3FC71 for ; Thu, 6 Sep 2012 09:09:36 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754629Ab2IFJJc (ORCPT ); Thu, 6 Sep 2012 05:09:32 -0400 Received: from fgwmail6.fujitsu.co.jp ([192.51.44.36]:58414 "EHLO fgwmail6.fujitsu.co.jp" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753919Ab2IFJJc (ORCPT ); Thu, 6 Sep 2012 05:09:32 -0400 Received: from m4.gw.fujitsu.co.jp (unknown [10.0.50.74]) by fgwmail6.fujitsu.co.jp (Postfix) with ESMTP id CF5A23EE0BC for ; Thu, 6 Sep 2012 18:09:30 +0900 (JST) Received: from smail (m4 [127.0.0.1]) by outgoing.m4.gw.fujitsu.co.jp (Postfix) with ESMTP id B93F145DE52 for ; Thu, 6 Sep 2012 18:09:30 +0900 (JST) Received: from s4.gw.fujitsu.co.jp (s4.gw.fujitsu.co.jp [10.0.50.94]) by m4.gw.fujitsu.co.jp (Postfix) with ESMTP id 9DEDA45DE51 for ; Thu, 6 Sep 2012 18:09:30 +0900 (JST) Received: from s4.gw.fujitsu.co.jp (localhost.localdomain [127.0.0.1]) by s4.gw.fujitsu.co.jp (Postfix) with ESMTP id 517DBE08003 for ; Thu, 6 Sep 2012 18:09:30 +0900 (JST) Received: from ml14.s.css.fujitsu.com (ml14.s.css.fujitsu.com [10.240.81.134]) by s4.gw.fujitsu.co.jp (Postfix) with ESMTP id 043F81DB803E for ; Thu, 6 Sep 2012 18:09:30 +0900 (JST) Received: from ml14.css.fujitsu.com (ml14 [127.0.0.1]) by ml14.s.css.fujitsu.com (Postfix) with ESMTP id CFAF49F7928; Thu, 6 Sep 2012 18:09:29 +0900 (JST) Received: from FM-323941448.jp.fujitsu.com (unknown [10.124.101.87]) by ml14.s.css.fujitsu.com (Postfix) with SMTP id 6741D9F7879; Thu, 6 Sep 2012 18:09:29 +0900 (JST) X-SecurityPolicyCheck: OK by SHieldMailChecker v1.7.4 Message-Id: <201209060908.AA00005@FM-323941448.jp.fujitsu.com> From: Tsutomu Itoh Date: Thu, 06 Sep 2012 18:08:59 +0900 To: chris.mason@fusionio.com Cc: linux-btrfs@vger.kernel.org Subject: [PATCH] Btrfs: fix error handling in delete_block_group_cache() MIME-Version: 1.0 X-Mailer: AL-Mail32 Version 1.13 Sender: linux-btrfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-btrfs@vger.kernel.org btrfs_iget() never return NULL. So, NULL check is unnecessary. Signed-off-by: Tsutomu Itoh --- fs/btrfs/relocation.c | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) -- 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 diff --git a/fs/btrfs/relocation.c b/fs/btrfs/relocation.c index c5dbd91..738e869 100644 --- a/fs/btrfs/relocation.c +++ b/fs/btrfs/relocation.c @@ -3270,8 +3270,8 @@ static int delete_block_group_cache(struct btrfs_fs_info *fs_info, key.offset = 0; inode = btrfs_iget(fs_info->sb, &key, root, NULL); - if (IS_ERR_OR_NULL(inode) || is_bad_inode(inode)) { - if (inode && !IS_ERR(inode)) + if (IS_ERR(inode) || is_bad_inode(inode)) { + if (!IS_ERR(inode)) iput(inode); return -ENOENT; }