From: David Sterba <dsterba@suse.cz>
To: linux-btrfs@vger.kernel.org
Cc: zab@zabbo.net, David Sterba <dsterba@suse.cz>
Subject: [PATCH] btrfs-progs: fix check of running scrub
Date: Mon, 19 Jan 2015 19:01:05 +0100 [thread overview]
Message-ID: <1421690465-2465-1-git-send-email-dsterba@suse.cz> (raw)
Scrub on multiple devices may report wrong status if scrub finishes
early on one of them.
Reported-by: Sandy McArthur Jr <sandymac@gmail.com>
Signed-off-by: David Sterba <dsterba@suse.cz>
---
cmds-scrub.c | 6 +-----
1 file changed, 1 insertion(+), 5 deletions(-)
diff --git a/cmds-scrub.c b/cmds-scrub.c
index eb50d8a65708..06c2a306f3b2 100644
--- a/cmds-scrub.c
+++ b/cmds-scrub.c
@@ -1073,15 +1073,11 @@ static int is_scrub_running_in_kernel(int fd,
memset(&sp, 0, sizeof(sp));
sp.scrub_args.devid = di_args[i].devid;
ret = ioctl(fd, BTRFS_IOC_SCRUB_PROGRESS, &sp.scrub_args);
- if (ret < 0 && errno == ENODEV)
- continue;
- if (ret < 0 && errno == ENOTCONN)
- return 0;
if (!ret)
return 1;
}
- return 1;
+ return 0;
}
static const char * const cmd_scrub_start_usage[];
--
2.1.3
reply other threads:[~2015-01-19 18:01 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=1421690465-2465-1-git-send-email-dsterba@suse.cz \
--to=dsterba@suse.cz \
--cc=linux-btrfs@vger.kernel.org \
--cc=zab@zabbo.net \
/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).