Skip to content

Commit bbb20ea

Browse files
lxbszidryomov
authored andcommitted
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: 5b11888 ("fscrypt: support crypto data unit size less than filesystem block size") Signed-off-by: Xiubo Li <xiubli@redhat.com> Reviewed-by: Eric Biggers <ebiggers@google.com> Signed-off-by: Ilya Dryomov <idryomov@gmail.com>
1 parent 8e46a2d commit bbb20ea

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

fs/ceph/inode.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,8 @@ struct inode *ceph_new_inode(struct inode *dir, struct dentry *dentry,
7878
if (!inode)
7979
return ERR_PTR(-ENOMEM);
8080

81+
inode->i_blkbits = CEPH_FSCRYPT_BLOCK_SHIFT;
82+
8183
if (!S_ISLNK(*mode)) {
8284
err = ceph_pre_init_acls(dir, mode, as_ctx);
8385
if (err < 0)

0 commit comments

Comments
 (0)