From patchwork Tue Jun 17 14:32:13 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "jeff.liu" X-Patchwork-Id: 4366671 Return-Path: X-Original-To: patchwork-linux-btrfs@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 64FF9BEEAA for ; Tue, 17 Jun 2014 14:32:34 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id A6CB22025B for ; Tue, 17 Jun 2014 14:32:30 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id F0519202B4 for ; Tue, 17 Jun 2014 14:32:26 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933016AbaFQOcX (ORCPT ); Tue, 17 Jun 2014 10:32:23 -0400 Received: from userp1040.oracle.com ([156.151.31.81]:49315 "EHLO userp1040.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932915AbaFQOcW (ORCPT ); Tue, 17 Jun 2014 10:32:22 -0400 Received: from acsinet21.oracle.com (acsinet21.oracle.com [141.146.126.237]) by userp1040.oracle.com (Sentrion-MTA-4.3.2/Sentrion-MTA-4.3.2) with ESMTP id s5HEWJEd029725 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Tue, 17 Jun 2014 14:32:20 GMT Received: from userz7021.oracle.com (userz7021.oracle.com [156.151.31.85]) by acsinet21.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id s5HEWIZI006402 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=FAIL); Tue, 17 Jun 2014 14:32:19 GMT Received: from abhmp0014.oracle.com (abhmp0014.oracle.com [141.146.116.20]) by userz7021.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id s5HEWIxl010490; Tue, 17 Jun 2014 14:32:18 GMT Received: from [192.168.1.101] (/27.194.216.145) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Tue, 17 Jun 2014 07:32:17 -0700 Message-ID: <53A0516D.5040607@oracle.com> Date: Tue, 17 Jun 2014 22:32:13 +0800 From: Jeff Liu User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.1.0 MIME-Version: 1.0 To: clm@fb.com, Josef Bacik CC: linux-btrfs@vger.kernel.org Subject: [PATCH 16/24] btrfs: return actual error on btrfs_init_sysfs X-Source-IP: acsinet21.oracle.com [141.146.126.237] Sender: linux-btrfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-btrfs@vger.kernel.org X-Spam-Status: No, score=-7.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Jie Liu Return the actual error code if call kset_create_and_add() failed Cc: Chris Mason Cc: Josef Bacik Signed-off-by: Jie Liu --- fs/btrfs/sysfs.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/fs/btrfs/sysfs.c b/fs/btrfs/sysfs.c index df39458..8f7dfa7 100644 --- a/fs/btrfs/sysfs.c +++ b/fs/btrfs/sysfs.c @@ -705,8 +705,8 @@ int btrfs_init_sysfs(void) int ret; btrfs_kset = kset_create_and_add("btrfs", NULL, fs_kobj); - if (!btrfs_kset) - return -ENOMEM; + if (IS_ERR(btrfs_kset)) + return PTR_ERR(btrfs_kset); ret = btrfs_init_debugfs(); if (ret)