linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Stephen Rothwell <sfr@canb.auug.org.au>
To: Al Viro <viro@ZenIV.linux.org.uk>
Cc: linux-next@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: linux-next: manual merge of the vfs tree with Linus' tree
Date: Thu, 2 May 2013 11:55:46 +1000	[thread overview]
Message-ID: <20130502115546.06177c1994f2529f5324d6ac@canb.auug.org.au> (raw)

[-- Attachment #1: Type: text/plain, Size: 5854 bytes --]

Hi Al,

Today's linux-next merge of the vfs tree got a conflict in fs/compat.c
between commit 76b021d053ed ("convert vmsplice to COMPAT_SYSCALL_DEFINE")
from Linus' tree and commit 72ec35163f9f ("switch compat readv/writev
variants to COMPAT_SYSCALL_DEFINE") from the vfs tree.

I fixed it up (see below) and can carry the fix as necessary (no action
is required).

-- 
Cheers,
Stephen Rothwell                    sfr@canb.auug.org.au

diff --cc fs/compat.c
index 5f83ffa,5058345..0000000
--- a/fs/compat.c
+++ b/fs/compat.c
@@@ -1068,190 -1069,26 +1068,6 @@@ asmlinkage long compat_sys_getdents64(u
  }
  #endif /* ! __ARCH_OMIT_COMPAT_SYS_GETDENTS64 */
  
- static ssize_t compat_do_readv_writev(int type, struct file *file,
- 			       const struct compat_iovec __user *uvector,
- 			       unsigned long nr_segs, loff_t *pos)
- {
- 	compat_ssize_t tot_len;
- 	struct iovec iovstack[UIO_FASTIOV];
- 	struct iovec *iov = iovstack;
- 	ssize_t ret;
- 	io_fn_t fn;
- 	iov_fn_t fnv;
- 
- 	ret = -EINVAL;
- 	if (!file->f_op)
- 		goto out;
- 
- 	ret = compat_rw_copy_check_uvector(type, uvector, nr_segs,
- 					       UIO_FASTIOV, iovstack, &iov);
- 	if (ret <= 0)
- 		goto out;
- 
- 	tot_len = ret;
- 	ret = rw_verify_area(type, file, pos, tot_len);
- 	if (ret < 0)
- 		goto out;
- 
- 	fnv = NULL;
- 	if (type == READ) {
- 		fn = file->f_op->read;
- 		fnv = file->f_op->aio_read;
- 	} else {
- 		fn = (io_fn_t)file->f_op->write;
- 		fnv = file->f_op->aio_write;
- 	}
- 
- 	if (fnv)
- 		ret = do_sync_readv_writev(file, iov, nr_segs, tot_len,
- 						pos, fnv);
- 	else
- 		ret = do_loop_readv_writev(file, iov, nr_segs, pos, fn);
- 
- out:
- 	if (iov != iovstack)
- 		kfree(iov);
- 	if ((ret + (type == READ)) > 0) {
- 		if (type == READ)
- 			fsnotify_access(file);
- 		else
- 			fsnotify_modify(file);
- 	}
- 	return ret;
- }
- 
- static size_t compat_readv(struct file *file,
- 			   const struct compat_iovec __user *vec,
- 			   unsigned long vlen, loff_t *pos)
- {
- 	ssize_t ret = -EBADF;
- 
- 	if (!(file->f_mode & FMODE_READ))
- 		goto out;
- 
- 	ret = -EINVAL;
- 	if (!file->f_op || (!file->f_op->aio_read && !file->f_op->read))
- 		goto out;
- 
- 	ret = compat_do_readv_writev(READ, file, vec, vlen, pos);
- 
- out:
- 	if (ret > 0)
- 		add_rchar(current, ret);
- 	inc_syscr(current);
- 	return ret;
- }
- 
- asmlinkage ssize_t
- compat_sys_readv(unsigned long fd, const struct compat_iovec __user *vec,
- 		 unsigned long vlen)
- {
- 	struct fd f = fdget(fd);
- 	ssize_t ret;
- 	loff_t pos;
- 
- 	if (!f.file)
- 		return -EBADF;
- 	pos = f.file->f_pos;
- 	ret = compat_readv(f.file, vec, vlen, &pos);
- 	f.file->f_pos = pos;
- 	fdput(f);
- 	return ret;
- }
- 
- asmlinkage ssize_t
- compat_sys_preadv64(unsigned long fd, const struct compat_iovec __user *vec,
- 		    unsigned long vlen, loff_t pos)
- {
- 	struct fd f;
- 	ssize_t ret;
- 
- 	if (pos < 0)
- 		return -EINVAL;
- 	f = fdget(fd);
- 	if (!f.file)
- 		return -EBADF;
- 	ret = -ESPIPE;
- 	if (f.file->f_mode & FMODE_PREAD)
- 		ret = compat_readv(f.file, vec, vlen, &pos);
- 	fdput(f);
- 	return ret;
- }
- 
- asmlinkage ssize_t
- compat_sys_preadv(unsigned long fd, const struct compat_iovec __user *vec,
- 		  unsigned long vlen, u32 pos_low, u32 pos_high)
- {
- 	loff_t pos = ((loff_t)pos_high << 32) | pos_low;
- 	return compat_sys_preadv64(fd, vec, vlen, pos);
- }
- 
- static size_t compat_writev(struct file *file,
- 			    const struct compat_iovec __user *vec,
- 			    unsigned long vlen, loff_t *pos)
- {
- 	ssize_t ret = -EBADF;
- 
- 	if (!(file->f_mode & FMODE_WRITE))
- 		goto out;
- 
- 	ret = -EINVAL;
- 	if (!file->f_op || (!file->f_op->aio_write && !file->f_op->write))
- 		goto out;
- 
- 	ret = compat_do_readv_writev(WRITE, file, vec, vlen, pos);
- 
- out:
- 	if (ret > 0)
- 		add_wchar(current, ret);
- 	inc_syscw(current);
- 	return ret;
- }
- 
- asmlinkage ssize_t
- compat_sys_writev(unsigned long fd, const struct compat_iovec __user *vec,
- 		  unsigned long vlen)
- {
- 	struct fd f = fdget(fd);
- 	ssize_t ret;
- 	loff_t pos;
- 
- 	if (!f.file)
- 		return -EBADF;
- 	pos = f.file->f_pos;
- 	ret = compat_writev(f.file, vec, vlen, &pos);
- 	f.file->f_pos = pos;
- 	fdput(f);
- 	return ret;
- }
- 
- asmlinkage ssize_t
- compat_sys_pwritev64(unsigned long fd, const struct compat_iovec __user *vec,
- 		     unsigned long vlen, loff_t pos)
- {
- 	struct fd f;
- 	ssize_t ret;
- 
- 	if (pos < 0)
- 		return -EINVAL;
- 	f = fdget(fd);
- 	if (!f.file)
- 		return -EBADF;
- 	ret = -ESPIPE;
- 	if (f.file->f_mode & FMODE_PWRITE)
- 		ret = compat_writev(f.file, vec, vlen, &pos);
- 	fdput(f);
- 	return ret;
- }
- 
- asmlinkage ssize_t
- compat_sys_pwritev(unsigned long fd, const struct compat_iovec __user *vec,
- 		   unsigned long vlen, u32 pos_low, u32 pos_high)
- {
- 	loff_t pos = ((loff_t)pos_high << 32) | pos_low;
- 	return compat_sys_pwritev64(fd, vec, vlen, pos);
- }
- 
 -asmlinkage long
 -compat_sys_vmsplice(int fd, const struct compat_iovec __user *iov32,
 -		    unsigned int nr_segs, unsigned int flags)
 -{
 -	unsigned i;
 -	struct iovec __user *iov;
 -	if (nr_segs > UIO_MAXIOV)
 -		return -EINVAL;
 -	iov = compat_alloc_user_space(nr_segs * sizeof(struct iovec));
 -	for (i = 0; i < nr_segs; i++) {
 -		struct compat_iovec v;
 -		if (get_user(v.iov_base, &iov32[i].iov_base) ||
 -		    get_user(v.iov_len, &iov32[i].iov_len) ||
 -		    put_user(compat_ptr(v.iov_base), &iov[i].iov_base) ||
 -		    put_user(v.iov_len, &iov[i].iov_len))
 -			return -EFAULT;
 -	}
 -	return sys_vmsplice(fd, iov, nr_segs, flags);
 -}
 -
  /*
   * Exactly like fs/open.c:sys_open(), except that it doesn't set the
   * O_LARGEFILE flag.

[-- Attachment #2: Type: application/pgp-signature, Size: 836 bytes --]

             reply	other threads:[~2013-05-02  1:56 UTC|newest]

Thread overview: 53+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-05-02  1:55 Stephen Rothwell [this message]
  -- strict thread matches above, loose matches on Subject: below --
2024-01-05  0:10 linux-next: manual merge of the vfs tree with Linus' tree Stephen Rothwell
2024-01-05  0:20 ` Steven Rostedt
2024-01-01 22:36 Stephen Rothwell
2020-07-28  1:09 Stephen Rothwell
2020-07-27  1:37 Stephen Rothwell
2020-03-31 23:55 Stephen Rothwell
2019-01-02  1:32 Stephen Rothwell
2019-01-02  1:18 Stephen Rothwell
2018-10-30  1:20 Stephen Rothwell
2018-06-01  1:52 Stephen Rothwell
2018-01-01 22:54 Stephen Rothwell
2017-12-03 23:05 Stephen Rothwell
2017-11-28 23:53 Stephen Rothwell
2017-11-30 23:36 ` Stephen Rothwell
2017-11-17  0:42 Stephen Rothwell
2017-03-30  0:07 Stephen Rothwell
2017-02-27  0:10 Stephen Rothwell
2017-02-27  8:28 ` David Howells
2017-01-22 23:36 Stephen Rothwell
2016-10-10  0:20 Stephen Rothwell
2016-05-19  1:17 Stephen Rothwell
2016-05-19  2:02 ` Steve French
2016-05-02  0:49 Stephen Rothwell
2016-05-02  0:43 Stephen Rothwell
2016-05-02  0:38 Stephen Rothwell
2016-03-13 23:24 Stephen Rothwell
2015-12-07  1:46 Stephen Rothwell
2015-02-22  0:57 Stephen Rothwell
2015-02-22  0:55 Stephen Rothwell
2015-02-22  0:51 Stephen Rothwell
2015-02-22  0:46 Stephen Rothwell
2015-01-23  1:10 Stephen Rothwell
2014-05-29  3:19 Stephen Rothwell
2014-04-22  1:17 Stephen Rothwell
2014-04-22  0:50 Stephen Rothwell
2014-04-22  0:44 Stephen Rothwell
2013-11-08  1:01 Stephen Rothwell
2013-09-05  2:59 Stephen Rothwell
2013-05-02  2:00 Stephen Rothwell
2013-05-01  2:11 Stephen Rothwell
2013-04-29  1:38 Stephen Rothwell
2012-09-24  1:45 Stephen Rothwell
2012-07-30  0:41 Stephen Rothwell
2012-07-30  0:37 Stephen Rothwell
2012-02-14  0:54 Stephen Rothwell
2012-02-14  1:43 ` Al Viro
2012-01-09  1:11 Stephen Rothwell
2012-01-09  1:32 ` Linus Torvalds
2012-01-09  2:22   ` Stephen Rothwell
2012-01-09  2:14 ` Al Viro
2010-05-28  1:31 Stephen Rothwell
2010-05-28  1:31 Stephen Rothwell

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20130502115546.06177c1994f2529f5324d6ac@canb.auug.org.au \
    --to=sfr@canb.auug.org.au \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-next@vger.kernel.org \
    --cc=viro@ZenIV.linux.org.uk \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).