Re: [PATCH V2] btrfs-progs: add newline to some error messages

2015-08-25 Thread David Sterba
On Fri, Aug 07, 2015 at 09:20:25AM +0900, Tsutomu Itoh wrote:
 Added a missing newline to some error messages.
 Also printf() was changed to fprintf(stderr) for error message.
 
 Signed-off-by: Tsutomu Itoh t-i...@jp.fujitsu.com

Applied, thanks.
--
To unsubscribe from this list: send the line unsubscribe linux-btrfs in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


RE: [PATCH V2] btrfs-progs: add newline to some error messages

2015-08-06 Thread Zhao Lei
Reviewed-by: Zhao Lei zhao...@cn.fujitsu.com

Thanks
Zhaolei

 -Original Message-
 From: Tsutomu Itoh [mailto:t-i...@jp.fujitsu.com]
 Sent: Friday, August 07, 2015 8:20 AM
 To: linux-btrfs@vger.kernel.org
 Cc: Zhao Lei
 Subject: [PATCH V2] btrfs-progs: add newline to some error messages
 
 Added a missing newline to some error messages.
 Also printf() was changed to fprintf(stderr) for error message.
 
 Signed-off-by: Tsutomu Itoh t-i...@jp.fujitsu.com
 ---
  btrfs-corrupt-block.c |  2 +-
  cmds-check.c  |  4 ++--
  cmds-send.c   |  4 ++--
  dir-item.c|  6 +++---
  free-space-cache.c| 24 +++-
  mkfs.c|  2 +-
  6 files changed, 24 insertions(+), 18 deletions(-)
 
 diff --git a/btrfs-corrupt-block.c b/btrfs-corrupt-block.c index 
 1a2aa23..ea871f4
 100644
 --- a/btrfs-corrupt-block.c
 +++ b/btrfs-corrupt-block.c
 @@ -1010,7 +1010,7 @@ int find_chunk_offset(struct btrfs_root *root,
   goto out;
   }
   if (ret  0) {
 - fprintf(stderr, Error searching chunk);
 + fprintf(stderr, Error searching chunk\n);
   goto out;
   }
  out:
 diff --git a/cmds-check.c b/cmds-check.c index 50bb6f3..d0ffc94 100644
 --- a/cmds-check.c
 +++ b/cmds-check.c
 @@ -2399,7 +2399,7 @@ static int repair_inode_nlinks(struct
 btrfs_trans_handle *trans,
 BTRFS_FIRST_FREE_OBJECTID, lost_found_ino,
 mode);
   if (ret  0) {
 - fprintf(stderr, Failed to create '%s' dir: %s,
 + fprintf(stderr, Failed to create '%s' dir: %s\n,
   dir_name, strerror(-ret));
   goto out;
   }
 @@ -2427,7 +2427,7 @@ static int repair_inode_nlinks(struct
 btrfs_trans_handle *trans,
   }
   if (ret  0) {
   fprintf(stderr,
 - Failed to link the inode %llu to %s dir: %s,
 + Failed to link the inode %llu to %s dir: %s\n,
   rec-ino, dir_name, strerror(-ret));
   goto out;
   }
 diff --git a/cmds-send.c b/cmds-send.c
 index a0b7f95..6f2f340 100644
 --- a/cmds-send.c
 +++ b/cmds-send.c
 @@ -193,13 +193,13 @@ static int write_buf(int fd, const void *buf, int size)
   ret = write(fd, (char*)buf + pos, size - pos);
   if (ret  0) {
   ret = -errno;
 - fprintf(stderr, ERROR: failed to dump stream. %s,
 + fprintf(stderr, ERROR: failed to dump stream. %s\n,
   strerror(-ret));
   goto out;
   }
   if (!ret) {
   ret = -EIO;
 - fprintf(stderr, ERROR: failed to dump stream. %s,
 + fprintf(stderr, ERROR: failed to dump stream. %s\n,
   strerror(-ret));
   goto out;
   }
 diff --git a/dir-item.c b/dir-item.c
 index a5bf861..f3ad98f 100644
 --- a/dir-item.c
 +++ b/dir-item.c
 @@ -285,7 +285,7 @@ int verify_dir_item(struct btrfs_root *root,
   u8 type = btrfs_dir_type(leaf, dir_item);
 
   if (type = BTRFS_FT_MAX) {
 - fprintf(stderr, invalid dir item type: %d,
 + fprintf(stderr, invalid dir item type: %d\n,
  (int)type);
   return 1;
   }
 @@ -294,7 +294,7 @@ int verify_dir_item(struct btrfs_root *root,
   namelen = XATTR_NAME_MAX;
 
   if (btrfs_dir_name_len(leaf, dir_item)  namelen) {
 - fprintf(stderr, invalid dir item name len: %u,
 + fprintf(stderr, invalid dir item name len: %u\n,
  (unsigned)btrfs_dir_data_len(leaf, dir_item));
   return 1;
   }
 @@ -302,7 +302,7 @@ int verify_dir_item(struct btrfs_root *root,
   /* BTRFS_MAX_XATTR_SIZE is the same for all dir items */
   if ((btrfs_dir_data_len(leaf, dir_item) +
btrfs_dir_name_len(leaf, dir_item)) 
 BTRFS_MAX_XATTR_SIZE(root)) {
 - fprintf(stderr, invalid dir item name + data len: %u + %u,
 + fprintf(stderr, invalid dir item name + data len: %u + %u\n,
  (unsigned)btrfs_dir_name_len(leaf, dir_item),
  (unsigned)btrfs_dir_data_len(leaf, dir_item));
   return 1;
 diff --git a/free-space-cache.c b/free-space-cache.c index 67f00fd..19ab0c9
 100644
 --- a/free-space-cache.c
 +++ b/free-space-cache.c
 @@ -107,7 +107,8 @@ static int io_ctl_prepare_pages(struct io_ctl *io_ctl,
 struct btrfs_root *root,
 
   ret = btrfs_search_slot(NULL, root, key, path, 0, 0);
   if (ret) {
 - printf(Couldn't find file extent item for free space inode
 + fprintf(stderr,
 +Couldn't find file extent item for free

[PATCH V2] btrfs-progs: add newline to some error messages

2015-08-06 Thread Tsutomu Itoh
Added a missing newline to some error messages.
Also printf() was changed to fprintf(stderr) for error message.

Signed-off-by: Tsutomu Itoh t-i...@jp.fujitsu.com
---
 btrfs-corrupt-block.c |  2 +-
 cmds-check.c  |  4 ++--
 cmds-send.c   |  4 ++--
 dir-item.c|  6 +++---
 free-space-cache.c| 24 +++-
 mkfs.c|  2 +-
 6 files changed, 24 insertions(+), 18 deletions(-)

diff --git a/btrfs-corrupt-block.c b/btrfs-corrupt-block.c
index 1a2aa23..ea871f4 100644
--- a/btrfs-corrupt-block.c
+++ b/btrfs-corrupt-block.c
@@ -1010,7 +1010,7 @@ int find_chunk_offset(struct btrfs_root *root,
goto out;
}
if (ret  0) {
-   fprintf(stderr, Error searching chunk);
+   fprintf(stderr, Error searching chunk\n);
goto out;
}
 out:
diff --git a/cmds-check.c b/cmds-check.c
index 50bb6f3..d0ffc94 100644
--- a/cmds-check.c
+++ b/cmds-check.c
@@ -2399,7 +2399,7 @@ static int repair_inode_nlinks(struct btrfs_trans_handle 
*trans,
  BTRFS_FIRST_FREE_OBJECTID, lost_found_ino,
  mode);
if (ret  0) {
-   fprintf(stderr, Failed to create '%s' dir: %s,
+   fprintf(stderr, Failed to create '%s' dir: %s\n,
dir_name, strerror(-ret));
goto out;
}
@@ -2427,7 +2427,7 @@ static int repair_inode_nlinks(struct btrfs_trans_handle 
*trans,
}
if (ret  0) {
fprintf(stderr,
-   Failed to link the inode %llu to %s dir: %s,
+   Failed to link the inode %llu to %s dir: %s\n,
rec-ino, dir_name, strerror(-ret));
goto out;
}
diff --git a/cmds-send.c b/cmds-send.c
index a0b7f95..6f2f340 100644
--- a/cmds-send.c
+++ b/cmds-send.c
@@ -193,13 +193,13 @@ static int write_buf(int fd, const void *buf, int size)
ret = write(fd, (char*)buf + pos, size - pos);
if (ret  0) {
ret = -errno;
-   fprintf(stderr, ERROR: failed to dump stream. %s,
+   fprintf(stderr, ERROR: failed to dump stream. %s\n,
strerror(-ret));
goto out;
}
if (!ret) {
ret = -EIO;
-   fprintf(stderr, ERROR: failed to dump stream. %s,
+   fprintf(stderr, ERROR: failed to dump stream. %s\n,
strerror(-ret));
goto out;
}
diff --git a/dir-item.c b/dir-item.c
index a5bf861..f3ad98f 100644
--- a/dir-item.c
+++ b/dir-item.c
@@ -285,7 +285,7 @@ int verify_dir_item(struct btrfs_root *root,
u8 type = btrfs_dir_type(leaf, dir_item);
 
if (type = BTRFS_FT_MAX) {
-   fprintf(stderr, invalid dir item type: %d,
+   fprintf(stderr, invalid dir item type: %d\n,
   (int)type);
return 1;
}
@@ -294,7 +294,7 @@ int verify_dir_item(struct btrfs_root *root,
namelen = XATTR_NAME_MAX;
 
if (btrfs_dir_name_len(leaf, dir_item)  namelen) {
-   fprintf(stderr, invalid dir item name len: %u,
+   fprintf(stderr, invalid dir item name len: %u\n,
   (unsigned)btrfs_dir_data_len(leaf, dir_item));
return 1;
}
@@ -302,7 +302,7 @@ int verify_dir_item(struct btrfs_root *root,
/* BTRFS_MAX_XATTR_SIZE is the same for all dir items */
if ((btrfs_dir_data_len(leaf, dir_item) +
 btrfs_dir_name_len(leaf, dir_item))  BTRFS_MAX_XATTR_SIZE(root)) {
-   fprintf(stderr, invalid dir item name + data len: %u + %u,
+   fprintf(stderr, invalid dir item name + data len: %u + %u\n,
   (unsigned)btrfs_dir_name_len(leaf, dir_item),
   (unsigned)btrfs_dir_data_len(leaf, dir_item));
return 1;
diff --git a/free-space-cache.c b/free-space-cache.c
index 67f00fd..19ab0c9 100644
--- a/free-space-cache.c
+++ b/free-space-cache.c
@@ -107,7 +107,8 @@ static int io_ctl_prepare_pages(struct io_ctl *io_ctl, 
struct btrfs_root *root,
 
ret = btrfs_search_slot(NULL, root, key, path, 0, 0);
if (ret) {
-   printf(Couldn't find file extent item for free space inode
+   fprintf(stderr,
+  Couldn't find file extent item for free space inode
%Lu\n, ino);
btrfs_release_path(path);
return -EINVAL;
@@ -138,7 +139,7 @@ static int io_ctl_prepare_pages(struct io_ctl *io_ctl, 
struct btrfs_root *root,
struct