]> www.infradead.org Git - users/jedix/linux-maple.git/commit
aio: make kiocb->private NUll in init_sync_kiocb()
authorJunxiao Bi <junxiao.bi@oracle.com>
Thu, 31 May 2012 01:29:01 +0000 (09:29 +0800)
committerJunxiao Bi <junxiao.bi@oracle.com>
Thu, 31 May 2012 06:50:42 +0000 (14:50 +0800)
commitbebc1b8559d2916b4c5b0e9c4d41c0c73e3a30e6
tree59c7c2480fff55aabf563f0c5bf9f4e3a7e6d175
parent88f2ffb8f8c43975f8a27b6607f8abe28bc3a69d
aio: make kiocb->private NUll in init_sync_kiocb()

Orabug: 14063941

Ocfs2 uses kiocb.*private as a flag of unsigned long size. In
commit a11f7e6 ocfs2: serialize unaligned aio, the unaligned
io flag is involved in it to serialize the unaligned aio. As
*private is not initialized in init_sync_kiocb() of do_sync_write(),
this unaligned io flag may be unexpectly set in an aligned dio.
And this will cause OCFS2_I(inode)->ip_unaligned_aio decreased
to -1 in ocfs2_dio_end_io(), thus the following unaligned dio
will hang forever at ocfs2_aiodio_wait() in ocfs2_file_write_iter().

We can't initialized this flag in ocfs2_file_write_iter() since
it may be invoked several times by do_sync_write(). So we initialize
it in init_sync_kiocb(), it's also useful for other similiar use of
it in the future.

Signed-off-by: Junxiao Bi <junxiao.bi@oracle.com>
include/linux/aio.h