From: Aneesh Kumar K.V Date: Tue, 5 Oct 2010 10:33:42 +0000 (+0530) Subject: ceph: Update max_len with minimum required size X-Git-Tag: v2.6.36-rc8~20^2~2 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=bba0cd0e3d97472855840af817b766e3f632a501;p=platform%2Fkernel%2Flinux-exynos.git ceph: Update max_len with minimum required size 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 Signed-off-by: Sage Weil --- diff --git a/fs/ceph/export.c b/fs/ceph/export.c index 387c582..e38423e 100644 --- a/fs/ceph/export.c +++ b/fs/ceph/export.c @@ -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;