Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp13968600pxu; Mon, 4 Jan 2021 09:14:30 -0800 (PST) X-Google-Smtp-Source: ABdhPJyh9MYbD9kQjPc8Pp/OfGwjVpEvLe0+11mvT7Ko4cQkqJtXBqHmRZ56Pd2TaQIMYvg72FDF X-Received: by 2002:a17:906:6448:: with SMTP id l8mr42012710ejn.357.1609780470198; Mon, 04 Jan 2021 09:14:30 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1609780470; cv=none; d=google.com; s=arc-20160816; b=F2OmGwwMr8SLb5UNRNxrT8bq8H5TTi6iLqK5PQhC/TNk9YsvzDhsBd+44cv7p3CIjR UFlVBbfUnVvOj8Urt5FJuKDBV65OlKQcl7EL2+dIMD4ZZO5gyT/0Yu03NrDbwwhH3rRr H/l8vsNqcUfrywCHTuIwqgWFeXyEdAbbXP9fT/U4j26i5L3L6kcfwOYtoAfg8KtX66W1 MbcNgh17+Ljg/HgeR7iRaYx82cPvw6AgaVE5UKJKo3EfFbJezsuTM87LjrXESeDvRWyY 4vz/9kQZQO/hm02FrPxTh0/hraAlYOCN9fGH57SuWMiG+rdACQD9oD87l77l6cjZeACj nDIQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date; bh=j6dQq55HlITFtpZCwO4cvsB2wz6q6MnTiFdHUzMinyE=; b=r++E6OleHwJbWZKVRrJgnXdrfRorRHV2ctOTuyt61RariNVot0f0+LaNdGOm1D60wI QIzNuCjOLlLD8yIzs6LuSfszHeglgEoNkRsVAsZlXTcL4lksBltCITC165EIUFoYWuR+ esAHpR+fZhrC9D76sbqKLJW7X8MAr0gxwgNacKJo9IA7yaO3ysfFWEfUBaQiXrOLPuWQ HkiNhReuB1PAcHMAl7s2DcOiHwywOuqTiEf8J7++aKQZyVIu8l1nRwIYt7kgBw7hpnuZ L4Yn2mydr+a836dhparnBS8zhOAiq/BHoZJp7zlTi9UZ3OrcOyHWvFWKnm7/O14y7jxy 0uiQ== 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 d20si27613191eds.14.2021.01.04.09.14.06; Mon, 04 Jan 2021 09:14:30 -0800 (PST) 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 S1726246AbhADRMY (ORCPT + 99 others); Mon, 4 Jan 2021 12:12:24 -0500 Received: from verein.lst.de ([213.95.11.211]:58552 "EHLO verein.lst.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727217AbhADRMY (ORCPT ); Mon, 4 Jan 2021 12:12:24 -0500 Received: by verein.lst.de (Postfix, from userid 2407) id EDAD168AFE; Mon, 4 Jan 2021 18:11:41 +0100 (CET) Date: Mon, 4 Jan 2021 18:11:41 +0100 From: Christoph Hellwig To: Minwoo Im Cc: linux-block@vger.kernel.org, linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org, Jens Axboe , Alexander Viro , Christoph Hellwig , Chaitanya Kulkarni Subject: Re: [RFC PATCH V3 1/1] block: reject I/O for same fd if block size changed Message-ID: <20210104171141.GB27235@lst.de> References: <20210104130659.22511-1-minwoo.im.dev@gmail.com> <20210104130659.22511-2-minwoo.im.dev@gmail.com> <20210104171108.GA27235@lst.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20210104171108.GA27235@lst.de> User-Agent: Mutt/1.5.17 (2007-11-01) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Jan 04, 2021 at 06:11:08PM +0100, Christoph Hellwig wrote: > On Mon, Jan 04, 2021 at 10:06:59PM +0900, Minwoo Im wrote: > > + if (q->backing_dev_info && q->backing_dev_info->owner && > > + limits->logical_block_size != size) { > > + bdev = blkdev_get_no_open(q->backing_dev_info->owner->devt); > > + bdev->bd_disk->flags |= GENHD_FL_BLOCK_SIZE_CHANGED; > > + blkdev_put_no_open(bdev); > > + } > > We really need the backpointer from the queue to the gendisk I've wanted > to add for a while. Can we at least restrict this to a live gendisk? Alternatively we could make this request_queue QUEUE* flag for now.