From: Miklos Szeredi Date: Thu, 14 May 2015 08:04:44 +0000 (+0200) Subject: ovl: don't remove non-empty opaque directory X-Git-Tag: omap-for-v4.3/legacy-v2-signed~300^2~1 X-Git-Url: http://git.openpandora.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=d377c5eb54dd05aeb3094b7740252d19ba7791f7;p=pandora-kernel.git 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: Vincent Batts Signed-off-by: Miklos Szeredi Tested-by: Jordi Pujol Palomer Fixes: 263b4a0fee43 ("ovl: dont replace opaque dir") Cc: # v4.0+ --- Reading git-diff-tree failed