From patchwork Thu Aug 14 00:56:08 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: weiyj_lk@163.com X-Patchwork-Id: 4721401 Return-Path: X-Original-To: patchwork-ceph-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 2C53B9F319 for ; Thu, 14 Aug 2014 00:56:29 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 55BF6201CD for ; Thu, 14 Aug 2014 00:56:28 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 9C70F201C8 for ; Thu, 14 Aug 2014 00:56:25 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752809AbaHNA4Y (ORCPT ); Wed, 13 Aug 2014 20:56:24 -0400 Received: from m12-13.163.com ([220.181.12.13]:48910 "EHLO m12-13.163.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752149AbaHNA4X (ORCPT ); Wed, 13 Aug 2014 20:56:23 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=163.com; s=s110527; h=From:Subject:Date:Message-Id; bh=egp5h33eGEPj3Kr9mK ulbBUPTGiNkxtJOIHlnhDFKF8=; b=KHGf8GUXSk0vB9PmYqQug93ibQ5qMvrwpu ZDTM57IED2iVjh4axdxk1FaMF3ILXSDyg2/o0zjqcfj1II9b53B0ptOLJrU9x/LF SxGx9RLAZ69OX3JTvovcT8xH07ob67YJKlaY+AOXl3t5tR/MCug0LKgfBMa+WTPZ i6aagEKCs= Received: from localhost.localdomain.localdomain (unknown [49.77.231.131]) by smtp9 (Coremail) with SMTP id DcCowEAp+FkpCexT3XOFAA--.681S2; Thu, 14 Aug 2014 08:56:11 +0800 (CST) X-Coremail-DSSMTP: 49.77.231.131 From: weiyj_lk@163.com To: Yehuda Sadeh , Sage Weil , Alex Elder , Ilya Dryomov Cc: Wei Yongjun , ceph-devel@vger.kernel.org Subject: [PATCH -next] rbd: fix error return code in rbd_dev_device_setup() Date: Thu, 14 Aug 2014 08:56:08 +0800 Message-Id: <1407977768-15119-1-git-send-email-weiyj_lk@163.com> X-Mailer: git-send-email 1.9.3 X-CM-TRANSID: DcCowEAp+FkpCexT3XOFAA--.681S2 X-Coremail-Antispam: 1Uf129KBjvdXoW7WryUGw48uF4fCF1rZF17GFg_yoW3KFc_u3 yYvrnrZr1UKFnY9r4UKFy5ZryFkw1qvr4SvF1ftFn3Xay7JFZrXan2vrn8Zw15ZF1UCFsx Z34DWryxArs7XjkaLaAFLSUrUUUUUb8apTn2vfkv8UJUUUU8Yxn0WfASr-VFAUDa7-sFnT 9fnUUvcSsGvfC2KfnxnUUI43ZEXa7IU5vfO7UUUUU== X-Originating-IP: [49.77.231.131] X-CM-SenderInfo: pzhl5yxbonqiywtou0bp/1tbiMAzn1lEAOGhsbwAAsP Sender: ceph-devel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: ceph-devel@vger.kernel.org X-Spam-Status: No, score=-7.5 required=5.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,RP_MATCHES_RCVD,T_DKIM_INVALID,UNPARSEABLE_RELAY autolearn=ham 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: Wei Yongjun Fix to return -ENOMEM from the workqueue alloc error handling case instead of 0, as done elsewhere in this function. Signed-off-by: Wei Yongjun Reviewed-by: Alex Elder --- drivers/block/rbd.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) -- To unsubscribe from this list: send the line "unsubscribe ceph-devel" 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/drivers/block/rbd.c b/drivers/block/rbd.c index 623c841..f3be022 100644 --- a/drivers/block/rbd.c +++ b/drivers/block/rbd.c @@ -5088,8 +5087,10 @@ static int rbd_dev_device_setup(struct rbd_device *rbd_dev) set_disk_ro(rbd_dev->disk, rbd_dev->mapping.read_only); rbd_dev->rq_wq = alloc_workqueue(rbd_dev->disk->disk_name, 0, 0); - if (!rbd_dev->rq_wq) + if (!rbd_dev->rq_wq) { + ret = -ENOMEM; goto err_out_mapping; + } ret = rbd_bus_add_dev(rbd_dev); if (ret)