Skip to content

Commit 89658c4

Browse files
amschuma-ntapTrond Myklebust
authored andcommitted
NFS: Return -ETXTBSY when attempting to write to a swapfile
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 <[email protected]> Signed-off-by: Trond Myklebust <[email protected]>
1 parent 0e96322 commit 89658c4

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

fs/nfs/file.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -649,7 +649,7 @@ ssize_t nfs_file_write(struct kiocb *iocb, struct iov_iter *from)
649649

650650
out_swapfile:
651651
printk(KERN_INFO "NFS: attempt to write to active swap file!\n");
652-
return -EBUSY;
652+
return -ETXTBSY;
653653
}
654654
EXPORT_SYMBOL_GPL(nfs_file_write);
655655

0 commit comments

Comments
 (0)