Bug 492911

Summary: tar off gfs2 broken - truncated symbolic links
Product: Red Hat Enterprise Linux 5 Reporter: Everett Bennett <everett.bennett>
Component: kernelAssignee: Steve Whitehouse <swhiteho>
Status: CLOSED ERRATA QA Contact: Cluster QE <mspqa-list>
Severity: urgent Docs Contact:
Priority: low    
Version: 5.3CC: adas, bmarzins, dzickus, edamato, emcnabb, everett.bennett, mwaite, nstraz, rpeterso, sghosh
Target Milestone: rc   
Target Release: ---   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2009-09-02 09:02:42 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
Original report from Manager of ImE product team.
none
Proposed patch
none
Version which applies against the RHEL kernel none

Description Everett Bennett 2009-03-30 17:20:19 UTC
Created attachment 337234 [details]
Original report from Manager of ImE product team.

Description of problem:

Symbolic links are truncated and have size of 0 characters within gfs2 file system.

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

Name       : gfs2-utils
Arch       : x86_64
Version    : 0.1.53

How reproducible:

Create tar ball and then check using command such as:

Steps to Reproduce:

ime1/root> gtar zcf a.tgz app/oracle/product/11.1.0/db_1/bin/
ime1/root> gtar ztvf a.tgz|grep -F " ->"
lrwxrwxrwx oracle/oinstall        0 2009-03-26 12:19:45 app/oracle/product/11.1.0/db_1/bin/lbuilder -> /
ime1/root> ls -ld app/oracle/product/11.1.0/db_1/bin/lbuilder
lrwxrwxrwx 1 oracle oinstall 0 Mar 26 12:19 app/oracle/product/11.1.0/db_1/bin/lbuilder -> /dcs/appl01/app/oracle/product/11.1.0/db_1/nls/lbuilder/lbuilder

  
Actual results:

lrwxrwxrwx oracle/oinstall        0 2009-03-26 12:19:45 app/oracle/product/11.1.0/db_1/bin/lbuilder -> /

Expected results:

lrwxrwxrwx 1 oracle oinstall 0 Mar 26 12:19 app/oracle/product/11.1.0/db_1/bin/lbuilder -> /dcs/appl01/app/oracle/product/11.1.0/db_1/nls/lbuilder/lbuilder

Additional info:

Comment 1 Steve Whitehouse 2009-03-31 14:38:11 UTC
How were the links with zero size created? In particular were they pre-existing on a gfs1 filesystem which was converted, or created by some script or process?

I cannot reproduce the issue here at the moment, so I'm wonder what I might be doing differently. Roughly what % of the links are affected? ?Maybe I haven't created enough of them to see the issue yet...

Comment 2 Steve Whitehouse 2009-03-31 15:37:37 UTC
I think I might have found the issue....

if when you have some zero length symlinks on a gfs2 filesystem, you umount and then remount again, so the sizes suddenly become correct again? I'm working on a patch at the moment.

Comment 3 Steve Whitehouse 2009-03-31 16:10:03 UTC
Created attachment 337329 [details]
Proposed patch

This is the patch which will go upstream.

Comment 4 Steve Whitehouse 2009-03-31 16:30:54 UTC
Created attachment 337336 [details]
Version which applies against the RHEL kernel

Comment 5 Steve Whitehouse 2009-03-31 16:36:40 UTC
Patch posted to rhkernel-list.

Possible workarounds in the mean time:

1. umount/remount
2. Use the drop caches feature (via sysfs) which should mean that inodes (including symlinks) will be reread from disk.

Comment 7 Everett Bennett 2009-03-31 16:52:57 UTC
Can you provide a specific example on how to use vm.drop_caches ?

Especially with regards to "gfs2" ?

I found this link:  

 - http://www.linuxinsight.com/proc_sys_vm_drop_caches.html

Comment 8 Steve Whitehouse 2009-03-31 18:42:47 UTC
The link has the correct info. I'm afraid there is no way to make that filesystem specific, it will affect all the mounted filesystems and the effect will be to lower performance as the caches are refilled.

So its not in any way an ideal solution, but it might be the kind of thing which could be used in the short term if you just want to make an occasional back up of a directory tree or something along those lines.

Comment 9 Steve Whitehouse 2009-03-31 19:23:42 UTC
I should have also added that the echo 2 line is the one to use, since its the inodes that we wish to have reread.



The reproducer that I found was like this (for the benefit of qe):

mkdir -p a/b/c/d/e/f
touch a/b/c/d/e/f/g
ln -s a/b/c/d/e/f/g foo && stat foo

If the stat reveals a zero sized inode, than thats the bug. If nothing happens to cause the link's inode to be read before the system disposes of it (after the creation - and that doesn't take very long) then the link size will be set correctly so that the "stat foo" has to occur right away in order to show up the issue.

Comment 11 Don Zickus 2009-04-06 21:18:07 UTC
in kernel-2.6.18-138.el5
You can download this test kernel from http://people.redhat.com/dzickus/el5

Please do NOT transition this bugzilla state to VERIFIED until our QE team
has sent specific instructions indicating when to do so.  However feel free
to provide a comment indicating that this fix has been verified.

Comment 14 Everett Bennett 2009-04-16 16:23:18 UTC
The issue appears to have been resolved.  Thanks.

Comment 16 errata-xmlrpc 2009-09-02 09:02:42 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/RHSA-2009-1243.html