From: Eric Sandeen <sandeen@redhat.com>
To: Robert Yang <liezhi.yang@windriver.com>
Cc: "Darrick J. Wong" <darrick.wong@oracle.com>,
linux-ext4@vger.kernel.org, "Theodore Ts'o" <tytso@mit.edu>,
Darren Hart <dvhart@linux.intel.com>
Subject: Re: e2fsprogs/debugfs/write: Input/output error when file size is zero
Date: Wed, 24 Jul 2013 10:00:04 -0500 [thread overview]
Message-ID: <51EFEBF4.20701@redhat.com> (raw)
In-Reply-To: <51EF975E.2090700@windriver.com>
On 7/24/13 3:59 AM, Robert Yang wrote:
>
> Hello experts,
>
> I met a "Input/output error" problem when used debugfs' command "write"
> to copy a zero size file to ext4 fs, here are the steps to reproduce the
> problem:
>
> $ dd if=/dev/zero of=test.img count=1M bs=1k
> $ mkfs.ext4 -F test.img
> $ touch emptyfile
> $ debugfs -R "write emptyfile emptyfile" -w test.img
> $ mkdir mnt
> $ mount test.img mnt/
> $ ls mnt/emptyfile
> ls: cannot access mnt/emptyfile: Input/output error
>
> The degbufs is from the up-to-date git repo, the ext2 and ext3 work well,
> I think that it is caused by the EXT4_EXTENTS_FL, it works well if we
> turn off the EXT4_EXTENTS_FL when the file size is zero, but this is not
> a correct fix, would you please give me some instructions so that I can
> fix it?
When reporting problems like this it's helpful to include which kernel version
you tested, all the error messages (including dmesg), etc.
But on upstream it persists, and when we do the ls, we get:
[40992.729130] EXT4-fs error (device loop0): ext4_ext_check_inode:464: inode #12: comm ls: bad header/extent: invalid magic - magic 0, entries 0, max 0(0), depth 0(0)
so it seems that debugfs has created a corrupt inode in the image.
I'll send a patch.
next prev parent reply other threads:[~2013-07-24 15:09 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-07-24 8:59 e2fsprogs/debugfs/write: Input/output error when file size is zero Robert Yang
2013-07-24 15:00 ` Eric Sandeen [this message]
2013-07-24 15:11 ` [PATCH] debugfs: properly set up extent header in do_write Eric Sandeen
2013-07-25 6:18 ` Robert Yang
2013-07-29 2:33 ` Theodore Ts'o
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=51EFEBF4.20701@redhat.com \
--to=sandeen@redhat.com \
--cc=darrick.wong@oracle.com \
--cc=dvhart@linux.intel.com \
--cc=liezhi.yang@windriver.com \
--cc=linux-ext4@vger.kernel.org \
--cc=tytso@mit.edu \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).