exportfs: Return the minimum required handle size
The exportfs encode handle function should return the minimum required handle size. This helps user to find out the handle size by passing 0 handle size in the first step and then redoing to the call again with the returned handle size value. Acked-by: Serge Hallyn <serue@us.ibm.com> Signed-off-by: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com> Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
This commit is contained in:
committed by
Al Viro
parent
c8b91accfa
commit
5fe0c23788
@@ -197,8 +197,12 @@ static int ocfs2_encode_fh(struct dentry *dentry, u32 *fh_in, int *max_len,
|
||||
dentry->d_name.len, dentry->d_name.name,
|
||||
fh, len, connectable);
|
||||
|
||||
if (len < 3 || (connectable && len < 6)) {
|
||||
mlog(ML_ERROR, "fh buffer is too small for encoding\n");
|
||||
if (connectable && (len < 6)) {
|
||||
*max_len = 6;
|
||||
type = 255;
|
||||
goto bail;
|
||||
} else if (len < 3) {
|
||||
*max_len = 3;
|
||||
type = 255;
|
||||
goto bail;
|
||||
}
|
||||
|
Reference in New Issue
Block a user