public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* Reiserfs flags question
@ 2004-02-01 17:59 Bart Samwel
  2004-02-08 17:57 ` Oleg Drokin
  0 siblings, 1 reply; 2+ messages in thread
From: Bart Samwel @ 2004-02-01 17:59 UTC (permalink / raw)
  To: linux-kernel; +Cc: reiser

Hi everyone,

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

--Bart

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: Reiserfs flags question
  2004-02-01 17:59 Reiserfs flags question Bart Samwel
@ 2004-02-08 17:57 ` Oleg Drokin
  0 siblings, 0 replies; 2+ messages in thread
From: Oleg Drokin @ 2004-02-08 17:57 UTC (permalink / raw)
  To: linux-kernel, bart, nikita

Hello!

Bart Samwel <bart@samwel.tk> 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


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2004-02-08 17:57 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-02-01 17:59 Reiserfs flags question Bart Samwel
2004-02-08 17:57 ` Oleg Drokin

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox