linux/fs/xfs/libxfs
Brian Foster a6f485908d xfs: include inobt buffers in ifree tx log reservation
The tr_ifree transaction handles inode unlinks and inode chunk
frees. The current transaction calculation does not accurately
reflect worst case changes to the inode btree, however. The inobt
portion of the current transaction reservation only covers
modification of a single inobt buffer (for the particular inode
record). This is a historical artifact from the days before XFS
supported full inode chunk removal.

When support for inode chunk removal was added in commit
254f6311ed1b ("Implement deletion of inode clusters in XFS."), the
additional log reservation required for chunk removal was not added
correctly. The new reservation only considered the header overhead
of associated buffers rather than the full contents of the btrees
and AGF and AGFL buffers affected by the transaction. The
reservation for the free space btrees was subsequently fixed up in
commit 5fe6abb82f76 ("Add space for inode and allocation btrees to
ITRUNCATE log reservation"), but the res. for full inobt joins has
never been added.

Further review of the ifree reservation uncovered a couple more
problems:

- The undocumented +2 blocks are intended for the AGF and AGFL, but
  are also not sized correctly and should be logged as full sectors
  (not FSBs).
- The additional single block header is undocumented and serves no
  apparent purpose.

Update xfs_calc_ifree_reservation() to include a full inobt join in
the reservation calculation. Refactor the undocumented blocks
appropriately and fix up the comments to reflect the current
calculation.

Signed-off-by: Brian Foster <bfoster@redhat.com>
Reviewed-by: Dave Chinner <dchinner@redhat.com>
Reviewed-by: Darrick J. Wong <darrick.wong@oracle.com>
Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
2018-01-08 10:41:36 -08:00
..
xfs_ag_resv.c xfs: move error injection tags into their own file 2017-11-01 15:03:16 -07:00
xfs_ag_resv.h xfs: set up per-AG free space reservations 2016-09-19 10:30:52 +10:00
xfs_alloc_btree.c xfs: always compile the btree inorder check functions 2017-06-19 14:11:33 -07:00
xfs_alloc_btree.h libxfs: move header files 2014-06-25 14:57:36 +10:00
xfs_alloc.c xfs: always honor OWN_UNKNOWN rmap removal requests 2017-12-21 08:48:38 -08:00
xfs_alloc.h xfs: create block pointer check functions 2017-10-26 15:38:23 -07:00
xfs_attr_leaf.c xfs: hold xfs_buf locked between shortform->leaf conversion and the addition of an attribute 2017-12-14 09:18:12 -08:00
xfs_attr_leaf.h xfs: hold xfs_buf locked between shortform->leaf conversion and the addition of an attribute 2017-12-14 09:18:12 -08:00
xfs_attr_remote.c xfs: remove the ip argument to xfs_defer_finish 2017-09-01 10:55:30 -07:00
xfs_attr_remote.h libxfs: move header files 2014-06-25 14:57:36 +10:00
xfs_attr_sf.h xfs: remove double-underscore integer types 2017-06-19 14:11:33 -07:00
xfs_attr.c xfs: hold xfs_buf locked between shortform->leaf conversion and the addition of an attribute 2017-12-14 09:18:12 -08:00
xfs_bit.c libxfs: Optimize the loop for xfs_bitmap_empty 2016-01-04 16:10:19 +11:00
xfs_bit.h xfs: remove double-underscore integer types 2017-06-19 14:11:33 -07:00
xfs_bmap_btree.c xfs: use a b+tree for the in-core extent list 2017-11-06 11:53:41 -08:00
xfs_bmap_btree.h xfs: pass struct xfs_bmbt_irec to xfs_bmbt_validate_extent 2017-11-06 11:53:41 -08:00
xfs_bmap.c xfs: account for null transactions in bunmapi 2017-12-14 09:20:10 -08:00
xfs_bmap.h xfs: simplify xfs_reflink_convert_cow 2017-11-06 11:53:40 -08:00
xfs_btree.c xfs: mark xfs_btree_check_lblock and xfs_btree_check_ptr static 2017-11-06 11:57:39 -08:00
xfs_btree.h xfs: compare btree block keys to parent block's keys during scrub 2017-10-27 09:20:31 -07:00
xfs_cksum.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
xfs_da_btree.c xfs: abort dir/attr btree operation if btree is obviously weird 2017-10-27 09:20:31 -07:00
xfs_da_btree.h xfs: remove double-underscore integer types 2017-06-19 14:11:33 -07:00
xfs_da_format.c xfs: remove double-underscore integer types 2017-06-19 14:11:33 -07:00
xfs_da_format.h xfs: remove double-underscore integer types 2017-06-19 14:11:33 -07:00
xfs_defer.c xfs: add the ability to join a held buffer to a defer_ops 2017-12-14 09:17:35 -08:00
xfs_defer.h xfs: add the ability to join a held buffer to a defer_ops 2017-12-14 09:17:35 -08:00
xfs_dir2_block.c xfs: don't crash on unexpected holes in dir/attr btrees 2017-07-07 18:55:17 -07:00
xfs_dir2_data.c xfs: check that dir block entries don't off the end of the buffer 2017-07-25 08:36:35 -07:00
xfs_dir2_leaf.c xfs: don't crash on unexpected holes in dir/attr btrees 2017-07-07 18:55:17 -07:00
xfs_dir2_node.c xfs: return the hash value of a leaf1 directory block 2017-06-20 10:45:21 -07:00
xfs_dir2_priv.h xfs: pass along transaction context when reading directory block buffers 2017-06-20 10:45:22 -07:00
xfs_dir2_sf.c xfs: remove double-underscore integer types 2017-06-19 14:11:33 -07:00
xfs_dir2.c xfs: move error injection tags into their own file 2017-11-01 15:03:16 -07:00
xfs_dir2.h xfs: scrub directory metadata 2017-10-26 15:38:25 -07:00
xfs_dquot_buf.c xfs: simplify xfs_calc_dquots_per_chunk 2017-04-12 08:42:51 -07:00
xfs_errortag.h xfs: move error injection tags into their own file 2017-11-01 15:03:16 -07:00
xfs_format.h xfs: remove u_int* type usage 2017-11-09 15:50:29 -08:00
xfs_fs.h xfs: scrub quota information 2017-10-26 15:38:26 -07:00
xfs_ialloc_btree.c xfs: plumb in needed functions for range querying of various btrees 2017-06-19 14:11:34 -07:00
xfs_ialloc_btree.h xfs: use per-AG reservations for the finobt 2017-01-25 07:49:35 -08:00
xfs_ialloc.c xfs: remove "no-allocation" reservations for file creations 2017-12-08 17:51:05 -08:00
xfs_ialloc.h xfs: remove "no-allocation" reservations for file creations 2017-12-08 17:51:05 -08:00
xfs_iext_tree.c xfs: move xfs_iext_insert tracepoint to report useful information 2017-12-14 09:20:11 -08:00
xfs_inode_buf.c xfs: move error injection tags into their own file 2017-11-01 15:03:16 -07:00
xfs_inode_buf.h xfs: export various function for the online scrubber 2017-06-19 14:11:34 -07:00
xfs_inode_fork.c xfs: abstract out dev_t conversions 2017-11-21 01:44:53 -08:00
xfs_inode_fork.h xfs: remove the nr_extents argument to xfs_iext_remove 2017-11-06 11:53:41 -08:00
xfs_log_format.h xfs: fix type usage 2017-11-16 12:06:45 -08:00
xfs_log_recover.h xfs: remove double-underscore integer types 2017-06-19 14:11:33 -07:00
xfs_log_rlimit.c xfs: move most of xfs_sb.h to xfs_format.h 2014-11-28 14:27:09 +11:00
xfs_quota_defs.h Revert "xfs: grab dquots without taking the ilock" 2017-07-13 14:55:05 -07:00
xfs_refcount_btree.c xfs: always compile the btree inorder check functions 2017-06-19 14:11:33 -07:00
xfs_refcount_btree.h xfs: use the actual AG length when reserving blocks 2017-01-03 18:39:33 -08:00
xfs_refcount.c xfs: queue deferred rmap ops for cow staging extent alloc/free in the right order 2017-12-21 08:48:38 -08:00
xfs_refcount.h xfs: try to avoid blowing out the transaction reservation when bunmaping a shared extent 2017-06-19 08:59:10 -07:00
xfs_rmap_btree.c xfs: always compile the btree inorder check functions 2017-06-19 14:11:33 -07:00
xfs_rmap_btree.h xfs: use the actual AG length when reserving blocks 2017-01-03 18:39:33 -08:00
xfs_rmap.c xfs: only skip rmap owner checks for unknown-owner rmap removal 2017-12-21 08:48:38 -08:00
xfs_rmap.h xfs: always honor OWN_UNKNOWN rmap removal requests 2017-12-21 08:48:38 -08:00
xfs_rtbitmap.c xfs: remove redundant assignment to variable bit 2017-10-31 12:03:35 -07:00
xfs_sb.c xfs: remove double-underscore integer types 2017-06-19 14:11:33 -07:00
xfs_sb.h xfs: remove unused function definitions 2016-02-08 14:58:07 +11:00
xfs_shared.h xfs: define the on-disk refcount btree format 2016-10-03 09:11:18 -07:00
xfs_symlink_remote.c xfs: rename MAXPATHLEN to XFS_SYMLINK_MAXLEN 2017-07-07 08:37:26 -07:00
xfs_trans_resv.c xfs: include inobt buffers in ifree tx log reservation 2018-01-08 10:41:36 -08:00
xfs_trans_resv.h xfs: increase log reservations for reflink 2016-10-05 16:26:29 -07:00
xfs_trans_space.h xfs: reserve enough blocks to handle btree splits when remapping 2017-05-03 13:21:40 -07:00
xfs_types.h xfs: move xfs_bmbt_irec and xfs_exntst_t to xfs_types.h 2017-11-06 11:53:41 -08:00