]> git.ipfire.org Git - people/arne_f/kernel.git/commitdiff
cifs: smb2_clone_range() - exit on unhandled error
authorSachin Prabhu <sprabhu@redhat.com>
Wed, 4 Feb 2015 13:10:26 +0000 (13:10 +0000)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sun, 19 Apr 2015 08:11:08 +0000 (10:11 +0200)
commit 2477bc58d49edb1c0baf59df7dc093dce682af2b upstream.

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.

Signed-off-by: Sachin Prabhu <sprabhu@redhat.com>
Signed-off-by: Steve French <steve.french@primarydata.com>
Signed-off-by: Steve French <smfrench@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
fs/cifs/smb2ops.c

index 34a17d425be611c2675b6709d3537de7d8f1ed25..30f3eb5bc022869f0192379abf3fb83bd9f3b4bb 100644 (file)
@@ -630,7 +630,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: