From patchwork Thu Aug 1 18:05:18 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Steve French X-Patchwork-Id: 11071223 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 100891398 for ; Thu, 1 Aug 2019 18:05:33 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id E4C1F28721 for ; Thu, 1 Aug 2019 18:05:32 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id D6A0928725; Thu, 1 Aug 2019 18:05:32 +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=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=ham 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 7D33628721 for ; Thu, 1 Aug 2019 18:05:32 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731751AbfHASFc (ORCPT ); Thu, 1 Aug 2019 14:05:32 -0400 Received: from mail-pf1-f181.google.com ([209.85.210.181]:45450 "EHLO mail-pf1-f181.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731642AbfHASFb (ORCPT ); Thu, 1 Aug 2019 14:05:31 -0400 Received: by mail-pf1-f181.google.com with SMTP id r1so34508440pfq.12 for ; Thu, 01 Aug 2019 11:05:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:from:date:message-id:subject:to; bh=8PVvDn0maAZc6h+BgmIISTOgbBMcqChs55h834excoc=; b=O3BEhvXLyy5WVCfweklv/hkcP+VfRHQ2aTnL84LS8KPfixInzoLpyTkiL1OT4T+eiA XN4ITeDWzp3bZE3OPXHChrCD48rtkdq55G8qCkgfNGeaktCbaAq2+TOt4S/lzLOtsX6+ 9rLVZ3Cd13nxkFTY84VuE65u50r3wbPsoUKW6NHWvz7UOwX4vGeHoIe+LaGHL+lPDPDZ WuYsdOnYklgC9olmY6fJedhjjcBmyA8qKeZrZ4T/TEI2nLm21s7OEaS91ojD24tSfAhI drhyd3Xj8CBQkmJNPaqI/BRmEBapze+z9VMGWFGKtv5U6wyJS2pv1H+gCcWi71PRNDRF 9ZpQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:from:date:message-id:subject:to; bh=8PVvDn0maAZc6h+BgmIISTOgbBMcqChs55h834excoc=; b=YwbnAoXLPcq7eV08IIWH5ImMCghmujYiM5lTONhs4zapBLMij0ASCMs2wrb1G5VuQW eMXUbAhQH76C2wDzmDzfpLVEGksWHKl4oJXCZ7mKrDmufYLubTMwdjIBH454dRD6Oxr9 fH1fZO/rgeWMozKdqENw4JGx9kkUZYM3Nd4gR8IODxGzVaJHJHm44SIb0yzzAtklaiIG 490OqsST4Y31OYJMBDpWHOy1teTAqKWEC0BJSDQo56OrqPCPwh/3ET9A0ZVnbsCU19w7 1YPSQhHr9mrlU5UJeFvn16i8peQCOptR0mkg7L9Xl8AtVTRK9Ukla80mcK2l73fnEsie u3uw== X-Gm-Message-State: APjAAAXKK/UYZPQVOC6YKIgnBJaM5N6tBfhFv4SM7RaMwYzejARsayw9 UFvgZvaE5PMP9R5v2lo/QxBjdZJayaEXtA5dG6lX9lml X-Google-Smtp-Source: APXvYqxAcFbVBakEmMCwnjhh9I2/CC4OG9QP9qQzFWB2RtzUMDR6T8jj8uFyeKv2FOrB8nLWBfWNixoQP4wzB/RNnNw= X-Received: by 2002:a63:7245:: with SMTP id c5mr107264130pgn.11.1564682730715; Thu, 01 Aug 2019 11:05:30 -0700 (PDT) MIME-Version: 1.0 From: Steve French Date: Thu, 1 Aug 2019 13:05:18 -0500 Message-ID: Subject: [PATCH][WIP] do not ignore error on setinfo for chmod To: CIFS Sender: linux-cifs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-cifs@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP We were incorrectly skipping errors in some cases in cifs_settattr_nounix From d8423388e07b16dc508ed453637879f47bebd1b1 Mon Sep 17 00:00:00 2001 From: Steve French Date: Thu, 1 Aug 2019 12:21:14 -0500 Subject: [PATCH] cifs: fix error handling on chmod We were ignoring errors on chmod due to incorrect check of which attributes were being changed (certain timestamp setting errors can be safely ignored but not chmod). Signed-off-by: Steve French --- fs/cifs/inode.c | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/fs/cifs/inode.c b/fs/cifs/inode.c index 26cdfbf1e164..25a5aeddc09a 100644 --- a/fs/cifs/inode.c +++ b/fs/cifs/inode.c @@ -2559,12 +2559,14 @@ cifs_setattr_nounix(struct dentry *direntry, struct iattr *attrs) /* BB: check for rc = -EOPNOTSUPP and switch to legacy mode */ /* Even if error on time set, no sense failing the call if - the server would set the time to a reasonable value anyway, - and this check ensures that we are not being called from - sys_utimes in which case we ought to fail the call back to - the user when the server rejects the call */ - if ((rc) && (attrs->ia_valid & - (ATTR_MODE | ATTR_GID | ATTR_UID | ATTR_SIZE))) + * the server would set the time to a reasonable value anyway. + * TODO check if check to ensure that are not being called from + * sys_utimes (in which case we ought to fail the call when the + * server rejects the call) is correct. We do want + * to return an rc if error setting mode or owner or size + */ + if (rc && ((attrs->ia_valid & + (ATTR_MODE | ATTR_GID | ATTR_UID | ATTR_SIZE)) == 0)) rc = 0; } -- 2.20.1