X-Git-Url: https://git.karo-electronics.de/?a=blobdiff_plain;f=fs%2Fopen.c;h=74e5cd9f718e8b43eb17e8dad2f28074591fbaaf;hb=e7874c996b8591f59d78efa519031dab5b58723b;hp=040cef72bc00e46a0c58790f1c18cef7722756c8;hpb=d5e5deddf67389eabc3d9b13004c108120d397e1;p=karo-tx-linux.git 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 @@ #include #include #include -#include #include #include -#include #include #include #include @@ -21,6 +19,7 @@ #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);