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

From: Jeff Mahoney (jeffm_at_suse.com)
Date: 06/30/05

  • Next message: Chris Wedgwood: "Re: Build-in XML support?"
    Date:	Wed, 29 Jun 2005 18:52:28 -0400
    To: Andrew Morton <akpm@osdl.org>, Linus Torvalds <torvalds@osdl.org>, Linux Kernel Mailing List <linux-kernel@vger.kernel.org>
    
    

     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@suse.com>
     
    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@masi.ibp.fr) */
             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@vger.kernel.org
    More majordomo info at  http://vger.kernel.org/majordomo-info.html
    Please read the FAQ at  http://www.tux.org/lkml/
    

  • Next message: Chris Wedgwood: "Re: Build-in XML support?"