On Nov 26, 2001  20:25 +0100, Dieter N?tzel wrote:
> SunWave1 /usr# chattr -R -SAadiscu .badattr/

Actually the better thing is "chattr -R = .badattr"

> SunWave1 /lib/modules# lsattr 2.4.15-pre7-preempt/
> lsattr: No such file or directory While reading flags on 2.4.15-pre7-preempt//build

The problem is that lsattr calls "ioctl" to get the attributes, and if
this is not a regular file or directory, then the ioctl will not necessarily
work.  On ext2, e2fsck will clear attributes on sockets, devices, etc, for
you, and I imagine that reiserfsck will eventually do the same.  As with
any new feature, there is some time between when it is added to the fs,
and when support for it appears in fsck.

> Erm, while disabling set and get as a nice idea, you only need to disable 
> get. Disabling set will mean you 'cannot' reset the file that is causing 
> the problem, because chattr won't actually be able to do what you want.

That is not necessarily true - what if the attribute is "compressed" and
you are randomly allowed to clear this "feature"?  Then when you read back
the file you will get compressed garbage that is not your file.  There is
a reason why not all attributes (under ext2 at least) are set/clearable
from the user tools.

> eg: Does it read in the value, change the bit and write it out again, or 
> does it just change that bit? If it reads and get is disabled, well then 
> you would want to make sure you set the 'full value' that needs to be 
> there. Not a bug so much as something that just needs to be documented.

Depends on whether you use +/- or = when using chattr.  See above why
"chattr -R = .badattr" _should_ remove all of the features on your fs.

In the future (once reiserfsck and the kernel code are smarter about
clearing garbage attributes), reiserfs may want restrict set/clear of
attributes to supported values, so that you don't accidentally clear
something like "compressed" and screw yourself.

Cheers, Andreas
--
Andreas Dilger
http://sourceforge.net/projects/ext2resize/
http://www-mddsp.enel.ucalgary.ca/People/adilger/

Reply via email to