diff options
author | Trond Myklebust <Trond.Myklebust@netapp.com> | 2012-06-05 09:35:44 -0400 |
---|---|---|
committer | Trond Myklebust <Trond.Myklebust@netapp.com> | 2012-06-05 10:00:47 -0400 |
commit | 029c53473727f21c1dd73237e8d630a6f007a2fe (patch) | |
tree | 7d7fffb8b2f0cf3ee5f3db8b844027699cabb82e /fs | |
parent | 1549210fcc17e9ae20c09ac8cd4c48a8dfd431bd (diff) |
NFSv4: Fix up decode_attr_mdsthreshold
Fix an incorrect use of 'likely()'. The FATTR4_WORD2_MDSTHRESHOLD
bit is only expected in NFSv4.1 OPEN calls, and so is actually
rather _unlikely_.
decode_attr_mdsthreshold needs to clear FATTR4_WORD2_MDSTHRESHOLD
from the attribute bitmap after it has decoded the data.
Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
Cc: Andy Adamson <andros@netapp.com>
Diffstat (limited to 'fs')
-rw-r--r-- | fs/nfs/nfs4xdr.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/fs/nfs/nfs4xdr.c b/fs/nfs/nfs4xdr.c index 9ca1428da9d9..18fae29b0301 100644 --- a/fs/nfs/nfs4xdr.c +++ b/fs/nfs/nfs4xdr.c | |||
@@ -4360,7 +4360,7 @@ static int decode_attr_mdsthreshold(struct xdr_stream *xdr, | |||
4360 | 4360 | ||
4361 | if (unlikely(bitmap[2] & (FATTR4_WORD2_MDSTHRESHOLD - 1U))) | 4361 | if (unlikely(bitmap[2] & (FATTR4_WORD2_MDSTHRESHOLD - 1U))) |
4362 | return -EIO; | 4362 | return -EIO; |
4363 | if (likely(bitmap[2] & FATTR4_WORD2_MDSTHRESHOLD)) { | 4363 | if (bitmap[2] & FATTR4_WORD2_MDSTHRESHOLD) { |
4364 | /* Did the server return an unrequested attribute? */ | 4364 | /* Did the server return an unrequested attribute? */ |
4365 | if (unlikely(res == NULL)) | 4365 | if (unlikely(res == NULL)) |
4366 | return -EREMOTEIO; | 4366 | return -EREMOTEIO; |
@@ -4376,6 +4376,7 @@ static int decode_attr_mdsthreshold(struct xdr_stream *xdr, | |||
4376 | __func__); | 4376 | __func__); |
4377 | 4377 | ||
4378 | status = decode_first_threshold_item4(xdr, res); | 4378 | status = decode_first_threshold_item4(xdr, res); |
4379 | bitmap[2] &= ~FATTR4_WORD2_MDSTHRESHOLD; | ||
4379 | } | 4380 | } |
4380 | return status; | 4381 | return status; |
4381 | out_overflow: | 4382 | out_overflow: |