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
321#define IOCB_HIPRI (1 << 3)321#define IOCB_HIPRI (1 << 3)
322#define IOCB_DSYNC (1 << 4)322#define IOCB_DSYNC (1 << 4)
323#define IOCB_SYNC (1 << 5)323#define IOCB_SYNC (1 << 5)
324#define IOCB_WRITE (1 << 6)
324 325
325struct kiocb {326struct kiocb {
326 struct file *ki_filp;327 struct file *ki_filp;