Received: by 2002:a25:31c3:0:0:0:0:0 with SMTP id x186csp3034950ybx; Fri, 8 Nov 2019 13:04:03 -0800 (PST) X-Google-Smtp-Source: APXvYqz8PhsuKWfZykXvhfo3nKVhuj44NsMl4DDEfvEEyqL7eNjuZheaJdhe0K94ARgUrRmatU/8 X-Received: by 2002:a05:6402:4c7:: with SMTP id n7mr12582302edw.263.1573247043862; Fri, 08 Nov 2019 13:04:03 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1573247043; cv=none; d=google.com; s=arc-20160816; b=Cr5pEFgvRthtqtm9cIQc9a9j82+soPBheUmhul5I8XEmPGRfbWbFRpsfbi3+upulkb uLVlS/GRXan9q+b4524Mtze6mdmdkUl2Z6HTUS3oj6SSe+ldnte8JKQP9l1SfdGLiqtT tyZoBY0PBhnv1plaz136jmnGuokCiVpEymbds4/nxqRTLjzU5ddmJunZ5D38A01MEti5 gfbiMgUypxzdkLXDA9K08Qx8nz1piF8YJecVvM7di95rV4VoM9PErtCSk5fNdLQlrXc0 4T5vyw02EAPEBATJu+vKdd3bMyMYdbENUkS0KMqE7e9P2VPhbjQLiwPyPo3roY9ZCJ9z +WNQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=kUTQIBz1lo0h389F7WpocUOi4Y16RndkL1U5V7h4NfU=; b=hQ2K3PUF9UOsW0pRRCYTEo/o37nbX/hwxOuZL3uhVgPj39TKPFqzkbxOch9ZJ82Jm5 Fl4ShmviLQqRsr/BiSfiAWlUvBD2OFIVco07BHxiYFZA5C2HXnOUOYnReHmtLYn7387k 0NB7Eqrko9K7UVIghA/reqt/vzqUOGZTXEPVxpQBPorplbaDawYALT7P0l1qEjLZfvgT U/b+NIixOBxFXKjJXot960b83qVpwNKmHZcO5jd56viPXeVxI+lUzf0RHNiX7aUO63LO 3aWp8Wu/VEJfpSyd35clCKCcCltS6f2eQH5Ndm3Ooa7raBz0a4Ubzfz+m4u+JYm5k2mn MKIQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@gmail.com header.s=20161025 header.b=K7OyVudc; spf=pass (google.com: best guess record for domain of linux-nfs-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-nfs-owner@vger.kernel.org; dmarc=fail (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id b11si4487929ejv.278.2019.11.08.13.03.38; Fri, 08 Nov 2019 13:04:03 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-nfs-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=fail header.i=@gmail.com header.s=20161025 header.b=K7OyVudc; spf=pass (google.com: best guess record for domain of linux-nfs-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-nfs-owner@vger.kernel.org; dmarc=fail (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727612AbfKHVC3 (ORCPT + 99 others); Fri, 8 Nov 2019 16:02:29 -0500 Received: from mail-yw1-f68.google.com ([209.85.161.68]:34046 "EHLO mail-yw1-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727210AbfKHVC2 (ORCPT ); Fri, 8 Nov 2019 16:02:28 -0500 Received: by mail-yw1-f68.google.com with SMTP id y18so2688464ywk.1 for ; Fri, 08 Nov 2019 13:02:28 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=kUTQIBz1lo0h389F7WpocUOi4Y16RndkL1U5V7h4NfU=; b=K7OyVudcsUR3x4+revehF3TEa8uQ+twUXieYexOuKXmHONlt/LxNPDySb8sHS/+0Oi nojUtXRc3aM1/pG+XjPlVnYIQ3c0r6KtXFwyUS1bOFZjQdlI9w+SSzeRtquDaETK1XkP X5J7rM0tgxoTYhyKKrxlg60dmMkOIA7q1qc95O77/B0PofZwj4GCaVx0iw0zavK1xzAV s4vxWSxmgsPSaKDQ4OG1Oyb+0Q9NIrN4gg4i88ofcVjzZH95ZDRCxNoaO/7n1RsXeQX4 XdY0v4PY6SeGMDfl6fsHOGk6zdpvIFYbKVtj+j2AMLi+zd7+SH31QOey7fSZjlht5GI8 RN6Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=kUTQIBz1lo0h389F7WpocUOi4Y16RndkL1U5V7h4NfU=; b=cITkz0FCfP2cBJfVT9UczyPfannpAChEldnHQWiq/4EcJSOOSfGpGzS/5jDHVJHPQ5 QkJsezFFPju4i8gjN6qEbueB0+F12JQHI2I3K1Fl8Yr0FE3mJ60OqlznrRNXjg0s1r3z 8MuQTzvSix4L2ZhNfeDfsWOWRLndr043MSA7vhhZEI5SoXBeKXys8rT5+Sn8TWfL6NhK 02OfzIZ4ev5XFZgWsqPzlGdyNa4tOXSt/7GisW74rcJRQXry8qxgk94UU4cNOh2YQDzj S70VidfEqNjlg68v7qj+dxuzftmzoAwYGYzbHzqb3/DuogQ0pI8MRfKP0tavSo+m0iQW vPLw== X-Gm-Message-State: APjAAAW06eu5/mqZSrD6xASKZRYs/3ioVYp6icJEu6LxNOygr1DntDcR iviYd85jMKNWAY5as228ABU= X-Received: by 2002:a0d:d583:: with SMTP id x125mr8408656ywd.213.1573246947785; Fri, 08 Nov 2019 13:02:27 -0800 (PST) Received: from localhost.localdomain (c-68-42-68-242.hsd1.mi.comcast.net. [68.42.68.242]) by smtp.gmail.com with ESMTPSA id p126sm1904033ywc.16.2019.11.08.13.02.26 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 08 Nov 2019 13:02:27 -0800 (PST) From: schumaker.anna@gmail.com X-Google-Original-From: Anna.Schumaker@Netapp.com To: Trond.Myklebust@hammerspace.com, linux-nfs@vger.kernel.org Cc: Anna.Schumaker@Netapp.com Subject: [PATCH 2/2] NFS: Return -ETXTBSY when attempting to write to a swapfile Date: Fri, 8 Nov 2019 16:02:24 -0500 Message-Id: <20191108210224.33645-2-Anna.Schumaker@Netapp.com> X-Mailer: git-send-email 2.24.0 In-Reply-To: <20191108210224.33645-1-Anna.Schumaker@Netapp.com> References: <20191108210224.33645-1-Anna.Schumaker@Netapp.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-nfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-nfs@vger.kernel.org From: Anna Schumaker My understanding is that -EBUSY refers to the underlying device, and that -ETXTBSY is used when attempting to access a file in use by the kernel (like a swapfile). Changing this return code helps us pass xfstests generic/569 Signed-off-by: Anna Schumaker --- fs/nfs/file.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fs/nfs/file.c b/fs/nfs/file.c index 95dc90570786..8eb731d9be3e 100644 --- a/fs/nfs/file.c +++ b/fs/nfs/file.c @@ -649,7 +649,7 @@ ssize_t nfs_file_write(struct kiocb *iocb, struct iov_iter *from) out_swapfile: printk(KERN_INFO "NFS: attempt to write to active swap file!\n"); - return -EBUSY; + return -ETXTBSY; } EXPORT_SYMBOL_GPL(nfs_file_write); -- 2.24.0