From: Jan Kara Subject: Re: [PATCH 6/8] fsfreeze: add vfs ioctl to check freeze state Date: Fri, 13 Jul 2012 15:54:54 +0200 Message-ID: <20120713135454.GI20361@quack.suse.cz> References: <1342083464.7033.6.camel@nexus.lab.ntt.co.jp> <1342084214.7033.16.camel@nexus.lab.ntt.co.jp> Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: QUOTED-PRINTABLE Cc: Al Viro , Jan Kara , Dave Chinner , Christoph Hellwig , linux-fsdevel@vger.kernel.org To: Fernando Luis =?iso-8859-1?Q?V=E1zquez?= Cao Return-path: Received: from cantor2.suse.de ([195.135.220.15]:51569 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751031Ab2GMNyz (ORCPT ); Fri, 13 Jul 2012 09:54:55 -0400 Content-Disposition: inline In-Reply-To: <1342084214.7033.16.camel@nexus.lab.ntt.co.jp> Sender: linux-fsdevel-owner@vger.kernel.org List-ID: On Thu 12-07-12 18:10:14, Fernando Luis V=E1zquez Cao wrote: > The FIISFROZEN ioctl can be use by HA and monitoring software to chec= k > the freeze state of a mounted filesystem. >=20 > Cc: Christoph Hellwig > Cc: Jan Kara > Cc: Dave Chinner > Signed-off-by: Fernando Luis Vazquez Cao > --- >=20 > diff -urNp vfs-orig/fs/compat_ioctl.c vfs/fs/compat_ioctl.c > --- vfs-orig/fs/compat_ioctl.c 2012-07-04 18:57:54.000000000 +0900 > +++ vfs/fs/compat_ioctl.c 2012-07-12 17:25:37.592626439 +0900 > @@ -885,6 +885,7 @@ COMPATIBLE_IOCTL(FIGETBSZ) > /* 'X' - originally XFS but some now in the VFS */ > COMPATIBLE_IOCTL(FIFREEZE) > COMPATIBLE_IOCTL(FITHAW) > +COMPATIBLE_IOCTL(FIISFROZEN) > COMPATIBLE_IOCTL(KDGETKEYCODE) > COMPATIBLE_IOCTL(KDSETKEYCODE) > COMPATIBLE_IOCTL(KDGKBTYPE) > diff -urNp vfs-orig/fs/ioctl.c vfs/fs/ioctl.c > --- vfs-orig/fs/ioctl.c 2012-07-04 18:57:54.000000000 +0900 > +++ vfs/fs/ioctl.c 2012-07-12 17:25:37.592626439 +0900 > @@ -536,6 +536,16 @@ static int ioctl_fsthaw(struct file *fil > return thaw_super(sb); > } > =20 > +static int ioctl_fs_isfrozen(struct file *filp) > +{ > + struct super_block *sb =3D filp->f_path.dentry->d_inode->i_sb; > + > + if (!capable(CAP_SYS_ADMIN)) > + return -EPERM; > + > + return isfrozen_super(sb); > +} > + Is there any reason to restrict this to CAP_SYS_ADMIN? Honza --=20 Jan Kara SUSE Labs, CR -- 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