From: Al Viro <viro@ZenIV.linux.org.uk>
To: Marco Stornelli <marco.stornelli@gmail.com>
Cc: Linux FS Devel <linux-fsdevel@vger.kernel.org>,
	linux-kernel@vger.kernel.org,
	Vladimir Davydov <vdavydov@parallels.com>
Subject: Re: [PATCH 08/19] pramfs: file operations for dirs
Date: Sat, 7 Sep 2013 16:01:19 +0100	[thread overview]
Message-ID: <20130907150119.GB13318@ZenIV.linux.org.uk> (raw)
In-Reply-To: <522AE24C.6060903@gmail.com>
On Sat, Sep 07, 2013 at 10:22:36AM +0200, Marco Stornelli wrote:
> +int pram_add_link(struct dentry *dentry, struct inode *inode)
> +{
> +	struct inode *dir = dentry->d_parent->d_inode;
> +	struct pram_inode *pidir, *pi, *pitail = NULL;
> +	u64 tail_ino, prev_ino;
> +
> +	const char *name = dentry->d_name.name;
> +
> +	int namelen = min_t(unsigned int, dentry->d_name.len, PRAM_NAME_LEN);
Whatever the hell for?  Your ->lookup() rejects dentries with names longer
than PRAM_NAME_LEN with an error, so they won't reach this function at all.
> +int pram_remove_link(struct inode *inode)
Umm...  That's called on rename (for old one) *and* inode eviction when link
count goes to zero.  What's the point of keeping unlinked ones (unlink/rmdir/
rename victims) on those lists?  Sure, you skip them on lookups, but why
delay link removal until eviction?  You pay for that with extra locking,
BTW - if not for that, you wouldn't need your i_link_mutex at all.
> +	pi = pram_get_inode(sb, inode->i_ino);
> +
> +	switch ((u32)file->f_pos) {
> +	case 0:
> +		ret = dir_emit_dot(file, ctx);
> +		ctx->pos = 1;
> +		return ret;
Really?  So on the first call of ->iterate() you just generate one
entry and don't even try to produce more?  And it looks like the
rest is no nicer...
next prev parent reply	other threads:[~2013-09-07 15:01 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-09-07  8:22 [PATCH 08/19] pramfs: file operations for dirs Marco Stornelli
2013-09-07 15:01 ` Al Viro [this message]
2013-09-07 16:14   ` Marco Stornelli
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=20130907150119.GB13318@ZenIV.linux.org.uk \
    --to=viro@zeniv.linux.org.uk \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=marco.stornelli@gmail.com \
    --cc=vdavydov@parallels.com \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).