[Linux-cachefs] [GIT PULL] netfs: Potential deadlock and error handling fixes

2021-12-07 Thread David Howells
635dacf38e46d60bf3d4eb1: Linux 5.16-rc4 (2021-12-05 14:08:22 -0800) are available in the Git repository at: git://git.kernel.org/pub/scm/linux/kernel/git/dhowells/linux-fs.git tags/netfs-fixes-20211207 for you to fetch changes up to 3cfef1b612e15a0c2f5b1c9d3f3f31ad72d56fcd: netfs: fix param

Re: [Linux-cachefs] [PATCH] cachefiles: fix __cachefiles_prepare_write() error handling

2021-12-07 Thread David Howells
Arnd Bergmann wrote: > pos = cachefiles_inject_remove_error(); > - if (pos == 0) > - ret = vfs_fallocate(file, FALLOC_FL_PUNCH_HOLE | > FALLOC_FL_KEEP_SIZE, > - *_start, *_len); > + if (pos != 0) > + return 0; > + > + ret

[Linux-cachefs] [PATCH v2 0/2] ceph: adapt ceph to the fscache rewrite

2021-12-07 Thread Jeff Layton
v2: address David's review comments remove ceph_fscache_list infrastructure This is a follow-on set for David Howells' recent patchset to rewrite the fscache and cachefiles infrastructure. This re-enables fscache read support in the ceph driver (which is disabled by David's patchset), and also

[Linux-cachefs] [PATCH v2 2/2] ceph: add fscache writeback support

2021-12-07 Thread Jeff Layton
When updating the backing store from the pagecache (a'la writepage or writepages), write to the cache first. This allows us to keep caching files even when they are being written, as long as we have appropriate caps. Signed-off-by: Jeff Layton --- fs/ceph/addr.c | 67

[Linux-cachefs] [PATCH v2 1/2] ceph: conversion to new fscache API

2021-12-07 Thread Jeff Layton
Now that the fscache API has been reworked and simplified, change ceph over to use it. With the old API, we would only instantiate a cookie when the file was open for reads. Change it to instantiate the cookie when the inode is instantiated and call use/unuse when the file is opened/closed. Also,

[Linux-cachefs] [PATCH] cachefiles: fix __cachefiles_prepare_write() error handling

2021-12-07 Thread Arnd Bergmann
From: Arnd Bergmann clang points out that __cachefiles_prepare_write() returns an uninitialized error code in one of the code paths: fs/cachefiles/io.c:489:6: error: variable 'ret' is used uninitialized whenever 'if' condition is false [-Werror,-Wsometimes-uninitialized] if (pos == 0)

Re: [Linux-cachefs] [PATCH] mm: mask DIRECT_RECLAIM in kswapd

2021-12-07 Thread Zhaoyang Huang
On Tue, Dec 7, 2021 at 9:23 AM Andrew Morton wrote: > > On Mon, 6 Dec 2021 11:19:22 +0800 Huangzhaoyang > wrote: > > > From: Zhaoyang Huang > > > > As the eg bellowing, using GFP_KERNEL could confuse the registered > > .releasepage > > or .shrinker functions when called in kswapd and have the

Re: [Linux-cachefs] [PATCH] netfs: fix parameter of cleanup()

2021-12-07 Thread Jeff Layton
On Tue, 2021-12-07 at 11:14 +0800, Jeffle Xu wrote: > The order of these two parameters is just reversed. gcc didn't warn on > that, probably because 'void *' can be converted from or to other > pointer types without warning. > > Cc: sta...@vger.kernel.org > Fixes: 3d3c95046742 ("netfs: Provide re

Re: [Linux-cachefs] [PATCH] netfs: Fix lockdep warning from taking sb_writers whilst holding mmap_lock

2021-12-07 Thread David Howells
Matthew Wilcox wrote: > On Tue, Dec 07, 2021 at 11:19:35AM +, David Howells wrote: > > Taking sb_writers whilst holding mmap_lock isn't allowed and will result in > > a lockdep warning like that below. The problem comes from cachefiles > > needing to take the sb_writers lock in order to do a

Re: [Linux-cachefs] [PATCH] netfs: Fix lockdep warning from taking sb_writers whilst holding mmap_lock

2021-12-07 Thread Matthew Wilcox
On Tue, Dec 07, 2021 at 11:19:35AM +, David Howells wrote: > Taking sb_writers whilst holding mmap_lock isn't allowed and will result in > a lockdep warning like that below. The problem comes from cachefiles > needing to take the sb_writers lock in order to do a write to the cache, > but being

[Linux-cachefs] [PATCH] netfs: Fix lockdep warning from taking sb_writers whilst holding mmap_lock

2021-12-07 Thread David Howells
Taking sb_writers whilst holding mmap_lock isn't allowed and will result in a lockdep warning like that below. The problem comes from cachefiles needing to take the sb_writers lock in order to do a write to the cache, but being asked to do this by netfslib called from readpage, readahead or write_