diff mbox series

[v2,2/2] NFS: Return -ETXTBSY when attempting to write to a swapfile

Message ID 20191112213725.414154-2-Anna.Schumaker@Netapp.com (mailing list archive)
State New, archived
Headers show
Series [v2,1/2] NFS: Fallocate should use the nfs4_fattr_bitmap | expand

Commit Message

Anna Schumaker Nov. 12, 2019, 9:37 p.m. UTC
From: Anna Schumaker <Anna.Schumaker@Netapp.com>

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 <Anna.Schumaker@Netapp.com>
---
 fs/nfs/file.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff mbox series

Patch

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);