<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux/fs/open.c, branch v2.6.19</title>
<subtitle>Linux kernel source tree</subtitle>
<id>https://git.amat.us/linux/atom/fs/open.c?h=v2.6.19</id>
<link rel='self' href='https://git.amat.us/linux/atom/fs/open.c?h=v2.6.19'/>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/'/>
<updated>2006-10-01T07:39:30Z</updated>
<entry>
<title>[PATCH] r/o bind mounts: prepare for write access checks: collapse if()</title>
<updated>2006-10-01T07:39:30Z</updated>
<author>
<name>Dave Hansen</name>
<email>haveblue@us.ibm.com</email>
</author>
<published>2006-10-01T06:29:01Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=6902d925d568cd5bfda8a1a328bf08d26d1bab46'/>
<id>urn:sha1:6902d925d568cd5bfda8a1a328bf08d26d1bab46</id>
<content type='text'>
We're shortly going to be adding a bunch more permission checks in these
functions.  That requires adding either a bunch of new if() conditions, or
some gotos.  This patch collapses existing if()s and uses gotos instead to
prepare for the upcoming changes.

Signed-off-by: Dave Hansen &lt;haveblue@us.ibm.com&gt;
Acked-by: Christoph Hellwig &lt;hch@lst.de&gt;
Cc: Al Viro &lt;viro@zeniv.linux.org.uk&gt;
Signed-off-by: Andrew Morton &lt;akpm@osdl.org&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@osdl.org&gt;
</content>
</entry>
<entry>
<title>[PATCH] Create fs/utimes.c</title>
<updated>2006-10-01T07:39:19Z</updated>
<author>
<name>Alexey Dobriyan</name>
<email>adobriyan@gmail.com</email>
</author>
<published>2006-10-01T06:27:22Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=82b0547cfae1fb2ee26cad588f6d49a347d24740'/>
<id>urn:sha1:82b0547cfae1fb2ee26cad588f6d49a347d24740</id>
<content type='text'>
* fs/open.c is getting bit crowdy
* preparation to lutimes(2)

Signed-off-by: Alexey Dobriyan &lt;adobriyan@gmail.com&gt;
Signed-off-by: Andrew Morton &lt;akpm@osdl.org&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@osdl.org&gt;
</content>
</entry>
<entry>
<title>[PATCH] fix wrong error code on interrupted close syscalls</title>
<updated>2006-09-29T16:18:13Z</updated>
<author>
<name>Ernie Petrides</name>
<email>petrides@redhat.com</email>
</author>
<published>2006-09-29T09:00:13Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=ee731f4f7880b09ca147008ab46ad4e5f72cb8bf'/>
<id>urn:sha1:ee731f4f7880b09ca147008ab46ad4e5f72cb8bf</id>
<content type='text'>
The problem is that close() syscalls can call a file system's flush
handler, which in turn might sleep interruptibly and ultimately pass back
an -ERESTARTSYS return value.  This happens for files backed by an
interruptible NFS mount under nfs_file_flush() when a large file has just
been written and nfs_wait_bit_interruptible() detects that there is a
signal pending.

I have a test case where the "strace" command is used to attach to a
process sleeping in such a close().  Since the SIGSTOP is forced onto the
victim process (removing it from the thread's "blocked" mask in
force_sig_info()), the RPC wait is interrupted and the close() is
terminated early.

But the file table entry has already been cleared before the flush handler
was called.  Thus, when the syscall is restarted, the file descriptor
appears closed and an EBADF error is returned (which is wrong).  What's
worse, there is the hypothetical case where another thread of a
multi-threaded application might have reused the file descriptor, in which
case that file would be mistakenly closed.

The bottom line is that close() syscalls are not restartable, and thus
-ERESTARTSYS return values should be mapped to -EINTR.  This is consistent
with the close(2) manual page.  The fix is below.

Signed-off-by: Ernie Petrides &lt;petrides@redhat.com&gt;
Cc: Roland McGrath &lt;roland@redhat.com&gt;
Signed-off-by: Andrew Morton &lt;akpm@osdl.org&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@osdl.org&gt;
</content>
</entry>
<entry>
<title>[PATCH] vfs: define new lookup flag for chdir</title>
<updated>2006-09-29T16:18:08Z</updated>
<author>
<name>Miklos Szeredi</name>
<email>miklos@szeredi.hu</email>
</author>
<published>2006-09-29T08:59:35Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=650a898342b3fa21c392c06a2b7010fa19823efa'/>
<id>urn:sha1:650a898342b3fa21c392c06a2b7010fa19823efa</id>
<content type='text'>
In the "operation does permission checking" model used by fuse, chdir
permission is not checked, since there's no chdir method.

For this case set a lookup flag, which will be passed to -&gt;permission(), so
fuse can distinguish it from permission checks for other operations.

Signed-off-by: Miklos Szeredi &lt;miklos@szeredi.hu&gt;
Cc: Al Viro &lt;viro@zeniv.linux.org.uk&gt;
Signed-off-by: Andrew Morton &lt;akpm@osdl.org&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@osdl.org&gt;
</content>
</entry>
<entry>
<title>[PATCH] ftruncate does not always update m/ctime</title>
<updated>2006-06-25T17:01:15Z</updated>
<author>
<name>Peter Staubach</name>
<email>staubach@redhat.com</email>
</author>
<published>2006-06-25T12:48:36Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=6e656be899993f450a765056cdc8d87e58906508'/>
<id>urn:sha1:6e656be899993f450a765056cdc8d87e58906508</id>
<content type='text'>
In the course of trying to track down a bug where a file mtime was not
being updated correctly, it was discovered that the m/ctime updates were
not quite being handled correctly for ftruncate() calls.

Quoth SUSv3:

open(2):

        If O_TRUNC is set and the file did previously exist, upon
        successful completion, open() shall mark for update the st_ctime
        and st_mtime fields of the file.

truncate(2):

        Upon successful completion, if the file size is changed, this
        function shall mark for update the st_ctime and st_mtime fields
        of the file, and the S_ISUID and S_ISGID bits of the file mode
        may be cleared.

ftruncate(2):

        Upon successful completion, if fildes refers to a regular file,
        the ftruncate() function shall mark for update the st_ctime and
        st_mtime fields of the file and the S_ISUID and S_ISGID bits of
        the file mode may be cleared. If the ftruncate() function is
        unsuccessful, the file is unaffected.

The open(O_TRUNC) and truncate cases were being handled correctly, but the
ftruncate case was being handled like the truncate case.  The semantics of
truncate and ftruncate don't quite match, so ftruncate needs to be handled
slightly differently.

The attached patch addresses this issue for ftruncate(2).

My thanx to Stephen Tweedie and Trond Myklebust for their help in
understanding the situation and semantics.

Signed-off-by: Peter Staubach &lt;staubach@redhat.com&gt;
Cc: "Stephen C. Tweedie" &lt;sct@redhat.com&gt;
Cc: Trond Myklebust &lt;trond.myklebust@fys.uio.no&gt;
Cc: Al Viro &lt;viro@zeniv.linux.org.uk&gt;
Cc: Christoph Hellwig &lt;hch@lst.de&gt;
Signed-off-by: Andrew Morton &lt;akpm@osdl.org&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@osdl.org&gt;
</content>
</entry>
<entry>
<title>[PATCH] vfs: add lock owner argument to flush operation</title>
<updated>2006-06-23T14:43:02Z</updated>
<author>
<name>Miklos Szeredi</name>
<email>miklos@szeredi.hu</email>
</author>
<published>2006-06-23T09:05:12Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=75e1fcc0b18df0a65ab113198e9dc0e98999a08c'/>
<id>urn:sha1:75e1fcc0b18df0a65ab113198e9dc0e98999a08c</id>
<content type='text'>
Pass the POSIX lock owner ID to the flush operation.

This is useful for filesystems which don't want to store any locking state
in inode-&gt;i_flock but want to handle locking/unlocking POSIX locks
internally.  FUSE is one such filesystem but I think it possible that some
network filesystems would need this also.

Also add a flag to indicate that a POSIX locking request was generated by
close(), so filesystems using the above feature won't send an extra locking
request in this case.

Signed-off-by: Miklos Szeredi &lt;miklos@szeredi.hu&gt;
Cc: Trond Myklebust &lt;trond.myklebust@fys.uio.no&gt;
Cc: Al Viro &lt;viro@zeniv.linux.org.uk&gt;
Signed-off-by: Andrew Morton &lt;akpm@osdl.org&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@osdl.org&gt;
</content>
</entry>
<entry>
<title>[PATCH] VFS: Permit filesystem to perform statfs with a known root dentry</title>
<updated>2006-06-23T14:42:45Z</updated>
<author>
<name>David Howells</name>
<email>dhowells@redhat.com</email>
</author>
<published>2006-06-23T09:02:58Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=726c334223180e3c0197cc980a432681370d4baf'/>
<id>urn:sha1:726c334223180e3c0197cc980a432681370d4baf</id>
<content type='text'>
Give the statfs superblock operation a dentry pointer rather than a superblock
pointer.

This complements the get_sb() patch.  That reduced the significance of
sb-&gt;s_root, allowing NFS to place a fake root there.  However, NFS does
require a dentry to use as a target for the statfs operation.  This permits
the root in the vfsmount to be used instead.

linux/mount.h has been added where necessary to make allyesconfig build
successfully.

Interest has also been expressed for use with the FUSE and XFS filesystems.

