Re: [PATCH 2/5] CIFS: Invalidate inode pages on the last close

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

 



On Tue, 2 Nov 2010 12:01:17 +0300
Pavel Shilovsky <piastryyy@xxxxxxxxx> wrote:

> On strict cache mode when we close the last file handle of the inode we
> should invalidate 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@xxxxxxxxx>
> ---
>  fs/cifs/cifs_fs_sb.h |    1 +
>  fs/cifs/file.c       |    3 +++
>  2 files changed, 4 insertions(+), 0 deletions(-)
> 
> diff --git a/fs/cifs/cifs_fs_sb.h b/fs/cifs/cifs_fs_sb.h
> index 525ba59..3690c50 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 radix_tree_root tlink_tree;
> diff --git a/fs/cifs/file.c b/fs/cifs/file.c
> index a566f15..3970e68 100644
> --- a/fs/cifs/file.c
> +++ b/fs/cifs/file.c
> @@ -284,6 +284,9 @@ void cifsFileInfo_put(struct cifsFileInfo *cifs_file)
>  	}
>  	spin_unlock(&cifs_file_list_lock);
> 
> +	if (cifs_sb->mnt_cifs_flags & CIFS_MOUNT_STRICT_IO)
> +		invalidate_remote_inode(inode);
> +
>  	if (!tcon->need_reconnect && !cifs_file->invalidHandle) {
>  		int xid, rc;
> 

Suppose I have this file open twice and have r/o oplocks on both
filehandles. I close one of those file descriptors and the cache is
invalidated. Is that really what we want here?

-- 
Jeff Layton <jlayton@xxxxxxxxxx>
--
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