All of lore.kernel.org
 help / color / mirror / Atom feed
From: chrubis@suse.cz
To: DAN LI <li.dan@cn.fujitsu.com>
Cc: LTP list <ltp-list@lists.sourceforge.net>
Subject: Re: [LTP] [PATCH 2/2 v2] mount/mount03.c: Test feature MS_NOATIME of mount(2)
Date: Tue, 9 Jul 2013 16:57:53 +0200	[thread overview]
Message-ID: <20130709145753.GA760@rei.Home> (raw)
In-Reply-To: <51D274BD.5070707@cn.fujitsu.com>

Hi!
> Additional test for features MS_NOATIME.
> 
> Signed-off-by: DAN LI <li.dan@cn.fujitsu.com>
> ---
> +	case 6:
> +		/* Validate MS_NOATIME flag of mount call */
> +
> +		snprintf(file, PATH_MAX, "%satime", path_name);
> +		fd = open(file, O_CREAT | O_RDWR, S_IRWXU);
> +		if (fd == -1) {
> +			tst_resm(TWARN | TERRNO, "opening %s failed", file);
> +			return 1;
> +		}
> +
> +		if (write(fd, "TEST_MS_NOATIME", 15) != 15) {
> +			tst_resm(TWARN | TERRNO, "write %s failed", file);
> +			return 1;
> +		}
> +
> +		if (fstat(fd, &file_stat) == -1) {
> +			tst_resm(TWARN | TERRNO, "stat %s failed #1", file);
> +			return 1;
> +		}
> +
> +		atime = file_stat.st_atime;
> +
> +		sleep(1);
> +
> +		if (read(fd, NULL, 20) == -1) {
> +			tst_resm(TWARN | TERRNO, "read %s failed", file);
> +			return 1;
> +		}
> +
> +		if (fstat(fd, &file_stat) == -1) {
> +			tst_resm(TWARN | TERRNO, "stat %s failed #2", file);
> +			return 1;
> +		}
> +		close(fd);
> +
> +		if (file_stat.st_atime != atime) {
> +			tst_resm(TWARN, "access time is updated");
> +			return 1;
> +		}
> +		return 0;
>  	}

This version looks fine.

-- 
Cyril Hrubis
chrubis@suse.cz

------------------------------------------------------------------------------
See everything from the browser to the database with AppDynamics
Get end-to-end visibility with application monitoring from AppDynamics
Isolate bottlenecks and diagnose root cause in seconds.
Start your free trial of AppDynamics Pro today!
http://pubads.g.doubleclick.net/gampad/clk?id=48808831&iu=/4140/ostg.clktrk
_______________________________________________
Ltp-list mailing list
Ltp-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ltp-list

  reply	other threads:[~2013-07-09 14:56 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-07-02  6:21 [LTP] [PATCH 1/2] mount/mount03.c: clean up DAN LI
2013-07-02  6:23 ` [LTP] [PATCH 2/2] mount/mount03.c: Test feature MS_NOATIME of mount(2) DAN LI
2013-07-02  6:35 ` [LTP] [PATCH 2/2 v2] " DAN LI
2013-07-09 14:57   ` chrubis [this message]
2013-07-09 14:42 ` [LTP] [PATCH 1/2] mount/mount03.c: clean up chrubis
  -- strict thread matches above, loose matches on Subject: below --
2013-07-08  5:17 [LTP] [PATCH 1/2 v2] " DAN LI
2013-07-08  5:18 ` [LTP] [PATCH 2/2 v2] mount/mount03.c: Test feature MS_NOATIME of mount(2) DAN LI

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=20130709145753.GA760@rei.Home \
    --to=chrubis@suse.cz \
    --cc=li.dan@cn.fujitsu.com \
    --cc=ltp-list@lists.sourceforge.net \
    /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.