linux-next.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>, Jeff Layton <jlayton@poochiereds.net>
Cc: linux-next@vger.kernel.org, linux-kernel@vger.kernel.org,
	Jeff Layton <jeff.layton@primarydata.com>,
	Christoph Hellwig <hch@lst.de>
Subject: linux-next: manual merge of the vfs tree with the file-locks tree
Date: Mon, 7 Dec 2015 12:57:28 +1100	[thread overview]
Message-ID: <20151207125728.101b1aff@canb.auug.org.au> (raw)

Hi Al,

Today's linux-next merge of the vfs tree got a conflict in:

  include/linux/fs.h

between commit:

  9e8925b67a80 ("locks: Allow disabling mandatory locking at compile time")

from the file-locks tree and commit:

  9e48b0c90a29 ("locks: new locks_mandatory_area calling convention")

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 include/linux/fs.h
index cbf08d5c246e,59bf96d82d1d..000000000000
--- a/include/linux/fs.h
+++ b/include/linux/fs.h
@@@ -2027,12 -2035,9 +2035,9 @@@ extern struct kobject *fs_kobj
  
  #define MAX_RW_COUNT (INT_MAX & PAGE_CACHE_MASK)
  
- #define FLOCK_VERIFY_READ  1
- #define FLOCK_VERIFY_WRITE 2
- 
 -#ifdef CONFIG_FILE_LOCKING
 +#ifdef CONFIG_MANDATORY_FILE_LOCKING
  extern int locks_mandatory_locked(struct file *);
- extern int locks_mandatory_area(int, struct inode *, struct file *, loff_t, size_t);
+ extern int locks_mandatory_area(struct file *, loff_t, loff_t, unsigned char);
  
  /*
   * Candidates for mandatory locking have the setgid bit set
@@@ -2065,55 -2070,18 +2070,56 @@@ static inline int locks_verify_truncate
  				    struct file *filp,
  				    loff_t size)
  {
- 	if (inode->i_flctx && mandatory_lock(inode))
- 		return locks_mandatory_area(
- 			FLOCK_VERIFY_WRITE, inode, filp,
- 			size < inode->i_size ? size : inode->i_size,
- 			(size < inode->i_size ? inode->i_size - size
- 			 : size - inode->i_size)
- 		);
- 	return 0;
+ 	if (!inode->i_flctx || !mandatory_lock(inode))
+ 		return 0;
+ 
+ 	if (size < inode->i_size) {
+ 		return locks_mandatory_area(filp, size, inode->i_size - 1,
+ 				F_WRLCK);
+ 	} else {
+ 		return locks_mandatory_area(filp, inode->i_size, size - 1,
+ 				F_WRLCK);
+ 	}
  }
  
 +#else /* !CONFIG_MANDATORY_FILE_LOCKING */
 +
 +static inline int locks_mandatory_locked(struct file *file)
 +{
 +	return 0;
 +}
 +
- static inline int locks_mandatory_area(int rw, struct inode *inode,
- 				       struct file *filp, loff_t offset,
- 				       size_t count)
++static inline int locks_mandatory_area(struct file *filp, loff_t start,
++		loff_t end, unsigned char type)
 +{
 +	return 0;
 +}
 +
 +static inline int __mandatory_lock(struct inode *inode)
 +{
 +	return 0;
 +}
 +
 +static inline int mandatory_lock(struct inode *inode)
 +{
 +	return 0;
 +}
 +
 +static inline int locks_verify_locked(struct file *file)
 +{
 +	return 0;
 +}
 +
 +static inline int locks_verify_truncate(struct inode *inode, struct file *filp,
 +					size_t size)
 +{
 +	return 0;
 +}
 +
 +#endif /* CONFIG_MANDATORY_FILE_LOCKING */
 +
 +
 +#ifdef CONFIG_FILE_LOCKING
  static inline int break_lease(struct inode *inode, unsigned int mode)
  {
  	/*

                 reply	other threads:[~2015-12-07  1:57 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=20151207125728.101b1aff@canb.auug.org.au \
    --to=sfr@canb.auug.org.au \
    --cc=hch@lst.de \
    --cc=jeff.layton@primarydata.com \
    --cc=jlayton@poochiereds.net \
    --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).