Re: [PATCH 2/3] netcls_cgroup: introduce cgroup_cls_state->is_local

From
Daniel Wagner <hidden>
Date
2012-11-19 12:54:29
Also in
lkml
Reply to
Tejun Heo, 2012-11-17
Hi Tejun,

On 17.11.2012 04:31, Tejun Heo wrote:
quoted hunk ↗ jump to hunk
-static int write_classid(struct cgroup *cgrp, struct cftype *cft, u64 value)
+static int write_classid(struct cgroup *cgrp, struct cftype *cft,
+			 const char *buf)
  {
+	struct cgroup_cls_state *cs = cgrp_cls_state(cgrp);
+	s64 v;
+
+	if (sscanf(buf, "%lld", &v) != 1)
+		return -EINVAL;
+
This changes the user API slightly. cgroup_write_u64() uses simple_stroull() to parse the string. simple_stroull() allows to use either 0x1234 or 1234 as input. sscanf() will only handle the later type of input.

I noticed this because my test script stopped working:

   mkdir /sys/fs/cgroup/net_cls/a
   echo 0x100002 > /sys/fs/cgroup/net_cls/a/net_cls.classid # 10:2

   tc qdisc add dev $DEV root handle 10: htb
   tc class add dev $DEV parent 10: classid 10:2 htb rate 1mbit
   tc qdisc add dev $DEV parent 10:2 handle 20: sfq perturb 10

I am not completely sure if my setup is 100% correct, but at least
it seems to make something :)

cheers,
daniel
Thread (18 messages) 18 messages, 5 authors, last reply 2012-11-20
Keyboard shortcuts
hback out one level
jnext message in thread / next series-diff position
kprevious message in thread / previous series-diff position
ldrill in
Escclose help / fold thread tree
?toggle this help