From patchwork Sun Sep 29 13:35:56 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: "Geyslan G. Bem" X-Patchwork-Id: 2960241 Return-Path: X-Original-To: patchwork-v9fs-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 91768BFF0B for ; Sun, 29 Sep 2013 13:36:11 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id A44CA20212 for ; Sun, 29 Sep 2013 13:36:10 +0000 (UTC) Received: from lists.sourceforge.net (lists.sourceforge.net [216.34.181.88]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 6FDD5201ED for ; Sun, 29 Sep 2013 13:36:09 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=sfs-ml-4.v29.ch3.sourceforge.com) by sfs-ml-4.v29.ch3.sourceforge.com with esmtp (Exim 4.76) (envelope-from ) id 1VQHAM-0002Bk-9z; Sun, 29 Sep 2013 13:36:06 +0000 Received: from sog-mx-1.v43.ch3.sourceforge.com ([172.29.43.191] helo=mx.sourceforge.net) by sfs-ml-4.v29.ch3.sourceforge.com with esmtp (Exim 4.76) (envelope-from ) id 1VQHAK-0002Ba-9n for v9fs-developer@lists.sourceforge.net; Sun, 29 Sep 2013 13:36:04 +0000 Received-SPF: pass (sog-mx-1.v43.ch3.sourceforge.com: domain of gmail.com designates 209.85.216.48 as permitted sender) client-ip=209.85.216.48; envelope-from=geyslan@gmail.com; helo=mail-qa0-f48.google.com; Received: from mail-qa0-f48.google.com ([209.85.216.48]) by sog-mx-1.v43.ch3.sourceforge.com with esmtps (TLSv1:RC4-SHA:128) (Exim 4.76) id 1VQHAI-0001sH-D5 for v9fs-developer@lists.sourceforge.net; Sun, 29 Sep 2013 13:36:04 +0000 Received: by mail-qa0-f48.google.com with SMTP id hu16so1646527qab.14 for ; Sun, 29 Sep 2013 06:35:56 -0700 (PDT) MIME-Version: 1.0 X-Received: by 10.224.28.201 with SMTP id n9mr2293973qac.95.1380461756731; Sun, 29 Sep 2013 06:35:56 -0700 (PDT) Received: by 10.49.98.36 with HTTP; Sun, 29 Sep 2013 06:35:56 -0700 (PDT) Date: Sun, 29 Sep 2013 10:35:56 -0300 Message-ID: From: =?UTF-8?Q?Geyslan_Greg=C3=B3rio_Bem?= To: Eric Van Hensbergen , rminnich@sandia.gov, lucho@ionkov.net X-Spam-Score: -1.6 (-) X-Headers-End: 1VQHAI-0001sH-D5 Cc: v9fs-developer@lists.sourceforge.net Subject: [V9fs-developer] p9 vs unix mode bits X-BeenThere: v9fs-developer@lists.sourceforge.net X-Mailman-Version: 2.1.9 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: v9fs-developer-bounces@lists.sourceforge.net X-Spam-Status: No, score=-7.5 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, FREEMAIL_FROM,RCVD_IN_DNSWL_HI,RP_MATCHES_RCVD,UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Hi maintainers, I suggested yesterday eight p9 patches. Well, I would like to ask you about this other. Maybe after the ORing the mode bit never break when placed in a signed integer, but merely to remain in conformity, I propose this change since both p9 and unix mode bits are unsigned integers: res |= P9_DMDIR; @@ -144,7 +144,7 @@ static umode_t p9mode2unixmode(struct v9fs_session_info *v9ses, else if ((mode & P9_DMDEVICE) && (v9fs_proto_dotu(v9ses)) && (v9ses->nodev == 0)) { char type = 0, ext[32]; - int major = -1, minor = -1; + unsigned int major = 0, minor = 0; strlcpy(ext, stat->extension, sizeof(ext)); sscanf(ext, "%c %u %u", &type, &major, &minor); Let me know what do you think. Best Regards. Geyslan Gregório Bem hackingbits.com ------------------------------------------------------------------------------ October Webinars: Code for Performance Free Intel webinars can help you accelerate application performance. Explore tips for MPI, OpenMP, advanced profiling, and more. Get the most from the latest Intel processors and coprocessors. See abstracts and register > http://pubads.g.doubleclick.net/gampad/clk?id=60133471&iu=/4140/ostg.clktrk diff --git a/fs/9p/vfs_inode.c b/fs/9p/vfs_inode.c index b352457..ff46755 100644 --- a/fs/9p/vfs_inode.c +++ b/fs/9p/vfs_inode.c @@ -63,7 +63,7 @@ static const struct inode_operations v9fs_symlink_inode_operations; static u32 unixmode2p9mode(struct v9fs_session_info *v9ses, umode_t mode) { - int res; + unsigned int res; res = mode & 0777; if (S_ISDIR(mode))