Whamcloud - gitweb
orphan-delay patch
authortappro <tappro>
Tue, 26 Sep 2006 23:55:26 +0000 (23:55 +0000)
committertappro <tappro>
Tue, 26 Sep 2006 23:55:26 +0000 (23:55 +0000)
ldiskfs/kernel_patches/series/ldiskfs-2.6-fc3.series
ldiskfs/kernel_patches/series/ldiskfs-2.6-rhel4.series
lustre/kernel_patches/patches/ext3-orphans-delay.patch [new file with mode: 0644]
lustre/kernel_patches/series/ldiskfs-2.6-fc3.series
lustre/kernel_patches/series/ldiskfs-2.6-rhel4.series
lustre/osd/osd_handler.c

index 5395486..a013237 100644 (file)
@@ -20,3 +20,5 @@ ext3-htree-comments.patch
 ext3-iam-ops.patch
 ext3-iam-separate.patch 
 ext3-iam-uapi.patch 
+ext3-orphans-delay.patch 
+
index 2f2f413..43d0123 100644 (file)
@@ -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 (file)
index 0000000..63c8e02
--- /dev/null
@@ -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",
index 5395486..a013237 100644 (file)
@@ -20,3 +20,5 @@ ext3-htree-comments.patch
 ext3-iam-ops.patch
 ext3-iam-separate.patch 
 ext3-iam-uapi.patch 
+ext3-orphans-delay.patch 
+
index 2f2f413..43d0123 100644 (file)
@@ -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 
+
index 27b867e..2e6b7b1 100644 (file)
@@ -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);
 }