Skip to contentSkip to conversation

bug report: attributes ( chattr +a ) not respected by reiserfs 3,6, but this isn't listed in man mkreiserfs

DISCUSSION D.A.M. Revok 3 participants 8 messages Jul 12, 2003 – Jul 18, 2003

lore
Share & tools
lore
#0 lore raw

Please declare this in man .*reiser.*
( and also in the --help listings for 'em ), since it is kind of important to know *when* one is setting-up a filesystem
( rather than after the system's been built... )
so that no others will try setting
chattr +a logfile
to make it append-only, as part of system-security, because the attribute set is non-meaningful. ext3 respects this attribute.
This on SuSE 8.1 Pro and 8.2 Pro's kernel, maybe the stock kernel has it working, but I figure it'd be better to tell you people and let youse sort-it-out.

Thanks for a delightfully fast filesystem, though, eh?

: )

Signature · 12 lines
http://www.drawright.com/
 - "The New Drawing on the Right Side of the Brain" ( Betty Edwards, 
check "Theory", "Gallery", and "Exercises" )
http://www.ldonline.org/ld_indepth/iep/seven_habits.html
 - "The 7 Habits of Highly Effective People" ( this site is same 
principles as Covey's book )
http://www.eiconsortium.org/research/ei_theory_performance.htm
 - "Working With Emotional Intelligence" ( Goleman: this link is 
/revised/ theory, "Working. . . " is practical )
http://www.leadershipnow.com/leadershop/1978-5.html
 - Corps Business: The 30 /Management Principles/ of the U.S. Marines ( 
David Freedman )
#1 lore raw

Hello!

Quoted 11 lines · D.A.M. Revok

Please declare this in man .*reiser.*
( and also in the --help listings for 'em ), since it is kind of important to know *when* one is setting-up a filesystem
( rather than after the system's been built... )
so that no others will try setting
chattr +a logfile
to make it append-only, as part of system-security, because the attribute set is non-meaningful. ext3 respects this attribute.
This on SuSE 8.1 Pro and 8.2 Pro's kernel, maybe the stock kernel has it working, but I figure it'd be better to tell you people and let youse sort-it-out.

How do you tell it is not meaningful? Hve you tried to mount with -o attrs mount option?

Bye,
Oleg

#2 lore raw

I was absolutely stunned that reiserfs would throw-away attributes /by default/ but possibly it could know them?

So, I tried

su
mount -o remount,attrs /mnt/md1
exit
echo "this and that" > test
su
chattr +a test
lsattr test # *same as before*, it lists the attribute
exit
cp /dev/null test
ls -l test # answer is size==0

So now ( now that I found your e-mail in all these damn spams! ) I know that it doesn't respect attributes normally, or with the mount -o attrs
option.

It /shows/ that it respects attributes, but they don't /change anything/ and that is a problem.

Append-only logs work in ext3, but not with reiserfs.

Quoted 20 lines · you

Hello!

Quoted 11 lines · D.A.M. Revok

Please declare this in man .*reiser.*
( and also in the --help listings for 'em ), since it is kind of important to know *when* one is setting-up a filesystem
( rather than after the system's been built... )
so that no others will try setting
chattr +a logfile
to make it append-only, as part of system-security, because the attribute set is non-meaningful. ext3 respects this attribute. This on SuSE 8.1 Pro and 8.2 Pro's kernel, maybe the stock kernel has it working, but I figure it'd be better to tell you people and let youse sort-it-out.

How do you tell it is not meaningful? Hve you tried to mount with -o attrs mount option?

Bye,
Oleg

Signature · 12 lines
http://www.drawright.com/
 - "The New Drawing on the Right Side of the Brain" ( Betty Edwards, 
check "Theory", "Gallery", and "Exercises" )
http://www.ldonline.org/ld_indepth/iep/seven_habits.html
 - "The 7 Habits of Highly Effective People" ( this site is same 
principles as Covey's book )
http://www.eiconsortium.org/research/ei_theory_performance.htm
 - "Working With Emotional Intelligence" ( Goleman: this link is 
/revised/ theory, "Working. . . " is practical )
http://www.leadershipnow.com/leadershop/1978-5.html
 - Corps Business: The 30 /Management Principles/ of the U.S. Marines ( 
David Freedman )
#3 lore raw

Hello!

I suggest you to mount with -o attrs (not remount) also look in the kernel logs for any problems, there is a requirement that before you have attrs code working, you need to have special flag in superblock set (which you can set with reiserfsck --clean-attributes)

Bye,
Oleg

Quoted 59 lines · D.A.M. Revok

I was absolutely stunned that reiserfs would throw-away attributes /by default/ but possibly it could know them?
So, I tried
su
mount -o remount,attrs /mnt/md1
exit
echo "this and that" > test
su
chattr +a test
lsattr test # *same as before*, it lists the attribute
exit
cp /dev/null test
ls -l test # answer is size==0

So now ( now that I found your e-mail in all these damn spams! ) I know that it doesn't respect attributes normally, or with the mount -o attrs
option.

It /shows/ that it respects attributes, but they don't /change anything/ and that is a problem.

Append-only logs work in ext3, but not with reiserfs.

Quoted 20 lines · you

Hello!

Quoted 11 lines · D.A.M. Revok

Please declare this in man .*reiser.*
( and also in the --help listings for 'em ), since it is kind of important to know *when* one is setting-up a filesystem
( rather than after the system's been built... )
so that no others will try setting
chattr +a logfile
to make it append-only, as part of system-security, because the attribute set is non-meaningful. ext3 respects this attribute. This on SuSE 8.1 Pro and 8.2 Pro's kernel, maybe the stock kernel has it working, but I figure it'd be better to tell you people and let youse sort-it-out.

How do you tell it is not meaningful? Hve you tried to mount with -o attrs mount option?

Bye,
Oleg

Signature · 12 lines
http://www.drawright.com/
 - "The New Drawing on the Right Side of the Brain" ( Betty Edwards, 
check "Theory", "Gallery", and "Exercises" )
http://www.ldonline.org/ld_indepth/iep/seven_habits.html
 - "The 7 Habits of Highly Effective People" ( this site is same 
principles as Covey's book )
http://www.eiconsortium.org/research/ei_theory_performance.htm
 - "Working With Emotional Intelligence" ( Goleman: this link is 
/revised/ theory, "Working. . . " is practical )
http://www.leadershipnow.com/leadershop/1978-5.html
 - Corps Business: The 30 /Management Principles/ of the U.S. Marines ( 
David Freedman )
#4 lore raw

Re: bug report: attributes ( chattr +a ) not respected by reiserfs 3.6, but this isn't listed in man mkreiserfs

Hello yerself!

I tried it with 'mount' rather than 'mount -o remount' and ... ... no difference.

AND I've 'grepped -i ' for reiserfs in /var/log/*
... no errors.

I'll have to try the reiserfsck --clean-attributes trick, next...

Quoted 70 lines · you

Hello!

I suggest you to mount with -o attrs (not remount) also look in the
kernel logs for any problems, there is a requirement that before you have attrs code working, you need to have special flag in superblock set (which you can set with reiserfsck --clean-attributes)

Bye,
Oleg

Quoted 59 lines · D.A.M. Revok

I was absolutely stunned that reiserfs would throw-away attributes /by default/ but possibly it could know them?
So, I tried
su
mount -o remount,attrs /mnt/md1
exit
echo "this and that" > test
su
chattr +a test
lsattr test # *same as before*, it lists the attribute
exit
cp /dev/null test
ls -l test # answer is size==0

So now ( now that I found your e-mail in all these damn spams! ) I know that it doesn't respect attributes normally, or with the mount -o attrs
option.

It /shows/ that it respects attributes, but they don't /change anything/ and that is a problem.

Append-only logs work in ext3, but not with reiserfs.

Quoted 15 lines · you

Hello!

Quoted 11 lines · D.A.M. Revok

Please declare this in man .*reiser.*
( and also in the --help listings for 'em ), since it is kind of important to know *when* one is setting-up a filesystem ( rather than after the system's been built... )
so that no others will try setting
chattr +a logfile
to make it append-only, as part of system-security, because the attribute set is non-meaningful. ext3 respects this attribute. This on SuSE 8.1 Pro and 8.2 Pro's kernel, maybe the stock kernel has it working, but I figure it'd be better to tell you people and let youse sort-it-out.

Quoted 5 lines

How do you tell it is not meaningful? Hve you tried to mount with -o attrs mount option?

Bye,
Oleg

--
http://www.drawright.com/
- "The New Drawing on the Right Side of the Brain" ( Betty Edwards,
check "Theory", "Gallery", and "Exercises" )
http://www.ldonline.org/ld_indepth/iep/seven_habits.html
- "The 7 Habits of Highly Effective People" ( this site is same
principles as Covey's book )
http://www.eiconsortium.org/research/ei_theory_performance.htm
- "Working With Emotional Intelligence" ( Goleman: this link is
/revised/ theory, "Working. . . " is practical )
http://www.leadershipnow.com/leadershop/1978-5.html
- Corps Business: The 30 /Management Principles/ of the U.S. Marines
( David Freedman )

Signature · 12 lines
http://www.drawright.com/
 - "The New Drawing on the Right Side of the Brain" ( Betty Edwards, 
check "Theory", "Gallery", and "Exercises" )
http://www.ldonline.org/ld_indepth/iep/seven_habits.html
 - "The 7 Habits of Highly Effective People" ( this site is same 
principles as Covey's book )
http://www.eiconsortium.org/research/ei_theory_performance.htm
 - "Working With Emotional Intelligence" ( Goleman: this link is 
/revised/ theory, "Working. . . " is practical )
http://www.leadershipnow.com/leadershop/1978-5.html
 - Corps Business: The 30 /Management Principles/ of the U.S. Marines ( 
David Freedman )
#5 lore raw

Re: bug report: attributes ( chattr +a ) not respected by reiserfs 3.6, but this isn't listed in man mkreiserfs

Hello,

I get the same behaviour, but it appears that *only* the append-only attribute is ignored. Other attributes are respected fine. However, there are still some wierd things with reiserfs and attributes. This is a pretty long email detailing what I found.

I began by making a new filesystem.

# mkreiserfs /dev/hdc1
<-------------mkreiserfs, 2003------------->
reiserfsprogs 3.6.8

mkreiserfs: Guessing about desired format..
mkreiserfs: Kernel 2.4.20-xfs-r3 is running.
Format 3.6 with standard journal
...<snip>...

# mount -t reiserfs -o attrs /dev/hdc1 /mnt/reiser
# cd /mnt/reiser
# echo hello > file
-bash: file: Permission denied

Huh? I'm root, this is a new filesystem, why would permission be denied? Wait a minute...

# lsattr -d /mnt/reiser
suS-iadAcjIt- /mnt/reiser

Immutable (i) is set by default on new filesystems? That's funny. And why are all those others set? Anyway, the point is, immutable works just fine.

# chattr -i /mnt/reiser
# echo hello > file
# lsattr file
s-S---dAc--t- file
# chattr +i file
# echo line2 > file
-bash: file: Permission denied

Append only (a) is not respected.

# chattr -i +a file
# lsattr file
s-S--adAc--t- file
# echo test > file
# ls -l file
-rw-r--r--    1 root     root            5 Jul 16 16:09 file

However, noatime (A) works just fine.

# date
Wed Jul 16 16:11:09 CDT 2003
# cat file
test
# ls -lu file
-rw-r--r--    1 root     root            5 Jul 16 16:09 file

Now, a quick review of the attributes listed in chattr(1):

A : do not modify atime on file access
Works A-OK on reiserfs.

a : file can only be opened in append mode
Ignored by reiserfs.

c : automatically compress file data
No support in reiserfs.

D : sync directory writes (like "dirsync" option)
I don't know if this is supported or not.

d : tell "dump" to ignore this file
Does dump even work on reiserfs?

E : file has compression error
Not applicable; no compression support.

I : this directory is indexed with hash trees
Works A-OK on reiserfs.

i : immutable, file cannot be changed deleted renamed or linked to
Works A-OK on reiserfs.

j : apply data journalling to this file
I don't have the data journalling patches; I don't know if this works.

S : sync file writes (like "sync" option)
I don't know if this is supported or not.

s : secure delete, data blocks should be written with zeros when deallocated
I don't know if this is supported or not.

T : directory is top of hierarchy for orlov allocator
Not applicable, orlov is an ext2/3 block allocator added in 2.5.46

t : do not merge tails on this file
I don't know if this is supported or not.

u : allow user to undelete this file
No support in reiserfs.

X : compressed data may be accessed directly
Not applicable; no compression support.

Z : compressed file is dirty
Not applicable; no compression support.

lets look again at the default attributes on the root of a (newly created) reiserfs3 filesystem:

# lsattr -d /mnt/reiser
suS-iadAcjIt- /mnt/reiser

Some of these attributes make sense (tail merging, indexing), others require patches not in any vendor kernels (journalling), others just plain are not supported in reiserfs (compression, undelete), and some don't make a lick of sense (immutable, noatime). Why are all these set on new filesystems?

Finally, 'reiserfsck --clean-attributes' will produce the following:

# umount /mnt/reiser
# reiserfsck --clean-attributes /dev/hdc1
...<snip>...
# mount -t reiserfs -o attrs /dev/hdc1 /mnt/reiser
# lsattr -d /mnt/reiser
------------- /mnt/reiser
# lsattr /mnt/reiser/file
------------- /mnt/reiser/file
Signature · 1 line
    -Matt Stegman
#6 lore raw

Re: bug report: attributes ( chattr +a ) not respected by reiserfs 3.6, but this isn't listed in man mkreiserfs

Hello!

Quoted 4 lines · Matt Stegman

I get the same behaviour, but it appears that *only* the append-only attribute is ignored. Other attributes are respected fine. However, there are still some wierd things with reiserfs and attributes. This is a pretty long email detailing what I found.

Thanks a lot for a lot of details.

Quoted 7 lines
# mkreiserfs /dev/hdc1
<-------------mkreiserfs, 2003------------->
reiserfsprogs 3.6.8
mkreiserfs: Guessing about desired format.. 
mkreiserfs: Kernel 2.4.20-xfs-r3 is running.
Format 3.6 with standard journal
...<snip>...
Quoted 8 lines
# mount -t reiserfs -o attrs /dev/hdc1 /mnt/reiser
# cd /mnt/reiser
# echo hello > file
-bash: file: Permission denied
Huh?  I'm root, this is a new filesystem, why would permission be
denied?  Wait a minute...
# lsattr -d /mnt/reiser
suS-iadAcjIt- /mnt/reiser

Yes, this is a problem in mkreiserfs.
Surprisingly 2.6.4 works ok.
This of course will be fixed.

Quoted 11 lines
# chattr +i file
# echo line2 > file
-bash: file: Permission denied
Append only (a) is not respected.
# chattr -i +a file
# lsattr file
s-S--adAc--t- file
# echo test > file
# ls -l file
-rw-r--r--    1 root     root            5 Jul 16 16:09 file

Hm... Indeed. Sigh.

Quoted 2 lines

a : file can only be opened in append mode
Ignored by reiserfs.

Yes, this is a bug.

Quoted 2 lines

d : tell "dump" to ignore this file
Does dump even work on reiserfs?

We use this for marking the file as not needing tail packing.

Quoted 2 lines

t : do not merge tails on this file
I don't know if this is supported or not.

Hm, my "chattr" documentation does not have this flag.

Quoted 9 lines

Finally, 'reiserfsck --clean-attributes' will produce the following:

# umount /mnt/reiser
# reiserfsck --clean-attributes /dev/hdc1
...<snip>...
# mount -t reiserfs -o attrs /dev/hdc1 /mnt/reiser
# lsattr -d /mnt/reiser
------------- /mnt/reiser
# lsattr /mnt/reiser/file
------------- /mnt/reiser/file

Yes, this is expected.
Older kernels, that are unaware of reiserfs attributes (pre 2.4.17 ones)
write various garbage in sd_attrs field in stat data. So this needs to be cleaned. And we even invented a superblock flag to indicate that such a cleaning was performed already. Now we also see that new mkreiserfs also writes garbage there.

Bye,
Oleg

#7 lore raw

Re: bug report: attributes ( chattr +a ) not respected by reiserfs 3.6, but this isn't listed in man mkreiserfs

Quoted 4 lines · Oleg Drokin
Quoted 2 lines

t : do not merge tails on this file
I don't know if this is supported or not.

Hm, my "chattr" documentation does not have this flag.

My chattr(1) man page comes from e2fsprogs 1.33. The relevant text is:

A file with the 't' attribute will not have a partial block fragment at the of the file merged with other files (for those filesystems which support tail-merging). This is necessary for applications such as LILO which read the filesystem directly, and who don't understand tail- merged files.

Signature · 1 line
    -Matt Stegman