<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel.git/drivers/isdn/mISDN/timerdev.c, branch linux-3.12.y</title>
<subtitle>Hosts the 0x221E linux distro kernel.
</subtitle>
<id>https://git.0xinfinity.dev/distro/kernel.git/atom?h=linux-3.12.y</id>
<link rel='self' href='https://git.0xinfinity.dev/distro/kernel.git/atom?h=linux-3.12.y'/>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/'/>
<updated>2013-04-29T19:41:49Z</updated>
<entry>
<title>mISDN: grabbing/dropping reference to THIS_MODULE in open/release is racy</title>
<updated>2013-04-29T19:41:49Z</updated>
<author>
<name>Al Viro</name>
</author>
<published>2013-04-15T21:27:11Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=89b107adce32a52920b36787b60c8f24c986c526'/>
<id>urn:sha1:89b107adce32a52920b36787b60c8f24c986c526</id>
<content type='text'>
... when you have no -&gt;owner set.

Signed-off-by: Al Viro &lt;viro@zeniv.linux.org.uk&gt;
</content>
</entry>
<entry>
<title>mISDN: fix mISDN_read()/mISDN_read() race</title>
<updated>2013-04-29T19:41:49Z</updated>
<author>
<name>Al Viro</name>
</author>
<published>2013-04-15T21:18:17Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=ebb06be16bc9a1e66a010ca50c75c5128bafb4b1'/>
<id>urn:sha1:ebb06be16bc9a1e66a010ca50c75c5128bafb4b1</id>
<content type='text'>
Signed-off-by: Al Viro &lt;viro@zeniv.linux.org.uk&gt;
</content>
</entry>
<entry>
<title>mISDN: fix misdn_add_timer()/misdn_del_timer() race</title>
<updated>2013-04-29T19:41:48Z</updated>
<author>
<name>Al Viro</name>
</author>
<published>2013-04-15T21:04:04Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=1678ec00a632f8b9204e28e5c506128881171604'/>
<id>urn:sha1:1678ec00a632f8b9204e28e5c506128881171604</id>
<content type='text'>
do add_timer() *before* unlocking dev-&gt;lock, or unpleasant things can
happen if misdn_del_timer() on another CPU finds the sucker, calls
del_timer_sync() (which does nothing, since we hadn't started the
timer yet) and frees it, just as we get around to add_timer()...

Signed-off-by: Al Viro &lt;viro@zeniv.linux.org.uk&gt;
</content>
</entry>
<entry>
<title>mISDN: fix races between misdn_del_timer() and timer callback</title>
<updated>2013-04-29T19:41:48Z</updated>
<author>
<name>Al Viro</name>
</author>
<published>2013-04-15T20:55:41Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=1b1089561ce596a4032ba1039365090304db1cfd'/>
<id>urn:sha1:1b1089561ce596a4032ba1039365090304db1cfd</id>
<content type='text'>
mark the victim with negative -&gt;id if misdn_del_timer() finds it on
the list, have timer callback *not* move ones so marked to dev-&gt;expired

Signed-off-by: Al Viro &lt;viro@zeniv.linux.org.uk&gt;
</content>
</entry>
<entry>
<title>mISDN: fix the races with timers going off just as they are deleted</title>
<updated>2013-04-29T19:41:47Z</updated>
<author>
<name>Al Viro</name>
</author>
<published>2013-04-15T20:31:13Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=c08c464d6f4136d9e48ffa23c0bcd93442343b2a'/>
<id>urn:sha1:c08c464d6f4136d9e48ffa23c0bcd93442343b2a</id>
<content type='text'>
timer callback in timerdev.c both accesses struct mISDNtimer it's
called for *and* moves it to dev-&gt;expired.  We need del_timer_sync(),
or we risk kfree() freeing it right under dev_expire_timer() *and*
dev-&gt;expired getting corrupted.

Signed-off-by: Al Viro &lt;viro@zeniv.linux.org.uk&gt;
</content>
</entry>
<entry>
<title>isdn: whitespace coding style cleanup</title>
<updated>2012-02-21T17:04:01Z</updated>
<author>
<name>Joe Perches</name>
</author>
<published>2012-02-20T03:52:38Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=475be4d85a274d0961593db41cf85689db1d583c'/>
<id>urn:sha1:475be4d85a274d0961593db41cf85689db1d583c</id>
<content type='text'>
isdn source code uses a not-current coding style.

