Hello community,

here is the log from the commit of package crash for openSUSE:Factory checked 
in at 2013-03-05 15:49:45
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/crash (Old)
 and      /work/SRC/openSUSE:Factory/.crash.new (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "crash", Maintainer is "ptesa...@suse.com"

Changes:
--------
--- /work/SRC/openSUSE:Factory/crash/crash.changes      2013-02-04 
21:07:54.000000000 +0100
+++ /work/SRC/openSUSE:Factory/.crash.new/crash.changes 2013-03-05 
15:49:47.000000000 +0100
@@ -1,0 +2,28 @@
+Wed Feb 27 06:23:31 UTC 2013 - co...@suse.com
+
+- update license to new format
+
+-------------------------------------------------------------------
+Mon Feb  4 23:26:14 UTC 2013 - dm...@suse.com
+
+- Re-execution of 150764 by tabra...@suse.com to re-align patch
+  content, re-number patches for latest spec contents and to
+  remove some incidental content (e.g. whitespace insertion and
+  leftover comments of new lines). Comment from tabraham follows:
+
+ - added crash-display-date-fix.patch
+   This is a backport of the fix from crash-6.0.9 to fix the date
+   displayed by the initial system banner and by the "sys" command
+   for linux kernel 3.6 and later. Without the patch, the date
+   displayed will be that of the UNIX epoch adjusted to local time.
+
+ - added crash-kmem_cache_slab.patch
+   This is a backport of the fix from crash-6.1.0 for Linux 3.0 and
+   later kernels that have been configured with CONFIG_SLAB and with-
+   out CONFIG_NODES_SHIFT. Without the patch, the warning messages
+   "crash: nr_node_ids: symbol does not exist" and "crash: unable to
+   initialize kmem slab cache subsystem" are displayed during
+   initialization, and the "kmem -[sS]" options fail with the message
+   "kmem: kmem cache slab subsystem not available".
+
+-------------------------------------------------------------------

New:
----
  crash-display-date-fix.patch
  crash-kmem_cache_slab.patch

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Other differences:
------------------
++++++ crash.spec ++++++
--- /var/tmp/diff_new_pack.LvOxSn/_old  2013-03-05 15:49:51.000000000 +0100
+++ /var/tmp/diff_new_pack.LvOxSn/_new  2013-03-05 15:49:51.000000000 +0100
@@ -35,7 +35,7 @@
 %define build_kmp 1
 Url:            http://people.redhat.com/anderson/
 Summary:        Crash utility for live systems; netdump, diskdump, LKCD or 
mcore dumpfiles
-License:        GPL-3.0+ ; GFDL-1.2
+License:        GPL-3.0+ and GFDL-1.2
 Group:          Development/Tools/Debuggers
 Version:        %{crash_version}
 Release:        0
@@ -61,6 +61,8 @@
 Patch11:        %{name}-siginfo.patch
 Patch12:        %{name}-var_length_log_rec.patch
 Patch13:        %{name}-compressed-booted-kernel.patch
+Patch14:        %{name}-display-date-fix.patch
+Patch15:        %{name}-kmem_cache_slab.patch
 Patch90:        %{name}-sial-ps-2.6.29.diff
 BuildRequires:  bison
 BuildRequires:  flex
@@ -221,6 +223,8 @@
 %patch11 -p1
 %patch12 -p1
 %patch13 -p1
+%patch14 -p1
+%patch15 -p1
 ## SIAL patches
 cd sial-scripts-%{scripts_version}
 %patch90 -p1

++++++ crash-display-date-fix.patch ++++++
---
 defs.h    |    1 +
 kernel.c  |    8 ++++++++
 symbols.c |    2 ++
 3 files changed, 11 insertions(+)

--- a/defs.h
+++ b/defs.h
@@ -1721,6 +1721,7 @@ struct offset_table {
        long mount_mnt;
        long task_struct_exit_state;
        long timekeeper_xtime;
+       long timekeeper_xtime_sec;
        long file_f_op;
        long file_private_data;
        long hstate_order;
--- a/kernel.c
+++ b/kernel.c
@@ -173,6 +173,7 @@ kernel_init()
                kt->flags |= SMP|PER_CPU_OFF;
        
        MEMBER_OFFSET_INIT(timekeeper_xtime, "timekeeper", "xtime");
+       MEMBER_OFFSET_INIT(timekeeper_xtime_sec, "timekeeper", "xtime_sec");
        get_xtime(&kt->date);
        
        if (pc->flags & GET_TIMESTAMP) {
@@ -8055,12 +8056,19 @@ static void
 get_xtime(struct timespec *date)
 {
        struct syment *sp;
+       uint64_t xtime_sec;
 
        if (VALID_MEMBER(timekeeper_xtime) &&
            (sp = kernel_symbol_search("timekeeper"))) {
                 readmem(sp->value + OFFSET(timekeeper_xtime), KVADDR, 
                        date, sizeof(struct timespec),
                         "timekeeper xtime", RETURN_ON_ERROR);
+       } else if (VALID_MEMBER(timekeeper_xtime_sec) &&
+            (sp = kernel_symbol_search("timekeeper"))) {
+               readmem(sp->value + OFFSET(timekeeper_xtime_sec), KVADDR,
+                        &xtime_sec, sizeof(uint64_t),
+                        "timekeeper xtime_sec", RETURN_ON_ERROR);
+               date->tv_sec = (__time_t)xtime_sec;
        } else if (kernel_symbol_exists("xtime"))
                get_symbol_data("xtime", sizeof(struct timespec), date);
 }
--- a/symbols.c
+++ b/symbols.c
@@ -7470,6 +7470,8 @@ dump_offset_table(char *spec, ulong make
 
        fprintf(fp, "              timekeeper_xtime: %ld\n",
                OFFSET(timekeeper_xtime));
+       fprintf(fp, "              timekeeper_xtime_sec: %ld\n",
+               OFFSET(timekeeper_xtime_sec));
 
        fprintf(fp, "                k_sigaction_sa: %ld\n",
                OFFSET(k_sigaction_sa));
++++++ crash-kmem_cache_slab.patch ++++++
---
 defs.h   |    2 
 memory.c |  176 ++++++++++++++++++++++++++++++++++++++++++++-------------------
 2 files changed, 127 insertions(+), 51 deletions(-)

--- a/defs.h
+++ b/defs.h
@@ -310,6 +310,7 @@ struct number_option {
 #define QUIET            (0x4)
 #define HEX_BIAS         (0x8)
 #define LONG_LONG       (0x10)
+#define RETURN_PARTIAL  (0x20)
 
 #define SEEK_ERROR       (-1)
 #define READ_ERROR       (-2)
@@ -2088,6 +2089,7 @@ struct vm_table {                /* kern
 #define SWAPINFO_V1            (0x200000)
 #define SWAPINFO_V2            (0x400000)
 #define NODELISTS_IS_PTR       (0x800000)
+#define KMALLOC_COMMON        (0x1000000)
 
 #define IS_FLATMEM()           (vt->flags & FLATMEM)
 #define IS_DISCONTIGMEM()      (vt->flags & DISCONTIGMEM)
--- a/memory.c
+++ b/memory.c
@@ -155,7 +155,7 @@ static void dump_kmem_cache_percpu_v1(st
 static void dump_kmem_cache_percpu_v2(struct meminfo *);
 static void dump_kmem_cache_slub(struct meminfo *);
 static void dump_kmem_cache_info_v2(struct meminfo *);
-static void kmem_cache_list_slub(void);
+static void kmem_cache_list_common(void);
 static ulong get_cpu_slab_ptr(struct meminfo *, int, ulong *);
 static unsigned int oo_order(ulong);
 static unsigned int oo_objects(ulong);
@@ -503,12 +503,25 @@ vm_init(void)
                        STRUCT_SIZE_INIT(kmem_cache_s, "kmem_cache");
                        MEMBER_OFFSET_INIT(kmem_cache_s_num, "kmem_cache", 
"num");
                        MEMBER_OFFSET_INIT(kmem_cache_s_next, "kmem_cache", 
"next");
+                       if (INVALID_MEMBER(kmem_cache_s_next)) {
+                               /*
+                                * slab/slub unification starting in linux 3.6
+                                */
+                               MEMBER_OFFSET_INIT(kmem_cache_s_next, 
"kmem_cache", "list");
+                               MEMBER_OFFSET_INIT(kmem_cache_list, 
"kmem_cache", "list");
+                               MEMBER_OFFSET_INIT(kmem_cache_name, 
"kmem_cache", "name");
+                               MEMBER_OFFSET_INIT(kmem_cache_size, 
"kmem_cache", "size");
+                               STRUCT_SIZE_INIT(kmem_cache, "kmem_cache");
+                       }
                        MEMBER_OFFSET_INIT(kmem_cache_s_name, "kmem_cache", 
"name");
                        MEMBER_OFFSET_INIT(kmem_cache_s_colour_off, 
"kmem_cache", 
                                "colour_off");
                        if (MEMBER_EXISTS("kmem_cache", "objsize"))
                                MEMBER_OFFSET_INIT(kmem_cache_s_objsize, 
"kmem_cache", 
                                        "objsize");
+                       else if (MEMBER_EXISTS("kmem_cache", "size"))
+                               MEMBER_OFFSET_INIT(kmem_cache_s_objsize, 
"kmem_cache",
+                                       "size");
                        else if (MEMBER_EXISTS("kmem_cache", "buffer_size"))
                                MEMBER_OFFSET_INIT(kmem_cache_s_objsize, 
"kmem_cache", 
                                        "buffer_size");
@@ -532,9 +545,7 @@ vm_init(void)
                                                        &nr_node_ids);
                                                vt->kmem_cache_len_nodes = 
nr_node_ids;
                                        } else {
-                                               error(INFO, "nr_node_ids: 
symbol does not exist\n");
-                                               error(INFO, "unable to 
initialize kmem slab cache subsystem\n\n");
-                                               vt->flags |= KMEM_CACHE_UNAVAIL;
+                                               vt->kmem_cache_len_nodes = 1;
                                        }
                                } else
                                        
ARRAY_LENGTH_INIT(vt->kmem_cache_len_nodes, NULL, 
@@ -579,6 +590,9 @@ vm_init(void)
                STRUCT_SIZE_INIT(kmem_cache, "kmem_cache");
                MEMBER_OFFSET_INIT(kmem_cache_size, "kmem_cache", "size");
                MEMBER_OFFSET_INIT(kmem_cache_objsize, "kmem_cache", "objsize");
+               if (INVALID_MEMBER(kmem_cache_objsize))
+                       MEMBER_OFFSET_INIT(kmem_cache_objsize, "kmem_cache",
+                               "object_size");
                MEMBER_OFFSET_INIT(kmem_cache_offset, "kmem_cache", "offset");
                MEMBER_OFFSET_INIT(kmem_cache_order, "kmem_cache", "order");
                MEMBER_OFFSET_INIT(kmem_cache_local_node, "kmem_cache", 
"local_node");
@@ -1932,12 +1946,20 @@ accessible(ulong kva)
 #define WRITE_ERRMSG     "write error: %s address: %llx  type: \"%s\"\n"
 #define PAGE_EXCLUDED_ERRMSG  "page excluded: %s address: %llx  type: \"%s\"\n"
 
+#define RETURN_ON_PARTIAL_READ() \
+       if ((error_handle & RETURN_PARTIAL) && (size < orig_size)) {            
      \
+               if(CRASHDEBUG(1))                                               
      \
+                        error(INFO, "RETURN_PARTIAL: \"%s\" read: %ld of 
%ld\n",      \
+                                 type, orig_size - size, orig_size);           
        \
+               return TRUE;                                                    
      \
+       }
+
 int
 readmem(ulonglong addr, int memtype, void *buffer, long size,
        char *type, ulong error_handle)
 {
        int fd;
-       long cnt;
+       long cnt, orig_size;
        physaddr_t paddr;
        ulonglong pseudo;
        char *bufptr;
@@ -1948,6 +1970,7 @@ readmem(ulonglong addr, int memtype, voi
                        error_handle_string(error_handle), (ulong)buffer);
 
        bufptr = (char *)buffer;
+       orig_size = size;
 
        if (size <= 0) {
                if (PRINT_ERROR_MESSAGE)
@@ -2062,6 +2085,7 @@ readmem(ulonglong addr, int memtype, voi
                         goto readmem_error;
 
                case PAGE_EXCLUDED:
+                       RETURN_ON_PARTIAL_READ();
                         if (PRINT_ERROR_MESSAGE)
                                error(INFO, PAGE_EXCLUDED_ERRMSG, 
memtype_string(memtype, 0), addr, type);
                         goto readmem_error;
@@ -2093,6 +2117,7 @@ readmem_error:
                 RESTART();
 
         case (RETURN_ON_ERROR):
+       case (RETURN_PARTIAL|RETURN_ON_ERROR):
        case (QUIET|RETURN_ON_ERROR):
                break;
         }
@@ -2461,6 +2486,8 @@ char *error_handle_string(ulong error_ha
                sprintf(&ebuf[strlen(ebuf)], "%sQ", others++ ? "|" : "");
        if (error_handle & HEX_BIAS)
                sprintf(&ebuf[strlen(ebuf)], "%sHB", others++ ? "|" : "");
+       if (error_handle & RETURN_PARTIAL)
+               sprintf(&ebuf[strlen(ebuf)], "%sRP", others++ ? "|" : "");
 
        strcat(ebuf, ")");
 
@@ -4199,7 +4226,7 @@ cmd_kmem(void)
                           "cannot make virtual-to-physical translation: 
%llx\n",
                                                value[i]);
                        }
-                       
+
                        if ((p1 = is_kmem_cache_addr(value[i], buf))) {
                                if (meminfo.reqname)
                                        error(FATAL, 
@@ -7727,9 +7754,9 @@ kmem_cache_list(void)
                return;
        }
 
-       if (vt->flags & KMALLOC_SLUB) {
-               kmem_cache_list_slub();
-               return;         
+       if (vt->flags & (KMALLOC_SLUB|KMALLOC_COMMON)) {
+               kmem_cache_list_common();
+               return; 
        }
 
        if (symbol_exists("cache_chain")) {     
@@ -7948,11 +7975,22 @@ kmem_cache_init(void)
        /*
         *  Pre-2.6 versions used the "cache_cache" as the head of the
         *  slab chain list.  2.6 uses the "cache_chain" list_head.
+        *  In 3.6 SLAB and SLUB use the "slab_caches" list_head.
         */
         if (vt->flags & PERCPU_KMALLOC_V2) {
-                get_symbol_data("cache_chain", sizeof(ulong), &cache);
+               if (kernel_symbol_exists("cache_chain")) {
+                       get_symbol_data("cache_chain", sizeof(ulong), &cache);
+                       cache_end = symbol_value("cache_chain");
+               } else if (kernel_symbol_exists("slab_caches")) {
+                       vt->flags |= KMALLOC_COMMON;
+                       get_symbol_data("slab_caches", sizeof(ulong), &cache);
+                       cache_end = symbol_value("slab_caches");
+               } else {
+                       error(INFO,
+                                "unable to initialize kmem slab cache 
subsystem\n\n");
+                       return;
+               }
                cache -= next_offset;
-                cache_end = symbol_value("cache_chain");
         } else
                 cache = cache_end = symbol_value("cache_cache");
 
@@ -7987,7 +8025,6 @@ kmem_cache_init(void)
                }
 
                tmp = (ulong)(UINT(cache_buf + num_offset));
-
                 if (tmp > max_cnum)
                         max_cnum = tmp;
 
@@ -8083,8 +8120,10 @@ kmem_cache_downsize(void)
        if ((THIS_KERNEL_VERSION < LINUX(2,6,22)) ||
            !(vt->flags & PERCPU_KMALLOC_V2_NODES) ||
            !kernel_symbol_exists("cache_cache") ||
-           !MEMBER_EXISTS("kmem_cache", "buffer_size"))
+           (!MEMBER_EXISTS("kmem_cache", "buffer_size") &&
+            !MEMBER_EXISTS("kmem_cache", "size"))) {
                return;
+       }
 
        if (vt->flags & NODELISTS_IS_PTR) {
                /* 
@@ -8101,6 +8140,9 @@ kmem_cache_downsize(void)
                ARRAY_LENGTH(kmem_cache_s_array) = nr_cpu_ids;
                ASSIGN_SIZE(kmem_cache_s) = OFFSET(kmem_cache_s_array) +
                        sizeof(ulong) * nr_cpu_ids;
+               if (CRASHDEBUG(1))
+                       fprintf(fp, "kmem_cache_downsize: %ld to %ld\n",
+                               STRUCT_SIZE("kmem_cache"), SIZE(kmem_cache_s));
                return;
        }
 
@@ -8230,6 +8272,9 @@ kmem_cache_s_array:
 
 kmem_cache_s_array_nodes:
 
+       if(CRASHDEBUG(3))
+               fprintf(fp, "kmem_cache: %lx\n", cache);
+
        if (!readmem(cache+OFFSET(kmem_cache_s_array),
             KVADDR, &cpudata[0], 
            sizeof(ulong) * ARRAY_LENGTH(kmem_cache_s_array),
@@ -8242,6 +8287,8 @@ kmem_cache_s_array_nodes:
                     KVADDR, &limit, sizeof(int),
                     "array cache limit", RETURN_ON_ERROR))
                        goto bail_out;
+               if (CRASHDEBUG(3))
+                       fprintf(fp, "  array limit[%d]: %d\n", i, limit);
                 if (limit > max_limit)
                         max_limit = limit;
         }
@@ -8270,6 +8317,10 @@ kmem_cache_s_array_nodes:
                        if (readmem(shared + OFFSET(array_cache_limit),
                            KVADDR, &limit, sizeof(int), "shared array_cache 
limit",
                            RETURN_ON_ERROR|QUIET)) {
+                               if(CRASHDEBUG(3))
+                                       fprintf(fp,
+                                               "  shared node limit[%d]: %d\n",
+                                               i, limit);
                                if (limit > max_limit)
                                        max_limit = limit;
                                break;
@@ -8882,9 +8933,15 @@ dump_kmem_cache_percpu_v2(struct meminfo
                        KVADDR, &cache_end, sizeof(ulong),
                        "kmem_cache_s next", FAULT_ON_ERROR);
        else {
-               get_symbol_data("cache_chain", sizeof(ulong), &si->cache);
-               si->cache -= OFFSET(kmem_cache_s_next);
-               cache_end = symbol_value("cache_chain");
+               if (vt->flags & KMALLOC_COMMON) {
+                       get_symbol_data("slab_caches", sizeof(ulong), 
&si->cache);
+                       si->cache -= OFFSET(kmem_cache_s_next);
+                       cache_end = symbol_value("slab_caches");
+               } else {
+                       get_symbol_data("cache_chain", sizeof(ulong), 
&si->cache);
+                       si->cache -= OFFSET(kmem_cache_s_next);
+                       cache_end = symbol_value("cache_chain");
+               }
        }
 
        if (si->flags & ADDRESS_SPECIFIED) {
@@ -10882,10 +10939,11 @@ gather_cpudata_list_v2_nodes(struct memi
                else
                        continue;
 
-                readmem(cpudata[i]+OFFSET(array_cache_avail),
+                /* readmem(cpudata[i]+OFFSET(array_cache_avail),
                         KVADDR, &avail, sizeof(int),
                         "array cache avail", FAULT_ON_ERROR);
-
+               */
+               dump_struct("array_cache", cpudata[i], 0);
                if (!avail) 
                        continue;
 
@@ -11394,6 +11452,8 @@ dump_vm_table(int verbose)
                fprintf(fp, "%sVM_STAT", others++ ? "|" : "");\
        if (vt->flags & KMALLOC_SLUB)
                fprintf(fp, "%sKMALLOC_SLUB", others++ ? "|" : "");\
+       if (vt->flags & KMALLOC_COMMON)
+               fprintf(fp, "%sKMALLOC_COMMON", others++ ? "|" : "");\
        if (vt->flags & CONFIG_NUMA)
                fprintf(fp, "%sCONFIG_NUMA", others++ ? "|" : "");\
        if (vt->flags & VM_EVENT)
@@ -15531,25 +15591,22 @@ kmem_cache_init_slub(void)
 }
 
 static void 
-kmem_cache_list_slub(void)
+kmem_cache_list_common(void)
 {
         int i, cnt;
         ulong *cache_list;
         ulong name;
-       char *cache_buf;
        char buf[BUFSIZE];
 
        cnt = get_kmem_cache_list(&cache_list);
-       cache_buf = GETBUF(SIZE(kmem_cache));
 
        for (i = 0; i < cnt; i++) {
                fprintf(fp, "%lx ", cache_list[i]);
 
-               readmem(cache_list[i], KVADDR, cache_buf, 
-                       SIZE(kmem_cache), "kmem_cache buffer", 
-                       FAULT_ON_ERROR);
+               readmem(cache_list[i] + OFFSET(kmem_cache_name),
+                               KVADDR, &name, sizeof(char *),
+                               "kmem_cache.name", FAULT_ON_ERROR);
 
-               name = ULONG(cache_buf + OFFSET(kmem_cache_name)); 
                if (!read_string(name, buf, BUFSIZE-1))
                        sprintf(buf, "(unknown)\n");
                
@@ -15557,7 +15614,6 @@ kmem_cache_list_slub(void)
        }
 
        FREEBUF(cache_list);
-       FREEBUF(cache_buf);
 }
 
 #define DUMP_KMEM_CACHE_INFO_SLUB()  dump_kmem_cache_info_slub(si)
@@ -15642,8 +15698,10 @@ dump_kmem_cache_slub(struct meminfo *si)
                reqname = si->reqname;
 
        for (i = 0; i < si->cache_count; i++) {
+               BZERO(si->cache_buf, SIZE(kmem_cache));
                if (!readmem(si->cache_list[i], KVADDR, si->cache_buf, 
-                   SIZE(kmem_cache), "kmem_cache buffer", RETURN_ON_ERROR))
+                       SIZE(kmem_cache), "kmem_cache buffer", 
+                       RETURN_ON_ERROR|RETURN_PARTIAL))
                        goto next_cache;
 
                name = ULONG(si->cache_buf + OFFSET(kmem_cache_name)); 
@@ -16147,22 +16205,19 @@ is_kmem_cache_addr_slub(ulong vaddr, cha
         int i, cnt;
         ulong *cache_list;
         ulong name;
-        char *cache_buf;
         int found;
 
         cnt = get_kmem_cache_list(&cache_list);
-        cache_buf = GETBUF(SIZE(kmem_cache));
        
         for (i = 0, found = FALSE; i < cnt; i++) {
                if (cache_list[i] != vaddr)
                        continue;
 
-                if (!readmem(cache_list[i], KVADDR, cache_buf,
-                   SIZE(kmem_cache), "kmem_cache buffer",
-                   RETURN_ON_ERROR))
+               if(!readmem(cache_list[i] + OFFSET(kmem_cache_name),
+                       KVADDR, &name, sizeof(char *),
+                       "kmem_cache.name", RETURN_ON_ERROR))
                        break;
 
-                name = ULONG(cache_buf + OFFSET(kmem_cache_name));
                 if (!read_string(name, kbuf, BUFSIZE-1))
                        sprintf(kbuf, "(unknown)");
 
@@ -16171,7 +16226,6 @@ is_kmem_cache_addr_slub(ulong vaddr, cha
         }
 
         FREEBUF(cache_list);
-        FREEBUF(cache_buf);
 
        return (found ? kbuf : NULL);
 }
@@ -16266,17 +16320,23 @@ count_partial(ulong node, struct meminfo
        ulong list_head, next;
        short inuse;
        ulong total_inuse;
+       ulong count;
 
+       count = 0;
        total_inuse = 0;
        list_head = node + OFFSET(kmem_cache_node_partial);
        if (!readmem(list_head, KVADDR, &next, sizeof(ulong),
            "kmem_cache_node.partial", RETURN_ON_ERROR))
                return -1;
 
+       hq_open();
+
        while (next != list_head) {
                if (!readmem(next - OFFSET(page_lru) + OFFSET(page_inuse), 
-                   KVADDR, &inuse, sizeof(ushort), "page.inuse", 
RETURN_ON_ERROR))
-                       return -1;
+                       KVADDR, &inuse, sizeof(ushort), "page.inuse", 
RETURN_ON_ERROR)) {
+                               hq_close();
+                               return -1;
+               }
                if (inuse == -1) {
                        error(INFO, "%s: partial list: page.inuse: -1\n",
                                si->curname);
@@ -16284,14 +16344,34 @@ count_partial(ulong node, struct meminfo
                }
                total_inuse += inuse;
                if (!readmem(next, KVADDR, &next, sizeof(ulong),
-                   "page.lru.next", RETURN_ON_ERROR))
+                   "page.lru.next", RETURN_ON_ERROR)) {
+                       hq_close();
                        return -1;
+               }
                if (!IS_KVADDR(next)) {
                        error(INFO, "%s: partial list: page.lru.next: %lx\n", 
                                si->curname, next);
                        break;
                }
+
+               /* Keep track of the last 1000 entries, and check
+                * whether the list has recursed back onto itself
+                */
+               if ((++count % 1000) == 0) {
+                       hq_close();
+                       hq_open();
+               }
+               if (!hq_enter(next)) {
+                       error(INFO,
+                               "%s: partial list: list corrupt: recurses back 
onto itself\n",
+                               si->curname);
+                       hq_close();
+                       return -1;
+
+               }
        }
+
+       hq_close();
        return total_inuse;
 }
 
@@ -16301,7 +16381,7 @@ is_slab_page(struct meminfo *si, char *b
        int i, cnt;
        ulong page_slab, page_flags, name;
         ulong *cache_list;
-        char *cache_buf, *retval;
+        char *retval;
 
        if (!(vt->flags & KMALLOC_SLUB))
                return NULL;
@@ -16324,16 +16404,14 @@ is_slab_page(struct meminfo *si, char *b
 
        retval = NULL;
         cnt = get_kmem_cache_list(&cache_list);
-        cache_buf = GETBUF(SIZE(kmem_cache));
 
        for (i = 0; i < cnt; i++) {
                if (page_slab == cache_list[i]) {
-                       if (!readmem(cache_list[i], KVADDR, cache_buf,
-                           SIZE(kmem_cache), "kmem_cache buffer",
-                           QUIET|RETURN_ON_ERROR))
-                               goto bailout;
+                       if (!readmem(cache_list[i] + OFFSET(kmem_cache_name),
+                               KVADDR, &name, sizeof(char *),
+                               "kmem_cache.name", QUIET|RETURN_ON_ERROR))
+                                       goto bailout;
 
-                       name = ULONG(cache_buf + OFFSET(kmem_cache_name));
                        if (!read_string(name, buf, BUFSIZE-1))
                                goto bailout;
 
@@ -16344,7 +16422,6 @@ is_slab_page(struct meminfo *si, char *b
 
 bailout:
        FREEBUF(cache_list);
-       FREEBUF(cache_buf);
 
        return retval;
 }
@@ -16467,7 +16544,6 @@ get_kmem_cache_by_name(char *request)
         int i, cnt;
         ulong *cache_list;
         ulong name;
-        char *cache_buf;
         char buf[BUFSIZE];
         ulong found;
 
@@ -16476,11 +16552,10 @@ get_kmem_cache_by_name(char *request)
         found = 0;
 
         for (i = 0; i < cnt; i++) {
-                readmem(cache_list[i], KVADDR, cache_buf,
-                        SIZE(kmem_cache), "kmem_cache buffer",
-                        FAULT_ON_ERROR);
+               readmem(cache_list[i] + OFFSET(kmem_cache_name),
+                               KVADDR, &name, sizeof(char *),
+                               "kmem_cache.name", FAULT_ON_ERROR);
 
-                name = ULONG(cache_buf + OFFSET(kmem_cache_name));
                 if (!read_string(name, buf, BUFSIZE-1))
                        continue;
 
@@ -16491,7 +16566,6 @@ get_kmem_cache_by_name(char *request)
         }
 
         FREEBUF(cache_list);
-        FREEBUF(cache_buf);
 
         return found;
 }
-- 
To unsubscribe, e-mail: opensuse-commit+unsubscr...@opensuse.org
For additional commands, e-mail: opensuse-commit+h...@opensuse.org

Reply via email to