summaryrefslogtreecommitdiff
path: root/Documentation/filesystems/unionfs/rename.txt
blob: e20bb82fd084c55147e1eba3724a27292a6d87ae (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
Rename is a complex beast. The following table shows which rename(2) operations
should succeed and which should fail.

o: success
E: error (either unionfs or vfs)
X: EXDEV

none = file does not exist
file = file is a file
dir  = file is a empty directory
child= file is a non-empty directory
wh   = file is a directory containing only whiteouts; this makes it logically
		empty

                      none    file    dir     child   wh
file                  o       o       E       E       E
dir                   o       E       o       E       o
child                 X       E       X       E       X
wh                    o       E       o       E       o


Renaming directories:
=====================

Whenever a empty (either physically or logically) directory is being renamed,
the following sequence of events should take place:

1) Remove whiteouts from both source and destination directory
2) Rename source to destination
3) Make destination opaque to prevent anything under it from showing up