diff options
Diffstat (limited to 'fs/ntfs/mft.c')
| -rw-r--r-- | fs/ntfs/mft.c | 23 | 
1 files changed, 13 insertions, 10 deletions
diff --git a/fs/ntfs/mft.c b/fs/ntfs/mft.c index b572b672718..3014a36a255 100644 --- a/fs/ntfs/mft.c +++ b/fs/ntfs/mft.c @@ -1,7 +1,7 @@  /**   * mft.c - NTFS kernel mft record operations. Part of the Linux-NTFS project.   * - * Copyright (c) 2001-2006 Anton Altaparmakov + * Copyright (c) 2001-2012 Anton Altaparmakov and Tuxera Inc.   * Copyright (c) 2002 Richard Russon   *   * This program/include file is free software; you can redistribute it and/or @@ -73,7 +73,7 @@ static inline MFT_RECORD *map_mft_record_page(ntfs_inode *ni)  		if (index > end_index || (i_size & ~PAGE_CACHE_MASK) < ofs +  				vol->mft_record_size) {  			page = ERR_PTR(-ENOENT); -			ntfs_error(vol->sb, "Attemt to read mft record 0x%lx, " +			ntfs_error(vol->sb, "Attempt to read mft record 0x%lx, "  					"which is beyond the end of the mft.  "  					"This is probably a bug in the ntfs "  					"driver.", ni->mft_no); @@ -1367,7 +1367,7 @@ static int ntfs_mft_bitmap_extend_allocation_nolock(ntfs_volume *vol)  			ntfs_error(vol->sb, "Failed to merge runlists for mft "  					"bitmap.");  			if (ntfs_cluster_free_from_rl(vol, rl2)) { -				ntfs_error(vol->sb, "Failed to dealocate " +				ntfs_error(vol->sb, "Failed to deallocate "  						"allocated cluster.%s", es);  				NVolSetErrors(vol);  			} @@ -1442,7 +1442,7 @@ static int ntfs_mft_bitmap_extend_allocation_nolock(ntfs_volume *vol)  		// Note: It will need to be a special mft record and if none of  		// those are available it gets rather complicated...  		ntfs_error(vol->sb, "Not enough space in this mft record to " -				"accomodate extended mft bitmap attribute " +				"accommodate extended mft bitmap attribute "  				"extent.  Cannot handle this yet.");  		ret = -EOPNOTSUPP;  		goto undo_alloc; @@ -1805,7 +1805,7 @@ static int ntfs_mft_data_extend_allocation_nolock(ntfs_volume *vol)  		ntfs_error(vol->sb, "Failed to merge runlists for mft data "  				"attribute.");  		if (ntfs_cluster_free_from_rl(vol, rl2)) { -			ntfs_error(vol->sb, "Failed to dealocate clusters " +			ntfs_error(vol->sb, "Failed to deallocate clusters "  					"from the mft data attribute.%s", es);  			NVolSetErrors(vol);  		} @@ -1879,7 +1879,7 @@ static int ntfs_mft_data_extend_allocation_nolock(ntfs_volume *vol)  		// and we would then need to update all references to this mft  		// record appropriately.  This is rather complicated...  		ntfs_error(vol->sb, "Not enough space in this mft record to " -				"accomodate extended mft data attribute " +				"accommodate extended mft data attribute "  				"extent.  Cannot handle this yet.");  		ret = -EOPNOTSUPP;  		goto undo_alloc; @@ -2357,7 +2357,7 @@ ntfs_inode *ntfs_mft_record_alloc(ntfs_volume *vol, const int mode,  	}  #ifdef DEBUG  	read_lock_irqsave(&mftbmp_ni->size_lock, flags); -	ntfs_debug("Status of mftbmp after initialized extention: " +	ntfs_debug("Status of mftbmp after initialized extension: "  			"allocated_size 0x%llx, data_size 0x%llx, "  			"initialized_size 0x%llx.",  			(long long)mftbmp_ni->allocated_size, @@ -2576,6 +2576,8 @@ mft_rec_already_initialized:  	flush_dcache_page(page);  	SetPageUptodate(page);  	if (base_ni) { +		MFT_RECORD *m_tmp; +  		/*  		 * Setup the base mft record in the extent mft record.  This  		 * completes initialization of the allocated extent mft record @@ -2588,11 +2590,11 @@ mft_rec_already_initialized:  		 * attach it to the base inode @base_ni and map, pin, and lock  		 * its, i.e. the allocated, mft record.  		 */ -		m = map_extent_mft_record(base_ni, bit, &ni); -		if (IS_ERR(m)) { +		m_tmp = map_extent_mft_record(base_ni, bit, &ni); +		if (IS_ERR(m_tmp)) {  			ntfs_error(vol->sb, "Failed to map allocated extent "  					"mft record 0x%llx.", (long long)bit); -			err = PTR_ERR(m); +			err = PTR_ERR(m_tmp);  			/* Set the mft record itself not in use. */  			m->flags &= cpu_to_le16(  					~le16_to_cpu(MFT_RECORD_IN_USE)); @@ -2603,6 +2605,7 @@ mft_rec_already_initialized:  			ntfs_unmap_page(page);  			goto undo_mftbmp_alloc;  		} +		BUG_ON(m != m_tmp);  		/*  		 * Make sure the allocated mft record is written out to disk.  		 * No need to set the inode dirty because the caller is going  | 
