/*
@@ -2764,6 +2765,8 @@ struct inode *ext4_iget(struct super_blo
+ ei->i_acl = EXT4_ACL_NOT_CACHED;
ei->i_default_acl = EXT4_ACL_NOT_CACHED;
#endif
- ei->i_block_alloc_info = NULL;
+ if (ext4_iopen_get_inode(inode))
+ return inode;
===================================================================
--- linux-2.6.18-128.1.6.orig/fs/ext4/super.c
+++ linux-2.6.18-128.1.6/fs/ext4/super.c
-@@ -888,6 +888,7 @@ enum {
- Opt_ignore, Opt_barrier, Opt_err, Opt_resize, Opt_usrquota,
- Opt_grpquota, Opt_extents, Opt_noextents, Opt_i_version,
- Opt_mballoc, Opt_nomballoc, Opt_stripe,
+@@ -888,7 +888,8 @@ enum {
+
+ Opt_usrquota, Opt_grpquota, Opt_i_version,
+ Opt_stripe, Opt_delalloc, Opt_nodelalloc,
+- Opt_inode_readahead_blks, Opt_journal_ioprio
++ Opt_inode_readahead_blks, Opt_journal_ioprio,
+ Opt_iopen, Opt_noiopen, Opt_iopen_nopriv,
};
+ if (ext4_check_for_iopen(dir, dentry))
+ return NULL;
+
- bh = ext4_find_entry(dentry, &de);
+ bh = ext4_find_entry(dir, &dentry->d_name, &de);
inode = NULL;
if (bh) {
@@ -1062,7 +1066,8 @@ static struct dentry *ext4_lookup(struct
ext4_mark_inode_dirty(handle, inode);
- d_instantiate(dentry, inode);
+ iopen_d_instantiate(dentry, inode);
+ unlock_new_inode(inode);
return 0;
}
- drop_nlink(inode);
@@ -1868,7 +1873,7 @@ out_clear_inode:
ext4_inc_count(handle, dir);
ext4_update_dx_flag(dir);
ext4_mark_inode_dirty(handle, dir);
- d_instantiate(dentry, inode);
+ iopen_d_instantiate(dentry, inode);
+ unlock_new_inode(inode);
out_stop:
ext4_journal_stop(handle);
- if (err == -ENOSPC && ext4_should_retry_alloc(dir->i_sb, &retries))
@@ -2134,10 +2139,6 @@ static int ext4_rmdir (struct inode * di
inode->i_nlink);
inode->i_version++;
+ return err;
+}
+
- static int ext4_link (struct dentry * old_dentry,
- struct inode * dir, struct dentry *dentry)
+ static int ext4_link(struct dentry *old_dentry,
+ struct inode *dir, struct dentry *dentry)
{
-@@ -2293,7 +2311,8 @@ retry:
+@@ -2293,14 +2311,8 @@ retry:
ext4_inc_count(handle, inode);
atomic_inc(&inode->i_count);
-- err = ext4_add_nondir(handle, dentry, inode);
+- err = ext4_add_entry(handle, dentry, inode);
+- if (!err) {
+- ext4_mark_inode_dirty(handle, inode);
+- d_instantiate(dentry, inode);
+- } else {
+- drop_nlink(inode);
+- iput(inode);
+- }
+ err = ext4_add_link(handle, dentry, inode);
+ ext4_orphan_del(handle, inode);
ext4_journal_stop(handle);
obj-$(CONFIG_EXT4DEV_FS) += ext4dev.o
--ext4dev-y := balloc.o bitmap.o dir.o file.o fsync.o ialloc.o inode.o \
-+ext4dev-y := balloc.o bitmap.o dir.o file.o fsync.o ialloc.o inode.o iopen.o \
+-ext4-y := balloc.o bitmap.o dir.o file.o fsync.o ialloc.o inode.o \
++ext4-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 extents.o \
ext4_jbd2.o migrate.o mballoc.o
===================================================================
--- linux-2.6.18-128.1.6.orig/fs/ext4/ext4.h
+++ linux-2.6.18-128.1.6/fs/ext4/ext4.h
-@@ -18,6 +18,7 @@
-
- #include <linux/types.h>
- #include <linux/blkdev.h>
-+#include <linux/jbd2.h>
- #include "ext4_i.h"
-
- #define EXT4_SUPER_MAGIC 0xEF53
@@ -537,6 +538,8 @@ do { \
#define EXT4_MOUNT_JOURNAL_ASYNC_COMMIT 0x1000000 /* Journal Async Commit */
#define EXT4_MOUNT_I_VERSION 0x2000000 /* i_version support */
- #define EXT4_MOUNT_MBALLOC 0x4000000 /* Buddy allocation support */
-+#define EXT4_MOUNT_IOPEN 0x8000000 /* Allow access via iopen */
-+#define EXT4_MOUNT_IOPEN_NOPRIV 0x10000000 /* Make iopen world-readable */
+ #define EXT4_MOUNT_DELALLOC 0x8000000 /* Delalloc support */
+ #define EXT4_MOUNT_DATA_ERR_ABORT 0x10000000 /* Abort on file data write */
++#define EXT4_MOUNT_IOPEN 0x20000000 /* Allow access via iopen */
++#define EXT4_MOUNT_IOPEN_NOPRIV 0x40000000 /* Make iopen world-readable */
+
/* Compatibility, for having both ext2_fs.h and ext4_fs.h included at once */
#ifndef _LINUX_EXT2_FS_H
- #define clear_opt(o, opt) o &= ~EXT4_MOUNT_##opt