Commit graph android_kernel_sony_sdm845/fs
Message SHA1
[PATCH] aio syscalls are not checked by lsm
Another case of missing call to security_file_permission: aio functions
(namely, io_submit) does not check credentials with security modules.

Below is the simple patch to the problem.  It seems that it is enough to
check for rights at the request submission time.

Signed-off-by: Kostik Belousov <kostikbel@gmail.com>
Signed-off-by: Chris Wright <chrisw@osdl.org>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>

Kostik Belousov   authored and   Linus Torvalds   commited 2005-10-23 16:38:38 -07:00
8766ce4101
Merge changes from linux-2.6 by hand
Paul Mackerras   commited 2005-10-22 16:51:34 +10:00
985990137e
Merge with /pub/scm/linux/kernel/git/sfrench/cifs-2.6.git/
Steve French   commited 2005-10-21 08:39:12 -07:00
d6d3f5bc68
NFSv4: Fix up locking for nfs4_state_owner
Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>

Trond Myklebust   commited 2005-10-20 14:22:47 -07:00
ec07342828
NFSv4: Final tweak to sequence id
Sacrifice queueing fairness for performance.

 Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>

Trond Myklebust   commited 2005-10-20 14:22:41 -07:00
4e51336a00
[CIFS] Defer close of file handle slightly if there are pending writes that
need to get in ahead of it that depend on that file handle. Fixes
occassional bad file handle errors on write with heavy use multiple process
cases.

Signed-off-by: Steve French <sfrench@us.ibm.com>

Steve French   commited 2005-10-20 13:44:56 -07:00
23e7dd7d95
NTFS: Fix serious data corruption issue when writing.
Many thanks to Alberto Patino for testing and reporting the data
      corruption.  And many apologies for corrupting his partition.

Signed-off-by: Anton Altaparmakov <aia21@cantab.net>

Anton Altaparmakov   commited 2005-10-19 12:23:10 +01:00
d5aeaef37d
NTFS: $EA attributes can be both resident non-resident.
Minor tidying.

Signed-off-by: Anton Altaparmakov <aia21@cantab.net>

Anton Altaparmakov   commited 2005-10-19 12:21:19 +01:00
7d0ffdb279
Merge branch 'master' of /usr/src/ntfs-2.6/
Anton Altaparmakov   commited 2005-10-19 12:13:58 +01:00
e087a412b4
NFSv4: Fix acl buffer size
resp_len is passed in as buffer size to decode routine; make sure it's
 set right in case where userspace provides less than a page's worth of
 buffer.

 Signed-off-by: J. Bruce Fields <bfields@citi.umich.edu>
 Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>

J. Bruce Fields   authored and   Trond Myklebust   commited 2005-10-18 23:19:41 -07:00
1d95db8e16
NFSv4: handle no acl attr
Stop handing garbage to userspace in the case where a weird server clears the
 acl bit in the getattr return (despite the fact that they've already claimed
 acl support.)

 Signed-off-by: J. Bruce Fields <bfields@citi.umich.edu>
 Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>

J. Bruce Fields   authored and   Trond Myklebust   commited 2005-10-18 23:19:41 -07:00
8c233cf9c2
NFSv4: Fix an oopsable condition in nfs_free_seqid
Storing a pointer to the struct rpc_task in the nfs_seqid is broken
 since the nfs_seqid may be freed well after the task has been destroyed.

 Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>

Trond Myklebust   commited 2005-10-18 23:19:39 -07:00
7f709a48fa
NFS: Fix rename of directory onto empty directory
If someone tries to rename a directory onto an empty directory, we
 currently fail and return EBUSY.
 This patch ensures that we try the rename if both source and target
 are directories, and that we fail with a correct error of EISDIR if
 the source is not a directory.

 Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>

Trond Myklebust   commited 2005-10-18 14:20:22 -07:00
6fe43f9e37
Fix Connectathon locking test failure
We currently fail Connectathon test 6.10 in the case of 32-bit locks due
 to incorrect error checking.
 Also add support for l->l_len < 0 to 64-bit locks.

 Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>

Trond Myklebust   commited 2005-10-18 14:20:21 -07:00
4c780a4688
NFSv4: Ensure that we recover from the OPEN + OPEN_CONFIRM BAD_STATEID race
If the server is in the unconfirmed OPEN state for a given open owner
 and receives a second OPEN for the same open owner, it will cancel the
 state of the first request and set up an OPEN_CONFIRM for the second.

 This can cause a race that is discussed in rfc3530 on page 181.

 The following patch allows the client to recover by retrying the
 original open request.

 Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>

