Linux PARISC architecture development
 help / color / mirror / Atom feed
From: Joel Soete <joel.soete@freebel.net>
To: jsoe0708@tiscali.be
Cc: Randolph Chung <randolph@tausq.org>,
	Stefan Pfetzing <dreamind@dreamind.de>,
	parisc-linux@lists.parisc-linux.org
Subject: Re: [parisc-linux] Re: mkfs.xfs (xfsprogs-2.3.5) failled
Date: Sat, 26 Oct 2002 17:39:48 +0000	[thread overview]
Message-ID: <3DBAD364.9060301@freebel.net> (raw)
In-Reply-To: 3DB5776100000C32@ocpmta8.be.tiscali.com

Hmm question about "default:" uaccess.h implementation on different 
platform:

i386 declare: "extern void __get_user_bad(void);"

ia64: "extern void __get_user_unknown (void);"

mips: "extern void __get_user_unknown(void);"
...
but not define elsewhere? (is it there so that the build of the kernel 
failed if that case was requested to run properly?)

Thanks in advance for attention,
     Joel

PS: afaik on i386 only put_user_u64 is define why not pending get_user?


jsoe0708@tiscali.be wrote:
> too bad:
> 
>  man ioctl advise that it would return -1 (not ENOTSUP which would be assign
> to errno) I will try to see how?
> 
> Sorry to annoy,
>     Joel
> 
> 
>>-- Original Message --
>>From: jsoe0708@tiscali.be
>>Subject: Re: [parisc-linux] Re: mkfs.xfs (xfsprogs-2.3.5) failled
>>To: "Randolph Chung" <randolph@tausq.org>,
>>	"Stefan Pfetzing" <dreamind@dreamind.de>
>>Cc: parisc-linux@lists.parisc-linux.org
>>Date: Fri, 25 Oct 2002 14:58:42 +0200
>>
>>
>>Hi Randolph,
>>
>>It sure I found a bug in the two parts kernel and xfs.
>>
>>A. The kernel hppa: put_user and get_user does just a printk for BUG messages
>>but don't return error code as ENOTSUP (or what else) (what I assume the
>>other platforms does when they do not yet support BLKGETSIZE64?)
>>
>>Here is a small patch I suggest:
>>(I do not reach to implement an operational support of BLKGETSIZE64 [for
>>32bits kernel]; I do not find a easy way to manage code failure :-( )
>>
>>--- uaccess.h.orig	2002-10-22 15:14:54.000000000 +0200
>>+++ uaccess.h	2002-10-23 13:46:48.000000000 +0200
>>@@ -35,10 +35,10 @@
>>#define get_user __get_user
>>
>>#if BITS_PER_LONG == 32
>>-#define LDD_KERNEL(ptr)		BUG()
>>-#define LDD_USER(ptr)		BUG()
>>-#define STD_KERNEL(x, ptr)	BUG()
>>-#define STD_USER(x, ptr)	BUG()
>>+#define LDD_KERNEL(ptr)		BUG(); __gu_err=ENOTSUP;
>>+#define LDD_USER(ptr)		BUG(); __gu_err=ENOTSUP;
>>+#define STD_KERNEL(x, ptr)	BUG(); __pu_err=ENOTSUP;
>>+#define STD_USER(x, ptr)	BUG(); __pu_err=ENOTSUP;
>>#else
>>#define LDD_KERNEL(ptr) __get_kernel_asm("ldd",ptr)
>>#define LDD_USER(ptr) __get_user_asm("ldd",ptr)
>>@@ -75,7 +75,7 @@
>>	    case 2: __get_kernel_asm("ldh",ptr); break; \
>>	    case 4: __get_kernel_asm("ldw",ptr); break; \
>>	    case 8: LDD_KERNEL(ptr); break;		\
>>-	    default: BUG(); break;                      \
>>+	    default: BUG(); __gu_err=ENOTSUP; break;    \
>>	    }                                           \
>>	}                                               \
>>	else {                                          \
>>@@ -84,7 +84,7 @@
>>	    case 2: __get_user_asm("ldh",ptr); break;   \
>>	    case 4: __get_user_asm("ldw",ptr); break;   \
>>	    case 8: LDD_USER(ptr);  break;		\
>>-	    default: BUG(); break;                      \
>>+	    default: BUG(); __gu_err=ENOTSUP; break;    \
>>	    }                                           \
>>	}                                               \
>>							\
>>@@ -144,7 +144,7 @@
>>	    case 2: __put_kernel_asm("sth",x,ptr); break;       \
>>	    case 4: __put_kernel_asm("stw",x,ptr); break;       \
>>	    case 8: STD_KERNEL(x,ptr); break;			\
>>-	    default: BUG(); break;                              \
>>+	    default: BUG(); __pu_err=ENOTSUP; break;		\
>>	    }                                                   \
>>	}                                                       \
>>	else {                                                  \
>>@@ -153,7 +153,7 @@
>>	    case 2: __put_user_asm("sth",x,ptr); break;         \
>>	    case 4: __put_user_asm("stw",x,ptr); break;         \
>>	    case 8: STD_USER(x,ptr); break;			\
>>-	    default: BUG(); break;                              \
>>+	    default: BUG(); __pu_err=ENOTSUP; break;		\
>>	    }                                                   \
>>	}                                                       \
>>								\
>>
>>If all agreed, (awaiting better :?) can somebody ci it?
>>
>>
>>Thanks in advance for attention,
>>   Joel
>>
>>PS: 
>>B. in xfs:
>>
>>	error = ioctl(fd, BLKGETSIZE64, &size);
>>-	if (error >= 0) {
>>+	if (!error) {
>>		/* BLKGETSIZE64 returns size in bytes not 512-byte blocks */
>>
>>AFAIK ioctl should return error=0 if success and error <>0 (>0?) 
>>
>>here is the full patch I will suggest:
>>
>>--- cmd/xfsprogs/libxfs/init.c.orig	2002-10-25 12:12:29.000000000 +0200
>>+++ cmd/xfsprogs/libxfs/init.c	2002-10-25 14:22:34.000000000 +0200
>>@@ -155,11 +155,14 @@
>>			progname, path, strerror(errno));
>>		exit(1);
>>	}
>>+#if !defined(__hppa__) || defined(__LP64__)
>>	error = ioctl(fd, BLKGETSIZE64, &size);
>>-	if (error >= 0) {
>>+	if (!error) {
>>		/* BLKGETSIZE64 returns size in bytes not 512-byte blocks */
>>		size = size >> 9;
>>-	} else {
>>+	} else
>>+#endif
>>+        {
>>		/* If BLKGETSIZE64 fails, try BLKGETSIZE */
>>		unsigned long tmpsize;
>>		error = ioctl(fd, BLKGETSIZE, &tmpsize);
>>
>>_______________________________________________
>>parisc-linux mailing list
>>parisc-linux@lists.parisc-linux.org
>>http://lists.parisc-linux.org/mailman/listinfo/parisc-linux
> 
> 
> _______________________________________________
> parisc-linux mailing list
> parisc-linux@lists.parisc-linux.org
> http://lists.parisc-linux.org/mailman/listinfo/parisc-linux
> 

  reply	other threads:[~2002-10-26 16:33 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-10-23  7:30 [parisc-linux] mkfs.xfs (xfsprogs-2.3.5) failled jsoe0708
2002-10-24 17:58 ` [parisc-linux] " Stefan Pfetzing
2002-10-24 18:15   ` Randolph Chung
2002-10-24 18:17     ` Stefan Pfetzing
2002-10-24 19:00       ` Randolph Chung
2002-10-24 23:08         ` Stefan Pfetzing
2002-10-25  6:04         ` jsoe0708
2002-10-25 12:58         ` jsoe0708
2002-10-25 15:09           ` jsoe0708
2002-10-26 17:39             ` Joel Soete [this message]
2002-10-26 21:18               ` Randolph Chung
     [not found]                 ` <3DBB30C0.6060000@freebel.net>
2002-10-27  0:32                   ` Joel Soete
2002-10-26 23:40               ` Joel Soete
2002-10-25 15:26           ` Randolph Chung
2002-10-25  5:57   ` jsoe0708

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=3DBAD364.9060301@freebel.net \
    --to=joel.soete@freebel.net \
    --cc=dreamind@dreamind.de \
    --cc=jsoe0708@tiscali.be \
    --cc=parisc-linux@lists.parisc-linux.org \
    --cc=randolph@tausq.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox