~ubuntu-branches/ubuntu/hoary/xfsprogs/hoary

« back to all changes in this revision

Viewing changes to repair/versions.c

  • Committer: Bazaar Package Importer
  • Author(s): Nathan Scott
  • Date: 2004-07-28 21:11:38 UTC
  • Revision ID: james.westby@ubuntu.com-20040728211138-0v4pdnunnp7na5lm
Tags: 2.6.20-1
* New upstream release.
* Fix xfs_io segfault on non-XFS files.  (closes: #260470)
* Fix packaging botch, deleted files included.  (closes: #260491)

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
/*
2
 
 * Copyright (c) 2000 Silicon Graphics, Inc.  All Rights Reserved.
3
 
 * 
 
2
 * Copyright (c) 2000-2001 Silicon Graphics, Inc.  All Rights Reserved.
 
3
 *
4
4
 * This program is free software; you can redistribute it and/or modify it
5
5
 * under the terms of version 2 of the GNU General Public License as
6
6
 * published by the Free Software Foundation.
7
 
 * 
 
7
 *
8
8
 * This program is distributed in the hope that it would be useful, but
9
9
 * WITHOUT ANY WARRANTY; without even the implied warranty of
10
10
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
11
 
 * 
 
11
 *
12
12
 * Further, this software is distributed without any warranty that it is
13
13
 * free of the rightful claim of any third person regarding infringement
14
14
 * or the like.  Any license provided herein, whether implied or
15
15
 * otherwise, applies only to this software file.  Patent licenses, if
16
16
 * any, provided herein do not apply to combinations of this program with
17
17
 * other software, or any other product whatsoever.
18
 
 * 
 
18
 *
19
19
 * You should have received a copy of the GNU General Public License along
20
20
 * with this program; if not, write the Free Software Foundation, Inc., 59
21
21
 * Temple Place - Suite 330, Boston MA 02111-1307, USA.
22
 
 * 
 
22
 *
23
23
 * Contact information: Silicon Graphics, Inc., 1600 Amphitheatre Pkwy,
24
24
 * Mountain View, CA  94043, or:
25
 
 * 
26
 
 * http://www.sgi.com 
27
 
 * 
28
 
 * For further information regarding this notice, see: 
29
 
 * 
 
25
 *
 
26
 * http://www.sgi.com
 
27
 *
 
28
 * For further information regarding this notice, see:
 
29
 *
30
30
 * http://oss.sgi.com/projects/GenInfo/SGIGPLNoticeExplan/
31
31
 */
32
32
 
85
85
                         * no_modify mode, it'll never get flushed out
86
86
                         * so this is ok.
87
87
                         */
88
 
                        do_warn("bogus quota flags 0x%x set in superblock",
 
88
                        do_warn(_("bogus quota flags 0x%x set in superblock"),
89
89
                                sb->sb_qflags & ~(XFS_UQUOTA_ACCT|
90
90
                                XFS_UQUOTA_ENFD|
91
91
                                XFS_UQUOTA_CHKD|XFS_GQUOTA_ACCT|
97
97
                                XFS_GQUOTA_ENFD|XFS_GQUOTA_CHKD);
98
98
 
99
99
                        if (!no_modify)
100
 
                                do_warn(", bogus flags will be cleared\n");
 
100
                                do_warn(_(", bogus flags will be cleared\n"));
101
101
                        else
102
 
                                do_warn(", bogus flags would be cleared\n");
 
102
                                do_warn(_(", bogus flags would be cleared\n"));
103
103
                }
104
104
        } else  {
105
105
                sb->sb_qflags = 0;
111
111
 
112
112
                        if (!(vn & XFS_SB_VERSION_ALLFBITS))
113
113
                                vn = XFS_SB_VERSION_TOOLD(vn);
114
 
                        
 
114
 
115
115
                        ASSERT(vn != 0);
116
116
                        sb->sb_versionnum = vn;
117
117
                }
155
155
                if (!fs_has_extflgbit_allowed)  {
156
156
                        issue_warning = 1;
157
157
                        do_warn(
158
 
                           "This filesystem has uninitialized extent flags.\n");
 
158
                        _("This filesystem has uninitialized extent flags.\n"));
159
159
                }
160
160
        }
