Yes I upgraded to kernel 4.18 and async fsync works as expected. Thank you Darrick, and Dave for your quick response! Shawn On Sat, Oct 29, 2022 at 2:01 PM Dave Chinner <david@xxxxxxxxxxxxx> wrote: > > On Fri, Oct 28, 2022 at 03:11:15PM -0700, Neutron Sharc wrote: > > Hello all, > > I have a workload that benefits the most if I can issue async fsync > > after many async writes are completed. I was under the impression that > > xfs/ext4 both support async fsync so I can use libaio to submit fsync. > > When I tested with io_submit(fsync), it always returned EINVAL. So I > > browsed the linux source (both kernel 3.10, 4.14) and I found > > xfs/xfs_file.c doesn't implement "aio_fsync", nor does ext4/file.c. > > Generic support for IOCB_CMD_FSYNC and IOCB_CMD_FDSYNC was added > into 4.17. As a result it should be supported by almost all > filesystems, not just XFS.... > > > I found an old post which said aio_fsync was already included in xfs > > (https://www.spinics.net/lists/xfs/msg28408.html) > > Yeah, the code that went into fs/aio.c was pretty much a generic > version of this. > > > What xfs or kernel version should I use to get aio_fsync working? Thanks all. > > Just a kernel that isn't ancient. If you are looking for features, > always check latest code first, then go back and find when it was > merged (git log, git blame, etc). That's all I did.... > > -Dave. > -- > Dave Chinner > david@xxxxxxxxxxxxx