aboutsummaryrefslogtreecommitdiffstats
path: root/fs/open.c
diff options
context:
space:
mode:
authorH. Peter Anvin <hpa@zytor.com>2010-04-29 19:53:17 -0400
committerH. Peter Anvin <hpa@zytor.com>2010-04-29 19:53:17 -0400
commitd9c5841e22231e4e49fd0a1004164e6fce59b7a6 (patch)
treee1f589c46b3ff79bbe7b1b2469f6362f94576da6 /fs/open.c
parentb701a47ba48b698976fb2fe05fb285b0edc1d26a (diff)
parent5967ed87ade85a421ef814296c3c7f182b08c225 (diff)
Merge branch 'x86/asm' into x86/atomic
Merge reason: Conflict between LOCK_PREFIX_HERE and relative alternatives pointers Resolved Conflicts: arch/x86/include/asm/alternative.h arch/x86/kernel/alternative.c Signed-off-by: H. Peter Anvin <hpa@zytor.com>
Diffstat (limited to 'fs/open.c')
-rw-r--r--fs/open.c9
1 files changed, 3 insertions, 6 deletions
diff --git a/fs/open.c b/fs/open.c
index 040cef72bc00..74e5cd9f718e 100644
--- a/fs/open.c
+++ b/fs/open.c
@@ -8,10 +8,8 @@
8#include <linux/mm.h> 8#include <linux/mm.h>
9#include <linux/file.h> 9#include <linux/file.h>
10#include <linux/fdtable.h> 10#include <linux/fdtable.h>
11#include <linux/quotaops.h>
12#include <linux/fsnotify.h> 11#include <linux/fsnotify.h>
13#include <linux/module.h> 12#include <linux/module.h>
14#include <linux/slab.h>
15#include <linux/tty.h> 13#include <linux/tty.h>
16#include <linux/namei.h> 14#include <linux/namei.h>
17#include <linux/backing-dev.h> 15#include <linux/backing-dev.h>
@@ -21,6 +19,7 @@
21#include <linux/mount.h> 19#include <linux/mount.h>
22#include <linux/vfs.h> 20#include <linux/vfs.h>
23#include <linux/fcntl.h> 21#include <linux/fcntl.h>
22#include <linux/slab.h>
24#include <asm/uaccess.h> 23#include <asm/uaccess.h>
25#include <linux/fs.h> 24#include <linux/fs.h>
26#include <linux/personality.h> 25#include <linux/personality.h>
@@ -271,17 +270,15 @@ static long do_sys_truncate(const char __user *pathname, loff_t length)
271 * Make sure that there are no leases. get_write_access() protects 270 * Make sure that there are no leases. get_write_access() protects
272 * against the truncate racing with a lease-granting setlease(). 271 * against the truncate racing with a lease-granting setlease().
273 */ 272 */
274 error = break_lease(inode, FMODE_WRITE); 273 error = break_lease(inode, O_WRONLY);
275 if (error) 274 if (error)
276 goto put_write_and_out; 275 goto put_write_and_out;
277 276
278 error = locks_verify_truncate(inode, NULL, length); 277 error = locks_verify_truncate(inode, NULL, length);
279 if (!error) 278 if (!error)
280 error = security_path_truncate(&path, length, 0); 279 error = security_path_truncate(&path, length, 0);
281 if (!error) { 280 if (!error)
282 vfs_dq_init(inode);
283 error = do_truncate(path.dentry, length, 0, NULL); 281 error = do_truncate(path.dentry, length, 0, NULL);
284 }
285 282
286put_write_and_out: 283put_write_and_out:
287 put_write_access(inode); 284 put_write_access(inode);