From: "Theodore Ts'o" <tytso@mit.edu>
To: Al Viro <viro@ZenIV.linux.org.uk>
Cc: "zhangyi (F)" <yi.zhang@huawei.com>,
"Darrick J. Wong" <darrick.wong@oracle.com>,
Valdis.Kletnieks@vt.edu, linux-ext4@vger.kernel.org,
linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org,
adilger.kernel@dilger.ca, jack@suse.cz
Subject: Re: [RFC PATCH] ext4: increase the protection of drop nlink and ext4 inode destroy
Date: Fri, 13 Jan 2017 09:26:56 -0500 [thread overview]
Message-ID: <20170113142656.xmrtuimxfwgxt522@thunk.org> (raw)
In-Reply-To: <20170113034219.GG1555@ZenIV.linux.org.uk>
On Fri, Jan 13, 2017 at 03:42:19AM +0000, Al Viro wrote:
> On Thu, Jan 12, 2017 at 12:03:28PM -0500, Theodore Ts'o wrote:
> > On Thu, Jan 12, 2017 at 04:00:16PM +0800, zhangyi (F) wrote:
> > >
> > > At the same time, I think other file systems may have the same problem, do
> > > you think we should put these detections on the VFS layer? Thus other file
> > > systems no need to do the same things, but the disadvantage is that we can
> > > not call ext4_error to report ext4 inconsistency.
> >
> > There are file systems which don't have inodes per-se where the
> > i_nlinks could be a something which is simulated by the file system.
> > So it's not *necessarily* an on-disk inconsistency.
> >
> > We'll have to see if Al and other file system developers are
> > agreeable, but one thing that we could do is to do the detection in
> > the VFS layer (which it is actually easier to do), and if they find an
> > issue, they can just pass a report via a callback function found in
> > the struct_operations structure. If there isn't such a function
> > defined, or the function returns 0, the VFS could just do nothing; if
> > it returns an error code, then that would get reflected back up to
> > userspace, plus whatever other action the file system sees fit to do.
>
> Detection of what? Zero ->i_nlink on inode of dentry that passes e.g.
> may_delete()?
Or other impossible cases where there is a valid dentry pointing at an
inode with zero i_nlink. I am fairly sure this should **never**
happen in the case of unlink(2), rmdir(2), or by the time we call
file_ops->open(), and if it does, it indicates that the underlying
on-disk file system (at least for ext4) is corrupt.
Am I missing a case? And do you have an opinion about whether we
should be trying to do this check at the VFS layer versus inside ext4?
Thanks,
- Ted
next prev parent reply other threads:[~2017-01-13 14:27 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-12-26 12:34 yi zhang
2016-12-26 18:32 ` Andreas Dilger
2016-12-31 22:59 ` Valdis.Kletnieks
2017-01-04 8:29 ` zhangyi (F)
2017-01-04 21:54 ` Darrick J. Wong
2017-01-04 22:00 ` Andreas Dilger
2017-01-04 23:35 ` Theodore Ts'o
2017-01-05 7:24 ` zhangyi (F)
2017-01-05 17:38 ` Darrick J. Wong
2017-01-11 9:07 ` zhangyi (F)
2017-01-11 15:34 ` Theodore Ts'o
2017-01-12 8:00 ` zhangyi (F)
2017-01-12 17:03 ` Theodore Ts'o
2017-01-13 3:42 ` Al Viro
2017-01-13 14:26 ` Theodore Ts'o [this message]
2017-01-16 3:24 ` zhangyi (F)
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=20170113142656.xmrtuimxfwgxt522@thunk.org \
--to=tytso@mit.edu \
--cc=Valdis.Kletnieks@vt.edu \
--cc=adilger.kernel@dilger.ca \
--cc=darrick.wong@oracle.com \
--cc=jack@suse.cz \
--cc=linux-ext4@vger.kernel.org \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=viro@ZenIV.linux.org.uk \
--cc=yi.zhang@huawei.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
Powered by JetHome