Skip to content

Commit dde7f55

Browse files
committed
Merge branch 'xfs-misc-fixes-for-4.5-2' into for-next
2 parents 4922be5 + 7d6a13f commit dde7f55

18 files changed

+159
-234
lines changed

fs/xfs/libxfs/xfs_attr.c

Lines changed: 23 additions & 118 deletions
Original file line numberDiff line numberDiff line change
@@ -207,7 +207,7 @@ xfs_attr_set(
207207
struct xfs_trans_res tres;
208208
xfs_fsblock_t firstblock;
209209
int rsvd = (flags & ATTR_ROOT) != 0;
210-
int error, err2, committed, local;
210+
int error, err2, local;
211211

212212
XFS_STATS_INC(mp, xs_attr_set);
213213

@@ -334,24 +334,14 @@ xfs_attr_set(
334334
*/
335335
xfs_bmap_init(args.flist, args.firstblock);
336336
error = xfs_attr_shortform_to_leaf(&args);
337-
if (!error) {
338-
error = xfs_bmap_finish(&args.trans, args.flist,
339-
&committed);
340-
}
337+
if (!error)
338+
error = xfs_bmap_finish(&args.trans, args.flist, dp);
341339
if (error) {
342-
ASSERT(committed);
343340
args.trans = NULL;
344341
xfs_bmap_cancel(&flist);
345342
goto out;
346343
}
347344

348-
/*
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-
355345
/*
356346
* Commit the leaf transformation. We'll need another (linked)
357347
* transaction to add the new attribute to the leaf.
@@ -568,7 +558,7 @@ xfs_attr_leaf_addname(xfs_da_args_t *args)
568558
{
569559
xfs_inode_t *dp;
570560
struct xfs_buf *bp;
571-
int retval, error, committed, forkoff;
561+
int retval, error, forkoff;
572562

573563
trace_xfs_attr_leaf_addname(args);
574564

@@ -628,24 +618,14 @@ xfs_attr_leaf_addname(xfs_da_args_t *args)
628618
*/
629619
xfs_bmap_init(args->flist, args->firstblock);
630620
error = xfs_attr3_leaf_to_node(args);
631-
if (!error) {
632-
error = xfs_bmap_finish(&args->trans, args->flist,
633-
&committed);
634-
}
621+
if (!error)
622+
error = xfs_bmap_finish(&args->trans, args->flist, dp);
635623
if (error) {
636-
ASSERT(committed);
637624
args->trans = NULL;
638625
xfs_bmap_cancel(args->flist);
639626
return error;
640627
}
641628

642-
/*
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-
649629
/*
650630
* Commit the current trans (including the inode) and start
651631
* a new one.
@@ -729,25 +709,14 @@ xfs_attr_leaf_addname(xfs_da_args_t *args)
729709
xfs_bmap_init(args->flist, args->firstblock);
730710
error = xfs_attr3_leaf_to_shortform(bp, args, forkoff);
731711
/* bp is gone due to xfs_da_shrink_inode */
732-
if (!error) {
712+
if (!error)
733713
error = xfs_bmap_finish(&args->trans,
734-
args->flist,
735-
&committed);
736-
}
714+
args->flist, dp);
737715
if (error) {
738-
ASSERT(committed);
739716
args->trans = NULL;
740717
xfs_bmap_cancel(args->flist);
741718
return error;
742719
}
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);
751720
}
752721

753722
/*
@@ -775,7 +744,7 @@ xfs_attr_leaf_removename(xfs_da_args_t *args)
775744
{
776745
xfs_inode_t *dp;
777746
struct xfs_buf *bp;
778-
int error, committed, forkoff;
747+
int error, forkoff;
779748

780749
trace_xfs_attr_leaf_removename(args);
781750

@@ -803,23 +772,13 @@ xfs_attr_leaf_removename(xfs_da_args_t *args)
803772
xfs_bmap_init(args->flist, args->firstblock);
804773
error = xfs_attr3_leaf_to_shortform(bp, args, forkoff);
805774
/* bp is gone due to xfs_da_shrink_inode */
806-
if (!error) {
807-
error = xfs_bmap_finish(&args->trans, args->flist,
808-
&committed);
809-
}
775+
if (!error)
776+
error = xfs_bmap_finish(&args->trans, args->flist, dp);
810777
if (error) {
811-
ASSERT(committed);
812778
args->trans = NULL;
813779
xfs_bmap_cancel(args->flist);
814780
return error;
815781
}
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);
823782
}
824783
return 0;
825784
}
@@ -877,7 +836,7 @@ xfs_attr_node_addname(xfs_da_args_t *args)
877836
xfs_da_state_blk_t *blk;
878837
xfs_inode_t *dp;
879838
xfs_mount_t *mp;
880-
int committed, retval, error;
839+
int retval, error;
881840

882841
trace_xfs_attr_node_addname(args);
883842

@@ -938,26 +897,15 @@ xfs_attr_node_addname(xfs_da_args_t *args)
938897
state = NULL;
939898
xfs_bmap_init(args->flist, args->firstblock);
940899
error = xfs_attr3_leaf_to_node(args);
941-
if (!error) {
900+
if (!error)
942901
error = xfs_bmap_finish(&args->trans,
943-
args->flist,
944-
&committed);
945-
}
902+
args->flist, dp);
946903
if (error) {
947-
ASSERT(committed);
948904
args->trans = NULL;
949905
xfs_bmap_cancel(args->flist);
950906
goto out;
951907
}
952908

