Change in vdsm[master]: Fix calculation of file volume allocated size.

nsoffer at redhat.com nsoffer at redhat.com
Thu Nov 21 08:08:13 UTC 2013


Nir Soffer has posted comments on this change.

Change subject: Fix calculation of file volume allocated size.
......................................................................


Patch Set 1: Code-Review+1

(2 comments)

The commit message and comment in the code can be improved.

....................................................
Commit Message
Line 14: it's value should be multiply by 512 instead of stat.st_blksize.
Line 15: 
Line 16: On my environment a 4.5GB volume appeared in the Engine as 1176GB and
Line 17: and I couldn't create additional disks on that storage domain because of
Line 18: Engine validations.
I would replace all this with:

Allocated size was computed using st_blksize as block size. st_blksize is the "preferred" buffer size for efficient file system I/O on the file system where the block is. This patch use block size of 512 bytes as specified in stat(2) manual.
Line 19: 
Line 20: Change-Id: I71646199e2c0ac4564b832b8ebb202f49e289344


....................................................
File vdsm/storage/fileSD.py
Line 300:         stat = self.oop.os.stat(volPath)
Line 301: 
Line 302:         # According to stat manual st_blocks is the number of 512B
Line 303:         # blocks allocated therefore it should be multiply by 512
Line 304:         # to get the allocated size
stat(2) manual is more clear:

    # The st_blocks field indicates the number of blocks allocated to 
    # the file, in 512-byte units.
Line 305:         return stat.st_blocks * 512
Line 306: 
Line 307:     @classmethod
Line 308:     def validateCreateVolumeParams(cls, volFormat, preallocate, srcVolUUID):


-- 
To view, visit http://gerrit.ovirt.org/21490
To unsubscribe, visit http://gerrit.ovirt.org/settings

Gerrit-MessageType: comment
Gerrit-Change-Id: I71646199e2c0ac4564b832b8ebb202f49e289344
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Sergey Gotliv <sgotliv at redhat.com>
Gerrit-Reviewer: Ayal Baron <abaron at redhat.com>
Gerrit-Reviewer: Dan Kenigsberg <danken at redhat.com>
Gerrit-Reviewer: Federico Simoncelli <fsimonce at redhat.com>
Gerrit-Reviewer: Nir Soffer <nsoffer at redhat.com>
Gerrit-Reviewer: oVirt Jenkins CI Server
Gerrit-HasComments: Yes


More information about the vdsm-patches mailing list