Commit 70f8c6f8 authored by Linus Torvalds's avatar Linus Torvalds

Merge tag 'xfs-6.6-fixes-5' of git://git.kernel.org/pub/scm/fs/xfs/xfs-linux

Pull xfs fixes from Chandan Babu:

 - Fix calculation of offset of AG's last block and its length

 - Update incore AG block count when shrinking an AG

 - Process free extents to busy list in FIFO order

 - Make XFS report its i_version as the STATX_CHANGE_COOKIE

* tag 'xfs-6.6-fixes-5' of git://git.kernel.org/pub/scm/fs/xfs/xfs-linux:
  xfs: reinstate the old i_version counter as STATX_CHANGE_COOKIE
  xfs: Remove duplicate include
  xfs: correct calculation for agend and blockcount
  xfs: process free extents to busy list in FIFO order
  xfs: adjust the incore perag block_count when shrinking
parents 727fb837 cbc06310
...@@ -1001,6 +1001,12 @@ xfs_ag_shrink_space( ...@@ -1001,6 +1001,12 @@ xfs_ag_shrink_space(
error = -ENOSPC; error = -ENOSPC;
goto resv_init_out; goto resv_init_out;
} }
/* Update perag geometry */
pag->block_count -= delta;
__xfs_agino_range(pag->pag_mount, pag->block_count, &pag->agino_min,
&pag->agino_max);
xfs_ialloc_log_agi(*tpp, agibp, XFS_AGI_LENGTH); xfs_ialloc_log_agi(*tpp, agibp, XFS_AGI_LENGTH);
xfs_alloc_log_agf(*tpp, agfbp, XFS_AGF_LENGTH); xfs_alloc_log_agf(*tpp, agfbp, XFS_AGF_LENGTH);
return 0; return 0;
......
...@@ -10,7 +10,6 @@ ...@@ -10,7 +10,6 @@
#include "xfs_log_format.h" #include "xfs_log_format.h"
#include "xfs_trans_resv.h" #include "xfs_trans_resv.h"
#include "xfs_mount.h" #include "xfs_mount.h"
#include "xfs_format.h"
#include "scrub/xfile.h" #include "scrub/xfile.h"
#include "scrub/xfarray.h" #include "scrub/xfarray.h"
#include "scrub/scrub.h" #include "scrub/scrub.h"
......
...@@ -62,7 +62,8 @@ xfs_extent_busy_insert_list( ...@@ -62,7 +62,8 @@ xfs_extent_busy_insert_list(
rb_link_node(&new->rb_node, parent, rbp); rb_link_node(&new->rb_node, parent, rbp);
rb_insert_color(&new->rb_node, &pag->pagb_tree); rb_insert_color(&new->rb_node, &pag->pagb_tree);
list_add(&new->list, busy_list); /* always process discard lists in fifo order */
list_add_tail(&new->list, busy_list);
spin_unlock(&pag->pagb_lock); spin_unlock(&pag->pagb_lock);
} }
......
...@@ -584,6 +584,11 @@ xfs_vn_getattr( ...@@ -584,6 +584,11 @@ xfs_vn_getattr(
} }
} }
if ((request_mask & STATX_CHANGE_COOKIE) && IS_I_VERSION(inode)) {
stat->change_cookie = inode_query_iversion(inode);
stat->result_mask |= STATX_CHANGE_COOKIE;
}
/* /*
* Note: If you add another clause to set an attribute flag, please * Note: If you add another clause to set an attribute flag, please
* update attributes_mask below. * update attributes_mask below.
......
...@@ -126,8 +126,8 @@ xfs_dax_notify_ddev_failure( ...@@ -126,8 +126,8 @@ xfs_dax_notify_ddev_failure(
struct xfs_rmap_irec ri_low = { }; struct xfs_rmap_irec ri_low = { };
struct xfs_rmap_irec ri_high; struct xfs_rmap_irec ri_high;
struct xfs_agf *agf; struct xfs_agf *agf;
xfs_agblock_t agend;
struct xfs_perag *pag; struct xfs_perag *pag;
xfs_agblock_t range_agend;
pag = xfs_perag_get(mp, agno); pag = xfs_perag_get(mp, agno);
error = xfs_alloc_read_agf(pag, tp, 0, &agf_bp); error = xfs_alloc_read_agf(pag, tp, 0, &agf_bp);
...@@ -148,10 +148,10 @@ xfs_dax_notify_ddev_failure( ...@@ -148,10 +148,10 @@ xfs_dax_notify_ddev_failure(
ri_high.rm_startblock = XFS_FSB_TO_AGBNO(mp, end_fsbno); ri_high.rm_startblock = XFS_FSB_TO_AGBNO(mp, end_fsbno);
agf = agf_bp->b_addr; agf = agf_bp->b_addr;
agend = min(be32_to_cpu(agf->agf_length), range_agend = min(be32_to_cpu(agf->agf_length) - 1,
ri_high.rm_startblock); ri_high.rm_startblock);
notify.startblock = ri_low.rm_startblock; notify.startblock = ri_low.rm_startblock;
notify.blockcount = agend - ri_low.rm_startblock; notify.blockcount = range_agend + 1 - ri_low.rm_startblock;
error = xfs_rmap_query_range(cur, &ri_low, &ri_high, error = xfs_rmap_query_range(cur, &ri_low, &ri_high,
xfs_dax_failure_fn, &notify); xfs_dax_failure_fn, &notify);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment