Lino Sanfilippo | 21 Apr 2009 17:39
Favicon

patch 1 for dazukofs release 3.0.0


Hi all,

this is the first patch of a series of patches that fixes some bugs, 
that I encountered while
testing dazukofs on various platforms. Please apply the patches 
consecutively.
I will do a short description for each bug:

Bug description:
On 32 Bit systems large file support may not be enabled. This prevents 
processes from opening
files larger than 4 GB.
This may cause a failure of the dentry_open() function which is used by 
dazukofs to get a
file descriptor for an accessed file.
This failure results in the file accessing process hanging infinitely 
while the dazukofs kernel code
tries to get an open file descriptor again and again, always failing due 
to the file size limits.
The solution is to open the file explicitly with large file support 
enabled by setting the
O_LARGEFILE flag.

Geschäftsführender Gesellschafter: Tjark Auerbach
Sitz der Gesellschaft: Tettnang
Handelsregister: Amtsgericht Ulm, HRB 630992
ALLGEMEINE GESCHÄFTSBEDINGUNGEN
Es gelten unsere Allgemeinen Geschäftsbedingungen
(AGB). Sie finden sie in der jeweils gültigen Fassung
(Continue reading)

Lino Sanfilippo | 21 Apr 2009 18:18
Favicon

patch 2 for dazukofs release 3.0.0


Bug description:
dazukofs uses the generic_file_mmap() function provided by the linux 
kernel api
to handle memory mapping. This function in turn calls the 
dazukofs_readpage()
provided by dazuko.
dazukofs_readpage() calls the readpage() operation of the address_space 
object of the
underlaying filesystems inodes. But the underlaying filesystem might not 
have initialized
this struct to provide a readpage() function (since not all filesystems 
provide memory mapping
for certain file types, i.e. directories). In this case the readpage() 
function of the address_space
object is set to NULL, resulting in an oops when dazukofs tries to call it.

The solution is not to use the generic function(s), but to provide an 
own function,
that calls the underlaying filesystems function only if it is defined.

Similar problems may occur with the generic_file_aio_read() and 
generic_file_aio_write() functions
used by dazukofs, so they have been removed, too.

Geschäftsführender Gesellschafter: Tjark Auerbach
Sitz der Gesellschaft: Tettnang
Handelsregister: Amtsgericht Ulm, HRB 630992
ALLGEMEINE GESCHÄFTSBEDINGUNGEN
Es gelten unsere Allgemeinen Geschäftsbedingungen
(Continue reading)

Lino Sanfilippo | 21 Apr 2009 18:53
Favicon

patch 3 for dazukofs release 3.0.0


Bug description:
If the setuid bit of a file that resided within a dazukofs mount (over 
an ext3fs) was set
and the file was accessed afterwards a kernel oops appeared.
The reason seemed to be the following:

The dazukofs_setxattr() function sets the attributes of an underlaying 
filesystems inode
by calling the notify_change() function provided by the vfs kernel code 
(I assume this is
done to let the vfs take some default actions in case that the 
setxattr() function
is not defined for this inode).
The problem is, that the vfs apparently modifies the given attributes in 
some way
and under some circumstances, before they reach the dazukofs code.

Since the vfs has already passed the attributes to the dazukofs kernel 
after possibly
modifying the attributes _once_, the  call back to notify_change() might 
trigger a _second_
modification (or influence the further processing in some other way) 
which may result
in the attempt to set invalid values for the inodes attributes.

I think it is quite dangerous to jump back from the dazukofs kernel code 
to a higher
vfs level, anyway, since we can never be sure that the vfs code does not 
modify
(Continue reading)

Lino Sanfilippo | 21 Apr 2009 19:01
Favicon

patch 4 for dazukofs release 3.0.0


Bug description:
The attempt to mount dazukofs over a regular file results in a kernel oops.

The solution is to ensure that the mount point is a directory.
(This is a repost of the patch posted on the 9th Feb. 2009. It is only
posted for the sake of completeness.)

Geschäftsführender Gesellschafter: Tjark Auerbach
Sitz der Gesellschaft: Tettnang
Handelsregister: Amtsgericht Ulm, HRB 630992
ALLGEMEINE GESCHÄFTSBEDINGUNGEN
Es gelten unsere Allgemeinen Geschäftsbedingungen
(AGB). Sie finden sie in der jeweils gültigen Fassung
im Internet unter http://www.avira.de/agb
***************************************************
diff -rup dazukofs-3.0.0-p3/super.c dazukofs-3.0.0-p4/super.c
--- dazukofs-3.0.0-p3/super.c	2009-03-15 18:24:16.000000000 +0100
+++ dazukofs-3.0.0-p4/super.c	2009-03-15 19:23:58.000000000 +0100
 <at>  <at>  -171,6 +171,11  <at>  <at>  static int dazukofs_read_super(struct su
 		goto out_put;
 	}

+	if (!S_ISDIR(lower_root->d_inode->i_mode)) {
+		err = -ENOENT;
+		goto out_put;
+	}
+
 	SET_LOWER_SB(sb, lower_root->d_sb);
(Continue reading)

Lino Sanfilippo | 21 Apr 2009 19:16
Favicon

patch 5 for dazukofs release 3.0.0


This patch is not a bug fix, but useful to increase performance:

dazukofs reports open events for all kind of files. But this does
mainly make sense for regular files (who wants to check
fifos for malware?).
Thus a simple check ensures that only open events for regular
files are announced to userspace.

(On my system a simple "find" command executed in /usr which was
mounted with dazukofs resulted in over 90000 context switches -
only caused by opening directories..)

