Re: [Samba] A samba locking question

2004-02-19 Thread Mike Fedyk
Andrew Bartlett wrote:
oplocks do not override fcntl locks - but clients that have successfully
gained an oplock might not ask for an SMB lock, and therefore Samba
might not attempt to gain the matching fcntl() lock.
Would strict locking avoid that locking hole by setting the fcntl lock 
upon giving an oplock?
--
To unsubscribe from this list go to the following URL and read the
instructions:  http://lists.samba.org/mailman/listinfo/samba


Re: [Samba] A samba locking question

2004-02-11 Thread Patrik Gustavsson

Let me the try to communicate in a different way.

The only thing I want to know if byte range locks
or file share reservation are propagated to or from UNIX.

That is:

a) When a external program is doing a byte range lock through
   fcntl on file, will that be checked before Samba is 
   opening the file ?

   My findings tells me it does.


b) When a external program is doing file share reservation
   through on a file fcntl will that be checked before Samba is opening
   the file ?

   My findings tells me it don't.
 
   The test-program did file share reservation through fcntl on file
   with the parameters:
f_access=F_RWACC (Set a  file  share  reservation  for  read 
  and  write access)
f_deny=F_RWDNY   (Set a file share reservation to deny  read 
  and  write)

   The client could through Samba open and write in that file.

c) If/When Samba is doing a byte range lock on file will that byte
   range lock be propagated externaly to UNIX ?

   I believe it will not.

d) If/When Samba is doing a file share reservation on file will that
   be propagated externaly to UNIX ?

   My findings tells me it don't.


I don't this good or bad. I just want to know.

/Patrik



On Tue, 2004-02-10 at 19:18, Jeremy Allison wrote:
 On Tue, Feb 10, 2004 at 09:39:01AM +0100, Patrik Gustavsson wrote:
  Well, you should know.
  
  But if Samba is doing byte ranged lock using fcntl, then
  I don't understand why my tests failed.
  
  The first test I did was:
  
  I simulated a NFS client and did byte range lock on a file,
  a document in this case 8K in size, and tried to open that from
  client using Samba and it failed becuse is was locked.
  
  The second test I did was:
  
  When  a client opened the file using samba, with a
  DENY_WRITE lock (output from smbstatus) and I used the same simulated
  NFS client that did a byte range write lock using fcntl() on that
  document.
  I would assume that the byte range lock would fail, but it didn't it 
  succeeded.
  
  That surprised me.
 
 You're confusing share modes with byte range locks. Read up on share
 modes - smbstatus doesn't report byte range locks, only share modes.
 
 Until you understand the difference we're not really communicating :-). At all :-).
 
 Jeremy.
-- 
In a world without fences who needs Gates
Patrik Gustavsson, Senior Technical Consultant
[EMAIL PROTECTED] Telephone: +46 60 671540
http://glen.swedenMobile: +46 70 3551040
SUN MICROSYSTEMS  Fax: +46 60 671550
--


-- 
To unsubscribe from this list go to the following URL and read the
instructions:  http://lists.samba.org/mailman/listinfo/samba


Re: [Samba] A samba locking question

2004-02-11 Thread Jeremy Allison
On Wed, Feb 11, 2004 at 02:11:07PM +0100, Patrik Gustavsson wrote:
 
 Let me the try to communicate in a different way.
 
 The only thing I want to know if byte range locks
 or file share reservation are propagated to or from UNIX.
 
 That is:
 
 a) When a external program is doing a byte range lock through
fcntl on file, will that be checked before Samba is 
opening the file ?
 
My findings tells me it does.

Yes it will.

 
 b) When a external program is doing file share reservation
through on a file fcntl will that be checked before Samba is opening
the file ?
 
My findings tells me it don't.
  
The test-program did file share reservation through fcntl on file
with the parameters:
   f_access=F_RWACC (Set a  file  share  reservation  for  read 
 and  write access)
   f_deny=F_RWDNY   (Set a file share reservation to deny  read 
 and  write)
 
The client could through Samba open and write in that file.

I have never heard of these f_access codes ? This is not POSIX.
I have no clue what system you are using that has these share modes. No
POSIX system has this.

So not suprisingly Samba doesn't know anything about this.

 c) If/When Samba is doing a byte range lock on file will that byte
range lock be propagated externaly to UNIX ?
 
I believe it will not.

Yes it will, you are incorrect.

 d) If/When Samba is doing a file share reservation on file will that
be propagated externaly to UNIX ?
 
My findings tells me it don't.

Only on Linux, where Samba is compiled with the parameter
HAVE_KERNEL_SHARE_MODES will share modes be understood by the kernel.

Share modes have *NOTHING* to do with byte range locks. The two
are completely orthoganal.

You really need to understand this before you can proceed.

Jeremy.

-- 
To unsubscribe from this list go to the following URL and read the
instructions:  http://lists.samba.org/mailman/listinfo/samba


Re: [Samba] A samba locking question

2004-02-10 Thread Jeremy Allison
On Tue, Feb 10, 2004 at 07:46:11AM +0100, Patrik Gustavsson wrote:
 Yes, your are wright. But Samba will not
 do a byte ranged lock using fcntl() on the file
 when lock range is below 2^31 as stated in the docs.

No, you've got it wrong (I *wrote* the mapping code). Samba checks
a lock request against the internal 64-bit unsigned locking database.

If that lock request would be granted (no other Windows locks
conflict) then it tries to map the 64-bit unsigned Windows
lock onto either (a) a 64-bit signed POSIX lock or (b) a 32-bit
signed POSIX lock (depending on what the underlying UNIX supports).

If it can also get that lock then the lock is granted, if not
then it rolls back the lock entry in the internal Windows
locking database and returns a lock error to the client.

It can be complicated by the fact there is a parameter to
tell Samba whether to map onto POSIX locks or not, and also
a client may ask for a blocking lock which may delay the
response.

Jeremy.
-- 
To unsubscribe from this list go to the following URL and read the
instructions:  http://lists.samba.org/mailman/listinfo/samba


Re: [Samba] A samba locking question

2004-02-10 Thread Patrik Gustavsson
Well, you should know.

But if Samba is doing byte ranged lock using fcntl, then
I don't understand why my tests failed.

The first test I did was:

I simulated a NFS client and did byte range lock on a file,
a document in this case 8K in size, and tried to open that from
client using Samba and it failed becuse is was locked.

The second test I did was:

When  a client opened the file using samba, with a
DENY_WRITE lock (output from smbstatus) and I used the same simulated
NFS client that did a byte range write lock using fcntl() on that
document.
I would assume that the byte range lock would fail, but it didn't it 
succeeded.

That surprised me.

The third test I did on my Solaris box was:

I wrote a 'new' fcntl() function and that was preloaded when smbd was
started. This 'new' function call logged all fcntl-calls before it
called the real fcntl() call and returned the result.
I opened the file from the client and tracked the filedesriptor for
the  opened file in /proc and compared with logging information from
the fcntl calls.
The only fcntl calls for that file was that smbd was asking for F_GETLK
information.

That lead me to the fact that smbd is not doing any byte range locks
using fcntl().

Mayby I am wrong, but I can't where.

/Patrik



On Tue, 2004-02-10 at 08:15, Jeremy Allison wrote:
 On Tue, Feb 10, 2004 at 07:46:11AM +0100, Patrik Gustavsson wrote:
  Yes, your are wright. But Samba will not
  do a byte ranged lock using fcntl() on the file
  when lock range is below 2^31 as stated in the docs.
 
 No, you've got it wrong (I *wrote* the mapping code). Samba checks
 a lock request against the internal 64-bit unsigned locking database.
 
 If that lock request would be granted (no other Windows locks
 conflict) then it tries to map the 64-bit unsigned Windows
 lock onto either (a) a 64-bit signed POSIX lock or (b) a 32-bit
 signed POSIX lock (depending on what the underlying UNIX supports).
 
 If it can also get that lock then the lock is granted, if not
 then it rolls back the lock entry in the internal Windows
 locking database and returns a lock error to the client.
 
 It can be complicated by the fact there is a parameter to
 tell Samba whether to map onto POSIX locks or not, and also
 a client may ask for a blocking lock which may delay the
 response.
 
 Jeremy.
-- 
In a world without fences who needs Gates
Patrik Gustavsson, Senior Technical Consultant
[EMAIL PROTECTED] Telephone: +46 60 671540
http://glen.swedenMobile: +46 70 3551040
SUN MICROSYSTEMS  Fax: +46 60 671550
--


-- 
To unsubscribe from this list go to the following URL and read the
instructions:  http://lists.samba.org/mailman/listinfo/samba


Re: [Samba] A samba locking question

2004-02-10 Thread Jeremy Allison
On Tue, Feb 10, 2004 at 09:39:01AM +0100, Patrik Gustavsson wrote:
 Well, you should know.
 
 But if Samba is doing byte ranged lock using fcntl, then
 I don't understand why my tests failed.
 
 The first test I did was:
 
 I simulated a NFS client and did byte range lock on a file,
 a document in this case 8K in size, and tried to open that from
 client using Samba and it failed becuse is was locked.
 
 The second test I did was:
 
 When  a client opened the file using samba, with a
 DENY_WRITE lock (output from smbstatus) and I used the same simulated
 NFS client that did a byte range write lock using fcntl() on that
 document.
 I would assume that the byte range lock would fail, but it didn't it 
 succeeded.
 
 That surprised me.

You're confusing share modes with byte range locks. Read up on share
modes - smbstatus doesn't report byte range locks, only share modes.

Until you understand the difference we're not really communicating :-). At all :-).

Jeremy.
-- 
To unsubscribe from this list go to the following URL and read the
instructions:  http://lists.samba.org/mailman/listinfo/samba


Re: [Samba] A samba locking question

2004-02-10 Thread Thomas Bork
Hallo Jeremy,

 You're confusing share modes with byte range locks. Read up on share
 modes - smbstatus doesn't report byte range locks, only share modes.
 
 Until you understand the difference we're not really communicating :-). At
 all :-).

if smbstatus could show byte range locks, the debugging of locking issues would be 
easier then today. Is it possible to enhance smbstatus that way?
__
Erdbeben im Iran: Zehntausende Kinder brauchen Hilfe. UNICEF hilft den
Kindern - helfen Sie mit! https://www.unicef.de/spe/spe_03.php

-- 
To unsubscribe from this list go to the following URL and read the
instructions:  http://lists.samba.org/mailman/listinfo/samba


Re: [Samba] A samba locking question

2004-02-10 Thread Jeremy Allison
On Tue, Feb 10, 2004 at 09:11:48PM +0100, Thomas Bork wrote:
 Hallo Jeremy,
 
  You're confusing share modes with byte range locks. Read up on share
  modes - smbstatus doesn't report byte range locks, only share modes.
  
  Until you understand the difference we're not really communicating :-). At
  all :-).
 
 if smbstatus could show byte range locks, the debugging of locking issues would be 
 easier then today. Is it possible to enhance smbstatus that way?

Patches are welcome :-). Make it an option though, as it will disrupt the normal
status output.

Jeremy.
-- 
To unsubscribe from this list go to the following URL and read the
instructions:  http://lists.samba.org/mailman/listinfo/samba


Re: [Samba] A samba locking question

2004-02-09 Thread Jeremy Allison
On Thu, Feb 05, 2004 at 09:25:25AM +0100, Patrik Gustavsson wrote:
 
 The things that tricked me was that I read the docs
 for Samba 3 regarding locks.
 
 And it says in the third paragraph in section 14.2
 
 Samba 2.2 and above implements record locking completely independent
 of the underlying UNIX system. If a byte range lock that the client
 requests happens to fall into the range of 0-2^31, Samba hands this
 request down to the UNIX system. All other locks cannot be seen by
 UNIX, anyway
 
 I interperted that Samba would do fcntl locks on the file if the request
 is below 2^31 and not if it is above.
 Which are not true.
 
 Secondly, I don't understand why Samba is checking if a file
 locked through fcntl before opening it, when it is not locking 
 the file through fcntl when Samba is opening the file.

