linux-btrfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Better handling of stale scrub status
@ 2014-05-20 15:30 Holger Hoffstätte
  2014-05-31 21:54 ` Marc MERLIN
  0 siblings, 1 reply; 2+ messages in thread
From: Holger Hoffstätte @ 2014-05-20 15:30 UTC (permalink / raw)
  To: linux-btrfs


As Marc Merlin recently wrote in his blog [1] scrub can sometimes leave a 
stale state file behind, making cancel/resume complain. I took a peek at 
the code and found most of the scrub state file handling fairly 
straightforward, so before I go off and start hacking, what would a 
better behaviour look like?

- delete the stale file?
- fix the file by setting the "finished" flag?
- something else entirely?

I currently lean towards fixing (and not printing an error?), but maybe 
someone else has different ideas about how this should be handled.
Any suggestions welcome..

cheers
Holger

[1] http://marc.merlins.org/perso/btrfs/post_2014-04-26_Btrfs-Tips_-
Cancel-A-Btrfs-Scrub-That-Is-Already-Stopped.html


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

* Re: Better handling of stale scrub status
  2014-05-20 15:30 Better handling of stale scrub status Holger Hoffstätte
@ 2014-05-31 21:54 ` Marc MERLIN
  0 siblings, 0 replies; 2+ messages in thread
From: Marc MERLIN @ 2014-05-31 21:54 UTC (permalink / raw)
  To: Holger Hoffstätte; +Cc: linux-btrfs

On Tue, May 20, 2014 at 03:30:48PM +0000, Holger Hoffstätte wrote:
> As Marc Merlin recently wrote in his blog [1] scrub can sometimes leave a 
> stale state file behind, making cancel/resume complain. I took a peek at 
> the code and found most of the scrub state file handling fairly 
> straightforward, so before I go off and start hacking, what would a 
> better behaviour look like?
> 
> - delete the stale file?
> - fix the file by setting the "finished" flag?
> - something else entirely?

So while writing the workaround I was also indeed thinking we should
just fix the tool, I just haven't had time to look at it myself yet.

Basically once you have a way to confirm that indeed there is no scrub
running, I'd say the best is to set the finished flag, as if someone has
cancelled the scrub before shutting down the machine.

> I currently lean towards fixing (and not printing an error?), but maybe 
> someone else has different ideas about how this should be handled.
> Any suggestions welcome..

Yeah, it's a spurious error, auto fixing is the right solution.

Marc
-- 
"A mouse is a device used to point at the xterm you want to type in" - A.S.R.
Microsoft is to operating systems ....
                                      .... what McDonalds is to gourmet cooking
Home page: http://marc.merlins.org/                         | PGP 1024R/763BE901

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

end of thread, other threads:[~2014-05-31 21:54 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-05-20 15:30 Better handling of stale scrub status Holger Hoffstätte
2014-05-31 21:54 ` Marc MERLIN

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