All of lore.kernel.org
 help / color / mirror / Atom feed
From: Henry C Chang <henry.cy.chang@gmail.com>
To: ceph-devel <ceph-devel@vger.kernel.org>
Subject: output file not truncated
Date: Thu, 8 Sep 2011 12:13:57 +0800	[thread overview]
Message-ID: <CANExM-M8+-i8f38vGkv2ivQkZGu5U7ba+6S5uxpRB8jOxWOkMw@mail.gmail.com> (raw)

Hi,

Finally got some time to play around ceph.
I found that: when I dumped osd status by: ceph osd dump -o
/tmp/dump.json --format=json, I got some garbage data in the end of
file.
Thus, I checked the code. I noticed that the output file was not
truncated in ceph_tool_cli_input:

  // Write to a file. Don't truncate the file.
  int fd = TEMP_FAILURE_RETRY(::open(outfile, O_WRONLY|O_CREAT|O_TRUNC, 0644));

Since it seems intended, I was wondering why. After all, in my case, I
found it causing problems.

Henry

             reply	other threads:[~2011-09-08  4:13 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-09-08  4:13 Henry C Chang [this message]
2011-09-08  4:41 ` output file not truncated Sage Weil
2011-09-08  4:50   ` Henry C Chang

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CANExM-M8+-i8f38vGkv2ivQkZGu5U7ba+6S5uxpRB8jOxWOkMw@mail.gmail.com \
    --to=henry.cy.chang@gmail.com \
    --cc=ceph-devel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.