From owner-svn-src-all@FreeBSD.ORG Sat Aug 2 05:05:11 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 7102C877; Sat, 2 Aug 2014 05:05:11 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 5FA7D296F; Sat, 2 Aug 2014 05:05:11 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s7255BCX035397; Sat, 2 Aug 2014 05:05:11 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s7255BZR035396; Sat, 2 Aug 2014 05:05:11 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <201408020505.s7255BZR035396@svn.freebsd.org> From: Warner Losh Date: Sat, 2 Aug 2014 05:05:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r269421 - head/sys/fs/nandfs X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 02 Aug 2014 05:05:11 -0000 Author: imp Date: Sat Aug 2 05:05:10 2014 New Revision: 269421 URL: http://svnweb.freebsd.org/changeset/base/269421 Log: Follow the ufs practice for disallowing permission changes as well as writes to files for read-only file systems. Since there are already checks in nandfs_setattr that return an error, this moves detection of the error earlier. Modified: head/sys/fs/nandfs/nandfs_vnops.c Modified: head/sys/fs/nandfs/nandfs_vnops.c ============================================================================== --- head/sys/fs/nandfs/nandfs_vnops.c Sat Aug 2 05:05:05 2014 (r269420) +++ head/sys/fs/nandfs/nandfs_vnops.c Sat Aug 2 05:05:10 2014 (r269421) @@ -987,7 +987,7 @@ nandfs_check_possible(struct vnode *vp, * Normal nodes: check if we're on a read-only mounted * filingsystem and bomb out if we're trying to write. */ - if ((mode & VWRITE) && (vp->v_mount->mnt_flag & MNT_RDONLY)) + if ((mode & VMODIFY_PERMS) && (vp->v_mount->mnt_flag & MNT_RDONLY)) return (EROFS); break; case VBLK: