diff -urN xfsdump-2.2.13.orig/dump/inomap.c xfsdump-2.2.13/dump/inomap.c --- xfsdump-2.2.13.orig/dump/inomap.c Wed Apr 30 22:00:47 2003 +++ xfsdump-2.2.13/dump/inomap.c Sun Oct 19 21:58:23 2003 @@ -759,11 +759,24 @@ statp->bs_ino, statp->bs_uid, estimated_size ); + mlog( MLOG_NORMAL | MLOG_WARNING , + "deprecated SGI_XFSDUMP_SKIP_FILE extended attribute set on ino %llu\n", + statp->bs_ino ); map_add( ino, MAP_NDR_NOCHNG ); inomap_exclude_skipattr++; return 0; } } + if (allowexcludefiles_pr && statp->bs_xflags & XFS_XFLAG_NODUMP) { + mlog( MLOG_DEBUG | MLOG_EXCLFILES, + "pruned ino %llu, owner %u, estimated size %llu: skip flag set\n", + statp->bs_ino, + statp->bs_uid, + estimated_size ); + map_add( ino, MAP_NDR_NOCHNG ); + inomap_exclude_skipattr++; + return 0; + } #endif /* EXTATTR */ map_add( ino, MAP_NDR_CHANGE ); diff -urN xfsdump-2.2.13.orig/restore/content.c xfsdump-2.2.13/restore/content.c --- xfsdump-2.2.13.orig/restore/content.c Wed Apr 30 22:00:48 2003 +++ xfsdump-2.2.13/restore/content.c Sun Oct 19 23:14:55 2003 @@ -7339,41 +7339,6 @@ } } -#ifdef EXTATTR - /* set the extended attributes - */ - if ( persp->a.dstdirisxfspr ) { - struct fsxattr fsxattr; - - ( void )memset((void *)&fsxattr, - 0, - sizeof( fsxattr )); - fsxattr.fsx_xflags = - bstatp->bs_xflags; - ASSERT( bstatp->bs_extsize >= 0 ); - fsxattr.fsx_extsize = - ( u_int32_t ) - bstatp->bs_extsize; - - rval = ioctl( fd, - XFS_IOC_FSSETXATTR, - (void *)&fsxattr); - if ( rval < 0 ) { - mlog(MLOG_NORMAL | MLOG_WARNING, - _("attempt to set " - "extended attributes " - "(xflags 0x%x, " - "extsize = 0x%x)" - "of %s failed: " - "%s\n"), - bstatp->bs_xflags, - bstatp->bs_extsize, - path, - strerror(errno)); - } - } -#endif - #ifdef DMEXTATTR if ( persp->a.restoredmpr) { fsdmidata_t fssetdm; @@ -7551,6 +7516,41 @@ path, strerror( errno )); } + +#ifdef EXTATTR + /* set the extended attributes + */ + if ( persp->a.dstdirisxfspr ) { + struct fsxattr fsxattr; + + ( void )memset((void *)&fsxattr, + 0, + sizeof( fsxattr )); + fsxattr.fsx_xflags = + bstatp->bs_xflags; + ASSERT( bstatp->bs_extsize >= 0 ); + fsxattr.fsx_extsize = + ( u_int32_t ) + bstatp->bs_extsize; + + rval = ioctl( fd, + XFS_IOC_FSSETXATTR, + (void *)&fsxattr); + if ( rval < 0 ) { + mlog(MLOG_NORMAL | MLOG_WARNING, + _("attempt to set " + "extended attributes " + "(xflags 0x%x, " + "extsize = 0x%x)" + "of %s failed: " + "%s\n"), + bstatp->bs_xflags, + bstatp->bs_extsize, + path, + strerror(errno)); + } + } +#endif rval = close( fd ); if ( rval ) { diff -urN xfsdump-2.2.13.orig/restore/tree.c xfsdump-2.2.13/restore/tree.c --- xfsdump-2.2.13.orig/restore/tree.c Wed Apr 30 22:00:49 2003 +++ xfsdump-2.2.13/restore/tree.c Sun Oct 19 21:31:32 2003 @@ -2458,8 +2458,11 @@ mode_t mode; struct utimbuf utimbuf; /* REFERENCED */ - struct fsxattr fsxattr; /* can we get rid of this? */ + struct fsxattr fsxattr; intgen_t rval; + size_t hlen; + void *hanp; + intgen_t fd; if ( dah == DAH_NULL ) return; @@ -2469,10 +2472,7 @@ #ifdef DMEXTATTR if ( persp->p_restoredmpr ) { - size_t hlen; - void *hanp; fsdmidata_t fssetdm; - intgen_t fd; fssetdm.fsd_dmevmask = dirattr_get_dmevmask( dah ); fssetdm.fsd_padding = 0; /* not used */ @@ -2545,6 +2545,54 @@ path, strerror( errno )); } + +#ifdef EXTATTR + /* set the extended attributes + */ +#if 0 /* open_by_handle() doesn't work */ + if (path_to_handle(path, &hanp, &hlen)) { + mlog( MLOG_NORMAL | MLOG_WARNING, _( + "path_to_handle of %s failed:%s\n"), + path, strerror( errno )); + return; + } + + fd = open_by_handle(hanp, hlen, O_RDONLY); + if (fd < 0) { + mlog( MLOG_NORMAL | MLOG_WARNING, _( + "open_by_handle of %s failed:%s\n"), + path, strerror( errno )); + free_handle(hanp, hlen); + return; + } + free_handle(hanp, hlen); +#else + fd = open(path, O_RDONLY); + if (fd < 0) { + mlog( MLOG_NORMAL | MLOG_WARNING, _( + "open of %s failed:%s\n"), + path, strerror( errno )); + return; + } +#endif /* broken *handle() */ + rval = ioctl( fd, + XFS_IOC_FSSETXATTR, + (void *)&fsxattr); + if ( rval < 0 ) { + mlog(MLOG_NORMAL | MLOG_WARNING, + _("attempt to set " + "extended attributes " + "(xflags 0x%x, " + "extsize = 0x%x)" + "of %s failed: " + "%s\n"), + dirattr_get_xflags( dah ), + dirattr_get_extsize( dah ), + path, + strerror(errno)); + } + ( void )close( fd ); +#endif /* EXTATTR */ } /* deletes orphanage if empty, else warns