mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: David Howells <dhowells@redhat.com>
To: akpm@osdl.org
Cc: linux-kernel@vger.kernel.org
Subject: [PATCH] CacheFiles: cachefiles_write_page() shouldn't indicate error twice
Date: Thu, 31 Aug 2006 13:41:17 +0100	[thread overview]
Message-ID: <15128.1157028077@warthog.cambridge.redhat.com> (raw)


Prevent cachefiles_write_page() from issuing an error twice, instead forgoing
the callback if it can return the error directly.

Previously, the netfs was being informed of the error twice, once by the error
being passed to the netfs callback, and a second time when fscache_write_page()
returned to the netfs.

In NFS's case, this meant it attempted to do error handling twice, including
clearing PG_fs_misc twice...

Signed-Off-By: David Howells <dhowells@redhat.com>
---

 fs/cachefiles/cf-interface.c |    6 ++++--
 1 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/fs/cachefiles/cf-interface.c b/fs/cachefiles/cf-interface.c
index 6be3d98..4c0eb31 100644
--- a/fs/cachefiles/cf-interface.c
+++ b/fs/cachefiles/cf-interface.c
@@ -1247,9 +1247,11 @@ #else
 						"write page to backing file"
 						" failed");
 		ret = -ENOBUFS;
+	} else {
+		/* only invoke the callback if successful, we return the error
+		 * directly otherwise */
+		end_io_func(page, context, ret);
 	}
-
-	end_io_func(page, context, ret);
 #endif
 
 	_leave(" = %d", ret);

                 reply	other threads:[~2006-08-31 12:41 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=15128.1157028077@warthog.cambridge.redhat.com \
    --to=dhowells@redhat.com \
    --cc=akpm@osdl.org \
    --cc=linux-kernel@vger.kernel.org \
    /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

Powered by JetHome