Re: [RFC PATCH] btrfs-progs: btrfsck operations should be exclusive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Mon, Jan 13, 2014 at 09:14:55PM +0800, Anand Jain wrote:
> From: Anand Jain <Anand.Jain@xxxxxxxxxx>
> 
> this patch will make btrfsck operations to open disk in exclusive mode,
> so that mount will fail when btrfsck is running

Makes sense, especially if fsck is in the repair mode, mounting such fs
would be bad.

> --- a/disk-io.h
> +++ b/disk-io.h
> @@ -32,6 +32,7 @@ enum btrfs_open_ctree_flags {
>  	OPEN_CTREE_RECOVER_SUPER	= 8,
>  	OPEN_CTREE_RESTORE		= 16,
>  	OPEN_CTREE_NO_BLOCK_GROUPS	= 32,
> +	OPEN_CTREE_O_EXCL		= 64,

I'd rather pick a more descriptive name, matching to the others, eg.
OPEN_CTREE_EXCLUSIVE, which would translate to the O_EXCL open mode.

As you've implemented it, the exclusive mode applies to both read-only
and write/repair modes, which is imho right and should prevent
accidental errors, ie. a safe default.


david
--
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




[Index of Archives]     [Linux Filesystem Development]     [Linux NFS]     [Linux NILFS]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux