xfs_rename.c 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635
  1. /*
  2. * Copyright (c) 2000-2003,2005 Silicon Graphics, Inc.
  3. * All Rights Reserved.
  4. *
  5. * This program is free software; you can redistribute it and/or
  6. * modify it under the terms of the GNU General Public License as
  7. * published by the Free Software Foundation.
  8. *
  9. * This program is distributed in the hope that it would be useful,
  10. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  11. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  12. * GNU General Public License for more details.
  13. *
  14. * You should have received a copy of the GNU General Public License
  15. * along with this program; if not, write the Free Software Foundation,
  16. * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  17. */
  18. #include "xfs.h"
  19. #include "xfs_fs.h"
  20. #include "xfs_types.h"
  21. #include "xfs_log.h"
  22. #include "xfs_inum.h"
  23. #include "xfs_trans.h"
  24. #include "xfs_sb.h"
  25. #include "xfs_dir.h"
  26. #include "xfs_dir2.h"
  27. #include "xfs_dmapi.h"
  28. #include "xfs_mount.h"
  29. #include "xfs_da_btree.h"
  30. #include "xfs_bmap_btree.h"
  31. #include "xfs_dir_sf.h"
  32. #include "xfs_dir2_sf.h"
  33. #include "xfs_attr_sf.h"
  34. #include "xfs_dinode.h"
  35. #include "xfs_inode.h"
  36. #include "xfs_inode_item.h"
  37. #include "xfs_bmap.h"
  38. #include "xfs_error.h"
  39. #include "xfs_quota.h"
  40. #include "xfs_refcache.h"
  41. #include "xfs_utils.h"
  42. #include "xfs_trans_space.h"
  43. #include "xfs_dir_leaf.h"
  44. /*
  45. * Given an array of up to 4 inode pointers, unlock the pointed to inodes.
  46. * If there are fewer than 4 entries in the array, the empty entries will
  47. * be at the end and will have NULL pointers in them.
  48. */
  49. STATIC void
  50. xfs_rename_unlock4(
  51. xfs_inode_t **i_tab,
  52. uint lock_mode)
  53. {
  54. int i;
  55. xfs_iunlock(i_tab[0], lock_mode);
  56. for (i = 1; i < 4; i++) {
  57. if (i_tab[i] == NULL) {
  58. break;
  59. }
  60. /*
  61. * Watch out for duplicate entries in the table.
  62. */
  63. if (i_tab[i] != i_tab[i-1]) {
  64. xfs_iunlock(i_tab[i], lock_mode);
  65. }
  66. }
  67. }
  68. #ifdef DEBUG
  69. int xfs_rename_skip, xfs_rename_nskip;
  70. #endif
  71. /*
  72. * The following routine will acquire the locks required for a rename
  73. * operation. The code understands the semantics of renames and will
  74. * validate that name1 exists under dp1 & that name2 may or may not
  75. * exist under dp2.
  76. *
  77. * We are renaming dp1/name1 to dp2/name2.
  78. *
  79. * Return ENOENT if dp1 does not exist, other lookup errors, or 0 for success.
  80. */
  81. STATIC int
  82. xfs_lock_for_rename(
  83. xfs_inode_t *dp1, /* old (source) directory inode */
  84. xfs_inode_t *dp2, /* new (target) directory inode */
  85. vname_t *vname1,/* old entry name */
  86. vname_t *vname2,/* new entry name */
  87. xfs_inode_t **ipp1, /* inode of old entry */
  88. xfs_inode_t **ipp2, /* inode of new entry, if it
  89. already exists, NULL otherwise. */
  90. xfs_inode_t **i_tab,/* array of inode returned, sorted */
  91. int *num_inodes) /* number of inodes in array */
  92. {
  93. xfs_inode_t *ip1, *ip2, *temp;
  94. xfs_ino_t inum1, inum2;
  95. int error;
  96. int i, j;
  97. uint lock_mode;
  98. int diff_dirs = (dp1 != dp2);
  99. ip2 = NULL;
  100. /*
  101. * First, find out the current inums of the entries so that we
  102. * can determine the initial locking order. We'll have to
  103. * sanity check stuff after all the locks have been acquired
  104. * to see if we still have the right inodes, directories, etc.
  105. */
  106. lock_mode = xfs_ilock_map_shared(dp1);
  107. error = xfs_get_dir_entry(vname1, &ip1);
  108. if (error) {
  109. xfs_iunlock_map_shared(dp1, lock_mode);
  110. return error;
  111. }
  112. inum1 = ip1->i_ino;
  113. ASSERT(ip1);
  114. ITRACE(ip1);
  115. /*
  116. * Unlock dp1 and lock dp2 if they are different.
  117. */
  118. if (diff_dirs) {
  119. xfs_iunlock_map_shared(dp1, lock_mode);
  120. lock_mode = xfs_ilock_map_shared(dp2);
  121. }
  122. error = xfs_dir_lookup_int(XFS_ITOBHV(dp2), lock_mode,
  123. vname2, &inum2, &ip2);
  124. if (error == ENOENT) { /* target does not need to exist. */
  125. inum2 = 0;
  126. } else if (error) {
  127. /*
  128. * If dp2 and dp1 are the same, the next line unlocks dp1.
  129. * Got it?
  130. */
  131. xfs_iunlock_map_shared(dp2, lock_mode);
  132. IRELE (ip1);
  133. return error;
  134. } else {
  135. ITRACE(ip2);
  136. }
  137. /*
  138. * i_tab contains a list of pointers to inodes. We initialize
  139. * the table here & we'll sort it. We will then use it to
  140. * order the acquisition of the inode locks.
  141. *
  142. * Note that the table may contain duplicates. e.g., dp1 == dp2.
  143. */
  144. i_tab[0] = dp1;
  145. i_tab[1] = dp2;
  146. i_tab[2] = ip1;
  147. if (inum2 == 0) {
  148. *num_inodes = 3;
  149. i_tab[3] = NULL;
  150. } else {
  151. *num_inodes = 4;
  152. i_tab[3] = ip2;
  153. }
  154. /*
  155. * Sort the elements via bubble sort. (Remember, there are at
  156. * most 4 elements to sort, so this is adequate.)
  157. */
  158. for (i=0; i < *num_inodes; i++) {
  159. for (j=1; j < *num_inodes; j++) {
  160. if (i_tab[j]->i_ino < i_tab[j-1]->i_ino) {
  161. temp = i_tab[j];
  162. i_tab[j] = i_tab[j-1];
  163. i_tab[j-1] = temp;
  164. }
  165. }
  166. }
  167. /*
  168. * We have dp2 locked. If it isn't first, unlock it.
  169. * If it is first, tell xfs_lock_inodes so it can skip it
  170. * when locking. if dp1 == dp2, xfs_lock_inodes will skip both
  171. * since they are equal. xfs_lock_inodes needs all these inodes
  172. * so that it can unlock and retry if there might be a dead-lock
  173. * potential with the log.
  174. */
  175. if (i_tab[0] == dp2 && lock_mode == XFS_ILOCK_SHARED) {
  176. #ifdef DEBUG
  177. xfs_rename_skip++;
  178. #endif
  179. xfs_lock_inodes(i_tab, *num_inodes, 1, XFS_ILOCK_SHARED);
  180. } else {
  181. #ifdef DEBUG
  182. xfs_rename_nskip++;
  183. #endif
  184. xfs_iunlock_map_shared(dp2, lock_mode);
  185. xfs_lock_inodes(i_tab, *num_inodes, 0, XFS_ILOCK_SHARED);
  186. }
  187. /*
  188. * Set the return value. Null out any unused entries in i_tab.
  189. */
  190. *ipp1 = *ipp2 = NULL;
  191. for (i=0; i < *num_inodes; i++) {
  192. if (i_tab[i]->i_ino == inum1) {
  193. *ipp1 = i_tab[i];
  194. }
  195. if (i_tab[i]->i_ino == inum2) {
  196. *ipp2 = i_tab[i];
  197. }
  198. }
  199. for (;i < 4; i++) {
  200. i_tab[i] = NULL;
  201. }
  202. return 0;
  203. }
  204. /*
  205. * xfs_rename
  206. */
  207. int
  208. xfs_rename(
  209. bhv_desc_t *src_dir_bdp,
  210. vname_t *src_vname,
  211. vnode_t *target_dir_vp,
  212. vname_t *target_vname,
  213. cred_t *credp)
  214. {
  215. xfs_trans_t *tp;
  216. xfs_inode_t *src_dp, *target_dp, *src_ip, *target_ip;
  217. xfs_mount_t *mp;
  218. int new_parent; /* moving to a new dir */
  219. int src_is_directory; /* src_name is a directory */
  220. int error;
  221. xfs_bmap_free_t free_list;
  222. xfs_fsblock_t first_block;
  223. int cancel_flags;
  224. int committed;
  225. xfs_inode_t *inodes[4];
  226. int target_ip_dropped = 0; /* dropped target_ip link? */
  227. vnode_t *src_dir_vp;
  228. int spaceres;
  229. int target_link_zero = 0;
  230. int num_inodes;
  231. char *src_name = VNAME(src_vname);
  232. char *target_name = VNAME(target_vname);
  233. int src_namelen = VNAMELEN(src_vname);
  234. int target_namelen = VNAMELEN(target_vname);
  235. src_dir_vp = BHV_TO_VNODE(src_dir_bdp);
  236. vn_trace_entry(src_dir_vp, "xfs_rename", (inst_t *)__return_address);
  237. vn_trace_entry(target_dir_vp, "xfs_rename", (inst_t *)__return_address);
  238. /*
  239. * Find the XFS behavior descriptor for the target directory
  240. * vnode since it was not handed to us.
  241. */
  242. target_dp = xfs_vtoi(target_dir_vp);
  243. if (target_dp == NULL) {
  244. return XFS_ERROR(EXDEV);
  245. }
  246. src_dp = XFS_BHVTOI(src_dir_bdp);
  247. mp = src_dp->i_mount;
  248. if (DM_EVENT_ENABLED(src_dir_vp->v_vfsp, src_dp, DM_EVENT_RENAME) ||
  249. DM_EVENT_ENABLED(target_dir_vp->v_vfsp,
  250. target_dp, DM_EVENT_RENAME)) {
  251. error = XFS_SEND_NAMESP(mp, DM_EVENT_RENAME,
  252. src_dir_vp, DM_RIGHT_NULL,
  253. target_dir_vp, DM_RIGHT_NULL,
  254. src_name, target_name,
  255. 0, 0, 0);
  256. if (error) {
  257. return error;
  258. }
  259. }
  260. /* Return through std_return after this point. */
  261. /*
  262. * Lock all the participating inodes. Depending upon whether
  263. * the target_name exists in the target directory, and
  264. * whether the target directory is the same as the source
  265. * directory, we can lock from 2 to 4 inodes.
  266. * xfs_lock_for_rename() will return ENOENT if src_name
  267. * does not exist in the source directory.
  268. */
  269. tp = NULL;
  270. error = xfs_lock_for_rename(src_dp, target_dp, src_vname,
  271. target_vname, &src_ip, &target_ip, inodes,
  272. &num_inodes);
  273. if (error) {
  274. /*
  275. * We have nothing locked, no inode references, and
  276. * no transaction, so just get out.
  277. */
  278. goto std_return;
  279. }
  280. ASSERT(src_ip != NULL);
  281. if ((src_ip->i_d.di_mode & S_IFMT) == S_IFDIR) {
  282. /*
  283. * Check for link count overflow on target_dp
  284. */
  285. if (target_ip == NULL && (src_dp != target_dp) &&
  286. target_dp->i_d.di_nlink >= XFS_MAXLINK) {
  287. error = XFS_ERROR(EMLINK);
  288. xfs_rename_unlock4(inodes, XFS_ILOCK_SHARED);
  289. goto rele_return;
  290. }
  291. }
  292. new_parent = (src_dp != target_dp);
  293. src_is_directory = ((src_ip->i_d.di_mode & S_IFMT) == S_IFDIR);
  294. /*
  295. * Drop the locks on our inodes so that we can start the transaction.
  296. */
  297. xfs_rename_unlock4(inodes, XFS_ILOCK_SHARED);
  298. XFS_BMAP_INIT(&free_list, &first_block);
  299. tp = xfs_trans_alloc(mp, XFS_TRANS_RENAME);
  300. cancel_flags = XFS_TRANS_RELEASE_LOG_RES;
  301. spaceres = XFS_RENAME_SPACE_RES(mp, target_namelen);
  302. error = xfs_trans_reserve(tp, spaceres, XFS_RENAME_LOG_RES(mp), 0,
  303. XFS_TRANS_PERM_LOG_RES, XFS_RENAME_LOG_COUNT);
  304. if (error == ENOSPC) {
  305. spaceres = 0;
  306. error = xfs_trans_reserve(tp, 0, XFS_RENAME_LOG_RES(mp), 0,
  307. XFS_TRANS_PERM_LOG_RES, XFS_RENAME_LOG_COUNT);
  308. }
  309. if (error) {
  310. xfs_trans_cancel(tp, 0);
  311. goto rele_return;
  312. }
  313. /*
  314. * Attach the dquots to the inodes
  315. */
  316. if ((error = XFS_QM_DQVOPRENAME(mp, inodes))) {
  317. xfs_trans_cancel(tp, cancel_flags);
  318. goto rele_return;
  319. }
  320. /*
  321. * Reacquire the inode locks we dropped above.
  322. */
  323. xfs_lock_inodes(inodes, num_inodes, 0, XFS_ILOCK_EXCL);
  324. /*
  325. * Join all the inodes to the transaction. From this point on,
  326. * we can rely on either trans_commit or trans_cancel to unlock
  327. * them. Note that we need to add a vnode reference to the
  328. * directories since trans_commit & trans_cancel will decrement
  329. * them when they unlock the inodes. Also, we need to be careful
  330. * not to add an inode to the transaction more than once.
  331. */
  332. VN_HOLD(src_dir_vp);
  333. xfs_trans_ijoin(tp, src_dp, XFS_ILOCK_EXCL);
  334. if (new_parent) {
  335. VN_HOLD(target_dir_vp);
  336. xfs_trans_ijoin(tp, target_dp, XFS_ILOCK_EXCL);
  337. }
  338. if ((src_ip != src_dp) && (src_ip != target_dp)) {
  339. xfs_trans_ijoin(tp, src_ip, XFS_ILOCK_EXCL);
  340. }
  341. if ((target_ip != NULL) &&
  342. (target_ip != src_ip) &&
  343. (target_ip != src_dp) &&
  344. (target_ip != target_dp)) {
  345. xfs_trans_ijoin(tp, target_ip, XFS_ILOCK_EXCL);
  346. }
  347. /*
  348. * Set up the target.
  349. */
  350. if (target_ip == NULL) {
  351. /*
  352. * If there's no space reservation, check the entry will
  353. * fit before actually inserting it.
  354. */
  355. if (spaceres == 0 &&
  356. (error = XFS_DIR_CANENTER(mp, tp, target_dp, target_name,
  357. target_namelen))) {
  358. goto error_return;
  359. }
  360. /*
  361. * If target does not exist and the rename crosses
  362. * directories, adjust the target directory link count
  363. * to account for the ".." reference from the new entry.
  364. */
  365. error = XFS_DIR_CREATENAME(mp, tp, target_dp, target_name,
  366. target_namelen, src_ip->i_ino,
  367. &first_block, &free_list, spaceres);
  368. if (error == ENOSPC) {
  369. goto error_return;
  370. }
  371. if (error) {
  372. goto abort_return;
  373. }
  374. xfs_ichgtime(target_dp, XFS_ICHGTIME_MOD | XFS_ICHGTIME_CHG);
  375. if (new_parent && src_is_directory) {
  376. error = xfs_bumplink(tp, target_dp);
  377. if (error) {
  378. goto abort_return;
  379. }
  380. }
  381. } else { /* target_ip != NULL */
  382. /*
  383. * If target exists and it's a directory, check that both
  384. * target and source are directories and that target can be
  385. * destroyed, or that neither is a directory.
  386. */
  387. if ((target_ip->i_d.di_mode & S_IFMT) == S_IFDIR) {
  388. /*
  389. * Make sure target dir is empty.
  390. */
  391. if (!(XFS_DIR_ISEMPTY(target_ip->i_mount, target_ip)) ||
  392. (target_ip->i_d.di_nlink > 2)) {
  393. error = XFS_ERROR(EEXIST);
  394. goto error_return;
  395. }
  396. }
  397. /*
  398. * Link the source inode under the target name.
  399. * If the source inode is a directory and we are moving
  400. * it across directories, its ".." entry will be
  401. * inconsistent until we replace that down below.
  402. *
  403. * In case there is already an entry with the same
  404. * name at the destination directory, remove it first.
  405. */
  406. error = XFS_DIR_REPLACE(mp, tp, target_dp, target_name,
  407. target_namelen, src_ip->i_ino, &first_block,
  408. &free_list, spaceres);
  409. if (error) {
  410. goto abort_return;
  411. }
  412. xfs_ichgtime(target_dp, XFS_ICHGTIME_MOD | XFS_ICHGTIME_CHG);
  413. /*
  414. * Decrement the link count on the target since the target
  415. * dir no longer points to it.
  416. */
  417. error = xfs_droplink(tp, target_ip);
  418. if (error) {
  419. goto abort_return;
  420. }
  421. target_ip_dropped = 1;
  422. if (src_is_directory) {
  423. /*
  424. * Drop the link from the old "." entry.
  425. */
  426. error = xfs_droplink(tp, target_ip);
  427. if (error) {
  428. goto abort_return;
  429. }
  430. }
  431. /* Do this test while we still hold the locks */
  432. target_link_zero = (target_ip)->i_d.di_nlink==0;
  433. } /* target_ip != NULL */
  434. /*
  435. * Remove the source.
  436. */
  437. if (new_parent && src_is_directory) {
  438. /*
  439. * Rewrite the ".." entry to point to the new
  440. * directory.
  441. */
  442. error = XFS_DIR_REPLACE(mp, tp, src_ip, "..", 2,
  443. target_dp->i_ino, &first_block,
  444. &free_list, spaceres);
  445. ASSERT(error != EEXIST);
  446. if (error) {
  447. goto abort_return;
  448. }
  449. xfs_ichgtime(src_ip, XFS_ICHGTIME_MOD | XFS_ICHGTIME_CHG);
  450. } else {
  451. /*
  452. * We always want to hit the ctime on the source inode.
  453. * We do it in the if clause above for the 'new_parent &&
  454. * src_is_directory' case, and here we get all the other
  455. * cases. This isn't strictly required by the standards
  456. * since the source inode isn't really being changed,
  457. * but old unix file systems did it and some incremental
  458. * backup programs won't work without it.
  459. */
  460. xfs_ichgtime(src_ip, XFS_ICHGTIME_CHG);
  461. }
  462. /*
  463. * Adjust the link count on src_dp. This is necessary when
  464. * renaming a directory, either within one parent when
  465. * the target existed, or across two parent directories.
  466. */
  467. if (src_is_directory && (new_parent || target_ip != NULL)) {
  468. /*
  469. * Decrement link count on src_directory since the
  470. * entry that's moved no longer points to it.
  471. */
  472. error = xfs_droplink(tp, src_dp);
  473. if (error) {
  474. goto abort_return;
  475. }
  476. }
  477. error = XFS_DIR_REMOVENAME(mp, tp, src_dp, src_name, src_namelen,
  478. src_ip->i_ino, &first_block, &free_list, spaceres);
  479. if (error) {
  480. goto abort_return;
  481. }
  482. xfs_ichgtime(src_dp, XFS_ICHGTIME_MOD | XFS_ICHGTIME_CHG);
  483. /*
  484. * Update the generation counts on all the directory inodes
  485. * that we're modifying.
  486. */
  487. src_dp->i_gen++;
  488. xfs_trans_log_inode(tp, src_dp, XFS_ILOG_CORE);
  489. if (new_parent) {
  490. target_dp->i_gen++;
  491. xfs_trans_log_inode(tp, target_dp, XFS_ILOG_CORE);
  492. }
  493. /*
  494. * If there was a target inode, take an extra reference on
  495. * it here so that it doesn't go to xfs_inactive() from
  496. * within the commit.
  497. */
  498. if (target_ip != NULL) {
  499. IHOLD(target_ip);
  500. }
  501. /*
  502. * If this is a synchronous mount, make sure that the
  503. * rename transaction goes to disk before returning to
  504. * the user.
  505. */
  506. if (mp->m_flags & (XFS_MOUNT_WSYNC|XFS_MOUNT_DIRSYNC)) {
  507. xfs_trans_set_sync(tp);
  508. }
  509. /*
  510. * Take refs. for vop_link_removed calls below. No need to worry
  511. * about directory refs. because the caller holds them.
  512. *
  513. * Do holds before the xfs_bmap_finish since it might rele them down
  514. * to zero.
  515. */
  516. if (target_ip_dropped)
  517. IHOLD(target_ip);
  518. IHOLD(src_ip);
  519. error = xfs_bmap_finish(&tp, &free_list, first_block, &committed);
  520. if (error) {
  521. xfs_bmap_cancel(&free_list);
  522. xfs_trans_cancel(tp, (XFS_TRANS_RELEASE_LOG_RES |
  523. XFS_TRANS_ABORT));
  524. if (target_ip != NULL) {
  525. IRELE(target_ip);
  526. }
  527. if (target_ip_dropped) {
  528. IRELE(target_ip);
  529. }
  530. IRELE(src_ip);
  531. goto std_return;
  532. }
  533. /*
  534. * trans_commit will unlock src_ip, target_ip & decrement
  535. * the vnode references.
  536. */
  537. error = xfs_trans_commit(tp, XFS_TRANS_RELEASE_LOG_RES, NULL);
  538. if (target_ip != NULL) {
  539. xfs_refcache_purge_ip(target_ip);
  540. IRELE(target_ip);
  541. }
  542. /*
  543. * Let interposed file systems know about removed links.
  544. */
  545. if (target_ip_dropped) {
  546. VOP_LINK_REMOVED(XFS_ITOV(target_ip), target_dir_vp,
  547. target_link_zero);
  548. IRELE(target_ip);
  549. }
  550. IRELE(src_ip);
  551. /* Fall through to std_return with error = 0 or errno from
  552. * xfs_trans_commit */
  553. std_return:
  554. if (DM_EVENT_ENABLED(src_dir_vp->v_vfsp, src_dp, DM_EVENT_POSTRENAME) ||
  555. DM_EVENT_ENABLED(target_dir_vp->v_vfsp,
  556. target_dp, DM_EVENT_POSTRENAME)) {
  557. (void) XFS_SEND_NAMESP (mp, DM_EVENT_POSTRENAME,
  558. src_dir_vp, DM_RIGHT_NULL,
  559. target_dir_vp, DM_RIGHT_NULL,
  560. src_name, target_name,
  561. 0, error, 0);
  562. }
  563. return error;
  564. abort_return:
  565. cancel_flags |= XFS_TRANS_ABORT;
  566. /* FALLTHROUGH */
  567. error_return:
  568. xfs_bmap_cancel(&free_list);
  569. xfs_trans_cancel(tp, cancel_flags);
  570. goto std_return;
  571. rele_return:
  572. IRELE(src_ip);
  573. if (target_ip != NULL) {
  574. IRELE(target_ip);
  575. }
  576. goto std_return;
  577. }