Trond Myklebust   commited 2005-10-18 14:20:21 -07:00
550f57470c
NFSv4: If a delegated open fails, ensure that we return the delegation
Unless of course the open fails due to permission issues.

 Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>

Trond Myklebust   commited 2005-10-18 14:20:20 -07:00
b8e5c4c297
NFSv4: Return delegations in case we're changing ACLs
Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>

Trond Myklebust   commited 2005-10-18 14:20:19 -07:00
642ac54923
NFSv4: Return delegation upon rename or removal of file.
Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>

Trond Myklebust   commited 2005-10-18 14:20:19 -07:00
cae7a073a4
VFS: Make link_path_walk set LOOKUP_CONTINUE before calling permission().
This will allow nfs_permission() to perform additional optimizations when
 walking the path, by folding the ACCESS(MAY_EXEC) call on the directory
 into the lookup revalidation.

 Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>

Trond Myklebust   commited 2005-10-18 14:20:18 -07:00
cdce5d6b94
[NFS]: Check that the server returns a valid regular file to our OPEN request
Since it appears that some servers don't...

 Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>

Trond Myklebust   commited 2005-10-18 14:20:18 -07:00
6f926b5ba7
NFSv4: Eliminate nfsv4 open race...
Make NFSv4 return the fully initialized file pointer with the
 stateid that it created in the lookup w/intent.

 Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>

Trond Myklebust   commited 2005-10-18 14:20:17 -07:00
02a913a73b
VFS: Allow the filesystem to return a full file pointer on open intent
This is needed by NFSv4 for atomicity reasons: our open command is in
 fact a lookup+open, so we need to be able to propagate open context
 information from lookup() into the resulting struct file's
 private_data field.

 Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>

Trond Myklebust   commited 2005-10-18 14:20:16 -07:00
834f2a4a15
NFS: Fix up a race in the NFS implementation of GETLK
...and fix a memory corruption bug due to improper use of memcpy() on
 a struct file_lock.

 Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>

Trond Myklebust   commited 2005-10-18 14:20:16 -07:00
039c4d7a82
NFSv4: Fix up handling of open_to_lock sequence ids
Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>

Trond Myklebust   commited 2005-10-18 14:20:15 -07:00
06735b3454
NFSv4: Make NFS clean up byte range locks asynchronously
Currently we fail to do so if the process was signalled.

 Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>

Trond Myklebust   commited 2005-10-18 14:20:15 -07:00
faf5f49c2d
NFSv4: Add missing handling of OPEN_CONFIRM requests on CLAIM_DELEGATE_CUR.
Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>

Trond Myklebust   commited 2005-10-18 14:20:14 -07:00
0a8838f972
NFSv4: Remove nfs4_client->cl_sem from close() path
We no longer need to worry about collisions between close() and the state
 recovery code, since the new close will automatically recheck the
 file state once it is done waiting on its sequence slot.

 Ditto for the nfs4_proc_locku() procedure.

 Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>

Trond Myklebust   commited 2005-10-18 14:20:13 -07:00
83c9d41e45
NFSv4: Remove obsolete state_owner and lock_owner semaphores
OPEN, CLOSE, etc no longer need these semaphores to ensure ordering of
 requests.

 Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>

Trond Myklebust   commited 2005-10-18 14:20:13 -07:00
e6dfa553cf
NFSv4: Fix a potential CLOSE race
Once the state_owner and lock_owner semaphores get removed, it will be
 possible for other OPEN requests to reopen the same file if they have
 lower sequence ids than our CLOSE call.
 This patch ensures that we recheck the file state once
 nfs_wait_on_sequence() has completed waiting.

 Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>

Trond Myklebust   commited 2005-10-18 14:20:12 -07:00
9512135df1
NFSv4: Add functions to order RPC calls
NFSv4 file state-changing functions such as OPEN, CLOSE, LOCK,... are all
 labelled with "sequence identifiers" in order to prevent the server from
 reordering RPC requests, as this could cause its file state to
 become out of sync with the client.

 Currently the NFS client code enforces this ordering locally using
 semaphores to restrict access to structures until the RPC call is done.
 This, of course, only works with synchronous RPC calls, since the
 user process must first grab the semaphore.
 By dropping semaphores, and instead teaching the RPC engine to hold
 the RPC calls until they are ready to be sent, we can extend this
 process to work nicely with asynchronous RPC calls too.

 This patch adds a new list called "rpc_sequence" that defines the order
 of the RPC calls to be sent. We add one such list for each state_owner.
 When an RPC call is ready to be sent, it checks if it is top of the
 rpc_sequence list. If so, it proceeds. If not, it goes back to sleep,
 and loops until it hits top of the list.
 Once the RPC call has completed, it can then bump the sequence id counter,
 and remove itself from the rpc_sequence list, and then wake up the next
 sleeper.

 Note that the state_owner sequence ids and lock_owner sequence ids are
 all indexed to the same rpc_sequence list, so OPEN, LOCK,... requests
 are all ordered w.r.t. each other.

 Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>

