Re: Reiserfs flags question

From: Oleg Drokin
Date: Sun Feb 08 2004 - 12:58:56 EST


Hello!

Bart Samwel <bart@xxxxxxxxx> wrote:

BS> I was looking at fs/reiserfs/inode.c, and I noticed that the functions
BS> sd_attrs_to_i_attrs and i_attrs_to_sd_attrs are not exact inverses:
BS> i_attrs_to_sd_attrs doesn't convert the S_APPEND flag to
BS> REISERFS_APPEND_FL, but sd_attrs_to_i_attrs does convert
BS> REISERFS_APPEND_FL to S_APPEND. I was wondering, is this intentional?

Indeed this is a mistake.
Everything was still working as expected because i_attrs_to_sd_attrs cannot
change anything these days, since the only way to change inode attributes is
through special ioctl, that directly assigns passed flags value to i_attrs
field of reiserfs specific part of inode.

For the sakr of correctness and also in case there would be another path
to change file attrubutes besides the ioctl, this patch below is needed
for both 2.4 and 2.6
Thank you very much.

Bye,
Oleg

===== fs/reiserfs/inode.c 1.87 vs edited =====
--- 1.87/fs/reiserfs/inode.c Mon Jan 19 08:22:24 2004
+++ edited/fs/reiserfs/inode.c Sun Feb 8 19:41:43 2004
@@ -2317,6 +2317,11 @@
*sd_attrs |= REISERFS_IMMUTABLE_FL;
else
*sd_attrs &= ~REISERFS_IMMUTABLE_FL;
+ if( inode -> i_flags & S_APPEND )
+ *sd_attrs |= REISERFS_APPEND_FL;
+ else
+ *sd_attrs &= ~REISERFS_APPEND_FL;
+
if( inode -> i_flags & S_SYNC )
*sd_attrs |= REISERFS_SYNC_FL;
else

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/