[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20200225180725.GA29862@infradead.org>
Date: Tue, 25 Feb 2020 10:07:25 -0800
From: Christoph Hellwig <hch@...radead.org>
To: Qian Cai <cai@....pw>
Cc: darrick.wong@...cle.com, linux-xfs@...r.kernel.org,
linux-kernel@...r.kernel.org
Subject: Re: [PATCH] xfs: fix an undefined behaviour in _da3_path_shift
I think we code do this a tad more cleaner, something like:
diff --git a/fs/xfs/libxfs/xfs_da_btree.c b/fs/xfs/libxfs/xfs_da_btree.c
index 875e04f82541..542a4edfcf54 100644
--- a/fs/xfs/libxfs/xfs_da_btree.c
+++ b/fs/xfs/libxfs/xfs_da_btree.c
@@ -1986,7 +1986,8 @@ xfs_da3_path_shift(
ASSERT(path != NULL);
ASSERT((path->active > 0) && (path->active < XFS_DA_NODE_MAXDEPTH));
level = (path->active-1) - 1; /* skip bottom layer in path */
- for (blk = &path->blk[level]; level >= 0; blk--, level--) {
+ for ( ; level >= 0; level--) {
+ blk = &path->blk[level];
xfs_da3_node_hdr_from_disk(dp->i_mount, &nodehdr,
blk->bp->b_addr);
Powered by blists - more mailing lists