Patch "NFSv4.1/flexfiles: Fix a protocol error in layoutreturn" has been added to the 4.2-stable tree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This is a note to let you know that I've just added the patch titled

    NFSv4.1/flexfiles: Fix a protocol error in layoutreturn

to the 4.2-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:
     nfsv4.1-flexfiles-fix-a-protocol-error-in-layoutreturn.patch
and it can be found in the queue-4.2 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree,
please let <stable@xxxxxxxxxxxxxxx> know about it.


>From d13549074cf066d6d5bb29903d044beffea342d3 Mon Sep 17 00:00:00 2001
From: Trond Myklebust <trond.myklebust@xxxxxxxxxxxxxxx>
Date: Thu, 27 Aug 2015 20:37:39 -0400
Subject: NFSv4.1/flexfiles: Fix a protocol error in layoutreturn

From: Trond Myklebust <trond.myklebust@xxxxxxxxxxxxxxx>

commit d13549074cf066d6d5bb29903d044beffea342d3 upstream.

According to the flexfiles protocol, the layoutreturn should specify an
array of errors in the following format:

struct ff_ioerr4 {
	offset4        ffie_offset;
	length4        ffie_length;
	stateid4       ffie_stateid;
	device_error4  ffie_errors<>;
};

This patch fixes up the code to ensure that our ffie_errors is indeed
encoded as an array (albeit with only a single entry).

Reported-by: Tom Haynes <thomas.haynes@xxxxxxxxxxxxxxx>
Signed-off-by: Trond Myklebust <trond.myklebust@xxxxxxxxxxxxxxx>
Signed-off-by: Greg Kroah-Hartman <gregkh@xxxxxxxxxxxxxxxxxxx>

---
 fs/nfs/flexfilelayout/flexfilelayoutdev.c |    7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

--- a/fs/nfs/flexfilelayout/flexfilelayoutdev.c
+++ b/fs/nfs/flexfilelayout/flexfilelayoutdev.c
@@ -500,16 +500,19 @@ int ff_layout_encode_ds_ioerr(struct nfs
 					   range->offset, range->length))
 			continue;
 		/* offset(8) + length(8) + stateid(NFS4_STATEID_SIZE)
-		 * + deviceid(NFS4_DEVICEID4_SIZE) + status(4) + opnum(4)
+		 * + array length + deviceid(NFS4_DEVICEID4_SIZE)
+		 * + status(4) + opnum(4)
 		 */
 		p = xdr_reserve_space(xdr,
-				24 + NFS4_STATEID_SIZE + NFS4_DEVICEID4_SIZE);
+				28 + NFS4_STATEID_SIZE + NFS4_DEVICEID4_SIZE);
 		if (unlikely(!p))
 			return -ENOBUFS;
 		p = xdr_encode_hyper(p, err->offset);
 		p = xdr_encode_hyper(p, err->length);
 		p = xdr_encode_opaque_fixed(p, &err->stateid,
 					    NFS4_STATEID_SIZE);
+		/* Encode 1 error */
+		*p++ = cpu_to_be32(1);
 		p = xdr_encode_opaque_fixed(p, &err->deviceid,
 					    NFS4_DEVICEID4_SIZE);
 		*p++ = cpu_to_be32(err->status);


Patches currently in stable-queue which might be from trond.myklebust@xxxxxxxxxxxxxxx are

queue-4.2/nfs41-flexfiles-zero-out-ds-write-wcc.patch
queue-4.2/nfs-nfs_set_pgio_error-sometimes-misses-errors.patch
queue-4.2/nfs-fix-a-null-pointer-dereference-of-migration-recovery-ops-for-v4.2-client.patch
queue-4.2/sunrpc-xs_reset_transport-must-mark-the-connection-as-disconnected.patch
queue-4.2/nfs-fix-truncated-client-owner-id-without-proto-type.patch
queue-4.2/nfs-don-t-let-the-ctime-override-attribute-barriers.patch
queue-4.2/sunrpc-fix-a-thinko-in-xs_connect.patch
queue-4.2/nfsv4-don-t-set-setattr-for-o_rdonly-o_excl.patch
queue-4.2/nfs41-flexfiles-update-inode-after-write-finishes.patch
queue-4.2/nfsv4.1-pnfs-fix-borken-function-_same_data_server_addrs_locked.patch
queue-4.2/nfsv4-force-a-post-op-attribute-update-when-holding-a-delegation.patch
queue-4.2/nfsv4.1-pnfs-fix-atomicity-of-commit-list-updates.patch
queue-4.2/nfsv4.1-flexfiles-fix-a-protocol-error-in-layoutreturn.patch
queue-4.2/revert-nfsv4-remove-incorrect-check-in-can_open_delegated.patch
queue-4.2/nfsv4.1-fix-a-protocol-issue-with-close-stateids.patch
--
To unsubscribe from this list: send the line "unsubscribe stable" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Linux Kernel]     [Kernel Development Newbies]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite Hiking]     [Linux Kernel]     [Linux SCSI]