Skip to contentSkip to conversation

2.6.14-rc1 - kernel BUG at fs/ntfs/aops.c:403

DISCUSSION Bas Vermeulen 4 participants 13 messages Sep 15, 2005 – Sep 21, 2005 NTFS filesystem

lore
Share & tools
lore
#0 lore raw

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.

Signature · 1 line
Bas Vermeulen <[email protected]>
#1 lore raw

Hi,

Quoted 10 lines · 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!

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 renamed from aops.c.old +4 -0
@@ -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

Signature · 4 lines
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/
#2 lore raw
Quoted 4 lines · 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:

done.

Quoted 1 line

2) Enable ntfs debugging in the kernel configuration.

done.

Quoted 7 lines

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.

Quoted 2 lines

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

Signature · 1 line
Bas Vermeulen <[email protected]>
#3 lore raw
Quoted 6 lines · Bas Vermeulen
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

Signature · 4 lines
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/
#4 lore raw
Quoted 8 lines · Anton Altaparmakov
Quoted 6 lines · Bas Vermeulen
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.

Quoted 5 lines

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,

Signature · 1 line
Bas Vermeulen <[email protected]>
#5 lore raw
Quoted 9 lines · Bas Vermeulen
Quoted 8 lines · Anton Altaparmakov
Quoted 6 lines · Bas Vermeulen
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.

Quoted 7 lines
Quoted 5 lines

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

Signature · 4 lines
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/
#6 lore raw
In reply to Anton Altaparmakov

Hi Anton, Bas, all,

[Bas Vermeulen]

Quoted 10 lines
Quoted 10 lines

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]

Quoted 23 lines

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 renamed from aops.c.old +4 -0
@@ -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).

Quoted 8 lines

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,

Signature · 1 line
Jean Delvare
#7 lore raw

Jean Delvare <[email protected]> ha scritto:

Quoted 14 lines

Hi Anton, Bas, all,

[Bas Vermeulen]

Quoted 10 lines
Quoted 10 lines

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!

Quoted 3 lines

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.

Quoted 1 line

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

ntfsinfo(8)

Luca

Signature · 2 lines
Home: http://kronoz.cjb.net
Se non puoi convincerli, confondili.
#8 lore raw

Hi,

Quoted 15 lines · Luca

Jean Delvare <[email protected]> ha scritto:

Quoted 14 lines

Hi Anton, Bas, all,

[Bas Vermeulen]

Quoted 10 lines
Quoted 10 lines

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!

Quoted 6 lines
Quoted 3 lines

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

Signature · 15 lines
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
fs/ntfs/aops.c +8 -4
@@ -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);
#9 lore raw

Anton Altaparmakov <[email protected]> ha scritto:

Quoted 18 lines

Hi,

Quoted 15 lines · Luca

Jean Delvare <[email protected]> ha scritto:

Quoted 14 lines

Hi Anton, Bas, all,

[Bas Vermeulen]

Quoted 10 lines
Quoted 10 lines

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!

Quoted 8 lines
Quoted 6 lines
Quoted 3 lines

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

Signature · 3 lines
Home: http://kronoz.cjb.net
"It is more complicated than you think"
                -- The Eighth Networking Truth from RFC 1925
#10 lore raw
Quoted 21 lines · Luca

Anton Altaparmakov <[email protected]> ha scritto:

Quoted 20 lines · Luca
Quoted 19 lines

Jean Delvare <[email protected]> ha scritto:

Quoted 17 lines

Hi Anton, Bas, all,

[Bas Vermeulen]

Quoted 10 lines
Quoted 10 lines

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.

Quoted 7 lines
Quoted 4 lines
Quoted 2 lines

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

Signature · 4 lines
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/
#12 lore raw

Hi,

Quoted 3 lines · Jean Delvare
Quoted 1 line

Below is the fix I just sent off to Linus.

2.6.14-rc2 works for me.

Great, thanks.

Best regards,

Anton

Signature · 4 lines
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/