linux-ext4.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Zheng Liu <gnehzuil.liu@gmail.com>
To: Dmitry Monakhov <dmonakhov@openvz.org>
Cc: Christian Kujau <lists@nerdbynature.de>,
	CAI Qian <caiqian@redhat.com>, Theodore Ts'o <tytso@mit.edu>,
	LKML <linux-kernel@vger.kernel.org>,
	linux-s390 <linux-s390@vger.kernel.org>,
	Steve Best <sbest@redhat.com>,
	linux-ext4@vger.kernel.org
Subject: Re: s390x: kernel BUG at fs/ext4/inode.c:1591! (powerpc too!)
Date: Wed, 3 Apr 2013 18:22:04 +0800	[thread overview]
Message-ID: <20130403102204.GA15383@gmail.com> (raw)
In-Reply-To: <87hajoq6s2.fsf@openvz.org>

On Wed, Apr 03, 2013 at 01:53:49PM +0400, Dmitry Monakhov wrote:
> On Wed, 03 Apr 2013 12:52:06 +0400, Dmitry Monakhov <dmonakhov@openvz.org> wrote:
> Non-text part: multipart/mixed
> > On Tue, 2 Apr 2013 16:22:41 -0700 (PDT), Christian Kujau <lists@nerdbynature.de> wrote:
> > > On Wed, 3 Apr 2013 at 02:05, Dmitry Monakhov wrote:
> > > > Please drop that patch and collect logs with a kernel which 
> > > > has only 0001-enable-ES_AGGRESSIVE_TEST-V2.patch patch applied
> > Ok I have found at least one issue.
> Yeah.. My college advise me to use sparse in order to spot all
> cpu_to_ondisk format conversion
> make C=2 CF="-D__CHECK_ENDIAN__" fs/ext4/ 
> And it spotted a huge amount of issues. Which tell us that we are deeply
> in shit.

Yes, My college also suggest me that we should use sparse to check this
problem.  I think the following patch could fix this bug.

Regards,
                                                - Zheng

Subject: [PATCH] ext4: fix a big-endian bug when an extent is zeroed out

From: Zheng Liu <wenqing.lz@taobao.com>

When an extent was zeroed out, we forgot to do convert from cpu to le16.
It could make us hit a BUG_ON when we try to write dirty pages out.  So
fix it.

Signed-off-by: Zheng Liu <wenqing.lz@taobao.com>
---
 fs/ext4/extents.c | 11 +++++++----
 1 file changed, 7 insertions(+), 4 deletions(-)

diff --git a/fs/ext4/extents.c b/fs/ext4/extents.c
index e4a6844..2352467 100644
--- a/fs/ext4/extents.c
+++ b/fs/ext4/extents.c
@@ -2999,20 +2999,23 @@ static int ext4_split_extent_at(handle_t *handle,
 			if (split_flag & EXT4_EXT_DATA_VALID1) {
 				err = ext4_ext_zeroout(inode, ex2);
 				zero_ex.ee_block = ex2->ee_block;
-				zero_ex.ee_len = ext4_ext_get_actual_len(ex2);
+				zero_ex.ee_len = cpu_to_le16(
+						ext4_ext_get_actual_len(ex2));
 				ext4_ext_store_pblock(&zero_ex,
 						      ext4_ext_pblock(ex2));
 			} else {
 				err = ext4_ext_zeroout(inode, ex);
 				zero_ex.ee_block = ex->ee_block;
-				zero_ex.ee_len = ext4_ext_get_actual_len(ex);
+				zero_ex.ee_len = cpu_to_le16(
+						ext4_ext_get_actual_len(ex));
 				ext4_ext_store_pblock(&zero_ex,
 						      ext4_ext_pblock(ex));
 			}
 		} else {
 			err = ext4_ext_zeroout(inode, &orig_ex);
 			zero_ex.ee_block = orig_ex.ee_block;
-			zero_ex.ee_len = ext4_ext_get_actual_len(&orig_ex);
+			zero_ex.ee_len = cpu_to_le16(
+						ext4_ext_get_actual_len(&orig_ex));
 			ext4_ext_store_pblock(&zero_ex,
 					      ext4_ext_pblock(&orig_ex));
 		}
@@ -3272,7 +3275,7 @@ static int ext4_ext_convert_to_initialized(handle_t *handle,
 		if (err)
 			goto out;
 		zero_ex.ee_block = ex->ee_block;
-		zero_ex.ee_len = ext4_ext_get_actual_len(ex);
+		zero_ex.ee_len = cpu_to_le16(ext4_ext_get_actual_len(ex));
 		ext4_ext_store_pblock(&zero_ex, ext4_ext_pblock(ex));
 
 		err = ext4_ext_get_access(handle, inode, path + depth);
-- 
1.7.12.rc2.18.g61b472e

  reply	other threads:[~2013-04-03 10:22 UTC|newest]

Thread overview: 35+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <863434221.7624846.1364452822093.JavaMail.root@redhat.com>
2013-03-28  6:40 ` s390x: kernel BUG at fs/ext4/inode.c:1591! CAI Qian
2013-03-28  9:44   ` CAI Qian
2013-03-28 12:05   ` Theodore Ts'o
2013-03-28 14:56     ` Dmitry Monakhov
2013-03-29  8:53       ` CAI Qian
2013-03-29 10:08         ` Dmitry Monakhov
2013-03-29  9:27     ` CAI Qian
2013-04-01  6:07       ` Dmitry Monakhov
2013-04-01  6:30         ` CAI Qian
2013-04-01  6:56           ` Dmitry Monakhov
2013-04-02  4:06             ` bisected! (WAS Re: s390x: kernel BUG at fs/ext4/inode.c:1591!) CAI Qian
     [not found]               ` <alpine.DEB.2.10.1304012249440.5874@trent.utfs.org>
2013-04-02  9:47                 ` s390x: kernel BUG at fs/ext4/inode.c:1591! (powerpc too!) Dmitry Monakhov
2013-04-02 12:33                   ` Zheng Liu
     [not found]                     ` <alpine.DEB.2.10.1304021202100.13746@trent.utfs.org>
2013-04-02 19:49                       ` Dmitry Monakhov
     [not found]                   ` <alpine.DEB.2.10.1304020955280.13746@trent.utfs.org>
2013-04-02 17:19                     ` Dmitry Monakhov
     [not found]                   ` <alpine.DEB.2.10.1304021430480.13746@trent.utfs.org>
2013-04-02 22:05                     ` Dmitry Monakhov
     [not found]                       ` <alpine.DEB.2.10.1304021611020.13746@trent.utfs.org>
2013-04-03  8:52                         ` Dmitry Monakhov
2013-04-03  9:53                           ` Dmitry Monakhov
2013-04-03 10:22                             ` Zheng Liu [this message]
2013-04-03 12:20                               ` [PATCH] ext4: fix a big-endian bug when an extent is zeroed out Theodore Ts'o
2013-04-03 12:29                                 ` Dmitry Monakhov
2013-04-03 14:34                                 ` Eric Whitney
2013-04-03 14:41                                   ` Theodore Ts'o
2013-04-03 15:23                                     ` Florian Fainelli
2013-04-09  3:05                                     ` CAI Qian
2013-04-20 15:19                                       ` Theodore Ts'o
2013-04-22  3:40                                         ` CAI Qian
2013-04-22 10:04                                         ` Christian Borntraeger
2013-04-03 11:02                             ` s390x: kernel BUG at fs/ext4/inode.c:1591! (powerpc too!) Dmitry Monakhov
     [not found]                               ` <alpine.DEB.2.10.1304030935230.13746@trent.utfs.org>
2013-04-03 16:50                                 ` Dmitry Monakhov
2013-04-03 16:52                                 ` Zheng Liu
2013-04-02 10:01               ` bisected! (WAS Re: s390x: kernel BUG at fs/ext4/inode.c:1591!) Dmitry Monakhov
     [not found]                 ` <876098945.1097253.1364961617725.JavaMail.root@redhat.com>
2013-04-03  7:14                   ` CAI Qian
2013-04-03  7:51                     ` Dmitry Monakhov
2013-04-03  8:09                   ` Lukáš Czerner

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=20130403102204.GA15383@gmail.com \
    --to=gnehzuil.liu@gmail.com \
    --cc=caiqian@redhat.com \
    --cc=dmonakhov@openvz.org \
    --cc=linux-ext4@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-s390@vger.kernel.org \
    --cc=lists@nerdbynature.de \
    --cc=sbest@redhat.com \
    --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).