NFS: Remove a redundant call to unmap_mapping_range()
Subsystems (2)
PATCH 1/2 NFS: Remove a redundant call to unmap_mapping_range()
We don't need to call unmap_mapping_range() prior to calling nfs_sync_mapping().
--- fs/nfs/inode.c | 1 - 1 file changed, 1 deletion(-)
fs/nfs/inode.c +0 -1
@@ -1170,7 +1170,6 @@ static int nfs_invalidate_mapping(struct inode *inode, struct address_space *mapif (mapping->nrpages !=0 ) {if (S_ISREG (inode->i_mode)) { -unmap_mapping_range (mapping,0 ,0 ,0 ); ret =nfs_sync_mapping (mapping);if (ret <0 )return ret;
Signature · 1 line
2.14.3
PATCH 2/2 NFS: Fix a race between mmap() and O_DIRECT
When locking the file in order to do O_DIRECT on it, we must unmap any mmapped ranges on the pagecache so that we can flush out the dirty data.
--- fs/nfs/io.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
fs/nfs/io.c +1 -1
@@ -99,7 +99,7 @@ static void nfs_block_buffered(struct nfs_inode *nfsi, struct inode *inode) {if (!test_bit (NFS_INO_ODIRECT , &nfsi->flags)) {set_bit (NFS_INO_ODIRECT , &nfsi->flags); -nfs_wb_all (inode); +nfs_sync_mapping (inode->i_mapping); } }
Signature · 1 line
2.14.3
Quoted 2 lines · Trond Myklebust
We don't need to call
unmap_mapping_range()prior to callingnfs_sync_mapping().
Don't we?
Doesn't that allow a process which mapped the page to dirty it immediately after nfs_sync_mapping(), without the page being reloaded from the server first?
Doesn't seem right..
Thanks,
NeilBrown
Quoted 25 lines
Signed-off-by Trond Myklebust <[email protected]>--- fs/nfs/inode.c | 1 - 1 file changed, 1 deletion(-)fs/nfs/inode.c +0
-1@@ -1170,7 +1170,6 @@ static int nfs_invalidate_mapping(struct inode *inode, struct address_space *mapif (mapping->nrpages !=0 ) {if (S_ISREG (inode->i_mode)) { -unmap_mapping_range (mapping,0 ,0 ,0 ); ret =nfs_sync_mapping (mapping);if (ret <0 )return ret;Signature · 6 lines
2.14.3 -- To unsubscribe from this list: send the line "unsubscribe linux-nfs" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
Quoted 6 lines · NeilBrown
Quoted 2 lines · Trond Myklebust
We don't need to call
unmap_mapping_range()prior to callingnfs_sync_mapping().Don't we?
See line 2 of nfs_sync_mapping(). ☺
Quoted 36 lines
Doesn't that allow a process which mapped the page to dirty it immediately after
nfs_sync_mapping(), without the page being reloaded from the server first?
Doesn't seem right..Thanks,
NeilBrownQuoted 27 lines
Signed-off-by Trond Myklebust <[email protected]>--- fs/nfs/inode.c | 1 - 1 file changed, 1 deletion(-)fs/nfs/inode.c +0
-0@@ -1170,7 +1170,6 @@ static int nfs_invalidate_mapping(structinode *inode, struct
address_space*mapfs/nfs/inode.c +0
-1if (mapping->nrpages !=0 ) {if (S_ISREG (inode->i_mode)) { -unmap_mapping_range (mapping,0 ,0 ,0 ); ret =nfs_sync_mapping (mapping);if (ret <0 )return ret;Signature · 7 lines
2.14.3 -- To unsubscribe from this list: send the line "unsubscribe linux- nfs" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
Signature · 3 lines
Trond Myklebust Linux NFS client maintainer, PrimaryData [email protected]
Quoted 9 lines · Trond Myklebust
Quoted 6 lines · NeilBrown
Quoted 2 lines · Trond Myklebust
We don't need to call
unmap_mapping_range()prior to callingnfs_sync_mapping().Don't we?
See line 2 of
nfs_sync_mapping(). ☺
Ahhh. Makes perfect sense now - thanks
NeilBrown
Quoted 41 lines
Quoted 37 lines
Doesn't that allow a process which mapped the page to dirty it immediately after
nfs_sync_mapping(), without the page being reloaded from the server first?
Doesn't seem right..Thanks,
NeilBrownQuoted 27 lines
Signed-off-by Trond Myklebust <[email protected]>--- fs/nfs/inode.c | 1 - 1 file changed, 1 deletion(-)fs/nfs/inode.c +0
-0@@ -1170,7 +1170,6 @@ static int nfs_invalidate_mapping(structinode *inode, struct
address_space*mapfs/nfs/inode.c +0
-1if (mapping->nrpages !=0 ) {if (S_ISREG (inode->i_mode)) { -unmap_mapping_range (mapping,0 ,0 ,0 ); ret =nfs_sync_mapping (mapping);if (ret <0 )return ret;Signature · 7 lines
2.14.3 -- To unsubscribe from this list: send the line "unsubscribe linux- nfs" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.htmlSignature · 3 lines
Trond Myklebust Linux NFS client maintainer, PrimaryData [email protected]