DragonFly kernel List (threaded) for 2008-06
DragonFly BSD
DragonFly kernel List (threaded) for 2008-06
[Date Prev][Date Next]  [Thread Prev][Thread Next]  [Date Index][Thread Index]

Re: 0 bytes sized file can't be written to a HAMMER partition


From: Antonio Huete Jimenez <tuxillo@xxxxxxxxxxxxxxxxx>
Date: Tue, 10 Jun 2008 17:45:13 +0200

It looks like the code should be changed to:

if (uio->uio_offset < 0 || uio->uio_offset + uio->uio_resid < 0) {
       hammer_done_transaction(&trans);
       return (EFBIG);
}

Applying that change the issue I'm able to copy zero-bytes sized files to a HAMMER partition:


master# touch /tmp/qq && cp /tmp/qq /datapool/
master# ls -l /datapool/qq
-rw-r--r--  1 root  wheel  0 Jun 10 19:43 /datapool/qq
master# mount |grep datapool
datapool on /datapool (hammer, local)

Thank you
Antonio Huete



basically the second check was <= instead of < which caught my eye. I could be wrong, because I haven't dug into the code, but that's the most obvious point in the return (EFBIG) case. Try that, Antonio, and once youve got a built kernel, try copying a zero-byte file to a HAMMER fs.

Regards.
Jon
________________________________________



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