linux-ext4.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] ext4: grab missed write_count for EXT4_IOC_SWAP_BOOT
@ 2014-10-02  7:50 Dmitry Monakhov
  2014-10-02 11:40 ` Jan Kara
  0 siblings, 1 reply; 3+ messages in thread
From: Dmitry Monakhov @ 2014-10-02  7:50 UTC (permalink / raw)
  To: linux-ext4; +Cc: Dmitry Monakhov

Otherwise this provokes complain like follows:
WARNING: CPU: 12 PID: 5795 at fs/ext4/ext4_jbd2.c:48 ext4_journal_check_start+0x4e/0xa0()
Modules linked in: brd iTCO_wdt lpc_ich mfd_core igb ptp dm_mirror dm_region_hash dm_log dm_mod
CPU: 12 PID: 5795 Comm: python Not tainted 3.17.0-rc2-00175-gae5344f #158
Hardware name: Intel Corporation W2600CR/W2600CR, BIOS SE5C600.86B.99.99.x028.061320111235 06/13/2011
 0000000000000030 ffff8808116cfd28 ffffffff815c7dfc 0000000000000030
 0000000000000000 ffff8808116cfd68 ffffffff8106ce8c ffff8808116cfdc8
 ffff880813b16000 ffff880806ad6ae8 ffffffff81202008 0000000000000000
Call Trace:
 [<ffffffff815c7dfc>] dump_stack+0x51/0x6d
 [<ffffffff8106ce8c>] warn_slowpath_common+0x8c/0xc0
 [<ffffffff81202008>] ? ext4_ioctl+0x9e8/0xeb0
 [<ffffffff8106ceda>] warn_slowpath_null+0x1a/0x20
 [<ffffffff8122867e>] ext4_journal_check_start+0x4e/0xa0
 [<ffffffff81228c10>] __ext4_journal_start_sb+0x90/0x110
 [<ffffffff81202008>] ext4_ioctl+0x9e8/0xeb0
 [<ffffffff8107b0bd>] ? ptrace_stop+0x24d/0x2f0
 [<ffffffff81088530>] ? alloc_pid+0x480/0x480
 [<ffffffff8107b1f2>] ? ptrace_do_notify+0x92/0xb0
 [<ffffffff81186545>] do_vfs_ioctl+0x4e5/0x550
 [<ffffffff815cdbcb>] ? _raw_spin_unlock_irq+0x2b/0x40
 [<ffffffff81186603>] SyS_ioctl+0x53/0x80
 [<ffffffff815ce2ce>] tracesys+0xd0/0xd5

Signed-off-by: Dmitry Monakhov <dmonakhov@openvz.org>
---
 fs/ext4/ioctl.c |   10 +++++++++-
 1 files changed, 9 insertions(+), 1 deletions(-)

diff --git a/fs/ext4/ioctl.c b/fs/ext4/ioctl.c
index 0f2252e..3d5de16 100644
--- a/fs/ext4/ioctl.c
+++ b/fs/ext4/ioctl.c
@@ -532,9 +532,17 @@ group_add_out:
 	}
 
 	case EXT4_IOC_SWAP_BOOT:
+	{
+		int err;
 		if (!(filp->f_mode & FMODE_WRITE))
 			return -EBADF;
-		return swap_inode_boot_loader(sb, inode);
+		err = mnt_want_write_file(filp);
+		if (err)
+			return err;
+		err = swap_inode_boot_loader(sb, inode);
+		mnt_drop_write_file(filp);
+		return err;
+	}
 
 	case EXT4_IOC_RESIZE_FS: {
 		ext4_fsblk_t n_blocks_count;
-- 
1.7.1


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] ext4: grab missed write_count for EXT4_IOC_SWAP_BOOT
  2014-10-02  7:50 [PATCH] ext4: grab missed write_count for EXT4_IOC_SWAP_BOOT Dmitry Monakhov
@ 2014-10-02 11:40 ` Jan Kara
  2014-10-03 16:50   ` Theodore Ts'o
  0 siblings, 1 reply; 3+ messages in thread
From: Jan Kara @ 2014-10-02 11:40 UTC (permalink / raw)
  To: Dmitry Monakhov; +Cc: linux-ext4

On Thu 02-10-14 11:50:02, Dmitry Monakhov wrote:
> Otherwise this provokes complain like follows:
> WARNING: CPU: 12 PID: 5795 at fs/ext4/ext4_jbd2.c:48 ext4_journal_check_start+0x4e/0xa0()
> Modules linked in: brd iTCO_wdt lpc_ich mfd_core igb ptp dm_mirror dm_region_hash dm_log dm_mod
> CPU: 12 PID: 5795 Comm: python Not tainted 3.17.0-rc2-00175-gae5344f #158
> Hardware name: Intel Corporation W2600CR/W2600CR, BIOS SE5C600.86B.99.99.x028.061320111235 06/13/2011
>  0000000000000030 ffff8808116cfd28 ffffffff815c7dfc 0000000000000030
>  0000000000000000 ffff8808116cfd68 ffffffff8106ce8c ffff8808116cfdc8
>  ffff880813b16000 ffff880806ad6ae8 ffffffff81202008 0000000000000000
> Call Trace:
>  [<ffffffff815c7dfc>] dump_stack+0x51/0x6d
>  [<ffffffff8106ce8c>] warn_slowpath_common+0x8c/0xc0
>  [<ffffffff81202008>] ? ext4_ioctl+0x9e8/0xeb0
>  [<ffffffff8106ceda>] warn_slowpath_null+0x1a/0x20
>  [<ffffffff8122867e>] ext4_journal_check_start+0x4e/0xa0
>  [<ffffffff81228c10>] __ext4_journal_start_sb+0x90/0x110
>  [<ffffffff81202008>] ext4_ioctl+0x9e8/0xeb0
>  [<ffffffff8107b0bd>] ? ptrace_stop+0x24d/0x2f0
>  [<ffffffff81088530>] ? alloc_pid+0x480/0x480
>  [<ffffffff8107b1f2>] ? ptrace_do_notify+0x92/0xb0
>  [<ffffffff81186545>] do_vfs_ioctl+0x4e5/0x550
>  [<ffffffff815cdbcb>] ? _raw_spin_unlock_irq+0x2b/0x40
>  [<ffffffff81186603>] SyS_ioctl+0x53/0x80
>  [<ffffffff815ce2ce>] tracesys+0xd0/0xd5
> 
> Signed-off-by: Dmitry Monakhov <dmonakhov@openvz.org>
  Ah, good spotting. You can add:
Reviewed-by: Jan Kara <jack@suse.cz>

							Honza

> ---
>  fs/ext4/ioctl.c |   10 +++++++++-
>  1 files changed, 9 insertions(+), 1 deletions(-)
> 
> diff --git a/fs/ext4/ioctl.c b/fs/ext4/ioctl.c
> index 0f2252e..3d5de16 100644
> --- a/fs/ext4/ioctl.c
> +++ b/fs/ext4/ioctl.c
> @@ -532,9 +532,17 @@ group_add_out:
>  	}
>  
>  	case EXT4_IOC_SWAP_BOOT:
> +	{
> +		int err;
>  		if (!(filp->f_mode & FMODE_WRITE))
>  			return -EBADF;
> -		return swap_inode_boot_loader(sb, inode);
> +		err = mnt_want_write_file(filp);
> +		if (err)
> +			return err;
> +		err = swap_inode_boot_loader(sb, inode);
> +		mnt_drop_write_file(filp);
> +		return err;
> +	}
>  
>  	case EXT4_IOC_RESIZE_FS: {
>  		ext4_fsblk_t n_blocks_count;
> -- 
> 1.7.1
> 
> --
> To unsubscribe from this list: send the line "unsubscribe linux-ext4" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
-- 
Jan Kara <jack@suse.cz>
SUSE Labs, CR

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] ext4: grab missed write_count for EXT4_IOC_SWAP_BOOT
  2014-10-02 11:40 ` Jan Kara
