Files
linux/include/linux
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
2019-12-11 09:12:38 +01:00
2019-11-12 11:43:29 -05:00
2020-06-25 22:25:13 -07:00
2020-06-16 14:19:57 +02:00
2020-05-24 20:48:11 +02:00
2020-07-21 08:24:52 -05:00
2020-07-08 10:48:35 -07:00
2020-10-02 14:59:25 -07:00
2020-09-21 15:00:40 -07:00
2020-10-02 15:00:49 -07:00
2020-10-16 17:21:51 +02:00
2019-10-09 19:33:43 -07:00
2020-03-09 11:12:19 +01:00
2019-12-03 11:20:37 +01:00
2020-06-16 19:25:20 +02:00
2020-07-27 14:29:23 -04:00
2020-05-04 11:19:58 -07:00
2020-08-12 20:42:08 +02:00
2020-06-17 00:07:38 +02:00
2020-03-06 11:06:15 +01:00
2020-09-30 22:44:26 +02:00
2020-07-24 17:12:41 -07:00
2019-06-26 13:19:46 -07:00
2020-08-04 21:02:38 -04:00
2019-10-04 12:31:46 -07:00
2019-10-15 13:34:25 +02:00
2020-09-16 08:54:53 -05:00
2020-05-18 10:30:21 +01:00
2020-08-26 12:41:56 +02:00
2020-10-21 23:22:37 -04:00
2020-10-13 18:38:32 -07:00
2019-12-04 19:44:14 -08:00
2020-06-02 15:15:46 +01:00
2019-12-11 09:12:38 +01:00
2020-09-04 09:25:20 -07:00
2020-05-08 18:18:11 +01:00
2020-05-08 00:12:42 +02:00
2020-05-28 10:31:09 +02:00
2020-09-23 18:02:49 -07:00
2020-03-06 11:56:59 +01:00
2020-10-18 09:27:09 -07:00
2020-09-04 12:46:07 +01:00
2020-08-27 16:06:47 -04:00
2019-08-14 15:30:35 +02:00
2019-11-14 19:06:47 -08:00
2020-10-07 14:28:39 -04:00
2020-05-09 13:57:12 +02:00
2020-07-01 10:49:02 +02:00
2020-09-24 19:49:36 -07:00
2020-07-23 17:34:18 +10:00
2020-05-15 13:51:28 -07:00
2020-08-31 12:52:33 -07:00
2019-07-16 19:23:25 -07:00
2020-09-23 18:02:49 -07:00
2020-10-18 09:27:10 -07:00
2020-05-09 13:57:12 +02:00
2019-06-15 12:25:49 +02:00
2020-08-18 17:06:15 +02:00
2020-07-16 23:19:51 +02:00
2020-09-01 14:18:28 +02:00
2020-08-07 11:33:24 -07:00
2020-09-26 22:55:05 -04:00
2020-05-04 09:16:37 -07:00
2020-07-04 09:35:36 -05:00
2020-09-10 14:03:31 -07:00
2020-01-14 12:20:48 +01:00
2020-07-07 11:58:59 -05:00
2020-08-01 11:28:17 +02:00
2020-04-01 12:06:26 -04:00
2020-10-18 09:27:10 -07:00
2020-10-05 13:21:49 +02:00