All of lore.kernel.org
 help / color / mirror / Atom feed
From: NeilBrown <neilb@suse.de>
To: Milosz Tanski <milosz@adfin.com>
Cc: linux-cachefs@redhat.com, linux-fsdevel@vger.kernel.org,
	linux-kernel@vger.kernel.org, David Howells <dhowells@redhat.com>
Subject: Re: [PATCH 2/3] FS-Cache: Reduce cookie ref count if submit fails.
Date: Thu, 14 Aug 2014 14:23:48 +1000	[thread overview]
Message-ID: <20140814142348.161b2eca@notabene.brown> (raw)
In-Reply-To: <53EB992D.6040608@adfin.com>

[-- Attachment #1: Type: text/plain, Size: 1090 bytes --]

On Wed, 13 Aug 2014 12:58:21 -0400 Milosz Tanski <milosz@adfin.com> wrote:

> I've been seeing issues with disposing cookies under vma pressure. The symptom
> is that the refcount gets out of sync. In this case we fail to decrement the
> refcount if submit fails. I found this while auditing the error in and around
> cookie operations.
> 
> Signed-off-by: Milosz Tanski <milosz@adfin.com>
> ---
>  fs/fscache/object.c |    2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/fs/fscache/object.c b/fs/fscache/object.c
> index d3b4539..e1eb1f5 100644
> --- a/fs/fscache/object.c
> +++ b/fs/fscache/object.c
> @@ -982,6 +982,8 @@ nomem:
>  submit_op_failed:
>  	clear_bit(FSCACHE_OBJECT_IS_LIVE, &object->flags);
>  	spin_unlock(&cookie->lock);
> +	if (__fscache_unuse_cookie(cookie))
> +		__fscache_wake_unused_cookie(cookie);
>  	kfree(op);
>  	_leave(" [EIO]");
>  	return transit_to(KILL_OBJECT);

Should this simple by
  +     fscache_unuse_cookie(cookie);

it does both the "unuse" and the "wake".

Otherwise they all look good to me.

NeilBrown

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 828 bytes --]

WARNING: multiple messages have this Message-ID (diff)
From: NeilBrown <neilb@suse.de>
To: Milosz Tanski <milosz@adfin.com>
Cc: linux-fsdevel@vger.kernel.org, linux-cachefs@redhat.com,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH 2/3] FS-Cache: Reduce cookie ref count if submit fails.
Date: Thu, 14 Aug 2014 14:23:48 +1000	[thread overview]
Message-ID: <20140814142348.161b2eca@notabene.brown> (raw)
In-Reply-To: <53EB992D.6040608@adfin.com>


[-- Attachment #1.1: Type: text/plain, Size: 1090 bytes --]

On Wed, 13 Aug 2014 12:58:21 -0400 Milosz Tanski <milosz@adfin.com> wrote:

> I've been seeing issues with disposing cookies under vma pressure. The symptom
> is that the refcount gets out of sync. In this case we fail to decrement the
> refcount if submit fails. I found this while auditing the error in and around
> cookie operations.
> 
> Signed-off-by: Milosz Tanski <milosz@adfin.com>
> ---
>  fs/fscache/object.c |    2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/fs/fscache/object.c b/fs/fscache/object.c
> index d3b4539..e1eb1f5 100644
> --- a/fs/fscache/object.c
> +++ b/fs/fscache/object.c
> @@ -982,6 +982,8 @@ nomem:
>  submit_op_failed:
>  	clear_bit(FSCACHE_OBJECT_IS_LIVE, &object->flags);
>  	spin_unlock(&cookie->lock);
> +	if (__fscache_unuse_cookie(cookie))
> +		__fscache_wake_unused_cookie(cookie);
>  	kfree(op);
>  	_leave(" [EIO]");
>  	return transit_to(KILL_OBJECT);

Should this simple by
  +     fscache_unuse_cookie(cookie);

it does both the "unuse" and the "wake".

Otherwise they all look good to me.

NeilBrown

[-- Attachment #1.2: signature.asc --]
[-- Type: application/pgp-signature, Size: 828 bytes --]

[-- Attachment #2: Type: text/plain, Size: 0 bytes --]



  reply	other threads:[~2014-08-14  4:24 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <cover.1407948737.git.milosz@adfin.com>
2014-08-13 16:58 ` [PATCH 1/3] FS-Cache: Timeout for releasepage() Milosz Tanski
2014-08-13 16:58 ` [PATCH 2/3] FS-Cache: Reduce cookie ref count if submit fails Milosz Tanski
2014-08-13 16:58   ` Milosz Tanski
2014-08-14  4:23   ` NeilBrown [this message]
2014-08-14  4:23     ` NeilBrown
2014-08-13 16:58 ` [PATCH 3/3] FS-Cache: refcount becomes corrupt under vma pressure Milosz Tanski
2014-08-13 16:58   ` Milosz Tanski
2014-08-27 14:29 ` [PATCH 1/3] FS-Cache: Timeout for releasepage() David Howells
2014-08-27 14:29   ` David Howells
2014-08-27 14:31 ` [PATCH 2/3] FS-Cache: Reduce cookie ref count if submit fails David Howells
2014-08-27 14:31   ` David Howells
2014-09-04 16:00   ` Milosz Tanski
2014-09-08 15:55     ` Milosz Tanski
2014-09-17 20:23     ` David Howells
2014-09-17 20:23       ` David Howells
2014-09-17 20:24       ` Milosz Tanski
     [not found] <cover.1406043029.git.milosz@adfin.com>
2014-07-22 15:50 ` Milosz Tanski
2014-07-29 15:37 ` David Howells
2014-07-29 15:37   ` David Howells
2014-08-06 15:21   ` Milosz Tanski
2014-08-11 18:37     ` Milosz Tanski
2014-08-12 12:47   ` David Howells
2014-08-12 12:47     ` David Howells

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=20140814142348.161b2eca@notabene.brown \
    --to=neilb@suse.de \
    --cc=dhowells@redhat.com \
    --cc=linux-cachefs@redhat.com \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=milosz@adfin.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.