#endif /* F_GETLK64 && F_GETLK != F_GETLK64 */
AFS_GLOCK();
+ if ((vcp->f.states & CRO)) {
+ if (flp->fl_type == F_WRLCK) {
+ code = EBADF;
+ } else {
+ code = 0;
+ }
+ AFS_GUNLOCK();
+ crfree(credp);
+ return code;
+ }
code = afs_convert_code(afs_lockctl(vcp, &flock, cmd, credp));
AFS_GUNLOCK();
{
struct dentry *target;
+ /* avoid symlink resolution limits when resolving; we cannot contribute to
+ * an infinite symlink loop */
+ current->total_link_count--;
+
target = canonical_dentry(path->dentry->d_inode);
if (target == path->dentry) {
if(page_ix == 0) {
offset = page_offset(pp);
- auio->uio_offset = offset;
+ ancr->offset = auio->uio_offset = offset;
base_index = pp->index;
}
iovecp[page_ix].iov_len = PAGE_SIZE;
static inline int
afs_linux_can_bypass(struct inode *ip) {
+
switch(cache_bypass_strategy) {
case NEVER_BYPASS_CACHE:
return 0;
case ALWAYS_BYPASS_CACHE:
return 1;
case LARGE_FILES_BYPASS_CACHE:
- if(i_size_read(ip) > cache_bypass_threshold)
+ if (i_size_read(ip) > cache_bypass_threshold)
return 1;
default:
return 0;
struct dentry **dpp;
struct dentry *target;
+ if (current->total_link_count > 0) {
+ /* avoid symlink resolution limits when resolving; we cannot contribute to
+ * an infinite symlink loop */
+ /* only do this for follow_link when total_link_count is positive to be
+ * on the safe side; there is at least one code path in the Linux
+ * kernel where it seems like it may be possible to get here without
+ * total_link_count getting incremented. it is not clear on how that
+ * path is actually reached, but guard against it just to be safe */
+ current->total_link_count--;
+ }
+
target = canonical_dentry(dentry->d_inode);
# ifdef STRUCT_NAMEIDATA_HAS_PATH
*dpp = dget(dentry);
}
+ nd->last_type = LAST_BIND;
+
return NULL;
}
#endif /* !STRUCT_DENTRY_OPERATIONS_HAS_D_AUTOMOUNT */