linux-f2fs-devel.lists.sourceforge.net archive mirror
 help / color / mirror / Atom feed
From: Jaegeuk Kim <jaegeuk@kernel.org>
To: linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org,
	linux-f2fs-devel@lists.sourceforge.net
Cc: Jaegeuk Kim <jaegeuk@kernel.org>
Subject: [PATCH] f2fs: don't commit quota files
Date: Tue, 10 Oct 2017 15:53:35 -0700	[thread overview]
Message-ID: <20171010225335.22457-1-jaegeuk@kernel.org> (raw)

We don't need to commit every quota changes, since it only recovers fsynced
data. So, we need to rely on quotacheck to fix any inconsistency.
This also tries to resolve deadlock condition as follows.

- f2fs_write_begin
 - f2fs_reserve_block
  - mutex(node_change)
   - dquot_claim_space_nodirty
    - f2fs_mark_dquot_dirty
     - dquot_commit
      - mutex_lock()

- f2fs_setattr
 - dquot_transfer
  - dqget
   - dquot_acquire
    - write_blk
     - f2fs_quota_write
      - f2fs_write_begin
       - mutex(node_change)

Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
---
 fs/f2fs/super.c | 16 +---------------
 1 file changed, 1 insertion(+), 15 deletions(-)

diff --git a/fs/f2fs/super.c b/fs/f2fs/super.c
index 85ba56ac34f2..5268690dd219 100644
--- a/fs/f2fs/super.c
+++ b/fs/f2fs/super.c
@@ -1641,20 +1641,6 @@ void f2fs_quota_off_umount(struct super_block *sb)
 		f2fs_quota_off(sb, type);
 }
 
-static int f2fs_mark_dquot_dirty(struct dquot *dquot)
-{
-	struct super_block *sb = dquot->dq_sb;
-	struct f2fs_sb_info *sbi = F2FS_SB(sb);
-
-	if (f2fs_sb_has_quota_ino(sb) ||
-		sbi->s_qf_names[USRQUOTA] || sbi->s_qf_names[GRPQUOTA]) {
-		dquot_mark_dquot_dirty(dquot);
-		return dquot_commit(dquot);
-	} else {
-		return dquot_mark_dquot_dirty(dquot);
-	}
-}
-
 int f2fs_get_projid(struct inode *inode, kprojid_t *projid)
 {
 	*projid = F2FS_I(inode)->i_projid;
@@ -1666,7 +1652,7 @@ static const struct dquot_operations f2fs_quota_operations = {
 	.write_dquot	= dquot_commit,
 	.acquire_dquot	= dquot_acquire,
 	.release_dquot	= dquot_release,
-	.mark_dirty	= f2fs_mark_dquot_dirty,
+	.mark_dirty	= dquot_mark_dquot_dirty,
 	.write_info	= dquot_commit_info,
 	.alloc_dquot	= dquot_alloc,
 	.destroy_dquot	= dquot_destroy,
-- 
2.14.0.rc1.383.gd1ce394fe2-goog

                 reply	other threads:[~2017-10-10 22:53 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=20171010225335.22457-1-jaegeuk@kernel.org \
    --to=jaegeuk@kernel.org \
    --cc=linux-f2fs-devel@lists.sourceforge.net \
    --cc=linux-fsdevel@vger.kernel.org \
    --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).