@ 2014-10-03 16:50   ` Theodore Ts'o
  0 siblings, 0 replies; 3+ messages in thread
From: Theodore Ts'o @ 2014-10-03 16:50 UTC (permalink / raw)
  To: Jan Kara; +Cc: Dmitry Monakhov, linux-ext4

On Thu, Oct 02, 2014 at 01:40:51PM +0200, Jan Kara wrote:
> On Thu 02-10-14 11:50:02, Dmitry Monakhov wrote:
> > Otherwise this provokes complain like follows:
> > WARNING: CPU: 12 PID: 5795 at fs/ext4/ext4_jbd2.c:48 ext4_journal_check_start+0x4e/0xa0()
> > Modules linked in: brd iTCO_wdt lpc_ich mfd_core igb ptp dm_mirror dm_region_hash dm_log dm_mod
> > CPU: 12 PID: 5795 Comm: python Not tainted 3.17.0-rc2-00175-gae5344f #158
> > Hardware name: Intel Corporation W2600CR/W2600CR, BIOS SE5C600.86B.99.99.x028.061320111235 06/13/2011
> >  0000000000000030 ffff8808116cfd28 ffffffff815c7dfc 0000000000000030
> >  0000000000000000 ffff8808116cfd68 ffffffff8106ce8c ffff8808116cfdc8
> >  ffff880813b16000 ffff880806ad6ae8 ffffffff81202008 0000000000000000
> > Call Trace:
> >  [<ffffffff815c7dfc>] dump_stack+0x51/0x6d
> >  [<ffffffff8106ce8c>] warn_slowpath_common+0x8c/0xc0
> >  [<ffffffff81202008>] ? ext4_ioctl+0x9e8/0xeb0
> >  [<ffffffff8106ceda>] warn_slowpath_null+0x1a/0x20
> >  [<ffffffff8122867e>] ext4_journal_check_start+0x4e/0xa0
> >  [<ffffffff81228c10>] __ext4_journal_start_sb+0x90/0x110
> >  [<ffffffff81202008>] ext4_ioctl+0x9e8/0xeb0
> >  [<ffffffff8107b0bd>] ? ptrace_stop+0x24d/0x2f0
> >  [<ffffffff81088530>] ? alloc_pid+0x480/0x480
> >  [<ffffffff8107b1f2>] ? ptrace_do_notify+0x92/0xb0
> >  [<ffffffff81186545>] do_vfs_ioctl+0x4e5/0x550
> >  [<ffffffff815cdbcb>] ? _raw_spin_unlock_irq+0x2b/0x40
> >  [<ffffffff81186603>] SyS_ioctl+0x53/0x80
> >  [<ffffffff815ce2ce>] tracesys+0xd0/0xd5
> > 
> > Signed-off-by: Dmitry Monakhov <dmonakhov@openvz.org>
>   Ah, good spotting. You can add:
> Reviewed-by: Jan Kara <jack@suse.cz>

Thanks, applied.

					- Ted

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2014-10-03 16:50 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-10-02  7:50 [PATCH] ext4: grab missed write_count for EXT4_IOC_SWAP_BOOT Dmitry Monakhov
2014-10-02 11:40 ` Jan Kara
2014-10-03 16:50   ` Theodore Ts'o

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).