2003-06-30 14:28:17

by Trond Myklebust

[permalink] [raw]
Subject: [PATCH 1/4] Optimize NFS open() calls by means of 'intents'...


- Make the VFS pass the struct nameidata as an optional argument
to the create inode operation.
- Patch vfs_create() to take a struct nameidata as an optional
argument.


diff -u --recursive --new-file linux-2.5.73-04-lookupintent/fs/affs/namei.c linux-2.5.73-05-createintent/fs/affs/namei.c
--- linux-2.5.73-04-lookupintent/fs/affs/namei.c 2003-06-30 08:48:42.000000000 +0200
+++ linux-2.5.73-05-createintent/fs/affs/namei.c 2003-06-30 08:49:04.000000000 +0200
@@ -256,7 +256,7 @@
}

int
-affs_create(struct inode *dir, struct dentry *dentry, int mode)
+affs_create(struct inode *dir, struct dentry *dentry, int mode, struct nameidata *nd)
{
struct super_block *sb = dir->i_sb;
struct inode *inode;
diff -u --recursive --new-file linux-2.5.73-04-lookupintent/fs/bfs/dir.c linux-2.5.73-05-createintent/fs/bfs/dir.c
--- linux-2.5.73-04-lookupintent/fs/bfs/dir.c 2003-06-30 08:48:42.000000000 +0200
+++ linux-2.5.73-05-createintent/fs/bfs/dir.c 2003-06-30 08:49:04.000000000 +0200
@@ -78,7 +78,8 @@

extern void dump_imap(const char *, struct super_block *);

-static int bfs_create(struct inode * dir, struct dentry * dentry, int mode)
+static int bfs_create(struct inode * dir, struct dentry * dentry, int mode,
+ struct nameidata *nd)
{
int err;
struct inode * inode;
diff -u --recursive --new-file linux-2.5.73-04-lookupintent/fs/cifs/cifsfs.h linux-2.5.73-05-createintent/fs/cifs/cifsfs.h
--- linux-2.5.73-04-lookupintent/fs/cifs/cifsfs.h 2003-06-30 08:48:42.000000000 +0200
+++ linux-2.5.73-05-createintent/fs/cifs/cifsfs.h 2003-06-30 08:49:04.000000000 +0200
@@ -46,7 +46,7 @@

/* Functions related to inodes */
extern struct inode_operations cifs_dir_inode_ops;
-extern int cifs_create(struct inode *, struct dentry *, int);
+extern int cifs_create(struct inode *, struct dentry *, int, struct nameidata *);
extern struct dentry *cifs_lookup(struct inode *, struct dentry *, struct nameidata *);
extern int cifs_unlink(struct inode *, struct dentry *);
extern int cifs_hardlink(struct dentry *, struct inode *, struct dentry *);
diff -u --recursive --new-file linux-2.5.73-04-lookupintent/fs/cifs/dir.c linux-2.5.73-05-createintent/fs/cifs/dir.c
--- linux-2.5.73-04-lookupintent/fs/cifs/dir.c 2003-06-30 08:48:42.000000000 +0200
+++ linux-2.5.73-05-createintent/fs/cifs/dir.c 2003-06-30 08:49:04.000000000 +0200
@@ -119,7 +119,8 @@
/* Inode operations in similar order to how they appear in the Linux file fs.h */

int
-cifs_create(struct inode *inode, struct dentry *direntry, int mode)
+cifs_create(struct inode *inode, struct dentry *direntry, int mode,
+ struct nameidata *nd)
{
int rc = -ENOENT;
int xid;
diff -u --recursive --new-file linux-2.5.73-04-lookupintent/fs/coda/dir.c linux-2.5.73-05-createintent/fs/coda/dir.c
--- linux-2.5.73-04-lookupintent/fs/coda/dir.c 2003-06-30 08:48:42.000000000 +0200
+++ linux-2.5.73-05-createintent/fs/coda/dir.c 2003-06-30 08:49:04.000000000 +0200
@@ -28,7 +28,7 @@
#include <linux/coda_proc.h>

/* dir inode-ops */
-static int coda_create(struct inode *dir, struct dentry *new, int mode);
+static int coda_create(struct inode *dir, struct dentry *new, int mode, struct nameidata *nd);
static int coda_mknod(struct inode *dir, struct dentry *new, int mode, dev_t rdev);
static struct dentry *coda_lookup(struct inode *dir, struct dentry *target, struct nameidata *nd);
static int coda_link(struct dentry *old_dentry, struct inode *dir_inode,
@@ -190,7 +190,7 @@
}

/* creation routines: create, mknod, mkdir, link, symlink */
-static int coda_create(struct inode *dir, struct dentry *de, int mode)
+static int coda_create(struct inode *dir, struct dentry *de, int mode, struct nameidata *nd)
{
int error=0;
const char *name=de->d_name.name;
diff -u --recursive --new-file linux-2.5.73-04-lookupintent/fs/ext2/namei.c linux-2.5.73-05-createintent/fs/ext2/namei.c
--- linux-2.5.73-04-lookupintent/fs/ext2/namei.c 2003-06-30 08:48:42.000000000 +0200
+++ linux-2.5.73-05-createintent/fs/ext2/namei.c 2003-06-30 08:49:04.000000000 +0200
@@ -120,7 +120,7 @@
* If the create succeeds, we fill in the inode information
* with d_instantiate().
*/
-static int ext2_create (struct inode * dir, struct dentry * dentry, int mode)
+static int ext2_create (struct inode * dir, struct dentry * dentry, int mode, struct nameidata *nd)
{
struct inode * inode = ext2_new_inode (dir, mode);
int err = PTR_ERR(inode);
diff -u --recursive --new-file linux-2.5.73-04-lookupintent/fs/ext3/namei.c linux-2.5.73-05-createintent/fs/ext3/namei.c
--- linux-2.5.73-04-lookupintent/fs/ext3/namei.c 2003-06-30 08:48:42.000000000 +0200
+++ linux-2.5.73-05-createintent/fs/ext3/namei.c 2003-06-30 08:49:04.000000000 +0200
@@ -1623,7 +1623,8 @@
* If the create succeeds, we fill in the inode information
* with d_instantiate().
*/
-static int ext3_create (struct inode * dir, struct dentry * dentry, int mode)
+static int ext3_create (struct inode * dir, struct dentry * dentry, int mode,
+ struct nameidata *nd)
{
handle_t *handle;
struct inode * inode;
diff -u --recursive --new-file linux-2.5.73-04-lookupintent/fs/hfs/dir.c linux-2.5.73-05-createintent/fs/hfs/dir.c
--- linux-2.5.73-04-lookupintent/fs/hfs/dir.c 2002-02-15 01:54:38.000000000 +0100
+++ linux-2.5.73-05-createintent/fs/hfs/dir.c 2003-06-30 08:49:04.000000000 +0200
@@ -163,7 +163,7 @@
* a directory and return a corresponding inode, given the inode for
* the directory and the name (and its length) of the new file.
*/
-int hfs_create(struct inode * dir, struct dentry *dentry, int mode)
+int hfs_create(struct inode * dir, struct dentry *dentry, int mode, struct nameidata *nd)
{
struct hfs_cat_entry *entry = HFS_I(dir)->entry;
struct hfs_cat_entry *new;
diff -u --recursive --new-file linux-2.5.73-04-lookupintent/fs/hfs/dir_dbl.c linux-2.5.73-05-createintent/fs/hfs/dir_dbl.c
--- linux-2.5.73-04-lookupintent/fs/hfs/dir_dbl.c 2003-06-30 08:48:42.000000000 +0200
+++ linux-2.5.73-05-createintent/fs/hfs/dir_dbl.c 2003-06-30 08:49:04.000000000 +0200
@@ -26,7 +26,7 @@

static struct dentry *dbl_lookup(struct inode *, struct dentry *, struct nameidata *);
static int dbl_readdir(struct file *, void *, filldir_t);
-static int dbl_create(struct inode *, struct dentry *, int);
+static int dbl_create(struct inode *, struct dentry *, int, struct nameidata *);
static int dbl_mkdir(struct inode *, struct dentry *, int);
static int dbl_unlink(struct inode *, struct dentry *);
static int dbl_rmdir(struct inode *, struct dentry *);
@@ -272,7 +272,7 @@
* the directory and the name (and its length) of the new file.
*/
static int dbl_create(struct inode * dir, struct dentry *dentry,
- int mode)
+ int mode, struct nameidata *nd)
{
int error;

@@ -280,7 +280,7 @@
if (is_hdr(dir, dentry->d_name.name, dentry->d_name.len)) {
error = -EEXIST;
} else {
- error = hfs_create(dir, dentry, mode);
+ error = hfs_create(dir, dentry, mode, nd);
}
unlock_kernel();
return error;
diff -u --recursive --new-file linux-2.5.73-04-lookupintent/fs/hpfs/hpfs_fn.h linux-2.5.73-05-createintent/fs/hpfs/hpfs_fn.h
--- linux-2.5.73-04-lookupintent/fs/hpfs/hpfs_fn.h 2003-06-30 08:48:42.000000000 +0200
+++ linux-2.5.73-05-createintent/fs/hpfs/hpfs_fn.h 2003-06-30 08:49:04.000000000 +0200
@@ -285,7 +285,7 @@
/* namei.c */

int hpfs_mkdir(struct inode *, struct dentry *, int);
-int hpfs_create(struct inode *, struct dentry *, int);
+int hpfs_create(struct inode *, struct dentry *, int, struct nameidata *);
int hpfs_mknod(struct inode *, struct dentry *, int, dev_t);
int hpfs_symlink(struct inode *, struct dentry *, const char *);
int hpfs_unlink(struct inode *, struct dentry *);
diff -u --recursive --new-file linux-2.5.73-04-lookupintent/fs/hpfs/namei.c linux-2.5.73-05-createintent/fs/hpfs/namei.c
--- linux-2.5.73-04-lookupintent/fs/hpfs/namei.c 2003-06-26 01:30:54.000000000 +0200
+++ linux-2.5.73-05-createintent/fs/hpfs/namei.c 2003-06-30 08:49:04.000000000 +0200
@@ -106,7 +106,7 @@
return -ENOSPC;
}

-int hpfs_create(struct inode *dir, struct dentry *dentry, int mode)
+int hpfs_create(struct inode *dir, struct dentry *dentry, int mode, struct nameidata *nd)
{
const char *name = dentry->d_name.name;
unsigned len = dentry->d_name.len;
diff -u --recursive --new-file linux-2.5.73-04-lookupintent/fs/hugetlbfs/inode.c linux-2.5.73-05-createintent/fs/hugetlbfs/inode.c
--- linux-2.5.73-04-lookupintent/fs/hugetlbfs/inode.c 2003-06-20 22:16:19.000000000 +0200
+++ linux-2.5.73-05-createintent/fs/hugetlbfs/inode.c 2003-06-30 08:49:04.000000000 +0200
@@ -462,7 +462,7 @@
return retval;
}

-static int hugetlbfs_create(struct inode *dir, struct dentry *dentry, int mode)
+static int hugetlbfs_create(struct inode *dir, struct dentry *dentry, int mode, struct nameidata *nd)
{
return hugetlbfs_mknod(dir, dentry, mode | S_IFREG, 0);
}
diff -u --recursive --new-file linux-2.5.73-04-lookupintent/fs/intermezzo/dir.c linux-2.5.73-05-createintent/fs/intermezzo/dir.c
--- linux-2.5.73-04-lookupintent/fs/intermezzo/dir.c 2003-06-30 08:48:42.000000000 +0200
+++ linux-2.5.73-05-createintent/fs/intermezzo/dir.c 2003-06-30 08:49:04.000000000 +0200
@@ -412,7 +412,8 @@
return 0;
}

-static int presto_create(struct inode * dir, struct dentry * dentry, int mode)
+static int presto_create(struct inode * dir, struct dentry * dentry, int mode,
+ struct nameidata *nd)
{
int error;
struct presto_cache *cache;
diff -u --recursive --new-file linux-2.5.73-04-lookupintent/fs/intermezzo/vfs.c linux-2.5.73-05-createintent/fs/intermezzo/vfs.c
--- linux-2.5.73-04-lookupintent/fs/intermezzo/vfs.c 2003-06-12 05:00:51.000000000 +0200
+++ linux-2.5.73-05-createintent/fs/intermezzo/vfs.c 2003-06-30 08:49:04.000000000 +0200
@@ -598,7 +598,7 @@
}
DQUOT_INIT(dir->d_inode);
lock_kernel();
- error = iops->create(dir->d_inode, dentry, mode);
+ error = iops->create(dir->d_inode, dentry, mode, NULL);
if (error) {
EXIT;
goto exit_lock;
diff -u --recursive --new-file linux-2.5.73-04-lookupintent/fs/jffs/inode-v23.c linux-2.5.73-05-createintent/fs/jffs/inode-v23.c
--- linux-2.5.73-04-lookupintent/fs/jffs/inode-v23.c 2003-06-30 08:48:42.000000000 +0200
+++ linux-2.5.73-05-createintent/fs/jffs/inode-v23.c 2003-06-30 08:49:04.000000000 +0200
@@ -1273,7 +1273,8 @@
* with d_instantiate().
*/
static int
-jffs_create(struct inode *dir, struct dentry *dentry, int mode)
+jffs_create(struct inode *dir, struct dentry *dentry, int mode,
+ struct nameidata *nd)
{
struct jffs_raw_inode raw_inode;
struct jffs_control *c;
diff -u --recursive --new-file linux-2.5.73-04-lookupintent/fs/jffs2/dir.c linux-2.5.73-05-createintent/fs/jffs2/dir.c
--- linux-2.5.73-04-lookupintent/fs/jffs2/dir.c 2003-06-30 08:48:42.000000000 +0200
+++ linux-2.5.73-05-createintent/fs/jffs2/dir.c 2003-06-30 08:49:04.000000000 +0200
@@ -32,7 +32,7 @@

static int jffs2_readdir (struct file *, void *, filldir_t);

-static int jffs2_create (struct inode *,struct dentry *,int);
+static int jffs2_create (struct inode *,struct dentry *,int, struct nameidata *);
static struct dentry *jffs2_lookup (struct inode *,struct dentry *, struct nameidata *);
static int jffs2_link (struct dentry *,struct inode *,struct dentry *);
static int jffs2_unlink (struct inode *,struct dentry *);
@@ -175,7 +175,8 @@
/***********************************************************************/


-static int jffs2_create(struct inode *dir_i, struct dentry *dentry, int mode)
+static int jffs2_create(struct inode *dir_i, struct dentry *dentry, int mode,
+ struct nameidata *nd)
{
struct jffs2_raw_inode *ri;
struct jffs2_inode_info *f, *dir_f;
diff -u --recursive --new-file linux-2.5.73-04-lookupintent/fs/jfs/namei.c linux-2.5.73-05-createintent/fs/jfs/namei.c
--- linux-2.5.73-04-lookupintent/fs/jfs/namei.c 2003-06-30 08:48:42.000000000 +0200
+++ linux-2.5.73-05-createintent/fs/jfs/namei.c 2003-06-30 08:49:04.000000000 +0200
@@ -54,11 +54,13 @@
* PARAMETER: dip - parent directory vnode
* dentry - dentry of new file
* mode - create mode (rwxrwxrwx).
+ * nd- nd struct
*
* RETURN: Errors from subroutines
*
*/
-int jfs_create(struct inode *dip, struct dentry *dentry, int mode)
+int jfs_create(struct inode *dip, struct dentry *dentry, int mode,
+ struct nameidata *nd)
{
int rc = 0;
tid_t tid; /* transaction id */
diff -u --recursive --new-file linux-2.5.73-04-lookupintent/fs/minix/namei.c linux-2.5.73-05-createintent/fs/minix/namei.c
--- linux-2.5.73-04-lookupintent/fs/minix/namei.c 2003-06-30 08:48:42.000000000 +0200
+++ linux-2.5.73-05-createintent/fs/minix/namei.c 2003-06-30 08:49:04.000000000 +0200
@@ -89,7 +89,8 @@
return error;
}

-static int minix_create(struct inode * dir, struct dentry *dentry, int mode)
+static int minix_create(struct inode * dir, struct dentry *dentry, int mode,
+ struct nameidata *nd)
{
return minix_mknod(dir, dentry, mode, 0);
}
diff -u --recursive --new-file linux-2.5.73-04-lookupintent/fs/msdos/namei.c linux-2.5.73-05-createintent/fs/msdos/namei.c
--- linux-2.5.73-04-lookupintent/fs/msdos/namei.c 2003-06-30 08:48:42.000000000 +0200
+++ linux-2.5.73-05-createintent/fs/msdos/namei.c 2003-06-30 08:49:04.000000000 +0200
@@ -261,7 +261,8 @@
*/

/***** Create a file */
-int msdos_create(struct inode *dir,struct dentry *dentry,int mode)
+int msdos_create(struct inode *dir,struct dentry *dentry,int mode,
+ struct nameidata *nd)
{
struct super_block *sb = dir->i_sb;
struct buffer_head *bh;
diff -u --recursive --new-file linux-2.5.73-04-lookupintent/fs/namei.c linux-2.5.73-05-createintent/fs/namei.c
--- linux-2.5.73-04-lookupintent/fs/namei.c 2003-06-30 08:48:42.000000000 +0200
+++ linux-2.5.73-05-createintent/fs/namei.c 2003-06-30 08:49:04.000000000 +0200
@@ -1105,7 +1105,8 @@
}
}

-int vfs_create(struct inode *dir, struct dentry *dentry, int mode)
+int vfs_create(struct inode *dir, struct dentry *dentry, int mode,
+ struct nameidata *nd)
{
int error = may_create(dir, dentry);

@@ -1120,7 +1121,7 @@
if (error)
return error;
DQUOT_INIT(dir);
- error = dir->i_op->create(dir, dentry, mode);
+ error = dir->i_op->create(dir, dentry, mode, nd);
if (!error) {
inode_dir_notify(dir, DN_CREATE);
security_inode_post_create(dir, dentry, mode);
@@ -1277,7 +1278,7 @@
if (!dentry->d_inode) {
if (!IS_POSIXACL(dir->d_inode))
mode &= ~current->fs->umask;
- error = vfs_create(dir->d_inode, dentry, mode);
+ error = vfs_create(dir->d_inode, dentry, mode, nd);
up(&dir->d_inode->i_sem);
dput(nd->dentry);
nd->dentry = dentry;
@@ -1445,7 +1446,7 @@
if (!IS_ERR(dentry)) {
switch (mode & S_IFMT) {
case 0: case S_IFREG:
- error = vfs_create(nd.dentry->d_inode,dentry,mode);
+ error = vfs_create(nd.dentry->d_inode,dentry,mode,&nd);
break;
case S_IFCHR: case S_IFBLK: case S_IFIFO: case S_IFSOCK:
error = vfs_mknod(nd.dentry->d_inode,dentry,mode,dev);
diff -u --recursive --new-file linux-2.5.73-04-lookupintent/fs/ncpfs/dir.c linux-2.5.73-05-createintent/fs/ncpfs/dir.c
--- linux-2.5.73-04-lookupintent/fs/ncpfs/dir.c 2003-06-30 08:48:42.000000000 +0200
+++ linux-2.5.73-05-createintent/fs/ncpfs/dir.c 2003-06-30 08:49:04.000000000 +0200
@@ -34,7 +34,7 @@

static int ncp_readdir(struct file *, void *, filldir_t);

-static int ncp_create(struct inode *, struct dentry *, int);
+static int ncp_create(struct inode *, struct dentry *, int, struct nameidata *);
static struct dentry *ncp_lookup(struct inode *, struct dentry *, struct nameidata *);
static int ncp_unlink(struct inode *, struct dentry *);
static int ncp_mkdir(struct inode *, struct dentry *, int);
@@ -942,7 +942,8 @@
return error;
}

-static int ncp_create(struct inode *dir, struct dentry *dentry, int mode)
+static int ncp_create(struct inode *dir, struct dentry *dentry, int mode,
+ struct nameidata *nd)
{
return ncp_create_new(dir, dentry, mode, 0, 0);
}
diff -u --recursive --new-file linux-2.5.73-04-lookupintent/fs/nfs/dir.c linux-2.5.73-05-createintent/fs/nfs/dir.c
--- linux-2.5.73-04-lookupintent/fs/nfs/dir.c 2003-06-30 08:48:42.000000000 +0200
+++ linux-2.5.73-05-createintent/fs/nfs/dir.c 2003-06-30 08:49:04.000000000 +0200
@@ -40,7 +40,7 @@
static struct dentry *nfs_lookup(struct inode *, struct dentry *, struct nameidata *);
static int nfs_cached_lookup(struct inode *, struct dentry *,
struct nfs_fh *, struct nfs_fattr *);
-static int nfs_create(struct inode *, struct dentry *, int);
+static int nfs_create(struct inode *, struct dentry *, int, struct nameidata *);
static int nfs_mkdir(struct inode *, struct dentry *, int);
static int nfs_rmdir(struct inode *, struct dentry *);
static int nfs_unlink(struct inode *, struct dentry *);
@@ -787,7 +787,8 @@
* that the operation succeeded on the server, but an error in the
* reply path made it appear to have failed.
*/
-static int nfs_create(struct inode *dir, struct dentry *dentry, int mode)
+static int nfs_create(struct inode *dir, struct dentry *dentry, int mode,
+ struct nameidata *nd)
{
struct iattr attr;
struct nfs_fattr fattr;
diff -u --recursive --new-file linux-2.5.73-04-lookupintent/fs/nfsd/vfs.c linux-2.5.73-05-createintent/fs/nfsd/vfs.c
--- linux-2.5.73-04-lookupintent/fs/nfsd/vfs.c 2003-06-20 22:16:06.000000000 +0200
+++ linux-2.5.73-05-createintent/fs/nfsd/vfs.c 2003-06-30 08:49:04.000000000 +0200
@@ -924,7 +924,7 @@
err = nfserr_perm;
switch (type) {
case S_IFREG:
- err = vfs_create(dirp, dchild, iap->ia_mode);
+ err = vfs_create(dirp, dchild, iap->ia_mode, NULL);
break;
case S_IFDIR:
err = vfs_mkdir(dirp, dchild, iap->ia_mode);
@@ -1067,7 +1067,7 @@
goto out;
}

- err = vfs_create(dirp, dchild, iap->ia_mode);
+ err = vfs_create(dirp, dchild, iap->ia_mode, NULL);
if (err < 0)
goto out_nfserr;

diff -u --recursive --new-file linux-2.5.73-04-lookupintent/fs/openpromfs/inode.c linux-2.5.73-05-createintent/fs/openpromfs/inode.c
--- linux-2.5.73-04-lookupintent/fs/openpromfs/inode.c 2003-06-30 08:48:42.000000000 +0200
+++ linux-2.5.73-05-createintent/fs/openpromfs/inode.c 2003-06-30 08:49:04.000000000 +0200
@@ -59,7 +59,7 @@
#define NODE2INO(node) (node + OPENPROM_FIRST_INO)
#define NODEP2INO(no) (no + OPENPROM_FIRST_INO + last_node)

-static int openpromfs_create (struct inode *, struct dentry *, int);
+static int openpromfs_create (struct inode *, struct dentry *, int, struct nameidata *);
static int openpromfs_readdir(struct file *, void *, filldir_t);
static struct dentry *openpromfs_lookup(struct inode *, struct dentry *dentry, struct nameidata *nd);
static int openpromfs_unlink (struct inode *, struct dentry *dentry);
@@ -854,7 +854,8 @@
return 0;
}

-static int openpromfs_create (struct inode *dir, struct dentry *dentry, int mode)
+static int openpromfs_create (struct inode *dir, struct dentry *dentry, int mode,
+ struct nameidata *nd)
{
char *p;
struct inode *inode;
diff -u --recursive --new-file linux-2.5.73-04-lookupintent/fs/qnx4/namei.c linux-2.5.73-05-createintent/fs/qnx4/namei.c
--- linux-2.5.73-04-lookupintent/fs/qnx4/namei.c 2003-06-30 08:48:43.000000000 +0200
+++ linux-2.5.73-05-createintent/fs/qnx4/namei.c 2003-06-30 08:49:04.000000000 +0200
@@ -142,7 +142,8 @@
}

#ifdef CONFIG_QNX4FS_RW
-int qnx4_create(struct inode *dir, struct dentry *dentry, int mode)
+int qnx4_create(struct inode *dir, struct dentry *dentry, int mode,
+ struct nameidata *nd)
{
QNX4DEBUG(("qnx4: qnx4_create\n"));
if (dir == NULL) {
diff -u --recursive --new-file linux-2.5.73-04-lookupintent/fs/ramfs/inode.c linux-2.5.73-05-createintent/fs/ramfs/inode.c
--- linux-2.5.73-04-lookupintent/fs/ramfs/inode.c 2003-05-26 04:19:54.000000000 +0200
+++ linux-2.5.73-05-createintent/fs/ramfs/inode.c 2003-06-30 08:49:04.000000000 +0200
@@ -111,7 +111,7 @@
return retval;
}

-static int ramfs_create(struct inode *dir, struct dentry *dentry, int mode)
+static int ramfs_create(struct inode *dir, struct dentry *dentry, int mode, struct nameidata *nd)
{
return ramfs_mknod(dir, dentry, mode | S_IFREG, 0);
}
diff -u --recursive --new-file linux-2.5.73-04-lookupintent/fs/reiserfs/namei.c linux-2.5.73-05-createintent/fs/reiserfs/namei.c
--- linux-2.5.73-04-lookupintent/fs/reiserfs/namei.c 2003-06-30 08:48:43.000000000 +0200
+++ linux-2.5.73-05-createintent/fs/reiserfs/namei.c 2003-06-30 08:49:04.000000000 +0200
@@ -558,7 +558,8 @@
return 0 ;
}

-static int reiserfs_create (struct inode * dir, struct dentry *dentry, int mode)
+static int reiserfs_create (struct inode * dir, struct dentry *dentry, int mode,
+ struct nameidata *nd)
{
int retval;
struct inode * inode;
diff -u --recursive --new-file linux-2.5.73-04-lookupintent/fs/smbfs/dir.c linux-2.5.73-05-createintent/fs/smbfs/dir.c
--- linux-2.5.73-04-lookupintent/fs/smbfs/dir.c 2003-06-30 08:48:43.000000000 +0200
+++ linux-2.5.73-05-createintent/fs/smbfs/dir.c 2003-06-30 08:49:04.000000000 +0200
@@ -25,7 +25,7 @@
static int smb_dir_open(struct inode *, struct file *);

static struct dentry *smb_lookup(struct inode *, struct dentry *, struct nameidata *);
-static int smb_create(struct inode *, struct dentry *, int);
+static int smb_create(struct inode *, struct dentry *, int, struct nameidata *);
static int smb_mkdir(struct inode *, struct dentry *, int);
static int smb_rmdir(struct inode *, struct dentry *);
static int smb_unlink(struct inode *, struct dentry *);
@@ -510,7 +510,8 @@

/* N.B. How should the mode argument be used? */
static int
-smb_create(struct inode *dir, struct dentry *dentry, int mode)
+smb_create(struct inode *dir, struct dentry *dentry, int mode,
+ struct nameidata *nd)
{
struct smb_sb_info *server = server_from_dentry(dentry);
__u16 fileid;
diff -u --recursive --new-file linux-2.5.73-04-lookupintent/fs/sysv/namei.c linux-2.5.73-05-createintent/fs/sysv/namei.c
--- linux-2.5.73-04-lookupintent/fs/sysv/namei.c 2003-06-30 08:48:43.000000000 +0200
+++ linux-2.5.73-05-createintent/fs/sysv/namei.c 2003-06-30 08:49:04.000000000 +0200
@@ -96,7 +96,7 @@
return err;
}

-static int sysv_create(struct inode * dir, struct dentry * dentry, int mode)
+static int sysv_create(struct inode * dir, struct dentry * dentry, int mode, struct nameidata *nd)
{
return sysv_mknod(dir, dentry, mode, 0);
}
diff -u --recursive --new-file linux-2.5.73-04-lookupintent/fs/udf/namei.c linux-2.5.73-05-createintent/fs/udf/namei.c
--- linux-2.5.73-04-lookupintent/fs/udf/namei.c 2003-06-30 08:48:43.000000000 +0200
+++ linux-2.5.73-05-createintent/fs/udf/namei.c 2003-06-30 08:49:04.000000000 +0200
@@ -621,7 +621,7 @@
return udf_write_fi(inode, cfi, fi, fibh, NULL, NULL);
}

-static int udf_create(struct inode *dir, struct dentry *dentry, int mode)
+static int udf_create(struct inode *dir, struct dentry *dentry, int mode, struct nameidata *nd)
{
struct udf_fileident_bh fibh;
struct inode *inode;
diff -u --recursive --new-file linux-2.5.73-04-lookupintent/fs/ufs/namei.c linux-2.5.73-05-createintent/fs/ufs/namei.c
--- linux-2.5.73-04-lookupintent/fs/ufs/namei.c 2003-06-30 08:48:43.000000000 +0200
+++ linux-2.5.73-05-createintent/fs/ufs/namei.c 2003-06-30 08:49:04.000000000 +0200
@@ -92,7 +92,8 @@
* If the create succeeds, we fill in the inode information
* with d_instantiate().
*/
-static int ufs_create (struct inode * dir, struct dentry * dentry, int mode)
+static int ufs_create (struct inode * dir, struct dentry * dentry, int mode,
+ struct nameidata *nd)
{
struct inode * inode = ufs_new_inode(dir, mode);
int err = PTR_ERR(inode);
diff -u --recursive --new-file linux-2.5.73-04-lookupintent/fs/umsdos/emd.c linux-2.5.73-05-createintent/fs/umsdos/emd.c
--- linux-2.5.73-04-lookupintent/fs/umsdos/emd.c 2002-04-30 00:18:54.000000000 +0200
+++ linux-2.5.73-05-createintent/fs/umsdos/emd.c 2003-06-30 08:49:04.000000000 +0200
@@ -105,7 +105,7 @@
Printk(("umsdos_make_emd: creating EMD %s/%s\n",
parent->d_name.name, demd->d_name.name));

- err = msdos_create(parent->d_inode, demd, S_IFREG | 0777);
+ err = msdos_create(parent->d_inode, demd, S_IFREG | 0777, NULL);
if (err) {
printk (KERN_WARNING
"umsdos_make_emd: create %s/%s failed, err=%d\n",
diff -u --recursive --new-file linux-2.5.73-04-lookupintent/fs/umsdos/namei.c linux-2.5.73-05-createintent/fs/umsdos/namei.c
--- linux-2.5.73-04-lookupintent/fs/umsdos/namei.c 2002-11-20 12:19:02.000000000 +0100
+++ linux-2.5.73-05-createintent/fs/umsdos/namei.c 2003-06-30 08:49:04.000000000 +0200
@@ -274,7 +274,7 @@
if (fake->d_inode)
goto out_remove_dput;

- ret = msdos_create (dir, fake, S_IFREG | 0777);
+ ret = msdos_create (dir, fake, S_IFREG | 0777, NULL);
if (ret)
goto out_remove_dput;

@@ -311,7 +311,7 @@
*
* Return the status of the operation. 0 mean success.
*/
-int UMSDOS_create (struct inode *dir, struct dentry *dentry, int mode)
+int UMSDOS_create (struct inode *dir, struct dentry *dentry, int mode, struct nameidata *nd)
{
return umsdos_create_any (dir, dentry, mode, 0, 0);
}
diff -u --recursive --new-file linux-2.5.73-04-lookupintent/fs/vfat/namei.c linux-2.5.73-05-createintent/fs/vfat/namei.c
--- linux-2.5.73-04-lookupintent/fs/vfat/namei.c 2003-06-30 08:48:43.000000000 +0200
+++ linux-2.5.73-05-createintent/fs/vfat/namei.c 2003-06-30 08:49:04.000000000 +0200
@@ -912,7 +912,8 @@
return dentry;
}

-int vfat_create(struct inode *dir,struct dentry* dentry,int mode)
+int vfat_create(struct inode *dir,struct dentry* dentry,int mode,
+ struct nameidata *nd)
{
struct super_block *sb = dir->i_sb;
struct inode *inode = NULL;
diff -u --recursive --new-file linux-2.5.73-04-lookupintent/fs/xfs/linux/xfs_iops.c linux-2.5.73-05-createintent/fs/xfs/linux/xfs_iops.c
--- linux-2.5.73-04-lookupintent/fs/xfs/linux/xfs_iops.c 2003-06-30 08:48:43.000000000 +0200
+++ linux-2.5.73-05-createintent/fs/xfs/linux/xfs_iops.c 2003-06-30 08:49:04.000000000 +0200
@@ -175,7 +175,8 @@
linvfs_create(
struct inode *dir,
struct dentry *dentry,
- int mode)
+ int mode,
+ struct nameidata *nd)
{
return linvfs_mknod(dir, dentry, mode, 0);
}
diff -u --recursive --new-file linux-2.5.73-04-lookupintent/include/linux/affs_fs.h linux-2.5.73-05-createintent/include/linux/affs_fs.h
--- linux-2.5.73-04-lookupintent/include/linux/affs_fs.h 2003-06-30 08:48:43.000000000 +0200
+++ linux-2.5.73-05-createintent/include/linux/affs_fs.h 2003-06-30 08:49:04.000000000 +0200
@@ -43,7 +43,7 @@
extern int affs_hash_name(struct super_block *sb, const u8 *name, unsigned int len);
extern struct dentry *affs_lookup(struct inode *dir, struct dentry *dentry, struct nameidata *);
extern int affs_unlink(struct inode *dir, struct dentry *dentry);
-extern int affs_create(struct inode *dir, struct dentry *dentry, int mode);
+extern int affs_create(struct inode *dir, struct dentry *dentry, int mode, struct nameidata *);
extern int affs_mkdir(struct inode *dir, struct dentry *dentry, int mode);
extern int affs_rmdir(struct inode *dir, struct dentry *dentry);
extern int affs_link(struct dentry *olddentry, struct inode *dir,
diff -u --recursive --new-file linux-2.5.73-04-lookupintent/include/linux/fs.h linux-2.5.73-05-createintent/include/linux/fs.h
--- linux-2.5.73-04-lookupintent/include/linux/fs.h 2003-06-30 08:48:43.000000000 +0200
+++ linux-2.5.73-05-createintent/include/linux/fs.h 2003-06-30 08:49:04.000000000 +0200
@@ -639,7 +639,7 @@
/*
* VFS helper functions..
*/
-extern int vfs_create(struct inode *, struct dentry *, int);
+extern int vfs_create(struct inode *, struct dentry *, int, struct nameidata *);
extern int vfs_mkdir(struct inode *, struct dentry *, int);
extern int vfs_mknod(struct inode *, struct dentry *, int, dev_t);
extern int vfs_symlink(struct inode *, struct dentry *, const char *);
@@ -730,7 +730,7 @@
};

struct inode_operations {
- int (*create) (struct inode *,struct dentry *,int);
+ int (*create) (struct inode *,struct dentry *,int, struct nameidata *);
struct dentry * (*lookup) (struct inode *,struct dentry *, struct nameidata *);
int (*link) (struct dentry *,struct inode *,struct dentry *);
int (*unlink) (struct inode *,struct dentry *);
diff -u --recursive --new-file linux-2.5.73-04-lookupintent/include/linux/hfs_fs.h linux-2.5.73-05-createintent/include/linux/hfs_fs.h
--- linux-2.5.73-04-lookupintent/include/linux/hfs_fs.h 2002-10-07 19:27:58.000000000 +0200
+++ linux-2.5.73-05-createintent/include/linux/hfs_fs.h 2003-06-30 08:49:04.000000000 +0200
@@ -234,7 +234,7 @@
const struct hfs_cat_key *);

/* dir.c */
-extern int hfs_create(struct inode *, struct dentry *, int);
+extern int hfs_create(struct inode *, struct dentry *, int, struct nameidata *);
extern int hfs_mkdir(struct inode *, struct dentry *, int);
extern int hfs_unlink(struct inode *, struct dentry *);
extern int hfs_rmdir(struct inode *, struct dentry *);
diff -u --recursive --new-file linux-2.5.73-04-lookupintent/include/linux/msdos_fs.h linux-2.5.73-05-createintent/include/linux/msdos_fs.h
--- linux-2.5.73-04-lookupintent/include/linux/msdos_fs.h 2003-06-30 08:48:43.000000000 +0200
+++ linux-2.5.73-05-createintent/include/linux/msdos_fs.h 2003-06-30 08:49:04.000000000 +0200
@@ -308,7 +308,7 @@

/* msdos/namei.c - these are for Umsdos */
extern struct dentry *msdos_lookup(struct inode *dir, struct dentry *, struct nameidata *);
-extern int msdos_create(struct inode *dir, struct dentry *dentry, int mode);
+extern int msdos_create(struct inode *dir, struct dentry *dentry, int mode, struct nameidata *);
extern int msdos_rmdir(struct inode *dir, struct dentry *dentry);
extern int msdos_mkdir(struct inode *dir, struct dentry *dentry, int mode);
extern int msdos_unlink(struct inode *dir, struct dentry *dentry);
@@ -318,7 +318,7 @@

/* vfat/namei.c - these are for dmsdos */
extern struct dentry *vfat_lookup(struct inode *dir, struct dentry *, struct nameidata *);
-extern int vfat_create(struct inode *dir, struct dentry *dentry, int mode);
+extern int vfat_create(struct inode *dir, struct dentry *dentry, int mode, struct nameidata *);
extern int vfat_rmdir(struct inode *dir, struct dentry *dentry);
extern int vfat_unlink(struct inode *dir, struct dentry *dentry);
extern int vfat_mkdir(struct inode *dir, struct dentry *dentry, int mode);
diff -u --recursive --new-file linux-2.5.73-04-lookupintent/include/linux/qnx4_fs.h linux-2.5.73-05-createintent/include/linux/qnx4_fs.h
--- linux-2.5.73-04-lookupintent/include/linux/qnx4_fs.h 2003-06-30 08:48:43.000000000 +0200
+++ linux-2.5.73-05-createintent/include/linux/qnx4_fs.h 2003-06-30 08:49:04.000000000 +0200
@@ -117,14 +117,13 @@
extern struct buffer_head *qnx4_getblk(struct inode *, int, int);
extern struct buffer_head *qnx4_bread(struct inode *, int, int);

-extern int qnx4_create(struct inode *dir, struct dentry *dentry, int mode);
extern struct inode_operations qnx4_file_inode_operations;
extern struct inode_operations qnx4_dir_inode_operations;
extern struct file_operations qnx4_file_operations;
extern struct file_operations qnx4_dir_operations;
extern int qnx4_is_free(struct super_block *sb, long block);
extern int qnx4_set_bitmap(struct super_block *sb, long block, int busy);
-extern int qnx4_create(struct inode *inode, struct dentry *dentry, int mode);
+extern int qnx4_create(struct inode *inode, struct dentry *dentry, int mode, struct nameidata *nd);
extern void qnx4_truncate(struct inode *inode);
extern void qnx4_free_inode(struct inode *inode);
extern int qnx4_unlink(struct inode *dir, struct dentry *dentry);
diff -u --recursive --new-file linux-2.5.73-04-lookupintent/mm/shmem.c linux-2.5.73-05-createintent/mm/shmem.c
--- linux-2.5.73-04-lookupintent/mm/shmem.c 2003-06-20 22:16:19.000000000 +0200
+++ linux-2.5.73-05-createintent/mm/shmem.c 2003-06-30 08:49:04.000000000 +0200
@@ -1397,7 +1397,8 @@
return 0;
}

-static int shmem_create(struct inode *dir, struct dentry *dentry, int mode)
+static int shmem_create(struct inode *dir, struct dentry *dentry, int mode,
+ struct nameidata *nd)
{
return shmem_mknod(dir, dentry, mode | S_IFREG, 0);
}


2003-06-30 14:32:12

by Trond Myklebust

[permalink] [raw]
Subject: RE: [PATCH 1/4] Optimize NFS open() calls by means of 'intents'...

Whoops. Title should have [PATCH 2/4]

Cheers,
Trond

2003-06-30 18:03:16

by Wes Janzen

[permalink] [raw]
Subject: FS Corruption with VIA MVP3 + UDMA/DMA

I was wondering if anyone knows about this issue or has had this problem?

I've been fighting FS corruption since switching to a UDMA hard drive
(Maxtor) on my FIC PA2013 with the VIA MVP3, but I didn't really know
that since the change was a result of a dying drive. Finally, through
the chance of having installed an older Quantum drive that only allowed
DMA MultiMode 2 as the fastest mode, I found the problem.

At least on my board, the IDE UDMA/DMA implementation appears flawed
[lspci gives: "VT82C586/B/686A/B PI (rev 6)"]. I've had the same
problem with three UDMA DVD drives -- two Toshibas and a Pioneer. They
would all lock-up installing software or corrupt the data being
installed causing the installation to fail. I've also had four other
Maxtor hard drives (3 factory certified, one retail) randomly corrupt
content on the drives (fs type doesn't matter [NTFS, FAT, FAT32, EXT2,
REISERFS have been tried]). That means that every UDMA drive I've
plugged in has had data corruption issues (trying no less than 10 IDE
cables, which I confirmed good on the Promise and I've tried both IDE
channels on the MVP3). I started with Linux kernel version 2.2 and the
problem remains up to 2.5.73. I've also confirmed the issue in Windows
98SE, Windows XP and Windows 2003 RC2. At this point, one might as well
stick in a PCI adapter, since with "hdparm -t" I get between 5.5-8.5
MB/s. With the same mode on my Promise 20269 I get 12 MB/s , so clearly
something is odd. I know the hard drive can do better since I can get
20MB/s in UDMA 2 on the MVP3, but of course that's not safe.

Even at DMA multiword 2, I can force r/w errors by heavy io. Moving to
DMA mode 1 clears up the errors, but performance degrades to a
consistent 5.49 MB/s (all the higher modes actually vary 2-6 MB/s
between runs of hdparm) while the Promise in the same mode still gets 12
MB/s consistently. I've found that copying a 300 MB file to my drive on
the Promise, making 12 new files while making 12 duplicates to the drive
on the MVP3 can still force errors in dma multiword 2. I check for
write errors by comparing the copied files to the source file. It's
much easier to create errors in any of the UDMA modes. Errors actually
seem more likely to occur during actual use of the system since they are
fairly common even in multiword 2, but the copying method makes it
extremely repeatable (though not all the files are corrupted, that
part's random).

My current configuration has the Promise as the boot device with a
single drive on the primary. I have my DVD (UDMA) on the secondary of
the Promise. My other Maxtor hard drive is on the primary channel
(alone) of the MVP3 with UDMA disabled in the bios (and thus not used by
WinXP/2003 or Linux). Finally my cd writer and IDE Zip are on the
secondary channel of the MVP3. I'd put my hard drive on the secondary
channel of the Promise, but for some reason the computer won't boot with
both hard drives on the Promise (even though they're on different
cables)... I don't remember right now if it just locks up during OS
loading or if it won't post. I can test it if that information is required.

Otherwise my machine is fairly stable (3+weeks, but I usually have to
boot to Windows for Illustrator and such before then) and I don't get
any corruption when copying files around on my Promise controller. I
can get errors even copying from my MVP3 drive to itself (making
defragging dangerous on my shared FAT32 partition) even in DMA multiword 2.

Is there anything that can be done with the IDE drivers for this chipset
to make it "safe" without resorting to forcing DMA mode 1?

Thanks,
Wes Janzen

2003-07-12 20:27:23

by Wes Janzen

[permalink] [raw]
Subject: Re: FS Corruption with VIA MVP3 + UDMA/DMA

Thanks for the suggestions, here's what I've tried to solve the problem:
-->Tested system memory for 4 consecutive days with memtest86
-->Replaced SDRAM with new modules tested in every DIMM slot
-->Tried the ac patch on 2.5.69
-->Clocked K6-2 back to 350 from 400 (FSB still 100Mhz)
-->Played with PCI settings in the BIOS
-->Removed all other cards except AGP video card
-->Disabled all other integrated peripherals in the BIOS (only serial
and parallel in this case).
-->Reverted to BIOS defaults.

None of this has solved the problem so I've disabled the onboard IDE and
replaced it with another promise card. I have not changed anything but
adding another card and moving the drives over using the same cables.
Yet my corruption problems are gone. My other PCI cards work fine, so I
don't think it's a PCI busmaster problem (that would affect my promise,
3com, and NEC PCI cards too, correct?). I can't see any other cause
except for a defective IDE controller implementation (either by VIA or
board design).

I've received one response from a person with an FIC VA503+ that worked
and another (same chipset, unknown model) who has the same problem. I
imagine there are quite a few people that have fallen victim to this
problem but they just didn't know the cause of the instability.

I don't know what the solution is (if there is one), but something
should be done to at least warn people of the chance of problems...IMO.

At least someone trying Linux for the first time won't get too bad an
impression since reiserfs at least seems to endure the damage much
better (and longer) than NTFS or FAT32. Still, sucks to have to rebuild
the tree and restore corrupted files every couple weeks.

-Wes-

Wes Janzen wrote:

> I was wondering if anyone knows about this issue or has had this problem?
>
> I've been fighting FS corruption since switching to a UDMA hard drive
> (Maxtor) on my FIC PA2013 with the VIA MVP3, but I didn't really know
> that since the change was a result of a dying drive. Finally, through
> the chance of having installed an older Quantum drive that only
> allowed DMA MultiMode 2 as the fastest mode, I found the problem.
> At least on my board, the IDE UDMA/DMA implementation appears flawed
> [lspci gives: "VT82C586/B/686A/B PI (rev 6)"]. I've had the same
> problem with three UDMA DVD drives -- two Toshibas and a Pioneer.
> They would all lock-up installing software or corrupt the data being
> installed causing the installation to fail. I've also had four other
> Maxtor hard drives (3 factory certified, one retail) randomly corrupt
> content on the drives (fs type doesn't matter [NTFS, FAT, FAT32, EXT2,
> REISERFS have been tried]). That means that every UDMA drive I've
> plugged in has had data corruption issues (trying no less than 10 IDE
> cables, which I confirmed good on the Promise and I've tried both IDE
> channels on the MVP3). I started with Linux kernel version 2.2 and
> the problem remains up to 2.5.73. I've also confirmed the issue in
> Windows 98SE, Windows XP and Windows 2003 RC2. At this point, one
> might as well stick in a PCI adapter, since with "hdparm -t" I get
> between 5.5-8.5 MB/s. With the same mode on my Promise 20269 I get 12
> MB/s , so clearly something is odd. I know the hard drive can do
> better since I can get 20MB/s in UDMA 2 on the MVP3, but of course
> that's not safe.
>
> Even at DMA multiword 2, I can force r/w errors by heavy io. Moving
> to DMA mode 1 clears up the errors, but performance degrades to a
> consistent 5.49 MB/s (all the higher modes actually vary 2-6 MB/s
> between runs of hdparm) while the Promise in the same mode still gets
> 12 MB/s consistently. I've found that copying a 300 MB file to my
> drive on the Promise, making 12 new files while making 12 duplicates
> to the drive on the MVP3 can still force errors in dma multiword 2. I
> check for write errors by comparing the copied files to the source
> file. It's much easier to create errors in any of the UDMA modes.
> Errors actually seem more likely to occur during actual use of the
> system since they are fairly common even in multiword 2, but the
> copying method makes it extremely repeatable (though not all the files
> are corrupted, that part's random).
>
> My current configuration has the Promise as the boot device with a
> single drive on the primary. I have my DVD (UDMA) on the secondary of
> the Promise. My other Maxtor hard drive is on the primary channel
> (alone) of the MVP3 with UDMA disabled in the bios (and thus not used
> by WinXP/2003 or Linux). Finally my cd writer and IDE Zip are on the
> secondary channel of the MVP3. I'd put my hard drive on the secondary
> channel of the Promise, but for some reason the computer won't boot
> with both hard drives on the Promise (even though they're on different
> cables)... I don't remember right now if it just locks up during OS
> loading or if it won't post. I can test it if that information is
> required.
>
> Otherwise my machine is fairly stable (3+weeks, but I usually have to
> boot to Windows for Illustrator and such before then) and I don't get
> any corruption when copying files around on my Promise controller. I
> can get errors even copying from my MVP3 drive to itself (making
> defragging dangerous on my shared FAT32 partition) even in DMA
> multiword 2.
>
> Is there anything that can be done with the IDE drivers for this
> chipset to make it "safe" without resorting to forcing DMA mode 1?
>
> Thanks,
> Wes Janzen
>
> -
> To unsubscribe from this list: send the line "unsubscribe
> linux-kernel" in
> the body of a message to [email protected]
> More majordomo info at http://vger.kernel.org/majordomo-info.html
> Please read the FAQ at http://www.tux.org/lkml/
>

2003-07-14 08:51:47

by Vladimir B. Savkin

[permalink] [raw]
Subject: Re: FS Corruption with VIA MVP3 + UDMA/DMA

Hi!

On Sat, Jul 12, 2003 at 03:42:07PM -0500, Wes Janzen wrote:
> Thanks for the suggestions, here's what I've tried to solve the problem:
> -->Tested system memory for 4 consecutive days with memtest86
> -->Replaced SDRAM with new modules tested in every DIMM slot
> -->Tried the ac patch on 2.5.69
> -->Clocked K6-2 back to 350 from 400 (FSB still 100Mhz)
> -->Played with PCI settings in the BIOS
> -->Removed all other cards except AGP video card
> -->Disabled all other integrated peripherals in the BIOS (only serial
> and parallel in this case).
> -->Reverted to BIOS defaults.
>

I was using PA2013, and was having problems with IDE too.
The data corruption was solved after turning off "Spread spectrum
modulated" feature in the BIOS setup (AFAIR this misfeature is ON
by default). But I wasn't able to get on-board IDE working right
nevertheless. For some strange reason it was OK with kernel 2.2.15
but produced DMA timeouts with every later kernel version I tested.
Yes, I did try copying VIA IDE driver from 2.2.15 to later kernel,
it still didn't help. So I ended up with Promise controller too :(

:wq
With best regards,
Vladimir Savkin.

2003-08-09 12:19:24

by Wes Janzen

[permalink] [raw]
Subject: Re: FS Corruption with VIA MVP3 + UDMA/DMA

I seemed to get a skeptical reaction when I originally posted this to
the list, however, just google for "mvp3 corrupt dma mode" to confirm.
I don't know that it takes to hit this error, but it's very easy to
reproduce on my machine. Some links only mention UDMA, but all DMA
modes are affected on my board. I couldn't even burn a CD over 12X
without running into this issue. There I thought it was bad media, but
after burning 11 CD's at 32X with the PDC20269 (rather than the native
IDE) and not encountering any errors using the same batch of media and
writer, the culprit is clear.

I don't know why I didn't google for this in the first place, but it
looks like it is a known issue. Just apparently not well-known.

Probably not especially important though, I wonder just how many people
are still running this setup... With Linux, I'd say even fewer.





2003-08-09 14:41:03

by Alan

[permalink] [raw]
Subject: Re: FS Corruption with VIA MVP3 + UDMA/DMA

On Sad, 2003-08-09 at 13:19, Wes Janzen wrote:
> I don't know why I didn't google for this in the first place, but it
> looks like it is a known issue. Just apparently not well-known.
>
> Probably not especially important though, I wonder just how many people
> are still running this setup... With Linux, I'd say even fewer.

I'm running MVP4 without problems. I've got an old MVP3 board I need to
dig out and play with. Certainly MVP3 has problems with some AGP and
some other high load PCI situations.

2003-08-09 15:50:03

by Helge Hafting

[permalink] [raw]
Subject: Re: FS Corruption with VIA MVP3 + UDMA/DMA

On Sat, Aug 09, 2003 at 03:37:07PM +0100, Alan Cox wrote:
> On Sad, 2003-08-09 at 13:19, Wes Janzen wrote:
> > I don't know why I didn't google for this in the first place, but it
> > looks like it is a known issue. Just apparently not well-known.
> >
> > Probably not especially important though, I wonder just how many people
> > are still running this setup... With Linux, I'd say even fewer.
>
> I'm running MVP4 without problems. I've got an old MVP3 board I need to
> dig out and play with. Certainly MVP3 has problems with some AGP and
> some other high load PCI situations.

I have a pc with a VIA MVP3, that I use as an x-terminal.
Using dma is not an option, I got the impression that ide
developers consider the chip so broken they don't want to
try make that work. That is ok with me, I wouldn't consider
running anything needing good io performance on that old thing.

What is worse is that 2.6 ide don't work with it at all.
Booting attempts die early of io errors, sometimes it don't
even find the root fs superblock, other times dies a little later.
So it is sort of left behind, running 2.5.69-mm3 which at least works
in pio mode. The harddisk is a old 240MB thing with debian
shoehorned onto it.

There is no AGP card in the machine, so AGP is clearly not necessary
to get io trouble.

Here's the lspci output, if anyone is interested:
00:00.0 Host bridge: VIA Technologies, Inc. VT82C598 [Apollo MVP3] (rev 04)
00:01.0 PCI bridge: VIA Technologies, Inc. VT82C598/694x [Apollo MVP3/Pro133x
AGP]
00:07.0 ISA bridge: VIA Technologies, Inc. VT82C586/A/B PCI-to-ISA [Apollo VP]
(rev 41)
00:07.1 IDE interface: VIA Technologies, Inc. VT82C586/B/686A/B PIPC Bus
Master IDE (rev 06)
00:07.3 Bridge: VIA Technologies, Inc. VT82C586B ACPI (rev 10)
00:0a.0 Ethernet controller: 3Com Corporation 3c905B 100BaseTX [Cyclone] (rev
64)
00:0b.0 VGA compatible controller: S3 Inc. ViRGE/DX or /GX (rev 01)

Helge Hafting

2003-08-09 16:27:28

by Jamie Lokier

[permalink] [raw]
Subject: Re: FS Corruption with VIA MVP3 + UDMA/DMA

Wes Janzen wrote:
> I seemed to get a skeptical reaction when I originally posted this to
> the list, however, just google for "mvp3 corrupt dma mode" to confirm.

The VP2/97 also had severe problems with DMA. I could never run
standard kernels on mind in the 2.0 days, and distro installs would
always lock up during installation, although Mandrake 8 seemed
reliable so something improved.

-- Jamie

2003-08-09 16:43:39

by insecure

[permalink] [raw]
Subject: Re: FS Corruption with VIA MVP3 + UDMA/DMA

On Saturday 09 August 2003 19:27, Jamie Lokier wrote:
> Wes Janzen wrote:
> > I seemed to get a skeptical reaction when I originally posted this to
> > the list, however, just google for "mvp3 corrupt dma mode" to confirm.
>
> The VP2/97 also had severe problems with DMA. I could never run
> standard kernels on mind in the 2.0 days, and distro installs would
> always lock up during installation, although Mandrake 8 seemed
> reliable so something improved.

I had a VIA VPX sometime ago. AFAIR it worked fine...

I suspect PCI conf tweaks etc could work around
this trouble. I'm afraid there won't be much interest
in fixing these oldies. For example, I got rid of that
board (exchanged for Socket A one) -> no way to test fixes :(
--
vda

2003-08-09 17:02:38

by John Wendel

[permalink] [raw]
Subject: Re: FS Corruption with VIA MVP3 + UDMA/DMA

On Sat, 9 Aug 2003 17:57:08 +0200
Helge Hafting <[email protected]> wrote:

> I have a pc with a VIA MVP3, that I use as an x-terminal.
> Using dma is not an option, I got the impression that ide
> developers consider the chip so broken they don't want to
> try make that work. That is ok with me, I wouldn't consider
> running anything needing good io performance on that old thing.
>
> What is worse is that 2.6 ide don't work with it at all.
> Booting attempts die early of io errors, sometimes it don't
> even find the root fs superblock, other times dies a little later.
> So it is sort of left behind, running 2.5.69-mm3 which at least works
> in pio mode. The harddisk is a old 240MB thing with debian
> shoehorned onto it.
>
> There is no AGP card in the machine, so AGP is clearly not necessary
> to get io trouble.
>
> Here's the lspci output, if anyone is interested:
> 00:00.0 Host bridge: VIA Technologies, Inc. VT82C598 [Apollo MVP3]
> (rev 04) 00:01.0 PCI bridge: VIA Technologies, Inc. VT82C598/694x
> [Apollo MVP3/Pro133x AGP]
> 00:07.0 ISA bridge: VIA Technologies, Inc. VT82C586/A/B PCI-to-ISA
> [Apollo VP] (rev 41)
> 00:07.1 IDE interface: VIA Technologies, Inc. VT82C586/B/686A/B PIPC
> Bus Master IDE (rev 06)
> 00:07.3 Bridge: VIA Technologies, Inc. VT82C586B ACPI (rev 10)
> 00:0a.0 Ethernet controller: 3Com Corporation 3c905B 100BaseTX
> [Cyclone] (rev 64)
> 00:0b.0 VGA compatible controller: S3 Inc. ViRGE/DX or /GX (rev 01)
>
> Helge Hafting

Just another data point, for what it's worth.

I've got one of these puppies that works perfectly except I cannot
enable DMA on the CD-RW drive. I normally run a vanilla 2.4.19 kernel,
but it also works fine with the RedHat 8.0 kernel (whatever that is?). I
only have one hard disk at the moment (80GB WD) but before the old one
died, I routinely copied 800 MB files (video) between disks with no
errors. The CD burner works fine at 16X. I'm running an AMD K6-III 350
with a 25 Mhz overclock, rock solid. The MB is a FIC VIA 503+.

A normal load on the machine is a continuous 200KB/sec download on the
cable modem using PAN, XMMS, Firebird, and Sylpheed. XMMS skips are very
rare! Mplayer works great with a few dropped frames on really high res
DIVX video.

So I don't think you can point the finger at the MVP3 chipset.

00:00.0 Host bridge: VIA Technologies, Inc. VT82C598 [Apollo MVP3] (rev
04)
00:01.0 PCI bridge: VIA Technologies, Inc. VT82C598/694x [Apollo
MVP3/Pro133x AGP]
00:07.0 ISA bridge: VIA Technologies, Inc. VT82C586/A/B PCI-to-ISA
[Apollo VP] (rev 41)
00:07.1 IDE interface: VIA Technologies, Inc. VT82C586B PIPC Bus Master
IDE (rev 06)
00:07.3 PCI bridge: VIA Technologies, Inc. VT82C586B ACPI (rev 10)
00:09.0 Multimedia audio controller: Yamaha Corporation YMF-724F [DS-1
Audio Controller] (rev 03)
00:0a.0 Ethernet controller: Linksys Network Everywhere Fast Ethernet
10/100 model NC100 (rev 11)
01:00.0 VGA compatible controller: 3Dfx Interactive, Inc. Voodoo Banshee
(rev 03)

/dev/hda:
multcount = 16 (on)
IO_support = 1 (32-bit)
unmaskirq = 1 (on)
using_dma = 1 (on)
keepsettings = 0 (off)
readonly = 0 (off)
readahead = 8 (on)
geometry = 9729/255/63, sectors = 156301488, start = 0

I'll be happy to supply any info that can help anyone. I know this
problem has been bugging people for a long time.

--

John

2003-08-09 17:39:04

by Jamie Lokier

[permalink] [raw]
Subject: Re: FS Corruption with VIA MVP3 + UDMA/DMA

insecure wrote:
> > The VP2/97 also had severe problems with DMA. I could never run
> > standard kernels on mind in the 2.0 days, and distro installs would
> > always lock up during installation, although Mandrake 8 seemed
> > reliable so something improved.
>
> I had a VIA VPX sometime ago. AFAIR it worked fine...
>
> I suspect PCI conf tweaks etc could work around
> this trouble. I'm afraid there won't be much interest
> in fixing these oldies. For example, I got rid of that
> board (exchanged for Socket A one) -> no way to test fixes :(

I found a hdparm command which fixed it, though it wasn't much use
during distro installs. It was very pleasant to see Mandrake 8 just
work. Fwiw, Windows 95, 98 and NT4 have no problems on the box. It's
now my "Internet Explorer 4" test rig :)

-- Jamie

2003-08-09 23:17:59

by Wes Janzen

[permalink] [raw]
Subject: Re: FS Corruption with VIA MVP3 + UDMA/DMA

Nothing runs on this one ;-)

WinXP/2003 will die from registry and unrecoverable NTFS filesystem
corruption. Win98 will randomly corrupt driver files eventually leading
to an unbootable system, or worse, a completely corrupted filesystem as
scandisk happily crosslinks all the files (experienced this several
times, just thought it was the hard drives and windows...since the
drives would fail a few months later and since I had past experience
with a Pentium 166 and HX system running Win95 doing this).

Linux fared better, but still would corrupt the filesystem, sometimes
leading to an unusable system say if an important library is moved to
lost+found during fsck. It was much more reliable than any Windows
install and easily repairable. With windows, I had no choice but to
re-install (backing up the registry after every boot worked until NTFS
would eventually die). I lost a few data and help files under linux,
but at this point I backed up all the time anyway (after my first
installation was hopelessly mangled).

I've tried several PCI tweaks with 2.4 which didn't really seem to cure
anything. My powertweak doesn't seem to like the 2.5 series kernels, so
I haven't tried that. Not that it seems to matter, the promise
controllers have much better throughput anyway even with the same modes
and settings in hdparm. I tried all the hdparm combinations of dma
modes and other settings with only a slight decrease in the chance of
corruption and a corresponding dive in throughput. It worked through
2.5.74, but I finally disabled it for everything except my IDE ZIP drive
and stuck in another promise card after concluding that it was just
hopelessly broken.

It would have been nice if 2.4 would just refuse to use DMA, that way
I'd have known about the problem much earlier. I would think with all
the stuff in the kernel about the RZ1000, the problems with the MVP3
would be mentioned as well. As just a typical end user I couldn't
figure out why Linux and reiserfs, which are supposed to be so stable
wouldn't weren't. At this point I'd already run exhaustive memory ,
hard drive bad sector, and CPU tests without any failures so I was
pretty certain it wasn't a hardware issue. Everyone I knew had crashes
with Windows so those didn't surprise me so much.

It's a decent computer for web browsing and let's me gauge the
performance of my business apps. It's a pretty good low-end target
machine now that it doesn't write garbage to my drives.

I just think this should be documented in case someone sets up a
proxy/firewall machine with this configuration. For the majority of
home users, any higher-end machine is probably wasted on such an
application. I setup such a system to share my parents dial-up
connection over a wireless network. Of course, it's using an HX chipset
and P233MMX so it's rock solid, only needing rebooted when the modem
locks up (happened twice since I set it up a year ago). Even though
it's running 2.4.18 and my dad likes to reset it rather than
CTRL-ALT-DEL when the modem locks up, it has yet to corrupt reiserfs.

That's the kind of stability that got me really wondering about my system...

Jamie Lokier wrote:

>insecure wrote:
>
>
>>>The VP2/97 also had severe problems with DMA. I could never run
>>>standard kernels on mind in the 2.0 days, and distro installs would
>>>always lock up during installation, although Mandrake 8 seemed
>>>reliable so something improved.
>>>
>>>
>>I had a VIA VPX sometime ago. AFAIR it worked fine...
>>
>>I suspect PCI conf tweaks etc could work around
>>this trouble. I'm afraid there won't be much interest
>>in fixing these oldies. For example, I got rid of that
>>board (exchanged for Socket A one) -> no way to test fixes :(
>>
>>
>
>I found a hdparm command which fixed it, though it wasn't much use
>during distro installs. It was very pleasant to see Mandrake 8 just
>work. Fwiw, Windows 95, 98 and NT4 have no problems on the box. It's
>now my "Internet Explorer 4" test rig :)
>
>-- Jamie
>
>
>