cluster-devel.redhat.com archive mirror
 help / color / mirror / Atom feed
From: Steven Rostedt <rostedt@goodmis.org>
To: cluster-devel.redhat.com
Subject: [Cluster-devel] [PATCH 3/7] dlm: Use seq_is_full - remove seq_printf returns
Date: Mon, 27 Oct 2014 16:17:24 -0400	[thread overview]
Message-ID: <20141027161724.0ec20325@gandalf.local.home> (raw)
In-Reply-To: <20140930103435.GC2707@dhcp128.suse.cz>

Note, I've started with Joe's patches and I'm massaging them for
something I can work with.

On Tue, 30 Sep 2014 12:34:35 +0200
Petr Mladek <pmladek@suse.cz> wrote:


> > -		rv = seq_printf(s, "\"\nInvalid master %d\n",
> > -				res->res_nodeid);
> > -	if (rv)
> > +		seq_printf(s, "\"\nInvalid master %d\n", res->res_nodeid);
> > +	if (seq_is_full(s))
> >  		goto out;
> 
> I would check for seq_overflow()
> 
> Etc. There are needed many more changes if we agree on introducing
> seq_is_full() and seq_overflow().

As I'm looking at this code, I'm thinking that we never
really care about seq_is_full(). We only really care if
seq_overflowed(), in which the contents will be discarded.

Rational? Because if we break when seq_is_full(), my new logic wont
throw away the result. If we break out of the function when it's full
and not when it has overflowed, then we may never print out the rest of
the content, as the seq_file code will still use a full buffer that
hasn't overflowed.

I'm thinking of switching everything to use seq_has_overflowed() and
try again.

Thoughts?

-- Steve



  reply	other threads:[~2014-10-27 20:17 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20140929124246.3e39dac8@gandalf.local.home>
2014-09-29 23:08 ` [Cluster-devel] [PATCH 0/7] seq_printf cleanups Joe Perches
2014-09-29 23:08   ` [Cluster-devel] [PATCH 3/7] dlm: Use seq_is_full - remove seq_printf returns Joe Perches
2014-09-30 10:34     ` Petr Mladek
2014-10-27 20:17       ` Steven Rostedt [this message]
2014-10-27 20:25         ` Joe Perches
2014-10-29 12:21         ` Petr Mladek
2014-09-29 23:08   ` [Cluster-devel] [PATCH 4/7] dlm: Use seq_puts, remove unnecessary trailing spaces Joe Perches
2014-10-28 15:32   ` [Cluster-devel] [PATCH 0/7] seq_printf cleanups Steven Rostedt
2014-10-28 15:51     ` Joe Perches

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=20141027161724.0ec20325@gandalf.local.home \
    --to=rostedt@goodmis.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).