Re: [RFC PATCH v6 20/20] ceph: add fscrypt ioctls

Luis Henriques
2021-04-19T10:07:46Z

Hi Jeff!

Jeff Layton <jlayton@kernel.org> writes:
<...>
> +
> + case FS_IOC_ADD_ENCRYPTION_KEY:
> + ret = vet_mds_for_fscrypt(file);
> + if (ret)
> + return ret;
> + atomic_inc(&ci->i_shared_gen);

After spending some (well... a lot, actually) time looking at the MDS code
to try to figure out my bug, I'm back at this point in the kernel client
code. I understand that this code is trying to invalidate the directory
dentries here. However, I just found that the directory we get at this
point is the filesystem root directory, and not the directory we're trying
to unlock.

So, I still don't fully understand the issue I'm seeing, but I believe the
code above is assuming 'ci' is the inode being unlocked, which isn't
correct.

(Note: I haven't checked if there are other ioctls getting the FS root.)

Cheers,
--
Luis