25 May, 2010
3 commits
-
mapping_gfp_mask() is not supposed to store allocation contex details,
only page location details. So mapping_gfp_mask should be applied to the
pagecache page allocation, wheras normal (kernel mapped) memory should be
used for surrounding allocations such as radix-tree nodes allocated by
add_to_page_cache. Context modifiers should be applied on a per-callsite
basis.So change splice to follow this convention (which is followed in similar
code patterns in core code).Signed-off-by: Nick Piggin
Signed-off-by: Andrew Morton
Signed-off-by: Jens Axboe -
Instead of requiring an exact number of pages as the argument and
return value, change the API to deal with number of bytes instead.This also relaxes the requirement that the passed in size must
result in a power-of-2 page array size. Round up to the nearest
power-of-2 automatically and return the resulting size of the pipe
on success.Signed-off-by: Jens Axboe
-
If the passed in size is larger than what has been set as the
system wide limit and the user is not root, we want to return
permission denied (not invalid value).Signed-off-by: Jens Axboe
22 May, 2010
37 commits
-
* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs-2.6: (69 commits)
fix handling of offsets in cris eeprom.c, get rid of fake on-stack files
get rid of home-grown mutex in cris eeprom.c
switch ecryptfs_write() to struct inode *, kill on-stack fake files
switch ecryptfs_get_locked_page() to struct inode *
simplify access to ecryptfs inodes in ->readpage() and friends
AFS: Don't put struct file on the stack
Ban ecryptfs over ecryptfs
logfs: replace inode uid,gid,mode initialization with helper function
ufs: replace inode uid,gid,mode initialization with helper function
udf: replace inode uid,gid,mode init with helper
ubifs: replace inode uid,gid,mode initialization with helper function
sysv: replace inode uid,gid,mode initialization with helper function
reiserfs: replace inode uid,gid,mode initialization with helper function
ramfs: replace inode uid,gid,mode initialization with helper function
omfs: replace inode uid,gid,mode initialization with helper function
bfs: replace inode uid,gid,mode initialization with helper function
ocfs2: replace inode uid,gid,mode initialization with helper function
nilfs2: replace inode uid,gid,mode initialization with helper function
minix: replace inode uid,gid,mode init with helper
ext4: replace inode uid,gid,mode init with helper
...Trivial conflict in fs/fs-writeback.c (mark bitfields unsigned)
-
Signed-off-by: Al Viro
-
Signed-off-by: Al Viro
-
we can get to them from page->mapping->host, no need to mess with
file.Signed-off-by: Al Viro
-
Don't put struct file on the stack as it takes up quite a lot of space
and violates lifetime rules for struct file.Rather than calling afs_readpage() indirectly from the directory routines by
way of read_mapping_page(), split afs_readpage() to have afs_page_filler()
that's given a key instead of a file and call read_cache_page(), specifying the
new function directly. Use it in afs_readpages() as well.Also make use of this in afs_mntpt_check_symlink() too for the same reason.
Reported-by: Al Viro
Signed-off-by: Al Viro
Signed-off-by: David Howells -
This is a seriously simplified patch from Eric Sandeen; copy of
rationale follows:
===
mounting stacked ecryptfs on ecryptfs has been shown to lead to bugs
in testing. For crypto info in xattr, there is no mechanism for handling
this at all, and for normal file headers, we run into other trouble:BUG: unable to handle kernel NULL pointer dereference at 0000000000000008
IP: [] ecryptfs_d_revalidate+0x43/0xa0 [ecryptfs]
...There doesn't seem to be any good usecase for this, so I'd suggest just
disallowing the configuration.Based on a patch originally, I believe, from Mike Halcrow.
===Signed-off-by: Al Viro
-
Signed-off-by: Al Viro
-
Signed-off-by: Dmitry Monakhov
Signed-off-by: Al Viro -
Acked-by: Jan Kara
Signed-off-by: Dmitry Monakhov
Signed-off-by: Al Viro -
Acked-by: Artem Bityutskiy
Signed-off-by: Dmitry Monakhov
Signed-off-by: Al Viro -
Signed-off-by: Dmitry Monakhov
Signed-off-by: Al Viro -
Signed-off-by: Dmitry Monakhov
Signed-off-by: Al Viro -
- seems what ramfs_get_inode is only locally, make it static.
[AV: the hell it is; it's used by shmem, so shmem needed conversion too
and no, that function can't be made static]Signed-off-by: Dmitry Monakhov
Signed-off-by: Al Viro -
Signed-off-by: Dmitry Monakhov
Signed-off-by: Al Viro -
Signed-off-by: Dmitry Monakhov
Signed-off-by: Al Viro -
Acked-by: Joel Becker
Signed-off-by: Dmitry Monakhov
Signed-off-by: Al Viro -
Acked-by: Ryusuke Konishi
Signed-off-by: Dmitry Monakhov
Signed-off-by: Al Viro -
- also redesign minix_new_inode interface
Signed-off-by: Dmitry Monakhov
Signed-off-by: Al Viro -
Signed-off-by: Dmitry Monakhov
Signed-off-by: Al Viro -
Acked-by: Jan Kara
Signed-off-by: Dmitry Monakhov
Signed-off-by: Al Viro -
Acked-by: Jan Kara
Signed-off-by: Dmitry Monakhov
Signed-off-by: Al Viro -
Ack-by: Boaz Harrosh
Signed-off-by: Dmitry Monakhov
Signed-off-by: Al Viro -
Signed-off-by: Dmitry Monakhov
Signed-off-by: Al Viro -
Acked-by: Dave Kleikamp
Signed-off-by: Dmitry Monakhov
Signed-off-by: Al Viro -
Signed-off-by: Dmitry Monakhov
Signed-off-by: Al Viro -
Signed-off-by: Dmitry Monakhov
Signed-off-by: Al Viro -
This fixes sparse noise:
error: dubious one-bit signed bitfieldSigned-off-by: H Hartley Sweeten
Cc: Alexander Viro
Signed-off-by: Al Viro -
update the mnt of the path when it is not equal to the new one.
Signed-off-by: Huang Shijie
Signed-off-by: Al Viro -
> =============================================
> [ INFO: possible recursive locking detected ]
> 2.6.31-2-generic #14~rbd3
> ---------------------------------------------
> firefox-3.5/4162 is trying to acquire lock:
> (&s->s_vfs_rename_mutex){+.+.+.}, at: [] lock_rename+0x41/0xf0
>
> but task is already holding lock:
> (&s->s_vfs_rename_mutex){+.+.+.}, at: [] lock_rename+0x41/0xf0
>
> other info that might help us debug this:
> 3 locks held by firefox-3.5/4162:
> #0: (&s->s_vfs_rename_mutex){+.+.+.}, at: [] lock_rename+0x41/0xf0
> #1: (&sb->s_type->i_mutex_key#11/1){+.+.+.}, at: [] lock_rename+0x6a/0xf0
> #2: (&sb->s_type->i_mutex_key#11/2){+.+.+.}, at: [] lock_rename+0x7f/0xf0
>
> stack backtrace:
> Pid: 4162, comm: firefox-3.5 Tainted: G C 2.6.31-2-generic #14~rbd3
> Call Trace:
> [] print_deadlock_bug+0xf4/0x100
> [] validate_chain+0x4c6/0x750
> [] __lock_acquire+0x237/0x430
> [] lock_acquire+0xa5/0x150
> [] ? lock_rename+0x41/0xf0
> [] __mutex_lock_common+0x4d/0x3d0
> [] ? lock_rename+0x41/0xf0
> [] ? lock_rename+0x41/0xf0
> [] ? ecryptfs_rename+0x99/0x170
> [] mutex_lock_nested+0x46/0x60
> [] lock_rename+0x41/0xf0
> [] ecryptfs_rename+0xca/0x170
> [] vfs_rename_dir+0x13e/0x160
> [] vfs_rename+0xee/0x290
> [] ? __lookup_hash+0x102/0x160
> [] sys_renameat+0x252/0x280
> [] ? cp_new_stat+0xe4/0x100
> [] ? sysret_check+0x2e/0x69
> [] ? trace_hardirqs_on_caller+0x14d/0x190
> [] sys_rename+0x1b/0x20
> [] system_call_fastpath+0x16/0x1bThe trace above is totally reproducible by doing a cross-directory
rename on an ecryptfs directory.The issue seems to be that sys_renameat() does lock_rename() then calls
into the filesystem; if the filesystem is ecryptfs, then
ecryptfs_rename() again does lock_rename() on the lower filesystem, and
lockdep can't tell that the two s_vfs_rename_mutexes are different. It
seems an annotation like the following is sufficient to fix this (it
does get rid of the lockdep trace in my simple tests); however I would
like to make sure I'm not misunderstanding the locking, hence the CC
list...Signed-off-by: Roland Dreier
Cc: Tyler Hicks
Cc: Dustin Kirkland
Cc: Al Viro
Signed-off-by: Andrew Morton
Signed-off-by: Al Viro -
ADDPART_FLAG_RAID was introduced in commit d18d768, and most places were
converted to use it instead of a hardcoded value. However, some places seem
to have been missed.Change all of them to the symbolic names via the following semantic patch:
@@
struct parsed_partitions *state;
expression E;
@@
(
- state->parts[E].flags = 1
+ state->parts[E].flags = ADDPART_FLAG_RAID
|
- state->parts[E].flags |= 1
+ state->parts[E].flags |= ADDPART_FLAG_RAID
|
- state->parts[E].flags = 2
+ state->parts[E].flags = ADDPART_FLAG_WHOLEDISK
|
- state->parts[E].flags |= 2
+ state->parts[E].flags |= ADDPART_FLAG_WHOLEDISK
)Signed-off-by: Cesar Eduardo Barros
Signed-off-by: Al Viro -
Now that the last user passing a NULL file pointer is gone we can remove
the redundant dentry argument and associated hacks inside vfs_fsynmc_range.The next step will be removig the dentry argument from ->fsync, but given
the luck with the last round of method prototype changes I'd rather
defer this until after the main merge window.Signed-off-by: Christoph Hellwig
Signed-off-by: Al Viro -
Instead of just looking up a path use do_filp_open to get us a file
structure for the nfs4 recovery directory. This allows us to get
rid of the last non-standard vfs_fsync caller with a NULL file
pointer.[AV: should be using fput(), not filp_close()]
Signed-off-by: Christoph Hellwig
Signed-off-by: Al Viro -
Using atomic_inc_return in __iget(struct inode *inode) makes the intent
of this code clearer and generates less code on processors that have
this operation.On x86_64 this patch reduces the text size of inode.o by 12 bytes.
Signed-off-by: Richard Kennedy
----
patch against 2.6.34-rc7
compiled & tested on x86_64 AMD X2I've been running with this patch applied for several weeks with no
obvious problems.
regards
Richard
Signed-off-by: Al Viro -
anon_inode_mkinode() sets inode->i_mode = S_IRUSR | S_IWUSR; This means
that (inode->i_mode & S_IFMT) == 0. This trips up some SELinux code that
needs to determine if a given inode is a regular file, a directory, etc.
The easiest solution is to just make sure that the anon_inode also sets
S_IFREG.Signed-off-by: Eric Paris
Signed-off-by: Al Viro -
Signed-off-by: Stephen Hemminger
Signed-off-by: Al Viro -
Signed-off-by: Stephen Hemminger
Signed-off-by: Al Viro -
Signed-off-by: Stephen Hemminger
Signed-off-by: Al Viro