161
161
 
163
163
                fs_shared = 1;
164
164
                if (!fs_shared_allowed)  {
165
165
                        issue_warning = 1;
166
 
                        do_warn("This filesystem is marked shared.\n");
 
166
                        do_warn(_("This filesystem is marked shared.\n"));
167
167
                }
168
168
        }
169
169
 
170
170
        if (issue_warning)  {
171
171
                do_warn(
172
 
"This filesystem uses 6.5 feature(s) not yet supported in this release.\n\
173
 
Please run a 6.5 version of xfs_repair.\n");
 
172
_("This filesystem uses feature(s) not yet supported in this release.\n"
 
173
  "Please run a more recent version of xfs_repair.\n"));
174
174
                return(1);
175
175
        }
176
176
 
177
177
        if (!XFS_SB_GOOD_VERSION(sb))  {
178
 
                do_warn(
179
 
        "WARNING:  unknown superblock version %d\n", XFS_SB_VERSION_NUM(sb));
180
 
                do_warn(
181
 
        "This filesystem contains features not understood by this program.\n");
 
178
                do_warn(_("WARNING:  unknown superblock version %d\n"),
 
179
                        XFS_SB_VERSION_NUM(sb));
 
180
                do_warn(
 
181
_("This filesystem contains features not understood by this program.\n"));
182
182
                return(1);
183
183
        }
184
184
 
185
185
        if (XFS_SB_VERSION_NUM(sb) == XFS_SB_VERSION_4)  {
186
186
                if (!fs_sb_feature_bits_allowed)  {
187
 
                        do_warn(
188
 
        "WARNING:  you have disallowed superblock feature bits disallowed\n");
189
 
                        do_warn(
190
 
        "\tbut this superblock has feature bits.  The superblock\n");
191
 
 
192
187
                        if (!no_modify)  {
193
188
                                do_warn(
194
 
        "\twill be downgraded.  This may cause loss of filesystem meta-data\n");
 
189
_("WARNING:  you have disallowed superblock-feature-bits-allowed\n"
 
190
  "\tbut this superblock has feature bits.  The superblock\n"
 
191
  "\twill be downgraded.  This may cause loss of filesystem meta-data\n"));
195
192
                        } else   {
196
193
                                do_warn(
197
 
        "\twould be downgraded.  This might cause loss of filesystem\n");
198
 
                                do_warn(
199
 
        "\tmeta-data.\n");
 
194
_("WARNING:  you have disallowed superblock-feature-bits-allowed\n"
 
195
  "\tbut this superblock has feature bits.  The superblock\n"
 
196
  "\twould be downgraded.  This might cause loss of filesystem\n"
 
197
  "\tmeta-data.\n"));
200
198
                        }
