From: "Sylvain 'ythier' Hitier" <sylvain.hitier@gmail.com>
To: linux-kernel@vger.kernel.org
Cc: Andy Lutomirski <luto@amacapital.net>
Subject: [PATCH] Ensure prepare_update_cmtime() returns an initialized value (was: Re: [PATCH v4 2/7] fs: Add inode_update_time_writable)
Date: Wed, 4 Sep 2013 20:27:47 +0200 [thread overview]
Message-ID: <20130904182747.GB7024@begonia> (raw)
In-Reply-To: <dd275081395986c38e577b6db4c4dd8cb42dde93.1377193658.git.luto@amacapital.net>
Hello,
This is to apply on top of
"[PATCH v4 2/7] fs: Add inode_update_time_writable"
dated Thu, 22 Aug 2013 17:03:18 -0700
Ensure prepare_update_cmtime() returns an initialized value.
While at it:
- always use sync_it var as a bitfield
- remove useless test
Signed-off-by: Sylvain "ythier" Hitier <sylvain.hitier@gmail.com>
---
fs/inode.c | 7 ++-----
1 files changed, 2 insertions(+), 5 deletions(-)
diff --git a/fs/inode.c b/fs/inode.c
index 2bbcb19..edf225c 100644
--- a/fs/inode.c
+++ b/fs/inode.c
@@ -1643,7 +1643,7 @@ EXPORT_SYMBOL(file_remove_suid);
*/
static int prepare_update_cmtime(struct inode *inode, struct timespec *now)
{
- int sync_it;
+ int sync_it = 0;
/* First try to exhaust all avenues to not sync */
if (IS_NOCMTIME(inode))
@@ -1651,7 +1651,7 @@ static int prepare_update_cmtime(struct inode *inode, struct timespec *now)
*now = current_fs_time(inode->i_sb);
if (!timespec_equal(&inode->i_mtime, now))
- sync_it = S_MTIME;
+ sync_it |= S_MTIME;
if (!timespec_equal(&inode->i_ctime, now))
sync_it |= S_CTIME;
@@ -1659,9 +1659,6 @@ static int prepare_update_cmtime(struct inode *inode, struct timespec *now)
if (IS_I_VERSION(inode))
sync_it |= S_VERSION;
- if (!sync_it)
- return 0;
-
return sync_it;
}
Regards,
Sylvain "ythier" Hitier
--
Business is about being busy, not being rich...
Lived 777 days in a Debian package => http://en.wikipedia.org/wiki/Apt,_Vaucluse
There's THE room for ideals in this mechanical place!
next prev parent reply other threads:[~2013-09-04 18:27 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-08-23 0:03 [PATCH v3 0/5] Rework mtime and ctime updates on mmaped writes Andy Lutomirski
2013-08-23 0:03 ` [PATCH v4 1/7] mm: Track mappings that have been written via ptes Andy Lutomirski
2013-08-23 0:03 ` [PATCH v4 2/7] fs: Add inode_update_time_writable Andy Lutomirski
2013-09-04 18:27 ` Sylvain 'ythier' Hitier [this message]
2013-09-04 18:30 ` [PATCH] Ensure prepare_update_cmtime() returns an initialized value (was: Re: [PATCH v4 2/7] fs: Add inode_update_time_writable) Andy Lutomirski
2013-08-23 0:03 ` [PATCH v4 3/7] mm: Allow filesystems to defer cmtime updates Andy Lutomirski
2013-09-04 14:57 ` Jan Kara
2013-09-04 17:54 ` Andy Lutomirski
2013-09-04 19:20 ` Jan Kara
2013-09-04 20:05 ` Andy Lutomirski
2013-08-23 0:03 ` [PATCH v4 4/7] mm: Scan for dirty ptes and update cmtime on MS_ASYNC Andy Lutomirski
2013-08-23 0:03 ` [PATCH v4 5/7] ext4: Defer mmap cmtime updates Andy Lutomirski
2013-08-23 0:03 ` [PATCH v4 6/7] btrfs: " Andy Lutomirski
2013-08-23 0:03 ` [PATCH v4 7/7] xfs: " Andy Lutomirski
2013-08-23 1:12 ` [PATCH v3 0/5] Rework mtime and ctime updates on mmaped writes Andy Lutomirski
2013-09-04 14:06 ` Jan Kara
2013-09-04 15:08 ` Jan Kara
2013-09-04 17:33 ` Andy Lutomirski
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20130904182747.GB7024@begonia \
--to=sylvain.hitier@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=luto@amacapital.net \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox