All of lore.kernel.org
 help / color / mirror / Atom feed
From: Fabian Frederick <fabf@skynet.be>
To: Al Viro <viro@ZenIV.linux.org.uk>
Cc: Andrew Morton <akpm@linux-foundation.org>,
	linux-kernel@vger.kernel.org, Jan Kara <jack@suse.cz>,
	linux-fsdevel@vger.kernel.org
Subject: Re: [PATCH 3/6 linux-next] fs/affs: make affs exportable
Date: Wed, 4 Jan 2017 18:51:19 +0100 (CET)	[thread overview]
Message-ID: <241634629.1245349.1483552279270.open-xchange@webmail.nmp.proximus.be> (raw)
In-Reply-To: <20170103222906.GC1555@ZenIV.linux.org.uk>



> On 03 January 2017 at 23:29 Al Viro <viro@ZenIV.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

      parent reply	other threads:[~2017-01-04 17:53 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-01-03 21:30 [PATCH 3/6 linux-next] fs/affs: make affs exportable Fabian Frederick
2017-01-03 22:29 ` Al Viro
2017-01-04  5:53   ` Fabian Frederick
2017-01-13 17:39     ` J. Bruce Fields
2017-01-13 18:52       ` Christoph Hellwig
2017-01-13 19:03         ` J. Bruce Fields
2017-01-13 19:57           ` Al Viro
2017-01-13 20:02             ` J. Bruce Fields
2017-01-04 17:51   ` Fabian Frederick [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=241634629.1245349.1483552279270.open-xchange@webmail.nmp.proximus.be \
    --to=fabf@skynet.be \
    --cc=akpm@linux-foundation.org \
    --cc=jack@suse.cz \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=viro@ZenIV.linux.org.uk \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.