Bug #24028
closedCephFS flock() on a directory is broken
0%
Description
Accroding to man page, flock() semantics must work also on directory. Actually it works with, say, Ext4. It does not work with CephFS.
Luminous 12.2.5, Debian 9 (kernel mount)
I'm setting "major" since irreversible data loss may occur on user's data due to this bug.
Updated by Марк Коренберг almost 6 years ago
I tested flock() logic on different hosts.
on one host:
flock my_dir sleep 1000
on second:
flock my_dir echo test
This work as expected for plain files. And does not work on directories.
Updated by Patrick Donnelly almost 6 years ago
- Category set to Correctness/Safety
- Target version changed from v12.2.5 to v14.0.0
- Source set to Community (user)
- Backport set to mimic,luminous
- Severity changed from 2 - major to 4 - irritation
- Affected Versions deleted (
v12.2.5) - ceph-qa-suite deleted (
fs, kcephfs) - Component(FS) Common/Protocol added
- Labels (FS) task(intern) added
Updated by Zheng Yan almost 6 years ago
- Status changed from New to 7
Updated by Patrick Donnelly almost 6 years ago
- Assignee set to Zheng Yan
- Component(FS) kceph added
- Component(FS) deleted (
Common/Protocol)
Does ceph-fuse not have this problem?
Updated by Марк Коренберг almost 6 years ago
Updated by Марк Коренберг almost 6 years ago
Patrick Donnelly, why you set version to 14 ? Will this change be merged to Luminous ?
Updated by Patrick Donnelly almost 6 years ago
Марк Коренберг wrote:
Patrick Donnelly, why you set version to 14 ? Will this change be merged to Luminous ?
Because master is now 14.0.0. The backports field tracks where the fix will be backported.
Updated by Zheng Yan almost 6 years ago
ceph-fuse does not support file lock on directory. It's limitation of fuse kernel module.
Updated by Марк Коренберг almost 6 years ago
In that case flock() syscall over FUSEd directory should return an ENOTSUPP?. In any case we must not allow unsafe locking (i.e. return success when no cluster-wide locking occurred).
Updated by Zheng Yan almost 6 years ago
In fuse filesystem, flock on directory is handled by VFS, there is nothing ceph-fuse can do.