Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

NFSv4: Truncating file opens should also sync O_DIRECT writes

We don't just want to sync out buffered writes, but also O_DIRECT ones.

Signed-off-by: Trond Myklebust <trond.myklebust@primarydata.com>

+4 -2
+2 -1
fs/nfs/inode.c
··· 133 133 nfs_clear_inode(inode); 134 134 } 135 135 136 - static int nfs_sync_inode(struct inode *inode) 136 + int nfs_sync_inode(struct inode *inode) 137 137 { 138 138 nfs_inode_dio_wait(inode); 139 139 return nfs_wb_all(inode); 140 140 } 141 + EXPORT_SYMBOL_GPL(nfs_sync_inode); 141 142 142 143 /** 143 144 * nfs_sync_mapping - helper to flush all mmapped dirty data to disk
+1 -1
fs/nfs/nfs4file.c
··· 59 59 if (openflags & O_TRUNC) { 60 60 attr.ia_valid |= ATTR_SIZE; 61 61 attr.ia_size = 0; 62 - nfs_wb_all(inode); 62 + nfs_sync_inode(inode); 63 63 } 64 64 65 65 inode = NFS_PROTO(dir)->open_context(dir, ctx, openflags, &attr, &opened);
+1
include/linux/nfs_fs.h
··· 512 512 * Try to write back everything synchronously (but check the 513 513 * return value!) 514 514 */ 515 + extern int nfs_sync_inode(struct inode *inode); 515 516 extern int nfs_wb_all(struct inode *inode); 516 517 extern int nfs_wb_page(struct inode *inode, struct page* page); 517 518 extern int nfs_wb_page_cancel(struct inode *inode, struct page* page);