xfs
[Top] [All Lists]

An Introduction, and some Questions

To: linux-xfs@xxxxxxxxxxx
Subject: An Introduction, and some Questions
From: Danny <danscox@xxxxxxxxxxxxxx>
Date: Tue, 14 Nov 2000 18:12:35 -0500
Organization: Connex Inc
Reply-to: dcox@xxxxxxxxxx
Sender: owner-linux-xfs@xxxxxxxxxxx
Hello, all!

        By way of introduction, I'm Danny Cox, recently hired by Connex, a
company that makes NAS boxes, among other things.  I was charged with
getting ACLs to work with XFS.  Mr. Lord pointed us to the original ACL
code, and most of it went pretty smoothly.  With some caveats, it all
seems to work, even!

        I do have some issues, though.  I can describe the symptoms, and
perhaps someone will be able to point me in the right direction.  Thanks
in advance.

        First, I have a program that is suid-root, and takes two arguments: a
file of tests to perform, and a file to perform the tests upon.  It
changes the user/group of the file to that specified, and forks.  The
child assumes the user/group specified (perhaps different than the
file's user/group), and performs the tests (read/write/execute).  I
discovered that it didn't always work!  The short form is that if I
place a acl_get(2) or a stat(2) call after the acl_set(2), it works
every time.  I thus conclude that the data is being cached (for lack of
a better term) somewhere, and that it's not available to the xfs_access
call some few milliseconds later.

        Item two: the test file I use has some 49 tests.  Sometimes (sorry,
I've not yet been able to narrow this down any), the file in question
acquires a strange quality.  Thereafter, any attempt to execute it
fails, with a result of 'Text file busy'.  I'm mystified!  No obvious
entries with 'ps ax' appear, and unmount fails with 'Device busy'.  I
don't have any idea of where to begin looking!

        Item last: when adding the various functions to handle the intermediate
steps between system call and xfs_acl.c, I basically copied what
attr_get did.  One of these, in linux/xfs_vnode.h is:
-------------------------------------------------------------
#define VOP_ACL_GET(vp, acl, dacl, rv)                                 
\
{                                                                      
\
        VN_BHV_READ_LOCK(&(vp)->v_bh);                                 
\
        rv = _VOP_(vop_acl_get, vp)((vp),acl,dacl);                    
\
        VN_BHV_READ_UNLOCK(&(vp)->v_bh);                               
\
}
-------------------------------------------------------------
My question is: is this necessary?  Under Linux, VN_BHV_READ_LOCK is
defined away to nothing. However, on other archs, it may not be.  Since
acl_get eventually calls attr_get through a similar macro, the lock is
set twice!  Is this is problem?  Similarly, acl_set does the same.

        Finally, then: once these issues are dealt with, to whom shall I send
the diffs, assuming that folks want it?

        Thanks for your time!

-- 
"Men occasionally stumble over the truth, but most of them pick 
themselves up and hurry off as if nothing had happened." 
   -- Winston Churchill 

Danny

<Prev in Thread] Current Thread [Next in Thread>