summaryrefslogtreecommitdiffstats
path: root/fs/cachefiles
diff options
context:
space:
mode:
authorDavid Howells <dhowells@redhat.com>2022-01-07 10:57:45 +0000
committerDavid Howells <dhowells@redhat.com>2022-01-21 21:36:28 +0000
commit6633213139d827fb9abf9a9a280f3d9e89fc7091 (patch)
tree73b603360942f71883ec614b48325161f0348b50 /fs/cachefiles
parent14b9d0902dfa25dac9c41bf346aa655fdeafe5b2 (diff)
downloadlinux-stable-6633213139d827fb9abf9a9a280f3d9e89fc7091.tar.gz
linux-stable-6633213139d827fb9abf9a9a280f3d9e89fc7091.tar.bz2
linux-stable-6633213139d827fb9abf9a9a280f3d9e89fc7091.zip
cachefiles: Check that the backing filesystem supports tmpfiles
Add a check that the backing filesystem supports the creation of tmpfiles[1]. Suggested-by: Jeff Layton <jlayton@kernel.org> Signed-off-by: David Howells <dhowells@redhat.com> Reviewed-by: Jeff Layton <jlayton@kernel.org> cc: linux-cachefs@redhat.com Link: https://lore.kernel.org/r/568749bd7cc02908ecf6f3d6a611b6f9cf5c4afd.camel@kernel.org/ [1] Link: https://lore.kernel.org/r/164251406558.3435901.1249023136670058162.stgit@warthog.procyon.org.uk/ # v1
Diffstat (limited to 'fs/cachefiles')
-rw-r--r--fs/cachefiles/cache.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/fs/cachefiles/cache.c b/fs/cachefiles/cache.c
index 2b2879c5d1d2..7077f72e6f47 100644
--- a/fs/cachefiles/cache.c
+++ b/fs/cachefiles/cache.c
@@ -51,6 +51,7 @@ int cachefiles_add_cache(struct cachefiles_cache *cache)
/* Check features of the backing filesystem:
* - Directories must support looking up and directory creation
+ * - We create tmpfiles to handle invalidation
* - We use xattrs to store metadata
* - We need to be able to query the amount of space available
* - We want to be able to sync the filesystem when stopping the cache
@@ -60,6 +61,7 @@ int cachefiles_add_cache(struct cachefiles_cache *cache)
if (d_is_negative(root) ||
!d_backing_inode(root)->i_op->lookup ||
!d_backing_inode(root)->i_op->mkdir ||
+ !d_backing_inode(root)->i_op->tmpfile ||
!(d_backing_inode(root)->i_opflags & IOP_XATTR) ||
!root->d_sb->s_op->statfs ||
!root->d_sb->s_op->sync_fs ||