lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Tue, 4 Nov 2014 09:18:49 +1100
From:	Dave Chinner <david@...morbit.com>
To:	Jan Beulich <JBeulich@...e.com>
Cc:	Jan Kara <jack@...e.cz>, xfs@....sgi.com,
	linux-kernel@...r.kernel.org
Subject: Re: your patch "mm: Remove false WARN_ON from
 pagecache_isize_extended()"

On Mon, Nov 03, 2014 at 04:41:13PM +0000, Jan Beulich wrote:
> Jan,
> 
> having run into that warning too, I looked into it a little, and now
> having found that patch am pretty uncertain: Both truncate_setsize()
> and pagecache_isize_extended() document that they want to be
> called with i_mutex held, so removing the WARN_ON() alone seems
> either incomplete or wrong. What I found to work without violating
> this documented requirement is the patch below.

Or, just perhaps, the comments are wrong....

Some filesystems have stronger, more robust internal serialisation
than the VFS provides with i_mutex....

> --- a/fs/xfs/xfs_file.c
> +++ b/fs/xfs/xfs_file.c
> @@ -797,7 +797,7 @@ xfs_file_fallocate(
>  		     FALLOC_FL_COLLAPSE_RANGE | FALLOC_FL_ZERO_RANGE))
>  		return -EOPNOTSUPP;
>  
> -	xfs_ilock(ip, XFS_IOLOCK_EXCL);
> +	xfs_rw_ilock(ip, XFS_IOLOCK_EXCL);
>  	if (mode & FALLOC_FL_PUNCH_HOLE) {
>  		error = xfs_free_file_space(ip, offset, len);
>  		if (error)

The i_mutex is completely redundant here. Not to mention there are
multiple callers of these xfs_*_file_space() functions used to
implement fallocate(), and we're not about to change the locking
model for them....

Cheers,

Dave.
-- 
Dave Chinner
david@...morbit.com
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