From: Dave Kleikamp <shaggy@austin.ibm.com>
To: James Spooner <james@endace.com>
Cc: linux-kernel <linux-kernel@vger.kernel.org>
Subject: Re: JFS kernel BUG
Date: Mon, 30 Aug 2004 09:55:49 -0500 [thread overview]
Message-ID: <1093877749.20837.26.camel@shaggy.austin.ibm.com> (raw)
In-Reply-To: <001001c48e7d$17c63b60$5440a8c0@zeus>
On Mon, 2004-08-30 at 05:35, James Spooner wrote:
> I've encountered a problem writing large files onto a JFS
> filesystem under 2.6.8.1. As follows. What is interesting
> is that this bug is triggered as the file reaches the 512GB
> mark, co-incidence perhaps? :)
>
> BUG at fs/jfs/jfs_xtree.c:1701 assert(p->header.nextindex == ((__u16)(2 +
> 1)))
I've just recently fixed this due to another bug report, but haven't
merged the patch yet. Can you test it with this patch please?
Thanks,
Shaggy
--
David Kleikamp
IBM Linux Technology Center
diff -Nurp linux-2.6.9-rc1-mm1/fs/jfs/jfs_xtree.c linux/fs/jfs/jfs_xtree.c
--- linux-2.6.9-rc1-mm1/fs/jfs/jfs_xtree.c 2004-08-30 09:47:14.245002600 -0500
+++ linux/fs/jfs/jfs_xtree.c 2004-08-30 09:48:29.847509272 -0500
@@ -1622,7 +1622,6 @@ int xtExtend(tid_t tid, /* transaction
s64 xaddr;
struct tlock *tlck;
struct xtlock *xtlck = NULL;
- int rootsplit = 0;
jfs_info("xtExtend: nxoff:0x%lx nxlen:0x%x", (ulong) xoff, xlen);
@@ -1678,8 +1677,6 @@ int xtExtend(tid_t tid, /* transaction
* The xtSplitUp() will insert the entry and unpin the leaf page.
*/
if (nextindex == le16_to_cpu(p->header.maxentry)) {
- rootsplit = p->header.flag & BT_ROOT;
-
/* xtSpliUp() unpins leaf pages */
split.mp = mp;
split.index = index + 1;
@@ -1691,16 +1688,21 @@ int xtExtend(tid_t tid, /* transaction
if ((rc = xtSplitUp(tid, ip, &split, &btstack)))
return rc;
+ /* get back old page */
+ XT_GETPAGE(ip, bn, mp, PSIZE, p, rc);
+ if (rc)
+ return rc;
/*
* if leaf root has been split, original root has been
* copied to new child page, i.e., original entry now
* resides on the new child page;
*/
- if (rootsplit) {
+ if (p->header.flag & BT_INTERNAL) {
ASSERT(p->header.nextindex ==
cpu_to_le16(XTENTRYSTART + 1));
xad = &p->xad[XTENTRYSTART];
bn = addressXAD(xad);
+ XT_PUTPAGE(mp);
/* get new child page */
XT_GETPAGE(ip, bn, mp, PSIZE, p, rc);
@@ -1712,11 +1714,6 @@ int xtExtend(tid_t tid, /* transaction
tlck = txLock(tid, ip, mp, tlckXTREE|tlckGROW);
xtlck = (struct xtlock *) & tlck->lock;
}
- } else {
- /* get back old page */
- XT_GETPAGE(ip, bn, mp, PSIZE, p, rc);
- if (rc)
- return rc;
}
}
/*
@@ -1790,7 +1787,6 @@ int xtTailgate(tid_t tid, /* transactio
struct xtlock *xtlck = 0;
struct tlock *mtlck;
struct maplock *pxdlock;
- int rootsplit = 0;
/*
printf("xtTailgate: nxoff:0x%lx nxlen:0x%x nxaddr:0x%lx\n",
@@ -1848,8 +1844,6 @@ printf("xtTailgate: xoff:0x%lx xlen:0x%x
* The xtSplitUp() will insert the entry and unpin the leaf page.
*/
if (nextindex == le16_to_cpu(p->header.maxentry)) {
- rootsplit = p->header.flag & BT_ROOT;
-
/* xtSpliUp() unpins leaf pages */
split.mp = mp;
split.index = index + 1;
@@ -1861,16 +1855,21 @@ printf("xtTailgate: xoff:0x%lx xlen:0x%x
if ((rc = xtSplitUp(tid, ip, &split, &btstack)))
return rc;
+ /* get back old page */
+ XT_GETPAGE(ip, bn, mp, PSIZE, p, rc);
+ if (rc)
+ return rc;
/*
* if leaf root has been split, original root has been
* copied to new child page, i.e., original entry now
* resides on the new child page;
*/
- if (rootsplit) {
+ if (p->header.flag & BT_INTERNAL) {
ASSERT(p->header.nextindex ==
cpu_to_le16(XTENTRYSTART + 1));
xad = &p->xad[XTENTRYSTART];
bn = addressXAD(xad);
+ XT_PUTPAGE(mp);
/* get new child page */
XT_GETPAGE(ip, bn, mp, PSIZE, p, rc);
@@ -1882,11 +1881,6 @@ printf("xtTailgate: xoff:0x%lx xlen:0x%x
tlck = txLock(tid, ip, mp, tlckXTREE|tlckGROW);
xtlck = (struct xtlock *) & tlck->lock;
}
- } else {
- /* get back old page */
- XT_GETPAGE(ip, bn, mp, PSIZE, p, rc);
- if (rc)
- return rc;
}
}
/*
@@ -1976,7 +1970,7 @@ int xtUpdate(tid_t tid, struct inode *ip
s64 nxaddr, xaddr;
struct tlock *tlck;
struct xtlock *xtlck = NULL;
- int rootsplit = 0, newpage = 0;
+ int newpage = 0;
/* there must exist extent to be tailgated */
nxoff = offsetXAD(nxad);
@@ -2183,7 +2177,6 @@ int xtUpdate(tid_t tid, struct inode *ip
/* insert nXAD:recorded */
if (nextindex == le16_to_cpu(p->header.maxentry)) {
- rootsplit = p->header.flag & BT_ROOT;
/* xtSpliUp() unpins leaf pages */
split.mp = mp;
@@ -2196,16 +2189,21 @@ int xtUpdate(tid_t tid, struct inode *ip
if ((rc = xtSplitUp(tid, ip, &split, &btstack)))
return rc;
+ /* get back old page */
+ XT_GETPAGE(ip, bn, mp, PSIZE, p, rc);
+ if (rc)
+ return rc;
/*
* if leaf root has been split, original root has been
* copied to new child page, i.e., original entry now
* resides on the new child page;
*/
- if (rootsplit) {
+ if (p->header.flag & BT_INTERNAL) {
ASSERT(p->header.nextindex ==
cpu_to_le16(XTENTRYSTART + 1));
xad = &p->xad[XTENTRYSTART];
bn = addressXAD(xad);
+ XT_PUTPAGE(mp);
/* get new child page */
XT_GETPAGE(ip, bn, mp, PSIZE, p, rc);
@@ -2218,11 +2216,6 @@ int xtUpdate(tid_t tid, struct inode *ip
xtlck = (struct xtlock *) & tlck->lock;
}
} else {
- /* get back old page */
- XT_GETPAGE(ip, bn, mp, PSIZE, p, rc);
- if (rc)
- return rc;
-
/* is nXAD on new page ? */
if (newindex >
(le16_to_cpu(p->header.maxentry) >> 1)) {
@@ -2336,8 +2329,6 @@ int xtUpdate(tid_t tid, struct inode *ip
xlen = xlen - nxlen;
xaddr = xaddr + nxlen;
if (nextindex == le16_to_cpu(p->header.maxentry)) {
- rootsplit = p->header.flag & BT_ROOT;
-
/*
printf("xtUpdate.updateLeft.split p:0x%p\n", p);
*/
@@ -2352,16 +2343,22 @@ printf("xtUpdate.updateLeft.split p:0x%p
if ((rc = xtSplitUp(tid, ip, &split, &btstack)))
return rc;
+ /* get back old page */
+ XT_GETPAGE(ip, bn, mp, PSIZE, p, rc);
+ if (rc)
+ return rc;
+
/*
* if leaf root has been split, original root has been
* copied to new child page, i.e., original entry now
* resides on the new child page;
*/
- if (rootsplit) {
+ if (p->header.flag & BT_INTERNAL) {
ASSERT(p->header.nextindex ==
cpu_to_le16(XTENTRYSTART + 1));
xad = &p->xad[XTENTRYSTART];
bn = addressXAD(xad);
+ XT_PUTPAGE(mp);
/* get new child page */
XT_GETPAGE(ip, bn, mp, PSIZE, p, rc);
@@ -2373,11 +2370,6 @@ printf("xtUpdate.updateLeft.split p:0x%p
tlck = txLock(tid, ip, mp, tlckXTREE|tlckGROW);
xtlck = (struct xtlock *) & tlck->lock;
}
- } else {
- /* get back old page */
- XT_GETPAGE(ip, bn, mp, PSIZE, p, rc);
- if (rc)
- return rc;
}
} else {
/* if insert into middle, shift right remaining entries */
prev parent reply other threads:[~2004-08-30 18:30 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2004-08-30 10:35 James Spooner
2004-08-30 14:55 ` Dave Kleikamp [this message]
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=1093877749.20837.26.camel@shaggy.austin.ibm.com \
--to=shaggy@austin.ibm.com \
--cc=james@endace.com \
--cc=linux-kernel@vger.kernel.org \
/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
all inboxes | Powered by JetHome®