Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
View | Details | Raw Unified | Return to bug 852269
Collapse All | Expand All

(-)a/doc/xfsdump.html (-1 lines)
Lines 1092-1098 the size of the hash table. Link Here
1092
        bool_t p_ownerpr - whether to restore directory owner/group attributes
1092
        bool_t p_ownerpr - whether to restore directory owner/group attributes
1093
        bool_t p_fullpr - whether restoring a full level 0 non-resumed dump
1093
        bool_t p_fullpr - whether restoring a full level 0 non-resumed dump
1094
        bool_t p_ignoreorphpr - set if positive subtree or interactive
1094
        bool_t p_ignoreorphpr - set if positive subtree or interactive
1095
        bool_t p_restoredmpr - restore DMI event settings
1096
</pre>
1095
</pre>
1097
<p>
1096
<p>
1098
The hash table maps the inode number to the tree node. It is a
1097
The hash table maps the inode number to the tree node. It is a
(-)a/po/de.po (-5 lines)
Lines 3972-3982 msgstr "" Link Here
3972
msgid "no additional media objects needed\n"
3972
msgid "no additional media objects needed\n"
3973
msgstr "keine zusätzlichen Mediendateien benötigt\n"
3973
msgstr "keine zusätzlichen Mediendateien benötigt\n"
3974
3974
3975
#: .././restore/content.c:9547
3976
#, c-format
3977
msgid "fssetdm_by_handle of %s failed %s\n"
3978
msgstr "fssetdm_by_handle von %s fehlgeschlagen %s\n"
3979
3980
#: .././restore/content.c:9566
3975
#: .././restore/content.c:9566
3981
#, c-format
3976
#, c-format
3982
msgid "%s quota information written to '%s'\n"
3977
msgid "%s quota information written to '%s'\n"
(-)a/po/pl.po (-5 lines)
Lines 3455-3465 msgstr "nie są potrzebne dodatkowe obiekty nośnika\n" Link Here
3455
msgid "path_to_handle of %s failed:%s\n"
3455
msgid "path_to_handle of %s failed:%s\n"
3456
msgstr "path_to_handle na %s nie powiodło się: %s\n"
3456
msgstr "path_to_handle na %s nie powiodło się: %s\n"
3457
3457
3458
#: .././restore/content.c:9723
3459
#, c-format
3460
msgid "fssetdm_by_handle of %s failed %s\n"
3461
msgstr "fssetdm_by_handle na %s nie powiodło się: %s\n"
3462
3463
#: .././restore/content.c:9742
3458
#: .././restore/content.c:9742
3464
#, c-format
3459
#, c-format
3465
msgid "%s quota information written to '%s'\n"
3460
msgid "%s quota information written to '%s'\n"
(-)a/restore/content.c (-93 / +6 lines)
Lines 477-485 struct pers { Link Here
477
			/* how many pages following the header page are reserved
477
			/* how many pages following the header page are reserved
478
			 * for the subtree descriptors
478
			 * for the subtree descriptors
479
			 */
479
			 */
480
		bool_t restoredmpr;
481
			/* restore DMAPI event settings
482
			 */
483
		bool_t restoreextattrpr;
480
		bool_t restoreextattrpr;
484
			/* restore extended attributes
481
			/* restore extended attributes
485
			 */
482
			 */
Lines 858-864 static void partial_reg(ix_t d_index, xfs_ino_t ino, off64_t fsize, Link Here
858
                        off64_t offset, off64_t sz);
855
                        off64_t offset, off64_t sz);
859
static bool_t partial_check (xfs_ino_t ino, off64_t fsize);
856
static bool_t partial_check (xfs_ino_t ino, off64_t fsize);
860
static bool_t partial_check2 (partial_rest_t *isptr, off64_t fsize);
857
static bool_t partial_check2 (partial_rest_t *isptr, off64_t fsize);
861
static int do_fssetdm_by_handle(char *path, fsdmidata_t *fdmp);
862
static int quotafilecheck(char *type, char *dstdir, char *quotafile);
858
static int quotafilecheck(char *type, char *dstdir, char *quotafile);
863
859
864
/* definition of locally defined global variables ****************************/
860
/* definition of locally defined global variables ****************************/
Lines 894-900 content_init(int argc, char *argv[], size64_t vmsz) Link Here
894
	bool_t changepr;/* cmd line overwrite inhibit specification */
890
	bool_t changepr;/* cmd line overwrite inhibit specification */
895
	bool_t interpr;	/* cmd line interactive mode requested */
891
	bool_t interpr;	/* cmd line interactive mode requested */
896
	bool_t ownerpr;	/* cmd line chown/chmod requested */
892
	bool_t ownerpr;	/* cmd line chown/chmod requested */
