]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
NFSD: use correct reservation type in nfsd4_scsi_fence_client
authorDai Ngo <dai.ngo@oracle.com>
Wed, 5 Nov 2025 20:45:54 +0000 (12:45 -0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 19 Jan 2026 12:11:49 +0000 (13:11 +0100)
commit 6f52063db9aabdaabea929b1e998af98c2e8d917 upstream.

The reservation type argument for the pr_preempt call should match the
one used in nfsd4_block_get_device_info_scsi.

Fixes: f99d4fbdae67 ("nfsd: add SCSI layout support")
Cc: stable@vger.kernel.org
Signed-off-by: Dai Ngo <dai.ngo@oracle.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
fs/nfsd/blocklayout.c

index e01b141ac7334dc32b6aed3e578619fb6d672a0e..5c8f20a326d2364b8275d4aa8041014a851b8dda 100644 (file)
@@ -410,7 +410,8 @@ nfsd4_scsi_fence_client(struct nfs4_layout_stateid *ls)
        struct block_device *bdev = ls->ls_file->nf_file->f_path.mnt->mnt_sb->s_bdev;
 
        bdev->bd_disk->fops->pr_ops->pr_preempt(bdev, NFSD_MDS_PR_KEY,
-                       nfsd4_scsi_pr_key(clp), 0, true);
+                       nfsd4_scsi_pr_key(clp),
+                       PR_EXCLUSIVE_ACCESS_REG_ONLY, true);
 }
 
 const struct nfsd4_layout_ops scsi_layout_ops = {