lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Wed, 4 Jan 2017 18:51:19 +0100 (CET)
From:   Fabian Frederick <fabf@...net.be>
To:     Al Viro <viro@...IV.linux.org.uk>
Cc:     Andrew Morton <akpm@...ux-foundation.org>,
        linux-kernel@...r.kernel.org, Jan Kara <jack@...e.cz>,
        linux-fsdevel@...r.kernel.org
Subject: Re: [PATCH 3/6 linux-next] fs/affs: make affs exportable



> On 03 January 2017 at 23:29 Al Viro <viro@...IV.linux.org.uk> wrote:
>
>
> On Tue, Jan 03, 2017 at 10:30:39PM +0100, Fabian Frederick wrote:
> > Add standard functions making AFFS work with NFS.
> >
> > Functions based on ext4 implementation.
> > Tested on loop device.
>
> How the hell is that supposed to work with cold dcache?  You don't have
> ->get_parent() there at all...
>
> There *IS* a reference to parent directory in those suckers - not the same
> kind as in normal unix filesystems (".." is not a directory entry there -
> it's all fake), but it's doable.  be32_to_cpu(AFFS_TAIL(sb, bh)->parent)
> would be the inumber you need, where bh is the inode block of directory.
>
> So it can be done, but not in this form.  NAK for the time being...
I tried with the following function:

static struct dentry *affs_get_parent(struct dentry *child)
{
        struct inode *parent;
        struct buffer_head *bh;

        bh = affs_bread(child->d_sb, d_inode(child)->i_ino);
        if (IS_ERR(bh))
                return ERR_CAST(bh);

        parent = affs_iget(child->d_sb,
                           be32_to_cpu(AFFS_TAIL(child->d_sb, bh)->parent));
        brelse(bh);
        if (IS_ERR(parent))
                return ERR_CAST(parent);

        return d_obtain_alias(parent);
}

but after creating a new file and echo 3 > /proc/sys/vm/drop_caches
on server, client directory requires some seconds before being updated
or gives "ls: cannot open directory '.': Stale file handle" the first time
and correct directory when trying again... Do you know how I could improve this
?

Regards,
Fabian

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