From: Cyril Hrubis <chrubis@suse.cz>
To: ltp@lists.linux.it
Subject: [LTP] [PATCH] du01: create the temp file outside of the working directory
Date: Tue, 16 Aug 2016 17:57:13 +0200 [thread overview]
Message-ID: <20160816155713.GG25540@rei.lan> (raw)
In-Reply-To: <1469451123-9296-1-git-send-email-stanislav.kholmanskikh@oracle.com>
Hi!
> I noticed that with older kernels and with XFS the 'du -B 512'
> scenario of this test case may fail:
>
> [root@kholmanskikh du01]# uname -r
> 3.8.13-98.2.2.el6uek.x86_64
> [root@kholmanskikh du01]# ls -l
> total 10240
> drwxr-xr-x 2 root root 24 Jul 25 14:48 testdir
> -rw-r--r-- 1 root root 10485760 Jul 25 14:48 testfile
> [root@kholmanskikh du01]# du -B 512
> 0 ./testdir
> 20480 .
> [root@kholmanskikh du01]# du -B 512 > temp; cat temp
> 0 ./testdir
> 20608 .
> [root@kholmanskikh du01]#
>
> This happens because we create 'temp' file in the working directory,
> i.e. 'temp' may already contain some data at the moment 'du' tries
> to 'fstat' it.
>
> So let's keep the working directory clean and create any extra
> files outside of it.
Looks good to me, acked.
--
Cyril Hrubis
chrubis@suse.cz
next prev parent reply other threads:[~2016-08-16 15:57 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-07-25 12:52 [LTP] [PATCH] du01: create the temp file outside of the working directory Stanislav Kholmanskikh
2016-08-16 15:57 ` Cyril Hrubis [this message]
2016-08-17 12:32 ` Cyril Hrubis
2016-08-17 13:07 ` Stanislav Kholmanskikh
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=20160816155713.GG25540@rei.lan \
--to=chrubis@suse.cz \
--cc=ltp@lists.linux.it \
/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