* [PATCH XFS] Fix error return for fallocate() on XFS
@ 2009-11-24 21:52 ` Jason Gunthorpe
0 siblings, 0 replies; 4+ messages in thread
From: Jason Gunthorpe @ 2009-11-24 21:52 UTC (permalink / raw)
To: xfs-masters; +Cc: xfs, linux-kernel
Noticed that through glibc fallocate would return 28 rather than -1
and errno = 28 for ENOSPC. The xfs routines uses XFS_ERROR format
positive return error codes while the syscalls use negative return codes.
Fixup the two cases in xfs_vn_fallocate syscall to convert to negative.
Signed-off-by: Jason Gunthorpe <jgunthorpe@obsidianresearch.com>
---
fs/xfs/linux-2.6/xfs_iops.c | 6 +++---
1 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/fs/xfs/linux-2.6/xfs_iops.c b/fs/xfs/linux-2.6/xfs_iops.c
index cd42ef7..1f3b4b8 100644
--- a/fs/xfs/linux-2.6/xfs_iops.c
+++ b/fs/xfs/linux-2.6/xfs_iops.c
@@ -573,8 +573,8 @@ xfs_vn_fallocate(
bf.l_len = len;
xfs_ilock(ip, XFS_IOLOCK_EXCL);
- error = xfs_change_file_space(ip, XFS_IOC_RESVSP, &bf,
- 0, XFS_ATTR_NOLOCK);
+ error = -xfs_change_file_space(ip, XFS_IOC_RESVSP, &bf,
+ 0, XFS_ATTR_NOLOCK);
if (!error && !(mode & FALLOC_FL_KEEP_SIZE) &&
offset + len > i_size_read(inode))
new_size = offset + len;
@@ -585,7 +585,7 @@ xfs_vn_fallocate(
iattr.ia_valid = ATTR_SIZE;
iattr.ia_size = new_size;
- error = xfs_setattr(ip, &iattr, XFS_ATTR_NOLOCK);
+ error = -xfs_setattr(ip, &iattr, XFS_ATTR_NOLOCK);
}
xfs_iunlock(ip, XFS_IOLOCK_EXCL);
--
1.5.4.2
^ permalink raw reply related [flat|nested] 4+ messages in thread
* [PATCH XFS] Fix error return for fallocate() on XFS
@ 2009-11-24 21:52 ` Jason Gunthorpe
0 siblings, 0 replies; 4+ messages in thread
From: Jason Gunthorpe @ 2009-11-24 21:52 UTC (permalink / raw)
To: xfs-masters; +Cc: linux-kernel, xfs
Noticed that through glibc fallocate would return 28 rather than -1
and errno = 28 for ENOSPC. The xfs routines uses XFS_ERROR format
positive return error codes while the syscalls use negative return codes.
Fixup the two cases in xfs_vn_fallocate syscall to convert to negative.
Signed-off-by: Jason Gunthorpe <jgunthorpe@obsidianresearch.com>
---
fs/xfs/linux-2.6/xfs_iops.c | 6 +++---
1 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/fs/xfs/linux-2.6/xfs_iops.c b/fs/xfs/linux-2.6/xfs_iops.c
index cd42ef7..1f3b4b8 100644
--- a/fs/xfs/linux-2.6/xfs_iops.c
+++ b/fs/xfs/linux-2.6/xfs_iops.c
@@ -573,8 +573,8 @@ xfs_vn_fallocate(
bf.l_len = len;
xfs_ilock(ip, XFS_IOLOCK_EXCL);
- error = xfs_change_file_space(ip, XFS_IOC_RESVSP, &bf,
- 0, XFS_ATTR_NOLOCK);
+ error = -xfs_change_file_space(ip, XFS_IOC_RESVSP, &bf,
+ 0, XFS_ATTR_NOLOCK);
if (!error && !(mode & FALLOC_FL_KEEP_SIZE) &&
offset + len > i_size_read(inode))
new_size = offset + len;
@@ -585,7 +585,7 @@ xfs_vn_fallocate(
iattr.ia_valid = ATTR_SIZE;
iattr.ia_size = new_size;
- error = xfs_setattr(ip, &iattr, XFS_ATTR_NOLOCK);
+ error = -xfs_setattr(ip, &iattr, XFS_ATTR_NOLOCK);
}
xfs_iunlock(ip, XFS_IOLOCK_EXCL);
--
1.5.4.2
_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH XFS] Fix error return for fallocate() on XFS
2009-11-24 21:52 ` Jason Gunthorpe
@ 2009-11-24 23:25 ` Eric Sandeen
-1 siblings, 0 replies; 4+ messages in thread
From: Eric Sandeen @ 2009-11-24 23:25 UTC (permalink / raw)
To: Jason Gunthorpe; +Cc: xfs-masters, linux-kernel, xfs
Jason Gunthorpe wrote:
> Noticed that through glibc fallocate would return 28 rather than -1
> and errno = 28 for ENOSPC. The xfs routines uses XFS_ERROR format
> positive return error codes while the syscalls use negative return codes.
> Fixup the two cases in xfs_vn_fallocate syscall to convert to negative.
grumblegrumble xfs error signs grumble...
> Signed-off-by: Jason Gunthorpe <jgunthorpe@obsidianresearch.com>
Thanks,
Reviewed-by: Eric Sandeen <sandeen@sandeen.net>
> ---
> fs/xfs/linux-2.6/xfs_iops.c | 6 +++---
> 1 files changed, 3 insertions(+), 3 deletions(-)
>
> diff --git a/fs/xfs/linux-2.6/xfs_iops.c b/fs/xfs/linux-2.6/xfs_iops.c
> index cd42ef7..1f3b4b8 100644
> --- a/fs/xfs/linux-2.6/xfs_iops.c
> +++ b/fs/xfs/linux-2.6/xfs_iops.c
> @@ -573,8 +573,8 @@ xfs_vn_fallocate(
> bf.l_len = len;
>
> xfs_ilock(ip, XFS_IOLOCK_EXCL);
> - error = xfs_change_file_space(ip, XFS_IOC_RESVSP, &bf,
> - 0, XFS_ATTR_NOLOCK);
> + error = -xfs_change_file_space(ip, XFS_IOC_RESVSP, &bf,
> + 0, XFS_ATTR_NOLOCK);
> if (!error && !(mode & FALLOC_FL_KEEP_SIZE) &&
> offset + len > i_size_read(inode))
> new_size = offset + len;
> @@ -585,7 +585,7 @@ xfs_vn_fallocate(
>
> iattr.ia_valid = ATTR_SIZE;
> iattr.ia_size = new_size;
> - error = xfs_setattr(ip, &iattr, XFS_ATTR_NOLOCK);
> + error = -xfs_setattr(ip, &iattr, XFS_ATTR_NOLOCK);
> }
>
> xfs_iunlock(ip, XFS_IOLOCK_EXCL);
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH XFS] Fix error return for fallocate() on XFS
@ 2009-11-24 23:25 ` Eric Sandeen
0 siblings, 0 replies; 4+ messages in thread
From: Eric Sandeen @ 2009-11-24 23:25 UTC (permalink / raw)
To: Jason Gunthorpe; +Cc: xfs-masters, linux-kernel, xfs
Jason Gunthorpe wrote:
> Noticed that through glibc fallocate would return 28 rather than -1
> and errno = 28 for ENOSPC. The xfs routines uses XFS_ERROR format
> positive return error codes while the syscalls use negative return codes.
> Fixup the two cases in xfs_vn_fallocate syscall to convert to negative.
grumblegrumble xfs error signs grumble...
> Signed-off-by: Jason Gunthorpe <jgunthorpe@obsidianresearch.com>
Thanks,
Reviewed-by: Eric Sandeen <sandeen@sandeen.net>
> ---
> fs/xfs/linux-2.6/xfs_iops.c | 6 +++---
> 1 files changed, 3 insertions(+), 3 deletions(-)
>
> diff --git a/fs/xfs/linux-2.6/xfs_iops.c b/fs/xfs/linux-2.6/xfs_iops.c
> index cd42ef7..1f3b4b8 100644
> --- a/fs/xfs/linux-2.6/xfs_iops.c
> +++ b/fs/xfs/linux-2.6/xfs_iops.c
> @@ -573,8 +573,8 @@ xfs_vn_fallocate(
> bf.l_len = len;
>
> xfs_ilock(ip, XFS_IOLOCK_EXCL);
> - error = xfs_change_file_space(ip, XFS_IOC_RESVSP, &bf,
> - 0, XFS_ATTR_NOLOCK);
> + error = -xfs_change_file_space(ip, XFS_IOC_RESVSP, &bf,
> + 0, XFS_ATTR_NOLOCK);
> if (!error && !(mode & FALLOC_FL_KEEP_SIZE) &&
> offset + len > i_size_read(inode))
> new_size = offset + len;
> @@ -585,7 +585,7 @@ xfs_vn_fallocate(
>
> iattr.ia_valid = ATTR_SIZE;
> iattr.ia_size = new_size;
> - error = xfs_setattr(ip, &iattr, XFS_ATTR_NOLOCK);
> + error = -xfs_setattr(ip, &iattr, XFS_ATTR_NOLOCK);
> }
>
> xfs_iunlock(ip, XFS_IOLOCK_EXCL);
_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2009-11-24 23:25 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-11-24 21:52 [PATCH XFS] Fix error return for fallocate() on XFS Jason Gunthorpe
2009-11-24 21:52 ` Jason Gunthorpe
2009-11-24 23:25 ` Eric Sandeen
2009-11-24 23:25 ` Eric Sandeen
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.