Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Skip to content
Commit d377c5eb authored by Miklos Szeredi's avatar Miklos Szeredi
Browse files

ovl: don't remove non-empty opaque directory



When removing an opaque directory we can't just call rmdir() to check for
emptiness, because the directory will need to be replaced with a whiteout.
The replacement is done with RENAME_EXCHANGE, which doesn't check
emptiness.

Solution is just to check emptiness by reading the directory.  In the
future we could add a new rename flag to check for emptiness even for
RENAME_EXCHANGE to optimize this case.

Reported-by: default avatarVincent Batts <vbatts@gmail.com>
Signed-off-by: default avatarMiklos Szeredi <mszeredi@suse.cz>
Tested-by: default avatarJordi Pujol Palomer <jordipujolp@gmail.com>
Fixes: 263b4a0f ("ovl: dont replace opaque dir")
Cc: <stable@vger.kernel.org> # v4.0+
parent 030bbdbf
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment