mirror of
https://github.com/torvalds/linux.git
synced 2026-09-23 13:14:02 +02:00
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: 2d829cc767 ("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>
This commit is contained in:
parent
e9193f2f1c
commit
14e379600d
|
|
@ -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();
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user