How to best return errors on follow_link

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Jeff noticed a problem with the error handling in cifs_follow_link
that brought up a question about how follow_link is supposed to be
handling errors.  His change has a sideeffect of now returning NULL
instead of an  ENOMEM on memory allocation errors in cifs_follow_link.

The caller of follow_link in the VFS  (__do_follow_link) seems to
expect errors to be returned (see below piece of fs/namei.c) not a
NULL ptr:

	cookie = dentry->d_inode->i_op->follow_link(dentry, nd);
	error = PTR_ERR(cookie);
	if (!IS_ERR(cookie)) {
		char *s = nd_get_link(nd);
		error = 0;
		if (s)
			error = __vfs_follow_link(nd, s);
		if (dentry->d_inode->i_op->put_link)
			dentry->d_inode->i_op->put_link(dentry, nd, cookie);
	}
	path_put(path);
	return error;

Some file systems rather than returning an error to the caller will
call nd_set_link while will set:         nd->saved_names[nd->depth] =
to the error;


Is it ok to return errors on follow_link - seems strange to return
them indicectly via set_link?
-- 
Thanks,

Steve
--
To unsubscribe from this list: send the line "unsubscribe linux-fsdevel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Ext4 Filesystem]     [Union Filesystem]     [Filesystem Testing]     [Ceph Users]     [Ecryptfs]     [AutoFS]     [Kernel Newbies]     [Share Photos]     [Security]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux Cachefs]     [Reiser Filesystem]     [Linux RAID]     [Samba]     [Device Mapper]     [CEPH Development]
  Powered by Linux