nfsd: Remove macro LOFF_OVERFLOW

This change “nfsd: Remove macro LOFF_OVERFLOW” in Linux kernel is authored by Kinglong Mee <kinglongmee [at] gmail.com> on Mon Jul 13 17:34:19 2015 +0800.

nfsd: Remove macro LOFF_OVERFLOW

Signed-off-by: Kinglong Mee <kinglongmee@gmail.com>
Signed-off-by: J. Bruce Fields <bfields@redhat.com>

This Linux change may have been applied to various maintained Linux releases and you can find Linux releases including commit e796931.

There are 7 lines of Linux source code added/deleted in this change. Code changes to Linux kernel are as follows.

 fs/nfsd/nfs4state.c | 7 ++-----
 1 file changed, 2 insertions(+), 5 deletions(-)

diff --git a/fs/nfsd/nfs4state.c b/fs/nfsd/nfs4state.c
index 433355d..74eb8c2 100644
--- a/fs/nfsd/nfs4state.c
+++ b/fs/nfsd/nfs4state.c
@@ -5045,9 +5045,6 @@ static void nfsd4_close_open_stateid(struct nfs4_ol_stateid *s)
 	return status;
 }
 
-
-#define LOFF_OVERFLOW(start, len)      ((u64)(len) > ~(u64)(start))
-
 static inline u64
 end_offset(u64 start, u64 len)
 {
@@ -5299,8 +5296,8 @@ static void nfs4_free_lockowner(struct nfs4_stateowner *sop)
 static int
 check_lock_length(u64 offset, u64 length)
 {
-	return ((length == 0)  || ((length != NFS4_MAX_UINT64) &&
-	     LOFF_OVERFLOW(offset, length)));
+	return ((length == 0) || ((length != NFS4_MAX_UINT64) &&
+		(length > ~offset)));
 }
 
 static void get_lock_access(struct nfs4_ol_stateid *lock_stp, u32 access)

The commit for this change in Linux stable tree is e796931 (patch).

Leave a Reply

Your email address will not be published. Required fields are marked *