From 22afaa758661c76f9cb5be201fc4eb4468ddc76c Mon Sep 17 00:00:00 2001 From: ed Date: Thu, 17 Sep 2026 21:46:12 +0000 Subject: [PATCH] nocow histpath iff btrfs --- copyparty/up2k.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/copyparty/up2k.py b/copyparty/up2k.py index fe4bdf616..6391cca49 100644 --- a/copyparty/up2k.py +++ b/copyparty/up2k.py @@ -1313,11 +1313,14 @@ class Up2k(object): self.log(t % (vpath, ex), 1) return None - if dir_is_empty(self.log_func, not self.args.no_scandir, histpath) and not ( - ANYWIN or UNIX or "hist_cow" in flags + if not ( + ANYWIN or UNIX or "hist_cow" in flags or "up2k.db" in os.listdir(histpath) ): try: - runcmd([b"chattr", b"+C", fsenc(histpath)], 1) + if self.fstab.get(ptop)[0] != "btrfs": + raise Exception() + runcmd([b"chattr", b"-c", fsenc(histpath)], 1) # compression and... + runcmd([b"chattr", b"+C", fsenc(histpath)], 1) # no-cow are incompat except: pass