* [PATCH] ext4: Fix the wrong comment in ext4_ext_search_right. @ 2011-10-07 15:30 Tao Ma 2011-10-07 15:30 ` [PATCH] ext4: Remove the obsolete broken EXT4_IOC32_WAIT_FOR_READONLY Tao Ma ` (2 more replies) 0 siblings, 3 replies; 6+ messages in thread From: Tao Ma @ 2011-10-07 15:30 UTC (permalink / raw) To: linux-ext4; +Cc: Theodore Ts'o From: Tao Ma <boyu.mt@taobao.com> With ext4_ext_search_right, the comment is wrong. We returns 0 @phys when *logical is the 'largest' allocated block, not smallest. So change it. Some other typos are also included. Cc: "Theodore Ts'o" <tytso@mit.edu> Signed-off-by: Tao Ma <boyu.mt@taobao.com> --- fs/ext4/extents.c | 4 ++-- fs/ext4/inode.c | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/fs/ext4/extents.c b/fs/ext4/extents.c index dee73d2..f6b333c 100644 --- a/fs/ext4/extents.c +++ b/fs/ext4/extents.c @@ -1260,7 +1260,7 @@ static int ext4_ext_search_left(struct inode *inode, /* * search the closest allocated block to the right for *logical * and returns it at @logical + it's physical address at @phys - * if *logical is the smallest allocated block, the function + * if *logical is the largest allocated block, the function * returns 0 at @phys * return value contains 0 (success) or error code */ @@ -2158,7 +2158,7 @@ int ext4_ext_calc_credits_for_single_extent(struct inode *inode, int nrblocks, * need to account for leaf block credit * * bitmaps and block group descriptor blocks - * and other metadat blocks still need to be + * and other metadata blocks still need to be * accounted. */ /* 1 bitmap, 1 block group descriptor */ diff --git a/fs/ext4/inode.c b/fs/ext4/inode.c index 0e2c0d1..56c4f72 100644 --- a/fs/ext4/inode.c +++ b/fs/ext4/inode.c @@ -455,7 +455,7 @@ int ext4_map_blocks(handle_t *handle, struct inode *inode, * Returns if the blocks have already allocated * * Note that if blocks have been preallocated - * ext4_ext_get_block() returns th create = 0 + * ext4_ext_get_block() returns the create = 0 * with buffer head unmapped. */ if (retval > 0 && map->m_flags & EXT4_MAP_MAPPED) -- 1.7.1 ^ permalink raw reply related [flat|nested] 6+ messages in thread
* [PATCH] ext4: Remove the obsolete broken EXT4_IOC32_WAIT_FOR_READONLY. 2011-10-07 15:30 [PATCH] ext4: Fix the wrong comment in ext4_ext_search_right Tao Ma @ 2011-10-07 15:30 ` Tao Ma 2011-10-08 19:57 ` Ted Ts'o 2011-10-07 15:30 ` [PATCH] ext4: Use le32_to_cpu for ext4_extent_idx.ei_block in ext4_ext_search_left Tao Ma 2011-10-08 19:50 ` [PATCH] ext4: Fix the wrong comment in ext4_ext_search_right Ted Ts'o 2 siblings, 1 reply; 6+ messages in thread From: Tao Ma @ 2011-10-07 15:30 UTC (permalink / raw) To: linux-ext4; +Cc: Theodore Ts'o From: Tao Ma <boyu.mt@taobao.com> There are no user of EXT4_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: "Theodore Ts'o" <tytso@mit.edu> Signed-off-by: Tao Ma <boyu.mt@taobao.com> --- fs/ext4/ext4.h | 7 ------- fs/ext4/inode.c | 2 +- fs/ext4/ioctl.c | 29 ----------------------------- 3 files changed, 1 insertions(+), 37 deletions(-) diff --git a/fs/ext4/ext4.h b/fs/ext4/ext4.h index b7d7bd0..4cb030c 100644 --- a/fs/ext4/ext4.h +++ b/fs/ext4/ext4.h @@ -563,9 +563,6 @@ struct ext4_new_group_data { #define EXT4_IOC32_SETRSVSZ _IOW('f', 6, int) #define EXT4_IOC32_GROUP_EXTEND _IOW('f', 7, unsigned int) #define EXT4_IOC32_GROUP_ADD _IOW('f', 8, struct compat_ext4_new_group_input) -#ifdef CONFIG_JBD2_DEBUG -#define EXT4_IOC32_WAIT_FOR_READONLY _IOR('f', 99, int) -#endif #define EXT4_IOC32_GETVERSION_OLD FS_IOC32_GETVERSION #define EXT4_IOC32_SETVERSION_OLD FS_IOC32_SETVERSION #endif @@ -1136,10 +1133,6 @@ struct ext4_sb_info { u32 s_max_batch_time; u32 s_min_batch_time; struct block_device *journal_bdev; -#ifdef CONFIG_JBD2_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 */ diff --git a/fs/ext4/inode.c b/fs/ext4/inode.c index 986e238..0e2c0d1 100644 --- a/fs/ext4/inode.c +++ b/fs/ext4/inode.c @@ -416,7 +416,7 @@ static pgoff_t ext4_num_dirty_pages(struct inode *inode, pgoff_t idx, * the buffer head is mapped. * * It returns 0 if plain look up failed (blocks have not been allocated), in - * that casem, buffer head is unmapped + * that case, buffer head is unmapped * * It returns the error in case of allocation failure. */ diff --git a/fs/ext4/ioctl.c b/fs/ext4/ioctl.c index f18bfe3..1d065d3 100644 --- a/fs/ext4/ioctl.c +++ b/fs/ext4/ioctl.c @@ -173,30 +173,6 @@ setversion_out: mnt_drop_write(filp->f_path.mnt); return err; } -#ifdef CONFIG_JBD2_DEBUG - case EXT4_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(&EXT4_SB(sb)->ro_wait_queue, &wait); - if (timer_pending(&EXT4_SB(sb)->turn_ro_timer)) { - schedule(); - ret = 1; - } - remove_wait_queue(&EXT4_SB(sb)->ro_wait_queue, &wait); - return ret; - } -#endif case EXT4_IOC_GROUP_EXTEND: { ext4_fsblk_t n_blocks_count; struct super_block *sb = inode->i_sb; @@ -396,11 +372,6 @@ long ext4_compat_ioctl(struct file *file, unsigned int cmd, unsigned long arg) case EXT4_IOC32_SETVERSION_OLD: cmd = EXT4_IOC_SETVERSION_OLD; break; -#ifdef CONFIG_JBD2_DEBUG - case EXT4_IOC32_WAIT_FOR_READONLY: - cmd = EXT4_IOC_WAIT_FOR_READONLY; - break; -#endif case EXT4_IOC32_GETRSVSZ: cmd = EXT4_IOC_GETRSVSZ; break; -- 1.7.1 ^ permalink raw reply related [flat|nested] 6+ messages in thread
* Re: [PATCH] ext4: Remove the obsolete broken EXT4_IOC32_WAIT_FOR_READONLY. 2011-10-07 15:30 ` [PATCH] ext4: Remove the obsolete broken EXT4_IOC32_WAIT_FOR_READONLY Tao Ma @ 2011-10-08 19:57 ` Ted Ts'o 0 siblings, 0 replies; 6+ messages in thread From: Ted Ts'o @ 2011-10-08 19:57 UTC (permalink / raw) To: Tao Ma; +Cc: linux-ext4 On Fri, Oct 07, 2011 at 11:30:27PM +0800, Tao Ma wrote: > From: Tao Ma <boyu.mt@taobao.com> > > There are no user of EXT4_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: "Theodore Ts'o" <tytso@mit.edu> > Signed-off-by: Tao Ma <boyu.mt@taobao.com> Applied, thanks. I adjusted the commit description a little and removed the #define for EXT4_IOC_WAIT_FOR_READONLY which you missed in your patch. - Ted ^ permalink raw reply [flat|nested] 6+ messages in thread
* [PATCH] ext4: Use le32_to_cpu for ext4_extent_idx.ei_block in ext4_ext_search_left. 2011-10-07 15:30 [PATCH] ext4: Fix the wrong comment in ext4_ext_search_right Tao Ma 2011-10-07 15:30 ` [PATCH] ext4: Remove the obsolete broken EXT4_IOC32_WAIT_FOR_READONLY Tao Ma @ 2011-10-07 15:30 ` Tao Ma 2011-10-08 20:11 ` Ted Ts'o 2011-10-08 19:50 ` [PATCH] ext4: Fix the wrong comment in ext4_ext_search_right Ted Ts'o 2 siblings, 1 reply; 6+ messages in thread From: Tao Ma @ 2011-10-07 15:30 UTC (permalink / raw) To: linux-ext4; +Cc: Theodore Ts'o From: Tao Ma <boyu.mt@taobao.com> ext4_extent_idx.e_block is __le32, so use le32_to_cpu when using them in ext4_ext_search_left. Cc: "Theodore Ts'o" <tytso@mit.edu> Signed-off-by: Tao Ma <boyu.mt@taobao.com> --- fs/ext4/extents.c | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) diff --git a/fs/ext4/extents.c b/fs/ext4/extents.c index 37a1b4d..dee73d2 100644 --- a/fs/ext4/extents.c +++ b/fs/ext4/extents.c @@ -1235,9 +1235,9 @@ static int ext4_ext_search_left(struct inode *inode, if (unlikely(ix != EXT_FIRST_INDEX(path[depth].p_hdr))) { EXT4_ERROR_INODE(inode, "ix (%d) != EXT_FIRST_INDEX (%d) (depth %d)!", - ix != NULL ? ix->ei_block : 0, + ix != NULL ? le32_to_cpu(ix->ei_block) : 0, EXT_FIRST_INDEX(path[depth].p_hdr) != NULL ? - EXT_FIRST_INDEX(path[depth].p_hdr)->ei_block : 0, + le32_to_cpu(EXT_FIRST_INDEX(path[depth].p_hdr)->ei_block) : 0, depth); return -EIO; } -- 1.7.1 ^ permalink raw reply related [flat|nested] 6+ messages in thread
* Re: [PATCH] ext4: Use le32_to_cpu for ext4_extent_idx.ei_block in ext4_ext_search_left. 2011-10-07 15:30 ` [PATCH] ext4: Use le32_to_cpu for ext4_extent_idx.ei_block in ext4_ext_search_left Tao Ma @ 2011-10-08 20:11 ` Ted Ts'o 0 siblings, 0 replies; 6+ messages in thread From: Ted Ts'o @ 2011-10-08 20:11 UTC (permalink / raw) To: Tao Ma; +Cc: linux-ext4 On Fri, Oct 07, 2011 at 11:30:28PM +0800, Tao Ma wrote: > From: Tao Ma <boyu.mt@taobao.com> > > ext4_extent_idx.e_block is __le32, so use le32_to_cpu when using them > in ext4_ext_search_left. > > Cc: "Theodore Ts'o" <tytso@mit.edu> > Signed-off-by: Tao Ma <boyu.mt@taobao.com> Thanks, applied. - Ted ^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] ext4: Fix the wrong comment in ext4_ext_search_right. 2011-10-07 15:30 [PATCH] ext4: Fix the wrong comment in ext4_ext_search_right Tao Ma 2011-10-07 15:30 ` [PATCH] ext4: Remove the obsolete broken EXT4_IOC32_WAIT_FOR_READONLY Tao Ma 2011-10-07 15:30 ` [PATCH] ext4: Use le32_to_cpu for ext4_extent_idx.ei_block in ext4_ext_search_left Tao Ma @ 2011-10-08 19:50 ` Ted Ts'o 2 siblings, 0 replies; 6+ messages in thread From: Ted Ts'o @ 2011-10-08 19:50 UTC (permalink / raw) To: Tao Ma; +Cc: linux-ext4 On Fri, Oct 07, 2011 at 11:30:26PM +0800, Tao Ma wrote: > From: Tao Ma <boyu.mt@taobao.com> > > With ext4_ext_search_right, the comment is wrong. We returns 0 @phys when > *logical is the 'largest' allocated block, not smallest. So change it. > Some other typos are also included. > > Cc: "Theodore Ts'o" <tytso@mit.edu> > Signed-off-by: Tao Ma <boyu.mt@taobao.com> Applied, thanks. - Ted ^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2011-10-08 20:11 UTC | newest] Thread overview: 6+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2011-10-07 15:30 [PATCH] ext4: Fix the wrong comment in ext4_ext_search_right Tao Ma 2011-10-07 15:30 ` [PATCH] ext4: Remove the obsolete broken EXT4_IOC32_WAIT_FOR_READONLY Tao Ma 2011-10-08 19:57 ` Ted Ts'o 2011-10-07 15:30 ` [PATCH] ext4: Use le32_to_cpu for ext4_extent_idx.ei_block in ext4_ext_search_left Tao Ma 2011-10-08 20:11 ` Ted Ts'o 2011-10-08 19:50 ` [PATCH] ext4: Fix the wrong comment in ext4_ext_search_right Ted 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).