From patchwork Thu Nov 26 10:00:23 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jan Kara X-Patchwork-Id: 7705711 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 28CA89F2E9 for ; Thu, 26 Nov 2015 10:00:37 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 6FEBA204EA for ; Thu, 26 Nov 2015 10:00:35 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 61355204AD for ; Thu, 26 Nov 2015 10:00:34 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751309AbbKZKAc (ORCPT ); Thu, 26 Nov 2015 05:00:32 -0500 Received: from mx2.suse.de ([195.135.220.15]:51801 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751060AbbKZKAa (ORCPT ); Thu, 26 Nov 2015 05:00:30 -0500 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (charybdis-ext.suse.de [195.135.220.254]) by mx2.suse.de (Postfix) with ESMTP id D3A67AB13; Thu, 26 Nov 2015 09:58:48 +0000 (UTC) Received: by quack.suse.cz (Postfix, from userid 1000) id AEB9482827; Thu, 26 Nov 2015 11:00:26 +0100 (CET) From: Jan Kara To: OGAWA Hirofumi Cc: Volker Kuhlmann , linux-fsdevel@vger.kernel.org, Jan Kara Subject: [PATCH] fat: Allow time_offset to be upto 24 hours Date: Thu, 26 Nov 2015 11:00:23 +0100 Message-Id: <1448532023-16954-1-git-send-email-jack@suse.cz> X-Mailer: git-send-email 2.1.4 Sender: linux-fsdevel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-fsdevel@vger.kernel.org X-Spam-Status: No, score=-7.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, 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 Currently we limit values of time_offset mount option to be between -12 and 12 hours. However e.g. zone GMT+12 can have a DST correction on top which makes the total time difference 13 hours. Update the checks in mount option parsing to allow offset of upto 24 hours to allow for unusual cases. Reported-by: Volker Kuhlmann Signed-off-by: Jan Kara Acked-by: OGAWA Hirofumi --- fs/fat/inode.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/fs/fat/inode.c b/fs/fat/inode.c index 509411dd3698..aa7bc11fe8fb 100644 --- a/fs/fat/inode.c +++ b/fs/fat/inode.c @@ -1146,7 +1146,12 @@ static int parse_options(struct super_block *sb, char *options, int is_vfat, case Opt_time_offset: if (match_int(&args[0], &option)) return -EINVAL; - if (option < -12 * 60 || option > 12 * 60) + /* + * GMT+-12 zones may have DST corrections so at least + * 13 hours difference is needed. Make the limit 24 + * just in case someone invents something unusual. + */ + if (option < -24 * 60 || option > 24 * 60) return -EINVAL; opts->tz_set = 1; opts->time_offset = option;