From 37e4c13b987a7923ec13bda7368901b3e094fecb Mon Sep 17 00:00:00 2001 From: Anton Altaparmakov Date: Fri, 18 Feb 2005 10:03:13 +0000 Subject: NTFS: Fix a nasty runlist merge bug when merging two holes. Signed-off-by: Anton Altaparmakov --- fs/ntfs/runlist.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'fs/ntfs/runlist.c') diff --git a/fs/ntfs/runlist.c b/fs/ntfs/runlist.c index 5244687dfaa..1b344dd4d40 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? */ -- cgit v1.2.3