[PATCH 1/2] ext4: grab write access inside ext4_file_dio_write

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



We are responsible hold write count before any fs-speciffic modifications
This patch should fix following warning:

WARNING: at fs/ext4/ext4_jbd2.c:50 __ext4_journal_start_sb+0x132/0x240()
Call Trace:
[<ffffffff8106fb0d>] warn_slowpath_common+0xad/0xf0
[<ffffffff81344f97>] ? ext4_da_write_begin+0x277/0x4f0
[<ffffffff8106fb6a>] warn_slowpath_null+0x1a/0x20
[<ffffffff8138a122>] __ext4_journal_start_sb+0x132/0x240
[<ffffffff81344f97>] ext4_da_write_begin+0x277/0x4f0
[<ffffffff811a0668>] generic_perform_write+0x148/0x3c0
[<ffffffff811a0944>] generic_file_buffered_write+0x64/0xd0
[<ffffffff811a5c90>] __generic_file_aio_write+0x4d0/0x750
[<ffffffff81335da3>] ext4_file_dio_write+0x253/0x4e0
[<ffffffff81336101>] ext4_file_write+0xd1/0x190
[<ffffffff81243072>] do_sync_write+0xb2/0x120
[<ffffffff8124332c>] ? rw_verify_area+0x12c/0x270
[<ffffffff812435f2>] vfs_write+0x182/0x1f0
[<ffffffff818ff605>] ? sysret_check+0x22/0x5d
[<ffffffff812445f4>] sys_write+0x94/0xd0
[<ffffffff818ff5d9>] system_call_fastpath+0x16/0x1b

Signed-off-by: Dmitry Monakhov <dmonakhov@xxxxxxxxxx>
---
 fs/ext4/file.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/fs/ext4/file.c b/fs/ext4/file.c
index 7e85a10..99918e4 100644
--- a/fs/ext4/file.c
+++ b/fs/ext4/file.c
@@ -106,6 +106,7 @@ ext4_file_dio_write(struct kiocb *iocb, const struct iovec *iov,
 	    !is_sync_kiocb(iocb))
 		unaligned_aio = ext4_unaligned_aio(inode, iov, nr_segs, pos);
 
+	sb_start_write(inode->i_sb);
 	/* Unaligned direct AIO must be serialized; see comment above */
 	if (unaligned_aio) {
 		mutex_lock(ext4_aio_mutex(inode));
@@ -160,6 +161,7 @@ ext4_file_dio_write(struct kiocb *iocb, const struct iovec *iov,
 	if (unaligned_aio)
 		mutex_unlock(ext4_aio_mutex(inode));
 
+	sb_end_write(inode->i_sb);
 	return ret;
 }
 
-- 
1.7.1

--
To unsubscribe from this list: send the line "unsubscribe linux-ext4" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Reiser Filesystem Development]     [Ceph FS]     [Kernel Newbies]     [Security]     [Netfilter]     [Bugtraq]     [Linux FS]     [Yosemite National Park]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Device Mapper]     [Linux Media]

  Powered by Linux