diff options
| author | Amir Goldstein <[email protected]> | 2016-10-26 09:34:06 +0000 |
|---|---|---|
| committer | Miklos Szeredi <[email protected]> | 2016-12-16 10:02:57 +0000 |
| commit | d15951198eaccb92c6b49e62cb72f5ff62da2236 (patch) | |
| tree | 9a93dbee0a4b62d70761993e5f9e949444868bed /net/unix/af_unix.c | |
| parent | ovl: redirect on rename-dir (diff) | |
| download | kernel-d15951198eaccb92c6b49e62cb72f5ff62da2236.tar.gz kernel-d15951198eaccb92c6b49e62cb72f5ff62da2236.zip | |
ovl: check for emptiness of redirect dir
Before introducing redirect_dir feature, the condition
!ovl_lower_positive(dentry) for a directory, implied that it is a pure
upper directory, which may be removed if empty.
Now that directory can be redirect, it is possible that upper does not
cover any lower (i.e. !ovl_lower_positive(dentry)), but the directory is a
merge (with redirected path) and maybe non empty.
Check for this case in ovl_remove_upper().
This change fixes the following test case from rename-pop-dir.py
of unionmount-testsuite:
"""Remove dir and rename old name"""
d = ctx.non_empty_dir()
d2 = ctx.no_dir()
ctx.rmdir(d, err=ENOTEMPTY)
ctx.rename(d, d2)
ctx.rmdir(d, err=ENOENT)
ctx.rmdir(d2, err=ENOTEMPTY)
./run --ov rename-pop-dir
/mnt/a/no_dir103: Expected error (Directory not empty) was not produced
Signed-off-by: Amir Goldstein <[email protected]>
Signed-off-by: Miklos Szeredi <[email protected]>
Diffstat (limited to 'net/unix/af_unix.c')
0 files changed, 0 insertions, 0 deletions
