diff options
author | Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com> | 2010-10-05 06:33:42 -0400 |
---|---|---|
committer | Sage Weil <sage@newdream.net> | 2010-10-07 11:00:24 -0400 |
commit | bba0cd0e3d97472855840af817b766e3f632a501 (patch) | |
tree | 31794165c098a079e3af617b594eaf9ae8d3bd8a /fs | |
parent | 92923dcbfcad107b0e0469f579a2455729ccf10e (diff) |
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 <aneesh.kumar@linux.vnet.ibm.com>
Signed-off-by: Sage Weil <sage@newdream.net>
Diffstat (limited to 'fs')
-rw-r--r-- | fs/ceph/export.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/fs/ceph/export.c b/fs/ceph/export.c index 387c5823944e..e38423e82f2e 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, | |||
62 | *max_len = connected_handle_length; | 62 | *max_len = connected_handle_length; |
63 | type = 2; | 63 | type = 2; |
64 | } else if (*max_len >= handle_length) { | 64 | } else if (*max_len >= handle_length) { |
65 | if (connectable) | 65 | if (connectable) { |
66 | *max_len = connected_handle_length; | ||
66 | return 255; | 67 | return 255; |
68 | } | ||
67 | dout("encode_fh %p\n", dentry); | 69 | dout("encode_fh %p\n", dentry); |
68 | fh->ino = ceph_ino(dentry->d_inode); | 70 | fh->ino = ceph_ino(dentry->d_inode); |
69 | *max_len = handle_length; | 71 | *max_len = handle_length; |
70 | type = 1; | 72 | type = 1; |
71 | } else { | 73 | } else { |
74 | *max_len = handle_length; | ||
72 | return 255; | 75 | return 255; |
73 | } | 76 | } |
74 | return type; | 77 | return type; |