diff mbox series

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

Message ID 20191108210224.33645-2-Anna.Schumaker@Netapp.com
State New, archived
Headers show
Series [1/2] NFS: Add FATTR4_WORD1_SPACE_USED to the cache_consistency_bitmask | expand

Commit Message

Anna Schumaker Nov. 8, 2019, 9:02 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


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)
 	printk(KERN_INFO "NFS: attempt to write to active swap file!\n");
-	return -EBUSY;
+	return -ETXTBSY;