[Bugs] [Bug 1668286] READDIRP incorrectly updates posix-acl inode ctx

bugzilla at redhat.com bugzilla at redhat.com
Wed Feb 13 08:25:41 UTC 2019


https://bugzilla.redhat.com/show_bug.cgi?id=1668286

homma at allworks.co.jp changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
              Flags|needinfo?(homma at allworks.co |
                   |.jp)                        |



--- Comment #6 from homma at allworks.co.jp ---
(In reply to Raghavendra G from comment #2)
> (In reply to homma from comment #0)
> > Additional info:
> > 
> > In readdir-ahead.c, rda_fill_fd_cbk() replaces dentries and zeroes out iatts
> > exept for ia_gfid and ia_type.
> > Then in posix-acl.c, posix_acl_readdirp_cbk() updates its inode ctx by that
> > zeroed permission, and permission is denied.
> 
> The expectation is kernel would do a fresh lookup for getting other
> attributes like permissions and that's what Glusterfs indicates kernel too -
> that only entry information (mapping of path to inode/gfid)  is valid and
> the attributes are not valid. How did you conclude zeroed out permissions
> are set on posix-acl? Did you see a call like setattr or any setxattr
> updating posix acls? If yes, whether these zeroed out attributes were sent
> from kernel?

In the client log, 'ctx(uid:0,gid:0,in-groups:0,perm:000,updated-fop:READDIRP,
acl:-)' indicates that owner, group, and permissions are all zero in posix-acl
ctx.

With gdb, the following output is obtained when executing the above commands
(see 'Steps to Reproduce').
The ctx is zeroed out (uid = 0, gid = 0, perm = 32768) when updated by
READDIRP, while it has correct values (uid = 1000, gid = 1000, perm = 33204)
when updated by LOOKUP.


(gdb) break posix-acl.c:1196
Breakpoint 1 at 0x7fbdc0fecb28: file posix-acl.c, line 1196.
(gdb) commands
Type commands for breakpoint(s) 1, one per line.
End with a line saying just "end".
>print *loc
>print *(struct posix_acl_ctx *)loc.inode._ctx[13].ptr1
>continue
>end
(gdb) break posix-acl.c:1200
Breakpoint 2 at 0x7fbdc0fec953: file posix-acl.c, line 1200.
(gdb) commands
Type commands for breakpoint(s) 2, one per line.
End with a line saying just "end".
>print *loc
>print *(struct posix_acl_ctx *)loc.inode._ctx[13].ptr1
>continue
>end
(gdb) set pagination off
(gdb) continue
Continuing.
[Switching to Thread 0x7fbdbb7fe700 (LWP 7156)]

Breakpoint 1, posix_acl_open (frame=frame at entry=0x7fbdac01e8b8,
this=this at entry=0x7fbdbc01dc00, loc=loc at entry=0x7fbdac000f30,
flags=flags at entry=32769, fd=fd at entry=0x7fbdac009d88, xdata=xdata at entry=0x0) at
posix-acl.c:1196
1196        STACK_WIND(frame, posix_acl_open_cbk, FIRST_CHILD(this),
$1 = {path = 0x7fbdac007f20 "/centos/test/foo", name = 0x0, inode =
0x7fbdac001e98, parent = 0x0, gfid =
"\341n\035>u\030C#\230/\032\323H\371`\217", pargfid = '\000' <repeats 15
times>}
$2 = {uid = 1000, gid = 1000, perm = 33204, fop = GF_FOP_LOOKUP, acl_access =
0x0, acl_default = 0x0}

Breakpoint 1, posix_acl_open (frame=frame at entry=0x7fbdac014fe8,
this=this at entry=0x7fbdbc01dc00, loc=loc at entry=0x7fbdac000f30,
flags=flags at entry=32768, fd=fd at entry=0x7fbdac00ab28, xdata=xdata at entry=0x0) at
posix-acl.c:1196
1196        STACK_WIND(frame, posix_acl_open_cbk, FIRST_CHILD(this),
$3 = {path = 0x7fbdac009090 "/centos/test/foo", name = 0x0, inode =
0x7fbdac001e98, parent = 0x0, gfid =
"\341n\035>u\030C#\230/\032\323H\371`\217", pargfid = '\000' <repeats 15
times>}
$4 = {uid = 1000, gid = 1000, perm = 33204, fop = GF_FOP_LOOKUP, acl_access =
0x0, acl_default = 0x0}

Breakpoint 2, posix_acl_open (frame=frame at entry=0x7fbdac013978,
this=this at entry=0x7fbdbc01dc00, loc=loc at entry=0x7fbdac000f30,
flags=flags at entry=32768, fd=fd at entry=0x7fbdac014638, xdata=xdata at entry=0x0) at
posix-acl.c:1200
1200        STACK_UNWIND_STRICT(open, frame, -1, EACCES, NULL, NULL);
$5 = {path = 0x7fbdac009090 "/centos/test/foo", name = 0x0, inode =
0x7fbdac001e98, parent = 0x0, gfid =
"\341n\035>u\030C#\230/\032\323H\371`\217", pargfid = '\000' <repeats 15
times>}
$6 = {uid = 0, gid = 0, perm = 32768, fop = GF_FOP_READDIRP, acl_access = 0x0,
acl_default = 0x0}

Breakpoint 2, posix_acl_open (frame=frame at entry=0x7fbdac0126a8,
this=this at entry=0x7fbdbc01dc00, loc=loc at entry=0x7fbdac000f30,
flags=flags at entry=32768, fd=fd at entry=0x7fbdac017b48, xdata=xdata at entry=0x0) at
posix-acl.c:1200
1200        STACK_UNWIND_STRICT(open, frame, -1, EACCES, NULL, NULL);
$7 = {path = 0x7fbdac007f20 "/centos/test/foo", name = 0x0, inode =
0x7fbdac001e98, parent = 0x0, gfid =
"\341n\035>u\030C#\230/\032\323H\371`\217", pargfid = '\000' <repeats 15
times>}
$8 = {uid = 0, gid = 0, perm = 32768, fop = GF_FOP_READDIRP, acl_access = 0x0,
acl_default = 0x0}

Breakpoint 2, posix_acl_open (frame=frame at entry=0x7fbdac017b48,
this=this at entry=0x7fbdbc01dc00, loc=loc at entry=0x7fbdac000f30,
flags=flags at entry=32768, fd=fd at entry=0x7fbdac014fe8, xdata=xdata at entry=0x0) at
posix-acl.c:1200
1200        STACK_UNWIND_STRICT(open, frame, -1, EACCES, NULL, NULL);
$9 = {path = 0x7fbdac009090 "/centos/test/foo", name = 0x0, inode =
0x7fbdac001e98, parent = 0x0, gfid =
"\341n\035>u\030C#\230/\032\323H\371`\217", pargfid = '\000' <repeats 15
times>}
$10 = {uid = 0, gid = 0, perm = 32768, fop = GF_FOP_READDIRP, acl_access = 0x0,
acl_default = 0x0}

Breakpoint 2, posix_acl_open (frame=frame at entry=0x7fbdac014fe8,
this=this at entry=0x7fbdbc01dc00, loc=loc at entry=0x7fbdac000f30,
flags=flags at entry=32768, fd=fd at entry=0x7fbdac0126a8, xdata=xdata at entry=0x0) at
posix-acl.c:1200
1200        STACK_UNWIND_STRICT(open, frame, -1, EACCES, NULL, NULL);
$11 = {path = 0x7fbdac007f20 "/centos/test/foo", name = 0x0, inode =
0x7fbdac001e98, parent = 0x0, gfid =
"\341n\035>u\030C#\230/\032\323H\371`\217", pargfid = '\000' <repeats 15
times>}
$12 = {uid = 0, gid = 0, perm = 32768, fop = GF_FOP_READDIRP, acl_access = 0x0,
acl_default = 0x0}

Breakpoint 2, posix_acl_open (frame=frame at entry=0x7fbdac0126a8,
this=this at entry=0x7fbdbc01dc00, loc=loc at entry=0x7fbdac000f30,
flags=flags at entry=32768, fd=fd at entry=0x7fbdac017b48, xdata=xdata at entry=0x0) at
posix-acl.c:1200
1200        STACK_UNWIND_STRICT(open, frame, -1, EACCES, NULL, NULL);
$13 = {path = 0x7fbdac009090 "/centos/test/foo", name = 0x0, inode =
0x7fbdac001e98, parent = 0x0, gfid =
"\341n\035>u\030C#\230/\032\323H\371`\217", pargfid = '\000' <repeats 15
times>}
$14 = {uid = 0, gid = 0, perm = 32768, fop = GF_FOP_READDIRP, acl_access = 0x0,
acl_default = 0x0}

Breakpoint 1, posix_acl_open (frame=frame at entry=0x7fbdac018b38,
this=this at entry=0x7fbdbc01dc00, loc=loc at entry=0x7fbdac000f30,
flags=flags at entry=32768, fd=fd at entry=0x7fbdac0179d8, xdata=xdata at entry=0x0) at
posix-acl.c:1196
1196        STACK_WIND(frame, posix_acl_open_cbk, FIRST_CHILD(this),
$15 = {path = 0x7fbdac007f20 "/centos/test/foo", name = 0x0, inode =
0x7fbdac001e98, parent = 0x0, gfid =
"\341n\035>u\030C#\230/\032\323H\371`\217", pargfid = '\000' <repeats 15
times>}
$16 = {uid = 1000, gid = 1000, perm = 33204, fop = GF_FOP_LOOKUP, acl_access =
0x0, acl_default = 0x0}

-- 
You are receiving this mail because:
You are on the CC list for the bug.
You are the assignee for the bug.


More information about the Bugs mailing list