Bug 1542318 - dht_lookup_unlink_of_false_linkto_cbk fails with "Permission denied"
Summary: dht_lookup_unlink_of_false_linkto_cbk fails with "Permission denied"
Alias: None
Product: GlusterFS
Classification: Community
Component: distribute
Version: mainline
Hardware: Unspecified
OS: Unspecified
Target Milestone: ---
Assignee: Nithya Balachandran
QA Contact:
Depends On: 1540664
Blocks: 1543016 1543487
TreeView+ depends on / blocked
Reported: 2018-02-06 05:19 UTC by Nithya Balachandran
Modified: 2018-06-20 17:59 UTC (History)
15 users (show)

Fixed In Version: glusterfs-v4.1.0
Doc Type: If docs needed, set a value
Doc Text:
Clone Of: 1540664
: 1543016 1543487 (view as bug list)
Last Closed: 2018-06-20 17:59:24 UTC
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:

Attachments (Terms of Use)

Description Nithya Balachandran 2018-02-06 05:19:37 UTC
+++ This bug was initially created as a clone of Bug #1540664 +++

Description of problem:

[2018-01-30 19:41:53.630949] I [MSGID: 109045] [dht-common.c:2391:dht_lookup_cbk] 0-vol1-dht: linkfile not having link subvol for /data/file1
[2018-01-30 19:41:53.672524] W [MSGID: 114031] [client-rpc-fops.c:630:client3_3_unlink_cbk] 0-vol1-client-6: remote operation failed [Permission denied]
[2018-01-30 19:41:53.672638] W [MSGID: 114031] [client-rpc-fops.c:630:client3_3_unlink_cbk] 0-vol1-client-7: remote operation failed [Permission denied]
[2018-01-30 19:41:53.672632] W [MSGID: 114031] [client-rpc-fops.c:630:client3_3_unlink_cbk] 0-vol1-client-8: remote operation failed [Permission denied]
[2018-01-30 19:41:53.672828] W [MSGID: 114031] [client-rpc-fops.c:630:client3_3_unlink_cbk] 0-vol1-client-11: remote operation failed [Permission denied]
[2018-01-30 19:41:53.672839] I [MSGID: 109069] [dht-common.c:1353:dht_lookup_unlink_of_false_linkto_cbk] 0-vol1-dht: lookup_unlink returned with op_ret -> -1 and op-errno -> 13 for /data/file1
[2018-01-30 19:41:53.672868] W [MSGID: 112199] [nfs3-helpers.c:3515:nfs3_log_newfh_res] 0-nfs-nfsv3: /data/file1 => (XID: 52dbaffa, LOOKUP: NFS: 5(I/O error), POSIX: 5(Input/output error)), FH: exportid 00000000-0000-0000-0000-000000000000, gfid 00000000-0000-0000-0000-000000000000, mountid 00000000-0000-0000-0000-000000000000 [Resource temporarily unavailable]

Actual results:

Bricks are unable to fully heal.

Expected results:

Normal operation.

Additional info:

Comment 1 Nithya Balachandran 2018-02-06 09:48:10 UTC
Unprivileged users do not have permissions to delete stale linkto files. Failure to unlink the file causes DHT to return EIO.

Steps to reproduce this issue:

1. gluster volume create vol1 server1:/bricks/brick1/vol1-{1,2}
2. gluster volume start vol1                                                      
3. mount -t glusterfs -s server1:/vol1 /mnt/fuse1                                     
# create a file for testing                                                     
4. dd if=/dev/urandom of=/mnt/fuse1/FILE-1 count=1 bs=16k                            
5. gluster volume set vol1 performance.parallel-readdir on

#Rename the file in order to create a linkto file                        
6. mv vol1/FILE-1 vol1/FILE-2    
#Force the linkto xattr values to become stale by changing the dht subvols in the graph                               
7. gluster volume set vol1 performance.parallel-readdir off 

Fuse mount as a non-privileged user
8. echo user_allow_other >> /etc/fuse.conf                                         
9. gluster volume set vol1 allow-insecure on  

Create a user user1
10. useradd user1     
11: su user1                  
12. cd /home/user1/
13. mkdir mymount

#Mount the volume as user1
14: glusterfs --log-level=INFO --log-file=my_user_accessable_logfile.log --volfile-id=vol1 --volfile-server=server1 ~/mymount

15: cd mymount/
16. ls FILE-2

ls: cannot access FILE-2: Input/output error

Comment 2 Worker Ant 2018-02-06 09:53:36 UTC
REVIEW: https://review.gluster.org/19508 (cluster/dht: Unlink linkto files as root) posted (#1) for review on master by N Balachandran

Comment 3 Nithya Balachandran 2018-02-06 13:32:53 UTC
See Joe Julian's blog for details on how to FUSE mount the volume as a non-privileged user.


Comment 4 Worker Ant 2018-02-07 14:33:32 UTC
COMMIT: https://review.gluster.org/19508 committed in master by "N Balachandran" <nbalacha@redhat.com> with a commit message- cluster/dht: Unlink linkto files as root

Non-privileged users cannot delete linkto
files. However the failure to unlink a stale linkto
causes DHT to fail the lookup with EIO and hence
prevent access to the file.

Change-Id: Id295362d41e52263790694602f36f1219f0646a2
BUG: 1542318
Signed-off-by: N Balachandran <nbalacha@redhat.com>

Comment 5 Worker Ant 2018-02-07 15:30:14 UTC
REVIEW: https://review.gluster.org/19524 (tests/dht: Non-root can delete stale linkto files) posted (#1) for review on master by N Balachandran

Comment 6 Worker Ant 2018-02-08 08:19:36 UTC
COMMIT: https://review.gluster.org/19524 committed in master by "N Balachandran" <nbalacha@redhat.com> with a commit message- tests/dht: Non-root can delete stale linkto files

Test to check that non-root users can delete stale
linkto files

Change-Id: Ic9bc76bc485cab839927af60cfce78a058eee2e4
BUG: 1542318
Signed-off-by: N Balachandran <nbalacha@redhat.com>

Comment 7 Shyamsundar 2018-06-20 17:59:24 UTC
This bug is getting closed because a release has been made available that should address the reported issue. In case the problem is still not fixed with glusterfs-v4.1.0, please open a new bug report.

glusterfs-v4.1.0 has been announced on the Gluster mailinglists [1], packages for several distributions should become available in the near future. Keep an eye on the Gluster Users mailinglist [2] and the update infrastructure for your distribution.

[1] http://lists.gluster.org/pipermail/announce/2018-June/000102.html
[2] https://www.gluster.org/pipermail/gluster-users/

Note You need to log in before you can comment on or make changes to this bug.