lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [day] [month] [year] [list]
Message-ID: <15128.1157028077@warthog.cambridge.redhat.com>
Date:	Thu, 31 Aug 2006 13:41:17 +0100
From:	David Howells <dhowells@...hat.com>
To:	akpm@...l.org
cc:	linux-kernel@...r.kernel.org
Subject: [PATCH] CacheFiles: cachefiles_write_page() shouldn't indicate error twice


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@...hat.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);
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