From: Fernando Luis Vazquez Cao Subject: Re: [PATCH 12/17] fsfreeze: sb-level/bdev-level fsfreeze integration Date: Thu, 10 Jan 2013 18:57:17 +0900 Message-ID: <50EE907D.2050804@lab.ntt.co.jp> References: <1357557492.8183.1.camel@nexus.lab.ntt.co.jp> <1357558704.8183.19.camel@nexus.lab.ntt.co.jp> <20130109163737.GE17353@quack.suse.cz> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: QUOTED-PRINTABLE Cc: Al Viro , Josef Bacik , Eric Sandeen , Dave Chinner , Christoph Hellwig , Luiz Capitulino , linux-fsdevel@vger.kernel.org To: Jan Kara Return-path: Received: from tama500.ecl.ntt.co.jp ([129.60.39.148]:58359 "EHLO tama500.ecl.ntt.co.jp" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750800Ab3AJJ6O (ORCPT ); Thu, 10 Jan 2013 04:58:14 -0500 In-Reply-To: <20130109163737.GE17353@quack.suse.cz> Sender: linux-fsdevel-owner@vger.kernel.org List-ID: On 2013/01/10 01:37, Jan Kara wrote: > On Mon 07-01-13 20:38:24, Fernando Luis V=E1zquez Cao wrote: >> As things stand now a filesystem frozen through the in-kernel bdev=20 level API >> can be thawed using the userspace sb level API, which can lead to=20 accidental >> corruption of filesystem snapshots and backups. >> >> To address this problem we modify the in-kernel API so that we can = tell >> fsfreeze that a kernel initiated freeze is in progress and that the= =20 filesystem >> should not be thawed no matter how many times the FITHAW ioctl is=20 invoked. > > I'm not sure if this isn't going too far in the direction of tryin= g to > prevent sysadmin to shoot himself in the foot. For well written=20 applications > where FITHAW and FIFREEZE are paired, things should work OK after yo= ur > initial fixes. And if someone calls unpaired FITHAW, things can brea= k > spectacularly anyway for other users of FIFREEZE. So I just wouldn't= =20 bother > with any more protections. What do you think? I think that FITHAW/FIFREEZE should not interfere with (freeze/thaw)_bdev, which is an internal kernel API. It could be the case that users of freeze_bdev (external modules) cannot handle a scenario where a frozen filesystem is unexpectedly thawed through the userspace API. This kind of protection is also beneficial in virtualization environments where there can be hypervisor initiated uses of the fsfreeze API (this is a reality in KVM with the advent of QEMU's guest agent), which means that we effectively have two administrative domains (the guest's and hypervisor's). It would be nice if we can avoid situations where a guest initiated dm-snapshot is not affected by a spurious FITHAW request from the hypervisor. If the added complexity is acceptable I think this king of protections is desirable. - Fernando -- To unsubscribe from this list: send the line "unsubscribe linux-fsdevel= " in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html