Al Viro
4b0fe71fb3
shmem: fix recovery on rename failures
...
[ Upstream commit e1b4c6a583 ]
maple_tree insertions can fail if we are seriously short on memory;
simple_offset_rename() does not recover well if it runs into that.
The same goes for simple_offset_rename_exchange().
Moreover, shmem_whiteout() expects that if it succeeds, the caller will
progress to d_move(), i.e. that shmem_rename2() won't fail past the
successful call of shmem_whiteout().
Not hard to fix, fortunately - mtree_store() can't fail if the index we
are trying to store into is already present in the tree as a singleton.
For simple_offset_rename_exchange() that's enough - we just need to be
careful about the order of operations.
For simple_offset_rename() solution is to preinsert the target into the
tree for new_dir; the rest can be done without any potentially failing
operations.
That preinsertion has to be done in shmem_rename2() rather than in
simple_offset_rename() itself - otherwise we'd need to deal with the
possibility of failure after successful shmem_whiteout().
Fixes: a2e459555c ("shmem: stable directory offsets")
Reviewed-by: Christian Brauner <brauner@kernel.org >
Reviewed-by: Chuck Lever <chuck.lever@oracle.com >
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk >
Signed-off-by: Sasha Levin <sashal@kernel.org >
2026-01-08 10:13:54 +01:00
..
2025-06-27 11:11:19 +01:00
2025-05-29 11:03:15 +02:00
2024-12-19 18:13:14 +01:00
2025-12-18 13:54:45 +01:00
2025-11-02 22:15:22 +09:00
2024-12-14 20:03:12 +01:00
2025-12-07 06:24:57 +09:00
2024-12-14 20:03:26 +01:00
2025-12-07 06:24:56 +09:00
2025-05-29 11:02:43 +02:00
2025-05-29 11:02:49 +02:00
2025-09-25 11:13:44 +02:00
2025-06-27 11:11:26 +01:00
2025-12-18 13:55:07 +01:00
2025-02-27 04:30:17 -08:00
2025-04-10 14:39:28 +02:00
2024-11-04 14:23:09 +01:00
2025-12-07 06:24:57 +09:00
2025-10-19 16:34:03 +02:00
2025-12-07 06:25:02 +09:00
2025-08-20 18:30:58 +02:00
2024-12-27 14:02:13 +01:00
2024-11-06 21:31:36 +01:00
2024-12-27 14:01:57 +01:00
2025-06-19 15:31:38 +02:00
2024-11-07 11:18:52 +00:00
2025-12-01 11:43:21 +01:00
2025-09-04 15:31:47 +02:00
2025-11-02 22:15:20 +09:00
2025-04-25 10:47:49 +02:00
2025-02-17 10:04:43 +01:00
2025-06-19 15:32:33 +02:00
2025-11-02 22:15:22 +09:00
2025-11-02 22:15:22 +09:00
2025-12-18 13:55:19 +01:00
2025-05-02 07:58:54 +02:00
2025-12-18 13:55:21 +01:00
2024-10-30 12:13:46 -07:00
2024-10-24 10:17:12 -07:00
2025-11-13 15:33:57 -05:00
2025-09-09 18:58:01 +02:00
2025-10-15 12:00:04 +02:00
2025-10-15 12:00:03 +02:00
2025-05-29 11:02:00 +02:00
2025-06-19 15:32:33 +02:00
2025-08-28 16:31:06 +02:00
2025-04-20 10:15:04 +02:00
2025-11-13 15:34:06 -05:00
2024-12-14 20:03:38 +01:00
2024-12-14 20:04:16 +01:00
2025-03-13 13:01:58 +01:00
2024-12-05 14:02:45 +01:00
2025-11-24 10:35:46 +01:00
2025-09-19 16:35:45 +02:00
2025-03-07 18:25:35 +01:00
2025-08-28 16:31:10 +02:00
2025-04-10 14:39:28 +02:00
2025-06-04 14:43:52 +02:00
2025-12-18 13:54:57 +01:00
2025-12-18 13:55:21 +01:00
2025-09-11 17:21:46 +02:00
2025-10-19 16:34:02 +02:00
2025-12-18 13:55:17 +01:00
2025-10-12 12:57:19 +02:00
2025-09-04 15:31:45 +02:00
2025-05-29 11:01:59 +02:00
2024-12-14 20:04:09 +01:00
2025-02-21 14:01:34 +01:00
2025-05-02 07:58:52 +02:00
2025-05-29 11:03:25 +02:00
2025-03-13 13:02:07 +01:00
2024-12-14 20:03:35 +01:00
2025-05-18 08:24:59 +02:00
2025-07-10 16:05:08 +02:00
2025-11-13 15:34:14 -05:00
2024-12-14 20:03:48 +01:00
2025-11-13 15:33:55 -05:00
2025-12-18 13:55:00 +01:00
2025-08-15 12:13:49 +02:00
2025-08-15 12:13:31 +02:00
2026-01-08 10:13:54 +01:00
2025-04-10 14:39:17 +02:00
2025-09-09 18:58:04 +02:00
2025-05-29 11:03:22 +02:00
2024-12-05 14:01:18 +01:00
2025-02-17 10:05:31 +01:00
2025-01-23 17:23:03 +01:00
2025-11-24 10:36:07 +01:00
2025-06-27 11:11:40 +01:00
2025-05-22 14:29:48 +02:00
2025-08-20 18:30:14 +02:00
2025-12-18 13:55:07 +01:00
2025-12-18 13:55:14 +01:00
2025-08-20 18:30:37 +02:00
2024-11-02 22:28:58 -07:00
2024-12-05 14:01:35 +01:00
2025-04-10 14:39:12 +02:00
2025-09-25 11:13:48 +02:00
2024-12-27 14:02:17 +01:00
2025-05-29 11:03:25 +02:00
2025-01-17 13:40:34 +01:00
2025-05-09 09:50:34 +02:00
2025-08-15 12:14:05 +02:00
2025-08-28 16:31:12 +02:00
2025-08-28 16:31:05 +02:00
2025-05-29 11:02:23 +02:00
2025-08-01 09:48:42 +01:00
2024-12-05 14:01:22 +01:00
2025-02-08 09:57:58 +01:00
2024-12-09 10:41:08 +01:00
2025-08-28 16:31:09 +02:00
2025-03-28 22:03:30 +01:00
2024-12-05 14:03:03 +01:00
2025-10-19 16:34:01 +02:00
2025-11-24 10:36:05 +01:00
2024-12-14 20:04:01 +01:00
2025-08-20 18:30:57 +02:00
2024-12-05 14:02:46 +01:00
2025-05-29 11:02:25 +02:00
2025-11-24 10:35:59 +01:00
2025-07-17 18:37:24 +02:00
2025-06-19 15:31:54 +02:00
2024-11-11 00:00:37 -08:00
2025-01-09 13:33:54 +01:00
2025-08-20 18:30:16 +02:00
2025-09-25 11:13:51 +02:00
2025-01-09 13:33:54 +01:00
2025-10-23 16:20:47 +02:00
2025-05-29 11:03:23 +02:00
2024-12-05 14:03:08 +01:00
2024-11-07 14:14:58 -08:00
2025-05-18 08:24:59 +02:00
2025-08-15 12:13:59 +02:00
2025-01-17 13:40:50 +01:00
2025-02-08 09:57:23 +01:00
2025-05-29 11:02:41 +02:00
2024-12-19 18:13:19 +01:00
2025-02-27 04:30:18 -08:00
2025-08-28 16:31:04 +02:00
2025-11-24 10:36:06 +01:00
2025-02-08 09:57:59 +01:00
2025-12-18 13:55:18 +01:00
2025-08-28 16:31:05 +02:00
2025-12-18 13:55:18 +01:00
2025-04-25 10:47:50 +02:00
2024-12-05 14:02:27 +01:00
2025-04-10 14:39:11 +02:00
2025-03-13 13:02:03 +01:00
2025-06-19 15:32:18 +02:00
2024-12-05 14:01:32 +01:00
2024-12-05 14:03:08 +01:00
2025-10-15 12:00:03 +02:00
2025-06-19 15:32:37 +02:00
2025-08-20 18:30:35 +02:00
2025-05-29 11:03:22 +02:00
2025-04-20 10:15:25 +02:00
2025-05-29 11:02:04 +02:00
2025-06-19 15:32:11 +02:00
2025-11-13 15:34:12 -05:00
2025-12-18 13:54:49 +01:00
2025-09-19 16:35:42 +02:00
2025-09-19 16:35:42 +02:00
2025-06-19 15:31:54 +02:00
2025-03-13 13:02:07 +01:00
2025-06-19 15:32:22 +02:00
2025-10-23 16:20:39 +02:00
2025-05-29 11:02:20 +02:00
2025-06-19 15:31:42 +02:00
2025-01-23 17:22:57 +01:00
2025-08-15 12:13:35 +02:00
2025-04-20 10:15:12 +02:00
2025-08-15 12:13:53 +02:00
2025-01-23 17:22:53 +01:00
2025-08-15 12:13:42 +02:00
2025-07-17 18:37:08 +02:00
2025-02-08 09:57:07 +01:00
2025-12-18 13:55:04 +01:00
2025-12-18 13:54:44 +01:00
2025-05-29 11:03:02 +02:00
2025-03-07 18:25:43 +01:00
2025-05-29 11:03:02 +02:00
2025-08-15 12:13:46 +02:00
2025-10-19 16:33:34 +02:00
2024-12-05 14:01:23 +01:00
2025-08-20 18:30:49 +02:00
2024-12-14 20:03:18 +01:00
2025-03-13 13:01:58 +01:00
2025-02-01 18:39:35 +01:00
2024-12-05 14:01:23 +01:00
2025-02-27 04:30:14 -08:00
2025-11-13 15:34:18 -05:00
2025-02-08 09:57:07 +01:00
2025-09-09 18:58:10 +02:00
2025-02-27 04:30:19 -08:00
2025-03-07 18:25:32 +01:00
2024-11-13 19:29:46 -08:00
2024-12-05 14:01:23 +01:00
2025-07-10 16:04:54 +02:00
2025-08-01 09:48:43 +01:00
2024-12-14 20:03:32 +01:00
2024-12-19 18:13:24 +01:00
2025-10-02 13:44:11 +02:00
2025-06-27 11:11:30 +01:00
2025-04-10 14:39:26 +02:00
2024-10-27 10:36:04 +01:00
2024-12-14 20:04:16 +01:00
2025-11-13 15:34:02 -05:00
2025-05-22 14:29:50 +02:00
2025-04-10 14:39:35 +02:00
2025-05-29 11:02:04 +02:00
2025-05-29 11:02:04 +02:00
2025-05-18 08:24:56 +02:00
2024-10-30 11:38:10 -10:00
2025-04-10 14:39:37 +02:00
2025-07-10 16:05:11 +02:00
2024-11-07 14:14:59 -08:00
2025-01-23 17:23:02 +01:00
2024-12-09 10:41:06 +01:00
2025-12-18 13:55:12 +01:00
2025-12-18 13:55:10 +01:00
2025-08-20 18:30:40 +02:00
2025-05-22 14:29:38 +02:00
2024-11-11 00:00:37 -08:00
2025-09-09 18:58:15 +02:00
2025-01-02 10:34:10 +01:00
2025-08-15 12:14:04 +02:00
2024-12-27 14:02:20 +01:00
2025-01-17 13:40:33 +01:00