CacheFiles: Fix error handling in cachefiles_determine_cache_security()
[pandora-kernel.git] / fs / open.c
index 040cef7..74e5cd9 100644 (file)
--- a/fs/open.c
+++ b/fs/open.c
@@ -8,10 +8,8 @@
 #include <linux/mm.h>
 #include <linux/file.h>
 #include <linux/fdtable.h>
-#include <linux/quotaops.h>
 #include <linux/fsnotify.h>
 #include <linux/module.h>
-#include <linux/slab.h>
 #include <linux/tty.h>
 #include <linux/namei.h>
 #include <linux/backing-dev.h>
@@ -21,6 +19,7 @@
 #include <linux/mount.h>
 #include <linux/vfs.h>
 #include <linux/fcntl.h>
+#include <linux/slab.h>
 #include <asm/uaccess.h>
 #include <linux/fs.h>
 #include <linux/personality.h>
@@ -271,17 +270,15 @@ static long do_sys_truncate(const char __user *pathname, loff_t length)
         * Make sure that there are no leases.  get_write_access() protects
         * against the truncate racing with a lease-granting setlease().
         */
-       error = break_lease(inode, FMODE_WRITE);
+       error = break_lease(inode, O_WRONLY);
        if (error)
                goto put_write_and_out;
 
        error = locks_verify_truncate(inode, NULL, length);
        if (!error)
                error = security_path_truncate(&path, length, 0);
-       if (!error) {
-               vfs_dq_init(inode);
+       if (!error)
                error = do_truncate(path.dentry, length, 0, NULL);
-       }
 
 put_write_and_out:
        put_write_access(inode);