linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
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 17:04:38 +0900	[thread overview]
Message-ID: <10085.1232093078@jrobl> (raw)
In-Reply-To: <496FAFE2.8020102@linux.vnet.ibm.com>


Tyler Hicks:
> >> - remove the unnecessary d_drop()s in ecryptfs_link().
> 
> I tend to agree that they look unnecessary, but one of them was added
> for cifs (see ae56fb16) and the other two seem to be intentional (see
> 45ec4aba) as well.  I'm working on adding support for networked
> filesystems, I'll keep these d_drop()s in mind and see if we can drop
> them. :)

commit ae56fb16337c882c52806508f93ead4034004c7a
    When CIFS is the lower filesystem, the old lower dentry needs to be explicitly
    dropped from inside eCryptfs to force a revalidate.  In addition, when CIFS is
    the lower filesystem, the inode attributes need to be copied back up from the
    lower inode to the eCryptfs inode on an eCryptfs revalidate.

Even with this commit, fstat(2) still returns incorrect attributes,
doesn't it? Because fstat(2) doesn't involve revalidate.
{
	fd = open(fileA);
	link(fileA, fileB);
	fstat(fd);
}


commit 45ec4ababe999cb95f9c0cad03b2689cb0b77a2b
    Fix the use of dget/dput calls to balance out on the lower filesystem.
	:::
diff --git a/fs/ecryptfs/inode.c b/fs/ecryptfs/inode.c
index 2f2c6cf..ff4865d 100644
--- a/fs/ecryptfs/inode.c
+++ b/fs/ecryptfs/inode.c
	:::
@@ -475,8 +470,8 @@ out_lock:
 	unlock_dir(lower_dir_dentry);
 	dput(lower_new_dentry);
 	dput(lower_old_dentry);
-	if (!new_dentry->d_inode)
-		d_drop(new_dentry);
+	d_drop(new_dentry);
+	d_drop(old_dentry);
 	return rc;
 }
 
Are these two d_drop()s really intentional?
I don't understand why they are necessary after the success of link.
It might be the same to the commit ae56fb16 (see above), ie. wanting to
force re-lookup and get the latest inode attributes. (Just a guess)
Actually they are maintained in ecryptfs_link() correctly...


J. R. Okajima

  parent reply	other threads:[~2009-01-16  8:04 UTC|newest]

Thread overview: 21+ 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
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-16  8:04     ` hooanon05 [this message]
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=10085.1232093078@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 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).