if (a->flags & ATTR_IS_ENCRYPTED) { if (a->flags & ATTR_COMPRESSION_MASK) { ntfs_error(vi->i_sb, "Found encrypted and " "compressed data."); goto unm_err_out; } if (NInoMstProtected(ni)) { ntfs_error(vi->i_sb, "Found mst protected " "attribute but the attribute " "is encrypted.  Please report " "you saw this message to " "linux-ntfs-dev@lists." "sourceforge.net"); goto unm_err_out; } NInoSetEncrypted(ni); } 
static int ntfs_read_locked_attr_inode(struct inode *base_vi, struct inode *vi){	ntfs_volume *vol = NTFS_SB(vi->i_sb);	ntfs_inode *ni, *base_ni;	MFT_RECORD *m;	ATTR_RECORD *a;	ntfs_attr_search_ctx *ctx;	int err = 0;	ntfs_debug("Entering for i_ino 0x%lx.", vi->i_ino);	ntfs_init_big_inode(vi);	ni	= NTFS_I(vi);	base_ni = NTFS_I(base_vi);	/* Just mirror the values from the base inode. */	vi->i_blksize	= base_vi->i_blksize;	vi->i_version	= base_vi->i_version;	vi->i_uid	= base_vi->i_uid;	vi->i_gid	= base_vi->i_gid;	vi->i_nlink	= base_vi->i_nlink;	vi->i_mtime	= base_vi->i_mtime;	vi->i_ctime	= base_vi->i_ctime;	vi->i_atime	= base_vi->i_atime;	vi->i_generation = ni->seq_no = base_ni->seq_no;	/* Set inode type to zero but preserve permissions. */	vi->i_mode	= base_vi->i_mode & ~S_IFMT;	m = map_mft_record(base_ni);	if (IS_ERR(m)) {		err = PTR_ERR(m);		goto err_out;	}	ctx = ntfs_attr_get_search_ctx(base_ni, m);	if (!ctx) {		err = -ENOMEM;		goto unm_err_out;	}	/* Find the attribute. */	err = ntfs_attr_lookup(ni->type, ni->name, ni->name_len,			CASE_SENSITIVE, 0, NULL, 0, ctx);	if (unlikely(err))		goto unm_err_out;	a = ctx->attr;	if (!a->non_resident) {		/* Ensure the attribute name is placed before the value. */		if (unlikely(a->name_length && (le16_to_cpu(a->name_offset) >=				le16_to_cpu(a->data.resident.value_offset)))) {			ntfs_error(vol->sb, "Attribute name is placed after "					"the attribute value.");			goto unm_err_out;		}		if (NInoMstProtected(ni) || a->flags) {			ntfs_error(vi->i_sb, "Found mst protected attribute "					"or attribute with non-zero flags but "					"the attribute is resident.  Please "					"report you saw this message to "					"linux-ntfs-dev@lists.sourceforge.net");			goto unm_err_out;		}		vi->i_size = ni->initialized_size = le32_to_cpu(				a->data.resident.value_length);		ni->allocated_size = le32_to_cpu(a->length) -				le16_to_cpu(a->data.resident.value_offset);		if (vi->i_size > ni->allocated_size) {			ntfs_error(vi->i_sb, "Resident attribute is corrupt "					"(size exceeds allocation).");			goto unm_err_out;		}	} else {		NInoSetNonResident(ni);		/*		 * Ensure the attribute name is placed before the mapping pairs		 * array.		 */		if (unlikely(a->name_length && (le16_to_cpu(a->name_offset) >=				le16_to_cpu(				a->data.non_resident.mapping_pairs_offset)))) {			ntfs_error(vol->sb, "Attribute name is placed after "					"the mapping pairs array.");			goto unm_err_out;		}		if (a->flags & (ATTR_COMPRESSION_MASK | ATTR_IS_SPARSE)) {			if (a->flags & ATTR_COMPRESSION_MASK) {				NInoSetCompressed(ni);				if ((ni->type != AT_DATA) || (ni->type ==						AT_DATA && ni->name_len)) {					ntfs_error(vi->i_sb, "Found compressed "							"non-data or named "							"data attribute.  "							"Please report you "							"saw this message to "							"linux-ntfs-dev@lists."							"sourceforge.net");					goto unm_err_out;				}				if (vol->cluster_size > 4096) {					ntfs_error(vi->i_sb, "Found compressed "							"attribute but "							"compression is "							"disabled due to "							"cluster size (%i) > "							"4kiB.",							vol->cluster_size);					goto unm_err_out;				}				if ((a->flags & ATTR_COMPRESSION_MASK) !=						ATTR_IS_COMPRESSED) {					ntfs_error(vi->i_sb, "Found unknown "							"compression method.");					goto unm_err_out;				}			}			if (NInoMstProtected(ni)) {				ntfs_error(vi->i_sb, "Found mst protected "						"attribute but the attribute "						"is %s.  Please report you "						"saw this message to "						"linux-ntfs-dev@lists."						"sourceforge.net",						NInoCompressed(ni) ?						"compressed" : "sparse");				goto unm_err_out;			}			if (a->flags & ATTR_IS_SPARSE)				NInoSetSparse(ni);			if (a->data.non_resident.compression_unit != 4) {				ntfs_error(vi->i_sb, "Found nonstandard "						"compression unit (%u instead "						"of 4).  Cannot handle this.",						a->data.non_resident.						compression_unit);				err = -EOPNOTSUPP;				goto unm_err_out;			}			ni->itype.compressed.block_clusters = 1U <<					a->data.non_resident.compression_unit;			ni->itype.compressed.block_size = 1U << (					a->data.non_resident.compression_unit +					vol->cluster_size_bits);			ni->itype.compressed.block_size_bits = ffs(					ni->itype.compressed.block_size) - 1;			ni->itype.compressed.size = sle64_to_cpu(					a->data.non_resident.compressed_size);		}		if (a->flags & ATTR_IS_ENCRYPTED) {			if (a->flags & ATTR_COMPRESSION_MASK) {				ntfs_error(vi->i_sb, "Found encrypted and "						"compressed data.");				goto unm_err_out;			}			if (NInoMstProtected(ni)) {				ntfs_error(vi->i_sb, "Found mst protected "						"attribute but the attribute "						"is encrypted.  Please report "						"you saw this message to "						"linux-ntfs-dev@lists."						"sourceforge.net");				goto unm_err_out;			}			NInoSetEncrypted(ni);		}		if (a->data.non_resident.lowest_vcn) {			ntfs_error(vi->i_sb, "First extent of attribute has "					"non-zero lowest_vcn.");			goto unm_err_out;		}		vi->i_size = sle64_to_cpu(a->data.non_resident.data_size);		ni->initialized_size = sle64_to_cpu(				a->data.non_resident.initialized_size);		ni->allocated_size = sle64_to_cpu(				a->data.non_resident.allocated_size);	}	/* Setup the operations for this attribute inode. */	vi->i_op = NULL;	vi->i_fop = NULL;	if (NInoMstProtected(ni))		vi->i_mapping->a_ops = &ntfs_mst_aops;	else		vi->i_mapping->a_ops = &ntfs_aops;	if (NInoCompressed(ni) || NInoSparse(ni))		vi->i_blocks = ni->itype.compressed.size >> 9;	else		vi->i_blocks = ni->allocated_size >> 9;	/*	 * Make sure the base inode doesn't go away and attach it to the	 * attribute inode.	 */	igrab(base_vi);	ni->ext.base_ntfs_ino = base_ni;	ni->nr_extents = -1;	ntfs_attr_put_search_ctx(ctx);	unmap_mft_record(base_ni);	ntfs_debug("Done.");	return 0;unm_err_out:	if (!err)		err = -EIO;	if (ctx)		ntfs_attr_put_search_ctx(ctx);	unmap_mft_record(base_ni);err_out:	ntfs_error(vol->sb, "Failed with error code %i while reading attribute "			"inode (mft_no 0x%lx, type 0x%x, name_len %i).  "			"Marking corrupt inode and base inode 0x%lx as bad.  "			"Run chkdsk.", err, vi->i_ino, ni->type, ni->name_len,			base_vi->i_ino);	make_bad_inode(vi);	make_bad_inode(base_vi);	if (err != -ENOMEM)		NVolSetErrors(vol);	return err;}
4520	/local/tlutelli/issta_data/temp/c/2005_temp/2005/4520/67bb103725e4cde322cb4ddb160a12933c5c7072/inode.c/buggy/fs/ntfs/inode.c