Hello!

On Fri, Dec 14, 2001 at 04:18:51AM +0100, Philippe Gramoullé wrote:
> mkreiserfs segfaults when i try to make the partition. I can reproduce it
> every time.
Can you please retry with patch attached?

Bye,
    Oleg
Index: debugreiserfs/debugreiserfs.c
===================================================================
RCS file: /home/CVS/reiserfs/reiserfsprogs/debugreiserfs/debugreiserfs.c,v
retrieving revision 1.6.2.31
diff -u -r1.6.2.31 debugreiserfs.c
--- debugreiserfs/debugreiserfs.c       2001/12/07 20:03:21     1.6.2.31
+++ debugreiserfs/debugreiserfs.c       2001/12/14 07:01:54
@@ -41,7 +41,7 @@
 unsigned long * badblocks;
 int badblocks_nr;
 
-static void print_disk_tree (reiserfs_filsys_t * fs, int block_nr)
+static void print_disk_tree (reiserfs_filsys_t * fs, unsigned long block_nr)
 {
     struct buffer_head * bh;
     static int level = -1;
@@ -51,7 +51,7 @@
 
     bh = bread (fs->fs_dev, block_nr, fs->fs_blocksize);
     if (!bh) {
-       die ("Could not read block %d\n", block_nr);
+       die ("Could not read block %ld\n", block_nr);
     }
     level --;
 
@@ -92,7 +92,7 @@
 
 
 void pack_one_block (reiserfs_filsys_t * fs, unsigned long block);
-static void print_one_block (reiserfs_filsys_t * fs, int block)
+static void print_one_block (reiserfs_filsys_t * fs, unsigned long block)
 {
     struct buffer_head * bh;
     
@@ -110,17 +110,17 @@
         bm_bh = bread (fs->fs_dev, bm_block, fs->fs_blocksize);
         if (bm_bh) {
             if ( test_bit((block % (fs->fs_blocksize * 8)), bm_bh->b_data) )
-                fprintf (stderr, "%d is used in ondisk bitmap\n", block);
+                fprintf (stderr, "%lu is used in ondisk bitmap\n", block);
             else
-               fprintf (stderr, "%d is free in ondisk bitmap\n", block);
+               fprintf (stderr, "%lu is free in ondisk bitmap\n", block);
                
             brelse (bm_bh);
         }
     } else {
         if (reiserfs_bitmap_test_bit (fs->fs_bitmap2, block))
-           fprintf (stderr, "%d is used in ondisk bitmap\n", block);
+           fprintf (stderr, "%lu is used in ondisk bitmap\n", block);
         else
-           fprintf (stderr, "%d is free in ondisk bitmap\n", block);
+           fprintf (stderr, "%lu is free in ondisk bitmap\n", block);
     }
     
     bh = bread (fs->fs_dev, block, fs->fs_blocksize);
Index: debugreiserfs/pack.c
===================================================================
RCS file: /home/CVS/reiserfs/reiserfsprogs/debugreiserfs/pack.c,v
retrieving revision 1.4.2.23
diff -u -r1.4.2.23 pack.c
--- debugreiserfs/pack.c        2001/12/07 20:03:21     1.4.2.23
+++ debugreiserfs/pack.c        2001/12/14 07:01:54
@@ -767,7 +767,7 @@
     return 0;
 }
 
-static int do_pack (char * file, int block)
+static int do_pack (char * file, unsigned long block)
 {
     int fd;
     struct buffer_head * bh;
Index: fsck/check.c
===================================================================
RCS file: /home/CVS/reiserfs/reiserfsprogs/fsck/check.c,v
retrieving revision 1.7.2.13
diff -u -r1.7.2.13 check.c
--- fsck/check.c        2001/07/05 11:44:01     1.7.2.13
+++ fsck/check.c        2001/12/14 07:01:54
@@ -137,7 +137,7 @@
 }
 
 
