public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Al Viro <viro@ZenIV.linux.org.uk>
To: Salah Triki <salah.triki@acm.org>
Cc: akpm@linux-foundation.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH 3/3] fs: befs: Increment i_count when inode is found
Date: Sat, 4 Jun 2016 20:32:42 +0100	[thread overview]
Message-ID: <20160604193242.GB14480@ZenIV.linux.org.uk> (raw)
In-Reply-To: <e0e40c9bc375fe5f90dcb92e1884352840780a07.1465065995.git.salah.triki@acm.org>

On Sat, Jun 04, 2016 at 07:53:21PM +0100, Salah Triki wrote:
> As VFS expects, i_count field is incremented when the named inode is found.

VFS expects no such thing.  Incidentally, you have neither bothered to
check other filesystems nor cared to look at fs/inode.c.  OK, suppose you
have found a huge multi-filesystem bug - such things happen from time to
time.  But you have not even bothered to test your conjecture; this "fix"
had never been tried or even compiled.

What actually happens is that iget_locked() acquires a reference to inode.
That reference is either dropped by iget_failed() (called by befs_iget()
in case of failure to read and initialized the sucker) or used up by
d_add() as a reference to hold dentry->d_inode.

Similar situation holds for other filesystems; they do not need to manipulate
i_count at all.

  parent reply	other threads:[~2016-06-04 19:32 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-06-04 18:53 [PATCH 1/3] fs: befs: Lookup must return error code only on real error Salah Triki
2016-06-04 18:53 ` [PATCH 2/3] fs: befs: Insert NULL inode to dentry Salah Triki
2016-06-04 18:53 ` [PATCH 3/3] fs: befs: Increment i_count when inode is found Salah Triki
2016-06-04 19:14   ` kbuild test robot
2016-06-04 19:32   ` Al Viro [this message]
2016-06-04 20:03     ` Salah Triki
2016-06-04 19:37 ` [PATCH 1/3] fs: befs: Lookup must return error code only on real error Al Viro

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=20160604193242.GB14480@ZenIV.linux.org.uk \
    --to=viro@zeniv.linux.org.uk \
    --cc=akpm@linux-foundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=salah.triki@acm.org \
    /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