2005-09-15 07:29:50

by Bas Vermeulen

[permalink] [raw]
Subject: 2.6.14-rc1 - kernel BUG at fs/ntfs/aops.c:403

I get a kernel BUG when mounting my (dirty) NTFS volume.

Sep 12 18:54:47 laptop kernel: [4294708.961000] NTFS volume version 3.1.
Sep 12 18:54:47 laptop kernel: [4294708.961000] NTFS-fs error (device
sda2): load_system_files(): Volume is dirty. Mounting read-only. Run
chkdsk and mount in Windows.
Sep 12 18:54:47 laptop kernel: [4294709.063000] ------------[ cut
here ]------------
Sep 12 18:54:47 laptop kernel: [4294709.063000] kernel BUG at
fs/ntfs/aops.c:403!
Sep 12 18:54:47 laptop kernel: [4294709.063000] invalid operand: 0000
[#1]
Sep 12 18:54:47 laptop kernel: [4294709.063000] PREEMPT
Sep 12 18:54:47 laptop kernel: [4294709.063000] Modules linked in:
nls_iso8859_1 yenta_socket rsrc_nonstatic uhci_hcd floppy
Sep 12 18:54:47 laptop kernel: [4294709.063000] CPU: 0
Sep 12 18:54:47 laptop kernel: [4294709.063000] EIP: 0060:
[<c0269d8f>] Not tainted VLI
Sep 12 18:54:47 laptop kernel: [4294709.063000] EFLAGS: 00010203
(2.6.13-g2da65feb)
Sep 12 18:54:47 laptop kernel: [4294709.063000] EIP is at ntfs_readpage
+0x2bf/0x2d0
Sep 12 18:54:47 laptop kernel: [4294709.063000] eax: 00000070 ebx:
c13dfb40 ecx: 00000020 edx: deede2bc
Sep 12 18:54:47 laptop kernel: [4294709.063000] esi: 00000000 edi:
c13dfb40 ebp: deede220 esp: df2b1c14
Sep 12 18:54:47 laptop kernel: [4294709.063000] ds: 007b es: 007b
ss: 0068
Sep 12 18:54:47 laptop kernel: [4294709.063000] Process mount (pid:
2041, threadinfo=df2b0000 task=df830550)
Sep 12 18:54:47 laptop kernel: [4294709.063000] Stack: deede360 00000000
c13dfb40 df2b0000 deede35c c014576a 00000000 00000000
Sep 12 18:54:47 laptop kernel: [4294709.063000] c13dfb40 c13dfb40
c13dfb40 c13dfb40 00000000 c13dfb40 deede35c c014734c
Sep 12 18:54:47 laptop kernel: [4294709.063000] 000000d0 c0269ad0
00000000 00000000 deede35c 00000000 00000000 c0271fb5
Sep 12 18:54:47 laptop kernel: [4294709.063000] Call Trace:
Sep 12 18:54:47 laptop kernel: [4294709.063000] [<c014576a>]
add_to_page_cache+0x5a/0xb0
Sep 12 18:54:47 laptop kernel: [4294709.063000] [<c014734c>]
read_cache_page+0xac/0x270
Sep 12 18:54:47 laptop kernel: [4294709.063000] [<c0269ad0>]
ntfs_readpage+0x0/0x2d0
Sep 12 18:54:47 laptop kernel: [4294709.063000] [<c0271fb5>]
ntfs_lookup_inode_by_name+0x5d5/0xe50
Sep 12 18:54:47 laptop kernel: [4294709.063000] [<c0275749>]
ntfs_read_locked_inode+0x749/0xf10
Sep 12 18:54:47 laptop kernel: [4294709.063000] [<c0284c84>]
check_windows_hibernation_status+0x54/0x2f0
Sep 12 18:54:47 laptop kernel: [4294709.063000] [<c02749f0>]
ntfs_init_locked_inode+0x0/0x100
Sep 12 18:54:47 laptop kernel: [4294709.063000] [<c0286524>]
load_system_files+0x7e4/0xd40
Sep 12 18:54:47 laptop kernel: [4294709.063000] [<c0287bf2>]
ntfs_fill_super+0x242/0x7e0
Sep 12 18:54:47 laptop kernel: [4294709.063000] [<c016cc01>]
get_sb_bdev+0xb1/0x110
Sep 12 18:54:47 laptop kernel: [4294709.063000] [<c02881c9>]
ntfs_get_sb+0x19/0x1e
Sep 12 18:54:47 laptop kernel: [4294709.063000] [<c02879b0>]
ntfs_fill_super+0x0/0x7e0
Sep 12 18:54:47 laptop kernel: [4294709.063000] [<c016ce9a>]
do_kern_mount+0x9a/0x170
Sep 12 18:54:47 laptop kernel: [4294709.063000] [<c018423b>]
do_new_mount+0x6b/0xc0
Sep 12 18:54:47 laptop kernel: [4294709.063000] [<c018496f>] do_mount
+0x1cf/0x1e0
Sep 12 18:54:47 laptop kernel: [4294709.063000] [<c0181613>] iput
+0x53/0x70
Sep 12 18:54:47 laptop kernel: [4294709.063000] [<c0184749>]
copy_mount_options+0x59/0xb0
Sep 12 18:54:47 laptop kernel: [4294709.063000] [<c0184d09>] sys_mount
+0x79/0xb0
Sep 12 18:54:47 laptop kernel: [4294709.063000] [<c010302b>]
sysenter_past_esp+0x54/0x75
Sep 12 18:54:47 laptop kernel: [4294709.063000] Code: ff 83 c1 80 75 0e
be f3 ff ff ff 89 74 24 1c e9 1e ff ff ff 0f 0b 8d 01 ce 2a 75 c0 eb e8
0f 0b 94 01 ce 2a 75 c0 e9 43 ff ff ff <0f> 0b 93 01 ce 2a 75 c0 e9 2b
ff ff ff 8d 74 26 00 55 57 56 53

Not sure what's the cause, it started after the last NTFS code update.

--
Bas Vermeulen <[email protected]>


2005-09-15 08:58:57

by Anton Altaparmakov

[permalink] [raw]
Subject: Re: 2.6.14-rc1 - kernel BUG at fs/ntfs/aops.c:403

Hi,

On Thu, 15 Sep 2005, Bas Vermeulen wrote:
> I get a kernel BUG when mounting my (dirty) NTFS volume.
>
> Sep 12 18:54:47 laptop kernel: [4294708.961000] NTFS volume version 3.1.
> Sep 12 18:54:47 laptop kernel: [4294708.961000] NTFS-fs error (device
> sda2): load_system_files(): Volume is dirty. Mounting read-only. Run
> chkdsk and mount in Windows.
> Sep 12 18:54:47 laptop kernel: [4294709.063000] ------------[ cut
> here ]------------
> Sep 12 18:54:47 laptop kernel: [4294709.063000] kernel BUG at
> fs/ntfs/aops.c:403!

Ouch. )-: Could you do two things for me so I can figure out what is
going on?

1) Apply this patch to fs/ntfs/aops.c:

--- aops.c.old 2005-09-15 09:51:30.000000000 +0100
+++ aops.c 2005-09-15 09:53:53.000000000 +0100
@@ -400,6 +400,10 @@ retry_readpage:
}
/* Compressed data streams are handled in compress.c. */
if (NInoNonResident(ni) && NInoCompressed(ni)) {
+ ntfs_error(ni->vol->sb, "Eeek! i_ino = 0x%lx, "
+ "type = 0x%x, name_len = 0x%x.",
+ VFS_I(ni)->i_ino, ni->type,
+ ni->name_len);
BUG_ON(ni->type != AT_DATA);
BUG_ON(ni->name_len);
return ntfs_read_compressed_block(page);

2) Enable ntfs debugging in the kernel configuration.

Recompile the ntfs module (or the kernel if ntfs is built in).

Then load the new module (if not built in).

Then enable debug output (as root do):

echo 1 > /proc/sys/fs/ntfs-debug

Now do the mount and send me the resulting dmesg output. That should
hopefully enable me to fix it.

Thanks!

Best regards,

Anton
--
Anton Altaparmakov <aia21 at cam.ac.uk> (replace at with @)
Unix Support, Computing Service, University of Cambridge, CB2 3QH, UK
Linux NTFS maintainer / IRC: #ntfs on irc.freenode.net
WWW: http://linux-ntfs.sf.net/ & http://www-stu.christs.cam.ac.uk/~aia21/

2005-09-15 19:27:48

by Bas Vermeulen

[permalink] [raw]
Subject: Re: 2.6.14-rc1 - kernel BUG at fs/ntfs/aops.c:403

On Thu, 2005-09-15 at 09:58 +0100, Anton Altaparmakov wrote:
> Ouch. )-: Could you do two things for me so I can figure out what is
> going on?
>
> 1) Apply this patch to fs/ntfs/aops.c:

done.

> 2) Enable ntfs debugging in the kernel configuration.

done.

> Recompile the ntfs module (or the kernel if ntfs is built in).
>
> Then load the new module (if not built in).
>
> Then enable debug output (as root do):
>
> echo 1 > /proc/sys/fs/ntfs-debug

done.

> Now do the mount and send me the resulting dmesg output. That should
> hopefully enable me to fix it.

The logs are below. The mount resulted in a segmentation fault.

Sep 15 21:13:43 laptop kernel: [4295071.339000] NTFS volume version 3.1.
Sep 15 21:13:43 laptop kernel: [4295071.339000] NTFS-fs error (device
sda2): load_system_files(): Volume is dirty. Mounting read-only. Run
chkdsk and mount in Windows.
Sep 15 21:13:43 laptop kernel: [4295071.439000] NTFS-fs error (device
sda2): ntfs_readpage(): Eeek! i_ino = 0x5, type = 0xa0, name_len = 0x4.
Sep 15 21:13:43 laptop kernel: [4295071.439000] ------------[ cut
here ]------------
Sep 15 21:13:43 laptop kernel: [4295071.439000] kernel BUG at
fs/ntfs/aops.c:407!
Sep 15 21:13:43 laptop kernel: [4295071.439000] invalid operand: 0000
[#1]
Sep 15 21:13:43 laptop kernel: [4295071.439000] PREEMPT
Sep 15 21:13:43 laptop kernel: [4295071.439000] Modules linked in:
parport_pc lp parport nls_iso8859_1 yenta_socket rsrc_nonstatic uhci_hcd
floppy
Sep 15 21:13:43 laptop kernel: [4295071.439000] CPU: 0
Sep 15 21:13:43 laptop kernel: [4295071.439000] EIP: 0060:
[<c026a1ff>] Not tainted VLI
Sep 15 21:13:43 laptop kernel: [4295071.439000] EFLAGS: 00010202
(2.6.14-rc1-g03055f0b)
Sep 15 21:13:43 laptop kernel: [4295071.439000] EIP is at ntfs_readpage
+0x30f/0x320
Sep 15 21:13:43 laptop kernel: [4295071.439000] eax: 00000000 ebx:
c12c2220 ecx: 00000000 edx: 00000000
Sep 15 21:13:43 laptop kernel: [4295071.439000] esi: c076cfa0 edi:
c12c2220 ebp: d4b00220 esp: d8bc9bf4
Sep 15 21:13:43 laptop kernel: [4295071.439000] ds: 007b es: 007b
ss: 0068
Sep 15 21:13:43 laptop kernel: [4295071.439000] Process mount (pid:
4398, threadinfo=d8bc8000 task=c649ea70)
Sep 15 21:13:43 laptop kernel: [4295071.439000] Stack: c070690b cdc28600
c076cfa0 00000005 000000a0 00000004 00000000 00000000
Sep 15 21:13:43 laptop kernel: [4295071.439000] c12c2220 c12c2220
c12c2220 c12c2220 00000000 c12c2220 d4b0035c c01476bc
Sep 15 21:13:43 laptop kernel: [4295071.439000] 000000d0 c0269ef0
00000000 00000000 d4b0035c 00000000 00000000 c0273135
Sep 15 21:13:43 laptop kernel: [4295071.439000] Call Trace:
Sep 15 21:13:43 laptop kernel: [4295071.439000] [<c01476bc>]
read_cache_page+0xac/0x270
Sep 15 21:13:43 laptop kernel: [4295071.439000] [<c0269ef0>]
ntfs_readpage+0x0/0x320
Sep 15 21:13:43 laptop kernel: [4295071.439000] [<c0273135>]
ntfs_lookup_inode_by_name+0x5d5/0xeb0
Sep 15 21:13:43 laptop kernel: [4295071.439000] [<c0276e0e>]
ntfs_read_locked_inode+0x51e/0xf70
Sep 15 21:13:43 laptop kernel: [4295071.439000] [<c02729ed>]
__ntfs_debug+0x8d/0xc0
Sep 15 21:13:43 laptop kernel: [4295071.439000] [<c028897b>]
check_windows_hibernation_status+0x7b/0x450
Sep 15 21:13:43 laptop kernel: [4295071.439000] [<c0276330>] ntfs_iget
+0x60/0x80
Sep 15 21:13:43 laptop kernel: [4295071.439000] [<c02761d0>]
ntfs_init_locked_inode+0x0/0x100
Sep 15 21:13:43 laptop kernel: [4295071.439000] [<c028a614>]
load_system_files+0x814/0xd70
Sep 15 21:13:43 laptop kernel: [4295071.439000] [<c028bfd1>]
ntfs_fill_super+0x2a1/0x860
Sep 15 21:13:43 laptop kernel: [4295071.439000] [<c016d021>]
get_sb_bdev+0xb1/0x110
Sep 15 21:13:44 laptop kernel: [4295071.439000] [<c0183409>]
alloc_vfsmnt+0x89/0xc0
Sep 15 21:13:44 laptop kernel: [4295071.439000] [<c028c5c9>]
ntfs_get_sb+0x19/0x1e
Sep 15 21:13:44 laptop kernel: [4295071.439000] [<c028bd30>]
ntfs_fill_super+0x0/0x860
Sep 15 21:13:44 laptop kernel: [4295071.439000] [<c016d2ba>]
do_kern_mount+0x9a/0x170
Sep 15 21:13:44 laptop kernel: [4295071.439000] [<c01845eb>]
do_new_mount+0x6b/0xc0
Sep 15 21:13:44 laptop kernel: [4295071.439000] [<c0184d1f>] do_mount
+0x1cf/0x1e0
Sep 15 21:13:44 laptop kernel: [4295071.439000] [<c0184a62>]
exact_copy_from_user+0x32/0x70
Sep 15 21:13:44 laptop kernel: [4295071.439000] [<c0184af9>]
copy_mount_options+0x59/0xb0
Sep 15 21:13:44 laptop kernel: [4295071.439000] [<c01850b9>] sys_mount
+0x79/0xb0
Sep 15 21:13:44 laptop kernel: [4295071.439000] [<c010302b>]
sysenter_past_esp+0x54/0x75
Sep 15 21:13:44 laptop kernel: [4295071.439000] Code: ff 83 c1 80 75 0e
bf f3 ff ff ff 89 7c 24 1c e9 ce fe ff ff 0f 0b 8d 01 8b 67 75 c0 eb e8
0f 0b 98 01 8b 67 75 c0 e9 2a ff ff ff <0f> 0b 97 01 8b 67 75 c0 e9 12
ff ff ff 8d 74 26 00 55 bd d4 cf

--
Bas Vermeulen <[email protected]>

2005-09-15 21:21:23

by Anton Altaparmakov

[permalink] [raw]
Subject: Re: 2.6.14-rc1 - kernel BUG at fs/ntfs/aops.c:403

On Thu, 15 Sep 2005, Bas Vermeulen wrote:
> Sep 15 21:13:43 laptop kernel: [4295071.339000] NTFS volume version 3.1.
> Sep 15 21:13:43 laptop kernel: [4295071.339000] NTFS-fs error (device
> sda2): load_system_files(): Volume is dirty. Mounting read-only. Run
> chkdsk and mount in Windows.
> Sep 15 21:13:43 laptop kernel: [4295071.439000] NTFS-fs error (device
> sda2): ntfs_readpage(): Eeek! i_ino = 0x5, type = 0xa0, name_len = 0x4.

Great, thanks! I suspected this might be the case but I didn't think
that was possible. )-:

Could you confirm for me that this ntfs volume is compressed? (I.e. the
compression bit is enabled on the root directory.)

Best regards,

Anton
--
Anton Altaparmakov <aia21 at cam.ac.uk> (replace at with @)
Unix Support, Computing Service, University of Cambridge, CB2 3QH, UK
Linux NTFS maintainer / IRC: #ntfs on irc.freenode.net
WWW: http://linux-ntfs.sf.net/ & http://www-stu.christs.cam.ac.uk/~aia21/

2005-09-15 22:15:18

by Bas Vermeulen

[permalink] [raw]
Subject: Re: 2.6.14-rc1 - kernel BUG at fs/ntfs/aops.c:403

On Thu, 2005-09-15 at 22:21 +0100, Anton Altaparmakov wrote:
> On Thu, 15 Sep 2005, Bas Vermeulen wrote:
> > Sep 15 21:13:43 laptop kernel: [4295071.339000] NTFS volume version 3.1.
> > Sep 15 21:13:43 laptop kernel: [4295071.339000] NTFS-fs error (device
> > sda2): load_system_files(): Volume is dirty. Mounting read-only. Run
> > chkdsk and mount in Windows.
> > Sep 15 21:13:43 laptop kernel: [4295071.439000] NTFS-fs error (device
> > sda2): ntfs_readpage(): Eeek! i_ino = 0x5, type = 0xa0, name_len = 0x4.
>
> Great, thanks! I suspected this might be the case but I didn't think
> that was possible. )-:
>
> Could you confirm for me that this ntfs volume is compressed? (I.e. the
> compression bit is enabled on the root directory.)

Yes, it is compressed.

Regards,

--
Bas Vermeulen <[email protected]>

2005-09-16 00:11:49

by Anton Altaparmakov

[permalink] [raw]
Subject: Re: 2.6.14-rc1 - kernel BUG at fs/ntfs/aops.c:403

On Fri, 16 Sep 2005, Bas Vermeulen wrote:
> On Thu, 2005-09-15 at 22:21 +0100, Anton Altaparmakov wrote:
> > On Thu, 15 Sep 2005, Bas Vermeulen wrote:
> > > Sep 15 21:13:43 laptop kernel: [4295071.339000] NTFS volume version 3.1.
> > > Sep 15 21:13:43 laptop kernel: [4295071.339000] NTFS-fs error (device
> > > sda2): load_system_files(): Volume is dirty. Mounting read-only. Run
> > > chkdsk and mount in Windows.
> > > Sep 15 21:13:43 laptop kernel: [4295071.439000] NTFS-fs error (device
> > > sda2): ntfs_readpage(): Eeek! i_ino = 0x5, type = 0xa0, name_len = 0x4.
> >
> > Great, thanks! I suspected this might be the case but I didn't think
> > that was possible. )-:
> >
> > Could you confirm for me that this ntfs volume is compressed? (I.e. the
> > compression bit is enabled on the root directory.)
>
> Yes, it is compressed.

Excellent, thanks. I will try and do the fix tomorrow and send it to
Linus.

Best regards,

Anton
--
Anton Altaparmakov <aia21 at cam.ac.uk> (replace at with @)
Unix Support, Computing Service, University of Cambridge, CB2 3QH, UK
Linux NTFS maintainer / IRC: #ntfs on irc.freenode.net
WWW: http://linux-ntfs.sf.net/ & http://www-stu.christs.cam.ac.uk/~aia21/

2005-09-17 14:56:42

by Luca

[permalink] [raw]
Subject: Re: 2.6.14-rc1 - kernel BUG at fs/ntfs/aops.c:403

Jean Delvare <[email protected]> ha scritto:
> Hi Anton, Bas, all,
>
> [Bas Vermeulen]
>> > I get a kernel BUG when mounting my (dirty) NTFS volume.
>> >
>> > Sep 12 18:54:47 laptop kernel: [4294708.961000] NTFS volume version
>> > 3.1. Sep 12 18:54:47 laptop kernel: [4294708.961000] NTFS-fs error
>> > (device sda2): load_system_files(): Volume is dirty. Mounting
>> > read-only. Run chkdsk and mount in Windows.
>> > Sep 12 18:54:47 laptop kernel: [4294709.063000] ------------[ cut
>> > here ]------------
>> > Sep 12 18:54:47 laptop kernel: [4294709.063000] kernel BUG at
>> > fs/ntfs/aops.c:403!
>
> I just hit the same BUG in different conditions. My NTFS volume is not
> dirty, not compressed and the BUG triggered on use (updatedb), not
> mount.

Same here, but it only triggers accessing a compressed directory. I can
reproduce at will just by using 'ls' inside a compressed dir.

> (BTW, is there a way to tell from Linux directly?)

ntfsinfo(8)

Luca
--
Home: http://kronoz.cjb.net
Se non puoi convincerli, confondili.

2005-09-17 09:43:59

by Jean Delvare

[permalink] [raw]
Subject: Re: 2.6.14-rc1 - kernel BUG at fs/ntfs/aops.c:403

Hi Anton, Bas, all,

[Bas Vermeulen]
> > I get a kernel BUG when mounting my (dirty) NTFS volume.
> >
> > Sep 12 18:54:47 laptop kernel: [4294708.961000] NTFS volume version
> > 3.1. Sep 12 18:54:47 laptop kernel: [4294708.961000] NTFS-fs error
> > (device sda2): load_system_files(): Volume is dirty. Mounting
> > read-only. Run chkdsk and mount in Windows.
> > Sep 12 18:54:47 laptop kernel: [4294709.063000] ------------[ cut
> > here ]------------
> > Sep 12 18:54:47 laptop kernel: [4294709.063000] kernel BUG at
> > fs/ntfs/aops.c:403!

I just hit the same BUG in different conditions. My NTFS volume is not
dirty, not compressed (BTW, is there a way to tell from Linux directly?)
and the BUG triggered on use (updatedb), not mount.

[Anton Altaparmakov]
> Ouch. )-: Could you do two things for me so I can figure out what
> is going on?
>
> 1) Apply this patch to fs/ntfs/aops.c:
>
> --- aops.c.old 2005-09-15 09:51:30.000000000 +0100
> +++ aops.c 2005-09-15 09:53:53.000000000 +0100
> @@ -400,6 +400,10 @@ retry_readpage:
> }
> /* Compressed data streams are handled in compress.c. */
> if (NInoNonResident(ni) && NInoCompressed(ni)) {
> + ntfs_error(ni->vol->sb, "Eeek! i_ino = 0x%lx, "
> + "type = 0x%x, name_len = 0x%x.",
> + VFS_I(ni)->i_ino, ni->type,
> + ni->name_len);
> BUG_ON(ni->type != AT_DATA);
> BUG_ON(ni->name_len);
> return ntfs_read_compressed_block(page);
>
> 2) Enable ntfs debugging in the kernel configuration.
>
> Recompile the ntfs module (or the kernel if ntfs is built in).
>
> Then load the new module (if not built in).
>
> Then enable debug output (as root do):
>
> echo 1 > /proc/sys/fs/ntfs-debug
>
> Now do the mount and send me the resulting dmesg output. That should
> hopefully enable me to fix it.

I've done all this, ran updatedb and got a segmentation fault, here is
the resulting dmesg log:

