* [PATCH 1/2] ext4: grab write access inside ext4_file_dio_write
@ 2013-03-20 12:48 Dmitry Monakhov
2013-03-20 12:48 ` [PATCH 2/2] fs: prevent null pointer dereference for fs-less devices Dmitry Monakhov
2013-03-20 12:54 ` [PATCH 1/2] ext4: grab write access inside ext4_file_dio_write Al Viro
0 siblings, 2 replies; 3+ messages in thread
From: Dmitry Monakhov @ 2013-03-20 12:48 UTC (permalink / raw)
To: linux-ext4; +Cc: linux-fsdevel, viro, jack, Dmitry Monakhov
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@openvz.org>
---
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
^ permalink raw reply related [flat|nested] 3+ messages in thread
* [PATCH 2/2] fs: prevent null pointer dereference for fs-less devices
2013-03-20 12:48 [PATCH 1/2] ext4: grab write access inside ext4_file_dio_write Dmitry Monakhov
@ 2013-03-20 12:48 ` Dmitry Monakhov
2013-03-20 12:54 ` [PATCH 1/2] ext4: grab write access inside ext4_file_dio_write Al Viro
1 sibling, 0 replies; 3+ messages in thread
From: Dmitry Monakhov @ 2013-03-20 12:48 UTC (permalink / raw)
To: linux-ext4; +Cc: linux-fsdevel, viro, jack, Dmitry Monakhov
Signed-off-by: Dmitry Monakhov <dmonakhov@openvz.org>
---
fs/block_dev.c | 3 ++-
1 files changed, 2 insertions(+), 1 deletions(-)
diff --git a/fs/block_dev.c b/fs/block_dev.c
index 172f849..e13d1df 100644
--- a/fs/block_dev.c
+++ b/fs/block_dev.c
@@ -228,7 +228,8 @@ struct super_block *freeze_bdev(struct block_device *bdev)
* thaw_bdev drops it.
*/
sb = get_super(bdev);
- drop_super(sb);
+ if (sb)
+ drop_super(sb);
mutex_unlock(&bdev->bd_fsfreeze_mutex);
return sb;
}
--
1.7.1
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH 1/2] ext4: grab write access inside ext4_file_dio_write
2013-03-20 12:48 [PATCH 1/2] ext4: grab write access inside ext4_file_dio_write Dmitry Monakhov
2013-03-20 12:48 ` [PATCH 2/2] fs: prevent null pointer dereference for fs-less devices Dmitry Monakhov
@ 2013-03-20 12:54 ` Al Viro
1 sibling, 0 replies; 3+ messages in thread
From: Al Viro @ 2013-03-20 12:54 UTC (permalink / raw)
To: Dmitry Monakhov; +Cc: linux-ext4, linux-fsdevel, jack
On Wed, Mar 20, 2013 at 04:48:17PM +0400, Dmitry Monakhov wrote:
> We are responsible hold write count before any fs-speciffic modifications
> This patch should fix following warning:
NAK. The right way to do it is to lift the damn thing out of ->aio_write()
completely. See the last 3 commits in vfs.git#experimental...
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2013-03-20 12:54 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-03-20 12:48 [PATCH 1/2] ext4: grab write access inside ext4_file_dio_write Dmitry Monakhov
2013-03-20 12:48 ` [PATCH 2/2] fs: prevent null pointer dereference for fs-less devices Dmitry Monakhov
2013-03-20 12:54 ` [PATCH 1/2] ext4: grab write access inside ext4_file_dio_write Al Viro
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).