Skip to contentSkip to conversation

staging: erofs: don't check special inode layout

PATCH In review Yue Hu 3 participants 4 messages Jun 28, 2019 – Jun 29, 2019 Staging

lore
Share & tools
lore

Yue Hu

author
#0 lore raw

PATCH 1/1 staging: erofs: don't check special inode layout

From: Yue Hu <[email protected]>

Currently, we will check if inode layout is compression or inline if the inode is special in fill_inode(). Also set ->i_mapping->a_ops for it. That is pointless since the both modes won't be set for special inode when creating EROFS filesystem image. So, let's avoid it.

Signed-off-by Yue Hu <huyue2 at yulong.com>
---
 drivers/staging/erofs/inode.c | 1 +
 1 file changed, 1 insertion(+)
drivers/staging/erofs/inode.c +1 -0
index 1433f25..2fe0f6d 100644
@@ -205,6 +205,7 @@ static int fill_inode(struct inode *inode, int isdir)
 			S_ISFIFO(inode->i_mode) || S_ISSOCK(inode->i_mode)) {
 			inode->i_op = &erofs_generic_iops;
 			init_special_inode(inode, inode->i_mode, inode->i_rdev);
+			goto out_unlock;
 		} else {
 			err = -EIO;
 			goto out_unlock;
Signature · 1 line
1.9.1
#1 lore raw

Hi Yue,

Quoted 8 lines · Yue Hu

From: Yue Hu <huyue2 at yulong.com>

Currently, we will check if inode layout is compression or inline if the inode is special in fill_inode(). Also set ->i_mapping->a_ops for it. That is pointless since the both modes won't be set for special inode when creating EROFS filesystem image. So, let's avoid it.

Signed-off-by Yue Hu <huyue2 at yulong.com>

Have you test this patch with some actual image with legacy mkfs since new mkfs framework have not supported special inode...

I think that is fine in priciple, however, in case to introduce some potential issues, I will test this patch later. I will give a Reviewed-by tag after I tested this patch.

Thanks,
Gao Xiang

Quoted 17 lines
---
 drivers/staging/erofs/inode.c | 1 +
 1 file changed, 1 insertion(+)
drivers/staging/erofs/inode.c +1 -0
index 1433f25..2fe0f6d 100644
@@ -205,6 +205,7 @@ static int fill_inode(struct inode *inode, int isdir)
 			S_ISFIFO(inode->i_mode) || S_ISSOCK(inode->i_mode)) {
 			inode->i_op = &erofs_generic_iops;
 			init_special_inode(inode, inode->i_mode, inode->i_rdev);
+			goto out_unlock;
 		} else {
 			err = -EIO;
 			goto out_unlock;
author
#2 lore raw
Quoted 10 lines · On Fri, 28 Jun 2019 11:50:21 +0800 Gao Xiang <[email protected]> wrote:

Hi Yue,

Quoted 7 lines · Yue Hu

From: Yue Hu <huyue2 at yulong.com>

Currently, we will check if inode layout is compression or inline if the inode is special in fill_inode(). Also set ->i_mapping->a_ops for it. That is pointless since the both modes won't be set for special inode when creating EROFS filesystem image. So, let's avoid it.

Quoted 4 lines
Quoted 1 line
Signed-off-by Yue Hu <huyue2 at yulong.com>

Have you test this patch with some actual image with legacy mkfs since new mkfs framework have not supported special inode...

Hi Xiang,

I'm studying the testing :)

However, already check the code handling for special inode in leagcy mkfs as below:

```c
                break;
        case EROFS_FT_BLKDEV:
        case EROFS_FT_CHRDEV:
        case EROFS_FT_FIFO:
        case EROFS_FT_SOCK:
                mkfs_rank_inode(d);
                break;

        default:
                erofs_err("inode[%s] file_type error =%d",
                          d->i_fullpath,
```

No special inode layout operations, so this change should be fine.

Thx.

Quoted 4 lines

I think that is fine in priciple, however, in case to introduce some potential issues, I will test this patch later. I will give a Reviewed-by tag after I tested this patch.

Thanks.

Quoted 21 lines

Thanks,
Gao Xiang

Quoted 17 lines
---
 drivers/staging/erofs/inode.c | 1 +
 1 file changed, 1 insertion(+)
drivers/staging/erofs/inode.c +1 -0
index 1433f25..2fe0f6d 100644
@@ -205,6 +205,7 @@ static int fill_inode(struct inode *inode, int isdir)
 			S_ISFIFO(inode->i_mode) || S_ISSOCK(inode->i_mode)) {
 			inode->i_op = &erofs_generic_iops;
 			init_special_inode(inode, inode->i_mode, inode->i_rdev);
+			goto out_unlock;
 		} else {
 			err = -EIO;
 			goto out_unlock;
Reviewed-by
#3 lore raw
Quoted 38 lines · Yue Hu
Quoted 10 lines · On Fri, 28 Jun 2019 11:50:21 +0800 Gao Xiang <[email protected]> wrote:

Hi Yue,

Quoted 7 lines · Yue Hu

From: Yue Hu <huyue2 at yulong.com>

Currently, we will check if inode layout is compression or inline if the inode is special in fill_inode(). Also set ->i_mapping->a_ops for it. That is pointless since the both modes won't be set for special inode when creating EROFS filesystem image. So, let's avoid it.

Quoted 4 lines
Quoted 1 line
Signed-off-by Yue Hu <huyue2 at yulong.com>

Have you test this patch with some actual image with legacy mkfs since new mkfs framework have not supported special inode...

Hi Xiang,

I'm studying the testing :)

However, already check the code handling for special inode in leagcy mkfs as below:

```c
                break;
        case EROFS_FT_BLKDEV:
        case EROFS_FT_CHRDEV:
        case EROFS_FT_FIFO:
        case EROFS_FT_SOCK:
                mkfs_rank_inode(d);
                break;

        default:
                erofs_err("inode[%s] file_type error =%d",
                          d->i_fullpath,
```
Quoted 8 lines

No special inode layout operations, so this change should be fine.

Thx.

Quoted 4 lines

I think that is fine in priciple, however, in case to introduce some potential issues, I will test this patch later. I will give a Reviewed-by tag after I tested this patch.

This patch looks good to me, if this won't fail any tests from Xiang, you can add:

Reviewed-by Chao Yu <yuchao0 at huawei.com>

Thanks,

Quoted 27 lines

Thanks.

Quoted 8 lines

Thanks,
Gao Xiang

Quoted 4 lines
---
 drivers/staging/erofs/inode.c | 1 +
 1 file changed, 1 insertion(+)
Quoted 13 lines

drivers/staging/erofs/inode.c static int fill_inode(struct inode *inode, int isdir) · line 211

Quoted 13 lines
drivers/staging/erofs/inode.c +1 -0
index 1433f25..2fe0f6d 100644
@@ -205,6 +205,7 @@ static int fill_inode(struct inode *inode, int isdir)
 			S_ISFIFO(inode->i_mode) || S_ISSOCK(inode->i_mode)) {
 			inode->i_op = &erofs_generic_iops;
 			init_special_inode(inode, inode->i_mode, inode->i_rdev);
+			goto out_unlock;
 		} else {
 			err = -EIO;
 			goto out_unlock;

.