• Jan Kara's avatar
    aio: fix freeze protection of aio writes · 70fe2f48
    Jan Kara authored
    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().
    Reported-by: default avatarDmitry Monakhov <dmonakhov@openvz.org>
    Signed-off-by: default avatarJan Kara <jack@suse.cz>
    [hch: forward ported on top of various VFS and aio changes]
    Signed-off-by: default avatarChristoph Hellwig <hch@lst.de>
    Signed-off-by: default avatarAl Viro <viro@zeniv.linux.org.uk>
    70fe2f48
aio.c 43.9 KB