Please take our Survey
logo       

Choosing A Webhost:
A web hosting service is a type of Internet hosting service that allows individuals and organizations to provide their own website accessible via the World Wide Web. Web hosts are companies that provide space on a server they own for use by their clients as well as providing Internet connectivity, typically in a data center. Web hosts can also provide data center space and connectivity to the Internet for servers they do not own to be located in their data center, called colocation. more...

[SSI] openssi/kernel/ipc shm.c,1.2.2.11,1.2.2.12: msg#00350

Subject: [SSI] openssi/kernel/ipc shm.c,1.2.2.11,1.2.2.12
Update of /cvsroot/ssic-linux/openssi/kernel/ipc
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv8401/ipc

Modified Files:
      Tag: OPENSSI-RH
        shm.c 
Log Message:
ipc/shm.c
cluster/ssi/vproc/as_xscribe.c
        - Fix bug in error handling code where shm client structure was not
          getting cleaned up properly.
        - Modified as_do_vma() to return error when creating remote shm
          client structure.
        - Fix compile warning.


Index: shm.c
===================================================================
RCS file: /cvsroot/ssic-linux/openssi/kernel/ipc/Attic/shm.c,v
retrieving revision 1.2.2.11
retrieving revision 1.2.2.12
diff -C2 -d -r1.2.2.11 -r1.2.2.12
*** shm.c       19 Feb 2004 08:43:02 -0000      1.2.2.11
--- shm.c       27 Feb 2004 03:11:14 -0000      1.2.2.12
***************
*** 41,45 ****
  extern int cli_ipcname_rmid(int, global_id_t);
  extern int ssi_shmctl(clusternode_t, int, int, struct shmid_ds *);
! extern int ssi_shm_get_shmid_kernel(clusternode_t, int, int **, int *, int *);
  extern int ipc_grow_ary(struct ipc_ids *, int);
  long ssi_shmget(key_t, size_t, int);
--- 41,45 ----
  extern int cli_ipcname_rmid(int, global_id_t);
  extern int ssi_shmctl(clusternode_t, int, int, struct shmid_ds *);
! extern int ssi_shm_get_shmid_kernel(clusternode_t, int, char **, int *, int 
*);
  extern int ipc_grow_ary(struct ipc_ids *, int);
  long ssi_shmget(key_t, size_t, int);
***************
*** 206,211 ****
        int sz = 0;
  
