Whamcloud - gitweb
update file size in ll_file_read, lest the VFS decide not to call us
authorpschwan <pschwan>
Fri, 8 Nov 2002 19:33:59 +0000 (19:33 +0000)
committerpschwan <pschwan>
Fri, 8 Nov 2002 19:33:59 +0000 (19:33 +0000)
lustre/llite/file.c

index 8008fb3..3f52d6b 100644 (file)
@@ -454,6 +454,14 @@ static ssize_t ll_file_read(struct file *filp, char *buf, size_t count,
                 }
         }
 
+        /* If we don't refresh the file size, generic_file_read may not even
+         * call us */
+        retval = ll_file_size(inode, lsm);
+        if (retval < 0) {
+                CERROR("ll_file_size: %d\n", retval);
+                RETURN(retval);
+        }
+
         CDEBUG(D_INFO, "Reading inode %ld, %d bytes, offset %Ld\n",
                inode->i_ino, count, *ppos);
         retval = generic_file_read(filp, buf, count, ppos);