On 21/07/16 20:00, OmegaPhil wrote:
> Hi Alex,
> 
> Thanks for your changes and responses on
> https://gist.github.com/Alex131089/560a1386dd756059e21b - it looks like
> I can't subscribe to gists and I don't get emailed when mentioned, just
> bringing to your attention that I did see your messages and did respond :)
> 
> I have used the script a bit more, and have fixed some bugs - see
> attached patches - basically some error code reporting was wrong, and
> the script treated a symlinked directory as a directory, subsequently
> calling rmtree on it and failing as a symlink is a file.
> 
> I have 475 examples of the 'File has whiteout but is visible ?!'
> warning/error on my main aufs volume. In my case I have 4 writable
> branches, looking into the first example the whiteout exists on the 2nd
> branch and the whiteouted file exists both on the 1st and 3rd branches -
> therefore the whiteout only hides the 3rd branch file but lets the 1st
> branch one through.
> 
> I think this is valid aufs behaviour, but I agree its invalid for me
> (infact the whole whiteout idea is since I'm using 4 writeable branches
> to represent one 'whole' writeable disk, if a file gets deleted it
> should be purged everywhere). Shall I add a switch to go ahead and
> delete visible files (and then the whiteout) when they 'should' have
> been whiteouted from this perspective?
> 


I haven't had a response so I've gone ahead anyway - I've changed the
'file is visible but has whiteout' detection to lead to the file + the
whiteouts being deleted, as happens with other spurious whiteouts -
patch attached.

Do you mind if I host the script and my changes under my Github account,
if you don't want to maintain it?
From 31852544351e1e8fdbd16cd94f5d9f9594ede237 Mon Sep 17 00:00:00 2001
From: OmegaPhil <omegap...@startmail.com>
Date: Fri, 5 Aug 2016 17:03:48 +0100
Subject: [PATCH 3/3] Allow the presence of a file despite a whiteout to be a
 problem that is fixed during whiteout checking

---
 fsck.aufs.py | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/fsck.aufs.py b/fsck.aufs.py
index f7b3af1..83f7e08 100755
--- a/fsck.aufs.py
+++ b/fsck.aufs.py
@@ -278,8 +278,11 @@ class AufsCheck:
 		existing_branches = [branch for branch in self.branches if branch != current_branch and os.path.exists(os.path.join(branch, relpath, filename))]
 		
 		if os.path.exists(visible_path):
-			print(' /!\\ File {} has whiteout ({}) but is visible ?!'.format(visible_path, whiteout_path))
-		elif len(existing_branches) > 0:
+			# A whiteout can exist at the same time as a visible file, if the whiteouted file is present on an earlier (higher priority) branch
+			# then the whiteout
+			print(' /!\\ File {} has whiteout ({}) but is visible - whiteout branch is lower priority?'.format(visible_path, whiteout_path))
+
+		if len(existing_branches) > 0:
 			if self.args.verbose:
 				print('{} ({}) whiteouts : '.format(whiteout_path, self.branches[current_branch]['branch']))
 				for branch in existing_branches:
-- 
2.8.1

Attachment: signature.asc
Description: OpenPGP digital signature

------------------------------------------------------------------------------

Reply via email to