Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
FSAL_CEPH: fix create handle return EINVAL
    - correct the compare with key and len on the right data type.

Change-Id: I2a1d8c0e5b1d74a5eb51cd894a7825ba59ce573c
Signed-off-by: Vicente Cheng <vicente_cheng@bigtera.com>
  • Loading branch information
viCEnTECheNg authored and ffilz committed Oct 2, 2020
1 parent 5a05378 commit 101cfb8
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions src/FSAL/FSAL_CEPH/export.c
Expand Up @@ -238,7 +238,8 @@ static fsal_status_t create_handle(struct fsal_export *export_pub,
/* FSAL status to return */
fsal_status_t status = { ERR_FSAL_NO_ERROR, 0 };
/* The FSAL specific portion of the handle received by the client */
struct ceph_host_handle *key = desc->addr;
struct ceph_handle_key *key = desc->addr;
struct ceph_host_handle *hhdl = &key->hhdl;
/* Ceph return code */
int rc = 0;
/* Stat buffer */
Expand All @@ -256,8 +257,8 @@ static fsal_status_t create_handle(struct fsal_export *export_pub,
return status;
}

vi.ino.val = key->chk_ino;
vi.snapid.val = key->chk_snap;
vi.ino.val = hhdl->chk_ino;
vi.snapid.val = hhdl->chk_snap;

/* Check our local cache first */
i = ceph_ll_get_inode(export->cmount, vi);
Expand All @@ -268,7 +269,7 @@ static fsal_status_t create_handle(struct fsal_export *export_pub,
* Currently, there is no interface for looking up a snapped
* inode, so we just bail here in that case.
*/
if (key->chk_snap != CEPH_NOSNAP)
if (hhdl->chk_snap != CEPH_NOSNAP)
return ceph2fsal_error(-ESTALE);

rc = ceph_ll_lookup_inode(export->cmount, vi.ino, &i);
Expand Down

0 comments on commit 101cfb8

Please sign in to comment.