[Ocfs2-tools-devel] [PATCH 2/5] tunefs.ocfs2: Correct the way of calculating try_clusters

piaojun piaojun at huawei.com
Thu Apr 2 05:27:34 PDT 2015


In check_new_size(), ocfs2_clusters_in_bytes() should be replaced with
ocfs2_bytes_to_clusters() in case try_clusters is larger than
device_clusters.

Signed-off-by: Jun Piao <piaojun at huawei.com>
Reviewed-by: Alex Chen <alex.chen at huawei.com>

---
 tunefs.ocfs2/op_resize_volume.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tunefs.ocfs2/op_resize_volume.c b/tunefs.ocfs2/op_resize_volume.c
index 076bda0..96eef66 100644
--- a/tunefs.ocfs2/op_resize_volume.c
+++ b/tunefs.ocfs2/op_resize_volume.c
@@ -506,7 +506,7 @@ static errcode_t check_new_size(ocfs2_filesys *fs, uint64_t new_size,
 	errcode_t ret;
 	uint64_t max_bytes = ocfs2_clusters_to_bytes(fs, UINT32_MAX);
 	uint64_t device_bytes;
-	uint32_t try_clusters = ocfs2_clusters_in_bytes(fs, new_size);
+	uint32_t try_clusters = ocfs2_bytes_to_clusters(fs, new_size);
 	uint64_t try_blocks;
 	uint64_t device_blocks;
 	uint64_t device_clusters;  /* 64bits because devices can be larger
-- 
1.8.4.3




More information about the Ocfs2-tools-devel mailing list