[Gluster-devel] feature/trash and NetBSD

Anoop C S achiraya at redhat.com
Wed Mar 18 09:03:41 UTC 2015



On 03/18/2015 02:00 PM, Emmanuel Dreyfus wrote:
> On Wed, Mar 18, 2015 at 11:26:02AM +0530, Anoop C S wrote:
>> Trash translator creates the original file inside .trashcan directory on
>> receiving a truncate/ftruncate call and then truncates the file. During
>> the above mentioned procedure, whether a truncate/ftruncate call is
>> issued internally?
> 
> The kernel sends SETATTR with new file size, and glusterfs turns this
> into a truncate call. I have to dig deeper to tell how.

Ok. As of now trash translator doesn't distinguish between extended
truncate and reduced truncate. From your explanation and discussion with
Vijay, we doubt that it is an extended truncate(truncate with a higher
size). We are planning to skip extended truncate from trashing. A patch
will be sent out soon to address the problem. If that is the case, then
the corresponding (upcoming) patch will solve the issue.

> 
>> We have started looking into the failures. And I see many instances of
>> the following error:
>> du: unknown option -- b
> 
> Yes, I had to fix a few shell portability problems
> - The -p option for mkdir must be before the directory name
> - du -b is not portable. Use ls -l instead.
> - test -e file* fails if file* expands to multiple files. 
>   I introduced wildcard_exists() and wildcard_not_exists() to work 
>   this around.
> 
> Attached patch adresses the three points.

Thanks for pointing out the issues. When we have our above mentioned
patch merged upstream, we can verify and then you can send this patch
for trash.t upstream for review.

> 

--Anoop C S.


More information about the Gluster-devel mailing list