files-reg: Create ghost files in first existing parent directory
Since a deleted file may belong to a deleted directory
(which, in turn, may belong to another deleted, etc),
it's necessary to recreate all missing dentries in the path.
Doing this in mkreg_ghost() is not a good idea, because
another ghost file may need some of the dentries in the path,
and this requires to do refcouting of recreated directories.
To avoid this, we restore a ghost file in the first existing
parent directory of the patch. This guarantees, the ghost file
will be in the same mount with target file (rfi_remap() needs
that, because it uses link()).
Signed-off-by:
Pavel Emelyanov <xemul@virtuozzo.com>
Showing
Please
register
or
sign in
to comment