Update the coding style used on a per-line basis
so that git diff -w shows only elided blank lines
at EOF.

Done with emacs and some scripts and some typing.

Built x86 allyesconfig.
No detected change in objdump -d or size.

Signed-off-by: Joe Perches &lt;joe@perches.com&gt;
</content>
</entry>
<entry>
<title>llseek: automatically add .llseek fop</title>
<updated>2010-10-15T13:53:27Z</updated>
<author>
<name>Arnd Bergmann</name>
</author>
<published>2010-08-15T16:52:59Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=6038f373a3dc1f1c26496e60b6c40b164716f07e'/>
<id>urn:sha1:6038f373a3dc1f1c26496e60b6c40b164716f07e</id>
<content type='text'>
All file_operations should get a .llseek operation so we can make
nonseekable_open the default for future file operations without a
.llseek pointer.

The three cases that we can automatically detect are no_llseek, seq_lseek
and default_llseek. For cases where we can we can automatically prove that
the file offset is always ignored, we use noop_llseek, which maintains
the current behavior of not returning an error from a seek.

New drivers should normally not use noop_llseek but instead use no_llseek
and call nonseekable_open at open time.  Existing drivers can be converted
to do the same when the maintainer knows for certain that no user code
relies on calling seek on the device file.

The generated code is often incorrectly indented and right now contains
comments that clarify for each added line why a specific variant was
chosen. In the version that gets submitted upstream, the comments will
be gone and I will manually fix the indentation, because there does not
seem to be a way to do that using coccinelle.

Some amount of new code is currently sitting in linux-next that should get
the same modifications, which I will do at the end of the merge window.

Many thanks to Julia Lawall for helping me learn to write a semantic
patch that does all this.

===== begin semantic patch =====
// This adds an llseek= method to all file operations,
// as a preparation for making no_llseek the default.
//
// The rules are
// - use no_llseek explicitly if we do nonseekable_open
// - use seq_lseek for sequential files
// - use default_llseek if we know we access f_pos
// - use noop_llseek if we know we don't access f_pos,
//   but we still want to allow users to call lseek
//
@ open1 exists @
identifier nested_open;
@@
nested_open(...)
{
&lt;+...
nonseekable_open(...)
...+&gt;
}

@ open exists@
identifier open_f;
identifier i, f;
identifier open1.nested_open;
@@
int open_f(struct inode *i, struct file *f)
{
&lt;+...
(
nonseekable_open(...)
|
nested_open(...)
)
...+&gt;
}

@ read disable optional_qualifier exists @
identifier read_f;
identifier f, p, s, off;
type ssize_t, size_t, loff_t;
expression E;
identifier func;
@@
ssize_t read_f(struct file *f, char *p, size_t s, loff_t *off)
{
&lt;+...
(
   *off = E
|
   *off += E
|
   func(..., off, ...)
|
   E = *off
)
...+&gt;
}

@ read_no_fpos disable optional_qualifier exists @
identifier read_f;
identifier f, p, s, off;
type ssize_t, size_t, loff_t;
@@
ssize_t read_f(struct file *f, char *p, size_t s, loff_t *off)
{
... when != off
}

@ write @
identifier write_f;
identifier f, p, s, off;
type ssize_t, size_t, loff_t;
expression E;
identifier func;
@@
ssize_t write_f(struct file *f, const char *p, size_t s, loff_t *off)
{
&lt;+...
(
  *off = E
|
  *off += E
|
  func(..., off, ...)
|
  E = *off
)
...+&gt;
}

@ write_no_fpos @
identifier write_f;
identifier f, p, s, off;
type ssize_t, size_t, loff_t;
@@
ssize_t write_f(struct file *f, const char *p, size_t s, loff_t *off)
{
... when != off
}

@ fops0 @
identifier fops;
@@
struct file_operations fops = {
 ...
};

@ has_llseek depends on fops0 @
identifier fops0.fops;
identifier llseek_f;
@@
struct file_operations fops = {
...
 .llseek = llseek_f,
...
};

@ has_read depends on fops0 @
identifier fops0.fops;
identifier read_f;
@@
struct file_operations fops = {
...
 .read = read_f,
...
};

