Bug#483216: sqlite3: sqlite fails to update dbs used from a CIFS mount

2008-05-28 Thread Florian Weimer
* Daniel Kahn Gillmor:

 This bug is also reported to ubuntu, fwiw:

   https://bugs.launchpad.net/ubuntu/+source/samba/+bug/117730

This looks like cifs not providing POSIX file system semantics.  I dont
know if this ia bug, or an inherent protocol limitation.



-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of unsubscribe. Trouble? Contact [EMAIL PROTECTED]



Bug#483216: sqlite3: sqlite fails to update dbs used from a CIFS mount

2008-05-28 Thread Daniel Kahn Gillmor
On Wed 2008-05-28 15:08:36 -0400, Florian Weimer wrote:

 * Daniel Kahn Gillmor:

 This bug is also reported to ubuntu, fwiw:

   https://bugs.launchpad.net/ubuntu/+source/samba/+bug/117730

 This looks like cifs not providing POSIX file system semantics.  I
 dont know if this ia bug, or an inherent protocol limitation.

I agree that this is one possible interpretation of the problem, but
SQLite does *not* exhibit the same problem when it is run on Windows
clients using data directories that are network mapped via CIFS from
the same samba server.  Instead, it is able to read and write the
testdb without a problem.

So either the sqlite build for Windows doesn't internally depend on
those filesystem semantics, or there's a way to work around them on
Windows.  Maybe it's possible for SQLite in debian (and other unices)
to use the same workaround if it detects that it's working on CIFS?
Or maybe this is a bug in cifs.mount?  Or maybe a bug in the kernel's
cifs.ko?  Or in samba itself somehow?  I'd be happy to get pointed in
the right direction about where to get started fixing this.  (i'd be
even happier to be able to ditch CIFS, but that's not politically
feasible)

This bug is pretty serious because it's likely to strand users with
CIFS-exported home directories once Firefox 3 replaces Firefox 2.
It's already causing breakages in CIFS-homedir environments under
Ubuntu 8.04, and in debian with other apps that use SQLite
(e.g. f-spot, django, etc).

Thanks for the feedback and for any other direction or advice you can
give.

Regards,

   --dkg


pgpRJe1xIRSXz.pgp
Description: PGP signature


Bug#483216: sqlite3: sqlite fails to update dbs used from a CIFS mount

2008-05-28 Thread Laszlo Boszormenyi
package sqlite3
tags 483216 + wontfix
thanks

Hi,

On Tue, 2008-05-27 at 16:23 -0400, Daniel Kahn Gillmor wrote:
 SQLite works fine when used on most filesystems, but it seems to choke
 when used on a cifs-mounted filesystem.
 This is a known 'bug'[1] in SQLite3. There is a workaround, quoting:
You can work around the problem by compiling with
-DSQLITE_DISABLE_DIRSYNC=1.

But the webpage also states: SQLite appears to be doing the right thing
here. The bug appears to be OpenWRT-Linux, not in SQLite.

Using the mentioned workaround is very risky:
That macro disables the directory syncing logic. But then if you lose
power at exactly the wrong moment and your rollback journal vanishes (or
gets moved to /lost+found) and your database is corrupted - don't
complain. I better solution, it seems, would be to fix OpenWRT-Linux..

As for now, I don't want to make this risk to all of our users, tagging
this bug as wontfix.

Regards,
Laszlo/GCS
[1] http://sqlite.org/cvstrac/tktview?tn=1751




-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of unsubscribe. Trouble? Contact [EMAIL PROTECTED]



Bug#483216: sqlite3: sqlite fails to update dbs used from a CIFS mount

2008-05-28 Thread Daniel Kahn Gillmor
Ah: a bit more information after reading fcntl64(2) and mount.cifs(8),
noticing that the mand flag was present in /proc/mounts for the CIFS
mount, and some more testing:

I'm able to successfully perform the record insertion if i mount the
CIFS share with the nobrl option.  When i mount it with nobrl, the
mand flag in the /proc/mounts line disappears.  The record insertion
works whether or not i've build libsqlite3 with
-DSQLITE_DISABLE_DIRSYNC=1, so that particular concern appears to be
unrelated (note that the fsync() call still fails with DIRSYNC
enabled, but sqlite appears to just plow ahead).

