Skip to content
Snippets Groups Projects
Commit 038b92d5 authored by Johann Lombardi's avatar Johann Lombardi
Browse files

Branch b1_6

b=11039
i=adilger
i=scjody

Remove 2.4 and 2.6.12 kernel patches.
parent 6c89ca14
No related branches found
No related tags found
No related merge requests found
This diff is collapsed.
Signed-off-by: Johann Lombardi <johann.lombardi@bull.net>
--- linux-2.6.12.orig/fs/ext3/super.c 2005-06-17 21:48:29.000000000 +0200
+++ linux-2.6.12/fs/ext3/super.c 2005-11-07 13:37:30.000000000 +0100
@@ -39,7 +39,8 @@
#include "xattr.h"
#include "acl.h"
-static int ext3_load_journal(struct super_block *, struct ext3_super_block *);
+static int ext3_load_journal(struct super_block *, struct ext3_super_block *,
+ unsigned long journal_devnum);
static int ext3_create_journal(struct super_block *, struct ext3_super_block *,
int);
static void ext3_commit_super (struct super_block * sb,
@@ -586,7 +587,7 @@ enum {
Opt_nouid32, Opt_check, Opt_nocheck, Opt_debug, Opt_oldalloc, Opt_orlov,
Opt_user_xattr, Opt_nouser_xattr, Opt_acl, Opt_noacl,
Opt_reservation, Opt_noreservation, Opt_noload, Opt_nobh,
- Opt_commit, Opt_journal_update, Opt_journal_inum,
+ Opt_commit, Opt_journal_update, Opt_journal_inum, Opt_journal_dev,
Opt_abort, Opt_data_journal, Opt_data_ordered, Opt_data_writeback,
Opt_usrjquota, Opt_grpjquota, Opt_offusrjquota, Opt_offgrpjquota,
Opt_jqfmt_vfsold, Opt_jqfmt_vfsv0,
@@ -624,6 +625,7 @@ static match_table_t tokens = {
{Opt_commit, "commit=%u"},
{Opt_journal_update, "journal=update"},
{Opt_journal_inum, "journal=%u"},
+ {Opt_journal_dev, "journal_dev=%u"},
{Opt_abort, "abort"},
{Opt_data_journal, "data=journal"},
{Opt_data_ordered, "data=ordered"},
@@ -663,8 +665,9 @@ static unsigned long get_sb_block(void *
return sb_block;
}
-static int parse_options (char * options, struct super_block *sb,
- unsigned long * inum, unsigned long *n_blocks_count, int is_remount)
+static int parse_options (char *options, struct super_block *sb,
+ unsigned long *inum, unsigned long *journal_devnum,
+ unsigned long *n_blocks_count, int is_remount)
{
struct ext3_sb_info *sbi = EXT3_SB(sb);
char * p;
@@ -805,6 +808,16 @@ static int parse_options (char * options
return 0;
*inum = option;
break;
+ case Opt_journal_dev:
+ if (is_remount) {
+ printk(KERN_ERR "EXT3-fs: cannot specify "
+ "journal on remount\n");
+ return 0;
+ }
+ if (match_int(&args[0], &option))
+ return 0;
+ *journal_devnum = option;
+ break;
case Opt_noload:
set_opt (sbi->s_mount_opt, NOLOAD);
break;
@@ -1250,6 +1263,7 @@ static int ext3_fill_super (struct super
unsigned long logic_sb_block;
unsigned long offset = 0;
unsigned long journal_inum = 0;
+ unsigned long journal_devnum = 0;
unsigned long def_mount_opts;
struct inode *root;
int blocksize;
@@ -1330,7 +1344,8 @@ static int ext3_fill_super (struct super
set_opt(sbi->s_mount_opt, RESERVATION);
- if (!parse_options ((char *) data, sb, &journal_inum, NULL, 0))
+ if (!parse_options ((char *) data, sb, &journal_inum, &journal_devnum,
+ NULL, 0))
goto failed_mount;
sb->s_flags = (sb->s_flags & ~MS_POSIXACL) |
@@ -1541,7 +1556,7 @@ static int ext3_fill_super (struct super
*/
if (!test_opt(sb, NOLOAD) &&
EXT3_HAS_COMPAT_FEATURE(sb, EXT3_FEATURE_COMPAT_HAS_JOURNAL)) {
- if (ext3_load_journal(sb, es))
+ if (ext3_load_journal(sb, es, journal_devnum))
goto failed_mount2;
} else if (journal_inum) {
if (ext3_create_journal(sb, es, journal_inum))
@@ -1821,15 +1836,24 @@ out_bdev:
return NULL;
}
-static int ext3_load_journal(struct super_block * sb,
- struct ext3_super_block * es)
+static int ext3_load_journal(struct super_block *sb,
+ struct ext3_super_block *es,
+ unsigned long journal_devnum)
{
journal_t *journal;
int journal_inum = le32_to_cpu(es->s_journal_inum);
- dev_t journal_dev = new_decode_dev(le32_to_cpu(es->s_journal_dev));
+ dev_t journal_dev;
int err = 0;
int really_read_only;
+ if (journal_devnum &&
+ journal_devnum != le32_to_cpu(es->s_journal_dev)) {
+ printk(KERN_INFO "EXT3-fs: external journal device major/minor "
+ "numbers have changed\n");
+ journal_dev = new_decode_dev(journal_devnum);
+ } else
+ journal_dev = new_decode_dev(le32_to_cpu(es->s_journal_dev));
+
really_read_only = bdev_read_only(sb->s_bdev);
/*
@@ -1888,6 +1912,16 @@ static int ext3_load_journal(struct supe
EXT3_SB(sb)->s_journal = journal;
ext3_clear_journal_err(sb, es);
+
+ if (journal_devnum &&
+ journal_devnum != le32_to_cpu(es->s_journal_dev)) {
+ es->s_journal_dev = cpu_to_le32(journal_devnum);
+ sb->s_dirt = 1;
+
+ /* Make sure we flush the recovery flag to disk. */
+ ext3_commit_super(sb, es, 1);
+ }
+
return 0;
}
@@ -2093,13 +2127,13 @@ static int ext3_remount (struct super_bl
{
struct ext3_super_block * es;
struct ext3_sb_info *sbi = EXT3_SB(sb);
- unsigned long tmp;
+ unsigned long tmp1, tmp2;
unsigned long n_blocks_count = 0;
/*
* Allow the "check" option to be passed as a remount option.
*/
- if (!parse_options(data, sb, &tmp, &n_blocks_count, 1))
+ if (!parse_options(data, sb, &tmp1, &tmp2, &n_blocks_count, 1))
return -EINVAL;
if (sbi->s_mount_opt & EXT3_MOUNT_ABORT)
This diff is collapsed.
This diff is collapsed.
Subject: Avoid disk sector_t overflow for >2TB ext3 filesystem
From: Mingming Cao <cmm@us.ibm.com>
If ext3 filesystem is larger than 2TB, and sector_t is a u32 (i.e.
CONFIG_LBD not defined in the kernel), the calculation of the disk sector
will overflow. Add check at ext3_fill_super() and ext3_group_extend() to
prevent mount/remount/resize >2TB ext3 filesystem if sector_t size is 4
bytes.
Verified this patch on a 32 bit platform without CONFIG_LBD defined
(sector_t is 32 bits long), mount refuse to mount a 10TB ext3.
Signed-off-by: Mingming Cao<cmm@us.ibm.com>
Acked-by: Andreas Dilger <adilger@clusterfs.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
---
fs/ext3/resize.c | 10 ++++++++++
fs/ext3/super.c | 10 ++++++++++
2 files changed, 20 insertions(+)
diff -puN fs/ext3/resize.c~avoid-disk-sector_t-overflow-for-2tb-ext3-filesystem fs/ext3/resize.c
--- devel/fs/ext3/resize.c~avoid-disk-sector_t-overflow-for-2tb-ext3-filesystem 2006-05-22 14:09:53.000000000 -0700
+++ devel-akpm/fs/ext3/resize.c 2006-05-22 14:10:56.000000000 -0700
@@ -926,6 +926,16 @@ int ext3_group_extend(struct super_block
if (n_blocks_count == 0 || n_blocks_count == o_blocks_count)
return 0;
+ if (n_blocks_count > (sector_t)(~0ULL) >> (sb->s_blocksize_bits - 9)) {
+ printk(KERN_ERR "EXT3-fs: filesystem on %s: "
+ "too large to resize to %lu blocks safely\n",
+ sb->s_id, n_blocks_count);
+ if (sizeof(sector_t) < 8)
+ ext3_warning(sb, __FUNCTION__,
+ "CONFIG_LBD not enabled\n");
+ return -EINVAL;
+ }
+
if (n_blocks_count < o_blocks_count) {
ext3_warning(sb, __FUNCTION__,
"can't shrink FS - resize aborted");
diff -puN fs/ext3/super.c~avoid-disk-sector_t-overflow-for-2tb-ext3-filesystem fs/ext3/super.c
--- devel/fs/ext3/super.c~avoid-disk-sector_t-overflow-for-2tb-ext3-filesystem 2006-05-22 14:09:53.000000000 -0700
+++ devel-akpm/fs/ext3/super.c 2006-05-22 14:11:10.000000000 -0700
@@ -1565,6 +1565,17 @@ static int ext3_fill_super (struct super
goto failed_mount;
}
+ if (le32_to_cpu(es->s_blocks_count) >
+ (sector_t)(~0ULL) >> (sb->s_blocksize_bits - 9)) {
+ printk(KERN_ERR "EXT3-fs: filesystem on %s: "
+ "too large to mount safely - %u blocks\n", sb->s_id,
+ le32_to_cpu(es->s_blocks_count));
+ if (sizeof(sector_t) < 8)
+ printk(KERN_WARNING
+ "EXT3-fs: CONFIG_LBD not enabled\n");
+ goto failed_mount;
+ }
+
if (EXT3_BLOCKS_PER_GROUP(sb) == 0)
goto cantfind_ext3;
sbi->s_groups_count = (le32_to_cpu(es->s_blocks_count) -
_
Index: linux-2.6.12-rc6/fs/ext3/Makefile
===================================================================
--- linux-2.6.12-rc6.orig/fs/ext3/Makefile 2005-06-14 16:00:45.206720992 +0200
+++ linux-2.6.12-rc6/fs/ext3/Makefile 2005-06-14 16:14:33.595382720 +0200
@@ -4,7 +4,7 @@
obj-$(CONFIG_EXT3_FS) += ext3.o
-ext3-y := balloc.o bitmap.o dir.o file.o fsync.o ialloc.o inode.o \
+ext3-y := balloc.o bitmap.o dir.o file.o fsync.o ialloc.o inode.o iopen.o \
ioctl.o namei.o super.o symlink.o hash.o resize.o
ext3-$(CONFIG_EXT3_FS_XATTR) += xattr.o xattr_user.o xattr_trusted.o
Index: linux-2.6.12-rc6/fs/ext3/inode.c
===================================================================
--- linux-2.6.12-rc6.orig/fs/ext3/inode.c 2005-06-14 16:01:16.272150299 +0200
+++ linux-2.6.12-rc6/fs/ext3/inode.c 2005-06-14 16:24:55.686195412 +0200
@@ -37,6 +37,7 @@
#include <linux/mpage.h>
#include <linux/uio.h>
#include "xattr.h"
+#include "iopen.h"
#include "acl.h"
static int ext3_writepage_trans_blocks(struct inode *inode);
@@ -2437,6 +2438,8 @@
ei->i_default_acl = EXT3_ACL_NOT_CACHED;
#endif
ei->i_block_alloc_info = NULL;
+ if (ext3_iopen_get_inode(inode))
+ return;
if (__ext3_get_inode_loc(inode, &iloc, 0))
goto bad_inode;
Index: linux-2.6.12-rc6/fs/ext3/iopen.c
===================================================================
--- linux-2.6.12-rc6.orig/fs/ext3/iopen.c 2005-06-14 16:14:33.530929595 +0200
+++ linux-2.6.12-rc6/fs/ext3/iopen.c 2005-06-14 16:14:33.626632719 +0200
@@ -0,0 +1,278 @@
+/*
+ * linux/fs/ext3/iopen.c
+ *
+ * Special support for open by inode number
+ *
+ * Copyright (C) 2001 by Theodore Ts'o (tytso@alum.mit.edu).
+ *
+ * This file may be redistributed under the terms of the GNU General
+ * Public License.
+ *
+ *
+ * Invariants:
+ * - there is only ever a single DCACHE_NFSD_DISCONNECTED dentry alias
+ * for an inode at one time.
+ * - there are never both connected and DCACHE_NFSD_DISCONNECTED dentry
+ * aliases on an inode at the same time.
+ *
+ * If we have any connected dentry aliases for an inode, use one of those
+ * in iopen_lookup(). Otherwise, we instantiate a single NFSD_DISCONNECTED
+ * dentry for this inode, which thereafter will be found by the dcache
+ * when looking up this inode number in __iopen__, so we don't return here
+ * until it is gone.
+ *
+ * If we get an inode via a regular name lookup, then we "rename" the
+ * NFSD_DISCONNECTED dentry to the proper name and parent. This ensures
+ * existing users of the disconnected dentry will continue to use the same
+ * dentry as the connected users, and there will never be both kinds of
+ * dentry aliases at one time.
+ */
+
+#include <linux/sched.h>
+#include <linux/fs.h>
+#include <linux/ext3_jbd.h>
+#include <linux/jbd.h>
+#include <linux/ext3_fs.h>
+#include <linux/smp_lock.h>
+#include <linux/dcache.h>
+#include <linux/security.h>
+#include "iopen.h"
+
+#ifndef assert
+#define assert(test) J_ASSERT(test)
+#endif
+
+#define IOPEN_NAME_LEN 32
+
+/*
+ * This implements looking up an inode by number.
+ */
+static struct dentry *iopen_lookup(struct inode * dir, struct dentry *dentry,
+ struct nameidata *nd)
+{
+ struct inode *inode;
+ unsigned long ino;
+ struct list_head *lp;
+ struct dentry *alternate;
+ char buf[IOPEN_NAME_LEN];
+
+ if (dentry->d_name.len >= IOPEN_NAME_LEN)
+ return ERR_PTR(-ENAMETOOLONG);
+
+ memcpy(buf, dentry->d_name.name, dentry->d_name.len);
+ buf[dentry->d_name.len] = 0;
+
+ if (strcmp(buf, ".") == 0)
+ ino = dir->i_ino;
+ else if (strcmp(buf, "..") == 0)
+ ino = EXT3_ROOT_INO;
+ else
+ ino = simple_strtoul(buf, 0, 0);
+
+ if ((ino != EXT3_ROOT_INO &&
+ //ino != EXT3_ACL_IDX_INO &&
+ //ino != EXT3_ACL_DATA_INO &&
+ ino < EXT3_FIRST_INO(dir->i_sb)) ||
+ ino > le32_to_cpu(EXT3_SB(dir->i_sb)->s_es->s_inodes_count))
+ return ERR_PTR(-ENOENT);
+
+ inode = iget(dir->i_sb, ino);
+ if (!inode)
+ return ERR_PTR(-EACCES);
+ if (is_bad_inode(inode)) {
+ iput(inode);
+ return ERR_PTR(-ENOENT);
+ }
+
+ assert(list_empty(&dentry->d_alias)); /* d_instantiate */
+ assert(d_unhashed(dentry)); /* d_rehash */
+
+ /* preferrably return a connected dentry */
+ spin_lock(&dcache_lock);
+ list_for_each(lp, &inode->i_dentry) {
+ alternate = list_entry(lp, struct dentry, d_alias);
+ assert(!(alternate->d_flags & DCACHE_DISCONNECTED));
+ }
+
+ if (!list_empty(&inode->i_dentry)) {
+ alternate = list_entry(inode->i_dentry.next,
+ struct dentry, d_alias);
+ dget_locked(alternate);
+ spin_lock(&alternate->d_lock);
+ alternate->d_flags |= DCACHE_REFERENCED;
+ spin_unlock(&alternate->d_lock);
+ iput(inode);
+ spin_unlock(&dcache_lock);
+ return alternate;
+ }
+ dentry->d_flags |= DCACHE_DISCONNECTED;
+
+ /* d_add(), but don't drop dcache_lock before adding dentry to inode */
+ list_add(&dentry->d_alias, &inode->i_dentry); /* d_instantiate */
+ dentry->d_inode = inode;
+
+ d_rehash_cond(dentry, 0); /* d_rehash */
+ spin_unlock(&dcache_lock);
+
+ return NULL;
+}
+
+#define do_switch(x,y) do { \
+ __typeof__ (x) __tmp = x; \
+ x = y; y = __tmp; } while (0)
+
+static inline void switch_names(struct dentry *dentry, struct dentry *target)
+{
+ const unsigned char *old_name, *new_name;
+
+ memcpy(dentry->d_iname, target->d_iname, DNAME_INLINE_LEN_MIN);
+ old_name = target->d_name.name;
+ new_name = dentry->d_name.name;
+ if (old_name == target->d_iname)
+ old_name = dentry->d_iname;
+ if (new_name == dentry->d_iname)
+ new_name = target->d_iname;
+ target->d_name.name = new_name;
+ dentry->d_name.name = old_name;
+}
+
+/* This function is spliced into ext3_lookup and does the move of a
+ * disconnected dentry (if it exists) to a connected dentry.
+ */
+struct dentry *iopen_connect_dentry(struct dentry *dentry, struct inode *inode,
+ int rehash)
+{
+ struct dentry *tmp, *goal = NULL;
+ struct list_head *lp;
+
+ /* verify this dentry is really new */
+ assert(dentry->d_inode == NULL);
+ assert(list_empty(&dentry->d_alias)); /* d_instantiate */
+ if (rehash)
+ assert(d_unhashed(dentry)); /* d_rehash */
+ assert(list_empty(&dentry->d_subdirs));
+
+ spin_lock(&dcache_lock);
+ if (!inode)
+ goto do_rehash;
+
+ if (!test_opt(inode->i_sb, IOPEN))
+ goto do_instantiate;
+
+ /* preferrably return a connected dentry */
+ list_for_each(lp, &inode->i_dentry) {
+ tmp = list_entry(lp, struct dentry, d_alias);
+ if (tmp->d_flags & DCACHE_DISCONNECTED) {
+ assert(tmp->d_alias.next == &inode->i_dentry);
+ assert(tmp->d_alias.prev == &inode->i_dentry);
+ goal = tmp;
+ dget_locked(goal);
+ break;
+ }
+ }
+
+ if (!goal)
+ goto do_instantiate;
+
+ /* Move the goal to the de hash queue */
+ goal->d_flags &= ~DCACHE_DISCONNECTED;
+ security_d_instantiate(goal, inode);
+ __d_drop(dentry);
+ d_rehash_cond(dentry, 0);
+ __d_move(goal, dentry);
+ spin_unlock(&dcache_lock);
+ iput(inode);
+
+ return goal;
+
+ /* d_add(), but don't drop dcache_lock before adding dentry to inode */
+do_instantiate:
+ list_add(&dentry->d_alias, &inode->i_dentry); /* d_instantiate */
+ dentry->d_inode = inode;
+do_rehash:
+ if (rehash)
+ d_rehash_cond(dentry, 0); /* d_rehash */
+ spin_unlock(&dcache_lock);
+
+ return NULL;
+}
+
+/*
+ * These are the special structures for the iopen pseudo directory.
+ */
+
+static struct inode_operations iopen_inode_operations = {
+ lookup: iopen_lookup, /* BKL held */
+};
+
+static struct file_operations iopen_file_operations = {
+ read: generic_read_dir,
+};
+
+static int match_dentry(struct dentry *dentry, const char *name)
+{
+ int len;
+
+ len = strlen(name);
+ if (dentry->d_name.len != len)
+ return 0;
+ if (strncmp(dentry->d_name.name, name, len))
+ return 0;
+ return 1;
+}
+
+/*
+ * This function is spliced into ext3_lookup and returns 1 the file
+ * name is __iopen__ and dentry has been filled in appropriately.
+ */
+int ext3_check_for_iopen(struct inode *dir, struct dentry *dentry)
+{
+ struct inode *inode;
+
+ if (dir->i_ino != EXT3_ROOT_INO ||
+ !test_opt(dir->i_sb, IOPEN) ||
+ !match_dentry(dentry, "__iopen__"))
+ return 0;
+
+ inode = iget(dir->i_sb, EXT3_BAD_INO);
+
+ if (!inode)
+ return 0;
+ d_add(dentry, inode);
+ return 1;
+}
+
+/*
+ * This function is spliced into read_inode; it returns 1 if inode
+ * number is the one for /__iopen__, in which case the inode is filled
+ * in appropriately. Otherwise, this fuction returns 0.
+ */
+int ext3_iopen_get_inode(struct inode *inode)
+{
+ if (inode->i_ino != EXT3_BAD_INO)
+ return 0;
+
+ inode->i_mode = S_IFDIR | S_IRUSR | S_IXUSR;
+ if (test_opt(inode->i_sb, IOPEN_NOPRIV))
+ inode->i_mode |= 0777;
+ inode->i_uid = 0;
+ inode->i_gid = 0;
+ inode->i_nlink = 1;
+ inode->i_size = 4096;
+ inode->i_atime = CURRENT_TIME;
+ inode->i_ctime = CURRENT_TIME;
+ inode->i_mtime = CURRENT_TIME;
+ EXT3_I(inode)->i_dtime = 0;
+ inode->i_blksize = PAGE_SIZE; /* This is the optimal IO size
+ * (for stat), not the fs block
+ * size */
+ inode->i_blocks = 0;
+ inode->i_version = 1;
+ inode->i_generation = 0;
+
+ inode->i_op = &iopen_inode_operations;
+ inode->i_fop = &iopen_file_operations;
+ inode->i_mapping->a_ops = 0;
+
+ return 1;
+}
Index: linux-2.6.12-rc6/fs/ext3/iopen.h
===================================================================
--- linux-2.6.12-rc6.orig/fs/ext3/iopen.h 2005-06-14 16:14:33.534835845 +0200
+++ linux-2.6.12-rc6/fs/ext3/iopen.h 2005-06-14 16:14:33.633468657 +0200
@@ -0,0 +1,15 @@
+/*
+ * iopen.h
+ *
+ * Special support for opening files by inode number.
+ *
+ * Copyright (C) 2001 by Theodore Ts'o (tytso@alum.mit.edu).
+ *
+ * This file may be redistributed under the terms of the GNU General
+ * Public License.
+ */
+
+extern int ext3_check_for_iopen(struct inode *dir, struct dentry *dentry);
+extern int ext3_iopen_get_inode(struct inode *inode);
+extern struct dentry *iopen_connect_dentry(struct dentry *dentry,
+ struct inode *inode, int rehash);
Index: linux-2.6.12-rc6/fs/ext3/namei.c
===================================================================
--- linux-2.6.12-rc6.orig/fs/ext3/namei.c 2005-06-14 16:01:14.701837819 +0200
+++ linux-2.6.12-rc6/fs/ext3/namei.c 2005-06-14 16:14:33.644210844 +0200
@@ -37,6 +37,7 @@
#include <linux/buffer_head.h>
#include <linux/smp_lock.h>
#include "xattr.h"
+#include "iopen.h"
#include "acl.h"
/*
@@ -985,6 +986,9 @@
if (dentry->d_name.len > EXT3_NAME_LEN)
return ERR_PTR(-ENAMETOOLONG);
+ if (ext3_check_for_iopen(dir, dentry))
+ return NULL;
+
bh = ext3_find_entry(dentry, &de);
inode = NULL;
if (bh) {
@@ -995,10 +999,8 @@
if (!inode)
return ERR_PTR(-EACCES);
}
- if (inode)
- return d_splice_alias(inode, dentry);
- d_add(dentry, inode);
- return NULL;
+
+ return iopen_connect_dentry(dentry, inode, 1);
}
@@ -2042,10 +2044,6 @@
inode->i_nlink);
inode->i_version++;
inode->i_nlink = 0;
- /* There's no need to set i_disksize: the fact that i_nlink is
- * zero will ensure that the right thing happens during any
- * recovery. */
- inode->i_size = 0;
ext3_orphan_add(handle, inode);
inode->i_ctime = dir->i_ctime = dir->i_mtime = CURRENT_TIME_SEC;
ext3_mark_inode_dirty(handle, inode);
@@ -2168,6 +2166,23 @@
return err;
}
+/* Like ext3_add_nondir() except for call to iopen_connect_dentry */
+static int ext3_add_link(handle_t *handle, struct dentry *dentry,
+ struct inode *inode)
+{
+ int err = ext3_add_entry(handle, dentry, inode);
+ if (!err) {
+ err = ext3_mark_inode_dirty(handle, inode);
+ if (err == 0) {
+ dput(iopen_connect_dentry(dentry, inode, 0));
+ return 0;
+ }
+ }
+ ext3_dec_count(handle, inode);
+ iput(inode);
+ return err;
+}
+
static int ext3_link (struct dentry * old_dentry,
struct inode * dir, struct dentry *dentry)
{
@@ -2191,7 +2206,8 @@
ext3_inc_count(handle, inode);
atomic_inc(&inode->i_count);
- err = ext3_add_nondir(handle, dentry, inode);
+ err = ext3_add_link(handle, dentry, inode);
+ ext3_orphan_del(handle, inode);
ext3_journal_stop(handle);
if (err == -ENOSPC && ext3_should_retry_alloc(dir->i_sb, &retries))
goto retry;
Index: linux-2.6.12-rc6/fs/ext3/super.c
===================================================================
--- linux-2.6.12-rc6.orig/fs/ext3/super.c 2005-06-14 16:01:16.287775299 +0200
+++ linux-2.6.12-rc6/fs/ext3/super.c 2005-06-14 16:14:33.656906156 +0200
@@ -590,6 +590,7 @@
Opt_usrjquota, Opt_grpjquota, Opt_offusrjquota, Opt_offgrpjquota,
Opt_jqfmt_vfsold, Opt_jqfmt_vfsv0,
Opt_ignore, Opt_barrier, Opt_err, Opt_resize,
+ Opt_iopen, Opt_noiopen, Opt_iopen_nopriv,
};
static match_table_t tokens = {
@@ -638,6 +639,9 @@
{Opt_ignore, "noquota"},
{Opt_ignore, "quota"},
{Opt_ignore, "usrquota"},
+ {Opt_iopen, "iopen"},
+ {Opt_noiopen, "noiopen"},
+ {Opt_iopen_nopriv, "iopen_nopriv"},
{Opt_barrier, "barrier=%u"},
{Opt_err, NULL},
{Opt_resize, "resize"},
@@ -921,6 +925,18 @@
else
clear_opt(sbi->s_mount_opt, BARRIER);
break;
+ case Opt_iopen:
+ set_opt (sbi->s_mount_opt, IOPEN);
+ clear_opt (sbi->s_mount_opt, IOPEN_NOPRIV);
+ break;
+ case Opt_noiopen:
+ clear_opt (sbi->s_mount_opt, IOPEN);
+ clear_opt (sbi->s_mount_opt, IOPEN_NOPRIV);
+ break;
+ case Opt_iopen_nopriv:
+ set_opt (sbi->s_mount_opt, IOPEN);
+ set_opt (sbi->s_mount_opt, IOPEN_NOPRIV);
+ break;
case Opt_ignore:
break;
case Opt_resize:
Index: linux-2.6.12-rc6/include/linux/ext3_fs.h
===================================================================
--- linux-2.6.12-rc6.orig/include/linux/ext3_fs.h 2005-06-14 16:01:14.709650318 +0200
+++ linux-2.6.12-rc6/include/linux/ext3_fs.h 2005-06-14 16:28:38.452794245 +0200
@@ -358,6 +358,8 @@
#define EXT3_MOUNT_RESERVATION 0x10000 /* Preallocation */
#define EXT3_MOUNT_BARRIER 0x20000 /* Use block barriers */
#define EXT3_MOUNT_NOBH 0x40000 /* No bufferheads */
+#define EXT3_MOUNT_IOPEN 0x80000 /* Allow access via iopen */
+#define EXT3_MOUNT_IOPEN_NOPRIV 0x100000/* Make iopen world-readable */
/* Compatibility, for having both ext2_fs.h and ext3_fs.h included at once */
#ifndef _LINUX_EXT2_FS_H
ext3-wantedi-2.6-rhel4.patch
ext3-san-jdike-2.6-suse.patch
iopen-2.6.12.patch
ext3-map_inode_page-2.6-suse.patch
export-ext3-2.6-rhel4.patch
ext3-include-fixes-2.6-rhel4.patch
ext3-extents-2.6.12.patch
ext3-mballoc2-2.6.12.patch
ext3-nlinks-2.6.9.patch
ext3-ialloc-2.6.patch
ext3-remove-cond_resched-calls-2.6.12.patch
ext3-htree-dot-2.6.patch
ext3-external-journal-2.6.12.patch
ext3-check-jbd-errors-2.6.12.patch
ext3-check-jbd-errors-2.6.9.patch
ext3-uninit-2.6.9.patch
ext3-nanosecond-2.6-rhel4.patch
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment