From patchwork Thu Mar 17 16:36:30 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Miklos Szeredi X-Patchwork-Id: 8613171 Return-Path: X-Original-To: patchwork-linux-fsdevel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id ED7319F3D1 for ; Thu, 17 Mar 2016 16:35:21 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 18F67202EC for ; Thu, 17 Mar 2016 16:35:21 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 29856202AE for ; Thu, 17 Mar 2016 16:35:20 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S935847AbcCQQfS (ORCPT ); Thu, 17 Mar 2016 12:35:18 -0400 Received: from mail-wm0-f45.google.com ([74.125.82.45]:37551 "EHLO mail-wm0-f45.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754367AbcCQQfR (ORCPT ); Thu, 17 Mar 2016 12:35:17 -0400 Received: by mail-wm0-f45.google.com with SMTP id p65so1720287wmp.0 for ; Thu, 17 Mar 2016 09:35:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=szeredi.hu; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=R4LPcs6igIagOMzJm61+IF6dc0Dotp1Lo4PUdG9/emo=; b=Dts8gM4TTCs2RCNQ3h3ZoSINEwdDqn70jjFDDBrFJnyT90NN7b0FvEfcyJd73z6ABw 84qhO0CzUZb0lzRS0ZMAuaxnb29PqzsFjHXzO0i0lJMfqcmEmJtI64O8aebWdP1KTGe/ efmtAIl4ibeEMdv2L0OXb+BqrZg35jVljfY1A= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=R4LPcs6igIagOMzJm61+IF6dc0Dotp1Lo4PUdG9/emo=; b=Aw2/tZPOik5IUBhrHwwA6Gow3oPPGuXxpvZLzeDw5N/WY5T3/PPbibevGuARjjlEk9 DFSS2rqopUBsWyx71wXsJ850j4ZspFFZs9nDlHcSdzB7nl4E3j6qiHkfI5MrsOGX805m 4mxHEF9kJfYIMr7dcctjliowkqBue/+1CD/Lyo0Y6TRrzHjVMmJL430UbTrvmk8h/NrK Cz1yOf0bjMPF7v+x9b8i9l26xo80yna+TSGNk39Ea85Yq3I7Ya3CkvbaY0zi8lcEGSRx P1bG4jgv/l+YfPRcJG4MPVccFM+ai7sZC8ZmFjtXIgYg5bbXWhR212209FSpgwZCk++K q7Aw== X-Gm-Message-State: AD7BkJKIy4xT7d/M9k3P5jsF4ATH3jmA6xP+mzL/C1MPYBU9q8sEJ6DYDT7Ps/TvC3DFTA== X-Received: by 10.28.179.7 with SMTP id c7mr12538421wmf.46.1458232515333; Thu, 17 Mar 2016 09:35:15 -0700 (PDT) Received: from tucsk (pool-dsl-2c-0018.externet.hu. [217.173.44.24]) by smtp.gmail.com with ESMTPSA id gk4sm8435071wjd.7.2016.03.17.09.35.13 (version=TLS1 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 17 Mar 2016 09:35:14 -0700 (PDT) Date: Thu, 17 Mar 2016 17:36:30 +0100 From: Miklos Szeredi To: Konstantin Khlebnikov Cc: linux-fsdevel@vger.kernel.org, linux-unionfs@vger.kernel.org, Alexander Viro , linux-kernel@vger.kernel.org Subject: Re: [PATCH] vfs: update atime using file->f_inode Message-ID: <20160317163630.GR8655@tucsk> References: <145424638614.10446.16013603987277558993.stgit@zurg> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <145424638614.10446.16013603987277558993.stgit@zurg> User-Agent: Mutt/1.5.21 (2010-09-15) Sender: linux-fsdevel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-fsdevel@vger.kernel.org X-Spam-Status: No, score=-6.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,RP_MATCHES_RCVD,T_DKIM_INVALID,UNPARSEABLE_RELAY autolearn=ham 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 On Sun, Jan 31, 2016 at 04:19:46PM +0300, Konstantin Khlebnikov wrote: > This fixes some cases of missing atime update for overlayfs. Problem is it will update atime on lower layer, even if it's explicitly marked read-only. Which I think is a pretty bad breakage of assumptions. The following patch updates atime (untested) but only in the upper layer. Obviously it makes no sense to copy-up due to an atime update. Thanks, Miklos --- fs/overlayfs/inode.c | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) -- To unsubscribe from this list: send the line "unsubscribe linux-fsdevel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html --- a/fs/overlayfs/inode.c +++ b/fs/overlayfs/inode.c @@ -370,6 +370,27 @@ struct inode *ovl_d_select_inode(struct return d_backing_inode(realpath.dentry); } +static int ovl_update_time(struct inode *inode, struct timespec *ts, int flags) +{ + struct dentry *alias; + struct path upperpath; + + if (!(flags & S_ATIME)) + return 0; + + alias = d_find_any_alias(inode); + if (!alias) + return 0; + + ovl_path_upper(alias, &upperpath); + if (!upperpath.dentry) + return 0; + + touch_atime(&upperpath); + + return 0; +} + static const struct inode_operations ovl_file_inode_operations = { .setattr = ovl_setattr, .permission = ovl_permission, @@ -378,6 +399,7 @@ static const struct inode_operations ovl .getxattr = ovl_getxattr, .listxattr = ovl_listxattr, .removexattr = ovl_removexattr, + .update_time = ovl_update_time, }; static const struct inode_operations ovl_symlink_inode_operations = {