-------- Original Message --------
Subject: Re: [PATCH] btrfs-progs: make 'btrfs replace' signal-handling
works.
From: David Sterba <dsterba@xxxxxxx>
To: Qu Wenruo <quwenruo@xxxxxxxxxxxxxx>
Date: 2014年09月02日 19:25
On Wed, Aug 06, 2014 at 09:17:07AM +0800, Qu Wenruo wrote:
Current BTRFS_IOC_DEV_REPLACE ioctl is synchronous, and during the ioctl
program is fallen into kernel and unable to handle signal, the original
signal function will never be executed until the dev replace is done.
This is very annoying for someone who wants to stop dev replace by
Ctrl-c (we have to admit that's the most users will do when replacing
dev with nodatacow/nodatasum mount option).
This patch will create a thread to do the ioctl things, making the main
thread able to handle signal correctly.
As described under the kernel patch, I'd like to use the respective
cancel ioctls instead of signals.
I think I didn't describe it clear in the patch, the patch still uses
cancel ioctl to cancel the dev-replace,
it just makes the original dev_replace_handle_sigint() function get
called correctly.
(Before the patch, it will only be called after the ioctl is done, not
when Ctrl-C is pressed, as explained in patch)
If you mean 'dev-replace cancel' is correct way Ctrl-C should not be
used, then I can only agree with the first half.
Ctrl-C is almost a conditioned response for most people if they want to
stop some program,
due to the principle of least astonishment, I think the SIGINT handling
is still useful for most sysadmin.
Thanks,
Qu
--
To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html