Skip to content

Commit 8061e16

Browse files
committed
Merge tag 'xfs-5.18-fixes-1' of git://git.kernel.org/pub/scm/fs/xfs/xfs-linux
Pull xfs fixes from Dave Chinner: - define buffer bit flags as unsigned to fix gcc-5 + c11 warnings - remove redundant XFS fields from MAINTAINERS - fix inode buffer locking order regression * tag 'xfs-5.18-fixes-1' of git://git.kernel.org/pub/scm/fs/xfs/xfs-linux: xfs: reorder iunlink remove operation in xfs_ifree MAINTAINERS: update IOMAP FILESYSTEM LIBRARY and XFS FILESYSTEM xfs: convert buffer flags to unsigned.
2 parents 8f4dd16 + 9a5280b commit 8061e16

File tree

5 files changed

+38
-39
lines changed

5 files changed

+38
-39
lines changed

MAINTAINERS

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10237,8 +10237,6 @@ F: drivers/net/ethernet/sgi/ioc3-eth.c
1023710237
IOMAP FILESYSTEM LIBRARY
1023810238
M: Christoph Hellwig <[email protected]>
1023910239
M: Darrick J. Wong <[email protected]>
10240-
10241-
1024210240
1024310241
1024410242
S: Supported
@@ -21596,7 +21594,6 @@ F: drivers/xen/*swiotlb*
2159621594
XFS FILESYSTEM
2159721595
C: irc://irc.oftc.net/xfs
2159821596
M: Darrick J. Wong <[email protected]>
21599-
2160021597
2160121598
S: Supported
2160221599
W: http://xfs.org/

fs/xfs/xfs_buf.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -406,7 +406,7 @@ xfs_buf_alloc_pages(
406406
STATIC int
407407
_xfs_buf_map_pages(
408408
struct xfs_buf *bp,
409-
uint flags)
409+
xfs_buf_flags_t flags)
410410
{
411411
ASSERT(bp->b_flags & _XBF_PAGES);
412412
if (bp->b_page_count == 1) {
@@ -868,7 +868,7 @@ xfs_buf_read_uncached(
868868
struct xfs_buftarg *target,
869869
xfs_daddr_t daddr,
870870
size_t numblks,
871-
int flags,
871+
xfs_buf_flags_t flags,
872872
struct xfs_buf **bpp,
873873
const struct xfs_buf_ops *ops)
874874
{
@@ -903,7 +903,7 @@ int
903903
xfs_buf_get_uncached(
904904
struct xfs_buftarg *target,
905905
size_t numblks,
906-
int flags,
906+
xfs_buf_flags_t flags,
907907
struct xfs_buf **bpp)
908908
{
909909
int error;

fs/xfs/xfs_buf.h

Lines changed: 21 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -22,28 +22,28 @@ struct xfs_buf;
2222

2323
#define XFS_BUF_DADDR_NULL ((xfs_daddr_t) (-1LL))
2424

25-
#define XBF_READ (1 << 0) /* buffer intended for reading from device */
26-
#define XBF_WRITE (1 << 1) /* buffer intended for writing to device */
27-
#define XBF_READ_AHEAD (1 << 2) /* asynchronous read-ahead */
28-
#define XBF_NO_IOACCT (1 << 3) /* bypass I/O accounting (non-LRU bufs) */
29-
#define XBF_ASYNC (1 << 4) /* initiator will not wait for completion */
30-
#define XBF_DONE (1 << 5) /* all pages in the buffer uptodate */
31-
#define XBF_STALE (1 << 6) /* buffer has been staled, do not find it */
32-
#define XBF_WRITE_FAIL (1 << 7) /* async writes have failed on this buffer */
25+
#define XBF_READ (1u << 0) /* buffer intended for reading from device */
26+
#define XBF_WRITE (1u << 1) /* buffer intended for writing to device */
27+
#define XBF_READ_AHEAD (1u << 2) /* asynchronous read-ahead */
28+
#define XBF_NO_IOACCT (1u << 3) /* bypass I/O accounting (non-LRU bufs) */
29+
#define XBF_ASYNC (1u << 4) /* initiator will not wait for completion */
30+
#define XBF_DONE (1u << 5) /* all pages in the buffer uptodate */
31+
#define XBF_STALE (1u << 6) /* buffer has been staled, do not find it */
32+
#define XBF_WRITE_FAIL (1u << 7) /* async writes have failed on this buffer */
3333

3434
/* buffer type flags for write callbacks */
35-
#define _XBF_INODES (1 << 16)/* inode buffer */
36-
#define _XBF_DQUOTS (1 << 17)/* dquot buffer */
37-
#define _XBF_LOGRECOVERY (1 << 18)/* log recovery buffer */
35+
#define _XBF_INODES (1u << 16)/* inode buffer */
36+
#define _XBF_DQUOTS (1u << 17)/* dquot buffer */
37+
#define _XBF_LOGRECOVERY (1u << 18)/* log recovery buffer */
3838

