[PATCH] ceph: shrink dcache when adding a key

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Any extant dentries under a directory will be invalid once a key is
added to the directory. Prune any child dentries of the parent after
adding a key.

Cc: Luís Henriques <lhenriques@xxxxxxx>
Signed-off-by: Jeff Layton <jlayton@xxxxxxxxxx>
---
 fs/ceph/ioctl.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

This one is for the ceph+fscrypt series.

Luis, this seems to fix 580 and 593 for me. 595 still fails with it, but
that one is more related to file contents.

diff --git a/fs/ceph/ioctl.c b/fs/ceph/ioctl.c
index 9675ef3a6c47..12d5469c5df2 100644
--- a/fs/ceph/ioctl.c
+++ b/fs/ceph/ioctl.c
@@ -397,7 +397,10 @@ long ceph_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
 		ret = vet_mds_for_fscrypt(file);
 		if (ret)
 			return ret;
-		return fscrypt_ioctl_add_key(file, (void __user *)arg);
+		ret = fscrypt_ioctl_add_key(file, (void __user *)arg);
+		if (ret == 0)
+			shrink_dcache_parent(file_dentry(file));
+		return ret;
 
 	case FS_IOC_REMOVE_ENCRYPTION_KEY:
 		return fscrypt_ioctl_remove_key(file, (void __user *)arg);
-- 
2.35.1




[Index of Archives]     [CEPH Users]     [Ceph Large]     [Ceph Dev]     [Information on CEPH]     [Linux BTRFS]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux