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.

NFS: Add a helper to sync both O_DIRECT and buffered writes

Then apply it to nfs_setattr() and nfs_getattr().

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

+9 -6
+9 -6
fs/nfs/inode.c
··· 133 133 nfs_clear_inode(inode); 134 134 } 135 135 136 + static int nfs_sync_inode(struct inode *inode) 137 + { 138 + nfs_inode_dio_wait(inode); 139 + return nfs_wb_all(inode); 140 + } 141 + 136 142 /** 137 143 * nfs_sync_mapping - helper to flush all mmapped dirty data to disk 138 144 */ ··· 531 525 trace_nfs_setattr_enter(inode); 532 526 533 527 /* Write all dirty data */ 534 - if (S_ISREG(inode->i_mode)) { 535 - nfs_inode_dio_wait(inode); 536 - nfs_wb_all(inode); 537 - } 528 + if (S_ISREG(inode->i_mode)) 529 + nfs_sync_inode(inode); 538 530 539 531 fattr = nfs_alloc_fattr(); 540 532 if (fattr == NULL) ··· 648 644 trace_nfs_getattr_enter(inode); 649 645 /* Flush out writes to the server in order to update c/mtime. */ 650 646 if (S_ISREG(inode->i_mode)) { 651 - nfs_inode_dio_wait(inode); 652 - err = filemap_write_and_wait(inode->i_mapping); 647 + err = nfs_sync_inode(inode); 653 648 if (err) 654 649 goto out; 655 650 }