linux-btrfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Scrub resume regression
@ 2020-01-15  9:03 Graham Cobb
  2020-01-15  9:33 ` Filipe Manana
  2020-01-15 12:51 ` David Sterba
  0 siblings, 2 replies; 10+ messages in thread
From: Graham Cobb @ 2020-01-15  9:03 UTC (permalink / raw)
  To: linux-btrfs; +Cc: Sebastian Döring

OK, I have bisected the problem with scrub resume being broken by the
scrub ioctl ABI being changed.

The bad commit is:

Fail
06fe39ab15a6a47d4979460fcc17d33b1d72ccf9 is the first bad commit
commit 06fe39ab15a6a47d4979460fcc17d33b1d72ccf9
Author: Filipe Manana <fdmanana@suse.com>
Date:   Fri Dec 14 19:50:17 2018 +0000

    Btrfs: do not overwrite scrub error with fault error in scrub ioctl

    If scrub returned an error and then the copy_to_user() call did not
    succeed, we would overwrite the error returned by scrub with -EFAULT.
    Fix that by calling copy_to_user() only if btrfs_scrub_dev() returned
    success.

    Signed-off-by: Filipe Manana <fdmanana@suse.com>
    Reviewed-by: David Sterba <dsterba@suse.com>
    Signed-off-by: David Sterba <dsterba@suse.com>

 fs/btrfs/ioctl.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
bisect run success

It is important that scrub always returns the stats, even when it
returns an error. This is critical for cancel, as that is how
cancel/resume works, but it should also apply in case of other errors so
that the user can see how much of the scrub was done before the fatal error.

I am not sure in which kernel release this commit appeared but as this
breaks the "scrub resume" command completely, I think the fix for this
needs to be backported and may want to be considered by distro kernel
maintainers.

I will reply later with the simple reproducer program I created for the
bisection in case it is useful for testing.

^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2020-01-17 19:39 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-01-15  9:03 Scrub resume regression Graham Cobb
2020-01-15  9:33 ` Filipe Manana
2020-01-15 11:55   ` Graham Cobb
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

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).