Commit 7b0db045 authored by Long Li's avatar Long Li
Browse files

xfs: xfs_trans_cancel() path must check for log shutdown

hulk inclusion
category: bugfix
bugzilla: 188734, https://gitee.com/openeuler/kernel/issues/I76JSK


CVE: NA

--------------------------------

The following error occurred when do IO fault injection test:

XFS: Assertion failed: xlog_is_shutdown(lip->li_log), file: fs/xfs/xfs_inode_item.c, line: 748

commit "3c4cb76b xfs: xfs_trans_commit() path must check for log
shutdown" fix a problem that dirty transaction was canceled before log
shutdown, because of the log is still running, it result dirty and
unlogged inode item that isn't in the AIL in memory that can be flushed
to disk via writeback clustering.

xfs_trans_cancel() has the same problem, if a shut down races with
xfs_trans_cancel() and we have shut down the filesystem but not the log,
we will still cancel the transaction before log shutdown. So
xfs_trans_cancel() needs to check log state for shutdown, not mount.

Signed-off-by: default avatarLong Li <leo.lilong@huawei.com>
parent 85b0027e
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment