Currently we dropped freeze protection of aio writes just after IO was submitted. Thus aio write could be in flight while the filesystem was frozen and that could result in unexpected situation like aio completion wanting to convert extent type on frozen filesystem. Testcase from Dmitry triggering this is like: for ((i=0;i<60;i++));do fsfreeze -f /mnt ;sleep 1;fsfreeze -u /mnt;done & fio --bs=4k --ioengine=libaio --iodepth=128 --size=1g --direct=1 \ --runtime=60 --filename=/mnt/file --name=rand-write --rw=randwrite Fix the problem by dropping freeze protection only once IO is completed in aio_complete().
Showing the changes to include/linux (1 of 2 files). Show all
Unified · Split
| @@ -321,6 +321,7 @@ struct writeback_control; · 320 unmodified lines | ||
| 321 | 321 | #define IOCB_HIPRI (1 << 3) |
| 322 | 322 | #define IOCB_DSYNC (1 << 4) |
| 323 | 323 | #define IOCB_SYNC (1 << 5) |
| 324 | +#define IOCB_WRITE (1 << 6) | |
| 324 | 325 | |
| 325 | 326 | struct kiocb { |
| 326 | 327 | struct file *ki_filp; |