Merge tag 'vfs-6.10-rc8.fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/vfs/vfs
authorLinus Torvalds <torvalds@linux-foundation.org>
Thu, 11 Jul 2024 16:03:28 +0000 (09:03 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Thu, 11 Jul 2024 16:03:28 +0000 (09:03 -0700)
Pull vfs fixes from Christian Brauner:
 "cachefiles:

   - Export an existing and add a new cachefile helper to be used in
     filesystems to fix reference count bugs

   - Use the newly added fscache_ty_get_volume() helper to get a
     reference count on an fscache_volume to handle volumes that are
     about to be removed cleanly

   - After withdrawing a fscache_cache via FSCACHE_CACHE_IS_WITHDRAWN
     wait for all ongoing cookie lookups to complete and for the object
     count to reach zero

   - Propagate errors from vfs_getxattr() to avoid an infinite loop in
     cachefiles_check_volume_xattr() because it keeps seeing ESTALE

   - Don't send new requests when an object is dropped by raising
     CACHEFILES_ONDEMAND_OJBSTATE_DROPPING

   - Cancel all requests for an object that is about to be dropped

   - Wait for the ondemand_boject_worker to finish before dropping a
     cachefiles object to prevent use-after-free

   - Use cyclic allocation for message ids to better handle id recycling

   - Add missing lock protection when iterating through the xarray when
     polling

  netfs:

   - Use standard logging helpers for debug logging

  VFS:

   - Fix potential use-after-free in file locks during
     trace_posix_lock_inode(). The tracepoint could fire while another
     task raced it and freed the lock that was requested to be traced

   - Only increment the nr_dentry_negative counter for dentries that are
     present on the superblock LRU. Currently, DCACHE_LRU_LIST list is
     used to detect this case. However, the flag is also raised in
     combination with DCACHE_SHRINK_LIST to indicate that dentry->d_lru
     is used. So checking only DCACHE_LRU_LIST will lead to wrong
     nr_dentry_negative count. Fix the check to not count dentries that
     are on a shrink related list

  Misc:

   - hfsplus: fix an uninitialized value issue in copy_name

   - minix: fix minixfs_rename with HIGHMEM. It still uses kunmap() even
     though we switched it to kmap_local_page() a while ago"

* tag 'vfs-6.10-rc8.fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/vfs/vfs:
  minixfs: Fix minixfs_rename with HIGHMEM
  hfsplus: fix uninit-value in copy_name
  vfs: don't mod negative dentry count when on shrinker list
  filelock: fix potential use-after-free in posix_lock_inode
  cachefiles: add missing lock protection when polling
  cachefiles: cyclic allocation of msg_id to avoid reuse
  cachefiles: wait for ondemand_object_worker to finish when dropping object
  cachefiles: cancel all requests for the object that is being dropped
  cachefiles: stop sending new request when dropping object
  cachefiles: propagate errors from vfs_getxattr() to avoid infinite loop
  cachefiles: fix slab-use-after-free in cachefiles_withdraw_cookie()
  cachefiles: fix slab-use-after-free in fscache_withdraw_volume()
  netfs, fscache: export fscache_put_volume() and add fscache_try_get_volume()
  netfs: Switch debug logging to pr_debug()

1  2 
fs/dcache.c
fs/locks.c
fs/netfs/buffered_write.c
fs/netfs/direct_write.c
fs/netfs/internal.h
fs/netfs/misc.c
fs/netfs/write_issue.c

diff --cc fs/dcache.c
Simple merge
diff --cc fs/locks.c
Simple merge
Simple merge
index 88f2adfab75e926969a8fae3c4bf65051644f0ed,28b3c4396096e00638dc5821ae3523c7d52507bd..792ef17bae21d57c5bf4959f55e68fdf1a493dd7
@@@ -92,11 -92,10 +92,11 @@@ ssize_t netfs_unbuffered_write_iter_loc
        __set_bit(NETFS_RREQ_UPLOAD_TO_SERVER, &wreq->flags);
        if (async)
                wreq->iocb = iocb;
 +      wreq->len = iov_iter_count(&wreq->io_iter);
        wreq->cleanup = netfs_cleanup_dio_write;
 -      ret = netfs_unbuffered_write(wreq, is_sync_kiocb(iocb), iov_iter_count(&wreq->io_iter));
 +      ret = netfs_unbuffered_write(wreq, is_sync_kiocb(iocb), wreq->len);
        if (ret < 0) {
-               _debug("begin = %zd", ret);
+               kdebug("begin = %zd", ret);
                goto out;
        }
  
Simple merge
diff --cc fs/netfs/misc.c
Simple merge
Simple merge