lkml.org 
[lkml]   [2000]   [Mar]   [16]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Subjectsmall bugfixes for oom in shm
From
Date
Hi Linus,

the appended patch fixes two bugs during oom situations in the shm
code.

Greetings
Christoph

--
--- 99-pre1/ipc/shm.c Wed Mar 15 17:11:34 2000
+++ m-pre1/ipc/shm.c Wed Mar 15 19:15:43 2000
@@ -881,9 +881,8 @@
{
char *result;

- result = __getname ();
- if (IS_ERR(result))
- return result;
+ if (!(result = __getname ()))
+ return ERR_PTR(-ENOMEM);

sprintf (result, "%s/" SHM_FMT, shm_path, id);
return result;
@@ -1220,7 +1219,7 @@
struct page * page;

if (idx >= shp->shm_npages)
- goto sigbus;
+ return NOPAGE_SIGBUS;

pte = SHM_ENTRY(shp,idx);
if (!pte_present(pte)) {
@@ -1267,9 +1266,8 @@
return pte_page(pte);

oom:
+ shm_lock(shp->id);
return NOPAGE_OOM;
-sigbus:
- return NOPAGE_SIGBUS;
}

static struct page * shm_nopage(struct vm_area_struct * shmd, unsigned long address, int no_share)
\
 
 \ /
  Last update: 2005-03-22 13:57    [W:0.317 / U:0.860 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site