NTFS driver 2.1.24 [Flags: R/O DEBUG MODULE].
NTFS volume version 3.0.
(...)
NTFS-fs DEBUG (fs/ntfs/namei.c, 135): ntfs_lookup(): Done. (Case 1.)
NTFS-fs DEBUG (fs/ntfs/dir.c, 1121): ntfs_readdir(): Entering for inode 0x19, fpos 0xf400.
NTFS-fs DEBUG (fs/ntfs/dir.c, 1451): ntfs_readdir(): EOD, fpos 0xf400, returning 0.
NTFS-fs DEBUG (fs/ntfs/dir.c, 1121): ntfs_readdir(): Entering for inode 0x2e26, fpos 0x0.
NTFS-fs DEBUG (fs/ntfs/dir.c, 1130): ntfs_readdir(): Calling filldir for . with len 1, fpos 0x0, inode 0x2e26, DT_DIR.
NTFS-fs DEBUG (fs/ntfs/dir.c, 1139): ntfs_readdir(): Calling filldir for .. with len 2, fpos 0x1, inode 0x19, DT_DIR.
NTFS-fs DEBUG (fs/ntfs/mft.c, 155): map_mft_record(): Entering for mft_no 0x2e26.
NTFS-fs DEBUG (fs/ntfs/attrib.c, 1013): ntfs_attr_lookup(): Entering.
NTFS-fs DEBUG (fs/ntfs/mft.c, 215): unmap_mft_record(): Entering for mft_no 0x2e26.
NTFS-fs DEBUG (fs/ntfs/dir.c, 1216): ntfs_readdir(): In index root, offset 0x20.
NTFS-fs DEBUG (fs/ntfs/dir.c, 1279): ntfs_readdir(): Reading bitmap with page index 0x0, bit ofs 0x0
NTFS-fs DEBUG (fs/ntfs/mft.c, 155): map_mft_record(): Entering for mft_no 0x2e26.
NTFS-fs DEBUG (fs/ntfs/attrib.c, 1013): ntfs_attr_lookup(): Entering.
NTFS-fs DEBUG (fs/ntfs/mft.c, 215): unmap_mft_record(): Entering for mft_no 0x2e26.
NTFS-fs DEBUG (fs/ntfs/dir.c, 1310): ntfs_readdir(): Handling index buffer 0x0.
NTFS-fs error (device hda1): ntfs_readpage(): Eeek! i_ino = 0x2e26, type = 0xa0, name_len = 0x4.
------------[ cut here ]------------
kernel BUG at fs/ntfs/aops.c:407!
invalid operand: 0000 [#1]
Modules linked in: cpufreq_powersave cpufreq_conservative powernow_k8 freq_table it87 hwmon_vid hwmon i2c_isa rtc snd_pcm_oss snd_mixer_oss smbfs ohci_hcd sr_mod cdrom sym53c8xx scsi_transport_spi scsi_mod zr36060 adv7175 saa7110 zr36067 videocodec videodev uhci_hcd ehci_hcd usbcore i2c_viapro snd_via82xx snd_ac97_codec snd_ac97_bus snd_pcm snd_timer snd_page_alloc snd_mpu401_uart snd_rawmidi snd soundcore ohci1394 eth1394 ieee1394 via_rhine mii r8169 nls_iso8859_1 nls_cp437 vfat nls_utf8 ntfs radeon drm amd64_agp agpgart
CPU: 0
EIP: 0060:[<f8862ad3>] Not tainted VLI
EFLAGS: 00010202 (2.6.14-rc1)
EIP is at ntfs_readpage+0x2a3/0x2eb [ntfs]
eax: 00000068 ebx: c1552220 ecx: c0367380 edx: 007c742b
esi: eaf632c0 edi: c1552220 ebp: eaf633fc esp: f1b73e18
ds: 007b es: 007b ss: 0068
Process updatedb (pid: 5385, threadinfo=f1b72000 task=f15c8a90)
Stack: f887458b f7150400 f8875e40 00002e26 000000a0 00000004 c1552220 00000000
c1552220 00000000 c013442a c1552220 c1552220 c1552220 00000000 00000000
eaf633fc c0135d82 00000000 c1552220 00000000 000000d0 00000000 eaf633fc
Call Trace:
[<c013442a>] add_to_page_cache_lru+0x4a/0x50
[<c0135d82>] read_cache_page+0x72/0x230
[<f8867da2>] ntfs_readdir+0xa52/0x1690 [ntfs]
[<f8862830>] ntfs_readpage+0x0/0x2eb [ntfs]
[<c0161ff7>] vfs_readdir+0x77/0x90
[<c01622e0>] filldir64+0x0/0x100
[<c0162457>] sys_getdents64+0x77/0xcb
[<c01622e0>] filldir64+0x0/0x100
[<c0102cf5>] syscall_call+0x7/0xb
Code: 80 00 00 00 75 25 8b 6e 2c 85 ed 75 14 8b 44 24 30 89 44 24 48 83 c4 34 5b 5e 5f 5d e9 b7 23 00 00 0f 0b 98 01 80 51 87 f8 eb e2 <0f> 0b 97 01 80 51 87 f8 eb d1 83 c1 80 75 0d c7 44 24 24 f3 ff

There is much more debug stuff before the BUG happens but it was a bit
large to include here. Available of request.

The relevant line in /etc/fstab is:
/dev/hda1 /mnt/win/c ntfs gid=497,umask=0227,nls=utf8,noexec,ro 1 0

Note that I don't care about that NTFS volume myself, I don't use it,
I'm only mounting it in order to help find bugs in the ntfs driver. It
seems to work ;)

Thanks,
--
Jean Delvare

2005-09-19 09:39:17

by Anton Altaparmakov

[permalink] [raw]
Subject: Re: 2.6.14-rc1 - kernel BUG at fs/ntfs/aops.c:403

Hi,

On Sat, 2005-09-17 at 16:51 +0200, Luca wrote:
> Jean Delvare <[email protected]> ha scritto:
> > Hi Anton, Bas, all,
> >
> > [Bas Vermeulen]
> >> > I get a kernel BUG when mounting my (dirty) NTFS volume.
> >> >
> >> > Sep 12 18:54:47 laptop kernel: [4294708.961000] NTFS volume version
> >> > 3.1. Sep 12 18:54:47 laptop kernel: [4294708.961000] NTFS-fs error
> >> > (device sda2): load_system_files(): Volume is dirty. Mounting
> >> > read-only. Run chkdsk and mount in Windows.
> >> > Sep 12 18:54:47 laptop kernel: [4294709.063000] ------------[ cut
> >> > here ]------------
> >> > Sep 12 18:54:47 laptop kernel: [4294709.063000] kernel BUG at
> >> > fs/ntfs/aops.c:403!
> >
> > I just hit the same BUG in different conditions. My NTFS volume is not
> > dirty, not compressed and the BUG triggered on use (updatedb), not
> > mount.
>
> Same here, but it only triggers accessing a compressed directory. I can
> reproduce at will just by using 'ls' inside a compressed dir.

Below is the fix I just sent off to Linus.

Best regards,

Anton
--
Anton Altaparmakov <aia21 at cam.ac.uk> (replace at with @)
Unix Support, Computing Service, University of Cambridge, CB2 3QH, UK
Linux NTFS maintainer / IRC: #ntfs on irc.freenode.net
WWW: http://linux-ntfs.sf.net/ & http://www-stu.christs.cam.ac.uk/~aia21/

Subject: [PATCH 2/3] NTFS: Fix handling of compressed directories that I broke in earlier changeset.

Signed-off-by: Anton Altaparmakov <[email protected]>

---

fs/ntfs/aops.c | 12 ++++++++----
1 files changed, 8 insertions(+), 4 deletions(-)

