X-Git-Url: http://pileus.org/git/?a=blobdiff_plain;f=fs%2Fopen.c;h=e17f54454b5076b231e37c023abd31a1237445d5;hb=b7072c63c1b0611042ba6ecf0152a33c7b806e67;hp=040cef72bc00e46a0c58790f1c18cef7722756c8;hpb=83c5aac175e182c30729650f2edee3294c3b8bb0;p=~andy%2Flinux diff --git a/fs/open.c b/fs/open.c index 040cef72bc0..e17f54454b5 100644 --- a/fs/open.c +++ b/fs/open.c @@ -8,7 +8,6 @@ #include #include #include -#include #include #include #include @@ -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);