3939
/* flags used only internally */
40-
#define _XBF_PAGES (1 << 20)/* backed by refcounted pages */
41-
#define _XBF_KMEM (1 << 21)/* backed by heap memory */
42-
#define _XBF_DELWRI_Q (1 << 22)/* buffer on a delwri queue */
40+
#define _XBF_PAGES (1u << 20)/* backed by refcounted pages */
41+
#define _XBF_KMEM (1u << 21)/* backed by heap memory */
42+
#define _XBF_DELWRI_Q (1u << 22)/* buffer on a delwri queue */
4343

4444
/* flags used only as arguments to access routines */
45-
#define XBF_TRYLOCK (1 << 30)/* lock requested, but do not wait */
46-
#define XBF_UNMAPPED (1 << 31)/* do not map the buffer */
45+
#define XBF_TRYLOCK (1u << 30)/* lock requested, but do not wait */
46+
#define XBF_UNMAPPED (1u << 31)/* do not map the buffer */
4747

4848
typedef unsigned int xfs_buf_flags_t;
4949

@@ -58,7 +58,7 @@ typedef unsigned int xfs_buf_flags_t;
5858
{ XBF_WRITE_FAIL, "WRITE_FAIL" }, \
5959
{ _XBF_INODES, "INODES" }, \
6060
{ _XBF_DQUOTS, "DQUOTS" }, \
61-
{ _XBF_LOGRECOVERY, "LOG_RECOVERY" }, \
61+
{ _XBF_LOGRECOVERY, "LOG_RECOVERY" }, \
6262
{ _XBF_PAGES, "PAGES" }, \
6363
{ _XBF_KMEM, "KMEM" }, \
6464
{ _XBF_DELWRI_Q, "DELWRI_Q" }, \
@@ -247,11 +247,11 @@ xfs_buf_readahead(
247247
return xfs_buf_readahead_map(target, &map, 1, ops);
248248
}
249249

250-
int xfs_buf_get_uncached(struct xfs_buftarg *target, size_t numblks, int flags,
251-
struct xfs_buf **bpp);
250+
int xfs_buf_get_uncached(struct xfs_buftarg *target, size_t numblks,
251+
xfs_buf_flags_t flags, struct xfs_buf **bpp);
252252
int xfs_buf_read_uncached(struct xfs_buftarg *target, xfs_daddr_t daddr,
253-
size_t numblks, int flags, struct xfs_buf **bpp,
254-
const struct xfs_buf_ops *ops);
253+
size_t numblks, xfs_buf_flags_t flags, struct xfs_buf **bpp,
254+
const struct xfs_buf_ops *ops);
255255
int _xfs_buf_read(struct xfs_buf *bp, xfs_buf_flags_t flags);
256256
void xfs_buf_hold(struct xfs_buf *bp);
257257

fs/xfs/xfs_inode.c

Lines changed: 13 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -2594,14 +2594,13 @@ xfs_ifree_cluster(
25942594
}
25952595

25962596
/*
2597-
* This is called to return an inode to the inode free list.
2598-
* The inode should already be truncated to 0 length and have
2599-
* no pages associated with it. This routine also assumes that
2600-
* the inode is already a part of the transaction.
2597+
* This is called to return an inode to the inode free list. The inode should
2598+
* already be truncated to 0 length and have no pages associated with it. This
2599+
* routine also assumes that the inode is already a part of the transaction.
26012600
*
2602-
* The on-disk copy of the inode will have been added to the list
2603-
* of unlinked inodes in the AGI. We need to remove the inode from
2604-
* that list atomically with respect to freeing it here.
2601+
* The on-disk copy of the inode will have been added to the list of unlinked
2602+
* inodes in the AGI. We need to remove the inode from that list atomically with
2603+
* respect to freeing it here.
26052604
*/
26062605
int
26072606
xfs_ifree(
@@ -2623,13 +2622,16 @@ xfs_ifree(
26232622
pag = xfs_perag_get(mp, XFS_INO_TO_AGNO(mp, ip->i_ino));
26242623

26252624
/*
2626-
* Pull the on-disk inode from the AGI unlinked list.
2625+
* Free the inode first so that we guarantee that the AGI lock is going
2626+
* to be taken before we remove the inode from the unlinked list. This
2627+
* makes the AGI lock -> unlinked list modification order the same as
2628+
* used in O_TMPFILE creation.
26272629
*/
2628-
error = xfs_iunlink_remove(tp, pag, ip);
2630+
error = xfs_difree(tp, pag, ip->i_ino, &xic);
26292631
if (error)
2630-
goto out;
2632+
return error;
26312633

2632-
error = xfs_difree(tp, pag, ip->i_ino, &xic);
2634+
error = xfs_iunlink_remove(tp, pag, ip);
26332635
if (error)
26342636
goto out;
26352637

fs/xfs/xfs_trans.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -175,7 +175,7 @@ xfs_trans_get_buf(
175175
struct xfs_buftarg *target,
176176
xfs_daddr_t blkno,
177177
int numblks,
178-
uint flags,
178+
xfs_buf_flags_t flags,
179179
struct xfs_buf **bpp)
180180
{
181181
DEFINE_SINGLE_BUF_MAP(map, blkno, numblks);

0 commit comments

Comments
 (0)