[3953] in arla-drinkers

home help back first fref pref prev next nref lref last post

xfs behaviour on OpenBSD

daemon@ATHENA.MIT.EDU (Kristaps Johnson)
Thu Jun 15 07:30:02 2006

From arla-drinkers-bounces@stacken.kth.se Thu Jun 15 11:30:02 2006
Return-Path: <arla-drinkers-bounces@stacken.kth.se>
Delivered-To: arla-drinkers-mtg@bloom-picayune.mit.edu
Received: (qmail 27561 invoked from network); 15 Jun 2006 11:30:02 -0000
Received: from mx3.kth.se (130.237.48.97)
  by charon.mit.edu with SMTP; 15 Jun 2006 11:30:02 -0000
Received: from localhost (localhost.localdomain [127.0.0.1])
	by mx3.kth.se (Postfix) with ESMTP id 2A124140EE1;
	Thu, 15 Jun 2006 13:30:01 +0200 (CEST)
Received: from mx3.kth.se ([127.0.0.1])
 by localhost (mx3.kth.se [127.0.0.1]) (amavisd-new, port 10024) with LMTP
 id 17390-01-19; Thu, 15 Jun 2006 13:29:58 +0200 (CEST)
Received: from tapas.stacken.kth.se (tapas.stacken.kth.se [130.237.234.140])
	by mx3.kth.se (Postfix) with ESMTP id 35E1F14055F;
	Thu, 15 Jun 2006 13:29:58 +0200 (CEST)
Received: from tapas.stacken.kth.se (localhost [127.0.0.1])
	by tapas.stacken.kth.se (Postfix) with ESMTP id 4AF6D534FC;
	Thu, 15 Jun 2006 13:29:56 +0200 (CEST)
X-Original-To: arla-drinkers@tapas.stacken.kth.se
Delivered-To: arla-drinkers@tapas.stacken.kth.se
Received: from brev.stacken.kth.se (brev.stacken.kth.se [130.237.234.84])
	by tapas.stacken.kth.se (Postfix) with ESMTP id D6E55534FC
	for <arla-drinkers@tapas.stacken.kth.se>;
	Thu, 15 Jun 2006 13:29:53 +0200 (CEST)
Received: from mx1.kth.se (mx1.kth.se [130.237.32.140])
	by brev.stacken.kth.se (8.12.10/8.12.10) with ESMTP id k5FBTq1F018791
	for <arla-drinkers@stacken.kth.se>;
	Thu, 15 Jun 2006 13:29:52 +0200 (MET DST)
Received: from localhost (localhost.localdomain [127.0.0.1])
	by mx1.kth.se (Postfix) with ESMTP id B22F914107F
	for <arla-drinkers@stacken.kth.se>;
	Thu, 15 Jun 2006 13:29:52 +0200 (CEST)
Received: from mx1.kth.se ([127.0.0.1])
	by localhost (mx1.kth.se [127.0.0.1]) (amavisd-new,
	port 10024) with LMTP
	id 22462-01-27 for <arla-drinkers@stacken.kth.se>;
	Thu, 15 Jun 2006 13:29:42 +0200 (CEST)
Received: from outbound.mailhop.org (outbound.mailhop.org [63.208.196.171])
	by mx1.kth.se (Postfix) with ESMTP id EA560141033
	for <arla-drinkers@stacken.kth.se>;
	Thu, 15 Jun 2006 13:29:41 +0200 (CEST)
Received: from syru32-020.syr.edu ([128.230.32.20]
	helo=dryad.gradient-enterprises.com)
	by outbound.mailhop.org with esmtpa (Exim 4.51) id 1Fqq2e-000EM0-N4
	for arla-drinkers@stacken.kth.se; Thu, 15 Jun 2006 07:29:40 -0400
Received: from cycle0.hinterlands.net (cycle0.hinterlands.net [192.168.1.168])
	by dryad.gradient-enterprises.com (Postfix) with ESMTP id 38D5C3C94A
	for <arla-drinkers@stacken.kth.se>;
	Thu, 15 Jun 2006 07:32:44 -0400 (EDT)
Received: from kristaps (helo=localhost)
	by cycle0.hinterlands.net with local-esmtp (Exim 3.36 #1 (Debian))
	id 1Fqq2r-0002UN-00
	for <arla-drinkers@stacken.kth.se>; Thu, 15 Jun 2006 07:29:53 -0400
X-Mail-Handler: MailHop Outbound by DynDNS
X-Originating-IP: 128.230.32.20
X-Report-Abuse-To: abuse@dyndns.com (see
	http://www.mailhop.org/outbound/abuse.html for abuse reporting
	information)
X-MHO-User: wwcrew
Date: Thu, 15 Jun 2006 07:29:53 -0400 (EDT)
From: Kristaps Johnson <kristaps@gradient-enterprises.com>
X-X-Sender: kristaps@cycle0.hinterlands.net
To: arla-drinkers@stacken.kth.se
Subject: xfs behaviour on OpenBSD
Message-ID: <Pine.LNX.4.64.0606150720530.5425@cycle0.hinterlands.net>
MIME-Version: 1.0
X-Virus-Scanned: by amavisd-new at kth.se
X-Spam-Status: No, hits=0.0 tagged_above=-200.0 required=5.0 tests=
X-Spam-Level: 
X-BeenThere: arla-drinkers@stacken.kth.se
X-Mailman-Version: 2.1.6
Precedence: list
List-Id: Arla discussions <arla-drinkers.stacken.kth.se>
List-Unsubscribe: <https://lists.stacken.kth.se/mailman/listinfo/arla-drinkers>, 
	<mailto:arla-drinkers-request@stacken.kth.se?subject=unsubscribe>
List-Archive: <http://lists.stacken.kth.se/pipermail/arla-drinkers>
List-Post: <mailto:arla-drinkers@stacken.kth.se>
List-Help: <mailto:arla-drinkers-request@stacken.kth.se?subject=help>
List-Subscribe: <https://lists.stacken.kth.se/mailman/listinfo/arla-drinkers>, 
	<mailto:arla-drinkers-request@stacken.kth.se?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: arla-drinkers-bounces@stacken.kth.se
Errors-To: arla-drinkers-bounces@stacken.kth.se
X-Virus-Scanned: by amavisd-new at kth.se


Hello everybody.  I wonder if somebody can shed some light on strange 
behahiour (or sloppy thinking on my part).

If I mount_xfs on OpenBSD (3.9), and run two versions of a programme, one 
that read(2)s and one that fread(3)s, the read returns end-of-file while 
the fread returns correct values.

Sample code (minimal for brevity):

-------
#include <sys/types.h>
#include <fcntl.h>
#include <stdio.h>
#include <unistd.h>

int
main(int argc, char *argv[])
{
         char c = 0;
#if READ
         int fd = open("/dev/xfs0", O_RDWR);
         read(fd, &c, 1);
#else /* FREAD */
         FILE *f = fopen("/dev/xfs0", "r+");
         fread(&c, 1, 1, f);
#endif
         printf("read character %d\n", c);
         return(0);
}
--------

...just to demonstrate.  When I raise an oper (e.g., "ls /mnt/xfs0") the 
read returns end-of-file while the fread returns a proper value.

Any suggestions?

Thanks,
Kristaps
_______________________________________________
Arla-drinkers mailing list
Arla-drinkers@stacken.kth.se
https://lists.stacken.kth.se/mailman/listinfo/arla-drinkers

home help back first fref pref prev next nref lref last post