[OpenBMC] [Linux-5.10] useradd: cannot open /etc/passwd

CS20 CHLi30 CHLI30 at nuvoton.com
Wed Mar 31 11:56:12 AEDT 2021


Hi Joel,

Yes, you are right, the problem is jffs2 driver. Below is our analysis result:

Analysis result:
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Yesterday, we added more debug log in fs driver seems relate to do_splice_from() this function.
After replacing this function from kernel 5.4 then issue symptom was gone.

In jffs2 driver (kernel 5.4 and 5.10) that didn't provide .splice_write operation call from file_operations jffs2_file_operations.
But do_splice_from() be changed to verify .splice_write operation in kernel 5.10.
Thus, if didn't find this file operation just return not support write operation.

However, do_splic_from() will provide a default .splice_write function when it's not find .splice_write operation in kernel 5.4.
Thus, we could add .splice_write = iter_file_splice_write in jffs2 driver or using old do_splic_from() function to fix this problem.
We are checking if there is any misunderstanding to work around this issue.
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------

After checking your patch for this issue that did the same solution as our finding in jffs2 driver.
Thanks your help to fix this problem and merge it. Thank you!!!

Sincerely,
Tim

-----Original Message-----
From: Joel Stanley [mailto:joel at jms.id.au]
Sent: Wednesday, March 31, 2021 6:35 AM
To: CS20 CHLi30 <CHLI30 at nuvoton.com>
Cc: Lei Yu <yulei.sh at bytedance.com>; openbmc at lists.ozlabs.org
Subject: Re: [OpenBMC] [Linux-5.10] useradd: cannot open /etc/passwd

On Tue, 30 Mar 2021 at 05:47, CS20 CHLi30 <CHLI30 at nuvoton.com> wrote:
>
> Hi Lei Yu,
>
> Thanks your help to provide this information.
> This issue seems relate to "cannot do write action for /etc/passwd file".
> I'm trying to check whether is relate to jffs2 or overlayfs filesystem driver.

jffs2!

I did a bisection and the offending commit is https://apc01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgit.kernel.org%2Ftorvalds%2Fc%2F36e2c7421f02a&data=04%7C01%7CCHLI30%40nuvoton.com%7Ccd7e5a2f62bd4fbd46e908d8f3cc2035%7Ca3f24931d4034b4a94f17d83ac638e07%7C0%7C0%7C637527405356044360%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=qbmFGMGW5J4mbfQw%2BB%2FzukUwj7kTwiAfESNEbx6Uync%3D&reserved=0, from v5.9-rc1. I have posted a patch that fixes the issue:

https://apc01.safelinks.protection.outlook.com/?url=https%3A%2F%2Flore.kernel.org%2Flkml%2F20210330134537.423447-1-joel%40jms.id.au%2F&data=04%7C01%7CCHLI30%40nuvoton.com%7Ccd7e5a2f62bd4fbd46e908d8f3cc2035%7Ca3f24931d4034b4a94f17d83ac638e07%7C0%7C0%7C637527405356044360%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=m7iDZ2rhyAibeRj2OGDzz999ronznTNLloFqQDyZq%2Bc%3D&reserved=0

I will merge this patch into dev-5.10 today.

Cheers,

Joel
________________________________
________________________________
 The privileged confidential information contained in this email is intended for use only by the addressees as indicated by the original sender of this email. If you are not the addressee indicated in this email or are not responsible for delivery of the email to such a person, please kindly reply to the sender indicating this fact and delete all copies of it from your computer and network server immediately. Your cooperation is highly appreciated. It is advised that any unauthorized use of confidential information of Nuvoton is strictly prohibited; and any information in this email irrelevant to the official business of Nuvoton shall be deemed as neither given nor endorsed by Nuvoton.


More information about the openbmc mailing list