mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Michael Halcrow <mike@halcrow.us>
To: Eric Sandeen <sandeen@redhat.com>
Cc: Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
	Andrew Morton <akpm@osdl.org>,
	Michael Halcrow <mhalcrow@us.ibm.com>,
	Jeff Moyer <jmoyer@redhat.com>
Subject: Re: [PATCH] ecryptfs: redo dget,mntget on dentry_open failure
Date: Wed, 19 Dec 2007 12:14:17 -0600	[thread overview]
Message-ID: <20071219181417.GP13486@halcrow.us> (raw)
In-Reply-To: <47695621.6040709@redhat.com>

On Wed, Dec 19, 2007 at 11:34:25AM -0600, Eric Sandeen wrote:
> 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 <sandeen@redhat.com>

Acked-by: Mike Halcrow <mhalcrow@us.ibm.com>

> ---
> 
> Index: linux-2.6.24-rc3/fs/ecryptfs/main.c
> ===================================================================
> --- linux-2.6.24-rc3.orig/fs/ecryptfs/main.c
> +++ linux-2.6.24-rc3/fs/ecryptfs/main.c
> @@ -138,11 +138,14 @@ int ecryptfs_init_persistent_file(struct
>  		inode_info->lower_file = dentry_open(lower_dentry,
>  						     lower_mnt,
>  						     (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,
>  							     lower_mnt,
>  							     (O_RDONLY
>  							      | 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",
> 

      parent reply	other threads:[~2007-12-19 18:23 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-12-19 17:34 Eric Sandeen
2007-12-19 17:42 ` Jeff Moyer
2007-12-19 18:14 ` Michael Halcrow [this message]

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=20071219181417.GP13486@halcrow.us \
    --to=mike@halcrow.us \
    --cc=akpm@osdl.org \
    --cc=jmoyer@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mhalcrow@us.ibm.com \
    --cc=sandeen@redhat.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

all inboxes | Powered by JetHome®