[PATCH Version 2 1/1] NFSv4 always compare stateids in nfs4_stateid_is_current

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



From: Andy Adamson <andros@xxxxxxxxxx>

When nfs4_stateid_is_current does not compare the from the wire
stateid to the current stateid, nfs4_read/write_stateid_changed
can return a false positive resulting in a READ or WRITE looping
forever retrying a bad stateid and never triggering a stateid
recovery.

Do not check the non-boolean return from nfs4_set_rw_stateid.

Signed-off-by: Andy Adamson <andros@xxxxxxxxxx>
---
 fs/nfs/nfs4proc.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/fs/nfs/nfs4proc.c b/fs/nfs/nfs4proc.c
index 8672323..652e251 100644
--- a/fs/nfs/nfs4proc.c
+++ b/fs/nfs/nfs4proc.c
@@ -4053,8 +4053,8 @@ static bool nfs4_stateid_is_current(nfs4_stateid *stateid,
 {
 	nfs4_stateid current_stateid;
 
-	if (nfs4_set_rw_stateid(&current_stateid, ctx, l_ctx, fmode))
-		return false;
+	nfs4_stateid_copy(&current_stateid, &zero_stateid);
+	nfs4_set_rw_stateid(&current_stateid, ctx, l_ctx, fmode);
 	return nfs4_stateid_match(stateid, &current_stateid);
 }
 
-- 
1.8.3.1

--
To unsubscribe from this list: send the line "unsubscribe linux-nfs" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Linux Filesystem Development]     [Linux USB Development]     [Linux Media Development]     [Video for Linux]     [Linux NILFS]     [Linux Audio Users]     [Yosemite Info]     [Linux SCSI]

  Powered by Linux