Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
L
lustre-release
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
External wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
debian-packages
lustre-release
Commits
4275e6a1
Commit
4275e6a1
authored
21 years ago
by
Wang Di
Browse files
Options
Downloads
Patches
Plain Diff
some fix in delete snapshot
parent
7e2b7edb
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
lustre/kernel_patches/patches/snapfs_core-2.4.20.patch
+21
-26
21 additions, 26 deletions
lustre/kernel_patches/patches/snapfs_core-2.4.20.patch
with
21 additions
and
26 deletions
lustre/kernel_patches/patches/snapfs_core-2.4.20.patch
+
21
−
26
View file @
4275e6a1
...
@@ -2,8 +2,8 @@
...
@@ -2,8 +2,8 @@
Index: linux-2.4.20-8/fs/ext3/snap.c
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.orig/fs/ext3/snap.c 2003-01-30 18:24:37.000000000 +0800
+++ linux-2.4.20-8/fs/ext3/snap.c 2004-01-1
8 01:48:54
.000000000 +0800
+++ linux-2.4.20-8/fs/ext3/snap.c 2004-01-1
9 23:24:39
.000000000 +0800
@@ -0,0 +1,258
8
@@
@@ -0,0 +1,258
3
@@
+/* fs/ext3/snap.c
+/* fs/ext3/snap.c
+ *
+ *
+ * Copyright (c) 2002 Cluster File Systems, Inc. <info@clusterfs.com>
+ * Copyright (c) 2002 Cluster File Systems, Inc. <info@clusterfs.com>
...
@@ -424,7 +424,7 @@ Index: linux-2.4.20-8/fs/ext3/snap.c
...
@@ -424,7 +424,7 @@ Index: linux-2.4.20-8/fs/ext3/snap.c
+ lock_super(pri->i_sb);
+ lock_super(pri->i_sb);
+ ext3_journal_get_write_access(handle, sbi->s_sbh);
+ ext3_journal_get_write_access(handle, sbi->s_sbh);
+ sbi->s_es->s_first_cowed_pri_ino = cpu_to_le32(pri->i_ino);
+ sbi->s_es->s_first_cowed_pri_ino = cpu_to_le32(pri->i_ino);
+ SB_
LA
ST_COWED_INO(pri->i_sb) = cpu_to_le32(pri->i_ino);
+ SB_
FIR
ST_COWED_INO(pri->i_sb) = cpu_to_le32(pri->i_ino);
+ pri->i_sb->s_dirt = 1;
+ pri->i_sb->s_dirt = 1;
+ ext3_journal_dirty_metadata(handle, sbi->s_sbh);
+ ext3_journal_dirty_metadata(handle, sbi->s_sbh);
+ unlock_super(pri->i_sb);
+ unlock_super(pri->i_sb);
...
@@ -1898,44 +1898,40 @@ Index: linux-2.4.20-8/fs/ext3/snap.c
...
@@ -1898,44 +1898,40 @@ Index: linux-2.4.20-8/fs/ext3/snap.c
+ return 0;
+ return 0;
+
+
+ if( pri == pri->i_sb->u.ext3_sb.s_journal_inode ){
+ if( pri == pri->i_sb->u.ext3_sb.s_journal_inode ){
+
printk( KERN_EMERG
"TRY TO DESTROY JOURNAL'S IND\n");
+
snap_err(
"TRY TO DESTROY JOURNAL'S IND\n");
+ return -EINVAL;
+ return -EINVAL;
+ }
+ }
+
+
+ handle = ext3_journal_start(pri, SNAP_DESTROY_TRANS_BLOCKS);
+ if( !handle )
+ return -EINVAL;
+
+ err = ext3_xattr_get(pri, EXT3_SNAP_INDEX, EXT3_SNAP_ATTR,
+ err = ext3_xattr_get(pri, EXT3_SNAP_INDEX, EXT3_SNAP_ATTR,
+
buf, EXT3_MAX_SNAP_DATA);
+ buf, EXT3_MAX_SNAP_DATA);
+ if (err < 0) {
+ if (err < 0) {
+ if (err == -ENODATA)
+ snap_err("inode %lu attribute read error\n", pri->i_ino);
+ snap_err("inode %lu is not a redirector\n", pri->i_ino);
+ return err;
+ else
+ snap_err(EXT3_SNAP_ATTR " attribute read error\n");
+ goto err_stop;
+ }
+ }
+
+
+ snaps = (struct snap_ea *)buf;
+ snaps = (struct snap_ea *)buf;
+ if ( !snaps->ino[index] ) {
+ if ( !snaps->ino[index] ) {
+ snap_err("for pri ino %lu, index %d, redirect ino is 0\n",
+ snap_err("for pri ino %lu, index %d, redirect ino is 0\n",
+ pri->i_ino, index);
+ pri->i_ino, index);
+ err = -EINVAL;
+ return -EINVAL;
+ goto err_stop;
+ }
+ }
+
+
+ snap_debug("for pri ino %lu, reading inode %lu at index %d\n",
+ snap_debug("for pri ino %lu, reading inode %lu at index %d\n",
+ pri->i_ino, (ulong)le32_to_cpu(snaps->ino[index]), index);
+ pri->i_ino, (ulong)le32_to_cpu(snaps->ino[index]), index);
+
+
+ ind = iget(pri->i_sb, le32_to_cpu (snaps->ino[index]) );
+ ind = iget(pri->i_sb, le32_to_cpu (snaps->ino[index]) );
+
+ if ( !ind || IS_ERR(ind) || is_bad_inode(ind))
+ return -EINVAL;
+
+ snap_debug("iget ind %lu, ref count = %d\n",
+ snap_debug("iget ind %lu, ref count = %d\n",
+ ind->i_ino, atomic_read(&ind->i_count));
+ ind->i_ino, atomic_read(&ind->i_count));
+
+
+ if ( !ind || IS_ERR(ind) || is_bad_inode(ind) ) {
+ handle = ext3_journal_start(pri, SNAP_DESTROY_TRANS_BLOCKS);
+ err = -EINVAL;
+ if (!handle) {
+ goto err_stop;
+ iput(ind);
+ return -EINVAL;
+ }
+ }
+
+ /* if it's block level cow, first copy the blocks back */
+ /* if it's block level cow, first copy the blocks back */
+ if (EXT3_HAS_COMPAT_FEATURE(pri->i_sb, EXT3_FEATURE_COMPAT_BLOCKCOW) &&
+ if (EXT3_HAS_COMPAT_FEATURE(pri->i_sb, EXT3_FEATURE_COMPAT_BLOCKCOW) &&
+ S_ISREG(pri->i_mode)) {
+ S_ISREG(pri->i_mode)) {
...
@@ -1983,13 +1979,13 @@ Index: linux-2.4.20-8/fs/ext3/snap.c
...
@@ -1983,13 +1979,13 @@ Index: linux-2.4.20-8/fs/ext3/snap.c
+#else
+#else
+ snap_double_lock(next_ind, ind);
+ snap_double_lock(next_ind, ind);
+ for (i = 0; i < blocks; i++) {
+ for (i = 0; i < blocks; i++) {
+ if (ext3_bmap
(next_ind->i_mapping, i)
)
+ if (ext3_bmap(next_ind->i_mapping, i))
+ continue;
+ continue;
+ if (ext3_copy_block (next_ind, ind, i ) < 0) break;
+ if (ext3_copy_block(next_ind, ind, i ) < 0)
+ break;
+ }
+ }
+ ext3_mark_inode_dirty(handle, next_ind);
+ ext3_mark_inode_dirty(handle, next_ind);
+ double_unlock(next_ind, ind);
+ double_unlock(next_ind, ind);
+
+#endif
+#endif
+ }
+ }
+
+
...
@@ -2062,7 +2058,6 @@ Index: linux-2.4.20-8/fs/ext3/snap.c
...
@@ -2062,7 +2058,6 @@ Index: linux-2.4.20-8/fs/ext3/snap.c
+ pri->i_ctime = ctime;
+ pri->i_ctime = ctime;
+ ext3_mark_inode_dirty(handle, pri);
+ ext3_mark_inode_dirty(handle, pri);
+ }
+ }
+err_stop:
+ ext3_journal_stop(handle, pri);
+ ext3_journal_stop(handle, pri);
+ return err;
+ return err;
+}
+}
...
@@ -3059,11 +3054,11 @@ Index: linux-2.4.20-8/include/linux/ext3_jbd.h
...
@@ -3059,11 +3054,11 @@ Index: linux-2.4.20-8/include/linux/ext3_jbd.h
fs/ext3/Makefile | 2
fs/ext3/Makefile | 2
fs/ext3/ialloc.c | 7
fs/ext3/ialloc.c | 7
fs/ext3/inode.c | 2
fs/ext3/inode.c | 2
fs/ext3/snap.c | 258
8
+++++++++++++++++++++++++++++++++++++++++++++
fs/ext3/snap.c | 258
3
+++++++++++++++++++++++++++++++++++++++++++++
fs/ext3/super.c | 7
fs/ext3/super.c | 7
include/linux/ext3_fs.h | 38
include/linux/ext3_fs.h | 38
include/linux/ext3_fs_sb.h | 7
include/linux/ext3_fs_sb.h | 7
include/linux/ext3_jbd.h | 27
include/linux/ext3_jbd.h | 27
include/linux/snap.h | 266 ++++
include/linux/snap.h | 266 ++++
9 files changed, 293
9
insertions(+), 5 deletions(-)
9 files changed, 293
4
insertions(+), 5 deletions(-)
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment