Project

General

Profile

Actions

Bug #24028

closed

CephFS flock() on a directory is broken

Added by Марк Коренберг almost 6 years ago. Updated over 5 years ago.

Status:
Resolved
Priority:
Normal
Assignee:
Category:
Correctness/Safety
Target version:
% Done:

0%

Source:
Community (user)
Tags:
Backport:
Regression:
No
Severity:
4 - irritation
Reviewed:
Affected Versions:
ceph-qa-suite:
Component(FS):
kceph
Labels (FS):
task(intern)
Pull request ID:
Crash signature (v1):
Crash signature (v2):

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.

Actions #1

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.

Actions #2

Updated by John Spray almost 6 years ago

  • Project changed from Ceph to CephFS
Actions #3

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
Actions #5

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?

Actions #7

Updated by Марк Коренберг almost 6 years ago

Patrick Donnelly, why you set version to 14 ? Will this change be merged to Luminous ?

Actions #8

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.

Actions #9

Updated by Zheng Yan almost 6 years ago

ceph-fuse does not support file lock on directory. It's limitation of fuse kernel module.

Actions #10

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).

Actions #11

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.

Actions #12

Updated by Zheng Yan over 5 years ago

  • Status changed from 7 to Resolved
Actions #13

Updated by Nathan Cutler over 5 years ago

  • Backport deleted (mimic,luminous)
Actions

Also available in: Atom PDF