xfs_restore.patch 9.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338
  1. From: Darrick J. Wong <djwong@xxxxxxxxxx>
  2. The last of the DMAPI stubs were removed from Linux 5.17, so drop this
  3. functionality altogether.
  4. Signed-off-by: Darrick J. Wong <djwong@xxxxxxxxxx>
  5. ---
  6. doc/xfsdump.html | 1 -
  7. po/de.po | 5 ---
  8. po/pl.po | 5 ---
  9. restore/content.c | 99 +++--------------------------------------------------
  10. restore/tree.c | 33 ------------------
  11. restore/tree.h | 1 -
  12. 6 files changed, 6 insertions(+), 138 deletions(-)
  13. diff --git a/doc/xfsdump.html b/doc/xfsdump.html
  14. index d4d157f..2c9324b 100644
  15. --- a/doc/xfsdump.html
  16. +++ b/doc/xfsdump.html
  17. @@ -1092,7 +1092,6 @@ the size of the hash table.
  18. bool_t p_ownerpr - whether to restore directory owner/group attributes
  19. bool_t p_fullpr - whether restoring a full level 0 non-resumed dump
  20. bool_t p_ignoreorphpr - set if positive subtree or interactive
  21. - bool_t p_restoredmpr - restore DMI event settings
  22. </pre>
  23. <p>
  24. The hash table maps the inode number to the tree node. It is a
  25. diff --git a/po/de.po b/po/de.po
  26. index 62face8..bdf47d1 100644
  27. --- a/po/de.po
  28. +++ b/po/de.po
  29. @@ -3972,11 +3972,6 @@ msgstr ""
  30. msgid "no additional media objects needed\n"
  31. msgstr "keine zusätzlichen Mediendateien benötigt\n"
  32. -#: .././restore/content.c:9547
  33. -#, c-format
  34. -msgid "fssetdm_by_handle of %s failed %s\n"
  35. -msgstr "fssetdm_by_handle von %s fehlgeschlagen %s\n"
  36. -
  37. #: .././restore/content.c:9566
  38. #, c-format
  39. msgid "%s quota information written to '%s'\n"
  40. diff --git a/po/pl.po b/po/pl.po
  41. index 3cba8d6..ba25420 100644
  42. --- a/po/pl.po
  43. +++ b/po/pl.po
  44. @@ -3455,11 +3455,6 @@ msgstr "nie są potrzebne dodatkowe obiekty nośnika\n"
  45. msgid "path_to_handle of %s failed:%s\n"
  46. msgstr "path_to_handle na %s nie powiodło się: %s\n"
  47. -#: .././restore/content.c:9723
  48. -#, c-format
  49. -msgid "fssetdm_by_handle of %s failed %s\n"
  50. -msgstr "fssetdm_by_handle na %s nie powiodło się: %s\n"
  51. -
  52. #: .././restore/content.c:9742
  53. #, c-format
  54. msgid "%s quota information written to '%s'\n"
  55. diff --git a/restore/content.c b/restore/content.c
  56. index 6b22965..e9b0a07 100644
  57. --- a/restore/content.c
  58. +++ b/restore/content.c
  59. @@ -477,9 +477,6 @@ struct pers {
  60. /* how many pages following the header page are reserved
  61. * for the subtree descriptors
  62. */
  63. - bool_t restoredmpr;
  64. - /* restore DMAPI event settings
  65. - */
  66. bool_t restoreextattrpr;
  67. /* restore extended attributes
  68. */
  69. @@ -858,7 +855,6 @@ static void partial_reg(ix_t d_index, xfs_ino_t ino, off64_t fsize,
  70. off64_t offset, off64_t sz);
  71. static bool_t partial_check (xfs_ino_t ino, off64_t fsize);
  72. static bool_t partial_check2 (partial_rest_t *isptr, off64_t fsize);
  73. -static int do_fssetdm_by_handle(char *path, fsdmidata_t *fdmp);
  74. static int quotafilecheck(char *type, char *dstdir, char *quotafile);
  75. /* definition of locally defined global variables ****************************/
  76. @@ -894,7 +890,6 @@ content_init(int argc, char *argv[], size64_t vmsz)
  77. bool_t changepr;/* cmd line overwrite inhibit specification */
  78. bool_t interpr; /* cmd line interactive mode requested */
  79. bool_t ownerpr; /* cmd line chown/chmod requested */
  80. - bool_t restoredmpr; /* cmd line restore dm api attrs specification */
  81. bool_t restoreextattrpr; /* cmd line restore extended attr spec */
  82. bool_t sesscpltpr; /* force completion of prev interrupted session */
  83. ix_t stcnt; /* cmd line number of subtrees requested */
  84. @@ -956,7 +951,6 @@ content_init(int argc, char *argv[], size64_t vmsz)
  85. newerpr = BOOL_FALSE;
  86. changepr = BOOL_FALSE;
  87. ownerpr = BOOL_FALSE;
  88. - restoredmpr = BOOL_FALSE;
  89. restoreextattrpr = BOOL_TRUE;
  90. sesscpltpr = BOOL_FALSE;
  91. stcnt = 0;
  92. @@ -1162,8 +1156,11 @@ content_init(int argc, char *argv[], size64_t vmsz)
  93. tranp->t_noinvupdatepr = BOOL_TRUE;
  94. break;
  95. case GETOPT_SETDM:
  96. - restoredmpr = BOOL_TRUE;
  97. - break;
  98. + mlog(MLOG_NORMAL | MLOG_ERROR, _(
  99. + "-%c option no longer supported\n"),
  100. + GETOPT_SETDM);
  101. + usage();
  102. + return BOOL_FALSE;
  103. case GETOPT_ALERTPROG:
  104. if (!optarg || optarg[0] == '-') {
  105. mlog(MLOG_NORMAL | MLOG_ERROR, _(
  106. @@ -1574,12 +1571,6 @@ content_init(int argc, char *argv[], size64_t vmsz)
  107. }
  108. if (persp->a.valpr) {
  109. - if (restoredmpr && persp->a.restoredmpr != restoredmpr) {
  110. - mlog(MLOG_NORMAL | MLOG_ERROR, _(
  111. - "-%c cannot reset flag from previous restore\n"),
  112. - GETOPT_SETDM);
  113. - return BOOL_FALSE;
  114. - }
  115. if (!restoreextattrpr &&
  116. persp->a.restoreextattrpr != restoreextattrpr) {
  117. mlog(MLOG_NORMAL | MLOG_ERROR, _(
  118. @@ -1734,7 +1725,6 @@ content_init(int argc, char *argv[], size64_t vmsz)
  119. persp->a.newerpr = newerpr;
  120. persp->a.newertime = newertime;
  121. }
  122. - persp->a.restoredmpr = restoredmpr;
  123. if (!persp->a.dstdirisxfspr) {
  124. restoreextattrpr = BOOL_FALSE;
  125. }
  126. @@ -2365,7 +2355,6 @@ content_stream_restore(ix_t thrdix)
  127. scrhdrp->cih_inomap_nondircnt,
  128. tranp->t_vmsz,
  129. fullpr,
  130. - persp->a.restoredmpr,
  131. persp->a.dstdirisxfspr,
  132. grhdrp->gh_version,
  133. tranp->t_truncategenpr);
  134. @@ -7549,12 +7538,6 @@ restore_reg(drive_t *drivep,
  135. }
  136. }
  137. - if (persp->a.dstdirisxfspr && persp->a.restoredmpr) {
  138. - HsmBeginRestoreFile(bstatp,
  139. - *fdp,
  140. - &strctxp->sc_hsmflags);
  141. - }
  142. -
  143. return BOOL_TRUE;
  144. }
  145. @@ -7726,26 +7709,6 @@ restore_complete_reg(stream_context_t *strcxtp)
  146. strerror(errno));
  147. }
  148. - if (persp->a.dstdirisxfspr && persp->a.restoredmpr) {
  149. - fsdmidata_t fssetdm;
  150. -
  151. - /* Set the DMAPI Fields. */
  152. - fssetdm.fsd_dmevmask = bstatp->bs_dmevmask;
  153. - fssetdm.fsd_padding = 0;
  154. - fssetdm.fsd_dmstate = bstatp->bs_dmstate;
  155. -
  156. - rval = ioctl(fd, XFS_IOC_FSSETDM, (void *)&fssetdm);
  157. - if (rval) {
  158. - mlog(MLOG_NORMAL | MLOG_WARNING,
  159. - _("attempt to set DMI attributes of %s "
  160. - "failed: %s\n"),
  161. - path,
  162. - strerror(errno));
  163. - }
  164. -
  165. - HsmEndRestoreFile(path, fd, &strcxtp->sc_hsmflags);
  166. - }
  167. -
  168. /* set any extended inode flags that couldn't be set
  169. * prior to restoring the data.
  170. */
  171. @@ -8064,17 +8027,6 @@ restore_symlink(drive_t *drivep,
  172. strerror(errno));
  173. }
  174. }
  175. -
  176. - if (persp->a.restoredmpr) {
  177. - fsdmidata_t fssetdm;
  178. -
  179. - /* Restore DMAPI fields. */
  180. -
  181. - fssetdm.fsd_dmevmask = bstatp->bs_dmevmask;
  182. - fssetdm.fsd_padding = 0;
  183. - fssetdm.fsd_dmstate = bstatp->bs_dmstate;
  184. - rval = do_fssetdm_by_handle(path, &fssetdm);
  185. - }
  186. }
  187. return BOOL_TRUE;
  188. @@ -8777,7 +8729,7 @@ restore_extattr(drive_t *drivep,
  189. }
  190. assert(nread == (int)(recsz - EXTATTRHDR_SZ));
  191. - if (!persp->a.restoreextattrpr && !persp->a.restoredmpr) {
  192. + if (!persp->a.restoreextattrpr) {
  193. continue;
  194. }
  195. @@ -8796,19 +8748,6 @@ restore_extattr(drive_t *drivep,
  196. }
  197. } else if (isfilerestored && path[0] != '\0') {
  198. setextattr(path, ahdrp);
  199. -
  200. - if (persp->a.dstdirisxfspr && persp->a.restoredmpr) {
  201. - int flag = 0;
  202. - char *attrname = (char *)&ahdrp[1];
  203. - if (ahdrp->ah_flags & EXTATTRHDR_FLAGS_ROOT)
  204. - flag = ATTR_ROOT;
  205. - else if (ahdrp->ah_flags & EXTATTRHDR_FLAGS_SECURE)
  206. - flag = ATTR_SECURE;
  207. -
  208. - HsmRestoreAttribute(flag,
  209. - attrname,
  210. - &strctxp->sc_hsmflags);
  211. - }
  212. }
  213. }
  214. /* NOTREACHED */
  215. @@ -9709,32 +9648,6 @@ display_needed_objects(purp_t purp,
  216. }
  217. }
  218. -static int
  219. -do_fssetdm_by_handle(
  220. - char *path,
  221. - fsdmidata_t *fdmp)
  222. -{
  223. - void *hanp;
  224. - size_t hlen=0;
  225. - int rc;
  226. -
  227. - if (path_to_handle(path, &hanp, &hlen)) {
  228. - mlog(MLOG_NORMAL | MLOG_WARNING, _(
  229. - "path_to_handle of %s failed:%s\n"),
  230. - path, strerror(errno));
  231. - return -1;
  232. - }
  233. -
  234. - rc = fssetdm_by_handle(hanp, hlen, fdmp);
  235. - free_handle(hanp, hlen);
  236. - if (rc) {
  237. - mlog(MLOG_NORMAL | MLOG_WARNING, _(
  238. - "fssetdm_by_handle of %s failed %s\n"),
  239. - path, strerror(errno));
  240. - }
  241. - return rc;
  242. -}
  243. -
  244. static int
  245. quotafilecheck(char *type, char *dstdir, char *quotafile)
  246. {
  247. diff --git a/restore/tree.c b/restore/tree.c
  248. index 0670318..5429b74 100644
  249. --- a/restore/tree.c
  250. +++ b/restore/tree.c
  251. @@ -108,9 +108,6 @@ struct treePersStorage {
  252. bool_t p_ignoreorphpr;
  253. /* set if positive subtree or interactive
  254. */
  255. - bool_t p_restoredmpr;
  256. - /* restore DMI event settings
  257. - */
  258. bool_t p_truncategenpr;
  259. /* truncate inode generation number (for compatibility
  260. * with xfsdump format 2 and earlier)
  261. @@ -348,7 +345,6 @@ tree_init(char *hkdir,
  262. size64_t nondircnt,
  263. size64_t vmsz,
  264. bool_t fullpr,
  265. - bool_t restoredmpr,
  266. bool_t dstdirisxfspr,
  267. uint32_t dumpformat,
  268. bool_t truncategenpr)
  269. @@ -508,10 +504,6 @@ tree_init(char *hkdir,
  270. */
  271. persp->p_fullpr = fullpr;
  272. - /* record if DMI event settings should be restored
  273. - */
  274. - persp->p_restoredmpr = restoredmpr;
  275. -
  276. /* record if truncated generation numbers are required
  277. */
  278. if (dumpformat < GLOBAL_HDR_VERSION_3) {
  279. @@ -2550,31 +2542,6 @@ setdirattr(dah_t dah, char *path)
  280. }
  281. }
  282. - if (tranp->t_dstdirisxfspr && persp->p_restoredmpr) {
  283. - fsdmidata_t fssetdm;
  284. -
  285. - fssetdm.fsd_dmevmask = dirattr_get_dmevmask(dah);
  286. - fssetdm.fsd_padding = 0; /* not used */
  287. - fssetdm.fsd_dmstate = (uint16_t)dirattr_get_dmstate(dah);
  288. -
  289. - /* restore DMAPI event settings etc.
  290. - */
  291. - rval = ioctl(fd,
  292. - XFS_IOC_FSSETDM,
  293. - (void *)&fssetdm);
  294. - if (rval) {
  295. - mlog(errno == EINVAL
  296. - ?
  297. - (MLOG_NITTY + 1) | MLOG_TREE
  298. - :
  299. - MLOG_NITTY | MLOG_TREE,
  300. - "set DMI attributes"
  301. - " of %s failed: %s\n",
  302. - path,
  303. - strerror(errno));
  304. - }
  305. - }
  306. -
  307. utimbuf.actime = dirattr_get_atime(dah);
  308. utimbuf.modtime = dirattr_get_mtime(dah);
  309. rval = utime(path, &utimbuf);
  310. diff --git a/restore/tree.h b/restore/tree.h
  311. index 4f9ffe8..bf66e3d 100644
  312. --- a/restore/tree.h
  313. +++ b/restore/tree.h
  314. @@ -31,7 +31,6 @@ extern bool_t tree_init(char *hkdir,
  315. size64_t nondircnt,
  316. size64_t vmsz,
  317. bool_t fullpr,
  318. - bool_t restoredmpr,
  319. bool_t dstdirisxfspr,
  320. uint32_t dumpformat,
  321. bool_t truncategenpr);