lkml.org 
[lkml]   [2000]   [Nov]   [30]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
SubjectPATCH: 2.4.0-test12-pre3: fix ntfs BUG() call
Attached patch fixes the BUG() people are seeing when using the ntfs
driver with 2.4.0-test* kernels. Patch is tested and everything seems to
be working fine with it.

Description:

The BUG() call was due to a not implemented ntfs_get_block().

The fix is to comment out all [bm]map associated code since if any of it
is used it results in the BUG().

I haven't removed the code altogether, since, once ntfs_get_block is
implemented, the rest of the code can just be uncommented and it should
all work.

This patch has been submitted to Linus for inclusion in the next
2.4.0.test* kernel.

Regards,

Anton

--
Anton Altaparmakov Phone: +44-(0)1223-333541 (lab)
Christ's College eMail: AntonA@bigfoot.com / aia21@[cus.]cam.ac.uk
Cambridge CB2 3BU WWW: http://www-stu.christs.cam.ac.uk/~aia21/
United Kingdom ICQ: 8561279
diff -ur linux-2.4.0-test12-pre3/fs/ntfs/fs.c linux/fs/ntfs/fs.c
--- linux-2.4.0-test12-pre3/fs/ntfs/fs.c Thu Nov 16 21:18:26 2000
+++ linux/fs/ntfs/fs.c Fri Dec 1 00:08:38 2000
@@ -557,7 +557,8 @@
#endif

/* It's fscking broken. */
-
+/* FIXME: [bm]map code is disabled until ntfs_get_block gets sorted! */
+/*
static int ntfs_get_block(struct inode *inode, long block, struct buffer_head *bh, int create)
{
BUG();
@@ -573,6 +574,7 @@
};

static struct inode_operations ntfs_inode_operations;
+*/

static struct file_operations ntfs_dir_operations = {
read: generic_read_dir,
@@ -587,6 +589,7 @@
#endif
};

+/*
static int ntfs_writepage(struct file *file, struct page *page)
{
return block_write_full_page(page,ntfs_get_block);
@@ -612,6 +615,8 @@
commit_write: generic_commit_write,
bmap: _ntfs_bmap
};
+*/
+
/* ntfs_read_inode is called by the Virtual File System (the kernel layer that
* deals with filesystems) when iget is called requesting an inode not already
* present in the inode table. Typically filesystems have separate
@@ -664,7 +669,10 @@
else
{
inode->i_size=data->size;
- can_mmap=!data->resident && !data->compressed;
+ /* FIXME: once ntfs_get_block is implemented, uncomment the
+ * next line and remove the can_mmap = 0; */
+ /* can_mmap=!data->resident && !data->compressed;*/
+ can_mmap = 0;
}
/* get the file modification times from the standard information */
si=ntfs_find_attr(ino,vol->at_standard_information,NULL);
@@ -687,12 +695,17 @@
}
else
{
- if (can_mmap) {
+ /* As long as ntfs_get_block() is just a call to BUG() do not
+ * define any [bm]map ops or we get the BUG() whenever someone
+ * runs mc or mpg123 on an ntfs partition!
+ * FIXME: Uncomment the below code when ntfs_get_block is
+ * implemented. */
+ /* if (can_mmap) {
inode->i_op = &ntfs_inode_operations;
inode->i_fop = &ntfs_file_operations;
inode->i_mapping->a_ops = &ntfs_aops;
inode->u.ntfs_i.mmu_private = inode->i_size;
- } else {
+ } else */ {
inode->i_op=&ntfs_inode_operations_nobmap;
inode->i_fop=&ntfs_file_operations_nommap;
}
\
 
 \ /
  Last update: 2005-03-22 12:51    [W:0.061 / U:0.032 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site