Skip to content

Commit 9e06150

Browse files
committed
Merge tag 'xfs-6.5-merge-2' of git://git.kernel.org/pub/scm/fs/xfs/xfs-linux
Pull xfs updates from Darrick Wong: "There's not much going on this cycle -- the large extent counts feature graduated, so now users can create more extremely fragmented files! :P The rest are bug fixes; and I'll be sending more next week. - Fix a problem where shrink would blow out the space reserve by declining to shrink the filesystem - Drop the EXPERIMENTAL tag for the large extent counts feature - Set FMODE_CAN_ODIRECT and get rid of an address space op - Fix an AG count overflow bug in growfs if the new device size is redonkulously large" * tag 'xfs-6.5-merge-2' of git://git.kernel.org/pub/scm/fs/xfs/xfs-linux: xfs: fix ag count overflow during growfs xfs: set FMODE_CAN_ODIRECT instead of a dummy direct_IO method xfs: drop EXPERIMENTAL tag for large extent counts xfs: don't deplete the reserve pool when trying to shrink the fs
2 parents 53ea167 + c3b880a commit 9e06150

File tree

5 files changed

+19
-14
lines changed

5 files changed

+19
-14
lines changed

fs/xfs/libxfs/xfs_fs.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -257,6 +257,8 @@ typedef struct xfs_fsop_resblks {
257257
#define XFS_MAX_AG_BLOCKS (XFS_MAX_AG_BYTES / XFS_MIN_BLOCKSIZE)
258258
#define XFS_MAX_CRC_AG_BLOCKS (XFS_MAX_AG_BYTES / XFS_MIN_CRC_BLOCKSIZE)
259259

260+
#define XFS_MAX_AGNUMBER ((xfs_agnumber_t)(NULLAGNUMBER - 1))
261+
260262
/* keep the maximum size under 2^31 by a small amount */
261263
#define XFS_MAX_LOG_BYTES \
262264
((2 * 1024 * 1024 * 1024ULL) - XFS_MIN_LOG_BYTES)

fs/xfs/xfs_aops.c

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -582,7 +582,6 @@ const struct address_space_operations xfs_address_space_operations = {
582582
.release_folio = iomap_release_folio,
583583
.invalidate_folio = iomap_invalidate_folio,
584584
.bmap = xfs_vm_bmap,
585-
.direct_IO = noop_direct_IO,
586585
.migrate_folio = filemap_migrate_folio,
587586
.is_partially_uptodate = iomap_is_partially_uptodate,
588587
.error_remove_page = generic_error_remove_page,
@@ -591,7 +590,6 @@ const struct address_space_operations xfs_address_space_operations = {
591590

592591
const struct address_space_operations xfs_dax_aops = {
593592
.writepages = xfs_dax_writepages,
594-
.direct_IO = noop_direct_IO,
595593
.dirty_folio = noop_dirty_folio,
596594
.swap_activate = xfs_iomap_swapfile_activate,
597595
};

fs/xfs/xfs_file.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1194,7 +1194,7 @@ xfs_file_open(
11941194
if (xfs_is_shutdown(XFS_M(inode->i_sb)))
11951195
return -EIO;
11961196
file->f_mode |= FMODE_NOWAIT | FMODE_BUF_RASYNC | FMODE_BUF_WASYNC |
1197-
FMODE_DIO_PARALLEL_WRITE;
1197+
FMODE_DIO_PARALLEL_WRITE | FMODE_CAN_ODIRECT;
11981198
return generic_file_open(inode, file);
11991199
}
12001200

fs/xfs/xfs_fsops.c

Lines changed: 16 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -115,11 +115,16 @@ xfs_growfs_data_private(
115115

116116
nb_div = nb;
117117
nb_mod = do_div(nb_div, mp->m_sb.sb_agblocks);
118-
nagcount = nb_div + (nb_mod != 0);
119-
if (nb_mod && nb_mod < XFS_MIN_AG_BLOCKS) {
120-
nagcount--;
121-
nb = (xfs_rfsblock_t)nagcount * mp->m_sb.sb_agblocks;
118+
if (nb_mod && nb_mod >= XFS_MIN_AG_BLOCKS)
119+
nb_div++;
120+
else if (nb_mod)
121+
nb = nb_div * mp->m_sb.sb_agblocks;
122+
123+
if (nb_div > XFS_MAX_AGNUMBER + 1) {
124+
nb_div = XFS_MAX_AGNUMBER + 1;
125+
nb = nb_div * mp->m_sb.sb_agblocks;
122126
}
127+
nagcount = nb_div;
123128
delta = nb - mp->m_sb.sb_dblocks;
124129
/*
125130
* Reject filesystems with a single AG because they are not
@@ -140,9 +145,13 @@ xfs_growfs_data_private(
140145
return -EINVAL;
141146
}
142147

143-
error = xfs_trans_alloc(mp, &M_RES(mp)->tr_growdata,
144-
(delta > 0 ? XFS_GROWFS_SPACE_RES(mp) : -delta), 0,
145-
XFS_TRANS_RESERVE, &tp);
148+
if (delta > 0)
149+
error = xfs_trans_alloc(mp, &M_RES(mp)->tr_growdata,
150+
XFS_GROWFS_SPACE_RES(mp), 0, XFS_TRANS_RESERVE,
151+
&tp);
152+
else
153+
error = xfs_trans_alloc(mp, &M_RES(mp)->tr_growdata, -delta, 0,
154+
0, &tp);
146155
if (error)
147156
return error;
148157

fs/xfs/xfs_super.c

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1707,10 +1707,6 @@ xfs_fs_fill_super(
17071707
goto out_filestream_unmount;
17081708
}
17091709

1710-
if (xfs_has_large_extent_counts(mp))
1711-
xfs_warn(mp,
1712-
"EXPERIMENTAL Large extent counts feature in use. Use at your own risk!");
1713-
17141710
error = xfs_mountfs(mp);
17151711
if (error)
17161712
goto out_filestream_unmount;

0 commit comments

Comments
 (0)