Project

General

Profile

Actions

Bug #3951

closed

ceph-fuse: permissions error on create

Added by Sam Lang about 11 years ago. Updated almost 8 years ago.

Status:
Resolved
Priority:
Normal
Assignee:
Category:
-
Target version:
-
% Done:

0%

Source:
Development
Tags:
Backport:
Regression:
Severity:
3 - minor
Reviewed:
Affected Versions:
ceph-qa-suite:
Component(FS):
Client
Labels (FS):
Pull request ID:
Crash signature (v1):
Crash signature (v2):

Description

Reported by Greg Farnum:

gregf@kai:~/ceph/src [master]$ cd mnt/
gregf@kai:~/ceph/src/mnt$ sudo chown gregf.gregf .
gregf@kai:~/ceph/src/mnt$ ls
gregf@kai:~/ceph/src/mnt$ cp ../../qa/workunits/suites/fsync-tester.sh .
cp: cannot create regular file `./fsync-tester.sh': Permission denied
gregf@kai:~/ceph/src/mnt$ ls -lha
total 73K
drwxr-xr-x 1 gregf gregf 0 Jan 28 20:09 .
drwxr-xr-x 45 gregf gregf 68K Jan 28 20:09 ..
-rwxr-xr-x 1 gregf gregf 0 Jan 28 20:09 fsync-tester.sh
gregf@kai:~/ceph/src/mnt$ cp ../../qa/workunits/suites/fsync-tester.sh .
gregf@kai:~/ceph/src/mnt$ ls -lha
total 73K
drwxr-xr-x 1 gregf gregf 0 Jan 28 20:09 .
drwxr-xr-x 45 gregf gregf 68K Jan 28 20:09 ..
-rwxr-xr-x 1 gregf gregf 112 Jan 28 20:10 fsync-tester.sh


Proposed fix for this is in wip-fuse-create-fix.  We were using geteuid/getegid in ll_create(), which are of course 0/0.  The fix is just to use the passed in uid/gid.

There's a secondary problem here as well.  The reason we are even doing permissions checking in ll_create is that the created flag is not getting returned from _create.  That's happening because either 1) the file already exists at the mds, in case of remount, etc., which is correct behavior, and the above fix should resolve that case, or 2) the file does not exist at the mds, and the mds is not returning an early reply to the client, so the created flag (which only exists on the early reply never gets set.  The mds isn't returning an early reply because the create is the first that the mds sees, and so has no preallocated inodes yet.  So it allocates inodes, and sets alloc_ino=true, which prevents the early reply.

The branch includes a second commit that needs careful review. It adds the extra_bl (which holds the created ino) on the journaled reply from an openc request. Its unclear if we should always include the extra_bl for all journaled replies, or just for openc.

Actions #1

Updated by Greg Farnum about 11 years ago

  • Description updated (diff)

I've got a question in for Sam, but other than that this looks good to me!

Actions #2

Updated by Greg Farnum about 11 years ago

  • Status changed from Fix Under Review to Resolved

Fixed in master commit:cf7c3f7d3fc7b8dc3a08a4fbe4ca1c10f2cb6054 and tested that it solves the problem.

Actions #3

Updated by Greg Farnum almost 8 years ago

  • Component(FS) Client added
Actions

Also available in: Atom PDF