|
@@ -152,7 +152,7 @@ static u32 ocfs2_bits_per_group(struct ocfs2_chain_list *cl)
|
|
|
|
|
|
#define do_error(fmt, ...) \
|
|
#define do_error(fmt, ...) \
|
|
do{ \
|
|
do{ \
|
|
- if (clean_error) \
|
|
|
|
|
|
+ if (resize) \
|
|
mlog(ML_ERROR, fmt "\n", ##__VA_ARGS__); \
|
|
mlog(ML_ERROR, fmt "\n", ##__VA_ARGS__); \
|
|
else \
|
|
else \
|
|
ocfs2_error(sb, fmt, ##__VA_ARGS__); \
|
|
ocfs2_error(sb, fmt, ##__VA_ARGS__); \
|
|
@@ -160,7 +160,7 @@ static u32 ocfs2_bits_per_group(struct ocfs2_chain_list *cl)
|
|
|
|
|
|
static int ocfs2_validate_gd_self(struct super_block *sb,
|
|
static int ocfs2_validate_gd_self(struct super_block *sb,
|
|
struct buffer_head *bh,
|
|
struct buffer_head *bh,
|
|
- int clean_error)
|
|
|
|
|
|
+ int resize)
|
|
{
|
|
{
|
|
struct ocfs2_group_desc *gd = (struct ocfs2_group_desc *)bh->b_data;
|
|
struct ocfs2_group_desc *gd = (struct ocfs2_group_desc *)bh->b_data;
|
|
|
|
|
|
@@ -211,7 +211,7 @@ static int ocfs2_validate_gd_self(struct super_block *sb,
|
|
static int ocfs2_validate_gd_parent(struct super_block *sb,
|
|
static int ocfs2_validate_gd_parent(struct super_block *sb,
|
|
struct ocfs2_dinode *di,
|
|
struct ocfs2_dinode *di,
|
|
struct buffer_head *bh,
|
|
struct buffer_head *bh,
|
|
- int clean_error)
|
|
|
|
|
|
+ int resize)
|
|
{
|
|
{
|
|
unsigned int max_bits;
|
|
unsigned int max_bits;
|
|
struct ocfs2_group_desc *gd = (struct ocfs2_group_desc *)bh->b_data;
|
|
struct ocfs2_group_desc *gd = (struct ocfs2_group_desc *)bh->b_data;
|
|
@@ -233,8 +233,11 @@ static int ocfs2_validate_gd_parent(struct super_block *sb,
|
|
return -EINVAL;
|
|
return -EINVAL;
|
|
}
|
|
}
|
|
|
|
|
|
- if (le16_to_cpu(gd->bg_chain) >=
|
|
|
|
- le16_to_cpu(di->id2.i_chain.cl_next_free_rec)) {
|
|
|
|
|
|
+ /* In resize, we may meet the case bg_chain == cl_next_free_rec. */
|
|
|
|
+ if ((le16_to_cpu(gd->bg_chain) >
|
|
|
|
+ le16_to_cpu(di->id2.i_chain.cl_next_free_rec)) ||
|
|
|
|
+ ((le16_to_cpu(gd->bg_chain) ==
|
|
|
|
+ le16_to_cpu(di->id2.i_chain.cl_next_free_rec)) && !resize)) {
|
|
do_error("Group descriptor #%llu has bad chain %u",
|
|
do_error("Group descriptor #%llu has bad chain %u",
|
|
(unsigned long long)bh->b_blocknr,
|
|
(unsigned long long)bh->b_blocknr,
|
|
le16_to_cpu(gd->bg_chain));
|
|
le16_to_cpu(gd->bg_chain));
|