!       if ((ssi_shm_cleanup(svrnode, shp->id, this_node) < 0) ||
!                                               (svrnode != this_node)) {
                shm_unlock(shp->id);
                return;
--- 206,212 ----
        int sz = 0;
  
!       
!       if (svrnode && ((ssi_shm_cleanup(svrnode, shp->id, this_node) < 0) ||
!                                               (svrnode != this_node))) {
                shm_unlock(shp->id);
                return;
***************
*** 919,923 ****
                if (ssi_changeid(shp, id, shmid) < 0) {
                        printk("Unable to add newid %d to shm_ids\n",shmid);
!                       shp->shm_node = this_node;
                        shm_destroy(shp);
                        up(&shm_ids.sem);
--- 920,924 ----
                if (ssi_changeid(shp, id, shmid) < 0) {
                        printk("Unable to add newid %d to shm_ids\n",shmid);
!                       shp->shm_node = 0;
                        shm_destroy(shp);
                        up(&shm_ids.sem);
***************
*** 927,932 ****
                shm_unlock(shp->id);
                up(&shm_ids.sem);
-               dput(shp->shm_file->f_dentry);
-               mntput(shp->shm_file->f_vfsmnt);
                shp = shm_lock(shmid);
        }
--- 928,931 ----
***************
*** 937,946 ****
--- 936,954 ----
        err = shm_checkid(shp,shmid);
        if (err) {
+ #ifdef CONFIG_SSI
+               goto ssi_err;
+ #else
                shm_unlock(shmid);
                return err;
+ #endif
        }
        if (ipcperms(&shp->shm_perm, acc_mode)) {
+ #ifdef CONFIG_SSI
+               err = -EACCES;
+               goto ssi_err;
+ #else
                shm_unlock(shmid);
                return -EACCES;
+ #endif
        }
  #ifdef CONFIG_SSI
***************
*** 958,961 ****
--- 966,971 ----
                        if (de) {
                                /* switch file to cfs and cleanup */
+                               dput(shp->shm_file->f_dentry);
+                               mntput(shp->shm_file->f_vfsmnt);
                                new_mnt = (struct vfsmount *)
                                        cfs_shm_node_mnts[shp->shm_node];
***************
*** 965,969 ****
                        }
                        else {
!                               shp->shm_node = this_node;
                                shm_destroy(shp);
                                up (&shm_ids.sem);
--- 975,979 ----
                        }
                        else {
!                               shp->shm_node = 0;
                                shm_destroy(shp);
                                up (&shm_ids.sem);
***************
*** 1014,1017 ****
--- 1024,1038 ----
                err = PTR_ERR(user_addr);
        return err;
+ ssi_err:
+ #ifdef CONFIG_SSI
+       if (shp->shm_node != this_node && this_node != name_server_node && 
+                       shp->shm_file->f_op != &cfs_shm_file_operations) {
+               shp->shm_node = 0;
+               shm_destroy(shp);
+       }
+       else
+               shm_unlock(shmid);
+       return err;
+ #endif
  
  }
***************
*** 1153,1162 ****
                down(&shm_ids.sem);
                id = newseg(key, flags, sz, file, view);
! 
                shp = shm_lock(id);
                if (ssi_changeid(shp, id, shmid) < 0) {
                        printk("Unable to add newid %d to shm_ids\n",shmid);
                        get_file(file);
!                       shp->shm_node = this_node;
                        shm_destroy(shp);
                        up(&shm_ids.sem);
--- 1174,1186 ----
                down(&shm_ids.sem);
                id = newseg(key, flags, sz, file, view);
!               if (id < 0) {
!                       up(&shm_ids.sem);
!                       return id;
!               }
                shp = shm_lock(id);
                if (ssi_changeid(shp, id, shmid) < 0) {
                        printk("Unable to add newid %d to shm_ids\n",shmid);
                        get_file(file);
!                       shp->shm_node = 0;
                        shm_destroy(shp);
                        up(&shm_ids.sem);
***************
*** 1171,1178 ****
                }
        }
!       if (shp->shm_file != file){
!               old_file = file;
!               file = shp->shm_file; 
!               *filepp = file;
        }
        get_file(file);
--- 1195,1210 ----
                }
        }
!       if (shmid != shp->id) {
!               printk("Failed to create new cli entry, failing migrate\n");
!               shm_unlock(shp->id);
!               up(&shm_ids.sem);
!               return -EINVAL;
!       }
!       else {
!               if (shp->shm_file != file) {
!                       old_file = file;
!                       file = shp->shm_file; 
!                       *filepp = file;
!               }
        }
        get_file(file);
***************
*** 1208,1212 ****
        if (ssi_changeid(shp, id, shmid) < 0) {
                printk("Unable to add newid %d to shm_ids\n",shmid);
!               shp->shm_node = this_node;
                shm_destroy(shp);
                up(&shm_ids.sem);
--- 1240,1244 ----
        if (ssi_changeid(shp, id, shmid) < 0) {
                printk("Unable to add newid %d to shm_ids\n",shmid);
!               shp->shm_node = 0;
                shm_destroy(shp);
                up(&shm_ids.sem);
***************
*** 1406,1410 ****
                                if (ssi_changeid(shp, id, newid) < 0) {
                                        printk("Unable to add newid %lu to 
shm_ids\n",newid);
!                                       shp->shm_node = this_node;
                                        shm_destroy(shp);
                                        cli_ipcname_rmid(NAME_SERVICE_SHM, 
newid);
--- 1438,1442 ----
                                if (ssi_changeid(shp, id, newid) < 0) {
                                        printk("Unable to add newid %lu to 
shm_ids\n",newid);
!                                       shp->shm_node = 0;
                                        shm_destroy(shp);
                                        cli_ipcname_rmid(NAME_SERVICE_SHM, 
newid);
***************
*** 1419,1422 ****
--- 1451,1455 ----
                                cli_ipcname_rmid(NAME_SERVICE_SHM, newid);      
                                shm_lock(newid);
+                               shp->shm_node = 0;
                                shm_destroy(shp);
                                retval = -EINVAL;



-------------------------------------------------------
SF.Net is sponsored by: Speed Start Your Linux Apps Now.
Build and deploy apps & Web services for Linux with
a free DVD software kit from IBM. Click Now!
http://ads.osdn.com/?ad_id=1356&alloc_id=3438&op=click


<Prev in Thread] Current Thread [Next in Thread>
Google Custom Search

Recently Viewed:
hardware.arm.at...    cms.citadel.dev...    video.gstreamer...    java.facelets.u...    misc.basics.qna...    web.wiki.instik...    network.uip.use...    xdg.devel/2003-...    tex.bibtex.bibd...    finance.quotesp...    ietf.zeroconf/2...    redhat.blinux.g...    suse.db2/2003-0...    php.phpesp/2004...    uml.devel/2003-...    gnome.labyrinth...    qnx.openqnx.dev...    boot-loaders.gr...    db.dataperfect....    audio.audacity....    linux.uclinux.m...    editors.j.devel...    os.openbsd.tech...    kde.users.multi...   
Home | advertise | OSDir is an inevitable website. super tiny logo

Free Magazines

Cisco News
Receive a free quarterly e-newsletter with exclusive articles on how Cisco IT uses its own products and solutions to enable the business.
subscribe

Systems Management News, the newspaper for IT systems administration and data center managers! Each issue of Systems Management News is chock-full of news and analysis to help you understand what's happening in your field.
subscribe

The Enterprise Newsweekly eWeek is the essential technology information source for builders of e-business.
subscribe

Oracle Magazine Oracle Magazine contains technology strategy articles, sample code, tips, Oracle and partner news, how to articles for developers and DBAs, and more. Oracle (NASDAQ: ORCL) is the world's largest enterprise software company.
subscribe

Total Telecom Total Telecom is "The Economist of the communications industry".
subscribe

Navigation