@ has_write depends on fops0 @
identifier fops0.fops;
identifier write_f;
@@
struct file_operations fops = {
...
 .write = write_f,
...
};

@ has_open depends on fops0 @
identifier fops0.fops;
identifier open_f;
@@
struct file_operations fops = {
...
 .open = open_f,
...
};

// use no_llseek if we call nonseekable_open
////////////////////////////////////////////
@ nonseekable1 depends on !has_llseek &amp;&amp; has_open @
identifier fops0.fops;
identifier nso ~= "nonseekable_open";
@@
struct file_operations fops = {
...  .open = nso, ...
+.llseek = no_llseek, /* nonseekable */
};

@ nonseekable2 depends on !has_llseek @
identifier fops0.fops;
identifier open.open_f;
@@
struct file_operations fops = {
...  .open = open_f, ...
+.llseek = no_llseek, /* open uses nonseekable */
};

// use seq_lseek for sequential files
/////////////////////////////////////
@ seq depends on !has_llseek @
identifier fops0.fops;
identifier sr ~= "seq_read";
@@
struct file_operations fops = {
...  .read = sr, ...
+.llseek = seq_lseek, /* we have seq_read */
};

// use default_llseek if there is a readdir
///////////////////////////////////////////
@ fops1 depends on !has_llseek &amp;&amp; !nonseekable1 &amp;&amp; !nonseekable2 &amp;&amp; !seq @
identifier fops0.fops;
identifier readdir_e;
@@
// any other fop is used that changes pos
struct file_operations fops = {
... .readdir = readdir_e, ...
+.llseek = default_llseek, /* readdir is present */
};

// use default_llseek if at least one of read/write touches f_pos
/////////////////////////////////////////////////////////////////
@ fops2 depends on !fops1 &amp;&amp; !has_llseek &amp;&amp; !nonseekable1 &amp;&amp; !nonseekable2 &amp;&amp; !seq @
identifier fops0.fops;
identifier read.read_f;
@@
// read fops use offset
struct file_operations fops = {
... .read = read_f, ...
+.llseek = default_llseek, /* read accesses f_pos */
};

@ fops3 depends on !fops1 &amp;&amp; !fops2 &amp;&amp; !has_llseek &amp;&amp; !nonseekable1 &amp;&amp; !nonseekable2 &amp;&amp; !seq @
identifier fops0.fops;
identifier write.write_f;
@@
// write fops use offset
struct file_operations fops = {
... .write = write_f, ...
+	.llseek = default_llseek, /* write accesses f_pos */
};

// Use noop_llseek if neither read nor write accesses f_pos
///////////////////////////////////////////////////////////

@ fops4 depends on !fops1 &amp;&amp; !fops2 &amp;&amp; !fops3 &amp;&amp; !has_llseek &amp;&amp; !nonseekable1 &amp;&amp; !nonseekable2 &amp;&amp; !seq @
identifier fops0.fops;
identifier read_no_fpos.read_f;
identifier write_no_fpos.write_f;
@@
// write fops use offset
struct file_operations fops = {
...
 .write = write_f,
 .read = read_f,
...
+.llseek = noop_llseek, /* read and write both use no f_pos */
};

@ depends on has_write &amp;&amp; !has_read &amp;&amp; !fops1 &amp;&amp; !fops2 &amp;&amp; !has_llseek &amp;&amp; !nonseekable1 &amp;&amp; !nonseekable2 &amp;&amp; !seq @
identifier fops0.fops;
identifier write_no_fpos.write_f;
@@
struct file_operations fops = {
... .write = write_f, ...
+.llseek = noop_llseek, /* write uses no f_pos */
};

@ depends on has_read &amp;&amp; !has_write &amp;&amp; !fops1 &amp;&amp; !fops2 &amp;&amp; !has_llseek &amp;&amp; !nonseekable1 &amp;&amp; !nonseekable2 &amp;&amp; !seq @
identifier fops0.fops;
identifier read_no_fpos.read_f;
@@
struct file_operations fops = {
... .read = read_f, ...
+.llseek = noop_llseek, /* read uses no f_pos */
};

@ depends on !has_read &amp;&amp; !has_write &amp;&amp; !fops1 &amp;&amp; !fops2 &amp;&amp; !has_llseek &amp;&amp; !nonseekable1 &amp;&amp; !nonseekable2 &amp;&amp; !seq @
identifier fops0.fops;
@@
struct file_operations fops = {
...
+.llseek = noop_llseek, /* no read or write fn */
};
===== End semantic patch =====

