Go to:
Gentoo Home
Documentation
Forums
Lists
Bugs
Planet
Store
Wiki
Get Gentoo!
Gentoo's Bugzilla – Attachment 573764 Details for
Bug 666657
sys-fs/f2fs-tools: fsck.f2fs does never run for root mount
Home
|
New
–
[Ex]
|
Browse
|
Search
|
Privacy Policy
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Fix from upstream.
f2fs-ro-open-falure-fix.patch (text/plain), 2.07 KB, created by
hagbardcelin
on 2019-04-22 07:03:01 UTC
(
hide
)
Description:
Fix from upstream.
Filename:
MIME Type:
Creator:
hagbardcelin
Created:
2019-04-22 07:03:01 UTC
Size:
2.07 KB
patch
obsolete
>From 3221692b060649378f1f69b898ed85a814af3dbf Mon Sep 17 00:00:00 2001 >From: Jaegeuk Kim <jaegeuk@kernel.org> >Date: Tue, 16 Apr 2019 11:46:31 -0700 >Subject: [PATCH] fsck.f2fs: open ro disk if we want to check fs only > >This patch fixes the "open failure" issue on ro disk, reported by Hagbard. > >" > If I boot with kernel option "ro rootfstype=f2fs > I get the following halfway trough boot: > > * Checking local filesystems ... > Info: Use default preen mode > Info: Mounted device! > Info: Check FS only due to RO > Error: Failed to open the device! > * Filesystems couldn't be fixed >" > >Reported-by: Hagbard Celine <hagbardcelin@gmail.com> >Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org> >--- > lib/libf2fs.c | 25 +++++++++++++++++++++---- > 1 file changed, 21 insertions(+), 4 deletions(-) > >diff --git a/lib/libf2fs.c b/lib/libf2fs.c >index d30047f..853e713 100644 >--- a/lib/libf2fs.c >+++ b/lib/libf2fs.c >@@ -789,6 +789,15 @@ void get_kernel_uname_version(__u8 *version) > #endif /* APPLE_DARWIN */ > > #ifndef ANDROID_WINDOWS_HOST >+static int open_check_fs(char *path, int flag) >+{ >+ if (c.func != FSCK || c.fix_on || c.auto_fix) >+ return -1; >+ >+ /* allow to open ro */ >+ return open(path, O_RDONLY | flag); >+} >+ > int get_device_info(int i) > { > int32_t fd = 0; >@@ -810,8 +819,11 @@ int get_device_info(int i) > if (c.sparse_mode) { > fd = open(dev->path, O_RDWR | O_CREAT | O_BINARY, 0644); > if (fd < 0) { >- MSG(0, "\tError: Failed to open a sparse file!\n"); >- return -1; >+ fd = open_check_fs(dev->path, O_BINARY); >+ if (fd < 0) { >+ MSG(0, "\tError: Failed to open a sparse file!\n"); >+ return -1; >+ } > } > } > >@@ -825,10 +837,15 @@ int get_device_info(int i) > return -1; > } > >- if (S_ISBLK(stat_buf->st_mode) && !c.force) >+ if (S_ISBLK(stat_buf->st_mode) && !c.force) { > fd = open(dev->path, O_RDWR | O_EXCL); >- else >+ if (fd < 0) >+ fd = open_check_fs(dev->path, O_EXCL); >+ } else { > fd = open(dev->path, O_RDWR); >+ if (fd < 0) >+ fd = open_check_fs(dev->path, 0); >+ } > } > if (fd < 0) { > MSG(0, "\tError: Failed to open the device!\n"); >-- >2.19.0.605.g01d371f741-goog >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 666657
: 573764 |
573908