From: Jens Axboe <axboe@kernel.dk>
To: Erwan Velu <erwan@enovance.com>, fio@vger.kernel.org
Subject: Re: Surprising use of basename in finish_log_named
Date: Tue, 01 Apr 2014 12:49:36 -0600 [thread overview]
Message-ID: <533B0A40.3050504@kernel.dk> (raw)
In-Reply-To: <533AD484.2040608@enovance.com>
On 04/01/2014 09:00 AM, Erwan Velu wrote:
> Hi Jens,
>
> I had a input of the fio irc channel (yes some at getting into it
> sometimes :p), and he had a very interesting point.
>
> If you specify a full path name for the iops_log, the file will stay
> into the current dir.
> While looking at the code I found that finish_log_named() is performing
> the following:
>
> char file_name[256], *p;
> snprintf(file_name, sizeof(file_name), "%s_%s.log", prefix, postfix);
> p = basename(file_name);
>
> Why do we basename the file_name ? What's the reason of shrinking the
> path this way ?
I don't think there's a good reason for that. So feel free to send in a
(tested) patch :-)
> Note for the author: 256 is maybe too small for some ? :)))
We can make it PATH_MAX instead, not a big deal.
--
Jens Axboe
next prev parent reply other threads:[~2014-04-01 18:49 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-04-01 15:00 Surprising use of basename in finish_log_named Erwan Velu
2014-04-01 18:49 ` Jens Axboe [this message]
2014-04-02 8:11 ` Erwan Velu
2014-04-02 13:44 ` Jens Axboe
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=533B0A40.3050504@kernel.dk \
--to=axboe@kernel.dk \
--cc=erwan@enovance.com \
--cc=fio@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.