projects
/
openwrt
/
staging
/
blogic.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
311324a
)
NFSv4.1: Fix wraparound issues in pnfs_seqid_is_newer()
author
Trond Myklebust
<trond.myklebust@primarydata.com>
Wed, 12 Feb 2014 14:36:59 +0000
(09:36 -0500)
committer
Trond Myklebust
<trond.myklebust@primarydata.com>
Thu, 20 Feb 2014 02:21:01 +0000
(21:21 -0500)
Subtraction of signed integers does not have well defined wraparound
semantics in the C99 standard. In order to be wraparound-safe, we
have to use unsigned subtraction, and then cast the result.
Signed-off-by: Trond Myklebust <trond.myklebust@primarydata.com>
fs/nfs/pnfs.c
patch
|
blob
|
history
diff --git
a/fs/nfs/pnfs.c
b/fs/nfs/pnfs.c
index 4755858e37a0b93f64643811f683b0de7f0d6def..6e67ada6c22cfdd391472f845ea936a7d373de71 100644
(file)
--- a/
fs/nfs/pnfs.c
+++ b/
fs/nfs/pnfs.c
@@
-662,7
+662,7
@@
pnfs_destroy_all_layouts(struct nfs_client *clp)
*/
static bool pnfs_seqid_is_newer(u32 s1, u32 s2)
{
- return (s32)
s1 - (s32)s2
> 0;
+ return (s32)
(s1 - s2)
> 0;
}
/* update lo->plh_stateid with new if is more recent */