Signed-off-by: David Howells &lt;dhowells@redhat.com&gt;
Acked-by: Al Viro &lt;viro@zeniv.linux.org.uk&gt;
Cc: Nathan Scott &lt;nathans@sgi.com&gt;
Signed-off-by: Andrew Morton &lt;akpm@osdl.org&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@osdl.org&gt;
</content>
</entry>
<entry>
<title>[PATCH] log more info for directory entry change events</title>
<updated>2006-06-20T09:25:28Z</updated>
<author>
<name>Amy Griffis</name>
<email>amy.griffis@hp.com</email>
</author>
<published>2006-06-09T03:19:31Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=9c937dcc71021f2dbf78f904f03d962dd9bcc130'/>
<id>urn:sha1:9c937dcc71021f2dbf78f904f03d962dd9bcc130</id>
<content type='text'>
When an audit event involves changes to a directory entry, include
a PATH record for the directory itself.  A few other notable changes:

    - fixed audit_inode_child() hooks in fsnotify_move()
    - removed unused flags arg from audit_inode()
    - added audit log routines for logging a portion of a string

Here's some sample output.

before patch:
type=SYSCALL msg=audit(1149821605.320:26): arch=40000003 syscall=39 success=yes exit=0 a0=bf8d3c7c a1=1ff a2=804e1b8 a3=bf8d3c7c items=1 ppid=739 pid=800 auid=0 uid=0 gid=0 euid=0 suid=0 fsuid=0 egid=0 sgid=0 fsgid=0 tty=ttyS0 comm="mkdir" exe="/bin/mkdir" subj=root:system_r:unconfined_t:s0-s0:c0.c255
type=CWD msg=audit(1149821605.320:26):  cwd="/root"
type=PATH msg=audit(1149821605.320:26): item=0 name="foo" parent=164068 inode=164010 dev=03:00 mode=040755 ouid=0 ogid=0 rdev=00:00 obj=root:object_r:user_home_t:s0

after patch:
type=SYSCALL msg=audit(1149822032.332:24): arch=40000003 syscall=39 success=yes exit=0 a0=bfdd9c7c a1=1ff a2=804e1b8 a3=bfdd9c7c items=2 ppid=714 pid=777 auid=0 uid=0 gid=0 euid=0 suid=0 fsuid=0 egid=0 sgid=0 fsgid=0 tty=ttyS0 comm="mkdir" exe="/bin/mkdir" subj=root:system_r:unconfined_t:s0-s0:c0.c255
type=CWD msg=audit(1149822032.332:24):  cwd="/root"
type=PATH msg=audit(1149822032.332:24): item=0 name="/root" inode=164068 dev=03:00 mode=040750 ouid=0 ogid=0 rdev=00:00 obj=root:object_r:user_home_dir_t:s0
type=PATH msg=audit(1149822032.332:24): item=1 name="foo" inode=164010 dev=03:00 mode=040755 ouid=0 ogid=0 rdev=00:00 obj=root:object_r:user_home_t:s0

Signed-off-by: Amy Griffis &lt;amy.griffis@hp.com&gt;
Signed-off-by: Al Viro &lt;viro@zeniv.linux.org.uk&gt;
</content>
</entry>
<entry>
<title>[PATCH] fs/open.c: unexport sys_openat</title>
<updated>2006-05-15T18:20:54Z</updated>
<author>
<name>Adrian Bunk</name>
<email>bunk@stusta.de</email>
</author>
<published>2006-05-15T16:43:50Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=6aff5cb8ec270db569800b1bb59bd20003a76f07'/>
<id>urn:sha1:6aff5cb8ec270db569800b1bb59bd20003a76f07</id>
<content type='text'>
Remove the unused EXPORT_SYMBOL_GPL(sys_openat).

Signed-off-by: Adrian Bunk &lt;bunk@stusta.de&gt;
Signed-off-by: Andrew Morton &lt;akpm@osdl.org&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@osdl.org&gt;
</content>
</entry>
<entry>
<title>x86: be careful about tailcall breakage for sys_open[at] too</title>
<updated>2006-04-18T20:22:59Z</updated>
<author>
<name>Linus Torvalds</name>
<email>torvalds@g5.osdl.org</email>
</author>
<published>2006-04-18T20:22:59Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=385910f2b275a636238f70844f1b6da9fda6f2da'/>
<id>urn:sha1:385910f2b275a636238f70844f1b6da9fda6f2da</id>
<content type='text'>
Came up through a quick grep for other cases similar to the ftruncate()
one in commit 0a489cb3b6a7b277030cdbc97c2c65905db94536.

Also, add a comment, so that people who read the code understand why we
do what looks like a no-op.

(Again, this won't actually matter to any sane user, since libc will
save and restore the register gcc stomps on, but it's still wrong to
stomp on it)

Signed-off-by: Linus Torvalds &lt;torvalds@osdl.org&gt;
</content>
</entry>
</feed>
