summaryrefslogtreecommitdiffstats
path: root/fs/ntfs/mft.c
diff options
context:
space:
mode:
authorAnton Altaparmakov <aia21@cantab.net>2005-01-13 12:04:39 +0100
committerAnton Altaparmakov <aia21@cantab.net>2005-05-05 11:45:36 +0200
commit3834c3f227725e2395840aed82342bda4ee9d379 (patch)
tree7a145a78efc44cb5ddce614cdd2618c710c8e3b7 /fs/ntfs/mft.c
parentNTFS: Repeat a failed ntfs_truncate() in fs/ntfs/aops.c::ntfs_writepage() (diff)
downloadlinux-3834c3f227725e2395840aed82342bda4ee9d379.tar.xz
linux-3834c3f227725e2395840aed82342bda4ee9d379.zip
NTFS: Fix stupid bug in fs/ntfs/mft.c introduced in last changeset.
Signed-off-by: Anton Altaparmakov <aia21@cantab.net>
Diffstat (limited to '')
-rw-r--r--fs/ntfs/mft.c11
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:
* first written to so it optimizes away nicely in the common case.
*/
read_lock_irqsave(&mft_ni->size_lock, flags);
- old_data_size = mft_ni->allocated_size;
ntfs_debug("Status of mft data before extension: "
"allocated_size 0x%llx, data_size 0x%llx, "
"initialized_size 0x%llx.",
- (long long)old_data_size,
+ (long long)mft_ni->allocated_size,
(long long)i_size_read(vol->mft_ino),
(long long)mft_ni->initialized_size);
- read_unlock_irqrestore(&mft_ni->size_lock, flags);
- while (ll > old_data_size) {
+ while (ll > mft_ni->allocated_size) {
+ read_unlock_irqrestore(&mft_ni->size_lock, flags);
err = ntfs_mft_data_extend_allocation_nolock(vol);
if (unlikely(err)) {
ntfs_error(vol->sb, "Failed to extend mft data "
"allocation.");
goto undo_mftbmp_alloc_nolock;
}
-#ifdef DEBUG
read_lock_irqsave(&mft_ni->size_lock, flags);
ntfs_debug("Status of mft data after allocation extension: "
"allocated_size 0x%llx, data_size 0x%llx, "
@@ -2400,9 +2398,8 @@ have_alloc_rec:
(long long)mft_ni->allocated_size,
(long long)i_size_read(vol->mft_ino),
(long long)mft_ni->initialized_size);
- read_unlock_irqrestore(&mft_ni->size_lock, flags);
-#endif /* DEBUG */
}
+ read_unlock_irqrestore(&mft_ni->size_lock, flags);
/*
* Extend mft data initialized size (and data size of course) to reach
* the allocated mft record, formatting the mft records allong the way.