Comments (6)
from coda.
Yes. What I mean is that if I run venus -c 100000
I'll get a size of 400000
in the coda mount. Bellow the output;
pjcuadra@pjcuadra-vaio:/$ sudo venus -init -c 100000
Date: Sat 07/14/2018
13:58:22 Coda Venus, version 6.14.0
13:58:22 /var/lib/coda/LOG size is 19780620 bytes
13:58:22 /var/lib/coda/DATA size is 79122480 bytes
13:58:22 /var/lib/coda/DATA size is 79122480 bytes
13:58:22 Initializing RVM data...
13:58:22 ...done
13:58:22 Loading RVM data
13:58:22 Starting RealmDB scan
13:58:22 Found 1 realms
13:58:22 starting VDB scan
13:58:22 0 volume replicas
13:58:22 0 replicated volumes
13:58:22 0 CML entries allocated
13:58:22 0 CML entries on free-list
13:58:22 starting FSDB scan (4166, 100000) (25, 75, 4)
13:58:22 0 cache files in table (0 blocks)
13:58:22 4166 cache files on free-list
13:58:23 starting HDB scan
13:58:23 0 hdb entries in table
13:58:23 0 hdb entries on free-list
13:58:23 Kernel version ioctl failed.
13:58:23 Mounting root volume...
13:58:23 Venus starting...
13:58:23 /coda now mounted.
pjcuadra@pjcuadra-vaio:/$ df
Filesystem 1K-blocks Used Available Use% Mounted on
udev 3989196 0 3989196 0% /dev
...
coda 400000 0 375000 0% /coda
What happens is that; in my file system, the block size is in fact 4096. Output below;
pjcuadra@pjcuadra-vaio:/coda$ stat -f .
File: "."
ID: 0 Namelen: 255 Type: coda
Block size: 4096 Fundamental block size: 4096
Blocks: Total: 100000 Free: 100000 Available: 93750
Inodes: Total: 4166 Free: 4163
Aparently, the size of coda's root volume is calculated assuming 1K block size.
from coda.
from coda.
You mean something like editing vproc_vfscalls.cc
in this way?
#include <sys/statvfs.h>
...
#define CODA_BLOCK_SIZE 1024
...
void vproc::statfs(struct coda_statfs *sfs) {
struct statvfs stat;
LOG(1, ("vproc::statfs\n"));
sfs->f_blocks = CacheBlocks;
sfs->f_bfree = (CacheBlocks - FSDB->DirtyBlockCount());
sfs->f_bavail = FSDB->FreeBlockCount() - FSDB->FreeBlockMargin;
sfs->f_files = CacheFiles;
sfs->f_ffree = FSDB->FreeFsoCount();
/* Get stats from the FS where the cache is stored */
statvfs(CacheDir, &stat);
/* Compensate block size */
sfs->f_blocks *= CODA_BLOCK_SIZE;
sfs->f_blocks /= stat.f_bsize;
sfs->f_bfree *= CODA_BLOCK_SIZE;
sfs->f_bfree /= stat.f_bsize;
sfs->f_bavail *= CODA_BLOCK_SIZE;
sfs->f_bavail /= stat.f_bsize;
}
With this change I have the correct output as follows;
pjcuadra@pjcuadra-vaio:/coda$ df
Filesystem 1K-blocks Used Available Use% Mounted on
udev 3989196 0 3989196 0% /dev
...
coda 100000 0 93748 0% /coda
pjcuadra@pjcuadra-vaio:/coda$ stat -f .
File: "."
ID: 0 Namelen: 255 Type: coda
Block size: 4096 Fundamental block size: 4096
Blocks: Total: 25000 Free: 25000 Available: 23437
Inodes: Total: 4166 Free: 4163
Shouldn't we maybe make coda kernel "aware" of block size?
from coda.
You can have a look at the change here pjcuadra/coda/tree/fix/block_size_missmatch
from coda.
I just checked and the statfs->f_bsize value is not taken from the underlying filesystem block size, it is hardcoded as 4096 in the Linux kernel module. So doing a simple sfs->f_blocks /= 4;
probably is good enough.
I just went to check what the FBSD kernel module is doing and discovered that they dropped the Coda kernel module with release 10, either because of how it handled locking or GPL contamination. Either way we don't have to worry about how it used to handle file system block size.
from coda.
Related Issues (20)
- crash in file resolution
- rm fails to remove VASTRO object HOT 2
- crash in CacheFile::Copy
- Do not automatically restart client during upgrade HOT 1
- coda-7.1.0: assumes lwp is in PKG_CONFIG_PATH (bootstrap failure) HOT 9
- Web page news is out of date about versions HOT 4
- Missing tokens should cause a better failure than I/O error HOT 1
- Value 100000000 for cacheblocks causes "venus -init" to be terminated with signal 7 HOT 3
- "fatal error -- Assertion failed: file "fso_cfscalls2.cc", line 268" during file transfer HOT 1
- kernel BUG at /build/linux-CFFAZ3/linux-4.10.0/mm/usercopy.c:75 HOT 6
- Can't build on FreeBSD HOT 5
- coda-client-setup paths problem
- systemd-initd confusion HOT 1
- Servers fail to restart under systemd HOT 1
- After rpc2 update to 2.14, coda_server 6.9.5 breaks: error: unterminated conditional directive HOT 9
- Use available tools to find common bugs
- Current status and roadmap HOT 2
- Index and chunk size overflow on VASTRO's bitmap
- Whitespace in hostname disturbes vice-setup HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from coda.