coreutils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: some concern about the fix of " tail: consistently output all data f


From: Pádraig Brady
Subject: Re: some concern about the fix of " tail: consistently output all data for truncated files"
Date: Mon, 7 Nov 2016 12:48:24 +0000
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.2.0

On 07/11/16 05:16, Lian, George (Nokia - CN/Hangzhou) wrote:
> Hi,
> 
> There are a fix about truncated for tail application of coreutils,

Yes the fix and code are qualified with /* XXX ... heuristic */ etc.

> The change messages is "tail: consistently output all data for truncated 
> files",
> 
> Now I have some concern for this case
> 
> 1)      I suppose Truncate maybe not always truncate to ZERO, for example, 
> sometimes a file maybe only has been truncate the bottom 100 lines of 1M 
> lines , in this case , SEEK from head will be confused by the users.

Possible but not the usual use case.

> 2)      Sometimes truncated maybe not really happen even "stats.st_size < 
> fspec->size" is meet,  for example, a network based filesystems, for it's 
> current implementation, it will active the read data-cache first and then 
> update the meta-data cache, it is not an atomic operation, I suppose it is 
> reasonable that the "tail application" will read the data-cache with new 
> updated data, but get stat size with old value, in this case, the tail assume 
> it is truncated and dump the data from the begin, it also make more confuse 
> to users.

That issue impacts what ever scheme is chosen.

> 3)      As the comments in your changes, the stat size is bigger thand the 
> length has read, it also maybe happ truncate.

True, but inlikely.

> 4)      Why can't get size of fstat first, and read not more than the size of 
> fstat during the tail_forever loop?

That would help point 2) right?
I'm not sure how well that would work with inotify at least.

thanks,
Pádraig



reply via email to

[Prev in Thread] Current Thread [Next in Thread]