NFS: Ensure that buffered writes wait for O_DIRECT writes to complete
Subsystems (2)
PATCH 1/1 NFS: Ensure that buffered writes wait for O_DIRECT writes to complete
The O_DIRECT code will grab the inode->i_mutex and flush out buffered writes, before scheduling a read or a write. However there is no equivalent in the buffered write code to wait for O_DIRECT to complete.
Fixes a reported issue in xfstests generic/133, when first performing an O_DIRECT write followed by a buffered write.
--- fs/nfs/file.c | 4 ++++ 1 file changed, 4 insertions(+)
fs/nfs/file.c +4 -0
@@ -372,6 +372,10 @@ start: nfs_wait_bit_killable, TASK_KILLABLE);if (ret)return ret; +/* +* Wait for O_DIRECT to complete +*/ +nfs_inode_dio_wait (mapping->host); page =grab_cache_page_write_begin (mapping, index, flags);if (!page)
Signature · 1 line
2.1.0
Looks good to me.
-dros
Quoted 36 lines · Trond Myklebust
The
O_DIRECTcode will grab theinode->i_mutexand flush out buffered writes, before scheduling a read or a write. However there is no equivalent in the buffered write code to wait forO_DIRECTto complete.Fixes a reported issue in xfstests generic/133, when first performing an
O_DIRECTwrite followed by a buffered write.Signed-off-by Trond Myklebust <[email protected]>---
fs/nfs/file.c| 4 ++++1 file changed, 4 insertions(+)fs/nfs/file.c +4
-0@@ -372,6 +372,10 @@ start: nfs_wait_bit_killable, TASK_KILLABLE);if (ret)return ret; +/* +* Wait for O_DIRECT to complete +*/ +nfs_inode_dio_wait (mapping->host); page =grab_cache_page_write_begin (mapping, index, flags);if (!page)Signature · 6 lines
2.1.0 -- 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