-static void reiserfsck_check_tree (int dev, int block, int size, check_function_t 
comp_func)
+static void reiserfsck_check_tree (int dev, unsigned long block, int size, 
+check_function_t comp_func)
 {
     struct buffer_head * bh;
     int what_node;
@@ -188,7 +188,7 @@
     brelse (bh);
 }
 
-static void reiserfsck_check_cached_tree (int dev, int block, int size)
+static void reiserfsck_check_cached_tree (int dev, unsigned long block, int size)
 {
     struct buffer_head * bh;
     int what_node;
@@ -280,9 +280,9 @@
 #include <sys/mount.h>
 
 
-int blocks_on_device (int dev, int blocksize)
+unsigned long blocks_on_device (int dev, int blocksize)
 {
-    int size;
+    unsigned long size;
 
     if (ioctl (dev, BLKGETSIZE, &size) >= 0) {
        return  size / (blocksize / 512);
Index: fsck/fsck.h
===================================================================
RCS file: /home/CVS/reiserfs/reiserfsprogs/fsck/fsck.h,v
retrieving revision 1.10.2.31
diff -u -r1.10.2.31 fsck.h
--- fsck/fsck.h 2001/11/21 17:36:35     1.10.2.31
+++ fsck/fsck.h 2001/12/14 07:01:54
@@ -100,7 +100,7 @@
 /* pass1.c */
 void pass_1 (reiserfs_filsys_t *);
 void load_pass_1_result (FILE *, reiserfs_filsys_t *);
-struct buffer_head * make_buffer (int dev, int blocknr, int size, char * data);
+struct buffer_head * make_buffer (int dev, unsigned long blocknr, int size, char * 
+data);
 void build_the_tree (void);
 extern int g_unaccessed_items;
 int is_item_reachable (struct item_head * ih);
Index: fsck/pass0.c
===================================================================
RCS file: /home/CVS/reiserfs/reiserfsprogs/fsck/Attic/pass0.c,v
retrieving revision 1.1.2.53
diff -u -r1.1.2.53 pass0.c
--- fsck/pass0.c        2001/12/07 01:09:31     1.1.2.53
+++ fsck/pass0.c        2001/12/14 07:01:54
@@ -1067,7 +1067,7 @@
 {
     int i;
     int bad = 0;
-    int blocks;
+    unsigned long blocks;
 
     if (get_ih_item_len(ih) % UNFM_P_SIZE) {
        fsck_log ("is_bad_indirect: indirect item of %H of invalid length\n", ih);
Index: fsck/pass1.c
===================================================================
RCS file: /home/CVS/reiserfs/reiserfsprogs/fsck/pass1.c,v
retrieving revision 1.15.2.51
diff -u -r1.15.2.51 pass1.c
--- fsck/pass1.c        2001/12/07 01:09:31     1.15.2.51
+++ fsck/pass1.c        2001/12/14 07:01:54
@@ -11,7 +11,7 @@
 
 
 /* allocates buffer head and copy buffer content */
-struct buffer_head * make_buffer (int dev, int blocknr, int size, char * data)
+struct buffer_head * make_buffer (int dev, unsigned long blocknr, int size, char * 
+data)
 {
     struct buffer_head * bh;
     
Index: include/io.h
===================================================================
RCS file: /home/CVS/reiserfs/reiserfsprogs/include/io.h,v
retrieving revision 1.3.2.11
diff -u -r1.3.2.11 io.h
--- include/io.h        2001/11/05 14:22:14     1.3.2.11
+++ include/io.h        2001/12/14 07:01:54
@@ -43,13 +43,13 @@
 
 
 void __wait_on_buffer (struct buffer_head * bh);
-struct buffer_head * getblk (int dev, int block, int size);
-struct buffer_head * reiserfs_getblk (int dev, int block, int size, int *repeat);
+struct buffer_head * getblk (int dev, unsigned long block, int size);
+struct buffer_head * reiserfs_getblk (int dev, unsigned long block, int size, int 
+*repeat);
 
-struct buffer_head * find_buffer (int dev, int block, int size);
-struct buffer_head * get_hash_table(dev_t dev, int block, int size);
+struct buffer_head * find_buffer (int dev, unsigned long block, int size);
+struct buffer_head * get_hash_table(dev_t dev, unsigned long block, int size);
 struct buffer_head * bread (int dev, unsigned long block, size_t size);
-struct buffer_head * reiserfs_bread (int dev, int block, int size, int *repeat);
+struct buffer_head * reiserfs_bread (int dev, unsigned long block, int size, int 
+*repeat);
 int valid_offset (int fd, loff_t offset);
 int bwrite (struct buffer_head * bh);
 void brelse (struct buffer_head * bh);
Index: include/misc.h
===================================================================
RCS file: /home/CVS/reiserfs/reiserfsprogs/include/misc.h,v
retrieving revision 1.6.2.12
diff -u -r1.6.2.12 misc.h
--- include/misc.h      2001/11/07 18:07:59     1.6.2.12
+++ include/misc.h      2001/12/14 07:01:54
@@ -59,12 +59,12 @@
                         int *ppos, comparison_fn_t comp_func);
 
 struct block_handler {
-    int blocknr;
+    unsigned long blocknr;
     dev_t device;
 };
 
-int  blocklist__is_block_saved (struct block_handler ** base, int * count, int 
blocknr, dev_t device, int * position);
-void blocklist__insert_in_position (struct block_handler ** base, int * count, int 
blocknr, dev_t device, int * position);
+int  blocklist__is_block_saved (struct block_handler ** base, int * count, unsigned 
+long blocknr, dev_t device, int * position);
+void blocklist__insert_in_position (struct block_handler ** base, int * count, 
+unsigned long blocknr, dev_t device, int * position);
                         
                         
 #define set_bit_field_XX(XX,vp,val,from,count) \
Index: lib/io.c
===================================================================
RCS file: /home/CVS/reiserfs/reiserfsprogs/lib/io.c,v
retrieving revision 1.11.2.24
diff -u -r1.11.2.24 io.c
--- lib/io.c    2001/11/29 12:03:07     1.11.2.24
+++ lib/io.c    2001/12/14 07:01:54
@@ -262,7 +262,7 @@
 }
 
 
-struct buffer_head * find_buffer (int dev, int block, int size)
+struct buffer_head * find_buffer (int dev, unsigned long block, int size)
 {              
     struct buffer_head * next;
 
@@ -343,7 +343,7 @@
 }
 
 
-struct buffer_head * getblk (int dev, int block, int size)
+struct buffer_head * getblk (int dev, unsigned long block, int size)
 {
     struct buffer_head * bh;
 
Index: lib/misc.c
===================================================================
RCS file: /home/CVS/reiserfs/reiserfsprogs/lib/misc.c,v
retrieving revision 1.9.2.27
diff -u -r1.9.2.27 misc.c
--- lib/misc.c  2001/11/21 17:36:35     1.9.2.27
+++ lib/misc.c  2001/12/14 07:01:54
@@ -884,7 +884,7 @@
 }
 
 /* return -1 if smth found, otherwise return position which new item should be 
inserted into */
-int blocklist__is_block_saved (struct block_handler ** base, int * count, int 
blocknr, dev_t device, int * position) {
+int blocklist__is_block_saved (struct block_handler ** base, int * count, unsigned 
+long blocknr, dev_t device, int * position) {
     struct block_handler block_h;
     
     *position = 0;
@@ -901,7 +901,7 @@
     return 0;
 }
 
-void blocklist__insert_in_position (struct block_handler ** base, int * count, int 
blocknr, dev_t device, int * position) {
+void blocklist__insert_in_position (struct block_handler ** base, int * count, 
+unsigned long blocknr, dev_t device, int * position) {
     struct block_handler block_h;
     
     if (*base == NULL)

Reply via email to