[Top] [All Lists]

Re: [PATCH 10/13] xfs: use get_unused_fd_flags(0) instead of get_unused_

To: Ben Myers <bpm@xxxxxxx>
Subject: Re: [PATCH 10/13] xfs: use get_unused_fd_flags(0) instead of get_unused_fd()
From: Yann Droneaud <ydroneaud@xxxxxxxxxx>
Date: Wed, 10 Jul 2013 12:00:57 +0200
Cc: linux-kernel@xxxxxxxxxxxxxxx, xfs@xxxxxxxxxxx, ydroneaud@xxxxxxxxxx
Delivered-to: xfs@xxxxxxxxxxx
In-reply-to: <20130709205321.GV20932@xxxxxxx>
Organization: OPTEYA
References: <cover.1372777600.git.ydroneaud@xxxxxxxxxx> <8d21b76c621dbfc59b2dbbfc933f96170835304d.1372777600.git.ydroneaud@xxxxxxxxxx> <20130708224133.GA23250@xxxxxxx> <20130709205321.GV20932@xxxxxxx>
User-agent: Roundcube Webmail/0.9.2

Le 09.07.2013 22:53, Ben Myers a ÃcritÂ:
On Mon, Jul 08, 2013 at 05:41:33PM -0500, Ben Myers wrote:
On Tue, Jul 02, 2013 at 06:39:34PM +0200, Yann Droneaud wrote:

> diff --git a/fs/xfs/xfs_ioctl.c b/fs/xfs/xfs_ioctl.c
> index 5e99968..dc5b659 100644
> --- a/fs/xfs/xfs_ioctl.c
> +++ b/fs/xfs/xfs_ioctl.c
> @@ -248,7 +248,7 @@ xfs_open_by_handle(
>            goto out_dput;
>    }
> -  fd = get_unused_fd();
> +  fd = get_unused_fd_flags(0);

O_CLOEXEC should be fine in this case.

Reviewed-by: Ben Myers <bpm@xxxxxxx>

Applied at git://oss.sgi.com/xfs/xfs.git.  Looks like I was wrong about
O_CLOEXEC being ok here. There may be applications which open_by_handle then
fork/exec and expect to still be able to use that file descriptor.

OK, it's very important to not cause regression here.

For the record, xfs_open_by_handle() is not related to open_by_handle_at() syscall.

It's an ioctl (XFS_IOC_OPEN_BY_HANDLE) which is used by xfsprogs's libhandle
in functions open_by_fshandle() and open_by_handle().


According to codesearch.debian.org, libhandle's open_by_handle() is only used
by xfsdump


So there's no many *known* users of this features ... but it's more important
not to break *unknown* users of it.

BTW, thanks for the review and applying.


Yann Droneaud

<Prev in Thread] Current Thread [Next in Thread>