History

aio: fix freeze protection of aio writes

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().

Jan Kara committed 10 years ago

Commit 70fe2f41 parent 89319d32 files · +19 −1Browse files

Showing the changes to include/linux (1 of 2 files). Show all

Unified · Split

include/linux/fs.h+1−0
@@ -321,6 +321,7 @@ struct writeback_control; · 320 unmodified lines
321321 #define IOCB_HIPRI (1 << 3)
322322 #define IOCB_DSYNC (1 << 4)
323323 #define IOCB_SYNC (1 << 5)
324+#define IOCB_WRITE (1 << 6)
324325
325326 struct kiocb {
326327 struct file *ki_filp;