Commit bbb20ea9 authored by Xiubo Li's avatar Xiubo Li Committed by Ilya Dryomov

ceph: always set initial i_blkbits to CEPH_FSCRYPT_BLOCK_SHIFT

The fscrypt code will use i_blkbits to setup ci_data_unit_bits when
allocating the new inode, but ceph will initiate i_blkbits ater when
filling the inode, which is too late. Since ci_data_unit_bits will only
be used by the fscrypt framework so initiating i_blkbits with
CEPH_FSCRYPT_BLOCK_SHIFT is safe.

Link: https://tracker.ceph.com/issues/64035
Fixes: 5b118884 ("fscrypt: support crypto data unit size less than filesystem block size")
Signed-off-by: default avatarXiubo Li <xiubli@redhat.com>
Reviewed-by: default avatarEric Biggers <ebiggers@google.com>
Signed-off-by: default avatarIlya Dryomov <idryomov@gmail.com>
parent 8e46a2d0
......@@ -78,6 +78,8 @@ struct inode *ceph_new_inode(struct inode *dir, struct dentry *dentry,
if (!inode)
return ERR_PTR(-ENOMEM);
inode->i_blkbits = CEPH_FSCRYPT_BLOCK_SHIFT;
if (!S_ISLNK(*mode)) {
err = ceph_pre_init_acls(dir, mode, as_ctx);
if (err < 0)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment