From 33fd22073e639284135a387a484218d609ebf94b Mon Sep 17 00:00:00 2001 From: tappro Date: Tue, 26 Sep 2006 23:55:26 +0000 Subject: [PATCH] orphan-delay patch --- .../kernel_patches/series/ldiskfs-2.6-fc3.series | 2 ++ .../kernel_patches/series/ldiskfs-2.6-rhel4.series | 2 ++ .../patches/ext3-orphans-delay.patch | 35 ++++++++++++++++++++++ .../kernel_patches/series/ldiskfs-2.6-fc3.series | 2 ++ .../kernel_patches/series/ldiskfs-2.6-rhel4.series | 2 ++ lustre/osd/osd_handler.c | 8 +++-- 6 files changed, 49 insertions(+), 2 deletions(-) create mode 100644 lustre/kernel_patches/patches/ext3-orphans-delay.patch diff --git a/ldiskfs/kernel_patches/series/ldiskfs-2.6-fc3.series b/ldiskfs/kernel_patches/series/ldiskfs-2.6-fc3.series index 5395486..a013237 100644 --- a/ldiskfs/kernel_patches/series/ldiskfs-2.6-fc3.series +++ b/ldiskfs/kernel_patches/series/ldiskfs-2.6-fc3.series @@ -20,3 +20,5 @@ ext3-htree-comments.patch ext3-iam-ops.patch ext3-iam-separate.patch ext3-iam-uapi.patch +ext3-orphans-delay.patch + diff --git a/ldiskfs/kernel_patches/series/ldiskfs-2.6-rhel4.series b/ldiskfs/kernel_patches/series/ldiskfs-2.6-rhel4.series index 2f2f413..43d0123 100644 --- a/ldiskfs/kernel_patches/series/ldiskfs-2.6-rhel4.series +++ b/ldiskfs/kernel_patches/series/ldiskfs-2.6-rhel4.series @@ -22,3 +22,5 @@ ext3-check-jbd-errors-2.6.9.patch ext3-iam-ops.patch ext3-iam-separate.patch ext3-iam-uapi.patch +ext3-orphans-delay.patch + diff --git a/lustre/kernel_patches/patches/ext3-orphans-delay.patch b/lustre/kernel_patches/patches/ext3-orphans-delay.patch new file mode 100644 index 0000000..63c8e02 --- /dev/null +++ b/lustre/kernel_patches/patches/ext3-orphans-delay.patch @@ -0,0 +1,35 @@ +--- linux.orig/fs/ext3/super.c 2006-08-25 12:39:48.000000000 +0400 ++++ linux/fs/ext3/super.c 2006-09-27 02:37:46.000000000 +0400 +@@ -1139,8 +1139,8 @@ + * e2fsck was run on this filesystem, and it must have already done the orphan + * inode cleanup for us, so we can safely abort without any further action. + */ +-static void ext3_orphan_cleanup (struct super_block * sb, +- struct ext3_super_block * es) ++void ext3_orphan_cleanup (struct super_block * sb, ++ struct ext3_super_block * es) + { + unsigned int s_flags = sb->s_flags; + int nr_orphans = 0, nr_truncates = 0; +@@ -1227,7 +1227,9 @@ + } + #endif + sb->s_flags = s_flags; /* Restore MS_RDONLY status */ ++ EXT3_SB(sb)->s_mount_state &= ~EXT3_ORPHAN_FS; + } ++EXPORT_SYMBOL(ext3_orphan_cleanup); + + #define log2(n) ffz(~(n)) + +@@ -1641,9 +1643,8 @@ + * superblock lock. + */ + EXT3_SB(sb)->s_mount_state |= EXT3_ORPHAN_FS; +- ext3_orphan_cleanup(sb, es); +- EXT3_SB(sb)->s_mount_state &= ~EXT3_ORPHAN_FS; +- if (needs_recovery) ++ ++ if (needs_recovery) + printk (KERN_INFO "EXT3-fs: recovery complete.\n"); + ext3_mark_recovery_complete(sb, es); + printk (KERN_INFO "EXT3-fs: mounted filesystem with %s data mode.\n", diff --git a/lustre/kernel_patches/series/ldiskfs-2.6-fc3.series b/lustre/kernel_patches/series/ldiskfs-2.6-fc3.series index 5395486..a013237 100644 --- a/lustre/kernel_patches/series/ldiskfs-2.6-fc3.series +++ b/lustre/kernel_patches/series/ldiskfs-2.6-fc3.series @@ -20,3 +20,5 @@ ext3-htree-comments.patch ext3-iam-ops.patch ext3-iam-separate.patch ext3-iam-uapi.patch +ext3-orphans-delay.patch + diff --git a/lustre/kernel_patches/series/ldiskfs-2.6-rhel4.series b/lustre/kernel_patches/series/ldiskfs-2.6-rhel4.series index 2f2f413..43d0123 100644 --- a/lustre/kernel_patches/series/ldiskfs-2.6-rhel4.series +++ b/lustre/kernel_patches/series/ldiskfs-2.6-rhel4.series @@ -22,3 +22,5 @@ ext3-check-jbd-errors-2.6.9.patch ext3-iam-ops.patch ext3-iam-separate.patch ext3-iam-uapi.patch +ext3-orphans-delay.patch + diff --git a/lustre/osd/osd_handler.c b/lustre/osd/osd_handler.c index 27b867e..2e6b7b1 100644 --- a/lustre/osd/osd_handler.c +++ b/lustre/osd/osd_handler.c @@ -433,7 +433,7 @@ static void osd_object_delete(const struct lu_context *ctx, struct lu_object *l) * ("*OBJ-TEMP*"), but name in that directory is _not_ counted in * inode ->i_nlink. */ - + osd_index_fini(obj); if (inode != NULL) { int result; @@ -781,7 +781,7 @@ static int osd_inode_setattr(const struct lu_context *ctx, li->i_flags = (li->i_flags & ~LDISKFS_FL_USER_MODIFIABLE) | (attr->la_flags & LDISKFS_FL_USER_MODIFIABLE); } - mark_inode_dirty(inode); + mark_inode_dirty(inode); return rc; } @@ -2003,12 +2003,16 @@ static int osd_process_config(const struct lu_context *ctx, RETURN(err); } +extern void ldiskfs_orphan_cleanup (struct super_block * sb, + struct ldiskfs_super_block * es); static int osd_recovery_complete(const struct lu_context *ctxt, struct lu_device *d) { + struct osd_device *o = osd_dev(d); ENTRY; /* TODO: orphans handling */ + ldiskfs_orphan_cleanup(osd_sb(o), LDISKFS_SB(osd_sb(o))->s_es); RETURN(0); } -- 1.8.3.1