Brian Foster
763e4cdc0f
iomap: support partial page discard on writeback block mapping failure
...
iomap writeback mapping failure only calls into ->discard_page() if
the current page has not been added to the ioend. Accordingly, the
XFS callback assumes a full page discard and invalidation. This is
problematic for sub-page block size filesystems where some portion
of a page might have been mapped successfully before a failure to
map a delalloc block occurs. ->discard_page() is not called in that
error scenario and the bio is explicitly failed by iomap via the
error return from ->prepare_ioend(). As a result, the filesystem
leaks delalloc blocks and corrupts the filesystem block counters.
Since XFS is the only user of ->discard_page(), tweak the semantics
to invoke the callback unconditionally on mapping errors and provide
the file offset that failed to map. Update xfs_discard_page() to
discard the corresponding portion of the file and pass the range
along to iomap_invalidatepage(). The latter already properly handles
both full and sub-page scenarios by not changing any iomap or page
state on sub-page invalidations.
Signed-off-by: Brian Foster <bfoster@redhat.com >
Reviewed-by: Christoph Hellwig <hch@lst.de >
Reviewed-by: Darrick J. Wong <darrick.wong@oracle.com >
Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com >
2020-11-04 08:52:46 -08:00
..
2020-10-12 10:06:39 +02:00
2020-10-12 15:29:27 +02:00
2020-10-12 15:29:26 +02:00
2020-10-15 18:42:13 -07:00
2020-10-15 09:46:23 -07:00
2020-10-15 07:57:55 +02:00
2020-10-21 11:22:08 -07:00
2020-10-17 11:18:18 -07:00
2020-10-25 14:51:49 -07:00
2020-10-24 10:33:08 -07:00
2020-10-17 11:18:18 -07:00
2020-10-25 14:51:49 -07:00
2020-10-24 10:39:22 -07:00
2020-10-24 10:33:08 -07:00
2020-10-22 09:44:27 -07:00
2020-10-16 15:02:21 -07:00
2020-10-25 14:51:49 -07:00
2020-10-08 17:17:27 +02:00
2020-10-13 11:37:11 +02:00
2020-10-16 11:11:20 -07:00
2020-10-13 15:05:05 -06:00
2020-10-16 11:11:19 -07:00
2020-10-22 09:59:21 -07:00
2020-10-11 10:21:04 -07:00
2020-10-16 11:11:19 -07:00
2020-10-25 14:51:49 -07:00
2020-10-13 18:38:34 -07:00
2020-10-12 16:44:57 -07:00
2020-10-25 14:51:49 -07:00
2020-10-13 18:38:26 -07:00
2020-10-13 18:38:26 -07:00
2020-10-25 14:51:49 -07:00
2020-10-16 11:11:21 -07:00
2020-10-25 14:51:49 -07:00
2020-10-08 17:17:27 +02:00
2020-10-16 12:21:15 -07:00
2020-10-16 17:21:51 +02:00
2020-10-13 15:58:10 -07:00
2020-10-19 14:28:30 -07:00
2020-10-16 07:28:20 +02:00
2020-10-07 18:08:41 -04:00
2020-10-15 14:43:29 -07:00
2020-10-06 07:07:06 +02:00
2020-10-20 10:41:07 +02:00
2020-10-20 10:41:07 +02:00
2020-10-25 14:51:49 -07:00
2020-10-12 13:38:31 +02:00
2020-10-12 10:51:02 -07:00
2020-10-06 06:16:01 -07:00
2020-10-25 14:51:49 -07:00
2020-10-16 11:11:22 -07:00
2020-10-22 01:28:54 +02:00
2020-10-25 14:51:49 -07:00
2020-10-15 10:46:16 -07:00
2020-10-24 12:26:05 -07:00
2020-10-08 15:29:06 -04:00
2020-10-15 14:43:29 -07:00
2020-10-22 22:44:35 +02:00
2020-10-13 18:38:32 -07:00
2020-10-12 12:08:35 +02:00
2020-10-16 11:11:20 -07:00
2020-10-25 14:51:49 -07:00
2020-10-25 14:51:49 -07:00
2020-10-16 17:35:36 +02:00
2020-10-14 12:08:34 -07:00
2020-10-25 14:51:49 -07:00
2020-10-17 09:25:47 -06:00
2020-10-20 07:10:14 -06:00
2020-11-04 08:52:46 -08:00
2020-10-14 12:08:34 -07:00
2020-10-16 11:11:18 -07:00
2020-10-06 11:28:03 +01:00
2020-10-12 11:40:41 -07:00
2020-10-08 18:00:08 +02:00
2020-10-21 23:22:37 -04:00
2020-10-16 11:11:19 -07:00
2020-10-13 18:38:32 -07:00
2020-10-25 14:51:49 -07:00
2020-10-11 10:31:11 -07:00
2020-10-12 14:21:15 -07:00
2020-10-23 03:42:13 -04:00
2020-10-25 14:51:49 -07:00
2020-10-16 11:11:20 -07:00
2020-10-09 08:53:08 +02:00
2020-10-09 08:55:17 +02:00
2020-10-07 09:23:39 +02:00
2020-10-25 14:51:49 -07:00
2020-10-15 07:49:46 +02:00
2020-10-13 18:38:35 -07:00
2020-10-18 09:27:09 -07:00
2020-10-16 11:11:18 -07:00
2020-10-13 18:38:28 -07:00
2020-10-16 11:11:19 -07:00
2020-10-12 10:40:34 -07:00
2020-10-18 09:27:09 -07:00
2020-10-13 18:38:31 -07:00
2020-10-16 11:11:19 -07:00
2020-10-25 14:51:49 -07:00
2020-10-25 14:51:49 -07:00
2020-10-05 18:40:01 -07:00
2020-10-13 17:33:48 -07:00
2020-10-21 18:24:08 -07:00
2020-10-07 14:28:39 -04:00
2020-10-07 14:28:39 -04:00
2020-10-21 10:31:20 -04:00
2020-10-07 14:28:39 -04:00
2020-10-16 11:11:18 -07:00
2020-10-16 11:11:19 -07:00
2020-10-13 18:38:27 -07:00
2020-10-25 14:51:49 -07:00
2020-10-25 14:51:49 -07:00
2020-10-13 18:38:35 -07:00
2020-10-17 11:18:18 -07:00
2020-10-16 11:11:15 -07:00
2020-10-16 11:11:16 -07:00
2020-10-16 11:11:16 -07:00
2020-10-22 13:00:44 -07:00
2020-10-25 14:51:49 -07:00
2020-10-06 07:29:36 -06:00
2020-10-12 10:00:51 -07:00
2020-10-18 09:27:10 -07:00
2020-10-16 17:53:22 +02:00
2020-10-20 19:45:14 +02:00
2020-10-24 20:21:57 +02:00
2020-10-25 14:51:49 -07:00
2020-10-14 16:09:32 -07:00
2020-10-24 10:39:22 -07:00
2020-10-13 08:41:26 -04:00
2020-10-13 18:38:28 -07:00
2020-10-25 14:51:49 -07:00
2020-10-13 19:20:54 -05:00
2020-10-05 20:45:45 -03:00
2020-10-16 11:11:22 -07:00
2020-10-14 18:07:50 +02:00
2020-10-25 14:51:49 -07:00
2020-10-15 18:42:13 -07:00
2020-10-11 18:09:44 -07:00
2020-10-25 11:39:02 -07:00
2020-10-25 14:51:49 -07:00
2020-10-22 14:15:51 -06:00
2020-10-06 11:18:04 +02:00
2020-10-13 18:38:30 -07:00
2020-10-13 18:38:30 -07:00
2020-10-25 14:51:49 -07:00
2020-10-17 15:05:30 -06:00
2020-10-12 12:08:36 +02:00
2020-10-25 14:51:49 -07:00
2020-10-17 15:04:36 -06:00
2020-10-15 15:51:28 -07:00
2020-10-25 14:51:49 -07:00
2020-10-24 10:57:57 -07:00
2020-10-12 16:35:51 -07:00
2020-10-23 11:00:57 -07:00
2020-10-18 09:27:10 -07:00
2020-10-16 11:11:19 -07:00
2020-10-20 14:39:37 -07:00