diff --git a/debugfs.ocfs2-Fix-the-error-on-devices-with-sector-s.patch b/debugfs.ocfs2-Fix-the-error-on-devices-with-sector-s.patch new file mode 100644 index 0000000..32e329e --- /dev/null +++ b/debugfs.ocfs2-Fix-the-error-on-devices-with-sector-s.patch @@ -0,0 +1,49 @@ +From 4ab576767129a89f3ff6d60c85c23c3be80c2dae Mon Sep 17 00:00:00 2001 +From: Gang He +Date: Wed, 6 May 2020 18:06:07 +0800 +Subject: [PATCH] debugfs.ocfs2: Fix the error on devices with sector size 4096 + +Debugfs.ocfs2 can not work on devices with sector size 4096, +e.g. + # debugfs.ocfs2 -s 1 /dev/sdd + open: I/O error on channel Can't get the blocksize from the device by the num 1 + # blockdev --getss /dev/sdd + 4096 + +we should remove these line hard code, then debugfs.ocfs2 works on +different sector size devices. +--- + debugfs.ocfs2/commands.c | 10 +--------- + 1 file changed, 1 insertion(+), 9 deletions(-) + +diff --git a/debugfs.ocfs2/commands.c b/debugfs.ocfs2/commands.c +index cc88583c..b1ee6172 100644 +--- a/debugfs.ocfs2/commands.c ++++ b/debugfs.ocfs2/commands.c +@@ -482,14 +482,6 @@ static errcode_t get_blocksize(char* dev, uint64_t offset, uint64_t *blocksize, + if (ret) + goto bail; + +- /* since ocfs2_super_block inode can be stored in OCFS2_MIN_BLOCKSIZE, +- * so here we just use the minimum block size and read the information +- * in the specific offset. +- */ +- ret = io_set_blksize(channel, OCFS2_MIN_BLOCKSIZE); +- if (ret) +- goto bail; +- + ret = ocfs2_malloc_block(channel, &buf); + if (ret) + goto bail; +@@ -507,7 +499,7 @@ static errcode_t get_blocksize(char* dev, uint64_t offset, uint64_t *blocksize, + offset = hdr->hdr_superblocks[super_no-1] * hdr->hdr_fsblksz; + } + +- blkno = offset / OCFS2_MIN_BLOCKSIZE; ++ blkno = offset / io_get_blksize(channel); + ret = io_read_block(channel, blkno, 1, buf); + if (ret) + goto bail; +-- +2.21.0 + diff --git a/ocfs2-tools.changes b/ocfs2-tools.changes index edb2da3..2166370 100644 --- a/ocfs2-tools.changes +++ b/ocfs2-tools.changes @@ -1,3 +1,9 @@ +------------------------------------------------------------------- +Wed May 6 11:30:20 UTC 2020 - ghe@suse.com + +- Fix debugfs.ocfs2 error on devices with sector size 4096 (bsc#1170530) + + debugfs.ocfs2-Fix-the-error-on-devices-with-sector-s.patch + ------------------------------------------------------------------- Thu Jan 30 10:29:12 UTC 2020 - Thorsten Kukuk diff --git a/ocfs2-tools.spec b/ocfs2-tools.spec index 4b44a90..65f1261 100644 --- a/ocfs2-tools.spec +++ b/ocfs2-tools.spec @@ -1,7 +1,7 @@ # # spec file for package ocfs2-tools # -# Copyright (c) 2020 SUSE LLC +# Copyright (c) 2020 SUSE LINUX GmbH, Nuernberg, Germany. # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -60,6 +60,7 @@ Patch501: bnc#96864-ocfs2console-fix-starting-failure.patch Patch502: fsck.ocfs2-fix-compile-error-when-glibc-upgrade.patch Patch503: mounted.ocfs2-use-sys-sysmacros.h-include-for-makede.patch Patch504: fix-build-failure-with-glibc-2.28.patch +Patch505: debugfs.ocfs2-Fix-the-error-on-devices-with-sector-s.patch BuildRequires: autoconf BuildRequires: e2fsprogs-devel @@ -172,6 +173,7 @@ OCFS2 filesystem. %patch502 -p1 %patch503 -p1 %patch504 -p1 +%patch505 -p1 %build %global _lto_cflags %{_lto_cflags} -ffat-lto-objects