mirror of
https://github.com/seaweedfs/seaweedfs.git
synced 2024-01-19 02:48:24 +00:00
mount: avoid use uint64 for greater than zero test
This commit is contained in:
parent
c936a12afa
commit
2f75264ec7
|
@ -108,10 +108,11 @@ func (file *File) Setattr(ctx context.Context, req *fuse.SetattrRequest, resp *f
|
|||
// fmt.Printf("truncate %v \n", fullPath)
|
||||
var chunks []*filer_pb.FileChunk
|
||||
for _, chunk := range file.entry.Chunks {
|
||||
if uint64(chunk.Offset)+chunk.Size > req.Size {
|
||||
chunk.Size = req.Size - uint64(chunk.Offset)
|
||||
int64Size := int64(chunk.Size)
|
||||
if chunk.Offset+int64Size > int64(req.Size) {
|
||||
int64Size = int64(req.Size) - chunk.Offset
|
||||
}
|
||||
if chunk.Size > 0 {
|
||||
if int64Size > 0 {
|
||||
chunks = append(chunks, chunk)
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue