[PATCH] reiserfs: Check if attrs are enabled for attr ioctls

From: Jeff Mahoney
Date: Wed Jun 29 2005 - 17:55:09 EST


ReiserFS currently will allow the user to set/get attrs for files regardless
if they are enabled. The patch checks to see if they are enabled, and returns
-NOTTY if they are not.

ext[23] doesn't need this check because attrs are always enabled.

Please apply.

Signed-off-by: Jeff Mahoney <jeffm@xxxxxxxx>

diff -ruNpX dontdiff linux-2.6.12-rc6/fs/reiserfs/ioctl.c linux-2.6.12-rc6.devel/fs/reiserfs/ioctl.c
--- linux-2.6.12-rc6/fs/reiserfs/ioctl.c 2005-06-13 14:34:32.000000000 -0400
+++ linux-2.6.12-rc6.devel/fs/reiserfs/ioctl.c 2005-06-22 17:30:40.000000000 -0400
@@ -34,10 +34,16 @@ int reiserfs_ioctl (struct inode * inode
/* following two cases are taken from fs/ext2/ioctl.c by Remy
Card (card@xxxxxxxxxxx) */
case REISERFS_IOC_GETFLAGS:
+ if (!reiserfs_attrs (inode->i_sb))
+ return -ENOTTY;
+
flags = REISERFS_I(inode) -> i_attrs;
i_attrs_to_sd_attrs( inode, ( __u16 * ) &flags );
return put_user(flags, (int __user *) arg);
case REISERFS_IOC_SETFLAGS: {
+ if (!reiserfs_attrs (inode->i_sb))
+ return -ENOTTY;
+
if (IS_RDONLY(inode))
return -EROFS;

--
Jeff Mahoney
SuSE Labs
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/