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 gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id D7C07C7115B for ; Fri, 20 Jun 2025 17:39:47 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 7851D10EBA7; Fri, 20 Jun 2025 17:39:42 +0000 (UTC) Authentication-Results: gabe.freedesktop.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="WC3YSTNe"; dkim-atps=neutral Received: from mail-lj1-f170.google.com (mail-lj1-f170.google.com [209.85.208.170]) by gabe.freedesktop.org (Postfix) with ESMTPS id CD1E410E0E3; Thu, 19 Jun 2025 17:48:16 +0000 (UTC) Received: by mail-lj1-f170.google.com with SMTP id 38308e7fff4ca-32b855b468bso9819981fa.3; Thu, 19 Jun 2025 10:48:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1750355295; x=1750960095; darn=lists.freedesktop.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=YvO5fzYLvhWnXwDLeu0osljtoe46Ll4TNlde5gM445I=; b=WC3YSTNebnWwWyz1FFGNKzaJ1xtUYoOeFJzgvQXOPpj1gxbqDx69uBTzL7nQkLkPQd +p7/LfKfRXP2CDOlHU5t60FqxLEzjOPhcn8Nm/4RudeSk1ew/dEQRYdm7GD4TcSTaJ3Z kDVeF2Z3HHbJ4KFCh8uJ6+vta2wBBNtIXjR2EmVJVl/EJEp+ivwK0/l9Pz0h/y60rmzf FZTdni2fxXslQIe15co0U/pJWXuS0KbMO8OhFkTh3xJ+nSt5TO4exU6S+XhGWI7Y8enN Js2AHsfRc6DGwkhSUIYKHdjasI6xco2Grbcdjw+esI+JuOA8lm2odpbFNq0EMV/IEhno N3og== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1750355295; x=1750960095; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=YvO5fzYLvhWnXwDLeu0osljtoe46Ll4TNlde5gM445I=; b=gsTWIUgrNhRZ0WKcNxljaLC2sbApEpKn8AjQ5kMeKRObwLkGhqvAjFAGIPT/W+3QFE sJbWiXSIhyFX2ApY3Y2RFq6Hm4e6X5l+unrmzehhHx+TiRvAKGnABFHOipa7uI3wX7ku vEArTQfZh/GCw+JyB4XKjCTTxSFkj5fv69fPNwruKqOYWzqAjuQplkO8LzB4h8QBqmiC 0uqRuio1nM/4urYTq+mG6aARR9kUJc4yffrAftNXvllo9XOwi7gGTzX+BnQrQ0v2d1yp LqlYZFYJp3BMiGbn975L/prH17bQ4DWwd1IumwLWZ0rKUitvRm6wQqcoK6fs7GtSY2Xy 1owQ== X-Forwarded-Encrypted: i=1; AJvYcCVz9kow0Hszf4mwtbIBEgoC04cr3sycHwqPhZ28JxvTgfiAG8j/mgpCLPK+Pqc9N0TR3UhFYHRoVJ8=@lists.freedesktop.org, AJvYcCXjK3l5bluFDaWN20JnZiasE7apuF/BCTZybvxY2h1Go85EAk1f27CN+MXsHhdr/EQg0aEDs2gnr4v1@lists.freedesktop.org X-Gm-Message-State: AOJu0YxCHDNyqTkKVdFi1v8pIQ/to+gYqj9H2/E9FqtaKsczBEUp0BnG E7vNHsFvk1L8QNnRgB6NxLzYN2vStEF8NoY78ZWL0wxc9azT+xpVz1ovAKbCKCEfbbomXi+n9N3 dTJwRkBVuGYBqQL/leJTS6NalbFCqHDk= X-Gm-Gg: ASbGncuhWdZx9pZZ1ifBZLq0EQijTdi8WVQ+AYg5/1SSneLavnf7JJsjB2ET5ENEwNC iX2Wnr3XOyBGMoQGq8Im7YCeXA5nQN5Dm46vD3fO/OCrh8wnuViTWM1C7jpMNdqP1AM7ovxbDHM qXuGCMmgOcyKqHLCmVaTycbGbD9664Qo3dm15gHiyD30G1GBAQxMBKXt5RxEwGdeg1Io4HoGtn5 x3tIg== X-Google-Smtp-Source: AGHT+IGL41V3DbmFvBsWr3jGwFHfcX0duW69mbczpCAOINsa85ECUigYdfUlpWqgF++enxibRnhFFvr8Kxdp2WtP+R0= X-Received: by 2002:a05:651c:2203:b0:32a:8297:54c9 with SMTP id 38308e7fff4ca-32b4a3088bbmr63065741fa.8.1750355294494; Thu, 19 Jun 2025 10:48:14 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: Ryusuke Konishi Date: Fri, 20 Jun 2025 02:47:58 +0900 X-Gm-Features: AX0GCFsRgomy43xV-Lv7Stfld1a1yqIyJ3-ysZ2OVO90S8cEE5UAjZMSvGqxZQ8 Message-ID: Subject: Re: [PATCH 10/10] fs: replace mmap hook with .mmap_prepare for simple mappings To: Lorenzo Stoakes Cc: Andrew Morton , "Liam R . Howlett" , Jens Axboe , Jani Nikula , Joonas Lahtinen , Rodrigo Vivi , Tvrtko Ursulin , David Airlie , Simona Vetter , Eric Van Hensbergen , Latchesar Ionkov , Dominique Martinet , Christian Schoenebeck , David Sterba , David Howells , Marc Dionne , Alexander Viro , Christian Brauner , Jan Kara , Benjamin LaHaise , Miklos Szeredi , Amir Goldstein , Kent Overstreet , "Tigran A . Aivazian" , Kees Cook , Chris Mason , Josef Bacik , Xiubo Li , Ilya Dryomov , Jan Harkes , coda@cs.cmu.edu, Tyler Hicks , Gao Xiang , Chao Yu , Yue Hu , Jeffle Xu , Sandeep Dhavale , Hongbo Li , Namjae Jeon , Sungjong Seo , Yuezhang Mo , "Theodore Ts'o" , Andreas Dilger , Jaegeuk Kim , OGAWA Hirofumi , Viacheslav Dubeyko , John Paul Adrian Glaubitz , Yangtao Li , Richard Weinberger , Anton Ivanov , Johannes Berg , Mikulas Patocka , David Woodhouse , Dave Kleikamp , Trond Myklebust , Anna Schumaker , Konstantin Komarov , Mark Fasheh , Joel Becker , Joseph Qi , Bob Copeland , Mike Marshall , Martin Brandenburg , Steve French , Paulo Alcantara , Ronnie Sahlberg , Shyam Prasad N , Tom Talpey , Bharath SM , Zhihao Cheng , Hans de Goede , Carlos Maiolino , Damien Le Moal , Naohiro Aota , Johannes Thumshirn , Dan Williams , Matthew Wilcox , Vlastimil Babka , Jann Horn , Pedro Falcato , linux-block@vger.kernel.org, linux-kernel@vger.kernel.org, intel-gfx@lists.freedesktop.org, dri-devel@lists.freedesktop.org, v9fs@lists.linux.dev, linux-fsdevel@vger.kernel.org, linux-afs@lists.infradead.org, linux-aio@kvack.org, linux-unionfs@vger.kernel.org, linux-bcachefs@vger.kernel.org, linux-mm@kvack.org, linux-btrfs@vger.kernel.org, ceph-devel@vger.kernel.org, codalist@coda.cs.cmu.edu, ecryptfs@vger.kernel.org, linux-erofs@lists.ozlabs.org, linux-ext4@vger.kernel.org, linux-f2fs-devel@lists.sourceforge.net, linux-um@lists.infradead.org, linux-mtd@lists.infradead.org, jfs-discussion@lists.sourceforge.net, linux-nfs@vger.kernel.org, linux-nilfs@vger.kernel.org, ntfs3@lists.linux.dev, ocfs2-devel@lists.linux.dev, linux-karma-devel@lists.sourceforge.net, devel@lists.orangefs.org, linux-cifs@vger.kernel.org, samba-technical@lists.samba.org, linux-xfs@vger.kernel.org, nvdimm@lists.linux.dev Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Mailman-Approved-At: Fri, 20 Jun 2025 17:39:34 +0000 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" On Tue, Jun 17, 2025 at 4:48=E2=80=AFAM Lorenzo Stoakes wrote: > > Since commit c84bf6dd2b83 ("mm: introduce new .mmap_prepare() file > callback"), the f_op->mmap() hook has been deprecated in favour of > f_op->mmap_prepare(). > > This callback is invoked in the mmap() logic far earlier, so error handli= ng > can be performed more safely without complicated and bug-prone state > unwinding required should an error arise. > > This hook also avoids passing a pointer to a not-yet-correctly-establishe= d > VMA avoiding any issues with referencing this data structure. > > It rather provides a pointer to the new struct vm_area_desc descriptor ty= pe > which contains all required state and allows easy setting of required > parameters without any consideration needing to be paid to locking or > reference counts. > > Note that nested filesystems like overlayfs are compatible with an > .mmap_prepare() callback since commit bb666b7c2707 ("mm: add mmap_prepare= () > compatibility layer for nested file systems"). > > In this patch we apply this change to file systems with relatively simple > mmap() hook logic - exfat, ceph, f2fs, bcachefs, zonefs, btrfs, ocfs2, > orangefs, nilfs2, romfs, ramfs and aio. > > Signed-off-by: Lorenzo Stoakes For nilfs2, Acked-by: Ryusuke Konishi Thanks, Ryusuke Konishi