Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 232572
b: refs/heads/master
c: af5eb74
h: refs/heads/master
v: v3
  • Loading branch information
Anton Altaparmakov authored and Linus Torvalds committed Jan 31, 2011
1 parent 89583bf commit 33c8071
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 5 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 9fbf0c08d441888b977f7c459c8aa57f2c0cb6ad
refs/heads/master: af5eb745efe97d91d2cbe793029838b3311c15da
2 changes: 2 additions & 0 deletions trunk/Documentation/filesystems/ntfs.txt
Original file line number Diff line number Diff line change
Expand Up @@ -460,6 +460,8 @@ Note, a technical ChangeLog aimed at kernel hackers is in fs/ntfs/ChangeLog.
2.1.30:
- Fix writev() (it kept writing the first segment over and over again
instead of moving onto subsequent segments).
- Fix crash in ntfs_mft_record_alloc() when mapping the new extent mft
record failed.
2.1.29:
- Fix a deadlock when mounting read-write.
2.1.28:
Expand Down
11 changes: 7 additions & 4 deletions trunk/fs/ntfs/mft.c
Original file line number Diff line number Diff line change
@@ -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-2011 Anton Altaparmakov and Tuxera Inc.
* Copyright (c) 2002 Richard Russon
*
* This program/include file is free software; you can redistribute it and/or
Expand Down Expand Up @@ -2576,6 +2576,8 @@ ntfs_inode *ntfs_mft_record_alloc(ntfs_volume *vol, const int mode,
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
Expand All @@ -2588,11 +2590,11 @@ ntfs_inode *ntfs_mft_record_alloc(ntfs_volume *vol, const int mode,
* 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));
Expand All @@ -2603,6 +2605,7 @@ ntfs_inode *ntfs_mft_record_alloc(ntfs_volume *vol, const int mode,
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
Expand Down

0 comments on commit 33c8071

Please sign in to comment.