Geschäftsführender Gesellschafter: Tjark Auerbach
Sitz der Gesellschaft: Tettnang
Handelsregister: Amtsgericht Ulm, HRB 630992
ALLGEMEINE GESCHÄFTSBEDINGUNGEN
Es gelten unsere Allgemeinen Geschäftsbedingungen
(AGB). Sie finden sie in der jeweils gültigen Fassung
im Internet unter http://www.avira.de/agb
***************************************************
diff -rup dazukofs-3.0.0-p4/file.c dazukofs-3.0.0-p5/file.c
--- dazukofs-3.0.0-p4/file.c	2009-03-15 19:07:06.000000000 +0100
+++ dazukofs-3.0.0-p5/file.c	2009-03-15 19:26:14.000000000 +0100
 <at>  <at>  -177,9 +177,11  <at>  <at>  static int dazukofs_open(struct inode *i
 	struct file *lower_file;
 	int err;

-	err = dazukofs_check_access(file->f_dentry, file->f_vfsmnt);
(Continue reading)

Lino Sanfilippo | 22 Apr 2009 15:33
Favicon

patch 6 for dazukofs release 3.0.0


This bug occured with dazukofs mounted over a reiserfs on a system with
SLES 10.

Bug description:
Under some circumstances dazukofs inodes (instead of the lower inodes)
are marked as dirty. If the pdflush daemon is woken up it tries to write 
these
inodes physically to disk. To do so, the writepages() function of the 
dazukofs
inodes address_space object is called. Since this function does not exist
(it is set to NULL), the attempt to call it results in a kernel oops.

So why are the dazukofs inodes marked dirty instead of the lower inodes?
I could not find out the exact reason, but it definitely happens if
generic_commit_write() is called (which in turn is called by 
generic_file_write()
which i.e is used by reiserfs to write inodes to disk).
The generic_commit_write() function uses the inode that belongs to the page
that has to be written. For some reason some pages seem to be connected to
dazukofs inodes instead of the inodes of the lower filesystem.

Anyway, the solution is to tell the kernel not to mark dazukofs inodes
as dirty. This is done by using a backing_dev_info object with
writeback capabilities explicitly disabled.

Geschäftsführender Gesellschafter: Tjark Auerbach
Sitz der Gesellschaft: Tettnang
Handelsregister: Amtsgericht Ulm, HRB 630992
ALLGEMEINE GESCHÄFTSBEDINGUNGEN
(Continue reading)

Lino Sanfilippo | 22 Apr 2009 16:22
Favicon

patch 7 for dazukofs release 3.0.0


Bug description:
Dazukofs returns the -EINTR error code for the open() system call
if a signal is received during the file access check performed by dazuko.

This behaviour is not correct, since -EINTR is no error code that 
applications
or even the glibc would ever expect from an open() call. Thus signal 
interruption
should not be a reason for an open() to fail.

To avoid returning an error code that might not be handled properly by the
recipient, the file accessing process now waits uninterruptibly within the
dazukofs code.

This patch also exchanges freezable waits into interruptible ones, to 
avoid the bug
reported by Frantisek Hrbata (post from 27. Feb. 2009).

Geschäftsführender Gesellschafter: Tjark Auerbach
Sitz der Gesellschaft: Tettnang
Handelsregister: Amtsgericht Ulm, HRB 630992
ALLGEMEINE GESCHÄFTSBEDINGUNGEN
Es gelten unsere Allgemeinen Geschäftsbedingungen
(AGB). Sie finden sie in der jeweils gültigen Fassung
im Internet unter http://www.avira.de/agb
***************************************************
diff -rup dazukofs-3.0.0-p6/event.c dazukofs-3.0.0-p7/event.c
--- dazukofs-3.0.0-p6/event.c	2009-03-15 19:26:30.000000000 +0100
(Continue reading)

John Ogness | 26 Apr 2009 17:06

Re: patch 7 for dazukofs release 3.0.0

Thank you for the patches. If I apply these to DazukoFS 3.0.0 (to
create a 3.0.1 version), the following patches currently included with
DazukoFS 3.0.0 will no longer apply:

patch-linux-2.6.16
patch-linux-2.6.18
patch-linux-2.6.20
patch-linux-2.6.22
patch-linux-2.6.24
patch-linux-2.6.26
patch-opensuse-11.0
patch-opensuse-11.1
patch-ubuntu-8.10

Should I post a 3.0.1 release candidate with only your patches applied
and without these other patches included?

John

--

-- 
Dazuko Maintainer
Lino Sanfilippo | 27 Apr 2009 11:08
Favicon

Re: Re: patch 7 for dazukofs release 3.0.0

John Ogness schrieb:
> Thank you for the patches. If I apply these to DazukoFS 3.0.0 (to
> create a 3.0.1 version), the following patches currently included with
> DazukoFS 3.0.0 will no longer apply:
>
> patch-linux-2.6.16
> patch-linux-2.6.18
> patch-linux-2.6.20
> patch-linux-2.6.22
> patch-linux-2.6.24
> patch-linux-2.6.26
> patch-opensuse-11.0
> patch-opensuse-11.1
> patch-ubuntu-8.10
>
> Should I post a 3.0.1 release candidate with only your patches applied
> and without these other patches included?
>
> John
>
>   
Hi John,

if you post a new release candidate I suggest to include also the patches
for the other kernel versions. I would like to help you with that:
If you tell me which of the patches I posted you want to include (maybe 
not all of
them make sense to you or are the solution that you would prefer? For 
example patch 5
excludes the notification of non-regular files open events, which might 
(Continue reading)

Lino Sanfilippo | 27 Apr 2009 12:42
Favicon

patch 8 for dazukofs release 3.0.0


Bug description:
If the underlaying filesystem does not implement one or more of the 
inode operations
related to extended attributes(i.e. vfat), dazukofs returns an ENOSYS 
error code. This
seems not to be the proper return value, since it results in ugly 
"function not implemented"
messages on some systems, that use extended attributes related system 
calls (this happens for example
on OpenSuse11.1 systems, every time that an "ls -l" command is executed 
within an dazukofs
that is mounted over vfat).
The  error code set by the vfs layer is indeed -EOPNOTSUPP, if those 
functions are not implemented.
So this patch replaces the ENOSYS with  EOPNOTSUPP error codes to be 
conform to the
vfs behavior.

Geschäftsführender Gesellschafter: Tjark Auerbach
Sitz der Gesellschaft: Tettnang
Handelsregister: Amtsgericht Ulm, HRB 630992
ALLGEMEINE GESCHÄFTSBEDINGUNGEN
Es gelten unsere Allgemeinen Geschäftsbedingungen
(AGB). Sie finden sie in der jeweils gültigen Fassung
im Internet unter http://www.avira.de/agb
***************************************************
diff -rup dazukofs-3.0.0-p7/inode.c dazukofs-3.0.0-p8/inode.c
--- dazukofs-3.0.0-p7/inode.c	2009-04-21 14:37:12.000000000 +0200
(Continue reading)


Gmane