Re: [PATCH] xfs: Forbid FIEMAP on RT devices

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tue, Nov 19, 2019 at 04:44:53PM +0100, Carlos Maiolino wrote:
> By now, FIEMAP users have no way to identify which device contains the
> mapping being reported by the ioctl, so, let's forbid FIEMAP on RT
> devices/files until FIEMAP can properly report the device containing the
> returned mappings.
> 
> Signed-off-by: Carlos Maiolino <cmaiolino@xxxxxxxxxx>
> ---
> 
> Hi folks, this change has been previously suggested by Christoph while the
> fibmap->fiemap work was being discussed on the last version [1] of that set.
> And after some thought I do think RT devices shouldn't allow fiemap calls
> either, giving the file blocks will actually be on a different device than that
> displayed on /proc/mounts which can lead to erroneous assumptions.

Fingers are faster than my brain:

[1]: https://lore.kernel.org/linux-xfs/20190918132436.GA16210@xxxxxx/T/

> 
>  fs/xfs/xfs_iops.c | 3 +++
>  1 file changed, 3 insertions(+)
> 
> diff --git a/fs/xfs/xfs_iops.c b/fs/xfs/xfs_iops.c
> index e532db27d0dc..ec7749cbd3ca 100644
> --- a/fs/xfs/xfs_iops.c
> +++ b/fs/xfs/xfs_iops.c
> @@ -1138,6 +1138,9 @@ xfs_vn_fiemap(
>  {
>  	int			error;
>  
> +	if (XFS_IS_REALTIME_INODE(XFS_I(inode)))
> +		return -EOPNOTSUPP;
> +
>  	xfs_ilock(XFS_I(inode), XFS_IOLOCK_SHARED);
>  	if (fieinfo->fi_flags & FIEMAP_FLAG_XATTR) {
>  		fieinfo->fi_flags &= ~FIEMAP_FLAG_XATTR;
> -- 
> 2.23.0
> 

-- 
Carlos





[Index of Archives]     [XFS Filesystem Development (older mail)]     [Linux Filesystem Development]     [Linux Audio Users]     [Yosemite Trails]     [Linux Kernel]     [Linux RAID]     [Linux SCSI]


  Powered by Linux