From mboxrd@z Thu Jan 1 00:00:00 1970 From: Fernando Luis Vazquez Cao Subject: Re: [PATCH 6/8] fsfreeze: add vfs ioctl to check freeze state Date: Thu, 13 Sep 2012 15:11:54 +0900 Message-ID: <5051792A.1090003@lab.ntt.co.jp> References: <1342083464.7033.6.camel@nexus.lab.ntt.co.jp> <1342084214.7033.16.camel@nexus.lab.ntt.co.jp> <20120713135454.GI20361@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 , Dave Chinner , Christoph Hellwig , linux-fsdevel@vger.kernel.org To: Jan Kara Return-path: Received: from tama50.ecl.ntt.co.jp ([129.60.39.147]:50334 "EHLO tama50.ecl.ntt.co.jp" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751146Ab2IMGMV (ORCPT ); Thu, 13 Sep 2012 02:12:21 -0400 In-Reply-To: <20120713135454.GI20361@quack.suse.cz> Sender: linux-fsdevel-owner@vger.kernel.org List-ID: On 2012/07/13 22:54, Jan Kara wrote: > 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 che= ck >> the freeze state of a mounted filesystem. >> >> Cc: Christoph Hellwig >> Cc: Jan Kara >> Cc: Dave Chinner >> Signed-off-by: Fernando Luis Vazquez Cao >> --- >> >> 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? It is just for consistency with what FIFREEZE and FITHAW require in terms of ACLs. If it is deemed too strict for a check ioctl I can remove it. Thanks, =46ernando -- 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