I stumbled across another local FS call in vfs_ceph: 1025 static int strict_allocate_ftruncate(struct vfs_handle_struct *handle, files_struct *fsp, off_t len) 1026 { ... 1048 /* Shrink - just ftruncate. */ 1049 if (pst->st_ex_size > len) 1050 return ftruncate(fsp->fh->fd, len); This is in the disabled-by-default "strict allocate = yes" vfs_ceph ftruncate code path, so is unlikely to be tripped, but still needs to be fixed. Alongside this fix, it should also be possible to rip out the unnecessary ceph_ftruncate() and ceph_fallocate() fallback logic.
In testing a fix for this I've found that vfs_ceph is also missing an .fallocate_fn hook, which sees it also fallback to local FS I/O (vfs_default) for SMB_VFS_FALLOCATE(), which also happens to be called by strict_allocate_ftruncate(). I'll add an extra fix to address this for this ticket.
Created attachment 14874 [details] backport for 4.8.next
Created attachment 14875 [details] cherry-pick for 4.9.next
Created attachment 14876 [details] cherry-pick for 4.10.next
hi Günther, did you get a chance to look at the backports?
Comment on attachment 14876 [details] cherry-pick for 4.10.next LGTM
Comment on attachment 14875 [details] cherry-pick for 4.9.next LGTM
Comment on attachment 14874 [details] backport for 4.8.next LGTM
Karolin, please add to 4.8, 4.9 and 4.10. Thanks!
(In reply to Guenther Deschner from comment #9) Pushed to autobuild-v4-{10,9,8}-test
(In reply to Karolin Seeger from comment #10) Pushed to all branches. Closing out bug report. Thanks!