From f907e2f2919f2447e46aa0eb11d4e3afbad208b8 Mon Sep 17 00:00:00 2001 From: wangdi Date: Fri, 9 Jan 2004 16:10:43 +0000 Subject: [PATCH] fix some bug in snap-core.patch 1) add some item in ext3_sb 2)some error handler --- .../patches/snapfs_core-2.4.20.patch | 45 +++++++++++----------- 1 file changed, 23 insertions(+), 22 deletions(-) diff --git a/lustre/kernel_patches/patches/snapfs_core-2.4.20.patch b/lustre/kernel_patches/patches/snapfs_core-2.4.20.patch index a600722..4bf11cc 100644 --- a/lustre/kernel_patches/patches/snapfs_core-2.4.20.patch +++ b/lustre/kernel_patches/patches/snapfs_core-2.4.20.patch @@ -2,7 +2,7 @@ Index: linux-2.4.20-8/fs/ext3/snap.c =================================================================== --- linux-2.4.20-8.orig/fs/ext3/snap.c 2003-01-30 18:24:37.000000000 +0800 -+++ linux-2.4.20-8/fs/ext3/snap.c 2004-01-05 10:54:25.000000000 +0800 ++++ linux-2.4.20-8/fs/ext3/snap.c 2004-01-09 23:51:05.000000000 +0800 @@ -0,0 +1,2650 @@ +/* fs/ext3/snap.c + * @@ -448,7 +448,7 @@ Index: linux-2.4.20-8/fs/ext3/snap.c + } + err = ext3_xattr_get(last_inode, EXT3_SNAP_INDEX, EXT3_SNAP_ATTR, + buf, EXT3_MAX_SNAP_DATA); -+ if (err == -ENOENT) { ++ if (err == -ENODATA) { + snap_debug("no existing attributes - zeroing\n"); + memset(buf, 0, EXT3_MAX_SNAP_DATA); + } else if (err < 0 || err > EXT3_MAX_SNAP_DATA) { @@ -665,7 +665,7 @@ Index: linux-2.4.20-8/fs/ext3/snap.c + /* read ea at first */ + err = ext3_xattr_get(pri, EXT3_SNAP_INDEX ,EXT3_SNAP_ATTR, + buf, EXT3_MAX_SNAP_DATA); -+ if (err == -ENOENT || err == -ENOATTR) { ++ if (err == -ENODATA || err == -ENOATTR) { + snap_debug("no extended attributes - zeroing\n"); + memset(buf, 0, EXT3_MAX_SNAP_DATA); + /* XXX @@ -903,7 +903,7 @@ Index: linux-2.4.20-8/fs/ext3/snap.c + + err = ext3_xattr_get(primary, EXT3_SNAP_INDEX, EXT3_SNAP_ATTR, + buf, EXT3_MAX_SNAP_DATA); -+ if (err == -ENOENT) { ++ if (err == -ENODATA) { + slot = 0; + } else if (err < 0) { + snap_debug(" attribute read error\n"); @@ -1925,7 +1925,7 @@ Index: linux-2.4.20-8/fs/ext3/snap.c + err = ext3_xattr_get(pri, EXT3_SNAP_INDEX, EXT3_SNAP_ATTR, + buf, EXT3_MAX_SNAP_DATA); + if (err < 0) { -+ if (err == -ENOENT) ++ if (err == -ENODATA) + snap_err("inode %lu is not a redirector\n", pri->i_ino); + else + snap_err(EXT3_SNAP_ATTR " attribute read error\n"); @@ -2002,7 +2002,7 @@ Index: linux-2.4.20-8/fs/ext3/snap.c + continue; + if (ext3_copy_block (next_ind, ind, i ) < 0) break; + } -+ mark_inode_dirty(next_ind); ++ ext3_mark_inode_dirty(handle, next_ind); + double_unlock(next_ind, ind); + +#endif @@ -2599,7 +2599,7 @@ Index: linux-2.4.20-8/fs/ext3/snap.c + err = ext3_xattr_get(primary, EXT3_SNAP_INDEX, EXT3_SNAP_ATTR, + buf, EXT3_MAX_SNAP_DATA); + -+ if (err == -ENOENT) { ++ if (err == -ENODATA) { + memset(buf, 0, EXT3_MAX_SNAP_DATA); + } + else if (err < 0) { @@ -2657,7 +2657,7 @@ Index: linux-2.4.20-8/fs/ext3/snap.c Index: linux-2.4.20-8/fs/ext3/ioctl.c =================================================================== --- linux-2.4.20-8.orig/fs/ext3/ioctl.c 2004-01-05 10:54:00.000000000 +0800 -+++ linux-2.4.20-8/fs/ext3/ioctl.c 2004-01-05 10:54:25.000000000 +0800 ++++ linux-2.4.20-8/fs/ext3/ioctl.c 2004-01-09 23:50:19.000000000 +0800 @@ -13,6 +13,12 @@ #include #include @@ -2778,7 +2778,7 @@ Index: linux-2.4.20-8/fs/ext3/ioctl.c Index: linux-2.4.20-8/fs/ext3/Makefile =================================================================== --- linux-2.4.20-8.orig/fs/ext3/Makefile 2004-01-05 10:54:03.000000000 +0800 -+++ linux-2.4.20-8/fs/ext3/Makefile 2004-01-05 10:54:25.000000000 +0800 ++++ linux-2.4.20-8/fs/ext3/Makefile 2004-01-09 23:50:19.000000000 +0800 @@ -13,7 +13,7 @@ obj-y := balloc.o bitmap.o dir.o file.o fsync.o ialloc.o inode.o iopen.o \ @@ -2791,7 +2791,7 @@ Index: linux-2.4.20-8/fs/ext3/Makefile Index: linux-2.4.20-8/fs/ext3/inode.c =================================================================== --- linux-2.4.20-8.orig/fs/ext3/inode.c 2004-01-05 10:54:03.000000000 +0800 -+++ linux-2.4.20-8/fs/ext3/inode.c 2004-01-05 10:54:25.000000000 +0800 ++++ linux-2.4.20-8/fs/ext3/inode.c 2004-01-09 23:50:19.000000000 +0800 @@ -1191,7 +1191,7 @@ * So, if we see any bmap calls here on a modified, data-journaled file, * take extra steps to flush any blocks which might be in the cache. @@ -2804,7 +2804,7 @@ Index: linux-2.4.20-8/fs/ext3/inode.c Index: linux-2.4.20-8/fs/ext3/ialloc.c =================================================================== --- linux-2.4.20-8.orig/fs/ext3/ialloc.c 2004-01-05 10:54:03.000000000 +0800 -+++ linux-2.4.20-8/fs/ext3/ialloc.c 2004-01-05 10:54:25.000000000 +0800 ++++ linux-2.4.20-8/fs/ext3/ialloc.c 2004-01-09 23:50:19.000000000 +0800 @@ -78,7 +78,6 @@ sb->u.ext3_sb.s_inode_bitmap[bitmap_nr] = bh; return retval; @@ -2830,7 +2830,7 @@ Index: linux-2.4.20-8/fs/ext3/ialloc.c Index: linux-2.4.20-8/include/linux/snap.h =================================================================== --- linux-2.4.20-8.orig/include/linux/snap.h 2003-01-30 18:24:37.000000000 +0800 -+++ linux-2.4.20-8/include/linux/snap.h 2004-01-05 10:54:25.000000000 +0800 ++++ linux-2.4.20-8/include/linux/snap.h 2004-01-09 23:50:19.000000000 +0800 @@ -0,0 +1,266 @@ +/* + * Copyright (c) 2002 Cluster File Systems, Inc. @@ -3101,7 +3101,7 @@ Index: linux-2.4.20-8/include/linux/snap.h Index: linux-2.4.20-8/include/linux/ext3_fs.h =================================================================== --- linux-2.4.20-8.orig/include/linux/ext3_fs.h 2004-01-05 10:54:03.000000000 +0800 -+++ linux-2.4.20-8/include/linux/ext3_fs.h 2004-01-05 10:54:25.000000000 +0800 ++++ linux-2.4.20-8/include/linux/ext3_fs.h 2004-01-09 23:54:01.000000000 +0800 @@ -183,7 +183,13 @@ #define EXT3_INDEX_FL 0x00001000 /* hash-indexed directory */ #define EXT3_IMAGIC_FL 0x00002000 /* AFS directory */ @@ -3144,23 +3144,24 @@ Index: linux-2.4.20-8/include/linux/ext3_fs.h /* * Structure of an inode on the disk */ -@@ -429,7 +450,14 @@ +@@ -429,7 +450,15 @@ __u8 s_def_hash_version; /* Default hash version to use */ __u8 s_reserved_char_pad; __u16 s_reserved_word_pad; - __u32 s_reserved[192]; /* Padding to the end of the block */ + /* for snapfs */ -+ __u32 s_first_meta_bg; /* First metablock group */ -+ __u32 s_mkfs_time; /* When the filesystem was created */ ++ __u32 s_default_mount_opts; ++ __u32 s_first_meta_bg; /* First metablock group */ ++ __u32 s_mkfs_time; /* When the filesystem was created */ + __u32 s_first_cowed_pri_ino; /* For snapfs,the first cowed primary inode */ + __u32 s_last_cowed_pri_ino; /* last cowed ino in memory */ + __u32 s_snaptable_ino; /* snaptable ino in memory */ + __u32 s_last_snap_orphan; /* SnapFS: start of cowing indirect inode */ -+ __u32 s_reserved[186]; /* Padding to the end of the block,originally 204 */ ++ __u32 s_reserved[185]; /* Padding to the end of the block,originally 204 */ }; #ifdef __KERNEL__ -@@ -503,6 +531,9 @@ +@@ -503,6 +532,9 @@ #define EXT3_FEATURE_INCOMPAT_RECOVER 0x0004 /* Needs recovery */ #define EXT3_FEATURE_INCOMPAT_JOURNAL_DEV 0x0008 /* Journal device */ @@ -3173,7 +3174,7 @@ Index: linux-2.4.20-8/include/linux/ext3_fs.h Index: linux-2.4.20-8/include/linux/ext3_fs_sb.h =================================================================== --- linux-2.4.20-8.orig/include/linux/ext3_fs_sb.h 2004-01-05 10:54:00.000000000 +0800 -+++ linux-2.4.20-8/include/linux/ext3_fs_sb.h 2004-01-05 10:54:25.000000000 +0800 ++++ linux-2.4.20-8/include/linux/ext3_fs_sb.h 2004-01-09 23:50:20.000000000 +0800 @@ -86,6 +86,13 @@ wait_queue_head_t s_delete_thread_queue; wait_queue_head_t s_delete_waiter_queue; @@ -3191,7 +3192,7 @@ Index: linux-2.4.20-8/include/linux/ext3_fs_sb.h Index: linux-2.4.20-8/include/linux/ext3_jbd.h =================================================================== --- linux-2.4.20-8.orig/include/linux/ext3_jbd.h 2004-01-05 10:53:59.000000000 +0800 -+++ linux-2.4.20-8/include/linux/ext3_jbd.h 2004-01-05 10:54:25.000000000 +0800 ++++ linux-2.4.20-8/include/linux/ext3_jbd.h 2004-01-09 23:50:20.000000000 +0800 @@ -71,6 +71,33 @@ #define EXT3_INDEX_EXTRA_TRANS_BLOCKS 8 @@ -3233,9 +3234,9 @@ Index: linux-2.4.20-8/include/linux/ext3_jbd.h fs/ext3/inode.c | 2 fs/ext3/ioctl.c | 103 + fs/ext3/snap.c | 2650 +++++++++++++++++++++++++++++++++++++++++++++ - include/linux/ext3_fs.h | 37 + include/linux/ext3_fs.h | 38 include/linux/ext3_fs_sb.h | 7 include/linux/ext3_jbd.h | 27 include/linux/snap.h | 266 ++++ - 9 files changed, 3096 insertions(+), 6 deletions(-) + 9 files changed, 3097 insertions(+), 6 deletions(-) -- 1.8.3.1