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