g2p / bedup

Btrfs deduplication
http://pypi.python.org/pypi/bedup
GNU General Public License v2.0
322 stars 50 forks source link

bedup fails if top-level subvolume has higher ID nr than its sub-subvolumes #78

Open elmystico opened 8 years ago

elmystico commented 8 years ago

In other words: bedup fails when scans for subvolumes and sub-subvolumes were created before its top-level subvolume. When I've reordered subvolumes bedup stoped failing.

What I did: Started bedup for first time. Seemed ok but took so long to finish so i decided to make a subvolume to dedup partially only in subvolume. I've made a subvolume and mv all contents of a folder (that contained many subvolumes) to that newly created subvolume.

Now bedup fails with:

Traceback (most recent call last): File "/usr/sbin/bedup", line 9, in load_entry_point('bedup==0.10.1', 'console_scripts', 'bedup')() File "/root/.local/lib/python3.5/site-packages/bedup-0.10.1-py3.5-linux-x86_64.egg/bedup/main.py", line 497, in script_main sys.exit(main(sys.argv)) File "/root/.local/lib/python3.5/site-packages/bedup-0.10.1-py3.5-linux-x86_64.egg/bedup/main.py", line 486, in main return args.action(args) File "/root/.local/lib/python3.5/site-packages/bedup-0.10.1-py3.5-linux-x86_64.egg/bedup/main.py", line 127, in vol_cmd vols = whole_fs.load_all_writable_vols(tt) File "/root/.local/lib/python3.5/site-packages/bedup-0.10.1-py3.5-linux-x86_64.egg/bedup/filesystem.py", line 560, in load_all_writable_vols fs.root_info File "/root/.local/lib/python3.5/site-packages/SQLAlchemy-1.1.0b2-py3.5-linux-x86_64.egg/sqlalchemy/util/langhelpers.py", line 754, in get obj.dict[self.name] = result = self.fget(obj) File "/root/.local/lib/python3.5/site-packages/bedup-0.10.1-py3.5-linux-x86_64.egg/bedup/filesystem.py", line 193, in root_info return read_root_tree(fd) File "/root/.local/lib/python3.5/site-packages/bedup-0.10.1-py3.5-linux-x86_64.egg/bedup/platform/btrfs.py", line 545, in read_root_tree for (root_id, ri) in ri_rel.items(): RuntimeError: dictionary changed size during iteration

florianjacob commented 8 years ago

I can reproduce this as well, bedup broke after Idid some rearrangements to my btrfs subvolume layout.