Skip to content

Commit e2cf1f1

Browse files
committed
CacheFiles: Handle rename2
Not all filesystems now provide the rename i_op - ext4 for one - but rather provide the rename2 i_op. CacheFiles checks that the filesystem has rename and so will reject ext4 now with EPERM: CacheFiles: Failed to register: -1 Fix this by checking for rename2 as an alternative. The call to vfs_rename() actually handles selection of the appropriate function, so we needn't worry about that. Turning on debugging shows: [cachef] ==> cachefiles_get_directory(,,cache) [cachef] subdir -> ffff88000b22b778 positive [cachef] <== cachefiles_get_directory() = -1 [check] where -1 is EPERM. Signed-off-by: David Howells <dhowells@redhat.com>
1 parent 696382f commit e2cf1f1

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

fs/cachefiles/namei.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -779,7 +779,8 @@ struct dentry *cachefiles_get_directory(struct cachefiles_cache *cache,
779779
!subdir->d_inode->i_op->lookup ||
780780
!subdir->d_inode->i_op->mkdir ||
781781
!subdir->d_inode->i_op->create ||
782-
!subdir->d_inode->i_op->rename ||
782+
(!subdir->d_inode->i_op->rename &&
783+
!subdir->d_inode->i_op->rename2) ||
783784
!subdir->d_inode->i_op->rmdir ||
784785
!subdir->d_inode->i_op->unlink)
785786
goto check_error;

0 commit comments

Comments
 (0)