xfs
[Top] [All Lists]

[PATCH] [PRELIMINARY] Add support for file flags to xfsdump #1

To: linux-xfs@xxxxxxxxxxx
Subject: [PATCH] [PRELIMINARY] Add support for file flags to xfsdump #1
From: Ethan Benson <erbenson@xxxxxxxxxx>
Date: Sun, 19 Oct 2003 23:31:51 -0800
Mail-copies-to: nobody
Mail-followup-to: linux-xfs@xxxxxxxxxxx
Sender: linux-xfs-bounce@xxxxxxxxxxx
User-agent: Mutt/1.3.28i
Hi,

Recently my patches to add file flags to XFS were merged (immutable,
append-only etc).  xfsdump has some problems with the new flags:

* immutable/append-only files cannot be restored correctly as these
  flags are restored too soon, denying xfsrestore the permission it
  needs to complete its task.

* file flags are not restored to directories.

* the new nodump flag is ignored.

The attached patch fixes all of this, however I don't know enough
about xfsdump internals to know for sure that my fixes are truly
correct, I need someone with SGI who is familiar with xfsdump to
comment on this.

What I have done to fix the above problems in order:

* restore/content.c: move the restoration of xflags to the end of the
  restore_reg() function, right before the file is closed, previously it
  was done before DMAPI events were restored.

* restore/tree.c: Add code to restore xflags, this currently needs
  work, as you will notice I tried to use the same method as the DMAPI
  restore code does, open_by_handle(), however open_by_handle() does not
  work in my tests (always returns EBADF), I cannot explain why.  For
  now I #ifdef'ed out that code and replaced it with a standard open()
  call.  Also I am not sure if the new code needs to be wrapped in a
  test to check whether xattrs are being restored or not, all the other
  functions restoring xflags seem to have such a test, however its not
  clear to me how to test that in this context.

* dump/inomap.c: Add warning when SGI_XFSDUMP_SKIP_FILE xattr is
  present, but still honor it, this attribute is deprecated in favor of
  the new nodump file flag, support for the obsolete xattr should be
  removed in a future xfsdump (its not that old so this shouldn't be
  much of a problem).  Add check for new nodump file flag.

-- 
Ethan Benson
http://www.alaska.net/~erbenson/

Attachment: xfsdump-xflags.diff
Description: Text document

Attachment: pgpJlshJMWxEY.pgp
Description: PGP signature

<Prev in Thread] Current Thread [Next in Thread>