From 80459cf8380301800e4d024a5eb2bc4a63cdd919 Mon Sep 17 00:00:00 2001 From: An-Cheng Huang Date: Thu, 26 Aug 2010 14:49:04 -0700 Subject: mark changed ancestors up to the root --- src/cstore/unionfs/cstore-unionfs.cpp | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/cstore/unionfs/cstore-unionfs.cpp b/src/cstore/unionfs/cstore-unionfs.cpp index 849d659..eebabfe 100644 --- a/src/cstore/unionfs/cstore-unionfs.cpp +++ b/src/cstore/unionfs/cstore-unionfs.cpp @@ -755,9 +755,15 @@ bool UnionfsCstore::mark_changed_with_ancestors() { b_fs::path opath = mutable_cfg_path; // use a copy - while (opath.has_parent_path()) { - b_fs::path marker = (work_root / opath); - pop_path(opath); + bool done = false; + while (!done) { + b_fs::path marker = work_root; + if (opath.has_parent_path()) { + marker /= opath; + pop_path(opath); + } else { + done = true; + } if (!b_fs_exists(marker) || !b_fs_is_directory(marker)) { // don't do anything if the node is not there continue; -- cgit v1.2.3