Linux-BTRFS Archive on
 help / color / Atom feed
From: David Sterba <>
Subject: Re: [PATCH] Btrfs: always copy scrub arguments back to user space
Date: Thu, 16 Jan 2020 15:12:33 +0100
Message-ID: <> (raw)
In-Reply-To: <>

On Thu, Jan 16, 2020 at 11:29:20AM +0000, wrote:
> From: Filipe Manana <>
> If scrub returns an error we are not copying back the scrub arguments
> structure to user space. This prevents user space to know how much progress
> scrub has done if an error happened - this includes -ECANCELED which is
> returned when users ask for scrub to stop. A particular use case, which is
> used in btrfs-progs, is to resume scrub after it is canceled, in that case
> it relies on checking the progress from the scrub arguments structure and
> then use that progress in a call to resume scrub.
> So fix this by always copying the scrub arguments structure to user space,
> overwriting the value returned to user space with -EFAULT only if copying
> the structure failed to let user space know that either that copying did
> not happen, and therefore the structure is stale, or it happened partially
> and the structure is probably not valid and corrupt due to the partial
> copy.
> Reported-by: Graham Cobb <>
> Link:
> Fixes: 06fe39ab15a6a4 ("Btrfs: do not overwrite scrub error with fault error in scrub ioctl")
> Signed-off-by: Filipe Manana <>

Added to 5.5-rc queue, thanks.

  parent reply index

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-01-16 11:29 fdmanana
2020-01-16 11:59 ` Johannes Thumshirn
2020-01-16 12:00 ` Qu Wenruo
2020-01-16 14:12 ` David Sterba [this message]
2020-01-17 14:24   ` Graham Cobb

Reply instructions:

You may reply publically 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:

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \ \ \ \ \

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

Linux-BTRFS Archive on

Archives are clonable:
	git clone --mirror linux-btrfs/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 linux-btrfs linux-btrfs/ \
	public-inbox-index linux-btrfs

Example config snippet for mirrors

Newsgroup available over NNTP:

AGPL code for this site: git clone