Trond Myklebust   commited 2005-10-18 14:20:12 -07:00
cee54fc944
Merge /home/trondmy/scm/kernel/git/torvalds/linux-2.6
Trond Myklebust   commited 2005-10-18 13:50:52 -07:00
cff6bf9709
[PATCH] aio: revert lock_kiocb()
lock_kiocb() was introduced to serialize retrying and cancellation.  In the
process of doing so it tried to sleep waiting for KIF_LOCKED while holding
the ctx_lock spinlock.  Recent fixes have ensured that multiple concurrent
retries won't be attempted for a given iocb.  Cancel has other problems and
has no significant in-tree users that have been complaining about it.  So
for the immediate future we'll revert sleeping with the lock held and will
address proper cancellation and retry serialization in the future.

Signed-off-by: Zach Brown <zach.brown@oracle.com>
Acked-by: Benjamin LaHaise <bcrl@kvack.org>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>

Zach Brown   authored and   Linus Torvalds   commited 2005-10-17 17:03:57 -07:00
4faa528528
[PATCH] output of /proc/maps on nommu systems is incomplete
Currently you do not get all the map entries on nommu systems because the
start function doesn't index into the list using the value of "pos".

Signed-off-by: David McCullough <davidm@snapgear.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>

David McCullough   authored and   Linus Torvalds   commited 2005-10-17 17:03:57 -07:00
b65574fec5
[PATCH] NFS: Fix Oopsable/unnecessary i_count manipulations in nfs_wait_on_inode()
Oopsable since nfs_wait_on_inode() can get called as part of iput_final().

Unnecessary since the caller had better be damned sure that the inode won't
disappear from underneath it anyway.

Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>

Trond Myklebust   authored and   Linus Torvalds   commited 2005-10-17 14:47:16 -07:00
6ce969171d
[PATCH] NFS: Fix cache consistency races
If the data cache has been marked as potentially invalid by nfs_refresh_inode,
we should invalidate it rather than assume that changes are due to our own
activity.

Also ensure that we always start with a valid cache before declaring it
to be protected by a delegation.

Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>

Trond Myklebust   authored and   Linus Torvalds   commited 2005-10-17 14:47:16 -07:00
b3c52da33c
Merge branch 'master' of /usr/src/ntfs-2.6/
Anton Altaparmakov   commited 2005-10-17 15:00:34 +01:00
7946ada30b
[PATCH] nommu build error fix
"proc_smaps_operations" is not defined in case of "CONFIG_MMU=n".

Signed-off-by: Yoshinori Sato <ysato@users.sourceforge.jp>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>

Yoshinori Sato   authored and   Linus Torvalds   commited 2005-10-14 17:10:13 -07:00
63c6764ce4
CIFS: cifs_writepages should not write beyond end of file
Signed-off-by: Dave Kleikamp <shaggy@austin.ibm.com>
Signed-off-by: Steve French <sfrench@us.ibm.com>

Steve French   commited 2005-10-12 15:32:05 -07:00
84d2f07e8e
Merge from Linus' tree
Paul Mackerras   commited 2005-10-12 14:43:32 +10:00
b6ec995a21
[CIFS] Add null malloc response check in notify experimental code
Signed-off-by: Steve French (sfrench@us.ibm.com)

Steve French   commited 2005-10-11 20:03:18 -07:00
47c786e79b
[CIFS] CIFS Stats improvements
New cifs_writepages routine was not updated bytes written in cifs stats.
Also added ability to clear /proc/fs/cifs/Stats by writing (0 or 1) to it.
Signed-off-by: Steve French <sfrench@us.ibm.com>

Steve French   commited 2005-10-11 19:58:06 -07:00
1047abc159
[PATCH] binfmt_elf bss padding fix
Nir Tzachar <tzachar@cs.bgu.ac.il> points out that if an ELF file specifies a
zero-length bss at a whacky address, we cannot load that binary because
padzero() tries to zero out the end of the page at the whacky address, and
that may not be writeable.

