public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* Re: kernel-2.6.16-rc2-git8 - reiserfs - write problem !!!
@ 2006-02-12  7:56 art
  2006-02-12 16:28 ` Jeff Mahoney
  2006-02-12 17:52 ` Jeff Mahoney
  0 siblings, 2 replies; 3+ messages in thread
From: art @ 2006-02-12  7:56 UTC (permalink / raw)
  To: linux-kernel; +Cc: jeffm

FROM:   	   	
Jeffrey Mahoney <jeffm@suse.com> | Save Address
DATE: 	  	Sat, 11 Feb 2006 16:58:20 -0500
TO: 	  	<art@usfltd.com>  
SUBJECT: 	  	Re: kernel-2.6.16-rc2-git8 - reiserfs 3.6 - write problem !!!
  	
  	art wrote:
> kernel-2.6.16-rc2-git8 - reiserfs - write problem !!!
>
> it started ~from kernel-2.6.16-rc2
> 2.6.16-rc1-git6 works ok
>
> with 2.6.16-rc2-git8
> --reiserfs is 3.6 on ide hdd mounted on /mnt on scsi-hdd with ext3 on it--
> mount
> /dev/hda1 on /mnt/mountpoint-reiserfs type reiserfs (rw)
> /dev/sdb1 on /mnt/mountpoint-ext3 type ext3 (rw)
>
> [bebe@localhost mnt]$ ls -l -Z
> drwxr-xr-x root root system_u:object_r:file_t mountpoint-ext3
> drwxr-xr-x root root system_u:object_r:file_t mountpoint-reiserfs
>
> [root@localhost mountpoint-ext3]# ls -Z
> drwxrwxrwx root root root:object_r:file_t abc
> drwxr-xr-x bebe bebe root:object_r:file_t def
> drwx------  root root system_u:object_r:file_t lost+found
>
> [root@localhost mountpoint-reiserfs]# ls -Z
> drwxr-xr--  bebe bebe system_u:object_r:file_t abc
> drwxr-xr-x  root root system_u:object_r:file_t def
>
> [bebe@localhost abc]$ su
> Password:
> [root@localhost abc]# ls >xxxxxx
> bash: xxxxxx: Permission denied
> [root@localhost abc]#
>
> same in targeted and permissive mode in selinux
>
> up to 2.6.16-rc1-git6 it works OK

Can you post the output of 'lsattr <dir>' where you get permission
denied? Also, please include any relevant dmesg output as well.

-Jeff
------------------------------------

mount /dev/hda1 /mnt/mountpoint-reiserfs
mount /dev/sdb1 /mnt/mountpoint-ext3

kernel-2.6.16-rc1-git6     OK

[bebe@localhost ~]$ cd /mnt
[bebe@localhost mnt]$ lsattr
------------- ./mountpoint-ext3
lsattr: Inappropriate ioctl for device While reading flags on ./mountpoint-reiserfs
[bebe@localhost mnt]$

[bebe@localhost mnt]$ cd  mountpoint-reiserfs
[bebe@localhost mountpoint-reiserfs]$ lsattr
lsattr: Inappropriate ioctl for device While reading flags on ./v
lsattr: Inappropriate ioctl for device While reading flags on ./tmp

[bebe@localhost mountpoint-reiserfs]$

kernel-2.6.16-rc1-git6     OK

-----------------------------------

kernel-2.6.16-rc2-git9     BAD

[bebe@localhost ~]$ cd /mnt
[bebe@localhost mnt]$ lsattr
------------- ./mountpoint-ext3
su---ad-cjI-- ./mountpoint-reiserfs

[bebe@localhost mnt]$ cd mountpoint-reiserfs
[bebe@localhost mountpoint-reiserfs]$ lsattr
s-S-i-dAc--t- ./v
s-S-i-dAc--t- ./tmp

kernel-2.6.16-rc2-git9     BAD

looks like system automaticly sets attribs mounting reiserfs

"A file with the `i' attribute cannot be modified: it cannot be deleted or renamed, no link can be created to this file and no data can be written to the file. Only the superuser or a process possessing the CAP_LINUX_IMMUTABLE capability can set or clear this attribute."

"A file with the `a' attribute set can only be open in append mode for writing. Only the superuser or a process possessing the CAP_LINUX_IMMUTABLE capability can set or clear this attribute."

xboom


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

* Re: kernel-2.6.16-rc2-git8 - reiserfs - write problem !!!
  2006-02-12  7:56 kernel-2.6.16-rc2-git8 - reiserfs - write problem !!! art
@ 2006-02-12 16:28 ` Jeff Mahoney
  2006-02-12 17:52 ` Jeff Mahoney
  1 sibling, 0 replies; 3+ messages in thread
From: Jeff Mahoney @ 2006-02-12 16:28 UTC (permalink / raw)
  To: art; +Cc: linux-kernel, Chris Mason, Hans Reiser, Andrew Morton

