From patchwork Mon Oct 30 19:02:06 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mike Marshall X-Patchwork-Id: 10033039 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 45BA860291 for ; Mon, 30 Oct 2017 19:02:11 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 36763286B4 for ; Mon, 30 Oct 2017 19:02:11 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 2A08C28814; Mon, 30 Oct 2017 19:02:11 +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.4 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, RCVD_IN_DNSWL_HI, RCVD_IN_SORBS_SPAM 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 A719C286B4 for ; Mon, 30 Oct 2017 19:02:10 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932627AbdJ3TCJ (ORCPT ); Mon, 30 Oct 2017 15:02:09 -0400 Received: from mail-yw0-f193.google.com ([209.85.161.193]:48801 "EHLO mail-yw0-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932490AbdJ3TCI (ORCPT ); Mon, 30 Oct 2017 15:02:08 -0400 Received: by mail-yw0-f193.google.com with SMTP id q1so12545700ywh.5 for ; Mon, 30 Oct 2017 12:02:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=omnibond-com.20150623.gappssmtp.com; s=20150623; h=mime-version:from:date:message-id:subject:to; bh=P0cGZ3XSYkLl2qMGFqe5k4BH7iu5g6++bqK3PTo5qHA=; b=gvCQCd6uJf2MxVUW/Qzfy84e0m0/wXyQexiBQI+d0ege8H1IArPQ6+80YqtheuCEIT veQlQlkaXTaTU6JKjuyXwyO630/a+u8nyO2LDoOiORbh7eFPQIBnlXEJlRnCc47pra/V KyyTqEV1nzkFp/TZ731OZ6z+cNIR65NKNDN02O64lVQDs5zxgOzayCe5Bz4jWzfaFOrI /okcW+b6ZGw1N15YSgtsfxz+j+peLBSfBzC2ofVRJt/a5j00lUq92uZynX2naI84iLNh hNsFGxB3rb4TmyOheFrKNqP3JtvOOwLTcLLSctujNQ2JjEBB0uicXc8bV+oVnIuy7Exs PhVw== 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=P0cGZ3XSYkLl2qMGFqe5k4BH7iu5g6++bqK3PTo5qHA=; b=SVR5tDTnKy6LpyKB2JfGqLzSl4ediiGOF7Nwdmks71UCHLh0Q01hvel2l4RWwXrrFO xgd/XLxFC6wQemayzVdLKjkt/w7TY29U/P2ZNCHBfCcjzdBQRBp8DaG1giG00zlVX0+6 wwGRkgF8Z6CfmV6f2v99RXwwp4P1Q3TL9DDXEwmwnJV1arLLOX0z1b0L1waoH+pvwDvq a0k75ypptPExPtFa8ntuFv01IzS2TygIpk3ngkOfJKE44Rs3ONB+Ogl4GPE/x81h+r07 gijfgz85tH6yFKN3Dftt5ksVSMgGziCdtxzQVhyIOMiJiVcLSCg04UfYKbixr5eBG+AY 1OqQ== X-Gm-Message-State: AMCzsaWq/XisqsFbYuav5LdPgoZOa0UdfcruKQfVYP+CRtZzr7uu4H/l jeAVtfwO3iWTOjnPQZK/yKvyf+cH0w2CAAofVxOeBZmw X-Google-Smtp-Source: ABhQp+QAZwstRjUGZdzsPmtBRqrNJRbdKNgJ6bXdSfp/DT8Kj6DkLNIgRVegRZD3njfA/ewKdrRi4hO6vg1WOgrKEGo= X-Received: by 10.37.22.65 with SMTP id 62mr7237521ybw.410.1509390127209; Mon, 30 Oct 2017 12:02:07 -0700 (PDT) MIME-Version: 1.0 Received: by 10.37.129.68 with HTTP; Mon, 30 Oct 2017 12:02:06 -0700 (PDT) From: Mike Marshall Date: Mon, 30 Oct 2017 15:02:06 -0400 Message-ID: Subject: [RFC] don't update atime on file write... To: linux-fsdevel , Mike Marshall , Martin Brandenburg 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 I've been working with xfstests generic/003. It contains numerous tests. For example, we were updating atime on a directory when a new file was created in the directory. It "makes sense", but it was easy to google "open posix" and see that it was wrong: If O_CREAT is set and the file did not previously exist, upon successful completion, open() shall mark for update the st_atime, st_ctime, and st_mtime fields of the file and the st_ctime and st_mtime fields of the parent directory. We fixed the above in the server. Another thing we've been doing wrong is to update atime when a file is modified. Google "write posix" to the rescue again: Upon successful completion, where nbyte is greater than 0, write() shall mark for update the st_ctime and st_mtime fields of the file, and if the file is a regular file, the S_ISUID and S_ISGID bits of the file mode may be cleared. This makes the test pass, and I don't see that it has any bad side effects, does it seem OK to you all? -Mike diff --git a/fs/orangefs/file.c b/fs/orangefs/file.c index 336ecbf..009fce0 100644 --- a/fs/orangefs/file.c +++ b/fs/orangefs/file.c @@ -384,7 +384,9 @@ static ssize_t do_readv_writev(enum ORANGEFS_io_type type, struct file *file, } else { SetMtimeFlag(orangefs_inode); inode->i_mtime = current_time(inode); +/* mark_inode_dirty_sync(inode); +*/ } }