Description of problem:
Calling glfs_stat on a file or directory will return a garbage device ID (stat.st_dev).
Version-Release number of selected component (if applicable):
GlusterFS 3.6.3, GFAPI_3.4.0
Reproducible while building the coreutils for gluster.
Steps to Reproduce:
"Device: 2b630e2eh/727911982d" from running glfs_stat on the file in the volume.
"Device: 803h/2051d" from running stat directly on the file in the brick dir.
Soumya, maybe reassign this to Shyam, or someone else if appropriate?
Could you confirm if you see this issue with all types of files or for only particular types?
Sorry for the delayed response.
It appears to be an issue for:
* regular files
* symbolic links
* character special files
* block special files
Also, FWIW, it looks like the Inode number is also butchered (both via the gfapi and the FUSE mount), but I'm not sure is this is just a normal Gluster function.
GlusterFS-3.6 is nearing its End-Of-Life, only important security bugs still make a chance on getting fixed. Moving this to the mainline 'version'. If this needs to get fixed in 3.7 or 3.8 this bug should get cloned.
Device ID and inode are expected to be different from the values on the bricks. Ideally the device ID is the same for all files on the Gluster volume, and does not relate to the device ID on the brick. The inode needs to be different, because in a distributed volume the inode from a brick can exist multiple times in a Gluster volume. For replication the inode does not need to be the same on all the bricks.
What is you expectation of the device ID when you take the above in account? Have you seen the device ID change for different glfs_stat() calls on the same volume?
Tried with python bindings of gfapim, issue not reproducible, device id is same for all dirs and files also
>>> from gluster import gfapi
>>> vol = gfapi.Volume('gluster2','test2')
>>> list_en = vol.listdir_with_stat('/')
>>> for i in list_en:
... stat = i
>>> with vol.fopen("/venkat/f1", 'wb') as f:
... f.write("hello world")
>>> with vol.fopen("/venkat/f2", 'wb') as f:
... f.write("hello gluster")
>>> list_files = vol.listdir_with_stat('/venkat')
>>> for entry in list_files:
... stat = entry
As per c#6, the issue is not seen in latest gluster versions hence closing this bug as fixed in current release