.. | .. |
---|
1994 | 1994 | } |
---|
1995 | 1995 | } |
---|
1996 | 1996 | |
---|
1997 | | - if (file && should_remove_suid(file->f_path.dentry)) { |
---|
| 1997 | + if (file && setattr_should_drop_suidgid(file_inode(file))) { |
---|
1998 | 1998 | ret = __ocfs2_write_remove_suid(inode, di_bh); |
---|
1999 | 1999 | if (ret) { |
---|
2000 | 2000 | mlog_errno(ret); |
---|
.. | .. |
---|
2103 | 2103 | struct ocfs2_space_resv sr; |
---|
2104 | 2104 | int change_size = 1; |
---|
2105 | 2105 | int cmd = OCFS2_IOC_RESVSP64; |
---|
| 2106 | + int ret = 0; |
---|
2106 | 2107 | |
---|
2107 | 2108 | if (mode & ~(FALLOC_FL_KEEP_SIZE | FALLOC_FL_PUNCH_HOLE)) |
---|
2108 | 2109 | return -EOPNOTSUPP; |
---|
2109 | 2110 | if (!ocfs2_writes_unwritten_extents(osb)) |
---|
2110 | 2111 | return -EOPNOTSUPP; |
---|
2111 | 2112 | |
---|
2112 | | - if (mode & FALLOC_FL_KEEP_SIZE) |
---|
| 2113 | + if (mode & FALLOC_FL_KEEP_SIZE) { |
---|
2113 | 2114 | change_size = 0; |
---|
| 2115 | + } else { |
---|
| 2116 | + ret = inode_newsize_ok(inode, offset + len); |
---|
| 2117 | + if (ret) |
---|
| 2118 | + return ret; |
---|
| 2119 | + } |
---|
2114 | 2120 | |
---|
2115 | 2121 | if (mode & FALLOC_FL_PUNCH_HOLE) |
---|
2116 | 2122 | cmd = OCFS2_IOC_UNRESVSP64; |
---|
.. | .. |
---|
2282 | 2288 | * inode. There's also the dinode i_size state which |
---|
2283 | 2289 | * can be lost via setattr during extending writes (we |
---|
2284 | 2290 | * set inode->i_size at the end of a write. */ |
---|
2285 | | - if (should_remove_suid(dentry)) { |
---|
| 2291 | + if (setattr_should_drop_suidgid(inode)) { |
---|
2286 | 2292 | if (meta_level == 0) { |
---|
2287 | 2293 | ocfs2_inode_unlock_for_extent_tree(inode, |
---|
2288 | 2294 | &di_bh, |
---|