From: Ralph Boehme Date: Fri, 3 Apr 2020 07:48:58 +0000 (+0200) Subject: smbd: move files_struct.lock_failure_seen to a bitfield X-Git-Url: http://git.samba.org/samba.git/?a=commitdiff_plain;h=78e1492f218b94f1fd4085b20bc28bd84c8d6dc7;p=amitay%2Fsamba.git smbd: move files_struct.lock_failure_seen to a bitfield Updated comment in vfs.h explaining ABI change. Signed-off-by: Ralph Boehme Reviewed-by: Jeremy Allison Autobuild-User(master): Jeremy Allison Autobuild-Date(master): Fri Apr 3 20:41:34 UTC 2020 on sn-devel-184 --- diff --git a/source3/include/vfs.h b/source3/include/vfs.h index a6d0b217518..d0151213b0e 100644 --- a/source3/include/vfs.h +++ b/source3/include/vfs.h @@ -294,6 +294,25 @@ /* Version 43 - Remove deferred_close from struct files_struct */ /* Version 43 - Remove SMB_VFS_OPENDIR() */ /* Version 43 - Remove original_lcomp from struct smb_filename */ +/* Version 43 - files_struct flags: + bool kernel_share_modes_taken + bool update_write_time_triggered + bool update_write_time_on_close + bool write_time_forced + bool can_lock + bool can_read + bool can_write + bool modified + bool is_directory + bool aio_write_behind + bool initial_delete_on_close + bool delete_on_close + bool is_sparse + bool backup_intent + bool use_ofd_locks + bool closing + bool lock_failure_seen + changed to bitfields. */ #define SMB_VFS_INTERFACE_VERSION 43 @@ -374,6 +393,7 @@ typedef struct files_struct { bool backup_intent : 1; bool use_ofd_locks : 1; bool closing : 1; + bool lock_failure_seen : 1; } fsp_flags; struct tevent_timer *update_write_time_event; @@ -444,7 +464,6 @@ typedef struct files_struct { * SMB1 remembers lock failures and delays repeated blocking * lock attempts on the same offset. */ - bool lock_failure_seen; uint64_t lock_failure_offset; } files_struct; diff --git a/source3/smbd/blocking.c b/source3/smbd/blocking.c index eb219034a09..a684c9e9043 100644 --- a/source3/smbd/blocking.c +++ b/source3/smbd/blocking.c @@ -167,7 +167,7 @@ static void smbd_smb1_do_locks_setup_timeout( state->timeout = lp_lock_spin_time(); } - if ((fsp->lock_failure_seen) && + if (fsp->fsp_flags.lock_failure_seen && (blocker->offset == fsp->lock_failure_offset)) { /* * Delay repeated lock attempts on the same @@ -652,7 +652,7 @@ NTSTATUS smbd_smb1_do_locks_recv(struct tevent_req *req) DBG_DEBUG("Setting lock_failure_offset=%"PRIu64"\n", blocker->offset); - fsp->lock_failure_seen = true; + fsp->fsp_flags.lock_failure_seen = true; fsp->lock_failure_offset = blocker->offset; return status; }