All of lore.kernel.org
 help / color / mirror / Atom feed
From: Timothy Shimmin <tes@sgi.com>
To: Richard Hartmann <richih.mailinglist@gmail.com>
Cc: Nathan Scott <nscott@aconex.com>, Bill Kendall <wkendall@sgi.com>,
	xfs@oss.sgi.com
Subject: Re: xfsrestore over ssh?
Date: Wed, 23 Jul 2008 10:19:24 +1000	[thread overview]
Message-ID: <4886790C.7040100@sgi.com> (raw)
In-Reply-To: <2d460de70807220351i7c468de5o33fa5aa5e9ddab99@mail.gmail.com>

Richard Hartmann wrote:
> On Tue, Jul 22, 2008 at 09:04, Timothy Shimmin <tes@sgi.com> wrote:
>> If you could strace it then we could see what call was failing> in path_to_fshandle().
> First with -ttt to get rid of a tty allocation error, then without:
> % cat root.xfs | ssh -ttt root@192.168.1.213 strace xfsrestore - /mnt/sda3

>From your output:
> open("/mnt/sda3", O_RDONLY|O_LARGEFILE) = 4
> ioctl(4, 0xc01c5868, 0xbfd4178c)        = -1 EINVAL (Invalid argument)
> close(4) 

(I probably should have just asked for:
 # strace -o output -e trace=open,ioctl xfsrestore ...)


> On Tue, Jul 22, 2008 at 12:49, Richard Hartmann
> <richih.mailinglist@gmail.com> wrote:
> 
>> > The Knoppix boot CD is am using to restore has 2.2.24-1, btw.
> 
> Grml to the rescue.. I downloaded a grml iso, which has 2.2.45-1,
> and was able to restore the image.
> 
> Extremely annoying, as I spent quite some time poking various
> options, thinking I had been doing something very basic very
> wrong. I assume the issue has been fixed between .24 and .45.
> 
> 
> Thanks again,
> Richard


Okay, my best guess is that you are trying to restore to a non-xfs
filesystem. This was fixed again in 2.2.26 so that it would work
on a non-xfs filesystem.
Otherwise the xfs ioctl will be being called and get back an EINVAL
as we saw in the strace.

Personally, I can't remember why we are bothering with handle code
in restore (in dump, yes, because of bulkstat but restore....
I vaguely remember a comment about optimitisation).



Looking at the code (annotated version) in restore:

wkendall  |1.34 |master-melb:xfs-cmds:187436a|  /* effectively initialize libhandle on this filesystem by
wkendall  |1.34 |master-melb:xfs-cmds:187436a|   * allocating a file system handle. this needs to be done
wkendall  |1.34 |master-melb:xfs-cmds:187436a|   * before any open_by_handle() calls (and possibly other
wkendall  |1.34 |master-melb:xfs-cmds:187436a|   * libhandle calls).
wkendall  |1.34 |master-melb:xfs-cmds:187436a|   */
wkendall  |1.34 |master-melb:xfs-cmds:187436a|  if ( persp->a.dstdirisxfspr ) {
wkendall  |1.34 |master-melb:xfs-cmds:187436a|          void    *fshanp;
wkendall  |1.34 |master-melb:xfs-cmds:187436a|          size_t  fshlen=0;
wkendall  |1.34 |master-melb:xfs-cmds:187436a|
wkendall  |1.34 |master-melb:xfs-cmds:187436a|          if(path_to_fshandle(persp->a.dstdir, &fshanp, &fshlen)) {
wkendall  |1.34 |master-melb:xfs-cmds:187436a|                  mlog( MLOG_NORMAL,
wkendall  |1.34 |master-melb:xfs-cmds:187436a|                          _("unable to construct a file "
wkendall  |1.34 |master-melb:xfs-cmds:187436a|                            "system handle for %s: %s\n"),
wkendall  |1.34 |master-melb:xfs-cmds:187436a|                          persp->a.dstdir,
wkendall  |1.34 |master-melb:xfs-cmds:187436a|                          strerror( errno ));
wkendall  |1.34 |master-melb:xfs-cmds:187436a|                  return BOOL_FALSE;
wkendall  |1.34 |master-melb:xfs-cmds:187436a|          }
wkendall  |1.34 |master-melb:xfs-cmds:187436a|          /* libhandle has it cached, release this copy */
wkendall  |1.34 |master-melb:xfs-cmds:187436a|          free_handle(fshanp, fshlen);
wkendall  |1.34 |master-melb:xfs-cmds:187436a|  }
wkendall  |1.34 |master-melb:xfs-cmds:187436a|

----------------------------
revision 1.34
date: 2005/02/10 02:14:17;  author: wkendall.bonnie.engr.sgi.com;  state: Exp;  lines: +34 -26
modid: master-melb:xfs-cmds:187436a
Fix a couple of spots in xfsrestore where XFS-specific calls were
being made without first checking to see if the filesystem being
restored is XFS.
Merge of master:xfs-cmds:187436a by kenmcd.
----------------------------

xfsdump-2.2.26 (09 February 2005)
        - Fix xfsrestore so that it can restore to non-XFS filesystems again.


--Tim

  parent reply	other threads:[~2008-07-23  0:18 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-07-21 20:17 xfsrestore over ssh? Richard Hartmann
2008-07-21 20:33 ` Bill Kendall
2008-07-22  3:02   ` Richard Hartmann
2008-07-22  3:59     ` Timothy Shimmin
2008-07-22  4:43       ` Richard Hartmann
2008-07-22  6:20         ` Donald Douwsma
2008-07-22 10:40           ` Richard Hartmann
2008-07-22  6:33       ` Nathan Scott
2008-07-22  7:04         ` Timothy Shimmin
2008-07-22 10:51           ` Richard Hartmann
2008-07-22 10:52             ` Richard Hartmann
2008-07-23  0:19             ` Timothy Shimmin [this message]
2008-07-23 11:39               ` Richard Hartmann
2008-07-22 10:45         ` Richard Hartmann
2008-07-22 10:49           ` Richard Hartmann
2008-07-22 12:00             ` Richard Hartmann

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=4886790C.7040100@sgi.com \
    --to=tes@sgi.com \
    --cc=nscott@aconex.com \
    --cc=richih.mailinglist@gmail.com \
    --cc=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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.