Skip to content

Commit 533210f

Browse files
lrq-maxTrond Myklebust
authored andcommitted
nfs/localio: use read_seqbegin() rather than read_seqbegin_or_lock()
The usage of read_seqbegin_or_lock() in nfs_copy_boot_verifier() is wrong. "seq" is always even and thus "or_lock" has no effect. nfs_copy_boot_verifier() just copies 8 bytes and is supposed to be very rare operation, so we do not need the adaptive locking in this case. Signed-off-by: Li RongQing <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Trond Myklebust <[email protected]>
1 parent 9976523 commit 533210f

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

fs/nfs/localio.c

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -500,14 +500,13 @@ nfs_copy_boot_verifier(struct nfs_write_verifier *verifier, struct inode *inode)
500500
{
501501
struct nfs_client *clp = NFS_SERVER(inode)->nfs_client;
502502
u32 *verf = (u32 *)verifier->data;
503-
int seq = 0;
503+
unsigned int seq;
504504

505505
do {
506-
read_seqbegin_or_lock(&clp->cl_boot_lock, &seq);
506+
seq = read_seqbegin(&clp->cl_boot_lock);
507507
verf[0] = (u32)clp->cl_nfssvc_boot.tv_sec;
508508
verf[1] = (u32)clp->cl_nfssvc_boot.tv_nsec;
509-
} while (need_seqretry(&clp->cl_boot_lock, seq));
510-
done_seqretry(&clp->cl_boot_lock, seq);
509+
} while (read_seqretry(&clp->cl_boot_lock, seq));
511510
}
512511

513512
static void

0 commit comments

Comments
 (0)