aboutsummaryrefslogtreecommitdiffstats
path: root/fs/ntfs/runlist.c
diff options
context:
space:
mode:
authorAnton Altaparmakov <aia21@cantab.net>2005-02-18 10:03:13 +0000
committerAnton Altaparmakov <aia21@cantab.net>2005-05-05 11:03:01 +0100
commit37e4c13b987a7923ec13bda7368901b3e094fecb (patch)
tree781dcc0990fc42c26492206261d4b5f325715821 /fs/ntfs/runlist.c
parentNTFS: Change time to u64 in time.h::ntfs2utc() as it otherwise generates a (diff)
downloadlinux-dev-37e4c13b987a7923ec13bda7368901b3e094fecb.tar.xz
linux-dev-37e4c13b987a7923ec13bda7368901b3e094fecb.zip
NTFS: Fix a nasty runlist merge bug when merging two holes.
Signed-off-by: Anton Altaparmakov <aia21@cantab.net>
Diffstat (limited to 'fs/ntfs/runlist.c')
-rw-r--r--fs/ntfs/runlist.c5
1 files changed, 4 insertions, 1 deletions
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,
BUG_ON(!dst);
BUG_ON(!src);
- if ((dst->lcn < 0) || (src->lcn < 0)) /* Are we merging holes? */
+ if ((dst->lcn < 0) || (src->lcn < 0)) { /* Are we merging holes? */
+ if (dst->lcn == LCN_HOLE && src->lcn == LCN_HOLE)
+ return TRUE;
return FALSE;
+ }
if ((dst->lcn + dst->length) != src->lcn) /* Are the runs contiguous? */
return FALSE;
if ((dst->vcn + dst->length) != src->vcn) /* Are the runs misaligned? */