aboutsummaryrefslogtreecommitdiffstats
path: root/fs
diff options
context:
space:
mode:
authorAnton Altaparmakov <aia21@cantab.net>2005-02-18 05:03:13 -0500
committerAnton Altaparmakov <aia21@cantab.net>2005-05-05 06:03:01 -0400
commit37e4c13b987a7923ec13bda7368901b3e094fecb (patch)
tree781dcc0990fc42c26492206261d4b5f325715821 /fs
parentd8ec785e0bf2941ed546711c2f240a3e030c39c7 (diff)
NTFS: Fix a nasty runlist merge bug when merging two holes.
Signed-off-by: Anton Altaparmakov <aia21@cantab.net>
Diffstat (limited to 'fs')
-rw-r--r--fs/ntfs/ChangeLog3
-rw-r--r--fs/ntfs/runlist.c5
2 files changed, 6 insertions, 2 deletions
diff --git a/fs/ntfs/ChangeLog b/fs/ntfs/ChangeLog
index 0ef1cd329096..53bb6c1404f2 100644
--- a/fs/ntfs/ChangeLog
+++ b/fs/ntfs/ChangeLog
@@ -72,9 +72,10 @@ ToDo/Notes:
72 runlist. This allows us to find runlist elements with the runlist 72 runlist. This allows us to find runlist elements with the runlist
73 lock already held without having to drop and reacquire it around the 73 lock already held without having to drop and reacquire it around the
74 call. Adapt all callers. 74 call. Adapt all callers.
75 - Change time to u64 time.h::ntfs2utc() as it otherwise generates a 75 - Change time to u64 in time.h::ntfs2utc() as it otherwise generates a
76 warning in the do_div() call on sparc32. Thanks to Meelis Roos for 76 warning in the do_div() call on sparc32. Thanks to Meelis Roos for
77 the report and analysis of the warning. 77 the report and analysis of the warning.
78 - Fix a nasty runlist merge bug when merging two holes.
78 79
792.1.22 - Many bug and race fixes and error handling improvements. 802.1.22 - Many bug and race fixes and error handling improvements.
80 81
diff --git a/fs/ntfs/runlist.c b/fs/ntfs/runlist.c
index 5244687dfaa8..1b344dd4d407 100644
--- a/fs/ntfs/runlist.c
+++ b/fs/ntfs/runlist.c
@@ -113,8 +113,11 @@ static inline BOOL ntfs_are_rl_mergeable(runlist_element *dst,
113 BUG_ON(!dst); 113 BUG_ON(!dst);
114 BUG_ON(!src); 114 BUG_ON(!src);
115 115
116 if ((dst->lcn < 0) || (src->lcn < 0)) /* Are we merging holes? */ 116 if ((dst->lcn < 0) || (src->lcn < 0)) { /* Are we merging holes? */
117 if (dst->lcn == LCN_HOLE && src->lcn == LCN_HOLE)
118 return TRUE;
117 return FALSE; 119 return FALSE;
120 }
118 if ((dst->lcn + dst->length) != src->lcn) /* Are the runs contiguous? */ 121 if ((dst->lcn + dst->length) != src->lcn) /* Are the runs contiguous? */
119 return FALSE; 122 return FALSE;
120 if ((dst->vcn + dst->length) != src->vcn) /* Are the runs misaligned? */ 123 if ((dst->vcn + dst->length) != src->vcn) /* Are the runs misaligned? */