From: Graham Cobb <g.btrfs@cobb.uk.net>
To: fdmanana@gmail.com
Cc: linux-btrfs <linux-btrfs@vger.kernel.org>,
"Sebastian Döring" <moralapostel@gmail.com>
Subject: Re: Scrub resume regression
Date: Wed, 15 Jan 2020 11:55:47 +0000 [thread overview]
Message-ID: <26efdad1-cd74-d93e-23c1-1915b2d9c8d0@cobb.uk.net> (raw)
In-Reply-To: <CAL3q7H7ERYHeKPsQcyT05A=rgY7QJcgDhhnSFjmFfbKMfam_hg@mail.gmail.com>
On 15/01/2020 09:33, Filipe Manana wrote:
> On Wed, Jan 15, 2020 at 9:04 AM Graham Cobb <g.btrfs@cobb.uk.net> wrote:
>>
>> OK, I have bisected the problem with scrub resume being broken by the
>> scrub ioctl ABI being changed.
[snip]
>
> Try this:
>
> diff --git a/fs/btrfs/ioctl.c b/fs/btrfs/ioctl.c
> index 3a4bd5cd67fa..611dfe8cdbb1 100644
> --- a/fs/btrfs/ioctl.c
> +++ b/fs/btrfs/ioctl.c
> @@ -4253,8 +4253,10 @@ static long btrfs_ioctl_scrub(struct file
> *file, void __user *arg)
> &sa->progress, sa->flags & BTRFS_SCRUB_READONLY,
> 0);
>
> - if (ret == 0 && copy_to_user(arg, sa, sizeof(*sa)))
> - ret = -EFAULT;
> + if (copy_to_user(arg, sa, sizeof(*sa))) {
> + if (!ret)
> + ret = -EFAULT;
> + }
>
> if (!(sa->flags & BTRFS_SCRUB_READONLY))
> mnt_drop_write_file(file);
>
> I'll later send a patch with a changelog to the list.
> Thanks.
Thanks Filipe. I have tested that the patch builds and works with my
reproducer on a 5.4 kernel.
Later I will build a distro kernel with the patch and try my monthly
scrub-with-interruptions script. That will take a day or two.
next prev parent reply other threads:[~2020-01-15 11:55 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-01-15 9:03 Scrub resume regression Graham Cobb
2020-01-15 9:33 ` Filipe Manana
2020-01-15 11:55 ` Graham Cobb [this message]
2020-01-15 12:51 ` David Sterba
2020-01-15 13:10 ` Holger Hoffstätte
2020-01-15 21:02 ` Sebastian Döring
2020-01-16 14:02 ` David Sterba
2020-01-17 15:59 ` Zygo Blaxell
2020-01-17 18:39 ` Chris Murphy
2020-01-17 19:39 ` Graham Cobb
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=26efdad1-cd74-d93e-23c1-1915b2d9c8d0@cobb.uk.net \
--to=g.btrfs@cobb.uk.net \
--cc=fdmanana@gmail.com \
--cc=linux-btrfs@vger.kernel.org \
--cc=moralapostel@gmail.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 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).