diff options
-rw-r--r-- | fs/ntfs/mft.c | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/fs/ntfs/mft.c b/fs/ntfs/mft.c index 20011e02f5b6..4e0bf39426cf 100644 --- a/fs/ntfs/mft.c +++ b/fs/ntfs/mft.c | |||
@@ -2377,22 +2377,20 @@ have_alloc_rec: | |||
2377 | * first written to so it optimizes away nicely in the common case. | 2377 | * first written to so it optimizes away nicely in the common case. |
2378 | */ | 2378 | */ |
2379 | read_lock_irqsave(&mft_ni->size_lock, flags); | 2379 | read_lock_irqsave(&mft_ni->size_lock, flags); |
2380 | old_data_size = mft_ni->allocated_size; | ||
2381 | ntfs_debug("Status of mft data before extension: " | 2380 | ntfs_debug("Status of mft data before extension: " |
2382 | "allocated_size 0x%llx, data_size 0x%llx, " | 2381 | "allocated_size 0x%llx, data_size 0x%llx, " |
2383 | "initialized_size 0x%llx.", | 2382 | "initialized_size 0x%llx.", |
2384 | (long long)old_data_size, | 2383 | (long long)mft_ni->allocated_size, |
2385 | (long long)i_size_read(vol->mft_ino), | 2384 | (long long)i_size_read(vol->mft_ino), |
2386 | (long long)mft_ni->initialized_size); | 2385 | (long long)mft_ni->initialized_size); |
2387 | read_unlock_irqrestore(&mft_ni->size_lock, flags); | 2386 | while (ll > mft_ni->allocated_size) { |
2388 | while (ll > old_data_size) { | 2387 | read_unlock_irqrestore(&mft_ni->size_lock, flags); |
2389 | err = ntfs_mft_data_extend_allocation_nolock(vol); | 2388 | err = ntfs_mft_data_extend_allocation_nolock(vol); |
2390 | if (unlikely(err)) { | 2389 | if (unlikely(err)) { |
2391 | ntfs_error(vol->sb, "Failed to extend mft data " | 2390 | ntfs_error(vol->sb, "Failed to extend mft data " |
2392 | "allocation."); | 2391 | "allocation."); |
2393 | goto undo_mftbmp_alloc_nolock; | 2392 | goto undo_mftbmp_alloc_nolock; |
2394 | } | 2393 | } |
2395 | #ifdef DEBUG | ||
2396 | read_lock_irqsave(&mft_ni->size_lock, flags); | 2394 | read_lock_irqsave(&mft_ni->size_lock, flags); |
2397 | ntfs_debug("Status of mft data after allocation extension: " | 2395 | ntfs_debug("Status of mft data after allocation extension: " |
2398 | "allocated_size 0x%llx, data_size 0x%llx, " | 2396 | "allocated_size 0x%llx, data_size 0x%llx, " |
@@ -2400,9 +2398,8 @@ have_alloc_rec: | |||
2400 | (long long)mft_ni->allocated_size, | 2398 | (long long)mft_ni->allocated_size, |
2401 | (long long)i_size_read(vol->mft_ino), | 2399 | (long long)i_size_read(vol->mft_ino), |
2402 | (long long)mft_ni->initialized_size); | 2400 | (long long)mft_ni->initialized_size); |
2403 | read_unlock_irqrestore(&mft_ni->size_lock, flags); | ||
2404 | #endif /* DEBUG */ | ||
2405 | } | 2401 | } |
2402 | read_unlock_irqrestore(&mft_ni->size_lock, flags); | ||
2406 | /* | 2403 | /* |
2407 | * Extend mft data initialized size (and data size of course) to reach | 2404 | * Extend mft data initialized size (and data size of course) to reach |
2408 | * the allocated mft record, formatting the mft records allong the way. | 2405 | * the allocated mft record, formatting the mft records allong the way. |