]> git.baikalelectronics.ru Git - kernel.git/commit
fs: update atime before I/O in generic_file_read_iter
authorChristoph Hellwig <hch@lst.de>
Sun, 2 Oct 2016 22:48:08 +0000 (09:48 +1100)
committerDave Chinner <david@fromorbit.com>
Sun, 2 Oct 2016 22:48:08 +0000 (09:48 +1100)
commitbd8c28e32919c698d58fb5785dcc4421e66d22f8
tree08163c5359913d1747cc2ef74394b313c0949cbd
parent22a0a56f12a65204d631a887ea58606f0d5c6758
fs: update atime before I/O in generic_file_read_iter

After the call to ->direct_IO the final reference to the file might have
been dropped by aio_complete already, and the call to file_accessed might
cause a use after free.

Instead update the access time before the I/O, similar to how we
update the time stamps before writes.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Dave Chinner <dchinner@redhat.com>
Signed-off-by: Dave Chinner <david@fromorbit.com>
mm/filemap.c