Received: by 2002:a05:6a10:6744:0:0:0:0 with SMTP id w4csp3477772pxu; Sun, 11 Oct 2020 11:06:37 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzLJPUY3CGAxXNKy5ELQWULgawdd0gyXv6qXJtS0mzoDyGItTPGmIpHlElRSEHppnve4w87 X-Received: by 2002:a50:fa42:: with SMTP id c2mr10643506edq.282.1602439597620; Sun, 11 Oct 2020 11:06:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1602439597; cv=none; d=google.com; s=arc-20160816; b=E7arJlDuENuXFDioElQyKdi5FgahdW8NXfdJQVgvPsVITR//2Ru75TQNGB+SErsERv 1I3vNnluxhAXJw7H4rBJ1ps2hrIab0C7W352n7jJg0QGzzfaABllSdLxpHifVTzxUtsY iY5yfWU+eMugTZExHy83UmXy39Ppsy4czs5QoPEQbxzpXD5Ay/YtpDlZdWE56dilf8ML jk43RYUAp4Yv4E5e099VoWe+CLkcKhiGLjvcqG/v3DRJfxC4TqSbfhDpJfunYj72q4r1 0sbNOeFaZ2heCJvhSMi6rI3LUv3wvlHH1pFuUdAwe2nglyao9VYzWqz04aFWpMS0tWv5 ajUg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :in-reply-to:mime-version:user-agent:date:message-id:from:references :cc:to:subject; bh=epWpEahFW8WwxlZ4vgdkIM6COiA0hHZftlXfwENm6pc=; b=H4rGgG13ZwXT9ax+j5Xel4BVOzYozOqUm50mp++SdZ0lCYXpqzOfHa2PYqsO3+vq68 QIVIjN8l7/7L08ITj3ORpxseYvk4VNoWlAMbIGeZv9gb3pzHz6k3jaUCgaXnVqNwVhds czFoa0Odd0odVK6fkSC3zqL7akvQaBP+5I2oFTRDVnkPr69SjwNbASlMrqotv5eQbhVW P+P0ZYTuy6tT1KV71KLxUVU8WXgRrhX23Wds5SFq9daJV1q3GIeyPg71vrMgY9O7TNQi bUYrRv3d3mL8guODZKONlGXyfi6+zHeRGMYrujshnoRyQnSYDSKN9aOL2Qb0jGYo7Qls HDcg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id a1si7710109edb.335.2020.10.11.11.06.15; Sun, 11 Oct 2020 11:06:37 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730164AbgJKOxZ (ORCPT + 99 others); Sun, 11 Oct 2020 10:53:25 -0400 Received: from mx2.suse.de ([195.135.220.15]:53634 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725863AbgJKOxZ (ORCPT ); Sun, 11 Oct 2020 10:53:25 -0400 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.221.27]) by mx2.suse.de (Postfix) with ESMTP id 9EE40AC3F; Sun, 11 Oct 2020 14:53:23 +0000 (UTC) Subject: Re: [PATCH] block: switch to pr_warn() in __device_add_disk() To: Rustam Kovhaev , axboe@kernel.dk, linux-block@vger.kernel.org Cc: linux-kernel@vger.kernel.org References: <20201011130347.562264-1-rkovhaev@gmail.com> From: Hannes Reinecke Message-ID: <745dd869-00ba-19fd-3643-27a92326f424@suse.de> Date: Sun, 11 Oct 2020 16:53:22 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.12.0 MIME-Version: 1.0 In-Reply-To: <20201011130347.562264-1-rkovhaev@gmail.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 10/11/20 3:03 PM, Rustam Kovhaev wrote: > syzbot triggered a warning while fuzzing with failslab fault injection > enabled > let's convert WARN_ON() to pr_warn() > > Reported-and-tested-by: syzbot+f41893bb8c45cd18cf08@syzkaller.appspotmail.com > Link: https://syzkaller.appspot.com/bug?extid=f41893bb8c45cd18cf08 > Signed-off-by: Rustam Kovhaev > --- > block/genhd.c | 3 ++- > 1 file changed, 2 insertions(+), 1 deletion(-) > > diff --git a/block/genhd.c b/block/genhd.c > index 99c64641c314..be9ce35cf0fe 100644 > --- a/block/genhd.c > +++ b/block/genhd.c > @@ -822,7 +822,8 @@ static void __device_add_disk(struct device *parent, struct gendisk *disk, > /* Register BDI before referencing it from bdev */ > dev->devt = devt; > ret = bdi_register(bdi, "%u:%u", MAJOR(devt), MINOR(devt)); > - WARN_ON(ret); > + if (ret) > + pr_warn("%s: failed to register backing dev info\n", disk->disk_name); > bdi_set_owner(bdi, dev); > blk_register_region(disk_devt(disk), disk->minors, NULL, > exact_match, exact_lock, disk); > Please, don't. Where is the point in continuing here? I'd rather have it fixed up properly, either by having a return value to __device_add_disk() or by allowing the caller to check (eg by checking GENHD_FL_UP) if the call succeeded. Cheers, Hannes -- Dr. Hannes Reinecke Kernel Storage Architect hare@suse.de +49 911 74053 688 SUSE Software Solutions GmbH, Maxfeldstr. 5, 90409 Nürnberg HRB 36809 (AG Nürnberg), Geschäftsführer: Felix Imendörffer