Bug 1580540 - make getfattr return proper response for "glusterfs.gfidtopath" xattr for files created when gfid2path was off
Summary: make getfattr return proper response for "glusterfs.gfidtopath" xattr for fil...
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: GlusterFS
Classification: Community
Component: bitrot
Version: 4.1
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: bugs@gluster.org
QA Contact:
bugs@gluster.org
URL:
Whiteboard:
Depends On: 1570962
Blocks:
TreeView+ depends on / blocked
 
Reported: 2018-05-21 18:02 UTC by Raghavendra Bhat
Modified: 2018-06-20 18:06 UTC (History)
1 user (show)

Fixed In Version: glusterfs-v4.1.0
Doc Type: If docs needed, set a value
Doc Text:
Clone Of: 1570962
Environment:
Last Closed: 2018-06-20 18:06:39 UTC
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Embargoed:


Attachments (Terms of Use)

Description Raghavendra Bhat 2018-05-21 18:02:49 UTC
+++ This bug was initially created as a clone of Bug #1570962 +++

Description of problem:

The glusterfs.gfidtopath getxattr should fail if performed on a file that was created when storage.gfid2path option was turned off. 


Version-Release number of selected component (if applicable):


How reproducible:
Always

Steps to Reproduce:
1. turn off gfid2path option on a gluster volume

gluster volume set <volume name> storage.gfid2path off

2. Create a file in the volume for which gfid2path option is turned off above.

3. Turn on gfid2path option on the same volume

gluster volume set <volume name> storage.gfid2path on

Do a getxattr on the file that was created when gfid2path option was off, for the extended attribute "glusterfs.gfidtopath"

getfattr -n glusterfs.gfidtopath <path to the file>


Actual results:
echo $? returns success

Expected results:
The getfattr command should fail saying such a attribute is not present

Additional info:


This bug is mainly for backporting the patch "https://review.gluster.org/19963" from master to the release-4.1 branch. In the master branch the same bug (from which this bug is cloned) was used for 

A) bringing in the entire infrastructure of printing the paths of the corrupted
   objects found by bit-rot detection
B) fixing the getfattr behavior for "glusterfs.gfidtopath" xattr for a file
   created when gfid2path option was off. 


But the current release-4.1 branch contains the patch for (A) only. And hence using this bug as a clone of the master bug, but only for the submission of the patch that addresses (B)






--- Additional comment from Worker Ant on 2018-04-23 17:02:28 EDT ---

REVIEW: https://review.gluster.org/19928 (features/bitrot: print the path of the corrupted objects) posted (#1) for review on master by Raghavendra Bhat

--- Additional comment from Worker Ant on 2018-05-04 07:14:27 EDT ---

COMMIT: https://review.gluster.org/19928 committed in master by "Amar Tumballi" <amarts> with a commit message- features/bitrot: print the path of the corrupted objects

Currently "gluster volume bitrot <volume name> scrub status"
gives the list of the corrupted objects (files as of now).
But only the gfids of those corrupted objects are seen and
one has to do getfattr, find etc operations to get the actual
path of those objects for removal etc.

This change makes an attempt to print the path of those files
as much as possible.

* Try to get the path using the on disk gfid2path xattr.

* If the above operation fails, then go for in memory path
(provided that the object has its dentry
properly created and linked in the inode table of the brick where
the corrupted object is present) So the gfid to path resolution is
a soft resolution, i.e. based on the inode and dentry cache in the
brick's memory. If the path cannot be obtained via inode table also,
then only gfid is printed.

Change-Id: Ie9a30307f43a49a2a9225821803c7d40d231de68
fixes: bz#1570962
Signed-off-by: Raghavendra Bhat <raghavendra>

--- Additional comment from Worker Ant on 2018-05-04 13:20:08 EDT ---

REVIEW: https://review.gluster.org/19963 (make posix return errors when gfid2path key is absent) posted (#1) for review on master by Raghavendra Bhat

--- Additional comment from Worker Ant on 2018-05-18 00:20:06 EDT ---

COMMIT: https://review.gluster.org/19963 committed in master by "Amar Tumballi" <amarts> with a commit message- make posix return errors when gfid2path key is absent

Change-Id: I3a8d452d00560dac5e0b7ff0b1835d1f20a59f91
updates: bz#1570962
Signed-off-by: Raghavendra Bhat <raghavendra>

Comment 1 Worker Ant 2018-05-21 18:05:53 UTC
REVIEW: https://review.gluster.org/20053 (make posix return errors when gfid2path key is absent) posted (#1) for review on release-4.1 by Raghavendra Bhat

Comment 2 Worker Ant 2018-05-22 10:28:55 UTC
COMMIT: https://review.gluster.org/20053 committed in release-4.1 by "Shyamsundar Ranganathan" <srangana> with a commit message- make posix return errors when gfid2path key is absent

Change-Id: I3a8d452d00560dac5e0b7ff0b1835d1f20a59f91
updates: bz#1580540
Signed-off-by: Raghavendra Bhat <raghavendra>
(cherry picked from commit c2cf3f686f3ea0efd936d2eafc404fc9d2e0acc7)

Comment 3 Shyamsundar 2018-06-20 18:06:39 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.