if (!reiserfs_attrs (inode->i_sb)) return -ENOTTY;  
int reiserfs_ioctl (struct inode * inode, struct file * filp, unsigned int cmd,		unsigned long arg){	unsigned int flags;	switch (cmd) {	    case REISERFS_IOC_UNPACK:		if( S_ISREG( inode -> i_mode ) ) {		if (arg)		    return reiserfs_unpack (inode, filp);			else				return 0;		} else			return -ENOTTY;	/* following two cases are taken from fs/ext2/ioctl.c by Remy	   Card (card@masi.ibp.fr) */	case REISERFS_IOC_GETFLAGS:		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 (IS_RDONLY(inode))			return -EROFS;		if ((current->fsuid != inode->i_uid) && !capable(CAP_FOWNER))			return -EPERM;		if (get_user(flags, (int __user *) arg))			return -EFAULT;		if ( ( ( flags ^ REISERFS_I(inode) -> i_attrs) & ( REISERFS_IMMUTABLE_FL | REISERFS_APPEND_FL)) &&		     !capable( CAP_LINUX_IMMUTABLE ) )			return -EPERM;					if( ( flags & REISERFS_NOTAIL_FL ) &&		    S_ISREG( inode -> i_mode ) ) {				int result;				result = reiserfs_unpack( inode, filp );				if( result )					return result;		}		sd_attrs_to_i_attrs( flags, inode );		REISERFS_I(inode) -> i_attrs = flags;		inode->i_ctime = CURRENT_TIME_SEC;		mark_inode_dirty(inode);		return 0;	}	case REISERFS_IOC_GETVERSION:		return put_user(inode->i_generation, (int __user *) arg);	case REISERFS_IOC_SETVERSION:		if ((current->fsuid != inode->i_uid) && !capable(CAP_FOWNER))			return -EPERM;		if (IS_RDONLY(inode))			return -EROFS;		if (get_user(inode->i_generation, (int __user *) arg))			return -EFAULT;			inode->i_ctime = CURRENT_TIME_SEC;		mark_inode_dirty(inode);		return 0;	default:		return -ENOTTY;	}}
10457	/local/tlutelli/issta_data/temp/c/2005_temp/2005/10457/869eb76e7b60ebd8f87a358b72e97fa0aef1d1f5/ioctl.c/buggy/fs/reiserfs/ioctl.c