<div dir="ltr">Hi Cyrill,<div><br></div><div>Thanks for the patch. As you've probably already seen on Github, the issue is that during dump new->root is saved as /null//deleted, causing failure during restore.</div><div><br></div><div>Although with your patch strip_deleted() removes both " (deleted)" and "//deleted", new->root never makes it to strip_deleted().</div><div><br></div><div>As a quick test, I removed "//deleted" from new->root in parse_mountinfo_ent() and C/R works!</div><div><br></div><div>Hope this helps.</div><div><br></div><div>--Saied</div><div><br></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Tue, Jul 28, 2015 at 1:03 AM, Cyrill Gorcunov <span dir="ltr"><<a href="mailto:gorcunov@openvz.org" target="_blank">gorcunov@openvz.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">At moment here are two postfixes kernel supports,<br>
so rework the routine to handle both.<br>
<br>
Signed-off-by: Cyrill Gorcunov <<a href="mailto:gorcunov@openvz.org">gorcunov@openvz.org</a>><br>
---<br>
files-reg.c | 30 +++++++++++++++++++++++-------<br>
1 file changed, 23 insertions(+), 7 deletions(-)<br>
<br>
diff --git a/files-reg.c b/files-reg.c<br>
index 2a6269b2a550..1a89e45a89bd 100644<br>
--- a/files-reg.c<br>
+++ b/files-reg.c<br>
@@ -647,16 +647,32 @@ static inline bool nfs_silly_rename(char *rpath, const struct fd_parms *parms)<br>
<br>
static void strip_deleted(struct fd_link *link)<br>
{<br>
- const char postfix[] = " (deleted)";<br>
- const size_t plen = strlen(postfix);<br>
+ struct dcache_prepends {<br>
+ const char *str;<br>
+ size_t len;<br>
+ } static const prepends[] = {<br>
+ {<br>
+ .str = " (deleted)",<br>
+ .len = 10,<br>
+ }, {<br>
+ .str = "//deleted",<br>
+ .len = 10,<br>
+ }<br>
+ };<br>
+ size_t i;<br>
+<br>
+ for (i = 0; i < ARRAY_SIZE(prepends); i++) {<br>
+ size_t at;<br>
+<br>
+ if (link->len <= prepends[i].len)<br>
+ continue;<br>
<br>
- if (link->len > plen) {<br>
- size_t at = link->len - plen;<br>
- if (!strcmp(&link->name[at], postfix)) {<br>
+ at = link->len - prepends[i].len;<br>
+ if (!strcmp(&link->name[at], prepends[i].str)) {<br>
pr_debug("Stip %s' tag from '%s'\n",<br>
- postfix, link->name);<br>
+ prepends[i].str, link->name);<br>
link->name[at] = '\0';<br>
- link->len -= plen;<br>
+ link->len -= prepends[i].len;<br>
}<br>
}<br>
}<br>
<span class="HOEnZb"><font color="#888888">--<br>
2.4.3<br>
<br>
</font></span></blockquote></div><br></div>