mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-09 12:17:12 +09:00
f2fs: fix iostat lock protection
commit144f1cd40bupstream. Made iostat lock irq safe to avoid potentinal deadlock. Deadlock scenario: f2fs_attr_store -> f2fs_sbi_store -> _sbi_store -> spin_lock(sbi->iostat_lock) <interrupt request> -> scsi_end_request -> bio_endio -> f2fs_dio_read_end_io -> f2fs_update_iostat -> spin_lock_irqsave(sbi->iostat_lock) ===> Dead lock here Fixes:61803e9843("f2fs: fix iostat related lock protection") Fixes:a1e09b03e6("f2fs: use iomap for direct I/O") Signed-off-by: Qilin Tan <qilin.tan@mediatek.com> Reviewed-by: Chao Yu <chao@kernel.org> Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org> Cc: Daniel Rosenberg <drosen@google.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
d3b74c288d
commit
9214a5484e
@@ -403,9 +403,9 @@ out:
|
|||||||
if (!strcmp(a->attr.name, "iostat_period_ms")) {
|
if (!strcmp(a->attr.name, "iostat_period_ms")) {
|
||||||
if (t < MIN_IOSTAT_PERIOD_MS || t > MAX_IOSTAT_PERIOD_MS)
|
if (t < MIN_IOSTAT_PERIOD_MS || t > MAX_IOSTAT_PERIOD_MS)
|
||||||
return -EINVAL;
|
return -EINVAL;
|
||||||
spin_lock(&sbi->iostat_lock);
|
spin_lock_irq(&sbi->iostat_lock);
|
||||||
sbi->iostat_period_ms = (unsigned int)t;
|
sbi->iostat_period_ms = (unsigned int)t;
|
||||||
spin_unlock(&sbi->iostat_lock);
|
spin_unlock_irq(&sbi->iostat_lock);
|
||||||
return count;
|
return count;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user