Re: output file not truncated

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thu, 8 Sep 2011, Henry C Chang wrote:
> 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.

There was a recent change that lets you stack up commands, separated 
by ';':

 $ ceph pg stat \; osd stat

Basically we were lazy and reopened the output file inside the loop.

Just pushed a patch cleaning it up some!

sage

--
To unsubscribe from this list: send the line "unsubscribe ceph-devel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [CEPH Users]     [Ceph Large]     [Information on CEPH]     [Linux BTRFS]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]
  Powered by Linux