public inbox for ltp@lists.linux.it
 help / color / mirror / Atom feed
From: Cyril Hrubis <chrubis@suse.cz>
To: Stanislav Kholmanskikh <stanislav.kholmanskikh@oracle.com>
Cc: vasily.isaenko@oracle.com, ltp-list@lists.sourceforge.net
Subject: Re: [LTP] [PATCH V2 2/2] tbio: fixes
Date: Thu, 15 Jan 2015 10:53:02 +0100	[thread overview]
Message-ID: <20150115095301.GA12643@rei> (raw)
In-Reply-To: <1421146475-8597-1-git-send-email-stanislav.kholmanskikh@oracle.com>

Hi!
> +			if ((st.st_mode & S_IFBLK) && (st.st_rdev == devt)) {
> +				valid_node_created = 1;
> +				break;
>  			}
>  		}
> +
> +		sleep(1);

I would be inclined to check at least ten times in second. I.e.
usleep(100000); here and do the for loop 50 times instead.

Each second we spend doing nothing is second not spend doing actual
testing.

> +	}
> +
> +	if (!valid_node_created) {

Maybe we should issue TINFO message here that device wasn't created by
udev and we have fallen back to manual creation.

> +		if (unlink(DEVICE_NAME) && (errno != ENOENT))
> +			tst_brkm(TBROK | TERRNO, cleanup, "unlink() failed");
> +		if (mknod(DEVICE_NAME, S_IFBLK | S_IRUSR | S_IWUSR |
> +			  S_IRGRP | S_IWGRP, devt))
> +			tst_brkm(TBROK | TERRNO, cleanup, "mknod() failed");
>  	}

Otherwise this looks good.

-- 
Cyril Hrubis
chrubis@suse.cz

------------------------------------------------------------------------------
New Year. New Location. New Benefits. New Data Center in Ashburn, VA.
GigeNET is offering a free month of service with a new server in Ashburn.
Choose from 2 high performing configs, both with 100TB of bandwidth.
Higher redundancy.Lower latency.Increased capacity.Completely compliant.
http://p.sf.net/sfu/gigenet
_______________________________________________
Ltp-list mailing list
Ltp-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ltp-list

  reply	other threads:[~2015-01-15  9:53 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <54B4E154.2070801@oracle.com>
2015-01-13 10:54 ` [LTP] [PATCH V2 2/2] tbio: fixes Stanislav Kholmanskikh
2015-01-15  9:53   ` Cyril Hrubis [this message]
2015-01-15 10:39     ` [LTP] [PATCH V3 " Stanislav Kholmanskikh
2015-01-15 11:24       ` Cyril Hrubis

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=20150115095301.GA12643@rei \
    --to=chrubis@suse.cz \
    --cc=ltp-list@lists.sourceforge.net \
    --cc=stanislav.kholmanskikh@oracle.com \
    --cc=vasily.isaenko@oracle.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