Re: crash while reading win2k ntfs partition

From: Anton Altaparmakov (aia21@cam.ac.uk)
Date: Sat Apr 29 2000 - 14:07:12 EST


At 00:36 29/04/2000, Florin Andrei wrote:
[snip]
> When i tried to view with Midnight Commander (using the F3
> function) a
>file from C:\ i got this:
>
>Apr 29 02:18:46 main kernel: kernel BUG at fs.c:562!
>Apr 29 02:18:46 main kernel: invalid operand: 0000
>Apr 29 02:18:46 main kernel: CPU: 0
>Apr 29 02:18:46 main kernel: EIP: 0010:[ntfs_get_block+20/32]
[snip]
>Apr 29 02:18:46 main kernel: Call Trace: [tvecs+123490/153692]
>[tvecs+124580/153692] [block_read_full_page+321/632]
>[add_to_page_cache_unique+209/320] [ntfs_readpage+15/20]
>[ntfs_get_block+0/32] [read_cluster_nonblocking+249/332]
>Apr 29 02:18:46 main kernel: [filemap_nopage+439/932]
>[do_no_page+85/192] [handle_mm_fault+232/356] [do_page_fault+389/1224]
>[old_mmap+285/400] [error_code+45/52]
[snip]

This crash is not exactly a bug in the driver (um, well, I guess it is a
bug of sorts) but more of a "feature_not_implemented" type of problem. -
just to quote from the source:

-----
/* It's fscking broken. */

static int ntfs_get_block(struct inode *inode, long block, struct
buffer_head *bh, int create)
{
         BUG();
         return -1;
}
-----

Also looking at the implementation of block_read_full_page in fs/buffer.c
(starts on line 1535, linux-2.3.99-pre7-1) the call to the file system
supplied get_block function is not checked for its return value so it
wouldn't trap that ntfs_get_block wouldn't be "successful".

If anyone has any suggestions of how to handle this situation more
elegantly please let me know... - NB. I am not looking for the suggestion
"implement ntfs_get_block" unless you want to do it and send me a patch...

Also would people consider it a Good Thing (TM) if the driver checks for
the NTFS version during mount time and for example refuses to enable write
access if Win2k has upgraded the NTFS partition to the win2k version of
NTFS? IMHO this would be a good idea but I would like to hear what others
think first, before doing it.

Anton

--

"Education is what remains after one has forgotten everything he learned in school." - Albert Einstein

-- Anton Altaparmakov Voice: 01223-333541(lab) / 07712-632205(mobile) Christ's College eMail: AntonA@bigfoot.com Cambridge CB2 3BU ICQ: 8561279 United Kingdom WWW: http://www-stu.christs.cam.ac.uk/~aia21/

- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.rutgers.edu Please read the FAQ at http://www.tux.org/lkml/



This archive was generated by hypermail 2b29 : Sun Apr 30 2000 - 21:00:17 EST