Skip to content

Commit ce84042

Browse files
committed
xfs: revert 1baa280 ("xfs: remove the unused XFS_ALLOC_USERDATA flag")
Revert this commit, as it caused periodic regressions in xfs/173 w/ 1k blocks. [1] https://lore.kernel.org/lkml/20190919014602.GN15734@shao2-debian/ Signed-off-by: Darrick J. Wong <[email protected]> Reviewed-by: Brian Foster <[email protected]>
1 parent 583e4ef commit ce84042

File tree

2 files changed

+10
-5
lines changed

2 files changed

+10
-5
lines changed

fs/xfs/libxfs/xfs_alloc.h

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -81,9 +81,10 @@ typedef struct xfs_alloc_arg {
8181
/*
8282
* Defines for datatype
8383
*/
84-
#define XFS_ALLOC_INITIAL_USER_DATA (1 << 0)/* special case start of file */
85-
#define XFS_ALLOC_USERDATA_ZERO (1 << 1)/* zero extent on allocation */
86-
#define XFS_ALLOC_NOBUSY (1 << 2)/* Busy extents not allowed */
84+
#define XFS_ALLOC_USERDATA (1 << 0)/* allocation is for user data*/
85+
#define XFS_ALLOC_INITIAL_USER_DATA (1 << 1)/* special case start of file */
86+
#define XFS_ALLOC_USERDATA_ZERO (1 << 2)/* zero extent on allocation */
87+
#define XFS_ALLOC_NOBUSY (1 << 3)/* Busy extents not allowed */
8788

8889
static inline bool
8990
xfs_alloc_is_userdata(int datatype)

fs/xfs/libxfs/xfs_bmap.c

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4042,8 +4042,12 @@ xfs_bmapi_allocate(
40424042
*/
40434043
if (!(bma->flags & XFS_BMAPI_METADATA)) {
40444044
bma->datatype = XFS_ALLOC_NOBUSY;
4045-
if (whichfork == XFS_DATA_FORK && bma->offset == 0)
4046-
bma->datatype |= XFS_ALLOC_INITIAL_USER_DATA;
4045+
if (whichfork == XFS_DATA_FORK) {
4046+
if (bma->offset == 0)
4047+
bma->datatype |= XFS_ALLOC_INITIAL_USER_DATA;
4048+
else
4049+
bma->datatype |= XFS_ALLOC_USERDATA;
4050+
}
40474051
if (bma->flags & XFS_BMAPI_ZERO)
40484052
bma->datatype |= XFS_ALLOC_USERDATA_ZERO;
40494053
}

0 commit comments

Comments
 (0)