Re: [PATCH 1/6] CIFS: Make cifsFileInfo_put work with strict cache mode

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



2010/11/19 Jeff Layton <jlayton@xxxxxxxxxx>:
> On Fri, 19 Nov 2010 14:55:57 +0300
> I don't think we should apply any patches to fix a problem that we
> don't really understand. If it mostly goes away with cifsFYI turned on
> then it sounds like a race condition of some sort. It looks like
> invalidate_inode_pages2 invalidates locked pages whereas
> invalidate_remote_inode doesn't, so that may be a hint, or it could
> just change the timing of the race.
>
> You'll need to ascertain the nature of the race to ensure that the fix
> is really fixing the problem and not just papering over the bug.
>

I checked all the lock/unlock calls for pages in CIFS code and didn't
find any problem places. I added debug message that shows how many
pages invalidate_remote_inode invalidates and for wrong case it is 0:

 /home/piastry/git/cifs-2.6/fs/cifs/file.c: CIFS VFS: in cifs_close as
Xid: 1922 with uid: 500
 /home/piastry/git/cifs-2.6/fs/cifs/cifssmb.c: In CIFSSMBClose
 /home/piastry/git/cifs-2.6/fs/cifs/transport.c: For smb_command 4
 /home/piastry/git/cifs-2.6/fs/cifs/transport.c: Sending smb:  total_len 45
 /home/piastry/git/cifs-2.6/fs/cifs/connect.c: rfc1002 length 0x27
 /home/piastry/git/cifs-2.6/fs/cifs/file.c: closing last open instance
for inode e2402828
 /home/piastry/git/cifs-2.6/fs/cifs/file.c: CIFS VFS: leaving
cifs_close (xid = 1922) rc = 0
 /home/piastry/git/cifs-2.6/fs/cifs/inode.c: CIFS VFS: in
cifs_revalidate as Xid: 1923 with uid: 500
 /home/piastry/git/cifs-2.6/fs/cifs/inode.c: Revalidate: /_test4321_
inode 0xe2402690 count 1 dentry: 0xf6f0b550 d_time 1962130 jiffies
2313421
 /home/piastry/git/cifs-2.6/fs/cifs/file.c: CIFS VFS: in
cifs_writepages as Xid: 1924 with uid: 500
 /home/piastry/git/cifs-2.6/fs/cifs/file.c: CIFS VFS: leaving
cifs_writepages (xid = 1924) rc = 0
 /home/piastry/git/cifs-2.6/fs/cifs/inode.c: invalidating remote inode
since open detected it changed
 /home/piastry/git/cifs-2.6/fs/cifs/inode.c: invalidate returned: 0
 ^^^
 /home/piastry/git/cifs-2.6/fs/cifs/inode.c: CIFS VFS: leaving
cifs_revalidate (xid = 1923) rc = 0
 /home/piastry/git/cifs-2.6/fs/cifs/file.c: CIFS VFS: in cifs_open as
Xid: 1925 with uid: 500
 /home/piastry/git/cifs-2.6/fs/cifs/file.c: inode = 0xe2402690 file
flags are 0x8000 for /_test4321_

For right cases it is "invalidate returned: 1". This message was taken
from dmesg after a run of my python script I posted before.

So, the page can be locked and then successfully unlocked by VFS
(because invalidate_inode_pages2 locks a page before processing it).
Anyway I think we shouldn't use invalidate_remote_inode at all - we
can miss pages that are under some VFS process. In this case
invalidate_inode_pages2 is ok - I don't think it can break any things.

-- 
Best regards,
Pavel Shilovsky.
--
To unsubscribe from this list: send the line "unsubscribe linux-cifs" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux