linux-f2fs-devel.lists.sourceforge.net archive mirror
 help / color / mirror / Atom feed
From: wangzijie <wangzijie1@honor.com>
To: <chao@kernel.org>, <jaegeuk@kernel.org>
Cc: wangzijie <wangzijie1@honor.com>,
	linux-kernel@vger.kernel.org,
	linux-f2fs-devel@lists.sourceforge.net
Subject: [f2fs-dev] [RFC PATCH] f2fs: don't set SBI_QUOTA_NEED_REPAIR flag if receive SIGKILL
Date: Tue, 27 Aug 2024 14:22:42 +0800	[thread overview]
Message-ID: <20240827062242.776881-1-wangzijie1@honor.com> (raw)

Thread A
-dquot_initialize
 -dqget
  -f2fs_dquot_acquire
   -v2_read_dquot
    -qtree_read_dquot
     -find_tree_dqentry
      -f2fs_quota_read
       -read_cache_page_gfp
        -do_read_cache_folio
         -fiemap_read_folio
          -folio_wait_locked_killable
           -receive SIGKILL : return -EINTR
       -set SBI_QUOTA_NEED_REPAIR
   -set SBI_QUOTA_NEED_REPAIR

When calling read_cache_page_gfp in quota read, thread may receive SIGKILL and
set SBI_QUOTA_NEED_REPAIR, should we set SBI_QUOTA_NEED_REPAIR in this error path?

Signed-off-by: wangzijie <wangzijie1@honor.com>
---
 fs/f2fs/inode.c | 3 ++-
 fs/f2fs/super.c | 6 +++---
 2 files changed, 5 insertions(+), 4 deletions(-)

diff --git a/fs/f2fs/inode.c b/fs/f2fs/inode.c
index ed629dabb..2af98e2b7 100644
--- a/fs/f2fs/inode.c
+++ b/fs/f2fs/inode.c
@@ -837,8 +837,9 @@ void f2fs_evict_inode(struct inode *inode)
 
 	err = f2fs_dquot_initialize(inode);
 	if (err) {
+		if (err != -EINTR)
+			set_sbi_flag(sbi, SBI_QUOTA_NEED_REPAIR);
 		err = 0;
-		set_sbi_flag(sbi, SBI_QUOTA_NEED_REPAIR);
 	}
 
 	f2fs_remove_ino_entry(sbi, inode->i_ino, APPEND_INO);
diff --git a/fs/f2fs/super.c b/fs/f2fs/super.c
index 1f1b3647a..f99a36ff3 100644
--- a/fs/f2fs/super.c
+++ b/fs/f2fs/super.c
@@ -2650,8 +2650,8 @@ static ssize_t f2fs_quota_read(struct super_block *sb, int type, char *data,
 			if (PTR_ERR(page) == -ENOMEM) {
 				memalloc_retry_wait(GFP_NOFS);
 				goto repeat;
-			}
-			set_sbi_flag(F2FS_SB(sb), SBI_QUOTA_NEED_REPAIR);
+			} else if (PTR_ERR(page) != -EINTR)
+				set_sbi_flag(F2FS_SB(sb), SBI_QUOTA_NEED_REPAIR);
 			return PTR_ERR(page);
 		}
 
@@ -3070,7 +3070,7 @@ static int f2fs_dquot_acquire(struct dquot *dquot)
 
 	f2fs_down_read(&sbi->quota_sem);
 	ret = dquot_acquire(dquot);
-	if (ret < 0)
+	if (ret < 0 && ret != -EINTR)
 		set_sbi_flag(sbi, SBI_QUOTA_NEED_REPAIR);
 	f2fs_up_read(&sbi->quota_sem);
 	return ret;
-- 
2.25.1



_______________________________________________
Linux-f2fs-devel mailing list
Linux-f2fs-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel

             reply	other threads:[~2024-08-27  6:43 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-08-27  6:22 wangzijie [this message]
2024-09-02  7:32 ` [f2fs-dev] [RFC PATCH] f2fs: don't set SBI_QUOTA_NEED_REPAIR flag if receive SIGKILL Chao Yu via Linux-f2fs-devel
     [not found]   ` <20240903060658.1780002-1-wangzijie1@honor.com>
2024-09-04  3:49     ` Chao Yu via Linux-f2fs-devel
2024-09-08  4:12       ` wangzijie
2024-09-09  1:24         ` Chao Yu via Linux-f2fs-devel
2024-09-09  4:06           ` wangzijie
2024-09-09  9:04             ` Chao Yu via Linux-f2fs-devel
2024-09-11  7:12       ` Chao Yu via Linux-f2fs-devel

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20240827062242.776881-1-wangzijie1@honor.com \
    --to=wangzijie1@honor.com \
    --cc=chao@kernel.org \
    --cc=jaegeuk@kernel.org \
    --cc=linux-f2fs-devel@lists.sourceforge.net \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).