linux-next/Documentation
Al Viro a8b0026847 rename(): avoid a deadlock in the case of parents having no common ancestor
... and fix the directory locking documentation and proof of correctness.
Holding ->s_vfs_rename_mutex *almost* prevents ->d_parent changes; the
case where we really don't want it is splicing the root of disconnected
tree to somewhere.

In other words, ->s_vfs_rename_mutex is sufficient to stabilize "X is an
ancestor of Y" only if X and Y are already in the same tree.  Otherwise
it can go from false to true, and one can construct a deadlock on that.

Make lock_two_directories() report an error in such case and update the
callers of lock_rename()/lock_rename_child() to handle such errors.

And yes, such conditions are not impossible to create ;-/

Reviewed-by: Jan Kara <jack@suse.cz>
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
2023-11-25 02:54:14 -05:00
..
2023-11-09 13:37:28 -08:00
2023-11-10 12:22:14 -08:00
2023-11-06 15:06:06 -08:00
2023-11-04 08:07:19 -10:00
2023-10-10 13:37:43 -06:00
2023-10-10 13:35:55 -06:00
2023-11-03 15:15:47 -10:00
2023-10-30 20:30:49 -10:00
2023-11-01 15:28:33 -10:00
2023-09-02 12:02:41 -07:00
2023-10-23 19:38:22 +01:00
2023-11-06 15:06:06 -08:00
2023-11-03 16:00:42 -10:00
2023-10-31 16:37:07 -04:00