Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

9p: fix flags length in net

Some files in the net/9p directory uses "int" for flags. This can
cause hard to find bugs on some architectures. This patch converts the
flags to use "long" instead.

This bug was discovered by doing an allyesconfig make on the -rt kernel
where checks are done to ensure all flags are of size sizeof(long).

Signed-off-by: Steven Rostedt <srostedt@redhat.com>
Acked-by: Eric Van Hensbergen <ericvh@gmail.com>

authored by

Steven Rostedt and committed by
Eric Van Hensbergen
d0c44718 728fc4ef

+3 -3
+1 -1
net/9p/trans_virtio.c
··· 201 201 { 202 202 struct virtio_chan *chan = trans->priv; 203 203 int count; 204 - unsigned int flags; 204 + unsigned long flags; 205 205 206 206 spin_lock_irqsave(&chan->lock, flags); 207 207 p9_idpool_destroy(chan->tagpool);
+2 -2
net/9p/util.c
··· 88 88 { 89 89 int i = 0; 90 90 int error; 91 - unsigned int flags; 91 + unsigned long flags; 92 92 93 93 retry: 94 94 if (idr_pre_get(&p->pool, GFP_KERNEL) == 0) ··· 120 120 121 121 void p9_idpool_put(int id, struct p9_idpool *p) 122 122 { 123 - unsigned int flags; 123 + unsigned long flags; 124 124 spin_lock_irqsave(&p->lock, flags); 125 125 idr_remove(&p->pool, id); 126 126 spin_unlock_irqrestore(&p->lock, flags);