Flexible I/O Tester development
 help / color / mirror / Atom feed
From: Jens Axboe <axboe@kernel.dk>
To: "Sébastien Bouchex Bellomié" <sbouchex@infovista.com>,
	"fio@vger.kernel.org" <fio@vger.kernel.org>
Subject: Re: unlink=1 issue on Windows
Date: Thu, 20 Mar 2014 08:29:30 -0600	[thread overview]
Message-ID: <532AFB4A.7000707@kernel.dk> (raw)
In-Reply-To: <c1160a632c8b42e28487bf5902346d7e@DB4PR03MB572.eurprd03.prod.outlook.com>

On 03/19/2014 10:02 AM, S�bastien Bouchex Bellomi� wrote:
> Hi,
>
> I'm having an issue on windows : unlink=1 is not working (temp file are still there) and it's working fine on unix
>
> Looking at the code in close_and_free_files function :
>
> [...]
> if (td->o.unlink && f->filetype == FIO_TYPE_FILE) {
> 			dprint(FD_FILE, "free unlink %s\n", f->file_name);
> 			unlink(f->file_name);
> 		}
> [...]
>
> Unlink() fails because the file is still open : On Solaris, truss shows the following :
>
> [...]
> write(3, "\0\0\0\0\0 ;80\0\0\0\0\0".., 32768)   = 32768
> unlink("/data/fio/random_rw.0.0")               = 0
> close(3)                                        = 0
> [...]
>
> So unlink is called first.
>
> I would put this unlinking phase AFTER the remove_file_hash call.

Sure, we can move the unlink down a bit, should not matter really. Linux 
doesn't care when you call unlink, last close will just really unlink 
it. But if other operating systems do care, then I'll just move it.

http://git.kernel.dk/?p=fio.git;a=commit;h=b5f4d8baefc6eb3e13235b7d9042b7ffecdb23dd

-- 
Jens Axboe



  reply	other threads:[~2014-03-20 14:29 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-03-19 16:02 unlink=1 issue on Windows Sébastien Bouchex Bellomié
2014-03-20 14:29 ` Jens Axboe [this message]
2014-03-20 17:59 ` unlink castor.fu
2014-03-20 17:59   ` [PATCH 1/2] Pass -Wstrict-prototypes -Wold-style-definition, whitespace castor.fu
2014-03-21 15:29     ` Jens Axboe
2014-03-20 17:59   ` [PATCH 2/2] Add unlink hook to ioengine API castor.fu
2014-03-21 15:27     ` Jens Axboe
2014-03-21 17:03       ` Castor Fu

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=532AFB4A.7000707@kernel.dk \
    --to=axboe@kernel.dk \
    --cc=fio@vger.kernel.org \
    --cc=sbouchex@infovista.com \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox