/*
                 * If the result is small enough, shrink it all into the inode.
                 */
-               if ((forkoff = xfs_attr_shortform_allfit(bp, dp))) {
+               forkoff = xfs_attr_shortform_allfit(bp, dp);
+               if (forkoff)
                        error = xfs_attr3_leaf_to_shortform(bp, args, forkoff);
                        /* bp is gone due to xfs_da_shrink_inode */
-                       if (error)
-                               return error;
-                       error = xfs_defer_finish(&args->trans);
-                       if (error)
-                               return error;
-               }
-
-               /*
-                * Commit the remove and start the next trans in series.
-                */
-               error = xfs_trans_roll_inode(&args->trans, dp);
-
        } else if (args->rmtblkno > 0) {
                /*
                 * Added a "remote" value, just clear the incomplete flag.
                 */
                error = xfs_attr3_leaf_clearflag(args);
-               if (error)
-                       return error;
-
-               /*
-                * Commit the flag value change and start the next trans in
-                * series.
-                */
-               error = xfs_trans_roll_inode(&args->trans, args->dp);
        }
        return error;
 }
        /*
         * If the result is small enough, shrink it all into the inode.
         */
-       if ((forkoff = xfs_attr_shortform_allfit(bp, dp))) {
-               error = xfs_attr3_leaf_to_shortform(bp, args, forkoff);
+       forkoff = xfs_attr_shortform_allfit(bp, dp);
+       if (forkoff)
+               return xfs_attr3_leaf_to_shortform(bp, args, forkoff);
                /* bp is gone due to xfs_da_shrink_inode */
-               if (error)
-                       return error;
-               error = xfs_defer_finish(&args->trans);
-               if (error)
-                       return error;
-       }
+
        return 0;
 }
 
                        error = xfs_da3_join(state);
                        if (error)
                                goto out;
-                       error = xfs_defer_finish(&args->trans);
-                       if (error)
-                               goto out;
                }
 
-               /*
-                * Commit and start the next trans in the chain.
-                */
-               error = xfs_trans_roll_inode(&args->trans, dp);
-               if (error)
-                       goto out;
-
        } else if (args->rmtblkno > 0) {
                /*
                 * Added a "remote" value, just clear the incomplete flag.
                error = xfs_attr3_leaf_clearflag(args);
                if (error)
                        goto out;
-
-                /*
-                 * Commit the flag value change and start the next trans in
-                 * series.
-                 */
-               error = xfs_trans_roll_inode(&args->trans, args->dp);
-               if (error)
-                       goto out;
        }
        retval = error = 0;
 
        if (forkoff) {
                error = xfs_attr3_leaf_to_shortform(bp, args, forkoff);
                /* bp is gone due to xfs_da_shrink_inode */
-               if (error)
-                       return error;
-
-               error = xfs_defer_finish(&args->trans);
-               if (error)
-                       return error;
        } else
                xfs_trans_brelse(args->trans, bp);
 
-       return 0;
+       return error;
 }
 
 /*