This is a note to let you know that I've just added the patch titled
NFS: Don't use SetPageError in the NFS writeback code
to the 3.7-stable tree which can be found at:
http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary
The filename of the patch is:
nfs-don-t-use-setpageerror-in-the-nfs-writeback-code.patch
and it can be found in the queue-3.7 subdirectory.
If you, or anyone else, feels it should not be added to the stable tree,
please let <[email protected]> know about it.
>From ada8e20d044c0fa5610e504ce6fb4578ebd3edd9 Mon Sep 17 00:00:00 2001
From: Trond Myklebust <[email protected]>
Date: Sat, 15 Dec 2012 17:12:14 -0500
Subject: NFS: Don't use SetPageError in the NFS writeback code
From: Trond Myklebust <[email protected]>
commit ada8e20d044c0fa5610e504ce6fb4578ebd3edd9 upstream.
The writeback code is already capable of passing errors back to user space
by means of the open_context->error. In the case of ENOSPC, Neil Brown
is reporting seeing 2 errors being returned.
Neil writes:
"e.g. if /mnt2/ if an nfs mounted filesystem that has no space then
strace dd if=/dev/zero conv=fsync >> /mnt2/afile count=1
reported Input/output error and the relevant parts of the strace output are:
write(1, "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"...,
512) = 512
fsync(1) = -1 EIO (Input/output error)
close(1) = -1 ENOSPC (No space left on device)"
Neil then shows that the duplication of error messages appears to be due to
the use of the PageError() mechanism, which causes filemap_fdatawait_range
to return the extra EIO. The regression was introduced by
commit 7b281ee026552f10862b617a2a51acf49c829554 (NFS: fsync() must exit
with an error if page writeback failed).
Fix this by removing the call to SetPageError(), and just relying on
open_context->error reporting the ENOSPC back to fsync().
Reported-by: Neil Brown <[email protected]>
Tested-by: Neil Brown <[email protected]>
Signed-off-by: Trond Myklebust <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
---
fs/nfs/write.c | 1 -
1 file changed, 1 deletion(-)
--- a/fs/nfs/write.c
+++ b/fs/nfs/write.c
@@ -202,7 +202,6 @@ out:
/* A writeback failed: mark the page as bad, and invalidate the page cache */
static void nfs_set_pageerror(struct page *page)
{
- SetPageError(page);
nfs_zap_mapping(page_file_mapping(page)->host, page_file_mapping(page));
}
Patches currently in stable-queue which might be from
[email protected] are
queue-3.7/nfs-fix-access-to-suid-sgid-executables.patch
queue-3.7/nfs-ensure-that-we-free-the-rpc_task-after-read-and-write-cleanups-are-done.patch
queue-3.7/nfs-avoid-dereferencing-null-pointer-in-initiate_bulk_draining.patch
queue-3.7/pnfs-increase-the-refcount-when-layoutget-fails-the-first-time.patch
queue-3.7/nfs-fix-null-checking-in-nfs_get_option_str.patch
queue-3.7/nfs-add-sequence_priviliged_ops-for-nfs4_proc_sequence.patch
queue-3.7/nfs-don-t-extend-writes-to-cover-entire-page-if-pagecache-is-invalid.patch
queue-3.7/nfs-don-t-zero-out-the-rest-of-the-page-if-we-hit-the-eof-on-a-dio-read.patch
queue-3.7/nfs-don-t-use-setpageerror-in-the-nfs-writeback-code.patch
queue-3.7/nfs-fix-calls-to-drop_nlink.patch
queue-3.7/nfsv4-check-for-buffer-length-in-__nfs4_get_acl_uncached.patch
queue-3.7/nfs-avoid-null-dereference-in-nfs_destroy_server.patch
--
To unsubscribe from this list: send the line "unsubscribe stable" in
the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html