Re: [PATCH v2][RESEND] seq_file: don't set read position for invalid iterator

2016-11-24 Thread Miklos Szeredi
On Thu, Nov 24, 2016 at 4:23 PM, Tomasz Majchrzak wrote: > I don't understand it. Is it possible to map file position to the index > (record)? I think there is no way to determine record size without actually > reading it. Right. So don't update m->index when a

Re: [PATCH v2][RESEND] seq_file: don't set read position for invalid iterator

2016-11-24 Thread Miklos Szeredi
On Thu, Nov 24, 2016 at 4:23 PM, Tomasz Majchrzak wrote: > I don't understand it. Is it possible to map file position to the index > (record)? I think there is no way to determine record size without actually > reading it. Right. So don't update m->index when a zero size record is read. This

Re: [PATCH v2][RESEND] seq_file: don't set read position for invalid iterator

2016-11-24 Thread Tomasz Majchrzak
On Wed, Nov 02, 2016 at 10:11:47AM +0100, Miklos Szeredi wrote: > On Mon, Oct 31, 2016 at 10:32:21AM +0100, Tomasz Majchrzak wrote: > > On Wed, Oct 26, 2016 at 11:17:13AM +0200, Miklos Szeredi wrote: > > > On Wed, Oct 12, 2016 at 2:07 PM, Tomasz Majchrzak > > > wrote:

Re: [PATCH v2][RESEND] seq_file: don't set read position for invalid iterator

2016-11-24 Thread Tomasz Majchrzak
On Wed, Nov 02, 2016 at 10:11:47AM +0100, Miklos Szeredi wrote: > On Mon, Oct 31, 2016 at 10:32:21AM +0100, Tomasz Majchrzak wrote: > > On Wed, Oct 26, 2016 at 11:17:13AM +0200, Miklos Szeredi wrote: > > > On Wed, Oct 12, 2016 at 2:07 PM, Tomasz Majchrzak > > > wrote: > > > > If kernfs file is

Re: [PATCH v2][RESEND] seq_file: don't set read position for invalid iterator

2016-11-02 Thread Miklos Szeredi
On Mon, Oct 31, 2016 at 10:32:21AM +0100, Tomasz Majchrzak wrote: > On Wed, Oct 26, 2016 at 11:17:13AM +0200, Miklos Szeredi wrote: > > On Wed, Oct 12, 2016 at 2:07 PM, Tomasz Majchrzak > > wrote: > > > If kernfs file is empty on a first read, successive read

Re: [PATCH v2][RESEND] seq_file: don't set read position for invalid iterator

2016-11-02 Thread Miklos Szeredi
On Mon, Oct 31, 2016 at 10:32:21AM +0100, Tomasz Majchrzak wrote: > On Wed, Oct 26, 2016 at 11:17:13AM +0200, Miklos Szeredi wrote: > > On Wed, Oct 12, 2016 at 2:07 PM, Tomasz Majchrzak > > wrote: > > > If kernfs file is empty on a first read, successive read operations > > > using the same file

Re: [PATCH v2][RESEND] seq_file: don't set read position for invalid iterator

2016-10-31 Thread Tomasz Majchrzak
On Wed, Oct 26, 2016 at 11:17:13AM +0200, Miklos Szeredi wrote: > On Wed, Oct 12, 2016 at 2:07 PM, Tomasz Majchrzak > wrote: > > If kernfs file is empty on a first read, successive read operations > > using the same file descriptor will return no data, even when data

Re: [PATCH v2][RESEND] seq_file: don't set read position for invalid iterator

2016-10-31 Thread Tomasz Majchrzak
On Wed, Oct 26, 2016 at 11:17:13AM +0200, Miklos Szeredi wrote: > On Wed, Oct 12, 2016 at 2:07 PM, Tomasz Majchrzak > wrote: > > If kernfs file is empty on a first read, successive read operations > > using the same file descriptor will return no data, even when data is > > available. Default

Re: [PATCH v2][RESEND] seq_file: don't set read position for invalid iterator

2016-10-26 Thread Miklos Szeredi
On Wed, Oct 12, 2016 at 2:07 PM, Tomasz Majchrzak wrote: > If kernfs file is empty on a first read, successive read operations > using the same file descriptor will return no data, even when data is > available. Default kernfs 'seq_next' implementation advances

Re: [PATCH v2][RESEND] seq_file: don't set read position for invalid iterator

2016-10-26 Thread Miklos Szeredi
On Wed, Oct 12, 2016 at 2:07 PM, Tomasz Majchrzak wrote: > If kernfs file is empty on a first read, successive read operations > using the same file descriptor will return no data, even when data is > available. Default kernfs 'seq_next' implementation advances iterator > position even when next

[PATCH v2][RESEND] seq_file: don't set read position for invalid iterator

2016-10-12 Thread Tomasz Majchrzak
If kernfs file is empty on a first read, successive read operations using the same file descriptor will return no data, even when data is available. Default kernfs 'seq_next' implementation advances iterator position even when next object is not there. Kernfs 'seq_start' for following requests

[PATCH v2][RESEND] seq_file: don't set read position for invalid iterator

2016-10-12 Thread Tomasz Majchrzak
If kernfs file is empty on a first read, successive read operations using the same file descriptor will return no data, even when data is available. Default kernfs 'seq_next' implementation advances iterator position even when next object is not there. Kernfs 'seq_start' for following requests