From: Alex Markuze <amarkuze@redhat.com>
To: ceph-devel@vger.kernel.org
Cc: linux-kernel@vger.kernel.org, idryomov@gmail.com,
vdubeyko@redhat.com, Alex Markuze <amarkuze@redhat.com>
Subject: [PATCH v2 2/7] ceph: use proper endian conversion for flock_len in reconnect
Date: Wed, 15 Apr 2026 17:00:38 +0000 [thread overview]
Message-ID: <20260415170043.3882912-3-amarkuze@redhat.com> (raw)
In-Reply-To: <20260415170043.3882912-1-amarkuze@redhat.com>
Replace the __force __le32 cast with cpu_to_le32() for the flock_len field
in reconnect_caps_cb(). The old code used a type-system bypass to silence
sparse; the new form uses the proper endian conversion macro.
Also switch from a raw bitmask test against i_ceph_flags to test_bit() on
the named CEPH_I_ERROR_FILELOCK_BIT, which is the correct accessor for the
unsigned long flags field after the bit-position conversion.
Signed-off-by: Alex Markuze <amarkuze@redhat.com>
---
fs/ceph/mds_client.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/fs/ceph/mds_client.c b/fs/ceph/mds_client.c
index ccf0d53dde2b..871f0eef468d 100644
--- a/fs/ceph/mds_client.c
+++ b/fs/ceph/mds_client.c
@@ -4693,8 +4693,9 @@ static int reconnect_caps_cb(struct inode *inode, int mds, void *arg)
rec.v2.issued = cpu_to_le32(cap->issued);
rec.v2.snaprealm = cpu_to_le64(ci->i_snap_realm->ino);
rec.v2.pathbase = cpu_to_le64(path_info.vino.ino);
- rec.v2.flock_len = (__force __le32)
- ((ci->i_ceph_flags & CEPH_I_ERROR_FILELOCK) ? 0 : 1);
+ rec.v2.flock_len = cpu_to_le32(
+ test_bit(CEPH_I_ERROR_FILELOCK_BIT,
+ &ci->i_ceph_flags) ? 0 : 1);
} else {
struct timespec64 ts;
--
2.34.1
next prev parent reply other threads:[~2026-04-15 17:01 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-04-15 17:00 [PATCH v2 0/7] ceph: manual client session reset Alex Markuze
2026-04-15 17:00 ` [PATCH v2 1/7] ceph: convert inode flags to named bit positions and atomic bitops Alex Markuze
2026-04-15 19:54 ` [EXTERNAL] " Viacheslav Dubeyko
2026-04-16 12:46 ` Alex Markuze
2026-04-15 17:00 ` Alex Markuze [this message]
2026-04-15 19:57 ` [EXTERNAL] [PATCH v2 2/7] ceph: use proper endian conversion for flock_len in reconnect Viacheslav Dubeyko
2026-04-15 17:00 ` [PATCH v2 3/7] ceph: harden send_mds_reconnect and handle active-MDS peer reset Alex Markuze
2026-04-16 19:33 ` [EXTERNAL] " Viacheslav Dubeyko
2026-04-15 17:00 ` [PATCH v2 4/7] ceph: add diagnostic timeout loop to wait_caps_flush() Alex Markuze
2026-04-16 19:55 ` [EXTERNAL] " Viacheslav Dubeyko
2026-04-15 17:00 ` [PATCH v2 5/7] ceph: add client reset state machine and session teardown Alex Markuze
2026-04-16 21:50 ` [EXTERNAL] " Viacheslav Dubeyko
2026-04-15 17:00 ` [PATCH v2 6/7] ceph: add manual reset debugfs control and tracepoints Alex Markuze
2026-04-17 18:41 ` [EXTERNAL] " Viacheslav Dubeyko
2026-04-15 17:00 ` [PATCH v2 7/7] ceph: add manual reset selftests and validation harness Alex Markuze
2026-04-17 18:48 ` [EXTERNAL] " Viacheslav Dubeyko
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=20260415170043.3882912-3-amarkuze@redhat.com \
--to=amarkuze@redhat.com \
--cc=ceph-devel@vger.kernel.org \
--cc=idryomov@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=vdubeyko@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
all inboxes | Powered by JetHome®