diff options
-rw-r--r-- | fs/namei.c | 6 | ||||
-rw-r--r-- | include/linux/fs.h | 1 |
2 files changed, 5 insertions, 2 deletions
diff --git a/fs/namei.c b/fs/namei.c index 464eeccb675b..1e5c71669164 100644 --- a/fs/namei.c +++ b/fs/namei.c | |||
@@ -1659,8 +1659,10 @@ int may_open(struct nameidata *nd, int acc_mode, int flag) | |||
1659 | error = locks_verify_locked(inode); | 1659 | error = locks_verify_locked(inode); |
1660 | if (!error) { | 1660 | if (!error) { |
1661 | DQUOT_INIT(inode); | 1661 | DQUOT_INIT(inode); |
1662 | 1662 | ||
1663 | error = do_truncate(dentry, 0, ATTR_MTIME|ATTR_CTIME, NULL); | 1663 | error = do_truncate(dentry, 0, |
1664 | ATTR_MTIME|ATTR_CTIME|ATTR_OPEN, | ||
1665 | NULL); | ||
1664 | } | 1666 | } |
1665 | put_write_access(inode); | 1667 | put_write_access(inode); |
1666 | if (error) | 1668 | if (error) |
diff --git a/include/linux/fs.h b/include/linux/fs.h index e3fc5dbb2246..6a4d170ad9a5 100644 --- a/include/linux/fs.h +++ b/include/linux/fs.h | |||
@@ -330,6 +330,7 @@ typedef void (dio_iodone_t)(struct kiocb *iocb, loff_t offset, | |||
330 | #define ATTR_KILL_SGID 4096 | 330 | #define ATTR_KILL_SGID 4096 |
331 | #define ATTR_FILE 8192 | 331 | #define ATTR_FILE 8192 |
332 | #define ATTR_KILL_PRIV 16384 | 332 | #define ATTR_KILL_PRIV 16384 |
333 | #define ATTR_OPEN 32768 /* Truncating from open(O_TRUNC) */ | ||
333 | 334 | ||
334 | /* | 335 | /* |
335 | * This is the Inode Attributes structure, used for notify_change(). It | 336 | * This is the Inode Attributes structure, used for notify_change(). It |