From: "Theodore Ts'o" <tytso@mit.edu>
To: Harshad Shirwadkar <harshadshirwadkar@gmail.com>
Cc: linux-ext4@vger.kernel.org
Subject: Re: [PATCH v3 00/15] Fast commit changes for e2fsprogs
Date: Thu, 21 Jan 2021 00:22:25 -0500 [thread overview]
Message-ID: <YAkPkXDzua0va3v7@mit.edu> (raw)
In-Reply-To: <20210120212641.526556-1-user@harshads-520.kir.corp.google.com>
On Wed, Jan 20, 2021 at 01:26:26PM -0800, Harshad Shirwadkar wrote:
>
> - Fix compilation error by defining jbd2_journal_get_fc_num_blks (also
> rename it to jbd_get_fc_num_blks) as a preprocessor macro instead of
> inline function which gets compiled out when "-g" is passed
Unfortunately, this still doesn't quite fix things. The problem with
this approach is the preprocessor macro uses be32_to_cpu(), which gets
turned into ext2fs_swab32(). And the libe2p shared library is not
allowed to depend on libext2fs. Otherwise when we build with
configure --enable-elf-shlibs, the link of misc/chattr fails with:
<tytso@cwcc> {/build/e2fsprogs/misc}
1078% make V=1
../util/subst -f ../util/subst.conf /usr/projects/e2fsprogs/e2fsprogs/lib/dirpaths.h.in ../lib/dirpaths.h
gcc -Wl,-rpath-link,../lib -o chattr chattr.o ../lib/libe2p.so ../lib/libcom_err.so \
/bin/ld: ../lib/libe2p.so: undefined reference to `ext2fs_swab32'
collect2: error: ld returned 1 exit status
make: *** [Makefile:636: chattr] Error 1
We had already defined e2p_be32() and use it in other places in
lib/e2p/ljs.c.
So I fixed this by taking your Dec 10th version of the patch series,
and making the following change to patch 4/15:
diff --git a/lib/e2p/ljs.c b/lib/e2p/ljs.c
index 9f866c7e..59728198 100644
--- a/lib/e2p/ljs.c
+++ b/lib/e2p/ljs.c
@@ -36,6 +36,17 @@ static __u32 e2p_swab32(__u32 val)
#define e2p_be32(x) e2p_swab32(x)
#endif
+/*
+ * This function is copied from kernel-jbd.h's function
+ * jbd2_journal_get_num_fc_blks() to avoid inter-library dependencies.
+ */
+static inline int get_num_fc_blks(journal_superblock_t *jsb)
+{
+ int num_fc_blocks = e2p_be32(jsb->s_num_fc_blks);
+
+ return num_fc_blocks ? num_fc_blocks : JBD2_DEFAULT_FAST_COMMIT_BLOCKS;
+}
+
static const char *journal_checksum_type_str(__u8 type)
{
switch (type) {
@@ -58,7 +69,7 @@ void e2p_list_journal_super(FILE *f, char *journal_sb_buf,
int journal_blks = 0;
if (flags & E2P_LIST_JOURNAL_FLAG_FC)
- num_fc_blks = jbd2_journal_get_num_fc_blks((journal_superblock_t *)journal_sb_buf);
+ num_fc_blks = get_num_fc_blks((journal_superblock_t *)journal_sb_buf);
journal_blks = ntohl(jsb->s_maxlen) - num_fc_blks;
fprintf(f, "%s", "Journal features: ");
for (i=0, mask_ptr=&jsb->s_feature_compat; i <3; i++,mask_ptr++) {
prev parent reply other threads:[~2021-01-21 5:23 UTC|newest]
Thread overview: 26+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-01-20 21:26 [PATCH v3 00/15] Fast commit changes for e2fsprogs Harshad Shirwadkar
2021-01-20 21:26 ` [PATCH v3 01/15] ext2fs: move calculate_summary_stats to ext2fs lib Harshad Shirwadkar
2021-01-21 15:54 ` Theodore Ts'o
2021-01-20 21:26 ` [PATCH v3 02/15] e2fsck: add kernel endian-ness conversion macros Harshad Shirwadkar
2021-01-21 15:54 ` Theodore Ts'o
2021-01-20 21:26 ` [PATCH v3 03/15] e2fsck: port fc changes from kernel's recovery.c to e2fsck Harshad Shirwadkar
2021-01-21 15:54 ` Theodore Ts'o
2021-01-20 21:26 ` [PATCH v3 04/15] libext2fs: provide APIs to configure fast commit blocks Harshad Shirwadkar
2021-01-21 15:56 ` Theodore Ts'o
2021-01-20 21:26 ` [PATCH v3 05/15] e2fsprogs: make userspace tools number of fast commits blocks aware Harshad Shirwadkar
2021-01-21 15:58 ` Theodore Ts'o
2021-01-20 21:26 ` [PATCH v3 06/15] ext2fs: add new APIs needed for fast commits Harshad Shirwadkar
2021-01-21 5:58 ` Theodore Ts'o
2021-01-20 21:26 ` [PATCH v3 07/15] e2fsck: add function to rewrite extent tree Harshad Shirwadkar
2021-01-20 21:26 ` [PATCH v3 08/15] e2fsck: add fast commit setup code Harshad Shirwadkar
2021-01-21 16:54 ` Theodore Ts'o
2021-01-20 21:26 ` [PATCH v3 09/15] e2fsck: add fast commit scan pass Harshad Shirwadkar
2021-01-20 21:26 ` [PATCH v3 10/15] e2fsck: add fast commit replay skeleton Harshad Shirwadkar
2021-01-20 21:26 ` [PATCH v3 11/15] e2fsck: add fc replay for link, unlink, creat tags Harshad Shirwadkar
2021-01-20 21:26 ` [PATCH v3 12/15] e2fsck: add replay for add_range, del_range, and inode tags Harshad Shirwadkar
2021-01-20 21:26 ` [PATCH v3 13/15] debugfs: add fast commit support to logdump Harshad Shirwadkar
2021-01-21 16:49 ` Theodore Ts'o
2021-01-20 21:26 ` [PATCH v3 14/15] tests: add fast commit recovery tests Harshad Shirwadkar
2021-01-20 21:26 ` [PATCH v3 15/15] ext4: fix tests to account for new dumpe2fs output Harshad Shirwadkar
2021-01-21 16:01 ` Theodore Ts'o
2021-01-21 5:22 ` Theodore Ts'o [this message]
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=YAkPkXDzua0va3v7@mit.edu \
--to=tytso@mit.edu \
--cc=harshadshirwadkar@gmail.com \
--cc=linux-ext4@vger.kernel.org \
/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 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.