From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 9469F156F4 for ; Thu, 25 May 2023 18:35:24 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20210309; h=Sender:In-Reply-To:Content-Type: MIME-Version:References:Message-ID:Subject:Cc:To:From:Date:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=3UfPchLUYdWy9KCje7JNWMJZu0GBbqs1XHhZyb9Elpg=; b=dREWFlMgPsOScdh4mHYj5vpNlw HeeuA9W7TI40gjiRe+mbNwDH9vWaRtED9kNXnJ7Eusr53g6BtLAuotQypKw9DJH2uep7C9CpsQ1TQ bllam3AtdkUmxLMZlhm16mC05+GB2+Gk4N6vp43KXCjFQaya1hE5GmKX/HKra0P2wBWWcjHIEo1V2 3QPjca4/AhFY57yNLeouXSnrY3JLPy6ofCSM2oqccSgpfEqxBRP9wS2qzKiS/7ETGDwKvXWJBCVSf eqlNosa0U3phxMepSLIM4URGOCcoENiqxjZrTOQyp1azZhXnTh3gdW9Ek2FpB4L2sCBWcXpjL3ZiV CQJ4yMnw==; Received: from mcgrof by bombadil.infradead.org with local (Exim 4.96 #2 (Red Hat Linux)) id 1q2Fnt-00HPwi-2H; Thu, 25 May 2023 18:35:13 +0000 Date: Thu, 25 May 2023 11:35:13 -0700 From: Luis Chamberlain To: Linus Torvalds , Linux FS Devel , hch@lst.de, brauner@kernel.org, david@redhat.com Cc: tglx@linutronix.de, patches@lists.linux.dev, linux-modules@vger.kernel.org, linux-mm@kvack.org, linux-kernel@vger.kernel.org, pmladek@suse.com, petr.pavlu@suse.com, prarit@redhat.com, lennart@poettering.net, gregkh@linuxfoundation.org, rafael@kernel.org, song@kernel.org, lucas.de.marchi@gmail.com, lucas.demarchi@intel.com, christophe.leroy@csgroup.eu, peterz@infradead.org, rppt@kernel.org, dave@stgolabs.net, willy@infradead.org, vbabka@suse.cz, mhocko@suse.com, dave.hansen@linux.intel.com, colin.i.king@gmail.com, jim.cromie@gmail.com, catalin.marinas@arm.com, jbaron@akamai.com, rick.p.edgecombe@intel.com, yujie.liu@intel.com Subject: Re: [PATCH 1/2] fs/kernel_read_file: add support for duplicate detection Message-ID: References: <20230524213620.3509138-1-mcgrof@kernel.org> <20230524213620.3509138-2-mcgrof@kernel.org> Precedence: bulk X-Mailing-List: patches@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Sender: Luis Chamberlain On Thu, May 25, 2023 at 11:08:13AM -0700, Luis Chamberlain wrote: > + fsdevel please review, > So with two other hunks added (2nd and 4th), this now matches parity with > my patch, not suggesting this is right, just demonstrating how this > could be resolved with this. We could also just have a helper which lets > the module code allow_write_access() at the end of its use of the fd > (failure to load or module is removed). This even fixes the pathological case with stress-ng for finit_module: ./stress-ng --module 8192 --module-name xfs (stress-ng assumes you have all dependencies already loaded and the module is not loaded, it uses finit_module() directly) Luis