[Top] [All Lists]

Re: SIGSEGV with 'cp -a'

To: bfields@xxxxxxxxxxxxxx
Subject: Re: SIGSEGV with 'cp -a'
From: Alexander Clouter <alex@xxxxxxxxxxxxx>
Date: Sat, 7 May 2011 00:04:38 +0100
Cc: linux-xfs@xxxxxxxxxxx
In-reply-to: <20110506220035.GU25017@chipmunk>
Organization: diGriz
References: <20110506220035.GU25017@chipmunk>
Resent-date: Mon, 23 May 2011 11:53:24 +0100
Resent-from: Alexander Clouter <alex@xxxxxxxxxxxxx>
Resent-message-id: <20110523105324.GY28383@chipmunk>
Resent-to: xfs@xxxxxxxxxxx
User-agent: Mutt/1.5.20 (2009-06-14)

I *think* it all boils down to XFS[1] being bad and it should be 
returning ENOATTR rather than EINVAL for unknown xattr names; according 
to the getxattr() manpage.

The previous patch just plasters over the problem (as we should never be 
getting to acl_ptn4_acl_trans() on an XFS filesystem).  The result is 
that you see the ACL's on a NFSv4 mount, but local filesystems they are 

The attached patch fixes things (hopefully) properly.



* Alexander Clouter <alex@xxxxxxxxxxxxx> [2011-05-06 23:00:35+0100]:
> Unsure if you are interested, as it really looks like your nfs4 libacl 
> patches[1] are no longer being maintained, but after moving my Debian 
> installation from lenny to squeeze I got segfaults when copying files:
> ----
> Program received signal SIGSEGV, Segmentation fault.
> acl_ptn4_acl_trans (pacl=0x8062f8c, acl=0x0, type=32768, is_dir=1,
>     nfs_domain=0xbffff108 "elar.soas.ac.uk") at acl_ptn4_acl_trans.c:109
> 109             purge_aces(acl, type);
> (gdb) where
> #0  acl_ptn4_acl_trans (pacl=0x8062f8c, acl=0x0, type=32768, is_dir=1,
>     nfs_domain=0xbffff108 "elar.soas.ac.uk") at acl_ptn4_acl_trans.c:109
> #1  0xb7fac969 in acl_set_file (path_p=0x8062d20 "moo/private", 
> type=32768, acl=0x8062f8c)
>     at acl_set_file.c:114
> [snipped]
> ----
> Seems to come about as getxattr("system.nfs4_acl") on an XFS filesystem 
> pops back with (iirc) EINVAL which trickles into libacl as NULL in acl 
> when being passed to purge_aces().
> Obvious fix is to drop in a quick check for NULL, as done in the 
> attached patch.  Would be great if you could could commit this to your 
> dusty git tree, spit out a new patch and tell us all to "get with the 
> program and use richacls" ;)
> Having 'native' ACLs with NFSv4 has helped me no end, so my thanks to 
> you (and any other contributors).
> Cheers
> [1] http://www.citi.umich.edu/projects/nfsv4/linux/
> [2] I'm using the Debian acl/libacl 2.2.49-4 package with 
>       acl-2.2.42-CITI_NFS4_ALL-2.diff applied

Alexander Clouter
.sigmonster says: problem drinker, n.:
                        A man who never buys.

Attachment: nfs4-acl-oops-fix.patch
Description: Text Data

<Prev in Thread] Current Thread [Next in Thread>
  • Re: SIGSEGV with 'cp -a', Alexander Clouter <=