From eba747ac936418b50c63fbf586be5d1fe95d8e12 Mon Sep 17 00:00:00 2001 From: cha0smaster Date: Sun, 18 Dec 2005 16:27:20 +0000 Subject: [PATCH] * Add NTFS_DEV_LIST define. Use it everywhere instead of linux-ntfs-dev@lists.sf.net. * Replace all ntfs_log_trace where we ask to send mail to us with ntfs_log_error --- include/ntfs/support.h | 5 +++++ libntfs/attrib.c | 40 ++++++++++++++++++++-------------------- libntfs/dir.c | 24 ++++++++++++------------ libntfs/mft.c | 13 ++++++------- ntfsprogs/mkntfs.c | 11 ++++++----- ntfsprogs/ntfsdecrypt.c | 5 ++--- ntfsprogs/ntfsinfo.c | 4 ++-- ntfsprogs/ntfsresize.c | 4 ++-- ntfsprogs/utils.c | 2 +- 9 files changed, 56 insertions(+), 52 deletions(-) diff --git a/include/ntfs/support.h b/include/ntfs/support.h index 1c295672..76114d6a 100644 --- a/include/ntfs/support.h +++ b/include/ntfs/support.h @@ -30,6 +30,11 @@ #include #endif +/* + * Our mailing list. Use this define to prevent typos in email address. + */ +#define NTFS_DEV_LIST "linux-ntfs-dev@lists.sf.net" + /* * Generic macro to convert pointers to values for comparison purposes. */ diff --git a/libntfs/attrib.c b/libntfs/attrib.c index 9a525a5f..4e3612da 100644 --- a/libntfs/attrib.c +++ b/libntfs/attrib.c @@ -1220,9 +1220,9 @@ s64 ntfs_attr_pwrite(ntfs_attr *na, const s64 pos, s64 count, const void *b) * @cur_vcn, because we missed it during * instantiating of the hole. */ - ntfs_log_trace("BUG! Failed to find run after " + ntfs_log_error("BUG! Failed to find run after " "instantiating. Please report " - "to the linux-ntfs-dev@lists.sf.net.\n"); + "to the %s.\n", NTFS_DEV_LIST); errno = EIO; goto err_out; } @@ -1231,9 +1231,9 @@ s64 ntfs_attr_pwrite(ntfs_attr *na, const s64 pos, s64 count, const void *b) rl++; /* Now LCN shoudn't be less than 0. */ if (rl->lcn < 0) { - ntfs_log_trace("BUG! LCN is lesser than 0. Please " - "report to the " - "linux-ntfs-dev@lists.sf.net.\n"); + ntfs_log_error("BUG! LCN is lesser than 0. " + "Please report to the %s.\n", + NTFS_DEV_LIST); errno = EIO; goto err_out; } @@ -3969,9 +3969,9 @@ static int ntfs_attr_make_resident(ntfs_attr *na, ntfs_attr_search_ctx *ctx) * Bug, because ntfs_attr_record_resize should not fail (we * already checked that attribute fits MFT record). */ - ntfs_log_trace("BUG! Failed to resize attribute record. Please " - "report to the linux-ntfs-dev@lists.sf.net. " - "Aborting...\n"); + ntfs_log_error("BUG! Failed to resize attribute record. " + "Please report to the %s. Aborting...\n", + NTFS_DEV_LIST); errno = EIO; return -1; } @@ -4327,11 +4327,12 @@ retry: if (ntfs_attr_record_resize(m, a, le16_to_cpu(a->mapping_pairs_offset) + mp_size)) { - ntfs_log_trace("BUG! Ran out of space in mft record. " - "Please run chkdsk and if that " - "doesn't find any errors please " - "report you saw this message to " - "linux-ntfs-dev@lists.sf.net.\n"); + ntfs_log_error("BUG! Ran out of space in mft " + "record. Please run chkdsk and " + "if that doesn't find any " + "errors please report you saw " + "this message to %s.\n", + NTFS_DEV_LIST); err = EIO; goto put_err_out; } @@ -4357,11 +4358,10 @@ retry: finished_build = TRUE; if (!finished_build && errno != ENOSPC) { err = errno; - ntfs_log_trace("BUG! Mapping pairs build failed. " + ntfs_log_error("BUG! Mapping pairs build failed. " "Please run chkdsk and if that doesn't " "find any errors please report you saw " - "this message to " - "linux-ntfs-dev@lists.sf.net.\n"); + "this message to %s.\n", NTFS_DEV_LIST); goto put_err_out; } a->highest_vcn = cpu_to_sle64(stop_vcn - 1); @@ -4452,10 +4452,10 @@ retry: stop_vcn, &stop_vcn); if (err < 0 && errno != ENOSPC) { err = errno; - ntfs_log_trace("BUG! Mapping pairs build failed. Please " - "run chkdsk and if that doesn't find " - "any errors please report you saw this " - "message to linux-ntfs-dev@lists.sf.net.\n"); + ntfs_log_error("BUG! Mapping pairs build failed. " + "Please run chkdsk and if that doesn't " + "find any errors please report you saw " + "this message to %s.\n", NTFS_DEV_LIST); if (ntfs_mft_record_free(na->ni->vol, ni)) ntfs_log_trace("Couldn't free MFT record.\n"); goto put_err_out; diff --git a/libntfs/dir.c b/libntfs/dir.c index 3a0c5ea8..851ce568 100644 --- a/libntfs/dir.c +++ b/libntfs/dir.c @@ -193,12 +193,12 @@ found_it: IGNORE_CASE, vol->upcase, vol->upcase_len)) { /* Only one case insensitive matching name allowed. */ if (mref) { - ntfs_log_debug("Found already cached mft reference " - "in phase 1. Please run " - "chkdsk and if that doesn't " - "find any errors please report " - "you saw this message to " - "linux-ntfs-dev@lists.sf.net.\n"); + ntfs_log_error("Found already cached mft " + "reference in phase 1. Please " + "run chkdsk and if that doesn't" + " find any errors please report" + " you saw this message to %s\n", + NTFS_DEV_LIST); goto put_err_out; } mref = le64_to_cpu(ie->indexed_file); @@ -386,12 +386,12 @@ found_it2: IGNORE_CASE, vol->upcase, vol->upcase_len)) { /* Only one case insensitive matching name allowed. */ if (mref) { - ntfs_log_debug("Found already cached mft reference " - "in phase 2. Please run " - "chkdsk and if that doesn't " - "find any errors please report " - "you saw this message to " - "linux-ntfs-dev@lists.sf.net.\n"); + ntfs_log_error("Found already cached mft " + "reference in phase 2. Please " + "run chkdsk and if that doesn't" + " find any errors please report" + " you saw this message to %s\n", + NTFS_DEV_LIST); goto close_err_out; } mref = le64_to_cpu(ie->indexed_file); diff --git a/libntfs/mft.c b/libntfs/mft.c index 68c1fca6..afe9a1be 100644 --- a/libntfs/mft.c +++ b/libntfs/mft.c @@ -315,13 +315,12 @@ int ntfs_mft_record_layout(const ntfs_volume *vol, const MFT_REF mref, NTFS_BLOCK_SIZE + 1); else { mrec->usa_count = cpu_to_le16(1); - ntfs_log_debug("Sector size is bigger than MFT record size. " - "Setting usa_count to 1. If Windows\n"); - ntfs_log_debug("chkdsk reports this as corruption, please email " - "linux-ntfs-dev@lists.sf.net\n"); - ntfs_log_debug("stating that you saw this message and that the " - "file system created was corrupt.\n"); - ntfs_log_debug("Thank you.\n"); + ntfs_log_error("Sector size is bigger than MFT record size. " + "Setting usa_count to 1. If Windows chkdsk " + "reports this as corruption, please email %s " + "stating that you saw this message and that " + "the file system created was corrupt. " + "Thank you.\n", NTFS_DEV_LIST); } /* Set the update sequence number to 1. */ *(u16*)((u8*)mrec + le16_to_cpu(mrec->usa_ofs)) = cpu_to_le16(1); diff --git a/ntfsprogs/mkntfs.c b/ntfsprogs/mkntfs.c index 2879c177..c0040f2c 100644 --- a/ntfsprogs/mkntfs.c +++ b/ntfsprogs/mkntfs.c @@ -2478,11 +2478,12 @@ static int upgrade_to_large_index(MFT_RECORD *m, const char *name, NTFS_BLOCK_SIZE + 1); } else { ia_val->usa_count = cpu_to_le16(1); - ntfs_log_quiet("Sector size is bigger than index block size. Setting " - "usa_count to 1. If Windows\nchkdsk reports this as " - "corruption, please email linux-ntfs-dev@lists.sf.net\n" - "stating that you saw this message and that the file " - "system created was corrupt.\nThank you."); + ntfs_log_error("Sector size is bigger than index block size. " + "Setting usa_count to 1. If Windows chkdsk " + "reports this as corruption, please email %s " + "stating that you saw this message and that " + "the filesystem created was corrupt. " + "Thank you.", NTFS_DEV_LIST); } /* Set USN to 1. */ *(u16*)((char*)ia_val + le16_to_cpu(ia_val->usa_ofs)) = diff --git a/ntfsprogs/ntfsdecrypt.c b/ntfsprogs/ntfsdecrypt.c index 3fe1ed77..d7cdaf0b 100644 --- a/ntfsprogs/ntfsdecrypt.c +++ b/ntfsprogs/ntfsdecrypt.c @@ -1032,10 +1032,9 @@ static ntfs_fek *ntfs_fek_import_from_raw(u8 *fek_buf, else ntfs_log_error("Unknown crypto algorithm 0x%x\n", le32_to_cpu(fek->alg_id)); - ntfs_log_error(". Please email linux-ntfs-dev@lists." - "sourceforge.net and say that you saw this " + ntfs_log_error(". Please email %s and say that you saw this " "message. We will then try to implement " - "support for this algorithm.\n"); + "support for this algorithm.\n", NTFS_DEV_LIST); err = EOPNOTSUPP; goto out; } diff --git a/ntfsprogs/ntfsinfo.c b/ntfsprogs/ntfsinfo.c index 9acbba4f..c60cfb67 100644 --- a/ntfsprogs/ntfsinfo.c +++ b/ntfsprogs/ntfsinfo.c @@ -1871,8 +1871,8 @@ static void ntfs_hex_dump(void *buf,unsigned int length) static void ntfs_dump_attr_unknown(ATTR_RECORD *attr) { printf("Dumping unknown attribute type 0x%X.\n" - "--Please report this to linux-ntfs-dev@lists.sourceforge.net--\n", - (unsigned int)le32_to_cpu(attr->type)); + "--Please report this to %s--\n", + (unsigned int)le32_to_cpu(attr->type), NTFS_DEV_LIST); printf("\tResident size:\t\t %u\n",(unsigned int)le32_to_cpu(attr->length)); diff --git a/ntfsprogs/ntfsresize.c b/ntfsprogs/ntfsresize.c index e8927972..36745eea 100644 --- a/ntfsprogs/ntfsresize.c +++ b/ntfsprogs/ntfsresize.c @@ -2039,11 +2039,11 @@ static int check_bad_sectors(ntfs_volume *vol) if (NInoAttrList(ctx->ntfs_ino)) err_exit("Hopelessly many bad sectors! Please report to " - "linux-ntfs-dev@lists.sf.net\n"); + "%s\n", NTFS_DEV_LIST); if (!ctx->attr->non_resident) err_exit("Resident attribute in $BadClust! Please report to " - "linux-ntfs-dev@lists.sf.net\n"); + "%s\n", NTFS_DEV_LIST); if (!(rl = ntfs_mapping_pairs_decompress(vol, ctx->attr, NULL))) perr_exit("Decompressing $BadClust:$Bad mapping pairs failed"); diff --git a/ntfsprogs/utils.c b/ntfsprogs/utils.c index abc2cd3c..2be2bc53 100644 --- a/ntfsprogs/utils.c +++ b/ntfsprogs/utils.c @@ -72,7 +72,7 @@ #include "version.h" #include "logging.h" -const char *ntfs_bugs = "Developers' email address: linux-ntfs-dev@lists.sourceforge.net\n"; +const char *ntfs_bugs = "Developers' email address: "NTFS_DEV_LIST"\n"; const char *ntfs_home = "Linux NTFS homepage: http://www.linux-ntfs.org\n"; const char *ntfs_gpl = "This program is free software, released under the GNU " "General Public License\nand you are welcome to redistribute it under "