Loading fs/ceph/locks.c +10 −7 Original line number Diff line number Diff line Loading @@ -431,19 +431,22 @@ int ceph_locks_to_pagelist(struct ceph_filelock *flocks, if (err) goto out_fail; if (num_fcntl_locks > 0) { err = ceph_pagelist_append(pagelist, flocks, num_fcntl_locks * sizeof(*flocks)); if (err) goto out_fail; } nlocks = cpu_to_le32(num_flock_locks); err = ceph_pagelist_append(pagelist, &nlocks, sizeof(nlocks)); if (err) goto out_fail; err = ceph_pagelist_append(pagelist, &flocks[num_fcntl_locks], if (num_flock_locks > 0) { err = ceph_pagelist_append(pagelist, &flocks[num_fcntl_locks], num_flock_locks * sizeof(*flocks)); } out_fail: return err; } fs/ceph/mds_client.c +20 −14 Original line number Diff line number Diff line Loading @@ -2899,12 +2899,13 @@ static int encode_caps_cb(struct inode *inode, struct ceph_cap *cap, if (recon_state->msg_version >= 2) { int num_fcntl_locks, num_flock_locks; struct ceph_filelock *flocks; struct ceph_filelock *flocks = NULL; size_t struct_len, total_len = 0; u8 struct_v = 0; encode_again: ceph_count_locks(inode, &num_fcntl_locks, &num_flock_locks); if (num_fcntl_locks + num_flock_locks > 0) { flocks = kmalloc((num_fcntl_locks + num_flock_locks) * sizeof(struct ceph_filelock), GFP_NOFS); if (!flocks) { Loading @@ -2916,10 +2917,15 @@ static int encode_caps_cb(struct inode *inode, struct ceph_cap *cap, num_flock_locks); if (err) { kfree(flocks); flocks = NULL; if (err == -ENOSPC) goto encode_again; goto out_free; } } else { kfree(flocks); flocks = NULL; } if (recon_state->msg_version >= 3) { /* version, compat_version and struct_len */ Loading Loading
fs/ceph/locks.c +10 −7 Original line number Diff line number Diff line Loading @@ -431,19 +431,22 @@ int ceph_locks_to_pagelist(struct ceph_filelock *flocks, if (err) goto out_fail; if (num_fcntl_locks > 0) { err = ceph_pagelist_append(pagelist, flocks, num_fcntl_locks * sizeof(*flocks)); if (err) goto out_fail; } nlocks = cpu_to_le32(num_flock_locks); err = ceph_pagelist_append(pagelist, &nlocks, sizeof(nlocks)); if (err) goto out_fail; err = ceph_pagelist_append(pagelist, &flocks[num_fcntl_locks], if (num_flock_locks > 0) { err = ceph_pagelist_append(pagelist, &flocks[num_fcntl_locks], num_flock_locks * sizeof(*flocks)); } out_fail: return err; }
fs/ceph/mds_client.c +20 −14 Original line number Diff line number Diff line Loading @@ -2899,12 +2899,13 @@ static int encode_caps_cb(struct inode *inode, struct ceph_cap *cap, if (recon_state->msg_version >= 2) { int num_fcntl_locks, num_flock_locks; struct ceph_filelock *flocks; struct ceph_filelock *flocks = NULL; size_t struct_len, total_len = 0; u8 struct_v = 0; encode_again: ceph_count_locks(inode, &num_fcntl_locks, &num_flock_locks); if (num_fcntl_locks + num_flock_locks > 0) { flocks = kmalloc((num_fcntl_locks + num_flock_locks) * sizeof(struct ceph_filelock), GFP_NOFS); if (!flocks) { Loading @@ -2916,10 +2917,15 @@ static int encode_caps_cb(struct inode *inode, struct ceph_cap *cap, num_flock_locks); if (err) { kfree(flocks); flocks = NULL; if (err == -ENOSPC) goto encode_again; goto out_free; } } else { kfree(flocks); flocks = NULL; } if (recon_state->msg_version >= 3) { /* version, compat_version and struct_len */ Loading