Re: [PATCH] blk-cgroup: Flush stats before releasing blkcg_gq

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 




On 5/25/23 10:11, Michal Koutný wrote:
On Wed, May 24, 2023 at 10:37:10AM +0800, Ming Lei <ming.lei@xxxxxxxxxx> wrote:
I am not at all familiar with blkcg, but does calling
cgroup_rstat_flush() in offline_css() fix the problem?
Except for offline, this list needs to be flushed after the associated disk
is deleted.
Why the second flush trigger?
a) To break another ref-dependency cycle (like on the blkcg side)?
b) To avoid stale data upon device removal?

(Because b) should be unnecessary, a future reader would flush when
needed.)

Since the percpu blkg_iostat_set's that are linked in the lockless list will be freed if the corresponding blkcg_gq is freed, we need to flush the lockless list to avoid potential use-after-free in a future cgroup_rstat_flush*() call.

Cheers,
Longman




[Index of Archives]     [Linux RAID]     [Linux SCSI]     [Linux ATA RAID]     [IDE]     [Linux Wireless]     [Linux Kernel]     [ATH6KL]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Device Mapper]

  Powered by Linux