4e64c88693fde1b1cbaa4cfecad43a0c3fad354e
diff --git a/fs/ntfs/aops.c b/fs/ntfs/aops.c
--- a/fs/ntfs/aops.c
+++ b/fs/ntfs/aops.c
@@ -389,9 +389,11 @@ retry_readpage:
* Only $DATA attributes can be encrypted and only unnamed $DATA
* attributes can be compressed. Index root can have the flags set but
* this means to create compressed/encrypted files, not that the
- * attribute is compressed/encrypted.
+ * attribute is compressed/encrypted. Note we need to check for
+ * AT_INDEX_ALLOCATION since this is the type of both directory and
+ * index inodes.
*/
- if (ni->type != AT_INDEX_ROOT) {
+ if (ni->type != AT_INDEX_ALLOCATION) {
/* If attribute is encrypted, deny access, just like NT4. */
if (NInoEncrypted(ni)) {
BUG_ON(ni->type != AT_DATA);
@@ -1341,9 +1343,11 @@ retry_writepage:
* Only $DATA attributes can be encrypted and only unnamed $DATA
* attributes can be compressed. Index root can have the flags set but
* this means to create compressed/encrypted files, not that the
- * attribute is compressed/encrypted.
+ * attribute is compressed/encrypted. Note we need to check for
+ * AT_INDEX_ALLOCATION since this is the type of both directory and
+ * index inodes.
*/
- if (ni->type != AT_INDEX_ROOT) {
+ if (ni->type != AT_INDEX_ALLOCATION) {
/* If file is encrypted, deny access, just like NT4. */
if (NInoEncrypted(ni)) {
unlock_page(page);


2005-09-20 17:44:31

by Luca

[permalink] [raw]
Subject: Re: 2.6.14-rc1 - kernel BUG at fs/ntfs/aops.c:403

Anton Altaparmakov <[email protected]> ha scritto:
> Hi,
>
> On Sat, 2005-09-17 at 16:51 +0200, Luca wrote:
>> Jean Delvare <[email protected]> ha scritto:
>> > Hi Anton, Bas, all,
>> >
>> > [Bas Vermeulen]
>> >> > I get a kernel BUG when mounting my (dirty) NTFS volume.
>> >> >
>> >> > Sep 12 18:54:47 laptop kernel: [4294708.961000] NTFS volume version
>> >> > 3.1. Sep 12 18:54:47 laptop kernel: [4294708.961000] NTFS-fs error
>> >> > (device sda2): load_system_files(): Volume is dirty. Mounting
>> >> > read-only. Run chkdsk and mount in Windows.
>> >> > Sep 12 18:54:47 laptop kernel: [4294709.063000] ------------[ cut
>> >> > here ]------------
>> >> > Sep 12 18:54:47 laptop kernel: [4294709.063000] kernel BUG at
>> >> > fs/ntfs/aops.c:403!
>> >
>> > I just hit the same BUG in different conditions. My NTFS volume is not
>> > dirty, not compressed and the BUG triggered on use (updatedb), not
>> > mount.
>>
>> Same here, but it only triggers accessing a compressed directory. I can
>> reproduce at will just by using 'ls' inside a compressed dir.
>
> Below is the fix I just sent off to Linus.

Hi Anton,
I can confirm that the patch fixes the bug.

thanks,
Luca
--
Home: http://kronoz.cjb.net
"It is more complicated than you think"
-- The Eighth Networking Truth from RFC 1925

2005-09-20 17:47:40

by Anton Altaparmakov

[permalink] [raw]
Subject: Re: 2.6.14-rc1 - kernel BUG at fs/ntfs/aops.c:403

On Tue, 20 Sep 2005, Luca wrote:
> Anton Altaparmakov <[email protected]> ha scritto:
> > On Sat, 2005-09-17 at 16:51 +0200, Luca wrote:
> >> Jean Delvare <[email protected]> ha scritto:
> >> > Hi Anton, Bas, all,
> >> >
> >> > [Bas Vermeulen]
> >> >> > I get a kernel BUG when mounting my (dirty) NTFS volume.
> >> >> >
> >> >> > Sep 12 18:54:47 laptop kernel: [4294708.961000] NTFS volume version
> >> >> > 3.1. Sep 12 18:54:47 laptop kernel: [4294708.961000] NTFS-fs error
> >> >> > (device sda2): load_system_files(): Volume is dirty. Mounting
> >> >> > read-only. Run chkdsk and mount in Windows.
> >> >> > Sep 12 18:54:47 laptop kernel: [4294709.063000] ------------[ cut
> >> >> > here ]------------
> >> >> > Sep 12 18:54:47 laptop kernel: [4294709.063000] kernel BUG at
> >> >> > fs/ntfs/aops.c:403!
> >> >
> >> > I just hit the same BUG in different conditions. My NTFS volume is not
> >> > dirty, not compressed and the BUG triggered on use (updatedb), not
> >> > mount.
> >>
> >> Same here, but it only triggers accessing a compressed directory. I can
> >> reproduce at will just by using 'ls' inside a compressed dir.
> >
> > Below is the fix I just sent off to Linus.
>
> Hi Anton,
> I can confirm that the patch fixes the bug.

Cool, thanks.

Best regards,

Anton
--
Anton Altaparmakov <aia21 at cam.ac.uk> (replace at with @)
Unix Support, Computing Service, University of Cambridge, CB2 3QH, UK
Linux NTFS maintainer / IRC: #ntfs on irc.freenode.net
WWW: http://linux-ntfs.sf.net/ & http://www-stu.christs.cam.ac.uk/~aia21/

2005-09-21 18:36:25

by Jean Delvare

[permalink] [raw]
Subject: Re: 2.6.14-rc1 - kernel BUG at fs/ntfs/aops.c:403

Hi Anton,

> Below is the fix I just sent off to Linus.

2.6.14-rc2 works for me.

Thanks,
--
Jean Delvare

2005-09-21 19:34:59

by Anton Altaparmakov

[permalink] [raw]
Subject: Re: 2.6.14-rc1 - kernel BUG at fs/ntfs/aops.c:403

Hi,

On Wed, 21 Sep 2005, Jean Delvare wrote:
> > Below is the fix I just sent off to Linus.
>
> 2.6.14-rc2 works for me.

Great, thanks.

Best regards,

Anton
--
Anton Altaparmakov <aia21 at cam.ac.uk> (replace at with @)
Unix Support, Computing Service, University of Cambridge, CB2 3QH, UK
Linux NTFS maintainer / IRC: #ntfs on irc.freenode.net
WWW: http://linux-ntfs.sf.net/ & http://www-stu.christs.cam.ac.uk/~aia21/