Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 200135
b: refs/heads/master
c: af5a30d
h: refs/heads/master
i:
  200133: a259e10
  200131: 8650820
  200127: 2aa255b
v: v3
  • Loading branch information
Nick Piggin authored and Al Viro committed Jun 4, 2010
1 parent e465100 commit 4d043b5
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 4 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 8718d36cf99f5acf0f37487557ec25aee54b930b
refs/heads/master: af5a30d8cfcfc561336f982b06345d6b815e0bb3
2 changes: 1 addition & 1 deletion trunk/fs/ext2/inode.c
Original file line number Diff line number Diff line change
Expand Up @@ -1552,7 +1552,7 @@ int ext2_setattr(struct dentry *dentry, struct iattr *iattr)
if (error)
return error;
}
if (iattr->ia_valid & ATTR_SIZE) {
if (iattr->ia_valid & ATTR_SIZE && iattr->ia_size != inode->i_size) {
error = ext2_setsize(inode, iattr->ia_size);
if (error)
return error;
Expand Down
5 changes: 3 additions & 2 deletions trunk/mm/shmem.c
Original file line number Diff line number Diff line change
Expand Up @@ -764,10 +764,11 @@ static void shmem_truncate_range(struct inode *inode, loff_t start, loff_t end)
static int shmem_notify_change(struct dentry *dentry, struct iattr *attr)
{
struct inode *inode = dentry->d_inode;
loff_t newsize = attr->ia_size;
int error;

if (S_ISREG(inode->i_mode) && (attr->ia_valid & ATTR_SIZE)) {
loff_t newsize = attr->ia_size;
if (S_ISREG(inode->i_mode) && (attr->ia_valid & ATTR_SIZE)
&& newsize != inode->i_size) {
struct page *page = NULL;

if (newsize < inode->i_size) {
Expand Down

0 comments on commit 4d043b5

Please sign in to comment.