From: Christof Schmitt Date: Fri, 3 Jan 2020 18:40:50 +0000 (-0700) Subject: vfs_gpfs: Cleanup clearing file system share mode X-Git-Tag: ldb-2.1.0~100 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=eff66787c646e6ce6375929f7d61e9f1b5a0e202;p=thirdparty%2Fsamba.git vfs_gpfs: Cleanup clearing file system share mode The VFS flock function is called with a zero access_mask to indicate that the share mode should be cleared. Adjust the check to directly check the access_mask and provide a better message to indicate this case. Signed-off-by: Christof Schmitt Reviewed-by: Jeremy Allison --- diff --git a/source3/modules/vfs_gpfs.c b/source3/modules/vfs_gpfs.c index dde45156ffc..10db72dcd35 100644 --- a/source3/modules/vfs_gpfs.c +++ b/source3/modules/vfs_gpfs.c @@ -121,12 +121,10 @@ static bool set_gpfs_sharemode(files_struct *fsp, uint32_t access_mask, unsigned int deny = GPFS_DENY_NONE; int result; - allow = vfs_gpfs_access_mask_to_allow(access_mask); - - if (allow == GPFS_SHARE_NONE) { - DEBUG(10, ("special case am=no_access:%x\n",access_mask)); - } - else { + if (access_mask == 0) { + DBG_DEBUG("Clearing file system share mode.\n"); + } else { + allow = vfs_gpfs_access_mask_to_allow(access_mask); deny = vfs_gpfs_share_access_to_deny(share_access); } DEBUG(10, ("am=%x, allow=%d, sa=%x, deny=%d\n",