1. 16 5月, 2022 1 次提交
  2. 02 4月, 2022 5 次提交
  3. 23 3月, 2022 3 次提交
  4. 22 3月, 2022 2 次提交
  5. 17 3月, 2022 1 次提交
  6. 15 3月, 2022 7 次提交
  7. 14 3月, 2022 2 次提交
  8. 09 3月, 2022 2 次提交
  9. 22 1月, 2022 6 次提交
  10. 21 1月, 2022 1 次提交
  11. 15 1月, 2022 1 次提交
  12. 10 1月, 2022 1 次提交
    • A
      fs/locks: fix fcntl_getlk64/fcntl_setlk64 stub prototypes · 0ea9fc15
      Arnd Bergmann 提交于
      My patch to rework oabi fcntl64() introduced a harmless
      sparse warning when file locking is disabled:
      
         arch/arm/kernel/sys_oabi-compat.c:251:51: sparse: sparse: incorrect type in argument 3 (different address spaces) @@     expected struct flock64 [noderef] __user *user @@     got struct flock64 * @@
         arch/arm/kernel/sys_oabi-compat.c:251:51: sparse:     expected struct flock64 [noderef] __user *user
         arch/arm/kernel/sys_oabi-compat.c:251:51: sparse:     got struct flock64 *
         arch/arm/kernel/sys_oabi-compat.c:265:55: sparse: sparse: incorrect type in argument 4 (different address spaces) @@     expected struct flock64 [noderef] __user *user @@     got struct flock64 * @@
         arch/arm/kernel/sys_oabi-compat.c:265:55: sparse:     expected struct flock64 [noderef] __user *user
         arch/arm/kernel/sys_oabi-compat.c:265:55: sparse:     got struct flock64 *
      
      When file locking is enabled, everything works correctly and the
      right data gets passed, but the stub declarations in linux/fs.h
      did not get modified when the calling conventions changed in an
      earlier patch.
      Reported-by: Nkernel test robot <lkp@intel.com>
      Fixes: 7e2d8c29 ("ARM: 9111/1: oabi-compat: rework fcntl64() emulation")
      Fixes: a75d30c7 ("fs/locks: pass kernel struct flock to fcntl_getlk/setlk")
      Cc: Christoph Hellwig <hch@lst.de>
      Reviewed-by: NChristoph Hellwig <hch@lst.de>
      Acked-by: NChristian Brauner <christian.brauner@ubuntu.com>
      Signed-off-by: NArnd Bergmann <arnd@arndb.de>
      Signed-off-by: NJeff Layton <jlayton@kernel.org>
      Signed-off-by: NChuck Lever <chuck.lever@oracle.com>
      0ea9fc15
  13. 07 1月, 2022 2 次提交
  14. 05 12月, 2021 3 次提交
  15. 04 12月, 2021 3 次提交
    • J
      mm: move filemap_range_needs_writeback() into header · 4bdcd1dd
      Jens Axboe 提交于
      No functional changes in this patch, just in preparation for efficiently
      calling this light function from the block O_DIRECT handling.
      Reviewed-by: NMatthew Wilcox (Oracle) <willy@infradead.org>
      Signed-off-by: NJens Axboe <axboe@kernel.dk>
      4bdcd1dd
    • C
      fs: account for filesystem mappings · 1ac2a410
      Christian Brauner 提交于
      Currently we only support idmapped mounts for filesystems mounted
      without an idmapping. This was a conscious decision mentioned in
      multiple places (cf. e.g. [1]).
      
      As explained at length in [3] it is perfectly fine to extend support for
      idmapped mounts to filesystem's mounted with an idmapping should the
      need arise. The need has been there for some time now. Various container
      projects in userspace need this to run unprivileged and nested
      unprivileged containers (cf. [2]).
      
      Before we can port any filesystem that is mountable with an idmapping to
      support idmapped mounts we need to first extend the mapping helpers to
      account for the filesystem's idmapping. This again, is explained at
      length in our documentation at [3] but I'll give an overview here again.
      
      Currently, the low-level mapping helpers implement the remapping
      algorithms described in [3] in a simplified manner. Because we could
      rely on the fact that all filesystems supporting idmapped mounts are
      mounted without an idmapping the translation step from or into the
      filesystem idmapping could be skipped.
      
      In order to support idmapped mounts of filesystem's mountable with an
      idmapping the translation step we were able to skip before cannot be
      skipped anymore. A filesystem mounted with an idmapping is very likely
      to not use an identity mapping and will instead use a non-identity
      mapping. So the translation step from or into the filesystem's idmapping
      in the remapping algorithm cannot be skipped for such filesystems. More
      details with examples can be found in [3].
      
      This patch adds a few new and prepares some already existing low-level
      mapping helpers to perform the full translation algorithm explained in
      [3]. The low-level helpers can be written in a way that they only
      perform the additional translation step when the filesystem is indeed
      mounted with an idmapping.
      
      If the low-level helpers detect that they are not dealing with an
      idmapped mount they can simply return the relevant k{g,u}id unchanged;
      no remapping needs to be performed at all. The no_idmapping() helper
      detects whether the shortcut can be used.
      
      If the low-level helpers detected that they are dealing with an idmapped
      mount but the underlying filesystem is mounted without an idmapping we
      can rely on the previous shorcut and can continue to skip the
      translation step from or into the filesystem's idmapping.
      
      These checks guarantee that only the minimal amount of work is
      performed. As before, if idmapped mounts aren't used the low-level
      helpers are idempotent and no work is performed at all.
      
      This patch adds the helpers mapped_k{g,u}id_fs() and
      mapped_k{g,u}id_user(). Following patches will port all places to
      replace the old k{g,u}id_into_mnt() and k{g,u}id_from_mnt() with these
      two new helpers. After the conversion is done k{g,u}id_into_mnt() and
      k{g,u}id_from_mnt() will be removed. This also concludes the renaming of
      the mapping helpers we started in [4]. Now, all mapping helpers will
      started with the "mapped_" prefix making everything nice and consistent.
      
      The mapped_k{g,u}id_fs() helpers replace the k{g,u}id_into_mnt()
      helpers. They are to be used when k{g,u}ids are to be mapped from the
      vfs, e.g. from from struct inode's i_{g,u}id.  Conversely, the
      mapped_k{g,u}id_user() helpers replace the k{g,u}id_from_mnt() helpers.
      They are to be used when k{g,u}ids are to be written to disk, e.g. when
      entering from a system call to change ownership of a file.
      
      This patch only introduces the helpers. It doesn't yet convert the
      relevant places to account for filesystem mounted with an idmapping.
      
      [1]: commit 2ca4dcc4 ("fs/mount_setattr: tighten permission checks")
      [2]: https://github.com/containers/podman/issues/10374
      [3]: Documentations/filesystems/idmappings.rst
      [4]: commit a65e58e7 ("fs: document and rename fsid helpers")
      
      Link: https://lore.kernel.org/r/20211123114227.3124056-5-brauner@kernel.org (v1)
      Link: https://lore.kernel.org/r/20211130121032.3753852-5-brauner@kernel.org (v2)
      Link: https://lore.kernel.org/r/20211203111707.3901969-5-brauner@kernel.org
      Cc: Seth Forshee <sforshee@digitalocean.com>
      Cc: Amir Goldstein <amir73il@gmail.com>
      Cc: Christoph Hellwig <hch@lst.de>
      Cc: Al Viro <viro@zeniv.linux.org.uk>
      CC: linux-fsdevel@vger.kernel.org
      Reviewed-by: NSeth Forshee <sforshee@digitalocean.com>
      Signed-off-by: NChristian Brauner <christian.brauner@ubuntu.com>
      1ac2a410
    • C
      fs: tweak fsuidgid_has_mapping() · 476860b3
      Christian Brauner 提交于
      If the caller's fs{g,u}id aren't mapped in the mount's idmapping we can
      return early and skip the check whether the mapped fs{g,u}id also have a
      mapping in the filesystem's idmapping. If the fs{g,u}id aren't mapped in
      the mount's idmapping they consequently can't be mapped in the
      filesystem's idmapping. So there's no point in checking that.
      
      Link: https://lore.kernel.org/r/20211123114227.3124056-4-brauner@kernel.org (v1)
      Link: https://lore.kernel.org/r/20211130121032.3753852-4-brauner@kernel.org (v2)
      Link: https://lore.kernel.org/r/20211203111707.3901969-4-brauner@kernel.org
      Cc: Seth Forshee <sforshee@digitalocean.com>
      Cc: Christoph Hellwig <hch@lst.de>
      Cc: Al Viro <viro@zeniv.linux.org.uk>
      CC: linux-fsdevel@vger.kernel.org
      Reviewed-by: NAmir Goldstein <amir73il@gmail.com>
      Reviewed-by: NSeth Forshee <sforshee@digitalocean.com>
      Signed-off-by: NChristian Brauner <christian.brauner@ubuntu.com>
      476860b3