From 6b3d1f3a83e00639ec483bc76a2fc3f65f548110 Mon Sep 17 00:00:00 2001 From: Boaz Harrosh Date: Mon, 2 Nov 2009 18:19:24 +0200 Subject: [PATCH] --- yaml --- r: 174356 b: refs/heads/master c: cae012d8532879544326fff5fa2ae22a6dfe8e23 h: refs/heads/master v: v3 --- [refs] | 2 +- trunk/fs/exofs/super.c | 10 ++++++---- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/[refs] b/[refs] index 8b5238ed05a3..673865ff895f 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 19fe294f2eaee33574ac1fdcf3cc26880de820ea +refs/heads/master: cae012d8532879544326fff5fa2ae22a6dfe8e23 diff --git a/trunk/fs/exofs/super.c b/trunk/fs/exofs/super.c index 920f0165edf3..28add3eac0a4 100644 --- a/trunk/fs/exofs/super.c +++ b/trunk/fs/exofs/super.c @@ -473,9 +473,11 @@ static int exofs_statfs(struct dentry *dentry, struct kstatfs *buf) goto out; ret = extract_attr_from_req(or, &attrs[0]); - if (likely(!ret)) + if (likely(!ret)) { capacity = get_unaligned_be64(attrs[0].val_ptr); - else + if (unlikely(!capacity)) + capacity = ULLONG_MAX; + } else EXOFS_DBGMSG("exofs_statfs: get capacity failed.\n"); ret = extract_attr_from_req(or, &attrs[1]); @@ -487,8 +489,8 @@ static int exofs_statfs(struct dentry *dentry, struct kstatfs *buf) /* fill in the stats buffer */ buf->f_type = EXOFS_SUPER_MAGIC; buf->f_bsize = EXOFS_BLKSIZE; - buf->f_blocks = (capacity >> EXOFS_BLKSHIFT); - buf->f_bfree = ((capacity - used) >> EXOFS_BLKSHIFT); + buf->f_blocks = capacity >> 9; + buf->f_bfree = (capacity - used) >> 9; buf->f_bavail = buf->f_bfree; buf->f_files = sbi->s_numfiles; buf->f_ffree = EXOFS_MAX_ID - sbi->s_numfiles;