Hi, it is quite possible for O_DIRECT and buffered writes to a file to race. The xfstests test suite has a test - generic/036 - which tests this case. Unlike most filesystems, cephfs does not hold inode_lock() across direct writes. This means that buffer pages can become dirty while direct writes are happening. This confused ceph a little. The following two patches allow ceph to handle this possibility a little more cleanly. The more important patch removes a WARN_ON() for a circumstance which can easily be triggered. Thanks, NeilBrown
Attachment:
signature.asc
Description: PGP signature