Project

General

Profile

Bug #9995

failing test_filelock

Added by Greg Farnum almost 5 years ago. Updated over 4 years ago.

Status:
Resolved
Priority:
High
Assignee:
Category:
-
Target version:
-
Start date:
11/03/2014
Due date:
% Done:

0%

Source:
Q/A
Tags:
Backport:
Regression:
No
Severity:
3 - minor
Reviewed:
Affected Versions:
ceph-qa-suite:
Component(FS):
Labels (FS):
Pull request ID:

Associated revisions

Revision edb780a3 (diff)
Added by Yan, Zheng almost 5 years ago

tasks/cephfs/mount: use seperate for testing flock and posix lock

Old version libfuse treats both flock and posix lock requests as posix
lock request. This is a workaround for the bug.

Fixes: #9995
Signed-off-by: Yan, Zheng <>

Revision f780f189 (diff)
Added by Greg Farnum over 4 years ago

cephfs/test_client_recovery: check FUSE version before invoking flock

flock only works properly on FUSE versions >=2.9, which is newer
than eg Ubuntu Precise. So check the version on our client mounts and
only test flock if it's at least that new.

Fixes: #9995

Signed-off-by: Greg Farnum <>

History

#1 Updated by Zheng Yan almost 5 years ago

  • Status changed from New to Won't Fix

it's a bug in old version of libfuse, it calls our setlk callback for both fcntl setlk and flock requests

#2 Updated by Greg Farnum almost 5 years ago

  • Status changed from Won't Fix to Verified

Is there something we can do as a workaround to prevent this blocking things? I expect people are going to use new ceph-fuse with old kernels. And our nightlies are going to keep turning up errors. :(

Oh, looking at it a bit more, you must mean that FUSE prior to 2.9 is translating flock calls into setlk calls? Why would that break our interfaces?

#3 Updated by Zheng Yan almost 5 years ago

static void do_setlk_common(fuse_req_t req, fuse_ino_t nodeid,
                            const void *inarg, int sleep)
{       
        struct fuse_lk_in *arg = (struct fuse_lk_in *) inarg;
        struct fuse_file_info fi;
        struct flock flock;

        memset(&fi, 0, sizeof(fi));
        fi.fh = arg->fh;
        fi.lock_owner = arg->owner;

        if (arg->lk_flags & FUSE_LK_FLOCK) {
                int op = 0;

                switch (arg->lk.type) {
                case F_RDLCK:
                        op = LOCK_SH;
                        break;
                case F_WRLCK:
                        op = LOCK_EX;
                        break;
                case F_UNLCK:
                        op = LOCK_UN;
                        break;
                }
                if (!sleep)
                        op |= LOCK_NB;

                if (req->f->op.flock)
                        req->f->op.flock(req, nodeid, &fi, op);
                else    
                        fuse_reply_err(req, ENOSYS);
        } else {
                convert_fuse_file_lock(&arg->lk, &flock);
                if (req->f->op.setlk)
                        req->f->op.setlk(req, nodeid, &fi, &flock, sleep);
                else    
                        fuse_reply_err(req, ENOSYS);
        }
}

old libfuse does not recognize FUSE_LK_FLOCK. I think we can't do anything with this bug.

#4 Updated by Greg Farnum almost 5 years ago

  • Assignee deleted (Zheng Yan)

We'll need to update the test then so that it detects this situation and aborts quietly instead of raising an error.

#6 Updated by Zheng Yan almost 5 years ago

  • Status changed from Verified to Testing

#7 Updated by Zheng Yan almost 5 years ago

  • Status changed from Testing to Resolved

#8 Updated by Greg Farnum over 4 years ago

  • Status changed from Resolved to Verified
  • Assignee set to Greg Farnum

I'm going to add something so the test IDs old FUSE and quits nicely instead of failing: http://pulpito.ceph.com/teuthology-2015-04-20_23:04:01-fs-master-testing-basic-multi/856815/

#9 Updated by Greg Farnum over 4 years ago

  • Priority changed from Urgent to High

#10 Updated by Greg Farnum over 4 years ago

  • Status changed from Verified to Need Review

#11 Updated by Greg Farnum over 4 years ago

  • Status changed from Need Review to Resolved
  • Regression set to No

Finally merged in ceph-qa-suite commit:8eb3255a4c5c62720cf5c749032cbeccc4f9b264

Also available in: Atom PDF