Date: Tue, 28 Oct 2008 03:06:59 GMT From: Yoshihiro Ota <ota@j.email.ne.jp> To: freebsd-gnats-submit@FreeBSD.org Subject: kern/128427: mount_mfs warns "chmod: /usr/ports: Read-only file system" Message-ID: <200810280306.m9S36xn4093231@www.freebsd.org> Resent-Message-ID: <200810280310.m9S3A3Yi069285@freefall.freebsd.org>
next in thread | raw e-mail | index | archive | help
>Number: 128427 >Category: kern >Synopsis: mount_mfs warns "chmod: /usr/ports: Read-only file system" >Confidential: no >Severity: non-critical >Priority: medium >Responsible: freebsd-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: sw-bug >Submitter-Id: current-users >Arrival-Date: Tue Oct 28 03:10:03 UTC 2008 >Closed-Date: >Last-Modified: >Originator: Yoshihiro Ota >Release: 7.1-PRERELEASE >Organization: >Environment: ... 7.1-PRERELEASE FreeBSD 7.1-PRERELEASE #441: Sat Oct 25 02:48:52 EDT 2008 root@xxx:/usr/obj/usr/src/sys/GENERIC i386 >Description: mdmfs attempts to change permission on read-only file system and gets warning. >How-To-Repeat: # grep mfs /etc/fstab /dev/md.uzip /usr/ports mfs noauto,ro,-P,-F/usr/uzip/ports-20081003.uzip # mount /usr/ports/ mount_mfs: chmod: /usr/ports: Read-only file system # df /usr/ports/ Filesystem 1K-blocks Used Avail Capacity Mounted on /dev/md1.uzip 911262 462926 375436 55% /usr/ports >Fix: Do not attempt chmod on read-only filesystem. Patch attached with submission follows: Index: sbin/mdmfs/mdmfs.c =================================================================== RCS file: /home/ncvs/src/sbin/mdmfs/mdmfs.c,v retrieving revision 1.33 diff -u -r1.33 mdmfs.c --- sbin/mdmfs/mdmfs.c 14 May 2007 19:23:13 -0000 1.33 +++ sbin/mdmfs/mdmfs.c 28 Oct 2008 03:05:30 -0000 @@ -60,6 +60,7 @@ bool mi_have_gid; mode_t mi_mode; bool mi_have_mode; + bool mi_is_readonly; }; static bool debug; /* Emit debugging information? */ @@ -195,6 +196,8 @@ break; case 'o': argappend(&mount_arg, "-o %s", optarg); + if(strcmp(optarg, "ro") == 0) + mi.mi_is_readonly = true; break; case 'P': newfs = false; @@ -440,7 +443,8 @@ static void do_mtptsetup(const char *mtpoint, struct mtpt_info *mip) { - + if (mip->mi_is_readonly) + return; if (mip->mi_have_mode) { debugprintf("changing mode of %s to %o.", mtpoint, mip->mi_mode); >Release-Note: >Audit-Trail: >Unformatted:
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200810280306.m9S36xn4093231>