OSDN Git Service

libext2fs: search all possible blocks in implied_cluster_alloc()
authorDarrick J. Wong <darrick.wong@oracle.com>
Tue, 8 Oct 2013 16:08:46 +0000 (12:08 -0400)
committerTheodore Ts'o <tytso@mit.edu>
Tue, 8 Oct 2013 16:08:49 +0000 (12:08 -0400)
commit2a091427bcbff1fd1cf3f0bccf00da98d52b8f16
tree934bf5ee171b92119020230fff9a86472f5c2a02
parent4605a35d1ef573dc166a73ed910d0ee7b02489cb
libext2fs: search all possible blocks in implied_cluster_alloc()

implied_cluster_alloc() is written such that if the the user passes in
a logical block that is the zeroth block in a logical cluster (lblk %
cluster_ratio == 0), then it will assume that there is no physical
cluster mapped to any other part of the logical cluster.

This is not true if we happen to be allocating logical blocks in
reverse order.  Therefore, search the whole cluster, except for the
lblk that we passed in.

Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
lib/ext2fs/bmap.c