> > > > I dunno. Is this true of all linux filesystems in all cases? Maybe.
> > >
> > > Assuming one of them is not would you rather want to fix that file system
> > > or 10 zillion user programs (including the kernel core dumper) that
> > > get it wrong? @)
> > >
> >
> > I think that removing one bug is better than adding one.
> >
> > Many filesystems will return a short write if they hit a memory
> > allocation failure, for example. pipe_write() sure will. Retrying
> > is appropriate in such a case.
>
> Sorry but are you really suggesting every program in the world that uses
> write() anywhere should put it into a loop? That seems just like really
> bad API design to me, requiring such contortions in a fundamental
> system call just to work around kernel deficiencies.
>
> I can just imagine the programmers putting nasty comments
> about the Linux kernel on top of those loops and they would
> be fully deserved.
>
Hey, don't look at me - blame Brian Kernighan or George Bush or
someone.
超訳:
背景: core dumpをパイプ経由で書き込むときに
static int dump_write(struct file *file, const void *addr, int nr)
{
return file->f_op->write(file, addr, nr, &file->f_pos) == nr;
}
というコードがあって、こんな仮定動くはずねーーー。とか言って議論している
Andi Kleen:
writeの返り値をちゃんとチェックしていないプログラムなんて星の数ほどあるんだから、POSIXがどうのこうのとか言い訳するのはやめようぜ。
Paul Smith:
うーん、でも多くのファイルシステムがメモリ不足やらなんやらで部分書き込み成功を返すんだよね。ここはcore dumpのところだけ直すのが影響範囲が小さくて・・・
Andi Kleen:
世界中のおばかプログラムを直して回る気?これはAPIデザインが腐ってるよ。きっとプログラマーはLinuxを罵倒するコメントを、エラーチェックのループの先頭に入れることになるだろうね
Andrew Morton:
こっち見んな( ゚Д゚ )
文句はブライアン・カーニハンとかジョージ・ブッシュとか、その辺に言ってくれ
コメント