897
	bool_t restoredmpr; /* cmd line restore dm api attrs specification */
898
	bool_t restoreextattrpr; /* cmd line restore extended attr spec */
893
	bool_t restoreextattrpr; /* cmd line restore extended attr spec */
899
	bool_t sesscpltpr; /* force completion of prev interrupted session */
894
	bool_t sesscpltpr; /* force completion of prev interrupted session */
900
	ix_t stcnt;	/* cmd line number of subtrees requested */
895
	ix_t stcnt;	/* cmd line number of subtrees requested */
Lines 956-962 content_init(int argc, char *argv[], size64_t vmsz) Link Here
956
	newerpr = BOOL_FALSE;
951
	newerpr = BOOL_FALSE;
957
	changepr = BOOL_FALSE;
952
	changepr = BOOL_FALSE;
958
	ownerpr = BOOL_FALSE;
953
	ownerpr = BOOL_FALSE;
959
	restoredmpr = BOOL_FALSE;
960
	restoreextattrpr = BOOL_TRUE;
954
	restoreextattrpr = BOOL_TRUE;
961
	sesscpltpr = BOOL_FALSE;
955
	sesscpltpr = BOOL_FALSE;
962
	stcnt = 0;
956
	stcnt = 0;
Lines 1162-1169 content_init(int argc, char *argv[], size64_t vmsz) Link Here
1162
			tranp->t_noinvupdatepr = BOOL_TRUE;
1156
			tranp->t_noinvupdatepr = BOOL_TRUE;
1163
			break;
1157
			break;
1164
		case GETOPT_SETDM:
1158
		case GETOPT_SETDM:
1165
			restoredmpr = BOOL_TRUE;
1159
			mlog(MLOG_NORMAL | MLOG_ERROR, _(
1166
			break;
1160
			      "-%c option no longer supported\n"),
1161
			      GETOPT_SETDM);
1162
			usage();
1163
			return BOOL_FALSE;
1167
		case GETOPT_ALERTPROG:
1164
		case GETOPT_ALERTPROG:
1168
			if (!optarg || optarg[0] == '-') {
1165
			if (!optarg || optarg[0] == '-') {
1169
				mlog(MLOG_NORMAL | MLOG_ERROR, _(
1166
				mlog(MLOG_NORMAL | MLOG_ERROR, _(
Lines 1574-1585 content_init(int argc, char *argv[], size64_t vmsz) Link Here
1574
	}
1571
	}
1575
1572
1576
	if (persp->a.valpr) {
1573
	if (persp->a.valpr) {
1577
		if (restoredmpr && persp->a.restoredmpr != restoredmpr) {
1578
			mlog(MLOG_NORMAL | MLOG_ERROR, _(
1579
			     "-%c cannot reset flag from previous restore\n"),
1580
			      GETOPT_SETDM);
1581
			return BOOL_FALSE;
1582
		}
1583
		if (!restoreextattrpr &&
1574
		if (!restoreextattrpr &&
1584
		       persp->a.restoreextattrpr != restoreextattrpr) {
1575
		       persp->a.restoreextattrpr != restoreextattrpr) {
1585
			mlog(MLOG_NORMAL | MLOG_ERROR, _(
1576
			mlog(MLOG_NORMAL | MLOG_ERROR, _(
Lines 1734-1740 content_init(int argc, char *argv[], size64_t vmsz) Link Here
1734
			persp->a.newerpr = newerpr;
1725
			persp->a.newerpr = newerpr;
1735
			persp->a.newertime = newertime;
1726
			persp->a.newertime = newertime;
1736
		}
1727
		}
1737
		persp->a.restoredmpr = restoredmpr;
1738
		if (!persp->a.dstdirisxfspr) {
1728
		if (!persp->a.dstdirisxfspr) {
1739
			restoreextattrpr = BOOL_FALSE;
1729
			restoreextattrpr = BOOL_FALSE;
1740
		}
1730
		}
Lines 2365-2371 content_stream_restore(ix_t thrdix) Link Here
2365
					scrhdrp->cih_inomap_nondircnt,
2355
					scrhdrp->cih_inomap_nondircnt,
2366
					tranp->t_vmsz,
2356
					tranp->t_vmsz,
2367
					fullpr,
2357
					fullpr,
2368
					persp->a.restoredmpr,
2369
					persp->a.dstdirisxfspr,
2358
					persp->a.dstdirisxfspr,
2370
					grhdrp->gh_version,
2359
					grhdrp->gh_version,
2371
					tranp->t_truncategenpr);
2360
					tranp->t_truncategenpr);
Lines 7549-7560 restore_reg(drive_t *drivep, Link Here
7549
		}
7538
		}
7550
	}
7539
	}
7551
7540
7552
	if (persp->a.dstdirisxfspr && persp->a.restoredmpr) {
7553
		HsmBeginRestoreFile(bstatp,
7554
				     *fdp,
7555
				     &strctxp->sc_hsmflags);
7556
	}
7557
7558
	return BOOL_TRUE;
7541
	return BOOL_TRUE;
7559
}
7542
}
7560
7543
Lines 7726-7751 restore_complete_reg(stream_context_t *strcxtp) Link Here
7726
		      strerror(errno));
7709
		      strerror(errno));
7727
	}
7710
	}
7728
7711
7729
	if (persp->a.dstdirisxfspr && persp->a.restoredmpr) {
7730
		fsdmidata_t fssetdm;
7731
7732
		/* Set the DMAPI Fields. */
7733
		fssetdm.fsd_dmevmask = bstatp->bs_dmevmask;
7734
		fssetdm.fsd_padding = 0;
7735
		fssetdm.fsd_dmstate = bstatp->bs_dmstate;
7736
7737
		rval = ioctl(fd, XFS_IOC_FSSETDM, (void *)&fssetdm);
7738
		if (rval) {
7739
			mlog(MLOG_NORMAL | MLOG_WARNING,
7740
			      _("attempt to set DMI attributes of %s "
7741
			      "failed: %s\n"),
7742
			      path,
7743
			      strerror(errno));
7744
		}
7745
7746
		HsmEndRestoreFile(path, fd, &strcxtp->sc_hsmflags);
7747
	}
7748
7749
	/* set any extended inode flags that couldn't be set
7712
	/* set any extended inode flags that couldn't be set
7750
	 * prior to restoring the data.
7713
	 * prior to restoring the data.
7751
	 */
7714
	 */
Lines 8064-8080 restore_symlink(drive_t *drivep, Link Here
8064
				      strerror(errno));
8027
				      strerror(errno));
8065
			}
8028
			}
8066
		}
8029
		}
8067
8068
		if (persp->a.restoredmpr) {
8069
		fsdmidata_t fssetdm;
8070
8071
		/*	Restore DMAPI fields. */
8072
8073
		fssetdm.fsd_dmevmask = bstatp->bs_dmevmask;
8074
		fssetdm.fsd_padding = 0;
8075
		fssetdm.fsd_dmstate = bstatp->bs_dmstate;
8076
		rval = do_fssetdm_by_handle(path, &fssetdm);
8077
		}
8078
	}
8030
	}
8079
8031
8080
	return BOOL_TRUE;
8032
	return BOOL_TRUE;
Lines 8777-8783 restore_extattr(drive_t *drivep, Link Here
8777
		}
8729
		}
8778
		assert(nread == (int)(recsz - EXTATTRHDR_SZ));
8730
		assert(nread == (int)(recsz - EXTATTRHDR_SZ));
8779
8731
8780
		if (!persp->a.restoreextattrpr && !persp->a.restoredmpr) {
8732
		if (!persp->a.restoreextattrpr) {
8781
			continue;
8733
			continue;
8782
		}
8734
		}
8783
8735
Lines 8796-8814 restore_extattr(drive_t *drivep, Link Here
8796
			}
8748
			}
8797
		} else if (isfilerestored && path[0] != '\0') {
8749
		} else if (isfilerestored && path[0] != '\0') {
8798
			setextattr(path, ahdrp);
8750
			setextattr(path, ahdrp);
8799
8800
			if (persp->a.dstdirisxfspr && persp->a.restoredmpr) {
8801
				int flag = 0;
8802
				char *attrname = (char *)&ahdrp[1];
8803
				if (ahdrp->ah_flags & EXTATTRHDR_FLAGS_ROOT)
8804
					flag = ATTR_ROOT;
8805
				else if (ahdrp->ah_flags & EXTATTRHDR_FLAGS_SECURE)
8806
					flag = ATTR_SECURE;
8807
8808
				HsmRestoreAttribute(flag,
8809
						     attrname,
8810
						     &strctxp->sc_hsmflags);
8811
			}
8812
		}
8751
		}
8813
	}
8752
	}
8814
	/* NOTREACHED */
8753
	/* NOTREACHED */
Lines 9709-9740 display_needed_objects(purp_t purp, Link Here
9709
	}
9648
	}
9710
}
9649
}
9711
9650
9712
static int
9713
do_fssetdm_by_handle(
9714
	char		*path,
9715
	fsdmidata_t	*fdmp)
