]> git.baikalelectronics.ru Git - kernel.git/commit
nfsd: check for EBUSY from vfs_rmdir/vfs_unink.
authorNeilBrown <neilb@suse.de>
Thu, 28 Nov 2019 02:56:43 +0000 (13:56 +1100)
committerJ. Bruce Fields <bfields@redhat.com>
Sat, 30 Nov 2019 19:59:52 +0000 (14:59 -0500)
commitcd04eaea6a63fd7a3bb57813d048b51caf68ff67
treefce5a8414513e8b4c7587d7f8f711e278b8b89ee
parentb70d12264612afbb0d083dc289648f8298a7ca36
nfsd: check for EBUSY from vfs_rmdir/vfs_unink.

vfs_rmdir and vfs_unlink can return -EBUSY if the
target is a mountpoint.  This currently gets passed to
nfserrno() by nfsd_unlink(), and that results in a WARNing,
which is not user-friendly.

Possibly the best NFSv4 error is NFS4ERR_FILE_OPEN, because
there is a sense in which the object is currently in use
by some other task.  The Linux NFSv4 client will map this
back to EBUSY, which is an added benefit.

For NFSv3, the best we can do is probably NFS3ERR_ACCES, which isn't
true, but is not less true than the other options.

Signed-off-by: NeilBrown <neilb@suse.de>
Signed-off-by: J. Bruce Fields <bfields@redhat.com>
fs/nfsd/nfsd.h
fs/nfsd/vfs.c