See also http://bugzilla.kernel.org/show_bug.cgi?id=5411

So teach load_elf_binary() to skip the bss settng altogether if the elf file
has a zero-length bss segment.

Cc: Roland McGrath <roland@redhat.com>
Cc: Daniel Jacobowitz <dan@debian.org>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>

akpm@osdl.org   authored and   Linus Torvalds   commited 2005-10-11 09:46:54 -07:00
6de505173e
[PATCH] nfsacl: Solaris VxFS compatibility fix
Here is a compatibility fix between Linux and Solaris when used with VxFS
filesystems: Solaris usually accepts acl entries in any order, but with
VxFS it replies with NFSERR_INVAL when it sees a four-entry acl that is not
in canonical form.  It may also fail with other non-canonical acls -- I
can't tell, because that case never triggers: We only send non-canonical
acls when we fake up an ACL_MASK entry.

Instead of adding fake ACL_MASK entries at the end, inserting them in the
correct position makes Solaris+VxFS happy.  The Linux client and server
sides don't care about entry order.  The three-entry-acl special case in
which we need a fake ACL_MASK entry was handled in xdr_nfsace_encode.  The
patch moves this into nfsacl_encode.

Signed-off-by: Andreas Gruenbacher <agruen@suse.de>
Acked-by: Trond Myklebust <trond.myklebust@fys.uio.no>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>

Andreas Gruenbacher   authored and   Linus Torvalds   commited 2005-10-11 09:46:54 -07:00
22c1ea44f0
[PATCH] v9fs: remove additional buffer allocation from v9fs_file_read and v9fs_file_write
v9fs_file_read and v9fs_file_write use kmalloc to allocate buffers as big
as the data buffer received as parameter.  kmalloc cannot be used to
allocate buffers bigger than 128K, so reading/writing data in chunks bigger
than 128k fails.

This patch reorganizes v9fs_file_read and v9fs_file_write to allocate only
buffers as big as the maximum data that can be sent in one 9P message.

Signed-off-by: Latchesar Ionkov <lucho@ionkov.net>
Cc: Eric Van Hensbergen <ericvh@gmail.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>

Latchesar Ionkov   authored and   Linus Torvalds   commited 2005-10-11 09:46:54 -07:00
19cba8abd6
NTFS: The big ntfs write(2) rewrite has arrived. We now implement our own
file operations ->write(), ->aio_write(), and ->writev() for regular
      files.  This replaces the old use of generic_file_write(), et al and
      the address space operations ->prepare_write and ->commit_write.
      This means that both sparse and non-sparse (unencrypted and
      uncompressed) files can now be extended using the normal write(2)
      code path.  There are two limitations at present and these are that
      we never create sparse files and that we only have limited support
      for highly fragmented files, i.e. ones whose data attribute is split
      across multiple extents.   When such a case is encountered,
      EOPNOTSUPP is returned.

Signed-off-by: Anton Altaparmakov <aia21@cantab.net>

Anton Altaparmakov   commited 2005-10-11 15:40:40 +01:00
98b270362b
JFS: Corrupted block map should not cause trap
Replace assert statements with better error handling.

Signed-off-by: Dave Kleikamp <shaggy@austin.ibm.com>

Dave Kleikamp   commited 2005-10-11 09:06:59 -05:00
b6a47fd8ff
NTFS: Remove address space operations ->prepare_write and ->commit_write in
preparation for the big rewrite of write(2) support in ntfs.

Signed-off-by: Anton Altaparmakov <aia21@cantab.net>

Anton Altaparmakov   commited 2005-10-11 14:59:40 +01:00
29f5f3c141
NTFS: In attrib.c::ntfs_attr_set() call balance_dirty_pages_ratelimited()
and cond_resched() in the main loop as we could be dirtying a lot of
      pages and this ensures we play nice with the VM and the system as a
      whole.

Signed-off-by: Anton Altaparmakov <aia21@cantab.net>

Anton Altaparmakov   commited 2005-10-11 14:54:42 +01:00
29b8990513
Merge branch 'master' of /usr/src/ntfs-2.6/
Anton Altaparmakov   commited 2005-10-11 09:29:48 +01:00
29d8699ebb
[CIFS] Fix oops in experimental notify code (when CONFIG_CIFS_EXPERIMENTAL
was turned on).

Signed-off-by: Steve French <sfrench@us.ibm.com>

Steve French   commited 2005-10-10 19:52:13 -07:00
4ca9c190d9