lkml.org 
[lkml]   [2004]   [Dec]   [22]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    Date
    From
    SubjectRe: XFS: inode with st_mode == 0
    On Wed, Dec 22, 2004 at 09:41:58AM +0100, Jakob Oestergaard wrote:
    > On Tue, Dec 21, 2004 at 07:43:04PM +0100, Jan Kasprzak wrote:
    > ...
    > > :
    > > : No, the problem I've fixed was related to XFS getting the inode version
    > > : number wrong - or at least different than NFSD expects.
    > > :
    > > We have applied these two patches to 2.6.10-rc2, but this
    > > does not help. A few minutes ago I've got the "?----------" file
    > > again from my test script. This time it took >4 hours (it was
    > > about an hour or so without this patch).
    >
    > I run the patch on 2.6.9 - it solved the problem in the common case.
    > Before the patch, I was unable to complete a "cvs checkout" of a
    > moderately large tree - would end up with undeletable directories and
    > lots of other weird things... After the patch, I can run cvs checkout.
    >
    > However, we still see the problem - so the patch does not solve this
    > completely, as you have observed as well.
    >
    > Our most common situation is that a new file gets created as a symlink
    > pointing to itself, instead of as a regular file.
    >
    > It also happens regularly, that a command (be it cvs, etags, ld or
    > something else) reports EINVAL when attempting to create/write a file.
    >
    > So, status on my side is; things still suck, but they suck less than on
    > vanilla 2.6.9

    I have a better patch than the one I gave you (attached below). If you
    send me a mail with steps to reproduce your remaining problems I'll put
    this very high on my TODO list after christmas. Btw, any chance you could
    try XFS CVS (which is at 2.6.9) + the patch below instead of plain 2.6.9,
    there have been various other fixes in the last months.


    Index: fs/xfs/xfs_vfsops.c
    ===================================================================
    RCS file: /cvs/linux-2.6-xfs/fs/xfs/xfs_vfsops.c,v
    retrieving revision 1.459
    diff -u -p -r1.459 xfs_vfsops.c
    --- fs/xfs/xfs_vfsops.c 15 Dec 2004 04:56:58 -0000 1.459
    +++ fs/xfs/xfs_vfsops.c 16 Dec 2004 20:47:22 -0000
    @@ -1581,7 +1581,7 @@ xfs_syncsub(
    }

    /*
    - * xfs_vget - called by DMAPI to get vnode from file handle
    + * xfs_vget - called by DMAPI and NFSD to get vnode from file handle
    */
    STATIC int
    xfs_vget(
    @@ -1623,7 +1623,7 @@ xfs_vget(
    return XFS_ERROR(EIO);
    }

    - if (ip->i_d.di_mode == 0 || (igen && (ip->i_d.di_gen != igen))) {
    + if (ip->i_d.di_mode == 0 || ip->i_d.di_gen != igen) {
    xfs_iput_new(ip, XFS_ILOCK_SHARED);
    *vpp = NULL;
    return XFS_ERROR(ENOENT);
    Index: fs/xfs/linux-2.6/xfs_super.c
    ===================================================================
    RCS file: /cvs/linux-2.6-xfs/fs/xfs/linux-2.6/xfs_super.c,v
    retrieving revision 1.321
    diff -u -p -r1.321 xfs_super.c
    --- fs/xfs/linux-2.6/xfs_super.c 9 Dec 2004 02:41:20 -0000 1.321
    +++ fs/xfs/linux-2.6/xfs_super.c 16 Dec 2004 20:47:23 -0000
    @@ -731,6 +731,39 @@ linvfs_get_dentry(
    return result;
    }

    +STATIC struct dentry *
    +linvfs_decode_fh(
    + struct super_block *sb,
    + __u32 *fh,
    + int fh_len,
    + int fileid_type,
    + int (*acceptable)(
    + void *context,
    + struct dentry *de),
    + void *context)
    +{
    + __u32 parent[2];
    + parent[0] = parent[1] = 0;
    +
    + if (fh_len < 2 || fileid_type > 2)
    + return NULL;
    +
    + if (fileid_type == 2 && fh_len > 2) {
    + if (fh_len == 3) {
    + printk(KERN_WARNING
    + "XFS: detected filehandle without "
    + "parent inode generation information.");
    + return ERR_PTR(-ESTALE);
    + }
    +
    + parent[0] = fh[2];
    + parent[1] = fh[3];
    + }
    +
    + return find_exported_dentry(sb, fh, parent, acceptable, context);
    +
    +}
    +
    STATIC int
    linvfs_show_options(
    struct seq_file *m,
    @@ -893,6 +926,7 @@ linvfs_get_sb(


    STATIC struct export_operations linvfs_export_ops = {
    + .decode_fh = linvfs_decode_fh,
    .get_parent = linvfs_get_parent,
    .get_dentry = linvfs_get_dentry,
    };
    Index: include/linux/fs.h
    ===================================================================
    RCS file: /cvs/linux-2.6-xfs/include/linux/fs.h,v
    retrieving revision 1.11
    diff -u -p -r1.11 fs.h
    --- include/linux/fs.h 1 Oct 2004 15:10:15 -0000 1.11
    +++ include/linux/fs.h 16 Dec 2004 20:47:25 -0000
    @@ -1115,6 +1115,10 @@ struct export_operations {

    };

    +extern struct dentry *
    +find_exported_dentry(struct super_block *sb, void *obj, void *parent,
    + int (*acceptable)(void *context, struct dentry *de),
    + void *context);

    struct file_system_type {
    const char *name;
    -
    To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
    the body of a message to majordomo@vger.kernel.org
    More majordomo info at http://vger.kernel.org/majordomo-info.html
    Please read the FAQ at http://www.tux.org/lkml/
    \
     
     \ /
      Last update: 2005-03-22 14:08    [W:2.064 / U:0.020 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site