Reiser4 for 2.6.19
Subsystems (2)
Hi,
There is 10 patches in this series, first one is "Reiser4 for 2.6.18 version 3". It's made up from the last Namesys Reiser4 patch for vanilla kernel
(http://ftp.namesys.com/pub/reiser4-for-2.6/2.6.18/reiser4-for-2.6.18-3.patch.gz),
updated to apply cleanly on top of 2.6.19 kernel. One can alternatively apply the original patch from Namesys (reiser4-for-2.6.18-3.patch.gz) on top of 2.6.19 kernel, it will successfully apply with some oddities.
The 9 next patches are compile-fixes for 2.6.19 or bug-fixes I picked up from reiserfs mailing-list.
Andrew Wade (3):
Reiser4: fix use after free in jrelse_tail
Reiser4: release d_ref
Reiser4: release d_ref (fix)
Edward Shishkin (2):
Reiser4 for 2.6.18 version 3
reiser4-generic_file_read-fixLaurent Riffard (5):
Reiser4: cometics changes in mm/filemap.c.
Reiser4: fix calls to kmem_cache_destroy
Reiser4: Replace inode.u.generic_ip with inode.i_private
Reiser4: inode.i_blksize suppression
Reiser4: remove unnecessary config.h includes.
The whole series is available as in a single patch:
http://laurent.riffard.free.fr/reiser4/reiser4-for-2.6.19.patch.gz.
I'm not a filesystem guru, nor I'm affiliated with Namesys. These patches just suit my needs. It works for me and I hope it will help somebody else.
~~
laurent
PATCH 2/10 Reiser4: cometics changes in mm/filemap.c.
In reply to a message not in the archiveThis patch moves some EXPORT_SYMOLs near the functions definition.
--- mm/filemap.c | 6 +++--- 1 files changed, 3 insertions(+), 3 deletions(-)
mm/filemap.c +3 -3
@@ -467,6 +467,7 @@ int add_to_page_cache_lru(struct page *page, struct address_space *mapping,lru_cache_add (page);return ret; } +EXPORT_SYMBOL (add_to_page_cache_lru);#ifdef CONFIG_NUMA struct page *__page_cache_alloc (gfp_t gfp)
@@ -740,7 +741,7 @@ unsigned find_get_pages(struct address_space *mapping, pgoff_t start,read_unlock_irq (&mapping->tree_lock);return ret; } -EXPORT_SYMBOL (add_to_page_cache_lru); +EXPORT_SYMBOL (find_get_pages);/** * find_get_pages_contig - gang contiguous pagecache lookup
@@ -801,7 +802,7 @@ unsigned find_get_pages_tag(struct address_space *mapping, pgoff_t *index,read_unlock_irq (&mapping->tree_lock);return ret; } -EXPORT_SYMBOL (find_get_pages); +EXPORT_SYMBOL (find_get_pages_tag);/** * grab_cache_page_nowait - returns locked page at given index in given cache
@@ -859,7 +860,6 @@ static void shrink_readahead_size_eio(struct file *filp, ra->ra_pages /=4 ; } -EXPORT_SYMBOL (find_get_pages_tag);/** * do_generic_mapping_read - generic file read routine
Signature · 1 line
1.4.4.1.gaed4
PATCH 6/10 Reiser4: fix calls to kmem_cache_destroy
In reply to a message not in the archiveSince Linux v2.6.19-rc1, kmem_cache_destroy() returns void because there is very little filesystem driver code can do upon failed kmem_cache_destroy().
This patch updates Reiser4 code to reflect this change. BTW, we do not test anymore for null argument since kmem_cache_destroy does this check.
--- fs/reiser4/super_ops.c | 6 +----- 1 files changed, 1 insertions(+), 5 deletions(-)
fs/reiser4/super_ops.c +1 -5
@@ -589,11 +589,7 @@ static struct file_system_type reiser4_fs_type = {void destroy_reiser4_cache (kmem_cache_t **cachep) { -int result; - -BUG_ON (*cachep ==NULL ); - result =kmem_cache_destroy (*cachep); -BUG_ON (result !=0 ); +kmem_cache_destroy (*cachep); *cachep =NULL ; }
Signature · 1 line
1.4.4.1.gaed4
PATCH 7/10 Reiser4: Replace inode.u.generic_ip with inode.i_private
inode.u.generic_ip was replaced with inode.i_private to reduce the size of the VFS inode structure. This patch updates reiser4 code to reflect this change.
--- fs/reiser4/inode.h | 2 +- fs/reiser4/plugin/file/symlink.c | 14 +++++++------- fs/reiser4/plugin/inode_ops.c | 6 +++--- fs/reiser4/plugin/item/static_stat.c | 18 +++++++++--------- 4 files changed, 20 insertions(+), 20 deletions(-)
fs/reiser4/inode.h +1 -1
@@ -41,7 +41,7 @@ typedef enum {REISER4_IMMUTABLE =2 ,/* inode was read from storage */ REISER4_LOADED =3 , -/* this bit is set for symlinks. inode->u.generic_ip points to target +/* this bit is set for symlinks. inode->i_private points to target name of symlink. */ REISER4_GENERIC_PTR_USED = 4,/* set if size of stat-data item for this inode is known. If this is
fs/reiser4/plugin/file/symlink.c +7 -7
@@ -42,8 +42,8 @@ int create_symlink(struct inode *symlink,*/ reiser4_inode_data (symlink)->extmask |= (1 <<SYMLINK_STAT ); -assert ("vs-838" , symlink->u.generic_ip ==NULL ); - symlink->u.generic_ip = (void *)data->name; +assert ("vs-838" , symlink->i_private ==NULL ); + symlink->i_private = (void *)data->name;assert ("vs-843" , symlink->i_size ==0 );INODE_SET_FIELD (symlink, i_size,strlen (data->name));
@@ -51,14 +51,14 @@ int create_symlink(struct inode *symlink,/* insert stat data appended with data->name */ result =inode_file_plugin (symlink)->write_sd_by_inode (symlink);if (result) { -/* FIXME-VS: Make sure that symlink->u.generic_ip is not attached +/* FIXME-VS: Make sure that symlink->i_private is not attached to kmalloced data */ INODE_SET_FIELD (symlink, i_size,0 ); }else { -assert ("vs-849" , symlink->u.generic_ip +assert ("vs-849" , symlink->i_private &&inode_get_flag (symlink,REISER4_GENERIC_PTR_USED ));assert ("vs-850" , - !memcmp ((char *)symlink->u.generic_ip, data->name, + !memcmp ((char *)symlink->i_private, data->name, (size_t ) symlink->i_size +1 )); }return result;
@@ -76,8 +76,8 @@ void destroy_inode_symlink(struct inode *inode)assert ("edward-801" ,inode_get_flag (inode,REISER4_GENERIC_PTR_USED ));assert ("vs-839" ,S_ISLNK (inode->i_mode)); -kfree (inode->u.generic_ip); - inode->u.generic_ip =NULL ; +kfree (inode->i_private); + inode->i_private =NULL ;inode_clr_flag (inode,REISER4_GENERIC_PTR_USED ); }
fs/reiser4/plugin/inode_ops.c +3 -3
@@ -389,16 +389,16 @@ int mknod_common(struct inode *parent, struct dentry *dentry,* * This is common implementation of vfs's followlink method of struct * inode_operations. -* Assumes that inode's generic_ip points to the content of symbolic link. +* Assumes that inode's i_private points to the content of symbolic link. */ void *follow_link_common (struct dentry *dentry,struct nameidata *nd) {assert ("vs-851" ,S_ISLNK (dentry->d_inode->i_mode)); -if (!dentry->d_inode->u.generic_ip +if (!dentry->d_inode->i_private || !inode_get_flag (dentry->d_inode,REISER4_GENERIC_PTR_USED ))return ERR_PTR (RETERR (-EINVAL )); -nd_set_link (nd, dentry->d_inode->u.generic_ip); +nd_set_link (nd, dentry->d_inode->i_private);return NULL ; }
fs/reiser4/plugin/item/static_stat.c +9 -9
@@ -430,21 +430,21 @@ save_large_times_sd(struct inode *inode /* object being processed */ ,/* symlink stat data extension */ -/* allocate memory for symlink target and attach it to inode->u.generic_ip */ +/* allocate memory for symlink target and attach it to inode->i_private */ static int symlink_target_to_inode (struct inode *inode,const char *target,int len) { -assert ("vs-845" , inode->u.generic_ip ==NULL ); +assert ("vs-845" , inode->i_private ==NULL );assert ("vs-846" , !inode_get_flag (inode,REISER4_GENERIC_PTR_USED ));/* FIXME-VS: this is prone to deadlock. Not more than other similar places, though */ - inode->u.generic_ip =kmalloc ((size_t ) len +1 ,get_gfp_mask ()); -if (!inode->u.generic_ip) + inode->i_private =kmalloc ((size_t ) len +1 ,get_gfp_mask ()); +if (!inode->i_private)return RETERR (-ENOMEM ); -memcpy ((char *)(inode->u.generic_ip), target, (size_t ) len); - ((char *)(inode->u.generic_ip))[len] =0 ; +memcpy ((char *)(inode->i_private), target, (size_t ) len); + ((char *)(inode->i_private))[len] =0 ;inode_set_flag (inode,REISER4_GENERIC_PTR_USED );return 0 ; }
@@ -499,8 +499,8 @@ static int save_symlink_sd(struct inode *inode, char **area)if (!inode_get_flag (inode,REISER4_GENERIC_PTR_USED )) {const char *target; - target = (const char *)(inode->u.generic_ip); - inode->u.generic_ip =NULL ; + target = (const char *)(inode->i_private); + inode->i_private =NULL ; result =symlink_target_to_inode (inode, target, length);
@@ -510,7 +510,7 @@ static int save_symlink_sd(struct inode *inode, char **area) }else {/* there is nothing to do in update but move area */ assert ("vs-844" , - !memcmp (inode->u.generic_ip, sd->body, + !memcmp (inode->i_private, sd->body, (size_t ) length +1 )); }
Signature · 1 line
1.4.4.1.gaed4
PATCH 8/10 Reiser4: inode.i_blksize suppression
This patch updates the reiser4 code to reflect the suppression of the inode.i_blksize field (see commit ba52de123d454b57369f291348266d86f4b35070).
--- fs/reiser4/plugin/item/static_stat.c | 2 -- 1 files changed, 0 insertions(+), 2 deletions(-)
fs/reiser4/plugin/item/static_stat.c +0 -2
@@ -168,8 +168,6 @@ int init_inode_static_sd(struct inode *inode /* object being processed */ ,break ; } state->extmask = bigmask; -/* common initialisations */ - inode->i_blksize =get_super_private (inode->i_sb)->optimal_io_size;if (len - (bit /16 *sizeof (d16)) >0 ) {/* alignment in save_len_static_sd() is taken into account -edward */
Signature · 1 line
1.4.4.1.gaed4
PATCH 9/10 Reiser4: remove unnecessary config.h includes.
--- fs/reiser4/plugin/compress/compress.c | 1 - fs/reiser4/reiser4.h | 1 - 2 files changed, 0 insertions(+), 2 deletions(-)
fs/reiser4/plugin/compress/compress.c +0 -1
@@ -6,7 +6,6 @@#include "../plugin.h" #include "minilzo.h" -#include <linux/config.h> #include <linux/zlib.h> #include <linux/types.h> #include <linux/hardirq.h>
fs/reiser4/reiser4.h +0 -1
@@ -6,7 +6,6 @@#if !defined( __REISER4_H__ )#define __REISER4_H__ -#include <linux/config.h> #include <asm/param.h> /* for HZ */ #include <linux/errno.h> #include <linux/types.h>
Signature · 1 line
1.4.4.1.gaed4
PATCH 10/10 reiser4-generic_file_read-fix
From: Edward Shishkin <[email protected]>
Use do_sync_read() instead of generic_file_read()
--- fs/reiser4/plugin/file/cryptcompress.c | 2 +- fs/reiser4/plugin/object.c | 1 + 2 files changed, 2 insertions(+), 1 deletions(-)
fs/reiser4/plugin/file/cryptcompress.c +1 -1
@@ -2883,7 +2883,7 @@ ssize_t read_cryptcompress(struct file * file, char __user *buf, size_t size,down_read (&info->lock);LOCK_CNT_INC (inode_sem_r); - result =generic_file_read (file, buf, size, off); + result =do_sync_read (file, buf, size, off);up_read (&info->lock);LOCK_CNT_DEC (inode_sem_r);
fs/reiser4/plugin/object.c +1 -0
@@ -305,6 +305,7 @@ file_plugin file_plugins[LAST_FILE_PLUGIN_ID] = { .llseek = generic_file_llseek, .read = read_cryptcompress, .write = write_cryptcompress, + .aio_read = generic_file_aio_read, .mmap = mmap_cryptcompress, .release = release_cryptcompress, .fsync = sync_common,
Signature · 1 line
1.4.4.1.gaed4