Signed-off-by: Arnd Bergmann &lt;arnd@arndb.de&gt;
Cc: Julia Lawall &lt;julia@diku.dk&gt;
Cc: Christoph Hellwig &lt;hch@infradead.org&gt;
</content>
</entry>
<entry>
<title>isdn: autoconvert trivial BKL users to private mutex</title>
<updated>2010-07-13T03:21:47Z</updated>
<author>
<name>Arnd Bergmann</name>
</author>
<published>2010-07-11T11:18:53Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=76a64921dad9acd76270dc74249f0dfe11c84bb8'/>
<id>urn:sha1:76a64921dad9acd76270dc74249f0dfe11c84bb8</id>
<content type='text'>
All these files use the big kernel lock in a trivial
way to serialize their private file operations,
typically resulting from an earlier semi-automatic
pushdown from VFS.

None of these drivers appears to want to lock against
other code, and they all use the BKL as the top-level
lock in their file operations, meaning that there
is no lock-order inversion problem.

Consequently, we can remove the BKL completely,
replacing it with a per-file mutex in every case.
Using a scripted approach means we can avoid
typos.

file=$1
name=$2
if grep -q lock_kernel ${file} ; then
    if grep -q 'include.*linux.mutex.h' ${file} ; then
            sed -i '/include.*&lt;linux\/smp_lock.h&gt;/d' ${file}
    else
            sed -i 's/include.*&lt;linux\/smp_lock.h&gt;.*$/include &lt;linux\/mutex.h&gt;/g' ${file}
    fi
    sed -i ${file} \
        -e "/^#include.*linux.mutex.h/,$ {
                1,/^\(static\|int\|long\)/ {
                     /^\(static\|int\|long\)/istatic DEFINE_MUTEX(${name}_mutex);

} }"  \
    -e "s/\(un\)*lock_kernel\&gt;[ ]*()/mutex_\1lock(\&amp;${name}_mutex)/g" \
    -e '/[      ]*cycle_kernel_lock();/d'
else
    sed -i -e '/include.*\&lt;smp_lock.h\&gt;/d' ${file}  \
                -e '/cycle_kernel_lock()/d'
fi

Signed-off-by: Arnd Bergmann &lt;arnd@arndb.de&gt;
Cc: Karsten Keil &lt;isdn@linux-pingi.de&gt;
Cc: netdev@vger.kernel.org
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
</entry>
<entry>
<title>mISDN: remove unnecessary test on f_pos</title>
<updated>2010-05-27T16:12:56Z</updated>
<author>
<name>Jan Blunck</name>
</author>
<published>2010-05-26T21:44:46Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=b627dbce6b5524c7c9032738bb60538999f45d41'/>
<id>urn:sha1:b627dbce6b5524c7c9032738bb60538999f45d41</id>
<content type='text'>
This test is not doing anything since it is always false if the
mISDN_read() is called from vfs_read().  Besides that the driver uses
nonseekable_open() and is not using off or file-&gt;f_pos anywhere.

Signed-off-by: Jan Blunck &lt;jblunck@suse.de&gt;
Cc: Frederic Weisbecker &lt;fweisbec@gmail.com&gt;
Cc: Karsten Keil &lt;isdn@linux-pingi.de&gt;
Signed-off-by: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
</content>
</entry>
<entry>
<title>isdn: Push down BKL into ioctl functions</title>
<updated>2010-05-17T03:27:05Z</updated>
<author>
<name>Arnd Bergmann</name>
</author>
<published>2010-04-26T22:24:02Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=703c631ebbcadcfd861d01e697fdda7c388fec9a'/>
<id>urn:sha1:703c631ebbcadcfd861d01e697fdda7c388fec9a</id>
<content type='text'>
Push down bkl into isdn ioctl functions

[fweisbec: dropped drivers/isdn/divert/divert_procfs.c
as it has been pushed down in procfs branch already]

Signed-off-by: Arnd Bergmann &lt;arnd@arndb.de&gt;
Signed-off-by: Frederic Weisbecker &lt;fweisbec@gmail.com&gt;
</content>
</entry>
</feed>
