]> www.infradead.org Git - users/jedix/linux-maple.git/commit
btrfs: btrfs_permission's RO check shouldn't apply to device nodes
authorJeff Mahoney <jeffm@suse.de>
Mon, 15 Aug 2011 17:27:21 +0000 (17:27 +0000)
committerChris Mason <chris.mason@oracle.com>
Wed, 16 Nov 2011 00:56:33 +0000 (19:56 -0500)
commit8264827bec3604ba0731660f68c8203f20f4e5cc
tree2cc9a4605ab6064cfc2013d35a560efa50249a2e
parentaa94610c1f45797b9e6f482e95a11a0d9513f168
btrfs: btrfs_permission's RO check shouldn't apply to device nodes

This patch tightens the read-only access checks in btrfs_permission to
 match the constraints in inode_permission. Currently, even though the
 device node itself will be unmodified, read-write access to device nodes
 is denied to when the device node resides on a read-only subvolume or a
 is a file that has been marked read-only by the btrfs conversion utility.

 With this patch applied, the check only affects regular files,
 directories, and symlinks. It also restructures the code a bit so that
 we don't duplicate the MAY_WRITE check for both tests.

Signed-off-by: Jeff Mahoney <jeffm@suse.com>
Signed-off-by: Chris Mason <chris.mason@oracle.com>
(cherry picked from commit cb6db4e57632ba8589cc2f9fe1d0aa9116b87ab8 with conflicts)
fs/btrfs/inode.c