Locking and VFS modules question

Stefan (metze) Metzmacher metze at samba.org
Tue Jul 30 11:01:17 MDT 2013

Hi Jon,

> As part of coding a local VFS opaque module we have run into a problem
> with locking causing core dumps.  We're at a relatively early stage of
> our development and the target filesystem that we're interfacing to
> doesn't really support locking, so we're just interested in simple share
> mode locks currently (no byte range locking or anything fancy).  In our
> VFS's create_file() routine we try to get share mode locks when we open
> files using:
>   struct share_mode_lock *lck = NULL;
>   lck = get_share_mode_lock(handle, fsp->file_id,
>                         handle->conn->connectpath,
>                             smb_fname, &old_write_time);
>   if (lck == NULL) {
>       DEBUG(0, ("Could not get share mode lock\n"));
>   }
>   set_share_mode(lck, fsp, get_current_uid(handle->conn),
>                  req ? req->mid : 0,
>                  fsp->oplock_type);

I guess you're missing a TALLOC_FREE(lck); here.
That will release the lock on the tdb level.


-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 261 bytes
Desc: OpenPGP digital signature
URL: <http://lists.samba.org/pipermail/samba-technical/attachments/20130730/33ecf48c/attachment.pgp>

More information about the samba-technical mailing list