提交 3dc5436a 编写于 作者: A Aneesh Kumar K.V 提交者: Eric Van Hensbergen

fs/9p: Writeback dirty data before setattr

change file attribute can result in making the file readonly.
So flush the dirty pages before that.
Signed-off-by: NAneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>
Signed-off-by: NVenkateswararao Jujjuri <jvrao@linux.vnet.ibm.com>
Signed-off-by: NEric Van Hensbergen <ericvh@gmail.com>
上级 f10fc50f
......@@ -999,6 +999,10 @@ static int v9fs_vfs_setattr(struct dentry *dentry, struct iattr *iattr)
if (retval)
return retval;
}
/* Write all dirty data */
if (S_ISREG(dentry->d_inode->i_mode))
filemap_write_and_wait(dentry->d_inode->i_mapping);
retval = p9_client_wstat(fid, &wstat);
if (retval < 0)
return retval;
......
......@@ -459,6 +459,10 @@ int v9fs_vfs_setattr_dotl(struct dentry *dentry, struct iattr *iattr)
if (retval)
return retval;
}
/* Write all dirty data */
if (S_ISREG(dentry->d_inode->i_mode))
filemap_write_and_wait(dentry->d_inode->i_mapping);
retval = p9_client_setattr(fid, &p9attr);
if (retval < 0)
return retval;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册