[linux-cifs-client] Re: cifs caching problem fixed? and GENERIC_WRITE vs. GENERIC_ALL fix pushed to 2.4 cvs

Ian ian at gallowit.com
Wed Feb 4 16:41:44 GMT 2004


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Steve,
~    Is this the cause of the odd vi behaviour? I ran some more tests and
discovered that vi will behave oddly whether the file being edited is
new or not.

Steve French wrote:

| Ian, Thanks, trying 2.4.24 at current cvs level I see the problem
| with the date and time stamps on 2.4 (the 2.4 and 2.6 logic for
| creating files is very different due to the more efficient "lookup
| intent" changes in 2.6 so I can see why 2.6 would not have this
| problem).   There are actually (at least) 3 setpathinfo calls caused
| indirectly in executing the "touch" command in 2.4 due in part to the
|  strange way that create is broken into multiple pieces in
| implemented in the VFS.   Of three date/time stamps fields on a file
| - the create and access ones are getting overwritten while the modify
|  one is ok (they look fine until the third (!) setpathinfo - in which
|  it looks like the correct values are shifted and partially
| overwritten with zeros.  Am investigating. Interestingly the date and
|  time stamps are ok on the file most of the way through the trace
| (frame 20 out of 25 sets it to the incorrect value, but it is fine
| until that point).
|
| On Tue, 2004-02-03 at 07:49, Ian wrote:
|
|> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1
|>
|> HI ~    I tried the fixes this morning and found that the odd
|> permission problem had been solved however, I found that this has
|> broken something else. Here is the test I ran
|>
|> [iamess at strider NT]$ ls -l test ls: test: No such file or directory
|>  [iamess at strider NT]$ touch test [iamess at strider NT]$ ls -l test -
|> -rw-rw-rw-    1 iamess   iamess          0 Aug  9  2037 test (note
|> date) [iamess at strider NT]$ vi test
|>
|> E325: ATTENTION Found a swap file by the name ".test.swp" ~ owned
|> by: iamess   dated: Tue Feb  3 12:06:34 2004 ~ [cannot be read]
|> While opening file "test" ~             dated: Sun Aug  9 14:26:34
|> 2037 ~      NEWER than swap file!
|>
|> (1) Another program may be editing the same file. ~    If this is
|> the case, be careful not to end up with two ~    different
|> instances of the same file when making changes. ~    Quit, or
|> continue with caution.
|>
|> (2) An edit session for this file crashed. ~    If this is the
|> case, use ":recover" or "vim -r test" ~    to recover the changes
|> (see ":help recovery"). ~    If you did this already, delete the
|> swap file ".test.swp" ~    to avoid this message.
|>
|> Swap file ".test.swp" already exists! [O]pen Read-Only, (E)dit
|> anyway, (R)ecover, (Q)uit, (D)elete it:
|>
|> ~    Chose to Delete file vi returns an emptly file ~    Entered
|> some text
|>
|> [iamess at strider NT]$ ls -l test* - -rw-rw-rw-    1 iamess   iamess
|> 16 Feb  3 13:44 test - -rw-rw-rw-    1 iamess   iamess          0
|> Feb  3 13:44 test~ [iamess at strider NT]$ ls -l .test* - -rw-rw-rw- 1
|>  iamess   iamess          0 Feb  3 13:43 .test.swp - -rw-rw-rw- 1
|> iamess   iamess          0 Feb  3 13:41 .test.swpx
|>
|> ~    I'm guessing but it seems that an open request is being made
|> at least twice.
|>
|> Cheers, Ian
|>
|> Steve French wrote:
|>
|> |Howard, |See below - this seems to work now based on my tests on
|> 2.6 which has |the identical code in these routines to 2.4.  The
|> caching/oplock problem |no longer fails with the minor change to
|> cifsfs.c that I made today and |pushed in the
|> bk://cifs.bkbits.net/linux-2.5cifs 2.6 development tree (I |also
|> backported them to the 2.4 cvs version in samba.org cvs but they
|> |have not been tested yet on 2.4).  The 2.4 code now includes the
|> fix Ian |was asking about as well (for the odd share permissions
|> access denied). | |/localhost/stevef on /mnt type cifs (0)
|> |stevef95:/home/stevef/bk/linux-2.5cifs # ls -l /mnt/foo |ls:
|> /mnt/foo: No such file or directory
|> |stevef95:/home/stevef/bk/linux-2.5cifs # touch !$ |touch /mnt/foo
|> |stevef95:/home/stevef/bk/linux-2.5cifs # ls -l /mnt/foo
|> |-rwxrwxrwx    1 stevef   users           0 2004-02-02 18:24
|> /mnt/foo |stevef95:/home/stevef/bk/linux-2.5cifs # rm /mnt/foo
|> |stevef95:/home/stevef/bk/linux-2.5cifs # echo "This is the client"
|>
|>
|>> |/mnt/foo |stevef95:/home/stevef/bk/linux-2.5cifs # ls -l
|> /mnt/foo |-rwxrwxrwx    1 stevef   users          19 2004-02-02
|> 18:25 /mnt/foo |stevef95:/home/stevef/bk/linux-2.5cifs # echo "look
|>  at server version of |file now" |look at server version of file
|> now |stevef95:/home/stevef/bk/linux-2.5cifs # ls -l
|> /data/pchome/stevef/foo |-rwxrwxrwx    1 stevef   users          19
|>  2004-02-02 18:25 |/data/pchome/stevef/foo
|> |stevef95:/home/stevef/bk/linux-2.5cifs # cat
|> /data/pchome/stevef/foo |This is the client
|> |stevef95:/home/stevef/bk/linux-2.5cifs # perl -pi -e
|> 's/client/server/' |/data/pchome/stevef/foo
|> |stevef95:/home/stevef/bk/linux-2.5cifs # cat
|> /data/pchome/stevef/foo |This is the server
|> |stevef95:/home/stevef/bk/linux-2.5cifs # echo "Back to client view
|>  of |file" |Back to client view of file
|> |stevef95:/home/stevef/bk/linux-2.5cifs # cat /mnt/foo |This is the
|>  server |stevef95:/home/stevef/bk/linux-2.5cifs # touch !$ |touch
|> /mnt/foo |stevef95:/home/stevef/bk/linux-2.5cifs # ls -l /mnt/foo
|> |-rwxrwxrwx    1 stevef   users          19 2004-02-02 18:27
|> /mnt/foo |stevef95:/home/stevef/bk/linux-2.5cifs # cat /mnt/foo
|> |This is the server |stevef95:/home/stevef/bk/linux-2.5cifs # toch
|> /mnt/foo |bash: toch: command not found
|> |stevef95:/home/stevef/bk/linux-2.5cifs # cat /mnt/foo |This is the
|>  server |stevef95:/home/stevef/bk/linux-2.5cifs #
|> /usr/local/samba/sbin/smbd -V |Version CVS 3.0.1pre1
|> |stevef95:/home/stevef/bk/linux-2.5cifs # | | |Then same test with
|> oplock enabled (default) | |stevef95:/home/stevef/bk/linux-2.5cifs
|> # cat /proc/fs/cifs/OplockEnabled |1
|> |stevef95:/home/stevef/bk/linux-2.5cifs # ls -l /mnt/foo1 |ls:
|> /mnt/foo1: No such file or directory
|> |stevef95:/home/stevef/bk/linux-2.5cifs # touch !$ |touch /mnt/foo1
|>  |stevef95:/home/stevef/bk/linux-2.5cifs # ls -l /mnt/foo1
|> |-rwxrwxrwx    1 stevef   users           0 2004-02-02 18:30
|> /mnt/foo1 |stevef95:/home/stevef/bk/linux-2.5cifs # rm !$ |rm
|> /mnt/foo1 |stevef95:/home/stevef/bk/linux-2.5cifs # echo "This is
|> client" > |/mnt/foo1 |stevef95:/home/stevef/bk/linux-2.5cifs # ls
|> -l /mnt/foo1 |-rwxrwxrwx    1 stevef   users          15 2004-02-02
|>  18:31 /mnt/foo1 |stevef95:/home/stevef/bk/linux-2.5cifs # echo
|> "switch to server view of |same file" |switch to server view of
|> same file |stevef95:/home/stevef/bk/linux-2.5cifs # ls -l
|> /data/pchome/stevef/foo1 |-rwxrwxrwx    1 stevef   users 15
|> 2004-02-02 18:31 |/data/pchome/stevef/foo1
|> |stevef95:/home/stevef/bk/linux-2.5cifs # cat
|> /data/pchome/stevef/foo1 |This is client
|> |stevef95:/home/stevef/bk/linux-2.5cifs # perl -pi -e
|> 's/client/server/' |/data/pchome/stevef/foo1
|> |stevef95:/home/stevef/bk/linux-2.5cifs # cat
|> /data/pchome/stevef/foo1 |This is server
|> |stevef95:/home/stevef/bk/linux-2.5cifs # echo switch to client
|> view |switch to client view |stevef95:/home/stevef/bk/linux-2.5cifs
|>  # cat /mnt/foo1 |This is server
|> |stevef95:/home/stevef/bk/linux-2.5cifs # touch !$ |touch /mnt/foo1
|>  |stevef95:/home/stevef/bk/linux-2.5cifs # ls -l /mnt/foo1
|> |-rwxrwxrwx    1 stevef   users          15 2004-02-02 18:33
|> /mnt/foo1 |stevef95:/home/stevef/bk/linux-2.5cifs # cat /mnt/foo1
|> |This is server |stevef95:/home/stevef/bk/linux-2.5cifs # touch
|> /mnt/foo1 |stevef95:/home/stevef/bk/linux-2.5cifs # cat /mnt/foo1
|> |This is server | -----BEGIN PGP SIGNATURE----- Version: GnuPG
|> v1.2.1 (GNU/Linux)
|>
|> iD8DBQFAH6cEzR2KhuAWJ/gRAtsoAJ0XallwGPnXzdPomZm6SVdamwmj/QCgwKFz
|> 2lsk74fd434D6mebpTf7kZw= =4bGd -----END PGP SIGNATURE-----
|>
|>
|>
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.1 (GNU/Linux)

iD8DBQFAISDGzR2KhuAWJ/gRAlymAKCooMHIX7JUnxXsQ3z8Wzsds+ZfzQCfbZC/
fvujf8t7hclk8v2b5VVg+sw=
=ue0g
-----END PGP SIGNATURE-----




More information about the linux-cifs-client mailing list