diff options
author | Darrick J. Wong <djwong@kernel.org> | 2021-07-09 11:05:48 -0700 |
---|---|---|
committer | Darrick J. Wong <djwong@kernel.org> | 2021-08-25 22:25:59 -0700 |
commit | 4cf18001845083e35676c913ddcc7ae41b914b64 (patch) | |
tree | d08c99508a485e9787d43603e0f13c879fa0d90c /fs/xfs/xfs_log_priv.h | |
parent | 176fd00779949a9f87cfc7f157f78eb86c6c0d84 (diff) |
xfs: clear log incompat feature bits when the log is idlelog-use-incompat-features_2021-08-25
When there are no ongoing transactions and the log contents have been
checkpointed back into the filesystem, the log performs 'covering',
which is to say that it log a dummy transaction to record the fact that
the tail has caught up with the head. This is a good time to clear log
incompat feature flags, because they are flags that are temporarily set
to limit the range of kernels that can replay a dirty log.
Since it's possible that some other higher level thread is about to
start logging items protected by a log incompat flag, we create a rwsem
so that upper level threads can coordinate this with the log. It would
probably be more performant to use a percpu rwsem, but the ability to
/try/ taking the write lock during covering is critical, and percpu
rwsems do not provide that.
Signed-off-by: Darrick J. Wong <djwong@kernel.org>
Diffstat (limited to 'fs/xfs/xfs_log_priv.h')
-rw-r--r-- | fs/xfs/xfs_log_priv.h | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/fs/xfs/xfs_log_priv.h b/fs/xfs/xfs_log_priv.h index f3e79a45d60a..6953f86f866c 100644 --- a/fs/xfs/xfs_log_priv.h +++ b/fs/xfs/xfs_log_priv.h @@ -456,6 +456,9 @@ struct xlog { xfs_lsn_t l_recovery_lsn; uint32_t l_iclog_roundoff;/* padding roundoff */ + + /* Users of log incompat features should take a read lock. */ + struct rw_semaphore l_incompat_users; }; #define XLOG_BUF_CANCEL_BUCKET(log, blkno) \ |