[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <df1bd1ff181cf98b9bd5318632b7353b12174a1c.1667822611.git.ritesh.list@gmail.com>
Date: Mon, 7 Nov 2022 17:51:16 +0530
From: "Ritesh Harjani (IBM)" <ritesh.list@...il.com>
To: Theodore Ts'o <tytso@....edu>
Cc: linux-ext4@...r.kernel.org,
Harshad Shirwadkar <harshadshirwadkar@...il.com>,
Wang Shilong <wshilong@....com>,
Andreas Dilger <adilger.kernel@...ger.ca>,
Li Xi <lixi@....com>, Ritesh Harjani <ritesh.list@...il.com>
Subject: [RFCv1 28/72] e2fsck: Add asserts in open_channel_fs
From: Li Xi <lixi@....com>
Signed-off-by: Li Xi <lixi@....com>
Signed-off-by: Ritesh Harjani (IBM) <ritesh.list@...il.com>
---
e2fsck/pass1.c | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/e2fsck/pass1.c b/e2fsck/pass1.c
index 9a273515..ea432ff2 100644
--- a/e2fsck/pass1.c
+++ b/e2fsck/pass1.c
@@ -2190,6 +2190,18 @@ static errcode_t e2fsck_open_channel_fs(ext2_filsys dest, e2fsck_t dest_context,
io_channel_set_blksize(dest->io, src->io->block_size);
ehandler_init(dest->io);
+ assert(dest->io->magic == src->io->magic);
+ assert(dest->io->manager == src->io->manager);
+ assert(strcmp(dest->io->name, src->io->name) == 0);
+ assert(dest->io->block_size == src->io->block_size);
+ assert(dest->io->read_error == src->io->read_error);
+ assert(dest->io->write_error == src->io->write_error);
+ assert(dest->io->refcount == src->io->refcount);
+ assert(dest->io->flags == src->io->flags);
+ assert(dest->io->app_data == dest);
+ assert(src->io->app_data == src);
+ assert(dest->io->align == src->io->align);
+
dest->priv_data = dest_context;
dest_context->fs = dest;
/* The data should be written to disk immediately */
--
2.37.3
Powered by blists - more mailing lists