Skip to content

Commit

Permalink
NTFS: Fix a nasty runlist merge bug when merging two holes.
Browse files Browse the repository at this point in the history
Signed-off-by: Anton Altaparmakov <aia21@cantab.net>
  • Loading branch information
AntonAltaparmakov committed May 5, 2005
1 parent d8ec785 commit 37e4c13
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
3 changes: 2 additions & 1 deletion fs/ntfs/ChangeLog
Original file line number Diff line number Diff line change
Expand Up @@ -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.

Expand Down
5 changes: 4 additions & 1 deletion fs/ntfs/runlist.c
Original file line number Diff line number Diff line change
Expand Up @@ -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? */
Expand Down

0 comments on commit 37e4c13

Please sign in to comment.