From nobody Sun Nov 21 16:03:18 2021 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 3E4DE189ACFD; Sun, 21 Nov 2021 16:03:19 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HxwDR1FF4z3m6W; Sun, 21 Nov 2021 16:03:19 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 026A91262E; Sun, 21 Nov 2021 16:03:19 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1ALG3IND095824; Sun, 21 Nov 2021 16:03:18 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1ALG3ILj095823; Sun, 21 Nov 2021 16:03:18 GMT (envelope-from git) Date: Sun, 21 Nov 2021 16:03:18 GMT Message-Id: <202111211603.1ALG3ILj095823@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Rick Macklem Subject: git: 529957726679 - stable/13 - nfsd: Fix the NFSv4 pNFS MDS server for DS NFSERR_NOSPC List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: rmacklem X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 5299577266790d1da58db29ada5082550287ce55 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by rmacklem: URL: https://cgit.FreeBSD.org/src/commit/?id=5299577266790d1da58db29ada5082550287ce55 commit 5299577266790d1da58db29ada5082550287ce55 Author: Rick Macklem AuthorDate: 2021-11-07 19:43:03 +0000 Commit: Rick Macklem CommitDate: 2021-11-21 15:59:49 +0000 nfsd: Fix the NFSv4 pNFS MDS server for DS NFSERR_NOSPC If a pNFS server's DS runs out of disk space, it replies NFSERR_NOSPC to the client doing writing. For the Linux client, it then sends a LayoutError RPC to the server to tell it about the error and keeps retrying, doing repeated LayoutGet and Write RPCs to the DS. The Linux client is "stuck" until disk space on the DS is free'd up. For a mirrored server configuration, the first mirror that ran out of space was taken offline. This does not make much sense, since the other mirror(s) will run out of space soon and the fix is a manual cleanup up disk space. This patch changes the pNFS server to not disable a mirror for the mirrored case when this occurs. Further work is needed, since the Linux client expects the MDS to reply NFSERR_NOSPC to LayoutGets once the DS is out of space. Without this further change, the above mentioned looping occurs. Found during a recent IEFT NFSv4 working group testing event. (cherry picked from commit a7e014eee5d47d6eb13bc98c71e65d00a6de8ed3) --- sys/fs/nfsserver/nfs_nfsdserv.c | 7 ++++--- sys/fs/nfsserver/nfs_nfsdstate.c | 7 ++++--- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/sys/fs/nfsserver/nfs_nfsdserv.c b/sys/fs/nfsserver/nfs_nfsdserv.c index 7ca766c99069..0e447778d639 100644 --- a/sys/fs/nfsserver/nfs_nfsdserv.c +++ b/sys/fs/nfsserver/nfs_nfsdserv.c @@ -5046,10 +5046,11 @@ nfsrvd_layouterror(struct nfsrv_descript *nd, __unused int isdgram, opnum = fxdr_unsigned(int, *tl); NFSD_DEBUG(4, "nfsrvd_layouterr op=%d stat=%d\n", opnum, stat); /* - * Except for NFSERR_ACCES and NFSERR_STALE errors, - * disable the mirror. + * Except for NFSERR_ACCES, NFSERR_STALE and NFSERR_NOSPC + * errors, disable the mirror. */ - if (stat != NFSERR_ACCES && stat != NFSERR_STALE) + if (stat != NFSERR_ACCES && stat != NFSERR_STALE && + stat != NFSERR_NOSPC) nfsrv_delds(devid, curthread); } nfsmout: diff --git a/sys/fs/nfsserver/nfs_nfsdstate.c b/sys/fs/nfsserver/nfs_nfsdstate.c index 750eda2027ec..797b9b0a466e 100644 --- a/sys/fs/nfsserver/nfs_nfsdstate.c +++ b/sys/fs/nfsserver/nfs_nfsdstate.c @@ -7009,10 +7009,11 @@ nfsrv_flexlayouterr(struct nfsrv_descript *nd, uint32_t *layp, int maxcnt, NFSD_DEBUG(4, "flexlayouterr op=%d stat=%d\n", opnum, stat); /* - * Except for NFSERR_ACCES and NFSERR_STALE errors, - * disable the mirror. + * Except for NFSERR_ACCES, NFSERR_STALE and + * NFSERR_NOSPC errors, disable the mirror. */ - if (stat != NFSERR_ACCES && stat != NFSERR_STALE) + if (stat != NFSERR_ACCES && stat != NFSERR_STALE && + stat != NFSERR_NOSPC) nfsrv_delds(devid, p); } }