mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] CacheFiles: cachefiles_write_page() shouldn't indicate error twice
@ 2006-08-31 12:41 David Howells
  0 siblings, 0 replies; only message in thread
From: David Howells @ 2006-08-31 12:41 UTC (permalink / raw)
  To: akpm; +Cc: linux-kernel


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);

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2006-08-31 12:41 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-08-31 12:41 [PATCH] CacheFiles: cachefiles_write_page() shouldn't indicate error twice David Howells

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