Re: [PATCH 2/9] xfs: lift writable fs check up into log worker task

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

 





On 1/6/21 10:41 AM, Brian Foster wrote:
The log covering helper checks whether the filesystem is writable to
determine whether to cover the log. The helper is currently only
called from the background log worker. In preparation to reuse the
helper from freezing contexts, lift the check into xfs_log_worker().

Signed-off-by: Brian Foster <bfoster@xxxxxxxxxx>
Looks straight forward
Reviewed-by: Allison Henderson <allison.henderson@xxxxxxxxxx>
---
  fs/xfs/xfs_log.c | 12 +++++-------
  1 file changed, 5 insertions(+), 7 deletions(-)

diff --git a/fs/xfs/xfs_log.c b/fs/xfs/xfs_log.c
index b445e63cbc3c..4137ed007111 100644
--- a/fs/xfs/xfs_log.c
+++ b/fs/xfs/xfs_log.c
@@ -1050,13 +1050,11 @@ xfs_log_space_wake(
   * can't start trying to idle the log until both the CIL and AIL are empty.
   */
  static int
-xfs_log_need_covered(xfs_mount_t *mp)
+xfs_log_need_covered(
+	struct xfs_mount	*mp)
  {
-	struct xlog	*log = mp->m_log;
-	int		needed = 0;
-
-	if (!xfs_fs_writable(mp, SB_FREEZE_WRITE))
-		return 0;
+	struct xlog		*log = mp->m_log;
+	int			needed = 0;
if (!xlog_cil_empty(log))
  		return 0;
@@ -1271,7 +1269,7 @@ xfs_log_worker(
  	struct xfs_mount	*mp = log->l_mp;
/* dgc: errors ignored - not fatal and nowhere to report them */
-	if (xfs_log_need_covered(mp)) {
+	if (xfs_fs_writable(mp, SB_FREEZE_WRITE) && xfs_log_need_covered(mp)) {
  		/*
  		 * Dump a transaction into the log that contains no real change.
  		 * This is needed to stamp the current tail LSN into the log




[Index of Archives]     [XFS Filesystem Development (older mail)]     [Linux Filesystem Development]     [Linux Audio Users]     [Yosemite Trails]     [Linux Kernel]     [Linux RAID]     [Linux SCSI]


  Powered by Linux