Skip to content

Commit 90e12a3

Browse files
olgakorn1amschuma-ntap
authored andcommitted
NFSv4 remove zero number of fs_locations entries error check
Remove the check for the zero length fs_locations reply in the xdr decoding, and instead check for that in the migration code. Signed-off-by: Olga Kornievskaia <[email protected]> Signed-off-by: Anna Schumaker <[email protected]>
1 parent 1751fc1 commit 90e12a3

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

fs/nfs/nfs4state.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2106,6 +2106,9 @@ static int nfs4_try_migration(struct nfs_server *server, const struct cred *cred
21062106
}
21072107

21082108
result = -NFS4ERR_NXIO;
2109+
if (!locations->nlocations)
2110+
goto out;
2111+
21092112
if (!(locations->fattr.valid & NFS_ATTR_FATTR_V4_LOCATIONS)) {
21102113
dprintk("<-- %s: No fs_locations data, migration skipped\n",
21112114
__func__);

fs/nfs/nfs4xdr.c

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3732,8 +3732,6 @@ static int decode_attr_fs_locations(struct xdr_stream *xdr, uint32_t *bitmap, st
37323732
if (unlikely(!p))
37333733
goto out_eio;
37343734
n = be32_to_cpup(p);
3735-
if (n <= 0)
3736-
goto out_eio;
37373735
for (res->nlocations = 0; res->nlocations < n; res->nlocations++) {
37383736
u32 m;
37393737
struct nfs4_fs_location *loc;

0 commit comments

Comments
 (0)