[SSI] openssi/kernel/cluster/ssi/util gfs_mount.c, 1.7, 1.8 load_level.c, 1.22, 1.23 nfs_mount.c, 1.11, 1.12 rmtfb.c, 1.22, 1.23 rmtsock.c, 1.21, 1.22 ssidev.c, 1.25, 1.26 ssidev_ics.c, 1.13, 1.14 ssipty.c, 1.13, 1.14
Roger Tsang <[email protected]>
| Newsgroups | gmane.linux.cluster.ssic.cvs |
|---|---|
| Message-ID | <[email protected]> |
Update of /cvsroot/ssic-linux/openssi/kernel/cluster/ssi/util
In directory fdv4jf1.ch3.sourceforge.com:/tmp/cvs-serv29491/cluster/ssi/util
Modified Files:
Tag: OPENSSI-FC
gfs_mount.c load_level.c nfs_mount.c rmtfb.c rmtsock.c
ssidev.c ssidev_ics.c ssipty.c
Log Message:
Bug fixes and enhancements (see ChangeLog)
Index: rmtsock.c
===================================================================
RCS file: /cvsroot/ssic-linux/openssi/kernel/cluster/ssi/util/rmtsock.c,v
retrieving revision 1.21
retrieving revision 1.22
diff -u -d -r1.21 -r1.22
--- rmtsock.c 3 Feb 2009 06:18:13 -0000 1.21
+++ rmtsock.c 24 Mar 2009 04:26:28 -0000 1.22
@@ -123,6 +123,9 @@
struct dentry *ssi_lookup(struct inode *root, struct dentry *dentry,
struct nameidata *nd)
{
+#ifdef SSI_LOOKUP_DENTRY_HASH
+ struct inode *inode = iget(root->i_sb, dentry->d_name.hash);
+#else
char *name = (char *) dentry->d_name.name;
unsigned int len = dentry->d_name.len;
unsigned long ino;
@@ -135,6 +138,7 @@
return ERR_PTR(-EINVAL); /* SSI_XXX: CLIBUG */
inode = iget(root->i_sb, ino);
+#endif /* !SSI_LOOKUP_DENTRY_HASH */
if (!inode)
return ERR_PTR(-EACCES);
remove_inode_hash(inode);
Index: load_level.c
===================================================================
RCS file: /cvsroot/ssic-linux/openssi/kernel/cluster/ssi/util/load_level.c,v
retrieving revision 1.22
retrieving revision 1.23
diff -u -d -r1.22 -r1.23
--- load_level.c 3 Feb 2009 06:18:13 -0000 1.22
+++ load_level.c 24 Mar 2009 04:26:28 -0000 1.23
@@ -458,6 +458,11 @@
}
}
+/*
+ * Cannot sleep in following path...
+ * tasklist_lock (choose)
+ * (is_loadlevelable)
+ */
int
is_loadlevelable(struct task_struct *p, char *fname)
{
@@ -476,17 +481,32 @@
return 0;
pvp = PVP(p->p_vproc);
-#ifndef LOADLEVEL_TABLE_LIST
+#ifdef LOADLEVEL_TABLE_LIST
+ if (pvp->pvp_pin || pvp->pvp_localview == 1)
+ return 0;
+#else
held = VPROC_LOCK_EXCL_HELD(p->p_vproc);
#endif
if (pvp->pvp_loadlevel == -1) {
if (!fname) {
/* Check to see if process has dentry filled in */
+#ifdef LOADLEVEL_TABLE_LIST
+ read_lock_irq(&tasklist_lock);
+ dentry = dget(pvp->pvp_comm_de);
+ mnt = mntget(pvp->pvp_comm_mnt);
+ read_unlock_irq(&tasklist_lock);
+ if (!dentry) {
+ mntput(mnt);
+ mnt = NULL;
+#else
if (PVP(p->p_vproc)->pvp_comm_de) {
+ read_lock_irq(&tasklist_lock);
dentry = dget(PVP(p->p_vproc)->pvp_comm_de);
mnt = mntget(PVP(p->p_vproc)->pvp_comm_mnt);
+ read_unlock_irq(&tasklist_lock);
}
else {
+#endif /* !LOADLEVEL_TABLE_LIST */
/* get process executable from its memory */
task_lock(p);
mm = p->mm;
@@ -530,17 +550,31 @@
#ifdef LOADLEVEL_TABLE_LIST
if (dentry && mnt) {
/* check list and set loadlevel field accordingly */
- LOADLIST_LOCK_SHARED();
+ if (!TRY_LOADLIST_LOCK_SHARED())
+ goto out_nolock;
list_for_each_entry(ent, &loadlevel_table, inc_list) {
if (dentry == ent->de && mnt == ent->mnt) {
LOADLIST_UNLOCK_SHARED();
- pvp->pvp_loadlevel = 1;
- goto out_nolock;
+ set_mb(pvp->pvp_loadlevel, 1);
+ dput(dentry);
+ mntput(mnt);
+ return 1;
}
}
LOADLIST_UNLOCK_SHARED();
}
- pvp->pvp_loadlevel = 0;
+ set_mb(pvp->pvp_loadlevel, 0);
+ }
+ else if ((pvp->pvp_loadlevel == 0) && fname) {
+ /* reset so that it can be resolved again since process is
+ * about to exec
+ */
+ set_mb(pvp->pvp_loadlevel, -1);
+ }
+out_nolock:
+ dput(dentry);
+ mntput(mnt);
+ return 0;
#else /* !LOADLEVEL_TABLE_LIST */
if (!held)
if (!TRY_VPROC_LOCK_EXCL(p->p_vproc,"is_loadlevelable"))
@@ -561,31 +595,27 @@
}
pvp->pvp_loadlevel = 0;
LOADLIST_UNLOCK();
-#endif /* !LOADLEVEL_TABLE_LIST */
}
else if ((pvp->pvp_loadlevel == 0) && fname) {
-#ifndef LOADLEVEL_TABLE_LIST
if (!held)
VPROC_LOCK_EXCL(p->p_vproc,"is_loadlevelable");
-#endif
/* reset so that it can be resolved again since process is
* about to exec
*/
pvp->pvp_loadlevel = -1;
}
-#ifndef LOADLEVEL_TABLE_LIST
else
goto out_nolock;
out:
if (!held)
VPROC_UNLOCK_EXCL(p->p_vproc, "is_loadlevelable");
-#endif
out_nolock:
dput(dentry);
mntput(mnt);
return((pvp->pvp_pin || pvp->pvp_loadlevel < 0 ||
pvp->pvp_localview == 1) ? 0 : pvp->pvp_loadlevel);
+#endif /* !LOADLEVEL_TABLE_LIST */
}
ssize_t
@@ -597,14 +627,18 @@
int off = 0;
char *tmp;
char *path;
+#ifndef WRITE_LOADLIST_FIX
int read;
+#endif
char *str;
tmp = (char *)__get_free_page(GFP_KERNEL);
page = (char *)__get_free_page(GFP_KERNEL);
+#ifndef WRITE_LOADLIST_FIX
/* Stuff to do: */
/* Might use the ppos as index into table if list longer than count */
+#endif
/* get inclusion list */
str = page;
@@ -628,18 +662,33 @@
#else
LOADLIST_UNLOCK();
#endif
+#ifdef WRITE_LOADLIST_FIX
+ if (*ppos > off) {
+ count = -EINVAL;
+ goto out;
+ }
+ if (count > (off - *ppos))
+ count = off - *ppos;
+ copy_to_user(buf, page + *ppos, count);
+ *ppos += count;
+#else
read = off - *ppos;
if (read == 0)
goto out;
if (off > count)
off = count;
copy_to_user(buf, page, off);
+#endif
out:
free_page((unsigned long)page);
free_page((unsigned long)tmp);
+#ifdef WRITE_LOADLIST_FIX
+ return count;
+#else
*ppos += read;
return read;
+#endif
}
#define LINE_SIZE 80
@@ -652,19 +701,23 @@
nsc_nlcookie_t cookie;
clusternode_t node;
char *page;
- char *str;
- int size;
+#ifdef WRITE_LOADLIST_FIX
+ if (unlikely(!buf || !count || *ppos))
+ return -EINVAL;
+#endif
/* Get buffer from user space */
- page = (char *)kzmalloc(count, GFP_KERNEL);
+ page = (char *) kmalloc(count, GFP_KERNEL);
+#ifdef WRITE_LOADLIST_FIX
+ if (!page)
+ return -ENOMEM;
+#endif
- size = count;
- if ( copy_from_user (page, buf, size) ) {
+ if ( copy_from_user (page, buf, count) ) {
kfree(page);
return -EFAULT;
}
- str = page + size - 1;
- *str = '\0';
+ page[count-1] = '\0';
/* get node list */
nodelist = clms_get_nsc_nodelist(CLMS_NODE_UP
@@ -672,6 +725,9 @@
|CLMS_NODE_HALF_DOWN);
NSC_NLCOOKIE_INIT(&cookie);
+#ifdef WRITE_LOADLIST_FIX
+ NSC_NODELIST_CLR1(nodelist, this_node);
+#endif
while ((node = NSC_NODELIST_GET_NEXT(&cookie,nodelist))
!= CLUSTERNODE_INVAL) {
@@ -686,6 +742,12 @@
NSC_NODELIST_FREE(nodelist);
+#ifdef WRITE_LOADLIST_FIX
+ /* Local */
+ count = PVPSOP_WRITE_LOADLIST(this_node, file->f_flags, page, count,
+ ppos);
+#endif
+
kfree(page);
return count;
@@ -700,8 +762,13 @@
#else
struct inclusion_list *ptr, *ent, *oldlist = NULL;
#endif
+#ifdef WRITE_LOADLIST_FIX
+ char *line;
+ int len;
+#else
char *line, *str, *tmpbuf;
int len, size;
+#endif
struct nameidata nd;
int error = -ENOENT;
int write = 0;
@@ -716,6 +783,7 @@
return -ENOSYS;
}
+#ifndef WRITE_LOADLIST_FIX
line = (char *)kzmalloc(LINE_SIZE, GFP_KERNEL);
/* things to do:
@@ -731,6 +799,7 @@
tmpbuf = buf;
if (len == 0)
goto out;
+#endif
LOADLIST_LOCK();
/* if not append then clear the table since it
@@ -744,6 +813,30 @@
loadlevel_table = NULL;
#endif
}
+#ifdef WRITE_LOADLIST_FIX
+next_line:
+ do {
+ line = strsep(&buf, "\n");
+ if (!buf) {
+ len = count - write;
+ write = count;
+ break;
+ }
+ len = buf - line;
+ write += len;
+ } while (len == 1 && write < count); /* skip empty lines */
+
+ if (len >= PATH_MAX) {
+ LOADLIST_UNLOCK();
+ error = -ENAMETOOLONG;
+ goto out;
+ }
+ if (!*line) {
+ LOADLIST_UNLOCK();
+ error = 0;
+ goto out;
+ }
+#else
line:
for(str = tmpbuf; str && (*str != '\n' && *str != '\0'); str++);
if (*str == '\n') *str = '\0';
@@ -756,11 +849,26 @@
else
tmpbuf = ++str;
+#endif /* !WRITE_LOADLIST_FIX */
error = path_lookup(line, LOOKUP_FOLLOW, &nd);
/* Add entries into inclusion list */
if (!error) {
- ent = (struct inclusion_list *)kmalloc(
- sizeof(struct inclusion_list), GFP_KERNEL);
+#ifdef LOADLEVEL_TABLE_LIST
+ if (flags & O_APPEND) {
+ /* Check for duplicate entries */
+ list_for_each_entry(ent, &loadlevel_table, inc_list) {
+ if (ent->de->d_name.hash != nd.dentry->d_name.hash)
+ continue;
+ if (ent->de->d_parent != nd.dentry->d_parent)
+ continue;
+ dput(nd.dentry);
+ mntput(nd.mnt);
+ goto next_line;
+ }
+ }
+#endif
+
+ ent = kmalloc(sizeof(*ent), GFP_KERNEL);
if (!ent) {
LOADLIST_UNLOCK();
error = -ENOMEM;
@@ -771,7 +879,6 @@
ent->mnt = nd.mnt;
#ifdef LOADLEVEL_TABLE_LIST
INIT_LIST_HEAD(&ent->inc_list);
-
list_add_tail(&ent->inc_list, &loadlevel_table);
#else
ent->next = NULL;
@@ -787,8 +894,13 @@
#endif
}
+#ifdef WRITE_LOADLIST_FIX
+ if (write < count)
+ goto next_line;
+#else
if (len && write < count)
goto line;
+#endif
LOADLIST_UNLOCK();
@@ -799,7 +911,9 @@
*/
ssi_reset_loadlevel();
+#ifndef WRITE_LOADLIST_FIX
kfree(line);
+#endif
/* Now free oldlist if there is one */
#ifdef LOADLEVEL_TABLE_LIST
Index: nfs_mount.c
===================================================================
RCS file: /cvsroot/ssic-linux/openssi/kernel/cluster/ssi/util/nfs_mount.c,v
retrieving revision 1.11
retrieving revision 1.12
diff -u -d -r1.11 -r1.12
--- nfs_mount.c 19 Feb 2009 08:01:02 -0000 1.11
+++ nfs_mount.c 24 Mar 2009 04:26:28 -0000 1.12
@@ -314,7 +314,9 @@
BUG();
}
+#ifndef CFS_VFSMOUNT_RACE_FIX
mntget(mnt);
+#endif
if (!(atomic_read(&mnt->mnt_count) == 2 || flags & MNT_DETACH))
retval = -EBUSY;
@@ -347,13 +349,15 @@
printk("rnfs_umount; Can't find vfsmount\n");
BUG();
}
+#ifdef CFS_VFSMOUNT_RACE_FIX
+ _mntput(mnt); /* for the lookup */
+#endif
/* vfsmount should have the right number of holds due to prep above. */
retval = do_umount(mnt, flags);
- mntput(mnt);
-
+ _mntput(mnt);
*rval = retval;
return 0;
}
@@ -376,8 +380,10 @@
BUG();
}
+#ifdef CFS_VFSMOUNT_RACE_FIX
+ mntput(mnt); /* for the lookup */
+#endif
/* SSI_XXX: Release lock held in prep umount above */
-
mntput(mnt);
*rval = 0;
Index: rmtfb.c
===================================================================
RCS file: /cvsroot/ssic-linux/openssi/kernel/cluster/ssi/util/rmtfb.c,v
retrieving revision 1.22
retrieving revision 1.23
diff -u -d -r1.22 -r1.23
--- rmtfb.c 19 Feb 2009 08:01:02 -0000 1.22
+++ rmtfb.c 24 Mar 2009 04:26:28 -0000 1.23
@@ -721,7 +721,6 @@
{
struct rmtfb_cli *rfb;
struct file *file;
- struct socket *sock;
int loop = 0;
#ifdef REOP_EXPORT_PATH_SVRNODE
int svr = 0;
@@ -764,7 +763,7 @@
/* make socket back pointer */
if (file->f_dentry->d_inode->i_sock) {
- sock = SOCKET_I(file->f_dentry->d_inode);
+ struct socket *sock = SOCKET_I(file->f_dentry->d_inode);
sock->file = file;
#ifdef SSI_SOCK_REOP_TYPE
sock->type = socket_type;
Index: ssidev.c
===================================================================
RCS file: /cvsroot/ssic-linux/openssi/kernel/cluster/ssi/util/ssidev.c,v
retrieving revision 1.25
retrieving revision 1.26
diff -u -d -r1.25 -r1.26
--- ssidev.c 19 Feb 2009 08:01:02 -0000 1.25
+++ ssidev.c 24 Mar 2009 04:26:28 -0000 1.26
@@ -105,6 +105,13 @@
static void ssidev_poll_cli_init(void);
#endif
+#ifdef RCU_SSIDEV_POLL_CLI_LIST
+/*
+ * Bits in ssidev_poll_cli_t.pc_state
+ */
+#define pc_wakeup 0x1 /* wake pc_proc */
+#endif
+
static inline ssidev_hash_t *
ssidev_search_linuxtossi(clusternode_t devnode, int mode, dev_t linuxdev)
{
@@ -440,7 +447,7 @@
(void)to_node;
#ifdef SSIDEV_HASH_KMEM_CACHE
- newp = kmem_cache_alloc(ssidev_hash_cachep, GFP_KERNEL);
+ newp = kmem_cache_alloc(ssidev_hash_cachep, SLAB_KERNEL);
#else
newp = kmalloc(sizeof(*newp), GFP_KERNEL);
#endif
@@ -474,7 +481,7 @@
(void)to_node;
#ifdef SSIDEV_HASH_KMEM_CACHE
- newp = kmem_cache_alloc(ssidev_hash_cachep, GFP_KERNEL);
+ newp = kmem_cache_alloc(ssidev_hash_cachep, SLAB_KERNEL);
#else
newp = kmalloc(sizeof(*newp), GFP_KERNEL);
#endif
@@ -779,22 +786,25 @@
return error;
}
-static inline signed long ssidev_poll_cli_wait(ssidev_poll_cli_t *pcp,
- signed long timeout)
-{
#ifdef RCU_SSIDEV_POLL_CLI_LIST
- LOCK_SPIN_LOCK(&pcp->pc_spinlock);
- if (!pcp->pc_wakeup) {
- pcp->pc_proc = current;
- UNLOCK_SPIN_LOCK(&pcp->pc_spinlock);
- if (!pcp->pc_wakeup)
- timeout = schedule_timeout(timeout);
- LOCK_SPIN_LOCK(&pcp->pc_spinlock);
- pcp->pc_wakeup = 0;
- pcp->pc_proc = NULL;
+static inline int ssidev_poll_cli_wait(ssidev_poll_cli_t *pcp, long *timeout)
+{
+ if (!test_bit(pc_wakeup, &pcp->pc_state)) {
+ if (signal_pending(current))
+ return -EINTR;
+
+ *timeout = schedule_timeout(*timeout);
+ if (*timeout == 0)
+ return 0;
+ if (signal_pending(current)) /* Interrupted */
+ return -EINTR;
}
- UNLOCK_SPIN_LOCK(&pcp->pc_spinlock);
+ return 0;
+}
#else
+static inline signed long ssidev_poll_cli_wait(ssidev_poll_cli_t *pcp,
+ signed long timeout)
+{
spin_lock(&ssidev_poll_cli_spinlock);
pcp->pc_proc = current;
spin_unlock(&ssidev_poll_cli_spinlock);
@@ -804,10 +814,10 @@
pcp->pc_proc = NULL;
pcp->pc_wakeup = 0;
spin_unlock(&ssidev_poll_cli_spinlock);
-#endif /* !RCU_SSIDEV_POLL_CLI_LIST */
return timeout;
}
+#endif /* !RCU_SSIDEV_POLL_CLI_LIST */
void ssidev_poll_wake_cli(caddr_t cpcp)
{
@@ -817,13 +827,8 @@
rcu_read_lock();
list_for_each_entry_rcu(pcp, &ssidev_poll_cli_list, pc_list) {
if (pcp == (ssidev_poll_cli_t *)cpcp) {
- LOCK_SPIN_LOCK(&pcp->pc_spinlock);
- pcp->pc_wakeup = 1;
- if (pcp->pc_proc) {
+ if (!test_and_set_bit(pc_wakeup, &pcp->pc_state))
wake_up_process(pcp->pc_proc);
- pcp->pc_proc = NULL; /* avoid race */
- }
- UNLOCK_SPIN_LOCK(&pcp->pc_spinlock);
break;
}
}
@@ -898,7 +903,7 @@
ssidev_poll_node_t *pnp;
#ifdef SSIDEV_POLL_NODE_KMEM_CACHE
- pnp = kmem_cache_alloc(ssidev_poll_node_cachep, GFP_KERNEL);
+ pnp = kmem_cache_alloc(ssidev_poll_node_cachep, SLAB_KERNEL);
#else
pnp = kmalloc(sizeof(*pnp), GFP_KERNEL);
#endif
@@ -924,12 +929,28 @@
}
#ifdef SSIDEV_POLL_CLI_KMEM_CACHE
+static void
+ssidev_poll_cli_ctor(void * foo, kmem_cache_t * cachep, unsigned long flags)
+{
+ ssidev_poll_cli_t *pcp = (ssidev_poll_cli_t *) foo;
+
+ if ((flags & (SLAB_CTOR_VERIFY|SLAB_CTOR_CONSTRUCTOR)) ==
+ SLAB_CTOR_CONSTRUCTOR) {
+#ifdef RCU_SSIDEV_POLL_CLI_LIST
+ INIT_RCU_HEAD(&pcp->pc_rcu);
+#else
+ pcp->pc_proc = NULL;
+#endif
+ memset(pcp->pc_node, 0, sizeof(pcp->pc_node));
+ }
+}
+
static void ssidev_poll_cli_init(void)
{
ssidev_poll_cli_cachep = kmem_cache_create("ssidev_poll_cli",
sizeof(ssidev_poll_cli_t), 0,
SLAB_HWCACHE_ALIGN|SLAB_RECLAIM_ACCOUNT|SLAB_PANIC,
- NULL, NULL);
+ ssidev_poll_cli_ctor, NULL);
}
#endif
@@ -939,22 +960,31 @@
ssidev_poll_cli_t *pcp;
#ifdef SSIDEV_POLL_CLI_KMEM_CACHE
- pcp = kmem_cache_alloc(ssidev_poll_cli_cachep, GFP_KERNEL);
+ pcp = kmem_cache_alloc(ssidev_poll_cli_cachep, SLAB_KERNEL);
+ if (pcp == NULL)
+ return NULL;
+#ifdef RCU_SSIDEV_POLL_CLI_LIST
+ pcp->pc_proc = current;
+ /* pcp->pc_state = 0; */
#else
- pcp = kmalloc(sizeof(*pcp), GFP_KERNEL);
+ pcp->pc_wakeup = 0;
#endif
+#else /* !SSIDEV_POLL_CLI_KMEM_CACHE */
+ pcp = kmalloc(sizeof(*pcp), GFP_KERNEL);
if (pcp == NULL)
return NULL;
- INIT_LIST_HEAD(&pcp->pc_list);
+ pcp->pc_proc = NULL;
#ifdef RCU_SSIDEV_POLL_CLI_LIST
+ pcp->pc_state = 0;
INIT_RCU_HEAD(&pcp->pc_rcu);
- INIT_SPIN_LOCK(&pcp->pc_spinlock);
+#else
+ pcp->pc_wakeup = 0;
#endif
- pcp->pc_proc = NULL;
+ memset(pcp->pc_node, 0, sizeof(pcp->pc_node));
+#endif /* !SSIDEV_POLL_CLI_KMEM_CACHE */
+ INIT_LIST_HEAD(&pcp->pc_list);
pcp->pc_events = events;
- pcp->pc_wakeup = 0;
pcp->pc_retfunc = retfunc;
- memset(pcp->pc_node, 0, sizeof(pcp->pc_node));
spin_lock(&ssidev_poll_cli_spinlock);
#ifdef RCU_SSIDEV_POLL_CLI_LIST
list_add_rcu(&pcp->pc_list, &ssidev_poll_cli_list);
@@ -976,12 +1006,10 @@
if (pcp == NULL)
return;
-#ifdef RCU_SSIDEV_POLL_CLI_LIST
- SSI_ASSERT(pcp->pc_proc == NULL);
spin_lock(&ssidev_poll_cli_spinlock);
+#ifdef RCU_SSIDEV_POLL_CLI_LIST
list_del_rcu(&pcp->pc_list);
#else
- spin_lock(&ssidev_poll_cli_spinlock);
list_del(&pcp->pc_list);
#endif
spin_unlock(&ssidev_poll_cli_spinlock);
@@ -992,6 +1020,9 @@
if (pnp->pn_waiting)
ssidev_rpoll_wake_svr(i + 1, pcp);
ssidev_poll_node_free(pnp);
+#ifdef SSIDEV_POLL_CLI_KMEM_CACHE
+ pcp->pc_node[i] = NULL;
+#endif
}
#ifdef RCU_SSIDEV_POLL_CLI_LIST
call_rcu(&pcp->pc_rcu, ssidev_poll_cli_dealloc);
@@ -1082,6 +1113,9 @@
struct pollfd *fdp;
ssidev_poll_node_t *pnp;
+#ifdef RCU_SSIDEV_POLL_CLI_LIST
+ pcp->pc_state = 0;
+#endif
pcp->pc_retfunc = ssidev_poll_return;
for (i = 0; i < NSC_MAX_NODE_VALUE; i++) {
pnp = pcp->pc_node[i];
@@ -1360,11 +1394,15 @@
}
if (error < 0 || ucount > 0 || wait == NULL)
goto out;
+#ifdef RCU_SSIDEV_POLL_CLI_LIST
+ error = ssidev_poll_cli_wait(pcp, timeout);
+#else
if (signal_pending(current)) {
error = -EINTR;
goto out;
}
*timeout = ssidev_poll_cli_wait(pcp, *timeout);
+#endif
out:
__set_current_state(TASK_RUNNING);
@@ -1543,9 +1581,6 @@
orig_dentry = f->f_dentry;
orig_vfsmnt = f->f_vfsmnt;
- mb();
- f->f_dentry = dentry;
- f->f_vfsmnt = mnt;
inode = dentry->d_inode;
if (f->f_mode & FMODE_WRITE) {
@@ -1570,6 +1605,8 @@
put_write_access(orig_dentry->d_inode);
dput(orig_dentry);
mntput(orig_vfsmnt);
+ f->f_dentry = dentry;
+ f->f_vfsmnt = mnt;
return 0;
out_err:
Index: ssipty.c
===================================================================
RCS file: /cvsroot/ssic-linux/openssi/kernel/cluster/ssi/util/ssipty.c,v
retrieving revision 1.13
retrieving revision 1.14
diff -u -d -r1.13 -r1.14
--- ssipty.c 19 Feb 2009 08:01:02 -0000 1.13
+++ ssipty.c 24 Mar 2009 04:26:28 -0000 1.14
@@ -1096,7 +1096,9 @@
BUG();
}
+#ifndef CFS_VFSMOUNT_RACE_FIX
mntget(mnt);
+#endif
if (atomic_read(&mnt->mnt_count) != 2)
retval = -EBUSY;
@@ -1129,11 +1131,14 @@
printk("%s; Can't find vfsmount\n", __FUNCTION__);
BUG();
}
+#ifdef CFS_VFSMOUNT_RACE_FIX
+ _mntput(mnt); /* for the lookup */
+#endif
/* vfsmount should have the right number of holds due to prep above. */
retval = do_umount(mnt, flags);
- mntput(mnt);
+ _mntput(mnt);
*rval = retval;
return 0;
@@ -1157,8 +1162,10 @@
BUG();
}
+#ifdef CFS_VFSMOUNT_RACE_FIX
+ _mntput(mnt); /* for the lookup */
+#endif
/* SSI_XXX: Release lock held in prep umount above */
-
mntput(mnt);
*rval = 0;
Index: gfs_mount.c
===================================================================
RCS file: /cvsroot/ssic-linux/openssi/kernel/cluster/ssi/util/gfs_mount.c,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -d -r1.7 -r1.8
--- gfs_mount.c 10 Feb 2005 01:07:23 -0000 1.7
+++ gfs_mount.c 24 Mar 2009 04:26:28 -0000 1.8
@@ -223,7 +223,9 @@
BUG();
}
+#ifndef CFS_VFSMOUNT_RACE_FIX
mntget(mnt);
+#endif
/* SSI_XXX: Don't support MNT_DETACH yet */
if (flags & MNT_DETACH)
@@ -259,12 +261,15 @@
printk("rgfs_umount; Can't find vfsmount\n");
BUG();
}
+#ifdef CFS_VFSMOUNT_RACE_FIX
+ _mntput(mnt); /* for the lookup */
+#endif
/* vfsmount should have the right number of holds due to prep above. */
retval = do_umount(mnt, flags);
- mntput(mnt);
+ _mntput(mnt);
*rval = retval;
return 0;
@@ -288,8 +293,10 @@
BUG();
}
+#ifdef CFS_VFSMOUNT_RACE_FIX
+ _mntput(mnt); /* for the lookup */
+#endif
/* SSI_XXX: Release lock held in prep umount above */
-
mntput(mnt);
*rval = 0;
Index: ssidev_ics.c
===================================================================
RCS file: /cvsroot/ssic-linux/openssi/kernel/cluster/ssi/util/ssidev_ics.c,v
retrieving revision 1.13
retrieving revision 1.14
diff -u -d -r1.13 -r1.14
--- ssidev_ics.c 19 Feb 2009 08:01:02 -0000 1.13
+++ ssidev_ics.c 24 Mar 2009 04:26:28 -0000 1.14
@@ -252,7 +252,11 @@
*retval = -EINVAL;
file = rfb->common.rfb_file;
if (file->f_op && (fn = file->f_op->read))
+#ifdef SSI_RW_VERIFY_AREA_FIX
+ *retval = fn(file, buf, count, ppos);
+#else
*retval = fn(file, buf, count, &file->f_pos);
+#endif
rmtfb_putsvr(rfb);
} else
*retval = PTR_ERR(rfb);
@@ -324,7 +328,11 @@
*retval = -EINVAL;
file = rfb->common.rfb_file;
if (file->f_op && (fn = file->f_op->write))
+#ifdef SSI_RW_VERIFY_AREA_FIX
+ *retval = fn(file, buf, count, ppos);
+#else
*retval = fn(file, buf, count, &file->f_pos);
+#endif
rmtfb_putsvr(rfb);
} else
*retval = PTR_ERR(rfb);
@@ -739,13 +747,18 @@
wait = &table.pt;
tmpret = ssidev_do_poll_getf(icp);
SSI_ASSERT(tmpret <= 0);
- if (tmpret < 0)
+ if (tmpret < 0) {
psp->ps_retval = tmpret;
- set_current_state(TASK_INTERRUPTIBLE);
#ifdef RCU_SSIDEV_POLL_SVR_LIST
- /* serialized by ps_wakeup bit */
- psp->ps_proc = current;
-#else
+ set_bit(ps_wakeup, &psp->ps_state);
+#endif
+ }
+#ifdef RCU_SSIDEV_POLL_SVR_LIST
+ else
+ psp->ps_proc = current;
+#endif
+ set_current_state(TASK_INTERRUPTIBLE);
+#ifndef RCU_SSIDEV_POLL_SVR_LIST
spin_lock(&ssidev_poll_svr_spinlock);
psp->ps_proc = current;
spin_unlock(&ssidev_poll_svr_spinlock);
@@ -753,26 +766,28 @@
ssi_procstate_set(psp->ps_pstate);
tmpret = ssidev_do_poll_node(icp, psp->ps_events, wait);
ssi_procstate_set(&save_pstate);
- if (tmpret != 0)
+ if (tmpret != 0) {
psp->ps_retval = tmpret;
+#ifdef RCU_SSIDEV_POLL_SVR_LIST
+ set_bit(ps_wakeup, &psp->ps_state);
+#endif
+ }
up(&psp->ps_sem);
#ifdef RCU_SSIDEV_POLL_SVR_LIST
- if (!psp->ps_retval && !test_bit(ps_wakeup, &psp->ps_state))
+ if (!test_bit(ps_wakeup, &psp->ps_state))
#else
if (!psp->ps_retval && !psp->ps_wakeup)
#endif
schedule();
set_current_state(TASK_RUNNING);
-#ifdef RCU_SSIDEV_POLL_SVR_LIST
- psp->ps_proc = NULL;
-#else
+#ifndef RCU_SSIDEV_POLL_SVR_LIST
spin_lock(&ssidev_poll_svr_spinlock);
psp->ps_proc = NULL;
spin_unlock(&ssidev_poll_svr_spinlock);
#endif
poll_freewait(&table);
#ifdef RCU_SSIDEV_POLL_SVR_LIST
- if (!psp->ps_retval && !test_bit(ps_wakeup, &psp->ps_state))
+ if (!test_and_set_bit(ps_wakeup, &psp->ps_state))
#else
if (!psp->ps_retval && !psp->ps_wakeup)
#endif
------------------------------------------------------------------------------
Apps built with the Adobe(R) Flex(R) framework and Flex Builder(TM) are
powering Web 2.0 with engaging, cross-platform capabilities. Quickly and
easily build your RIAs with Flex Builder, the Eclipse(TM)based development
software that enables intelligent coding and step-through debugging.
Download the free 60 day trial. http://p.sf.net/sfu/www-adobe-com