linux-ext4.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jan Kara <jack@suse.cz>
To: Ted Tso <tytso@mit.edu>
Cc: <linux-ext4@vger.kernel.org>, Jan Kara <jack@suse.cz>
Subject: [PATCH 3/9] e2image: Dump quota files
Date: Mon, 12 Jul 2021 17:43:09 +0200	[thread overview]
Message-ID: <20210712154315.9606-4-jack@suse.cz> (raw)
In-Reply-To: <20210712154315.9606-1-jack@suse.cz>

Dump quota files to resulting filesystem image. They are fs metadata.

Signed-off-by: Jan Kara <jack@suse.cz>
---
 misc/e2image.c | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)

diff --git a/misc/e2image.c b/misc/e2image.c
index 90a34bebc36d..ac00827e4628 100644
--- a/misc/e2image.c
+++ b/misc/e2image.c
@@ -52,6 +52,7 @@ extern int optind;
 
 #include "support/nls-enable.h"
 #include "support/plausible.h"
+#include "support/quotaio.h"
 #include "../version.h"
 
 #define QCOW_OFLAG_COPIED     (1ULL << 63)
@@ -1364,9 +1365,11 @@ static void write_raw_image_file(ext2_filsys fs, int fd, int type, int flags,
 		pb.ino = ino;
 		pb.is_dir = LINUX_S_ISDIR(inode.i_mode);
 		if (LINUX_S_ISDIR(inode.i_mode) ||
-		    (LINUX_S_ISLNK(inode.i_mode) &&
-		     ext2fs_inode_has_valid_blocks2(fs, &inode)) ||
-		    ino == fs->super->s_journal_inum) {
+		    LINUX_S_ISLNK(inode.i_mode) ||
+		    ino == fs->super->s_journal_inum ||
+		    ino == quota_type2inum(USRQUOTA, fs->super) ||
+		    ino == quota_type2inum(GRPQUOTA, fs->super) ||
+		    ino == quota_type2inum(PRJQUOTA, fs->super)) {
 			retval = ext2fs_block_iterate3(fs, ino,
 					BLOCK_FLAG_READ_ONLY, block_buf,
 					process_dir_block, &pb);
-- 
2.26.2


  parent reply	other threads:[~2021-07-12 15:43 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-07-12 15:43 [PATCH 0/9 v4] e2fsprogs: Support for orphan file feature Jan Kara
2021-07-12 15:43 ` [PATCH 1/9] ext2fs: Drop HAS_SNAPSHOT feature Jan Kara
2021-07-12 18:20   ` Andreas Dilger
2021-07-13  8:11     ` Jan Kara
2021-07-12 15:43 ` [PATCH 2/9] quota: Do not account space used by project quota file to quota Jan Kara
2021-07-12 15:43 ` Jan Kara [this message]
2021-07-12 15:43 ` [PATCH 4/9] libext2fs: Support for orphan file feature Jan Kara
2021-08-03 16:57   ` Theodore Ts'o
2021-08-03 17:40     ` Theodore Ts'o
2021-08-04  9:25     ` Jan Kara
2021-08-04 10:13       ` Jan Kara
2021-07-12 15:43 ` [PATCH 5/9] mke2fs: Add support for orphan_file feature Jan Kara
2021-07-12 15:43 ` [PATCH 6/9] e2fsck: Add support for handling orphan file Jan Kara
2021-08-03 18:56   ` Theodore Ts'o
2021-07-12 15:43 ` [PATCH 7/9] tune2fs: Add support for orphan_file feature Jan Kara
2021-07-12 15:43 ` [PATCH 8/9] mke2fs: Add orphan_file feature into mke2fs.conf Jan Kara
2021-08-04 19:04   ` Theodore Ts'o
2021-08-05 15:00     ` Jan Kara
2021-07-12 15:43 ` [PATCH 9/9] dumpe2fs, debugfs, e2image: Add support for orphan file Jan Kara
  -- strict thread matches above, loose matches on Subject: below --
2021-06-16 10:57 [PATCH 0/9 v3] e2fsprogs: Support for orphan file feature Jan Kara
2021-06-16 10:57 ` [PATCH 3/9] e2image: Dump quota files Jan Kara
2021-08-03 16:15   ` Theodore Ts'o

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20210712154315.9606-4-jack@suse.cz \
    --to=jack@suse.cz \
    --cc=linux-ext4@vger.kernel.org \
    --cc=tytso@mit.edu \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).