From: green Date: Wed, 11 May 2005 21:16:30 +0000 (+0000) Subject: Branch: b1_4 X-Git-Tag: v1_7_100~1^25~8^2~134 X-Git-Url: https://git.whamcloud.com/gitweb?a=commitdiff_plain;h=68c2d5c4d31bfc70a063fd99f59ed984f3784aaa;p=fs%2Flustre-release.git Branch: b1_4 b=6243 r=adilger Properly return 0 for reads that are totally after EOF. --- diff --git a/lustre/ChangeLog b/lustre/ChangeLog index aa17e2c..73f15ff 100644 --- a/lustre/ChangeLog +++ b/lustre/ChangeLog @@ -5,6 +5,7 @@ tbd Cluster File Systems, Inc. - fix a collection of import/export refcount and cleanup ordering issues for safer force cleanup (5949,4834) - fix lfs to handle large numbers of targets (6223) + - Fix reads after EOF on files with no objects to return 0 (6264,6243) 2005-05-10 Cluster File Systems, Inc. * version 1.4.2 diff --git a/lustre/llite/file.c b/lustre/llite/file.c index 2d7e572..fa7455b 100644 --- a/lustre/llite/file.c +++ b/lustre/llite/file.c @@ -784,6 +784,11 @@ static ssize_t ll_file_read(struct file *filp, char *buf, size_t count, /* Since there are no objects on OSTs, we have nothing to get * lock on and so we are forced to access inode->i_size * unguarded */ + + /* Read beyond end of file */ + if (*ppos >= inode->i_size) + RETURN(0); + if (count > inode->i_size - *ppos) count = inode->i_size - *ppos; /* Make sure to correctly adjust the file pos pointer for