bug-tar
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Bug-tar] tar vs. zfs


From: Pieter Bowman
Subject: [Bug-tar] tar vs. zfs
Date: Fri, 8 Dec 2006 16:49:29 -0700 (MST)

This is not a bug per se, but more of an enhancement.

We've been using amanda for many years, using both native dump and GNU
tar as backup mechanisms.  Recently we started migrating to ZFS on our
Solaris systems.  One thought I had was to point tar at a ZFS snapshot
for the purposes of doing backups, giving a stable/read-only
filesystem for tar to work on.  However, I found a major problem with
this, in that the device number changes for each snapshot (and is
different from the parent filesystem).  Since the GNU tar
listed-incremental option relies on having a consistent device number,
we're stuck.  I looked through the code and it appears that this
problem has already been handled when the filesystem is NFS, so as an
experiment I made the following changes to tar and then made a few
tests.  The tests seemed to do what I expect them to, but I thought I
would ask if anybody saw a problem with this.

I believe the second of these two changes is a bug fix.

Thanks for any help you can provide.

Pieter

Pieter Bowman                        Voice:                 1-801-581-5252
University of Utah                   FAX:                   1-801-581-4148
Department of Mathematics            Email:           address@hidden
155 S 1400 E RM 233                  URL: http://www.math.utah.edu/~bowman
Salt Lake City, Ut, 84112-0090       Office:                       103 LCB


diff -r -c tar-1.16/src/incremen.c tar-1.16-local/src/incremen.c
*** tar-1.16/src/incremen.c     Fri Sep  8 10:42:18 2006
--- tar-1.16-local/src/incremen.c       Fri Dec  8 14:53:37 2006
***************
*** 71,77 ****
  
  #if HAVE_ST_FSTYPE_STRING
    static char const nfs_string[] = "nfs";
! # define NFS_FILE_STAT(st) (strcmp ((st).st_fstype, nfs_string) == 0)
  #else
  # define ST_DEV_MSB(st) (~ (dev_t) 0 << (sizeof (st).st_dev * CHAR_BIT - 1))
  # define NFS_FILE_STAT(st) (((st).st_dev & ST_DEV_MSB (st)) != 0)
--- 71,77 ----
  
  #if HAVE_ST_FSTYPE_STRING
    static char const nfs_string[] = "nfs";
! # define NFS_FILE_STAT(st) (strcmp ((st).st_fstype, nfs_string) == 0 || 
strcmp ((st).st_fstype, "zfs") == 0)
  #else
  # define ST_DEV_MSB(st) (~ (dev_t) 0 << (sizeof (st).st_dev * CHAR_BIT - 1))
  # define NFS_FILE_STAT(st) (((st).st_dev & ST_DEV_MSB (st)) != 0)
***************
*** 247,253 ****
         directories, consider all NFS devices as equal,
         relying on the i-node to establish differences.  */
  
!       if (! (((DIR_IS_NFS (directory) & nfs)
              || directory->device_number == stat_data->st_dev)
             && directory->inode_number == stat_data->st_ino))
        {
--- 247,253 ----
         directories, consider all NFS devices as equal,
         relying on the i-node to establish differences.  */
  
!       if (! (((DIR_IS_NFS (directory) && nfs)
              || directory->device_number == stat_data->st_dev)
             && directory->inode_number == stat_data->st_ino))
        {




reply via email to

[Prev in Thread] Current Thread [Next in Thread]