953-
/*
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-
961909
/*
962910
* Commit the node conversion and start the next
963911
* trans in the chain.
@@ -977,23 +925,13 @@ xfs_attr_node_addname(xfs_da_args_t *args)
977925
*/
978926
xfs_bmap_init(args->flist, args->firstblock);
979927
error = xfs_da3_split(state);
980-
if (!error) {
981-
error = xfs_bmap_finish(&args->trans, args->flist,
982-
&committed);
983-
}
928+
if (!error)
929+
error = xfs_bmap_finish(&args->trans, args->flist, dp);
984930
if (error) {
985-
ASSERT(committed);
986931
args->trans = NULL;
987932
xfs_bmap_cancel(args->flist);
988933
goto out;
989934
}
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);
997935
} else {
998936
/*
999937
* Addition succeeded, update Btree hashvals.
@@ -1086,25 +1024,14 @@ xfs_attr_node_addname(xfs_da_args_t *args)
10861024
if (retval && (state->path.active > 1)) {
10871025
xfs_bmap_init(args->flist, args->firstblock);
10881026
error = xfs_da3_join(state);
1089-
if (!error) {
1027+
if (!error)
10901028
error = xfs_bmap_finish(&args->trans,
1091-
args->flist,
1092-
&committed);
1093-
}
1029+
args->flist, dp);
10941030
if (error) {
1095-
ASSERT(committed);
10961031
args->trans = NULL;
10971032
xfs_bmap_cancel(args->flist);
10981033
goto out;
10991034
}
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);
11081035
}
11091036

11101037
/*
@@ -1146,7 +1073,7 @@ xfs_attr_node_removename(xfs_da_args_t *args)
11461073
xfs_da_state_blk_t *blk;
11471074
xfs_inode_t *dp;
11481075
struct xfs_buf *bp;
1149-
int retval, error, committed, forkoff;
1076+
int retval, error, forkoff;
11501077

11511078
trace_xfs_attr_node_removename(args);
11521079

@@ -1220,24 +1147,13 @@ xfs_attr_node_removename(xfs_da_args_t *args)
12201147
if (retval && (state->path.active > 1)) {
12211148
xfs_bmap_init(args->flist, args->firstblock);
12221149
error = xfs_da3_join(state);
1223-
if (!error) {
1224-
error = xfs_bmap_finish(&args->trans, args->flist,
1225-
&committed);
1226-
}
1150+
if (!error)
1151+
error = xfs_bmap_finish(&args->trans, args->flist, dp);
12271152
if (error) {
1228-
ASSERT(committed);
12291153
args->trans = NULL;
12301154
xfs_bmap_cancel(args->flist);
12311155
goto out;
12321156
}
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-
12411157
/*
12421158
* Commit the Btree join operation and start a new trans.
12431159
*/
@@ -1265,25 +1181,14 @@ xfs_attr_node_removename(xfs_da_args_t *args)
12651181
xfs_bmap_init(args->flist, args->firstblock);
12661182
error = xfs_attr3_leaf_to_shortform(bp, args, forkoff);
12671183
/* bp is gone due to xfs_da_shrink_inode */
1268-
if (!error) {
1184+
if (!error)
12691185
error = xfs_bmap_finish(&args->trans,
1270-
args->flist,
1271-
&committed);
1272-
}
1186+
args->flist, dp);
12731187
if (error) {
1274-
ASSERT(committed);
12751188
args->trans = NULL;
12761189
xfs_bmap_cancel(args->flist);
12771190
goto out;
12781191
}
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);
12871192
} else
12881193
xfs_trans_brelse(args->trans, bp);
12891194
}

fs/xfs/libxfs/xfs_attr_remote.c

Lines changed: 4 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -448,8 +448,6 @@ xfs_attr_rmtval_set(
448448
* Roll through the "value", allocating blocks on disk as required.
449449
*/
450450
while (blkcnt > 0) {
451-
int committed;
452-
453451
/*
454452
* Allocate a single extent, up to the size of the value.
455453
*
@@ -467,24 +465,14 @@ xfs_attr_rmtval_set(
467465
error = xfs_bmapi_write(args->trans, dp, (xfs_fileoff_t)lblkno,
468466
blkcnt, XFS_BMAPI_ATTRFORK, args->firstblock,
469467
args->total, &map, &nmap, args->flist);
470-
if (!error) {
471-
error = xfs_bmap_finish(&args->trans, args->flist,
472-
&committed);
473-
}
468+
if (!error)
469+
error = xfs_bmap_finish(&args->trans, args->flist, dp);
474470
if (error) {
475-
ASSERT(committed);
476471
args->trans = NULL;
477472
xfs_bmap_cancel(args->flist);
478473
return error;
479474
}
480475

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-
488476
ASSERT(nmap == 1);
489477
ASSERT((map.br_startblock != DELAYSTARTBLOCK) &&
490478
(map.br_startblock != HOLESTARTBLOCK));
@@ -615,30 +603,19 @@ xfs_attr_rmtval_remove(
615603
blkcnt = args->rmtblkcnt;
616604
done = 0;
617605
while (!done) {
618-
int committed;
619-
620606
xfs_bmap_init(args->flist, args->firstblock);
621607
error = xfs_bunmapi(args->trans, args->dp, lblkno, blkcnt,
622608
XFS_BMAPI_ATTRFORK, 1, args->firstblock,
623609
args->flist, &done);
624-
if (!error) {
610+
if (!error)
625611
error = xfs_bmap_finish(&args->trans, args->flist,
626-
&committed);
627-
}
612+
args->dp);
628613
if (error) {
629-
ASSERT(committed);
630614
args->trans = NULL;
631615
xfs_bmap_cancel(args->flist);
632616
return error;
633617
}
634618

635-
/*
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-
642619
/*
643620
* Close out trans and start the next one in the chain.
644621
*/

0 commit comments

Comments
 (0)