mirror of
https://github.com/Fishwaldo/linux-bl808.git
synced 2025-06-17 20:25:19 +00:00
Merge branch 'fscache' of git://git.kernel.org/pub/scm/linux/kernel/git/dhowells/linux-fs into linux-next
Pull fs-cache fixes from David Howells: Can you pull these commits to fix an issue with NFS whereby caching can be enabled on a file that is open for writing by subsequently opening it for reading. This can be made to crash by opening it for writing again if you're quick enough. The gist of the patchset is that the cookie should be acquired at inode creation only and subsequently enabled and disabled as appropriate (which dispenses with the backing objects when they're not needed). The extra synchronisation that NFS does can then be dispensed with as it is thenceforth managed by FS-Cache. Could you send these on to Linus? This likely will need fixing also in CIFS and 9P also once the FS-Cache changes are upstream. AFS and Ceph are probably safe. * 'fscache' of git://git.kernel.org/pub/scm/linux/kernel/git/dhowells/linux-fs: NFS: Use i_writecount to control whether to get an fscache cookie in nfs_open() FS-Cache: Provide the ability to enable/disable cookies FS-Cache: Add use/unuse/wake cookie wrappers
This commit is contained in:
commit
c698dbf9fe
23 changed files with 465 additions and 306 deletions
|
@ -122,7 +122,7 @@ void nfs_clear_inode(struct inode *inode)
|
|||
WARN_ON_ONCE(!list_empty(&NFS_I(inode)->open_files));
|
||||
nfs_zap_acl_cache(inode);
|
||||
nfs_access_zap_cache(inode);
|
||||
nfs_fscache_release_inode_cookie(inode);
|
||||
nfs_fscache_clear_inode(inode);
|
||||
}
|
||||
EXPORT_SYMBOL_GPL(nfs_clear_inode);
|
||||
|
||||
|
@ -459,7 +459,7 @@ nfs_fhget(struct super_block *sb, struct nfs_fh *fh, struct nfs_fattr *fattr, st
|
|||
nfsi->attrtimeo_timestamp = now;
|
||||
nfsi->access_cache = RB_ROOT;
|
||||
|
||||
nfs_fscache_init_inode_cookie(inode);
|
||||
nfs_fscache_init_inode(inode);
|
||||
|
||||
unlock_new_inode(inode);
|
||||
} else
|
||||
|
@ -854,7 +854,7 @@ int nfs_open(struct inode *inode, struct file *filp)
|
|||
return PTR_ERR(ctx);
|
||||
nfs_file_set_open_context(filp, ctx);
|
||||
put_nfs_open_context(ctx);
|
||||
nfs_fscache_set_inode_cookie(inode, filp);
|
||||
nfs_fscache_open_file(inode, filp);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue