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 for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Sat, 10 Jun 2017 06:27:03 +0100
From:   Al Viro <viro@...IV.linux.org.uk>
To:     Goldwyn Rodrigues <rgoldwyn@...e.de>
Cc:     linux-fsdevel@...r.kernel.org, jack@...e.com, hch@...radead.org,
        linux-block@...r.kernel.org, linux-btrfs@...r.kernel.org,
        linux-ext4@...r.kernel.org, linux-xfs@...r.kernel.org,
        axboe@...nel.dk, linux-api@...r.kernel.org,
        adam.manzanares@....com, Goldwyn Rodrigues <rgoldwyn@...e.com>
Subject: Re: [PATCH 04/10] fs: Introduce RWF_NOWAIT

On Tue, Jun 06, 2017 at 06:19:33AM -0500, Goldwyn Rodrigues wrote:
> From: Goldwyn Rodrigues <rgoldwyn@...e.com>
> 
> RWF_NOWAIT informs kernel to bail out if an AIO request will block
> for reasons such as file allocations, or a writeback triggered,
> or would block while allocating requests while performing
> direct I/O.
> 
> RWF_NOWAIT is translated to IOCB_NOWAIT for iocb->ki_flags.
> 
> The check for -EOPNOTSUPP is placed in generic_file_write_iter(). This
> is called by most filesystems, either through fsops.write_iter() or through
> the function defined by write_iter(). If not, we perform the check defined
> by .write_iter() which is called for direct IO specifically.
> 
> Filesystems xfs, btrfs and ext4 would be supported in the following patches.

Umm...  What about ->write_iter() instances outside of fs/*?  Even in fs/*,
consider e.g.
int cifs_get_writer(struct cifsInodeInfo *cinode)
{
        int rc;

start:
        rc = wait_on_bit(&cinode->flags, CIFS_INODE_PENDING_OPLOCK_BREAK,
                         TASK_KILLABLE);

and cifs_file_write_iter() calling it before going to generic_file_write_iter().
Ditto for cifs_struct_writev()...  coda_file_write_iter() does inode_lock()
before calling vfs_iter_write().  ext2_dax_write_iter(): inode_lock().
f2fs_file_write_iter(): ditto.  fuse_file_write_iter(): ditto in case when
->writeback_cache is false.  gfs2 is O_APPEND case: almost certainly blocks.
ncp_file_write_iter(): blocks (mutex_lock(&NCP_FINFO(inode)->open_mutex)
in ncp_make_open(), not to mention anything else). ntfs_file_write_iter():
inode_lock().  orangefs_file_write_iter(): ditto.  ubifs_write_iter():
may block in update_mctime().  udf_file_write_iter(): inode_lock().

Lustre sure as hell does block before it gets anywhere near mm/filemap.c.

And that - just from looking at regular files.  Then we have sockets and
pipes, not to mention weird stuff like fs/fuse/cuse.c, etc.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