Bug 1358020

Summary: rgw_setattr does not change attrs
Product: [Red Hat Storage] Red Hat Ceph Storage Reporter: Matt Benjamin (redhat) <mbenjamin>
Component: RGWAssignee: Matt Benjamin (redhat) <mbenjamin>
Status: CLOSED ERRATA QA Contact: Ramakrishnan Periyasamy <rperiyas>
Severity: low Docs Contact: Bara Ancincova <bancinco>
Priority: low    
Version: 2.0CC: cbodley, ceph-eng-bugs, ceph-qe-bugs, hnallurv, kbader, kdreyer, mbenjamin, nlevine, owasserm, sweil, tserlin, uboppana
Target Milestone: rc   
Target Release: 2.2   
Hardware: All   
OS: All   
Whiteboard:
Fixed In Version: RHEL: ceph-10.2.5-7.el7cp Ubuntu: ceph_10.2.5-3redhat1xenial Doc Type: Bug Fix
Doc Text:
.Setting file permissions and ownership attributes no longer fails on existing files and directories Previously, the NFS Ganesha file system failed to serialize and store UNIX attributes on existing files and directories. Consequently, file permissions and ownership attributes that were set after file or directory creation were not correctly stored. The underlying source code has been modified, and setting file permissions and ownership attributes no longer fails on existing files and directories.
Story Points: ---
Clone Of: Environment:
Last Closed: 2017-03-14 15:44:17 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On: 1357932    
Bug Blocks: 1383917, 1412948    

Description Matt Benjamin (redhat) 2016-07-19 20:19:38 UTC
Description of problem:

The rgw_setattr operation, though called by the RGW FSAL, has no effect.


How reproducible:
100%


Steps to Reproduce:
1. mount NFS RGW namespace
2. create any objects
3. chown objects to any uid or gid

Actual results:
Ownership does not change (shows as nobody/nogroup, typically)

Expected results:
Ownership matches that requested

Comment 3 Matt Benjamin (redhat) 2016-07-19 20:23:16 UTC
Fixed in cc106aaab6d5a745c17e678a15266b9cd3a6787e.

Comment 5 Matt Benjamin (redhat) 2016-07-19 21:20:44 UTC
(In reply to Matt Benjamin (redhat) from comment #3)
> Fixed in cc106aaab6d5a745c17e678a15266b9cd3a6787e.


Sorry, ignore this SHA, rather:

On ceph-rhel-2-patches, it's ae5487e912fac971db5d84af9ac136054f306f07

    Signed-off-by: Matt Benjamin <mbenjamin>
    (cherry picked from commit 4de1c3c260265f821ebee842d49cb35bf49d8e4e)

Comment 12 Matt Benjamin (redhat) 2016-09-20 21:45:15 UTC
I do not reproduce an EIO result in testing with current master.

HOWEVER.

1. I found a regression in nfs-ganesha setting unix gid caused by a copy-paste of a similar error--a fix for this has been submitted to nfs-ganesha upstream and should merge in 2.4.0-rc6

2. I found that discretionary set_attr operations were not being restored successfully, whereas attrs set on file creation were restored;  the root cause of this was a) failure of RGWLibFS::setattr to set a value for RGW_ATTR_UNIX_KEY1, while RGWLibFS::expects it.

Fix proposed in https://github.com/ceph/ceph/pull/11159

Comment 16 Ramakrishnan Periyasamy 2016-11-02 17:53:51 UTC
Hi Matt, 
         As per below output chown for root user is passing but still ownership is with "4294967294" user, is this expected  or it should be updated while listing the files ?

[ubuntu@magna105 bucket-from-nfs]$ ll
total 9884
-rw-r--r--. 1 4294967294 4294967294       66 Nov  2 17:12 ceph.client.magna104.keyring
-rw-r--r--. 1 4294967294 4294967294 10118605 Nov  2 17:10 ceph_output
-rw-r--r--. 1 4294967294 4294967294     1043 Nov  2 17:11 old_ceph.conf
-rw-r--r--. 1 4294967294 4294967294     1913 Nov  2 17:11 old_ganesha.conf
[ubuntu@magna105 bucket-from-nfs]$ sudo chown root:root ceph.client.magna104.keyring 
[ubuntu@magna105 bucket-from-nfs]$ ls -l
total 9884
-rw-r--r--. 1 4294967294 4294967294       66 Nov  2 17:12 ceph.client.magna104.keyring
-rw-r--r--. 1 4294967294 4294967294 10118605 Nov  2 17:10 ceph_output
-rw-r--r--. 1 4294967294 4294967294     1043 Nov  2 17:11 old_ceph.conf
-rw-r--r--. 1 4294967294 4294967294     1913 Nov  2 17:11 old_ganesha.conf
[ubuntu@magna105 bucket-from-nfs]$ 

Regards,
Ramakrishnan

Comment 17 Matt Benjamin (redhat) 2016-11-02 18:25:50 UTC
(In reply to Ramakrishnan Periyasamy from comment #16)
> Hi Matt, 
>          As per below output chown for root user is passing but still
> ownership is with "4294967294" user, is this expected  or it should be
> updated while listing the files ?
> 

Hi Ramakrishnan,

It should be updated, however, setuid can fail due to nfs permissions--which looks to be the case here, because "4294967294" is the nfs-ganesha value for nobody or nogroup (i.e., the object has been root-squashed).

To avoid this, you need to run nfs-ganesha with 

NFSV4 {
    Allow_Numeric_Owners = true;
    Only_Numeric_Owners = true;
}

If testing with those settings still yields uid or gid of "4294967294", it's still not likely to be an actual RGW bug.

Comment 18 Ramakrishnan Periyasamy 2016-11-03 06:54:05 UTC
(In reply to Matt Benjamin (redhat) from comment #17)
> (In reply to Ramakrishnan Periyasamy from comment #16)
> > Hi Matt, 
> >          As per below output chown for root user is passing but still
> > ownership is with "4294967294" user, is this expected  or it should be
> > updated while listing the files ?
> > 
> 
> Hi Ramakrishnan,
> 
> It should be updated, however, setuid can fail due to nfs permissions--which
> looks to be the case here, because "4294967294" is the nfs-ganesha value for
> nobody or nogroup (i.e., the object has been root-squashed).
> 
> To avoid this, you need to run nfs-ganesha with 
> 
> NFSV4 {
>     Allow_Numeric_Owners = true;
>     Only_Numeric_Owners = true;
> }
>
> If testing with those settings still yields uid or gid of "4294967294", it's
> still not likely to be an actual RGW bug.

Hi Matt,

NFS service is running with above values in config file. Discussed with you about this in irc, as per our discussion not moving this bug to verified state also this needs to be documented for this release.

Regards,
Ramakrishnan

Comment 29 Matt Benjamin (redhat) 2017-01-05 18:51:10 UTC
fix is on jewel/rhcs 2.2 baseline

Comment 32 Ramakrishnan Periyasamy 2017-01-30 16:42:50 UTC
moving this bug to verified state. comment 31 has the verification results.
Verified in following build:
ceph: 10.2.5-12.el7cp (8614488f8c3e7a9be34e58fb1aaf23416156152c)
NFS-Ganesha: nfs-ganesha-rgw-2.4.2-1.el7cp.x86_64

Comment 36 errata-xmlrpc 2017-03-14 15:44:17 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://rhn.redhat.com/errata/RHBA-2017-0514.html