diff mbox series

[v2,1/2] e2fsck: allow to check >2GB sized directory

Message ID 20181214075054.47359-1-artem.blagodarenko@gmail.com
State Accepted, archived
Headers show
Series [v2,1/2] e2fsck: allow to check >2GB sized directory | expand

Commit Message

Artem Blagodarenko Dec. 14, 2018, 7:50 a.m. UTC
After large_dir feature has been added, e2fsprogs is
ready for directories > 2GB, so we can remove e2fsck
directory size check.

Signed-off-by: Artem Blagodarenko <artem.blagodarenko@gmail.com>
---
 e2fsck/pass1.c | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

Comments

Artem Blagodarenko Jan. 30, 2019, 9:01 a.m. UTC | #1
Hello, Theodore.

 Do I need fix something in this patch series?

Thank you.

> On 14 Dec 2018, at 10:50, Artem Blagodarenko <artem.blagodarenko@gmail.com> wrote:
> 
> After large_dir feature has been added, e2fsprogs is
> ready for directories > 2GB, so we can remove e2fsck
> directory size check.
> 
> Signed-off-by: Artem Blagodarenko <artem.blagodarenko@gmail.com>
> ---
> e2fsck/pass1.c | 7 +++++--
> 1 file changed, 5 insertions(+), 2 deletions(-)
> 
> diff --git a/e2fsck/pass1.c b/e2fsck/pass1.c
> index 5c0b92d5..5c413610 100644
> --- a/e2fsck/pass1.c
> +++ b/e2fsck/pass1.c
> @@ -3647,9 +3647,12 @@ static int process_block(ext2_filsys fs,
> 		}
> 	}
> 
> -	if (p->is_dir && blockcnt > (1 << (21 - fs->super->s_log_block_size)))
> +	if (p->is_dir && !ext2fs_has_feature_largedir(fs->super) &&
> +	    blockcnt > (1 << (21 - fs->super->s_log_block_size)))
> 		problem = PR_1_TOOBIG_DIR;
> -	if (p->is_reg && p->num_blocks+1 >= p->max_blocks)
> +	if (p->is_dir && p->num_blocks + 1 >= p->max_blocks)
> +		problem = PR_1_TOOBIG_DIR;
> +	if (p->is_reg && p->num_blocks + 1 >= p->max_blocks)
> 		problem = PR_1_TOOBIG_REG;
> 	if (!p->is_dir && !p->is_reg && blockcnt > 0)
> 		problem = PR_1_TOOBIG_SYMLINK;
> -- 
> 2.14.3
>
Andreas Dilger Jan. 30, 2019, 5:58 p.m. UTC | #2
On Dec 14, 2018, at 12:50 AM, Artem Blagodarenko <artem.blagodarenko@gmail.com> wrote:
> 
> After large_dir feature has been added, e2fsprogs is
> ready for directories > 2GB, so we can remove e2fsck
> directory size check.
> 
> Signed-off-by: Artem Blagodarenko <artem.blagodarenko@gmail.com>

Reviewed-by: Andreas Dilger <adilger@dilger.ca>

> ---
> e2fsck/pass1.c | 7 +++++--
> 1 file changed, 5 insertions(+), 2 deletions(-)
> 
> diff --git a/e2fsck/pass1.c b/e2fsck/pass1.c
> index 5c0b92d5..5c413610 100644
> --- a/e2fsck/pass1.c
> +++ b/e2fsck/pass1.c
> @@ -3647,9 +3647,12 @@ static int process_block(ext2_filsys fs,
> 		}
> 	}
> 
> -	if (p->is_dir && blockcnt > (1 << (21 - fs->super->s_log_block_size)))
> +	if (p->is_dir && !ext2fs_has_feature_largedir(fs->super) &&
> +	    blockcnt > (1 << (21 - fs->super->s_log_block_size)))
> 		problem = PR_1_TOOBIG_DIR;
> -	if (p->is_reg && p->num_blocks+1 >= p->max_blocks)
> +	if (p->is_dir && p->num_blocks + 1 >= p->max_blocks)
> +		problem = PR_1_TOOBIG_DIR;
> +	if (p->is_reg && p->num_blocks + 1 >= p->max_blocks)
> 		problem = PR_1_TOOBIG_REG;
> 	if (!p->is_dir && !p->is_reg && blockcnt > 0)
> 		problem = PR_1_TOOBIG_SYMLINK;
> --
> 2.14.3
> 


Cheers, Andreas
Theodore Ts'o Feb. 5, 2019, 10:10 p.m. UTC | #3
On Fri, Dec 14, 2018 at 10:50:53AM +0300, Artem Blagodarenko wrote:
> After large_dir feature has been added, e2fsprogs is
> ready for directories > 2GB, so we can remove e2fsck
> directory size check.
> 
> Signed-off-by: Artem Blagodarenko <artem.blagodarenko@gmail.com>

Applied, thanks.

					- Ted
diff mbox series

Patch

diff --git a/e2fsck/pass1.c b/e2fsck/pass1.c
index 5c0b92d5..5c413610 100644
--- a/e2fsck/pass1.c
+++ b/e2fsck/pass1.c
@@ -3647,9 +3647,12 @@  static int process_block(ext2_filsys fs,
 		}
 	}
 
-	if (p->is_dir && blockcnt > (1 << (21 - fs->super->s_log_block_size)))
+	if (p->is_dir && !ext2fs_has_feature_largedir(fs->super) &&
+	    blockcnt > (1 << (21 - fs->super->s_log_block_size)))
 		problem = PR_1_TOOBIG_DIR;
-	if (p->is_reg && p->num_blocks+1 >= p->max_blocks)
+	if (p->is_dir && p->num_blocks + 1 >= p->max_blocks)
+		problem = PR_1_TOOBIG_DIR;
+	if (p->is_reg && p->num_blocks + 1 >= p->max_blocks)
 		problem = PR_1_TOOBIG_REG;
 	if (!p->is_dir && !p->is_reg && blockcnt > 0)
 		problem = PR_1_TOOBIG_SYMLINK;