Al Viro
e1b4c6a583
shmem: fix recovery on rename failures
...
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 >
2025-12-16 00:57:29 -05:00
..
2025-12-07 08:29:09 -08:00
2025-07-28 13:43:25 -07:00
2025-10-20 20:22:26 +02:00
2025-12-03 17:24:33 -08:00
2025-12-05 15:52:30 -08:00
2025-10-20 20:22:26 +02:00
2025-12-01 09:02:34 -08:00
2025-12-05 17:01:20 -08:00
2025-12-01 16:13:46 -08:00
2025-12-06 14:01:20 -08:00
2025-10-20 20:22:26 +02:00
2025-12-05 14:36:21 -08:00
2025-10-20 20:22:26 +02:00
2025-12-06 14:01:20 -08:00
2025-12-05 21:29:02 -08:00
2025-11-16 01:35:04 -05:00
2025-11-04 19:10:33 -08:00
2025-12-01 16:13:46 -08:00
2025-12-05 14:36:21 -08:00
2025-10-20 20:22:26 +02:00
2025-12-05 17:01:20 -08:00
2025-12-03 10:00:17 +09:00
2025-10-20 20:22:26 +02:00
2025-12-03 20:37:15 -08:00
2025-12-09 12:06:20 +09:00
2025-12-01 14:18:01 -08:00
2025-10-20 20:22:26 +02:00
2025-12-05 15:25:13 -08:00
2025-12-03 20:28:50 -08:00
2025-12-03 20:08:32 -08:00
2025-12-03 20:08:32 -08:00
2025-12-05 16:30:56 -08:00
2025-12-01 14:18:01 -08:00
2025-12-05 14:36:21 -08:00
2025-12-01 10:26:38 -08:00
2025-12-01 09:02:34 -08:00
2025-11-26 17:05:47 -05:00
2025-10-20 20:22:26 +02:00
2025-12-01 09:02:34 -08:00
2025-12-05 21:29:02 -08:00
2025-12-06 10:57:02 -08:00
2025-12-01 15:22:40 -08:00
2025-12-01 10:26:38 -08:00
2025-12-05 17:53:56 -08:00
2025-08-05 16:45:40 -07:00
2025-12-06 10:57:02 -08:00
2025-12-06 14:01:20 -08:00
2025-12-01 11:58:06 +02:00
2025-12-01 17:32:07 -08:00
2025-12-05 13:52:43 -08:00
2025-12-06 15:28:11 -08:00
2025-12-01 14:18:01 -08:00
2025-10-20 20:22:26 +02:00
2025-12-01 09:02:34 -08:00
2025-12-05 16:16:20 -08:00
2025-12-08 15:32:15 -08:00
2025-12-05 14:36:21 -08:00
2025-10-20 20:22:26 +02:00
2025-10-20 20:22:26 +02:00
2025-10-20 20:22:26 +02:00
2025-12-05 14:36:21 -08:00
2025-12-05 13:52:43 -08:00
2025-10-20 20:22:26 +02:00
2025-12-07 11:46:19 -06:00
2025-10-20 20:22:26 +02:00
2025-11-26 15:16:35 +01:00
2025-11-16 01:35:03 -05:00
2025-12-09 08:50:27 +09:00
2025-10-20 20:22:26 +02:00
2025-10-20 20:22:26 +02:00
2025-09-16 23:59:38 -04:00
2025-09-29 15:55:20 -07:00
2025-12-03 20:19:38 -08:00
2025-12-01 09:02:34 -08:00
2025-11-04 12:36:33 +01:00
2025-11-28 12:42:31 +01:00
2025-11-12 09:38:34 +01:00
2025-12-01 13:45:41 -08:00
2025-07-28 17:11:40 -07:00
2025-11-04 08:33:33 +01:00
2025-12-05 14:36:21 -08:00
2025-09-15 21:17:08 -04:00
2025-12-01 10:26:38 -08:00
2025-12-03 17:24:33 -08:00
2025-07-08 10:25:19 +02:00
2025-12-05 13:52:43 -08:00
2025-12-05 15:25:13 -08:00
2025-07-31 14:57:54 -07:00
2025-10-20 20:22:26 +02:00
2025-11-28 12:42:31 +01:00
2025-11-28 12:42:32 +01:00
2025-12-02 08:48:53 -08:00
2025-11-12 09:38:37 +01:00
2025-11-28 12:42:31 +01:00
2025-11-19 12:17:31 +01:00
2025-10-07 12:48:33 +02:00
2025-12-01 17:32:07 -08:00
2025-09-04 15:20:51 -04:00
2025-11-05 09:51:30 +01:00
2025-11-05 22:51:23 +01:00
2025-12-01 09:20:51 -08:00
2025-08-11 14:52:41 +02:00
2025-11-12 09:38:36 +01:00
2025-12-03 11:14:50 +01:00
2025-12-05 14:36:21 -08:00
2025-09-01 13:08:01 +02:00
2025-10-02 18:18:33 -07:00
2025-09-03 20:49:32 -07:00
2025-12-16 00:57:29 -05:00
2025-11-28 10:30:41 +01:00
2025-11-05 09:51:30 +01:00
2025-11-11 10:01:31 +01:00
2025-09-21 14:22:16 -07:00
2025-12-01 16:13:46 -08:00
2025-12-01 17:32:07 -08:00
2025-12-01 17:32:07 -08:00
2025-12-01 17:32:07 -08:00
2025-12-01 10:17:39 -08:00
2025-12-05 11:15:37 -08:00
2025-09-15 21:26:44 -04:00
2025-09-15 21:26:44 -04:00
2025-11-12 09:38:34 +01:00
2025-08-15 16:11:47 +02:00
2025-11-04 08:28:34 +01:00
2025-11-28 12:42:32 +01:00
2025-11-25 10:11:16 +01:00
2025-06-23 12:17:33 +02:00
2025-09-15 21:17:07 -04:00
2025-12-05 15:52:30 -08:00
2025-12-01 09:20:51 -08:00
2025-11-28 12:42:32 +01:00
2025-12-05 13:52:43 -08:00
2025-12-01 15:34:41 -08:00
2025-11-12 09:38:34 +01:00