Bug 449330

Summary: stat() syscall on a file returns id of diapered device in st_dev
Product: Red Hat Enterprise Linux 4 Reporter: Mark Hlawatschek <hlawatschek>
Component: GFS-kernelAssignee: Robert Peterson <rpeterso>
Status: CLOSED ERRATA QA Contact: GFS Bugs <gfs-bugs>
Severity: medium Docs Contact:
Priority: low    
Version: 4.6   
Target Milestone: rc   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2009-05-18 21:10:12 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Attachments:
Description Flags
Proposed patch none

Description Mark Hlawatschek 2008-06-02 08:24:37 UTC
Description of problem:

a stat() syscall on a file residing on gfs returns the id of the diapered 
device. This causes problems, when the "mounted" device and the st_dev entry 
of the stat structure are compared. (e.g. grubby) 

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

GFS-kernel-smp-2.6.9-75.9

How reproducible:
Always

Steps to Reproduce:
1. get stat.st_dev from a file residing on gfs volume
  
Actual results:
stat.st_dev is the device id of the diapered device

Expected results:
I expected stat.st_dev to show the id of the device that has been used during 
the mount operation. 


Additional info:

The different device information shown from stat and mount leads to problems. 
e.g. grubby compares the two values.

Comment 1 Robert Peterson 2008-06-02 18:06:45 UTC
Created attachment 307543 [details]
Proposed patch

This patch returns the "real" device ID rather than the diapered device
for file stat operations.

Comment 2 Robert Peterson 2008-06-02 18:07:36 UTC
Output before and after the patch:

[root@trin-12 /home/bob]# mount -tgfs /dev/hda4 /mnt/gfs/
[root@trin-12 /home/bob]# ls -l /dev | grep "hda4"
brw-------  1 root root   252,   0 Jun  2 18:28 diapered_hda4
brw-rw----  1 root disk     3,   4 Jun  2 11:46 hda4
[root@trin-12 /home/bob]# ./diaperdevtest 
st_dev = 252 / 0
[root@trin-12 /home/bob]# umount /mnt/gfs
[root@trin-12 /home/bob]# rmmod gfs
[root@trin-12 /home/bob]# insmod cluster/gfs-kernel/src/gfs/gfs.ko
[root@trin-12 /home/bob]# mount -tgfs /dev/hda4 /mnt/gfs/
[root@trin-12 /home/bob]# ./diaperdevtest 
st_dev = 3 / 4
[root@trin-12 /home/bob]# 


Comment 3 Robert Peterson 2008-06-02 18:15:36 UTC
FYI: This does not affect RHEL5.x due to the fact that we're not using
diapered devices there.


Comment 7 Robert Peterson 2008-06-04 20:14:35 UTC
This patch has been pushed to the RHEL4 branch of the cluster git tree
for inclusion into 4.8.  Changing status to Modified.


Comment 10 errata-xmlrpc 2009-05-18 21:10:12 UTC
An advisory has been issued which should help the problem
described in this bug report. This report is therefore being
closed with a resolution of ERRATA. For more information
on therefore solution and/or where to find the updated files,
please follow the link below. You may reopen this bug report
if the solution does not work for you.

http://rhn.redhat.com/errata/RHBA-2009-1045.html