lkml.org 
[lkml]   [1999]   [Sep]   [2]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
SubjectNFSv3 stat() reports incorrect block count
Here's the symptom:

-rw-r--r-- 1 rugolsky ead 18158786 Sep 1 08:02 linux-kernel.gz
rugolsky@ead44: statfile linux-kernel.gz
dev: 3
ino: 10103
mode: 100644
nlink: 1
uid: 343
gid: 50
rdev: 0
size: 18158786
atime: 990901 10:40:46
mtime: 990901 08:02:38
ctime: 990901 08:02:38
blksize: 8192
blocks: 18186240

The (rounded up) block count is being multipled by the block size.
Attached is a trivial patch against linux-2.2.12-nfsv3-0.11.6.

Regards,

Bill Rugolsky
rugolsky@ead.dsa.com

--- linux/fs/nfs/inode.c.orig Tue Aug 31 15:08:17 1999
+++ linux/fs/nfs/inode.c Thu Sep 2 09:47:56 1999
@@ -1236,8 +1236,7 @@
* report the blocks in i_blksize units
*/
inode->i_blocks = ((used + inode->i_sb->s_blocksize - 1)
- / inode->i_sb->s_blocksize)
- * inode->i_sb->s_blocksize;
+ / inode->i_sb->s_blocksize);
inode->i_blksize = inode->i_sb->s_blocksize;
} else {
inode->i_blocks = fattr->du.nfs2.blocks;
\
 
 \ /
  Last update: 2005-03-22 13:53    [W:0.327 / U:0.056 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site