From: hooanon05@yahoo.co.jp
To: Tyler Hicks <tyhicks@linux.vnet.ibm.com>
Cc: Dave Kleikamp <shaggy@linux.vnet.ibm.com>,
linux-fsdevel <linux-fsdevel@vger.kernel.org>,
linux-kernel@vger.kernel.org, ecryptfs-devel@lists.launchpad.net
Subject: Re: [Ecryptfs-devel] [PATCH] ecryptfs: some inode attrs, and a question
Date: Fri, 16 Jan 2009 16:36:06 +0900 [thread overview]
Message-ID: <9829.1232091366@jrobl> (raw)
In-Reply-To: <496FAFE2.8020102@linux.vnet.ibm.com>
Tyler Hicks:
> >> - The ecryptfs inode holds a reference to the lower inode, but doesn't=
>
> >> increment the reference counter. When a user sets inotify to the
> >> ecryptfs inode, it may live without the corresponding dentry. In thi=
> s
> >> case the referecen to the lower inode may be broken.
> >> This patch maintains the reference of the lower inode.
>
> Is this a problem that you've experienced or something you found during
> a code review? How can it be reproduced? We get a reference to the
> lower inode with the igrab() in ecryptfs_interpose() and put it back in
> ecryptfs_clear_inode(). This part of the patch seems to just increment
> the ref counts again.
I could confirm the igrab() in ecryptfs_interpose(), so touching i_count
in my patch are unnecessary.
Although I don't remember the detail, I have experienced a trouble (and
I wrote the patch). If I can recall the problem and find the
reproducible way, I will write again.
One thing I remember is, vfs_unlink() in ecryptfs_unlink() made
lower_dentry->d_inode NULL unexpectedly.
I guess the problem was related to the i_count including my fixes for
ecryptfs_unlink() and ecryptfs_link(). Current ecryptfs_link() calls
ecryptfs_interpose(), but obviously the inode is not I_NEW and the
incremented i_count is decremented again (finally unchanged).
The current unnecessary d_drop()s may help hiding the problem, but I am
not sure.
> I see that do_unlinkat does this, but since eCryptfs already holds these
> references, I don't think that we need to do it here.
Whether the counter is one or more is more important than to hold or not
to hold simply.
> This part of the patch is valid, nice catch!
I am happy that my patch was not totally useless. :-)
And one more suggestion. It is better to set f_type in
ecryptfs_statfs(), and move ECRYPTFS_SUPER_MAGIC under include/linux/,
in order to be usable from userspace (or other modules).
J. R. Okajima
next prev parent reply other threads:[~2009-01-16 7:36 UTC|newest]
Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-01-13 6:20 [PATCH] ecryptfs: some inode attrs, and a question hooanon05
2009-01-13 13:17 ` Dave Kleikamp
2009-01-15 21:51 ` [Ecryptfs-devel] " Tyler Hicks
2009-01-16 7:36 ` hooanon05 [this message]
2009-01-16 16:59 ` Dave Kleikamp
2009-01-17 6:03 ` hooanon05
2009-01-17 16:42 ` Dave Kleikamp
2009-01-17 17:42 ` hooanon05
2009-01-17 18:11 ` Dave Kleikamp
2009-01-19 2:17 ` hooanon05
2009-01-19 15:01 ` Dave Kleikamp
2009-01-19 15:25 ` hooanon05
2009-01-19 15:30 ` Dave Kleikamp
2009-01-19 15:35 ` hooanon05
2009-01-19 2:15 ` hooanon05
2009-01-19 2:15 ` hooanon05
2009-01-16 8:04 ` hooanon05
2009-01-15 23:03 ` Andrew Morton
2009-01-15 23:39 ` [Ecryptfs-devel] " Tyler Hicks
2009-01-15 23:51 ` Andrew Morton
2009-01-16 7:42 ` hooanon05
2009-01-16 7:53 ` Andrew Morton
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=9829.1232091366@jrobl \
--to=hooanon05@yahoo.co.jp \
--cc=ecryptfs-devel@lists.launchpad.net \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=shaggy@linux.vnet.ibm.com \
--cc=tyhicks@linux.vnet.ibm.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 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.