2014-10-27 20:17:41

by Steven Rostedt

[permalink] [raw]
Subject: Re: [PATCH 3/7] dlm: Use seq_is_full - remove seq_printf returns

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 <[email protected]> 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


2014-10-27 20:25:26

by Joe Perches

[permalink] [raw]
Subject: Re: [PATCH 3/7] dlm: Use seq_is_full - remove seq_printf returns

On Mon, 2014-10-27 at 16:17 -0400, Steven Rostedt wrote:
> Note, I've started with Joe's patches and I'm massaging them for
> something I can work with.
[]
> I'm thinking of switching everything to use seq_has_overflowed() and
> try again.

Fine by me.

2014-10-29 12:21:35

by Petr Mladek

[permalink] [raw]
Subject: Re: [PATCH 3/7] dlm: Use seq_is_full - remove seq_printf returns

On Mon 2014-10-27 16:17:24, Steven Rostedt wrote:
> 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 <[email protected]> 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?

Sounds good to me.

Best Regards,
Petr