vboxsf: Honor excl flag to the dir-inode create op
authorHans de Goede <hdegoede@redhat.com>
Thu, 21 Jan 2021 09:08:59 +0000 (10:08 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sun, 15 Aug 2021 12:00:26 +0000 (14:00 +0200)
commit971703fc19cf578263df5cb772586ba171326985
tree6870e518a05b0249dde93cf5de85cdf3267d450e
parent96b2232cb7e59a3d9268638554ca38decc1b46d1
vboxsf: Honor excl flag to the dir-inode create op

commit cc3ddee97cff034cea4d095de4a484c92a219bf5 upstream

Honor the excl flag to the dir-inode create op, instead of behaving
as if it is always set.

Note the old behavior still worked most of the time since a non-exclusive
open only calls the create op, if there is a race and the file is created
between the dentry lookup and the calling of the create call.

While at it change the type of the is_dir parameter to the
vboxsf_dir_create() helper from an int to a bool, to be consistent with
the use of bool for the excl parameter.

Fixes: 0fd169576648 ("fs: Add VirtualBox guest shared folder (vboxsf) support")
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Sudip Mukherjee <sudipm.mukherjee@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
fs/vboxsf/dir.c