Project

General

Profile

Bug #24028

CephFS flock() on a directory is broken

Added by Марк Коренберг 8 months ago. Updated about 2 months ago.

Status:
Resolved
Priority:
Normal
Assignee:
Category:
Correctness/Safety
Target version:
Start date:
05/07/2018
Due date:
% 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:

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.

History

#1 Updated by Марк Коренберг 8 months 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.

#2 Updated by John Spray 7 months ago

  • Project changed from Ceph to fs

#3 Updated by Patrick Donnelly 7 months 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

#5 Updated by Patrick Donnelly 7 months ago

  • Assignee set to Zheng Yan
  • Component(FS) kceph added
  • Component(FS) deleted (Common/Protocol)

Does ceph-fuse not have this problem?

#7 Updated by Марк Коренберг 7 months ago

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

#8 Updated by Patrick Donnelly 7 months 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.

#9 Updated by Zheng Yan 7 months ago

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

#10 Updated by Марк Коренберг 7 months 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).

#11 Updated by Zheng Yan 7 months ago

In fuse filesystem, flock on directory is handled by VFS, there is nothing ceph-fuse can do.

#12 Updated by Zheng Yan about 2 months ago

  • Status changed from Testing to Resolved

#13 Updated by Nathan Cutler about 2 months ago

  • Backport deleted (mimic,luminous)

Also available in: Atom PDF