CIFS: Make cifsFileInfo_put work with strict cache mode (try #3)
Subsystems (2)
PATCH 1/1 CIFS: Make cifsFileInfo_put work with strict cache mode (try #3)
On strict cache mode when we close the last file handle of the inode we should set invalid_mapping flag on this inode to prevent data coherency problem when we open it again but it has been modified by other clients.
--- fs/cifs/cifs_fs_sb.h | 1 + fs/cifs/file.c | 8 ++++++++ 2 files changed, 9 insertions(+), 0 deletions(-)
fs/cifs/cifs_fs_sb.h +1 -0
@@ -40,6 +40,7 @@#define CIFS_MOUNT_FSCACHE 0x8000/* local caching enabled */ #define CIFS_MOUNT_MF_SYMLINKS 0x10000/* Minshall+French Symlinks enabled */ #define CIFS_MOUNT_MULTIUSER 0x20000/* multiuser mount */ +#define CIFS_MOUNT_STRICT_IO 0x40000/* strict cache mode */ struct cifs_sb_info {struct rb_root tlink_tree;
fs/cifs/file.c +8 -0
@@ -264,6 +264,7 @@ void cifsFileInfo_put(struct cifsFileInfo *cifs_file)struct inode *inode = cifs_file->dentry->d_inode;struct cifsTconInfo *tcon =tlink_tcon (cifs_file->tlink);struct cifsInodeInfo *cifsi =CIFS_I (inode); +struct cifs_sb_info *cifs_sb =CIFS_SB (inode->i_sb);struct cifsLockInfo *li, *tmp;spin_lock (&cifs_file_list_lock);
@@ -279,6 +280,13 @@ void cifsFileInfo_put(struct cifsFileInfo *cifs_file)if (list_empty (&cifsi->openFileList)) {cFYI (1 ,"closing last open instance for inode %p" , cifs_file->dentry->d_inode); + +/* in strict cache mode we need invalidate mapping on the last +close because it may cause a error when we open this file +again and get at least level II oplock */ +if (cifs_sb->mnt_cifs_flags &CIFS_MOUNT_STRICT_IO ) +CIFS_I (inode)->invalid_mapping = true; +cifs_set_oplock_level (cifsi,0 ); }spin_unlock (&cifs_file_list_lock);
Signature · 1 line
1.7.3.2
A message that is not in the archive (sent off-list or not yet received): 1290368618-12918-1-git-send-email-piastryyy-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org
2010/11/21 Pavel Shilovsky <[email protected]>:
Quoted 4 lines
On strict cache mode when we close the last file handle of the inode we should set
invalid_mappingflag on this inode to prevent data coherency problem when we open it again but it has been modified by other clients.
What's about this patch and other strictcache mode related things?
Signature · 2 lines
Best regards, Pavel Shilovsky.
A message that is not in the archive (sent off-list or not yet received): AANLkTikhDHcSK2p6UJKtTS4rNq-bMWDarYd=PTHg-TUN-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org
Quoted 8 lines · On Thu, 25 Nov 2010 13:51:29 +0300 Pavel Shilovsky…
2010/11/21 Pavel Shilovsky <[email protected]>:
Quoted 4 lines
On strict cache mode when we close the last file handle of the inode we should set
invalid_mappingflag on this inode to prevent data coherency problem when we open it again but it has been modified by other clients.What's about this patch and other strictcache mode related things?
I'm not sure which ones need review at this point. Perhaps it would be best to re-post the set? If you do, make sure to attach Reviewed-by/Acked-by tags on patches that have already been reviewed.
Thanks,
Signature · 1 line
Jeff Layton <[email protected]>
A message that is not in the archive (sent off-list or not yet received): 20101127073116.20f3a064-9yPaYZwiELC+kQycOl6kW4xkIHaj4LzF@public.gmane.org
2010/11/27 Jeff Layton <[email protected]>:
Quoted 9 lines
Quoted 6 lines · On Thu, 25 Nov 2010 13:51:29 +0300 Pavel Shilovsky…
2010/11/21 Pavel Shilovsky <[email protected]>:
Quoted 4 lines
On strict cache mode when we close the last file handle of the inode we should set
invalid_mappingflag on this inode to prevent data coherency problem when we open it again but it has been modified by other clients.
Quoted 7 lines
Quoted 2 lines
What's about this patch and other strictcache mode related things?
I'm not sure which ones need review at this point. Perhaps it would be best to re-post the set? If you do, make sure to attach Reviewed-by/Acked-by tags on patches that have already been reviewed.
Ok, it isn't a problem. Another problem that no one from the series got Reviewed-by/Acked-by tags :)
So, I have several separate set of patches (strict cache, ip_connect/port, cifs_open) - let's finised with them in the order, because I am a bit confused about it. May be I shouldn't post second and third rewritten set until we deal with the first successfully?
In general, I am not think that I understand correctly all the process of linux kernel cifs client contributing, can you explain the main points or point to a appropriate link, please?
Signature · 2 lines
Best regards, Pavel Shilovsky.
A message that is not in the archive (sent off-list or not yet received): AANLkTimCW5_=0LGCds9-0whUyMcjZ5ZRSjTHaXRW9sjN-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org
Quoted 18 lines · On Sun, 28 Nov 2010 11:11:28 +0300 Pavel Shilovsky…
2010/11/27 Jeff Layton <[email protected]>:
Quoted 9 lines
Quoted 6 lines · On Thu, 25 Nov 2010 13:51:29 +0300 Pavel Shilovsky…
2010/11/21 Pavel Shilovsky <[email protected]>:
Quoted 4 lines
On strict cache mode when we close the last file handle of the inode we should set
invalid_mappingflag on this inode to prevent data coherency problem when we open it again but it has been modified by other clients.Quoted 7 lines
Quoted 2 lines
What's about this patch and other strictcache mode related things?
I'm not sure which ones need review at this point. Perhaps it would be best to re-post the set? If you do, make sure to attach Reviewed-by/Acked-by tags on patches that have already been reviewed.
Quoted 8 lines
Ok, it isn't a problem. Another problem that no one from the series got Reviewed-by/Acked-by tags :)
So, I have several separate set of patches (strict cache, ip_connect/port,
cifs_open) - let's finised with them in the order, because I am a bit confused about it. May be I shouldn't post second and third rewritten set until we deal with the first successfully?
Your call. In general, I find that trying to marshal more than one or two sets of patches at a time is too confusing and labor-intensive.
Other people manage it just fine though, so it's really your preference.
Quoted 4 lines
In general, I am not think that I understand correctly all the process of linux kernel cifs client contributing, can you explain the main points or point to a appropriate link, please?
It's not a very formalized process. Basically, contributing to CIFS means getting patches into Steve's tree and having him push them to mainline.
I (and others) try to help out by reviewing the patches as they go across the list. Review is done by volunteers however and our time to spend on it is limited, so it's generally a good idea to make that job as painless as you can.
Signature · 1 line
Jeff Layton <[email protected]>
A message that is not in the archive (sent off-list or not yet received): 20101128062220.6bbebf9e-9yPaYZwiELC+kQycOl6kW4xkIHaj4LzF@public.gmane.org
2010/11/28 Jeff Layton <[email protected]>:
Quoted 41 lines
Quoted 18 lines · On Sun, 28 Nov 2010 11:11:28 +0300 Pavel Shilovsky…
2010/11/27 Jeff Layton <[email protected]>:
Quoted 9 lines
Quoted 6 lines · On Thu, 25 Nov 2010 13:51:29 +0300 Pavel Shilovsky…
2010/11/21 Pavel Shilovsky <[email protected]>:
Quoted 4 lines
On strict cache mode when we close the last file handle of the inode we should set
invalid_mappingflag on this inode to prevent data coherency problem when we open it again but it has been modified by other clients.Quoted 7 lines
Quoted 2 lines
What's about this patch and other strictcache mode related things?
I'm not sure which ones need review at this point. Perhaps it would be best to re-post the set? If you do, make sure to attach Reviewed-by/Acked-by tags on patches that have already been reviewed.
Quoted 8 lines
Ok, it isn't a problem. Another problem that no one from the series got Reviewed-by/Acked-by tags :)
So, I have several separate set of patches (strict cache, ip_connect/port,
cifs_open) - let's finised with them in the order, because I am a bit confused about it. May be I shouldn't post second and third rewritten set until we deal with the first successfully?Your call. In general, I find that trying to marshal more than one or two sets of patches at a time is too confusing and labor-intensive.
Other people manage it just fine though, so it's really your preference.
Quoted 4 lines
In general, I am not think that I understand correctly all the process of linux kernel cifs client contributing, can you explain the main points or point to a appropriate link, please?
Quoted 9 lines
It's not a very formalized process. Basically, contributing to CIFS means getting patches into Steve's tree and having him push them to mainline.
I (and others) try to help out by reviewing the patches as they go across the list. Review is done by volunteers however and our time to spend on it is limited, so it's generally a good idea to make that job as painless as you can.
Ok, thank you!
Signature · 2 lines
Best regards, Pavel Shilovsky.