[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH] ext2fs: Update to upstream Hurd-reserved xattr index for "gn

From: Samuel Thibault
Subject: Re: [PATCH] ext2fs: Update to upstream Hurd-reserved xattr index for "gnu.*".
Date: Tue, 12 May 2020 16:28:19 +0200
User-agent: NeoMutt/20170609 (1.8.3)

Jan Nieuwenhuizen, le mar. 12 mai 2020 16:12:34 +0200, a ecrit:
> setfattr --name=gnu.translator --value='/hurd/pflocal\0' /mnt/servers/socket/1

man setfattr says

If the given string is enclosed in double quotes, the inner string is
treated as text.  In that case, backslashes and double quotes have
special meanings and need to be escaped by a preceding backslash.

so I guess it needs 

setfattr --name=gnu.translator --value='"/hurd/pflocal\0"' /mnt/servers/socket/1

to actually interpret \0

> --8<---------------cut here---------------start------------->8---
> fsck --yes --force /
> fsysopts / --writable
> mv /servers/socket/1 /servers/socket/1-linux
> touch /servers/socket/1
> setfattr --name=gnu.translator --value='/hurd/pflocal\0' /servers/socket/1

Note that glibc's setxattr, i.e. _hurd_xattr_set, translates that
into a __file_set_translator() RPC call. Did you pass the proper option
to make ext2fs record the translator as xattr instead of passive record?

> And I guess there must be an incompatibility between Linux and the Hurd
> in how setfattr embeds the xattr attributes into the file system.
> How to best "diff" this aspect in the file system; how to proceed?

debugfs can be used for that.

> Inspired by Shengyu's GSoC code that simply seemed to use fprintf for
> debbugging, I tried adding some debug printing in inode.c
>     fprintf (stderr, "gnu.translator[%d,%d]=%s\n", datalen, strlen (*namep), 
> *namep);

Printf is the simplest way to make sure things are happening the way one
wants, yes. Note however that in the case of translators even the output on
stderr is buffered, so you need to flush it with fflush(stderr). Even
safer is to use snprintf + mach_print().

> but that does not seem to work,

More precisely?
I'll assume "does not show up".

If your print doesn't show up, try to put a print in other places which
are definitely to be called such as in diskfs_user_read_node(). If those
come up, then it means the code you put your prints is not even called,
so put prints in code you thought was calling it etc. up to the RPC that
you thought would be called, then jump to libc which was supposed to be
making the RPC call, etc.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]