struct dentry *dentry = file->f_path.dentry;
struct dentry *cursor = file->private_data;
@@ -194,9 +195,10 @@ int dcache_readdir(struct file *file, st
- if (ctx->pos == 2)
- p = &dentry->d_subdirs;
- while ((next = next_positive(dentry, p, 1)) != NULL) {
+ p = &cursor->d_child;
+
+ while ((p = scan_positives(cursor, p, 1, &next)) != anchor) {
- if (!dir_emit(ctx, next->d_name.name, next->d_name.len,
+ if (!filter || filter(next))
+ if (!dir_emit(ctx, next->d_name.name, next->d_name.len,
d_inode(next)->i_ino, dt_type(d_inode(next))))
- break;
+ break;
- moved = true;
- p = &next->d_child;
ctx->pos++;
+ }
+ spin_lock(&dentry->d_lock);
@@ -205,8 +207,22 @@ int dcache_readdir(struct file *file, st
move_cursor(cursor, p);
return 0;
} else if (S_ISDIR(mode)) {
inc_nlink(inode);
/* Some things misbehave if size == 0 on a directory */
-@@ -396,8 +404,11 @@ static void mqueue_evict_inode(struct in
-
+@@ -402,6 +402,7 @@ static void mqueue_evict_inode(struct in
user = info->user;
if (user) {
+ unsigned long mq_bytes, mq_treesize;
+ struct vx_info *vxi = info->vxi;
-+
+
+ /* Total amount of bytes accounted for the mqueue */
+ mq_treesize = info->attr.mq_maxmsg * sizeof(struct msg_msg) +
+@@ -413,6 +414,7 @@ static void mqueue_evict_inode(struct in
+
spin_lock(&mq_lock);
user->mq_bytes -= mq_bytes;
+ vx_ipcmsg_sub(vxi, user, mq_bytes);
#include <linux/hw_breakpoint.h>
#include <linux/cn_proc.h>
#include <linux/compat.h>
-@@ -325,6 +326,11 @@ ok:
- !ptrace_has_cap(mm->user_ns, mode)))
- return -EPERM;
+@@ -331,6 +331,12 @@ ok:
+ if (mode & PTRACE_MODE_SCHED)
+ return 0;
++
+ if (!vx_check(task->xid, VS_ADMIN_P|VS_WATCH_P|VS_IDENT))
+ return -EPERM;
+ if (!vx_check(task->xid, VS_IDENT) &&
-+ !task_vx_flags(task, VXF_STATE_ADMIN, 0))
++ !task_vx_flags(task, VXF_STATE_ADMIN, 0))
+ return -EACCES;
return security_ptrace_access_check(task, mode);
}