9716
{
9717
	void		*hanp;
9718
	size_t		hlen=0;
9719
	int		rc;
9720
9721
	if (path_to_handle(path, &hanp, &hlen)) {
9722
		mlog(MLOG_NORMAL | MLOG_WARNING, _(
9723
			"path_to_handle of %s failed:%s\n"),
9724
			path, strerror(errno));
9725
		return -1;
9726
	}
9727
9728
	rc = fssetdm_by_handle(hanp, hlen, fdmp);
9729
	free_handle(hanp, hlen);
9730
	if (rc) {
9731
		mlog(MLOG_NORMAL | MLOG_WARNING, _(
9732
			"fssetdm_by_handle of %s failed %s\n"),
9733
			path, strerror(errno));
9734
	}
9735
	return rc;
9736
}
9737
9738
static int
9651
static int
9739
quotafilecheck(char *type, char *dstdir, char *quotafile)
9652
quotafilecheck(char *type, char *dstdir, char *quotafile)
9740
{
9653
{
(-)a/restore/tree.c (-33 lines)
Lines 108-116 struct treePersStorage { Link Here
108
	bool_t p_ignoreorphpr;
108
	bool_t p_ignoreorphpr;
109
		/* set if positive subtree or interactive
109
		/* set if positive subtree or interactive
110
		 */
110
		 */
111
	bool_t p_restoredmpr;
112
		/* restore DMI event settings
113
		 */
114
	bool_t p_truncategenpr;
111
	bool_t p_truncategenpr;
115
		/* truncate inode generation number (for compatibility
112
		/* truncate inode generation number (for compatibility
116
		 * with xfsdump format 2 and earlier)
113
		 * with xfsdump format 2 and earlier)
Lines 348-354 tree_init(char *hkdir, Link Here
348
	   size64_t nondircnt,
345
	   size64_t nondircnt,
349
	   size64_t vmsz,
346
	   size64_t vmsz,
350
	   bool_t fullpr,
347
	   bool_t fullpr,
351
	   bool_t restoredmpr,
352
	   bool_t dstdirisxfspr,
348
	   bool_t dstdirisxfspr,
353
	   uint32_t dumpformat,
349
	   uint32_t dumpformat,
354
	   bool_t truncategenpr)
350
	   bool_t truncategenpr)
Lines 508-517 tree_init(char *hkdir, Link Here
508
	 */
504
	 */
509
	persp->p_fullpr = fullpr;
505
	persp->p_fullpr = fullpr;
510
506
511
	/* record if DMI event settings should be restored
512
	 */
513
	persp->p_restoredmpr = restoredmpr;
514
515
	/* record if truncated generation numbers are required
507
	/* record if truncated generation numbers are required
516
	 */
508
	 */
517
	if (dumpformat < GLOBAL_HDR_VERSION_3) {
509
	if (dumpformat < GLOBAL_HDR_VERSION_3) {
Lines 2550-2580 setdirattr(dah_t dah, char *path) Link Here
2550
		}
2542
		}
2551
	}
2543
	}
2552
2544
2553
	if (tranp->t_dstdirisxfspr && persp->p_restoredmpr) {
2554
		fsdmidata_t fssetdm;
2555
2556
		fssetdm.fsd_dmevmask = dirattr_get_dmevmask(dah);
2557
		fssetdm.fsd_padding = 0;	/* not used */
2558
		fssetdm.fsd_dmstate = (uint16_t)dirattr_get_dmstate(dah);
2559
2560
		/* restore DMAPI event settings etc.
2561
		 */
2562
		rval = ioctl(fd,
2563
			      XFS_IOC_FSSETDM,
2564
			      (void *)&fssetdm);
2565
		if (rval) {
2566
			mlog(errno == EINVAL
2567
			      ?
2568
			      (MLOG_NITTY + 1) | MLOG_TREE
2569
			      :
2570
			      MLOG_NITTY | MLOG_TREE,
2571
			      "set DMI attributes"
2572
			      " of %s failed: %s\n",
2573
			      path,
2574
			      strerror(errno));
2575
		}
2576
	}
2577
2578
	utimbuf.actime = dirattr_get_atime(dah);
2545
	utimbuf.actime = dirattr_get_atime(dah);
2579
	utimbuf.modtime = dirattr_get_mtime(dah);
2546
	utimbuf.modtime = dirattr_get_mtime(dah);
2580
	rval = utime(path, &utimbuf);
2547
	rval = utime(path, &utimbuf);
(-)a/restore/tree.h (-1 lines)
Lines 31-37 extern bool_t tree_init(char *hkdir, Link Here
31
			 size64_t nondircnt,
31
			 size64_t nondircnt,
32
			 size64_t vmsz,
32
			 size64_t vmsz,
33
			 bool_t fullpr,
33
			 bool_t fullpr,
34
			 bool_t restoredmpr,
35
			 bool_t dstdirisxfspr,
34
			 bool_t dstdirisxfspr,
36
			 uint32_t dumpformat,
35
			 uint32_t dumpformat,
37
			 bool_t truncategenpr);
36
			 bool_t truncategenpr);

Return to bug 852269