Project

General

Profile

Actions

Bug #63906

open

Inconsistent file mode across two clients

Added by Tao Lyu 5 months ago. Updated 23 days ago.

Status:
Fix Under Review
Priority:
Normal
Assignee:
Category:
Correctness/Safety
Target version:
-
% Done:

0%

Source:
Tags:
Backport:
Regression:
No
Severity:
1 - critical
Reviewed:
Affected Versions:
ceph-qa-suite:
Component(FS):
Client, MDS, kceph
Labels (FS):
Pull request ID:
Crash signature (v1):
Crash signature (v2):

Description

Hi,

I'm running ceph version 15.2.1 (9fd2f65f91d9246fae2c841a6222d34d121680ee) octopus (stable). And the client is Kclient (Linux 5.15)

After executing two sequences of syscalls on two clients respectively, the file mode retrieved by stat syscall immediately on two clients are different.
This violates the strong consistency model of CephFS, which is illustrated here: https://docs.ceph.com/en/reef/cephfs/posix/?highlight=atomicity#bottom-line

Reproduction steps:
1. Set up a CephFS instance with 7 nodes, including 1 monitor, 2 OSDs, 2 MDSes, 2 clients mounted by Kclient. Each node runs in one VM.
2. Client1: Create a regular file "file0" on with syscall(_NR_open,"./file0", 0x40, 0xa);
3. Client2: open the "file0" with syscall(
_NR_open, "./file0", 0x80e82, 0x0);
4. Client2: syscall(__NR_chmod, "./file0", 0x0);
5. Client1 and client2 execute stat syscall concurrently and immediately after step 4. Then you will see file mode 32768 from client1, and 32776 from client2.

One thing to note is that, from step 2 to step 5, there shouldn't be a long time gap. We are using shared memory to communicate among VM nodes for immediate and fast execution.

And it we will for a while to stat from both nodes, then the file mode are consistent.


Files

poc.c (1.47 KB) poc.c Tao Lyu, 01/05/2024 09:15 AM
memset.c (598 Bytes) memset.c Tao Lyu, 01/05/2024 09:15 AM
fix.patch (2.26 KB) fix.patch Xiubo Li, 01/10/2024 10:21 AM
Actions

Also available in: Atom PDF