* [PATCH] ext3: Remove the obsolete broken EXT3_IOC32_WAIT_FOR_READONLY.
@ 2011-10-07 15:21 Tao Ma
2011-10-07 22:12 ` Jan Kara
0 siblings, 1 reply; 4+ messages in thread
From: Tao Ma @ 2011-10-07 15:21 UTC (permalink / raw)
To: linux-ext4; +Cc: Jan Kara
From: Tao Ma <boyu.mt@taobao.com>
There are no user of EXT3_IOC32_WAIT_FOR_READONLY and also it is
broken. No one set the set_ro_timer, no one wake up us and our
state is set to TASK_INTERRUPTIBLE not RUNNING. So remove it.
Cc: Jan Kara <jack@suse.cz>
Signed-off-by: Tao Ma <boyu.mt@taobao.com>
---
fs/ext3/ioctl.c | 24 ------------------------
include/linux/ext3_fs_sb.h | 4 ----
2 files changed, 0 insertions(+), 28 deletions(-)
diff --git a/fs/ext3/ioctl.c b/fs/ext3/ioctl.c
index c7f4394..ba1b54e 100644
--- a/fs/ext3/ioctl.c
+++ b/fs/ext3/ioctl.c
@@ -150,30 +150,6 @@ setversion_out:
mnt_drop_write(filp->f_path.mnt);
return err;
}
-#ifdef CONFIG_JBD_DEBUG
- case EXT3_IOC_WAIT_FOR_READONLY:
- /*
- * This is racy - by the time we're woken up and running,
- * the superblock could be released. And the module could
- * have been unloaded. So sue me.
- *
- * Returns 1 if it slept, else zero.
- */
- {
- struct super_block *sb = inode->i_sb;
- DECLARE_WAITQUEUE(wait, current);
- int ret = 0;
-
- set_current_state(TASK_INTERRUPTIBLE);
- add_wait_queue(&EXT3_SB(sb)->ro_wait_queue, &wait);
- if (timer_pending(&EXT3_SB(sb)->turn_ro_timer)) {
- schedule();
- ret = 1;
- }
- remove_wait_queue(&EXT3_SB(sb)->ro_wait_queue, &wait);
- return ret;
- }
-#endif
case EXT3_IOC_GETRSVSZ:
if (test_opt(inode->i_sb, RESERVATION)
&& S_ISREG(inode->i_mode)
diff --git a/include/linux/ext3_fs_sb.h b/include/linux/ext3_fs_sb.h
index 258088a..6436525 100644
--- a/include/linux/ext3_fs_sb.h
+++ b/include/linux/ext3_fs_sb.h
@@ -76,10 +76,6 @@ struct ext3_sb_info {
struct mutex s_resize_lock;
unsigned long s_commit_interval;
struct block_device *journal_bdev;
-#ifdef CONFIG_JBD_DEBUG
- struct timer_list turn_ro_timer; /* For turning read-only (crash simulation) */
- wait_queue_head_t ro_wait_queue; /* For people waiting for the fs to go read-only */
-#endif
#ifdef CONFIG_QUOTA
char *s_qf_names[MAXQUOTAS]; /* Names of quota files with journalled quota */
int s_jquota_fmt; /* Format of quota to use */
--
1.7.1
^ permalink raw reply related [flat|nested] 4+ messages in thread* Re: [PATCH] ext3: Remove the obsolete broken EXT3_IOC32_WAIT_FOR_READONLY.
2011-10-07 15:21 [PATCH] ext3: Remove the obsolete broken EXT3_IOC32_WAIT_FOR_READONLY Tao Ma
@ 2011-10-07 22:12 ` Jan Kara
2011-10-08 20:52 ` Ted Ts'o
0 siblings, 1 reply; 4+ messages in thread
From: Jan Kara @ 2011-10-07 22:12 UTC (permalink / raw)
To: Tao Ma; +Cc: linux-ext4, Jan Kara, Andrew Morton
On Fri 07-10-11 23:21:18, Tao Ma wrote:
> From: Tao Ma <boyu.mt@taobao.com>
>
> There are no user of EXT3_IOC32_WAIT_FOR_READONLY and also it is
> broken. No one set the set_ro_timer, no one wake up us and our
> state is set to TASK_INTERRUPTIBLE not RUNNING. So remove it.
Hmm, I vaguely recall Andrew had some debugging patches which were using
turn_ro_timer and this functionality. But I'm not sure if they are still
usable or if they still make sense when one can easily test crashing using
virtual machines... Andrew?
Honza
>
> Cc: Jan Kara <jack@suse.cz>
> Signed-off-by: Tao Ma <boyu.mt@taobao.com>
> ---
> fs/ext3/ioctl.c | 24 ------------------------
> include/linux/ext3_fs_sb.h | 4 ----
> 2 files changed, 0 insertions(+), 28 deletions(-)
>
> diff --git a/fs/ext3/ioctl.c b/fs/ext3/ioctl.c
> index c7f4394..ba1b54e 100644
> --- a/fs/ext3/ioctl.c
> +++ b/fs/ext3/ioctl.c
> @@ -150,30 +150,6 @@ setversion_out:
> mnt_drop_write(filp->f_path.mnt);
> return err;
> }
> -#ifdef CONFIG_JBD_DEBUG
> - case EXT3_IOC_WAIT_FOR_READONLY:
> - /*
> - * This is racy - by the time we're woken up and running,
> - * the superblock could be released. And the module could
> - * have been unloaded. So sue me.
> - *
> - * Returns 1 if it slept, else zero.
> - */
> - {
> - struct super_block *sb = inode->i_sb;
> - DECLARE_WAITQUEUE(wait, current);
> - int ret = 0;
> -
> - set_current_state(TASK_INTERRUPTIBLE);
> - add_wait_queue(&EXT3_SB(sb)->ro_wait_queue, &wait);
> - if (timer_pending(&EXT3_SB(sb)->turn_ro_timer)) {
> - schedule();
> - ret = 1;
> - }
> - remove_wait_queue(&EXT3_SB(sb)->ro_wait_queue, &wait);
> - return ret;
> - }
> -#endif
> case EXT3_IOC_GETRSVSZ:
> if (test_opt(inode->i_sb, RESERVATION)
> && S_ISREG(inode->i_mode)
> diff --git a/include/linux/ext3_fs_sb.h b/include/linux/ext3_fs_sb.h
> index 258088a..6436525 100644
> --- a/include/linux/ext3_fs_sb.h
> +++ b/include/linux/ext3_fs_sb.h
> @@ -76,10 +76,6 @@ struct ext3_sb_info {
> struct mutex s_resize_lock;
> unsigned long s_commit_interval;
> struct block_device *journal_bdev;
> -#ifdef CONFIG_JBD_DEBUG
> - struct timer_list turn_ro_timer; /* For turning read-only (crash simulation) */
> - wait_queue_head_t ro_wait_queue; /* For people waiting for the fs to go read-only */
> -#endif
> #ifdef CONFIG_QUOTA
> char *s_qf_names[MAXQUOTAS]; /* Names of quota files with journalled quota */
> int s_jquota_fmt; /* Format of quota to use */
> --
> 1.7.1
>
--
Jan Kara <jack@suse.cz>
SUSE Labs, CR
^ permalink raw reply [flat|nested] 4+ messages in thread* Re: [PATCH] ext3: Remove the obsolete broken EXT3_IOC32_WAIT_FOR_READONLY.
2011-10-07 22:12 ` Jan Kara
@ 2011-10-08 20:52 ` Ted Ts'o
2011-10-10 16:27 ` Jan Kara
0 siblings, 1 reply; 4+ messages in thread
From: Ted Ts'o @ 2011-10-08 20:52 UTC (permalink / raw)
To: Jan Kara; +Cc: Tao Ma, linux-ext4, Andrew Morton
On Sat, Oct 08, 2011 at 12:12:33AM +0200, Jan Kara wrote:
> On Fri 07-10-11 23:21:18, Tao Ma wrote:
> > From: Tao Ma <boyu.mt@taobao.com>
> >
> > There are no user of EXT3_IOC32_WAIT_FOR_READONLY and also it is
> > broken. No one set the set_ro_timer, no one wake up us and our
> > state is set to TASK_INTERRUPTIBLE not RUNNING. So remove it.
> Hmm, I vaguely recall Andrew had some debugging patches which were using
> turn_ro_timer and this functionality. But I'm not sure if they are still
> usable or if they still make sense when one can easily test crashing using
> virtual machines... Andrew?
That's why I decided to accept the corresponding patch for ext4; if
the rest of debugging patch is out-of-tree, then might as well have it
all out-of-tree --- and killall qemu is probably a better way of
testing this anyway.
- Ted
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] ext3: Remove the obsolete broken EXT3_IOC32_WAIT_FOR_READONLY.
2011-10-08 20:52 ` Ted Ts'o
@ 2011-10-10 16:27 ` Jan Kara
0 siblings, 0 replies; 4+ messages in thread
From: Jan Kara @ 2011-10-10 16:27 UTC (permalink / raw)
To: Ted Ts'o; +Cc: Jan Kara, Tao Ma, linux-ext4, Andrew Morton
On Sat 08-10-11 16:52:35, Ted Tso wrote:
> On Sat, Oct 08, 2011 at 12:12:33AM +0200, Jan Kara wrote:
> > On Fri 07-10-11 23:21:18, Tao Ma wrote:
> > > From: Tao Ma <boyu.mt@taobao.com>
> > >
> > > There are no user of EXT3_IOC32_WAIT_FOR_READONLY and also it is
> > > broken. No one set the set_ro_timer, no one wake up us and our
> > > state is set to TASK_INTERRUPTIBLE not RUNNING. So remove it.
> > Hmm, I vaguely recall Andrew had some debugging patches which were using
> > turn_ro_timer and this functionality. But I'm not sure if they are still
> > usable or if they still make sense when one can easily test crashing using
> > virtual machines... Andrew?
>
> That's why I decided to accept the corresponding patch for ext4; if
> the rest of debugging patch is out-of-tree, then might as well have it
> all out-of-tree --- and killall qemu is probably a better way of
> testing this anyway.
OK. I've merged the patch in my tree. If Andrew shouts loudly, I can
always revert it :)
Honza
--
Jan Kara <jack@suse.cz>
SUSE Labs, CR
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2011-10-10 16:27 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-10-07 15:21 [PATCH] ext3: Remove the obsolete broken EXT3_IOC32_WAIT_FOR_READONLY Tao Ma
2011-10-07 22:12 ` Jan Kara
2011-10-08 20:52 ` Ted Ts'o
2011-10-10 16:27 ` Jan Kara
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox