public inbox for linux-xfs@vger.kernel.org
 help / color / mirror / Atom feed
From: Bill Kendall <wkendall@sgi.com>
To: xfs@oss.sgi.com
Subject: [PATCH] xfsdump: dirs being created in list-only restore
Date: Wed, 22 Feb 2012 12:55:06 -0600	[thread overview]
Message-ID: <1329936906-12470-1-git-send-email-wkendall@sgi.com> (raw)
In-Reply-To: <CAGdb-8fC4-3swyyfP3xO=camgzDjR5GYV3qoaB1w+xAfiNeYPw@mail.gmail.com>

When xfsrestore is run with the -t option, it lists the files contained
in the dump but does not restore anything. This patch fixes code that
creates an orphaned file's parent directories without checking to see if
this is a list-only (table-of-contents) restore.

Signed-off-by: Bill Kendall <wkendall@sgi.com>
---
 restore/tree.c |   14 +++++++++-----
 1 files changed, 9 insertions(+), 5 deletions(-)

diff --git a/restore/tree.c b/restore/tree.c
index 05e0628..a61fd16 100644
--- a/restore/tree.c
+++ b/restore/tree.c
@@ -1867,12 +1867,16 @@ tree_cb_links( xfs_ino_t ino,
 					return RV_NOTOK;
 				}
 			} else {
-				char *dir;
-				char tmp[PATH_MAX];
 
-				strcpy(tmp, path);
-				dir = dirname(tmp);
-				mkdir_r(dir);
+				if ( ! tranp->t_toconlypr ) {
+					char *dir;
+					char tmp[PATH_MAX];
+
+					strcpy(tmp, path);
+					dir = dirname(tmp);
+					mkdir_r(dir);
+				}
+
 				mlog (MLOG_VERBOSE | MLOG_NOTE | MLOG_TREE, _(
 				      "ino %llu salvaging file,"
 				      " placing in %s\n"), ino, path1);
-- 
1.7.0.4

_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs

      parent reply	other threads:[~2012-02-22 18:55 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-02-14 17:21 xfsrestore will create orphanage directory when use -t Tommy Wu
2012-02-17 20:50 ` Bill Kendall
2012-02-18  0:22   ` Tommy Wu
2012-02-18  0:34     ` Tommy Wu
2012-02-22 18:31     ` Bill Kendall
2012-02-23  1:16       ` Tommy Wu
2012-02-22 18:55 ` Bill Kendall [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1329936906-12470-1-git-send-email-wkendall@sgi.com \
    --to=wkendall@sgi.com \
    --cc=xfs@oss.sgi.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox