About this list Date view Thread view Subject view Author view Attachment view

From: Sam Vilain (sam_at_vilain.net)
Date: Fri 10 May 2002 - 09:31:18 BST


Justin,

Sorry, I haven't released a patch for this recently.

Once you get the reiserfs inode attributes patch patch (from
ftp://ftp.namesys.com/pub/reiserfs-for-2.4/2.4.18.pending in the case
of 2.4.18, or by using a 2.4.19-preN kernel), then the changes to
allow immutability (assuming you have the ctx10 patch) are fairly
minimal; this patch works for me:

diff -ur linux-2.4.18-ac3-ctx10-reiser-crypto-netdev-preempt/fs/reiserfs/inode.c linux-2.4.18-ac3-ctx10-reiser-crypto-netdev-preempt-C/fs/reiserfs/inode.c
--- linux-2.4.18-ac3-ctx10-reiser-crypto-netdev-preempt/fs/reiserfs/inode.c Tue Apr 23 16:49:34 2002
+++ linux-2.4.18-ac3-ctx10-reiser-crypto-netdev-preempt-C/fs/reiserfs/inode.c Tue Apr 23 18:28:34 2002
@@ -1587,7 +1587,7 @@
 
     /* symlink cannot be immutable or append only, right? */
     if( S_ISLNK( inode -> i_mode ) )
- inode -> i_flags &= ~ ( S_IMMUTABLE | S_APPEND );
+ inode -> i_flags &= ~ ( S_IMMUTABLE_FILE | S_APPEND );
 
     inode->i_mtime = inode->i_atime = inode->i_ctime = CURRENT_TIME;
     inode->i_size = i_size;
@@ -2124,10 +2124,14 @@
                         inode -> i_flags |= S_SYNC;
                 else
                         inode -> i_flags &= ~S_SYNC;
- if( sd_attrs & REISERFS_IMMUTABLE_FL )
- inode -> i_flags |= S_IMMUTABLE;
+ if( sd_attrs & REISERFS_IMMUTABLE_FILE_FL )
+ inode -> i_flags |= S_IMMUTABLE_FILE;
                 else
- inode -> i_flags &= ~S_IMMUTABLE;
+ inode -> i_flags &= ~S_IMMUTABLE_FILE;
+ if( sd_attrs & REISERFS_IMMUTABLE_LINK_FL )
+ inode -> i_flags |= S_IMMUTABLE_LINK;
+ else
+ inode -> i_flags &= ~S_IMMUTABLE_LINK;
                 if( sd_attrs & REISERFS_NOATIME_FL )
                         inode -> i_flags |= S_NOATIME;
                 else
