filestore: return negative error code if open fails

ENOENT was being treated as a read of length 2, causing #890.

Signed-off-by: Josh Durgin <josh.durgin@dreamhost.com>
This commit is contained in:
Josh Durgin 2011-03-16 11:21:47 -07:00
parent 3f442f0686
commit a70b5a81a5

View File

@ -2152,7 +2152,7 @@ int FileStore::read(coll_t cid, const sobject_t& oid,
int err = errno;
dout(10) << "FileStore::read(" << fn << "): open error "
<< cpp_strerror(err) << dendl;
return err;
return -err;
}
if (len == 0) {