diff options
Diffstat (limited to 'fs/gfs2/super.c')
-rw-r--r-- | fs/gfs2/super.c | 46 |
1 files changed, 42 insertions, 4 deletions
diff --git a/fs/gfs2/super.c b/fs/gfs2/super.c index f522bb017973..0ec3ec672de1 100644 --- a/fs/gfs2/super.c +++ b/fs/gfs2/super.c | |||
@@ -38,7 +38,7 @@ | |||
38 | #include "trans.h" | 38 | #include "trans.h" |
39 | #include "util.h" | 39 | #include "util.h" |
40 | #include "sys.h" | 40 | #include "sys.h" |
41 | #include "eattr.h" | 41 | #include "xattr.h" |
42 | 42 | ||
43 | #define args_neq(a1, a2, x) ((a1)->ar_##x != (a2)->ar_##x) | 43 | #define args_neq(a1, a2, x) ((a1)->ar_##x != (a2)->ar_##x) |
44 | 44 | ||
@@ -68,6 +68,8 @@ enum { | |||
68 | Opt_discard, | 68 | Opt_discard, |
69 | Opt_nodiscard, | 69 | Opt_nodiscard, |
70 | Opt_commit, | 70 | Opt_commit, |
71 | Opt_err_withdraw, | ||
72 | Opt_err_panic, | ||
71 | Opt_error, | 73 | Opt_error, |
72 | }; | 74 | }; |
73 | 75 | ||
@@ -97,6 +99,8 @@ static const match_table_t tokens = { | |||
97 | {Opt_discard, "discard"}, | 99 | {Opt_discard, "discard"}, |
98 | {Opt_nodiscard, "nodiscard"}, | 100 | {Opt_nodiscard, "nodiscard"}, |
99 | {Opt_commit, "commit=%d"}, | 101 | {Opt_commit, "commit=%d"}, |
102 | {Opt_err_withdraw, "errors=withdraw"}, | ||
103 | {Opt_err_panic, "errors=panic"}, | ||
100 | {Opt_error, NULL} | 104 | {Opt_error, NULL} |
101 | }; | 105 | }; |
102 | 106 | ||
@@ -152,6 +156,11 @@ int gfs2_mount_args(struct gfs2_sbd *sdp, struct gfs2_args *args, char *options) | |||
152 | args->ar_localcaching = 1; | 156 | args->ar_localcaching = 1; |
153 | break; | 157 | break; |
154 | case Opt_debug: | 158 | case Opt_debug: |
159 | if (args->ar_errors == GFS2_ERRORS_PANIC) { | ||
160 | fs_info(sdp, "-o debug and -o errors=panic " | ||
161 | "are mutually exclusive.\n"); | ||
162 | return -EINVAL; | ||
163 | } | ||
155 | args->ar_debug = 1; | 164 | args->ar_debug = 1; |
156 | break; | 165 | break; |
157 | case Opt_nodebug: | 166 | case Opt_nodebug: |
@@ -205,6 +214,17 @@ int gfs2_mount_args(struct gfs2_sbd *sdp, struct gfs2_args *args, char *options) | |||
205 | return rv ? rv : -EINVAL; | 214 | return rv ? rv : -EINVAL; |
206 | } | 215 | } |
207 | break; | 216 | break; |
217 | case Opt_err_withdraw: | ||
218 | args->ar_errors = GFS2_ERRORS_WITHDRAW; | ||
219 | break; | ||
220 | case Opt_err_panic: | ||
221 | if (args->ar_debug) { | ||
222 | fs_info(sdp, "-o debug and -o errors=panic " | ||
223 | "are mutually exclusive.\n"); | ||
224 | return -EINVAL; | ||
225 | } | ||
226 | args->ar_errors = GFS2_ERRORS_PANIC; | ||
227 | break; | ||
208 | case Opt_error: | 228 | case Opt_error: |
209 | default: | 229 | default: |
210 | fs_info(sdp, "invalid mount option: %s\n", o); | 230 | fs_info(sdp, "invalid mount option: %s\n", o); |
@@ -768,7 +788,6 @@ restart: | |||
768 | /* Release stuff */ | 788 | /* Release stuff */ |
769 | 789 | ||
770 | iput(sdp->sd_jindex); | 790 | iput(sdp->sd_jindex); |
771 | iput(sdp->sd_inum_inode); | ||
772 | iput(sdp->sd_statfs_inode); | 791 | iput(sdp->sd_statfs_inode); |
773 | iput(sdp->sd_rindex); | 792 | iput(sdp->sd_rindex); |
774 | iput(sdp->sd_quota_inode); | 793 | iput(sdp->sd_quota_inode); |
@@ -779,10 +798,8 @@ restart: | |||
779 | if (!sdp->sd_args.ar_spectator) { | 798 | if (!sdp->sd_args.ar_spectator) { |
780 | gfs2_glock_dq_uninit(&sdp->sd_journal_gh); | 799 | gfs2_glock_dq_uninit(&sdp->sd_journal_gh); |
781 | gfs2_glock_dq_uninit(&sdp->sd_jinode_gh); | 800 | gfs2_glock_dq_uninit(&sdp->sd_jinode_gh); |
782 | gfs2_glock_dq_uninit(&sdp->sd_ir_gh); | ||
783 | gfs2_glock_dq_uninit(&sdp->sd_sc_gh); | 801 | gfs2_glock_dq_uninit(&sdp->sd_sc_gh); |
784 | gfs2_glock_dq_uninit(&sdp->sd_qc_gh); | 802 | gfs2_glock_dq_uninit(&sdp->sd_qc_gh); |
785 | iput(sdp->sd_ir_inode); | ||
786 | iput(sdp->sd_sc_inode); | 803 | iput(sdp->sd_sc_inode); |
787 | iput(sdp->sd_qc_inode); | 804 | iput(sdp->sd_qc_inode); |
788 | } | 805 | } |
@@ -1084,6 +1101,7 @@ static int gfs2_remount_fs(struct super_block *sb, int *flags, char *data) | |||
1084 | gt->gt_log_flush_secs = args.ar_commit; | 1101 | gt->gt_log_flush_secs = args.ar_commit; |
1085 | spin_unlock(>->gt_spin); | 1102 | spin_unlock(>->gt_spin); |
1086 | 1103 | ||
1104 | gfs2_online_uevent(sdp); | ||
1087 | return 0; | 1105 | return 0; |
1088 | } | 1106 | } |
1089 | 1107 | ||
@@ -1225,6 +1243,22 @@ static int gfs2_show_options(struct seq_file *s, struct vfsmount *mnt) | |||
1225 | lfsecs = sdp->sd_tune.gt_log_flush_secs; | 1243 | lfsecs = sdp->sd_tune.gt_log_flush_secs; |
1226 | if (lfsecs != 60) | 1244 | if (lfsecs != 60) |
1227 | seq_printf(s, ",commit=%d", lfsecs); | 1245 | seq_printf(s, ",commit=%d", lfsecs); |
1246 | if (args->ar_errors != GFS2_ERRORS_DEFAULT) { | ||
1247 | const char *state; | ||
1248 | |||
1249 | switch (args->ar_errors) { | ||
1250 | case GFS2_ERRORS_WITHDRAW: | ||
1251 | state = "withdraw"; | ||
1252 | break; | ||
1253 | case GFS2_ERRORS_PANIC: | ||
1254 | state = "panic"; | ||
1255 | break; | ||
1256 | default: | ||
1257 | state = "unknown"; | ||
1258 | break; | ||
1259 | } | ||
1260 | seq_printf(s, ",errors=%s", state); | ||
1261 | } | ||
1228 | return 0; | 1262 | return 0; |
1229 | } | 1263 | } |
1230 | 1264 | ||
@@ -1252,6 +1286,10 @@ static void gfs2_delete_inode(struct inode *inode) | |||
1252 | goto out; | 1286 | goto out; |
1253 | } | 1287 | } |
1254 | 1288 | ||
1289 | error = gfs2_check_blk_type(sdp, ip->i_no_addr, GFS2_BLKST_UNLINKED); | ||
1290 | if (error) | ||
1291 | goto out_truncate; | ||
1292 | |||
1255 | gfs2_glock_dq_wait(&ip->i_iopen_gh); | 1293 | gfs2_glock_dq_wait(&ip->i_iopen_gh); |
1256 | gfs2_holder_reinit(LM_ST_EXCLUSIVE, LM_FLAG_TRY_1CB | GL_NOCACHE, &ip->i_iopen_gh); | 1294 | gfs2_holder_reinit(LM_ST_EXCLUSIVE, LM_FLAG_TRY_1CB | GL_NOCACHE, &ip->i_iopen_gh); |
1257 | error = gfs2_glock_nq(&ip->i_iopen_gh); | 1295 | error = gfs2_glock_nq(&ip->i_iopen_gh); |