diff options
author | Damien Le Moal <damien.lemoal@wdc.com> | 2021-03-10 15:20:28 +0900 |
---|---|---|
committer | Damien Le Moal <damien.lemoal@wdc.com> | 2021-03-16 17:46:55 +0900 |
commit | ebfd68cd0c1e81267c757332385cb96df30dacce (patch) | |
tree | 3610fbdef839e6165197216c3ea128b98d84d0b1 /tools/perf/scripts/python/exported-sql-viewer.py | |
parent | 1601ea068b886da1f8f8d4e18b9403e9e24adef6 (diff) |
zonefs: Fix O_APPEND async write handling
zonefs updates the size of a sequential zone file inode only on
completion of direct writes. When executing asynchronous append writes
(with a file open with O_APPEND or using RWF_APPEND), the use of the
current inode size in generic_write_checks() to set an iocb offset thus
leads to unaligned write if an application issues an append write
operation with another write already being executed.
Fix this problem by introducing zonefs_write_checks() as a modified
version of generic_write_checks() using the file inode wp_offset for an
append write iocb offset. Also introduce zonefs_write_check_limits() to
replace generic_write_check_limits() call. This zonefs special helper
makes sure that the maximum file limit used is the maximum size of the
file being accessed.
Since zonefs_write_checks() already truncates the iov_iter, the calls
to iov_iter_truncate() in zonefs_file_dio_write() and
zonefs_file_buffered_write() are removed.
Fixes: 8dcc1a9d90c1 ("fs: New zonefs file system")
Cc: <stable@vger.kernel.org>
Reviewed-by: Johannes Thumshirn <johannes.thumshirn@wdc.com>
Signed-off-by: Damien Le Moal <damien.lemoal@wdc.com>
Diffstat (limited to 'tools/perf/scripts/python/exported-sql-viewer.py')
0 files changed, 0 insertions, 0 deletions