Samba doesn't use fcntl to check locks before opening, that's what
share modes are for. fcntl locks are for byte range lock mapping
onto POSIX.

Jeremy.
-- 
To unsubscribe from this list go to the following URL and read the
instructions:  http://lists.samba.org/mailman/listinfo/samba


Re: [Samba] A samba locking question

2004-02-09 Thread Patrik Gustavsson
Yes, your are wright. But Samba will not
do a byte ranged lock using fcntl() on the file
when lock range is below 2^31 as stated in the docs.

/Patrik


On tis, 2004-02-10 at 00:22, Jeremy Allison wrote:
 On Thu, Feb 05, 2004 at 09:25:25AM +0100, Patrik Gustavsson wrote:
  
  The things that tricked me was that I read the docs
  for Samba 3 regarding locks.
  
  And it says in the third paragraph in section 14.2
  
  Samba 2.2 and above implements record locking completely independent
  of the underlying UNIX system. If a byte range lock that the client
  requests happens to fall into the range of 0-2^31, Samba hands this
  request down to the UNIX system. All other locks cannot be seen by
  UNIX, anyway
  
  I interperted that Samba would do fcntl locks on the file if the request
  is below 2^31 and not if it is above.
  Which are not true.
  
  Secondly, I don't understand why Samba is checking if a file
  locked through fcntl before opening it, when it is not locking 
  the file through fcntl when Samba is opening the file.
 
 Samba doesn't use fcntl to check locks before opening, that's what
 share modes are for. fcntl locks are for byte range lock mapping
 onto POSIX.
 
 Jeremy.
-- 
In a world without fences who needs Gates
Patrik Gustavsson, Senior Technical Consultant
[EMAIL PROTECTED] Telephone: +46 60 671540
http://glen.swedenMobile: +46 70 3551040
SUN MICROSYSTEMS  Fax: +46 60 671550
--


-- 
To unsubscribe from this list go to the following URL and read the
instructions:  http://lists.samba.org/mailman/listinfo/samba


Re: [Samba] A samba locking question

2004-02-05 Thread Patrik Gustavsson

The things that tricked me was that I read the docs
for Samba 3 regarding locks.

And it says in the third paragraph in section 14.2

Samba 2.2 and above implements record locking completely independent
of the underlying UNIX system. If a byte range lock that the client
requests happens to fall into the range of 0-2^31, Samba hands this
request down to the UNIX system. All other locks cannot be seen by
UNIX, anyway

I interperted that Samba would do fcntl locks on the file if the request
is below 2^31 and not if it is above.
Which are not true.

Secondly, I don't understand why Samba is checking if a file
locked through fcntl before opening it, when it is not locking 
the file through fcntl when Samba is opening the file.

/Patrik



On ons, 2004-02-04 at 18:38, Jeremy Allison wrote:
 On Wed, Feb 04, 2004 at 11:14:31AM +0100, Patrik Gustavsson wrote:
  
  Let me be more specific of what I am trying to do.
  
  I am the engineer at Sun that wrote the cluster agent for
  Samba, a standard HA agent.
  This works as a dream and is deployed on several clusters
  around the world.
  
  Now, I am doing study to see if the standard samba can be run
  as a scalable service (Several smbd's on different nodes accessing
  the same data).
  I know the issue with oplocks, so they are disable duering this
  tests.
  
  The Sun Cluster has the feature GFS (Global File system) as
  what True Cluster has.
  And the GFS will propagate all fcntl(), lockf() calls to all the
  nodes in the cluster.
  
  This has been tested by issuing a fcntl() locks on file, both local and
  remote, and having pc trying open that file and it's fail because it is
  locked.
  
  The issue I have with Samba locks is that, when a client open
  file I can have put a fcntl() write lock on that file.
  
  That shouldn't be possible if the file or part of that file
  had been looked with a fcntl() call.
  
  The output from smbstatus for that file:
  6696   DENY_WRITE 0x2019f RDWR   NONE
  /global/mnt1/datadir/TEST.sxw   Wed Feb  4 10:50:44 2004
 
 This won't work unless you have some method of propagating
 the open file table (found in locking.tdb) which tells clients
 what the current open share modes are.
 
 You need to solve this basic problem before you get to esoterica
 like byte range locks across the cluster.
 
 Jeremy.
