From: Andrew Price <anprice@redhat.com>
To: cluster-devel.redhat.com
Subject: [Cluster-devel] [PATCH 4/6] fsck.gfs2: Remove de variable from dirref_find()
Date: Mon, 30 Jan 2023 15:21:44 +0000 [thread overview]
Message-ID: <20230130152146.633484-5-anprice@redhat.com> (raw)
In-Reply-To: <20230130152146.633484-1-anprice@redhat.com>
It always points to 'dentry' so it can be replaced in all uses.
Signed-off-by: Andrew Price <anprice@redhat.com>
---
gfs2/fsck/pass2.c | 13 ++++++-------
1 file changed, 6 insertions(+), 7 deletions(-)
diff --git a/gfs2/fsck/pass2.c b/gfs2/fsck/pass2.c
index 0c2e0146..002bf2cb 100644
--- a/gfs2/fsck/pass2.c
+++ b/gfs2/fsck/pass2.c
@@ -621,18 +621,17 @@ static int dirref_find(struct fsck_cx *cx, struct lgfs2_inode *ip, struct gfs2_d
/* the metawalk_fxn's private field must be set to the dentry
* block we want to clear */
struct lgfs2_inum *entry = private;
- struct lgfs2_dirent dentry, *de;
+ struct lgfs2_dirent dentry;
char fn[MAX_FILENAME];
memset(&dentry, 0, sizeof(dentry));
lgfs2_dirent_in(&dentry, dent);
- de = &dentry;
- if (de->dr_inum.in_addr != entry->in_addr) {
+ if (dentry.dr_inum.in_addr != entry->in_addr) {
(*count)++;
return 0;
}
- if (de->dr_inum.in_formal_ino == be64_to_cpu(dent->de_inum.no_formal_ino)) {
+ if (dentry.dr_inum.in_formal_ino == be64_to_cpu(dent->de_inum.no_formal_ino)) {
log_debug("Formal inode number matches; must be a hard "
"link.\n");
goto out;
@@ -641,13 +640,13 @@ static int dirref_find(struct fsck_cx *cx, struct lgfs2_inode *ip, struct gfs2_d
"directory %"PRIu64" (0x%"PRIx64") has the wrong 'formal' inode "
"number.\n"), entry->in_addr, entry->in_addr, ip->i_num.in_addr, ip->i_num.in_addr);
memset(fn, 0, sizeof(fn));
- if (de->dr_name_len < MAX_FILENAME)
- strncpy(fn, filename, de->dr_name_len);
+ if (dentry.dr_name_len < MAX_FILENAME)
+ strncpy(fn, filename, dentry.dr_name_len);
else
strncpy(fn, filename, MAX_FILENAME - 1);
log_err(_("The bad reference '%s' had formal inode number: %"PRIu64
" (0x%"PRIx64") but the correct value is: %"PRIu64" (0x%"PRIx64")\n"),
- fn, de->dr_inum.in_formal_ino, de->dr_inum.in_formal_ino,
+ fn, dentry.dr_inum.in_formal_ino, dentry.dr_inum.in_formal_ino,
entry->in_formal_ino, entry->in_formal_ino);
if (!query(cx, _("Delete the bad directory entry? (y/n) "))) {
log_err(_("The corrupt directory entry was not fixed.\n"));
--
2.39.0
next prev parent reply other threads:[~2023-01-30 15:21 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-01-30 15:21 [Cluster-devel] [PATCH 0/6] gfs2-utils: Cleanups and fsck.gfs2 fixes Andrew Price
2023-01-30 15:21 ` [Cluster-devel] [PATCH 1/6] libgfs2: Return the inode from lgfs2_lookupi() Andrew Price
2023-01-30 15:21 ` [Cluster-devel] [PATCH 2/6] libgfs2: Remove lgfs2_gfs_createi() Andrew Price
2023-01-30 15:21 ` [Cluster-devel] [PATCH 3/6] libgfs2: Reorganise lgfs2_createi() Andrew Price
2023-01-30 15:21 ` Andrew Price [this message]
2023-01-30 15:21 ` [Cluster-devel] [PATCH 5/6] fsck.gfs2: Fix wrong entry used in dentry comparison Andrew Price
2023-01-30 15:21 ` [Cluster-devel] [PATCH 6/6] fsck.gfs2: fix_hashtable: Decrement i_blocks when freeing leaf blocks Andrew Price
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=20230130152146.633484-5-anprice@redhat.com \
--to=anprice@redhat.com \
/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).