From patchwork Sun Apr 23 18:58:15 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Fabian Frederick X-Patchwork-Id: 9695251 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 844EF601E9 for ; Sun, 23 Apr 2017 18:58:39 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 786EA26490 for ; Sun, 23 Apr 2017 18:58:39 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 6D17A265B9; Sun, 23 Apr 2017 18:58:39 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=unavailable version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 299FF26490 for ; Sun, 23 Apr 2017 18:58:39 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1163312AbdDWS6b (ORCPT ); Sun, 23 Apr 2017 14:58:31 -0400 Received: from mailrelay117.isp.belgacom.be ([195.238.20.144]:29985 "EHLO mailrelay117.isp.belgacom.be" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1163309AbdDWS6a (ORCPT ); Sun, 23 Apr 2017 14:58:30 -0400 X-Belgacom-Dynamic: yes IronPort-PHdr: =?us-ascii?q?9a23=3ANcku4R8EhWlRBv9uRHKM819IXTAuvvDOBiVQ1KB3?= =?us-ascii?q?1eIcTK2v8tzYMVDF4r011RmSDNmds6oMotGVmpioYXYH75eFvSJKW713fDhBt/?= =?us-ascii?q?8rmRc9CtWOE0zxIa2iRSU7GMNfSA0tpCnjYgBaF8nkelLdvGC54yIMFRXjLwp1?= =?us-ascii?q?Ifn+FpLPg8it2e2//5Lebx9UiDahfLh/MAi4oQLNu8cMnIBsMLwxyhzHontJf+?= =?us-ascii?q?RZ22ZlLk+Nkhj/+8m94odt/zxftPw9+cFAV776f7kjQrxDEDsmKWE169b1uhTF?= =?us-ascii?q?UACC+2ETUmQSkhpPHgjF8BT3VYr/vyfmquZw3jSRMMvrRr42RDui9b9mRh/2hi?= =?us-ascii?q?kaOTA382bZh9dsgK5Huh+tuwZyz5LIbIyTKfFwfrndfdQfRWdZXsheTTdOAoKm?= =?us-ascii?q?YIsJEuEPPfxYoJfgqFQQtxu+BBWjBODywTJPiH/5x7Y10+o6HAHd3wwhH9QOv2?= =?us-ascii?q?rIrNnvL6gdT/m4wa/VxjvAd/NbwTPw5JXSfhw8o/yBWah8fdfVxEQsDQ/IjlWd?= =?us-ascii?q?pIr4ND2PzOsNqXKU7+94WOKqjG4oth9+ryC0xscplonJnoUVyk3Y9SlhwIY6O9?= =?us-ascii?q?m4SEljbN6gF5tfqzuVN492QsMlWGFopDw2yrkBuZGnZicKzIkoxxnaa/OdcoiI?= =?us-ascii?q?5ArvVOeXIThmmHJoYLayiwuo/US9yODxUtO43EtOoydGiNXBtnAA2wTW6sedS/?= =?us-ascii?q?t9+kmh2SyI1wDW8uxEL1o7mrHVK5M62b4wlZoSsULdES/qgkn5l7GZel0++ue0?= =?us-ascii?q?8+TnfqnmppiEOo92kA7xLqcul9ekAeQlKQgBQXKX9vi71L3m5Uf5WqlFjuUqkq?= =?us-ascii?q?nFt5DXPcAbpq+/Aw9I3Ycv8hi/Dyy739sGg3kIMlZFdQmZj4jmJV7OOur0DfSh?= =?us-ascii?q?jFS2ljdk2fTGMqfmApXXIXjJiK3hcqpl605A1AozyshS55ZVCrEHPfLyVVb9tN?= =?us-ascii?q?/GAR8jNQy73eLnBc5j1oMRR22PGLWVMKDMvl+S4OIgPe2MaJUSuDbnJPgv/+Tu?= =?us-ascii?q?gmMhmV8BYamp2oMaaH6iEft9LUWUemHsgtQBEGcMoAU+UPbmh0acXm0bW3Hnfa?= =?us-ascii?q?s6rhIyEovuWYXKTYOFm6Ga0WGwGZgANU5cDVXZP37idoyCE9kWZS6fOM5qkXRQ?= =?us-ascii?q?W7GrRac61gCouRO8wbcxfbmcwTERqZ+2jIs93ObUjxxnrTE=3D?= X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: =?us-ascii?q?A2AeAgBf+PxY/zfGs1tcHAELAQUBGAELA?= =?us-ascii?q?QUBgj9rJ4FGjm+RHAGVOoIPIYYDhA1AGAEBAQEBAQEBAQEBaiiCMyCCcC8jKXE?= =?us-ascii?q?kE4oPEa1ROoQQhzSGU4xogkoFnUGSeQ2RV5QZHziBBkMdGIRdAU8cgWU+NYk2A?= =?us-ascii?q?QEB?= X-IPAS-Result: =?us-ascii?q?A2AeAgBf+PxY/zfGs1tcHAELAQUBGAELAQUBgj9rJ4FGjm+?= =?us-ascii?q?RHAGVOoIPIYYDhA1AGAEBAQEBAQEBAQEBaiiCMyCCcC8jKXEkE4oPEa1ROoQQh?= =?us-ascii?q?zSGU4xogkoFnUGSeQ2RV5QZHziBBkMdGIRdAU8cgWU+NYk2AQEB?= Received: from 55.198-179-91.adsl-dyn.isp.belgacom.be (HELO localhost.localdomain) ([91.179.198.55]) by relay.skynet.be with ESMTP; 23 Apr 2017 20:58:22 +0200 From: Fabian Frederick To: Jan Kara Cc: linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, fabf@skynet.be Subject: [PATCH 1/2 linux-next] udf: use octal for permissions Date: Sun, 23 Apr 2017 20:58:15 +0200 Message-Id: <20170423185815.5851-1-fabf@skynet.be> X-Mailer: git-send-email 2.9.3 Sender: linux-fsdevel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-fsdevel@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP According to commit f90774e1fd27 ("checkpatch: look for symbolic permissions and suggest octal instead") Signed-off-by: Fabian Frederick --- fs/udf/inode.c | 14 +++++++------- fs/udf/namei.c | 2 +- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/fs/udf/inode.c b/fs/udf/inode.c index a8d8f71..8715dcd 100644 --- a/fs/udf/inode.c +++ b/fs/udf/inode.c @@ -1535,7 +1535,7 @@ static int udf_read_inode(struct inode *inode, bool hidden_inode) inode->i_data.a_ops = &udf_symlink_aops; inode->i_op = &udf_symlink_inode_operations; inode_nohighmem(inode); - inode->i_mode = S_IFLNK | S_IRWXUGO; + inode->i_mode = S_IFLNK | 0777; break; case ICBTAG_FILE_TYPE_MAIN: udf_debug("METADATA FILE-----\n"); @@ -1591,9 +1591,9 @@ static umode_t udf_convert_permissions(struct fileEntry *fe) permissions = le32_to_cpu(fe->permissions); flags = le16_to_cpu(fe->icbTag.flags); - mode = ((permissions) & S_IRWXO) | - ((permissions >> 2) & S_IRWXG) | - ((permissions >> 4) & S_IRWXU) | + mode = ((permissions) & 0007) | + ((permissions >> 2) & 0070) | + ((permissions >> 4) & 0700) | ((flags & ICBTAG_FLAG_SETUID) ? S_ISUID : 0) | ((flags & ICBTAG_FLAG_SETGID) ? S_ISGID : 0) | ((flags & ICBTAG_FLAG_STICKY) ? S_ISVTX : 0); @@ -1669,9 +1669,9 @@ static int udf_update_inode(struct inode *inode, int do_sync) else fe->gid = cpu_to_le32(i_gid_read(inode)); - udfperms = ((inode->i_mode & S_IRWXO)) | - ((inode->i_mode & S_IRWXG) << 2) | - ((inode->i_mode & S_IRWXU) << 4); + udfperms = ((inode->i_mode & 0007)) | + ((inode->i_mode & 0070) << 2) | + ((inode->i_mode & 0700) << 4); udfperms |= (le32_to_cpu(fe->permissions) & (FE_PERM_O_DELETE | FE_PERM_O_CHATTR | diff --git a/fs/udf/namei.c b/fs/udf/namei.c index babf48d..385ee89 100644 --- a/fs/udf/namei.c +++ b/fs/udf/namei.c @@ -906,7 +906,7 @@ static int udf_unlink(struct inode *dir, struct dentry *dentry) static int udf_symlink(struct inode *dir, struct dentry *dentry, const char *symname) { - struct inode *inode = udf_new_inode(dir, S_IFLNK | S_IRWXUGO); + struct inode *inode = udf_new_inode(dir, S_IFLNK | 0777); struct pathComponent *pc; const char *compstart; struct extent_position epos = {};