Skip to content

Commit

Permalink
ceph: Update max_len with minimum required size
Browse files Browse the repository at this point in the history
encode_fh on error should update max_len with minimum required
size, so that caller can redo the call with the reallocated buffer.
This is required with open by handle patch series

Signed-off-by: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>
Signed-off-by: Sage Weil <sage@newdream.net>
  • Loading branch information
Aneesh Kumar K.V authored and Sage Weil committed Oct 7, 2010
1 parent 92923dc commit bba0cd0
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion fs/ceph/export.c
Original file line number Diff line number Diff line change
Expand Up @@ -62,13 +62,16 @@ static int ceph_encode_fh(struct dentry *dentry, u32 *rawfh, int *max_len,
*max_len = connected_handle_length;
type = 2;
} else if (*max_len >= handle_length) {
if (connectable)
if (connectable) {
*max_len = connected_handle_length;
return 255;
}
dout("encode_fh %p\n", dentry);
fh->ino = ceph_ino(dentry->d_inode);
*max_len = handle_length;
type = 1;
} else {
*max_len = handle_length;
return 255;
}
return type;
Expand Down

0 comments on commit bba0cd0

Please sign in to comment.