• Darrick J. Wong's avatar
    xfs: use per-mount cpumask to track nonempty percpu inodegc lists · 62334fab
    Darrick J. Wong authored
    Directly track which CPUs have contributed to the inodegc percpu lists
    instead of trusting the cpu online mask.  This eliminates a theoretical
    problem where the inodegc flush functions might fail to flush a CPU's
    inodes if that CPU happened to be dying at exactly the same time.  Most
    likely nobody's noticed this because the CPU dead hook moves the percpu
    inodegc list to another CPU and schedules that worker immediately.  But
    it's quite possible that this is a subtle race leading to UAF if the
    inodegc flush were part of an unmount.
    
    Further benefits: This reduces the overhead of the inodegc flush code
    slightly by allowing us to ignore CPUs that have empty lists.  Better
    yet, it reduces our dependence on the cpu online masks, which have been
    the cause of confusion and drama lately.
    
    Fixes: ab23a776 ("xfs: per-cpu deferred inode inactivation queues")
    Signed-off-by: default avatarDarrick J. Wong <djwong@kernel.org>
    Reviewed-by: default avatarDave Chinner <dchinner@redhat.com>
    62334fab
xfs_super.c 63.4 KB