@@ -2142,10 +2146,14 @@
 void i_attrs_to_sd_attrs( struct inode *inode, __u16 *sd_attrs )
 {
         if( reiserfs_attrs( inode -> i_sb ) ) {
- if( inode -> i_flags & S_IMMUTABLE )
- *sd_attrs |= REISERFS_IMMUTABLE_FL;
+ if( inode -> i_flags & S_IMMUTABLE_FILE )
+ *sd_attrs |= REISERFS_IMMUTABLE_FILE_FL;
+ else
+ *sd_attrs &= ~REISERFS_IMMUTABLE_FILE_FL;
+ if( inode -> i_flags & S_IMMUTABLE_LINK )
+ *sd_attrs |= REISERFS_IMMUTABLE_LINK_FL;
                 else
- *sd_attrs &= ~REISERFS_IMMUTABLE_FL;
+ *sd_attrs &= ~REISERFS_IMMUTABLE_LINK_FL;
                 if( inode -> i_flags & S_SYNC )
                         *sd_attrs |= REISERFS_SYNC_FL;
                 else
diff -ur linux-2.4.18-ac3-ctx10-reiser-crypto-netdev-preempt/fs/reiserfs/ioctl.c linux-2.4.18-ac3-ctx10-reiser-crypto-netdev-preempt-C/fs/reiserfs/ioctl.c
--- linux-2.4.18-ac3-ctx10-reiser-crypto-netdev-preempt/fs/reiserfs/ioctl.c Tue Apr 23 16:49:34 2002
+++ linux-2.4.18-ac3-ctx10-reiser-crypto-netdev-preempt-C/fs/reiserfs/ioctl.c Tue Apr 23 18:29:10 2002
@@ -47,7 +47,7 @@
                 if (get_user(flags, (int *) arg))
                         return -EFAULT;
 
- if ( ( flags & REISERFS_IMMUTABLE_FL ) &&
+ if ( ( flags & REISERFS_IMMUTABLE_FILE_FL ) &&
                      !capable( CAP_LINUX_IMMUTABLE ) )
                         return -EPERM;
                         
diff -ur linux-2.4.18-ac3-ctx10-reiser-crypto-netdev-preempt/include/linux/reiserfs_fs.h linux-2.4.18-ac3-ctx10-reiser-crypto-netdev-preempt-C/include/linux/reiserfs_fs.h
--- linux-2.4.18-ac3-ctx10-reiser-crypto-netdev-preempt/include/linux/reiserfs_fs.h Tue Apr 23 18:09:33 2002
+++ linux-2.4.18-ac3-ctx10-reiser-crypto-netdev-preempt-C/include/linux/reiserfs_fs.h Tue Apr 23 18:26:46 2002
@@ -723,7 +723,8 @@
 
 /* we want common flags to have the same values as in ext2,
    so chattr(1) will work without problems */
-#define REISERFS_IMMUTABLE_FL EXT2_IMMUTABLE_FL
+#define REISERFS_IMMUTABLE_FILE_FL EXT2_IMMUTABLE_FILE_FL
+#define REISERFS_IMMUTABLE_LINK_FL EXT2_IMMUTABLE_LINK_FL
 #define REISERFS_SYNC_FL EXT2_SYNC_FL
 #define REISERFS_NOATIME_FL EXT2_NOATIME_FL
 #define REISERFS_NODUMP_FL EXT2_NODUMP_FL
@@ -739,7 +740,8 @@
 #define REISERFS_NOTAIL_FL (0x00008000) /* EXT2_NOTAIL_FL */
 
 /* persistent flags that file inherits from the parent directory */
-#define REISERFS_INHERIT_MASK ( REISERFS_IMMUTABLE_FL | \
+#define REISERFS_INHERIT_MASK ( REISERFS_IMMUTABLE_FILE_FL | \
+ REISERFS_IMMUTABLE_LINK_FL | \
                                 REISERFS_SYNC_FL | \
                                 REISERFS_NOATIME_FL | \
                                 REISERFS_NODUMP_FL | \

Most of the work is still being done by the immutability macros in the
main ctx10 patch and by the kernel's may_delete() functions, etc.

Assuming that after this patch your kernel compiles (if something is
wrong it will just barf, because I don't define the old XXX_IMMUTABLE
macros - only the XXX_IMMUTABLE_LINK and XXX_IMMUTABLE_FILE pair),
then reiserfs works. I do recommend applying the patch to e2fsprogs,
as then you will have admin visibility of the new inode attribute.

With the out-of-the-box vserver kernel, ext2/3 are fully supported,
but unification with reiserfs needs a patch. This will change when
the ctx patches are based on the 2.4.19 linux kernel release.

Good luck,
Sam.

On Thu, 9 May 2002 11:24:44 -0500
"Justin M Kuntz" <jkuntz_at_prominic.com> wrote:

> Sam --
>
> It seems you are the guru when it comes to ReiserFS support with vserver.
> :) Having a journaling filesystem is of utmost importance to me. So my
> choices are ext3 or ReiserFS. Currently I have several systems running
> ReiserFS on SuSE 7.3 - but none of them are using vserver kernel patches
> (yet?).
>
> I'm installing a new system - Red Hat 7.2 - with ext3 simply because it
> seems like right now vserver is most tested on this platform. But some
> messages I've seen in the mailing list archive have made me unclear on the
> status of which filesystems support _all_ of the vserver features including
> immutable flags and unification.
>
> Back in Nov 2001 this was posted by you:
> http://vserver.vlad.net/list/0066.html
>
> along with this link to why ReiserFS doesn't support extended attributes:
> http://www.namesys.com/stream_ans.html
>
> Has this changed by now (May 9, 2002)? I mean would you consider ReiserFS
> now feature complete in terms of vserver's requirements? How about ext3?
> Based on this message:
> http://vserver.vlad.net/list/0513.html
> it sounded like some of the ext2 attributes had to be mapped to ext3 unused
> bits, which I assume may not be a permanent solution if vserver has to
> officially request those bits to be reserved from the ext3 management team.
> (I have no idea of the actual process of managing filesystem development,
> I'm simply making an assumption about bits needing to be well-known, etc):
>
> Currently I'm using on the Red Hat 7.2 system 2.4.18ctx-10. Is the
> 2.4.19-pre3 kernel the one to be using if I want feature complete ReiserFS
> support for vserver? Or do you still need to build a patch of some kind?
>
> Thanks!
>
> Justin
>
> --------------------------
>
> Excellent, it looks like inode attributes on reiserfs are in the latest
> stable kernel pre-release.
>
>
> I feel another patch coming on...
>
>
> Sam.
>
>
> Begin forwarded message:
>
>
> Date: Tue, 12 Mar 2002 14:40:16 +0300
> From: Oleg Drokin <green_at_namesys.com>
> To: Sam Vilain <sam_at_vilain.net>
> Subject: inode attributes
>
>
> Hello!
>
>
> On Tue, Mar 12, 2002 at 11:20:00AM +0000, Sam Vilain wrote:
>
>
> > btw, nice to see inode attributes back in the "pending" patches. Any
> idea> when this patch will make it into the mainstream kernel?
> It is already.
> Download 2.4.19-pre3 and enjoy.
>
>
> Bye,
>    Oleg
>
>
>
>

--
   Sam Vilain, sam_at_vilain.net     WWW: http://sam.vilain.net/
    7D74 2A09 B2D3 C30F F78E      GPG: http://sam.vilain.net/sam.asc
    278A A425 30A9 05B5 2F13

Hi, I'm a .signature virus! Add me to your ~/.signature, please!


About this list Date view Thread view Subject view Author view Attachment view
[Next/Previous Months] [Main vserver Project Homepage] [Howto Subscribe/Unsubscribe] [Paul Sladen's vserver stuff]
Generated on Wed 06 Nov 2002 - 07:03:40 GMT by hypermail 2.1.3