NFS: Return -ETXTBSY when attempting to write to a swapfile
authorAnna Schumaker <Anna.Schumaker@Netapp.com>
Fri, 8 Nov 2019 21:02:24 +0000 (16:02 -0500)
committerTrond Myklebust <trond.myklebust@hammerspace.com>
Mon, 18 Nov 2019 09:43:24 +0000 (10:43 +0100)
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>
Signed-off-by: Trond Myklebust <trond.myklebust@hammerspace.com>
fs/nfs/file.c

index 95dc905..8eb731d 100644 (file)
@@ -649,7 +649,7 @@ out:
 
 out_swapfile:
        printk(KERN_INFO "NFS: attempt to write to active swap file!\n");
-       return -EBUSY;
+       return -ETXTBSY;
 }
 EXPORT_SYMBOL_GPL(nfs_file_write);