Bug 11919 - SMB_VFS_KERNEL_FLOCK should only be called when 'kernel share modes = yes'
Summary: SMB_VFS_KERNEL_FLOCK should only be called when 'kernel share modes = yes'
Status: RESOLVED FIXED
Alias: None
Product: Samba 4.1 and newer
Classification: Unclassified
Component: File services (show other bugs)
Version: 4.4.3
Hardware: All All
: P5 normal (vote)
Target Milestone: ---
Assignee: Karolin Seeger
QA Contact: Samba QA Contact
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-05-15 21:32 UTC by Michael Adam
Modified: 2021-01-18 11:32 UTC (History)
3 users (show)

See Also:


Attachments
patch for master that has been sent to samba-technical (1.73 KB, patch)
2016-05-15 21:49 UTC, Michael Adam
obnox: review-
Details
patch for v4-4-test, cherry-picked from master (3.50 KB, patch)
2016-05-20 12:17 UTC, Michael Adam
obnox: review+
ambi: review+
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Michael Adam 2016-05-15 21:32:31 UTC
The smb.conf is meant to guard SMB_VFS_KERNEL_FLOCK().
In source3/smbd/close.c:close_remove_share_mode(), SMB_VFS_KERNEL_FLOCK() is called unconditionally though.

On some platforms that don't implement this vfs function, e.g. the gluster-vfs-module setup, this can lead to misbehaviour even if 'kernel share modes = no'.

> [2016/05/13 18:57:07.563199,  2] ../source3/smbd/close.c:478(close_remove_share_mode)
>  close_remove_share_mode: removing kernel flock for file.dd failed: Function not implemented

This should be fixed.
Comment 1 Michael Adam 2016-05-15 21:49:14 UTC
Created attachment 12105 [details]
patch for master that has been sent to samba-technical

master patch
Comment 2 Michael Adam 2016-05-15 23:54:41 UTC
Comment on attachment 12105 [details]
patch for master that has been sent to samba-technical

different patch posted to s-t after comment by metze
Comment 3 Michael Adam 2016-05-20 12:17:35 UTC
Created attachment 12120 [details]
patch for v4-4-test, cherry-picked from master

Patch for v4-4-test
Comment 4 Michael Adam 2016-05-20 12:59:26 UTC
Karo, please include in v4-4-test.
Thanks!
Comment 5 Karolin Seeger 2016-05-30 08:51:43 UTC
Pushed to autobuild-v4-4-test.
Comment 6 Karolin Seeger 2016-06-01 07:38:20 UTC
(In reply to Karolin Seeger from comment #5)
Pushed to v4-4-test.
Closing out bug report.

Thanks!