Re: exFAT support

2020-08-06 Thread Ingo Schwarze
Hi John,

jo...@armadilloaerospace.com wrote on Thu, Aug 06, 2020 at 04:28:53PM -0700:

> I was considering making a kernel patch that reported it was
> an exFATfilesystem

Sounds like a layering violation.  The table of file system IDs
is in userland - /usr/src/sbin/fdisk/part.c - rather than in the
kernel, so the kernel is hardly a natural place for figuring out
what kind of filesystem is supposed to be on the partition.

> when the mount failed, which you would see if you were onttyC0, or could
> call up with dmesg, as with the kernel messages thathappen when you first
> plug a drive in.
> Is there a concise "philosophy" of when the kernel should print amessage
> post-boot?  Just when devices are dynamically configured?

I would put it as follows: kernel printf(9) is for
 1. boot messages (before init(8) starts)
(hotplugging hardware is similar even though it happens later)
 2. catastrophic kernel failures (like panics)
 3. catastrophic hardware failures (like a dying disk)
 4. debugging and data collection during active development

System-level errors (in particular from daemons) are usually reported
via syslog(3) instead.  Simply user errors like this one are reported
by the application program on stderr.

Yours,
  Ingo



Re: exFAT support

2020-08-06 Thread gwes

On 8/6/20 5:47 PM, Bryan Steele wrote:

On Thu, Aug 06, 2020 at 02:16:11PM -0700, jo...@armadilloaerospace.com wrote:

With Microsoft's release of the [exFAT] spec last year, is the path open for
kernel support now, when someone gets around to it?

I don't know the details, but I believe one issue with exFAT has been
Microsoft and software patents, not just available documentation. Linux
may eventually get a kernel implementation but I'm not sure that helps
us.

https://www.zdnet.com/article/microsoft-readies-exfat-patents-for-linux-and-open-source/
The license as published tries very hard to restrict use only to "Linux 
systems."

There are two sentences that might allow additional licenses.
Lawyer would be involved.

geoff steckel



Re: exFAT support

2020-08-06 Thread johnc
I was considering making a kernel patch that reported it was an exFATfilesystem
when the mount failed, which you would see if you were onttyC0, or could
call up with dmesg, as with the kernel messages thathappen when you first
plug a drive in.
Is there a concise "philosophy" of when the kernel should print amessage
post-boot?  Just when devices are dynamically configured?

   Original Message 
  Subject: Re: exFAT support
  From: Ingo Schwarze 
  Date: Thu, August 06, 2020 3:57 pm
  To: jo...@armadilloaerospace.com
  Cc: t...@openbsd.org

  Hi,

  in addition to what Bryan said...

  This message is wildly off-topic on tech@.
  If you reply, please reply to misc@.

  Quoting from https://www.openbsd.org/mail.html (please read that!):

  Developer lists:
  [...]
  t...@openbsd.org
  Discussion of technical topics for OpenBSD developers and advanced
  users. This is _not_ a "tech support" forum - do not use it as such.


  jo...@armadilloaerospace.com wrote on Thu, Aug 06, 2020 at 02:16:11PM
  -0700:

  > I tried to mount a 12TB USB drive, and was getting an
  "Inappropriate
  > file type or format" error.

  Even on misc@, when asking questions, please state what you are
  actually doing, showing the exact commands you type and the exact
  output you get, together in the original order, for example like
  this:

  isnote# mount -t msdos /dev/sd1a /mnt
  mount_msdos: /dev/sd1a on /mnt: Inappropriate file type or format

  > It turned out to be due to exFAT formatting, but it took me some
  > investigating to figure that out. Would it be reasonable to have
  the
  > kernel print

  You didn't say where you saw the message, but i assume it was the
  output of mount(8), not kernel output on the system console or in
  /var/log/messages. The kernel doesn't print such messages. The
  application program (e.g. mount(8)) prints them. All the kernel
  does is return an errno(2) to the mount(2) syscall. So you can
  find an exhaustive list of the messages that could be printed in
  the errno(2) manual page. Also, which errno(2) is returned from
  syscalls in which error case is not arbitrary and cannot be changed
  arbitrarily.

  > a more informative warning like "exFAT filesystem not
  > supported" when you try to mount it with mount_msdos, or are
  additional
  > kernel prints considered bad form?

  I bet if the kernel had printed anything, you wouldn't even have
  noticed. Besides, yes indeed, the kernel is absolutely not supposed
  to print anything when users type wrong commands.

  Yours,
  Ingo