Skip to content

Commit

Permalink
Merge tag 'xfs-4.14-merge-7' of git://git.kernel.org/pub/scm/fs/xfs/x…
Browse files Browse the repository at this point in the history
…fs-linux

Pull XFS updates from Darrick Wong:
 "Here are the changes for xfs for 4.14. Most of these are cleanups and
  fixes for bad behavior, as we're mostly focusing on improving
  reliablity this cycle (read: there's potentially a lot of stuff on the
  horizon for 4.15 so better to spend a few weeks killing other bugs
  now).

  Summary:

   - Write unmount record for a ro mount to avoid unnecessary log replay

   - Clean up orphaned inodes when mounting fs readonly

   - Resubmit inode log items when buffer writeback fails to avoid
     umount hang

   - Fix log recovery corruption problems when log headers wrap around
     the end

   - Avoid infinite loop searching for free inodes when inode counters
     are wrong

   - Evict inodes involved with log redo so that we don't leak them
     later

   - Fix a potential race between reclaim and inode cluster freeing

   - Refactor the inode joining code w.r.t. transaction rolling &
     deferred ops

   - Fix a bug where the log doesn't properly deal with dirty buffers
     that are about to become ordered buffers

   - Fix the extent swap code to deal with making dirty buffers ordered
     properly

   - Consolidate page fault handlers

   - Refactor the incore extent manipulation functions to use the iext
     abstractions instead of directly modifying with extent data

   - Disable crashy chattr +/-x until we fix it

   - Don't allow us to set S_DAX for v2 inodes

   - Various cleanups

   - Clarify some documentation

   - Fix a problem where fsync and a log commit race to send the disk a
     flush command, resulting in a small window where power fail data
     loss could occur

   - Simplify some rmap operations in the fcollapse code

   - Fix some use-after-free problems in async writeback"

* tag 'xfs-4.14-merge-7' of git://git.kernel.org/pub/scm/fs/xfs/xfs-linux: (44 commits)
  xfs: use kmem_free to free return value of kmem_zalloc
  xfs: open code end_buffer_async_write in xfs_finish_page_writeback
  xfs: don't set v3 xflags for v2 inodes
  xfs: fix compiler warnings
  fsmap: fix documentation of FMR_OF_LAST
  xfs: simplify the rmap code in xfs_bmse_merge
  xfs: remove unused flags arg from xfs_file_iomap_begin_delay
  xfs: fix incorrect log_flushed on fsync
  xfs: disable per-inode DAX flag
  xfs: replace xfs_qm_get_rtblks with a direct call to xfs_bmap_count_leaves
  xfs: rewrite xfs_bmap_count_leaves using xfs_iext_get_extent
  xfs: use xfs_iext_*_extent helpers in xfs_bmap_split_extent_at
  xfs: use xfs_iext_*_extent helpers in xfs_bmap_shift_extents
  xfs: move some code around inside xfs_bmap_shift_extents
  xfs: use xfs_iext_get_extent in xfs_bmap_first_unused
  xfs: switch xfs_bmap_local_to_extents to use xfs_iext_insert
  xfs: add a xfs_iext_update_extent helper
  xfs: consolidate the various page fault handlers
  iomap: return VM_FAULT_* codes from iomap_page_mkwrite
  xfs: relog dirty buffers during swapext bmbt owner change
  ...
  • Loading branch information
Linus Torvalds committed Sep 6, 2017
2 parents 77d0ab6 + 6c37059 commit 5791577
Show file tree
Hide file tree
Showing 50 changed files with 1,027 additions and 709 deletions.
1 change: 1 addition & 0 deletions fs/inode.c
Original file line number Diff line number Diff line change
Expand Up @@ -637,6 +637,7 @@ void evict_inodes(struct super_block *sb)

dispose_list(&dispose);
}
EXPORT_SYMBOL_GPL(evict_inodes);

/**
* invalidate_inodes - attempt to free all inodes on a superblock
Expand Down
1 change: 0 additions & 1 deletion fs/internal.h
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,6 @@ static inline bool atime_needs_update_rcu(const struct path *path,
extern void inode_io_list_del(struct inode *inode);

extern long get_nr_dirty_inodes(void);
extern void evict_inodes(struct super_block *);
extern int invalidate_inodes(struct super_block *, bool);

/*
Expand Down
4 changes: 2 additions & 2 deletions fs/iomap.c
Original file line number Diff line number Diff line change
Expand Up @@ -477,10 +477,10 @@ int iomap_page_mkwrite(struct vm_fault *vmf, const struct iomap_ops *ops)

set_page_dirty(page);
wait_for_stable_page(page);
return 0;
return VM_FAULT_LOCKED;
out_unlock:
unlock_page(page);
return ret;
return block_page_mkwrite_return(ret);
}
EXPORT_SYMBOL_GPL(iomap_page_mkwrite);

Expand Down
156 changes: 81 additions & 75 deletions fs/xfs/libxfs/xfs_attr.c
Original file line number Diff line number Diff line change
Expand Up @@ -328,20 +328,19 @@ xfs_attr_set(
*/
xfs_defer_init(args.dfops, args.firstblock);
error = xfs_attr_shortform_to_leaf(&args);
if (!error)
error = xfs_defer_finish(&args.trans, args.dfops, dp);
if (error) {
args.trans = NULL;
xfs_defer_cancel(&dfops);
goto out;
}
if (error)
goto out_defer_cancel;
xfs_defer_ijoin(args.dfops, dp);
error = xfs_defer_finish(&args.trans, args.dfops);
if (error)
goto out_defer_cancel;

/*
* Commit the leaf transformation. We'll need another (linked)
* transaction to add the new attribute to the leaf.
*/

error = xfs_trans_roll(&args.trans, dp);
error = xfs_trans_roll_inode(&args.trans, dp);
if (error)
goto out;

Expand Down Expand Up @@ -373,6 +372,9 @@ xfs_attr_set(

return error;

out_defer_cancel:
xfs_defer_cancel(&dfops);
args.trans = NULL;
out:
if (args.trans)
xfs_trans_cancel(args.trans);
Expand Down Expand Up @@ -593,19 +595,18 @@ xfs_attr_leaf_addname(xfs_da_args_t *args)
*/
xfs_defer_init(args->dfops, args->firstblock);
error = xfs_attr3_leaf_to_node(args);
if (!error)
error = xfs_defer_finish(&args->trans, args->dfops, dp);
if (error) {
args->trans = NULL;
xfs_defer_cancel(args->dfops);
return error;
}
if (error)
goto out_defer_cancel;
xfs_defer_ijoin(args->dfops, dp);
error = xfs_defer_finish(&args->trans, args->dfops);
if (error)
goto out_defer_cancel;

/*
* Commit the current trans (including the inode) and start
* a new one.
*/
error = xfs_trans_roll(&args->trans, dp);
error = xfs_trans_roll_inode(&args->trans, dp);
if (error)
return error;

Expand All @@ -620,7 +621,7 @@ xfs_attr_leaf_addname(xfs_da_args_t *args)
* Commit the transaction that added the attr name so that
* later routines can manage their own transactions.
*/
error = xfs_trans_roll(&args->trans, dp);
error = xfs_trans_roll_inode(&args->trans, dp);
if (error)
return error;

Expand Down Expand Up @@ -684,20 +685,18 @@ xfs_attr_leaf_addname(xfs_da_args_t *args)
xfs_defer_init(args->dfops, args->firstblock);
error = xfs_attr3_leaf_to_shortform(bp, args, forkoff);
/* bp is gone due to xfs_da_shrink_inode */
if (!error)
error = xfs_defer_finish(&args->trans,
args->dfops, dp);
if (error) {
args->trans = NULL;
xfs_defer_cancel(args->dfops);
return error;
}
if (error)
goto out_defer_cancel;
xfs_defer_ijoin(args->dfops, dp);
error = xfs_defer_finish(&args->trans, args->dfops);
if (error)
goto out_defer_cancel;
}

/*
* Commit the remove and start the next trans in series.
*/
error = xfs_trans_roll(&args->trans, dp);
error = xfs_trans_roll_inode(&args->trans, dp);

} else if (args->rmtblkno > 0) {
/*
Expand All @@ -706,6 +705,10 @@ xfs_attr_leaf_addname(xfs_da_args_t *args)
error = xfs_attr3_leaf_clearflag(args);
}
return error;
out_defer_cancel:
xfs_defer_cancel(args->dfops);
args->trans = NULL;
return error;
}

/*
Expand Down Expand Up @@ -747,15 +750,18 @@ xfs_attr_leaf_removename(xfs_da_args_t *args)
xfs_defer_init(args->dfops, args->firstblock);
error = xfs_attr3_leaf_to_shortform(bp, args, forkoff);
/* bp is gone due to xfs_da_shrink_inode */
if (!error)
error = xfs_defer_finish(&args->trans, args->dfops, dp);
if (error) {
args->trans = NULL;
xfs_defer_cancel(args->dfops);
return error;
}
if (error)
goto out_defer_cancel;
xfs_defer_ijoin(args->dfops, dp);
error = xfs_defer_finish(&args->trans, args->dfops);
if (error)
goto out_defer_cancel;
}
return 0;
out_defer_cancel:
xfs_defer_cancel(args->dfops);
args->trans = NULL;
return error;
}

/*
Expand Down Expand Up @@ -872,20 +878,18 @@ xfs_attr_node_addname(xfs_da_args_t *args)
state = NULL;
xfs_defer_init(args->dfops, args->firstblock);
error = xfs_attr3_leaf_to_node(args);
if (!error)
error = xfs_defer_finish(&args->trans,
args->dfops, dp);
if (error) {
args->trans = NULL;
xfs_defer_cancel(args->dfops);
goto out;
}
if (error)
goto out_defer_cancel;
xfs_defer_ijoin(args->dfops, dp);
error = xfs_defer_finish(&args->trans, args->dfops);
if (error)
goto out_defer_cancel;

/*
* Commit the node conversion and start the next
* trans in the chain.
*/
error = xfs_trans_roll(&args->trans, dp);
error = xfs_trans_roll_inode(&args->trans, dp);
if (error)
goto out;

Expand All @@ -900,13 +904,12 @@ xfs_attr_node_addname(xfs_da_args_t *args)
*/
xfs_defer_init(args->dfops, args->firstblock);
error = xfs_da3_split(state);
if (!error)
error = xfs_defer_finish(&args->trans, args->dfops, dp);
if (error) {
args->trans = NULL;
xfs_defer_cancel(args->dfops);
goto out;
}
if (error)
goto out_defer_cancel;
xfs_defer_ijoin(args->dfops, dp);
error = xfs_defer_finish(&args->trans, args->dfops);
if (error)
goto out_defer_cancel;
} else {
/*
* Addition succeeded, update Btree hashvals.
Expand All @@ -925,7 +928,7 @@ xfs_attr_node_addname(xfs_da_args_t *args)
* Commit the leaf addition or btree split and start the next
* trans in the chain.
*/
error = xfs_trans_roll(&args->trans, dp);
error = xfs_trans_roll_inode(&args->trans, dp);
if (error)
goto out;

Expand Down Expand Up @@ -999,20 +1002,18 @@ xfs_attr_node_addname(xfs_da_args_t *args)
if (retval && (state->path.active > 1)) {
xfs_defer_init(args->dfops, args->firstblock);
error = xfs_da3_join(state);
if (!error)
error = xfs_defer_finish(&args->trans,
args->dfops, dp);
if (error) {
args->trans = NULL;
xfs_defer_cancel(args->dfops);
goto out;
}
if (error)
goto out_defer_cancel;
xfs_defer_ijoin(args->dfops, dp);
error = xfs_defer_finish(&args->trans, args->dfops);
if (error)
goto out_defer_cancel;
}

/*
* Commit and start the next trans in the chain.
*/
error = xfs_trans_roll(&args->trans, dp);
error = xfs_trans_roll_inode(&args->trans, dp);
if (error)
goto out;

Expand All @@ -1032,6 +1033,10 @@ xfs_attr_node_addname(xfs_da_args_t *args)
if (error)
return error;
return retval;
out_defer_cancel:
xfs_defer_cancel(args->dfops);
args->trans = NULL;
goto out;
}

