Skip to content

Commit 78cee9a

Browse files
J. Bruce FieldsAl Viro
authored andcommitted
exportfs: more detailed comment for path_reconnect
Reviewed-by: Christoph Hellwig <hch@lst.de> Signed-off-by: J. Bruce Fields <bfields@redhat.com> Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
1 parent 854ff5c commit 78cee9a

1 file changed

Lines changed: 13 additions & 1 deletion

File tree

‎fs/exportfs/expfs.c‎

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,19 @@ find_disconnected_root(struct dentry *dentry)
9393
/*
9494
* Make sure target_dir is fully connected to the dentry tree.
9595
*
96-
* It may already be, as the flag isn't always updated when connection happens.
96+
* On successful return, DCACHE_DISCONNECTED will be cleared on
97+
* target_dir, and target_dir->d_parent->...->d_parent will reach the
98+
* root of the filesystem.
99+
*
100+
* Whenever DCACHE_DISCONNECTED is unset, target_dir is fully connected.
101+
* But the converse is not true: target_dir may have DCACHE_DISCONNECTED
102+
* set but already be connected. In that case we'll verify the
103+
* connection to root and then clear the flag.
104+
*
105+
* Note that target_dir could be removed by a concurrent operation. In
106+
* that case reconnect_path may still succeed with target_dir fully
107+
* connected, but further operations using the filehandle will fail when
108+
* necessary (due to S_DEAD being set on the directory).
97109
*/
98110
static int
99111
reconnect_path(struct vfsmount *mnt, struct dentry *target_dir, char *nbuf)

0 commit comments

Comments
 (0)