From bf71036be72f43866c8bc8f55cd6d8af9bbe1591 Mon Sep 17 00:00:00 2001 From: Anton Altaparmakov Date: Fri, 18 Feb 2005 10:03:13 +0000 Subject: [PATCH] --- yaml --- r: 4847 b: refs/heads/master c: 37e4c13b987a7923ec13bda7368901b3e094fecb h: refs/heads/master i: 4845: 20ca18533bc999bf8014c5b17eedb19b9b48a54a 4843: 2e5645b0eabb582785700bab33536ea8411d1731 4839: e3f92d8121e692d556a0de77e8670d418330e380 4831: ac9efee298dc102415889dddfb133f404017f8bd v: v3 --- [refs] | 2 +- trunk/fs/ntfs/ChangeLog | 3 ++- trunk/fs/ntfs/runlist.c | 5 ++++- 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/[refs] b/[refs] index 8727cda74c21..97b094e4d4e8 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: d8ec785e0bf2941ed546711c2f240a3e030c39c7 +refs/heads/master: 37e4c13b987a7923ec13bda7368901b3e094fecb diff --git a/trunk/fs/ntfs/ChangeLog b/trunk/fs/ntfs/ChangeLog index 0ef1cd329096..53bb6c1404f2 100644 --- a/trunk/fs/ntfs/ChangeLog +++ b/trunk/fs/ntfs/ChangeLog @@ -72,9 +72,10 @@ ToDo/Notes: runlist. This allows us to find runlist elements with the runlist lock already held without having to drop and reacquire it around the call. Adapt all callers. - - Change time to u64 time.h::ntfs2utc() as it otherwise generates a + - Change time to u64 in time.h::ntfs2utc() as it otherwise generates a warning in the do_div() call on sparc32. Thanks to Meelis Roos for the report and analysis of the warning. + - Fix a nasty runlist merge bug when merging two holes. 2.1.22 - Many bug and race fixes and error handling improvements. diff --git a/trunk/fs/ntfs/runlist.c b/trunk/fs/ntfs/runlist.c index 5244687dfaa8..1b344dd4d407 100644 --- a/trunk/fs/ntfs/runlist.c +++ b/trunk/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? */