diff options
author | 2016-05-18 11:51:59 -0700 | |
---|---|---|
committer | 2016-05-18 11:51:59 -0700 | |
commit | 9e17632c0a146891c90a4353a160cfcf71f34b8f (patch) | |
tree | 9ab52130a11cdc9cac5f4727b773badf1279555f /fs/coredump.c | |
parent | Merge branch 'work.iov_iter' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs (diff) | |
parent | coredump: only charge written data against RLIMIT_CORE (diff) | |
download | wireguard-linux-9e17632c0a146891c90a4353a160cfcf71f34b8f.tar.xz wireguard-linux-9e17632c0a146891c90a4353a160cfcf71f34b8f.zip |
Merge branch 'work.misc' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs
Pull misc vfs cleanups from Al Viro:
"Assorted cleanups and fixes all over the place"
* 'work.misc' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs:
coredump: only charge written data against RLIMIT_CORE
coredump: get rid of coredump_params->written
ecryptfs_lookup(): try either only encrypted or plaintext name
ecryptfs: avoid multiple aliases for directories
bpf: reject invalid names right in ->lookup()
__d_alloc(): treat NULL name as QSTR("/", 1)
mtd: switch ubi_open_volume_path() to vfs_stat()
mtd: switch open_mtd_by_chdev() to use of vfs_stat()
Diffstat (limited to 'fs/coredump.c')
-rw-r--r-- | fs/coredump.c | 5 |
1 files changed, 1 insertions, 4 deletions
diff --git a/fs/coredump.c b/fs/coredump.c index 47c32c3bfa1d..492c2db25dc9 100644 --- a/fs/coredump.c +++ b/fs/coredump.c @@ -803,12 +803,9 @@ int dump_skip(struct coredump_params *cprm, size_t nr) static char zeroes[PAGE_SIZE]; struct file *file = cprm->file; if (file->f_op->llseek && file->f_op->llseek != no_llseek) { - if (cprm->written + nr > cprm->limit) - return 0; if (dump_interrupted() || file->f_op->llseek(file, nr, SEEK_CUR) < 0) return 0; - cprm->written += nr; return 1; } else { while (nr > PAGE_SIZE) { @@ -823,7 +820,7 @@ EXPORT_SYMBOL(dump_skip); int dump_align(struct coredump_params *cprm, int align) { - unsigned mod = cprm->written & (align - 1); + unsigned mod = cprm->file->f_pos & (align - 1); if (align & (align - 1)) return 0; return mod ? dump_skip(cprm, align - mod) : 1; |