Skip to contentSkip to conversation

Problem - reiser4(2004.08.13), apache(2.0.50) and "AllowOverride All"

DISCUSSION Andreas Sundstrom 6 participants 8 messages Aug 24, 2004 – Aug 25, 2004

lore
Share & tools
lore
#0 lore raw

If I enable "AllowOverride All" in apache it can no longer serve files from reiser4 filesystems.

Here's an error from apache:

(13)Permission denied: /var/www/htdocs/valid-xhtml11.png/.htaccess pcfg_openfile: unable to check htaccess file, ensure it is readable, referer: http://zappa.cx/

Some info about the file:

sunkan@zappa:~$ ls -il /var/www/htdocs/valid-xhtml11.png
72832 -rw-r--r--  1 root root 1917 Sep 14  2001 /var/www/htdocs/valid-xhtml11.png
sunkan@zappa:~$ file /var/www/htdocs/valid-xhtml11.png
/var/www/htdocs/valid-xhtml11.png: PNG image data, 88 x 31, 8-bit colormap, non-interlaced

I found this post to be interesting:
http://marc.theaimsgroup.com/?l=reiserfs&m=109114584717552&w=2

I used this patch to get reiser4 support in my kernel:
http://linux.mjh.name/kernel/patches/reiser4/2004.08.13_2.6.8.1/

So I'm running vanilla 2.6.8.1 except for reiser4.

sunkan@zappa:~/kernel/linux-2.6.8.1-reiser4$ grep REISER .config
CONFIG_REISER4_FS=y
CONFIG_REISER4_LARGE_KEY=y
# CONFIG_REISER4_CHECK is not set
CONFIG_REISERFS_FS=y
# CONFIG_REISERFS_CHECK is not set
# CONFIG_REISERFS_PROC_INFO is not set
CONFIG_REISERFS_FS_XATTR=y
CONFIG_REISERFS_FS_POSIX_ACL=y
# CONFIG_REISERFS_FS_SECURITY is not set
sunkan@zappa:~/kernel/linux-2.6.8.1-reiser4$ grep 4KSTACK .config
# CONFIG_4KSTACKS is not set

My guess is that apache tries to open every file as an directory and if that works it checks wether an .htaccess file is present but that fails in my case beacause it isn't an directory but a file.

Who's to blame? ;)

Let me know if I need to gather more information about this.

I'm currently not on the list so please CC me if you want fast responses. (otherwise I read the archives)

Thanks for any help..
/Andreas Sundstrom

#1 lore raw

Thanks, I think you just diagnosed one of our support requests. flx, can you write and send in a patch to the apache maintainers? (Zam has a huge backlog of tasks....) Zam, can you send the support requestor this diagnosis?

So, we now have 0 bug reports resulting from going into -mm.

Could be that we ask to go into it next week.....:)

Hans

Quoted 51 lines · Andreas Sundstrom

If I enable "AllowOverride All" in apache it can no longer serve files from reiser4 filesystems.

Here's an error from apache:

(13)Permission denied: /var/www/htdocs/valid-xhtml11.png/.htaccess pcfg_openfile: unable to check htaccess file, ensure it is readable, referer: http://zappa.cx/

Some info about the file:

sunkan@zappa:~$ ls -il /var/www/htdocs/valid-xhtml11.png
72832 -rw-r--r--  1 root root 1917 Sep 14  2001 /var/www/htdocs/valid-xhtml11.png
sunkan@zappa:~$ file /var/www/htdocs/valid-xhtml11.png
/var/www/htdocs/valid-xhtml11.png: PNG image data, 88 x 31, 8-bit colormap, non-interlaced

I found this post to be interesting:
http://marc.theaimsgroup.com/?l=reiserfs&m=109114584717552&w=2

I used this patch to get reiser4 support in my kernel:
http://linux.mjh.name/kernel/patches/reiser4/2004.08.13_2.6.8.1/

So I'm running vanilla 2.6.8.1 except for reiser4.

sunkan@zappa:~/kernel/linux-2.6.8.1-reiser4$ grep REISER .config
CONFIG_REISER4_FS=y
CONFIG_REISER4_LARGE_KEY=y
# CONFIG_REISER4_CHECK is not set
CONFIG_REISERFS_FS=y
# CONFIG_REISERFS_CHECK is not set
# CONFIG_REISERFS_PROC_INFO is not set
CONFIG_REISERFS_FS_XATTR=y
CONFIG_REISERFS_FS_POSIX_ACL=y
# CONFIG_REISERFS_FS_SECURITY is not set
sunkan@zappa:~/kernel/linux-2.6.8.1-reiser4$ grep 4KSTACK .config
# CONFIG_4KSTACKS is not set

My guess is that apache tries to open every file as an directory and if that works it checks wether an .htaccess file is present but that fails in my case beacause it isn't an directory but a file.

Who's to blame? ;)

Let me know if I need to gather more information about this.

I'm currently not on the list so please CC me if you want fast responses. (otherwise I read the archives)

Thanks for any help..
/Andreas Sundstrom

#2 lore raw
Quoted 1 line · Hans Reiser

Thanks, I think you just diagnosed one of our support requests. flx, can

Great, it's always nice to be able to help out in some way ;)

Quoted 1 line

you write and send in a patch to the apache maintainers? (Zam has a

If a patch is created I would very much like to get hold of it so I can revert to my normal setup on apache.

Quoted 60 lines

huge backlog of tasks....) Zam, can you send the support requestor this diagnosis?

So, we now have 0 bug reports resulting from going into -mm. Could be that we ask to go into it next week.....:)

Hans

Quoted 51 lines · Andreas Sundstrom

If I enable "AllowOverride All" in apache it can no longer serve files from reiser4 filesystems.

Here's an error from apache:

(13)Permission denied: /var/www/htdocs/valid-xhtml11.png/.htaccess pcfg_openfile: unable to check htaccess file, ensure it is readable, referer: http://zappa.cx/

Some info about the file:

sunkan@zappa:~$ ls -il /var/www/htdocs/valid-xhtml11.png
72832 -rw-r--r--  1 root root 1917 Sep 14  2001 /var/www/htdocs/valid-xhtml11.png
sunkan@zappa:~$ file /var/www/htdocs/valid-xhtml11.png
/var/www/htdocs/valid-xhtml11.png: PNG image data, 88 x 31, 8-bit colormap, non-interlaced

I found this post to be interesting:
http://marc.theaimsgroup.com/?l=reiserfs&m=109114584717552&w=2

I used this patch to get reiser4 support in my kernel:
http://linux.mjh.name/kernel/patches/reiser4/2004.08.13_2.6.8.1/

So I'm running vanilla 2.6.8.1 except for reiser4.

sunkan@zappa:~/kernel/linux-2.6.8.1-reiser4$ grep REISER .config
CONFIG_REISER4_FS=y
CONFIG_REISER4_LARGE_KEY=y
# CONFIG_REISER4_CHECK is not set
CONFIG_REISERFS_FS=y
# CONFIG_REISERFS_CHECK is not set
# CONFIG_REISERFS_PROC_INFO is not set
CONFIG_REISERFS_FS_XATTR=y
CONFIG_REISERFS_FS_POSIX_ACL=y
# CONFIG_REISERFS_FS_SECURITY is not set
sunkan@zappa:~/kernel/linux-2.6.8.1-reiser4$ grep 4KSTACK .config
# CONFIG_4KSTACKS is not set

My guess is that apache tries to open every file as an directory and if that works it checks wether an .htaccess file is present but that fails in my case beacause it isn't an directory but a file.

Who's to blame? ;)

Let me know if I need to gather more information about this.

I'm currently not on the list so please CC me if you want fast responses. (otherwise I read the archives)

Thanks for any help..
/Andreas Sundstrom

#3 lore raw
In reply to Andreas Sundstrom

Am Dienstag, den 24.08.2004, 18:51 +0200 schrieb Andreas Sundstrom:

Quoted 7 lines

If I enable "AllowOverride All" in apache it can no longer serve files from reiser4 filesystems.

Here's an error from apache:

(13)Permission denied: /var/www/htdocs/valid-xhtml11.png/.htaccess pcfg_openfile: unable to check htaccess file, ensure it is readable, referer: http://zappa.cx/

Well, this as a ENOTDIR vs. EPERM problem.

Apache2 expects the filesystem to return ENOTDIR when it tries to access some_file/.htaccess. reiser4 returns EPERM and apache2 thinks that some_file is actually a directory but doesn't have permissions to access that directory.

#4 lore raw

Am Dienstag, den 24.08.2004, 20:43 +0200 schrieb Christophe Saout:

Quoted 1 line

Well, this as a ENOTDIR vs. EPERM problem.

Sorry, this was already known. My current apache 2.0.50 seems to call lstat first though. Perhaps this is already solved? Because I noticed apache2 doing this while stracing processes for fun on a machine not running Reiser4 some time ago.

But to make sure nothing goes wrong Apache should not use ENOTDIR at all or at least have some workaround that calls stat on a file if it returns EPERM to make sure... (ugly?).

#5 lore raw
Quoted 2 lines · Christophe Saout

Sorry, this was already known. My current apache 2.0.50 seems to call lstat first though.

Note that doing an lstat first still has a race condition.....

#6 lore raw
In reply to Christophe Saout
Quoted 10 lines · Christophe Saout

Am Dienstag, den 24.08.2004, 18:51 +0200 schrieb Andreas Sundstrom:

Quoted 7 lines

If I enable "AllowOverride All" in apache it can no longer serve files from reiser4 filesystems.

Here's an error from apache:

(13)Permission denied: /var/www/htdocs/valid-xhtml11.png/.htaccess pcfg_openfile: unable to check htaccess file, ensure it is readable, referer: http://zappa.cx/

Quoted 6 lines

Well, this as a ENOTDIR vs. EPERM problem.

Apache2 expects the filesystem to return ENOTDIR when it tries to access some_file/.htaccess. reiser4 returns EPERM and apache2 thinks that some_file is actually a directory but doesn't have permissions to access that directory.

yes. exactly. It is strange that reiser4 passes -ENOTDIR to upper levels in that case.

Signature · 1 line
Alex.
#7 lore raw
Quoted 13 lines · Alex Zarochentsev
Quoted 12 lines · Christophe Saout

Am Dienstag, den 24.08.2004, 18:51 +0200 schrieb Andreas Sundstrom:

Quoted 7 lines

If I enable "AllowOverride All" in apache it can no longer serve files from reiser4 filesystems.

Here's an error from apache:

(13)Permission denied: /var/www/htdocs/valid-xhtml11.png/.htaccess pcfg_openfile: unable to check htaccess file, ensure it is readable, referer: http://zappa.cx/

Well, this as a ENOTDIR vs. EPERM problem.

Quoted 7 lines
Quoted 4 lines

Apache2 expects the filesystem to return ENOTDIR when it tries to access some_file/.htaccess. reiser4 returns EPERM and apache2 thinks that some_file is actually a directory but doesn't have permissions to access that directory.

yes. exactly. It is strange that reiser4 passes -ENOTDIR to upper levels in that case.

Actual problem is that open(path, O_DIRECTORY) always succeeds in reiser4, see fs/namei.c:

		if (lookup_flags & LOOKUP_DIRECTORY) {
			err = -ENOTDIR; 
			if (!inode->i_op || !inode->i_op->lookup)
				break;
		}

so all applications using this flag to check whether file is directory or not are bound to fail.

In this case, apache calls

    open("/var/www/htdocs/valid-xhtml11.png", O_DIRECTORY)

it returns without error, so apache thinks that valid-xhtml11.png is a directory and proceeds with accessing .htaccess file in it.

Quoted 3 lines
Signature · 2 lines
-- 
Alex.

Nikita.