Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp497683ybl; Thu, 23 Jan 2020 02:38:00 -0800 (PST) X-Google-Smtp-Source: APXvYqzTyAgKc7e/Au38isPtsOjqivy8gNCMr0sBmwo0xr+BcX8MTXebn2xCVfx3cRXJiEaUvGjb X-Received: by 2002:a05:6808:618:: with SMTP id y24mr9609037oih.86.1579775880638; Thu, 23 Jan 2020 02:38:00 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1579775880; cv=none; d=google.com; s=arc-20160816; b=Atcp7+bAdj55zVTgWIpU77ObbkCY+rUdUSjudLurmjMZBomwOfnLt0NmvxagOegurG eVZ0FiAKIGaExfMxRyZIghmy9MLa+EKh60y7R3bDzUgBjEHq08eVCcUSkZcYO0eaO3/f oLy+NXCWCCSf7lpy2MCyKsoV2DlHKZ/OKDwbbh58I/sdMaISGvMru433msX45gjNrIPs ao1npaXIOytWaoP5PF65dW2kjZj07jnrHqZMBh9p5iASn4b+IEJPZUF0hhdOAtMqeFb0 9mFYuAz2RVmNMwwEzMwMFs2LjnIwJIQsfx2oAt3GJtNZd0Vitz/zkpOOWA7jtHEI6dtg pZ3g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=6L8nK/yXsf3UzKXoncofWr4RqyR/vIboyAU6KZ/JiM0=; b=K4jDE+HZSapysFPg3outyf6hCQKOokluPob+j7BmLxKY4v5f2uyVNeS1OGP//avPYY 41e0lrBC+bJ7vdC/HvTLdkJAbRVCJblJqfhfeAa/i/PdQXTVQbX+KQmelNfTbpheTAfn ozt5FsKhd100Zf1nx540RdLJvj9SpkX5BYcwnyhgiC6QIoNEzYNCe4vHelw7RoT+d3fN X6ZTtNkUQa8g7FxQVPKi89oRaIDDfN2DI9vgRpUttDaOYgBHSFUf0A3cBs3dVGVBXwkj OOTRPKYqbjqUvbMADD/UExdyI2q9yHFEyuSNgBeCZK3aYyaX5HOfkkyszG4tTyJNMmx0 /t2Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=HuMXlEXe; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id m7si662652oih.7.2020.01.23.02.37.47; Thu, 23 Jan 2020 02:38:00 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=HuMXlEXe; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727523AbgAWKfv (ORCPT + 99 others); Thu, 23 Jan 2020 05:35:51 -0500 Received: from us-smtp-2.mimecast.com ([205.139.110.61]:39254 "EHLO us-smtp-delivery-1.mimecast.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726026AbgAWKfv (ORCPT ); Thu, 23 Jan 2020 05:35:51 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1579775750; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=6L8nK/yXsf3UzKXoncofWr4RqyR/vIboyAU6KZ/JiM0=; b=HuMXlEXeU5LNBReMk2Z6CEFabOm1UEPJgQFFEYRY4iUCYnjpjZ0q94Xh7qHzJ03riqMyAX KJL946CpGzSKppVgJ9uxN0Bzg7yL7z5gVutijNpAgtdbDfSf4EvGavK7J74UEir23EruCE ChgbUJihSd95xECBODazof3M30ydkXk= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-248-0nX-IX36P9yjx0TPhlR4iQ-1; Thu, 23 Jan 2020 05:35:46 -0500 X-MC-Unique: 0nX-IX36P9yjx0TPhlR4iQ-1 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 18C1F477; Thu, 23 Jan 2020 10:35:45 +0000 (UTC) Received: from localhost (unknown [10.18.25.174]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 4742F85757; Thu, 23 Jan 2020 10:35:42 +0000 (UTC) Date: Thu, 23 Jan 2020 05:35:41 -0500 From: Mike Snitzer To: Stefan Bader Cc: linux-kernel@vger.kernel.org, dm-devel@redhat.com, linux-block@vger.kernel.org, Alasdair Kergon , Jens Axboe , Tyler Hicks Subject: Re: [PATCH 1/1] blk/core: Gracefully handle unset make_request_fn Message-ID: <20200123103541.GA28102@redhat.com> References: <20200123091713.12623-1-stefan.bader@canonical.com> <20200123091713.12623-2-stefan.bader@canonical.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200123091713.12623-2-stefan.bader@canonical.com> User-Agent: Mutt/1.5.21 (2010-09-15) X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Jan 23 2020 at 4:17am -0500, Stefan Bader wrote: > When device-mapper adapted for multi-queue functionality, they > also re-organized the way the make-request function was set. > Before, this happened when the device-mapper logical device was > created. Now it is done once the mapping table gets loaded the > first time (this also decides whether the block device is request > or bio based). > > However in generic_make_request(), the request function gets used > without further checks and this happens if one tries to mount such > a partially set up device. > > This can easily be reproduced with the following steps: > - dmsetup create -n test > - mount /dev/dm-<#> /mnt > > This maybe is something which also should be fixed up in device- > mapper. I'll look closer at other options. > But given there is already a check for an unset queue > pointer and potentially there could be other drivers which do or > might do the same, it sounds like a good move to add another check > to generic_make_request_checks() and to bail out if the request > function has not been set, yet. > > BugLink: https://bugs.launchpad.net/bugs/1860231 From that bug; "The currently proposed fix introduces no chance of stability regressions. There is a chance of a very small performance regression since an additional pointer comparison is performed on each block layer request but this is unlikely to be noticeable." This captures my immediate concern: slowing down everyone for this DM edge-case isn't desirable. Mike