2022-08-12 11:11 GMT+09:00, Hyunchul Lee <hyc.lee@xxxxxxxxx>: > Remove unnecessary generic_fillattr to fix wrong > AllocationSize of SMB2_CREATE response, And > Move the call of ksmbd_vfs_getattr above the place > where stat is needed because of truncate. > > This patch fixes wrong AllocationSize of SMB2_CREATE > response. Because ext4 updates inode->i_blocks only > when disk space is allocated, generic_fillattr does > not set stat.blocks properly for delayed allocation. > But ext4 returns the blocks that include the delayed > allocation blocks when getattr is called. > > The issue can be reproduced with commands below: > > touch ${FILENAME} > xfs_io -c "pwrite -S 0xAB 0 40k" ${FILENAME} > xfs_io -c "stat" ${FILENAME} > > 40KB are written, but the count of blocks is 8. > > Signed-off-by: Hyunchul Lee <hyc.lee@xxxxxxxxx> Acked-by: Namjae Jeon <linkinjeon@xxxxxxxxxx> Thanks!