aufs: file op, internal re-open when write
By default, aufs doesn't copy-up the file in open(2).
The file write operation is one of the trigger of the copy-up.
Although I understand that O_RDWR or O_WRONLY should trigger the
copy-up, it is not a good idea for the case of open(O_RDWR) +
mmap(MAP_PRIVATE). In this case, all changes are not written-back to the
file on disk, and the copy-up is meaningless entirely.
In other words, aufs postpone the copy-up as possible.
This design also applies to the file operation after branch management.
Some of the opened file need to be refreshed after add/del/mod
branches. Eg. detect the revealed same named one, open it, close the old
one internally while the virtual file is kept opened.
Signed-off-by: J. R. Okajima <hooanon05g@gmail.com>
Please register or sign in to comment