diff options
Diffstat (limited to 'fs')
-rw-r--r-- | fs/ocfs2/file.c | 22 |
1 files changed, 12 insertions, 10 deletions
diff --git a/fs/ocfs2/file.c b/fs/ocfs2/file.c index aa501d3f93f1..600227389387 100644 --- a/fs/ocfs2/file.c +++ b/fs/ocfs2/file.c | |||
@@ -1871,8 +1871,7 @@ relock: | |||
1871 | goto out_dio; | 1871 | goto out_dio; |
1872 | } | 1872 | } |
1873 | } else { | 1873 | } else { |
1874 | written = generic_file_aio_write_nolock(iocb, iov, nr_segs, | 1874 | written = __generic_file_aio_write(iocb, iov, nr_segs, ppos); |
1875 | *ppos); | ||
1876 | } | 1875 | } |
1877 | 1876 | ||
1878 | out_dio: | 1877 | out_dio: |
@@ -1880,18 +1879,21 @@ out_dio: | |||
1880 | BUG_ON(ret == -EIOCBQUEUED && !(file->f_flags & O_DIRECT)); | 1879 | BUG_ON(ret == -EIOCBQUEUED && !(file->f_flags & O_DIRECT)); |
1881 | 1880 | ||
1882 | if ((file->f_flags & O_SYNC && !direct_io) || IS_SYNC(inode)) { | 1881 | if ((file->f_flags & O_SYNC && !direct_io) || IS_SYNC(inode)) { |
1883 | /* | 1882 | ret = filemap_fdatawrite_range(file->f_mapping, pos, |
1884 | * The generic write paths have handled getting data | 1883 | pos + count - 1); |
1885 | * to disk, but since we don't make use of the dirty | 1884 | if (ret < 0) |
1886 | * inode list, a manual journal commit is necessary | 1885 | written = ret; |
1887 | * here. | 1886 | |
1888 | */ | 1887 | if (!ret && (old_size != i_size_read(inode) || |
1889 | if (old_size != i_size_read(inode) || | 1888 | old_clusters != OCFS2_I(inode)->ip_clusters)) { |
1890 | old_clusters != OCFS2_I(inode)->ip_clusters) { | ||
1891 | ret = jbd2_journal_force_commit(osb->journal->j_journal); | 1889 | ret = jbd2_journal_force_commit(osb->journal->j_journal); |
1892 | if (ret < 0) | 1890 | if (ret < 0) |
1893 | written = ret; | 1891 | written = ret; |
1894 | } | 1892 | } |
1893 | |||
1894 | if (!ret) | ||
1895 | ret = filemap_fdatawait_range(file->f_mapping, pos, | ||
1896 | pos + count - 1); | ||
1895 | } | 1897 | } |
1896 | 1898 | ||
1897 | /* | 1899 | /* |