Re: Current git tree broke busybox start-stop-daemon



On Wed, Apr 16, 2008 at 08:34:17PM +0100, Al Viro wrote:
On Wed, Apr 16, 2008 at 11:00:57PM +0400, Alexey Dobriyan wrote:
On Wed, Apr 16, 2008 at 07:25:02PM +0200, Joakim Tjernlund wrote:
open("/proc/1/stat", O_RDONLY|O_LARGEFILE) = 4
_llseek(4, 0, 0xbfb94898, SEEK_END) = -1 EINVAL (Invalid argument)

So it appears that lseek is no longer allowed for /proc/1/stat
Bug or feature?
start-stop-daemon works fine in 2.6.23

That's what happens when switching ->llseek method from NULL
(effectively, default_llseek), to seq_lseek (which rejects SEEK_END).

commit be614086a4aff163d5aa0dc160638d1193b59cde
commit ee992744ea53db0a90c986fd0a70fbbf91e7f8bd

Al, do you remember why SEEK_END was omitted back then?

Because there's no sane way to implement it?

Ugly ->index games, sigh...

Note that original cheerfully
did nothing, since it had zero ->i_size for that file. Which makes program
in question very odd - what behaviour does it rely upon?

Busybox just wants to estimate size of a file. And it knows about
zero-length /proc/*/stat .

libbb/read.c:

void *xmalloc_open_read_close(const char *filename, size_t *sizep)
{
char *buf;
size_t size = sizep ? *sizep : INT_MAX;
int fd;
off_t len;

fd = xopen(filename, O_RDONLY);
/* /proc/N/stat files report len 0 here */
/* In order to make such files readable, we add small const */
len = xlseek(fd, 0, SEEK_END) | 0x3ff; /* + up to 1k */
...

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/



Relevant Pages

  • Re: Current git tree broke busybox start-stop-daemon
    ... Bug or feature? ... start-stop-daemon works fine in 2.6.23 ... That's what happens when switching ->llseek method from NULL ... commit be614086a4aff163d5aa0dc160638d1193b59cde ...
    (Linux-Kernel)
  • Re: Current git tree broke busybox start-stop-daemon
    ... Bug or feature? ... start-stop-daemon works fine in 2.6.23 ... That's what happens when switching ->llseek method from NULL ... commit be614086a4aff163d5aa0dc160638d1193b59cde ...
    (Linux-Kernel)
  • Re: [EXT4 set 8][PATCH 1/1]Add journal checksums
    ... A new user-visible feature should be accompanied by an update to ... * validate the data journaling mode. ... struct journal_head *descriptor; ... changed the on-disk format of the journal commit blocks. ...
    (Linux-Kernel)
  • Re: [EXT4 set 8][PATCH 1/1]Add journal checksums
    ... JBD2_FEATURE_CHECKSUM flag indicates that the commit block contains the ... checksum for the blocks described by the descriptor blocks. ... A new user-visible feature should be accompanied by an update to ... * validate the data journaling mode. ...
    (Linux-Kernel)
  • lots of straightforward protocol or dorm, and shell behind pledge everybody
    ... Let's decline far from the reluctant jungles, but don't commit the ... Otherwise the enjoyment in Annabel's gate might feature some ... disastrous pollutions. ... Some cautions want, ask, and reflect. ...
    (sci.polymers)