9fans - fans of the OS Plan 9 from Bell Labs
 help / color / mirror / Atom feed
From: Ole-Hjalmar Kristensen <ole.hjalmar.kristensen@gmail.com>
To: Fans of the OS Plan 9 from Bell Labs <9fans@9fans.net>
Subject: Venti on OpenBSD - some information and a question
Date: Mon, 4 May 2020 22:05:36 +0200	[thread overview]
Message-ID: <CAHqDL_86c-YUNbQD-DqGwCbGoN0f4ido0pd+sOMh526pUwW5uQ@mail.gmail.com> (raw)

[-- Attachment #1: Type: text/plain, Size: 3167 bytes --]

I am in the process of moving a venti from Linux to OpenBSD.
First, unless int _p9dir(struct stat *lst, struct stat *st, char *name, Dir
*d, char **str, char *estr) is patched, it will always return size 0 for
raw partitions.
We need to allow character devices as well, not just block devices:

diff --git a/src/lib9/_p9dir.c b/src/lib9/_p9dir.c
index 58c63573..0fb3410e 100644
--- a/src/lib9/_p9dir.c
+++ b/src/lib9/_p9dir.c
@@ -230,7 +230,7 @@ _p9dir(struct stat *lst, struct stat *st, char *name,
Dir *d, char **str, char *
  d->qid.path = ('c'<<16)|st->st_rdev;
  }
  /* fetch real size for disks */
- if(S_ISBLK(lst->st_mode)){
+ if(S_ISBLK(lst->st_mode) || S_ISCHR(lst->st_mode)){
  if((fd = open(name, O_RDONLY)) >= 0){
  d->length = disksize(fd, st);
  close(fd);
dell-openbsd$ git log | head
commit c1c1b5267fd5e14be531a4b22ed0124b35d427cb
Author: sean <phonologus@gmail.com>
Date:   Wed Apr 29 11:21:35 2020 +0100

Second, if your raw partitions are MBR partitions, not OpenBSD disk labels,
you will still get 0 size, so venti will not run.
Disk with only MBR partitions:

dell-openbsd# disklabel sd1
16 partitions:
#                size           offset  fstype [fsize bsize   cpg]
  c:        488378645                0  unused
  i:        460800000              256 unknown
  j:         25600000        460800256 unknown
  k:          1834980        486400770 unknown

In this case you will need to run disklabel and edit the label to get BSD
partitions:
dell-openbsd# disklabel sd1.
16 partitions:
#                size           offset  fstype [fsize bsize   cpg]
  c:        488378645                0  unused
  d:        460800000              256  4.2BSD   4096 32768     1
  e:         25600000        460800256  4.2BSD   4096 32768     1
  f:          1834980        486400770  4.2BSD   4096 32768     1
  i:        460800000              256 unknown
  j:         25600000        460800256 unknown
  k:          1834980        486400770 unknown

Now for the question. For some reason, the venti running on OpenBSD is
refusing connections, both on port 80 and on 17034. No error messages from
venti that I can see.
dell-openbsd# bin/venti/venti -d -c /home/ole/venti/v2.conf
2020/0504 21:48:08 venti: conf...httpd tcp!*!80...init...icache
1,895,825,408 bytes = 18,850,537 entries; 16 scache
sync...announce tcp!*!17034...serving.

I can connect to the venti from localhost, but not from any other machine.
However, if I run nc -l on ports 17034 and 80, I can connect from any
machine. It is definitely not the packet filter, since the problem persists
even if I disable the packet filter. Any suggestions about what might be
blocking the connection?

The only real clue I have is that even on localhost I get "connection
refused", but telnet switches to IPv6 and that attempt is accepted:
dell-openbsd$ telnet localhost 17034
Trying 127.0.0.1...
telnet: connect to address 127.0.0.1: Connection refused
Trying ::1...
Connected to localhost.
Escape character is '^]'.
venti-04:02-libventi

Is it possible that venti somehow is listening only on the IPv6 address?

Ole-Hj.

[-- Attachment #2: Type: text/html, Size: 4069 bytes --]

             reply	other threads:[~2020-05-04 20:05 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-05-04 20:05 Ole-Hjalmar Kristensen [this message]
2020-05-04 20:09 ` [9fans] " ori
2020-05-04 20:58   ` Ole-Hjalmar Kristensen

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=CAHqDL_86c-YUNbQD-DqGwCbGoN0f4ido0pd+sOMh526pUwW5uQ@mail.gmail.com \
    --to=ole.hjalmar.kristensen@gmail.com \
    --cc=9fans@9fans.net \
    /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;
as well as URLs for NNTP newsgroup(s).