From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id B2E8FEB64D9 for ; Fri, 7 Jul 2023 11:29:47 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231953AbjGGL3r (ORCPT ); Fri, 7 Jul 2023 07:29:47 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41082 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232004AbjGGL3V (ORCPT ); Fri, 7 Jul 2023 07:29:21 -0400 Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:3::133]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DCD202100; Fri, 7 Jul 2023 04:29:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20210309; h=In-Reply-To:Content-Type:MIME-Version :References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=wJgsDHh5HYYtVRdMHx8zuGrawKX6Ed1TZktUw5oGUnQ=; b=wfT3+DZI080k0A8y1McdGcpf+T UyRlzKpGhViBsX83jEcEhSM3A2l0/aiTSwVjOTfjSMf+3Mx2gBooURlgMO5cFnQAGB+mJUIItdxFm DWuGUzaONVUrfeSJs3+ox7/+1QusGVCF88aE+KSmgV3FMvL+XKIXuR0lbAbtVA9XlYLtkLOVtG1AH DyHHW+GURQodu2Ss/tZddHWarGcgDWx2AwIqixZUFOKtNHeBQT/2xQZXeLHZwPI2UK5V/OOAhjUx2 51cfhbA3+5DN+I/3uD1EGLNg+f0YoP/Ytd6ynq1ndEzk2ffovTRTDuo9a6Ahx/+j6raqFpnWyGaTg P/52PkkQ==; Received: from hch by bombadil.infradead.org with local (Exim 4.96 #2 (Red Hat Linux)) id 1qHjeK-004Vx0-2T; Fri, 07 Jul 2023 11:29:20 +0000 Date: Fri, 7 Jul 2023 04:29:20 -0700 From: Christoph Hellwig To: Jan Kara Cc: Christoph Hellwig , linux-block@vger.kernel.org, linux-fsdevel@vger.kernel.org, Jens Axboe Subject: Re: [PATCH 02/32] block: Use file->f_flags for determining exclusive opens in file_to_blk_mode() Message-ID: References: <20230629165206.383-1-jack@suse.cz> <20230704122224.16257-2-jack@suse.cz> <20230706163556.7ygts5dhfhgj53zl@quack3> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20230706163556.7ygts5dhfhgj53zl@quack3> X-SRS-Rewrite: SMTP reverse-path rewritten from by bombadil.infradead.org. See http://www.infradead.org/rpr.html Precedence: bulk List-ID: X-Mailing-List: linux-fsdevel@vger.kernel.org On Thu, Jul 06, 2023 at 06:35:56PM +0200, Jan Kara wrote: > > While this looks a lot nicer, I don't think it actually works given that > > do_dentry_open clears out O_EXCL, and thus it won't be set when > > calling into blkdev_ioctl. > > Aha, good point! So I need to workaround this a bit differently. I think > the best would be to have file_to_blk_mode() for blkdev_open() only and > make the other places (which already have bdev_handle available from > struct file) use bdev_handle->mode. Exactly. > But I have to come up with a sane > transition to that state :). I think you can simply do it in the patch switching the block device to be handle based.