Commit 7db83c07 authored by Linus Torvalds's avatar Linus Torvalds
Browse files

Merge tag 'vfs-5.7-merge-1' of git://git.kernel.org/pub/scm/fs/xfs/xfs-linux

Pull hibernation fix from Darrick Wong:
 "Fix a regression where we broke the userspace hibernation driver by
  disallowing writes to the swap device"

* tag 'vfs-5.7-merge-1' of git://git.kernel.org/pub/scm/fs/xfs/xfs-linux:
  hibernate: Allow uswsusp to write to swap
parents 35a9fafe 56939e01
Loading
Loading
Loading
Loading
+3 −1
Original line number Original line Diff line number Diff line
@@ -34,6 +34,7 @@
#include <linux/task_io_accounting_ops.h>
#include <linux/task_io_accounting_ops.h>
#include <linux/falloc.h>
#include <linux/falloc.h>
#include <linux/uaccess.h>
#include <linux/uaccess.h>
#include <linux/suspend.h>
#include "internal.h"
#include "internal.h"


struct bdev_inode {
struct bdev_inode {
@@ -2013,7 +2014,8 @@ ssize_t blkdev_write_iter(struct kiocb *iocb, struct iov_iter *from)
	if (bdev_read_only(I_BDEV(bd_inode)))
	if (bdev_read_only(I_BDEV(bd_inode)))
		return -EPERM;
		return -EPERM;


	if (IS_SWAPFILE(bd_inode))
	/* uswsusp needs write permission to the swap */
	if (IS_SWAPFILE(bd_inode) && !hibernation_available())
		return -ETXTBSY;
		return -ETXTBSY;


	if (!iov_iter_count(from))
	if (!iov_iter_count(from))