Commit:     16317ec2e5a85884fea680d24c1b228a5602159f
Parent:     c8161f64ccdcc3ac05c7bbfebc031e7ad5ca6412
Author:     Eric Sandeen <[EMAIL PROTECTED]>
AuthorDate: Sat Dec 22 14:03:26 2007 -0800
Committer:  Linus Torvalds <[EMAIL PROTECTED]>
CommitDate: Sun Dec 23 12:54:37 2007 -0800

    ecryptfs: redo dget,mntget on dentry_open failure
    Thanks to Jeff Moyer for pointing this out.
    If the RDWR dentry_open() in ecryptfs_init_persistent_file fails,
    it will do a dput/mntput.  Need to re-take references if we
    retry as RDONLY.
    Signed-off-by: Eric Sandeen <[EMAIL PROTECTED]>
    Acked-by: Mike Halcrow <[EMAIL PROTECTED]>
    Signed-off-by: Jeff Moyer <[EMAIL PROTECTED]>
    Signed-off-by: Andrew Morton <[EMAIL PROTECTED]>
    Signed-off-by: Linus Torvalds <[EMAIL PROTECTED]>
 fs/ecryptfs/main.c |    5 ++++-
 1 files changed, 4 insertions(+), 1 deletions(-)

diff --git a/fs/ecryptfs/main.c b/fs/ecryptfs/main.c
index a277754..e5580bc 100644
--- a/fs/ecryptfs/main.c
+++ b/fs/ecryptfs/main.c
@@ -138,11 +138,14 @@ int ecryptfs_init_persistent_file(struct dentry 
                inode_info->lower_file = dentry_open(lower_dentry,
                                                     (O_RDWR | O_LARGEFILE));
-               if (IS_ERR(inode_info->lower_file))
+               if (IS_ERR(inode_info->lower_file)) {
+                       dget(lower_dentry);
+                       mntget(lower_mnt);
                        inode_info->lower_file = dentry_open(lower_dentry,
                                                              | O_LARGEFILE));
+               }
                if (IS_ERR(inode_info->lower_file)) {
                        printk(KERN_ERR "Error opening lower persistent file "
                               "for lower_dentry [0x%p] and lower_mnt [0x%p]\n",
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at

Reply via email to