diff options
| author | Christoph Hellwig <hch@lst.de> | 2026-09-14 13:35:38 +0200 |
|---|---|---|
| committer | Carlos Maiolino <cem@kernel.org> | 2026-09-15 10:12:38 +0200 |
| commit | 14e379600d3e57ab0872b049c28cfe5ef519d439 (patch) | |
| tree | 8559335e7e7b5420e6b0cade079e9cb721f19b03 | |
| parent | e9193f2f1ce32d02b9230094ffdbfab715ab6137 (diff) | |
| download | linux-next-14e379600d3e57ab0872b049c28cfe5ef519d439.tar.gz linux-next-14e379600d3e57ab0872b049c28cfe5ef519d439.zip | |
xfs: don't try to get a reference to a NULL oz in xfs_get_cached_zone
oz can be NULL when we resample it after taking i_flags_lock, so account
for that.
Fixes: 2d829cc76777 ("xfs: fix racy open zone caching")
Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Hans Holmberg <hans.holmberg@wdc.com>
Reviewed-by: Carlos Maiolino <cmaiolino@redhat.com>
Signed-off-by: Carlos Maiolino <cem@kernel.org>
| -rw-r--r-- | fs/xfs/xfs_zone_alloc.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/fs/xfs/xfs_zone_alloc.c b/fs/xfs/xfs_zone_alloc.c index 28c1e48909fa..d7ec055a9a06 100644 --- a/fs/xfs/xfs_zone_alloc.c +++ b/fs/xfs/xfs_zone_alloc.c @@ -820,7 +820,7 @@ xfs_get_cached_zone( spin_unlock(&ip->i_flags_lock); } - if (!atomic_inc_not_zero(&oz->oz_ref)) + if (oz && !atomic_inc_not_zero(&oz->oz_ref)) oz = NULL; out_unlock: rcu_read_unlock(); |
