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?
From eb24fdc4ce45496adca0eb3f04ed5db528076fa7 Mon Sep 17 00:00:00 2001 From: OmegaPhil <omegap...@startmail.com> Date: Sun, 17 Jul 2016 12:39:51 +0100 Subject: [PATCH 1/2] Error objects do not have message attributes --- fsck.aufs.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/fsck.aufs.py b/fsck.aufs.py index 2564932..6181350 100755 --- a/fsck.aufs.py +++ b/fsck.aufs.py @@ -70,9 +70,9 @@ def main(): fsck.start_checks() except ValueError as e: - print('ValueError: {}'.format(e.message)) + print('ValueError: {}'.format(e)) except EnvironmentError as e: - print('EnvironmentError: {}'.format(e.message)) + print('EnvironmentError: {}'.format(e)) except IOError as e: print('IOError: {}'.format(e.strerror)) @@ -445,7 +445,7 @@ class AufsCheck: print('-> {} successfully deleted'.format(fullpath)) except OSError as e: remove_whiteouted_success = False - print(' /!\\ Deletion of {} failed : '.format(fullpath, e.message)) + print(' /!\\ Deletion of {} failed : '.format(fullpath, e)) # Remove the whiteout if it become unnecessarily (ie. we removed all path whiteouted) if remove_whiteouted_success: if not dry_run: -- 2.8.1
From 1d89d8c7348deed8583c0b7ad670eae8de2fc356 Mon Sep 17 00:00:00 2001 From: OmegaPhil <omegap...@startmail.com> Date: Thu, 21 Jul 2016 18:57:49 +0100 Subject: [PATCH 2/2] Fix deletion of symlinked directories, fix some error reporting --- fsck.aufs.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/fsck.aufs.py b/fsck.aufs.py index 6181350..f7b3af1 100755 --- a/fsck.aufs.py +++ b/fsck.aufs.py @@ -437,7 +437,8 @@ class AufsCheck: try: if not dry_run: fullpath = os.path.join(branch, filepath) - if os.path.isdir(fullpath): + # Make sure symlinks to directories are treated as normal files + if not os.path.islink(fullpath) and os.path.isdir(fullpath): shutil.rmtree(fullpath) else: os.remove(fullpath) @@ -445,7 +446,7 @@ class AufsCheck: print('-> {} successfully deleted'.format(fullpath)) except OSError as e: remove_whiteouted_success = False - print(' /!\\ Deletion of {} failed : '.format(fullpath, e)) + print(' /!\\ Deletion of {} failed : {} '.format(fullpath, e)) # Remove the whiteout if it become unnecessarily (ie. we removed all path whiteouted) if remove_whiteouted_success: if not dry_run: @@ -453,7 +454,7 @@ class AufsCheck: if self.args.verbose: print('-> {} successfully deleted'.format(whiteout_path)) else: - print(' -> {} left because of previours error'.format(whiteout_path)) + print(' -> {} left because of previous error'.format(whiteout_path)) @staticmethod -- 2.8.1
signature.asc
Description: OpenPGP digital signature
------------------------------------------------------------------------------ What NetFlow Analyzer can do for you? Monitors network bandwidth and traffic patterns at an interface-level. Reveals which users, apps, and protocols are consuming the most bandwidth. Provides multi-vendor support for NetFlow, J-Flow, sFlow and other flows. Make informed decisions using capacity planning reports.http://sdm.link/zohodev2dev