Skip to content

Commit bde9154

Browse files
authored
Merge pull request ceph#64701 from izxl007/getattr
fuse: improve error handling in fuse_ll_getattr Reviewed-by: Venky Shankar <[email protected]>
2 parents dd36628 + c0dd7cb commit bde9154

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

src/client/fuse_ll.cc

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -389,13 +389,14 @@ static void fuse_ll_getattr(fuse_req_t req, fuse_ino_t ino,
389389

390390
(void) fi; // XXX
391391

392-
if (cfuse->client->ll_getattr(in, &stbuf, perms)
393-
== 0) {
392+
int r = cfuse->client->ll_getattr(in, &stbuf, perms);
393+
if (r == 0) {
394394
stbuf.st_ino = cfuse->make_fake_ino(stbuf.st_ino, stbuf.st_dev);
395395
stbuf.st_rdev = new_encode_dev(stbuf.st_rdev);
396396
fuse_reply_attr(req, &stbuf, 0);
397397
} else
398-
fuse_reply_err(req, ENOENT);
398+
fuse_reply_err(req, get_sys_errno(-r));
399+
399400

400401
cfuse->iput(in); // iput required
401402
}

0 commit comments

Comments
 (0)