Commit e2f7f0d7 authored by Martin Brandenburg's avatar Martin Brandenburg Committed by Mike Marshall

orangefs: use new orangefs_inode_getattr to get size in write and llseek

Signed-off-by: default avatarMartin Brandenburg <martin@omnibond.com>
Signed-off-by: default avatarMike Marshall <hubcap@omnibond.com>
parent 075cca50
...@@ -455,11 +455,12 @@ static ssize_t orangefs_file_write_iter(struct kiocb *iocb, struct iov_iter *ite ...@@ -455,11 +455,12 @@ static ssize_t orangefs_file_write_iter(struct kiocb *iocb, struct iov_iter *ite
/* Make sure generic_write_checks sees an up to date inode size. */ /* Make sure generic_write_checks sees an up to date inode size. */
if (file->f_flags & O_APPEND) { if (file->f_flags & O_APPEND) {
rc = orangefs_inode_old_getattr(file->f_mapping->host, rc = orangefs_inode_getattr(file->f_mapping->host, 0, 1);
ORANGEFS_ATTR_SYS_SIZE, 0); if (rc == -ESTALE)
rc = -EIO;
if (rc) { if (rc) {
gossip_err("%s: orangefs_inode_old_getattr failed, rc:%zd:.\n", gossip_err("%s: orangefs_inode_getattr failed, "
__func__, rc); "rc:%zd:.\n", __func__, rc);
goto out; goto out;
} }
} }
...@@ -670,8 +671,9 @@ static loff_t orangefs_file_llseek(struct file *file, loff_t offset, int origin) ...@@ -670,8 +671,9 @@ static loff_t orangefs_file_llseek(struct file *file, loff_t offset, int origin)
* NOTE: We are only interested in file size here, * NOTE: We are only interested in file size here,
* so we set mask accordingly. * so we set mask accordingly.
*/ */
ret = orangefs_inode_old_getattr(inode, ret = orangefs_inode_getattr(file->f_mapping->host, 0, 1);
ORANGEFS_ATTR_SYS_SIZE, 0); if (ret == -ESTALE)
ret = -EIO;
if (ret) { if (ret) {
gossip_debug(GOSSIP_FILE_DEBUG, gossip_debug(GOSSIP_FILE_DEBUG,
"%s:%s:%d calling make bad inode\n", "%s:%s:%d calling make bad inode\n",
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment