public inbox for linux-next@vger.kernel.org 
 help / color / mirror / Atom feed
From: Stephen Rothwell <sfr-3FnU+UHB4dNDw9hX6IcOSA@public•gmane.org>
To: Philipp Reisner
	<philipp.reisner-63ez5xqkn6DQT0dZR+AlfA@public•gmane.org>,
	drbd-dev-cunTk1MwBs8qoQakbn7OcQ@public•gmane.org
Cc: Jens Axboe <jens.axboe-QHcLZuEGTsvQT0dZR+AlfA@public•gmane.org>,
	linux-next-u79uwXL29TY76Z2rM5mHXA@public•gmane.org,
	Julia Lawall <julia-dAYI7NvHqcQ@public•gmane.org>,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA@public•gmane.org,
	Al Viro <viro-RmSDqhL/yNMiFSDQTTA3OLVCufUGDwFn@public•gmane.org>
Subject: linux-next: manual merge of the drbd tree with Linus' tree
Date: Tue, 1 Jun 2010 14:13:24 +1000	[thread overview]
Message-ID: <20100601141324.edf41f7f.sfr@canb.auug.org.au> (raw)

Hi all,

Today's linux-next merge of the drbd tree got a conflict in fs/pipe.c
between commit cc967be54710d97c05229b2e5ba2d00df84ddd64 ("fs: Add missing
mutex_unlock") from Linus' tree and commits
0191f8697bbdfefcd36e7b8dc3eeddfe82893e4b ("pipe: F_SETPIPE_SZ should
return -EPERM for non-root") and b9598db3401282bb27b4aef77e3eee12015f7f29
("pipe: make F_{GET,SET}PIPE_SZ deal with byte sizes") from the drbd tree.

I fixed it up (see below) and can carry the fix for a while.
-- 
Cheers,
Stephen Rothwell                    sfr-3FnU+UHB4dNDw9hX6IcOSA@public•gmane.org

diff --cc fs/pipe.c
index db6eaab,bdd3f96..0000000
--- a/fs/pipe.c
+++ b/fs/pipe.c
@@@ -1174,23 -1162,30 +1168,34 @@@ long pipe_fcntl(struct file *file, unsi
  	mutex_lock(&pipe->inode->i_mutex);
  
  	switch (cmd) {
- 	case F_SETPIPE_SZ:
- 		if (!capable(CAP_SYS_ADMIN) && arg > pipe_max_pages) {
- 			ret = -EINVAL;
+ 	case F_SETPIPE_SZ: {
+ 		unsigned long nr_pages;
+ 
+ 		/*
+ 		 * Currently the array must be a power-of-2 size, so adjust
+ 		 * upwards if needed.
+ 		 */
+ 		nr_pages = (arg + PAGE_SIZE - 1) >> PAGE_SHIFT;
+ 		nr_pages = roundup_pow_of_two(nr_pages);
+ 
 -		if (!capable(CAP_SYS_ADMIN) && nr_pages > pipe_max_pages)
 -			return -EPERM;
++		if (!capable(CAP_SYS_ADMIN) && nr_pages > pipe_max_pages) {
++			ret = -EPERM;
 +			goto out;
 +		}
+ 
  		/*
  		 * The pipe needs to be at least 2 pages large to
  		 * guarantee POSIX behaviour.
  		 */
- 		if (arg < 2) {
 -		if (nr_pages < 2)
 -			return -EINVAL;
++		if (nr_pages < 2) {
 +			ret = -EINVAL;
 +			goto out;
 +		}
- 		ret = pipe_set_size(pipe, arg);
+ 		ret = pipe_set_size(pipe, nr_pages);
  		break;
+ 		}
  	case F_GETPIPE_SZ:
- 		ret = pipe->buffers;
+ 		ret = pipe->buffers * PAGE_SIZE;
  		break;
  	default:
  		ret = -EINVAL;

             reply	other threads:[~2010-06-01  4:13 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-06-01  4:13 Stephen Rothwell [this message]
2010-06-01  8:18 ` linux-next: manual merge of the drbd tree with Linus' tree Christoph Hellwig
     [not found]   ` <20100601081823.GA29991-wEGCiKHe2LqWVfeAwA7xHQ@public.gmane.org>
2010-06-01  8:22     ` Stephen Rothwell
2010-06-01  8:31       ` Jens Axboe
2010-06-01  8:42         ` Stephen Rothwell
2010-06-01  8:53           ` Jens Axboe
2010-06-01 10:35             ` Stephen Rothwell
2010-06-01 10:45       ` Jens Axboe
2010-06-01 10:49         ` Stephen Rothwell
2010-06-01 10:50           ` Jens Axboe
2010-06-01  8:22   ` Jens Axboe
     [not found]     ` <20100601082246.GA3564-tSWWG44O7X1aa/9Udqfwiw@public.gmane.org>
2010-06-01  8:32       ` Christoph Hellwig
2010-06-01  8:36         ` Jens Axboe

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=20100601141324.edf41f7f.sfr@canb.auug.org.au \
    --to=sfr-3fnu+uhb4dndw9hx6icosa@public$(echo .)gmane.org \
    --cc=drbd-dev-cunTk1MwBs8qoQakbn7OcQ@public$(echo .)gmane.org \
    --cc=jens.axboe-QHcLZuEGTsvQT0dZR+AlfA@public$(echo .)gmane.org \
    --cc=julia-dAYI7NvHqcQ@public$(echo .)gmane.org \
    --cc=linux-kernel-u79uwXL29TY76Z2rM5mHXA@public$(echo .)gmane.org \
    --cc=linux-next-u79uwXL29TY76Z2rM5mHXA@public$(echo .)gmane.org \
    --cc=philipp.reisner-63ez5xqkn6DQT0dZR+AlfA@public$(echo .)gmane.org \
    --cc=viro-RmSDqhL/yNMiFSDQTTA3OLVCufUGDwFn@public$(echo .)gmane.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html
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