Messages in this thread Patch in this message | | | Date | Thu, 12 Nov 1998 09:01:09 -0500 (EST) | From | Alexander Viro <> | Subject | [PATCH] Fixes to fs drivers (bmap et. al.) |
| |
[Cc'd to maintainers]
a) msdos, vfat, isofs and ufs have bmap method in directory inodes. All paths that can lead to call of foo->bmap do it only if we (1) have foo->readpage or (2) foo is regular. None of these conditions is fulfilled.
b) qnx4 defines create for symlinks' and regular files' inodes ;-)
c) I suspect that bmap and readpage are off-the-wall for umsdos directory inodes too, but couldn't verify it yet. In principle they may be legitimate there, but _only_ if for some reasons fat_read_read is ever called for such beasts. Bloody unlikely, but then it _is_ called for umsdos symlinks...
d) there are few functions in minixfs that don't need to be public (e.g. V1_minix_truncate). Cheers, Al
Patch below fixes (a), (b) and (d). It's against 2.1.127, but it seems that it should apply to 2.1.128-pre1 too.
--- fs/msdos/namei.c.old Sun Oct 4 18:33:57 1998 +++ fs/msdos/namei.c Thu Nov 12 02:00:36 1998 @@ -993,7 +993,7 @@ NULL, /* follow_link */ NULL, /* readpage */ NULL, /* writepage */ - fat_bmap, /* bmap */ + NULL, /* bmap */ NULL, /* truncate */ NULL, /* permission */ NULL, /* smap */ --- fs/vfat/namei.c.old Sun Oct 4 18:33:31 1998 +++ fs/vfat/namei.c Thu Nov 12 02:02:28 1998 @@ -1846,7 +1846,7 @@ NULL, /* followlink */ NULL, /* readpage */ NULL, /* writepage */ - fat_bmap, /* bmap */ + NULL, /* bmap */ NULL, /* truncate */ NULL /* permission */ }; --- fs/isofs/dir.c.old Sun Oct 4 18:32:37 1998 +++ fs/isofs/dir.c Thu Nov 12 02:06:00 1998 @@ -59,7 +59,7 @@ NULL, /* follow_link */ NULL, /* readpage */ NULL, /* writepage */ - isofs_bmap, /* bmap */ + NULL, /* bmap */ NULL, /* truncate */ NULL /* permission */ }; *** fs/ufs/dir.c.old Sat Oct 24 22:36:29 1998 --- fs/ufs/dir.c Thu Nov 12 02:08:26 1998 *************** *** 220,223 **** NULL, /* follow_link */ NULL, /* readpage */ NULL, /* writepage */ ! ufs_bmap, /* bmap */ --- 220,223 ---- NULL, /* follow_link */ NULL, /* readpage */ NULL, /* writepage */ ! NULL, /* bmap */ --- fs/qnx4/file.c.old Sun Oct 4 18:33:02 1998 +++ fs/qnx4/file.c Thu Nov 12 02:22:32 1998 @@ -180,11 +180,7 @@ struct inode_operations qnx4_file_inode_operations = { &qnx4_file_operations, /* default file operations */ -#ifdef CONFIG_QNX4FS_RW - qnx4_create, /* create */ -#else - NULL, -#endif + NULL, /* create? It's not a directory */ NULL, /* lookup */ NULL, /* link */ NULL, /* unlink */ --- fs/qnx4/symlinks.c.old Sun Oct 4 18:33:02 1998 +++ fs/qnx4/symlinks.c Thu Nov 12 02:24:44 1998 @@ -32,11 +32,7 @@ struct inode_operations qnx4_symlink_inode_operations = { NULL, /* no file-operations */ -#ifdef CONFIG_QNX4FS_RW - qnx4_create, /* create */ -#else - NULL, -#endif + NULL, /* create */ NULL, /* lookup */ NULL, /* link */ NULL, /* unlink */ --- fs/minix/fsync.c.old Sat Sep 13 14:07:28 1997 +++ fs/minix/fsync.c Thu Nov 12 02:29:07 1998 @@ -144,7 +144,7 @@ return err; } -int V1_minix_sync_file(struct inode * inode, struct file * file) +static int V1_minix_sync_file(struct inode * inode, struct file * file) { int wait, err = 0; @@ -305,7 +305,7 @@ return err; } -int V2_minix_sync_file(struct inode * inode, struct file * file) +static int V2_minix_sync_file(struct inode * inode, struct file * file) { int wait, err = 0; --- fs/minix/inode.c.old Sun Oct 4 18:29:54 1998 +++ fs/minix/inode.c Thu Nov 12 02:33:05 1998 @@ -40,7 +40,7 @@ sb->s_dirt = 0; } -void minix_write_super (struct super_block * sb) +static void minix_write_super (struct super_block * sb) { struct minix_super_block * ms; @@ -55,7 +55,7 @@ } -void minix_put_super(struct super_block *sb) +static void minix_put_super(struct super_block *sb) { int i; @@ -86,7 +86,7 @@ minix_remount }; -int minix_remount (struct super_block * sb, int * flags, char * data) +static int minix_remount (struct super_block * sb, int * flags, char * data) { struct minix_super_block * ms; @@ -162,7 +162,7 @@ return errmsg; } -struct super_block *minix_read_super(struct super_block *s, void *data, +static struct super_block *minix_read_super(struct super_block *s, void *data, int silent) { struct buffer_head *bh; @@ -326,7 +326,7 @@ return NULL; } -int minix_statfs(struct super_block *sb, struct statfs *buf, int bufsiz) +static int minix_statfs(struct super_block *sb, struct statfs *buf, int bufsiz) { struct statfs tmp; @@ -830,7 +830,7 @@ /* * The global function to read an inode. */ -void minix_read_inode(struct inode * inode) +static void minix_read_inode(struct inode * inode) { if (INODE_VERSION(inode) == MINIX_V1) V1_minix_read_inode(inode); @@ -916,7 +916,7 @@ return bh; } -struct buffer_head *minix_update_inode(struct inode *inode) +static struct buffer_head *minix_update_inode(struct inode *inode) { if (INODE_VERSION(inode) == MINIX_V1) return V1_minix_update_inode(inode); @@ -924,7 +924,7 @@ return V2_minix_update_inode(inode); } -void minix_write_inode(struct inode * inode) +static void minix_write_inode(struct inode * inode) { struct buffer_head *bh; --- fs/minix/truncate.c.old Sun Oct 4 18:29:54 1998 +++ fs/minix/truncate.c Thu Nov 12 02:33:23 1998 @@ -176,7 +176,7 @@ return retry; } -void V1_minix_truncate(struct inode * inode) +static void V1_minix_truncate(struct inode * inode) { int retry;
- 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/
| |