All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2 1/2] e2fsck: allow to check >2GB sized directory
@ 2018-12-14  7:50 Artem Blagodarenko
  2018-12-14  7:50 ` [PATCH v2 2/2] debugfs: output large directory size Artem Blagodarenko
                   ` (3 more replies)
  0 siblings, 4 replies; 6+ messages in thread
From: Artem Blagodarenko @ 2018-12-14  7:50 UTC (permalink / raw)
  To: linux-ext4; +Cc: adilger.kernel

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

^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [PATCH v2 2/2] debugfs: output large directory size
  2018-12-14  7:50 [PATCH v2 1/2] e2fsck: allow to check >2GB sized directory Artem Blagodarenko
@ 2018-12-14  7:50 ` Artem Blagodarenko
  2019-02-05 22:10   ` Theodore Y. Ts'o
  2019-01-30  9:01 ` [PATCH v2 1/2] e2fsck: allow to check >2GB sized directory Artem Blagodarenko
                   ` (2 subsequent siblings)
  3 siblings, 1 reply; 6+ messages in thread
From: Artem Blagodarenko @ 2018-12-14  7:50 UTC (permalink / raw)
  To: linux-ext4; +Cc: adilger.kernel

large_dir option allows to create directory with size > 2GB.
debugfs utility outputs negative size value for large directories
and ignores high part of directory size.

Fix debugfs to use high part of directory size in debugfs output
and use appropriate output format.

Signed-off-by: Artem Blagodarenko <artem.blagodarenko@gmail.com>
---
 debugfs/debugfs.c | 2 +-
 debugfs/ls.c      | 3 ---
 2 files changed, 1 insertion(+), 4 deletions(-)

diff --git a/debugfs/debugfs.c b/debugfs/debugfs.c
index e03519c4..2e600b92 100644
--- a/debugfs/debugfs.c
+++ b/debugfs/debugfs.c
@@ -848,7 +848,7 @@ void internal_dump_inode(FILE *out, const char *prefix,
 	if (is_large_inode && large_inode->i_extra_isize >= 32)
 		fprintf(out, "   Project: %5d", large_inode->i_projid);
 	fputs("   Size: ", out);
-	if (LINUX_S_ISREG(inode->i_mode))
+	if (LINUX_S_ISREG(inode->i_mode) || LINUX_S_ISDIR(inode->i_mode))
 		fprintf(out, "%llu\n", EXT2_I_SIZE(inode));
 	else
 		fprintf(out, "%d\n", inode->i_size);
diff --git a/debugfs/ls.c b/debugfs/ls.c
index a1e8f4e9..41af15d2 100644
--- a/debugfs/ls.c
+++ b/debugfs/ls.c
@@ -152,9 +152,6 @@ static int list_dir_proc(ext2_ino_t dir EXT2FS_ATTR((unused)),
 		fprintf(ls->f, "(%d)  %5d  %5d   ",
 			ext2fs_dirent_file_type(dirent),
 			inode_uid(inode), inode_gid(inode));
-		if (LINUX_S_ISDIR(inode.i_mode))
-			fprintf(ls->f, "%5d", inode.i_size);
-		else
 			fprintf(ls->f, "%5llu", EXT2_I_SIZE(&inode));
 		fprintf(ls->f, " %s ", datestr);
 		print_filename(ls->f, dirent, options);
-- 
2.14.3

^ permalink raw reply related	[flat|nested] 6+ messages in thread

* Re: [PATCH v2 1/2] e2fsck: allow to check >2GB sized directory
  2018-12-14  7:50 [PATCH v2 1/2] e2fsck: allow to check >2GB sized directory Artem Blagodarenko
  2018-12-14  7:50 ` [PATCH v2 2/2] debugfs: output large directory size Artem Blagodarenko
@ 2019-01-30  9:01 ` Artem Blagodarenko
  2019-01-30 17:58 ` Andreas Dilger
  2019-02-05 22:10 ` Theodore Y. Ts'o
  3 siblings, 0 replies; 6+ messages in thread
From: Artem Blagodarenko @ 2019-01-30  9:01 UTC (permalink / raw)
  To: linux-ext4; +Cc: adilger.kernel

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
> 


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH v2 1/2] e2fsck: allow to check >2GB sized directory
  2018-12-14  7:50 [PATCH v2 1/2] e2fsck: allow to check >2GB sized directory Artem Blagodarenko
  2018-12-14  7:50 ` [PATCH v2 2/2] debugfs: output large directory size Artem Blagodarenko
  2019-01-30  9:01 ` [PATCH v2 1/2] e2fsck: allow to check >2GB sized directory Artem Blagodarenko
@ 2019-01-30 17:58 ` Andreas Dilger
  2019-02-05 22:10 ` Theodore Y. Ts'o
  3 siblings, 0 replies; 6+ messages in thread
From: Andreas Dilger @ 2019-01-30 17:58 UTC (permalink / raw)
  To: Artem Blagodarenko; +Cc: Ext4 Developers List

[-- Attachment #1: Type: text/plain, Size: 1271 bytes --]

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






[-- Attachment #2: Message signed with OpenPGP --]
[-- Type: application/pgp-signature, Size: 873 bytes --]

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH v2 1/2] e2fsck: allow to check >2GB sized directory
  2018-12-14  7:50 [PATCH v2 1/2] e2fsck: allow to check >2GB sized directory Artem Blagodarenko
                   ` (2 preceding siblings ...)
  2019-01-30 17:58 ` Andreas Dilger
@ 2019-02-05 22:10 ` Theodore Y. Ts'o
  3 siblings, 0 replies; 6+ messages in thread
From: Theodore Y. Ts'o @ 2019-02-05 22:10 UTC (permalink / raw)
  To: Artem Blagodarenko; +Cc: linux-ext4, adilger.kernel

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

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH v2 2/2] debugfs: output large directory size
  2018-12-14  7:50 ` [PATCH v2 2/2] debugfs: output large directory size Artem Blagodarenko
@ 2019-02-05 22:10   ` Theodore Y. Ts'o
  0 siblings, 0 replies; 6+ messages in thread
From: Theodore Y. Ts'o @ 2019-02-05 22:10 UTC (permalink / raw)
  To: Artem Blagodarenko; +Cc: linux-ext4, adilger.kernel

On Fri, Dec 14, 2018 at 10:50:54AM +0300, Artem Blagodarenko wrote:
> large_dir option allows to create directory with size > 2GB.
> debugfs utility outputs negative size value for large directories
> and ignores high part of directory size.
> 
> Fix debugfs to use high part of directory size in debugfs output
> and use appropriate output format.
> 
> Signed-off-by: Artem Blagodarenko <artem.blagodarenko@gmail.com>

Applied, thanks.

						- Ted

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2019-02-05 22:11 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-12-14  7:50 [PATCH v2 1/2] e2fsck: allow to check >2GB sized directory Artem Blagodarenko
2018-12-14  7:50 ` [PATCH v2 2/2] debugfs: output large directory size Artem Blagodarenko
2019-02-05 22:10   ` Theodore Y. Ts'o
2019-01-30  9:01 ` [PATCH v2 1/2] e2fsck: allow to check >2GB sized directory Artem Blagodarenko
2019-01-30 17:58 ` Andreas Dilger
2019-02-05 22:10 ` Theodore Y. Ts'o

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.