All of lore.kernel.org
 help / color / mirror / Atom feed
From: Eric Sandeen <sandeen@sandeen.net>
To: Jason Gunthorpe <jgunthorpe@obsidianresearch.com>
Cc: xfs-masters@oss.sgi.com, linux-kernel@vger.kernel.org, xfs@oss.sgi.com
Subject: Re: [PATCH XFS] Fix error return for fallocate() on XFS
Date: Tue, 24 Nov 2009 17:25:14 -0600	[thread overview]
Message-ID: <4B0C6B5A.6080702@sandeen.net> (raw)
In-Reply-To: <20091124215253.GA10693@obsidianresearch.com>

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);


WARNING: multiple messages have this Message-ID (diff)
From: Eric Sandeen <sandeen@sandeen.net>
To: Jason Gunthorpe <jgunthorpe@obsidianresearch.com>
Cc: xfs-masters@oss.sgi.com, linux-kernel@vger.kernel.org, xfs@oss.sgi.com
Subject: Re: [PATCH XFS] Fix error return for fallocate() on XFS
Date: Tue, 24 Nov 2009 17:25:14 -0600	[thread overview]
Message-ID: <4B0C6B5A.6080702@sandeen.net> (raw)
In-Reply-To: <20091124215253.GA10693@obsidianresearch.com>

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

  reply	other threads:[~2009-11-24 23:25 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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 [this message]
2009-11-24 23:25   ` Eric Sandeen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4B0C6B5A.6080702@sandeen.net \
    --to=sandeen@sandeen.net \
    --cc=jgunthorpe@obsidianresearch.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=xfs-masters@oss.sgi.com \
    --cc=xfs@oss.sgi.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.