Received: by 2002:a25:7ec1:0:0:0:0:0 with SMTP id z184csp1061284ybc; Tue, 12 Nov 2019 13:38:20 -0800 (PST) X-Google-Smtp-Source: APXvYqzutyFIMQafFNnsk5gZe2+4evsig5XCtTab116tsJTKcWH1l1APuS0KGyGavCsxNtOBXKMC X-Received: by 2002:a17:906:134c:: with SMTP id x12mr31550144ejb.269.1573594700462; Tue, 12 Nov 2019 13:38:20 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1573594700; cv=none; d=google.com; s=arc-20160816; b=vNPo8WdLjJ8Jrc+eksJe0PSE0PF+6ipRid3W59N3iBiZRRzAFYj0J256XcB5m7UoD4 hIG31tWh97Zwvap/YhIjd33ATh9cYt3f9UR83BxCgD64dLlFPcODPVx8rdezPKYESnrH bV63JlXLi9Z6mzPiGYdsLLr9eBcL3IT9ffmY1eqzCBmOhtS/nAl4iKsEAzWvjrXScL5r 6yvvf5q6D2+NvIBLEMN48pyey2iQMq3A0ygzz/EHqMEQhZfXqTCSAbUSHi6Z8IsyGXtV xjac1Qg+AN5EMe2+0/Fmnw+HUylFGLo4JUwTokWAKP6hO2gSZuIhpy5KSpWCFXBdN6Ov debA== 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=YUY/HRwj/bm8xklZVGq4XKr/0QoG+CCKkTN07Mf+o8I/pFPE70SR4yzr7/Wb0qB+4N faE9BFPerIEM16lDTyrK4rXJr8Hy1VU85V1f+i8NScTPdMVXRZLnYTcq5NDG9s/Dad9Z sbd+6lFWe3xVtCa8Bw5UHdfpGyXad5LjDKRkDochKUJMmfECSEUvW0dIA2JizObxeeX7 m2BmWVCOa8kFCXoepju+8YiYDgqxtvWfi58yzFGtaa4tHunylz1x/W5nHmp6LUjfIVr2 96t4xdPzmL94kvhnrN16Sqmb50i2K/ZxXPrCqJofvGyli/2/T5CjSActYHHixjbr/Zzg Aaeg== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@gmail.com header.s=20161025 header.b=lwNB8SPy; 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 w2si14474258edf.32.2019.11.12.13.37.55; Tue, 12 Nov 2019 13:38:20 -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=lwNB8SPy; 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 S1726953AbfKLVha (ORCPT + 99 others); Tue, 12 Nov 2019 16:37:30 -0500 Received: from mail-yw1-f66.google.com ([209.85.161.66]:34050 "EHLO mail-yw1-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726912AbfKLVha (ORCPT ); Tue, 12 Nov 2019 16:37:30 -0500 Received: by mail-yw1-f66.google.com with SMTP id y18so6999480ywk.1 for ; Tue, 12 Nov 2019 13:37:29 -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=lwNB8SPy31L+0JKnv1Rl1lmpV48Nc0BIBOstj2STpUXpFWRgAJzNt5mrbNDy8g7tRu ZB912ZVVGQOaNs7qIQxCR6mN8dnLde64IFsak7x1KwJA0g9002noYWS5Z7OMFPI+h6vq Wl4pxulD6bGQ03yAw0Qsu3YEqDrt94ulTzU+SN35M1RQ7xyQgwAnmmFECXtDVpZ357As b3cMA+5lJrjxDRflcvEEJ1Mp/F18kU1HbXP8DTb4F4AVMJIAD1qozfgvVl4qNYRcrbwe Q3IxMrhJ1T69bsi9XMKh5HtiC08/uZNYh1UylUt706D+suSt9R2xKIQfpOSjGiSH5eyK gdSA== 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=AXEJm74kQCeh4bKDRcQdDh7AA3HOE36v5o0r4owHDtkE3M8hodORtTritRioG593sw T/LMKkbwwYQNUn8+EpBOx7CFab8lqvDC4SiDZ6v/U3/kR7Ecw+iVWaU+qmmqOSF/5j0V FEfVFHg2YPdwdufkzDF2zCIVJshn9qsNOp1rvJ+QoRSbt4AaKSMJspMWkev9KnwU0cLq bARKV8rfDbnH4UHWceMRINchrhO2O4w+QdlPKYlcIYEM0kfC80s3WZ9iutZvHw8Y4w7F Yb/9Lkvmv7lFVXE1DelQ5ViCw7uv0uBtoWZ5v7onkLsmhAvNDZu9QtzTVPD2bXy6yDvJ sjiA== X-Gm-Message-State: APjAAAURU6FqP6QR+jO9GzCuEsHuyTzlqV52hpvv3rDd5Z3lZc5QFwdi 6OTHKg9FIjEJORbeu2kHtwU= X-Received: by 2002:a81:58c6:: with SMTP id m189mr98123ywb.25.1573594648605; Tue, 12 Nov 2019 13:37:28 -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 137sm14233490ywu.84.2019.11.12.13.37.27 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 12 Nov 2019 13:37:28 -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 v2 2/2] NFS: Return -ETXTBSY when attempting to write to a swapfile Date: Tue, 12 Nov 2019 16:37:25 -0500 Message-Id: <20191112213725.414154-2-Anna.Schumaker@Netapp.com> X-Mailer: git-send-email 2.24.0 In-Reply-To: <20191112213725.414154-1-Anna.Schumaker@Netapp.com> References: <20191112213725.414154-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