diff options
Diffstat (limited to 'libdiskfs/io-read.c')
-rw-r--r-- | libdiskfs/io-read.c | 8 |
1 files changed, 1 insertions, 7 deletions
diff --git a/libdiskfs/io-read.c b/libdiskfs/io-read.c index 397349df..041cbc29 100644 --- a/libdiskfs/io-read.c +++ b/libdiskfs/io-read.c @@ -39,8 +39,6 @@ diskfs_S_io_read (struct protid *cred, np = cred->po->np; if (!(cred->po->openstat & O_READ)) return EBADF; - if (maxread < 0) - return EINVAL; mutex_lock (&np->lock); @@ -50,11 +48,7 @@ diskfs_S_io_read (struct protid *cred, off = cred->po->filepointer; if (off + maxread > np->dn_stat.st_size) - { - maxread = np->dn_stat.st_size - off; - if (maxread < 0) - maxread = 0; - } + maxread = np->dn_stat.st_size - off; if (maxread > *datalen) { |