lkml.org 
[lkml]   [2000]   [Mar]   [10]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
SubjectRe: [2.3.51pre2] wrong shm_statfs in ipc/shm.c
   Date:   Fri, 10 Mar 2000 08:19:26 -0500
From: Rui Sousa <rsousa@grad.physics.sunysb.edu>

It gives a compiler warning about wrong pointer assignment

Try the patch at the end of this email

and
when running a number of applications fail with the following message
in /var/log/messages:

Mar 10 08:16:48 localhost kernel: shmget: shm filesystem not mounted

"mkdir /var/shm" and add a line like the following to /etc/fstab if
you want to run 2.3.x and have working sysv SHM:

none /var/shm shm defaults 0 0

Here is the patch for the statfs problem.

diff -u --recursive --new-file --exclude=CVS --exclude=.cvsignore vanilla/linux/ipc/shm.c linux/ipc/shm.c
--- vanilla/linux/ipc/shm.c Fri Mar 10 01:02:53 2000
+++ linux/ipc/shm.c Thu Mar 9 23:22:54 2000
@@ -48,7 +48,7 @@
static int shm_remount_fs (struct super_block *, int *, char *);
static void shm_read_inode (struct inode *);
static void shm_write_inode(struct inode *);
-static int shm_statfs (struct super_block *, struct statfs *, int);
+static int shm_statfs (struct super_block *, struct statfs *);
static int shm_create (struct inode *,struct dentry *,int);
static struct dentry *shm_lookup (struct inode *,struct dentry *);
static int shm_unlink (struct inode *,struct dentry *);
@@ -347,18 +347,16 @@
up(&shm_ids.sem);
}

-static int shm_statfs(struct super_block *sb, struct statfs *buf, int bufsiz)
+static int shm_statfs(struct super_block *sb, struct statfs *buf)
{
- struct statfs tmp;
-
- tmp.f_type = 0;
- tmp.f_bsize = PAGE_SIZE;
- tmp.f_blocks = shm_ctlall;
- tmp.f_bavail = tmp.f_bfree = shm_ctlall - shm_tot;
- tmp.f_files = shm_ctlmni;
- tmp.f_ffree = shm_ctlmni - used_segs;
- tmp.f_namelen = SHM_NAME_LEN;
- return copy_to_user(buf, &tmp, bufsiz) ? -EFAULT : 0;
+ buf->f_type = 0;
+ buf->f_bsize = PAGE_SIZE;
+ buf->f_blocks = shm_ctlall;
+ buf->f_bavail = buf->f_bfree = shm_ctlall - shm_tot;
+ buf->f_files = shm_ctlmni;
+ buf->f_ffree = shm_ctlmni - used_segs;
+ buf->f_namelen = SHM_NAME_LEN;
+ return 0;
}

static void shm_write_inode(struct inode * inode)
-
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/

\
 
 \ /
  Last update: 2005-03-22 13:56    [W:0.045 / U:0.176 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site