/*
Expand Down Expand Up @@ -1122,17 +1127,16 @@ xfs_attr_node_removename(xfs_da_args_t *args)
if (retval && (state->path.active > 1)) {
xfs_defer_init(args->dfops, args->firstblock);
error = xfs_da3_join(state);
if (!error)
error = xfs_defer_finish(&args->trans, args->dfops, dp);
if (error) {
args->trans = NULL;
xfs_defer_cancel(args->dfops);
goto out;
}
if (error)
goto out_defer_cancel;
xfs_defer_ijoin(args->dfops, dp);
error = xfs_defer_finish(&args->trans, args->dfops);
if (error)
goto out_defer_cancel;
/*
* Commit the Btree join operation and start a new trans.
*/
error = xfs_trans_roll(&args->trans, dp);
error = xfs_trans_roll_inode(&args->trans, dp);
if (error)
goto out;
}
Expand All @@ -1156,14 +1160,12 @@ xfs_attr_node_removename(xfs_da_args_t *args)
xfs_defer_init(args->dfops, args->firstblock);
error = xfs_attr3_leaf_to_shortform(bp, args, forkoff);
/* bp is gone due to xfs_da_shrink_inode */
if (!error)
error = xfs_defer_finish(&args->trans,
args->dfops, dp);
if (error) {
args->trans = NULL;
xfs_defer_cancel(args->dfops);
goto out;
}
if (error)
goto out_defer_cancel;
xfs_defer_ijoin(args->dfops, dp);
error = xfs_defer_finish(&args->trans, args->dfops);
if (error)
goto out_defer_cancel;
} else
xfs_trans_brelse(args->trans, bp);
}
Expand All @@ -1172,6 +1174,10 @@ xfs_attr_node_removename(xfs_da_args_t *args)
out:
xfs_da_state_free(state);
return error;
out_defer_cancel:
xfs_defer_cancel(args->dfops);
args->trans = NULL;
goto out;
}

/*
Expand Down
6 changes: 3 additions & 3 deletions fs/xfs/libxfs/xfs_attr_leaf.c
Original file line number Diff line number Diff line change
Expand Up @@ -2608,7 +2608,7 @@ xfs_attr3_leaf_clearflag(
/*
* Commit the flag value change and start the next trans in series.
*/
return xfs_trans_roll(&args->trans, args->dp);
return xfs_trans_roll_inode(&args->trans, args->dp);
}

/*
Expand Down Expand Up @@ -2659,7 +2659,7 @@ xfs_attr3_leaf_setflag(
/*
* Commit the flag value change and start the next trans in series.
*/
return xfs_trans_roll(&args->trans, args->dp);
return xfs_trans_roll_inode(&args->trans, args->dp);
}

/*
Expand Down Expand Up @@ -2777,7 +2777,7 @@ xfs_attr3_leaf_flipflags(
/*
* Commit the flag value change and start the next trans in series.
*/
error = xfs_trans_roll(&args->trans, args->dp);
error = xfs_trans_roll_inode(&args->trans, args->dp);

return error;
}
Loading

0 comments on commit 5791577

Please sign in to comment.