Jan Kara
a155ad9506
udf: Fix file corruption when appending just after end of preallocated extent
...
commit 36ec52ea03 upstream.
When we append new block just after the end of preallocated extent, the
code in inode_getblk() wrongly determined we're going to use the
preallocated extent which resulted in adding block into a wrong logical
offset in the file. Sequence like this manifests it:
xfs_io -f -c "pwrite 0x2cacf 0xd122" -c "truncate 0x2dd6f" \
-c "pwrite 0x27fd9 0x69a9" -c "pwrite 0x32981 0x7244" <file>
The code that determined the use of preallocated extent is actually
stale because udf_do_extend_file() does not create preallocation anymore
so after calling that function we are sure there's no usable
preallocation. Just remove the faulty condition.
CC: stable@vger.kernel.org
Fixes: 16d0556568 ("udf: Discard preallocation before extending file with a hole")
Signed-off-by: Jan Kara <jack@suse.cz >
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org >
2023-03-10 09:40:00 +01:00
..
2022-08-17 14:24:07 +02:00
2021-06-29 10:53:48 -07:00
2023-02-01 08:27:06 +01:00
2022-12-31 13:14:45 +01:00
2021-10-20 21:09:02 -04:00
2021-08-19 09:02:55 +09:00
2021-06-29 10:53:48 -07:00
2023-03-10 09:39:56 +01:00
2022-07-02 16:41:14 +02:00
2023-02-14 19:18:03 +01:00
2023-03-10 09:39:56 +01:00
2023-03-10 09:39:50 +01:00
2022-12-31 13:14:15 +01:00
2022-11-10 18:15:37 +01:00
2022-12-31 13:14:03 +01:00
2022-02-01 17:27:01 +01:00
2023-03-10 09:39:58 +01:00
2022-07-02 16:41:14 +02:00
2021-04-12 15:04:29 +02:00
2023-02-06 07:59:00 +01:00
2023-03-10 09:39:58 +01:00
2022-06-09 10:23:32 +02:00
2022-10-26 12:35:51 +02:00
2023-02-25 12:06:45 +01:00
2023-03-10 09:39:58 +01:00
2022-06-09 10:22:42 +02:00
2021-10-04 22:13:12 +01:00
2022-12-02 17:41:11 +01:00
2023-03-10 09:39:53 +01:00
2023-03-10 09:39:57 +01:00
2023-03-10 09:39:57 +01:00
2021-08-26 22:28:02 +02:00
2021-07-27 11:00:36 +02:00
2022-12-31 13:14:44 +01:00
2022-06-09 10:22:55 +02:00
2021-11-12 15:05:50 +01:00
2022-10-26 12:34:28 +02:00
2022-06-14 18:36:10 +02:00
2022-12-31 13:14:40 +01:00
2022-11-03 23:59:13 +09:00
2023-03-10 09:39:57 +01:00
2022-12-31 13:14:05 +01:00
2022-04-13 20:59:10 +02:00
2021-12-29 12:28:59 +01:00
2023-03-10 09:39:30 +01:00
2021-10-04 22:02:17 +01:00
2023-03-10 09:39:55 +01:00
2023-02-22 12:57:10 +01:00
2022-06-09 10:22:50 +02:00
2022-11-26 09:24:52 +01:00
2023-02-09 11:26:47 +01:00
2023-03-10 09:39:59 +01:00
2021-06-29 10:53:48 -07:00
2021-03-12 22:15:22 -05:00
2022-12-31 13:14:44 +01:00
2023-02-09 11:26:47 +01:00
2023-02-09 11:26:44 +01:00
2023-01-12 11:58:46 +01:00
2021-09-21 08:36:48 -07:00
2023-01-12 11:59:01 +01:00
2021-06-29 10:53:48 -07:00
2023-02-01 08:27:19 +01:00
2021-12-14 10:57:12 +01:00
2023-02-22 12:57:07 +01:00
2021-08-06 13:05:28 +02:00
2022-12-31 13:14:05 +01:00
2022-09-20 12:39:43 +02:00
2022-04-08 14:24:08 +02:00
2023-03-10 09:40:00 +01:00
2021-08-19 09:02:55 +09:00
2021-05-02 00:43:35 +09:00
2021-09-27 11:26:21 -07:00
2021-09-22 10:56:34 -07:00
2023-02-22 12:57:04 +01:00
2023-01-24 07:22:42 +01:00
2023-02-22 12:57:05 +01:00
2022-08-17 14:22:50 +02:00
2021-08-18 22:08:24 +02:00
2021-09-05 10:15:05 -07:00
2023-01-12 11:58:46 +01:00
2022-11-03 23:59:12 +09:00
2022-06-09 10:22:26 +02:00
2022-12-31 13:14:39 +01:00
2022-11-26 09:24:51 +01:00
2022-12-31 13:14:30 +01:00
2022-04-08 14:24:18 +02:00
2021-09-02 10:07:29 -07:00
2022-09-28 11:11:56 +02:00
2021-04-15 22:36:45 -04:00
2021-04-09 14:54:23 -07:00
2021-09-03 09:58:10 -07:00
2023-01-24 07:22:43 +01:00
2023-01-24 07:22:43 +01:00
2022-11-03 23:59:12 +09:00
2021-09-03 10:08:28 -07:00
2021-04-07 13:56:43 -04:00
2022-10-26 12:34:58 +02:00
2022-12-14 11:37:15 +01:00
2021-08-23 01:25:40 -04:00
2022-01-20 09:13:14 +01:00
2021-09-07 16:07:47 -04:00
2022-12-02 17:41:07 +01:00
2022-10-12 09:53:26 +02:00
2022-10-26 12:34:58 +02:00
2022-05-25 09:57:26 +02:00
2021-09-12 10:10:21 -07:00
2021-07-25 22:33:03 -07:00
2021-10-18 20:22:03 -10:00
2022-12-31 13:14:03 +01:00
2023-01-12 11:59:14 +01:00
2022-12-14 11:37:31 +01:00
2023-01-12 11:59:20 +01:00
2021-03-11 07:47:48 -07:00
2022-11-26 09:24:51 +01:00
2022-08-31 17:16:37 +02:00
2022-10-26 12:34:58 +02:00
2022-06-06 08:43:37 +02:00
2023-01-12 11:58:47 +01:00
2021-03-08 15:18:43 +01:00
2022-07-02 16:41:17 +02:00
2022-07-02 16:41:14 +02:00
2022-12-19 12:36:39 +01:00
2021-04-17 11:39:49 -07:00
2022-07-21 21:24:14 +02:00
2022-01-29 10:58:25 +01:00
2022-07-12 16:35:08 +02:00
2021-12-14 10:57:15 +01:00
2022-10-26 12:34:17 +02:00
2022-04-27 14:38:57 +02:00
2021-02-13 17:17:53 +01:00
2022-11-10 18:15:37 +01:00
2022-04-27 14:38:50 +02:00
2021-08-10 17:57:22 +02:00
2022-10-26 12:34:36 +02:00
2022-12-31 13:14:01 +01:00