Whamcloud - gitweb
Branch: b1_4
authorgreen <green>
Wed, 11 May 2005 21:16:30 +0000 (21:16 +0000)
committergreen <green>
Wed, 11 May 2005 21:16:30 +0000 (21:16 +0000)
b=6243
r=adilger

Properly return 0 for reads that are totally after EOF.

lustre/ChangeLog
lustre/llite/file.c

index aa17e2c..73f15ff 100644 (file)
@@ -5,6 +5,7 @@ tbd         Cluster File Systems, Inc. <info@clusterfs.com>
        - 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. <info@clusterfs.com>
        * version 1.4.2
index 2d7e572..fa7455b 100644 (file)
@@ -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