-- 
In a world without fences who needs Gates
Patrik Gustavsson, Senior Technical Consultant
[EMAIL PROTECTED] Telephone: +46 60 671540
http://glen.swedenMobile: +46 70 3551040
SUN MICROSYSTEMS  Fax: +46 60 671550
--


-- 
To unsubscribe from this list go to the following URL and read the
instructions:  http://lists.samba.org/mailman/listinfo/samba


Re: [Samba] A samba locking question

2004-02-04 Thread Patrik Gustavsson
Hi,

If I get this wright is that Samba will not use
a direct call to fcnl() to lock the file.

IE:
If a PC open a file and do lock that file, will that
lock be propagated so other application on the server can see that
file is locked by calling fcntl().

/Patrik

On lör, 2004-01-31 at 01:24, Andrew Bartlett wrote:
 On Thu, 2004-01-29 at 23:55, Patrik Gustavsson wrote:
  Hi,
  
  Maybe this is a stupid question, but any way
  
  Will samba use fcntl locking if level 1 and 2 oplocks is
  disabled and samba is not compiled with spin-locks enabled ?
  
  I am using Samba on solaris
 
 Samba uses fcntl() locking in two places.  Firstly, it is used to mirror
 SMB locks, asked for by the client.  Secondly they are used to mediate
 access to tdbs.
 
 Spinlocks are an alternative (if much less reliable) method for tdb
 mediation.  
 
 oplocks do not override fcntl locks - but clients that have successfully
 gained an oplock might not ask for an SMB lock, and therefore Samba
 might not attempt to gain the matching fcntl() lock.
 
 The nasty performance issues in Solaris are due to bad fcntl() lock
 contention performance in Samba's TDB access.  
 
 Andrew Bartlett
-- 
In a world without fences who needs Gates
Patrik Gustavsson, Senior Technical Consultant
[EMAIL PROTECTED] Telephone: +46 60 671540
http://glen.swedenMobile: +46 70 3551040
SUN MICROSYSTEMS  Fax: +46 60 671550
--


-- 
To unsubscribe from this list go to the following URL and read the
instructions:  http://lists.samba.org/mailman/listinfo/samba


Re: [Samba] A samba locking question

2004-02-04 Thread Andrew Bartlett
On Wed, 2004-02-04 at 20:29, Patrik Gustavsson wrote:
 Hi,
 
 If I get this wright is that Samba will not use
 a direct call to fcnl() to lock the file.
 
 IE:
 If a PC open a file and do lock that file, will that
 lock be propagated so other application on the server can see that
 file is locked by calling fcntl().

Yes.

Samba will, to the best of it's ability, use fcntl() locks to indicate
SMB locks to other applications (be they local unix apps, or NFS clients
etc)

Andrew Bartlett

-- 
Andrew Bartlett [EMAIL PROTECTED]
Manager, Authentication Subsystems, Samba Team  [EMAIL PROTECTED]
Student Network Administrator, Hawker College   [EMAIL PROTECTED]
http://samba.org http://build.samba.org http://hawkerc.net


signature.asc
Description: This is a digitally signed message part
-- 
To unsubscribe from this list go to the following URL and read the
instructions:  http://lists.samba.org/mailman/listinfo/samba

Re: [Samba] A samba locking question

2004-02-04 Thread Patrik Gustavsson

Let me be more specific of what I am trying to do.

I am the engineer at Sun that wrote the cluster agent for
Samba, a standard HA agent.
This works as a dream and is deployed on several clusters
around the world.

Now, I am doing study to see if the standard samba can be run
as a scalable service (Several smbd's on different nodes accessing
the same data).
I know the issue with oplocks, so they are disable duering this
tests.

The Sun Cluster has the feature GFS (Global File system) as
what True Cluster has.
And the GFS will propagate all fcntl(), lockf() calls to all the
nodes in the cluster.

This has been tested by issuing a fcntl() locks on file, both local and
remote, and having pc trying open that file and it's fail because it is
locked.

