Re: [reiserfs-list] Re: magic is useless Determining File Types

2002-01-13 Thread Hans Reiser

Hubert Chan wrote:

   The
.. just means something special to the OS,

It doesn't mean something special to the OS, you guys are missing my 
intention, it is a style convention, not more.

Hans








Re: [reiserfs-list] Re: magic is useless Determining File Types

2002-01-13 Thread Hans Reiser

Alexander G. M. Smith wrote:

David L. Parsley [EMAIL PROTECTED] wrote on Fri, 04 Jan 2002 19:23:11 -0500:

I'll agree that I initially thought the 'file as directory' idea had a 
very high cool factor - but Linus, Al Viro, etc. convinced me otherwise. 
This also makes me think you'll have a hard time getting the kernel 
changed to let you open a file as a directory.


Why did they reject the idea?  It seems to work so well, having
objects which have both contents (data like a file) and subobjects
(like a directory).  Is there an objection other than it isn't the
traditional way of doing things?

If the kernel people can't fit it in, it can be hacked around.
Perhaps have each object appear twice in directory listings (once
as a file, once as a directory, perhaps with a slightly different
name).  Or have an alternate API via ioctl codes until it gets
accepted as being worthy of the kernel.

- Alex



Viro rejects (it isn't his father's Unix is I think the reason), Linus 
thinks it is fine and proved that VFS could handle files being directories.

Hans




[reiserfs-list] reiserfsck dumps core

2002-01-13 Thread Ole Tange

If I run:

  reiserfsck badfile

then I get a coredump. Badfile is really bad! But a coredump is not OK
even for really screwed files.

# reiserfsck --version
reiserfsck, 2001 - reiserfsprogs 3.x.0jreiserfsck: unrecognized option
`--version'


/Ole



[reiserfs-list] mkreiserfs does not work on loopback

2002-01-13 Thread Ole Tange

mkreiserfs seems not to work on plain files, which is pretty bad if you
want to make a loopback-file with reiserfs.

# dd if=/dev/zero of=loopfile count=100k
# mkreiserfs -f loopfile
mkreiserfs, 2001 - reiserfsprogs 3.x.0jmkreiserfs: loopfile is not a block
special device.
Forced to continue, but please confirm (y/n)y
# mkdir mountpoint
# mount loopfile mountpoint -oloop -t reiserfs
mount: wrong fs type, bad option, bad superblock on /dev/loop0,
   or too many mounted file systems


/Ole




Re: [reiserfs-list] reiserfsck dumps core

2002-01-13 Thread Ole Tange

On Sun, 13 Jan 2002, Ole Tange wrote:

 If I run:

   reiserfsck badfile

 then I get a coredump.

badfile was attached. But attachments probably do not get though.

It is also here:
http://ole.tange.dk/linux/problemer/badfile.bz2 (9kb)


/Ole




Re: [reiserfs-list] mkreiserfs does not work on loopback

2002-01-13 Thread Manuel Krause

On 01/13/2002 05:05 PM, Ole Tange wrote:

 mkreiserfs seems not to work on plain files, which is pretty bad if you
 want to make a loopback-file with reiserfs.
 
 # dd if=/dev/zero of=loopfile count=100k
 # mkreiserfs -f loopfile
 mkreiserfs, 2001 - reiserfsprogs 3.x.0jmkreiserfs: loopfile is not a block
 special device.
 Forced to continue, but please confirm (y/n)y
 # mkdir mountpoint
 # mount loopfile mountpoint -oloop -t reiserfs
 mount: wrong fs type, bad option, bad superblock on /dev/loop0,
or too many mounted file systems
 
 
 /Ole
 
 
 


Hi Ole,

I didn't have problems with these commands and reiserfs-progs 3.x.1 . 
Here I had to add another -f:

# mkreiserfs -f -f /mnt/beta/loopfile

-mkreiserfs, 2001-
reiserfsprogs 3.x.1

mkreiserfs: /mnt/beta/loopfile is not a block special device
Continue (y/n):y
[...]


Manuel




Re: [reiserfs-list] Re: magic is useless Determining File Types

2002-01-13 Thread Xuan Baldauf



Andrew Clausen wrote:

 On Sat, Jan 12, 2002 at 07:48:23PM +0100, Xuan Baldauf wrote:
   Why would they rely on using foo.jpeg/thumbnail.png, as opposed to
   foo.jpeg/thumbnail.png/content?
 
  Because there is a contract between the application and the filesystem that some
  entity (e.g. a file) can be found again using the same name which was used on
  creation of that entity.

 I agree, but I don't see how this is inconsistent.
 If you just store thumbnail.png (as opposed to thumbnail/content),
 then there is no possibility of adding attributes.

That's the point. :-) There shall be the possibility of adding attributes to files and
there shall be files being accessible by using the same name as used before, so, for
complying to both requirements, there must be a possibility of adding attributes to
files without requiring to rename them.



   Why not support both options?  If a file is a file, it's a file. (*grin*)
   If a file is a directory with /content, then it's also a file ;)
 
  That's my point. If attributes of files are implemented as directories, accessing
  those files with attributes must be downward compatible. If redirecting an
 
open(foo.jpeg);
 
  to an
 
open(foo.jpeg/content);
 
  within the kernel if foo.jpeg got changed to be an directory is possible and
  efficient, that could be okay from that viewpoint.

 It seems better to implement this in user space.  libgnomevfs, or something
 like that.

   What does name mean in this context?
 
  The text string to access the same data which was stored using the same name some
  time ago. So requiring the application to change
 
open(foo.jpeg);
 
  to
 
open(foo.jpeg/content);

 All problems in software engineering can be solved by adding another
 layer of indirection TM

 Basically: on the shell, etc., I want to see foo/content as a directory
 containing a file.  When I use GNOME, I want to be able to see it both
 ways.  For applications that don't adopt this, no big deal... just pass
 them file/content, instead of file.

I agree with you that this could be done in userspace, but
(1) It has to be done below the application level (e.g. glibc), not higher (like
GNOME), because all the tools (tar, cp, etc.) _must_ still be able to open foo.jpeg
if it has morphed into foo.jpeg/content using the same name.
(2) It will slow down disk accesses, because for every attributed file, there will be
two calls needed to access the file. But this can be optimized by kernel support and
changing glibc appropriately at a later stage of distribution of attributes.
(3) What do you do with attributes of directories? There are conventions for UNIX-style
filesystems that the number of subdirectories within a directory is the link count of
that directory - 2. This convention might be changed if attributes of directories are
implemented as entries of that directories. A glibc-implementation could reimplement
stat to return the conventional link count at the cost of a subdirectory scan and the
associated performance penalty, though.
(4) There will be some glitches, like the atomic rename(2), which by definition
automatically unlinks the destination file if it exists in one step. If implemented in
userspace, there won't be atomic rename-over-attributed-files.

After all, implementing within glibc sounds feasible for me and the only semantic
drawback is the missing atomicity of rename(). This is not the fault of glibc per se,
but the missing transaction API between kernel and userspace. Even the filesystem
namespace occupied for attributes can be hidden by a glibc implementation which escapes
names used by applications which would denote an attribute if read by glibc again.

This implementation would be inefficient but portable. Note that I still see this
implementation only as a transitional implementation until native kernel and filesystem
support is available.



 Andrew


Xuân.


--
Mit freundlichen Grüßen

Xuân Baldauf
Medium.net Internet Server Software