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 kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 60EFDC3ABCC for ; Wed, 14 May 2025 14:23:29 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 98A9E6B0163; Wed, 14 May 2025 10:23:27 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 9132E6B0165; Wed, 14 May 2025 10:23:27 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 7B4F76B0166; Wed, 14 May 2025 10:23:27 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0011.hostedemail.com [216.40.44.11]) by kanga.kvack.org (Postfix) with ESMTP id 56DEB6B0163 for ; Wed, 14 May 2025 10:23:27 -0400 (EDT) Received: from smtpin07.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay09.hostedemail.com (Postfix) with ESMTP id 2CB1280E8B for ; Wed, 14 May 2025 14:23:28 +0000 (UTC) X-FDA: 83441731296.07.C95F9F8 Received: from outgoing.mit.edu (outgoing-auth-1.mit.edu [18.9.28.11]) by imf19.hostedemail.com (Postfix) with ESMTP id 501651A0005 for ; Wed, 14 May 2025 14:23:26 +0000 (UTC) Authentication-Results: imf19.hostedemail.com; dkim=none; spf=pass (imf19.hostedemail.com: domain of tytso@mit.edu designates 18.9.28.11 as permitted sender) smtp.mailfrom=tytso@mit.edu; dmarc=pass (policy=none) header.from=mit.edu ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1747232606; a=rsa-sha256; cv=none; b=SM8kIHE7BtVInmqu5y+oUZTmEs2dRMp9Ahpfpnrd7EQZVKxgqCptrgSJVsCUcC3WWmXJw5 PekTYDnJHniPn7CEyxlG8qZlyOZGaBZpcNbqrdZqBgD/GA1ldKQqOrDK6pfb7tnJqb8do/ W8Eqx/DhzTY0KzZME3WY7IbUuhrBC/k= ARC-Authentication-Results: i=1; imf19.hostedemail.com; dkim=none; spf=pass (imf19.hostedemail.com: domain of tytso@mit.edu designates 18.9.28.11 as permitted sender) smtp.mailfrom=tytso@mit.edu; dmarc=pass (policy=none) header.from=mit.edu ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1747232606; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=eZUyi54D4xg02NwWm4Iu2VAhCWxMBxdNK3pdpJLgsfE=; b=lOe9m7iuXpyz0cwgoyR+ps4oD712BvhUEZQPFFYXiQS2rXq/2Od7L7RKu+/b/JyH+vFu+6 TASS4NcDkKszb7A22y/44ugy6lY/6hCo2fetIPpHhK7uAqo1+py5OXs+uYNz4JpTNXt+H5 k/Qp0fSiZIcYaxGY4RYbtsDJetzrNAQ= Received: from trampoline.thunk.org (pool-173-48-112-151.bstnma.fios.verizon.net [173.48.112.151]) (authenticated bits=0) (User authenticated as tytso@ATHENA.MIT.EDU) by outgoing.mit.edu (8.14.7/8.12.4) with ESMTP id 54EENGYW025919 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 14 May 2025 10:23:17 -0400 Received: by trampoline.thunk.org (Postfix, from userid 15806) id 7F1132E00DC; Wed, 14 May 2025 10:23:16 -0400 (EDT) Date: Wed, 14 May 2025 10:23:16 -0400 From: "Theodore Ts'o" To: Matthew Wilcox Cc: =?utf-8?B?6ZmI5rab5rab?= Taotao Chen , "adilger.kernel@dilger.ca" , "akpm@linux-foundation.org" , "linux-ext4@vger.kernel.org" , "linux-kernel@vger.kernel.org" , "linux-fsdevel@vger.kernel.org" , "linux-mm@kvack.org" Subject: Re: [PATCH 1/3] mm/filemap: initialize fsdata with iocb->ki_flags Message-ID: <20250514142316.GF9943@mit.edu> References: <20250421105026.19577-1-chentaotao@didiglobal.com> <20250421105026.19577-2-chentaotao@didiglobal.com> <20250514035125.GB178093@mit.edu> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Rspam-User: X-Rspamd-Server: rspam01 X-Rspamd-Queue-Id: 501651A0005 X-Stat-Signature: ct9k94iyoac1p9suidxw8qkq7n1a6ix6 X-HE-Tag: 1747232606-638266 X-HE-Meta: U2FsdGVkX18frPCw/qgjmxRVrqI2RibMIwKMgv1OqrpK8gl2MdI7IAU0pjXKO+OMrCV77DVzU307K9LkVpVCqME7HAUtryXwtPQi7MrcYDCZG6Nw+8UOWHQ03LEr5RFwGwrer2HSCW9ueMhQZQsIyiMqoWhIay2alFvKvWnLDF52ZbAQu9ylvB2CWgRX7eqayBRyOkmUkUlmgstXNbKdzz66+LsNWwGh06w6a8ulceq47MquJyr0MC3etqhwl+WxACZjKYsB/Gjq+u1/3x6GywDmY54vfKPFTMluUHl2S+KQd02PGW7cSFLadvFzwQ4uZ/GdlxCfKjQusb4wva1Lj4y0KTQxZEFb3JBP2We/63qvge1vBifqu1IzL8DE6vw7RBfS6K3cyqFm//fgSTykWX3IZZCb4kBgZTd5tRaDXw39YhMU2sae58ujmBOrWbeacIRcILDgmL7F/Mp8E2FhS9flGarmq/QaG/fT3ZuLrJ83bCorZPEwHtICxhQMwg2Sb/hgEJ6i3AxxBGreJyXxtaKEmkIV3fF0tENR1ZdpvkCF1yhJng4JXDZqIDqBUQoNNWXdtfJRJldwh+v1jV+hcHO1TCXQzlDhcLCG4eSxThYUQCqW04Pz7qnV321WdTBnO4EDkSB5N9M1IxhP4p7/HkkQ/Dm2of+0nbRbagxIvv2OsZQepwlTRzi2X+QbsZQUn6jVoHzSzVXNRBvX5LLvqVQu/5b8pobs5VG7KEsIjGdooifYzXxWvL99ZMD3MrXSuExfz9Wti2llRci+odvBtg8fjiBCGeutiC0wXptoJiNPWL7XaxC96yAaqPQhqk1OMqBsZEpLWpKgAB6swRPCDrKcm3jF2XkRjaVOJdDw+oCtwzpBmpjHWpw+DJtseuwYs2c0Z3gZFg0uKUcGMa93uXKrTa0CxDzKNemMM8PiOJrS39c4zN6E6ByTP+lcejrqEWMEEZ7m38hNWalVvFR GwKjAk71 nbWBE5RMT4UxuKEaKHuPZWp3DDb1XLqZtDqRcinI7+RB7Zwopv25AH2lTERXuYWsXVkJnRQMXJ7laYMK2iJ2qVzjruo6rcg1bHW06+UOcUOhCrCZZ4WwzIiJpkeMkpxybOeFEpEOXXt+7lKrnAL+3jkhc+qdK/whAksF8t4imbCLGQlByoDrUt/3VGRmWIC+huTeUAuSf0CK0C9YURmbL7pvUqdDzO3UCHCw4edva8jklMssJhbCMjJqvbds8v7PqKP2n X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: List-Subscribe: List-Unsubscribe: On Wed, May 14, 2025 at 02:38:05PM +0100, Matthew Wilcox wrote: > On Tue, May 13, 2025 at 11:51:25PM -0400, Theodore Ts'o wrote: > > I understand that it would be a lot more inconvenient change the > > function signature of write_begin() to pass through iocb->ki_fags via > > a new parameter. But I think that probably is the best way to go. > > I'd suggest that passing in iocb rather than file is the way to go. > Most callers of ->write_begin already pass NULL as the first argument so > would not need to change. i915/gem passes a non-NULL file, but it only > operates on shmem and shmem does not use the file argument, so they can > pass NULL instead. fs/buffer.c simply passes through the file passed > to write_begin and can be changed to pass through the iocb passed in. > exfat_extend_valid_size() has an iocb in its caller and can pass in the > iocb instead. generic_perform_write() has an iocb. Mmm, nice! I agree, that's probably the way to go. There might be some callers if write_begin() that might require some restructing because they don't have an iocb. For example, shmem_pwrite() in drivers/gpu/i915/gem/i915_gem_shmem.c came up when I did a quick grep. - Ted