All of lore.kernel.org
 help / color / mirror / Atom feed
From: Josef Bacik <josef@toxicpanda.com>
To: linux-btrfs@vger.kernel.org, kernel-team@fb.com,
	linux-fsdevel@vger.kernel.org
Cc: Nikolay Borisov <nborisov@suse.com>
Subject: [PATCH v3 7/9] btrfs: use the filemap_fdatawrite_wbc helper for delalloc shrinking
Date: Wed, 14 Jul 2021 14:47:23 -0400	[thread overview]
Message-ID: <8b03a72d1b50931637b25daad29fb470fb08dde8.1626288241.git.josef@toxicpanda.com> (raw)
In-Reply-To: <cover.1626288241.git.josef@toxicpanda.com>

sync_inode() has some holes that can cause problems if we're under heavy
ENOSPC pressure.  If there's writeback running on a separate thread
sync_inode() will skip writing the inode altogether.  What we really
want is to make sure writeback has been started on all the pages to make
sure we can see the ordered extents and wait on them if appropriate.
Switch to this new helper which will allow us to accomplish this and
avoid ENOSPC'ing early.

Signed-off-by: Josef Bacik <josef@toxicpanda.com>
Reviewed-by: Nikolay Borisov <nborisov@suse.com>
---
 fs/btrfs/inode.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/fs/btrfs/inode.c b/fs/btrfs/inode.c
index e388153c4ae4..b25c84aba743 100644
--- a/fs/btrfs/inode.c
+++ b/fs/btrfs/inode.c
@@ -9713,7 +9713,7 @@ static int start_delalloc_inodes(struct btrfs_root *root,
 			btrfs_queue_work(root->fs_info->flush_workers,
 					 &work->work);
 		} else {
-			ret = sync_inode(inode, wbc);
+			ret = filemap_fdatawrite_wbc(inode->i_mapping, wbc);
 			btrfs_add_delayed_iput(inode);
 			if (ret || wbc->nr_to_write <= 0)
 				goto out;
-- 
2.26.3


  parent reply	other threads:[~2021-07-14 18:47 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-07-14 18:47 [PATCH v3 0/9] ENOSPC delalloc flushing fixes Josef Bacik
2021-07-14 18:47 ` [PATCH v3 1/9] btrfs: wake up async_delalloc_pages waiters after submit Josef Bacik
2021-07-14 18:47 ` [PATCH v3 2/9] btrfs: include delalloc related info in dump space info tracepoint Josef Bacik
2021-07-14 18:47 ` [PATCH v3 3/9] btrfs: enable a tracepoint when we fail tickets Josef Bacik
2021-07-14 18:47 ` [PATCH v3 4/9] btrfs: handle shrink_delalloc pages calculation differently Josef Bacik
2021-07-14 18:47 ` [PATCH v3 5/9] btrfs: wait on async extents when flushing delalloc Josef Bacik
2021-07-14 18:47 ` [PATCH v3 6/9] fs: add a filemap_fdatawrite_wbc helper Josef Bacik
2021-07-15  6:23   ` Christoph Hellwig
2021-07-21 11:20     ` David Sterba
2021-07-14 18:47 ` Josef Bacik [this message]
2021-07-14 18:47 ` [PATCH v3 8/9] 9p: migrate from sync_inode to filemap_fdatawrite_wbc Josef Bacik
2021-07-15  6:25   ` Christoph Hellwig
2021-07-21 10:49   ` David Sterba
2021-07-14 18:47 ` [PATCH v3 9/9] fs: kill sync_inode Josef Bacik
2021-07-15  6:27   ` Christoph Hellwig
2021-07-15  7:31 ` [PATCH v3 0/9] ENOSPC delalloc flushing fixes Nikolay Borisov
2021-07-21 11:29 ` David Sterba

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=8b03a72d1b50931637b25daad29fb470fb08dde8.1626288241.git.josef@toxicpanda.com \
    --to=josef@toxicpanda.com \
    --cc=kernel-team@fb.com \
    --cc=linux-btrfs@vger.kernel.org \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=nborisov@suse.com \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.