From 2c794e6e9ee839b0e3332cc32bf3a4a6ecc91076 Mon Sep 17 00:00:00 2001 From: Nathan Scott Date: Mon, 15 Sep 2003 05:23:16 +0000 Subject: [PATCH] xfsprogs update - added code for manipulating additional inode flags, fix up some logprint bugs (minor), allow growfs to work on device/path now. bump version, document changes. --- VERSION | 2 +- db/frag.c | 4 +- debian/changelog | 4 +- doc/CHANGES | 14 ++ doc/CREDITS | 7 + growfs/explore.c | 18 +- include/xfs_fs.h | 12 +- io/open.c | 233 ++++++++++++++++++++++++- logprint/log_misc.c | 4 + logprint/logprint.c | 4 +- mkfs/xfs_mkfs.c | 2 +- po/xfsprogs.pot | 402 ++++++++++++++++++++++++++++---------------- repair/globals.h | 1 - repair/xfs_repair.c | 7 +- 14 files changed, 539 insertions(+), 175 deletions(-) diff --git a/VERSION b/VERSION index 2bccba924..869cdc5f3 100644 --- a/VERSION +++ b/VERSION @@ -3,5 +3,5 @@ # PKG_MAJOR=2 PKG_MINOR=5 -PKG_REVISION=7 +PKG_REVISION=8 PKG_BUILD=0 diff --git a/db/frag.c b/db/frag.c index 1c61bd9bf..467fa8cb3 100644 --- a/db/frag.c +++ b/db/frag.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000-2001 Silicon Graphics, Inc. All Rights Reserved. + * Copyright (c) 2000-2003 Silicon Graphics, Inc. All Rights Reserved. * * This program is free software; you can redistribute it and/or modify it * under the terms of version 2 of the GNU General Public License as @@ -103,7 +103,7 @@ static void scanfunc_ino(xfs_btree_sblock_t *ablock, int level, static const cmdinfo_t frag_cmd = { "frag", NULL, frag_f, 0, -1, 0, - "[-a] [-d] [-f] [-l] [-r]", + "[-a] [-d] [-f] [-l] [-q] [-R] [-r] [-v]", "get file fragmentation data", NULL }; static extmap_t * diff --git a/debian/changelog b/debian/changelog index 40d01c5be..a51249af0 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,8 +1,8 @@ -xfsprogs (2.5.7-1) unstable; urgency=low +xfsprogs (2.5.8-1) unstable; urgency=low * New upstream release. - -- Nathan Scott Fri, 29 Aug 2003 13:52:53 +1000 + -- Nathan Scott Fri, 12 Sep 2003 13:49:46 +1000 xfsprogs (2.5.6-1) unstable; urgency=low diff --git a/doc/CHANGES b/doc/CHANGES index 777728f6f..61f2dd125 100644 --- a/doc/CHANGES +++ b/doc/CHANGES @@ -1,3 +1,17 @@ +xfsprogs-2.5.8 (12 September 2003) + - Add missing options to xfs_db frag command one-line summary. + - Add xfs_io commands for setting and clearing new inode flags + for immutable/append-only/sync/no-atime/no-dump. + - Dump some other statfs fields in the xfs_io statfs commands. + - Remove "test" mode from xfs_repair, only useful in xfs_check. + - Fix problem in xfs_logprint where it was trying to continue + in the presence of a corrupt log when it shouldn't have. + - Fix an incorrect assertion in xfs_logprint in regards to the + validity of the log start block. + - Fix xfs_growfs (and hence xfs_info) to allow it to be given + either a mount point or a device in the mount table - it'll + figure it out and should do the right thing either way now. + xfsprogs-2.5.7 (29 August 2003) - Sync up user/kernel source in libxfs and headers. - Make xfs_copy a tad more portable, although work remains. diff --git a/doc/CREDITS b/doc/CREDITS index 6e86b54b8..109fe3d77 100644 --- a/doc/CREDITS +++ b/doc/CREDITS @@ -16,6 +16,13 @@ S: Peter Bangs Vej 258, 2TH S: 2500 Valby S: Denmark +N: Ethan Benson +E: erbenson@alaska.net +D: Additional inode flags (immutable, append-only, etc) +S: P.O. Box 770525 +S: Eagle River, AK 99577 +S: Alaska + N: Danny Cox E: danscox@mindspring.com D: ACL port to Linux diff --git a/growfs/explore.c b/growfs/explore.c index ba6e4f72b..8c720b60f 100644 --- a/growfs/explore.c +++ b/growfs/explore.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000-2002 Silicon Graphics, Inc. All Rights Reserved. + * Copyright (c) 2000-2003 Silicon Graphics, Inc. All Rights Reserved. * * This program is free software; you can redistribute it and/or modify it * under the terms of version 2 of the GNU General Public License as @@ -43,10 +43,12 @@ explore_mtab(char *mtab, char *mntpoint) { struct mntent *mnt; struct stat64 statuser; - struct stat64 statmtab; + struct stat64 statmtab_dir; + struct stat64 statmtab_dev; FILE *mtp; char *rtend; char *logend; + int havedev; if (!mtab) mtab = MOUNTED; @@ -63,13 +65,17 @@ explore_mtab(char *mtab, char *mntpoint) } while ((mnt = getmntent(mtp)) != NULL) { - if (stat64(mnt->mnt_dir, &statmtab) < 0) { + if (stat64(mnt->mnt_dir, &statmtab_dir) < 0) { fprintf(stderr, _("%s: ignoring entry %s in %s: %s\n"), progname, mnt->mnt_dir, mtab, strerror(errno)); continue; } - if (statuser.st_ino != statmtab.st_ino || - statuser.st_dev != statmtab.st_dev) + havedev = (stat64(mnt->mnt_fsname, &statmtab_dev) != -1); + if ( !((statuser.st_ino == statmtab_dir.st_ino && + statuser.st_dev == statmtab_dir.st_dev) || + (statuser.st_ino == statmtab_dev.st_ino && + statuser.st_dev == statmtab_dev.st_dev && + havedev)) ) continue; else if (strcmp(mnt->mnt_type, "xfs") != 0) { fprintf(stderr, _("%s: %s is not an XFS filesystem\n"), @@ -81,7 +87,7 @@ explore_mtab(char *mtab, char *mntpoint) if (mnt == NULL) { fprintf(stderr, - _("%s: %s is not a filesystem mount point, according to %s\n"), + _("%s: %s is not a mounted XFS filesystem, according to %s\n"), progname, mntpoint, MOUNTED); exit(1); } diff --git a/include/xfs_fs.h b/include/xfs_fs.h index d52e81462..c2c3cc118 100644 --- a/include/xfs_fs.h +++ b/include/xfs_fs.h @@ -69,12 +69,14 @@ struct fsxattr { * There should be a one-to-one correspondence between these flags and the * XFS_DIFLAG_s. */ -#define XFS_XFLAG_REALTIME 0x00000001 -#define XFS_XFLAG_PREALLOC 0x00000002 +#define XFS_XFLAG_REALTIME 0x00000001 /* data in realtime volume */ +#define XFS_XFLAG_PREALLOC 0x00000002 /* preallocated file extents */ +#define XFS_XFLAG_IMMUTABLE 0x00000008 /* file cannot be modified */ +#define XFS_XFLAG_APPEND 0x00000010 /* all writes append */ +#define XFS_XFLAG_SYNC 0x00000020 /* all writes synchronous */ +#define XFS_XFLAG_NOATIME 0x00000040 /* do not update access time */ +#define XFS_XFLAG_NODUMP 0x00000080 /* do not include in backups */ #define XFS_XFLAG_HASATTR 0x80000000 /* no DIFLAG for this */ -#define XFS_XFLAG_ALL \ - ( XFS_XFLAG_REALTIME|XFS_XFLAG_PREALLOC|XFS_XFLAG_HASATTR ) - /* * Structure for XFS_IOC_GETBMAP. diff --git a/io/open.c b/io/open.c index 01089aa27..76d147a0b 100644 --- a/io/open.c +++ b/io/open.c @@ -39,6 +39,8 @@ static cmdinfo_t open_cmd; static cmdinfo_t stat_cmd; static cmdinfo_t setfl_cmd; static cmdinfo_t statfs_cmd; +static cmdinfo_t chattr_cmd; +static cmdinfo_t lsattr_cmd; static cmdinfo_t extsize_cmd; static int stat_f(int, char **); @@ -137,9 +139,10 @@ open_help(void) " -s -- open with O_SYNC\n" " -t -- open with O_TRUNC (truncate the file to zero length if it exists)\n" " -x -- mark the file as a realtime XFS file immediately after opening it\n" -" Note1: read/write direct IO requests must be blocksize aligned.\n" -" Note2: the bmap for non-regular files can be obtained provided the file\n" -" was opened appropriately (in particular, must be opened read-only).\n" +" Note1: usually read/write direct IO requests must be blocksize aligned.\n" +" Note2: some kernels, however, allow sectorsize alignment for direct IO.\n" +" Note3: the bmap for non-regular files can be obtained provided the file\n" +" was opened correctly (in particular, must be opened read-only).\n" "\n")); } @@ -259,6 +262,198 @@ filetype(mode_t mode) return NULL; } +static void +printxattr(int flags, int verbose, int dofname, int dobraces, int doeol) +{ + static struct { + int flag; + char *shortname; + char *longname; + } *p, xflags[] = { + { XFS_XFLAG_REALTIME, "r", "realtime" }, + { XFS_XFLAG_PREALLOC, "p", "prealloc" }, + { XFS_XFLAG_IMMUTABLE, "i", "immutable" }, + { XFS_XFLAG_APPEND, "a", "append-only" }, + { XFS_XFLAG_SYNC, "s", "sync" }, + { XFS_XFLAG_NOATIME, "A", "no-atime" }, + { XFS_XFLAG_NODUMP, "d", "no-dump" }, + { 0, NULL, NULL } + }; + int first = 1; + + if (dobraces) + fputs("[", stdout); + for (p = xflags; p->flag; p++) { + if (flags & p->flag) { + if (verbose) { + if (first) + first = 0; + else + fputs(", ", stdout); + fputs(p->longname, stdout); + } else { + fputs(p->shortname, stdout); + } + } else if (!verbose) { + fputs("-", stdout); + } + } + if (dobraces) + fputs("]", stdout); + if (dofname) + printf(" %s ", fname); + if (doeol) + fputs("\n", stdout); +} + +static int +lsattr_f( + int argc, + char **argv) +{ + struct fsxattr fsx; + int c, aflag = 0, vflag = 0; + + while ((c = getopt(argc, argv, "av")) != EOF) { + switch (c) { + case 'a': + aflag = 1; + vflag = 0; + break; + case 'v': + aflag = 0; + vflag = 1; + break; + default: + printf(_("invalid lsattr argument -- '%c'\n"), c); + return 0; + } + } + + if ((xfsctl(fname, fdesc, XFS_IOC_FSGETXATTR, &fsx)) < 0) { + perror("xfsctl(XFS_IOC_FSGETXATTR)"); + } else { + printxattr(fsx.fsx_xflags, vflag, !aflag, vflag, !aflag); + if (aflag) { + fputs("/", stdout); + printxattr(-1, 0, 1, 0, 1); + } + } + return 0; +} + +static void +lsattr_help(void) +{ + printf(_( +"\n" +" displays the set of extended inode flags associated with the current file\n" +"\n" +" Each individual flag is displayed as a single character, in this order:\n" +" r -- file data is stored in the realtime section\n" +" p -- file has preallocated extents (cannot be changed using chattr)\n" +" i -- immutable, file cannot be modified\n" +" a -- append-only, file can only be appended to\n" +" s -- all updates are synchronous\n" +" A -- the access time is not updated for this inode\n" +" d -- do not include this file in a dump of the filesystem\n" +"\n" +" Options:\n" +" -a -- show all flags which can be set alongside those which are set\n" +" -v -- verbose mode; show long names of flags, not single characters\n" +"\n")); +} + +static int +chattr_f( + int argc, + char **argv) +{ + static struct { + int flag; + char optc; + } *p, xflags[] = { + { XFS_XFLAG_REALTIME, 'r' }, + { XFS_XFLAG_IMMUTABLE, 'i' }, + { XFS_XFLAG_APPEND, 'a' }, + { XFS_XFLAG_SYNC, 's' }, + { XFS_XFLAG_NOATIME, 'A' }, + { XFS_XFLAG_NODUMP, 'd' }, + { 0, '\0' } + }; + struct fsxattr attr; + unsigned int i = 0; + char *c; + + if (xfsctl(fname, fdesc, XFS_IOC_FSGETXATTR, &attr) < 0) { + perror("XFS_IOC_FSGETXATTR"); + return 0; + } + while (++i < argc) { + if (argv[i][0] == '+') { + for (c = &argv[i][1]; *c; c++) { + for (p = xflags; p->flag; p++) { + if (p->optc == *c) { + attr.fsx_xflags |= p->flag; + break; + } + } + if (!p->flag) { + fprintf(stderr, _("%s: unknown flag\n"), + progname); + return 0; + } + } + } else if (argv[i][0] == '-') { + for (c = &argv[i][1]; *c; c++) { + for (p = xflags; p->flag; p++) { + if (p->optc == *c) { + attr.fsx_xflags &= ~p->flag; + break; + } + } + if (!p->flag) { + fprintf(stderr, _("%s: unknown flag\n"), + progname); + return 0; + } + } + } else { + fprintf(stderr, _("%s: bad chattr command, not +/-X\n"), + progname); + return 0; + } + } + if (xfsctl(fname, fdesc, XFS_IOC_FSSETXATTR, &attr) < 0) + perror("XFS_IOC_FSSETXATTR"); + return 0; +} + +static void +chattr_help(void) +{ + printf(_( +"\n" +" modifies the set of extended inode flags associated with the current file\n" +"\n" +" Examples:\n" +" 'chattr +a' - sets the append-only flag\n" +" 'chattr -a' - clears the append-only flag\n" +"\n" +" +/-r -- set/clear the realtime flag\n" +" +/-i -- set/clear the immutable flag\n" +" +/-a -- set/clear the append-only flag\n" +" +/-s -- set/clear the sync flag\n" +" +/-A -- set/clear the no-atime flag\n" +" +/-d -- set/clear the no-dump flag\n" +" Note1: user must have certain capabilities to modify immutable/append-only.\n" +" Note2: immutable/append-only files cannot be deleted; removing these files\n" +" requires the immutable/append-only flag to be cleared first.\n" +" Note3: the realtime flag can only be set if the filesystem has a realtime\n" +" section, and the (regular) file must be empty when the flag is set.\n" +"\n")); +} + static int stat_f( int argc, @@ -267,6 +462,7 @@ stat_f( struct fsxattr fsx; struct stat64 st; char fullname[PATH_MAX + 1]; + int verbose = (argc == 2 && !strcmp(argv[1], "-v")); printf(_("fd.path = \"%s\"\n"), realpath(fname, fullname) ? fullname : fname); @@ -283,7 +479,7 @@ stat_f( printf(_("stat.type = %s\n"), filetype(st.st_mode)); printf(_("stat.size = %lld\n"), (long long)st.st_size); printf(_("stat.blocks = %lld\n"), (long long)st.st_blocks); - if (argc == 2 && !strcmp(argv[1], "-v")) { + if (verbose) { printf(_("stat.atime = %s"), ctime(&st.st_atime)); printf(_("stat.mtime = %s"), ctime(&st.st_mtime)); printf(_("stat.ctime = %s"), ctime(&st.st_ctime)); @@ -292,7 +488,8 @@ stat_f( if ((xfsctl(fname, fdesc, XFS_IOC_FSGETXATTR, &fsx)) < 0) { perror("xfsctl(XFS_IOC_FSGETXATTR)"); } else { - printf(_("xattr.xflags = 0x%x\n"), fsx.fsx_xflags); + printf(_("xattr.xflags = 0x%x "), fsx.fsx_xflags); + printxattr(fsx.fsx_xflags, verbose, 0, 1, 1); printf(_("xattr.extsize = %u\n"), fsx.fsx_extsize); printf(_("xattr.nextents = %u\n"), fsx.fsx_nextents); } @@ -380,9 +577,13 @@ statfs_f( } else { printf(_("statfs.f_bsize = %lld\n"), (long long) st.f_bsize); printf(_("statfs.f_blocks = %lld\n"), (long long) st.f_blocks); -#if !defined(__sgi__) +#if defined(__sgi__) + printf(_("statfs.f_frsize = %lld\n"), (long long) st.f_frsize); +else printf(_("statfs.f_bavail = %lld\n"), (long long) st.f_bavail); #endif + printf(_("statfs.f_files = %lld\n"), (long long) st.f_files); + printf(_("statfs.f_ffree = %lld\n"), (long long) st.f_ffree); } if ((xfsctl(fname, fdesc, XFS_IOC_FSGEOMETRY_V1, &fsgeo)) < 0) { perror("xfsctl(XFS_IOC_FSGEOMETRY_V1)"); @@ -435,6 +636,24 @@ open_init(void) statfs_cmd.oneline = _("statistics on the filesystem of the currently open file"); + chattr_cmd.name = _("chattr"); + chattr_cmd.cfunc = chattr_f; + chattr_cmd.args = _("[+/-riasAd]"); + chattr_cmd.argmin = 1; + chattr_cmd.argmax = 1; + chattr_cmd.oneline = + _("change extended inode flags on the currently open file"); + chattr_cmd.help = chattr_help; + + lsattr_cmd.name = _("lsattr"); + lsattr_cmd.cfunc = lsattr_f; + lsattr_cmd.args = _("[-a | -v]"); + lsattr_cmd.argmin = 0; + lsattr_cmd.argmax = 2; + lsattr_cmd.oneline = + _("list extended inode flags set on the currently open file"); + lsattr_cmd.help = lsattr_help; + extsize_cmd.name = _("extsize"); extsize_cmd.cfunc = extsize_f; extsize_cmd.argmin = 1; @@ -446,5 +665,7 @@ open_init(void) add_command(&stat_cmd); add_command(&setfl_cmd); add_command(&statfs_cmd); + add_command(&chattr_cmd); + add_command(&lsattr_cmd); add_command(&extsize_cmd); } diff --git a/logprint/log_misc.c b/logprint/log_misc.c index ac78e40a2..35f6f203b 100644 --- a/logprint/log_misc.c +++ b/logprint/log_misc.c @@ -1030,6 +1030,10 @@ xlog_print_record(int fd, default: { fprintf(stderr, "%s: unknown log operation type (%x)\n", progname, *(unsigned short *)ptr); + if (print_exit) { + free(buf); + return BAD_HEADER; + } skip = 0; ptr += INT_GET(op_head->oh_len, ARCH_CONVERT); } diff --git a/logprint/logprint.c b/logprint/logprint.c index cc9aaac29..7cda29b71 100644 --- a/logprint/logprint.c +++ b/logprint/logprint.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000-2002 Silicon Graphics, Inc. All Rights Reserved. + * Copyright (c) 2000-2003 Silicon Graphics, Inc. All Rights Reserved. * * This program is free software; you can redistribute it and/or modify it * under the terms of version 2 of the GNU General Public License as @@ -241,7 +241,7 @@ main(int argc, char **argv) printf("daddr: %lld length: %lld\n\n", (long long)x.logBBstart, (long long)x.logBBsize); - ASSERT(x.logBBstart <= INT_MAX); + ASSERT(x.logBBsize <= INT_MAX); /* init log structure */ log.l_dev = x.logdev; diff --git a/mkfs/xfs_mkfs.c b/mkfs/xfs_mkfs.c index 7762db3e3..7a7768542 100644 --- a/mkfs/xfs_mkfs.c +++ b/mkfs/xfs_mkfs.c @@ -1936,7 +1936,7 @@ an AG size that is one stripe unit smaller, for example %llu.\n"), * will succeed. */ if (xi.disfile && ftruncate64(xi.dfd, dblocks * blocksize) < 0) { - fprintf(stderr, _("%s: Growing the data section file failed\n"), + fprintf(stderr, _("%s: Growing the data section failed\n"), progname); exit(1); } diff --git a/po/xfsprogs.pot b/po/xfsprogs.pot index e4b781eb0..7f3d559c9 100644 --- a/po/xfsprogs.pot +++ b/po/xfsprogs.pot @@ -9,7 +9,7 @@ msgid "" msgstr "" #: ../freeze/xfs_freeze.c:90 ../growfs/xfs_growfs.c:214 ../imap/xfs_imap.c:66 -#: ../io/open.c:78 +#: ../io/open.c:83 #, c-format msgid "%s: specified file [\"%s\"] is not on an XFS filesystem\n" msgstr "" @@ -24,29 +24,29 @@ msgstr "" msgid "%s: cannot unfreeze filesystem mounted at %s: %s\n" msgstr "" -#: ../growfs/explore.c:55 +#: ../growfs/explore.c:57 #, c-format msgid "%s: cannot access mount list %s: %s\n" msgstr "" -#: ../growfs/explore.c:60 +#: ../growfs/explore.c:62 #, c-format msgid "%s: cannot access mount point %s: %s\n" msgstr "" -#: ../growfs/explore.c:67 +#: ../growfs/explore.c:69 #, c-format msgid "%s: ignoring entry %s in %s: %s\n" msgstr "" -#: ../growfs/explore.c:75 +#: ../growfs/explore.c:81 #, c-format msgid "%s: %s is not an XFS filesystem\n" msgstr "" -#: ../growfs/explore.c:84 +#: ../growfs/explore.c:90 #, c-format -msgid "%s: %s is not a filesystem mount point, according to %s\n" +msgid "%s: %s is not a mounted XFS filesystem, according to %s\n" msgstr "" #: ../growfs/xfs_growfs.c:53 @@ -283,7 +283,7 @@ msgstr "" msgid "%s: no extents\n" msgstr "" -#: ../io/bmap.c:261 ../io/bmap.c:367 +#: ../io/bmap.c:261 ../io/bmap.c:376 msgid "hole" msgstr "" @@ -292,63 +292,72 @@ msgstr "" msgid " %lld blocks\n" msgstr "" -#: ../io/bmap.c:335 +#: ../io/bmap.c:340 msgid "EXT" msgstr "" -#: ../io/bmap.c:336 +#: ../io/bmap.c:341 msgid "FILE-OFFSET" msgstr "" -#: ../io/bmap.c:337 +#: ../io/bmap.c:342 msgid "BLOCK-RANGE" msgstr "" -#: ../io/bmap.c:338 +#: ../io/bmap.c:343 msgid "AG" msgstr "" -#: ../io/bmap.c:339 +#: ../io/bmap.c:344 msgid "AG-OFFSET" msgstr "" -#: ../io/bmap.c:340 +#: ../io/bmap.c:345 msgid "TOTAL" msgstr "" -#: ../io/bmap.c:396 -msgid " FLG Values:\n" +#: ../io/bmap.c:346 +msgid " FLAGS" +msgstr "" + +#: ../io/bmap.c:405 +msgid " FLAG Values:\n" msgstr "" -#: ../io/bmap.c:397 +#: ../io/bmap.c:406 #, c-format -msgid " %5.5o Doesn't begin on stripe unit\n" +msgid " %*.*o Unwritten preallocated extent\n" msgstr "" -#: ../io/bmap.c:399 +#: ../io/bmap.c:408 #, c-format -msgid " %5.5o Doesn't end on stripe unit\n" +msgid " %*.*o Doesn't begin on stripe unit\n" msgstr "" -#: ../io/bmap.c:401 +#: ../io/bmap.c:410 #, c-format -msgid " %5.5o Doesn't begin on stripe width\n" +msgid " %*.*o Doesn't end on stripe unit\n" msgstr "" -#: ../io/bmap.c:403 +#: ../io/bmap.c:412 #, c-format -msgid " %5.5o Doesn't end on stripe width\n" +msgid " %*.*o Doesn't begin on stripe width\n" msgstr "" #: ../io/bmap.c:414 +#, c-format +msgid " %*.*o Doesn't end on stripe width\n" +msgstr "" + +#: ../io/bmap.c:425 msgid "bmap" msgstr "" -#: ../io/bmap.c:418 +#: ../io/bmap.c:429 msgid "[-adlpv] [-n nx]" msgstr "" -#: ../io/bmap.c:419 +#: ../io/bmap.c:430 msgid "print block mapping for an XFS file" msgstr "" @@ -428,7 +437,7 @@ msgstr "" msgid "Usage: %s [-r] [-p prog] [-c cmd]... file\n" msgstr "" -#: ../io/open.c:122 +#: ../io/open.c:127 msgid "" "\n" " opens a new file in the requested mode, after closing the current file\n" @@ -445,255 +454,354 @@ msgid "" " -s -- open with O_SYNC\n" " -t -- open with O_TRUNC (truncate the file to zero length if it exists)\n" " -x -- mark the file as a realtime XFS file immediately after opening it\n" -" Note1: read/write direct IO requests must be blocksize aligned.\n" -" Note2: the bmap for non-regular files can be obtained provided the file\n" -" was opened appropriately (in particular, must be opened read-only).\n" +" Note1: usually read/write direct IO requests must be blocksize aligned.\n" +" Note2: some kernels, however, allow sectorsize alignment for direct IO.\n" +" Note3: the bmap for non-regular files can be obtained provided the file\n" +" was opened correctly (in particular, must be opened read-only).\n" "\n" msgstr "" -#: ../io/open.c:242 +#: ../io/open.c:248 msgid "socket" msgstr "" -#: ../io/open.c:244 +#: ../io/open.c:250 msgid "directory" msgstr "" -#: ../io/open.c:246 +#: ../io/open.c:252 msgid "char device" msgstr "" -#: ../io/open.c:248 +#: ../io/open.c:254 msgid "block device" msgstr "" -#: ../io/open.c:250 +#: ../io/open.c:256 msgid "regular file" msgstr "" -#: ../io/open.c:252 +#: ../io/open.c:258 msgid "symbolic link" msgstr "" -#: ../io/open.c:254 +#: ../io/open.c:260 msgid "fifo" msgstr "" -#: ../io/open.c:268 ../io/open.c:373 +#: ../io/open.c:328 +#, c-format +msgid "invalid lsattr argument -- '%c'\n" +msgstr "" + +#: ../io/open.c:349 +msgid "" +"\n" +" displays the set of extended inode flags associated with the current file\n" +"\n" +" Each individual flag is displayed as a single character, in this order:\n" +" r -- file data is stored in the realtime section\n" +" p -- file has preallocated extents (cannot be changed using chattr)\n" +" i -- immutable, file cannot be modified\n" +" a -- append-only, file can only be appended to\n" +" s -- all updates are synchronous\n" +" A -- the access time is not updated for this inode\n" +" d -- do not include this file in a dump of the filesystem\n" +"\n" +" Options:\n" +" -a -- show all flags which can be set alongside those which are set\n" +" -v -- verbose mode; show long names of flags, not single characters\n" +"\n" +msgstr "" + +#: ../io/open.c:402 ../io/open.c:416 +#, c-format +msgid "%s: unknown flag\n" +msgstr "" + +#: ../io/open.c:422 +#, c-format +msgid "%s: bad chattr command, not +/-X\n" +msgstr "" + +#: ../io/open.c:436 +msgid "" +"\n" +" modifies the set of extended inode flags associated with the current file\n" +"\n" +" Examples:\n" +" 'chattr +a' - sets the append-only flag\n" +" 'chattr -a' - clears the append-only flag\n" +"\n" +" +/-r -- set/clear the realtime flag\n" +" +/-i -- set/clear the immutable flag\n" +" +/-a -- set/clear the append-only flag\n" +" +/-s -- set/clear the sync flag\n" +" +/-A -- set/clear the no-atime flag\n" +" +/-d -- set/clear the no-dump flag\n" +" Note1: user must have certain capabilities to modify immutable/append-" +"only.\n" +" Note2: immutable/append-only files cannot be deleted; removing these files\n" +" requires the immutable/append-only flag to be cleared first.\n" +" Note3: the realtime flag can only be set if the filesystem has a realtime\n" +" section, and the (regular) file must be empty when the flag is set.\n" +"\n" +msgstr "" + +#: ../io/open.c:467 ../io/open.c:573 #, c-format msgid "fd.path = \"%s\"\n" msgstr "" -#: ../io/open.c:270 +#: ../io/open.c:469 #, c-format msgid "fd.flags = %s,%s,%s%s%s\n" msgstr "" -#: ../io/open.c:271 +#: ../io/open.c:470 msgid "sync" msgstr "" -#: ../io/open.c:271 +#: ../io/open.c:470 msgid "non-sync" msgstr "" -#: ../io/open.c:272 +#: ../io/open.c:471 msgid "direct" msgstr "" -#: ../io/open.c:272 +#: ../io/open.c:471 msgid "non-direct" msgstr "" -#: ../io/open.c:273 +#: ../io/open.c:472 msgid "read-only" msgstr "" -#: ../io/open.c:273 +#: ../io/open.c:472 msgid "read-write" msgstr "" -#: ../io/open.c:274 +#: ../io/open.c:473 msgid ",real-time" msgstr "" -#: ../io/open.c:275 +#: ../io/open.c:474 msgid ",append-only" msgstr "" -#: ../io/open.c:279 +#: ../io/open.c:478 #, c-format msgid "stat.ino = %lld\n" msgstr "" -#: ../io/open.c:280 +#: ../io/open.c:479 #, c-format msgid "stat.type = %s\n" msgstr "" -#: ../io/open.c:281 +#: ../io/open.c:480 #, c-format msgid "stat.size = %lld\n" msgstr "" -#: ../io/open.c:282 +#: ../io/open.c:481 #, c-format msgid "stat.blocks = %lld\n" msgstr "" -#: ../io/open.c:284 +#: ../io/open.c:483 #, c-format msgid "stat.atime = %s" msgstr "" -#: ../io/open.c:285 +#: ../io/open.c:484 #, c-format msgid "stat.mtime = %s" msgstr "" -#: ../io/open.c:286 +#: ../io/open.c:485 #, c-format msgid "stat.ctime = %s" msgstr "" -#: ../io/open.c:292 +#: ../io/open.c:491 #, c-format -msgid "xattr.xflags = 0x%x\n" +msgid "xattr.xflags = 0x%x " msgstr "" -#: ../io/open.c:293 +#: ../io/open.c:493 #, c-format msgid "xattr.extsize = %u\n" msgstr "" -#: ../io/open.c:294 +#: ../io/open.c:494 #, c-format msgid "xattr.nextents = %u\n" msgstr "" -#: ../io/open.c:327 +#: ../io/open.c:527 #, c-format msgid "invalid setfl argument -- '%c'\n" msgstr "" -#: ../io/open.c:348 +#: ../io/open.c:548 #, c-format msgid "non-numeric extsize argument -- %s\n" msgstr "" -#: ../io/open.c:378 +#: ../io/open.c:578 #, c-format msgid "statfs.f_bsize = %lld\n" msgstr "" -#: ../io/open.c:379 +#: ../io/open.c:579 #, c-format msgid "statfs.f_blocks = %lld\n" msgstr "" -#: ../io/open.c:381 +#: ../io/open.c:581 +#, c-format +msgid "statfs.f_frsize = %lld\n" +msgstr "" + +#: ../io/open.c:583 #, c-format msgid "statfs.f_bavail = %lld\n" msgstr "" -#: ../io/open.c:387 +#: ../io/open.c:585 +#, c-format +msgid "statfs.f_files = %lld\n" +msgstr "" + +#: ../io/open.c:586 +#, c-format +msgid "statfs.f_ffree = %lld\n" +msgstr "" + +#: ../io/open.c:591 #, c-format msgid "geom.bsize = %u\n" msgstr "" -#: ../io/open.c:388 +#: ../io/open.c:592 #, c-format msgid "geom.agcount = %u\n" msgstr "" -#: ../io/open.c:389 +#: ../io/open.c:593 #, c-format msgid "geom.agblocks = %u\n" msgstr "" -#: ../io/open.c:390 +#: ../io/open.c:594 #, c-format msgid "geom.datablocks = %llu\n" msgstr "" -#: ../io/open.c:392 +#: ../io/open.c:596 #, c-format msgid "geom.rtblocks = %llu\n" msgstr "" -#: ../io/open.c:394 +#: ../io/open.c:598 #, c-format msgid "geom.rtextents = %llu\n" msgstr "" -#: ../io/open.c:396 +#: ../io/open.c:600 #, c-format msgid "geom.rtextsize = %u\n" msgstr "" -#: ../io/open.c:397 +#: ../io/open.c:601 #, c-format msgid "geom.sunit = %u\n" msgstr "" -#: ../io/open.c:398 +#: ../io/open.c:602 #, c-format msgid "geom.swidth = %u\n" msgstr "" -#: ../io/open.c:406 +#: ../io/open.c:610 msgid "open" msgstr "" -#: ../io/open.c:407 +#: ../io/open.c:611 msgid "o" msgstr "" -#: ../io/open.c:411 +#: ../io/open.c:615 msgid "[-acdrstx] [path]" msgstr "" -#: ../io/open.c:413 +#: ../io/open.c:617 msgid "close the current file, open file specified by path" msgstr "" -#: ../io/open.c:416 +#: ../io/open.c:620 msgid "stat" msgstr "" -#: ../io/open.c:420 +#: ../io/open.c:624 msgid "[-v]" msgstr "" -#: ../io/open.c:422 +#: ../io/open.c:626 msgid "statistics on the currently open file" msgstr "" -#: ../io/open.c:424 +#: ../io/open.c:628 msgid "setfl" msgstr "" -#: ../io/open.c:426 +#: ../io/open.c:630 msgid "[-adx]" msgstr "" -#: ../io/open.c:428 +#: ../io/open.c:632 msgid "set/clear append/direct flags on the open file" msgstr "" -#: ../io/open.c:430 +#: ../io/open.c:634 msgid "statfs" msgstr "" -#: ../io/open.c:433 +#: ../io/open.c:637 msgid "statistics on the filesystem of the currently open file" msgstr "" -#: ../io/open.c:435 +#: ../io/open.c:639 +msgid "chattr" +msgstr "" + +#: ../io/open.c:641 +msgid "[+/-riasAd]" +msgstr "" + +#: ../io/open.c:645 +msgid "change extended inode flags on the currently open file" +msgstr "" + +#: ../io/open.c:648 +msgid "lsattr" +msgstr "" + +#: ../io/open.c:650 +msgid "[-a | -v]" +msgstr "" + +#: ../io/open.c:654 +msgid "list extended inode flags set on the currently open file" +msgstr "" + +#: ../io/open.c:657 msgid "extsize" msgstr "" -#: ../io/open.c:440 +#: ../io/open.c:662 msgid "set prefered extent size (in bytes) for the open file" msgstr "" @@ -712,17 +820,17 @@ msgid "" "\n" msgstr "" -#: ../io/pread.c:153 ../io/pwrite.c:113 +#: ../io/pread.c:153 ../io/pwrite.c:112 #, c-format msgid "non-numeric bsize -- %s\n" msgstr "" -#: ../io/pread.c:171 ../io/prealloc.c:53 ../io/pwrite.c:149 +#: ../io/pread.c:171 ../io/prealloc.c:53 ../io/pwrite.c:148 #, c-format msgid "non-numeric offset argument -- %s\n" msgstr "" -#: ../io/pread.c:177 ../io/prealloc.c:58 ../io/pwrite.c:155 +#: ../io/pread.c:177 ../io/prealloc.c:58 ../io/pwrite.c:154 #, c-format msgid "non-numeric length argument -- %s\n" msgstr "" @@ -804,34 +912,34 @@ msgid "" "\n" msgstr "" -#: ../io/pwrite.c:127 +#: ../io/pwrite.c:126 #, c-format msgid "non-numeric skip -- %s\n" msgstr "" -#: ../io/pwrite.c:134 +#: ../io/pwrite.c:133 #, c-format msgid "non-numeric seed -- %s\n" msgstr "" -#: ../io/pwrite.c:170 +#: ../io/pwrite.c:169 #, c-format msgid "wrote %ld/%ld bytes at offset %lld\n" msgstr "" -#: ../io/pwrite.c:179 +#: ../io/pwrite.c:178 msgid "pwrite" msgstr "" -#: ../io/pwrite.c:180 +#: ../io/pwrite.c:179 msgid "w" msgstr "" -#: ../io/pwrite.c:185 +#: ../io/pwrite.c:184 msgid "[-i infile [-d] [-s skip]] [-b bs] [-S seed] off len" msgstr "" -#: ../io/pwrite.c:187 +#: ../io/pwrite.c:186 msgid "writes a number of bytes at a specified offset" msgstr "" @@ -1427,21 +1535,24 @@ msgstr "" #: ../mkfs/xfs_mkfs.c:1773 #, c-format -msgid "" -"log stripe unit (%d bytes) is too large for kernel to handle (max 256k)\n" +msgid "log stripe unit (%d bytes) is too large (maximum is 256KiB)\n" msgstr "" -#: ../mkfs/xfs_mkfs.c:1800 +#: ../mkfs/xfs_mkfs.c:1776 +msgid "log stripe unit adjusted to 32KiB\n" +msgstr "" + +#: ../mkfs/xfs_mkfs.c:1801 #, c-format msgid "internal log size %lld too large, must fit in allocation group\n" msgstr "" -#: ../mkfs/xfs_mkfs.c:1807 +#: ../mkfs/xfs_mkfs.c:1808 #, c-format msgid "log ag number %d too large, must be less than %lld\n" msgstr "" -#: ../mkfs/xfs_mkfs.c:1833 +#: ../mkfs/xfs_mkfs.c:1834 #, c-format msgid "" "meta-data=%-22s isize=%-6d agcount=%lld, agsize=%lld blks\n" @@ -1454,55 +1565,55 @@ msgid "" "realtime =%-22s extsz=%-6d blocks=%lld, rtextents=%lld\n" msgstr "" -#: ../mkfs/xfs_mkfs.c:1938 +#: ../mkfs/xfs_mkfs.c:1939 #, c-format -msgid "%s: Growing the data section file failed\n" +msgid "%s: Growing the data section failed\n" msgstr "" -#: ../mkfs/xfs_mkfs.c:1966 +#: ../mkfs/xfs_mkfs.c:1967 #, c-format msgid "%s: filesystem failed to initialize\n" msgstr "" -#: ../mkfs/xfs_mkfs.c:1974 +#: ../mkfs/xfs_mkfs.c:1975 #, c-format msgid "%s: log size (%lld) is too small for transaction reservations\n" msgstr "" -#: ../mkfs/xfs_mkfs.c:2192 +#: ../mkfs/xfs_mkfs.c:2193 #, c-format msgid "%s: root inode created in AG %u, not AG 0\n" msgstr "" -#: ../mkfs/xfs_mkfs.c:2268 +#: ../mkfs/xfs_mkfs.c:2269 #, c-format msgid "Cannot specify both -%c %s and -%c %s\n" msgstr "" -#: ../mkfs/xfs_mkfs.c:2279 +#: ../mkfs/xfs_mkfs.c:2280 #, c-format msgid "Illegal value %s for -%s option\n" msgstr "" -#: ../mkfs/xfs_mkfs.c:2296 +#: ../mkfs/xfs_mkfs.c:2297 #, c-format msgid "-%c %s option requires a value\n" msgstr "" -#: ../mkfs/xfs_mkfs.c:2309 ../repair/xfs_repair.c:143 +#: ../mkfs/xfs_mkfs.c:2310 ../repair/xfs_repair.c:143 msgid "option respecified\n" msgstr "" -#: ../mkfs/xfs_mkfs.c:2318 ../repair/xfs_repair.c:150 +#: ../mkfs/xfs_mkfs.c:2319 ../repair/xfs_repair.c:150 #, c-format msgid "unknown option -%c %s\n" msgstr "" -#: ../mkfs/xfs_mkfs.c:2357 +#: ../mkfs/xfs_mkfs.c:2358 msgid "blocksize not available yet.\n" msgstr "" -#: ../mkfs/xfs_mkfs.c:2381 +#: ../mkfs/xfs_mkfs.c:2382 #, c-format msgid "" "Usage: %s\n" @@ -1565,7 +1676,7 @@ msgstr "" msgid "%s: can't tell if \"%s\" is writable: %s\n" msgstr "" -#: ../libxfs/darwin.c:87 ../libxfs/freebsd.c:169 ../libxfs/irix.c:75 +#: ../libxfs/darwin.c:87 ../libxfs/freebsd.c:127 ../libxfs/irix.c:75 #: ../libxfs/linux.c:137 #, c-format msgid "%s: cannot stat the device file \"%s\": %s\n" @@ -1576,19 +1687,39 @@ msgstr "" msgid "%s: can't determine device size: %s\n" msgstr "" -#: ../libxfs/freebsd.c:118 +#: ../libxfs/freebsd.c:62 #, c-format -msgid "%s: can't figure out partition info\n" +msgid "%s: %s possibly contains a mounted filesystem\n" msgstr "" -#: ../libxfs/freebsd.c:142 +#: ../libxfs/freebsd.c:73 ../libxfs/linux.c:73 #, c-format -msgid "%s: can't read disk label: %s\n" +msgid "%s: %s contains a mounted filesystem\n" msgstr "" -#: ../libxfs/freebsd.c:152 +#: ../libxfs/freebsd.c:88 ../libxfs/linux.c:91 #, c-format -msgid "%s: partition %s is unavailable\n" +msgid "%s: %s contains a possibly writable, mounted filesystem\n" +msgstr "" + +#: ../libxfs/freebsd.c:102 ../libxfs/linux.c:105 +#, c-format +msgid "%s: %s contains a mounted and writable filesystem\n" +msgstr "" + +#: ../libxfs/freebsd.c:140 +#, c-format +msgid "%s: Not a device or file: \"%s\"n" +msgstr "" + +#: ../libxfs/freebsd.c:147 +#, c-format +msgid "%s: DIOCGMEDIASIZE failed on \"%s\": %s\n" +msgstr "" + +#: ../libxfs/freebsd.c:154 +#, c-format +msgid "%s: DIOCGSECTORSIZE failed on \"%s\": %s\n" msgstr "" #: ../libxfs/init.c:87 ../libxfs/init.c:168 @@ -1716,21 +1847,6 @@ msgstr "" msgid "%s: cannot read root inode (%d)\n" msgstr "" -#: ../libxfs/linux.c:73 -#, c-format -msgid "%s: %s contains a mounted filesystem\n" -msgstr "" - -#: ../libxfs/linux.c:91 -#, c-format -msgid "%s: %s contains a possibly writable, mounted filesystem\n" -msgstr "" - -#: ../libxfs/linux.c:105 -#, c-format -msgid "%s: %s contains a mounted and writable filesystem\n" -msgstr "" - #: ../libxfs/linux.c:117 #, c-format msgid "%s: warning - cannot set blocksize on block device %s: %s\n" @@ -1766,42 +1882,42 @@ msgstr "" msgid "%s: %s not progressing?\n" msgstr "" -#: ../libxfs/rdwr.c:200 +#: ../libxfs/rdwr.c:216 #, c-format msgid "%s: buf calloc failed (%ld bytes): %s\n" msgstr "" -#: ../libxfs/rdwr.c:227 +#: ../libxfs/rdwr.c:243 #, c-format msgid "%s: read failed: %s\n" msgstr "" -#: ../libxfs/rdwr.c:274 +#: ../libxfs/rdwr.c:290 #, c-format msgid "%s: pwrite64 failed: %s\n" msgstr "" -#: ../libxfs/rdwr.c:281 +#: ../libxfs/rdwr.c:297 #, c-format msgid "%s: error - wrote only %d of %d bytes\n" msgstr "" -#: ../libxfs/rdwr.c:329 +#: ../libxfs/rdwr.c:345 #, c-format msgid "%s: zone init failed (%s, %d bytes): %s\n" msgstr "" -#: ../libxfs/rdwr.c:348 +#: ../libxfs/rdwr.c:364 #, c-format msgid "%s: zone calloc failed (%s, %d bytes): %s\n" msgstr "" -#: ../libxfs/rdwr.c:383 +#: ../libxfs/rdwr.c:399 #, c-format msgid "%s: calloc failed (%d bytes): %s\n" msgstr "" -#: ../libxfs/rdwr.c:414 +#: ../libxfs/rdwr.c:430 #, c-format msgid "%s: realloc failed (%d bytes): %s\n" msgstr "" diff --git a/repair/globals.h b/repair/globals.h index 3bcb4a321..b5642f950 100644 --- a/repair/globals.h +++ b/repair/globals.h @@ -120,7 +120,6 @@ EXTERN int fs_fd; /* filesystem fd */ EXTERN int verbose; EXTERN int no_modify; -EXTERN int test_mode; /* freespace is being faked, leave it */ EXTERN int dangerously; /* live dangerously ... fix ro mount */ EXTERN int isa_file; EXTERN int zap_log; diff --git a/repair/xfs_repair.c b/repair/xfs_repair.c index ea55cb18e..1effeaada 100644 --- a/repair/xfs_repair.c +++ b/repair/xfs_repair.c @@ -189,7 +189,7 @@ process_args(int argc, char **argv) * XXX have to add suboption processing here * attributes, quotas, nlinks, aligned_inos, sb_fbits */ - while ((c = getopt(argc, argv, "o:fl:r:LnDtvVd")) != EOF) { + while ((c = getopt(argc, argv, "o:fl:r:LnDvVd")) != EOF) { switch (c) { case 'D': dumpcore = 1; @@ -238,9 +238,6 @@ process_args(int argc, char **argv) case 'n': no_modify = 1; break; - case 't': - test_mode = 1; - break; case 'v': verbose = 1; break; @@ -518,8 +515,6 @@ main(int argc, char **argv) if (no_modify) printf(_("No modify flag set, skipping phase 5\n")); - else if (test_mode) - printf(_("Test mode flag set, skipping phase 5\n")); else phase5(mp); -- 2.47.2