The issue I have with Samba locks is that, when a client open
file I can have put a fcntl() write lock on that file.

That shouldn't be possible if the file or part of that file
had been looked with a fcntl() call.

The output from smbstatus for that file:
6696   DENY_WRITE 0x2019f RDWR   NONE
/global/mnt1/datadir/TEST.sxw   Wed Feb  4 10:50:44 2004

The samba version I am using is 3.0.1

/Patrik



On ons, 2004-02-04 at 10:45, Andrew Bartlett wrote:
 On Wed, 2004-02-04 at 20:29, Patrik Gustavsson wrote:
  Hi,
  
  If I get this wright is that Samba will not use
  a direct call to fcnl() to lock the file.
  
  IE:
  If a PC open a file and do lock that file, will that
  lock be propagated so other application on the server can see that
  file is locked by calling fcntl().
 
 Yes.
 
 Samba will, to the best of it's ability, use fcntl() locks to indicate
 SMB locks to other applications (be they local unix apps, or NFS clients
 etc)
 
 Andrew Bartlett
-- 
In a world without fences who needs Gates
Patrik Gustavsson, Senior Technical Consultant
[EMAIL PROTECTED] Telephone: +46 60 671540
http://glen.swedenMobile: +46 70 3551040
SUN MICROSYSTEMS  Fax: +46 60 671550
--


-- 
To unsubscribe from this list go to the following URL and read the
instructions:  http://lists.samba.org/mailman/listinfo/samba


Re: [Samba] A samba locking question

2004-02-04 Thread Jeremy Allison
On Wed, Feb 04, 2004 at 11:14:31AM +0100, Patrik Gustavsson wrote:
 
 Let me be more specific of what I am trying to do.
 
 I am the engineer at Sun that wrote the cluster agent for
 Samba, a standard HA agent.
 This works as a dream and is deployed on several clusters
 around the world.
 
 Now, I am doing study to see if the standard samba can be run
 as a scalable service (Several smbd's on different nodes accessing
 the same data).
 I know the issue with oplocks, so they are disable duering this
 tests.
 
 The Sun Cluster has the feature GFS (Global File system) as
 what True Cluster has.
 And the GFS will propagate all fcntl(), lockf() calls to all the
 nodes in the cluster.
 
 This has been tested by issuing a fcntl() locks on file, both local and
 remote, and having pc trying open that file and it's fail because it is
 locked.
 
 The issue I have with Samba locks is that, when a client open
 file I can have put a fcntl() write lock on that file.
 
 That shouldn't be possible if the file or part of that file
 had been looked with a fcntl() call.
 
 The output from smbstatus for that file:
 6696   DENY_WRITE 0x2019f RDWR   NONE
 /global/mnt1/datadir/TEST.sxw   Wed Feb  4 10:50:44 2004

This won't work unless you have some method of propagating
the open file table (found in locking.tdb) which tells clients
what the current open share modes are.

You need to solve this basic problem before you get to esoterica
like byte range locks across the cluster.

Jeremy.
-- 
To unsubscribe from this list go to the following URL and read the
instructions:  http://lists.samba.org/mailman/listinfo/samba


Re: [Samba] A samba locking question

2004-02-02 Thread Thomas Hannan
Hello,

I have a question to tack on to this one -- 

How would I go about compiling Samba such that it either didn't pass
locking requests (for file shares, not TDB's) to fcntl() and just
handled these locks internally for the Windows clients, or at least did
that for locks requested in the 32-64 bit offset range? If I'm not
mistaken, I believe that was the default behavior in the 2.2 series, and
looks like it changed in 3.0.0 (at least in my tests on linux 2.4.x with
glibc 2.2).

Many thanks,
Thomas

On Fri, 2004-01-30 at 18:24, Andrew Bartlett wrote:
 On Thu, 2004-01-29 at 23:55, Patrik Gustavsson wrote:
  Hi,
  
  Maybe this is a stupid question, but any way
  
  Will samba use fcntl locking if level 1 and 2 oplocks is
  disabled and samba is not compiled with spin-locks enabled ?
  
  I am using Samba on solaris
 
 Samba uses fcntl() locking in two places.  Firstly, it is used to mirror
 SMB locks, asked for by the client.  Secondly they are used to mediate
 access to tdbs.
 
 Spinlocks are an alternative (if much less reliable) method for tdb
 mediation.  
 
 oplocks do not override fcntl locks - but clients that have successfully
 gained an oplock might not ask for an SMB lock, and therefore Samba
 might not attempt to gain the matching fcntl() lock.
 
 The nasty performance issues in Solaris are due to bad fcntl() lock
 contention performance in Samba's TDB access.  
 
 Andrew Bartlett
 
 -- 
 Andrew Bartlett [EMAIL PROTECTED]
 Manager, Authentication Subsystems, Samba Team  [EMAIL PROTECTED]
 Student Network Administrator, Hawker College   [EMAIL PROTECTED]
 http://samba.org http://build.samba.org http://hawkerc.net
 
 

 -- 
 To unsubscribe from this list go to the following URL and read the
 instructions:  http://lists.samba.org/mailman/listinfo/samba


-- 
To unsubscribe from this list go to the following URL and read the
instructions:  http://lists.samba.org/mailman/listinfo/samba


Re: [Samba] A samba locking question

2004-02-02 Thread Jeremy Allison
On Mon, Feb 02, 2004 at 01:26:01PM -0600, Thomas Hannan wrote:
 Hello,
 
 I have a question to tack on to this one -- 
 
 How would I go about compiling Samba such that it either didn't pass
 locking requests (for file shares, not TDB's) to fcntl() and just
 handled these locks internally for the Windows clients, or at least did
 that for locks requested in the 32-64 bit offset range? If I'm not
 mistaken, I believe that was the default behavior in the 2.2 series, and
 looks like it changed in 3.0.0 (at least in my tests on linux 2.4.x with
 glibc 2.2).

Nope, Samba always handles full 64-bit unsigned locks internally. It
then passes down the parts that make sense to the underlying lock
system (be it 32-bit or 64-bit signed). Samba should already be doing
this. If it isn't for you then the configure test is screwing up and
telling Samba you have 64-bit signed fcntl locks when you really don't
(such as when re-exporting an NFS mount for instance).

Jeremy.
-- 
To unsubscribe from this list go to the following URL and read the
instructions:  http://lists.samba.org/mailman/listinfo/samba


Re: [Samba] A samba locking question

2004-02-02 Thread Jeremy Allison
On Mon, Feb 02, 2004 at 02:12:16PM -0600, Thomas Hannan wrote:
 This is exactly the case -- I want it to NOT pass down a 64 bit lock to
 fcntl but it does. I unfortunately have no alternative but to re-export
 an NFS mount (v3 on linux), and have tried to make it fail the configure
 test for 64 bit fcntl, but have not succeeded. (in the configure script,
 I simply made either result of the conftest for 64 bit fcntl locking set
 samba_cv_HAVE_STRUCT_FLOCK64=no) ...
 
 even when I compile after telling it that I don't have 64bit locking, i
 still get loads of errors in my syslog from smbd
 locking/posix.c:posix_fcntl_lock(656) an No locks available error. This
 can happen when using 64 bit offsets  
 
 I wish I could find a way to not have to re-export an NFS mount, but
 there's no way around it and I know that when I tested with an old 2.2
 binary that it worked beautifully, but I wasn't able to use any of the
 new features in 3.0, or test out new RC versions...

You could try doing the configure in the NFS mounted directory. I think
configure runs the tests in the current directory. Then the 64-bit locking
tests should fail and Samba should set itself up as only supporting
32-bit signed locks.

Jeremy.
-- 
To unsubscribe from this list go to the following URL and read the
instructions:  http://lists.samba.org/mailman/listinfo/samba


Re: [Samba] A samba locking question

2004-02-02 Thread Thomas Hannan
The builds themselves are done in an NFS mount 
ls -l :
/usr/local/src/samba-3.0.1 - /var/archive/globauth/samba-3.0.1
mount :
triton:/var/archive on /var/archive type nfs
(rw,vers=3,wsize=16384,rsize=16384,hard,intr,addr=192.168.1.50)

could it possibly be executing the tests in /tmp, or maybe could this
actually be a bug in the configure test? 

I don't know if there are still any bugs in Redhat's build environment,
but just in case, the machine that I'm building Samba on is a RH7.3
system with the latest glibc 2.2.5-34 patch that RH issued, gcc 2.96-110
and a slightly older kernel (2.4.18-3). I don't have a Debian or any
other *nix server here for that matter to test on. 

Thanks,
Thomas

On Mon, 2004-02-02 at 14:08, Jeremy Allison wrote:
 On Mon, Feb 02, 2004 at 02:12:16PM -0600, Thomas Hannan wrote:
  This is exactly the case -- I want it to NOT pass down a 64 bit lock to
  fcntl but it does. I unfortunately have no alternative but to re-export
  an NFS mount (v3 on linux), and have tried to make it fail the configure
  test for 64 bit fcntl, but have not succeeded. (in the configure script,
  I simply made either result of the conftest for 64 bit fcntl locking set
  samba_cv_HAVE_STRUCT_FLOCK64=no) ...
  
  even when I compile after telling it that I don't have 64bit locking, i
  still get loads of errors in my syslog from smbd
  locking/posix.c:posix_fcntl_lock(656) an No locks available error. This
  can happen when using 64 bit offsets  
  
  I wish I could find a way to not have to re-export an NFS mount, but
  there's no way around it and I know that when I tested with an old 2.2
  binary that it worked beautifully, but I wasn't able to use any of the
  new features in 3.0, or test out new RC versions...
 
 You could try doing the configure in the NFS mounted directory. I think
 configure runs the tests in the current directory. Then the 64-bit locking
 tests should fail and Samba should set itself up as only supporting
 32-bit signed locks.
 
 Jeremy.


-- 
To unsubscribe from this list go to the following URL and read the
instructions:  http://lists.samba.org/mailman/listinfo/samba


Re: [Samba] A samba locking question

2004-01-30 Thread Andrew Bartlett
On Thu, 2004-01-29 at 23:55, Patrik Gustavsson wrote:
 Hi,
 
 Maybe this is a stupid question, but any way
 
 Will samba use fcntl locking if level 1 and 2 oplocks is
 disabled and samba is not compiled with spin-locks enabled ?
 
 I am using Samba on solaris

Samba uses fcntl() locking in two places.  Firstly, it is used to mirror
SMB locks, asked for by the client.  Secondly they are used to mediate
access to tdbs.

Spinlocks are an alternative (if much less reliable) method for tdb
mediation.  

oplocks do not override fcntl locks - but clients that have successfully
gained an oplock might not ask for an SMB lock, and therefore Samba
might not attempt to gain the matching fcntl() lock.

The nasty performance issues in Solaris are due to bad fcntl() lock
contention performance in Samba's TDB access.  

Andrew Bartlett

-- 
Andrew Bartlett [EMAIL PROTECTED]
Manager, Authentication Subsystems, Samba Team  [EMAIL PROTECTED]
Student Network Administrator, Hawker College   [EMAIL PROTECTED]
http://samba.org http://build.samba.org http://hawkerc.net


signature.asc
Description: This is a digitally signed message part
-- 
To unsubscribe from this list go to the following URL and read the
instructions:  http://lists.samba.org/mailman/listinfo/samba

[Samba] A samba locking question

2004-01-29 Thread Patrik Gustavsson
Hi,

Maybe this is a stupid question, but any way

Will samba use fcntl locking if level 1 and 2 oplocks is
disabled and samba is not compiled with spin-locks enabled ?

I am using Samba on solaris

/Patrik
-- 
In a world without fences who needs Gates
Patrik Gustavsson, Senior Technical Consultant
[EMAIL PROTECTED] Telephone: +46 60 671540
http://glen.swedenMobile: +46 70 3551040
SUN MICROSYSTEMS  Fax: +46 60 671550
--


-- 
To unsubscribe from this list go to the following URL and read the
instructions:  http://lists.samba.org/mailman/listinfo/samba