All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jeff Layton <jlayton@redhat.com>
To: "Yan, Zheng" <zyan@redhat.com>, ceph-devel@vger.kernel.org
Subject: Re: [PATCH] ceph: avoid accessing freeing inode in ceph_check_delayed_caps()
Date: Tue, 27 Jun 2017 10:23:44 -0400	[thread overview]
Message-ID: <1498573424.4830.1.camel@redhat.com> (raw)
In-Reply-To: <20170627134344.80072-1-zyan@redhat.com>

On Tue, 2017-06-27 at 21:43 +0800, Yan, Zheng wrote:
> Signed-off-by: "Yan, Zheng" <zyan@redhat.com>
> ---
>  fs/ceph/caps.c | 11 +++++++++--
>  1 file changed, 9 insertions(+), 2 deletions(-)
> 
> diff --git a/fs/ceph/caps.c b/fs/ceph/caps.c
> index f555245..7007ae2 100644
> --- a/fs/ceph/caps.c
> +++ b/fs/ceph/caps.c
> @@ -3809,6 +3809,7 @@ void ceph_handle_caps(struct ceph_mds_session *session,
>   */
>  void ceph_check_delayed_caps(struct ceph_mds_client *mdsc)
>  {
> +	struct inode *inode;
>  	struct ceph_inode_info *ci;
>  	int flags = CHECK_CAPS_NODELAY;
>  
> @@ -3824,9 +3825,15 @@ void ceph_check_delayed_caps(struct ceph_mds_client *mdsc)
>  		    time_before(jiffies, ci->i_hold_caps_max))
>  			break;
>  		list_del_init(&ci->i_cap_delay_list);
> +
> +		inode = igrab(&ci->vfs_inode);
>  		spin_unlock(&mdsc->cap_delay_lock);
> -		dout("check_delayed_caps on %p\n", &ci->vfs_inode);
> -		ceph_check_caps(ci, flags, NULL);
> +
> +		if (inode) {
> +			dout("check_delayed_caps on %p\n", inode);
> +			ceph_check_caps(ci, flags, NULL);
> +			iput(inode);
> +		}
>  	}
>  	spin_unlock(&mdsc->cap_delay_lock);
>  }

Reviewed-by: Jeff Layton <jlayton@redhat.com>

      reply	other threads:[~2017-06-27 14:24 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-06-27 13:43 [PATCH] ceph: avoid accessing freeing inode in ceph_check_delayed_caps() Yan, Zheng
2017-06-27 14:23 ` Jeff Layton [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=1498573424.4830.1.camel@redhat.com \
    --to=jlayton@redhat.com \
    --cc=ceph-devel@vger.kernel.org \
    --cc=zyan@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 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.