Bug 449330 - stat() syscall on a file returns id of diapered device in st_dev
stat() syscall on a file returns id of diapered device in st_dev
Status: CLOSED ERRATA
Product: Red Hat Enterprise Linux 4
Classification: Red Hat
Component: GFS-kernel (Show other bugs)
4.6
All Linux
low Severity medium
: rc
: ---
Assigned To: Robert Peterson
GFS Bugs
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2008-06-02 04:24 EDT by Mark Hlawatschek
Modified: 2010-01-11 22:23 EST (History)
0 users

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2009-05-18 17:10:12 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)
Proposed patch (1004 bytes, patch)
2008-06-02 14:06 EDT, Robert Peterson
no flags Details | Diff

  None (edit)
Description Mark Hlawatschek 2008-06-02 04:24:37 EDT
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 14:06:45 EDT
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 14:07:36 EDT
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 14:15:36 EDT
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 16:14:35 EDT
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 17:10:12 EDT
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

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