All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/6] Introducing new strict cache mode (try #5)
@ 2010-11-10 15:41 Pavel Shilovsky
       [not found] ` <1289403711-12965-1-git-send-email-piastryyy-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
  0 siblings, 1 reply; 17+ messages in thread
From: Pavel Shilovsky @ 2010-11-10 15:41 UTC (permalink / raw)
  To: linux-cifs-u79uwXL29TY76Z2rM5mHXA

Here are new set of patches. I made changes according to Jeff's notices and fix bugs in fsync and mmap.

Pavel Shilovsky (6):
  CIFS: Make cifsFileInfo_put work with strict cache mode
  CIFS: Make read call work with strict cache mode
  CIFS: Make write call work with strict cache mode
  CIFS: Make cifs_fsync work with strict cache mode
  CIFS: Make cifs_file_map work with strict cache mode
  CIFS: Add strictcache mount option

 fs/cifs/README       |    5 +++
 fs/cifs/cifs_fs_sb.h |    1 +
 fs/cifs/cifsfs.c     |   71 +++++++++++++++++++++++++++++++++++++++++++++----
 fs/cifs/connect.c    |    5 +++
 fs/cifs/file.c       |   62 +++++++++++++++++++++++++++++++++----------
 5 files changed, 124 insertions(+), 20 deletions(-)

-- 
1.7.2.3

^ permalink raw reply	[flat|nested] 17+ messages in thread
* [PATCH 1/6] CIFS: Make cifsFileInfo_put work with strict cache mode
@ 2010-12-14 11:10 Pavel Shilovsky
       [not found] ` <1292325060-8828-1-git-send-email-piastryyy-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
  0 siblings, 1 reply; 17+ messages in thread
From: Pavel Shilovsky @ 2010-12-14 11:10 UTC (permalink / raw)
  To: linux-cifs-u79uwXL29TY76Z2rM5mHXA

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.

Signed-off-by: Pavel Shilovsky <piastryyy-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
Reviewed-by: Jeff Layton <jlayton-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
---
 fs/cifs/cifs_fs_sb.h |    1 +
 fs/cifs/file.c       |    8 ++++++++
 2 files changed, 9 insertions(+), 0 deletions(-)

diff --git a/fs/cifs/cifs_fs_sb.h b/fs/cifs/cifs_fs_sb.h
index 7852cd6..ac51cd2 100644
--- a/fs/cifs/cifs_fs_sb.h
+++ b/fs/cifs/cifs_fs_sb.h
@@ -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;
diff --git a/fs/cifs/file.c b/fs/cifs/file.c
index 5a28660..60c3f84 100644
--- a/fs/cifs/file.c
+++ b/fs/cifs/file.c
@@ -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);
-- 
1.7.3.2

^ permalink raw reply related	[flat|nested] 17+ messages in thread
* [PATCH 0/6] Introducing new strict cache mode (try #4)
@ 2010-11-05  8:29 Pavel Shilovsky
       [not found] ` <1288945777-9197-1-git-send-email-piastryyy-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
  0 siblings, 1 reply; 17+ messages in thread
From: Pavel Shilovsky @ 2010-11-05  8:29 UTC (permalink / raw)
  To: linux-cifs-u79uwXL29TY76Z2rM5mHXA

I add new ones (fsync, mmap) and modified previous patches (read, write, close) and their descriptions. Here is the complete set of them.

Pavel Shilovsky (6):
  CIFS: Make cifsFileInfo_put work with strict cache mode
  CIFS: Make read call work with strict cache mode
  CIFS: Make write call work with strict cache mode
  CIFS: Make cifs_fsync work with strict cache mode
  CIFS: Make cifs_file_map work with strict cache mode
  CIFS: Add strictcache mount option

 fs/cifs/README       |    5 +++
 fs/cifs/cifs_fs_sb.h |    1 +
 fs/cifs/cifsfs.c     |   79 +++++++++++++++++++++++++++++++++++++++++++++----
 fs/cifs/connect.c    |    5 +++
 fs/cifs/file.c       |   54 +++++++++++++++++++++++++---------
 5 files changed, 123 insertions(+), 21 deletions(-)

-- 
1.7.2.3

^ permalink raw reply	[flat|nested] 17+ messages in thread

end of thread, other threads:[~2010-12-14 14:50 UTC | newest]

Thread overview: 17+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-11-10 15:41 [PATCH 0/6] Introducing new strict cache mode (try #5) Pavel Shilovsky
     [not found] ` <1289403711-12965-1-git-send-email-piastryyy-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2010-11-10 15:41   ` [PATCH 1/6] CIFS: Make cifsFileInfo_put work with strict cache mode Pavel Shilovsky
     [not found]     ` <1289403711-12965-2-git-send-email-piastryyy-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2010-11-13 12:07       ` Jeff Layton
     [not found]         ` <20101113070735.060ac5ca-9yPaYZwiELC+kQycOl6kW4xkIHaj4LzF@public.gmane.org>
2010-11-13 18:07           ` Pavel Shilovsky
2010-11-10 15:41   ` [PATCH 2/6] CIFS: Make read call " Pavel Shilovsky
2010-11-10 15:41   ` [PATCH 3/6] CIFS: Make write " Pavel Shilovsky
     [not found]     ` <1289403711-12965-4-git-send-email-piastryyy-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2010-11-10 15:50       ` Pavel Shilovsky
     [not found]         ` <1289404251-13066-1-git-send-email-piastryyy-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2010-11-10 15:54           ` Pavel Shilovsky
2010-11-10 15:41   ` [PATCH 4/6] CIFS: Make cifs_fsync " Pavel Shilovsky
     [not found]     ` <1289403711-12965-5-git-send-email-piastryyy-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2010-11-14  6:13       ` Pavel Shilovsky
     [not found]         ` <1289715224-2517-1-git-send-email-piastryyy-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2010-11-14  9:02           ` Pavel Shilovsky
2010-11-10 15:41   ` [PATCH 5/6] CIFS: Make cifs_file_map " Pavel Shilovsky
2010-11-10 15:41   ` [PATCH 6/6] CIFS: Add strictcache mount option Pavel Shilovsky
     [not found]     ` <1289403711-12965-7-git-send-email-piastryyy-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2010-11-18 17:28       ` Suresh Jayaraman
  -- strict thread matches above, loose matches on Subject: below --
2010-12-14 11:10 [PATCH 1/6] CIFS: Make cifsFileInfo_put work with strict cache mode Pavel Shilovsky
     [not found] ` <1292325060-8828-1-git-send-email-piastryyy-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2010-12-14 11:11   ` [PATCH 6/6] CIFS: Add strictcache mount option Pavel Shilovsky
     [not found]     ` <1292325060-8828-6-git-send-email-piastryyy-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2010-12-14 14:50       ` Jeff Layton
2010-11-05  8:29 [PATCH 0/6] Introducing new strict cache mode (try #4) Pavel Shilovsky
     [not found] ` <1288945777-9197-1-git-send-email-piastryyy-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2010-11-05  8:29   ` [PATCH 6/6] CIFS: Add strictcache mount option Pavel Shilovsky

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.