linux-btrfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Wang Yugui <wangyugui@e16-tech.com>
To: fdmanana@kernel.org
Cc: linux-btrfs@vger.kernel.org
Subject: Re: [PATCH 5.10.x] btrfs: fix crash after non-aligned direct IO write with O_DSYNC
Date: Sat, 13 Feb 2021 09:04:17 +0800	[thread overview]
Message-ID: <20210213090416.926A.409509F4@e16-tech.com> (raw)
In-Reply-To: <94663c8a2172dc96b760d356a538d45c36f46040.1613062764.git.fdmanana@suse.com>

Hi,

> This bug only affects 5.10 kernels, and the regression was introduced in
> 5.10-rc1 by commit 0eb79294dbe328 ("btrfs: dio iomap DSYNC workaround").
> The bug does not exist in 5.11 kernels due to commit ecfdc08b8cc65d
> ("btrfs: remove dio iomap DSYNC workaround"), which depends on other
> changes that went into the merge window for 5.11. So this is a fix only
> for 5.10.x stable kernels, as there are people hitting this.

It is OK too to backport commit ecfdc08b8cc65d
 ("btrfs: remove dio iomap DSYNC workaround") to 5.10 for this problem?

the iomap issue for commit 0eb79294dbe328 ("btrfs: dio iomap DSYNC workaround")
is already fixed in 5.10?

Best Regards
Wang Yugui (wangyugui@e16-tech.com)
2021/02/13


> Fixes: 0eb79294dbe328 ("btrfs: dio iomap DSYNC workaround")
> CC: stable@vger.kernel.org # 5.10 (and only 5.10)
> Bugzilla: https://bugzilla.suse.com/show_bug.cgi?id=1181605
> Signed-off-by: Filipe Manana <fdmanana@suse.com>
> ---
>  fs/btrfs/inode.c | 6 +++++-
>  1 file changed, 5 insertions(+), 1 deletion(-)
> 
> diff --git a/fs/btrfs/inode.c b/fs/btrfs/inode.c
> index acc47e2ffb46..b536d21541a9 100644
> --- a/fs/btrfs/inode.c
> +++ b/fs/btrfs/inode.c
> @@ -8026,8 +8026,12 @@ ssize_t btrfs_direct_IO(struct kiocb *iocb, struct iov_iter *iter)
>  	bool relock = false;
>  	ssize_t ret;
>  
> -	if (check_direct_IO(fs_info, iter, offset))
> +	if (check_direct_IO(fs_info, iter, offset)) {
> +		ASSERT(current->journal_info == NULL ||
> +		       current->journal_info == BTRFS_DIO_SYNC_STUB);
> +		current->journal_info = NULL;
>  		return 0;
> +	}
>  
>  	count = iov_iter_count(iter);
>  	if (iov_iter_rw(iter) == WRITE) {
> -- 
> 2.28.0



  reply	other threads:[~2021-02-13  1:05 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-02-11 17:00 [PATCH 5.10.x] btrfs: fix crash after non-aligned direct IO write with O_DSYNC fdmanana
2021-02-13  1:04 ` Wang Yugui [this message]
2021-02-15 11:05   ` Filipe Manana
2021-02-16 14:23     ` David Sterba
2021-02-16 14:41       ` Filipe Manana
2021-02-16 14:40 ` fdmanana
2021-02-16 14:50 ` Greg KH
2021-02-16 14:52   ` Filipe Manana
2021-02-16 15:15   ` David Sterba
2021-02-16 15:34     ` Greg KH
2021-02-16 17:52       ` David Sterba
2021-02-22 11:07         ` Greg KH

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=20210213090416.926A.409509F4@e16-tech.com \
    --to=wangyugui@e16-tech.com \
    --cc=fdmanana@kernel.org \
    --cc=linux-btrfs@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).