aboutsummaryrefslogtreecommitdiff
path: root/rust/helpers.c
diff options
context:
space:
mode:
authorDamien Le Moal <[email protected]>2023-03-29 13:16:01 +0900
committerDamien Le Moal <[email protected]>2023-03-30 20:55:49 +0900
commitc1976bd8f23016d8706973908f2bb0ac0d852a8f (patch)
tree84c1ffa6bbd37a37db5cc45e957320a56d5d77f2 /rust/helpers.c
parent197b6b60ae7bc51dd0814953c562833143b292aa (diff)
zonefs: Always invalidate last cached page on append write
When a direct append write is executed, the append offset may correspond to the last page of a sequential file inode which might have been cached already by buffered reads, page faults with mmap-read or non-direct readahead. To ensure that the on-disk and cached data is consistant for such last cached page, make sure to always invalidate it in zonefs_file_dio_append(). If the invalidation fails, return -EBUSY to userspace to differentiate from IO errors. This invalidation will always be a no-op when the FS block size (device zone write granularity) is equal to the page size (e.g. 4K). Reported-by: Hans Holmberg <[email protected]> Fixes: 02ef12a663c7 ("zonefs: use REQ_OP_ZONE_APPEND for sync DIO") Cc: [email protected] Signed-off-by: Damien Le Moal <[email protected]> Reviewed-by: Christoph Hellwig <[email protected]> Reviewed-by: Johannes Thumshirn <[email protected]> Tested-by: Hans Holmberg <[email protected]>
Diffstat (limited to 'rust/helpers.c')
0 files changed, 0 insertions, 0 deletions