aboutsummaryrefslogtreecommitdiffstats
path: root/fs/afs
diff options
context:
space:
mode:
Diffstat (limited to 'fs/afs')
-rw-r--r--fs/afs/inode.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/fs/afs/inode.c b/fs/afs/inode.c
index 0362cc7e1c7c..c4652b42d545 100644
--- a/fs/afs/inode.c
+++ b/fs/afs/inode.c
@@ -111,7 +111,11 @@ static int afs_inode_init_from_status(struct afs_vnode *vnode, struct key *key,
return afs_protocol_error(NULL, -EBADMSG, afs_eproto_file_type);
}
- inode->i_blocks = 0;
+ /*
+ * Estimate 512 bytes blocks used, rounded up to nearest 1K
+ * for consistency with other AFS clients.
+ */
+ inode->i_blocks = ((i_size_read(inode) + 1023) >> 10) << 1;
vnode->invalid_before = vnode->status.data_version;
read_sequnlock_excl(&vnode->cb_lock);