201
199
                } else   {
202
200
                        fs_sb_feature_bits = 1;
205
203
 
206
204
        if (XFS_SB_VERSION_HASATTR(sb))  {
207
205
                if (!fs_attributes_allowed)  {
208
 
                        do_warn(
209
 
        "WARNING:  you have disallowed attributes but this filesystem\n");
210
206
                        if (!no_modify)  {
211
207
                                do_warn(
212
 
        "\thas attributes.  The filesystem will be downgraded and\n");
213
 
                                do_warn(
214
 
        "\tall attributes will be removed.\n");
 
208
_("WARNING:  you have disallowed attributes but this filesystem\n"
 
209
  "\thas attributes.  The filesystem will be downgraded and\n"
 
210
  "\tall attributes will be removed.\n"));
215
211
                        } else  {
216
212
                                do_warn(
217
 
        "\thas attributes.  The filesystem would be downgraded and\n");
218
 
                                do_warn(
219
 
        "\tall attributes would be removed.\n");
 
213
_("WARNING:  you have disallowed attributes but this filesystem\n"
 
214
  "\thas attributes.  The filesystem would be downgraded and\n"
 
215
  "\tall attributes would be removed.\n"));
220
216
                        }
221
217
                } else   {
222
218
                        fs_attributes = 1;
225
221
 
226
222
        if (XFS_SB_VERSION_HASNLINK(sb))  {
227
223
                if (!fs_inode_nlink_allowed)  {
228
 
                        do_warn(
229
 
        "WARNING:  you have disallowed version 2 inodes but this filesystem\n");
230
224
                        if (!no_modify)  {
231
225
                                do_warn(
232
 
        "\thas version 2 inodes.  The filesystem will be downgraded and\n");
233
 
                                do_warn(
234
 
        "\tall version 2 inodes will be converted to version 1 inodes.\n");
235
 
                                do_warn(
236
 
        "\tThis may cause some hard links to files to be destroyed\n");
 
226
_("WARNING:  you have disallowed version 2 inodes but this filesystem\n"
 
227
  "\thas version 2 inodes.  The filesystem will be downgraded and\n"
 
228
  "\tall version 2 inodes will be converted to version 1 inodes.\n"
 
229
  "\tThis may cause some hard links to files to be destroyed\n"));
237
230
                        } else  {
238
231
                                do_warn(
239
 
        "\thas version 2 inodes.  The filesystem would be downgraded and\n");
240
 
                                do_warn(
241
 
        "\tall version 2 inodes would be converted to version 1 inodes.\n");
242
 
                                do_warn(
243
 
        "\tThis might cause some hard links to files to be destroyed\n");
 
232
_("WARNING:  you have disallowed version 2 inodes but this filesystem\n"
 
233
  "\thas version 2 inodes.  The filesystem would be downgraded and\n"
 
234
  "\tall version 2 inodes would be converted to version 1 inodes.\n"
 
235
  "\tThis might cause some hard links to files to be destroyed\n"));
244
236
                        }
245
237
                } else   {
246
238
                        fs_inode_nlink = 1;
249
241
 
250
242
        if (XFS_SB_VERSION_HASQUOTA(sb))  {
251
243
                if (!fs_quotas_allowed)  {
252
 
                        do_warn(
253
 
        "WARNING:  you have disallowed quotas but this filesystem\n");
254
244
                        if (!no_modify)  {
255
245
                                do_warn(
256
 
        "\thas quotas.  The filesystem will be downgraded and\n");
257
 
                                do_warn(
258
 
        "\tall quota information will be removed.\n");
 
246
_("WARNING:  you have disallowed quotas but this filesystem\n"
 
247
  "\thas quotas.  The filesystem will be downgraded and\n"
 
248
  "\tall quota information will be removed.\n"));
259
249
                        } else  {
260
250
                                do_warn(
261
 
        "\thas quotas.  The filesystem would be downgraded and\n");
262
 
                                do_warn(
263
 
        "\tall quota information would be removed.\n");
 
251
_("WARNING:  you have disallowed quotas but this filesystem\n"
 
252
  "\thas quotas.  The filesystem would be downgraded and\n"
 
253
  "\tall quota information would be removed.\n"));
264
254
                        }
265
255
                } else   {
266
256
                        fs_quotas = 1;
280
270
                        fs_aligned_inodes = 1;
281
271
                        fs_ino_alignment = sb->sb_inoalignmt;
282
272
                } else   {
283
 
                        do_warn(
284
 
        "WARNING:  you have disallowed aligned inodes but this filesystem\n");
285
273
                        if (!no_modify)  {
286
274
                                do_warn(
287
 
        "\thas aligned inodes.  The filesystem will be downgraded.\n");
288
 
                                do_warn(
289
 
"\tThis will permanently degrade the performance of this filesystem.\n");
 
275
_("WARNING:  you have disallowed aligned inodes but this filesystem\n"
 
276
  "\thas aligned inodes.  The filesystem will be downgraded.\n"
 
277
  "\tThis will permanently degrade the performance of this filesystem.\n"));
290
278
                        } else  {
291
279
                                do_warn(
292
 
        "\thas aligned inodes.  The filesystem would be downgraded.\n");
293
 
                                do_warn(
294
 
"\tThis would permanently degrade the performance of this filesystem.\n");
 
280
_("WARNING:  you have disallowed aligned inodes but this filesystem\n"
 
281
  "\thas aligned inodes.  The filesystem would be downgraded.\n"
 
282
  "\tThis would permanently degrade the performance of this filesystem.\n"));
295
283
                        }
296
284
                }
297
285
        }