From: Sachin Prabhu Date: Wed, 4 Feb 2015 13:10:26 +0000 (+0000) Subject: cifs: smb2_clone_range() - exit on unhandled error X-Git-Tag: v3.18.13~58 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=6bb88677e8e9a47b643ae03959f3a216d22432ac;p=thirdparty%2Fkernel%2Fstable.git cifs: smb2_clone_range() - exit on unhandled error [ Upstream commit 2477bc58d49edb1c0baf59df7dc093dce682af2b ] While attempting to clone a file on a samba server, we receive a STATUS_INVALID_DEVICE_REQUEST. This is mapped to -EOPNOTSUPP which isn't handled in smb2_clone_range(). We end up looping in the while loop making same call to the samba server over and over again. The proposed fix is to exit and return the error value when encountered with an unhandled error. Cc: Signed-off-by: Sachin Prabhu Signed-off-by: Steve French Signed-off-by: Steve French Signed-off-by: Sasha Levin --- diff --git a/fs/cifs/smb2ops.c b/fs/cifs/smb2ops.c index c5f521bcdee24..cc93a7ffe8e4a 100644 --- a/fs/cifs/smb2ops.c +++ b/fs/cifs/smb2ops.c @@ -683,7 +683,8 @@ smb2_clone_range(const unsigned int xid, /* No need to change MaxChunks since already set to 1 */ chunk_sizes_updated = true; - } + } else + goto cchunk_out; } cchunk_out: