* [PATCH 1/2 v2] ext4: move ext4_ind_migrate() into migrate.c
@ 2013-04-09 11:24 Lukas Czerner
2013-04-09 11:24 ` [PATCH 2/2 v2] ext4: Do not convert to indirect with bigalloc enabled Lukas Czerner
` (2 more replies)
0 siblings, 3 replies; 10+ messages in thread
From: Lukas Czerner @ 2013-04-09 11:24 UTC (permalink / raw)
To: linux-ext4; +Cc: gnehzuil.liu, Lukas Czerner
Move ext4_ind_migrate() into migrate.c file since it makes much more
sense and ext4_ext_migrate() is there as well.
Also fix tiny style problem - add spaces around "=" in "i=0".
Signed-off-by: Lukas Czerner <lczerner@redhat.com>
---
v2: added to the series
fs/ext4/ext4.h | 2 +-
fs/ext4/extents.c | 59 ----------------------------------------------------
fs/ext4/migrate.c | 60 ++++++++++++++++++++++++++++++++++++++++++++++++++++-
3 files changed, 60 insertions(+), 61 deletions(-)
diff --git a/fs/ext4/ext4.h b/fs/ext4/ext4.h
index a0637e5..bb56920 100644
--- a/fs/ext4/ext4.h
+++ b/fs/ext4/ext4.h
@@ -2131,6 +2131,7 @@ extern long ext4_compat_ioctl(struct file *, unsigned int, unsigned long);
/* migrate.c */
extern int ext4_ext_migrate(struct inode *);
+extern int ext4_ind_migrate(struct inode *inode);
/* namei.c */
extern int ext4_dirent_csum_verify(struct inode *inode,
@@ -2620,7 +2621,6 @@ extern int ext4_find_delalloc_range(struct inode *inode,
extern int ext4_find_delalloc_cluster(struct inode *inode, ext4_lblk_t lblk);
extern int ext4_fiemap(struct inode *inode, struct fiemap_extent_info *fieinfo,
__u64 start, __u64 len);
-extern int ext4_ind_migrate(struct inode *inode);
/* move_extent.c */
diff --git a/fs/ext4/extents.c b/fs/ext4/extents.c
index 6c5a70a..3645357 100644
--- a/fs/ext4/extents.c
+++ b/fs/ext4/extents.c
@@ -4715,62 +4715,3 @@ int ext4_fiemap(struct inode *inode, struct fiemap_extent_info *fieinfo,
return error;
}
-
-/*
- * Migrate a simple extent-based inode to use the i_blocks[] array
- */
-int ext4_ind_migrate(struct inode *inode)
-{
- struct ext4_extent_header *eh;
- struct ext4_super_block *es = EXT4_SB(inode->i_sb)->s_es;
- struct ext4_inode_info *ei = EXT4_I(inode);
- struct ext4_extent *ex;
- unsigned int i, len;
- ext4_fsblk_t blk;
- handle_t *handle;
- int ret;
-
- if (!EXT4_HAS_INCOMPAT_FEATURE(inode->i_sb,
- EXT4_FEATURE_INCOMPAT_EXTENTS) ||
- (!ext4_test_inode_flag(inode, EXT4_INODE_EXTENTS)))
- return -EINVAL;
-
- down_write(&EXT4_I(inode)->i_data_sem);
- ret = ext4_ext_check_inode(inode);
- if (ret)
- goto errout;
-
- eh = ext_inode_hdr(inode);
- ex = EXT_FIRST_EXTENT(eh);
- if (ext4_blocks_count(es) > EXT4_MAX_BLOCK_FILE_PHYS ||
- eh->eh_depth != 0 || eh->eh_entries > 1) {
- ret = -EOPNOTSUPP;
- goto errout;
- }
- if (eh->eh_entries == 0)
- blk = len = 0;
- else {
- len = le16_to_cpu(ex->ee_len);
- blk = ext4_ext_pblock(ex);
- if (len > EXT4_NDIR_BLOCKS) {
- ret = -EOPNOTSUPP;
- goto errout;
- }
- }
-
- handle = ext4_journal_start(inode, EXT4_HT_MIGRATE, 1);
- if (IS_ERR(handle)) {
- ret = PTR_ERR(handle);
- goto errout;
- }
-
- ext4_clear_inode_flag(inode, EXT4_INODE_EXTENTS);
- memset(ei->i_data, 0, sizeof(ei->i_data));
- for (i=0; i < len; i++)
- ei->i_data[i] = cpu_to_le32(blk++);
- ext4_mark_inode_dirty(handle, inode);
- ext4_journal_stop(handle);
-errout:
- up_write(&EXT4_I(inode)->i_data_sem);
- return ret;
-}
diff --git a/fs/ext4/migrate.c b/fs/ext4/migrate.c
index 480acf4..3464604 100644
--- a/fs/ext4/migrate.c
+++ b/fs/ext4/migrate.c
@@ -426,7 +426,6 @@ static int free_ext_block(handle_t *handle, struct inode *inode)
return retval;
}
return retval;
-
}
int ext4_ext_migrate(struct inode *inode)
@@ -606,3 +605,62 @@ out:
return retval;
}
+
+/*
+ * Migrate a simple extent-based inode to use the i_blocks[] array
+ */
+int ext4_ind_migrate(struct inode *inode)
+{
+ struct ext4_extent_header *eh;
+ struct ext4_super_block *es = EXT4_SB(inode->i_sb)->s_es;
+ struct ext4_inode_info *ei = EXT4_I(inode);
+ struct ext4_extent *ex;
+ unsigned int i, len;
+ ext4_fsblk_t blk;
+ handle_t *handle;
+ int ret;
+
+ if (!EXT4_HAS_INCOMPAT_FEATURE(inode->i_sb,
+ EXT4_FEATURE_INCOMPAT_EXTENTS) ||
+ (!ext4_test_inode_flag(inode, EXT4_INODE_EXTENTS)))
+ return -EINVAL;
+
+ down_write(&EXT4_I(inode)->i_data_sem);
+ ret = ext4_ext_check_inode(inode);
+ if (ret)
+ goto errout;
+
+ eh = ext_inode_hdr(inode);
+ ex = EXT_FIRST_EXTENT(eh);
+ if (ext4_blocks_count(es) > EXT4_MAX_BLOCK_FILE_PHYS ||
+ eh->eh_depth != 0 || eh->eh_entries > 1) {
+ ret = -EOPNOTSUPP;
+ goto errout;
+ }
+ if (eh->eh_entries == 0)
+ blk = len = 0;
+ else {
+ len = le16_to_cpu(ex->ee_len);
+ blk = ext4_ext_pblock(ex);
+ if (len > EXT4_NDIR_BLOCKS) {
+ ret = -EOPNOTSUPP;
+ goto errout;
+ }
+ }
+
+ handle = ext4_journal_start(inode, EXT4_HT_MIGRATE, 1);
+ if (IS_ERR(handle)) {
+ ret = PTR_ERR(handle);
+ goto errout;
+ }
+
+ ext4_clear_inode_flag(inode, EXT4_INODE_EXTENTS);
+ memset(ei->i_data, 0, sizeof(ei->i_data));
+ for (i = 0; i < len; i++)
+ ei->i_data[i] = cpu_to_le32(blk++);
+ ext4_mark_inode_dirty(handle, inode);
+ ext4_journal_stop(handle);
+errout:
+ up_write(&EXT4_I(inode)->i_data_sem);
+ return ret;
+}
--
1.7.7.6
^ permalink raw reply related [flat|nested] 10+ messages in thread
* [PATCH 2/2 v2] ext4: Do not convert to indirect with bigalloc enabled
2013-04-09 11:24 [PATCH 1/2 v2] ext4: move ext4_ind_migrate() into migrate.c Lukas Czerner
@ 2013-04-09 11:24 ` Lukas Czerner
2013-04-09 12:48 ` Zheng Liu
2013-04-11 3:58 ` Theodore Ts'o
2013-04-09 12:47 ` [PATCH 1/2 v2] ext4: move ext4_ind_migrate() into migrate.c Zheng Liu
2013-04-11 3:58 ` Theodore Ts'o
2 siblings, 2 replies; 10+ messages in thread
From: Lukas Czerner @ 2013-04-09 11:24 UTC (permalink / raw)
To: linux-ext4; +Cc: gnehzuil.liu, Lukas Czerner
With bigalloc feature enabled we do not support indirect addressing at all
so we have to prevent extent addressing to indirect addressing
conversion in this case. The problem has been introduced with the commit
"ext4: support simple conversion of extent-mapped inodes to use i_blocks"
Signed-off-by: Lukas Czerner <lczerner@redhat.com>
---
v2: added to the series
fs/ext4/migrate.c | 4 ++++
1 files changed, 4 insertions(+), 0 deletions(-)
diff --git a/fs/ext4/migrate.c b/fs/ext4/migrate.c
index 3464604..f13a289 100644
--- a/fs/ext4/migrate.c
+++ b/fs/ext4/migrate.c
@@ -625,6 +625,10 @@ int ext4_ind_migrate(struct inode *inode)
(!ext4_test_inode_flag(inode, EXT4_INODE_EXTENTS)))
return -EINVAL;
+ if (EXT4_HAS_RO_COMPAT_FEATURE(inode->i_sb,
+ EXT4_FEATURE_RO_COMPAT_BIGALLOC))
+ return -EOPNOTSUPP;
+
down_write(&EXT4_I(inode)->i_data_sem);
ret = ext4_ext_check_inode(inode);
if (ret)
--
1.7.7.6
^ permalink raw reply related [flat|nested] 10+ messages in thread
* Re: [PATCH 2/2 v2] ext4: Do not convert to indirect with bigalloc enabled
2013-04-09 11:24 ` [PATCH 2/2 v2] ext4: Do not convert to indirect with bigalloc enabled Lukas Czerner
@ 2013-04-09 12:48 ` Zheng Liu
2013-04-11 3:58 ` Theodore Ts'o
1 sibling, 0 replies; 10+ messages in thread
From: Zheng Liu @ 2013-04-09 12:48 UTC (permalink / raw)
To: Lukas Czerner; +Cc: linux-ext4
On Tue, Apr 09, 2013 at 01:24:47PM +0200, Lukas Czerner wrote:
> With bigalloc feature enabled we do not support indirect addressing at all
> so we have to prevent extent addressing to indirect addressing
> conversion in this case. The problem has been introduced with the commit
> "ext4: support simple conversion of extent-mapped inodes to use i_blocks"
>
> Signed-off-by: Lukas Czerner <lczerner@redhat.com>
Reviewed-by: Zheng Liu <wenqing.lz@taobao.com>
Regards,
- Zheng
> ---
> v2: added to the series
>
> fs/ext4/migrate.c | 4 ++++
> 1 files changed, 4 insertions(+), 0 deletions(-)
>
> diff --git a/fs/ext4/migrate.c b/fs/ext4/migrate.c
> index 3464604..f13a289 100644
> --- a/fs/ext4/migrate.c
> +++ b/fs/ext4/migrate.c
> @@ -625,6 +625,10 @@ int ext4_ind_migrate(struct inode *inode)
> (!ext4_test_inode_flag(inode, EXT4_INODE_EXTENTS)))
> return -EINVAL;
>
> + if (EXT4_HAS_RO_COMPAT_FEATURE(inode->i_sb,
> + EXT4_FEATURE_RO_COMPAT_BIGALLOC))
> + return -EOPNOTSUPP;
> +
> down_write(&EXT4_I(inode)->i_data_sem);
> ret = ext4_ext_check_inode(inode);
> if (ret)
> --
> 1.7.7.6
>
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [PATCH 2/2 v2] ext4: Do not convert to indirect with bigalloc enabled
2013-04-09 11:24 ` [PATCH 2/2 v2] ext4: Do not convert to indirect with bigalloc enabled Lukas Czerner
2013-04-09 12:48 ` Zheng Liu
@ 2013-04-11 3:58 ` Theodore Ts'o
1 sibling, 0 replies; 10+ messages in thread
From: Theodore Ts'o @ 2013-04-11 3:58 UTC (permalink / raw)
To: Lukas Czerner; +Cc: linux-ext4, gnehzuil.liu
On Tue, Apr 09, 2013 at 01:24:47PM +0200, Lukas Czerner wrote:
> With bigalloc feature enabled we do not support indirect addressing at all
> so we have to prevent extent addressing to indirect addressing
> conversion in this case. The problem has been introduced with the commit
> "ext4: support simple conversion of extent-mapped inodes to use i_blocks"
>
> Signed-off-by: Lukas Czerner <lczerner@redhat.com>
Thanks, this version is now in the ext4 patch queue.
- Ted
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [PATCH 1/2 v2] ext4: move ext4_ind_migrate() into migrate.c
2013-04-09 11:24 [PATCH 1/2 v2] ext4: move ext4_ind_migrate() into migrate.c Lukas Czerner
2013-04-09 11:24 ` [PATCH 2/2 v2] ext4: Do not convert to indirect with bigalloc enabled Lukas Czerner
@ 2013-04-09 12:47 ` Zheng Liu
2013-04-11 3:58 ` Theodore Ts'o
2 siblings, 0 replies; 10+ messages in thread
From: Zheng Liu @ 2013-04-09 12:47 UTC (permalink / raw)
To: Lukas Czerner; +Cc: linux-ext4
On Tue, Apr 09, 2013 at 01:24:46PM +0200, Lukas Czerner wrote:
> Move ext4_ind_migrate() into migrate.c file since it makes much more
> sense and ext4_ext_migrate() is there as well.
>
> Also fix tiny style problem - add spaces around "=" in "i=0".
>
> Signed-off-by: Lukas Czerner <lczerner@redhat.com>
Reviewed-by: Zheng Liu <wenqing.lz@taobao.com>
Regards,
- Zheng
> ---
> v2: added to the series
>
> fs/ext4/ext4.h | 2 +-
> fs/ext4/extents.c | 59 ----------------------------------------------------
> fs/ext4/migrate.c | 60 ++++++++++++++++++++++++++++++++++++++++++++++++++++-
> 3 files changed, 60 insertions(+), 61 deletions(-)
>
> diff --git a/fs/ext4/ext4.h b/fs/ext4/ext4.h
> index a0637e5..bb56920 100644
> --- a/fs/ext4/ext4.h
> +++ b/fs/ext4/ext4.h
> @@ -2131,6 +2131,7 @@ extern long ext4_compat_ioctl(struct file *, unsigned int, unsigned long);
>
> /* migrate.c */
> extern int ext4_ext_migrate(struct inode *);
> +extern int ext4_ind_migrate(struct inode *inode);
>
> /* namei.c */
> extern int ext4_dirent_csum_verify(struct inode *inode,
> @@ -2620,7 +2621,6 @@ extern int ext4_find_delalloc_range(struct inode *inode,
> extern int ext4_find_delalloc_cluster(struct inode *inode, ext4_lblk_t lblk);
> extern int ext4_fiemap(struct inode *inode, struct fiemap_extent_info *fieinfo,
> __u64 start, __u64 len);
> -extern int ext4_ind_migrate(struct inode *inode);
>
>
> /* move_extent.c */
> diff --git a/fs/ext4/extents.c b/fs/ext4/extents.c
> index 6c5a70a..3645357 100644
> --- a/fs/ext4/extents.c
> +++ b/fs/ext4/extents.c
> @@ -4715,62 +4715,3 @@ int ext4_fiemap(struct inode *inode, struct fiemap_extent_info *fieinfo,
>
> return error;
> }
> -
> -/*
> - * Migrate a simple extent-based inode to use the i_blocks[] array
> - */
> -int ext4_ind_migrate(struct inode *inode)
> -{
> - struct ext4_extent_header *eh;
> - struct ext4_super_block *es = EXT4_SB(inode->i_sb)->s_es;
> - struct ext4_inode_info *ei = EXT4_I(inode);
> - struct ext4_extent *ex;
> - unsigned int i, len;
> - ext4_fsblk_t blk;
> - handle_t *handle;
> - int ret;
> -
> - if (!EXT4_HAS_INCOMPAT_FEATURE(inode->i_sb,
> - EXT4_FEATURE_INCOMPAT_EXTENTS) ||
> - (!ext4_test_inode_flag(inode, EXT4_INODE_EXTENTS)))
> - return -EINVAL;
> -
> - down_write(&EXT4_I(inode)->i_data_sem);
> - ret = ext4_ext_check_inode(inode);
> - if (ret)
> - goto errout;
> -
> - eh = ext_inode_hdr(inode);
> - ex = EXT_FIRST_EXTENT(eh);
> - if (ext4_blocks_count(es) > EXT4_MAX_BLOCK_FILE_PHYS ||
> - eh->eh_depth != 0 || eh->eh_entries > 1) {
> - ret = -EOPNOTSUPP;
> - goto errout;
> - }
> - if (eh->eh_entries == 0)
> - blk = len = 0;
> - else {
> - len = le16_to_cpu(ex->ee_len);
> - blk = ext4_ext_pblock(ex);
> - if (len > EXT4_NDIR_BLOCKS) {
> - ret = -EOPNOTSUPP;
> - goto errout;
> - }
> - }
> -
> - handle = ext4_journal_start(inode, EXT4_HT_MIGRATE, 1);
> - if (IS_ERR(handle)) {
> - ret = PTR_ERR(handle);
> - goto errout;
> - }
> -
> - ext4_clear_inode_flag(inode, EXT4_INODE_EXTENTS);
> - memset(ei->i_data, 0, sizeof(ei->i_data));
> - for (i=0; i < len; i++)
> - ei->i_data[i] = cpu_to_le32(blk++);
> - ext4_mark_inode_dirty(handle, inode);
> - ext4_journal_stop(handle);
> -errout:
> - up_write(&EXT4_I(inode)->i_data_sem);
> - return ret;
> -}
> diff --git a/fs/ext4/migrate.c b/fs/ext4/migrate.c
> index 480acf4..3464604 100644
> --- a/fs/ext4/migrate.c
> +++ b/fs/ext4/migrate.c
> @@ -426,7 +426,6 @@ static int free_ext_block(handle_t *handle, struct inode *inode)
> return retval;
> }
> return retval;
> -
> }
>
> int ext4_ext_migrate(struct inode *inode)
> @@ -606,3 +605,62 @@ out:
>
> return retval;
> }
> +
> +/*
> + * Migrate a simple extent-based inode to use the i_blocks[] array
> + */
> +int ext4_ind_migrate(struct inode *inode)
> +{
> + struct ext4_extent_header *eh;
> + struct ext4_super_block *es = EXT4_SB(inode->i_sb)->s_es;
> + struct ext4_inode_info *ei = EXT4_I(inode);
> + struct ext4_extent *ex;
> + unsigned int i, len;
> + ext4_fsblk_t blk;
> + handle_t *handle;
> + int ret;
> +
> + if (!EXT4_HAS_INCOMPAT_FEATURE(inode->i_sb,
> + EXT4_FEATURE_INCOMPAT_EXTENTS) ||
> + (!ext4_test_inode_flag(inode, EXT4_INODE_EXTENTS)))
> + return -EINVAL;
> +
> + down_write(&EXT4_I(inode)->i_data_sem);
> + ret = ext4_ext_check_inode(inode);
> + if (ret)
> + goto errout;
> +
> + eh = ext_inode_hdr(inode);
> + ex = EXT_FIRST_EXTENT(eh);
> + if (ext4_blocks_count(es) > EXT4_MAX_BLOCK_FILE_PHYS ||
> + eh->eh_depth != 0 || eh->eh_entries > 1) {
> + ret = -EOPNOTSUPP;
> + goto errout;
> + }
> + if (eh->eh_entries == 0)
> + blk = len = 0;
> + else {
> + len = le16_to_cpu(ex->ee_len);
> + blk = ext4_ext_pblock(ex);
> + if (len > EXT4_NDIR_BLOCKS) {
> + ret = -EOPNOTSUPP;
> + goto errout;
> + }
> + }
> +
> + handle = ext4_journal_start(inode, EXT4_HT_MIGRATE, 1);
> + if (IS_ERR(handle)) {
> + ret = PTR_ERR(handle);
> + goto errout;
> + }
> +
> + ext4_clear_inode_flag(inode, EXT4_INODE_EXTENTS);
> + memset(ei->i_data, 0, sizeof(ei->i_data));
> + for (i = 0; i < len; i++)
> + ei->i_data[i] = cpu_to_le32(blk++);
> + ext4_mark_inode_dirty(handle, inode);
> + ext4_journal_stop(handle);
> +errout:
> + up_write(&EXT4_I(inode)->i_data_sem);
> + return ret;
> +}
> --
> 1.7.7.6
>
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [PATCH 1/2 v2] ext4: move ext4_ind_migrate() into migrate.c
2013-04-09 11:24 [PATCH 1/2 v2] ext4: move ext4_ind_migrate() into migrate.c Lukas Czerner
2013-04-09 11:24 ` [PATCH 2/2 v2] ext4: Do not convert to indirect with bigalloc enabled Lukas Czerner
2013-04-09 12:47 ` [PATCH 1/2 v2] ext4: move ext4_ind_migrate() into migrate.c Zheng Liu
@ 2013-04-11 3:58 ` Theodore Ts'o
2013-04-11 5:54 ` Dmitry Monakhov
2013-04-11 8:18 ` Lukáš Czerner
2 siblings, 2 replies; 10+ messages in thread
From: Theodore Ts'o @ 2013-04-11 3:58 UTC (permalink / raw)
To: Lukas Czerner; +Cc: linux-ext4, gnehzuil.liu
On Tue, Apr 09, 2013 at 01:24:46PM +0200, Lukas Czerner wrote:
> Move ext4_ind_migrate() into migrate.c file since it makes much more
> sense and ext4_ext_migrate() is there as well.
>
> Also fix tiny style problem - add spaces around "=" in "i=0".
>
> Signed-off-by: Lukas Czerner <lczerner@redhat.com>
I had to regenerate this patch since ext4_ind_migrate has been changed
by other patches in the ext4 patch queue, but it's applied now.
- Ted
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [PATCH 1/2 v2] ext4: move ext4_ind_migrate() into migrate.c
2013-04-11 3:58 ` Theodore Ts'o
@ 2013-04-11 5:54 ` Dmitry Monakhov
2013-04-11 8:18 ` Lukáš Czerner
1 sibling, 0 replies; 10+ messages in thread
From: Dmitry Monakhov @ 2013-04-11 5:54 UTC (permalink / raw)
To: Theodore Ts'o, Lukas Czerner; +Cc: linux-ext4, gnehzuil.liu
[-- Attachment #1: Type: text/plain, Size: 635 bytes --]
On Wed, 10 Apr 2013 23:58:26 -0400, Theodore Ts'o <tytso@mit.edu> wrote:
> On Tue, Apr 09, 2013 at 01:24:46PM +0200, Lukas Czerner wrote:
> > Move ext4_ind_migrate() into migrate.c file since it makes much more
> > sense and ext4_ext_migrate() is there as well.
> >
> > Also fix tiny style problem - add spaces around "=" in "i=0".
> >
> > Signed-off-by: Lukas Czerner <lczerner@redhat.com>
>
> I had to regenerate this patch since ext4_ind_migrate has been changed
> by other patches in the ext4 patch queue, but it's applied now.
You have placed it in to wrong position, Obviously check should be performed before
journal_start()
[-- Attachment #2: fix --]
[-- Type: application/octet-stream, Size: 694 bytes --]
diff --git a/fs/ext4/migrate.c b/fs/ext4/migrate.c
index 8d64067..8052070 100644
--- a/fs/ext4/migrate.c
+++ b/fs/ext4/migrate.c
@@ -625,13 +625,14 @@ int ext4_ind_migrate(struct inode *inode)
(!ext4_test_inode_flag(inode, EXT4_INODE_EXTENTS)))
return -EINVAL;
+ if (EXT4_HAS_RO_COMPAT_FEATURE(inode->i_sb,
+ EXT4_FEATURE_RO_COMPAT_BIGALLOC))
+ return -EOPNOTSUPP;
+
handle = ext4_journal_start(inode, EXT4_HT_MIGRATE, 1);
if (IS_ERR(handle))
return PTR_ERR(handle);
- if (EXT4_HAS_RO_COMPAT_FEATURE(inode->i_sb,
- EXT4_FEATURE_RO_COMPAT_BIGALLOC))
- return -EOPNOTSUPP;
down_write(&EXT4_I(inode)->i_data_sem);
ret = ext4_ext_check_inode(inode);
[-- Attachment #3: Type: text/plain, Size: 234 bytes --]
>
> - Ted
> --
> 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
^ permalink raw reply related [flat|nested] 10+ messages in thread
* Re: [PATCH 1/2 v2] ext4: move ext4_ind_migrate() into migrate.c
2013-04-11 3:58 ` Theodore Ts'o
2013-04-11 5:54 ` Dmitry Monakhov
@ 2013-04-11 8:18 ` Lukáš Czerner
2013-04-11 14:56 ` Theodore Ts'o
1 sibling, 1 reply; 10+ messages in thread
From: Lukáš Czerner @ 2013-04-11 8:18 UTC (permalink / raw)
To: Theodore Ts'o; +Cc: Lukas Czerner, linux-ext4, gnehzuil.liu
On Wed, 10 Apr 2013, Theodore Ts'o wrote:
> Date: Wed, 10 Apr 2013 23:58:26 -0400
> From: Theodore Ts'o <tytso@mit.edu>
> To: Lukas Czerner <lczerner@redhat.com>
> Cc: linux-ext4@vger.kernel.org, gnehzuil.liu@gmail.com
> Subject: Re: [PATCH 1/2 v2] ext4: move ext4_ind_migrate() into migrate.c
>
> On Tue, Apr 09, 2013 at 01:24:46PM +0200, Lukas Czerner wrote:
> > Move ext4_ind_migrate() into migrate.c file since it makes much more
> > sense and ext4_ext_migrate() is there as well.
> >
> > Also fix tiny style problem - add spaces around "=" in "i=0".
> >
> > Signed-off-by: Lukas Czerner <lczerner@redhat.com>
>
> I had to regenerate this patch since ext4_ind_migrate has been changed
> by other patches in the ext4 patch queue, but it's applied now.
Thanks, but Dmitry is right, the check should be before the
journal_start() call.
I am not sure how much work will it be for you, but would it be
possible to resend patch to the list when you change it ? Just to
make sure we do not get unnecessary problems.
Thanks!
-Lukas
>
> - Ted
>
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [PATCH 1/2 v2] ext4: move ext4_ind_migrate() into migrate.c
2013-04-11 8:18 ` Lukáš Czerner
@ 2013-04-11 14:56 ` Theodore Ts'o
2013-04-11 15:15 ` Lukáš Czerner
0 siblings, 1 reply; 10+ messages in thread
From: Theodore Ts'o @ 2013-04-11 14:56 UTC (permalink / raw)
To: Lukáš Czerner; +Cc: linux-ext4, gnehzuil.liu
On Thu, Apr 11, 2013 at 10:18:16AM +0200, Lukáš Czerner wrote:
> Thanks, but Dmitry is right, the check should be before the
> journal_start() call.
Whoops! I'm not sure how I screwed that up. Thanks for catching
that, Dmitry!
> I am not sure how much work will it be for you, but would it be
> possible to resend patch to the list when you change it ? Just to
> make sure we do not get unnecessary problems.
Yes, I'll try to do that in the future. Here's the revised patch....
- Ted
commit 3b296c66fe6f9a6ed44b0b83f4f2ae87d8874af6
Author: Lukas Czerner <lczerner@redhat.com>
Date: Thu Apr 11 10:54:46 2013 -0400
ext4: do not convert to indirect with bigalloc enabled
With bigalloc feature enabled we do not support indirect addressing at all
so we have to prevent extent addressing to indirect addressing
conversion in this case. The problem has been introduced with the commit
"ext4: support simple conversion of extent-mapped inodes to use i_blocks"
Signed-off-by: Lukas Czerner <lczerner@redhat.com>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
diff --git a/fs/ext4/migrate.c b/fs/ext4/migrate.c
index d129a4d..49e8bdf 100644
--- a/fs/ext4/migrate.c
+++ b/fs/ext4/migrate.c
@@ -625,6 +625,10 @@ int ext4_ind_migrate(struct inode *inode)
(!ext4_test_inode_flag(inode, EXT4_INODE_EXTENTS)))
return -EINVAL;
+ if (EXT4_HAS_RO_COMPAT_FEATURE(inode->i_sb,
+ EXT4_FEATURE_RO_COMPAT_BIGALLOC))
+ return -EOPNOTSUPP;
+
handle = ext4_journal_start(inode, EXT4_HT_MIGRATE, 1);
if (IS_ERR(handle))
return PTR_ERR(handle);
--
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
^ permalink raw reply related [flat|nested] 10+ messages in thread
* Re: [PATCH 1/2 v2] ext4: move ext4_ind_migrate() into migrate.c
2013-04-11 14:56 ` Theodore Ts'o
@ 2013-04-11 15:15 ` Lukáš Czerner
0 siblings, 0 replies; 10+ messages in thread
From: Lukáš Czerner @ 2013-04-11 15:15 UTC (permalink / raw)
To: Theodore Ts'o; +Cc: Lukáš Czerner, linux-ext4, gnehzuil.liu
[-- Attachment #1: Type: TEXT/PLAIN, Size: 2046 bytes --]
On Thu, 11 Apr 2013, Theodore Ts'o wrote:
> Date: Thu, 11 Apr 2013 10:56:20 -0400
> From: Theodore Ts'o <tytso@mit.edu>
> To: Lukáš Czerner <lczerner@redhat.com>
> Cc: linux-ext4@vger.kernel.org, gnehzuil.liu@gmail.com
> Subject: Re: [PATCH 1/2 v2] ext4: move ext4_ind_migrate() into migrate.c
>
> On Thu, Apr 11, 2013 at 10:18:16AM +0200, Lukáš Czerner wrote:
> > Thanks, but Dmitry is right, the check should be before the
> > journal_start() call.
>
> Whoops! I'm not sure how I screwed that up. Thanks for catching
> that, Dmitry!
>
> > I am not sure how much work will it be for you, but would it be
> > possible to resend patch to the list when you change it ? Just to
> > make sure we do not get unnecessary problems.
>
> Yes, I'll try to do that in the future. Here's the revised patch....
>
Thanks! Now it looks ok.
-Lukas
> - Ted
>
> commit 3b296c66fe6f9a6ed44b0b83f4f2ae87d8874af6
> Author: Lukas Czerner <lczerner@redhat.com>
> Date: Thu Apr 11 10:54:46 2013 -0400
>
> ext4: do not convert to indirect with bigalloc enabled
>
> With bigalloc feature enabled we do not support indirect addressing at all
> so we have to prevent extent addressing to indirect addressing
> conversion in this case. The problem has been introduced with the commit
> "ext4: support simple conversion of extent-mapped inodes to use i_blocks"
>
> Signed-off-by: Lukas Czerner <lczerner@redhat.com>
> Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
>
> diff --git a/fs/ext4/migrate.c b/fs/ext4/migrate.c
> index d129a4d..49e8bdf 100644
> --- a/fs/ext4/migrate.c
> +++ b/fs/ext4/migrate.c
> @@ -625,6 +625,10 @@ int ext4_ind_migrate(struct inode *inode)
> (!ext4_test_inode_flag(inode, EXT4_INODE_EXTENTS)))
> return -EINVAL;
>
> + if (EXT4_HAS_RO_COMPAT_FEATURE(inode->i_sb,
> + EXT4_FEATURE_RO_COMPAT_BIGALLOC))
> + return -EOPNOTSUPP;
> +
> handle = ext4_journal_start(inode, EXT4_HT_MIGRATE, 1);
> if (IS_ERR(handle))
> return PTR_ERR(handle);
>
^ permalink raw reply [flat|nested] 10+ messages in thread
end of thread, other threads:[~2013-04-11 15:15 UTC | newest]
Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-04-09 11:24 [PATCH 1/2 v2] ext4: move ext4_ind_migrate() into migrate.c Lukas Czerner
2013-04-09 11:24 ` [PATCH 2/2 v2] ext4: Do not convert to indirect with bigalloc enabled Lukas Czerner
2013-04-09 12:48 ` Zheng Liu
2013-04-11 3:58 ` Theodore Ts'o
2013-04-09 12:47 ` [PATCH 1/2 v2] ext4: move ext4_ind_migrate() into migrate.c Zheng Liu
2013-04-11 3:58 ` Theodore Ts'o
2013-04-11 5:54 ` Dmitry Monakhov
2013-04-11 8:18 ` Lukáš Czerner
2013-04-11 14:56 ` Theodore Ts'o
2013-04-11 15:15 ` Lukáš Czerner
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).