aboutsummaryrefslogtreecommitdiffstats
path: root/fs/ntfs/file.c
diff options
context:
space:
mode:
authorAnton Altaparmakov <aia21@cantab.net>2005-11-01 10:49:31 -0500
committerAnton Altaparmakov <aia21@cantab.net>2005-11-01 10:49:31 -0500
commit3aebf25bdcf030f3e4afeb9340486d5b46deb46e (patch)
treed4a0d4e1f0aff3a808846807f3b4d2fd9fa35667 /fs/ntfs/file.c
parent1f04c0a24b2f3cfe89c802a24396263623e3512d (diff)
NTFS: Fix a stupid bug causing writes to non-initialized pages to segfault.
Signed-off-by: Anton Altaparmakov <aia21@cantab.net>
Diffstat (limited to 'fs/ntfs/file.c')
-rw-r--r--fs/ntfs/file.c17
1 files changed, 9 insertions, 8 deletions
diff --git a/fs/ntfs/file.c b/fs/ntfs/file.c
index cf3e6ced2d01..727533891813 100644
--- a/fs/ntfs/file.c
+++ b/fs/ntfs/file.c
@@ -668,10 +668,10 @@ map_buffer_cached:
668 * to, we need to read it in before the write, 668 * to, we need to read it in before the write,
669 * i.e. now. 669 * i.e. now.
670 */ 670 */
671 if (!buffer_uptodate(bh) && ((bh_pos < pos && 671 if (!buffer_uptodate(bh) && bh_pos < end &&
672 bh_end > pos) || 672 bh_end > pos &&
673 (bh_end > end && 673 (bh_pos < pos ||
674 bh_end > end))) { 674 bh_end > end)) {
675 /* 675 /*
676 * If the buffer is fully or partially 676 * If the buffer is fully or partially
677 * within the initialized size, do an 677 * within the initialized size, do an
@@ -784,10 +784,11 @@ retry_remap:
784 blocksize_bits); 784 blocksize_bits);
785 cdelta = 0; 785 cdelta = 0;
786 /* 786 /*
787 * If the number of remaining clusters in the 787 * If the number of remaining clusters touched
788 * @pages is smaller or equal to the number of 788 * by the write is smaller or equal to the
789 * cached clusters, unlock the runlist as the 789 * number of cached clusters, unlock the
790 * map cache will be used from now on. 790 * runlist as the map cache will be used from
791 * now on.
791 */ 792 */
792 if (likely(vcn + vcn_len >= cend)) { 793 if (likely(vcn + vcn_len >= cend)) {
793 if (rl_write_locked) { 794 if (rl_write_locked) {