From patchwork Tue Nov 7 14:49:05 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christian Brauner X-Patchwork-Id: 162522 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:aa0b:0:b0:403:3b70:6f57 with SMTP id k11csp285054vqo; Tue, 7 Nov 2023 06:53:34 -0800 (PST) X-Google-Smtp-Source: AGHT+IFSPtH7B+Y5cRkRxGRb4CeI/9PvReTPkuU6EBU8ClT5BnH8fJZu1QcLV0CchAmEEBd9B07O X-Received: by 2002:a05:6358:5e08:b0:168:e438:15e5 with SMTP id q8-20020a0563585e0800b00168e43815e5mr30253344rwn.29.1699368813972; Tue, 07 Nov 2023 06:53:33 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1699368813; cv=none; d=google.com; s=arc-20160816; b=zeGSanG0oUIH2DqPzhd3K39QHujkFLg6pYqXoc631nbpF69c4v6Vs2NqABYGuNqyzR G+tJQyqyq97GybbXeQso1vvmgAv+cxNZQJrh2mD3adE2x4ZEp6GwaepVdk3Xuk6WGD52 lhqxjp1eKoOifTdfaqubtr9iLriolqD/7m4Y6ikP+JvfIZJdAhqyY71OBGip+mWl+xpy iZ3wtsNAqL6TEloXuaxjiMQCONxQPb38hYjm8yOr0Cie+KZGM4g0wvSxJB1YsfOmTt3/ OOmlPhvvBumz1RkLSfmf6iIbk+xalSHmuh/cTL/qr8mypyHf6HpcwKr3NzzNRDaA9YOb efrw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=alLVC68hzAiZiTVKWs9aSFFAkl6PwdKAJWv7QTAZfL0=; fh=qDZ+YnS9HJbCVOaeWFr2FnYZt7eE+vt5IJIDIlhBdxU=; b=wglemdPLpBTADVpeLnpozm/RdDVuS9hE66amkKJmcdviVtsG6ldH+azdGsRxi9IeYv tvxcb57fBSKAbq4us7aYiKJ+KUSihADrGgJBKjt7VxF/lfSjXGSzZnD5RNBdtblhn4vG hJISSlC56FQvl2G7zO7/zKYUijVwcwMaIqoEHGsrBwYNwc0dMX428VY7tKTDJhvlI2DH /Y8TBheh4C7WMmndfHu1SW2xTlGsv7CtAt2jDvfGlJQKK8+6aI7o09tOCrbo0qnum+xA VqCqflrHpmYcM+dUweeB5667a762vY8JNWM91r+K97AUVoKuGGXsrLJtNc3UsQH019+4 TDJg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=Cve460iX; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from snail.vger.email (snail.vger.email. [23.128.96.37]) by mx.google.com with ESMTPS id 82-20020a630155000000b005b982b4f5a9si2160684pgb.429.2023.11.07.06.53.33 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 07 Nov 2023 06:53:33 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) client-ip=23.128.96.37; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=Cve460iX; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by snail.vger.email (Postfix) with ESMTP id CB9DF82164C0; Tue, 7 Nov 2023 06:53:32 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at snail.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234092AbjKGOxW (ORCPT + 32 others); Tue, 7 Nov 2023 09:53:22 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43588 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230186AbjKGOxU (ORCPT ); Tue, 7 Nov 2023 09:53:20 -0500 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E8994102 for ; Tue, 7 Nov 2023 06:53:17 -0800 (PST) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 277B4C433C8; Tue, 7 Nov 2023 14:53:15 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1699368797; bh=MaOv3uRMTC7lQ4NBx17LlalIHL3gMHwO/4ig3t9FTYs=; h=From:To:Cc:Subject:Date:From; b=Cve460iXGtNGqEQBh35z3TRxbV692UkhDwnIZjC4goeiVD1FKzANJVhDacbDYEg+8 JwOxD7xS9Qn8c/fwnX+RhI2QpQo19IvuVhmXMjwbOHHhfUwfN9+YTanzKOZwDYTp3I wi6tay+6pPLsdBsjt2AzuIyGBCLeMYVfQHxNcMapQT7cnKeMDcgElWuGJrsmHH5n8k Psi3goSxXLERogy58YG2o2r+XJ1p3QMERhltU1gd0/veaLqUVm2Pk6c4kRqy6b1+LZ 1b6QUx4KiCoBdRupYUF68xQFXHEW7EOQJkaDyMn62b9bw8y15UfCa4wOKaozVN7eTW x8ZExeoC7jDPw== From: Christian Brauner To: Linus Torvalds Cc: Christian Brauner , linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [GIT PULL] vfs fanotify fsid updates Date: Tue, 7 Nov 2023 15:49:05 +0100 Message-Id: <20231107-vfs-fsid-5037e344d215@brauner> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=4496; i=brauner@kernel.org; h=from:subject:message-id; bh=7h6GXlgDapiairCQv3vt5Tjr1T20Utak+PtBsBNKJ5E=; b=owGbwMvMwCU28Zj0gdSKO4sYT6slMaR6+dpwqH/9ckt6gubHD4Vz9r/Lfx0iuMizt6lQp2XrR7up S1raO0pZGMS4GGTFFFkc2k3C5ZbzVGw2ytSAmcPKBDKEgYtTACYSd4aRYaeJzP7sm27pBw99O3PN8v +Lirdi611WzVI8fdz/jzC7nRzDH34Oxrp3Itft1z6Y6RG8d4pBL5PAnU8ac7xz3fNz0ywmcwMA X-Developer-Key: i=brauner@kernel.org; a=openpgp; fpr=4880B8C9BD0E5106FC070F4F7B3C391EFEA93624 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF, RCVD_IN_DNSWL_BLOCKED,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (snail.vger.email [0.0.0.0]); Tue, 07 Nov 2023 06:53:32 -0800 (PST) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1781917353439558458 X-GMAIL-MSGID: 1781917353439558458 Hey Linus, /* Summary */ This work is part of the plan to enable fanotify to serve as a drop-in replacement for inotify. While inotify is availabe on all filesystems, fanotify currently isn't. In order to support fanotify on all filesystems two things are needed: (1) all filesystems need to support AT_HANDLE_FID (2) all filesystems need to report a non-zero f_fsid This pull request contains (1) and allows filesystems to encode non-decodable file handlers for fanotify without implementing any exportfs operations by encoding a file id of type FILEID_INO64_GEN from i_ino and i_generation. Filesystems that want to opt out of encoding non-decodable file ids for fanotify that don't support NFS export can do so by providing an empty export_operations struct. The pull request also partially addresses (2) by generating f_fsid for simple filesystems as well as freevxfs. Remaining filesystems will be dealt with by separate patches. Finally, this contains the patch from the current exportfs maintainers which moves exportfs under vfs with Chuck, Jeff, and Amir as maintainers and vfs.git as tree. /* Testing */ clang: Debian clang version 16.0.6 (16) gcc: gcc (Debian 13.2.0-5) 13.2.0 All patches are based on v6.6-rc7 and have been sitting in linux-next. A single build failure was reported but has since been fixed. /* Conflicts */ This will have a merge conflict with the vfs-6.7.iomap pull request I sent out earlier: [GIT PULL] vfs iomap updates https://lore.kernel.org/r/20231107-vfs-iomap-60b485c2b4fb@brauner It should be fairly obvious how to resolve. It will also have a merge conflict with current mainline that I suggest to resolve as: +++ b/Documentation/filesystems/porting.rst @@@ -1050,5 -1050,7 +1050,14 @@@ kill_anon_super(), or kill_block_super( **mandatory** +Lock ordering has been changed so that s_umount ranks above open_mutex again. +All places where s_umount was taken under open_mutex have been fixed up. ++ ++--- ++ ++**mandatory** ++ + export_operations ->encode_fh() no longer has a default implementation to + encode FILEID_INO32_GEN* file handles. + Filesystems that used the default implementation may use the generic helper + generic_encode_ino32_fh() explicitly. The following changes since commit 05d3ef8bba77c1b5f98d941d8b2d4aeab8118ef1: Linux 6.6-rc7 (2023-10-22 12:11:21 -1000) are available in the Git repository at: git@gitolite.kernel.org:pub/scm/linux/kernel/git/vfs/vfs tags/vfs-6.7.fsid for you to fetch changes up to 4ad714df58e646d4b2a454a7dface8ff903911c4: MAINTAINERS: create an entry for exportfs (2023-11-07 15:06:01 +0100) Please consider pulling these changes from the signed vfs-6.7.fsid tag. Thanks! Christian ---------------------------------------------------------------- vfs-6.7.fsid ---------------------------------------------------------------- Amir Goldstein (8): exportfs: add helpers to check if filesystem can encode/decode file handles exportfs: make ->encode_fh() a mandatory method for NFS export exportfs: define FILEID_INO64_GEN* file handle types exportfs: support encoding non-decodeable file handles by default fs: report f_fsid from s_dev for "simple" filesystems freevxfs: derive f_fsid from bdev->bd_dev fs: fix build error with CONFIG_EXPORTFS=m or not defined MAINTAINERS: create an entry for exportfs Documentation/filesystems/nfs/exporting.rst | 7 +--- Documentation/filesystems/porting.rst | 9 +++++ MAINTAINERS | 13 ++++++- fs/affs/namei.c | 1 + fs/befs/linuxvfs.c | 1 + fs/efivarfs/super.c | 2 + fs/efs/super.c | 1 + fs/erofs/super.c | 1 + fs/exportfs/expfs.c | 57 ++++++++++------------------- fs/ext2/super.c | 1 + fs/ext4/super.c | 1 + fs/f2fs/super.c | 1 + fs/fat/nfs.c | 1 + fs/fhandle.c | 6 +-- fs/freevxfs/vxfs_super.c | 2 + fs/fuse/inode.c | 7 ++-- fs/hugetlbfs/inode.c | 2 + fs/jffs2/super.c | 1 + fs/jfs/super.c | 1 + fs/libfs.c | 44 ++++++++++++++++++++++ fs/nfsd/export.c | 3 +- fs/notify/fanotify/fanotify_user.c | 4 +- fs/ntfs/namei.c | 1 + fs/ntfs3/super.c | 1 + fs/overlayfs/util.c | 2 +- fs/smb/client/export.c | 11 +++--- fs/squashfs/export.c | 1 + fs/ufs/super.c | 1 + include/linux/exportfs.h | 50 +++++++++++++++++++++++-- 29 files changed, 168 insertions(+), 65 deletions(-) diff --cc Documentation/filesystems/porting.rst index d69f59700a23,9cc6cb27c4d5..000000000000 --- a/Documentation/filesystems/porting.rst