aboutsummaryrefslogtreecommitdiffstats
path: root/fs/xfs
diff options
context:
space:
mode:
authorEric Sandeen <sandeen@sandeen.net>2016-01-10 19:34:01 -0500
committerDave Chinner <david@fromorbit.com>2016-01-10 19:34:01 -0500
commitf6106efae5f4144b32f6c10de0dc3e7efc9181e3 (patch)
tree15d2a875d0e9bf02cf4b10488c249fa71c24b9b4 /fs/xfs
parente35438196c6a1d8b206471d51e80c380e80e047b (diff)
xfs: eliminate committed arg from xfs_bmap_finish
Calls to xfs_bmap_finish() and xfs_trans_ijoin(), and the associated comments were replicated several times across the attribute code, all dealing with what to do if the transaction was or wasn't committed. And in that replicated code, an ASSERT() test of an uninitialized variable occurs in several locations: error = xfs_attr_thing(&args); if (!error) { error = xfs_bmap_finish(&args.trans, args.flist, &committed); } if (error) { ASSERT(committed); If the first xfs_attr_thing() failed, we'd skip the xfs_bmap_finish, never set "committed", and then test it in the ASSERT. Fix this up by moving the committed state internal to xfs_bmap_finish, and add a new inode argument. If an inode is passed in, it is passed through to __xfs_trans_roll() and joined to the transaction there if the transaction was committed. xfs_qm_dqalloc() was a little unique in that it called bjoin rather than ijoin, but as Dave points out we can detect the committed state but checking whether (*tpp != tp). Addresses-Coverity-Id: 102360 Addresses-Coverity-Id: 102361 Addresses-Coverity-Id: 102363 Addresses-Coverity-Id: 102364 Signed-off-by: Eric Sandeen <sandeen@redhat.com> Reviewed-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Dave Chinner <david@fromorbit.com>
Diffstat (limited to 'fs/xfs')
-rw-r--r--fs/xfs/libxfs/xfs_attr.c141
-rw-r--r--fs/xfs/libxfs/xfs_attr_remote.c31
-rw-r--r--fs/xfs/libxfs/xfs_bmap.c6
-rw-r--r--fs/xfs/libxfs/xfs_bmap.h2
-rw-r--r--fs/xfs/xfs_bmap_util.c43
-rw-r--r--fs/xfs/xfs_dquot.c13
-rw-r--r--fs/xfs/xfs_inode.c25
-rw-r--r--fs/xfs/xfs_iomap.c10
-rw-r--r--fs/xfs/xfs_rtalloc.c3
-rw-r--r--fs/xfs/xfs_symlink.c12
10 files changed, 68 insertions, 218 deletions
diff --git a/fs/xfs/libxfs/xfs_attr.c b/fs/xfs/libxfs/xfs_attr.c
index f949818fa1c7..fa3b948ef9c2 100644
--- a/fs/xfs/libxfs/xfs_attr.c
+++ b/fs/xfs/libxfs/xfs_attr.c
@@ -207,7 +207,7 @@ xfs_attr_set(
207 struct xfs_trans_res tres; 207 struct xfs_trans_res tres;
208 xfs_fsblock_t firstblock; 208 xfs_fsblock_t firstblock;
209 int rsvd = (flags & ATTR_ROOT) != 0; 209 int rsvd = (flags & ATTR_ROOT) != 0;
210 int error, err2, committed, local; 210 int error, err2, local;
211 211
212 XFS_STATS_INC(mp, xs_attr_set); 212 XFS_STATS_INC(mp, xs_attr_set);
213 213
@@ -334,25 +334,15 @@ xfs_attr_set(
334 */ 334 */
335 xfs_bmap_init(args.flist, args.firstblock); 335 xfs_bmap_init(args.flist, args.firstblock);
336 error = xfs_attr_shortform_to_leaf(&args); 336 error = xfs_attr_shortform_to_leaf(&args);
337 if (!error) { 337 if (!error)
338 error = xfs_bmap_finish(&args.trans, args.flist, 338 error = xfs_bmap_finish(&args.trans, args.flist, dp);
339 &committed);
340 }
341 if (error) { 339 if (error) {
342 ASSERT(committed);
343 args.trans = NULL; 340 args.trans = NULL;
344 xfs_bmap_cancel(&flist); 341 xfs_bmap_cancel(&flist);
345 goto out; 342 goto out;
346 } 343 }
347 344
348 /* 345 /*
349 * bmap_finish() may have committed the last trans and started
350 * a new one. We need the inode to be in all transactions.
351 */
352 if (committed)
353 xfs_trans_ijoin(args.trans, dp, 0);
354
355 /*
356 * Commit the leaf transformation. We'll need another (linked) 346 * Commit the leaf transformation. We'll need another (linked)
357 * transaction to add the new attribute to the leaf. 347 * transaction to add the new attribute to the leaf.
358 */ 348 */
@@ -568,7 +558,7 @@ xfs_attr_leaf_addname(xfs_da_args_t *args)
568{ 558{
569 xfs_inode_t *dp; 559 xfs_inode_t *dp;
570 struct xfs_buf *bp; 560 struct xfs_buf *bp;
571 int retval, error, committed, forkoff; 561 int retval, error, forkoff;
572 562
573 trace_xfs_attr_leaf_addname(args); 563 trace_xfs_attr_leaf_addname(args);
574 564
@@ -628,25 +618,15 @@ xfs_attr_leaf_addname(xfs_da_args_t *args)
628 */ 618 */
629 xfs_bmap_init(args->flist, args->firstblock); 619 xfs_bmap_init(args->flist, args->firstblock);
630 error = xfs_attr3_leaf_to_node(args); 620 error = xfs_attr3_leaf_to_node(args);
631 if (!error) { 621 if (!error)
632 error = xfs_bmap_finish(&args->trans, args->flist, 622 error = xfs_bmap_finish(&args->trans, args->flist, dp);
633 &committed);
634 }
635 if (error) { 623 if (error) {
636 ASSERT(committed);
637 args->trans = NULL; 624 args->trans = NULL;
638 xfs_bmap_cancel(args->flist); 625 xfs_bmap_cancel(args->flist);
639 return error; 626 return error;
640 } 627 }
641 628
642 /* 629 /*
643 * bmap_finish() may have committed the last trans and started
644 * a new one. We need the inode to be in all transactions.
645 */
646 if (committed)
647 xfs_trans_ijoin(args->trans, dp, 0);
648
649 /*
650 * Commit the current trans (including the inode) and start 630 * Commit the current trans (including the inode) and start
651 * a new one. 631 * a new one.
652 */ 632 */
@@ -729,25 +709,14 @@ xfs_attr_leaf_addname(xfs_da_args_t *args)
729 xfs_bmap_init(args->flist, args->firstblock); 709 xfs_bmap_init(args->flist, args->firstblock);
730 error = xfs_attr3_leaf_to_shortform(bp, args, forkoff); 710 error = xfs_attr3_leaf_to_shortform(bp, args, forkoff);
731 /* bp is gone due to xfs_da_shrink_inode */ 711 /* bp is gone due to xfs_da_shrink_inode */
732 if (!error) { 712 if (!error)
733 error = xfs_bmap_finish(&args->trans, 713 error = xfs_bmap_finish(&args->trans,
734 args->flist, 714 args->flist, dp);
735 &committed);
736 }
737 if (error) { 715 if (error) {
738 ASSERT(committed);
739 args->trans = NULL; 716 args->trans = NULL;
740 xfs_bmap_cancel(args->flist); 717 xfs_bmap_cancel(args->flist);
741 return error; 718 return error;
742 } 719 }
743
744 /*
745 * bmap_finish() may have committed the last trans
746 * and started a new one. We need the inode to be
747 * in all transactions.
748 */
749 if (committed)
750 xfs_trans_ijoin(args->trans, dp, 0);
751 } 720 }
752 721
753 /* 722 /*
@@ -775,7 +744,7 @@ xfs_attr_leaf_removename(xfs_da_args_t *args)
775{ 744{
776 xfs_inode_t *dp; 745 xfs_inode_t *dp;
777 struct xfs_buf *bp; 746 struct xfs_buf *bp;
778 int error, committed, forkoff; 747 int error, forkoff;
779 748
780 trace_xfs_attr_leaf_removename(args); 749 trace_xfs_attr_leaf_removename(args);
781 750
@@ -803,23 +772,13 @@ xfs_attr_leaf_removename(xfs_da_args_t *args)
803 xfs_bmap_init(args->flist, args->firstblock); 772 xfs_bmap_init(args->flist, args->firstblock);
804 error = xfs_attr3_leaf_to_shortform(bp, args, forkoff); 773 error = xfs_attr3_leaf_to_shortform(bp, args, forkoff);
805 /* bp is gone due to xfs_da_shrink_inode */ 774 /* bp is gone due to xfs_da_shrink_inode */
806 if (!error) { 775 if (!error)
807 error = xfs_bmap_finish(&args->trans, args->flist, 776 error = xfs_bmap_finish(&args->trans, args->flist, dp);
808 &committed);
809 }
810 if (error) { 777 if (error) {
811 ASSERT(committed);
812 args->trans = NULL; 778 args->trans = NULL;
813 xfs_bmap_cancel(args->flist); 779 xfs_bmap_cancel(args->flist);
814 return error; 780 return error;
815 } 781 }
816
817 /*
818 * bmap_finish() may have committed the last trans and started
819 * a new one. We need the inode to be in all transactions.
820 */
821 if (committed)
822 xfs_trans_ijoin(args->trans, dp, 0);
823 } 782 }
824 return 0; 783 return 0;
825} 784}
@@ -877,7 +836,7 @@ xfs_attr_node_addname(xfs_da_args_t *args)
877 xfs_da_state_blk_t *blk; 836 xfs_da_state_blk_t *blk;
878 xfs_inode_t *dp; 837 xfs_inode_t *dp;
879 xfs_mount_t *mp; 838 xfs_mount_t *mp;
880 int committed, retval, error; 839 int retval, error;
881 840
882 trace_xfs_attr_node_addname(args); 841 trace_xfs_attr_node_addname(args);
883 842
@@ -938,27 +897,16 @@ restart:
938 state = NULL; 897 state = NULL;
939 xfs_bmap_init(args->flist, args->firstblock); 898 xfs_bmap_init(args->flist, args->firstblock);
940 error = xfs_attr3_leaf_to_node(args); 899 error = xfs_attr3_leaf_to_node(args);
941 if (!error) { 900 if (!error)
942 error = xfs_bmap_finish(&args->trans, 901 error = xfs_bmap_finish(&args->trans,
943 args->flist, 902 args->flist, dp);
944 &committed);
945 }
946 if (error) { 903 if (error) {
947 ASSERT(committed);
948 args->trans = NULL; 904 args->trans = NULL;
949 xfs_bmap_cancel(args->flist); 905 xfs_bmap_cancel(args->flist);
950 goto out; 906 goto out;
951 } 907 }
952 908
953 /* 909 /*
954 * bmap_finish() may have committed the last trans
955 * and started a new one. We need the inode to be
956 * in all transactions.
957 */
958 if (committed)
959 xfs_trans_ijoin(args->trans, dp, 0);
960
961 /*
962 * Commit the node conversion and start the next 910 * Commit the node conversion and start the next
963 * trans in the chain. 911 * trans in the chain.
964 */ 912 */
@@ -977,23 +925,13 @@ restart:
977 */ 925 */
978 xfs_bmap_init(args->flist, args->firstblock); 926 xfs_bmap_init(args->flist, args->firstblock);
979 error = xfs_da3_split(state); 927 error = xfs_da3_split(state);
980 if (!error) { 928 if (!error)
981 error = xfs_bmap_finish(&args->trans, args->flist, 929 error = xfs_bmap_finish(&args->trans, args->flist, dp);
982 &committed);
983 }
984 if (error) { 930 if (error) {
985 ASSERT(committed);
986 args->trans = NULL; 931 args->trans = NULL;
987 xfs_bmap_cancel(args->flist); 932 xfs_bmap_cancel(args->flist);
988 goto out; 933 goto out;
989 } 934 }
990
991 /*
992 * bmap_finish() may have committed the last trans and started
993 * a new one. We need the inode to be in all transactions.
994 */
995 if (committed)
996 xfs_trans_ijoin(args->trans, dp, 0);
997 } else { 935 } else {
998 /* 936 /*
999 * Addition succeeded, update Btree hashvals. 937 * Addition succeeded, update Btree hashvals.
@@ -1086,25 +1024,14 @@ restart:
1086 if (retval && (state->path.active > 1)) { 1024 if (retval && (state->path.active > 1)) {
1087 xfs_bmap_init(args->flist, args->firstblock); 1025 xfs_bmap_init(args->flist, args->firstblock);
1088 error = xfs_da3_join(state); 1026 error = xfs_da3_join(state);
1089 if (!error) { 1027 if (!error)
1090 error = xfs_bmap_finish(&args->trans, 1028 error = xfs_bmap_finish(&args->trans,
1091 args->flist, 1029 args->flist, dp);
1092 &committed);
1093 }
1094 if (error) { 1030 if (error) {
1095 ASSERT(committed);
1096 args->trans = NULL; 1031 args->trans = NULL;
1097 xfs_bmap_cancel(args->flist); 1032 xfs_bmap_cancel(args->flist);
1098 goto out; 1033 goto out;
1099 } 1034 }
1100
1101 /*
1102 * bmap_finish() may have committed the last trans
1103 * and started a new one. We need the inode to be
1104 * in all transactions.
1105 */
1106 if (committed)
1107 xfs_trans_ijoin(args->trans, dp, 0);
1108 } 1035 }
1109 1036
1110 /* 1037 /*
@@ -1146,7 +1073,7 @@ xfs_attr_node_removename(xfs_da_args_t *args)
1146 xfs_da_state_blk_t *blk; 1073 xfs_da_state_blk_t *blk;
1147 xfs_inode_t *dp; 1074 xfs_inode_t *dp;
1148 struct xfs_buf *bp; 1075 struct xfs_buf *bp;
1149 int retval, error, committed, forkoff; 1076 int retval, error, forkoff;
1150 1077
1151 trace_xfs_attr_node_removename(args); 1078 trace_xfs_attr_node_removename(args);
1152 1079
@@ -1220,24 +1147,13 @@ xfs_attr_node_removename(xfs_da_args_t *args)
1220 if (retval && (state->path.active > 1)) { 1147 if (retval && (state->path.active > 1)) {
1221 xfs_bmap_init(args->flist, args->firstblock); 1148 xfs_bmap_init(args->flist, args->firstblock);
1222 error = xfs_da3_join(state); 1149 error = xfs_da3_join(state);
1223 if (!error) { 1150 if (!error)
1224 error = xfs_bmap_finish(&args->trans, args->flist, 1151 error = xfs_bmap_finish(&args->trans, args->flist, dp);
1225 &committed);
1226 }
1227 if (error) { 1152 if (error) {
1228 ASSERT(committed);
1229 args->trans = NULL; 1153 args->trans = NULL;
1230 xfs_bmap_cancel(args->flist); 1154 xfs_bmap_cancel(args->flist);
1231 goto out; 1155 goto out;
1232 } 1156 }
1233
1234 /*
1235 * bmap_finish() may have committed the last trans and started
1236 * a new one. We need the inode to be in all transactions.
1237 */
1238 if (committed)
1239 xfs_trans_ijoin(args->trans, dp, 0);
1240
1241 /* 1157 /*
1242 * Commit the Btree join operation and start a new trans. 1158 * Commit the Btree join operation and start a new trans.
1243 */ 1159 */
@@ -1265,25 +1181,14 @@ xfs_attr_node_removename(xfs_da_args_t *args)
1265 xfs_bmap_init(args->flist, args->firstblock); 1181 xfs_bmap_init(args->flist, args->firstblock);
1266 error = xfs_attr3_leaf_to_shortform(bp, args, forkoff); 1182 error = xfs_attr3_leaf_to_shortform(bp, args, forkoff);
1267 /* bp is gone due to xfs_da_shrink_inode */ 1183 /* bp is gone due to xfs_da_shrink_inode */
1268 if (!error) { 1184 if (!error)
1269 error = xfs_bmap_finish(&args->trans, 1185 error = xfs_bmap_finish(&args->trans,
1270 args->flist, 1186 args->flist, dp);
1271 &committed);
1272 }
1273 if (error) { 1187 if (error) {
1274 ASSERT(committed);
1275 args->trans = NULL; 1188 args->trans = NULL;
1276 xfs_bmap_cancel(args->flist); 1189 xfs_bmap_cancel(args->flist);
1277 goto out; 1190 goto out;
1278 } 1191 }
1279
1280 /*
1281 * bmap_finish() may have committed the last trans
1282 * and started a new one. We need the inode to be
1283 * in all transactions.
1284 */
1285 if (committed)
1286 xfs_trans_ijoin(args->trans, dp, 0);
1287 } else 1192 } else
1288 xfs_trans_brelse(args->trans, bp); 1193 xfs_trans_brelse(args->trans, bp);
1289 } 1194 }
diff --git a/fs/xfs/libxfs/xfs_attr_remote.c b/fs/xfs/libxfs/xfs_attr_remote.c
index f3ed9bf0b065..a572532a55cd 100644
--- a/fs/xfs/libxfs/xfs_attr_remote.c
+++ b/fs/xfs/libxfs/xfs_attr_remote.c
@@ -448,8 +448,6 @@ xfs_attr_rmtval_set(
448 * Roll through the "value", allocating blocks on disk as required. 448 * Roll through the "value", allocating blocks on disk as required.
449 */ 449 */
450 while (blkcnt > 0) { 450 while (blkcnt > 0) {
451 int committed;
452
453 /* 451 /*
454 * Allocate a single extent, up to the size of the value. 452 * Allocate a single extent, up to the size of the value.
455 * 453 *
@@ -467,24 +465,14 @@ xfs_attr_rmtval_set(
467 error = xfs_bmapi_write(args->trans, dp, (xfs_fileoff_t)lblkno, 465 error = xfs_bmapi_write(args->trans, dp, (xfs_fileoff_t)lblkno,
468 blkcnt, XFS_BMAPI_ATTRFORK, args->firstblock, 466 blkcnt, XFS_BMAPI_ATTRFORK, args->firstblock,
469 args->total, &map, &nmap, args->flist); 467 args->total, &map, &nmap, args->flist);
470 if (!error) { 468 if (!error)
471 error = xfs_bmap_finish(&args->trans, args->flist, 469 error = xfs_bmap_finish(&args->trans, args->flist, dp);
472 &committed);
473 }
474 if (error) { 470 if (error) {
475 ASSERT(committed);
476 args->trans = NULL; 471 args->trans = NULL;
477 xfs_bmap_cancel(args->flist); 472 xfs_bmap_cancel(args->flist);
478 return error; 473 return error;
479 } 474 }
480 475
481 /*
482 * bmap_finish() may have committed the last trans and started
483 * a new one. We need the inode to be in all transactions.
484 */
485 if (committed)
486 xfs_trans_ijoin(args->trans, dp, 0);
487
488 ASSERT(nmap == 1); 476 ASSERT(nmap == 1);
489 ASSERT((map.br_startblock != DELAYSTARTBLOCK) && 477 ASSERT((map.br_startblock != DELAYSTARTBLOCK) &&
490 (map.br_startblock != HOLESTARTBLOCK)); 478 (map.br_startblock != HOLESTARTBLOCK));
@@ -615,31 +603,20 @@ xfs_attr_rmtval_remove(
615 blkcnt = args->rmtblkcnt; 603 blkcnt = args->rmtblkcnt;
616 done = 0; 604 done = 0;
617 while (!done) { 605 while (!done) {
618 int committed;
619
620 xfs_bmap_init(args->flist, args->firstblock); 606 xfs_bmap_init(args->flist, args->firstblock);
621 error = xfs_bunmapi(args->trans, args->dp, lblkno, blkcnt, 607 error = xfs_bunmapi(args->trans, args->dp, lblkno, blkcnt,
622 XFS_BMAPI_ATTRFORK, 1, args->firstblock, 608 XFS_BMAPI_ATTRFORK, 1, args->firstblock,
623 args->flist, &done); 609 args->flist, &done);
624 if (!error) { 610 if (!error)
625 error = xfs_bmap_finish(&args->trans, args->flist, 611 error = xfs_bmap_finish(&args->trans, args->flist,
626 &committed); 612 args->dp);
627 }
628 if (error) { 613 if (error) {
629 ASSERT(committed);
630 args->trans = NULL; 614 args->trans = NULL;
631 xfs_bmap_cancel(args->flist); 615 xfs_bmap_cancel(args->flist);
632 return error; 616 return error;
633 } 617 }
634 618
635 /* 619 /*
636 * bmap_finish() may have committed the last trans and started
637 * a new one. We need the inode to be in all transactions.
638 */
639 if (committed)
640 xfs_trans_ijoin(args->trans, args->dp, 0);
641
642 /*
643 * Close out trans and start the next one in the chain. 620 * Close out trans and start the next one in the chain.
644 */ 621 */
645 error = xfs_trans_roll(&args->trans, args->dp); 622 error = xfs_trans_roll(&args->trans, args->dp);
diff --git a/fs/xfs/libxfs/xfs_bmap.c b/fs/xfs/libxfs/xfs_bmap.c
index bc7e7d5b8c97..ef00156f4f96 100644
--- a/fs/xfs/libxfs/xfs_bmap.c
+++ b/fs/xfs/libxfs/xfs_bmap.c
@@ -1117,7 +1117,6 @@ xfs_bmap_add_attrfork(
1117 xfs_trans_t *tp; /* transaction pointer */ 1117 xfs_trans_t *tp; /* transaction pointer */
1118 int blks; /* space reservation */ 1118 int blks; /* space reservation */
1119 int version = 1; /* superblock attr version */ 1119 int version = 1; /* superblock attr version */
1120 int committed; /* xaction was committed */
1121 int logflags; /* logging flags */ 1120 int logflags; /* logging flags */
1122 int error; /* error return value */ 1121 int error; /* error return value */
1123 1122
@@ -1220,7 +1219,7 @@ xfs_bmap_add_attrfork(
1220 xfs_log_sb(tp); 1219 xfs_log_sb(tp);
1221 } 1220 }
1222 1221
1223 error = xfs_bmap_finish(&tp, &flist, &committed); 1222 error = xfs_bmap_finish(&tp, &flist, NULL);
1224 if (error) 1223 if (error)
1225 goto bmap_cancel; 1224 goto bmap_cancel;
1226 error = xfs_trans_commit(tp); 1225 error = xfs_trans_commit(tp);
@@ -5957,7 +5956,6 @@ xfs_bmap_split_extent(
5957 struct xfs_trans *tp; 5956 struct xfs_trans *tp;
5958 struct xfs_bmap_free free_list; 5957 struct xfs_bmap_free free_list;
5959 xfs_fsblock_t firstfsb; 5958 xfs_fsblock_t firstfsb;
5960 int committed;
5961 int error; 5959 int error;
5962 5960
5963 tp = xfs_trans_alloc(mp, XFS_TRANS_DIOSTRAT); 5961 tp = xfs_trans_alloc(mp, XFS_TRANS_DIOSTRAT);
@@ -5978,7 +5976,7 @@ xfs_bmap_split_extent(
5978 if (error) 5976 if (error)
5979 goto out; 5977 goto out;
5980 5978
5981 error = xfs_bmap_finish(&tp, &free_list, &committed); 5979 error = xfs_bmap_finish(&tp, &free_list, NULL);
5982 if (error) 5980 if (error)
5983 goto out; 5981 goto out;
5984 5982
diff --git a/fs/xfs/libxfs/xfs_bmap.h b/fs/xfs/libxfs/xfs_bmap.h
index a160f8a5a3fc..423a34e832bd 100644
--- a/fs/xfs/libxfs/xfs_bmap.h
+++ b/fs/xfs/libxfs/xfs_bmap.h
@@ -195,7 +195,7 @@ void xfs_bmap_add_free(xfs_fsblock_t bno, xfs_filblks_t len,
195 struct xfs_bmap_free *flist, struct xfs_mount *mp); 195 struct xfs_bmap_free *flist, struct xfs_mount *mp);
196void xfs_bmap_cancel(struct xfs_bmap_free *flist); 196void xfs_bmap_cancel(struct xfs_bmap_free *flist);
197int xfs_bmap_finish(struct xfs_trans **tp, struct xfs_bmap_free *flist, 197int xfs_bmap_finish(struct xfs_trans **tp, struct xfs_bmap_free *flist,
198 int *committed); 198 struct xfs_inode *ip);
199void xfs_bmap_compute_maxlevels(struct xfs_mount *mp, int whichfork); 199void xfs_bmap_compute_maxlevels(struct xfs_mount *mp, int whichfork);
200int xfs_bmap_first_unused(struct xfs_trans *tp, struct xfs_inode *ip, 200int xfs_bmap_first_unused(struct xfs_trans *tp, struct xfs_inode *ip,
201 xfs_extlen_t len, xfs_fileoff_t *unused, int whichfork); 201 xfs_extlen_t len, xfs_fileoff_t *unused, int whichfork);
diff --git a/fs/xfs/xfs_bmap_util.c b/fs/xfs/xfs_bmap_util.c
index dbae6490a79a..45ec9e40150c 100644
--- a/fs/xfs/xfs_bmap_util.c
+++ b/fs/xfs/xfs_bmap_util.c
@@ -91,32 +91,32 @@ xfs_zero_extent(
91 * last due to locking considerations. We never free any extents in 91 * last due to locking considerations. We never free any extents in
92 * the first transaction. 92 * the first transaction.
93 * 93 *
94 * Return 1 if the given transaction was committed and a new one 94 * If an inode *ip is provided, rejoin it to the transaction if
95 * started, and 0 otherwise in the committed parameter. 95 * the transaction was committed.
96 */ 96 */
97int /* error */ 97int /* error */
98xfs_bmap_finish( 98xfs_bmap_finish(
99 struct xfs_trans **tp, /* transaction pointer addr */ 99 struct xfs_trans **tp, /* transaction pointer addr */
100 struct xfs_bmap_free *flist, /* i/o: list extents to free */ 100 struct xfs_bmap_free *flist, /* i/o: list extents to free */
101 int *committed)/* xact committed or not */ 101 struct xfs_inode *ip)
102{ 102{
103 struct xfs_efd_log_item *efd; /* extent free data */ 103 struct xfs_efd_log_item *efd; /* extent free data */
104 struct xfs_efi_log_item *efi; /* extent free intention */ 104 struct xfs_efi_log_item *efi; /* extent free intention */
105 int error; /* error return value */ 105 int error; /* error return value */
106 int committed;/* xact committed or not */
106 struct xfs_bmap_free_item *free; /* free extent item */ 107 struct xfs_bmap_free_item *free; /* free extent item */
107 struct xfs_bmap_free_item *next; /* next item on free list */ 108 struct xfs_bmap_free_item *next; /* next item on free list */
108 109
109 ASSERT((*tp)->t_flags & XFS_TRANS_PERM_LOG_RES); 110 ASSERT((*tp)->t_flags & XFS_TRANS_PERM_LOG_RES);
110 if (flist->xbf_count == 0) { 111 if (flist->xbf_count == 0)
111 *committed = 0;
112 return 0; 112 return 0;
113 } 113
114 efi = xfs_trans_get_efi(*tp, flist->xbf_count); 114 efi = xfs_trans_get_efi(*tp, flist->xbf_count);
115 for (free = flist->xbf_first; free; free = free->xbfi_next) 115 for (free = flist->xbf_first; free; free = free->xbfi_next)
116 xfs_trans_log_efi_extent(*tp, efi, free->xbfi_startblock, 116 xfs_trans_log_efi_extent(*tp, efi, free->xbfi_startblock,
117 free->xbfi_blockcount); 117 free->xbfi_blockcount);
118 118
119 error = __xfs_trans_roll(tp, NULL, committed); 119 error = __xfs_trans_roll(tp, ip, &committed);
120 if (error) { 120 if (error) {
121 /* 121 /*
122 * If the transaction was committed, drop the EFD reference 122 * If the transaction was committed, drop the EFD reference
@@ -128,16 +128,13 @@ xfs_bmap_finish(
128 * transaction so we should return committed=1 even though we're 128 * transaction so we should return committed=1 even though we're
129 * returning an error. 129 * returning an error.
130 */ 130 */
131 if (*committed) { 131 if (committed) {
132 xfs_efi_release(efi); 132 xfs_efi_release(efi);
133 xfs_force_shutdown((*tp)->t_mountp, 133 xfs_force_shutdown((*tp)->t_mountp,
134 (error == -EFSCORRUPTED) ? 134 (error == -EFSCORRUPTED) ?
135 SHUTDOWN_CORRUPT_INCORE : 135 SHUTDOWN_CORRUPT_INCORE :
136 SHUTDOWN_META_IO_ERROR); 136 SHUTDOWN_META_IO_ERROR);
137 } else {
138 *committed = 1;
139 } 137 }
140
141 return error; 138 return error;
142 } 139 }
143 140
@@ -969,7 +966,6 @@ xfs_alloc_file_space(
969 xfs_bmbt_irec_t imaps[1], *imapp; 966 xfs_bmbt_irec_t imaps[1], *imapp;
970 xfs_bmap_free_t free_list; 967 xfs_bmap_free_t free_list;
971 uint qblocks, resblks, resrtextents; 968 uint qblocks, resblks, resrtextents;
972 int committed;
973 int error; 969 int error;
974 970
975 trace_xfs_alloc_file_space(ip); 971 trace_xfs_alloc_file_space(ip);
@@ -1064,23 +1060,20 @@ xfs_alloc_file_space(
1064 error = xfs_bmapi_write(tp, ip, startoffset_fsb, 1060 error = xfs_bmapi_write(tp, ip, startoffset_fsb,
1065 allocatesize_fsb, alloc_type, &firstfsb, 1061 allocatesize_fsb, alloc_type, &firstfsb,
1066 resblks, imapp, &nimaps, &free_list); 1062 resblks, imapp, &nimaps, &free_list);
1067 if (error) { 1063 if (error)
1068 goto error0; 1064 goto error0;
1069 }
1070 1065
1071 /* 1066 /*
1072 * Complete the transaction 1067 * Complete the transaction
1073 */ 1068 */
1074 error = xfs_bmap_finish(&tp, &free_list, &committed); 1069 error = xfs_bmap_finish(&tp, &free_list, NULL);
1075 if (error) { 1070 if (error)
1076 goto error0; 1071 goto error0;
1077 }
1078 1072
1079 error = xfs_trans_commit(tp); 1073 error = xfs_trans_commit(tp);
1080 xfs_iunlock(ip, XFS_ILOCK_EXCL); 1074 xfs_iunlock(ip, XFS_ILOCK_EXCL);
1081 if (error) { 1075 if (error)
1082 break; 1076 break;
1083 }
1084 1077
1085 allocated_fsb = imapp->br_blockcount; 1078 allocated_fsb = imapp->br_blockcount;
1086 1079
@@ -1206,7 +1199,6 @@ xfs_free_file_space(
1206 xfs_off_t offset, 1199 xfs_off_t offset,
1207 xfs_off_t len) 1200 xfs_off_t len)
1208{ 1201{
1209 int committed;
1210 int done; 1202 int done;
1211 xfs_fileoff_t endoffset_fsb; 1203 xfs_fileoff_t endoffset_fsb;
1212 int error; 1204 int error;
@@ -1346,17 +1338,15 @@ xfs_free_file_space(
1346 error = xfs_bunmapi(tp, ip, startoffset_fsb, 1338 error = xfs_bunmapi(tp, ip, startoffset_fsb,
1347 endoffset_fsb - startoffset_fsb, 1339 endoffset_fsb - startoffset_fsb,
1348 0, 2, &firstfsb, &free_list, &done); 1340 0, 2, &firstfsb, &free_list, &done);
1349 if (error) { 1341 if (error)
1350 goto error0; 1342 goto error0;
1351 }
1352 1343
1353 /* 1344 /*
1354 * complete the transaction 1345 * complete the transaction
1355 */ 1346 */
1356 error = xfs_bmap_finish(&tp, &free_list, &committed); 1347 error = xfs_bmap_finish(&tp, &free_list, NULL);
1357 if (error) { 1348 if (error)
1358 goto error0; 1349 goto error0;
1359 }
1360 1350
1361 error = xfs_trans_commit(tp); 1351 error = xfs_trans_commit(tp);
1362 xfs_iunlock(ip, XFS_ILOCK_EXCL); 1352 xfs_iunlock(ip, XFS_ILOCK_EXCL);
@@ -1434,7 +1424,6 @@ xfs_shift_file_space(
1434 int error; 1424 int error;
1435 struct xfs_bmap_free free_list; 1425 struct xfs_bmap_free free_list;
1436 xfs_fsblock_t first_block; 1426 xfs_fsblock_t first_block;
1437 int committed;
1438 xfs_fileoff_t stop_fsb; 1427 xfs_fileoff_t stop_fsb;
1439 xfs_fileoff_t next_fsb; 1428 xfs_fileoff_t next_fsb;
1440 xfs_fileoff_t shift_fsb; 1429 xfs_fileoff_t shift_fsb;
@@ -1526,7 +1515,7 @@ xfs_shift_file_space(
1526 if (error) 1515 if (error)
1527 goto out_bmap_cancel; 1516 goto out_bmap_cancel;
1528 1517
1529 error = xfs_bmap_finish(&tp, &free_list, &committed); 1518 error = xfs_bmap_finish(&tp, &free_list, NULL);
1530 if (error) 1519 if (error)
1531 goto out_bmap_cancel; 1520 goto out_bmap_cancel;
1532 1521
diff --git a/fs/xfs/xfs_dquot.c b/fs/xfs/xfs_dquot.c
index 7ac6c5c586cb..9c44d38dcd1f 100644
--- a/fs/xfs/xfs_dquot.c
+++ b/fs/xfs/xfs_dquot.c
@@ -306,7 +306,7 @@ xfs_qm_dqalloc(
306 xfs_fsblock_t firstblock; 306 xfs_fsblock_t firstblock;
307 xfs_bmap_free_t flist; 307 xfs_bmap_free_t flist;
308 xfs_bmbt_irec_t map; 308 xfs_bmbt_irec_t map;
309 int nmaps, error, committed; 309 int nmaps, error;
310 xfs_buf_t *bp; 310 xfs_buf_t *bp;
311 xfs_trans_t *tp = *tpp; 311 xfs_trans_t *tp = *tpp;
312 312
@@ -379,11 +379,12 @@ xfs_qm_dqalloc(
379 379
380 xfs_trans_bhold(tp, bp); 380 xfs_trans_bhold(tp, bp);
381 381
382 if ((error = xfs_bmap_finish(tpp, &flist, &committed))) { 382 error = xfs_bmap_finish(tpp, &flist, NULL);
383 if (error)
383 goto error1; 384 goto error1;
384 }
385 385
386 if (committed) { 386 /* Transaction was committed? */
387 if (*tpp != tp) {
387 tp = *tpp; 388 tp = *tpp;
388 xfs_trans_bjoin(tp, bp); 389 xfs_trans_bjoin(tp, bp);
389 } else { 390 } else {
@@ -393,9 +394,9 @@ xfs_qm_dqalloc(
393 *O_bpp = bp; 394 *O_bpp = bp;
394 return 0; 395 return 0;
395 396
396 error1: 397error1:
397 xfs_bmap_cancel(&flist); 398 xfs_bmap_cancel(&flist);
398 error0: 399error0:
399 xfs_iunlock(quotip, XFS_ILOCK_EXCL); 400 xfs_iunlock(quotip, XFS_ILOCK_EXCL);
400 401
401 return error; 402 return error;
diff --git a/fs/xfs/xfs_inode.c b/fs/xfs/xfs_inode.c
index 8ee393996b7d..ae3758a90ed6 100644
--- a/fs/xfs/xfs_inode.c
+++ b/fs/xfs/xfs_inode.c
@@ -1143,7 +1143,6 @@ xfs_create(
1143 xfs_bmap_free_t free_list; 1143 xfs_bmap_free_t free_list;
1144 xfs_fsblock_t first_block; 1144 xfs_fsblock_t first_block;
1145 bool unlock_dp_on_error = false; 1145 bool unlock_dp_on_error = false;
1146 int committed;
1147 prid_t prid; 1146 prid_t prid;
1148 struct xfs_dquot *udqp = NULL; 1147 struct xfs_dquot *udqp = NULL;
1149 struct xfs_dquot *gdqp = NULL; 1148 struct xfs_dquot *gdqp = NULL;
@@ -1226,7 +1225,7 @@ xfs_create(
1226 * pointing to itself. 1225 * pointing to itself.
1227 */ 1226 */
1228 error = xfs_dir_ialloc(&tp, dp, mode, is_dir ? 2 : 1, rdev, 1227 error = xfs_dir_ialloc(&tp, dp, mode, is_dir ? 2 : 1, rdev,
1229 prid, resblks > 0, &ip, &committed); 1228 prid, resblks > 0, &ip, NULL);
1230 if (error) 1229 if (error)
1231 goto out_trans_cancel; 1230 goto out_trans_cancel;
1232 1231
@@ -1275,7 +1274,7 @@ xfs_create(
1275 */ 1274 */
1276 xfs_qm_vop_create_dqattach(tp, ip, udqp, gdqp, pdqp); 1275 xfs_qm_vop_create_dqattach(tp, ip, udqp, gdqp, pdqp);
1277 1276
1278 error = xfs_bmap_finish(&tp, &free_list, &committed); 1277 error = xfs_bmap_finish(&tp, &free_list, NULL);
1279 if (error) 1278 if (error)
1280 goto out_bmap_cancel; 1279 goto out_bmap_cancel;
1281 1280
@@ -1427,7 +1426,6 @@ xfs_link(
1427 int error; 1426 int error;
1428 xfs_bmap_free_t free_list; 1427 xfs_bmap_free_t free_list;
1429 xfs_fsblock_t first_block; 1428 xfs_fsblock_t first_block;
1430 int committed;
1431 int resblks; 1429 int resblks;
1432 1430
1433 trace_xfs_link(tdp, target_name); 1431 trace_xfs_link(tdp, target_name);
@@ -1502,11 +1500,10 @@ xfs_link(
1502 * link transaction goes to disk before returning to 1500 * link transaction goes to disk before returning to
1503 * the user. 1501 * the user.
1504 */ 1502 */
1505 if (mp->m_flags & (XFS_MOUNT_WSYNC|XFS_MOUNT_DIRSYNC)) { 1503 if (mp->m_flags & (XFS_MOUNT_WSYNC|XFS_MOUNT_DIRSYNC))
1506 xfs_trans_set_sync(tp); 1504 xfs_trans_set_sync(tp);
1507 }
1508 1505
1509 error = xfs_bmap_finish (&tp, &free_list, &committed); 1506 error = xfs_bmap_finish(&tp, &free_list, NULL);
1510 if (error) { 1507 if (error) {
1511 xfs_bmap_cancel(&free_list); 1508 xfs_bmap_cancel(&free_list);
1512 goto error_return; 1509 goto error_return;
@@ -1555,7 +1552,6 @@ xfs_itruncate_extents(
1555 xfs_fileoff_t first_unmap_block; 1552 xfs_fileoff_t first_unmap_block;
1556 xfs_fileoff_t last_block; 1553 xfs_fileoff_t last_block;
1557 xfs_filblks_t unmap_len; 1554 xfs_filblks_t unmap_len;
1558 int committed;
1559 int error = 0; 1555 int error = 0;
1560 int done = 0; 1556 int done = 0;
1561 1557
@@ -1601,9 +1597,7 @@ xfs_itruncate_extents(
1601 * Duplicate the transaction that has the permanent 1597 * Duplicate the transaction that has the permanent
1602 * reservation and commit the old transaction. 1598 * reservation and commit the old transaction.
1603 */ 1599 */
1604 error = xfs_bmap_finish(&tp, &free_list, &committed); 1600 error = xfs_bmap_finish(&tp, &free_list, ip);
1605 if (committed)
1606 xfs_trans_ijoin(tp, ip, 0);
1607 if (error) 1601 if (error)
1608 goto out_bmap_cancel; 1602 goto out_bmap_cancel;
1609 1603
@@ -1774,7 +1768,6 @@ xfs_inactive_ifree(
1774{ 1768{
1775 xfs_bmap_free_t free_list; 1769 xfs_bmap_free_t free_list;
1776 xfs_fsblock_t first_block; 1770 xfs_fsblock_t first_block;
1777 int committed;
1778 struct xfs_mount *mp = ip->i_mount; 1771 struct xfs_mount *mp = ip->i_mount;
1779 struct xfs_trans *tp; 1772 struct xfs_trans *tp;
1780 int error; 1773 int error;
@@ -1841,7 +1834,7 @@ xfs_inactive_ifree(
1841 * Just ignore errors at this point. There is nothing we can do except 1834 * Just ignore errors at this point. There is nothing we can do except
1842 * to try to keep going. Make sure it's not a silent error. 1835 * to try to keep going. Make sure it's not a silent error.
1843 */ 1836 */
1844 error = xfs_bmap_finish(&tp, &free_list, &committed); 1837 error = xfs_bmap_finish(&tp, &free_list, NULL);
1845 if (error) { 1838 if (error) {
1846 xfs_notice(mp, "%s: xfs_bmap_finish returned error %d", 1839 xfs_notice(mp, "%s: xfs_bmap_finish returned error %d",
1847 __func__, error); 1840 __func__, error);
@@ -2523,7 +2516,6 @@ xfs_remove(
2523 int error = 0; 2516 int error = 0;
2524 xfs_bmap_free_t free_list; 2517 xfs_bmap_free_t free_list;
2525 xfs_fsblock_t first_block; 2518 xfs_fsblock_t first_block;
2526 int committed;
2527 uint resblks; 2519 uint resblks;
2528 2520
2529 trace_xfs_remove(dp, name); 2521 trace_xfs_remove(dp, name);
@@ -2624,7 +2616,7 @@ xfs_remove(
2624 if (mp->m_flags & (XFS_MOUNT_WSYNC|XFS_MOUNT_DIRSYNC)) 2616 if (mp->m_flags & (XFS_MOUNT_WSYNC|XFS_MOUNT_DIRSYNC))
2625 xfs_trans_set_sync(tp); 2617 xfs_trans_set_sync(tp);
2626 2618
2627 error = xfs_bmap_finish(&tp, &free_list, &committed); 2619 error = xfs_bmap_finish(&tp, &free_list, NULL);
2628 if (error) 2620 if (error)
2629 goto out_bmap_cancel; 2621 goto out_bmap_cancel;
2630 2622
@@ -2701,7 +2693,6 @@ xfs_finish_rename(
2701 struct xfs_trans *tp, 2693 struct xfs_trans *tp,
2702 struct xfs_bmap_free *free_list) 2694 struct xfs_bmap_free *free_list)
2703{ 2695{
2704 int committed = 0;
2705 int error; 2696 int error;
2706 2697
2707 /* 2698 /*
@@ -2711,7 +2702,7 @@ xfs_finish_rename(
2711 if (tp->t_mountp->m_flags & (XFS_MOUNT_WSYNC|XFS_MOUNT_DIRSYNC)) 2702 if (tp->t_mountp->m_flags & (XFS_MOUNT_WSYNC|XFS_MOUNT_DIRSYNC))
2712 xfs_trans_set_sync(tp); 2703 xfs_trans_set_sync(tp);
2713 2704
2714 error = xfs_bmap_finish(&tp, free_list, &committed); 2705 error = xfs_bmap_finish(&tp, free_list, NULL);
2715 if (error) { 2706 if (error) {
2716 xfs_bmap_cancel(free_list); 2707 xfs_bmap_cancel(free_list);
2717 xfs_trans_cancel(tp); 2708 xfs_trans_cancel(tp);
diff --git a/fs/xfs/xfs_iomap.c b/fs/xfs/xfs_iomap.c
index f4f5b43cf647..ffc7baf64cab 100644
--- a/fs/xfs/xfs_iomap.c
+++ b/fs/xfs/xfs_iomap.c
@@ -129,7 +129,6 @@ xfs_iomap_write_direct(
129 xfs_trans_t *tp; 129 xfs_trans_t *tp;
130 xfs_bmap_free_t free_list; 130 xfs_bmap_free_t free_list;
131 uint qblocks, resblks, resrtextents; 131 uint qblocks, resblks, resrtextents;
132 int committed;
133 int error; 132 int error;
134 int lockmode; 133 int lockmode;
135 int bmapi_flags = XFS_BMAPI_PREALLOC; 134 int bmapi_flags = XFS_BMAPI_PREALLOC;
@@ -247,7 +246,7 @@ xfs_iomap_write_direct(
247 /* 246 /*
248 * Complete the transaction 247 * Complete the transaction
249 */ 248 */
250 error = xfs_bmap_finish(&tp, &free_list, &committed); 249 error = xfs_bmap_finish(&tp, &free_list, NULL);
251 if (error) 250 if (error)
252 goto out_bmap_cancel; 251 goto out_bmap_cancel;
253 252
@@ -693,7 +692,7 @@ xfs_iomap_write_allocate(
693 xfs_bmap_free_t free_list; 692 xfs_bmap_free_t free_list;
694 xfs_filblks_t count_fsb; 693 xfs_filblks_t count_fsb;
695 xfs_trans_t *tp; 694 xfs_trans_t *tp;
696 int nimaps, committed; 695 int nimaps;
697 int error = 0; 696 int error = 0;
698 int nres; 697 int nres;
699 698
@@ -794,7 +793,7 @@ xfs_iomap_write_allocate(
794 if (error) 793 if (error)
795 goto trans_cancel; 794 goto trans_cancel;
796 795
797 error = xfs_bmap_finish(&tp, &free_list, &committed); 796 error = xfs_bmap_finish(&tp, &free_list, NULL);
798 if (error) 797 if (error)
799 goto trans_cancel; 798 goto trans_cancel;
800 799
@@ -852,7 +851,6 @@ xfs_iomap_write_unwritten(
852 xfs_bmap_free_t free_list; 851 xfs_bmap_free_t free_list;
853 xfs_fsize_t i_size; 852 xfs_fsize_t i_size;
854 uint resblks; 853 uint resblks;
855 int committed;
856 int error; 854 int error;
857 855
858 trace_xfs_unwritten_convert(ip, offset, count); 856 trace_xfs_unwritten_convert(ip, offset, count);
@@ -924,7 +922,7 @@ xfs_iomap_write_unwritten(
924 xfs_trans_log_inode(tp, ip, XFS_ILOG_CORE); 922 xfs_trans_log_inode(tp, ip, XFS_ILOG_CORE);
925 } 923 }
926 924
927 error = xfs_bmap_finish(&tp, &free_list, &committed); 925 error = xfs_bmap_finish(&tp, &free_list, NULL);
928 if (error) 926 if (error)
929 goto error_on_bmapi_transaction; 927 goto error_on_bmapi_transaction;
930 928
diff --git a/fs/xfs/xfs_rtalloc.c b/fs/xfs/xfs_rtalloc.c
index ab1bac6a3a1c..be02a68b2fe2 100644
--- a/fs/xfs/xfs_rtalloc.c
+++ b/fs/xfs/xfs_rtalloc.c
@@ -766,7 +766,6 @@ xfs_growfs_rt_alloc(
766{ 766{
767 xfs_fileoff_t bno; /* block number in file */ 767 xfs_fileoff_t bno; /* block number in file */
768 struct xfs_buf *bp; /* temporary buffer for zeroing */ 768 struct xfs_buf *bp; /* temporary buffer for zeroing */
769 int committed; /* transaction committed flag */
770 xfs_daddr_t d; /* disk block address */ 769 xfs_daddr_t d; /* disk block address */
771 int error; /* error return value */ 770 int error; /* error return value */
772 xfs_fsblock_t firstblock;/* first block allocated in xaction */ 771 xfs_fsblock_t firstblock;/* first block allocated in xaction */
@@ -811,7 +810,7 @@ xfs_growfs_rt_alloc(
811 /* 810 /*
812 * Free any blocks freed up in the transaction, then commit. 811 * Free any blocks freed up in the transaction, then commit.
813 */ 812 */
814 error = xfs_bmap_finish(&tp, &flist, &committed); 813 error = xfs_bmap_finish(&tp, &flist, NULL);
815 if (error) 814 if (error)
816 goto out_bmap_cancel; 815 goto out_bmap_cancel;
817 error = xfs_trans_commit(tp); 816 error = xfs_trans_commit(tp);
diff --git a/fs/xfs/xfs_symlink.c b/fs/xfs/xfs_symlink.c
index 996481eeb491..b44284c1adda 100644
--- a/fs/xfs/xfs_symlink.c
+++ b/fs/xfs/xfs_symlink.c
@@ -178,7 +178,6 @@ xfs_symlink(
178 struct xfs_bmap_free free_list; 178 struct xfs_bmap_free free_list;
179 xfs_fsblock_t first_block; 179 xfs_fsblock_t first_block;
180 bool unlock_dp_on_error = false; 180 bool unlock_dp_on_error = false;
181 int committed;
182 xfs_fileoff_t first_fsb; 181 xfs_fileoff_t first_fsb;
183 xfs_filblks_t fs_blocks; 182 xfs_filblks_t fs_blocks;
184 int nmaps; 183 int nmaps;
@@ -387,7 +386,7 @@ xfs_symlink(
387 xfs_trans_set_sync(tp); 386 xfs_trans_set_sync(tp);
388 } 387 }
389 388
390 error = xfs_bmap_finish(&tp, &free_list, &committed); 389 error = xfs_bmap_finish(&tp, &free_list, NULL);
391 if (error) 390 if (error)
392 goto out_bmap_cancel; 391 goto out_bmap_cancel;
393 392
@@ -434,7 +433,6 @@ xfs_inactive_symlink_rmt(
434 struct xfs_inode *ip) 433 struct xfs_inode *ip)
435{ 434{
436 xfs_buf_t *bp; 435 xfs_buf_t *bp;
437 int committed;
438 int done; 436 int done;
439 int error; 437 int error;
440 xfs_fsblock_t first_block; 438 xfs_fsblock_t first_block;
@@ -510,16 +508,10 @@ xfs_inactive_symlink_rmt(
510 /* 508 /*
511 * Commit the first transaction. This logs the EFI and the inode. 509 * Commit the first transaction. This logs the EFI and the inode.
512 */ 510 */
513 error = xfs_bmap_finish(&tp, &free_list, &committed); 511 error = xfs_bmap_finish(&tp, &free_list, ip);
514 if (error) 512 if (error)
515 goto error_bmap_cancel; 513 goto error_bmap_cancel;
516 /* 514 /*
517 * The transaction must have been committed, since there were
518 * actually extents freed by xfs_bunmapi. See xfs_bmap_finish.
519 * The new tp has the extent freeing and EFDs.
520 */
521 ASSERT(committed);
522 /*
523 * The first xact was committed, so add the inode to the new one. 515 * The first xact was committed, so add the inode to the new one.
524 * Mark it dirty so it will be logged and moved forward in the log as 516 * Mark it dirty so it will be logged and moved forward in the log as
525 * part of every commit. 517 * part of every commit.