[-- Attachment #1: Type: text/plain, Size: 1194 bytes --]

On Sun, Feb 12, 2006 at 01:56:52AM -0600, art wrote:
> kernel-2.6.16-rc2-git9     BAD
> 
> looks like system automaticly sets attribs mounting reiserfs
> 
> "A file with the `i' attribute cannot be modified: it cannot be deleted or renamed, no link can be created to this file and no data can be written to the file. Only the superuser or a process possessing the CAP_LINUX_IMMUTABLE capability can set or clear this attribute."
> 
> "A file with the `a' attribute set can only be open in append mode for writing. Only the superuser or a process possessing the CAP_LINUX_IMMUTABLE capability can set or clear this attribute."

Ok. That's what I was afraid of. If this isn't your root file system, you
can clear the attributes with reiserfsck --clean-attributes <device>, and
it will fix the problem.

Unfortunately, this is hardly a solution, since this is a change that causes
unexpected and unpredictable results on file systems in use.

Andrew -

Since the attr-bits-cleared bit can't be trusted, I don't think we'll ever be
able to enable reiserfs inode attrs by default. I'll send a patch separately
to back out this behavior.

-Jeff

-- 
Jeff Mahoney
SuSE Labs

[-- Attachment #2: Type: application/pgp-signature, Size: 189 bytes --]

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

* Re: kernel-2.6.16-rc2-git8 - reiserfs - write problem !!!
  2006-02-12  7:56 kernel-2.6.16-rc2-git8 - reiserfs - write problem !!! art
  2006-02-12 16:28 ` Jeff Mahoney
@ 2006-02-12 17:52 ` Jeff Mahoney
  1 sibling, 0 replies; 3+ messages in thread
From: Jeff Mahoney @ 2006-02-12 17:52 UTC (permalink / raw)
  To: art; +Cc: linux-kernel, ReiserFS List


[-- Attachment #1.1: Type: text/plain, Size: 1331 bytes --]

On Sun, Feb 12, 2006 at 01:56:52AM -0600, art wrote:
> FROM:   	   	
> Jeffrey Mahoney <jeffm@suse.com> | Save Address
> DATE: 	  	Sat, 11 Feb 2006 16:58:20 -0500
> TO: 	  	<art@usfltd.com>  
> SUBJECT: 	  	Re: kernel-2.6.16-rc2-git8 - reiserfs 3.6 - write problem !!!
>   	
>   	art wrote:
> > kernel-2.6.16-rc2-git8 - reiserfs - write problem !!!
> >
> > it started ~from kernel-2.6.16-rc2
> > 2.6.16-rc1-git6 works ok

art -

One more followup question. Was the file system you're using converted from a
v3.5 file system, or has it always been v3.6?

Sergey Vlasov on the reiserfs list noticed that v3.5 objects never had
REISERFS_I(inode)->i_attrs set, which means that even on a converted v3.6
file system, objects created underneath a v3.5-created directory would
inherit random attrs bits.

I have a patch that adds an additional check to see if the file system has
always been v3.6 - just by checking the version of the stat data on the root
directory.

If you haven't already run reiserfsck --clean attributes, can you give the
patch a try? Don't mount with -oattrs, since we already know the attributes
are corrupt. I just want to test and see if the file system you've got is
converted from a v3.5 file system and if it fixes the problem.

Thanks.

-Jeff
-- 
Jeff Mahoney
SuSE Labs

[-- Attachment #1.2: reiserfs-attrs-test-fix.diff --]
[-- Type: text/plain, Size: 1403 bytes --]

diff -ruNpX dontdiff linux-2.6.15/fs/reiserfs/inode.c linux-2.6.15-reiserfs/fs/reiserfs/inode.c
--- linux-2.6.15/fs/reiserfs/inode.c	2006-02-06 19:54:10.000000000 -0500
+++ linux-2.6.15-reiserfs/fs/reiserfs/inode.c	2006-02-12 12:43:00.000000000 -0500
@@ -1195,6 +1195,7 @@ static void init_inode(struct inode *ino
 		/* nopack is initially zero for v1 objects. For v2 objects,
 		   nopack is initialised from sd_attrs */
 		REISERFS_I(inode)->i_flags &= ~i_nopack_mask;
+		REISERFS_I(inode)->i_attrs = 0;
 	} else {
 		// new stat data found, but object may have old items
 		// (directories and symlinks)
diff -ruNpX dontdiff linux-2.6.15/fs/reiserfs/super.c linux-2.6.15-reiserfs/fs/reiserfs/super.c
--- linux-2.6.15/fs/reiserfs/super.c	2006-02-06 19:54:27.000000000 -0500
+++ linux-2.6.15-reiserfs/fs/reiserfs/super.c	2006-02-12 12:48:41.000000000 -0500
@@ -1121,7 +1121,9 @@ static void handle_attrs(struct super_bl
 					 "reiserfs: cannot support attributes until flag is set in super-block");
 			REISERFS_SB(s)->s_mount_opt &= ~(1 << REISERFS_ATTRS);
 		}
-	} else if (le32_to_cpu(rs->s_flags) & reiserfs_attrs_cleared) {
+	} else if (le32_to_cpu(rs->s_flags) & reiserfs_attrs_cleared &&
+	           get_inode_item_key_version(s->s_root->d_inode) == KEY_FORMAT_3_6) {
+		/* Enable attrs by default on v3.6-native file systems */
 		REISERFS_SB(s)->s_mount_opt |= (1 << REISERFS_ATTRS);
 	}
 }

[-- Attachment #2: Type: application/pgp-signature, Size: 189 bytes --]

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

end of thread, other threads:[~2006-02-12 17:52 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-02-12  7:56 kernel-2.6.16-rc2-git8 - reiserfs - write problem !!! art
2006-02-12 16:28 ` Jeff Mahoney
2006-02-12 17:52 ` Jeff Mahoney

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