From mount.cifs(8):

  nobrl
  Do not send byte range lock requests to the server. This is
  necessary for certain applications that break with cifs
  style mandatory byte range locks (and most cifs servers do
  not yet support requesting advisory byte range locks).

Does this mean that SQLite (and any application which uses it) are
those certain applications?

Or is there a bug in SQLite in the way that it uses locks?  Or a bug
in the cifs kernel module?

   --dkg


pgpQloU7c8boA.pgp
Description: PGP signature


Bug#483216: sqlite3: sqlite fails to update dbs used from a CIFS mount

2008-05-27 Thread Daniel Kahn Gillmor
Package: sqlite3
Version: 3.5.8-4
Severity: normal

SQLite works fine when used on most filesystems, but it seems to choke
when used on a cifs-mounted filesystem.

In the test below, i'm connecting to a debian etch (3.0.24-6etch9)
samba server running on bob (the leading number in the prompt is the
return code from the previous command):

[0 [EMAIL PROTECTED] ~]$ mount | egrep '/(tmp|mnt)'
/tmp on /tmp type tmpfs (rw,nosuid,nodev)
//bob/dmz on /mnt type cifs 
(rw,mand,unc=\\bob\dmz,username=,uid=1000,posixpaths,rsize=16384,wsize=57344)
[0 [EMAIL PROTECTED] ~]$ rm -f /tmp/testdb 
[0 [EMAIL PROTECTED] ~]$ echo 'create table foo (x int); insert into foo (x) 
values (1);' | sqlite3 /tmp/testdb
[0 [EMAIL PROTECTED] ~]$ echo 'select * from foo;' | sqlite3 /tmp/testdb
1
[0 [EMAIL PROTECTED] ~]$ cp /tmp/testdb /mnt/testdb
cp: overwrite `/mnt/testdb'? y
[0 [EMAIL PROTECTED] ~]$ echo 'select * from foo;' | sqlite3 /mnt/testdb
1
[0 [EMAIL PROTECTED] ~]$ echo 'insert into foo (x) values (2);' | sqlite3 
/tmp/testdb
[0 [EMAIL PROTECTED] ~]$ echo 'insert into foo (x) values (2);' | sqlite3 
/mnt/testdb
SQL error near line 1: database is locked
[1 [EMAIL PROTECTED] ~]$ echo 'select * from foo;' | sqlite3 /tmp/testdb
1
2
[0 [EMAIL PROTECTED] ~]$ echo 'select * from foo;' | sqlite3 /mnt/testdb
1
[0 [EMAIL PROTECTED] ~]$ 


I'm using mount.cifs on the client from lenny:

[0 [EMAIL PROTECTED] ~]$ dpkg -l smbfs
Desired=Unknown/Install/Remove/Purge/Hold
| Status=Not/Inst/Cfg-files/Unpacked/Failed-cfg/Half-inst/trig-aWait/Trig-pend
|/ Err?=(none)/Hold/Reinst-required/X=both-problems (Status,Err: uppercase=bad)
||/ Name   VersionDescription
+++-==-==-
ii  smbfs  1:3.0.28a-3mount and umount commands for the smbfs (for
[0 [EMAIL PROTECTED] ~]$ 


This combination is a bad one as sqlite starts to be used more widely.
In particular, firefox v3 uses sqlite internally, so any institutions
using CIFS-mounted home directories will find firefox3 failing for
their users.

This bug is also reported to ubuntu, fwiw:

  https://bugs.launchpad.net/ubuntu/+source/samba/+bug/117730

Thanks for maintaining sqlite3 in debian,

   --dkg

-- System Information:
Debian Release: lenny/sid
  APT prefers testing
  APT policy: (500, 'testing'), (200, 'unstable'), (101, 'experimental')
Architecture: i386 (i686)

Kernel: Linux 2.6.24-1-686 (SMP w/1 CPU core)
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/bash

Versions of packages sqlite3 depends on:
ii  libc6 2.7-10 GNU C Library: Shared libraries
ii  libreadline5  5.2-3  GNU readline and history libraries
ii  libsqlite3-0  3.5.8-4SQLite 3 shared library

sqlite3 recommends no packages.

-- no debconf information



-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of unsubscribe. Trouble? Contact [EMAIL PROTECTED]