From c.affolter@purplehaze.ch Mon Feb 1 02:59:47 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=ham version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay2.corp.sgi.com [137.38.102.29]) by oss.sgi.com (Postfix) with ESMTP id 4E8EC7CA3 for ; Mon, 1 Feb 2016 02:59:47 -0600 (CST) Received: from cuda.sgi.com (cuda1.sgi.com [192.48.157.11]) by relay2.corp.sgi.com (Postfix) with ESMTP id 22A5E304051 for ; Mon, 1 Feb 2016 00:59:43 -0800 (PST) X-ASG-Debug-ID: 1454317174-04bdf04d6b1e0690001-NocioJ Received: from mail.stepping-stone.ch (mail.stepping-stone.ch [194.176.109.206]) by cuda.sgi.com with ESMTP id IRyalYA4O82PMJvI (version=TLSv1 cipher=ECDHE-RSA-AES256-SHA bits=256 verify=NO) for ; Mon, 01 Feb 2016 00:59:35 -0800 (PST) X-Barracuda-Envelope-From: c.affolter@purplehaze.ch X-Barracuda-Apparent-Source-IP: 194.176.109.206 Received: from localhost (janitor-01.int.stepping-stone.ch [10.17.98.12]) by mta-01.int.stepping-stone.ch (Postfix) with ESMTP id E92D666226; Mon, 1 Feb 2016 09:59:33 +0100 (CET) X-Virus-Scanned: amavisd-new at stepping-stone.ch Received: from mta-01.int.stepping-stone.ch ([10.17.98.30]) by localhost (janitor-01.int.stepping-stone.ch [10.17.98.12]) (amavisd-new, port 10026) with LMTP id mRUB3NLIYR8H; Mon, 1 Feb 2016 09:59:24 +0100 (CET) Received: from [10.84.1.149] (224.109.22.178.ftth.as8758.net [178.22.109.224]) (using TLSv1 with cipher ECDHE-RSA-AES128-SHA (128/128 bits)) (Client did not present a certificate) by smtp.stepping-stone.ch (Postfix) with ESMTPSA id E653266224; Mon, 1 Feb 2016 09:59:23 +0100 (CET) Subject: Re: Random write result differences between RAID device and XFS To: Dave Chinner X-ASG-Orig-Subj: Re: Random write result differences between RAID device and XFS References: <56AB44AF.8020807@purplehaze.ch> <20160129222553.GK20456@dastard> <56AC93EC.80202@purplehaze.ch> <20160201054639.GU6033@dastard> Cc: xfs@oss.sgi.com From: Christian Affolter X-Enigmail-Draft-Status: N1110 Message-ID: <56AF1E6B.5090402@purplehaze.ch> Date: Mon, 1 Feb 2016 09:59:23 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.5.0 MIME-Version: 1.0 In-Reply-To: <20160201054639.GU6033@dastard> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit X-Barracuda-Connect: mail.stepping-stone.ch[194.176.109.206] X-Barracuda-Start-Time: 1454317175 X-Barracuda-Encrypted: ECDHE-RSA-AES256-SHA X-Barracuda-URL: https://192.48.157.11:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-BRTS-Status: 1 X-Barracuda-Spam-Score: 0.00 X-Barracuda-Spam-Status: No, SCORE=0.00 using per-user scores of TAG_LEVEL=1000.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.7 tests=BSF_SC0_MISMATCH_TO X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.3.26641 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 0.00 BSF_SC0_MISMATCH_TO Envelope rcpt doesn't match header Hello Dave, On 01.02.2016 06:46, Dave Chinner wrote: > On Sat, Jan 30, 2016 at 11:43:56AM +0100, Christian Affolter wrote: >> Hi Dave, >> >> On 29.01.2016 23:25, Dave Chinner wrote: >>> On Fri, Jan 29, 2016 at 11:53:35AM +0100, Christian Affolter wrote: >>>> Hi everyone, >>>> >>>> I'm trying to understand the differences of some bandwidth and IOPs test >>>> results I see while running a random-write full-stripe-width aligned fio >>>> test (using libaio with direct IO) on a hardware RAID 6 raw device >>>> versus on the same device with the XFS file system on top of it. >>>> >>>> On the raw device I get: >>>> write: io=24828MB, bw=423132KB/s, iops=137, runt= 60085msec >>>> >>>> With XFS on top of it: >>>> write: io=14658MB, bw=249407KB/s, iops=81, runt= 60182msec >>> >>> Now repeat with a file that is contiguously allocated before you >>> start. And also perhaps with the "swalloc" mount option. >> >> Wow, thanks! After specifying --fallocate=none (instead of the default >> fallocate=posix), bandwidth and iops increases and are even higher than >> on the raw device: >> >> write: io=30720MB, bw=599232KB/s, iops=195, runt= 52496msec >> >> I'm eager to learn what's going on behind the scenes, can you give a >> short explanation? > > Usually when concurrent direct IO writes are slower than the raw > device it's because something is causing IO submission > serialisation. Usually that's to do with writes that extend the > file because that can require the inode to be locked exclusively. > Whatever behaviour the fio configuration change modifed, it removed > the IO submission serialisation and so it's now running at full disk > speed. > > As to why XFS is faster than the raw block device, the XFS file > is only 30GB, so the random writes are only seeking a short > distance compared to the block device test which is seeking across > the whole device. > >> Btw. mounting the volume with "swalloc" didn't make any change. > > Which means there is no performance differential between stripe unit > and stripe width aligned writes in this test on your hardware. Thank you so much for the detailed explanation and taking the time to help. Best, Chris From cmaiolino@redhat.com Mon Feb 1 03:42:24 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=ham version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay2.corp.sgi.com [137.38.102.29]) by oss.sgi.com (Postfix) with ESMTP id C1C5A7CA3 for ; Mon, 1 Feb 2016 03:42:24 -0600 (CST) Received: from cuda.sgi.com (cuda1.sgi.com [192.48.157.11]) by relay2.corp.sgi.com (Postfix) with ESMTP id 5AD07304043 for ; Mon, 1 Feb 2016 01:42:21 -0800 (PST) X-ASG-Debug-ID: 1454319738-04bdf04d6a1e1ec0001-NocioJ Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by cuda.sgi.com with ESMTP id TCTgIBBQPVmj3nVe (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO) for ; Mon, 01 Feb 2016 01:42:18 -0800 (PST) X-Barracuda-Envelope-From: cmaiolino@redhat.com X-Barracuda-Apparent-Source-IP: 209.132.183.28 X-ASG-Whitelist: Client Received: from int-mx13.intmail.prod.int.phx2.redhat.com (int-mx13.intmail.prod.int.phx2.redhat.com [10.5.11.26]) by mx1.redhat.com (Postfix) with ESMTPS id 2ED105A73; Mon, 1 Feb 2016 09:42:18 +0000 (UTC) Received: from redhat.com (dhcp-26-103.brq.redhat.com [10.34.26.103]) by int-mx13.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id u119gEJk003406 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Mon, 1 Feb 2016 04:42:17 -0500 Date: Mon, 1 Feb 2016 10:42:14 +0100 From: Carlos Maiolino To: Eric Sandeen Cc: xfs@oss.sgi.com Subject: Re: [PATCH] xfs: Split default quota limits by quota type V3 Message-ID: <20160201094214.GA8141@redhat.com> X-ASG-Orig-Subj: Re: [PATCH] xfs: Split default quota limits by quota type V3 Mail-Followup-To: Eric Sandeen , xfs@oss.sgi.com References: <1454000266-22541-1-git-send-email-cmaiolino@redhat.com> <56AA51B7.7030403@sandeen.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <56AA51B7.7030403@sandeen.net> User-Agent: Mutt/1.5.24 (2015-08-30) X-Scanned-By: MIMEDefang 2.68 on 10.5.11.26 X-Barracuda-Connect: mx1.redhat.com[209.132.183.28] X-Barracuda-Start-Time: 1454319738 X-Barracuda-Encrypted: ECDHE-RSA-AES256-GCM-SHA384 X-Barracuda-URL: https://192.48.157.11:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-BRTS-Status: 1 On Thu, Jan 28, 2016 at 11:36:55AM -0600, Eric Sandeen wrote: > On 1/28/16 10:57 AM, Carlos Maiolino wrote: > > Default quotas are globally set due historical reasons. IRIX only supported user > > and project quotas, and default quota was only applied to user quotas. > > > > In Linux, when a default quota is set, all different quota types inherits the > > same default value. > > > > An user with a quota limit larger than the default quota value, will still be > > limited to the default value because the group quotas also inherits the default > > quotas. Unless the group which the user belongs to have a custom quota limit > > set. > > > > This patch aims to split the default quota value by quota type. Allowing each > > quota type having different default values. > > > > Default time limits are still set globally. XFS does not set a per-user/group > > timer, but a single global timer. For changing this behavior, some changes > > should be made in user-space tools another bugs being fixed. > > Some minor comments about comments below. But the code looks fine to me, > so: > > Reviewed-by: Eric Sandeen > > and if you want to fix the comments & resend w/ my review tag I think that'd > be ok. > > Care to write an xfstests testcase for the default quota limit while you're > at it? > Thanks, I'll fix the comments and resend it. I sometimes overcomment (if that word even exists:) code, I'll fix that up. Regarding xfstests, indeed, I'll write a xfstest for it. Cheers. > Thanks, > -Eric > > > Changelog: > > > > V2 - Remove comment about old behavior > > V3 - Keep time limit configuration inside xfs_qm_init_quotainfo to keep > > the current behavior of quota timers > > > > Signed-off-by: Carlos Maiolino > > --- > > fs/xfs/xfs_dquot.c | 26 +++++++++++--------- > > fs/xfs/xfs_qm.c | 64 +++++++++++++++++++++++++++++++++++------------- > > fs/xfs/xfs_qm.h | 34 ++++++++++++++++++++----- > > fs/xfs/xfs_qm_syscalls.c | 15 +++++++----- > > fs/xfs/xfs_trans_dquot.c | 15 +++++++----- > > 5 files changed, 107 insertions(+), 47 deletions(-) > > > > diff --git a/fs/xfs/xfs_dquot.c b/fs/xfs/xfs_dquot.c > > index 9c44d38..23f551b 100644 > > --- a/fs/xfs/xfs_dquot.c > > +++ b/fs/xfs/xfs_dquot.c > > @@ -92,26 +92,28 @@ xfs_qm_adjust_dqlimits( > > { > > struct xfs_quotainfo *q = mp->m_quotainfo; > > struct xfs_disk_dquot *d = &dq->q_core; > > + struct xfs_def_quota *defq; > > int prealloc = 0; > > > > ASSERT(d->d_id); > > + defq = xfs_get_defquota(dq, q); > > > > - if (q->qi_bsoftlimit && !d->d_blk_softlimit) { > > - d->d_blk_softlimit = cpu_to_be64(q->qi_bsoftlimit); > > + if (defq->bsoftlimit && !d->d_blk_softlimit) { > > + d->d_blk_softlimit = cpu_to_be64(defq->bsoftlimit); > > prealloc = 1; > > } > > - if (q->qi_bhardlimit && !d->d_blk_hardlimit) { > > - d->d_blk_hardlimit = cpu_to_be64(q->qi_bhardlimit); > > + if (defq->bhardlimit && !d->d_blk_hardlimit) { > > + d->d_blk_hardlimit = cpu_to_be64(defq->bhardlimit); > > prealloc = 1; > > } > > - if (q->qi_isoftlimit && !d->d_ino_softlimit) > > - d->d_ino_softlimit = cpu_to_be64(q->qi_isoftlimit); > > - if (q->qi_ihardlimit && !d->d_ino_hardlimit) > > - d->d_ino_hardlimit = cpu_to_be64(q->qi_ihardlimit); > > - if (q->qi_rtbsoftlimit && !d->d_rtb_softlimit) > > - d->d_rtb_softlimit = cpu_to_be64(q->qi_rtbsoftlimit); > > - if (q->qi_rtbhardlimit && !d->d_rtb_hardlimit) > > - d->d_rtb_hardlimit = cpu_to_be64(q->qi_rtbhardlimit); > > + if (defq->isoftlimit && !d->d_ino_softlimit) > > + d->d_ino_softlimit = cpu_to_be64(defq->isoftlimit); > > + if (defq->ihardlimit && !d->d_ino_hardlimit) > > + d->d_ino_hardlimit = cpu_to_be64(defq->ihardlimit); > > + if (defq->rtbsoftlimit && !d->d_rtb_softlimit) > > + d->d_rtb_softlimit = cpu_to_be64(defq->rtbsoftlimit); > > + if (defq->rtbhardlimit && !d->d_rtb_hardlimit) > > + d->d_rtb_hardlimit = cpu_to_be64(defq->rtbhardlimit); > > > > if (prealloc) > > xfs_dquot_set_prealloc_limits(dq); > > diff --git a/fs/xfs/xfs_qm.c b/fs/xfs/xfs_qm.c > > index 532ab79..4cbb22b 100644 > > --- a/fs/xfs/xfs_qm.c > > +++ b/fs/xfs/xfs_qm.c > > @@ -560,6 +560,37 @@ xfs_qm_shrink_count( > > return list_lru_shrink_count(&qi->qi_lru, sc); > > } > > > > +STATIC void > > +xfs_qm_set_defquota( > > + xfs_mount_t *mp, > > + uint type, > > + xfs_quotainfo_t *qinf) > > +{ > > + xfs_dquot_t *dqp; > > + struct xfs_def_quota *defq; > > + int error; > > + > > + error = xfs_qm_dqread(mp, 0, type, XFS_QMOPT_DOWARN, &dqp); > > + > > + if (!error) { > > + xfs_disk_dquot_t *ddqp = &dqp->q_core; > > + > > + defq = xfs_get_defquota(dqp, qinf); > > + > > + /* > > + * Timers and warnings have been already set, let's just set the > > + * default limits for this quota type > > + */ > > + defq->bhardlimit = be64_to_cpu(ddqp->d_blk_hardlimit); > > + defq->bsoftlimit = be64_to_cpu(ddqp->d_blk_softlimit); > > + defq->ihardlimit = be64_to_cpu(ddqp->d_ino_hardlimit); > > + defq->isoftlimit = be64_to_cpu(ddqp->d_ino_softlimit); > > + defq->rtbhardlimit = be64_to_cpu(ddqp->d_rtb_hardlimit); > > + defq->rtbsoftlimit = be64_to_cpu(ddqp->d_rtb_softlimit); > > + xfs_qm_dqdestroy(dqp); > > + } > > +} > > + > > /* > > * This initializes all the quota information that's kept in the > > * mount structure > > @@ -606,27 +637,22 @@ xfs_qm_init_quotainfo( > > * We try to get the limits from the superuser's limits fields. > > * This is quite hacky, but it is standard quota practice. > > * > > - * We look at the USR dquot with id == 0 first, but if user quotas > > - * are not enabled we goto the GRP dquot with id == 0. > > - * We don't really care to keep separate default limits for user > > - * and group quotas, at least not at this point. > > - * > > * Since we may not have done a quotacheck by this point, just read > > * the dquot without attaching it to any hashtables or lists. > > + * > > + * Timers and warnings are globally set by the first timer found in > > + * user/group/proj quota types, otherwise a default value is used. > > + * This should be splitted into different fields per quota type. > > s/splitted/split/ > > > */ > > error = xfs_qm_dqread(mp, 0, > > XFS_IS_UQUOTA_RUNNING(mp) ? XFS_DQ_USER : > > (XFS_IS_GQUOTA_RUNNING(mp) ? XFS_DQ_GROUP : > > XFS_DQ_PROJ), > > XFS_QMOPT_DOWARN, &dqp); > > + > > if (!error) { > > xfs_disk_dquot_t *ddqp = &dqp->q_core; > > > > - /* > > - * The warnings and timers set the grace period given to > > - * a user or group before he or she can not perform any > > - * more writing. If it is zero, a default is used. > > - */ > > Not sure why you removed this comment? > > > qinf->qi_btimelimit = ddqp->d_btimer ? > > be32_to_cpu(ddqp->d_btimer) : XFS_QM_BTIMELIMIT; > > qinf->qi_itimelimit = ddqp->d_itimer ? > > @@ -639,13 +665,6 @@ xfs_qm_init_quotainfo( > > be16_to_cpu(ddqp->d_iwarns) : XFS_QM_IWARNLIMIT; > > qinf->qi_rtbwarnlimit = ddqp->d_rtbwarns ? > > be16_to_cpu(ddqp->d_rtbwarns) : XFS_QM_RTBWARNLIMIT; > > - qinf->qi_bhardlimit = be64_to_cpu(ddqp->d_blk_hardlimit); > > - qinf->qi_bsoftlimit = be64_to_cpu(ddqp->d_blk_softlimit); > > - qinf->qi_ihardlimit = be64_to_cpu(ddqp->d_ino_hardlimit); > > - qinf->qi_isoftlimit = be64_to_cpu(ddqp->d_ino_softlimit); > > - qinf->qi_rtbhardlimit = be64_to_cpu(ddqp->d_rtb_hardlimit); > > - qinf->qi_rtbsoftlimit = be64_to_cpu(ddqp->d_rtb_softlimit); > > - > > xfs_qm_dqdestroy(dqp); > > } else { > > qinf->qi_btimelimit = XFS_QM_BTIMELIMIT; > > @@ -656,6 +675,17 @@ xfs_qm_init_quotainfo( > > qinf->qi_rtbwarnlimit = XFS_QM_RTBWARNLIMIT; > > } > > > > + /* > > + * Default quota values are set by quota type, timer and warn limits > > + * have already been setpreviously, no need for error check here. > > "set previously" - and, not sure the comment about error checking is needed. > Previously, if we couldn't read the inode, we set timers but no limits. > And the limits were (and still are) zalloc'd so it's safe to ignore > the errors, I guess. > > > > + */ > > + if (XFS_IS_UQUOTA_RUNNING(mp)) > > + xfs_qm_set_defquota(mp, XFS_DQ_USER, qinf); > > + if (XFS_IS_GQUOTA_RUNNING(mp)) > > + xfs_qm_set_defquota(mp, XFS_DQ_GROUP, qinf); > > + if (XFS_IS_PQUOTA_RUNNING(mp)) > > + xfs_qm_set_defquota(mp, XFS_DQ_PROJ, qinf); > > + > > qinf->qi_shrinker.count_objects = xfs_qm_shrink_count; > > qinf->qi_shrinker.scan_objects = xfs_qm_shrink_scan; > > qinf->qi_shrinker.seeks = DEFAULT_SEEKS; > > diff --git a/fs/xfs/xfs_qm.h b/fs/xfs/xfs_qm.h > > index 996a040..45e2c36 100644 > > --- a/fs/xfs/xfs_qm.h > > +++ b/fs/xfs/xfs_qm.h > > @@ -53,6 +53,15 @@ extern struct kmem_zone *xfs_qm_dqtrxzone; > > */ > > #define XFS_DQUOT_CLUSTER_SIZE_FSB (xfs_filblks_t)1 > > > > +struct xfs_def_quota { > > + xfs_qcnt_t bhardlimit; /* default data blk hard limit */ > > + xfs_qcnt_t bsoftlimit; /* default data blk soft limit */ > > + xfs_qcnt_t ihardlimit; /* default inode count hard limit */ > > + xfs_qcnt_t isoftlimit; /* default inode count soft limit */ > > + xfs_qcnt_t rtbhardlimit; /* default realtime blk hard limit */ > > + xfs_qcnt_t rtbsoftlimit; /* default realtime blk soft limit */ > > +}; > > + > > /* > > * Various quota information for individual filesystems. > > * The mount structure keeps a pointer to this. > > @@ -76,12 +85,9 @@ typedef struct xfs_quotainfo { > > struct mutex qi_quotaofflock;/* to serialize quotaoff */ > > xfs_filblks_t qi_dqchunklen; /* # BBs in a chunk of dqs */ > > uint qi_dqperchunk; /* # ondisk dqs in above chunk */ > > - xfs_qcnt_t qi_bhardlimit; /* default data blk hard limit */ > > - xfs_qcnt_t qi_bsoftlimit; /* default data blk soft limit */ > > - xfs_qcnt_t qi_ihardlimit; /* default inode count hard limit */ > > - xfs_qcnt_t qi_isoftlimit; /* default inode count soft limit */ > > - xfs_qcnt_t qi_rtbhardlimit;/* default realtime blk hard limit */ > > - xfs_qcnt_t qi_rtbsoftlimit;/* default realtime blk soft limit */ > > + struct xfs_def_quota qi_usr_default; > > + struct xfs_def_quota qi_grp_default; > > + struct xfs_def_quota qi_prj_default; > > struct shrinker qi_shrinker; > > } xfs_quotainfo_t; > > > > @@ -171,4 +177,20 @@ extern int xfs_qm_scall_setqlim(struct xfs_mount *, xfs_dqid_t, uint, > > extern int xfs_qm_scall_quotaon(struct xfs_mount *, uint); > > extern int xfs_qm_scall_quotaoff(struct xfs_mount *, uint); > > > > +static inline struct xfs_def_quota * > > +xfs_get_defquota(struct xfs_dquot *dqp, struct xfs_quotainfo *qi) > > +{ > > + struct xfs_def_quota *defq; > > + > > + if (XFS_QM_ISUDQ(dqp)) > > + defq = &qi->qi_usr_default; > > + else if (XFS_QM_ISGDQ(dqp)) > > + defq = &qi->qi_grp_default; > > + else { > > + ASSERT(XFS_QM_ISPDQ(dqp)); > > + defq = &qi->qi_prj_default; > > + } > > + return defq; > > +} > > + > > #endif /* __XFS_QM_H__ */ > > diff --git a/fs/xfs/xfs_qm_syscalls.c b/fs/xfs/xfs_qm_syscalls.c > > index 3640c6e..31830f0 100644 > > --- a/fs/xfs/xfs_qm_syscalls.c > > +++ b/fs/xfs/xfs_qm_syscalls.c > > @@ -404,6 +404,7 @@ xfs_qm_scall_setqlim( > > struct xfs_disk_dquot *ddq; > > struct xfs_dquot *dqp; > > struct xfs_trans *tp; > > + struct xfs_def_quota *defq; > > int error; > > xfs_qcnt_t hard, soft; > > > > @@ -431,6 +432,8 @@ xfs_qm_scall_setqlim( > > ASSERT(error != -ENOENT); > > goto out_unlock; > > } > > + > > + defq = xfs_get_defquota(dqp, q); > > xfs_dqunlock(dqp); > > > > tp = xfs_trans_alloc(mp, XFS_TRANS_QM_SETQLIM); > > @@ -458,8 +461,8 @@ xfs_qm_scall_setqlim( > > ddq->d_blk_softlimit = cpu_to_be64(soft); > > xfs_dquot_set_prealloc_limits(dqp); > > if (id == 0) { > > - q->qi_bhardlimit = hard; > > - q->qi_bsoftlimit = soft; > > + defq->bhardlimit = hard; > > + defq->bsoftlimit = soft; > > } > > } else { > > xfs_debug(mp, "blkhard %Ld < blksoft %Ld", hard, soft); > > @@ -474,8 +477,8 @@ xfs_qm_scall_setqlim( > > ddq->d_rtb_hardlimit = cpu_to_be64(hard); > > ddq->d_rtb_softlimit = cpu_to_be64(soft); > > if (id == 0) { > > - q->qi_rtbhardlimit = hard; > > - q->qi_rtbsoftlimit = soft; > > + defq->rtbhardlimit = hard; > > + defq->rtbsoftlimit = soft; > > } > > } else { > > xfs_debug(mp, "rtbhard %Ld < rtbsoft %Ld", hard, soft); > > @@ -491,8 +494,8 @@ xfs_qm_scall_setqlim( > > ddq->d_ino_hardlimit = cpu_to_be64(hard); > > ddq->d_ino_softlimit = cpu_to_be64(soft); > > if (id == 0) { > > - q->qi_ihardlimit = hard; > > - q->qi_isoftlimit = soft; > > + defq->ihardlimit = hard; > > + defq->isoftlimit = soft; > > } > > } else { > > xfs_debug(mp, "ihard %Ld < isoft %Ld", hard, soft); > > diff --git a/fs/xfs/xfs_trans_dquot.c b/fs/xfs/xfs_trans_dquot.c > > index 9951701..c3d5472 100644 > > --- a/fs/xfs/xfs_trans_dquot.c > > +++ b/fs/xfs/xfs_trans_dquot.c > > @@ -609,17 +609,20 @@ xfs_trans_dqresv( > > xfs_qcnt_t total_count; > > xfs_qcnt_t *resbcountp; > > xfs_quotainfo_t *q = mp->m_quotainfo; > > + struct xfs_def_quota *defq; > > > > > > xfs_dqlock(dqp); > > > > + defq = xfs_get_defquota(dqp, q); > > + > > if (flags & XFS_TRANS_DQ_RES_BLKS) { > > hardlimit = be64_to_cpu(dqp->q_core.d_blk_hardlimit); > > if (!hardlimit) > > - hardlimit = q->qi_bhardlimit; > > + hardlimit = defq->bhardlimit; > > softlimit = be64_to_cpu(dqp->q_core.d_blk_softlimit); > > if (!softlimit) > > - softlimit = q->qi_bsoftlimit; > > + softlimit = defq->bsoftlimit; > > timer = be32_to_cpu(dqp->q_core.d_btimer); > > warns = be16_to_cpu(dqp->q_core.d_bwarns); > > warnlimit = dqp->q_mount->m_quotainfo->qi_bwarnlimit; > > @@ -628,10 +631,10 @@ xfs_trans_dqresv( > > ASSERT(flags & XFS_TRANS_DQ_RES_RTBLKS); > > hardlimit = be64_to_cpu(dqp->q_core.d_rtb_hardlimit); > > if (!hardlimit) > > - hardlimit = q->qi_rtbhardlimit; > > + hardlimit = defq->rtbhardlimit; > > softlimit = be64_to_cpu(dqp->q_core.d_rtb_softlimit); > > if (!softlimit) > > - softlimit = q->qi_rtbsoftlimit; > > + softlimit = defq->rtbsoftlimit; > > timer = be32_to_cpu(dqp->q_core.d_rtbtimer); > > warns = be16_to_cpu(dqp->q_core.d_rtbwarns); > > warnlimit = dqp->q_mount->m_quotainfo->qi_rtbwarnlimit; > > @@ -672,10 +675,10 @@ xfs_trans_dqresv( > > warnlimit = dqp->q_mount->m_quotainfo->qi_iwarnlimit; > > hardlimit = be64_to_cpu(dqp->q_core.d_ino_hardlimit); > > if (!hardlimit) > > - hardlimit = q->qi_ihardlimit; > > + hardlimit = defq->ihardlimit; > > softlimit = be64_to_cpu(dqp->q_core.d_ino_softlimit); > > if (!softlimit) > > - softlimit = q->qi_isoftlimit; > > + softlimit = defq->isoftlimit; > > > > if (hardlimit && total_count > hardlimit) { > > xfs_quota_warn(mp, dqp, QUOTA_NL_IHARDWARN); > > > > _______________________________________________ > xfs mailing list > xfs@oss.sgi.com > http://oss.sgi.com/mailman/listinfo/xfs -- Carlos From cmaiolino@redhat.com Mon Feb 1 03:54:30 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=ham version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay3.corp.sgi.com [198.149.34.15]) by oss.sgi.com (Postfix) with ESMTP id 96AF07CA3 for ; Mon, 1 Feb 2016 03:54:30 -0600 (CST) Received: from cuda.sgi.com (cuda2.sgi.com [192.48.176.25]) by relay3.corp.sgi.com (Postfix) with ESMTP id 0A43BAC002 for ; Mon, 1 Feb 2016 01:54:26 -0800 (PST) X-ASG-Debug-ID: 1454320464-04cbb026fe1ebc30001-NocioJ Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by cuda.sgi.com with ESMTP id DFtKcq1ONezBcbij (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO) for ; Mon, 01 Feb 2016 01:54:24 -0800 (PST) X-Barracuda-Envelope-From: cmaiolino@redhat.com X-Barracuda-Apparent-Source-IP: 209.132.183.28 X-ASG-Whitelist: Client Received: from int-mx10.intmail.prod.int.phx2.redhat.com (int-mx10.intmail.prod.int.phx2.redhat.com [10.5.11.23]) by mx1.redhat.com (Postfix) with ESMTPS id 26C9C7AE9A for ; Mon, 1 Feb 2016 09:54:24 +0000 (UTC) Received: from zion.usersys.redhat.com (dhcp-26-103.brq.redhat.com [10.34.26.103]) by int-mx10.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id u119sMnt014606 for ; Mon, 1 Feb 2016 04:54:23 -0500 From: Carlos Maiolino To: xfs@oss.sgi.com Subject: [PATCH] xfs: Split default quota limits by quota type V4 Date: Mon, 1 Feb 2016 10:54:13 +0100 X-ASG-Orig-Subj: [PATCH] xfs: Split default quota limits by quota type V4 Message-Id: <1454320453-9292-1-git-send-email-cmaiolino@redhat.com> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.23 X-Barracuda-Connect: mx1.redhat.com[209.132.183.28] X-Barracuda-Start-Time: 1454320464 X-Barracuda-Encrypted: ECDHE-RSA-AES256-GCM-SHA384 X-Barracuda-URL: https://192.48.176.25:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-BRTS-Status: 1 Default quotas are globally set due historical reasons. IRIX only supported user and project quotas, and default quota was only applied to user quotas. In Linux, when a default quota is set, all different quota types inherits the same default value. An user with a quota limit larger than the default quota value, will still be limited to the default value because the group quotas also inherits the default quotas. Unless the group which the user belongs to have a custom quota limit set. This patch aims to split the default quota value by quota type. Allowing each quota type having different default values. Default time limits are still set globally. XFS does not set a per-user/group timer, but a single global timer. For changing this behavior, some changes should be made in user-space tools another bugs being fixed. Changelog: V2 - Remove comment about old behavior V3 - Keep time limit configuration inside xfs_qm_init_quotainfo to keep the current behavior of quota timers V4 - Fix code comments based on Eric's review Reviewed-by: Eric Sandeen Signed-off-by: Carlos Maiolino --- fs/xfs/xfs_dquot.c | 26 ++++++++++++----------- fs/xfs/xfs_qm.c | 55 +++++++++++++++++++++++++++++++++++++----------- fs/xfs/xfs_qm.h | 34 ++++++++++++++++++++++++------ fs/xfs/xfs_qm_syscalls.c | 15 +++++++------ fs/xfs/xfs_trans_dquot.c | 15 +++++++------ 5 files changed, 103 insertions(+), 42 deletions(-) diff --git a/fs/xfs/xfs_dquot.c b/fs/xfs/xfs_dquot.c index 9c44d38..23f551b 100644 --- a/fs/xfs/xfs_dquot.c +++ b/fs/xfs/xfs_dquot.c @@ -92,26 +92,28 @@ xfs_qm_adjust_dqlimits( { struct xfs_quotainfo *q = mp->m_quotainfo; struct xfs_disk_dquot *d = &dq->q_core; + struct xfs_def_quota *defq; int prealloc = 0; ASSERT(d->d_id); + defq = xfs_get_defquota(dq, q); - if (q->qi_bsoftlimit && !d->d_blk_softlimit) { - d->d_blk_softlimit = cpu_to_be64(q->qi_bsoftlimit); + if (defq->bsoftlimit && !d->d_blk_softlimit) { + d->d_blk_softlimit = cpu_to_be64(defq->bsoftlimit); prealloc = 1; } - if (q->qi_bhardlimit && !d->d_blk_hardlimit) { - d->d_blk_hardlimit = cpu_to_be64(q->qi_bhardlimit); + if (defq->bhardlimit && !d->d_blk_hardlimit) { + d->d_blk_hardlimit = cpu_to_be64(defq->bhardlimit); prealloc = 1; } - if (q->qi_isoftlimit && !d->d_ino_softlimit) - d->d_ino_softlimit = cpu_to_be64(q->qi_isoftlimit); - if (q->qi_ihardlimit && !d->d_ino_hardlimit) - d->d_ino_hardlimit = cpu_to_be64(q->qi_ihardlimit); - if (q->qi_rtbsoftlimit && !d->d_rtb_softlimit) - d->d_rtb_softlimit = cpu_to_be64(q->qi_rtbsoftlimit); - if (q->qi_rtbhardlimit && !d->d_rtb_hardlimit) - d->d_rtb_hardlimit = cpu_to_be64(q->qi_rtbhardlimit); + if (defq->isoftlimit && !d->d_ino_softlimit) + d->d_ino_softlimit = cpu_to_be64(defq->isoftlimit); + if (defq->ihardlimit && !d->d_ino_hardlimit) + d->d_ino_hardlimit = cpu_to_be64(defq->ihardlimit); + if (defq->rtbsoftlimit && !d->d_rtb_softlimit) + d->d_rtb_softlimit = cpu_to_be64(defq->rtbsoftlimit); + if (defq->rtbhardlimit && !d->d_rtb_hardlimit) + d->d_rtb_hardlimit = cpu_to_be64(defq->rtbhardlimit); if (prealloc) xfs_dquot_set_prealloc_limits(dq); diff --git a/fs/xfs/xfs_qm.c b/fs/xfs/xfs_qm.c index 532ab79..be125e1 100644 --- a/fs/xfs/xfs_qm.c +++ b/fs/xfs/xfs_qm.c @@ -560,6 +560,37 @@ xfs_qm_shrink_count( return list_lru_shrink_count(&qi->qi_lru, sc); } +STATIC void +xfs_qm_set_defquota( + xfs_mount_t *mp, + uint type, + xfs_quotainfo_t *qinf) +{ + xfs_dquot_t *dqp; + struct xfs_def_quota *defq; + int error; + + error = xfs_qm_dqread(mp, 0, type, XFS_QMOPT_DOWARN, &dqp); + + if (!error) { + xfs_disk_dquot_t *ddqp = &dqp->q_core; + + defq = xfs_get_defquota(dqp, qinf); + + /* + * Timers and warnings have been already set, let's just set the + * default limits for this quota type + */ + defq->bhardlimit = be64_to_cpu(ddqp->d_blk_hardlimit); + defq->bsoftlimit = be64_to_cpu(ddqp->d_blk_softlimit); + defq->ihardlimit = be64_to_cpu(ddqp->d_ino_hardlimit); + defq->isoftlimit = be64_to_cpu(ddqp->d_ino_softlimit); + defq->rtbhardlimit = be64_to_cpu(ddqp->d_rtb_hardlimit); + defq->rtbsoftlimit = be64_to_cpu(ddqp->d_rtb_softlimit); + xfs_qm_dqdestroy(dqp); + } +} + /* * This initializes all the quota information that's kept in the * mount structure @@ -606,19 +637,19 @@ xfs_qm_init_quotainfo( * We try to get the limits from the superuser's limits fields. * This is quite hacky, but it is standard quota practice. * - * We look at the USR dquot with id == 0 first, but if user quotas - * are not enabled we goto the GRP dquot with id == 0. - * We don't really care to keep separate default limits for user - * and group quotas, at least not at this point. - * * Since we may not have done a quotacheck by this point, just read * the dquot without attaching it to any hashtables or lists. + * + * Timers and warnings are globally set by the first timer found in + * user/group/proj quota types, otherwise a default value is used. + * This should be split into different fields per quota type. */ error = xfs_qm_dqread(mp, 0, XFS_IS_UQUOTA_RUNNING(mp) ? XFS_DQ_USER : (XFS_IS_GQUOTA_RUNNING(mp) ? XFS_DQ_GROUP : XFS_DQ_PROJ), XFS_QMOPT_DOWARN, &dqp); + if (!error) { xfs_disk_dquot_t *ddqp = &dqp->q_core; @@ -639,13 +670,6 @@ xfs_qm_init_quotainfo( be16_to_cpu(ddqp->d_iwarns) : XFS_QM_IWARNLIMIT; qinf->qi_rtbwarnlimit = ddqp->d_rtbwarns ? be16_to_cpu(ddqp->d_rtbwarns) : XFS_QM_RTBWARNLIMIT; - qinf->qi_bhardlimit = be64_to_cpu(ddqp->d_blk_hardlimit); - qinf->qi_bsoftlimit = be64_to_cpu(ddqp->d_blk_softlimit); - qinf->qi_ihardlimit = be64_to_cpu(ddqp->d_ino_hardlimit); - qinf->qi_isoftlimit = be64_to_cpu(ddqp->d_ino_softlimit); - qinf->qi_rtbhardlimit = be64_to_cpu(ddqp->d_rtb_hardlimit); - qinf->qi_rtbsoftlimit = be64_to_cpu(ddqp->d_rtb_softlimit); - xfs_qm_dqdestroy(dqp); } else { qinf->qi_btimelimit = XFS_QM_BTIMELIMIT; @@ -656,6 +680,13 @@ xfs_qm_init_quotainfo( qinf->qi_rtbwarnlimit = XFS_QM_RTBWARNLIMIT; } + if (XFS_IS_UQUOTA_RUNNING(mp)) + xfs_qm_set_defquota(mp, XFS_DQ_USER, qinf); + if (XFS_IS_GQUOTA_RUNNING(mp)) + xfs_qm_set_defquota(mp, XFS_DQ_GROUP, qinf); + if (XFS_IS_PQUOTA_RUNNING(mp)) + xfs_qm_set_defquota(mp, XFS_DQ_PROJ, qinf); + qinf->qi_shrinker.count_objects = xfs_qm_shrink_count; qinf->qi_shrinker.scan_objects = xfs_qm_shrink_scan; qinf->qi_shrinker.seeks = DEFAULT_SEEKS; diff --git a/fs/xfs/xfs_qm.h b/fs/xfs/xfs_qm.h index 996a040..45e2c36 100644 --- a/fs/xfs/xfs_qm.h +++ b/fs/xfs/xfs_qm.h @@ -53,6 +53,15 @@ extern struct kmem_zone *xfs_qm_dqtrxzone; */ #define XFS_DQUOT_CLUSTER_SIZE_FSB (xfs_filblks_t)1 +struct xfs_def_quota { + xfs_qcnt_t bhardlimit; /* default data blk hard limit */ + xfs_qcnt_t bsoftlimit; /* default data blk soft limit */ + xfs_qcnt_t ihardlimit; /* default inode count hard limit */ + xfs_qcnt_t isoftlimit; /* default inode count soft limit */ + xfs_qcnt_t rtbhardlimit; /* default realtime blk hard limit */ + xfs_qcnt_t rtbsoftlimit; /* default realtime blk soft limit */ +}; + /* * Various quota information for individual filesystems. * The mount structure keeps a pointer to this. @@ -76,12 +85,9 @@ typedef struct xfs_quotainfo { struct mutex qi_quotaofflock;/* to serialize quotaoff */ xfs_filblks_t qi_dqchunklen; /* # BBs in a chunk of dqs */ uint qi_dqperchunk; /* # ondisk dqs in above chunk */ - xfs_qcnt_t qi_bhardlimit; /* default data blk hard limit */ - xfs_qcnt_t qi_bsoftlimit; /* default data blk soft limit */ - xfs_qcnt_t qi_ihardlimit; /* default inode count hard limit */ - xfs_qcnt_t qi_isoftlimit; /* default inode count soft limit */ - xfs_qcnt_t qi_rtbhardlimit;/* default realtime blk hard limit */ - xfs_qcnt_t qi_rtbsoftlimit;/* default realtime blk soft limit */ + struct xfs_def_quota qi_usr_default; + struct xfs_def_quota qi_grp_default; + struct xfs_def_quota qi_prj_default; struct shrinker qi_shrinker; } xfs_quotainfo_t; @@ -171,4 +177,20 @@ extern int xfs_qm_scall_setqlim(struct xfs_mount *, xfs_dqid_t, uint, extern int xfs_qm_scall_quotaon(struct xfs_mount *, uint); extern int xfs_qm_scall_quotaoff(struct xfs_mount *, uint); +static inline struct xfs_def_quota * +xfs_get_defquota(struct xfs_dquot *dqp, struct xfs_quotainfo *qi) +{ + struct xfs_def_quota *defq; + + if (XFS_QM_ISUDQ(dqp)) + defq = &qi->qi_usr_default; + else if (XFS_QM_ISGDQ(dqp)) + defq = &qi->qi_grp_default; + else { + ASSERT(XFS_QM_ISPDQ(dqp)); + defq = &qi->qi_prj_default; + } + return defq; +} + #endif /* __XFS_QM_H__ */ diff --git a/fs/xfs/xfs_qm_syscalls.c b/fs/xfs/xfs_qm_syscalls.c index 3640c6e..31830f0 100644 --- a/fs/xfs/xfs_qm_syscalls.c +++ b/fs/xfs/xfs_qm_syscalls.c @@ -404,6 +404,7 @@ xfs_qm_scall_setqlim( struct xfs_disk_dquot *ddq; struct xfs_dquot *dqp; struct xfs_trans *tp; + struct xfs_def_quota *defq; int error; xfs_qcnt_t hard, soft; @@ -431,6 +432,8 @@ xfs_qm_scall_setqlim( ASSERT(error != -ENOENT); goto out_unlock; } + + defq = xfs_get_defquota(dqp, q); xfs_dqunlock(dqp); tp = xfs_trans_alloc(mp, XFS_TRANS_QM_SETQLIM); @@ -458,8 +461,8 @@ xfs_qm_scall_setqlim( ddq->d_blk_softlimit = cpu_to_be64(soft); xfs_dquot_set_prealloc_limits(dqp); if (id == 0) { - q->qi_bhardlimit = hard; - q->qi_bsoftlimit = soft; + defq->bhardlimit = hard; + defq->bsoftlimit = soft; } } else { xfs_debug(mp, "blkhard %Ld < blksoft %Ld", hard, soft); @@ -474,8 +477,8 @@ xfs_qm_scall_setqlim( ddq->d_rtb_hardlimit = cpu_to_be64(hard); ddq->d_rtb_softlimit = cpu_to_be64(soft); if (id == 0) { - q->qi_rtbhardlimit = hard; - q->qi_rtbsoftlimit = soft; + defq->rtbhardlimit = hard; + defq->rtbsoftlimit = soft; } } else { xfs_debug(mp, "rtbhard %Ld < rtbsoft %Ld", hard, soft); @@ -491,8 +494,8 @@ xfs_qm_scall_setqlim( ddq->d_ino_hardlimit = cpu_to_be64(hard); ddq->d_ino_softlimit = cpu_to_be64(soft); if (id == 0) { - q->qi_ihardlimit = hard; - q->qi_isoftlimit = soft; + defq->ihardlimit = hard; + defq->isoftlimit = soft; } } else { xfs_debug(mp, "ihard %Ld < isoft %Ld", hard, soft); diff --git a/fs/xfs/xfs_trans_dquot.c b/fs/xfs/xfs_trans_dquot.c index 9951701..c3d5472 100644 --- a/fs/xfs/xfs_trans_dquot.c +++ b/fs/xfs/xfs_trans_dquot.c @@ -609,17 +609,20 @@ xfs_trans_dqresv( xfs_qcnt_t total_count; xfs_qcnt_t *resbcountp; xfs_quotainfo_t *q = mp->m_quotainfo; + struct xfs_def_quota *defq; xfs_dqlock(dqp); + defq = xfs_get_defquota(dqp, q); + if (flags & XFS_TRANS_DQ_RES_BLKS) { hardlimit = be64_to_cpu(dqp->q_core.d_blk_hardlimit); if (!hardlimit) - hardlimit = q->qi_bhardlimit; + hardlimit = defq->bhardlimit; softlimit = be64_to_cpu(dqp->q_core.d_blk_softlimit); if (!softlimit) - softlimit = q->qi_bsoftlimit; + softlimit = defq->bsoftlimit; timer = be32_to_cpu(dqp->q_core.d_btimer); warns = be16_to_cpu(dqp->q_core.d_bwarns); warnlimit = dqp->q_mount->m_quotainfo->qi_bwarnlimit; @@ -628,10 +631,10 @@ xfs_trans_dqresv( ASSERT(flags & XFS_TRANS_DQ_RES_RTBLKS); hardlimit = be64_to_cpu(dqp->q_core.d_rtb_hardlimit); if (!hardlimit) - hardlimit = q->qi_rtbhardlimit; + hardlimit = defq->rtbhardlimit; softlimit = be64_to_cpu(dqp->q_core.d_rtb_softlimit); if (!softlimit) - softlimit = q->qi_rtbsoftlimit; + softlimit = defq->rtbsoftlimit; timer = be32_to_cpu(dqp->q_core.d_rtbtimer); warns = be16_to_cpu(dqp->q_core.d_rtbwarns); warnlimit = dqp->q_mount->m_quotainfo->qi_rtbwarnlimit; @@ -672,10 +675,10 @@ xfs_trans_dqresv( warnlimit = dqp->q_mount->m_quotainfo->qi_iwarnlimit; hardlimit = be64_to_cpu(dqp->q_core.d_ino_hardlimit); if (!hardlimit) - hardlimit = q->qi_ihardlimit; + hardlimit = defq->ihardlimit; softlimit = be64_to_cpu(dqp->q_core.d_ino_softlimit); if (!softlimit) - softlimit = q->qi_isoftlimit; + softlimit = defq->isoftlimit; if (hardlimit && total_count > hardlimit) { xfs_quota_warn(mp, dqp, QUOTA_NL_IHARDWARN); -- 2.4.3 From cmaiolino@redhat.com Mon Feb 1 03:57:12 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=ham version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay2.corp.sgi.com [137.38.102.29]) by oss.sgi.com (Postfix) with ESMTP id 720297CA3 for ; Mon, 1 Feb 2016 03:57:12 -0600 (CST) Received: from cuda.sgi.com (cuda2.sgi.com [192.48.176.25]) by relay2.corp.sgi.com (Postfix) with ESMTP id 5EC4E304043 for ; Mon, 1 Feb 2016 01:57:12 -0800 (PST) X-ASG-Debug-ID: 1454320631-04cbb026fd1ebe40001-NocioJ Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by cuda.sgi.com with ESMTP id X3uqk0SrY35vlu5P (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO) for ; Mon, 01 Feb 2016 01:57:11 -0800 (PST) X-Barracuda-Envelope-From: cmaiolino@redhat.com X-Barracuda-Apparent-Source-IP: 209.132.183.28 X-ASG-Whitelist: Client Received: from int-mx11.intmail.prod.int.phx2.redhat.com (int-mx11.intmail.prod.int.phx2.redhat.com [10.5.11.24]) by mx1.redhat.com (Postfix) with ESMTPS id 9FB39804ED; Mon, 1 Feb 2016 09:57:10 +0000 (UTC) Received: from redhat.com (dhcp-26-103.brq.redhat.com [10.34.26.103]) by int-mx11.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id u119v7AU023065 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Mon, 1 Feb 2016 04:57:09 -0500 Date: Mon, 1 Feb 2016 10:57:07 +0100 From: Carlos Maiolino To: Eric Sandeen Cc: xfs@oss.sgi.com Subject: Re: [PATCH] xfs: Split default quota limits by quota type V3 Message-ID: <20160201095707.GB8141@redhat.com> X-ASG-Orig-Subj: Re: [PATCH] xfs: Split default quota limits by quota type V3 Mail-Followup-To: Eric Sandeen , xfs@oss.sgi.com References: <1454000266-22541-1-git-send-email-cmaiolino@redhat.com> <56AA51B7.7030403@sandeen.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <56AA51B7.7030403@sandeen.net> User-Agent: Mutt/1.5.24 (2015-08-30) X-Scanned-By: MIMEDefang 2.68 on 10.5.11.24 X-Barracuda-Connect: mx1.redhat.com[209.132.183.28] X-Barracuda-Start-Time: 1454320631 X-Barracuda-Encrypted: ECDHE-RSA-AES256-GCM-SHA384 X-Barracuda-URL: https://192.48.176.25:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-BRTS-Status: 1 On Thu, Jan 28, 2016 at 11:36:55AM -0600, Eric Sandeen wrote: > On 1/28/16 10:57 AM, Carlos Maiolino wrote: > > Default quotas are globally set due historical reasons. IRIX only supported user > > and project quotas, and default quota was only applied to user quotas. > > > > In Linux, when a default quota is set, all different quota types inherits the > > same default value. > > > > An user with a quota limit larger than the default quota value, will still be > > limited to the default value because the group quotas also inherits the default > > quotas. Unless the group which the user belongs to have a custom quota limit > > set. > > > > This patch aims to split the default quota value by quota type. Allowing each > > quota type having different default values. > > > > Default time limits are still set globally. XFS does not set a per-user/group > > timer, but a single global timer. For changing this behavior, some changes > > should be made in user-space tools another bugs being fixed. > > Some minor comments about comments below. But the code looks fine to me, > so: > > Reviewed-by: Eric Sandeen > > and if you want to fix the comments & resend w/ my review tag I think that'd > be ok. > > Care to write an xfstests testcase for the default quota limit while you're > at it? > > Thanks, > -Eric > > > Changelog: > > > > V2 - Remove comment about old behavior > > V3 - Keep time limit configuration inside xfs_qm_init_quotainfo to keep > > the current behavior of quota timers > > > > + * > > + * Timers and warnings are globally set by the first timer found in > > + * user/group/proj quota types, otherwise a default value is used. > > + * This should be splitted into different fields per quota type. > > s/splitted/split/ > > > */ > > error = xfs_qm_dqread(mp, 0, > > XFS_IS_UQUOTA_RUNNING(mp) ? XFS_DQ_USER : > > (XFS_IS_GQUOTA_RUNNING(mp) ? XFS_DQ_GROUP : > > XFS_DQ_PROJ), > > XFS_QMOPT_DOWARN, &dqp); > > + > > if (!error) { > > xfs_disk_dquot_t *ddqp = &dqp->q_core; > > > > - /* > > - * The warnings and timers set the grace period given to > > - * a user or group before he or she can not perform any > > - * more writing. If it is zero, a default is used. > > - */ > > Not sure why you removed this comment? > Regarding this comment, I think it's just redundant with the previous comment, I left it in the code for the V4 though, I believe Dave can rip it off if it is really redundant. Cheers -- Carlos From lists@nerdbynature.de Mon Feb 1 04:11:30 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.1 required=5.0 tests=FROM_12LTRDOM autolearn=ham version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay2.corp.sgi.com [137.38.102.29]) by oss.sgi.com (Postfix) with ESMTP id D51EC7CA6 for ; Mon, 1 Feb 2016 04:11:30 -0600 (CST) Received: from cuda.sgi.com (cuda3.sgi.com [192.48.176.15]) by relay2.corp.sgi.com (Postfix) with ESMTP id C45F1304048 for ; Mon, 1 Feb 2016 02:11:27 -0800 (PST) X-ASG-Debug-ID: 1454321480-04cb6c0d5d1d2960001-NocioJ Received: from trent.utfs.org (trent.utfs.org [94.185.90.103]) by cuda.sgi.com with ESMTP id pndtYieOwWSeUteA (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO) for ; Mon, 01 Feb 2016 02:11:21 -0800 (PST) X-Barracuda-Envelope-From: lists@nerdbynature.de X-Barracuda-Apparent-Source-IP: 94.185.90.103 Received: from localhost (localhost [127.0.0.1]) by trent.utfs.org (Postfix) with ESMTP id DB68A3DB54; Mon, 1 Feb 2016 11:11:18 +0100 (CET) Date: Mon, 1 Feb 2016 02:11:18 -0800 (PST) From: Christian Kujau To: xfs@oss.sgi.com, bfoster@redhat.com Subject: 4.5-rc2: Torn write (CRC failure) detected Message-ID: X-ASG-Orig-Subj: 4.5-rc2: Torn write (CRC failure) detected User-Agent: Alpine 2.20.10 (DEB 116 2015-12-14) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8BIT X-Barracuda-Connect: trent.utfs.org[94.185.90.103] X-Barracuda-Start-Time: 1454321480 X-Barracuda-Encrypted: ECDHE-RSA-AES256-GCM-SHA384 X-Barracuda-URL: https://192.48.176.15:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-BRTS-Status: 1 X-Barracuda-Spam-Score: 0.50 X-Barracuda-Spam-Status: No, SCORE=0.50 using per-user scores of TAG_LEVEL=1000.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.7 tests=BSF_SC0_SA085, BSF_SC0_SA085b X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.3.26642 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 0.10 BSF_SC0_SA085 Custom Rule SA085 0.40 BSF_SC0_SA085b Custom Rule SA085b I tried to upgrade from 4.4.0-rc5 to 4.5.0-rc2 but I'm currently unable to mount my XFS filesystems any more on this PowerPC G4 machine: # mount -t xfs -o ro /dev/mapper/wdc1 /mnt/disk mount: mount /dev/mapper/wdc1 on /mnt/disk failed: Bad message # dmesg | tail [ 2035.937165] XFS (dm-2): Mounting V4 Filesystem [ 2036.357198] XFS (dm-2): Torn write (CRC failure) detected at log block 0x296e4. Truncating head block from 0x296e8. [ 2036.360155] XFS (dm-2): failed to locate log tail [ 2036.360222] XFS (dm-2): log mount/recovery failed: error -74 [ 2036.360751] XFS (dm-2): log mount failed AFAICS the message got introduced by "xfs: detect and trim torn writes during log recovery" - however, there is no crash involved here. The system was running 4.4.0-rc5 just fine and rebooted properly into 4.5.0-rc2. The underlying storage is an external disk attached via Firewire and dm-crypt on top of that. Running "xfs_repair -n" on the device came back with error code 1 (see below for its log[0]). This is all on Debian/stable with xfs_repair v3.2.1 - but I was unable to compile xfsprogs from the current git tree, because of a compilation error[1] Would it be safe to run xfs_repair without -n on that device? Christian. [0] xfs_repair # file -Ls /dev/mapper/wdc1 /dev/mapper/wdc1: SGI XFS filesystem data (blksz 4096, inosz 256, v2 dirs) # cryptsetup status wdc1 /dev/mapper/wdc1 is active. type: LUKS1 cipher: aes-cbc-essiv:sha256 keysize: 128 bits device: /dev/sde1 offset: 1032 sectors size: 1953524069 sectors mode: read/write # time xfs_repair -n /dev/mapper/wdc1; echo $? Phase 1 - find and verify superblock... Phase 2 - using internal log - scan filesystem freespace and inode maps... sb_fdblocks 15681968, counted 15731120 - found root inode chunk Phase 3 - for each AG... - scan (but don't clear) agi unlinked lists... - process known inodes and perform inode discovery... - agno = 0 - agno = 1 - agno = 2 - agno = 3 - process newly discovered inodes... Phase 4 - check for duplicate blocks... - setting up duplicate extent list... - check for inodes claiming duplicate blocks... - agno = 0 - agno = 1 - agno = 2 - agno = 3 No modify flag set, skipping phase 5 Phase 6 - check inode connectivity... - traversing filesystem ... - traversal finished ... - moving disconnected inodes to lost+found ... Phase 7 - verify link counts... No modify flag set, skipping filesystem flush and exiting. real 1m24.829s user 0m5.012s sys 0m1.200s 1 == Exit code [1] xfsprogs/v4.3.0 ==================================================== Building io [CC] fiemap.o In file included from ../include/xfs.h:58:0, from io.h:19, from fiemap.c:24: ../include/xfs/xfs_fs.h:42:8: error: redefinition of ‘struct fsxattr’ struct fsxattr { ^ In file included from fiemap.c:22:0: /usr/include/linux/fs.h:155:8: note: originally defined here struct fsxattr { ^ ../include/buildrules:59: recipe for target 'fiemap.o' failed make[2]: *** [fiemap.o] Error 1 include/buildrules:35: recipe for target 'io' failed make[1]: *** [io] Error 2 Makefile:70: recipe for target 'default' failed make: *** [default] Error 2 ==================================================== And indeed, "struct fsxattr" is already defined in /usr/include/linux/fs.h which is provided by linux-libc-dev, which cannot be removed that easily: $ sudo apt-get purge linux-libc-dev The following packages will be REMOVED: build-essential* dh-autoreconf* g++* g++-4.9* libblkid-dev* libbz2-dev* libc6-dev* libexpat1-dev* libicu-dev* libmysqlclient-dev* libncurses5-dev* libncursesw5-dev* libpam0g-dev* libpcre3-dev* libperl-dev* libpython-dev* libpython2.7-dev* libssl-dev* libstdc++-4.9-dev* libtool* libxmlrpc-core-c3-dev* linux-libc-dev* python-dev* python2.7-dev* uuid-dev* zlib1g-dev* Note: the compilation error was reported a few days ago on the qemu-devel mailing list too: [Qemu-devel] qemu fails to build on 4.5-rc1 https://www.mail-archive.com/qemu-devel@nongnu.org/msg348756.html -- BOFH excuse #154: You can tune a file system, but you can't tune a fish (from most tunefs man pages) From bfoster@redhat.com Mon Feb 1 06:18:53 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=ham version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay3.corp.sgi.com [198.149.34.15]) by oss.sgi.com (Postfix) with ESMTP id 220917CAD for ; Mon, 1 Feb 2016 06:18:53 -0600 (CST) Received: from cuda.sgi.com (cuda1.sgi.com [192.48.157.11]) by relay3.corp.sgi.com (Postfix) with ESMTP id B566DAC003 for ; Mon, 1 Feb 2016 04:18:52 -0800 (PST) X-ASG-Debug-ID: 1454329130-04bdf04d6b1e8dc0001-NocioJ Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by cuda.sgi.com with ESMTP id iH7gmCxAeQdLkHQr (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO) for ; Mon, 01 Feb 2016 04:18:51 -0800 (PST) X-Barracuda-Envelope-From: bfoster@redhat.com X-Barracuda-Apparent-Source-IP: 209.132.183.28 X-ASG-Whitelist: Client Received: from int-mx11.intmail.prod.int.phx2.redhat.com (int-mx11.intmail.prod.int.phx2.redhat.com [10.5.11.24]) by mx1.redhat.com (Postfix) with ESMTPS id A57845A79; Mon, 1 Feb 2016 12:18:50 +0000 (UTC) Received: from bfoster.bfoster (dhcp-41-28.bos.redhat.com [10.18.41.28]) by int-mx11.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id u11CInuD002938; Mon, 1 Feb 2016 07:18:50 -0500 Received: by bfoster.bfoster (Postfix, from userid 1000) id 187E01200AA; Mon, 1 Feb 2016 07:34:02 -0500 (EST) Date: Mon, 1 Feb 2016 07:34:01 -0500 From: Brian Foster To: Christian Kujau Cc: xfs@oss.sgi.com Subject: Re: 4.5-rc2: Torn write (CRC failure) detected Message-ID: <20160201123401.GA3992@bfoster.bfoster> X-ASG-Orig-Subj: Re: 4.5-rc2: Torn write (CRC failure) detected References: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: User-Agent: Mutt/1.5.24 (2015-08-30) X-Scanned-By: MIMEDefang 2.68 on 10.5.11.24 X-Barracuda-Connect: mx1.redhat.com[209.132.183.28] X-Barracuda-Start-Time: 1454329131 X-Barracuda-Encrypted: ECDHE-RSA-AES256-GCM-SHA384 X-Barracuda-URL: https://192.48.157.11:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-BRTS-Status: 1 On Mon, Feb 01, 2016 at 02:11:18AM -0800, Christian Kujau wrote: > I tried to upgrade from 4.4.0-rc5 to 4.5.0-rc2 but I'm currently unable to > mount my XFS filesystems any more on this PowerPC G4 machine: > You most likely need Darrick's recent fix, posted here: http://oss.sgi.com/pipermail/xfs/2016-January/046437.html The original patch had some endian conversion brokenness that wasn't detected on x86-64. Brian > # mount -t xfs -o ro /dev/mapper/wdc1 /mnt/disk > mount: mount /dev/mapper/wdc1 on /mnt/disk failed: Bad message > > # dmesg | tail > [ 2035.937165] XFS (dm-2): Mounting V4 Filesystem > [ 2036.357198] XFS (dm-2): Torn write (CRC failure) detected at log block 0x296e4. Truncating head block from 0x296e8. > [ 2036.360155] XFS (dm-2): failed to locate log tail > [ 2036.360222] XFS (dm-2): log mount/recovery failed: error -74 > [ 2036.360751] XFS (dm-2): log mount failed > > AFAICS the message got introduced by "xfs: detect and trim torn writes > during log recovery" - however, there is no crash involved here. The > system was running 4.4.0-rc5 just fine and rebooted properly into > 4.5.0-rc2. The underlying storage is an external disk attached via > Firewire and dm-crypt on top of that. > > Running "xfs_repair -n" on the device came back with error code 1 (see > below for its log[0]). > > This is all on Debian/stable with xfs_repair v3.2.1 - but I was unable to > compile xfsprogs from the current git tree, because of a compilation error[1] > > Would it be safe to run xfs_repair without -n on that device? > > Christian. > > [0] xfs_repair > # file -Ls /dev/mapper/wdc1 > /dev/mapper/wdc1: SGI XFS filesystem data (blksz 4096, inosz 256, v2 dirs) > > # cryptsetup status wdc1 > /dev/mapper/wdc1 is active. > type: LUKS1 > cipher: aes-cbc-essiv:sha256 > keysize: 128 bits > device: /dev/sde1 > offset: 1032 sectors > size: 1953524069 sectors > mode: read/write > > # time xfs_repair -n /dev/mapper/wdc1; echo $? > Phase 1 - find and verify superblock... > Phase 2 - using internal log > - scan filesystem freespace and inode maps... > sb_fdblocks 15681968, counted 15731120 > - found root inode chunk > Phase 3 - for each AG... > - scan (but don't clear) agi unlinked lists... > - process known inodes and perform inode discovery... > - agno = 0 > - agno = 1 > - agno = 2 > - agno = 3 > - process newly discovered inodes... > Phase 4 - check for duplicate blocks... > - setting up duplicate extent list... > - check for inodes claiming duplicate blocks... > - agno = 0 > - agno = 1 > - agno = 2 > - agno = 3 > No modify flag set, skipping phase 5 > Phase 6 - check inode connectivity... > - traversing filesystem ... > - traversal finished ... > - moving disconnected inodes to lost+found ... > Phase 7 - verify link counts... > No modify flag set, skipping filesystem flush and exiting. > > real 1m24.829s > user 0m5.012s > sys 0m1.200s > 1 == Exit code > > > > [1] xfsprogs/v4.3.0 > ==================================================== > Building io > [CC] fiemap.o > In file included from ../include/xfs.h:58:0, > from io.h:19, > from fiemap.c:24: > ../include/xfs/xfs_fs.h:42:8: error: redefinition of ‘struct fsxattr’ > struct fsxattr { > ^ > In file included from fiemap.c:22:0: > /usr/include/linux/fs.h:155:8: note: originally defined here > struct fsxattr { > ^ > ../include/buildrules:59: recipe for target 'fiemap.o' failed > make[2]: *** [fiemap.o] Error 1 > include/buildrules:35: recipe for target 'io' failed > make[1]: *** [io] Error 2 > Makefile:70: recipe for target 'default' failed > make: *** [default] Error 2 > ==================================================== > > And indeed, "struct fsxattr" is already defined in /usr/include/linux/fs.h > which is provided by linux-libc-dev, which cannot be removed that easily: > > $ sudo apt-get purge linux-libc-dev > The following packages will be REMOVED: > build-essential* dh-autoreconf* g++* g++-4.9* libblkid-dev* libbz2-dev* > libc6-dev* libexpat1-dev* libicu-dev* libmysqlclient-dev* libncurses5-dev* > libncursesw5-dev* libpam0g-dev* libpcre3-dev* libperl-dev* libpython-dev* > libpython2.7-dev* libssl-dev* libstdc++-4.9-dev* libtool* libxmlrpc-core-c3-dev* > linux-libc-dev* python-dev* python2.7-dev* uuid-dev* zlib1g-dev* > > Note: the compilation error was reported a few days ago on the qemu-devel > mailing list too: > > [Qemu-devel] qemu fails to build on 4.5-rc1 > https://www.mail-archive.com/qemu-devel@nongnu.org/msg348756.html > > -- > BOFH excuse #154: > > You can tune a file system, but you can't tune a fish (from most tunefs man pages) > > _______________________________________________ > xfs mailing list > xfs@oss.sgi.com > http://oss.sgi.com/mailman/listinfo/xfs From bfoster@redhat.com Mon Feb 1 09:02:51 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=ham version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay1.corp.sgi.com [137.38.102.111]) by oss.sgi.com (Postfix) with ESMTP id 562527CB1 for ; Mon, 1 Feb 2016 09:02:51 -0600 (CST) Received: from cuda.sgi.com (cuda1.sgi.com [192.48.157.11]) by relay1.corp.sgi.com (Postfix) with ESMTP id 2B8478F8033 for ; Mon, 1 Feb 2016 07:02:48 -0800 (PST) X-ASG-Debug-ID: 1454338964-04bdf04d6b1eee60001-NocioJ Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by cuda.sgi.com with ESMTP id Hx3Cui2BYUDwBP4j (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO) for ; Mon, 01 Feb 2016 07:02:44 -0800 (PST) X-Barracuda-Envelope-From: bfoster@redhat.com X-Barracuda-Apparent-Source-IP: 209.132.183.28 X-ASG-Whitelist: Client Received: from int-mx13.intmail.prod.int.phx2.redhat.com (int-mx13.intmail.prod.int.phx2.redhat.com [10.5.11.26]) by mx1.redhat.com (Postfix) with ESMTPS id 20B3070D74; Mon, 1 Feb 2016 15:02:44 +0000 (UTC) Received: from bfoster.bfoster (dhcp-41-28.bos.redhat.com [10.18.41.28]) by int-mx13.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id u11F2huE006559; Mon, 1 Feb 2016 10:02:43 -0500 Received: by bfoster.bfoster (Postfix, from userid 1000) id 1D17B1200AA; Mon, 1 Feb 2016 10:17:56 -0500 (EST) Date: Mon, 1 Feb 2016 10:17:56 -0500 From: Brian Foster To: "Darrick J. Wong" Cc: david@fromorbit.com, xfs@oss.sgi.com Subject: Re: [PATCH 2/5] libxfs: refactor the btree size calculator code Message-ID: <20160201151755.GB3992@bfoster.bfoster> X-ASG-Orig-Subj: Re: [PATCH 2/5] libxfs: refactor the btree size calculator code References: <20160123003502.2475.99558.stgit@birch.djwong.org> <20160123003508.2475.53723.stgit@birch.djwong.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20160123003508.2475.53723.stgit@birch.djwong.org> User-Agent: Mutt/1.5.24 (2015-08-30) X-Scanned-By: MIMEDefang 2.68 on 10.5.11.26 X-Barracuda-Connect: mx1.redhat.com[209.132.183.28] X-Barracuda-Start-Time: 1454338964 X-Barracuda-Encrypted: ECDHE-RSA-AES256-GCM-SHA384 X-Barracuda-URL: https://192.48.157.11:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-BRTS-Status: 1 On Fri, Jan 22, 2016 at 04:35:08PM -0800, Darrick J. Wong wrote: > Create a macro to generate btree height calculator functions. > This will be used (much) later when we get to the refcount > btree. > > Signed-off-by: Darrick J. Wong > --- The refactoring looks fine to me... though shouldn't this head into the kernel first and get backported to xfsprogs (or did I miss that somewhere)? That and one question below... > libxfs/xfs_bmap.c | 18 +----------------- > libxfs/xfs_bmap_btree.c | 9 +++++++++ > libxfs/xfs_bmap_btree.h | 3 +++ > libxfs/xfs_btree.c | 28 ++++++++++++++++++++++++++++ > libxfs/xfs_btree.h | 3 +++ > 5 files changed, 44 insertions(+), 17 deletions(-) > > > diff --git a/libxfs/xfs_bmap.c b/libxfs/xfs_bmap.c > index aef7cf3..c134765 100644 > --- a/libxfs/xfs_bmap.c > +++ b/libxfs/xfs_bmap.c > @@ -172,25 +172,9 @@ xfs_bmap_worst_indlen( > xfs_inode_t *ip, /* incore inode pointer */ > xfs_filblks_t len) /* delayed extent length */ > { > - int level; /* btree level number */ > - int maxrecs; /* maximum record count at this level */ > - xfs_mount_t *mp; /* mount structure */ > xfs_filblks_t rval; /* return value */ > > - mp = ip->i_mount; > - maxrecs = mp->m_bmap_dmxr[0]; > - for (level = 0, rval = 0; > - level < XFS_BM_MAXLEVELS(mp, XFS_DATA_FORK); > - level++) { > - len += maxrecs - 1; > - do_div(len, maxrecs); > - rval += len; > - if (len == 1) > - return rval + XFS_BM_MAXLEVELS(mp, XFS_DATA_FORK) - > - level - 1; > - if (level == 0) > - maxrecs = mp->m_bmap_dmxr[1]; > - } > + rval = xfs_bmbt_calc_size(ip->i_mount, len); We go from xfs_filblks_t to unsigned long here. Isn't the latter 4 bytes on 32-bit systems? Was that intentional? Brian > return rval; > } > > diff --git a/libxfs/xfs_bmap_btree.c b/libxfs/xfs_bmap_btree.c > index 2ef1836..3c595e2 100644 > --- a/libxfs/xfs_bmap_btree.c > +++ b/libxfs/xfs_bmap_btree.c > @@ -880,3 +880,12 @@ xfs_bmbt_change_owner( > xfs_btree_del_cursor(cur, error ? XFS_BTREE_ERROR : XFS_BTREE_NOERROR); > return error; > } > + > +xfs_filblks_t > +xfs_bmbt_calc_size( > + struct xfs_mount *mp, > + unsigned long len) > +{ > + return xfs_btree_calc_size(mp, mp->m_bmap_dmxr, > + XFS_BM_MAXLEVELS(mp, XFS_DATA_FORK), len); > +} > diff --git a/libxfs/xfs_bmap_btree.h b/libxfs/xfs_bmap_btree.h > index 819a8a4..04bc6e2 100644 > --- a/libxfs/xfs_bmap_btree.h > +++ b/libxfs/xfs_bmap_btree.h > @@ -140,4 +140,7 @@ extern int xfs_bmbt_change_owner(struct xfs_trans *tp, struct xfs_inode *ip, > extern struct xfs_btree_cur *xfs_bmbt_init_cursor(struct xfs_mount *, > struct xfs_trans *, struct xfs_inode *, int); > > +extern xfs_filblks_t xfs_bmbt_calc_size(struct xfs_mount *mp, > + unsigned long len); > + > #endif /* __XFS_BMAP_BTREE_H__ */ > diff --git a/libxfs/xfs_btree.c b/libxfs/xfs_btree.c > index 658f27e..d5f16c5 100644 > --- a/libxfs/xfs_btree.c > +++ b/libxfs/xfs_btree.c > @@ -4081,6 +4081,34 @@ xfs_btree_change_owner( > return 0; > } > > +/* > + * xfs_btree_calc_size() -- Calculate the number of blocks needed to store > + * a given number of records. > + */ > +xfs_filblks_t > +xfs_btree_calc_size( > + struct xfs_mount *mp, > + uint *limits, > + int maxlevels, > + unsigned long len) > +{ > + int level; > + int maxrecs; > + xfs_filblks_t rval; > + > + maxrecs = limits[0]; > + for (level = 0, rval = 0; level < maxlevels; level++) { > + len += maxrecs - 1; > + do_div(len, maxrecs); > + rval += len; > + if (len == 1) > + return rval + maxlevels - level - 1; > + if (level == 0) > + maxrecs = limits[1]; > + } > + return rval; > +} > + > /** > * xfs_btree_sblock_v5hdr_verify() -- verify the v5 fields of a short-format > * btree block > diff --git a/libxfs/xfs_btree.h b/libxfs/xfs_btree.h > index 48cb251..b25ffd3 100644 > --- a/libxfs/xfs_btree.h > +++ b/libxfs/xfs_btree.h > @@ -465,6 +465,9 @@ static inline int xfs_btree_get_level(struct xfs_btree_block *block) > #define XFS_BTREE_TRACE_ARGR(c, r) > #define XFS_BTREE_TRACE_CURSOR(c, t) > > +xfs_filblks_t xfs_btree_calc_size(struct xfs_mount *mp, uint *limits, > + int maxlevels, unsigned long len); > + > bool xfs_btree_sblock_v5hdr_verify(struct xfs_buf *bp); > bool xfs_btree_sblock_verify(struct xfs_buf *bp, unsigned int max_recs); > > > _______________________________________________ > xfs mailing list > xfs@oss.sgi.com > http://oss.sgi.com/mailman/listinfo/xfs From bfoster@redhat.com Mon Feb 1 09:03:42 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=ham version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay1.corp.sgi.com [137.38.102.111]) by oss.sgi.com (Postfix) with ESMTP id BD99D7CB5 for ; Mon, 1 Feb 2016 09:03:42 -0600 (CST) Received: from cuda.sgi.com (cuda2.sgi.com [192.48.176.25]) by relay1.corp.sgi.com (Postfix) with ESMTP id 9FDAB8F8035 for ; Mon, 1 Feb 2016 07:03:42 -0800 (PST) X-ASG-Debug-ID: 1454339018-04cbb026fe1f9f40001-NocioJ Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by cuda.sgi.com with ESMTP id xPPhUNnnMgWh5lsj (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO) for ; Mon, 01 Feb 2016 07:03:38 -0800 (PST) X-Barracuda-Envelope-From: bfoster@redhat.com X-Barracuda-Apparent-Source-IP: 209.132.183.28 X-ASG-Whitelist: Client Received: from int-mx11.intmail.prod.int.phx2.redhat.com (int-mx11.intmail.prod.int.phx2.redhat.com [10.5.11.24]) by mx1.redhat.com (Postfix) with ESMTPS id DC9268E258; Mon, 1 Feb 2016 15:03:37 +0000 (UTC) Received: from bfoster.bfoster (dhcp-41-28.bos.redhat.com [10.18.41.28]) by int-mx11.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id u11F3b6T017970; Mon, 1 Feb 2016 10:03:37 -0500 Received: by bfoster.bfoster (Postfix, from userid 1000) id 069D21200AA; Mon, 1 Feb 2016 10:18:49 -0500 (EST) Date: Mon, 1 Feb 2016 10:18:49 -0500 From: Brian Foster To: "Darrick J. Wong" Cc: david@fromorbit.com, xfs@oss.sgi.com Subject: Re: [PATCH 4/5] xfs_db: don't error out when blocksize > 64 * inodesize Message-ID: <20160201151849.GC3992@bfoster.bfoster> X-ASG-Orig-Subj: Re: [PATCH 4/5] xfs_db: don't error out when blocksize > 64 * inodesize References: <20160123003502.2475.99558.stgit@birch.djwong.org> <20160123003525.2475.44264.stgit@birch.djwong.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20160123003525.2475.44264.stgit@birch.djwong.org> User-Agent: Mutt/1.5.24 (2015-08-30) X-Scanned-By: MIMEDefang 2.68 on 10.5.11.24 X-Barracuda-Connect: mx1.redhat.com[209.132.183.28] X-Barracuda-Start-Time: 1454339018 X-Barracuda-Encrypted: ECDHE-RSA-AES256-GCM-SHA384 X-Barracuda-URL: https://192.48.176.25:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-BRTS-Status: 1 On Fri, Jan 22, 2016 at 04:35:25PM -0800, Darrick J. Wong wrote: > When the block size is large enough that multiple inode chunks can fit > in a single block (e.g. 64k blocks, 512 byte inodes) we must calculate > the per-chunk block size and the buffer offset correctly so that check > actually examines the correct metadata. > > Signed-off-by: Darrick J. Wong > --- > db/check.c | 13 +++++++++---- > 1 file changed, 9 insertions(+), 4 deletions(-) > > > diff --git a/db/check.c b/db/check.c > index 838db53..4e2768e 100644 > --- a/db/check.c > +++ b/db/check.c > @@ -4386,6 +4386,7 @@ scanfunc_ino( > __u16 holemask; > xfs_agino_t rino; > xfs_extlen_t cblocks; > + int bufoff; > > if (be32_to_cpu(block->bb_magic) != XFS_IBT_MAGIC && > be32_to_cpu(block->bb_magic) != XFS_IBT_CRC_MAGIC) { > @@ -4455,6 +4456,8 @@ scanfunc_ino( > rino = agino + startidx; > cblocks = (endidx - startidx) >> > mp->m_sb.sb_inopblog; > + if (cblocks == 0) > + cblocks = 1; A comment would be nice here (i.e., "handle the case where the entire chunk is in a single block"). > > /* Check the sparse chunk alignment */ > if (sparse && > @@ -4468,8 +4471,9 @@ scanfunc_ino( > } > > /* Check the block map */ > - set_dbmap(seqno, XFS_AGINO_TO_AGBNO(mp, rino), > - cblocks, DBM_INODE, seqno, bno); > + if (XFS_AGINO_TO_OFFSET(mp, rino) == 0) > + set_dbmap(seqno, XFS_AGINO_TO_AGBNO(mp, rino), > + cblocks, DBM_INODE, seqno, bno); > > push_cur(); > set_cur(&typtab[TYP_INODE], > @@ -4489,14 +4493,15 @@ scanfunc_ino( > } > > /* Examine each inode in this chunk */ > - for (j = startidx; j < endidx; j++) { > + bufoff = ((XFS_AGINO_TO_OFFSET(mp, rino) - startidx) << mp->m_sb.sb_inodelog); > + for (j = startidx; j < endidx; j++, bufoff += (1 << mp->m_sb.sb_inodelog)) { Here as well. Though, does this work for sparse inodes? Suppose we start halfway into a sparse inode record. So XFS_AGINO_TO_OFFSET(mp, rino) is 0 since we're at the first inode of the fs block; and say startidx is 32 as that could be the first real inode index in the record. It looks like we could go off the rails in that case..? Brian > if (ino_issparse(&rp[i], j)) > continue; > isfree = XFS_INOBT_IS_FREE_DISK(&rp[i], j); > if (isfree) > nfree++; > process_inode(agf, agino + j, > - (xfs_dinode_t *)((char *)iocur_top->data + ((j - startidx) << mp->m_sb.sb_inodelog)), > + (xfs_dinode_t *)((char *)iocur_top->data + bufoff), > isfree); > } > pop_cur(); > > _______________________________________________ > xfs mailing list > xfs@oss.sgi.com > http://oss.sgi.com/mailman/listinfo/xfs From bfoster@redhat.com Mon Feb 1 09:03:46 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=ham version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay3.corp.sgi.com [198.149.34.15]) by oss.sgi.com (Postfix) with ESMTP id CBC467CB8 for ; Mon, 1 Feb 2016 09:03:46 -0600 (CST) Received: from cuda.sgi.com (cuda3.sgi.com [192.48.176.15]) by relay3.corp.sgi.com (Postfix) with ESMTP id 48EF7AC003 for ; Mon, 1 Feb 2016 07:03:46 -0800 (PST) X-ASG-Debug-ID: 1454339024-04cb6c0d601dd4b0001-NocioJ Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by cuda.sgi.com with ESMTP id SUIJRUZsFhwAKK8X (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO) for ; Mon, 01 Feb 2016 07:03:45 -0800 (PST) X-Barracuda-Envelope-From: bfoster@redhat.com X-Barracuda-Apparent-Source-IP: 209.132.183.28 X-ASG-Whitelist: Client Received: from int-mx11.intmail.prod.int.phx2.redhat.com (int-mx11.intmail.prod.int.phx2.redhat.com [10.5.11.24]) by mx1.redhat.com (Postfix) with ESMTPS id 896FB357321; Mon, 1 Feb 2016 15:03:44 +0000 (UTC) Received: from bfoster.bfoster (dhcp-41-28.bos.redhat.com [10.18.41.28]) by int-mx11.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id u11F3ixM018044; Mon, 1 Feb 2016 10:03:44 -0500 Received: by bfoster.bfoster (Postfix, from userid 1000) id 8B2CC1200AA; Mon, 1 Feb 2016 10:18:56 -0500 (EST) Date: Mon, 1 Feb 2016 10:18:56 -0500 From: Brian Foster To: "Darrick J. Wong" Cc: david@fromorbit.com, xfs@oss.sgi.com Subject: Re: [PATCH 6/5] mkfs: factor finobt changes into min log size when formatting Message-ID: <20160201151856.GD3992@bfoster.bfoster> X-ASG-Orig-Subj: Re: [PATCH 6/5] mkfs: factor finobt changes into min log size when formatting References: <20160123003502.2475.99558.stgit@birch.djwong.org> <20160127044448.GA20038@birch.djwong.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20160127044448.GA20038@birch.djwong.org> User-Agent: Mutt/1.5.24 (2015-08-30) X-Scanned-By: MIMEDefang 2.68 on 10.5.11.24 X-Barracuda-Connect: mx1.redhat.com[209.132.183.28] X-Barracuda-Start-Time: 1454339025 X-Barracuda-Encrypted: ECDHE-RSA-AES256-GCM-SHA384 X-Barracuda-URL: https://192.48.176.15:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-BRTS-Status: 1 On Tue, Jan 26, 2016 at 08:44:48PM -0800, Darrick J. Wong wrote: > Since the finobt affects the size of the log reservations, we need to > be able to include its effects in the calculation of the minimum log > size. > > (Not really a problem now, but adding rmapbt will give this one some > bite.) > > Signed-off-by: Darrick J. Wong > --- Reviewed-by: Brian Foster > mkfs/maxtrres.c | 5 ++++- > mkfs/xfs_mkfs.c | 2 +- > mkfs/xfs_mkfs.h | 2 +- > 3 files changed, 6 insertions(+), 3 deletions(-) > > diff --git a/mkfs/maxtrres.c b/mkfs/maxtrres.c > index e1d5ee9..b97d020 100644 > --- a/mkfs/maxtrres.c > +++ b/mkfs/maxtrres.c > @@ -36,7 +36,8 @@ max_trans_res( > int inodelog, > int dirblocklog, > int logversion, > - int log_sunit) > + int log_sunit, > + int finobt) > { > xfs_sb_t *sbp; > xfs_mount_t mount; > @@ -68,6 +69,8 @@ max_trans_res( > (dirversion == 2 ? XFS_SB_VERSION_DIRV2BIT : 0) | > (logversion > 1 ? XFS_SB_VERSION_LOGV2BIT : 0) | > XFS_DFL_SB_VERSION_BITS; > + if (finobt) > + sbp->sb_features_ro_compat |= XFS_SB_FEAT_RO_COMPAT_FINOBT; > > libxfs_mount(&mount, sbp, 0,0,0,0); > maxfsb = xfs_log_calc_minimum_size(&mount); > diff --git a/mkfs/xfs_mkfs.c b/mkfs/xfs_mkfs.c > index 700d12c..4c3a802 100644 > --- a/mkfs/xfs_mkfs.c > +++ b/mkfs/xfs_mkfs.c > @@ -2406,7 +2406,7 @@ an AG size that is one stripe unit smaller, for example %llu.\n"), > > min_logblocks = max_trans_res(crcs_enabled, dirversion, > sectorlog, blocklog, inodelog, dirblocklog, > - logversion, lsunit); > + logversion, lsunit, finobt); > ASSERT(min_logblocks); > min_logblocks = MAX(XFS_MIN_LOG_BLOCKS, min_logblocks); > if (!logsize && dblocks >= (1024*1024*1024) >> blocklog) > diff --git a/mkfs/xfs_mkfs.h b/mkfs/xfs_mkfs.h > index 9df5f37..128068e 100644 > --- a/mkfs/xfs_mkfs.h > +++ b/mkfs/xfs_mkfs.h > @@ -84,6 +84,6 @@ extern void res_failed (int err); > /* maxtrres.c */ > extern int max_trans_res (int crcs_enabled, int dirversion, > int sectorlog, int blocklog, int inodelog, int dirblocklog, > - int logversion, int log_sunit); > + int logversion, int log_sunit, int finobt); > > #endif /* __XFS_MKFS_H__ */ > > _______________________________________________ > xfs mailing list > xfs@oss.sgi.com > http://oss.sgi.com/mailman/listinfo/xfs From bfoster@redhat.com Mon Feb 1 09:41:37 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=ham version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay3.corp.sgi.com [198.149.34.15]) by oss.sgi.com (Postfix) with ESMTP id BB6A37CB1 for ; Mon, 1 Feb 2016 09:41:37 -0600 (CST) Received: from cuda.sgi.com (cuda2.sgi.com [192.48.176.25]) by relay3.corp.sgi.com (Postfix) with ESMTP id 48ABDAC003 for ; Mon, 1 Feb 2016 07:41:37 -0800 (PST) X-ASG-Debug-ID: 1454341295-04cbb026fc1fb680001-NocioJ Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by cuda.sgi.com with ESMTP id y7PC2d2yveS04ZbB (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO) for ; Mon, 01 Feb 2016 07:41:36 -0800 (PST) X-Barracuda-Envelope-From: bfoster@redhat.com X-Barracuda-Apparent-Source-IP: 209.132.183.28 X-ASG-Whitelist: Client Received: from int-mx09.intmail.prod.int.phx2.redhat.com (int-mx09.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by mx1.redhat.com (Postfix) with ESMTPS id 74278C0A9CE8 for ; Mon, 1 Feb 2016 15:41:35 +0000 (UTC) Received: from bfoster.bfoster (dhcp-41-28.bos.redhat.com [10.18.41.28]) by int-mx09.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id u11FfZdK005634 for ; Mon, 1 Feb 2016 10:41:35 -0500 Received: by bfoster.bfoster (Postfix, from userid 1000) id 8A0811200AA; Mon, 1 Feb 2016 10:56:47 -0500 (EST) From: Brian Foster To: xfs@oss.sgi.com Subject: [PATCH] xfs: fix xfs_log_ticket leak in xfs_end_io() after fs shutdown Date: Mon, 1 Feb 2016 10:56:47 -0500 X-ASG-Orig-Subj: [PATCH] xfs: fix xfs_log_ticket leak in xfs_end_io() after fs shutdown Message-Id: <1454342207-52734-1-git-send-email-bfoster@redhat.com> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.22 X-Barracuda-Connect: mx1.redhat.com[209.132.183.28] X-Barracuda-Start-Time: 1454341296 X-Barracuda-Encrypted: ECDHE-RSA-AES256-GCM-SHA384 X-Barracuda-URL: https://192.48.176.25:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-BRTS-Status: 1 If the filesystem has shut down, xfs_end_io() currently sets an error on the ioend and proceeds to ioend destruction. The ioend might contain a truncate transaction if the I/O extended the size of the file. This transaction is only cleaned up in xfs_setfilesize_ioend(), however, which is skipped in this case. This results in an xfs_log_ticket leak message when the associate cache slab is destroyed (e.g., on rmmod). This was originally reproduced by xfs/141 on a distro kernel. The problem is reproducible on an upstream kernel, but not easily detected in current upstream if the xfs_log_ticket cache happens to be merged with another cache. This can be reproduced more deterministically with the 'slab_nomerge' kernel boot option. Update xfs_end_io() to proceed with normal end I/O processing after an error is set on an ioend due to fs shutdown. The I/O type-based processing is already designed to handle an I/O error and ensure that the ioend is cleaned up correctly. Signed-off-by: Brian Foster --- fs/xfs/xfs_aops.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/fs/xfs/xfs_aops.c b/fs/xfs/xfs_aops.c index 379c089..7bf8512 100644 --- a/fs/xfs/xfs_aops.c +++ b/fs/xfs/xfs_aops.c @@ -214,10 +214,12 @@ xfs_end_io( struct xfs_inode *ip = XFS_I(ioend->io_inode); int error = 0; - if (XFS_FORCED_SHUTDOWN(ip->i_mount)) { + /* + * Set an error if the mount has shut down and proceed with end I/O + * processing so it can perform whatever cleanups are necessary. + */ + if (XFS_FORCED_SHUTDOWN(ip->i_mount)) ioend->io_error = -EIO; - goto done; - } /* * For unwritten extents we need to issue transactions to convert a -- 2.4.3 From darrick.wong@oracle.com Mon Feb 1 13:15:04 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay2.corp.sgi.com [137.38.102.29]) by oss.sgi.com (Postfix) with ESMTP id 4BBC57CB1 for ; Mon, 1 Feb 2016 13:15:04 -0600 (CST) Received: from cuda.sgi.com (cuda2.sgi.com [192.48.176.25]) by relay2.corp.sgi.com (Postfix) with ESMTP id 36DE2304048 for ; Mon, 1 Feb 2016 11:15:01 -0800 (PST) X-ASG-Debug-ID: 1454354095-04cbb026fc2023b0001-NocioJ Received: from aserp1040.oracle.com (aserp1040.oracle.com [141.146.126.69]) by cuda.sgi.com with ESMTP id vpgsdbgQHyHoTJMF (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO) for ; Mon, 01 Feb 2016 11:14:55 -0800 (PST) X-Barracuda-Envelope-From: darrick.wong@oracle.com X-Barracuda-Apparent-Source-IP: 141.146.126.69 Received: from aserv0022.oracle.com (aserv0022.oracle.com [141.146.126.234]) by aserp1040.oracle.com (Sentrion-MTA-4.3.2/Sentrion-MTA-4.3.2) with ESMTP id u11JEsnF019329 (version=TLSv1 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Mon, 1 Feb 2016 19:14:54 GMT Received: from aserv0122.oracle.com (aserv0122.oracle.com [141.146.126.236]) by aserv0022.oracle.com (8.13.8/8.13.8) with ESMTP id u11JEsSM022707 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=FAIL); Mon, 1 Feb 2016 19:14:54 GMT Received: from abhmp0007.oracle.com (abhmp0007.oracle.com [141.146.116.13]) by aserv0122.oracle.com (8.13.8/8.13.8) with ESMTP id u11JEsHc005584; Mon, 1 Feb 2016 19:14:54 GMT Received: from localhost (/24.21.154.84) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Mon, 01 Feb 2016 11:14:54 -0800 Date: Mon, 1 Feb 2016 11:14:53 -0800 From: "Darrick J. Wong" To: Brian Foster Cc: xfs@oss.sgi.com Subject: Re: [PATCH 2/5] libxfs: refactor the btree size calculator code Message-ID: <20160201191453.GH20038@birch.djwong.org> X-ASG-Orig-Subj: Re: [PATCH 2/5] libxfs: refactor the btree size calculator code References: <20160123003502.2475.99558.stgit@birch.djwong.org> <20160123003508.2475.53723.stgit@birch.djwong.org> <20160201151755.GB3992@bfoster.bfoster> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20160201151755.GB3992@bfoster.bfoster> User-Agent: Mutt/1.5.21 (2010-09-15) X-Source-IP: aserv0022.oracle.com [141.146.126.234] X-Barracuda-Connect: aserp1040.oracle.com[141.146.126.69] X-Barracuda-Start-Time: 1454354095 X-Barracuda-Encrypted: ECDHE-RSA-AES256-GCM-SHA384 X-Barracuda-URL: https://192.48.176.25:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-BRTS-Status: 1 X-Barracuda-Spam-Score: 0.00 X-Barracuda-Spam-Status: No, SCORE=0.00 using per-user scores of TAG_LEVEL=1000.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.7 tests=BSF_SC0_MISMATCH_TO, UNPARSEABLE_RELAY X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.3.26652 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 0.00 BSF_SC0_MISMATCH_TO Envelope rcpt doesn't match header 0.00 UNPARSEABLE_RELAY Informational: message has unparseable relay lines On Mon, Feb 01, 2016 at 10:17:56AM -0500, Brian Foster wrote: > On Fri, Jan 22, 2016 at 04:35:08PM -0800, Darrick J. Wong wrote: > > Create a macro to generate btree height calculator functions. > > This will be used (much) later when we get to the refcount > > btree. > > > > Signed-off-by: Darrick J. Wong > > --- > > The refactoring looks fine to me... though shouldn't this head into the > kernel first and get backported to xfsprogs (or did I miss that > somewhere)? I think I've posted the kernelside version of this patch, though I suppose it doesn't really become important until one starts adding the rmap/reflink stuff. > That and one question below... > > > libxfs/xfs_bmap.c | 18 +----------------- > > libxfs/xfs_bmap_btree.c | 9 +++++++++ > > libxfs/xfs_bmap_btree.h | 3 +++ > > libxfs/xfs_btree.c | 28 ++++++++++++++++++++++++++++ > > libxfs/xfs_btree.h | 3 +++ > > 5 files changed, 44 insertions(+), 17 deletions(-) > > > > > > diff --git a/libxfs/xfs_bmap.c b/libxfs/xfs_bmap.c > > index aef7cf3..c134765 100644 > > --- a/libxfs/xfs_bmap.c > > +++ b/libxfs/xfs_bmap.c > > @@ -172,25 +172,9 @@ xfs_bmap_worst_indlen( > > xfs_inode_t *ip, /* incore inode pointer */ > > xfs_filblks_t len) /* delayed extent length */ > > { > > - int level; /* btree level number */ > > - int maxrecs; /* maximum record count at this level */ > > - xfs_mount_t *mp; /* mount structure */ > > xfs_filblks_t rval; /* return value */ > > > > - mp = ip->i_mount; > > - maxrecs = mp->m_bmap_dmxr[0]; > > - for (level = 0, rval = 0; > > - level < XFS_BM_MAXLEVELS(mp, XFS_DATA_FORK); > > - level++) { > > - len += maxrecs - 1; > > - do_div(len, maxrecs); > > - rval += len; > > - if (len == 1) > > - return rval + XFS_BM_MAXLEVELS(mp, XFS_DATA_FORK) - > > - level - 1; > > - if (level == 0) > > - maxrecs = mp->m_bmap_dmxr[1]; > > - } > > + rval = xfs_bmbt_calc_size(ip->i_mount, len); > > We go from xfs_filblks_t to unsigned long here. Isn't the latter 4 bytes > on 32-bit systems? Was that intentional? Semi-intentional. The 'len' argument is the number of records you want to store in the btree. For a bmbt, we're capped by di_nextents/di_anextents, which limit us to 2^32 records and I think the methods in xfs_bmap.c won't create an extent longer than MAXEXTLEN (2^21) blocks anyway. OTOH I suppose the rmap btree can store more than 2^32 records when reflink is turned on (not that you'd want to) so this could be widened to ULL. --D > > Brian > > > return rval; > > } > > > > diff --git a/libxfs/xfs_bmap_btree.c b/libxfs/xfs_bmap_btree.c > > index 2ef1836..3c595e2 100644 > > --- a/libxfs/xfs_bmap_btree.c > > +++ b/libxfs/xfs_bmap_btree.c > > @@ -880,3 +880,12 @@ xfs_bmbt_change_owner( > > xfs_btree_del_cursor(cur, error ? XFS_BTREE_ERROR : XFS_BTREE_NOERROR); > > return error; > > } > > + > > +xfs_filblks_t > > +xfs_bmbt_calc_size( > > + struct xfs_mount *mp, > > + unsigned long len) > > +{ > > + return xfs_btree_calc_size(mp, mp->m_bmap_dmxr, > > + XFS_BM_MAXLEVELS(mp, XFS_DATA_FORK), len); > > +} > > diff --git a/libxfs/xfs_bmap_btree.h b/libxfs/xfs_bmap_btree.h > > index 819a8a4..04bc6e2 100644 > > --- a/libxfs/xfs_bmap_btree.h > > +++ b/libxfs/xfs_bmap_btree.h > > @@ -140,4 +140,7 @@ extern int xfs_bmbt_change_owner(struct xfs_trans *tp, struct xfs_inode *ip, > > extern struct xfs_btree_cur *xfs_bmbt_init_cursor(struct xfs_mount *, > > struct xfs_trans *, struct xfs_inode *, int); > > > > +extern xfs_filblks_t xfs_bmbt_calc_size(struct xfs_mount *mp, > > + unsigned long len); > > + > > #endif /* __XFS_BMAP_BTREE_H__ */ > > diff --git a/libxfs/xfs_btree.c b/libxfs/xfs_btree.c > > index 658f27e..d5f16c5 100644 > > --- a/libxfs/xfs_btree.c > > +++ b/libxfs/xfs_btree.c > > @@ -4081,6 +4081,34 @@ xfs_btree_change_owner( > > return 0; > > } > > > > +/* > > + * xfs_btree_calc_size() -- Calculate the number of blocks needed to store > > + * a given number of records. > > + */ > > +xfs_filblks_t > > +xfs_btree_calc_size( > > + struct xfs_mount *mp, > > + uint *limits, > > + int maxlevels, > > + unsigned long len) > > +{ > > + int level; > > + int maxrecs; > > + xfs_filblks_t rval; > > + > > + maxrecs = limits[0]; > > + for (level = 0, rval = 0; level < maxlevels; level++) { > > + len += maxrecs - 1; > > + do_div(len, maxrecs); > > + rval += len; > > + if (len == 1) > > + return rval + maxlevels - level - 1; > > + if (level == 0) > > + maxrecs = limits[1]; > > + } > > + return rval; > > +} > > + > > /** > > * xfs_btree_sblock_v5hdr_verify() -- verify the v5 fields of a short-format > > * btree block > > diff --git a/libxfs/xfs_btree.h b/libxfs/xfs_btree.h > > index 48cb251..b25ffd3 100644 > > --- a/libxfs/xfs_btree.h > > +++ b/libxfs/xfs_btree.h > > @@ -465,6 +465,9 @@ static inline int xfs_btree_get_level(struct xfs_btree_block *block) > > #define XFS_BTREE_TRACE_ARGR(c, r) > > #define XFS_BTREE_TRACE_CURSOR(c, t) > > > > +xfs_filblks_t xfs_btree_calc_size(struct xfs_mount *mp, uint *limits, > > + int maxlevels, unsigned long len); > > + > > bool xfs_btree_sblock_v5hdr_verify(struct xfs_buf *bp); > > bool xfs_btree_sblock_verify(struct xfs_buf *bp, unsigned int max_recs); > > > > > > _______________________________________________ > > xfs mailing list > > xfs@oss.sgi.com > > http://oss.sgi.com/mailman/listinfo/xfs > > _______________________________________________ > xfs mailing list > xfs@oss.sgi.com > http://oss.sgi.com/mailman/listinfo/xfs From lists@nerdbynature.de Mon Feb 1 13:55:03 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=ham version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay2.corp.sgi.com [137.38.102.29]) by oss.sgi.com (Postfix) with ESMTP id A808A7CB1 for ; Mon, 1 Feb 2016 13:55:03 -0600 (CST) Received: from cuda.sgi.com (cuda2.sgi.com [192.48.176.25]) by relay2.corp.sgi.com (Postfix) with ESMTP id 85F93304039 for ; Mon, 1 Feb 2016 11:55:03 -0800 (PST) X-ASG-Debug-ID: 1454356499-04cbb026ff2036a0001-NocioJ Received: from trent.utfs.org (trent.utfs.org [94.185.90.103]) by cuda.sgi.com with ESMTP id XMZuDCjq1EoNjoyp (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO) for ; Mon, 01 Feb 2016 11:55:00 -0800 (PST) X-Barracuda-Envelope-From: lists@nerdbynature.de X-Barracuda-Apparent-Source-IP: 94.185.90.103 Received: from localhost (localhost [127.0.0.1]) by trent.utfs.org (Postfix) with ESMTP id 9EB393DA93; Mon, 1 Feb 2016 20:54:58 +0100 (CET) Date: Mon, 1 Feb 2016 11:54:58 -0800 (PST) From: Christian Kujau To: Brian Foster cc: xfs@oss.sgi.com, "Darrick J. Wong" Subject: Re: 4.5-rc2: Torn write (CRC failure) detected In-Reply-To: <20160201123401.GA3992@bfoster.bfoster> X-ASG-Orig-Subj: Re: 4.5-rc2: Torn write (CRC failure) detected Message-ID: References: <20160201123401.GA3992@bfoster.bfoster> User-Agent: Alpine 2.20.10 (DEB 116 2015-12-14) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8BIT X-Barracuda-Connect: trent.utfs.org[94.185.90.103] X-Barracuda-Start-Time: 1454356499 X-Barracuda-Encrypted: ECDHE-RSA-AES256-GCM-SHA384 X-Barracuda-URL: https://192.48.176.25:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-BRTS-Status: 1 X-Barracuda-Spam-Score: 0.50 X-Barracuda-Spam-Status: No, SCORE=0.50 using per-user scores of TAG_LEVEL=1000.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.7 tests=BSF_SC0_MISMATCH_TO, BSF_SC0_SA085, BSF_SC0_SA085b X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.3.26653 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 0.00 BSF_SC0_MISMATCH_TO Envelope rcpt doesn't match header 0.10 BSF_SC0_SA085 Custom Rule SA085 0.40 BSF_SC0_SA085b Custom Rule SA085b On Mon, 1 Feb 2016, Brian Foster wrote: > On Mon, Feb 01, 2016 at 02:11:18AM -0800, Christian Kujau wrote: > > I tried to upgrade from 4.4.0-rc5 to 4.5.0-rc2 but I'm currently unable to > > mount my XFS filesystems any more on this PowerPC G4 machine: > > > > You most likely need Darrick's recent fix, posted here: > > http://oss.sgi.com/pipermail/xfs/2016-January/046437.html > > The original patch had some endian conversion brokenness that wasn't > detected on x86-64. Thanks! The patch helps and the XFS file systems can be mounted again! Tested-by: Christian Kujau C. > > Brian > > > # mount -t xfs -o ro /dev/mapper/wdc1 /mnt/disk > > mount: mount /dev/mapper/wdc1 on /mnt/disk failed: Bad message > > > > # dmesg | tail > > [ 2035.937165] XFS (dm-2): Mounting V4 Filesystem > > [ 2036.357198] XFS (dm-2): Torn write (CRC failure) detected at log block 0x296e4. Truncating head block from 0x296e8. > > [ 2036.360155] XFS (dm-2): failed to locate log tail > > [ 2036.360222] XFS (dm-2): log mount/recovery failed: error -74 > > [ 2036.360751] XFS (dm-2): log mount failed > > > > AFAICS the message got introduced by "xfs: detect and trim torn writes > > during log recovery" - however, there is no crash involved here. The > > system was running 4.4.0-rc5 just fine and rebooted properly into > > 4.5.0-rc2. The underlying storage is an external disk attached via > > Firewire and dm-crypt on top of that. > > > > Running "xfs_repair -n" on the device came back with error code 1 (see > > below for its log[0]). > > > > This is all on Debian/stable with xfs_repair v3.2.1 - but I was unable to > > compile xfsprogs from the current git tree, because of a compilation error[1] > > > > Would it be safe to run xfs_repair without -n on that device? > > > > Christian. > > > > [0] xfs_repair > > # file -Ls /dev/mapper/wdc1 > > /dev/mapper/wdc1: SGI XFS filesystem data (blksz 4096, inosz 256, v2 dirs) > > > > # cryptsetup status wdc1 > > /dev/mapper/wdc1 is active. > > type: LUKS1 > > cipher: aes-cbc-essiv:sha256 > > keysize: 128 bits > > device: /dev/sde1 > > offset: 1032 sectors > > size: 1953524069 sectors > > mode: read/write > > > > # time xfs_repair -n /dev/mapper/wdc1; echo $? > > Phase 1 - find and verify superblock... > > Phase 2 - using internal log > > - scan filesystem freespace and inode maps... > > sb_fdblocks 15681968, counted 15731120 > > - found root inode chunk > > Phase 3 - for each AG... > > - scan (but don't clear) agi unlinked lists... > > - process known inodes and perform inode discovery... > > - agno = 0 > > - agno = 1 > > - agno = 2 > > - agno = 3 > > - process newly discovered inodes... > > Phase 4 - check for duplicate blocks... > > - setting up duplicate extent list... > > - check for inodes claiming duplicate blocks... > > - agno = 0 > > - agno = 1 > > - agno = 2 > > - agno = 3 > > No modify flag set, skipping phase 5 > > Phase 6 - check inode connectivity... > > - traversing filesystem ... > > - traversal finished ... > > - moving disconnected inodes to lost+found ... > > Phase 7 - verify link counts... > > No modify flag set, skipping filesystem flush and exiting. > > > > real 1m24.829s > > user 0m5.012s > > sys 0m1.200s > > 1 == Exit code > > > > > > > > [1] xfsprogs/v4.3.0 > > ==================================================== > > Building io > > [CC] fiemap.o > > In file included from ../include/xfs.h:58:0, > > from io.h:19, > > from fiemap.c:24: > > ../include/xfs/xfs_fs.h:42:8: error: redefinition of ‘struct fsxattr’ > > struct fsxattr { > > ^ > > In file included from fiemap.c:22:0: > > /usr/include/linux/fs.h:155:8: note: originally defined here > > struct fsxattr { > > ^ > > ../include/buildrules:59: recipe for target 'fiemap.o' failed > > make[2]: *** [fiemap.o] Error 1 > > include/buildrules:35: recipe for target 'io' failed > > make[1]: *** [io] Error 2 > > Makefile:70: recipe for target 'default' failed > > make: *** [default] Error 2 > > ==================================================== > > > > And indeed, "struct fsxattr" is already defined in /usr/include/linux/fs.h > > which is provided by linux-libc-dev, which cannot be removed that easily: > > > > $ sudo apt-get purge linux-libc-dev > > The following packages will be REMOVED: > > build-essential* dh-autoreconf* g++* g++-4.9* libblkid-dev* libbz2-dev* > > libc6-dev* libexpat1-dev* libicu-dev* libmysqlclient-dev* libncurses5-dev* > > libncursesw5-dev* libpam0g-dev* libpcre3-dev* libperl-dev* libpython-dev* > > libpython2.7-dev* libssl-dev* libstdc++-4.9-dev* libtool* libxmlrpc-core-c3-dev* > > linux-libc-dev* python-dev* python2.7-dev* uuid-dev* zlib1g-dev* > > > > Note: the compilation error was reported a few days ago on the qemu-devel > > mailing list too: > > > > [Qemu-devel] qemu fails to build on 4.5-rc1 > > https://www.mail-archive.com/qemu-devel@nongnu.org/msg348756.html > > > > -- > > BOFH excuse #154: > > > > You can tune a file system, but you can't tune a fish (from most tunefs man pages) > > > > _______________________________________________ > > xfs mailing list > > xfs@oss.sgi.com > > http://oss.sgi.com/mailman/listinfo/xfs > -- BOFH excuse #354: Chewing gum on /dev/sd3c From david@fromorbit.com Mon Feb 1 15:22:58 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=ham version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay1.corp.sgi.com [137.38.102.111]) by oss.sgi.com (Postfix) with ESMTP id 5598B7CB1 for ; Mon, 1 Feb 2016 15:22:58 -0600 (CST) Received: from cuda.sgi.com (cuda3.sgi.com [192.48.176.15]) by relay1.corp.sgi.com (Postfix) with ESMTP id 38A0D8F8033 for ; Mon, 1 Feb 2016 13:22:55 -0800 (PST) X-ASG-Debug-ID: 1454361772-04cb6c0d5f1e76d0001-NocioJ Received: from ipmail07.adl2.internode.on.net (ipmail07.adl2.internode.on.net [150.101.137.131]) by cuda.sgi.com with ESMTP id LdSmuXzU0RaEOMEZ for ; Mon, 01 Feb 2016 13:22:52 -0800 (PST) X-Barracuda-Envelope-From: david@fromorbit.com X-Barracuda-Apparent-Source-IP: 150.101.137.131 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: A2DPBgCdy69W/xATLHlegzqBP4hYnhkBAQEGi2KFRYQFhgkEAgKBPE0BAQEBAQGBC4RCAQEEJxMcMwgDGAklDwUlAyEBEogavXsMHhiFMIR+hBeEVQEElm+NQoFkhEKIU4psg1JihAAoLogzgTgBAQE Received: from ppp121-44-19-16.lns20.syd4.internode.on.net (HELO dastard) ([121.44.19.16]) by ipmail07.adl2.internode.on.net with ESMTP; 02 Feb 2016 07:52:51 +1030 Received: from dave by dastard with local (Exim 4.80) (envelope-from ) id 1aQLvi-0007Og-AB; Tue, 02 Feb 2016 08:22:38 +1100 Date: Tue, 2 Feb 2016 08:22:38 +1100 From: Dave Chinner To: Eric Sandeen , xfs@oss.sgi.com Subject: Re: [PATCH] xfs: Split default quota limits by quota type V3 Message-ID: <20160201212238.GV6033@dastard> X-ASG-Orig-Subj: Re: [PATCH] xfs: Split default quota limits by quota type V3 References: <1454000266-22541-1-git-send-email-cmaiolino@redhat.com> <56AA51B7.7030403@sandeen.net> <20160201095707.GB8141@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20160201095707.GB8141@redhat.com> User-Agent: Mutt/1.5.21 (2010-09-15) X-Barracuda-Connect: ipmail07.adl2.internode.on.net[150.101.137.131] X-Barracuda-Start-Time: 1454361772 X-Barracuda-URL: https://192.48.176.15:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-BRTS-Status: 1 X-Barracuda-Spam-Score: 0.00 X-Barracuda-Spam-Status: No, SCORE=0.00 using per-user scores of TAG_LEVEL=1000.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.7 tests=BSF_SC0_MISMATCH_TO X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.3.26655 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 0.00 BSF_SC0_MISMATCH_TO Envelope rcpt doesn't match header On Mon, Feb 01, 2016 at 10:57:07AM +0100, Carlos Maiolino wrote: > On Thu, Jan 28, 2016 at 11:36:55AM -0600, Eric Sandeen wrote: > > On 1/28/16 10:57 AM, Carlos Maiolino wrote: > > > xfs_disk_dquot_t *ddqp = &dqp->q_core; > > > > > > - /* > > > - * The warnings and timers set the grace period given to > > > - * a user or group before he or she can not perform any > > > - * more writing. If it is zero, a default is used. > > > - */ > > > > Not sure why you removed this comment? > > > Regarding this comment, I think it's just redundant with the previous comment, I > left it in the code for the V4 though, I believe Dave can rip it off if it is > really redundant. No, please don't ask me to do make random patch edits on commit - it's your job as a patch submitter to get it right. I will sometimes do this for simple patches or patches that come from a never-seen-before-and-never-seen-again patch submitter, but for a regular developer submitting non-trivial patches I won't change the patches because the issue hasn't been sorted out during peer review. Work it out with Eric, get a reviewed-by tag, and I'll apply it as reviewed. Cheers, Dave. -- Dave Chinner david@fromorbit.com From gwendal@google.com Mon Feb 1 15:25:40 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=T_DKIM_INVALID autolearn=ham version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay2.corp.sgi.com [137.38.102.29]) by oss.sgi.com (Postfix) with ESMTP id 796897CB1 for ; Mon, 1 Feb 2016 15:25:40 -0600 (CST) Received: from cuda.sgi.com (cuda2.sgi.com [192.48.176.25]) by relay2.corp.sgi.com (Postfix) with ESMTP id 56F5F304032 for ; Mon, 1 Feb 2016 13:25:40 -0800 (PST) X-ASG-Debug-ID: 1454361934-04cbb026ff205df0001-NocioJ Received: from mail-pf0-f170.google.com (mail-pf0-f170.google.com [209.85.192.170]) by cuda.sgi.com with ESMTP id FiCZG2q0KUQfgiZS (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128 verify=NO) for ; Mon, 01 Feb 2016 13:25:34 -0800 (PST) X-Barracuda-Envelope-From: gwendal@google.com X-Barracuda-RBL-Trusted-Forwarder: 209.85.192.170 Received: by mail-pf0-f170.google.com with SMTP id n128so89519269pfn.3 for ; Mon, 01 Feb 2016 13:25:34 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references; bh=bW1nwh6c7l8u/rtJEIWHN41iv5PY+i5/XPyLMDOI/8g=; b=LFvHi/cRK4Jt8R1TuI/ib8Ku7nI1+J5X3DLpPaWGSbzZksSvFIIDKexuUQEpTza7iW 4hZ+wyB5ZvdrnM6UA7y0Lq8Z0dtubl//5eRT9Wc2ryadV1BQZU978hnTICu3Ge2Sm+c7 vzeE7+bT59hkvEznAvlBOC97fuA9fW99PAqsKopspGQn6ChVbjMI2vcbJte75klzCyI/ I0XaMVwQx/thEb7Cjtnr0462nNAAgVcKyzgyHOsJiqAt80tres2HmwtUibv/F7uw94g5 BDTVsq2ZvEHv4MfCgxxXIHgqB96fVBl2LQ5+ydCD0vdP5VeFOXEasIMecWkygR12uWRW YawQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references; bh=bW1nwh6c7l8u/rtJEIWHN41iv5PY+i5/XPyLMDOI/8g=; b=V4lBnu8bkbKNOkCRxU/QrS6yO8X8CRBXn/XUkp4QCoB7t2+wim340K8uRufYFqPRnO AxX/Z1oOMoEm/uZlpETE5KvFbcsW4eTkItdp2co56fURt5ujd0xDKJNYnUltt8Sw7CSJ w3eB3a/564/S3iuHgBQqs3La7taxcTnlCqTF+ATfRwPHWRZ9So+NT6QyQ7xhG595qH1g ANXW6SyDrkj444d9iFgYDXmNK05uZ69n8/F+y80InWWEGMpgFUIfZJQ3LotK3IrosVtf M6zEDvxVdkd8fmij6TO8ZWFmCMt9SeYOrM7OSBAr0wiZQUQ1m0HhC6B9WI0nEnwzdYFT S35Q== X-Gm-Message-State: AG10YOR4zBEle2dUtAj0K6AxjRL6+/HrN4AhIzXEdsF1dp4dpdt9kFTcHQkEOUEq4EuyZ7L8 X-Received: by 10.98.72.135 with SMTP id q7mr41335031pfi.151.1454361934189; Mon, 01 Feb 2016 13:25:34 -0800 (PST) Received: from gwendal.mtv.corp.google.com ([172.22.64.242]) by smtp.gmail.com with ESMTPSA id mk3sm10935757pab.20.2016.02.01.13.25.29 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 01 Feb 2016 13:25:30 -0800 (PST) Sender: Gwendal Grignou X-Barracuda-BBL-IP: 172.22.64.242 From: Gwendal Grignou To: hch@infradead.org, tytso@mit.edu Cc: fstests@vger.kernel.org, xfs@oss.sgi.com Subject: xfsprogs: Add BUILD_CFLAGS for cross compilation Date: Mon, 1 Feb 2016 13:25:09 -0800 X-ASG-Orig-Subj: xfsprogs: Add BUILD_CFLAGS for cross compilation Message-Id: <1454361909-36538-1-git-send-email-gwendal@chromium.org> X-Mailer: git-send-email 2.7.0.rc3.207.g0ac5344 In-Reply-To: <1437913255-7524-4-git-send-email-tytso@mit.edu> References: <1437913255-7524-4-git-send-email-tytso@mit.edu> X-Barracuda-Connect: mail-pf0-f170.google.com[209.85.192.170] X-Barracuda-Start-Time: 1454361934 X-Barracuda-Encrypted: ECDHE-RSA-AES128-GCM-SHA256 X-Barracuda-URL: https://192.48.176.25:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-BRTS-Status: 1 X-Barracuda-Spam-Score: 0.00 X-Barracuda-Spam-Status: No, SCORE=0.00 using per-user scores of TAG_LEVEL=1000.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.7 tests=BSF_SC0_MISMATCH_TO, DKIM_SIGNED, DKIM_VERIFIED X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.3.26655 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 0.00 BSF_SC0_MISMATCH_TO Envelope rcpt doesn't match header -0.00 DKIM_VERIFIED Domain Keys Identified Mail: signature passes verification 0.00 DKIM_SIGNED Domain Keys Identified Mail: message has a signature When cross compiling, CFLAGS may contains option for the cros-compiler the host compiler can not handle. Add BUILD_CFLAGS variable that does not include $OPTIMIZER options. Signed-off by: Gwendal Grignou --- a/include/builddefs.in 2016-02-01 09:44:14.636018753 -0800 +++ b/include/builddefs.in 2016-02-01 09:37:29.000000000 -0800 @@ -27,6 +27,7 @@ LOADERFLAGS = @LDFLAGS@ LTLDFLAGS = @LDFLAGS@ CFLAGS = @CFLAGS@ +BUILD_CFLAGS = @BUILD_CFLAGS@ LIBRT = @librt@ LIBUUID = @libuuid@ @@ -151,7 +151,7 @@ endif -GCFLAGS = $(OPTIMIZER) $(DEBUG) \ +GCFLAGS = $(DEBUG) \ -DVERSION=\"$(PKG_VERSION)\" -DLOCALEDIR=\"$(PKG_LOCALE_DIR)\" \ -DPACKAGE=\"$(PKG_NAME)\" -I$(TOPDIR)/include -I$(TOPDIR)/libxfs @@ -160,7 +160,8 @@ endif # First, Global, Platform, Local CFLAGS -CFLAGS += $(FCFLAGS) $(GCFLAGS) $(PCFLAGS) $(LCFLAGS) +BUILD_CFLAGS += $(FCFLAGS) $(GCFLAGS) $(PCFLAGS) $(LCFLAGS) +CFLAGS += $(FCFLAGS) $(OPTIMIZER) $(GCFLAGS) $(PCFLAGS) $(LCFLAGS) include $(TOPDIR)/include/buildmacros --- a/libxfs/Makefile 2016-02-01 09:44:14.644018849 -0800 +++ b/libxfs/Makefile 2016-02-01 09:37:55.000000000 -0800 @@ -111,7 +111,7 @@ crc32table.h: gen_crc32table.c @echo " [CC] gen_crc32table" - $(Q) $(BUILD_CC) $(CFLAGS) -o gen_crc32table $< + $(Q) $(BUILD_CC) $(BUILD_CFLAGS) -o gen_crc32table $< @echo " [GENERATE] $@" $(Q) ./gen_crc32table > crc32table.h @@ -122,7 +122,7 @@ # disk. crc32selftest: gen_crc32table.c crc32table.h crc32.c @echo " [TEST] CRC32" - $(Q) $(BUILD_CC) $(CFLAGS) -D CRC32_SELFTEST=1 crc32.c -o $@ + $(Q) $(BUILD_CC) $(BUILD_CFLAGS) -D CRC32_SELFTEST=1 crc32.c -o $@ $(Q) ./$@ # set up include/xfs header directory --- a/configure.ac 2016-02-01 09:56:42.873010767 -0800 +++ b/configure.ac 2016-02-01 09:56:45.885047014 -0800 @@ -11,9 +11,12 @@ AC_PROG_CC if test $cross_compiling = no; then BUILD_CC="$CC" + BUILD_CFLAGS="$CFLAGS" AC_SUBST(BUILD_CC) else AC_CHECK_PROGS(BUILD_CC, gcc cc) + BUILD_CFLAGS="-g" fi +AC_SUBST(BUILD_CFLAGS) AC_ARG_ENABLE(shared, [ --enable-shared=[yes/no] Enable use of shared libraries [default=yes]],, From darrick.wong@oracle.com Mon Feb 1 15:54:47 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay3.corp.sgi.com [198.149.34.15]) by oss.sgi.com (Postfix) with ESMTP id D85E07CB1 for ; Mon, 1 Feb 2016 15:54:46 -0600 (CST) Received: from cuda.sgi.com (cuda1.sgi.com [192.48.157.11]) by relay3.corp.sgi.com (Postfix) with ESMTP id 6B1A6AC003 for ; Mon, 1 Feb 2016 13:54:46 -0800 (PST) X-ASG-Debug-ID: 1454363683-04bdf04d6c1fb250001-NocioJ Received: from aserp1040.oracle.com (aserp1040.oracle.com [141.146.126.69]) by cuda.sgi.com with ESMTP id X5nngQeGQKEEnBzx (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO) for ; Mon, 01 Feb 2016 13:54:44 -0800 (PST) X-Barracuda-Envelope-From: darrick.wong@oracle.com X-Barracuda-Apparent-Source-IP: 141.146.126.69 Received: from aserv0022.oracle.com (aserv0022.oracle.com [141.146.126.234]) by aserp1040.oracle.com (Sentrion-MTA-4.3.2/Sentrion-MTA-4.3.2) with ESMTP id u11LsAL6007998 (version=TLSv1 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Mon, 1 Feb 2016 21:54:10 GMT Received: from aserv0121.oracle.com (aserv0121.oracle.com [141.146.126.235]) by aserv0022.oracle.com (8.13.8/8.13.8) with ESMTP id u11Ls9EH014734 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=FAIL); Mon, 1 Feb 2016 21:54:10 GMT Received: from abhmp0001.oracle.com (abhmp0001.oracle.com [141.146.116.7]) by aserv0121.oracle.com (8.13.8/8.13.8) with ESMTP id u11Ls9Sw023065; Mon, 1 Feb 2016 21:54:09 GMT Received: from localhost (/24.21.154.84) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Mon, 01 Feb 2016 13:54:09 -0800 Date: Mon, 1 Feb 2016 13:54:07 -0800 From: "Darrick J. Wong" To: Dave Chinner , Brian Foster Cc: Christoph Hellwig , xfs@oss.sgi.com, Christoph Hellwig Subject: Re: stop using ioends for direct write completions Message-ID: <20160201215407.GI20038@birch.djwong.org> X-ASG-Orig-Subj: Re: stop using ioends for direct write completions References: <1452766237-2314-1-git-send-email-hch@lst.de> <20160128131656.GB14876@infradead.org> <20160129141232.GA43184@bfoster.bfoster> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20160129141232.GA43184@bfoster.bfoster> User-Agent: Mutt/1.5.21 (2010-09-15) X-Source-IP: aserv0022.oracle.com [141.146.126.234] X-Barracuda-Connect: aserp1040.oracle.com[141.146.126.69] X-Barracuda-Start-Time: 1454363684 X-Barracuda-Encrypted: ECDHE-RSA-AES256-GCM-SHA384 X-Barracuda-URL: https://192.48.157.11:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-BRTS-Status: 1 X-Barracuda-Spam-Score: 0.00 X-Barracuda-Spam-Status: No, SCORE=0.00 using per-user scores of TAG_LEVEL=1000.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.7 tests=BSF_SC0_MISMATCH_TO, UNPARSEABLE_RELAY X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.3.26657 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 0.00 BSF_SC0_MISMATCH_TO Envelope rcpt doesn't match header 0.00 UNPARSEABLE_RELAY Informational: message has unparseable relay lines On Fri, Jan 29, 2016 at 09:12:33AM -0500, Brian Foster wrote: > On Thu, Jan 28, 2016 at 05:16:56AM -0800, Christoph Hellwig wrote: > > Any chance to get a review for this? It should really help > > with sorting out the buffered I/O COW code. > > > > I haven't taken a closer look at the patch yet. I was kind of waiting > for Dave to chime in because I'm a little confused over the back and > forth nature of dio/ioend completion lately. > > My understanding is that the original requirement for ioends here was to > track the state necessary in order to defer (to wq) completions that had > to allocate transactions. Eventually, the deferred buffer state was > implemented and we no longer required an ioend for that, so we removed > the ioends here: > > 2ba6623 xfs: don't allocate an ioend for direct I/O completions > > Then just a couple months later, we merged the following to re-add the > ioend into the dio path: > > d5cc2e3f xfs: DIO needs an ioend for writes > > I recall reviewing that one, but looking back afaict the ioend was used > simply to enable reuse of the ioend completion code. Now we have this > patch which presumably removes much of that code to eliminate the ioend > allocation overhead. > > Neither this patch nor the previous has any technical reasoning for one > approach over the other in the commit logs, so afaics this appears to be > a matter of preference. Can we get some agreement (or discussion) on > what the right interface is to transfer information to dio completion? > E.g., is this allocation overhead noticeable? Is ioend usage problematic > for other reasons (such as copy-on-write)? Going back to the previous > patch, were there explicit reasons for using ioends aside from code > reuse? Note that the subsequent commit 6dfa1b67 ("xfs: handle DIO > overwrite EOF update completion correctly") does refer to some problems > not running dio completions in the right context... Dave? I don't know the reason /for/ using ioends, but I'll share an argument in favor of Christoph's patch to remove them: Each ioend has a type code which determines what we do at the end of the IO. For buffered writes, we can create as many ioends as necessary to handle all the different dispositions of all the blocks in the range of dirty pages. For directio, however, the requirements are a little different -- we want to be able to say "change all the extents in this part of the file from unwritten to written", and to be able to change i_size after a write. We can reuse the ioend structure to encode these desires until CoW came along. Now we also want to be able to say "remap all extents in this part of a file if the write succeeds". Since we can only have one type code per ioend, either we have to hide extra offset/size fields in the ioend for this purpose, add a flags field, revise the code to create a bunch of ioends for each disposition type, unconditionally try to remap blocks for any reflink'd inode, or do what Christoph proposes, which is to stop (ab)using ioends and simply encode status flags into dio->private. Christoph's approach seems like the easiest, since we're already provided with the offset and size, and both the unwritten extent conversion and the CoW remap code know how to iterate the data fork to look for the extents they want to alter. The overhead probably goes down once we get rid of the memory allocation, but the primary purpose is to make life easier for CoW to avoid unnecessary overhead. Also: I've noticed that if I write 8MB file to a file backed by a failing device, xfs_end_io_direct_write() gets called with size == 8MB even if the writes failed. If the write was to an unwritten extent, the extent will be converted to a regular extent even though the blocks contain old file contents and other garbage, which can subsequently be read off the disk. For CoW I'd only want to remap the blocks if the write totally succeeds. If a disk error happens, the EIO code gets passed back to userspace, and it seems logical to me that the file contents should remain unchanged. To that end, I'm changing dio_iodone_t to pass an error code, and I think I want to change XFS to avoid doing unwritten extent conversions when the write fails. Does that make sense? --D > > Brian > > > _______________________________________________ > > xfs mailing list > > xfs@oss.sgi.com > > http://oss.sgi.com/mailman/listinfo/xfs > > _______________________________________________ > xfs mailing list > xfs@oss.sgi.com > http://oss.sgi.com/mailman/listinfo/xfs From david@fromorbit.com Mon Feb 1 16:05:46 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=ham version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay2.corp.sgi.com [137.38.102.29]) by oss.sgi.com (Postfix) with ESMTP id 4B37B7CB1 for ; Mon, 1 Feb 2016 16:05:46 -0600 (CST) Received: from cuda.sgi.com (cuda3.sgi.com [192.48.176.15]) by relay2.corp.sgi.com (Postfix) with ESMTP id 2D6B7304039 for ; Mon, 1 Feb 2016 14:05:43 -0800 (PST) X-ASG-Debug-ID: 1454364339-04cb6c0d5e1e8700001-NocioJ Received: from ipmail07.adl2.internode.on.net (ipmail07.adl2.internode.on.net [150.101.137.131]) by cuda.sgi.com with ESMTP id 5g4Kxf0EMOotDjr7 for ; Mon, 01 Feb 2016 14:05:40 -0800 (PST) X-Barracuda-Envelope-From: david@fromorbit.com X-Barracuda-Apparent-Source-IP: 150.101.137.131 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: A2DNCQBc1q9W/xATLHlegzqBP4hYnhkBAQEGi2I4hQ2EBYYJBAICgTxNAQEBAQEBgQuEQgEBBCMPASMjEAgDGAICBSECAg8FJQMhE4garyyObQELHhhjhE2EfocygToFlm+NQo55RI16YoQAKC6JawEBAQ Received: from ppp121-44-19-16.lns20.syd4.internode.on.net (HELO dastard) ([121.44.19.16]) by ipmail07.adl2.internode.on.net with ESMTP; 02 Feb 2016 08:35:14 +1030 Received: from dave by dastard with local (Exim 4.80) (envelope-from ) id 1aQMaj-0007Ul-0Z; Tue, 02 Feb 2016 09:05:01 +1100 Date: Tue, 2 Feb 2016 09:05:00 +1100 From: Dave Chinner To: Eric Sandeen Cc: Eric Sandeen , xfs@oss.sgi.com Subject: Re: [PATCH] xfs: lock bitmap/summary inodes in xfs_rtbuf_get() Message-ID: <20160201220500.GW6033@dastard> X-ASG-Orig-Subj: Re: [PATCH] xfs: lock bitmap/summary inodes in xfs_rtbuf_get() References: <56AC2D64.2080907@redhat.com> <20160130210650.GL20456@dastard> <015F4CF0-425A-4EB0-ACE2-4EBBE0B78173@sandeen.net> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <015F4CF0-425A-4EB0-ACE2-4EBBE0B78173@sandeen.net> User-Agent: Mutt/1.5.21 (2010-09-15) X-Barracuda-Connect: ipmail07.adl2.internode.on.net[150.101.137.131] X-Barracuda-Start-Time: 1454364339 X-Barracuda-URL: https://192.48.176.15:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-BRTS-Status: 1 X-Barracuda-Spam-Score: 0.00 X-Barracuda-Spam-Status: No, SCORE=0.00 using per-user scores of TAG_LEVEL=1000.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.7 tests=BSF_SC0_MISMATCH_TO X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.3.26657 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 0.00 BSF_SC0_MISMATCH_TO Envelope rcpt doesn't match header On Sat, Jan 30, 2016 at 03:53:48PM -0600, Eric Sandeen wrote: > OK, thanks Dave. It seemed like it was probably too simple… Yeah, and the simple fix (lock in xfs_bmap_rtalloc()) uncovers further issues w.r.t. logging - the buffers are not stamped with a type, so log recovery will not categorise them correctly. And, I suspect, log recovery might have problems with the bitmap/smmary buffers as they don't have magic numbers in them. More work to be done here... Cheers, Dave. -- Dave Chinner david@fromorbit.com From dave@fromorbit.com Mon Feb 1 18:39:33 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=ham version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay1.corp.sgi.com [137.38.102.111]) by oss.sgi.com (Postfix) with ESMTP id B7EE37CB1 for ; Mon, 1 Feb 2016 18:39:33 -0600 (CST) Received: from cuda.sgi.com (cuda3.sgi.com [192.48.176.15]) by relay1.corp.sgi.com (Postfix) with ESMTP id A8E258F8035 for ; Mon, 1 Feb 2016 16:39:33 -0800 (PST) X-ASG-Debug-ID: 1454373566-04cb6c0d5e1ec040001-NocioJ Received: from ipmail07.adl2.internode.on.net (ipmail07.adl2.internode.on.net [150.101.137.131]) by cuda.sgi.com with ESMTP id vIQfFgzPqBu6sGrd for ; Mon, 01 Feb 2016 16:39:27 -0800 (PST) X-Barracuda-Envelope-From: dave@fromorbit.com X-Barracuda-Apparent-Source-IP: 150.101.137.131 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: A2CoBwC2+a9W/xATLHlWCIM6gT+IWZ4WAQEBAQEBBpEli1RNAQEBAQEBgQuEQgEFJy8zCBgxOQMbGYgavkiFSIh+DnCDbgWHUIcEiBucO44+YoE2AQuCPiguiDKBOQEBAQ Received: from ppp121-44-19-16.lns20.syd4.internode.on.net (HELO dastard) ([121.44.19.16]) by ipmail07.adl2.internode.on.net with ESMTP; 02 Feb 2016 11:09:26 +1030 Received: from disappointment.disaster.area ([192.168.1.110] helo=disappointment) by dastard with esmtp (Exim 4.80) (envelope-from ) id 1aQOzw-0007pp-J2 for xfs@oss.sgi.com; Tue, 02 Feb 2016 11:39:12 +1100 Received: from dave by disappointment with local (Exim 4.86) (envelope-from ) id 1aQOzw-0000pb-I1 for xfs@oss.sgi.com; Tue, 02 Feb 2016 11:39:12 +1100 From: Dave Chinner To: xfs@oss.sgi.com Subject: [PATCH 1/3] xfs: lock rt summary inode on allocation Date: Tue, 2 Feb 2016 11:39:08 +1100 X-ASG-Orig-Subj: [PATCH 1/3] xfs: lock rt summary inode on allocation Message-Id: <1454373550-3102-2-git-send-email-david@fromorbit.com> X-Mailer: git-send-email 2.5.0 In-Reply-To: <1454373550-3102-1-git-send-email-david@fromorbit.com> References: <1454373550-3102-1-git-send-email-david@fromorbit.com> X-Barracuda-Connect: ipmail07.adl2.internode.on.net[150.101.137.131] X-Barracuda-Start-Time: 1454373566 X-Barracuda-URL: https://192.48.176.15:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-BRTS-Status: 1 X-Barracuda-Spam-Score: 0.00 X-Barracuda-Spam-Status: No, SCORE=0.00 using per-user scores of TAG_LEVEL=1000.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.7 tests= X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.3.26662 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- From: Dave Chinner RT allocation can fail on a debug kernel with: XFS: Assertion failed: xfs_isilocked(ip, XFS_ILOCK_SHARED|XFS_ILOCK_EXCL), file: fs/xfs/libxfs/xfs_bmap.c, line: 4039 When modifying the summary inode during allocation. This occurs because the summary inode is never locked, and xfs_bmapi_* operations expect it to be locked. The summary inode is effectively protected byt he lock on the bitmap inode, so this really is only a debug kernel issue. Signed-off-by: Dave Chinner --- fs/xfs/xfs_bmap_util.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/fs/xfs/xfs_bmap_util.c b/fs/xfs/xfs_bmap_util.c index 7087756..fd7f51c 100644 --- a/fs/xfs/xfs_bmap_util.c +++ b/fs/xfs/xfs_bmap_util.c @@ -202,10 +202,12 @@ xfs_bmap_rtalloc( ralen = MAXEXTLEN / mp->m_sb.sb_rextsize; /* - * Lock out other modifications to the RT bitmap inode. + * Lock out modifications to both the RT bitmap and summary inodes */ xfs_ilock(mp->m_rbmip, XFS_ILOCK_EXCL); xfs_trans_ijoin(ap->tp, mp->m_rbmip, XFS_ILOCK_EXCL); + xfs_ilock(mp->m_rsumip, XFS_ILOCK_EXCL); + xfs_trans_ijoin(ap->tp, mp->m_rsumip, XFS_ILOCK_EXCL); /* * If it's an allocation to an empty file at offset 0, -- 2.5.0 From dave@fromorbit.com Mon Feb 1 18:39:34 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=ham version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay3.corp.sgi.com [198.149.34.15]) by oss.sgi.com (Postfix) with ESMTP id B72747CB1 for ; Mon, 1 Feb 2016 18:39:34 -0600 (CST) Received: from cuda.sgi.com (cuda3.sgi.com [192.48.176.15]) by relay3.corp.sgi.com (Postfix) with ESMTP id 3FB88AC002 for ; Mon, 1 Feb 2016 16:39:34 -0800 (PST) X-ASG-Debug-ID: 1454373566-04cb6c0d5e1ec040002-NocioJ Received: from ipmail07.adl2.internode.on.net (ipmail07.adl2.internode.on.net [150.101.137.131]) by cuda.sgi.com with ESMTP id UIm7ym82Cj0EqrFj for ; Mon, 01 Feb 2016 16:39:32 -0800 (PST) X-Barracuda-Envelope-From: dave@fromorbit.com X-Barracuda-Apparent-Source-IP: 150.101.137.131 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: A2AjCgC2+a9W/xATLHlegzqKGJ4WAQEBAQEBBowahQuLVE0BAQEBAQGBC4UeO4ECA4hOn1OedYVIiXyDbgWSbIQDnDuOPmKBNgEBCAEBAQGCPCiKGQEBAQ Received: from ppp121-44-19-16.lns20.syd4.internode.on.net (HELO dastard) ([121.44.19.16]) by ipmail07.adl2.internode.on.net with ESMTP; 02 Feb 2016 11:09:26 +1030 Received: from disappointment.disaster.area ([192.168.1.110] helo=disappointment) by dastard with esmtp (Exim 4.80) (envelope-from ) id 1aQOzw-0007po-IY for xfs@oss.sgi.com; Tue, 02 Feb 2016 11:39:12 +1100 Received: from dave by disappointment with local (Exim 4.86) (envelope-from ) id 1aQOzw-0000pY-HF for xfs@oss.sgi.com; Tue, 02 Feb 2016 11:39:12 +1100 From: Dave Chinner To: xfs@oss.sgi.com Subject: [PATCH 0/3] xfs: fix realtime device assert failures Date: Tue, 2 Feb 2016 11:39:07 +1100 X-ASG-Orig-Subj: [PATCH 0/3] xfs: fix realtime device assert failures Message-Id: <1454373550-3102-1-git-send-email-david@fromorbit.com> X-Mailer: git-send-email 2.5.0 X-Barracuda-Connect: ipmail07.adl2.internode.on.net[150.101.137.131] X-Barracuda-Start-Time: 1454373572 X-Barracuda-URL: https://192.48.176.15:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-BRTS-Status: 1 X-Barracuda-Spam-Score: 0.00 X-Barracuda-Spam-Status: No, SCORE=0.00 using per-user scores of TAG_LEVEL=1000.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.7 tests= X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.3.26662 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- Hi folks, This is a followup to Eric's patch that attempted to fix the assert failure that Ross reported. I'd mentioned I'd looked at this recently, because xfs/090 was triggering the same failure when configured with a RT device. This series fixes the original locking based assert failures, followed by the issues that fixing the original assert uncovered. This now results in xfs/090 failing because of xfs_db check problem (repair is clean) but it (and other tests) no longer assert fail. Cheers, Dave. From dave@fromorbit.com Mon Feb 1 18:39:38 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=ham version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay2.corp.sgi.com [137.38.102.29]) by oss.sgi.com (Postfix) with ESMTP id 8A3847CB9 for ; Mon, 1 Feb 2016 18:39:38 -0600 (CST) Received: from cuda.sgi.com (cuda1.sgi.com [192.48.157.11]) by relay2.corp.sgi.com (Postfix) with ESMTP id 61684304048 for ; Mon, 1 Feb 2016 16:39:38 -0800 (PST) X-ASG-Debug-ID: 1454373572-04bdf04d6a1ff410001-NocioJ Received: from ipmail07.adl2.internode.on.net (ipmail07.adl2.internode.on.net [150.101.137.131]) by cuda.sgi.com with ESMTP id miXTk9kMwt4fdV9D for ; Mon, 01 Feb 2016 16:39:33 -0800 (PST) X-Barracuda-Envelope-From: dave@fromorbit.com X-Barracuda-Apparent-Source-IP: 150.101.137.131 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: A2CoBwC2+a9W/xATLHlWCIM6gT+IWZ4WAQEBAQEBBpEli1RNAQEBAQEBgQuEQgEFJy8zCBgxOQMbGYgavkiFSIkMcINuBY0liUqPJodnhS6OPmKBNgELQBmBZSguiWsBAQE Received: from ppp121-44-19-16.lns20.syd4.internode.on.net (HELO dastard) ([121.44.19.16]) by ipmail07.adl2.internode.on.net with ESMTP; 02 Feb 2016 11:09:26 +1030 Received: from disappointment.disaster.area ([192.168.1.110] helo=disappointment) by dastard with esmtp (Exim 4.80) (envelope-from ) id 1aQOzw-0007pr-KA for xfs@oss.sgi.com; Tue, 02 Feb 2016 11:39:12 +1100 Received: from dave by disappointment with local (Exim 4.86) (envelope-from ) id 1aQOzw-0000pl-JB for xfs@oss.sgi.com; Tue, 02 Feb 2016 11:39:12 +1100 From: Dave Chinner To: xfs@oss.sgi.com Subject: [PATCH 3/3] xfs: RT bitmap and summary buffers need verifiers Date: Tue, 2 Feb 2016 11:39:10 +1100 X-ASG-Orig-Subj: [PATCH 3/3] xfs: RT bitmap and summary buffers need verifiers Message-Id: <1454373550-3102-4-git-send-email-david@fromorbit.com> X-Mailer: git-send-email 2.5.0 In-Reply-To: <1454373550-3102-1-git-send-email-david@fromorbit.com> References: <1454373550-3102-1-git-send-email-david@fromorbit.com> X-Barracuda-Connect: ipmail07.adl2.internode.on.net[150.101.137.131] X-Barracuda-Start-Time: 1454373572 X-Barracuda-URL: https://192.48.157.11:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-BRTS-Status: 1 X-Barracuda-Spam-Score: 0.00 X-Barracuda-Spam-Status: No, SCORE=0.00 using per-user scores of TAG_LEVEL=1000.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.7 tests= X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.3.26662 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- From: Dave Chinner Buffers without verifiers issue runtime warnings on XFS. We don't have anything we can actually verify in the RT buffers (no CRCs, not magic numbers, etc), but we still need verifiers to avoid the warnings. Add a set of dummy verifier operations for the realtime buffers and apply them in the appropriate places. Signed-off-by: Dave Chinner --- fs/xfs/libxfs/xfs_rtbitmap.c | 27 ++++++++++++++++++++++++++- fs/xfs/libxfs/xfs_shared.h | 1 + fs/xfs/xfs_log_recover.c | 4 ++-- 3 files changed, 29 insertions(+), 3 deletions(-) diff --git a/fs/xfs/libxfs/xfs_rtbitmap.c b/fs/xfs/libxfs/xfs_rtbitmap.c index bfa7b85..01c0cdb 100644 --- a/fs/xfs/libxfs/xfs_rtbitmap.c +++ b/fs/xfs/libxfs/xfs_rtbitmap.c @@ -42,6 +42,31 @@ */ /* + * Real time buffers need verifiers to avoid runtime warnigns during IO. + * We don't have anything to verify, however, so these are just dummy + * operations. + */ +static void +xfs_rtbuf_verify_read( + struct xfs_buf *bp) +{ + return; +} + +static void +xfs_rtbuf_verify_write( + struct xfs_buf *bp) +{ + return; +} + +const struct xfs_buf_ops xfs_rtbuf_ops = { + .name = "rtbuf", + .verify_read = xfs_rtbuf_verify_read, + .verify_write = xfs_rtbuf_verify_write, +}; + +/* * Get a buffer for the bitmap or summary file block specified. * The buffer is returned read and locked. */ @@ -68,7 +93,7 @@ xfs_rtbuf_get( ASSERT(map.br_startblock != NULLFSBLOCK); error = xfs_trans_read_buf(mp, tp, mp->m_ddev_targp, XFS_FSB_TO_DADDR(mp, map.br_startblock), - mp->m_bsize, 0, &bp, NULL); + mp->m_bsize, 0, &bp, &xfs_rtbuf_ops); if (error) return error; diff --git a/fs/xfs/libxfs/xfs_shared.h b/fs/xfs/libxfs/xfs_shared.h index 15c3ceb..81ac870 100644 --- a/fs/xfs/libxfs/xfs_shared.h +++ b/fs/xfs/libxfs/xfs_shared.h @@ -53,6 +53,7 @@ extern const struct xfs_buf_ops xfs_dquot_buf_ra_ops; extern const struct xfs_buf_ops xfs_sb_buf_ops; extern const struct xfs_buf_ops xfs_sb_quiet_buf_ops; extern const struct xfs_buf_ops xfs_symlink_buf_ops; +extern const struct xfs_buf_ops xfs_rtbuf_ops; /* * Transaction types. Used to distinguish types of buffers. These never reach diff --git a/fs/xfs/xfs_log_recover.c b/fs/xfs/xfs_log_recover.c index e2d7533..9d09a0d 100644 --- a/fs/xfs/xfs_log_recover.c +++ b/fs/xfs/xfs_log_recover.c @@ -2475,8 +2475,8 @@ xlog_recover_validate_buf_type( break; case XFS_BLFT_RTBITMAP_BUF: case XFS_BLFT_RTSUMMARY_BUF: - /* no verification of RT buffers is done */ - bp->b_ops = NULL; + /* no magic numbers for verification of RT buffers */ + bp->b_ops = &xfs_rtbuf_ops; break; default: xfs_warn(mp, "Unknown buffer type %d!", -- 2.5.0 From dave@fromorbit.com Mon Feb 1 18:39:39 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=ham version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay2.corp.sgi.com [137.38.102.29]) by oss.sgi.com (Postfix) with ESMTP id EE6267CB9 for ; Mon, 1 Feb 2016 18:39:38 -0600 (CST) Received: from cuda.sgi.com (cuda3.sgi.com [192.48.176.15]) by relay2.corp.sgi.com (Postfix) with ESMTP id D0730304048 for ; Mon, 1 Feb 2016 16:39:35 -0800 (PST) X-ASG-Debug-ID: 1454373566-04cb6c0d5e1ec040003-NocioJ Received: from ipmail07.adl2.internode.on.net (ipmail07.adl2.internode.on.net [150.101.137.131]) by cuda.sgi.com with ESMTP id F3XuqPt5KzLeudcD for ; Mon, 01 Feb 2016 16:39:33 -0800 (PST) X-Barracuda-Envelope-From: dave@fromorbit.com X-Barracuda-Apparent-Source-IP: 150.101.137.131 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: A2CoBwC2+a9W/xATLHlUCoM6gT+IWZ4WAQEBAQEBBpEli1RNAQEBAQEBgQuEQgEFJy8zCBgxOQMbGYgavkiFSIkGdoNuBYdQhwSIG5w7jj5igTYBC4I+KC6JawEBAQ Received: from ppp121-44-19-16.lns20.syd4.internode.on.net (HELO dastard) ([121.44.19.16]) by ipmail07.adl2.internode.on.net with ESMTP; 02 Feb 2016 11:09:26 +1030 Received: from disappointment.disaster.area ([192.168.1.110] helo=disappointment) by dastard with esmtp (Exim 4.80) (envelope-from ) id 1aQOzw-0007pq-Jm for xfs@oss.sgi.com; Tue, 02 Feb 2016 11:39:12 +1100 Received: from dave by disappointment with local (Exim 4.86) (envelope-from ) id 1aQOzw-0000pg-IU for xfs@oss.sgi.com; Tue, 02 Feb 2016 11:39:12 +1100 From: Dave Chinner To: xfs@oss.sgi.com Subject: [PATCH 2/3] xfs: RT bitmap and summary buffers are not typed Date: Tue, 2 Feb 2016 11:39:09 +1100 X-ASG-Orig-Subj: [PATCH 2/3] xfs: RT bitmap and summary buffers are not typed Message-Id: <1454373550-3102-3-git-send-email-david@fromorbit.com> X-Mailer: git-send-email 2.5.0 In-Reply-To: <1454373550-3102-1-git-send-email-david@fromorbit.com> References: <1454373550-3102-1-git-send-email-david@fromorbit.com> X-Barracuda-Connect: ipmail07.adl2.internode.on.net[150.101.137.131] X-Barracuda-Start-Time: 1454373573 X-Barracuda-URL: https://192.48.176.15:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-BRTS-Status: 1 X-Barracuda-Spam-Score: 0.00 X-Barracuda-Spam-Status: No, SCORE=0.00 using per-user scores of TAG_LEVEL=1000.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.7 tests= X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.3.26662 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- From: Dave Chinner When logging buffers, we attach a type to them that follows the buffer all the way into the log and is used to identify the buffer contents in log recovery. Both the realtime summary buffers and the bitmap buffers do not have types defined or set, so when we try to log them we see assert failure: XFS: Assertion failed: (bip->bli_flags & XFS_BLI_STALE) || (xfs_blft_from_flags(&bip->__bli_format) > XFS_BLFT_UNKNOWN_BUF && xfs_blft_from_flags(&bip->__bli_format) < XFS_BLFT_MAX_BUF), file: fs/xfs/xfs_buf_item.c, line: 294 Fix this by adding buffer log format types for these buffers, and add identification support into log recovery for them. Signed-off-by: Dave Chinner --- fs/xfs/libxfs/xfs_log_format.h | 2 ++ fs/xfs/libxfs/xfs_rtbitmap.c | 3 +++ fs/xfs/xfs_log_recover.c | 5 +++++ 3 files changed, 10 insertions(+) diff --git a/fs/xfs/libxfs/xfs_log_format.h b/fs/xfs/libxfs/xfs_log_format.h index 03f90b9..d54a801 100644 --- a/fs/xfs/libxfs/xfs_log_format.h +++ b/fs/xfs/libxfs/xfs_log_format.h @@ -496,6 +496,8 @@ enum xfs_blft { XFS_BLFT_ATTR_LEAF_BUF, XFS_BLFT_ATTR_RMT_BUF, XFS_BLFT_SB_BUF, + XFS_BLFT_RTBITMAP_BUF, + XFS_BLFT_RTSUMMARY_BUF, XFS_BLFT_MAX_BUF = (1 << XFS_BLFT_BITS), }; diff --git a/fs/xfs/libxfs/xfs_rtbitmap.c b/fs/xfs/libxfs/xfs_rtbitmap.c index acc71dd..bfa7b85 100644 --- a/fs/xfs/libxfs/xfs_rtbitmap.c +++ b/fs/xfs/libxfs/xfs_rtbitmap.c @@ -71,6 +71,9 @@ xfs_rtbuf_get( mp->m_bsize, 0, &bp, NULL); if (error) return error; + + xfs_trans_buf_set_type(tp, bp, issum ? XFS_BLFT_RTSUMMARY_BUF + : XFS_BLFT_RTBITMAP_BUF); *bpp = bp; return 0; } diff --git a/fs/xfs/xfs_log_recover.c b/fs/xfs/xfs_log_recover.c index 464c5d4..e2d7533 100644 --- a/fs/xfs/xfs_log_recover.c +++ b/fs/xfs/xfs_log_recover.c @@ -2473,6 +2473,11 @@ xlog_recover_validate_buf_type( } bp->b_ops = &xfs_sb_buf_ops; break; + case XFS_BLFT_RTBITMAP_BUF: + case XFS_BLFT_RTSUMMARY_BUF: + /* no verification of RT buffers is done */ + bp->b_ops = NULL; + break; default: xfs_warn(mp, "Unknown buffer type %d!", xfs_blft_from_flags(buf_f)); -- 2.5.0 From sandeen@sandeen.net Mon Feb 1 19:25:30 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=ham version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay1.corp.sgi.com [137.38.102.111]) by oss.sgi.com (Postfix) with ESMTP id 4C18C7CB1 for ; Mon, 1 Feb 2016 19:25:30 -0600 (CST) Received: from cuda.sgi.com (cuda3.sgi.com [192.48.176.15]) by relay1.corp.sgi.com (Postfix) with ESMTP id 3DCE38F8040 for ; Mon, 1 Feb 2016 17:25:26 -0800 (PST) X-ASG-Debug-ID: 1454376324-04cb6c0d5d1ed0e0001-NocioJ Received: from sandeen.net (sandeen.net [63.231.237.45]) by cuda.sgi.com with ESMTP id fczOfPa8dN6iPG0c for ; Mon, 01 Feb 2016 17:25:24 -0800 (PST) X-Barracuda-Envelope-From: sandeen@sandeen.net X-Barracuda-Apparent-Source-IP: 63.231.237.45 Received: from liberator.sandeen.net (liberator.sandeen.net [10.0.0.4]) (using TLSv1.2 with cipher DHE-RSA-AES128-SHA (128/128 bits)) (No client certificate requested) by sandeen.net (Postfix) with ESMTPSA id C7C8B63C6064 for ; Mon, 1 Feb 2016 19:25:23 -0600 (CST) Subject: Re: [PATCH 3/3] xfs: RT bitmap and summary buffers need verifiers To: xfs@oss.sgi.com X-ASG-Orig-Subj: Re: [PATCH 3/3] xfs: RT bitmap and summary buffers need verifiers References: <1454373550-3102-1-git-send-email-david@fromorbit.com> <1454373550-3102-4-git-send-email-david@fromorbit.com> From: Eric Sandeen Message-ID: <56B00582.2070506@sandeen.net> Date: Mon, 1 Feb 2016 19:25:22 -0600 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.11; rv:38.0) Gecko/20100101 Thunderbird/38.5.1 MIME-Version: 1.0 In-Reply-To: <1454373550-3102-4-git-send-email-david@fromorbit.com> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit X-Barracuda-Connect: sandeen.net[63.231.237.45] X-Barracuda-Start-Time: 1454376324 X-Barracuda-URL: https://192.48.176.15:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-BRTS-Status: 1 X-Barracuda-Spam-Score: 0.00 X-Barracuda-Spam-Status: No, SCORE=0.00 using per-user scores of TAG_LEVEL=1000.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.7 tests= X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.3.26663 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- On 2/1/16 6:39 PM, Dave Chinner wrote: > From: Dave Chinner > > Buffers without verifiers issue runtime warnings on XFS. We don't > have anything we can actually verify in the RT buffers (no CRCs, not > magic numbers, etc), but we still need verifiers to avoid the > warnings. > > Add a set of dummy verifier operations for the realtime buffers and > apply them in the appropriate places. > > Signed-off-by: Dave Chinner > --- > fs/xfs/libxfs/xfs_rtbitmap.c | 27 ++++++++++++++++++++++++++- > fs/xfs/libxfs/xfs_shared.h | 1 + > fs/xfs/xfs_log_recover.c | 4 ++-- > 3 files changed, 29 insertions(+), 3 deletions(-) > > diff --git a/fs/xfs/libxfs/xfs_rtbitmap.c b/fs/xfs/libxfs/xfs_rtbitmap.c > index bfa7b85..01c0cdb 100644 > --- a/fs/xfs/libxfs/xfs_rtbitmap.c > +++ b/fs/xfs/libxfs/xfs_rtbitmap.c > @@ -42,6 +42,31 @@ > */ > > /* > + * Real time buffers need verifiers to avoid runtime warnigns during IO. "warnings" ;) Otherwise: Reviewed-by: Eric Sandeen > + * We don't have anything to verify, however, so these are just dummy > + * operations. > + */ > +static void > +xfs_rtbuf_verify_read( > + struct xfs_buf *bp) > +{ > + return; > +} > + > +static void > +xfs_rtbuf_verify_write( > + struct xfs_buf *bp) > +{ > + return; > +} > + > +const struct xfs_buf_ops xfs_rtbuf_ops = { > + .name = "rtbuf", > + .verify_read = xfs_rtbuf_verify_read, > + .verify_write = xfs_rtbuf_verify_write, > +}; > + > +/* > * Get a buffer for the bitmap or summary file block specified. > * The buffer is returned read and locked. > */ > @@ -68,7 +93,7 @@ xfs_rtbuf_get( > ASSERT(map.br_startblock != NULLFSBLOCK); > error = xfs_trans_read_buf(mp, tp, mp->m_ddev_targp, > XFS_FSB_TO_DADDR(mp, map.br_startblock), > - mp->m_bsize, 0, &bp, NULL); > + mp->m_bsize, 0, &bp, &xfs_rtbuf_ops); > if (error) > return error; > > diff --git a/fs/xfs/libxfs/xfs_shared.h b/fs/xfs/libxfs/xfs_shared.h > index 15c3ceb..81ac870 100644 > --- a/fs/xfs/libxfs/xfs_shared.h > +++ b/fs/xfs/libxfs/xfs_shared.h > @@ -53,6 +53,7 @@ extern const struct xfs_buf_ops xfs_dquot_buf_ra_ops; > extern const struct xfs_buf_ops xfs_sb_buf_ops; > extern const struct xfs_buf_ops xfs_sb_quiet_buf_ops; > extern const struct xfs_buf_ops xfs_symlink_buf_ops; > +extern const struct xfs_buf_ops xfs_rtbuf_ops; > > /* > * Transaction types. Used to distinguish types of buffers. These never reach > diff --git a/fs/xfs/xfs_log_recover.c b/fs/xfs/xfs_log_recover.c > index e2d7533..9d09a0d 100644 > --- a/fs/xfs/xfs_log_recover.c > +++ b/fs/xfs/xfs_log_recover.c > @@ -2475,8 +2475,8 @@ xlog_recover_validate_buf_type( > break; > case XFS_BLFT_RTBITMAP_BUF: > case XFS_BLFT_RTSUMMARY_BUF: > - /* no verification of RT buffers is done */ > - bp->b_ops = NULL; > + /* no magic numbers for verification of RT buffers */ > + bp->b_ops = &xfs_rtbuf_ops; > break; > default: > xfs_warn(mp, "Unknown buffer type %d!", > From sandeen@sandeen.net Mon Feb 1 19:26:21 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=ham version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay2.corp.sgi.com [137.38.102.29]) by oss.sgi.com (Postfix) with ESMTP id DF3EA7CB1 for ; Mon, 1 Feb 2016 19:26:21 -0600 (CST) Received: from cuda.sgi.com (cuda2.sgi.com [192.48.176.25]) by relay2.corp.sgi.com (Postfix) with ESMTP id D08F5304043 for ; Mon, 1 Feb 2016 17:26:18 -0800 (PST) X-ASG-Debug-ID: 1454376377-04cbb026ff20c2b0001-NocioJ Received: from sandeen.net (sandeen.net [63.231.237.45]) by cuda.sgi.com with ESMTP id lXfY5HZp1D8K2SAb for ; Mon, 01 Feb 2016 17:26:17 -0800 (PST) X-Barracuda-Envelope-From: sandeen@sandeen.net X-Barracuda-Apparent-Source-IP: 63.231.237.45 Received: from liberator.sandeen.net (liberator.sandeen.net [10.0.0.4]) (using TLSv1.2 with cipher DHE-RSA-AES128-SHA (128/128 bits)) (No client certificate requested) by sandeen.net (Postfix) with ESMTPSA id EC84063C6064 for ; Mon, 1 Feb 2016 19:26:16 -0600 (CST) Subject: Re: [PATCH 2/3] xfs: RT bitmap and summary buffers are not typed To: xfs@oss.sgi.com X-ASG-Orig-Subj: Re: [PATCH 2/3] xfs: RT bitmap and summary buffers are not typed References: <1454373550-3102-1-git-send-email-david@fromorbit.com> <1454373550-3102-3-git-send-email-david@fromorbit.com> From: Eric Sandeen Message-ID: <56B005B7.6040605@sandeen.net> Date: Mon, 1 Feb 2016 19:26:15 -0600 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.11; rv:38.0) Gecko/20100101 Thunderbird/38.5.1 MIME-Version: 1.0 In-Reply-To: <1454373550-3102-3-git-send-email-david@fromorbit.com> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit X-Barracuda-Connect: sandeen.net[63.231.237.45] X-Barracuda-Start-Time: 1454376377 X-Barracuda-URL: https://192.48.176.25:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-BRTS-Status: 1 X-Barracuda-Spam-Score: 0.00 X-Barracuda-Spam-Status: No, SCORE=0.00 using per-user scores of TAG_LEVEL=1000.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.7 tests= X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.3.26663 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- On 2/1/16 6:39 PM, Dave Chinner wrote: > From: Dave Chinner > > When logging buffers, we attach a type to them that follows the > buffer all the way into the log and is used to identify the buffer > contents in log recovery. Both the realtime summary buffers and the > bitmap buffers do not have types defined or set, so when we try to > log them we see assert failure: > > XFS: Assertion failed: (bip->bli_flags & XFS_BLI_STALE) || (xfs_blft_from_flags(&bip->__bli_format) > XFS_BLFT_UNKNOWN_BUF && xfs_blft_from_flags(&bip->__bli_format) < XFS_BLFT_MAX_BUF), file: fs/xfs/xfs_buf_item.c, line: 294 > > Fix this by adding buffer log format types for these buffers, and > add identification support into log recovery for them. > > Signed-off-by: Dave Chinner Reviewed-by: Eric Sandeen > --- > fs/xfs/libxfs/xfs_log_format.h | 2 ++ > fs/xfs/libxfs/xfs_rtbitmap.c | 3 +++ > fs/xfs/xfs_log_recover.c | 5 +++++ > 3 files changed, 10 insertions(+) > > diff --git a/fs/xfs/libxfs/xfs_log_format.h b/fs/xfs/libxfs/xfs_log_format.h > index 03f90b9..d54a801 100644 > --- a/fs/xfs/libxfs/xfs_log_format.h > +++ b/fs/xfs/libxfs/xfs_log_format.h > @@ -496,6 +496,8 @@ enum xfs_blft { > XFS_BLFT_ATTR_LEAF_BUF, > XFS_BLFT_ATTR_RMT_BUF, > XFS_BLFT_SB_BUF, > + XFS_BLFT_RTBITMAP_BUF, > + XFS_BLFT_RTSUMMARY_BUF, > XFS_BLFT_MAX_BUF = (1 << XFS_BLFT_BITS), > }; > > diff --git a/fs/xfs/libxfs/xfs_rtbitmap.c b/fs/xfs/libxfs/xfs_rtbitmap.c > index acc71dd..bfa7b85 100644 > --- a/fs/xfs/libxfs/xfs_rtbitmap.c > +++ b/fs/xfs/libxfs/xfs_rtbitmap.c > @@ -71,6 +71,9 @@ xfs_rtbuf_get( > mp->m_bsize, 0, &bp, NULL); > if (error) > return error; > + > + xfs_trans_buf_set_type(tp, bp, issum ? XFS_BLFT_RTSUMMARY_BUF > + : XFS_BLFT_RTBITMAP_BUF); > *bpp = bp; > return 0; > } > diff --git a/fs/xfs/xfs_log_recover.c b/fs/xfs/xfs_log_recover.c > index 464c5d4..e2d7533 100644 > --- a/fs/xfs/xfs_log_recover.c > +++ b/fs/xfs/xfs_log_recover.c > @@ -2473,6 +2473,11 @@ xlog_recover_validate_buf_type( > } > bp->b_ops = &xfs_sb_buf_ops; > break; > + case XFS_BLFT_RTBITMAP_BUF: > + case XFS_BLFT_RTSUMMARY_BUF: > + /* no verification of RT buffers is done */ > + bp->b_ops = NULL; > + break; > default: > xfs_warn(mp, "Unknown buffer type %d!", > xfs_blft_from_flags(buf_f)); > From sandeen@sandeen.net Mon Feb 1 19:26:53 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=ham version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay1.corp.sgi.com [137.38.102.111]) by oss.sgi.com (Postfix) with ESMTP id 742437CB1 for ; Mon, 1 Feb 2016 19:26:53 -0600 (CST) Received: from cuda.sgi.com (cuda2.sgi.com [192.48.176.25]) by relay1.corp.sgi.com (Postfix) with ESMTP id 6638D8F8039 for ; Mon, 1 Feb 2016 17:26:53 -0800 (PST) X-ASG-Debug-ID: 1454376411-04cbb026fd20c2d0001-NocioJ Received: from sandeen.net (sandeen.net [63.231.237.45]) by cuda.sgi.com with ESMTP id dKWQ9pmyr4GGAkmb for ; Mon, 01 Feb 2016 17:26:51 -0800 (PST) X-Barracuda-Envelope-From: sandeen@sandeen.net X-Barracuda-Apparent-Source-IP: 63.231.237.45 Received: from liberator.sandeen.net (liberator.sandeen.net [10.0.0.4]) (using TLSv1.2 with cipher DHE-RSA-AES128-SHA (128/128 bits)) (No client certificate requested) by sandeen.net (Postfix) with ESMTPSA id AF23663C6064 for ; Mon, 1 Feb 2016 19:26:51 -0600 (CST) Subject: Re: [PATCH 1/3] xfs: lock rt summary inode on allocation To: xfs@oss.sgi.com X-ASG-Orig-Subj: Re: [PATCH 1/3] xfs: lock rt summary inode on allocation References: <1454373550-3102-1-git-send-email-david@fromorbit.com> <1454373550-3102-2-git-send-email-david@fromorbit.com> From: Eric Sandeen Message-ID: <56B005DA.2030200@sandeen.net> Date: Mon, 1 Feb 2016 19:26:50 -0600 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.11; rv:38.0) Gecko/20100101 Thunderbird/38.5.1 MIME-Version: 1.0 In-Reply-To: <1454373550-3102-2-git-send-email-david@fromorbit.com> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit X-Barracuda-Connect: sandeen.net[63.231.237.45] X-Barracuda-Start-Time: 1454376411 X-Barracuda-URL: https://192.48.176.25:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-BRTS-Status: 1 X-Barracuda-Spam-Score: 0.00 X-Barracuda-Spam-Status: No, SCORE=0.00 using per-user scores of TAG_LEVEL=1000.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.7 tests= X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.3.26663 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- On 2/1/16 6:39 PM, Dave Chinner wrote: > From: Dave Chinner > > RT allocation can fail on a debug kernel with: > > XFS: Assertion failed: xfs_isilocked(ip, XFS_ILOCK_SHARED|XFS_ILOCK_EXCL), file: fs/xfs/libxfs/xfs_bmap.c, line: 4039 > > When modifying the summary inode during allocation. This occurs > because the summary inode is never locked, and xfs_bmapi_* > operations expect it to be locked. The summary inode is effectively > protected byt he lock on the bitmap inode, so this really is only a > debug kernel issue. > > Signed-off-by: Dave Chinner Oh, it was easy after all... Reviewed-by: Eric Sandeen > --- > fs/xfs/xfs_bmap_util.c | 4 +++- > 1 file changed, 3 insertions(+), 1 deletion(-) > > diff --git a/fs/xfs/xfs_bmap_util.c b/fs/xfs/xfs_bmap_util.c > index 7087756..fd7f51c 100644 > --- a/fs/xfs/xfs_bmap_util.c > +++ b/fs/xfs/xfs_bmap_util.c > @@ -202,10 +202,12 @@ xfs_bmap_rtalloc( > ralen = MAXEXTLEN / mp->m_sb.sb_rextsize; > > /* > - * Lock out other modifications to the RT bitmap inode. > + * Lock out modifications to both the RT bitmap and summary inodes > */ > xfs_ilock(mp->m_rbmip, XFS_ILOCK_EXCL); > xfs_trans_ijoin(ap->tp, mp->m_rbmip, XFS_ILOCK_EXCL); > + xfs_ilock(mp->m_rsumip, XFS_ILOCK_EXCL); > + xfs_trans_ijoin(ap->tp, mp->m_rsumip, XFS_ILOCK_EXCL); > > /* > * If it's an allocation to an empty file at offset 0, > From david@fromorbit.com Mon Feb 1 23:14:37 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=ham version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay1.corp.sgi.com [137.38.102.111]) by oss.sgi.com (Postfix) with ESMTP id 7FC267CB1 for ; Mon, 1 Feb 2016 23:14:37 -0600 (CST) Received: from cuda.sgi.com (cuda2.sgi.com [192.48.176.25]) by relay1.corp.sgi.com (Postfix) with ESMTP id 7202B8F8039 for ; Mon, 1 Feb 2016 21:14:34 -0800 (PST) X-ASG-Debug-ID: 1454390063-04cbb026fc2114e0001-NocioJ Received: from ipmail07.adl2.internode.on.net (ipmail07.adl2.internode.on.net [150.101.137.131]) by cuda.sgi.com with ESMTP id tUl7ns3QbZ3t4Nqv for ; Mon, 01 Feb 2016 21:14:23 -0800 (PST) X-Barracuda-Envelope-From: david@fromorbit.com X-Barracuda-Apparent-Source-IP: 150.101.137.131 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: A2AqCABlOrBW/xATLHlegzqBP4hZnhcBAQEBAQEGi2WFRIQFhgkCAgEBAoE1TQEBAQEBAYELhEIBAQQnExwjEAgDGAklDwUlAyETiBq+FQEBAQEGAgEdGIUwhH6HXYEPBZZxjUKOeUSNemKCAhmBZSguiWsBAQE Received: from ppp121-44-19-16.lns20.syd4.internode.on.net (HELO dastard) ([121.44.19.16]) by ipmail07.adl2.internode.on.net with ESMTP; 02 Feb 2016 15:44:22 +1030 Received: from dave by dastard with local (Exim 4.80) (envelope-from ) id 1aQTI2-0008Ne-2U; Tue, 02 Feb 2016 16:14:10 +1100 Date: Tue, 2 Feb 2016 16:14:10 +1100 From: Dave Chinner To: "Darrick J. Wong" Cc: xfs@oss.sgi.com Subject: Re: [PATCH 5/5] xfs_io: print dedupe errors to stderr, not stdout Message-ID: <20160202051410.GB32032@dastard> X-ASG-Orig-Subj: Re: [PATCH 5/5] xfs_io: print dedupe errors to stderr, not stdout References: <20160123003502.2475.99558.stgit@birch.djwong.org> <20160123003531.2475.59752.stgit@birch.djwong.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20160123003531.2475.59752.stgit@birch.djwong.org> User-Agent: Mutt/1.5.21 (2010-09-15) X-Barracuda-Connect: ipmail07.adl2.internode.on.net[150.101.137.131] X-Barracuda-Start-Time: 1454390063 X-Barracuda-URL: https://192.48.176.25:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-BRTS-Status: 1 X-Barracuda-Spam-Score: 0.00 X-Barracuda-Spam-Status: No, SCORE=0.00 using per-user scores of TAG_LEVEL=1000.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.7 tests=BSF_SC0_MISMATCH_TO X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.3.26666 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 0.00 BSF_SC0_MISMATCH_TO Envelope rcpt doesn't match header On Fri, Jan 22, 2016 at 04:35:31PM -0800, Darrick J. Wong wrote: > Signed-off-by: Darrick J. Wong > --- > io/reflink.c | 6 ++++-- > 1 file changed, 4 insertions(+), 2 deletions(-) > > > diff --git a/io/reflink.c b/io/reflink.c > index def01be..a09e82d 100644 > --- a/io/reflink.c > +++ b/io/reflink.c > @@ -78,11 +78,13 @@ dedupe_ioctl( > goto done; > } > if (info->status < 0) { > - printf("dedupe: %s\n", _(strerror(-info->status))); > + fprintf(stderr, "dedupe: %s\n", > + _(strerror(-info->status))); > goto done; > } > if (info->status == XFS_EXTENT_DATA_DIFFERS) { > - printf(_("Extents did not match.\n")); > + fprintf(stderr, "dedupe: %s\n", > + _("Extents did not match.")); > goto done; > } > if (args->length != 0 && I think this patch breaks dedupe detection in xfstests. I see the dedupe tests running instead of being detected as not supported, and all the diffs from test failures contain: +dedupe: Invalid argument This is on 4.5-rc2, so I suspect it's not returning the expected "not supported" error to xfstests from the ioctl. Cheers, Dave. -- Dave Chinner david@fromorbit.com From darrick.wong@oracle.com Mon Feb 1 23:16:24 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay1.corp.sgi.com [137.38.102.111]) by oss.sgi.com (Postfix) with ESMTP id 4CC597CB1 for ; Mon, 1 Feb 2016 23:16:24 -0600 (CST) Received: from cuda.sgi.com (cuda1.sgi.com [192.48.157.11]) by relay1.corp.sgi.com (Postfix) with ESMTP id 136178F8033 for ; Mon, 1 Feb 2016 21:16:23 -0800 (PST) X-ASG-Debug-ID: 1454390180-04bdf04d6b209540001-NocioJ Received: from userp1040.oracle.com (userp1040.oracle.com [156.151.31.81]) by cuda.sgi.com with ESMTP id 1DuxB4jWn21gWw8c (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO) for ; Mon, 01 Feb 2016 21:16:21 -0800 (PST) X-Barracuda-Envelope-From: darrick.wong@oracle.com X-Barracuda-Apparent-Source-IP: 156.151.31.81 Received: from aserv0022.oracle.com (aserv0022.oracle.com [141.146.126.234]) by userp1040.oracle.com (Sentrion-MTA-4.3.2/Sentrion-MTA-4.3.2) with ESMTP id u125GFGG001335 (version=TLSv1 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Tue, 2 Feb 2016 05:16:16 GMT Received: from aserv0121.oracle.com (aserv0121.oracle.com [141.146.126.235]) by aserv0022.oracle.com (8.13.8/8.13.8) with ESMTP id u125GFeN025388 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=FAIL); Tue, 2 Feb 2016 05:16:15 GMT Received: from abhmp0001.oracle.com (abhmp0001.oracle.com [141.146.116.7]) by aserv0121.oracle.com (8.13.8/8.13.8) with ESMTP id u125GFFC021781; Tue, 2 Feb 2016 05:16:15 GMT Received: from localhost (/24.21.154.84) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Mon, 01 Feb 2016 21:16:15 -0800 Date: Mon, 1 Feb 2016 21:16:13 -0800 From: "Darrick J. Wong" To: Dave Chinner Cc: xfs@oss.sgi.com Subject: Re: [PATCH 5/5] xfs_io: print dedupe errors to stderr, not stdout Message-ID: <20160202051613.GB22352@birch.djwong.org> X-ASG-Orig-Subj: Re: [PATCH 5/5] xfs_io: print dedupe errors to stderr, not stdout References: <20160123003502.2475.99558.stgit@birch.djwong.org> <20160123003531.2475.59752.stgit@birch.djwong.org> <20160202051410.GB32032@dastard> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20160202051410.GB32032@dastard> User-Agent: Mutt/1.5.21 (2010-09-15) X-Source-IP: aserv0022.oracle.com [141.146.126.234] X-Barracuda-Connect: userp1040.oracle.com[156.151.31.81] X-Barracuda-Start-Time: 1454390181 X-Barracuda-Encrypted: ECDHE-RSA-AES256-GCM-SHA384 X-Barracuda-URL: https://192.48.157.11:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-BRTS-Status: 1 X-Barracuda-Spam-Score: 0.00 X-Barracuda-Spam-Status: No, SCORE=0.00 using per-user scores of TAG_LEVEL=1000.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.7 tests=BSF_SC0_MISMATCH_TO, UNPARSEABLE_RELAY X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.3.26666 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 0.00 BSF_SC0_MISMATCH_TO Envelope rcpt doesn't match header 0.00 UNPARSEABLE_RELAY Informational: message has unparseable relay lines On Tue, Feb 02, 2016 at 04:14:10PM +1100, Dave Chinner wrote: > On Fri, Jan 22, 2016 at 04:35:31PM -0800, Darrick J. Wong wrote: > > Signed-off-by: Darrick J. Wong > > --- > > io/reflink.c | 6 ++++-- > > 1 file changed, 4 insertions(+), 2 deletions(-) > > > > > > diff --git a/io/reflink.c b/io/reflink.c > > index def01be..a09e82d 100644 > > --- a/io/reflink.c > > +++ b/io/reflink.c > > @@ -78,11 +78,13 @@ dedupe_ioctl( > > goto done; > > } > > if (info->status < 0) { > > - printf("dedupe: %s\n", _(strerror(-info->status))); > > + fprintf(stderr, "dedupe: %s\n", > > + _(strerror(-info->status))); > > goto done; > > } > > if (info->status == XFS_EXTENT_DATA_DIFFERS) { > > - printf(_("Extents did not match.\n")); > > + fprintf(stderr, "dedupe: %s\n", > > + _("Extents did not match.")); > > goto done; > > } > > if (args->length != 0 && > > I think this patch breaks dedupe detection in xfstests. I see the > dedupe tests running instead of being detected as not supported, and > all the diffs from test failures contain: > > +dedupe: Invalid argument > > This is on 4.5-rc2, so I suspect it's not returning the expected > "not supported" error to xfstests from the ioctl. Christoph sent a patch "[PATCH 3/4] xfstests: also treat EINVAL as reflink/dedup not supported" to take care of that. --D > > Cheers, > > Dave. > -- > Dave Chinner > david@fromorbit.com From david@fromorbit.com Mon Feb 1 23:16:49 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=ham version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay1.corp.sgi.com [137.38.102.111]) by oss.sgi.com (Postfix) with ESMTP id 4282A7CB1 for ; Mon, 1 Feb 2016 23:16:49 -0600 (CST) Received: from cuda.sgi.com (cuda3.sgi.com [192.48.176.15]) by relay1.corp.sgi.com (Postfix) with ESMTP id 28E148F8033 for ; Mon, 1 Feb 2016 21:16:49 -0800 (PST) X-ASG-Debug-ID: 1454390201-04cb6c0d601f2830001-NocioJ Received: from ipmail07.adl2.internode.on.net (ipmail07.adl2.internode.on.net [150.101.137.131]) by cuda.sgi.com with ESMTP id PIDtZiVweq7SOvQm for ; Mon, 01 Feb 2016 21:16:42 -0800 (PST) X-Barracuda-Envelope-From: david@fromorbit.com X-Barracuda-Apparent-Source-IP: 150.101.137.131 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: A2AqCABlOrBW/xATLHlegzqBP4hZnhcBAQEBAQEGi2WFRIQFhgkCAgEBAoE1TQEBAQEBAYELhEIBAQQnExwjEAgDGAklDwUlAyETiBq+FQEBAQEGAgEdGIUwhH6HXYEPBZZxjUKOeUSNemKCAhmBZSguiWsBAQE Received: from ppp121-44-19-16.lns20.syd4.internode.on.net (HELO dastard) ([121.44.19.16]) by ipmail07.adl2.internode.on.net with ESMTP; 02 Feb 2016 15:46:41 +1030 Received: from dave by dastard with local (Exim 4.80) (envelope-from ) id 1aQTKG-0008OF-LB; Tue, 02 Feb 2016 16:16:28 +1100 Date: Tue, 2 Feb 2016 16:16:28 +1100 From: Dave Chinner To: "Darrick J. Wong" Cc: xfs@oss.sgi.com Subject: Re: [PATCH 5/5] xfs_io: print dedupe errors to stderr, not stdout Message-ID: <20160202051628.GC32032@dastard> X-ASG-Orig-Subj: Re: [PATCH 5/5] xfs_io: print dedupe errors to stderr, not stdout References: <20160123003502.2475.99558.stgit@birch.djwong.org> <20160123003531.2475.59752.stgit@birch.djwong.org> <20160202051410.GB32032@dastard> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20160202051410.GB32032@dastard> User-Agent: Mutt/1.5.21 (2010-09-15) X-Barracuda-Connect: ipmail07.adl2.internode.on.net[150.101.137.131] X-Barracuda-Start-Time: 1454390201 X-Barracuda-URL: https://192.48.176.15:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-BRTS-Status: 1 X-Barracuda-Spam-Score: 0.00 X-Barracuda-Spam-Status: No, SCORE=0.00 using per-user scores of TAG_LEVEL=1000.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.7 tests=BSF_SC0_MISMATCH_TO X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.3.26666 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 0.00 BSF_SC0_MISMATCH_TO Envelope rcpt doesn't match header On Tue, Feb 02, 2016 at 04:14:10PM +1100, Dave Chinner wrote: > On Fri, Jan 22, 2016 at 04:35:31PM -0800, Darrick J. Wong wrote: > > Signed-off-by: Darrick J. Wong > > --- > > io/reflink.c | 6 ++++-- > > 1 file changed, 4 insertions(+), 2 deletions(-) > > > > > > diff --git a/io/reflink.c b/io/reflink.c > > index def01be..a09e82d 100644 > > --- a/io/reflink.c > > +++ b/io/reflink.c > > @@ -78,11 +78,13 @@ dedupe_ioctl( > > goto done; > > } > > if (info->status < 0) { > > - printf("dedupe: %s\n", _(strerror(-info->status))); > > + fprintf(stderr, "dedupe: %s\n", > > + _(strerror(-info->status))); > > goto done; > > } > > if (info->status == XFS_EXTENT_DATA_DIFFERS) { > > - printf(_("Extents did not match.\n")); > > + fprintf(stderr, "dedupe: %s\n", > > + _("Extents did not match.")); > > goto done; > > } > > if (args->length != 0 && > > I think this patch breaks dedupe detection in xfstests. I see the > dedupe tests running instead of being detected as not supported, and > all the diffs from test failures contain: > > +dedupe: Invalid argument > > This is on 4.5-rc2, so I suspect it's not returning the expected > "not supported" error to xfstests from the ioctl. Oh, never mind. I just found the xfstests patches Christoph sent to the wrong list that will fix this. Cheers, Dave. -- Dave Chinner david@fromorbit.com From bounce@bosphorushaber.com Tue Feb 2 01:28:27 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=HTML_MESSAGE,MIME_QP_LONG_LINE, T_DKIM_INVALID,T_TVD_FUZZY_SECTOR autolearn=ham version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay1.corp.sgi.com [137.38.102.111]) by oss.sgi.com (Postfix) with ESMTP id 60FD17CB1 for ; Tue, 2 Feb 2016 01:28:27 -0600 (CST) Received: from cuda.sgi.com (cuda1.sgi.com [192.48.157.11]) by relay1.corp.sgi.com (Postfix) with ESMTP id D0C9B8F8033 for ; Mon, 1 Feb 2016 23:28:23 -0800 (PST) X-ASG-Debug-ID: 1454398083-04bdf04d6c20fa90001-NocioJ Received: from user-108.bosphorushaber.com (user-108.bosphorushaber.com [185.82.221.108]) by cuda.sgi.com with ESMTP id PbV7LJou2XfeD7G2 for ; Mon, 01 Feb 2016 23:28:04 -0800 (PST) X-Barracuda-Envelope-From: bounce@bosphorushaber.com X-Barracuda-Apparent-Source-IP: 185.82.221.108 DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; s=dkim; d=bosphorushaber.com; h=Sender:Message-ID:Date:Subject:From:Reply-To:To:MIME-Version:Content-Type:List-Id:List-Unsubscribe; i=user-49@bosphorushaber.com; bh=hbVWrUBw9gMwLYLtJl8oHXpjFE8=; b=GAZpGYjaXoyKO/+bqISb5td+j01XB0yNQkEufGxtTs8RZdqEwUDHTiu8C/WRypzfqBRXvzuLgYwm 7ufZWkdQoh4hTFPMbsHgH1kP+D5e4gpgNu9Srz1+4x14UJaLH8Qy2x0t6moOa3kr65XxChKmpBME g3+11fEBs63JD0V7sA8= DomainKey-Signature: a=rsa-sha1; c=nofws; q=dns; s=dkim; d=bosphorushaber.com; b=P6dgJYT55z83ycvKGli/qn/SrCa+W9c8P4cefEOAd8G8eOY0O50vjNhKMdlagR8wny6hZoB/tsfd 09Jrg/Bk9iwJFKHkqe1pVU4N9cg6te5RWL9AjVx0S8TUPp91Tg9OoFc3v5L/tmV6EYNcB3iBb3NC WkOLGrP2W988Zo8O+rM=; Sender: user-49@bosphorushaber.com Message-ID: Date: Tue, 02 Feb 2016 07:27:42 +0000 Subject: Sosyal =?utf-8?Q?G=C3=BCvenlik?= ve =?utf-8?Q?=C4=B0=C5=9F?= Hukuku =?utf-8?Q?Uygulamalar=C4=B1nda?= Son =?utf-8?Q?D=C3=BCzenlemeler?= From: Elif Altunkaynak X-ASG-Orig-Subj: Sosyal =?utf-8?Q?G=C3=BCvenlik?= ve =?utf-8?Q?=C4=B0=C5=9F?= Hukuku =?utf-8?Q?Uygulamalar=C4=B1nda?= Son =?utf-8?Q?D=C3=BCzenlemeler?= Reply-To: Elif Altunkaynak To: "xfs@oss.sgi.com" MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="_=_swift_v4_1454398062_ae0e8a19e2aecb70765f3bd2dbd45f4e_=_" X-Receiver: xfs@oss.sgi.com X-Report-Abuse: Please report abuse for this campaign here: http://bosphorushaber.com/index.php/campaigns/qj1810emsh911/report-abuse/kf4673fqgv1ef/rk0917ya18bf8 X-Mw-Tracking-Did: 0 List-Id: kf4673fqgv1ef List-Unsubscribe: , X-Mw-Campaign-Uid: qj1810emsh911 X-Mw-Subscriber-Uid: rk0917ya18bf8 X-Mw-Customer-Uid: qw4572hlmx233 X-Sender: bounce@bosphorushaber.com X-Mw-Customer-Gid: 0 X-Mw-Mailer: SwiftMailer X-Mw-Delivery-Sid: 1 X-Barracuda-Connect: user-108.bosphorushaber.com[185.82.221.108] X-Barracuda-Start-Time: 1454398084 X-Barracuda-URL: https://192.48.157.11:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-BRTS-Status: 1 X-Barracuda-Spam-Score: 0.92 X-Barracuda-Spam-Status: No, SCORE=0.92 using per-user scores of TAG_LEVEL=1000.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.7 tests=BSF_SC0_SA085, DKIM_SIGNED, DKIM_VERIFIED, HTML_MESSAGE, MIME_QP_LONG_LINE, MIME_QP_LONG_LINE_2 X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.3.26669 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- -0.00 DKIM_VERIFIED Domain Keys Identified Mail: signature passes verification 0.00 DKIM_SIGNED Domain Keys Identified Mail: message has a signature 0.00 HTML_MESSAGE BODY: HTML included in message 0.00 MIME_QP_LONG_LINE RAW: Quoted-printable line longer than 76 chars 0.82 MIME_QP_LONG_LINE_2 RAW: Quoted-printable line longer than 76 chars 0.10 BSF_SC0_SA085 Custom Rule SA085 --_=_swift_v4_1454398062_ae0e8a19e2aecb70765f3bd2dbd45f4e_=_ Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable =20 ?alma Hayatnda G=FCncel Gelimelerle Sosyal G=FCvenlik ve Hukuku Uygulamalar 2016 Yl Torba Kanunlarla , SGK ve SG'de Yaplacak Deiiklikler, Asgari =DCcret, Yabanc =E7i =C7altrlmas gibi Tevik ve Devlet Destekleri, Denetimlere Hazrlk, G=FCncel Yarg Kararlar , dari Para Cezalar, S=FCre=E7te Potansiyel Sorunlar ve Pratik =C7=F6z=FCm =D6nerileri 27 ubat 2016 / 09.00 - 17.00 / Istanbul Hilton - Harbiye Konumaclar: PROF. DR. NURşEN CANİKLİOĞLU / Marmara =DCniversitesi Hukuk Fak=FCltesi =D6zel Hukuk B=F6l=FCm Bakan İSA KARAKAŞ / Sosyal G=FCvenlik ve Hukuku Bauzman/ 20 Yl Akn =C7SGB/SGK Bam=FCfettii OTURUM KONULARı: - 2016 Torba Kanunlarda Yaplan Deiiklikler, - Asgari =DCcret Tevikleri - Uygulama esaslar- Tevik nasl hesaplanacak? - Yeni yazlmlara ihtiya=E7 olacak m? - Asgari =FCcret art =FCcret politikalarn nasl etkileyecek? - Maliyet artlarnn kapatlmas i=E7in alnabilecek =F6nlemler- - Artk iverenin daha lehine olan prim teviklerini kullanmak bir =E7=F6z=FCm olabilir m? - Doum Yapan =E7ilere Part-time =E7alma esaslar - Genel Salk Sigorta deiiklikleri - =E7i-veren htilaflarnn =C7=F6z=FCm=FCne Y=F6nelik Yaplacak Deiiklikler - Yabanc =C7altrmasnda Yaplacak Kolaylklar - Ge=E7ici Koruma Salanan Yabanclarn =C7alma zinlerine Dair Y=F6netmelik neler getiriyor? - Bu Y=F6netmelik h=FCk=FCmleri iveren i=E7in maliyet destei salayacak m? - Aylk Prim ve Hizmet Belgelerinde sigortalnn meslei ile meslek kodunun bildirimi ilikin yaplacak d=FCzenlemeler ve denetim - G=FCvenlii Uzmanlar-yeri Hekimlerinin Hizmet S=FCrelerinde ve idari para cezalarnda y=FCr=FCrl=FCe girecek deiiklikler - SGK lemlerinde tiraz Ve Mahkeme Yolunda Yaplan Deiiklikler ve Uygulamas - Kanunundaki dari Para Cezalar - Sal ve G=FCvenlii Kanunundaki dari Para Cezalar - 6645 sayl Kanunla yaplan deiiklikler - yerinin az tehlikeli- tehlikeli ve =E7ok tehlikeli oluu idari para cezasn nasl etkiliyor? - =C7alan saysnn =F6nemi nedir? - Sosyal Sigortalar ve Genel Salk Sigortas Kanunda =D6ng=F6r=FClen dari Para Cezalar - dari Para cezalarndan kurtulma yollar - Kazas bildirimlerinde ve =FCcret tahakkuku ile SGK prim belgelerinde en =E7ok yaplan hatalar ve uygulamas - SGK Tevik lemlerinde Yaplan Deiiklikler Ve Uygulamas, avantajl teviklerden geriye doru faydalanlmas - e ade le lgili Deiiklikler Ve Uygulamas, e iade halinde yaplmas gereken SGK uygulamalar - Alt iveren (Taeron)-=DCst veren likisinde Deiikler le Bu likiden Kaynaklanan Asl verenin SGK- Kanunu le Sal Ve G=FCvenlii Bakmndan Y=FCk=FCml=FCl=FCk Ve Sorumluluklar le Alt verenliin Y=F6netimi, Muvazaa le lgili tiraz Ve Mahkeme Yollarna likin Deiiklikler - Yarg kararlar =E7er=E7evesinde i S=F6zlemesinin sonlandrlmasnda en =E7ok yaplan hatalar, ge=E7erli savunma-ihtarname ve tutanak d=FCzenlenmesi esaslar - Ge=E7erli braname ve belge d=FCzenlenmesinde p=FCf noktalar - Sal Ve G=FCvenlii Uygulamalarnda Yaplan K=F6kl=FC Deiiklikler Ve Getirilen Yenilikler: - Yeni y=FCk=FCml=FCl=FCkler ve idari para cezalarndan yaplan deiiklikler - G=FCvenlii uzmanlarna iverenlerine kar verilen yeni yetki-sorumluluklar ile m=FCeyyideler - =E7ilere verilen y=FCk=FCml=FCl=FCk e sorumluluklar ile i s=F6zlemesinin feshini gerektiren i g=FCvenliine ilikin nedenler - Yap denetim kurulularna verilen yeni yetki-sorumluluklar ile m=FCeyyideler - Sal Ve G=FCvenlii Uygulamalarnda tutulmas gereken defter ve ge=E7erli belge d=FCzenlenmesi - 2015 yl Torba Kanunu ile izinlerinde yaplan deiiklikler ile dier=20 Kanunu ilemlerinde yaplan deiiklikler ve uygulamas - Sosyal g=FCvenlik ile i mevzuatna ilikin dier deiiklik ve yenilikler - =C7alma ve Sosyal G=FCvenlik Teftilerine Hazrlk Uygulamalar - Ge=E7erli ve mevzuata uygun iyeri kayt ve belgelerinin d=FCzenlenmesi ve dikkat edilecek hususlar - =C7alanlarn meslekleri ile =FCcretleri baznda yaplan denetimler - Sekt=F6r baznda yaplan denetimler - in y=FCr=FCt=FCm koullarna ilikin denetimler - kazas-meslek hastalklar ile i sal ve g=FCvenlii denetimleri - sal ve g=FCvenlii baznda kayt ve belgelerinin d=FCzenlenmesi ve dikkat edilecek hususlar - hbar-ikayet bazl denetimler - Tefti s=FCrecinin y=F6netimi ile dier denetimlere ilikin dier hususlar=20 T=FCm Katlmclara Zirve D=F6k=FCmantasyonu ve kongre kitlerinin yansra sa Karaka'n "SGK- KUR ve Mevzuatnda dari Para Cezalar le =C7=F6z=FCm Yollar" Kitab hediye edilecektir. Bu eserde bata SGK olmak =FCzere, 4857 sayl=20 Kanunu, KUR-sizlik Sigortas, Yabanclar Mevzuat ve Yeni y=FCr=FCrl=FCe konan=20 Sal ve G=FCvenlii Kanunu uygulamalarnda =F6ng=F6r=FClen y=FCk=FCml=FCl=FCkler, bu y=FCk=FCml=FCl=FCklere bal olarak uygulanan idari para cezalar ile ihtilaflarnn =E7=F6z=FCm yollar bir b=FCt=FCn olarak ele alnmtr.=20 Katlm i=E7in kayt formu doldurulmas ve banka makbuzu ile tarafmza g=F6nderilmesi gerekmektedir. Programlarmz kontenjanlarmzla snrldr. Kayt ilemlerini web sayfamzdan online yapabilirsiniz, Program katlm bedeli 950TL+ KDV'dir. =D6le yemekleri, ara ikramlar, zirve kitleri, eitim notlar ve t=FCm d=F6k=FCmantasyon =FCcrete dahildir. Grup ndirim Oranlar: Ayn Firmadan 3 - 6 Katlmda %5, Ayn Firmadan 6 ve =FCzeri katlmda oran uygulanmaktadr. Toplu katlm, sponsorluk ve erken kayt avantajlarndan faydalanmak i=E7in l=FCtfen araynz: Kayt Yaptrmak i=E7in l=FCtfen tklaynz: BOSPHORUS CONFERENCES http://www.bogaziciegitim.com.tr 0216 422 9595 - 0555 422 9595 Bu etkinlik duyurusu tarafnza =FCye veritabanmzda kaytl olduunuz i=E7in g=F6nderilmitir. Bu hizmetimizden yararlanmak istemiyorsanz listemizden ayrlmak i=E7in buraya http://bosphorushaber.com/index.php/lists/kf4673fqgv1ef/unsubscribe/rk0917ya18bf8/qj1810emsh911 tklaynz. Mailimizi d=FCzg=FCn g=F6r=FCnt=FCleyemiyorsanz l=FCtfen buraya http://bosphorushaber.com/index.php/campaigns/qj1810emsh911/web-version/rk0917ya18bf8 tklaynz.=20 Bo=C4=9Fazi=C3=A7i E=C4=9Fitim http://www.bogaziciegitim.com.tr=20 istanbul Turkey a= lma Hayatnda G?ncel Gelimelerle Sosyal G?venlik ve Hukuku Uygulamal= ar 2016 Yl Torba Kanunlarla , SGK ve SG'de Yaplacak Deiiklikler,= Asgari ?cret, Yaba= nc ?i =C7altrlmas gibi Tevik ve Devlet Destekleri, Denetimlere Hazrlk, G=FCncel Yarg Kararlar , dari Para Cezalar, S=FCre=E7te Potansiyel Sorunlar ve Pratik =C7=F6z=FCm =D6nerileri 27 ubat 2016 / 09.00 - 17.00 / Istanbul Hilton - Harbiye Konumaclar: PROF. DR. NURşEN CANİKLİOĞLU / Marmara =DCniversitesi Hukuk Fak=FCltesi =D6zel Hukuk B=F6l=FCm Bakan İSA KARAKAŞ / Sosyal G=FCvenlik ve Hukuku Bauzman/ 20 Yl Akn =C7SGB/SGK Bam=FCfettii OTURUM KONULARı: - 2016 Torba Kanunlarda Yaplan Deiiklikler, - Asgari =DCcret Tevikleri - Uygulama esaslar- Tevik nasl hesaplanacak? - Yeni yazlmlara ihtiya=E7 olacak m? - Asgari =FCcret art =FCcret politikalarn nasl etkileyecek? - Maliyet artlarnn kapatlmas i=E7in alnabilecek =F6nlemler- - Artk iverenin daha lehine olan prim teviklerini kullanmak bir =E7=F6z=FCm olabilir m? - Doum Yapan =E7ilere Part-time =E7alma esaslar - Genel Salk Sigorta deiiklikleri - =E7i-veren htilaflarnn =C7=F6z=FCm=FCne Y=F6nelik Yaplacak Deiiklikler - Yabanc =C7altrmasnda Yaplacak Kolaylklar - Ge=E7ici Koruma Salanan Yabanclarn =C7alma zinlerine Dair Y=F6netmelik neler getiriyor? - Bu Y=F6netmelik h=FCk=FCmleri iveren i=E7in maliyet destei salayacak m? - Aylk Prim ve Hizmet Belgelerinde sigortalnn meslei ile meslek kodunun bildirimi ilikin yaplacak d=FCzenlemeler ve denetim - G=FCvenlii Uzmanlar-yeri Hekimlerinin Hizmet S=FCrelerinde ve idari para cezalarnda y=FCr=FCrl=FCe girecek deiiklikler - SGK lemlerinde tiraz Ve Mahkeme Yolunda Yaplan Deiiklikler ve Uygulamas - Kanunundaki dari Para Cezalar - Sal ve G=FCvenlii Kanunundaki dari Para Cezalar - 6645 sayl Kanunla yaplan deiiklikler - yerinin az tehlikeli- tehlikeli ve =E7ok tehlikeli oluu idari para cezasn nasl etkiliyor? - =C7alan saysnn =F6nemi nedir? - Sosyal Sigortalar ve Genel Salk Sigortas Kanunda =D6ng=F6r=FClen dari Para Cezalar - dari Para cezalarndan kurtulma yollar - Kazas bildirimlerinde ve =FCcret tahakkuku ile SGK prim belgelerinde en =E7ok yaplan hatalar ve uygulamas - SGK Tevik lemlerinde Yaplan Deiiklikler Ve Uygulamas, avantajl teviklerden geriye doru faydalanlmas - e ade le lgili Deiiklikler Ve Uygulamas, e iade halinde yaplmas gereken SGK uygulamalar - Alt iveren (Taeron)-=DCst veren likisinde Deiikler le Bu likiden Kaynaklanan Asl verenin SGK- Kanunu le Sal Ve G=FCvenlii Bakmndan Y=FCk=FCml=FCl=FCk Ve Sorumluluklar le Alt verenliin Y=F6netimi, Muvazaa le lgili tiraz Ve Mahkeme Yollarna likin Deiiklikler - Yarg kararlar =E7er=E7evesinde i S=F6zlemesinin sonlandrlmasnda en =E7ok yaplan hatalar, ge=E7erli savunma-ihtarname ve tutanak d=FCzenlenmesi esaslar - Ge=E7erli braname ve belge d=FCzenlenmesinde p=FCf noktalar - Sal Ve G=FCvenlii Uygulamalarnda Yaplan K=F6kl=FC Deiiklikler Ve Getirilen Yenilikler: - Yeni y=FCk=FCml=FCl=FCkler ve idari para cezalarndan yaplan deiiklikler - G=FCvenlii uzmanlarna iverenlerine kar verilen yeni yetki-sorumluluklar ile m=FCeyyideler - =E7ilere verilen y=FCk=FCml=FCl=FCk e sorumluluklar ile i s=F6zlemesinin feshini gerektiren i g=FCvenliine ilikin nedenler - Yap denetim kurulularna verilen yeni yetki-sorumluluklar ile m=FCeyyideler - Sal Ve G=FCvenlii Uygulamalarnda tutulmas gereken defter ve ge=E7erli belge d=FCzenlenmesi - 2015 yl Torba Kanunu ile izinlerinde yaplan deiiklikler ile dier=20 Kanunu ilemlerinde yaplan deiiklikler ve uygulamas - Sosyal g=FCvenlik ile i mevzuatna ilikin dier deiiklik ve yenilikler - =C7alma ve Sosyal G=FCvenlik Teftilerine Hazrlk Uygulamalar - Ge=E7erli ve mevzuata uygun iyeri kayt ve belgelerinin d=FCzenlenmesi ve dikkat edilecek hususlar - =C7alanlarn meslekleri ile =FCcretleri baznda yaplan denetimler - Sekt=F6r baznda yaplan denetimler - in y=FCr=FCt=FCm koullarna ilikin denetimler - kazas-meslek hastalklar ile i sal ve g=FCvenlii denetimleri - sal ve g=FCvenlii baznda kayt ve belgelerinin d=FCzenlenmesi ve dikkat edilecek hususlar - hbar-ikayet bazl denetimler - Tefti s=FCrecinin y=F6netimi ile dier denetimlere ilikin dier hususlar=20 T=FCm Katlmclara Zirve D=F6k=FCmantasyonu ve kongre kitlerinin yansra sa Karaka'n "SGK- KUR ve Mevzuatnda dari Para Cezalar le =C7=F6z=FCm Yollar" Kitab hediye edilecektir. Bu eserde bata SGK olmak =FCzere, 4857 sayl=20 Kanunu, KUR-sizlik Sigortas, Yabanclar Mevzuat ve Yeni y=FCr=FCrl=FCe konan=20 Sal ve G=FCvenlii Kanunu uygulamalarnda =F6ng=F6r=FClen y=FCk=FCml=FCl=FCkler, bu y=FCk=FCml=FCl=FCklere bal olarak uygulanan idari para cezalar ile ihtilaflarnn =E7=F6z=FCm yollar bir b=FCt=FCn olarak ele alnmtr.=20 Katlm i=E7in kayt formu doldurulmas ve banka makbuzu ile tarafmza g=F6nderilmesi gerekmektedir. Programlarmz kontenjanlarmzla snrldr. Kayt ilemlerini web sayfamzdan online yapabilirsiniz, Program katlm bedeli 950TL+ KDV'dir. =D6le yemekleri, ara ikramlar, zirve kitleri, eitim notlar ve t=FCm d=F6k=FCmantasyon =FCcrete dahildir. Grup ndirim Oranlar: Ayn Firmadan 3 - 6 Katlmda %5, Ayn Firmadan 6 ve =FCzeri katlmda oran uygulanmaktadr. Toplu katlm, sponsorluk ve erken kayt avantajlarndan faydalanmak i=E7in l=FCtfen araynz: Kayt Yaptrmak i=E7in l=FCtfen tklaynz: BOSPHORUS CONFERENCES http://www.bogaziciegitim.com.tr 0216 422 9595 - 0555 422 9595 Bu etkinlik duyurusu tarafnza =FCye veritabanmzda kaytl olduunuz i=E7in g=F6nderilmitir. Bu hizmetimizden yararlanmak istemiyorsanz listemizden ayrlmak i=E7in buraya http://bosphorushaber.com/index.php/lists/kf4673fqgv1ef/unsubscribe/rk0917ya18bf8/qj1810emsh911 tklaynz. Mailimizi d=FCzg=FCn g=F6r=FCnt=FCleyemiyorsanz l=FCtfen buraya http://bosphorushaber.com/index.php/campaigns/qj1810emsh911/web-version/rk0917ya18bf8 tklaynz.=20 Bo=C4=9Fazi=C3=A7i E=C4=9Fitim http://www.bogaziciegitim.com.tr=20 istanbul Turkey i= ?altrlmas gibi Tevik ve Devlet Destekleri, Denetimlere Hazrlk, G?nc= el Yarg Kararlar , dari Para Cezalar, S= ?re?te Potansiyel Sorunlar ve Pratik =C7=F6z=FCm =D6nerileri 27 ubat 2016 / 09.00 - 17.00 / Istanbul Hilton - Harbiye Konumaclar: PROF. DR. NURşEN CANİKLİOĞLU / Marmara =DCniversitesi Hukuk Fak=FCltesi =D6zel Hukuk B=F6l=FCm Bakan İSA KARAKAŞ / Sosyal G=FCvenlik ve Hukuku Bauzman/ 20 Yl Akn =C7SGB/SGK Bam=FCfettii OTURUM KONULARı: - 2016 Torba Kanunlarda Yaplan Deiiklikler, - Asgari =DCcret Tevikleri - Uygulama esaslar- Tevik nasl hesaplanacak? - Yeni yazlmlara ihtiya=E7 olacak m? - Asgari =FCcret art =FCcret politikalarn nasl etkileyecek? - Maliyet artlarnn kapatlmas i=E7in alnabilecek =F6nlemler- - Artk iverenin daha lehine olan prim teviklerini kullanmak bir =E7=F6z=FCm olabilir m? - Doum Yapan =E7ilere Part-time =E7alma esaslar - Genel Salk Sigorta deiiklikleri - =E7i-veren htilaflarnn =C7=F6z=FCm=FCne Y=F6nelik Yaplacak Deiiklikler - Yabanc =C7altrmasnda Yaplacak Kolaylklar - Ge=E7ici Koruma Salanan Yabanclarn =C7alma zinlerine Dair Y=F6netmelik neler getiriyor? - Bu Y=F6netmelik h=FCk=FCmleri iveren i=E7in maliyet destei salayacak m? - Aylk Prim ve Hizmet Belgelerinde sigortalnn meslei ile meslek kodunun bildirimi ilikin yaplacak d=FCzenlemeler ve denetim - G=FCvenlii Uzmanlar-yeri Hekimlerinin Hizmet S=FCrelerinde ve idari para cezalarnda y=FCr=FCrl=FCe girecek deiiklikler - SGK lemlerinde tiraz Ve Mahkeme Yolunda Yaplan Deiiklikler ve Uygulamas - Kanunundaki dari Para Cezalar - Sal ve G=FCvenlii Kanunundaki dari Para Cezalar - 6645 sayl Kanunla yaplan deiiklikler - yerinin az tehlikeli- tehlikeli ve =E7ok tehlikeli oluu idari para cezasn nasl etkiliyor? - =C7alan saysnn =F6nemi nedir? - Sosyal Sigortalar ve Genel Salk Sigortas Kanunda =D6ng=F6r=FClen dari Para Cezalar - dari Para cezalarndan kurtulma yollar - Kazas bildirimlerinde ve =FCcret tahakkuku ile SGK prim belgelerinde en =E7ok yaplan hatalar ve uygulamas - SGK Tevik lemlerinde Yaplan Deiiklikler Ve Uygulamas, avantajl teviklerden geriye doru faydalanlmas - e ade le lgili Deiiklikler Ve Uygulamas, e iade halinde yaplmas gereken SGK uygulamalar - Alt iveren (Taeron)-=DCst veren likisinde Deiikler le Bu likiden Kaynaklanan Asl verenin SGK- Kanunu le Sal Ve G=FCvenlii Bakmndan Y=FCk=FCml=FCl=FCk Ve Sorumluluklar le Alt verenliin Y=F6netimi, Muvazaa le lgili tiraz Ve Mahkeme Yollarna likin Deiiklikler - Yarg kararlar =E7er=E7evesinde i S=F6zlemesinin sonlandrlmasnda en =E7ok yaplan hatalar, ge=E7erli savunma-ihtarname ve tutanak d=FCzenlenmesi esaslar - Ge=E7erli braname ve belge d=FCzenlenmesinde p=FCf noktalar - Sal Ve G=FCvenlii Uygulamalarnda Yaplan K=F6kl=FC Deiiklikler Ve Getirilen Yenilikler: - Yeni y=FCk=FCml=FCl=FCkler ve idari para cezalarndan yaplan deiiklikler - G=FCvenlii uzmanlarna iverenlerine kar verilen yeni yetki-sorumluluklar ile m=FCeyyideler - =E7ilere verilen y=FCk=FCml=FCl=FCk e sorumluluklar ile i s=F6zlemesinin feshini gerektiren i g=FCvenliine ilikin nedenler - Yap denetim kurulularna verilen yeni yetki-sorumluluklar ile m=FCeyyideler - Sal Ve G=FCvenlii Uygulamalarnda tutulmas gereken defter ve ge=E7erli belge d=FCzenlenmesi - 2015 yl Torba Kanunu ile izinlerinde yaplan deiiklikler ile dier=20 Kanunu ilemlerinde yaplan deiiklikler ve uygulamas - Sosyal g=FCvenlik ile i mevzuatna ilikin dier deiiklik ve yenilikler - =C7alma ve Sosyal G=FCvenlik Teftilerine Hazrlk Uygulamalar - Ge=E7erli ve mevzuata uygun iyeri kayt ve belgelerinin d=FCzenlenmesi ve dikkat edilecek hususlar - =C7alanlarn meslekleri ile =FCcretleri baznda yaplan denetimler - Sekt=F6r baznda yaplan denetimler - in y=FCr=FCt=FCm koullarna ilikin denetimler - kazas-meslek hastalklar ile i sal ve g=FCvenlii denetimleri - sal ve g=FCvenlii baznda kayt ve belgelerinin d=FCzenlenmesi ve dikkat edilecek hususlar - hbar-ikayet bazl denetimler - Tefti s=FCrecinin y=F6netimi ile dier denetimlere ilikin dier hususlar=20 T=FCm Katlmclara Zirve D=F6k=FCmantasyonu ve kongre kitlerinin yansra sa Karaka'n "SGK- KUR ve Mevzuatnda dari Para Cezalar le =C7=F6z=FCm Yollar" Kitab hediye edilecektir. Bu eserde bata SGK olmak =FCzere, 4857 sayl=20 Kanunu, KUR-sizlik Sigortas, Yabanclar Mevzuat ve Yeni y=FCr=FCrl=FCe konan=20 Sal ve G=FCvenlii Kanunu uygulamalarnda =F6ng=F6r=FClen y=FCk=FCml=FCl=FCkler, bu y=FCk=FCml=FCl=FCklere bal olarak uygulanan idari para cezalar ile ihtilaflarnn =E7=F6z=FCm yollar bir b=FCt=FCn olarak ele alnmtr.=20 Katlm i=E7in kayt formu doldurulmas ve banka makbuzu ile tarafmza g=F6nderilmesi gerekmektedir. Programlarmz kontenjanlarmzla snrldr. Kayt ilemlerini web sayfamzdan online yapabilirsiniz, Program katlm bedeli 950TL+ KDV'dir. =D6le yemekleri, ara ikramlar, zirve kitleri, eitim notlar ve t=FCm d=F6k=FCmantasyon =FCcrete dahildir. Grup ndirim Oranlar: Ayn Firmadan 3 - 6 Katlmda %5, Ayn Firmadan 6 ve =FCzeri katlmda oran uygulanmaktadr. Toplu katlm, sponsorluk ve erken kayt avantajlarndan faydalanmak i=E7in l=FCtfen araynz: Kayt Yaptrmak i=E7in l=FCtfen tklaynz: BOSPHORUS CONFERENCES http://www.bogaziciegitim.com.tr 0216 422 9595 - 0555 422 9595 Bu etkinlik duyurusu tarafnza =FCye veritabanmzda kaytl olduunuz i=E7in g=F6nderilmitir. Bu hizmetimizden yararlanmak istemiyorsanz listemizden ayrlmak i=E7in buraya http://bosphorushaber.com/index.php/lists/kf4673fqgv1ef/unsubscribe/rk0917ya18bf8/qj1810emsh911 tklaynz. Mailimizi d=FCzg=FCn g=F6r=FCnt=FCleyemiyorsanz l=FCtfen buraya http://bosphorushaber.com/index.php/campaigns/qj1810emsh911/web-version/rk0917ya18bf8 tklaynz.=20 Bo=C4=9Fazi=C3=A7i E=C4=9Fitim http://www.bogaziciegitim.com.tr=20 istanbul Turkey t= e Potansiyel Sorunlar ve Pratik = ?=F6z=FCm =D6nerileri 27 ubat 2016 / 09.00 - 17.00 / Istanbul Hilton - Harbiye Konumaclar: PROF. DR. NURşEN CANİKLİOĞLU / Marmara =DCniversitesi Hukuk Fak=FCltesi =D6zel Hukuk B=F6l=FCm Bakan İSA KARAKAŞ / Sosyal G=FCvenlik ve Hukuku Bauzman/ 20 Yl Akn =C7SGB/SGK Bam=FCfettii OTURUM KONULARı: - 2016 Torba Kanunlarda Yaplan Deiiklikler, - Asgari =DCcret Tevikleri - Uygulama esaslar- Tevik nasl hesaplanacak? - Yeni yazlmlara ihtiya=E7 olacak m? - Asgari =FCcret art =FCcret politikalarn nasl etkileyecek? - Maliyet artlarnn kapatlmas i=E7in alnabilecek =F6nlemler- - Artk iverenin daha lehine olan prim teviklerini kullanmak bir =E7=F6z=FCm olabilir m? - Doum Yapan =E7ilere Part-time =E7alma esaslar - Genel Salk Sigorta deiiklikleri - =E7i-veren htilaflarnn =C7=F6z=FCm=FCne Y=F6nelik Yaplacak Deiiklikler - Yabanc =C7altrmasnda Yaplacak Kolaylklar - Ge=E7ici Koruma Salanan Yabanclarn =C7alma zinlerine Dair Y=F6netmelik neler getiriyor? - Bu Y=F6netmelik h=FCk=FCmleri iveren i=E7in maliyet destei salayacak m? - Aylk Prim ve Hizmet Belgelerinde sigortalnn meslei ile meslek kodunun bildirimi ilikin yaplacak d=FCzenlemeler ve denetim - G=FCvenlii Uzmanlar-yeri Hekimlerinin Hizmet S=FCrelerinde ve idari para cezalarnda y=FCr=FCrl=FCe girecek deiiklikler - SGK lemlerinde tiraz Ve Mahkeme Yolunda Yaplan Deiiklikler ve Uygulamas - Kanunundaki dari Para Cezalar - Sal ve G=FCvenlii Kanunundaki dari Para Cezalar - 6645 sayl Kanunla yaplan deiiklikler - yerinin az tehlikeli- tehlikeli ve =E7ok tehlikeli oluu idari para cezasn nasl etkiliyor? - =C7alan saysnn =F6nemi nedir? - Sosyal Sigortalar ve Genel Salk Sigortas Kanunda =D6ng=F6r=FClen dari Para Cezalar - dari Para cezalarndan kurtulma yollar - Kazas bildirimlerinde ve =FCcret tahakkuku ile SGK prim belgelerinde en =E7ok yaplan hatalar ve uygulamas - SGK Tevik lemlerinde Yaplan Deiiklikler Ve Uygulamas, avantajl teviklerden geriye doru faydalanlmas - e ade le lgili Deiiklikler Ve Uygulamas, e iade halinde yaplmas gereken SGK uygulamalar - Alt iveren (Taeron)-=DCst veren likisinde Deiikler le Bu likiden Kaynaklanan Asl verenin SGK- Kanunu le Sal Ve G=FCvenlii Bakmndan Y=FCk=FCml=FCl=FCk Ve Sorumluluklar le Alt verenliin Y=F6netimi, Muvazaa le lgili tiraz Ve Mahkeme Yollarna likin Deiiklikler - Yarg kararlar =E7er=E7evesinde i S=F6zlemesinin sonlandrlmasnda en =E7ok yaplan hatalar, ge=E7erli savunma-ihtarname ve tutanak d=FCzenlenmesi esaslar - Ge=E7erli braname ve belge d=FCzenlenmesinde p=FCf noktalar - Sal Ve G=FCvenlii Uygulamalarnda Yaplan K=F6kl=FC Deiiklikler Ve Getirilen Yenilikler: - Yeni y=FCk=FCml=FCl=FCkler ve idari para cezalarndan yaplan deiiklikler - G=FCvenlii uzmanlarna iverenlerine kar verilen yeni yetki-sorumluluklar ile m=FCeyyideler - =E7ilere verilen y=FCk=FCml=FCl=FCk e sorumluluklar ile i s=F6zlemesinin feshini gerektiren i g=FCvenliine ilikin nedenler - Yap denetim kurulularna verilen yeni yetki-sorumluluklar ile m=FCeyyideler - Sal Ve G=FCvenlii Uygulamalarnda tutulmas gereken defter ve ge=E7erli belge d=FCzenlenmesi - 2015 yl Torba Kanunu ile izinlerinde yaplan deiiklikler ile dier=20 Kanunu ilemlerinde yaplan deiiklikler ve uygulamas - Sosyal g=FCvenlik ile i mevzuatna ilikin dier deiiklik ve yenilikler - =C7alma ve Sosyal G=FCvenlik Teftilerine Hazrlk Uygulamalar - Ge=E7erli ve mevzuata uygun iyeri kayt ve belgelerinin d=FCzenlenmesi ve dikkat edilecek hususlar - =C7alanlarn meslekleri ile =FCcretleri baznda yaplan denetimler - Sekt=F6r baznda yaplan denetimler - in y=FCr=FCt=FCm koullarna ilikin denetimler - kazas-meslek hastalklar ile i sal ve g=FCvenlii denetimleri - sal ve g=FCvenlii baznda kayt ve belgelerinin d=FCzenlenmesi ve dikkat edilecek hususlar - hbar-ikayet bazl denetimler - Tefti s=FCrecinin y=F6netimi ile dier denetimlere ilikin dier hususlar=20 T=FCm Katlmclara Zirve D=F6k=FCmantasyonu ve kongre kitlerinin yansra sa Karaka'n "SGK- KUR ve Mevzuatnda dari Para Cezalar le =C7=F6z=FCm Yollar" Kitab hediye edilecektir. Bu eserde bata SGK olmak =FCzere, 4857 sayl=20 Kanunu, KUR-sizlik Sigortas, Yabanclar Mevzuat ve Yeni y=FCr=FCrl=FCe konan=20 Sal ve G=FCvenlii Kanunu uygulamalarnda =F6ng=F6r=FClen y=FCk=FCml=FCl=FCkler, bu y=FCk=FCml=FCl=FCklere bal olarak uygulanan idari para cezalar ile ihtilaflarnn =E7=F6z=FCm yollar bir b=FCt=FCn olarak ele alnmtr.=20 Katlm i=E7in kayt formu doldurulmas ve banka makbuzu ile tarafmza g=F6nderilmesi gerekmektedir. Programlarmz kontenjanlarmzla snrldr. Kayt ilemlerini web sayfamzdan online yapabilirsiniz, Program katlm bedeli 950TL+ KDV'dir. =D6le yemekleri, ara ikramlar, zirve kitleri, eitim notlar ve t=FCm d=F6k=FCmantasyon =FCcrete dahildir. Grup ndirim Oranlar: Ayn Firmadan 3 - 6 Katlmda %5, Ayn Firmadan 6 ve =FCzeri katlmda oran uygulanmaktadr. Toplu katlm, sponsorluk ve erken kayt avantajlarndan faydalanmak i=E7in l=FCtfen araynz: Kayt Yaptrmak i=E7in l=FCtfen tklaynz: BOSPHORUS CONFERENCES http://www.bogaziciegitim.com.tr 0216 422 9595 - 0555 422 9595 Bu etkinlik duyurusu tarafnza =FCye veritabanmzda kaytl olduunuz i=E7in g=F6nderilmitir. Bu hizmetimizden yararlanmak istemiyorsanz listemizden ayrlmak i=E7in buraya http://bosphorushaber.com/index.php/lists/kf4673fqgv1ef/unsubscribe/rk0917ya18bf8/qj1810emsh911 tklaynz. Mailimizi d=FCzg=FCn g=F6r=FCnt=FCleyemiyorsanz l=FCtfen buraya http://bosphorushaber.com/index.php/campaigns/qj1810emsh911/web-version/rk0917ya18bf8 tklaynz.=20 Bo=C4=9Fazi=C3=A7i E=C4=9Fitim http://www.bogaziciegitim.com.tr=20 istanbul Turkey ?z?m =D6nerileri 27 ubat 2016 / 09.00 - 17.00 / Istanbul Hilton - Harbiye Konumaclar: PROF. DR. NURşEN CANİKLİOĞLU / Marmara =DCniversitesi Hukuk Fak=FCltesi =D6zel Hukuk B=F6l=FCm Bakan İSA KARAKAŞ / Sosyal G=FCvenlik ve Hukuku Bauzman/ 20 Yl Akn =C7SGB/SGK Bam=FCfettii OTURUM KONULARı: - 2016 Torba Kanunlarda Yaplan Deiiklikler, - Asgari =DCcret Tevikleri - Uygulama esaslar- Tevik nasl hesaplanacak? - Yeni yazlmlara ihtiya=E7 olacak m? - Asgari =FCcret art =FCcret politikalarn nasl etkileyecek? - Maliyet artlarnn kapatlmas i=E7in alnabilecek =F6nlemler- - Artk iverenin daha lehine olan prim teviklerini kullanmak bir =E7=F6z=FCm olabilir m? - Doum Yapan =E7ilere Part-time =E7alma esaslar - Genel Salk Sigorta deiiklikleri - =E7i-veren htilaflarnn =C7=F6z=FCm=FCne Y=F6nelik Yaplacak Deiiklikler - Yabanc =C7altrmasnda Yaplacak Kolaylklar - Ge=E7ici Koruma Salanan Yabanclarn =C7alma zinlerine Dair Y=F6netmelik neler getiriyor? - Bu Y=F6netmelik h=FCk=FCmleri iveren i=E7in maliyet destei salayacak m? - Aylk Prim ve Hizmet Belgelerinde sigortalnn meslei ile meslek kodunun bildirimi ilikin yaplacak d=FCzenlemeler ve denetim - G=FCvenlii Uzmanlar-yeri Hekimlerinin Hizmet S=FCrelerinde ve idari para cezalarnda y=FCr=FCrl=FCe girecek deiiklikler - SGK lemlerinde tiraz Ve Mahkeme Yolunda Yaplan Deiiklikler ve Uygulamas - Kanunundaki dari Para Cezalar - Sal ve G=FCvenlii Kanunundaki dari Para Cezalar - 6645 sayl Kanunla yaplan deiiklikler - yerinin az tehlikeli- tehlikeli ve =E7ok tehlikeli oluu idari para cezasn nasl etkiliyor? - =C7alan saysnn =F6nemi nedir? - Sosyal Sigortalar ve Genel Salk Sigortas Kanunda =D6ng=F6r=FClen dari Para Cezalar - dari Para cezalarndan kurtulma yollar - Kazas bildirimlerinde ve =FCcret tahakkuku ile SGK prim belgelerinde en =E7ok yaplan hatalar ve uygulamas - SGK Tevik lemlerinde Yaplan Deiiklikler Ve Uygulamas, avantajl teviklerden geriye doru faydalanlmas - e ade le lgili Deiiklikler Ve Uygulamas, e iade halinde yaplmas gereken SGK uygulamalar - Alt iveren (Taeron)-=DCst veren likisinde Deiikler le Bu likiden Kaynaklanan Asl verenin SGK- Kanunu le Sal Ve G=FCvenlii Bakmndan Y=FCk=FCml=FCl=FCk Ve Sorumluluklar le Alt verenliin Y=F6netimi, Muvazaa le lgili tiraz Ve Mahkeme Yollarna likin Deiiklikler - Yarg kararlar =E7er=E7evesinde i S=F6zlemesinin sonlandrlmasnda en =E7ok yaplan hatalar, ge=E7erli savunma-ihtarname ve tutanak d=FCzenlenmesi esaslar - Ge=E7erli braname ve belge d=FCzenlenmesinde p=FCf noktalar - Sal Ve G=FCvenlii Uygulamalarnda Yaplan K=F6kl=FC Deiiklikler Ve Getirilen Yenilikler: - Yeni y=FCk=FCml=FCl=FCkler ve idari para cezalarndan yaplan deiiklikler - G=FCvenlii uzmanlarna iverenlerine kar verilen yeni yetki-sorumluluklar ile m=FCeyyideler - =E7ilere verilen y=FCk=FCml=FCl=FCk e sorumluluklar ile i s=F6zlemesinin feshini gerektiren i g=FCvenliine ilikin nedenler - Yap denetim kurulularna verilen yeni yetki-sorumluluklar ile m=FCeyyideler - Sal Ve G=FCvenlii Uygulamalarnda tutulmas gereken defter ve ge=E7erli belge d=FCzenlenmesi - 2015 yl Torba Kanunu ile izinlerinde yaplan deiiklikler ile dier=20 Kanunu ilemlerinde yaplan deiiklikler ve uygulamas - Sosyal g=FCvenlik ile i mevzuatna ilikin dier deiiklik ve yenilikler - =C7alma ve Sosyal G=FCvenlik Teftilerine Hazrlk Uygulamalar - Ge=E7erli ve mevzuata uygun iyeri kayt ve belgelerinin d=FCzenlenmesi ve dikkat edilecek hususlar - =C7alanlarn meslekleri ile =FCcretleri baznda yaplan denetimler - Sekt=F6r baznda yaplan denetimler - in y=FCr=FCt=FCm koullarna ilikin denetimler - kazas-meslek hastalklar ile i sal ve g=FCvenlii denetimleri - sal ve g=FCvenlii baznda kayt ve belgelerinin d=FCzenlenmesi ve dikkat edilecek hususlar - hbar-ikayet bazl denetimler - Tefti s=FCrecinin y=F6netimi ile dier denetimlere ilikin dier hususlar=20 T=FCm Katlmclara Zirve D=F6k=FCmantasyonu ve kongre kitlerinin yansra sa Karaka'n "SGK- KUR ve Mevzuatnda dari Para Cezalar le =C7=F6z=FCm Yollar" Kitab hediye edilecektir. Bu eserde bata SGK olmak =FCzere, 4857 sayl=20 Kanunu, KUR-sizlik Sigortas, Yabanclar Mevzuat ve Yeni y=FCr=FCrl=FCe konan=20 Sal ve G=FCvenlii Kanunu uygulamalarnda =F6ng=F6r=FClen y=FCk=FCml=FCl=FCkler, bu y=FCk=FCml=FCl=FCklere bal olarak uygulanan idari para cezalar ile ihtilaflarnn =E7=F6z=FCm yollar bir b=FCt=FCn olarak ele alnmtr.=20 Katlm i=E7in kayt formu doldurulmas ve banka makbuzu ile tarafmza g=F6nderilmesi gerekmektedir. Programlarmz kontenjanlarmzla snrldr. Kayt ilemlerini web sayfamzdan online yapabilirsiniz, Program katlm bedeli 950TL+ KDV'dir. =D6le yemekleri, ara ikramlar, zirve kitleri, eitim notlar ve t=FCm d=F6k=FCmantasyon =FCcrete dahildir. Grup ndirim Oranlar: Ayn Firmadan 3 - 6 Katlmda %5, Ayn Firmadan 6 ve =FCzeri katlmda oran uygulanmaktadr. Toplu katlm, sponsorluk ve erken kayt avantajlarndan faydalanmak i=E7in l=FCtfen araynz: Kayt Yaptrmak i=E7in l=FCtfen tklaynz: BOSPHORUS CONFERENCES http://www.bogaziciegitim.com.tr 0216 422 9595 - 0555 422 9595 Bu etkinlik duyurusu tarafnza =FCye veritabanmzda kaytl olduunuz i=E7in g=F6nderilmitir. Bu hizmetimizden yararlanmak istemiyorsanz listemizden ayrlmak i=E7in buraya http://bosphorushaber.com/index.php/lists/kf4673fqgv1ef/unsubscribe/rk0917ya18bf8/qj1810emsh911 tklaynz. Mailimizi d=FCzg=FCn g=F6r=FCnt=FCleyemiyorsanz l=FCtfen buraya http://bosphorushaber.com/index.php/campaigns/qj1810emsh911/web-version/rk0917ya18bf8 tklaynz.=20 Bo=C4=9Fazi=C3=A7i E=C4=9Fitim http://www.bogaziciegitim.com.tr=20 istanbul Turkey m= ?nerileri 27 ubat 2016 / 09.00 - 17.00 / Istanbul Hilton - Harb= iye Konumaclar: PROF. DR. NURşEN CANİKLİO&= #286;LU / Marmara ?niversitesi Hukuk Fak?lte= si ?zel Hukuk B=F6l=FCm Bakan İSA KARAKAŞ / Sosyal G=FCvenlik ve Hukuku Bauzman/ 20 Yl Akn =C7SGB/SGK Bam=FCfettii OTURUM KONULARı: - 2016 Torba Kanunlarda Yaplan Deiiklikler, - Asgari =DCcret Tevikleri - Uygulama esaslar- Tevik nasl hesaplanacak? - Yeni yazlmlara ihtiya=E7 olacak m? - Asgari =FCcret art =FCcret politikalarn nasl etkileyecek? - Maliyet artlarnn kapatlmas i=E7in alnabilecek =F6nlemler- - Artk iverenin daha lehine olan prim teviklerini kullanmak bir =E7=F6z=FCm olabilir m? - Doum Yapan =E7ilere Part-time =E7alma esaslar - Genel Salk Sigorta deiiklikleri - =E7i-veren htilaflarnn =C7=F6z=FCm=FCne Y=F6nelik Yaplacak Deiiklikler - Yabanc =C7altrmasnda Yaplacak Kolaylklar - Ge=E7ici Koruma Salanan Yabanclarn =C7alma zinlerine Dair Y=F6netmelik neler getiriyor? - Bu Y=F6netmelik h=FCk=FCmleri iveren i=E7in maliyet destei salayacak m? - Aylk Prim ve Hizmet Belgelerinde sigortalnn meslei ile meslek kodunun bildirimi ilikin yaplacak d=FCzenlemeler ve denetim - G=FCvenlii Uzmanlar-yeri Hekimlerinin Hizmet S=FCrelerinde ve idari para cezalarnda y=FCr=FCrl=FCe girecek deiiklikler - SGK lemlerinde tiraz Ve Mahkeme Yolunda Yaplan Deiiklikler ve Uygulamas - Kanunundaki dari Para Cezalar - Sal ve G=FCvenlii Kanunundaki dari Para Cezalar - 6645 sayl Kanunla yaplan deiiklikler - yerinin az tehlikeli- tehlikeli ve =E7ok tehlikeli oluu idari para cezasn nasl etkiliyor? - =C7alan saysnn =F6nemi nedir? - Sosyal Sigortalar ve Genel Salk Sigortas Kanunda =D6ng=F6r=FClen dari Para Cezalar - dari Para cezalarndan kurtulma yollar - Kazas bildirimlerinde ve =FCcret tahakkuku ile SGK prim belgelerinde en =E7ok yaplan hatalar ve uygulamas - SGK Tevik lemlerinde Yaplan Deiiklikler Ve Uygulamas, avantajl teviklerden geriye doru faydalanlmas - e ade le lgili Deiiklikler Ve Uygulamas, e iade halinde yaplmas gereken SGK uygulamalar - Alt iveren (Taeron)-=DCst veren likisinde Deiikler le Bu likiden Kaynaklanan Asl verenin SGK- Kanunu le Sal Ve G=FCvenlii Bakmndan Y=FCk=FCml=FCl=FCk Ve Sorumluluklar le Alt verenliin Y=F6netimi, Muvazaa le lgili tiraz Ve Mahkeme Yollarna likin Deiiklikler - Yarg kararlar =E7er=E7evesinde i S=F6zlemesinin sonlandrlmasnda en =E7ok yaplan hatalar, ge=E7erli savunma-ihtarname ve tutanak d=FCzenlenmesi esaslar - Ge=E7erli braname ve belge d=FCzenlenmesinde p=FCf noktalar - Sal Ve G=FCvenlii Uygulamalarnda Yaplan K=F6kl=FC Deiiklikler Ve Getirilen Yenilikler: - Yeni y=FCk=FCml=FCl=FCkler ve idari para cezalarndan yaplan deiiklikler - G=FCvenlii uzmanlarna iverenlerine kar verilen yeni yetki-sorumluluklar ile m=FCeyyideler - =E7ilere verilen y=FCk=FCml=FCl=FCk e sorumluluklar ile i s=F6zlemesinin feshini gerektiren i g=FCvenliine ilikin nedenler - Yap denetim kurulularna verilen yeni yetki-sorumluluklar ile m=FCeyyideler - Sal Ve G=FCvenlii Uygulamalarnda tutulmas gereken defter ve ge=E7erli belge d=FCzenlenmesi - 2015 yl Torba Kanunu ile izinlerinde yaplan deiiklikler ile dier=20 Kanunu ilemlerinde yaplan deiiklikler ve uygulamas - Sosyal g=FCvenlik ile i mevzuatna ilikin dier deiiklik ve yenilikler - =C7alma ve Sosyal G=FCvenlik Teftilerine Hazrlk Uygulamalar - Ge=E7erli ve mevzuata uygun iyeri kayt ve belgelerinin d=FCzenlenmesi ve dikkat edilecek hususlar - =C7alanlarn meslekleri ile =FCcretleri baznda yaplan denetimler - Sekt=F6r baznda yaplan denetimler - in y=FCr=FCt=FCm koullarna ilikin denetimler - kazas-meslek hastalklar ile i sal ve g=FCvenlii denetimleri - sal ve g=FCvenlii baznda kayt ve belgelerinin d=FCzenlenmesi ve dikkat edilecek hususlar - hbar-ikayet bazl denetimler - Tefti s=FCrecinin y=F6netimi ile dier denetimlere ilikin dier hususlar=20 T=FCm Katlmclara Zirve D=F6k=FCmantasyonu ve kongre kitlerinin yansra sa Karaka'n "SGK- KUR ve Mevzuatnda dari Para Cezalar le =C7=F6z=FCm Yollar" Kitab hediye edilecektir. Bu eserde bata SGK olmak =FCzere, 4857 sayl=20 Kanunu, KUR-sizlik Sigortas, Yabanclar Mevzuat ve Yeni y=FCr=FCrl=FCe konan=20 Sal ve G=FCvenlii Kanunu uygulamalarnda =F6ng=F6r=FClen y=FCk=FCml=FCl=FCkler, bu y=FCk=FCml=FCl=FCklere bal olarak uygulanan idari para cezalar ile ihtilaflarnn =E7=F6z=FCm yollar bir b=FCt=FCn olarak ele alnmtr.=20 Katlm i=E7in kayt formu doldurulmas ve banka makbuzu ile tarafmza g=F6nderilmesi gerekmektedir. Programlarmz kontenjanlarmzla snrldr. Kayt ilemlerini web sayfamzdan online yapabilirsiniz, Program katlm bedeli 950TL+ KDV'dir. =D6le yemekleri, ara ikramlar, zirve kitleri, eitim notlar ve t=FCm d=F6k=FCmantasyon =FCcrete dahildir. Grup ndirim Oranlar: Ayn Firmadan 3 - 6 Katlmda %5, Ayn Firmadan 6 ve =FCzeri katlmda oran uygulanmaktadr. Toplu katlm, sponsorluk ve erken kayt avantajlarndan faydalanmak i=E7in l=FCtfen araynz: Kayt Yaptrmak i=E7in l=FCtfen tklaynz: BOSPHORUS CONFERENCES http://www.bogaziciegitim.com.tr 0216 422 9595 - 0555 422 9595 Bu etkinlik duyurusu tarafnza =FCye veritabanmzda kaytl olduunuz i=E7in g=F6nderilmitir. Bu hizmetimizden yararlanmak istemiyorsanz listemizden ayrlmak i=E7in buraya http://bosphorushaber.com/index.php/lists/kf4673fqgv1ef/unsubscribe/rk0917ya18bf8/qj1810emsh911 tklaynz. Mailimizi d=FCzg=FCn g=F6r=FCnt=FCleyemiyorsanz l=FCtfen buraya http://bosphorushaber.com/index.php/campaigns/qj1810emsh911/web-version/rk0917ya18bf8 tklaynz.=20 Bo=C4=9Fazi=C3=A7i E=C4=9Fitim http://www.bogaziciegitim.com.tr=20 istanbul Turkey z= el Hukuk B?l?m Bakan İSA KARAKAŞ / Sosyal G?venlik ve Huk= uku Bauzman/ 20 Yl A= kn ?SGB/SGK Bam=FCfettii OTURUM KONULARı: - 2016 Torba Kanunlarda Yaplan Deiiklikler, - Asgari =DCcret Tevikleri - Uygulama esaslar- Tevik nasl hesaplanacak? - Yeni yazlmlara ihtiya=E7 olacak m? - Asgari =FCcret art =FCcret politikalarn nasl etkileyecek? - Maliyet artlarnn kapatlmas i=E7in alnabilecek =F6nlemler- - Artk iverenin daha lehine olan prim teviklerini kullanmak bir =E7=F6z=FCm olabilir m? - Doum Yapan =E7ilere Part-time =E7alma esaslar - Genel Salk Sigorta deiiklikleri - =E7i-veren htilaflarnn =C7=F6z=FCm=FCne Y=F6nelik Yaplacak Deiiklikler - Yabanc =C7altrmasnda Yaplacak Kolaylklar - Ge=E7ici Koruma Salanan Yabanclarn =C7alma zinlerine Dair Y=F6netmelik neler getiriyor? - Bu Y=F6netmelik h=FCk=FCmleri iveren i=E7in maliyet destei salayacak m? - Aylk Prim ve Hizmet Belgelerinde sigortalnn meslei ile meslek kodunun bildirimi ilikin yaplacak d=FCzenlemeler ve denetim - G=FCvenlii Uzmanlar-yeri Hekimlerinin Hizmet S=FCrelerinde ve idari para cezalarnda y=FCr=FCrl=FCe girecek deiiklikler - SGK lemlerinde tiraz Ve Mahkeme Yolunda Yaplan Deiiklikler ve Uygulamas - Kanunundaki dari Para Cezalar - Sal ve G=FCvenlii Kanunundaki dari Para Cezalar - 6645 sayl Kanunla yaplan deiiklikler - yerinin az tehlikeli- tehlikeli ve =E7ok tehlikeli oluu idari para cezasn nasl etkiliyor? - =C7alan saysnn =F6nemi nedir? - Sosyal Sigortalar ve Genel Salk Sigortas Kanunda =D6ng=F6r=FClen dari Para Cezalar - dari Para cezalarndan kurtulma yollar - Kazas bildirimlerinde ve =FCcret tahakkuku ile SGK prim belgelerinde en =E7ok yaplan hatalar ve uygulamas - SGK Tevik lemlerinde Yaplan Deiiklikler Ve Uygulamas, avantajl teviklerden geriye doru faydalanlmas - e ade le lgili Deiiklikler Ve Uygulamas, e iade halinde yaplmas gereken SGK uygulamalar - Alt iveren (Taeron)-=DCst veren likisinde Deiikler le Bu likiden Kaynaklanan Asl verenin SGK- Kanunu le Sal Ve G=FCvenlii Bakmndan Y=FCk=FCml=FCl=FCk Ve Sorumluluklar le Alt verenliin Y=F6netimi, Muvazaa le lgili tiraz Ve Mahkeme Yollarna likin Deiiklikler - Yarg kararlar =E7er=E7evesinde i S=F6zlemesinin sonlandrlmasnda en =E7ok yaplan hatalar, ge=E7erli savunma-ihtarname ve tutanak d=FCzenlenmesi esaslar - Ge=E7erli braname ve belge d=FCzenlenmesinde p=FCf noktalar - Sal Ve G=FCvenlii Uygulamalarnda Yaplan K=F6kl=FC Deiiklikler Ve Getirilen Yenilikler: - Yeni y=FCk=FCml=FCl=FCkler ve idari para cezalarndan yaplan deiiklikler - G=FCvenlii uzmanlarna iverenlerine kar verilen yeni yetki-sorumluluklar ile m=FCeyyideler - =E7ilere verilen y=FCk=FCml=FCl=FCk e sorumluluklar ile i s=F6zlemesinin feshini gerektiren i g=FCvenliine ilikin nedenler - Yap denetim kurulularna verilen yeni yetki-sorumluluklar ile m=FCeyyideler - Sal Ve G=FCvenlii Uygulamalarnda tutulmas gereken defter ve ge=E7erli belge d=FCzenlenmesi - 2015 yl Torba Kanunu ile izinlerinde yaplan deiiklikler ile dier=20 Kanunu ilemlerinde yaplan deiiklikler ve uygulamas - Sosyal g=FCvenlik ile i mevzuatna ilikin dier deiiklik ve yenilikler - =C7alma ve Sosyal G=FCvenlik Teftilerine Hazrlk Uygulamalar - Ge=E7erli ve mevzuata uygun iyeri kayt ve belgelerinin d=FCzenlenmesi ve dikkat edilecek hususlar - =C7alanlarn meslekleri ile =FCcretleri baznda yaplan denetimler - Sekt=F6r baznda yaplan denetimler - in y=FCr=FCt=FCm koullarna ilikin denetimler - kazas-meslek hastalklar ile i sal ve g=FCvenlii denetimleri - sal ve g=FCvenlii baznda kayt ve belgelerinin d=FCzenlenmesi ve dikkat edilecek hususlar - hbar-ikayet bazl denetimler - Tefti s=FCrecinin y=F6netimi ile dier denetimlere ilikin dier hususlar=20 T=FCm Katlmclara Zirve D=F6k=FCmantasyonu ve kongre kitlerinin yansra sa Karaka'n "SGK- KUR ve Mevzuatnda dari Para Cezalar le =C7=F6z=FCm Yollar" Kitab hediye edilecektir. Bu eserde bata SGK olmak =FCzere, 4857 sayl=20 Kanunu, KUR-sizlik Sigortas, Yabanclar Mevzuat ve Yeni y=FCr=FCrl=FCe konan=20 Sal ve G=FCvenlii Kanunu uygulamalarnda =F6ng=F6r=FClen y=FCk=FCml=FCl=FCkler, bu y=FCk=FCml=FCl=FCklere bal olarak uygulanan idari para cezalar ile ihtilaflarnn =E7=F6z=FCm yollar bir b=FCt=FCn olarak ele alnmtr.=20 Katlm i=E7in kayt formu doldurulmas ve banka makbuzu ile tarafmza g=F6nderilmesi gerekmektedir. Programlarmz kontenjanlarmzla snrldr. Kayt ilemlerini web sayfamzdan online yapabilirsiniz, Program katlm bedeli 950TL+ KDV'dir. =D6le yemekleri, ara ikramlar, zirve kitleri, eitim notlar ve t=FCm d=F6k=FCmantasyon =FCcrete dahildir. Grup ndirim Oranlar: Ayn Firmadan 3 - 6 Katlmda %5, Ayn Firmadan 6 ve =FCzeri katlmda oran uygulanmaktadr. Toplu katlm, sponsorluk ve erken kayt avantajlarndan faydalanmak i=E7in l=FCtfen araynz: Kayt Yaptrmak i=E7in l=FCtfen tklaynz: BOSPHORUS CONFERENCES http://www.bogaziciegitim.com.tr 0216 422 9595 - 0555 422 9595 Bu etkinlik duyurusu tarafnza =FCye veritabanmzda kaytl olduunuz i=E7in g=F6nderilmitir. Bu hizmetimizden yararlanmak istemiyorsanz listemizden ayrlmak i=E7in buraya http://bosphorushaber.com/index.php/lists/kf4673fqgv1ef/unsubscribe/rk0917ya18bf8/qj1810emsh911 tklaynz. Mailimizi d=FCzg=FCn g=F6r=FCnt=FCleyemiyorsanz l=FCtfen buraya http://bosphorushaber.com/index.php/campaigns/qj1810emsh911/web-version/rk0917ya18bf8 tklaynz.=20 Bo=C4=9Fazi=C3=A7i E=C4=9Fitim http://www.bogaziciegitim.com.tr=20 istanbul Turkey S= GB/SGK Bam?fettii OTURUM KONULARı: - 2016 Tor= ba Kanunlarda Yaplan Deiiklikler, - Asgari ?cret Tevikleri - Uy= gulama esaslar- Tevik nasl hesaplanacak? - Yeni yazlmlara ihtiya? o= lacak m? - Asga= ri ?cret art =FCcret politikalarn nasl etkileyecek? - Maliyet artlarnn kapatlmas i=E7in alnabilecek =F6nlemler- - Artk iverenin daha lehine olan prim teviklerini kullanmak bir =E7=F6z=FCm olabilir m? - Doum Yapan =E7ilere Part-time =E7alma esaslar - Genel Salk Sigorta deiiklikleri - =E7i-veren htilaflarnn =C7=F6z=FCm=FCne Y=F6nelik Yaplacak Deiiklikler - Yabanc =C7altrmasnda Yaplacak Kolaylklar - Ge=E7ici Koruma Salanan Yabanclarn =C7alma zinlerine Dair Y=F6netmelik neler getiriyor? - Bu Y=F6netmelik h=FCk=FCmleri iveren i=E7in maliyet destei salayacak m? - Aylk Prim ve Hizmet Belgelerinde sigortalnn meslei ile meslek kodunun bildirimi ilikin yaplacak d=FCzenlemeler ve denetim - G=FCvenlii Uzmanlar-yeri Hekimlerinin Hizmet S=FCrelerinde ve idari para cezalarnda y=FCr=FCrl=FCe girecek deiiklikler - SGK lemlerinde tiraz Ve Mahkeme Yolunda Yaplan Deiiklikler ve Uygulamas - Kanunundaki dari Para Cezalar - Sal ve G=FCvenlii Kanunundaki dari Para Cezalar - 6645 sayl Kanunla yaplan deiiklikler - yerinin az tehlikeli- tehlikeli ve =E7ok tehlikeli oluu idari para cezasn nasl etkiliyor? - =C7alan saysnn =F6nemi nedir? - Sosyal Sigortalar ve Genel Salk Sigortas Kanunda =D6ng=F6r=FClen dari Para Cezalar - dari Para cezalarndan kurtulma yollar - Kazas bildirimlerinde ve =FCcret tahakkuku ile SGK prim belgelerinde en =E7ok yaplan hatalar ve uygulamas - SGK Tevik lemlerinde Yaplan Deiiklikler Ve Uygulamas, avantajl teviklerden geriye doru faydalanlmas - e ade le lgili Deiiklikler Ve Uygulamas, e iade halinde yaplmas gereken SGK uygulamalar - Alt iveren (Taeron)-=DCst veren likisinde Deiikler le Bu likiden Kaynaklanan Asl verenin SGK- Kanunu le Sal Ve G=FCvenlii Bakmndan Y=FCk=FCml=FCl=FCk Ve Sorumluluklar le Alt verenliin Y=F6netimi, Muvazaa le lgili tiraz Ve Mahkeme Yollarna likin Deiiklikler - Yarg kararlar =E7er=E7evesinde i S=F6zlemesinin sonlandrlmasnda en =E7ok yaplan hatalar, ge=E7erli savunma-ihtarname ve tutanak d=FCzenlenmesi esaslar - Ge=E7erli braname ve belge d=FCzenlenmesinde p=FCf noktalar - Sal Ve G=FCvenlii Uygulamalarnda Yaplan K=F6kl=FC Deiiklikler Ve Getirilen Yenilikler: - Yeni y=FCk=FCml=FCl=FCkler ve idari para cezalarndan yaplan deiiklikler - G=FCvenlii uzmanlarna iverenlerine kar verilen yeni yetki-sorumluluklar ile m=FCeyyideler - =E7ilere verilen y=FCk=FCml=FCl=FCk e sorumluluklar ile i s=F6zlemesinin feshini gerektiren i g=FCvenliine ilikin nedenler - Yap denetim kurulularna verilen yeni yetki-sorumluluklar ile m=FCeyyideler - Sal Ve G=FCvenlii Uygulamalarnda tutulmas gereken defter ve ge=E7erli belge d=FCzenlenmesi - 2015 yl Torba Kanunu ile izinlerinde yaplan deiiklikler ile dier=20 Kanunu ilemlerinde yaplan deiiklikler ve uygulamas - Sosyal g=FCvenlik ile i mevzuatna ilikin dier deiiklik ve yenilikler - =C7alma ve Sosyal G=FCvenlik Teftilerine Hazrlk Uygulamalar - Ge=E7erli ve mevzuata uygun iyeri kayt ve belgelerinin d=FCzenlenmesi ve dikkat edilecek hususlar - =C7alanlarn meslekleri ile =FCcretleri baznda yaplan denetimler - Sekt=F6r baznda yaplan denetimler - in y=FCr=FCt=FCm koullarna ilikin denetimler - kazas-meslek hastalklar ile i sal ve g=FCvenlii denetimleri - sal ve g=FCvenlii baznda kayt ve belgelerinin d=FCzenlenmesi ve dikkat edilecek hususlar - hbar-ikayet bazl denetimler - Tefti s=FCrecinin y=F6netimi ile dier denetimlere ilikin dier hususlar=20 T=FCm Katlmclara Zirve D=F6k=FCmantasyonu ve kongre kitlerinin yansra sa Karaka'n "SGK- KUR ve Mevzuatnda dari Para Cezalar le =C7=F6z=FCm Yollar" Kitab hediye edilecektir. Bu eserde bata SGK olmak =FCzere, 4857 sayl=20 Kanunu, KUR-sizlik Sigortas, Yabanclar Mevzuat ve Yeni y=FCr=FCrl=FCe konan=20 Sal ve G=FCvenlii Kanunu uygulamalarnda =F6ng=F6r=FClen y=FCk=FCml=FCl=FCkler, bu y=FCk=FCml=FCl=FCklere bal olarak uygulanan idari para cezalar ile ihtilaflarnn =E7=F6z=FCm yollar bir b=FCt=FCn olarak ele alnmtr.=20 Katlm i=E7in kayt formu doldurulmas ve banka makbuzu ile tarafmza g=F6nderilmesi gerekmektedir. Programlarmz kontenjanlarmzla snrldr. Kayt ilemlerini web sayfamzdan online yapabilirsiniz, Program katlm bedeli 950TL+ KDV'dir. =D6le yemekleri, ara ikramlar, zirve kitleri, eitim notlar ve t=FCm d=F6k=FCmantasyon =FCcrete dahildir. Grup ndirim Oranlar: Ayn Firmadan 3 - 6 Katlmda %5, Ayn Firmadan 6 ve =FCzeri katlmda oran uygulanmaktadr. Toplu katlm, sponsorluk ve erken kayt avantajlarndan faydalanmak i=E7in l=FCtfen araynz: Kayt Yaptrmak i=E7in l=FCtfen tklaynz: BOSPHORUS CONFERENCES http://www.bogaziciegitim.com.tr 0216 422 9595 - 0555 422 9595 Bu etkinlik duyurusu tarafnza =FCye veritabanmzda kaytl olduunuz i=E7in g=F6nderilmitir. Bu hizmetimizden yararlanmak istemiyorsanz listemizden ayrlmak i=E7in buraya http://bosphorushaber.com/index.php/lists/kf4673fqgv1ef/unsubscribe/rk0917ya18bf8/qj1810emsh911 tklaynz. Mailimizi d=FCzg=FCn g=F6r=FCnt=FCleyemiyorsanz l=FCtfen buraya http://bosphorushaber.com/index.php/campaigns/qj1810emsh911/web-version/rk0917ya18bf8 tklaynz.=20 Bo=C4=9Fazi=C3=A7i E=C4=9Fitim http://www.bogaziciegitim.com.tr=20 istanbul Turkey c= ret art ?cret politikalarn nasl etkileyecek? - Maliyet artlarnn kap= atlmas i?in alnabilecek ?nlemler- - Artk iverenin daha lehine olan = prim teviklerini kullanmak b= ir ?=F6z=FCm olabilir m? - Doum Yapan =E7ilere Part-time =E7alma esaslar - Genel Salk Sigorta deiiklikleri - =E7i-veren htilaflarnn =C7=F6z=FCm=FCne Y=F6nelik Yaplacak Deiiklikler - Yabanc =C7altrmasnda Yaplacak Kolaylklar - Ge=E7ici Koruma Salanan Yabanclarn =C7alma zinlerine Dair Y=F6netmelik neler getiriyor? - Bu Y=F6netmelik h=FCk=FCmleri iveren i=E7in maliyet destei salayacak m? - Aylk Prim ve Hizmet Belgelerinde sigortalnn meslei ile meslek kodunun bildirimi ilikin yaplacak d=FCzenlemeler ve denetim - G=FCvenlii Uzmanlar-yeri Hekimlerinin Hizmet S=FCrelerinde ve idari para cezalarnda y=FCr=FCrl=FCe girecek deiiklikler - SGK lemlerinde tiraz Ve Mahkeme Yolunda Yaplan Deiiklikler ve Uygulamas - Kanunundaki dari Para Cezalar - Sal ve G=FCvenlii Kanunundaki dari Para Cezalar - 6645 sayl Kanunla yaplan deiiklikler - yerinin az tehlikeli- tehlikeli ve =E7ok tehlikeli oluu idari para cezasn nasl etkiliyor? - =C7alan saysnn =F6nemi nedir? - Sosyal Sigortalar ve Genel Salk Sigortas Kanunda =D6ng=F6r=FClen dari Para Cezalar - dari Para cezalarndan kurtulma yollar - Kazas bildirimlerinde ve =FCcret tahakkuku ile SGK prim belgelerinde en =E7ok yaplan hatalar ve uygulamas - SGK Tevik lemlerinde Yaplan Deiiklikler Ve Uygulamas, avantajl teviklerden geriye doru faydalanlmas - e ade le lgili Deiiklikler Ve Uygulamas, e iade halinde yaplmas gereken SGK uygulamalar - Alt iveren (Taeron)-=DCst veren likisinde Deiikler le Bu likiden Kaynaklanan Asl verenin SGK- Kanunu le Sal Ve G=FCvenlii Bakmndan Y=FCk=FCml=FCl=FCk Ve Sorumluluklar le Alt verenliin Y=F6netimi, Muvazaa le lgili tiraz Ve Mahkeme Yollarna likin Deiiklikler - Yarg kararlar =E7er=E7evesinde i S=F6zlemesinin sonlandrlmasnda en =E7ok yaplan hatalar, ge=E7erli savunma-ihtarname ve tutanak d=FCzenlenmesi esaslar - Ge=E7erli braname ve belge d=FCzenlenmesinde p=FCf noktalar - Sal Ve G=FCvenlii Uygulamalarnda Yaplan K=F6kl=FC Deiiklikler Ve Getirilen Yenilikler: - Yeni y=FCk=FCml=FCl=FCkler ve idari para cezalarndan yaplan deiiklikler - G=FCvenlii uzmanlarna iverenlerine kar verilen yeni yetki-sorumluluklar ile m=FCeyyideler - =E7ilere verilen y=FCk=FCml=FCl=FCk e sorumluluklar ile i s=F6zlemesinin feshini gerektiren i g=FCvenliine ilikin nedenler - Yap denetim kurulularna verilen yeni yetki-sorumluluklar ile m=FCeyyideler - Sal Ve G=FCvenlii Uygulamalarnda tutulmas gereken defter ve ge=E7erli belge d=FCzenlenmesi - 2015 yl Torba Kanunu ile izinlerinde yaplan deiiklikler ile dier=20 Kanunu ilemlerinde yaplan deiiklikler ve uygulamas - Sosyal g=FCvenlik ile i mevzuatna ilikin dier deiiklik ve yenilikler - =C7alma ve Sosyal G=FCvenlik Teftilerine Hazrlk Uygulamalar - Ge=E7erli ve mevzuata uygun iyeri kayt ve belgelerinin d=FCzenlenmesi ve dikkat edilecek hususlar - =C7alanlarn meslekleri ile =FCcretleri baznda yaplan denetimler - Sekt=F6r baznda yaplan denetimler - in y=FCr=FCt=FCm koullarna ilikin denetimler - kazas-meslek hastalklar ile i sal ve g=FCvenlii denetimleri - sal ve g=FCvenlii baznda kayt ve belgelerinin d=FCzenlenmesi ve dikkat edilecek hususlar - hbar-ikayet bazl denetimler - Tefti s=FCrecinin y=F6netimi ile dier denetimlere ilikin dier hususlar=20 T=FCm Katlmclara Zirve D=F6k=FCmantasyonu ve kongre kitlerinin yansra sa Karaka'n "SGK- KUR ve Mevzuatnda dari Para Cezalar le =C7=F6z=FCm Yollar" Kitab hediye edilecektir. Bu eserde bata SGK olmak =FCzere, 4857 sayl=20 Kanunu, KUR-sizlik Sigortas, Yabanclar Mevzuat ve Yeni y=FCr=FCrl=FCe konan=20 Sal ve G=FCvenlii Kanunu uygulamalarnda =F6ng=F6r=FClen y=FCk=FCml=FCl=FCkler, bu y=FCk=FCml=FCl=FCklere bal olarak uygulanan idari para cezalar ile ihtilaflarnn =E7=F6z=FCm yollar bir b=FCt=FCn olarak ele alnmtr.=20 Katlm i=E7in kayt formu doldurulmas ve banka makbuzu ile tarafmza g=F6nderilmesi gerekmektedir. Programlarmz kontenjanlarmzla snrldr. Kayt ilemlerini web sayfamzdan online yapabilirsiniz, Program katlm bedeli 950TL+ KDV'dir. =D6le yemekleri, ara ikramlar, zirve kitleri, eitim notlar ve t=FCm d=F6k=FCmantasyon =FCcrete dahildir. Grup ndirim Oranlar: Ayn Firmadan 3 - 6 Katlmda %5, Ayn Firmadan 6 ve =FCzeri katlmda oran uygulanmaktadr. Toplu katlm, sponsorluk ve erken kayt avantajlarndan faydalanmak i=E7in l=FCtfen araynz: Kayt Yaptrmak i=E7in l=FCtfen tklaynz: BOSPHORUS CONFERENCES http://www.bogaziciegitim.com.tr 0216 422 9595 - 0555 422 9595 Bu etkinlik duyurusu tarafnza =FCye veritabanmzda kaytl olduunuz i=E7in g=F6nderilmitir. Bu hizmetimizden yararlanmak istemiyorsanz listemizden ayrlmak i=E7in buraya http://bosphorushaber.com/index.php/lists/kf4673fqgv1ef/unsubscribe/rk0917ya18bf8/qj1810emsh911 tklaynz. Mailimizi d=FCzg=FCn g=F6r=FCnt=FCleyemiyorsanz l=FCtfen buraya http://bosphorushaber.com/index.php/campaigns/qj1810emsh911/web-version/rk0917ya18bf8 tklaynz.=20 Bo=C4=9Fazi=C3=A7i E=C4=9Fitim http://www.bogaziciegitim.com.tr=20 istanbul Turkey ?z=FCm olabilir m? - Doum Yapan =E7ilere Part-time =E7alma esaslar - Genel Salk Sigorta deiiklikleri - =E7i-veren htilaflarnn =C7=F6z=FCm=FCne Y=F6nelik Yaplacak Deiiklikler - Yabanc =C7altrmasnda Yaplacak Kolaylklar - Ge=E7ici Koruma Salanan Yabanclarn =C7alma zinlerine Dair Y=F6netmelik neler getiriyor? - Bu Y=F6netmelik h=FCk=FCmleri iveren i=E7in maliyet destei salayacak m? - Aylk Prim ve Hizmet Belgelerinde sigortalnn meslei ile meslek kodunun bildirimi ilikin yaplacak d=FCzenlemeler ve denetim - G=FCvenlii Uzmanlar-yeri Hekimlerinin Hizmet S=FCrelerinde ve idari para cezalarnda y=FCr=FCrl=FCe girecek deiiklikler - SGK lemlerinde tiraz Ve Mahkeme Yolunda Yaplan Deiiklikler ve Uygulamas - Kanunundaki dari Para Cezalar - Sal ve G=FCvenlii Kanunundaki dari Para Cezalar - 6645 sayl Kanunla yaplan deiiklikler - yerinin az tehlikeli- tehlikeli ve =E7ok tehlikeli oluu idari para cezasn nasl etkiliyor? - =C7alan saysnn =F6nemi nedir? - Sosyal Sigortalar ve Genel Salk Sigortas Kanunda =D6ng=F6r=FClen dari Para Cezalar - dari Para cezalarndan kurtulma yollar - Kazas bildirimlerinde ve =FCcret tahakkuku ile SGK prim belgelerinde en =E7ok yaplan hatalar ve uygulamas - SGK Tevik lemlerinde Yaplan Deiiklikler Ve Uygulamas, avantajl teviklerden geriye doru faydalanlmas - e ade le lgili Deiiklikler Ve Uygulamas, e iade halinde yaplmas gereken SGK uygulamalar - Alt iveren (Taeron)-=DCst veren likisinde Deiikler le Bu likiden Kaynaklanan Asl verenin SGK- Kanunu le Sal Ve G=FCvenlii Bakmndan Y=FCk=FCml=FCl=FCk Ve Sorumluluklar le Alt verenliin Y=F6netimi, Muvazaa le lgili tiraz Ve Mahkeme Yollarna likin Deiiklikler - Yarg kararlar =E7er=E7evesinde i S=F6zlemesinin sonlandrlmasnda en =E7ok yaplan hatalar, ge=E7erli savunma-ihtarname ve tutanak d=FCzenlenmesi esaslar - Ge=E7erli braname ve belge d=FCzenlenmesinde p=FCf noktalar - Sal Ve G=FCvenlii Uygulamalarnda Yaplan K=F6kl=FC Deiiklikler Ve Getirilen Yenilikler: - Yeni y=FCk=FCml=FCl=FCkler ve idari para cezalarndan yaplan deiiklikler - G=FCvenlii uzmanlarna iverenlerine kar verilen yeni yetki-sorumluluklar ile m=FCeyyideler - =E7ilere verilen y=FCk=FCml=FCl=FCk e sorumluluklar ile i s=F6zlemesinin feshini gerektiren i g=FCvenliine ilikin nedenler - Yap denetim kurulularna verilen yeni yetki-sorumluluklar ile m=FCeyyideler - Sal Ve G=FCvenlii Uygulamalarnda tutulmas gereken defter ve ge=E7erli belge d=FCzenlenmesi - 2015 yl Torba Kanunu ile izinlerinde yaplan deiiklikler ile dier=20 Kanunu ilemlerinde yaplan deiiklikler ve uygulamas - Sosyal g=FCvenlik ile i mevzuatna ilikin dier deiiklik ve yenilikler - =C7alma ve Sosyal G=FCvenlik Teftilerine Hazrlk Uygulamalar - Ge=E7erli ve mevzuata uygun iyeri kayt ve belgelerinin d=FCzenlenmesi ve dikkat edilecek hususlar - =C7alanlarn meslekleri ile =FCcretleri baznda yaplan denetimler - Sekt=F6r baznda yaplan denetimler - in y=FCr=FCt=FCm koullarna ilikin denetimler - kazas-meslek hastalklar ile i sal ve g=FCvenlii denetimleri - sal ve g=FCvenlii baznda kayt ve belgelerinin d=FCzenlenmesi ve dikkat edilecek hususlar - hbar-ikayet bazl denetimler - Tefti s=FCrecinin y=F6netimi ile dier denetimlere ilikin dier hususlar=20 T=FCm Katlmclara Zirve D=F6k=FCmantasyonu ve kongre kitlerinin yansra sa Karaka'n "SGK- KUR ve Mevzuatnda dari Para Cezalar le =C7=F6z=FCm Yollar" Kitab hediye edilecektir. Bu eserde bata SGK olmak =FCzere, 4857 sayl=20 Kanunu, KUR-sizlik Sigortas, Yabanclar Mevzuat ve Yeni y=FCr=FCrl=FCe konan=20 Sal ve G=FCvenlii Kanunu uygulamalarnda =F6ng=F6r=FClen y=FCk=FCml=FCl=FCkler, bu y=FCk=FCml=FCl=FCklere bal olarak uygulanan idari para cezalar ile ihtilaflarnn =E7=F6z=FCm yollar bir b=FCt=FCn olarak ele alnmtr.=20 Katlm i=E7in kayt formu doldurulmas ve banka makbuzu ile tarafmza g=F6nderilmesi gerekmektedir. Programlarmz kontenjanlarmzla snrldr. Kayt ilemlerini web sayfamzdan online yapabilirsiniz, Program katlm bedeli 950TL+ KDV'dir. =D6le yemekleri, ara ikramlar, zirve kitleri, eitim notlar ve t=FCm d=F6k=FCmantasyon =FCcrete dahildir. Grup ndirim Oranlar: Ayn Firmadan 3 - 6 Katlmda %5, Ayn Firmadan 6 ve =FCzeri katlmda oran uygulanmaktadr. Toplu katlm, sponsorluk ve erken kayt avantajlarndan faydalanmak i=E7in l=FCtfen araynz: Kayt Yaptrmak i=E7in l=FCtfen tklaynz: BOSPHORUS CONFERENCES http://www.bogaziciegitim.com.tr 0216 422 9595 - 0555 422 9595 Bu etkinlik duyurusu tarafnza =FCye veritabanmzda kaytl olduunuz i=E7in g=F6nderilmitir. Bu hizmetimizden yararlanmak istemiyorsanz listemizden ayrlmak i=E7in buraya http://bosphorushaber.com/index.php/lists/kf4673fqgv1ef/unsubscribe/rk0917ya18bf8/qj1810emsh911 tklaynz. Mailimizi d=FCzg=FCn g=F6r=FCnt=FCleyemiyorsanz l=FCtfen buraya http://bosphorushaber.com/index.php/campaigns/qj1810emsh911/web-version/rk0917ya18bf8 tklaynz.=20 Bo=C4=9Fazi=C3=A7i E=C4=9Fitim http://www.bogaziciegitim.com.tr=20 istanbul Turkey z= ?m olabilir m? - Doum Yapan ?ilere Part-time ?alma esas= lar - Genel Salk Sigorta deiiklikleri - ?i-veren htilaflarn= n ?=F6z=FCm=FCne Y=F6nelik Yaplacak Deiiklikler - Yabanc =C7altrmasnda Yaplacak Kolaylklar - Ge=E7ici Koruma Salanan Yabanclarn =C7alma zinlerine Dair Y=F6netmelik neler getiriyor? - Bu Y=F6netmelik h=FCk=FCmleri iveren i=E7in maliyet destei salayacak m? - Aylk Prim ve Hizmet Belgelerinde sigortalnn meslei ile meslek kodunun bildirimi ilikin yaplacak d=FCzenlemeler ve denetim - G=FCvenlii Uzmanlar-yeri Hekimlerinin Hizmet S=FCrelerinde ve idari para cezalarnda y=FCr=FCrl=FCe girecek deiiklikler - SGK lemlerinde tiraz Ve Mahkeme Yolunda Yaplan Deiiklikler ve Uygulamas - Kanunundaki dari Para Cezalar - Sal ve G=FCvenlii Kanunundaki dari Para Cezalar - 6645 sayl Kanunla yaplan deiiklikler - yerinin az tehlikeli- tehlikeli ve =E7ok tehlikeli oluu idari para cezasn nasl etkiliyor? - =C7alan saysnn =F6nemi nedir? - Sosyal Sigortalar ve Genel Salk Sigortas Kanunda =D6ng=F6r=FClen dari Para Cezalar - dari Para cezalarndan kurtulma yollar - Kazas bildirimlerinde ve =FCcret tahakkuku ile SGK prim belgelerinde en =E7ok yaplan hatalar ve uygulamas - SGK Tevik lemlerinde Yaplan Deiiklikler Ve Uygulamas, avantajl teviklerden geriye doru faydalanlmas - e ade le lgili Deiiklikler Ve Uygulamas, e iade halinde yaplmas gereken SGK uygulamalar - Alt iveren (Taeron)-=DCst veren likisinde Deiikler le Bu likiden Kaynaklanan Asl verenin SGK- Kanunu le Sal Ve G=FCvenlii Bakmndan Y=FCk=FCml=FCl=FCk Ve Sorumluluklar le Alt verenliin Y=F6netimi, Muvazaa le lgili tiraz Ve Mahkeme Yollarna likin Deiiklikler - Yarg kararlar =E7er=E7evesinde i S=F6zlemesinin sonlandrlmasnda en =E7ok yaplan hatalar, ge=E7erli savunma-ihtarname ve tutanak d=FCzenlenmesi esaslar - Ge=E7erli braname ve belge d=FCzenlenmesinde p=FCf noktalar - Sal Ve G=FCvenlii Uygulamalarnda Yaplan K=F6kl=FC Deiiklikler Ve Getirilen Yenilikler: - Yeni y=FCk=FCml=FCl=FCkler ve idari para cezalarndan yaplan deiiklikler - G=FCvenlii uzmanlarna iverenlerine kar verilen yeni yetki-sorumluluklar ile m=FCeyyideler - =E7ilere verilen y=FCk=FCml=FCl=FCk e sorumluluklar ile i s=F6zlemesinin feshini gerektiren i g=FCvenliine ilikin nedenler - Yap denetim kurulularna verilen yeni yetki-sorumluluklar ile m=FCeyyideler - Sal Ve G=FCvenlii Uygulamalarnda tutulmas gereken defter ve ge=E7erli belge d=FCzenlenmesi - 2015 yl Torba Kanunu ile izinlerinde yaplan deiiklikler ile dier=20 Kanunu ilemlerinde yaplan deiiklikler ve uygulamas - Sosyal g=FCvenlik ile i mevzuatna ilikin dier deiiklik ve yenilikler - =C7alma ve Sosyal G=FCvenlik Teftilerine Hazrlk Uygulamalar - Ge=E7erli ve mevzuata uygun iyeri kayt ve belgelerinin d=FCzenlenmesi ve dikkat edilecek hususlar - =C7alanlarn meslekleri ile =FCcretleri baznda yaplan denetimler - Sekt=F6r baznda yaplan denetimler - in y=FCr=FCt=FCm koullarna ilikin denetimler - kazas-meslek hastalklar ile i sal ve g=FCvenlii denetimleri - sal ve g=FCvenlii baznda kayt ve belgelerinin d=FCzenlenmesi ve dikkat edilecek hususlar - hbar-ikayet bazl denetimler - Tefti s=FCrecinin y=F6netimi ile dier denetimlere ilikin dier hususlar=20 T=FCm Katlmclara Zirve D=F6k=FCmantasyonu ve kongre kitlerinin yansra sa Karaka'n "SGK- KUR ve Mevzuatnda dari Para Cezalar le =C7=F6z=FCm Yollar" Kitab hediye edilecektir. Bu eserde bata SGK olmak =FCzere, 4857 sayl=20 Kanunu, KUR-sizlik Sigortas, Yabanclar Mevzuat ve Yeni y=FCr=FCrl=FCe konan=20 Sal ve G=FCvenlii Kanunu uygulamalarnda =F6ng=F6r=FClen y=FCk=FCml=FCl=FCkler, bu y=FCk=FCml=FCl=FCklere bal olarak uygulanan idari para cezalar ile ihtilaflarnn =E7=F6z=FCm yollar bir b=FCt=FCn olarak ele alnmtr.=20 Katlm i=E7in kayt formu doldurulmas ve banka makbuzu ile tarafmza g=F6nderilmesi gerekmektedir. Programlarmz kontenjanlarmzla snrldr. Kayt ilemlerini web sayfamzdan online yapabilirsiniz, Program katlm bedeli 950TL+ KDV'dir. =D6le yemekleri, ara ikramlar, zirve kitleri, eitim notlar ve t=FCm d=F6k=FCmantasyon =FCcrete dahildir. Grup ndirim Oranlar: Ayn Firmadan 3 - 6 Katlmda %5, Ayn Firmadan 6 ve =FCzeri katlmda oran uygulanmaktadr. Toplu katlm, sponsorluk ve erken kayt avantajlarndan faydalanmak i=E7in l=FCtfen araynz: Kayt Yaptrmak i=E7in l=FCtfen tklaynz: BOSPHORUS CONFERENCES http://www.bogaziciegitim.com.tr 0216 422 9595 - 0555 422 9595 Bu etkinlik duyurusu tarafnza =FCye veritabanmzda kaytl olduunuz i=E7in g=F6nderilmitir. Bu hizmetimizden yararlanmak istemiyorsanz listemizden ayrlmak i=E7in buraya http://bosphorushaber.com/index.php/lists/kf4673fqgv1ef/unsubscribe/rk0917ya18bf8/qj1810emsh911 tklaynz. Mailimizi d=FCzg=FCn g=F6r=FCnt=FCleyemiyorsanz l=FCtfen buraya http://bosphorushaber.com/index.php/campaigns/qj1810emsh911/web-version/rk0917ya18bf8 tklaynz.=20 Bo=C4=9Fazi=C3=A7i E=C4=9Fitim http://www.bogaziciegitim.com.tr=20 istanbul Turkey ?z=FCm=FCne Y=F6nelik Yaplacak Deiiklikler - Yabanc =C7altrmasnda Yaplacak Kolaylklar - Ge=E7ici Koruma Salanan Yabanclarn =C7alma zinlerine Dair Y=F6netmelik neler getiriyor? - Bu Y=F6netmelik h=FCk=FCmleri iveren i=E7in maliyet destei salayacak m? - Aylk Prim ve Hizmet Belgelerinde sigortalnn meslei ile meslek kodunun bildirimi ilikin yaplacak d=FCzenlemeler ve denetim - G=FCvenlii Uzmanlar-yeri Hekimlerinin Hizmet S=FCrelerinde ve idari para cezalarnda y=FCr=FCrl=FCe girecek deiiklikler - SGK lemlerinde tiraz Ve Mahkeme Yolunda Yaplan Deiiklikler ve Uygulamas - Kanunundaki dari Para Cezalar - Sal ve G=FCvenlii Kanunundaki dari Para Cezalar - 6645 sayl Kanunla yaplan deiiklikler - yerinin az tehlikeli- tehlikeli ve =E7ok tehlikeli oluu idari para cezasn nasl etkiliyor? - =C7alan saysnn =F6nemi nedir? - Sosyal Sigortalar ve Genel Salk Sigortas Kanunda =D6ng=F6r=FClen dari Para Cezalar - dari Para cezalarndan kurtulma yollar - Kazas bildirimlerinde ve =FCcret tahakkuku ile SGK prim belgelerinde en =E7ok yaplan hatalar ve uygulamas - SGK Tevik lemlerinde Yaplan Deiiklikler Ve Uygulamas, avantajl teviklerden geriye doru faydalanlmas - e ade le lgili Deiiklikler Ve Uygulamas, e iade halinde yaplmas gereken SGK uygulamalar - Alt iveren (Taeron)-=DCst veren likisinde Deiikler le Bu likiden Kaynaklanan Asl verenin SGK- Kanunu le Sal Ve G=FCvenlii Bakmndan Y=FCk=FCml=FCl=FCk Ve Sorumluluklar le Alt verenliin Y=F6netimi, Muvazaa le lgili tiraz Ve Mahkeme Yollarna likin Deiiklikler - Yarg kararlar =E7er=E7evesinde i S=F6zlemesinin sonlandrlmasnda en =E7ok yaplan hatalar, ge=E7erli savunma-ihtarname ve tutanak d=FCzenlenmesi esaslar - Ge=E7erli braname ve belge d=FCzenlenmesinde p=FCf noktalar - Sal Ve G=FCvenlii Uygulamalarnda Yaplan K=F6kl=FC Deiiklikler Ve Getirilen Yenilikler: - Yeni y=FCk=FCml=FCl=FCkler ve idari para cezalarndan yaplan deiiklikler - G=FCvenlii uzmanlarna iverenlerine kar verilen yeni yetki-sorumluluklar ile m=FCeyyideler - =E7ilere verilen y=FCk=FCml=FCl=FCk e sorumluluklar ile i s=F6zlemesinin feshini gerektiren i g=FCvenliine ilikin nedenler - Yap denetim kurulularna verilen yeni yetki-sorumluluklar ile m=FCeyyideler - Sal Ve G=FCvenlii Uygulamalarnda tutulmas gereken defter ve ge=E7erli belge d=FCzenlenmesi - 2015 yl Torba Kanunu ile izinlerinde yaplan deiiklikler ile dier=20 Kanunu ilemlerinde yaplan deiiklikler ve uygulamas - Sosyal g=FCvenlik ile i mevzuatna ilikin dier deiiklik ve yenilikler - =C7alma ve Sosyal G=FCvenlik Teftilerine Hazrlk Uygulamalar - Ge=E7erli ve mevzuata uygun iyeri kayt ve belgelerinin d=FCzenlenmesi ve dikkat edilecek hususlar - =C7alanlarn meslekleri ile =FCcretleri baznda yaplan denetimler - Sekt=F6r baznda yaplan denetimler - in y=FCr=FCt=FCm koullarna ilikin denetimler - kazas-meslek hastalklar ile i sal ve g=FCvenlii denetimleri - sal ve g=FCvenlii baznda kayt ve belgelerinin d=FCzenlenmesi ve dikkat edilecek hususlar - hbar-ikayet bazl denetimler - Tefti s=FCrecinin y=F6netimi ile dier denetimlere ilikin dier hususlar=20 T=FCm Katlmclara Zirve D=F6k=FCmantasyonu ve kongre kitlerinin yansra sa Karaka'n "SGK- KUR ve Mevzuatnda dari Para Cezalar le =C7=F6z=FCm Yollar" Kitab hediye edilecektir. Bu eserde bata SGK olmak =FCzere, 4857 sayl=20 Kanunu, KUR-sizlik Sigortas, Yabanclar Mevzuat ve Yeni y=FCr=FCrl=FCe konan=20 Sal ve G=FCvenlii Kanunu uygulamalarnda =F6ng=F6r=FClen y=FCk=FCml=FCl=FCkler, bu y=FCk=FCml=FCl=FCklere bal olarak uygulanan idari para cezalar ile ihtilaflarnn =E7=F6z=FCm yollar bir b=FCt=FCn olarak ele alnmtr.=20 Katlm i=E7in kayt formu doldurulmas ve banka makbuzu ile tarafmza g=F6nderilmesi gerekmektedir. Programlarmz kontenjanlarmzla snrldr. Kayt ilemlerini web sayfamzdan online yapabilirsiniz, Program katlm bedeli 950TL+ KDV'dir. =D6le yemekleri, ara ikramlar, zirve kitleri, eitim notlar ve t=FCm d=F6k=FCmantasyon =FCcrete dahildir. Grup ndirim Oranlar: Ayn Firmadan 3 - 6 Katlmda %5, Ayn Firmadan 6 ve =FCzeri katlmda oran uygulanmaktadr. Toplu katlm, sponsorluk ve erken kayt avantajlarndan faydalanmak i=E7in l=FCtfen araynz: Kayt Yaptrmak i=E7in l=FCtfen tklaynz: BOSPHORUS CONFERENCES http://www.bogaziciegitim.com.tr 0216 422 9595 - 0555 422 9595 Bu etkinlik duyurusu tarafnza =FCye veritabanmzda kaytl olduunuz i=E7in g=F6nderilmitir. Bu hizmetimizden yararlanmak istemiyorsanz listemizden ayrlmak i=E7in buraya http://bosphorushaber.com/index.php/lists/kf4673fqgv1ef/unsubscribe/rk0917ya18bf8/qj1810emsh911 tklaynz. Mailimizi d=FCzg=FCn g=F6r=FCnt=FCleyemiyorsanz l=FCtfen buraya http://bosphorushaber.com/index.php/campaigns/qj1810emsh911/web-version/rk0917ya18bf8 tklaynz.=20 Bo=C4=9Fazi=C3=A7i E=C4=9Fitim http://www.bogaziciegitim.com.tr=20 istanbul Turkey z= ?m?n= e Y?nelik Yaplacak Deiiklikler - Yabanc =C7altrmasnda Yaplacak Kolaylklar - Ge=E7ici Koruma Salanan Yabanclarn =C7alma zinlerine Dair Y=F6netmelik neler getiriyor? - Bu Y=F6netmelik h=FCk=FCmleri iveren i=E7in maliyet destei salayacak m? - Aylk Prim ve Hizmet Belgelerinde sigortalnn meslei ile meslek kodunun bildirimi ilikin yaplacak d=FCzenlemeler ve denetim - G=FCvenlii Uzmanlar-yeri Hekimlerinin Hizmet S=FCrelerinde ve idari para cezalarnda y=FCr=FCrl=FCe girecek deiiklikler - SGK lemlerinde tiraz Ve Mahkeme Yolunda Yaplan Deiiklikler ve Uygulamas - Kanunundaki dari Para Cezalar - Sal ve G=FCvenlii Kanunundaki dari Para Cezalar - 6645 sayl Kanunla yaplan deiiklikler - yerinin az tehlikeli- tehlikeli ve =E7ok tehlikeli oluu idari para cezasn nasl etkiliyor? - =C7alan saysnn =F6nemi nedir? - Sosyal Sigortalar ve Genel Salk Sigortas Kanunda =D6ng=F6r=FClen dari Para Cezalar - dari Para cezalarndan kurtulma yollar - Kazas bildirimlerinde ve =FCcret tahakkuku ile SGK prim belgelerinde en =E7ok yaplan hatalar ve uygulamas - SGK Tevik lemlerinde Yaplan Deiiklikler Ve Uygulamas, avantajl teviklerden geriye doru faydalanlmas - e ade le lgili Deiiklikler Ve Uygulamas, e iade halinde yaplmas gereken SGK uygulamalar - Alt iveren (Taeron)-=DCst veren likisinde Deiikler le Bu likiden Kaynaklanan Asl verenin SGK- Kanunu le Sal Ve G=FCvenlii Bakmndan Y=FCk=FCml=FCl=FCk Ve Sorumluluklar le Alt verenliin Y=F6netimi, Muvazaa le lgili tiraz Ve Mahkeme Yollarna likin Deiiklikler - Yarg kararlar =E7er=E7evesinde i S=F6zlemesinin sonlandrlmasnda en =E7ok yaplan hatalar, ge=E7erli savunma-ihtarname ve tutanak d=FCzenlenmesi esaslar - Ge=E7erli braname ve belge d=FCzenlenmesinde p=FCf noktalar - Sal Ve G=FCvenlii Uygulamalarnda Yaplan K=F6kl=FC Deiiklikler Ve Getirilen Yenilikler: - Yeni y=FCk=FCml=FCl=FCkler ve idari para cezalarndan yaplan deiiklikler - G=FCvenlii uzmanlarna iverenlerine kar verilen yeni yetki-sorumluluklar ile m=FCeyyideler - =E7ilere verilen y=FCk=FCml=FCl=FCk e sorumluluklar ile i s=F6zlemesinin feshini gerektiren i g=FCvenliine ilikin nedenler - Yap denetim kurulularna verilen yeni yetki-sorumluluklar ile m=FCeyyideler - Sal Ve G=FCvenlii Uygulamalarnda tutulmas gereken defter ve ge=E7erli belge d=FCzenlenmesi - 2015 yl Torba Kanunu ile izinlerinde yaplan deiiklikler ile dier=20 Kanunu ilemlerinde yaplan deiiklikler ve uygulamas - Sosyal g=FCvenlik ile i mevzuatna ilikin dier deiiklik ve yenilikler - =C7alma ve Sosyal G=FCvenlik Teftilerine Hazrlk Uygulamalar - Ge=E7erli ve mevzuata uygun iyeri kayt ve belgelerinin d=FCzenlenmesi ve dikkat edilecek hususlar - =C7alanlarn meslekleri ile =FCcretleri baznda yaplan denetimler - Sekt=F6r baznda yaplan denetimler - in y=FCr=FCt=FCm koullarna ilikin denetimler - kazas-meslek hastalklar ile i sal ve g=FCvenlii denetimleri - sal ve g=FCvenlii baznda kayt ve belgelerinin d=FCzenlenmesi ve dikkat edilecek hususlar - hbar-ikayet bazl denetimler - Tefti s=FCrecinin y=F6netimi ile dier denetimlere ilikin dier hususlar=20 T=FCm Katlmclara Zirve D=F6k=FCmantasyonu ve kongre kitlerinin yansra sa Karaka'n "SGK- KUR ve Mevzuatnda dari Para Cezalar le =C7=F6z=FCm Yollar" Kitab hediye edilecektir. Bu eserde bata SGK olmak =FCzere, 4857 sayl=20 Kanunu, KUR-sizlik Sigortas, Yabanclar Mevzuat ve Yeni y=FCr=FCrl=FCe konan=20 Sal ve G=FCvenlii Kanunu uygulamalarnda =F6ng=F6r=FClen y=FCk=FCml=FCl=FCkler, bu y=FCk=FCml=FCl=FCklere bal olarak uygulanan idari para cezalar ile ihtilaflarnn =E7=F6z=FCm yollar bir b=FCt=FCn olarak ele alnmtr.=20 Katlm i=E7in kayt formu doldurulmas ve banka makbuzu ile tarafmza g=F6nderilmesi gerekmektedir. Programlarmz kontenjanlarmzla snrldr. Kayt ilemlerini web sayfamzdan online yapabilirsiniz, Program katlm bedeli 950TL+ KDV'dir. =D6le yemekleri, ara ikramlar, zirve kitleri, eitim notlar ve t=FCm d=F6k=FCmantasyon =FCcrete dahildir. Grup ndirim Oranlar: Ayn Firmadan 3 - 6 Katlmda %5, Ayn Firmadan 6 ve =FCzeri katlmda oran uygulanmaktadr. Toplu katlm, sponsorluk ve erken kayt avantajlarndan faydalanmak i=E7in l=FCtfen araynz: Kayt Yaptrmak i=E7in l=FCtfen tklaynz: BOSPHORUS CONFERENCES http://www.bogaziciegitim.com.tr 0216 422 9595 - 0555 422 9595 Bu etkinlik duyurusu tarafnza =FCye veritabanmzda kaytl olduunuz i=E7in g=F6nderilmitir. Bu hizmetimizden yararlanmak istemiyorsanz listemizden ayrlmak i=E7in buraya http://bosphorushaber.com/index.php/lists/kf4673fqgv1ef/unsubscribe/rk0917ya18bf8/qj1810emsh911 tklaynz. Mailimizi d=FCzg=FCn g=F6r=FCnt=FCleyemiyorsanz l=FCtfen buraya http://bosphorushaber.com/index.php/campaigns/qj1810emsh911/web-version/rk0917ya18bf8 tklaynz.=20 Bo=C4=9Fazi=C3=A7i E=C4=9Fitim http://www.bogaziciegitim.com.tr=20 istanbul Turkey n= elik Yaplacak Deiiklikler - Yabanc ?altrmasnda Yaplacak Kolaylk= lar - Ge?ici Koruma Salanan Yabancla= rn ?alma zinlerine Dair Y=F6netmelik neler getiriyor? - Bu Y=F6netmelik h=FCk=FCmleri iveren i=E7in maliyet destei salayacak m? - Aylk Prim ve Hizmet Belgelerinde sigortalnn meslei ile meslek kodunun bildirimi ilikin yaplacak d=FCzenlemeler ve denetim - G=FCvenlii Uzmanlar-yeri Hekimlerinin Hizmet S=FCrelerinde ve idari para cezalarnda y=FCr=FCrl=FCe girecek deiiklikler - SGK lemlerinde tiraz Ve Mahkeme Yolunda Yaplan Deiiklikler ve Uygulamas - Kanunundaki dari Para Cezalar - Sal ve G=FCvenlii Kanunundaki dari Para Cezalar - 6645 sayl Kanunla yaplan deiiklikler - yerinin az tehlikeli- tehlikeli ve =E7ok tehlikeli oluu idari para cezasn nasl etkiliyor? - =C7alan saysnn =F6nemi nedir? - Sosyal Sigortalar ve Genel Salk Sigortas Kanunda =D6ng=F6r=FClen dari Para Cezalar - dari Para cezalarndan kurtulma yollar - Kazas bildirimlerinde ve =FCcret tahakkuku ile SGK prim belgelerinde en =E7ok yaplan hatalar ve uygulamas - SGK Tevik lemlerinde Yaplan Deiiklikler Ve Uygulamas, avantajl teviklerden geriye doru faydalanlmas - e ade le lgili Deiiklikler Ve Uygulamas, e iade halinde yaplmas gereken SGK uygulamalar - Alt iveren (Taeron)-=DCst veren likisinde Deiikler le Bu likiden Kaynaklanan Asl verenin SGK- Kanunu le Sal Ve G=FCvenlii Bakmndan Y=FCk=FCml=FCl=FCk Ve Sorumluluklar le Alt verenliin Y=F6netimi, Muvazaa le lgili tiraz Ve Mahkeme Yollarna likin Deiiklikler - Yarg kararlar =E7er=E7evesinde i S=F6zlemesinin sonlandrlmasnda en =E7ok yaplan hatalar, ge=E7erli savunma-ihtarname ve tutanak d=FCzenlenmesi esaslar - Ge=E7erli braname ve belge d=FCzenlenmesinde p=FCf noktalar - Sal Ve G=FCvenlii Uygulamalarnda Yaplan K=F6kl=FC Deiiklikler Ve Getirilen Yenilikler: - Yeni y=FCk=FCml=FCl=FCkler ve idari para cezalarndan yaplan deiiklikler - G=FCvenlii uzmanlarna iverenlerine kar verilen yeni yetki-sorumluluklar ile m=FCeyyideler - =E7ilere verilen y=FCk=FCml=FCl=FCk e sorumluluklar ile i s=F6zlemesinin feshini gerektiren i g=FCvenliine ilikin nedenler - Yap denetim kurulularna verilen yeni yetki-sorumluluklar ile m=FCeyyideler - Sal Ve G=FCvenlii Uygulamalarnda tutulmas gereken defter ve ge=E7erli belge d=FCzenlenmesi - 2015 yl Torba Kanunu ile izinlerinde yaplan deiiklikler ile dier=20 Kanunu ilemlerinde yaplan deiiklikler ve uygulamas - Sosyal g=FCvenlik ile i mevzuatna ilikin dier deiiklik ve yenilikler - =C7alma ve Sosyal G=FCvenlik Teftilerine Hazrlk Uygulamalar - Ge=E7erli ve mevzuata uygun iyeri kayt ve belgelerinin d=FCzenlenmesi ve dikkat edilecek hususlar - =C7alanlarn meslekleri ile =FCcretleri baznda yaplan denetimler - Sekt=F6r baznda yaplan denetimler - in y=FCr=FCt=FCm koullarna ilikin denetimler - kazas-meslek hastalklar ile i sal ve g=FCvenlii denetimleri - sal ve g=FCvenlii baznda kayt ve belgelerinin d=FCzenlenmesi ve dikkat edilecek hususlar - hbar-ikayet bazl denetimler - Tefti s=FCrecinin y=F6netimi ile dier denetimlere ilikin dier hususlar=20 T=FCm Katlmclara Zirve D=F6k=FCmantasyonu ve kongre kitlerinin yansra sa Karaka'n "SGK- KUR ve Mevzuatnda dari Para Cezalar le =C7=F6z=FCm Yollar" Kitab hediye edilecektir. Bu eserde bata SGK olmak =FCzere, 4857 sayl=20 Kanunu, KUR-sizlik Sigortas, Yabanclar Mevzuat ve Yeni y=FCr=FCrl=FCe konan=20 Sal ve G=FCvenlii Kanunu uygulamalarnda =F6ng=F6r=FClen y=FCk=FCml=FCl=FCkler, bu y=FCk=FCml=FCl=FCklere bal olarak uygulanan idari para cezalar ile ihtilaflarnn =E7=F6z=FCm yollar bir b=FCt=FCn olarak ele alnmtr.=20 Katlm i=E7in kayt formu doldurulmas ve banka makbuzu ile tarafmza g=F6nderilmesi gerekmektedir. Programlarmz kontenjanlarmzla snrldr. Kayt ilemlerini web sayfamzdan online yapabilirsiniz, Program katlm bedeli 950TL+ KDV'dir. =D6le yemekleri, ara ikramlar, zirve kitleri, eitim notlar ve t=FCm d=F6k=FCmantasyon =FCcrete dahildir. Grup ndirim Oranlar: Ayn Firmadan 3 - 6 Katlmda %5, Ayn Firmadan 6 ve =FCzeri katlmda oran uygulanmaktadr. Toplu katlm, sponsorluk ve erken kayt avantajlarndan faydalanmak i=E7in l=FCtfen araynz: Kayt Yaptrmak i=E7in l=FCtfen tklaynz: BOSPHORUS CONFERENCES http://www.bogaziciegitim.com.tr 0216 422 9595 - 0555 422 9595 Bu etkinlik duyurusu tarafnza =FCye veritabanmzda kaytl olduunuz i=E7in g=F6nderilmitir. Bu hizmetimizden yararlanmak istemiyorsanz listemizden ayrlmak i=E7in buraya http://bosphorushaber.com/index.php/lists/kf4673fqgv1ef/unsubscribe/rk0917ya18bf8/qj1810emsh911 tklaynz. Mailimizi d=FCzg=FCn g=F6r=FCnt=FCleyemiyorsanz l=FCtfen buraya http://bosphorushaber.com/index.php/campaigns/qj1810emsh911/web-version/rk0917ya18bf8 tklaynz.=20 Bo=C4=9Fazi=C3=A7i E=C4=9Fitim http://www.bogaziciegitim.com.tr=20 istanbul Turkey a= lma zinlerine Dair Y?netmelik neler getiriyor? - Bu Y?netmelik = h?k?mleri iveren i=E7in maliyet destei salayacak m? - Aylk Prim ve Hizmet Belgelerinde sigortalnn meslei ile meslek kodunun bildirimi ilikin yaplacak d=FCzenlemeler ve denetim - G=FCvenlii Uzmanlar-yeri Hekimlerinin Hizmet S=FCrelerinde ve idari para cezalarnda y=FCr=FCrl=FCe girecek deiiklikler - SGK lemlerinde tiraz Ve Mahkeme Yolunda Yaplan Deiiklikler ve Uygulamas - Kanunundaki dari Para Cezalar - Sal ve G=FCvenlii Kanunundaki dari Para Cezalar - 6645 sayl Kanunla yaplan deiiklikler - yerinin az tehlikeli- tehlikeli ve =E7ok tehlikeli oluu idari para cezasn nasl etkiliyor? - =C7alan saysnn =F6nemi nedir? - Sosyal Sigortalar ve Genel Salk Sigortas Kanunda =D6ng=F6r=FClen dari Para Cezalar - dari Para cezalarndan kurtulma yollar - Kazas bildirimlerinde ve =FCcret tahakkuku ile SGK prim belgelerinde en =E7ok yaplan hatalar ve uygulamas - SGK Tevik lemlerinde Yaplan Deiiklikler Ve Uygulamas, avantajl teviklerden geriye doru faydalanlmas - e ade le lgili Deiiklikler Ve Uygulamas, e iade halinde yaplmas gereken SGK uygulamalar - Alt iveren (Taeron)-=DCst veren likisinde Deiikler le Bu likiden Kaynaklanan Asl verenin SGK- Kanunu le Sal Ve G=FCvenlii Bakmndan Y=FCk=FCml=FCl=FCk Ve Sorumluluklar le Alt verenliin Y=F6netimi, Muvazaa le lgili tiraz Ve Mahkeme Yollarna likin Deiiklikler - Yarg kararlar =E7er=E7evesinde i S=F6zlemesinin sonlandrlmasnda en =E7ok yaplan hatalar, ge=E7erli savunma-ihtarname ve tutanak d=FCzenlenmesi esaslar - Ge=E7erli braname ve belge d=FCzenlenmesinde p=FCf noktalar - Sal Ve G=FCvenlii Uygulamalarnda Yaplan K=F6kl=FC Deiiklikler Ve Getirilen Yenilikler: - Yeni y=FCk=FCml=FCl=FCkler ve idari para cezalarndan yaplan deiiklikler - G=FCvenlii uzmanlarna iverenlerine kar verilen yeni yetki-sorumluluklar ile m=FCeyyideler - =E7ilere verilen y=FCk=FCml=FCl=FCk e sorumluluklar ile i s=F6zlemesinin feshini gerektiren i g=FCvenliine ilikin nedenler - Yap denetim kurulularna verilen yeni yetki-sorumluluklar ile m=FCeyyideler - Sal Ve G=FCvenlii Uygulamalarnda tutulmas gereken defter ve ge=E7erli belge d=FCzenlenmesi - 2015 yl Torba Kanunu ile izinlerinde yaplan deiiklikler ile dier=20 Kanunu ilemlerinde yaplan deiiklikler ve uygulamas - Sosyal g=FCvenlik ile i mevzuatna ilikin dier deiiklik ve yenilikler - =C7alma ve Sosyal G=FCvenlik Teftilerine Hazrlk Uygulamalar - Ge=E7erli ve mevzuata uygun iyeri kayt ve belgelerinin d=FCzenlenmesi ve dikkat edilecek hususlar - =C7alanlarn meslekleri ile =FCcretleri baznda yaplan denetimler - Sekt=F6r baznda yaplan denetimler - in y=FCr=FCt=FCm koullarna ilikin denetimler - kazas-meslek hastalklar ile i sal ve g=FCvenlii denetimleri - sal ve g=FCvenlii baznda kayt ve belgelerinin d=FCzenlenmesi ve dikkat edilecek hususlar - hbar-ikayet bazl denetimler - Tefti s=FCrecinin y=F6netimi ile dier denetimlere ilikin dier hususlar=20 T=FCm Katlmclara Zirve D=F6k=FCmantasyonu ve kongre kitlerinin yansra sa Karaka'n "SGK- KUR ve Mevzuatnda dari Para Cezalar le =C7=F6z=FCm Yollar" Kitab hediye edilecektir. Bu eserde bata SGK olmak =FCzere, 4857 sayl=20 Kanunu, KUR-sizlik Sigortas, Yabanclar Mevzuat ve Yeni y=FCr=FCrl=FCe konan=20 Sal ve G=FCvenlii Kanunu uygulamalarnda =F6ng=F6r=FClen y=FCk=FCml=FCl=FCkler, bu y=FCk=FCml=FCl=FCklere bal olarak uygulanan idari para cezalar ile ihtilaflarnn =E7=F6z=FCm yollar bir b=FCt=FCn olarak ele alnmtr.=20 Katlm i=E7in kayt formu doldurulmas ve banka makbuzu ile tarafmza g=F6nderilmesi gerekmektedir. Programlarmz kontenjanlarmzla snrldr. Kayt ilemlerini web sayfamzdan online yapabilirsiniz, Program katlm bedeli 950TL+ KDV'dir. =D6le yemekleri, ara ikramlar, zirve kitleri, eitim notlar ve t=FCm d=F6k=FCmantasyon =FCcrete dahildir. Grup ndirim Oranlar: Ayn Firmadan 3 - 6 Katlmda %5, Ayn Firmadan 6 ve =FCzeri katlmda oran uygulanmaktadr. Toplu katlm, sponsorluk ve erken kayt avantajlarndan faydalanmak i=E7in l=FCtfen araynz: Kayt Yaptrmak i=E7in l=FCtfen tklaynz: BOSPHORUS CONFERENCES http://www.bogaziciegitim.com.tr 0216 422 9595 - 0555 422 9595 Bu etkinlik duyurusu tarafnza =FCye veritabanmzda kaytl olduunuz i=E7in g=F6nderilmitir. Bu hizmetimizden yararlanmak istemiyorsanz listemizden ayrlmak i=E7in buraya http://bosphorushaber.com/index.php/lists/kf4673fqgv1ef/unsubscribe/rk0917ya18bf8/qj1810emsh911 tklaynz. Mailimizi d=FCzg=FCn g=F6r=FCnt=FCleyemiyorsanz l=FCtfen buraya http://bosphorushaber.com/index.php/campaigns/qj1810emsh911/web-version/rk0917ya18bf8 tklaynz.=20 Bo=C4=9Fazi=C3=A7i E=C4=9Fitim http://www.bogaziciegitim.com.tr=20 istanbul Turkey m= leri iveren i?in maliyet destei salayacak m? - Aylk Prim ve Hizmet = Belgelerinde sigortalnn meslei ile meslek kodunun bildirimi ilikin y= aplacak d?zenlemeler ve denetim - G?venlii Uzmanlar-yeri Hekimlerin= in Hizme= t S?relerinde ve idari para cezalarnda y=FCr=FCrl=FCe girecek deiiklikler - SGK lemlerinde tiraz Ve Mahkeme Yolunda Yaplan Deiiklikler ve Uygulamas - Kanunundaki dari Para Cezalar - Sal ve G=FCvenlii Kanunundaki dari Para Cezalar - 6645 sayl Kanunla yaplan deiiklikler - yerinin az tehlikeli- tehlikeli ve =E7ok tehlikeli oluu idari para cezasn nasl etkiliyor? - =C7alan saysnn =F6nemi nedir? - Sosyal Sigortalar ve Genel Salk Sigortas Kanunda =D6ng=F6r=FClen dari Para Cezalar - dari Para cezalarndan kurtulma yollar - Kazas bildirimlerinde ve =FCcret tahakkuku ile SGK prim belgelerinde en =E7ok yaplan hatalar ve uygulamas - SGK Tevik lemlerinde Yaplan Deiiklikler Ve Uygulamas, avantajl teviklerden geriye doru faydalanlmas - e ade le lgili Deiiklikler Ve Uygulamas, e iade halinde yaplmas gereken SGK uygulamalar - Alt iveren (Taeron)-=DCst veren likisinde Deiikler le Bu likiden Kaynaklanan Asl verenin SGK- Kanunu le Sal Ve G=FCvenlii Bakmndan Y=FCk=FCml=FCl=FCk Ve Sorumluluklar le Alt verenliin Y=F6netimi, Muvazaa le lgili tiraz Ve Mahkeme Yollarna likin Deiiklikler - Yarg kararlar =E7er=E7evesinde i S=F6zlemesinin sonlandrlmasnda en =E7ok yaplan hatalar, ge=E7erli savunma-ihtarname ve tutanak d=FCzenlenmesi esaslar - Ge=E7erli braname ve belge d=FCzenlenmesinde p=FCf noktalar - Sal Ve G=FCvenlii Uygulamalarnda Yaplan K=F6kl=FC Deiiklikler Ve Getirilen Yenilikler: - Yeni y=FCk=FCml=FCl=FCkler ve idari para cezalarndan yaplan deiiklikler - G=FCvenlii uzmanlarna iverenlerine kar verilen yeni yetki-sorumluluklar ile m=FCeyyideler - =E7ilere verilen y=FCk=FCml=FCl=FCk e sorumluluklar ile i s=F6zlemesinin feshini gerektiren i g=FCvenliine ilikin nedenler - Yap denetim kurulularna verilen yeni yetki-sorumluluklar ile m=FCeyyideler - Sal Ve G=FCvenlii Uygulamalarnda tutulmas gereken defter ve ge=E7erli belge d=FCzenlenmesi - 2015 yl Torba Kanunu ile izinlerinde yaplan deiiklikler ile dier=20 Kanunu ilemlerinde yaplan deiiklikler ve uygulamas - Sosyal g=FCvenlik ile i mevzuatna ilikin dier deiiklik ve yenilikler - =C7alma ve Sosyal G=FCvenlik Teftilerine Hazrlk Uygulamalar - Ge=E7erli ve mevzuata uygun iyeri kayt ve belgelerinin d=FCzenlenmesi ve dikkat edilecek hususlar - =C7alanlarn meslekleri ile =FCcretleri baznda yaplan denetimler - Sekt=F6r baznda yaplan denetimler - in y=FCr=FCt=FCm koullarna ilikin denetimler - kazas-meslek hastalklar ile i sal ve g=FCvenlii denetimleri - sal ve g=FCvenlii baznda kayt ve belgelerinin d=FCzenlenmesi ve dikkat edilecek hususlar - hbar-ikayet bazl denetimler - Tefti s=FCrecinin y=F6netimi ile dier denetimlere ilikin dier hususlar=20 T=FCm Katlmclara Zirve D=F6k=FCmantasyonu ve kongre kitlerinin yansra sa Karaka'n "SGK- KUR ve Mevzuatnda dari Para Cezalar le =C7=F6z=FCm Yollar" Kitab hediye edilecektir. Bu eserde bata SGK olmak =FCzere, 4857 sayl=20 Kanunu, KUR-sizlik Sigortas, Yabanclar Mevzuat ve Yeni y=FCr=FCrl=FCe konan=20 Sal ve G=FCvenlii Kanunu uygulamalarnda =F6ng=F6r=FClen y=FCk=FCml=FCl=FCkler, bu y=FCk=FCml=FCl=FCklere bal olarak uygulanan idari para cezalar ile ihtilaflarnn =E7=F6z=FCm yollar bir b=FCt=FCn olarak ele alnmtr.=20 Katlm i=E7in kayt formu doldurulmas ve banka makbuzu ile tarafmza g=F6nderilmesi gerekmektedir. Programlarmz kontenjanlarmzla snrldr. Kayt ilemlerini web sayfamzdan online yapabilirsiniz, Program katlm bedeli 950TL+ KDV'dir. =D6le yemekleri, ara ikramlar, zirve kitleri, eitim notlar ve t=FCm d=F6k=FCmantasyon =FCcrete dahildir. Grup ndirim Oranlar: Ayn Firmadan 3 - 6 Katlmda %5, Ayn Firmadan 6 ve =FCzeri katlmda oran uygulanmaktadr. Toplu katlm, sponsorluk ve erken kayt avantajlarndan faydalanmak i=E7in l=FCtfen araynz: Kayt Yaptrmak i=E7in l=FCtfen tklaynz: BOSPHORUS CONFERENCES http://www.bogaziciegitim.com.tr 0216 422 9595 - 0555 422 9595 Bu etkinlik duyurusu tarafnza =FCye veritabanmzda kaytl olduunuz i=E7in g=F6nderilmitir. Bu hizmetimizden yararlanmak istemiyorsanz listemizden ayrlmak i=E7in buraya http://bosphorushaber.com/index.php/lists/kf4673fqgv1ef/unsubscribe/rk0917ya18bf8/qj1810emsh911 tklaynz. Mailimizi d=FCzg=FCn g=F6r=FCnt=FCleyemiyorsanz l=FCtfen buraya http://bosphorushaber.com/index.php/campaigns/qj1810emsh911/web-version/rk0917ya18bf8 tklaynz.=20 Bo=C4=9Fazi=C3=A7i E=C4=9Fitim http://www.bogaziciegitim.com.tr=20 istanbul Turkey r= elerinde ve idari para cezalarnd= a y?r=FCrl=FCe girecek deiiklikler - SGK lemlerinde tiraz Ve Mahkeme Yolunda Yaplan Deiiklikler ve Uygulamas - Kanunundaki dari Para Cezalar - Sal ve G=FCvenlii Kanunundaki dari Para Cezalar - 6645 sayl Kanunla yaplan deiiklikler - yerinin az tehlikeli- tehlikeli ve =E7ok tehlikeli oluu idari para cezasn nasl etkiliyor? - =C7alan saysnn =F6nemi nedir? - Sosyal Sigortalar ve Genel Salk Sigortas Kanunda =D6ng=F6r=FClen dari Para Cezalar - dari Para cezalarndan kurtulma yollar - Kazas bildirimlerinde ve =FCcret tahakkuku ile SGK prim belgelerinde en =E7ok yaplan hatalar ve uygulamas - SGK Tevik lemlerinde Yaplan Deiiklikler Ve Uygulamas, avantajl teviklerden geriye doru faydalanlmas - e ade le lgili Deiiklikler Ve Uygulamas, e iade halinde yaplmas gereken SGK uygulamalar - Alt iveren (Taeron)-=DCst veren likisinde Deiikler le Bu likiden Kaynaklanan Asl verenin SGK- Kanunu le Sal Ve G=FCvenlii Bakmndan Y=FCk=FCml=FCl=FCk Ve Sorumluluklar le Alt verenliin Y=F6netimi, Muvazaa le lgili tiraz Ve Mahkeme Yollarna likin Deiiklikler - Yarg kararlar =E7er=E7evesinde i S=F6zlemesinin sonlandrlmasnda en =E7ok yaplan hatalar, ge=E7erli savunma-ihtarname ve tutanak d=FCzenlenmesi esaslar - Ge=E7erli braname ve belge d=FCzenlenmesinde p=FCf noktalar - Sal Ve G=FCvenlii Uygulamalarnda Yaplan K=F6kl=FC Deiiklikler Ve Getirilen Yenilikler: - Yeni y=FCk=FCml=FCl=FCkler ve idari para cezalarndan yaplan deiiklikler - G=FCvenlii uzmanlarna iverenlerine kar verilen yeni yetki-sorumluluklar ile m=FCeyyideler - =E7ilere verilen y=FCk=FCml=FCl=FCk e sorumluluklar ile i s=F6zlemesinin feshini gerektiren i g=FCvenliine ilikin nedenler - Yap denetim kurulularna verilen yeni yetki-sorumluluklar ile m=FCeyyideler - Sal Ve G=FCvenlii Uygulamalarnda tutulmas gereken defter ve ge=E7erli belge d=FCzenlenmesi - 2015 yl Torba Kanunu ile izinlerinde yaplan deiiklikler ile dier=20 Kanunu ilemlerinde yaplan deiiklikler ve uygulamas - Sosyal g=FCvenlik ile i mevzuatna ilikin dier deiiklik ve yenilikler - =C7alma ve Sosyal G=FCvenlik Teftilerine Hazrlk Uygulamalar - Ge=E7erli ve mevzuata uygun iyeri kayt ve belgelerinin d=FCzenlenmesi ve dikkat edilecek hususlar - =C7alanlarn meslekleri ile =FCcretleri baznda yaplan denetimler - Sekt=F6r baznda yaplan denetimler - in y=FCr=FCt=FCm koullarna ilikin denetimler - kazas-meslek hastalklar ile i sal ve g=FCvenlii denetimleri - sal ve g=FCvenlii baznda kayt ve belgelerinin d=FCzenlenmesi ve dikkat edilecek hususlar - hbar-ikayet bazl denetimler - Tefti s=FCrecinin y=F6netimi ile dier denetimlere ilikin dier hususlar=20 T=FCm Katlmclara Zirve D=F6k=FCmantasyonu ve kongre kitlerinin yansra sa Karaka'n "SGK- KUR ve Mevzuatnda dari Para Cezalar le =C7=F6z=FCm Yollar" Kitab hediye edilecektir. Bu eserde bata SGK olmak =FCzere, 4857 sayl=20 Kanunu, KUR-sizlik Sigortas, Yabanclar Mevzuat ve Yeni y=FCr=FCrl=FCe konan=20 Sal ve G=FCvenlii Kanunu uygulamalarnda =F6ng=F6r=FClen y=FCk=FCml=FCl=FCkler, bu y=FCk=FCml=FCl=FCklere bal olarak uygulanan idari para cezalar ile ihtilaflarnn =E7=F6z=FCm yollar bir b=FCt=FCn olarak ele alnmtr.=20 Katlm i=E7in kayt formu doldurulmas ve banka makbuzu ile tarafmza g=F6nderilmesi gerekmektedir. Programlarmz kontenjanlarmzla snrldr. Kayt ilemlerini web sayfamzdan online yapabilirsiniz, Program katlm bedeli 950TL+ KDV'dir. =D6le yemekleri, ara ikramlar, zirve kitleri, eitim notlar ve t=FCm d=F6k=FCmantasyon =FCcrete dahildir. Grup ndirim Oranlar: Ayn Firmadan 3 - 6 Katlmda %5, Ayn Firmadan 6 ve =FCzeri katlmda oran uygulanmaktadr. Toplu katlm, sponsorluk ve erken kayt avantajlarndan faydalanmak i=E7in l=FCtfen araynz: Kayt Yaptrmak i=E7in l=FCtfen tklaynz: BOSPHORUS CONFERENCES http://www.bogaziciegitim.com.tr 0216 422 9595 - 0555 422 9595 Bu etkinlik duyurusu tarafnza =FCye veritabanmzda kaytl olduunuz i=E7in g=F6nderilmitir. Bu hizmetimizden yararlanmak istemiyorsanz listemizden ayrlmak i=E7in buraya http://bosphorushaber.com/index.php/lists/kf4673fqgv1ef/unsubscribe/rk0917ya18bf8/qj1810emsh911 tklaynz. Mailimizi d=FCzg=FCn g=F6r=FCnt=FCleyemiyorsanz l=FCtfen buraya http://bosphorushaber.com/index.php/campaigns/qj1810emsh911/web-version/rk0917ya18bf8 tklaynz.=20 Bo=C4=9Fazi=C3=A7i E=C4=9Fitim http://www.bogaziciegitim.com.tr=20 istanbul Turkey r= ?rl?e girecek deiiklikler - SGK lemlerinde tiraz Ve Mahkeme Yolunda Yaplan Deiiklikler ve Uygulamas - Kanunundaki dari Para Cezalar - Sal ve G=FCvenlii Kanunundaki dari Para Cezalar - 6645 sayl Kanunla yaplan deiiklikler - yerinin az tehlikeli- tehlikeli ve =E7ok tehlikeli oluu idari para cezasn nasl etkiliyor? - =C7alan saysnn =F6nemi nedir? - Sosyal Sigortalar ve Genel Salk Sigortas Kanunda =D6ng=F6r=FClen dari Para Cezalar - dari Para cezalarndan kurtulma yollar - Kazas bildirimlerinde ve =FCcret tahakkuku ile SGK prim belgelerinde en =E7ok yaplan hatalar ve uygulamas - SGK Tevik lemlerinde Yaplan Deiiklikler Ve Uygulamas, avantajl teviklerden geriye doru faydalanlmas - e ade le lgili Deiiklikler Ve Uygulamas, e iade halinde yaplmas gereken SGK uygulamalar - Alt iveren (Taeron)-=DCst veren likisinde Deiikler le Bu likiden Kaynaklanan Asl verenin SGK- Kanunu le Sal Ve G=FCvenlii Bakmndan Y=FCk=FCml=FCl=FCk Ve Sorumluluklar le Alt verenliin Y=F6netimi, Muvazaa le lgili tiraz Ve Mahkeme Yollarna likin Deiiklikler - Yarg kararlar =E7er=E7evesinde i S=F6zlemesinin sonlandrlmasnda en =E7ok yaplan hatalar, ge=E7erli savunma-ihtarname ve tutanak d=FCzenlenmesi esaslar - Ge=E7erli braname ve belge d=FCzenlenmesinde p=FCf noktalar - Sal Ve G=FCvenlii Uygulamalarnda Yaplan K=F6kl=FC Deiiklikler Ve Getirilen Yenilikler: - Yeni y=FCk=FCml=FCl=FCkler ve idari para cezalarndan yaplan deiiklikler - G=FCvenlii uzmanlarna iverenlerine kar verilen yeni yetki-sorumluluklar ile m=FCeyyideler - =E7ilere verilen y=FCk=FCml=FCl=FCk e sorumluluklar ile i s=F6zlemesinin feshini gerektiren i g=FCvenliine ilikin nedenler - Yap denetim kurulularna verilen yeni yetki-sorumluluklar ile m=FCeyyideler - Sal Ve G=FCvenlii Uygulamalarnda tutulmas gereken defter ve ge=E7erli belge d=FCzenlenmesi - 2015 yl Torba Kanunu ile izinlerinde yaplan deiiklikler ile dier=20 Kanunu ilemlerinde yaplan deiiklikler ve uygulamas - Sosyal g=FCvenlik ile i mevzuatna ilikin dier deiiklik ve yenilikler - =C7alma ve Sosyal G=FCvenlik Teftilerine Hazrlk Uygulamalar - Ge=E7erli ve mevzuata uygun iyeri kayt ve belgelerinin d=FCzenlenmesi ve dikkat edilecek hususlar - =C7alanlarn meslekleri ile =FCcretleri baznda yaplan denetimler - Sekt=F6r baznda yaplan denetimler - in y=FCr=FCt=FCm koullarna ilikin denetimler - kazas-meslek hastalklar ile i sal ve g=FCvenlii denetimleri - sal ve g=FCvenlii baznda kayt ve belgelerinin d=FCzenlenmesi ve dikkat edilecek hususlar - hbar-ikayet bazl denetimler - Tefti s=FCrecinin y=F6netimi ile dier denetimlere ilikin dier hususlar=20 T=FCm Katlmclara Zirve D=F6k=FCmantasyonu ve kongre kitlerinin yansra sa Karaka'n "SGK- KUR ve Mevzuatnda dari Para Cezalar le =C7=F6z=FCm Yollar" Kitab hediye edilecektir. Bu eserde bata SGK olmak =FCzere, 4857 sayl=20 Kanunu, KUR-sizlik Sigortas, Yabanclar Mevzuat ve Yeni y=FCr=FCrl=FCe konan=20 Sal ve G=FCvenlii Kanunu uygulamalarnda =F6ng=F6r=FClen y=FCk=FCml=FCl=FCkler, bu y=FCk=FCml=FCl=FCklere bal olarak uygulanan idari para cezalar ile ihtilaflarnn =E7=F6z=FCm yollar bir b=FCt=FCn olarak ele alnmtr.=20 Katlm i=E7in kayt formu doldurulmas ve banka makbuzu ile tarafmza g=F6nderilmesi gerekmektedir. Programlarmz kontenjanlarmzla snrldr. Kayt ilemlerini web sayfamzdan online yapabilirsiniz, Program katlm bedeli 950TL+ KDV'dir. =D6le yemekleri, ara ikramlar, zirve kitleri, eitim notlar ve t=FCm d=F6k=FCmantasyon =FCcrete dahildir. Grup ndirim Oranlar: Ayn Firmadan 3 - 6 Katlmda %5, Ayn Firmadan 6 ve =FCzeri katlmda oran uygulanmaktadr. Toplu katlm, sponsorluk ve erken kayt avantajlarndan faydalanmak i=E7in l=FCtfen araynz: Kayt Yaptrmak i=E7in l=FCtfen tklaynz: BOSPHORUS CONFERENCES http://www.bogaziciegitim.com.tr 0216 422 9595 - 0555 422 9595 Bu etkinlik duyurusu tarafnza =FCye veritabanmzda kaytl olduunuz i=E7in g=F6nderilmitir. Bu hizmetimizden yararlanmak istemiyorsanz listemizden ayrlmak i=E7in buraya http://bosphorushaber.com/index.php/lists/kf4673fqgv1ef/unsubscribe/rk0917ya18bf8/qj1810emsh911 tklaynz. Mailimizi d=FCzg=FCn g=F6r=FCnt=FCleyemiyorsanz l=FCtfen buraya http://bosphorushaber.com/index.php/campaigns/qj1810emsh911/web-version/rk0917ya18bf8 tklaynz.=20 Bo=C4=9Fazi=C3=A7i E=C4=9Fitim http://www.bogaziciegitim.com.tr=20 istanbul Turkey e= girecek deiiklikler - SGK lemlerinde tiraz Ve Mahkeme Yolunda Yapl= an Deiiklikler ve Uygulamas - Kanunundaki dari Para Cezalar= - Sal ve G?venlii Kanunundaki dari Para Cezalar - 6645 sayl = Kanunla yaplan deiiklikler - yerinin az tehlikeli- tehlikeli ve ?ok= tehlikeli oluu idari para cezasn nasl etkiliyor? - ?alan saysn= n ?nemi nedir? - Sosyal Sigortalar ve Genel Salk Sigortas Kanun= da ?ng=F6r=FClen dari Para Cezalar - dari Para cezalarndan kurtulma yollar - Kazas bildirimlerinde ve =FCcret tahakkuku ile SGK prim belgelerinde en =E7ok yaplan hatalar ve uygulamas - SGK Tevik lemlerinde Yaplan Deiiklikler Ve Uygulamas, avantajl teviklerden geriye doru faydalanlmas - e ade le lgili Deiiklikler Ve Uygulamas, e iade halinde yaplmas gereken SGK uygulamalar - Alt iveren (Taeron)-=DCst veren likisinde Deiikler le Bu likiden Kaynaklanan Asl verenin SGK- Kanunu le Sal Ve G=FCvenlii Bakmndan Y=FCk=FCml=FCl=FCk Ve Sorumluluklar le Alt verenliin Y=F6netimi, Muvazaa le lgili tiraz Ve Mahkeme Yollarna likin Deiiklikler - Yarg kararlar =E7er=E7evesinde i S=F6zlemesinin sonlandrlmasnda en =E7ok yaplan hatalar, ge=E7erli savunma-ihtarname ve tutanak d=FCzenlenmesi esaslar - Ge=E7erli braname ve belge d=FCzenlenmesinde p=FCf noktalar - Sal Ve G=FCvenlii Uygulamalarnda Yaplan K=F6kl=FC Deiiklikler Ve Getirilen Yenilikler: - Yeni y=FCk=FCml=FCl=FCkler ve idari para cezalarndan yaplan deiiklikler - G=FCvenlii uzmanlarna iverenlerine kar verilen yeni yetki-sorumluluklar ile m=FCeyyideler - =E7ilere verilen y=FCk=FCml=FCl=FCk e sorumluluklar ile i s=F6zlemesinin feshini gerektiren i g=FCvenliine ilikin nedenler - Yap denetim kurulularna verilen yeni yetki-sorumluluklar ile m=FCeyyideler - Sal Ve G=FCvenlii Uygulamalarnda tutulmas gereken defter ve ge=E7erli belge d=FCzenlenmesi - 2015 yl Torba Kanunu ile izinlerinde yaplan deiiklikler ile dier=20 Kanunu ilemlerinde yaplan deiiklikler ve uygulamas - Sosyal g=FCvenlik ile i mevzuatna ilikin dier deiiklik ve yenilikler - =C7alma ve Sosyal G=FCvenlik Teftilerine Hazrlk Uygulamalar - Ge=E7erli ve mevzuata uygun iyeri kayt ve belgelerinin d=FCzenlenmesi ve dikkat edilecek hususlar - =C7alanlarn meslekleri ile =FCcretleri baznda yaplan denetimler - Sekt=F6r baznda yaplan denetimler - in y=FCr=FCt=FCm koullarna ilikin denetimler - kazas-meslek hastalklar ile i sal ve g=FCvenlii denetimleri - sal ve g=FCvenlii baznda kayt ve belgelerinin d=FCzenlenmesi ve dikkat edilecek hususlar - hbar-ikayet bazl denetimler - Tefti s=FCrecinin y=F6netimi ile dier denetimlere ilikin dier hususlar=20 T=FCm Katlmclara Zirve D=F6k=FCmantasyonu ve kongre kitlerinin yansra sa Karaka'n "SGK- KUR ve Mevzuatnda dari Para Cezalar le =C7=F6z=FCm Yollar" Kitab hediye edilecektir. Bu eserde bata SGK olmak =FCzere, 4857 sayl=20 Kanunu, KUR-sizlik Sigortas, Yabanclar Mevzuat ve Yeni y=FCr=FCrl=FCe konan=20 Sal ve G=FCvenlii Kanunu uygulamalarnda =F6ng=F6r=FClen y=FCk=FCml=FCl=FCkler, bu y=FCk=FCml=FCl=FCklere bal olarak uygulanan idari para cezalar ile ihtilaflarnn =E7=F6z=FCm yollar bir b=FCt=FCn olarak ele alnmtr.=20 Katlm i=E7in kayt formu doldurulmas ve banka makbuzu ile tarafmza g=F6nderilmesi gerekmektedir. Programlarmz kontenjanlarmzla snrldr. Kayt ilemlerini web sayfamzdan online yapabilirsiniz, Program katlm bedeli 950TL+ KDV'dir. =D6le yemekleri, ara ikramlar, zirve kitleri, eitim notlar ve t=FCm d=F6k=FCmantasyon =FCcrete dahildir. Grup ndirim Oranlar: Ayn Firmadan 3 - 6 Katlmda %5, Ayn Firmadan 6 ve =FCzeri katlmda oran uygulanmaktadr. Toplu katlm, sponsorluk ve erken kayt avantajlarndan faydalanmak i=E7in l=FCtfen araynz: Kayt Yaptrmak i=E7in l=FCtfen tklaynz: BOSPHORUS CONFERENCES http://www.bogaziciegitim.com.tr 0216 422 9595 - 0555 422 9595 Bu etkinlik duyurusu tarafnza =FCye veritabanmzda kaytl olduunuz i=E7in g=F6nderilmitir. Bu hizmetimizden yararlanmak istemiyorsanz listemizden ayrlmak i=E7in buraya http://bosphorushaber.com/index.php/lists/kf4673fqgv1ef/unsubscribe/rk0917ya18bf8/qj1810emsh911 tklaynz. Mailimizi d=FCzg=FCn g=F6r=FCnt=FCleyemiyorsanz l=FCtfen buraya http://bosphorushaber.com/index.php/campaigns/qj1810emsh911/web-version/rk0917ya18bf8 tklaynz.=20 Bo=C4=9Fazi=C3=A7i E=C4=9Fitim http://www.bogaziciegitim.com.tr=20 istanbul Turkey n= g?r?len dari Para Cezalar - dari Para cezalarndan kurtulma yollar - Kazas bildirimlerinde ve =FCcret tahakkuku ile SGK prim belgelerinde en =E7ok yaplan hatalar ve uygulamas - SGK Tevik lemlerinde Yaplan Deiiklikler Ve Uygulamas, avantajl teviklerden geriye doru faydalanlmas - e ade le lgili Deiiklikler Ve Uygulamas, e iade halinde yaplmas gereken SGK uygulamalar - Alt iveren (Taeron)-=DCst veren likisinde Deiikler le Bu likiden Kaynaklanan Asl verenin SGK- Kanunu le Sal Ve G=FCvenlii Bakmndan Y=FCk=FCml=FCl=FCk Ve Sorumluluklar le Alt verenliin Y=F6netimi, Muvazaa le lgili tiraz Ve Mahkeme Yollarna likin Deiiklikler - Yarg kararlar =E7er=E7evesinde i S=F6zlemesinin sonlandrlmasnda en =E7ok yaplan hatalar, ge=E7erli savunma-ihtarname ve tutanak d=FCzenlenmesi esaslar - Ge=E7erli braname ve belge d=FCzenlenmesinde p=FCf noktalar - Sal Ve G=FCvenlii Uygulamalarnda Yaplan K=F6kl=FC Deiiklikler Ve Getirilen Yenilikler: - Yeni y=FCk=FCml=FCl=FCkler ve idari para cezalarndan yaplan deiiklikler - G=FCvenlii uzmanlarna iverenlerine kar verilen yeni yetki-sorumluluklar ile m=FCeyyideler - =E7ilere verilen y=FCk=FCml=FCl=FCk e sorumluluklar ile i s=F6zlemesinin feshini gerektiren i g=FCvenliine ilikin nedenler - Yap denetim kurulularna verilen yeni yetki-sorumluluklar ile m=FCeyyideler - Sal Ve G=FCvenlii Uygulamalarnda tutulmas gereken defter ve ge=E7erli belge d=FCzenlenmesi - 2015 yl Torba Kanunu ile izinlerinde yaplan deiiklikler ile dier=20 Kanunu ilemlerinde yaplan deiiklikler ve uygulamas - Sosyal g=FCvenlik ile i mevzuatna ilikin dier deiiklik ve yenilikler - =C7alma ve Sosyal G=FCvenlik Teftilerine Hazrlk Uygulamalar - Ge=E7erli ve mevzuata uygun iyeri kayt ve belgelerinin d=FCzenlenmesi ve dikkat edilecek hususlar - =C7alanlarn meslekleri ile =FCcretleri baznda yaplan denetimler - Sekt=F6r baznda yaplan denetimler - in y=FCr=FCt=FCm koullarna ilikin denetimler - kazas-meslek hastalklar ile i sal ve g=FCvenlii denetimleri - sal ve g=FCvenlii baznda kayt ve belgelerinin d=FCzenlenmesi ve dikkat edilecek hususlar - hbar-ikayet bazl denetimler - Tefti s=FCrecinin y=F6netimi ile dier denetimlere ilikin dier hususlar=20 T=FCm Katlmclara Zirve D=F6k=FCmantasyonu ve kongre kitlerinin yansra sa Karaka'n "SGK- KUR ve Mevzuatnda dari Para Cezalar le =C7=F6z=FCm Yollar" Kitab hediye edilecektir. Bu eserde bata SGK olmak =FCzere, 4857 sayl=20 Kanunu, KUR-sizlik Sigortas, Yabanclar Mevzuat ve Yeni y=FCr=FCrl=FCe konan=20 Sal ve G=FCvenlii Kanunu uygulamalarnda =F6ng=F6r=FClen y=FCk=FCml=FCl=FCkler, bu y=FCk=FCml=FCl=FCklere bal olarak uygulanan idari para cezalar ile ihtilaflarnn =E7=F6z=FCm yollar bir b=FCt=FCn olarak ele alnmtr.=20 Katlm i=E7in kayt formu doldurulmas ve banka makbuzu ile tarafmza g=F6nderilmesi gerekmektedir. Programlarmz kontenjanlarmzla snrldr. Kayt ilemlerini web sayfamzdan online yapabilirsiniz, Program katlm bedeli 950TL+ KDV'dir. =D6le yemekleri, ara ikramlar, zirve kitleri, eitim notlar ve t=FCm d=F6k=FCmantasyon =FCcrete dahildir. Grup ndirim Oranlar: Ayn Firmadan 3 - 6 Katlmda %5, Ayn Firmadan 6 ve =FCzeri katlmda oran uygulanmaktadr. Toplu katlm, sponsorluk ve erken kayt avantajlarndan faydalanmak i=E7in l=FCtfen araynz: Kayt Yaptrmak i=E7in l=FCtfen tklaynz: BOSPHORUS CONFERENCES http://www.bogaziciegitim.com.tr 0216 422 9595 - 0555 422 9595 Bu etkinlik duyurusu tarafnza =FCye veritabanmzda kaytl olduunuz i=E7in g=F6nderilmitir. Bu hizmetimizden yararlanmak istemiyorsanz listemizden ayrlmak i=E7in buraya http://bosphorushaber.com/index.php/lists/kf4673fqgv1ef/unsubscribe/rk0917ya18bf8/qj1810emsh911 tklaynz. Mailimizi d=FCzg=FCn g=F6r=FCnt=FCleyemiyorsanz l=FCtfen buraya http://bosphorushaber.com/index.php/campaigns/qj1810emsh911/web-version/rk0917ya18bf8 tklaynz.=20 Bo=C4=9Fazi=C3=A7i E=C4=9Fitim http://www.bogaziciegitim.com.tr=20 istanbul Turkey l= en dari Para Cezalar - dari Para cezalarndan kurtulma yol= lar - Kazas bildirimlerinde ve ?cret tahakkuku ile SGK prim belgele= rinde en ?ok yaplan hatalar ve uygulamas - SGK Tevik lemlerinde= Yaplan Deiiklikler Ve Uygulamas, avantajl teviklerden geriye doru f= aydalanlmas - e ade le lgili Deiiklikler Ve Uygulamas, e iade halind= e yaplmas gereken SGK uygulamalar - Alt iveren (Taeron)-?st ver= en likisinde Deiikler le Bu likiden Kaynaklanan Asl verenin SGK- Kanu= nu le Sal V= e G?venlii Bakmndan Y=FCk=FCml=FCl=FCk Ve Sorumluluklar le Alt verenliin Y=F6netimi, Muvazaa le lgili tiraz Ve Mahkeme Yollarna likin Deiiklikler - Yarg kararlar =E7er=E7evesinde i S=F6zlemesinin sonlandrlmasnda en =E7ok yaplan hatalar, ge=E7erli savunma-ihtarname ve tutanak d=FCzenlenmesi esaslar - Ge=E7erli braname ve belge d=FCzenlenmesinde p=FCf noktalar - Sal Ve G=FCvenlii Uygulamalarnda Yaplan K=F6kl=FC Deiiklikler Ve Getirilen Yenilikler: - Yeni y=FCk=FCml=FCl=FCkler ve idari para cezalarndan yaplan deiiklikler - G=FCvenlii uzmanlarna iverenlerine kar verilen yeni yetki-sorumluluklar ile m=FCeyyideler - =E7ilere verilen y=FCk=FCml=FCl=FCk e sorumluluklar ile i s=F6zlemesinin feshini gerektiren i g=FCvenliine ilikin nedenler - Yap denetim kurulularna verilen yeni yetki-sorumluluklar ile m=FCeyyideler - Sal Ve G=FCvenlii Uygulamalarnda tutulmas gereken defter ve ge=E7erli belge d=FCzenlenmesi - 2015 yl Torba Kanunu ile izinlerinde yaplan deiiklikler ile dier=20 Kanunu ilemlerinde yaplan deiiklikler ve uygulamas - Sosyal g=FCvenlik ile i mevzuatna ilikin dier deiiklik ve yenilikler - =C7alma ve Sosyal G=FCvenlik Teftilerine Hazrlk Uygulamalar - Ge=E7erli ve mevzuata uygun iyeri kayt ve belgelerinin d=FCzenlenmesi ve dikkat edilecek hususlar - =C7alanlarn meslekleri ile =FCcretleri baznda yaplan denetimler - Sekt=F6r baznda yaplan denetimler - in y=FCr=FCt=FCm koullarna ilikin denetimler - kazas-meslek hastalklar ile i sal ve g=FCvenlii denetimleri - sal ve g=FCvenlii baznda kayt ve belgelerinin d=FCzenlenmesi ve dikkat edilecek hususlar - hbar-ikayet bazl denetimler - Tefti s=FCrecinin y=F6netimi ile dier denetimlere ilikin dier hususlar=20 T=FCm Katlmclara Zirve D=F6k=FCmantasyonu ve kongre kitlerinin yansra sa Karaka'n "SGK- KUR ve Mevzuatnda dari Para Cezalar le =C7=F6z=FCm Yollar" Kitab hediye edilecektir. Bu eserde bata SGK olmak =FCzere, 4857 sayl=20 Kanunu, KUR-sizlik Sigortas, Yabanclar Mevzuat ve Yeni y=FCr=FCrl=FCe konan=20 Sal ve G=FCvenlii Kanunu uygulamalarnda =F6ng=F6r=FClen y=FCk=FCml=FCl=FCkler, bu y=FCk=FCml=FCl=FCklere bal olarak uygulanan idari para cezalar ile ihtilaflarnn =E7=F6z=FCm yollar bir b=FCt=FCn olarak ele alnmtr.=20 Katlm i=E7in kayt formu doldurulmas ve banka makbuzu ile tarafmza g=F6nderilmesi gerekmektedir. Programlarmz kontenjanlarmzla snrldr. Kayt ilemlerini web sayfamzdan online yapabilirsiniz, Program katlm bedeli 950TL+ KDV'dir. =D6le yemekleri, ara ikramlar, zirve kitleri, eitim notlar ve t=FCm d=F6k=FCmantasyon =FCcrete dahildir. Grup ndirim Oranlar: Ayn Firmadan 3 - 6 Katlmda %5, Ayn Firmadan 6 ve =FCzeri katlmda oran uygulanmaktadr. Toplu katlm, sponsorluk ve erken kayt avantajlarndan faydalanmak i=E7in l=FCtfen araynz: Kayt Yaptrmak i=E7in l=FCtfen tklaynz: BOSPHORUS CONFERENCES http://www.bogaziciegitim.com.tr 0216 422 9595 - 0555 422 9595 Bu etkinlik duyurusu tarafnza =FCye veritabanmzda kaytl olduunuz i=E7in g=F6nderilmitir. Bu hizmetimizden yararlanmak istemiyorsanz listemizden ayrlmak i=E7in buraya http://bosphorushaber.com/index.php/lists/kf4673fqgv1ef/unsubscribe/rk0917ya18bf8/qj1810emsh911 tklaynz. Mailimizi d=FCzg=FCn g=F6r=FCnt=FCleyemiyorsanz l=FCtfen buraya http://bosphorushaber.com/index.php/campaigns/qj1810emsh911/web-version/rk0917ya18bf8 tklaynz.=20 Bo=C4=9Fazi=C3=A7i E=C4=9Fitim http://www.bogaziciegitim.com.tr=20 istanbul Turkey v= enlii Bakmndan Y?k?m= l?l?k Ve Sorumluluklar le Alt verenliin Y=F6netimi, Muvazaa le lgili tiraz Ve Mahkeme Yollarna likin Deiiklikler - Yarg kararlar =E7er=E7evesinde i S=F6zlemesinin sonlandrlmasnda en =E7ok yaplan hatalar, ge=E7erli savunma-ihtarname ve tutanak d=FCzenlenmesi esaslar - Ge=E7erli braname ve belge d=FCzenlenmesinde p=FCf noktalar - Sal Ve G=FCvenlii Uygulamalarnda Yaplan K=F6kl=FC Deiiklikler Ve Getirilen Yenilikler: - Yeni y=FCk=FCml=FCl=FCkler ve idari para cezalarndan yaplan deiiklikler - G=FCvenlii uzmanlarna iverenlerine kar verilen yeni yetki-sorumluluklar ile m=FCeyyideler - =E7ilere verilen y=FCk=FCml=FCl=FCk e sorumluluklar ile i s=F6zlemesinin feshini gerektiren i g=FCvenliine ilikin nedenler - Yap denetim kurulularna verilen yeni yetki-sorumluluklar ile m=FCeyyideler - Sal Ve G=FCvenlii Uygulamalarnda tutulmas gereken defter ve ge=E7erli belge d=FCzenlenmesi - 2015 yl Torba Kanunu ile izinlerinde yaplan deiiklikler ile dier=20 Kanunu ilemlerinde yaplan deiiklikler ve uygulamas - Sosyal g=FCvenlik ile i mevzuatna ilikin dier deiiklik ve yenilikler - =C7alma ve Sosyal G=FCvenlik Teftilerine Hazrlk Uygulamalar - Ge=E7erli ve mevzuata uygun iyeri kayt ve belgelerinin d=FCzenlenmesi ve dikkat edilecek hususlar - =C7alanlarn meslekleri ile =FCcretleri baznda yaplan denetimler - Sekt=F6r baznda yaplan denetimler - in y=FCr=FCt=FCm koullarna ilikin denetimler - kazas-meslek hastalklar ile i sal ve g=FCvenlii denetimleri - sal ve g=FCvenlii baznda kayt ve belgelerinin d=FCzenlenmesi ve dikkat edilecek hususlar - hbar-ikayet bazl denetimler - Tefti s=FCrecinin y=F6netimi ile dier denetimlere ilikin dier hususlar=20 T=FCm Katlmclara Zirve D=F6k=FCmantasyonu ve kongre kitlerinin yansra sa Karaka'n "SGK- KUR ve Mevzuatnda dari Para Cezalar le =C7=F6z=FCm Yollar" Kitab hediye edilecektir. Bu eserde bata SGK olmak =FCzere, 4857 sayl=20 Kanunu, KUR-sizlik Sigortas, Yabanclar Mevzuat ve Yeni y=FCr=FCrl=FCe konan=20 Sal ve G=FCvenlii Kanunu uygulamalarnda =F6ng=F6r=FClen y=FCk=FCml=FCl=FCkler, bu y=FCk=FCml=FCl=FCklere bal olarak uygulanan idari para cezalar ile ihtilaflarnn =E7=F6z=FCm yollar bir b=FCt=FCn olarak ele alnmtr.=20 Katlm i=E7in kayt formu doldurulmas ve banka makbuzu ile tarafmza g=F6nderilmesi gerekmektedir. Programlarmz kontenjanlarmzla snrldr. Kayt ilemlerini web sayfamzdan online yapabilirsiniz, Program katlm bedeli 950TL+ KDV'dir. =D6le yemekleri, ara ikramlar, zirve kitleri, eitim notlar ve t=FCm d=F6k=FCmantasyon =FCcrete dahildir. Grup ndirim Oranlar: Ayn Firmadan 3 - 6 Katlmda %5, Ayn Firmadan 6 ve =FCzeri katlmda oran uygulanmaktadr. Toplu katlm, sponsorluk ve erken kayt avantajlarndan faydalanmak i=E7in l=FCtfen araynz: Kayt Yaptrmak i=E7in l=FCtfen tklaynz: BOSPHORUS CONFERENCES http://www.bogaziciegitim.com.tr 0216 422 9595 - 0555 422 9595 Bu etkinlik duyurusu tarafnza =FCye veritabanmzda kaytl olduunuz i=E7in g=F6nderilmitir. Bu hizmetimizden yararlanmak istemiyorsanz listemizden ayrlmak i=E7in buraya http://bosphorushaber.com/index.php/lists/kf4673fqgv1ef/unsubscribe/rk0917ya18bf8/qj1810emsh911 tklaynz. Mailimizi d=FCzg=FCn g=F6r=FCnt=FCleyemiyorsanz l=FCtfen buraya http://bosphorushaber.com/index.php/campaigns/qj1810emsh911/web-version/rk0917ya18bf8 tklaynz.=20 Bo=C4=9Fazi=C3=A7i E=C4=9Fitim http://www.bogaziciegitim.com.tr=20 istanbul Turkey k= Ve Sorumluluklar le Alt verenliin Y?netimi, Muvazaa le lgili tiraz V= e Mahkeme Yollarna likin Deiiklikler - Yarg kararlar ?er?evesinde i= S?zlemesinin sonlandrlmasnda en ?ok yaplan hatalar,= ge?erli savunma-ihtarname ve tutanak d=FCzenlenmesi esaslar - Ge=E7erli braname ve belge d=FCzenlenmesinde p=FCf noktalar - Sal Ve G=FCvenlii Uygulamalarnda Yaplan K=F6kl=FC Deiiklikler Ve Getirilen Yenilikler: - Yeni y=FCk=FCml=FCl=FCkler ve idari para cezalarndan yaplan deiiklikler - G=FCvenlii uzmanlarna iverenlerine kar verilen yeni yetki-sorumluluklar ile m=FCeyyideler - =E7ilere verilen y=FCk=FCml=FCl=FCk e sorumluluklar ile i s=F6zlemesinin feshini gerektiren i g=FCvenliine ilikin nedenler - Yap denetim kurulularna verilen yeni yetki-sorumluluklar ile m=FCeyyideler - Sal Ve G=FCvenlii Uygulamalarnda tutulmas gereken defter ve ge=E7erli belge d=FCzenlenmesi - 2015 yl Torba Kanunu ile izinlerinde yaplan deiiklikler ile dier=20 Kanunu ilemlerinde yaplan deiiklikler ve uygulamas - Sosyal g=FCvenlik ile i mevzuatna ilikin dier deiiklik ve yenilikler - =C7alma ve Sosyal G=FCvenlik Teftilerine Hazrlk Uygulamalar - Ge=E7erli ve mevzuata uygun iyeri kayt ve belgelerinin d=FCzenlenmesi ve dikkat edilecek hususlar - =C7alanlarn meslekleri ile =FCcretleri baznda yaplan denetimler - Sekt=F6r baznda yaplan denetimler - in y=FCr=FCt=FCm koullarna ilikin denetimler - kazas-meslek hastalklar ile i sal ve g=FCvenlii denetimleri - sal ve g=FCvenlii baznda kayt ve belgelerinin d=FCzenlenmesi ve dikkat edilecek hususlar - hbar-ikayet bazl denetimler - Tefti s=FCrecinin y=F6netimi ile dier denetimlere ilikin dier hususlar=20 T=FCm Katlmclara Zirve D=F6k=FCmantasyonu ve kongre kitlerinin yansra sa Karaka'n "SGK- KUR ve Mevzuatnda dari Para Cezalar le =C7=F6z=FCm Yollar" Kitab hediye edilecektir. Bu eserde bata SGK olmak =FCzere, 4857 sayl=20 Kanunu, KUR-sizlik Sigortas, Yabanclar Mevzuat ve Yeni y=FCr=FCrl=FCe konan=20 Sal ve G=FCvenlii Kanunu uygulamalarnda =F6ng=F6r=FClen y=FCk=FCml=FCl=FCkler, bu y=FCk=FCml=FCl=FCklere bal olarak uygulanan idari para cezalar ile ihtilaflarnn =E7=F6z=FCm yollar bir b=FCt=FCn olarak ele alnmtr.=20 Katlm i=E7in kayt formu doldurulmas ve banka makbuzu ile tarafmza g=F6nderilmesi gerekmektedir. Programlarmz kontenjanlarmzla snrldr. Kayt ilemlerini web sayfamzdan online yapabilirsiniz, Program katlm bedeli 950TL+ KDV'dir. =D6le yemekleri, ara ikramlar, zirve kitleri, eitim notlar ve t=FCm d=F6k=FCmantasyon =FCcrete dahildir. Grup ndirim Oranlar: Ayn Firmadan 3 - 6 Katlmda %5, Ayn Firmadan 6 ve =FCzeri katlmda oran uygulanmaktadr. Toplu katlm, sponsorluk ve erken kayt avantajlarndan faydalanmak i=E7in l=FCtfen araynz: Kayt Yaptrmak i=E7in l=FCtfen tklaynz: BOSPHORUS CONFERENCES http://www.bogaziciegitim.com.tr 0216 422 9595 - 0555 422 9595 Bu etkinlik duyurusu tarafnza =FCye veritabanmzda kaytl olduunuz i=E7in g=F6nderilmitir. Bu hizmetimizden yararlanmak istemiyorsanz listemizden ayrlmak i=E7in buraya http://bosphorushaber.com/index.php/lists/kf4673fqgv1ef/unsubscribe/rk0917ya18bf8/qj1810emsh911 tklaynz. Mailimizi d=FCzg=FCn g=F6r=FCnt=FCleyemiyorsanz l=FCtfen buraya http://bosphorushaber.com/index.php/campaigns/qj1810emsh911/web-version/rk0917ya18bf8 tklaynz.=20 Bo=C4=9Fazi=C3=A7i E=C4=9Fitim http://www.bogaziciegitim.com.tr=20 istanbul Turkey e= rli savunma-ihtarname ve tutanak d?zenlenmesi esaslar -= Ge?erli braname ve belge d=FCzenlenmesinde p=FCf noktalar - Sal Ve G=FCvenlii Uygulamalarnda Yaplan K=F6kl=FC Deiiklikler Ve Getirilen Yenilikler: - Yeni y=FCk=FCml=FCl=FCkler ve idari para cezalarndan yaplan deiiklikler - G=FCvenlii uzmanlarna iverenlerine kar verilen yeni yetki-sorumluluklar ile m=FCeyyideler - =E7ilere verilen y=FCk=FCml=FCl=FCk e sorumluluklar ile i s=F6zlemesinin feshini gerektiren i g=FCvenliine ilikin nedenler - Yap denetim kurulularna verilen yeni yetki-sorumluluklar ile m=FCeyyideler - Sal Ve G=FCvenlii Uygulamalarnda tutulmas gereken defter ve ge=E7erli belge d=FCzenlenmesi - 2015 yl Torba Kanunu ile izinlerinde yaplan deiiklikler ile dier=20 Kanunu ilemlerinde yaplan deiiklikler ve uygulamas - Sosyal g=FCvenlik ile i mevzuatna ilikin dier deiiklik ve yenilikler - =C7alma ve Sosyal G=FCvenlik Teftilerine Hazrlk Uygulamalar - Ge=E7erli ve mevzuata uygun iyeri kayt ve belgelerinin d=FCzenlenmesi ve dikkat edilecek hususlar - =C7alanlarn meslekleri ile =FCcretleri baznda yaplan denetimler - Sekt=F6r baznda yaplan denetimler - in y=FCr=FCt=FCm koullarna ilikin denetimler - kazas-meslek hastalklar ile i sal ve g=FCvenlii denetimleri - sal ve g=FCvenlii baznda kayt ve belgelerinin d=FCzenlenmesi ve dikkat edilecek hususlar - hbar-ikayet bazl denetimler - Tefti s=FCrecinin y=F6netimi ile dier denetimlere ilikin dier hususlar=20 T=FCm Katlmclara Zirve D=F6k=FCmantasyonu ve kongre kitlerinin yansra sa Karaka'n "SGK- KUR ve Mevzuatnda dari Para Cezalar le =C7=F6z=FCm Yollar" Kitab hediye edilecektir. Bu eserde bata SGK olmak =FCzere, 4857 sayl=20 Kanunu, KUR-sizlik Sigortas, Yabanclar Mevzuat ve Yeni y=FCr=FCrl=FCe konan=20 Sal ve G=FCvenlii Kanunu uygulamalarnda =F6ng=F6r=FClen y=FCk=FCml=FCl=FCkler, bu y=FCk=FCml=FCl=FCklere bal olarak uygulanan idari para cezalar ile ihtilaflarnn =E7=F6z=FCm yollar bir b=FCt=FCn olarak ele alnmtr.=20 Katlm i=E7in kayt formu doldurulmas ve banka makbuzu ile tarafmza g=F6nderilmesi gerekmektedir. Programlarmz kontenjanlarmzla snrldr. Kayt ilemlerini web sayfamzdan online yapabilirsiniz, Program katlm bedeli 950TL+ KDV'dir. =D6le yemekleri, ara ikramlar, zirve kitleri, eitim notlar ve t=FCm d=F6k=FCmantasyon =FCcrete dahildir. Grup ndirim Oranlar: Ayn Firmadan 3 - 6 Katlmda %5, Ayn Firmadan 6 ve =FCzeri katlmda oran uygulanmaktadr. Toplu katlm, sponsorluk ve erken kayt avantajlarndan faydalanmak i=E7in l=FCtfen araynz: Kayt Yaptrmak i=E7in l=FCtfen tklaynz: BOSPHORUS CONFERENCES http://www.bogaziciegitim.com.tr 0216 422 9595 - 0555 422 9595 Bu etkinlik duyurusu tarafnza =FCye veritabanmzda kaytl olduunuz i=E7in g=F6nderilmitir. Bu hizmetimizden yararlanmak istemiyorsanz listemizden ayrlmak i=E7in buraya http://bosphorushaber.com/index.php/lists/kf4673fqgv1ef/unsubscribe/rk0917ya18bf8/qj1810emsh911 tklaynz. Mailimizi d=FCzg=FCn g=F6r=FCnt=FCleyemiyorsanz l=FCtfen buraya http://bosphorushaber.com/index.php/campaigns/qj1810emsh911/web-version/rk0917ya18bf8 tklaynz.=20 Bo=C4=9Fazi=C3=A7i E=C4=9Fitim http://www.bogaziciegitim.com.tr=20 istanbul Turkey e= rli braname ve belge d?zenlenmesinde p?f noktalar - Sal Ve G?venli= i Uygulamalarnda Yaplan K?kl? Deiiklikler Ve Getirilen Yenilikle= r: - Yeni y?k?m= l?l?kler ve idari para cezalarndan yaplan deiiklikler - G=FCvenlii uzmanlarna iverenlerine kar verilen yeni yetki-sorumluluklar ile m=FCeyyideler - =E7ilere verilen y=FCk=FCml=FCl=FCk e sorumluluklar ile i s=F6zlemesinin feshini gerektiren i g=FCvenliine ilikin nedenler - Yap denetim kurulularna verilen yeni yetki-sorumluluklar ile m=FCeyyideler - Sal Ve G=FCvenlii Uygulamalarnda tutulmas gereken defter ve ge=E7erli belge d=FCzenlenmesi - 2015 yl Torba Kanunu ile izinlerinde yaplan deiiklikler ile dier=20 Kanunu ilemlerinde yaplan deiiklikler ve uygulamas - Sosyal g=FCvenlik ile i mevzuatna ilikin dier deiiklik ve yenilikler - =C7alma ve Sosyal G=FCvenlik Teftilerine Hazrlk Uygulamalar - Ge=E7erli ve mevzuata uygun iyeri kayt ve belgelerinin d=FCzenlenmesi ve dikkat edilecek hususlar - =C7alanlarn meslekleri ile =FCcretleri baznda yaplan denetimler - Sekt=F6r baznda yaplan denetimler - in y=FCr=FCt=FCm koullarna ilikin denetimler - kazas-meslek hastalklar ile i sal ve g=FCvenlii denetimleri - sal ve g=FCvenlii baznda kayt ve belgelerinin d=FCzenlenmesi ve dikkat edilecek hususlar - hbar-ikayet bazl denetimler - Tefti s=FCrecinin y=F6netimi ile dier denetimlere ilikin dier hususlar=20 T=FCm Katlmclara Zirve D=F6k=FCmantasyonu ve kongre kitlerinin yansra sa Karaka'n "SGK- KUR ve Mevzuatnda dari Para Cezalar le =C7=F6z=FCm Yollar" Kitab hediye edilecektir. Bu eserde bata SGK olmak =FCzere, 4857 sayl=20 Kanunu, KUR-sizlik Sigortas, Yabanclar Mevzuat ve Yeni y=FCr=FCrl=FCe konan=20 Sal ve G=FCvenlii Kanunu uygulamalarnda =F6ng=F6r=FClen y=FCk=FCml=FCl=FCkler, bu y=FCk=FCml=FCl=FCklere bal olarak uygulanan idari para cezalar ile ihtilaflarnn =E7=F6z=FCm yollar bir b=FCt=FCn olarak ele alnmtr.=20 Katlm i=E7in kayt formu doldurulmas ve banka makbuzu ile tarafmza g=F6nderilmesi gerekmektedir. Programlarmz kontenjanlarmzla snrldr. Kayt ilemlerini web sayfamzdan online yapabilirsiniz, Program katlm bedeli 950TL+ KDV'dir. =D6le yemekleri, ara ikramlar, zirve kitleri, eitim notlar ve t=FCm d=F6k=FCmantasyon =FCcrete dahildir. Grup ndirim Oranlar: Ayn Firmadan 3 - 6 Katlmda %5, Ayn Firmadan 6 ve =FCzeri katlmda oran uygulanmaktadr. Toplu katlm, sponsorluk ve erken kayt avantajlarndan faydalanmak i=E7in l=FCtfen araynz: Kayt Yaptrmak i=E7in l=FCtfen tklaynz: BOSPHORUS CONFERENCES http://www.bogaziciegitim.com.tr 0216 422 9595 - 0555 422 9595 Bu etkinlik duyurusu tarafnza =FCye veritabanmzda kaytl olduunuz i=E7in g=F6nderilmitir. Bu hizmetimizden yararlanmak istemiyorsanz listemizden ayrlmak i=E7in buraya http://bosphorushaber.com/index.php/lists/kf4673fqgv1ef/unsubscribe/rk0917ya18bf8/qj1810emsh911 tklaynz. Mailimizi d=FCzg=FCn g=F6r=FCnt=FCleyemiyorsanz l=FCtfen buraya http://bosphorushaber.com/index.php/campaigns/qj1810emsh911/web-version/rk0917ya18bf8 tklaynz.=20 Bo=C4=9Fazi=C3=A7i E=C4=9Fitim http://www.bogaziciegitim.com.tr=20 istanbul Turkey k= ler ve idari para cezalarndan yaplan deiiklikler - G?venlii uzmanl= arna iverenlerine kar verilen yeni yetki-sorumluluklar ile m?eyyidel= er - ?ilere verilen y?k= ?ml?l=FCk e sorumluluklar ile i s=F6zlemesinin feshini gerektiren i g=FCvenliine ilikin nedenler - Yap denetim kurulularna verilen yeni yetki-sorumluluklar ile m=FCeyyideler - Sal Ve G=FCvenlii Uygulamalarnda tutulmas gereken defter ve ge=E7erli belge d=FCzenlenmesi - 2015 yl Torba Kanunu ile izinlerinde yaplan deiiklikler ile dier=20 Kanunu ilemlerinde yaplan deiiklikler ve uygulamas - Sosyal g=FCvenlik ile i mevzuatna ilikin dier deiiklik ve yenilikler - =C7alma ve Sosyal G=FCvenlik Teftilerine Hazrlk Uygulamalar - Ge=E7erli ve mevzuata uygun iyeri kayt ve belgelerinin d=FCzenlenmesi ve dikkat edilecek hususlar - =C7alanlarn meslekleri ile =FCcretleri baznda yaplan denetimler - Sekt=F6r baznda yaplan denetimler - in y=FCr=FCt=FCm koullarna ilikin denetimler - kazas-meslek hastalklar ile i sal ve g=FCvenlii denetimleri - sal ve g=FCvenlii baznda kayt ve belgelerinin d=FCzenlenmesi ve dikkat edilecek hususlar - hbar-ikayet bazl denetimler - Tefti s=FCrecinin y=F6netimi ile dier denetimlere ilikin dier hususlar=20 T=FCm Katlmclara Zirve D=F6k=FCmantasyonu ve kongre kitlerinin yansra sa Karaka'n "SGK- KUR ve Mevzuatnda dari Para Cezalar le =C7=F6z=FCm Yollar" Kitab hediye edilecektir. Bu eserde bata SGK olmak =FCzere, 4857 sayl=20 Kanunu, KUR-sizlik Sigortas, Yabanclar Mevzuat ve Yeni y=FCr=FCrl=FCe konan=20 Sal ve G=FCvenlii Kanunu uygulamalarnda =F6ng=F6r=FClen y=FCk=FCml=FCl=FCkler, bu y=FCk=FCml=FCl=FCklere bal olarak uygulanan idari para cezalar ile ihtilaflarnn =E7=F6z=FCm yollar bir b=FCt=FCn olarak ele alnmtr.=20 Katlm i=E7in kayt formu doldurulmas ve banka makbuzu ile tarafmza g=F6nderilmesi gerekmektedir. Programlarmz kontenjanlarmzla snrldr. Kayt ilemlerini web sayfamzdan online yapabilirsiniz, Program katlm bedeli 950TL+ KDV'dir. =D6le yemekleri, ara ikramlar, zirve kitleri, eitim notlar ve t=FCm d=F6k=FCmantasyon =FCcrete dahildir. Grup ndirim Oranlar: Ayn Firmadan 3 - 6 Katlmda %5, Ayn Firmadan 6 ve =FCzeri katlmda oran uygulanmaktadr. Toplu katlm, sponsorluk ve erken kayt avantajlarndan faydalanmak i=E7in l=FCtfen araynz: Kayt Yaptrmak i=E7in l=FCtfen tklaynz: BOSPHORUS CONFERENCES http://www.bogaziciegitim.com.tr 0216 422 9595 - 0555 422 9595 Bu etkinlik duyurusu tarafnza =FCye veritabanmzda kaytl olduunuz i=E7in g=F6nderilmitir. Bu hizmetimizden yararlanmak istemiyorsanz listemizden ayrlmak i=E7in buraya http://bosphorushaber.com/index.php/lists/kf4673fqgv1ef/unsubscribe/rk0917ya18bf8/qj1810emsh911 tklaynz. Mailimizi d=FCzg=FCn g=F6r=FCnt=FCleyemiyorsanz l=FCtfen buraya http://bosphorushaber.com/index.php/campaigns/qj1810emsh911/web-version/rk0917ya18bf8 tklaynz.=20 Bo=C4=9Fazi=C3=A7i E=C4=9Fitim http://www.bogaziciegitim.com.tr=20 istanbul Turkey l= ?k e sorumluluklar ile i s?zlemesinin feshini gerektiren i g?venliin= e ilikin nedenler - Yap denetim kurulularna verilen yeni yetki-soru= mluluklar il= e m?eyyideler - Sal Ve G=FCvenlii Uygulamalarnda tutulmas gereken defter ve ge=E7erli belge d=FCzenlenmesi - 2015 yl Torba Kanunu ile izinlerinde yaplan deiiklikler ile dier=20 Kanunu ilemlerinde yaplan deiiklikler ve uygulamas - Sosyal g=FCvenlik ile i mevzuatna ilikin dier deiiklik ve yenilikler - =C7alma ve Sosyal G=FCvenlik Teftilerine Hazrlk Uygulamalar - Ge=E7erli ve mevzuata uygun iyeri kayt ve belgelerinin d=FCzenlenmesi ve dikkat edilecek hususlar - =C7alanlarn meslekleri ile =FCcretleri baznda yaplan denetimler - Sekt=F6r baznda yaplan denetimler - in y=FCr=FCt=FCm koullarna ilikin denetimler - kazas-meslek hastalklar ile i sal ve g=FCvenlii denetimleri - sal ve g=FCvenlii baznda kayt ve belgelerinin d=FCzenlenmesi ve dikkat edilecek hususlar - hbar-ikayet bazl denetimler - Tefti s=FCrecinin y=F6netimi ile dier denetimlere ilikin dier hususlar=20 T=FCm Katlmclara Zirve D=F6k=FCmantasyonu ve kongre kitlerinin yansra sa Karaka'n "SGK- KUR ve Mevzuatnda dari Para Cezalar le =C7=F6z=FCm Yollar" Kitab hediye edilecektir. Bu eserde bata SGK olmak =FCzere, 4857 sayl=20 Kanunu, KUR-sizlik Sigortas, Yabanclar Mevzuat ve Yeni y=FCr=FCrl=FCe konan=20 Sal ve G=FCvenlii Kanunu uygulamalarnda =F6ng=F6r=FClen y=FCk=FCml=FCl=FCkler, bu y=FCk=FCml=FCl=FCklere bal olarak uygulanan idari para cezalar ile ihtilaflarnn =E7=F6z=FCm yollar bir b=FCt=FCn olarak ele alnmtr.=20 Katlm i=E7in kayt formu doldurulmas ve banka makbuzu ile tarafmza g=F6nderilmesi gerekmektedir. Programlarmz kontenjanlarmzla snrldr. Kayt ilemlerini web sayfamzdan online yapabilirsiniz, Program katlm bedeli 950TL+ KDV'dir. =D6le yemekleri, ara ikramlar, zirve kitleri, eitim notlar ve t=FCm d=F6k=FCmantasyon =FCcrete dahildir. Grup ndirim Oranlar: Ayn Firmadan 3 - 6 Katlmda %5, Ayn Firmadan 6 ve =FCzeri katlmda oran uygulanmaktadr. Toplu katlm, sponsorluk ve erken kayt avantajlarndan faydalanmak i=E7in l=FCtfen araynz: Kayt Yaptrmak i=E7in l=FCtfen tklaynz: BOSPHORUS CONFERENCES http://www.bogaziciegitim.com.tr 0216 422 9595 - 0555 422 9595 Bu etkinlik duyurusu tarafnza =FCye veritabanmzda kaytl olduunuz i=E7in g=F6nderilmitir. Bu hizmetimizden yararlanmak istemiyorsanz listemizden ayrlmak i=E7in buraya http://bosphorushaber.com/index.php/lists/kf4673fqgv1ef/unsubscribe/rk0917ya18bf8/qj1810emsh911 tklaynz. Mailimizi d=FCzg=FCn g=F6r=FCnt=FCleyemiyorsanz l=FCtfen buraya http://bosphorushaber.com/index.php/campaigns/qj1810emsh911/web-version/rk0917ya18bf8 tklaynz.=20 Bo=C4=9Fazi=C3=A7i E=C4=9Fitim http://www.bogaziciegitim.com.tr=20 istanbul Turkey e= yyideler - Sal Ve G?venlii Uygulamalarnda tutulmas gereken defter = ve ge?erli belge d?zenlenmesi - 2015 yl Torba Kanunu ile izinle= rinde yaplan deiiklikler ile dier=20 Kanunu ilemlerinde yaplan deiikli= kler ve uygulamas - Sosyal g?venlik ile i mevzuatna ilikin dier dei= iklik ve yenilikler - ?alma ve Sosya= l G?venlik Teftilerine Hazrlk Uygulamalar - Ge=E7erli ve mevzuata uygun iyeri kayt ve belgelerinin d=FCzenlenmesi ve dikkat edilecek hususlar - =C7alanlarn meslekleri ile =FCcretleri baznda yaplan denetimler - Sekt=F6r baznda yaplan denetimler - in y=FCr=FCt=FCm koullarna ilikin denetimler - kazas-meslek hastalklar ile i sal ve g=FCvenlii denetimleri - sal ve g=FCvenlii baznda kayt ve belgelerinin d=FCzenlenmesi ve dikkat edilecek hususlar - hbar-ikayet bazl denetimler - Tefti s=FCrecinin y=F6netimi ile dier denetimlere ilikin dier hususlar=20 T=FCm Katlmclara Zirve D=F6k=FCmantasyonu ve kongre kitlerinin yansra sa Karaka'n "SGK- KUR ve Mevzuatnda dari Para Cezalar le =C7=F6z=FCm Yollar" Kitab hediye edilecektir. Bu eserde bata SGK olmak =FCzere, 4857 sayl=20 Kanunu, KUR-sizlik Sigortas, Yabanclar Mevzuat ve Yeni y=FCr=FCrl=FCe konan=20 Sal ve G=FCvenlii Kanunu uygulamalarnda =F6ng=F6r=FClen y=FCk=FCml=FCl=FCkler, bu y=FCk=FCml=FCl=FCklere bal olarak uygulanan idari para cezalar ile ihtilaflarnn =E7=F6z=FCm yollar bir b=FCt=FCn olarak ele alnmtr.=20 Katlm i=E7in kayt formu doldurulmas ve banka makbuzu ile tarafmza g=F6nderilmesi gerekmektedir. Programlarmz kontenjanlarmzla snrldr. Kayt ilemlerini web sayfamzdan online yapabilirsiniz, Program katlm bedeli 950TL+ KDV'dir. =D6le yemekleri, ara ikramlar, zirve kitleri, eitim notlar ve t=FCm d=F6k=FCmantasyon =FCcrete dahildir. Grup ndirim Oranlar: Ayn Firmadan 3 - 6 Katlmda %5, Ayn Firmadan 6 ve =FCzeri katlmda oran uygulanmaktadr. Toplu katlm, sponsorluk ve erken kayt avantajlarndan faydalanmak i=E7in l=FCtfen araynz: Kayt Yaptrmak i=E7in l=FCtfen tklaynz: BOSPHORUS CONFERENCES http://www.bogaziciegitim.com.tr 0216 422 9595 - 0555 422 9595 Bu etkinlik duyurusu tarafnza =FCye veritabanmzda kaytl olduunuz i=E7in g=F6nderilmitir. Bu hizmetimizden yararlanmak istemiyorsanz listemizden ayrlmak i=E7in buraya http://bosphorushaber.com/index.php/lists/kf4673fqgv1ef/unsubscribe/rk0917ya18bf8/qj1810emsh911 tklaynz. Mailimizi d=FCzg=FCn g=F6r=FCnt=FCleyemiyorsanz l=FCtfen buraya http://bosphorushaber.com/index.php/campaigns/qj1810emsh911/web-version/rk0917ya18bf8 tklaynz.=20 Bo=C4=9Fazi=C3=A7i E=C4=9Fitim http://www.bogaziciegitim.com.tr=20 istanbul Turkey v= enlik Teftilerine Hazrlk Uygulamalar - Ge?erli ve mevzuata uygun iy= eri kayt ve belgelerinin d?zenlenmesi ve dikkat edilecek hususla= r - ?alanlarn meslekleri ile ?cretleri baznda yaplan denetimler= - Sekt?r baznda yaplan denetimler - in y?r?t?m koullarna iliki= n denetimler - kazas-meslek hastalklar ile i sal v= e g?venlii denetimleri - sal ve g=FCvenlii baznda kayt ve belgelerinin d=FCzenlenmesi ve dikkat edilecek hususlar - hbar-ikayet bazl denetimler - Tefti s=FCrecinin y=F6netimi ile dier denetimlere ilikin dier hususlar=20 T=FCm Katlmclara Zirve D=F6k=FCmantasyonu ve kongre kitlerinin yansra sa Karaka'n "SGK- KUR ve Mevzuatnda dari Para Cezalar le =C7=F6z=FCm Yollar" Kitab hediye edilecektir. Bu eserde bata SGK olmak =FCzere, 4857 sayl=20 Kanunu, KUR-sizlik Sigortas, Yabanclar Mevzuat ve Yeni y=FCr=FCrl=FCe konan=20 Sal ve G=FCvenlii Kanunu uygulamalarnda =F6ng=F6r=FClen y=FCk=FCml=FCl=FCkler, bu y=FCk=FCml=FCl=FCklere bal olarak uygulanan idari para cezalar ile ihtilaflarnn =E7=F6z=FCm yollar bir b=FCt=FCn olarak ele alnmtr.=20 Katlm i=E7in kayt formu doldurulmas ve banka makbuzu ile tarafmza g=F6nderilmesi gerekmektedir. Programlarmz kontenjanlarmzla snrldr. Kayt ilemlerini web sayfamzdan online yapabilirsiniz, Program katlm bedeli 950TL+ KDV'dir. =D6le yemekleri, ara ikramlar, zirve kitleri, eitim notlar ve t=FCm d=F6k=FCmantasyon =FCcrete dahildir. Grup ndirim Oranlar: Ayn Firmadan 3 - 6 Katlmda %5, Ayn Firmadan 6 ve =FCzeri katlmda oran uygulanmaktadr. Toplu katlm, sponsorluk ve erken kayt avantajlarndan faydalanmak i=E7in l=FCtfen araynz: Kayt Yaptrmak i=E7in l=FCtfen tklaynz: BOSPHORUS CONFERENCES http://www.bogaziciegitim.com.tr 0216 422 9595 - 0555 422 9595 Bu etkinlik duyurusu tarafnza =FCye veritabanmzda kaytl olduunuz i=E7in g=F6nderilmitir. Bu hizmetimizden yararlanmak istemiyorsanz listemizden ayrlmak i=E7in buraya http://bosphorushaber.com/index.php/lists/kf4673fqgv1ef/unsubscribe/rk0917ya18bf8/qj1810emsh911 tklaynz. Mailimizi d=FCzg=FCn g=F6r=FCnt=FCleyemiyorsanz l=FCtfen buraya http://bosphorushaber.com/index.php/campaigns/qj1810emsh911/web-version/rk0917ya18bf8 tklaynz.=20 Bo=C4=9Fazi=C3=A7i E=C4=9Fitim http://www.bogaziciegitim.com.tr=20 istanbul Turkey v= enlii denetimleri - sal ve g?venlii baznda kayt ve belgelerini= n d?zenlenmesi ve dikkat edilecek hususlar - hbar-ikayet bazl denetimler - Tefti s=FCrecinin y=F6netimi ile dier denetimlere ilikin dier hususlar=20 T=FCm Katlmclara Zirve D=F6k=FCmantasyonu ve kongre kitlerinin yansra sa Karaka'n "SGK- KUR ve Mevzuatnda dari Para Cezalar le =C7=F6z=FCm Yollar" Kitab hediye edilecektir. Bu eserde bata SGK olmak =FCzere, 4857 sayl=20 Kanunu, KUR-sizlik Sigortas, Yabanclar Mevzuat ve Yeni y=FCr=FCrl=FCe konan=20 Sal ve G=FCvenlii Kanunu uygulamalarnda =F6ng=F6r=FClen y=FCk=FCml=FCl=FCkler, bu y=FCk=FCml=FCl=FCklere bal olarak uygulanan idari para cezalar ile ihtilaflarnn =E7=F6z=FCm yollar bir b=FCt=FCn olarak ele alnmtr.=20 Katlm i=E7in kayt formu doldurulmas ve banka makbuzu ile tarafmza g=F6nderilmesi gerekmektedir. Programlarmz kontenjanlarmzla snrldr. Kayt ilemlerini web sayfamzdan online yapabilirsiniz, Program katlm bedeli 950TL+ KDV'dir. =D6le yemekleri, ara ikramlar, zirve kitleri, eitim notlar ve t=FCm d=F6k=FCmantasyon =FCcrete dahildir. Grup ndirim Oranlar: Ayn Firmadan 3 - 6 Katlmda %5, Ayn Firmadan 6 ve =FCzeri katlmda oran uygulanmaktadr. Toplu katlm, sponsorluk ve erken kayt avantajlarndan faydalanmak i=E7in l=FCtfen araynz: Kayt Yaptrmak i=E7in l=FCtfen tklaynz: BOSPHORUS CONFERENCES http://www.bogaziciegitim.com.tr 0216 422 9595 - 0555 422 9595 Bu etkinlik duyurusu tarafnza =FCye veritabanmzda kaytl olduunuz i=E7in g=F6nderilmitir. Bu hizmetimizden yararlanmak istemiyorsanz listemizden ayrlmak i=E7in buraya http://bosphorushaber.com/index.php/lists/kf4673fqgv1ef/unsubscribe/rk0917ya18bf8/qj1810emsh911 tklaynz. Mailimizi d=FCzg=FCn g=F6r=FCnt=FCleyemiyorsanz l=FCtfen buraya http://bosphorushaber.com/index.php/campaigns/qj1810emsh911/web-version/rk0917ya18bf8 tklaynz.=20 Bo=C4=9Fazi=C3=A7i E=C4=9Fitim http://www.bogaziciegitim.com.tr=20 istanbul Turkey z= enlenmesi ve dikkat edilecek hususlar - hbar-ikayet bazl denetim= ler - Tefti s?recini= n y?netimi ile dier denetimlere ilikin dier hususlar=20 T=FCm Katlmclara Zirve D=F6k=FCmantasyonu ve kongre kitlerinin yansra sa Karaka'n "SGK- KUR ve Mevzuatnda dari Para Cezalar le =C7=F6z=FCm Yollar" Kitab hediye edilecektir. Bu eserde bata SGK olmak =FCzere, 4857 sayl=20 Kanunu, KUR-sizlik Sigortas, Yabanclar Mevzuat ve Yeni y=FCr=FCrl=FCe konan=20 Sal ve G=FCvenlii Kanunu uygulamalarnda =F6ng=F6r=FClen y=FCk=FCml=FCl=FCkler, bu y=FCk=FCml=FCl=FCklere bal olarak uygulanan idari para cezalar ile ihtilaflarnn =E7=F6z=FCm yollar bir b=FCt=FCn olarak ele alnmtr.=20 Katlm i=E7in kayt formu doldurulmas ve banka makbuzu ile tarafmza g=F6nderilmesi gerekmektedir. Programlarmz kontenjanlarmzla snrldr. Kayt ilemlerini web sayfamzdan online yapabilirsiniz, Program katlm bedeli 950TL+ KDV'dir. =D6le yemekleri, ara ikramlar, zirve kitleri, eitim notlar ve t=FCm d=F6k=FCmantasyon =FCcrete dahildir. Grup ndirim Oranlar: Ayn Firmadan 3 - 6 Katlmda %5, Ayn Firmadan 6 ve =FCzeri katlmda oran uygulanmaktadr. Toplu katlm, sponsorluk ve erken kayt avantajlarndan faydalanmak i=E7in l=FCtfen araynz: Kayt Yaptrmak i=E7in l=FCtfen tklaynz: BOSPHORUS CONFERENCES http://www.bogaziciegitim.com.tr 0216 422 9595 - 0555 422 9595 Bu etkinlik duyurusu tarafnza =FCye veritabanmzda kaytl olduunuz i=E7in g=F6nderilmitir. Bu hizmetimizden yararlanmak istemiyorsanz listemizden ayrlmak i=E7in buraya http://bosphorushaber.com/index.php/lists/kf4673fqgv1ef/unsubscribe/rk0917ya18bf8/qj1810emsh911 tklaynz. Mailimizi d=FCzg=FCn g=F6r=FCnt=FCleyemiyorsanz l=FCtfen buraya http://bosphorushaber.com/index.php/campaigns/qj1810emsh911/web-version/rk0917ya18bf8 tklaynz.=20 Bo=C4=9Fazi=C3=A7i E=C4=9Fitim http://www.bogaziciegitim.com.tr=20 istanbul Turkey n= etimi ile dier denetimlere ilikin dier hususlar = T?m Katlmclara Zirve D=F6k=FCmantasyonu ve kongre kitlerinin yansra sa Karaka'n "SGK- KUR ve Mevzuatnda dari Para Cezalar le =C7=F6z=FCm Yollar" Kitab hediye edilecektir. Bu eserde bata SGK olmak =FCzere, 4857 sayl=20 Kanunu, KUR-sizlik Sigortas, Yabanclar Mevzuat ve Yeni y=FCr=FCrl=FCe konan=20 Sal ve G=FCvenlii Kanunu uygulamalarnda =F6ng=F6r=FClen y=FCk=FCml=FCl=FCkler, bu y=FCk=FCml=FCl=FCklere bal olarak uygulanan idari para cezalar ile ihtilaflarnn =E7=F6z=FCm yollar bir b=FCt=FCn olarak ele alnmtr.=20 Katlm i=E7in kayt formu doldurulmas ve banka makbuzu ile tarafmza g=F6nderilmesi gerekmektedir. Programlarmz kontenjanlarmzla snrldr. Kayt ilemlerini web sayfamzdan online yapabilirsiniz, Program katlm bedeli 950TL+ KDV'dir. =D6le yemekleri, ara ikramlar, zirve kitleri, eitim notlar ve t=FCm d=F6k=FCmantasyon =FCcrete dahildir. Grup ndirim Oranlar: Ayn Firmadan 3 - 6 Katlmda %5, Ayn Firmadan 6 ve =FCzeri katlmda oran uygulanmaktadr. Toplu katlm, sponsorluk ve erken kayt avantajlarndan faydalanmak i=E7in l=FCtfen araynz: Kayt Yaptrmak i=E7in l=FCtfen tklaynz: BOSPHORUS CONFERENCES http://www.bogaziciegitim.com.tr 0216 422 9595 - 0555 422 9595 Bu etkinlik duyurusu tarafnza =FCye veritabanmzda kaytl olduunuz i=E7in g=F6nderilmitir. Bu hizmetimizden yararlanmak istemiyorsanz listemizden ayrlmak i=E7in buraya http://bosphorushaber.com/index.php/lists/kf4673fqgv1ef/unsubscribe/rk0917ya18bf8/qj1810emsh911 tklaynz. Mailimizi d=FCzg=FCn g=F6r=FCnt=FCleyemiyorsanz l=FCtfen buraya http://bosphorushaber.com/index.php/campaigns/qj1810emsh911/web-version/rk0917ya18bf8 tklaynz.=20 Bo=C4=9Fazi=C3=A7i E=C4=9Fitim http://www.bogaziciegitim.com.tr=20 istanbul Turkey m= Katlmclara Zirv= e D?k=FCmantasyonu ve kongre kitlerinin yansra sa Karaka'n "SGK- KUR ve Mevzuatnda dari Para Cezalar le =C7=F6z=FCm Yollar" Kitab hediye edilecektir. Bu eserde bata SGK olmak =FCzere, 4857 sayl=20 Kanunu, KUR-sizlik Sigortas, Yabanclar Mevzuat ve Yeni y=FCr=FCrl=FCe konan=20 Sal ve G=FCvenlii Kanunu uygulamalarnda =F6ng=F6r=FClen y=FCk=FCml=FCl=FCkler, bu y=FCk=FCml=FCl=FCklere bal olarak uygulanan idari para cezalar ile ihtilaflarnn =E7=F6z=FCm yollar bir b=FCt=FCn olarak ele alnmtr.=20 Katlm i=E7in kayt formu doldurulmas ve banka makbuzu ile tarafmza g=F6nderilmesi gerekmektedir. Programlarmz kontenjanlarmzla snrldr. Kayt ilemlerini web sayfamzdan online yapabilirsiniz, Program katlm bedeli 950TL+ KDV'dir. =D6le yemekleri, ara ikramlar, zirve kitleri, eitim notlar ve t=FCm d=F6k=FCmantasyon =FCcrete dahildir. Grup ndirim Oranlar: Ayn Firmadan 3 - 6 Katlmda %5, Ayn Firmadan 6 ve =FCzeri katlmda oran uygulanmaktadr. Toplu katlm, sponsorluk ve erken kayt avantajlarndan faydalanmak i=E7in l=FCtfen araynz: Kayt Yaptrmak i=E7in l=FCtfen tklaynz: BOSPHORUS CONFERENCES http://www.bogaziciegitim.com.tr 0216 422 9595 - 0555 422 9595 Bu etkinlik duyurusu tarafnza =FCye veritabanmzda kaytl olduunuz i=E7in g=F6nderilmitir. Bu hizmetimizden yararlanmak istemiyorsanz listemizden ayrlmak i=E7in buraya http://bosphorushaber.com/index.php/lists/kf4673fqgv1ef/unsubscribe/rk0917ya18bf8/qj1810emsh911 tklaynz. Mailimizi d=FCzg=FCn g=F6r=FCnt=FCleyemiyorsanz l=FCtfen buraya http://bosphorushaber.com/index.php/campaigns/qj1810emsh911/web-version/rk0917ya18bf8 tklaynz.=20 Bo=C4=9Fazi=C3=A7i E=C4=9Fitim http://www.bogaziciegitim.com.tr=20 istanbul Turkey k= ?mantasyonu ve kongre kitlerinin yansra sa Karaka'n "SGK- KUR ve Me= vzuatnda dari Para Cezalar l= e ?=F6z=FCm Yollar" Kitab hediye edilecektir. Bu eserde bata SGK olmak =FCzere, 4857 sayl=20 Kanunu, KUR-sizlik Sigortas, Yabanclar Mevzuat ve Yeni y=FCr=FCrl=FCe konan=20 Sal ve G=FCvenlii Kanunu uygulamalarnda =F6ng=F6r=FClen y=FCk=FCml=FCl=FCkler, bu y=FCk=FCml=FCl=FCklere bal olarak uygulanan idari para cezalar ile ihtilaflarnn =E7=F6z=FCm yollar bir b=FCt=FCn olarak ele alnmtr.=20 Katlm i=E7in kayt formu doldurulmas ve banka makbuzu ile tarafmza g=F6nderilmesi gerekmektedir. Programlarmz kontenjanlarmzla snrldr. Kayt ilemlerini web sayfamzdan online yapabilirsiniz, Program katlm bedeli 950TL+ KDV'dir. =D6le yemekleri, ara ikramlar, zirve kitleri, eitim notlar ve t=FCm d=F6k=FCmantasyon =FCcrete dahildir. Grup ndirim Oranlar: Ayn Firmadan 3 - 6 Katlmda %5, Ayn Firmadan 6 ve =FCzeri katlmda oran uygulanmaktadr. Toplu katlm, sponsorluk ve erken kayt avantajlarndan faydalanmak i=E7in l=FCtfen araynz: Kayt Yaptrmak i=E7in l=FCtfen tklaynz: BOSPHORUS CONFERENCES http://www.bogaziciegitim.com.tr 0216 422 9595 - 0555 422 9595 Bu etkinlik duyurusu tarafnza =FCye veritabanmzda kaytl olduunuz i=E7in g=F6nderilmitir. Bu hizmetimizden yararlanmak istemiyorsanz listemizden ayrlmak i=E7in buraya http://bosphorushaber.com/index.php/lists/kf4673fqgv1ef/unsubscribe/rk0917ya18bf8/qj1810emsh911 tklaynz. Mailimizi d=FCzg=FCn g=F6r=FCnt=FCleyemiyorsanz l=FCtfen buraya http://bosphorushaber.com/index.php/campaigns/qj1810emsh911/web-version/rk0917ya18bf8 tklaynz.=20 Bo=C4=9Fazi=C3=A7i E=C4=9Fitim http://www.bogaziciegitim.com.tr=20 istanbul Turkey ?z=FCm Yollar" Kitab hediye edilecektir. Bu eserde bata SGK olmak =FCzere, 4857 sayl=20 Kanunu, KUR-sizlik Sigortas, Yabanclar Mevzuat ve Yeni y=FCr=FCrl=FCe konan=20 Sal ve G=FCvenlii Kanunu uygulamalarnda =F6ng=F6r=FClen y=FCk=FCml=FCl=FCkler, bu y=FCk=FCml=FCl=FCklere bal olarak uygulanan idari para cezalar ile ihtilaflarnn =E7=F6z=FCm yollar bir b=FCt=FCn olarak ele alnmtr.=20 Katlm i=E7in kayt formu doldurulmas ve banka makbuzu ile tarafmza g=F6nderilmesi gerekmektedir. Programlarmz kontenjanlarmzla snrldr. Kayt ilemlerini web sayfamzdan online yapabilirsiniz, Program katlm bedeli 950TL+ KDV'dir. =D6le yemekleri, ara ikramlar, zirve kitleri, eitim notlar ve t=FCm d=F6k=FCmantasyon =FCcrete dahildir. Grup ndirim Oranlar: Ayn Firmadan 3 - 6 Katlmda %5, Ayn Firmadan 6 ve =FCzeri katlmda oran uygulanmaktadr. Toplu katlm, sponsorluk ve erken kayt avantajlarndan faydalanmak i=E7in l=FCtfen araynz: Kayt Yaptrmak i=E7in l=FCtfen tklaynz: BOSPHORUS CONFERENCES http://www.bogaziciegitim.com.tr 0216 422 9595 - 0555 422 9595 Bu etkinlik duyurusu tarafnza =FCye veritabanmzda kaytl olduunuz i=E7in g=F6nderilmitir. Bu hizmetimizden yararlanmak istemiyorsanz listemizden ayrlmak i=E7in buraya http://bosphorushaber.com/index.php/lists/kf4673fqgv1ef/unsubscribe/rk0917ya18bf8/qj1810emsh911 tklaynz. Mailimizi d=FCzg=FCn g=F6r=FCnt=FCleyemiyorsanz l=FCtfen buraya http://bosphorushaber.com/index.php/campaigns/qj1810emsh911/web-version/rk0917ya18bf8 tklaynz.=20 Bo=C4=9Fazi=C3=A7i E=C4=9Fitim http://www.bogaziciegitim.com.tr=20 istanbul Turkey z= ?m Yollar" Kitab hediye edilecektir. Bu eserde bata SGK olmak ?zere,= 4857 sayl=20 Kanunu, KUR-sizlik Sigortas, Yabanclar Mevzuat ve Yen= i y?r=FCrl=FCe konan=20 Sal ve G=FCvenlii Kanunu uygulamalarnda =F6ng=F6r=FClen y=FCk=FCml=FCl=FCkler, bu y=FCk=FCml=FCl=FCklere bal olarak uygulanan idari para cezalar ile ihtilaflarnn =E7=F6z=FCm yollar bir b=FCt=FCn olarak ele alnmtr.=20 Katlm i=E7in kayt formu doldurulmas ve banka makbuzu ile tarafmza g=F6nderilmesi gerekmektedir. Programlarmz kontenjanlarmzla snrldr. Kayt ilemlerini web sayfamzdan online yapabilirsiniz, Program katlm bedeli 950TL+ KDV'dir. =D6le yemekleri, ara ikramlar, zirve kitleri, eitim notlar ve t=FCm d=F6k=FCmantasyon =FCcrete dahildir. Grup ndirim Oranlar: Ayn Firmadan 3 - 6 Katlmda %5, Ayn Firmadan 6 ve =FCzeri katlmda oran uygulanmaktadr. Toplu katlm, sponsorluk ve erken kayt avantajlarndan faydalanmak i=E7in l=FCtfen araynz: Kayt Yaptrmak i=E7in l=FCtfen tklaynz: BOSPHORUS CONFERENCES http://www.bogaziciegitim.com.tr 0216 422 9595 - 0555 422 9595 Bu etkinlik duyurusu tarafnza =FCye veritabanmzda kaytl olduunuz i=E7in g=F6nderilmitir. Bu hizmetimizden yararlanmak istemiyorsanz listemizden ayrlmak i=E7in buraya http://bosphorushaber.com/index.php/lists/kf4673fqgv1ef/unsubscribe/rk0917ya18bf8/qj1810emsh911 tklaynz. Mailimizi d=FCzg=FCn g=F6r=FCnt=FCleyemiyorsanz l=FCtfen buraya http://bosphorushaber.com/index.php/campaigns/qj1810emsh911/web-version/rk0917ya18bf8 tklaynz.=20 Bo=C4=9Fazi=C3=A7i E=C4=9Fitim http://www.bogaziciegitim.com.tr=20 istanbul Turkey r= ?rl?e konan=20 Sal ve G=FCvenlii Kanunu uygulamalarnda =F6ng=F6r=FClen y=FCk=FCml=FCl=FCkler, bu y=FCk=FCml=FCl=FCklere bal olarak uygulanan idari para cezalar ile ihtilaflarnn =E7=F6z=FCm yollar bir b=FCt=FCn olarak ele alnmtr.=20 Katlm i=E7in kayt formu doldurulmas ve banka makbuzu ile tarafmza g=F6nderilmesi gerekmektedir. Programlarmz kontenjanlarmzla snrldr. Kayt ilemlerini web sayfamzdan online yapabilirsiniz, Program katlm bedeli 950TL+ KDV'dir. =D6le yemekleri, ara ikramlar, zirve kitleri, eitim notlar ve t=FCm d=F6k=FCmantasyon =FCcrete dahildir. Grup ndirim Oranlar: Ayn Firmadan 3 - 6 Katlmda %5, Ayn Firmadan 6 ve =FCzeri katlmda oran uygulanmaktadr. Toplu katlm, sponsorluk ve erken kayt avantajlarndan faydalanmak i=E7in l=FCtfen araynz: Kayt Yaptrmak i=E7in l=FCtfen tklaynz: BOSPHORUS CONFERENCES http://www.bogaziciegitim.com.tr 0216 422 9595 - 0555 422 9595 Bu etkinlik duyurusu tarafnza =FCye veritabanmzda kaytl olduunuz i=E7in g=F6nderilmitir. Bu hizmetimizden yararlanmak istemiyorsanz listemizden ayrlmak i=E7in buraya http://bosphorushaber.com/index.php/lists/kf4673fqgv1ef/unsubscribe/rk0917ya18bf8/qj1810emsh911 tklaynz. Mailimizi d=FCzg=FCn g=F6r=FCnt=FCleyemiyorsanz l=FCtfen buraya http://bosphorushaber.com/index.php/campaigns/qj1810emsh911/web-version/rk0917ya18bf8 tklaynz.=20 Bo=C4=9Fazi=C3=A7i E=C4=9Fitim http://www.bogaziciegitim.com.tr=20 istanbul Turkey e= konan=20 Sal v= e G?venlii Kanunu uygulamalarnda =F6ng=F6r=FClen y=FCk=FCml=FCl=FCkler, bu y=FCk=FCml=FCl=FCklere bal olarak uygulanan idari para cezalar ile ihtilaflarnn =E7=F6z=FCm yollar bir b=FCt=FCn olarak ele alnmtr.=20 Katlm i=E7in kayt formu doldurulmas ve banka makbuzu ile tarafmza g=F6nderilmesi gerekmektedir. Programlarmz kontenjanlarmzla snrldr. Kayt ilemlerini web sayfamzdan online yapabilirsiniz, Program katlm bedeli 950TL+ KDV'dir. =D6le yemekleri, ara ikramlar, zirve kitleri, eitim notlar ve t=FCm d=F6k=FCmantasyon =FCcrete dahildir. Grup ndirim Oranlar: Ayn Firmadan 3 - 6 Katlmda %5, Ayn Firmadan 6 ve =FCzeri katlmda oran uygulanmaktadr. Toplu katlm, sponsorluk ve erken kayt avantajlarndan faydalanmak i=E7in l=FCtfen araynz: Kayt Yaptrmak i=E7in l=FCtfen tklaynz: BOSPHORUS CONFERENCES http://www.bogaziciegitim.com.tr 0216 422 9595 - 0555 422 9595 Bu etkinlik duyurusu tarafnza =FCye veritabanmzda kaytl olduunuz i=E7in g=F6nderilmitir. Bu hizmetimizden yararlanmak istemiyorsanz listemizden ayrlmak i=E7in buraya http://bosphorushaber.com/index.php/lists/kf4673fqgv1ef/unsubscribe/rk0917ya18bf8/qj1810emsh911 tklaynz. Mailimizi d=FCzg=FCn g=F6r=FCnt=FCleyemiyorsanz l=FCtfen buraya http://bosphorushaber.com/index.php/campaigns/qj1810emsh911/web-version/rk0917ya18bf8 tklaynz.=20 Bo=C4=9Fazi=C3=A7i E=C4=9Fitim http://www.bogaziciegitim.com.tr=20 istanbul Turkey v= enlii Kanunu uygulamalarnda = ?ng?r=FClen y=FCk=FCml=FCl=FCkler, bu y=FCk=FCml=FCl=FCklere bal olarak uygulanan idari para cezalar ile ihtilaflarnn =E7=F6z=FCm yollar bir b=FCt=FCn olarak ele alnmtr.=20 Katlm i=E7in kayt formu doldurulmas ve banka makbuzu ile tarafmza g=F6nderilmesi gerekmektedir. Programlarmz kontenjanlarmzla snrldr. Kayt ilemlerini web sayfamzdan online yapabilirsiniz, Program katlm bedeli 950TL+ KDV'dir. =D6le yemekleri, ara ikramlar, zirve kitleri, eitim notlar ve t=FCm d=F6k=FCmantasyon =FCcrete dahildir. Grup ndirim Oranlar: Ayn Firmadan 3 - 6 Katlmda %5, Ayn Firmadan 6 ve =FCzeri katlmda oran uygulanmaktadr. Toplu katlm, sponsorluk ve erken kayt avantajlarndan faydalanmak i=E7in l=FCtfen araynz: Kayt Yaptrmak i=E7in l=FCtfen tklaynz: BOSPHORUS CONFERENCES http://www.bogaziciegitim.com.tr 0216 422 9595 - 0555 422 9595 Bu etkinlik duyurusu tarafnza =FCye veritabanmzda kaytl olduunuz i=E7in g=F6nderilmitir. Bu hizmetimizden yararlanmak istemiyorsanz listemizden ayrlmak i=E7in buraya http://bosphorushaber.com/index.php/lists/kf4673fqgv1ef/unsubscribe/rk0917ya18bf8/qj1810emsh911 tklaynz. Mailimizi d=FCzg=FCn g=F6r=FCnt=FCleyemiyorsanz l=FCtfen buraya http://bosphorushaber.com/index.php/campaigns/qj1810emsh911/web-version/rk0917ya18bf8 tklaynz.=20 Bo=C4=9Fazi=C3=A7i E=C4=9Fitim http://www.bogaziciegitim.com.tr=20 istanbul Turkey r= ?len y?k= ?ml?l=FCkler, bu y=FCk=FCml=FCl=FCklere bal olarak uygulanan idari para cezalar ile ihtilaflarnn =E7=F6z=FCm yollar bir b=FCt=FCn olarak ele alnmtr.=20 Katlm i=E7in kayt formu doldurulmas ve banka makbuzu ile tarafmza g=F6nderilmesi gerekmektedir. Programlarmz kontenjanlarmzla snrldr. Kayt ilemlerini web sayfamzdan online yapabilirsiniz, Program katlm bedeli 950TL+ KDV'dir. =D6le yemekleri, ara ikramlar, zirve kitleri, eitim notlar ve t=FCm d=F6k=FCmantasyon =FCcrete dahildir. Grup ndirim Oranlar: Ayn Firmadan 3 - 6 Katlmda %5, Ayn Firmadan 6 ve =FCzeri katlmda oran uygulanmaktadr. Toplu katlm, sponsorluk ve erken kayt avantajlarndan faydalanmak i=E7in l=FCtfen araynz: Kayt Yaptrmak i=E7in l=FCtfen tklaynz: BOSPHORUS CONFERENCES http://www.bogaziciegitim.com.tr 0216 422 9595 - 0555 422 9595 Bu etkinlik duyurusu tarafnza =FCye veritabanmzda kaytl olduunuz i=E7in g=F6nderilmitir. Bu hizmetimizden yararlanmak istemiyorsanz listemizden ayrlmak i=E7in buraya http://bosphorushaber.com/index.php/lists/kf4673fqgv1ef/unsubscribe/rk0917ya18bf8/qj1810emsh911 tklaynz. Mailimizi d=FCzg=FCn g=F6r=FCnt=FCleyemiyorsanz l=FCtfen buraya http://bosphorushaber.com/index.php/campaigns/qj1810emsh911/web-version/rk0917ya18bf8 tklaynz.=20 Bo=C4=9Fazi=C3=A7i E=C4=9Fitim http://www.bogaziciegitim.com.tr=20 istanbul Turkey l= ?kler, b= u y?k=FCml=FCl=FCklere bal olarak uygulanan idari para cezalar ile ihtilaflarnn =E7=F6z=FCm yollar bir b=FCt=FCn olarak ele alnmtr.=20 Katlm i=E7in kayt formu doldurulmas ve banka makbuzu ile tarafmza g=F6nderilmesi gerekmektedir. Programlarmz kontenjanlarmzla snrldr. Kayt ilemlerini web sayfamzdan online yapabilirsiniz, Program katlm bedeli 950TL+ KDV'dir. =D6le yemekleri, ara ikramlar, zirve kitleri, eitim notlar ve t=FCm d=F6k=FCmantasyon =FCcrete dahildir. Grup ndirim Oranlar: Ayn Firmadan 3 - 6 Katlmda %5, Ayn Firmadan 6 ve =FCzeri katlmda oran uygulanmaktadr. Toplu katlm, sponsorluk ve erken kayt avantajlarndan faydalanmak i=E7in l=FCtfen araynz: Kayt Yaptrmak i=E7in l=FCtfen tklaynz: BOSPHORUS CONFERENCES http://www.bogaziciegitim.com.tr 0216 422 9595 - 0555 422 9595 Bu etkinlik duyurusu tarafnza =FCye veritabanmzda kaytl olduunuz i=E7in g=F6nderilmitir. Bu hizmetimizden yararlanmak istemiyorsanz listemizden ayrlmak i=E7in buraya http://bosphorushaber.com/index.php/lists/kf4673fqgv1ef/unsubscribe/rk0917ya18bf8/qj1810emsh911 tklaynz. Mailimizi d=FCzg=FCn g=F6r=FCnt=FCleyemiyorsanz l=FCtfen buraya http://bosphorushaber.com/index.php/campaigns/qj1810emsh911/web-version/rk0917ya18bf8 tklaynz.=20 Bo=C4=9Fazi=C3=A7i E=C4=9Fitim http://www.bogaziciegitim.com.tr=20 istanbul Turkey k= ?ml?l=FCklere bal olarak uygulanan idari para cezalar ile ihtilaflarnn =E7=F6z=FCm yollar bir b=FCt=FCn olarak ele alnmtr.=20 Katlm i=E7in kayt formu doldurulmas ve banka makbuzu ile tarafmza g=F6nderilmesi gerekmektedir. Programlarmz kontenjanlarmzla snrldr. Kayt ilemlerini web sayfamzdan online yapabilirsiniz, Program katlm bedeli 950TL+ KDV'dir. =D6le yemekleri, ara ikramlar, zirve kitleri, eitim notlar ve t=FCm d=F6k=FCmantasyon =FCcrete dahildir. Grup ndirim Oranlar: Ayn Firmadan 3 - 6 Katlmda %5, Ayn Firmadan 6 ve =FCzeri katlmda oran uygulanmaktadr. Toplu katlm, sponsorluk ve erken kayt avantajlarndan faydalanmak i=E7in l=FCtfen araynz: Kayt Yaptrmak i=E7in l=FCtfen tklaynz: BOSPHORUS CONFERENCES http://www.bogaziciegitim.com.tr 0216 422 9595 - 0555 422 9595 Bu etkinlik duyurusu tarafnza =FCye veritabanmzda kaytl olduunuz i=E7in g=F6nderilmitir. Bu hizmetimizden yararlanmak istemiyorsanz listemizden ayrlmak i=E7in buraya http://bosphorushaber.com/index.php/lists/kf4673fqgv1ef/unsubscribe/rk0917ya18bf8/qj1810emsh911 tklaynz. Mailimizi d=FCzg=FCn g=F6r=FCnt=FCleyemiyorsanz l=FCtfen buraya http://bosphorushaber.com/index.php/campaigns/qj1810emsh911/web-version/rk0917ya18bf8 tklaynz.=20 Bo=C4=9Fazi=C3=A7i E=C4=9Fitim http://www.bogaziciegitim.com.tr=20 istanbul Turkey l= ?klere bal olarak uygulanan idari para cezalar ile ihtilaflarnn = ?=F6z=FCm yollar bir b=FCt=FCn olarak ele alnmtr.=20 Katlm i=E7in kayt formu doldurulmas ve banka makbuzu ile tarafmza g=F6nderilmesi gerekmektedir. Programlarmz kontenjanlarmzla snrldr. Kayt ilemlerini web sayfamzdan online yapabilirsiniz, Program katlm bedeli 950TL+ KDV'dir. =D6le yemekleri, ara ikramlar, zirve kitleri, eitim notlar ve t=FCm d=F6k=FCmantasyon =FCcrete dahildir. Grup ndirim Oranlar: Ayn Firmadan 3 - 6 Katlmda %5, Ayn Firmadan 6 ve =FCzeri katlmda oran uygulanmaktadr. Toplu katlm, sponsorluk ve erken kayt avantajlarndan faydalanmak i=E7in l=FCtfen araynz: Kayt Yaptrmak i=E7in l=FCtfen tklaynz: BOSPHORUS CONFERENCES http://www.bogaziciegitim.com.tr 0216 422 9595 - 0555 422 9595 Bu etkinlik duyurusu tarafnza =FCye veritabanmzda kaytl olduunuz i=E7in g=F6nderilmitir. Bu hizmetimizden yararlanmak istemiyorsanz listemizden ayrlmak i=E7in buraya http://bosphorushaber.com/index.php/lists/kf4673fqgv1ef/unsubscribe/rk0917ya18bf8/qj1810emsh911 tklaynz. Mailimizi d=FCzg=FCn g=F6r=FCnt=FCleyemiyorsanz l=FCtfen buraya http://bosphorushaber.com/index.php/campaigns/qj1810emsh911/web-version/rk0917ya18bf8 tklaynz.=20 Bo=C4=9Fazi=C3=A7i E=C4=9Fitim http://www.bogaziciegitim.com.tr=20 istanbul Turkey ?z?m yollar bir b=FCt=FCn olarak ele alnmtr.=20 Katlm i=E7in kayt formu doldurulmas ve banka makbuzu ile tarafmza g=F6nderilmesi gerekmektedir. Programlarmz kontenjanlarmzla snrldr. Kayt ilemlerini web sayfamzdan online yapabilirsiniz, Program katlm bedeli 950TL+ KDV'dir. =D6le yemekleri, ara ikramlar, zirve kitleri, eitim notlar ve t=FCm d=F6k=FCmantasyon =FCcrete dahildir. Grup ndirim Oranlar: Ayn Firmadan 3 - 6 Katlmda %5, Ayn Firmadan 6 ve =FCzeri katlmda oran uygulanmaktadr. Toplu katlm, sponsorluk ve erken kayt avantajlarndan faydalanmak i=E7in l=FCtfen araynz: Kayt Yaptrmak i=E7in l=FCtfen tklaynz: BOSPHORUS CONFERENCES http://www.bogaziciegitim.com.tr 0216 422 9595 - 0555 422 9595 Bu etkinlik duyurusu tarafnza =FCye veritabanmzda kaytl olduunuz i=E7in g=F6nderilmitir. Bu hizmetimizden yararlanmak istemiyorsanz listemizden ayrlmak i=E7in buraya http://bosphorushaber.com/index.php/lists/kf4673fqgv1ef/unsubscribe/rk0917ya18bf8/qj1810emsh911 tklaynz. Mailimizi d=FCzg=FCn g=F6r=FCnt=FCleyemiyorsanz l=FCtfen buraya http://bosphorushaber.com/index.php/campaigns/qj1810emsh911/web-version/rk0917ya18bf8 tklaynz.=20 Bo=C4=9Fazi=C3=A7i E=C4=9Fitim http://www.bogaziciegitim.com.tr=20 istanbul Turkey m= yollar bir = b?t?n olarak ele alnmtr.=20 Katlm i=E7in kayt formu doldurulmas ve banka makbuzu ile tarafmza g=F6nderilmesi gerekmektedir. Programlarmz kontenjanlarmzla snrldr. Kayt ilemlerini web sayfamzdan online yapabilirsiniz, Program katlm bedeli 950TL+ KDV'dir. =D6le yemekleri, ara ikramlar, zirve kitleri, eitim notlar ve t=FCm d=F6k=FCmantasyon =FCcrete dahildir. Grup ndirim Oranlar: Ayn Firmadan 3 - 6 Katlmda %5, Ayn Firmadan 6 ve =FCzeri katlmda oran uygulanmaktadr. Toplu katlm, sponsorluk ve erken kayt avantajlarndan faydalanmak i=E7in l=FCtfen araynz: Kayt Yaptrmak i=E7in l=FCtfen tklaynz: BOSPHORUS CONFERENCES http://www.bogaziciegitim.com.tr 0216 422 9595 - 0555 422 9595 Bu etkinlik duyurusu tarafnza =FCye veritabanmzda kaytl olduunuz i=E7in g=F6nderilmitir. Bu hizmetimizden yararlanmak istemiyorsanz listemizden ayrlmak i=E7in buraya http://bosphorushaber.com/index.php/lists/kf4673fqgv1ef/unsubscribe/rk0917ya18bf8/qj1810emsh911 tklaynz. Mailimizi d=FCzg=FCn g=F6r=FCnt=FCleyemiyorsanz l=FCtfen buraya http://bosphorushaber.com/index.php/campaigns/qj1810emsh911/web-version/rk0917ya18bf8 tklaynz.=20 Bo=C4=9Fazi=C3=A7i E=C4=9Fitim http://www.bogaziciegitim.com.tr=20 istanbul Turkey n= olarak ele alnmtr.=20 Katlm i?in kayt formu doldurulmas ve banka= makbuzu ile tarafmz= a g?nderilmesi gerekmektedir. Programlarmz kontenjanlarmzla snrldr. Kayt ilemlerini web sayfamzdan online yapabilirsiniz, Program katlm bedeli 950TL+ KDV'dir. =D6le yemekleri, ara ikramlar, zirve kitleri, eitim notlar ve t=FCm d=F6k=FCmantasyon =FCcrete dahildir. Grup ndirim Oranlar: Ayn Firmadan 3 - 6 Katlmda %5, Ayn Firmadan 6 ve =FCzeri katlmda oran uygulanmaktadr. Toplu katlm, sponsorluk ve erken kayt avantajlarndan faydalanmak i=E7in l=FCtfen araynz: Kayt Yaptrmak i=E7in l=FCtfen tklaynz: BOSPHORUS CONFERENCES http://www.bogaziciegitim.com.tr 0216 422 9595 - 0555 422 9595 Bu etkinlik duyurusu tarafnza =FCye veritabanmzda kaytl olduunuz i=E7in g=F6nderilmitir. Bu hizmetimizden yararlanmak istemiyorsanz listemizden ayrlmak i=E7in buraya http://bosphorushaber.com/index.php/lists/kf4673fqgv1ef/unsubscribe/rk0917ya18bf8/qj1810emsh911 tklaynz. Mailimizi d=FCzg=FCn g=F6r=FCnt=FCleyemiyorsanz l=FCtfen buraya http://bosphorushaber.com/index.php/campaigns/qj1810emsh911/web-version/rk0917ya18bf8 tklaynz.=20 Bo=C4=9Fazi=C3=A7i E=C4=9Fitim http://www.bogaziciegitim.com.tr=20 istanbul Turkey n= derilmesi gerekmektedir. Programlarmz kontenjanlarmzla snrldr. Kayt= ilemlerini web sayfamzdan online yapabilirsiniz, Program katlm bed= eli 950TL+ KDV'dir. ?le yemekleri, ara ikramlar, zirve kitleri, eiti= m notlar ve t?m = d?k?mantasyon =FCcrete dahildir. Grup ndirim Oranlar: Ayn Firmadan 3 - 6 Katlmda %5, Ayn Firmadan 6 ve =FCzeri katlmda oran uygulanmaktadr. Toplu katlm, sponsorluk ve erken kayt avantajlarndan faydalanmak i=E7in l=FCtfen araynz: Kayt Yaptrmak i=E7in l=FCtfen tklaynz: BOSPHORUS CONFERENCES http://www.bogaziciegitim.com.tr 0216 422 9595 - 0555 422 9595 Bu etkinlik duyurusu tarafnza =FCye veritabanmzda kaytl olduunuz i=E7in g=F6nderilmitir. Bu hizmetimizden yararlanmak istemiyorsanz listemizden ayrlmak i=E7in buraya http://bosphorushaber.com/index.php/lists/kf4673fqgv1ef/unsubscribe/rk0917ya18bf8/qj1810emsh911 tklaynz. Mailimizi d=FCzg=FCn g=F6r=FCnt=FCleyemiyorsanz l=FCtfen buraya http://bosphorushaber.com/index.php/campaigns/qj1810emsh911/web-version/rk0917ya18bf8 tklaynz.=20 Bo=C4=9Fazi=C3=A7i E=C4=9Fitim http://www.bogaziciegitim.com.tr=20 istanbul Turkey m= antasyon ?crete dahildir. Grup ndirim Oranlar: Ayn Firmadan 3 - 6 K= atlmda %5, Ayn Firmadan 6 ve ?zeri katlmda oran uygulanmaktadr. Topl= u katlm, sponsorluk ve erken kayt avantajlarndan faydalanmak i?i= n l?tfen araynz: Kayt Yaptrmak i=E7in l=FCtfen tklaynz: BOSPHORUS CONFERENCES http://www.bogaziciegitim.com.tr 0216 422 9595 - 0555 422 9595 Bu etkinlik duyurusu tarafnza =FCye veritabanmzda kaytl olduunuz i=E7in g=F6nderilmitir. Bu hizmetimizden yararlanmak istemiyorsanz listemizden ayrlmak i=E7in buraya http://bosphorushaber.com/index.php/lists/kf4673fqgv1ef/unsubscribe/rk0917ya18bf8/qj1810emsh911 tklaynz. Mailimizi d=FCzg=FCn g=F6r=FCnt=FCleyemiyorsanz l=FCtfen buraya http://bosphorushaber.com/index.php/campaigns/qj1810emsh911/web-version/rk0917ya18bf8 tklaynz.=20 Bo=C4=9Fazi=C3=A7i E=C4=9Fitim http://www.bogaziciegitim.com.tr=20 istanbul Turkey t= fen araynz: Kayt Yaptrmak i?i= n l?tfen tklaynz: BOSPHORUS CONFERENCES http://www.bogaziciegitim.com.tr 0216 422 9595 - 0555 422 9595 Bu etkinlik duyurusu tarafnza =FCye veritabanmzda kaytl olduunuz i=E7in g=F6nderilmitir. Bu hizmetimizden yararlanmak istemiyorsanz listemizden ayrlmak i=E7in buraya http://bosphorushaber.com/index.php/lists/kf4673fqgv1ef/unsubscribe/rk0917ya18bf8/qj1810emsh911 tklaynz. Mailimizi d=FCzg=FCn g=F6r=FCnt=FCleyemiyorsanz l=FCtfen buraya http://bosphorushaber.com/index.php/campaigns/qj1810emsh911/web-version/rk0917ya18bf8 tklaynz.=20 Bo=C4=9Fazi=C3=A7i E=C4=9Fitim http://www.bogaziciegitim.com.tr=20 istanbul Turkey t= fen tklaynz: BOSPHORUS CONFERENCES http://www.bogaziciegitim.com= .tr 0216 422 9595 - 0555 422 9595 Bu etkinlik duyurusu t= arafnza ?ye veritabanmzda kaytl olduunuz i?i= n g?nderilmitir. Bu hizmetimizden yararlanmak istemiyorsanz listemizden ayrlmak i=E7in buraya http://bosphorushaber.com/index.php/lists/kf4673fqgv1ef/unsubscribe/rk0917ya18bf8/qj1810emsh911 tklaynz. Mailimizi d=FCzg=FCn g=F6r=FCnt=FCleyemiyorsanz l=FCtfen buraya http://bosphorushaber.com/index.php/campaigns/qj1810emsh911/web-version/rk0917ya18bf8 tklaynz.=20 Bo=C4=9Fazi=C3=A7i E=C4=9Fitim http://www.bogaziciegitim.com.tr=20 istanbul Turkey n= derilmitir. Bu hizmetimizden yararlanmak istemiyorsanz listemizden a= yrlmak i?in buraya http://bosphorushaber.com/index.php/lists/kf46= 73fqgv1ef/unsubscribe/rk0917ya18bf8/qj1810emsh911 tklaynz. Mail= imiz= i d?zg=FCn g=F6r=FCnt=FCleyemiyorsanz l=FCtfen buraya http://bosphorushaber.com/index.php/campaigns/qj1810emsh911/web-version/rk0917ya18bf8 tklaynz.=20 Bo=C4=9Fazi=C3=A7i E=C4=9Fitim http://www.bogaziciegitim.com.tr=20 istanbul Turkey z= g?n = g?r?nt=FCleyemiyorsanz l=FCtfen buraya http://bosphorushaber.com/index.php/campaigns/qj1810emsh911/web-version/rk0917ya18bf8 tklaynz.=20 Bo=C4=9Fazi=C3=A7i E=C4=9Fitim http://www.bogaziciegitim.com.tr=20 istanbul Turkey n= t?leyemiyorsanz l?tfen buraya http://bosphorushaber.com/index.php/ca= mpaigns/qj1810emsh911/web-version/rk0917ya18bf8 tklaynz. = Bo=C4=9Fazi=C3=A7i E=C4=9Fitim http://www.bogaziciegitim.com.= tr=20 istanbul Turkey =20 --_=_swift_v4_1454398062_ae0e8a19e2aecb70765f3bd2dbd45f4e_=_ Content-Type: text/html; charset=utf-8 Content-Transfer-Encoding: 8bit


Çalışma Hayatında Güncel Gelişmelerle
Sosyal Güvenlik ve İş Hukuku Uygulamaları


2016 Yılı Torba Kanunlarla İş, SGK ve İSG’de Yapılacak Değişiklikler,
Asgari Ücret, Yabancı İşçi Çalıştırılması gibi Teşvik ve Devlet Destekleri,
Denetimlere Hazırlık, Güncel Yargı Kararları , İdari Para Cezaları,
Süreçte Potansiyel Sorunlar ve Pratik Çözüm Önerileri


27 Şubat 2016 / 09.00 – 17.00 / Istanbul Hilton - Harbiye

Konuşmacılar:
Prof. Dr. Nurşen CANİKLİOĞLU / Marmara Üniversitesi Hukuk Fakültesi Özel Hukuk Bölüm Başkanı
İsa KARAKAŞ / Sosyal Güvenlik ve İş Hukuku Başuzmanı/ 20 Yılı Aşkın ÇSGB/SGK Başmüfettişi
 

 

Oturum Konuları:

- 2016 Torba Kanunlarda Yapılan Değişiklikler,
- Asgari Ücret Teşvikleri
- Uygulama esasları- Teşvik nasıl hesaplanacak?
- Yeni yazılımlara ihtiyaç olacak mı?
- Asgari ücret artışı ücret politikalarını nasıl etkileyecek?
- Maliyet artışlarının kapatılması için alınabilecek önlemler-
- Artık işverenin daha lehine olan prim teşviklerini kullanmak bir çözüm olabilir m?
- Doğum Yapan İşçilere Part-time çalışma esasları
- Genel Sağlık Sigorta değişiklikleri
- İşçi-İşveren İhtilaflarının Çözümüne Yönelik Yapılacak Değişiklikler
- Yabancı Çalıştırmasında Yapılacak Kolaylıklar
- Geçici Koruma Sağlanan Yabancıların Çalışma İzinlerine Dair Yönetmelik neler getiriyor?
- Bu Yönetmelik hükümleri işveren için maliyet desteği sağlayacak mı?
- Aylık Prim ve Hizmet Belgelerinde sigortalının mesleği ile meslek kodunun bildirimi ilişkin yapılacak düzenlemeler ve denetim
- İş Güvenliği Uzmanları-İşyeri Hekimlerinin Hizmet Sürelerinde ve idari para cezalarında yürürlüğe girecek değişiklikler
- SGK İşlemlerinde İtiraz Ve Mahkeme Yolunda Yapılan Değişiklikler ve Uygulaması
- İş Kanunundaki İdari Para Cezaları
- İş Sağlığı ve Güvenliği Kanunundaki İdari Para Cezaları
- 6645 sayılı Kanunla yapılan değişiklikler
- İşyerinin az tehlikeli- tehlikeli ve çok tehlikeli oluşu idari para cezasını nasıl etkiliyor?
- Çalışan sayısının önemi nedir?
- Sosyal Sigortalar ve Genel Sağlık Sigortası Kanunda Öngörülen İdari Para Cezaları
- İdari Para cezalarından kurtulma yolları
- İş Kazası bildirimlerinde ve ücret tahakkuku ile SGK prim belgelerinde en çok yapılan hatalar ve uygulaması
- SGK Teşvik İşlemlerinde Yapılan Değişiklikler Ve Uygulaması, avantajlı teşviklerden geriye doğru faydalanılması
- İşe İade İle İlgili Değişiklikler Ve Uygulaması, İşe iade halinde yapılması gereken SGK uygulamaları
- Alt işveren (Taşeron)-Üst İşveren İlişkisinde Değişikler İle Bu İlişkiden Kaynaklanan Asıl İşverenin SGK-İŞ Kanunu İle İş Sağlığı Ve Güvenliği Bakımından Yükümlülük Ve Sorumlulukları İle Alt İşverenliğin Yönetimi, Muvazaa İle İlgili İtiraz Ve Mahkeme Yollarına İlişkin Değişiklikler
- Yargı kararları çerçevesinde iş Sözleşmesinin sonlandırılmasında en çok yapılan hatalar, geçerli savunma-ihtarname ve tutanak düzenlenmesi esasları
- Geçerli İbraname ve belge düzenlenmesinde püf noktalar
- İş Sağlığı Ve Güvenliği Uygulamalarında Yapılan Köklü Değişiklikler Ve Getirilen Yenilikler:
- Yeni yükümlülükler ve idari para cezalarından yapılan değişiklikler
- İş Güvenliği uzmanlarına işverenlerine karşı verilen yeni yetki-sorumluluklar ile müeyyideler
- İşçilere verilen yükümlülük e sorumluluklar ile iş sözleşmesinin feshini gerektiren iş güvenliğine ilişkin nedenler
- Yapı denetim kuruluşlarına verilen yeni yetki-sorumluluklar ile müeyyideler
- İş Sağlığı Ve Güvenliği Uygulamalarında tutulması gereken defter ve geçerli belge düzenlenmesi
- 2015 yılı Torba Kanunu ile izinlerinde yapılan değişiklikler ile diğer İş Kanunu işlemlerinde yapılan değişiklikler ve uygulaması
- Sosyal güvenlik ile iş mevzuatına ilişkin diğer değişiklik ve yenilikler
- Çalışma ve Sosyal Güvenlik Teftişlerine Hazırlık Uygulamaları
- Geçerli ve mevzuata uygun işyeri kayıt ve belgelerinin düzenlenmesi ve dikkat edilecek hususlar
- Çalışanların meslekleri ile ücretleri bazında yapılan denetimler
- Sektör bazında yapılan denetimler
- İşin yürütüm koşullarına ilişkin denetimler
- İş kazası-meslek hastalıkları ile iş sağlığı ve güvenliği denetimleri
- İş sağlığı ve güvenliği bazında kayıt ve belgelerinin düzenlenmesi ve dikkat edilecek hususlar
- İhbar-şikayet bazlı denetimler
- Teftiş sürecinin yönetimi ile diğer denetimlere ilişkin diğer hususlar



Tüm Katılımcılara Zirve Dökümantasyonu ve kongre kitlerinin yanısıra İsa Karakaş’ın “SGK- İŞKUR ve İŞ Mevzuatında İdari Para Cezaları İle Çözüm Yolları” Kitabı hediye edilecektir. Bu eserde başta SGK olmak üzere, 4857 sayılı İş Kanunu, İŞKUR-İşsizlik Sigortası, Yabancılar Mevzuatı ve Yeni yürürlüğe konan İş Sağlığı ve Güvenliği Kanunu uygulamalarında öngörülen yükümlülükler, bu yükümlülüklere bağlı olarak uygulanan idari para cezaları ile ihtilaflarının çözüm yolları bir bütün olarak ele alınmıştır.


Katılım için kayıt formu doldurulması ve banka makbuzu ile tarafımıza gönderilmesi gerekmektedir. Programlarımız kontenjanlarımızla sınırlıdır.
Kayıt işlemlerini web sayfamızdan online yapabilirsiniz,
Program katılım bedeli 950TL+ KDV’dir. Öğle yemekleri, ara ikramlar, zirve kitleri, eğitim notları ve tüm dökümantasyon ücrete dahildir.
Grup İndirim Oranları: Aynı Firmadan 3 – 6 Katılımda %5, Aynı Firmadan 6 ve üzeri katılımda oran uygulanmaktadır. Toplu katılım, sponsorluk ve erken kayıt avantajlarından faydalanmak için lütfen arayınız:


Kayıt Yaptırmak için lütfen tıklayınız:
BOSPHORUS CONFERENCES
0
216 422 9595 - 0555 422 9595

 


Bu etkinlik duyurusu tarafınıza üye veritabanımızda kayıtlı olduğunuz için gönderilmiştir.
Bu hizmetimizden yararlanmak istemiyorsanız listemizden ayrılmak için
buraya tıklayınız.
Mailimizi düzgün görüntüleyemiyorsanız lütfen
buraya tıklayınız.

 

 

 

Boğaziçi Eğitim http://www.bogaziciegitim.com.tr
istanbul Turkey

 

 

 

--_=_swift_v4_1454398062_ae0e8a19e2aecb70765f3bd2dbd45f4e_=_-- From hch@lst.de Tue Feb 2 05:17:51 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=ham version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay3.corp.sgi.com [198.149.34.15]) by oss.sgi.com (Postfix) with ESMTP id 81AEA7CB1 for ; Tue, 2 Feb 2016 05:17:51 -0600 (CST) Received: from cuda.sgi.com (cuda2.sgi.com [192.48.176.25]) by relay3.corp.sgi.com (Postfix) with ESMTP id 1FB19AC002 for ; Tue, 2 Feb 2016 03:17:47 -0800 (PST) X-ASG-Debug-ID: 1454411861-04cbb026ff21ae10001-NocioJ Received: from newverein.lst.de (verein.lst.de [213.95.11.211]) by cuda.sgi.com with ESMTP id H0rnzNFRzUOIDLr5 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO) for ; Tue, 02 Feb 2016 03:17:42 -0800 (PST) X-Barracuda-Envelope-From: hch@lst.de X-Barracuda-Apparent-Source-IP: 213.95.11.211 Received: by newverein.lst.de (Postfix, from userid 2407) id 04B8F692CD; Tue, 2 Feb 2016 12:17:41 +0100 (CET) Date: Tue, 2 Feb 2016 12:17:40 +0100 From: Christoph Hellwig To: "Darrick J. Wong" Cc: Dave Chinner , Brian Foster , Christoph Hellwig , xfs@oss.sgi.com, Christoph Hellwig Subject: Re: stop using ioends for direct write completions Message-ID: <20160202111740.GA28777@lst.de> X-ASG-Orig-Subj: Re: stop using ioends for direct write completions References: <1452766237-2314-1-git-send-email-hch@lst.de> <20160128131656.GB14876@infradead.org> <20160129141232.GA43184@bfoster.bfoster> <20160201215407.GI20038@birch.djwong.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20160201215407.GI20038@birch.djwong.org> User-Agent: Mutt/1.5.17 (2007-11-01) X-Barracuda-Connect: verein.lst.de[213.95.11.211] X-Barracuda-Start-Time: 1454411862 X-Barracuda-Encrypted: ECDHE-RSA-AES256-GCM-SHA384 X-Barracuda-URL: https://192.48.176.25:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-BRTS-Status: 1 X-Barracuda-Spam-Score: 0.00 X-Barracuda-Spam-Status: No, SCORE=0.00 using per-user scores of TAG_LEVEL=1000.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.7 tests=BSF_SC0_MISMATCH_TO X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.3.26672 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 0.00 BSF_SC0_MISMATCH_TO Envelope rcpt doesn't match header On Mon, Feb 01, 2016 at 01:54:07PM -0800, Darrick J. Wong wrote: > Also: I've noticed that if I write 8MB file to a file backed by a failing > device, xfs_end_io_direct_write() gets called with size == 8MB even if the > writes failed. If the write was to an unwritten extent, the extent will be > converted to a regular extent even though the blocks contain old file contents > and other garbage, which can subsequently be read off the disk. > > For CoW I'd only want to remap the blocks if the write totally succeeds. If a > disk error happens, the EIO code gets passed back to userspace, and it seems > logical to me that the file contents should remain unchanged. > > To that end, I'm changing dio_iodone_t to pass an error code, and I think I > want to change XFS to avoid doing unwritten extent conversions when the write > fails. Does that make sense? I have some of these patches prepared already, I'm just too busy keeping up with all your changes. I'll rebase and post this ASAP! From hch@lst.de Tue Feb 2 05:20:54 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=ham version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay1.corp.sgi.com [137.38.102.111]) by oss.sgi.com (Postfix) with ESMTP id 0E2A27CB1 for ; Tue, 2 Feb 2016 05:20:54 -0600 (CST) Received: from cuda.sgi.com (cuda1.sgi.com [192.48.157.11]) by relay1.corp.sgi.com (Postfix) with ESMTP id E41398F8033 for ; Tue, 2 Feb 2016 03:20:50 -0800 (PST) X-ASG-Debug-ID: 1454412047-04bdf04d6b215a10001-NocioJ Received: from newverein.lst.de (verein.lst.de [213.95.11.211]) by cuda.sgi.com with ESMTP id KFqg2Q8DHIDh75h8 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO) for ; Tue, 02 Feb 2016 03:20:48 -0800 (PST) X-Barracuda-Envelope-From: hch@lst.de X-Barracuda-Apparent-Source-IP: 213.95.11.211 Received: by newverein.lst.de (Postfix, from userid 2407) id 4983A692CC; Tue, 2 Feb 2016 12:20:46 +0100 (CET) Date: Tue, 2 Feb 2016 12:20:46 +0100 From: Christoph Hellwig To: Brian Foster Cc: Christoph Hellwig , Christoph Hellwig , darrick.wong@oracle.com, xfs@oss.sgi.com Subject: Re: stop using ioends for direct write completions Message-ID: <20160202112046.GB28777@lst.de> X-ASG-Orig-Subj: Re: stop using ioends for direct write completions References: <1452766237-2314-1-git-send-email-hch@lst.de> <20160128131656.GB14876@infradead.org> <20160129141232.GA43184@bfoster.bfoster> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20160129141232.GA43184@bfoster.bfoster> User-Agent: Mutt/1.5.17 (2007-11-01) X-Barracuda-Connect: verein.lst.de[213.95.11.211] X-Barracuda-Start-Time: 1454412048 X-Barracuda-Encrypted: ECDHE-RSA-AES256-GCM-SHA384 X-Barracuda-URL: https://192.48.157.11:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-BRTS-Status: 1 X-Barracuda-Spam-Score: 0.00 X-Barracuda-Spam-Status: No, SCORE=0.00 using per-user scores of TAG_LEVEL=1000.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.7 tests=BSF_SC0_MISMATCH_TO X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.3.26673 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 0.00 BSF_SC0_MISMATCH_TO Envelope rcpt doesn't match header On Fri, Jan 29, 2016 at 09:12:33AM -0500, Brian Foster wrote: > My understanding is that the original requirement for ioends here was to > track the state necessary in order to defer (to wq) completions that had > to allocate transactions. Eventually, the deferred buffer state was > implemented and we no longer required an ioend for that, so we removed > the ioends here: > > 2ba6623 xfs: don't allocate an ioend for direct I/O completions > > Then just a couple months later, we merged the following to re-add the > ioend into the dio path: > > d5cc2e3f xfs: DIO needs an ioend for writes And I complained about that one! I didn't have time to provide a full analysis and the patches around this one were criticial enough. But this patch has the analysis on why ioends are not needed and bad which should have been the full review back then. Note that this new version is better than the old ioend removal as it does not just use the private data as a boolean, but as a bitmask so that additional information such as the COW status can be communicated. From cmaiolino@redhat.com Tue Feb 2 08:22:22 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=ham version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay3.corp.sgi.com [198.149.34.15]) by oss.sgi.com (Postfix) with ESMTP id D3B907CB1 for ; Tue, 2 Feb 2016 08:22:21 -0600 (CST) Received: from cuda.sgi.com (cuda2.sgi.com [192.48.176.25]) by relay3.corp.sgi.com (Postfix) with ESMTP id 63CB3AC005 for ; Tue, 2 Feb 2016 06:22:18 -0800 (PST) X-ASG-Debug-ID: 1454422936-04cbb026fc221ce0001-NocioJ Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by cuda.sgi.com with ESMTP id 692vwR8aVhEyIABD (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO) for ; Tue, 02 Feb 2016 06:22:17 -0800 (PST) X-Barracuda-Envelope-From: cmaiolino@redhat.com X-Barracuda-Apparent-Source-IP: 209.132.183.28 X-ASG-Whitelist: Client Received: from int-mx13.intmail.prod.int.phx2.redhat.com (int-mx13.intmail.prod.int.phx2.redhat.com [10.5.11.26]) by mx1.redhat.com (Postfix) with ESMTPS id 8024E804E7; Tue, 2 Feb 2016 14:22:16 +0000 (UTC) Received: from redhat.com (dhcp-26-103.brq.redhat.com [10.34.26.103]) by int-mx13.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id u12EMCCo002886 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Tue, 2 Feb 2016 09:22:15 -0500 Date: Tue, 2 Feb 2016 15:22:12 +0100 From: Carlos Maiolino To: Dave Chinner Cc: Eric Sandeen , xfs@oss.sgi.com Subject: Re: [PATCH] xfs: Split default quota limits by quota type V3 Message-ID: <20160202142212.GA5630@redhat.com> X-ASG-Orig-Subj: Re: [PATCH] xfs: Split default quota limits by quota type V3 Mail-Followup-To: Dave Chinner , Eric Sandeen , xfs@oss.sgi.com References: <1454000266-22541-1-git-send-email-cmaiolino@redhat.com> <56AA51B7.7030403@sandeen.net> <20160201095707.GB8141@redhat.com> <20160201212238.GV6033@dastard> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20160201212238.GV6033@dastard> User-Agent: Mutt/1.5.24 (2015-08-30) X-Scanned-By: MIMEDefang 2.68 on 10.5.11.26 X-Barracuda-Connect: mx1.redhat.com[209.132.183.28] X-Barracuda-Start-Time: 1454422937 X-Barracuda-Encrypted: ECDHE-RSA-AES256-GCM-SHA384 X-Barracuda-URL: https://192.48.176.25:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-BRTS-Status: 1 On Tue, Feb 02, 2016 at 08:22:38AM +1100, Dave Chinner wrote: > On Mon, Feb 01, 2016 at 10:57:07AM +0100, Carlos Maiolino wrote: > > On Thu, Jan 28, 2016 at 11:36:55AM -0600, Eric Sandeen wrote: > > > On 1/28/16 10:57 AM, Carlos Maiolino wrote: > > > > xfs_disk_dquot_t *ddqp = &dqp->q_core; > > > > > > > > - /* > > > > - * The warnings and timers set the grace period given to > > > > - * a user or group before he or she can not perform any > > > > - * more writing. If it is zero, a default is used. > > > > - */ > > > > > > Not sure why you removed this comment? > > > > > Regarding this comment, I think it's just redundant with the previous comment, I > > left it in the code for the V4 though, I believe Dave can rip it off if it is > > really redundant. > > No, please don't ask me to do make random patch edits on commit - > it's your job as a patch submitter to get it right. I will sometimes > do this for simple patches or patches that come from a > never-seen-before-and-never-seen-again patch submitter, but for a > regular developer submitting non-trivial patches I won't change the > patches because the issue hasn't been sorted out during peer review. > Hey, I apologize, I had no intention to give you any extra job :) I meant that in case you agreed or not with the comment, I thought you could decide by ripping the comment off or not, I had no intention to actually give you some unfinished job. In any case, I sent a V4 of this patch with the comment's change Eric suggested, adding his review-by too, although, a quick look from him again would be nice, I'll figure it out with him. cheers. > Work it out with Eric, get a reviewed-by tag, and I'll apply it as > reviewed. > > Cheers, > > Dave. > -- > Dave Chinner > david@fromorbit.com > > _______________________________________________ > xfs mailing list > xfs@oss.sgi.com > http://oss.sgi.com/mailman/listinfo/xfs -- Carlos From bfoster@redhat.com Tue Feb 2 09:26:28 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=ham version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay2.corp.sgi.com [137.38.102.29]) by oss.sgi.com (Postfix) with ESMTP id 68FB47CB1 for ; Tue, 2 Feb 2016 09:26:28 -0600 (CST) Received: from cuda.sgi.com (cuda2.sgi.com [192.48.176.25]) by relay2.corp.sgi.com (Postfix) with ESMTP id 46197304039 for ; Tue, 2 Feb 2016 07:26:25 -0800 (PST) X-ASG-Debug-ID: 1454426783-04cbb026fe2241f0001-NocioJ Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by cuda.sgi.com with ESMTP id fGaY0svOnQHZoZDX (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO) for ; Tue, 02 Feb 2016 07:26:24 -0800 (PST) X-Barracuda-Envelope-From: bfoster@redhat.com X-Barracuda-Apparent-Source-IP: 209.132.183.28 X-ASG-Whitelist: Client Received: from int-mx11.intmail.prod.int.phx2.redhat.com (int-mx11.intmail.prod.int.phx2.redhat.com [10.5.11.24]) by mx1.redhat.com (Postfix) with ESMTPS id 436308F4F6; Tue, 2 Feb 2016 15:26:23 +0000 (UTC) Received: from bfoster.bfoster (dhcp-41-28.bos.redhat.com [10.18.41.28]) by int-mx11.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id u12FQMAH008944; Tue, 2 Feb 2016 10:26:23 -0500 Received: by bfoster.bfoster (Postfix, from userid 1000) id C2F1212530A; Tue, 2 Feb 2016 10:26:21 -0500 (EST) Date: Tue, 2 Feb 2016 10:26:21 -0500 From: Brian Foster To: "Darrick J. Wong" Cc: Dave Chinner , Christoph Hellwig , xfs@oss.sgi.com, Christoph Hellwig Subject: Re: stop using ioends for direct write completions Message-ID: <20160202152620.GA1853@bfoster.bfoster> X-ASG-Orig-Subj: Re: stop using ioends for direct write completions References: <1452766237-2314-1-git-send-email-hch@lst.de> <20160128131656.GB14876@infradead.org> <20160129141232.GA43184@bfoster.bfoster> <20160201215407.GI20038@birch.djwong.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20160201215407.GI20038@birch.djwong.org> User-Agent: Mutt/1.5.24 (2015-08-30) X-Scanned-By: MIMEDefang 2.68 on 10.5.11.24 X-Barracuda-Connect: mx1.redhat.com[209.132.183.28] X-Barracuda-Start-Time: 1454426784 X-Barracuda-Encrypted: ECDHE-RSA-AES256-GCM-SHA384 X-Barracuda-URL: https://192.48.176.25:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-BRTS-Status: 1 On Mon, Feb 01, 2016 at 01:54:07PM -0800, Darrick J. Wong wrote: > On Fri, Jan 29, 2016 at 09:12:33AM -0500, Brian Foster wrote: > > On Thu, Jan 28, 2016 at 05:16:56AM -0800, Christoph Hellwig wrote: > > > Any chance to get a review for this? It should really help > > > with sorting out the buffered I/O COW code. > > > > > > > I haven't taken a closer look at the patch yet. I was kind of waiting > > for Dave to chime in because I'm a little confused over the back and > > forth nature of dio/ioend completion lately. > > > > My understanding is that the original requirement for ioends here was to > > track the state necessary in order to defer (to wq) completions that had > > to allocate transactions. Eventually, the deferred buffer state was > > implemented and we no longer required an ioend for that, so we removed > > the ioends here: > > > > 2ba6623 xfs: don't allocate an ioend for direct I/O completions > > > > Then just a couple months later, we merged the following to re-add the > > ioend into the dio path: > > > > d5cc2e3f xfs: DIO needs an ioend for writes > > > > I recall reviewing that one, but looking back afaict the ioend was used > > simply to enable reuse of the ioend completion code. Now we have this > > patch which presumably removes much of that code to eliminate the ioend > > allocation overhead. > > > > Neither this patch nor the previous has any technical reasoning for one > > approach over the other in the commit logs, so afaics this appears to be > > a matter of preference. Can we get some agreement (or discussion) on > > what the right interface is to transfer information to dio completion? > > E.g., is this allocation overhead noticeable? Is ioend usage problematic > > for other reasons (such as copy-on-write)? Going back to the previous > > patch, were there explicit reasons for using ioends aside from code > > reuse? Note that the subsequent commit 6dfa1b67 ("xfs: handle DIO > > overwrite EOF update completion correctly") does refer to some problems > > not running dio completions in the right context... Dave? > > I don't know the reason /for/ using ioends, but I'll share an argument in favor > of Christoph's patch to remove them: > The only thing I can gather from the historical information is that they are used to facilitate reuse of the completion path code responsible for unwritten conversion, inode size updates, etc. (i.e., convenience). > Each ioend has a type code which determines what we do at the end of the IO. > For buffered writes, we can create as many ioends as necessary to handle all > the different dispositions of all the blocks in the range of dirty pages. > > For directio, however, the requirements are a little different -- we want to be > able to say "change all the extents in this part of the file from unwritten to > written", and to be able to change i_size after a write. We can reuse the > ioend structure to encode these desires until CoW came along. Now we also want > to be able to say "remap all extents in this part of a file if the write > succeeds". Since we can only have one type code per ioend, either we have to > hide extra offset/size fields in the ioend for this purpose, add a flags field, > revise the code to create a bunch of ioends for each disposition type, > unconditionally try to remap blocks for any reflink'd inode, or do what > Christoph proposes, which is to stop (ab)using ioends and simply encode status > flags into dio->private. > > Christoph's approach seems like the easiest, since we're already provided > with the offset and size, and both the unwritten extent conversion and the > CoW remap code know how to iterate the data fork to look for the extents > they want to alter. > > The overhead probably goes down once we get rid of the memory allocation, > but the primary purpose is to make life easier for CoW to avoid unnecessary > overhead. > That sounds reasonable to me, though I'd probably have to see the cow bits to grok/appreciate the complexity avoided by killing off ioends here. I wonder if then perhaps the right thing to do is package this change with the associated cow bits (as a dependency) wherever/once they are available..? > Also: I've noticed that if I write 8MB file to a file backed by a failing > device, xfs_end_io_direct_write() gets called with size == 8MB even if the > writes failed. If the write was to an unwritten extent, the extent will be > converted to a regular extent even though the blocks contain old file contents > and other garbage, which can subsequently be read off the disk. > > For CoW I'd only want to remap the blocks if the write totally succeeds. If a > disk error happens, the EIO code gets passed back to userspace, and it seems > logical to me that the file contents should remain unchanged. > > To that end, I'm changing dio_iodone_t to pass an error code, and I think I > want to change XFS to avoid doing unwritten extent conversions when the write > fails. Does that make sense? > Yep, sounds like a fail to me. Brian > --D > > > > > Brian > > > > > _______________________________________________ > > > xfs mailing list > > > xfs@oss.sgi.com > > > http://oss.sgi.com/mailman/listinfo/xfs > > > > _______________________________________________ > > xfs mailing list > > xfs@oss.sgi.com > > http://oss.sgi.com/mailman/listinfo/xfs From bfoster@redhat.com Tue Feb 2 09:31:25 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=ham version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay3.corp.sgi.com [198.149.34.15]) by oss.sgi.com (Postfix) with ESMTP id F382B7CB9 for ; Tue, 2 Feb 2016 09:31:24 -0600 (CST) Received: from cuda.sgi.com (cuda2.sgi.com [192.48.176.25]) by relay3.corp.sgi.com (Postfix) with ESMTP id 80768AC004 for ; Tue, 2 Feb 2016 07:31:21 -0800 (PST) X-ASG-Debug-ID: 1454427079-04cbb026fc224540001-NocioJ Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by cuda.sgi.com with ESMTP id EhJxqz5j7b75vaPK (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO) for ; Tue, 02 Feb 2016 07:31:20 -0800 (PST) X-Barracuda-Envelope-From: bfoster@redhat.com X-Barracuda-Apparent-Source-IP: 209.132.183.28 X-ASG-Whitelist: Client Received: from int-mx11.intmail.prod.int.phx2.redhat.com (int-mx11.intmail.prod.int.phx2.redhat.com [10.5.11.24]) by mx1.redhat.com (Postfix) with ESMTPS id BB7308E678; Tue, 2 Feb 2016 15:31:19 +0000 (UTC) Received: from bfoster.bfoster (dhcp-41-28.bos.redhat.com [10.18.41.28]) by int-mx11.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id u12FVJlK014092; Tue, 2 Feb 2016 10:31:19 -0500 Received: by bfoster.bfoster (Postfix, from userid 1000) id 7081B12530A; Tue, 2 Feb 2016 10:31:18 -0500 (EST) Date: Tue, 2 Feb 2016 10:31:18 -0500 From: Brian Foster To: Christoph Hellwig Cc: Christoph Hellwig , xfs@oss.sgi.com, darrick.wong@oracle.com Subject: Re: stop using ioends for direct write completions Message-ID: <20160202153117.GB1853@bfoster.bfoster> X-ASG-Orig-Subj: Re: stop using ioends for direct write completions References: <1452766237-2314-1-git-send-email-hch@lst.de> <20160128131656.GB14876@infradead.org> <20160129141232.GA43184@bfoster.bfoster> <20160202112046.GB28777@lst.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20160202112046.GB28777@lst.de> User-Agent: Mutt/1.5.24 (2015-08-30) X-Scanned-By: MIMEDefang 2.68 on 10.5.11.24 X-Barracuda-Connect: mx1.redhat.com[209.132.183.28] X-Barracuda-Start-Time: 1454427080 X-Barracuda-Encrypted: ECDHE-RSA-AES256-GCM-SHA384 X-Barracuda-URL: https://192.48.176.25:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-BRTS-Status: 1 On Tue, Feb 02, 2016 at 12:20:46PM +0100, Christoph Hellwig wrote: > On Fri, Jan 29, 2016 at 09:12:33AM -0500, Brian Foster wrote: > > My understanding is that the original requirement for ioends here was to > > track the state necessary in order to defer (to wq) completions that had > > to allocate transactions. Eventually, the deferred buffer state was > > implemented and we no longer required an ioend for that, so we removed > > the ioends here: > > > > 2ba6623 xfs: don't allocate an ioend for direct I/O completions > > > > Then just a couple months later, we merged the following to re-add the > > ioend into the dio path: > > > > d5cc2e3f xfs: DIO needs an ioend for writes > > And I complained about that one! I didn't have time to provide a full > analysis and the patches around this one were criticial enough. But this > patch has the analysis on why ioends are not needed and bad which should > have been the full review back then. Note that this new version is > better than the old ioend removal as it does not just use the private > data as a boolean, but as a bitmask so that additional information > such as the COW status can be communicated. > FWIW, I don't see any such review comments against the three versions of the "DIO needs an ioend for writes" patch I have in my mailbox, but I easily could have missed something..? But if there wasn't time, then fair enough. I'm just looking for context. I don't have much of an opinion on which approach is used here. If it simplifies COW, then that seems good enough reason to me to take this approach. I'm pointing this out more because this code seems to have been rewritten the last couple of times we needed to fix something, which makes backports particularly annoying. The two patches above were associated with a broader enhancement and a bug fix (respectively) as a sort of justification, whereas this post had a much more vague purpose from what I could tell, and therefore why I at least hadn't taken the time to review it. If COW is the primary motivator, perhaps we can bundle it with that work? Brian > _______________________________________________ > xfs mailing list > xfs@oss.sgi.com > http://oss.sgi.com/mailman/listinfo/xfs From hch@lst.de Tue Feb 2 10:42:44 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=ham version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay3.corp.sgi.com [198.149.34.15]) by oss.sgi.com (Postfix) with ESMTP id 586C77CB1 for ; Tue, 2 Feb 2016 10:42:44 -0600 (CST) Received: from cuda.sgi.com (cuda2.sgi.com [192.48.176.25]) by relay3.corp.sgi.com (Postfix) with ESMTP id D65B2AC007 for ; Tue, 2 Feb 2016 08:42:40 -0800 (PST) X-ASG-Debug-ID: 1454431357-04cbb04c9700860001-NocioJ Received: from newverein.lst.de (verein.lst.de [213.95.11.211]) by cuda.sgi.com with ESMTP id HyQtwyWoTbtDqajh (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO) for ; Tue, 02 Feb 2016 08:42:38 -0800 (PST) X-Barracuda-Envelope-From: hch@lst.de X-Barracuda-Apparent-Source-IP: 213.95.11.211 Received: by newverein.lst.de (Postfix, from userid 2407) id 6BF75692CC; Tue, 2 Feb 2016 17:42:37 +0100 (CET) Date: Tue, 2 Feb 2016 17:42:37 +0100 From: Christoph Hellwig To: Brian Foster Cc: xfs@oss.sgi.com, darrick.wong@oracle.com Subject: Re: stop using ioends for direct write completions Message-ID: <20160202164237.GA25436@lst.de> X-ASG-Orig-Subj: Re: stop using ioends for direct write completions References: <1452766237-2314-1-git-send-email-hch@lst.de> <20160128131656.GB14876@infradead.org> <20160129141232.GA43184@bfoster.bfoster> <20160202112046.GB28777@lst.de> <20160202153117.GB1853@bfoster.bfoster> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20160202153117.GB1853@bfoster.bfoster> User-Agent: Mutt/1.5.17 (2007-11-01) X-Barracuda-Connect: verein.lst.de[213.95.11.211] X-Barracuda-Start-Time: 1454431358 X-Barracuda-Encrypted: ECDHE-RSA-AES256-GCM-SHA384 X-Barracuda-URL: https://192.48.176.25:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-BRTS-Status: 1 X-Barracuda-Spam-Score: 0.00 X-Barracuda-Spam-Status: No, SCORE=0.00 using per-user scores of TAG_LEVEL=1000.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.7 tests=BSF_SC0_MISMATCH_TO X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.3.26678 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 0.00 BSF_SC0_MISMATCH_TO Envelope rcpt doesn't match header On Tue, Feb 02, 2016 at 10:31:18AM -0500, Brian Foster wrote: > FWIW, I don't see any such review comments against the three versions of > the "DIO needs an ioend for writes" patch I have in my mailbox, but I > easily could have missed something..? But if there wasn't time, then > fair enough. I'll have to look at the mailboxes, but I remember Dave sending this out and complaining. > I'm just looking for context. I don't have much of an opinion on which > approach is used here. If it simplifies COW, then that seems good enough > reason to me to take this approach. I'm pointing this out more because > this code seems to have been rewritten the last couple of times we > needed to fix something, which makes backports particularly annoying. > The two patches above were associated with a broader enhancement and a > bug fix (respectively) as a sort of justification, whereas this post had > a much more vague purpose from what I could tell, and therefore why I at > least hadn't taken the time to review it. > > If COW is the primary motivator, perhaps we can bundle it with that > work? The prime motivator is to: (1) avoid a pointless memory allocation (2) avoid a pointless context switch (3) avoid pointless code complexity COW is just another case where these show up. From BATV+7b2dcb252496780e18a8+4545+infradead.org+hch@bombadil.srs.infradead.org Tue Feb 2 12:08:37 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=ham version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay3.corp.sgi.com [198.149.34.15]) by oss.sgi.com (Postfix) with ESMTP id 9A9E47CB3 for ; Tue, 2 Feb 2016 12:08:37 -0600 (CST) Received: from cuda.sgi.com (cuda2.sgi.com [192.48.176.25]) by relay3.corp.sgi.com (Postfix) with ESMTP id 27D32AC004 for ; Tue, 2 Feb 2016 10:08:33 -0800 (PST) X-ASG-Debug-ID: 1454436510-04cbb04c9503280001-NocioJ Received: from bombadil.infradead.org ([198.137.202.9]) by cuda.sgi.com with ESMTP id nZxH990CR2T0mKRz (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128 verify=NO) for ; Tue, 02 Feb 2016 10:08:31 -0800 (PST) X-Barracuda-Envelope-From: BATV+7b2dcb252496780e18a8+4545+infradead.org+hch@bombadil.srs.infradead.org X-Barracuda-Apparent-Source-IP: 198.137.202.9 Received: from hch by bombadil.infradead.org with local (Exim 4.80.1 #2 (Red Hat Linux)) id 1aQfNM-0004PL-Ke; Tue, 02 Feb 2016 18:08:28 +0000 Date: Tue, 2 Feb 2016 10:08:28 -0800 From: Christoph Hellwig To: Gwendal Grignou Cc: hch@infradead.org, tytso@mit.edu, fstests@vger.kernel.org, xfs@oss.sgi.com Subject: Re: xfsprogs: Add BUILD_CFLAGS for cross compilation Message-ID: <20160202180828.GA13880@infradead.org> X-ASG-Orig-Subj: Re: xfsprogs: Add BUILD_CFLAGS for cross compilation References: <1437913255-7524-4-git-send-email-tytso@mit.edu> <1454361909-36538-1-git-send-email-gwendal@chromium.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1454361909-36538-1-git-send-email-gwendal@chromium.org> User-Agent: Mutt/1.5.24 (2015-08-30) X-SRS-Rewrite: SMTP reverse-path rewritten from by bombadil.infradead.org See http://www.infradead.org/rpr.html X-Barracuda-Connect: UNKNOWN[198.137.202.9] X-Barracuda-Start-Time: 1454436511 X-Barracuda-Encrypted: ECDHE-RSA-AES128-GCM-SHA256 X-Barracuda-URL: https://192.48.176.25:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-BRTS-Status: 1 X-Barracuda-Spam-Score: 0.10 X-Barracuda-Spam-Status: No, SCORE=0.10 using per-user scores of TAG_LEVEL=1000.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.7 tests=BSF_SC0_MISMATCH_TO, RDNS_NONE X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.3.26679 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 0.00 BSF_SC0_MISMATCH_TO Envelope rcpt doesn't match header 0.10 RDNS_NONE Delivered to trusted network by a host with no rDNS On Mon, Feb 01, 2016 at 01:25:09PM -0800, Gwendal Grignou wrote: > When cross compiling, CFLAGS may contains option for the cros-compiler the > host compiler can not handle. > Add BUILD_CFLAGS variable that does not include $OPTIMIZER options. I would have expected this to be HOST_CFLAGS, but it seems the BUILD_ convention already exists in xfsprogs, so sticking to it looks fine to me. Reviewed-by: Christoph Hellwig From BATV+41eca50886e6d2c6bfa1+4545+infradead.org+hch@casper.srs.infradead.org Tue Feb 2 14:17:46 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=ham version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay1.corp.sgi.com [137.38.102.111]) by oss.sgi.com (Postfix) with ESMTP id F22057CB0 for ; Tue, 2 Feb 2016 14:17:45 -0600 (CST) Received: from cuda.sgi.com (cuda3.sgi.com [192.48.176.15]) by relay1.corp.sgi.com (Postfix) with ESMTP id E2DAB8F8035 for ; Tue, 2 Feb 2016 12:17:45 -0800 (PST) X-ASG-Debug-ID: 1454444262-04cb6c379806e40001-NocioJ Received: from casper.infradead.org (casper.infradead.org [85.118.1.10]) by cuda.sgi.com with ESMTP id hm1z37Ph9gZTly8S (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128 verify=NO) for ; Tue, 02 Feb 2016 12:17:42 -0800 (PST) X-Barracuda-Envelope-From: BATV+41eca50886e6d2c6bfa1+4545+infradead.org+hch@casper.srs.infradead.org X-Barracuda-Apparent-Source-IP: 85.118.1.10 Received: from [83.175.99.196] (helo=localhost) by casper.infradead.org with esmtpsa (Exim 4.85 #2 (Red Hat Linux)) id 1aQhOP-0002ZL-Ua; Tue, 02 Feb 2016 20:17:42 +0000 From: Christoph Hellwig To: linux-fsdevel@vger.kernel.org, xfs@oss.sgi.com, linux-ext4@vger.kernel.org, ocfs2-devel@oss.oracle.com Cc: darrick.wong@oracle.com Subject: [PATCH 2/3] xfs: don't use ioends for direct write completions Date: Tue, 2 Feb 2016 21:17:36 +0100 X-ASG-Orig-Subj: [PATCH 2/3] xfs: don't use ioends for direct write completions Message-Id: <1454444257-9086-3-git-send-email-hch@lst.de> X-Mailer: git-send-email 2.1.4 In-Reply-To: <1454444257-9086-1-git-send-email-hch@lst.de> References: <1454444257-9086-1-git-send-email-hch@lst.de> X-SRS-Rewrite: SMTP reverse-path rewritten from by casper.infradead.org X-Barracuda-Connect: casper.infradead.org[85.118.1.10] X-Barracuda-Start-Time: 1454444262 X-Barracuda-Encrypted: ECDHE-RSA-AES128-GCM-SHA256 X-Barracuda-URL: https://192.48.176.15:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-BRTS-Status: 1 X-Barracuda-Spam-Score: 0.00 X-Barracuda-Spam-Status: No, SCORE=0.00 using per-user scores of TAG_LEVEL=1000.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.7 tests=BSF_SC0_MISMATCH_TO X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.3.26685 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 0.00 BSF_SC0_MISMATCH_TO Envelope rcpt doesn't match header We only need to communicate two bits of information to the direct I/O completion handler: (1) do we need to convert any unwritten extents in the range (2) do we need to check if we need to update the inode size based on the range passed to the completion handler We can use the private data passed to the get_block handler and the completion handler as a simple bitmask to communicate this information instead of the current complicated infrastructure reusing the ioends from the buffer I/O path, and thus avoiding a memory allocation and a context switch for any non-trivial direct write. As a nice side effect we also decouple the direct I/O path implementation from that of the buffered I/O path. Signed-off-by: Christoph Hellwig --- fs/xfs/xfs_aops.c | 216 ++++++++++++++++++----------------------------------- fs/xfs/xfs_trace.h | 9 +-- 2 files changed, 77 insertions(+), 148 deletions(-) diff --git a/fs/xfs/xfs_aops.c b/fs/xfs/xfs_aops.c index c318e9f..f6b08ea 100644 --- a/fs/xfs/xfs_aops.c +++ b/fs/xfs/xfs_aops.c @@ -36,6 +36,10 @@ #include #include +/* flags for direct write completions */ +#define XFS_DIO_FLAG_UNWRITTEN (1 << 0) +#define XFS_DIO_FLAG_APPEND (1 << 1) + void xfs_count_page_state( struct page *page, @@ -1238,27 +1242,8 @@ xfs_vm_releasepage( } /* - * When we map a DIO buffer, we may need to attach an ioend that describes the - * type of write IO we are doing. This passes to the completion function the - * operations it needs to perform. If the mapping is for an overwrite wholly - * within the EOF then we don't need an ioend and so we don't allocate one. - * This avoids the unnecessary overhead of allocating and freeing ioends for - * workloads that don't require transactions on IO completion. - * - * If we get multiple mappings in a single IO, we might be mapping different - * types. But because the direct IO can only have a single private pointer, we - * need to ensure that: - * - * a) i) the ioend spans the entire region of unwritten mappings; or - * ii) the ioend spans all the mappings that cross or are beyond EOF; and - * b) if it contains unwritten extents, it is *permanently* marked as such - * - * We could do this by chaining ioends like buffered IO does, but we only - * actually get one IO completion callback from the direct IO, and that spans - * the entire IO regardless of how many mappings and IOs are needed to complete - * the DIO. There is only going to be one reference to the ioend and its life - * cycle is constrained by the DIO completion code. hence we don't need - * reference counting here. + * When we map a DIO buffer, we may need to pass flags to + * xfs_end_io_direct_write to tell it what kind of write IO we are doing. * * Note that for DIO, an IO to the highest supported file block offset (i.e. * 2^63 - 1FSB bytes) will result in the offset + count overflowing a signed 64 @@ -1266,68 +1251,26 @@ xfs_vm_releasepage( * extending the file size. We won't know for sure until IO completion is run * and the actual max write offset is communicated to the IO completion * routine. - * - * For DAX page faults, we are preparing to never see unwritten extents here, - * nor should we ever extend the inode size. Hence we will soon have nothing to - * do here for this case, ensuring we don't have to provide an IO completion - * callback to free an ioend that we don't actually need for a fault into the - * page at offset (2^63 - 1FSB) bytes. */ - static void xfs_map_direct( struct inode *inode, struct buffer_head *bh_result, struct xfs_bmbt_irec *imap, - xfs_off_t offset, - bool dax_fault) + xfs_off_t offset) { - struct xfs_ioend *ioend; + uintptr_t *flags = (uintptr_t *)&bh_result->b_private; xfs_off_t size = bh_result->b_size; - int type; - - if (ISUNWRITTEN(imap)) - type = XFS_IO_UNWRITTEN; - else - type = XFS_IO_OVERWRITE; - - trace_xfs_gbmap_direct(XFS_I(inode), offset, size, type, imap); - - if (dax_fault) { - ASSERT(type == XFS_IO_OVERWRITE); - trace_xfs_gbmap_direct_none(XFS_I(inode), offset, size, type, - imap); - return; - } - if (bh_result->b_private) { - ioend = bh_result->b_private; - ASSERT(ioend->io_size > 0); - ASSERT(offset >= ioend->io_offset); - if (offset + size > ioend->io_offset + ioend->io_size) - ioend->io_size = offset - ioend->io_offset + size; - - if (type == XFS_IO_UNWRITTEN && type != ioend->io_type) - ioend->io_type = XFS_IO_UNWRITTEN; - - trace_xfs_gbmap_direct_update(XFS_I(inode), ioend->io_offset, - ioend->io_size, ioend->io_type, - imap); - } else if (type == XFS_IO_UNWRITTEN || - offset + size > i_size_read(inode) || - offset + size < 0) { - ioend = xfs_alloc_ioend(inode, type); - ioend->io_offset = offset; - ioend->io_size = size; + trace_xfs_get_blocks_map_direct(XFS_I(inode), offset, size, + ISUNWRITTEN(imap) ? XFS_IO_UNWRITTEN : XFS_IO_OVERWRITE, imap); - bh_result->b_private = ioend; + if (ISUNWRITTEN(imap)) { + *flags |= XFS_DIO_FLAG_UNWRITTEN; + set_buffer_defer_completion(bh_result); + } else if (offset + size > i_size_read(inode) || offset + size < 0) { + *flags |= XFS_DIO_FLAG_APPEND; set_buffer_defer_completion(bh_result); - - trace_xfs_gbmap_direct_new(XFS_I(inode), offset, size, type, - imap); - } else { - trace_xfs_gbmap_direct_none(XFS_I(inode), offset, size, type, - imap); } } @@ -1498,9 +1441,12 @@ __xfs_get_blocks( if (ISUNWRITTEN(&imap)) set_buffer_unwritten(bh_result); /* direct IO needs special help */ - if (create && direct) - xfs_map_direct(inode, bh_result, &imap, offset, - dax_fault); + if (create && direct) { + if (dax_fault) + ASSERT(!ISUNWRITTEN(&imap)); + else + xfs_map_direct(inode, bh_result, &imap, offset); + } } /* @@ -1570,42 +1516,50 @@ xfs_get_blocks_dax_fault( return __xfs_get_blocks(inode, iblock, bh_result, create, true, true); } -static void -__xfs_end_io_direct_write( - struct inode *inode, - struct xfs_ioend *ioend, +/* + * Complete a direct I/O write request. + * + * xfs_map_direct passes us some flags in the private data to tell us what to + * do. If not flags are set, then the write IO is an overwrite wholly within + * the existing allocated file size and so there is nothing for us to do. + * + * Note that in this case the completion can be called in interrupt context, + * whereas if we have flags set we will always be called in task context + * (i.e. from a workqueue). + */ +STATIC void +xfs_end_io_direct_write( + struct kiocb *iocb, loff_t offset, - ssize_t size) + ssize_t size, + void *private) { - struct xfs_mount *mp = XFS_I(inode)->i_mount; + struct inode *inode = file_inode(iocb->ki_filp); + struct xfs_inode *ip = XFS_I(inode); + struct xfs_mount *mp = ip->i_mount; + uintptr_t flags = (uintptr_t)private; + int error = 0; - if (XFS_FORCED_SHUTDOWN(mp) || ioend->io_error) - goto out_end_io; + trace_xfs_end_io_direct_write(ip, offset, size); - /* - * dio completion end_io functions are only called on writes if more - * than 0 bytes was written. - */ - ASSERT(size > 0); + if (XFS_FORCED_SHUTDOWN(mp)) + return; - /* - * The ioend only maps whole blocks, while the IO may be sector aligned. - * Hence the ioend offset/size may not match the IO offset/size exactly. - * Because we don't map overwrites within EOF into the ioend, the offset - * may not match, but only if the endio spans EOF. Either way, write - * the IO sizes into the ioend so that completion processing does the - * right thing. - */ - ASSERT(offset + size <= ioend->io_offset + ioend->io_size); - ioend->io_size = size; - ioend->io_offset = offset; + if (size <= 0) + return; /* - * The ioend tells us whether we are doing unwritten extent conversion + * The flags tell us whether we are doing unwritten extent conversion * or an append transaction that updates the on-disk file size. These * cases are the only cases where we should *potentially* be needing * to update the VFS inode size. - * + */ + if (flags == 0) { + ASSERT(offset + size <= i_size_read(inode)); + return; + } + + /* * We need to update the in-core inode size here so that we don't end up * with the on-disk inode size being outside the in-core inode size. We * have no other method of updating EOF for AIO, so always do it here @@ -1616,57 +1570,33 @@ __xfs_end_io_direct_write( * here can result in EOF moving backwards and Bad Things Happen when * that occurs. */ - spin_lock(&XFS_I(inode)->i_flags_lock); + spin_lock(&ip->i_flags_lock); if (offset + size > i_size_read(inode)) i_size_write(inode, offset + size); - spin_unlock(&XFS_I(inode)->i_flags_lock); + spin_unlock(&ip->i_flags_lock); - /* - * If we are doing an append IO that needs to update the EOF on disk, - * do the transaction reserve now so we can use common end io - * processing. Stashing the error (if there is one) in the ioend will - * result in the ioend processing passing on the error if it is - * possible as we can't return it from here. - */ - if (ioend->io_type == XFS_IO_OVERWRITE) - ioend->io_error = xfs_setfilesize_trans_alloc(ioend); + if (flags & XFS_DIO_FLAG_UNWRITTEN) { + trace_xfs_end_io_direct_write_unwritten(ip, offset, size); -out_end_io: - xfs_end_io(&ioend->io_work); - return; -} + error = xfs_iomap_write_unwritten(ip, offset, size); -/* - * Complete a direct I/O write request. - * - * The ioend structure is passed from __xfs_get_blocks() to tell us what to do. - * If no ioend exists (i.e. @private == NULL) then the write IO is an overwrite - * wholly within the EOF and so there is nothing for us to do. Note that in this - * case the completion can be called in interrupt context, whereas if we have an - * ioend we will always be called in task context (i.e. from a workqueue). - */ -STATIC void -xfs_end_io_direct_write( - struct kiocb *iocb, - loff_t offset, - ssize_t size, - void *private) -{ - struct inode *inode = file_inode(iocb->ki_filp); - struct xfs_ioend *ioend = private; + WARN_ON_ONCE(error); + } else if (flags & XFS_DIO_FLAG_APPEND) { + struct xfs_trans *tp; - if (size <= 0) - return; + trace_xfs_end_io_direct_write_append(ip, offset, size); - trace_xfs_gbmap_direct_endio(XFS_I(inode), offset, size, - ioend ? ioend->io_type : 0, NULL); + tp = xfs_trans_alloc(mp, XFS_TRANS_FSYNC_TS); - if (!ioend) { - ASSERT(offset + size <= i_size_read(inode)); - return; + error = xfs_trans_reserve(tp, &M_RES(mp)->tr_fsyncts, 0, 0); + if (error) { + xfs_trans_cancel(tp); + WARN_ON_ONCE(error); + return; + } + error = xfs_setfilesize(ip, tp, offset, size); + WARN_ON_ONCE(error); } - - __xfs_end_io_direct_write(inode, ioend, offset, size); } static inline ssize_t diff --git a/fs/xfs/xfs_trace.h b/fs/xfs/xfs_trace.h index 391d797..c8d5842 100644 --- a/fs/xfs/xfs_trace.h +++ b/fs/xfs/xfs_trace.h @@ -1296,11 +1296,7 @@ DEFINE_IOMAP_EVENT(xfs_map_blocks_found); DEFINE_IOMAP_EVENT(xfs_map_blocks_alloc); DEFINE_IOMAP_EVENT(xfs_get_blocks_found); DEFINE_IOMAP_EVENT(xfs_get_blocks_alloc); -DEFINE_IOMAP_EVENT(xfs_gbmap_direct); -DEFINE_IOMAP_EVENT(xfs_gbmap_direct_new); -DEFINE_IOMAP_EVENT(xfs_gbmap_direct_update); -DEFINE_IOMAP_EVENT(xfs_gbmap_direct_none); -DEFINE_IOMAP_EVENT(xfs_gbmap_direct_endio); +DEFINE_IOMAP_EVENT(xfs_get_blocks_map_direct); DECLARE_EVENT_CLASS(xfs_simple_io_class, TP_PROTO(struct xfs_inode *ip, xfs_off_t offset, ssize_t count), @@ -1340,6 +1336,9 @@ DEFINE_SIMPLE_IO_EVENT(xfs_unwritten_convert); DEFINE_SIMPLE_IO_EVENT(xfs_get_blocks_notfound); DEFINE_SIMPLE_IO_EVENT(xfs_setfilesize); DEFINE_SIMPLE_IO_EVENT(xfs_zero_eof); +DEFINE_SIMPLE_IO_EVENT(xfs_end_io_direct_write); +DEFINE_SIMPLE_IO_EVENT(xfs_end_io_direct_write_unwritten); +DEFINE_SIMPLE_IO_EVENT(xfs_end_io_direct_write_append); DECLARE_EVENT_CLASS(xfs_itrunc_class, TP_PROTO(struct xfs_inode *ip, xfs_fsize_t new_size), -- 2.1.4 From BATV+41eca50886e6d2c6bfa1+4545+infradead.org+hch@casper.srs.infradead.org Tue Feb 2 14:17:47 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=ham version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay1.corp.sgi.com [137.38.102.111]) by oss.sgi.com (Postfix) with ESMTP id C6A2E7CB1 for ; Tue, 2 Feb 2016 14:17:47 -0600 (CST) Received: from cuda.sgi.com (cuda1.sgi.com [192.48.157.11]) by relay1.corp.sgi.com (Postfix) with ESMTP id 9DDF48F8040 for ; Tue, 2 Feb 2016 12:17:44 -0800 (PST) X-ASG-Debug-ID: 1454444261-04bdf0705306ce0001-NocioJ Received: from casper.infradead.org (casper.infradead.org [85.118.1.10]) by cuda.sgi.com with ESMTP id uxmmCkre6Mfn11Vp (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128 verify=NO) for ; Tue, 02 Feb 2016 12:17:42 -0800 (PST) X-Barracuda-Envelope-From: BATV+41eca50886e6d2c6bfa1+4545+infradead.org+hch@casper.srs.infradead.org X-Barracuda-Apparent-Source-IP: 85.118.1.10 Received: from [83.175.99.196] (helo=localhost) by casper.infradead.org with esmtpsa (Exim 4.85 #2 (Red Hat Linux)) id 1aQhOO-0002Z6-8l; Tue, 02 Feb 2016 20:17:40 +0000 From: Christoph Hellwig To: linux-fsdevel@vger.kernel.org, xfs@oss.sgi.com, linux-ext4@vger.kernel.org, ocfs2-devel@oss.oracle.com Cc: darrick.wong@oracle.com Subject: VFS/XFS: directio updates to ease COW handling Date: Tue, 2 Feb 2016 21:17:34 +0100 X-ASG-Orig-Subj: VFS/XFS: directio updates to ease COW handling Message-Id: <1454444257-9086-1-git-send-email-hch@lst.de> X-Mailer: git-send-email 2.1.4 X-SRS-Rewrite: SMTP reverse-path rewritten from by casper.infradead.org X-Barracuda-Connect: casper.infradead.org[85.118.1.10] X-Barracuda-Start-Time: 1454444262 X-Barracuda-Encrypted: ECDHE-RSA-AES128-GCM-SHA256 X-Barracuda-URL: https://192.48.157.11:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-BRTS-Status: 1 X-Barracuda-Spam-Score: 0.00 X-Barracuda-Spam-Status: No, SCORE=0.00 using per-user scores of TAG_LEVEL=1000.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.7 tests=BSF_SC0_MISMATCH_TO X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.3.26684 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 0.00 BSF_SC0_MISMATCH_TO Envelope rcpt doesn't match header The first patch ensures ->end_io is always called for direct I/O requests that pass it in, even if there was a zero length write, or if an error occured. The existing users have been updated to ignore it, but XFS will make use of it in the future, and a comment in ext4 suggests it might be useful for it as well. The other two simplify the XFS direct I/O code. From BATV+41eca50886e6d2c6bfa1+4545+infradead.org+hch@casper.srs.infradead.org Tue Feb 2 14:17:48 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=ham version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay3.corp.sgi.com [198.149.34.15]) by oss.sgi.com (Postfix) with ESMTP id 671807CB2 for ; Tue, 2 Feb 2016 14:17:48 -0600 (CST) Received: from cuda.sgi.com (cuda3.sgi.com [192.48.176.15]) by relay3.corp.sgi.com (Postfix) with ESMTP id ED0DFAC004 for ; Tue, 2 Feb 2016 12:17:44 -0800 (PST) X-ASG-Debug-ID: 1454444261-04cb6c379506e30001-NocioJ Received: from casper.infradead.org (casper.infradead.org [85.118.1.10]) by cuda.sgi.com with ESMTP id sCGYo75U5VHhlesa (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128 verify=NO) for ; Tue, 02 Feb 2016 12:17:42 -0800 (PST) X-Barracuda-Envelope-From: BATV+41eca50886e6d2c6bfa1+4545+infradead.org+hch@casper.srs.infradead.org X-Barracuda-Apparent-Source-IP: 85.118.1.10 Received: from [83.175.99.196] (helo=localhost) by casper.infradead.org with esmtpsa (Exim 4.85 #2 (Red Hat Linux)) id 1aQhOP-0002ZA-3e; Tue, 02 Feb 2016 20:17:41 +0000 From: Christoph Hellwig To: linux-fsdevel@vger.kernel.org, xfs@oss.sgi.com, linux-ext4@vger.kernel.org, ocfs2-devel@oss.oracle.com Cc: darrick.wong@oracle.com Subject: [PATCH 1/3] direct-io: always call ->end_io if non-NULL Date: Tue, 2 Feb 2016 21:17:35 +0100 X-ASG-Orig-Subj: [PATCH 1/3] direct-io: always call ->end_io if non-NULL Message-Id: <1454444257-9086-2-git-send-email-hch@lst.de> X-Mailer: git-send-email 2.1.4 In-Reply-To: <1454444257-9086-1-git-send-email-hch@lst.de> References: <1454444257-9086-1-git-send-email-hch@lst.de> X-SRS-Rewrite: SMTP reverse-path rewritten from by casper.infradead.org X-Barracuda-Connect: casper.infradead.org[85.118.1.10] X-Barracuda-Start-Time: 1454444262 X-Barracuda-Encrypted: ECDHE-RSA-AES128-GCM-SHA256 X-Barracuda-URL: https://192.48.176.15:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-BRTS-Status: 1 X-Barracuda-Spam-Score: 0.00 X-Barracuda-Spam-Status: No, SCORE=0.00 using per-user scores of TAG_LEVEL=1000.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.7 tests=BSF_SC0_MISMATCH_TO X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.3.26685 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 0.00 BSF_SC0_MISMATCH_TO Envelope rcpt doesn't match header This way we can pass back errors to the file system, and allow for cleanup required for all direct I/O invocations. Signed-off-by: Christoph Hellwig --- fs/dax.c | 2 +- fs/direct-io.c | 4 ++-- fs/ext4/inode.c | 3 +++ fs/ocfs2/aops.c | 3 +++ fs/xfs/xfs_aops.c | 3 +++ 5 files changed, 12 insertions(+), 3 deletions(-) diff --git a/fs/dax.c b/fs/dax.c index 4fd6b0c..e47d1ba 100644 --- a/fs/dax.c +++ b/fs/dax.c @@ -267,7 +267,7 @@ ssize_t dax_do_io(struct kiocb *iocb, struct inode *inode, if ((flags & DIO_LOCKING) && iov_iter_rw(iter) == READ) inode_unlock(inode); - if ((retval > 0) && end_io) + if (end_io) end_io(iocb, pos, retval, bh.b_private); if (!(flags & DIO_SKIP_DIO_COUNT)) diff --git a/fs/direct-io.c b/fs/direct-io.c index 1b2f7ff..ead7ac1 100644 --- a/fs/direct-io.c +++ b/fs/direct-io.c @@ -253,8 +253,8 @@ static ssize_t dio_complete(struct dio *dio, loff_t offset, ssize_t ret, if (ret == 0) ret = transferred; - if (dio->end_io && dio->result) - dio->end_io(dio->iocb, offset, transferred, dio->private); + if (dio->end_io) + dio->end_io(dio->iocb, offset, ret, dio->private); if (!(dio->flags & DIO_SKIP_DIO_COUNT)) inode_dio_end(dio->inode); diff --git a/fs/ext4/inode.c b/fs/ext4/inode.c index 83bc8bf..d04555b 100644 --- a/fs/ext4/inode.c +++ b/fs/ext4/inode.c @@ -3166,6 +3166,9 @@ static void ext4_end_io_dio(struct kiocb *iocb, loff_t offset, { ext4_io_end_t *io_end = iocb->private; + if (size <= 0) + return; + /* if not async direct IO just return */ if (!io_end) return; diff --git a/fs/ocfs2/aops.c b/fs/ocfs2/aops.c index 794fd15..1eeb804 100644 --- a/fs/ocfs2/aops.c +++ b/fs/ocfs2/aops.c @@ -628,6 +628,9 @@ static void ocfs2_dio_end_io(struct kiocb *iocb, struct inode *inode = file_inode(iocb->ki_filp); int level; + if (bytes <= 0) + return; + /* this io's submitter should not have unlocked this before we could */ BUG_ON(!ocfs2_iocb_is_rw_locked(iocb)); diff --git a/fs/xfs/xfs_aops.c b/fs/xfs/xfs_aops.c index 379c089..c318e9f 100644 --- a/fs/xfs/xfs_aops.c +++ b/fs/xfs/xfs_aops.c @@ -1655,6 +1655,9 @@ xfs_end_io_direct_write( struct inode *inode = file_inode(iocb->ki_filp); struct xfs_ioend *ioend = private; + if (size <= 0) + return; + trace_xfs_gbmap_direct_endio(XFS_I(inode), offset, size, ioend ? ioend->io_type : 0, NULL); -- 2.1.4 From BATV+41eca50886e6d2c6bfa1+4545+infradead.org+hch@casper.srs.infradead.org Tue Feb 2 14:17:49 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=ham version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay2.corp.sgi.com [137.38.102.29]) by oss.sgi.com (Postfix) with ESMTP id 0ACFF7CB0 for ; Tue, 2 Feb 2016 14:17:49 -0600 (CST) Received: from cuda.sgi.com (cuda3.sgi.com [192.48.176.15]) by relay2.corp.sgi.com (Postfix) with ESMTP id E2F4E304059 for ; Tue, 2 Feb 2016 12:17:45 -0800 (PST) X-ASG-Debug-ID: 1454444263-04cb6c379606e40001-NocioJ Received: from casper.infradead.org (casper.infradead.org [85.118.1.10]) by cuda.sgi.com with ESMTP id B86RuI3AX6eU3Kbc (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128 verify=NO) for ; Tue, 02 Feb 2016 12:17:43 -0800 (PST) X-Barracuda-Envelope-From: BATV+41eca50886e6d2c6bfa1+4545+infradead.org+hch@casper.srs.infradead.org X-Barracuda-Apparent-Source-IP: 85.118.1.10 Received: from [83.175.99.196] (helo=localhost) by casper.infradead.org with esmtpsa (Exim 4.85 #2 (Red Hat Linux)) id 1aQhOQ-0002ZS-PO; Tue, 02 Feb 2016 20:17:42 +0000 From: Christoph Hellwig To: linux-fsdevel@vger.kernel.org, xfs@oss.sgi.com, linux-ext4@vger.kernel.org, ocfs2-devel@oss.oracle.com Cc: darrick.wong@oracle.com Subject: [PATCH 3/3] xfs: fold xfs_vm_do_dio into xfs_vm_direct_IO Date: Tue, 2 Feb 2016 21:17:37 +0100 X-ASG-Orig-Subj: [PATCH 3/3] xfs: fold xfs_vm_do_dio into xfs_vm_direct_IO Message-Id: <1454444257-9086-4-git-send-email-hch@lst.de> X-Mailer: git-send-email 2.1.4 In-Reply-To: <1454444257-9086-1-git-send-email-hch@lst.de> References: <1454444257-9086-1-git-send-email-hch@lst.de> X-SRS-Rewrite: SMTP reverse-path rewritten from by casper.infradead.org X-Barracuda-Connect: casper.infradead.org[85.118.1.10] X-Barracuda-Start-Time: 1454444263 X-Barracuda-Encrypted: ECDHE-RSA-AES128-GCM-SHA256 X-Barracuda-URL: https://192.48.176.15:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-BRTS-Status: 1 X-Barracuda-Spam-Score: 0.00 X-Barracuda-Spam-Status: No, SCORE=0.00 using per-user scores of TAG_LEVEL=1000.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.7 tests=BSF_SC0_MISMATCH_TO X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.3.26685 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 0.00 BSF_SC0_MISMATCH_TO Envelope rcpt doesn't match header Signed-off-by: Christoph Hellwig --- fs/xfs/xfs_aops.c | 39 ++++++++++++++------------------------- 1 file changed, 14 insertions(+), 25 deletions(-) diff --git a/fs/xfs/xfs_aops.c b/fs/xfs/xfs_aops.c index f6b08ea..e3cb7f8 100644 --- a/fs/xfs/xfs_aops.c +++ b/fs/xfs/xfs_aops.c @@ -1599,41 +1599,30 @@ xfs_end_io_direct_write( } } -static inline ssize_t -xfs_vm_do_dio( - struct inode *inode, +STATIC ssize_t +xfs_vm_direct_IO( struct kiocb *iocb, struct iov_iter *iter, - loff_t offset, - void (*endio)(struct kiocb *iocb, - loff_t offset, - ssize_t size, - void *private), - int flags) + loff_t offset) { + struct inode *inode = iocb->ki_filp->f_mapping->host; + dio_iodone_t *endio = NULL; + int flags = 0; struct block_device *bdev; - if (IS_DAX(inode)) + if (iov_iter_rw(iter) == WRITE) { + endio = xfs_end_io_direct_write; + flags = DIO_ASYNC_EXTEND; + } + + if (IS_DAX(inode)) { return dax_do_io(iocb, inode, iter, offset, xfs_get_blocks_direct, endio, 0); + } bdev = xfs_find_bdev_for_inode(inode); return __blockdev_direct_IO(iocb, inode, bdev, iter, offset, - xfs_get_blocks_direct, endio, NULL, flags); -} - -STATIC ssize_t -xfs_vm_direct_IO( - struct kiocb *iocb, - struct iov_iter *iter, - loff_t offset) -{ - struct inode *inode = iocb->ki_filp->f_mapping->host; - - if (iov_iter_rw(iter) == WRITE) - return xfs_vm_do_dio(inode, iocb, iter, offset, - xfs_end_io_direct_write, DIO_ASYNC_EXTEND); - return xfs_vm_do_dio(inode, iocb, iter, offset, NULL, 0); + xfs_get_blocks_direct, endio, NULL, flags); } /* -- 2.1.4 From nmdilipsimha@gmail.com Tue Feb 2 16:32:52 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=FREEMAIL_FROM,HTML_MESSAGE, T_DKIM_INVALID autolearn=ham version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay2.corp.sgi.com [137.38.102.29]) by oss.sgi.com (Postfix) with ESMTP id 933917CB0 for ; Tue, 2 Feb 2016 16:32:52 -0600 (CST) Received: from cuda.sgi.com (cuda1.sgi.com [192.48.157.11]) by relay2.corp.sgi.com (Postfix) with ESMTP id 65FCF304053 for ; Tue, 2 Feb 2016 14:32:52 -0800 (PST) X-ASG-Debug-ID: 1454452367-04bdf070510a930001-NocioJ Received: from mail-ob0-f179.google.com (mail-ob0-f179.google.com [209.85.214.179]) by cuda.sgi.com with ESMTP id ak7IPnJuQ4H4vq0g (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128 verify=NO) for ; Tue, 02 Feb 2016 14:32:47 -0800 (PST) X-Barracuda-Envelope-From: nmdilipsimha@gmail.com X-Barracuda-Apparent-Source-IP: 209.85.214.179 Received: by mail-ob0-f179.google.com with SMTP id wb13so4420813obb.1 for ; Tue, 02 Feb 2016 14:32:47 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:from:date:message-id:subject:to:content-type; bh=MHBbkKMjPAmzv2um/Oru1TixgPdXer6E3829nBEpKeY=; b=gSx4MtWI1hKwl/N15pjuQR19XuPR848Zle5MeWogU0yZo7J9/j/bikoO6i33VTdzKF smYK/TGZn2ivJ8Jzp3Lzx5W9d3voGpZwzDun7mxJJJaediCBVu+Z56ORoz/RXaLrVCVU gjQyO9lgwzObTvx+zVJ0F7znVr7UEogZnw8TOI2Ks/XuqXvJa8/kxPUk5WkjWvB/XJ7s bqu09yW88y+cyfc6Jrh1foHjTpdpmt4Q3eO1sWYXeSaFrHGs0g2eyOzjTXWZnMtEJ1+J 1G+6iqUCdnABtwHnP19XxKVtqb6HDYYqRhpdKqpWHwn0Zab3nPZJXi4czlb29jK0Gjrl ITkw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:from:date:message-id:subject:to :content-type; bh=MHBbkKMjPAmzv2um/Oru1TixgPdXer6E3829nBEpKeY=; b=jqvuoBiRr7iPU8CxP3CrGB2kEFsYzLHYXcuCr6MekwSec3jRdm/ZN9cTB6wxKAYfE5 1WLTHvEB55fk1GYGezDmYYM9QcqPa3K1fjzpVPKvSsfeJd5gmL2MzNaeMIac76303Iub 25CVmBGG5m+mqzO8X/w+Qhn9eaO1qeLGVIGb0koYJxgKx06y+o1sosNEMGAvYoevVZ/4 5ekDItgV+KY4u+N7cZCPc7vXlR1MTuegEyMBMwrTlgTl/INyp7y6r6Fnqgcbg/gZs8VK 4lw8YbEZ6Id4+lJShh9yvxyDOd1c4Sdb/mCTFmRxY4sQfpU1thZZ+coit43PG3wE2QRc TJiw== X-Gm-Message-State: AG10YOQx5rvkPZpK/4guHiBOQhi8BkQ0NQU9nc3zuXTYQ9vOOmDQksPnaDpA1WMO81AY2Md+CGmT/NVwT8FFIA== X-Received: by 10.182.130.234 with SMTP id oh10mr26817221obb.58.1454452366637; Tue, 02 Feb 2016 14:32:46 -0800 (PST) MIME-Version: 1.0 Received: by 10.202.86.204 with HTTP; Tue, 2 Feb 2016 14:32:27 -0800 (PST) From: Dilip Simha Date: Tue, 2 Feb 2016 14:32:27 -0800 Message-ID: Subject: Request for information on bloated writes using Swift To: xfs@oss.sgi.com X-ASG-Orig-Subj: Request for information on bloated writes using Swift Content-Type: multipart/alternative; boundary=089e013a0112a80116052ad11447 X-Barracuda-Connect: mail-ob0-f179.google.com[209.85.214.179] X-Barracuda-Start-Time: 1454452367 X-Barracuda-Encrypted: ECDHE-RSA-AES128-GCM-SHA256 X-Barracuda-URL: https://192.48.157.11:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-BRTS-Status: 1 X-Barracuda-Spam-Score: 0.00 X-Barracuda-Spam-Status: No, SCORE=0.00 using per-user scores of TAG_LEVEL=1000.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.7 tests=DKIM_SIGNED, DKIM_VERIFIED, HTML_MESSAGE X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.3.26688 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- -0.00 DKIM_VERIFIED Domain Keys Identified Mail: signature passes verification 0.00 DKIM_SIGNED Domain Keys Identified Mail: message has a signature 0.00 HTML_MESSAGE BODY: HTML included in message --089e013a0112a80116052ad11447 Content-Type: text/plain; charset=UTF-8 Hi, I have a question regarding speculated preallocation in XFS, w.r.t kernel version: 3.16.0-46-generic. I am using Swift version: 1.0 and mkfs.xfs version 3.2.1 When I write a 256KiB file to Swift, I see that the underlying XFS uses 3x the amount of space/blocks to write that data. Upon performing detailed experiments, I see that when Swift uses fallocate (default approach), XFS doesn't reclaim the preallocated blocks that XFS allocated. Swift fallocate doesn't exceed the body size(256 KiB). Interestingly, when either allocsize=4k or when swift doesn't use fallocate, XFS doesn't consume additional space. Can you please let me know if this is a known bug and if its fixed in the later versions? Thanks & Regards, Dilip --089e013a0112a80116052ad11447 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
Hi,

I have a question regarding specula= ted preallocation in XFS, w.r.t kernel version: 3.16.0-46-generic.
I am using Swift version: 1.0 and mkfs.xfs version 3.2.1

When I write a 256KiB file to Swift, I see that the und= erlying XFS uses 3x the amount of space/blocks to write that data.
Upon performing detailed experiments, I see that when Swift uses fallocat= e (default approach), XFS doesn't reclaim the preallocated blocks that = XFS allocated. Swift fallocate doesn't exceed the body size(256 KiB).

Interestingly, when either allocsize=3D4k or when s= wift doesn't use fallocate, XFS doesn't consume additional space.

Can you please let me know if this is a known bug a= nd if its fixed in the later versions?

Thanks &= ; Regards,
Dilip
--089e013a0112a80116052ad11447-- From darrick.wong@oracle.com Tue Feb 2 17:06:44 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay2.corp.sgi.com [137.38.102.29]) by oss.sgi.com (Postfix) with ESMTP id DBD137CB0 for ; Tue, 2 Feb 2016 17:06:44 -0600 (CST) Received: from cuda.sgi.com (cuda3.sgi.com [192.48.176.15]) by relay2.corp.sgi.com (Postfix) with ESMTP id BD061304051 for ; Tue, 2 Feb 2016 15:06:41 -0800 (PST) X-ASG-Debug-ID: 1454454399-04cb6c37960b3f0001-NocioJ Received: from aserp1040.oracle.com (aserp1040.oracle.com [141.146.126.69]) by cuda.sgi.com with ESMTP id ZFLnCDJ8LenzIlCk (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO) for ; Tue, 02 Feb 2016 15:06:39 -0800 (PST) X-Barracuda-Envelope-From: darrick.wong@oracle.com X-Barracuda-Apparent-Source-IP: 141.146.126.69 Received: from userv0021.oracle.com (userv0021.oracle.com [156.151.31.71]) by aserp1040.oracle.com (Sentrion-MTA-4.3.2/Sentrion-MTA-4.3.2) with ESMTP id u12N6bSW006180 (version=TLSv1 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Tue, 2 Feb 2016 23:06:38 GMT Received: from aserv0122.oracle.com (aserv0122.oracle.com [141.146.126.236]) by userv0021.oracle.com (8.13.8/8.13.8) with ESMTP id u12N6bG2015978 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=FAIL); Tue, 2 Feb 2016 23:06:37 GMT Received: from abhmp0019.oracle.com (abhmp0019.oracle.com [141.146.116.25]) by aserv0122.oracle.com (8.13.8/8.13.8) with ESMTP id u12N6aPp007855; Tue, 2 Feb 2016 23:06:36 GMT Received: from localhost (/24.21.154.84) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Tue, 02 Feb 2016 15:06:36 -0800 Date: Tue, 2 Feb 2016 15:06:35 -0800 From: "Darrick J. Wong" To: Dave Chinner Cc: Brian Foster , xfs@oss.sgi.com Subject: Re: [RFCv4 00/76] xfs: add reverse-mapping, reflink, and dedupe support Message-ID: <20160202230635.GD22352@birch.djwong.org> X-ASG-Orig-Subj: Re: [RFCv4 00/76] xfs: add reverse-mapping, reflink, and dedupe support References: <20151219085622.12713.88678.stgit@birch.djwong.org> <20151220140254.GA3618@laptop.bfoster> <20160104235951.GE28330@birch.djwong.org> <20160105124226.GA38749@bfoster.bfoster> <20160106020440.GL28330@birch.djwong.org> <20160106034415.GH21461@dastard> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20160106034415.GH21461@dastard> User-Agent: Mutt/1.5.21 (2010-09-15) X-Source-IP: userv0021.oracle.com [156.151.31.71] X-Barracuda-Connect: aserp1040.oracle.com[141.146.126.69] X-Barracuda-Start-Time: 1454454399 X-Barracuda-Encrypted: ECDHE-RSA-AES256-GCM-SHA384 X-Barracuda-URL: https://192.48.176.15:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-BRTS-Status: 1 X-Barracuda-Spam-Score: 0.00 X-Barracuda-Spam-Status: No, SCORE=0.00 using per-user scores of TAG_LEVEL=1000.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.7 tests=BSF_SC0_MISMATCH_TO, UNPARSEABLE_RELAY X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.3.26689 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 0.00 BSF_SC0_MISMATCH_TO Envelope rcpt doesn't match header 0.00 UNPARSEABLE_RELAY Informational: message has unparseable relay lines On Wed, Jan 06, 2016 at 02:44:15PM +1100, Dave Chinner wrote: > On Tue, Jan 05, 2016 at 06:04:40PM -0800, Darrick J. Wong wrote: > > On Tue, Jan 05, 2016 at 07:42:26AM -0500, Brian Foster wrote: > > > On Mon, Jan 04, 2016 at 03:59:51PM -0800, Darrick J. Wong wrote: > > > > I've temporarily fixed this by adding code that figures out how many blocks we > > > > need if the reference count btree has to have a unique record for every block > > > > in the AG and holding that many blocks until either they're allocated to the > > > > refcount btree or freed at umount time. Right now it's a temporary fix (if the > > > > FS crashes, the reserved blocks are lost) but it wouldn't be difficult for the > > > > FS to make a permanent reservation that's recorded on disk somehow. But that's > > > > involves writing things to disk + making xfsprogs understand the reservation; > > > > let's see what people say about the reserved pool idea at all. > > > > > > > > Does that make sense? :) > > > > > > > > > > Yep, it sounds sort of like the reserve pool mechanism used to protect > > > against ENOSPC when freeing blocks. Curious... why are the reserved > > > blocks lost on fs crash? Wouldn't they be reserved again on the > > > subsequent mount? > > > > They will, but the pre-crash reservation isn't (yet) written down anywhere on > > disk. > > Does it need to be? The global reserve pool is not "written down" > anywhere. When we mount, we pull the reserve from the global free > space accounting. Hence we given ENOSPC when we've used "total fs > blocks - reserve pool blocks" in memory, and so if we crash we've > still got at least that many free blocks on disk. hence on mount we > re-reserve those blocks in memory and everything is back to the way > it was prior to the crash. > > I suspect the per-ag code is a bit different, but it should be able > to work the same way. i.e. when we initialise the per-ag structure, > we pull the reserve from the free block count in the AG, as well as > from the global free space count. Then we will get correct global > ENOSPC detection, as well as leave enough space free in each AG as > we scan and skip them during allocation... > > As long as the per-ag reservation is restored during mount before we > do EFI recovery processing (i.e. between the two log recovery > phases), it should restore the reserve pool to the same size as it > was before a crash occurred.... > > Unless, of course, I'm missing something newly introduced by the > reflink code... Technically you were, but I've fixed the reservation code to exist purely as in-core magic that works more or less how you outlined above. No more on-disk artifacts, no more need to write a persistence and recovery mechanism. :) --D > > Cheers, > > Dave. > -- > Dave Chinner > david@fromorbit.com From ross.zwisler@linux.intel.com Tue Feb 2 17:12:17 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=ham version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay1.corp.sgi.com [137.38.102.111]) by oss.sgi.com (Postfix) with ESMTP id 09DD07CB0 for ; Tue, 2 Feb 2016 17:12:17 -0600 (CST) Received: from cuda.sgi.com (cuda2.sgi.com [192.48.176.25]) by relay1.corp.sgi.com (Postfix) with ESMTP id EFA108F8033 for ; Tue, 2 Feb 2016 15:12:13 -0800 (PST) X-ASG-Debug-ID: 1454454732-04cbb04c960d000001-NocioJ Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) by cuda.sgi.com with ESMTP id hqJxfgFBZNN1t5A5 for ; Tue, 02 Feb 2016 15:12:12 -0800 (PST) X-Barracuda-Envelope-From: ross.zwisler@linux.intel.com X-Barracuda-Apparent-Source-IP: 134.134.136.24 X-ASG-Whitelist: Client Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by orsmga102.jf.intel.com with ESMTP; 02 Feb 2016 15:11:52 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.22,386,1449561600"; d="scan'208";a="895075611" Received: from rzwisler-desk.amr.corp.intel.com (HELO phyrexia.intel.com) ([10.252.195.239]) by fmsmga001.fm.intel.com with ESMTP; 02 Feb 2016 15:11:49 -0800 From: Ross Zwisler To: linux-kernel@vger.kernel.org Cc: Ross Zwisler , "J. Bruce Fields" , Alexander Viro , Andrew Morton , Dan Williams , Dave Chinner , Jan Kara , Jeff Layton , Matthew Wilcox , linux-fsdevel@vger.kernel.org, linux-nvdimm@lists.01.org, xfs@oss.sgi.com Subject: [PATCH] dax: allow DAX to look up an inode's block device Date: Tue, 2 Feb 2016 16:11:42 -0700 X-ASG-Orig-Subj: [PATCH] dax: allow DAX to look up an inode's block device Message-Id: <1454454702-11889-1-git-send-email-ross.zwisler@linux.intel.com> X-Mailer: git-send-email 2.5.0 X-Barracuda-Connect: mga09.intel.com[134.134.136.24] X-Barracuda-Start-Time: 1454454732 X-Barracuda-URL: https://192.48.176.25:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-BRTS-Status: 1 There are a number of places in dax.c that look up the struct block_device associated with an inode. Previously this was done by just using inode->i_sb->s_bdev. This is correct in some cases, such as when using ext2 and ext4. However, for raw block devices and for XFS with a real-time device, the value in inode->i_sb->s_bdev is not correct. With the code as it is currently written, an fsync or msync to a DAX enabled raw block device will cause a NULL pointer dereference kernel BUG. For this to work correctly we need to ask the block device or filesystem what struct block_device is appropriate for our inode. To that end, add a get_bdev(struct inode *) entry point to struct super_operations. If this function pointer is non-NULL, this notifies DAX that it needs to use it to look up the correct block_device. If i_sb->get_bdev() is NULL DAX will default to inode->i_sb->s_bdev. I added the function to super_operations instead of another alternative like inode_operations because the function pointer varies by filesystem or block device, not per inode. I believe that this will also save memory because there is only one struct super_operations per mounted filesystem but there could be many struct inode_operations and there is no need to keep many copies of the same function pointer in memory. Signed-off-by: Ross Zwisler --- fs/block_dev.c | 6 ++++++ fs/dax.c | 20 ++++++++++++++------ fs/xfs/xfs_aops.c | 2 +- fs/xfs/xfs_aops.h | 1 + fs/xfs/xfs_super.c | 1 + include/linux/fs.h | 1 + 6 files changed, 24 insertions(+), 7 deletions(-) diff --git a/fs/block_dev.c b/fs/block_dev.c index fa0507a..845b049 100644 --- a/fs/block_dev.c +++ b/fs/block_dev.c @@ -156,6 +156,11 @@ blkdev_get_block(struct inode *inode, sector_t iblock, return 0; } +static struct block_device *blkdev_get_bdev(struct inode *inode) +{ + return I_BDEV(inode); +} + static struct inode *bdev_file_inode(struct file *file) { return file->f_mapping->host; @@ -569,6 +574,7 @@ static const struct super_operations bdev_sops = { .alloc_inode = bdev_alloc_inode, .destroy_inode = bdev_destroy_inode, .drop_inode = generic_delete_inode, + .get_bdev = blkdev_get_bdev, .evict_inode = bdev_evict_inode, }; diff --git a/fs/dax.c b/fs/dax.c index 227974a..c701ea4 100644 --- a/fs/dax.c +++ b/fs/dax.c @@ -32,6 +32,14 @@ #include #include +static struct block_device *dax_get_bdev(struct inode *inode) +{ + if (inode->i_sb->s_op->get_bdev) + return inode->i_sb->s_op->get_bdev(inode); + else + return inode->i_sb->s_bdev; +} + static long dax_map_atomic(struct block_device *bdev, struct blk_dax_ctl *dax) { struct request_queue *q = bdev->bd_queue; @@ -85,7 +93,7 @@ struct page *read_dax_sector(struct block_device *bdev, sector_t n) */ int dax_clear_blocks(struct inode *inode, sector_t block, long _size) { - struct block_device *bdev = inode->i_sb->s_bdev; + struct block_device *bdev = dax_get_bdev(inode); struct blk_dax_ctl dax = { .sector = block << (inode->i_blkbits - 9), .size = _size, @@ -266,7 +274,7 @@ ssize_t dax_do_io(struct kiocb *iocb, struct inode *inode, loff_t end = pos + iov_iter_count(iter); memset(&bh, 0, sizeof(bh)); - bh.b_bdev = inode->i_sb->s_bdev; + bh.b_bdev = dax_get_bdev(inode); if ((flags & DIO_LOCKING) && iov_iter_rw(iter) == READ) { struct address_space *mapping = inode->i_mapping; @@ -488,7 +496,7 @@ int dax_writeback_mapping_range(struct address_space *mapping, loff_t start, loff_t end) { struct inode *inode = mapping->host; - struct block_device *bdev = inode->i_sb->s_bdev; + struct block_device *bdev = dax_get_bdev(inode); pgoff_t start_index, end_index, pmd_index; pgoff_t indices[PAGEVEC_SIZE]; struct pagevec pvec; @@ -628,7 +636,7 @@ int __dax_fault(struct vm_area_struct *vma, struct vm_fault *vmf, memset(&bh, 0, sizeof(bh)); block = (sector_t)vmf->pgoff << (PAGE_SHIFT - blkbits); - bh.b_bdev = inode->i_sb->s_bdev; + bh.b_bdev = dax_get_bdev(inode); bh.b_size = PAGE_SIZE; repeat: @@ -847,7 +855,7 @@ int __dax_pmd_fault(struct vm_area_struct *vma, unsigned long address, } memset(&bh, 0, sizeof(bh)); - bh.b_bdev = inode->i_sb->s_bdev; + bh.b_bdev = dax_get_bdev(inode); block = (sector_t)pgoff << (PAGE_SHIFT - blkbits); bh.b_size = PMD_SIZE; @@ -1100,7 +1108,7 @@ int dax_zero_page_range(struct inode *inode, loff_t from, unsigned length, BUG_ON((offset + length) > PAGE_CACHE_SIZE); memset(&bh, 0, sizeof(bh)); - bh.b_bdev = inode->i_sb->s_bdev; + bh.b_bdev = dax_get_bdev(inode); bh.b_size = PAGE_CACHE_SIZE; err = get_block(inode, index, &bh, 0); if (err < 0) diff --git a/fs/xfs/xfs_aops.c b/fs/xfs/xfs_aops.c index 379c089..fc20518 100644 --- a/fs/xfs/xfs_aops.c +++ b/fs/xfs/xfs_aops.c @@ -55,7 +55,7 @@ xfs_count_page_state( } while ((bh = bh->b_this_page) != head); } -STATIC struct block_device * +struct block_device * xfs_find_bdev_for_inode( struct inode *inode) { diff --git a/fs/xfs/xfs_aops.h b/fs/xfs/xfs_aops.h index f6ffc9a..a4343c6 100644 --- a/fs/xfs/xfs_aops.h +++ b/fs/xfs/xfs_aops.h @@ -62,5 +62,6 @@ int xfs_get_blocks_dax_fault(struct inode *inode, sector_t offset, struct buffer_head *map_bh, int create); extern void xfs_count_page_state(struct page *, int *, int *); +extern struct block_device *xfs_find_bdev_for_inode(struct inode *); #endif /* __XFS_AOPS_H__ */ diff --git a/fs/xfs/xfs_super.c b/fs/xfs/xfs_super.c index 59c9b7b..26e7051 100644 --- a/fs/xfs/xfs_super.c +++ b/fs/xfs/xfs_super.c @@ -1623,6 +1623,7 @@ static const struct super_operations xfs_super_operations = { .destroy_inode = xfs_fs_destroy_inode, .evict_inode = xfs_fs_evict_inode, .drop_inode = xfs_fs_drop_inode, + .get_bdev = xfs_find_bdev_for_inode, .put_super = xfs_fs_put_super, .sync_fs = xfs_fs_sync_fs, .freeze_fs = xfs_fs_freeze, diff --git a/include/linux/fs.h b/include/linux/fs.h index b10002d..5b636eb 100644 --- a/include/linux/fs.h +++ b/include/linux/fs.h @@ -1730,6 +1730,7 @@ struct super_operations { int (*write_inode) (struct inode *, struct writeback_control *wbc); int (*drop_inode) (struct inode *); void (*evict_inode) (struct inode *); + struct block_device *(*get_bdev) (struct inode *); void (*put_super) (struct super_block *); int (*sync_fs)(struct super_block *sb, int wait); int (*freeze_super) (struct super_block *); -- 2.5.0 From viro@ftp.linux.org.uk Tue Feb 2 17:19:49 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=ham version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay3.corp.sgi.com [198.149.34.15]) by oss.sgi.com (Postfix) with ESMTP id 547227CB0 for ; Tue, 2 Feb 2016 17:19:49 -0600 (CST) Received: from cuda.sgi.com (cuda3.sgi.com [192.48.176.15]) by relay3.corp.sgi.com (Postfix) with ESMTP id D88B5AC004 for ; Tue, 2 Feb 2016 15:19:45 -0800 (PST) X-ASG-Debug-ID: 1454455181-04cb6c37960b830001-NocioJ Received: from ZenIV.linux.org.uk (zeniv.linux.org.uk [195.92.253.2]) by cuda.sgi.com with ESMTP id SfoMULraO9o5zbJk (version=TLSv1 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Tue, 02 Feb 2016 15:19:42 -0800 (PST) X-Barracuda-Envelope-From: viro@ftp.linux.org.uk X-Barracuda-Apparent-Source-IP: 195.92.253.2 Received: from viro by ZenIV.linux.org.uk with local (Exim 4.76 #1 (Red Hat Linux)) id 1aQkEN-00041Z-QF; Tue, 02 Feb 2016 23:19:31 +0000 Date: Tue, 2 Feb 2016 23:19:31 +0000 From: Al Viro To: Ross Zwisler Cc: linux-kernel@vger.kernel.org, "J. Bruce Fields" , Andrew Morton , Dan Williams , Dave Chinner , Jan Kara , Jeff Layton , Matthew Wilcox , linux-fsdevel@vger.kernel.org, linux-nvdimm@ml01.01.org, xfs@oss.sgi.com Subject: Re: [PATCH] dax: allow DAX to look up an inode's block device Message-ID: <20160202231931.GR17997@ZenIV.linux.org.uk> X-ASG-Orig-Subj: Re: [PATCH] dax: allow DAX to look up an inode's block device References: <1454454702-11889-1-git-send-email-ross.zwisler@linux.intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1454454702-11889-1-git-send-email-ross.zwisler@linux.intel.com> User-Agent: Mutt/1.5.21 (2010-09-15) Sender: Al Viro X-Barracuda-Connect: zeniv.linux.org.uk[195.92.253.2] X-Barracuda-Start-Time: 1454455182 X-Barracuda-Encrypted: DHE-RSA-AES256-SHA X-Barracuda-URL: https://192.48.176.15:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-BRTS-Status: 1 X-Barracuda-Spam-Score: 0.00 X-Barracuda-Spam-Status: No, SCORE=0.00 using per-user scores of TAG_LEVEL=1000.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.7 tests=BSF_SC0_MISMATCH_TO X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.3.26690 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 0.00 BSF_SC0_MISMATCH_TO Envelope rcpt doesn't match header On Tue, Feb 02, 2016 at 04:11:42PM -0700, Ross Zwisler wrote: > However, for raw block devices and for XFS with a real-time device, the > value in inode->i_sb->s_bdev is not correct. With the code as it is > currently written, an fsync or msync to a DAX enabled raw block device will > cause a NULL pointer dereference kernel BUG. For this to work correctly we > need to ask the block device or filesystem what struct block_device is > appropriate for our inode. > > To that end, add a get_bdev(struct inode *) entry point to struct > super_operations. If this function pointer is non-NULL, this notifies DAX > that it needs to use it to look up the correct block_device. If > i_sb->get_bdev() is NULL DAX will default to inode->i_sb->s_bdev. Umm... It assumes that bdev will stay pinned for as long as inode is referenced, presumably? If so, that needs to be documented (and verified for existing fs instances). In principle, multi-disk fs might want to support things like "silently move the inodes backed by that disk to other ones"... From darrick.wong@oracle.com Tue Feb 2 17:27:47 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay1.corp.sgi.com [137.38.102.111]) by oss.sgi.com (Postfix) with ESMTP id C4DAC7CAF for ; Tue, 2 Feb 2016 17:27:47 -0600 (CST) Received: from cuda.sgi.com (cuda1.sgi.com [192.48.157.11]) by relay1.corp.sgi.com (Postfix) with ESMTP id 7EC4A8F8040 for ; Tue, 2 Feb 2016 15:27:44 -0800 (PST) X-ASG-Debug-ID: 1454455661-04bdf070510bf90001-NocioJ Received: from userp1040.oracle.com (userp1040.oracle.com [156.151.31.81]) by cuda.sgi.com with ESMTP id 2QLkUfEf54er4p0j (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO) for ; Tue, 02 Feb 2016 15:27:42 -0800 (PST) X-Barracuda-Envelope-From: darrick.wong@oracle.com X-Barracuda-Apparent-Source-IP: 156.151.31.81 Received: from userv0022.oracle.com (userv0022.oracle.com [156.151.31.74]) by userp1040.oracle.com (Sentrion-MTA-4.3.2/Sentrion-MTA-4.3.2) with ESMTP id u12NReN5022239 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 2 Feb 2016 23:27:40 GMT Received: from aserv0121.oracle.com (aserv0121.oracle.com [141.146.126.235]) by userv0022.oracle.com (8.14.4/8.13.8) with ESMTP id u12NRdEn025122 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=FAIL); Tue, 2 Feb 2016 23:27:40 GMT Received: from abhmp0019.oracle.com (abhmp0019.oracle.com [141.146.116.25]) by aserv0121.oracle.com (8.13.8/8.13.8) with ESMTP id u12NRdrP015806; Tue, 2 Feb 2016 23:27:39 GMT Received: from localhost (/24.21.154.84) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Tue, 02 Feb 2016 15:27:38 -0800 Date: Tue, 2 Feb 2016 15:27:35 -0800 From: "Darrick J. Wong" To: Brian Foster Cc: david@fromorbit.com, xfs@oss.sgi.com Subject: Re: [PATCH 3/3] xfs: check sizes of XFS on-disk structures at compile time Message-ID: <20160202232735.GE22352@birch.djwong.org> X-ASG-Orig-Subj: Re: [PATCH 3/3] xfs: check sizes of XFS on-disk structures at compile time References: <20160123003425.2338.18133.stgit@birch.djwong.org> <20160123003444.2338.37236.stgit@birch.djwong.org> <20160127133117.GD60730@bfoster.bfoster> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20160127133117.GD60730@bfoster.bfoster> User-Agent: Mutt/1.5.21 (2010-09-15) X-Source-IP: userv0022.oracle.com [156.151.31.74] X-Barracuda-Connect: userp1040.oracle.com[156.151.31.81] X-Barracuda-Start-Time: 1454455661 X-Barracuda-Encrypted: ECDHE-RSA-AES256-GCM-SHA384 X-Barracuda-URL: https://192.48.157.11:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-BRTS-Status: 1 X-Barracuda-Spam-Score: 0.00 X-Barracuda-Spam-Status: No, SCORE=0.00 using per-user scores of TAG_LEVEL=1000.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.7 tests=BSF_SC0_MISMATCH_TO, UNPARSEABLE_RELAY X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.3.26690 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 0.00 BSF_SC0_MISMATCH_TO Envelope rcpt doesn't match header 0.00 UNPARSEABLE_RELAY Informational: message has unparseable relay lines On Wed, Jan 27, 2016 at 08:31:17AM -0500, Brian Foster wrote: > On Fri, Jan 22, 2016 at 04:34:44PM -0800, Darrick J. Wong wrote: > > Check the sizes of XFS on-disk structures when compiling the kernel. > > Use this to catch inadvertent changes in structure size due to padding > > and alignment issues, etc. > > > > Signed-off-by: Darrick J. Wong > > --- > > fs/xfs/xfs_ondisk.h | 108 +++++++++++++++++++++++++++++++++++++++++++++++++++ > > fs/xfs/xfs_super.c | 3 + > > 2 files changed, 111 insertions(+) > > create mode 100644 fs/xfs/xfs_ondisk.h > > > > > > diff --git a/fs/xfs/xfs_ondisk.h b/fs/xfs/xfs_ondisk.h > > new file mode 100644 > > index 0000000..56fab46 > > --- /dev/null > > +++ b/fs/xfs/xfs_ondisk.h > > @@ -0,0 +1,108 @@ > > +/* > > + * Copyright (c) 2016 Oracle. > > + * All Rights Reserved. > > + * > > + * This program is free software; you can redistribute it and/or > > + * modify it under the terms of the GNU General Public License as > > + * published by the Free Software Foundation. > > + * > > + * This program is distributed in the hope that it would be useful, > > + * but WITHOUT ANY WARRANTY; without even the implied warranty of > > + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the > > + * GNU General Public License for more details. > > + * > > + * You should have received a copy of the GNU General Public License > > + * along with this program; if not, write the Free Software Foundation, > > + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA > > + */ > > +#ifndef __XFS_ONDISK_H > > +#define __XFS_ONDISK_H > > + > > +#define XFS_CHECK_STRUCT_SIZE(structname, size) \ > > + BUILD_BUG_ON_MSG(sizeof(structname) != (size), "XFS: sizeof(struct " \ > > We're printing "struct" in the core message as well as part of the > structname (where appropriate). E.g., "sizeof(struct struct xfs_acl) is > wrong, ..." Heh, fixed. > It would also be nice to include the current structure size in the > message if it happens to be unexpected. Otherwise, seems fine to me. I don't think it's possible to pass the size to __attribute__((error(msg...)))? gcc only seems only to accept string arguments to the error() attribute. --D > > Brian > > > + #structname ") is wrong, expected " #size) > > + > > > +static inline void __init > > +xfs_check_ondisk_structs(void) > > +{ > > + /* ag/file structures */ > > + XFS_CHECK_STRUCT_SIZE(struct xfs_acl, 4); > > + XFS_CHECK_STRUCT_SIZE(struct xfs_acl_entry, 12); > > + XFS_CHECK_STRUCT_SIZE(struct xfs_agf, 224); > > + XFS_CHECK_STRUCT_SIZE(struct xfs_agfl, 36); > > + XFS_CHECK_STRUCT_SIZE(struct xfs_agi, 336); > > + XFS_CHECK_STRUCT_SIZE(struct xfs_bmbt_key, 8); > > + XFS_CHECK_STRUCT_SIZE(struct xfs_bmbt_rec, 16); > > + XFS_CHECK_STRUCT_SIZE(struct xfs_bmdr_block, 4); > > + XFS_CHECK_STRUCT_SIZE(struct xfs_btree_block, 72); > > + XFS_CHECK_STRUCT_SIZE(struct xfs_dinode, 176); > > + XFS_CHECK_STRUCT_SIZE(struct xfs_disk_dquot, 104); > > + XFS_CHECK_STRUCT_SIZE(struct xfs_dqblk, 136); > > + XFS_CHECK_STRUCT_SIZE(struct xfs_dsb, 264); > > + XFS_CHECK_STRUCT_SIZE(struct xfs_dsymlink_hdr, 56); > > + XFS_CHECK_STRUCT_SIZE(struct xfs_inobt_key, 4); > > + XFS_CHECK_STRUCT_SIZE(struct xfs_inobt_rec, 16); > > + XFS_CHECK_STRUCT_SIZE(struct xfs_timestamp, 8); > > + XFS_CHECK_STRUCT_SIZE(xfs_alloc_key_t, 8); > > + XFS_CHECK_STRUCT_SIZE(xfs_alloc_ptr_t, 4); > > + XFS_CHECK_STRUCT_SIZE(xfs_alloc_rec_t, 8); > > + XFS_CHECK_STRUCT_SIZE(xfs_inobt_ptr_t, 4); > > + > > + /* dir/attr trees */ > > + XFS_CHECK_STRUCT_SIZE(struct xfs_attr3_leaf_hdr, 80); > > + XFS_CHECK_STRUCT_SIZE(struct xfs_attr3_leafblock, 88); > > + XFS_CHECK_STRUCT_SIZE(struct xfs_attr3_rmt_hdr, 56); > > + XFS_CHECK_STRUCT_SIZE(struct xfs_da3_blkinfo, 56); > > + XFS_CHECK_STRUCT_SIZE(struct xfs_da3_intnode, 64); > > + XFS_CHECK_STRUCT_SIZE(struct xfs_da3_node_hdr, 64); > > + XFS_CHECK_STRUCT_SIZE(struct xfs_dir3_blk_hdr, 48); > > + XFS_CHECK_STRUCT_SIZE(struct xfs_dir3_data_hdr, 64); > > + XFS_CHECK_STRUCT_SIZE(struct xfs_dir3_free, 64); > > + XFS_CHECK_STRUCT_SIZE(struct xfs_dir3_free_hdr, 64); > > + XFS_CHECK_STRUCT_SIZE(struct xfs_dir3_leaf, 64); > > + XFS_CHECK_STRUCT_SIZE(struct xfs_dir3_leaf_hdr, 64); > > + XFS_CHECK_STRUCT_SIZE(xfs_attr_leaf_entry_t, 8); > > + XFS_CHECK_STRUCT_SIZE(xfs_attr_leaf_hdr_t, 32); > > + XFS_CHECK_STRUCT_SIZE(xfs_attr_leaf_map_t, 4); > > + XFS_CHECK_STRUCT_SIZE(xfs_attr_leaf_name_local_t, 4); > > + XFS_CHECK_STRUCT_SIZE(xfs_attr_leaf_name_remote_t, 12); > > + XFS_CHECK_STRUCT_SIZE(xfs_attr_leafblock_t, 40); > > + XFS_CHECK_STRUCT_SIZE(xfs_attr_shortform_t, 8); > > + XFS_CHECK_STRUCT_SIZE(xfs_da_blkinfo_t, 12); > > + XFS_CHECK_STRUCT_SIZE(xfs_da_intnode_t, 16); > > + XFS_CHECK_STRUCT_SIZE(xfs_da_node_entry_t, 8); > > + XFS_CHECK_STRUCT_SIZE(xfs_da_node_hdr_t, 16); > > + XFS_CHECK_STRUCT_SIZE(xfs_dir2_data_free_t, 4); > > + XFS_CHECK_STRUCT_SIZE(xfs_dir2_data_hdr_t, 16); > > + XFS_CHECK_STRUCT_SIZE(xfs_dir2_data_unused_t, 6); > > + XFS_CHECK_STRUCT_SIZE(xfs_dir2_free_hdr_t, 16); > > + XFS_CHECK_STRUCT_SIZE(xfs_dir2_free_t, 16); > > + XFS_CHECK_STRUCT_SIZE(xfs_dir2_ino4_t, 4); > > + XFS_CHECK_STRUCT_SIZE(xfs_dir2_ino8_t, 8); > > + XFS_CHECK_STRUCT_SIZE(xfs_dir2_inou_t, 8); > > + XFS_CHECK_STRUCT_SIZE(xfs_dir2_leaf_entry_t, 8); > > + XFS_CHECK_STRUCT_SIZE(xfs_dir2_leaf_hdr_t, 16); > > + XFS_CHECK_STRUCT_SIZE(xfs_dir2_leaf_t, 16); > > + XFS_CHECK_STRUCT_SIZE(xfs_dir2_leaf_tail_t, 4); > > + XFS_CHECK_STRUCT_SIZE(xfs_dir2_sf_entry_t, 3); > > + XFS_CHECK_STRUCT_SIZE(xfs_dir2_sf_hdr_t, 10); > > + XFS_CHECK_STRUCT_SIZE(xfs_dir2_sf_off_t, 2); > > + > > + /* log structures */ > > + XFS_CHECK_STRUCT_SIZE(struct xfs_dq_logformat, 24); > > + XFS_CHECK_STRUCT_SIZE(struct xfs_efd_log_format_32, 28); > > + XFS_CHECK_STRUCT_SIZE(struct xfs_efd_log_format_64, 32); > > + XFS_CHECK_STRUCT_SIZE(struct xfs_efi_log_format_32, 28); > > + XFS_CHECK_STRUCT_SIZE(struct xfs_efi_log_format_64, 32); > > + XFS_CHECK_STRUCT_SIZE(struct xfs_extent_32, 12); > > + XFS_CHECK_STRUCT_SIZE(struct xfs_extent_64, 16); > > + XFS_CHECK_STRUCT_SIZE(struct xfs_icdinode, 176); > > + XFS_CHECK_STRUCT_SIZE(struct xfs_icreate_log, 28); > > + XFS_CHECK_STRUCT_SIZE(struct xfs_ictimestamp, 8); > > + XFS_CHECK_STRUCT_SIZE(struct xfs_inode_log_format_32, 52); > > + XFS_CHECK_STRUCT_SIZE(struct xfs_inode_log_format_64, 56); > > + XFS_CHECK_STRUCT_SIZE(struct xfs_qoff_logformat, 20); > > + XFS_CHECK_STRUCT_SIZE(struct xfs_trans_header, 16); > > +} > > + > > +#endif /* __XFS_ONDISK_H */ > > diff --git a/fs/xfs/xfs_super.c b/fs/xfs/xfs_super.c > > index 36bd882..f63d212 100644 > > --- a/fs/xfs/xfs_super.c > > +++ b/fs/xfs/xfs_super.c > > @@ -45,6 +45,7 @@ > > #include "xfs_filestream.h" > > #include "xfs_quota.h" > > #include "xfs_sysfs.h" > > +#include "xfs_ondisk.h" > > > > #include > > #include > > @@ -1817,6 +1818,8 @@ init_xfs_fs(void) > > { > > int error; > > > > + xfs_check_ondisk_structs(); > > + > > printk(KERN_INFO XFS_VERSION_STRING " with " > > XFS_BUILD_OPTIONS " enabled\n"); > > > > > > _______________________________________________ > > xfs mailing list > > xfs@oss.sgi.com > > http://oss.sgi.com/mailman/listinfo/xfs From jaredeh@gmail.com Tue Feb 2 17:36:10 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=FREEMAIL_FROM,T_DKIM_INVALID autolearn=ham version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay3.corp.sgi.com [198.149.34.15]) by oss.sgi.com (Postfix) with ESMTP id C27F87CB0 for ; Tue, 2 Feb 2016 17:36:10 -0600 (CST) Received: from cuda.sgi.com (cuda2.sgi.com [192.48.176.25]) by relay3.corp.sgi.com (Postfix) with ESMTP id 1B862AC004 for ; Tue, 2 Feb 2016 15:36:07 -0800 (PST) X-ASG-Debug-ID: 1454456163-04cbb04c950dae0001-NocioJ Received: from mail-wm0-f46.google.com (mail-wm0-f46.google.com [74.125.82.46]) by cuda.sgi.com with ESMTP id haSTy6dTDWeYetEO (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128 verify=NO) for ; Tue, 02 Feb 2016 15:36:04 -0800 (PST) X-Barracuda-Envelope-From: jaredeh@gmail.com X-Barracuda-Apparent-Source-IP: 74.125.82.46 Received: by mail-wm0-f46.google.com with SMTP id l66so46135330wml.0 for ; Tue, 02 Feb 2016 15:36:04 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=m2WWFRaBr1v0/LTM8SPdsyNP+ctbJ6cPPIkSOi5nfuA=; b=L+TG+3HkSD9OcofD/p810n95pfu1sLu3Ce7+SY3jvLrOHEIKRFeqgyzFNSwwuHTARm HHVf2E26QP3rRAAAFQ1ijMq5uWHg5VEU2rwLTjWGlf4o4MRbZFZ0uF5bAT3NFhXHudxL 7bL2Imj82G79aD6M25TytxkOO9MfO6w2AlIyPsZ5m9Sb1yII0mDoXHAiWLDc0qg9rWVd tnIfmxjDW8Rn7aWaPU5WsYLD+ze/ImoeR+4Ngk27PmhYsIe45/rGKCrqsuj164wHH0bC SCVcmOm3uMAJALrWSwon3ptDXTKhKYJNl/uXfOLAHnjgNKJAl6i50xqhrQyQzXD0J0Dg biOg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:date :message-id:subject:from:to:cc:content-type; bh=m2WWFRaBr1v0/LTM8SPdsyNP+ctbJ6cPPIkSOi5nfuA=; b=PcSk+Iehgba9zpQr5XKOluN9dlKuMHHyPvo2O/4iMH8hBJq4m39vp/Jph1FGdCbyfA EtUyzQtd6G9TFCuem/Nb+W04/lqIAif2oZCdl5hNGQQwxoWImYFMbEWQP15vb8HwgYG2 gBckCkpzp3MNvzk6h+859HXwjG4MECN4Ojsn72s5mp+CvUwwNyEWgzjMIjZnmUILFITw ODKSa09n6TzId62hPNkksGSe4znp08lGGZSeDs2qSIiQaH8twEowJGANHGLGXgE7P8Do kbAt7aKFEzwVdoTnkAQK0y+nTgmo38woU4506NYw5YA7BOZgSbgCvPzVo/XdV90iUhII E4+Q== X-Gm-Message-State: AG10YOQUh9XO8Kj+Art3bjc/XI+b+bb8ljioh1oo7WB7WfRhCvjB8TstkUuB8sQaiE/Us5RjtsIof7XcP+VWgA== MIME-Version: 1.0 X-Received: by 10.194.117.169 with SMTP id kf9mr31187403wjb.122.1454456163456; Tue, 02 Feb 2016 15:36:03 -0800 (PST) Received: by 10.27.12.21 with HTTP; Tue, 2 Feb 2016 15:36:03 -0800 (PST) In-Reply-To: <20160202231931.GR17997@ZenIV.linux.org.uk> References: <1454454702-11889-1-git-send-email-ross.zwisler@linux.intel.com> <20160202231931.GR17997@ZenIV.linux.org.uk> Date: Tue, 2 Feb 2016 15:36:03 -0800 Message-ID: Subject: Re: [PATCH] dax: allow DAX to look up an inode's block device From: Jared Hulbert X-ASG-Orig-Subj: Re: [PATCH] dax: allow DAX to look up an inode's block device To: Al Viro , Dan Williams Cc: Ross Zwisler , Jeff Layton , linux-nvdimm , Dave Chinner , LKML , xfs@oss.sgi.com, "J. Bruce Fields" , Jan Kara , Linux FS Devel , Andrew Morton Content-Type: text/plain; charset=UTF-8 X-Barracuda-Connect: mail-wm0-f46.google.com[74.125.82.46] X-Barracuda-Start-Time: 1454456164 X-Barracuda-Encrypted: ECDHE-RSA-AES128-GCM-SHA256 X-Barracuda-URL: https://192.48.176.25:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-BRTS-Status: 1 X-Barracuda-Spam-Score: 0.00 X-Barracuda-Spam-Status: No, SCORE=0.00 using per-user scores of TAG_LEVEL=1000.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.7 tests=BSF_SC0_MISMATCH_TO, DKIM_SIGNED, DKIM_VERIFIED X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.3.26690 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 0.00 BSF_SC0_MISMATCH_TO Envelope rcpt doesn't match header -0.00 DKIM_VERIFIED Domain Keys Identified Mail: signature passes verification 0.00 DKIM_SIGNED Domain Keys Identified Mail: message has a signature On Tue, Feb 2, 2016 at 3:19 PM, Al Viro wrote: > > On Tue, Feb 02, 2016 at 04:11:42PM -0700, Ross Zwisler wrote: > > > However, for raw block devices and for XFS with a real-time device, the > > value in inode->i_sb->s_bdev is not correct. With the code as it is > > currently written, an fsync or msync to a DAX enabled raw block device will > > cause a NULL pointer dereference kernel BUG. For this to work correctly we > > need to ask the block device or filesystem what struct block_device is > > appropriate for our inode. > > > > To that end, add a get_bdev(struct inode *) entry point to struct > > super_operations. If this function pointer is non-NULL, this notifies DAX > > that it needs to use it to look up the correct block_device. If > > i_sb->get_bdev() is NULL DAX will default to inode->i_sb->s_bdev. > > Umm... It assumes that bdev will stay pinned for as long as inode is > referenced, presumably? If so, that needs to be documented (and verified > for existing fs instances). In principle, multi-disk fs might want to > support things like "silently move the inodes backed by that disk to other > ones"... Dan, This is exactly the kind of thing I'm taking about WRT the weirder device models and directly calling bdev_direct_access(). Filesystems don't have the monogamous relationship with a device that is implicitly assumed in DAX, you have to ask the filesystem what the relationship is and is migrating to, and allow the filesystem to update DAX when the relationship is changing. As we start to see many DIMM's and 10s TiB pmem systems this is going be an even bigger deal as load balancing, wear leveling, and fault tolerance concerned are inevitably driven by the filesystem. From dan.j.williams@intel.com Tue Feb 2 17:38:20 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=T_DKIM_INVALID autolearn=ham version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay1.corp.sgi.com [137.38.102.111]) by oss.sgi.com (Postfix) with ESMTP id 676CB7CB0 for ; Tue, 2 Feb 2016 17:38:20 -0600 (CST) Received: from cuda.sgi.com (cuda2.sgi.com [192.48.176.25]) by relay1.corp.sgi.com (Postfix) with ESMTP id 270DF8F8040 for ; Tue, 2 Feb 2016 15:38:20 -0800 (PST) X-ASG-Debug-ID: 1454456297-04cbb04c950dbe0001-NocioJ Received: from mail-yk0-f178.google.com (mail-yk0-f178.google.com [209.85.160.178]) by cuda.sgi.com with ESMTP id KImdqcXA29wq0YXP (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128 verify=NO) for ; Tue, 02 Feb 2016 15:38:18 -0800 (PST) X-Barracuda-Envelope-From: dan.j.williams@intel.com X-Barracuda-Apparent-Source-IP: 209.85.160.178 Received: by mail-yk0-f178.google.com with SMTP id z7so4340712yka.3 for ; Tue, 02 Feb 2016 15:38:18 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=intel-com.20150623.gappssmtp.com; s=20150623; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=72MPA5GvdklrJwSVzh4uV3SPfp4aKl1fH2YRNPy2DIc=; b=OjaBC9oVrz0NSfQFnmMH+qT9umJJcMMGV8pJCxMtw9bn+88a1KgxL+uJdYtC2fXc+B BlSlGpJj1iLhP0Hhn41x5CHWYsAbceFfrHJ8MzTNqWQrLsiZMKAxGzoeHRWh/8gU/Ufw EI7OAUdwdenS9cBQC/Gy6E0Vd2xy8fiKSVAmg8pMn2zvRrnBFIup1LH4lI0Kxw11PYts sAPwU7lYd6s4hA+ZyU2dJIWDji+BrRqX/Vwb4ppVhmo/WEfz0ja4BFACbyOh+NCeK39b dVocoM0TYfX8ZbUVJBBsd8UunXv4Cu8ZFvxdyHYFeMqha97Fr3MUsMtEPeQta69tuFr6 epow== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:date :message-id:subject:from:to:cc:content-type; bh=72MPA5GvdklrJwSVzh4uV3SPfp4aKl1fH2YRNPy2DIc=; b=OcVrtsUIjaYYNCuBnzvWTNOu2dh/6LQMgYz+Im1d16e7LV+BiNcvjIWT2PbwBwmPXq n5dAUZWfiJBA8bsqmz37IuqPQqIP+Slgd8Txr3aO2MUtMj3s74lv8DcHy8WxU2goY+xI j9UlEgA6a9dDn47Xi61xIsCNQVOPjPPcGZsnt0Biz39zTAtniuv52OqtkiYKhjJScsLQ m+Bd/GgFq10EuXoI7m178VBkHThbfFuFOn+wtACJ03+J1aG4mUuH/JyXF7OQUPcVIYXw +zQWoNNh3NR1UEpKMIlfZW9SAS0/J7G5kpX1MgjR58AOYWLsa4awf86ZgWgff1/NTRXt r5Hw== X-Gm-Message-State: AG10YOQf+lCm6GbYl0rLB1MhS31jwiGjHpqLKt8ii/KXyZ3ACRvp38Raxn8nKAtINtuSMgJGmDcKRHucl36qHjuH MIME-Version: 1.0 X-Received: by 10.37.15.130 with SMTP id 124mr22501231ybp.84.1454456297490; Tue, 02 Feb 2016 15:38:17 -0800 (PST) Received: by 10.37.202.20 with HTTP; Tue, 2 Feb 2016 15:38:17 -0800 (PST) In-Reply-To: <20160202231931.GR17997@ZenIV.linux.org.uk> References: <1454454702-11889-1-git-send-email-ross.zwisler@linux.intel.com> <20160202231931.GR17997@ZenIV.linux.org.uk> Date: Tue, 2 Feb 2016 15:38:17 -0800 Message-ID: Subject: Re: [PATCH] dax: allow DAX to look up an inode's block device From: Dan Williams X-ASG-Orig-Subj: Re: [PATCH] dax: allow DAX to look up an inode's block device To: Al Viro Cc: Ross Zwisler , "linux-kernel@vger.kernel.org" , "J. Bruce Fields" , Andrew Morton , Dave Chinner , Jan Kara , Jeff Layton , Matthew Wilcox , linux-fsdevel , linux-nvdimm , XFS Developers , inux-btrfs@vger.kernel.org Content-Type: text/plain; charset=UTF-8 X-Barracuda-Connect: mail-yk0-f178.google.com[209.85.160.178] X-Barracuda-Start-Time: 1454456297 X-Barracuda-Encrypted: ECDHE-RSA-AES128-GCM-SHA256 X-Barracuda-URL: https://192.48.176.25:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-BRTS-Status: 1 X-Barracuda-Spam-Score: 0.00 X-Barracuda-Spam-Status: No, SCORE=0.00 using per-user scores of TAG_LEVEL=1000.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.7 tests=BSF_SC0_MISMATCH_TO, DKIM_SIGNED, DKIM_VERIFIED X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.3.26690 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 0.00 BSF_SC0_MISMATCH_TO Envelope rcpt doesn't match header -0.00 DKIM_VERIFIED Domain Keys Identified Mail: signature passes verification 0.00 DKIM_SIGNED Domain Keys Identified Mail: message has a signature [ adding btrfs ] On Tue, Feb 2, 2016 at 3:19 PM, Al Viro wrote: > On Tue, Feb 02, 2016 at 04:11:42PM -0700, Ross Zwisler wrote: > >> However, for raw block devices and for XFS with a real-time device, the >> value in inode->i_sb->s_bdev is not correct. With the code as it is >> currently written, an fsync or msync to a DAX enabled raw block device will >> cause a NULL pointer dereference kernel BUG. For this to work correctly we >> need to ask the block device or filesystem what struct block_device is >> appropriate for our inode. >> >> To that end, add a get_bdev(struct inode *) entry point to struct >> super_operations. If this function pointer is non-NULL, this notifies DAX >> that it needs to use it to look up the correct block_device. If >> i_sb->get_bdev() is NULL DAX will default to inode->i_sb->s_bdev. > > Umm... It assumes that bdev will stay pinned for as long as inode is > referenced, presumably? If so, that needs to be documented (and verified > for existing fs instances). In principle, multi-disk fs might want to > support things like "silently move the inodes backed by that disk to other > ones"... I assume btrfs is the only fs we have that might reassign the bdev for a given inode on the fly? Hopefully we don't need anything stronger than rcu_read_lock() to pin the result as valid. At least in this case the initial user is dax-fsync where the ->get_bdev() answer should be static for the life of the inode, and btrfs does not currently interface with dax. But yes, we need to get the expected semantics clear. From dan.j.williams@intel.com Tue Feb 2 17:39:18 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=T_DKIM_INVALID autolearn=ham version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay3.corp.sgi.com [198.149.34.15]) by oss.sgi.com (Postfix) with ESMTP id 3B8157CB0 for ; Tue, 2 Feb 2016 17:39:18 -0600 (CST) Received: from cuda.sgi.com (cuda3.sgi.com [192.48.176.15]) by relay3.corp.sgi.com (Postfix) with ESMTP id BDAD9AC005 for ; Tue, 2 Feb 2016 15:39:17 -0800 (PST) X-ASG-Debug-ID: 1454456355-04cb6c37970c060001-NocioJ Received: from mail-yk0-f173.google.com (mail-yk0-f173.google.com [209.85.160.173]) by cuda.sgi.com with ESMTP id YCqb7GncWBX2Bg3w (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128 verify=NO) for ; Tue, 02 Feb 2016 15:39:16 -0800 (PST) X-Barracuda-Envelope-From: dan.j.williams@intel.com X-Barracuda-Apparent-Source-IP: 209.85.160.173 Received: by mail-yk0-f173.google.com with SMTP id z7so4359493yka.3 for ; Tue, 02 Feb 2016 15:39:16 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=intel-com.20150623.gappssmtp.com; s=20150623; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=gjbOAjm08T8HZR2ERSGdHpLj9WjkVg+5Ll8SOxc5/cc=; b=Ncjlv5ZcOOV5mgm3/BnG8Ypr+TeodN5XSL+BtFy++oIrhzzDo5CKLpYOKdhrN8+J/p XA9U30z+caLvkJvSqSU0E5M2OZmro7DkF9YOclO7kPYVIrQQkYhQNh0udaIV8q6lGXSK gyM+/nIHLw7+5dMJqg3SNLnJyWwE6OJN8K5FtOAHY++D7weF+N0fvuc4XlCT02oW3o+Y w2oHL9Qbv/n7gNt8H3NNuOZwfvQtZjW/wxKbK7+jfMvCCWIIGiO2eO/tdqfFWdbPn1Ds KnpQDAnZe7zphUSReoQB6zVbp6F72HYrt6OQFRlrrVQZWfZJbpGvtSwKat7qSG05q/Ko sDsg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:date :message-id:subject:from:to:cc:content-type; bh=gjbOAjm08T8HZR2ERSGdHpLj9WjkVg+5Ll8SOxc5/cc=; b=JbQKHOYLBuDct/ewx4o3YsumPwBKBvC2Qa1WFbU6h5mRoxBz4ORllZQW2mzd683NQM axG9OvsqRIK4aiVyGTQrrjmYrWiemB8f9VccwnN0h2W3iIhJn+IcIgUbh6uYCOtLaNdE XJfJklOT043539mbTTKw9sZtssT1QT/csn/mFebVkDjOIgSWLO7kjin6Bvh1CSU1H4A1 BSthJa8EeooEzDyHnvI7yy8oYnz5Nft++b36hPZiWQ5/3T7cCapNQpXKrIE3Ye28K1zc XiJYMkVLXglRTpQk2lXIVzGAIchQFjK8LfwugP3OK+8GhhuiYT8k1nrneG4cSdzLxhlA kxxg== X-Gm-Message-State: AG10YOSElH6HiLiswZ964X2tvD+GXWKCFxxQzXunPQsyhDaTIFiSGqJ0i4izqsYlmNl+RItJjVAl7tXewtfBllN3 MIME-Version: 1.0 X-Received: by 10.37.231.21 with SMTP id e21mr13390618ybh.51.1454456355742; Tue, 02 Feb 2016 15:39:15 -0800 (PST) Received: by 10.37.202.20 with HTTP; Tue, 2 Feb 2016 15:39:15 -0800 (PST) In-Reply-To: References: <1454454702-11889-1-git-send-email-ross.zwisler@linux.intel.com> <20160202231931.GR17997@ZenIV.linux.org.uk> Date: Tue, 2 Feb 2016 15:39:15 -0800 Message-ID: Subject: Re: [PATCH] dax: allow DAX to look up an inode's block device From: Dan Williams X-ASG-Orig-Subj: Re: [PATCH] dax: allow DAX to look up an inode's block device To: Al Viro Cc: Ross Zwisler , "linux-kernel@vger.kernel.org" , "J. Bruce Fields" , Andrew Morton , Dave Chinner , Jan Kara , Jeff Layton , Matthew Wilcox , linux-fsdevel , linux-nvdimm , XFS Developers , linux-btrfs@vger.kernel.org Content-Type: text/plain; charset=UTF-8 X-Barracuda-Connect: mail-yk0-f173.google.com[209.85.160.173] X-Barracuda-Start-Time: 1454456356 X-Barracuda-Encrypted: ECDHE-RSA-AES128-GCM-SHA256 X-Barracuda-URL: https://192.48.176.15:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-BRTS-Status: 1 X-Barracuda-Spam-Score: 0.00 X-Barracuda-Spam-Status: No, SCORE=0.00 using per-user scores of TAG_LEVEL=1000.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.7 tests=BSF_SC0_MISMATCH_TO, DKIM_SIGNED, DKIM_VERIFIED X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.3.26690 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 0.00 BSF_SC0_MISMATCH_TO Envelope rcpt doesn't match header -0.00 DKIM_VERIFIED Domain Keys Identified Mail: signature passes verification 0.00 DKIM_SIGNED Domain Keys Identified Mail: message has a signature [ adding btrfs, resend with the correct list address ] On Tue, Feb 2, 2016 at 3:19 PM, Al Viro wrote: > On Tue, Feb 02, 2016 at 04:11:42PM -0700, Ross Zwisler wrote: > >> However, for raw block devices and for XFS with a real-time device, the >> value in inode->i_sb->s_bdev is not correct. With the code as it is >> currently written, an fsync or msync to a DAX enabled raw block device will >> cause a NULL pointer dereference kernel BUG. For this to work correctly we >> need to ask the block device or filesystem what struct block_device is >> appropriate for our inode. >> >> To that end, add a get_bdev(struct inode *) entry point to struct >> super_operations. If this function pointer is non-NULL, this notifies DAX >> that it needs to use it to look up the correct block_device. If >> i_sb->get_bdev() is NULL DAX will default to inode->i_sb->s_bdev. > > Umm... It assumes that bdev will stay pinned for as long as inode is > referenced, presumably? If so, that needs to be documented (and verified > for existing fs instances). In principle, multi-disk fs might want to > support things like "silently move the inodes backed by that disk to other > ones"... I assume btrfs is the only fs we have that might reassign the bdev for a given inode on the fly? Hopefully we don't need anything stronger than rcu_read_lock() to pin the result as valid. At least in this case the initial user is dax-fsync where the ->get_bdev() answer should be static for the life of the inode, and btrfs does not currently interface with dax. But yes, we need to get the expected semantics clear. On Tue, Feb 2, 2016 at 3:38 PM, Dan Williams wrote: > [ adding btrfs ] > > On Tue, Feb 2, 2016 at 3:19 PM, Al Viro wrote: >> On Tue, Feb 02, 2016 at 04:11:42PM -0700, Ross Zwisler wrote: >> >>> However, for raw block devices and for XFS with a real-time device, the >>> value in inode->i_sb->s_bdev is not correct. With the code as it is >>> currently written, an fsync or msync to a DAX enabled raw block device will >>> cause a NULL pointer dereference kernel BUG. For this to work correctly we >>> need to ask the block device or filesystem what struct block_device is >>> appropriate for our inode. >>> >>> To that end, add a get_bdev(struct inode *) entry point to struct >>> super_operations. If this function pointer is non-NULL, this notifies DAX >>> that it needs to use it to look up the correct block_device. If >>> i_sb->get_bdev() is NULL DAX will default to inode->i_sb->s_bdev. >> >> Umm... It assumes that bdev will stay pinned for as long as inode is >> referenced, presumably? If so, that needs to be documented (and verified >> for existing fs instances). In principle, multi-disk fs might want to >> support things like "silently move the inodes backed by that disk to other >> ones"... > > I assume btrfs is the only fs we have that might reassign the bdev for > a given inode on the fly? Hopefully we don't need anything stronger > than rcu_read_lock() to pin the result as valid. > > At least in this case the initial user is dax-fsync where the > ->get_bdev() answer should be static for the life of the inode, and > btrfs does not currently interface with dax. But yes, we need to get > the expected semantics clear. From dan.j.williams@intel.com Tue Feb 2 17:41:40 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=T_DKIM_INVALID autolearn=ham version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay1.corp.sgi.com [137.38.102.111]) by oss.sgi.com (Postfix) with ESMTP id 30B117CB0 for ; Tue, 2 Feb 2016 17:41:40 -0600 (CST) Received: from cuda.sgi.com (cuda1.sgi.com [192.48.157.11]) by relay1.corp.sgi.com (Postfix) with ESMTP id C85488F8040 for ; Tue, 2 Feb 2016 15:41:39 -0800 (PST) X-ASG-Debug-ID: 1454456497-04bdf070530c4e0001-NocioJ Received: from mail-yk0-f172.google.com (mail-yk0-f172.google.com [209.85.160.172]) by cuda.sgi.com with ESMTP id NzTHFt4LEwc25wDY (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128 verify=NO) for ; Tue, 02 Feb 2016 15:41:38 -0800 (PST) X-Barracuda-Envelope-From: dan.j.williams@intel.com X-Barracuda-Apparent-Source-IP: 209.85.160.172 Received: by mail-yk0-f172.google.com with SMTP id r207so4463435ykd.2 for ; Tue, 02 Feb 2016 15:41:38 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=intel-com.20150623.gappssmtp.com; s=20150623; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=+iQo8r442x3cY0nGxALL7y/ijBqyIEQv25Jq0bIQpXo=; b=Y3fu4S587FeKzmGYzA6KFlmviD7z3jzTXJTEevdEbvYGFypzImiK/Wqk5jk/1SUc6m Ui08t4zGdgQrpxnNcQcTgSPu6ukATCjEhgaC7fa0Ga/yDdH/aX384fPTf+jQPLXOY6Wk uzb2/17K43pskjdCE6VqWgtrE+WQg/yqzsPnGeORem5mXO/pjF9irxIiJsP7yBYg+O9N g1jR4UdKwIDjOizPGTZvJIEYrt6JSbpGqSstSI6yGMvNzryclTocbA/UXmyZqi6+nkvm 1l5o7OmlpL43cMpUGu5/WIWdj6tLTxcpeZQ+g8PLKkLkOksheRKXhQcfybO3rvId+uHp LiPg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:date :message-id:subject:from:to:cc:content-type; bh=+iQo8r442x3cY0nGxALL7y/ijBqyIEQv25Jq0bIQpXo=; b=Q3CL/0QAkYbZ+jnJYMEnyIeOcykqnp6R2UNKkttoHFQ7lx2qP5Ae8VWecj/bieEzUx r78tUBBGvMw23Zi0xE7d5WVom5IG0GBKB8lcToiQ7g7LOb0NM3Yaxy9VmCsuvw9/tOrv 8SoZ5vZN5TrU6cv9e+4aHj9ey6/0rEOCYUihJAqNx6mRi4svcSfRyync6EICeGMroIS7 /vCi1yjTNted57XEA4wVqjOPEXizxsrJ2i9DpB3M+mtVwGWfYsg3W6k4hLGrCNS6zBcu dvoP2SVnyXk+BIlcvTA/HI/KlP/FUA+7sZ9c4NJEDkoj/mNgLB+v5iama6/1dhBrWl6s ANbQ== X-Gm-Message-State: AG10YOQ6TVRCMUOb3Vew5zWaltSelSxnnexWgQXI773+R7tkx5mmEP0x43AThvU8aipH2Fw8Fa2mFasFwT7ec97X MIME-Version: 1.0 X-Received: by 10.37.25.212 with SMTP id 203mr21618060ybz.163.1454456497336; Tue, 02 Feb 2016 15:41:37 -0800 (PST) Received: by 10.37.202.20 with HTTP; Tue, 2 Feb 2016 15:41:37 -0800 (PST) In-Reply-To: References: <1454454702-11889-1-git-send-email-ross.zwisler@linux.intel.com> <20160202231931.GR17997@ZenIV.linux.org.uk> Date: Tue, 2 Feb 2016 15:41:37 -0800 Message-ID: Subject: Re: [PATCH] dax: allow DAX to look up an inode's block device From: Dan Williams X-ASG-Orig-Subj: Re: [PATCH] dax: allow DAX to look up an inode's block device To: Jared Hulbert Cc: Al Viro , Ross Zwisler , Jeff Layton , linux-nvdimm , Dave Chinner , LKML , XFS Developers , "J. Bruce Fields" , Jan Kara , Linux FS Devel , Andrew Morton Content-Type: text/plain; charset=UTF-8 X-Barracuda-Connect: mail-yk0-f172.google.com[209.85.160.172] X-Barracuda-Start-Time: 1454456497 X-Barracuda-Encrypted: ECDHE-RSA-AES128-GCM-SHA256 X-Barracuda-URL: https://192.48.157.11:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-BRTS-Status: 1 X-Barracuda-Spam-Score: 0.00 X-Barracuda-Spam-Status: No, SCORE=0.00 using per-user scores of TAG_LEVEL=1000.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.7 tests=BSF_SC0_MISMATCH_TO, DKIM_SIGNED, DKIM_VERIFIED X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.3.26690 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 0.00 BSF_SC0_MISMATCH_TO Envelope rcpt doesn't match header -0.00 DKIM_VERIFIED Domain Keys Identified Mail: signature passes verification 0.00 DKIM_SIGNED Domain Keys Identified Mail: message has a signature On Tue, Feb 2, 2016 at 3:36 PM, Jared Hulbert wrote: > On Tue, Feb 2, 2016 at 3:19 PM, Al Viro wrote: >> >> On Tue, Feb 02, 2016 at 04:11:42PM -0700, Ross Zwisler wrote: >> >> > However, for raw block devices and for XFS with a real-time device, the >> > value in inode->i_sb->s_bdev is not correct. With the code as it is >> > currently written, an fsync or msync to a DAX enabled raw block device will >> > cause a NULL pointer dereference kernel BUG. For this to work correctly we >> > need to ask the block device or filesystem what struct block_device is >> > appropriate for our inode. >> > >> > To that end, add a get_bdev(struct inode *) entry point to struct >> > super_operations. If this function pointer is non-NULL, this notifies DAX >> > that it needs to use it to look up the correct block_device. If >> > i_sb->get_bdev() is NULL DAX will default to inode->i_sb->s_bdev. >> >> Umm... It assumes that bdev will stay pinned for as long as inode is >> referenced, presumably? If so, that needs to be documented (and verified >> for existing fs instances). In principle, multi-disk fs might want to >> support things like "silently move the inodes backed by that disk to other >> ones"... > > Dan, This is exactly the kind of thing I'm taking about WRT the > weirder device models and directly calling bdev_direct_access(). > Filesystems don't have the monogamous relationship with a device that > is implicitly assumed in DAX, you have to ask the filesystem what the > relationship is and is migrating to, and allow the filesystem to > update DAX when the relationship is changing. That's precisely what ->get_bdev() does. When the answer inode->i_sb->s_bdev lookup is invalid, use ->get_bdev(). > As we start to see many > DIMM's and 10s TiB pmem systems this is going be an even bigger deal > as load balancing, wear leveling, and fault tolerance concerned are > inevitably driven by the filesystem. No, there are no plans on the horizon for an fs to manage these media specific concerns for persistent memory. From willy@linux.intel.com Tue Feb 2 17:52:50 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=ham version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay3.corp.sgi.com [198.149.34.15]) by oss.sgi.com (Postfix) with ESMTP id 665447CB0 for ; Tue, 2 Feb 2016 17:52:50 -0600 (CST) Received: from cuda.sgi.com (cuda2.sgi.com [192.48.176.25]) by relay3.corp.sgi.com (Postfix) with ESMTP id D9B3CAC005 for ; Tue, 2 Feb 2016 15:52:49 -0800 (PST) X-ASG-Debug-ID: 1454457168-04cbb04c970e110001-NocioJ Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) by cuda.sgi.com with ESMTP id 0sCU1Guaf7dfhJtF for ; Tue, 02 Feb 2016 15:52:48 -0800 (PST) X-Barracuda-Envelope-From: willy@linux.intel.com X-Barracuda-Apparent-Source-IP: 134.134.136.20 X-ASG-Whitelist: Client Received: from orsmga003.jf.intel.com ([10.7.209.27]) by orsmga101.jf.intel.com with ESMTP; 02 Feb 2016 15:52:48 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.22,387,1449561600"; d="scan'208";a="739466141" Received: from hhan3-mobl4.amr.corp.intel.com (HELO thog.int.wil.cx) ([10.252.135.38]) by orsmga003.jf.intel.com with SMTP; 02 Feb 2016 15:52:44 -0800 Received: by thog.int.wil.cx (Postfix, from userid 1000) id D204761CE3; Tue, 2 Feb 2016 18:52:43 -0500 (EST) Date: Tue, 2 Feb 2016 18:52:43 -0500 From: Matthew Wilcox To: Dan Williams Cc: Al Viro , Ross Zwisler , "linux-kernel@vger.kernel.org" , "J. Bruce Fields" , Andrew Morton , Dave Chinner , Jan Kara , Jeff Layton , linux-fsdevel , linux-nvdimm , XFS Developers , linux-btrfs@vger.kernel.org Subject: Re: [PATCH] dax: allow DAX to look up an inode's block device Message-ID: <20160202235243.GC3260@linux.intel.com> X-ASG-Orig-Subj: Re: [PATCH] dax: allow DAX to look up an inode's block device References: <1454454702-11889-1-git-send-email-ross.zwisler@linux.intel.com> <20160202231931.GR17997@ZenIV.linux.org.uk> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.24 (2015-08-30) X-Barracuda-Connect: mga02.intel.com[134.134.136.20] X-Barracuda-Start-Time: 1454457168 X-Barracuda-URL: https://192.48.176.25:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-BRTS-Status: 1 On Tue, Feb 02, 2016 at 03:39:15PM -0800, Dan Williams wrote: > On Tue, Feb 2, 2016 at 3:19 PM, Al Viro wrote: > > On Tue, Feb 02, 2016 at 04:11:42PM -0700, Ross Zwisler wrote: > >> However, for raw block devices and for XFS with a real-time device, the > >> value in inode->i_sb->s_bdev is not correct. With the code as it is > >> currently written, an fsync or msync to a DAX enabled raw block device will > >> cause a NULL pointer dereference kernel BUG. For this to work correctly we > >> need to ask the block device or filesystem what struct block_device is > >> appropriate for our inode. > >> > >> To that end, add a get_bdev(struct inode *) entry point to struct > >> super_operations. If this function pointer is non-NULL, this notifies DAX > >> that it needs to use it to look up the correct block_device. If > >> i_sb->get_bdev() is NULL DAX will default to inode->i_sb->s_bdev. > > > > Umm... It assumes that bdev will stay pinned for as long as inode is > > referenced, presumably? If so, that needs to be documented (and verified > > for existing fs instances). In principle, multi-disk fs might want to > > support things like "silently move the inodes backed by that disk to other > > ones"... > > I assume btrfs is the only fs we have that might reassign the bdev for > a given inode on the fly? Hopefully we don't need anything stronger > than rcu_read_lock() to pin the result as valid. > > At least in this case the initial user is dax-fsync where the > ->get_bdev() answer should be static for the life of the inode, and > btrfs does not currently interface with dax. But yes, we need to get > the expected semantics clear. Let's be clear though. ->get_bdev is a temporary hack. The need for it goes away when DAX doesn't rely on being on a block_device any more. I don't expect it to live longer than six months. From darrick.wong@oracle.com Tue Feb 2 18:05:25 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay3.corp.sgi.com [198.149.34.15]) by oss.sgi.com (Postfix) with ESMTP id 138617CB0 for ; Tue, 2 Feb 2016 18:05:25 -0600 (CST) Received: from cuda.sgi.com (cuda3.sgi.com [192.48.176.15]) by relay3.corp.sgi.com (Postfix) with ESMTP id 8EAB7AC005 for ; Tue, 2 Feb 2016 16:05:21 -0800 (PST) X-ASG-Debug-ID: 1454457916-04cb6c37980cb10001-NocioJ Received: from aserp1040.oracle.com (aserp1040.oracle.com [141.146.126.69]) by cuda.sgi.com with ESMTP id fUdhtzQUIcTd3NHJ (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO) for ; Tue, 02 Feb 2016 16:05:16 -0800 (PST) X-Barracuda-Envelope-From: darrick.wong@oracle.com X-Barracuda-Apparent-Source-IP: 141.146.126.69 Received: from userv0022.oracle.com (userv0022.oracle.com [156.151.31.74]) by aserp1040.oracle.com (Sentrion-MTA-4.3.2/Sentrion-MTA-4.3.2) with ESMTP id u1305D4D003634 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 3 Feb 2016 00:05:14 GMT Received: from userv0121.oracle.com (userv0121.oracle.com [156.151.31.72]) by userv0022.oracle.com (8.14.4/8.13.8) with ESMTP id u1305DR8009259 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=FAIL); Wed, 3 Feb 2016 00:05:13 GMT Received: from abhmp0008.oracle.com (abhmp0008.oracle.com [141.146.116.14]) by userv0121.oracle.com (8.13.8/8.13.8) with ESMTP id u1305CjT024231; Wed, 3 Feb 2016 00:05:12 GMT Received: from localhost (/24.21.154.84) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Tue, 02 Feb 2016 16:05:12 -0800 Date: Tue, 2 Feb 2016 16:05:10 -0800 From: "Darrick J. Wong" To: Christoph Hellwig Cc: linux-fsdevel@vger.kernel.org, xfs@oss.sgi.com, linux-ext4@vger.kernel.org, ocfs2-devel@oss.oracle.com Subject: Re: [PATCH 1/3] direct-io: always call ->end_io if non-NULL Message-ID: <20160203000510.GB5854@birch.djwong.org> X-ASG-Orig-Subj: Re: [PATCH 1/3] direct-io: always call ->end_io if non-NULL References: <1454444257-9086-1-git-send-email-hch@lst.de> <1454444257-9086-2-git-send-email-hch@lst.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1454444257-9086-2-git-send-email-hch@lst.de> User-Agent: Mutt/1.5.21 (2010-09-15) X-Source-IP: userv0022.oracle.com [156.151.31.74] X-Barracuda-Connect: aserp1040.oracle.com[141.146.126.69] X-Barracuda-Start-Time: 1454457916 X-Barracuda-Encrypted: ECDHE-RSA-AES256-GCM-SHA384 X-Barracuda-URL: https://192.48.176.15:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-BRTS-Status: 1 X-Barracuda-Spam-Score: 0.00 X-Barracuda-Spam-Status: No, SCORE=0.00 using per-user scores of TAG_LEVEL=1000.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.7 tests=BSF_SC0_MISMATCH_TO, UNPARSEABLE_RELAY X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.3.26690 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 0.00 BSF_SC0_MISMATCH_TO Envelope rcpt doesn't match header 0.00 UNPARSEABLE_RELAY Informational: message has unparseable relay lines On Tue, Feb 02, 2016 at 09:17:35PM +0100, Christoph Hellwig wrote: > See http://www.infradead.org/rpr.html Ick. ^^^ > This way we can pass back errors to the file system, and allow for > cleanup required for all direct I/O invocations. > > Signed-off-by: Christoph Hellwig > --- > fs/dax.c | 2 +- > fs/direct-io.c | 4 ++-- > fs/ext4/inode.c | 3 +++ > fs/ocfs2/aops.c | 3 +++ > fs/xfs/xfs_aops.c | 3 +++ > 5 files changed, 12 insertions(+), 3 deletions(-) > > diff --git a/fs/dax.c b/fs/dax.c > index 4fd6b0c..e47d1ba 100644 > --- a/fs/dax.c > +++ b/fs/dax.c > @@ -267,7 +267,7 @@ ssize_t dax_do_io(struct kiocb *iocb, struct inode *inode, > if ((flags & DIO_LOCKING) && iov_iter_rw(iter) == READ) > inode_unlock(inode); > > - if ((retval > 0) && end_io) > + if (end_io) > end_io(iocb, pos, retval, bh.b_private); > > if (!(flags & DIO_SKIP_DIO_COUNT)) > diff --git a/fs/direct-io.c b/fs/direct-io.c > index 1b2f7ff..ead7ac1 100644 > --- a/fs/direct-io.c > +++ b/fs/direct-io.c > @@ -253,8 +253,8 @@ static ssize_t dio_complete(struct dio *dio, loff_t offset, ssize_t ret, > if (ret == 0) > ret = transferred; > > - if (dio->end_io && dio->result) > - dio->end_io(dio->iocb, offset, transferred, dio->private); > + if (dio->end_io) > + dio->end_io(dio->iocb, offset, ret, dio->private); Could we make end_io return an int so that errors during completion can be stuffed into ret to be picked up by whatever's calling directio? Something like this: if (dio->end_io) { int ret2; ret2 = dio->end_io(dio->iocb, offset, ret, dio->private); if (ret2 && !ret) ret = ret2; } That way I can capture IO errors during the CoW remapping step and pass them to userland either via dio_complete()'s return value or through ki_complete. (If ret itself is an error code then obviously we don't bother with the post-CoW remap.) --D > > if (!(dio->flags & DIO_SKIP_DIO_COUNT)) > inode_dio_end(dio->inode); > diff --git a/fs/ext4/inode.c b/fs/ext4/inode.c > index 83bc8bf..d04555b 100644 > --- a/fs/ext4/inode.c > +++ b/fs/ext4/inode.c > @@ -3166,6 +3166,9 @@ static void ext4_end_io_dio(struct kiocb *iocb, loff_t offset, > { > ext4_io_end_t *io_end = iocb->private; > > + if (size <= 0) > + return; > + > /* if not async direct IO just return */ > if (!io_end) > return; > diff --git a/fs/ocfs2/aops.c b/fs/ocfs2/aops.c > index 794fd15..1eeb804 100644 > --- a/fs/ocfs2/aops.c > +++ b/fs/ocfs2/aops.c > @@ -628,6 +628,9 @@ static void ocfs2_dio_end_io(struct kiocb *iocb, > struct inode *inode = file_inode(iocb->ki_filp); > int level; > > + if (bytes <= 0) > + return; > + > /* this io's submitter should not have unlocked this before we could */ > BUG_ON(!ocfs2_iocb_is_rw_locked(iocb)); > > diff --git a/fs/xfs/xfs_aops.c b/fs/xfs/xfs_aops.c > index 379c089..c318e9f 100644 > --- a/fs/xfs/xfs_aops.c > +++ b/fs/xfs/xfs_aops.c > @@ -1655,6 +1655,9 @@ xfs_end_io_direct_write( > struct inode *inode = file_inode(iocb->ki_filp); > struct xfs_ioend *ioend = private; > > + if (size <= 0) > + return; > + > trace_xfs_gbmap_direct_endio(XFS_I(inode), offset, size, > ioend ? ioend->io_type : 0, NULL); > > -- > 2.1.4 > > -- > 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 From jaredeh@gmail.com Tue Feb 2 18:33:22 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=FREEMAIL_FROM,T_DKIM_INVALID autolearn=ham version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay3.corp.sgi.com [198.149.34.15]) by oss.sgi.com (Postfix) with ESMTP id 987437CB0 for ; Tue, 2 Feb 2016 18:33:22 -0600 (CST) Received: from cuda.sgi.com (cuda2.sgi.com [192.48.176.25]) by relay3.corp.sgi.com (Postfix) with ESMTP id 198DBAC006 for ; Tue, 2 Feb 2016 16:33:22 -0800 (PST) X-ASG-Debug-ID: 1454459596-04cbb04c980efe0001-NocioJ Received: from mail-wm0-f53.google.com (mail-wm0-f53.google.com [74.125.82.53]) by cuda.sgi.com with ESMTP id a7QwRMYCcFeK0ep8 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128 verify=NO) for ; Tue, 02 Feb 2016 16:33:17 -0800 (PST) X-Barracuda-Envelope-From: jaredeh@gmail.com X-Barracuda-Apparent-Source-IP: 74.125.82.53 Received: by mail-wm0-f53.google.com with SMTP id l66so47371974wml.0 for ; Tue, 02 Feb 2016 16:33:17 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=sl+ldnZ2PYQ3HVn2mRuHA1UxBAmDj58csF5WIb8ksfU=; b=G2QZ72odRCl1/hOBlPHfs8SQMdlp5ed5dNSGYk2cvEhj5NnZ7wC6a7+7R4e6F3lKCj eV6jEn3sOfAIkQdtciW298awBeHrKQa5n/Zl1rtHNU2t92V6Cc+kZ3DBLLEBiB8k0nBu 2yG7CoNWKDfZtMy4n7W2ltqBZR0U6HX/8HWIcUDv7rDHDPOCHfU7bf+ENssJnur2iTPa lPYUPtBxy4gMsyqzqFO8undyjQqsn0Ch725hMN43poimrrhjcyB5wZxy5bBnaxT5n0sK AyGpW+nELnj1PZfuNvl/fuX4ovLRI8ANFY4+Ou5L1xG3JbAhZ+yNxE2pYwZ/DErlEmGS +qRA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:date :message-id:subject:from:to:cc:content-type; bh=sl+ldnZ2PYQ3HVn2mRuHA1UxBAmDj58csF5WIb8ksfU=; b=Ln+wZR7y4rTuRWBOz9t4agmjPAbDpYQqxOgC9s5BjxluUtLKsuXaaWXi+0IGEQzH26 vXNfrjBW/zZnsNIgD2xqMw9+dgBgtdsGFmuaMdM/MJ8+hW3XveLMbFzSgvI6bAgw9hae WbrcDDb+4ECujIFoEgQPLyP72tcEtal6vbWMFy4z3oe2act5enW0//4lbzE8iCrR0jW4 rTZxjxyZA15ujaD25yZEbl1k3+2QwaKG+zP8zdPP3FpV43zXBnEd+EwvcuD+5fp+3oTf VcyvFjezynEWrExKaHnwU31A9oj29MDSkiYeXRhZ6xS/8E+71KXVfDVRdIQzM/UNvYH/ ydWA== X-Gm-Message-State: AG10YORdn/Mi48luT8LSPsjSaau0c9YnXi+oNYY1Q8y2lC6ir3PA/K4f7ewUslH5LP71c+MlJxgKD7Pt0bTqRQ== MIME-Version: 1.0 X-Received: by 10.194.62.11 with SMTP id u11mr35540575wjr.172.1454459596156; Tue, 02 Feb 2016 16:33:16 -0800 (PST) Received: by 10.27.12.21 with HTTP; Tue, 2 Feb 2016 16:33:16 -0800 (PST) In-Reply-To: References: <1454454702-11889-1-git-send-email-ross.zwisler@linux.intel.com> <20160202231931.GR17997@ZenIV.linux.org.uk> Date: Tue, 2 Feb 2016 16:33:16 -0800 Message-ID: Subject: Re: [PATCH] dax: allow DAX to look up an inode's block device From: Jared Hulbert X-ASG-Orig-Subj: Re: [PATCH] dax: allow DAX to look up an inode's block device To: Dan Williams Cc: Al Viro , Ross Zwisler , Jeff Layton , linux-nvdimm , Dave Chinner , LKML , XFS Developers , "J. Bruce Fields" , Jan Kara , Linux FS Devel , Andrew Morton Content-Type: text/plain; charset=UTF-8 X-Barracuda-Connect: mail-wm0-f53.google.com[74.125.82.53] X-Barracuda-Start-Time: 1454459596 X-Barracuda-Encrypted: ECDHE-RSA-AES128-GCM-SHA256 X-Barracuda-URL: https://192.48.176.25:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-BRTS-Status: 1 X-Barracuda-Spam-Score: 0.00 X-Barracuda-Spam-Status: No, SCORE=0.00 using per-user scores of TAG_LEVEL=1000.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.7 tests=BSF_SC0_MISMATCH_TO, DKIM_SIGNED, DKIM_VERIFIED X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.3.26691 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 0.00 BSF_SC0_MISMATCH_TO Envelope rcpt doesn't match header -0.00 DKIM_VERIFIED Domain Keys Identified Mail: signature passes verification 0.00 DKIM_SIGNED Domain Keys Identified Mail: message has a signature On Tue, Feb 2, 2016 at 3:41 PM, Dan Williams wrote: > On Tue, Feb 2, 2016 at 3:36 PM, Jared Hulbert wrote: >> On Tue, Feb 2, 2016 at 3:19 PM, Al Viro wrote: >>> >>> On Tue, Feb 02, 2016 at 04:11:42PM -0700, Ross Zwisler wrote: >>> >>> > However, for raw block devices and for XFS with a real-time device, the >>> > value in inode->i_sb->s_bdev is not correct. With the code as it is >>> > currently written, an fsync or msync to a DAX enabled raw block device will >>> > cause a NULL pointer dereference kernel BUG. For this to work correctly we >>> > need to ask the block device or filesystem what struct block_device is >>> > appropriate for our inode. >>> > >>> > To that end, add a get_bdev(struct inode *) entry point to struct >>> > super_operations. If this function pointer is non-NULL, this notifies DAX >>> > that it needs to use it to look up the correct block_device. If >>> > i_sb->get_bdev() is NULL DAX will default to inode->i_sb->s_bdev. >>> >>> Umm... It assumes that bdev will stay pinned for as long as inode is >>> referenced, presumably? If so, that needs to be documented (and verified >>> for existing fs instances). In principle, multi-disk fs might want to >>> support things like "silently move the inodes backed by that disk to other >>> ones"... >> >> Dan, This is exactly the kind of thing I'm taking about WRT the >> weirder device models and directly calling bdev_direct_access(). >> Filesystems don't have the monogamous relationship with a device that >> is implicitly assumed in DAX, you have to ask the filesystem what the >> relationship is and is migrating to, and allow the filesystem to >> update DAX when the relationship is changing. > > That's precisely what ->get_bdev() does. When the answer > inode->i_sb->s_bdev lookup is invalid, use ->get_bdev(). > >> As we start to see many >> DIMM's and 10s TiB pmem systems this is going be an even bigger deal >> as load balancing, wear leveling, and fault tolerance concerned are >> inevitably driven by the filesystem. > > No, there are no plans on the horizon for an fs to manage these media > specific concerns for persistent memory. So the filesystem is now directly in charge of mapping user pages to physical memory. The filesystem is effectively bypassing NUMA and zones and all that stuff that tries to balance memory bus and QPI traffic etc. You don't think the filesystem will therefore be in charge of memory bus hotspots? Alright. We can just agree to disagree on that point. From sandeen@sandeen.net Tue Feb 2 20:47:30 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=ham version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay3.corp.sgi.com [198.149.34.15]) by oss.sgi.com (Postfix) with ESMTP id C7B7B7CB0 for ; Tue, 2 Feb 2016 20:47:30 -0600 (CST) Received: from cuda.sgi.com (cuda3.sgi.com [192.48.176.15]) by relay3.corp.sgi.com (Postfix) with ESMTP id 63304AC001 for ; Tue, 2 Feb 2016 18:47:29 -0800 (PST) X-ASG-Debug-ID: 1454467645-04cb6c379710740001-NocioJ Received: from sandeen.net (sandeen.net [63.231.237.45]) by cuda.sgi.com with ESMTP id pi7JkXppOrRwOEFX for ; Tue, 02 Feb 2016 18:47:26 -0800 (PST) X-Barracuda-Envelope-From: sandeen@sandeen.net X-Barracuda-Apparent-Source-IP: 63.231.237.45 Received: from liberator.sandeen.net (liberator.sandeen.net [10.0.0.4]) (using TLSv1.2 with cipher DHE-RSA-AES128-SHA (128/128 bits)) (No client certificate requested) by sandeen.net (Postfix) with ESMTPSA id 9652563C6064 for ; Tue, 2 Feb 2016 20:47:25 -0600 (CST) Subject: Re: Request for information on bloated writes using Swift To: xfs@oss.sgi.com X-ASG-Orig-Subj: Re: Request for information on bloated writes using Swift References: From: Eric Sandeen X-Enigmail-Draft-Status: N1110 Message-ID: <56B16A3C.1030207@sandeen.net> Date: Tue, 2 Feb 2016 20:47:24 -0600 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.11; rv:38.0) Gecko/20100101 Thunderbird/38.5.1 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 8bit X-Barracuda-Connect: sandeen.net[63.231.237.45] X-Barracuda-Start-Time: 1454467646 X-Barracuda-URL: https://192.48.176.15:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-BRTS-Status: 1 X-Barracuda-Spam-Score: 0.00 X-Barracuda-Spam-Status: No, SCORE=0.00 using per-user scores of TAG_LEVEL=1000.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.7 tests= X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.3.26694 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- On 2/2/16 4:32 PM, Dilip Simha wrote: > Hi, > > I have a question regarding speculated preallocation in XFS, w.r.t > kernel version: 3.16.0-46-generic. I am using Swift version: 1.0 and > mkfs.xfs version 3.2.1 > > When I write a 256KiB file to Swift, I see that the underlying XFS > uses 3x the amount of space/blocks to write that data. Upon > performing detailed experiments, I see that when Swift uses fallocate > (default approach), XFS doesn't reclaim the preallocated blocks that > XFS allocated. Swift fallocate doesn't exceed the body size(256 > KiB). > > Interestingly, when either allocsize=4k or when swift doesn't use > fallocate, XFS doesn't consume additional space. > > Can you please let me know if this is a known bug and if its fixed in > the later versions? Can you clarify the exact sequence of events? i.e. - xfs_io -f -c "fallocate 0 256k" -c "pwrite 0 256k" somefile leads to unreaclaimed preallocation, while xfs_io -f -c "pwrite 0 256k" somefile does not? Or is it some other sequence? I don't have a 3.16 handy to test, but if you can describe it in more detail that'd help. Some of this is influenced by fs geometry, too so xfs_info output would be good, along with any mount options you might be using. Are you preallocating with or without KEEP_SIZE? -Eric From nmdilipsimha@gmail.com Tue Feb 2 21:41:00 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=FREEMAIL_FROM,HTML_MESSAGE, T_DKIM_INVALID autolearn=ham version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay3.corp.sgi.com [198.149.34.15]) by oss.sgi.com (Postfix) with ESMTP id 0DA9029DF5 for ; Tue, 2 Feb 2016 21:41:00 -0600 (CST) Received: from cuda.sgi.com (cuda1.sgi.com [192.48.157.11]) by relay3.corp.sgi.com (Postfix) with ESMTP id A0A34AC001 for ; Tue, 2 Feb 2016 19:40:56 -0800 (PST) X-ASG-Debug-ID: 1454470853-04bdf07051123f0001-NocioJ Received: from mail-ob0-f181.google.com (mail-ob0-f181.google.com [209.85.214.181]) by cuda.sgi.com with ESMTP id nrFzf4aC3vvtGLCV (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128 verify=NO) for ; Tue, 02 Feb 2016 19:40:54 -0800 (PST) X-Barracuda-Envelope-From: nmdilipsimha@gmail.com X-Barracuda-Apparent-Source-IP: 209.85.214.181 Received: by mail-ob0-f181.google.com with SMTP id xk3so12782847obc.2 for ; Tue, 02 Feb 2016 19:40:54 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc:content-type; bh=eXY/EcGSTOWuLD3QiR8NXqvYx5Ajs+F/CjUnkjHAuCY=; b=bqU9Z6a+LLsE1l4ObyuH3po+q9fXmv5F8RGH6sfALrUJm+TBpM7laxyWbLedkRJpw2 qLa8yU1+QHfjrtjN+Ki+sKps9geg6yfSqlqtiyf7PY66UrDi155twmjyAAW3D9/aeJni LFixa2NOnxjLGB0r8P+rgMGRiajkamBJkrixtjU5niUsQStL1KsWHehQfkI4KpZF7iWW qz1gKsGZNq+9uRICF0P+RZagLCnN2VyEANl/2qkT08U0dpHfpwYoc9ezGsGqDCF+Ant9 T9eVCCpGekgIQ0l23lnyACg6CX9tt6Tmhnl1hP0fU7KoVkvxK0fedSBNmpoKrgdpPZCE f/ew== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc:content-type; bh=eXY/EcGSTOWuLD3QiR8NXqvYx5Ajs+F/CjUnkjHAuCY=; b=NvvrKPtfD85znR5090jxg8ySLm2+gSiP9n5hfCCWYJJp25QOjPKuEfVTbZVYY/mD+n niUKXvv4D6mp+5+q5nlt2A+gj8S5oBqJ7OvixAwiwbApFR6v6f9Sg+m+wKSwOA3bqm7f vHe3hoFWTu0fMbB4chpdAVL3QswNQl7Is5R/E5zy+95isMT6jZjBwhVlFhLHsM94ltMG 6n54IeXudWQD6xNYxMrOAFRNk+w/CNJ496OW9QZjXAKZrNOxcYrE4p7EBqzxymx0HPal Gh1ZpBh6A3nonT4C1IKw6DK4sgrexSDLYQdkzZ2Y2UjX3SJ34Wjdzn4B7+nRmx5ABRyD Ocjg== X-Gm-Message-State: AG10YORqpfz/e5pNLmkFHH35+GDuOkBSQJr0BEfUvpm/v2gWlxLGSsJzx9MQHThllHv5x8djJN3vpFHY70ndhg== X-Received: by 10.182.214.40 with SMTP id nx8mr28320581obc.20.1454470853808; Tue, 02 Feb 2016 19:40:53 -0800 (PST) MIME-Version: 1.0 Received: by 10.202.86.204 with HTTP; Tue, 2 Feb 2016 19:40:34 -0800 (PST) In-Reply-To: <56B16A3C.1030207@sandeen.net> References: <56B16A3C.1030207@sandeen.net> From: Dilip Simha Date: Tue, 2 Feb 2016 19:40:34 -0800 Message-ID: Subject: Re: Request for information on bloated writes using Swift To: Eric Sandeen X-ASG-Orig-Subj: Re: Request for information on bloated writes using Swift Cc: xfs@oss.sgi.com Content-Type: multipart/alternative; boundary=e89a8ff1c01e93da38052ad562b2 X-Barracuda-Connect: mail-ob0-f181.google.com[209.85.214.181] X-Barracuda-Start-Time: 1454470854 X-Barracuda-Encrypted: ECDHE-RSA-AES128-GCM-SHA256 X-Barracuda-URL: https://192.48.157.11:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-BRTS-Status: 1 X-Barracuda-Spam-Score: 0.00 X-Barracuda-Spam-Status: No, SCORE=0.00 using per-user scores of TAG_LEVEL=1000.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.7 tests=BSF_SC0_MISMATCH_TO, DKIM_SIGNED, DKIM_VERIFIED, HTML_MESSAGE X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.3.26695 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 0.00 BSF_SC0_MISMATCH_TO Envelope rcpt doesn't match header -0.00 DKIM_VERIFIED Domain Keys Identified Mail: signature passes verification 0.00 DKIM_SIGNED Domain Keys Identified Mail: message has a signature 0.00 HTML_MESSAGE BODY: HTML included in message --e89a8ff1c01e93da38052ad562b2 Content-Type: text/plain; charset=UTF-8 Hi Eric, Thank you for your quick reply. Using xfs_io as per your suggestion, I am able to reproduce the issue. However, I need to falloc for 256K and write for 257K to see this issue. # xfs_io -f -c "falloc 0 256k" -c "pwrite 0 257k" /srv/node/r1/t1.txt # stat /srv/node/r1/t4.txt | grep Blocks Size: 263168 Blocks: 1536 IO Block: 4096 regular file # xfs_io -f -c "pwrite 0 257k" /srv/node/r1/t2.txt # stat /srv/node/r1/t2.txt | grep Blocks Size: 263168 *Blocks*: 520 IO Block: 4096 regular file # xfs_info /srv/node/r1 meta-data=/dev/mapper/35000cca05831283c-part2 isize=256 agcount=4, agsize=183141504 blks = sectsz=512 attr=2, projid32bit=1 = crc=0 finobt=0 data = bsize=4096 blocks=732566016, imaxpct=5 = sunit=0 swidth=0 blks naming =version 2 bsize=4096 ascii-ci=0 ftype=0 log =internal bsize=4096 blocks=357698, version=2 = sectsz=512 sunit=0 blks, lazy-count=1 realtime =none extsz=4096 blocks=0, rtextents=0 # cat /proc/mounts | grep r1 /dev/mapper/35000cca05831283c-part2 /srv/node/*r1* xfs rw,nosuid,nodev,noexec,noatime,nodiratime,attr2,inode64,logbufs=8,noquota 0 0 I waited for around 15 mins before collecting the stat output to give the background reclamation logic a fair chance to do its job. I also tried changing the value of speculative_prealloc_lifetime from 300 to 10. But it was of no use. cat /proc/sys/fs/xfs/speculative_prealloc_lifetime 10 Regards, Dilip On Tue, Feb 2, 2016 at 6:47 PM, Eric Sandeen wrote: > > > On 2/2/16 4:32 PM, Dilip Simha wrote: > > Hi, > > > > I have a question regarding speculated preallocation in XFS, w.r.t > > kernel version: 3.16.0-46-generic. I am using Swift version: 1.0 and > > mkfs.xfs version 3.2.1 > > > > When I write a 256KiB file to Swift, I see that the underlying XFS > > uses 3x the amount of space/blocks to write that data. Upon > > performing detailed experiments, I see that when Swift uses fallocate > > (default approach), XFS doesn't reclaim the preallocated blocks that > > XFS allocated. Swift fallocate doesn't exceed the body size(256 > > KiB). > > > > Interestingly, when either allocsize=4k or when swift doesn't use > > fallocate, XFS doesn't consume additional space. > > > > Can you please let me know if this is a known bug and if its fixed in > > the later versions? > > Can you clarify the exact sequence of events? > > i.e. - > > xfs_io -f -c "fallocate 0 256k" -c "pwrite 0 256k" somefile > > leads to unreaclaimed preallocation, while > > xfs_io -f -c "pwrite 0 256k" somefile > > does not? Or is it some other sequence? I don't have a > 3.16 handy to test, but if you can describe it in more detail > that'd help. Some of this is influenced by fs geometry, too > so xfs_info output would be good, along with any mount options > you might be using. > > Are you preallocating with or without KEEP_SIZE? > > -Eric > > _______________________________________________ > xfs mailing list > xfs@oss.sgi.com > http://oss.sgi.com/mailman/listinfo/xfs > --e89a8ff1c01e93da38052ad562b2 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
Hi Eric,

Thank you for your quick reply= .

Using xfs_io as per your suggestion, I am ab= le to reproduce the issue. However, I need to falloc for 256K and write for= 257K to see this issue.

# xfs_io -f -c &= quot;falloc 0 256k" -c "pwrite 0 257k" /srv/node/r1/t1.txt
# stat /srv/node/r1/t4.txt | grep Blocks
=C2=A0 Size: 26= 3168 =C2=A0 =C2=A0 Blocks: 1536= =C2=A0 =C2=A0 =C2=A0 IO Block: 4096 =C2=A0 regular file

# xfs_io -f -c "pwrite 0 257k" /srv/node/r1/t2.txt

# stat=C2=A0 /srv/node/r1/t2.txt | grep Blocks
Size= : 263168=C2=A0 =C2=A0=C2=A0Blocks: 520=C2=A0 =C2=A0 =C2=A0 =C2=A0 IO= Block: 4096 =C2=A0 regular file

# xfs_= info /srv/node/r1
meta-data=3D/dev/mapper/35000cca05831283c-part2= isize=3D256 =C2=A0 =C2=A0agcount=3D4, agsize=3D183141504 blks
= =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0=3D =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 sectsz=3D512 =C2=A0 attr=3D2, pro= jid32bit=3D1
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0=3D =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 crc=3D0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0finobt=3D0
data =C2=A0 =C2=A0 =3D =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 bsize= =3D4096 =C2=A0 blocks=3D732566016, imaxpct=3D5
=C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0=3D =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 sunit=3D0 =C2=A0 =C2=A0 =C2=A0swidth=3D0 blks
naming =C2=A0 =3Dversion 2 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0bsize=3D4096 =C2=A0 ascii-ci=3D0 ftype=3D0
log =C2=A0 =C2= =A0 =C2=A0=3Dinternal =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 bsiz= e=3D4096 =C2=A0 blocks=3D357698, version=3D2
=C2=A0 =C2=A0 =C2=A0= =C2=A0 =C2=A0=3D =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 sectsz=3D512 =C2=A0 sunit=3D0 blks, lazy-count=3D1
realtime =3Dnone =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 extsz=3D4096 =C2=A0 blocks=3D0, rtextents=3D0

# cat /proc/mounts | grep r1

/dev/mapper/35000cca05831283c-part2 /srv/node/r1 xfs rw,nosuid,nodev,= noexec,noatime,nodiratime,attr2,inode64,logbufs=3D8,noquota 0 0

<= /div>
I waited for around 15 mins before collecting the stat output to = give the background reclamation logic a fair chance to do its job. I also t= ried changing the value of speculative_prealloc_lifetime from 300 to 10. Bu= t it was of no use.

cat /proc/sys/fs/xfs/speculative_prealloc_lifetime
<= /div>
10

Regards,
Dilip
<= div class=3D"gmail_extra">
On Tue, Feb 2, 201= 6 at 6:47 PM, Eric Sandeen <sandeen@sandeen.net> wrote:


On 2/2/16 4:32 PM, Dilip Simha wrote:
> Hi,
>
> I have a question regarding speculated preallocation in XFS, w.r.t
> kernel version: 3.16.0-46-generic. I am using Swift version: 1.0 and > mkfs.xfs version 3.2.1
>
> When I write a 256KiB file to Swift, I see that the underlying XFS
> uses 3x the amount of space/blocks to write that data. Upon
> performing detailed experiments, I see that when Swift uses fallocate<= br> > (default approach), XFS doesn't reclaim the preallocated blocks th= at
> XFS allocated. Swift fallocate doesn't exceed the body size(256 > KiB).
>
> Interestingly, when either allocsize=3D4k or when swift doesn't us= e
> fallocate, XFS doesn't consume additional space.
>
> Can you please let me know if this is a known bug and if its fixed in<= br> > the later versions?

Can you clarify the exact sequence of events?

i.e. -

xfs_io -f -c "fallocate 0 256k" -c "pwrite 0 256k" some= file

leads to unreaclaimed preallocation, while

xfs_io -f -c "pwrite 0 256k" somefile

does not?=C2=A0 Or is it some other sequence?=C2=A0 I don't have a
3.16 handy to test, but if you can describe it in more detail
that'd help.=C2=A0 Some of this is influenced by fs geometry, too
so xfs_info output would be good, along with any mount options
you might be using.

Are you preallocating with or without KEEP_SIZE?

-Eric

_______________________________________________
xfs mailing list
xfs@oss.sgi.com http://oss.sgi.com/mailman/listinfo/xfs

--e89a8ff1c01e93da38052ad562b2-- From nmdilipsimha@gmail.com Tue Feb 2 21:42:31 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=FREEMAIL_FROM,HTML_MESSAGE, T_DKIM_INVALID autolearn=ham version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay2.corp.sgi.com [137.38.102.29]) by oss.sgi.com (Postfix) with ESMTP id A309929DF5 for ; Tue, 2 Feb 2016 21:42:31 -0600 (CST) Received: from cuda.sgi.com (cuda3.sgi.com [192.48.176.15]) by relay2.corp.sgi.com (Postfix) with ESMTP id 98053304039 for ; Tue, 2 Feb 2016 19:42:28 -0800 (PST) X-ASG-Debug-ID: 1454470945-04cb6c379511a20001-NocioJ Received: from mail-ob0-f175.google.com (mail-ob0-f175.google.com [209.85.214.175]) by cuda.sgi.com with ESMTP id ckbAgLFEMXcApfbI (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128 verify=NO) for ; Tue, 02 Feb 2016 19:42:26 -0800 (PST) X-Barracuda-Envelope-From: nmdilipsimha@gmail.com X-Barracuda-Apparent-Source-IP: 209.85.214.175 Received: by mail-ob0-f175.google.com with SMTP id ba1so12611850obb.3 for ; Tue, 02 Feb 2016 19:42:26 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc:content-type; bh=CzEbjP9M6tDTROvkpxA/xWhVj40SmVcjBzbp8DDZUSg=; b=Lpp0HYR531FDcd7MHLjoT5npnSGjE2MqW3862jIyBffj+vJW7oWtza0LdWgG8y3DfY UeSeuI+YUS2Qr8f8prAA3jT1GwflE41mMMug4I8rWTKUYRKqpTUkg7rLH5OZICaV95AM 6uOnr070bGlqc1Ob/0WDIwfoDM0tOHpq0KHTkmbCj9bedep/QxKm22xCkJxwdVOek/AH uATEhLeHg+94ai549WJg8yOPWTgjEsW32uim3CradhpTn4krGEQ+OudOUaiQlaWbEVSn RsDXQm3XJiykfzB8jWccSpFvYsQXuSxpXf1zPMgrv3ecDNvox1K0xnTeR4YWFaphnhUs sC8g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc:content-type; bh=CzEbjP9M6tDTROvkpxA/xWhVj40SmVcjBzbp8DDZUSg=; b=R1LAO5sQiIv51TYGB2dZIQY2JWYMyAB4q733Uy1Xc8QuWoMCEgKaVvjaBEa4i36w8t 4dxwHnk9Vj+RddIwDbBj2f6Fd2/YQFQX1YS5C3qXiCuRYzejvOL85HpTqr0TwQqQJINp hRNfUAVZHfnc/e9cH5ppcRXSc4P6mOPTNvXHPJpCHauoaCDsLMbYnlyz86jnwjqudKyE UDxZSCv4iQq8UabtNncQXQ0E5AYb3TJYzNFZzR+3PvUUuEsAr4QvoTcIiwxaO0iUrY62 L2qyLaDN6FfNCTH23izMuGloJNmJ89ig9HxWOKM1T7Eax6ewWec8MTg3ExG0pkkOjgyU 1XOw== X-Gm-Message-State: AG10YOSYRwa7zZWStcjpcpyhiHmlNUDKeeqOzzNHGbEjB6SHcS56PkhTEZdhhNl/VZamnJuzGsQG9PSjFHjJbA== X-Received: by 10.60.136.197 with SMTP id qc5mr28214407oeb.79.1454470945726; Tue, 02 Feb 2016 19:42:25 -0800 (PST) MIME-Version: 1.0 Received: by 10.202.86.204 with HTTP; Tue, 2 Feb 2016 19:42:06 -0800 (PST) In-Reply-To: References: <56B16A3C.1030207@sandeen.net> From: Dilip Simha Date: Tue, 2 Feb 2016 19:42:06 -0800 Message-ID: Subject: Re: Request for information on bloated writes using Swift To: Eric Sandeen X-ASG-Orig-Subj: Re: Request for information on bloated writes using Swift Cc: xfs@oss.sgi.com Content-Type: multipart/alternative; boundary=089e0160c2b00e69b9052ad568ee X-Barracuda-Connect: mail-ob0-f175.google.com[209.85.214.175] X-Barracuda-Start-Time: 1454470946 X-Barracuda-Encrypted: ECDHE-RSA-AES128-GCM-SHA256 X-Barracuda-URL: https://192.48.176.15:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-BRTS-Status: 1 X-Barracuda-Spam-Score: 0.00 X-Barracuda-Spam-Status: No, SCORE=0.00 using per-user scores of TAG_LEVEL=1000.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.7 tests=BSF_SC0_MISMATCH_TO, DKIM_SIGNED, DKIM_VERIFIED, HTML_MESSAGE X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.3.26695 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 0.00 BSF_SC0_MISMATCH_TO Envelope rcpt doesn't match header -0.00 DKIM_VERIFIED Domain Keys Identified Mail: signature passes verification 0.00 DKIM_SIGNED Domain Keys Identified Mail: message has a signature 0.00 HTML_MESSAGE BODY: HTML included in message --089e0160c2b00e69b9052ad568ee Content-Type: text/plain; charset=UTF-8 Apologies: Small correction: The stat was taken on t1.txt but mistakenly printed it as t4.txt. On Tue, Feb 2, 2016 at 7:40 PM, Dilip Simha wrote: > Hi Eric, > > Thank you for your quick reply. > > Using xfs_io as per your suggestion, I am able to reproduce the issue. > However, I need to falloc for 256K and write for 257K to see this issue. > > # xfs_io -f -c "falloc 0 256k" -c "pwrite 0 257k" /srv/node/r1/t1.txt > # stat /srv/node/r1/t4.txt | grep Blocks > Size: 263168 Blocks: 1536 IO Block: 4096 regular file > > # xfs_io -f -c "pwrite 0 257k" /srv/node/r1/t2.txt > # stat /srv/node/r1/t2.txt | grep Blocks > Size: 263168 *Blocks*: 520 IO Block: 4096 regular file > > # xfs_info /srv/node/r1 > meta-data=/dev/mapper/35000cca05831283c-part2 isize=256 agcount=4, > agsize=183141504 blks > = sectsz=512 attr=2, projid32bit=1 > = crc=0 finobt=0 > data = bsize=4096 blocks=732566016, imaxpct=5 > = sunit=0 swidth=0 blks > naming =version 2 bsize=4096 ascii-ci=0 ftype=0 > log =internal bsize=4096 blocks=357698, version=2 > = sectsz=512 sunit=0 blks, lazy-count=1 > realtime =none extsz=4096 blocks=0, rtextents=0 > > # cat /proc/mounts | grep r1 > > /dev/mapper/35000cca05831283c-part2 /srv/node/*r1* xfs > rw,nosuid,nodev,noexec,noatime,nodiratime,attr2,inode64,logbufs=8,noquota 0 > 0 > I waited for around 15 mins before collecting the stat output to give the > background reclamation logic a fair chance to do its job. I also tried > changing the value of speculative_prealloc_lifetime from 300 to 10. But it > was of no use. > > cat /proc/sys/fs/xfs/speculative_prealloc_lifetime > 10 > > Regards, > Dilip > > On Tue, Feb 2, 2016 at 6:47 PM, Eric Sandeen wrote: > >> >> >> On 2/2/16 4:32 PM, Dilip Simha wrote: >> > Hi, >> > >> > I have a question regarding speculated preallocation in XFS, w.r.t >> > kernel version: 3.16.0-46-generic. I am using Swift version: 1.0 and >> > mkfs.xfs version 3.2.1 >> > >> > When I write a 256KiB file to Swift, I see that the underlying XFS >> > uses 3x the amount of space/blocks to write that data. Upon >> > performing detailed experiments, I see that when Swift uses fallocate >> > (default approach), XFS doesn't reclaim the preallocated blocks that >> > XFS allocated. Swift fallocate doesn't exceed the body size(256 >> > KiB). >> > >> > Interestingly, when either allocsize=4k or when swift doesn't use >> > fallocate, XFS doesn't consume additional space. >> > >> > Can you please let me know if this is a known bug and if its fixed in >> > the later versions? >> >> Can you clarify the exact sequence of events? >> >> i.e. - >> >> xfs_io -f -c "fallocate 0 256k" -c "pwrite 0 256k" somefile >> >> leads to unreaclaimed preallocation, while >> >> xfs_io -f -c "pwrite 0 256k" somefile >> >> does not? Or is it some other sequence? I don't have a >> 3.16 handy to test, but if you can describe it in more detail >> that'd help. Some of this is influenced by fs geometry, too >> so xfs_info output would be good, along with any mount options >> you might be using. >> >> Are you preallocating with or without KEEP_SIZE? >> >> -Eric >> >> _______________________________________________ >> xfs mailing list >> xfs@oss.sgi.com >> http://oss.sgi.com/mailman/listinfo/xfs >> > > --089e0160c2b00e69b9052ad568ee Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
Apologies:
Small correction:

The st= at was taken on t1.txt but mistakenly printed it as t4.txt.=C2=A0

On Tue, F= eb 2, 2016 at 7:40 PM, Dilip Simha <nmdilipsimha@gmail.com> wrote:
Hi Eric,
Thank you for your quick reply.

Using xfs_io as per your suggestion, I am able to reproduce the issue. Ho= wever, I need to falloc for 256K and write for 257K to see this issue.
<= /div>

# xfs_io -f -c "falloc 0 256k" -c &= quot;pwrite 0 257k" /srv/node/r1/t1.txt
# stat /srv/node/r1/= t4.txt | grep Blocks
=C2=A0 Size: 263168 =C2=A0 =C2=A0 Blocks: 1536 =C2=A0 =C2=A0 =C2=A0 IO Bloc= k: 4096 =C2=A0 regular file

# xfs_io -f -c "pwrite 0 257k" /srv/node/r1/t2.txt

# stat=C2=A0 /srv/node/r1/t2.txt | grep Blocks
Size= : 263168=C2=A0 =C2=A0=C2=A0Blocks: 520=C2=A0 =C2=A0 =C2=A0 =C2=A0 IO= Block: 4096 =C2=A0 regular file

# xfs_= info /srv/node/r1
meta-data=3D/dev/mapper/35000cca05831283c-part2= isize=3D256 =C2=A0 =C2=A0agcount=3D4, agsize=3D183141504 blks
= =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0=3D =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 sectsz=3D512 =C2=A0 attr=3D2, pro= jid32bit=3D1
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0=3D =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 crc=3D0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0finobt=3D0
data =C2=A0 =C2=A0 =3D =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 bsize= =3D4096 =C2=A0 blocks=3D732566016, imaxpct=3D5
=C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0=3D =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 sunit=3D0 =C2=A0 =C2=A0 =C2=A0swidth=3D0 blks
naming =C2=A0 =3Dversion 2 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0bsize=3D4096 =C2=A0 ascii-ci=3D0 ftype=3D0
log =C2=A0 =C2= =A0 =C2=A0=3Dinternal =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 bsiz= e=3D4096 =C2=A0 blocks=3D357698, version=3D2
=C2=A0 =C2=A0 =C2=A0= =C2=A0 =C2=A0=3D =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 sectsz=3D512 =C2=A0 sunit=3D0 blks, lazy-count=3D1
realtime =3Dnone =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 extsz=3D4096 =C2=A0 blocks=3D0, rtextents=3D0

# cat /proc/mounts | grep r1

/dev/mapper/35000c= ca05831283c-part2 /srv/node/r1 xfs rw,nosu= id,nodev,noexec,noatime,nodiratime,attr2,inode64,logbufs=3D8,noquota 0 0

I waited for around 15 mins before collecting the stat o= utput to give the background reclamation logic a fair chance to do its job.= I also tried changing the value of speculative_prealloc_lifetime from 300 = to 10. But it was of no use.

cat /proc/sys/fs/xfs/speculative_prealloc_lifetime
<= /div>
10

Regards,
Dilip
<= div>

On Tue, Feb 2, 2016 at 6:47 PM, Eric Sandeen <sandeen@sandeen.net> wrote:


On 2/2/16 4:32 PM, Dilip Simha wrote:
> Hi,
>
> I have a question regarding speculated preallocation in XFS, w.r.t
> kernel version: 3.16.0-46-generic. I am using Swift version: 1.0 and > mkfs.xfs version 3.2.1
>
> When I write a 256KiB file to Swift, I see that the underlying XFS
> uses 3x the amount of space/blocks to write that data. Upon
> performing detailed experiments, I see that when Swift uses fallocate<= br> > (default approach), XFS doesn't reclaim the preallocated blocks th= at
> XFS allocated. Swift fallocate doesn't exceed the body size(256 > KiB).
>
> Interestingly, when either allocsize=3D4k or when swift doesn't us= e
> fallocate, XFS doesn't consume additional space.
>
> Can you please let me know if this is a known bug and if its fixed in<= br> > the later versions?

Can you clarify the exact sequence of events?

i.e. -

xfs_io -f -c "fallocate 0 256k" -c "pwrite 0 256k" some= file

leads to unreaclaimed preallocation, while

xfs_io -f -c "pwrite 0 256k" somefile

does not?=C2=A0 Or is it some other sequence?=C2=A0 I don't have a
3.16 handy to test, but if you can describe it in more detail
that'd help.=C2=A0 Some of this is influenced by fs geometry, too
so xfs_info output would be good, along with any mount options
you might be using.

Are you preallocating with or without KEEP_SIZE?

-Eric

_______________________________________________
xfs mailing list
xfs@oss.sgi.com http://oss.sgi.com/mailman/listinfo/xfs


--089e0160c2b00e69b9052ad568ee-- From david@fromorbit.com Wed Feb 3 00:37:26 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=ham version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay2.corp.sgi.com [137.38.102.29]) by oss.sgi.com (Postfix) with ESMTP id 4BC937CAF for ; Wed, 3 Feb 2016 00:37:26 -0600 (CST) Received: from cuda.sgi.com (cuda1.sgi.com [192.48.157.11]) by relay2.corp.sgi.com (Postfix) with ESMTP id 1C7A6304039 for ; Tue, 2 Feb 2016 22:37:26 -0800 (PST) X-ASG-Debug-ID: 1454481439-04bdf0705316000001-NocioJ Received: from ipmail07.adl2.internode.on.net (ipmail07.adl2.internode.on.net [150.101.137.131]) by cuda.sgi.com with ESMTP id De3798LdmiULGQjq for ; Tue, 02 Feb 2016 22:37:19 -0800 (PST) X-Barracuda-Envelope-From: david@fromorbit.com X-Barracuda-Apparent-Source-IP: 150.101.137.131 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: A2AWCQDynrFW/xATLHlegzqBP4JphXKeKwEBAQEBBotkiUiGBwICAQECgURNAQEBAQEBgQuEQQEBAQMBOhwjBQsIAw4KCSUPBSUDIROIEwe/VQEBAQcCAR0YhTCEfoQcg0GBDwWSbIQFjUSBZI0WaYoFg1Jig3goLogzgTgBAQE Received: from ppp121-44-19-16.lns20.syd4.internode.on.net (HELO dastard) ([121.44.19.16]) by ipmail07.adl2.internode.on.net with ESMTP; 03 Feb 2016 17:07:18 +1030 Received: from dave by dastard with local (Exim 4.80) (envelope-from ) id 1aQr3p-00034Q-Sk; Wed, 03 Feb 2016 17:37:05 +1100 Date: Wed, 3 Feb 2016 17:37:05 +1100 From: Dave Chinner To: Dilip Simha Cc: Eric Sandeen , xfs@oss.sgi.com Subject: Re: Request for information on bloated writes using Swift Message-ID: <20160203063705.GB459@dastard> X-ASG-Orig-Subj: Re: Request for information on bloated writes using Swift References: <56B16A3C.1030207@sandeen.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.21 (2010-09-15) X-Barracuda-Connect: ipmail07.adl2.internode.on.net[150.101.137.131] X-Barracuda-Start-Time: 1454481439 X-Barracuda-URL: https://192.48.157.11:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-BRTS-Status: 1 X-Barracuda-Spam-Score: 0.00 X-Barracuda-Spam-Status: No, SCORE=0.00 using per-user scores of TAG_LEVEL=1000.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.7 tests=BSF_SC0_MISMATCH_TO X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.3.26698 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 0.00 BSF_SC0_MISMATCH_TO Envelope rcpt doesn't match header On Tue, Feb 02, 2016 at 07:40:34PM -0800, Dilip Simha wrote: > Hi Eric, > > Thank you for your quick reply. > > Using xfs_io as per your suggestion, I am able to reproduce the issue. > However, I need to falloc for 256K and write for 257K to see this issue. > > # xfs_io -f -c "falloc 0 256k" -c "pwrite 0 257k" /srv/node/r1/t1.txt > # stat /srv/node/r1/t4.txt | grep Blocks > Size: 263168 Blocks: 1536 IO Block: 4096 regular file Fallocate sets the XFS_DIFLAG_PREALLOC on the inode. When you writing *past the preallocated area* and do delayed allocation, the speculative preallocation beyond EOF is double the size of the extent at EOF. i.e. 512k, leading to 768k being allocated to the file (1536 blocks, exactly). This is expected behaviour. > # xfs_io -f -c "pwrite 0 257k" /srv/node/r1/t2.txt > # stat /srv/node/r1/t2.txt | grep Blocks > Size: 263168 *Blocks*: 520 IO Block: 4096 regular file So pure delayed allocation, specualtive preallocation starts at 64k file size, so it would have been (((64k + 64K) + 128K) + 256k) = 768k. > I waited for around 15 mins before collecting the stat output to give the > background reclamation logic a fair chance to do its job. I also tried > changing the value of speculative_prealloc_lifetime from 300 to 10. But it > was of no use. The prealloc cleaner skips inodes with XFS_DIFLAG_PREALLOC set on them. Because the XFS_DIFLAG_PREALLOC flag is not set on the delayed allocation inode, the EOF blocks cleaner runs truncates it to EOF, and 260k (520 blocks) remains allocated to the file. i.e. you are seeing behaviour exactly as designed and intended. The way swift is using fallocate is actively harmful. You do not want preallocation for write once files - this is exactly the workload that delayed allocation was designed to be optimal for as delayed allocation sequentialises the IO from multiple files. Using preallocation means writeback of the data cannot be optimised across files as the preallocation location will not be sequential to the IO that was just issued, hence writeback will seek the disks back and forth instead of seeing a nice sequential IO stream. Yet another way that the swift storage back end tries to be smart but ends up just making things go slow.... Cheers, Dave. -- Dave Chinner david@fromorbit.com From nmdilipsimha@gmail.com Wed Feb 3 01:09:40 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=FREEMAIL_FROM,HTML_MESSAGE, T_DKIM_INVALID autolearn=ham version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay2.corp.sgi.com [137.38.102.29]) by oss.sgi.com (Postfix) with ESMTP id E46C87CA4 for ; Wed, 3 Feb 2016 01:09:40 -0600 (CST) Received: from cuda.sgi.com (cuda1.sgi.com [192.48.157.11]) by relay2.corp.sgi.com (Postfix) with ESMTP id AA9AE304053 for ; Tue, 2 Feb 2016 23:09:37 -0800 (PST) X-ASG-Debug-ID: 1454483375-04bdf0705316bc0001-NocioJ Received: from mail-ob0-f171.google.com (mail-ob0-f171.google.com [209.85.214.171]) by cuda.sgi.com with ESMTP id EwtmP0RCKBaZMYQ1 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128 verify=NO) for ; Tue, 02 Feb 2016 23:09:35 -0800 (PST) X-Barracuda-Envelope-From: nmdilipsimha@gmail.com X-Barracuda-Apparent-Source-IP: 209.85.214.171 Received: by mail-ob0-f171.google.com with SMTP id xk3so17691964obc.2 for ; Tue, 02 Feb 2016 23:09:35 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc:content-type; bh=89dJ8HCn6S/6Xk+z34GnBoT3fzLNV7s3BI1LAPh/xNg=; b=lH2BmlXq723cNUiF/CJIkPMbIE6TZKSH4boKdds1Oq1f4X0fgmZ92z5cZ/xz04PhA4 szHthgIxLz8y8XG/aoMtDYA9f6AP6N2sjAFmJx7d43RVsn/u5DgY7vFMaSYmdvty8bSJ 31qA70ijelxxwaQwVs9vFBtnSz1yUqeUL6JfzvqMXINl44z/5LD8/4r3TLLC4ZIS5qCl Fi5yZdxRVve/ORACh1jIdw0solLI/YgibxTwkezJunOTkA2JXtQD8nL7ZsuD/CNvwj81 n4BWuScZApgZfDo8Mcn7nC5l7CALLW1fizIuSiVVTywDOHtXwoyzK9Yl3o5dd9fBy807 f+7w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc:content-type; bh=89dJ8HCn6S/6Xk+z34GnBoT3fzLNV7s3BI1LAPh/xNg=; b=E/OosqXszAgNKuCYPvRIo9x7nnoKM16eDyR+DdqgJPWTupjBtZTmLvXYBV6Bcws/PT 12Cf8gFZt9F+zRSjj/0Xng+SobT71SvXnaVb2XqD1cEeDMbygfHxa1xwtFQre007Ze90 KOnYp4KZNaLqqwFJjS5uF9ufXzXCQGifg9xVozw/5FnWocwigbfptMpQG+W3aIu+YA7/ xDAp66ulMxgTLMdMutOZfOalSNk9vi+Uamd4ufQd/eM+YYWXi3J9TNFFMmJ9kFdb0/JC jou3hIo6s4SELLE3voOOkjwo7ZPYbqoFehyk8ZV+tD2mxbvyK9f0gaA+/LwCusQ7QDkQ DcaA== X-Gm-Message-State: AG10YOSCS42K60PJUpBxN/bGRhdo62TqIDne6QQl6TT0IX6kLoNWH3jRmlt/9mMtg6Jksg9+NHFK8QIzPAT0iw== X-Received: by 10.182.114.232 with SMTP id jj8mr27949316obb.19.1454483374953; Tue, 02 Feb 2016 23:09:34 -0800 (PST) MIME-Version: 1.0 Received: by 10.202.86.204 with HTTP; Tue, 2 Feb 2016 23:09:15 -0800 (PST) In-Reply-To: <20160203063705.GB459@dastard> References: <56B16A3C.1030207@sandeen.net> <20160203063705.GB459@dastard> From: Dilip Simha Date: Tue, 2 Feb 2016 23:09:15 -0800 Message-ID: Subject: Re: Request for information on bloated writes using Swift To: Dave Chinner X-ASG-Orig-Subj: Re: Request for information on bloated writes using Swift Cc: Eric Sandeen , xfs@oss.sgi.com Content-Type: multipart/alternative; boundary=001a11c301dce56573052ad84c24 X-Barracuda-Connect: mail-ob0-f171.google.com[209.85.214.171] X-Barracuda-Start-Time: 1454483375 X-Barracuda-Encrypted: ECDHE-RSA-AES128-GCM-SHA256 X-Barracuda-URL: https://192.48.157.11:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-BRTS-Status: 1 X-Barracuda-Spam-Score: 0.00 X-Barracuda-Spam-Status: No, SCORE=0.00 using per-user scores of TAG_LEVEL=1000.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.7 tests=BSF_SC0_MISMATCH_TO, DKIM_SIGNED, DKIM_VERIFIED, HTML_MESSAGE X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.3.26698 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 0.00 BSF_SC0_MISMATCH_TO Envelope rcpt doesn't match header -0.00 DKIM_VERIFIED Domain Keys Identified Mail: signature passes verification 0.00 DKIM_SIGNED Domain Keys Identified Mail: message has a signature 0.00 HTML_MESSAGE BODY: HTML included in message --001a11c301dce56573052ad84c24 Content-Type: text/plain; charset=UTF-8 Hi Dave, On Tue, Feb 2, 2016 at 10:37 PM, Dave Chinner wrote: > On Tue, Feb 02, 2016 at 07:40:34PM -0800, Dilip Simha wrote: > > Hi Eric, > > > > Thank you for your quick reply. > > > > Using xfs_io as per your suggestion, I am able to reproduce the issue. > > However, I need to falloc for 256K and write for 257K to see this issue. > > > > # xfs_io -f -c "falloc 0 256k" -c "pwrite 0 257k" /srv/node/r1/t1.txt > > # stat /srv/node/r1/t4.txt | grep Blocks > > Size: 263168 Blocks: 1536 IO Block: 4096 regular file > > Fallocate sets the XFS_DIFLAG_PREALLOC on the inode. > > When you writing *past the preallocated area* and do delayed > allocation, the speculative preallocation beyond EOF is double the > size of the extent at EOF. i.e. 512k, leading to 768k being > allocated to the file (1536 blocks, exactly). > Thank you for the details. This is exactly where I am a bit perplexed. Since the reclamation logic skips inodes that have the XFS_DIFLAG_PREALLOC flag set, why did the allocation logic allot more blocks on such an inode? My understanding is that the fallocate caller only requested for 256K worth of blocks to be available sequentially if possible. On any subsequent write beyond the EOF, the caller is completely unaware of the underlying file-system storing that data adjacent to the first 256K data. Since XFS is speculatively allocating additional space (512K) adjacent to the first 256K data, I would expect XFS to either treat these two allocations distinctly and NOT mark XFS_DIFLAG_PREALLOC on the additional 512K data(minus the actually used additional data=1K), OR remove XFS_DIFLAG_PREALLOC flag on the entire inode. Also, is there any way I can check for this flag? The FLAGS, as observed from xfs_bmap doesn't show any flags set to it. Am I not looking at the right flags? # xfs_bmap -lpv /srv/node/r16/objects/10/ff3/55517cd029bee36151a5098ce7cdeff3/1453771923.11401.data /srv/node/r16/objects/10/ff3/55517cd029bee36151a5098ce7cdeff3/1453771923.11401.data: EXT: FILE-OFFSET BLOCK-RANGE AG AG-OFFSET TOTAL FLAGS 0: [0..1535]: 1465876416..1465877951 1 (744384..745919) 1536 00000 Thanks & Regards, Dilip > This is expected behaviour. > > > # xfs_io -f -c "pwrite 0 257k" /srv/node/r1/t2.txt > > # stat /srv/node/r1/t2.txt | grep Blocks > > Size: 263168 *Blocks*: 520 IO Block: 4096 regular file > > So pure delayed allocation, specualtive preallocation starts at 64k > file size, so it would have been (((64k + 64K) + 128K) + 256k) = > 768k. > > > > I waited for around 15 mins before collecting the stat output to give the > > background reclamation logic a fair chance to do its job. I also tried > > changing the value of speculative_prealloc_lifetime from 300 to 10. But > it > > was of no use. > > The prealloc cleaner skips inodes with XFS_DIFLAG_PREALLOC set on > them. > > Because the XFS_DIFLAG_PREALLOC flag is not set on the delayed > allocation inode, the EOF blocks cleaner runs truncates it to EOF, > and 260k (520 blocks) remains allocated to the file. > > i.e. you are seeing behaviour exactly as designed and intended. > > The way swift is using fallocate is actively harmful. You do not > want preallocation for write once files - this is exactly the > workload that delayed allocation was designed to be optimal for as > delayed allocation sequentialises the IO from multiple files. > > Using preallocation means writeback of the data cannot be optimised > across files as the preallocation location will not be sequential to > the IO that was just issued, hence writeback will seek the disks > back and forth instead of seeing a nice sequential IO stream. > > > > Yet another way that the swift storage back end tries to be smart > but ends up just making things go slow.... > > Cheers, > > Dave. > -- > Dave Chinner > david@fromorbit.com > --001a11c301dce56573052ad84c24 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
Hi Dave,

On Tue, Feb 2, 2016 at 10:37 PM, Dave Chinner <= ;david@fromorbit.c= om> wrote:
On Tue, Feb 0= 2, 2016 at 07:40:34PM -0800, Dilip Simha wrote:
> Hi Eric,
>
> Thank you for your quick reply.
>
> Using xfs_io as per your suggestion, I am able to reproduce the issue.=
> However, I need to falloc for 256K and write for 257K to see this issu= e.
>
> # xfs_io -f -c "falloc 0 256k" -c "pwrite 0 257k" = /srv/node/r1/t1.txt
> # stat /srv/node/r1/t4.txt | grep Blocks
>=C2=A0 =C2=A0Size: 263168=C2=A0 =C2=A0 =C2=A0Blocks: 1536=C2=A0 =C2=A0 = =C2=A0 =C2=A0IO Block: 4096=C2=A0 =C2=A0regular file

Fallocate sets the XFS_DIFLAG_PREALLOC on the inode.

When you writing *past the preallocated area* and do delayed
allocation, the speculative preallocation beyond EOF is double the
size of the extent at EOF. i.e. 512k, leading to 768k being
allocated to the file (1536 blocks, exactly).

Thank you for the details.
This is exactly where I am = a bit perplexed. Since the reclamation logic skips inodes that have the XFS= _DIFLAG_PREALLOC flag set, why did the allocation logic allot more blocks o= n such an inode?
My understanding is that the fallocate caller on= ly requested for 256K worth of blocks to be available sequentially if possi= ble. On any subsequent write beyond the EOF, the caller is completely unawa= re of the underlying file-system storing that data adjacent to the first 25= 6K data. Since XFS is speculatively allocating additional space (512K) adja= cent to the first 256K data, I would expect XFS to either treat these two a= llocations distinctly and NOT mark XFS_DIFLAG_PREALLOC on the additional 51= 2K data(minus the actually used additional data=3D1K), OR remove XFS_DIFLAG= _PREALLOC flag on the entire inode.

Also, is there= any way I can check for this flag?
The FLAGS, as observed from x= fs_bmap doesn't show any flags set to it. Am I not looking at the right= flags?=C2=A0

# xfs_bmap -lpv /srv/node/r16/o= bjects/10/ff3/55517cd029bee36151a5098ce7cdeff3/1453771923.11401.data
<= div>/srv/node/r16/objects/10/ff3/55517cd029bee36151a5098ce7cdeff3/145377192= 3.11401.data:
EXT: FILE-OFFSET BLOCK-RANGE AG AG-OFFSET TOTAL FLA= GS
0: [0..1535]: 1465876416..1465877951 1 (744384..745919) 1536 0= 0000

Thanks & Regards,
Dilip


This is expected behaviour.

> # xfs_io -f -c "pwrite 0 257k" /srv/node/r1/t2.txt
> # stat=C2=A0 /srv/node/r1/t2.txt | grep Blocks
> Size: 263168=C2=A0 =C2=A0 *Blocks*: 520=C2=A0 =C2=A0 =C2=A0 =C2= =A0 IO Block: 4096=C2=A0 =C2=A0regular file

So pure delayed allocation, specualtive preallocation starts at 64k
file size, so it would have been (((64k + 64K) + 128K) + 256k) =3D
768k.


> I waited for around 15 mins before collecting the stat output to give = the
> background reclamation logic a fair chance to do its job. I also tried=
> changing the value of speculative_prealloc_lifetime from 300 to 10. Bu= t it
> was of no use.

The prealloc cleaner skips inodes with XFS_DIFLAG_PREALLOC set on them.

Because the XFS_DIFLAG_PREALLOC flag is not set on the delayed
allocation inode, the EOF blocks cleaner runs truncates it to EOF,
and 260k (520 blocks) remains allocated to the file.

i.e. you are seeing behaviour exactly as designed and intended.

The way swift is using fallocate is actively harmful. You do not
want preallocation for write once files - this is exactly the
workload that delayed allocation was designed to be optimal for as
delayed allocation sequentialises the IO from multiple files.

Using preallocation means writeback of the data cannot be optimised
across files as the preallocation location will not be sequential to
the IO that was just issued, hence writeback will seek the disks
back and forth instead of seeing a nice sequential IO stream.

<sigh>

Yet another way that the swift storage back end tries to be smart
but ends up just making things go slow....

Cheers,

Dave.
--
Dave Chinner
david@fromorbit.com

--001a11c301dce56573052ad84c24-- From david@fromorbit.com Wed Feb 3 02:31:29 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=ham version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay2.corp.sgi.com [137.38.102.29]) by oss.sgi.com (Postfix) with ESMTP id EC6C829DF5 for ; Wed, 3 Feb 2016 02:31:28 -0600 (CST) Received: from cuda.sgi.com (cuda3.sgi.com [192.48.176.15]) by relay2.corp.sgi.com (Postfix) with ESMTP id DDC73304043 for ; Wed, 3 Feb 2016 00:31:25 -0800 (PST) X-ASG-Debug-ID: 1454488254-04cb6c379619080001-NocioJ Received: from ipmail07.adl2.internode.on.net (ipmail07.adl2.internode.on.net [150.101.137.131]) by cuda.sgi.com with ESMTP id W9Yco8tWrbhgOTuu for ; Wed, 03 Feb 2016 00:30:54 -0800 (PST) X-Barracuda-Envelope-From: david@fromorbit.com X-Barracuda-Apparent-Source-IP: 150.101.137.131 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: A2AWCQAgurFW/xATLHlegzqBP4JphXKeDgEBAQEBBotkiUiGBwICAQECgTZNAQEBAQEBgQuEQQEBAQMBOhwVDgULCAMOCgklDwUlAyETiBMHv2QBAQEBBgIBHRiFMIR+h12BDwWWcY1EgWSNFmmKBYNSYoIDGYFcKC6JawEBAQ Received: from ppp121-44-19-16.lns20.syd4.internode.on.net (HELO dastard) ([121.44.19.16]) by ipmail07.adl2.internode.on.net with ESMTP; 03 Feb 2016 19:00:29 +1030 Received: from dave by dastard with local (Exim 4.80) (envelope-from ) id 1aQspM-0003HM-U2; Wed, 03 Feb 2016 19:30:16 +1100 Date: Wed, 3 Feb 2016 19:30:16 +1100 From: Dave Chinner To: Dilip Simha Cc: Eric Sandeen , xfs@oss.sgi.com Subject: Re: Request for information on bloated writes using Swift Message-ID: <20160203083016.GD459@dastard> X-ASG-Orig-Subj: Re: Request for information on bloated writes using Swift References: <56B16A3C.1030207@sandeen.net> <20160203063705.GB459@dastard> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.21 (2010-09-15) X-Barracuda-Connect: ipmail07.adl2.internode.on.net[150.101.137.131] X-Barracuda-Start-Time: 1454488254 X-Barracuda-URL: https://192.48.176.15:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-BRTS-Status: 1 X-Barracuda-Spam-Score: 0.00 X-Barracuda-Spam-Status: No, SCORE=0.00 using per-user scores of TAG_LEVEL=1000.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.7 tests=BSF_SC0_MISMATCH_TO X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.3.26700 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 0.00 BSF_SC0_MISMATCH_TO Envelope rcpt doesn't match header On Tue, Feb 02, 2016 at 11:09:15PM -0800, Dilip Simha wrote: > Hi Dave, > > On Tue, Feb 2, 2016 at 10:37 PM, Dave Chinner wrote: > > > On Tue, Feb 02, 2016 at 07:40:34PM -0800, Dilip Simha wrote: > > > Hi Eric, > > > > > > Thank you for your quick reply. > > > > > > Using xfs_io as per your suggestion, I am able to reproduce the issue. > > > However, I need to falloc for 256K and write for 257K to see this issue. > > > > > > # xfs_io -f -c "falloc 0 256k" -c "pwrite 0 257k" /srv/node/r1/t1.txt > > > # stat /srv/node/r1/t4.txt | grep Blocks > > > Size: 263168 Blocks: 1536 IO Block: 4096 regular file > > > > Fallocate sets the XFS_DIFLAG_PREALLOC on the inode. > > > > When you writing *past the preallocated area* and do delayed > > allocation, the speculative preallocation beyond EOF is double the > > size of the extent at EOF. i.e. 512k, leading to 768k being > > allocated to the file (1536 blocks, exactly). > > > > Thank you for the details. > This is exactly where I am a bit perplexed. Since the reclamation logic > skips inodes that have the XFS_DIFLAG_PREALLOC flag set, why did the > allocation logic allot more blocks on such an inode? To store the data you wrote outside the preallocated region, of course. > My understanding is that the fallocate caller only requested for 256K worth > of blocks to be available sequentially if possible. fallocate only guarantees the blocks are allocated - it does not guarantee anything about the layout of the blocks. > On any subsequent write beyond the EOF, the caller is completely > unaware of the underlying file-system storing that data adjacent > to the first 256K data. Since XFS is speculatively allocating > additional space (512K) adjacent to the first 256K data, I would > expect XFS to either treat these two allocations distinctly and > NOT mark XFS_DIFLAG_PREALLOC on the additional 512K data(minus the > actually used additional data=1K), OR remove XFS_DIFLAG_PREALLOC > flag on the entire inode. Oh, if only it were that simple. It's way more complex than I have time to explain here. Fundamentally, XFS_DIFLAG_PREALLOC is used to indicate that persistent preallocation has been done on the file, and so if that has happened we need to turn off optimistic removal of blocks anywhere in the file because we can't tell what blocks had persistent preallocation done on them after the fact. That's the way it's been since unwritten extents were added to XFS back in 1998, and I don't really see the need for it to change right now. If an application wants to mix fallocate and delayed allocatin writes to the same file in the same IO, then that's an application bug. It's going to cause bad IO patterns and file fragmentation and have other side effects (as you've noticed), and there's nothing the filesystem can do about it. fallocate() requires expertise to use in a beneficial manner - most developers do not have the required expertise (and don't have enough expertise to realise this) and so usually make things worse rather than better by using fallocate. > Also, is there any way I can check for this flag? > The FLAGS, as observed from xfs_bmap doesn't show any flags set to it. Am I > not looking at the right flags? xfs_io -c stat Cheers, Dave. -- Dave Chinner david@fromorbit.com From bfoster@redhat.com Wed Feb 3 06:37:09 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=ham version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay2.corp.sgi.com [137.38.102.29]) by oss.sgi.com (Postfix) with ESMTP id D7A4B7CA1 for ; Wed, 3 Feb 2016 06:37:09 -0600 (CST) Received: from cuda.sgi.com (cuda1.sgi.com [192.48.157.11]) by relay2.corp.sgi.com (Postfix) with ESMTP id 9C83C304048 for ; Wed, 3 Feb 2016 04:37:06 -0800 (PST) X-ASG-Debug-ID: 1454503024-04bdf0705424ca0001-NocioJ Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by cuda.sgi.com with ESMTP id y8UcZcmyAcvudLm0 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO) for ; Wed, 03 Feb 2016 04:37:05 -0800 (PST) X-Barracuda-Envelope-From: bfoster@redhat.com X-Barracuda-Apparent-Source-IP: 209.132.183.28 X-ASG-Whitelist: Client Received: from int-mx10.intmail.prod.int.phx2.redhat.com (int-mx10.intmail.prod.int.phx2.redhat.com [10.5.11.23]) by mx1.redhat.com (Postfix) with ESMTPS id A4EEDA4CB5; Wed, 3 Feb 2016 12:37:04 +0000 (UTC) Received: from bfoster.bfoster (dhcp-41-164.bos.redhat.com [10.18.41.164]) by int-mx10.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id u13Cb4TP013043; Wed, 3 Feb 2016 07:37:04 -0500 Received: by bfoster.bfoster (Postfix, from userid 1000) id CF0071200ED; Wed, 3 Feb 2016 07:37:03 -0500 (EST) Date: Wed, 3 Feb 2016 07:37:03 -0500 From: Brian Foster To: "Darrick J. Wong" Cc: xfs@oss.sgi.com Subject: Re: [PATCH 3/3] xfs: check sizes of XFS on-disk structures at compile time Message-ID: <20160203123702.GA20211@bfoster.bfoster> X-ASG-Orig-Subj: Re: [PATCH 3/3] xfs: check sizes of XFS on-disk structures at compile time References: <20160123003425.2338.18133.stgit@birch.djwong.org> <20160123003444.2338.37236.stgit@birch.djwong.org> <20160127133117.GD60730@bfoster.bfoster> <20160202232735.GE22352@birch.djwong.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20160202232735.GE22352@birch.djwong.org> User-Agent: Mutt/1.5.24 (2015-08-30) X-Scanned-By: MIMEDefang 2.68 on 10.5.11.23 X-Barracuda-Connect: mx1.redhat.com[209.132.183.28] X-Barracuda-Start-Time: 1454503025 X-Barracuda-Encrypted: ECDHE-RSA-AES256-GCM-SHA384 X-Barracuda-URL: https://192.48.157.11:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-BRTS-Status: 1 On Tue, Feb 02, 2016 at 03:27:35PM -0800, Darrick J. Wong wrote: > On Wed, Jan 27, 2016 at 08:31:17AM -0500, Brian Foster wrote: > > On Fri, Jan 22, 2016 at 04:34:44PM -0800, Darrick J. Wong wrote: > > > Check the sizes of XFS on-disk structures when compiling the kernel. > > > Use this to catch inadvertent changes in structure size due to padding > > > and alignment issues, etc. > > > > > > Signed-off-by: Darrick J. Wong > > > --- > > > fs/xfs/xfs_ondisk.h | 108 +++++++++++++++++++++++++++++++++++++++++++++++++++ > > > fs/xfs/xfs_super.c | 3 + > > > 2 files changed, 111 insertions(+) > > > create mode 100644 fs/xfs/xfs_ondisk.h > > > > > > > > > diff --git a/fs/xfs/xfs_ondisk.h b/fs/xfs/xfs_ondisk.h > > > new file mode 100644 > > > index 0000000..56fab46 > > > --- /dev/null > > > +++ b/fs/xfs/xfs_ondisk.h > > > @@ -0,0 +1,108 @@ > > > +/* > > > + * Copyright (c) 2016 Oracle. > > > + * All Rights Reserved. > > > + * > > > + * This program is free software; you can redistribute it and/or > > > + * modify it under the terms of the GNU General Public License as > > > + * published by the Free Software Foundation. > > > + * > > > + * This program is distributed in the hope that it would be useful, > > > + * but WITHOUT ANY WARRANTY; without even the implied warranty of > > > + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the > > > + * GNU General Public License for more details. > > > + * > > > + * You should have received a copy of the GNU General Public License > > > + * along with this program; if not, write the Free Software Foundation, > > > + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA > > > + */ > > > +#ifndef __XFS_ONDISK_H > > > +#define __XFS_ONDISK_H > > > + > > > +#define XFS_CHECK_STRUCT_SIZE(structname, size) \ > > > + BUILD_BUG_ON_MSG(sizeof(structname) != (size), "XFS: sizeof(struct " \ > > > > We're printing "struct" in the core message as well as part of the > > structname (where appropriate). E.g., "sizeof(struct struct xfs_acl) is > > wrong, ..." > > Heh, fixed. > > > It would also be nice to include the current structure size in the > > message if it happens to be unexpected. Otherwise, seems fine to me. > > I don't think it's possible to pass the size to __attribute__((error(msg...)))? > > gcc only seems only to accept string arguments to the error() attribute. > Ah, I guess we'd have to preconstruct the string or something like that. Definitely not worth it, thanks! Brian > --D > > > > > Brian > > > > > + #structname ") is wrong, expected " #size) > > > + > > > > > +static inline void __init > > > +xfs_check_ondisk_structs(void) > > > +{ > > > + /* ag/file structures */ > > > + XFS_CHECK_STRUCT_SIZE(struct xfs_acl, 4); > > > + XFS_CHECK_STRUCT_SIZE(struct xfs_acl_entry, 12); > > > + XFS_CHECK_STRUCT_SIZE(struct xfs_agf, 224); > > > + XFS_CHECK_STRUCT_SIZE(struct xfs_agfl, 36); > > > + XFS_CHECK_STRUCT_SIZE(struct xfs_agi, 336); > > > + XFS_CHECK_STRUCT_SIZE(struct xfs_bmbt_key, 8); > > > + XFS_CHECK_STRUCT_SIZE(struct xfs_bmbt_rec, 16); > > > + XFS_CHECK_STRUCT_SIZE(struct xfs_bmdr_block, 4); > > > + XFS_CHECK_STRUCT_SIZE(struct xfs_btree_block, 72); > > > + XFS_CHECK_STRUCT_SIZE(struct xfs_dinode, 176); > > > + XFS_CHECK_STRUCT_SIZE(struct xfs_disk_dquot, 104); > > > + XFS_CHECK_STRUCT_SIZE(struct xfs_dqblk, 136); > > > + XFS_CHECK_STRUCT_SIZE(struct xfs_dsb, 264); > > > + XFS_CHECK_STRUCT_SIZE(struct xfs_dsymlink_hdr, 56); > > > + XFS_CHECK_STRUCT_SIZE(struct xfs_inobt_key, 4); > > > + XFS_CHECK_STRUCT_SIZE(struct xfs_inobt_rec, 16); > > > + XFS_CHECK_STRUCT_SIZE(struct xfs_timestamp, 8); > > > + XFS_CHECK_STRUCT_SIZE(xfs_alloc_key_t, 8); > > > + XFS_CHECK_STRUCT_SIZE(xfs_alloc_ptr_t, 4); > > > + XFS_CHECK_STRUCT_SIZE(xfs_alloc_rec_t, 8); > > > + XFS_CHECK_STRUCT_SIZE(xfs_inobt_ptr_t, 4); > > > + > > > + /* dir/attr trees */ > > > + XFS_CHECK_STRUCT_SIZE(struct xfs_attr3_leaf_hdr, 80); > > > + XFS_CHECK_STRUCT_SIZE(struct xfs_attr3_leafblock, 88); > > > + XFS_CHECK_STRUCT_SIZE(struct xfs_attr3_rmt_hdr, 56); > > > + XFS_CHECK_STRUCT_SIZE(struct xfs_da3_blkinfo, 56); > > > + XFS_CHECK_STRUCT_SIZE(struct xfs_da3_intnode, 64); > > > + XFS_CHECK_STRUCT_SIZE(struct xfs_da3_node_hdr, 64); > > > + XFS_CHECK_STRUCT_SIZE(struct xfs_dir3_blk_hdr, 48); > > > + XFS_CHECK_STRUCT_SIZE(struct xfs_dir3_data_hdr, 64); > > > + XFS_CHECK_STRUCT_SIZE(struct xfs_dir3_free, 64); > > > + XFS_CHECK_STRUCT_SIZE(struct xfs_dir3_free_hdr, 64); > > > + XFS_CHECK_STRUCT_SIZE(struct xfs_dir3_leaf, 64); > > > + XFS_CHECK_STRUCT_SIZE(struct xfs_dir3_leaf_hdr, 64); > > > + XFS_CHECK_STRUCT_SIZE(xfs_attr_leaf_entry_t, 8); > > > + XFS_CHECK_STRUCT_SIZE(xfs_attr_leaf_hdr_t, 32); > > > + XFS_CHECK_STRUCT_SIZE(xfs_attr_leaf_map_t, 4); > > > + XFS_CHECK_STRUCT_SIZE(xfs_attr_leaf_name_local_t, 4); > > > + XFS_CHECK_STRUCT_SIZE(xfs_attr_leaf_name_remote_t, 12); > > > + XFS_CHECK_STRUCT_SIZE(xfs_attr_leafblock_t, 40); > > > + XFS_CHECK_STRUCT_SIZE(xfs_attr_shortform_t, 8); > > > + XFS_CHECK_STRUCT_SIZE(xfs_da_blkinfo_t, 12); > > > + XFS_CHECK_STRUCT_SIZE(xfs_da_intnode_t, 16); > > > + XFS_CHECK_STRUCT_SIZE(xfs_da_node_entry_t, 8); > > > + XFS_CHECK_STRUCT_SIZE(xfs_da_node_hdr_t, 16); > > > + XFS_CHECK_STRUCT_SIZE(xfs_dir2_data_free_t, 4); > > > + XFS_CHECK_STRUCT_SIZE(xfs_dir2_data_hdr_t, 16); > > > + XFS_CHECK_STRUCT_SIZE(xfs_dir2_data_unused_t, 6); > > > + XFS_CHECK_STRUCT_SIZE(xfs_dir2_free_hdr_t, 16); > > > + XFS_CHECK_STRUCT_SIZE(xfs_dir2_free_t, 16); > > > + XFS_CHECK_STRUCT_SIZE(xfs_dir2_ino4_t, 4); > > > + XFS_CHECK_STRUCT_SIZE(xfs_dir2_ino8_t, 8); > > > + XFS_CHECK_STRUCT_SIZE(xfs_dir2_inou_t, 8); > > > + XFS_CHECK_STRUCT_SIZE(xfs_dir2_leaf_entry_t, 8); > > > + XFS_CHECK_STRUCT_SIZE(xfs_dir2_leaf_hdr_t, 16); > > > + XFS_CHECK_STRUCT_SIZE(xfs_dir2_leaf_t, 16); > > > + XFS_CHECK_STRUCT_SIZE(xfs_dir2_leaf_tail_t, 4); > > > + XFS_CHECK_STRUCT_SIZE(xfs_dir2_sf_entry_t, 3); > > > + XFS_CHECK_STRUCT_SIZE(xfs_dir2_sf_hdr_t, 10); > > > + XFS_CHECK_STRUCT_SIZE(xfs_dir2_sf_off_t, 2); > > > + > > > + /* log structures */ > > > + XFS_CHECK_STRUCT_SIZE(struct xfs_dq_logformat, 24); > > > + XFS_CHECK_STRUCT_SIZE(struct xfs_efd_log_format_32, 28); > > > + XFS_CHECK_STRUCT_SIZE(struct xfs_efd_log_format_64, 32); > > > + XFS_CHECK_STRUCT_SIZE(struct xfs_efi_log_format_32, 28); > > > + XFS_CHECK_STRUCT_SIZE(struct xfs_efi_log_format_64, 32); > > > + XFS_CHECK_STRUCT_SIZE(struct xfs_extent_32, 12); > > > + XFS_CHECK_STRUCT_SIZE(struct xfs_extent_64, 16); > > > + XFS_CHECK_STRUCT_SIZE(struct xfs_icdinode, 176); > > > + XFS_CHECK_STRUCT_SIZE(struct xfs_icreate_log, 28); > > > + XFS_CHECK_STRUCT_SIZE(struct xfs_ictimestamp, 8); > > > + XFS_CHECK_STRUCT_SIZE(struct xfs_inode_log_format_32, 52); > > > + XFS_CHECK_STRUCT_SIZE(struct xfs_inode_log_format_64, 56); > > > + XFS_CHECK_STRUCT_SIZE(struct xfs_qoff_logformat, 20); > > > + XFS_CHECK_STRUCT_SIZE(struct xfs_trans_header, 16); > > > +} > > > + > > > +#endif /* __XFS_ONDISK_H */ > > > diff --git a/fs/xfs/xfs_super.c b/fs/xfs/xfs_super.c > > > index 36bd882..f63d212 100644 > > > --- a/fs/xfs/xfs_super.c > > > +++ b/fs/xfs/xfs_super.c > > > @@ -45,6 +45,7 @@ > > > #include "xfs_filestream.h" > > > #include "xfs_quota.h" > > > #include "xfs_sysfs.h" > > > +#include "xfs_ondisk.h" > > > > > > #include > > > #include > > > @@ -1817,6 +1818,8 @@ init_xfs_fs(void) > > > { > > > int error; > > > > > > + xfs_check_ondisk_structs(); > > > + > > > printk(KERN_INFO XFS_VERSION_STRING " with " > > > XFS_BUILD_OPTIONS " enabled\n"); > > > > > > > > > _______________________________________________ > > > xfs mailing list > > > xfs@oss.sgi.com > > > http://oss.sgi.com/mailman/listinfo/xfs > > _______________________________________________ > xfs mailing list > xfs@oss.sgi.com > http://oss.sgi.com/mailman/listinfo/xfs From bfoster@redhat.com Wed Feb 3 07:52:26 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=ham version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay2.corp.sgi.com [137.38.102.29]) by oss.sgi.com (Postfix) with ESMTP id BE5447CA3 for ; Wed, 3 Feb 2016 07:52:26 -0600 (CST) Received: from cuda.sgi.com (cuda1.sgi.com [192.48.157.11]) by relay2.corp.sgi.com (Postfix) with ESMTP id 945B6304043 for ; Wed, 3 Feb 2016 05:52:23 -0800 (PST) X-ASG-Debug-ID: 1454507538-04bdf0705326f20001-NocioJ Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by cuda.sgi.com with ESMTP id 2vC2FokvQ3tpeyD5 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO) for ; Wed, 03 Feb 2016 05:52:18 -0800 (PST) X-Barracuda-Envelope-From: bfoster@redhat.com X-Barracuda-Apparent-Source-IP: 209.132.183.28 X-ASG-Whitelist: Client Received: from int-mx13.intmail.prod.int.phx2.redhat.com (int-mx13.intmail.prod.int.phx2.redhat.com [10.5.11.26]) by mx1.redhat.com (Postfix) with ESMTPS id D46DA686; Wed, 3 Feb 2016 13:52:17 +0000 (UTC) Received: from bfoster.bfoster (dhcp-41-164.bos.redhat.com [10.18.41.164]) by int-mx13.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id u13DqH3o001743; Wed, 3 Feb 2016 08:52:17 -0500 Received: by bfoster.bfoster (Postfix, from userid 1000) id AB1031200ED; Wed, 3 Feb 2016 08:52:16 -0500 (EST) Date: Wed, 3 Feb 2016 08:52:16 -0500 From: Brian Foster To: Christoph Hellwig Cc: linux-fsdevel@vger.kernel.org, xfs@oss.sgi.com, linux-ext4@vger.kernel.org, ocfs2-devel@oss.oracle.com, darrick.wong@oracle.com Subject: Re: [PATCH 2/3] xfs: don't use ioends for direct write completions Message-ID: <20160203135216.GC20211@bfoster.bfoster> X-ASG-Orig-Subj: Re: [PATCH 2/3] xfs: don't use ioends for direct write completions References: <1454444257-9086-1-git-send-email-hch@lst.de> <1454444257-9086-3-git-send-email-hch@lst.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1454444257-9086-3-git-send-email-hch@lst.de> User-Agent: Mutt/1.5.24 (2015-08-30) X-Scanned-By: MIMEDefang 2.68 on 10.5.11.26 X-Barracuda-Connect: mx1.redhat.com[209.132.183.28] X-Barracuda-Start-Time: 1454507538 X-Barracuda-Encrypted: ECDHE-RSA-AES256-GCM-SHA384 X-Barracuda-URL: https://192.48.157.11:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-BRTS-Status: 1 On Tue, Feb 02, 2016 at 09:17:36PM +0100, Christoph Hellwig wrote: > We only need to communicate two bits of information to the direct I/O > completion handler: > > (1) do we need to convert any unwritten extents in the range > (2) do we need to check if we need to update the inode size based > on the range passed to the completion handler > > We can use the private data passed to the get_block handler and the > completion handler as a simple bitmask to communicate this information > instead of the current complicated infrastructure reusing the ioends > from the buffer I/O path, and thus avoiding a memory allocation and > a context switch for any non-trivial direct write. As a nice side > effect we also decouple the direct I/O path implementation from that > of the buffered I/O path. > > Signed-off-by: Christoph Hellwig > --- > fs/xfs/xfs_aops.c | 216 ++++++++++++++++++----------------------------------- > fs/xfs/xfs_trace.h | 9 +-- > 2 files changed, 77 insertions(+), 148 deletions(-) > > diff --git a/fs/xfs/xfs_aops.c b/fs/xfs/xfs_aops.c > index c318e9f..f6b08ea 100644 > --- a/fs/xfs/xfs_aops.c > +++ b/fs/xfs/xfs_aops.c ... > @@ -1570,42 +1516,50 @@ xfs_get_blocks_dax_fault( > return __xfs_get_blocks(inode, iblock, bh_result, create, true, true); > } > > -static void > -__xfs_end_io_direct_write( > - struct inode *inode, > - struct xfs_ioend *ioend, > +/* > + * Complete a direct I/O write request. > + * > + * xfs_map_direct passes us some flags in the private data to tell us what to > + * do. If not flags are set, then the write IO is an overwrite wholly within "If no flags ..." Otherwise, looks fine: Reviewed-by: Brian Foster > + * the existing allocated file size and so there is nothing for us to do. > + * > + * Note that in this case the completion can be called in interrupt context, > + * whereas if we have flags set we will always be called in task context > + * (i.e. from a workqueue). > + */ > +STATIC void > +xfs_end_io_direct_write( > + struct kiocb *iocb, > loff_t offset, > - ssize_t size) > + ssize_t size, > + void *private) > { > - struct xfs_mount *mp = XFS_I(inode)->i_mount; > + struct inode *inode = file_inode(iocb->ki_filp); > + struct xfs_inode *ip = XFS_I(inode); > + struct xfs_mount *mp = ip->i_mount; > + uintptr_t flags = (uintptr_t)private; > + int error = 0; > > - if (XFS_FORCED_SHUTDOWN(mp) || ioend->io_error) > - goto out_end_io; > + trace_xfs_end_io_direct_write(ip, offset, size); > > - /* > - * dio completion end_io functions are only called on writes if more > - * than 0 bytes was written. > - */ > - ASSERT(size > 0); > + if (XFS_FORCED_SHUTDOWN(mp)) > + return; > > - /* > - * The ioend only maps whole blocks, while the IO may be sector aligned. > - * Hence the ioend offset/size may not match the IO offset/size exactly. > - * Because we don't map overwrites within EOF into the ioend, the offset > - * may not match, but only if the endio spans EOF. Either way, write > - * the IO sizes into the ioend so that completion processing does the > - * right thing. > - */ > - ASSERT(offset + size <= ioend->io_offset + ioend->io_size); > - ioend->io_size = size; > - ioend->io_offset = offset; > + if (size <= 0) > + return; > > /* > - * The ioend tells us whether we are doing unwritten extent conversion > + * The flags tell us whether we are doing unwritten extent conversion > * or an append transaction that updates the on-disk file size. These > * cases are the only cases where we should *potentially* be needing > * to update the VFS inode size. > - * > + */ > + if (flags == 0) { > + ASSERT(offset + size <= i_size_read(inode)); > + return; > + } > + > + /* > * We need to update the in-core inode size here so that we don't end up > * with the on-disk inode size being outside the in-core inode size. We > * have no other method of updating EOF for AIO, so always do it here > @@ -1616,57 +1570,33 @@ __xfs_end_io_direct_write( > * here can result in EOF moving backwards and Bad Things Happen when > * that occurs. > */ > - spin_lock(&XFS_I(inode)->i_flags_lock); > + spin_lock(&ip->i_flags_lock); > if (offset + size > i_size_read(inode)) > i_size_write(inode, offset + size); > - spin_unlock(&XFS_I(inode)->i_flags_lock); > + spin_unlock(&ip->i_flags_lock); > > - /* > - * If we are doing an append IO that needs to update the EOF on disk, > - * do the transaction reserve now so we can use common end io > - * processing. Stashing the error (if there is one) in the ioend will > - * result in the ioend processing passing on the error if it is > - * possible as we can't return it from here. > - */ > - if (ioend->io_type == XFS_IO_OVERWRITE) > - ioend->io_error = xfs_setfilesize_trans_alloc(ioend); > + if (flags & XFS_DIO_FLAG_UNWRITTEN) { > + trace_xfs_end_io_direct_write_unwritten(ip, offset, size); > > -out_end_io: > - xfs_end_io(&ioend->io_work); > - return; > -} > + error = xfs_iomap_write_unwritten(ip, offset, size); > > -/* > - * Complete a direct I/O write request. > - * > - * The ioend structure is passed from __xfs_get_blocks() to tell us what to do. > - * If no ioend exists (i.e. @private == NULL) then the write IO is an overwrite > - * wholly within the EOF and so there is nothing for us to do. Note that in this > - * case the completion can be called in interrupt context, whereas if we have an > - * ioend we will always be called in task context (i.e. from a workqueue). > - */ > -STATIC void > -xfs_end_io_direct_write( > - struct kiocb *iocb, > - loff_t offset, > - ssize_t size, > - void *private) > -{ > - struct inode *inode = file_inode(iocb->ki_filp); > - struct xfs_ioend *ioend = private; > + WARN_ON_ONCE(error); > + } else if (flags & XFS_DIO_FLAG_APPEND) { > + struct xfs_trans *tp; > > - if (size <= 0) > - return; > + trace_xfs_end_io_direct_write_append(ip, offset, size); > > - trace_xfs_gbmap_direct_endio(XFS_I(inode), offset, size, > - ioend ? ioend->io_type : 0, NULL); > + tp = xfs_trans_alloc(mp, XFS_TRANS_FSYNC_TS); > > - if (!ioend) { > - ASSERT(offset + size <= i_size_read(inode)); > - return; > + error = xfs_trans_reserve(tp, &M_RES(mp)->tr_fsyncts, 0, 0); > + if (error) { > + xfs_trans_cancel(tp); > + WARN_ON_ONCE(error); > + return; > + } > + error = xfs_setfilesize(ip, tp, offset, size); > + WARN_ON_ONCE(error); > } > - > - __xfs_end_io_direct_write(inode, ioend, offset, size); > } > > static inline ssize_t > diff --git a/fs/xfs/xfs_trace.h b/fs/xfs/xfs_trace.h > index 391d797..c8d5842 100644 > --- a/fs/xfs/xfs_trace.h > +++ b/fs/xfs/xfs_trace.h > @@ -1296,11 +1296,7 @@ DEFINE_IOMAP_EVENT(xfs_map_blocks_found); > DEFINE_IOMAP_EVENT(xfs_map_blocks_alloc); > DEFINE_IOMAP_EVENT(xfs_get_blocks_found); > DEFINE_IOMAP_EVENT(xfs_get_blocks_alloc); > -DEFINE_IOMAP_EVENT(xfs_gbmap_direct); > -DEFINE_IOMAP_EVENT(xfs_gbmap_direct_new); > -DEFINE_IOMAP_EVENT(xfs_gbmap_direct_update); > -DEFINE_IOMAP_EVENT(xfs_gbmap_direct_none); > -DEFINE_IOMAP_EVENT(xfs_gbmap_direct_endio); > +DEFINE_IOMAP_EVENT(xfs_get_blocks_map_direct); > > DECLARE_EVENT_CLASS(xfs_simple_io_class, > TP_PROTO(struct xfs_inode *ip, xfs_off_t offset, ssize_t count), > @@ -1340,6 +1336,9 @@ DEFINE_SIMPLE_IO_EVENT(xfs_unwritten_convert); > DEFINE_SIMPLE_IO_EVENT(xfs_get_blocks_notfound); > DEFINE_SIMPLE_IO_EVENT(xfs_setfilesize); > DEFINE_SIMPLE_IO_EVENT(xfs_zero_eof); > +DEFINE_SIMPLE_IO_EVENT(xfs_end_io_direct_write); > +DEFINE_SIMPLE_IO_EVENT(xfs_end_io_direct_write_unwritten); > +DEFINE_SIMPLE_IO_EVENT(xfs_end_io_direct_write_append); > > DECLARE_EVENT_CLASS(xfs_itrunc_class, > TP_PROTO(struct xfs_inode *ip, xfs_fsize_t new_size), > -- > 2.1.4 > > _______________________________________________ > xfs mailing list > xfs@oss.sgi.com > http://oss.sgi.com/mailman/listinfo/xfs From bfoster@redhat.com Wed Feb 3 07:52:28 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=ham version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay3.corp.sgi.com [198.149.34.15]) by oss.sgi.com (Postfix) with ESMTP id A76B57CA5 for ; Wed, 3 Feb 2016 07:52:27 -0600 (CST) Received: from cuda.sgi.com (cuda3.sgi.com [192.48.176.15]) by relay3.corp.sgi.com (Postfix) with ESMTP id 2DD9BAC004 for ; Wed, 3 Feb 2016 05:52:24 -0800 (PST) X-ASG-Debug-ID: 1454507542-04cb6c379826000001-NocioJ Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by cuda.sgi.com with ESMTP id 0wqGpokJ4aE1oehs (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO) for ; Wed, 03 Feb 2016 05:52:22 -0800 (PST) X-Barracuda-Envelope-From: bfoster@redhat.com X-Barracuda-Apparent-Source-IP: 209.132.183.28 X-ASG-Whitelist: Client Received: from int-mx09.intmail.prod.int.phx2.redhat.com (int-mx09.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by mx1.redhat.com (Postfix) with ESMTPS id E102247D4; Wed, 3 Feb 2016 13:52:21 +0000 (UTC) Received: from bfoster.bfoster (dhcp-41-164.bos.redhat.com [10.18.41.164]) by int-mx09.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id u13DqLsx003436; Wed, 3 Feb 2016 08:52:21 -0500 Received: by bfoster.bfoster (Postfix, from userid 1000) id 03B931200ED; Wed, 3 Feb 2016 08:52:20 -0500 (EST) Date: Wed, 3 Feb 2016 08:52:20 -0500 From: Brian Foster To: Christoph Hellwig Cc: linux-fsdevel@vger.kernel.org, xfs@oss.sgi.com, linux-ext4@vger.kernel.org, ocfs2-devel@oss.oracle.com, darrick.wong@oracle.com Subject: Re: [PATCH 3/3] xfs: fold xfs_vm_do_dio into xfs_vm_direct_IO Message-ID: <20160203135220.GD20211@bfoster.bfoster> X-ASG-Orig-Subj: Re: [PATCH 3/3] xfs: fold xfs_vm_do_dio into xfs_vm_direct_IO References: <1454444257-9086-1-git-send-email-hch@lst.de> <1454444257-9086-4-git-send-email-hch@lst.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1454444257-9086-4-git-send-email-hch@lst.de> User-Agent: Mutt/1.5.24 (2015-08-30) X-Scanned-By: MIMEDefang 2.68 on 10.5.11.22 X-Barracuda-Connect: mx1.redhat.com[209.132.183.28] X-Barracuda-Start-Time: 1454507542 X-Barracuda-Encrypted: ECDHE-RSA-AES256-GCM-SHA384 X-Barracuda-URL: https://192.48.176.15:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-BRTS-Status: 1 On Tue, Feb 02, 2016 at 09:17:37PM +0100, Christoph Hellwig wrote: > Signed-off-by: Christoph Hellwig > --- Reviewed-by: Brian Foster > fs/xfs/xfs_aops.c | 39 ++++++++++++++------------------------- > 1 file changed, 14 insertions(+), 25 deletions(-) > > diff --git a/fs/xfs/xfs_aops.c b/fs/xfs/xfs_aops.c > index f6b08ea..e3cb7f8 100644 > --- a/fs/xfs/xfs_aops.c > +++ b/fs/xfs/xfs_aops.c > @@ -1599,41 +1599,30 @@ xfs_end_io_direct_write( > } > } > > -static inline ssize_t > -xfs_vm_do_dio( > - struct inode *inode, > +STATIC ssize_t > +xfs_vm_direct_IO( > struct kiocb *iocb, > struct iov_iter *iter, > - loff_t offset, > - void (*endio)(struct kiocb *iocb, > - loff_t offset, > - ssize_t size, > - void *private), > - int flags) > + loff_t offset) > { > + struct inode *inode = iocb->ki_filp->f_mapping->host; > + dio_iodone_t *endio = NULL; > + int flags = 0; > struct block_device *bdev; > > - if (IS_DAX(inode)) > + if (iov_iter_rw(iter) == WRITE) { > + endio = xfs_end_io_direct_write; > + flags = DIO_ASYNC_EXTEND; > + } > + > + if (IS_DAX(inode)) { > return dax_do_io(iocb, inode, iter, offset, > xfs_get_blocks_direct, endio, 0); > + } > > bdev = xfs_find_bdev_for_inode(inode); > return __blockdev_direct_IO(iocb, inode, bdev, iter, offset, > - xfs_get_blocks_direct, endio, NULL, flags); > -} > - > -STATIC ssize_t > -xfs_vm_direct_IO( > - struct kiocb *iocb, > - struct iov_iter *iter, > - loff_t offset) > -{ > - struct inode *inode = iocb->ki_filp->f_mapping->host; > - > - if (iov_iter_rw(iter) == WRITE) > - return xfs_vm_do_dio(inode, iocb, iter, offset, > - xfs_end_io_direct_write, DIO_ASYNC_EXTEND); > - return xfs_vm_do_dio(inode, iocb, iter, offset, NULL, 0); > + xfs_get_blocks_direct, endio, NULL, flags); > } > > /* > -- > 2.1.4 > > _______________________________________________ > xfs mailing list > xfs@oss.sgi.com > http://oss.sgi.com/mailman/listinfo/xfs From sandeen@sandeen.net Wed Feb 3 09:02:51 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=ham version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay3.corp.sgi.com [198.149.34.15]) by oss.sgi.com (Postfix) with ESMTP id 2E8037CA1 for ; Wed, 3 Feb 2016 09:02:51 -0600 (CST) Received: from cuda.sgi.com (cuda2.sgi.com [192.48.176.25]) by relay3.corp.sgi.com (Postfix) with ESMTP id ADDFBAC001 for ; Wed, 3 Feb 2016 07:02:46 -0800 (PST) X-ASG-Debug-ID: 1454511761-04cbb04c967b0c0001-NocioJ Received: from sandeen.net (sandeen.net [63.231.237.45]) by cuda.sgi.com with ESMTP id zSBZLRMl9KfQmIFr for ; Wed, 03 Feb 2016 07:02:41 -0800 (PST) X-Barracuda-Envelope-From: sandeen@sandeen.net X-Barracuda-Apparent-Source-IP: 63.231.237.45 Received: from liberator.sandeen.net (liberator.sandeen.net [10.0.0.4]) (using TLSv1.2 with cipher DHE-RSA-AES128-SHA (128/128 bits)) (No client certificate requested) by sandeen.net (Postfix) with ESMTPSA id 1589163C6064; Wed, 3 Feb 2016 09:02:41 -0600 (CST) Subject: Re: Request for information on bloated writes using Swift To: Dave Chinner , Dilip Simha X-ASG-Orig-Subj: Re: Request for information on bloated writes using Swift References: <56B16A3C.1030207@sandeen.net> <20160203063705.GB459@dastard> <20160203083016.GD459@dastard> Cc: xfs@oss.sgi.com From: Eric Sandeen X-Enigmail-Draft-Status: N1110 Message-ID: <56B21690.2070304@sandeen.net> Date: Wed, 3 Feb 2016 09:02:40 -0600 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.11; rv:38.0) Gecko/20100101 Thunderbird/38.5.1 MIME-Version: 1.0 In-Reply-To: <20160203083016.GD459@dastard> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 8bit X-Barracuda-Connect: sandeen.net[63.231.237.45] X-Barracuda-Start-Time: 1454511761 X-Barracuda-URL: https://192.48.176.25:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-BRTS-Status: 1 X-Barracuda-Spam-Score: 0.00 X-Barracuda-Spam-Status: No, SCORE=0.00 using per-user scores of TAG_LEVEL=1000.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.7 tests=BSF_SC0_MISMATCH_TO X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.3.26706 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 0.00 BSF_SC0_MISMATCH_TO Envelope rcpt doesn't match header On 2/3/16 2:30 AM, Dave Chinner wrote: > On Tue, Feb 02, 2016 at 11:09:15PM -0800, Dilip Simha wrote: >> Hi Dave, >> >> On Tue, Feb 2, 2016 at 10:37 PM, Dave Chinner wrote: >> >>> On Tue, Feb 02, 2016 at 07:40:34PM -0800, Dilip Simha wrote: >>>> Hi Eric, >>>> >>>> Thank you for your quick reply. >>>> >>>> Using xfs_io as per your suggestion, I am able to reproduce the issue. >>>> However, I need to falloc for 256K and write for 257K to see this issue. >>>> >>>> # xfs_io -f -c "falloc 0 256k" -c "pwrite 0 257k" /srv/node/r1/t1.txt >>>> # stat /srv/node/r1/t4.txt | grep Blocks >>>> Size: 263168 Blocks: 1536 IO Block: 4096 regular file >>> >>> Fallocate sets the XFS_DIFLAG_PREALLOC on the inode. >>> >>> When you writing *past the preallocated area* and do delayed >>> allocation, the speculative preallocation beyond EOF is double the >>> size of the extent at EOF. i.e. 512k, leading to 768k being >>> allocated to the file (1536 blocks, exactly). >>> >> >> Thank you for the details. >> This is exactly where I am a bit perplexed. Since the reclamation logic >> skips inodes that have the XFS_DIFLAG_PREALLOC flag set, why did the >> allocation logic allot more blocks on such an inode? > > To store the data you wrote outside the preallocated region, of > course. I think what Dilip meant was, why does it do preallocation, not why does it allocate blocks for the data. That part is obvious of course. ;) IOWS, if XFS_DIFLAG_PREALLOC prevents speculative preallocation from being reclaimed, why is speculative preallocation added to files with that flag set? Seems like a fair question, even if Swift's use of preallocation is ill-advised. I don't have all the speculative preallocation heuristics in my head like you do Dave, but if I have it right, and it's i.e.: 1) preallocate 256k 2) inode gets XFS_DIFLAG_PREALLOC 3) write 257k 4) inode gets speculative preallocation added due to write past EOF 5) inode never gets preallocation trimmed due to XFS_DIFLAG_PREALLOC that seems suboptimal. Never doing speculative preallocation on files with XFS_DIFLAG_PREALLOC set, regardless of file offset, would seem sane to me. App asked to take control via prealloc; let it have it, and leave it at that. (Of course now I'll go read the code to see if I understand it properly...) -Eric From hch@lst.de Wed Feb 3 09:48:21 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=ham version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay3.corp.sgi.com [198.149.34.15]) by oss.sgi.com (Postfix) with ESMTP id 3B47F7CA1 for ; Wed, 3 Feb 2016 09:48:21 -0600 (CST) Received: from cuda.sgi.com (cuda2.sgi.com [192.48.176.25]) by relay3.corp.sgi.com (Postfix) with ESMTP id CC325AC005 for ; Wed, 3 Feb 2016 07:48:20 -0800 (PST) X-ASG-Debug-ID: 1454514496-04cbb04c95806a0001-NocioJ Received: from newverein.lst.de (verein.lst.de [213.95.11.211]) by cuda.sgi.com with ESMTP id 8DqS46Qqn64DuaeC (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO) for ; Wed, 03 Feb 2016 07:48:17 -0800 (PST) X-Barracuda-Envelope-From: hch@lst.de X-Barracuda-Apparent-Source-IP: 213.95.11.211 Received: by newverein.lst.de (Postfix, from userid 2407) id 1E738692C7; Wed, 3 Feb 2016 16:48:16 +0100 (CET) Date: Wed, 3 Feb 2016 16:48:16 +0100 From: Christoph Hellwig To: "Darrick J. Wong" Cc: linux-fsdevel@vger.kernel.org, xfs@oss.sgi.com, linux-ext4@vger.kernel.org, ocfs2-devel@oss.oracle.com Subject: Re: [PATCH 1/3] direct-io: always call ->end_io if non-NULL Message-ID: <20160203154816.GA2698@lst.de> X-ASG-Orig-Subj: Re: [PATCH 1/3] direct-io: always call ->end_io if non-NULL References: <1454444257-9086-1-git-send-email-hch@lst.de> <1454444257-9086-2-git-send-email-hch@lst.de> <20160203000510.GB5854@birch.djwong.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20160203000510.GB5854@birch.djwong.org> User-Agent: Mutt/1.5.17 (2007-11-01) X-Barracuda-Connect: verein.lst.de[213.95.11.211] X-Barracuda-Start-Time: 1454514497 X-Barracuda-Encrypted: ECDHE-RSA-AES256-GCM-SHA384 X-Barracuda-URL: https://192.48.176.25:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-BRTS-Status: 1 X-Barracuda-Spam-Score: 0.00 X-Barracuda-Spam-Status: No, SCORE=0.00 using per-user scores of TAG_LEVEL=1000.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.7 tests=BSF_SC0_MISMATCH_TO X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.3.26707 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 0.00 BSF_SC0_MISMATCH_TO Envelope rcpt doesn't match header > > - if (dio->end_io && dio->result) > > - dio->end_io(dio->iocb, offset, transferred, dio->private); > > + if (dio->end_io) > > + dio->end_io(dio->iocb, offset, ret, dio->private); > > Could we make end_io return an int so that errors during completion can be > stuffed into ret to be picked up by whatever's calling directio? Something > like this: > > if (dio->end_io) { > int ret2; > > ret2 = dio->end_io(dio->iocb, offset, ret, dio->private); > if (ret2 && !ret) > ret = ret2; > } > > That way I can capture IO errors during the CoW remapping step and pass them to > userland either via dio_complete()'s return value or through ki_complete. > > (If ret itself is an error code then obviously we don't bother with the > post-CoW remap.) Should be doable, I'll respin it with that change. From nmdilipsimha@gmail.com Wed Feb 3 10:11:14 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=FREEMAIL_FROM,HTML_MESSAGE, T_DKIM_INVALID autolearn=ham version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay1.corp.sgi.com [137.38.102.111]) by oss.sgi.com (Postfix) with ESMTP id 6E4727CA1 for ; Wed, 3 Feb 2016 10:11:14 -0600 (CST) Received: from cuda.sgi.com (cuda1.sgi.com [192.48.157.11]) by relay1.corp.sgi.com (Postfix) with ESMTP id 3818C8F8049 for ; Wed, 3 Feb 2016 08:11:14 -0800 (PST) X-ASG-Debug-ID: 1454515869-04bdf070522bed0001-NocioJ Received: from mail-ob0-f169.google.com (mail-ob0-f169.google.com [209.85.214.169]) by cuda.sgi.com with ESMTP id PnZKh6YRfwtEXEVV (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128 verify=NO) for ; Wed, 03 Feb 2016 08:11:09 -0800 (PST) X-Barracuda-Envelope-From: nmdilipsimha@gmail.com X-Barracuda-Apparent-Source-IP: 209.85.214.169 Received: by mail-ob0-f169.google.com with SMTP id ba1so36005985obb.3 for ; Wed, 03 Feb 2016 08:11:09 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc:content-type; bh=GxJE+eXRHkHwIxMHQ9HTfIKWXU+ikPYRwBXgfXSVYO4=; b=rOaMgRJZqiH5PLsX8C51FCJ662MoIM4bd0QZreezFn0hyKQsOsHss1FoeA0fFDhj0h c7DbNErxs/HkZ6ZhYYR33+KRAzqtirGMKi+enSgCRKKdeR2WxMhUNFy6gAS7LUt8VEU+ 35w1l2DUT5wH8c1GmIT4jMHGx37zj6fVKZ6ijQLttCdsz2u+42k8HsUlaGjEMK1qOZk5 3LNuoAKd8oc9rwA7ODNSLp5TlLvkxcn5XMtT1hsqdCRGP/ku+T9UKoLzQWiOQ7ECv8BB 2E7jGeqVCTooOQbT0Nc0hLxNQx8fX5pEHWWcF8K8xP8+5r8+pH+CCt0ZRNdxkp6Z5uxd b3WA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc:content-type; bh=GxJE+eXRHkHwIxMHQ9HTfIKWXU+ikPYRwBXgfXSVYO4=; b=ZpFTfBXy1ceIE7QwhKvE07RpaVGz1MWjtvPHaLJwlsZhUYYbCd6IjaS+K4wqMJFR42 sGNTg2kbwmGwj/MzT8DvaM00s53+SjArMk/RbdYf6OUVqO0hc0+jSAcflxDpZ5NYaZ6l qSUCWgsbHl1uEGhTylpvv0QCogPiEIMeSQ+x3AAMN7ndURmyrpNpX//avkA7rOvJirOO 51OxNKLXA74+rQO/pXf7xUWlv/VEG0YnVkd21Dm1F7h35UBs/8UzcwzS6L3xAuS1wXjR ItX17vglAmUJqK+mTfc13zBep0Mxe/wJI36dZN97tI6cAPFKzuiSRowz/isHnSngKgi3 nfCQ== X-Gm-Message-State: AG10YORhqi2SpCa+5USoctzhVRCpMWe4KufD+P+TCgVWzMi8XGAF1p+SHBb1eSW41omykioBrYBjeFPvwzpmfQ== X-Received: by 10.60.136.197 with SMTP id qc5mr3012872oeb.79.1454515865642; Wed, 03 Feb 2016 08:11:05 -0800 (PST) MIME-Version: 1.0 Received: by 10.202.86.204 with HTTP; Wed, 3 Feb 2016 08:10:46 -0800 (PST) In-Reply-To: <20160203083016.GD459@dastard> References: <56B16A3C.1030207@sandeen.net> <20160203063705.GB459@dastard> <20160203083016.GD459@dastard> From: Dilip Simha Date: Wed, 3 Feb 2016 08:10:46 -0800 Message-ID: Subject: Re: Request for information on bloated writes using Swift To: Dave Chinner X-ASG-Orig-Subj: Re: Request for information on bloated writes using Swift Cc: Eric Sandeen , xfs@oss.sgi.com Content-Type: multipart/alternative; boundary=089e0160c2b07dedfd052adfdd85 X-Barracuda-Connect: mail-ob0-f169.google.com[209.85.214.169] X-Barracuda-Start-Time: 1454515869 X-Barracuda-Encrypted: ECDHE-RSA-AES128-GCM-SHA256 X-Barracuda-URL: https://192.48.157.11:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-BRTS-Status: 1 X-Barracuda-Spam-Score: 0.00 X-Barracuda-Spam-Status: No, SCORE=0.00 using per-user scores of TAG_LEVEL=1000.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.7 tests=BSF_SC0_MISMATCH_TO, DKIM_SIGNED, DKIM_VERIFIED, HTML_MESSAGE X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.3.26707 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 0.00 BSF_SC0_MISMATCH_TO Envelope rcpt doesn't match header -0.00 DKIM_VERIFIED Domain Keys Identified Mail: signature passes verification 0.00 DKIM_SIGNED Domain Keys Identified Mail: message has a signature 0.00 HTML_MESSAGE BODY: HTML included in message --089e0160c2b07dedfd052adfdd85 Content-Type: text/plain; charset=UTF-8 On Wed, Feb 3, 2016 at 12:30 AM, Dave Chinner wrote: > On Tue, Feb 02, 2016 at 11:09:15PM -0800, Dilip Simha wrote: > > Hi Dave, > > > > On Tue, Feb 2, 2016 at 10:37 PM, Dave Chinner > wrote: > > > > > On Tue, Feb 02, 2016 at 07:40:34PM -0800, Dilip Simha wrote: > > > > Hi Eric, > > > > > > > > Thank you for your quick reply. > > > > > > > > Using xfs_io as per your suggestion, I am able to reproduce the > issue. > > > > However, I need to falloc for 256K and write for 257K to see this > issue. > > > > > > > > # xfs_io -f -c "falloc 0 256k" -c "pwrite 0 257k" /srv/node/r1/t1.txt > > > > # stat /srv/node/r1/t4.txt | grep Blocks > > > > Size: 263168 Blocks: 1536 IO Block: 4096 regular file > > > > > > Fallocate sets the XFS_DIFLAG_PREALLOC on the inode. > > > > > > When you writing *past the preallocated area* and do delayed > > > allocation, the speculative preallocation beyond EOF is double the > > > size of the extent at EOF. i.e. 512k, leading to 768k being > > > allocated to the file (1536 blocks, exactly). > > > > > > > Thank you for the details. > > This is exactly where I am a bit perplexed. Since the reclamation logic > > skips inodes that have the XFS_DIFLAG_PREALLOC flag set, why did the > > allocation logic allot more blocks on such an inode? > > To store the data you wrote outside the preallocated region, of > course. > > > My understanding is that the fallocate caller only requested for 256K > worth > > of blocks to be available sequentially if possible. > > fallocate only guarantees the blocks are allocated - it does not > guarantee anything about the layout of the blocks. > > > On any subsequent write beyond the EOF, the caller is completely > > unaware of the underlying file-system storing that data adjacent > > to the first 256K data. Since XFS is speculatively allocating > > additional space (512K) adjacent to the first 256K data, I would > > expect XFS to either treat these two allocations distinctly and > > NOT mark XFS_DIFLAG_PREALLOC on the additional 512K data(minus the > > actually used additional data=1K), OR remove XFS_DIFLAG_PREALLOC > > flag on the entire inode. > > Oh, if only it were that simple. It's way more complex than I have > time to explain here. > > Fundamentally, XFS_DIFLAG_PREALLOC is used to indicate that > persistent preallocation has been done on the file, and so if that > has happened we need to turn off optimistic removal of blocks > anywhere in the file because we can't tell what blocks had > persistent preallocation done on them after the fact. That's the > way it's been since unwritten extents were added to XFS back in > 1998, and I don't really see the need for it to change right now. > I completely understand the reasoning behind this reclamation logic and I also agree to it. But my question is with the allocation logic. I don't understand why XFS allocates more than necessary blocks when this flag is set and when it knows that its not going to clean up the additional space. A simple example would be: 1: Open File in Write mode. 2: Fallocate 256K 3: Write 256K 4: Close File Stat shows that XFS allocated 512 blocks as expected. 5: Open file in append mode. 6: Write 256 bytes. 7: Close file. Expectation is that the number of blocks allocated is either 512+1 or 512+8 depending on the block size. However, XFS uses speculative preallocation to allocate 512K (as per your explanation) to write 256 bytes and hence the overall disk usage goes up to 1536 blocks. Now, who is responsible for clearing up the additional allocated blocks? Clearly the application has no idea about the over-allocation. I agree that if an application uses fallocate and delayed allocation on the same file in the same IO, then its a badly structured application. But in this case we have two different IOs on the same file. The first IO did not expect an append and hence issued an fallocate. So that looks good to me. Your thoughts on this? Regards, Dilip > If an application wants to mix fallocate and delayed allocatin > writes to the same file in the same IO, then that's an application > bug. It's going to cause bad IO patterns and file fragmentation and > have other side effects (as you've noticed), and there's nothing the > filesystem can do about it. fallocate() requires expertise to use in > a beneficial manner - most developers do not have the required > expertise (and don't have enough expertise to realise this) and so > usually make things worse rather than better by using fallocate. > > > Also, is there any way I can check for this flag? > > The FLAGS, as observed from xfs_bmap doesn't show any flags set to it. > Am I > > not looking at the right flags? > > xfs_io -c stat > > Cheers, > > Dave. > -- > Dave Chinner > david@fromorbit.com > --089e0160c2b07dedfd052adfdd85 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
On W= ed, Feb 3, 2016 at 12:30 AM, Dave Chinner <david@fromorbit.com> wrote:
On Tue, Feb= 02, 2016 at 11:09:15PM -0800, Dilip Simha wrote:
> Hi Dave,
>
> On Tue, Feb 2, 2016 at 10:37 PM, Dave Chinner <david@fromorbit.com> wrote:
>
> > On Tue, Feb 02, 2016 at 07:40:34PM -0800, Dilip Simha wrote:
> > > Hi Eric,
> > >
> > > Thank you for your quick reply.
> > >
> > > Using xfs_io as per your suggestion, I am able to reproduce = the issue.
> > > However, I need to falloc for 256K and write for 257K to see= this issue.
> > >
> > > # xfs_io -f -c "falloc 0 256k" -c "pwrite 0 2= 57k" /srv/node/r1/t1.txt
> > > # stat /srv/node/r1/t4.txt | grep Blocks
> > >=C2=A0 =C2=A0Size: 263168=C2=A0 =C2=A0 =C2=A0Blocks: 1536=C2= =A0 =C2=A0 =C2=A0 =C2=A0IO Block: 4096=C2=A0 =C2=A0regular file
> >
> > Fallocate sets the XFS_DIFLAG_PREALLOC on the inode.
> >
> > When you writing *past the preallocated area* and do delayed
> > allocation, the speculative preallocation beyond EOF is double th= e
> > size of the extent at EOF. i.e. 512k, leading to 768k being
> > allocated to the file (1536 blocks, exactly).
> >
>
> Thank you for the details.
> This is exactly where I am a bit perplexed. Since the reclamation logi= c
> skips inodes that have the XFS_DIFLAG_PREALLOC flag set, why did the > allocation logic allot more blocks on such an inode?

To store the data you wrote outside the preallocated region, of
course.

> My understanding is that the fallocate caller only requested for 256K = worth
> of blocks to be available sequentially if possible.

fallocate only guarantees the blocks are allocated - it does not
guarantee anything about the layout of the blocks.

> On any subsequent write beyond the EOF, the caller is completely
> unaware of the underlying file-system storing that data adjacent
> to the first 256K data.=C2=A0 Since XFS is speculatively allocating > additional space (512K) adjacent to the first 256K data, I would
> expect XFS to either treat these two allocations distinctly and
> NOT mark XFS_DIFLAG_PREALLOC on the additional 512K data(minus the
> actually used additional data=3D1K), OR remove XFS_DIFLAG_PREALLOC
> flag on the entire inode.

Oh, if only it were that simple. It's way more complex than I ha= ve
time to explain here.

Fundamentally, XFS_DIFLAG_PREALLOC is used to indicate that
persistent preallocation has been done on the file, and so if that
has happened we need to turn off optimistic removal of blocks
anywhere in the file because we can't tell what blocks had
persistent preallocation done on them after the fact.=C2=A0 That's the<= br> way it's been since unwritten extents were added to XFS back in
1998, and I don't really see the need for it to change right now.

I completely understand the reasoning behind= this reclamation logic and I also agree to it.
But my question i= s with the allocation logic. I don't understand why XFS allocates more = than necessary blocks when this flag is set and when it knows that its not = going to clean up the additional space.

A simple e= xample would be:
1: Open File in Write mode.
2: Falloca= te 256K
3: Write 256K
4: Close File

Stat shows that XFS allocated 512 blocks as expected.

<= /div>
5: Open file in append mode.
6: Write 256 bytes.
<= div>7: Close file.

Expectation is that the number = of blocks allocated is either 512+1 or 512+8 depending on the block size.
However, XFS uses speculative preallocation to allocate 512K (as p= er your explanation) to write 256 bytes and hence the overall disk usage go= es up to 1536 blocks.
Now, who is responsible for clearing up the= additional allocated blocks? Clearly the application has no idea about the= over-allocation.

I agree that if an application u= ses fallocate and delayed allocation on the same file in the same IO, then = its a badly structured application. But in this case we have two different = IOs on the same file. The first IO did not expect an append and hence issue= d an fallocate. So that looks good to me.

Your tho= ughts on this?

Regards,
Dilip
=

If an application wants to mix fallocate and delayed allocatin
writes to the same file in the same IO, then that's an application
bug. It's going to cause bad IO patterns and file fragmentation and
have other side effects (as you've noticed), and there's nothing th= e
filesystem can do about it. fallocate() requires expertise to use in
a beneficial manner - most developers do not have the required
expertise (and don't have enough expertise to realise this) and so
usually make things worse rather than better by using fallocate.

> Also, is there any way I can check for this flag?
> The FLAGS, as observed from xfs_bmap doesn't show any flags set to= it. Am I
> not looking at the right flags?

xfs_io -c stat <file>

Cheers,

Dave.
--
Dave Chinner
david@fromorbit.com

--089e0160c2b07dedfd052adfdd85-- From nmdilipsimha@gmail.com Wed Feb 3 10:15:57 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=FREEMAIL_FROM,HTML_MESSAGE, T_DKIM_INVALID autolearn=ham version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay1.corp.sgi.com [137.38.102.111]) by oss.sgi.com (Postfix) with ESMTP id F2D5C7CA1 for ; Wed, 3 Feb 2016 10:15:56 -0600 (CST) Received: from cuda.sgi.com (cuda2.sgi.com [192.48.176.25]) by relay1.corp.sgi.com (Postfix) with ESMTP id D24368F8033 for ; Wed, 3 Feb 2016 08:15:56 -0800 (PST) X-ASG-Debug-ID: 1454516154-04cbb04c9583430001-NocioJ Received: from mail-ob0-f175.google.com (mail-ob0-f175.google.com [209.85.214.175]) by cuda.sgi.com with ESMTP id F8qAxBEshzknyMzR (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128 verify=NO) for ; Wed, 03 Feb 2016 08:15:54 -0800 (PST) X-Barracuda-Envelope-From: nmdilipsimha@gmail.com X-Barracuda-Apparent-Source-IP: 209.85.214.175 Received: by mail-ob0-f175.google.com with SMTP id ba1so36243448obb.3 for ; Wed, 03 Feb 2016 08:15:54 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc:content-type; bh=Zz1r7vw+8TXpdP0sd+5oOkq53gDp2iiDp0tCQt6gXFE=; b=htk1NMNcncAmJMPNPxi2Cps26G2mCViOjcZxtDGRLF1VG5z8mKF9uiaoUeJZf/0Mtp yLyUi8z60iG1Fqc6wWcGXGU/fOYJKfi+Ql379WnVAXeR0iegCSCCdZpgmmGWyjUrb6bO 5kvZIy0q5RzN+lL7HEsE3pw6NIlz9MQkGWA8l64woRAZQ/cZM4CdvqiRUeaaEcTPAl1W pig9VzioCjf8yzPCJUcxRVXpolGLgsfYEh4Q34i3sNu4+e68OShWDfZG3sMitzhqmURV EqObaMfVcSeXc4vsnXxJ1UK67aDzSD1QXHgV8ZR0lnc/9O9+4KKD1vjjiK0gw7QA9Mlr pCeg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc:content-type; bh=Zz1r7vw+8TXpdP0sd+5oOkq53gDp2iiDp0tCQt6gXFE=; b=I7e9NfZaJZHxIC8RRzFsSdt3LioGDIr1j30Fa0ZBcl9P+akt/gKOM72SRyLGusLqZM 0WjW7JiI/GbhWxGLZQZ9eNg05Lek4JBn5ykD3nxrUdUOC0DBLbpg0tJzmEGFTPu8ArR/ ZazoVBj4/f5pfYj3bWzgD7TI3hvhMJrv+RAgahZV+eFzRWzS+Zzh3heEHYSzJCyakEfj eUO6yjHpCKcb/7Ql2OeWhNdVEZMqgASe4Dj2BRxxoWgIo2/Ncd18xgGAOEw4jl8OaPJL L46vUvHBNgZbgnJ2FA0AzCm5knS2163OdI/6jeC1ZkyhqRIVKfj+ruX+Jc28HuW6Qzsz 7byw== X-Gm-Message-State: AG10YORZxEP0X7N4/QIpqwLqJxeMUEfAopbhRxmegTePgM1wTuK2I9Cmzm9Lkn6UaPC2auFBi1Ky4b3TVHxDlw== X-Received: by 10.182.120.3 with SMTP id ky3mr2885255obb.17.1454516154114; Wed, 03 Feb 2016 08:15:54 -0800 (PST) MIME-Version: 1.0 Received: by 10.202.86.204 with HTTP; Wed, 3 Feb 2016 08:15:34 -0800 (PST) In-Reply-To: References: <56B16A3C.1030207@sandeen.net> <20160203063705.GB459@dastard> <20160203083016.GD459@dastard> From: Dilip Simha Date: Wed, 3 Feb 2016 08:15:34 -0800 Message-ID: Subject: Re: Request for information on bloated writes using Swift To: Dave Chinner X-ASG-Orig-Subj: Re: Request for information on bloated writes using Swift Cc: Eric Sandeen , xfs@oss.sgi.com Content-Type: multipart/alternative; boundary=089e01229de0afab6f052adfeec4 X-Barracuda-Connect: mail-ob0-f175.google.com[209.85.214.175] X-Barracuda-Start-Time: 1454516154 X-Barracuda-Encrypted: ECDHE-RSA-AES128-GCM-SHA256 X-Barracuda-URL: https://192.48.176.25:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-BRTS-Status: 1 X-Barracuda-Spam-Score: 0.00 X-Barracuda-Spam-Status: No, SCORE=0.00 using per-user scores of TAG_LEVEL=1000.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.7 tests=BSF_SC0_MISMATCH_TO, DKIM_SIGNED, DKIM_VERIFIED, HTML_MESSAGE X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.3.26707 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 0.00 BSF_SC0_MISMATCH_TO Envelope rcpt doesn't match header -0.00 DKIM_VERIFIED Domain Keys Identified Mail: signature passes verification 0.00 DKIM_SIGNED Domain Keys Identified Mail: message has a signature 0.00 HTML_MESSAGE BODY: HTML included in message --089e01229de0afab6f052adfeec4 Content-Type: text/plain; charset=UTF-8 Thank you Eric, I am sorry, I missed reading your message before replying. You got my question right. Regards, Dilip On Wed, Feb 3, 2016 at 8:10 AM, Dilip Simha wrote: > On Wed, Feb 3, 2016 at 12:30 AM, Dave Chinner wrote: > >> On Tue, Feb 02, 2016 at 11:09:15PM -0800, Dilip Simha wrote: >> > Hi Dave, >> > >> > On Tue, Feb 2, 2016 at 10:37 PM, Dave Chinner >> wrote: >> > >> > > On Tue, Feb 02, 2016 at 07:40:34PM -0800, Dilip Simha wrote: >> > > > Hi Eric, >> > > > >> > > > Thank you for your quick reply. >> > > > >> > > > Using xfs_io as per your suggestion, I am able to reproduce the >> issue. >> > > > However, I need to falloc for 256K and write for 257K to see this >> issue. >> > > > >> > > > # xfs_io -f -c "falloc 0 256k" -c "pwrite 0 257k" >> /srv/node/r1/t1.txt >> > > > # stat /srv/node/r1/t4.txt | grep Blocks >> > > > Size: 263168 Blocks: 1536 IO Block: 4096 regular file >> > > >> > > Fallocate sets the XFS_DIFLAG_PREALLOC on the inode. >> > > >> > > When you writing *past the preallocated area* and do delayed >> > > allocation, the speculative preallocation beyond EOF is double the >> > > size of the extent at EOF. i.e. 512k, leading to 768k being >> > > allocated to the file (1536 blocks, exactly). >> > > >> > >> > Thank you for the details. >> > This is exactly where I am a bit perplexed. Since the reclamation logic >> > skips inodes that have the XFS_DIFLAG_PREALLOC flag set, why did the >> > allocation logic allot more blocks on such an inode? >> >> To store the data you wrote outside the preallocated region, of >> course. >> >> > My understanding is that the fallocate caller only requested for 256K >> worth >> > of blocks to be available sequentially if possible. >> >> fallocate only guarantees the blocks are allocated - it does not >> guarantee anything about the layout of the blocks. >> >> > On any subsequent write beyond the EOF, the caller is completely >> > unaware of the underlying file-system storing that data adjacent >> > to the first 256K data. Since XFS is speculatively allocating >> > additional space (512K) adjacent to the first 256K data, I would >> > expect XFS to either treat these two allocations distinctly and >> > NOT mark XFS_DIFLAG_PREALLOC on the additional 512K data(minus the >> > actually used additional data=1K), OR remove XFS_DIFLAG_PREALLOC >> > flag on the entire inode. >> >> Oh, if only it were that simple. It's way more complex than I have >> time to explain here. >> >> Fundamentally, XFS_DIFLAG_PREALLOC is used to indicate that >> persistent preallocation has been done on the file, and so if that >> has happened we need to turn off optimistic removal of blocks >> anywhere in the file because we can't tell what blocks had >> persistent preallocation done on them after the fact. That's the >> way it's been since unwritten extents were added to XFS back in >> 1998, and I don't really see the need for it to change right now. >> > > I completely understand the reasoning behind this reclamation logic and I > also agree to it. > But my question is with the allocation logic. I don't understand why XFS > allocates more than necessary blocks when this flag is set and when it > knows that its not going to clean up the additional space. > > A simple example would be: > 1: Open File in Write mode. > 2: Fallocate 256K > 3: Write 256K > 4: Close File > > Stat shows that XFS allocated 512 blocks as expected. > > 5: Open file in append mode. > 6: Write 256 bytes. > 7: Close file. > > Expectation is that the number of blocks allocated is either 512+1 or > 512+8 depending on the block size. > However, XFS uses speculative preallocation to allocate 512K (as per your > explanation) to write 256 bytes and hence the overall disk usage goes up to > 1536 blocks. > Now, who is responsible for clearing up the additional allocated blocks? > Clearly the application has no idea about the over-allocation. > > I agree that if an application uses fallocate and delayed allocation on > the same file in the same IO, then its a badly structured application. But > in this case we have two different IOs on the same file. The first IO did > not expect an append and hence issued an fallocate. So that looks good to > me. > > Your thoughts on this? > > Regards, > Dilip > > >> If an application wants to mix fallocate and delayed allocatin >> writes to the same file in the same IO, then that's an application >> bug. It's going to cause bad IO patterns and file fragmentation and >> have other side effects (as you've noticed), and there's nothing the >> filesystem can do about it. fallocate() requires expertise to use in >> a beneficial manner - most developers do not have the required >> expertise (and don't have enough expertise to realise this) and so >> usually make things worse rather than better by using fallocate. >> >> > Also, is there any way I can check for this flag? >> > The FLAGS, as observed from xfs_bmap doesn't show any flags set to it. >> Am I >> > not looking at the right flags? >> >> xfs_io -c stat >> >> Cheers, >> >> Dave. >> -- >> Dave Chinner >> david@fromorbit.com >> > > --089e01229de0afab6f052adfeec4 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
Thank you Eric,
I am sorry, I missed reading your mess= age before replying.
You got my question right.

Regards,
Dilip

=
On Wed, Feb 3, 2016 at 8:10 AM, Dilip Simha <nmdilipsimha@gmail.com> wrote:
On Wed, Feb 3, 2016 at 12:30 AM, Dave Chinner <david@fromorbit.com> wrote:
david@fromorbit.com> wrote:
>
> > On Tue, Feb 02, 2016 at 07:40:34PM -0800, Dilip Simha wrote:
> > > Hi Eric,
> > >
> > > Thank you for your quick reply.
> > >
> > > Using xfs_io as per your suggestion, I am able to reproduce = the issue.
> > > However, I need to falloc for 256K and write for 257K to see= this issue.
> > >
> > > # xfs_io -f -c "falloc 0 256k" -c "pwrite 0 2= 57k" /srv/node/r1/t1.txt
> > > # stat /srv/node/r1/t4.txt | grep Blocks
> > >=C2=A0 =C2=A0Size: 263168=C2=A0 =C2=A0 =C2=A0Blocks: 1536=C2= =A0 =C2=A0 =C2=A0 =C2=A0IO Block: 4096=C2=A0 =C2=A0regular file
> >
> > Fallocate sets the XFS_DIFLAG_PREALLOC on the inode.
> >
> > When you writing *past the preallocated area* and do delayed
> > allocation, the speculative preallocation beyond EOF is double th= e
> > size of the extent at EOF. i.e. 512k, leading to 768k being
> > allocated to the file (1536 blocks, exactly).
> >
>
> Thank you for the details.
> This is exactly where I am a bit perplexed. Since the reclamation logi= c
> skips inodes that have the XFS_DIFLAG_PREALLOC flag set, why did the > allocation logic allot more blocks on such an inode?

To store the data you wrote outside the preallocated region, of
course.

> My understanding is that the fallocate caller only requested for 256K = worth
> of blocks to be available sequentially if possible.

fallocate only guarantees the blocks are allocated - it does not
guarantee anything about the layout of the blocks.

> On any subsequent write beyond the EOF, the caller is completely
> unaware of the underlying file-system storing that data adjacent
> to the first 256K data.=C2=A0 Since XFS is speculatively allocating > additional space (512K) adjacent to the first 256K data, I would
> expect XFS to either treat these two allocations distinctly and
> NOT mark XFS_DIFLAG_PREALLOC on the additional 512K data(minus the
> actually used additional data=3D1K), OR remove XFS_DIFLAG_PREALLOC
> flag on the entire inode.

Oh, if only it were that simple. It's way more complex than I ha= ve
time to explain here.

Fundamentally, XFS_DIFLAG_PREALLOC is used to indicate that
persistent preallocation has been done on the file, and so if that
has happened we need to turn off optimistic removal of blocks
anywhere in the file because we can't tell what blocks had
persistent preallocation done on them after the fact.=C2=A0 That's the<= br> way it's been since unwritten extents were added to XFS back in
1998, and I don't really see the need for it to change right now.

I completely understand the reas= oning behind this reclamation logic and I also agree to it.
But m= y question is with the allocation logic. I don't understand why XFS all= ocates more than necessary blocks when this flag is set and when it knows t= hat its not going to clean up the additional space.

A simple example would be:
1: Open File in Write mode.
2: Fallocate 256K
3: Write 256K
4: Close File

Stat shows that XFS allocated 512 blocks as expected.

5: Open file in append mode.
6: Write 256 b= ytes.
7: Close file.

Expectation is that= the number of blocks allocated is either 512+1 or 512+8 depending on the b= lock size.
However, XFS uses speculative preallocation to allocat= e 512K (as per your explanation) to write 256 bytes and hence the overall d= isk usage goes up to 1536 blocks.
Now, who is responsible for cle= aring up the additional allocated blocks? Clearly the application has no id= ea about the over-allocation.

I agree that if an a= pplication uses fallocate and delayed allocation on the same file in the sa= me IO, then its a badly structured application. But in this case we have tw= o different IOs on the same file. The first IO did not expect an append and= hence issued an fallocate. So that looks good to me.

<= div>Your thoughts on this?

Regards,
Dili= p


If an application wants to mix fallocate and delayed allocatin
writes to the same file in the same IO, then that's an application
bug. It's going to cause bad IO patterns and file fragmentation and
have other side effects (as you've noticed), and there's nothing th= e
filesystem can do about it. fallocate() requires expertise to use in
a beneficial manner - most developers do not have the required
expertise (and don't have enough expertise to realise this) and so
usually make things worse rather than better by using fallocate.

> Also, is there any way I can check for this flag?
> The FLAGS, as observed from xfs_bmap doesn't show any flags set to= it. Am I
> not looking at the right flags?

xfs_io -c stat <file>

Cheers,

Dave.
--
Dave Chinner
david@fromorbit.co= m


--089e01229de0afab6f052adfeec4-- From ross.zwisler@linux.intel.com Wed Feb 3 10:42:19 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=ham version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay2.corp.sgi.com [137.38.102.29]) by oss.sgi.com (Postfix) with ESMTP id 943F37CA1 for ; Wed, 3 Feb 2016 10:42:19 -0600 (CST) Received: from cuda.sgi.com (cuda3.sgi.com [192.48.176.15]) by relay2.corp.sgi.com (Postfix) with ESMTP id 80296304048 for ; Wed, 3 Feb 2016 08:42:19 -0800 (PST) X-ASG-Debug-ID: 1454517738-04cb6c37982a940001-NocioJ Received: from mga01.intel.com ([192.55.52.88]) by cuda.sgi.com with ESMTP id v7spxxQ0Lzrs1yhj for ; Wed, 03 Feb 2016 08:42:18 -0800 (PST) X-Barracuda-Envelope-From: ross.zwisler@linux.intel.com X-Barracuda-Apparent-Source-IP: 192.55.52.88 X-ASG-Whitelist: Client Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by fmsmga101.fm.intel.com with ESMTP; 03 Feb 2016 08:42:18 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.22,391,1449561600"; d="scan'208";a="41799768" Received: from rzwisler-desk.amr.corp.intel.com (HELO linux.intel.com) ([10.252.195.239]) by fmsmga004.fm.intel.com with ESMTP; 03 Feb 2016 08:42:16 -0800 Date: Wed, 3 Feb 2016 09:42:09 -0700 From: Ross Zwisler To: Jan Kara Cc: Ross Zwisler , linux-kernel@vger.kernel.org, "H. Peter Anvin" , "J. Bruce Fields" , Theodore Ts'o , Alexander Viro , Andreas Dilger , Andrew Morton , Dan Williams , Dave Chinner , Dave Hansen , Ingo Molnar , Jan Kara , Jeff Layton , Matthew Wilcox , Matthew Wilcox , Thomas Gleixner , linux-ext4@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux-mm@kvack.org, linux-nvdimm@lists.01.org, x86@kernel.org, xfs@oss.sgi.com Subject: Re: [PATCH v8 4/9] dax: support dirty DAX entries in radix tree Message-ID: <20160203164209.GA29275@linux.intel.com> X-ASG-Orig-Subj: Re: [PATCH v8 4/9] dax: support dirty DAX entries in radix tree Mail-Followup-To: Ross Zwisler , Jan Kara , linux-kernel@vger.kernel.org, "H. Peter Anvin" , "J. Bruce Fields" , Theodore Ts'o , Alexander Viro , Andreas Dilger , Andrew Morton , Dan Williams , Dave Chinner , Dave Hansen , Ingo Molnar , Jan Kara , Jeff Layton , Matthew Wilcox , Matthew Wilcox , Thomas Gleixner , linux-ext4@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux-mm@kvack.org, linux-nvdimm@lists.01.org, x86@kernel.org, xfs@oss.sgi.com References: <1452230879-18117-1-git-send-email-ross.zwisler@linux.intel.com> <1452230879-18117-5-git-send-email-ross.zwisler@linux.intel.com> <20160113094411.GA17057@quack.suse.cz> <20160113184832.GA5904@linux.intel.com> <20160115132249.GL15950@quack.suse.cz> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20160115132249.GL15950@quack.suse.cz> User-Agent: Mutt/1.5.24 (2015-08-30) X-Barracuda-Connect: UNKNOWN[192.55.52.88] X-Barracuda-Start-Time: 1454517738 X-Barracuda-URL: https://192.48.176.15:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-BRTS-Status: 1 On Fri, Jan 15, 2016 at 02:22:49PM +0100, Jan Kara wrote: > On Wed 13-01-16 11:48:32, Ross Zwisler wrote: > > On Wed, Jan 13, 2016 at 10:44:11AM +0100, Jan Kara wrote: > > > On Thu 07-01-16 22:27:54, Ross Zwisler wrote: > > > > Add support for tracking dirty DAX entries in the struct address_space > > > > radix tree. This tree is already used for dirty page writeback, and it > > > > already supports the use of exceptional (non struct page*) entries. > > > > > > > > In order to properly track dirty DAX pages we will insert new exceptional > > > > entries into the radix tree that represent dirty DAX PTE or PMD pages. > > > > These exceptional entries will also contain the writeback sectors for the > > > > PTE or PMD faults that we can use at fsync/msync time. > > > > > > > > There are currently two types of exceptional entries (shmem and shadow) > > > > that can be placed into the radix tree, and this adds a third. We rely on > > > > the fact that only one type of exceptional entry can be found in a given > > > > radix tree based on its usage. This happens for free with DAX vs shmem but > > > > we explicitly prevent shadow entries from being added to radix trees for > > > > DAX mappings. > > > > > > > > The only shadow entries that would be generated for DAX radix trees would > > > > be to track zero page mappings that were created for holes. These pages > > > > would receive minimal benefit from having shadow entries, and the choice > > > > to have only one type of exceptional entry in a given radix tree makes the > > > > logic simpler both in clear_exceptional_entry() and in the rest of DAX. > > > > > > > > Signed-off-by: Ross Zwisler > > > > Reviewed-by: Jan Kara > > > > > > I have realized there's one issue with this code. See below: > > > > > > > @@ -34,31 +35,39 @@ static void clear_exceptional_entry(struct address_space *mapping, > > > > return; > > > > > > > > spin_lock_irq(&mapping->tree_lock); > > > > - /* > > > > - * Regular page slots are stabilized by the page lock even > > > > - * without the tree itself locked. These unlocked entries > > > > - * need verification under the tree lock. > > > > - */ > > > > - if (!__radix_tree_lookup(&mapping->page_tree, index, &node, &slot)) > > > > - goto unlock; > > > > - if (*slot != entry) > > > > - goto unlock; > > > > - radix_tree_replace_slot(slot, NULL); > > > > - mapping->nrshadows--; > > > > - if (!node) > > > > - goto unlock; > > > > - workingset_node_shadows_dec(node); > > > > - /* > > > > - * Don't track node without shadow entries. > > > > - * > > > > - * Avoid acquiring the list_lru lock if already untracked. > > > > - * The list_empty() test is safe as node->private_list is > > > > - * protected by mapping->tree_lock. > > > > - */ > > > > - if (!workingset_node_shadows(node) && > > > > - !list_empty(&node->private_list)) > > > > - list_lru_del(&workingset_shadow_nodes, &node->private_list); > > > > - __radix_tree_delete_node(&mapping->page_tree, node); > > > > + > > > > + if (dax_mapping(mapping)) { > > > > + if (radix_tree_delete_item(&mapping->page_tree, index, entry)) > > > > + mapping->nrexceptional--; > > > > > > So when you punch hole in a file, you can delete a PMD entry from a radix > > > tree which covers part of the file which still stays. So in this case you > > > have to split the PMD entry into PTE entries (probably that needs to happen > > > up in truncate_inode_pages_range()) or something similar... > > > > I think (and will verify) that the DAX code just unmaps the entire PMD range > > when we receive a hole punch request inside of the PMD. If this is true then > > I think the radix tree code should behave the same way and just remove the PMD > > entry in the radix tree. > > But you cannot just remove it if it is dirty... You have to keep somewhere > information that part of the PMD range is still dirty (or write that range > out before removing the radix tree entry). It turns out that hole punching a DAX PMD hits a BUG: [ 247.821632] ------------[ cut here ]------------ [ 247.822744] kernel BUG at mm/memory.c:1195! [ 247.823742] invalid opcode: 0000 [#1] SMP [ 247.824768] Modules linked in: nd_pmem nd_btt nd_e820 libnvdimm [ 247.826299] CPU: 1 PID: 1544 Comm: test Tainted: G W 4.4.0-rc8+ #9 [ 247.828017] Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS 1.8.2-20150714_191134- 04/01/2014 [ 247.830298] task: ffff880036756200 ti: ffff8800a077c000 task.ti: ffff8800a077c000 [ 247.831935] RIP: 0010:[] [] unmap_page_range+0x907/0x910 [ 247.833847] RSP: 0018:ffff8800a077fb88 EFLAGS: 00010282 [ 247.835030] RAX: 0000000000000073 RBX: ffffc00000000fff RCX: 0000000000000000 [ 247.836595] RDX: 0000000000000000 RSI: ffff88051a3ce168 RDI: ffff88051a3ce168 [ 247.838168] RBP: ffff8800a077fc68 R08: 0000000000000001 R09: 0000000000000001 [ 247.839728] R10: 0000000000000001 R11: 0000000000000001 R12: 0000000010405000 [ 247.841244] R13: 0000000010403000 R14: ffff8800a077fcb0 R15: 0000000010403000 [ 247.842715] FS: 00007f533a5bb700(0000) GS:ffff88051a200000(0000) knlGS:0000000000000000 [ 247.844395] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 [ 247.845589] CR2: 0000000010403000 CR3: 0000000514337000 CR4: 00000000000006e0 [ 247.847076] Stack: [ 247.847502] ffff8800a077fcb0 ffff8800a077fc38 ffff880036756200 ffff8800a077fbb0 [ 247.849126] 0000000010404fff 0000000010404fff 0000000010404fff ffff880514337000 [ 247.850714] ffff880513499000 ffff8800a077fcc0 0000000010405000 0000000000000000 [ 247.852246] Call Trace: [ 247.852740] [] ? trace_hardirqs_on+0xd/0x10 [ 247.853883] [] unmap_single_vma+0x7d/0xe0 [ 247.855004] [] zap_page_range_single+0xad/0xf0 [ 247.856195] [] ? unmap_mapping_range+0xa0/0x190 [ 247.857403] [] unmap_mapping_range+0x166/0x190 [ 247.858596] [] truncate_pagecache_range+0x48/0x60 [ 247.859839] [] ext4_punch_hole+0x33a/0x4b0 [ 247.860837] [] ext4_fallocate+0x144/0x890 [ 247.861784] [] ? update_fast_ctr+0x17/0x30 [ 247.862751] [] ? percpu_down_read+0x49/0x90 [ 247.863731] [] ? __sb_start_write+0xb4/0xf0 [ 247.864709] [] vfs_fallocate+0x140/0x220 [ 247.865645] [] SyS_fallocate+0x44/0x70 [ 247.866553] [] entry_SYSCALL_64_fastpath+0x12/0x76 [ 247.867632] Code: 12 fe ff ff 0f 0b 48 8b 45 98 48 8b 4d 90 4c 89 fa 48 c7 c6 78 30 c2 81 48 c7 c7 50 6b f0 81 4c 8b 48 08 4c 8b 00 e8 06 4a fc ff <0f> 0b e8 d2 2f ea ff 66 90 66 66 66 66 90 48 8b 06 4c 8b 4e 08 [ 247.871862] RIP [] unmap_page_range+0x907/0x910 [ 247.872843] RSP [ 247.873435] ---[ end trace 75145e78670ba43d ]--- This happens with XFS as well. I'm not sure that this path has ever been run, so essentially the next step is "add PMD hole punch support to DAX, including fsync/msync support". From ross.zwisler@linux.intel.com Wed Feb 3 10:50:50 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=ham version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay1.corp.sgi.com [137.38.102.111]) by oss.sgi.com (Postfix) with ESMTP id 239327CA1 for ; Wed, 3 Feb 2016 10:50:50 -0600 (CST) Received: from cuda.sgi.com (cuda2.sgi.com [192.48.176.25]) by relay1.corp.sgi.com (Postfix) with ESMTP id 03FDD8F8039 for ; Wed, 3 Feb 2016 08:50:50 -0800 (PST) X-ASG-Debug-ID: 1454518248-04cbb04c9786e40001-NocioJ Received: from mga03.intel.com (mga03.intel.com [134.134.136.65]) by cuda.sgi.com with ESMTP id WuR0BcOrRA9cf2Zp for ; Wed, 03 Feb 2016 08:50:49 -0800 (PST) X-Barracuda-Envelope-From: ross.zwisler@linux.intel.com X-Barracuda-Apparent-Source-IP: 134.134.136.65 X-ASG-Whitelist: Client Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by orsmga103.jf.intel.com with ESMTP; 03 Feb 2016 08:50:38 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.22,391,1449561600"; d="scan'208";a="646607922" Received: from rzwisler-desk.amr.corp.intel.com (HELO linux.intel.com) ([10.252.195.239]) by FMSMGA003.fm.intel.com with ESMTP; 03 Feb 2016 08:50:37 -0800 Date: Wed, 3 Feb 2016 09:50:31 -0700 From: Ross Zwisler To: xfs@oss.sgi.com, Dave Chinner Subject: real-time device warning Message-ID: <20160203165031.GB29275@linux.intel.com> X-ASG-Orig-Subj: real-time device warning MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.5.24 (2015-08-30) X-Barracuda-Connect: mga03.intel.com[134.134.136.65] X-Barracuda-Start-Time: 1454518248 X-Barracuda-URL: https://192.48.176.25:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-BRTS-Status: 1 I've been doing some more real-time device testing with XFS, and I was able to get past the BUG I reported here: http://www.spinics.net/lists/xfs/msg37445.html by setting CONFIG_XFS_DEBUG=n as Dave suggested. After that I/O seems to work, although it doesn't look like the DAX mount option is applied to I/Os that go to the real-time device. After the first I/O, though, the following warning is hit: [ 413.086897] XFS (ram1): _xfs_buf_ioapply: no ops on block 0xa0/0x8 [ 413.091102] ffff8805038e8000: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ [ 413.093495] ffff8805038e8010: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ [ 413.095855] ffff8805038e8020: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ [ 413.098221] ffff8805038e8030: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ [ 413.100576] CPU: 0 PID: 1362 Comm: xfsaild/ram1 Not tainted 4.5.0-rc2 #20 [ 413.102244] Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS 1.8.2-20150714_191134- 04/01/2014 [ 413.104494] 0000000000000000 0000000004f1f04f ffff8800981abbe0 ffffffff8155d6b2 [ 413.106378] 0000000000000001 ffff8800981abc98 ffffffff814780d2 ffffffff81a50737 [ 413.108253] ffffe8ffffa00c00 ffff8800981abc50 ffffffff810c1947 00000000001d12d0 [ 413.110071] Call Trace: [ 413.110635] [] dump_stack+0x44/0x62 [ 413.111807] [] _xfs_buf_ioapply+0x432/0x480 [ 413.113106] [] ? _raw_spin_unlock+0x27/0x30 [ 413.114406] [] ? __queue_work+0x167/0x3a0 [ 413.115788] [] ? lockdep_init_map+0x64/0x6b0 [ 413.117116] [] ? trace_hardirqs_on+0xd/0x10 [ 413.118421] [] ? wake_up_q+0x70/0x70 [ 413.119589] [] ? __xfs_buf_delwri_submit+0x1f4/0x2e0 [ 413.120984] [] xfs_buf_submit+0x73/0x160 [ 413.122175] [] __xfs_buf_delwri_submit+0x1f4/0x2e0 [ 413.123520] [] ? xfs_buf_delwri_submit_nowait+0x2f/0x50 [ 413.124967] [] ? xfs_buf_delwri_submit_nowait+0x2f/0x50 [ 413.126417] [] xfs_buf_delwri_submit_nowait+0x2f/0x50 [ 413.127815] [] xfsaild+0x264/0x6c0 [ 413.128871] [] ? xfs_trans_ail_cursor_first+0x90/0x90 [ 413.130222] [] ? xfs_trans_ail_cursor_first+0x90/0x90 [ 413.131529] [] kthread+0xf6/0x110 [ 413.132510] [] ? trace_hardirqs_on_caller+0x129/0x1b0 [ 413.133805] [] ? kthread_create_on_node+0x250/0x250 [ 413.135036] [] ret_from_fork+0x3f/0x70 [ 413.136084] [] ? kthread_create_on_node+0x250/0x250 The steps to reproduce this are as follows: # fdisk -l /dev/ram* Disk /dev/ram0: 4 GiB, 4294967296 bytes, 8388608 sectors Units: sectors of 1 * 512 = 512 bytes Sector size (logical/physical): 512 bytes / 4096 bytes I/O size (minimum/optimal): 4096 bytes / 4096 bytes Disk /dev/ram1: 4 GiB, 4294967296 bytes, 8388608 sectors Units: sectors of 1 * 512 = 512 bytes Sector size (logical/physical): 512 bytes / 4096 bytes I/O size (minimum/optimal): 4096 bytes / 4096 bytes # mkfs.xfs -f -r rtdev=/dev/ram0 /dev/ram1 meta-data=/dev/ram1 isize=512 agcount=4, agsize=262144 blks = sectsz=4096 attr=2, projid32bit=1 = crc=1 finobt=1, sparse=0 data = bsize=4096 blocks=1048576, imaxpct=25 = sunit=0 swidth=0 blks naming =version 2 bsize=4096 ascii-ci=0 ftype=1 log =internal log bsize=4096 blocks=2560, version=2 = sectsz=4096 sunit=1 blks, lazy-count=1 realtime =/dev/ram0 extsz=4096 blocks=1048576, rtextents=1048576 # mount -t xfs -o rtdev=/dev/ram0 /dev/ram1 /mnt # mount | grep '/mnt' /dev/ram1 on /mnt type xfs (rw,relatime,seclabel,attr2,inode64,rtdev=/dev/ram0,noquota) # xfs_rtcp ~/data /mnt/ xfs_rtcp: /root/data is not a realtime file. Thanks, - Ross From BATV+60f2efc1bb123f201640+4546+infradead.org+hch@casper.srs.infradead.org Wed Feb 3 12:40:23 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=ham version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay3.corp.sgi.com [198.149.34.15]) by oss.sgi.com (Postfix) with ESMTP id 8D51B7CA1 for ; Wed, 3 Feb 2016 12:40:23 -0600 (CST) Received: from cuda.sgi.com (cuda2.sgi.com [192.48.176.25]) by relay3.corp.sgi.com (Postfix) with ESMTP id 2C543AC006 for ; Wed, 3 Feb 2016 10:40:23 -0800 (PST) X-ASG-Debug-ID: 1454524819-04cbb04c9891c00001-NocioJ Received: from casper.infradead.org (casper.infradead.org [85.118.1.10]) by cuda.sgi.com with ESMTP id V4eF9DqxEIMcYZpV (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128 verify=NO) for ; Wed, 03 Feb 2016 10:40:20 -0800 (PST) X-Barracuda-Envelope-From: BATV+60f2efc1bb123f201640+4546+infradead.org+hch@casper.srs.infradead.org X-Barracuda-Apparent-Source-IP: 85.118.1.10 Received: from chello080109146114.tirol.surfer.at ([80.109.146.114] helo=localhost) by casper.infradead.org with esmtpsa (Exim 4.85 #2 (Red Hat Linux)) id 1aR2Li-000176-Np; Wed, 03 Feb 2016 18:40:18 +0000 From: Christoph Hellwig To: linux-fsdevel@vger.kernel.org, xfs@oss.sgi.com, linux-ext4@vger.kernel.org, ocfs2-devel@oss.oracle.com Subject: vfs/xfs: directio updates to ease COW handling V2 Date: Wed, 3 Feb 2016 19:40:13 +0100 X-ASG-Orig-Subj: vfs/xfs: directio updates to ease COW handling V2 Message-Id: <1454524816-11392-1-git-send-email-hch@lst.de> X-Mailer: git-send-email 2.1.4 X-SRS-Rewrite: SMTP reverse-path rewritten from by casper.infradead.org X-Barracuda-Connect: casper.infradead.org[85.118.1.10] X-Barracuda-Start-Time: 1454524820 X-Barracuda-Encrypted: ECDHE-RSA-AES128-GCM-SHA256 X-Barracuda-URL: https://192.48.176.25:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-BRTS-Status: 1 X-Barracuda-Spam-Score: 0.00 X-Barracuda-Spam-Status: No, SCORE=0.00 using per-user scores of TAG_LEVEL=1000.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.7 tests=BSF_SC0_MISMATCH_TO X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.3.26710 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 0.00 BSF_SC0_MISMATCH_TO Envelope rcpt doesn't match header The first patch ensures ->end_io is always called for direct I/O requests that pass it in, even if there was a zero length write, or if an error occured. The existing users have been updated to ignore it, but XFS will make use of it in the future, and a comment in ext4 suggests it might be useful for it as well. The other two simplify the XFS direct I/O code. Changes since V1: - allow ->end_io to return errors - a comment spelling fix From BATV+60f2efc1bb123f201640+4546+infradead.org+hch@casper.srs.infradead.org Wed Feb 3 12:40:25 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=ham version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay3.corp.sgi.com [198.149.34.15]) by oss.sgi.com (Postfix) with ESMTP id EB3CA7CA1 for ; Wed, 3 Feb 2016 12:40:24 -0600 (CST) Received: from cuda.sgi.com (cuda2.sgi.com [192.48.176.25]) by relay3.corp.sgi.com (Postfix) with ESMTP id 8ABB1AC006 for ; Wed, 3 Feb 2016 10:40:24 -0800 (PST) X-ASG-Debug-ID: 1454524822-04cbb04c9791c20001-NocioJ Received: from casper.infradead.org (casper.infradead.org [85.118.1.10]) by cuda.sgi.com with ESMTP id 0FWS6eZ7AroX025B (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128 verify=NO) for ; Wed, 03 Feb 2016 10:40:23 -0800 (PST) X-Barracuda-Envelope-From: BATV+60f2efc1bb123f201640+4546+infradead.org+hch@casper.srs.infradead.org X-Barracuda-Apparent-Source-IP: 85.118.1.10 Received: from chello080109146114.tirol.surfer.at ([80.109.146.114] helo=localhost) by casper.infradead.org with esmtpsa (Exim 4.85 #2 (Red Hat Linux)) id 1aR2Ll-00017Y-W9; Wed, 03 Feb 2016 18:40:22 +0000 From: Christoph Hellwig To: linux-fsdevel@vger.kernel.org, xfs@oss.sgi.com, linux-ext4@vger.kernel.org, ocfs2-devel@oss.oracle.com Subject: [PATCH 3/3] xfs: fold xfs_vm_do_dio into xfs_vm_direct_IO Date: Wed, 3 Feb 2016 19:40:16 +0100 X-ASG-Orig-Subj: [PATCH 3/3] xfs: fold xfs_vm_do_dio into xfs_vm_direct_IO Message-Id: <1454524816-11392-4-git-send-email-hch@lst.de> X-Mailer: git-send-email 2.1.4 In-Reply-To: <1454524816-11392-1-git-send-email-hch@lst.de> References: <1454524816-11392-1-git-send-email-hch@lst.de> X-SRS-Rewrite: SMTP reverse-path rewritten from by casper.infradead.org X-Barracuda-Connect: casper.infradead.org[85.118.1.10] X-Barracuda-Start-Time: 1454524822 X-Barracuda-Encrypted: ECDHE-RSA-AES128-GCM-SHA256 X-Barracuda-URL: https://192.48.176.25:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-BRTS-Status: 1 X-Barracuda-Spam-Score: 0.00 X-Barracuda-Spam-Status: No, SCORE=0.00 using per-user scores of TAG_LEVEL=1000.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.7 tests=BSF_SC0_MISMATCH_TO X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.3.26710 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 0.00 BSF_SC0_MISMATCH_TO Envelope rcpt doesn't match header Signed-off-by: Christoph Hellwig Reviewed-by: Brian Foster --- fs/xfs/xfs_aops.c | 36 ++++++++++++++---------------------- 1 file changed, 14 insertions(+), 22 deletions(-) diff --git a/fs/xfs/xfs_aops.c b/fs/xfs/xfs_aops.c index f008a4f..8163910 100644 --- a/fs/xfs/xfs_aops.c +++ b/fs/xfs/xfs_aops.c @@ -1596,38 +1596,30 @@ xfs_end_io_direct_write( return error; } -static inline ssize_t -xfs_vm_do_dio( - struct inode *inode, +STATIC ssize_t +xfs_vm_direct_IO( struct kiocb *iocb, struct iov_iter *iter, - loff_t offset, - dio_iodone_t endio, - int flags) + loff_t offset) { + struct inode *inode = iocb->ki_filp->f_mapping->host; + dio_iodone_t *endio = NULL; + int flags = 0; struct block_device *bdev; - if (IS_DAX(inode)) + if (iov_iter_rw(iter) == WRITE) { + endio = xfs_end_io_direct_write; + flags = DIO_ASYNC_EXTEND; + } + + if (IS_DAX(inode)) { return dax_do_io(iocb, inode, iter, offset, xfs_get_blocks_direct, endio, 0); + } bdev = xfs_find_bdev_for_inode(inode); return __blockdev_direct_IO(iocb, inode, bdev, iter, offset, - xfs_get_blocks_direct, endio, NULL, flags); -} - -STATIC ssize_t -xfs_vm_direct_IO( - struct kiocb *iocb, - struct iov_iter *iter, - loff_t offset) -{ - struct inode *inode = iocb->ki_filp->f_mapping->host; - - if (iov_iter_rw(iter) == WRITE) - return xfs_vm_do_dio(inode, iocb, iter, offset, - xfs_end_io_direct_write, DIO_ASYNC_EXTEND); - return xfs_vm_do_dio(inode, iocb, iter, offset, NULL, 0); + xfs_get_blocks_direct, endio, NULL, flags); } /* -- 2.1.4 From BATV+60f2efc1bb123f201640+4546+infradead.org+hch@casper.srs.infradead.org Wed Feb 3 12:40:26 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=ham version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay2.corp.sgi.com [137.38.102.29]) by oss.sgi.com (Postfix) with ESMTP id DFC4429E00 for ; Wed, 3 Feb 2016 12:40:26 -0600 (CST) Received: from cuda.sgi.com (cuda2.sgi.com [192.48.176.25]) by relay2.corp.sgi.com (Postfix) with ESMTP id D25AE304053 for ; Wed, 3 Feb 2016 10:40:23 -0800 (PST) X-ASG-Debug-ID: 1454524820-04cbb04c9591c00001-NocioJ Received: from casper.infradead.org (casper.infradead.org [85.118.1.10]) by cuda.sgi.com with ESMTP id lS77bagSBWtyvAI7 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128 verify=NO) for ; Wed, 03 Feb 2016 10:40:20 -0800 (PST) X-Barracuda-Envelope-From: BATV+60f2efc1bb123f201640+4546+infradead.org+hch@casper.srs.infradead.org X-Barracuda-Apparent-Source-IP: 85.118.1.10 Received: from chello080109146114.tirol.surfer.at ([80.109.146.114] helo=localhost) by casper.infradead.org with esmtpsa (Exim 4.85 #2 (Red Hat Linux)) id 1aR2Lj-00017E-Vb; Wed, 03 Feb 2016 18:40:20 +0000 From: Christoph Hellwig To: linux-fsdevel@vger.kernel.org, xfs@oss.sgi.com, linux-ext4@vger.kernel.org, ocfs2-devel@oss.oracle.com Subject: [PATCH 1/3] direct-io: always call ->end_io if non-NULL Date: Wed, 3 Feb 2016 19:40:14 +0100 X-ASG-Orig-Subj: [PATCH 1/3] direct-io: always call ->end_io if non-NULL Message-Id: <1454524816-11392-2-git-send-email-hch@lst.de> X-Mailer: git-send-email 2.1.4 In-Reply-To: <1454524816-11392-1-git-send-email-hch@lst.de> References: <1454524816-11392-1-git-send-email-hch@lst.de> X-SRS-Rewrite: SMTP reverse-path rewritten from by casper.infradead.org X-Barracuda-Connect: casper.infradead.org[85.118.1.10] X-Barracuda-Start-Time: 1454524820 X-Barracuda-Encrypted: ECDHE-RSA-AES128-GCM-SHA256 X-Barracuda-URL: https://192.48.176.25:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-BRTS-Status: 1 X-Barracuda-Spam-Score: 0.00 X-Barracuda-Spam-Status: No, SCORE=0.00 using per-user scores of TAG_LEVEL=1000.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.7 tests=BSF_SC0_MISMATCH_TO X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.3.26710 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 0.00 BSF_SC0_MISMATCH_TO Envelope rcpt doesn't match header This way we can pass back errors to the file system, and allow for cleanup required for all direct I/O invocations. Also allow the ->end_io handlers to return errors on their own, so that I/O completion errors can be passed on to the callers. Signed-off-by: Christoph Hellwig --- fs/dax.c | 9 +++++++-- fs/direct-io.c | 9 +++++++-- fs/ext4/inode.c | 9 +++++++-- fs/ocfs2/aops.c | 7 ++++++- fs/xfs/xfs_aops.c | 13 +++++++------ include/linux/fs.h | 2 +- 6 files changed, 35 insertions(+), 14 deletions(-) diff --git a/fs/dax.c b/fs/dax.c index 4fd6b0c..e38b2c5 100644 --- a/fs/dax.c +++ b/fs/dax.c @@ -267,8 +267,13 @@ ssize_t dax_do_io(struct kiocb *iocb, struct inode *inode, if ((flags & DIO_LOCKING) && iov_iter_rw(iter) == READ) inode_unlock(inode); - if ((retval > 0) && end_io) - end_io(iocb, pos, retval, bh.b_private); + if (end_io) { + int err; + + err = end_io(iocb, pos, retval, bh.b_private); + if (err) + retval = err; + } if (!(flags & DIO_SKIP_DIO_COUNT)) inode_dio_end(inode); diff --git a/fs/direct-io.c b/fs/direct-io.c index 1b2f7ff..9c6f885 100644 --- a/fs/direct-io.c +++ b/fs/direct-io.c @@ -253,8 +253,13 @@ static ssize_t dio_complete(struct dio *dio, loff_t offset, ssize_t ret, if (ret == 0) ret = transferred; - if (dio->end_io && dio->result) - dio->end_io(dio->iocb, offset, transferred, dio->private); + if (dio->end_io) { + int err; + + err = dio->end_io(dio->iocb, offset, ret, dio->private); + if (err) + ret = err; + } if (!(dio->flags & DIO_SKIP_DIO_COUNT)) inode_dio_end(dio->inode); diff --git a/fs/ext4/inode.c b/fs/ext4/inode.c index 83bc8bf..9db04dd 100644 --- a/fs/ext4/inode.c +++ b/fs/ext4/inode.c @@ -3161,14 +3161,17 @@ out: } #endif -static void ext4_end_io_dio(struct kiocb *iocb, loff_t offset, +static int ext4_end_io_dio(struct kiocb *iocb, loff_t offset, ssize_t size, void *private) { ext4_io_end_t *io_end = iocb->private; + if (size <= 0) + return 0; + /* if not async direct IO just return */ if (!io_end) - return; + return 0; ext_debug("ext4_end_io_dio(): io_end 0x%p " "for inode %lu, iocb 0x%p, offset %llu, size %zd\n", @@ -3179,6 +3182,8 @@ static void ext4_end_io_dio(struct kiocb *iocb, loff_t offset, io_end->offset = offset; io_end->size = size; ext4_put_io_end(io_end); + + return 0; } /* diff --git a/fs/ocfs2/aops.c b/fs/ocfs2/aops.c index 794fd15..5dcc5f5 100644 --- a/fs/ocfs2/aops.c +++ b/fs/ocfs2/aops.c @@ -620,7 +620,7 @@ bail: * particularly interested in the aio/dio case. We use the rw_lock DLM lock * to protect io on one node from truncation on another. */ -static void ocfs2_dio_end_io(struct kiocb *iocb, +static int ocfs2_dio_end_io(struct kiocb *iocb, loff_t offset, ssize_t bytes, void *private) @@ -628,6 +628,9 @@ static void ocfs2_dio_end_io(struct kiocb *iocb, struct inode *inode = file_inode(iocb->ki_filp); int level; + if (bytes <= 0) + return 0; + /* this io's submitter should not have unlocked this before we could */ BUG_ON(!ocfs2_iocb_is_rw_locked(iocb)); @@ -644,6 +647,8 @@ static void ocfs2_dio_end_io(struct kiocb *iocb, level = ocfs2_iocb_rw_locked_level(iocb); ocfs2_rw_unlock(inode, level); } + + return 0; } static int ocfs2_releasepage(struct page *page, gfp_t wait) diff --git a/fs/xfs/xfs_aops.c b/fs/xfs/xfs_aops.c index 379c089..295aaff 100644 --- a/fs/xfs/xfs_aops.c +++ b/fs/xfs/xfs_aops.c @@ -1645,7 +1645,7 @@ out_end_io: * case the completion can be called in interrupt context, whereas if we have an * ioend we will always be called in task context (i.e. from a workqueue). */ -STATIC void +STATIC int xfs_end_io_direct_write( struct kiocb *iocb, loff_t offset, @@ -1655,15 +1655,19 @@ xfs_end_io_direct_write( struct inode *inode = file_inode(iocb->ki_filp); struct xfs_ioend *ioend = private; + if (size <= 0) + return 0; + trace_xfs_gbmap_direct_endio(XFS_I(inode), offset, size, ioend ? ioend->io_type : 0, NULL); if (!ioend) { ASSERT(offset + size <= i_size_read(inode)); - return; + return 0; } __xfs_end_io_direct_write(inode, ioend, offset, size); + return 0; } static inline ssize_t @@ -1672,10 +1676,7 @@ xfs_vm_do_dio( struct kiocb *iocb, struct iov_iter *iter, loff_t offset, - void (*endio)(struct kiocb *iocb, - loff_t offset, - ssize_t size, - void *private), + dio_iodone_t endio, int flags) { struct block_device *bdev; diff --git a/include/linux/fs.h b/include/linux/fs.h index 1a20462..d7f37bf 100644 --- a/include/linux/fs.h +++ b/include/linux/fs.h @@ -70,7 +70,7 @@ extern int sysctl_protected_hardlinks; struct buffer_head; typedef int (get_block_t)(struct inode *inode, sector_t iblock, struct buffer_head *bh_result, int create); -typedef void (dio_iodone_t)(struct kiocb *iocb, loff_t offset, +typedef int (dio_iodone_t)(struct kiocb *iocb, loff_t offset, ssize_t bytes, void *private); typedef void (dax_iodone_t)(struct buffer_head *bh_map, int uptodate); -- 2.1.4 From BATV+60f2efc1bb123f201640+4546+infradead.org+hch@casper.srs.infradead.org Wed Feb 3 12:40:26 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=ham version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay3.corp.sgi.com [198.149.34.15]) by oss.sgi.com (Postfix) with ESMTP id C24587CA1 for ; Wed, 3 Feb 2016 12:40:25 -0600 (CST) Received: from cuda.sgi.com (cuda3.sgi.com [192.48.176.15]) by relay3.corp.sgi.com (Postfix) with ESMTP id 3538BAC00A for ; Wed, 3 Feb 2016 10:40:25 -0800 (PST) X-ASG-Debug-ID: 1454524821-04cb6c37972e160001-NocioJ Received: from casper.infradead.org (casper.infradead.org [85.118.1.10]) by cuda.sgi.com with ESMTP id L2qsr6QRLXe2TKF4 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128 verify=NO) for ; Wed, 03 Feb 2016 10:40:22 -0800 (PST) X-Barracuda-Envelope-From: BATV+60f2efc1bb123f201640+4546+infradead.org+hch@casper.srs.infradead.org X-Barracuda-Apparent-Source-IP: 85.118.1.10 Received: from chello080109146114.tirol.surfer.at ([80.109.146.114] helo=localhost) by casper.infradead.org with esmtpsa (Exim 4.85 #2 (Red Hat Linux)) id 1aR2Lk-00017S-VG; Wed, 03 Feb 2016 18:40:21 +0000 From: Christoph Hellwig To: linux-fsdevel@vger.kernel.org, xfs@oss.sgi.com, linux-ext4@vger.kernel.org, ocfs2-devel@oss.oracle.com Subject: [PATCH 2/3] xfs: don't use ioends for direct write completions Date: Wed, 3 Feb 2016 19:40:15 +0100 X-ASG-Orig-Subj: [PATCH 2/3] xfs: don't use ioends for direct write completions Message-Id: <1454524816-11392-3-git-send-email-hch@lst.de> X-Mailer: git-send-email 2.1.4 In-Reply-To: <1454524816-11392-1-git-send-email-hch@lst.de> References: <1454524816-11392-1-git-send-email-hch@lst.de> X-SRS-Rewrite: SMTP reverse-path rewritten from by casper.infradead.org X-Barracuda-Connect: casper.infradead.org[85.118.1.10] X-Barracuda-Start-Time: 1454524821 X-Barracuda-Encrypted: ECDHE-RSA-AES128-GCM-SHA256 X-Barracuda-URL: https://192.48.176.15:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-BRTS-Status: 1 X-Barracuda-Spam-Score: 0.00 X-Barracuda-Spam-Status: No, SCORE=0.00 using per-user scores of TAG_LEVEL=1000.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.7 tests=BSF_SC0_MISMATCH_TO X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.3.26710 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 0.00 BSF_SC0_MISMATCH_TO Envelope rcpt doesn't match header We only need to communicate two bits of information to the direct I/O completion handler: (1) do we need to convert any unwritten extents in the range (2) do we need to check if we need to update the inode size based on the range passed to the completion handler We can use the private data passed to the get_block handler and the completion handler as a simple bitmask to communicate this information instead of the current complicated infrastructure reusing the ioends from the buffer I/O path, and thus avoiding a memory allocation and a context switch for any non-trivial direct write. As a nice side effect we also decouple the direct I/O path implementation from that of the buffered I/O path. Signed-off-by: Christoph Hellwig Reviewed-by: Brian Foster --- fs/xfs/xfs_aops.c | 216 ++++++++++++++++++----------------------------------- fs/xfs/xfs_trace.h | 9 +-- 2 files changed, 75 insertions(+), 150 deletions(-) diff --git a/fs/xfs/xfs_aops.c b/fs/xfs/xfs_aops.c index 295aaff..f008a4f 100644 --- a/fs/xfs/xfs_aops.c +++ b/fs/xfs/xfs_aops.c @@ -36,6 +36,10 @@ #include #include +/* flags for direct write completions */ +#define XFS_DIO_FLAG_UNWRITTEN (1 << 0) +#define XFS_DIO_FLAG_APPEND (1 << 1) + void xfs_count_page_state( struct page *page, @@ -1238,27 +1242,8 @@ xfs_vm_releasepage( } /* - * When we map a DIO buffer, we may need to attach an ioend that describes the - * type of write IO we are doing. This passes to the completion function the - * operations it needs to perform. If the mapping is for an overwrite wholly - * within the EOF then we don't need an ioend and so we don't allocate one. - * This avoids the unnecessary overhead of allocating and freeing ioends for - * workloads that don't require transactions on IO completion. - * - * If we get multiple mappings in a single IO, we might be mapping different - * types. But because the direct IO can only have a single private pointer, we - * need to ensure that: - * - * a) i) the ioend spans the entire region of unwritten mappings; or - * ii) the ioend spans all the mappings that cross or are beyond EOF; and - * b) if it contains unwritten extents, it is *permanently* marked as such - * - * We could do this by chaining ioends like buffered IO does, but we only - * actually get one IO completion callback from the direct IO, and that spans - * the entire IO regardless of how many mappings and IOs are needed to complete - * the DIO. There is only going to be one reference to the ioend and its life - * cycle is constrained by the DIO completion code. hence we don't need - * reference counting here. + * When we map a DIO buffer, we may need to pass flags to + * xfs_end_io_direct_write to tell it what kind of write IO we are doing. * * Note that for DIO, an IO to the highest supported file block offset (i.e. * 2^63 - 1FSB bytes) will result in the offset + count overflowing a signed 64 @@ -1266,68 +1251,26 @@ xfs_vm_releasepage( * extending the file size. We won't know for sure until IO completion is run * and the actual max write offset is communicated to the IO completion * routine. - * - * For DAX page faults, we are preparing to never see unwritten extents here, - * nor should we ever extend the inode size. Hence we will soon have nothing to - * do here for this case, ensuring we don't have to provide an IO completion - * callback to free an ioend that we don't actually need for a fault into the - * page at offset (2^63 - 1FSB) bytes. */ - static void xfs_map_direct( struct inode *inode, struct buffer_head *bh_result, struct xfs_bmbt_irec *imap, - xfs_off_t offset, - bool dax_fault) + xfs_off_t offset) { - struct xfs_ioend *ioend; + uintptr_t *flags = (uintptr_t *)&bh_result->b_private; xfs_off_t size = bh_result->b_size; - int type; - - if (ISUNWRITTEN(imap)) - type = XFS_IO_UNWRITTEN; - else - type = XFS_IO_OVERWRITE; - - trace_xfs_gbmap_direct(XFS_I(inode), offset, size, type, imap); - - if (dax_fault) { - ASSERT(type == XFS_IO_OVERWRITE); - trace_xfs_gbmap_direct_none(XFS_I(inode), offset, size, type, - imap); - return; - } - if (bh_result->b_private) { - ioend = bh_result->b_private; - ASSERT(ioend->io_size > 0); - ASSERT(offset >= ioend->io_offset); - if (offset + size > ioend->io_offset + ioend->io_size) - ioend->io_size = offset - ioend->io_offset + size; - - if (type == XFS_IO_UNWRITTEN && type != ioend->io_type) - ioend->io_type = XFS_IO_UNWRITTEN; - - trace_xfs_gbmap_direct_update(XFS_I(inode), ioend->io_offset, - ioend->io_size, ioend->io_type, - imap); - } else if (type == XFS_IO_UNWRITTEN || - offset + size > i_size_read(inode) || - offset + size < 0) { - ioend = xfs_alloc_ioend(inode, type); - ioend->io_offset = offset; - ioend->io_size = size; + trace_xfs_get_blocks_map_direct(XFS_I(inode), offset, size, + ISUNWRITTEN(imap) ? XFS_IO_UNWRITTEN : XFS_IO_OVERWRITE, imap); - bh_result->b_private = ioend; + if (ISUNWRITTEN(imap)) { + *flags |= XFS_DIO_FLAG_UNWRITTEN; + set_buffer_defer_completion(bh_result); + } else if (offset + size > i_size_read(inode) || offset + size < 0) { + *flags |= XFS_DIO_FLAG_APPEND; set_buffer_defer_completion(bh_result); - - trace_xfs_gbmap_direct_new(XFS_I(inode), offset, size, type, - imap); - } else { - trace_xfs_gbmap_direct_none(XFS_I(inode), offset, size, type, - imap); } } @@ -1498,9 +1441,12 @@ __xfs_get_blocks( if (ISUNWRITTEN(&imap)) set_buffer_unwritten(bh_result); /* direct IO needs special help */ - if (create && direct) - xfs_map_direct(inode, bh_result, &imap, offset, - dax_fault); + if (create && direct) { + if (dax_fault) + ASSERT(!ISUNWRITTEN(&imap)); + else + xfs_map_direct(inode, bh_result, &imap, offset); + } } /* @@ -1570,42 +1516,50 @@ xfs_get_blocks_dax_fault( return __xfs_get_blocks(inode, iblock, bh_result, create, true, true); } -static void -__xfs_end_io_direct_write( - struct inode *inode, - struct xfs_ioend *ioend, +/* + * Complete a direct I/O write request. + * + * xfs_map_direct passes us some flags in the private data to tell us what to + * do. If no flags are set, then the write IO is an overwrite wholly within + * the existing allocated file size and so there is nothing for us to do. + * + * Note that in this case the completion can be called in interrupt context, + * whereas if we have flags set we will always be called in task context + * (i.e. from a workqueue). + */ +STATIC int +xfs_end_io_direct_write( + struct kiocb *iocb, loff_t offset, - ssize_t size) + ssize_t size, + void *private) { - struct xfs_mount *mp = XFS_I(inode)->i_mount; + struct inode *inode = file_inode(iocb->ki_filp); + struct xfs_inode *ip = XFS_I(inode); + struct xfs_mount *mp = ip->i_mount; + uintptr_t flags = (uintptr_t)private; + int error = 0; - if (XFS_FORCED_SHUTDOWN(mp) || ioend->io_error) - goto out_end_io; + trace_xfs_end_io_direct_write(ip, offset, size); - /* - * dio completion end_io functions are only called on writes if more - * than 0 bytes was written. - */ - ASSERT(size > 0); + if (XFS_FORCED_SHUTDOWN(mp)) + return -EIO; - /* - * The ioend only maps whole blocks, while the IO may be sector aligned. - * Hence the ioend offset/size may not match the IO offset/size exactly. - * Because we don't map overwrites within EOF into the ioend, the offset - * may not match, but only if the endio spans EOF. Either way, write - * the IO sizes into the ioend so that completion processing does the - * right thing. - */ - ASSERT(offset + size <= ioend->io_offset + ioend->io_size); - ioend->io_size = size; - ioend->io_offset = offset; + if (size <= 0) + return size; /* - * The ioend tells us whether we are doing unwritten extent conversion + * The flags tell us whether we are doing unwritten extent conversions * or an append transaction that updates the on-disk file size. These * cases are the only cases where we should *potentially* be needing * to update the VFS inode size. - * + */ + if (flags == 0) { + ASSERT(offset + size <= i_size_read(inode)); + return 0; + } + + /* * We need to update the in-core inode size here so that we don't end up * with the on-disk inode size being outside the in-core inode size. We * have no other method of updating EOF for AIO, so always do it here @@ -1616,58 +1570,30 @@ __xfs_end_io_direct_write( * here can result in EOF moving backwards and Bad Things Happen when * that occurs. */ - spin_lock(&XFS_I(inode)->i_flags_lock); + spin_lock(&ip->i_flags_lock); if (offset + size > i_size_read(inode)) i_size_write(inode, offset + size); - spin_unlock(&XFS_I(inode)->i_flags_lock); + spin_unlock(&ip->i_flags_lock); - /* - * If we are doing an append IO that needs to update the EOF on disk, - * do the transaction reserve now so we can use common end io - * processing. Stashing the error (if there is one) in the ioend will - * result in the ioend processing passing on the error if it is - * possible as we can't return it from here. - */ - if (ioend->io_type == XFS_IO_OVERWRITE) - ioend->io_error = xfs_setfilesize_trans_alloc(ioend); + if (flags & XFS_DIO_FLAG_UNWRITTEN) { + trace_xfs_end_io_direct_write_unwritten(ip, offset, size); -out_end_io: - xfs_end_io(&ioend->io_work); - return; -} + error = xfs_iomap_write_unwritten(ip, offset, size); + } else if (flags & XFS_DIO_FLAG_APPEND) { + struct xfs_trans *tp; -/* - * Complete a direct I/O write request. - * - * The ioend structure is passed from __xfs_get_blocks() to tell us what to do. - * If no ioend exists (i.e. @private == NULL) then the write IO is an overwrite - * wholly within the EOF and so there is nothing for us to do. Note that in this - * case the completion can be called in interrupt context, whereas if we have an - * ioend we will always be called in task context (i.e. from a workqueue). - */ -STATIC int -xfs_end_io_direct_write( - struct kiocb *iocb, - loff_t offset, - ssize_t size, - void *private) -{ - struct inode *inode = file_inode(iocb->ki_filp); - struct xfs_ioend *ioend = private; + trace_xfs_end_io_direct_write_append(ip, offset, size); - if (size <= 0) - return 0; - - trace_xfs_gbmap_direct_endio(XFS_I(inode), offset, size, - ioend ? ioend->io_type : 0, NULL); - - if (!ioend) { - ASSERT(offset + size <= i_size_read(inode)); - return 0; + tp = xfs_trans_alloc(mp, XFS_TRANS_FSYNC_TS); + error = xfs_trans_reserve(tp, &M_RES(mp)->tr_fsyncts, 0, 0); + if (error) { + xfs_trans_cancel(tp); + return error; + } + error = xfs_setfilesize(ip, tp, offset, size); } - __xfs_end_io_direct_write(inode, ioend, offset, size); - return 0; + return error; } static inline ssize_t diff --git a/fs/xfs/xfs_trace.h b/fs/xfs/xfs_trace.h index 391d797..c8d5842 100644 --- a/fs/xfs/xfs_trace.h +++ b/fs/xfs/xfs_trace.h @@ -1296,11 +1296,7 @@ DEFINE_IOMAP_EVENT(xfs_map_blocks_found); DEFINE_IOMAP_EVENT(xfs_map_blocks_alloc); DEFINE_IOMAP_EVENT(xfs_get_blocks_found); DEFINE_IOMAP_EVENT(xfs_get_blocks_alloc); -DEFINE_IOMAP_EVENT(xfs_gbmap_direct); -DEFINE_IOMAP_EVENT(xfs_gbmap_direct_new); -DEFINE_IOMAP_EVENT(xfs_gbmap_direct_update); -DEFINE_IOMAP_EVENT(xfs_gbmap_direct_none); -DEFINE_IOMAP_EVENT(xfs_gbmap_direct_endio); +DEFINE_IOMAP_EVENT(xfs_get_blocks_map_direct); DECLARE_EVENT_CLASS(xfs_simple_io_class, TP_PROTO(struct xfs_inode *ip, xfs_off_t offset, ssize_t count), @@ -1340,6 +1336,9 @@ DEFINE_SIMPLE_IO_EVENT(xfs_unwritten_convert); DEFINE_SIMPLE_IO_EVENT(xfs_get_blocks_notfound); DEFINE_SIMPLE_IO_EVENT(xfs_setfilesize); DEFINE_SIMPLE_IO_EVENT(xfs_zero_eof); +DEFINE_SIMPLE_IO_EVENT(xfs_end_io_direct_write); +DEFINE_SIMPLE_IO_EVENT(xfs_end_io_direct_write_unwritten); +DEFINE_SIMPLE_IO_EVENT(xfs_end_io_direct_write_append); DECLARE_EVENT_CLASS(xfs_itrunc_class, TP_PROTO(struct xfs_inode *ip, xfs_fsize_t new_size), -- 2.1.4 From jmoyer@redhat.com Wed Feb 3 13:43:09 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=ham version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay3.corp.sgi.com [198.149.34.15]) by oss.sgi.com (Postfix) with ESMTP id 38C9F7CA1 for ; Wed, 3 Feb 2016 13:43:09 -0600 (CST) Received: from cuda.sgi.com (cuda1.sgi.com [192.48.157.11]) by relay3.corp.sgi.com (Postfix) with ESMTP id DA086AC001 for ; Wed, 3 Feb 2016 11:43:05 -0800 (PST) X-ASG-Debug-ID: 1454528584-04bdf079c500900001-NocioJ Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by cuda.sgi.com with ESMTP id Wnptv1ONZzvlB3OY (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO) for ; Wed, 03 Feb 2016 11:43:04 -0800 (PST) X-Barracuda-Envelope-From: jmoyer@redhat.com X-Barracuda-Apparent-Source-IP: 209.132.183.28 X-ASG-Whitelist: Client Received: from int-mx11.intmail.prod.int.phx2.redhat.com (int-mx11.intmail.prod.int.phx2.redhat.com [10.5.11.24]) by mx1.redhat.com (Postfix) with ESMTPS id 4D9778F4F4; Wed, 3 Feb 2016 19:43:04 +0000 (UTC) Received: from segfault.boston.devel.redhat.com (segfault.boston.devel.redhat.com [10.19.60.26]) by int-mx11.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id u13Jh2gL013248 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Wed, 3 Feb 2016 14:43:03 -0500 From: Jeff Moyer To: Christoph Hellwig Cc: linux-fsdevel@vger.kernel.org, xfs@oss.sgi.com, linux-ext4@vger.kernel.org, ocfs2-devel@oss.oracle.com Subject: Re: vfs/xfs: directio updates to ease COW handling V2 References: <1454524816-11392-1-git-send-email-hch@lst.de> X-ASG-Orig-Subj: Re: vfs/xfs: directio updates to ease COW handling V2 X-PGP-KeyID: 1F78E1B4 X-PGP-CertKey: F6FE 280D 8293 F72C 65FD 5A58 1FF8 A7CA 1F78 E1B4 X-PCLoadLetter: What the f**k does that mean? Date: Wed, 03 Feb 2016 14:43:02 -0500 In-Reply-To: <1454524816-11392-1-git-send-email-hch@lst.de> (Christoph Hellwig's message of "Wed, 3 Feb 2016 19:40:13 +0100") Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Scanned-By: MIMEDefang 2.68 on 10.5.11.24 X-Barracuda-Connect: mx1.redhat.com[209.132.183.28] X-Barracuda-Start-Time: 1454528584 X-Barracuda-Encrypted: ECDHE-RSA-AES256-GCM-SHA384 X-Barracuda-URL: https://192.48.157.11:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-BRTS-Status: 1 Hi, Christoph, Can you explain a bit what you mean by easing COW handling? Whenever I see COW referenced near DIO, my mind always turns to g_u_p vs. fork. Thanks! Jeff Christoph Hellwig writes: > See http://www.infradead.org/rpr.html > > The first patch ensures ->end_io is always called for direct I/O requests > that pass it in, even if there was a zero length write, or if an error > occured. The existing users have been updated to ignore it, but XFS > will make use of it in the future, and a comment in ext4 suggests it > might be useful for it as well. > > The other two simplify the XFS direct I/O code. > > Changes since V1: > - allow ->end_io to return errors > - a comment spelling fix > > > -- > 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 From darrick.wong@oracle.com Wed Feb 3 13:55:44 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay2.corp.sgi.com [137.38.102.29]) by oss.sgi.com (Postfix) with ESMTP id 0EF677CA1 for ; Wed, 3 Feb 2016 13:55:44 -0600 (CST) Received: from cuda.sgi.com (cuda2.sgi.com [192.48.176.25]) by relay2.corp.sgi.com (Postfix) with ESMTP id 007C2304039 for ; Wed, 3 Feb 2016 11:55:40 -0800 (PST) X-ASG-Debug-ID: 1454529337-04cbb04cfa037b0001-NocioJ Received: from userp1040.oracle.com (userp1040.oracle.com [156.151.31.81]) by cuda.sgi.com with ESMTP id 3P5bHrs6zdObEN4D (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO) for ; Wed, 03 Feb 2016 11:55:38 -0800 (PST) X-Barracuda-Envelope-From: darrick.wong@oracle.com X-Barracuda-Apparent-Source-IP: 156.151.31.81 Received: from aserv0021.oracle.com (aserv0021.oracle.com [141.146.126.233]) by userp1040.oracle.com (Sentrion-MTA-4.3.2/Sentrion-MTA-4.3.2) with ESMTP id u13JtYV5024728 (version=TLSv1 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Wed, 3 Feb 2016 19:55:34 GMT Received: from aserv0121.oracle.com (aserv0121.oracle.com [141.146.126.235]) by aserv0021.oracle.com (8.13.8/8.13.8) with ESMTP id u13JtXp9026775 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=FAIL); Wed, 3 Feb 2016 19:55:33 GMT Received: from abhmp0003.oracle.com (abhmp0003.oracle.com [141.146.116.9]) by aserv0121.oracle.com (8.13.8/8.13.8) with ESMTP id u13JtXFS020944; Wed, 3 Feb 2016 19:55:33 GMT Received: from localhost (/24.21.154.84) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Wed, 03 Feb 2016 11:55:33 -0800 Date: Wed, 3 Feb 2016 11:55:31 -0800 From: "Darrick J. Wong" To: Christoph Hellwig Cc: linux-fsdevel@vger.kernel.org, xfs@oss.sgi.com, linux-ext4@vger.kernel.org, ocfs2-devel@oss.oracle.com Subject: Re: [PATCH 1/3] direct-io: always call ->end_io if non-NULL Message-ID: <20160203195531.GJ20038@birch.djwong.org> X-ASG-Orig-Subj: Re: [PATCH 1/3] direct-io: always call ->end_io if non-NULL References: <1454524816-11392-1-git-send-email-hch@lst.de> <1454524816-11392-2-git-send-email-hch@lst.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1454524816-11392-2-git-send-email-hch@lst.de> User-Agent: Mutt/1.5.21 (2010-09-15) X-Source-IP: aserv0021.oracle.com [141.146.126.233] X-Barracuda-Connect: userp1040.oracle.com[156.151.31.81] X-Barracuda-Start-Time: 1454529338 X-Barracuda-Encrypted: ECDHE-RSA-AES256-GCM-SHA384 X-Barracuda-URL: https://192.48.176.25:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-BRTS-Status: 1 X-Barracuda-Spam-Score: 0.00 X-Barracuda-Spam-Status: No, SCORE=0.00 using per-user scores of TAG_LEVEL=1000.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.7 tests=BSF_SC0_MISMATCH_TO, UNPARSEABLE_RELAY X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.3.26713 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 0.00 BSF_SC0_MISMATCH_TO Envelope rcpt doesn't match header 0.00 UNPARSEABLE_RELAY Informational: message has unparseable relay lines On Wed, Feb 03, 2016 at 07:40:14PM +0100, Christoph Hellwig wrote: > This way we can pass back errors to the file system, and allow for > cleanup required for all direct I/O invocations. > > Also allow the ->end_io handlers to return errors on their own, so that > I/O completion errors can be passed on to the callers. > > Signed-off-by: Christoph Hellwig > --- > fs/dax.c | 9 +++++++-- > fs/direct-io.c | 9 +++++++-- > fs/ext4/inode.c | 9 +++++++-- > fs/ocfs2/aops.c | 7 ++++++- > fs/xfs/xfs_aops.c | 13 +++++++------ > include/linux/fs.h | 2 +- > 6 files changed, 35 insertions(+), 14 deletions(-) > > diff --git a/fs/dax.c b/fs/dax.c > index 4fd6b0c..e38b2c5 100644 > --- a/fs/dax.c > +++ b/fs/dax.c > @@ -267,8 +267,13 @@ ssize_t dax_do_io(struct kiocb *iocb, struct inode *inode, > if ((flags & DIO_LOCKING) && iov_iter_rw(iter) == READ) > inode_unlock(inode); > > - if ((retval > 0) && end_io) > - end_io(iocb, pos, retval, bh.b_private); > + if (end_io) { > + int err; > + > + err = end_io(iocb, pos, retval, bh.b_private); > + if (err) > + retval = err; This will have the effect of a later error superseding an earlier error. I'm under the impression that code should generally preserve the first error, since some side effect of that probably caused the rest of the errors. That said, my guess is that 95% of the time err is set, retval and err will both be -EIO anyway. I'm not particularly passionate about whether or not we preserve the first error code. > + } > > if (!(flags & DIO_SKIP_DIO_COUNT)) > inode_dio_end(inode); > diff --git a/fs/direct-io.c b/fs/direct-io.c > index 1b2f7ff..9c6f885 100644 > --- a/fs/direct-io.c > +++ b/fs/direct-io.c > @@ -253,8 +253,13 @@ static ssize_t dio_complete(struct dio *dio, loff_t offset, ssize_t ret, > if (ret == 0) > ret = transferred; > > - if (dio->end_io && dio->result) > - dio->end_io(dio->iocb, offset, transferred, dio->private); > + if (dio->end_io) { > + int err; > + > + err = dio->end_io(dio->iocb, offset, ret, dio->private); > + if (err) > + ret = err; Same comment here. Other than that, everything vfs looks ok to me. > + } > > if (!(dio->flags & DIO_SKIP_DIO_COUNT)) > inode_dio_end(dio->inode); > diff --git a/fs/ext4/inode.c b/fs/ext4/inode.c > index 83bc8bf..9db04dd 100644 > --- a/fs/ext4/inode.c > +++ b/fs/ext4/inode.c > @@ -3161,14 +3161,17 @@ out: > } > #endif > > -static void ext4_end_io_dio(struct kiocb *iocb, loff_t offset, > +static int ext4_end_io_dio(struct kiocb *iocb, loff_t offset, > ssize_t size, void *private) > { > ext4_io_end_t *io_end = iocb->private; > > + if (size <= 0) > + return 0; This leaks the ext4_io_end_t, if there was one. Granted, that only happens during an AIO DIO to an unwritten extent, but in any case I suggest removing this hunk and... > + > /* if not async direct IO just return */ > if (!io_end) > - return; > + return 0; > > ext_debug("ext4_end_io_dio(): io_end 0x%p " > "for inode %lu, iocb 0x%p, offset %llu, size %zd\n", > @@ -3179,6 +3182,8 @@ static void ext4_end_io_dio(struct kiocb *iocb, loff_t offset, > io_end->offset = offset; > io_end->size = size; ...if size < 0, then call ext4_clear_io_unwritten_flag to neutralize the ioend: if (size < 0) ext4_clear_io_unwritten_flag(io_end); else io_end->size = size; ext4_put_io_end(io_end); return 0; You'll probably have to stuff ext4_clear_io_unwritten_flag into a header file; it's currently a static function somewhere. > ext4_put_io_end(io_end); > + > + return 0; > } > > /* > diff --git a/fs/ocfs2/aops.c b/fs/ocfs2/aops.c > index 794fd15..5dcc5f5 100644 > --- a/fs/ocfs2/aops.c > +++ b/fs/ocfs2/aops.c > @@ -620,7 +620,7 @@ bail: > * particularly interested in the aio/dio case. We use the rw_lock DLM lock > * to protect io on one node from truncation on another. > */ > -static void ocfs2_dio_end_io(struct kiocb *iocb, > +static int ocfs2_dio_end_io(struct kiocb *iocb, > loff_t offset, > ssize_t bytes, > void *private) > @@ -628,6 +628,9 @@ static void ocfs2_dio_end_io(struct kiocb *iocb, > struct inode *inode = file_inode(iocb->ki_filp); > int level; > > + if (bytes <= 0) > + return 0; > + I suspect we still need to unlock the mutexes later on in this function. > /* this io's submitter should not have unlocked this before we could */ > BUG_ON(!ocfs2_iocb_is_rw_locked(iocb)); > > @@ -644,6 +647,8 @@ static void ocfs2_dio_end_io(struct kiocb *iocb, > level = ocfs2_iocb_rw_locked_level(iocb); > ocfs2_rw_unlock(inode, level); > } Do we need to still have an accurate value for bytes the conditional above even if the IO errored out? > + > + return 0; > } > > static int ocfs2_releasepage(struct page *page, gfp_t wait) > diff --git a/fs/xfs/xfs_aops.c b/fs/xfs/xfs_aops.c > index 379c089..295aaff 100644 > --- a/fs/xfs/xfs_aops.c > +++ b/fs/xfs/xfs_aops.c > @@ -1645,7 +1645,7 @@ out_end_io: > * case the completion can be called in interrupt context, whereas if we have an > * ioend we will always be called in task context (i.e. from a workqueue). > */ > -STATIC void > +STATIC int > xfs_end_io_direct_write( > struct kiocb *iocb, > loff_t offset, > @@ -1655,15 +1655,19 @@ xfs_end_io_direct_write( > struct inode *inode = file_inode(iocb->ki_filp); > struct xfs_ioend *ioend = private; > > + if (size <= 0) > + return 0; Same thing here, I think we can end up leaking the ioend. --D > + > trace_xfs_gbmap_direct_endio(XFS_I(inode), offset, size, > ioend ? ioend->io_type : 0, NULL); > > if (!ioend) { > ASSERT(offset + size <= i_size_read(inode)); > - return; > + return 0; > } > > __xfs_end_io_direct_write(inode, ioend, offset, size); > + return 0; > } > > static inline ssize_t > @@ -1672,10 +1676,7 @@ xfs_vm_do_dio( > struct kiocb *iocb, > struct iov_iter *iter, > loff_t offset, > - void (*endio)(struct kiocb *iocb, > - loff_t offset, > - ssize_t size, > - void *private), > + dio_iodone_t endio, > int flags) > { > struct block_device *bdev; > diff --git a/include/linux/fs.h b/include/linux/fs.h > index 1a20462..d7f37bf 100644 > --- a/include/linux/fs.h > +++ b/include/linux/fs.h > @@ -70,7 +70,7 @@ extern int sysctl_protected_hardlinks; > struct buffer_head; > typedef int (get_block_t)(struct inode *inode, sector_t iblock, > struct buffer_head *bh_result, int create); > -typedef void (dio_iodone_t)(struct kiocb *iocb, loff_t offset, > +typedef int (dio_iodone_t)(struct kiocb *iocb, loff_t offset, > ssize_t bytes, void *private); > typedef void (dax_iodone_t)(struct buffer_head *bh_map, int uptodate); > > -- > 2.1.4 > > _______________________________________________ > xfs mailing list > xfs@oss.sgi.com > http://oss.sgi.com/mailman/listinfo/xfs From darrick.wong@oracle.com Wed Feb 3 14:02:11 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay2.corp.sgi.com [137.38.102.29]) by oss.sgi.com (Postfix) with ESMTP id C95AD7CA1 for ; Wed, 3 Feb 2016 14:02:11 -0600 (CST) Received: from cuda.sgi.com (cuda1.sgi.com [192.48.157.11]) by relay2.corp.sgi.com (Postfix) with ESMTP id 9ECF3304039 for ; Wed, 3 Feb 2016 12:02:08 -0800 (PST) X-ASG-Debug-ID: 1454529724-04bdf079c1011c0001-NocioJ Received: from userp1040.oracle.com (userp1040.oracle.com [156.151.31.81]) by cuda.sgi.com with ESMTP id 1scYn2T9EXKHXdVI (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO) for ; Wed, 03 Feb 2016 12:02:04 -0800 (PST) X-Barracuda-Envelope-From: darrick.wong@oracle.com X-Barracuda-Apparent-Source-IP: 156.151.31.81 Received: from aserv0021.oracle.com (aserv0021.oracle.com [141.146.126.233]) by userp1040.oracle.com (Sentrion-MTA-4.3.2/Sentrion-MTA-4.3.2) with ESMTP id u13K215Y001384 (version=TLSv1 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Wed, 3 Feb 2016 20:02:02 GMT Received: from aserv0122.oracle.com (aserv0122.oracle.com [141.146.126.236]) by aserv0021.oracle.com (8.13.8/8.13.8) with ESMTP id u13K21iK014661 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=FAIL); Wed, 3 Feb 2016 20:02:01 GMT Received: from abhmp0011.oracle.com (abhmp0011.oracle.com [141.146.116.17]) by aserv0122.oracle.com (8.13.8/8.13.8) with ESMTP id u13K20oL024586; Wed, 3 Feb 2016 20:02:01 GMT Received: from localhost (/24.21.154.84) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Wed, 03 Feb 2016 12:02:00 -0800 Date: Wed, 3 Feb 2016 12:01:59 -0800 From: "Darrick J. Wong" To: Jeff Moyer Cc: Christoph Hellwig , linux-fsdevel@vger.kernel.org, linux-ext4@vger.kernel.org, ocfs2-devel@oss.oracle.com, xfs@oss.sgi.com Subject: Re: vfs/xfs: directio updates to ease COW handling V2 Message-ID: <20160203200159.GK20038@birch.djwong.org> X-ASG-Orig-Subj: Re: vfs/xfs: directio updates to ease COW handling V2 References: <1454524816-11392-1-git-send-email-hch@lst.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.21 (2010-09-15) X-Source-IP: aserv0021.oracle.com [141.146.126.233] X-Barracuda-Connect: userp1040.oracle.com[156.151.31.81] X-Barracuda-Start-Time: 1454529724 X-Barracuda-Encrypted: ECDHE-RSA-AES256-GCM-SHA384 X-Barracuda-URL: https://192.48.157.11:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-BRTS-Status: 1 X-Barracuda-Spam-Score: 0.00 X-Barracuda-Spam-Status: No, SCORE=0.00 using per-user scores of TAG_LEVEL=1000.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.7 tests=BSF_SC0_MISMATCH_TO, UNPARSEABLE_RELAY X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.3.26713 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 0.00 BSF_SC0_MISMATCH_TO Envelope rcpt doesn't match header 0.00 UNPARSEABLE_RELAY Informational: message has unparseable relay lines On Wed, Feb 03, 2016 at 02:43:02PM -0500, Jeff Moyer wrote: > Hi, Christoph, > > Can you explain a bit what you mean by easing COW handling? Whenever I > see COW referenced near DIO, my mind always turns to g_u_p vs. fork. Just to clarify, I'm talking about copy on write for disk blocks, not for memory pages. Basically, XFS implements (disk block) copy on write for (perfectly block aligned) directio writes by allocating a set of replacement blocks, mapping the dio writes to the new blocks, and playing a punch/remap trick to map the new blocks into the file at the appropriate offset. If the write fails then we don't want do the remap, so the dio_complete handler has to know whether or not the IO succeeded, hence the new parameter. Furthermore, if the write succeeds but the remap fails, we also want to be able to report that to userspace, hence the change of return value from void to int. (If the dio write isn't block aligned, we fall back to the page cache.) Hope that helps, --D > > Thanks! > Jeff > > Christoph Hellwig writes: > > > See http://www.infradead.org/rpr.html > > > > The first patch ensures ->end_io is always called for direct I/O requests > > that pass it in, even if there was a zero length write, or if an error > > occured. The existing users have been updated to ignore it, but XFS > > will make use of it in the future, and a comment in ext4 suggests it > > might be useful for it as well. > > > > The other two simplify the XFS direct I/O code. > > > > Changes since V1: > > - allow ->end_io to return errors > > - a comment spelling fix > > > > > > -- > > 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 > > _______________________________________________ > xfs mailing list > xfs@oss.sgi.com > http://oss.sgi.com/mailman/listinfo/xfs From david@fromorbit.com Wed Feb 3 15:52:03 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=ham version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay3.corp.sgi.com [198.149.34.15]) by oss.sgi.com (Postfix) with ESMTP id 468197CA1 for ; Wed, 3 Feb 2016 15:52:03 -0600 (CST) Received: from cuda.sgi.com (cuda3.sgi.com [192.48.176.15]) by relay3.corp.sgi.com (Postfix) with ESMTP id A55B9AC006 for ; Wed, 3 Feb 2016 13:52:02 -0800 (PST) X-ASG-Debug-ID: 1454536318-04cb6c274403430001-NocioJ Received: from ipmail07.adl2.internode.on.net (ipmail07.adl2.internode.on.net [150.101.137.131]) by cuda.sgi.com with ESMTP id nrbCFYHzU0h3vNpl for ; Wed, 03 Feb 2016 13:51:59 -0800 (PST) X-Barracuda-Envelope-From: david@fromorbit.com X-Barracuda-Apparent-Source-IP: 150.101.137.131 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: A2AvCQAHdbJW/xATLHlegzp+QYJphXKdVQEBAQEBAQaLZIlKhgcCAgEBAoFLTQEBAQEBAYELhEEBAQEDATocIwULCAMYCSUPBSUDIROIEwfAVgEBCAIeGIUyhH+HXYEPBZJshAWNRIFkjRZpigWDUmKCAxmBXCguiWsBAQE Received: from ppp121-44-19-16.lns20.syd4.internode.on.net (HELO dastard) ([121.44.19.16]) by ipmail07.adl2.internode.on.net with ESMTP; 04 Feb 2016 08:21:57 +1030 Received: from dave by dastard with local (Exim 4.80) (envelope-from ) id 1aR5Kz-0005NC-24; Thu, 04 Feb 2016 08:51:45 +1100 Date: Thu, 4 Feb 2016 08:51:45 +1100 From: Dave Chinner To: Eric Sandeen Cc: Dilip Simha , xfs@oss.sgi.com Subject: Re: Request for information on bloated writes using Swift Message-ID: <20160203215144.GE459@dastard> X-ASG-Orig-Subj: Re: Request for information on bloated writes using Swift References: <56B16A3C.1030207@sandeen.net> <20160203063705.GB459@dastard> <20160203083016.GD459@dastard> <56B21690.2070304@sandeen.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <56B21690.2070304@sandeen.net> User-Agent: Mutt/1.5.21 (2010-09-15) X-Barracuda-Connect: ipmail07.adl2.internode.on.net[150.101.137.131] X-Barracuda-Start-Time: 1454536318 X-Barracuda-URL: https://192.48.176.15:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-BRTS-Status: 1 X-Barracuda-Spam-Score: 0.00 X-Barracuda-Spam-Status: No, SCORE=0.00 using per-user scores of TAG_LEVEL=1000.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.7 tests=BSF_SC0_MISMATCH_TO X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.3.26716 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 0.00 BSF_SC0_MISMATCH_TO Envelope rcpt doesn't match header On Wed, Feb 03, 2016 at 09:02:40AM -0600, Eric Sandeen wrote: > > > On 2/3/16 2:30 AM, Dave Chinner wrote: > > On Tue, Feb 02, 2016 at 11:09:15PM -0800, Dilip Simha wrote: > >> Hi Dave, > >> > >> On Tue, Feb 2, 2016 at 10:37 PM, Dave Chinner wrote: > >> > >>> On Tue, Feb 02, 2016 at 07:40:34PM -0800, Dilip Simha wrote: > >>>> Hi Eric, > >>>> > >>>> Thank you for your quick reply. > >>>> > >>>> Using xfs_io as per your suggestion, I am able to reproduce the issue. > >>>> However, I need to falloc for 256K and write for 257K to see this issue. > >>>> > >>>> # xfs_io -f -c "falloc 0 256k" -c "pwrite 0 257k" /srv/node/r1/t1.txt > >>>> # stat /srv/node/r1/t4.txt | grep Blocks > >>>> Size: 263168 Blocks: 1536 IO Block: 4096 regular file > >>> > >>> Fallocate sets the XFS_DIFLAG_PREALLOC on the inode. > >>> > >>> When you writing *past the preallocated area* and do delayed > >>> allocation, the speculative preallocation beyond EOF is double the > >>> size of the extent at EOF. i.e. 512k, leading to 768k being > >>> allocated to the file (1536 blocks, exactly). > >>> > >> > >> Thank you for the details. > >> This is exactly where I am a bit perplexed. Since the reclamation logic > >> skips inodes that have the XFS_DIFLAG_PREALLOC flag set, why did the > >> allocation logic allot more blocks on such an inode? > > > > To store the data you wrote outside the preallocated region, of > > course. > > I think what Dilip meant was, why does it do preallocation, not > why does it allocate blocks for the data. That part is obvious > of course. ;) > > IOWS, if XFS_DIFLAG_PREALLOC prevents speculative preallocation > from being reclaimed, why is speculative preallocation added to files > with that flag set? > > Seems like a fair question, even if Swift's use of preallocation is > ill-advised. > > I don't have all the speculative preallocation heuristics in my > head like you do Dave, but if I have it right, and it's i.e.: > > 1) preallocate 256k > 2) inode gets XFS_DIFLAG_PREALLOC > 3) write 257k > 4) inode gets speculative preallocation added due to write past EOF > 5) inode never gets preallocation trimmed due to XFS_DIFLAG_PREALLOC > > that seems suboptimal. So do things the other way around: 1) write 257k 2) preallocate 256k beyond EOF and speculative prealloc region 3) inode gets XFS_DIFLAG_PREALLOC 4) inode never gets preallocation trimmed due to XFS_DIFLAG_PREALLOC This is correct behaviour. How do you tell them apart, and in what context can we actually determine that we need to remove the inode flag? Consider the fact that the 'write 257k' doesn't actually do any modification to the extent list. i.e. we still have 256k of persistent preallocation as unwritten extents. These do not converted to written extents until writeback *completes*, so if we crash before writeback, the inode remains with only 256k of preallocated, unwritten extents. speculative prealloc in memory occurs in the write() context, physical allocation occurs in the writeback context, and inode size updates occur at IO completion. i.e. none of these contexts have enough information to be able to determine whether the XFS_DIFLAG_PREALLOC needs to be removed, because it cannot be removed until all the persistent prealloc has been written over *and* the new EOF is stable on disk. Further, what about persistent preallocation in the middle of the file? Do we remove the XFS_DIFLAG_PREALLOC while that still exists as unwritten extents? This gets especially interesting once we consider the behaviour reflink, COW and dedupe should have on such extents.... As I said: This is anything but simple, and it's not going to get any simpler any time soon. > Never doing speculative preallocation on files with XFS_DIFLAG_PREALLOC > set, regardless of file offset, would seem sane to me. App asked > to take control via prealloc; let it have it, and leave it at that. We don't do speculative prealloc on inodes that already have blocks beyond EOF. We already detect that case and don't do speculative prealloc. But when there aren't blocks beyond EOF, extending writes should use speculative preallocation. But if we decide that we don't do speculative prealloc when XFS_DIFLAG_PREALLOC is set, then workloads that mis-use fallocate (like swift), or use fallocate to fill sparse holes in files are going fragment the hell out of their files when they extending them. In reality, if swift is really just writing 1k past the prealloc'd range it creates, then that is clearly an application bug. Further, if swift is only ever preallocating the first 256k of each file it writes, regardless of size, then that is also an application bug. If such users don't like the fact their application is badly written and interacts badly with a filesystem feature that is, in general, the best behaviour to have, then they can either (1) get the application fixed, or (2) set mount options to turn off the feature that the application bugs interact badly with. Cheers, Dave. -- Dave Chinner david@fromorbit.com From jmoyer@redhat.com Wed Feb 3 15:53:11 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=ham version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay2.corp.sgi.com [137.38.102.29]) by oss.sgi.com (Postfix) with ESMTP id 9E8197CA1 for ; Wed, 3 Feb 2016 15:53:11 -0600 (CST) Received: from cuda.sgi.com (cuda3.sgi.com [192.48.176.15]) by relay2.corp.sgi.com (Postfix) with ESMTP id 7F132304043 for ; Wed, 3 Feb 2016 13:53:08 -0800 (PST) X-ASG-Debug-ID: 1454536386-04cb6c2745034a0001-NocioJ Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by cuda.sgi.com with ESMTP id jZoOfH8Hmk95h88E (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO) for ; Wed, 03 Feb 2016 13:53:07 -0800 (PST) X-Barracuda-Envelope-From: jmoyer@redhat.com X-Barracuda-Apparent-Source-IP: 209.132.183.28 X-ASG-Whitelist: Client Received: from int-mx09.intmail.prod.int.phx2.redhat.com (int-mx09.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by mx1.redhat.com (Postfix) with ESMTPS id 99C617AE8F; Wed, 3 Feb 2016 21:53:06 +0000 (UTC) Received: from segfault.boston.devel.redhat.com (segfault.boston.devel.redhat.com [10.19.60.26]) by int-mx09.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id u13Lr5dH017404 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Wed, 3 Feb 2016 16:53:05 -0500 From: Jeff Moyer To: "Darrick J. Wong" Cc: Christoph Hellwig , linux-fsdevel@vger.kernel.org, linux-ext4@vger.kernel.org, ocfs2-devel@oss.oracle.com, xfs@oss.sgi.com Subject: Re: vfs/xfs: directio updates to ease COW handling V2 References: <1454524816-11392-1-git-send-email-hch@lst.de> <20160203200159.GK20038@birch.djwong.org> X-ASG-Orig-Subj: Re: vfs/xfs: directio updates to ease COW handling V2 X-PGP-KeyID: 1F78E1B4 X-PGP-CertKey: F6FE 280D 8293 F72C 65FD 5A58 1FF8 A7CA 1F78 E1B4 X-PCLoadLetter: What the f**k does that mean? Date: Wed, 03 Feb 2016 16:53:04 -0500 In-Reply-To: <20160203200159.GK20038@birch.djwong.org> (Darrick J. Wong's message of "Wed, 3 Feb 2016 12:01:59 -0800") Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Scanned-By: MIMEDefang 2.68 on 10.5.11.22 X-Barracuda-Connect: mx1.redhat.com[209.132.183.28] X-Barracuda-Start-Time: 1454536387 X-Barracuda-Encrypted: ECDHE-RSA-AES256-GCM-SHA384 X-Barracuda-URL: https://192.48.176.15:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-BRTS-Status: 1 "Darrick J. Wong" writes: > On Wed, Feb 03, 2016 at 02:43:02PM -0500, Jeff Moyer wrote: >> Hi, Christoph, >> >> Can you explain a bit what you mean by easing COW handling? Whenever I >> see COW referenced near DIO, my mind always turns to g_u_p vs. fork. > > Just to clarify, I'm talking about copy on write for disk blocks, not for > memory pages. > > Basically, XFS implements (disk block) copy on write for (perfectly block > aligned) directio writes by allocating a set of replacement blocks, mapping the > dio writes to the new blocks, and playing a punch/remap trick to map the new > blocks into the file at the appropriate offset. > > If the write fails then we don't want do the remap, so the dio_complete handler > has to know whether or not the IO succeeded, hence the new parameter. > Furthermore, if the write succeeds but the remap fails, we also want to be able > to report that to userspace, hence the change of return value from void to int. > > (If the dio write isn't block aligned, we fall back to the page cache.) > > Hope that helps, Eric said the magic word: reflink. I think I've got it now. Thanks! Jeff From david@fromorbit.com Wed Feb 3 15:56:15 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=ham version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay1.corp.sgi.com [137.38.102.111]) by oss.sgi.com (Postfix) with ESMTP id 651BF7CA1 for ; Wed, 3 Feb 2016 15:56:15 -0600 (CST) Received: from cuda.sgi.com (cuda2.sgi.com [192.48.176.25]) by relay1.corp.sgi.com (Postfix) with ESMTP id 545438F8039 for ; Wed, 3 Feb 2016 13:56:12 -0800 (PST) X-ASG-Debug-ID: 1454536569-04cbb04cf90e9e0001-NocioJ Received: from ipmail07.adl2.internode.on.net (ipmail07.adl2.internode.on.net [150.101.137.131]) by cuda.sgi.com with ESMTP id 0YC9Nzo8H4CgA2kK for ; Wed, 03 Feb 2016 13:56:09 -0800 (PST) X-Barracuda-Envelope-From: david@fromorbit.com X-Barracuda-Apparent-Source-IP: 150.101.137.131 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: A2BqDgBYdrJW/xATLHlegzpSbYJphXKETJh9DAEBAQEBAQaLZDiJEhcKhWYEAgKBS00BAQEBAQGBC4RCAQEEAQI3HCMQCAMYCSUPBRQRAyETiBoPwEgBAQgCHhiFMoR/glSFCYEPBZZxhUmFHYJejnqOQGKDeCguAYlqAQEB Received: from ppp121-44-19-16.lns20.syd4.internode.on.net (HELO dastard) ([121.44.19.16]) by ipmail07.adl2.internode.on.net with ESMTP; 04 Feb 2016 08:26:08 +1030 Received: from dave by dastard with local (Exim 4.80) (envelope-from ) id 1aR5P1-0005No-S4; Thu, 04 Feb 2016 08:55:55 +1100 Date: Thu, 4 Feb 2016 08:55:55 +1100 From: Dave Chinner To: Ross Zwisler Cc: xfs@oss.sgi.com Subject: Re: real-time device warning Message-ID: <20160203215555.GF459@dastard> X-ASG-Orig-Subj: Re: real-time device warning References: <20160203165031.GB29275@linux.intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20160203165031.GB29275@linux.intel.com> User-Agent: Mutt/1.5.21 (2010-09-15) X-Barracuda-Connect: ipmail07.adl2.internode.on.net[150.101.137.131] X-Barracuda-Start-Time: 1454536569 X-Barracuda-URL: https://192.48.176.25:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-BRTS-Status: 1 X-Barracuda-Spam-Score: 0.00 X-Barracuda-Spam-Status: No, SCORE=0.00 using per-user scores of TAG_LEVEL=1000.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.7 tests=BSF_SC0_MISMATCH_TO X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.3.26716 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 0.00 BSF_SC0_MISMATCH_TO Envelope rcpt doesn't match header On Wed, Feb 03, 2016 at 09:50:31AM -0700, Ross Zwisler wrote: > I've been doing some more real-time device testing with XFS, and I was able to > get past the BUG I reported here: > > http://www.spinics.net/lists/xfs/msg37445.html > > by setting CONFIG_XFS_DEBUG=n as Dave suggested. > > After that I/O seems to work, although it doesn't look like the DAX mount > option is applied to I/Os that go to the real-time device. > > After the first I/O, though, the following warning is hit: > > [ 413.086897] XFS (ram1): _xfs_buf_ioapply: no ops on block 0xa0/0x8 This series: http://oss.sgi.com/archives/xfs/2016-02/msg00017.html -Dave. -- Dave Chinner david@fromorbit.com From david@fromorbit.com Wed Feb 3 16:22:38 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=ham version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay2.corp.sgi.com [137.38.102.29]) by oss.sgi.com (Postfix) with ESMTP id 4231129DF9 for ; Wed, 3 Feb 2016 16:22:38 -0600 (CST) Received: from cuda.sgi.com (cuda3.sgi.com [192.48.176.15]) by relay2.corp.sgi.com (Postfix) with ESMTP id 3090A304039 for ; Wed, 3 Feb 2016 14:22:35 -0800 (PST) X-ASG-Debug-ID: 1454538149-04cb6c2745040f0001-NocioJ Received: from ipmail07.adl2.internode.on.net (ipmail07.adl2.internode.on.net [150.101.137.131]) by cuda.sgi.com with ESMTP id ysgJqIVX8KKFVN78 for ; Wed, 03 Feb 2016 14:22:30 -0800 (PST) X-Barracuda-Envelope-From: david@fromorbit.com X-Barracuda-Apparent-Source-IP: 150.101.137.131 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: A2CoBwBafLJW/xATLHlegzqBP4JphXKdVQEBAQEBAQaLZIlKhgcEAgKBS00BAQEBAQGBC4RBAQEBAwE6HCMQCAMOCgklDwUlAyETG4d4B8BfAQEIAh4YhTKEf4QRhFsFlnGNRI56jkBig3goLog7gTABAQE Received: from ppp121-44-19-16.lns20.syd4.internode.on.net (HELO dastard) ([121.44.19.16]) by ipmail07.adl2.internode.on.net with ESMTP; 04 Feb 2016 08:52:28 +1030 Received: from dave by dastard with local (Exim 4.80) (envelope-from ) id 1aR5oW-0005Qv-Cx; Thu, 04 Feb 2016 09:22:16 +1100 Date: Thu, 4 Feb 2016 09:22:16 +1100 From: Dave Chinner To: Christoph Hellwig Cc: Brian Foster , darrick.wong@oracle.com, xfs@oss.sgi.com Subject: Re: stop using ioends for direct write completions Message-ID: <20160203222216.GG459@dastard> X-ASG-Orig-Subj: Re: stop using ioends for direct write completions References: <1452766237-2314-1-git-send-email-hch@lst.de> <20160128131656.GB14876@infradead.org> <20160129141232.GA43184@bfoster.bfoster> <20160202112046.GB28777@lst.de> <20160202153117.GB1853@bfoster.bfoster> <20160202164237.GA25436@lst.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20160202164237.GA25436@lst.de> User-Agent: Mutt/1.5.21 (2010-09-15) X-Barracuda-Connect: ipmail07.adl2.internode.on.net[150.101.137.131] X-Barracuda-Start-Time: 1454538149 X-Barracuda-URL: https://192.48.176.15:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-BRTS-Status: 1 X-Barracuda-Spam-Score: 0.00 X-Barracuda-Spam-Status: No, SCORE=0.00 using per-user scores of TAG_LEVEL=1000.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.7 tests=BSF_SC0_MISMATCH_TO X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.3.26717 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 0.00 BSF_SC0_MISMATCH_TO Envelope rcpt doesn't match header On Tue, Feb 02, 2016 at 05:42:37PM +0100, Christoph Hellwig wrote: > On Tue, Feb 02, 2016 at 10:31:18AM -0500, Brian Foster wrote: > > FWIW, I don't see any such review comments against the three versions of > > the "DIO needs an ioend for writes" patch I have in my mailbox, but I > > easily could have missed something..? But if there wasn't time, then > > fair enough. > > I'll have to look at the mailboxes, but I remember Dave sending this > out and complaining. I don't recall the exact discussion that was had, but at the time it was an evil that I couldn't see a way of avoiding, and with no other solution being presented. ISTR a tie-in with the DAX code, too, but that's gone away now with the block zeroing during allocation rather than using unwritten extents and completions for this. > > If COW is the primary motivator, perhaps we can bundle it with that > > work? > > The prime motivator is to: > > (1) avoid a pointless memory allocation > (2) avoid a pointless context switch > (3) avoid pointless code complexity > > COW is just another case where these show up. *nod* Cheers, Dave. -- Dave Chinner david@fromorbit.com From nmdilipsimha@gmail.com Wed Feb 3 16:43:52 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=FREEMAIL_FROM,HTML_MESSAGE, T_DKIM_INVALID autolearn=ham version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay2.corp.sgi.com [137.38.102.29]) by oss.sgi.com (Postfix) with ESMTP id 041E37CA1 for ; Wed, 3 Feb 2016 16:43:51 -0600 (CST) Received: from cuda.sgi.com (cuda1.sgi.com [192.48.157.11]) by relay2.corp.sgi.com (Postfix) with ESMTP id 90258304039 for ; Wed, 3 Feb 2016 14:43:51 -0800 (PST) X-ASG-Debug-ID: 1454539427-04bdf079c104f20001-NocioJ Received: from mail-ob0-f172.google.com (mail-ob0-f172.google.com [209.85.214.172]) by cuda.sgi.com with ESMTP id MnkeDfAcGJ009mXF (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128 verify=NO) for ; Wed, 03 Feb 2016 14:43:47 -0800 (PST) X-Barracuda-Envelope-From: nmdilipsimha@gmail.com X-Barracuda-Apparent-Source-IP: 209.85.214.172 Received: by mail-ob0-f172.google.com with SMTP id wb13so49676295obb.1 for ; Wed, 03 Feb 2016 14:43:47 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc:content-type; bh=VzbBch1XzPDhyUtBkaUJTxaBIVHpnSkyR+aINA3LprY=; b=FkW0G1z79/UpNnweXr5t0VimGIuO34Sb04a9diZcZaLAm90K3OgNJqI3f4p3ravn7v Wcde7kVeU+aS4+ptgdZBsV95hOpWYRG36QSegzjY7EaA5/QJbjwXxXQzIyAkVQqnmKXC g61YbtuRlP7vBaPbgDdnPdhsEA/TASJgBUmpbZ5PikbP8lqrfpEVaykHkW4WkYx7rlQ7 Y37ulAMc9D8Qh5DFSjDp3S3TTASlcVv0PfvCLtC+xyGwkMqNu5qou826WQdIShPPBw26 yXPJS9GkY/ur5jzT6Hvg8+1h9B5L0ibMHGClR54KHA8xlZ47mFXn07COtswIhjHIcZSQ 5Uhg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc:content-type; bh=VzbBch1XzPDhyUtBkaUJTxaBIVHpnSkyR+aINA3LprY=; b=XovVTxvYhbYXJqLZEuZD1vaWVUMDQfd7EhvkDsIx2TOIh7qwwXNOPC5IwSz6GXEI/e UfFwpEFVNlRkvZR4uNmzw+KYTc7nHK0mZuPd8XXUif9AQMkYXlLErgDiO4HHz8hFTuER QItq+f9vPg5OsfY7lgynsrOA0TS+jFzjSztgq18e6KMNFhZbOCNgwPdBswkmRWut6bPX BDfwZbf7vNT0o3M7fc0jfz3MGWEZa1EnFen4AvI/gTrJFiIQqJhkWPMV3oDNyQ5Ql/+b U4WsfgumbZb/2V/1jGkXwxOCRwsp09OYZz+8Pqb6hYEeUC5iVkfw744Zwua7eur+Jf7T FV6g== X-Gm-Message-State: AG10YOQv7c8v+ES5whfnoRob1l3w5nhYuflsVS7ZvGaXWbZgEwNDk0EhWfrbZKSpgerQGyFV/mSnpS/hLU6r3g== X-Received: by 10.182.214.40 with SMTP id nx8mr5031426obc.20.1454539426994; Wed, 03 Feb 2016 14:43:46 -0800 (PST) MIME-Version: 1.0 Received: by 10.202.86.204 with HTTP; Wed, 3 Feb 2016 14:43:27 -0800 (PST) In-Reply-To: <20160203215144.GE459@dastard> References: <56B16A3C.1030207@sandeen.net> <20160203063705.GB459@dastard> <20160203083016.GD459@dastard> <56B21690.2070304@sandeen.net> <20160203215144.GE459@dastard> From: Dilip Simha Date: Wed, 3 Feb 2016 14:43:27 -0800 Message-ID: Subject: Re: Request for information on bloated writes using Swift To: Dave Chinner X-ASG-Orig-Subj: Re: Request for information on bloated writes using Swift Cc: Eric Sandeen , xfs@oss.sgi.com Content-Type: multipart/alternative; boundary=e89a8ff1c01edba0dd052ae55968 X-Barracuda-Connect: mail-ob0-f172.google.com[209.85.214.172] X-Barracuda-Start-Time: 1454539427 X-Barracuda-Encrypted: ECDHE-RSA-AES128-GCM-SHA256 X-Barracuda-URL: https://192.48.157.11:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-BRTS-Status: 1 X-Barracuda-Spam-Score: 0.00 X-Barracuda-Spam-Status: No, SCORE=0.00 using per-user scores of TAG_LEVEL=1000.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.7 tests=BSF_SC0_MISMATCH_TO, DKIM_SIGNED, DKIM_VERIFIED, HTML_MESSAGE X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.3.26717 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 0.00 BSF_SC0_MISMATCH_TO Envelope rcpt doesn't match header -0.00 DKIM_VERIFIED Domain Keys Identified Mail: signature passes verification 0.00 DKIM_SIGNED Domain Keys Identified Mail: message has a signature 0.00 HTML_MESSAGE BODY: HTML included in message --e89a8ff1c01edba0dd052ae55968 Content-Type: text/plain; charset=UTF-8 On Wed, Feb 3, 2016 at 1:51 PM, Dave Chinner wrote: > On Wed, Feb 03, 2016 at 09:02:40AM -0600, Eric Sandeen wrote: > > > > > > On 2/3/16 2:30 AM, Dave Chinner wrote: > > > On Tue, Feb 02, 2016 at 11:09:15PM -0800, Dilip Simha wrote: > > >> Hi Dave, > > >> > > >> On Tue, Feb 2, 2016 at 10:37 PM, Dave Chinner > wrote: > > >> > > >>> On Tue, Feb 02, 2016 at 07:40:34PM -0800, Dilip Simha wrote: > > >>>> Hi Eric, > > >>>> > > >>>> Thank you for your quick reply. > > >>>> > > >>>> Using xfs_io as per your suggestion, I am able to reproduce the > issue. > > >>>> However, I need to falloc for 256K and write for 257K to see this > issue. > > >>>> > > >>>> # xfs_io -f -c "falloc 0 256k" -c "pwrite 0 257k" > /srv/node/r1/t1.txt > > >>>> # stat /srv/node/r1/t4.txt | grep Blocks > > >>>> Size: 263168 Blocks: 1536 IO Block: 4096 regular file > > >>> > > >>> Fallocate sets the XFS_DIFLAG_PREALLOC on the inode. > > >>> > > >>> When you writing *past the preallocated area* and do delayed > > >>> allocation, the speculative preallocation beyond EOF is double the > > >>> size of the extent at EOF. i.e. 512k, leading to 768k being > > >>> allocated to the file (1536 blocks, exactly). > > >>> > > >> > > >> Thank you for the details. > > >> This is exactly where I am a bit perplexed. Since the reclamation > logic > > >> skips inodes that have the XFS_DIFLAG_PREALLOC flag set, why did the > > >> allocation logic allot more blocks on such an inode? > > > > > > To store the data you wrote outside the preallocated region, of > > > course. > > > > I think what Dilip meant was, why does it do preallocation, not > > why does it allocate blocks for the data. That part is obvious > > of course. ;) > > > > IOWS, if XFS_DIFLAG_PREALLOC prevents speculative preallocation > > from being reclaimed, why is speculative preallocation added to files > > with that flag set? > > > > Seems like a fair question, even if Swift's use of preallocation is > > ill-advised. > > > > I don't have all the speculative preallocation heuristics in my > > head like you do Dave, but if I have it right, and it's i.e.: > > > > 1) preallocate 256k > > 2) inode gets XFS_DIFLAG_PREALLOC > > 3) write 257k > > 4) inode gets speculative preallocation added due to write past EOF > > 5) inode never gets preallocation trimmed due to XFS_DIFLAG_PREALLOC > > > > that seems suboptimal. > > So do things the other way around: > > 1) write 257k > 2) preallocate 256k beyond EOF and speculative prealloc region > 3) inode gets XFS_DIFLAG_PREALLOC > 4) inode never gets preallocation trimmed due to XFS_DIFLAG_PREALLOC > > This is correct behaviour. > I am sorry, but I don't agree to this. How can an user application know about step2. XFS may preallocate 256k or any other size depending on the free space available on the system. Some other file-system may not even do speculative preallocation. So it makes little sense for an user-application to own up responsibility for disk space that it doesn't know about. > > How do you tell them apart, and in what context can we actually > determine that we need to remove the inode flag? > > Consider the fact that the 'write 257k' doesn't actually do any > modification to the extent list. i.e. we still have 256k of > persistent preallocation as unwritten extents. These do not > converted to written extents until writeback *completes*, so if we > crash before writeback, the inode remains with only 256k of > preallocated, unwritten extents. speculative prealloc in memory occurs in > the > write() context, physical allocation occurs in the writeback > context, and inode size updates occur at IO completion. > > i.e. none of these contexts have enough information to be able to > determine whether the XFS_DIFLAG_PREALLOC needs to be removed, > because it cannot be removed until all the persistent prealloc has > been written over *and* the new EOF is stable on disk. > > Further, what about persistent preallocation in the middle of the > file? Do we remove the XFS_DIFLAG_PREALLOC while that still exists > as unwritten extents? This gets especially interesting once we > consider the behaviour reflink, COW and dedupe should have on such > extents.... > > As I said: This is anything but simple, and it's not going to get > any simpler any time soon. > I agree, having to remove the XFS_DIFLAG_PREALLOC flag is not a simpler option but needs careful thought. However, as Dave suggested, its easier to NOT do speculative preallocation on inodes that have this flag already set. This is simply because of the fact that XFS assumes the user-application issued fallocate with the best knowledge of its workload. By the way, this need not be just the Swift. Any user application can experience this issue. Also, I am not associated with Swift! > > > Never doing speculative preallocation on files with XFS_DIFLAG_PREALLOC > > set, regardless of file offset, would seem sane to me. App asked > > to take control via prealloc; let it have it, and leave it at that. > > We don't do speculative prealloc on inodes that already have blocks > beyond EOF. We already detect that case and don't do speculative > prealloc. But when there aren't blocks beyond EOF, extending > writes should use speculative preallocation. > > But if we decide that we don't do speculative prealloc when > XFS_DIFLAG_PREALLOC is set, then workloads that mis-use fallocate > (like swift), or use fallocate to fill sparse holes in files are > going fragment the hell out of their files when they extending > them. > I don't understand why would this be the case. If XFS doesn't do speculative preallocation then for the 256 byte write after the end of EOF will simply result in pushing the EOF ahead. So I see no harm if XFS doesn't do speculative preallocation when XFS_DIFLAG_PREALLOC is set. > > In reality, if swift is really just writing 1k past the prealloc'd > range it creates, then that is clearly an application bug. Further, > if swift is only ever preallocating the first 256k of each file it > writes, regardless of size, then that is also an application bug. > Its not a bug. Assume a use-case like appending to a file. Would you say append is a buggy operation? An append operation can come at any time after the initial fallocate and write has happened. Simple steps to recreate this bloated-write issue is: xfs_io -f -c "falloc 0 256k" -c "pwrite 0 256k" -c "pwrite 256k 256" t1.txt Thanks & Regards, Dilip > If such users don't like the fact their application is badly written > and interacts badly with a filesystem feature that is, in general, > the best behaviour to have, then they can either (1) get the > application fixed, or (2) set mount options to turn off the feature > that the application bugs interact badly with. > > Cheers, > > Dave. > -- > Dave Chinner > david@fromorbit.com > --e89a8ff1c01edba0dd052ae55968 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
On W= ed, Feb 3, 2016 at 1:51 PM, Dave Chinner <david@fromorbit.com> wrote:
On Wed, F= eb 03, 2016 at 09:02:40AM -0600, Eric Sandeen wrote:
>
>
> On 2/3/16 2:30 AM, Dave Chinner wrote:
> > On Tue, Feb 02, 2016 at 11:09:15PM -0800, Dilip Simha wrote:
> >> Hi Dave,
> >>
> >> On Tue, Feb 2, 2016 at 10:37 PM, Dave Chinner <david@fromorbit.com> wrote:
> >>
> >>> On Tue, Feb 02, 2016 at 07:40:34PM -0800, Dilip Simha wro= te:
> >>>> Hi Eric,
> >>>>
> >>>> Thank you for your quick reply.
> >>>>
> >>>> Using xfs_io as per your suggestion, I am able to rep= roduce the issue.
> >>>> However, I need to falloc for 256K and write for 257K= to see this issue.
> >>>>
> >>>> # xfs_io -f -c "falloc 0 256k" -c "pwr= ite 0 257k" /srv/node/r1/t1.txt
> >>>> # stat /srv/node/r1/t4.txt | grep Blocks
> >>>>=C2=A0 =C2=A0Size: 263168=C2=A0 =C2=A0 =C2=A0Blocks: 1= 536=C2=A0 =C2=A0 =C2=A0 =C2=A0IO Block: 4096=C2=A0 =C2=A0regular file
> >>>
> >>> Fallocate sets the XFS_DIFLAG_PREALLOC on the inode.
> >>>
> >>> When you writing *past the preallocated area* and do dela= yed
> >>> allocation, the speculative preallocation beyond EOF is d= ouble the
> >>> size of the extent at EOF. i.e. 512k, leading to 768k bei= ng
> >>> allocated to the file (1536 blocks, exactly).
> >>>
> >>
> >> Thank you for the details.
> >> This is exactly where I am a bit perplexed. Since the reclama= tion logic
> >> skips inodes that have the XFS_DIFLAG_PREALLOC flag set, why = did the
> >> allocation logic allot more blocks on such an inode?
> >
> > To store the data you wrote outside the preallocated region, of > > course.
>
> I think what Dilip meant was, why does it do preallocation, not
> why does it allocate blocks for the data.=C2=A0 That part is obvious > of course.=C2=A0 ;)
>
> IOWS, if XFS_DIFLAG_PREALLOC prevents speculative preallocation
> from being reclaimed, why is speculative preallocation added to files<= br> > with that flag set?
>
> Seems like a fair question, even if Swift's use of preallocation i= s
> ill-advised.
>
> I don't have all the speculative preallocation heuristics in my > head like you do Dave, but if I have it right, and it's i.e.:
>
> 1) preallocate 256k
> 2) inode gets XFS_DIFLAG_PREALLOC
> 3) write 257k
> 4) inode gets speculative preallocation added due to write past EOF > 5) inode never gets preallocation trimmed due to XFS_DIFLAG_PREALLOC >
> that seems suboptimal.

So do things the other way around:

1) write 257k
2) preallocate 256k beyond EOF and speculative prealloc region
3) inode gets XFS_DIFLAG_PREALLOC
4) inode never gets preallocation trimmed due to XFS_DIFLAG_PREALLOC

This is correct behaviour.

I am sorry, = but I don't agree to this. How can an user application know about step2= . XFS may preallocate 256k or any other size depending on the free space av= ailable on the system. Some other file-system may not even do speculative p= reallocation. So it makes little sense for an user-application to own up re= sponsibility for disk space that it doesn't know about.
=C2= =A0

How do you tell them apart, and in what context can we actually
determine that we need to remove the inode flag?

Consider the fact that the 'write 257k' doesn't actually do any=
modification to the extent list. i.e. we still have 256k of
persistent preallocation as unwritten extents. These do not
converted to written extents until writeback *completes*, so if we
crash before writeback, the inode remains with only 256k of
preallocated, unwritten extents. speculative prealloc in memory occurs in t= he
write() context, physical allocation occurs in the writeback
context, and inode size updates occur at IO completion.

i.e. none of these contexts have enough information to be able to
determine whether the XFS_DIFLAG_PREALLOC needs to be removed,
because it cannot be removed until all the persistent prealloc has
been written over *and* the new EOF is stable on disk.

Further, what about persistent preallocation in the middle of the
file? Do we remove the XFS_DIFLAG_PREALLOC while that still exists
as unwritten extents? This gets especially interesting once we
consider the behaviour reflink, COW and dedupe should have on such
extents....

As I said: This is anything but simple, and it's not going to get
any simpler any time soon.

I agree, hav= ing to remove the XFS_DIFLAG_PREALLOC flag is not a simpler option but need= s careful thought.
However, as Dave suggested, its easier to NOT = do speculative preallocation on inodes that have this flag already set. Thi= s is simply because of the fact that XFS assumes the user-application issue= d fallocate with the best knowledge of its workload. By the way, this need = not be just the Swift. Any user application can experience this issue. Also= , I am not associated with Swift!

> Never doing speculative preallocation on files with XFS_DIFLAG_PREALLO= C
> set, regardless of file offset, would seem sane to me.=C2=A0 App asked=
> to take control via prealloc; let it have it, and leave it at that.
We don't do speculative prealloc on inodes that already have blo= cks
beyond EOF. We already detect that case and don't do speculative
prealloc. But when there aren't blocks beyond EOF, extending
writes should use speculative preallocation.

But if we decide that we don't do speculative prealloc when
XFS_DIFLAG_PREALLOC is set, then workloads that mis-use fallocate
(like swift), or use fallocate to fill sparse holes in files are
going fragment the hell out of their files when they extending
them.

I don't understand why would = this be the case. If XFS doesn't do speculative preallocation then for = the 256 byte write after the end of EOF will simply result in pushing the E= OF ahead. So I see no harm if XFS doesn't do speculative preallocation = when XFS_DIFLAG_PREALLOC is set.
=C2=A0

In reality, if swift is really just writing 1k past the prealloc'd
range it creates, then that is clearly an application bug. Further,
if swift is only ever preallocating the first 256k of each file it
writes, regardless of size, then that is also an application bug.

Its not a bug. Assume a use-case like appending = to a file. Would you say append is a buggy operation?
An append o= peration can come at any time after the initial fallocate and write has hap= pened.

Simple steps to recreate this bloated-write= issue is:
xfs_io -f -c "falloc 0 256k" -c "pwrite= 0 256k" -c "pwrite 256k 256" t1.txt

Thanks & Regards,
Dilip


If such users don't like the fact their application is badly written and interacts badly with a filesystem feature that is, in general,
the best behaviour to have, then they can either (1) get the
application fixed, or (2) set mount options to turn off the feature
that the application bugs interact badly with.

Cheers,

Dave.
--
Dave Chinner
david@fromorbit.com

--e89a8ff1c01edba0dd052ae55968-- From ross.zwisler@linux.intel.com Wed Feb 3 17:13:10 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=ham version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay2.corp.sgi.com [137.38.102.29]) by oss.sgi.com (Postfix) with ESMTP id F1D637CA1 for ; Wed, 3 Feb 2016 17:13:10 -0600 (CST) Received: from cuda.sgi.com (cuda2.sgi.com [192.48.176.25]) by relay2.corp.sgi.com (Postfix) with ESMTP id DFDF1304039 for ; Wed, 3 Feb 2016 15:13:10 -0800 (PST) X-ASG-Debug-ID: 1454541189-04cbb04cfa163f0001-NocioJ Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) by cuda.sgi.com with ESMTP id CqXXsdg6SzezdjcI for ; Wed, 03 Feb 2016 15:13:10 -0800 (PST) X-Barracuda-Envelope-From: ross.zwisler@linux.intel.com X-Barracuda-Apparent-Source-IP: 134.134.136.20 X-ASG-Whitelist: Client Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by orsmga101.jf.intel.com with ESMTP; 03 Feb 2016 15:13:09 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.22,392,1449561600"; d="scan'208";a="895859592" Received: from rzwisler-desk.amr.corp.intel.com (HELO linux.intel.com) ([10.252.195.239]) by fmsmga001.fm.intel.com with ESMTP; 03 Feb 2016 15:13:06 -0800 Date: Wed, 3 Feb 2016 16:12:59 -0700 From: Ross Zwisler To: Dave Chinner Cc: Ross Zwisler , xfs@oss.sgi.com Subject: Re: real-time device warning Message-ID: <20160203231259.GA5137@linux.intel.com> X-ASG-Orig-Subj: Re: real-time device warning References: <20160203165031.GB29275@linux.intel.com> <20160203215555.GF459@dastard> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20160203215555.GF459@dastard> User-Agent: Mutt/1.5.24 (2015-08-30) X-Barracuda-Connect: mga02.intel.com[134.134.136.20] X-Barracuda-Start-Time: 1454541189 X-Barracuda-URL: https://192.48.176.25:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-BRTS-Status: 1 On Thu, Feb 04, 2016 at 08:55:55AM +1100, Dave Chinner wrote: > On Wed, Feb 03, 2016 at 09:50:31AM -0700, Ross Zwisler wrote: > > I've been doing some more real-time device testing with XFS, and I was able to > > get past the BUG I reported here: > > > > http://www.spinics.net/lists/xfs/msg37445.html > > > > by setting CONFIG_XFS_DEBUG=n as Dave suggested. > > > > After that I/O seems to work, although it doesn't look like the DAX mount > > option is applied to I/Os that go to the real-time device. > > > > After the first I/O, though, the following warning is hit: > > > > [ 413.086897] XFS (ram1): _xfs_buf_ioapply: no ops on block 0xa0/0x8 > > This series: > > http://oss.sgi.com/archives/xfs/2016-02/msg00017.html Ah, I wasn't aware of that work. Can you please CC me next time so I can give you a Tested-by? From david@fromorbit.com Wed Feb 3 17:29:19 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=ham version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay2.corp.sgi.com [137.38.102.29]) by oss.sgi.com (Postfix) with ESMTP id 157CD7CA1 for ; Wed, 3 Feb 2016 17:29:19 -0600 (CST) Received: from cuda.sgi.com (cuda3.sgi.com [192.48.176.15]) by relay2.corp.sgi.com (Postfix) with ESMTP id 03865304032 for ; Wed, 3 Feb 2016 15:29:18 -0800 (PST) X-ASG-Debug-ID: 1454542151-04cb6c274507120001-NocioJ Received: from ipmail07.adl2.internode.on.net (ipmail07.adl2.internode.on.net [150.101.137.131]) by cuda.sgi.com with ESMTP id qRYjZ9gmhl8RGGwP for ; Wed, 03 Feb 2016 15:29:11 -0800 (PST) X-Barracuda-Envelope-From: david@fromorbit.com X-Barracuda-Apparent-Source-IP: 150.101.137.131 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: A2AwCQDTjLJW/xATLHlegzp+QYJphXKdVAEBAQEBAQaLZIlKhgcCAgEBAoFATQEBAQEBAYELhEEBAQEDATocIxAIAw4KCSUPBSUDIRMbh3gHwQMBKRiFMoQEe4hsBZZxjUSBZI0WaYoFg1JiggMZgVwoLolrAQEB Received: from ppp121-44-19-16.lns20.syd4.internode.on.net (HELO dastard) ([121.44.19.16]) by ipmail07.adl2.internode.on.net with ESMTP; 04 Feb 2016 09:58:47 +1030 Received: from dave by dastard with local (Exim 4.80) (envelope-from ) id 1aR6qg-0005ig-Mb; Thu, 04 Feb 2016 10:28:34 +1100 Date: Thu, 4 Feb 2016 10:28:34 +1100 From: Dave Chinner To: Dilip Simha Cc: Eric Sandeen , xfs@oss.sgi.com Subject: Re: Request for information on bloated writes using Swift Message-ID: <20160203232834.GH459@dastard> X-ASG-Orig-Subj: Re: Request for information on bloated writes using Swift References: <56B16A3C.1030207@sandeen.net> <20160203063705.GB459@dastard> <20160203083016.GD459@dastard> <56B21690.2070304@sandeen.net> <20160203215144.GE459@dastard> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.21 (2010-09-15) X-Barracuda-Connect: ipmail07.adl2.internode.on.net[150.101.137.131] X-Barracuda-Start-Time: 1454542151 X-Barracuda-URL: https://192.48.176.15:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-BRTS-Status: 1 X-Barracuda-Spam-Score: 0.00 X-Barracuda-Spam-Status: No, SCORE=0.00 using per-user scores of TAG_LEVEL=1000.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.7 tests=BSF_SC0_MISMATCH_TO X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.3.26718 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 0.00 BSF_SC0_MISMATCH_TO Envelope rcpt doesn't match header On Wed, Feb 03, 2016 at 02:43:27PM -0800, Dilip Simha wrote: > On Wed, Feb 3, 2016 at 1:51 PM, Dave Chinner wrote: > > > On Wed, Feb 03, 2016 at 09:02:40AM -0600, Eric Sandeen wrote: > > > > > > > > > On 2/3/16 2:30 AM, Dave Chinner wrote: > > > > On Tue, Feb 02, 2016 at 11:09:15PM -0800, Dilip Simha wrote: > > > >> Hi Dave, > > > >> > > > >> On Tue, Feb 2, 2016 at 10:37 PM, Dave Chinner > > wrote: > > > >> > > > >>> On Tue, Feb 02, 2016 at 07:40:34PM -0800, Dilip Simha wrote: > > > >>>> Hi Eric, > > > >>>> > > > >>>> Thank you for your quick reply. > > > >>>> > > > >>>> Using xfs_io as per your suggestion, I am able to reproduce the > > issue. > > > >>>> However, I need to falloc for 256K and write for 257K to see this > > issue. > > > >>>> > > > >>>> # xfs_io -f -c "falloc 0 256k" -c "pwrite 0 257k" > > /srv/node/r1/t1.txt > > > >>>> # stat /srv/node/r1/t4.txt | grep Blocks > > > >>>> Size: 263168 Blocks: 1536 IO Block: 4096 regular file > > > >>> > > > >>> Fallocate sets the XFS_DIFLAG_PREALLOC on the inode. > > > >>> > > > >>> When you writing *past the preallocated area* and do delayed > > > >>> allocation, the speculative preallocation beyond EOF is double the > > > >>> size of the extent at EOF. i.e. 512k, leading to 768k being > > > >>> allocated to the file (1536 blocks, exactly). > > > >>> > > > >> > > > >> Thank you for the details. > > > >> This is exactly where I am a bit perplexed. Since the reclamation > > logic > > > >> skips inodes that have the XFS_DIFLAG_PREALLOC flag set, why did the > > > >> allocation logic allot more blocks on such an inode? > > > > > > > > To store the data you wrote outside the preallocated region, of > > > > course. > > > > > > I think what Dilip meant was, why does it do preallocation, not > > > why does it allocate blocks for the data. That part is obvious > > > of course. ;) > > > > > > IOWS, if XFS_DIFLAG_PREALLOC prevents speculative preallocation > > > from being reclaimed, why is speculative preallocation added to files > > > with that flag set? > > > > > > Seems like a fair question, even if Swift's use of preallocation is > > > ill-advised. > > > > > > I don't have all the speculative preallocation heuristics in my > > > head like you do Dave, but if I have it right, and it's i.e.: > > > > > > 1) preallocate 256k > > > 2) inode gets XFS_DIFLAG_PREALLOC > > > 3) write 257k > > > 4) inode gets speculative preallocation added due to write past EOF > > > 5) inode never gets preallocation trimmed due to XFS_DIFLAG_PREALLOC > > > > > > that seems suboptimal. > > > > So do things the other way around: > > > > 1) write 257k > > 2) preallocate 256k beyond EOF and speculative prealloc region > > 3) inode gets XFS_DIFLAG_PREALLOC > > 4) inode never gets preallocation trimmed due to XFS_DIFLAG_PREALLOC > > > > This is correct behaviour. > > > > I am sorry, but I don't agree to this. How can an user application know > about step2. Step 2 is fallocate(keep size) to a range well beyond EOF. e.g. in preparation for a bunch of sparse writes that are about to take place. So userspace will most definitely know about it. It's now the kernel that now doesn't have a clue what to do about the speculative preallocation it already has because the application is mixing it's IO models. Fundamentally, if you mix writes across persistent preallocation and adjacent holes, you are going to get a mess no matter what filesystem you do this to. If you don't like the way XFS handles it, either fix the application to not do this, or use the mount option to turn off speculative preallocation. Just like we say "don't mix direct IO and buffered IO on the same file", it's a really good idea not to mix preallocated and non-preallocated writes to the same file. > > But if we decide that we don't do speculative prealloc when > > XFS_DIFLAG_PREALLOC is set, then workloads that mis-use fallocate > > (like swift), or use fallocate to fill sparse holes in files are > > going fragment the hell out of their files when they extending > > them. > > > > I don't understand why would this be the case. If XFS doesn't do > speculative preallocation then for the 256 byte write after the end of EOF > will simply result in pushing the EOF ahead. So I see no harm if XFS > doesn't do speculative preallocation when XFS_DIFLAG_PREALLOC is set. I see *potential harm* in changing a long standing default behaviour. > > In reality, if swift is really just writing 1k past the prealloc'd > > range it creates, then that is clearly an application bug. Further, > > if swift is only ever preallocating the first 256k of each file it > > writes, regardless of size, then that is also an application bug. > > Its not a bug. Assume a use-case like appending to a file. Would you say > append is a buggy operation? If the app is using preallocation to reduce append workload file fragmenation, and then doesn't use preallocation once it is used up, the the app is definitely buggy because it's not being consistent in it's IO behaviour. The app should always use fallocate() to control file layout, or it should never use fallocate and leave the filesystem to optimise the layout at it sees best. In my experience, the filesystem will almost always do a better job of optimising allocation for best throughput and minimum seeks than applications using fallocate(). IOWs, the default behaviour of XFS has been around for more than 15 years and is sane for the majority of applications out there. Hence the solution here is to either fix the application that is doing stupid things with fallocate(), or use the allocasize mount option to minimise the impact of the stupid thing the buggy application is doing. Cheers, Dave. -- Dave Chinner david@fromorbit.com From david@fromorbit.com Wed Feb 3 17:40:41 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=ham version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay1.corp.sgi.com [137.38.102.111]) by oss.sgi.com (Postfix) with ESMTP id 019067CA1 for ; Wed, 3 Feb 2016 17:40:41 -0600 (CST) Received: from cuda.sgi.com (cuda2.sgi.com [192.48.176.25]) by relay1.corp.sgi.com (Postfix) with ESMTP id E55E48F8033 for ; Wed, 3 Feb 2016 15:40:37 -0800 (PST) X-ASG-Debug-ID: 1454542834-04cbb04cfb19110001-NocioJ Received: from ipmail07.adl2.internode.on.net (ipmail07.adl2.internode.on.net [150.101.137.131]) by cuda.sgi.com with ESMTP id 2MKgNCbheoMFZLPw for ; Wed, 03 Feb 2016 15:40:35 -0800 (PST) X-Barracuda-Envelope-From: david@fromorbit.com X-Barracuda-Apparent-Source-IP: 150.101.137.131 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: A2C/BwBTj7JW/xATLHlegzpSbYJphXKdSAwBAQEBAQEGi2SJShcKhWYEAgKBQE0BAQEBAQGBC4RCAQEEAQI3HCMQCAMYCSUPBRQRAyETiBoPwG4BAQEHAgEdGIUyhH+CVIEuEQGEWAWSbIQFhUmFHYJegWSEQohUjkBig3goLgGIOoEwAQEB Received: from ppp121-44-19-16.lns20.syd4.internode.on.net (HELO dastard) ([121.44.19.16]) by ipmail07.adl2.internode.on.net with ESMTP; 04 Feb 2016 10:10:34 +1030 Received: from dave by dastard with local (Exim 4.80) (envelope-from ) id 1aR725-0005m6-5f; Thu, 04 Feb 2016 10:40:21 +1100 Date: Thu, 4 Feb 2016 10:40:21 +1100 From: Dave Chinner To: Ross Zwisler Cc: xfs@oss.sgi.com Subject: Re: real-time device warning Message-ID: <20160203234021.GI459@dastard> X-ASG-Orig-Subj: Re: real-time device warning References: <20160203165031.GB29275@linux.intel.com> <20160203215555.GF459@dastard> <20160203231259.GA5137@linux.intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20160203231259.GA5137@linux.intel.com> User-Agent: Mutt/1.5.21 (2010-09-15) X-Barracuda-Connect: ipmail07.adl2.internode.on.net[150.101.137.131] X-Barracuda-Start-Time: 1454542834 X-Barracuda-URL: https://192.48.176.25:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-BRTS-Status: 1 X-Barracuda-Spam-Score: 0.00 X-Barracuda-Spam-Status: No, SCORE=0.00 using per-user scores of TAG_LEVEL=1000.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.7 tests=BSF_SC0_MISMATCH_TO X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.3.26718 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 0.00 BSF_SC0_MISMATCH_TO Envelope rcpt doesn't match header On Wed, Feb 03, 2016 at 04:12:59PM -0700, Ross Zwisler wrote: > On Thu, Feb 04, 2016 at 08:55:55AM +1100, Dave Chinner wrote: > > On Wed, Feb 03, 2016 at 09:50:31AM -0700, Ross Zwisler wrote: > > > I've been doing some more real-time device testing with XFS, and I was able to > > > get past the BUG I reported here: > > > > > > http://www.spinics.net/lists/xfs/msg37445.html > > > > > > by setting CONFIG_XFS_DEBUG=n as Dave suggested. > > > > > > After that I/O seems to work, although it doesn't look like the DAX mount > > > option is applied to I/Os that go to the real-time device. > > > > > > After the first I/O, though, the following warning is hit: > > > > > > [ 413.086897] XFS (ram1): _xfs_buf_ioapply: no ops on block 0xa0/0x8 > > > > This series: > > > > http://oss.sgi.com/archives/xfs/2016-02/msg00017.html > > Ah, I wasn't aware of that work. Can you please CC me next time so I can give > you a Tested-by? Sure, easy to forget cc's when posting a patchbomb(*), especially when I've got my own test cases that trigger the problem... Cheers, Dave. (*) I do not allow git-send-email to add cc's from commit message details because that's a silent information leak just waiting to happen. -- Dave Chinner david@fromorbit.com From nmdilipsimha@gmail.com Thu Feb 4 00:17:02 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=FREEMAIL_FROM,HTML_MESSAGE, T_DKIM_INVALID autolearn=ham version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay3.corp.sgi.com [198.149.34.15]) by oss.sgi.com (Postfix) with ESMTP id 256D87CA1 for ; Thu, 4 Feb 2016 00:17:02 -0600 (CST) Received: from cuda.sgi.com (cuda3.sgi.com [192.48.176.15]) by relay3.corp.sgi.com (Postfix) with ESMTP id 7D11DAC003 for ; Wed, 3 Feb 2016 22:16:58 -0800 (PST) X-ASG-Debug-ID: 1454566615-04cb6c27440f3b0001-NocioJ Received: from mail-ob0-f180.google.com (mail-ob0-f180.google.com [209.85.214.180]) by cuda.sgi.com with ESMTP id 8owo4qr9BUvCReeM (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128 verify=NO) for ; Wed, 03 Feb 2016 22:16:55 -0800 (PST) X-Barracuda-Envelope-From: nmdilipsimha@gmail.com X-Barracuda-Apparent-Source-IP: 209.85.214.180 Received: by mail-ob0-f180.google.com with SMTP id ba1so56637017obb.3 for ; Wed, 03 Feb 2016 22:16:55 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc:content-type; bh=ZA1R6Oed0sdgXQqIy6K5TZxc4Z45iqDzzoYo4rdx9yY=; b=x3eP3S4GyhcCSS+mLWgCXba9Er0q/Cugltmpyhflpbhctx0md5e+8cbh572mRX6N6z UPaYxvrDbDVVgz++/M6vEO30cILH8tarwd8N2z9v8QOcg2CBNULhrAj9/J6bkJfQCfE6 Fd01xijfc9RQptKy3MHVDw0SP+EcWtasFjFqJZfuH1QChhUJJkPCXpeCylOfqZuii2Rm A4pkh+aOBSyZX3vVkasKfP5UTQKgSoUwOGUvIGAuG8eS+lDAhO/2ZoYb4GbOWxTPnGPx z9LZKucFUKLtkETFF1FtsCNPOfoGXqj/3bQgC31X1Ey63N975/WxwA/XgwluDDFGjsiV sHuQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc:content-type; bh=ZA1R6Oed0sdgXQqIy6K5TZxc4Z45iqDzzoYo4rdx9yY=; b=YlBhXBIPi5+HQP8he4oHcPqTDH9JS0wy8y5AiIQTixX/eIHFAIAyDgKATeaWjt0pxQ lzWHemmjJSXOTPal/Vsk7EqPn2J1HMNG1jwBtaQpI5BqWH7HuOqYo6eHXXO9yvB4bcPr NRXApU1SmxV8gqEBZegb2N8AJ61NtO+6EXFUs1DLXSvQEgJfO/40Hm0wPEjIsx7TTUzX uMHULMb2YAslKxI33EvynLYUAKggcnJzWP8KggsUewUXeitlLnoJPxoJUZS9Lf6lpTUV Wkp50M0ihNM6+Lw/QIANOfvcM7miTp8OcMDlwbHa7ySziCOCo50DaAjhuIj30yUQdukD 1IHg== X-Gm-Message-State: AG10YORdgjw8nBv3BQm9UpipPkoupNOroUU9OBc3VtHSdll2fE6vZO8bQhmQA9sh16vqF+Z8R9ET2tX/6CQ1yg== X-Received: by 10.60.124.165 with SMTP id mj5mr6082903oeb.39.1454566615192; Wed, 03 Feb 2016 22:16:55 -0800 (PST) MIME-Version: 1.0 Received: by 10.202.86.204 with HTTP; Wed, 3 Feb 2016 22:16:35 -0800 (PST) In-Reply-To: <20160203232834.GH459@dastard> References: <56B16A3C.1030207@sandeen.net> <20160203063705.GB459@dastard> <20160203083016.GD459@dastard> <56B21690.2070304@sandeen.net> <20160203215144.GE459@dastard> <20160203232834.GH459@dastard> From: Dilip Simha Date: Wed, 3 Feb 2016 22:16:35 -0800 Message-ID: Subject: Re: Request for information on bloated writes using Swift To: Dave Chinner X-ASG-Orig-Subj: Re: Request for information on bloated writes using Swift Cc: Eric Sandeen , xfs@oss.sgi.com Content-Type: multipart/alternative; boundary=047d7b33c8a2669b76052aebaed9 X-Barracuda-Connect: mail-ob0-f180.google.com[209.85.214.180] X-Barracuda-Start-Time: 1454566615 X-Barracuda-Encrypted: ECDHE-RSA-AES128-GCM-SHA256 X-Barracuda-URL: https://192.48.176.15:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-BRTS-Status: 1 X-Barracuda-Spam-Score: 0.00 X-Barracuda-Spam-Status: No, SCORE=0.00 using per-user scores of TAG_LEVEL=1000.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.7 tests=BSF_SC0_MISMATCH_TO, DKIM_SIGNED, DKIM_VERIFIED, HTML_MESSAGE X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.3.26728 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 0.00 BSF_SC0_MISMATCH_TO Envelope rcpt doesn't match header -0.00 DKIM_VERIFIED Domain Keys Identified Mail: signature passes verification 0.00 DKIM_SIGNED Domain Keys Identified Mail: message has a signature 0.00 HTML_MESSAGE BODY: HTML included in message --047d7b33c8a2669b76052aebaed9 Content-Type: text/plain; charset=UTF-8 Hi Dave, Thanks much for the suggestions. Your suggestion of not mixing preallocated and non-preallocated writes on the same file makes sense to me. Regards, Dilip On Wed, Feb 3, 2016 at 3:28 PM, Dave Chinner wrote: > On Wed, Feb 03, 2016 at 02:43:27PM -0800, Dilip Simha wrote: > > On Wed, Feb 3, 2016 at 1:51 PM, Dave Chinner > wrote: > > > > > On Wed, Feb 03, 2016 at 09:02:40AM -0600, Eric Sandeen wrote: > > > > > > > > > > > > On 2/3/16 2:30 AM, Dave Chinner wrote: > > > > > On Tue, Feb 02, 2016 at 11:09:15PM -0800, Dilip Simha wrote: > > > > >> Hi Dave, > > > > >> > > > > >> On Tue, Feb 2, 2016 at 10:37 PM, Dave Chinner < > david@fromorbit.com> > > > wrote: > > > > >> > > > > >>> On Tue, Feb 02, 2016 at 07:40:34PM -0800, Dilip Simha wrote: > > > > >>>> Hi Eric, > > > > >>>> > > > > >>>> Thank you for your quick reply. > > > > >>>> > > > > >>>> Using xfs_io as per your suggestion, I am able to reproduce the > > > issue. > > > > >>>> However, I need to falloc for 256K and write for 257K to see > this > > > issue. > > > > >>>> > > > > >>>> # xfs_io -f -c "falloc 0 256k" -c "pwrite 0 257k" > > > /srv/node/r1/t1.txt > > > > >>>> # stat /srv/node/r1/t4.txt | grep Blocks > > > > >>>> Size: 263168 Blocks: 1536 IO Block: 4096 regular > file > > > > >>> > > > > >>> Fallocate sets the XFS_DIFLAG_PREALLOC on the inode. > > > > >>> > > > > >>> When you writing *past the preallocated area* and do delayed > > > > >>> allocation, the speculative preallocation beyond EOF is double > the > > > > >>> size of the extent at EOF. i.e. 512k, leading to 768k being > > > > >>> allocated to the file (1536 blocks, exactly). > > > > >>> > > > > >> > > > > >> Thank you for the details. > > > > >> This is exactly where I am a bit perplexed. Since the reclamation > > > logic > > > > >> skips inodes that have the XFS_DIFLAG_PREALLOC flag set, why did > the > > > > >> allocation logic allot more blocks on such an inode? > > > > > > > > > > To store the data you wrote outside the preallocated region, of > > > > > course. > > > > > > > > I think what Dilip meant was, why does it do preallocation, not > > > > why does it allocate blocks for the data. That part is obvious > > > > of course. ;) > > > > > > > > IOWS, if XFS_DIFLAG_PREALLOC prevents speculative preallocation > > > > from being reclaimed, why is speculative preallocation added to files > > > > with that flag set? > > > > > > > > Seems like a fair question, even if Swift's use of preallocation is > > > > ill-advised. > > > > > > > > I don't have all the speculative preallocation heuristics in my > > > > head like you do Dave, but if I have it right, and it's i.e.: > > > > > > > > 1) preallocate 256k > > > > 2) inode gets XFS_DIFLAG_PREALLOC > > > > 3) write 257k > > > > 4) inode gets speculative preallocation added due to write past EOF > > > > 5) inode never gets preallocation trimmed due to XFS_DIFLAG_PREALLOC > > > > > > > > that seems suboptimal. > > > > > > So do things the other way around: > > > > > > 1) write 257k > > > 2) preallocate 256k beyond EOF and speculative prealloc region > > > 3) inode gets XFS_DIFLAG_PREALLOC > > > 4) inode never gets preallocation trimmed due to XFS_DIFLAG_PREALLOC > > > > > > This is correct behaviour. > > > > > > > I am sorry, but I don't agree to this. How can an user application know > > about step2. > > Step 2 is fallocate(keep size) to a range well beyond EOF. e.g. in > preparation for a bunch of sparse writes that are about to take > place. So userspace will most definitely know about it. It's now the > kernel that now doesn't have a clue what to do about the speculative > preallocation it already has because the application is mixing it's > IO models. > > Fundamentally, if you mix writes across persistent preallocation and > adjacent holes, you are going to get a mess no matter what > filesystem you do this to. If you don't like the way XFS handles it, > either fix the application to not do this, or use the mount option > to turn off speculative preallocation. > > Just like we say "don't mix direct IO and buffered IO on the same > file", it's a really good idea not to mix preallocated and > non-preallocated writes to the same file. > > > > But if we decide that we don't do speculative prealloc when > > > XFS_DIFLAG_PREALLOC is set, then workloads that mis-use fallocate > > > (like swift), or use fallocate to fill sparse holes in files are > > > going fragment the hell out of their files when they extending > > > them. > > > > > > > I don't understand why would this be the case. If XFS doesn't do > > speculative preallocation then for the 256 byte write after the end of > EOF > > will simply result in pushing the EOF ahead. So I see no harm if XFS > > doesn't do speculative preallocation when XFS_DIFLAG_PREALLOC is set. > > I see *potential harm* in changing a long standing default > behaviour. > > > > In reality, if swift is really just writing 1k past the prealloc'd > > > range it creates, then that is clearly an application bug. Further, > > > if swift is only ever preallocating the first 256k of each file it > > > writes, regardless of size, then that is also an application bug. > > > > Its not a bug. Assume a use-case like appending to a file. Would you say > > append is a buggy operation? > > If the app is using preallocation to reduce append workload file > fragmenation, and then doesn't use preallocation once it is used up, > the the app is definitely buggy because it's not being consistent in > it's IO behaviour. The app should always use fallocate() to control > file layout, or it should never use fallocate and leave the > filesystem to optimise the layout at it sees best. > > In my experience, the filesystem will almost always do a better job > of optimising allocation for best throughput and minimum seeks than > applications using fallocate(). > > IOWs, the default behaviour of XFS has been around for more than 15 > years and is sane for the majority of applications out there. Hence > the solution here is to either fix the application that is doing > stupid things with fallocate(), or use the allocasize mount option > to minimise the impact of the stupid thing the buggy application is > doing. > > Cheers, > > Dave. > -- > Dave Chinner > david@fromorbit.com > --047d7b33c8a2669b76052aebaed9 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
Hi Dave,

Thanks much for the suggestion= s. Your suggestion of not mixing preallocated and non-preallocated writes o= n the same file makes sense to me.

Regards,
<= div>Dilip

On Wed, Feb 3, 2016 at 3:28 PM, Dave Chinner <david@fromorbit.com> wrote:
On Wed, Feb 03, 2016 at 02:43:27PM -0800, Dilip Simha wr= ote:
> On Wed, Feb 3, 2016 at 1:51 PM, Dave Chinner <
david@fromorbit.com> wrote:
>
> > On Wed, Feb 03, 2016 at 09:02:40AM -0600, Eric Sandeen wrote:
> > >
> > >
> > > On 2/3/16 2:30 AM, Dave Chinner wrote:
> > > > On Tue, Feb 02, 2016 at 11:09:15PM -0800, Dilip Simha w= rote:
> > > >> Hi Dave,
> > > >>
> > > >> On Tue, Feb 2, 2016 at 10:37 PM, Dave Chinner <<= a href=3D"mailto:david@fromorbit.com">david@fromorbit.com>
> > wrote:
> > > >>
> > > >>> On Tue, Feb 02, 2016 at 07:40:34PM -0800, Dilip= Simha wrote:
> > > >>>> Hi Eric,
> > > >>>>
> > > >>>> Thank you for your quick reply.
> > > >>>>
> > > >>>> Using xfs_io as per your suggestion, I am a= ble to reproduce the
> > issue.
> > > >>>> However, I need to falloc for 256K and writ= e for 257K to see this
> > issue.
> > > >>>>
> > > >>>> # xfs_io -f -c "falloc 0 256k" -c= "pwrite 0 257k"
> > /srv/node/r1/t1.txt
> > > >>>> # stat /srv/node/r1/t4.txt | grep Blocks > > > >>>>=C2=A0 =C2=A0Size: 263168=C2=A0 =C2=A0 =C2= =A0Blocks: 1536=C2=A0 =C2=A0 =C2=A0 =C2=A0IO Block: 4096=C2=A0 =C2=A0regula= r file
> > > >>>
> > > >>> Fallocate sets the XFS_DIFLAG_PREALLOC on the i= node.
> > > >>>
> > > >>> When you writing *past the preallocated area* a= nd do delayed
> > > >>> allocation, the speculative preallocation beyon= d EOF is double the
> > > >>> size of the extent at EOF. i.e. 512k, leading t= o 768k being
> > > >>> allocated to the file (1536 blocks, exactly). > > > >>>
> > > >>
> > > >> Thank you for the details.
> > > >> This is exactly where I am a bit perplexed. Since t= he reclamation
> > logic
> > > >> skips inodes that have the XFS_DIFLAG_PREALLOC flag= set, why did the
> > > >> allocation logic allot more blocks on such an inode= ?
> > > >
> > > > To store the data you wrote outside the preallocated re= gion, of
> > > > course.
> > >
> > > I think what Dilip meant was, why does it do preallocation, = not
> > > why does it allocate blocks for the data.=C2=A0 That part is= obvious
> > > of course.=C2=A0 ;)
> > >
> > > IOWS, if XFS_DIFLAG_PREALLOC prevents speculative preallocat= ion
> > > from being reclaimed, why is speculative preallocation added= to files
> > > with that flag set?
> > >
> > > Seems like a fair question, even if Swift's use of preal= location is
> > > ill-advised.
> > >
> > > I don't have all the speculative preallocation heuristic= s in my
> > > head like you do Dave, but if I have it right, and it's = i.e.:
> > >
> > > 1) preallocate 256k
> > > 2) inode gets XFS_DIFLAG_PREALLOC
> > > 3) write 257k
> > > 4) inode gets speculative preallocation added due to write p= ast EOF
> > > 5) inode never gets preallocation trimmed due to XFS_DIFLAG_= PREALLOC
> > >
> > > that seems suboptimal.
> >
> > So do things the other way around:
> >
> > 1) write 257k
> > 2) preallocate 256k beyond EOF and speculative prealloc region > > 3) inode gets XFS_DIFLAG_PREALLOC
> > 4) inode never gets preallocation trimmed due to XFS_DIFLAG_PREAL= LOC
> >
> > This is correct behaviour.
> >
>
> I am sorry, but I don't agree to this. How can an user application= know
> about step2.

Step 2 is fallocate(keep size) to a range well beyond EOF. e.g.= in
preparation for a bunch of sparse writes that are about to take
place. So userspace will most definitely know about it. It's now the kernel that now doesn't have a clue what to do about the speculative preallocation it already has because the application is mixing it's
IO models.

Fundamentally, if you mix writes across persistent preallocation and
adjacent holes, you are going to get a mess no matter what
filesystem you do this to. If you don't like the way XFS handles it, either fix the application to not do this, or use the mount option
to turn off speculative preallocation.

Just like we say "don't mix direct IO and buffered IO on the same<= br> file", it's a really good idea not to mix preallocated and
non-preallocated writes to the same file.

> > But if we decide that we don't do speculative prealloc when > > XFS_DIFLAG_PREALLOC is set, then workloads that mis-use fallocate=
> > (like swift), or use fallocate to fill sparse holes in files are<= br> > > going fragment the hell out of their files when they extending > > them.
> >
>
> I don't understand why would this be the case. If XFS doesn't = do
> speculative preallocation then for the 256 byte write after the end of= EOF
> will simply result in pushing the EOF ahead. So I see no harm if XFS > doesn't do speculative preallocation when XFS_DIFLAG_PREALLOC is s= et.

I see *potential harm* in changing a long standing default
behaviour.

> > In reality, if swift is really just writing 1k past the prealloc&= #39;d
> > range it creates, then that is clearly an application bug. Furthe= r,
> > if swift is only ever preallocating the first 256k of each file i= t
> > writes, regardless of size, then that is also an application bug.=
>
> Its not a bug. Assume a use-case like appending to a file. Would you s= ay
> append is a buggy operation?

If the app is using preallocation to reduce append workload file
fragmenation, and then doesn't use preallocation once it is used up, the the app is definitely buggy because it's not being consistent in it's IO behaviour.=C2=A0 The app should always use fallocate() to contr= ol
file layout, or it should never use fallocate and leave the
filesystem to optimise the layout at it sees best.

In my experience, the filesystem will almost always do a better job
of optimising allocation for best throughput and minimum seeks than
applications using fallocate().

IOWs, the default behaviour of XFS has been around for more than 15
years and is sane for the majority of applications out there. Hence
the solution here is to either fix the application that is doing
stupid things with fallocate(), or use the allocasize mount option
to minimise the impact of the stupid thing the buggy application is
doing.

Cheers,

Dave.
--
Dave Chinner
david@fromorbit.com

--047d7b33c8a2669b76052aebaed9-- From hch@lst.de Thu Feb 4 01:15:03 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=ham version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay3.corp.sgi.com [198.149.34.15]) by oss.sgi.com (Postfix) with ESMTP id 31A0A7CA2 for ; Thu, 4 Feb 2016 01:15:03 -0600 (CST) Received: from cuda.sgi.com (cuda2.sgi.com [192.48.176.25]) by relay3.corp.sgi.com (Postfix) with ESMTP id B4CAEAC001 for ; Wed, 3 Feb 2016 23:14:59 -0800 (PST) X-ASG-Debug-ID: 1454570096-04cbb04cf928140001-NocioJ Received: from newverein.lst.de (verein.lst.de [213.95.11.211]) by cuda.sgi.com with ESMTP id E9DMSJaOKK8xHzD3 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO) for ; Wed, 03 Feb 2016 23:14:57 -0800 (PST) X-Barracuda-Envelope-From: hch@lst.de X-Barracuda-Apparent-Source-IP: 213.95.11.211 Received: by newverein.lst.de (Postfix, from userid 2407) id 6833D692C7; Thu, 4 Feb 2016 08:14:55 +0100 (CET) Date: Thu, 4 Feb 2016 08:14:55 +0100 From: Christoph Hellwig To: "Darrick J. Wong" Cc: Christoph Hellwig , linux-fsdevel@vger.kernel.org, xfs@oss.sgi.com, linux-ext4@vger.kernel.org, ocfs2-devel@oss.oracle.com Subject: Re: [PATCH 1/3] direct-io: always call ->end_io if non-NULL Message-ID: <20160204071455.GA20002@lst.de> X-ASG-Orig-Subj: Re: [PATCH 1/3] direct-io: always call ->end_io if non-NULL References: <1454524816-11392-1-git-send-email-hch@lst.de> <1454524816-11392-2-git-send-email-hch@lst.de> <20160203195531.GJ20038@birch.djwong.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20160203195531.GJ20038@birch.djwong.org> User-Agent: Mutt/1.5.17 (2007-11-01) X-Barracuda-Connect: verein.lst.de[213.95.11.211] X-Barracuda-Start-Time: 1454570096 X-Barracuda-Encrypted: ECDHE-RSA-AES256-GCM-SHA384 X-Barracuda-URL: https://192.48.176.25:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-BRTS-Status: 1 X-Barracuda-Spam-Score: 0.00 X-Barracuda-Spam-Status: No, SCORE=0.00 using per-user scores of TAG_LEVEL=1000.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.7 tests=BSF_SC0_MISMATCH_TO X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.3.26729 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 0.00 BSF_SC0_MISMATCH_TO Envelope rcpt doesn't match header On Wed, Feb 03, 2016 at 11:55:31AM -0800, Darrick J. Wong wrote: > This will have the effect of a later error superseding an earlier error. I'm > under the impression that code should generally preserve the first error, since > some side effect of that probably caused the rest of the errors. > > That said, my guess is that 95% of the time err is set, retval and err will > both be -EIO anyway. I'm not particularly passionate about whether or not we > preserve the first error code. This leaves the option to the file system to pass the value through or not. Note that ret before the call will usually have the positive number of bytes written, so checking if it's 'set' wouldn't be enough even if adding some special casing in the callers. > > +static int ext4_end_io_dio(struct kiocb *iocb, loff_t offset, > > ssize_t size, void *private) > > { > > ext4_io_end_t *io_end = iocb->private; > > > > + if (size <= 0) > > + return 0; > > This leaks the ext4_io_end_t, if there was one. Granted, that only happens > during an AIO DIO to an unwritten extent, but in any case I suggest removing > this hunk and... It's the same behavior as before - and if you look at ext4_ext_direct_IO it seems to expect this and works around it. > > + if (bytes <= 0) > > + return 0; > > + > > I suspect we still need to unlock the mutexes later on in this function. > > > /* this io's submitter should not have unlocked this before we could */ > > BUG_ON(!ocfs2_iocb_is_rw_locked(iocb)); > > > > @@ -644,6 +647,8 @@ static void ocfs2_dio_end_io(struct kiocb *iocb, > > level = ocfs2_iocb_rw_locked_level(iocb); > > ocfs2_rw_unlock(inode, level); > > } > > Do we need to still have an accurate value for bytes the conditional above > even if the IO errored out? Again, no changes to the old behavior. ocfs has some magic stuffed in iocb->private to deal with the locked state of an iocb, and while I don't fully understand it I suspect it's to handle the existing odd ->end_io calling conventions. Cleaning this up would be nice, but let's keep that a separate patch. > > struct kiocb *iocb, > > loff_t offset, > > @@ -1655,15 +1655,19 @@ xfs_end_io_direct_write( > > struct inode *inode = file_inode(iocb->ki_filp); > > struct xfs_ioend *ioend = private; > > > > + if (size <= 0) > > + return 0; > > Same thing here, I think we can end up leaking the ioend. This keeps the existing behavior. But either way, at least for XFS all this will be properly fixed in the next patch anyway. From hch@lst.de Thu Feb 4 01:46:24 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=ham version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay1.corp.sgi.com [137.38.102.111]) by oss.sgi.com (Postfix) with ESMTP id 31AA47CA2 for ; Thu, 4 Feb 2016 01:46:24 -0600 (CST) Received: from cuda.sgi.com (cuda2.sgi.com [192.48.176.25]) by relay1.corp.sgi.com (Postfix) with ESMTP id 1615C8F8033 for ; Wed, 3 Feb 2016 23:46:21 -0800 (PST) X-ASG-Debug-ID: 1454571978-04cbb04cfb28d80001-NocioJ Received: from newverein.lst.de (verein.lst.de [213.95.11.211]) by cuda.sgi.com with ESMTP id ynL8neNKLYdj9iGV (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO) for ; Wed, 03 Feb 2016 23:46:18 -0800 (PST) X-Barracuda-Envelope-From: hch@lst.de X-Barracuda-Apparent-Source-IP: 213.95.11.211 Received: by newverein.lst.de (Postfix, from userid 2407) id A11A6692C7; Thu, 4 Feb 2016 08:46:17 +0100 (CET) Date: Thu, 4 Feb 2016 08:46:17 +0100 From: Christoph Hellwig To: "Darrick J. Wong" Cc: xfs@oss.sgi.com Subject: reflink log reservations Message-ID: <20160204074617.GB20496@lst.de> X-ASG-Orig-Subj: reflink log reservations MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.5.17 (2007-11-01) X-Barracuda-Connect: verein.lst.de[213.95.11.211] X-Barracuda-Start-Time: 1454571978 X-Barracuda-Encrypted: ECDHE-RSA-AES256-GCM-SHA384 X-Barracuda-URL: https://192.48.176.25:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-BRTS-Status: 1 X-Barracuda-Spam-Score: 0.00 X-Barracuda-Spam-Status: No, SCORE=0.00 using per-user scores of TAG_LEVEL=1000.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.7 tests=BSF_SC0_MISMATCH_TO X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.3.26730 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 0.00 BSF_SC0_MISMATCH_TO Envelope rcpt doesn't match header Hi Darrick, I'm running into the following log reservation assert after a few xfstests runs over NFS. I'll try to understand the reservation calculations, but in case this is still fresh in your head here's a headsup: generic/167 11s ... [ 640.924891] XFS: Assertion failed: tp->t_blk_res_used <= tp->t_blk_res, file: fs/xfs/xfs_trans.c, line: 315 [ 640.925750] ------------[ cut here ]------------ [ 640.926164] kernel BUG at fs/xfs/xfs_message.c:113! [ 640.926583] invalid opcode: 0000 [#1] SMP [ 640.926995] Modules linked in: [ 640.927385] CPU: 3 PID: 3719 Comm: nfsd Not tainted 4.5.0-rc2+ #424 [ 640.928036] Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS 1.7.5-20140531_083030-gandalf 04/01/2014 [ 640.928098] task: ffff88007b614380 ti: ffff880077cd4000 task.ti: ffff880077cd4000 [ 640.928098] RIP: 0010:[] [] assfail+0x1d/0x20 [ 640.928098] RSP: 0018:ffff880077cd72e0 EFLAGS: 00010282 [ 640.928098] RAX: 00000000ffffffea RBX: ffff88007afc9130 RCX: 0000000000000021 [ 640.928098] RDX: ffff880077cd7208 RSI: 000000000000000a RDI: ffffffff81fdc510 [ 640.928098] RBP: ffff880077cd72e0 R08: 0000000000000000 R09: 0000000000000000 [ 640.928098] R10: 000000000000000a R11: f000000000000000 R12: ffffffffffffffff [ 640.928098] R13: ffff88007b2cd000 R14: 00000000000a0000 R15: 0000000000000001 [ 640.928098] FS: 0000000000000000(0000) GS:ffff88007fd80000(0000) knlGS:0000000000000000 [ 640.928098] CS: 0010 DS: 0000 ES: 0000 CR0: 000000008005003b [ 640.928098] CR2: 00000000013e10f8 CR3: 0000000075b18000 CR4: 00000000000006e0 [ 640.928098] DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000 [ 640.928098] DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400 [ 640.928098] Stack: [ 640.928098] ffff880077cd7308 ffffffff814d7d00 ffff880077cd7390 0000000000000001 [ 640.928098] ffff880077cd7390 ffff880077cd7328 ffffffff8146059d ffff88007b2cd000 [ 640.928098] 0000000000000020 ffff880077cd7378 ffffffff814617cd ffff880077cd7378 [ 640.928098] Call Trace: [ 640.928098] [] xfs_trans_mod_sb+0x250/0x290 [ 640.928098] [] xfs_alloc_ag_vextent+0x28d/0x330 [ 640.928098] [] xfs_alloc_vextent+0x70d/0x800 [ 640.928098] [] xfs_refcountbt_alloc_block+0xd1/0x1a0 [ 640.928098] [] __xfs_btree_split+0xb6/0xbd0 [ 640.928098] [] ? xfs_trans_read_buf_map+0x1e6/0x370 [ 640.928098] [] xfs_btree_split+0x34/0xc0 [ 640.928098] [] xfs_btree_make_block_unfull+0xef/0x170 [ 640.928098] [] xfs_btree_insrec+0x9f9/0xc50 [ 640.928098] [] ? xfs_btree_read_buf_block+0xa4/0xd0 [ 640.928098] [] ? xfs_trans_log_buf+0x15f/0x1b0 [ 640.928098] [] xfs_btree_insert+0x69/0x1d0 [ 640.928098] [] xfs_refcountbt_insert+0x4e/0x90 [ 640.928098] [] try_split_right_rcextent+0x17f/0x200 [ 640.928098] [] xfs_refcountbt_adjust_refcount+0x4c/0x100 [ 640.928098] [] xfs_refcount_decrease+0x5c/0xa0 [ 640.928098] [] xfs_refcount_put_extent+0x83/0xb0 [ 640.928098] [] xfs_bmap_del_extent+0x57f/0x1160 [ 640.928098] [] ? kmem_zone_alloc+0x7b/0x120 [ 640.928098] [] ? kmem_zone_alloc+0x7b/0x120 [ 640.928098] [] ? xfs_bmbt_init_cursor+0x5f/0x190 [ 640.928098] [] xfs_bunmapi+0x845/0x10d0 [ 640.928098] [] xfs_itruncate_extents+0x218/0x3e0 [ 640.928098] [] xfs_inactive_truncate+0xbd/0x130 [ 640.928098] [] xfs_inactive+0x1ab/0x1e0 [ 640.928098] [] xfs_fs_evict_inode+0x109/0x160 [ 640.928098] [] evict+0xbb/0x180 [ 640.928098] [] iput+0x174/0x1e0 [ 640.928098] [] d_delete+0x11e/0x160 [ 640.928098] [] vfs_unlink+0x133/0x160 [ 640.928098] [] ? lookup_one_len+0xca/0x120 [ 640.928098] [] nfsd_unlink+0x127/0x210 [ 640.928098] [] nfsd4_remove+0x49/0x130 [ 640.928098] [] nfsd4_proc_compound+0x31a/0x570 [ 640.928098] [] nfsd_dispatch+0x89/0x170 [ 640.928098] [] svc_process_common+0x39a/0x520 [ 640.928098] [] svc_process+0x150/0x1a0 [ 640.928098] [] nfsd+0xea/0x150 [ 640.928098] [] ? nfsd_destroy+0x60/0x60 [ 640.928098] [] kthread+0xd6/0xf0 [ 640.928098] [] ? kthread_create_on_node+0x170/0x170 [ 640.928098] [] ret_from_fork+0x3f/0x70 [ 640.928098] [] ? kthread_create_on_node+0x170/0x170 From darrick.wong@oracle.com Thu Feb 4 02:16:31 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay3.corp.sgi.com [198.149.34.15]) by oss.sgi.com (Postfix) with ESMTP id 6C50B7CA2 for ; Thu, 4 Feb 2016 02:16:31 -0600 (CST) Received: from cuda.sgi.com (cuda3.sgi.com [192.48.176.15]) by relay3.corp.sgi.com (Postfix) with ESMTP id F2DA7AC001 for ; Thu, 4 Feb 2016 00:16:27 -0800 (PST) X-ASG-Debug-ID: 1454573785-04cb6c274511c90001-NocioJ Received: from userp1040.oracle.com (userp1040.oracle.com [156.151.31.81]) by cuda.sgi.com with ESMTP id mEzdHw6ZFdDGnIWt (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO) for ; Thu, 04 Feb 2016 00:16:25 -0800 (PST) X-Barracuda-Envelope-From: darrick.wong@oracle.com X-Barracuda-Apparent-Source-IP: 156.151.31.81 Received: from userv0021.oracle.com (userv0021.oracle.com [156.151.31.71]) by userp1040.oracle.com (Sentrion-MTA-4.3.2/Sentrion-MTA-4.3.2) with ESMTP id u148GM42007565 (version=TLSv1 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Thu, 4 Feb 2016 08:16:22 GMT Received: from aserv0121.oracle.com (aserv0121.oracle.com [141.146.126.235]) by userv0021.oracle.com (8.13.8/8.13.8) with ESMTP id u148GLSo023046 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=FAIL); Thu, 4 Feb 2016 08:16:22 GMT Received: from abhmp0011.oracle.com (abhmp0011.oracle.com [141.146.116.17]) by aserv0121.oracle.com (8.13.8/8.13.8) with ESMTP id u148GLJk015369; Thu, 4 Feb 2016 08:16:21 GMT Received: from localhost (/24.21.154.84) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Thu, 04 Feb 2016 00:16:21 -0800 Date: Thu, 4 Feb 2016 00:16:20 -0800 From: "Darrick J. Wong" To: Christoph Hellwig Cc: xfs@oss.sgi.com Subject: Re: reflink log reservations Message-ID: <20160204081620.GL20038@birch.djwong.org> X-ASG-Orig-Subj: Re: reflink log reservations References: <20160204074617.GB20496@lst.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20160204074617.GB20496@lst.de> User-Agent: Mutt/1.5.21 (2010-09-15) X-Source-IP: userv0021.oracle.com [156.151.31.71] X-Barracuda-Connect: userp1040.oracle.com[156.151.31.81] X-Barracuda-Start-Time: 1454573785 X-Barracuda-Encrypted: ECDHE-RSA-AES256-GCM-SHA384 X-Barracuda-URL: https://192.48.176.15:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-BRTS-Status: 1 X-Barracuda-Spam-Score: 0.00 X-Barracuda-Spam-Status: No, SCORE=0.00 using per-user scores of TAG_LEVEL=1000.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.7 tests=BSF_SC0_MISMATCH_TO, UNPARSEABLE_RELAY X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.3.26730 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 0.00 BSF_SC0_MISMATCH_TO Envelope rcpt doesn't match header 0.00 UNPARSEABLE_RELAY Informational: message has unparseable relay lines On Thu, Feb 04, 2016 at 08:46:17AM +0100, Christoph Hellwig wrote: > Hi Darrick, > > I'm running into the following log reservation assert after a few > xfstests runs over NFS. I'll try to understand the reservation > calculations, but in case this is still fresh in your head here's > a headsup: Hmm, interesting, I haven't seen /that/ one... my guess is that the block reservation needs to be bumped up for the refcount tree. --D > > generic/167 11s ... > [ 640.924891] XFS: Assertion failed: tp->t_blk_res_used <= tp->t_blk_res, file: fs/xfs/xfs_trans.c, line: 315 > [ 640.925750] ------------[ cut here ]------------ > [ 640.926164] kernel BUG at fs/xfs/xfs_message.c:113! > [ 640.926583] invalid opcode: 0000 [#1] SMP > [ 640.926995] Modules linked in: > [ 640.927385] CPU: 3 PID: 3719 Comm: nfsd Not tainted 4.5.0-rc2+ #424 > [ 640.928036] Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS 1.7.5-20140531_083030-gandalf 04/01/2014 > [ 640.928098] task: ffff88007b614380 ti: ffff880077cd4000 task.ti: ffff880077cd4000 > [ 640.928098] RIP: 0010:[] [] assfail+0x1d/0x20 > [ 640.928098] RSP: 0018:ffff880077cd72e0 EFLAGS: 00010282 > [ 640.928098] RAX: 00000000ffffffea RBX: ffff88007afc9130 RCX: 0000000000000021 > [ 640.928098] RDX: ffff880077cd7208 RSI: 000000000000000a RDI: ffffffff81fdc510 > [ 640.928098] RBP: ffff880077cd72e0 R08: 0000000000000000 R09: 0000000000000000 > [ 640.928098] R10: 000000000000000a R11: f000000000000000 R12: ffffffffffffffff > [ 640.928098] R13: ffff88007b2cd000 R14: 00000000000a0000 R15: 0000000000000001 > [ 640.928098] FS: 0000000000000000(0000) GS:ffff88007fd80000(0000) knlGS:0000000000000000 > [ 640.928098] CS: 0010 DS: 0000 ES: 0000 CR0: 000000008005003b > [ 640.928098] CR2: 00000000013e10f8 CR3: 0000000075b18000 CR4: 00000000000006e0 > [ 640.928098] DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000 > [ 640.928098] DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400 > [ 640.928098] Stack: > [ 640.928098] ffff880077cd7308 ffffffff814d7d00 ffff880077cd7390 0000000000000001 > [ 640.928098] ffff880077cd7390 ffff880077cd7328 ffffffff8146059d ffff88007b2cd000 > [ 640.928098] 0000000000000020 ffff880077cd7378 ffffffff814617cd ffff880077cd7378 > [ 640.928098] Call Trace: > [ 640.928098] [] xfs_trans_mod_sb+0x250/0x290 > [ 640.928098] [] xfs_alloc_ag_vextent+0x28d/0x330 > [ 640.928098] [] xfs_alloc_vextent+0x70d/0x800 > [ 640.928098] [] xfs_refcountbt_alloc_block+0xd1/0x1a0 > [ 640.928098] [] __xfs_btree_split+0xb6/0xbd0 > [ 640.928098] [] ? xfs_trans_read_buf_map+0x1e6/0x370 > [ 640.928098] [] xfs_btree_split+0x34/0xc0 > [ 640.928098] [] xfs_btree_make_block_unfull+0xef/0x170 > [ 640.928098] [] xfs_btree_insrec+0x9f9/0xc50 > [ 640.928098] [] ? xfs_btree_read_buf_block+0xa4/0xd0 > [ 640.928098] [] ? xfs_trans_log_buf+0x15f/0x1b0 > [ 640.928098] [] xfs_btree_insert+0x69/0x1d0 > [ 640.928098] [] xfs_refcountbt_insert+0x4e/0x90 > [ 640.928098] [] try_split_right_rcextent+0x17f/0x200 > [ 640.928098] [] xfs_refcountbt_adjust_refcount+0x4c/0x100 > [ 640.928098] [] xfs_refcount_decrease+0x5c/0xa0 > [ 640.928098] [] xfs_refcount_put_extent+0x83/0xb0 > [ 640.928098] [] xfs_bmap_del_extent+0x57f/0x1160 > [ 640.928098] [] ? kmem_zone_alloc+0x7b/0x120 > [ 640.928098] [] ? kmem_zone_alloc+0x7b/0x120 > [ 640.928098] [] ? xfs_bmbt_init_cursor+0x5f/0x190 > [ 640.928098] [] xfs_bunmapi+0x845/0x10d0 > [ 640.928098] [] xfs_itruncate_extents+0x218/0x3e0 > [ 640.928098] [] xfs_inactive_truncate+0xbd/0x130 > [ 640.928098] [] xfs_inactive+0x1ab/0x1e0 > [ 640.928098] [] xfs_fs_evict_inode+0x109/0x160 > [ 640.928098] [] evict+0xbb/0x180 > [ 640.928098] [] iput+0x174/0x1e0 > [ 640.928098] [] d_delete+0x11e/0x160 > [ 640.928098] [] vfs_unlink+0x133/0x160 > [ 640.928098] [] ? lookup_one_len+0xca/0x120 > [ 640.928098] [] nfsd_unlink+0x127/0x210 > [ 640.928098] [] nfsd4_remove+0x49/0x130 > [ 640.928098] [] nfsd4_proc_compound+0x31a/0x570 > [ 640.928098] [] nfsd_dispatch+0x89/0x170 > [ 640.928098] [] svc_process_common+0x39a/0x520 > [ 640.928098] [] svc_process+0x150/0x1a0 > [ 640.928098] [] nfsd+0xea/0x150 > [ 640.928098] [] ? nfsd_destroy+0x60/0x60 > [ 640.928098] [] kthread+0xd6/0xf0 > [ 640.928098] [] ? kthread_create_on_node+0x170/0x170 > [ 640.928098] [] ret_from_fork+0x3f/0x70 > [ 640.928098] [] ? kthread_create_on_node+0x170/0x170 > > > _______________________________________________ > xfs mailing list > xfs@oss.sgi.com > http://oss.sgi.com/mailman/listinfo/xfs From darrick.wong@oracle.com Thu Feb 4 02:18:08 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay1.corp.sgi.com [137.38.102.111]) by oss.sgi.com (Postfix) with ESMTP id E9C017CA2 for ; Thu, 4 Feb 2016 02:18:08 -0600 (CST) Received: from cuda.sgi.com (cuda2.sgi.com [192.48.176.25]) by relay1.corp.sgi.com (Postfix) with ESMTP id CD12F8F8033 for ; Thu, 4 Feb 2016 00:18:05 -0800 (PST) X-ASG-Debug-ID: 1454573882-04cbb04cfb29aa0001-NocioJ Received: from userp1040.oracle.com (userp1040.oracle.com [156.151.31.81]) by cuda.sgi.com with ESMTP id lfCHEobCnAfmtz4V (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO) for ; Thu, 04 Feb 2016 00:18:03 -0800 (PST) X-Barracuda-Envelope-From: darrick.wong@oracle.com X-Barracuda-Apparent-Source-IP: 156.151.31.81 Received: from userv0022.oracle.com (userv0022.oracle.com [156.151.31.74]) by userp1040.oracle.com (Sentrion-MTA-4.3.2/Sentrion-MTA-4.3.2) with ESMTP id u148I0vn009449 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 4 Feb 2016 08:18:00 GMT Received: from userv0122.oracle.com (userv0122.oracle.com [156.151.31.75]) by userv0022.oracle.com (8.14.4/8.13.8) with ESMTP id u148Hxoo032623 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL); Thu, 4 Feb 2016 08:18:00 GMT Received: from abhmp0009.oracle.com (abhmp0009.oracle.com [141.146.116.15]) by userv0122.oracle.com (8.14.4/8.14.4) with ESMTP id u148HxEF010425; Thu, 4 Feb 2016 08:17:59 GMT Received: from localhost (/24.21.154.84) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Thu, 04 Feb 2016 00:17:59 -0800 Date: Thu, 4 Feb 2016 00:17:57 -0800 From: "Darrick J. Wong" To: Christoph Hellwig Cc: linux-fsdevel@vger.kernel.org, xfs@oss.sgi.com, linux-ext4@vger.kernel.org, ocfs2-devel@oss.oracle.com Subject: Re: [PATCH 1/3] direct-io: always call ->end_io if non-NULL Message-ID: <20160204081757.GM22352@birch.djwong.org> X-ASG-Orig-Subj: Re: [PATCH 1/3] direct-io: always call ->end_io if non-NULL References: <1454524816-11392-1-git-send-email-hch@lst.de> <1454524816-11392-2-git-send-email-hch@lst.de> <20160203195531.GJ20038@birch.djwong.org> <20160204071455.GA20002@lst.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20160204071455.GA20002@lst.de> User-Agent: Mutt/1.5.21 (2010-09-15) X-Source-IP: userv0022.oracle.com [156.151.31.74] X-Barracuda-Connect: userp1040.oracle.com[156.151.31.81] X-Barracuda-Start-Time: 1454573883 X-Barracuda-Encrypted: ECDHE-RSA-AES256-GCM-SHA384 X-Barracuda-URL: https://192.48.176.25:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-BRTS-Status: 1 X-Barracuda-Spam-Score: 0.00 X-Barracuda-Spam-Status: No, SCORE=0.00 using per-user scores of TAG_LEVEL=1000.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.7 tests=BSF_SC0_MISMATCH_TO, UNPARSEABLE_RELAY X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.3.26730 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 0.00 BSF_SC0_MISMATCH_TO Envelope rcpt doesn't match header 0.00 UNPARSEABLE_RELAY Informational: message has unparseable relay lines On Thu, Feb 04, 2016 at 08:14:55AM +0100, Christoph Hellwig wrote: > On Wed, Feb 03, 2016 at 11:55:31AM -0800, Darrick J. Wong wrote: > > This will have the effect of a later error superseding an earlier error. I'm > > under the impression that code should generally preserve the first error, since > > some side effect of that probably caused the rest of the errors. > > > > That said, my guess is that 95% of the time err is set, retval and err will > > both be -EIO anyway. I'm not particularly passionate about whether or not we > > preserve the first error code. > > This leaves the option to the file system to pass the value through > or not. Note that ret before the call will usually have the positive > number of bytes written, so checking if it's 'set' wouldn't be enough > even if adding some special casing in the callers. Ok, I can live with that. > > > +static int ext4_end_io_dio(struct kiocb *iocb, loff_t offset, > > > ssize_t size, void *private) > > > { > > > ext4_io_end_t *io_end = iocb->private; > > > > > > + if (size <= 0) > > > + return 0; > > > > This leaks the ext4_io_end_t, if there was one. Granted, that only happens > > during an AIO DIO to an unwritten extent, but in any case I suggest removing > > this hunk and... > > It's the same behavior as before - and if you look at ext4_ext_direct_IO > it seems to expect this and works around it. Gotcha. That's right, so I'll stop worrying about these. :) --D > > > > + if (bytes <= 0) > > > + return 0; > > > + > > > > I suspect we still need to unlock the mutexes later on in this function. > > > > > /* this io's submitter should not have unlocked this before we could */ > > > BUG_ON(!ocfs2_iocb_is_rw_locked(iocb)); > > > > > > @@ -644,6 +647,8 @@ static void ocfs2_dio_end_io(struct kiocb *iocb, > > > level = ocfs2_iocb_rw_locked_level(iocb); > > > ocfs2_rw_unlock(inode, level); > > > } > > > > Do we need to still have an accurate value for bytes the conditional above > > even if the IO errored out? > > Again, no changes to the old behavior. ocfs has some magic stuffed > in iocb->private to deal with the locked state of an iocb, and while > I don't fully understand it I suspect it's to handle the existing > odd ->end_io calling conventions. Cleaning this up would be nice, > but let's keep that a separate patch. > > > > struct kiocb *iocb, > > > loff_t offset, > > > @@ -1655,15 +1655,19 @@ xfs_end_io_direct_write( > > > struct inode *inode = file_inode(iocb->ki_filp); > > > struct xfs_ioend *ioend = private; > > > > > > + if (size <= 0) > > > + return 0; > > > > Same thing here, I think we can end up leaking the ioend. > > This keeps the existing behavior. But either way, at least for > XFS all this will be properly fixed in the next patch anyway. From hch@lst.de Thu Feb 4 07:31:44 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=ham version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay2.corp.sgi.com [137.38.102.29]) by oss.sgi.com (Postfix) with ESMTP id 0ED4D7CA4 for ; Thu, 4 Feb 2016 07:31:44 -0600 (CST) Received: from cuda.sgi.com (cuda3.sgi.com [192.48.176.15]) by relay2.corp.sgi.com (Postfix) with ESMTP id E3B32304032 for ; Thu, 4 Feb 2016 05:31:40 -0800 (PST) X-ASG-Debug-ID: 1454592694-04cb6c27471b6e0001-NocioJ Received: from newverein.lst.de (verein.lst.de [213.95.11.211]) by cuda.sgi.com with ESMTP id PYAextlXV7lieZmC (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO) for ; Thu, 04 Feb 2016 05:31:35 -0800 (PST) X-Barracuda-Envelope-From: hch@lst.de X-Barracuda-Apparent-Source-IP: 213.95.11.211 Received: by newverein.lst.de (Postfix, from userid 2407) id A0934692CE; Thu, 4 Feb 2016 14:31:33 +0100 (CET) Date: Thu, 4 Feb 2016 14:31:33 +0100 From: Christoph Hellwig To: "Darrick J. Wong" Cc: Christoph Hellwig , xfs@oss.sgi.com Subject: Re: reflink log reservations Message-ID: <20160204133133.GA28701@lst.de> X-ASG-Orig-Subj: Re: reflink log reservations References: <20160204074617.GB20496@lst.de> <20160204081620.GL20038@birch.djwong.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20160204081620.GL20038@birch.djwong.org> User-Agent: Mutt/1.5.17 (2007-11-01) X-Barracuda-Connect: verein.lst.de[213.95.11.211] X-Barracuda-Start-Time: 1454592694 X-Barracuda-Encrypted: ECDHE-RSA-AES256-GCM-SHA384 X-Barracuda-URL: https://192.48.176.15:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-BRTS-Status: 1 X-Barracuda-Spam-Score: 0.00 X-Barracuda-Spam-Status: No, SCORE=0.00 using per-user scores of TAG_LEVEL=1000.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.7 tests=BSF_SC0_MISMATCH_TO X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.3.26736 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 0.00 BSF_SC0_MISMATCH_TO Envelope rcpt doesn't match header On Thu, Feb 04, 2016 at 12:16:20AM -0800, Darrick J. Wong wrote: > On Thu, Feb 04, 2016 at 08:46:17AM +0100, Christoph Hellwig wrote: > > Hi Darrick, > > > > I'm running into the following log reservation assert after a few > > xfstests runs over NFS. I'll try to understand the reservation > > calculations, but in case this is still fresh in your head here's > > a headsup: > > Hmm, interesting, I haven't seen /that/ one... my guess is that the > block reservation needs to be bumped up for the refcount tree. This seems to fix it for me: --- >From 6e27eb42ece3a25f610690487b403a0091cafa26 Mon Sep 17 00:00:00 2001 From: Christoph Hellwig Date: Thu, 4 Feb 2016 13:50:16 +0100 Subject: xfs: account for the refcount btree in the alloc/free log reservation Signed-off-by: Christoph Hellwig --- fs/xfs/libxfs/xfs_trans_resv.c | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/fs/xfs/libxfs/xfs_trans_resv.c b/fs/xfs/libxfs/xfs_trans_resv.c index d495f82..f4c2648 100644 --- a/fs/xfs/libxfs/xfs_trans_resv.c +++ b/fs/xfs/libxfs/xfs_trans_resv.c @@ -65,12 +65,15 @@ xfs_calc_buf_res( /* * Per-extent log reservation for the allocation btree changes - * involved in freeing or allocating an extent. When rmap is not enabled, - * there are only two trees that will be modified (free space trees), and when - * rmap is enabled there will be three (freespace + rmap trees). The number of - * blocks reserved is based on the formula: + * involved in freeing or allocating an extent. * - * num trees * ((2 blocks/level * max depth) - 1) + * There are at least two trees that will be modified (free space trees), when + * rmap is enabled there will be an additional rmap tree, and when reflinks + * are enabled there will be a refcount btree as well + * + * The number of blocks reserved is based on the formula: + * + * num trees * ((2 blocks/level * max depth) - 1) */ static uint xfs_allocfree_log_count( @@ -81,6 +84,8 @@ xfs_allocfree_log_count( if (xfs_sb_version_hasrmapbt(&mp->m_sb)) num_trees++; + if (xfs_sb_version_hasreflink(&mp->m_sb)) + num_trees++; return num_ops * num_trees * (2 * mp->m_ag_maxlevels - 1); } -- 2.1.4 From rjevskiy@gmail.com Thu Feb 4 08:02:14 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=FREEMAIL_FROM,T_DKIM_INVALID autolearn=ham version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay3.corp.sgi.com [198.149.34.15]) by oss.sgi.com (Postfix) with ESMTP id E0DB47CA2 for ; Thu, 4 Feb 2016 08:02:13 -0600 (CST) Received: from cuda.sgi.com (cuda3.sgi.com [192.48.176.15]) by relay3.corp.sgi.com (Postfix) with ESMTP id 5F1E3AC004 for ; Thu, 4 Feb 2016 06:02:10 -0800 (PST) X-ASG-Debug-ID: 1454594525-04cb6c27471ccf0001-NocioJ Received: from mail-lb0-f180.google.com (mail-lb0-f180.google.com [209.85.217.180]) by cuda.sgi.com with ESMTP id TYBQ7SZRTPIYcEeR (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128 verify=NO) for ; Thu, 04 Feb 2016 06:02:06 -0800 (PST) X-Barracuda-Envelope-From: rjevskiy@gmail.com X-Barracuda-Apparent-Source-IP: 209.85.217.180 Received: by mail-lb0-f180.google.com with SMTP id bc4so31603748lbc.2 for ; Thu, 04 Feb 2016 06:02:06 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:from:to:cc:mime-version:content-type:subject:in-reply-to :user-agent:date:message-id; bh=f7XrSbNaJXeM+vUWhU8MK/hUc6+xWPnb4TN81jrpD7I=; b=TbaPPQrYaP409Q9p0ezeaesI3XhlbZiD8WgJ30EtEn8MZEOGKmSJQpq90EXTO42EZT RDQvO+xYSkTOM/QjcdcXO3CR3dWUwZaU/mv1XJO0R+sCl4CM+GI37IGq3skehmBapidf +SWMMMmo9S8CLs5Ttu4k4enwkGuog6RRdbO1Nr7OjyhWPt+GgKNSuLVfWlLn1W+Vsx+D B90C4a3alforAhSLexGLChB/fYUtinekqoGTP+bV1Fun70a5Utj/JvPw8smv5yBVF2H9 3ntI69S2GgCks4lgDdn+xXY7cBVuDNOGVrmZGhtGhacATBHrMChsvMmgA9GDeYLA2RFG 6x/g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:sender:from:to:cc:mime-version:content-type :subject:in-reply-to:user-agent:date:message-id; bh=f7XrSbNaJXeM+vUWhU8MK/hUc6+xWPnb4TN81jrpD7I=; b=Zknf3HAXNJIv/IiTTZQaK4Si/bPBkmHJctO/rDSRqQAtrCe/CIbTPzxJN/vucaeS29 dcAG977OCSmCEa9yCQoYtD7X6bO1Ebuk6cNT9EMm36j+JT1qAAdJuzcBh/d3f/ShAHMx pY9D8JC3aZtVrJNgukcyy1ByouVxpJZ8Vt9riAUU4SZPcuUGYAJJQrsOesdIrNqY9jmW zVGFdQGkpafUwkCVEuuWHQCFNjPxUBtG8W2C3I1gwDbPirjh7G2hQ9cg/HLvK7YbHlWx EwYmXVd4Dp0C5DKyGQQHWBHLk2xbTQiYAE4liNjzs2ePFKnt07f0LslGJ4B4lEHMq5s3 Ypmw== X-Gm-Message-State: AG10YOSNoiiUnlfVEPT+XEgVcPWzOAXZeHMiQxtXVwFXkA4L6kCislKRR6cxjR8FS4lRKQ== X-Received: by 10.112.147.1 with SMTP id tg1mr2979000lbb.119.1454594524952; Thu, 04 Feb 2016 06:02:04 -0800 (PST) Received: from smtp.gmail.com ([195.214.234.4]) by smtp.gmail.com with ESMTPSA id l129sm1579172lfl.37.2016.02.04.06.02.03 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 04 Feb 2016 06:02:04 -0800 (PST) Sender: Dmitry Monakhov From: Dmitry Monakhov To: Ross Zwisler Cc: "linux-kernel\@vger.kernel.org" , "H. Peter Anvin" , "J. Bruce Fields" , Theodore Ts'o , Alexander Viro , Andreas Dilger , Dave Chinner , Ingo Molnar , Jan Kara , Jeff Layton , Matthew Wilcox , Thomas Gleixner , linux-ext4 , linux-fsdevel , Linux MM , "linux-nvdimm\@lists.01.org" , X86 ML , XFS Developers , Andrew Morton , Matthew Wilcox , Dave Hansen MIME-Version: 1.0 Content-Type: text/plain Subject: [PATCH] dax: dirty inode only if required In-Reply-To: 1450899560-26708-5-git-send-email-ross.zwisler@linux.intel.com X-ASG-Orig-Subj: [PATCH] dax: dirty inode only if required User-Agent: Notmuch/0.18.1 (http://notmuchmail.org) Emacs/24.4.1 (x86_64-pc-linux-gnu) Date: Thu, 04 Feb 2016 17:02:02 +0300 Message-ID: <87k2mkr2ud.fsf@openvz.org> X-Barracuda-Connect: mail-lb0-f180.google.com[209.85.217.180] X-Barracuda-Start-Time: 1454594526 X-Barracuda-Encrypted: ECDHE-RSA-AES128-GCM-SHA256 X-Barracuda-URL: https://192.48.176.15:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-BRTS-Status: 1 X-Barracuda-Spam-Score: 0.00 X-Barracuda-Spam-Status: No, SCORE=0.00 using per-user scores of TAG_LEVEL=1000.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.7 tests=BSF_SC0_MISMATCH_TO, DKIM_SIGNED, DKIM_VERIFIED X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.3.26736 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 0.00 BSF_SC0_MISMATCH_TO Envelope rcpt doesn't match header -0.00 DKIM_VERIFIED Domain Keys Identified Mail: signature passes verification 0.00 DKIM_SIGNED Domain Keys Identified Mail: message has a signature Signed-off-by: Dmitry Monakhov --- fs/dax.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/fs/dax.c b/fs/dax.c index e0e9358..fc2e314 100644 --- a/fs/dax.c +++ b/fs/dax.c @@ -358,7 +358,8 @@ static int dax_radix_entry(struct address_space *mapping, pgoff_t index, void *entry; WARN_ON_ONCE(pmd_entry && !dirty); - __mark_inode_dirty(mapping->host, I_DIRTY_PAGES); + if (dirty) + __mark_inode_dirty(mapping->host, I_DIRTY_PAGES); spin_lock_irq(&mapping->tree_lock); -- 1.8.3.1 From jack@suse.cz Thu Feb 4 08:28:10 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=ham version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay1.corp.sgi.com [137.38.102.111]) by oss.sgi.com (Postfix) with ESMTP id 495267CA2 for ; Thu, 4 Feb 2016 08:28:10 -0600 (CST) Received: from cuda.sgi.com (cuda3.sgi.com [192.48.176.15]) by relay1.corp.sgi.com (Postfix) with ESMTP id 2AE3A8F8049 for ; Thu, 4 Feb 2016 06:28:10 -0800 (PST) X-ASG-Debug-ID: 1454596086-04cb6c27461d8f0001-NocioJ Received: from mx2.suse.de (mx2.suse.de [195.135.220.15]) by cuda.sgi.com with ESMTP id cfWHEEL8R6M9RUqs (version=TLSv1 cipher=ECDHE-RSA-AES256-SHA bits=256 verify=NO) for ; Thu, 04 Feb 2016 06:28:07 -0800 (PST) X-Barracuda-Envelope-From: jack@suse.cz X-Barracuda-Apparent-Source-IP: 195.135.220.15 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay1.suse.de (charybdis-ext.suse.de [195.135.220.254]) by mx2.suse.de (Postfix) with ESMTP id 3343FAC86; Thu, 4 Feb 2016 14:28:06 +0000 (UTC) Received: by quack.suse.cz (Postfix, from userid 1000) id 6438C823D6; Thu, 4 Feb 2016 15:28:19 +0100 (CET) From: Jan Kara To: linux-fsdevel@vger.kernel.org Cc: ocfs2-devel@oss.oracle.com, Mark Fasheh , Joel Becker , xfs@oss.sgi.com, Jan Kara Subject: [PATCH 3/3] ocfs2: Implement get_next_id() Date: Thu, 4 Feb 2016 15:28:07 +0100 X-ASG-Orig-Subj: [PATCH 3/3] ocfs2: Implement get_next_id() Message-Id: <1454596087-6814-4-git-send-email-jack@suse.cz> X-Mailer: git-send-email 2.6.2 In-Reply-To: <1454596087-6814-1-git-send-email-jack@suse.cz> References: <1454596087-6814-1-git-send-email-jack@suse.cz> X-Barracuda-Connect: mx2.suse.de[195.135.220.15] X-Barracuda-Start-Time: 1454596087 X-Barracuda-Encrypted: ECDHE-RSA-AES256-SHA X-Barracuda-URL: https://192.48.176.15:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-BRTS-Status: 1 X-Barracuda-Spam-Score: 0.00 X-Barracuda-Spam-Status: No, SCORE=0.00 using per-user scores of TAG_LEVEL=1000.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.7 tests=BSF_SC0_MISMATCH_TO X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.3.26737 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 0.00 BSF_SC0_MISMATCH_TO Envelope rcpt doesn't match header Implement get_next_id() callback to enable use of Q_GETNEXTQUOTA quotactl for OCFS2. Signed-off-by: Jan Kara --- fs/ocfs2/ocfs2_trace.h | 2 ++ fs/ocfs2/quota_global.c | 25 +++++++++++++++++++++++++ 2 files changed, 27 insertions(+) diff --git a/fs/ocfs2/ocfs2_trace.h b/fs/ocfs2/ocfs2_trace.h index 6cb019b7c6a8..a52a2dbc064e 100644 --- a/fs/ocfs2/ocfs2_trace.h +++ b/fs/ocfs2/ocfs2_trace.h @@ -2035,6 +2035,8 @@ DEFINE_OCFS2_UINT_INT_EVENT(ocfs2_release_dquot); DEFINE_OCFS2_UINT_INT_EVENT(ocfs2_acquire_dquot); +DEFINE_OCFS2_UINT_INT_EVENT(ocfs2_get_next_id); + DEFINE_OCFS2_UINT_INT_EVENT(ocfs2_mark_dquot_dirty); /* End of trace events for fs/ocfs2/quota_global.c. */ diff --git a/fs/ocfs2/quota_global.c b/fs/ocfs2/quota_global.c index fde9ef18cff3..8c903ce08e95 100644 --- a/fs/ocfs2/quota_global.c +++ b/fs/ocfs2/quota_global.c @@ -860,6 +860,30 @@ out: return status; } +static int ocfs2_get_next_id(struct super_block *sb, struct kqid *qid) +{ + int type = qid->type; + struct ocfs2_mem_dqinfo *info = sb_dqinfo(sb, type)->dqi_priv; + int status = 0; + + trace_ocfs2_get_next_id(from_kqid(&init_user_ns, *qid), type); + status = ocfs2_lock_global_qf(info, 0); + if (status < 0) + goto out; + status = ocfs2_qinfo_lock(info, 0); + if (status < 0) + goto out_global; + status = qtree_get_next_id(&info->dqi_gi, qid); + ocfs2_qinfo_unlock(info, 0); +out_global: + ocfs2_unlock_global_qf(info, 0); +out: + /* Avoid logging ENOENT since it just means there isn't next ID */ + if (status && status != -ENOENT) + mlog_errno(status); + return status; +} + static int ocfs2_mark_dquot_dirty(struct dquot *dquot) { unsigned long mask = (1 << (DQ_LASTSET_B + QIF_ILIMITS_B)) | @@ -968,4 +992,5 @@ const struct dquot_operations ocfs2_quota_operations = { .write_info = ocfs2_write_info, .alloc_dquot = ocfs2_alloc_dquot, .destroy_dquot = ocfs2_destroy_dquot, + .get_next_id = ocfs2_get_next_id, }; -- 2.6.2 From jack@suse.cz Thu Feb 4 08:28:11 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=ham version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay3.corp.sgi.com [198.149.34.15]) by oss.sgi.com (Postfix) with ESMTP id EE0277CA3 for ; Thu, 4 Feb 2016 08:28:10 -0600 (CST) Received: from cuda.sgi.com (cuda3.sgi.com [192.48.176.15]) by relay3.corp.sgi.com (Postfix) with ESMTP id 6B263AC005 for ; Thu, 4 Feb 2016 06:28:10 -0800 (PST) X-ASG-Debug-ID: 1454596086-04cb6c27471d8f0001-NocioJ Received: from mx2.suse.de (mx2.suse.de [195.135.220.15]) by cuda.sgi.com with ESMTP id T7VvEweJrjUW8ScV (version=TLSv1 cipher=ECDHE-RSA-AES256-SHA bits=256 verify=NO) for ; Thu, 04 Feb 2016 06:28:07 -0800 (PST) X-Barracuda-Envelope-From: jack@suse.cz X-Barracuda-Apparent-Source-IP: 195.135.220.15 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 33304AC20; Thu, 4 Feb 2016 14:28:06 +0000 (UTC) Received: by quack.suse.cz (Postfix, from userid 1000) id 66239823DB; Thu, 4 Feb 2016 15:28:19 +0100 (CET) From: Jan Kara To: linux-fsdevel@vger.kernel.org Cc: ocfs2-devel@oss.oracle.com, Mark Fasheh , Joel Becker , xfs@oss.sgi.com, Jan Kara Subject: [PATCH 2/3] quota_v2: Implement get_next_id() for V2 quota format Date: Thu, 4 Feb 2016 15:28:06 +0100 X-ASG-Orig-Subj: [PATCH 2/3] quota_v2: Implement get_next_id() for V2 quota format Message-Id: <1454596087-6814-3-git-send-email-jack@suse.cz> X-Mailer: git-send-email 2.6.2 In-Reply-To: <1454596087-6814-1-git-send-email-jack@suse.cz> References: <1454596087-6814-1-git-send-email-jack@suse.cz> X-Barracuda-Connect: mx2.suse.de[195.135.220.15] X-Barracuda-Start-Time: 1454596087 X-Barracuda-Encrypted: ECDHE-RSA-AES256-SHA X-Barracuda-URL: https://192.48.176.15:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-BRTS-Status: 1 X-Barracuda-Spam-Score: 0.00 X-Barracuda-Spam-Status: No, SCORE=0.00 using per-user scores of TAG_LEVEL=1000.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.7 tests=BSF_SC0_MISMATCH_TO X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.3.26737 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 0.00 BSF_SC0_MISMATCH_TO Envelope rcpt doesn't match header Implement functions to get id of next existing quota structure in quota file for quota tree based formats and thus for V2 quota format. Signed-off-by: Jan Kara --- fs/quota/quota_tree.c | 67 +++++++++++++++++++++++++++++++++++++++++++-- fs/quota/quota_v2.c | 6 ++++ include/linux/dqblk_qtree.h | 2 ++ 3 files changed, 73 insertions(+), 2 deletions(-) diff --git a/fs/quota/quota_tree.c b/fs/quota/quota_tree.c index 58efb83dec1c..0738972e8d3f 100644 --- a/fs/quota/quota_tree.c +++ b/fs/quota/quota_tree.c @@ -22,10 +22,9 @@ MODULE_LICENSE("GPL"); #define __QUOTA_QT_PARANOIA -static int get_index(struct qtree_mem_dqinfo *info, struct kqid qid, int depth) +static int __get_index(struct qtree_mem_dqinfo *info, qid_t id, int depth) { unsigned int epb = info->dqi_usable_bs >> 2; - qid_t id = from_kqid(&init_user_ns, qid); depth = info->dqi_qtree_depth - depth - 1; while (depth--) @@ -33,6 +32,13 @@ static int get_index(struct qtree_mem_dqinfo *info, struct kqid qid, int depth) return id % epb; } +static int get_index(struct qtree_mem_dqinfo *info, struct kqid qid, int depth) +{ + qid_t id = from_kqid(&init_user_ns, qid); + + return __get_index(info, id, depth); +} + /* Number of entries in one blocks */ static int qtree_dqstr_in_blk(struct qtree_mem_dqinfo *info) { @@ -668,3 +674,60 @@ int qtree_release_dquot(struct qtree_mem_dqinfo *info, struct dquot *dquot) return 0; } EXPORT_SYMBOL(qtree_release_dquot); + +static int find_next_id(struct qtree_mem_dqinfo *info, qid_t *id, + unsigned int blk, int depth) +{ + char *buf = getdqbuf(info->dqi_usable_bs); + __le32 *ref = (__le32 *)buf; + ssize_t ret; + unsigned int epb = info->dqi_usable_bs >> 2; + unsigned int level_inc = 1; + int i; + + if (!buf) + return -ENOMEM; + + for (i = depth; i < info->dqi_qtree_depth - 1; i++) + level_inc *= epb; + + ret = read_blk(info, blk, buf); + if (ret < 0) { + quota_error(info->dqi_sb, + "Can't read quota tree block %u", blk); + goto out_buf; + } + for (i = __get_index(info, *id, depth); i < epb; i++) { + if (ref[i] == cpu_to_le32(0)) { + *id += level_inc; + continue; + } + if (depth == info->dqi_qtree_depth - 1) { + ret = 0; + goto out_buf; + } + ret = find_next_id(info, id, le32_to_cpu(ref[i]), depth + 1); + if (ret != -ENOENT) + break; + } + if (i == epb) { + ret = -ENOENT; + goto out_buf; + } +out_buf: + kfree(buf); + return ret; +} + +int qtree_get_next_id(struct qtree_mem_dqinfo *info, struct kqid *qid) +{ + qid_t id = from_kqid(&init_user_ns, *qid); + int ret; + + ret = find_next_id(info, &id, QT_TREEOFF, 0); + if (ret < 0) + return ret; + *qid = make_kqid(&init_user_ns, qid->type, id); + return 0; +} +EXPORT_SYMBOL(qtree_get_next_id); diff --git a/fs/quota/quota_v2.c b/fs/quota/quota_v2.c index ed85d4f35c04..ca71bf881ad1 100644 --- a/fs/quota/quota_v2.c +++ b/fs/quota/quota_v2.c @@ -304,6 +304,11 @@ static int v2_free_file_info(struct super_block *sb, int type) return 0; } +static int v2_get_next_id(struct super_block *sb, struct kqid *qid) +{ + return qtree_get_next_id(sb_dqinfo(sb, qid->type)->dqi_priv, qid); +} + static const struct quota_format_ops v2_format_ops = { .check_quota_file = v2_check_quota_file, .read_file_info = v2_read_file_info, @@ -312,6 +317,7 @@ static const struct quota_format_ops v2_format_ops = { .read_dqblk = v2_read_dquot, .commit_dqblk = v2_write_dquot, .release_dqblk = v2_release_dquot, + .get_next_id = v2_get_next_id, }; static struct quota_format_type v2r0_quota_format = { diff --git a/include/linux/dqblk_qtree.h b/include/linux/dqblk_qtree.h index ff8b55359648..0de21e935976 100644 --- a/include/linux/dqblk_qtree.h +++ b/include/linux/dqblk_qtree.h @@ -15,6 +15,7 @@ #define QTREE_DEL_REWRITE 6 struct dquot; +struct kqid; /* Operations */ struct qtree_fmt_operations { @@ -52,5 +53,6 @@ static inline int qtree_depth(struct qtree_mem_dqinfo *info) entries *= epb; return i; } +int qtree_get_next_id(struct qtree_mem_dqinfo *info, struct kqid *qid); #endif /* _LINUX_DQBLK_QTREE_H */ -- 2.6.2 From jack@suse.cz Thu Feb 4 08:28:13 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=ham version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay1.corp.sgi.com [137.38.102.111]) by oss.sgi.com (Postfix) with ESMTP id 03DF77CA2 for ; Thu, 4 Feb 2016 08:28:13 -0600 (CST) Received: from cuda.sgi.com (cuda3.sgi.com [192.48.176.15]) by relay1.corp.sgi.com (Postfix) with ESMTP id E8EA08F8039 for ; Thu, 4 Feb 2016 06:28:09 -0800 (PST) X-ASG-Debug-ID: 1454596086-04cb6c27441d8e0001-NocioJ Received: from mx2.suse.de (mx2.suse.de [195.135.220.15]) by cuda.sgi.com with ESMTP id mOZ4auvL0Y8wUx7T (version=TLSv1 cipher=ECDHE-RSA-AES256-SHA bits=256 verify=NO) for ; Thu, 04 Feb 2016 06:28:07 -0800 (PST) X-Barracuda-Envelope-From: jack@suse.cz X-Barracuda-Apparent-Source-IP: 195.135.220.15 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay1.suse.de (charybdis-ext.suse.de [195.135.220.254]) by mx2.suse.de (Postfix) with ESMTP id 33386AC75; Thu, 4 Feb 2016 14:28:06 +0000 (UTC) Received: by quack.suse.cz (Postfix, from userid 1000) id 5BCCA823DA; Thu, 4 Feb 2016 15:28:19 +0100 (CET) From: Jan Kara To: linux-fsdevel@vger.kernel.org Cc: ocfs2-devel@oss.oracle.com, Mark Fasheh , Joel Becker , xfs@oss.sgi.com, Jan Kara Subject: [PATCH 0/3 v2] Q_GETNEXTQUOTA support Date: Thu, 4 Feb 2016 15:28:04 +0100 X-ASG-Orig-Subj: [PATCH 0/3 v2] Q_GETNEXTQUOTA support Message-Id: <1454596087-6814-1-git-send-email-jack@suse.cz> X-Mailer: git-send-email 2.6.2 X-Barracuda-Connect: mx2.suse.de[195.135.220.15] X-Barracuda-Start-Time: 1454596087 X-Barracuda-Encrypted: ECDHE-RSA-AES256-SHA X-Barracuda-URL: https://192.48.176.15:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-BRTS-Status: 1 X-Barracuda-Spam-Score: 0.00 X-Barracuda-Spam-Status: No, SCORE=0.00 using per-user scores of TAG_LEVEL=1000.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.7 tests=BSF_SC0_MISMATCH_TO X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.3.26737 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 0.00 BSF_SC0_MISMATCH_TO Envelope rcpt doesn't match header Hello, the patch set below adds support for VFS quotas for Q_GETNEXTQUOTA quotactl and thus repquota(8) doesn't have to iterate over /etc/passwd or LDAP database to report all quota limits. ext2, ext4, reiserfs, jfs, and ocfs2 support this quotactl (and Q_XGETNEXTQUOTA as well) after applying this patch set. XFS bits will likely get merged independently through XFS tree. If nobody objects, I'll push these patches to my tree in a few days. Changes since v2: * Added get_next_id() operation to dquot_operations to allow for cleaner support in OCFS2 * Added OCFS2 support Honza From jack@suse.cz Thu Feb 4 08:28:13 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=ham version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay3.corp.sgi.com [198.149.34.15]) by oss.sgi.com (Postfix) with ESMTP id B330C7CA2 for ; Thu, 4 Feb 2016 08:28:13 -0600 (CST) Received: from cuda.sgi.com (cuda2.sgi.com [192.48.176.25]) by relay3.corp.sgi.com (Postfix) with ESMTP id 43867AC003 for ; Thu, 4 Feb 2016 06:28:13 -0800 (PST) X-ASG-Debug-ID: 1454596086-04cbb04cf935360001-NocioJ Received: from mx2.suse.de (mx2.suse.de [195.135.220.15]) by cuda.sgi.com with ESMTP id iHVoZS3REWfuZLlc (version=TLSv1 cipher=ECDHE-RSA-AES256-SHA bits=256 verify=NO) for ; Thu, 04 Feb 2016 06:28:07 -0800 (PST) X-Barracuda-Envelope-From: jack@suse.cz X-Barracuda-Apparent-Source-IP: 195.135.220.15 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 334FAADAE; Thu, 4 Feb 2016 14:28:06 +0000 (UTC) Received: by quack.suse.cz (Postfix, from userid 1000) id 61A0881B65; Thu, 4 Feb 2016 15:28:19 +0100 (CET) From: Jan Kara To: linux-fsdevel@vger.kernel.org Cc: ocfs2-devel@oss.oracle.com, Mark Fasheh , Joel Becker , xfs@oss.sgi.com, Jan Kara Subject: [PATCH 1/3] quota: Add support for ->get_nextdqblk() for VFS quota Date: Thu, 4 Feb 2016 15:28:05 +0100 X-ASG-Orig-Subj: [PATCH 1/3] quota: Add support for ->get_nextdqblk() for VFS quota Message-Id: <1454596087-6814-2-git-send-email-jack@suse.cz> X-Mailer: git-send-email 2.6.2 In-Reply-To: <1454596087-6814-1-git-send-email-jack@suse.cz> References: <1454596087-6814-1-git-send-email-jack@suse.cz> X-Barracuda-Connect: mx2.suse.de[195.135.220.15] X-Barracuda-Start-Time: 1454596087 X-Barracuda-Encrypted: ECDHE-RSA-AES256-SHA X-Barracuda-URL: https://192.48.176.25:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-BRTS-Status: 1 X-Barracuda-Spam-Score: 0.00 X-Barracuda-Spam-Status: No, SCORE=0.00 using per-user scores of TAG_LEVEL=1000.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.7 tests=BSF_SC0_MISMATCH_TO X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.3.26737 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 0.00 BSF_SC0_MISMATCH_TO Envelope rcpt doesn't match header Add infrastructure for supporting get_nextdqblk() callback for VFS quotas. Translate the operation into a callback to appropriate filesystem and consequently to quota format callback. Signed-off-by: Jan Kara --- fs/ext4/super.c | 1 + fs/quota/dquot.c | 39 +++++++++++++++++++++++++++++++++++++++ fs/reiserfs/super.c | 1 + include/linux/quota.h | 3 +++ include/linux/quotaops.h | 3 +++ 5 files changed, 47 insertions(+) diff --git a/fs/ext4/super.c b/fs/ext4/super.c index f1b56ff01208..51649f442bf6 100644 --- a/fs/ext4/super.c +++ b/fs/ext4/super.c @@ -1100,6 +1100,7 @@ static const struct dquot_operations ext4_quota_operations = { .write_info = ext4_write_info, .alloc_dquot = dquot_alloc, .destroy_dquot = dquot_destroy, + .get_next_id = dquot_get_next_id, }; static const struct quotactl_ops ext4_qctl_operations = { diff --git a/fs/quota/dquot.c b/fs/quota/dquot.c index fbd70af98820..f5c4967b62f1 100644 --- a/fs/quota/dquot.c +++ b/fs/quota/dquot.c @@ -2031,6 +2031,21 @@ int dquot_commit_info(struct super_block *sb, int type) } EXPORT_SYMBOL(dquot_commit_info); +int dquot_get_next_id(struct super_block *sb, struct kqid *qid) +{ + struct quota_info *dqopt = sb_dqopt(sb); + int err; + + if (!dqopt->ops[qid->type]->get_next_id) + return -ENOSYS; + mutex_lock(&dqopt->dqio_mutex); + err = dqopt->ops[qid->type]->get_next_id(sb, qid); + mutex_unlock(&dqopt->dqio_mutex); + + return err; +} +EXPORT_SYMBOL(dquot_get_next_id); + /* * Definitions of diskquota operations. */ @@ -2042,6 +2057,7 @@ const struct dquot_operations dquot_operations = { .write_info = dquot_commit_info, .alloc_dquot = dquot_alloc, .destroy_dquot = dquot_destroy, + .get_next_id = dquot_get_next_id, }; EXPORT_SYMBOL(dquot_operations); @@ -2565,6 +2581,27 @@ int dquot_get_dqblk(struct super_block *sb, struct kqid qid, } EXPORT_SYMBOL(dquot_get_dqblk); +int dquot_get_next_dqblk(struct super_block *sb, struct kqid *qid, + struct qc_dqblk *di) +{ + struct dquot *dquot; + int err; + + if (!sb->dq_op->get_next_id) + return -ENOSYS; + err = sb->dq_op->get_next_id(sb, qid); + if (err < 0) + return err; + dquot = dqget(sb, *qid); + if (IS_ERR(dquot)) + return PTR_ERR(dquot); + do_get_dqblk(dquot, di); + dqput(dquot); + + return 0; +} +EXPORT_SYMBOL(dquot_get_next_dqblk); + #define VFS_QC_MASK \ (QC_SPACE | QC_SPC_SOFT | QC_SPC_HARD | \ QC_INO_COUNT | QC_INO_SOFT | QC_INO_HARD | \ @@ -2765,6 +2802,7 @@ const struct quotactl_ops dquot_quotactl_ops = { .get_state = dquot_get_state, .set_info = dquot_set_dqinfo, .get_dqblk = dquot_get_dqblk, + .get_nextdqblk = dquot_get_next_dqblk, .set_dqblk = dquot_set_dqblk }; EXPORT_SYMBOL(dquot_quotactl_ops); @@ -2776,6 +2814,7 @@ const struct quotactl_ops dquot_quotactl_sysfile_ops = { .get_state = dquot_get_state, .set_info = dquot_set_dqinfo, .get_dqblk = dquot_get_dqblk, + .get_nextdqblk = dquot_get_next_dqblk, .set_dqblk = dquot_set_dqblk }; EXPORT_SYMBOL(dquot_quotactl_sysfile_ops); diff --git a/fs/reiserfs/super.c b/fs/reiserfs/super.c index 05db7473bcb5..b62f495add62 100644 --- a/fs/reiserfs/super.c +++ b/fs/reiserfs/super.c @@ -802,6 +802,7 @@ static const struct dquot_operations reiserfs_quota_operations = { .write_info = reiserfs_write_info, .alloc_dquot = dquot_alloc, .destroy_dquot = dquot_destroy, + .get_next_id = dquot_get_next_id, }; static const struct quotactl_ops reiserfs_qctl_operations = { diff --git a/include/linux/quota.h b/include/linux/quota.h index fba92f5c1a63..9dfb6bce8c9e 100644 --- a/include/linux/quota.h +++ b/include/linux/quota.h @@ -306,6 +306,7 @@ struct quota_format_ops { int (*read_dqblk)(struct dquot *dquot); /* Read structure for one user */ int (*commit_dqblk)(struct dquot *dquot); /* Write structure for one user */ int (*release_dqblk)(struct dquot *dquot); /* Called when last reference to dquot is being dropped */ + int (*get_next_id)(struct super_block *sb, struct kqid *qid); /* Get next ID with existing structure in the quota file */ }; /* Operations working with dquots */ @@ -321,6 +322,8 @@ struct dquot_operations { * quota code only */ qsize_t *(*get_reserved_space) (struct inode *); int (*get_projid) (struct inode *, kprojid_t *);/* Get project ID */ + /* Get next ID with active quota structure */ + int (*get_next_id) (struct super_block *sb, struct kqid *qid); }; struct path; diff --git a/include/linux/quotaops.h b/include/linux/quotaops.h index 7a57c28eb5e7..f00fa86ac966 100644 --- a/include/linux/quotaops.h +++ b/include/linux/quotaops.h @@ -82,6 +82,7 @@ int dquot_commit(struct dquot *dquot); int dquot_acquire(struct dquot *dquot); int dquot_release(struct dquot *dquot); int dquot_commit_info(struct super_block *sb, int type); +int dquot_get_next_id(struct super_block *sb, struct kqid *qid); int dquot_mark_dquot_dirty(struct dquot *dquot); int dquot_file_open(struct inode *inode, struct file *file); @@ -99,6 +100,8 @@ int dquot_get_state(struct super_block *sb, struct qc_state *state); int dquot_set_dqinfo(struct super_block *sb, int type, struct qc_info *ii); int dquot_get_dqblk(struct super_block *sb, struct kqid id, struct qc_dqblk *di); +int dquot_get_next_dqblk(struct super_block *sb, struct kqid *id, + struct qc_dqblk *di); int dquot_set_dqblk(struct super_block *sb, struct kqid id, struct qc_dqblk *di); -- 2.6.2 From jack@suse.cz Thu Feb 4 08:33:40 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=ham version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay3.corp.sgi.com [198.149.34.15]) by oss.sgi.com (Postfix) with ESMTP id 433127CA2 for ; Thu, 4 Feb 2016 08:33:40 -0600 (CST) Received: from cuda.sgi.com (cuda2.sgi.com [192.48.176.25]) by relay3.corp.sgi.com (Postfix) with ESMTP id B0887AC003 for ; Thu, 4 Feb 2016 06:33:39 -0800 (PST) X-ASG-Debug-ID: 1454596414-04cbb04cfa355b0001-NocioJ Received: from mx2.suse.de (mx2.suse.de [195.135.220.15]) by cuda.sgi.com with ESMTP id TiY9Wu51gdPpd2FT (version=TLSv1 cipher=ECDHE-RSA-AES256-SHA bits=256 verify=NO) for ; Thu, 04 Feb 2016 06:33:35 -0800 (PST) X-Barracuda-Envelope-From: jack@suse.cz X-Barracuda-Apparent-Source-IP: 195.135.220.15 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay1.suse.de (charybdis-ext.suse.de [195.135.220.254]) by mx2.suse.de (Postfix) with ESMTP id B2E95AC20; Thu, 4 Feb 2016 14:33:31 +0000 (UTC) Received: by quack.suse.cz (Postfix, from userid 1000) id 51C0B823D6; Thu, 4 Feb 2016 15:33:44 +0100 (CET) Date: Thu, 4 Feb 2016 15:33:44 +0100 From: Jan Kara To: Dmitry Monakhov Cc: Ross Zwisler , "linux-kernel@vger.kernel.org" , "H. Peter Anvin" , "J. Bruce Fields" , Theodore Ts'o , Alexander Viro , Andreas Dilger , Dave Chinner , Ingo Molnar , Jan Kara , Jeff Layton , Matthew Wilcox , Thomas Gleixner , linux-ext4 , linux-fsdevel , Linux MM , "linux-nvdimm@lists.01.org" , X86 ML , XFS Developers , Andrew Morton , Matthew Wilcox , Dave Hansen Subject: Re: [PATCH] dax: dirty inode only if required Message-ID: <20160204143344.GA6895@quack.suse.cz> X-ASG-Orig-Subj: Re: [PATCH] dax: dirty inode only if required References: <87k2mkr2ud.fsf@openvz.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <87k2mkr2ud.fsf@openvz.org> User-Agent: Mutt/1.5.24 (2015-08-30) X-Barracuda-Connect: mx2.suse.de[195.135.220.15] X-Barracuda-Start-Time: 1454596414 X-Barracuda-Encrypted: ECDHE-RSA-AES256-SHA X-Barracuda-URL: https://192.48.176.25:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-BRTS-Status: 1 X-Barracuda-Spam-Score: 0.00 X-Barracuda-Spam-Status: No, SCORE=0.00 using per-user scores of TAG_LEVEL=1000.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.7 tests=BSF_SC0_MISMATCH_TO X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.3.26737 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 0.00 BSF_SC0_MISMATCH_TO Envelope rcpt doesn't match header On Thu 04-02-16 17:02:02, Dmitry Monakhov wrote: > > Signed-off-by: Dmitry Monakhov Makes sense. You can add: Reviewed-by: Jan Kara Honza > --- > fs/dax.c | 3 ++- > 1 file changed, 2 insertions(+), 1 deletion(-) > > diff --git a/fs/dax.c b/fs/dax.c > index e0e9358..fc2e314 100644 > --- a/fs/dax.c > +++ b/fs/dax.c > @@ -358,7 +358,8 @@ static int dax_radix_entry(struct address_space *mapping, pgoff_t index, > void *entry; > > WARN_ON_ONCE(pmd_entry && !dirty); > - __mark_inode_dirty(mapping->host, I_DIRTY_PAGES); > + if (dirty) > + __mark_inode_dirty(mapping->host, I_DIRTY_PAGES); > > spin_lock_irq(&mapping->tree_lock); > > -- > 1.8.3.1 > -- Jan Kara SUSE Labs, CR From ross.zwisler@linux.intel.com Thu Feb 4 09:52:03 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=ham version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay2.corp.sgi.com [137.38.102.29]) by oss.sgi.com (Postfix) with ESMTP id 46D5B7CA2 for ; Thu, 4 Feb 2016 09:52:03 -0600 (CST) Received: from cuda.sgi.com (cuda3.sgi.com [192.48.176.15]) by relay2.corp.sgi.com (Postfix) with ESMTP id 2864C304048 for ; Thu, 4 Feb 2016 07:52:03 -0800 (PST) X-ASG-Debug-ID: 1454601118-04cb6c27441fd00001-NocioJ Received: from mga11.intel.com ([192.55.52.93]) by cuda.sgi.com with ESMTP id FM16NqOHe6WJ81t5 for ; Thu, 04 Feb 2016 07:51:59 -0800 (PST) X-Barracuda-Envelope-From: ross.zwisler@linux.intel.com X-Barracuda-Apparent-Source-IP: 192.55.52.93 X-ASG-Whitelist: Client Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by fmsmga102.fm.intel.com with ESMTP; 04 Feb 2016 07:50:44 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.22,396,1449561600"; d="scan'208";a="896388891" Received: from tarkir.lm.intel.com (HELO linux.intel.com) ([10.232.112.142]) by fmsmga001.fm.intel.com with ESMTP; 04 Feb 2016 07:50:44 -0800 Date: Thu, 4 Feb 2016 08:50:39 -0700 From: Ross Zwisler To: Jan Kara Cc: Dmitry Monakhov , Ross Zwisler , "linux-kernel@vger.kernel.org" , "H. Peter Anvin" , "J. Bruce Fields" , Theodore Ts'o , Alexander Viro , Andreas Dilger , Dave Chinner , Ingo Molnar , Jan Kara , Jeff Layton , Matthew Wilcox , Thomas Gleixner , linux-ext4 , linux-fsdevel , Linux MM , "linux-nvdimm@lists.01.org" , X86 ML , XFS Developers , Andrew Morton , Matthew Wilcox , Dave Hansen Subject: Re: [PATCH] dax: dirty inode only if required Message-ID: <20160204155039.GA17818@linux.intel.com> X-ASG-Orig-Subj: Re: [PATCH] dax: dirty inode only if required Mail-Followup-To: Ross Zwisler , Jan Kara , Dmitry Monakhov , "linux-kernel@vger.kernel.org" , "H. Peter Anvin" , "J. Bruce Fields" , Theodore Ts'o , Alexander Viro , Andreas Dilger , Dave Chinner , Ingo Molnar , Jan Kara , Jeff Layton , Matthew Wilcox , Thomas Gleixner , linux-ext4 , linux-fsdevel , Linux MM , "linux-nvdimm@lists.01.org" , X86 ML , XFS Developers , Andrew Morton , Matthew Wilcox , Dave Hansen References: <87k2mkr2ud.fsf@openvz.org> <20160204143344.GA6895@quack.suse.cz> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20160204143344.GA6895@quack.suse.cz> User-Agent: Mutt/1.5.24 (2015-08-30) X-Barracuda-Connect: UNKNOWN[192.55.52.93] X-Barracuda-Start-Time: 1454601119 X-Barracuda-URL: https://192.48.176.15:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-BRTS-Status: 1 On Thu, Feb 04, 2016 at 03:33:44PM +0100, Jan Kara wrote: > On Thu 04-02-16 17:02:02, Dmitry Monakhov wrote: > > > > Signed-off-by: Dmitry Monakhov > > Makes sense. You can add: > > Reviewed-by: Jan Kara Looks good to me as well. Reviewed-by: Ross Zwisler > Honza > > --- > > fs/dax.c | 3 ++- > > 1 file changed, 2 insertions(+), 1 deletion(-) > > > > diff --git a/fs/dax.c b/fs/dax.c > > index e0e9358..fc2e314 100644 > > --- a/fs/dax.c > > +++ b/fs/dax.c > > @@ -358,7 +358,8 @@ static int dax_radix_entry(struct address_space *mapping, pgoff_t index, > > void *entry; > > > > WARN_ON_ONCE(pmd_entry && !dirty); > > - __mark_inode_dirty(mapping->host, I_DIRTY_PAGES); > > + if (dirty) > > + __mark_inode_dirty(mapping->host, I_DIRTY_PAGES); > > > > spin_lock_irq(&mapping->tree_lock); > > > > -- > > 1.8.3.1 > > > -- > Jan Kara > SUSE Labs, CR From darrick.wong@oracle.com Thu Feb 4 12:06:07 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay3.corp.sgi.com [198.149.34.15]) by oss.sgi.com (Postfix) with ESMTP id F3C427CA2 for ; Thu, 4 Feb 2016 12:06:06 -0600 (CST) Received: from cuda.sgi.com (cuda1.sgi.com [192.48.157.11]) by relay3.corp.sgi.com (Postfix) with ESMTP id 9170DAC004 for ; Thu, 4 Feb 2016 10:06:03 -0800 (PST) X-ASG-Debug-ID: 1454609156-04bdf079c124220001-NocioJ Received: from aserp1040.oracle.com (aserp1040.oracle.com [141.146.126.69]) by cuda.sgi.com with ESMTP id KQzeelV6jt5Td65a (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO) for ; Thu, 04 Feb 2016 10:05:56 -0800 (PST) X-Barracuda-Envelope-From: darrick.wong@oracle.com X-Barracuda-Apparent-Source-IP: 141.146.126.69 Received: from userv0022.oracle.com (userv0022.oracle.com [156.151.31.74]) by aserp1040.oracle.com (Sentrion-MTA-4.3.2/Sentrion-MTA-4.3.2) with ESMTP id u14I5rW3000793 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 4 Feb 2016 18:05:54 GMT Received: from aserv0121.oracle.com (aserv0121.oracle.com [141.146.126.235]) by userv0022.oracle.com (8.14.4/8.13.8) with ESMTP id u14I5r6G007207 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=FAIL); Thu, 4 Feb 2016 18:05:53 GMT Received: from abhmp0019.oracle.com (abhmp0019.oracle.com [141.146.116.25]) by aserv0121.oracle.com (8.13.8/8.13.8) with ESMTP id u14I5qab027576; Thu, 4 Feb 2016 18:05:53 GMT Received: from localhost (/24.21.154.84) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Thu, 04 Feb 2016 10:05:52 -0800 Date: Thu, 4 Feb 2016 10:05:51 -0800 From: "Darrick J. Wong" To: Christoph Hellwig Cc: xfs@oss.sgi.com Subject: Re: reflink log reservations Message-ID: <20160204180551.GB27899@birch.djwong.org> X-ASG-Orig-Subj: Re: reflink log reservations References: <20160204074617.GB20496@lst.de> <20160204081620.GL20038@birch.djwong.org> <20160204133133.GA28701@lst.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20160204133133.GA28701@lst.de> User-Agent: Mutt/1.5.21 (2010-09-15) X-Source-IP: userv0022.oracle.com [156.151.31.74] X-Barracuda-Connect: aserp1040.oracle.com[141.146.126.69] X-Barracuda-Start-Time: 1454609156 X-Barracuda-Encrypted: ECDHE-RSA-AES256-GCM-SHA384 X-Barracuda-URL: https://192.48.157.11:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-BRTS-Status: 1 X-Barracuda-Spam-Score: 0.00 X-Barracuda-Spam-Status: No, SCORE=0.00 using per-user scores of TAG_LEVEL=1000.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.7 tests=BSF_SC0_MISMATCH_TO, UNPARSEABLE_RELAY X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.3.26741 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 0.00 BSF_SC0_MISMATCH_TO Envelope rcpt doesn't match header 0.00 UNPARSEABLE_RELAY Informational: message has unparseable relay lines On Thu, Feb 04, 2016 at 02:31:33PM +0100, Christoph Hellwig wrote: > On Thu, Feb 04, 2016 at 12:16:20AM -0800, Darrick J. Wong wrote: > > On Thu, Feb 04, 2016 at 08:46:17AM +0100, Christoph Hellwig wrote: > > > Hi Darrick, > > > > > > I'm running into the following log reservation assert after a few > > > xfstests runs over NFS. I'll try to understand the reservation > > > calculations, but in case this is still fresh in your head here's > > > a headsup: > > > > Hmm, interesting, I haven't seen /that/ one... my guess is that the > > block reservation needs to be bumped up for the refcount tree. > > This seems to fix it for me: > > --- > From 6e27eb42ece3a25f610690487b403a0091cafa26 Mon Sep 17 00:00:00 2001 > From: Christoph Hellwig > Date: Thu, 4 Feb 2016 13:50:16 +0100 > Subject: xfs: account for the refcount btree in the alloc/free log reservation > > Signed-off-by: Christoph Hellwig > --- > fs/xfs/libxfs/xfs_trans_resv.c | 15 ++++++++++----- > 1 file changed, 10 insertions(+), 5 deletions(-) > > diff --git a/fs/xfs/libxfs/xfs_trans_resv.c b/fs/xfs/libxfs/xfs_trans_resv.c > index d495f82..f4c2648 100644 > --- a/fs/xfs/libxfs/xfs_trans_resv.c > +++ b/fs/xfs/libxfs/xfs_trans_resv.c > @@ -65,12 +65,15 @@ xfs_calc_buf_res( > > /* > * Per-extent log reservation for the allocation btree changes > - * involved in freeing or allocating an extent. When rmap is not enabled, > - * there are only two trees that will be modified (free space trees), and when > - * rmap is enabled there will be three (freespace + rmap trees). The number of > - * blocks reserved is based on the formula: > + * involved in freeing or allocating an extent. > * > - * num trees * ((2 blocks/level * max depth) - 1) > + * There are at least two trees that will be modified (free space trees), when > + * rmap is enabled there will be an additional rmap tree, and when reflinks > + * are enabled there will be a refcount btree as well > + * > + * The number of blocks reserved is based on the formula: > + * > + * num trees * ((2 blocks/level * max depth) - 1) Huh, could've sworn I used to have a patch that does this... but I can't find it, so it clearly fell out. Thanks for the patch. --D > */ > static uint > xfs_allocfree_log_count( > @@ -81,6 +84,8 @@ xfs_allocfree_log_count( > > if (xfs_sb_version_hasrmapbt(&mp->m_sb)) > num_trees++; > + if (xfs_sb_version_hasreflink(&mp->m_sb)) > + num_trees++; > > return num_ops * num_trees * (2 * mp->m_ag_maxlevels - 1); > } > -- > 2.1.4 > From zwisler@gmail.com Thu Feb 4 15:22:29 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=FREEMAIL_FROM,T_DKIM_INVALID autolearn=ham version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay2.corp.sgi.com [137.38.102.29]) by oss.sgi.com (Postfix) with ESMTP id 64A087CA2 for ; Thu, 4 Feb 2016 15:22:29 -0600 (CST) Received: from cuda.sgi.com (cuda1.sgi.com [192.48.157.11]) by relay2.corp.sgi.com (Postfix) with ESMTP id 2ACEE304032 for ; Thu, 4 Feb 2016 13:22:26 -0800 (PST) X-ASG-Debug-ID: 1454620937-04bdf079c3295c0001-NocioJ Received: from mail-qg0-f42.google.com (mail-qg0-f42.google.com [209.85.192.42]) by cuda.sgi.com with ESMTP id tGbEJmjoN9ViaN6h (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128 verify=NO) for ; Thu, 04 Feb 2016 13:22:18 -0800 (PST) X-Barracuda-Envelope-From: zwisler@gmail.com X-Barracuda-Apparent-Source-IP: 209.85.192.42 Received: by mail-qg0-f42.google.com with SMTP id b35so52865651qge.0 for ; Thu, 04 Feb 2016 13:22:18 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=5BSzbxPrsOvvtUgACdhnANhqoivF6yz5Amtvh2ZnJgM=; b=GRxAvh/eDAbwsA5dc3C1R422INfmkMDMNk6WSxkM1NwR+GVPvcamSkj5nPWz8Uxu0E xwr/vKbdp9z0PpOgQf7hBEK+StBCgK08syKSn+uXP+IjObR7t3pZrcYhjboYBjTxXoB6 qcMFGol6gMrG43IJVTkFH6UzgRzFidlHXpuVH+xKXCqgL96+Zu64vEvui3jvAx615LEc LFfDcw/z8ZTp86O6+1L5hwb01r1ppka4J72EgAtCqD3hhXjYjCudjuvFJDnrkV8/aCmk qLOJuH5aU7avfRcRs4BWv98jXP1Ip3xz7WiC9o9pvGJ2yPQBHKm99TCw45XHmKbzrU3e 1nmA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:date :message-id:subject:from:to:cc:content-type; bh=5BSzbxPrsOvvtUgACdhnANhqoivF6yz5Amtvh2ZnJgM=; b=KggeMebK4fjf5yLoZpOVzgHDY8VQGMAJ+GVTb7cVpr0CxbdtgBPZfX2ZFvSMU7AP9+ JwazsNj2+wttPgzUJEZvVNMKxFwCxrUFFkZ3BThIl1f9zzOBvz6GLoK0UZejK5fryXRD /r6bXKeADBJBypSzefam60XCuLy99hNrsB2e+vUTpQ3aXkcwFoRNnAfa2scnmkDpocZ9 aCc2F9aeNOCOmcDtJMbUkmb012Z3JtmcDYBRjeFi1GBpbW5POrU/I843romSWdOW2Tfg AfpQaA8UQseZD9zfUD+ufX8g5G9rTCAw//J2K8+dKPhd5lJ9uIOB7NyQ0DrCwI+y4+Y7 kghg== X-Gm-Message-State: AG10YOTR9qaQI9DmUEliSseFFQQk0aqLxyiZBeKckaJAJAQqfKvQKAVtOxXDxBqGoDWfTkJPe498yXtY+lVZeQ== MIME-Version: 1.0 X-Received: by 10.140.160.130 with SMTP id g124mr10604507qhg.88.1454620937058; Thu, 04 Feb 2016 13:22:17 -0800 (PST) Received: by 10.55.78.67 with HTTP; Thu, 4 Feb 2016 13:22:17 -0800 (PST) In-Reply-To: <1454373550-3102-1-git-send-email-david@fromorbit.com> References: <1454373550-3102-1-git-send-email-david@fromorbit.com> Date: Thu, 4 Feb 2016 14:22:17 -0700 Message-ID: Subject: Re: [PATCH 0/3] xfs: fix realtime device assert failures From: Ross Zwisler X-ASG-Orig-Subj: Re: [PATCH 0/3] xfs: fix realtime device assert failures To: Dave Chinner Cc: xfs@oss.sgi.com Content-Type: text/plain; charset=UTF-8 X-Barracuda-Connect: mail-qg0-f42.google.com[209.85.192.42] X-Barracuda-Start-Time: 1454620938 X-Barracuda-Encrypted: ECDHE-RSA-AES128-GCM-SHA256 X-Barracuda-URL: https://192.48.157.11:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-BRTS-Status: 1 X-Barracuda-Spam-Score: 0.00 X-Barracuda-Spam-Status: No, SCORE=0.00 using per-user scores of TAG_LEVEL=1000.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.7 tests=BSF_SC0_MISMATCH_TO, DKIM_SIGNED, DKIM_VERIFIED X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.3.26748 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 0.00 BSF_SC0_MISMATCH_TO Envelope rcpt doesn't match header -0.00 DKIM_VERIFIED Domain Keys Identified Mail: signature passes verification 0.00 DKIM_SIGNED Domain Keys Identified Mail: message has a signature This series solves the assert and the follow-up XFS warning for me. Tested-by: Ross Zwisler The lockdep splat is still there, but I assume you know that. On Mon, Feb 1, 2016 at 5:39 PM, Dave Chinner wrote: > Hi folks, > > This is a followup to Eric's patch that attempted to fix the assert > failure that Ross reported. I'd mentioned I'd looked at this > recently, because xfs/090 was triggering the same failure when > configured with a RT device. This series fixes the original locking > based assert failures, followed by the issues that fixing the > original assert uncovered. This now results in xfs/090 failing > because of xfs_db check problem (repair is clean) but it (and other > tests) no longer assert fail. > > Cheers, > > Dave. > > _______________________________________________ > xfs mailing list > xfs@oss.sgi.com > http://oss.sgi.com/mailman/listinfo/xfs From dave@fromorbit.com Thu Feb 4 17:03:01 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=ham version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay1.corp.sgi.com [137.38.102.111]) by oss.sgi.com (Postfix) with ESMTP id 0A6B87CA2 for ; Thu, 4 Feb 2016 17:03:01 -0600 (CST) Received: from cuda.sgi.com (cuda3.sgi.com [192.48.176.15]) by relay1.corp.sgi.com (Postfix) with ESMTP id EE71A8F8033 for ; Thu, 4 Feb 2016 15:02:57 -0800 (PST) X-ASG-Debug-ID: 1454626965-04cb6c274629ea0001-NocioJ Received: from ipmail06.adl2.internode.on.net (ipmail06.adl2.internode.on.net [150.101.137.129]) by cuda.sgi.com with ESMTP id QHNicwrIC98MPr7n for ; Thu, 04 Feb 2016 15:02:48 -0800 (PST) X-Barracuda-Envelope-From: dave@fromorbit.com X-Barracuda-Apparent-Source-IP: 150.101.137.129 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: A2BxEwBu17NWPBATLHleKAECgw9SbYhbhEiYXwIWAQEBAQEBBoEPiw2FDIQohyxNAQEBAQEBBwEBAQFBP0ESAYRKO4ECAweIRw+hep5yhUqHU4Iqg24FlnGFS5Z1jkCCGAEBAQcBAQEBgjQoLgGBVoZTAQEB Received: from ppp121-44-19-16.lns20.syd4.internode.on.net (HELO dastard) ([121.44.19.16]) by ipmail06.adl2.internode.on.net with ESMTP; 05 Feb 2016 09:31:11 +1030 Received: from disappointment.disaster.area ([192.168.1.110] helo=disappointment) by dastard with esmtp (Exim 4.80) (envelope-from ) id 1aRStY-0000D6-Qn for xfs@oss.sgi.com; Fri, 05 Feb 2016 10:01:00 +1100 Received: from dave by disappointment with local (Exim 4.86) (envelope-from ) id 1aRStY-0004vU-Pz for xfs@oss.sgi.com; Fri, 05 Feb 2016 10:01:00 +1100 From: Dave Chinner To: xfs@oss.sgi.com Subject: [PATCH 0/3 v2] metadump/restore: fix up zeroing and accounting Date: Fri, 5 Feb 2016 10:00:55 +1100 X-ASG-Orig-Subj: [PATCH 0/3 v2] metadump/restore: fix up zeroing and accounting Message-Id: <1454626858-17823-1-git-send-email-david@fromorbit.com> X-Mailer: git-send-email 2.5.0 X-Barracuda-Connect: ipmail06.adl2.internode.on.net[150.101.137.129] X-Barracuda-Start-Time: 1454626967 X-Barracuda-URL: https://192.48.176.15:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-BRTS-Status: 1 X-Barracuda-Spam-Score: 0.00 X-Barracuda-Spam-Status: No, SCORE=0.00 using per-user scores of TAG_LEVEL=1000.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.7 tests=BSF_SC0_SA717 X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.3.26751 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 0.00 BSF_SC0_SA717 Custom Rule BSF_SC0_SA717 Hi folks, These are my pending metadump fixes - the second patch in the series still needs review - the only changes there are to fix up the leaf/node max record count indexes that Brian noticed were wrong. First posted here: http://oss.sgi.com/archives/xfs/2015-12/msg00557.html -Dave. From dave@fromorbit.com Thu Feb 4 17:03:04 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=ham version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay3.corp.sgi.com [198.149.34.15]) by oss.sgi.com (Postfix) with ESMTP id ADCA529DF9 for ; Thu, 4 Feb 2016 17:03:04 -0600 (CST) Received: from cuda.sgi.com (cuda3.sgi.com [192.48.176.15]) by relay3.corp.sgi.com (Postfix) with ESMTP id 3097FAC005 for ; Thu, 4 Feb 2016 15:03:04 -0800 (PST) X-ASG-Debug-ID: 1454626965-04cb6c274629ea0003-NocioJ Received: from ipmail06.adl2.internode.on.net (ipmail06.adl2.internode.on.net [150.101.137.129]) by cuda.sgi.com with ESMTP id xLIlp2NiE53g04Ck for ; Thu, 04 Feb 2016 15:02:58 -0800 (PST) X-Barracuda-Envelope-From: dave@fromorbit.com X-Barracuda-Apparent-Source-IP: 150.101.137.129 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: A2AtDQBu17NWPBATLHleKAECgw+BP4ZjgXidPwEBAQEBAQaRKItUTQEBAQEBAQcBAQEBQT9BEgGDbgEFJy8zCBgxOQMHFBmIGsB7hUqNawWHU48enECOQIIYAQtBGYFcKC6BV4ZTAQEB Received: from ppp121-44-19-16.lns20.syd4.internode.on.net (HELO dastard) ([121.44.19.16]) by ipmail06.adl2.internode.on.net with ESMTP; 05 Feb 2016 09:31:12 +1030 Received: from disappointment.disaster.area ([192.168.1.110] helo=disappointment) by dastard with esmtp (Exim 4.80) (envelope-from ) id 1aRStY-0000D8-RC for xfs@oss.sgi.com; Fri, 05 Feb 2016 10:01:00 +1100 Received: from dave by disappointment with local (Exim 4.86) (envelope-from ) id 1aRStY-0004vX-Qi for xfs@oss.sgi.com; Fri, 05 Feb 2016 10:01:00 +1100 From: Dave Chinner To: xfs@oss.sgi.com Subject: [PATCH 1/3] metadump: clean up btree block region zeroing Date: Fri, 5 Feb 2016 10:00:56 +1100 X-ASG-Orig-Subj: [PATCH 1/3] metadump: clean up btree block region zeroing Message-Id: <1454626858-17823-2-git-send-email-david@fromorbit.com> X-Mailer: git-send-email 2.5.0 In-Reply-To: <1454626858-17823-1-git-send-email-david@fromorbit.com> References: <1454626858-17823-1-git-send-email-david@fromorbit.com> X-Barracuda-Connect: ipmail06.adl2.internode.on.net[150.101.137.129] X-Barracuda-Start-Time: 1454626977 X-Barracuda-URL: https://192.48.176.15:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-BRTS-Status: 1 X-Barracuda-Spam-Score: 0.00 X-Barracuda-Spam-Status: No, SCORE=0.00 using per-user scores of TAG_LEVEL=1000.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.7 tests= X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.3.26751 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- From: Dave Chinner Abstract out all the common operations in the btree block zeroing so that we only have one copy of offset/len calculations and don't require lots of casts for the pointer arithmetic. Signed-off-by: Dave Chinner Tested-by: Arkadiusz Miskiewicz Reviewed-by: Brian Foster Signed-off-by: Dave Chinner --- db/metadump.c | 61 +++++++++++++++++++++++------------------------------------ 1 file changed, 24 insertions(+), 37 deletions(-) diff --git a/db/metadump.c b/db/metadump.c index 8455fdd..a185da5 100644 --- a/db/metadump.c +++ b/db/metadump.c @@ -258,8 +258,8 @@ zero_btree_node( xfs_inobt_key_t *ikp; xfs_alloc_ptr_t *app; xfs_alloc_key_t *akp; - void *zp1, *zp2; - int zlen1, zlen2; + char *zp1, *zp2; + char *key_end; nrecs = be16_to_cpu(block->bb_numrecs); @@ -268,43 +268,36 @@ zero_btree_node( case TYP_BMAPBTD: bkp = XFS_BMBT_KEY_ADDR(mp, block, 1); bpp = XFS_BMBT_PTR_ADDR(mp, block, 1, mp->m_bmap_dmxr[1]); - zp1 = &bkp[nrecs]; - zlen1 = (char *)&bpp[0] - (char *)&bkp[nrecs]; - zp2 = &bpp[nrecs]; - zlen2 = (char *)block + mp->m_sb.sb_blocksize - - (char *)&bpp[nrecs]; + zp1 = (char *)&bkp[nrecs]; + zp2 = (char *)&bpp[nrecs]; + key_end = (char *)bpp; break; case TYP_INOBT: case TYP_FINOBT: ikp = XFS_INOBT_KEY_ADDR(mp, block, 1); ipp = XFS_INOBT_PTR_ADDR(mp, block, 1, mp->m_inobt_mxr[1]); - zp1 = &ikp[nrecs]; - zlen1 = (char *)&ipp[0] - (char *)&ikp[nrecs]; - zp2 = &ipp[nrecs]; - zlen2 = (char *)block + mp->m_sb.sb_blocksize - - (char *)&ipp[nrecs]; + zp1 = (char *)&ikp[nrecs]; + zp2 = (char *)&ipp[nrecs]; + key_end = (char *)ipp; break; case TYP_BNOBT: case TYP_CNTBT: akp = XFS_ALLOC_KEY_ADDR(mp, block, 1); app = XFS_ALLOC_PTR_ADDR(mp, block, 1, mp->m_alloc_mxr[1]); - zp1 = &akp[nrecs]; - zlen1 = (char *)&app[0] - (char *)&akp[nrecs]; - zp2 = &app[nrecs]; - zlen2 = (char *)block + mp->m_sb.sb_blocksize - - (char *)&app[nrecs]; + zp1 = (char *)&akp[nrecs]; + zp2 = (char *)&app[nrecs]; + key_end = (char *)app; break; default: - zp1 = NULL; - break; + return; } - if (zp1 && zp2) { - /* Zero from end of keys to beginning of pointers */ - memset(zp1, 0, zlen1); - /* Zero from end of pointers to end of block */ - memset(zp2, 0, zlen2); - } + + /* Zero from end of keys to beginning of pointers */ + memset(zp1, 0, key_end - zp1); + + /* Zero from end of pointers to end of block */ + memset(zp2, 0, (char *)block + mp->m_sb.sb_blocksize - zp2); } static void @@ -316,8 +309,7 @@ zero_btree_leaf( struct xfs_bmbt_rec *brp; struct xfs_inobt_rec *irp; struct xfs_alloc_rec *arp; - void *zp; - int zlen; + char *zp; nrecs = be16_to_cpu(block->bb_numrecs); @@ -325,29 +317,24 @@ zero_btree_leaf( case TYP_BMAPBTA: case TYP_BMAPBTD: brp = XFS_BMBT_REC_ADDR(mp, block, 1); - zp = &brp[nrecs]; - zlen = (char *)block + mp->m_sb.sb_blocksize - (char *)&brp[nrecs]; + zp = (char *)&brp[nrecs]; break; case TYP_INOBT: case TYP_FINOBT: irp = XFS_INOBT_REC_ADDR(mp, block, 1); - zp = &irp[nrecs]; - zlen = (char *)block + mp->m_sb.sb_blocksize - (char *)&irp[nrecs]; + zp = (char *)&irp[nrecs]; break; case TYP_BNOBT: case TYP_CNTBT: arp = XFS_ALLOC_REC_ADDR(mp, block, 1); - zp = &arp[nrecs]; - zlen = (char *)block + mp->m_sb.sb_blocksize - (char *)&arp[nrecs]; + zp = (char *)&arp[nrecs]; break; default: - zp = NULL; - break; + return; } /* Zero from end of records to end of block */ - if (zp && zlen < mp->m_sb.sb_blocksize) - memset(zp, 0, zlen); + memset(zp, 0, (char *)block + mp->m_sb.sb_blocksize - zp); } static void -- 2.5.0 From dave@fromorbit.com Thu Feb 4 17:03:06 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=ham version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay3.corp.sgi.com [198.149.34.15]) by oss.sgi.com (Postfix) with ESMTP id EA20F29DF9 for ; Thu, 4 Feb 2016 17:03:05 -0600 (CST) Received: from cuda.sgi.com (cuda3.sgi.com [192.48.176.15]) by relay3.corp.sgi.com (Postfix) with ESMTP id 72C40AC005 for ; Thu, 4 Feb 2016 15:03:02 -0800 (PST) X-ASG-Debug-ID: 1454626965-04cb6c274629ea0002-NocioJ Received: from ipmail06.adl2.internode.on.net (ipmail06.adl2.internode.on.net [150.101.137.129]) by cuda.sgi.com with ESMTP id 9FzCObN2bDgXFtEV for ; Thu, 04 Feb 2016 15:02:56 -0800 (PST) X-Barracuda-Envelope-From: dave@fromorbit.com X-Barracuda-Apparent-Source-IP: 150.101.137.129 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: A2AtDQBu17NWPBATLHleKAECgw+BP4ZjgXidPwEBAQEBAQaRKItUTQEBAQEBAQcBAQEBQT9BEgGDbgEFVjMIGBgZOQMHFBmIGsB7hUqJcA2DbgWWcY8qh2iFLkSNfIIYAQs+HIFcKC6BV4ZTAQEB Received: from ppp121-44-19-16.lns20.syd4.internode.on.net (HELO dastard) ([121.44.19.16]) by ipmail06.adl2.internode.on.net with ESMTP; 05 Feb 2016 09:31:11 +1030 Received: from disappointment.disaster.area ([192.168.1.110] helo=disappointment) by dastard with esmtp (Exim 4.80) (envelope-from ) id 1aRStY-0000DA-Su for xfs@oss.sgi.com; Fri, 05 Feb 2016 10:01:00 +1100 Received: from dave by disappointment with local (Exim 4.86) (envelope-from ) id 1aRStY-0004vh-SR for xfs@oss.sgi.com; Fri, 05 Feb 2016 10:01:00 +1100 From: Dave Chinner To: xfs@oss.sgi.com Subject: [PATCH 3/3] xfs_mdrestore: correctly account bytes read Date: Fri, 5 Feb 2016 10:00:58 +1100 X-ASG-Orig-Subj: [PATCH 3/3] xfs_mdrestore: correctly account bytes read Message-Id: <1454626858-17823-4-git-send-email-david@fromorbit.com> X-Mailer: git-send-email 2.5.0 In-Reply-To: <1454626858-17823-1-git-send-email-david@fromorbit.com> References: <1454626858-17823-1-git-send-email-david@fromorbit.com> X-Barracuda-Connect: ipmail06.adl2.internode.on.net[150.101.137.129] X-Barracuda-Start-Time: 1454626974 X-Barracuda-URL: https://192.48.176.15:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-BRTS-Status: 1 X-Barracuda-Spam-Score: 0.00 X-Barracuda-Spam-Status: No, SCORE=0.00 using per-user scores of TAG_LEVEL=1000.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.7 tests= X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.3.26751 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- From: Dave Chinner Progess indication comes in the form of a "X MB read" output. This doesn't match up with the actual number of bytes read from the metadump file because it only accounts header blocks in the file, not actual metadata blocks that are restored, Hence the number reported is usually much lower than the size of the metadump file, hence it's impossible to use to gauge progress of the restore. While there, fix the progress output so that it overwrites the previous progress output line correctly. Signed-off-by: Dave Chinner Reviewed-by: Brian Foster Signed-off-by: Dave Chinner --- mdrestore/xfs_mdrestore.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/mdrestore/xfs_mdrestore.c b/mdrestore/xfs_mdrestore.c index ebc5e54..70a160c 100644 --- a/mdrestore/xfs_mdrestore.c +++ b/mdrestore/xfs_mdrestore.c @@ -133,7 +133,7 @@ perform_restore( for (;;) { if (show_progress && (bytes_read & ((1 << 20) - 1)) == 0) - print_progress("%lld MB read\n", bytes_read >> 20); + print_progress("%lld MB read", bytes_read >> 20); for (cur_index = 0; cur_index < mb_count; cur_index++) { if (pwrite64(dst_fd, &block_buffer[cur_index << @@ -160,7 +160,7 @@ perform_restore( 1, src_f) != 1) fatal("error reading from file: %s\n", strerror(errno)); - bytes_read += block_size; + bytes_read += block_size + (mb_count << tmb.mb_blocklog); } if (progress_since_warning) -- 2.5.0 From dave@fromorbit.com Thu Feb 4 17:03:10 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=ham version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay3.corp.sgi.com [198.149.34.15]) by oss.sgi.com (Postfix) with ESMTP id A16E929E05 for ; Thu, 4 Feb 2016 17:03:10 -0600 (CST) Received: from cuda.sgi.com (cuda2.sgi.com [192.48.176.25]) by relay3.corp.sgi.com (Postfix) with ESMTP id 336E6AC001 for ; Thu, 4 Feb 2016 15:03:10 -0800 (PST) X-ASG-Debug-ID: 1454626976-04cbb04cfc43090001-NocioJ Received: from ipmail06.adl2.internode.on.net (ipmail06.adl2.internode.on.net [150.101.137.129]) by cuda.sgi.com with ESMTP id VpgJtA2GPOcMSDqT for ; Thu, 04 Feb 2016 15:02:56 -0800 (PST) X-Barracuda-Envelope-From: dave@fromorbit.com X-Barracuda-Apparent-Source-IP: 150.101.137.129 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: A2AtDQBu17NWPBATLHleKAECgw+BP4ZjgXidPwEBAQEBAQaRKItUTQEBAQEBAQcBAQEBQT9BEgGDbgEFJy8zCBgxOQMHFBmIGsB7hUqJfYNuBYdQhwSIHZxAjkCCGAELQRmBXCgugVeGUwEBAQ Received: from ppp121-44-19-16.lns20.syd4.internode.on.net (HELO dastard) ([121.44.19.16]) by ipmail06.adl2.internode.on.net with ESMTP; 05 Feb 2016 09:31:11 +1030 Received: from disappointment.disaster.area ([192.168.1.110] helo=disappointment) by dastard with esmtp (Exim 4.80) (envelope-from ) id 1aRStY-0000D9-ST for xfs@oss.sgi.com; Fri, 05 Feb 2016 10:01:00 +1100 Received: from dave by disappointment with local (Exim 4.86) (envelope-from ) id 1aRStY-0004vc-R6 for xfs@oss.sgi.com; Fri, 05 Feb 2016 10:01:00 +1100 From: Dave Chinner To: xfs@oss.sgi.com Subject: [PATCH 2/3] metadump: bounds check btree block regions being zeroed Date: Fri, 5 Feb 2016 10:00:57 +1100 X-ASG-Orig-Subj: [PATCH 2/3] metadump: bounds check btree block regions being zeroed Message-Id: <1454626858-17823-3-git-send-email-david@fromorbit.com> X-Mailer: git-send-email 2.5.0 In-Reply-To: <1454626858-17823-1-git-send-email-david@fromorbit.com> References: <1454626858-17823-1-git-send-email-david@fromorbit.com> X-Barracuda-Connect: ipmail06.adl2.internode.on.net[150.101.137.129] X-Barracuda-Start-Time: 1454626976 X-Barracuda-URL: https://192.48.176.25:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-BRTS-Status: 1 X-Barracuda-Spam-Score: 0.00 X-Barracuda-Spam-Status: No, SCORE=0.00 using per-user scores of TAG_LEVEL=1000.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.7 tests= X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.3.26751 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- From: Dave Chinner Arkadiusz Miskiewicz reported that metadump was crashing on one of his corrupted filesystems, and the trace indicated that it was zeroing unused regions in inode btree blocks when it failed. The btree block had a corrupt nrecs field, which was resulting in an out of bounds memset() occurring. Ensure that the region being generated for zeroing is within bounds before executing the zeroing. Reported-by: Arkadiusz Miskiewicz Signed-off-by: Dave Chinner --- db/metadump.c | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) diff --git a/db/metadump.c b/db/metadump.c index a185da5..26a3bd5 100644 --- a/db/metadump.c +++ b/db/metadump.c @@ -246,6 +246,11 @@ write_buf( return seenint() ? -EINTR : 0; } +/* + * We could be processing a corrupt block, so we can't trust any of + * the offsets or lengths to be within the buffer range. Hence check + * carefully! + */ static void zero_btree_node( struct xfs_btree_block *block, @@ -262,10 +267,15 @@ zero_btree_node( char *key_end; nrecs = be16_to_cpu(block->bb_numrecs); + if (nrecs < 0) + return; switch (btype) { case TYP_BMAPBTA: case TYP_BMAPBTD: + if (nrecs > mp->m_bmap_dmxr[1]) + return; + bkp = XFS_BMBT_KEY_ADDR(mp, block, 1); bpp = XFS_BMBT_PTR_ADDR(mp, block, 1, mp->m_bmap_dmxr[1]); zp1 = (char *)&bkp[nrecs]; @@ -274,6 +284,9 @@ zero_btree_node( break; case TYP_INOBT: case TYP_FINOBT: + if (nrecs > mp->m_inobt_mxr[1]) + return; + ikp = XFS_INOBT_KEY_ADDR(mp, block, 1); ipp = XFS_INOBT_PTR_ADDR(mp, block, 1, mp->m_inobt_mxr[1]); zp1 = (char *)&ikp[nrecs]; @@ -282,6 +295,9 @@ zero_btree_node( break; case TYP_BNOBT: case TYP_CNTBT: + if (nrecs > mp->m_alloc_mxr[1]) + return; + akp = XFS_ALLOC_KEY_ADDR(mp, block, 1); app = XFS_ALLOC_PTR_ADDR(mp, block, 1, mp->m_alloc_mxr[1]); zp1 = (char *)&akp[nrecs]; @@ -300,6 +316,11 @@ zero_btree_node( memset(zp2, 0, (char *)block + mp->m_sb.sb_blocksize - zp2); } +/* + * We could be processing a corrupt block, so we can't trust any of + * the offsets or lengths to be within the buffer range. Hence check + * carefully! + */ static void zero_btree_leaf( struct xfs_btree_block *block, @@ -312,20 +333,31 @@ zero_btree_leaf( char *zp; nrecs = be16_to_cpu(block->bb_numrecs); + if (nrecs < 0) + return; switch (btype) { case TYP_BMAPBTA: case TYP_BMAPBTD: + if (nrecs > mp->m_bmap_dmxr[0]) + return; + brp = XFS_BMBT_REC_ADDR(mp, block, 1); zp = (char *)&brp[nrecs]; break; case TYP_INOBT: case TYP_FINOBT: + if (nrecs > mp->m_inobt_mxr[0]) + return; + irp = XFS_INOBT_REC_ADDR(mp, block, 1); zp = (char *)&irp[nrecs]; break; case TYP_BNOBT: case TYP_CNTBT: + if (nrecs > mp->m_alloc_mxr[0]) + return; + arp = XFS_ALLOC_REC_ADDR(mp, block, 1); zp = (char *)&arp[nrecs]; break; -- 2.5.0 From dave@fromorbit.com Thu Feb 4 17:07:33 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=ham version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay2.corp.sgi.com [137.38.102.29]) by oss.sgi.com (Postfix) with ESMTP id B13177CA2 for ; Thu, 4 Feb 2016 17:07:33 -0600 (CST) Received: from cuda.sgi.com (cuda3.sgi.com [192.48.176.15]) by relay2.corp.sgi.com (Postfix) with ESMTP id 9E885304051 for ; Thu, 4 Feb 2016 15:07:33 -0800 (PST) X-ASG-Debug-ID: 1454627250-04cb6c27452a0c0001-NocioJ Received: from ipmail06.adl2.internode.on.net (ipmail06.adl2.internode.on.net [150.101.137.129]) by cuda.sgi.com with ESMTP id enJ7Qag7pfWHbzqJ for ; Thu, 04 Feb 2016 15:07:30 -0800 (PST) X-Barracuda-Envelope-From: dave@fromorbit.com X-Barracuda-Apparent-Source-IP: 150.101.137.129 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: A2AtDQCV2LNWPBATLHleKAECgw+BP4ZjgXidPwEBAQEBAQaRKItUTQEBAQEBAQcBAQEBQT9BEgGDbgEFJy8zCBgxOQMHFBmIGsB+hUqNawWHU48enECOQIIYAQtBGYFcKC6BV4ZTAQEB Received: from ppp121-44-19-16.lns20.syd4.internode.on.net (HELO dastard) ([121.44.19.16]) by ipmail06.adl2.internode.on.net with ESMTP; 05 Feb 2016 09:35:11 +1030 Received: from disappointment.disaster.area ([192.168.1.110] helo=disappointment) by dastard with esmtp (Exim 4.80) (envelope-from ) id 1aRSxa-0000Ea-Ak for xfs@oss.sgi.com; Fri, 05 Feb 2016 10:05:10 +1100 Received: from dave by disappointment with local (Exim 4.86) (envelope-from ) id 1aRSxa-0004yr-AG for xfs@oss.sgi.com; Fri, 05 Feb 2016 10:05:10 +1100 From: Dave Chinner To: xfs@oss.sgi.com Subject: [PATCH 1/7] repair: parallelise phase 7 Date: Fri, 5 Feb 2016 10:05:02 +1100 X-ASG-Orig-Subj: [PATCH 1/7] repair: parallelise phase 7 Message-Id: <1454627108-19036-2-git-send-email-david@fromorbit.com> X-Mailer: git-send-email 2.5.0 In-Reply-To: <1454627108-19036-1-git-send-email-david@fromorbit.com> References: <1454627108-19036-1-git-send-email-david@fromorbit.com> X-Barracuda-Connect: ipmail06.adl2.internode.on.net[150.101.137.129] X-Barracuda-Start-Time: 1454627250 X-Barracuda-URL: https://192.48.176.15:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-BRTS-Status: 1 X-Barracuda-Spam-Score: 0.00 X-Barracuda-Spam-Status: No, SCORE=0.00 using per-user scores of TAG_LEVEL=1000.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.7 tests= X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.3.26751 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- From: Dave Chinner It operates on a single AG at a time, sequentially, doing inode updates. All the data structures accessed and modified are per AG, as are the modification to on-disk structures. Hence we can run this phase concurrently across multiple AGs. This is important for large, broken filesystem repairs, where there can be millions of inodes that need link counts updated. Once such repair image takes more than 45 minutes to run phase 7 as a single threaded operation. Signed-off-by: Dave Chinner Reviewed-by: Brian Foster Signed-off-by: Dave Chinner --- repair/phase7.c | 77 ++++++++++++++++++++++++++++++++++------------------- repair/progress.c | 4 +-- repair/protos.h | 2 +- repair/xfs_repair.c | 2 +- 4 files changed, 54 insertions(+), 31 deletions(-) diff --git a/repair/phase7.c b/repair/phase7.c index b1e3a55..91dad02 100644 --- a/repair/phase7.c +++ b/repair/phase7.c @@ -26,6 +26,7 @@ #include "dinode.h" #include "versions.h" #include "progress.h" +#include "threads.h" /* dinoc is a pointer to the IN-CORE dinode core */ static void @@ -108,45 +109,67 @@ update_inode_nlinks( IRELE(ip); } -void -phase7(xfs_mount_t *mp) +/* + * for each ag, look at each inode 1 at a time. If the number of + * links is bad, reset it, log the inode core, commit the transaction + */ +static void +do_link_updates( + struct work_queue *wq, + xfs_agnumber_t agno, + void *arg) { ino_tree_node_t *irec; - int i; int j; __uint32_t nrefs; + irec = findfirst_inode_rec(agno); + + while (irec != NULL) { + for (j = 0; j < XFS_INODES_PER_CHUNK; j++) { + ASSERT(is_inode_confirmed(irec, j)); + + if (is_inode_free(irec, j)) + continue; + + ASSERT(no_modify || is_inode_reached(irec, j)); + + nrefs = num_inode_references(irec, j); + ASSERT(no_modify || nrefs > 0); + + if (get_inode_disk_nlinks(irec, j) != nrefs) + update_inode_nlinks(wq->mp, + XFS_AGINO_TO_INO(wq->mp, agno, + irec->ino_startnum + j), + nrefs); + } + irec = next_ino_rec(irec); + } + + PROG_RPT_INC(prog_rpt_done[agno], 1); +} + +void +phase7( + struct xfs_mount *mp, + int scan_threads) +{ + struct work_queue wq; + int agno; + if (!no_modify) do_log(_("Phase 7 - verify and correct link counts...\n")); else do_log(_("Phase 7 - verify link counts...\n")); - /* - * for each ag, look at each inode 1 at a time. If the number of - * links is bad, reset it, log the inode core, commit the transaction - */ - for (i = 0; i < glob_agcount; i++) { - irec = findfirst_inode_rec(i); - - while (irec != NULL) { - for (j = 0; j < XFS_INODES_PER_CHUNK; j++) { - ASSERT(is_inode_confirmed(irec, j)); + set_progress_msg(PROGRESS_FMT_CORR_LINK, (__uint64_t) glob_agcount); - if (is_inode_free(irec, j)) - continue; + create_work_queue(&wq, mp, scan_threads); - ASSERT(no_modify || is_inode_reached(irec, j)); + for (agno = 0; agno < mp->m_sb.sb_agcount; agno++) + queue_work(&wq, do_link_updates, agno, NULL); - nrefs = num_inode_references(irec, j); - ASSERT(no_modify || nrefs > 0); + destroy_work_queue(&wq); - if (get_inode_disk_nlinks(irec, j) != nrefs) - update_inode_nlinks(mp, - XFS_AGINO_TO_INO(mp, i, - irec->ino_startnum + j), - nrefs); - } - irec = next_ino_rec(irec); - } - } + print_final_rpt(); } diff --git a/repair/progress.c b/repair/progress.c index 418b803..2a09b23 100644 --- a/repair/progress.c +++ b/repair/progress.c @@ -75,9 +75,9 @@ progress_rpt_t progress_rpt_reports[] = { {FMT2, N_("moving disconnected inodes to lost+found"), /* 12 */ &rpt_fmts[FMT2], &rpt_types[TYPE_INODE]}, {FMT1, N_("verify and correct link counts"), /* 13 */ - &rpt_fmts[FMT1], &rpt_types[TYPE_INODE]}, + &rpt_fmts[FMT1], &rpt_types[TYPE_AG]}, {FMT1, N_("verify link counts"), /* 14 */ - &rpt_fmts[FMT1], &rpt_types[TYPE_INODE]} + &rpt_fmts[FMT1], &rpt_types[TYPE_AG]} }; pthread_t report_thread; diff --git a/repair/protos.h b/repair/protos.h index 9d5a2a6..b113aca 100644 --- a/repair/protos.h +++ b/repair/protos.h @@ -50,7 +50,7 @@ void phase3(struct xfs_mount *); void phase4(struct xfs_mount *); void phase5(struct xfs_mount *); void phase6(struct xfs_mount *); -void phase7(struct xfs_mount *); +void phase7(struct xfs_mount *, int); int verify_set_agheader(struct xfs_mount *, struct xfs_buf *, struct xfs_sb *, struct xfs_agf *, struct xfs_agi *, diff --git a/repair/xfs_repair.c b/repair/xfs_repair.c index 3eaced4..fcdb212 100644 --- a/repair/xfs_repair.c +++ b/repair/xfs_repair.c @@ -893,7 +893,7 @@ main(int argc, char **argv) phase6(mp); timestamp(PHASE_END, 6, NULL); - phase7(mp); + phase7(mp, phase2_threads); timestamp(PHASE_END, 7, NULL); } else { do_warn( -- 2.5.0 From dave@fromorbit.com Thu Feb 4 17:07:35 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=ham version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay1.corp.sgi.com [137.38.102.111]) by oss.sgi.com (Postfix) with ESMTP id A4FE37CA2 for ; Thu, 4 Feb 2016 17:07:35 -0600 (CST) Received: from cuda.sgi.com (cuda3.sgi.com [192.48.176.15]) by relay1.corp.sgi.com (Postfix) with ESMTP id 957A18F8033 for ; Thu, 4 Feb 2016 15:07:35 -0800 (PST) X-ASG-Debug-ID: 1454627250-04cb6c27452a0c0002-NocioJ Received: from ipmail06.adl2.internode.on.net (ipmail06.adl2.internode.on.net [150.101.137.129]) by cuda.sgi.com with ESMTP id EjSUbYa5d26zmx8r for ; Thu, 04 Feb 2016 15:07:33 -0800 (PST) X-Barracuda-Envelope-From: dave@fromorbit.com X-Barracuda-Apparent-Source-IP: 150.101.137.129 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: A2BxEwCV2LNWPBATLHleKAECgw9SbYhbhEiYXwIWAQEBAQEBBoEPiw2FDIQohyxNAQEBAQEBBwEBAQFBP0ESAYRKO4ECAweIRw+he550hUqHU4Iqg24FlnGFS5Z1jkCCGAEBAQcBAQEBgjQoLgGBVoZTAQEB Received: from ppp121-44-19-16.lns20.syd4.internode.on.net (HELO dastard) ([121.44.19.16]) by ipmail06.adl2.internode.on.net with ESMTP; 05 Feb 2016 09:35:11 +1030 Received: from disappointment.disaster.area ([192.168.1.110] helo=disappointment) by dastard with esmtp (Exim 4.80) (envelope-from ) id 1aRSxa-0000EZ-AO for xfs@oss.sgi.com; Fri, 05 Feb 2016 10:05:10 +1100 Received: from dave by disappointment with local (Exim 4.86) (envelope-from ) id 1aRSxa-0004yo-9q for xfs@oss.sgi.com; Fri, 05 Feb 2016 10:05:10 +1100 From: Dave Chinner To: xfs@oss.sgi.com Subject: [PATCH 1/7 v2] repair: big broken filesystems cause pain Date: Fri, 5 Feb 2016 10:05:01 +1100 X-ASG-Orig-Subj: [PATCH 1/7 v2] repair: big broken filesystems cause pain Message-Id: <1454627108-19036-1-git-send-email-david@fromorbit.com> X-Mailer: git-send-email 2.5.0 X-Barracuda-Connect: ipmail06.adl2.internode.on.net[150.101.137.129] X-Barracuda-Start-Time: 1454627252 X-Barracuda-URL: https://192.48.176.15:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-BRTS-Status: 1 X-Barracuda-Spam-Score: 0.00 X-Barracuda-Spam-Status: No, SCORE=0.00 using per-user scores of TAG_LEVEL=1000.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.7 tests=BSF_SC0_SA717 X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.3.26751 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 0.00 BSF_SC0_SA717 Custom Rule BSF_SC0_SA717 Hi folks, This is a followup to the original series I posted here: http://oss.sgi.com/archives/xfs/2015-12/msg00557.html This addresses Brian's review comments for patch 3 - the da tree node splitting doesn't use extra blocks for the root split - and includes the patch I missed in the original patch posting to reset the dirty buffer priority when it is looked up again (patch 7). Otherwise the patch series is unchanged. -Dave. From dave@fromorbit.com Thu Feb 4 17:07:37 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=ham version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay2.corp.sgi.com [137.38.102.29]) by oss.sgi.com (Postfix) with ESMTP id 8A81729E00 for ; Thu, 4 Feb 2016 17:07:37 -0600 (CST) Received: from cuda.sgi.com (cuda3.sgi.com [192.48.176.15]) by relay2.corp.sgi.com (Postfix) with ESMTP id 6BDBD30405F for ; Thu, 4 Feb 2016 15:07:37 -0800 (PST) X-ASG-Debug-ID: 1454627250-04cb6c27452a0c0003-NocioJ Received: from ipmail06.adl2.internode.on.net (ipmail06.adl2.internode.on.net [150.101.137.129]) by cuda.sgi.com with ESMTP id Au3Uz2y3g5COds5N for ; Thu, 04 Feb 2016 15:07:35 -0800 (PST) X-Barracuda-Envelope-From: dave@fromorbit.com X-Barracuda-Apparent-Source-IP: 150.101.137.129 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: A2AtDQCV2LNWPBATLHleKAECgw+BP4ZjgXidPwEBAQEBAQaRKItUTQEBAQEBAQcBAQEBQT9BEgGDbgEFJy8zCBgxOQMHFBmIGsB+hUqJfYNuBZZxnECOQIIYAQtAGoFcKC6BV4ZTAQEB Received: from ppp121-44-19-16.lns20.syd4.internode.on.net (HELO dastard) ([121.44.19.16]) by ipmail06.adl2.internode.on.net with ESMTP; 05 Feb 2016 09:35:11 +1030 Received: from disappointment.disaster.area ([192.168.1.110] helo=disappointment) by dastard with esmtp (Exim 4.80) (envelope-from ) id 1aRSxa-0000Eg-DC for xfs@oss.sgi.com; Fri, 05 Feb 2016 10:05:10 +1100 Received: from dave by disappointment with local (Exim 4.86) (envelope-from ) id 1aRSxa-0004zL-Cb for xfs@oss.sgi.com; Fri, 05 Feb 2016 10:05:10 +1100 From: Dave Chinner To: xfs@oss.sgi.com Subject: [PATCH 7/7] libxfs: reset dirty buffer priority on lookup Date: Fri, 5 Feb 2016 10:05:08 +1100 X-ASG-Orig-Subj: [PATCH 7/7] libxfs: reset dirty buffer priority on lookup Message-Id: <1454627108-19036-8-git-send-email-david@fromorbit.com> X-Mailer: git-send-email 2.5.0 In-Reply-To: <1454627108-19036-1-git-send-email-david@fromorbit.com> References: <1454627108-19036-1-git-send-email-david@fromorbit.com> X-Barracuda-Connect: ipmail06.adl2.internode.on.net[150.101.137.129] X-Barracuda-Start-Time: 1454627254 X-Barracuda-URL: https://192.48.176.15:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-BRTS-Status: 1 X-Barracuda-Spam-Score: 0.00 X-Barracuda-Spam-Status: No, SCORE=0.00 using per-user scores of TAG_LEVEL=1000.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.7 tests= X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.3.26751 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- From: Dave Chinner When a buffer on the dirty MRU is looked up and found, we remove the buffer from the MRU. However, we've already set the priority ofthe buffer to "dirty" so when we are donw with it it will go back on the dirty buffer MRU regardless of whether it needs to or not. Hence when we move a buffer to a the dirty MRU, reocrd the old priority and restore it when we remove the buffer from the MRU on lookup. This will prevent us from putting fixed, now writeable buffers back on the dirty MRU and allow the cache routine to write, shake and reclaim the buffers once they are clean. Signed-off-by: Dave Chinner --- include/cache.h | 1 + libxfs/cache.c | 7 +++++++ 2 files changed, 8 insertions(+) diff --git a/include/cache.h b/include/cache.h index 55761d3..3a989d7 100644 --- a/include/cache.h +++ b/include/cache.h @@ -99,6 +99,7 @@ struct cache_node { unsigned int cn_count; /* reference count */ unsigned int cn_hashidx; /* hash chain index */ int cn_priority; /* priority, -1 = free list */ + int cn_old_priority;/* saved pre-dirty prio */ pthread_mutex_t cn_mutex; /* node mutex */ }; diff --git a/libxfs/cache.c b/libxfs/cache.c index d4b4a4e..0398be3 100644 --- a/libxfs/cache.c +++ b/libxfs/cache.c @@ -197,6 +197,7 @@ cache_move_to_dirty_mru( mru = &cache->c_mrus[CACHE_DIRTY_PRIORITY]; pthread_mutex_lock(&mru->cm_mutex); + node->cn_old_priority = node->cn_priority; node->cn_priority = CACHE_DIRTY_PRIORITY; list_move(&node->cn_mru, &mru->cm_list); mru->cm_count++; @@ -325,6 +326,7 @@ cache_node_allocate( list_head_init(&node->cn_mru); node->cn_count = 1; node->cn_priority = 0; + node->cn_old_priority = -1; return node; } @@ -434,6 +436,10 @@ cache_node_get( mru->cm_count--; list_del_init(&node->cn_mru); pthread_mutex_unlock(&mru->cm_mutex); + if (node->cn_old_priority != -1) { + node->cn_priority = node->cn_old_priority; + node->cn_old_priority = -1; + } } node->cn_count++; @@ -534,6 +540,7 @@ cache_node_set_priority( pthread_mutex_lock(&node->cn_mutex); ASSERT(node->cn_count > 0); node->cn_priority = priority; + node->cn_old_priority = -1; pthread_mutex_unlock(&node->cn_mutex); } -- 2.5.0 From dave@fromorbit.com Thu Feb 4 17:07:37 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=ham version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay3.corp.sgi.com [198.149.34.15]) by oss.sgi.com (Postfix) with ESMTP id 46BD229DFE for ; Thu, 4 Feb 2016 17:07:37 -0600 (CST) Received: from cuda.sgi.com (cuda2.sgi.com [192.48.176.25]) by relay3.corp.sgi.com (Postfix) with ESMTP id BDB9CAC006 for ; Thu, 4 Feb 2016 15:07:36 -0800 (PST) X-ASG-Debug-ID: 1454627253-04cbb04cfb43370001-NocioJ Received: from ipmail06.adl2.internode.on.net (ipmail06.adl2.internode.on.net [150.101.137.129]) by cuda.sgi.com with ESMTP id v9IdJmCj0AvKP0Cw for ; Thu, 04 Feb 2016 15:07:34 -0800 (PST) X-Barracuda-Envelope-From: dave@fromorbit.com X-Barracuda-Apparent-Source-IP: 150.101.137.129 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: A2AtDQCV2LNWPBATLHleKAECgw+BP4ZjgXidPwEBAQEBAQaRKItUTQEBAQEBAQcBAQEBQT9BEgGDbgEFJy8zCBgxOQMHFBmIGsB+hUqNawWHU48enECOQIIYAQtAARmBXCgugVeGUwEBAQ Received: from ppp121-44-19-16.lns20.syd4.internode.on.net (HELO dastard) ([121.44.19.16]) by ipmail06.adl2.internode.on.net with ESMTP; 05 Feb 2016 09:35:11 +1030 Received: from disappointment.disaster.area ([192.168.1.110] helo=disappointment) by dastard with esmtp (Exim 4.80) (envelope-from ) id 1aRSxa-0000Ed-Bz for xfs@oss.sgi.com; Fri, 05 Feb 2016 10:05:10 +1100 Received: from dave by disappointment with local (Exim 4.86) (envelope-from ) id 1aRSxa-0004z6-BP for xfs@oss.sgi.com; Fri, 05 Feb 2016 10:05:10 +1100 From: Dave Chinner To: xfs@oss.sgi.com Subject: [PATCH 4/7] libxfs: don't discard dirty buffers Date: Fri, 5 Feb 2016 10:05:05 +1100 X-ASG-Orig-Subj: [PATCH 4/7] libxfs: don't discard dirty buffers Message-Id: <1454627108-19036-5-git-send-email-david@fromorbit.com> X-Mailer: git-send-email 2.5.0 In-Reply-To: <1454627108-19036-1-git-send-email-david@fromorbit.com> References: <1454627108-19036-1-git-send-email-david@fromorbit.com> X-Barracuda-Connect: ipmail06.adl2.internode.on.net[150.101.137.129] X-Barracuda-Start-Time: 1454627253 X-Barracuda-URL: https://192.48.176.25:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-BRTS-Status: 1 X-Barracuda-Spam-Score: 0.00 X-Barracuda-Spam-Status: No, SCORE=0.00 using per-user scores of TAG_LEVEL=1000.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.7 tests= X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.3.26751 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- From: Dave Chinner When we release a buffer from the cache, if it is dirty we wite it to disk then put the buffer on the free list for recycling. However, if the write fails (e.g. verifier failure due unfixed corruption) we effectively throw the buffer and it contents away. This causes all sorts of problems for xfs_repair as it then re-reads the buffer from disk on the next access and hence loses all the corrections that had previously been made, resulting in tripping over corruptions in code that assumes the corruptions have already been fixed/flagged in the buffer it receives. TO fix this, we have to make the cache aware that writes can fail, and keep the buffer in cache when writes fail. Hence we have to add an explicit error notification to the flush operation, and we need to do that before we release the buffer to the free list. This also means that we need to remove the writeback code from the release mechanisms, instead replacing them with assertions that the buffers are already clean. Signed-off-by: Dave Chinner Reviewed-by: Brian Foster Signed-off-by: Dave Chinner --- include/cache.h | 2 +- libxfs/cache.c | 15 ++++++++++++++- libxfs/rdwr.c | 44 +++++++++++++++++++++++++++----------------- 3 files changed, 42 insertions(+), 19 deletions(-) diff --git a/include/cache.h b/include/cache.h index 0a84c69..87826be 100644 --- a/include/cache.h +++ b/include/cache.h @@ -64,7 +64,7 @@ typedef void *cache_key_t; typedef void (*cache_walk_t)(struct cache_node *); typedef struct cache_node * (*cache_node_alloc_t)(cache_key_t); -typedef void (*cache_node_flush_t)(struct cache_node *); +typedef int (*cache_node_flush_t)(struct cache_node *); typedef void (*cache_node_relse_t)(struct cache_node *); typedef unsigned int (*cache_node_hash_t)(cache_key_t, unsigned int, unsigned int); diff --git a/libxfs/cache.c b/libxfs/cache.c index 4753a1d..a48ebd9 100644 --- a/libxfs/cache.c +++ b/libxfs/cache.c @@ -219,6 +219,12 @@ cache_shake( if (pthread_mutex_trylock(&node->cn_mutex) != 0) continue; + /* can't release dirty objects */ + if (cache->flush(node)) { + pthread_mutex_unlock(&node->cn_mutex); + continue; + } + hash = cache->c_hash + node->cn_hashidx; if (pthread_mutex_trylock(&hash->ch_mutex) != 0) { pthread_mutex_unlock(&node->cn_mutex); @@ -311,6 +317,13 @@ __cache_node_purge( pthread_mutex_unlock(&node->cn_mutex); return count; } + + /* can't purge dirty objects */ + if (cache->flush(node)) { + pthread_mutex_unlock(&node->cn_mutex); + return 1; + } + mru = &cache->c_mrus[node->cn_priority]; pthread_mutex_lock(&mru->cm_mutex); list_del_init(&node->cn_mru); @@ -321,7 +334,7 @@ __cache_node_purge( pthread_mutex_destroy(&node->cn_mutex); list_del_init(&node->cn_hash); cache->relse(node); - return count; + return 0; } /* diff --git a/libxfs/rdwr.c b/libxfs/rdwr.c index 7b23394..37162cd 100644 --- a/libxfs/rdwr.c +++ b/libxfs/rdwr.c @@ -659,6 +659,8 @@ __libxfs_getbufr(int blen) bp = kmem_zone_zalloc(xfs_buf_zone, 0); pthread_mutex_unlock(&xfs_buf_freelist.cm_mutex); bp->b_ops = NULL; + if (bp->b_flags & LIBXFS_B_DIRTY) + fprintf(stderr, "found dirty buffer (bulk) on free list!"); return bp; } @@ -1223,23 +1225,26 @@ libxfs_iomove(xfs_buf_t *bp, uint boff, int len, void *data, int flags) } static void -libxfs_brelse(struct cache_node *node) +libxfs_brelse( + struct cache_node *node) { - xfs_buf_t *bp = (xfs_buf_t *)node; + struct xfs_buf *bp = (struct xfs_buf *)node; - if (bp != NULL) { - if (bp->b_flags & LIBXFS_B_DIRTY) - libxfs_writebufr(bp); - pthread_mutex_lock(&xfs_buf_freelist.cm_mutex); - list_add(&bp->b_node.cn_mru, &xfs_buf_freelist.cm_list); - pthread_mutex_unlock(&xfs_buf_freelist.cm_mutex); - } + if (!bp) + return; + if (bp->b_flags & LIBXFS_B_DIRTY) + fprintf(stderr, + "releasing dirty buffer to free list!"); + + pthread_mutex_lock(&xfs_buf_freelist.cm_mutex); + list_add(&bp->b_node.cn_mru, &xfs_buf_freelist.cm_list); + pthread_mutex_unlock(&xfs_buf_freelist.cm_mutex); } static unsigned int libxfs_bulkrelse( - struct cache *cache, - struct list_head *list) + struct cache *cache, + struct list_head *list) { xfs_buf_t *bp; int count = 0; @@ -1249,7 +1254,8 @@ libxfs_bulkrelse( list_for_each_entry(bp, list, b_node.cn_mru) { if (bp->b_flags & LIBXFS_B_DIRTY) - libxfs_writebufr(bp); + fprintf(stderr, + "releasing dirty buffer (bulk) to free list!"); count++; } @@ -1260,18 +1266,22 @@ libxfs_bulkrelse( return count; } -static void -libxfs_bflush(struct cache_node *node) +static int +libxfs_bflush( + struct cache_node *node) { - xfs_buf_t *bp = (xfs_buf_t *)node; + struct xfs_buf *bp = (struct xfs_buf *)node; - if ((bp != NULL) && (bp->b_flags & LIBXFS_B_DIRTY)) - libxfs_writebufr(bp); + if (bp->b_flags & LIBXFS_B_DIRTY) + return libxfs_writebufr(bp); + return 0; } void libxfs_putbufr(xfs_buf_t *bp) { + if (bp->b_flags & LIBXFS_B_DIRTY) + libxfs_writebufr(bp); libxfs_brelse((struct cache_node *)bp); } -- 2.5.0 From dave@fromorbit.com Thu Feb 4 17:07:38 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=ham version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay2.corp.sgi.com [137.38.102.29]) by oss.sgi.com (Postfix) with ESMTP id 8DD6B29E03 for ; Thu, 4 Feb 2016 17:07:38 -0600 (CST) Received: from cuda.sgi.com (cuda2.sgi.com [192.48.176.25]) by relay2.corp.sgi.com (Postfix) with ESMTP id 7CE72304059 for ; Thu, 4 Feb 2016 15:07:38 -0800 (PST) X-ASG-Debug-ID: 1454627253-04cbb04cfb43370002-NocioJ Received: from ipmail06.adl2.internode.on.net (ipmail06.adl2.internode.on.net [150.101.137.129]) by cuda.sgi.com with ESMTP id QMoB6DDbRGZqs9OP for ; Thu, 04 Feb 2016 15:07:36 -0800 (PST) X-Barracuda-Envelope-From: dave@fromorbit.com X-Barracuda-Apparent-Source-IP: 150.101.137.129 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: A2CZEQCV2LNWPBATLHleKAECgw9+QYZjgXidPwEBAQEBAQaRKItUTQEBAQEBAQcBAQEBQT9BEgGDbgEFJy8zCBgxOQMHFBmIGsB+hUqNawWHUAOHAYgdjyqHaIUujkCCGAELPgMZgVwoLoFXhlMBAQE Received: from ppp121-44-19-16.lns20.syd4.internode.on.net (HELO dastard) ([121.44.19.16]) by ipmail06.adl2.internode.on.net with ESMTP; 05 Feb 2016 09:35:11 +1030 Received: from disappointment.disaster.area ([192.168.1.110] helo=disappointment) by dastard with esmtp (Exim 4.80) (envelope-from ) id 1aRSxa-0000Ee-CJ for xfs@oss.sgi.com; Fri, 05 Feb 2016 10:05:10 +1100 Received: from dave by disappointment with local (Exim 4.86) (envelope-from ) id 1aRSxa-0004zB-Bp for xfs@oss.sgi.com; Fri, 05 Feb 2016 10:05:10 +1100 From: Dave Chinner To: xfs@oss.sgi.com Subject: [PATCH 5/7] libxfs: don't repeatedly shake unwritable buffers Date: Fri, 5 Feb 2016 10:05:06 +1100 X-ASG-Orig-Subj: [PATCH 5/7] libxfs: don't repeatedly shake unwritable buffers Message-Id: <1454627108-19036-6-git-send-email-david@fromorbit.com> X-Mailer: git-send-email 2.5.0 In-Reply-To: <1454627108-19036-1-git-send-email-david@fromorbit.com> References: <1454627108-19036-1-git-send-email-david@fromorbit.com> X-Barracuda-Connect: ipmail06.adl2.internode.on.net[150.101.137.129] X-Barracuda-Start-Time: 1454627255 X-Barracuda-URL: https://192.48.176.25:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-BRTS-Status: 1 X-Barracuda-Spam-Score: 0.00 X-Barracuda-Spam-Status: No, SCORE=0.00 using per-user scores of TAG_LEVEL=1000.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.7 tests= X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.3.26751 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- From: Dave Chinner now that we try to write dirty buffers before we release them, we can get buildup of unwritable dirty buffers on the LRU lists, This results in the cache shaker repeatedly trying to write out these buffers every time the cache fills up. This results in more corruption warnings, and takes up a lot of time doing reclaiming nothing. This can effectively livelock the processing parts of phase 4. Fix this by not trying to write buffers with corruption errors on them. These errors will get cleared when the buffer is re-read and fixed and them marked dirty again. At which point, we'll be able to write them and so the cache can reclaim them successfully. Signed-off-by: Dave Chinner Reviewed-by: Brian Foster Signed-off-by: Dave Chinner --- libxfs/rdwr.c | 27 ++++++++++++++++----------- 1 file changed, 16 insertions(+), 11 deletions(-) diff --git a/libxfs/rdwr.c b/libxfs/rdwr.c index 37162cd..2e298c2 100644 --- a/libxfs/rdwr.c +++ b/libxfs/rdwr.c @@ -1103,7 +1103,6 @@ int libxfs_writebufr(xfs_buf_t *bp) { int fd = libxfs_device_to_fd(bp->b_target->dev); - int error = 0; /* * we never write buffers that are marked stale. This indicates they @@ -1134,7 +1133,7 @@ libxfs_writebufr(xfs_buf_t *bp) } if (!(bp->b_flags & LIBXFS_B_DISCONTIG)) { - error = __write_buf(fd, bp->b_addr, bp->b_bcount, + bp->b_error = __write_buf(fd, bp->b_addr, bp->b_bcount, LIBXFS_BBTOOFF64(bp->b_bn), bp->b_flags); } else { int i; @@ -1144,11 +1143,10 @@ libxfs_writebufr(xfs_buf_t *bp) off64_t offset = LIBXFS_BBTOOFF64(bp->b_map[i].bm_bn); int len = BBTOB(bp->b_map[i].bm_len); - error = __write_buf(fd, buf, len, offset, bp->b_flags); - if (error) { - bp->b_error = error; + bp->b_error = __write_buf(fd, buf, len, offset, + bp->b_flags); + if (bp->b_error) break; - } buf += len; } } @@ -1157,14 +1155,14 @@ libxfs_writebufr(xfs_buf_t *bp) printf("%lx: %s: wrote %u bytes, blkno=%llu(%llu), %p, error %d\n", pthread_self(), __FUNCTION__, bp->b_bcount, (long long)LIBXFS_BBTOOFF64(bp->b_bn), - (long long)bp->b_bn, bp, error); + (long long)bp->b_bn, bp, bp->b_error); #endif - if (!error) { + if (!bp->b_error) { bp->b_flags |= LIBXFS_B_UPTODATE; bp->b_flags &= ~(LIBXFS_B_DIRTY | LIBXFS_B_EXIT | LIBXFS_B_UNCHECKED); } - return error; + return bp->b_error; } int @@ -1266,15 +1264,22 @@ libxfs_bulkrelse( return count; } +/* + * When a buffer is marked dirty, the error is cleared. Hence if we are trying + * to flush a buffer prior to cache reclaim that has an error on it it means + * we've already tried to flush it and it failed. Prevent repeated corruption + * errors from being reported by skipping such buffers - when the corruption is + * fixed the buffer will be marked dirty again and we can write it again. + */ static int libxfs_bflush( struct cache_node *node) { struct xfs_buf *bp = (struct xfs_buf *)node; - if (bp->b_flags & LIBXFS_B_DIRTY) + if (!bp->b_error && bp->b_flags & LIBXFS_B_DIRTY) return libxfs_writebufr(bp); - return 0; + return bp->b_error; } void -- 2.5.0 From dave@fromorbit.com Thu Feb 4 17:07:40 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=ham version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay3.corp.sgi.com [198.149.34.15]) by oss.sgi.com (Postfix) with ESMTP id 00A7629E04 for ; Thu, 4 Feb 2016 17:07:39 -0600 (CST) Received: from cuda.sgi.com (cuda3.sgi.com [192.48.176.15]) by relay3.corp.sgi.com (Postfix) with ESMTP id 53C76AC005 for ; Thu, 4 Feb 2016 15:07:39 -0800 (PST) X-ASG-Debug-ID: 1454627250-04cb6c27452a0c0004-NocioJ Received: from ipmail06.adl2.internode.on.net (ipmail06.adl2.internode.on.net [150.101.137.129]) by cuda.sgi.com with ESMTP id yLbE2NTDiXQc51aC for ; Thu, 04 Feb 2016 15:07:37 -0800 (PST) X-Barracuda-Envelope-From: dave@fromorbit.com X-Barracuda-Apparent-Source-IP: 150.101.137.129 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: A2AtDQCV2LNWPBATLHleKAECgw+BP4ZjgXidPwEBAQEBAQaRKItUTQEBAQEBAQcBAQEBQT9BEgGDbgEFJy8zCBgxOQMHFBmIGsB+hUqNawWWcZxAjkCCGAELQRmBXCgugVeGUwEBAQ Received: from ppp121-44-19-16.lns20.syd4.internode.on.net (HELO dastard) ([121.44.19.16]) by ipmail06.adl2.internode.on.net with ESMTP; 05 Feb 2016 09:35:11 +1030 Received: from disappointment.disaster.area ([192.168.1.110] helo=disappointment) by dastard with esmtp (Exim 4.80) (envelope-from ) id 1aRSxa-0000Eb-B8 for xfs@oss.sgi.com; Fri, 05 Feb 2016 10:05:10 +1100 Received: from dave by disappointment with local (Exim 4.86) (envelope-from ) id 1aRSxa-0004yw-Ae for xfs@oss.sgi.com; Fri, 05 Feb 2016 10:05:10 +1100 From: Dave Chinner To: xfs@oss.sgi.com Subject: [PATCH 2/7] repair: parallelise uncertin inode processing in phase 3 Date: Fri, 5 Feb 2016 10:05:03 +1100 X-ASG-Orig-Subj: [PATCH 2/7] repair: parallelise uncertin inode processing in phase 3 Message-Id: <1454627108-19036-3-git-send-email-david@fromorbit.com> X-Mailer: git-send-email 2.5.0 In-Reply-To: <1454627108-19036-1-git-send-email-david@fromorbit.com> References: <1454627108-19036-1-git-send-email-david@fromorbit.com> X-Barracuda-Connect: ipmail06.adl2.internode.on.net[150.101.137.129] X-Barracuda-Start-Time: 1454627256 X-Barracuda-URL: https://192.48.176.15:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-BRTS-Status: 1 X-Barracuda-Spam-Score: 0.00 X-Barracuda-Spam-Status: No, SCORE=0.00 using per-user scores of TAG_LEVEL=1000.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.7 tests= X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.3.26751 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- From: Dave Chinner This can take a long time when there are millions of uncertain inodes in badly broken filesystems. THe processing is per-ag, the data structures are all per-ag, and the load is mostly CPU time spent checking CRCs on each uncertaini inode. Parallelising reduced the runtime of this phase on a badly broken filesytem from ~30 minutes to under 5 miniutes. Signed-off-by: Dave Chinner Reviewed-by: Brian Foster Signed-off-by: Dave Chinner --- repair/phase3.c | 59 ++++++++++++++++++++++++++++++++++++++++++++--------- repair/protos.h | 2 +- repair/xfs_repair.c | 2 +- 3 files changed, 51 insertions(+), 12 deletions(-) diff --git a/repair/phase3.c b/repair/phase3.c index 76c9440..0890a27 100644 --- a/repair/phase3.c +++ b/repair/phase3.c @@ -28,6 +28,7 @@ #include "dinode.h" #include "progress.h" #include "bmap.h" +#include "threads.h" static void process_agi_unlinked( @@ -87,10 +88,33 @@ process_ags( do_inode_prefetch(mp, ag_stride, process_ag_func, false, false); } +static void +do_uncertain_aginodes( + work_queue_t *wq, + xfs_agnumber_t agno, + void *arg) +{ + int *count = arg; + + *count = process_uncertain_aginodes(wq->mp, agno); + +#ifdef XR_INODE_TRACE + fprintf(stderr, + "\t\t phase 3 - ag %d process_uncertain_inodes returns %d\n", + *count, j); +#endif + + PROG_RPT_INC(prog_rpt_done[agno], 1); +} + void -phase3(xfs_mount_t *mp) +phase3( + struct xfs_mount *mp, + int scan_threads) { - int i, j; + int i, j; + int *counts; + work_queue_t wq; do_log(_("Phase 3 - for each AG...\n")); if (!no_modify) @@ -129,20 +153,35 @@ phase3(xfs_mount_t *mp) */ do_log(_(" - process newly discovered inodes...\n")); set_progress_msg(PROG_FMT_NEW_INODES, (__uint64_t) glob_agcount); + + counts = calloc(sizeof(*counts), mp->m_sb.sb_agcount); + if (!counts) { + do_abort(_("no memory for uncertain inode counts\n")); + return; + } + do { /* * have to loop until no ag has any uncertain * inodes */ j = 0; - for (i = 0; i < mp->m_sb.sb_agcount; i++) { - j += process_uncertain_aginodes(mp, i); -#ifdef XR_INODE_TRACE - fprintf(stderr, - "\t\t phase 3 - process_uncertain_inodes returns %d\n", j); -#endif - PROG_RPT_INC(prog_rpt_done[i], 1); - } + memset(counts, 0, mp->m_sb.sb_agcount * sizeof(*counts)); + + create_work_queue(&wq, mp, scan_threads); + + for (i = 0; i < mp->m_sb.sb_agcount; i++) + queue_work(&wq, do_uncertain_aginodes, i, &counts[i]); + + destroy_work_queue(&wq); + + /* tally up the counts */ + for (i = 0; i < mp->m_sb.sb_agcount; i++) + j += counts[i]; + } while (j != 0); + + free(counts); + print_final_rpt(); } diff --git a/repair/protos.h b/repair/protos.h index b113aca..0290420 100644 --- a/repair/protos.h +++ b/repair/protos.h @@ -46,7 +46,7 @@ void thread_init(void); void phase1(struct xfs_mount *); void phase2(struct xfs_mount *, int); -void phase3(struct xfs_mount *); +void phase3(struct xfs_mount *, int); void phase4(struct xfs_mount *); void phase5(struct xfs_mount *); void phase6(struct xfs_mount *); diff --git a/repair/xfs_repair.c b/repair/xfs_repair.c index fcdb212..5d5f3aa 100644 --- a/repair/xfs_repair.c +++ b/repair/xfs_repair.c @@ -871,7 +871,7 @@ main(int argc, char **argv) if (do_prefetch) init_prefetch(mp); - phase3(mp); + phase3(mp, phase2_threads); timestamp(PHASE_END, 3, NULL); phase4(mp); -- 2.5.0 From dave@fromorbit.com Thu Feb 4 17:07:40 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=ham version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay3.corp.sgi.com [198.149.34.15]) by oss.sgi.com (Postfix) with ESMTP id D238829DFE for ; Thu, 4 Feb 2016 17:07:39 -0600 (CST) Received: from cuda.sgi.com (cuda1.sgi.com [192.48.157.11]) by relay3.corp.sgi.com (Postfix) with ESMTP id 4FA06AC001 for ; Thu, 4 Feb 2016 15:07:39 -0800 (PST) X-ASG-Debug-ID: 1454627255-04bdf079c12bad0001-NocioJ Received: from ipmail06.adl2.internode.on.net (ipmail06.adl2.internode.on.net [150.101.137.129]) by cuda.sgi.com with ESMTP id nN0ygS2TqFhIUG58 for ; Thu, 04 Feb 2016 15:07:36 -0800 (PST) X-Barracuda-Envelope-From: dave@fromorbit.com X-Barracuda-Apparent-Source-IP: 150.101.137.129 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: A2AtDQCV2LNWPBATLHleKAECgw+BP4ZjgXidPwEBAQEBAQaRKItUTQEBAQEBAQcBAQEBQT9BEgGDbgEFJy8zCBgxOQMHFBmIGsB+hUqJDIRfBYdThVKJTJxAjkCCGAELQAEZgVwoLoFXhRuBOAEBAQ Received: from ppp121-44-19-16.lns20.syd4.internode.on.net (HELO dastard) ([121.44.19.16]) by ipmail06.adl2.internode.on.net with ESMTP; 05 Feb 2016 09:35:11 +1030 Received: from disappointment.disaster.area ([192.168.1.110] helo=disappointment) by dastard with esmtp (Exim 4.80) (envelope-from ) id 1aRSxa-0000Ef-Cf for xfs@oss.sgi.com; Fri, 05 Feb 2016 10:05:10 +1100 Received: from dave by disappointment with local (Exim 4.86) (envelope-from ) id 1aRSxa-0004zG-CD for xfs@oss.sgi.com; Fri, 05 Feb 2016 10:05:10 +1100 From: Dave Chinner To: xfs@oss.sgi.com Subject: [PATCH 6/7] libxfs: keep unflushable buffers off the cache MRUs Date: Fri, 5 Feb 2016 10:05:07 +1100 X-ASG-Orig-Subj: [PATCH 6/7] libxfs: keep unflushable buffers off the cache MRUs Message-Id: <1454627108-19036-7-git-send-email-david@fromorbit.com> X-Mailer: git-send-email 2.5.0 In-Reply-To: <1454627108-19036-1-git-send-email-david@fromorbit.com> References: <1454627108-19036-1-git-send-email-david@fromorbit.com> X-Barracuda-Connect: ipmail06.adl2.internode.on.net[150.101.137.129] X-Barracuda-Start-Time: 1454627255 X-Barracuda-URL: https://192.48.157.11:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-BRTS-Status: 1 X-Barracuda-Spam-Score: 0.00 X-Barracuda-Spam-Status: No, SCORE=0.00 using per-user scores of TAG_LEVEL=1000.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.7 tests= X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.3.26751 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- From: Dave Chinner There's no point trying to free buffers that are dirty and return errors on flush as we have to keep them around until the corruption is fixed. Hence if we fail to flush an inode during a cache shake, move the buffer to a special dirty MRU list that the cache does not shake. This prevents memory pressure from seeing these buffers, but allows subsequent cache lookups to still find them through the hash. This ensures we don't waste huge amounts of CPU trying to flush and reclaim buffers that canot be flushed or reclaimed. Signed-off-by: Dave Chinner --- include/cache.h | 3 ++- libxfs/cache.c | 78 ++++++++++++++++++++++++++++++++++++++++++--------------- 2 files changed, 60 insertions(+), 21 deletions(-) diff --git a/include/cache.h b/include/cache.h index 87826be..55761d3 100644 --- a/include/cache.h +++ b/include/cache.h @@ -51,6 +51,7 @@ enum { #define CACHE_BASE_PRIORITY 0 #define CACHE_PREFETCH_PRIORITY 8 #define CACHE_MAX_PRIORITY 15 +#define CACHE_DIRTY_PRIORITY (CACHE_MAX_PRIORITY + 1) /* * Simple, generic implementation of a cache (arbitrary data). @@ -115,7 +116,7 @@ struct cache { unsigned int c_hashsize; /* hash bucket count */ unsigned int c_hashshift; /* hash key shift */ struct cache_hash *c_hash; /* hash table buckets */ - struct cache_mru c_mrus[CACHE_MAX_PRIORITY + 1]; + struct cache_mru c_mrus[CACHE_DIRTY_PRIORITY + 1]; unsigned long long c_misses; /* cache misses */ unsigned long long c_hits; /* cache hits */ unsigned int c_max; /* max nodes ever used */ diff --git a/libxfs/cache.c b/libxfs/cache.c index a48ebd9..d4b4a4e 100644 --- a/libxfs/cache.c +++ b/libxfs/cache.c @@ -81,7 +81,7 @@ cache_init( pthread_mutex_init(&cache->c_hash[i].ch_mutex, NULL); } - for (i = 0; i <= CACHE_MAX_PRIORITY; i++) { + for (i = 0; i <= CACHE_DIRTY_PRIORITY; i++) { list_head_init(&cache->c_mrus[i].cm_list); cache->c_mrus[i].cm_count = 0; pthread_mutex_init(&cache->c_mrus[i].cm_mutex, NULL); @@ -154,7 +154,7 @@ cache_destroy( list_head_destroy(&cache->c_hash[i].ch_list); pthread_mutex_destroy(&cache->c_hash[i].ch_mutex); } - for (i = 0; i <= CACHE_MAX_PRIORITY; i++) { + for (i = 0; i <= CACHE_DIRTY_PRIORITY; i++) { list_head_destroy(&cache->c_mrus[i].cm_list); pthread_mutex_destroy(&cache->c_mrus[i].cm_mutex); } @@ -183,15 +183,45 @@ cache_generic_bulkrelse( } /* - * We've hit the limit on cache size, so we need to start reclaiming - * nodes we've used. The MRU specified by the priority is shaken. - * Returns new priority at end of the call (in case we call again). + * Park unflushable nodes on their own special MRU so that cache_shake() doesn't + * end up repeatedly scanning them in the futile attempt to clean them before + * reclaim. + */ +static void +cache_move_to_dirty_mru( + struct cache *cache, + struct cache_node *node) +{ + struct cache_mru *mru; + + mru = &cache->c_mrus[CACHE_DIRTY_PRIORITY]; + + pthread_mutex_lock(&mru->cm_mutex); + node->cn_priority = CACHE_DIRTY_PRIORITY; + list_move(&node->cn_mru, &mru->cm_list); + mru->cm_count++; + pthread_mutex_unlock(&mru->cm_mutex); +} + +/* + * We've hit the limit on cache size, so we need to start reclaiming nodes we've + * used. The MRU specified by the priority is shaken. Returns new priority at + * end of the call (in case we call again). We are not allowed to reclaim dirty + * objects, so we have to flush them first. If flushing fails, we move them to + * the "dirty, unreclaimable" list. + * + * Hence we skip priorities > CACHE_MAX_PRIORITY unless "purge" is set as we + * park unflushable (and hence unreclaimable) buffers at these priorities. + * Trying to shake unreclaimable buffer lists whent here is memory pressure is a + * waste of time and CPU and greatly slows down cache node recycling operations. + * Hence we only try to free them if we are being asked to purge the cache of + * all entries. */ static unsigned int cache_shake( struct cache * cache, unsigned int priority, - int all) + bool purge) { struct cache_mru *mru; struct cache_hash * hash; @@ -202,10 +232,11 @@ cache_shake( struct cache_node * node; unsigned int count; - ASSERT(priority <= CACHE_MAX_PRIORITY); - if (priority > CACHE_MAX_PRIORITY) + ASSERT(priority <= CACHE_DIRTY_PRIORITY); + if (priority > CACHE_MAX_PRIORITY && !purge) priority = 0; + mru = &cache->c_mrus[priority]; count = 0; list_head_init(&temp); @@ -219,8 +250,10 @@ cache_shake( if (pthread_mutex_trylock(&node->cn_mutex) != 0) continue; - /* can't release dirty objects */ - if (cache->flush(node)) { + /* memory pressure is not allowed to release dirty objects */ + if (cache->flush(node) && !purge) { + cache_move_to_dirty_mru(cache, node); + mru->cm_count--; pthread_mutex_unlock(&node->cn_mutex); continue; } @@ -242,7 +275,7 @@ cache_shake( pthread_mutex_unlock(&node->cn_mutex); count++; - if (!all && count == CACHE_SHAKE_COUNT) + if (!purge && count == CACHE_SHAKE_COUNT) break; } pthread_mutex_unlock(&mru->cm_mutex); @@ -423,7 +456,7 @@ next_object: node = cache_node_allocate(cache, key); if (node) break; - priority = cache_shake(cache, priority, 0); + priority = cache_shake(cache, priority, false); /* * We start at 0; if we free CACHE_SHAKE_COUNT we get * back the same priority, if not we get back priority+1. @@ -578,8 +611,8 @@ cache_purge( { int i; - for (i = 0; i <= CACHE_MAX_PRIORITY; i++) - cache_shake(cache, i, 1); + for (i = 0; i <= CACHE_DIRTY_PRIORITY; i++) + cache_shake(cache, i, true); #ifdef CACHE_DEBUG if (cache->c_count != 0) { @@ -626,13 +659,13 @@ cache_flush( #define HASH_REPORT (3 * HASH_CACHE_RATIO) void cache_report( - FILE *fp, - const char *name, - struct cache *cache) + FILE *fp, + const char *name, + struct cache *cache) { - int i; - unsigned long count, index, total; - unsigned long hash_bucket_lengths[HASH_REPORT + 2]; + int i; + unsigned long count, index, total; + unsigned long hash_bucket_lengths[HASH_REPORT + 2]; if ((cache->c_hits + cache->c_misses) == 0) return; @@ -662,6 +695,11 @@ cache_report( i, cache->c_mrus[i].cm_count, cache->c_mrus[i].cm_count * 100 / cache->c_count); + i = CACHE_DIRTY_PRIORITY; + fprintf(fp, "Dirty MRU %d entries = %6u (%3u%%)\n", + i, cache->c_mrus[i].cm_count, + cache->c_mrus[i].cm_count * 100 / cache->c_count); + /* report hash bucket lengths */ bzero(hash_bucket_lengths, sizeof(hash_bucket_lengths)); -- 2.5.0 From dave@fromorbit.com Thu Feb 4 17:07:42 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=ham version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay3.corp.sgi.com [198.149.34.15]) by oss.sgi.com (Postfix) with ESMTP id 42B6A7CA2 for ; Thu, 4 Feb 2016 17:07:42 -0600 (CST) Received: from cuda.sgi.com (cuda2.sgi.com [192.48.176.25]) by relay3.corp.sgi.com (Postfix) with ESMTP id B84CDAC005 for ; Thu, 4 Feb 2016 15:07:41 -0800 (PST) X-ASG-Debug-ID: 1454627253-04cbb04cfb43370003-NocioJ Received: from ipmail06.adl2.internode.on.net (ipmail06.adl2.internode.on.net [150.101.137.129]) by cuda.sgi.com with ESMTP id dAeq8J4rfEj0iTHc for ; Thu, 04 Feb 2016 15:07:38 -0800 (PST) X-Barracuda-Envelope-From: dave@fromorbit.com X-Barracuda-Apparent-Source-IP: 150.101.137.129 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: A2CkEQCV2LNWPBATLHleKAECgw9SLEGGY4F4nT8BAQEBAQEGjAqFHoQghzRNAQEBAQEBBwEBAQFBP0ESAYNuAQUnLzMIGDE5AwcUGYgawH6FSo1rBYdTjx6FS4lfSoxMhXCIUIIYAQtAGoFcKC6BV4ZTAQEB Received: from ppp121-44-19-16.lns20.syd4.internode.on.net (HELO dastard) ([121.44.19.16]) by ipmail06.adl2.internode.on.net with ESMTP; 05 Feb 2016 09:35:11 +1030 Received: from disappointment.disaster.area ([192.168.1.110] helo=disappointment) by dastard with esmtp (Exim 4.80) (envelope-from ) id 1aRSxa-0000Ec-BU for xfs@oss.sgi.com; Fri, 05 Feb 2016 10:05:10 +1100 Received: from dave by disappointment with local (Exim 4.86) (envelope-from ) id 1aRSxa-0004z1-B2 for xfs@oss.sgi.com; Fri, 05 Feb 2016 10:05:10 +1100 From: Dave Chinner To: xfs@oss.sgi.com Subject: [PATCH 3/7] libxfs: directory node splitting does not have an extra block Date: Fri, 5 Feb 2016 10:05:04 +1100 X-ASG-Orig-Subj: [PATCH 3/7] libxfs: directory node splitting does not have an extra block Message-Id: <1454627108-19036-4-git-send-email-david@fromorbit.com> X-Mailer: git-send-email 2.5.0 In-Reply-To: <1454627108-19036-1-git-send-email-david@fromorbit.com> References: <1454627108-19036-1-git-send-email-david@fromorbit.com> X-Barracuda-Connect: ipmail06.adl2.internode.on.net[150.101.137.129] X-Barracuda-Start-Time: 1454627257 X-Barracuda-URL: https://192.48.176.25:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-BRTS-Status: 1 X-Barracuda-Spam-Score: 0.00 X-Barracuda-Spam-Status: No, SCORE=0.00 using per-user scores of TAG_LEVEL=1000.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.7 tests=INFO_TLD X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.3.26751 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 0.00 INFO_TLD URI: Contains an URL in the INFO top-level domain From: Dave Chinner xfs_da3_split() has to handle all three versions of the directory/attribute btree structure. The attr tree is v1, the dir tre is v2 or v3. The main difference between the v1 and v2/3 trees is the way tree nodes are split - in the v1 tree we can require a double split to occur because the object to be inserted may be larger than the space made by splitting a leaf. In this case we need to do a double split - one to split the full leaf, then another to allocate an empty leaf block in the correct location for the new entry. This does not happen with dir (v2/v3) formats as the objects being inserted are always guaranteed to fit into the new space in the split blocks. Indeed, for directories they *may* be an extra block on this buffer pointer. However, it's guaranteed not to be a leaf block (i.e. a directory data block) - the directory code only ever places hash index or free space blocks in this pointer (as a cursor of sorts), and so to use it as a directory data block will immediately corrupt the directory. The problem is that the code assumes that there may be extra blocks that we need to link into the tree once we've split the root, but this is not true for either dir or attr trees, because the extra attr block is always consumed by the last node split before we split the root. Hence the linking in an extra block is always wrong at the root split level, and this manifests itself in repair as a directory corruption in a repaired directory, leaving the directory rebuild incomplete. This is a dir v2 zero-day bug - it was in the initial dir v2 commit that was made back in February 1998. Fix this by ensuring the linking of the blocks after the root split never tries to make use of the extra blocks that may be held in the cursor. They are held there for other purposes and should never be touched by the root splitting code. Signed-off-by: Dave Chinner --- libxfs/xfs_da_btree.c | 59 +++++++++++++++++++++++++-------------------------- 1 file changed, 29 insertions(+), 30 deletions(-) diff --git a/libxfs/xfs_da_btree.c b/libxfs/xfs_da_btree.c index bf5fe21..25072c7 100644 --- a/libxfs/xfs_da_btree.c +++ b/libxfs/xfs_da_btree.c @@ -351,7 +351,6 @@ xfs_da3_split( struct xfs_da_state_blk *newblk; struct xfs_da_state_blk *addblk; struct xfs_da_intnode *node; - struct xfs_buf *bp; int max; int action = 0; int error; @@ -392,7 +391,9 @@ xfs_da3_split( break; } /* - * Entry wouldn't fit, split the leaf again. + * Entry wouldn't fit, split the leaf again. The new + * extrablk will be consumed by xfs_da3_node_split if + * the node is split. */ state->extravalid = 1; if (state->inleaf) { @@ -441,6 +442,14 @@ xfs_da3_split( return 0; /* + * xfs_da3_node_split() should have consumed any extra blocks we added + * during a double leaf split in the attr fork. This is guaranteed as + * we can't be here if the attr fork only has a single leaf block. + */ + ASSERT(state->extravalid == 0 || + state->path.blk[max].magic == XFS_DIR2_LEAFN_MAGIC); + + /* * Split the root node. */ ASSERT(state->path.active == 0); @@ -452,43 +461,33 @@ xfs_da3_split( } /* - * Update pointers to the node which used to be block 0 and - * just got bumped because of the addition of a new root node. - * There might be three blocks involved if a double split occurred, - * and the original block 0 could be at any position in the list. + * Update pointers to the node which used to be block 0 and just got + * bumped because of the addition of a new root node. Note that the + * original block 0 could be at any position in the list of blocks in + * the tree. * - * Note: the magic numbers and sibling pointers are in the same - * physical place for both v2 and v3 headers (by design). Hence it - * doesn't matter which version of the xfs_da_intnode structure we use - * here as the result will be the same using either structure. + * Note: the magic numbers and sibling pointers are in the same physical + * place for both v2 and v3 headers (by design). Hence it doesn't matter + * which version of the xfs_da_intnode structure we use here as the + * result will be the same using either structure. */ node = oldblk->bp->b_addr; if (node->hdr.info.forw) { - if (be32_to_cpu(node->hdr.info.forw) == addblk->blkno) { - bp = addblk->bp; - } else { - ASSERT(state->extravalid); - bp = state->extrablk.bp; - } - node = bp->b_addr; + ASSERT(be32_to_cpu(node->hdr.info.forw) == addblk->blkno); + node = addblk->bp->b_addr; node->hdr.info.back = cpu_to_be32(oldblk->blkno); - xfs_trans_log_buf(state->args->trans, bp, - XFS_DA_LOGRANGE(node, &node->hdr.info, - sizeof(node->hdr.info))); + xfs_trans_log_buf(state->args->trans, addblk->bp, + XFS_DA_LOGRANGE(node, &node->hdr.info, + sizeof(node->hdr.info))); } node = oldblk->bp->b_addr; if (node->hdr.info.back) { - if (be32_to_cpu(node->hdr.info.back) == addblk->blkno) { - bp = addblk->bp; - } else { - ASSERT(state->extravalid); - bp = state->extrablk.bp; - } - node = bp->b_addr; + ASSERT(be32_to_cpu(node->hdr.info.back) == addblk->blkno); + node = addblk->bp->b_addr; node->hdr.info.forw = cpu_to_be32(oldblk->blkno); - xfs_trans_log_buf(state->args->trans, bp, - XFS_DA_LOGRANGE(node, &node->hdr.info, - sizeof(node->hdr.info))); + xfs_trans_log_buf(state->args->trans, addblk->bp, + XFS_DA_LOGRANGE(node, &node->hdr.info, + sizeof(node->hdr.info))); } addblk->bp = NULL; return 0; -- 2.5.0 From dave@fromorbit.com Thu Feb 4 17:15:25 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=ham version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay1.corp.sgi.com [137.38.102.111]) by oss.sgi.com (Postfix) with ESMTP id 0CE8E29DF5 for ; Thu, 4 Feb 2016 17:15:25 -0600 (CST) Received: from cuda.sgi.com (cuda2.sgi.com [192.48.176.25]) by relay1.corp.sgi.com (Postfix) with ESMTP id EF21E8F8049 for ; Thu, 4 Feb 2016 15:15:24 -0800 (PST) X-ASG-Debug-ID: 1454627721-04cbb04cf943690001-NocioJ Received: from ipmail06.adl2.internode.on.net (ipmail06.adl2.internode.on.net [150.101.137.129]) by cuda.sgi.com with ESMTP id 8CS3xpUYjyFsWA22 for ; Thu, 04 Feb 2016 15:15:21 -0800 (PST) X-Barracuda-Envelope-From: dave@fromorbit.com X-Barracuda-Apparent-Source-IP: 150.101.137.129 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: A2DSDADz2rNWPBATLHleKAECgw9SbYhbnScCFgEBAQEBAQaBD5AZhCiHLU0BAQEBAQEHAQEBAUE/QRIBhEojGIECAweIRw/AcIVKh1OCKoNuBZZxhUuWdUSNfIIYAQEBBwEBAQGCNCguAYFWhlMBAQE Received: from ppp121-44-19-16.lns20.syd4.internode.on.net (HELO dastard) ([121.44.19.16]) by ipmail06.adl2.internode.on.net with ESMTP; 05 Feb 2016 09:45:20 +1030 Received: from disappointment.disaster.area ([192.168.1.110] helo=disappointment) by dastard with esmtp (Exim 4.80) (envelope-from ) id 1aRT7Q-0000Ij-4p; Fri, 05 Feb 2016 10:15:20 +1100 Received: from dave by disappointment with local (Exim 4.86) (envelope-from ) id 1aRT7Q-00058i-42; Fri, 05 Feb 2016 10:15:20 +1100 From: Dave Chinner To: xfs@oss.sgi.com Cc: fstests@vger.kernel.org Subject: [PATCH 0/2 v2] xfs_quota: allow operation on ext4 for project quotas Date: Fri, 5 Feb 2016 10:15:16 +1100 X-ASG-Orig-Subj: [PATCH 0/2 v2] xfs_quota: allow operation on ext4 for project quotas Message-Id: <1454627718-19583-1-git-send-email-david@fromorbit.com> X-Mailer: git-send-email 2.5.0 X-Barracuda-Connect: ipmail06.adl2.internode.on.net[150.101.137.129] X-Barracuda-Start-Time: 1454627721 X-Barracuda-URL: https://192.48.176.25:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-BRTS-Status: 1 X-Barracuda-Spam-Score: 0.00 X-Barracuda-Spam-Status: No, SCORE=0.00 using per-user scores of TAG_LEVEL=1000.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.7 tests= X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.3.26751 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- Hi folks, This is a followup to the patch I posted here: http://oss.sgi.com/archives/xfs/2016-01/msg00450.html The first patch is changed to address Eric's comments about how the report command should not change - I introduced a "-f" command line flag to ensure that foreign filesystems are only available whenteh -f flag is present. The second patch is to address the build issue that occurs from the newly promoted definitions defining the struct fsxattr and having xfs_fs.h define it a second time. We have to still support builds on systems that don't have the new VFS ioctl definitions, so it triggers the definitions of the structure and flags based on whether the VFS definition has been included or not already. -Dave. From dave@fromorbit.com Thu Feb 4 17:15:27 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=ham version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay2.corp.sgi.com [137.38.102.29]) by oss.sgi.com (Postfix) with ESMTP id 10FA829DFC for ; Thu, 4 Feb 2016 17:15:27 -0600 (CST) Received: from cuda.sgi.com (cuda2.sgi.com [192.48.176.25]) by relay2.corp.sgi.com (Postfix) with ESMTP id 01177304032 for ; Thu, 4 Feb 2016 15:15:27 -0800 (PST) X-ASG-Debug-ID: 1454627721-04cbb04cf943690002-NocioJ Received: from ipmail06.adl2.internode.on.net (ipmail06.adl2.internode.on.net [150.101.137.129]) by cuda.sgi.com with ESMTP id dHCUIJ4LaQ81Qxml for ; Thu, 04 Feb 2016 15:15:24 -0800 (PST) X-Barracuda-Envelope-From: dave@fromorbit.com X-Barracuda-Apparent-Source-IP: 150.101.137.129 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: A2AvDQDz2rNWPBATLHleKAECgw+BP4ZjgXidPwEBAQEBAQaRKIhugmdNAQEBAQEBBwEBAQFBP0ESAYNuAQVWIxAIGDE5AwcUGYgawH+FSo1rBYdTjx6PKo0WRIUsiFCCGAGCQSgugVeGUwEBAQ Received: from ppp121-44-19-16.lns20.syd4.internode.on.net (HELO dastard) ([121.44.19.16]) by ipmail06.adl2.internode.on.net with ESMTP; 05 Feb 2016 09:45:20 +1030 Received: from disappointment.disaster.area ([192.168.1.110] helo=disappointment) by dastard with esmtp (Exim 4.80) (envelope-from ) id 1aRT7Q-0000Il-5m; Fri, 05 Feb 2016 10:15:20 +1100 Received: from dave by disappointment with local (Exim 4.86) (envelope-from ) id 1aRT7Q-00058q-5D; Fri, 05 Feb 2016 10:15:20 +1100 From: Dave Chinner To: xfs@oss.sgi.com Cc: fstests@vger.kernel.org Subject: [PATCH 2/2] xfs_fs.h: XFS_IOC_FS[SG]SETXATTR to FS_IOC_FS[SG]ETXATTR promotion Date: Fri, 5 Feb 2016 10:15:18 +1100 X-ASG-Orig-Subj: [PATCH 2/2] xfs_fs.h: XFS_IOC_FS[SG]SETXATTR to FS_IOC_FS[SG]ETXATTR promotion Message-Id: <1454627718-19583-3-git-send-email-david@fromorbit.com> X-Mailer: git-send-email 2.5.0 In-Reply-To: <1454627718-19583-1-git-send-email-david@fromorbit.com> References: <1454627718-19583-1-git-send-email-david@fromorbit.com> X-Barracuda-Connect: ipmail06.adl2.internode.on.net[150.101.137.129] X-Barracuda-Start-Time: 1454627723 X-Barracuda-URL: https://192.48.176.25:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-BRTS-Status: 1 X-Barracuda-Spam-Score: 0.00 X-Barracuda-Spam-Status: No, SCORE=0.00 using per-user scores of TAG_LEVEL=1000.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.7 tests= X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.3.26751 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- From: Dave Chinner The kernel commit to make this ioctl promotion (bb99e06ddf) moved the definitions for the XFS ioctl to uapi/linux/fs.h for the following reason: Hoist the ioctl definitions for the XFS_IOC_FS[SG]SETXATTR API from fs/xfs/libxfs/xfs_fs.h to include/uapi/linux/fs.h so that the ioctls can be used by all filesystems, not just XFS. This enables (initially) ext4 to use the ioctl to set project IDs on inodes. This means we now need to handle this change in userspace as the uapi/linux/fs.h file may not contain the definitions (i.e. new xfsprogs/ old linux uapi files) xfsprogs needs to build. Hence we need to massage the definition in xfs_fs.h to take the values from the system header if it exists, otherwise keep the old definitions for compatibility and platforms other than linux.. Signed-off-by: Dave Chinner --- libxfs/xfs_fs.h | 67 ++++++++++++++++++++++++++++++++++++--------------------- 1 file changed, 43 insertions(+), 24 deletions(-) diff --git a/libxfs/xfs_fs.h b/libxfs/xfs_fs.h index d8b733a..ced9b2d 100644 --- a/libxfs/xfs_fs.h +++ b/libxfs/xfs_fs.h @@ -35,10 +35,8 @@ struct dioattr { }; #endif -/* - * Structure for XFS_IOC_FSGETXATTR[A] and XFS_IOC_FSSETXATTR. - */ -#ifndef HAVE_FSXATTR +/* check whether we have to define FS_IOC_FS[GS]ETXATTR ourselves */ +#ifndef FS_IOC_FSGETXATTR struct fsxattr { __u32 fsx_xflags; /* xflags field value (get/set) */ __u32 fsx_extsize; /* extsize field value (get/set)*/ @@ -46,28 +44,49 @@ struct fsxattr { __u32 fsx_projid; /* project identifier (get/set) */ unsigned char fsx_pad[12]; }; + +/* + * Flags for the fsx_xflags field + */ +#define FS_XFLAG_REALTIME 0x00000001 /* data in realtime volume */ +#define FS_XFLAG_PREALLOC 0x00000002 /* preallocated file extents */ +#define FS_XFLAG_IMMUTABLE 0x00000008 /* file cannot be modified */ +#define FS_XFLAG_APPEND 0x00000010 /* all writes append */ +#define FS_XFLAG_SYNC 0x00000020 /* all writes synchronous */ +#define FS_XFLAG_NOATIME 0x00000040 /* do not update access time */ +#define FS_XFLAG_NODUMP 0x00000080 /* do not include in backups */ +#define FS_XFLAG_RTINHERIT 0x00000100 /* create with rt bit set */ +#define FS_XFLAG_PROJINHERIT 0x00000200 /* create with parents projid */ +#define FS_XFLAG_NOSYMLINKS 0x00000400 /* disallow symlink creation */ +#define FS_XFLAG_EXTSIZE 0x00000800 /* extent size allocator hint */ +#define FS_XFLAG_EXTSZINHERIT 0x00001000 /* inherit inode extent size */ +#define FS_XFLAG_NODEFRAG 0x00002000 /* do not defragment */ +#define FS_XFLAG_FILESTREAM 0x00004000 /* use filestream allocator */ +#define FS_XFLAG_HASATTR 0x80000000 /* no DIFLAG for this */ + +#define FS_IOC_FSGETXATTR _IOR ('X', 31, struct fsxattr) +#define FS_IOC_FSSETXATTR _IOW ('X', 32, struct fsxattr) + #endif /* - * Flags for the bs_xflags/fsx_xflags field - * There should be a one-to-one correspondence between these flags and the - * XFS_DIFLAG_s. + * Flags for the bs_xflags/fsx_xflags field in FS_IOC_FS[GS]ETXATTR[A] */ -#define XFS_XFLAG_REALTIME 0x00000001 /* data in realtime volume */ -#define XFS_XFLAG_PREALLOC 0x00000002 /* preallocated file extents */ -#define XFS_XFLAG_IMMUTABLE 0x00000008 /* file cannot be modified */ -#define XFS_XFLAG_APPEND 0x00000010 /* all writes append */ -#define XFS_XFLAG_SYNC 0x00000020 /* all writes synchronous */ -#define XFS_XFLAG_NOATIME 0x00000040 /* do not update access time */ -#define XFS_XFLAG_NODUMP 0x00000080 /* do not include in backups */ -#define XFS_XFLAG_RTINHERIT 0x00000100 /* create with rt bit set */ -#define XFS_XFLAG_PROJINHERIT 0x00000200 /* create with parents projid */ -#define XFS_XFLAG_NOSYMLINKS 0x00000400 /* disallow symlink creation */ -#define XFS_XFLAG_EXTSIZE 0x00000800 /* extent size allocator hint */ -#define XFS_XFLAG_EXTSZINHERIT 0x00001000 /* inherit inode extent size */ -#define XFS_XFLAG_NODEFRAG 0x00002000 /* do not defragment */ -#define XFS_XFLAG_FILESTREAM 0x00004000 /* use filestream allocator */ -#define XFS_XFLAG_HASATTR 0x80000000 /* no DIFLAG for this */ +#define XFS_XFLAG_REALTIME FS_XFLAG_REALTIME +#define XFS_XFLAG_PREALLOC FS_XFLAG_PREALLOC +#define XFS_XFLAG_IMMUTABLE FS_XFLAG_IMMUTABLE +#define XFS_XFLAG_APPEND FS_XFLAG_APPEND +#define XFS_XFLAG_SYNC FS_XFLAG_SYNC +#define XFS_XFLAG_NOATIME FS_XFLAG_NOATIME +#define XFS_XFLAG_NODUMP FS_XFLAG_NODUMP +#define XFS_XFLAG_RTINHERIT FS_XFLAG_RTINHERIT +#define XFS_XFLAG_PROJINHERIT FS_XFLAG_PROJINHERIT +#define XFS_XFLAG_NOSYMLINKS FS_XFLAG_NOSYMLINKS +#define XFS_XFLAG_EXTSIZE FS_XFLAG_EXTSIZE +#define XFS_XFLAG_EXTSZINHERIT FS_XFLAG_EXTSZINHERIT +#define XFS_XFLAG_NODEFRAG FS_XFLAG_NODEFRAG +#define XFS_XFLAG_FILESTREAM FS_XFLAG_FILESTREAM +#define XFS_XFLAG_HASATTR FS_XFLAG_HASATTR /* * Structure for XFS_IOC_GETBMAP. @@ -513,8 +532,8 @@ typedef struct xfs_swapext #define XFS_IOC_ALLOCSP _IOW ('X', 10, struct xfs_flock64) #define XFS_IOC_FREESP _IOW ('X', 11, struct xfs_flock64) #define XFS_IOC_DIOINFO _IOR ('X', 30, struct dioattr) -#define XFS_IOC_FSGETXATTR _IOR ('X', 31, struct fsxattr) -#define XFS_IOC_FSSETXATTR _IOW ('X', 32, struct fsxattr) +#define XFS_IOC_FSGETXATTR FS_IOC_FSGETXATTR +#define XFS_IOC_FSSETXATTR FS_IOC_FSSETXATTR #define XFS_IOC_ALLOCSP64 _IOW ('X', 36, struct xfs_flock64) #define XFS_IOC_FREESP64 _IOW ('X', 37, struct xfs_flock64) #define XFS_IOC_GETBMAP _IOWR('X', 38, struct getbmap) -- 2.5.0 From dave@fromorbit.com Thu Feb 4 17:15:29 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=ham version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay1.corp.sgi.com [137.38.102.111]) by oss.sgi.com (Postfix) with ESMTP id 16E9129E0B for ; Thu, 4 Feb 2016 17:15:29 -0600 (CST) Received: from cuda.sgi.com (cuda3.sgi.com [192.48.176.15]) by relay1.corp.sgi.com (Postfix) with ESMTP id 0714B8F8035 for ; Thu, 4 Feb 2016 15:15:28 -0800 (PST) X-ASG-Debug-ID: 1454627724-04cb6c27442a650001-NocioJ Received: from ipmail06.adl2.internode.on.net (ipmail06.adl2.internode.on.net [150.101.137.129]) by cuda.sgi.com with ESMTP id shEtJYqIktwCoies for ; Thu, 04 Feb 2016 15:15:24 -0800 (PST) X-Barracuda-Envelope-From: dave@fromorbit.com X-Barracuda-Apparent-Source-IP: 150.101.137.129 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: A2D3EwDz2rNWPBATLHleKAECgw9SbYZjgXidPwEBAQEBAQZcAQExkBmEJIJAhHFNAQEBAQEBBwEBAQFBP0ESAYNuAQUnLxUOEAgYMTkDBxQZiBrAf4VKiHgehFUFjSWJDECFS4tPiyZEjXyCGAFMGYFcKC6BV4UbgTgBAQE Received: from ppp121-44-19-16.lns20.syd4.internode.on.net (HELO dastard) ([121.44.19.16]) by ipmail06.adl2.internode.on.net with ESMTP; 05 Feb 2016 09:45:20 +1030 Received: from disappointment.disaster.area ([192.168.1.110] helo=disappointment) by dastard with esmtp (Exim 4.80) (envelope-from ) id 1aRT7Q-0000Ik-5L; Fri, 05 Feb 2016 10:15:20 +1100 Received: from dave by disappointment with local (Exim 4.86) (envelope-from ) id 1aRT7Q-00058l-4l; Fri, 05 Feb 2016 10:15:20 +1100 From: Dave Chinner To: xfs@oss.sgi.com Cc: fstests@vger.kernel.org Subject: [PATCH 1/2] xfs_quota: allow operation on foreign filesystem types Date: Fri, 5 Feb 2016 10:15:17 +1100 X-ASG-Orig-Subj: [PATCH 1/2] xfs_quota: allow operation on foreign filesystem types Message-Id: <1454627718-19583-2-git-send-email-david@fromorbit.com> X-Mailer: git-send-email 2.5.0 In-Reply-To: <1454627718-19583-1-git-send-email-david@fromorbit.com> References: <1454627718-19583-1-git-send-email-david@fromorbit.com> X-Barracuda-Connect: ipmail06.adl2.internode.on.net[150.101.137.129] X-Barracuda-Start-Time: 1454627724 X-Barracuda-URL: https://192.48.176.15:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-BRTS-Status: 1 X-Barracuda-Spam-Score: 0.50 X-Barracuda-Spam-Status: No, SCORE=0.50 using per-user scores of TAG_LEVEL=1000.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.7 tests=BSF_SC0_MV0713 X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.3.26751 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 0.50 BSF_SC0_MV0713 Custom rule MV0713 From: Dave Chinner This allows xfs_quota to be used on ext4 for project quota testing in xfstests. Signed-off-by: Dave Chinner --- include/command.h | 3 ++- include/path.h | 1 + io/init.h | 2 +- libxcmd/paths.c | 7 +++---- quota/free.c | 2 ++ quota/init.c | 29 +++++++++++++++++++++++++++-- quota/init.h | 1 + quota/path.c | 5 +++-- quota/project.c | 1 + quota/quot.c | 1 + quota/quota.c | 2 ++ quota/report.c | 11 +++++++++-- quota/state.c | 4 +++- quota/util.c | 1 + 14 files changed, 57 insertions(+), 13 deletions(-) diff --git a/include/command.h b/include/command.h index 7b9fc28..81d5a4d 100644 --- a/include/command.h +++ b/include/command.h @@ -20,7 +20,8 @@ #include -#define CMD_FLAG_GLOBAL ((int)0x80000000) /* don't iterate "args" */ +#define CMD_FLAG_GLOBAL (1<<31) /* don't iterate "args" */ +#define CMD_FLAG_FOREIGN_OK (1<<30) /* command not restricted to XFS */ typedef int (*cfunc_t)(int argc, char **argv); typedef void (*helpfunc_t)(void); diff --git a/include/path.h b/include/path.h index 46a887e..39c1a95 100644 --- a/include/path.h +++ b/include/path.h @@ -29,6 +29,7 @@ #define FS_MOUNT_POINT (1<<0) #define FS_PROJECT_PATH (1<<1) +#define FS_FOREIGN (1<<2) typedef struct fs_path { char *fs_name; /* Data device for filesystem */ diff --git a/io/init.h b/io/init.h index d773b1b..bb25242 100644 --- a/io/init.h +++ b/io/init.h @@ -18,7 +18,7 @@ #define CMD_NOFILE_OK (1<<0) /* command doesn't need an open file */ #define CMD_NOMAP_OK (1<<1) /* command doesn't need a mapped region */ -#define CMD_FOREIGN_OK (1<<2) /* command not restricted to XFS files */ +#define CMD_FOREIGN_OK CMD_FLAG_FOREIGN_OK extern char *progname; extern int exitcode; diff --git a/libxcmd/paths.c b/libxcmd/paths.c index 71af25f..7c8c673 100644 --- a/libxcmd/paths.c +++ b/libxcmd/paths.c @@ -113,6 +113,9 @@ fs_table_insert( goto out_nodev; } + if (!platform_test_xfs_path(dir)) + flags |= FS_FOREIGN; + /* * Make copies of the directory and data device path. * The log device and real-time device, if non-null, @@ -301,8 +304,6 @@ fs_table_initialise_mounts( return errno; while ((mnt = getmntent(mtp)) != NULL) { - if (strcmp(mnt->mnt_type, "xfs") != 0) - continue; if (!realpath(mnt->mnt_dir, rmnt_dir)) continue; if (!realpath(mnt->mnt_fsname, rmnt_fsname)) @@ -360,8 +361,6 @@ fs_table_initialise_mounts( return errno; for (i = 0; i < count; i++) { - if (strcmp(stats[i].f_fstypename, "xfs") != 0) - continue; if (!realpath(stats[i].f_mntfromname, rmntfromname)) continue; if (!realpath(stats[i].f_mntonname, rmntonname)) diff --git a/quota/free.c b/quota/free.c index dcbe8ce..487260a 100644 --- a/quota/free.c +++ b/quota/free.c @@ -16,6 +16,7 @@ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ +#include #include "command.h" #include "init.h" #include "quota.h" @@ -371,6 +372,7 @@ free_init(void) free_cmd.args = _("[-bir] [-hn] [-f file]"); free_cmd.oneline = _("show free and used counts for blocks and inodes"); free_cmd.help = free_help; + free_cmd.flags = CMD_FLAG_FOREIGN_OK; add_command(&free_cmd); } diff --git a/quota/init.c b/quota/init.c index 52f7941..dfd8ce7 100644 --- a/quota/init.c +++ b/quota/init.c @@ -24,6 +24,7 @@ char *progname; int exitcode; int expert; +bool foreign_allowed = false; static char **projopts; /* table of project names (cmdline) */ static int nprojopts; /* number of entries in name table. */ @@ -83,15 +84,36 @@ init_args_command( do { fs_path = &fs_table[index++]; - } while ((fs_path->fs_flags & FS_PROJECT_PATH) && index < fs_count); + if (fs_path->fs_flags & FS_PROJECT_PATH) + continue; + if (!foreign_allowed && (fs_path->fs_flags & FS_FOREIGN)) + continue; + } while (index < fs_count); if (fs_path->fs_flags & FS_PROJECT_PATH) return 0; + if (!foreign_allowed && (fs_path->fs_flags & FS_FOREIGN)) + return 0; if (index > fs_count) return 0; return index; } +static int +init_check_command( + const cmdinfo_t *ct) +{ + if (fs_path && + !(ct->flags & CMD_FLAG_FOREIGN_OK) && + (fs_path->fs_flags & FS_FOREIGN)) { + fprintf(stderr, + _("foreign mount active, %s command is for XFS filesystems only\n"), + ct->name); + return 0; + } + return 1; +} + static void init( int argc, @@ -104,7 +126,7 @@ init( bindtextdomain(PACKAGE, LOCALEDIR); textdomain(PACKAGE); - while ((c = getopt(argc, argv, "c:d:D:P:p:t:xV")) != EOF) { + while ((c = getopt(argc, argv, "c:d:D:fP:p:t:xV")) != EOF) { switch (c) { case 'c': /* commands */ add_user_command(optarg); @@ -112,6 +134,8 @@ init( case 'd': add_project_opt(optarg); break; + case 'f': + foreign_allowed = true; case 't': mtab_file = optarg; break; @@ -140,6 +164,7 @@ init( init_commands(); add_args_command(init_args_command); + add_check_command(init_check_command); /* * Ensure that global commands don't end up with an invalid path pointer diff --git a/quota/init.h b/quota/init.h index 71706cb..6879855 100644 --- a/quota/init.h +++ b/quota/init.h @@ -19,6 +19,7 @@ extern char *progname; extern int exitcode; extern int expert; +extern bool foreign_allowed; extern void edit_init(void); extern void free_init(void); diff --git a/quota/path.c b/quota/path.c index bdb8c98..a623d25 100644 --- a/quota/path.c +++ b/quota/path.c @@ -42,6 +42,7 @@ printpath( if (number) { printf(_("%c%03d%c "), braces? '[':' ', index, braces? ']':' '); } + printf("%s ", (path->fs_flags & FS_FOREIGN) ? "(F)" : " "); printf(_("%-19s %s"), path->fs_dir, path->fs_name); if (path->fs_flags & FS_PROJECT_PATH) { prj = getprprid(path->fs_prid); @@ -127,7 +128,7 @@ path_init(void) path_cmd.cfunc = path_f; path_cmd.argmin = 0; path_cmd.argmax = 1; - path_cmd.flags = CMD_FLAG_GLOBAL; + path_cmd.flags = CMD_FLAG_GLOBAL | CMD_FLAG_FOREIGN_OK; path_cmd.oneline = _("set current path, or show the list of paths"); print_cmd.name = "print"; @@ -135,7 +136,7 @@ path_init(void) print_cmd.cfunc = print_f; print_cmd.argmin = 0; print_cmd.argmax = 0; - print_cmd.flags = CMD_FLAG_GLOBAL; + print_cmd.flags = CMD_FLAG_GLOBAL | CMD_FLAG_FOREIGN_OK; print_cmd.oneline = _("list known mount points and projects"); if (expert) diff --git a/quota/project.c b/quota/project.c index 17a83b0..79a0a8e 100644 --- a/quota/project.c +++ b/quota/project.c @@ -355,6 +355,7 @@ project_init(void) project_cmd.argmax = -1; project_cmd.oneline = _("check, setup or clear project quota trees"); project_cmd.help = project_help; + project_cmd.flags = CMD_FLAG_FOREIGN_OK; if (expert) add_command(&project_cmd); diff --git a/quota/quot.c b/quota/quot.c index 9116e48..cff8629 100644 --- a/quota/quot.c +++ b/quota/quot.c @@ -16,6 +16,7 @@ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ +#include #include "command.h" #include #include diff --git a/quota/quota.c b/quota/quota.c index f6b24c3..dd12158 100644 --- a/quota/quota.c +++ b/quota/quota.c @@ -16,6 +16,7 @@ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ +#include #include "command.h" #include #include @@ -464,6 +465,7 @@ quota_init(void) quota_cmd.args = _("[-bir] [-gpu] [-hnNv] [-f file] [id|name]..."); quota_cmd.oneline = _("show usage and limits"); quota_cmd.help = quota_help; + quota_cmd.flags = CMD_FLAG_FOREIGN_OK; add_command("a_cmd); } diff --git a/quota/report.c b/quota/report.c index 8653134..e8e5d96 100644 --- a/quota/report.c +++ b/quota/report.c @@ -15,7 +15,7 @@ * along with this program; if not, write the Free Software Foundation, * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ - +#include #include "command.h" #include #include @@ -592,6 +592,8 @@ report_any_type( if (type & XFS_USER_QUOTA) { fs_cursor_initialise(dir, FS_MOUNT_POINT, &cursor); while ((mount = fs_cursor_next_entry(&cursor))) { + if (!foreign_allowed && (mount->fs_flags & FS_FOREIGN)) + continue; if (xfsquotactl(XFS_QSYNC, mount->fs_name, XFS_USER_QUOTA, 0, NULL) < 0 && errno != ENOENT && errno != ENOSYS) @@ -603,6 +605,8 @@ report_any_type( if (type & XFS_GROUP_QUOTA) { fs_cursor_initialise(dir, FS_MOUNT_POINT, &cursor); while ((mount = fs_cursor_next_entry(&cursor))) { + if (!foreign_allowed && (mount->fs_flags & FS_FOREIGN)) + continue; if (xfsquotactl(XFS_QSYNC, mount->fs_name, XFS_GROUP_QUOTA, 0, NULL) < 0 && errno != ENOENT && errno != ENOSYS) @@ -614,6 +618,8 @@ report_any_type( if (type & XFS_PROJ_QUOTA) { fs_cursor_initialise(dir, FS_MOUNT_POINT, &cursor); while ((mount = fs_cursor_next_entry(&cursor))) { + if (!foreign_allowed && (mount->fs_flags & FS_FOREIGN)) + continue; if (xfsquotactl(XFS_QSYNC, mount->fs_name, XFS_PROJ_QUOTA, 0, NULL) < 0 && errno != ENOENT && errno != ENOSYS) @@ -728,16 +734,17 @@ report_init(void) dump_cmd.args = _("[-gpu] [-f file]"); dump_cmd.oneline = _("dump quota information for backup utilities"); dump_cmd.help = dump_help; + dump_cmd.flags = CMD_FLAG_FOREIGN_OK; report_cmd.name = "report"; report_cmd.altname = "repquota"; report_cmd.cfunc = report_f; report_cmd.argmin = 0; report_cmd.argmax = -1; - report_cmd.flags = CMD_FLAG_GLOBAL; report_cmd.args = _("[-bir] [-gpu] [-ahnt] [-f file]"); report_cmd.oneline = _("report filesystem quota information"); report_cmd.help = report_help; + report_cmd.flags = CMD_FLAG_GLOBAL | CMD_FLAG_FOREIGN_OK; if (expert) { add_command(&dump_cmd); diff --git a/quota/state.c b/quota/state.c index 8186762..d134580 100644 --- a/quota/state.c +++ b/quota/state.c @@ -15,7 +15,7 @@ * along with this program; if not, write the Free Software Foundation, * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ - +#include #include "command.h" #include "init.h" #include "quota.h" @@ -527,6 +527,7 @@ state_init(void) off_cmd.args = _("[-gpu] [-v]"); off_cmd.oneline = _("permanently switch quota off for a path"); off_cmd.help = off_help; + off_cmd.flags = CMD_FLAG_FOREIGN_OK; state_cmd.name = "state"; state_cmd.cfunc = state_f; @@ -535,6 +536,7 @@ state_init(void) state_cmd.args = _("[-gpu] [-a] [-v] [-f file]"); state_cmd.oneline = _("get overall quota state information"); state_cmd.help = state_help; + state_cmd.flags = CMD_FLAG_FOREIGN_OK; enable_cmd.name = "enable"; enable_cmd.cfunc = enable_f; diff --git a/quota/util.c b/quota/util.c index 7c43fbd..42746d9 100644 --- a/quota/util.c +++ b/quota/util.c @@ -17,6 +17,7 @@ */ #include +#include #include #include #include -- 2.5.0 From sandeen@sandeen.net Thu Feb 4 18:04:11 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=ham version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay3.corp.sgi.com [198.149.34.15]) by oss.sgi.com (Postfix) with ESMTP id 951C57CA2 for ; Thu, 4 Feb 2016 18:04:11 -0600 (CST) Received: from cuda.sgi.com (cuda2.sgi.com [192.48.176.25]) by relay3.corp.sgi.com (Postfix) with ESMTP id 071BBAC001 for ; Thu, 4 Feb 2016 16:04:07 -0800 (PST) X-ASG-Debug-ID: 1454630644-04cbb04cf944f50001-NocioJ Received: from sandeen.net (sandeen.net [63.231.237.45]) by cuda.sgi.com with ESMTP id IhTt8u2Xxf17N8il for ; Thu, 04 Feb 2016 16:04:04 -0800 (PST) X-Barracuda-Envelope-From: sandeen@sandeen.net X-Barracuda-Apparent-Source-IP: 63.231.237.45 Received: from Liberator.local (70-90-76-85-BusName-mn.hfc.comcastbusiness.net [70.90.76.85]) (using TLSv1.2 with cipher DHE-RSA-AES128-SHA (128/128 bits)) (No client certificate requested) by sandeen.net (Postfix) with ESMTPSA id A6B7D63C5D8D; Thu, 4 Feb 2016 18:04:03 -0600 (CST) Subject: Re: [PATCH 1/2] xfs_quota: allow operation on foreign filesystem types To: Dave Chinner , xfs@oss.sgi.com X-ASG-Orig-Subj: Re: [PATCH 1/2] xfs_quota: allow operation on foreign filesystem types References: <1454627718-19583-1-git-send-email-david@fromorbit.com> <1454627718-19583-2-git-send-email-david@fromorbit.com> Cc: fstests@vger.kernel.org From: Eric Sandeen X-Enigmail-Draft-Status: N1110 Message-ID: <56B3E6F3.802@sandeen.net> Date: Thu, 4 Feb 2016 18:04:03 -0600 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.11; rv:38.0) Gecko/20100101 Thunderbird/38.5.1 MIME-Version: 1.0 In-Reply-To: <1454627718-19583-2-git-send-email-david@fromorbit.com> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 8bit X-Barracuda-Connect: sandeen.net[63.231.237.45] X-Barracuda-Start-Time: 1454630644 X-Barracuda-URL: https://192.48.176.25:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-BRTS-Status: 1 X-Barracuda-Spam-Score: 0.50 X-Barracuda-Spam-Status: No, SCORE=0.50 using per-user scores of TAG_LEVEL=1000.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.7 tests=BSF_SC0_MISMATCH_TO, BSF_SC0_MV0713 X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.3.26753 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 0.00 BSF_SC0_MISMATCH_TO Envelope rcpt doesn't match header 0.50 BSF_SC0_MV0713 Custom rule MV0713 Looks ok, but now with the new option: 1) needs a manpage update 2) usage() should be updated to include -f 3) and I just noticed, _("foreign mount active, %s command is for XFS filesystems only\n"), seems kind of unclear; maybe just _("%s command is for XFS filesystems only\n"), But I'm also seeing a lot of noise in output with "-f" - # quota/xfs_quota -f -x -c "report -a" XFS_QSYNC proj quota: Invalid argument XFS_QSYNC proj quota: Invalid argument XFS_QSYNC proj quota: Invalid argument # quota/xfs_quota -f -x -c "report" /dev/sdb2 XFS_QSYNC proj quota: Invalid argument even though there are quotas... # repquota /mnt/scratch *** Report for user quotas on device /dev/sdb2 Block grace time: 7days; Inode grace time: 7days Block limits File limits User used soft hard grace used soft hard grace ---------------------------------------------------------------------- root -- 20 0 0 2 0 0 so something's not quite right :) -Eric On 2/4/16 5:15 PM, Dave Chinner wrote: > From: Dave Chinner > > This allows xfs_quota to be used on ext4 for project quota testing > in xfstests. > > Signed-off-by: Dave Chinner > --- > include/command.h | 3 ++- > include/path.h | 1 + > io/init.h | 2 +- > libxcmd/paths.c | 7 +++---- > quota/free.c | 2 ++ > quota/init.c | 29 +++++++++++++++++++++++++++-- > quota/init.h | 1 + > quota/path.c | 5 +++-- > quota/project.c | 1 + > quota/quot.c | 1 + > quota/quota.c | 2 ++ > quota/report.c | 11 +++++++++-- > quota/state.c | 4 +++- > quota/util.c | 1 + > 14 files changed, 57 insertions(+), 13 deletions(-) > > diff --git a/include/command.h b/include/command.h > index 7b9fc28..81d5a4d 100644 > --- a/include/command.h > +++ b/include/command.h > @@ -20,7 +20,8 @@ > > #include > > -#define CMD_FLAG_GLOBAL ((int)0x80000000) /* don't iterate "args" */ > +#define CMD_FLAG_GLOBAL (1<<31) /* don't iterate "args" */ > +#define CMD_FLAG_FOREIGN_OK (1<<30) /* command not restricted to XFS */ > > typedef int (*cfunc_t)(int argc, char **argv); > typedef void (*helpfunc_t)(void); > diff --git a/include/path.h b/include/path.h > index 46a887e..39c1a95 100644 > --- a/include/path.h > +++ b/include/path.h > @@ -29,6 +29,7 @@ > > #define FS_MOUNT_POINT (1<<0) > #define FS_PROJECT_PATH (1<<1) > +#define FS_FOREIGN (1<<2) > > typedef struct fs_path { > char *fs_name; /* Data device for filesystem */ > diff --git a/io/init.h b/io/init.h > index d773b1b..bb25242 100644 > --- a/io/init.h > +++ b/io/init.h > @@ -18,7 +18,7 @@ > > #define CMD_NOFILE_OK (1<<0) /* command doesn't need an open file */ > #define CMD_NOMAP_OK (1<<1) /* command doesn't need a mapped region */ > -#define CMD_FOREIGN_OK (1<<2) /* command not restricted to XFS files */ > +#define CMD_FOREIGN_OK CMD_FLAG_FOREIGN_OK > > extern char *progname; > extern int exitcode; > diff --git a/libxcmd/paths.c b/libxcmd/paths.c > index 71af25f..7c8c673 100644 > --- a/libxcmd/paths.c > +++ b/libxcmd/paths.c > @@ -113,6 +113,9 @@ fs_table_insert( > goto out_nodev; > } > > + if (!platform_test_xfs_path(dir)) > + flags |= FS_FOREIGN; > + > /* > * Make copies of the directory and data device path. > * The log device and real-time device, if non-null, > @@ -301,8 +304,6 @@ fs_table_initialise_mounts( > return errno; > > while ((mnt = getmntent(mtp)) != NULL) { > - if (strcmp(mnt->mnt_type, "xfs") != 0) > - continue; > if (!realpath(mnt->mnt_dir, rmnt_dir)) > continue; > if (!realpath(mnt->mnt_fsname, rmnt_fsname)) > @@ -360,8 +361,6 @@ fs_table_initialise_mounts( > return errno; > > for (i = 0; i < count; i++) { > - if (strcmp(stats[i].f_fstypename, "xfs") != 0) > - continue; > if (!realpath(stats[i].f_mntfromname, rmntfromname)) > continue; > if (!realpath(stats[i].f_mntonname, rmntonname)) > diff --git a/quota/free.c b/quota/free.c > index dcbe8ce..487260a 100644 > --- a/quota/free.c > +++ b/quota/free.c > @@ -16,6 +16,7 @@ > * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA > */ > > +#include > #include "command.h" > #include "init.h" > #include "quota.h" > @@ -371,6 +372,7 @@ free_init(void) > free_cmd.args = _("[-bir] [-hn] [-f file]"); > free_cmd.oneline = _("show free and used counts for blocks and inodes"); > free_cmd.help = free_help; > + free_cmd.flags = CMD_FLAG_FOREIGN_OK; > > add_command(&free_cmd); > } > diff --git a/quota/init.c b/quota/init.c > index 52f7941..dfd8ce7 100644 > --- a/quota/init.c > +++ b/quota/init.c > @@ -24,6 +24,7 @@ > char *progname; > int exitcode; > int expert; > +bool foreign_allowed = false; > > static char **projopts; /* table of project names (cmdline) */ > static int nprojopts; /* number of entries in name table. */ > @@ -83,15 +84,36 @@ init_args_command( > > do { > fs_path = &fs_table[index++]; > - } while ((fs_path->fs_flags & FS_PROJECT_PATH) && index < fs_count); > + if (fs_path->fs_flags & FS_PROJECT_PATH) > + continue; > + if (!foreign_allowed && (fs_path->fs_flags & FS_FOREIGN)) > + continue; > + } while (index < fs_count); > > if (fs_path->fs_flags & FS_PROJECT_PATH) > return 0; > + if (!foreign_allowed && (fs_path->fs_flags & FS_FOREIGN)) > + return 0; > if (index > fs_count) > return 0; > return index; > } > > +static int > +init_check_command( > + const cmdinfo_t *ct) > +{ > + if (fs_path && > + !(ct->flags & CMD_FLAG_FOREIGN_OK) && > + (fs_path->fs_flags & FS_FOREIGN)) { > + fprintf(stderr, > + _("foreign mount active, %s command is for XFS filesystems only\n"), > + ct->name); > + return 0; > + } > + return 1; > +} > + > static void > init( > int argc, > @@ -104,7 +126,7 @@ init( > bindtextdomain(PACKAGE, LOCALEDIR); > textdomain(PACKAGE); > > - while ((c = getopt(argc, argv, "c:d:D:P:p:t:xV")) != EOF) { > + while ((c = getopt(argc, argv, "c:d:D:fP:p:t:xV")) != EOF) { > switch (c) { > case 'c': /* commands */ > add_user_command(optarg); > @@ -112,6 +134,8 @@ init( > case 'd': > add_project_opt(optarg); > break; > + case 'f': > + foreign_allowed = true; > case 't': > mtab_file = optarg; > break; > @@ -140,6 +164,7 @@ init( > > init_commands(); > add_args_command(init_args_command); > + add_check_command(init_check_command); > > /* > * Ensure that global commands don't end up with an invalid path pointer > diff --git a/quota/init.h b/quota/init.h > index 71706cb..6879855 100644 > --- a/quota/init.h > +++ b/quota/init.h > @@ -19,6 +19,7 @@ > extern char *progname; > extern int exitcode; > extern int expert; > +extern bool foreign_allowed; > > extern void edit_init(void); > extern void free_init(void); > diff --git a/quota/path.c b/quota/path.c > index bdb8c98..a623d25 100644 > --- a/quota/path.c > +++ b/quota/path.c > @@ -42,6 +42,7 @@ printpath( > if (number) { > printf(_("%c%03d%c "), braces? '[':' ', index, braces? ']':' '); > } > + printf("%s ", (path->fs_flags & FS_FOREIGN) ? "(F)" : " "); > printf(_("%-19s %s"), path->fs_dir, path->fs_name); > if (path->fs_flags & FS_PROJECT_PATH) { > prj = getprprid(path->fs_prid); > @@ -127,7 +128,7 @@ path_init(void) > path_cmd.cfunc = path_f; > path_cmd.argmin = 0; > path_cmd.argmax = 1; > - path_cmd.flags = CMD_FLAG_GLOBAL; > + path_cmd.flags = CMD_FLAG_GLOBAL | CMD_FLAG_FOREIGN_OK; > path_cmd.oneline = _("set current path, or show the list of paths"); > > print_cmd.name = "print"; > @@ -135,7 +136,7 @@ path_init(void) > print_cmd.cfunc = print_f; > print_cmd.argmin = 0; > print_cmd.argmax = 0; > - print_cmd.flags = CMD_FLAG_GLOBAL; > + print_cmd.flags = CMD_FLAG_GLOBAL | CMD_FLAG_FOREIGN_OK; > print_cmd.oneline = _("list known mount points and projects"); > > if (expert) > diff --git a/quota/project.c b/quota/project.c > index 17a83b0..79a0a8e 100644 > --- a/quota/project.c > +++ b/quota/project.c > @@ -355,6 +355,7 @@ project_init(void) > project_cmd.argmax = -1; > project_cmd.oneline = _("check, setup or clear project quota trees"); > project_cmd.help = project_help; > + project_cmd.flags = CMD_FLAG_FOREIGN_OK; > > if (expert) > add_command(&project_cmd); > diff --git a/quota/quot.c b/quota/quot.c > index 9116e48..cff8629 100644 > --- a/quota/quot.c > +++ b/quota/quot.c > @@ -16,6 +16,7 @@ > * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA > */ > > +#include > #include "command.h" > #include > #include > diff --git a/quota/quota.c b/quota/quota.c > index f6b24c3..dd12158 100644 > --- a/quota/quota.c > +++ b/quota/quota.c > @@ -16,6 +16,7 @@ > * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA > */ > > +#include > #include "command.h" > #include > #include > @@ -464,6 +465,7 @@ quota_init(void) > quota_cmd.args = _("[-bir] [-gpu] [-hnNv] [-f file] [id|name]..."); > quota_cmd.oneline = _("show usage and limits"); > quota_cmd.help = quota_help; > + quota_cmd.flags = CMD_FLAG_FOREIGN_OK; > > add_command("a_cmd); > } > diff --git a/quota/report.c b/quota/report.c > index 8653134..e8e5d96 100644 > --- a/quota/report.c > +++ b/quota/report.c > @@ -15,7 +15,7 @@ > * along with this program; if not, write the Free Software Foundation, > * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA > */ > - > +#include > #include "command.h" > #include > #include > @@ -592,6 +592,8 @@ report_any_type( > if (type & XFS_USER_QUOTA) { > fs_cursor_initialise(dir, FS_MOUNT_POINT, &cursor); > while ((mount = fs_cursor_next_entry(&cursor))) { > + if (!foreign_allowed && (mount->fs_flags & FS_FOREIGN)) > + continue; > if (xfsquotactl(XFS_QSYNC, mount->fs_name, > XFS_USER_QUOTA, 0, NULL) < 0 > && errno != ENOENT && errno != ENOSYS) > @@ -603,6 +605,8 @@ report_any_type( > if (type & XFS_GROUP_QUOTA) { > fs_cursor_initialise(dir, FS_MOUNT_POINT, &cursor); > while ((mount = fs_cursor_next_entry(&cursor))) { > + if (!foreign_allowed && (mount->fs_flags & FS_FOREIGN)) > + continue; > if (xfsquotactl(XFS_QSYNC, mount->fs_name, > XFS_GROUP_QUOTA, 0, NULL) < 0 > && errno != ENOENT && errno != ENOSYS) > @@ -614,6 +618,8 @@ report_any_type( > if (type & XFS_PROJ_QUOTA) { > fs_cursor_initialise(dir, FS_MOUNT_POINT, &cursor); > while ((mount = fs_cursor_next_entry(&cursor))) { > + if (!foreign_allowed && (mount->fs_flags & FS_FOREIGN)) > + continue; > if (xfsquotactl(XFS_QSYNC, mount->fs_name, > XFS_PROJ_QUOTA, 0, NULL) < 0 > && errno != ENOENT && errno != ENOSYS) > @@ -728,16 +734,17 @@ report_init(void) > dump_cmd.args = _("[-gpu] [-f file]"); > dump_cmd.oneline = _("dump quota information for backup utilities"); > dump_cmd.help = dump_help; > + dump_cmd.flags = CMD_FLAG_FOREIGN_OK; > > report_cmd.name = "report"; > report_cmd.altname = "repquota"; > report_cmd.cfunc = report_f; > report_cmd.argmin = 0; > report_cmd.argmax = -1; > - report_cmd.flags = CMD_FLAG_GLOBAL; > report_cmd.args = _("[-bir] [-gpu] [-ahnt] [-f file]"); > report_cmd.oneline = _("report filesystem quota information"); > report_cmd.help = report_help; > + report_cmd.flags = CMD_FLAG_GLOBAL | CMD_FLAG_FOREIGN_OK; > > if (expert) { > add_command(&dump_cmd); > diff --git a/quota/state.c b/quota/state.c > index 8186762..d134580 100644 > --- a/quota/state.c > +++ b/quota/state.c > @@ -15,7 +15,7 @@ > * along with this program; if not, write the Free Software Foundation, > * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA > */ > - > +#include > #include "command.h" > #include "init.h" > #include "quota.h" > @@ -527,6 +527,7 @@ state_init(void) > off_cmd.args = _("[-gpu] [-v]"); > off_cmd.oneline = _("permanently switch quota off for a path"); > off_cmd.help = off_help; > + off_cmd.flags = CMD_FLAG_FOREIGN_OK; > > state_cmd.name = "state"; > state_cmd.cfunc = state_f; > @@ -535,6 +536,7 @@ state_init(void) > state_cmd.args = _("[-gpu] [-a] [-v] [-f file]"); > state_cmd.oneline = _("get overall quota state information"); > state_cmd.help = state_help; > + state_cmd.flags = CMD_FLAG_FOREIGN_OK; > > enable_cmd.name = "enable"; > enable_cmd.cfunc = enable_f; > diff --git a/quota/util.c b/quota/util.c > index 7c43fbd..42746d9 100644 > --- a/quota/util.c > +++ b/quota/util.c > @@ -17,6 +17,7 @@ > */ > > #include > +#include > #include > #include > #include > From dave@fromorbit.com Thu Feb 4 18:41:19 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=ham version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay3.corp.sgi.com [198.149.34.15]) by oss.sgi.com (Postfix) with ESMTP id E38A07CA2 for ; Thu, 4 Feb 2016 18:41:19 -0600 (CST) Received: from cuda.sgi.com (cuda3.sgi.com [192.48.176.15]) by relay3.corp.sgi.com (Postfix) with ESMTP id 69080AC001 for ; Thu, 4 Feb 2016 16:41:19 -0800 (PST) X-ASG-Debug-ID: 1454632876-04cb6c27452bfa0001-NocioJ Received: from ipmail06.adl2.internode.on.net (ipmail06.adl2.internode.on.net [150.101.137.129]) by cuda.sgi.com with ESMTP id Npc42wR235VUPdPR for ; Thu, 04 Feb 2016 16:41:16 -0800 (PST) X-Barracuda-Envelope-From: dave@fromorbit.com X-Barracuda-Apparent-Source-IP: 150.101.137.129 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: A2CzEwDo7rNWPBATLHleKAECgw+IIoF4nT8BAQEBAQEGjByFDItTTQEBAQEBAQcBAQEBQT9BEgGESjuBAgMHiEeiBJ52hUqJfYNuBZZxnECOQIIYAQEIAQEBAT8ZgVwoggWGUwEBAQ Received: from ppp121-44-19-16.lns20.syd4.internode.on.net (HELO dastard) ([121.44.19.16]) by ipmail06.adl2.internode.on.net with ESMTP; 05 Feb 2016 11:08:06 +1030 Received: from disappointment.disaster.area ([192.168.1.110] helo=disappointment) by dastard with esmtp (Exim 4.80) (envelope-from ) id 1aRUPV-0000Rh-8u for xfs@oss.sgi.com; Fri, 05 Feb 2016 11:38:05 +1100 Received: from dave by disappointment with local (Exim 4.86) (envelope-from ) id 1aRUPV-0005MP-7s for xfs@oss.sgi.com; Fri, 05 Feb 2016 11:38:05 +1100 From: Dave Chinner To: xfs@oss.sgi.com Subject: [PATCH 0/6] xfs: clean up buffer flag macros Date: Fri, 5 Feb 2016 11:37:57 +1100 X-ASG-Orig-Subj: [PATCH 0/6] xfs: clean up buffer flag macros Message-Id: <1454632683-20543-1-git-send-email-david@fromorbit.com> X-Mailer: git-send-email 2.5.0 X-Barracuda-Connect: ipmail06.adl2.internode.on.net[150.101.137.129] X-Barracuda-Start-Time: 1454632876 X-Barracuda-URL: https://192.48.176.15:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-BRTS-Status: 1 X-Barracuda-Spam-Score: 0.00 X-Barracuda-Spam-Status: No, SCORE=0.00 using per-user scores of TAG_LEVEL=1000.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.7 tests= X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.3.26754 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- Hi folks, This series gets rid of the remaining XFS_BUF flag macros. We've removed most of them over the past few years as we've made changes, with only a few now remaining. May as well get rid of them for good... -Dave. From dave@fromorbit.com Thu Feb 4 18:41:22 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=ham version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay3.corp.sgi.com [198.149.34.15]) by oss.sgi.com (Postfix) with ESMTP id 0184029E00 for ; Thu, 4 Feb 2016 18:41:22 -0600 (CST) Received: from cuda.sgi.com (cuda1.sgi.com [192.48.157.11]) by relay3.corp.sgi.com (Postfix) with ESMTP id A3188AC004 for ; Thu, 4 Feb 2016 16:41:21 -0800 (PST) X-ASG-Debug-ID: 1454632878-04bdf079c12d6b0001-NocioJ Received: from ipmail06.adl2.internode.on.net (ipmail06.adl2.internode.on.net [150.101.137.129]) by cuda.sgi.com with ESMTP id b9EKeSIPCwZQdhbP for ; Thu, 04 Feb 2016 16:41:19 -0800 (PST) X-Barracuda-Envelope-From: dave@fromorbit.com X-Barracuda-Apparent-Source-IP: 150.101.137.129 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: A2AtDQDo7rNWPBATLHleKAECgw+BP4ZjgXidPwEBAQEBAQaRKItTTQEBAQEBAQcBAQEBQT9BEgGDbgEFJy8zCBgxOQMHFBmIGsB6hUqJfYNuBZZxnEBEjXyCGAELQRmBXCgugVeGUwEBAQ Received: from ppp121-44-19-16.lns20.syd4.internode.on.net (HELO dastard) ([121.44.19.16]) by ipmail06.adl2.internode.on.net with ESMTP; 05 Feb 2016 11:08:06 +1030 Received: from disappointment.disaster.area ([192.168.1.110] helo=disappointment) by dastard with esmtp (Exim 4.80) (envelope-from ) id 1aRUPV-0000Rm-B2 for xfs@oss.sgi.com; Fri, 05 Feb 2016 11:38:05 +1100 Received: from dave by disappointment with local (Exim 4.86) (envelope-from ) id 1aRUPV-0005Mm-AH for xfs@oss.sgi.com; Fri, 05 Feb 2016 11:38:05 +1100 From: Dave Chinner To: xfs@oss.sgi.com Subject: [PATCH 5/6] xfs: remove XBF_STALE flag wrapper macros Date: Fri, 5 Feb 2016 11:38:02 +1100 X-ASG-Orig-Subj: [PATCH 5/6] xfs: remove XBF_STALE flag wrapper macros Message-Id: <1454632683-20543-6-git-send-email-david@fromorbit.com> X-Mailer: git-send-email 2.5.0 In-Reply-To: <1454632683-20543-1-git-send-email-david@fromorbit.com> References: <1454632683-20543-1-git-send-email-david@fromorbit.com> X-Barracuda-Connect: ipmail06.adl2.internode.on.net[150.101.137.129] X-Barracuda-Start-Time: 1454632878 X-Barracuda-URL: https://192.48.157.11:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-BRTS-Status: 1 X-Barracuda-Spam-Score: 0.00 X-Barracuda-Spam-Status: No, SCORE=0.00 using per-user scores of TAG_LEVEL=1000.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.7 tests= X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.3.26755 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- From: Dave Chinner They only set/clear/check a flag, no need for obfuscating this with a macro. Signed-off-by: Dave Chinner --- fs/xfs/xfs_buf.h | 4 +--- fs/xfs/xfs_buf_item.c | 2 +- fs/xfs/xfs_trans_buf.c | 6 +++--- 3 files changed, 5 insertions(+), 7 deletions(-) diff --git a/fs/xfs/xfs_buf.h b/fs/xfs/xfs_buf.h index a118962..98b7ee9 100644 --- a/fs/xfs/xfs_buf.h +++ b/fs/xfs/xfs_buf.h @@ -302,6 +302,7 @@ extern void xfs_buf_iomove(xfs_buf_t *, size_t, size_t, void *, /* Buffer Utility Routines */ extern void *xfs_buf_offset(struct xfs_buf *, size_t); +extern void xfs_buf_stale(struct xfs_buf *bp); /* Delayed Write Buffer Routines */ extern bool xfs_buf_delwri_queue(struct xfs_buf *, struct list_head *); @@ -317,9 +318,6 @@ extern void xfs_buf_terminate(void); XBF_SYNCIO|XBF_FUA|XBF_FLUSH| \ XBF_WRITE_FAIL)) -void xfs_buf_stale(struct xfs_buf *bp); -#define XFS_BUF_UNSTALE(bp) ((bp)->b_flags &= ~XBF_STALE) -#define XFS_BUF_ISSTALE(bp) ((bp)->b_flags & XBF_STALE) /* * These macros use the IO block map rather than b_bn. b_bn is now really diff --git a/fs/xfs/xfs_buf_item.c b/fs/xfs/xfs_buf_item.c index 344ab44..2891134 100644 --- a/fs/xfs/xfs_buf_item.c +++ b/fs/xfs/xfs_buf_item.c @@ -408,7 +408,7 @@ xfs_buf_item_unpin( if (freed && stale) { ASSERT(bip->bli_flags & XFS_BLI_STALE); ASSERT(xfs_buf_islocked(bp)); - ASSERT(XFS_BUF_ISSTALE(bp)); + ASSERT(bp->b_flags & XBF_STALE); ASSERT(bip->__bli_format.blf_flags & XFS_BLF_CANCEL); trace_xfs_buf_item_unpin_stale(bip); diff --git a/fs/xfs/xfs_trans_buf.c b/fs/xfs/xfs_trans_buf.c index ed6f61f..8ee29ca 100644 --- a/fs/xfs/xfs_trans_buf.c +++ b/fs/xfs/xfs_trans_buf.c @@ -534,8 +534,8 @@ xfs_trans_log_buf(xfs_trans_t *tp, */ if (bip->bli_flags & XFS_BLI_STALE) { bip->bli_flags &= ~XFS_BLI_STALE; - ASSERT(XFS_BUF_ISSTALE(bp)); - XFS_BUF_UNSTALE(bp); + ASSERT(bp->b_flags & XBF_STALE); + bp->b_flags &= ~XBF_STALE; bip->__bli_format.blf_flags &= ~XFS_BLF_CANCEL; } @@ -600,7 +600,7 @@ xfs_trans_binval( * If the buffer is already invalidated, then * just return. */ - ASSERT(XFS_BUF_ISSTALE(bp)); + ASSERT(bp->b_flags & XBF_STALE); ASSERT(!(bip->bli_flags & (XFS_BLI_LOGGED | XFS_BLI_DIRTY))); ASSERT(!(bip->__bli_format.blf_flags & XFS_BLF_INODE_BUF)); ASSERT(!(bip->__bli_format.blf_flags & XFS_BLFT_MASK)); -- 2.5.0 From dave@fromorbit.com Thu Feb 4 18:41:22 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=ham version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay2.corp.sgi.com [137.38.102.29]) by oss.sgi.com (Postfix) with ESMTP id D612629E00 for ; Thu, 4 Feb 2016 18:41:22 -0600 (CST) Received: from cuda.sgi.com (cuda3.sgi.com [192.48.176.15]) by relay2.corp.sgi.com (Postfix) with ESMTP id C5E2E30405F for ; Thu, 4 Feb 2016 16:41:22 -0800 (PST) X-ASG-Debug-ID: 1454632876-04cb6c27452bfa0003-NocioJ Received: from ipmail06.adl2.internode.on.net (ipmail06.adl2.internode.on.net [150.101.137.129]) by cuda.sgi.com with ESMTP id xoeSmTHVR6TNqdiW for ; Thu, 04 Feb 2016 16:41:21 -0800 (PST) X-Barracuda-Envelope-From: dave@fromorbit.com X-Barracuda-Apparent-Source-IP: 150.101.137.129 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: A2AtDQDo7rNWPBATLHleKAECgw+BP4ZjgXidPwEBAQEBAQaRKItTTQEBAQEBAQcBAQEBQT9BEgGDbgEFJy8zCBgxOQMHFBmIGsB6hUqJfYNuBZZxnEBEjXyCGAELQRmBXCgugVeGUwEBAQ Received: from ppp121-44-19-16.lns20.syd4.internode.on.net (HELO dastard) ([121.44.19.16]) by ipmail06.adl2.internode.on.net with ESMTP; 05 Feb 2016 11:08:06 +1030 Received: from disappointment.disaster.area ([192.168.1.110] helo=disappointment) by dastard with esmtp (Exim 4.80) (envelope-from ) id 1aRUPV-0000Rk-AE for xfs@oss.sgi.com; Fri, 05 Feb 2016 11:38:05 +1100 Received: from dave by disappointment with local (Exim 4.86) (envelope-from ) id 1aRUPV-0005Mc-9R for xfs@oss.sgi.com; Fri, 05 Feb 2016 11:38:05 +1100 From: Dave Chinner To: xfs@oss.sgi.com Subject: [PATCH 3/6] xfs: remove XBF_READ flag wrapper macros Date: Fri, 5 Feb 2016 11:38:00 +1100 X-ASG-Orig-Subj: [PATCH 3/6] xfs: remove XBF_READ flag wrapper macros Message-Id: <1454632683-20543-4-git-send-email-david@fromorbit.com> X-Mailer: git-send-email 2.5.0 In-Reply-To: <1454632683-20543-1-git-send-email-david@fromorbit.com> References: <1454632683-20543-1-git-send-email-david@fromorbit.com> X-Barracuda-Connect: ipmail06.adl2.internode.on.net[150.101.137.129] X-Barracuda-Start-Time: 1454632880 X-Barracuda-URL: https://192.48.176.15:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-BRTS-Status: 1 X-Barracuda-Spam-Score: 0.00 X-Barracuda-Spam-Status: No, SCORE=0.00 using per-user scores of TAG_LEVEL=1000.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.7 tests= X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.3.26754 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- From: Dave Chinner They only set/clear/check a flag, no need for obfuscating this with a macro. Signed-off-by: Dave Chinner --- fs/xfs/xfs_buf.h | 4 ---- fs/xfs/xfs_log_recover.c | 4 ++-- 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/fs/xfs/xfs_buf.h b/fs/xfs/xfs_buf.h index 2a28d1c..329e612 100644 --- a/fs/xfs/xfs_buf.h +++ b/fs/xfs/xfs_buf.h @@ -321,10 +321,6 @@ void xfs_buf_stale(struct xfs_buf *bp); #define XFS_BUF_UNSTALE(bp) ((bp)->b_flags &= ~XBF_STALE) #define XFS_BUF_ISSTALE(bp) ((bp)->b_flags & XBF_STALE) -#define XFS_BUF_READ(bp) ((bp)->b_flags |= XBF_READ) -#define XFS_BUF_UNREAD(bp) ((bp)->b_flags &= ~XBF_READ) -#define XFS_BUF_ISREAD(bp) ((bp)->b_flags & XBF_READ) - #define XFS_BUF_WRITE(bp) ((bp)->b_flags |= XBF_WRITE) #define XFS_BUF_UNWRITE(bp) ((bp)->b_flags &= ~XBF_WRITE) #define XFS_BUF_ISWRITE(bp) ((bp)->b_flags & XBF_WRITE) diff --git a/fs/xfs/xfs_log_recover.c b/fs/xfs/xfs_log_recover.c index b34337d..81c525a 100644 --- a/fs/xfs/xfs_log_recover.c +++ b/fs/xfs/xfs_log_recover.c @@ -190,7 +190,7 @@ xlog_bread_noalign( ASSERT(nbblks <= bp->b_length); XFS_BUF_SET_ADDR(bp, log->l_logBBstart + blk_no); - XFS_BUF_READ(bp); + bp->b_flags |= XBF_READ; bp->b_io_length = nbblks; bp->b_error = 0; @@ -4928,7 +4928,7 @@ xlog_do_recover( bp = xfs_getsb(log->l_mp, 0); bp->b_flags &= ~(XBF_DONE | XBF_ASYNC); ASSERT(!(XFS_BUF_ISWRITE(bp))); - XFS_BUF_READ(bp); + bp->b_flags |= XBF_READ; bp->b_ops = &xfs_sb_buf_ops; error = xfs_buf_submit_wait(bp); -- 2.5.0 From dave@fromorbit.com Thu Feb 4 18:41:23 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=ham version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay3.corp.sgi.com [198.149.34.15]) by oss.sgi.com (Postfix) with ESMTP id 0E04C29E06 for ; Thu, 4 Feb 2016 18:41:23 -0600 (CST) Received: from cuda.sgi.com (cuda1.sgi.com [192.48.157.11]) by relay3.corp.sgi.com (Postfix) with ESMTP id AEFF6AC004 for ; Thu, 4 Feb 2016 16:41:22 -0800 (PST) X-ASG-Debug-ID: 1454632878-04bdf079c12d6b0002-NocioJ Received: from ipmail06.adl2.internode.on.net (ipmail06.adl2.internode.on.net [150.101.137.129]) by cuda.sgi.com with ESMTP id 153cmlETh0LTYUXp for ; Thu, 04 Feb 2016 16:41:20 -0800 (PST) X-Barracuda-Envelope-From: dave@fromorbit.com X-Barracuda-Apparent-Source-IP: 150.101.137.129 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: A2AtDQDo7rNWPBATLHleKAECgw+BP4ZjgXidPwEBAQEBAQaRKItTTQEBAQEBAQcBAQEBQT9BEgGDbgEFJy8zCBgxOQMHFBmIGsB6hUqJfYNuBZZxnEBEjXyCGAELQRmBXCgugVeGUwEBAQ Received: from ppp121-44-19-16.lns20.syd4.internode.on.net (HELO dastard) ([121.44.19.16]) by ipmail06.adl2.internode.on.net with ESMTP; 05 Feb 2016 11:08:06 +1030 Received: from disappointment.disaster.area ([192.168.1.110] helo=disappointment) by dastard with esmtp (Exim 4.80) (envelope-from ) id 1aRUPV-0000Rn-BV for xfs@oss.sgi.com; Fri, 05 Feb 2016 11:38:05 +1100 Received: from dave by disappointment with local (Exim 4.86) (envelope-from ) id 1aRUPV-0005Mr-Ai for xfs@oss.sgi.com; Fri, 05 Feb 2016 11:38:05 +1100 From: Dave Chinner To: xfs@oss.sgi.com Subject: [PATCH 6/6] xfs: rename XFS_BUF_ZEROFLAGS macro Date: Fri, 5 Feb 2016 11:38:03 +1100 X-ASG-Orig-Subj: [PATCH 6/6] xfs: rename XFS_BUF_ZEROFLAGS macro Message-Id: <1454632683-20543-7-git-send-email-david@fromorbit.com> X-Mailer: git-send-email 2.5.0 In-Reply-To: <1454632683-20543-1-git-send-email-david@fromorbit.com> References: <1454632683-20543-1-git-send-email-david@fromorbit.com> X-Barracuda-Connect: ipmail06.adl2.internode.on.net[150.101.137.129] X-Barracuda-Start-Time: 1454632880 X-Barracuda-URL: https://192.48.157.11:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-BRTS-Status: 1 X-Barracuda-Spam-Score: 0.00 X-Barracuda-Spam-Status: No, SCORE=0.00 using per-user scores of TAG_LEVEL=1000.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.7 tests= X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.3.26755 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- From: Dave Chinner This macro is really clearing the IO flags from the buffer. Rename it appropriately and turn it into a static inline to get rid of the shoutiness. Signed-off-by: Dave Chinner --- fs/xfs/xfs_buf.h | 10 ++++++---- fs/xfs/xfs_log.c | 4 ++-- fs/xfs/xfs_log_recover.c | 2 +- 3 files changed, 9 insertions(+), 7 deletions(-) diff --git a/fs/xfs/xfs_buf.h b/fs/xfs/xfs_buf.h index 98b7ee9..0735096 100644 --- a/fs/xfs/xfs_buf.h +++ b/fs/xfs/xfs_buf.h @@ -313,10 +313,12 @@ extern int xfs_buf_delwri_submit_nowait(struct list_head *); extern int xfs_buf_init(void); extern void xfs_buf_terminate(void); -#define XFS_BUF_ZEROFLAGS(bp) \ - ((bp)->b_flags &= ~(XBF_READ|XBF_WRITE|XBF_ASYNC| \ - XBF_SYNCIO|XBF_FUA|XBF_FLUSH| \ - XBF_WRITE_FAIL)) +static inline void xfs_buf_clear_ioflags(struct xfs_buf *bp) +{ + bp->b_flags &= ~(XBF_READ | XBF_WRITE | XBF_ASYNC | + XBF_SYNCIO | XBF_FUA | XBF_FLUSH | + XBF_WRITE_FAIL); +} /* diff --git a/fs/xfs/xfs_log.c b/fs/xfs/xfs_log.c index edf20b2..185d1b0 100644 --- a/fs/xfs/xfs_log.c +++ b/fs/xfs/xfs_log.c @@ -1864,7 +1864,7 @@ xlog_sync( bp->b_io_length = BTOBB(count); bp->b_fspriv = iclog; - XFS_BUF_ZEROFLAGS(bp); + xfs_buf_clear_ioflags(bp); bp->b_flags |= (XBF_ASYNC | XBF_SYNCIO | XBF_WRITE); if (log->l_mp->m_flags & XFS_MOUNT_BARRIER) { @@ -1908,7 +1908,7 @@ xlog_sync( xfs_buf_associate_memory(bp, (char *)&iclog->ic_header + count, split); bp->b_fspriv = iclog; - XFS_BUF_ZEROFLAGS(bp); + xfs_buf_clear_ioflags(bp); bp->b_flags |= (XBF_ASYNC | XBF_SYNCIO | XBF_WRITE); if (log->l_mp->m_flags & XFS_MOUNT_BARRIER) bp->b_flags |= XBF_FUA; diff --git a/fs/xfs/xfs_log_recover.c b/fs/xfs/xfs_log_recover.c index 68406fd..b05d07b 100644 --- a/fs/xfs/xfs_log_recover.c +++ b/fs/xfs/xfs_log_recover.c @@ -275,9 +275,9 @@ xlog_bwrite( ASSERT(nbblks <= bp->b_length); XFS_BUF_SET_ADDR(bp, log->l_logBBstart + blk_no); - XFS_BUF_ZEROFLAGS(bp); xfs_buf_hold(bp); xfs_buf_lock(bp); + xfs_buf_clear_ioflags(bp); bp->b_io_length = nbblks; bp->b_error = 0; -- 2.5.0 From dave@fromorbit.com Thu Feb 4 18:41:23 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=ham version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay2.corp.sgi.com [137.38.102.29]) by oss.sgi.com (Postfix) with ESMTP id AE0C529DF9 for ; Thu, 4 Feb 2016 18:41:23 -0600 (CST) Received: from cuda.sgi.com (cuda3.sgi.com [192.48.176.15]) by relay2.corp.sgi.com (Postfix) with ESMTP id 8509F304059 for ; Thu, 4 Feb 2016 16:41:23 -0800 (PST) X-ASG-Debug-ID: 1454632881-04cb6c27472bfb0001-NocioJ Received: from ipmail06.adl2.internode.on.net (ipmail06.adl2.internode.on.net [150.101.137.129]) by cuda.sgi.com with ESMTP id N5xJ4494vtHAmy2D for ; Thu, 04 Feb 2016 16:41:21 -0800 (PST) X-Barracuda-Envelope-From: dave@fromorbit.com X-Barracuda-Apparent-Source-IP: 150.101.137.129 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: A2AtDQDo7rNWPBATLHleKAECgw+BP4ZjgXidPwEBAQEBAQaRKItTTQEBAQEBAQcBAQEBQT9BEgGDbgEFJy8zCBgxOQMHFBmIGsB6hUqJfYNuBYdIhwyIHY8qh2iFLkSNfIIYAQtBGYFcKC6BV4ZTAQEB Received: from ppp121-44-19-16.lns20.syd4.internode.on.net (HELO dastard) ([121.44.19.16]) by ipmail06.adl2.internode.on.net with ESMTP; 05 Feb 2016 11:08:06 +1030 Received: from disappointment.disaster.area ([192.168.1.110] helo=disappointment) by dastard with esmtp (Exim 4.80) (envelope-from ) id 1aRUPV-0000Rj-9k for xfs@oss.sgi.com; Fri, 05 Feb 2016 11:38:05 +1100 Received: from dave by disappointment with local (Exim 4.86) (envelope-from ) id 1aRUPV-0005MX-91 for xfs@oss.sgi.com; Fri, 05 Feb 2016 11:38:05 +1100 From: Dave Chinner To: xfs@oss.sgi.com Subject: [PATCH 2/6] xfs: remove XBF_ASYNC flag wrapper macros Date: Fri, 5 Feb 2016 11:37:59 +1100 X-ASG-Orig-Subj: [PATCH 2/6] xfs: remove XBF_ASYNC flag wrapper macros Message-Id: <1454632683-20543-3-git-send-email-david@fromorbit.com> X-Mailer: git-send-email 2.5.0 In-Reply-To: <1454632683-20543-1-git-send-email-david@fromorbit.com> References: <1454632683-20543-1-git-send-email-david@fromorbit.com> X-Barracuda-Connect: ipmail06.adl2.internode.on.net[150.101.137.129] X-Barracuda-Start-Time: 1454632881 X-Barracuda-URL: https://192.48.176.15:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-BRTS-Status: 1 X-Barracuda-Spam-Score: 0.00 X-Barracuda-Spam-Status: No, SCORE=0.00 using per-user scores of TAG_LEVEL=1000.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.7 tests= X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.3.26754 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- From: Dave Chinner They only set/clear/check a flag, no need for obfuscating this with a macro. Signed-off-by: Dave Chinner --- fs/xfs/xfs_buf.h | 4 ---- fs/xfs/xfs_buf_item.c | 2 +- fs/xfs/xfs_log.c | 8 +++----- fs/xfs/xfs_log_recover.c | 3 +-- 4 files changed, 5 insertions(+), 12 deletions(-) diff --git a/fs/xfs/xfs_buf.h b/fs/xfs/xfs_buf.h index 03b5d3a..2a28d1c 100644 --- a/fs/xfs/xfs_buf.h +++ b/fs/xfs/xfs_buf.h @@ -321,10 +321,6 @@ void xfs_buf_stale(struct xfs_buf *bp); #define XFS_BUF_UNSTALE(bp) ((bp)->b_flags &= ~XBF_STALE) #define XFS_BUF_ISSTALE(bp) ((bp)->b_flags & XBF_STALE) -#define XFS_BUF_ASYNC(bp) ((bp)->b_flags |= XBF_ASYNC) -#define XFS_BUF_UNASYNC(bp) ((bp)->b_flags &= ~XBF_ASYNC) -#define XFS_BUF_ISASYNC(bp) ((bp)->b_flags & XBF_ASYNC) - #define XFS_BUF_READ(bp) ((bp)->b_flags |= XBF_READ) #define XFS_BUF_UNREAD(bp) ((bp)->b_flags &= ~XBF_READ) #define XFS_BUF_ISREAD(bp) ((bp)->b_flags & XBF_READ) diff --git a/fs/xfs/xfs_buf_item.c b/fs/xfs/xfs_buf_item.c index 2d2029d..344ab44 100644 --- a/fs/xfs/xfs_buf_item.c +++ b/fs/xfs/xfs_buf_item.c @@ -974,7 +974,7 @@ xfs_buf_iodone_callbacks( * errors tend to affect the whole device and a failing log write * will make us give up. But we really ought to do better here. */ - if (XFS_BUF_ISASYNC(bp)) { + if (bp->b_flags & XBF_ASYNC) { ASSERT(bp->b_iodone != NULL); trace_xfs_buf_item_iodone_async(bp, _RET_IP_); diff --git a/fs/xfs/xfs_log.c b/fs/xfs/xfs_log.c index aa8c9bf..19db3da 100644 --- a/fs/xfs/xfs_log.c +++ b/fs/xfs/xfs_log.c @@ -1212,7 +1212,7 @@ xlog_iodone(xfs_buf_t *bp) } /* log I/O is always issued ASYNC */ - ASSERT(XFS_BUF_ISASYNC(bp)); + ASSERT(bp->b_flags & XBF_ASYNC); xlog_state_done_syncing(iclog, aborted); /* @@ -1865,8 +1865,7 @@ xlog_sync( bp->b_io_length = BTOBB(count); bp->b_fspriv = iclog; XFS_BUF_ZEROFLAGS(bp); - XFS_BUF_ASYNC(bp); - bp->b_flags |= XBF_SYNCIO; + bp->b_flags |= (XBF_ASYNC | XBF_SYNCIO); if (log->l_mp->m_flags & XFS_MOUNT_BARRIER) { bp->b_flags |= XBF_FUA; @@ -1911,8 +1910,7 @@ xlog_sync( (char *)&iclog->ic_header + count, split); bp->b_fspriv = iclog; XFS_BUF_ZEROFLAGS(bp); - XFS_BUF_ASYNC(bp); - bp->b_flags |= XBF_SYNCIO; + bp->b_flags |= (XBF_ASYNC | XBF_SYNCIO); if (log->l_mp->m_flags & XFS_MOUNT_BARRIER) bp->b_flags |= XBF_FUA; diff --git a/fs/xfs/xfs_log_recover.c b/fs/xfs/xfs_log_recover.c index 97cfeab..b34337d 100644 --- a/fs/xfs/xfs_log_recover.c +++ b/fs/xfs/xfs_log_recover.c @@ -4926,10 +4926,9 @@ xlog_do_recover( * updates, re-read in the superblock and reverify it. */ bp = xfs_getsb(log->l_mp, 0); - bp->b_flags &= ~XBF_DONE; + bp->b_flags &= ~(XBF_DONE | XBF_ASYNC); ASSERT(!(XFS_BUF_ISWRITE(bp))); XFS_BUF_READ(bp); - XFS_BUF_UNASYNC(bp); bp->b_ops = &xfs_sb_buf_ops; error = xfs_buf_submit_wait(bp); -- 2.5.0 From dave@fromorbit.com Thu Feb 4 18:41:24 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=ham version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay2.corp.sgi.com [137.38.102.29]) by oss.sgi.com (Postfix) with ESMTP id 6D05529E0D for ; Thu, 4 Feb 2016 18:41:24 -0600 (CST) Received: from cuda.sgi.com (cuda3.sgi.com [192.48.176.15]) by relay2.corp.sgi.com (Postfix) with ESMTP id 4F4CD304059 for ; Thu, 4 Feb 2016 16:41:21 -0800 (PST) X-ASG-Debug-ID: 1454632876-04cb6c27452bfa0002-NocioJ Received: from ipmail06.adl2.internode.on.net (ipmail06.adl2.internode.on.net [150.101.137.129]) by cuda.sgi.com with ESMTP id nhcAGBSQ6LApXR9y for ; Thu, 04 Feb 2016 16:41:18 -0800 (PST) X-Barracuda-Envelope-From: dave@fromorbit.com X-Barracuda-Apparent-Source-IP: 150.101.137.129 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: A2AtDQDo7rNWPBATLHleKAECgw+BP4ZjgXidPwEBAQEBAQaRKItTTQEBAQEBAQcBAQEBQT9BEgGDbgEFJy8zCBgxOQMHFBmIGsB6hUqNawWWcY8qh2iFLkSNfIIYAQtBGYFcKC6BV4ZTAQEB Received: from ppp121-44-19-16.lns20.syd4.internode.on.net (HELO dastard) ([121.44.19.16]) by ipmail06.adl2.internode.on.net with ESMTP; 05 Feb 2016 11:08:06 +1030 Received: from disappointment.disaster.area ([192.168.1.110] helo=disappointment) by dastard with esmtp (Exim 4.80) (envelope-from ) id 1aRUPV-0000Ri-9L for xfs@oss.sgi.com; Fri, 05 Feb 2016 11:38:05 +1100 Received: from dave by disappointment with local (Exim 4.86) (envelope-from ) id 1aRUPV-0005MS-8b for xfs@oss.sgi.com; Fri, 05 Feb 2016 11:38:05 +1100 From: Dave Chinner To: xfs@oss.sgi.com Subject: [PATCH 1/6] xfs: remove XBF_DONE flag wrapper macros Date: Fri, 5 Feb 2016 11:37:58 +1100 X-ASG-Orig-Subj: [PATCH 1/6] xfs: remove XBF_DONE flag wrapper macros Message-Id: <1454632683-20543-2-git-send-email-david@fromorbit.com> X-Mailer: git-send-email 2.5.0 In-Reply-To: <1454632683-20543-1-git-send-email-david@fromorbit.com> References: <1454632683-20543-1-git-send-email-david@fromorbit.com> X-Barracuda-Connect: ipmail06.adl2.internode.on.net[150.101.137.129] X-Barracuda-Start-Time: 1454632878 X-Barracuda-URL: https://192.48.176.15:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-BRTS-Status: 1 X-Barracuda-Spam-Score: 0.00 X-Barracuda-Spam-Status: No, SCORE=0.00 using per-user scores of TAG_LEVEL=1000.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.7 tests= X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.3.26754 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- From: Dave Chinner They only set/clear/check a flag, no need for obfuscating this with a macro. Signed-off-by: Dave Chinner --- fs/xfs/xfs_buf.c | 2 +- fs/xfs/xfs_buf.h | 4 ---- fs/xfs/xfs_buf_item.c | 6 +++--- fs/xfs/xfs_inode.c | 2 +- fs/xfs/xfs_log.c | 4 ++-- fs/xfs/xfs_log_recover.c | 2 +- fs/xfs/xfs_mount.c | 2 +- fs/xfs/xfs_trans_buf.c | 4 ++-- 8 files changed, 11 insertions(+), 15 deletions(-) diff --git a/fs/xfs/xfs_buf.c b/fs/xfs/xfs_buf.c index 3c61547..5f7ff50 100644 --- a/fs/xfs/xfs_buf.c +++ b/fs/xfs/xfs_buf.c @@ -650,7 +650,7 @@ xfs_buf_read_map( if (bp) { trace_xfs_buf_read(bp, flags, _RET_IP_); - if (!XFS_BUF_ISDONE(bp)) { + if (!(bp->b_flags & XBF_DONE)) { XFS_STATS_INC(target->bt_mount, xb_get_read); bp->b_ops = ops; _xfs_buf_read(bp, flags); diff --git a/fs/xfs/xfs_buf.h b/fs/xfs/xfs_buf.h index c75721a..03b5d3a 100644 --- a/fs/xfs/xfs_buf.h +++ b/fs/xfs/xfs_buf.h @@ -321,10 +321,6 @@ void xfs_buf_stale(struct xfs_buf *bp); #define XFS_BUF_UNSTALE(bp) ((bp)->b_flags &= ~XBF_STALE) #define XFS_BUF_ISSTALE(bp) ((bp)->b_flags & XBF_STALE) -#define XFS_BUF_DONE(bp) ((bp)->b_flags |= XBF_DONE) -#define XFS_BUF_UNDONE(bp) ((bp)->b_flags &= ~XBF_DONE) -#define XFS_BUF_ISDONE(bp) ((bp)->b_flags & XBF_DONE) - #define XFS_BUF_ASYNC(bp) ((bp)->b_flags |= XBF_ASYNC) #define XFS_BUF_UNASYNC(bp) ((bp)->b_flags &= ~XBF_ASYNC) #define XFS_BUF_ISASYNC(bp) ((bp)->b_flags & XBF_ASYNC) diff --git a/fs/xfs/xfs_buf_item.c b/fs/xfs/xfs_buf_item.c index 82f676f..2d2029d 100644 --- a/fs/xfs/xfs_buf_item.c +++ b/fs/xfs/xfs_buf_item.c @@ -470,7 +470,7 @@ xfs_buf_item_unpin( xfs_buf_hold(bp); bp->b_flags |= XBF_ASYNC; xfs_buf_ioerror(bp, -EIO); - XFS_BUF_UNDONE(bp); + bp->b_flags &= ~XBF_DONE; xfs_buf_stale(bp); xfs_buf_ioend(bp); } @@ -951,7 +951,7 @@ xfs_buf_iodone_callbacks( */ if (XFS_FORCED_SHUTDOWN(mp)) { xfs_buf_stale(bp); - XFS_BUF_DONE(bp); + bp->b_flags |= XBF_DONE; trace_xfs_buf_item_iodone(bp, _RET_IP_); goto do_callbacks; } @@ -997,7 +997,7 @@ xfs_buf_iodone_callbacks( * sure to return the error to the caller of xfs_bwrite(). */ xfs_buf_stale(bp); - XFS_BUF_DONE(bp); + bp->b_flags |= XBF_DONE; trace_xfs_buf_error_relse(bp, _RET_IP_); diff --git a/fs/xfs/xfs_inode.c b/fs/xfs/xfs_inode.c index 205796f..415c70a 100644 --- a/fs/xfs/xfs_inode.c +++ b/fs/xfs/xfs_inode.c @@ -3297,7 +3297,7 @@ cluster_corrupt_out: * mark it as stale and brelse. */ if (bp->b_iodone) { - XFS_BUF_UNDONE(bp); + bp->b_flags &= ~XBF_DONE; xfs_buf_stale(bp); xfs_buf_ioerror(bp, -EIO); xfs_buf_ioend(bp); diff --git a/fs/xfs/xfs_log.c b/fs/xfs/xfs_log.c index 9c9a1c9..aa8c9bf 100644 --- a/fs/xfs/xfs_log.c +++ b/fs/xfs/xfs_log.c @@ -3979,7 +3979,7 @@ xfs_log_force_umount( log->l_flags & XLOG_ACTIVE_RECOVERY) { mp->m_flags |= XFS_MOUNT_FS_SHUTDOWN; if (mp->m_sb_bp) - XFS_BUF_DONE(mp->m_sb_bp); + mp->m_sb_bp->b_flags |= XBF_DONE; return 0; } @@ -4009,7 +4009,7 @@ xfs_log_force_umount( spin_lock(&log->l_icloglock); mp->m_flags |= XFS_MOUNT_FS_SHUTDOWN; if (mp->m_sb_bp) - XFS_BUF_DONE(mp->m_sb_bp); + mp->m_sb_bp->b_flags |= XBF_DONE; /* * Mark the log and the iclogs with IO error flags to prevent any diff --git a/fs/xfs/xfs_log_recover.c b/fs/xfs/xfs_log_recover.c index bd6f23b..97cfeab 100644 --- a/fs/xfs/xfs_log_recover.c +++ b/fs/xfs/xfs_log_recover.c @@ -4926,7 +4926,7 @@ xlog_do_recover( * updates, re-read in the superblock and reverify it. */ bp = xfs_getsb(log->l_mp, 0); - XFS_BUF_UNDONE(bp); + bp->b_flags &= ~XBF_DONE; ASSERT(!(XFS_BUF_ISWRITE(bp))); XFS_BUF_READ(bp); XFS_BUF_UNASYNC(bp); diff --git a/fs/xfs/xfs_mount.c b/fs/xfs/xfs_mount.c index d306105..986290c 100644 --- a/fs/xfs/xfs_mount.c +++ b/fs/xfs/xfs_mount.c @@ -1284,7 +1284,7 @@ xfs_getsb( } xfs_buf_hold(bp); - ASSERT(XFS_BUF_ISDONE(bp)); + ASSERT(bp->b_flags & XBF_DONE); return bp; } diff --git a/fs/xfs/xfs_trans_buf.c b/fs/xfs/xfs_trans_buf.c index 7579841..ed6f61f 100644 --- a/fs/xfs/xfs_trans_buf.c +++ b/fs/xfs/xfs_trans_buf.c @@ -155,7 +155,7 @@ xfs_trans_get_buf_map( ASSERT(xfs_buf_islocked(bp)); if (XFS_FORCED_SHUTDOWN(tp->t_mountp)) { xfs_buf_stale(bp); - XFS_BUF_DONE(bp); + bp->b_flags |= XBF_DONE; } ASSERT(bp->b_transp == tp); @@ -518,7 +518,7 @@ xfs_trans_log_buf(xfs_trans_t *tp, * inside the b_bdstrat callback so that this won't get written to * disk. */ - XFS_BUF_DONE(bp); + bp->b_flags |= XBF_DONE; ASSERT(atomic_read(&bip->bli_refcount) > 0); bp->b_iodone = xfs_buf_iodone_callbacks; -- 2.5.0 From dave@fromorbit.com Thu Feb 4 18:41:27 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=ham version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay1.corp.sgi.com [137.38.102.111]) by oss.sgi.com (Postfix) with ESMTP id 57DF029DFC for ; Thu, 4 Feb 2016 18:41:27 -0600 (CST) Received: from cuda.sgi.com (cuda1.sgi.com [192.48.157.11]) by relay1.corp.sgi.com (Postfix) with ESMTP id 2C3648F8039 for ; Thu, 4 Feb 2016 16:41:24 -0800 (PST) X-ASG-Debug-ID: 1454632878-04bdf079c12d6b0003-NocioJ Received: from ipmail06.adl2.internode.on.net (ipmail06.adl2.internode.on.net [150.101.137.129]) by cuda.sgi.com with ESMTP id SOrNPqWN4hEGN7cT for ; Thu, 04 Feb 2016 16:41:22 -0800 (PST) X-Barracuda-Envelope-From: dave@fromorbit.com X-Barracuda-Apparent-Source-IP: 150.101.137.129 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: A2AtDQDo7rNWPBATLHleKAECgw+BP4ZjgXidPwEBAQEBAQaRKItTTQEBAQEBAQcBAQEBQT9BEgGDbgEFJy8zCBgYGTkDBxQZiBrAeoVKiXANg24FlnGcQESNfIIYAQtBGYFcKC6BV4ZTAQEB Received: from ppp121-44-19-16.lns20.syd4.internode.on.net (HELO dastard) ([121.44.19.16]) by ipmail06.adl2.internode.on.net with ESMTP; 05 Feb 2016 11:08:06 +1030 Received: from disappointment.disaster.area ([192.168.1.110] helo=disappointment) by dastard with esmtp (Exim 4.80) (envelope-from ) id 1aRUPV-0000Rl-Ad for xfs@oss.sgi.com; Fri, 05 Feb 2016 11:38:05 +1100 Received: from dave by disappointment with local (Exim 4.86) (envelope-from ) id 1aRUPV-0005Mh-9t for xfs@oss.sgi.com; Fri, 05 Feb 2016 11:38:05 +1100 From: Dave Chinner To: xfs@oss.sgi.com Subject: [PATCH 4/6] xfs: remove XBF_WRITE flag wrapper macros Date: Fri, 5 Feb 2016 11:38:01 +1100 X-ASG-Orig-Subj: [PATCH 4/6] xfs: remove XBF_WRITE flag wrapper macros Message-Id: <1454632683-20543-5-git-send-email-david@fromorbit.com> X-Mailer: git-send-email 2.5.0 In-Reply-To: <1454632683-20543-1-git-send-email-david@fromorbit.com> References: <1454632683-20543-1-git-send-email-david@fromorbit.com> X-Barracuda-Connect: ipmail06.adl2.internode.on.net[150.101.137.129] X-Barracuda-Start-Time: 1454632882 X-Barracuda-URL: https://192.48.157.11:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-BRTS-Status: 1 X-Barracuda-Spam-Score: 0.00 X-Barracuda-Spam-Status: No, SCORE=0.00 using per-user scores of TAG_LEVEL=1000.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.7 tests= X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.3.26755 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- From: Dave Chinner They only set/clear/check a flag, no need for obfuscating this with a macro. Signed-off-by: Dave Chinner --- fs/xfs/xfs_buf.h | 4 ---- fs/xfs/xfs_log.c | 8 +++----- fs/xfs/xfs_log_recover.c | 2 +- 3 files changed, 4 insertions(+), 10 deletions(-) diff --git a/fs/xfs/xfs_buf.h b/fs/xfs/xfs_buf.h index 329e612..a118962 100644 --- a/fs/xfs/xfs_buf.h +++ b/fs/xfs/xfs_buf.h @@ -321,10 +321,6 @@ void xfs_buf_stale(struct xfs_buf *bp); #define XFS_BUF_UNSTALE(bp) ((bp)->b_flags &= ~XBF_STALE) #define XFS_BUF_ISSTALE(bp) ((bp)->b_flags & XBF_STALE) -#define XFS_BUF_WRITE(bp) ((bp)->b_flags |= XBF_WRITE) -#define XFS_BUF_UNWRITE(bp) ((bp)->b_flags &= ~XBF_WRITE) -#define XFS_BUF_ISWRITE(bp) ((bp)->b_flags & XBF_WRITE) - /* * These macros use the IO block map rather than b_bn. b_bn is now really * just for the buffer cache index for cached buffers. As IO does not use b_bn diff --git a/fs/xfs/xfs_log.c b/fs/xfs/xfs_log.c index 19db3da..edf20b2 100644 --- a/fs/xfs/xfs_log.c +++ b/fs/xfs/xfs_log.c @@ -1865,7 +1865,7 @@ xlog_sync( bp->b_io_length = BTOBB(count); bp->b_fspriv = iclog; XFS_BUF_ZEROFLAGS(bp); - bp->b_flags |= (XBF_ASYNC | XBF_SYNCIO); + bp->b_flags |= (XBF_ASYNC | XBF_SYNCIO | XBF_WRITE); if (log->l_mp->m_flags & XFS_MOUNT_BARRIER) { bp->b_flags |= XBF_FUA; @@ -1892,12 +1892,11 @@ xlog_sync( /* account for log which doesn't start at block #0 */ XFS_BUF_SET_ADDR(bp, XFS_BUF_ADDR(bp) + log->l_logBBstart); + /* * Don't call xfs_bwrite here. We do log-syncs even when the filesystem * is shutting down. */ - XFS_BUF_WRITE(bp); - error = xlog_bdstrat(bp); if (error) { xfs_buf_ioerror_alert(bp, "xlog_sync"); @@ -1910,7 +1909,7 @@ xlog_sync( (char *)&iclog->ic_header + count, split); bp->b_fspriv = iclog; XFS_BUF_ZEROFLAGS(bp); - bp->b_flags |= (XBF_ASYNC | XBF_SYNCIO); + bp->b_flags |= (XBF_ASYNC | XBF_SYNCIO | XBF_WRITE); if (log->l_mp->m_flags & XFS_MOUNT_BARRIER) bp->b_flags |= XBF_FUA; @@ -1919,7 +1918,6 @@ xlog_sync( /* account for internal log which doesn't start at block #0 */ XFS_BUF_SET_ADDR(bp, XFS_BUF_ADDR(bp) + log->l_logBBstart); - XFS_BUF_WRITE(bp); error = xlog_bdstrat(bp); if (error) { xfs_buf_ioerror_alert(bp, "xlog_sync (split)"); diff --git a/fs/xfs/xfs_log_recover.c b/fs/xfs/xfs_log_recover.c index 81c525a..68406fd 100644 --- a/fs/xfs/xfs_log_recover.c +++ b/fs/xfs/xfs_log_recover.c @@ -4927,7 +4927,7 @@ xlog_do_recover( */ bp = xfs_getsb(log->l_mp, 0); bp->b_flags &= ~(XBF_DONE | XBF_ASYNC); - ASSERT(!(XFS_BUF_ISWRITE(bp))); + ASSERT(!(bp->b_flags & XBF_WRITE)); bp->b_flags |= XBF_READ; bp->b_ops = &xfs_sb_buf_ops; -- 2.5.0 From david@fromorbit.com Thu Feb 4 19:06:47 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=ham version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay3.corp.sgi.com [198.149.34.15]) by oss.sgi.com (Postfix) with ESMTP id D98BE7CA2 for ; Thu, 4 Feb 2016 19:06:47 -0600 (CST) Received: from cuda.sgi.com (cuda2.sgi.com [192.48.176.25]) by relay3.corp.sgi.com (Postfix) with ESMTP id 68F38AC001 for ; Thu, 4 Feb 2016 17:06:44 -0800 (PST) X-ASG-Debug-ID: 1454634400-04cbb04cfa474b0001-NocioJ Received: from ipmail06.adl2.internode.on.net (ipmail06.adl2.internode.on.net [150.101.137.129]) by cuda.sgi.com with ESMTP id AWocz4Pw8XWuCWOi for ; Thu, 04 Feb 2016 17:06:41 -0800 (PST) X-Barracuda-Envelope-From: david@fromorbit.com X-Barracuda-Apparent-Source-IP: 150.101.137.129 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: A2C2CgDT9LNWPBATLHleKAECgw+BP4Jpg3qBeJ1AAQEBAQEBBotkhUSEB4YHAgIBAQKBPk0BAQEBAQEHAQEBAUE/hEIBAQQnExwjEAgDDgoJJQ8FJQMHGhOIGsBBAQEIAgEdGIUyhH+EF4RVAQSWcY1GgWSNFkSKKoNShFooLoZygTgBAQE Received: from ppp121-44-19-16.lns20.syd4.internode.on.net (HELO dastard) ([121.44.19.16]) by ipmail06.adl2.internode.on.net with ESMTP; 05 Feb 2016 11:35:19 +1030 Received: from dave by dastard with local (Exim 4.80) (envelope-from ) id 1aRUpr-0000VY-Ca; Fri, 05 Feb 2016 12:05:19 +1100 Date: Fri, 5 Feb 2016 12:05:19 +1100 From: Dave Chinner To: Jan Kara Cc: linux-fsdevel@vger.kernel.org, ocfs2-devel@oss.oracle.com, Mark Fasheh , Joel Becker , xfs@oss.sgi.com Subject: Re: [PATCH 1/3] quota: Add support for ->get_nextdqblk() for VFS quota Message-ID: <20160205010519.GJ459@dastard> X-ASG-Orig-Subj: Re: [PATCH 1/3] quota: Add support for ->get_nextdqblk() for VFS quota References: <1454596087-6814-1-git-send-email-jack@suse.cz> <1454596087-6814-2-git-send-email-jack@suse.cz> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1454596087-6814-2-git-send-email-jack@suse.cz> User-Agent: Mutt/1.5.21 (2010-09-15) X-Barracuda-Connect: ipmail06.adl2.internode.on.net[150.101.137.129] X-Barracuda-Start-Time: 1454634400 X-Barracuda-URL: https://192.48.176.25:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-BRTS-Status: 1 X-Barracuda-Spam-Score: 0.00 X-Barracuda-Spam-Status: No, SCORE=0.00 using per-user scores of TAG_LEVEL=1000.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.7 tests=BSF_SC0_MISMATCH_TO X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.3.26756 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 0.00 BSF_SC0_MISMATCH_TO Envelope rcpt doesn't match header On Thu, Feb 04, 2016 at 03:28:05PM +0100, Jan Kara wrote: > Add infrastructure for supporting get_nextdqblk() callback for VFS > quotas. Translate the operation into a callback to appropriate > filesystem and consequently to quota format callback. > > Signed-off-by: Jan Kara I'm a little confused here. What patchset is this dependent on? i.e. what introduces the ->get_nextdqblk method? The patches I currently have in my XFS working tree introduce this (quota: add new quotactl Q_XGETNEXTQUOTA) and everythign else is dependent on this. I looked a coupl eof days ago and I wasnt' able to find this in your tree. I'd much prefer that one of us publish a stable branch with just the quotactl() infrastructure (i.e. commands and bits up to the ->get_nextdqblk() callback) that we can then both base the different subsystem implementations off, rather than one of us having to pull in a whole tree of changes just to get the one commit we need... Cheers, Dave. -- Dave Chinner david@fromorbit.com From dave@fromorbit.com Thu Feb 4 19:23:36 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=ham version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay3.corp.sgi.com [198.149.34.15]) by oss.sgi.com (Postfix) with ESMTP id 38CED7CA2 for ; Thu, 4 Feb 2016 19:23:36 -0600 (CST) Received: from cuda.sgi.com (cuda1.sgi.com [192.48.157.11]) by relay3.corp.sgi.com (Postfix) with ESMTP id CDB0DAC004 for ; Thu, 4 Feb 2016 17:23:35 -0800 (PST) X-ASG-Debug-ID: 1454635413-04bdf079c32e4c0001-NocioJ Received: from ipmail06.adl2.internode.on.net (ipmail06.adl2.internode.on.net [150.101.137.129]) by cuda.sgi.com with ESMTP id Hnb7WujZuvwlft9D for ; Thu, 04 Feb 2016 17:23:33 -0800 (PST) X-Barracuda-Envelope-From: dave@fromorbit.com X-Barracuda-Apparent-Source-IP: 150.101.137.129 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: A2AtDQB0+LNWPBATLHleKAECgw+BP4ZjgXidQgEBAQEBAQaRKItUTQEBAQEBAQcBAQEBQT9BEgGDbgEFJy8zCBgxOQMHFBmIGsBqhUqJfYNuBY0liUycQI5AghgBC4I2KC6BV4ZTAQEB Received: from ppp121-44-19-16.lns20.syd4.internode.on.net (HELO dastard) ([121.44.19.16]) by ipmail06.adl2.internode.on.net with ESMTP; 05 Feb 2016 11:53:31 +1030 Received: from disappointment.disaster.area ([192.168.1.110] helo=disappointment) by dastard with esmtp (Exim 4.80) (envelope-from ) id 1aRV7T-0000Wv-4b for xfs@oss.sgi.com; Fri, 05 Feb 2016 12:23:31 +1100 Received: from dave by disappointment with local (Exim 4.86) (envelope-from ) id 1aRV7T-0005tj-3l for xfs@oss.sgi.com; Fri, 05 Feb 2016 12:23:31 +1100 From: Dave Chinner To: xfs@oss.sgi.com Subject: [PATCH 7/9] xfs: add configuration handles for specific errors Date: Fri, 5 Feb 2016 12:23:25 +1100 X-ASG-Orig-Subj: [PATCH 7/9] xfs: add configuration handles for specific errors Message-Id: <1454635407-22276-8-git-send-email-david@fromorbit.com> X-Mailer: git-send-email 2.5.0 In-Reply-To: <1454635407-22276-1-git-send-email-david@fromorbit.com> References: <1454635407-22276-1-git-send-email-david@fromorbit.com> X-Barracuda-Connect: ipmail06.adl2.internode.on.net[150.101.137.129] X-Barracuda-Start-Time: 1454635413 X-Barracuda-URL: https://192.48.157.11:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-BRTS-Status: 1 X-Barracuda-Spam-Score: 0.00 X-Barracuda-Spam-Status: No, SCORE=0.00 using per-user scores of TAG_LEVEL=1000.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.7 tests= X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.3.26757 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- From: Dave Chinner now most of the infrastructure is in place, we can start adding support for configuring specific errors such as ENODEV, ENOSPC, EIO, etc. Add these error configurations and configure them all to have appropriate behaviours. That is, all will use the "fail never, fail at unmount" default except for ENODEV, which is an unrecoverable error so it will be configured as a "fail fast" error. Signed-off-by: Dave Chinner --- fs/xfs/xfs_mount.h | 3 +++ fs/xfs/xfs_sysfs.c | 24 ++++++++++++++++++++++++ 2 files changed, 27 insertions(+) diff --git a/fs/xfs/xfs_mount.h b/fs/xfs/xfs_mount.h index edeb0b6..c05b500 100644 --- a/fs/xfs/xfs_mount.h +++ b/fs/xfs/xfs_mount.h @@ -50,6 +50,9 @@ enum { }; enum { XFS_ERR_DEFAULT, + XFS_ERR_EIO, + XFS_ERR_ENOSPC, + XFS_ERR_ENODEV, XFS_ERR_ERRNO_MAX, }; enum { diff --git a/fs/xfs/xfs_sysfs.c b/fs/xfs/xfs_sysfs.c index a5b040a..d48dc46 100644 --- a/fs/xfs/xfs_sysfs.c +++ b/fs/xfs/xfs_sysfs.c @@ -507,6 +507,21 @@ static const struct xfs_error_init xfs_error_meta_init[XFS_ERR_ERRNO_MAX] = { .retry_timeout = 0, .fail_at_unmount = true, }, + { .name = "EIO", + .fail_speed = XFS_ERR_FAIL_NEVER, + .max_retries = INT_MAX, + .retry_timeout = 0, + .fail_at_unmount = true, + }, + { .name = "ENOSPC", + .fail_speed = XFS_ERR_FAIL_NEVER, + .max_retries = INT_MAX, + .retry_timeout = 0, + .fail_at_unmount = true, + }, + { .name = "ENODEV", + .fail_speed = XFS_ERR_FAIL_FAST, + }, }; static int @@ -606,6 +621,15 @@ xfs_error_get_cfg( struct xfs_error_cfg *cfg; switch (error) { + case EIO: + cfg = &mp->m_error_cfg[error_class][XFS_ERR_EIO]; + break; + case ENOSPC: + cfg = &mp->m_error_cfg[error_class][XFS_ERR_ENOSPC]; + break; + case ENODEV: + cfg = &mp->m_error_cfg[error_class][XFS_ERR_ENODEV]; + break; default: cfg = &mp->m_error_cfg[error_class][XFS_ERR_DEFAULT]; break; -- 2.5.0 From dave@fromorbit.com Thu Feb 4 19:23:38 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=ham version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay3.corp.sgi.com [198.149.34.15]) by oss.sgi.com (Postfix) with ESMTP id D05917CA2 for ; Thu, 4 Feb 2016 19:23:37 -0600 (CST) Received: from cuda.sgi.com (cuda1.sgi.com [192.48.157.11]) by relay3.corp.sgi.com (Postfix) with ESMTP id 704DAAC006 for ; Thu, 4 Feb 2016 17:23:37 -0800 (PST) X-ASG-Debug-ID: 1454635413-04bdf079c32e4c0002-NocioJ Received: from ipmail06.adl2.internode.on.net (ipmail06.adl2.internode.on.net [150.101.137.129]) by cuda.sgi.com with ESMTP id ZbEBrMOBSx3ourQx for ; Thu, 04 Feb 2016 17:23:35 -0800 (PST) X-Barracuda-Envelope-From: dave@fromorbit.com X-Barracuda-Apparent-Source-IP: 150.101.137.129 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: A2AtDQB0+LNWPBATLHleKAECgw+BP4ZjgXidQgEBAQEBAQaRKItUTQEBAQEBAQcBAQEBQT9BEgGDbgEFJy8zCBgxOQMHFBmIGsBqhUqJfYNuBY0liUycQI5AghgBC4I2KC6BV4ZTAQEB Received: from ppp121-44-19-16.lns20.syd4.internode.on.net (HELO dastard) ([121.44.19.16]) by ipmail06.adl2.internode.on.net with ESMTP; 05 Feb 2016 11:53:31 +1030 Received: from disappointment.disaster.area ([192.168.1.110] helo=disappointment) by dastard with esmtp (Exim 4.80) (envelope-from ) id 1aRV7T-0000Ww-4y for xfs@oss.sgi.com; Fri, 05 Feb 2016 12:23:31 +1100 Received: from dave by disappointment with local (Exim 4.86) (envelope-from ) id 1aRV7T-0005to-4A for xfs@oss.sgi.com; Fri, 05 Feb 2016 12:23:31 +1100 From: Dave Chinner To: xfs@oss.sgi.com Subject: [PATCH 8/9] xfs: disable specific error configurations Date: Fri, 5 Feb 2016 12:23:26 +1100 X-ASG-Orig-Subj: [PATCH 8/9] xfs: disable specific error configurations Message-Id: <1454635407-22276-9-git-send-email-david@fromorbit.com> X-Mailer: git-send-email 2.5.0 In-Reply-To: <1454635407-22276-1-git-send-email-david@fromorbit.com> References: <1454635407-22276-1-git-send-email-david@fromorbit.com> X-Barracuda-Connect: ipmail06.adl2.internode.on.net[150.101.137.129] X-Barracuda-Start-Time: 1454635414 X-Barracuda-URL: https://192.48.157.11:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-BRTS-Status: 1 X-Barracuda-Spam-Score: 0.00 X-Barracuda-Spam-Status: No, SCORE=0.00 using per-user scores of TAG_LEVEL=1000.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.7 tests= X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.3.26757 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- From: Dave Chinner Different error classes are going to need different error to be configured, so we don't want them all to be visible in sysfs. Add a configuration check into the config initialisation an lookup code to determine if the default should be used for a specific error. If so, the sysfs entry is not created, and on lookup the default config is returned. Add ENOMEM at this point to exercise this code, as it will be used later when adding a kmem error failure class. Signed-off-by: Dave Chinner --- fs/xfs/xfs_mount.h | 1 + fs/xfs/xfs_sysfs.c | 22 ++++++++++++++++++---- 2 files changed, 19 insertions(+), 4 deletions(-) diff --git a/fs/xfs/xfs_mount.h b/fs/xfs/xfs_mount.h index c05b500..0ff14a90 100644 --- a/fs/xfs/xfs_mount.h +++ b/fs/xfs/xfs_mount.h @@ -53,6 +53,7 @@ enum { XFS_ERR_EIO, XFS_ERR_ENOSPC, XFS_ERR_ENODEV, + XFS_ERR_ENOMEM, XFS_ERR_ERRNO_MAX, }; enum { diff --git a/fs/xfs/xfs_sysfs.c b/fs/xfs/xfs_sysfs.c index d48dc46..c984c3e 100644 --- a/fs/xfs/xfs_sysfs.c +++ b/fs/xfs/xfs_sysfs.c @@ -522,6 +522,9 @@ static const struct xfs_error_init xfs_error_meta_init[XFS_ERR_ERRNO_MAX] = { { .name = "ENODEV", .fail_speed = XFS_ERR_FAIL_FAST, }, + { .name = "ENOMEM", + .fail_speed = XFS_ERR_FAIL_DEFAULT, + }, }; static int @@ -545,12 +548,17 @@ xfs_error_sysfs_init_class( for (i = 0; i < XFS_ERR_ERRNO_MAX; i++) { cfg = &mp->m_error_cfg[class][i]; + + /* skip errors that are not configurable for this class */ + cfg->fail_speed = init[i].fail_speed; + if (cfg->fail_speed == XFS_ERR_FAIL_DEFAULT) + continue; + error = xfs_sysfs_init(&cfg->kobj, &xfs_error_cfg_ktype, parent_kobj, init[i].name); if (error) goto out_error; - cfg->fail_speed = init[i].fail_speed; cfg->max_retries = init[i].max_retries; cfg->retry_timeout = msecs_to_jiffies( init[i].retry_timeout * MSEC_PER_SEC); @@ -605,7 +613,8 @@ xfs_error_sysfs_del( for (j = 0; j < XFS_ERR_ERRNO_MAX; j++) { cfg = &mp->m_error_cfg[i][j]; - xfs_sysfs_del(&cfg->kobj); + if (cfg->fail_speed != XFS_ERR_FAIL_DEFAULT) + xfs_sysfs_del(&cfg->kobj); } } xfs_sysfs_del(&mp->m_error_meta_kobj); @@ -630,10 +639,15 @@ xfs_error_get_cfg( case ENODEV: cfg = &mp->m_error_cfg[error_class][XFS_ERR_ENODEV]; break; - default: - cfg = &mp->m_error_cfg[error_class][XFS_ERR_DEFAULT]; + case ENOMEM: + cfg = &mp->m_error_cfg[error_class][XFS_ERR_ENOMEM]; break; + default: + return &mp->m_error_cfg[error_class][XFS_ERR_DEFAULT]; } + /* The error may not be not configurable, so uses default behaviour */ + if (cfg->fail_speed == XFS_ERR_FAIL_DEFAULT) + return &mp->m_error_cfg[error_class][XFS_ERR_DEFAULT]; return cfg; } -- 2.5.0 From dave@fromorbit.com Thu Feb 4 19:23:38 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=ham version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay3.corp.sgi.com [198.149.34.15]) by oss.sgi.com (Postfix) with ESMTP id 557647CA4 for ; Thu, 4 Feb 2016 19:23:38 -0600 (CST) Received: from cuda.sgi.com (cuda1.sgi.com [192.48.157.11]) by relay3.corp.sgi.com (Postfix) with ESMTP id E7FC8AC004 for ; Thu, 4 Feb 2016 17:23:37 -0800 (PST) X-ASG-Debug-ID: 1454635415-04bdf079c32e4d0001-NocioJ Received: from ipmail06.adl2.internode.on.net (ipmail06.adl2.internode.on.net [150.101.137.129]) by cuda.sgi.com with ESMTP id Umq6mFAGVuCqikVx for ; Thu, 04 Feb 2016 17:23:35 -0800 (PST) X-Barracuda-Envelope-From: dave@fromorbit.com X-Barracuda-Apparent-Source-IP: 150.101.137.129 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: A2AtDQB0+LNWPBATLHleKAECgw+BP4ZjgXidQgEBAQEBAQaRKItUTQEBAQEBAQcBAQEBQT9BEgGDbgEFJy8zCBgxOQMHFBmIGsBqhUqJfYNuBY0liUyIN5QJjkCCGAELgjYoLoFXhlMBAQE Received: from ppp121-44-19-16.lns20.syd4.internode.on.net (HELO dastard) ([121.44.19.16]) by ipmail06.adl2.internode.on.net with ESMTP; 05 Feb 2016 11:53:31 +1030 Received: from disappointment.disaster.area ([192.168.1.110] helo=disappointment) by dastard with esmtp (Exim 4.80) (envelope-from ) id 1aRV7T-0000Ws-3K for xfs@oss.sgi.com; Fri, 05 Feb 2016 12:23:31 +1100 Received: from dave by disappointment with local (Exim 4.86) (envelope-from ) id 1aRV7T-0005tU-28 for xfs@oss.sgi.com; Fri, 05 Feb 2016 12:23:31 +1100 From: Dave Chinner To: xfs@oss.sgi.com Subject: [PATCH 4/9] xfs: introduce table-based init for error behaviours Date: Fri, 5 Feb 2016 12:23:22 +1100 X-ASG-Orig-Subj: [PATCH 4/9] xfs: introduce table-based init for error behaviours Message-Id: <1454635407-22276-5-git-send-email-david@fromorbit.com> X-Mailer: git-send-email 2.5.0 In-Reply-To: <1454635407-22276-1-git-send-email-david@fromorbit.com> References: <1454635407-22276-1-git-send-email-david@fromorbit.com> X-Barracuda-Connect: ipmail06.adl2.internode.on.net[150.101.137.129] X-Barracuda-Start-Time: 1454635415 X-Barracuda-URL: https://192.48.157.11:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-BRTS-Status: 1 X-Barracuda-Spam-Score: 0.00 X-Barracuda-Spam-Status: No, SCORE=0.00 using per-user scores of TAG_LEVEL=1000.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.7 tests= X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.3.26757 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- From: Dave Chinner Before we start expanding the number of error classes and errors we can configure behaviour for, we need a simple and clear way to define the default behaviour that we initialised each mount with. Introduce a table based method for keeping the initial configuration in, and apply that to the existing initialisation code. Signed-off-by: Dave Chinner --- fs/xfs/xfs_sysfs.c | 72 +++++++++++++++++++++++++++++++++++++++++++++--------- 1 file changed, 60 insertions(+), 12 deletions(-) diff --git a/fs/xfs/xfs_sysfs.c b/fs/xfs/xfs_sysfs.c index b8a6804..27487ce 100644 --- a/fs/xfs/xfs_sysfs.c +++ b/fs/xfs/xfs_sysfs.c @@ -340,11 +340,67 @@ struct kobj_type xfs_error_ktype = { .release = xfs_sysfs_release, }; +/* + * Error initialisation tables. These need to be ordered in the same + * order as the enums used to index the array. All class init tables need to + * define a "default" behaviour as the first entry, all other entries can be + * empty. + */ +struct xfs_error_init { + char *name; + int fail_speed; +}; + +static const struct xfs_error_init xfs_error_meta_init[XFS_ERR_ERRNO_MAX] = { + { .name = "Default", + .fail_speed = XFS_ERR_FAIL_NEVER, + }, +}; + +static int +xfs_error_sysfs_init_class( + struct xfs_mount *mp, + int class, + const char *parent_name, + struct xfs_kobj *parent_kobj, + const struct xfs_error_init init[]) +{ + struct xfs_error_cfg *cfg; + int error; + int i; + + ASSERT(class < XFS_ERR_CLASS_MAX); + + error = xfs_sysfs_init(parent_kobj, &xfs_error_ktype, + &mp->m_error_kobj, parent_name); + if (error) + return error; + + for (i = 0; i < XFS_ERR_ERRNO_MAX; i++) { + cfg = &mp->m_error_cfg[class][i]; + error = xfs_sysfs_init(&cfg->kobj, &xfs_error_cfg_ktype, + parent_kobj, init[i].name); + if (error) + goto out_error; + + cfg->fail_speed = init[i].fail_speed; + } + return 0; + +out_error: + /* unwind the entries that succeeded */ + for (i--; i >= 0; i--) { + cfg = &mp->m_error_cfg[class][i]; + xfs_sysfs_del(&cfg->kobj); + } + xfs_sysfs_del(parent_kobj); + return error; +} + int xfs_error_sysfs_init( struct xfs_mount *mp) { - struct xfs_error_cfg *cfg; int error; /* .../xfs//error/ */ @@ -354,22 +410,14 @@ xfs_error_sysfs_init( return error; /* .../xfs//error/metadata/ */ - error = xfs_sysfs_init(&mp->m_error_meta_kobj, &xfs_error_ktype, - &mp->m_error_kobj, "metadata"); + error = xfs_error_sysfs_init_class(mp, XFS_ERR_METADATA, + "metadata", &mp->m_error_meta_kobj, + xfs_error_meta_init); if (error) goto out_error; - cfg = &mp->m_error_cfg[XFS_ERR_METADATA][XFS_ERR_DEFAULT]; - error = xfs_sysfs_init(&cfg->kobj, &xfs_error_cfg_ktype, - &mp->m_error_meta_kobj, "Default"); - if (error) - goto out_error_meta; - cfg->fail_speed = XFS_ERR_FAIL_NEVER; - return 0; -out_error_meta: - xfs_sysfs_del(&mp->m_error_meta_kobj); out_error: xfs_sysfs_del(&mp->m_error_kobj); return error; -- 2.5.0 From dave@fromorbit.com Thu Feb 4 19:23:37 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=ham version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay3.corp.sgi.com [198.149.34.15]) by oss.sgi.com (Postfix) with ESMTP id 68F4B7CA3 for ; Thu, 4 Feb 2016 19:23:37 -0600 (CST) Received: from cuda.sgi.com (cuda1.sgi.com [192.48.157.11]) by relay3.corp.sgi.com (Postfix) with ESMTP id 0A009AC004 for ; Thu, 4 Feb 2016 17:23:36 -0800 (PST) X-ASG-Debug-ID: 1454635412-04bdf079c52e4c0002-NocioJ Received: from ipmail06.adl2.internode.on.net (ipmail06.adl2.internode.on.net [150.101.137.129]) by cuda.sgi.com with ESMTP id YZAjov703gBLlmBk for ; Thu, 04 Feb 2016 17:23:34 -0800 (PST) X-Barracuda-Envelope-From: dave@fromorbit.com X-Barracuda-Apparent-Source-IP: 150.101.137.129 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: A2CsDwB0+LNWPBATLHleKAECgw+BP4QvgjSBeJ1CAQEBAQEBBpEoi1RNAQEBAQEBBwEBAQFBP0ESAYNuAQUnLzMIGDE5AwcUGYgawGqFSo1rBYdTjx6cQI5AghgBC0EZgVwoLoFXhlMBAQE Received: from ppp121-44-19-16.lns20.syd4.internode.on.net (HELO dastard) ([121.44.19.16]) by ipmail06.adl2.internode.on.net with ESMTP; 05 Feb 2016 11:53:31 +1030 Received: from disappointment.disaster.area ([192.168.1.110] helo=disappointment) by dastard with esmtp (Exim 4.80) (envelope-from ) id 1aRV7T-0000Wr-2W for xfs@oss.sgi.com; Fri, 05 Feb 2016 12:23:31 +1100 Received: from dave by disappointment with local (Exim 4.86) (envelope-from ) id 1aRV7T-0005tP-1g for xfs@oss.sgi.com; Fri, 05 Feb 2016 12:23:31 +1100 From: Dave Chinner To: xfs@oss.sgi.com Subject: [PATCH 3/9] xfs: add configurable error support to metadata buffers Date: Fri, 5 Feb 2016 12:23:21 +1100 X-ASG-Orig-Subj: [PATCH 3/9] xfs: add configurable error support to metadata buffers Message-Id: <1454635407-22276-4-git-send-email-david@fromorbit.com> X-Mailer: git-send-email 2.5.0 In-Reply-To: <1454635407-22276-1-git-send-email-david@fromorbit.com> References: <1454635407-22276-1-git-send-email-david@fromorbit.com> X-Barracuda-Connect: ipmail06.adl2.internode.on.net[150.101.137.129] X-Barracuda-Start-Time: 1454635413 X-Barracuda-URL: https://192.48.157.11:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-BRTS-Status: 1 X-Barracuda-Spam-Score: 0.00 X-Barracuda-Spam-Status: No, SCORE=0.00 using per-user scores of TAG_LEVEL=1000.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.7 tests= X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.3.26757 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- From: Dave Chinner With the error configuration handle for async metadata write errors in place, we can now add initial support to the IO error processing in xfs_buf_iodone_error(). Add an infrastructure function to look up the configuration handle, and rearrange the error handling to prepare the way for different error handling conigurations to be used. Signed-off-by: Dave Chinner --- fs/xfs/xfs_buf.h | 1 + fs/xfs/xfs_buf_item.c | 112 ++++++++++++++++++++++++++++++-------------------- fs/xfs/xfs_mount.h | 3 ++ fs/xfs/xfs_sysfs.c | 17 ++++++++ 4 files changed, 88 insertions(+), 45 deletions(-) diff --git a/fs/xfs/xfs_buf.h b/fs/xfs/xfs_buf.h index 0735096..ad16a1e 100644 --- a/fs/xfs/xfs_buf.h +++ b/fs/xfs/xfs_buf.h @@ -183,6 +183,7 @@ typedef struct xfs_buf { unsigned int b_page_count; /* size of page array */ unsigned int b_offset; /* page offset in first page */ int b_error; /* error code on I/O */ + int b_last_error; /* previous async I/O error */ const struct xfs_buf_ops *b_ops; #ifdef XFS_BUF_LOCK_TRACKING diff --git a/fs/xfs/xfs_buf_item.c b/fs/xfs/xfs_buf_item.c index 2891134..68e34d1 100644 --- a/fs/xfs/xfs_buf_item.c +++ b/fs/xfs/xfs_buf_item.c @@ -926,35 +926,22 @@ xfs_buf_do_callbacks( } } -/* - * This is the iodone() function for buffers which have had callbacks - * attached to them by xfs_buf_attach_iodone(). It should remove each - * log item from the buffer's list and call the callback of each in turn. - * When done, the buffer's fsprivate field is set to NULL and the buffer - * is unlocked with a call to iodone(). - */ -void -xfs_buf_iodone_callbacks( +static bool +xfs_buf_iodone_callback_error( struct xfs_buf *bp) { struct xfs_log_item *lip = bp->b_fspriv; struct xfs_mount *mp = lip->li_mountp; static ulong lasttime; static xfs_buftarg_t *lasttarg; - - if (likely(!bp->b_error)) - goto do_callbacks; + struct xfs_error_cfg *cfg; /* * If we've already decided to shutdown the filesystem because of * I/O errors, there's no point in giving this a retry. */ - if (XFS_FORCED_SHUTDOWN(mp)) { - xfs_buf_stale(bp); - bp->b_flags |= XBF_DONE; - trace_xfs_buf_item_iodone(bp, _RET_IP_); - goto do_callbacks; - } + if (XFS_FORCED_SHUTDOWN(mp)) + goto out_stale; if (bp->b_target != lasttarg || time_after(jiffies, (lasttime + 5*HZ))) { @@ -963,45 +950,80 @@ xfs_buf_iodone_callbacks( } lasttarg = bp->b_target; + /* synchronous writes will have callers process the error */ + if (!(bp->b_flags & XBF_ASYNC)) + goto out_stale; + + trace_xfs_buf_item_iodone_async(bp, _RET_IP_); + ASSERT(bp->b_iodone != NULL); + /* * If the write was asynchronous then no one will be looking for the - * error. Clear the error state and write the buffer out again. - * - * XXX: This helps against transient write errors, but we need to find - * a way to shut the filesystem down if the writes keep failing. - * - * In practice we'll shut the filesystem down soon as non-transient - * errors tend to affect the whole device and a failing log write - * will make us give up. But we really ought to do better here. + * error. If this is the first failure of this type, clear the error + * state and write the buffer out again. This means we always retry an + * async write failure at least once, but we also need to set the buffer + * up to behave correctly now for repeated failures. */ - if (bp->b_flags & XBF_ASYNC) { - ASSERT(bp->b_iodone != NULL); - - trace_xfs_buf_item_iodone_async(bp, _RET_IP_); + cfg = xfs_error_get_cfg(mp, XFS_ERR_METADATA, bp->b_error); + if (!(bp->b_flags & (XBF_STALE|XBF_WRITE_FAIL)) || + bp->b_last_error != bp->b_error) { + bp->b_flags |= (XBF_WRITE | XBF_ASYNC | + XBF_DONE | XBF_WRITE_FAIL); + bp->b_last_error = bp->b_error; + xfs_buf_ioerror(bp, 0); + xfs_buf_submit(bp); + return true; + } - xfs_buf_ioerror(bp, 0); /* errno of 0 unsets the flag */ + /* + * Repeated failure on an async write. Take action according to the + * error configuration we have been set up to use. + */ + if (cfg->fail_speed == XFS_ERR_FAIL_FAST) + goto permanent_error; - if (!(bp->b_flags & (XBF_STALE|XBF_WRITE_FAIL))) { - bp->b_flags |= XBF_WRITE | XBF_ASYNC | - XBF_DONE | XBF_WRITE_FAIL; - xfs_buf_submit(bp); - } else { - xfs_buf_relse(bp); - } - - return; - } + /* still a transient error, higher layers will retry */ + xfs_buf_ioerror(bp, 0); + xfs_buf_relse(bp); + return true; /* - * If the write of the buffer was synchronous, we want to make - * sure to return the error to the caller of xfs_bwrite(). + * Permanent error - we need to trigger a shutdown if we haven't already + * to indicate that inconsistency will result from this action. */ +permanent_error: + xfs_force_shutdown(mp, SHUTDOWN_META_IO_ERROR); +out_stale: xfs_buf_stale(bp); bp->b_flags |= XBF_DONE; - trace_xfs_buf_error_relse(bp, _RET_IP_); + return false; +} + +/* + * This is the iodone() function for buffers which have had callbacks attached + * to them by xfs_buf_attach_iodone(). We need to iterate the items on the + * callback list, mark the buffer as having no more callbacks and then push the + * buffer through IO completion processing. + */ +void +xfs_buf_iodone_callbacks( + struct xfs_buf *bp) +{ + /* + * If there is an error, process it. Some errors require us + * to run callbacks after failure processing is done so we + * detect that and take appropriate action. + */ + if (bp->b_error && xfs_buf_iodone_callback_error(bp)) + return; + + /* + * Successful IO or permanent error. Either way, we can clear the + * retry state here in preparation for the next error that may occur. + */ + bp->b_last_error = 0; -do_callbacks: xfs_buf_do_callbacks(bp); bp->b_fspriv = NULL; bp->b_iodone = NULL; diff --git a/fs/xfs/xfs_mount.h b/fs/xfs/xfs_mount.h index 36e7330..9a61f39 100644 --- a/fs/xfs/xfs_mount.h +++ b/fs/xfs/xfs_mount.h @@ -371,4 +371,7 @@ extern void xfs_set_low_space_thresholds(struct xfs_mount *); int xfs_zero_extent(struct xfs_inode *ip, xfs_fsblock_t start_fsb, xfs_off_t count_fsb); +struct xfs_error_cfg * xfs_error_get_cfg(struct xfs_mount *mp, + int error_class, int error); + #endif /* __XFS_MOUNT_H__ */ diff --git a/fs/xfs/xfs_sysfs.c b/fs/xfs/xfs_sysfs.c index c5f0afa..b8a6804 100644 --- a/fs/xfs/xfs_sysfs.c +++ b/fs/xfs/xfs_sysfs.c @@ -392,3 +392,20 @@ xfs_error_sysfs_del( xfs_sysfs_del(&mp->m_error_meta_kobj); xfs_sysfs_del(&mp->m_error_kobj); } + +struct xfs_error_cfg * +xfs_error_get_cfg( + struct xfs_mount *mp, + int error_class, + int error) +{ + struct xfs_error_cfg *cfg; + + switch (error) { + default: + cfg = &mp->m_error_cfg[error_class][XFS_ERR_DEFAULT]; + break; + } + + return cfg; +} -- 2.5.0 From dave@fromorbit.com Thu Feb 4 19:23:39 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=ham version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay1.corp.sgi.com [137.38.102.111]) by oss.sgi.com (Postfix) with ESMTP id 01E517CA2 for ; Thu, 4 Feb 2016 19:23:38 -0600 (CST) Received: from cuda.sgi.com (cuda1.sgi.com [192.48.157.11]) by relay1.corp.sgi.com (Postfix) with ESMTP id AABB88F8040 for ; Thu, 4 Feb 2016 17:23:35 -0800 (PST) X-ASG-Debug-ID: 1454635412-04bdf079c52e4c0001-NocioJ Received: from ipmail06.adl2.internode.on.net (ipmail06.adl2.internode.on.net [150.101.137.129]) by cuda.sgi.com with ESMTP id VeF0wVqodsbjeYJg for ; Thu, 04 Feb 2016 17:23:32 -0800 (PST) X-Barracuda-Envelope-From: dave@fromorbit.com X-Barracuda-Apparent-Source-IP: 150.101.137.129 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: A2AnDQB0+LNWPBATLHleKAECgw+IIoF4nUIBAQEBAQEGkSiLVE0BAQEBAQEHAQEBAUE/QRIBhEo7gQIDB4hHoXaedIVKiX2DbgWSbIQFnECOQIIYAQsBgjUoggWGUwEBAQ Received: from ppp121-44-19-16.lns20.syd4.internode.on.net (HELO dastard) ([121.44.19.16]) by ipmail06.adl2.internode.on.net with ESMTP; 05 Feb 2016 11:53:31 +1030 Received: from disappointment.disaster.area ([192.168.1.110] helo=disappointment) by dastard with esmtp (Exim 4.80) (envelope-from ) id 1aRV7T-0000Wo-16 for xfs@oss.sgi.com; Fri, 05 Feb 2016 12:23:31 +1100 Received: from dave by disappointment with local (Exim 4.86) (envelope-from ) id 1aRV7S-0005tC-WF for xfs@oss.sgi.com; Fri, 05 Feb 2016 12:23:31 +1100 From: Dave Chinner To: xfs@oss.sgi.com Subject: [PATCH 0/9] xfs: configurable error behaviour Date: Fri, 5 Feb 2016 12:23:18 +1100 X-ASG-Orig-Subj: [PATCH 0/9] xfs: configurable error behaviour Message-Id: <1454635407-22276-1-git-send-email-david@fromorbit.com> X-Mailer: git-send-email 2.5.0 X-Barracuda-Connect: ipmail06.adl2.internode.on.net[150.101.137.129] X-Barracuda-Start-Time: 1454635412 X-Barracuda-URL: https://192.48.157.11:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-BRTS-Status: 1 X-Barracuda-Spam-Score: 0.00 X-Barracuda-Spam-Status: No, SCORE=0.00 using per-user scores of TAG_LEVEL=1000.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.7 tests= X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.3.26757 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- Hi folks, I need to restart the discussion and review of this patch series. There was some discussion of it last time, but nothing really came from that. I'm posting what I have in my tree right now - treat it as though it's an initial posting of the code because I can't recall what I've changed since the first posting. What I'd like to have to for the next merge window is all the IO error bits sorted out. The final patch (kmem failure behaviour) needs more infrastructure (passing mp to every allocation) so that's a secondary concern right now and I've only included it to demonstrate how to apply this code ot a different subsystem. Things that need to be nailed down before I can commit the series: - sysfs layout - naming conventions for errors and subsystems in sysfs - how best to display/change default behaviour Things that we can change/implement later: - default behaviour - additional error classes - additional error types - additional subsystems - subsystem error handling implementation - communication with other subsystems to dynamically change error behaviour IOWs, what is important right now is how we present this to userspace, because we can't change that easily once we've decided on a presentation structure. Modifying the code to classify and handle all the different error types is much less important, as we can change that to fix whatever problems we have without impacting the presentation to userspace. There is definite need for this (e.g. handling of ENOSPC on thin provisioned devices), so I want to get quickly to a consensus on the userspace facing aspects so that we can get this ball rolling. The biggest unsolved issue is how to change the default behaviour persistently. There is no infrastructure in this patch series to do that, but it is someting that we have to consider so that we don't require default behaviour to be changed after every mount of every filesystem on a system. My thoughts on this is we store changes to the defaults in xattrs on the root inode, but I'm open to ideas here as there's no code written for it yet. Solving this problem, however, is not necessary before commiting the initial code; it's something we can add later once we've worked out all the details. Discuss! -Dave. From dave@fromorbit.com Thu Feb 4 19:23:41 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=ham version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay1.corp.sgi.com [137.38.102.111]) by oss.sgi.com (Postfix) with ESMTP id 8FBD47CAD for ; Thu, 4 Feb 2016 19:23:40 -0600 (CST) Received: from cuda.sgi.com (cuda1.sgi.com [192.48.157.11]) by relay1.corp.sgi.com (Postfix) with ESMTP id 6367D8F8040 for ; Thu, 4 Feb 2016 17:23:40 -0800 (PST) X-ASG-Debug-ID: 1454635413-04bdf079c32e4c0003-NocioJ Received: from ipmail06.adl2.internode.on.net (ipmail06.adl2.internode.on.net [150.101.137.129]) by cuda.sgi.com with ESMTP id 6PbXTYX3PX4xqXvf for ; Thu, 04 Feb 2016 17:23:37 -0800 (PST) X-Barracuda-Envelope-From: dave@fromorbit.com X-Barracuda-Apparent-Source-IP: 150.101.137.129 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: A2AtDQB0+LNWPBATLHleKAECgw+BP4ZjgXidQgEBAQEBAQaRKItUTQEBAQEBAQcBAQEBQT9BEgGDbgEFJy8zCBgxOQMHFBmIGsBqhUqNawWWcZxAjkCCGAELgjYoLoFXhRoEgTUBAQE Received: from ppp121-44-19-16.lns20.syd4.internode.on.net (HELO dastard) ([121.44.19.16]) by ipmail06.adl2.internode.on.net with ESMTP; 05 Feb 2016 11:53:31 +1030 Received: from disappointment.disaster.area ([192.168.1.110] helo=disappointment) by dastard with esmtp (Exim 4.80) (envelope-from ) id 1aRV7T-0000Wu-4A for xfs@oss.sgi.com; Fri, 05 Feb 2016 12:23:31 +1100 Received: from dave by disappointment with local (Exim 4.86) (envelope-from ) id 1aRV7T-0005te-3L for xfs@oss.sgi.com; Fri, 05 Feb 2016 12:23:31 +1100 From: Dave Chinner To: xfs@oss.sgi.com Subject: [PATCH 6/9] xfs: add "fail at unmount" error handling configuration Date: Fri, 5 Feb 2016 12:23:24 +1100 X-ASG-Orig-Subj: [PATCH 6/9] xfs: add "fail at unmount" error handling configuration Message-Id: <1454635407-22276-7-git-send-email-david@fromorbit.com> X-Mailer: git-send-email 2.5.0 In-Reply-To: <1454635407-22276-1-git-send-email-david@fromorbit.com> References: <1454635407-22276-1-git-send-email-david@fromorbit.com> X-Barracuda-Connect: ipmail06.adl2.internode.on.net[150.101.137.129] X-Barracuda-Start-Time: 1454635416 X-Barracuda-URL: https://192.48.157.11:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-BRTS-Status: 1 X-Barracuda-Spam-Score: 0.00 X-Barracuda-Spam-Status: No, SCORE=0.00 using per-user scores of TAG_LEVEL=1000.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.7 tests= X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.3.26757 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- From: Dave Chinner If we take "retry forever" literally on metadata IO errors, we can hang an unmount retries those writes forever. This is the default behaviour, unfortunately. Add a error configuration option for this behaviour and default it to "fail" so that an unmount will trigger actual errors, a shutdown and allow the unmount to succeed. It will be noisy, though, as it will log the errors and shutdown that occurs. To do this, we need to mark the filesystem as being in the process of unmounting. Do this with a mount flag that is added at the appropriate time (i.e. before the blocking AIL sync). We also need to add this flag if mount fails after the initial phase of log recovery has been run. The config is done by a separate boolean sysfs option rather than a new fail_speed enum, as fail_at_unmount is relevant to both XFS_ERR_FAIL_NEVER and XFS_ERR_FAIL_SLOW options. Signed-off-by: Dave Chinner --- fs/xfs/xfs_buf_item.c | 4 ++++ fs/xfs/xfs_mount.c | 9 +++++++++ fs/xfs/xfs_mount.h | 2 ++ fs/xfs/xfs_sysfs.c | 36 ++++++++++++++++++++++++++++++++++++ 4 files changed, 51 insertions(+) diff --git a/fs/xfs/xfs_buf_item.c b/fs/xfs/xfs_buf_item.c index 7afd4d5..9220283 100644 --- a/fs/xfs/xfs_buf_item.c +++ b/fs/xfs/xfs_buf_item.c @@ -1001,6 +1001,10 @@ xfs_buf_iodone_callback_error( break; } + /* At unmount we may treat errors differently */ + if ((mp->m_flags & XFS_MOUNT_UNMOUNTING) && cfg->fail_at_unmount) + goto permanent_error; + /* still a transient error, higher layers will retry */ xfs_buf_ioerror(bp, 0); xfs_buf_relse(bp); diff --git a/fs/xfs/xfs_mount.c b/fs/xfs/xfs_mount.c index f6fb5e1..f8c4a50 100644 --- a/fs/xfs/xfs_mount.c +++ b/fs/xfs/xfs_mount.c @@ -980,6 +980,7 @@ xfs_mountfs( cancel_delayed_work_sync(&mp->m_reclaim_work); xfs_reclaim_inodes(mp, SYNC_WAIT); out_log_dealloc: + mp->m_flags |= XFS_MOUNT_UNMOUNTING; xfs_log_mount_cancel(mp); out_fail_wait: if (mp->m_logdev_targp && mp->m_logdev_targp != mp->m_ddev_targp) @@ -1031,6 +1032,14 @@ xfs_unmountfs( xfs_log_force(mp, XFS_LOG_SYNC); /* + * We now need to tell the world we are unmounting. This will allow + * us to detect that the filesystem is going away and we should error + * out anything that we have been retrying in the background. This will + * prevent neverending retries iin AIL pushing from hanging the unmount. + */ + mp->m_flags |= XFS_MOUNT_UNMOUNTING; + + /* * Flush all pending changes from the AIL. */ xfs_ail_push_all_sync(mp->m_ail); diff --git a/fs/xfs/xfs_mount.h b/fs/xfs/xfs_mount.h index 2a3d178..edeb0b6 100644 --- a/fs/xfs/xfs_mount.h +++ b/fs/xfs/xfs_mount.h @@ -64,6 +64,7 @@ struct xfs_error_cfg { int fail_speed; int max_retries; /* INT_MAX = retry forever */ unsigned long retry_timeout; /* in jiffies, 0 = no timeout */ + bool fail_at_unmount; }; typedef struct xfs_mount { @@ -187,6 +188,7 @@ typedef struct xfs_mount { #define XFS_MOUNT_WSYNC (1ULL << 0) /* for nfs - all metadata ops must be synchronous except for space allocations */ +#define XFS_MOUNT_UNMOUNTING (1ULL << 1) /* filesystem is unmounting */ #define XFS_MOUNT_WAS_CLEAN (1ULL << 3) #define XFS_MOUNT_FS_SHUTDOWN (1ULL << 4) /* atomic stop of all filesystem operations, typically for diff --git a/fs/xfs/xfs_sysfs.c b/fs/xfs/xfs_sysfs.c index 51d9fa7..a5b040a 100644 --- a/fs/xfs/xfs_sysfs.c +++ b/fs/xfs/xfs_sysfs.c @@ -435,10 +435,43 @@ retry_timeout_seconds_store( } XFS_SYSFS_ATTR_RW(retry_timeout_seconds); +static ssize_t +fail_at_unmount_show( + struct kobject *kobject, + char *buf) +{ + struct xfs_error_cfg *cfg = to_error_cfg(kobject); + + return snprintf(buf, PAGE_SIZE, "%d\n", cfg->fail_at_unmount); +} + +static ssize_t +fail_at_unmount_store( + struct kobject *kobject, + const char *buf, + size_t count) +{ + struct xfs_error_cfg *cfg = to_error_cfg(kobject); + int ret; + int val; + + ret = kstrtoint(buf, 0, &val); + if (ret) + return ret; + + if (val < 0 || val > 1) + return -EINVAL; + + cfg->fail_at_unmount = val; + return count; +} +XFS_SYSFS_ATTR_RW(fail_at_unmount); + static struct attribute *xfs_error_attrs[] = { ATTR_LIST(failure_speed), ATTR_LIST(max_retries), ATTR_LIST(retry_timeout_seconds), + ATTR_LIST(fail_at_unmount), NULL, }; @@ -464,6 +497,7 @@ struct xfs_error_init { int fail_speed; int max_retries; int retry_timeout; /* in seconds */ + bool fail_at_unmount; }; static const struct xfs_error_init xfs_error_meta_init[XFS_ERR_ERRNO_MAX] = { @@ -471,6 +505,7 @@ static const struct xfs_error_init xfs_error_meta_init[XFS_ERR_ERRNO_MAX] = { .fail_speed = XFS_ERR_FAIL_NEVER, .max_retries = INT_MAX, .retry_timeout = 0, + .fail_at_unmount = true, }, }; @@ -504,6 +539,7 @@ xfs_error_sysfs_init_class( cfg->max_retries = init[i].max_retries; cfg->retry_timeout = msecs_to_jiffies( init[i].retry_timeout * MSEC_PER_SEC); + cfg->fail_at_unmount = init[i].fail_at_unmount; } return 0; -- 2.5.0 From dave@fromorbit.com Thu Feb 4 19:23:41 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=ham version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay3.corp.sgi.com [198.149.34.15]) by oss.sgi.com (Postfix) with ESMTP id 2A82E7CAB for ; Thu, 4 Feb 2016 19:23:40 -0600 (CST) Received: from cuda.sgi.com (cuda1.sgi.com [192.48.157.11]) by relay3.corp.sgi.com (Postfix) with ESMTP id C0679AC004 for ; Thu, 4 Feb 2016 17:23:39 -0800 (PST) X-ASG-Debug-ID: 1454635412-04bdf079c52e4c0003-NocioJ Received: from ipmail06.adl2.internode.on.net (ipmail06.adl2.internode.on.net [150.101.137.129]) by cuda.sgi.com with ESMTP id QGrA5EFb8WRjrATb for ; Thu, 04 Feb 2016 17:23:36 -0800 (PST) X-Barracuda-Envelope-From: dave@fromorbit.com X-Barracuda-Apparent-Source-IP: 150.101.137.129 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: A2AtDQB0+LNWPBATLHleKAECgw+BP4ZjgXidQgEBAQEBAQaRKItUTQEBAQEBAQcBAQEBQT9BEgGDbgEFJy8zCBgxOQMHFBmIGsBqhUqNawWHUIVVgS+IHZxAjkCCGAELgjYoLoFXhlMBAQE Received: from ppp121-44-19-16.lns20.syd4.internode.on.net (HELO dastard) ([121.44.19.16]) by ipmail06.adl2.internode.on.net with ESMTP; 05 Feb 2016 11:53:31 +1030 Received: from disappointment.disaster.area ([192.168.1.110] helo=disappointment) by dastard with esmtp (Exim 4.80) (envelope-from ) id 1aRV7T-0000Wt-3m for xfs@oss.sgi.com; Fri, 05 Feb 2016 12:23:31 +1100 Received: from dave by disappointment with local (Exim 4.86) (envelope-from ) id 1aRV7T-0005tZ-2v for xfs@oss.sgi.com; Fri, 05 Feb 2016 12:23:31 +1100 From: Dave Chinner To: xfs@oss.sgi.com Subject: [PATCH 5/9] xfs: add configuration of error failure speed Date: Fri, 5 Feb 2016 12:23:23 +1100 X-ASG-Orig-Subj: [PATCH 5/9] xfs: add configuration of error failure speed Message-Id: <1454635407-22276-6-git-send-email-david@fromorbit.com> X-Mailer: git-send-email 2.5.0 In-Reply-To: <1454635407-22276-1-git-send-email-david@fromorbit.com> References: <1454635407-22276-1-git-send-email-david@fromorbit.com> X-Barracuda-Connect: ipmail06.adl2.internode.on.net[150.101.137.129] X-Barracuda-Start-Time: 1454635415 X-Barracuda-URL: https://192.48.157.11:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-BRTS-Status: 1 X-Barracuda-Spam-Score: 0.00 X-Barracuda-Spam-Status: No, SCORE=0.00 using per-user scores of TAG_LEVEL=1000.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.7 tests= X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.3.26757 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- From: Dave Chinner On reception of an error, we can fail immediately, perform some bound amount of retries or retry indefinitely. The current behaviour we have is to retry forever. However, we'd like the ability to choose what behaviour we have, and that requires the ability to configure the behaviour through the new sysfs interfaces. Add configuration options for fail fast, slow or never to reflect the three choices above. Fail fast or fail never don't require any other options, but "fail slow" needs configuration to bound the retry behaviour. Add both a maximum retry count and a retry timeout so that we can bound by time and/or physical IO attempts. Finally, plumb these into xfs_buf_iodone error processing so that the error behaviour follows the selected configuration. Signed-off-by: Dave Chinner --- fs/xfs/xfs_buf.h | 23 ++++++++- fs/xfs/xfs_buf_item.c | 22 ++++++++- fs/xfs/xfs_mount.h | 2 + fs/xfs/xfs_sysfs.c | 128 ++++++++++++++++++++++++++++++++++++++++++++++++-- 4 files changed, 169 insertions(+), 6 deletions(-) diff --git a/fs/xfs/xfs_buf.h b/fs/xfs/xfs_buf.h index ad16a1e..1edbe3c 100644 --- a/fs/xfs/xfs_buf.h +++ b/fs/xfs/xfs_buf.h @@ -183,7 +183,28 @@ typedef struct xfs_buf { unsigned int b_page_count; /* size of page array */ unsigned int b_offset; /* page offset in first page */ int b_error; /* error code on I/O */ - int b_last_error; /* previous async I/O error */ + + /* + * async write failure retry count. Initialised to zero on the first + * failure, then when it exceeds the maximum configured without a + * success the write is considered to be failed permanently and the + * iodone handler will take appropriate action. + * + * For retry timeouts, we record the jiffie of the first failure. This + * means that we can change the retry timeout and it on the next error + * it will be checked against the newly configured timeout. This + * prevents buffers getting stuck in retry loops with a really long + * timeout. + * + * last_error is used to ensure that we are getting repeated errors, not + * different errors. e.g. a block device might change ENOSPC to EIO when + * a failure timeout occurs, so we want to re-initialise the error + * retry behaviour appropriately when that happens. + */ + int b_retries; + unsigned long b_first_retry_time; /* in jiffies */ + int b_last_error; + const struct xfs_buf_ops *b_ops; #ifdef XFS_BUF_LOCK_TRACKING diff --git a/fs/xfs/xfs_buf_item.c b/fs/xfs/xfs_buf_item.c index 68e34d1..7afd4d5 100644 --- a/fs/xfs/xfs_buf_item.c +++ b/fs/xfs/xfs_buf_item.c @@ -970,6 +970,9 @@ xfs_buf_iodone_callback_error( bp->b_flags |= (XBF_WRITE | XBF_ASYNC | XBF_DONE | XBF_WRITE_FAIL); bp->b_last_error = bp->b_error; + bp->b_retries = 0; + bp->b_first_retry_time = jiffies; + xfs_buf_ioerror(bp, 0); xfs_buf_submit(bp); return true; @@ -979,9 +982,25 @@ xfs_buf_iodone_callback_error( * Repeated failure on an async write. Take action according to the * error configuration we have been set up to use. */ - if (cfg->fail_speed == XFS_ERR_FAIL_FAST) + switch (cfg->fail_speed) { + case XFS_ERR_FAIL_FAST: goto permanent_error; + case XFS_ERR_FAIL_SLOW: + if (++bp->b_retries > cfg->max_retries) + goto permanent_error; + if (!cfg->retry_timeout) + break; + if (time_after(jiffies, + cfg->retry_timeout + bp->b_first_retry_time)) + goto permanent_error; + break; + + case XFS_ERR_FAIL_NEVER: + default: + break; + } + /* still a transient error, higher layers will retry */ xfs_buf_ioerror(bp, 0); xfs_buf_relse(bp); @@ -1023,6 +1042,7 @@ xfs_buf_iodone_callbacks( * retry state here in preparation for the next error that may occur. */ bp->b_last_error = 0; + bp->b_retries = 0; xfs_buf_do_callbacks(bp); bp->b_fspriv = NULL; diff --git a/fs/xfs/xfs_mount.h b/fs/xfs/xfs_mount.h index 9a61f39..2a3d178 100644 --- a/fs/xfs/xfs_mount.h +++ b/fs/xfs/xfs_mount.h @@ -62,6 +62,8 @@ enum { struct xfs_error_cfg { struct xfs_kobj kobj; int fail_speed; + int max_retries; /* INT_MAX = retry forever */ + unsigned long retry_timeout; /* in jiffies, 0 = no timeout */ }; typedef struct xfs_mount { diff --git a/fs/xfs/xfs_sysfs.c b/fs/xfs/xfs_sysfs.c index 27487ce..51d9fa7 100644 --- a/fs/xfs/xfs_sysfs.c +++ b/fs/xfs/xfs_sysfs.c @@ -319,10 +319,6 @@ struct kobj_type xfs_log_ktype = { * and any other future type of IO (e.g. special inode or directory error * handling) we care to support. */ -static struct attribute *xfs_error_attrs[] = { - NULL, -}; - static inline struct xfs_error_cfg * to_error_cfg(struct kobject *kobject) { @@ -330,6 +326,123 @@ to_error_cfg(struct kobject *kobject) return container_of(kobj, struct xfs_error_cfg, kobj); } +static ssize_t +failure_speed_show( + struct kobject *kobject, + char *buf) +{ + struct xfs_error_cfg *cfg = to_error_cfg(kobject); + + if (cfg->fail_speed == XFS_ERR_FAIL_FAST) + return snprintf(buf, PAGE_SIZE, "[fast] slow never\n"); + if (cfg->fail_speed == XFS_ERR_FAIL_SLOW) + return snprintf(buf, PAGE_SIZE, "fast [slow] never\n"); + return snprintf(buf, PAGE_SIZE, "fast slow [never]\n"); +} + +static ssize_t +failure_speed_store( + struct kobject *kobject, + const char *buf, + size_t count) +{ + struct xfs_error_cfg *cfg = to_error_cfg(kobject); + char *str = kstrdup(buf, GFP_KERNEL); + char *sp; + int len; + + if (!str) + return -ENOMEM; + + sp = strstrip(str); + len = strlen(sp); + if (strncmp(sp, "fast", len) == 0) + cfg->fail_speed = XFS_ERR_FAIL_FAST; + else if (strncmp(sp, "slow", len) == 0) + cfg->fail_speed = XFS_ERR_FAIL_SLOW; + else if (strncmp(sp, "never", len) == 0) + cfg->fail_speed = XFS_ERR_FAIL_NEVER; + else + count = -EINVAL; + kfree(str); + return count; +} +XFS_SYSFS_ATTR_RW(failure_speed); + +static ssize_t +max_retries_show( + struct kobject *kobject, + char *buf) +{ + struct xfs_error_cfg *cfg = to_error_cfg(kobject); + + return snprintf(buf, PAGE_SIZE, "%d\n", cfg->max_retries); +} + +static ssize_t +max_retries_store( + struct kobject *kobject, + const char *buf, + size_t count) +{ + struct xfs_error_cfg *cfg = to_error_cfg(kobject); + int ret; + int val; + + ret = kstrtoint(buf, 0, &val); + if (ret) + return ret; + + if (val < 0 || val > INT_MAX) + return -EINVAL; + + cfg->max_retries = val; + return count; +} +XFS_SYSFS_ATTR_RW(max_retries); + +static ssize_t +retry_timeout_seconds_show( + struct kobject *kobject, + char *buf) +{ + struct xfs_error_cfg *cfg = to_error_cfg(kobject); + + return snprintf(buf, PAGE_SIZE, "%ld\n", + jiffies_to_msecs(cfg->retry_timeout) * MSEC_PER_SEC); +} + +static ssize_t +retry_timeout_seconds_store( + struct kobject *kobject, + const char *buf, + size_t count) +{ + struct xfs_error_cfg *cfg = to_error_cfg(kobject); + int ret; + int val; + + ret = kstrtoint(buf, 0, &val); + if (ret) + return ret; + + /* 1 day timeout maximum */ + if (val < 0 || val > 86400) + return -EINVAL; + + cfg->retry_timeout = msecs_to_jiffies(val * MSEC_PER_SEC); + return count; +} +XFS_SYSFS_ATTR_RW(retry_timeout_seconds); + +static struct attribute *xfs_error_attrs[] = { + ATTR_LIST(failure_speed), + ATTR_LIST(max_retries), + ATTR_LIST(retry_timeout_seconds), + NULL, +}; + + struct kobj_type xfs_error_cfg_ktype = { .release = xfs_sysfs_release, .sysfs_ops = &xfs_sysfs_ops, @@ -349,11 +462,15 @@ struct kobj_type xfs_error_ktype = { struct xfs_error_init { char *name; int fail_speed; + int max_retries; + int retry_timeout; /* in seconds */ }; static const struct xfs_error_init xfs_error_meta_init[XFS_ERR_ERRNO_MAX] = { { .name = "Default", .fail_speed = XFS_ERR_FAIL_NEVER, + .max_retries = INT_MAX, + .retry_timeout = 0, }, }; @@ -384,6 +501,9 @@ xfs_error_sysfs_init_class( goto out_error; cfg->fail_speed = init[i].fail_speed; + cfg->max_retries = init[i].max_retries; + cfg->retry_timeout = msecs_to_jiffies( + init[i].retry_timeout * MSEC_PER_SEC); } return 0; -- 2.5.0 From dave@fromorbit.com Thu Feb 4 19:23:43 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=ham version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay2.corp.sgi.com [137.38.102.29]) by oss.sgi.com (Postfix) with ESMTP id 77F777CB2 for ; Thu, 4 Feb 2016 19:23:41 -0600 (CST) Received: from cuda.sgi.com (cuda1.sgi.com [192.48.157.11]) by relay2.corp.sgi.com (Postfix) with ESMTP id 3C4BF304066 for ; Thu, 4 Feb 2016 17:23:41 -0800 (PST) X-ASG-Debug-ID: 1454635413-04bdf079c32e4c0004-NocioJ Received: from ipmail06.adl2.internode.on.net (ipmail06.adl2.internode.on.net [150.101.137.129]) by cuda.sgi.com with ESMTP id wGeq1t6boHko3rFk for ; Thu, 04 Feb 2016 17:23:38 -0800 (PST) X-Barracuda-Envelope-From: dave@fromorbit.com X-Barracuda-Apparent-Source-IP: 150.101.137.129 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: A2AtDQB0+LNWPBATLHleKAECgw+BP4ZjgXidQgEBAQEBAQaRKItUTQEBAQEBAQcBAQEBQT9BEgGDbgEFJy8zCBgxOQMHFBmIGsBqhUqJfYNuBZZxnECOQIIYAQtBGYFcKC6BV4ZTAQEB Received: from ppp121-44-19-16.lns20.syd4.internode.on.net (HELO dastard) ([121.44.19.16]) by ipmail06.adl2.internode.on.net with ESMTP; 05 Feb 2016 11:53:32 +1030 Received: from disappointment.disaster.area ([192.168.1.110] helo=disappointment) by dastard with esmtp (Exim 4.80) (envelope-from ) id 1aRV7T-0000Wq-26 for xfs@oss.sgi.com; Fri, 05 Feb 2016 12:23:31 +1100 Received: from dave by disappointment with local (Exim 4.86) (envelope-from ) id 1aRV7T-0005tK-1J for xfs@oss.sgi.com; Fri, 05 Feb 2016 12:23:31 +1100 From: Dave Chinner To: xfs@oss.sgi.com Subject: [PATCH 2/9] xfs: introduce metadata IO error class Date: Fri, 5 Feb 2016 12:23:20 +1100 X-ASG-Orig-Subj: [PATCH 2/9] xfs: introduce metadata IO error class Message-Id: <1454635407-22276-3-git-send-email-david@fromorbit.com> X-Mailer: git-send-email 2.5.0 In-Reply-To: <1454635407-22276-1-git-send-email-david@fromorbit.com> References: <1454635407-22276-1-git-send-email-david@fromorbit.com> X-Barracuda-Connect: ipmail06.adl2.internode.on.net[150.101.137.129] X-Barracuda-Start-Time: 1454635418 X-Barracuda-URL: https://192.48.157.11:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-BRTS-Status: 1 X-Barracuda-Spam-Score: 0.00 X-Barracuda-Spam-Status: No, SCORE=0.00 using per-user scores of TAG_LEVEL=1000.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.7 tests= X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.3.26757 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- From: Dave Chinner Now we have the basic infrastructure, add the first error class so we can build up the infrastructure in a meaningful way. Add the metadata async write IO error class and sysfs entry, and introduce a default configuration that matches the existing behaviour of XFS_ERR_FAIL_NEVER for async write metadata buffers. Signed-off-by: Dave Chinner --- fs/xfs/xfs_mount.h | 3 +++ fs/xfs/xfs_sysfs.c | 34 ++++++++++++++++++++++++++++++++++ 2 files changed, 37 insertions(+) diff --git a/fs/xfs/xfs_mount.h b/fs/xfs/xfs_mount.h index 96c9658..36e7330 100644 --- a/fs/xfs/xfs_mount.h +++ b/fs/xfs/xfs_mount.h @@ -45,9 +45,11 @@ enum { * Failure types describe when an error is considered fatal. */ enum { + XFS_ERR_METADATA, XFS_ERR_CLASS_MAX, }; enum { + XFS_ERR_DEFAULT, XFS_ERR_ERRNO_MAX, }; enum { @@ -153,6 +155,7 @@ typedef struct xfs_mount { /* low free space thresholds */ struct xfs_kobj m_kobj; struct xfs_kobj m_error_kobj; + struct xfs_kobj m_error_meta_kobj; struct xfs_error_cfg m_error_cfg[XFS_ERR_CLASS_MAX][XFS_ERR_ERRNO_MAX]; struct xstats m_stats; /* per-fs stats */ diff --git a/fs/xfs/xfs_sysfs.c b/fs/xfs/xfs_sysfs.c index 7d81c1b..c5f0afa 100644 --- a/fs/xfs/xfs_sysfs.c +++ b/fs/xfs/xfs_sysfs.c @@ -344,11 +344,34 @@ int xfs_error_sysfs_init( struct xfs_mount *mp) { + struct xfs_error_cfg *cfg; int error; /* .../xfs//error/ */ error = xfs_sysfs_init(&mp->m_error_kobj, &xfs_error_ktype, &mp->m_kobj, "error"); + if (error) + return error; + + /* .../xfs//error/metadata/ */ + error = xfs_sysfs_init(&mp->m_error_meta_kobj, &xfs_error_ktype, + &mp->m_error_kobj, "metadata"); + if (error) + goto out_error; + + cfg = &mp->m_error_cfg[XFS_ERR_METADATA][XFS_ERR_DEFAULT]; + error = xfs_sysfs_init(&cfg->kobj, &xfs_error_cfg_ktype, + &mp->m_error_meta_kobj, "Default"); + if (error) + goto out_error_meta; + cfg->fail_speed = XFS_ERR_FAIL_NEVER; + + return 0; + +out_error_meta: + xfs_sysfs_del(&mp->m_error_meta_kobj); +out_error: + xfs_sysfs_del(&mp->m_error_kobj); return error; } @@ -356,5 +379,16 @@ void xfs_error_sysfs_del( struct xfs_mount *mp) { + struct xfs_error_cfg *cfg; + int i, j; + + for (i = 0; i < XFS_ERR_CLASS_MAX; i++) { + for (j = 0; j < XFS_ERR_ERRNO_MAX; j++) { + cfg = &mp->m_error_cfg[i][j]; + + xfs_sysfs_del(&cfg->kobj); + } + } + xfs_sysfs_del(&mp->m_error_meta_kobj); xfs_sysfs_del(&mp->m_error_kobj); } -- 2.5.0 From dave@fromorbit.com Thu Feb 4 19:23:43 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=ham version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay3.corp.sgi.com [198.149.34.15]) by oss.sgi.com (Postfix) with ESMTP id 8C1487CA2 for ; Thu, 4 Feb 2016 19:23:41 -0600 (CST) Received: from cuda.sgi.com (cuda1.sgi.com [192.48.157.11]) by relay3.corp.sgi.com (Postfix) with ESMTP id 2BEE6AC001 for ; Thu, 4 Feb 2016 17:23:41 -0800 (PST) X-ASG-Debug-ID: 1454635412-04bdf079c52e4c0004-NocioJ Received: from ipmail06.adl2.internode.on.net (ipmail06.adl2.internode.on.net [150.101.137.129]) by cuda.sgi.com with ESMTP id Qn30dHkT66CvvwNT for ; Thu, 04 Feb 2016 17:23:38 -0800 (PST) X-Barracuda-Envelope-From: dave@fromorbit.com X-Barracuda-Apparent-Source-IP: 150.101.137.129 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: A2AtDQB0+LNWPBATLHleKAECgw+BP4ZjgXidQgEBAQEBAQaRKItUTQEBAQEBAQcBAQEBQT9BEgGDbgEFJy8zCBgxOQMHFBmIGsBqhUqJG4RQBZZxjyqHaIUujkCCGAELQRmBXCgugVeFG4E4AQEB Received: from ppp121-44-19-16.lns20.syd4.internode.on.net (HELO dastard) ([121.44.19.16]) by ipmail06.adl2.internode.on.net with ESMTP; 05 Feb 2016 11:53:32 +1030 Received: from disappointment.disaster.area ([192.168.1.110] helo=disappointment) by dastard with esmtp (Exim 4.80) (envelope-from ) id 1aRV7T-0000Wp-1k for xfs@oss.sgi.com; Fri, 05 Feb 2016 12:23:31 +1100 Received: from dave by disappointment with local (Exim 4.86) (envelope-from ) id 1aRV7T-0005tF-0i for xfs@oss.sgi.com; Fri, 05 Feb 2016 12:23:31 +1100 From: Dave Chinner To: xfs@oss.sgi.com Subject: [PATCH 1/9] xfs: configurable error behaviour via sysfs Date: Fri, 5 Feb 2016 12:23:19 +1100 X-ASG-Orig-Subj: [PATCH 1/9] xfs: configurable error behaviour via sysfs Message-Id: <1454635407-22276-2-git-send-email-david@fromorbit.com> X-Mailer: git-send-email 2.5.0 In-Reply-To: <1454635407-22276-1-git-send-email-david@fromorbit.com> References: <1454635407-22276-1-git-send-email-david@fromorbit.com> X-Barracuda-Connect: ipmail06.adl2.internode.on.net[150.101.137.129] X-Barracuda-Start-Time: 1454635418 X-Barracuda-URL: https://192.48.157.11:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-BRTS-Status: 1 X-Barracuda-Spam-Score: 0.00 X-Barracuda-Spam-Status: No, SCORE=0.00 using per-user scores of TAG_LEVEL=1000.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.7 tests= X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.3.26757 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- From: Dave Chinner We need to be able to change the way XFS behaviours in error conditions depending on the type of underlying storage. This is necessary for handling non-traditional block devices with extended error cases, such as thin provisioned devices that can return ENOSPC as an IO error. Introduce the basic sysfs infrastructure needed to define and configure error behaviours. This is done to be generic enough to extend to configuring behaviour in other error conditions, such as ENOMEM, which also has different desired behaviours according to machine configuration. Signed-off-by: Dave Chinner --- fs/xfs/xfs_mount.c | 10 +++++++++- fs/xfs/xfs_mount.h | 27 ++++++++++++++++++++++++++ fs/xfs/xfs_sysfs.c | 56 +++++++++++++++++++++++++++++++++++++++++++++++++++++- fs/xfs/xfs_sysfs.h | 3 +++ 4 files changed, 94 insertions(+), 2 deletions(-) diff --git a/fs/xfs/xfs_mount.c b/fs/xfs/xfs_mount.c index 986290c..f6fb5e1 100644 --- a/fs/xfs/xfs_mount.c +++ b/fs/xfs/xfs_mount.c @@ -708,10 +708,15 @@ xfs_mountfs( if (error) goto out_remove_sysfs; - error = xfs_uuid_mount(mp); + error = xfs_error_sysfs_init(mp); if (error) goto out_del_stats; + + error = xfs_uuid_mount(mp); + if (error) + goto out_remove_error_sysfs; + /* * Set the minimum read and write sizes */ @@ -986,6 +991,8 @@ xfs_mountfs( xfs_da_unmount(mp); out_remove_uuid: xfs_uuid_unmount(mp); + out_remove_error_sysfs: + xfs_error_sysfs_del(mp); out_del_stats: xfs_sysfs_del(&mp->m_stats.xs_kobj); out_remove_sysfs: @@ -1074,6 +1081,7 @@ xfs_unmountfs( #endif xfs_free_perag(mp); + xfs_error_sysfs_del(mp); xfs_sysfs_del(&mp->m_stats.xs_kobj); xfs_sysfs_del(&mp->m_kobj); } diff --git a/fs/xfs/xfs_mount.h b/fs/xfs/xfs_mount.h index b570984..96c9658 100644 --- a/fs/xfs/xfs_mount.h +++ b/fs/xfs/xfs_mount.h @@ -37,6 +37,31 @@ enum { XFS_LOWSP_MAX, }; +/* + * Error Configuration + * + * Error classes define the subsystem the configuration belongs to. + * Error numbers define the errors that are configurable. + * Failure types describe when an error is considered fatal. + */ +enum { + XFS_ERR_CLASS_MAX, +}; +enum { + XFS_ERR_ERRNO_MAX, +}; +enum { + XFS_ERR_FAIL_DEFAULT, + XFS_ERR_FAIL_NEVER, + XFS_ERR_FAIL_SLOW, + XFS_ERR_FAIL_FAST, +}; + +struct xfs_error_cfg { + struct xfs_kobj kobj; + int fail_speed; +}; + typedef struct xfs_mount { struct super_block *m_super; xfs_tid_t m_tid; /* next unused tid for fs */ @@ -127,6 +152,8 @@ typedef struct xfs_mount { int64_t m_low_space[XFS_LOWSP_MAX]; /* low free space thresholds */ struct xfs_kobj m_kobj; + struct xfs_kobj m_error_kobj; + struct xfs_error_cfg m_error_cfg[XFS_ERR_CLASS_MAX][XFS_ERR_ERRNO_MAX]; struct xstats m_stats; /* per-fs stats */ struct workqueue_struct *m_buf_workqueue; diff --git a/fs/xfs/xfs_sysfs.c b/fs/xfs/xfs_sysfs.c index 641d625..7d81c1b 100644 --- a/fs/xfs/xfs_sysfs.c +++ b/fs/xfs/xfs_sysfs.c @@ -17,11 +17,15 @@ */ #include "xfs.h" -#include "xfs_sysfs.h" +#include "xfs_shared.h" +#include "xfs_format.h" #include "xfs_log_format.h" +#include "xfs_trans_resv.h" +#include "xfs_sysfs.h" #include "xfs_log.h" #include "xfs_log_priv.h" #include "xfs_stats.h" +#include "xfs_mount.h" struct xfs_sysfs_attr { struct attribute attr; @@ -304,3 +308,53 @@ struct kobj_type xfs_log_ktype = { .sysfs_ops = &xfs_sysfs_ops, .default_attrs = xfs_log_attrs, }; + +/* + * Metadata IO error configuration + * + * The sysfs structure here is: + * ...xfs//error/// + * + * where allows use to discriminate between data IO and metadata IO, + * and any other future type of IO (e.g. special inode or directory error + * handling) we care to support. + */ +static struct attribute *xfs_error_attrs[] = { + NULL, +}; + +static inline struct xfs_error_cfg * +to_error_cfg(struct kobject *kobject) +{ + struct xfs_kobj *kobj = to_kobj(kobject); + return container_of(kobj, struct xfs_error_cfg, kobj); +} + +struct kobj_type xfs_error_cfg_ktype = { + .release = xfs_sysfs_release, + .sysfs_ops = &xfs_sysfs_ops, + .default_attrs = xfs_error_attrs, +}; + +struct kobj_type xfs_error_ktype = { + .release = xfs_sysfs_release, +}; + +int +xfs_error_sysfs_init( + struct xfs_mount *mp) +{ + int error; + + /* .../xfs//error/ */ + error = xfs_sysfs_init(&mp->m_error_kobj, &xfs_error_ktype, + &mp->m_kobj, "error"); + return error; +} + +void +xfs_error_sysfs_del( + struct xfs_mount *mp) +{ + xfs_sysfs_del(&mp->m_error_kobj); +} diff --git a/fs/xfs/xfs_sysfs.h b/fs/xfs/xfs_sysfs.h index be692e5..d046371 100644 --- a/fs/xfs/xfs_sysfs.h +++ b/fs/xfs/xfs_sysfs.h @@ -58,4 +58,7 @@ xfs_sysfs_del( wait_for_completion(&kobj->complete); } +int xfs_error_sysfs_init(struct xfs_mount *mp); +void xfs_error_sysfs_del(struct xfs_mount *mp); + #endif /* __XFS_SYSFS_H__ */ -- 2.5.0 From dave@fromorbit.com Thu Feb 4 19:23:42 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=ham version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay1.corp.sgi.com [137.38.102.111]) by oss.sgi.com (Postfix) with ESMTP id 3F3447CA3 for ; Thu, 4 Feb 2016 19:23:41 -0600 (CST) Received: from cuda.sgi.com (cuda1.sgi.com [192.48.157.11]) by relay1.corp.sgi.com (Postfix) with ESMTP id 0BADD8F8040 for ; Thu, 4 Feb 2016 17:23:40 -0800 (PST) X-ASG-Debug-ID: 1454635415-04bdf079c32e4d0002-NocioJ Received: from ipmail06.adl2.internode.on.net (ipmail06.adl2.internode.on.net [150.101.137.129]) by cuda.sgi.com with ESMTP id tiQjRoHeOeTuc1lE for ; Thu, 04 Feb 2016 17:23:37 -0800 (PST) X-Barracuda-Envelope-From: dave@fromorbit.com X-Barracuda-Apparent-Source-IP: 150.101.137.129 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: A2AtDQB0+LNWPBATLHleKAECgw+BP4ZjgXidQgEBAQEBAQaRKItUTQEBAQEBAQcBAQEBQT9BEgGDbgEFJy8zCBgxOQMHFBmIGsBqhUqNawWHU4VSiUycQI5AghgBC0EZgVwoLoFXhlMBAQE Received: from ppp121-44-19-16.lns20.syd4.internode.on.net (HELO dastard) ([121.44.19.16]) by ipmail06.adl2.internode.on.net with ESMTP; 05 Feb 2016 11:53:31 +1030 Received: from disappointment.disaster.area ([192.168.1.110] helo=disappointment) by dastard with esmtp (Exim 4.80) (envelope-from ) id 1aRV7T-0000Wx-5M for xfs@oss.sgi.com; Fri, 05 Feb 2016 12:23:31 +1100 Received: from dave by disappointment with local (Exim 4.86) (envelope-from ) id 1aRV7T-0005tt-4X for xfs@oss.sgi.com; Fri, 05 Feb 2016 12:23:31 +1100 From: Dave Chinner To: xfs@oss.sgi.com Subject: [PATCH 9/9] xfs: add kmem error configuration class Date: Fri, 5 Feb 2016 12:23:27 +1100 X-ASG-Orig-Subj: [PATCH 9/9] xfs: add kmem error configuration class Message-Id: <1454635407-22276-10-git-send-email-david@fromorbit.com> X-Mailer: git-send-email 2.5.0 In-Reply-To: <1454635407-22276-1-git-send-email-david@fromorbit.com> References: <1454635407-22276-1-git-send-email-david@fromorbit.com> X-Barracuda-Connect: ipmail06.adl2.internode.on.net[150.101.137.129] X-Barracuda-Start-Time: 1454635416 X-Barracuda-URL: https://192.48.157.11:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-BRTS-Status: 1 X-Barracuda-Spam-Score: 0.00 X-Barracuda-Spam-Status: No, SCORE=0.00 using per-user scores of TAG_LEVEL=1000.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.7 tests= X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.3.26757 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- From: Dave Chinner Add a new error configuration class for defining how memory allocation failures are supposed to be handled, This requires factoring the initialisation/teardown code to be able to handle a generic error class object. I'm not yet sure how to hook it into the memory allocation calls - that will be done in a later patch; this just demonstrates how multiple classes are configured and initialised. It may be that we don't configure specific errors here - instead configure how we handle specific types of allocation failure e.g. GFP_KERNEL vs GFP_NOFS vs allocations inside transactions. Either way, we are going to need to plumb the error config handler into the memory allocation code in some manner. Signed-off-by: Dave Chinner --- fs/xfs/xfs_mount.h | 3 ++- fs/xfs/xfs_sysfs.c | 77 +++++++++++++++++++++++++++++++++++++++++------------- 2 files changed, 61 insertions(+), 19 deletions(-) diff --git a/fs/xfs/xfs_mount.h b/fs/xfs/xfs_mount.h index 0ff14a90..62bcdcb 100644 --- a/fs/xfs/xfs_mount.h +++ b/fs/xfs/xfs_mount.h @@ -46,6 +46,7 @@ enum { */ enum { XFS_ERR_METADATA, + XFS_ERR_KMEM, XFS_ERR_CLASS_MAX, }; enum { @@ -162,7 +163,7 @@ typedef struct xfs_mount { /* low free space thresholds */ struct xfs_kobj m_kobj; struct xfs_kobj m_error_kobj; - struct xfs_kobj m_error_meta_kobj; + struct xfs_kobj m_error_class_kobj[XFS_ERR_CLASS_MAX]; struct xfs_error_cfg m_error_cfg[XFS_ERR_CLASS_MAX][XFS_ERR_ERRNO_MAX]; struct xstats m_stats; /* per-fs stats */ diff --git a/fs/xfs/xfs_sysfs.c b/fs/xfs/xfs_sysfs.c index c984c3e..c3dff95 100644 --- a/fs/xfs/xfs_sysfs.c +++ b/fs/xfs/xfs_sysfs.c @@ -522,26 +522,50 @@ static const struct xfs_error_init xfs_error_meta_init[XFS_ERR_ERRNO_MAX] = { { .name = "ENODEV", .fail_speed = XFS_ERR_FAIL_FAST, }, - { .name = "ENOMEM", + { /* ENOMEM */ .fail_speed = XFS_ERR_FAIL_DEFAULT, }, }; +static const struct xfs_error_init xfs_error_kmem_init[XFS_ERR_ERRNO_MAX] = { + { .name = "Default", + .fail_speed = XFS_ERR_FAIL_NEVER, + .max_retries = INT_MAX, + .retry_timeout = 0, + .fail_at_unmount = false, + }, + { /* EIO */ + .fail_speed = XFS_ERR_FAIL_DEFAULT, + }, + { /* ENOSPC */ + .fail_speed = XFS_ERR_FAIL_DEFAULT, + }, + { /* ENODEV */ + .fail_speed = XFS_ERR_FAIL_DEFAULT, + }, + { .name = "ENOMEM", + .fail_speed = XFS_ERR_FAIL_NEVER, + .max_retries = INT_MAX, + .retry_timeout = 0, + .fail_at_unmount = false, + }, +}; + static int xfs_error_sysfs_init_class( struct xfs_mount *mp, int class, const char *parent_name, - struct xfs_kobj *parent_kobj, const struct xfs_error_init init[]) { + struct xfs_kobj *class_kobj = &mp->m_error_class_kobj[class]; struct xfs_error_cfg *cfg; int error; int i; ASSERT(class < XFS_ERR_CLASS_MAX); - error = xfs_sysfs_init(parent_kobj, &xfs_error_ktype, + error = xfs_sysfs_init(class_kobj, &xfs_error_ktype, &mp->m_error_kobj, parent_name); if (error) return error; @@ -554,8 +578,9 @@ xfs_error_sysfs_init_class( if (cfg->fail_speed == XFS_ERR_FAIL_DEFAULT) continue; + ASSERT(init[i].name); error = xfs_sysfs_init(&cfg->kobj, &xfs_error_cfg_ktype, - parent_kobj, init[i].name); + class_kobj, init[i].name); if (error) goto out_error; @@ -572,10 +597,28 @@ out_error: cfg = &mp->m_error_cfg[class][i]; xfs_sysfs_del(&cfg->kobj); } - xfs_sysfs_del(parent_kobj); + xfs_sysfs_del(class_kobj); return error; } +static void +xfs_error_sysfs_del_class( + struct xfs_mount *mp, + int class) +{ + struct xfs_error_cfg *cfg; + int i; + + for (i = 0; i < XFS_ERR_ERRNO_MAX; i++) { + cfg = &mp->m_error_cfg[class][i]; + + if (cfg->fail_speed != XFS_ERR_FAIL_DEFAULT) + xfs_sysfs_del(&cfg->kobj); + } + + xfs_sysfs_del(&mp->m_error_class_kobj[class]); +} + int xfs_error_sysfs_init( struct xfs_mount *mp) @@ -589,14 +632,19 @@ xfs_error_sysfs_init( return error; /* .../xfs//error/metadata/ */ - error = xfs_error_sysfs_init_class(mp, XFS_ERR_METADATA, - "metadata", &mp->m_error_meta_kobj, - xfs_error_meta_init); + error = xfs_error_sysfs_init_class(mp, XFS_ERR_METADATA, "metadata", + xfs_error_meta_init); if (error) goto out_error; + error = xfs_error_sysfs_init_class(mp, XFS_ERR_KMEM, "kmem", + xfs_error_kmem_init); + if (error) + goto out_error_meta; return 0; +out_error_meta: + xfs_error_sysfs_del_class(mp, XFS_ERR_METADATA); out_error: xfs_sysfs_del(&mp->m_error_kobj); return error; @@ -606,18 +654,11 @@ void xfs_error_sysfs_del( struct xfs_mount *mp) { - struct xfs_error_cfg *cfg; - int i, j; + int i; - for (i = 0; i < XFS_ERR_CLASS_MAX; i++) { - for (j = 0; j < XFS_ERR_ERRNO_MAX; j++) { - cfg = &mp->m_error_cfg[i][j]; + for (i = 0; i < XFS_ERR_CLASS_MAX; i++) + xfs_error_sysfs_del_class(mp, i); - if (cfg->fail_speed != XFS_ERR_FAIL_DEFAULT) - xfs_sysfs_del(&cfg->kobj); - } - } - xfs_sysfs_del(&mp->m_error_meta_kobj); xfs_sysfs_del(&mp->m_error_kobj); } -- 2.5.0 From dave@fromorbit.com Thu Feb 4 22:47:39 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=ham version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay1.corp.sgi.com [137.38.102.111]) by oss.sgi.com (Postfix) with ESMTP id 8D4F17CA2 for ; Thu, 4 Feb 2016 22:47:39 -0600 (CST) Received: from cuda.sgi.com (cuda2.sgi.com [192.48.176.25]) by relay1.corp.sgi.com (Postfix) with ESMTP id 718BF8F804B for ; Thu, 4 Feb 2016 20:47:36 -0800 (PST) X-ASG-Debug-ID: 1454647652-04cbb04cf94c270001-NocioJ Received: from ipmail06.adl2.internode.on.net (ipmail06.adl2.internode.on.net [150.101.137.129]) by cuda.sgi.com with ESMTP id Ubvhinr1it9G5jcY for ; Thu, 04 Feb 2016 20:47:33 -0800 (PST) X-Barracuda-Envelope-From: dave@fromorbit.com X-Barracuda-Apparent-Source-IP: 150.101.137.129 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: A2BMCQCgKLRWPBATLHleKAECgw9SbYZjgXidKwIKDAEBAQEBAQaBD5AahCCHK00BAQEBAQEHAQEBAUE/hG8vOxhqAwctiBqhV550hUqGHYJbHoRVBYdThVKJTIVMlnMCjj+CGAELAUAZgVwoLohEgTgBAQE Received: from ppp121-44-19-16.lns20.syd4.internode.on.net (HELO dastard) ([121.44.19.16]) by ipmail06.adl2.internode.on.net with ESMTP; 05 Feb 2016 15:17:32 +1030 Received: from disappointment.disaster.area ([192.168.1.110] helo=disappointment) by dastard with esmtp (Exim 4.80) (envelope-from ) id 1aRYIt-0000vf-NW for xfs@oss.sgi.com; Fri, 05 Feb 2016 15:47:31 +1100 Received: from dave by disappointment with local (Exim 4.86) (envelope-from ) id 1aRYIt-0000Rk-MZ for xfs@oss.sgi.com; Fri, 05 Feb 2016 15:47:31 +1100 From: Dave Chinner To: xfs@oss.sgi.com Subject: [PATCH] quota: report should not take arbitrary parameters Date: Fri, 5 Feb 2016 15:47:31 +1100 X-ASG-Orig-Subj: [PATCH] quota: report should not take arbitrary parameters Message-Id: <1454647651-1677-1-git-send-email-david@fromorbit.com> X-Mailer: git-send-email 2.5.0 X-Barracuda-Connect: ipmail06.adl2.internode.on.net[150.101.137.129] X-Barracuda-Start-Time: 1454647652 X-Barracuda-URL: https://192.48.176.25:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-BRTS-Status: 1 X-Barracuda-Spam-Score: 0.00 X-Barracuda-Spam-Status: No, SCORE=0.00 using per-user scores of TAG_LEVEL=1000.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.7 tests= X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.3.26760 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- From: Dave Chinner The report command is not documented to take any parameters other than what is needed to specify the behaviour. Ever since the initial commit of the report command, usres have been able to specify extra parameters to the report command, which it then tries to parse and use as a path to report quotas on. This is completely undocumented, either in the man pages, the help text or the code, and is completely broken in many, many ways. Just trying to work out how to make it work hurt my brain. e.g: $ xfs_quota -x -c "report -p 1" needs the extra parameter to be treated as a numeric project ID. $ xfs_quota -x -c "report -p scratch" needs the extra parameter to be treated as a project ID alias. $ xfs_quota -x -c "report -p /mnt/scratch" needs the extra parameter to be treated as a mount point. $ xfs_quota -x -c "report -p /mnt/scratch/project-1" needs the extra parameter to be treated as project path. Then I started to get scared - what the hell is an incantation like this supposed to do: $ xfs_quota -x -c "report -ugp 1 foo /mnt/bar /mnt/scratch/project-1" This will be accepted as valid and it will do /something/. Just what is anyone's guess, so I'm thinking it's just dumb luck that an xfs_quota user hasn't accidently summoned an Elder God With An Unspeakable Name and caused the End Of The World As We Know It. So to ensure that us poor XFS developers can retain some shred of their remaining sanity, remove the extra command processing from the report command and return an error message when this happens.. If we need to report on a specific filesystem, then it's defined as part of the main xfs_quota command line and so set up as the primary fs_path that the report command will act on, such as: $ xfs_quota -x -c "report -p" /mnt/scratch If a user needs to get a report on a specific ID, then they can use the upper and lower ID specification to define that. Signed-off-by: Dave Chinner --- quota/report.c | 27 ++++++++++++--------------- 1 file changed, 12 insertions(+), 15 deletions(-) diff --git a/quota/report.c b/quota/report.c index e8e5d96..f660b41 100644 --- a/quota/report.c +++ b/quota/report.c @@ -30,8 +30,6 @@ static cmdinfo_t report_cmd; static void dump_help(void) { - dump_cmd.args = _("[-gpu] [-f file]"); - dump_cmd.oneline = _("dump quota information for backup utilities"); printf(_( "\n" " create a backup file which contains quota limits information\n" @@ -45,8 +43,6 @@ dump_help(void) static void report_help(void) { - report_cmd.args = _("[-bir] [-gpu] [-ahntlLNU] [-f file]"); - report_cmd.oneline = _("report filesystem quota information"); printf(_( "\n" " report used space and inodes, and quota limits, for a filesystem\n" @@ -695,6 +691,11 @@ report_f( } } + if (argc != optind) { + fprintf(stderr, "Error: Invalid arguments on command line!\n"); + return command_usage(&report_cmd); + } + if (!form) form = XFS_BLOCK_QUOTA; @@ -707,17 +708,13 @@ report_f( if ((fp = fopen_write_secure(fname)) == NULL) return 0; - if (argc == optind) { - if (flags & ALL_MOUNTS_FLAG) - report_any_type(fp, form, type, NULL, - lower, upper, flags); - else if (fs_path && (fs_path->fs_flags & FS_MOUNT_POINT)) - report_any_type(fp, form, type, fs_path->fs_dir, - lower, upper, flags); - } else while (argc > optind) { - report_any_type(fp, form, type, argv[optind++], + + if (flags & ALL_MOUNTS_FLAG) + report_any_type(fp, form, type, NULL, + lower, upper, flags); + else if (fs_path && (fs_path->fs_flags & FS_MOUNT_POINT)) + report_any_type(fp, form, type, fs_path->fs_dir, lower, upper, flags); - } if (fname) fclose(fp); @@ -741,7 +738,7 @@ report_init(void) report_cmd.cfunc = report_f; report_cmd.argmin = 0; report_cmd.argmax = -1; - report_cmd.args = _("[-bir] [-gpu] [-ahnt] [-f file]"); + report_cmd.args = _("[-bir] [-gpu] [-ahntlLNU] [-f file]"); report_cmd.oneline = _("report filesystem quota information"); report_cmd.help = report_help; report_cmd.flags = CMD_FLAG_GLOBAL | CMD_FLAG_FOREIGN_OK; -- 2.5.0 From sandeen@sandeen.net Thu Feb 4 23:27:46 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=ham version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay3.corp.sgi.com [198.149.34.15]) by oss.sgi.com (Postfix) with ESMTP id 0DBE07CA2 for ; Thu, 4 Feb 2016 23:27:46 -0600 (CST) Received: from cuda.sgi.com (cuda1.sgi.com [192.48.157.11]) by relay3.corp.sgi.com (Postfix) with ESMTP id AEA47AC001 for ; Thu, 4 Feb 2016 21:27:42 -0800 (PST) X-ASG-Debug-ID: 1454650059-04bdf079c334e60001-NocioJ Received: from sandeen.net (sandeen.net [63.231.237.45]) by cuda.sgi.com with ESMTP id Qe0PC2iTvfsZ7Ov4 for ; Thu, 04 Feb 2016 21:27:40 -0800 (PST) X-Barracuda-Envelope-From: sandeen@sandeen.net X-Barracuda-Apparent-Source-IP: 63.231.237.45 Received: from liberator.sandeen.net (liberator.sandeen.net [10.0.0.4]) (using TLSv1.2 with cipher DHE-RSA-AES128-SHA (128/128 bits)) (No client certificate requested) by sandeen.net (Postfix) with ESMTPSA id A665663C5D8D for ; Thu, 4 Feb 2016 23:27:39 -0600 (CST) Subject: Re: [PATCH 1/2] xfs_quota: allow operation on foreign filesystem types To: xfs@oss.sgi.com X-ASG-Orig-Subj: Re: [PATCH 1/2] xfs_quota: allow operation on foreign filesystem types References: <1454627718-19583-1-git-send-email-david@fromorbit.com> <1454627718-19583-2-git-send-email-david@fromorbit.com> <56B3E6F3.802@sandeen.net> From: Eric Sandeen Message-ID: <56B432CB.5080709@sandeen.net> Date: Thu, 4 Feb 2016 23:27:39 -0600 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.11; rv:38.0) Gecko/20100101 Thunderbird/38.5.1 MIME-Version: 1.0 In-Reply-To: <56B3E6F3.802@sandeen.net> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit X-Barracuda-Connect: sandeen.net[63.231.237.45] X-Barracuda-Start-Time: 1454650059 X-Barracuda-URL: https://192.48.157.11:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-BRTS-Status: 1 X-Barracuda-Spam-Score: 0.00 X-Barracuda-Spam-Status: No, SCORE=0.00 using per-user scores of TAG_LEVEL=1000.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.7 tests= X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.3.26761 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- On 2/4/16 6:04 PM, Eric Sandeen wrote: > Looks ok, but now with the new option: > > 1) needs a manpage update > 2) usage() should be updated to include -f So, I haven't quite worked out what this *is* doing, but on further reflection, it seems like "-f" should definitely relate to behavior which iterates over all filesystems. i.e. without -f, non-xfs filesystems are skipped; with -f, "foreign" filesystems are included. That was my main concern. But if an xfs_quota command is pointed directly at a non-xfs filesystem, I'm not sure what's best. Assume the user intended it, and operate on that fs w/o needing -f? Or require "-f" for consistency? What do you think? And, we can specify multiple mount points to operate on, i.e. xfs_quota -c "foo" /mnt/ext4 /mnt/xfs so ... I guess I don't know if that should require -f or not. principle of least surprise? Keep old behavior of ignoring the non-xfs mount? -Eric From david@fromorbit.com Thu Feb 4 23:41:53 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=ham version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay3.corp.sgi.com [198.149.34.15]) by oss.sgi.com (Postfix) with ESMTP id 862C87CA2 for ; Thu, 4 Feb 2016 23:41:53 -0600 (CST) Received: from cuda.sgi.com (cuda2.sgi.com [192.48.176.25]) by relay3.corp.sgi.com (Postfix) with ESMTP id 28A54AC002 for ; Thu, 4 Feb 2016 21:41:53 -0800 (PST) X-ASG-Debug-ID: 1454650907-04cbb04cfa4d4b0001-NocioJ Received: from ipmail06.adl2.internode.on.net (ipmail06.adl2.internode.on.net [150.101.137.129]) by cuda.sgi.com with ESMTP id ndVbgoQB3cGta47c for ; Thu, 04 Feb 2016 21:41:47 -0800 (PST) X-Barracuda-Envelope-From: david@fromorbit.com X-Barracuda-Apparent-Source-IP: 150.101.137.129 Received: from ppp121-44-19-16.lns20.syd4.internode.on.net (HELO dastard) ([121.44.19.16]) by ipmail06.adl2.internode.on.net with ESMTP; 05 Feb 2016 16:11:01 +1030 Received: from dave by dastard with local (Exim 4.80) (envelope-from ) id 1aRZ8G-0000zn-9F; Fri, 05 Feb 2016 16:40:36 +1100 Date: Fri, 5 Feb 2016 16:40:36 +1100 From: Dave Chinner To: Eric Sandeen Cc: xfs@oss.sgi.com Subject: Re: [PATCH 1/2] xfs_quota: allow operation on foreign filesystem types Message-ID: <20160205054036.GK459@dastard> X-ASG-Orig-Subj: Re: [PATCH 1/2] xfs_quota: allow operation on foreign filesystem types References: <1454627718-19583-1-git-send-email-david@fromorbit.com> <1454627718-19583-2-git-send-email-david@fromorbit.com> <56B3E6F3.802@sandeen.net> <56B432CB.5080709@sandeen.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <56B432CB.5080709@sandeen.net> User-Agent: Mutt/1.5.21 (2010-09-15) X-Barracuda-Connect: ipmail06.adl2.internode.on.net[150.101.137.129] X-Barracuda-Start-Time: 1454650907 X-Barracuda-URL: https://192.48.176.25:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-BRTS-Status: 1 X-Barracuda-Spam-Score: 0.00 X-Barracuda-Spam-Status: No, SCORE=0.00 using per-user scores of TAG_LEVEL=1000.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.7 tests=BSF_SC0_MISMATCH_TO X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.3.26761 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 0.00 BSF_SC0_MISMATCH_TO Envelope rcpt doesn't match header On Thu, Feb 04, 2016 at 11:27:39PM -0600, Eric Sandeen wrote: > > > On 2/4/16 6:04 PM, Eric Sandeen wrote: > > Looks ok, but now with the new option: > > > > 1) needs a manpage update > > 2) usage() should be updated to include -f > > So, I haven't quite worked out what this *is* doing, but on further reflection, > it seems like "-f" should definitely relate to behavior which iterates over > all filesystems. i.e. without -f, non-xfs filesystems are skipped; with -f, > "foreign" filesystems are included. That was my main concern. > > But if an xfs_quota command is pointed directly at a non-xfs filesystem, > I'm not sure what's best. Assume the user intended it, and operate on > that fs w/o needing -f? Or require "-f" for consistency? What do you think? > > And, we can specify multiple mount points to operate on, i.e. > > xfs_quota -c "foo" /mnt/ext4 /mnt/xfs > > so ... I guess I don't know if that should require -f or not. principle of > least surprise? Keep old behavior of ignoring the non-xfs mount? I think we start with requiring "-f", and if people then complain that it's too cumbersome, we remove it and just autodetect. Cheers, Dave. -- Dave Chinner david@fromorbit.com From info1stsetup@gmail.com Fri Feb 5 07:13:07 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=FREEMAIL_FROM,HTML_MESSAGE, T_DKIM_INVALID autolearn=ham version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay3.corp.sgi.com [198.149.34.15]) by oss.sgi.com (Postfix) with ESMTP id 3C6EF7CA2 for ; Fri, 5 Feb 2016 07:13:07 -0600 (CST) Received: from cuda.sgi.com (cuda3.sgi.com [192.48.176.15]) by relay3.corp.sgi.com (Postfix) with ESMTP id A31F9AC001 for ; Fri, 5 Feb 2016 05:13:06 -0800 (PST) X-ASG-Debug-ID: 1454677980-04cb6c27453e050001-NocioJ Received: from mail-yw0-f181.google.com (mail-yw0-f181.google.com [209.85.161.181]) by cuda.sgi.com with ESMTP id irh0vtBU7NJ9RtfA (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128 verify=NO) for ; Fri, 05 Feb 2016 05:13:01 -0800 (PST) X-Barracuda-Envelope-From: info1stsetup@gmail.com X-Barracuda-Apparent-Source-IP: 209.85.161.181 Received: by mail-yw0-f181.google.com with SMTP id g127so50416577ywf.2 for ; Fri, 05 Feb 2016 05:13:01 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:date:message-id:subject:from:to:content-type; bh=t+GSQLrw1WiFlAbxXFYk8bStmyUu3wU5Bacsx1zuBhk=; b=k91J29QnU+D4wLjCSokl3mTPQcjA5AtiXSYbufaktY/rVgzHdbOMSyYskG3tmw/z4K uR1RHeE9SYnR8uqmdP5P4c0Z04uFhqpUzMpmbtuCkXEJHV5yiCDqj/FZOU0dGHFk840A gQGyaxa8aHjQIhodGCmjh5cD8kIDVK+ABK/nOb98sR4zHPsPG2CM35JDcWL6HGT7678r 1vcxniV6KM+nceCsbRNkvGxr1F4urlX7TAbJXFwwieByJcRb9NJIrpz1gT036K9T2O+n 2xS+IT9Yx1utH3UYZkJrDNXjF8muwWYh8D35egwxEJKP3GKe+jD/fj90QrQ9R4+P7DYp 0V3g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:date:message-id:subject:from:to :content-type; bh=t+GSQLrw1WiFlAbxXFYk8bStmyUu3wU5Bacsx1zuBhk=; b=JNCQ5c713rp/jwjt0teLN9AlLgJdajc81el9f2fPcgBob7Sy2OIQtGX+Kh1fQbFb6t 4x9fDiwSdISEGOcO0v+Vpgb2T72EWvLt4E/pR02euMfS8mn8Ti3rtmOfelyeU9RWjZaw db9M2zAGlVdHSryG/PpSCkyneJjCJaTkJ6ebyFbCi+HiY62yPBoIBeGUlEUAOSPml9hd s95/3B3bg6CkdAcO4ox5OkY/j2/lamUqywMZ4fQYg/UgHE5A0aaZSIFMY9+Ajf9eiQgr nCkm9b/oG8Eo8VNYA4lE5YcnojSFabj3luC+pZhjp48Fguk20P2JTrx+9zwEivV4ckJb M+XQ== X-Gm-Message-State: AG10YOQXr+6EpJ8fN6oMwtBpGyj0k1IaM+Bilx3/+zWItLBCRSZhJ+fLUQ8KpVs0RlZJSKLjQ97ZDgRxMRmNog== MIME-Version: 1.0 X-Received: by 10.129.96.134 with SMTP id u128mr6566639ywb.250.1454677980764; Fri, 05 Feb 2016 05:13:00 -0800 (PST) Received: by 10.37.13.145 with HTTP; Fri, 5 Feb 2016 05:13:00 -0800 (PST) Date: Fri, 5 Feb 2016 14:13:00 +0100 Message-ID: Subject: Question about continous blocks for inode due to 'no space left on device' problem From: Michel Verbraak X-ASG-Orig-Subj: Question about continous blocks for inode due to 'no space left on device' problem To: xfs@oss.sgi.com Content-Type: multipart/alternative; boundary=001a114735544e61cc052b059cce X-Barracuda-Connect: mail-yw0-f181.google.com[209.85.161.181] X-Barracuda-Start-Time: 1454677981 X-Barracuda-Encrypted: ECDHE-RSA-AES128-GCM-SHA256 X-Barracuda-URL: https://192.48.176.15:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-BRTS-Status: 1 X-Barracuda-Spam-Score: 0.00 X-Barracuda-Spam-Status: No, SCORE=0.00 using per-user scores of TAG_LEVEL=1000.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.7 tests=DKIM_SIGNED, DKIM_VERIFIED, HTML_MESSAGE X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.3.26768 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- -0.00 DKIM_VERIFIED Domain Keys Identified Mail: signature passes verification 0.00 DKIM_SIGNED Domain Keys Identified Mail: message has a signature 0.00 HTML_MESSAGE BODY: HTML included in message --001a114735544e61cc052b059cce Content-Type: text/plain; charset=UTF-8 All, Recently we ran into a problem where our filesystem (300GB in size) reported 'no space left on device' (ENOSPC) but when we looked at disk space usage and inode usage it was around 52% for disk space and 11% for inode. (sorry do not have a save of the output of df command). Second we looked at the xfs_info and xfs_db -c freesp for each AG. Sadly we do not have a copy anymore of the xfs_info from that time but I do have that of the freesp (at end of this mail). As we did not fully understand the output of the 'xfs_db -c freesp' we simply added another 100GB to the filesystem and our problem was solved for now. The AG count went from 4 to 6. For now we are looking into how can we detect (monitor) this filesystem and see the same problem creeping up to us before it happens. After searching online, reading a lot of mail threads and info pages it looks like we hit the problem of not having any continuous blocks of at least 16k to hold a new inode ( http://oss.sgi.com/pipermail/xfs/2014-September/038301.html). Currently the xfs_info (after adding 100GB) looks like this: meta-data=/dev/sdb isize=256 agcount=6, agsize=19660800 blks = sectsz=512 attr=2 data = bsize=4096 blocks=104857600, imaxpct=25 = sunit=0 swidth=0 blks naming =version 2 bsize=4096 ascii-ci=0 log =internal bsize=4096 blocks=38400, version=2 = sectsz=512 sunit=0 blks, lazy-count=1 realtime =none extsz=4096 blocks=0, rtextents=0 The output of 'xfs_db -c freesp' shows a historgram. We first thought the "from" column shows the minimal number of continous blocks. And as each block is 4K (4096) the row with 'from 4 to 7' contains at least 4 continuous blocks with a minimal size of 4x4k=16k. So our filesystem has enough blocks and extents which are 16k for new inodes, atleast what we think. - So why did we still get the ENOSPC error? - Where can I find a better explanation of the 'xfs_db -c freesp' output? - What is the best way to monitor/detect this problem before it happens. Some extra info about the system and files on the system: - Ubuntu 12.04.5 LTS - Kernel: Linux ealxs00170 3.2.0-97-generic #137-Ubuntu SMP Thu Dec 17 18:11:47 UTC 2015 x86_64 x86_64 x86_64 GNU/Linux - 32 million files of which about 75% is smaller than 1k. Files are separated over different folders to keep the number of files per folder low. - mount options: defaults,noatime,inode64,nobarrier Regards, Michel Verbraak. Store 03 (root@server):~# xfs_db -c freesp /dev/sdb from to extents blocks pct 1 1 3282633 3282633 9.03 2 3 3416223 8372325 23.03 4 7 6175009 24700036 67.94 Store 03 (root@server):~# xfs_db -c "freesp -a 0" /dev/sdb from to extents blocks pct 1 1 813491 813491 8.95 2 3 806828 1953270 21.50 4 7 1579585 6318340 69.55 Store 03 (root@server):~# xfs_db -c "freesp -a 1" /dev/sdb from to extents blocks pct 1 1 835174 835174 9.20 2 3 953626 2381033 26.22 4 7 1465787 5863148 64.58 Store 03 (root@server):~# xfs_db -c "freesp -a 2" /dev/sdb from to extents blocks pct 1 1 819098 819098 9.05 2 3 846158 2074235 22.93 4 7 1538593 6154372 68.02 Store 03 (root@server):~# xfs_db -c "freesp -a 3" /dev/sdb from to extents blocks pct 1 1 814870 814870 8.91 2 3 809611 1963787 21.48 4 7 1591044 6364176 69.61 --001a114735544e61cc052b059cce Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: base64 PGRpdiBkaXI9Imx0ciI+PGRpdj5BbGwsDQo8YnI+DQo8YnI+UmVjZW50bHkgd2UgcmFuIGludG8g YSBwcm9ibGVtIHdoZXJlIG91ciBmaWxlc3lzdGVtICgzMDBHQiBpbiBzaXplKSANCnJlcG9ydGVk ICYjMzk7bm8gc3BhY2UgbGVmdCBvbiBkZXZpY2UmIzM5OyAoRU5PU1BDKSBidXQgd2hlbiB3ZSBs b29rZWQgYXQgZGlzayANCnNwYWNlIHVzYWdlIGFuZCBpbm9kZSB1c2FnZSBpdCB3YXMgYXJvdW5k IDUyJSBmb3IgZGlzayBzcGFjZSBhbmQgMTElIGZvciANCmlub2RlLiAoc29ycnkgZG8gbm90IGhh dmUgYSBzYXZlIG9mIHRoZSBvdXRwdXQgb2YgZGYgY29tbWFuZCkuDQo8YnI+DQo8YnI+U2Vjb25k IHdlIGxvb2tlZCBhdCB0aGUgeGZzX2luZm8gYW5kIHhmc19kYiAtYyBmcmVlc3AgZm9yIGVhY2gg QUcuIFNhZGx5IA0Kd2UgZG8gbm90IGhhdmUgYSBjb3B5IGFueW1vcmUgb2YgdGhlIHhmc19pbmZv IGZyb20gdGhhdCB0aW1lIGJ1dCBJIGRvIA0KaGF2ZSB0aGF0IG9mIHRoZSBmcmVlc3AgKGF0IGVu ZCBvZiB0aGlzIG1haWwpLg0KPGJyPg0KPGJyPkFzIHdlIGRpZCBub3QgZnVsbHkgdW5kZXJzdGFu ZCB0aGUgb3V0cHV0IG9mIHRoZSAmIzM5O3hmc19kYiAtYyBmcmVlc3AmIzM5OyB3ZSANCnNpbXBs eSBhZGRlZCBhbm90aGVyIDEwMEdCIHRvIHRoZSBmaWxlc3lzdGVtIGFuZCBvdXIgcHJvYmxlbSB3 YXMgc29sdmVkIA0KZm9yIG5vdy4gVGhlIEFHIGNvdW50IHdlbnQgZnJvbSA0IHRvIDYuDQo8YnI+ DQo8YnI+Rm9yIG5vdyB3ZSBhcmUgbG9va2luZyBpbnRvIGhvdyBjYW4gd2UgZGV0ZWN0IChtb25p dG9yKSB0aGlzIGZpbGVzeXN0ZW0gDQphbmQgc2VlIHRoZSBzYW1lIHByb2JsZW0gY3JlZXBpbmcg dXAgdG8gdXMgYmVmb3JlIGl0IGhhcHBlbnMuDQo8YnI+QWZ0ZXIgc2VhcmNoaW5nIG9ubGluZSwg cmVhZGluZyBhIGxvdCBvZiBtYWlsIHRocmVhZHMgYW5kIGluZm8gcGFnZXMgaXQgDQpsb29rcyBs aWtlIHdlIGhpdCB0aGUgcHJvYmxlbSBvZiBub3QgaGF2aW5nIGFueSBjb250aW51b3VzIGJsb2Nr cyBvZiBhdCANCmxlYXN0IDE2ayB0byBob2xkIGEgbmV3IGlub2RlIA0KKDxhIGNsYXNzPSIiIGhy ZWY9Imh0dHA6Ly9vc3Muc2dpLmNvbS9waXBlcm1haWwveGZzLzIwMTQtU2VwdGVtYmVyLzAzODMw MS5odG1sIj5odHRwOi8vb3NzLnNnaS5jb20vcGlwZXJtYWlsL3hmcy8yMDE0LVNlcHRlbWJlci8w MzgzMDEuaHRtbDwvYT4pLg0KPGJyPg0KPGJyPkN1cnJlbnRseSB0aGUgeGZzX2luZm8gKGFmdGVy IGFkZGluZyAxMDBHQikgbG9va3MgbGlrZSB0aGlzOg0KPGJyPg0KPGJyPm1ldGEtZGF0YT0vZGV2 L3NkYsKgwqDCoMKgwqDCoMKgwqDCoMKgwqDCoMKgwqAgaXNpemU9MjU2wqDCoMKgIGFnY291bnQ9 NiwgYWdzaXplPTE5NjYwODAwIA0KYmxrcw0KPGJyPsKgwqDCoMKgwqDCoMKgwqAgPcKgwqDCoMKg wqDCoMKgwqDCoMKgwqDCoMKgwqDCoMKgwqDCoMKgwqDCoMKgIHNlY3Rzej01MTLCoMKgIGF0dHI9 Mg0KPGJyPmRhdGHCoMKgwqDCoCA9wqDCoMKgwqDCoMKgwqDCoMKgwqDCoMKgwqDCoMKgwqDCoMKg wqDCoMKgwqAgYnNpemU9NDA5NiBibG9ja3M9MTA0ODU3NjAwLCBpbWF4cGN0PTI1DQo8YnI+wqDC oMKgwqDCoMKgwqDCoCA9wqDCoMKgwqDCoMKgwqDCoMKgwqDCoMKgwqDCoMKgwqDCoMKgwqDCoMKg wqAgc3VuaXQ9MMKgwqDCoMKgwqAgc3dpZHRoPTAgYmxrcw0KPGJyPm5hbWluZ8KgwqAgPXZlcnNp b24gMsKgwqDCoMKgwqDCoMKgwqDCoMKgwqDCoMKgIGJzaXplPTQwOTbCoMKgIGFzY2lpLWNpPTAN Cjxicj5sb2fCoMKgwqDCoMKgID1pbnRlcm5hbMKgwqDCoMKgwqDCoMKgwqDCoMKgwqDCoMKgwqAg YnNpemU9NDA5NsKgwqAgYmxvY2tzPTM4NDAwLCB2ZXJzaW9uPTINCjxicj7CoMKgwqDCoMKgwqDC oMKgID3CoMKgwqDCoMKgwqDCoMKgwqDCoMKgwqDCoMKgwqDCoMKgwqDCoMKgwqDCoCBzZWN0c3o9 NTEywqDCoCBzdW5pdD0wIGJsa3MsIGxhenktY291bnQ9MQ0KPGJyPnJlYWx0aW1lID1ub25lwqDC oMKgwqDCoMKgwqDCoMKgwqDCoMKgwqDCoMKgwqDCoMKgIGV4dHN6PTQwOTbCoMKgIGJsb2Nrcz0w LCBydGV4dGVudHM9MA0KPGJyPg0KPGJyPlRoZSBvdXRwdXQgb2YgJiMzOTt4ZnNfZGIgLWMgZnJl ZXNwJiMzOTsgc2hvd3MgYSBoaXN0b3JncmFtLiBXZSBmaXJzdCB0aG91Z2h0IA0KdGhlICZxdW90 O2Zyb20mcXVvdDsgY29sdW1uIHNob3dzIHRoZSBtaW5pbWFsIG51bWJlciBvZiBjb250aW5vdXMg YmxvY2tzLiBBbmQgYXMgDQplYWNoIGJsb2NrIGlzIDRLICg0MDk2KSB0aGUgcm93IHdpdGggJiMz OTtmcm9tIDQgdG8gNyYjMzk7IGNvbnRhaW5zIGF0IGxlYXN0IDQgDQpjb250aW51b3VzIGJsb2Nr cyB3aXRoIGEgbWluaW1hbCBzaXplIG9mIDR4NGs9MTZrLiBTbyBvdXIgZmlsZXN5c3RlbSBoYXMg DQplbm91Z2ggYmxvY2tzIGFuZCBleHRlbnRzIHdoaWNoIGFyZSAxNmsgZm9yIG5ldyBpbm9kZXMs IGF0bGVhc3Qgd2hhdCB3ZSANCnRoaW5rLg0KPGJyPg0KPGJyPi0gU28gd2h5IGRpZCB3ZSBzdGls bCBnZXQgdGhlIEVOT1NQQyBlcnJvcj8NCjxicj4tIFdoZXJlIGNhbiBJIGZpbmQgYSBiZXR0ZXIg ZXhwbGFuYXRpb24gb2YgdGhlICYjMzk7eGZzX2RiIC1jIGZyZWVzcCYjMzk7IG91dHB1dD8NCjxi cj4tIFdoYXQgaXMgdGhlIGJlc3Qgd2F5IHRvIG1vbml0b3IvZGV0ZWN0IHRoaXMgcHJvYmxlbSBi ZWZvcmUgaXQgaGFwcGVucy4NCjxicj4NCjxicj5Tb21lIGV4dHJhIGluZm8gYWJvdXQgdGhlIHN5 c3RlbSBhbmQgZmlsZXMgb24gdGhlIHN5c3RlbToNCjxicj4tIFVidW50dSAxMi4wNC41IExUUw0K PGJyPi0gS2VybmVsOiBMaW51eCBlYWx4czAwMTcwIDMuMi4wLTk3LWdlbmVyaWMgIzEzNy1VYnVu dHUgU01QIFRodSBEZWMgMTcgDQoxODoxMTo0NyBVVEMgMjAxNSB4ODZfNjQgeDg2XzY0IHg4Nl82 NCBHTlUvTGludXgNCjxicj4tIDMyIG1pbGxpb24gZmlsZXMgb2Ygd2hpY2ggYWJvdXQgNzUlIGlz IHNtYWxsZXIgdGhhbiAxay4gRmlsZXMgYXJlIA0Kc2VwYXJhdGVkIG92ZXIgZGlmZmVyZW50IGZv bGRlcnMgdG8ga2VlcCB0aGUgbnVtYmVyIG9mIGZpbGVzIHBlciBmb2xkZXIgbG93Ljxicj48L2Rp dj4tIG1vdW50IG9wdGlvbnM6IGRlZmF1bHRzLG5vYXRpbWUsaW5vZGU2NCxub2JhcnJpZXIgPGJy PjxkaXY+DQo8YnI+UmVnYXJkcywNCjxicj4NCjxicj5NaWNoZWwgVmVyYnJhYWsuDQo8YnI+DQo8 YnI+U3RvcmUgMDMgKHJvb3RAc2VydmVyKTp+IyB4ZnNfZGIgLWMgZnJlZXNwIC9kZXYvc2RiDQo8 YnI+wqDCoCBmcm9twqDCoMKgwqDCoCB0byBleHRlbnRzwqAgYmxvY2tzwqDCoMKgIHBjdA0KPGJy PsKgwqDCoMKgwqAgMcKgwqDCoMKgwqDCoCAxIDMyODI2MzMgMzI4MjYzM8KgwqAgOS4wMw0KPGJy PsKgwqDCoMKgwqAgMsKgwqDCoMKgwqDCoCAzIDM0MTYyMjMgODM3MjMyNcKgIDIzLjAzDQo8YnI+ wqDCoMKgwqDCoCA0wqDCoMKgwqDCoMKgIDcgNjE3NTAwOSAyNDcwMDAzNsKgIDY3Ljk0DQo8YnI+ DQo8YnI+U3RvcmUgMDMgKHJvb3RAc2VydmVyKTp+IyB4ZnNfZGIgLWMgJnF1b3Q7ZnJlZXNwIC1h IDAmcXVvdDsgL2Rldi9zZGINCjxicj7CoMKgIGZyb23CoMKgwqDCoMKgIHRvIGV4dGVudHPCoCBi bG9ja3PCoMKgwqAgcGN0DQo8YnI+wqDCoMKgwqDCoCAxwqDCoMKgwqDCoMKgIDHCoCA4MTM0OTHC oCA4MTM0OTHCoMKgIDguOTUNCjxicj7CoMKgwqDCoMKgIDLCoMKgwqDCoMKgwqAgM8KgIDgwNjgy OCAxOTUzMjcwwqAgMjEuNTANCjxicj7CoMKgwqDCoMKgIDTCoMKgwqDCoMKgwqAgNyAxNTc5NTg1 IDYzMTgzNDDCoCA2OS41NQ0KPGJyPg0KPGJyPlN0b3JlIDAzIChyb290QHNlcnZlcik6fiMgeGZz X2RiIC1jICZxdW90O2ZyZWVzcCAtYSAxJnF1b3Q7IC9kZXYvc2RiDQo8YnI+wqDCoCBmcm9twqDC oMKgwqDCoCB0byBleHRlbnRzwqAgYmxvY2tzwqDCoMKgIHBjdA0KPGJyPsKgwqDCoMKgwqAgMcKg wqDCoMKgwqDCoCAxwqAgODM1MTc0wqAgODM1MTc0wqDCoCA5LjIwDQo8YnI+wqDCoMKgwqDCoCAy wqDCoMKgwqDCoMKgIDPCoCA5NTM2MjYgMjM4MTAzM8KgIDI2LjIyDQo8YnI+wqDCoMKgwqDCoCA0 wqDCoMKgwqDCoMKgIDcgMTQ2NTc4NyA1ODYzMTQ4wqAgNjQuNTgNCjxicj4NCjxicj5TdG9yZSAw MyAocm9vdEBzZXJ2ZXIpOn4jIHhmc19kYiAtYyAmcXVvdDtmcmVlc3AgLWEgMiZxdW90OyAvZGV2 L3NkYg0KPGJyPsKgwqAgZnJvbcKgwqDCoMKgwqAgdG8gZXh0ZW50c8KgIGJsb2Nrc8KgwqDCoCBw Y3QNCjxicj7CoMKgwqDCoMKgIDHCoMKgwqDCoMKgwqAgMcKgIDgxOTA5OMKgIDgxOTA5OMKgwqAg OS4wNQ0KPGJyPsKgwqDCoMKgwqAgMsKgwqDCoMKgwqDCoCAzwqAgODQ2MTU4IDIwNzQyMzXCoCAy Mi45Mw0KPGJyPsKgwqDCoMKgwqAgNMKgwqDCoMKgwqDCoCA3IDE1Mzg1OTMgNjE1NDM3MsKgIDY4 LjAyDQo8YnI+DQo8YnI+U3RvcmUgMDMgKHJvb3RAc2VydmVyKTp+IyB4ZnNfZGIgLWMgJnF1b3Q7 ZnJlZXNwIC1hIDMmcXVvdDsgL2Rldi9zZGINCjxicj7CoMKgIGZyb23CoMKgwqDCoMKgIHRvIGV4 dGVudHPCoCBibG9ja3PCoMKgwqAgcGN0DQo8YnI+wqDCoMKgwqDCoCAxwqDCoMKgwqDCoMKgIDHC oCA4MTQ4NzDCoCA4MTQ4NzDCoMKgIDguOTENCjxicj7CoMKgwqDCoMKgIDLCoMKgwqDCoMKgwqAg M8KgIDgwOTYxMSAxOTYzNzg3wqAgMjEuNDgNCjxicj7CoMKgwqDCoMKgIDTCoMKgwqDCoMKgwqAg NyAxNTkxMDQ0IDYzNjQxNzbCoCA2OS42MQ0KPGJyPg0KPC9kaXY+PC9kaXY+DQo= --001a114735544e61cc052b059cce-- From bfoster@redhat.com Fri Feb 5 08:20:55 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=ham version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay3.corp.sgi.com [198.149.34.15]) by oss.sgi.com (Postfix) with ESMTP id 4F1A77CA2 for ; Fri, 5 Feb 2016 08:20:55 -0600 (CST) Received: from cuda.sgi.com (cuda3.sgi.com [192.48.176.15]) by relay3.corp.sgi.com (Postfix) with ESMTP id C8DE1AC002 for ; Fri, 5 Feb 2016 06:20:51 -0800 (PST) X-ASG-Debug-ID: 1454682050-04cb6c27443f810001-NocioJ Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by cuda.sgi.com with ESMTP id 2DdiWrNWCHGMxYBl (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO) for ; Fri, 05 Feb 2016 06:20:50 -0800 (PST) X-Barracuda-Envelope-From: bfoster@redhat.com X-Barracuda-Apparent-Source-IP: 209.132.183.28 X-ASG-Whitelist: Client Received: from int-mx09.intmail.prod.int.phx2.redhat.com (int-mx09.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by mx1.redhat.com (Postfix) with ESMTPS id EF84E368E3; Fri, 5 Feb 2016 14:20:49 +0000 (UTC) Received: from bfoster.bfoster (dhcp-41-164.bos.redhat.com [10.18.41.164]) by int-mx09.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id u15EKnWY023727; Fri, 5 Feb 2016 09:20:49 -0500 Received: by bfoster.bfoster (Postfix, from userid 1000) id A0FB4123DF8; Fri, 5 Feb 2016 09:20:48 -0500 (EST) Date: Fri, 5 Feb 2016 09:20:48 -0500 From: Brian Foster To: Dave Chinner Cc: xfs@oss.sgi.com Subject: Re: [PATCH 2/3] metadump: bounds check btree block regions being zeroed Message-ID: <20160205142047.GA52478@bfoster.bfoster> X-ASG-Orig-Subj: Re: [PATCH 2/3] metadump: bounds check btree block regions being zeroed References: <1454626858-17823-1-git-send-email-david@fromorbit.com> <1454626858-17823-3-git-send-email-david@fromorbit.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1454626858-17823-3-git-send-email-david@fromorbit.com> User-Agent: Mutt/1.5.24 (2015-08-30) X-Scanned-By: MIMEDefang 2.68 on 10.5.11.22 X-Barracuda-Connect: mx1.redhat.com[209.132.183.28] X-Barracuda-Start-Time: 1454682050 X-Barracuda-Encrypted: ECDHE-RSA-AES256-GCM-SHA384 X-Barracuda-URL: https://192.48.176.15:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-BRTS-Status: 1 On Fri, Feb 05, 2016 at 10:00:57AM +1100, Dave Chinner wrote: > From: Dave Chinner > > Arkadiusz Miskiewicz reported that metadump was crashing on one of > his corrupted filesystems, and the trace indicated that it was > zeroing unused regions in inode btree blocks when it failed. The > btree block had a corrupt nrecs field, which was resulting in an out > of bounds memset() occurring. Ensure that the region being > generated for zeroing is within bounds before executing the zeroing. > > Reported-by: Arkadiusz Miskiewicz > Signed-off-by: Dave Chinner > --- Reviewed-by: Brian Foster > db/metadump.c | 32 ++++++++++++++++++++++++++++++++ > 1 file changed, 32 insertions(+) > > diff --git a/db/metadump.c b/db/metadump.c > index a185da5..26a3bd5 100644 > --- a/db/metadump.c > +++ b/db/metadump.c > @@ -246,6 +246,11 @@ write_buf( > return seenint() ? -EINTR : 0; > } > > +/* > + * We could be processing a corrupt block, so we can't trust any of > + * the offsets or lengths to be within the buffer range. Hence check > + * carefully! > + */ > static void > zero_btree_node( > struct xfs_btree_block *block, > @@ -262,10 +267,15 @@ zero_btree_node( > char *key_end; > > nrecs = be16_to_cpu(block->bb_numrecs); > + if (nrecs < 0) > + return; > > switch (btype) { > case TYP_BMAPBTA: > case TYP_BMAPBTD: > + if (nrecs > mp->m_bmap_dmxr[1]) > + return; > + > bkp = XFS_BMBT_KEY_ADDR(mp, block, 1); > bpp = XFS_BMBT_PTR_ADDR(mp, block, 1, mp->m_bmap_dmxr[1]); > zp1 = (char *)&bkp[nrecs]; > @@ -274,6 +284,9 @@ zero_btree_node( > break; > case TYP_INOBT: > case TYP_FINOBT: > + if (nrecs > mp->m_inobt_mxr[1]) > + return; > + > ikp = XFS_INOBT_KEY_ADDR(mp, block, 1); > ipp = XFS_INOBT_PTR_ADDR(mp, block, 1, mp->m_inobt_mxr[1]); > zp1 = (char *)&ikp[nrecs]; > @@ -282,6 +295,9 @@ zero_btree_node( > break; > case TYP_BNOBT: > case TYP_CNTBT: > + if (nrecs > mp->m_alloc_mxr[1]) > + return; > + > akp = XFS_ALLOC_KEY_ADDR(mp, block, 1); > app = XFS_ALLOC_PTR_ADDR(mp, block, 1, mp->m_alloc_mxr[1]); > zp1 = (char *)&akp[nrecs]; > @@ -300,6 +316,11 @@ zero_btree_node( > memset(zp2, 0, (char *)block + mp->m_sb.sb_blocksize - zp2); > } > > +/* > + * We could be processing a corrupt block, so we can't trust any of > + * the offsets or lengths to be within the buffer range. Hence check > + * carefully! > + */ > static void > zero_btree_leaf( > struct xfs_btree_block *block, > @@ -312,20 +333,31 @@ zero_btree_leaf( > char *zp; > > nrecs = be16_to_cpu(block->bb_numrecs); > + if (nrecs < 0) > + return; > > switch (btype) { > case TYP_BMAPBTA: > case TYP_BMAPBTD: > + if (nrecs > mp->m_bmap_dmxr[0]) > + return; > + > brp = XFS_BMBT_REC_ADDR(mp, block, 1); > zp = (char *)&brp[nrecs]; > break; > case TYP_INOBT: > case TYP_FINOBT: > + if (nrecs > mp->m_inobt_mxr[0]) > + return; > + > irp = XFS_INOBT_REC_ADDR(mp, block, 1); > zp = (char *)&irp[nrecs]; > break; > case TYP_BNOBT: > case TYP_CNTBT: > + if (nrecs > mp->m_alloc_mxr[0]) > + return; > + > arp = XFS_ALLOC_REC_ADDR(mp, block, 1); > zp = (char *)&arp[nrecs]; > break; > -- > 2.5.0 > > _______________________________________________ > xfs mailing list > xfs@oss.sgi.com > http://oss.sgi.com/mailman/listinfo/xfs From bfoster@redhat.com Fri Feb 5 08:21:00 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=ham version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay3.corp.sgi.com [198.149.34.15]) by oss.sgi.com (Postfix) with ESMTP id 7A2567CA6 for ; Fri, 5 Feb 2016 08:21:00 -0600 (CST) Received: from cuda.sgi.com (cuda1.sgi.com [192.48.157.11]) by relay3.corp.sgi.com (Postfix) with ESMTP id 1CDAFAC004 for ; Fri, 5 Feb 2016 06:20:59 -0800 (PST) X-ASG-Debug-ID: 1454682058-04bdf079c5449a0001-NocioJ Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by cuda.sgi.com with ESMTP id TsrPdZtJo340k7VT (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO) for ; Fri, 05 Feb 2016 06:20:58 -0800 (PST) X-Barracuda-Envelope-From: bfoster@redhat.com X-Barracuda-Apparent-Source-IP: 209.132.183.28 X-ASG-Whitelist: Client Received: from int-mx13.intmail.prod.int.phx2.redhat.com (int-mx13.intmail.prod.int.phx2.redhat.com [10.5.11.26]) by mx1.redhat.com (Postfix) with ESMTPS id 76FB76113; Fri, 5 Feb 2016 14:20:58 +0000 (UTC) Received: from bfoster.bfoster (dhcp-41-164.bos.redhat.com [10.18.41.164]) by int-mx13.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id u15EKwpl028474; Fri, 5 Feb 2016 09:20:58 -0500 Received: by bfoster.bfoster (Postfix, from userid 1000) id 31579123DF8; Fri, 5 Feb 2016 09:20:57 -0500 (EST) Date: Fri, 5 Feb 2016 09:20:57 -0500 From: Brian Foster To: Dave Chinner Cc: xfs@oss.sgi.com Subject: Re: [PATCH 3/7] libxfs: directory node splitting does not have an extra block Message-ID: <20160205142056.GB52478@bfoster.bfoster> X-ASG-Orig-Subj: Re: [PATCH 3/7] libxfs: directory node splitting does not have an extra block References: <1454627108-19036-1-git-send-email-david@fromorbit.com> <1454627108-19036-4-git-send-email-david@fromorbit.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1454627108-19036-4-git-send-email-david@fromorbit.com> User-Agent: Mutt/1.5.24 (2015-08-30) X-Scanned-By: MIMEDefang 2.68 on 10.5.11.26 X-Barracuda-Connect: mx1.redhat.com[209.132.183.28] X-Barracuda-Start-Time: 1454682058 X-Barracuda-Encrypted: ECDHE-RSA-AES256-GCM-SHA384 X-Barracuda-URL: https://192.48.157.11:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-BRTS-Status: 1 On Fri, Feb 05, 2016 at 10:05:04AM +1100, Dave Chinner wrote: > From: Dave Chinner > > xfs_da3_split() has to handle all three versions of the > directory/attribute btree structure. The attr tree is v1, the dir > tre is v2 or v3. The main difference between the v1 and v2/3 trees > is the way tree nodes are split - in the v1 tree we can require a > double split to occur because the object to be inserted may be > larger than the space made by splitting a leaf. In this case we need > to do a double split - one to split the full leaf, then another to > allocate an empty leaf block in the correct location for the new > entry. This does not happen with dir (v2/v3) formats as the objects > being inserted are always guaranteed to fit into the new space in > the split blocks. > > Indeed, for directories they *may* be an extra block on this buffer > pointer. However, it's guaranteed not to be a leaf block (i.e. a > directory data block) - the directory code only ever places hash > index or free space blocks in this pointer (as a cursor of > sorts), and so to use it as a directory data block will immediately > corrupt the directory. > > The problem is that the code assumes that there may be extra blocks > that we need to link into the tree once we've split the root, but > this is not true for either dir or attr trees, because the extra > attr block is always consumed by the last node split before we split > the root. Hence the linking in an extra block is always wrong at the > root split level, and this manifests itself in repair as a directory > corruption in a repaired directory, leaving the directory rebuild > incomplete. > > This is a dir v2 zero-day bug - it was in the initial dir v2 commit > that was made back in February 1998. > > Fix this by ensuring the linking of the blocks after the root split > never tries to make use of the extra blocks that may be held in the > cursor. They are held there for other purposes and should never be > touched by the root splitting code. > > Signed-off-by: Dave Chinner > --- Reviewed-by: Brian Foster > libxfs/xfs_da_btree.c | 59 +++++++++++++++++++++++++-------------------------- > 1 file changed, 29 insertions(+), 30 deletions(-) > > diff --git a/libxfs/xfs_da_btree.c b/libxfs/xfs_da_btree.c > index bf5fe21..25072c7 100644 > --- a/libxfs/xfs_da_btree.c > +++ b/libxfs/xfs_da_btree.c > @@ -351,7 +351,6 @@ xfs_da3_split( > struct xfs_da_state_blk *newblk; > struct xfs_da_state_blk *addblk; > struct xfs_da_intnode *node; > - struct xfs_buf *bp; > int max; > int action = 0; > int error; > @@ -392,7 +391,9 @@ xfs_da3_split( > break; > } > /* > - * Entry wouldn't fit, split the leaf again. > + * Entry wouldn't fit, split the leaf again. The new > + * extrablk will be consumed by xfs_da3_node_split if > + * the node is split. > */ > state->extravalid = 1; > if (state->inleaf) { > @@ -441,6 +442,14 @@ xfs_da3_split( > return 0; > > /* > + * xfs_da3_node_split() should have consumed any extra blocks we added > + * during a double leaf split in the attr fork. This is guaranteed as > + * we can't be here if the attr fork only has a single leaf block. > + */ > + ASSERT(state->extravalid == 0 || > + state->path.blk[max].magic == XFS_DIR2_LEAFN_MAGIC); > + > + /* > * Split the root node. > */ > ASSERT(state->path.active == 0); > @@ -452,43 +461,33 @@ xfs_da3_split( > } > > /* > - * Update pointers to the node which used to be block 0 and > - * just got bumped because of the addition of a new root node. > - * There might be three blocks involved if a double split occurred, > - * and the original block 0 could be at any position in the list. > + * Update pointers to the node which used to be block 0 and just got > + * bumped because of the addition of a new root node. Note that the > + * original block 0 could be at any position in the list of blocks in > + * the tree. > * > - * Note: the magic numbers and sibling pointers are in the same > - * physical place for both v2 and v3 headers (by design). Hence it > - * doesn't matter which version of the xfs_da_intnode structure we use > - * here as the result will be the same using either structure. > + * Note: the magic numbers and sibling pointers are in the same physical > + * place for both v2 and v3 headers (by design). Hence it doesn't matter > + * which version of the xfs_da_intnode structure we use here as the > + * result will be the same using either structure. > */ > node = oldblk->bp->b_addr; > if (node->hdr.info.forw) { > - if (be32_to_cpu(node->hdr.info.forw) == addblk->blkno) { > - bp = addblk->bp; > - } else { > - ASSERT(state->extravalid); > - bp = state->extrablk.bp; > - } > - node = bp->b_addr; > + ASSERT(be32_to_cpu(node->hdr.info.forw) == addblk->blkno); > + node = addblk->bp->b_addr; > node->hdr.info.back = cpu_to_be32(oldblk->blkno); > - xfs_trans_log_buf(state->args->trans, bp, > - XFS_DA_LOGRANGE(node, &node->hdr.info, > - sizeof(node->hdr.info))); > + xfs_trans_log_buf(state->args->trans, addblk->bp, > + XFS_DA_LOGRANGE(node, &node->hdr.info, > + sizeof(node->hdr.info))); > } > node = oldblk->bp->b_addr; > if (node->hdr.info.back) { > - if (be32_to_cpu(node->hdr.info.back) == addblk->blkno) { > - bp = addblk->bp; > - } else { > - ASSERT(state->extravalid); > - bp = state->extrablk.bp; > - } > - node = bp->b_addr; > + ASSERT(be32_to_cpu(node->hdr.info.back) == addblk->blkno); > + node = addblk->bp->b_addr; > node->hdr.info.forw = cpu_to_be32(oldblk->blkno); > - xfs_trans_log_buf(state->args->trans, bp, > - XFS_DA_LOGRANGE(node, &node->hdr.info, > - sizeof(node->hdr.info))); > + xfs_trans_log_buf(state->args->trans, addblk->bp, > + XFS_DA_LOGRANGE(node, &node->hdr.info, > + sizeof(node->hdr.info))); > } > addblk->bp = NULL; > return 0; > -- > 2.5.0 > > _______________________________________________ > xfs mailing list > xfs@oss.sgi.com > http://oss.sgi.com/mailman/listinfo/xfs From bfoster@redhat.com Fri Feb 5 08:22:27 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=ham version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay1.corp.sgi.com [137.38.102.111]) by oss.sgi.com (Postfix) with ESMTP id 248537CA2 for ; Fri, 5 Feb 2016 08:22:27 -0600 (CST) Received: from cuda.sgi.com (cuda3.sgi.com [192.48.176.15]) by relay1.corp.sgi.com (Postfix) with ESMTP id 045CA8F8049 for ; Fri, 5 Feb 2016 06:22:23 -0800 (PST) X-ASG-Debug-ID: 1454682142-04cb6c27443f890001-NocioJ Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by cuda.sgi.com with ESMTP id xtnSLhhuAQVuR6U0 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO) for ; Fri, 05 Feb 2016 06:22:22 -0800 (PST) X-Barracuda-Envelope-From: bfoster@redhat.com X-Barracuda-Apparent-Source-IP: 209.132.183.28 X-ASG-Whitelist: Client Received: from int-mx11.intmail.prod.int.phx2.redhat.com (int-mx11.intmail.prod.int.phx2.redhat.com [10.5.11.24]) by mx1.redhat.com (Postfix) with ESMTPS id 4C139C07582F; Fri, 5 Feb 2016 14:22:22 +0000 (UTC) Received: from bfoster.bfoster (dhcp-41-164.bos.redhat.com [10.18.41.164]) by int-mx11.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id u15EML9T004698; Fri, 5 Feb 2016 09:22:22 -0500 Received: by bfoster.bfoster (Postfix, from userid 1000) id EBF94123DF8; Fri, 5 Feb 2016 09:22:20 -0500 (EST) Date: Fri, 5 Feb 2016 09:22:20 -0500 From: Brian Foster To: Dave Chinner Cc: xfs@oss.sgi.com Subject: Re: [PATCH 6/7] libxfs: keep unflushable buffers off the cache MRUs Message-ID: <20160205142220.GC52478@bfoster.bfoster> X-ASG-Orig-Subj: Re: [PATCH 6/7] libxfs: keep unflushable buffers off the cache MRUs References: <1454627108-19036-1-git-send-email-david@fromorbit.com> <1454627108-19036-7-git-send-email-david@fromorbit.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1454627108-19036-7-git-send-email-david@fromorbit.com> User-Agent: Mutt/1.5.24 (2015-08-30) X-Scanned-By: MIMEDefang 2.68 on 10.5.11.24 X-Barracuda-Connect: mx1.redhat.com[209.132.183.28] X-Barracuda-Start-Time: 1454682142 X-Barracuda-Encrypted: ECDHE-RSA-AES256-GCM-SHA384 X-Barracuda-URL: https://192.48.176.15:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-BRTS-Status: 1 On Fri, Feb 05, 2016 at 10:05:07AM +1100, Dave Chinner wrote: > From: Dave Chinner > > There's no point trying to free buffers that are dirty and return > errors on flush as we have to keep them around until the corruption > is fixed. Hence if we fail to flush an inode during a cache shake, > move the buffer to a special dirty MRU list that the cache does not > shake. This prevents memory pressure from seeing these buffers, but > allows subsequent cache lookups to still find them through the hash. > This ensures we don't waste huge amounts of CPU trying to flush and > reclaim buffers that canot be flushed or reclaimed. > > Signed-off-by: Dave Chinner > --- > include/cache.h | 3 ++- > libxfs/cache.c | 78 ++++++++++++++++++++++++++++++++++++++++++--------------- > 2 files changed, 60 insertions(+), 21 deletions(-) > ... > diff --git a/libxfs/cache.c b/libxfs/cache.c > index a48ebd9..d4b4a4e 100644 > --- a/libxfs/cache.c > +++ b/libxfs/cache.c ... > @@ -183,15 +183,45 @@ cache_generic_bulkrelse( > } > ... > +/* > + * We've hit the limit on cache size, so we need to start reclaiming nodes we've > + * used. The MRU specified by the priority is shaken. Returns new priority at > + * end of the call (in case we call again). We are not allowed to reclaim dirty > + * objects, so we have to flush them first. If flushing fails, we move them to > + * the "dirty, unreclaimable" list. > + * > + * Hence we skip priorities > CACHE_MAX_PRIORITY unless "purge" is set as we > + * park unflushable (and hence unreclaimable) buffers at these priorities. > + * Trying to shake unreclaimable buffer lists whent here is memory pressure is a typo ^ > + * waste of time and CPU and greatly slows down cache node recycling operations. > + * Hence we only try to free them if we are being asked to purge the cache of > + * all entries. > */ > static unsigned int > cache_shake( > struct cache * cache, > unsigned int priority, > - int all) > + bool purge) > { > struct cache_mru *mru; > struct cache_hash * hash; > @@ -202,10 +232,11 @@ cache_shake( > struct cache_node * node; > unsigned int count; > > - ASSERT(priority <= CACHE_MAX_PRIORITY); > - if (priority > CACHE_MAX_PRIORITY) > + ASSERT(priority <= CACHE_DIRTY_PRIORITY); > + if (priority > CACHE_MAX_PRIORITY && !purge) > priority = 0; > > + ... and still an extra newline here. Otherwise looks good: Reviewed-by: Brian Foster > mru = &cache->c_mrus[priority]; > count = 0; > list_head_init(&temp); > @@ -219,8 +250,10 @@ cache_shake( > if (pthread_mutex_trylock(&node->cn_mutex) != 0) > continue; > > - /* can't release dirty objects */ > - if (cache->flush(node)) { > + /* memory pressure is not allowed to release dirty objects */ > + if (cache->flush(node) && !purge) { > + cache_move_to_dirty_mru(cache, node); > + mru->cm_count--; > pthread_mutex_unlock(&node->cn_mutex); > continue; > } > @@ -242,7 +275,7 @@ cache_shake( > pthread_mutex_unlock(&node->cn_mutex); > > count++; > - if (!all && count == CACHE_SHAKE_COUNT) > + if (!purge && count == CACHE_SHAKE_COUNT) > break; > } > pthread_mutex_unlock(&mru->cm_mutex); > @@ -423,7 +456,7 @@ next_object: > node = cache_node_allocate(cache, key); > if (node) > break; > - priority = cache_shake(cache, priority, 0); > + priority = cache_shake(cache, priority, false); > /* > * We start at 0; if we free CACHE_SHAKE_COUNT we get > * back the same priority, if not we get back priority+1. > @@ -578,8 +611,8 @@ cache_purge( > { > int i; > > - for (i = 0; i <= CACHE_MAX_PRIORITY; i++) > - cache_shake(cache, i, 1); > + for (i = 0; i <= CACHE_DIRTY_PRIORITY; i++) > + cache_shake(cache, i, true); > > #ifdef CACHE_DEBUG > if (cache->c_count != 0) { > @@ -626,13 +659,13 @@ cache_flush( > #define HASH_REPORT (3 * HASH_CACHE_RATIO) > void > cache_report( > - FILE *fp, > - const char *name, > - struct cache *cache) > + FILE *fp, > + const char *name, > + struct cache *cache) > { > - int i; > - unsigned long count, index, total; > - unsigned long hash_bucket_lengths[HASH_REPORT + 2]; > + int i; > + unsigned long count, index, total; > + unsigned long hash_bucket_lengths[HASH_REPORT + 2]; > > if ((cache->c_hits + cache->c_misses) == 0) > return; > @@ -662,6 +695,11 @@ cache_report( > i, cache->c_mrus[i].cm_count, > cache->c_mrus[i].cm_count * 100 / cache->c_count); > > + i = CACHE_DIRTY_PRIORITY; > + fprintf(fp, "Dirty MRU %d entries = %6u (%3u%%)\n", > + i, cache->c_mrus[i].cm_count, > + cache->c_mrus[i].cm_count * 100 / cache->c_count); > + > /* report hash bucket lengths */ > bzero(hash_bucket_lengths, sizeof(hash_bucket_lengths)); > > -- > 2.5.0 > > _______________________________________________ > xfs mailing list > xfs@oss.sgi.com > http://oss.sgi.com/mailman/listinfo/xfs From bfoster@redhat.com Fri Feb 5 08:23:19 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=ham version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay3.corp.sgi.com [198.149.34.15]) by oss.sgi.com (Postfix) with ESMTP id 7BB1B7CA2 for ; Fri, 5 Feb 2016 08:23:19 -0600 (CST) Received: from cuda.sgi.com (cuda1.sgi.com [192.48.157.11]) by relay3.corp.sgi.com (Postfix) with ESMTP id 1A4CAAC002 for ; Fri, 5 Feb 2016 06:23:18 -0800 (PST) X-ASG-Debug-ID: 1454682197-04bdf079c544a60001-NocioJ Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by cuda.sgi.com with ESMTP id 8IbxJa8NchogQtEd (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO) for ; Fri, 05 Feb 2016 06:23:18 -0800 (PST) X-Barracuda-Envelope-From: bfoster@redhat.com X-Barracuda-Apparent-Source-IP: 209.132.183.28 X-ASG-Whitelist: Client Received: from int-mx14.intmail.prod.int.phx2.redhat.com (int-mx14.intmail.prod.int.phx2.redhat.com [10.5.11.27]) by mx1.redhat.com (Postfix) with ESMTPS id AEE4B35010D; Fri, 5 Feb 2016 14:23:17 +0000 (UTC) Received: from bfoster.bfoster (dhcp-41-164.bos.redhat.com [10.18.41.164]) by int-mx14.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id u15ENHrd023745; Fri, 5 Feb 2016 09:23:17 -0500 Received: by bfoster.bfoster (Postfix, from userid 1000) id 7DE6E123DF8; Fri, 5 Feb 2016 09:23:16 -0500 (EST) Date: Fri, 5 Feb 2016 09:23:16 -0500 From: Brian Foster To: Dave Chinner Cc: xfs@oss.sgi.com Subject: Re: [PATCH 7/7] libxfs: reset dirty buffer priority on lookup Message-ID: <20160205142315.GD52478@bfoster.bfoster> X-ASG-Orig-Subj: Re: [PATCH 7/7] libxfs: reset dirty buffer priority on lookup References: <1454627108-19036-1-git-send-email-david@fromorbit.com> <1454627108-19036-8-git-send-email-david@fromorbit.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1454627108-19036-8-git-send-email-david@fromorbit.com> User-Agent: Mutt/1.5.24 (2015-08-30) X-Scanned-By: MIMEDefang 2.68 on 10.5.11.27 X-Barracuda-Connect: mx1.redhat.com[209.132.183.28] X-Barracuda-Start-Time: 1454682197 X-Barracuda-Encrypted: ECDHE-RSA-AES256-GCM-SHA384 X-Barracuda-URL: https://192.48.157.11:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-BRTS-Status: 1 On Fri, Feb 05, 2016 at 10:05:08AM +1100, Dave Chinner wrote: > From: Dave Chinner > > When a buffer on the dirty MRU is looked up and found, we remove the > buffer from the MRU. However, we've already set the priority ofthe of the > buffer to "dirty" so when we are donw with it it will go back on the done > dirty buffer MRU regardless of whether it needs to or not. > > Hence when we move a buffer to a the dirty MRU, reocrd the old record > priority and restore it when we remove the buffer from the MRU on > lookup. This will prevent us from putting fixed, now writeable > buffers back on the dirty MRU and allow the cache routine to write, > shake and reclaim the buffers once they are clean. > > Signed-off-by: Dave Chinner > --- > include/cache.h | 1 + > libxfs/cache.c | 7 +++++++ > 2 files changed, 8 insertions(+) > ... > diff --git a/libxfs/cache.c b/libxfs/cache.c > index d4b4a4e..0398be3 100644 > --- a/libxfs/cache.c > +++ b/libxfs/cache.c ... > @@ -434,6 +436,10 @@ cache_node_get( > mru->cm_count--; > list_del_init(&node->cn_mru); > pthread_mutex_unlock(&mru->cm_mutex); > + if (node->cn_old_priority != -1) { Might be good to ASSERT(node->cn_priority == CACHE_DIRTY_PRIORITY) here. Otherwise looks good: Reviewed-by: Brian Foster > + node->cn_priority = node->cn_old_priority; > + node->cn_old_priority = -1; > + } > } > node->cn_count++; > > @@ -534,6 +540,7 @@ cache_node_set_priority( > pthread_mutex_lock(&node->cn_mutex); > ASSERT(node->cn_count > 0); > node->cn_priority = priority; > + node->cn_old_priority = -1; > pthread_mutex_unlock(&node->cn_mutex); > } > > -- > 2.5.0 > > _______________________________________________ > xfs mailing list > xfs@oss.sgi.com > http://oss.sgi.com/mailman/listinfo/xfs From darrick.wong@oracle.com Fri Feb 5 15:57:36 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay3.corp.sgi.com [198.149.34.15]) by oss.sgi.com (Postfix) with ESMTP id DD4AF7CA2 for ; Fri, 5 Feb 2016 15:57:35 -0600 (CST) Received: from cuda.sgi.com (cuda3.sgi.com [192.48.176.15]) by relay3.corp.sgi.com (Postfix) with ESMTP id 4DA7FAC001 for ; Fri, 5 Feb 2016 13:57:32 -0800 (PST) X-ASG-Debug-ID: 1454709443-04cb6c274559380001-NocioJ Received: from aserp1040.oracle.com (aserp1040.oracle.com [141.146.126.69]) by cuda.sgi.com with ESMTP id 0uhsODvDOSOHp3te (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO) for ; Fri, 05 Feb 2016 13:57:24 -0800 (PST) X-Barracuda-Envelope-From: darrick.wong@oracle.com X-Barracuda-Apparent-Source-IP: 141.146.126.69 Received: from aserv0021.oracle.com (aserv0021.oracle.com [141.146.126.233]) by aserp1040.oracle.com (Sentrion-MTA-4.3.2/Sentrion-MTA-4.3.2) with ESMTP id u15LvLro025399 (version=TLSv1 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Fri, 5 Feb 2016 21:57:21 GMT Received: from aserv0121.oracle.com (aserv0121.oracle.com [141.146.126.235]) by aserv0021.oracle.com (8.13.8/8.13.8) with ESMTP id u15LvKlr002473 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=FAIL); Fri, 5 Feb 2016 21:57:20 GMT Received: from abhmp0014.oracle.com (abhmp0014.oracle.com [141.146.116.20]) by aserv0121.oracle.com (8.13.8/8.13.8) with ESMTP id u15LvKqg013187; Fri, 5 Feb 2016 21:57:20 GMT Received: from localhost (/24.21.154.84) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Fri, 05 Feb 2016 13:57:19 -0800 Date: Fri, 5 Feb 2016 13:57:18 -0800 From: "Darrick J. Wong" To: Christoph Hellwig Cc: linux-fsdevel@vger.kernel.org, xfs@oss.sgi.com, linux-ext4@vger.kernel.org, ocfs2-devel@oss.oracle.com Subject: Re: [PATCH 2/3] xfs: don't use ioends for direct write completions Message-ID: <20160205215718.GM20038@birch.djwong.org> X-ASG-Orig-Subj: Re: [PATCH 2/3] xfs: don't use ioends for direct write completions References: <1454524816-11392-1-git-send-email-hch@lst.de> <1454524816-11392-3-git-send-email-hch@lst.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1454524816-11392-3-git-send-email-hch@lst.de> User-Agent: Mutt/1.5.21 (2010-09-15) X-Source-IP: aserv0021.oracle.com [141.146.126.233] X-Barracuda-Connect: aserp1040.oracle.com[141.146.126.69] X-Barracuda-Start-Time: 1454709444 X-Barracuda-Encrypted: ECDHE-RSA-AES256-GCM-SHA384 X-Barracuda-URL: https://192.48.176.15:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-BRTS-Status: 1 X-Barracuda-Spam-Score: 0.00 X-Barracuda-Spam-Status: No, SCORE=0.00 using per-user scores of TAG_LEVEL=1000.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.7 tests=BSF_SC0_MISMATCH_TO, UNPARSEABLE_RELAY X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.3.26781 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 0.00 BSF_SC0_MISMATCH_TO Envelope rcpt doesn't match header 0.00 UNPARSEABLE_RELAY Informational: message has unparseable relay lines On Wed, Feb 03, 2016 at 07:40:15PM +0100, Christoph Hellwig wrote: > We only need to communicate two bits of information to the direct I/O > completion handler: > > (1) do we need to convert any unwritten extents in the range > (2) do we need to check if we need to update the inode size based > on the range passed to the completion handler > > We can use the private data passed to the get_block handler and the > completion handler as a simple bitmask to communicate this information > instead of the current complicated infrastructure reusing the ioends > from the buffer I/O path, and thus avoiding a memory allocation and > a context switch for any non-trivial direct write. As a nice side > effect we also decouple the direct I/O path implementation from that > of the buffered I/O path. > > Signed-off-by: Christoph Hellwig > Reviewed-by: Brian Foster > --- > fs/xfs/xfs_aops.c | 216 ++++++++++++++++++----------------------------------- > fs/xfs/xfs_trace.h | 9 +-- > 2 files changed, 75 insertions(+), 150 deletions(-) > > diff --git a/fs/xfs/xfs_aops.c b/fs/xfs/xfs_aops.c > index 295aaff..f008a4f 100644 > --- a/fs/xfs/xfs_aops.c > +++ b/fs/xfs/xfs_aops.c > @@ -36,6 +36,10 @@ > #include > #include > > +/* flags for direct write completions */ > +#define XFS_DIO_FLAG_UNWRITTEN (1 << 0) > +#define XFS_DIO_FLAG_APPEND (1 << 1) > + > void > xfs_count_page_state( > struct page *page, > @@ -1238,27 +1242,8 @@ xfs_vm_releasepage( > } > > /* > - * When we map a DIO buffer, we may need to attach an ioend that describes the > - * type of write IO we are doing. This passes to the completion function the > - * operations it needs to perform. If the mapping is for an overwrite wholly > - * within the EOF then we don't need an ioend and so we don't allocate one. > - * This avoids the unnecessary overhead of allocating and freeing ioends for > - * workloads that don't require transactions on IO completion. > - * > - * If we get multiple mappings in a single IO, we might be mapping different > - * types. But because the direct IO can only have a single private pointer, we > - * need to ensure that: > - * > - * a) i) the ioend spans the entire region of unwritten mappings; or > - * ii) the ioend spans all the mappings that cross or are beyond EOF; and > - * b) if it contains unwritten extents, it is *permanently* marked as such > - * > - * We could do this by chaining ioends like buffered IO does, but we only > - * actually get one IO completion callback from the direct IO, and that spans > - * the entire IO regardless of how many mappings and IOs are needed to complete > - * the DIO. There is only going to be one reference to the ioend and its life > - * cycle is constrained by the DIO completion code. hence we don't need > - * reference counting here. > + * When we map a DIO buffer, we may need to pass flags to > + * xfs_end_io_direct_write to tell it what kind of write IO we are doing. > * > * Note that for DIO, an IO to the highest supported file block offset (i.e. > * 2^63 - 1FSB bytes) will result in the offset + count overflowing a signed 64 > @@ -1266,68 +1251,26 @@ xfs_vm_releasepage( > * extending the file size. We won't know for sure until IO completion is run > * and the actual max write offset is communicated to the IO completion > * routine. > - * > - * For DAX page faults, we are preparing to never see unwritten extents here, > - * nor should we ever extend the inode size. Hence we will soon have nothing to > - * do here for this case, ensuring we don't have to provide an IO completion > - * callback to free an ioend that we don't actually need for a fault into the > - * page at offset (2^63 - 1FSB) bytes. > */ > - > static void > xfs_map_direct( > struct inode *inode, > struct buffer_head *bh_result, > struct xfs_bmbt_irec *imap, > - xfs_off_t offset, > - bool dax_fault) > + xfs_off_t offset) > { > - struct xfs_ioend *ioend; > + uintptr_t *flags = (uintptr_t *)&bh_result->b_private; > xfs_off_t size = bh_result->b_size; > - int type; > - > - if (ISUNWRITTEN(imap)) > - type = XFS_IO_UNWRITTEN; > - else > - type = XFS_IO_OVERWRITE; > - > - trace_xfs_gbmap_direct(XFS_I(inode), offset, size, type, imap); > - > - if (dax_fault) { > - ASSERT(type == XFS_IO_OVERWRITE); > - trace_xfs_gbmap_direct_none(XFS_I(inode), offset, size, type, > - imap); > - return; > - } > > - if (bh_result->b_private) { > - ioend = bh_result->b_private; > - ASSERT(ioend->io_size > 0); > - ASSERT(offset >= ioend->io_offset); > - if (offset + size > ioend->io_offset + ioend->io_size) > - ioend->io_size = offset - ioend->io_offset + size; > - > - if (type == XFS_IO_UNWRITTEN && type != ioend->io_type) > - ioend->io_type = XFS_IO_UNWRITTEN; > - > - trace_xfs_gbmap_direct_update(XFS_I(inode), ioend->io_offset, > - ioend->io_size, ioend->io_type, > - imap); > - } else if (type == XFS_IO_UNWRITTEN || > - offset + size > i_size_read(inode) || > - offset + size < 0) { > - ioend = xfs_alloc_ioend(inode, type); > - ioend->io_offset = offset; > - ioend->io_size = size; > + trace_xfs_get_blocks_map_direct(XFS_I(inode), offset, size, > + ISUNWRITTEN(imap) ? XFS_IO_UNWRITTEN : XFS_IO_OVERWRITE, imap); > > - bh_result->b_private = ioend; > + if (ISUNWRITTEN(imap)) { > + *flags |= XFS_DIO_FLAG_UNWRITTEN; > + set_buffer_defer_completion(bh_result); > + } else if (offset + size > i_size_read(inode) || offset + size < 0) { > + *flags |= XFS_DIO_FLAG_APPEND; > set_buffer_defer_completion(bh_result); > - > - trace_xfs_gbmap_direct_new(XFS_I(inode), offset, size, type, > - imap); > - } else { > - trace_xfs_gbmap_direct_none(XFS_I(inode), offset, size, type, > - imap); > } > } > > @@ -1498,9 +1441,12 @@ __xfs_get_blocks( > if (ISUNWRITTEN(&imap)) > set_buffer_unwritten(bh_result); > /* direct IO needs special help */ > - if (create && direct) > - xfs_map_direct(inode, bh_result, &imap, offset, > - dax_fault); > + if (create && direct) { > + if (dax_fault) > + ASSERT(!ISUNWRITTEN(&imap)); > + else > + xfs_map_direct(inode, bh_result, &imap, offset); > + } > } > > /* > @@ -1570,42 +1516,50 @@ xfs_get_blocks_dax_fault( > return __xfs_get_blocks(inode, iblock, bh_result, create, true, true); > } > > -static void > -__xfs_end_io_direct_write( > - struct inode *inode, > - struct xfs_ioend *ioend, > +/* > + * Complete a direct I/O write request. > + * > + * xfs_map_direct passes us some flags in the private data to tell us what to > + * do. If no flags are set, then the write IO is an overwrite wholly within > + * the existing allocated file size and so there is nothing for us to do. > + * > + * Note that in this case the completion can be called in interrupt context, > + * whereas if we have flags set we will always be called in task context > + * (i.e. from a workqueue). > + */ > +STATIC int > +xfs_end_io_direct_write( > + struct kiocb *iocb, > loff_t offset, > - ssize_t size) > + ssize_t size, > + void *private) > { > - struct xfs_mount *mp = XFS_I(inode)->i_mount; > + struct inode *inode = file_inode(iocb->ki_filp); > + struct xfs_inode *ip = XFS_I(inode); > + struct xfs_mount *mp = ip->i_mount; > + uintptr_t flags = (uintptr_t)private; > + int error = 0; > > - if (XFS_FORCED_SHUTDOWN(mp) || ioend->io_error) > - goto out_end_io; > + trace_xfs_end_io_direct_write(ip, offset, size); > > - /* > - * dio completion end_io functions are only called on writes if more > - * than 0 bytes was written. > - */ > - ASSERT(size > 0); > + if (XFS_FORCED_SHUTDOWN(mp)) > + return -EIO; > > - /* > - * The ioend only maps whole blocks, while the IO may be sector aligned. > - * Hence the ioend offset/size may not match the IO offset/size exactly. > - * Because we don't map overwrites within EOF into the ioend, the offset > - * may not match, but only if the endio spans EOF. Either way, write > - * the IO sizes into the ioend so that completion processing does the > - * right thing. > - */ > - ASSERT(offset + size <= ioend->io_offset + ioend->io_size); > - ioend->io_size = size; > - ioend->io_offset = offset; > + if (size <= 0) > + return size; > > /* > - * The ioend tells us whether we are doing unwritten extent conversion > + * The flags tell us whether we are doing unwritten extent conversions > * or an append transaction that updates the on-disk file size. These > * cases are the only cases where we should *potentially* be needing > * to update the VFS inode size. > - * > + */ > + if (flags == 0) { > + ASSERT(offset + size <= i_size_read(inode)); > + return 0; > + } > + > + /* > * We need to update the in-core inode size here so that we don't end up > * with the on-disk inode size being outside the in-core inode size. We > * have no other method of updating EOF for AIO, so always do it here > @@ -1616,58 +1570,30 @@ __xfs_end_io_direct_write( > * here can result in EOF moving backwards and Bad Things Happen when > * that occurs. > */ > - spin_lock(&XFS_I(inode)->i_flags_lock); > + spin_lock(&ip->i_flags_lock); > if (offset + size > i_size_read(inode)) > i_size_write(inode, offset + size); > - spin_unlock(&XFS_I(inode)->i_flags_lock); > + spin_unlock(&ip->i_flags_lock); > > - /* > - * If we are doing an append IO that needs to update the EOF on disk, > - * do the transaction reserve now so we can use common end io > - * processing. Stashing the error (if there is one) in the ioend will > - * result in the ioend processing passing on the error if it is > - * possible as we can't return it from here. > - */ > - if (ioend->io_type == XFS_IO_OVERWRITE) > - ioend->io_error = xfs_setfilesize_trans_alloc(ioend); > + if (flags & XFS_DIO_FLAG_UNWRITTEN) { > + trace_xfs_end_io_direct_write_unwritten(ip, offset, size); > > -out_end_io: > - xfs_end_io(&ioend->io_work); > - return; > -} > + error = xfs_iomap_write_unwritten(ip, offset, size); > + } else if (flags & XFS_DIO_FLAG_APPEND) { > + struct xfs_trans *tp; > > -/* > - * Complete a direct I/O write request. > - * > - * The ioend structure is passed from __xfs_get_blocks() to tell us what to do. > - * If no ioend exists (i.e. @private == NULL) then the write IO is an overwrite > - * wholly within the EOF and so there is nothing for us to do. Note that in this > - * case the completion can be called in interrupt context, whereas if we have an > - * ioend we will always be called in task context (i.e. from a workqueue). > - */ > -STATIC int > -xfs_end_io_direct_write( > - struct kiocb *iocb, > - loff_t offset, > - ssize_t size, > - void *private) > -{ > - struct inode *inode = file_inode(iocb->ki_filp); > - struct xfs_ioend *ioend = private; > + trace_xfs_end_io_direct_write_append(ip, offset, size); > > - if (size <= 0) > - return 0; > - > - trace_xfs_gbmap_direct_endio(XFS_I(inode), offset, size, > - ioend ? ioend->io_type : 0, NULL); > - > - if (!ioend) { > - ASSERT(offset + size <= i_size_read(inode)); > - return 0; > + tp = xfs_trans_alloc(mp, XFS_TRANS_FSYNC_TS); > + error = xfs_trans_reserve(tp, &M_RES(mp)->tr_fsyncts, 0, 0); > + if (error) { > + xfs_trans_cancel(tp); > + return error; > + } > + error = xfs_setfilesize(ip, tp, offset, size); Don't we need a xfs_trans_commit() here? --D > } > > - __xfs_end_io_direct_write(inode, ioend, offset, size); > - return 0; > + return error; > } > > static inline ssize_t > diff --git a/fs/xfs/xfs_trace.h b/fs/xfs/xfs_trace.h > index 391d797..c8d5842 100644 > --- a/fs/xfs/xfs_trace.h > +++ b/fs/xfs/xfs_trace.h > @@ -1296,11 +1296,7 @@ DEFINE_IOMAP_EVENT(xfs_map_blocks_found); > DEFINE_IOMAP_EVENT(xfs_map_blocks_alloc); > DEFINE_IOMAP_EVENT(xfs_get_blocks_found); > DEFINE_IOMAP_EVENT(xfs_get_blocks_alloc); > -DEFINE_IOMAP_EVENT(xfs_gbmap_direct); > -DEFINE_IOMAP_EVENT(xfs_gbmap_direct_new); > -DEFINE_IOMAP_EVENT(xfs_gbmap_direct_update); > -DEFINE_IOMAP_EVENT(xfs_gbmap_direct_none); > -DEFINE_IOMAP_EVENT(xfs_gbmap_direct_endio); > +DEFINE_IOMAP_EVENT(xfs_get_blocks_map_direct); > > DECLARE_EVENT_CLASS(xfs_simple_io_class, > TP_PROTO(struct xfs_inode *ip, xfs_off_t offset, ssize_t count), > @@ -1340,6 +1336,9 @@ DEFINE_SIMPLE_IO_EVENT(xfs_unwritten_convert); > DEFINE_SIMPLE_IO_EVENT(xfs_get_blocks_notfound); > DEFINE_SIMPLE_IO_EVENT(xfs_setfilesize); > DEFINE_SIMPLE_IO_EVENT(xfs_zero_eof); > +DEFINE_SIMPLE_IO_EVENT(xfs_end_io_direct_write); > +DEFINE_SIMPLE_IO_EVENT(xfs_end_io_direct_write_unwritten); > +DEFINE_SIMPLE_IO_EVENT(xfs_end_io_direct_write_append); > > DECLARE_EVENT_CLASS(xfs_itrunc_class, > TP_PROTO(struct xfs_inode *ip, xfs_fsize_t new_size), > -- > 2.1.4 > > _______________________________________________ > xfs mailing list > xfs@oss.sgi.com > http://oss.sgi.com/mailman/listinfo/xfs From david@fromorbit.com Fri Feb 5 16:31:23 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=ham version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay2.corp.sgi.com [137.38.102.29]) by oss.sgi.com (Postfix) with ESMTP id 8C8457CA2 for ; Fri, 5 Feb 2016 16:31:23 -0600 (CST) Received: from cuda.sgi.com (cuda3.sgi.com [192.48.176.15]) by relay2.corp.sgi.com (Postfix) with ESMTP id 7D786304048 for ; Fri, 5 Feb 2016 14:31:20 -0800 (PST) X-ASG-Debug-ID: 1454711476-04cb6c27465ada0001-NocioJ Received: from ipmail06.adl2.internode.on.net (ipmail06.adl2.internode.on.net [150.101.137.129]) by cuda.sgi.com with ESMTP id ofWfBGcDDMKubsOt for ; Fri, 05 Feb 2016 14:31:17 -0800 (PST) X-Barracuda-Envelope-From: david@fromorbit.com X-Barracuda-Apparent-Source-IP: 150.101.137.129 Received: from ppp121-44-19-16.lns20.syd4.internode.on.net (HELO dastard) ([121.44.19.16]) by ipmail06.adl2.internode.on.net with ESMTP; 06 Feb 2016 09:00:24 +1030 Received: from dave by dastard with local (Exim 4.80) (envelope-from ) id 1aRotT-0002rF-9b; Sat, 06 Feb 2016 09:30:23 +1100 Date: Sat, 6 Feb 2016 09:30:23 +1100 From: Dave Chinner To: Michel Verbraak Cc: xfs@oss.sgi.com Subject: Re: Question about continous blocks for inode due to 'no space left on device' problem Message-ID: <20160205223023.GL459@dastard> X-ASG-Orig-Subj: Re: Question about continous blocks for inode due to 'no space left on device' problem References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.21 (2010-09-15) X-Barracuda-Connect: ipmail06.adl2.internode.on.net[150.101.137.129] X-Barracuda-Start-Time: 1454711476 X-Barracuda-URL: https://192.48.176.15:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-BRTS-Status: 1 X-Barracuda-Spam-Score: 0.00 X-Barracuda-Spam-Status: No, SCORE=0.00 using per-user scores of TAG_LEVEL=1000.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.7 tests=BSF_SC0_MISMATCH_TO X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.3.26782 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 0.00 BSF_SC0_MISMATCH_TO Envelope rcpt doesn't match header On Fri, Feb 05, 2016 at 02:13:00PM +0100, Michel Verbraak wrote: > All, > > Recently we ran into a problem where our filesystem (300GB in size) > reported 'no space left on device' (ENOSPC) but when we looked at disk > space usage and inode usage it was around 52% for disk space and 11% for > inode. (sorry do not have a save of the output of df command). .... > meta-data=/dev/sdb isize=256 agcount=6, agsize=19660800 Inode allocation requires aligned 16k extents. ...... > Some extra info about the system and files on the system: > - Ubuntu 12.04.5 LTS > - Kernel: Linux ealxs00170 3.2.0-97-generic #137-Ubuntu SMP Thu Dec 17 > 18:11:47 UTC 2015 x86_64 x86_64 x86_64 GNU/Linux > - 32 million files of which about 75% is smaller than 1k. Files are > separated over different folders to keep the number of files per folder low. You have lots of small single block files which will cause free space to tend towards small extents as the filesystem fills up... > - mount options: defaults,noatime,inode64,nobarrier > > Regards, > > Michel Verbraak. > > Store 03 (root@server):~# xfs_db -c freesp /dev/sdb > from to extents blocks pct > 1 1 3282633 3282633 9.03 > 2 3 3416223 8372325 23.03 > 4 7 6175009 24700036 67.94 Yup, no more aligned 4 block extents in the filesystem. This is what the experimental sparse inode feature in current kernels addresses - it allows unaligned block allocation for inodes and so allows you to abuse the filesystem all the way up to 100% full with workloads like this. But without moving to a current 4.4 kernel and reformatting all your filesystems, there's absolutely nothing you can do about it except grow the filesystem to be larger every time you drive the filesystem into this condition. Cheers, Dave. -- Dave Chinner david@fromorbit.com From david@fromorbit.com Fri Feb 5 16:35:26 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=ham version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay2.corp.sgi.com [137.38.102.29]) by oss.sgi.com (Postfix) with ESMTP id 40C397CA2 for ; Fri, 5 Feb 2016 16:35:26 -0600 (CST) Received: from cuda.sgi.com (cuda3.sgi.com [192.48.176.15]) by relay2.corp.sgi.com (Postfix) with ESMTP id 21A35304048 for ; Fri, 5 Feb 2016 14:35:26 -0800 (PST) X-ASG-Debug-ID: 1454711722-04cb6c27465b5d0001-NocioJ Received: from ipmail06.adl2.internode.on.net (ipmail06.adl2.internode.on.net [150.101.137.129]) by cuda.sgi.com with ESMTP id 2xYrCDmASqFJqB3p for ; Fri, 05 Feb 2016 14:35:23 -0800 (PST) X-Barracuda-Envelope-From: david@fromorbit.com X-Barracuda-Apparent-Source-IP: 150.101.137.129 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: A2BQCQA8IrVWPBATLHleKAECgw+BP4Jpg3qBeJ1CAQIBAQaLZ4VEhAeGBwICAQECgTRNAQEBAQEBBwEBAQFBP4RCAQEEOhwjEAgDGAklDwUlAwcaE4gavzoBAQgCHhiFMoR/iGwFlnWNR458jj6EWiguAYl7AQEB Received: from ppp121-44-19-16.lns20.syd4.internode.on.net (HELO dastard) ([121.44.19.16]) by ipmail06.adl2.internode.on.net with ESMTP; 06 Feb 2016 09:05:20 +1030 Received: from dave by dastard with local (Exim 4.80) (envelope-from ) id 1aRoyF-0002rx-GD; Sat, 06 Feb 2016 09:35:19 +1100 Date: Sat, 6 Feb 2016 09:35:19 +1100 From: Dave Chinner To: Ross Zwisler Cc: xfs@oss.sgi.com Subject: Re: [PATCH 0/3] xfs: fix realtime device assert failures Message-ID: <20160205223519.GM459@dastard> X-ASG-Orig-Subj: Re: [PATCH 0/3] xfs: fix realtime device assert failures References: <1454373550-3102-1-git-send-email-david@fromorbit.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.21 (2010-09-15) X-Barracuda-Connect: ipmail06.adl2.internode.on.net[150.101.137.129] X-Barracuda-Start-Time: 1454711722 X-Barracuda-URL: https://192.48.176.15:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-BRTS-Status: 1 X-Barracuda-Spam-Score: 0.00 X-Barracuda-Spam-Status: No, SCORE=0.00 using per-user scores of TAG_LEVEL=1000.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.7 tests=BSF_SC0_MISMATCH_TO X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.3.26782 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 0.00 BSF_SC0_MISMATCH_TO Envelope rcpt doesn't match header On Thu, Feb 04, 2016 at 02:22:17PM -0700, Ross Zwisler wrote: > This series solves the assert and the follow-up XFS warning for me. > > Tested-by: Ross Zwisler > > The lockdep splat is still there, but I assume you know that. Mostly I don't care about lockdep splats because experience tells me they are wild goose chases that end with us jumping through ever more complex flaming hoops to annotate the special corner case lockdep has falsely triggered on. I also don't have time to care about lockdep right now, so I'm ignoring it until it manifests itself as a real deadlock. Cheers, Dave. -- Dave Chinner david@fromorbit.com From david@fromorbit.com Fri Feb 5 16:36:45 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=ham version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay3.corp.sgi.com [198.149.34.15]) by oss.sgi.com (Postfix) with ESMTP id E2B4F7CA2 for ; Fri, 5 Feb 2016 16:36:45 -0600 (CST) Received: from cuda.sgi.com (cuda2.sgi.com [192.48.176.25]) by relay3.corp.sgi.com (Postfix) with ESMTP id 72F23AC006 for ; Fri, 5 Feb 2016 14:36:42 -0800 (PST) X-ASG-Debug-ID: 1454711795-04cbb04cfc75ab0001-NocioJ Received: from ipmail06.adl2.internode.on.net (ipmail06.adl2.internode.on.net [150.101.137.129]) by cuda.sgi.com with ESMTP id PBQzLZfYXFR4q36l for ; Fri, 05 Feb 2016 14:36:36 -0800 (PST) X-Barracuda-Envelope-From: david@fromorbit.com X-Barracuda-Apparent-Source-IP: 150.101.137.129 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: A2D0CABoI7VWPBATLHleKAECgw+BP4Jpg3qBeJ1CAQIBAQaLZ4VEhAeGBwQCAoE0TQEBAQEBAQcBAQEBQT+EQgEBBCcTHCMQCAMYCSUPBSUDBxoTiBq/OgEBCAIeGIUyhH+IbAEElnWNR458jj6CZRmBXCguiXwBAQE Received: from ppp121-44-19-16.lns20.syd4.internode.on.net (HELO dastard) ([121.44.19.16]) by ipmail06.adl2.internode.on.net with ESMTP; 06 Feb 2016 09:06:27 +1030 Received: from dave by dastard with local (Exim 4.80) (envelope-from ) id 1aRozK-0002sC-J4; Sat, 06 Feb 2016 09:36:26 +1100 Date: Sat, 6 Feb 2016 09:36:26 +1100 From: Dave Chinner To: "Darrick J. Wong" Cc: Christoph Hellwig , linux-fsdevel@vger.kernel.org, xfs@oss.sgi.com, linux-ext4@vger.kernel.org, ocfs2-devel@oss.oracle.com Subject: Re: [PATCH 2/3] xfs: don't use ioends for direct write completions Message-ID: <20160205223626.GN459@dastard> X-ASG-Orig-Subj: Re: [PATCH 2/3] xfs: don't use ioends for direct write completions References: <1454524816-11392-1-git-send-email-hch@lst.de> <1454524816-11392-3-git-send-email-hch@lst.de> <20160205215718.GM20038@birch.djwong.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20160205215718.GM20038@birch.djwong.org> User-Agent: Mutt/1.5.21 (2010-09-15) X-Barracuda-Connect: ipmail06.adl2.internode.on.net[150.101.137.129] X-Barracuda-Start-Time: 1454711795 X-Barracuda-URL: https://192.48.176.25:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-BRTS-Status: 1 X-Barracuda-Spam-Score: 0.00 X-Barracuda-Spam-Status: No, SCORE=0.00 using per-user scores of TAG_LEVEL=1000.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.7 tests=BSF_SC0_MISMATCH_TO X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.3.26782 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 0.00 BSF_SC0_MISMATCH_TO Envelope rcpt doesn't match header On Fri, Feb 05, 2016 at 01:57:18PM -0800, Darrick J. Wong wrote: > On Wed, Feb 03, 2016 at 07:40:15PM +0100, Christoph Hellwig wrote: > > - struct kiocb *iocb, > > - loff_t offset, > > - ssize_t size, > > - void *private) > > -{ > > - struct inode *inode = file_inode(iocb->ki_filp); > > - struct xfs_ioend *ioend = private; > > + trace_xfs_end_io_direct_write_append(ip, offset, size); > > > > - if (size <= 0) > > - return 0; > > - > > - trace_xfs_gbmap_direct_endio(XFS_I(inode), offset, size, > > - ioend ? ioend->io_type : 0, NULL); > > - > > - if (!ioend) { > > - ASSERT(offset + size <= i_size_read(inode)); > > - return 0; > > + tp = xfs_trans_alloc(mp, XFS_TRANS_FSYNC_TS); > > + error = xfs_trans_reserve(tp, &M_RES(mp)->tr_fsyncts, 0, 0); > > + if (error) { > > + xfs_trans_cancel(tp); > > + return error; > > + } > > + error = xfs_setfilesize(ip, tp, offset, size); > > Don't we need a xfs_trans_commit() here? No, xfs_setfilesize() does that. Cheers, Dave. -- Dave Chinner david@fromorbit.com From debbugs@buxtehude.debian.org Fri Feb 5 19:03:19 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=ham version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay2.corp.sgi.com [137.38.102.29]) by oss.sgi.com (Postfix) with ESMTP id B49D429DF5 for ; Fri, 5 Feb 2016 19:03:19 -0600 (CST) Received: from cuda.sgi.com (cuda2.sgi.com [192.48.176.25]) by relay2.corp.sgi.com (Postfix) with ESMTP id 93BE2304032 for ; Fri, 5 Feb 2016 17:03:16 -0800 (PST) X-ASG-Debug-ID: 1454720586-04cbb04cfc820c0001-NocioJ Received: from buxtehude.debian.org (buxtehude.debian.org [206.12.19.147]) by cuda.sgi.com with ESMTP id njjjockk0tNjiiBq (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128 verify=NO) for ; Fri, 05 Feb 2016 17:03:06 -0800 (PST) X-Barracuda-Envelope-From: debbugs@buxtehude.debian.org X-Barracuda-Apparent-Source-IP: 206.12.19.147 Received: from debbugs by buxtehude.debian.org with local (Exim 4.84) (envelope-from ) id 1aRrHE-0003YJ-18; Sat, 06 Feb 2016 01:03:04 +0000 X-Loop: owner@bugs.debian.org Subject: Bug#766811: spurious library links Reply-To: Marco d'Itri , 766811@bugs.debian.org X-ASG-Orig-Subj: Bug#766811: spurious library links Resent-From: Marco d'Itri Resent-To: debian-bugs-dist@lists.debian.org Resent-CC: XFS Development Team X-Loop: owner@bugs.debian.org Resent-Date: Sat, 06 Feb 2016 01:03:01 +0000 Resent-Message-ID: X-Debian-PR-Message: followup 766811 X-Debian-PR-Package: xfslibs-dev X-Debian-PR-Keywords: X-Debian-PR-Source: xfsprogs Received: via spool by 766811-submit@bugs.debian.org id=B766811.145472031712015 (code B ref 766811); Sat, 06 Feb 2016 01:03:01 +0000 Received: (at 766811) by bugs.debian.org; 6 Feb 2016 00:58:37 +0000 Received: from attila.bofh.it ([2001:4b78:2000::1] ident=postfix) by buxtehude.debian.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84) (envelope-from ) id 1aRrCv-00037J-02 for 766811@bugs.debian.org; Sat, 06 Feb 2016 00:58:37 +0000 Received: by attila.bofh.it (Postfix, from userid 10) id B49EE2E786; Sat, 6 Feb 2016 01:58:32 +0100 (CET) Received: by bongo.bofh.it (Postfix, from userid 1000) id 51C662C0703; Sat, 6 Feb 2016 01:58:21 +0100 (CET) Date: Sat, 6 Feb 2016 01:58:21 +0100 From: Marco d'Itri To: Jakub Wilk Cc: 766811@bugs.debian.org Message-ID: <20160206005821.GA11551@bongo.bofh.it> References: <20141026004825.GA27863@bongo.bofh.it> <20160124151308.GA7620@jwilk.net> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="jI8keyz6grp/JLjh" Content-Disposition: inline In-Reply-To: <20160124151308.GA7620@jwilk.net> User-Agent: Mutt/1.5.24 (2015-08-30) X-Barracuda-Connect: buxtehude.debian.org[206.12.19.147] X-Barracuda-Start-Time: 1454720586 X-Barracuda-Encrypted: ECDHE-RSA-AES128-GCM-SHA256 X-Barracuda-URL: https://192.48.176.25:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-BRTS-Status: 1 X-Barracuda-Spam-Score: 0.00 X-Barracuda-Spam-Status: No, SCORE=0.00 using per-user scores of TAG_LEVEL=1000.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.7 tests=BSF_SC0_MISMATCH_TO X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.3.26788 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 0.00 BSF_SC0_MISMATCH_TO Envelope rcpt doesn't match header --jI8keyz6grp/JLjh Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Jan 24, Jakub Wilk wrote: > I can still see them in the current version: You are right, I was fooled because the extra files disappear if you=20 rebuild the package: md@bongo:/tmp/xfs/xfsprogs-4.3.0+nmu1$ find debian/|grep libhandle debian/xfslibs-dev/lib/libhandle.so debian/xfslibs-dev/usr/lib/libhandle.a debian/xfslibs-dev/usr/lib/libhandle.la debian/xfsprogs/lib/libhandle.so.1 debian/xfsprogs/lib/libhandle.so.1.0.3 So I wonder if this was a libtool bug and we just need to request=20 a binnmu of the package. --=20 ciao, Marco --jI8keyz6grp/JLjh Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQGcBAABCAAGBQJWtUUtAAoJECv1pcEixPekD0cMAL6Xn7kH9iaCFJgnL9M6WFy0 PsX7p117Kk/7KnH7cBoeUhCTgkK+YBggujFWmFOyiEnfSiKnvb1sYh/uCC6ysdME +t0gb9G/rU6h494qU/HbgOPQ2SQ2GpE0oMGaeb8LCSRd3LtqqED4tcTe7gR7pvrH z4atW/1cFiUmO1dsmlGCaNrT2FWfGVtoat8NZcII+WBWUnDji7VBsx2T8rMDvdIH +tozYVhA233qt2MwrVqvKuuXQ2Dopxm33Afc44O8USxOAfwULUi9C6F9lIzCLKFq c20ZZfLK74KGq7+f1n985M2fNNVAMccOMvcn+T6VgiAzDnJ4lkjt/rrrukDP9q3N ZtstfhR3BLmEvEI8hTrykZvTktSPsNL1dea/INQCfUmsA10w8U6Ja4xr4IJgaBBa xr2PkqLgQRkxKfdWfz7+9Esjxc1uLdgvL81pyMr5kR617uEkgmoOzkr1FX3wesbK V2kFpZfvSIPiUtnRTtQAKvgR87xMXJmcQXD4HicPEw== =4vZn -----END PGP SIGNATURE----- --jI8keyz6grp/JLjh-- From debbugs@buxtehude.debian.org Sat Feb 6 07:27:13 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=ham version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay2.corp.sgi.com [137.38.102.29]) by oss.sgi.com (Postfix) with ESMTP id 0ACC27CA2 for ; Sat, 6 Feb 2016 07:27:13 -0600 (CST) Received: from cuda.sgi.com (cuda3.sgi.com [192.48.176.15]) by relay2.corp.sgi.com (Postfix) with ESMTP id DF072304032 for ; Sat, 6 Feb 2016 05:27:09 -0800 (PST) X-ASG-Debug-ID: 1454765226-04cb6c27469b5a0001-NocioJ Received: from buxtehude.debian.org (buxtehude.debian.org [206.12.19.147]) by cuda.sgi.com with ESMTP id tbFKw5xhBanGdPMr (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128 verify=NO) for ; Sat, 06 Feb 2016 05:27:07 -0800 (PST) X-Barracuda-Envelope-From: debbugs@buxtehude.debian.org X-Barracuda-Apparent-Source-IP: 206.12.19.147 Received: from debbugs by buxtehude.debian.org with local (Exim 4.84) (envelope-from ) id 1aS2tE-0004lH-F7; Sat, 06 Feb 2016 13:27:04 +0000 X-Loop: owner@bugs.debian.org Subject: Bug#766811: spurious library links Reply-To: Jakub Wilk , 766811@bugs.debian.org X-ASG-Orig-Subj: Bug#766811: spurious library links Resent-From: Jakub Wilk Resent-To: debian-bugs-dist@lists.debian.org Resent-CC: XFS Development Team X-Loop: owner@bugs.debian.org Resent-Date: Sat, 06 Feb 2016 13:27:02 +0000 Resent-Message-ID: X-Debian-PR-Message: followup 766811 X-Debian-PR-Package: xfslibs-dev X-Debian-PR-Keywords: X-Debian-PR-Source: xfsprogs Received: via spool by 766811-submit@bugs.debian.org id=B766811.145476496816448 (code B ref 766811); Sat, 06 Feb 2016 13:27:02 +0000 Received: (at 766811) by bugs.debian.org; 6 Feb 2016 13:22:48 +0000 Received: from mailly.debian.org ([2001:41b8:202:deb:6564:a62:52c3:4b72]) from C=NA,ST=NA,L=Ankh Morpork,O=Debian SMTP,OU=Debian SMTP CA,CN=mailly.debian.org,EMAIL=hostmaster@mailly.debian.org (verified) by buxtehude.debian.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.84) (envelope-from ) id 1aS2p5-0004H5-Qw for 766811@bugs.debian.org; Sat, 06 Feb 2016 13:22:47 +0000 Received: from paradis2.debian.org ([2001:41c8:1000:21::21:31] helo=paradis.debian.org) from C=NA,ST=NA,L=Ankh Morpork,O=Debian SMTP,OU=Debian SMTP CA,CN=paradis.debian.org,EMAIL=hostmaster@paradis.debian.org (verified) by mailly.debian.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.84) (envelope-from ) id 1aS2p4-0000av-5y; Sat, 06 Feb 2016 13:22:46 +0000 Received: from jwilk by paradis.debian.org with local (Exim 4.84) (envelope-from ) id 1aS2p3-0002Z3-GD; Sat, 06 Feb 2016 13:22:45 +0000 Date: Sat, 6 Feb 2016 14:22:41 +0100 From: Jakub Wilk To: 766811@bugs.debian.org Cc: Marco d'Itri Message-ID: <20160206132241.GA2869@jwilk.net> References: <20141026004825.GA27863@bongo.bofh.it> <20160124151308.GA7620@jwilk.net> <20160206005821.GA11551@bongo.bofh.it> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Disposition: inline In-Reply-To: <20160206005821.GA11551@bongo.bofh.it> User-Agent: Mutt/1.5.23.1 (2014-03-12) X-Barracuda-Connect: buxtehude.debian.org[206.12.19.147] X-Barracuda-Start-Time: 1454765227 X-Barracuda-Encrypted: ECDHE-RSA-AES128-GCM-SHA256 X-Barracuda-URL: https://192.48.176.15:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-BRTS-Status: 1 X-Barracuda-Spam-Score: 0.00 X-Barracuda-Spam-Status: No, SCORE=0.00 using per-user scores of TAG_LEVEL=1000.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.7 tests=BSF_SC0_MISMATCH_TO X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.3.26803 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 0.00 BSF_SC0_MISMATCH_TO Envelope rcpt doesn't match header * Marco d'Itri , 2016-02-06, 01:58: >>I can still see them in the current version: >You are right, I was fooled because the extra files disappear if you >rebuild the package: > >md@bongo:/tmp/xfs/xfsprogs-4.3.0+nmu1$ find debian/|grep libhandle >debian/xfslibs-dev/lib/libhandle.so >debian/xfslibs-dev/usr/lib/libhandle.a >debian/xfslibs-dev/usr/lib/libhandle.la >debian/xfsprogs/lib/libhandle.so.1 >debian/xfsprogs/lib/libhandle.so.1.0.3 I can't reproduce this disappearance in a clean up-to-date sid chroot. AFAICS this is the code responsible for creating /lib/libfoo <-> /usr/lib/libfoo symlinks (see include/buildmacros:79): if [ "x$(shell readlink -f $(PKG_LIB_DIR))" != \ "x$(shell readlink -f $(PKG_ROOT_LIB_DIR))" ]; then \ ../$(INSTALL) -S $(PKG_LIB_DIR)/$(LIBNAME).a $(PKG_ROOT_LIB_DIR)/$(LIBNAME).a; \ ../$(INSTALL) -S $(PKG_LIB_DIR)/$(LIBNAME).la $(PKG_ROOT_LIB_DIR)/$(LIBNAME).la; \ ../$(INSTALL) -S $(PKG_ROOT_LIB_DIR)/$(LIBNAME).so $(PKG_LIB_DIR)/$(LIBNAME).so; \ fi I guess the symlinks weren't created on your system only because your /lib is symlinked to /usr/lib. -- Jakub Wilk From rjevskiy@gmail.com Sat Feb 6 08:33:20 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=FREEMAIL_FROM,T_DKIM_INVALID autolearn=ham version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay3.corp.sgi.com [198.149.34.15]) by oss.sgi.com (Postfix) with ESMTP id 392B47CA2 for ; Sat, 6 Feb 2016 08:33:20 -0600 (CST) Received: from cuda.sgi.com (cuda3.sgi.com [192.48.176.15]) by relay3.corp.sgi.com (Postfix) with ESMTP id 9BB4FAC002 for ; Sat, 6 Feb 2016 06:33:19 -0800 (PST) X-ASG-Debug-ID: 1454769194-04cb6c27459fc50001-NocioJ Received: from mail-lf0-f65.google.com (mail-lf0-f65.google.com [209.85.215.65]) by cuda.sgi.com with ESMTP id Cqhfz9OmTSvKT00g (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128 verify=NO) for ; Sat, 06 Feb 2016 06:33:15 -0800 (PST) X-Barracuda-Envelope-From: rjevskiy@gmail.com X-Barracuda-Apparent-Source-IP: 209.85.215.65 Received: by mail-lf0-f65.google.com with SMTP id h198so3795232lfh.3 for ; Sat, 06 Feb 2016 06:33:15 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:from:to:cc:subject:in-reply-to:references:user-agent:date :message-id:mime-version:content-type; bh=0vaNLeLeTwUzWmz5gzM6HaUTIGWxkSivrsSnxvphOu4=; b=JkHPjtvi/i3KqrHTIJ/ug1y5xg7si+pi6oY84bPM5twO0F61GrEY4iJ3VjdxeHqPY6 2pONEIoHG90/Dk/9DotrNuQH8adnhfKe1AeFCsmEtdoEniGj3pdy93X6OdZd86CApvoh ksfk6cqFksgL4xpfyXXpeP2qdab0J+0fiQsA9g4ptrHVi1BgI8pcApJJTAtdlIUTueH0 KEdqKJW0c1tYj02xPIccQf+D9+sng3viAcH54+nrQs22nlutBI0rZ3Ei8xfeMWUIhS5e 8kqvMwSrCYm4CgVEo2WvuqtSDXnbzvu7akZXAJyxfc15HDFV9m0DQlJ5bEVV+L+nfzur 4GKw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:sender:from:to:cc:subject:in-reply-to:references :user-agent:date:message-id:mime-version:content-type; bh=0vaNLeLeTwUzWmz5gzM6HaUTIGWxkSivrsSnxvphOu4=; b=aA6p55FnOVXejwU78yYAeb7yDvNa7MrGvFZjiw6RuVWkCkLXDMebaMob8tmJQT4gCG iFAAuJQ9lgRKo6lGh7ENY1VEhVu1ra8TRwqc03XkRUylUT0tRcrF/TUPkY7EfWVGLbbb bPcSfMxKuduWVjVY+9sqVB3m/h8Va54wN4Z6eWbjL9Vd6ZzIDDmIrkhXjntEgcfysUgA YzdheNk/RZp8JBZcaEQ0PWLzoTmckQBGftu2Tntq9X05xpy7djincxyEw5jr5oPaBz4X YFYWW0ufiW8uEkEDb5ZjObFTBgnKQEx1Bkd2slIYant359lY6+daiYfKEc+XIwZZuP5g 1Pow== X-Gm-Message-State: AG10YOQVMLiKhY2SZGBb2cQhCUrmDUCPlgV+44c57N6mZL/yKpM5TbSApB5KwowtmNYlZg== X-Received: by 10.25.15.226 with SMTP id 95mr8603173lfp.85.1454769194071; Sat, 06 Feb 2016 06:33:14 -0800 (PST) Received: from smtp.gmail.com ([195.214.234.4]) by smtp.gmail.com with ESMTPSA id ax1sm2823301lbc.20.2016.02.06.06.33.12 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 06 Feb 2016 06:33:12 -0800 (PST) Sender: Dmitry Monakhov From: Dmitry Monakhov To: Ross Zwisler , linux-kernel@vger.kernel.org Cc: Ross Zwisler , "H. Peter Anvin" , "J. Bruce Fields" , Theodore Ts'o , Alexander Viro , Andreas Dilger , Andrew Morton , Dan Williams , Dave Chinner , Dave Hansen , Ingo Molnar , Jan Kara , Jeff Layton , Matthew Wilcox , Matthew Wilcox , Thomas Gleixner , linux-ext4@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux-mm@kvack.org, linux-nvdimm@lists.01.org, x86@kernel.org, xfs@oss.sgi.com Subject: Re: [PATCH v8 6/9] dax: add support for fsync/msync In-Reply-To: <1452230879-18117-7-git-send-email-ross.zwisler@linux.intel.com> X-ASG-Orig-Subj: Re: [PATCH v8 6/9] dax: add support for fsync/msync References: <1452230879-18117-1-git-send-email-ross.zwisler@linux.intel.com> <1452230879-18117-7-git-send-email-ross.zwisler@linux.intel.com> User-Agent: Notmuch/0.18.1 (http://notmuchmail.org) Emacs/24.4.1 (x86_64-pc-linux-gnu) Date: Sat, 06 Feb 2016 17:33:07 +0300 Message-ID: <878u2xrjrw.fsf@openvz.org> MIME-Version: 1.0 Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha512; protocol="application/pgp-signature" X-Barracuda-Connect: mail-lf0-f65.google.com[209.85.215.65] X-Barracuda-Start-Time: 1454769195 X-Barracuda-Encrypted: ECDHE-RSA-AES128-GCM-SHA256 X-Barracuda-URL: https://192.48.176.15:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-BRTS-Status: 1 X-Barracuda-Spam-Score: 0.00 X-Barracuda-Spam-Status: No, SCORE=0.00 using per-user scores of TAG_LEVEL=1000.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.7 tests=BSF_SC0_MISMATCH_TO, DKIM_SIGNED, DKIM_VERIFIED X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.3.26804 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 0.00 BSF_SC0_MISMATCH_TO Envelope rcpt doesn't match header -0.00 DKIM_VERIFIED Domain Keys Identified Mail: signature passes verification 0.00 DKIM_SIGNED Domain Keys Identified Mail: message has a signature --=-=-= Content-Type: text/plain Content-Transfer-Encoding: quoted-printable Ross Zwisler writes: > To properly handle fsync/msync in an efficient way DAX needs to track dir= ty > pages so it is able to flush them durably to media on demand. Please see coments below > > The tracking of dirty pages is done via the radix tree in struct > address_space. This radix tree is already used by the page writeback > infrastructure for tracking dirty pages associated with an open file, and > it already has support for exceptional (non struct page*) entries. We > build upon these features to add exceptional entries to the radix tree for > DAX dirty PMD or PTE pages at fault time. > > Signed-off-by: Ross Zwisler > --- > fs/dax.c | 194 ++++++++++++++++++++++++++++++++++++++++++++++= ++++-- > include/linux/dax.h | 2 + > mm/filemap.c | 6 ++ > 3 files changed, 196 insertions(+), 6 deletions(-) > > diff --git a/fs/dax.c b/fs/dax.c > index 5b84a46..0db21ea 100644 > --- a/fs/dax.c > +++ b/fs/dax.c > @@ -24,6 +24,7 @@ > #include > #include > #include > +#include > #include > #include > #include > @@ -324,6 +325,174 @@ static int copy_user_bh(struct page *to, struct ino= de *inode, > return 0; > } >=20=20 > +#define NO_SECTOR -1 > + > +static int dax_radix_entry(struct address_space *mapping, pgoff_t index, IMHO it would be sane to call that function as dax_radix_entry_insert()=20 > + sector_t sector, bool pmd_entry, bool dirty) > +{ > + struct radix_tree_root *page_tree =3D &mapping->page_tree; > + int type, error =3D 0; > + void *entry; > + > + __mark_inode_dirty(mapping->host, I_DIRTY_PAGES); > + > + spin_lock_irq(&mapping->tree_lock); > + entry =3D radix_tree_lookup(page_tree, index); > + > + if (entry) { > + type =3D RADIX_DAX_TYPE(entry); > + if (WARN_ON_ONCE(type !=3D RADIX_DAX_PTE && > + type !=3D RADIX_DAX_PMD)) { > + error =3D -EIO; > + goto unlock; > + } > + > + if (!pmd_entry || type =3D=3D RADIX_DAX_PMD) > + goto dirty; > + radix_tree_delete(&mapping->page_tree, index); > + mapping->nrexceptional--; > + } > + > + if (sector =3D=3D NO_SECTOR) { > + /* > + * This can happen during correct operation if our pfn_mkwrite > + * fault raced against a hole punch operation. If this > + * happens the pte that was hole punched will have been > + * unmapped and the radix tree entry will have been removed by > + * the time we are called, but the call will still happen. We > + * will return all the way up to wp_pfn_shared(), where the > + * pte_same() check will fail, eventually causing page fault > + * to be retried by the CPU. > + */ > + goto unlock; > + } > + > + error =3D radix_tree_insert(page_tree, index, > + RADIX_DAX_ENTRY(sector, pmd_entry)); > + if (error) > + goto unlock; > + > + mapping->nrexceptional++; > + dirty: > + if (dirty) > + radix_tree_tag_set(page_tree, index, PAGECACHE_TAG_DIRTY); > + unlock: > + spin_unlock_irq(&mapping->tree_lock); > + return error; > +} > + > +static int dax_writeback_one(struct block_device *bdev, > + struct address_space *mapping, pgoff_t index, void *entry) > +{ > + struct radix_tree_root *page_tree =3D &mapping->page_tree; > + int type =3D RADIX_DAX_TYPE(entry); > + struct radix_tree_node *node; > + struct blk_dax_ctl dax; > + void **slot; > + int ret =3D 0; > + > + spin_lock_irq(&mapping->tree_lock); > + /* > + * Regular page slots are stabilized by the page lock even > + * without the tree itself locked. These unlocked entries > + * need verification under the tree lock. > + */ > + if (!__radix_tree_lookup(page_tree, index, &node, &slot)) > + goto unlock; > + if (*slot !=3D entry) > + goto unlock; > + > + /* another fsync thread may have already written back this entry */ > + if (!radix_tree_tag_get(page_tree, index, PAGECACHE_TAG_TOWRITE)) > + goto unlock; > + > + radix_tree_tag_clear(page_tree, index, PAGECACHE_TAG_TOWRITE); > + > + if (WARN_ON_ONCE(type !=3D RADIX_DAX_PTE && type !=3D RADIX_DAX_PMD)) { > + ret =3D -EIO; > + goto unlock; > + } > + > + dax.sector =3D RADIX_DAX_SECTOR(entry); > + dax.size =3D (type =3D=3D RADIX_DAX_PMD ? PMD_SIZE : PAGE_SIZE); > + spin_unlock_irq(&mapping->tree_lock); > + > + /* > + * We cannot hold tree_lock while calling dax_map_atomic() because it > + * eventually calls cond_resched(). > + */ > + ret =3D dax_map_atomic(bdev, &dax); > + if (ret < 0) > + return ret; > + > + if (WARN_ON_ONCE(ret < dax.size)) { > + ret =3D -EIO; > + goto unmap; > + } > + > + wb_cache_pmem(dax.addr, dax.size); > + unmap: > + dax_unmap_atomic(bdev, &dax); > + return ret; > + > + unlock: > + spin_unlock_irq(&mapping->tree_lock); > + return ret; > +} > + > +/* > + * Flush the mapping to the persistent domain within the byte range of [= start, > + * end]. This is required by data integrity operations to ensure file da= ta is > + * on persistent storage prior to completion of the operation. > + */ > +int dax_writeback_mapping_range(struct address_space *mapping, loff_t st= art, > + loff_t end) > +{ > + struct inode *inode =3D mapping->host; > + struct block_device *bdev =3D inode->i_sb->s_bdev; > + pgoff_t indices[PAGEVEC_SIZE]; > + pgoff_t start_page, end_page; > + struct pagevec pvec; > + void *entry; > + int i, ret =3D 0; > + > + if (WARN_ON_ONCE(inode->i_blkbits !=3D PAGE_SHIFT)) > + return -EIO; > + > + rcu_read_lock(); > + entry =3D radix_tree_lookup(&mapping->page_tree, start & PMD_MASK); > + rcu_read_unlock(); > + > + /* see if the start of our range is covered by a PMD entry */ > + if (entry && RADIX_DAX_TYPE(entry) =3D=3D RADIX_DAX_PMD) > + start &=3D PMD_MASK; > + > + start_page =3D start >> PAGE_CACHE_SHIFT; > + end_page =3D end >> PAGE_CACHE_SHIFT; > + > + tag_pages_for_writeback(mapping, start_page, end_page); > + > + pagevec_init(&pvec, 0); > + while (1) { > + pvec.nr =3D find_get_entries_tag(mapping, start_page, > + PAGECACHE_TAG_TOWRITE, PAGEVEC_SIZE, > + pvec.pages, indices); > + > + if (pvec.nr =3D=3D 0) > + break; > + > + for (i =3D 0; i < pvec.nr; i++) { > + ret =3D dax_writeback_one(bdev, mapping, indices[i], > + pvec.pages[i]); > + if (ret < 0) > + return ret; > + } I think it would be more efficient to use batched locking like follows: spin_lock_irq(&mapping->tree_lock); for (i =3D 0; i < pvec.nr; i++) { struct blk_dax_ctl dax[PAGEVEC_SIZE];=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20 radix_tree_tag_clear(page_tree, indices[i], PAGECACHE_T= AG_TOWRITE); /* It is also reasonable to merge adjacent dax * regions in to one */ dax[i].sector =3D RADIX_DAX_SECTOR(entry); dax[i].size =3D (type =3D=3D RADIX_DAX_PMD ? PMD_SIZE := PAGE_SIZE);=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20 } spin_unlock_irq(&mapping->tree_lock); if (blk_queue_enter(q, true) !=3D 0) goto error; for (i =3D 0; i < pvec.nr; i++) { rc =3D bdev_direct_access(bdev, dax[i]); wb_cache_pmem(dax[i].addr, dax[i].size); } ret =3D blk_queue_exit(q, true) > + } > + wmb_pmem(); > + return 0; > +} > +EXPORT_SYMBOL_GPL(dax_writeback_mapping_range); > + > static int dax_insert_mapping(struct inode *inode, struct buffer_head *b= h, > struct vm_area_struct *vma, struct vm_fault *vmf) > { > @@ -363,6 +532,11 @@ static int dax_insert_mapping(struct inode *inode, s= truct buffer_head *bh, > } > dax_unmap_atomic(bdev, &dax); >=20=20 > + error =3D dax_radix_entry(mapping, vmf->pgoff, dax.sector, false, > + vmf->flags & FAULT_FLAG_WRITE); > + if (error) > + goto out; > + > error =3D vm_insert_mixed(vma, vaddr, dax.pfn); >=20=20 > out: > @@ -487,6 +661,7 @@ int __dax_fault(struct vm_area_struct *vma, struct vm= _fault *vmf, > delete_from_page_cache(page); > unlock_page(page); > page_cache_release(page); > + page =3D NULL; > } I've realized that I do not understand why dax_fault code works at all. During dax_fault we want to remove page from mapping and insert dax-entry Basically code looks like follows: 0 page =3D find_get_page() 1 lock_page(page) 2 delete_from_page_cache(page); 3 unlock_page(page); 4 dax_insert_mapping(inode, &bh, vma, vmf); BUT what on earth protects us from other process to reinsert page again after step(2) but before (4)? Imagine we do write to file-hole which result in to dax_fault(write), but another task also does read fault and reinsert deleted page via dax_hole_lo= ad As result dax_tree_entry will fail with EIO Testcase looks very trivial, but i can not reproduce this. >=20=20 > /* > @@ -591,7 +766,7 @@ int __dax_pmd_fault(struct vm_area_struct *vma, unsig= ned long address, > pgoff_t size, pgoff; > loff_t lstart, lend; > sector_t block; > - int result =3D 0; > + int error, result =3D 0; >=20=20 > /* dax pmd mappings require pfn_t_devmap() */ > if (!IS_ENABLED(CONFIG_FS_DAX_PMD)) > @@ -733,6 +908,16 @@ int __dax_pmd_fault(struct vm_area_struct *vma, unsi= gned long address, > } > dax_unmap_atomic(bdev, &dax); >=20=20 > + if (write) { > + error =3D dax_radix_entry(mapping, pgoff, dax.sector, > + true, true); > + if (error) { > + dax_pmd_dbg(&bh, address, > + "PMD radix insertion failed"); > + goto fallback; > + } > + } > + > dev_dbg(part_to_dev(bdev->bd_part), > "%s: %s addr: %lx pfn: %lx sect: %llx\n", > __func__, current->comm, address, > @@ -791,15 +976,12 @@ EXPORT_SYMBOL_GPL(dax_pmd_fault); > * dax_pfn_mkwrite - handle first write to DAX page > * @vma: The virtual memory area where the fault occurred > * @vmf: The description of the fault > - * > */ > int dax_pfn_mkwrite(struct vm_area_struct *vma, struct vm_fault *vmf) > { > - struct super_block *sb =3D file_inode(vma->vm_file)->i_sb; > + struct file *file =3D vma->vm_file; >=20=20 > - sb_start_pagefault(sb); > - file_update_time(vma->vm_file); > - sb_end_pagefault(sb); > + dax_radix_entry(file->f_mapping, vmf->pgoff, NO_SECTOR, false, true); > return VM_FAULT_NOPAGE; > } > EXPORT_SYMBOL_GPL(dax_pfn_mkwrite); > diff --git a/include/linux/dax.h b/include/linux/dax.h > index e9d57f68..8204c3d 100644 > --- a/include/linux/dax.h > +++ b/include/linux/dax.h > @@ -41,4 +41,6 @@ static inline bool dax_mapping(struct address_space *ma= pping) > { > return mapping->host && IS_DAX(mapping->host); > } > +int dax_writeback_mapping_range(struct address_space *mapping, loff_t st= art, > + loff_t end); > #endif > diff --git a/mm/filemap.c b/mm/filemap.c > index 1e215fc..2e7c8d9 100644 > --- a/mm/filemap.c > +++ b/mm/filemap.c > @@ -482,6 +482,12 @@ int filemap_write_and_wait_range(struct address_spac= e *mapping, > { > int err =3D 0; >=20=20 > + if (dax_mapping(mapping) && mapping->nrexceptional) { > + err =3D dax_writeback_mapping_range(mapping, lstart, lend); > + if (err) > + return err; > + } > + > if (mapping->nrpages) { > err =3D __filemap_fdatawrite_range(mapping, lstart, lend, > WB_SYNC_ALL); > --=20 > 2.5.0 > > -- > To unsubscribe, send a message with 'unsubscribe linux-mm' in > the body to majordomo@kvack.org. For more info on Linux MM, > see: http://www.linux-mm.org/ . > Don't email: email@kvack.org --=-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iQEcBAEBCgAGBQJWtgQjAAoJELhyPTmIL6kBCwAIAJYQRJRSwkbJDZpwrfftBqwe mda1iK6TNeMcEqmObR8SUVr1wxAdEBRJPgPfbNZslKnTwISSqMh3TJIW1sG9uNq/ 6G8n7hxSFloCDz24dL6NLz6rmNHFkE6QPRCmhxjYoVY33tvc6UJUKk+F8BsQzIBH U8wY6ljtEkto8FZCbvs4RQyua8lf/pGfk5t8gZKhXPwpQNhUIe8fvfpwyuX+xcOV DMrHpKjz+PTksXn5bAGfgOfxPy+9aGHGa/f20n2galOe2o7HyO6kKVJZWfQ4ihA1 D0sG3MEPmRpk0JCB9z1E301s6CLZrg++ZEGuac2TrxYSWKjrLxBh17+ldfzbRzE= =tCyF -----END PGP SIGNATURE----- --=-=-=-- From investopedia-owner@s01.emaildodo.com Sat Feb 6 16:41:42 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: ** X-Spam-Status: No, score=2.7 required=5.0 tests=FS_LARGE_PERCENT2,HTML_MESSAGE, MIME_BASE64_BLANKS,T_DKIM_INVALID autolearn=no version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay3.corp.sgi.com [198.149.34.15]) by oss.sgi.com (Postfix) with ESMTP id A1F3E29DF5 for ; Sat, 6 Feb 2016 16:41:42 -0600 (CST) Received: from cuda.sgi.com (cuda1.sgi.com [192.48.157.11]) by relay3.corp.sgi.com (Postfix) with ESMTP id 3FB01AC002 for ; Sat, 6 Feb 2016 14:41:38 -0800 (PST) X-ASG-Debug-ID: 1454798496-04bdf079c3b5090001-NocioJ Received: from s01.emaildodo.com (s01.emaildodo.com [213.201.230.70]) by cuda.sgi.com with ESMTP id BqGcfmUGyBvNriAF for ; Sat, 06 Feb 2016 14:41:36 -0800 (PST) X-Barracuda-Envelope-From: investopedia-owner@s01.emaildodo.com X-Barracuda-Apparent-Source-IP: 213.201.230.70 Received: by s01.emaildodo.com (Postfix, from userid 48) id 1455534D2627; Sat, 6 Feb 2016 23:41:20 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha1; q=dns/txt; s=key1; t=1454798480; c=relaxed/relaxed; h=from:subject:reply-to:mime-version:to; d=emaildodo.com; bh=DmnQRdwWycmzU5zVs0YZLnQF4u0=; b=WJEsaArwJ1mlRCCWq0yxU65uwTHqM9Ak9WGfmV9pC8+i/KAFm4tgEJm21++jDhHx 4Kb46e/5FyWZwwIUsD/5DArQjVvSNN6Kaa8++E/DaWvKLMrR8GRhs8TBUJsoelhL alPo5Ddh7oonDWBX1QXCPthmId7HWsodafM3nYGl82Y= To: xfs@oss.sgi.com From: =?UTF-8?B?Q3VydGlzIElydmluZw==?= Subject: =?UTF-8?B?MjAwJSDQstC+0LfQstGA0LDRgtCwINC40L3QstC10YHRgg==?= =?UTF-8?B?0LjRhtC40Lk=?= Reply-To: curtis@lnvestopedia.com X-ASG-Orig-Subj: =?UTF-8?B?MjAwJSDQstC+0LfQstGA0LDRgtCwINC40L3QstC10YHRgg==?= =?UTF-8?B?0LjRhtC40Lk=?= Content-Transfer-Encoding: 8bit MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="b1_79d6e1b5525464cf619a324f0bb9a878" Message-Id: <20160206224138.1455534D2627@s01.emaildodo.com> Date: Sat, 6 Feb 2016 23:41:20 +0100 (CET) X-Barracuda-Connect: s01.emaildodo.com[213.201.230.70] X-Barracuda-Start-Time: 1454798496 X-Barracuda-URL: https://192.48.157.11:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-BRTS-Status: 1 X-Barracuda-Spam-Score: 2.10 X-Barracuda-Spam-Status: No, SCORE=2.10 using per-user scores of TAG_LEVEL=1000.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.7 tests=DKIM_SIGNED, DKIM_VERIFIED, FROM_EXCESS_BASE64, FROM_EXCESS_BASE64_2, FS_LARGE_PERCENT2, HTML_MESSAGE, MIME_BASE64_BLANKS X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.3.26812 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 1.04 FS_LARGE_PERCENT2 Larger than 100% in subj. -0.00 DKIM_VERIFIED Domain Keys Identified Mail: signature passes verification 0.00 DKIM_SIGNED Domain Keys Identified Mail: message has a signature 0.00 HTML_MESSAGE BODY: HTML included in message 0.00 MIME_BASE64_BLANKS RAW: Extra blank lines in base64 encoding 0.01 FROM_EXCESS_BASE64 From: base64 encoded unnecessarily 1.05 FROM_EXCESS_BASE64_2 From: base64 encoded unnecessarily --b1_79d6e1b5525464cf619a324f0bb9a878 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: base64 0J/RgNC40LLQtdGCCgrQryDQstCw0YjQuCDQu9C40YfQvdGL0LUg0JrQtdGA0YLQuNGBINC40Lcg 0LrQvtGC0L7RgNGL0YUg0Y/QstC70Y/QtdGC0YHRjyDQstC10LTRg9GJ0LjQvCDRgNC10YHRg9GA 0YHQvtC8INC00LvRjyDQuNC90LLQtdGB0YLQuNGA0L7QstCw0L3QuNGPINC+0LHRgNCw0LfQvtCy 0LDQvdC40Y8sINC70LjRh9C90YvRhSDRhNC40L3QsNC90YHQvtCyINC4INCw0L3QsNC70LjQt9Cw INGA0YvQvdC60LAsINC80Ysg0LTQsNC10Lwg0LLQvtC30LzQvtC20L3QvtGB0YLRjCDQvdC10LDQ utC60YDQtdC00LjRgtC+0LLQsNC90L3Ri9C1INC40L3QstC10YHRgtC+0YDRiywg0YDQvtC30L3Q uNGH0L3Ri9C1INC40L3QstC10YHRgtC+0YDRiyDQuNC70Lgg0LrRgtC+LdC70LjQsdC+INC00L7R gdGC0YPQvyDQuiDRgdC00LXQu9C+0Log0L/RgNGP0LzRi9GFINC40L3QstC10YHRgtC40YbQuNC5 LCDQuNC90LLQtdGB0YLQuNGA0L7QstCw0YLRjCDQsiDRh9Cw0YHRgtC90YvQuSDQutCw0L/QuNGC 0LDQuyDQutC+0LzQv9Cw0L3QuNC5LCDQvdCw0YDRj9C00YMg0YEg0LjQvdGB0YLQuNGC0YPRhtC4 0L7QvdCw0LvRjNC90YvQvNC4INC4INCw0LrQutGA0LXQtNC40YLQvtCy0LDQvdC90YvRhSDQuNC9 0LLQtdGB0YLQvtGA0L7QsiDRgSDQs9Cw0YDQsNC90YLQuNGA0L7QstCw0L3QvdC+0LkgMjAwJSDQ uNC70Lgg0LHQvtC70YzRiNC1ICjRgNC10L3RgtCw0LHQtdC70YzQvdC+0YHRgtGMKSDRgNC10L3R gtCw0LHQtdC70YzQvdC+0YHRgtGMINCy0L7Qt9Cy0YDQsNGC0LAg0LjQvdCy0LXRgdGC0LjRhtC4 0Lkg0YbQtdC70YwgPSAyMDDQpSDQvdCwINCy0LvQvtC20LXQvdC90YvQuSDQutCw0L/QuNGC0LDQ uywg0L3QtSDQv9GA0LjQstGP0LfQsNC90L3Ri9C5INC6INGA0YvQvdC60YMg0Lgg0LXQttC10LTQ vdC10LLQvdC+0Lkg0LLRi9C/0LvQsNGC0LUg0LTQuNCy0LjQtNC10L3QtNC+0LIg0LjQvdCy0LXR gdGC0L7RgNCw0LwuCtCl0L7RgtC40YLQtSDQuNC90LLQtdGB0YLQuNGA0L7QstCw0YLRjD8g0LfQ sNGC0LXQvCDQntGC0L/RgNCw0LLQuNGC0Ywg0LzQvdC1INC/0L4g0Y3Qu9C10LrRgtGA0L7QvdC9 0L7QuSDQv9C+0YfRgtC1INC4LArQryDRgSDQvdC10YLQtdGA0L/QtdC90LjQtdC8INC+0LbQuNC0 0LDRjiDRg9GB0LvRi9GI0LDRgtGMINC+0YIg0LLQsNGBCtChINCd0LDQuNC70YPRh9GI0LjQvNC4 INCf0L7QttC10LvQsNC90LjRj9C80LgKCtCa0LXRgNGC0LjRgSDQmNGA0LLQuNC90LMKCgoKSW52 ZXN0b3BlZGlhIFVTLCBBIERpdmlzaW9uIG9mIElBQy4xMTAgRSA0Mm5kIFN0LiBOZXcgWW9yaywg TlkgMTAwMTdDb3B5cmlnaHQgJmNvcHk7IDIwMTYsIEludmVzdG9wZWRpYSwgTExDLiBBbGwgUmln aHRzIFJlc2VydmVkCgoKCgpGb2xsb3cgVXM6CiZuYnNwOyZuYnNwOwoKCgoKCgoKCl8tXy1fLV8t XwpJZiB5b3Ugd2FudCB0byB1bnN1YnNjcmliZSBmcm9tIHRoaXMgR3JvdXAgY2xpY2sgaHR0cDov L3d3dy5lbWFpbGRvZG8uY29tL3Vuc3Vic2NyaWJlX290aGVyLnBocD9saXN0bmFtZT1pbnZlc3Rv cGVkaWEmZW1haWw9eGZzQG9zcy5zZ2kuY29tIA0KVG8gZmlsZSBhIGNvbXBsYWludCBwbGVhc2Ug c2VuZCBhbiBlTWFpbCB0bzogY29tcGxhaW50c0BlbWFpbGRvZG8uY29tDQooYW5kIGluY2x1ZGUg dGhlICBHcm91cCBuYW1lKQotXy1fLV8tXy0KCg== --b1_79d6e1b5525464cf619a324f0bb9a878 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: base64 PHAgc3R5bGU9Im1hcmdpbi1ib3R0b206IDEuMzVlbTsgbWFyZ2luLXRvcDogMHB4ICFpbXBvcnRh bnQ7IG1hcmdpbi1yaWdodDogMHB4ICFpbXBvcnRhbnQ7IG1hcmdpbi1sZWZ0OiAwcHggIWltcG9y dGFudDsgcGFkZGluZzogMHB4ICFpbXBvcnRhbnQ7Ij48c3BhbiBzdHlsZT0iZm9udC1mYW1pbHk6 IEFyaWFsLCBzYW5zLXNlcmlmOyBjb2xvcjogIzQ0NDQ0NDsiPjxzcGFuIHN0eWxlPSJmb250LXNp emU6IDE0cHg7IGxpbmUtaGVpZ2h0OiAxNi4xcHg7Ij7Qn9GA0LjQstC10YI8L3NwYW4+PC9zcGFu PjwvcD4KPHAgc3R5bGU9Im1hcmdpbi1ib3R0b206IDEuMzVlbTsgbWFyZ2luLXRvcDogMHB4ICFp bXBvcnRhbnQ7IG1hcmdpbi1yaWdodDogMHB4ICFpbXBvcnRhbnQ7IG1hcmdpbi1sZWZ0OiAwcHgg IWltcG9ydGFudDsgcGFkZGluZzogMHB4ICFpbXBvcnRhbnQ7Ij48c3BhbiBzdHlsZT0iZm9udC1m YW1pbHk6IEFyaWFsLCBzYW5zLXNlcmlmOyBjb2xvcjogIzQ0NDQ0NDsiPjxzcGFuIHN0eWxlPSJm b250LXNpemU6IDE0cHg7IGxpbmUtaGVpZ2h0OiAxNi4xcHg7Ij48YnIgLz48L3NwYW4+PC9zcGFu PjwvcD4KPHAgc3R5bGU9Im1hcmdpbi1ib3R0b206IDEuMzVlbTsgbWFyZ2luLXRvcDogMHB4ICFp bXBvcnRhbnQ7IG1hcmdpbi1yaWdodDogMHB4ICFpbXBvcnRhbnQ7IG1hcmdpbi1sZWZ0OiAwcHgg IWltcG9ydGFudDsgcGFkZGluZzogMHB4ICFpbXBvcnRhbnQ7Ij48c3BhbiBzdHlsZT0iZm9udC1m YW1pbHk6IEFyaWFsLCBzYW5zLXNlcmlmOyBjb2xvcjogIzQ0NDQ0NDsiPjxzcGFuIHN0eWxlPSJm b250LXNpemU6IDE0cHg7IGxpbmUtaGVpZ2h0OiAxNi4xcHg7Ij7QryDQstCw0YjQuCDQu9C40YfQ vdGL0LUg0JrQtdGA0YLQuNGBINC40Lcg0LrQvtGC0L7RgNGL0YUg0Y/QstC70Y/QtdGC0YHRjyDQ stC10LTRg9GJ0LjQvCDRgNC10YHRg9GA0YHQvtC8INC00LvRjyDQuNC90LLQtdGB0YLQuNGA0L7Q stCw0L3QuNGPINC+0LHRgNCw0LfQvtCy0LDQvdC40Y8sINC70LjRh9C90YvRhSDRhNC40L3QsNC9 0YHQvtCyINC4INCw0L3QsNC70LjQt9CwINGA0YvQvdC60LAsINC80Ysg0LTQsNC10Lwg0LLQvtC3 0LzQvtC20L3QvtGB0YLRjCDQvdC10LDQutC60YDQtdC00LjRgtC+0LLQsNC90L3Ri9C1INC40L3Q stC10YHRgtC+0YDRiywg0YDQvtC30L3QuNGH0L3Ri9C1INC40L3QstC10YHRgtC+0YDRiyDQuNC7 0Lgg0LrRgtC+LdC70LjQsdC+INC00L7RgdGC0YPQvyDQuiDRgdC00LXQu9C+0Log0L/RgNGP0LzR i9GFINC40L3QstC10YHRgtC40YbQuNC5LCDQuNC90LLQtdGB0YLQuNGA0L7QstCw0YLRjCDQsiDR h9Cw0YHRgtC90YvQuSDQutCw0L/QuNGC0LDQuyDQutC+0LzQv9Cw0L3QuNC5LCDQvdCw0YDRj9C0 0YMg0YEg0LjQvdGB0YLQuNGC0YPRhtC40L7QvdCw0LvRjNC90YvQvNC4INC4INCw0LrQutGA0LXQ tNC40YLQvtCy0LDQvdC90YvRhSDQuNC90LLQtdGB0YLQvtGA0L7QsiDRgSDQs9Cw0YDQsNC90YLQ uNGA0L7QstCw0L3QvdC+0LkgMjAwJSDQuNC70Lgg0LHQvtC70YzRiNC1ICjRgNC10L3RgtCw0LHQ tdC70YzQvdC+0YHRgtGMKSDRgNC10L3RgtCw0LHQtdC70YzQvdC+0YHRgtGMINCy0L7Qt9Cy0YDQ sNGC0LAg0LjQvdCy0LXRgdGC0LjRhtC40Lkg0YbQtdC70YwgPSAyMDDQpSDQvdCwINCy0LvQvtC2 0LXQvdC90YvQuSDQutCw0L/QuNGC0LDQuywg0L3QtSDQv9GA0LjQstGP0LfQsNC90L3Ri9C5INC6 INGA0YvQvdC60YMg0Lgg0LXQttC10LTQvdC10LLQvdC+0Lkg0LLRi9C/0LvQsNGC0LUg0LTQuNCy 0LjQtNC10L3QtNC+0LIg0LjQvdCy0LXRgdGC0L7RgNCw0LwuPC9zcGFuPjwvc3Bhbj48L3A+Cjxw IHN0eWxlPSJtYXJnaW4tYm90dG9tOiAxLjM1ZW07IG1hcmdpbi10b3A6IDBweCAhaW1wb3J0YW50 OyBtYXJnaW4tcmlnaHQ6IDBweCAhaW1wb3J0YW50OyBtYXJnaW4tbGVmdDogMHB4ICFpbXBvcnRh bnQ7IHBhZGRpbmc6IDBweCAhaW1wb3J0YW50OyI+PHNwYW4gc3R5bGU9ImZvbnQtc2l6ZTogMTRw eDsgbGluZS1oZWlnaHQ6IDE2LjFweDsgY29sb3I6ICM0NDQ0NDQ7IGZvbnQtZmFtaWx5OiBBcmlh bCwgc2Fucy1zZXJpZjsiPtCl0L7RgtC40YLQtSDQuNC90LLQtdGB0YLQuNGA0L7QstCw0YLRjD8g 0LfQsNGC0LXQvCDQntGC0L/RgNCw0LLQuNGC0Ywg0LzQvdC1INC/0L4g0Y3Qu9C10LrRgtGA0L7Q vdC90L7QuSDQv9C+0YfRgtC1INC4LDwvc3Bhbj48L3A+CjxwIHN0eWxlPSJtYXJnaW4tYm90dG9t OiAxLjM1ZW07IG1hcmdpbi10b3A6IDBweCAhaW1wb3J0YW50OyBtYXJnaW4tcmlnaHQ6IDBweCAh aW1wb3J0YW50OyBtYXJnaW4tbGVmdDogMHB4ICFpbXBvcnRhbnQ7IHBhZGRpbmc6IDBweCAhaW1w b3J0YW50OyI+PHNwYW4gc3R5bGU9ImZvbnQtc2l6ZTogMTRweDsgbGluZS1oZWlnaHQ6IDE2LjFw eDsgY29sb3I6ICM0NDQ0NDQ7IGZvbnQtZmFtaWx5OiBBcmlhbCwgc2Fucy1zZXJpZjsiPtCvINGB INC90LXRgtC10YDQv9C10L3QuNC10Lwg0L7QttC40LTQsNGOINGD0YHQu9GL0YjQsNGC0Ywg0L7R giDQstCw0YE8L3NwYW4+PC9wPgo8cCBzdHlsZT0ibWFyZ2luLWJvdHRvbTogMS4zNWVtOyBtYXJn aW4tdG9wOiAwcHggIWltcG9ydGFudDsgbWFyZ2luLXJpZ2h0OiAwcHggIWltcG9ydGFudDsgbWFy Z2luLWxlZnQ6IDBweCAhaW1wb3J0YW50OyBwYWRkaW5nOiAwcHggIWltcG9ydGFudDsiPjxzcGFu IHN0eWxlPSJjb2xvcjogIzQ0NDQ0NDsgZm9udC1mYW1pbHk6IEFyaWFsLCBzYW5zLXNlcmlmOyBm b250LXNpemU6IDE0cHg7IGxpbmUtaGVpZ2h0OiAxNi4xcHg7Ij7QoSDQndCw0LjQu9GD0YfRiNC4 0LzQuCDQn9C+0LbQtdC70LDQvdC40Y/QvNC4PC9zcGFuPjwvcD4KPHAgc3R5bGU9Im1hcmdpbi1i b3R0b206IDEuMzVlbTsgbWFyZ2luLXRvcDogMHB4ICFpbXBvcnRhbnQ7IG1hcmdpbi1yaWdodDog MHB4ICFpbXBvcnRhbnQ7IG1hcmdpbi1sZWZ0OiAwcHggIWltcG9ydGFudDsgcGFkZGluZzogMHB4 ICFpbXBvcnRhbnQ7Ij48L3A+CjxwIHN0eWxlPSJtYXJnaW4tYm90dG9tOiAxLjM1ZW07IG1hcmdp bi10b3A6IDBweCAhaW1wb3J0YW50OyBtYXJnaW4tcmlnaHQ6IDBweCAhaW1wb3J0YW50OyBtYXJn aW4tbGVmdDogMHB4ICFpbXBvcnRhbnQ7IHBhZGRpbmc6IDBweCAhaW1wb3J0YW50OyI+PHNwYW4g c3R5bGU9ImNvbG9yOiAjNDQ0NDQ0OyBmb250LWZhbWlseTogQXJpYWwsIHNhbnMtc2VyaWY7IGZv bnQtc2l6ZTogMTRweDsgbGluZS1oZWlnaHQ6IDE2LjFweDsiPtCa0LXRgNGC0LjRgSDQmNGA0LLQ uNC90LM8L3NwYW4+PC9wPgo8dGFibGUgc3R5bGU9ImxpbmUtaGVpZ2h0OiAxOC40NnB4OyBmb250 LXNpemU6IDEzcHg7IGZvbnQtZmFtaWx5OiBzb3VyY2Vfc2Fuc19wcm9saWdodCwgSGVsdmV0aWNh LCBBcmlhbCwgc2Fucy1zZXJpZjsgd2lkdGg6IDcyOHB4OyBjb2xvcjogI2ZmZmZmZjsgYmFja2dy b3VuZC1jb2xvcjogIzI2MmEzOTsiIGJvcmRlcj0iMCIgY2VsbHNwYWNpbmc9IjAiIGNlbGxwYWRk aW5nPSIwIiBhbGlnbj0iY2VudGVyIj4KPHRib2R5IHN0eWxlPSJsaW5lLWhlaWdodDogMTguNDZw eDsiPgo8dHIgc3R5bGU9ImxpbmUtaGVpZ2h0OiAxOC40NnB4OyI+Cjx0ZCBzdHlsZT0iZm9udC1m YW1pbHk6IGFyaWFsLCBzYW5zLXNlcmlmOyBtYXJnaW46IDBweDsgbGluZS1oZWlnaHQ6IDE0LjJw eDsgcGFkZGluZzogMjBweCAyMHB4IDIwcHggODBweDsgdmVydGljYWwtYWxpZ246IG1pZGRsZTsi PjxiciBzdHlsZT0ibGluZS1oZWlnaHQ6IDE0LjJweDsiIC8+SW52ZXN0b3BlZGlhIFVTLCBBIERp dmlzaW9uIG9mIElBQy48YnIgc3R5bGU9ImxpbmUtaGVpZ2h0OiAxNC4ycHg7IiAvPjExMCBFIDQy bmQgU3QuIE5ldyBZb3JrLCBOWSAxMDAxNzxiciBzdHlsZT0ibGluZS1oZWlnaHQ6IDE0LjJweDsi IC8+PGEgc3R5bGU9ImNvbG9yOiAjZmZmZmZmOyBsaW5lLWhlaWdodDogMTQuMnB4OyBmb250LXdl aWdodDogaW5oZXJpdDsgdGV4dC1kZWNvcmF0aW9uOiBub25lOyIgaHJlZj0iaHR0cDovL2xpbmsu aW52ZXN0b3BlZGlhLmNvbS9jbGljay82MDAxMzk5LjQ0NTgyL2FIUjBjRG92TDNkM2R5NXBiblps YzNSdmNHVmthV0V1WTI5dEwyTnZjbkF2WTI5d2VYSnBaMmgwTG1GemNIZ19kWFJ0WDNOdmRYSmpa VDFwYm5abGMzUnBibWN0WW1GemFXTnovNTZhNTU2OTY5OGNiNzU0NDJmOGI0NTk4QjgwZTk1NWIx IiB0YXJnZXQ9Il9ibGFuayI+Q29weXJpZ2h0ICZjb3B5OyAyMDE2LCBJbnZlc3RvcGVkaWEsIExM Qy4gQWxsIFJpZ2h0cyBSZXNlcnZlZDwvYT48L3RkPgo8dGQgc3R5bGU9ImZvbnQtZmFtaWx5OiBh cmlhbCwgc2Fucy1zZXJpZjsgbWFyZ2luOiAwcHg7IGxpbmUtaGVpZ2h0OiAxNC4ycHg7IHRleHQt YWxpZ246IHJpZ2h0OyBwYWRkaW5nOiAyMHB4IDgwcHggMjBweCAyMHB4OyB2ZXJ0aWNhbC1hbGln bjogbWlkZGxlOyI+Cjx0YWJsZSBzdHlsZT0ibGluZS1oZWlnaHQ6IDE0LjJweDsiIGJvcmRlcj0i MCIgY2VsbHNwYWNpbmc9IjAiIGNlbGxwYWRkaW5nPSIwIiB3aWR0aD0iMTAwJSI+Cjx0Ym9keSBz dHlsZT0ibGluZS1oZWlnaHQ6IDE0LjJweDsiPgo8dHIgc3R5bGU9ImxpbmUtaGVpZ2h0OiAxNC4y cHg7Ij4KPHRkIHN0eWxlPSJmb250LWZhbWlseTogYXJpYWwsIHNhbnMtc2VyaWY7IG1hcmdpbjog MHB4OyBsaW5lLWhlaWdodDogMTQuMnB4OyB2ZXJ0aWNhbC1hbGlnbjogbWlkZGxlOyB3aWR0aDog OTBweDsiPkZvbGxvdyBVczo8L3RkPgo8dGQgc3R5bGU9ImZvbnQtZmFtaWx5OiBhcmlhbCwgc2Fu cy1zZXJpZjsgbWFyZ2luOiAwcHg7IGxpbmUtaGVpZ2h0OiAxNC4ycHg7IHZlcnRpY2FsLWFsaWdu OiBtaWRkbGU7IHdpZHRoOiA5MHB4OyI+PGEgc3R5bGU9ImNvbG9yOiAjMTE1NWNjOyBsaW5lLWhl aWdodDogMTQuMnB4OyBmb250LXdlaWdodDogaW5oZXJpdDsgYm9yZGVyOiBub25lOyIgaHJlZj0i aHR0cDovL2xpbmsuaW52ZXN0b3BlZGlhLmNvbS9jbGljay82MDAxMzk5LjQ0NTgyL2FIUjBjRG92 TDNkM2R5NW1ZV05sWW05dmF5NWpiMjB2U1c1MlpYTjBiM0JsWkdsaFAzVjBiVjl6YjNWeVkyVTlh VzUyWlhOMGFXNW5MV0poYzJsamN3LzU2YTU1Njk2OThjYjc1NDQyZjhiNDU5OEJhY2NhZGYzYSIg dGFyZ2V0PSJfYmxhbmsiPjxpbWcgY2xhc3M9IkNUb1dVZCIgc3R5bGU9ImxpbmUtaGVpZ2h0OiAx NC4ycHg7IGJvcmRlcjogbm9uZTsiIHNyYz0iaHR0cHM6Ly9jaTYuZ29vZ2xldXNlcmNvbnRlbnQu Y29tL3Byb3h5L09paUVsb1BjZWlNWFh6OUZ0VXFkSV9MekpjR0RaeC1YTTl2cGg5TXVfS1h2cnBR TlI4QWw3emZVS0hnRjJjTzBxRlV6TlFrNjFqU1Y1c1F5Y2RldHEtVllMWUFnUGVrV0dZczdRREJV dXdRPXMwLWQtZTEtZnQjaHR0cDovL2kuaW52ZXN0b3BlZGlhLmNvbS9uZXdzbGV0dGVyc192Mi9p Y29uX2ZhY2Vib29rLnBuZyIgYWx0PSIiIC8+PC9hPiZuYnNwOzxhIHN0eWxlPSJjb2xvcjogIzEx NTVjYzsgbGluZS1oZWlnaHQ6IDE0LjJweDsgZm9udC13ZWlnaHQ6IGluaGVyaXQ7IGJvcmRlcjog bm9uZTsiIGhyZWY9Imh0dHA6Ly9saW5rLmludmVzdG9wZWRpYS5jb20vY2xpY2svNjAwMTM5OS40 NDU4Mi9hSFIwY0hNNkx5OTBkMmwwZEdWeUxtTnZiUzlwYm5abGMzUnZjR1ZrYVdFX2RYUnRYM052 ZFhKalpUMXBiblpsYzNScGJtY3RZbUZ6YVdOei81NmE1NTY5Njk4Y2I3NTQ0MmY4YjQ1OThCMjAy ZTZjMTUiIHRhcmdldD0iX2JsYW5rIj48aW1nIGNsYXNzPSJDVG9XVWQiIHN0eWxlPSJsaW5lLWhl aWdodDogMTQuMnB4OyBib3JkZXI6IG5vbmU7IiBzcmM9Imh0dHBzOi8vY2kzLmdvb2dsZXVzZXJj b250ZW50LmNvbS9wcm94eS9BSTNFZXh5U3ZNLVgyQW1aRGdGT3gweUFDUUxEcU9qOHZ4STE4S2lo bkNOMmlpTUNpVVdRM3VTU05iaE91QWN5MDZ1SmpaRzR2alAtMnh3NlhjUnlNMUxYbGRGb2h3cXJm X08tUjJFUldRPXMwLWQtZTEtZnQjaHR0cDovL2kuaW52ZXN0b3BlZGlhLmNvbS9uZXdzbGV0dGVy c192Mi9pY29uX3R3aXR0ZXIucG5nIiBhbHQ9IiIgLz48L2E+Jm5ic3A7PGEgc3R5bGU9ImNvbG9y OiAjMTE1NWNjOyBsaW5lLWhlaWdodDogMTQuMnB4OyBmb250LXdlaWdodDogaW5oZXJpdDsgYm9y ZGVyOiBub25lOyIgaHJlZj0iaHR0cDovL2xpbmsuaW52ZXN0b3BlZGlhLmNvbS9jbGljay82MDAx Mzk5LjQ0NTgyL2FIUjBjSE02THk5d2JIVnpMbWR2YjJkc1pTNWpiMjB2SzJsdWRtVnpkRzl3WldS cFlTOF9kWFJ0WDNOdmRYSmpaVDFwYm5abGMzUnBibWN0WW1GemFXTnovNTZhNTU2OTY5OGNiNzU0 NDJmOGI0NTk4QjUyMmRhM2RjIiB0YXJnZXQ9Il9ibGFuayI+PGltZyBjbGFzcz0iQ1RvV1VkIiBz dHlsZT0ibGluZS1oZWlnaHQ6IDE0LjJweDsgYm9yZGVyOiBub25lOyIgc3JjPSJodHRwczovL2Np My5nb29nbGV1c2VyY29udGVudC5jb20vcHJveHkvX3RmVGZZOUFlVjBSUFVnWmZLVlptM0xLZ1Vl NXhReEZUOEdua0UxbmVsalFrdDh3Qlc0Sm0tS3ZtYW1ET1ZseWlBUGdWdDd1LWFEclBMWVRFRHpu bENtN2N1Tnp1VDRqQ0M4SGZYY1g9czAtZC1lMS1mdCNodHRwOi8vaS5pbnZlc3RvcGVkaWEuY29t L25ld3NsZXR0ZXJzX3YyL2ljb25fZ29vZ2xlLnBuZyIgYWx0PSIiIC8+PC9hPjwvdGQ+CjwvdHI+ CjwvdGJvZHk+CjwvdGFibGU+CjwvdGQ+CjwvdHI+CjwvdGJvZHk+CjwvdGFibGU+CgoKCjxhIG5h bWU9ImVEb2RvRm9vdFN0YXJ0Ij48L2E+Cjxicj48cD48L3A+DQo8aHIgc2l6ZT0iMSIgYWxpZ249 ImxlZnQiIHN0eWxlPSJtYXJnaW46MHB4IGF1dG87Y29sb3I6ICM2OTk7Ii8+DQo8c3BhbiBzdHls ZT0iY29sb3I6ICM2NjY2NjY7Zm9udC1mYW1pbHk6IEFyaWFsLCBIZWx2ZXRpY2EsIHNhbnMtc2Vy aWY7Zm9udC1zaXplOjEwcHgiPg0KDQpJZiB5b3Ugd2FudCB0byB1bnN1YnNjcmliZSBmcm9tIHRo aXMgaW52ZXN0b3BlZGlhQGVtYWlsZG9kby5jb20gR3JvdXAgY2xpY2sgIA0KPGEgaHJlZj0iaHR0 cDovL3d3dy5lbWFpbGRvZG8uY29tL3Vuc3Vic2NyaWJlX290aGVyLnBocD9saXN0bmFtZT1pbnZl c3RvcGVkaWEmZW1haWw9eGZzQG9zcy5zZ2kuY29tIj5oZXJlPC9hPjxiciAvPg0KVG8gZmlsZSBh IGNvbXBsYWludCBwbGVhc2Ugc2VuZCBhbiBlTWFpbCB0bzogIA0KPHNwYW4gc3R5bGU9ImNvbG9y OmJsdWUiPjxhIGhyZWY9Im1haWx0bzpjb21wbGFpbnRzQGVtYWlsZG9kby5jb20/c3ViamVjdD1U aGlzIGlzIGEgY29tcGxhaW50IGFib3V0IGludmVzdG9wZWRpYUBlbWFpbGRvZG8uY29tJmFtcDti b2R5PUhpLCUwRCUwQSUwRCUwQQ0KSSB3b3VsZCBsaWtlIHRvIGZpbGUgYSBjb21wbGFpbnQgYWJv dXQgdGhlIGludmVzdG9wZWRpYUBlbWFpbGRvZG8uY29tIGdyb3VwLiAlMEQlMEElMEQlMEFJIGFt IG5vdCBoYXBweSBhYm91dCB0aGUgZmFjdCB0aGF0IC4uLi4uLi4lMEQlMEElMEQlMEFXb3VsZCB5 b3UgYmUgc28ga2luZCB0byBmb2xsb3cgdGhpcyB1cCA/JTBEJTBBJTBEJTBBVGhhbmtzLCUwRCUw QSI+Y29tcGxhaW50c0BlbWFpbGRvZG8uY29tPC9hPjwvc3Bhbj48aW1nIHNyYz0iaHR0cHM6Ly93 d3cuZW1haWxkb2RvLmNvbS90cmFja2VyLnBocD9jcElkPTE1NDU2Jm1JZD0yMDg4MjI0Ij48YnI+ CjxhIG5hbWU9ImVEb2RvRm9vdEVuZCI+PC9hPgo= --b1_79d6e1b5525464cf619a324f0bb9a878-- From ross.zwisler@linux.intel.com Sun Feb 7 01:19:36 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=ham version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay1.corp.sgi.com [137.38.102.111]) by oss.sgi.com (Postfix) with ESMTP id 752457CA3 for ; Sun, 7 Feb 2016 01:19:36 -0600 (CST) Received: from cuda.sgi.com (cuda2.sgi.com [192.48.176.25]) by relay1.corp.sgi.com (Postfix) with ESMTP id 6739F8F8039 for ; Sat, 6 Feb 2016 23:19:33 -0800 (PST) X-ASG-Debug-ID: 1454829571-04cbb04cf9f9de0001-NocioJ Received: from mga03.intel.com (mga03.intel.com [134.134.136.65]) by cuda.sgi.com with ESMTP id 9s400sPCSjgcOWvg for ; Sat, 06 Feb 2016 23:19:31 -0800 (PST) X-Barracuda-Envelope-From: ross.zwisler@linux.intel.com X-Barracuda-Apparent-Source-IP: 134.134.136.65 X-ASG-Whitelist: Client Received: from orsmga003.jf.intel.com ([10.7.209.27]) by orsmga103.jf.intel.com with ESMTP; 06 Feb 2016 23:19:31 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.22,409,1449561600"; d="scan'208";a="741902342" Received: from rzwisler-desk.amr.corp.intel.com (HELO phyrexia.intel.com) ([10.254.103.197]) by orsmga003.jf.intel.com with ESMTP; 06 Feb 2016 23:19:30 -0800 From: Ross Zwisler To: linux-kernel@vger.kernel.org Cc: Ross Zwisler , "Theodore Ts'o" , Alexander Viro , Andreas Dilger , Andrew Morton , Dan Williams , Dave Chinner , Jan Kara , Matthew Wilcox , linux-ext4@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux-mm@kvack.org, linux-nvdimm@lists.01.org, xfs@oss.sgi.com Subject: [PATCH 0/2] DAX bdev fixes - move flushing calls to FS Date: Sun, 7 Feb 2016 00:19:11 -0700 X-ASG-Orig-Subj: [PATCH 0/2] DAX bdev fixes - move flushing calls to FS Message-Id: <1454829553-29499-1-git-send-email-ross.zwisler@linux.intel.com> X-Mailer: git-send-email 2.5.0 X-Barracuda-Connect: mga03.intel.com[134.134.136.65] X-Barracuda-Start-Time: 1454829571 X-Barracuda-URL: https://192.48.176.25:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-BRTS-Status: 1 The first patch in the series just adds a bdev argument to dax_clear_blocks(), and should be relatively straightforward. The second patch is slightly more controversial. During testing of raw block devices + DAX I noticed that the struct block_device that we were using for DAX operations was incorrect. For the fault handlers, etc. we can just get the correct bdev via get_block(), which is passed in as a function pointer, but for the flushing code we don't have access to get_block(). This is also an issue for XFS real-time devices, whenever we get those working. In short, somehow we need to get dax_writeback_mapping_range() a valid bdev. Right now it is called via filemap_write_and_wait_range(), which can't provide either the bdev nor a get_block() function pointer. So, our options seem to be: a) Move the calls to dax_writeback_mapping_range() into the filesystems. This is implemented by patch 2 in this series. b) Keep the calls to dax_writeback_mapping_range() in the mm code, and provide a generic way to ask a filesystem for an inode's bdev. I did a version of this using a superblock operation here: https://lkml.org/lkml/2016/2/2/941 It has been noted that we may need to expand the coverage of our DAX flushing code to include support for the sync() and syncfs() userspace calls. This is still under discussion, but if we do end up needing to add support for sync(), I don't think that it is v4.5 material for the reasons stated here: https://lkml.org/lkml/2016/2/4/962 I think that for v4.5 we either need patch 2 of this series, or the get_bdev() patch listed in for solution b) above. Ross Zwisler (2): dax: pass bdev argument to dax_clear_blocks() dax: move writeback calls into the filesystems fs/block_dev.c | 7 +++++++ fs/dax.c | 9 ++++----- fs/ext2/file.c | 10 ++++++++++ fs/ext2/inode.c | 5 +++-- fs/ext4/fsync.c | 10 +++++++++- fs/xfs/xfs_aops.c | 2 +- fs/xfs/xfs_aops.h | 1 + fs/xfs/xfs_bmap_util.c | 4 +++- fs/xfs/xfs_file.c | 12 ++++++++++-- include/linux/dax.h | 7 ++++--- mm/filemap.c | 6 ------ 11 files changed, 52 insertions(+), 21 deletions(-) -- 2.5.0 From ross.zwisler@linux.intel.com Sun Feb 7 01:19:38 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=ham version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay3.corp.sgi.com [198.149.34.15]) by oss.sgi.com (Postfix) with ESMTP id 2AB5A7CA3 for ; Sun, 7 Feb 2016 01:19:38 -0600 (CST) Received: from cuda.sgi.com (cuda2.sgi.com [192.48.176.25]) by relay3.corp.sgi.com (Postfix) with ESMTP id A20EDAC001 for ; Sat, 6 Feb 2016 23:19:34 -0800 (PST) X-ASG-Debug-ID: 1454829571-04cbb04cf9f9de0002-NocioJ Received: from mga03.intel.com (mga03.intel.com [134.134.136.65]) by cuda.sgi.com with ESMTP id LrydzCQQ3lH43TRJ for ; Sat, 06 Feb 2016 23:19:32 -0800 (PST) X-Barracuda-Envelope-From: ross.zwisler@linux.intel.com X-Barracuda-Apparent-Source-IP: 134.134.136.65 X-ASG-Whitelist: Client Received: from orsmga003.jf.intel.com ([10.7.209.27]) by orsmga103.jf.intel.com with ESMTP; 06 Feb 2016 23:19:31 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.22,409,1449561600"; d="scan'208";a="741902346" Received: from rzwisler-desk.amr.corp.intel.com (HELO phyrexia.intel.com) ([10.254.103.197]) by orsmga003.jf.intel.com with ESMTP; 06 Feb 2016 23:19:31 -0800 From: Ross Zwisler To: linux-kernel@vger.kernel.org Cc: Ross Zwisler , "Theodore Ts'o" , Alexander Viro , Andreas Dilger , Andrew Morton , Dan Williams , Dave Chinner , Jan Kara , Matthew Wilcox , linux-ext4@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux-mm@kvack.org, linux-nvdimm@lists.01.org, xfs@oss.sgi.com Subject: [PATCH 1/2] dax: pass bdev argument to dax_clear_blocks() Date: Sun, 7 Feb 2016 00:19:12 -0700 X-ASG-Orig-Subj: [PATCH 1/2] dax: pass bdev argument to dax_clear_blocks() Message-Id: <1454829553-29499-2-git-send-email-ross.zwisler@linux.intel.com> X-Mailer: git-send-email 2.5.0 In-Reply-To: <1454829553-29499-1-git-send-email-ross.zwisler@linux.intel.com> References: <1454829553-29499-1-git-send-email-ross.zwisler@linux.intel.com> X-Barracuda-Connect: mga03.intel.com[134.134.136.65] X-Barracuda-Start-Time: 1454829572 X-Barracuda-URL: https://192.48.176.25:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-BRTS-Status: 1 dax_clear_blocks() needs a valid struct block_device and previously it was using inode->i_sb->s_bdev in all cases. This is correct for normal inodes on mounted ext2, ext4 and XFS filesystems, but is incorrect for DAX raw block devices and for XFS real-time devices. Instead, have the caller pass in a struct block_device pointer which it knows to be correct. Signed-off-by: Ross Zwisler --- fs/dax.c | 4 ++-- fs/ext2/inode.c | 5 +++-- fs/xfs/xfs_aops.c | 2 +- fs/xfs/xfs_aops.h | 1 + fs/xfs/xfs_bmap_util.c | 4 +++- include/linux/dax.h | 3 ++- 6 files changed, 12 insertions(+), 7 deletions(-) diff --git a/fs/dax.c b/fs/dax.c index 227974a..4592241 100644 --- a/fs/dax.c +++ b/fs/dax.c @@ -83,9 +83,9 @@ struct page *read_dax_sector(struct block_device *bdev, sector_t n) * and hence this means the stack from this point must follow GFP_NOFS * semantics for all operations. */ -int dax_clear_blocks(struct inode *inode, sector_t block, long _size) +int dax_clear_blocks(struct inode *inode, struct block_device *bdev, + sector_t block, long _size) { - struct block_device *bdev = inode->i_sb->s_bdev; struct blk_dax_ctl dax = { .sector = block << (inode->i_blkbits - 9), .size = _size, diff --git a/fs/ext2/inode.c b/fs/ext2/inode.c index 338eefd..277a32b 100644 --- a/fs/ext2/inode.c +++ b/fs/ext2/inode.c @@ -737,8 +737,9 @@ static int ext2_get_blocks(struct inode *inode, * so that it's not found by another thread before it's * initialised */ - err = dax_clear_blocks(inode, le32_to_cpu(chain[depth-1].key), - 1 << inode->i_blkbits); + err = dax_clear_blocks(inode, inode->i_sb->s_bdev, + le32_to_cpu(chain[depth-1].key), + 1 << inode->i_blkbits); if (err) { mutex_unlock(&ei->truncate_mutex); goto cleanup; diff --git a/fs/xfs/xfs_aops.c b/fs/xfs/xfs_aops.c index 379c089..fc20518 100644 --- a/fs/xfs/xfs_aops.c +++ b/fs/xfs/xfs_aops.c @@ -55,7 +55,7 @@ xfs_count_page_state( } while ((bh = bh->b_this_page) != head); } -STATIC struct block_device * +struct block_device * xfs_find_bdev_for_inode( struct inode *inode) { diff --git a/fs/xfs/xfs_aops.h b/fs/xfs/xfs_aops.h index f6ffc9a..a4343c6 100644 --- a/fs/xfs/xfs_aops.h +++ b/fs/xfs/xfs_aops.h @@ -62,5 +62,6 @@ int xfs_get_blocks_dax_fault(struct inode *inode, sector_t offset, struct buffer_head *map_bh, int create); extern void xfs_count_page_state(struct page *, int *, int *); +extern struct block_device *xfs_find_bdev_for_inode(struct inode *); #endif /* __XFS_AOPS_H__ */ diff --git a/fs/xfs/xfs_bmap_util.c b/fs/xfs/xfs_bmap_util.c index 07ef29b..f722ba2 100644 --- a/fs/xfs/xfs_bmap_util.c +++ b/fs/xfs/xfs_bmap_util.c @@ -73,9 +73,11 @@ xfs_zero_extent( xfs_daddr_t sector = xfs_fsb_to_db(ip, start_fsb); sector_t block = XFS_BB_TO_FSBT(mp, sector); ssize_t size = XFS_FSB_TO_B(mp, count_fsb); + struct inode *inode = VFS_I(ip); if (IS_DAX(VFS_I(ip))) - return dax_clear_blocks(VFS_I(ip), block, size); + return dax_clear_blocks(inode, xfs_find_bdev_for_inode(inode), + block, size); /* * let the block layer decide on the fastest method of diff --git a/include/linux/dax.h b/include/linux/dax.h index 8204c3d..bad27b0 100644 --- a/include/linux/dax.h +++ b/include/linux/dax.h @@ -7,7 +7,8 @@ ssize_t dax_do_io(struct kiocb *, struct inode *, struct iov_iter *, loff_t, get_block_t, dio_iodone_t, int flags); -int dax_clear_blocks(struct inode *, sector_t block, long size); +int dax_clear_blocks(struct inode *inode, struct block_device *bdev, + sector_t block, long _size); int dax_zero_page_range(struct inode *, loff_t from, unsigned len, get_block_t); int dax_truncate_page(struct inode *, loff_t from, get_block_t); int dax_fault(struct vm_area_struct *, struct vm_fault *, get_block_t, -- 2.5.0 From ross.zwisler@linux.intel.com Sun Feb 7 01:19:37 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=ham version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay2.corp.sgi.com [137.38.102.29]) by oss.sgi.com (Postfix) with ESMTP id 6F8D47CA4 for ; Sun, 7 Feb 2016 01:19:37 -0600 (CST) Received: from cuda.sgi.com (cuda2.sgi.com [192.48.176.25]) by relay2.corp.sgi.com (Postfix) with ESMTP id 52982304032 for ; Sat, 6 Feb 2016 23:19:34 -0800 (PST) X-ASG-Debug-ID: 1454829572-04cbb04cfbf9df0001-NocioJ Received: from mga03.intel.com (mga03.intel.com [134.134.136.65]) by cuda.sgi.com with ESMTP id jZYAuZ44tW5D7RGK for ; Sat, 06 Feb 2016 23:19:33 -0800 (PST) X-Barracuda-Envelope-From: ross.zwisler@linux.intel.com X-Barracuda-Apparent-Source-IP: 134.134.136.65 X-ASG-Whitelist: Client Received: from orsmga003.jf.intel.com ([10.7.209.27]) by orsmga103.jf.intel.com with ESMTP; 06 Feb 2016 23:19:32 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.22,409,1449561600"; d="scan'208";a="741902350" Received: from rzwisler-desk.amr.corp.intel.com (HELO phyrexia.intel.com) ([10.254.103.197]) by orsmga003.jf.intel.com with ESMTP; 06 Feb 2016 23:19:31 -0800 From: Ross Zwisler To: linux-kernel@vger.kernel.org Cc: Ross Zwisler , "Theodore Ts'o" , Alexander Viro , Andreas Dilger , Andrew Morton , Dan Williams , Dave Chinner , Jan Kara , Matthew Wilcox , linux-ext4@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux-mm@kvack.org, linux-nvdimm@lists.01.org, xfs@oss.sgi.com Subject: [PATCH 2/2] dax: move writeback calls into the filesystems Date: Sun, 7 Feb 2016 00:19:13 -0700 X-ASG-Orig-Subj: [PATCH 2/2] dax: move writeback calls into the filesystems Message-Id: <1454829553-29499-3-git-send-email-ross.zwisler@linux.intel.com> X-Mailer: git-send-email 2.5.0 In-Reply-To: <1454829553-29499-1-git-send-email-ross.zwisler@linux.intel.com> References: <1454829553-29499-1-git-send-email-ross.zwisler@linux.intel.com> X-Barracuda-Connect: mga03.intel.com[134.134.136.65] X-Barracuda-Start-Time: 1454829572 X-Barracuda-URL: https://192.48.176.25:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-BRTS-Status: 1 Previously calls to dax_writeback_mapping_range() for all DAX filesystems (ext2, ext4 & xfs) were centralized in filemap_write_and_wait_range(). dax_writeback_mapping_range() needs a struct block_device, and it used to get that from inode->i_sb->s_bdev. This is correct for normal inodes mounted on ext2, ext4 and XFS filesystems, but is incorrect for DAX raw block devices and for XFS real-time files. Instead, call dax_writeback_mapping_range() directly from the filesystem or raw block device fsync/msync code so that they can supply us with a valid block device. It should be noted that this will reduce the number of calls to dax_writeback_mapping_range() because filemap_write_and_wait_range() is called in the various filesystems for operations other than just fsync/msync. Both ext4 & XFS call filemap_write_and_wait_range() outside of ->fsync for hole punch, truncate, and block relocation (xfs_shift_file_space() && ext4_collapse_range()/ext4_insert_range()). I don't believe that these extra flushes are necessary in the DAX case. In the page cache case when we have dirty data in the page cache, that data will be actively lost if we evict a dirty page cache page without flushing it to media first. For DAX, though, the data will remain consistent with the physical address to which it was written regardless of whether it's in the processor cache or not - really the only reason I see to flush is in response to a fsync or msync so that our data is durable on media in case of a power loss. The case where we could throw dirty data out of the page cache and essentially lose writes simply doesn't exist. Signed-off-by: Ross Zwisler --- fs/block_dev.c | 7 +++++++ fs/dax.c | 5 ++--- fs/ext2/file.c | 10 ++++++++++ fs/ext4/fsync.c | 10 +++++++++- fs/xfs/xfs_file.c | 12 ++++++++++-- include/linux/dax.h | 4 ++-- mm/filemap.c | 6 ------ 7 files changed, 40 insertions(+), 14 deletions(-) diff --git a/fs/block_dev.c b/fs/block_dev.c index fa0507a..312ad44 100644 --- a/fs/block_dev.c +++ b/fs/block_dev.c @@ -356,8 +356,15 @@ int blkdev_fsync(struct file *filp, loff_t start, loff_t end, int datasync) { struct inode *bd_inode = bdev_file_inode(filp); struct block_device *bdev = I_BDEV(bd_inode); + struct address_space *mapping = bd_inode->i_mapping; int error; + if (dax_mapping(mapping) && mapping->nrexceptional) { + error = dax_writeback_mapping_range(mapping, bdev, start, end); + if (error) + return error; + } + error = filemap_write_and_wait_range(filp->f_mapping, start, end); if (error) return error; diff --git a/fs/dax.c b/fs/dax.c index 4592241..4b5006a 100644 --- a/fs/dax.c +++ b/fs/dax.c @@ -484,11 +484,10 @@ static int dax_writeback_one(struct block_device *bdev, * end]. This is required by data integrity operations to ensure file data is * on persistent storage prior to completion of the operation. */ -int dax_writeback_mapping_range(struct address_space *mapping, loff_t start, - loff_t end) +int dax_writeback_mapping_range(struct address_space *mapping, + struct block_device *bdev, loff_t start, loff_t end) { struct inode *inode = mapping->host; - struct block_device *bdev = inode->i_sb->s_bdev; pgoff_t start_index, end_index, pmd_index; pgoff_t indices[PAGEVEC_SIZE]; struct pagevec pvec; diff --git a/fs/ext2/file.c b/fs/ext2/file.c index 2c88d68..d1abf53 100644 --- a/fs/ext2/file.c +++ b/fs/ext2/file.c @@ -162,6 +162,16 @@ int ext2_fsync(struct file *file, loff_t start, loff_t end, int datasync) int ret; struct super_block *sb = file->f_mapping->host->i_sb; struct address_space *mapping = sb->s_bdev->bd_inode->i_mapping; +#ifdef CONFIG_FS_DAX + struct address_space *inode_mapping = file->f_inode->i_mapping; + + if (dax_mapping(inode_mapping) && inode_mapping->nrexceptional) { + ret = dax_writeback_mapping_range(inode_mapping, sb->s_bdev, + start, end); + if (ret) + return ret; + } +#endif ret = generic_file_fsync(file, start, end, datasync); if (ret == -EIO || test_and_clear_bit(AS_EIO, &mapping->flags)) { diff --git a/fs/ext4/fsync.c b/fs/ext4/fsync.c index 8850254..e9cf53b 100644 --- a/fs/ext4/fsync.c +++ b/fs/ext4/fsync.c @@ -27,6 +27,7 @@ #include #include #include +#include #include "ext4.h" #include "ext4_jbd2.h" @@ -83,10 +84,10 @@ static int ext4_sync_parent(struct inode *inode) * What we do is just kick off a commit and wait on it. This will snapshot the * inode to disk. */ - int ext4_sync_file(struct file *file, loff_t start, loff_t end, int datasync) { struct inode *inode = file->f_mapping->host; + struct address_space *mapping = inode->i_mapping; struct ext4_inode_info *ei = EXT4_I(inode); journal_t *journal = EXT4_SB(inode->i_sb)->s_journal; int ret = 0, err; @@ -97,6 +98,13 @@ int ext4_sync_file(struct file *file, loff_t start, loff_t end, int datasync) trace_ext4_sync_file_enter(file, datasync); + if (dax_mapping(mapping) && mapping->nrexceptional) { + err = dax_writeback_mapping_range(mapping, inode->i_sb->s_bdev, + start, end); + if (err) + goto out; + } + if (inode->i_sb->s_flags & MS_RDONLY) { /* Make sure that we read updated s_mount_flags value */ smp_rmb(); diff --git a/fs/xfs/xfs_file.c b/fs/xfs/xfs_file.c index 52883ac..84e95cc 100644 --- a/fs/xfs/xfs_file.c +++ b/fs/xfs/xfs_file.c @@ -209,7 +209,8 @@ xfs_file_fsync( loff_t end, int datasync) { - struct inode *inode = file->f_mapping->host; + struct address_space *mapping = file->f_mapping; + struct inode *inode = mapping->host; struct xfs_inode *ip = XFS_I(inode); struct xfs_mount *mp = ip->i_mount; int error = 0; @@ -218,7 +219,14 @@ xfs_file_fsync( trace_xfs_file_fsync(ip); - error = filemap_write_and_wait_range(inode->i_mapping, start, end); + if (dax_mapping(mapping) && mapping->nrexceptional) { + error = dax_writeback_mapping_range(mapping, + xfs_find_bdev_for_inode(inode), start, end); + if (error) + return error; + } + + error = filemap_write_and_wait_range(mapping, start, end); if (error) return error; diff --git a/include/linux/dax.h b/include/linux/dax.h index bad27b0..8e9f114 100644 --- a/include/linux/dax.h +++ b/include/linux/dax.h @@ -42,6 +42,6 @@ static inline bool dax_mapping(struct address_space *mapping) { return mapping->host && IS_DAX(mapping->host); } -int dax_writeback_mapping_range(struct address_space *mapping, loff_t start, - loff_t end); +int dax_writeback_mapping_range(struct address_space *mapping, + struct block_device *bdev, loff_t start, loff_t end); #endif diff --git a/mm/filemap.c b/mm/filemap.c index bc94386..c4286eb 100644 --- a/mm/filemap.c +++ b/mm/filemap.c @@ -482,12 +482,6 @@ int filemap_write_and_wait_range(struct address_space *mapping, { int err = 0; - if (dax_mapping(mapping) && mapping->nrexceptional) { - err = dax_writeback_mapping_range(mapping, lstart, lend); - if (err) - return err; - } - if (mapping->nrpages) { err = __filemap_fdatawrite_range(mapping, lstart, lend, WB_SYNC_ALL); -- 2.5.0 From mtk.manpages@gmail.com Sun Feb 7 10:28:51 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=FREEMAIL_FROM,T_DKIM_INVALID autolearn=ham version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay2.corp.sgi.com [137.38.102.29]) by oss.sgi.com (Postfix) with ESMTP id 327627CA2 for ; Sun, 7 Feb 2016 10:28:51 -0600 (CST) Received: from cuda.sgi.com (cuda1.sgi.com [192.48.157.11]) by relay2.corp.sgi.com (Postfix) with ESMTP id EBB09304032 for ; Sun, 7 Feb 2016 08:28:47 -0800 (PST) X-ASG-Debug-ID: 1454862524-04bdf079c0f6f80001-NocioJ Received: from mail-wm0-f54.google.com (mail-wm0-f54.google.com [74.125.82.54]) by cuda.sgi.com with ESMTP id nVUrKWtEupo2L0oI (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128 verify=NO) for ; Sun, 07 Feb 2016 08:28:45 -0800 (PST) X-Barracuda-Envelope-From: mtk.manpages@gmail.com X-Barracuda-Apparent-Source-IP: 74.125.82.54 Received: by mail-wm0-f54.google.com with SMTP id r129so85202527wmr.0 for ; Sun, 07 Feb 2016 08:28:45 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=cc:to:from:subject:message-id:date:user-agent:mime-version :content-type:content-transfer-encoding; bh=01yc7/7ORIdrZLpbs3p3Dd24NCxvTzIWrAniF/FKC28=; b=EHtcs4kzV65W3Mvqee9OXdo8Ok50miVl8k+nvVlYbpsydHQW1M+mnE64EY9qalwxYu mWE9JApE25tx4g30/aB+InLOQP/P4/1a5JvxIdhbHimqSPzyUxHa0sbSaP0ZL3FliI2H U7prauCBB+QF0vbVPtzugd8Z+J2bY0y/otjS513XrLW8Be6BdGlpcUHURzXz/oEr0/53 JMXKF1m23xUyWdU/nOQ1kS0znXqN66uNAjo1PNMgmnqp9M1Rhyo3+w0oLomwqqgL5BdN 7MSKfkhvwQkp1DUEkwWU17XFDeFsadM6mqHzxJbg61QnR1i0/ymo4o4JNUrOK0CAu2OO HXCQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:cc:to:from:subject:message-id:date:user-agent :mime-version:content-type:content-transfer-encoding; bh=01yc7/7ORIdrZLpbs3p3Dd24NCxvTzIWrAniF/FKC28=; b=cd79qi41Fg5h4QOdsSqgkxfFfWRF9WV9At+UN59oWfkzPB46RFaJPUsj6DggchG68z Q6xfFIPzT0V1HhOA3BCFf/OoT1bE+DL7UaSg7Zzk2ysjCU89Vv896YDd54jwcD2IwPoe yADmugJSltq9AoQaaArQINPP5kiSryK2c4MYcNYP39DHNWx/5SkpHwA6KUWJBQTZlZA3 IV/y3ZD2+5T4wehZ4T24uoDej05m/+T2xkdRt9mO9pOjnU3+9lJCm84yiqtaR+fV4i/s o+2tPXvf6wVrjz10E/ZQdaDMPTm30qSmb3EAwPd3bgCHqc6gWR1lIvcSnGgLXopMtaI6 hbVQ== X-Gm-Message-State: AG10YOQ0XppDsIxzCUDpleZK6kv8uJfmole3StXQHeo5//DhVFETsmfMGwIHCBmhZgxAIg== X-Received: by 10.194.240.66 with SMTP id vy2mr23770599wjc.28.1454862524259; Sun, 07 Feb 2016 08:28:44 -0800 (PST) Received: from [10.0.113.147] (46-245-176-226.static.mivitec.net. [46.245.176.226]) by smtp.gmail.com with ESMTPSA id l7sm25636230wjx.14.2016.02.07.08.28.41 (version=TLSv1/SSLv3 cipher=OTHER); Sun, 07 Feb 2016 08:28:43 -0800 (PST) Cc: mtk.manpages@gmail.com, "J. Bruce Fields" , linux-ext4@vger.kernel.org, xfs@oss.sgi.com, lkml , linux-fsdevel@vger.kernel.org, linux-nfs@vger.kernel.org, linux-cifs@vger.kernel.org, Linux API , Dave Chinner , Christoph Hellwig , Anna Schumaker , Trond Myklebust , Jeff Layton , Andreas Dilger To: Andreas Gruenbacher From: "Michael Kerrisk (man-pages)" Subject: RichACLs man-pages review X-Enigmail-Draft-Status: N1110 X-ASG-Orig-Subj: RichACLs man-pages review Message-ID: <56B770B6.7040803@gmail.com> Date: Sun, 7 Feb 2016 17:28:38 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.5.0 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-Barracuda-Connect: mail-wm0-f54.google.com[74.125.82.54] X-Barracuda-Start-Time: 1454862525 X-Barracuda-Encrypted: ECDHE-RSA-AES128-GCM-SHA256 X-Barracuda-URL: https://192.48.157.11:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-BRTS-Status: 1 X-Barracuda-Spam-Score: 0.00 X-Barracuda-Spam-Status: No, SCORE=0.00 using per-user scores of TAG_LEVEL=1000.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.7 tests=BSF_SC0_MISMATCH_TO, DKIM_SIGNED, DKIM_VERIFIED X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.3.26830 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 0.00 BSF_SC0_MISMATCH_TO Envelope rcpt doesn't match header -0.00 DKIM_VERIFIED Domain Keys Identified Mail: signature passes verification 0.00 DKIM_SIGNED Domain Keys Identified Mail: message has a signature Hello Andreas I've taken a look at the current drafts of the setrichacl(1), getrichacl(1), and richacl(7) man pages, and will send comments as separate following mails. Cheers, Michael -- Michael Kerrisk Linux man-pages maintainer; http://www.kernel.org/doc/man-pages/ Linux/UNIX System Programming Training: http://man7.org/training/ From mtk.manpages@gmail.com Sun Feb 7 10:30:00 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=FREEMAIL_FROM,T_DKIM_INVALID autolearn=ham version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay1.corp.sgi.com [137.38.102.111]) by oss.sgi.com (Postfix) with ESMTP id 09BDF7CA2 for ; Sun, 7 Feb 2016 10:30:00 -0600 (CST) Received: from cuda.sgi.com (cuda1.sgi.com [192.48.157.11]) by relay1.corp.sgi.com (Postfix) with ESMTP id C39648F8033 for ; Sun, 7 Feb 2016 08:29:56 -0800 (PST) X-ASG-Debug-ID: 1454862593-04bdf079c3f6fd0001-NocioJ Received: from mail-wm0-f41.google.com (mail-wm0-f41.google.com [74.125.82.41]) by cuda.sgi.com with ESMTP id KGLruewFw73VDzjx (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128 verify=NO) for ; Sun, 07 Feb 2016 08:29:54 -0800 (PST) X-Barracuda-Envelope-From: mtk.manpages@gmail.com X-Barracuda-Apparent-Source-IP: 74.125.82.41 Received: by mail-wm0-f41.google.com with SMTP id g62so105362959wme.0 for ; Sun, 07 Feb 2016 08:29:54 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=subject:to:references:cc:from:message-id:date:user-agent :mime-version:in-reply-to:content-type:content-transfer-encoding; bh=R3V21P2hJJTxuGfVU3wVE9WFxx0C16V0/kvQUG7FqOU=; b=Wm/TIU4xelURwSYPNu0F/84QM8FwIuBRNOg+c11FhdOC7dGdQquO+CfT/ROwXM8NIN 5NQ3tcudoxrZKCXTP8BWOi988rFlg2rzxLMULpO7Boxvsti3NFxapsMFHIWLuDH+fghG WvfhL2F8FqidsR7CMuyOt/V5+oi3d8/aVEgrrAsqJjNvCCv/a+NgWGgCx07zy6zFcGUQ LKm8tSzo5ENbO2L23qRhSg0UJ2k43O8QIAtnPumC+NisVAZzwFMqSylye2UJqx4eWWvh /8bR8RRpn6/GP3tDndIDZBZg+bfKFo2n1CgcDV2OlRIFY1JMflXxxsUCViPc6rkKt6v5 eQpA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:subject:to:references:cc:from:message-id:date :user-agent:mime-version:in-reply-to:content-type :content-transfer-encoding; bh=R3V21P2hJJTxuGfVU3wVE9WFxx0C16V0/kvQUG7FqOU=; b=JLAc1kwxXec4G4gB5NgrPuRHCDTcSzkm6p9y0t9M+rU8xUT6RzQZjCvhkaZ3c5a6EA AFMLbqVHFklCrz1BY43/3j313kKrpaxr5WIvk5pZBfF6AnOb5kuzcxpCbFUg6kkstD0+ iOh2kno4dcUNYVSuv0MFTsDN90QagC6YY2r9ZqCUg2FgC5erm4bACgto3/eHkOG6dmIZ rrdXix0JY8Wi+bsUsAacNR31tOS6Z3j8MtHitpNZr2hfVU1E+X3cynrfOBYo0/jZQpkV lDEcA7ePoeDhePwnnlVwdq/UIEB7/7mq7CZL7+FhqQ5aZ9quddzzBizu7YQfk0CPGFSh PczQ== X-Gm-Message-State: AG10YOTyEMSABzDLw5OCuQGfO2w8jC5XS47UqFzpdhWJhib9rcAkeDl9MqBgNxqxJDOMcg== X-Received: by 10.28.146.8 with SMTP id u8mr44497069wmd.72.1454862592758; Sun, 07 Feb 2016 08:29:52 -0800 (PST) Received: from [10.0.113.147] (46-245-176-226.static.mivitec.net. [46.245.176.226]) by smtp.gmail.com with ESMTPSA id u191sm8495020wmd.4.2016.02.07.08.29.48 (version=TLSv1/SSLv3 cipher=OTHER); Sun, 07 Feb 2016 08:29:51 -0800 (PST) Subject: Re: RichACLs man-pages review To: Andreas Gruenbacher X-ASG-Orig-Subj: Re: RichACLs man-pages review References: <56B770B6.7040803@gmail.com> Cc: mtk.manpages@gmail.com, "J. Bruce Fields" , linux-ext4@vger.kernel.org, xfs@oss.sgi.com, lkml , linux-fsdevel@vger.kernel.org, linux-nfs@vger.kernel.org, linux-cifs@vger.kernel.org, Linux API , Dave Chinner , Christoph Hellwig , Anna Schumaker , Trond Myklebust , Jeff Layton , Andreas Dilger From: "Michael Kerrisk (man-pages)" Message-ID: <56B770FA.2050107@gmail.com> Date: Sun, 7 Feb 2016 17:29:46 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.5.0 MIME-Version: 1.0 In-Reply-To: <56B770B6.7040803@gmail.com> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Barracuda-Connect: mail-wm0-f41.google.com[74.125.82.41] X-Barracuda-Start-Time: 1454862593 X-Barracuda-Encrypted: ECDHE-RSA-AES128-GCM-SHA256 X-Barracuda-URL: https://192.48.157.11:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-BRTS-Status: 1 X-Barracuda-Spam-Score: 0.00 X-Barracuda-Spam-Status: No, SCORE=0.00 using per-user scores of TAG_LEVEL=1000.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.7 tests=BSF_SC0_MISMATCH_TO, DKIM_SIGNED, DKIM_VERIFIED X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.3.26830 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 0.00 BSF_SC0_MISMATCH_TO Envelope rcpt doesn't match header -0.00 DKIM_VERIFIED Domain Keys Identified Mail: signature passes verification 0.00 DKIM_SIGNED Domain Keys Identified Mail: message has a signature Hello Andreas, Here, some comments on the setrichacl(1) page. > .\" > .\" Richacl Manual Pages > .\" > .\" Copyright (C) 2015 Red Hat, Inc. > .\" Written by Andreas Gruenbacher > .\" This is free documentation; you can redistribute it and/or > .\" modify it under the terms of the GNU General Public License as > .\" published by the Free Software Foundation; either version 2 of > .\" the License, or (at your option) any later version. > .\" > .\" The GNU General Public License's references to "object code" > .\" and "executables" are to be interpreted as the output of any > .\" document formatting or typesetting system, including > .\" intermediate and printed output. > .\" > .\" This manual is distributed in the hope that it will be useful, > .\" but WITHOUT ANY WARRANTY; without even the implied warranty of > .\" MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the > .\" GNU General Public License for more details. > .\" > .\" You should have received a copy of the GNU General Public > .\" License along with this manual. If not, see > .\" . > .\" > .TH SETRICHACL 7 2015-09-01 "Linux" "Rich Access Control Lists" > > .SH NAME > setrichacl \- Set Rich Access Control Lists > > .SH SYNOPSIS > .B setrichacl > .RI [ OPTION "]... [" FILE ]... In man-pages, at least, the convention is to use lower case for these pieces (and thus through the remainder of the page), so: > .RI [ option "]... [" file ]... > > .SH DESCRIPTION > The setrichacl utility sets or modifies Rich Access Control Lists (richacls) of .BR setrichacl > files and directories. > > The > .B \-m > and > .B \-s > options expect an ACL or parts of an ACL on the command line. The > .B \-M > and > .B \-S > options read an ACL or parts of an ACL from a file. In either case, the entry > format is described in section > .I TEXT FORM > of the richacl(7) manual page. The single-letter or long forms of flags and Use .BR richachl (7) for page cross references. > permissions can be mixed arbitrarily. Multiple entries are separated by > whitespace, newlines or commas. > > Note that the order of ACL entries matters, and that changing the order may > grant different permissions. > > The use of > .B deny > entries is discouraged. If > .B deny > entries are used, they should be placed ahead of > .B allow > entries for improved interoperability with Windows where possible. > > When the file masks are not specified, they are computed automatically. > > When the ACL to be set is simple enough that the traditional file permission > bits can express the same permissions, setrichacl instead only sets the file .BR setrichacl > permission bits. Minor differences that do not have an influence on the > permissions granted by the acl are not preserved. When setrichacl's s/acl/ACL/ .BR setrichacl 's > counterpart utility, getrichacl, is used on a file or directory that does not .BR getrichacl , > have a richacl, it displays the access permissions defined by the file > permission bits as a richacl. > > .SS Permissions > > Setting ACLs or changing the file permission bits is allowed to the file owner, > to processes which have the write_acl permission, and to processes which have .B write_acl > the CAP_FOWNER capability. .B CAP_FOWNER > > .SH OPTIONS > .TP > \-\-\fBmodify\fR \fIacl\fR, \fB\-m\fR \fIacl\fR > Modify the ACL of \fIFILE\fR by replacing existing entries with the entries in > \fIacl\fR, and adding all new entries. When the permissions of an entry are > empty, remove the entry. > .TP > \fB\-\-modify\-file\fR \fIacl_file\fR, \fB\-M\fR \fIacl_file\fR > Identical to \-\-modify, but read the ACL from \fIacl_file\fR instead. If the .B \-\-modify > file is \(lq\-\(rq, read from standard input. > .TP > \fB\-\-set\fR \fIacl\fR, \fB\-s\fR \fIacl\fR > Set the ACL of \fIFILE\fR to \fIacl\fR. Any previous ACL is replaced. > ACL entries are separated by whitespace, newlines, or commas. > .TP > \fB\-\-set\-file\fR \fIacl_file\fR, \fB\-S\fR \fIacl_file\fR > Identical to \-\-set, but read the ACL from \fIacl_file\fR instead. If the .BR \-\-set , > file is \(lq\-\(rq, read from standard input. > .TP > \fB\-\-remove\fR, \fB\-b\fR > Remove all extended permissions and revert to the file permission bits only. > .TP > \fB\-\-version\fR, \fB\-v\fR > Display the version of setrichacl and exit. .BR setrichacl > .TP > \fB\-\-help\fR, \fB\-h\fR > Display command-line usage help text. > > .\" .SH EXAMPLES Yes please! > .SH AUTHOR > Written by Andreas Grünbacher . > > Please send your bug reports, suggested features and comments to the above address. > > .SH CONFORMING TO > Rich Access Control Lists are Linux-specific. > > .SH SEE ALSO > .BR getrichacl (1), > .BR richacl (7) Cheers, Michael -- Michael Kerrisk Linux man-pages maintainer; http://www.kernel.org/doc/man-pages/ Linux/UNIX System Programming Training: http://man7.org/training/ From mtk.manpages@gmail.com Sun Feb 7 10:30:56 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=FREEMAIL_FROM,T_DKIM_INVALID autolearn=ham version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay1.corp.sgi.com [137.38.102.111]) by oss.sgi.com (Postfix) with ESMTP id 525A97CA2 for ; Sun, 7 Feb 2016 10:30:56 -0600 (CST) Received: from cuda.sgi.com (cuda2.sgi.com [192.48.176.25]) by relay1.corp.sgi.com (Postfix) with ESMTP id 426BC8F8033 for ; Sun, 7 Feb 2016 08:30:56 -0800 (PST) X-ASG-Debug-ID: 1454862653-04cbb04cfc11c080001-NocioJ Received: from mail-wm0-f41.google.com (mail-wm0-f41.google.com [74.125.82.41]) by cuda.sgi.com with ESMTP id O5Or5MFLYwk4rLcy (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128 verify=NO) for ; Sun, 07 Feb 2016 08:30:53 -0800 (PST) X-Barracuda-Envelope-From: mtk.manpages@gmail.com X-Barracuda-Apparent-Source-IP: 74.125.82.41 Received: by mail-wm0-f41.google.com with SMTP id g62so105381795wme.0 for ; Sun, 07 Feb 2016 08:30:53 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=subject:to:references:cc:from:message-id:date:user-agent :mime-version:in-reply-to:content-type:content-transfer-encoding; bh=la9Oiz7DSab/KoUVEQ//32v1e/frPR0nuQcyyZC0iXQ=; b=f4iJxdvsxFYKmLIKCH+FOJLdSJbcp9XNmff7fjKzmSxcZcuCtuh+44pA1GooNSpPOI mCTIin8Ti1TSkXcs4xplxNRh1yjrzhXAGc18FD8+Df7szQyqPR3n3o/t4ZZgY0m3RIZ+ GKLeTcw12UhSc9QVQsn+YPPLcO0y/jB46gC1UUAoRSPxcdXUyORN8IxGRyakyH7OLKzB 5xx4BU1YxY0e6c19JV4R1iIBJ6qfQkbTHiuGRJXFGPlIr6IKjNPkW41LPpaIH0R7cYBl zfv7A/K+XEbd9B7ksb75RfSDOGeW2u2cc5HjRFhHtdWdTG8QqEpQdJZfD8DnfYfZofQU PYKw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:subject:to:references:cc:from:message-id:date :user-agent:mime-version:in-reply-to:content-type :content-transfer-encoding; bh=la9Oiz7DSab/KoUVEQ//32v1e/frPR0nuQcyyZC0iXQ=; b=M7Glyj6x+LIuIk5IgiKDtHyuXAMANG/UXx0fGYYf8tyRlSARg0lNO8h+YN/RvMLlAR aa/GWCKRWbIXJBHvAbMZ6Fk0bzVlHTAkcKEfQfY3TBki0i3bOvn3sZNgiRPpu2sg6HQS vl0R2zCvDisZjcB08lNzEnUlY6dGjvHZu5JoEVSQovb78SACmbE/WhazvqtGuEC+Jeip HwgPxhCWtK73lw/eKyp+au0VtkJcZdJZhboaYMktd+imlQOme7y6U73jIYI4P8qsjs8C 31hyv8FduXPpywpUWyToZPpyzyaaGTV9x/et+H6J6TrwcXWAUCcpmY5t4MyhdUj3+NUG 1RZg== X-Gm-Message-State: AG10YOTgckPIIpr8YpiyVaZBKvqW1XnKX6k9NgRlPEEdjL6aTUGZD3PSo+tRGcblqRcwww== X-Received: by 10.194.79.194 with SMTP id l2mr26512867wjx.160.1454862652839; Sun, 07 Feb 2016 08:30:52 -0800 (PST) Received: from [10.0.113.147] (46-245-176-226.static.mivitec.net. [46.245.176.226]) by smtp.gmail.com with ESMTPSA id y188sm8444630wmy.11.2016.02.07.08.30.50 (version=TLSv1/SSLv3 cipher=OTHER); Sun, 07 Feb 2016 08:30:52 -0800 (PST) Subject: getrichacl(1) man page review comments To: Andreas Gruenbacher X-ASG-Orig-Subj: getrichacl(1) man page review comments References: <56B770B6.7040803@gmail.com> Cc: mtk.manpages@gmail.com, "J. Bruce Fields" , linux-ext4@vger.kernel.org, xfs@oss.sgi.com, lkml , linux-fsdevel@vger.kernel.org, linux-nfs@vger.kernel.org, linux-cifs@vger.kernel.org, Linux API , Dave Chinner , Christoph Hellwig , Anna Schumaker , Trond Myklebust , Jeff Layton , Andreas Dilger From: "Michael Kerrisk (man-pages)" X-Enigmail-Draft-Status: N1110 Message-ID: <56B77139.4080209@gmail.com> Date: Sun, 7 Feb 2016 17:30:49 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.5.0 MIME-Version: 1.0 In-Reply-To: <56B770B6.7040803@gmail.com> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Barracuda-Connect: mail-wm0-f41.google.com[74.125.82.41] X-Barracuda-Start-Time: 1454862653 X-Barracuda-Encrypted: ECDHE-RSA-AES128-GCM-SHA256 X-Barracuda-URL: https://192.48.176.25:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-BRTS-Status: 1 X-Barracuda-Spam-Score: 0.00 X-Barracuda-Spam-Status: No, SCORE=0.00 using per-user scores of TAG_LEVEL=1000.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.7 tests=BSF_SC0_MISMATCH_TO, DKIM_SIGNED, DKIM_VERIFIED X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.3.26830 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 0.00 BSF_SC0_MISMATCH_TO Envelope rcpt doesn't match header -0.00 DKIM_VERIFIED Domain Keys Identified Mail: signature passes verification 0.00 DKIM_SIGNED Domain Keys Identified Mail: message has a signature Hello Andreas, Here, some comments on the getrichacl(1) page. > .\" > .\" Richacl Manual Pages > .\" > .\" Copyright (C) 2015 Red Hat, Inc. > .\" Written by Andreas Gruenbacher > .\" This is free documentation; you can redistribute it and/or > .\" modify it under the terms of the GNU General Public License as > .\" published by the Free Software Foundation; either version 2 of > .\" the License, or (at your option) any later version. > .\" > .\" The GNU General Public License's references to "object code" > .\" and "executables" are to be interpreted as the output of any > .\" document formatting or typesetting system, including > .\" intermediate and printed output. > .\" > .\" This manual is distributed in the hope that it will be useful, > .\" but WITHOUT ANY WARRANTY; without even the implied warranty of > .\" MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the > .\" GNU General Public License for more details. > .\" > .\" You should have received a copy of the GNU General Public > .\" License along with this manual. If not, see > .\" . > .\" > .TH GETRICHACL 7 2015-09-01 "Linux" "Rich Access Control Lists" > > .SH NAME > getrichacl \- Get Rich Access Control Lists > > .SH SYNOPSIS > .B getrichacl > .RI [ OPTION "]... [" FILE ]... In man-pages, at least, the convention is to use lower case for these pieces (and thus through the remainder of the page), so: > .RI [ option "]... [" file ]... > .SH DESCRIPTION > For each file, getrichacl displays the file name and Rich Access Control List For man-pages, at least, the convention is that the references to the function/command name explained in the page are bold, do: .BR getrichacl > (richacl). For what it's worth, I think it would be worthwhile to start with a consistent abbreviation comment here (and use it throughout all of the man pages): "RichACL" (or "richACL"), rather than "richacl"; that seems more consistent with the traditional abbreviation "ACL". > > By default, getrichacl displays the effective permissions remaining after .BR getrichacl > applying the file masks to the ACL. The file masks and underlying NFSv4 ACL > can be displayed with the \-\-raw option. Use .BR \-\-raw > > The output format of getrichacl is as follows: .BR getrichacl > .fam C > .RS > .nf > 1: file: > 2: flags:a > 3: owner:rwp-------------::mask > 4: group:r-p-------------::mask > 5: other:r---------------::mask > 6: owner@:rwp-------------::allow > 7: user:foo:r-p-------------::allow > 8: group@:r-p-------------::allow > 9: group:bar:r-p-------------::allow > 10: everyone@:r---------------::allow > 11: > .fi > .RE > .fam T > > Line 1 contains the file name, followed by a colon. > > Line 2 contains the ACL flags. This line is omitted if no flags are set. > > Lines 3--5 indicate the owner, group, and other file masks, which are only > shown if the \-\-raw option is specified. > > Lines 6--10 indicate different ACL entries for the file owner > .RB ( owner@ ), > user foo, the owning group > .RB ( group@ ), > group bar, and for everyone .IR bar , > .RB ( everyone@ ). > > A blank line follows at the end. > > By default, getrichacl displays the the single-letter forms of flags and .BR getrichacl s/the the/the/ > permissions, the identifiers of ACL entryies are right justified, the s/entryies/entries/ > permissions are vertically aligned, and permissions which are always > granted > .RB ( read_attributes ", " read_acl ", " synchronize ) > are omitted. See the richacl(7) manual page for the defined flags and Use .BR richachl (7) for page cross references. > permissions. > > When getrichacl is used on a file that does not have a richacl or on a .BR getrichacl > filesystem that does not support richacls, getrichacl displays the access .BR getrichacl > permissions defined by the traditional file permission bits as a richacl. When > getrichacl is used on a file that has a POSIX ACL, it prints an error message. .BR getrichacl And then: [...] has a POSIX ACL (see .BR acl (7)), it prints [...] > > .SH OPTIONS > .TP > \fB\-\-long\fR, \fB\-l\fR > Display access masks and flags in their long form. > .TP > \fB\-\-full\fR > Also show permissions which are always implicitly allowed. > .TP > \fB\-\-raw\fR > Show acls as stored on the file system including the file masks. Implies s/axls/ACLs/ > \fB\-\-full\fR. > .TP > \fB\-\-unaligned\fR > Do not align ACL entries or pad missing permissions with '-'. > .TP > \fB\-\-numeric-ids\fR > Display numeric user and group IDs instead of names. > .TP > \fB\-\-access\fR [=\fIuser\fR[:\fIgroup\fR:...]}, \fB\-a\fR[\fIuser\fR[:\fIgroup\fR:...]} > Instead of the ACL, show which permissions the caller or a specified user has "caller"? "the user running the command, " > for file(s). When a list of groups is given, this overrides the groups the s/file(s)/specified file(s)/ > user is in. The preceding text is not very clear. > .TP > \fB\-\-version\fR, \fB\-v\fR > Display the version of getrichacl and exit. .BR getrichacl > .TP > \fB\-\-help\fR, \fB\-h\fR > Display command-line usage help text. > > .SH AUTHOR > Written by Andreas Grünbacher . > > Please send your bug reports, suggested features and comments to the above address. > > .SH CONFORMING TO > Rich Access Control Lists are Linux-specific. > > .SH SEE ALSO > .BR setrichacl (1), > .BR richacl (7) Cheers, Michael -- Michael Kerrisk Linux man-pages maintainer; http://www.kernel.org/doc/man-pages/ Linux/UNIX System Programming Training: http://man7.org/training/ From mtk.manpages@gmail.com Sun Feb 7 10:31:56 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=FREEMAIL_FROM,T_DKIM_INVALID autolearn=ham version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay3.corp.sgi.com [198.149.34.15]) by oss.sgi.com (Postfix) with ESMTP id 939D07CA2 for ; Sun, 7 Feb 2016 10:31:56 -0600 (CST) Received: from cuda.sgi.com (cuda2.sgi.com [192.48.176.25]) by relay3.corp.sgi.com (Postfix) with ESMTP id 242EAAC001 for ; Sun, 7 Feb 2016 08:31:53 -0800 (PST) X-ASG-Debug-ID: 1454862709-04cbb04cfb11c2b0001-NocioJ Received: from mail-wm0-f43.google.com (mail-wm0-f43.google.com [74.125.82.43]) by cuda.sgi.com with ESMTP id 5p4tnDIxJplNovLZ (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128 verify=NO) for ; Sun, 07 Feb 2016 08:31:50 -0800 (PST) X-Barracuda-Envelope-From: mtk.manpages@gmail.com X-Barracuda-Apparent-Source-IP: 74.125.82.43 Received: by mail-wm0-f43.google.com with SMTP id g62so105397692wme.0 for ; Sun, 07 Feb 2016 08:31:50 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=subject:to:references:cc:from:message-id:date:user-agent :mime-version:in-reply-to:content-type:content-transfer-encoding; bh=iwHnw2K/uaxzdCSXUkhdb4V8H3tjNKOZCuNDqxHdWwA=; b=Kly2cmG/Oj5kFBEDfhGftAVS4lPWC+DY/rs8+CBdJgj4pyhHsccnkeCRDHAXo+m5Gr u8KJOaoyUZ2XOjjf38e0gjH3eLykWo82gQ452iqxQO6d3VQydbNwg4vPPzmFEwlJL66E QiRRqhr5Gh4s5QHwdQ/N4Ff781EXvG8ymDduu6LV+jRiwDQEgLZR3HWsF3gB1m+YJsW7 tAvUvmuTG5+6128IB4eXDMNbbunkKlaxEP/oP49Bo/x9UtaPVWkvMwVu37f2u6GjPKVY ABJFQr1iA79A74Ul0gzKW8nVIPPNnT8DuEzkz6u8J62vfit+TL+wDMmXITrAs2P0wBhR 7NcA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:subject:to:references:cc:from:message-id:date :user-agent:mime-version:in-reply-to:content-type :content-transfer-encoding; bh=iwHnw2K/uaxzdCSXUkhdb4V8H3tjNKOZCuNDqxHdWwA=; b=G8waK1oqdogLqFC0EJQgjxVBl59eW8PtlphEd0f4Lz7DZA3vMLcvVUgHPO2G/jqCZg 7bvUqxidGuu5LLCMlfjfVzI7H1EPHcherK3z5nKLFgxD/DbYtQcgCy8XVPRVGKJAsaZA P8il6k0vUNJF9XhWdJKjNJxYAp25wx2NybESVNjnl5pYqRPrbMvL9HI76D13XCGJGVSj PE45F8/5n7FFQqk4XGjbRu1+dQ4oBZ1VflvQF0ac6Bfbt8Zqua6JZ5t9MmQgO5Na6XT6 +buf5w7NUIztm6X+X1J0NQCsoBAXcCy/Ni9XAb6wZv9i5FMQOXuCLFQnNI/5qqBa07hz rIPA== X-Gm-Message-State: AG10YOQXd3KIQYvctfkqk/Dn9lwNtmc2zGTz5atAGis1x+lQtpfuY6TW6F9djNyUDpO2fg== X-Received: by 10.195.11.35 with SMTP id ef3mr23314046wjd.35.1454862709611; Sun, 07 Feb 2016 08:31:49 -0800 (PST) Received: from [10.0.113.147] (46-245-176-226.static.mivitec.net. [46.245.176.226]) by smtp.gmail.com with ESMTPSA id v66sm8448820wmb.18.2016.02.07.08.31.46 (version=TLSv1/SSLv3 cipher=OTHER); Sun, 07 Feb 2016 08:31:48 -0800 (PST) Subject: setrichacl(1) man page review comments To: Andreas Gruenbacher X-ASG-Orig-Subj: setrichacl(1) man page review comments References: <56B770B6.7040803@gmail.com> Cc: mtk.manpages@gmail.com, "J. Bruce Fields" , linux-ext4@vger.kernel.org, xfs@oss.sgi.com, lkml , linux-fsdevel@vger.kernel.org, linux-nfs@vger.kernel.org, linux-cifs@vger.kernel.org, Linux API , Dave Chinner , Christoph Hellwig , Anna Schumaker , Trond Myklebust , Jeff Layton , Andreas Dilger From: "Michael Kerrisk (man-pages)" Message-ID: <56B7716F.6060404@gmail.com> Date: Sun, 7 Feb 2016 17:31:43 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.5.0 MIME-Version: 1.0 In-Reply-To: <56B770B6.7040803@gmail.com> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Barracuda-Connect: mail-wm0-f43.google.com[74.125.82.43] X-Barracuda-Start-Time: 1454862710 X-Barracuda-Encrypted: ECDHE-RSA-AES128-GCM-SHA256 X-Barracuda-URL: https://192.48.176.25:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-BRTS-Status: 1 X-Barracuda-Spam-Score: 0.00 X-Barracuda-Spam-Status: No, SCORE=0.00 using per-user scores of TAG_LEVEL=1000.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.7 tests=BSF_SC0_MISMATCH_TO, DKIM_SIGNED, DKIM_VERIFIED X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.3.26830 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 0.00 BSF_SC0_MISMATCH_TO Envelope rcpt doesn't match header -0.00 DKIM_VERIFIED Domain Keys Identified Mail: signature passes verification 0.00 DKIM_SIGNED Domain Keys Identified Mail: message has a signature Hello Andreas, Here, some comments on the setrichacl(1) page. > .\" > .\" Richacl Manual Pages > .\" > .\" Copyright (C) 2015 Red Hat, Inc. > .\" Written by Andreas Gruenbacher > .\" This is free documentation; you can redistribute it and/or > .\" modify it under the terms of the GNU General Public License as > .\" published by the Free Software Foundation; either version 2 of > .\" the License, or (at your option) any later version. > .\" > .\" The GNU General Public License's references to "object code" > .\" and "executables" are to be interpreted as the output of any > .\" document formatting or typesetting system, including > .\" intermediate and printed output. > .\" > .\" This manual is distributed in the hope that it will be useful, > .\" but WITHOUT ANY WARRANTY; without even the implied warranty of > .\" MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the > .\" GNU General Public License for more details. > .\" > .\" You should have received a copy of the GNU General Public > .\" License along with this manual. If not, see > .\" . > .\" > .TH SETRICHACL 7 2015-09-01 "Linux" "Rich Access Control Lists" > > .SH NAME > setrichacl \- Set Rich Access Control Lists > > .SH SYNOPSIS > .B setrichacl > .RI [ OPTION "]... [" FILE ]... In man-pages, at least, the convention is to use lower case for these pieces (and thus through the remainder of the page), so: > .RI [ option "]... [" file ]... > > .SH DESCRIPTION > The setrichacl utility sets or modifies Rich Access Control Lists (richacls) of .BR setrichacl > files and directories. > > The > .B \-m > and > .B \-s > options expect an ACL or parts of an ACL on the command line. The > .B \-M > and > .B \-S > options read an ACL or parts of an ACL from a file. In either case, the entry > format is described in section > .I TEXT FORM > of the richacl(7) manual page. The single-letter or long forms of flags and Use .BR richachl (7) for page cross references. > permissions can be mixed arbitrarily. Multiple entries are separated by > whitespace, newlines or commas. > > Note that the order of ACL entries matters, and that changing the order may > grant different permissions. > > The use of > .B deny > entries is discouraged. If > .B deny > entries are used, they should be placed ahead of > .B allow > entries for improved interoperability with Windows where possible. > > When the file masks are not specified, they are computed automatically. > > When the ACL to be set is simple enough that the traditional file permission > bits can express the same permissions, setrichacl instead only sets the file .BR setrichacl > permission bits. Minor differences that do not have an influence on the > permissions granted by the acl are not preserved. When setrichacl's s/acl/ACL/ .BR setrichacl 's > counterpart utility, getrichacl, is used on a file or directory that does not .BR getrichacl , > have a richacl, it displays the access permissions defined by the file > permission bits as a richacl. > > .SS Permissions > > Setting ACLs or changing the file permission bits is allowed to the file owner, > to processes which have the write_acl permission, and to processes which have .B write_acl > the CAP_FOWNER capability. .B CAP_FOWNER > > .SH OPTIONS > .TP > \-\-\fBmodify\fR \fIacl\fR, \fB\-m\fR \fIacl\fR > Modify the ACL of \fIFILE\fR by replacing existing entries with the entries in > \fIacl\fR, and adding all new entries. When the permissions of an entry are > empty, remove the entry. > .TP > \fB\-\-modify\-file\fR \fIacl_file\fR, \fB\-M\fR \fIacl_file\fR > Identical to \-\-modify, but read the ACL from \fIacl_file\fR instead. If the .B \-\-modify > file is \(lq\-\(rq, read from standard input. > .TP > \fB\-\-set\fR \fIacl\fR, \fB\-s\fR \fIacl\fR > Set the ACL of \fIFILE\fR to \fIacl\fR. Any previous ACL is replaced. > ACL entries are separated by whitespace, newlines, or commas. > .TP > \fB\-\-set\-file\fR \fIacl_file\fR, \fB\-S\fR \fIacl_file\fR > Identical to \-\-set, but read the ACL from \fIacl_file\fR instead. If the .BR \-\-set , > file is \(lq\-\(rq, read from standard input. > .TP > \fB\-\-remove\fR, \fB\-b\fR > Remove all extended permissions and revert to the file permission bits only. > .TP > \fB\-\-version\fR, \fB\-v\fR > Display the version of setrichacl and exit. .BR setrichacl > .TP > \fB\-\-help\fR, \fB\-h\fR > Display command-line usage help text. > > .\" .SH EXAMPLES Yes please! > .SH AUTHOR > Written by Andreas Grünbacher . > > Please send your bug reports, suggested features and comments to the above address. > > .SH CONFORMING TO > Rich Access Control Lists are Linux-specific. > > .SH SEE ALSO > .BR getrichacl (1), > .BR richacl (7) Cheers, Michael -- Michael Kerrisk Linux man-pages maintainer; http://www.kernel.org/doc/man-pages/ Linux/UNIX System Programming Training: http://man7.org/training/ From mtk.manpages@gmail.com Sun Feb 7 10:35:58 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=FREEMAIL_FROM,T_DKIM_INVALID autolearn=ham version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay1.corp.sgi.com [137.38.102.111]) by oss.sgi.com (Postfix) with ESMTP id 6EE2B7CA2 for ; Sun, 7 Feb 2016 10:35:58 -0600 (CST) Received: from cuda.sgi.com (cuda3.sgi.com [192.48.176.15]) by relay1.corp.sgi.com (Postfix) with ESMTP id 5A2CE8F804B for ; Sun, 7 Feb 2016 08:35:58 -0800 (PST) X-ASG-Debug-ID: 1454862950-04cb6c274611e490001-NocioJ Received: from mail-wm0-f53.google.com (mail-wm0-f53.google.com [74.125.82.53]) by cuda.sgi.com with ESMTP id GOhxq5w14MlYwziz (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128 verify=NO) for ; Sun, 07 Feb 2016 08:35:51 -0800 (PST) X-Barracuda-Envelope-From: mtk.manpages@gmail.com X-Barracuda-Apparent-Source-IP: 74.125.82.53 Received: by mail-wm0-f53.google.com with SMTP id p63so84967110wmp.1 for ; Sun, 07 Feb 2016 08:35:51 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=subject:to:references:cc:from:message-id:date:user-agent :mime-version:in-reply-to:content-type:content-transfer-encoding; bh=ipkonB/9G6WwgvPdVq9mor1Lm+2cpq+IMbdh5ZGnYeI=; b=ca9SvVBTMpCNB+EfMC4751AVQtfpbE/+olYYRTQVzVtxkz/YaRbBhe3lkqhvho6FQ9 U51ggAZYlhtis0x60hMN9xx/1yHoXuJPy15aTdOD7yq0Kohb0Nuut5Gdr78otu/YeCbZ Wh/REBTzwmJZqFSkzWjnTPplSZwrdsYOHfxnMFFe05BMtjy5Wb+lsE7MbdyxShagwXw+ CoyAESe2/nzOBxux8c7Lk0uWg4ZlnQyOtGJGQAnsljN9nbRsfMcr0vTj9Px2gGC0I8J9 iDaLdVTtPGDlOOC0AuOwIrvAQeLf4totcyWxYIzcMw2G4ofXC8cITMsn8QGZzBPjPu4q hNSQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:subject:to:references:cc:from:message-id:date :user-agent:mime-version:in-reply-to:content-type :content-transfer-encoding; bh=ipkonB/9G6WwgvPdVq9mor1Lm+2cpq+IMbdh5ZGnYeI=; b=XNOlEPnv0+muRV0sIT4WsyAv0BwuBDQrKdxtd4mFr4jkMHXgvGgt077/rgC9xHWWdG kwaStOQPH35GtpioV4X6VGVmmGScnask2YVuHOfJhU9+1a8et5/PEewKYyv05Ep6mgy0 tQSB8XeoDwkrm7Y9/w7MsVCGPU67/7es4xkQcJpuXHgkmv55XvzOqBvKIz05pEBxQDZN KRSfOXaXaRtunxcf0MJm9dosI7TdyxmKQ0PqRSZyDsHZnFnCIo2ukZ55zYKTdFmLpJVg clDhIXRQGwXw8P0Z5WJcLEEldJehGmjZj8f7PkgjKAV9cC/hgP62SSJXrPGfHTSWPtf/ EJdg== X-Gm-Message-State: AG10YOSPWiL+utGROSSp1XD/60kCUOGWmhmqhXZa6DW9tf7LwHzqmO/0VdMjqCm3/8+EjQ== X-Received: by 10.194.79.194 with SMTP id l2mr26530461wjx.160.1454862950528; Sun, 07 Feb 2016 08:35:50 -0800 (PST) Received: from [10.0.113.147] (46-245-176-226.static.mivitec.net. [46.245.176.226]) by smtp.gmail.com with ESMTPSA id e19sm5467604wmd.1.2016.02.07.08.35.47 (version=TLSv1/SSLv3 cipher=OTHER); Sun, 07 Feb 2016 08:35:49 -0800 (PST) Subject: richacl(7) man page review comments To: Andreas Gruenbacher X-ASG-Orig-Subj: richacl(7) man page review comments References: <56B770B6.7040803@gmail.com> Cc: mtk.manpages@gmail.com, "J. Bruce Fields" , linux-ext4@vger.kernel.org, xfs@oss.sgi.com, lkml , linux-fsdevel@vger.kernel.org, linux-nfs@vger.kernel.org, linux-cifs@vger.kernel.org, Linux API , Dave Chinner , Christoph Hellwig , Anna Schumaker , Trond Myklebust , Jeff Layton , Andreas Dilger From: "Michael Kerrisk (man-pages)" Message-ID: <56B77262.7090107@gmail.com> Date: Sun, 7 Feb 2016 17:35:46 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.5.0 MIME-Version: 1.0 In-Reply-To: <56B770B6.7040803@gmail.com> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Barracuda-Connect: mail-wm0-f53.google.com[74.125.82.53] X-Barracuda-Start-Time: 1454862951 X-Barracuda-Encrypted: ECDHE-RSA-AES128-GCM-SHA256 X-Barracuda-URL: https://192.48.176.15:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-BRTS-Status: 1 X-Barracuda-Spam-Score: 0.00 X-Barracuda-Spam-Status: No, SCORE=0.00 using per-user scores of TAG_LEVEL=1000.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.7 tests=BSF_SC0_MISMATCH_TO, DKIM_SIGNED, DKIM_VERIFIED X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.3.26830 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 0.00 BSF_SC0_MISMATCH_TO Envelope rcpt doesn't match header -0.00 DKIM_VERIFIED Domain Keys Identified Mail: signature passes verification 0.00 DKIM_SIGNED Domain Keys Identified Mail: message has a signature Hi Andreas, I'll probably have quite a few more comments on this page as I get to understand RichACLs better. Here's some comments from an initial reading. So, an initial comment. It seems to me to that this page (but not setrichacl(1) and getrichacl(1)) should ultimately land in man-pages (just like acl(7)), since we're talking about a kernel feature. Make sense? > .\" > .\" Richacl Manual Pages > .\" > .\" Copyright (C) 2015 Red Hat, Inc. > .\" Written by Andreas Gruenbacher > .\" This is free documentation; you can redistribute it and/or > .\" modify it under the terms of the GNU General Public License as > .\" published by the Free Software Foundation; either version 2 of > .\" the License, or (at your option) any later version. > .\" > .\" The GNU General Public License's references to "object code" > .\" and "executables" are to be interpreted as the output of any > .\" document formatting or typesetting system, including > .\" intermediate and printed output. > .\" > .\" This manual is distributed in the hope that it will be useful, > .\" but WITHOUT ANY WARRANTY; without even the implied warranty of > .\" MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the > .\" GNU General Public License for more details. > .\" > .\" You should have received a copy of the GNU General Public > .\" License along with this manual. If not, see > .\" . > .\" > .de URL > \\$2 \(laURL: \\$1 \(ra\\$3 > .. > .if \n[.g] .mso www.tmac > .TH RICHACL 7 2015-09-01 "Linux" "Rich Access Control Lists" > .SH NAME > richacl \- Rich Access Control Lists > .SH DESCRIPTION > Rich Access Control Lists (richacls) are an extension of the POSIX file For what it's worth, I think it would be worthwhile to start with a consistent abbreviation comment here (and use it throughout all of the man pages): "RichACL" (or "richACL"), rather than "richacl"; that seems more consistent with the traditional abbreviation "ACL". > permission model to support Make this: permission mode (see .BR acl (7)) to support > .URL https://tools.ietf.org/rfc/rfc5661.txt "NFSv4 Access Control Lists" > on local and remote-mounted filesystems. > > Richacls support file masks which allow to apply a file mode to an existing s/which allow to apply/which can be used to apply/ > NFSv4 ACL without destructive side effects: the file mode determines the values > of the file masks; the file masks restrict the permissions granted by the NFSv4 > ACL. When a less restrictive file mode is applied later, the file masks become > less restrictive, and more of the original permissions can become effective. > > A richacl can always be translated into an equivalent NFSv4 ACL which grants > the same permissions. > > Richacls can be enabled on supported filesystems. This disables POSIX Access > Control Lists; the two ACL models will not coexist on the same filesystem. s/will not/can not/ ? > > When used on a filesystem that does not support richacls, the getrichacl and Use .BR getrichacl (1) for cross-references. > setrichacl utilities will operate on the file permission bits instead: > getrichacl will display the file permission bits as a richacl; when a richacl Use .BR getrichacl (1) for cross-references. > is set with setrichacl which can be represented exactly by the file permission Use .BR setrichacl (1) for cross-references. > bits, setrichacl will set the file permission bits instead. Use .BR setrichacl (1) for cross-references. Here, I think it would be helpful to add a sentence: "An attempt to set a richacl that cannot be represented exactly by the file permission bits results in an error." (If that sentence is correct, of course.) > > .SH STRUCTURE OF RICHACLS For all of the "nonstandard" (see man-pages(7)) ".SH" sections here, I'd be inclined to switch to using ".SS" subsections. There are downsides to multiple nonstandard section headings (e.g., automated TOCs for Section headings become clumsy and long), and I don't think your use of .SH vs .SS really helps much to structure the information in this page. > > Richacls consist of a number of ACL entries, three file masks, and some flags. s/some flags./some flags specifying attributes of the ACL as whole (by contrast with the per-ACL-entry flags described below)./ > Each of the ACL entries allows or denies some permissions to a particular user, > group, or special entity. Each acl entry consists of: s/acl// > .IP \(bu 4 > The user (with prefix s/The user/A tag which specifies the user/ (Is "tag" the right word? In any case, what would helpful to have here is the generic term for this component of the ACL.) > .B user: > or > .BR u: ), > group (with prefix > .B group: > or > .BR g: ), > or special identifier the entry applies to. Special > identifiers can be the file owner > .RB ( owner@ ), > the owning group > .RB ( group@ ), > or everyone > .RB ( everyone@ ). > .IP \(bu > A set of permissions the entry allows or denies. > .IP \(bu > A set of flags that indicate whether the user or group identifier is mapped or > unmapped, and whether the entry has been and can be inherited. > .IP \(bu 4 > A field indicating whether the entry allows or denies access. > .PP > The owner, group, and other file masks further control which permissions the > ACL grants, subject to the > .B masked > .RB ( m ) > and > .B write_through > .RB ( w ) > ACL flags. > > Note that entries with the identifier > .B everyone@ > apply to all processes, whereas the \(lqother\(rq file permissions and > \(lqother\(rq entries in POSIX ACLs apply to all processes which are not the > owner, are not in the owning group, and do not match a user or group mentioned > in the acl. s/acl/ACL/ > Richacls do not have separate \(lqaccess\(rq ACLs that define the access > permissions and \(lqdefault\(rq ACLs that define the inheritable permissions as > POSIX ACLs. I'd restructure the preceding sentence as: "Unlike POSIX ACLs, richacls do not.... that define the inheritable permissions." > Instead, whether an ACL entry is effective during access checks > and/or inheritable is determined by the ACL entry flags. > > .SS ACL Flags I'd use lower case in the above for all words except the first. (That's the convention in man-pages.) > > The following flags on ACLs are defined: > > .RS 4 > .HP 4 s/4/8/ in the preceding two lines. I think more indentation would make this (and the similar lists below) more readable. > .B masked > .RB ( m ): I'd write each of these list entries starting here, and below, in the form: .BR masked "\ (" m ): This form is a little easier to read in the source, and it forces just a single space before the "(", which looks a little better, I find. > When set, the file masks define upper limits on the permissions the ACL may > grant. > .HP > .B write_through > .RB ( w ): > When this flag and the masked flag are both set, the owner and other file masks .B masked > define the actual permissions granted to the file owner and to others instead > of an upper limit. > .HP > .B auto_inherit > .RB ( a ): > Automatic Inheritance is enabled for the file the ACL is > attached to. See > .IR "Automatic Inheritance" . > .HP > .B protected > .RB ( p ): > The ACL is protected from modification by Automatic > Inheritance. > .HP > .B defaulted > .RB ( d ): > The ACL has been assigned by default. Automatic Inheritance should completely > replace the ACL. > .RE > > .SS ACL Entry Flags > > The following flags on ACL entries are defined: > > .RS 4 > .HP 4 s/4/8/ in the preceding two lines. > .B file_inherit > .RB ( f ): > The entry is inheritable for files. > .HP > .B dir_inherit > .RB ( d ): > The entry is inheritable for directories. > .HP > .B no_propagate > .RB ( n ): > Inheritance stops at the next subdirectory level. > .HP > .B inherit_only > .RB ( i ): > The entry defines inheritable permissions only and is ignored for access > checking. > .HP > .B inherited > .RB ( a ): > The entry has been automatically inherited from the parent directory; the > ACL's auto_inherit Use .B auto_inherit > .RB ( a ) > flag should be on. > .HP > .B unmapped > .RB ( u ): > The user or group identifier is a textual string and has no mapping to a > numeric user or group identifier. So here, I think there should be a sentence that explains how a meaning is attached to the strings? Is this for NFS, for Windows, for something else? > .RE > > .SS Permissions > > The following permissions are defined for richacl entries and for the three > file masks: > > .RS 4 > .HP 4 s/4/8/ in the preceding two lines. > .B read_data > / > .B list_directory > .RB ( r ): Replace the preceding four lines by .BR read_data / list_directory "\ (" r ) and do similar for the next two list entried below. Note that "\ (" will force just a singlke space before the "(". > Read the data of a file. > List the contents of a directory. In the above list entry, and the next two, I find the layout ("xxx/yyy (z)") confusing. A closer reading indicates that in each case, the "xxx" applies for files and he "yyy" is for directories. But I think the text could make this point a little easier to grasp. In each of these three list entries this could be done something lke the following: "For a file: read the data of the file. For a directory: list the contents of the directory." By the way, can the terms "read_data" and "list_directory" be used interchangeably? That is, can you employ (say) "read_data" when setting an ACL entry for a directory? (I'm assuming the answer is "yes".) If the terms are just interchangeable synonyms, perhas it's worth making that point explicitly in the text. > .HP > .B write_data > / > .B add_file > .RB ( w ): > Modify the data of a file. Add a new file in a directory. See above comment re file/directory. > .HP > .B append_data > / > .B add_subdirectory > .RB ( p ): > Open a file in append mode. Create a subdirectory in a directory. So, in other words, if append mode is denied, then the file can be opened for writing (contingent on write permission being granted), but can't be opened with O_APPEND? Is that correct? This point needs to be made clearer. > .HP > .B execute > .RB ( x ): > Execute a file. Traverse / search a directory. See above comment re file/directory. > .HP > .B delete_child > .RB ( d ): > Delete a file or directory within a directory. > .HP > .B delete > .RB ( D ): > Delete the file or directory. > .HP > .B read_attributes > .RB ( a ): > Read basic attributes of a file or directory. What are "attributes" in this context? Does this mean stat(2)? Make this explicit. > This permission is always implicitly granted. > .HP > .B write_attributes > .RB ( A ): > Change the times associated with a file or directory to an arbitrary value. > This permission is always implicitly granted to the file owner. > .HP > .B read_acl > .RB ( c ): > Read the ACL of a file or directory. This permission is always > implicitly granted. > .HP > .B write_acl > .RB ( C ): > Change the ACL or file mode of a file or directory. > .HP > .B write_owner > .RB ( o ): > Take ownership of a file or directory. Change the owning group of a file or > directory to a group of which the calling process is a member. > .HP > .B read_named_attrs > .RB ( R ), > .B write_named_attrs > .RB ( W ), > .B synchronize > .RB ( S ), > .B write_retention > .RB ( e ), > .B write_retention_hold > .RB ( E ): > These permissions can be stored, but do not have a local meaning. So, I thenk that a sentence here should explain why these permissions exist. Is if for future extension, because they are meaningful in NFS, or something else? > .RE > > .SH TEXT FORM > > The common textual representation of richacl consists of the colon separated s/richacl/richacls/ (or, "RichACLs"/"richACLs") s/colon separated/colon-separated/ > fields of the the acl flags, file masks, and acl entries in the following s/acl/ACL/ (*2) > format: > .TP > \fBflags:\fR\fIacl_flags\fR > The ACL flags. > .TP > \fBowner:\fR\fIperm\fR\fB::mask\fR, \fBgroup:\fR\fIperm\fR\fB::mask\fR, \fBother:\fR\fIperm\fR\fB::mask\fR > The file masks and their permissions. > .TP > \fIwho\fR\fB:\fR\fIperm\fR\fB:\fR\fIflags\fR\fB:allow\fR, \fIwho\fR\fB:\fR\fIperm\fR\fB:\fR\fIflags\fR\fB:deny\fR > For each ACL entry, who the entry applies to, the permissions of the entry, the > entry flags, and whether the entry allows or denies permissions. The who field has s/who/\\fIwho\\fP/ > no prefix for special identifiers, a > .B user: > or > .B u: > prefix for regular users, and a > .B group: > or > .B g: > prefix for regular groups. > .PP > The entries are comma, whitespace or newline separated. s/whitespace/whitespace,/ > > Flags and permissions have single-letter as well as long forms as listed under s/forms/forms,/ > .IR "ACL Flags" , > .IR "ACL Entry Flags" , > and > .IR Permissions . If you follow my suggestion about capitalization in the ".SS" entries, you'll need to change the capitalization in the above phrases. > When the single-letter forms are used, the flags or permissions are > concatenated. When the long forms are used, the flags or permissions are > separated by slashes. To align permissions or flags vertically, dashes can be > use for padding. s/use/used/ > > .SH SETTING AND MODIFYING FILE PERMISSIONS > The access permissions for a file can either be set by assigning an access > control list (setrichacl) or by changing the file mode permission bits (chmod). Use .RB ( setrichacl (1)) for cross-reference. Use .RB ( chmod (1)). > In addition, a file can inherit an ACL from its parent > directory at create time; the inherited ACL is then further s/create/creation/ > restricted by the creating system call's mode parameter (see the creat(2) > manual page). creat(2) is pretty much history. I suggest writing (as given to .BR open (2), .BR mkdir (2), and similar). And here, I think we need a statement about whether the process umask has an effect or not... > > .SS Assigning An Access Control List > When assigning an ACL to a file, unless explicitly specified, the owner, group, > and other file masks will be computed from the ACL entries as described in > section > .IR "COMPUTING THE MAXIMUM FILE MASKS" . > The owner, group, and other file mode permission bits are then each set from > the owner, group, and other file mask as follows: > .IP \(bu 4 > If the file mask includes the > .B r > permission, the read > file mode permission bit will be set. > .IP \(bu > If the file mask includes the > .B w > or > .B p > permission, the write file mode permission bit will be set. > .IP \(bu > If the file mask includes the > .B x > permission, the execute file mode permission bit will be set. > .PP > If the ACL can be represented exactly by the file mode > permission bits, the file permission bits are set to match the access control > list and the ACL is not stored. (When the reverse happens and s/and/and the/ > ACL of a file is requested which doesn't have an explicit > ACL, the file mode permission bits are converted into an > equivalent richacl.) > > .SS Changing The File Mode Permission Bits I'd use lower case in the above for all words except the first > When changing the file mode permission bits with chmod(2), the owner, group, .BR chmod (2) > and other file permission bits are set to the permission bits in the new mode, > and the file masks each are set based on the new mode bits as follows: > .IP \(bu 4 > If the read bit in a set of permissions is set, the > .B r > permission in the corresponding file mask will be set. > .IP \(bu > If the write bit in a set of permissions is set, the > .B w > and > .B p > permissions in the corresponding file mask will be set. > .IP \(bu > If the execute bit in a set of permissions is set, the > .B x > permission in the corresponding file mask will be set. > .PP > In addition, the > .B masked > and > .B write_through > ACL flags are set. This has the > effect of limiting the permissions granted by the ACL to the file mode > permission bits; in addition, the owner is granted the owner mode bits and > others are granted the other mode bits. If the > .B auto_inherit > flag is set, the > .B protected > flag is also set to prevent the Automatic Inheritance algorithm from modifying > the ACL. > > .SS Permissions At File Create Time s/File Create/file-creation/ I'd use lower case in the above for all words except the first > When a directory has inheritable ACL entries, the following > happens when a file or directory is created inside that directory: > .RS 4 > .IP 1. 4 > A file created inside that directory will inherit all entries with the s/all entries with/all of the directories entries that/ > .B file_inherit > flag set, and all inheritance-related flags in the inherited entries will be > cleared. > > A subdirectory will inherit all entries with the > .B file_inherit > or > .B dir_inherit > flag set. Entries whose > .B no_propagate > flag is set will have all inheritance-related flags cleared. Entries whose > .B no_propagate > and > .B dir_inherit > flags are not set and whose > .B file_inherit > is set will have their > .B inherit_only > flag set. > .IP 2. > If the parent directory's ACL has the > .B auto_inherit > flag set, the inherited ACL will have its > .B auto_inherit > flag set, and all entries will have their > .B inherited > flag set. > .IP 3. > The three file masks are computed from the inherited ACL as described in > section > .IR "COMPUTING THE MAXIMUM FILE MASKS" . > .IP 4. > The three sets of permissions for the owner, the group, and for others in > the mode parameter of the creating system call are converted into sets of > richacl permissions as described in section s/in/in the/ > .IR "Changing The File Mode Permission Bits" . > Any richacl permissions not included in those sets are > removed from the owner, group, and other file masks. The file mode permission > bits are then computed from the file masks as described in section s/in/in the/ > .IR "Assigning An Access Control List" . > .IP 5. > The > .B masked > ACL flag is set. The > .B write_through > ACL flag remains cleared. In addition, if the > .B auto_inherit > flag of the inherited ACL is set, the > .B protected > flag is also set to prevent the Automatic Inheritance algorithm from modifying > the ACL. > .RE > .PP > When a directory does not have inheritable ACL entries, files > and directories created inside that directory will not be assigned access > control lists and the file mode permission bits will be set to (mode\ &\ > ~umask). will be set to (mode & umask) where .I mode is the permission mode argument of the relevant system call and .I umask is the process umask (see .BR umask (2)). > > .SS Automatic Inheritance I'd use lower case in the above for all words except the first > Automatic Inheritance allows permission changes to propagate from a directory > to files and subdirectories inside that directory, recursively. Carrying out > this propagation of permissions is the responsibility of the process changing > the directory permissions (usually, setrichacl(1)). I'm confused by the previous sentence. the feature is labeled "Automatic Inheritance", implying that the user/process need do nothing. The next sentence says "propagation ... is the responsibility of the process". These two points seem contradictory. I think something more needs to be said here. > > A significant limitation is that this mechanism works only as long as files > are created without explicitly specifying the file permissions to use. The > standard system calls for creating files an directories (creat(2), open(2), > mkdir(2), mkfifo(2), mknod(2)) all have mandatory mode parameters which define Format that system call list as .RB ( creat (2), .BR open (2), .BR mkdir (2), .BR mknod (2)) Note that I removed mkfifo(): it's a library functionlayered on mkonod(2). > the maximum allowed permissions of the new files. To take account of this > restriction, the > .B protected > ACL flag must be set if the > .B inherited > flag is set. This effectively disables Automatic Inheritance for that > particular file. > > Automatic Inheritance still remains useful for network protocols like NFSv4 and > SMB, which both support creating files and directories without defining which > permissions: they can implement those operations by using the standard system > calls and by then undoing the effect of applying the mode parameters. > > When the ACL of a directory is changed, the following should Why "should"? > happen for each entry inside that directory (for each \(lqchild\(rq): Make the preceding line: happen for each entry (\(lqchild\(rq) inside that directory: > .IP 1. 4 > If the entry is a symblic link, skip the child. > .IP 2. > If the > .B auto_inherit > flag of the entry's ACL is not set or the > .B protected > flag is set, skip the child. > .IP 3. > With the child's ACL: > .RS 4 > .IP 1. 4 s/1./a)/ (i.e., use a different labeling scheme for the sublist) > If the > .B defaulted > flag is set, replace the ACL with an empty ACL > with the > .B auto_inherit > flag set. > .IP 2. s/2./b)/ > Delete all entries which have the > .B inherited > flag set. > .IP 3. s/3./c)/ > Append all entries inherited from the parent directory according to step 1 of > the algorithm described under > .IR "Permissions At File Create Time". > Set the > .B inherited > flag of each of these entries. > .IP 4. s/4./d)/ > Recompute the file masks. > .RE > .IP 4. > If the child is a directory, recursively apply this algorithm. > > .SH ACCESS CHECK ALGORITHM > > When a process requests a particular kind of access to a file defined by a set s/defined/protected/ (?) > of richacl permissions, the following algorithm determines if the access is s/if/whether/ > granted or denied: > > .IP 1. 4 > If the > .B masked > ACL flag is set, then: > .RS 4 > .IP 1. 4 s/1./a)/ Use a different numbering scheme for sublists. > if the s/if/If/ > .B write_through > ACL flag is set, then: > .RS 4 > .IP \(bu 4 > if the requesting process is the file owner, then access is granted if the s/if/If/ > owner mask includes the requested permissions, and is otherwise denied. > .IP \(bu > if the requesting process is not the file owner, is not in the owning group, s/if/If/ > and no ACL entries other than > .B everyone@ > match the process, then access is granted if the other mask includes the > requested permissions, and is otherwise denied. > .RE > .IP 2. s/2./b)/ > if any of the following is true: s/if/If/ > .RS 4 > .IP \(bu 4 > the requesting process is the file owner and the owner mask does no include all s/no /not / > requested permissions, > .IP \(bu 4 > the requesting process is not the file owner and it is in the owning group or > matches any ACL entries other than > .BR everyone@ , > and the group mask does no include all requested permissions, > .IP \(bu 4 > the requesting process is not the file owner, not in the owning group, it > matches no ACL entries other than > .BR everyone@ , > and the other mask does no include all requested permissions, > .PP > then access is denied. > .RE > .RE > .IP 2. > Set the remaining permissions to the requested permissions. Go through all ACL > entries. For each entry: > .RS 4 > .IP 1. 4 s/1./a)/ Use a different numbering scheme for sublists. > if the > .B inherit_only > or > .B unmapped > flags are set, continue with the next ACL entry. > .IP 2. s/2./b)/ > if any of the following is true: > .RS 4 > .IP \(bu 4 > the entry's identifier is > .B owner@ > and the requesting process is the file owner, > .IP \(bu > the entry's identifier is > .B group@ > and the requesting process is in the owning group, > .IP \(bu > the entry's identifier is a user and the requesting process is owned by that > user, > .IP \(bu > the entry's identifier is a group and the requesting process is a member in > that group, > .IP \(bu > the entry's identifier is > .BR everyone@ , > .PP > the entry matches the process; proceed. Otherwise, continue with the next ACL s/proceed/proceed to the next step/ (?) > entry. > .RE > .IP 3. s/3./c)/ > If the entry denies any of the remaining permissions, access is denied. > .IP 4. s/4./d)/ > If the entry allows any of the remaining permissions, then: > .RS 4 > .IP \(bu 4 > if the > .B masked > ACL flag is set and the entry's identifier is not > .B owner@ > or > .BR everyone@ > or is a user entry matching the file owner, remove all permissions from the > remaining permissions which are both allowed by the entry and included in the > group mask, > .IP \(bu > otherwise, remove all permissions from the remaining permissions wich are > allowed by the entry. > .RE > .RE > .IP 3. > If there are no more remaining permissions, access is allowed. Otherwise, > access is denied. > > .SH COMPUTING THE MAXIMUM FILE MASKS > When setting an ACL and no file masks have been explicitly specified and when > inheriting an ACL from the parent directory, the following algorithm is used > for computing the file masks: > > .IP 1. 4 > Clear the owner, group, and other file masks. Remember which permissions have > already been processed (initially, the empty set). > .IP 2. > For each ACL entry: > .RS 4 > .IP \(bu 4 > If the > .B inherit_only > flag is set, skip the entry. > .IP \(bu 4 > Otherwise, compute which permissions the entry allows or denies that have not > been processed yet (the remaining permissions). > .IP \(bu > If the entry is an > .B owner@ > entry, add the remaining permissions to the owner mask for > .B allow > entries, and remove the remaining permissions from the owner mask for > .B deny > entries. > .IP \(bu > Otherwise, if the entry is an > .B everyone@ > entry, proceed as with > .B owner@ > entries but add or remove the remaining permissions from the owner, group, and > other file masks. > .IP \(bu > Otherwise, proceed as with > .B owner@ > entries but add or remove the remaining permissions from the owner and group > file masks. > .IP \(bu > Add the entry's permissions to the processed permissions. > .RE > .PP > The resulting file masks represent the ACL as closely as possible. With these > file masks, if the > .B masked > ACL flag is set, the effective permissions still stay the same. This page is in *desperate* need of *multiple* examples, starting simple, and building up in complexity, with walkthogh text explaining how the permisssions are interpreted and how the masks are generated. Having read the page multiple times (and having little knowledge of NFS ACLs), I'm still struggling to put all the pieces together. Probably some examples that relate to an NFS context would also be helpful. > .\" .SH BUGS > .SH AUTHOR > Written by Andreas Grünbacher . > > Please send your bug reports, suggested features and comments to the above address. > > .SH CONFORMING TO > Rich Access Control Lists are Linux-specific. > .SH SEE ALSO > .BR chmod (1), > .BR getrichacl (1), > .BR ls (1), > .BR setrichacl (1) > .BR stat (2), > .BR umask (2), > .BR acl (7) > .\" librichacl Cheers, Michael -- Michael Kerrisk Linux man-pages maintainer; http://www.kernel.org/doc/man-pages/ Linux/UNIX System Programming Training: http://man7.org/training/ From martin@lichtvoll.de Sun Feb 7 12:16:51 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=ham version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay3.corp.sgi.com [198.149.34.15]) by oss.sgi.com (Postfix) with ESMTP id EEDCA29DF5 for ; Sun, 7 Feb 2016 12:16:50 -0600 (CST) Received: from cuda.sgi.com (cuda1.sgi.com [192.48.157.11]) by relay3.corp.sgi.com (Postfix) with ESMTP id 8D865AC003 for ; Sun, 7 Feb 2016 10:16:47 -0800 (PST) X-ASG-Debug-ID: 1454869001-04bdf079c5fbd50001-NocioJ Received: from mail.lichtvoll.de (mondschein.lichtvoll.de [194.150.191.11]) by cuda.sgi.com with ESMTP id QB6EfDL5GkbUIfcK for ; Sun, 07 Feb 2016 10:16:41 -0800 (PST) X-Barracuda-Envelope-From: martin@lichtvoll.de X-Barracuda-Apparent-Source-IP: 194.150.191.11 Received: from merkaba.localnet (host-188-174-223-41.customer.m-online.net [188.174.223.41]) by mail.lichtvoll.de (Postfix) with ESMTPSA id B854E274; Sun, 7 Feb 2016 19:16:40 +0100 (CET) From: Martin Steigerwald To: "Michael Kerrisk (man-pages)" Cc: Andreas Gruenbacher , "J. Bruce Fields" , linux-ext4@vger.kernel.org, xfs@oss.sgi.com, lkml , linux-fsdevel@vger.kernel.org, linux-nfs@vger.kernel.org, linux-cifs@vger.kernel.org, Linux API , Dave Chinner , Christoph Hellwig , Anna Schumaker , Trond Myklebust , Jeff Layton , Andreas Dilger Subject: Re: getrichacl(1) man page review comments Date: Sun, 07 Feb 2016 19:16:40 +0100 X-ASG-Orig-Subj: Re: getrichacl(1) man page review comments Message-ID: <1505883.O2zQ69A2Zb@merkaba> User-Agent: KMail/5.1.64 (Linux/4.4.0-tp520-btrfstrim+; KDE/5.19.0; x86_64; git-9d5c25b; 2016-02-06) In-Reply-To: <56B77139.4080209@gmail.com> References: <56B770B6.7040803@gmail.com> <56B77139.4080209@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="UTF-8" X-Barracuda-Connect: mondschein.lichtvoll.de[194.150.191.11] X-Barracuda-Start-Time: 1454869001 X-Barracuda-URL: https://192.48.157.11:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-BRTS-Status: 1 X-Barracuda-Spam-Score: 0.00 X-Barracuda-Spam-Status: No, SCORE=0.00 using per-user scores of TAG_LEVEL=1000.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.7 tests=BSF_SC0_MISMATCH_TO X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.3.26831 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 0.00 BSF_SC0_MISMATCH_TO Envelope rcpt doesn't match header Am Sonntag, 7. Februar 2016, 17:30:49 CET schrieb Michael Kerrisk (man-page= s): > Hello Andreas, >=20 > Here, some comments on the getrichacl(1) page. I know that the command names are based on setfacl and getfacl. But sometim= es=20 I still wonder about these names. They just don=C2=B4t fit. Its chsomething for changing things in Unix traditionally =E2=80=93 chown, = chmod,=20 chattr, chage chsh, you name it =E2=80=93, but there is nothing for queryin= g things.=20 So I get where this is coming from, yet I always found setfacl and getfacl= =20 command names cumbersome. Sorry, for posting here instead of a previous richacl implementation patchs= et.=20 I fully appreciate that it may be too late to change anything regarding=20 command names. Also considering usermod and groupmod the command naming in= =20 Unix / Linux appears to be a big mess anyway. Thanks, =2D-=20 Martin From dan.j.williams@intel.com Sun Feb 7 12:19:35 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=T_DKIM_INVALID autolearn=ham version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay2.corp.sgi.com [137.38.102.29]) by oss.sgi.com (Postfix) with ESMTP id 5FA6729DF5 for ; Sun, 7 Feb 2016 12:19:35 -0600 (CST) Received: from cuda.sgi.com (cuda2.sgi.com [192.48.176.25]) by relay2.corp.sgi.com (Postfix) with ESMTP id 50D47304043 for ; Sun, 7 Feb 2016 10:19:32 -0800 (PST) X-ASG-Debug-ID: 1454869169-04cbb04cfc121140001-NocioJ Received: from mail-yw0-f173.google.com (mail-yw0-f173.google.com [209.85.161.173]) by cuda.sgi.com with ESMTP id 0bQc4pkeJ02qFeMf (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128 verify=NO) for ; Sun, 07 Feb 2016 10:19:30 -0800 (PST) X-Barracuda-Envelope-From: dan.j.williams@intel.com X-Barracuda-Apparent-Source-IP: 209.85.161.173 Received: by mail-yw0-f173.google.com with SMTP id g127so88032686ywf.2 for ; Sun, 07 Feb 2016 10:19:30 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=intel-com.20150623.gappssmtp.com; s=20150623; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=l90sa513N7j8emNvplZ7DDZ3GVGEAyl8jywwC5YIWew=; b=rGMd4YpgcBsltfNhKCWTxDdOLJGjaKPoB/KyXJylnb2ZkIiL25O/bZtkKs4k2h8FfY uI6PnRFc38CPjbNLd3M+ttl5e3Dl3gzcprbZov0NZ8D36r1JtxF4RFjJjqZ5UHvzPotO OvHjo3HwcZV/RUTA9pKRrbi+P3eEiT4ht8Lc9vMJ7ucZCZ+5Xs3Vb+FGp1/BrRTOjyCK xw19xlMIB3IQGwkDT5oHtFQ29ehiq/bsxzFEUFo3Kdm6V4DgEXoUDQS74JbRdOI8ccY0 sHvxEzXL2v5nocGZ1H+TjUiZoTVvOkpJyex/WEORVwz1gAyqs60K3KmSeXj9uktY7amV iSMg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:date :message-id:subject:from:to:cc:content-type; bh=l90sa513N7j8emNvplZ7DDZ3GVGEAyl8jywwC5YIWew=; b=GeZaWmOLwbMJ1cQf5glxVENzxivdYDlTpxh4x26akQiLg2YrG+YNHz2v69dSWNFSUW a6xg/iyPoH+2NXRYIeeoh4GhCvWYbjpHBBCKCFvG6jWphJ9Wv1JGwXJBn6J8HC2f+pKF 6BZ1vviVziWk/MlsgQjO+ld0DNapPvEhcIYz6av8URKOuaW1izeLpUHNA05OPZKunI3V iVQbDJ6VutNb/dgQF2/hZI839rrD2BQmDnUSPCtT2rqCwq2O07Ff4ZLI7AYEUkTLIsTS ASiOXuYpmxX43uWW15+/KoIIFiF8X4OgNsvFbrAYqi0KBsM3zOLDm6U9Jm0QZEKgGQHk EcAw== X-Gm-Message-State: AG10YOT8w7SjvLQ52dMxDJh5E7YrEUDgyo37xaIEhCowSWQ6elDSzTpT9wXeMtIz7KX/6snN8V3br8mye3d4o7j8 MIME-Version: 1.0 X-Received: by 10.129.48.137 with SMTP id w131mr3126657yww.82.1454869169632; Sun, 07 Feb 2016 10:19:29 -0800 (PST) Received: by 10.37.223.199 with HTTP; Sun, 7 Feb 2016 10:19:29 -0800 (PST) In-Reply-To: <1454829553-29499-2-git-send-email-ross.zwisler@linux.intel.com> References: <1454829553-29499-1-git-send-email-ross.zwisler@linux.intel.com> <1454829553-29499-2-git-send-email-ross.zwisler@linux.intel.com> Date: Sun, 7 Feb 2016 10:19:29 -0800 Message-ID: Subject: Re: [PATCH 1/2] dax: pass bdev argument to dax_clear_blocks() From: Dan Williams X-ASG-Orig-Subj: Re: [PATCH 1/2] dax: pass bdev argument to dax_clear_blocks() To: Ross Zwisler Cc: "linux-kernel@vger.kernel.org" , "Theodore Ts'o" , Alexander Viro , Andreas Dilger , Andrew Morton , Dave Chinner , Jan Kara , Matthew Wilcox , linux-ext4 , linux-fsdevel , Linux MM , "linux-nvdimm@lists.01.org" , XFS Developers Content-Type: text/plain; charset=UTF-8 X-Barracuda-Connect: mail-yw0-f173.google.com[209.85.161.173] X-Barracuda-Start-Time: 1454869170 X-Barracuda-Encrypted: ECDHE-RSA-AES128-GCM-SHA256 X-Barracuda-URL: https://192.48.176.25:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-BRTS-Status: 1 X-Barracuda-Spam-Score: 0.00 X-Barracuda-Spam-Status: No, SCORE=0.00 using per-user scores of TAG_LEVEL=1000.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.7 tests=BSF_SC0_MISMATCH_TO, DKIM_SIGNED, DKIM_VERIFIED X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.3.26832 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 0.00 BSF_SC0_MISMATCH_TO Envelope rcpt doesn't match header -0.00 DKIM_VERIFIED Domain Keys Identified Mail: signature passes verification 0.00 DKIM_SIGNED Domain Keys Identified Mail: message has a signature On Sat, Feb 6, 2016 at 11:19 PM, Ross Zwisler wrote: > dax_clear_blocks() needs a valid struct block_device and previously it was > using inode->i_sb->s_bdev in all cases. This is correct for normal inodes > on mounted ext2, ext4 and XFS filesystems, but is incorrect for DAX raw > block devices and for XFS real-time devices. > > Instead, have the caller pass in a struct block_device pointer which it > knows to be correct. > > Signed-off-by: Ross Zwisler > --- > fs/dax.c | 4 ++-- > fs/ext2/inode.c | 5 +++-- > fs/xfs/xfs_aops.c | 2 +- > fs/xfs/xfs_aops.h | 1 + > fs/xfs/xfs_bmap_util.c | 4 +++- > include/linux/dax.h | 3 ++- > 6 files changed, 12 insertions(+), 7 deletions(-) > > diff --git a/fs/dax.c b/fs/dax.c > index 227974a..4592241 100644 > --- a/fs/dax.c > +++ b/fs/dax.c > @@ -83,9 +83,9 @@ struct page *read_dax_sector(struct block_device *bdev, sector_t n) > * and hence this means the stack from this point must follow GFP_NOFS > * semantics for all operations. > */ > -int dax_clear_blocks(struct inode *inode, sector_t block, long _size) > +int dax_clear_blocks(struct inode *inode, struct block_device *bdev, > + sector_t block, long _size) Since this is a bdev relative routine we should also resolve the sector, i.e. the signature should drop the inode: int dax_clear_sectors(struct block_device *bdev, sector_t sector, long _size) From dan.j.williams@intel.com Sun Feb 7 13:13:55 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=T_DKIM_INVALID autolearn=ham version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay2.corp.sgi.com [137.38.102.29]) by oss.sgi.com (Postfix) with ESMTP id 5D47B29DF5 for ; Sun, 7 Feb 2016 13:13:55 -0600 (CST) Received: from cuda.sgi.com (cuda1.sgi.com [192.48.157.11]) by relay2.corp.sgi.com (Postfix) with ESMTP id 21D36304032 for ; Sun, 7 Feb 2016 11:13:55 -0800 (PST) X-ASG-Debug-ID: 1454872432-04bdf079c3fe030001-NocioJ Received: from mail-yw0-f179.google.com (mail-yw0-f179.google.com [209.85.161.179]) by cuda.sgi.com with ESMTP id sZhyZ1DCL2hUom5S (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128 verify=NO) for ; Sun, 07 Feb 2016 11:13:52 -0800 (PST) X-Barracuda-Envelope-From: dan.j.williams@intel.com X-Barracuda-Apparent-Source-IP: 209.85.161.179 Received: by mail-yw0-f179.google.com with SMTP id q190so88695217ywd.3 for ; Sun, 07 Feb 2016 11:13:52 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=intel-com.20150623.gappssmtp.com; s=20150623; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=BQaHOnzItGGoAJ2WLwhT0gHM6aDwh2WvrKhYfp0VPsA=; b=f7AibMMc3R+TObOWD6n7RqQpCr2gIikI5GS6IQGUOGMiCBZivMyuMiGrbEMKPZq5x1 qI+NWjXhi1zphpl0gATNUnUNcSv4xg+XpkxkIAt2P+7JyN/pDFETA7/twR8hPsbbqyVE fqjgdYtE1CmtuAYMHyngffXIoBtxIOZkamHFOn8CL8UZ+BHNbcAk9aWzBNkwHFD7vhd3 kHXCQRAAYqWqP4yHoBlX+zMyh1sjoZXq75XLS8aWt/zCzi0bSaDeQPAeCZz9pPIWLW70 Xz9Pe5Aia8srjb7T5CS15ppXpbXrysGDMaPlXm3PAbUEz4GjIeTGuMkigFQQt/2DSmjA LkSg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:date :message-id:subject:from:to:cc:content-type; bh=BQaHOnzItGGoAJ2WLwhT0gHM6aDwh2WvrKhYfp0VPsA=; b=jJQePKDvGHOO+fdIa3NipNfqxpL1TgcxAtLPJhUOthLUn9DyJLYcC+1beLlnGp+NTI D9GQXfJljzjiiuFq3R2LVxrz/FF5DIUPjxOa70Q0ex5c83mXoxZKm3h7nOLeUAfQBAI8 8YhshIkEN77jnTbCr/7+a1TaeqY+qQ2dymDwuwvaVpeCO6DHLAvWvF9s9bu0nFO3izIG OT+4Lp6l7OxdlT2pD86UNkRAyV6fFgaCtjHsEnpLlgRdZdDgG1dAszqm1HUGzIKRdEY3 ofEig/YwXoHEL0LzZsmGxcwgwsNBlYOnfLNOzkZ1BGn/QcuKitIvPercux9y3pM3a1Qc iEUg== X-Gm-Message-State: AG10YOR1Je4d1unTu1orONwchSSZBrYLgF6UcqL9N0sVqJUWGhcbCV8pTjGzpAiyW/iU2DcVZGLm3dYwmCL5DaPS MIME-Version: 1.0 X-Received: by 10.129.85.85 with SMTP id j82mr12267990ywb.28.1454872431940; Sun, 07 Feb 2016 11:13:51 -0800 (PST) Received: by 10.37.223.199 with HTTP; Sun, 7 Feb 2016 11:13:51 -0800 (PST) In-Reply-To: <1454829553-29499-3-git-send-email-ross.zwisler@linux.intel.com> References: <1454829553-29499-1-git-send-email-ross.zwisler@linux.intel.com> <1454829553-29499-3-git-send-email-ross.zwisler@linux.intel.com> Date: Sun, 7 Feb 2016 11:13:51 -0800 Message-ID: Subject: Re: [PATCH 2/2] dax: move writeback calls into the filesystems From: Dan Williams X-ASG-Orig-Subj: Re: [PATCH 2/2] dax: move writeback calls into the filesystems To: Ross Zwisler Cc: "linux-kernel@vger.kernel.org" , "Theodore Ts'o" , Alexander Viro , Andreas Dilger , Andrew Morton , Dave Chinner , Jan Kara , Matthew Wilcox , linux-ext4 , linux-fsdevel , Linux MM , "linux-nvdimm@lists.01.org" , XFS Developers , jmoyer Content-Type: text/plain; charset=UTF-8 X-Barracuda-Connect: mail-yw0-f179.google.com[209.85.161.179] X-Barracuda-Start-Time: 1454872432 X-Barracuda-Encrypted: ECDHE-RSA-AES128-GCM-SHA256 X-Barracuda-URL: https://192.48.157.11:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-BRTS-Status: 1 X-Barracuda-Spam-Score: 0.00 X-Barracuda-Spam-Status: No, SCORE=0.00 using per-user scores of TAG_LEVEL=1000.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.7 tests=BSF_SC0_MISMATCH_TO, DKIM_SIGNED, DKIM_VERIFIED X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.3.26832 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 0.00 BSF_SC0_MISMATCH_TO Envelope rcpt doesn't match header -0.00 DKIM_VERIFIED Domain Keys Identified Mail: signature passes verification 0.00 DKIM_SIGNED Domain Keys Identified Mail: message has a signature On Sat, Feb 6, 2016 at 11:19 PM, Ross Zwisler wrote: > Previously calls to dax_writeback_mapping_range() for all DAX filesystems > (ext2, ext4 & xfs) were centralized in filemap_write_and_wait_range(). > dax_writeback_mapping_range() needs a struct block_device, and it used to > get that from inode->i_sb->s_bdev. This is correct for normal inodes > mounted on ext2, ext4 and XFS filesystems, but is incorrect for DAX raw > block devices and for XFS real-time files. > > Instead, call dax_writeback_mapping_range() directly from the filesystem or > raw block device fsync/msync code so that they can supply us with a valid > block device. > > It should be noted that this will reduce the number of calls to > dax_writeback_mapping_range() because filemap_write_and_wait_range() is > called in the various filesystems for operations other than just > fsync/msync. Both ext4 & XFS call filemap_write_and_wait_range() outside > of ->fsync for hole punch, truncate, and block relocation > (xfs_shift_file_space() && ext4_collapse_range()/ext4_insert_range()). > > I don't believe that these extra flushes are necessary in the DAX case. In > the page cache case when we have dirty data in the page cache, that data > will be actively lost if we evict a dirty page cache page without flushing > it to media first. For DAX, though, the data will remain consistent with > the physical address to which it was written regardless of whether it's in > the processor cache or not - really the only reason I see to flush is in > response to a fsync or msync so that our data is durable on media in case > of a power loss. The case where we could throw dirty data out of the page > cache and essentially lose writes simply doesn't exist. > > Signed-off-by: Ross Zwisler > --- > fs/block_dev.c | 7 +++++++ > fs/dax.c | 5 ++--- > fs/ext2/file.c | 10 ++++++++++ > fs/ext4/fsync.c | 10 +++++++++- > fs/xfs/xfs_file.c | 12 ++++++++++-- > include/linux/dax.h | 4 ++-- > mm/filemap.c | 6 ------ > 7 files changed, 40 insertions(+), 14 deletions(-) This sprinkling of dax specific fixups outside of vm_operations_struct routines still has me thinking that we are going in the wrong direction for fsync/msync support. If an application is both unaware of DAX and doing mmap I/O it is better served by the page cache where writeback is durable by default. We expect DAX-aware applications to assume responsibility for cpu cache management [1]. Making DAX mmap semantics explicit opt-in solves not only durability support, but also the current problem that DAX gets silently disabled leaving an app to wonder if it really got a direct mapping. DAX also silently picks pud, pmd, or pte mappings which is information an application would really like to know at map time. The proposal: make applications explicitly request DAX semantics with a new MAP_DAX flag and fail if DAX is unavailable. Document that a successful MAP_DAX request mandates that the application assumes responsibility for cpu cache management. Require that all applications that mmap the file agree on MAP_DAX. This also solves the future problem of DAX support on virtually tagged cache architectures where it is difficult for the kernel to know what alias addresses need flushing. [1]: https://github.com/pmem/nvml From david@fromorbit.com Sun Feb 7 15:50:58 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=ham version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay3.corp.sgi.com [198.149.34.15]) by oss.sgi.com (Postfix) with ESMTP id AFBC329DF5 for ; Sun, 7 Feb 2016 15:50:58 -0600 (CST) Received: from cuda.sgi.com (cuda2.sgi.com [192.48.176.25]) by relay3.corp.sgi.com (Postfix) with ESMTP id 35C65AC001 for ; Sun, 7 Feb 2016 13:50:54 -0800 (PST) X-ASG-Debug-ID: 1454881850-04cbb04cfa12abf0001-NocioJ Received: from ipmail06.adl2.internode.on.net (ipmail06.adl2.internode.on.net [150.101.137.129]) by cuda.sgi.com with ESMTP id McFJB8rnCxZHeEn1 for ; Sun, 07 Feb 2016 13:50:50 -0800 (PST) X-Barracuda-Envelope-From: david@fromorbit.com X-Barracuda-Apparent-Source-IP: 150.101.137.129 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: A2CaDABou7dWPBATLHleKAECgw+BP4Jpg3qBeJ0/AQEBAQEBBotmhUSEB4YHAgIBAQKBH00BAQEBAQEHAQEBAUE/hEIBAQQnExwjEAgDGAklDwUlAwcaE4gavHABAQgCAR0YhTKEf4QWBoRQBZZ1jUeOfINSimyEWiguAYcagTgBAQE Received: from ppp121-44-19-16.lns20.syd4.internode.on.net (HELO dastard) ([121.44.19.16]) by ipmail06.adl2.internode.on.net with ESMTP; 08 Feb 2016 08:20:48 +1030 Received: from dave by dastard with local (Exim 4.80) (envelope-from ) id 1aSXEF-0006Pq-Om; Mon, 08 Feb 2016 08:50:47 +1100 Date: Mon, 8 Feb 2016 08:50:47 +1100 From: Dave Chinner To: Dan Williams Cc: Ross Zwisler , "linux-kernel@vger.kernel.org" , Theodore Ts'o , Alexander Viro , Andreas Dilger , Andrew Morton , Jan Kara , Matthew Wilcox , linux-ext4 , linux-fsdevel , Linux MM , "linux-nvdimm@lists.01.org" , XFS Developers , jmoyer Subject: Re: [PATCH 2/2] dax: move writeback calls into the filesystems Message-ID: <20160207215047.GJ31407@dastard> X-ASG-Orig-Subj: Re: [PATCH 2/2] dax: move writeback calls into the filesystems References: <1454829553-29499-1-git-send-email-ross.zwisler@linux.intel.com> <1454829553-29499-3-git-send-email-ross.zwisler@linux.intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.21 (2010-09-15) X-Barracuda-Connect: ipmail06.adl2.internode.on.net[150.101.137.129] X-Barracuda-Start-Time: 1454881850 X-Barracuda-URL: https://192.48.176.25:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-BRTS-Status: 1 X-Barracuda-Spam-Score: 0.00 X-Barracuda-Spam-Status: No, SCORE=0.00 using per-user scores of TAG_LEVEL=1000.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.7 tests=BSF_SC0_MISMATCH_TO X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.3.26838 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 0.00 BSF_SC0_MISMATCH_TO Envelope rcpt doesn't match header On Sun, Feb 07, 2016 at 11:13:51AM -0800, Dan Williams wrote: > On Sat, Feb 6, 2016 at 11:19 PM, Ross Zwisler > wrote: > > Previously calls to dax_writeback_mapping_range() for all DAX filesystems > > (ext2, ext4 & xfs) were centralized in filemap_write_and_wait_range(). > > dax_writeback_mapping_range() needs a struct block_device, and it used to > > get that from inode->i_sb->s_bdev. This is correct for normal inodes > > mounted on ext2, ext4 and XFS filesystems, but is incorrect for DAX raw > > block devices and for XFS real-time files. > > > > Instead, call dax_writeback_mapping_range() directly from the filesystem or > > raw block device fsync/msync code so that they can supply us with a valid > > block device. > > > > It should be noted that this will reduce the number of calls to > > dax_writeback_mapping_range() because filemap_write_and_wait_range() is > > called in the various filesystems for operations other than just > > fsync/msync. Both ext4 & XFS call filemap_write_and_wait_range() outside > > of ->fsync for hole punch, truncate, and block relocation > > (xfs_shift_file_space() && ext4_collapse_range()/ext4_insert_range()). > > > > I don't believe that these extra flushes are necessary in the DAX case. In > > the page cache case when we have dirty data in the page cache, that data > > will be actively lost if we evict a dirty page cache page without flushing > > it to media first. For DAX, though, the data will remain consistent with > > the physical address to which it was written regardless of whether it's in > > the processor cache or not - really the only reason I see to flush is in > > response to a fsync or msync so that our data is durable on media in case > > of a power loss. The case where we could throw dirty data out of the page > > cache and essentially lose writes simply doesn't exist. > > > > Signed-off-by: Ross Zwisler > > --- > > fs/block_dev.c | 7 +++++++ > > fs/dax.c | 5 ++--- > > fs/ext2/file.c | 10 ++++++++++ > > fs/ext4/fsync.c | 10 +++++++++- > > fs/xfs/xfs_file.c | 12 ++++++++++-- > > include/linux/dax.h | 4 ++-- > > mm/filemap.c | 6 ------ > > 7 files changed, 40 insertions(+), 14 deletions(-) > > This sprinkling of dax specific fixups outside of vm_operations_struct > routines still has me thinking that we are going in the wrong > direction for fsync/msync support. > > If an application is both unaware of DAX and doing mmap I/O it is > better served by the page cache where writeback is durable by default. > We expect DAX-aware applications to assume responsibility for cpu > cache management [1]. Making DAX mmap semantics explicit opt-in > solves not only durability support, but also the current problem that > DAX gets silently disabled leaving an app to wonder if it really got a > direct mapping. DAX also silently picks pud, pmd, or pte mappings > which is information an application would really like to know at map > time. > > The proposal: make applications explicitly request DAX semantics with > a new MAP_DAX flag and fail if DAX is unavailable. No. As I've stated before, the entire purpose of enabling DAX through existing filesytsems like XFS and ext4 is so that existing applications work with DAX *without modification*. That is, applications can be entirely unaware of the fact that the filesystem is giving them direct access to the storage because the access and failure semantics of DAX enabled mmap are *identical to the existing mmap semantics*. Given this, the app doesn't need to care whether DAX is enabled or not; all that will be seen is a difference in speed of access. Enabling and disabling DAX is, at this point, purely an administration decision - if the hardware and filesystem supports it, it can be turned on without having to wait years for application developers to add support for it.... -Dave. -- Dave Chinner david@fromorbit.com From david@fromorbit.com Sun Feb 7 16:04:38 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=ham version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay3.corp.sgi.com [198.149.34.15]) by oss.sgi.com (Postfix) with ESMTP id 4C43C29DF5 for ; Sun, 7 Feb 2016 16:04:38 -0600 (CST) Received: from cuda.sgi.com (cuda3.sgi.com [192.48.176.15]) by relay3.corp.sgi.com (Postfix) with ESMTP id E12DFAC003 for ; Sun, 7 Feb 2016 14:04:34 -0800 (PST) X-ASG-Debug-ID: 1454882671-04cb6c2744139280001-NocioJ Received: from ipmail06.adl2.internode.on.net (ipmail06.adl2.internode.on.net [150.101.137.129]) by cuda.sgi.com with ESMTP id 1pHiaihkcLN0al1P for ; Sun, 07 Feb 2016 14:04:32 -0800 (PST) X-Barracuda-Envelope-From: david@fromorbit.com X-Barracuda-Apparent-Source-IP: 150.101.137.129 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: A2AfDADqvrdWPBATLHleKAECgw+BP4Jpg3qBeJ0/AQEBAQEBBotmhUSEB4YHBAICgSBNAQEBAQEBBwEBAQFBP4RCAQEEJxMcIxAIAxgJJQ8FJQMHGhOIGrxzAQseGIUyhH+IbAEElnWNR458RI16gmUZgVwoLohTAQEB Received: from ppp121-44-19-16.lns20.syd4.internode.on.net (HELO dastard) ([121.44.19.16]) by ipmail06.adl2.internode.on.net with ESMTP; 08 Feb 2016 08:33:29 +1030 Received: from dave by dastard with local (Exim 4.80) (envelope-from ) id 1aSXQX-0006RL-Ce; Mon, 08 Feb 2016 09:03:29 +1100 Date: Mon, 8 Feb 2016 09:03:29 +1100 From: Dave Chinner To: Ross Zwisler Cc: linux-kernel@vger.kernel.org, Theodore Ts'o , Alexander Viro , Andreas Dilger , Andrew Morton , Dan Williams , Jan Kara , Matthew Wilcox , linux-ext4@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux-mm@kvack.org, linux-nvdimm@lists.01.org, xfs@oss.sgi.com Subject: Re: [PATCH 1/2] dax: pass bdev argument to dax_clear_blocks() Message-ID: <20160207220329.GK31407@dastard> X-ASG-Orig-Subj: Re: [PATCH 1/2] dax: pass bdev argument to dax_clear_blocks() References: <1454829553-29499-1-git-send-email-ross.zwisler@linux.intel.com> <1454829553-29499-2-git-send-email-ross.zwisler@linux.intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1454829553-29499-2-git-send-email-ross.zwisler@linux.intel.com> User-Agent: Mutt/1.5.21 (2010-09-15) X-Barracuda-Connect: ipmail06.adl2.internode.on.net[150.101.137.129] X-Barracuda-Start-Time: 1454882671 X-Barracuda-URL: https://192.48.176.15:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-BRTS-Status: 1 X-Barracuda-Spam-Score: 0.00 X-Barracuda-Spam-Status: No, SCORE=0.00 using per-user scores of TAG_LEVEL=1000.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.7 tests=BSF_SC0_MISMATCH_TO X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.3.26837 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 0.00 BSF_SC0_MISMATCH_TO Envelope rcpt doesn't match header On Sun, Feb 07, 2016 at 12:19:12AM -0700, Ross Zwisler wrote: > dax_clear_blocks() needs a valid struct block_device and previously it was > using inode->i_sb->s_bdev in all cases. This is correct for normal inodes > on mounted ext2, ext4 and XFS filesystems, but is incorrect for DAX raw > block devices and for XFS real-time devices. > > Instead, have the caller pass in a struct block_device pointer which it > knows to be correct. .... > diff --git a/fs/xfs/xfs_bmap_util.c b/fs/xfs/xfs_bmap_util.c > index 07ef29b..f722ba2 100644 > --- a/fs/xfs/xfs_bmap_util.c > +++ b/fs/xfs/xfs_bmap_util.c > @@ -73,9 +73,11 @@ xfs_zero_extent( > xfs_daddr_t sector = xfs_fsb_to_db(ip, start_fsb); > sector_t block = XFS_BB_TO_FSBT(mp, sector); > ssize_t size = XFS_FSB_TO_B(mp, count_fsb); > + struct inode *inode = VFS_I(ip); > > if (IS_DAX(VFS_I(ip))) > - return dax_clear_blocks(VFS_I(ip), block, size); > + return dax_clear_blocks(inode, xfs_find_bdev_for_inode(inode), > + block, size); Get rid of the local inode variable and use VFS_I(ip) like the code originally did. Do not change code that is unrelated to the modifcation being made, especially when it results in making the code an inconsistent mess of mixed pointer constructs.... Cheers, Dave. -- Dave Chinner david@fromorbit.com From david@fromorbit.com Sun Feb 7 19:00:48 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=ham version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay2.corp.sgi.com [137.38.102.29]) by oss.sgi.com (Postfix) with ESMTP id F28E37CA2 for ; Sun, 7 Feb 2016 19:00:47 -0600 (CST) Received: from cuda.sgi.com (cuda1.sgi.com [192.48.157.11]) by relay2.corp.sgi.com (Postfix) with ESMTP id D1F55304032 for ; Sun, 7 Feb 2016 17:00:44 -0800 (PST) X-ASG-Debug-ID: 1454893227-04bdf079c010cc90001-NocioJ Received: from ipmail06.adl2.internode.on.net (ipmail06.adl2.internode.on.net [150.101.137.129]) by cuda.sgi.com with ESMTP id FMrD4L6E4OJdlC88 for ; Sun, 07 Feb 2016 17:00:28 -0800 (PST) X-Barracuda-Envelope-From: david@fromorbit.com X-Barracuda-Apparent-Source-IP: 150.101.137.129 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: A2C7DQAU6LdWPBATLHleKAECgw+BP4ZjgXidQAEBAQEBAQaLZoVEhAeGBwICAQECgSFNAQEBAQEBBwEBAQFBP4RCAQEEOhwjEAgDDgoJJQ8FJQMHGhOIGrxOAQEIAgEdGIUyhH+IbAWWdY1HgWSNGIVuiFCEWiguiFMBAQE Received: from ppp121-44-19-16.lns20.syd4.internode.on.net (HELO dastard) ([121.44.19.16]) by ipmail06.adl2.internode.on.net with ESMTP; 08 Feb 2016 11:30:26 +1030 Received: from dave by dastard with local (Exim 4.80) (envelope-from ) id 1aSaBm-0006ie-4d; Mon, 08 Feb 2016 12:00:26 +1100 Date: Mon, 8 Feb 2016 12:00:26 +1100 From: Dave Chinner To: Christoph Hellwig Cc: linux-fsdevel@vger.kernel.org, xfs@oss.sgi.com, linux-ext4@vger.kernel.org, ocfs2-devel@oss.oracle.com Subject: Re: [PATCH 2/3] xfs: don't use ioends for direct write completions Message-ID: <20160208010026.GL31407@dastard> X-ASG-Orig-Subj: Re: [PATCH 2/3] xfs: don't use ioends for direct write completions References: <1454524816-11392-1-git-send-email-hch@lst.de> <1454524816-11392-3-git-send-email-hch@lst.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1454524816-11392-3-git-send-email-hch@lst.de> User-Agent: Mutt/1.5.21 (2010-09-15) X-Barracuda-Connect: ipmail06.adl2.internode.on.net[150.101.137.129] X-Barracuda-Start-Time: 1454893227 X-Barracuda-URL: https://192.48.157.11:443/cgi-mod/mark.cgi X-Barracuda-BRTS-Status: 1 X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-Spam-Score: 0.00 X-Barracuda-Spam-Status: No, SCORE=0.00 using per-user scores of TAG_LEVEL=1000.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.7 tests=BSF_SC0_MISMATCH_TO X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.3.26843 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 0.00 BSF_SC0_MISMATCH_TO Envelope rcpt doesn't match header On Wed, Feb 03, 2016 at 07:40:15PM +0100, Christoph Hellwig wrote: > We only need to communicate two bits of information to the direct I/O > completion handler: > > (1) do we need to convert any unwritten extents in the range > (2) do we need to check if we need to update the inode size based > on the range passed to the completion handler > > We can use the private data passed to the get_block handler and the > completion handler as a simple bitmask to communicate this information > instead of the current complicated infrastructure reusing the ioends > from the buffer I/O path, and thus avoiding a memory allocation and > a context switch for any non-trivial direct write. As a nice side > effect we also decouple the direct I/O path implementation from that > of the buffered I/O path. > > Signed-off-by: Christoph Hellwig > Reviewed-by: Brian Foster This change is now dependent on the preceeding direct IO API changes. Do I a) take the DIO API change through the XFS tree, or b) use the older version of the patch that didn't have this dependency and let somebody else deal with the API change and merge issues? I'm happy to take the DIO API change through the XFS tree, if that's the fastest/easiest way to get the necessary DIO subsystem fixes into the mainline tree for XFS. As such, the for-next tree that I'm building right now will include the DIO API change patch.... -Dave. -- Dave Chinner david@fromorbit.com From ross.zwisler@linux.intel.com Sun Feb 7 19:44:24 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=ham version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay2.corp.sgi.com [137.38.102.29]) by oss.sgi.com (Postfix) with ESMTP id 6AAC17CA2 for ; Sun, 7 Feb 2016 19:44:24 -0600 (CST) Received: from cuda.sgi.com (cuda2.sgi.com [192.48.176.25]) by relay2.corp.sgi.com (Postfix) with ESMTP id 4CDED304032 for ; Sun, 7 Feb 2016 17:44:21 -0800 (PST) X-ASG-Debug-ID: 1454895860-04cbb04cfc135a00001-NocioJ Received: from mga11.intel.com ([192.55.52.93]) by cuda.sgi.com with ESMTP id dxC8POGslFyPjW1D for ; Sun, 07 Feb 2016 17:44:20 -0800 (PST) X-Barracuda-Envelope-From: ross.zwisler@linux.intel.com X-Barracuda-Apparent-Source-IP: 192.55.52.93 X-ASG-Whitelist: Client Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by fmsmga102.fm.intel.com with ESMTP; 07 Feb 2016 17:44:20 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.22,413,1449561600"; d="scan'208";a="44077435" Received: from rzwisler-desk.amr.corp.intel.com (HELO linux.intel.com) ([10.254.103.197]) by fmsmga004.fm.intel.com with ESMTP; 07 Feb 2016 17:44:17 -0800 Date: Sun, 7 Feb 2016 18:44:09 -0700 From: Ross Zwisler To: Dave Chinner Cc: Ross Zwisler , linux-kernel@vger.kernel.org, Theodore Ts'o , Alexander Viro , Andreas Dilger , Andrew Morton , Dan Williams , Jan Kara , Matthew Wilcox , linux-ext4@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux-mm@kvack.org, linux-nvdimm@lists.01.org, xfs@oss.sgi.com Subject: Re: [PATCH 1/2] dax: pass bdev argument to dax_clear_blocks() Message-ID: <20160208014409.GA2343@linux.intel.com> X-ASG-Orig-Subj: Re: [PATCH 1/2] dax: pass bdev argument to dax_clear_blocks() Mail-Followup-To: Ross Zwisler , Dave Chinner , linux-kernel@vger.kernel.org, Theodore Ts'o , Alexander Viro , Andreas Dilger , Andrew Morton , Dan Williams , Jan Kara , Matthew Wilcox , linux-ext4@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux-mm@kvack.org, linux-nvdimm@lists.01.org, xfs@oss.sgi.com References: <1454829553-29499-1-git-send-email-ross.zwisler@linux.intel.com> <1454829553-29499-2-git-send-email-ross.zwisler@linux.intel.com> <20160207220329.GK31407@dastard> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20160207220329.GK31407@dastard> User-Agent: Mutt/1.5.24 (2015-08-30) X-Barracuda-Connect: UNKNOWN[192.55.52.93] X-Barracuda-Start-Time: 1454895860 X-Barracuda-URL: https://192.48.176.25:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-BRTS-Status: 1 On Mon, Feb 08, 2016 at 09:03:29AM +1100, Dave Chinner wrote: > On Sun, Feb 07, 2016 at 12:19:12AM -0700, Ross Zwisler wrote: > > dax_clear_blocks() needs a valid struct block_device and previously it was > > using inode->i_sb->s_bdev in all cases. This is correct for normal inodes > > on mounted ext2, ext4 and XFS filesystems, but is incorrect for DAX raw > > block devices and for XFS real-time devices. > > > > Instead, have the caller pass in a struct block_device pointer which it > > knows to be correct. > .... > > diff --git a/fs/xfs/xfs_bmap_util.c b/fs/xfs/xfs_bmap_util.c > > index 07ef29b..f722ba2 100644 > > --- a/fs/xfs/xfs_bmap_util.c > > +++ b/fs/xfs/xfs_bmap_util.c > > @@ -73,9 +73,11 @@ xfs_zero_extent( > > xfs_daddr_t sector = xfs_fsb_to_db(ip, start_fsb); > > sector_t block = XFS_BB_TO_FSBT(mp, sector); > > ssize_t size = XFS_FSB_TO_B(mp, count_fsb); > > + struct inode *inode = VFS_I(ip); > > > > if (IS_DAX(VFS_I(ip))) > > - return dax_clear_blocks(VFS_I(ip), block, size); > > + return dax_clear_blocks(inode, xfs_find_bdev_for_inode(inode), > > + block, size); > > Get rid of the local inode variable and use VFS_I(ip) like the code > originally did. Do not change code that is unrelated to the > modifcation being made, especially when it results in making > the code an inconsistent mess of mixed pointer constructs.... The local 'inode' variable was added to avoid multiple calls for VFS_I() for the same 'ip'. That said, I'm happy to make the change. From ross.zwisler@linux.intel.com Sun Feb 7 19:46:12 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=ham version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay1.corp.sgi.com [137.38.102.111]) by oss.sgi.com (Postfix) with ESMTP id 2DBB97CA2 for ; Sun, 7 Feb 2016 19:46:12 -0600 (CST) Received: from cuda.sgi.com (cuda1.sgi.com [192.48.157.11]) by relay1.corp.sgi.com (Postfix) with ESMTP id EB2768F8049 for ; Sun, 7 Feb 2016 17:46:11 -0800 (PST) X-ASG-Debug-ID: 1454895971-04bdf079c310edc0001-NocioJ Received: from mga04.intel.com ([192.55.52.120]) by cuda.sgi.com with ESMTP id iuL2AcHzymiUKyMp for ; Sun, 07 Feb 2016 17:46:11 -0800 (PST) X-Barracuda-Envelope-From: ross.zwisler@linux.intel.com X-Barracuda-Apparent-Source-IP: 192.55.52.120 X-ASG-Whitelist: Client Received: from orsmga002.jf.intel.com ([10.7.209.21]) by fmsmga104.fm.intel.com with ESMTP; 07 Feb 2016 17:46:11 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.22,413,1449561600"; d="scan'208";a="907509021" Received: from rzwisler-desk.amr.corp.intel.com (HELO linux.intel.com) ([10.254.103.197]) by orsmga002.jf.intel.com with ESMTP; 07 Feb 2016 17:46:09 -0800 Date: Sun, 7 Feb 2016 18:46:01 -0700 From: Ross Zwisler To: Dan Williams Cc: Ross Zwisler , "linux-kernel@vger.kernel.org" , Theodore Ts'o , Alexander Viro , Andreas Dilger , Andrew Morton , Dave Chinner , Jan Kara , Matthew Wilcox , linux-ext4 , linux-fsdevel , Linux MM , "linux-nvdimm@lists.01.org" , XFS Developers Subject: Re: [PATCH 1/2] dax: pass bdev argument to dax_clear_blocks() Message-ID: <20160208014601.GB2343@linux.intel.com> X-ASG-Orig-Subj: Re: [PATCH 1/2] dax: pass bdev argument to dax_clear_blocks() Mail-Followup-To: Ross Zwisler , Dan Williams , "linux-kernel@vger.kernel.org" , Theodore Ts'o , Alexander Viro , Andreas Dilger , Andrew Morton , Dave Chinner , Jan Kara , Matthew Wilcox , linux-ext4 , linux-fsdevel , Linux MM , "linux-nvdimm@lists.01.org" , XFS Developers References: <1454829553-29499-1-git-send-email-ross.zwisler@linux.intel.com> <1454829553-29499-2-git-send-email-ross.zwisler@linux.intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.24 (2015-08-30) X-Barracuda-Connect: UNKNOWN[192.55.52.120] X-Barracuda-Start-Time: 1454895971 X-Barracuda-URL: https://192.48.157.11:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-BRTS-Status: 1 On Sun, Feb 07, 2016 at 10:19:29AM -0800, Dan Williams wrote: > On Sat, Feb 6, 2016 at 11:19 PM, Ross Zwisler > wrote: > > dax_clear_blocks() needs a valid struct block_device and previously it was > > using inode->i_sb->s_bdev in all cases. This is correct for normal inodes > > on mounted ext2, ext4 and XFS filesystems, but is incorrect for DAX raw > > block devices and for XFS real-time devices. > > > > Instead, have the caller pass in a struct block_device pointer which it > > knows to be correct. > > > > Signed-off-by: Ross Zwisler > > --- > > fs/dax.c | 4 ++-- > > fs/ext2/inode.c | 5 +++-- > > fs/xfs/xfs_aops.c | 2 +- > > fs/xfs/xfs_aops.h | 1 + > > fs/xfs/xfs_bmap_util.c | 4 +++- > > include/linux/dax.h | 3 ++- > > 6 files changed, 12 insertions(+), 7 deletions(-) > > > > diff --git a/fs/dax.c b/fs/dax.c > > index 227974a..4592241 100644 > > --- a/fs/dax.c > > +++ b/fs/dax.c > > @@ -83,9 +83,9 @@ struct page *read_dax_sector(struct block_device *bdev, sector_t n) > > * and hence this means the stack from this point must follow GFP_NOFS > > * semantics for all operations. > > */ > > -int dax_clear_blocks(struct inode *inode, sector_t block, long _size) > > +int dax_clear_blocks(struct inode *inode, struct block_device *bdev, > > + sector_t block, long _size) > > Since this is a bdev relative routine we should also resolve the > sector, i.e. the signature should drop the inode: > > int dax_clear_sectors(struct block_device *bdev, sector_t sector, long _size) The inode is still needed because dax_clear_blocks() needs inode->i_blkbits. Unless there is some easy way to get this from the bdev that I'm not seeing? From dave@fromorbit.com Sun Feb 7 22:24:31 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=ham version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay2.corp.sgi.com [137.38.102.29]) by oss.sgi.com (Postfix) with ESMTP id C48AB7CA2 for ; Sun, 7 Feb 2016 22:24:31 -0600 (CST) Received: from cuda.sgi.com (cuda3.sgi.com [192.48.176.15]) by relay2.corp.sgi.com (Postfix) with ESMTP id B44D2304048 for ; Sun, 7 Feb 2016 20:24:28 -0800 (PST) X-ASG-Debug-ID: 1454905465-04cb6c2747155150001-NocioJ Received: from ipmail06.adl2.internode.on.net (ipmail06.adl2.internode.on.net [150.101.137.129]) by cuda.sgi.com with ESMTP id ABEtLlvCEhdnpDBy for ; Sun, 07 Feb 2016 20:24:26 -0800 (PST) X-Barracuda-Envelope-From: dave@fromorbit.com X-Barracuda-Apparent-Source-IP: 150.101.137.129 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: A2D7DgBJF7hWPBATLHleKAECgw9SbYhbnSgCFgEBAQEBAQaBD5AbhCiHEU0BAQEBAQEHAQEBAUE/QRIBhEo7gQIDB4hHD54anjSFSodTgiqDbgWWdYVMiV+HaYUvRIUqiFCCGAELAYI1KC4Bhn+BUwEBAQ Received: from ppp121-44-19-16.lns20.syd4.internode.on.net (HELO dastard) ([121.44.19.16]) by ipmail06.adl2.internode.on.net with ESMTP; 08 Feb 2016 14:54:24 +1030 Received: from disappointment.disaster.area ([192.168.1.110] helo=disappointment) by dastard with esmtp (Exim 4.80) (envelope-from ) id 1aSdN9-00072H-MS for xfs@oss.sgi.com; Mon, 08 Feb 2016 15:24:23 +1100 Received: from dave by disappointment with local (Exim 4.86) (envelope-from ) id 1aSdN9-0000lk-LF for xfs@oss.sgi.com; Mon, 08 Feb 2016 15:24:23 +1100 From: Dave Chinner To: xfs@oss.sgi.com Subject: [PATCH v3 0/9] xfs: gut the struct xfs_icdinode Date: Mon, 8 Feb 2016 15:24:12 +1100 X-ASG-Orig-Subj: [PATCH v3 0/9] xfs: gut the struct xfs_icdinode Message-Id: <1454905461-2773-1-git-send-email-david@fromorbit.com> X-Mailer: git-send-email 2.5.0 X-Barracuda-Connect: ipmail06.adl2.internode.on.net[150.101.137.129] X-Barracuda-Start-Time: 1454905465 X-Barracuda-URL: https://192.48.176.15:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-BRTS-Status: 1 X-Barracuda-Spam-Score: 0.00 X-Barracuda-Spam-Status: No, SCORE=0.00 using per-user scores of TAG_LEVEL=1000.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.7 tests= X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.3.26847 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- Hi folks, This is the thrid version of this patchset, the second version is here: http://oss.sgi.com/archives/xfs/2016-01/msg00459.html There is no change to the space savings the series gives us; it is an update to address Brian's review comments. Testing over the past couple of weeks indicates no new regressions, so hopefully this is the final review posting. :) Version 3 - fix typos/comments and use sb_meta_uuid (patch 3) - introduce new patch for reclaimable inode core reinitialisation infrastructure (patch 5) - remove typedefs (patch 6) - added field reinitialisation to function introduced in patch 5 (patches 6-9) - removed stray debug hunk (patch 9) - added reviewed-by tags to patches that have been reviewed already. Version 2 - timestamps are signed, so need casting to int before being stored in a 64 bit variable when read from disk. Fixes generic/258 failure (patch 2). - nlink wasn't being accounted correctly for O_TMPFILE files and rename whiteouts. Fixes generic/078 and others. (patch 5) - VFS does not initialise i_mode, ever, so we need to initialise it directly after slab allocation to ensure that we correctly detect new file creates and hence don't add the inode the sb list twice, corrupting it. (busy inodes after unmount, self destruct in 5 seconds, have a nice day!) (patch 8) - when reallocating a reclaimable inode, we need to save the variables that hold on-disk values across the inode_init_always() call, otherwise we lose them. This results in corruption of these fields. (patch 8) From dave@fromorbit.com Sun Feb 7 22:24:32 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=ham version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay3.corp.sgi.com [198.149.34.15]) by oss.sgi.com (Postfix) with ESMTP id E34F87CA3 for ; Sun, 7 Feb 2016 22:24:31 -0600 (CST) Received: from cuda.sgi.com (cuda3.sgi.com [192.48.176.15]) by relay3.corp.sgi.com (Postfix) with ESMTP id 67191AC003 for ; Sun, 7 Feb 2016 20:24:31 -0800 (PST) X-ASG-Debug-ID: 1454905465-04cb6c2747155150002-NocioJ Received: from ipmail06.adl2.internode.on.net (ipmail06.adl2.internode.on.net [150.101.137.129]) by cuda.sgi.com with ESMTP id qoRkJWbwBsDTV6Gm for ; Sun, 07 Feb 2016 20:24:28 -0800 (PST) X-Barracuda-Envelope-From: dave@fromorbit.com X-Barracuda-Apparent-Source-IP: 150.101.137.129 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: A2DIEQBJF7hWPBATLHleKAECgw+BP4ZjgXidQAEBAQEBAQaRKooUgSVNAQEBAQEBBwEBAQFBP0ESAYNuAQUnLzMIGDE5AwcUGYgavF2FSolXhBQFlnWcQ44+ghgBCz4cgVwoLocAgVMBAQE Received: from ppp121-44-19-16.lns20.syd4.internode.on.net (HELO dastard) ([121.44.19.16]) by ipmail06.adl2.internode.on.net with ESMTP; 08 Feb 2016 14:54:24 +1030 Received: from disappointment.disaster.area ([192.168.1.110] helo=disappointment) by dastard with esmtp (Exim 4.80) (envelope-from ) id 1aSdN9-00072O-Pk for xfs@oss.sgi.com; Mon, 08 Feb 2016 15:24:23 +1100 Received: from dave by disappointment with local (Exim 4.86) (envelope-from ) id 1aSdN9-0000mH-Ou for xfs@oss.sgi.com; Mon, 08 Feb 2016 15:24:23 +1100 From: Dave Chinner To: xfs@oss.sgi.com Subject: [PATCH 7/9] xfs: move inode generation count to VFS inode Date: Mon, 8 Feb 2016 15:24:19 +1100 X-ASG-Orig-Subj: [PATCH 7/9] xfs: move inode generation count to VFS inode Message-Id: <1454905461-2773-8-git-send-email-david@fromorbit.com> X-Mailer: git-send-email 2.5.0 In-Reply-To: <1454905461-2773-1-git-send-email-david@fromorbit.com> References: <1454905461-2773-1-git-send-email-david@fromorbit.com> X-Barracuda-Connect: ipmail06.adl2.internode.on.net[150.101.137.129] X-Barracuda-Start-Time: 1454905467 X-Barracuda-URL: https://192.48.176.15:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-BRTS-Status: 1 X-Barracuda-Spam-Score: 0.00 X-Barracuda-Spam-Status: No, SCORE=0.00 using per-user scores of TAG_LEVEL=1000.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.7 tests= X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.3.26847 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- From: Dave Chinner Pull another 4 bytes out of the xfs_icdinode. Signed-off-by: Dave Chinner --- fs/xfs/libxfs/xfs_inode_buf.c | 8 ++++---- fs/xfs/libxfs/xfs_inode_buf.h | 1 - fs/xfs/xfs_export.c | 2 +- fs/xfs/xfs_icache.c | 2 ++ fs/xfs/xfs_inode.c | 5 +---- fs/xfs/xfs_inode_item.c | 2 +- fs/xfs/xfs_ioctl.c | 2 +- fs/xfs/xfs_iops.c | 1 - fs/xfs/xfs_itable.c | 2 +- 9 files changed, 11 insertions(+), 14 deletions(-) diff --git a/fs/xfs/libxfs/xfs_inode_buf.c b/fs/xfs/libxfs/xfs_inode_buf.c index 0dcaa9a..0a3f10b 100644 --- a/fs/xfs/libxfs/xfs_inode_buf.c +++ b/fs/xfs/libxfs/xfs_inode_buf.c @@ -237,6 +237,7 @@ xfs_inode_from_disk( inode->i_mtime.tv_nsec = (int)be32_to_cpu(from->di_mtime.t_nsec); inode->i_ctime.tv_sec = (int)be32_to_cpu(from->di_ctime.t_sec); inode->i_ctime.tv_nsec = (int)be32_to_cpu(from->di_ctime.t_nsec); + inode->i_generation = be32_to_cpu(from->di_gen); to->di_size = be64_to_cpu(from->di_size); to->di_nblocks = be64_to_cpu(from->di_nblocks); @@ -248,7 +249,6 @@ xfs_inode_from_disk( to->di_dmevmask = be32_to_cpu(from->di_dmevmask); to->di_dmstate = be16_to_cpu(from->di_dmstate); to->di_flags = be16_to_cpu(from->di_flags); - to->di_gen = be32_to_cpu(from->di_gen); if (to->di_version == 3) { to->di_changecount = be64_to_cpu(from->di_changecount); @@ -286,6 +286,7 @@ xfs_inode_to_disk( to->di_ctime.t_sec = cpu_to_be32(inode->i_ctime.tv_sec); to->di_ctime.t_nsec = cpu_to_be32(inode->i_ctime.tv_nsec); to->di_nlink = cpu_to_be32(inode->i_nlink); + to->di_gen = cpu_to_be32(inode->i_generation); to->di_size = cpu_to_be64(from->di_size); to->di_nblocks = cpu_to_be64(from->di_nblocks); @@ -297,7 +298,6 @@ xfs_inode_to_disk( to->di_dmevmask = cpu_to_be32(from->di_dmevmask); to->di_dmstate = cpu_to_be16(from->di_dmstate); to->di_flags = cpu_to_be16(from->di_flags); - to->di_gen = cpu_to_be32(from->di_gen); if (from->di_version == 3) { to->di_changecount = cpu_to_be64(from->di_changecount); @@ -443,7 +443,7 @@ xfs_iread( !(mp->m_flags & XFS_MOUNT_IKEEP)) { /* initialise the on-disk inode core */ memset(&ip->i_d, 0, sizeof(ip->i_d)); - ip->i_d.di_gen = prandom_u32(); + VFS_I(ip)->i_generation = prandom_u32(); if (xfs_sb_version_hascrc(&mp->m_sb)) ip->i_d.di_version = 3; else @@ -491,7 +491,7 @@ xfs_iread( * that xfs_ialloc won't overwrite or relies on being correct. */ ip->i_d.di_version = dip->di_version; - ip->i_d.di_gen = be32_to_cpu(dip->di_gen); + VFS_I(ip)->i_generation = be32_to_cpu(dip->di_gen); ip->i_d.di_flushiter = be16_to_cpu(dip->di_flushiter); /* diff --git a/fs/xfs/libxfs/xfs_inode_buf.h b/fs/xfs/libxfs/xfs_inode_buf.h index 320b723..29fd9f1 100644 --- a/fs/xfs/libxfs/xfs_inode_buf.h +++ b/fs/xfs/libxfs/xfs_inode_buf.h @@ -46,7 +46,6 @@ struct xfs_icdinode { __uint32_t di_dmevmask; /* DMIG event mask */ __uint16_t di_dmstate; /* DMIG state info */ __uint16_t di_flags; /* random flags, XFS_DIFLAG_... */ - __uint32_t di_gen; /* generation number */ __uint64_t di_changecount; /* number of attribute changes */ __uint64_t di_flags2; /* more random flags */ diff --git a/fs/xfs/xfs_export.c b/fs/xfs/xfs_export.c index 652cd3c..2816d42 100644 --- a/fs/xfs/xfs_export.c +++ b/fs/xfs/xfs_export.c @@ -152,7 +152,7 @@ xfs_nfs_get_inode( return ERR_PTR(error); } - if (ip->i_d.di_gen != generation) { + if (VFS_I(ip)->i_generation != generation) { IRELE(ip); return ERR_PTR(-ESTALE); } diff --git a/fs/xfs/xfs_icache.c b/fs/xfs/xfs_icache.c index 4c184f7..6401e3c 100644 --- a/fs/xfs/xfs_icache.c +++ b/fs/xfs/xfs_icache.c @@ -149,10 +149,12 @@ xfs_reinit_inode( { int error; uint32_t nlink = inode->i_nlink; + uint32_t generation = inode->i_generation; error = inode_init_always(mp->m_super, inode); set_nlink(inode, nlink); + inode->i_generation = generation; return error; } diff --git a/fs/xfs/xfs_inode.c b/fs/xfs/xfs_inode.c index ed8e3d2..e8f87c7 100644 --- a/fs/xfs/xfs_inode.c +++ b/fs/xfs/xfs_inode.c @@ -835,9 +835,6 @@ xfs_ialloc( inode->i_atime = tv; inode->i_ctime = tv; - /* - * di_gen will have been taken care of in xfs_iread. - */ ip->i_d.di_extsize = 0; ip->i_d.di_dmevmask = 0; ip->i_d.di_dmstate = 0; @@ -2428,7 +2425,7 @@ xfs_ifree( * Bump the generation count so no one will be confused * by reincarnations of this inode. */ - ip->i_d.di_gen++; + VFS_I(ip)->i_generation++; xfs_trans_log_inode(tp, ip, XFS_ILOG_CORE); if (xic.deleted) diff --git a/fs/xfs/xfs_inode_item.c b/fs/xfs/xfs_inode_item.c index 193e0bd..6367780 100644 --- a/fs/xfs/xfs_inode_item.c +++ b/fs/xfs/xfs_inode_item.c @@ -350,6 +350,7 @@ xfs_inode_to_log_dinode( to->di_ctime.t_sec = inode->i_ctime.tv_sec; to->di_ctime.t_nsec = inode->i_ctime.tv_nsec; to->di_nlink = inode->i_nlink; + to->di_gen = inode->i_generation; to->di_size = from->di_size; to->di_nblocks = from->di_nblocks; @@ -361,7 +362,6 @@ xfs_inode_to_log_dinode( to->di_dmevmask = from->di_dmevmask; to->di_dmstate = from->di_dmstate; to->di_flags = from->di_flags; - to->di_gen = from->di_gen; if (from->di_version == 3) { to->di_changecount = from->di_changecount; diff --git a/fs/xfs/xfs_ioctl.c b/fs/xfs/xfs_ioctl.c index 478d04e..cdd6c31 100644 --- a/fs/xfs/xfs_ioctl.c +++ b/fs/xfs/xfs_ioctl.c @@ -114,7 +114,7 @@ xfs_find_handle( handle.ha_fid.fid_len = sizeof(xfs_fid_t) - sizeof(handle.ha_fid.fid_len); handle.ha_fid.fid_pad = 0; - handle.ha_fid.fid_gen = ip->i_d.di_gen; + handle.ha_fid.fid_gen = inode->i_generation; handle.ha_fid.fid_ino = ip->i_ino; hsize = XFS_HSIZE(handle); diff --git a/fs/xfs/xfs_iops.c b/fs/xfs/xfs_iops.c index 8982e56..a4daa3f 100644 --- a/fs/xfs/xfs_iops.c +++ b/fs/xfs/xfs_iops.c @@ -1231,7 +1231,6 @@ xfs_setup_inode( break; } - inode->i_generation = ip->i_d.di_gen; i_size_write(inode, ip->i_d.di_size); xfs_diflags_to_iflags(inode, ip); diff --git a/fs/xfs/xfs_itable.c b/fs/xfs/xfs_itable.c index cfb6527..6162e65 100644 --- a/fs/xfs/xfs_itable.c +++ b/fs/xfs/xfs_itable.c @@ -100,11 +100,11 @@ xfs_bulkstat_one_int( buf->bs_mtime.tv_nsec = inode->i_mtime.tv_nsec; buf->bs_ctime.tv_sec = inode->i_ctime.tv_sec; buf->bs_ctime.tv_nsec = inode->i_ctime.tv_nsec; + buf->bs_gen = inode->i_generation; buf->bs_xflags = xfs_ip2xflags(ip); buf->bs_extsize = dic->di_extsize << mp->m_sb.sb_blocklog; buf->bs_extents = dic->di_nextents; - buf->bs_gen = dic->di_gen; memset(buf->bs_pad, 0, sizeof(buf->bs_pad)); buf->bs_dmevmask = dic->di_dmevmask; buf->bs_dmstate = dic->di_dmstate; -- 2.5.0 From dave@fromorbit.com Sun Feb 7 22:24:33 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=ham version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay3.corp.sgi.com [198.149.34.15]) by oss.sgi.com (Postfix) with ESMTP id 339337CA2 for ; Sun, 7 Feb 2016 22:24:33 -0600 (CST) Received: from cuda.sgi.com (cuda3.sgi.com [192.48.176.15]) by relay3.corp.sgi.com (Postfix) with ESMTP id AB6CAAC003 for ; Sun, 7 Feb 2016 20:24:32 -0800 (PST) X-ASG-Debug-ID: 1454905466-04cb6c2746155150002-NocioJ Received: from ipmail06.adl2.internode.on.net (ipmail06.adl2.internode.on.net [150.101.137.129]) by cuda.sgi.com with ESMTP id GkYVioQoQowb1SPU for ; Sun, 07 Feb 2016 20:24:29 -0800 (PST) X-Barracuda-Envelope-From: dave@fromorbit.com X-Barracuda-Apparent-Source-IP: 150.101.137.129 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: A2DJEQBJF7hWPBATLHleKAECgw+BP4ZjgXidQAEBAQEBAQaRKooUgSVNAQEBAQEBBwEBAQFBP0ESAYNuAQUnLzMIGBkYOQMHFBmIGrxdhUqJVyIMg2YFh1OPIo8rjRiFbohQghgBCwE9AxmBXCguhwAjgTABAQE Received: from ppp121-44-19-16.lns20.syd4.internode.on.net (HELO dastard) ([121.44.19.16]) by ipmail06.adl2.internode.on.net with ESMTP; 08 Feb 2016 14:54:24 +1030 Received: from disappointment.disaster.area ([192.168.1.110] helo=disappointment) by dastard with esmtp (Exim 4.80) (envelope-from ) id 1aSdN9-00072K-O1 for xfs@oss.sgi.com; Mon, 08 Feb 2016 15:24:23 +1100 Received: from dave by disappointment with local (Exim 4.86) (envelope-from ) id 1aSdN9-0000lx-Mr for xfs@oss.sgi.com; Mon, 08 Feb 2016 15:24:23 +1100 From: Dave Chinner To: xfs@oss.sgi.com Subject: [PATCH 3/9] xfs: cull unnecessary icdinode fields Date: Mon, 8 Feb 2016 15:24:15 +1100 X-ASG-Orig-Subj: [PATCH 3/9] xfs: cull unnecessary icdinode fields Message-Id: <1454905461-2773-4-git-send-email-david@fromorbit.com> X-Mailer: git-send-email 2.5.0 In-Reply-To: <1454905461-2773-1-git-send-email-david@fromorbit.com> References: <1454905461-2773-1-git-send-email-david@fromorbit.com> X-Barracuda-Connect: ipmail06.adl2.internode.on.net[150.101.137.129] X-Barracuda-Start-Time: 1454905468 X-Barracuda-URL: https://192.48.176.15:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-BRTS-Status: 1 X-Barracuda-Spam-Score: 0.00 X-Barracuda-Spam-Status: No, SCORE=0.00 using per-user scores of TAG_LEVEL=1000.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.7 tests= X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.3.26847 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- From: Dave Chinner Now that the struct xfs_icdinode is not directly related to the on-disk format, we can cull things in it we really don't need to store: - magic number never changes - padding is not necessary - next_unlinked is never used - inode number is redundant - uuid is redundant - lsn is accessed directly from dinode - inode CRC is only accessed directly from dinode Hence we can remove these from the struct xfs_icdinode and redirect the code that uses them to the xfs_dinode appripriately. This reduces the size of the struct icdinode from 152 bytes to 88 bytes, and removes a fair chunk of unnecessary code, too. Signed-off-by: Dave Chinner --- fs/xfs/libxfs/xfs_inode_buf.c | 39 +++++++++++++-------------------------- fs/xfs/libxfs/xfs_inode_buf.h | 25 ++++++------------------- fs/xfs/xfs_inode.c | 19 +------------------ fs/xfs/xfs_inode_item.c | 19 +++++++++++-------- 4 files changed, 31 insertions(+), 71 deletions(-) diff --git a/fs/xfs/libxfs/xfs_inode_buf.c b/fs/xfs/libxfs/xfs_inode_buf.c index 26e3c46..17ff4e8 100644 --- a/fs/xfs/libxfs/xfs_inode_buf.c +++ b/fs/xfs/libxfs/xfs_inode_buf.c @@ -202,7 +202,6 @@ xfs_inode_from_disk( struct xfs_icdinode *to = &ip->i_d; struct inode *inode = VFS_I(ip); - to->di_magic = be16_to_cpu(from->di_magic); to->di_mode = be16_to_cpu(from->di_mode); to->di_version = from ->di_version; to->di_format = from->di_format; @@ -212,7 +211,6 @@ xfs_inode_from_disk( to->di_nlink = be32_to_cpu(from->di_nlink); to->di_projid_lo = be16_to_cpu(from->di_projid_lo); to->di_projid_hi = be16_to_cpu(from->di_projid_hi); - memcpy(to->di_pad, from->di_pad, sizeof(to->di_pad)); to->di_flushiter = be16_to_cpu(from->di_flushiter); /* @@ -245,24 +243,22 @@ xfs_inode_from_disk( to->di_crtime.t_sec = be32_to_cpu(from->di_crtime.t_sec); to->di_crtime.t_nsec = be32_to_cpu(from->di_crtime.t_nsec); to->di_flags2 = be64_to_cpu(from->di_flags2); - to->di_ino = be64_to_cpu(from->di_ino); - to->di_lsn = be64_to_cpu(from->di_lsn); - memcpy(to->di_pad2, from->di_pad2, sizeof(to->di_pad2)); - uuid_copy(&to->di_uuid, &from->di_uuid); } } void xfs_inode_to_disk( struct xfs_inode *ip, - struct xfs_dinode *to) + struct xfs_dinode *to, + xfs_lsn_t lsn) { struct xfs_icdinode *from = &ip->i_d; struct inode *inode = VFS_I(ip); - to->di_magic = cpu_to_be16(from->di_magic); + to->di_magic = cpu_to_be16(XFS_DINODE_MAGIC); + to->di_mode = cpu_to_be16(from->di_mode); - to->di_version = from ->di_version; + to->di_version = from->di_version; to->di_format = from->di_format; to->di_onlink = cpu_to_be16(from->di_onlink); to->di_uid = cpu_to_be32(from->di_uid); @@ -270,8 +266,8 @@ xfs_inode_to_disk( to->di_nlink = cpu_to_be32(from->di_nlink); to->di_projid_lo = cpu_to_be16(from->di_projid_lo); to->di_projid_hi = cpu_to_be16(from->di_projid_hi); - memcpy(to->di_pad, from->di_pad, sizeof(to->di_pad)); + memset(to->di_pad, 0, sizeof(to->di_pad)); to->di_atime.t_sec = cpu_to_be32(inode->i_atime.tv_sec); to->di_atime.t_nsec = cpu_to_be32(inode->i_atime.tv_nsec); to->di_mtime.t_sec = cpu_to_be32(inode->i_mtime.tv_sec); @@ -296,10 +292,11 @@ xfs_inode_to_disk( to->di_crtime.t_sec = cpu_to_be32(from->di_crtime.t_sec); to->di_crtime.t_nsec = cpu_to_be32(from->di_crtime.t_nsec); to->di_flags2 = cpu_to_be64(from->di_flags2); - to->di_ino = cpu_to_be64(from->di_ino); - to->di_lsn = cpu_to_be64(from->di_lsn); - memcpy(to->di_pad2, from->di_pad2, sizeof(to->di_pad2)); - uuid_copy(&to->di_uuid, &from->di_uuid); + + to->di_ino = cpu_to_be64(ip->i_ino); + to->di_lsn = cpu_to_be64(lsn); + memset(to->di_pad2, 0, sizeof(to->di_pad2)); + uuid_copy(&to->di_uuid, &ip->i_mount->m_sb.sb_meta_uuid); to->di_flushiter = 0; } else { to->di_flushiter = cpu_to_be16(from->di_flushiter); @@ -434,13 +431,10 @@ xfs_iread( !(mp->m_flags & XFS_MOUNT_IKEEP)) { /* initialise the on-disk inode core */ memset(&ip->i_d, 0, sizeof(ip->i_d)); - ip->i_d.di_magic = XFS_DINODE_MAGIC; ip->i_d.di_gen = prandom_u32(); - if (xfs_sb_version_hascrc(&mp->m_sb)) { + if (xfs_sb_version_hascrc(&mp->m_sb)) ip->i_d.di_version = 3; - ip->i_d.di_ino = ip->i_ino; - uuid_copy(&ip->i_d.di_uuid, &mp->m_sb.sb_meta_uuid); - } else + else ip->i_d.di_version = 2; return 0; } @@ -484,16 +478,10 @@ xfs_iread( * Partial initialisation of the in-core inode. Just the bits * that xfs_ialloc won't overwrite or relies on being correct. */ - ip->i_d.di_magic = be16_to_cpu(dip->di_magic); ip->i_d.di_version = dip->di_version; ip->i_d.di_gen = be32_to_cpu(dip->di_gen); ip->i_d.di_flushiter = be16_to_cpu(dip->di_flushiter); - if (dip->di_version == 3) { - ip->i_d.di_ino = be64_to_cpu(dip->di_ino); - uuid_copy(&ip->i_d.di_uuid, &dip->di_uuid); - } - /* * Make sure to pull in the mode here as well in * case the inode is released without being used. @@ -514,7 +502,6 @@ xfs_iread( */ if (ip->i_d.di_version == 1) { ip->i_d.di_version = 2; - memset(&(ip->i_d.di_pad[0]), 0, sizeof(ip->i_d.di_pad)); ip->i_d.di_nlink = ip->i_d.di_onlink; ip->i_d.di_onlink = 0; xfs_set_projid(ip, 0); diff --git a/fs/xfs/libxfs/xfs_inode_buf.h b/fs/xfs/libxfs/xfs_inode_buf.h index adcc9bf..7b8b1b9 100644 --- a/fs/xfs/libxfs/xfs_inode_buf.h +++ b/fs/xfs/libxfs/xfs_inode_buf.h @@ -22,24 +22,22 @@ struct xfs_inode; struct xfs_dinode; /* - * In memory representation of the XFS inode. This is held in the in-core - * struct xfs_inode to represent the on disk values, but no longer needs to be - * identical to the on-disk structure as it is always translated to on-disk + * In memory representation of the XFS inode. This is held in the in-core struct + * xfs_inode and represents the current on disk values but the structure is not + * in on-disk format. That is, this structure is always translated to on-disk * format specific structures at the appropriate time. */ struct xfs_icdinode { - __uint16_t di_magic; /* inode magic # = XFS_DINODE_MAGIC */ __uint16_t di_mode; /* mode and type of file */ __int8_t di_version; /* inode version */ __int8_t di_format; /* format of di_c data */ __uint16_t di_onlink; /* old number of links to file */ + __uint16_t di_flushiter; /* incremented on flush */ __uint32_t di_uid; /* owner's user id */ __uint32_t di_gid; /* owner's group id */ __uint32_t di_nlink; /* number of links to file */ __uint16_t di_projid_lo; /* lower part of owner's project id */ __uint16_t di_projid_hi; /* higher part of owner's project id */ - __uint8_t di_pad[6]; /* unused, zeroed space */ - __uint16_t di_flushiter; /* incremented on flush */ xfs_fsize_t di_size; /* number of bytes in file */ xfs_rfsblock_t di_nblocks; /* # of direct & btree blocks used */ xfs_extlen_t di_extsize; /* basic/minimum extent size for file */ @@ -52,22 +50,10 @@ struct xfs_icdinode { __uint16_t di_flags; /* random flags, XFS_DIFLAG_... */ __uint32_t di_gen; /* generation number */ - /* di_next_unlinked is the only non-core field in the old dinode */ - xfs_agino_t di_next_unlinked;/* agi unlinked list ptr */ - - /* start of the extended dinode, writable fields */ - __uint32_t di_crc; /* CRC of the inode */ __uint64_t di_changecount; /* number of attribute changes */ - xfs_lsn_t di_lsn; /* flush sequence */ __uint64_t di_flags2; /* more random flags */ - __uint8_t di_pad2[16]; /* more padding for future expansion */ - /* fields only written to during inode creation */ xfs_ictimestamp_t di_crtime; /* time created */ - xfs_ino_t di_ino; /* inode number */ - uuid_t di_uuid; /* UUID of the filesystem */ - - /* structure must be padded to 64 bit alignment */ }; /* @@ -86,7 +72,8 @@ int xfs_imap_to_bp(struct xfs_mount *, struct xfs_trans *, int xfs_iread(struct xfs_mount *, struct xfs_trans *, struct xfs_inode *, uint); void xfs_dinode_calc_crc(struct xfs_mount *, struct xfs_dinode *); -void xfs_inode_to_disk(struct xfs_inode *ip, struct xfs_dinode *to); +void xfs_inode_to_disk(struct xfs_inode *ip, struct xfs_dinode *to, + xfs_lsn_t lsn); void xfs_inode_from_disk(struct xfs_inode *ip, struct xfs_dinode *from); void xfs_log_dinode_to_disk(struct xfs_log_dinode *from, struct xfs_dinode *to); diff --git a/fs/xfs/xfs_inode.c b/fs/xfs/xfs_inode.c index 9ad9e35..45acdee 100644 --- a/fs/xfs/xfs_inode.c +++ b/fs/xfs/xfs_inode.c @@ -809,7 +809,6 @@ xfs_ialloc( ip->i_d.di_uid = xfs_kuid_to_uid(current_fsuid()); ip->i_d.di_gid = xfs_kgid_to_gid(current_fsgid()); xfs_set_projid(ip, prid); - memset(&(ip->i_d.di_pad[0]), 0, sizeof(ip->i_d.di_pad)); if (pip && XFS_INHERIT_GID(pip)) { ip->i_d.di_gid = pip->i_d.di_gid; @@ -847,13 +846,8 @@ xfs_ialloc( ip->i_d.di_flags = 0; if (ip->i_d.di_version == 3) { - ASSERT(ip->i_d.di_ino == ino); - ASSERT(uuid_equal(&ip->i_d.di_uuid, &mp->m_sb.sb_meta_uuid)); - ip->i_d.di_crc = 0; ip->i_d.di_changecount = 1; - ip->i_d.di_lsn = 0; ip->i_d.di_flags2 = 0; - memset(&(ip->i_d.di_pad2[0]), 0, sizeof(ip->i_d.di_pad2)); ip->i_d.di_crtime.t_sec = (__int32_t)tv.tv_sec; ip->i_d.di_crtime.t_nsec = (__int32_t)tv.tv_nsec; } @@ -3464,13 +3458,6 @@ xfs_iflush_int( __func__, ip->i_ino, be16_to_cpu(dip->di_magic), dip); goto corrupt_out; } - if (XFS_TEST_ERROR(ip->i_d.di_magic != XFS_DINODE_MAGIC, - mp, XFS_ERRTAG_IFLUSH_2, XFS_RANDOM_IFLUSH_2)) { - xfs_alert_tag(mp, XFS_PTAG_IFLUSH, - "%s: Bad inode %Lu, ptr 0x%p, magic number 0x%x", - __func__, ip->i_ino, ip, ip->i_d.di_magic); - goto corrupt_out; - } if (S_ISREG(ip->i_d.di_mode)) { if (XFS_TEST_ERROR( (ip->i_d.di_format != XFS_DINODE_FMT_EXTENTS) && @@ -3529,7 +3516,7 @@ xfs_iflush_int( * copy out the core of the inode, because if the inode is dirty at all * the core must be. */ - xfs_inode_to_disk(ip, dip); + xfs_inode_to_disk(ip, dip, iip->ili_item.li_lsn); /* Wrap, we never let the log put out DI_MAX_FLUSH */ if (ip->i_d.di_flushiter == DI_MAX_FLUSH) @@ -3581,10 +3568,6 @@ xfs_iflush_int( */ xfs_buf_attach_iodone(bp, xfs_iflush_done, &iip->ili_item); - /* update the lsn in the on disk inode if required */ - if (ip->i_d.di_version == 3) - dip->di_lsn = cpu_to_be64(iip->ili_item.li_lsn); - /* generate the checksum. */ xfs_dinode_calc_crc(mp, dip); diff --git a/fs/xfs/xfs_inode_item.c b/fs/xfs/xfs_inode_item.c index 9dcbf58..588d1b4 100644 --- a/fs/xfs/xfs_inode_item.c +++ b/fs/xfs/xfs_inode_item.c @@ -325,12 +325,14 @@ xfs_inode_item_format_attr_fork( static void xfs_inode_to_log_dinode( struct xfs_inode *ip, - struct xfs_log_dinode *to) + struct xfs_log_dinode *to, + xfs_lsn_t lsn) { struct xfs_icdinode *from = &ip->i_d; struct inode *inode = VFS_I(ip); - to->di_magic = from->di_magic; + to->di_magic = XFS_DINODE_MAGIC; + to->di_mode = from->di_mode; to->di_version = from->di_version; to->di_format = from->di_format; @@ -340,8 +342,8 @@ xfs_inode_to_log_dinode( to->di_nlink = from->di_nlink; to->di_projid_lo = from->di_projid_lo; to->di_projid_hi = from->di_projid_hi; - memcpy(to->di_pad, from->di_pad, sizeof(to->di_pad)); + memset(to->di_pad, 0, sizeof(to->di_pad)); to->di_atime.t_sec = inode->i_atime.tv_sec; to->di_atime.t_nsec = inode->i_atime.tv_nsec; to->di_mtime.t_sec = inode->i_mtime.tv_sec; @@ -366,10 +368,11 @@ xfs_inode_to_log_dinode( to->di_crtime.t_sec = from->di_crtime.t_sec; to->di_crtime.t_nsec = from->di_crtime.t_nsec; to->di_flags2 = from->di_flags2; - to->di_ino = from->di_ino; - to->di_lsn = from->di_lsn; - memcpy(to->di_pad2, from->di_pad2, sizeof(to->di_pad2)); - uuid_copy(&to->di_uuid, &from->di_uuid); + + to->di_ino = ip->i_ino; + to->di_lsn = lsn; + memset(to->di_pad2, 0, sizeof(to->di_pad2)); + uuid_copy(&to->di_uuid, &ip->i_mount->m_sb.sb_meta_uuid); to->di_flushiter = 0; } else { to->di_flushiter = from->di_flushiter; @@ -390,7 +393,7 @@ xfs_inode_item_format_core( struct xfs_log_dinode *dic; dic = xlog_prepare_iovec(lv, vecp, XLOG_REG_TYPE_ICORE); - xfs_inode_to_log_dinode(ip, dic); + xfs_inode_to_log_dinode(ip, dic, ip->i_itemp->ili_item.li_lsn); xlog_finish_iovec(lv, *vecp, xfs_log_dinode_size(ip->i_d.di_version)); } -- 2.5.0 From dave@fromorbit.com Sun Feb 7 22:24:33 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=ham version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay3.corp.sgi.com [198.149.34.15]) by oss.sgi.com (Postfix) with ESMTP id 36F4E7CA4 for ; Sun, 7 Feb 2016 22:24:33 -0600 (CST) Received: from cuda.sgi.com (cuda3.sgi.com [192.48.176.15]) by relay3.corp.sgi.com (Postfix) with ESMTP id AD266AC004 for ; Sun, 7 Feb 2016 20:24:29 -0800 (PST) X-ASG-Debug-ID: 1454905466-04cb6c2746155150001-NocioJ Received: from ipmail06.adl2.internode.on.net (ipmail06.adl2.internode.on.net [150.101.137.129]) by cuda.sgi.com with ESMTP id PRRzVGBlsiGKUlV7 for ; Sun, 07 Feb 2016 20:24:27 -0800 (PST) X-Barracuda-Envelope-From: dave@fromorbit.com X-Barracuda-Apparent-Source-IP: 150.101.137.129 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: A2DJEQBJF7hWPBATLHleKAECgw+BP4ZjgXidQAEBAQEBAQaRKooUgSVNAQEBAQEBBwEBAQFBP0ESAYNuAQUnLzMIGBkYOQMHFBmIGrxdhUqJVyIMg2YFh1OPIpxDRI16ghgBC0EZgVwoLocAI4EwAQEB Received: from ppp121-44-19-16.lns20.syd4.internode.on.net (HELO dastard) ([121.44.19.16]) by ipmail06.adl2.internode.on.net with ESMTP; 08 Feb 2016 14:54:24 +1030 Received: from disappointment.disaster.area ([192.168.1.110] helo=disappointment) by dastard with esmtp (Exim 4.80) (envelope-from ) id 1aSdN9-00072L-OS for xfs@oss.sgi.com; Mon, 08 Feb 2016 15:24:23 +1100 Received: from dave by disappointment with local (Exim 4.86) (envelope-from ) id 1aSdN9-0000m2-NW for xfs@oss.sgi.com; Mon, 08 Feb 2016 15:24:23 +1100 From: Dave Chinner To: xfs@oss.sgi.com Subject: [PATCH 4/9] xfs: move v1 inode conversion to xfs_inode_from_disk Date: Mon, 8 Feb 2016 15:24:16 +1100 X-ASG-Orig-Subj: [PATCH 4/9] xfs: move v1 inode conversion to xfs_inode_from_disk Message-Id: <1454905461-2773-5-git-send-email-david@fromorbit.com> X-Mailer: git-send-email 2.5.0 In-Reply-To: <1454905461-2773-1-git-send-email-david@fromorbit.com> References: <1454905461-2773-1-git-send-email-david@fromorbit.com> X-Barracuda-Connect: ipmail06.adl2.internode.on.net[150.101.137.129] X-Barracuda-Start-Time: 1454905466 X-Barracuda-URL: https://192.48.176.15:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-BRTS-Status: 1 X-Barracuda-Spam-Score: 0.00 X-Barracuda-Spam-Status: No, SCORE=0.00 using per-user scores of TAG_LEVEL=1000.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.7 tests= X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.3.26847 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- From: Dave Chinner So we don't have to carry an di_onlink variable around anymore, move the inode conversion from v1 inode format to v2 inode format into xfs_inode_from_disk(). This means we can remove the di_onlink fields from the struct xfs_icdinode. Signed-off-by: Dave Chinner Reviewed-by: Brian Foster Signed-off-by: Dave Chinner --- fs/xfs/libxfs/xfs_inode_buf.c | 42 ++++++++++++++++++++---------------------- fs/xfs/libxfs/xfs_inode_buf.h | 1 - fs/xfs/libxfs/xfs_log_format.h | 2 +- fs/xfs/xfs_inode.c | 2 -- fs/xfs/xfs_inode_item.c | 2 +- 5 files changed, 22 insertions(+), 27 deletions(-) diff --git a/fs/xfs/libxfs/xfs_inode_buf.c b/fs/xfs/libxfs/xfs_inode_buf.c index 17ff4e8..8a1b460 100644 --- a/fs/xfs/libxfs/xfs_inode_buf.c +++ b/fs/xfs/libxfs/xfs_inode_buf.c @@ -204,13 +204,25 @@ xfs_inode_from_disk( to->di_mode = be16_to_cpu(from->di_mode); to->di_version = from ->di_version; + + /* + * Convert v1 inodes immediately to v2 inode format as this is the + * minimum inode version format we support in the rest of the code. + */ + if (to->di_version == 1) { + to->di_nlink = be16_to_cpu(from->di_onlink); + to->di_projid_lo = 0; + to->di_projid_hi = 0; + to->di_version = 2; + } else { + to->di_nlink = be32_to_cpu(from->di_nlink); + to->di_projid_lo = be16_to_cpu(from->di_projid_lo); + to->di_projid_hi = be16_to_cpu(from->di_projid_hi); + } + to->di_format = from->di_format; - to->di_onlink = be16_to_cpu(from->di_onlink); to->di_uid = be32_to_cpu(from->di_uid); to->di_gid = be32_to_cpu(from->di_gid); - to->di_nlink = be32_to_cpu(from->di_nlink); - to->di_projid_lo = be16_to_cpu(from->di_projid_lo); - to->di_projid_hi = be16_to_cpu(from->di_projid_hi); to->di_flushiter = be16_to_cpu(from->di_flushiter); /* @@ -256,11 +268,11 @@ xfs_inode_to_disk( struct inode *inode = VFS_I(ip); to->di_magic = cpu_to_be16(XFS_DINODE_MAGIC); + to->di_onlink = 0; to->di_mode = cpu_to_be16(from->di_mode); to->di_version = from->di_version; to->di_format = from->di_format; - to->di_onlink = cpu_to_be16(from->di_onlink); to->di_uid = cpu_to_be32(from->di_uid); to->di_gid = cpu_to_be32(from->di_gid); to->di_nlink = cpu_to_be32(from->di_nlink); @@ -310,9 +322,9 @@ xfs_log_dinode_to_disk( { to->di_magic = cpu_to_be16(from->di_magic); to->di_mode = cpu_to_be16(from->di_mode); - to->di_version = from ->di_version; + to->di_version = from->di_version; to->di_format = from->di_format; - to->di_onlink = cpu_to_be16(from->di_onlink); + to->di_onlink = 0; to->di_uid = cpu_to_be32(from->di_uid); to->di_gid = cpu_to_be32(from->di_gid); to->di_nlink = cpu_to_be32(from->di_nlink); @@ -492,21 +504,7 @@ xfs_iread( ip->i_d.di_mode = 0; } - /* - * Automatically convert version 1 inode formats in memory to version 2 - * inode format. If the inode is modified, it will get logged and - * rewritten as a version 2 inode. We can do this because we set the - * superblock feature bit for v2 inodes unconditionally during mount - * and it means the reast of the code can assume the inode version is 2 - * or higher. - */ - if (ip->i_d.di_version == 1) { - ip->i_d.di_version = 2; - ip->i_d.di_nlink = ip->i_d.di_onlink; - ip->i_d.di_onlink = 0; - xfs_set_projid(ip, 0); - } - + ASSERT(ip->i_d.di_version >= 2); ip->i_delayed_blks = 0; /* diff --git a/fs/xfs/libxfs/xfs_inode_buf.h b/fs/xfs/libxfs/xfs_inode_buf.h index 7b8b1b9..73ba1d8 100644 --- a/fs/xfs/libxfs/xfs_inode_buf.h +++ b/fs/xfs/libxfs/xfs_inode_buf.h @@ -31,7 +31,6 @@ struct xfs_icdinode { __uint16_t di_mode; /* mode and type of file */ __int8_t di_version; /* inode version */ __int8_t di_format; /* format of di_c data */ - __uint16_t di_onlink; /* old number of links to file */ __uint16_t di_flushiter; /* incremented on flush */ __uint32_t di_uid; /* owner's user id */ __uint32_t di_gid; /* owner's group id */ diff --git a/fs/xfs/libxfs/xfs_log_format.h b/fs/xfs/libxfs/xfs_log_format.h index a78e1de..d54a801 100644 --- a/fs/xfs/libxfs/xfs_log_format.h +++ b/fs/xfs/libxfs/xfs_log_format.h @@ -369,7 +369,7 @@ struct xfs_log_dinode { __uint16_t di_mode; /* mode and type of file */ __int8_t di_version; /* inode version */ __int8_t di_format; /* format of di_c data */ - __uint16_t di_onlink; /* old number of links to file */ + __uint8_t di_pad3[2]; /* unused in v2/3 inodes */ __uint32_t di_uid; /* owner's user id */ __uint32_t di_gid; /* owner's group id */ __uint32_t di_nlink; /* number of links to file */ diff --git a/fs/xfs/xfs_inode.c b/fs/xfs/xfs_inode.c index 45acdee..7d9c514 100644 --- a/fs/xfs/xfs_inode.c +++ b/fs/xfs/xfs_inode.c @@ -803,9 +803,7 @@ xfs_ialloc( ip->i_d.di_version = 2; ip->i_d.di_mode = mode; - ip->i_d.di_onlink = 0; ip->i_d.di_nlink = nlink; - ASSERT(ip->i_d.di_nlink == nlink); ip->i_d.di_uid = xfs_kuid_to_uid(current_fsuid()); ip->i_d.di_gid = xfs_kgid_to_gid(current_fsgid()); xfs_set_projid(ip, prid); diff --git a/fs/xfs/xfs_inode_item.c b/fs/xfs/xfs_inode_item.c index 588d1b4..1e5ecbc 100644 --- a/fs/xfs/xfs_inode_item.c +++ b/fs/xfs/xfs_inode_item.c @@ -336,7 +336,6 @@ xfs_inode_to_log_dinode( to->di_mode = from->di_mode; to->di_version = from->di_version; to->di_format = from->di_format; - to->di_onlink = from->di_onlink; to->di_uid = from->di_uid; to->di_gid = from->di_gid; to->di_nlink = from->di_nlink; @@ -344,6 +343,7 @@ xfs_inode_to_log_dinode( to->di_projid_hi = from->di_projid_hi; memset(to->di_pad, 0, sizeof(to->di_pad)); + memset(to->di_pad3, 0, sizeof(to->di_pad3)); to->di_atime.t_sec = inode->i_atime.tv_sec; to->di_atime.t_nsec = inode->i_atime.tv_nsec; to->di_mtime.t_sec = inode->i_mtime.tv_sec; -- 2.5.0 From dave@fromorbit.com Sun Feb 7 22:24:35 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=ham version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay3.corp.sgi.com [198.149.34.15]) by oss.sgi.com (Postfix) with ESMTP id D516C7CA3 for ; Sun, 7 Feb 2016 22:24:33 -0600 (CST) Received: from cuda.sgi.com (cuda2.sgi.com [192.48.176.25]) by relay3.corp.sgi.com (Postfix) with ESMTP id 4C702AC002 for ; Sun, 7 Feb 2016 20:24:33 -0800 (PST) X-ASG-Debug-ID: 1454905468-04cbb04cf913d100001-NocioJ Received: from ipmail06.adl2.internode.on.net (ipmail06.adl2.internode.on.net [150.101.137.129]) by cuda.sgi.com with ESMTP id bHxVnhEEV9nf0CPN for ; Sun, 07 Feb 2016 20:24:29 -0800 (PST) X-Barracuda-Envelope-From: dave@fromorbit.com X-Barracuda-Apparent-Source-IP: 150.101.137.129 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: A2DGEQBJF7hWPBATLHleKAECgw+BP4ZjgXidQAEBAQEBAQaRKos5TQEBAQEBAQcBAQEBQT9BEgGDbgEFJy8zCBgZGDkDBxQZiBq8XYVKiXkMg2YFlnWcQ44+ghgBCwE9AxmBXCguhwAjgTABAQE Received: from ppp121-44-19-16.lns20.syd4.internode.on.net (HELO dastard) ([121.44.19.16]) by ipmail06.adl2.internode.on.net with ESMTP; 08 Feb 2016 14:54:24 +1030 Received: from disappointment.disaster.area ([192.168.1.110] helo=disappointment) by dastard with esmtp (Exim 4.80) (envelope-from ) id 1aSdN9-00072I-Mq for xfs@oss.sgi.com; Mon, 08 Feb 2016 15:24:23 +1100 Received: from dave by disappointment with local (Exim 4.86) (envelope-from ) id 1aSdN9-0000ln-M1 for xfs@oss.sgi.com; Mon, 08 Feb 2016 15:24:23 +1100 From: Dave Chinner To: xfs@oss.sgi.com Subject: [PATCH 1/9] xfs: introduce inode log format object Date: Mon, 8 Feb 2016 15:24:13 +1100 X-ASG-Orig-Subj: [PATCH 1/9] xfs: introduce inode log format object Message-Id: <1454905461-2773-2-git-send-email-david@fromorbit.com> X-Mailer: git-send-email 2.5.0 In-Reply-To: <1454905461-2773-1-git-send-email-david@fromorbit.com> References: <1454905461-2773-1-git-send-email-david@fromorbit.com> X-Barracuda-Connect: ipmail06.adl2.internode.on.net[150.101.137.129] X-Barracuda-Start-Time: 1454905468 X-Barracuda-URL: https://192.48.176.25:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-BRTS-Status: 1 X-Barracuda-Spam-Score: 0.00 X-Barracuda-Spam-Status: No, SCORE=0.00 using per-user scores of TAG_LEVEL=1000.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.7 tests= X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.3.26847 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- From: Dave Chinner We currently carry around and log an entire inode core in the struct xfs_inode. A lot of the information in the inode core is duplicated in the VFS inode, but we cannot remove this duplication of infomration because the inode core is logged directly in xfs_inode_item_format(). Add a new function xfs_inode_item_format_core() that copies the inode core data into a struct xfs_icdinode that is pulled directly from the log vector buffer. This means we no longer directly copy the inode core, but copy the structures one member at a time. This will be slightly less efficient than copying, but will allow us to remove duplicate and unnecessary items from the struct xfs_inode. To enable us to do this, call the new structure a xfs_log_dinode, so that we know it's different to the physical xfs_dinode and the in-core xfs_icdinode. Signed-off-by: Dave Chinner Reviewed-by: Brian Foster Signed-off-by: Dave Chinner --- fs/xfs/libxfs/xfs_inode_buf.c | 8 +-- fs/xfs/libxfs/xfs_inode_buf.h | 53 ++++++++++++++++- fs/xfs/libxfs/xfs_log_format.h | 15 ++--- fs/xfs/xfs_icache.c | 2 +- fs/xfs/xfs_inode.h | 2 +- fs/xfs/xfs_inode_item.c | 128 +++++++++++++++++++++++++++++++++++++++-- fs/xfs/xfs_inode_item.h | 2 + fs/xfs/xfs_log_recover.c | 52 +++++++++-------- 8 files changed, 218 insertions(+), 44 deletions(-) diff --git a/fs/xfs/libxfs/xfs_inode_buf.c b/fs/xfs/libxfs/xfs_inode_buf.c index 1aabfda..63d46bf 100644 --- a/fs/xfs/libxfs/xfs_inode_buf.c +++ b/fs/xfs/libxfs/xfs_inode_buf.c @@ -196,8 +196,8 @@ xfs_imap_to_bp( void xfs_dinode_from_disk( - xfs_icdinode_t *to, - xfs_dinode_t *from) + struct xfs_icdinode *to, + struct xfs_dinode *from) { to->di_magic = be16_to_cpu(from->di_magic); to->di_mode = be16_to_cpu(from->di_mode); @@ -243,8 +243,8 @@ xfs_dinode_from_disk( void xfs_dinode_to_disk( - xfs_dinode_t *to, - xfs_icdinode_t *from) + struct xfs_dinode *to, + struct xfs_icdinode *from) { to->di_magic = cpu_to_be16(from->di_magic); to->di_mode = cpu_to_be16(from->di_mode); diff --git a/fs/xfs/libxfs/xfs_inode_buf.h b/fs/xfs/libxfs/xfs_inode_buf.h index 9308c47..642f2a2 100644 --- a/fs/xfs/libxfs/xfs_inode_buf.h +++ b/fs/xfs/libxfs/xfs_inode_buf.h @@ -20,7 +20,58 @@ struct xfs_inode; struct xfs_dinode; -struct xfs_icdinode; + +/* + * In memory representation of the XFS inode. This is held in the in-core + * struct xfs_inode to represent the on disk values, but no longer needs to be + * identical to the on-disk structure as it is always translated to on-disk + * format specific structures at the appropriate time. + */ +struct xfs_icdinode { + __uint16_t di_magic; /* inode magic # = XFS_DINODE_MAGIC */ + __uint16_t di_mode; /* mode and type of file */ + __int8_t di_version; /* inode version */ + __int8_t di_format; /* format of di_c data */ + __uint16_t di_onlink; /* old number of links to file */ + __uint32_t di_uid; /* owner's user id */ + __uint32_t di_gid; /* owner's group id */ + __uint32_t di_nlink; /* number of links to file */ + __uint16_t di_projid_lo; /* lower part of owner's project id */ + __uint16_t di_projid_hi; /* higher part of owner's project id */ + __uint8_t di_pad[6]; /* unused, zeroed space */ + __uint16_t di_flushiter; /* incremented on flush */ + xfs_ictimestamp_t di_atime; /* time last accessed */ + xfs_ictimestamp_t di_mtime; /* time last modified */ + xfs_ictimestamp_t di_ctime; /* time created/inode modified */ + xfs_fsize_t di_size; /* number of bytes in file */ + xfs_rfsblock_t di_nblocks; /* # of direct & btree blocks used */ + xfs_extlen_t di_extsize; /* basic/minimum extent size for file */ + xfs_extnum_t di_nextents; /* number of extents in data fork */ + xfs_aextnum_t di_anextents; /* number of extents in attribute fork*/ + __uint8_t di_forkoff; /* attr fork offs, <<3 for 64b align */ + __int8_t di_aformat; /* format of attr fork's data */ + __uint32_t di_dmevmask; /* DMIG event mask */ + __uint16_t di_dmstate; /* DMIG state info */ + __uint16_t di_flags; /* random flags, XFS_DIFLAG_... */ + __uint32_t di_gen; /* generation number */ + + /* di_next_unlinked is the only non-core field in the old dinode */ + xfs_agino_t di_next_unlinked;/* agi unlinked list ptr */ + + /* start of the extended dinode, writable fields */ + __uint32_t di_crc; /* CRC of the inode */ + __uint64_t di_changecount; /* number of attribute changes */ + xfs_lsn_t di_lsn; /* flush sequence */ + __uint64_t di_flags2; /* more random flags */ + __uint8_t di_pad2[16]; /* more padding for future expansion */ + + /* fields only written to during inode creation */ + xfs_ictimestamp_t di_crtime; /* time created */ + xfs_ino_t di_ino; /* inode number */ + uuid_t di_uuid; /* UUID of the filesystem */ + + /* structure must be padded to 64 bit alignment */ +}; /* * Inode location information. Stored in the inode and passed to diff --git a/fs/xfs/libxfs/xfs_log_format.h b/fs/xfs/libxfs/xfs_log_format.h index 1be26ec..a78e1de 100644 --- a/fs/xfs/libxfs/xfs_log_format.h +++ b/fs/xfs/libxfs/xfs_log_format.h @@ -290,6 +290,7 @@ typedef struct xfs_inode_log_format_64 { __int32_t ilf_boffset; /* off of inode in buffer */ } xfs_inode_log_format_64_t; + /* * Flags for xfs_trans_log_inode flags field. */ @@ -360,10 +361,10 @@ typedef struct xfs_ictimestamp { } xfs_ictimestamp_t; /* - * NOTE: This structure must be kept identical to struct xfs_dinode - * except for the endianness annotations. + * Define the format of the inode core that is logged. This structure must be + * kept identical to struct xfs_dinode except for the endianness annotations. */ -typedef struct xfs_icdinode { +struct xfs_log_dinode { __uint16_t di_magic; /* inode magic # = XFS_DINODE_MAGIC */ __uint16_t di_mode; /* mode and type of file */ __int8_t di_version; /* inode version */ @@ -407,13 +408,13 @@ typedef struct xfs_icdinode { uuid_t di_uuid; /* UUID of the filesystem */ /* structure must be padded to 64 bit alignment */ -} xfs_icdinode_t; +}; -static inline uint xfs_icdinode_size(int version) +static inline uint xfs_log_dinode_size(int version) { if (version == 3) - return sizeof(struct xfs_icdinode); - return offsetof(struct xfs_icdinode, di_next_unlinked); + return sizeof(struct xfs_log_dinode); + return offsetof(struct xfs_log_dinode, di_next_unlinked); } /* diff --git a/fs/xfs/xfs_icache.c b/fs/xfs/xfs_icache.c index d7a490f..7c26f86 100644 --- a/fs/xfs/xfs_icache.c +++ b/fs/xfs/xfs_icache.c @@ -79,7 +79,7 @@ xfs_inode_alloc( memset(&ip->i_df, 0, sizeof(xfs_ifork_t)); ip->i_flags = 0; ip->i_delayed_blks = 0; - memset(&ip->i_d, 0, sizeof(xfs_icdinode_t)); + memset(&ip->i_d, 0, sizeof(ip->i_d)); return ip; } diff --git a/fs/xfs/xfs_inode.h b/fs/xfs/xfs_inode.h index ed7e933..57c5947 100644 --- a/fs/xfs/xfs_inode.h +++ b/fs/xfs/xfs_inode.h @@ -63,7 +63,7 @@ typedef struct xfs_inode { unsigned long i_flags; /* see defined flags below */ unsigned int i_delayed_blks; /* count of delay alloc blks */ - xfs_icdinode_t i_d; /* most of ondisk inode */ + struct xfs_icdinode i_d; /* most of ondisk inode */ /* VFS inode */ struct inode i_vnode; /* embedded VFS inode */ diff --git a/fs/xfs/xfs_inode_item.c b/fs/xfs/xfs_inode_item.c index d14b12b..3ad9972 100644 --- a/fs/xfs/xfs_inode_item.c +++ b/fs/xfs/xfs_inode_item.c @@ -135,7 +135,7 @@ xfs_inode_item_size( *nvecs += 2; *nbytes += sizeof(struct xfs_inode_log_format) + - xfs_icdinode_size(ip->i_d.di_version); + xfs_log_dinode_size(ip->i_d.di_version); xfs_inode_item_data_fork_size(iip, nvecs, nbytes); if (XFS_IFORK_Q(ip)) @@ -322,6 +322,127 @@ xfs_inode_item_format_attr_fork( } } +static void +xfs_icdinode_to_log_dinode( + struct xfs_icdinode *from, + struct xfs_log_dinode *to) +{ + to->di_magic = from->di_magic; + to->di_mode = from->di_mode; + to->di_version = from->di_version; + to->di_format = from->di_format; + to->di_onlink = from->di_onlink; + to->di_uid = from->di_uid; + to->di_gid = from->di_gid; + to->di_nlink = from->di_nlink; + to->di_projid_lo = from->di_projid_lo; + to->di_projid_hi = from->di_projid_hi; + memcpy(to->di_pad, from->di_pad, sizeof(to->di_pad)); + to->di_atime.t_sec = from->di_atime.t_sec; + to->di_atime.t_nsec = from->di_atime.t_nsec; + to->di_mtime.t_sec = from->di_mtime.t_sec; + to->di_mtime.t_nsec = from->di_mtime.t_nsec; + to->di_ctime.t_sec = from->di_ctime.t_sec; + to->di_ctime.t_nsec = from->di_ctime.t_nsec; + to->di_size = from->di_size; + to->di_nblocks = from->di_nblocks; + to->di_extsize = from->di_extsize; + to->di_nextents = from->di_nextents; + to->di_anextents = from->di_anextents; + to->di_forkoff = from->di_forkoff; + to->di_aformat = from->di_aformat; + to->di_dmevmask = from->di_dmevmask; + to->di_dmstate = from->di_dmstate; + to->di_flags = from->di_flags; + to->di_gen = from->di_gen; + + if (from->di_version == 3) { + to->di_changecount = from->di_changecount; + to->di_crtime.t_sec = from->di_crtime.t_sec; + to->di_crtime.t_nsec = from->di_crtime.t_nsec; + to->di_flags2 = from->di_flags2; + to->di_ino = from->di_ino; + to->di_lsn = from->di_lsn; + memcpy(to->di_pad2, from->di_pad2, sizeof(to->di_pad2)); + uuid_copy(&to->di_uuid, &from->di_uuid); + to->di_flushiter = 0; + } else { + to->di_flushiter = from->di_flushiter; + } +} + +/* + * Recovery needs to be able to convert a log dinode back to a real dinode + * for writeback we do that by converting a log dinode to a icdinode, and + * then passing that to the formatting function. + */ +void +xfs_log_dinode_to_icdinode( + struct xfs_log_dinode *from, + struct xfs_icdinode *to) +{ + to->di_magic = from->di_magic; + to->di_mode = from->di_mode; + to->di_version = from->di_version; + to->di_format = from->di_format; + to->di_onlink = from->di_onlink; + to->di_uid = from->di_uid; + to->di_gid = from->di_gid; + to->di_nlink = from->di_nlink; + to->di_projid_lo = from->di_projid_lo; + to->di_projid_hi = from->di_projid_hi; + memset(to->di_pad, 0, sizeof(to->di_pad)); + to->di_atime.t_sec = from->di_atime.t_sec; + to->di_atime.t_nsec = from->di_atime.t_nsec; + to->di_mtime.t_sec = from->di_mtime.t_sec; + to->di_mtime.t_nsec = from->di_mtime.t_nsec; + to->di_ctime.t_sec = from->di_ctime.t_sec; + to->di_ctime.t_nsec = from->di_ctime.t_nsec; + to->di_size = from->di_size; + to->di_nblocks = from->di_nblocks; + to->di_extsize = from->di_extsize; + to->di_nextents = from->di_nextents; + to->di_anextents = from->di_anextents; + to->di_forkoff = from->di_forkoff; + to->di_aformat = from->di_aformat; + to->di_dmevmask = from->di_dmevmask; + to->di_dmstate = from->di_dmstate; + to->di_flags = from->di_flags; + to->di_gen = from->di_gen; + + if (from->di_version == 3) { + to->di_changecount = from->di_changecount; + to->di_crtime.t_sec = from->di_crtime.t_sec; + to->di_crtime.t_nsec = from->di_crtime.t_nsec; + to->di_flags2 = from->di_flags2; + to->di_ino = from->di_ino; + to->di_lsn = from->di_lsn; + memcpy(to->di_pad2, from->di_pad2, sizeof(to->di_pad2)); + uuid_copy(&to->di_uuid, &from->di_uuid); + to->di_flushiter = 0; + } else { + to->di_flushiter = from->di_flushiter; + } +} + +/* + * Format the inode core. Current timestamp data is only in the VFS inode + * fields, so we need to grab them from there. Hence rather than just copying + * the XFS inode core structure, format the fields directly into the iovec. + */ +static void +xfs_inode_item_format_core( + struct xfs_inode *ip, + struct xfs_log_vec *lv, + struct xfs_log_iovec **vecp) +{ + struct xfs_log_dinode *dic; + + dic = xlog_prepare_iovec(lv, vecp, XLOG_REG_TYPE_ICORE); + xfs_icdinode_to_log_dinode(&ip->i_d, dic); + xlog_finish_iovec(lv, *vecp, xfs_log_dinode_size(ip->i_d.di_version)); +} + /* * This is called to fill in the vector of log iovecs for the given inode * log item. It fills the first item with an inode log format structure, @@ -351,10 +472,7 @@ xfs_inode_item_format( ilf->ilf_size = 2; /* format + core */ xlog_finish_iovec(lv, vecp, sizeof(struct xfs_inode_log_format)); - xlog_copy_iovec(lv, &vecp, XLOG_REG_TYPE_ICORE, - &ip->i_d, - xfs_icdinode_size(ip->i_d.di_version)); - + xfs_inode_item_format_core(ip, lv, &vecp); xfs_inode_item_format_data_fork(iip, ilf, lv, &vecp); if (XFS_IFORK_Q(ip)) { xfs_inode_item_format_attr_fork(iip, ilf, lv, &vecp); diff --git a/fs/xfs/xfs_inode_item.h b/fs/xfs/xfs_inode_item.h index 4c7722e..2426118 100644 --- a/fs/xfs/xfs_inode_item.h +++ b/fs/xfs/xfs_inode_item.h @@ -49,6 +49,8 @@ extern void xfs_istale_done(struct xfs_buf *, struct xfs_log_item *); extern void xfs_iflush_abort(struct xfs_inode *, bool); extern int xfs_inode_item_format_convert(xfs_log_iovec_t *, xfs_inode_log_format_t *); +extern void xfs_log_dinode_to_icdinode(struct xfs_log_dinode *from, + struct xfs_icdinode *to); extern struct kmem_zone *xfs_ili_zone; diff --git a/fs/xfs/xfs_log_recover.c b/fs/xfs/xfs_log_recover.c index af2539b..367012b 100644 --- a/fs/xfs/xfs_log_recover.c +++ b/fs/xfs/xfs_log_recover.c @@ -2844,7 +2844,8 @@ xlog_recover_inode_pass2( int error; int attr_index; uint fields; - xfs_icdinode_t *dicp; + struct xfs_log_dinode *ldip; + struct xfs_icdinode icic; uint isize; int need_free = 0; @@ -2897,8 +2898,8 @@ xlog_recover_inode_pass2( error = -EFSCORRUPTED; goto out_release; } - dicp = item->ri_buf[1].i_addr; - if (unlikely(dicp->di_magic != XFS_DINODE_MAGIC)) { + ldip = item->ri_buf[1].i_addr; + if (unlikely(ldip->di_magic != XFS_DINODE_MAGIC)) { xfs_alert(mp, "%s: Bad inode log record, rec ptr 0x%p, ino %Ld", __func__, item, in_f->ilf_ino); @@ -2934,13 +2935,13 @@ xlog_recover_inode_pass2( * to skip replay when the on disk inode is newer than the log one */ if (!xfs_sb_version_hascrc(&mp->m_sb) && - dicp->di_flushiter < be16_to_cpu(dip->di_flushiter)) { + ldip->di_flushiter < be16_to_cpu(dip->di_flushiter)) { /* * Deal with the wrap case, DI_MAX_FLUSH is less * than smaller numbers */ if (be16_to_cpu(dip->di_flushiter) == DI_MAX_FLUSH && - dicp->di_flushiter < (DI_MAX_FLUSH >> 1)) { + ldip->di_flushiter < (DI_MAX_FLUSH >> 1)) { /* do nothing */ } else { trace_xfs_log_recover_inode_skip(log, in_f); @@ -2950,13 +2951,13 @@ xlog_recover_inode_pass2( } /* Take the opportunity to reset the flush iteration count */ - dicp->di_flushiter = 0; + ldip->di_flushiter = 0; - if (unlikely(S_ISREG(dicp->di_mode))) { - if ((dicp->di_format != XFS_DINODE_FMT_EXTENTS) && - (dicp->di_format != XFS_DINODE_FMT_BTREE)) { + if (unlikely(S_ISREG(ldip->di_mode))) { + if ((ldip->di_format != XFS_DINODE_FMT_EXTENTS) && + (ldip->di_format != XFS_DINODE_FMT_BTREE)) { XFS_CORRUPTION_ERROR("xlog_recover_inode_pass2(3)", - XFS_ERRLEVEL_LOW, mp, dicp); + XFS_ERRLEVEL_LOW, mp, ldip); xfs_alert(mp, "%s: Bad regular inode log record, rec ptr 0x%p, " "ino ptr = 0x%p, ino bp = 0x%p, ino %Ld", @@ -2964,12 +2965,12 @@ xlog_recover_inode_pass2( error = -EFSCORRUPTED; goto out_release; } - } else if (unlikely(S_ISDIR(dicp->di_mode))) { - if ((dicp->di_format != XFS_DINODE_FMT_EXTENTS) && - (dicp->di_format != XFS_DINODE_FMT_BTREE) && - (dicp->di_format != XFS_DINODE_FMT_LOCAL)) { + } else if (unlikely(S_ISDIR(ldip->di_mode))) { + if ((ldip->di_format != XFS_DINODE_FMT_EXTENTS) && + (ldip->di_format != XFS_DINODE_FMT_BTREE) && + (ldip->di_format != XFS_DINODE_FMT_LOCAL)) { XFS_CORRUPTION_ERROR("xlog_recover_inode_pass2(4)", - XFS_ERRLEVEL_LOW, mp, dicp); + XFS_ERRLEVEL_LOW, mp, ldip); xfs_alert(mp, "%s: Bad dir inode log record, rec ptr 0x%p, " "ino ptr = 0x%p, ino bp = 0x%p, ino %Ld", @@ -2978,32 +2979,32 @@ xlog_recover_inode_pass2( goto out_release; } } - if (unlikely(dicp->di_nextents + dicp->di_anextents > dicp->di_nblocks)){ + if (unlikely(ldip->di_nextents + ldip->di_anextents > ldip->di_nblocks)){ XFS_CORRUPTION_ERROR("xlog_recover_inode_pass2(5)", - XFS_ERRLEVEL_LOW, mp, dicp); + XFS_ERRLEVEL_LOW, mp, ldip); xfs_alert(mp, "%s: Bad inode log record, rec ptr 0x%p, dino ptr 0x%p, " "dino bp 0x%p, ino %Ld, total extents = %d, nblocks = %Ld", __func__, item, dip, bp, in_f->ilf_ino, - dicp->di_nextents + dicp->di_anextents, - dicp->di_nblocks); + ldip->di_nextents + ldip->di_anextents, + ldip->di_nblocks); error = -EFSCORRUPTED; goto out_release; } - if (unlikely(dicp->di_forkoff > mp->m_sb.sb_inodesize)) { + if (unlikely(ldip->di_forkoff > mp->m_sb.sb_inodesize)) { XFS_CORRUPTION_ERROR("xlog_recover_inode_pass2(6)", - XFS_ERRLEVEL_LOW, mp, dicp); + XFS_ERRLEVEL_LOW, mp, ldip); xfs_alert(mp, "%s: Bad inode log record, rec ptr 0x%p, dino ptr 0x%p, " "dino bp 0x%p, ino %Ld, forkoff 0x%x", __func__, - item, dip, bp, in_f->ilf_ino, dicp->di_forkoff); + item, dip, bp, in_f->ilf_ino, ldip->di_forkoff); error = -EFSCORRUPTED; goto out_release; } - isize = xfs_icdinode_size(dicp->di_version); + isize = xfs_log_dinode_size(ldip->di_version); if (unlikely(item->ri_buf[1].i_len > isize)) { XFS_CORRUPTION_ERROR("xlog_recover_inode_pass2(7)", - XFS_ERRLEVEL_LOW, mp, dicp); + XFS_ERRLEVEL_LOW, mp, ldip); xfs_alert(mp, "%s: Bad inode log record length %d, rec ptr 0x%p", __func__, item->ri_buf[1].i_len, item); @@ -3012,7 +3013,8 @@ xlog_recover_inode_pass2( } /* The core is in in-core format */ - xfs_dinode_to_disk(dip, dicp); + xfs_log_dinode_to_icdinode(ldip, &icic); + xfs_dinode_to_disk(dip, &icic); /* the rest is in on-disk format */ if (item->ri_buf[1].i_len > isize) { -- 2.5.0 From dave@fromorbit.com Sun Feb 7 22:24:35 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=ham version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay2.corp.sgi.com [137.38.102.29]) by oss.sgi.com (Postfix) with ESMTP id 291F47CA5 for ; Sun, 7 Feb 2016 22:24:34 -0600 (CST) Received: from cuda.sgi.com (cuda3.sgi.com [192.48.176.15]) by relay2.corp.sgi.com (Postfix) with ESMTP id 1969F304048 for ; Sun, 7 Feb 2016 20:24:33 -0800 (PST) X-ASG-Debug-ID: 1454905465-04cb6c2747155150003-NocioJ Received: from ipmail06.adl2.internode.on.net (ipmail06.adl2.internode.on.net [150.101.137.129]) by cuda.sgi.com with ESMTP id fgljHoA2teHyhewK for ; Sun, 07 Feb 2016 20:24:30 -0800 (PST) X-Barracuda-Envelope-From: dave@fromorbit.com X-Barracuda-Apparent-Source-IP: 150.101.137.129 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: A2DIEQBJF7hWPBATLHleKAECgw+BP4ZjgXidQAEBAQEBAQaRKooUgSVNAQEBAQEBBwEBAQFBP0ESAYNuAQUnLzMIGDE5AwcUGYgavF2FSolXhBQFh1OPIpxDjj6CGAELAT0DGYFcKC6HAIFTAQEB Received: from ppp121-44-19-16.lns20.syd4.internode.on.net (HELO dastard) ([121.44.19.16]) by ipmail06.adl2.internode.on.net with ESMTP; 08 Feb 2016 14:54:24 +1030 Received: from disappointment.disaster.area ([192.168.1.110] helo=disappointment) by dastard with esmtp (Exim 4.80) (envelope-from ) id 1aSdN9-00072J-NH for xfs@oss.sgi.com; Mon, 08 Feb 2016 15:24:23 +1100 Received: from dave by disappointment with local (Exim 4.86) (envelope-from ) id 1aSdN9-0000ls-MQ for xfs@oss.sgi.com; Mon, 08 Feb 2016 15:24:23 +1100 From: Dave Chinner To: xfs@oss.sgi.com Subject: [PATCH 2/9] xfs: remove timestamps from incore inode Date: Mon, 8 Feb 2016 15:24:14 +1100 X-ASG-Orig-Subj: [PATCH 2/9] xfs: remove timestamps from incore inode Message-Id: <1454905461-2773-3-git-send-email-david@fromorbit.com> X-Mailer: git-send-email 2.5.0 In-Reply-To: <1454905461-2773-1-git-send-email-david@fromorbit.com> References: <1454905461-2773-1-git-send-email-david@fromorbit.com> X-Barracuda-Connect: ipmail06.adl2.internode.on.net[150.101.137.129] X-Barracuda-Start-Time: 1454905469 X-Barracuda-URL: https://192.48.176.15:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-BRTS-Status: 1 X-Barracuda-Spam-Score: 0.00 X-Barracuda-Spam-Status: No, SCORE=0.00 using per-user scores of TAG_LEVEL=1000.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.7 tests= X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.3.26847 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- From: Dave Chinner The struct xfs_inode has two copies of the current timestamps in it, one in the vfs inode and one in the struct xfs_icdinode. Now that we no longer log the struct xfs_icdinode directly, we don't need to keep the timestamps in this structure. instead we can copy them straight out of the VFS inode when formatting the inode log item or the on-disk inode. This reduces the struct xfs_inode in size by 24 bytes. Signed-off-by: Dave Chinner Reviewed-by: Brian Foster Signed-off-by: Dave Chinner --- fs/xfs/libxfs/xfs_inode_buf.c | 91 +++++++++++++++++++++++++++++++++++++------ fs/xfs/libxfs/xfs_inode_buf.h | 9 ++--- fs/xfs/libxfs/xfs_rtbitmap.c | 2 +- fs/xfs/xfs_inode.c | 21 +++++----- fs/xfs/xfs_inode_item.c | 73 ++++++---------------------------- fs/xfs/xfs_inode_item.h | 2 - fs/xfs/xfs_iops.c | 37 ++++-------------- fs/xfs/xfs_itable.c | 16 +++++--- fs/xfs/xfs_log_recover.c | 8 ++-- fs/xfs/xfs_rtalloc.c | 2 +- fs/xfs/xfs_trans_inode.c | 12 +----- 11 files changed, 130 insertions(+), 143 deletions(-) diff --git a/fs/xfs/libxfs/xfs_inode_buf.c b/fs/xfs/libxfs/xfs_inode_buf.c index 63d46bf..26e3c46 100644 --- a/fs/xfs/libxfs/xfs_inode_buf.c +++ b/fs/xfs/libxfs/xfs_inode_buf.c @@ -195,10 +195,13 @@ xfs_imap_to_bp( } void -xfs_dinode_from_disk( - struct xfs_icdinode *to, +xfs_inode_from_disk( + struct xfs_inode *ip, struct xfs_dinode *from) { + struct xfs_icdinode *to = &ip->i_d; + struct inode *inode = VFS_I(ip); + to->di_magic = be16_to_cpu(from->di_magic); to->di_mode = be16_to_cpu(from->di_mode); to->di_version = from ->di_version; @@ -211,12 +214,20 @@ xfs_dinode_from_disk( to->di_projid_hi = be16_to_cpu(from->di_projid_hi); memcpy(to->di_pad, from->di_pad, sizeof(to->di_pad)); to->di_flushiter = be16_to_cpu(from->di_flushiter); - to->di_atime.t_sec = be32_to_cpu(from->di_atime.t_sec); - to->di_atime.t_nsec = be32_to_cpu(from->di_atime.t_nsec); - to->di_mtime.t_sec = be32_to_cpu(from->di_mtime.t_sec); - to->di_mtime.t_nsec = be32_to_cpu(from->di_mtime.t_nsec); - to->di_ctime.t_sec = be32_to_cpu(from->di_ctime.t_sec); - to->di_ctime.t_nsec = be32_to_cpu(from->di_ctime.t_nsec); + + /* + * time is signed, so need to convert to signed 32 bit before + * storing in inode timestamp which may be 64 bit. Otherwise + * a time before epoch is converted to a time long after epoch + * on 64 bit systems. + */ + inode->i_atime.tv_sec = (int)be32_to_cpu(from->di_atime.t_sec); + inode->i_atime.tv_nsec = (int)be32_to_cpu(from->di_atime.t_nsec); + inode->i_mtime.tv_sec = (int)be32_to_cpu(from->di_mtime.t_sec); + inode->i_mtime.tv_nsec = (int)be32_to_cpu(from->di_mtime.t_nsec); + inode->i_ctime.tv_sec = (int)be32_to_cpu(from->di_ctime.t_sec); + inode->i_ctime.tv_nsec = (int)be32_to_cpu(from->di_ctime.t_nsec); + to->di_size = be64_to_cpu(from->di_size); to->di_nblocks = be64_to_cpu(from->di_nblocks); to->di_extsize = be32_to_cpu(from->di_extsize); @@ -242,9 +253,63 @@ xfs_dinode_from_disk( } void -xfs_dinode_to_disk( - struct xfs_dinode *to, - struct xfs_icdinode *from) +xfs_inode_to_disk( + struct xfs_inode *ip, + struct xfs_dinode *to) +{ + struct xfs_icdinode *from = &ip->i_d; + struct inode *inode = VFS_I(ip); + + to->di_magic = cpu_to_be16(from->di_magic); + to->di_mode = cpu_to_be16(from->di_mode); + to->di_version = from ->di_version; + to->di_format = from->di_format; + to->di_onlink = cpu_to_be16(from->di_onlink); + to->di_uid = cpu_to_be32(from->di_uid); + to->di_gid = cpu_to_be32(from->di_gid); + to->di_nlink = cpu_to_be32(from->di_nlink); + to->di_projid_lo = cpu_to_be16(from->di_projid_lo); + to->di_projid_hi = cpu_to_be16(from->di_projid_hi); + memcpy(to->di_pad, from->di_pad, sizeof(to->di_pad)); + + to->di_atime.t_sec = cpu_to_be32(inode->i_atime.tv_sec); + to->di_atime.t_nsec = cpu_to_be32(inode->i_atime.tv_nsec); + to->di_mtime.t_sec = cpu_to_be32(inode->i_mtime.tv_sec); + to->di_mtime.t_nsec = cpu_to_be32(inode->i_mtime.tv_nsec); + to->di_ctime.t_sec = cpu_to_be32(inode->i_ctime.tv_sec); + to->di_ctime.t_nsec = cpu_to_be32(inode->i_ctime.tv_nsec); + + to->di_size = cpu_to_be64(from->di_size); + to->di_nblocks = cpu_to_be64(from->di_nblocks); + to->di_extsize = cpu_to_be32(from->di_extsize); + to->di_nextents = cpu_to_be32(from->di_nextents); + to->di_anextents = cpu_to_be16(from->di_anextents); + to->di_forkoff = from->di_forkoff; + to->di_aformat = from->di_aformat; + to->di_dmevmask = cpu_to_be32(from->di_dmevmask); + to->di_dmstate = cpu_to_be16(from->di_dmstate); + to->di_flags = cpu_to_be16(from->di_flags); + to->di_gen = cpu_to_be32(from->di_gen); + + if (from->di_version == 3) { + to->di_changecount = cpu_to_be64(from->di_changecount); + to->di_crtime.t_sec = cpu_to_be32(from->di_crtime.t_sec); + to->di_crtime.t_nsec = cpu_to_be32(from->di_crtime.t_nsec); + to->di_flags2 = cpu_to_be64(from->di_flags2); + to->di_ino = cpu_to_be64(from->di_ino); + to->di_lsn = cpu_to_be64(from->di_lsn); + memcpy(to->di_pad2, from->di_pad2, sizeof(to->di_pad2)); + uuid_copy(&to->di_uuid, &from->di_uuid); + to->di_flushiter = 0; + } else { + to->di_flushiter = cpu_to_be16(from->di_flushiter); + } +} + +void +xfs_log_dinode_to_disk( + struct xfs_log_dinode *from, + struct xfs_dinode *to) { to->di_magic = cpu_to_be16(from->di_magic); to->di_mode = cpu_to_be16(from->di_mode); @@ -257,12 +322,14 @@ xfs_dinode_to_disk( to->di_projid_lo = cpu_to_be16(from->di_projid_lo); to->di_projid_hi = cpu_to_be16(from->di_projid_hi); memcpy(to->di_pad, from->di_pad, sizeof(to->di_pad)); + to->di_atime.t_sec = cpu_to_be32(from->di_atime.t_sec); to->di_atime.t_nsec = cpu_to_be32(from->di_atime.t_nsec); to->di_mtime.t_sec = cpu_to_be32(from->di_mtime.t_sec); to->di_mtime.t_nsec = cpu_to_be32(from->di_mtime.t_nsec); to->di_ctime.t_sec = cpu_to_be32(from->di_ctime.t_sec); to->di_ctime.t_nsec = cpu_to_be32(from->di_ctime.t_nsec); + to->di_size = cpu_to_be64(from->di_size); to->di_nblocks = cpu_to_be64(from->di_nblocks); to->di_extsize = cpu_to_be32(from->di_extsize); @@ -403,7 +470,7 @@ xfs_iread( * Otherwise, just get the truly permanent information. */ if (dip->di_mode) { - xfs_dinode_from_disk(&ip->i_d, dip); + xfs_inode_from_disk(ip, dip); error = xfs_iformat_fork(ip, dip); if (error) { #ifdef DEBUG diff --git a/fs/xfs/libxfs/xfs_inode_buf.h b/fs/xfs/libxfs/xfs_inode_buf.h index 642f2a2..adcc9bf 100644 --- a/fs/xfs/libxfs/xfs_inode_buf.h +++ b/fs/xfs/libxfs/xfs_inode_buf.h @@ -40,9 +40,6 @@ struct xfs_icdinode { __uint16_t di_projid_hi; /* higher part of owner's project id */ __uint8_t di_pad[6]; /* unused, zeroed space */ __uint16_t di_flushiter; /* incremented on flush */ - xfs_ictimestamp_t di_atime; /* time last accessed */ - xfs_ictimestamp_t di_mtime; /* time last modified */ - xfs_ictimestamp_t di_ctime; /* time created/inode modified */ xfs_fsize_t di_size; /* number of bytes in file */ xfs_rfsblock_t di_nblocks; /* # of direct & btree blocks used */ xfs_extlen_t di_extsize; /* basic/minimum extent size for file */ @@ -89,8 +86,10 @@ int xfs_imap_to_bp(struct xfs_mount *, struct xfs_trans *, int xfs_iread(struct xfs_mount *, struct xfs_trans *, struct xfs_inode *, uint); void xfs_dinode_calc_crc(struct xfs_mount *, struct xfs_dinode *); -void xfs_dinode_to_disk(struct xfs_dinode *to, struct xfs_icdinode *from); -void xfs_dinode_from_disk(struct xfs_icdinode *to, struct xfs_dinode *from); +void xfs_inode_to_disk(struct xfs_inode *ip, struct xfs_dinode *to); +void xfs_inode_from_disk(struct xfs_inode *ip, struct xfs_dinode *from); +void xfs_log_dinode_to_disk(struct xfs_log_dinode *from, + struct xfs_dinode *to); #if defined(DEBUG) void xfs_inobp_check(struct xfs_mount *, struct xfs_buf *); diff --git a/fs/xfs/libxfs/xfs_rtbitmap.c b/fs/xfs/libxfs/xfs_rtbitmap.c index 33806e0..951c044 100644 --- a/fs/xfs/libxfs/xfs_rtbitmap.c +++ b/fs/xfs/libxfs/xfs_rtbitmap.c @@ -1011,7 +1011,7 @@ xfs_rtfree_extent( mp->m_sb.sb_rextents) { if (!(mp->m_rbmip->i_d.di_flags & XFS_DIFLAG_NEWRTBM)) mp->m_rbmip->i_d.di_flags |= XFS_DIFLAG_NEWRTBM; - *(__uint64_t *)&mp->m_rbmip->i_d.di_atime = 0; + *(__uint64_t *)&VFS_I(mp->m_rbmip)->i_atime = 0; xfs_trans_log_inode(tp, mp->m_rbmip, XFS_ILOG_CORE); } return 0; diff --git a/fs/xfs/xfs_inode.c b/fs/xfs/xfs_inode.c index ceba1a8..9ad9e35 100644 --- a/fs/xfs/xfs_inode.c +++ b/fs/xfs/xfs_inode.c @@ -766,6 +766,7 @@ xfs_ialloc( uint flags; int error; struct timespec tv; + struct inode *inode; /* * Call the space management code to pick @@ -791,6 +792,7 @@ xfs_ialloc( if (error) return error; ASSERT(ip != NULL); + inode = VFS_I(ip); /* * We always convert v1 inodes to v2 now - we only support filesystems @@ -832,10 +834,9 @@ xfs_ialloc( ASSERT(ip->i_d.di_nblocks == 0); tv = current_fs_time(mp->m_super); - ip->i_d.di_mtime.t_sec = (__int32_t)tv.tv_sec; - ip->i_d.di_mtime.t_nsec = (__int32_t)tv.tv_nsec; - ip->i_d.di_atime = ip->i_d.di_mtime; - ip->i_d.di_ctime = ip->i_d.di_mtime; + inode->i_mtime = tv; + inode->i_atime = tv; + inode->i_ctime = tv; /* * di_gen will have been taken care of in xfs_iread. @@ -853,7 +854,8 @@ xfs_ialloc( ip->i_d.di_lsn = 0; ip->i_d.di_flags2 = 0; memset(&(ip->i_d.di_pad2[0]), 0, sizeof(ip->i_d.di_pad2)); - ip->i_d.di_crtime = ip->i_d.di_mtime; + ip->i_d.di_crtime.t_sec = (__int32_t)tv.tv_sec; + ip->i_d.di_crtime.t_nsec = (__int32_t)tv.tv_nsec; } @@ -3523,12 +3525,11 @@ xfs_iflush_int( ip->i_d.di_flushiter++; /* - * Copy the dirty parts of the inode into the on-disk - * inode. We always copy out the core of the inode, - * because if the inode is dirty at all the core must - * be. + * Copy the dirty parts of the inode into the on-disk inode. We always + * copy out the core of the inode, because if the inode is dirty at all + * the core must be. */ - xfs_dinode_to_disk(dip, &ip->i_d); + xfs_inode_to_disk(ip, dip); /* Wrap, we never let the log put out DI_MAX_FLUSH */ if (ip->i_d.di_flushiter == DI_MAX_FLUSH) diff --git a/fs/xfs/xfs_inode_item.c b/fs/xfs/xfs_inode_item.c index 3ad9972..9dcbf58 100644 --- a/fs/xfs/xfs_inode_item.c +++ b/fs/xfs/xfs_inode_item.c @@ -323,10 +323,13 @@ xfs_inode_item_format_attr_fork( } static void -xfs_icdinode_to_log_dinode( - struct xfs_icdinode *from, +xfs_inode_to_log_dinode( + struct xfs_inode *ip, struct xfs_log_dinode *to) { + struct xfs_icdinode *from = &ip->i_d; + struct inode *inode = VFS_I(ip); + to->di_magic = from->di_magic; to->di_mode = from->di_mode; to->di_version = from->di_version; @@ -338,66 +341,14 @@ xfs_icdinode_to_log_dinode( to->di_projid_lo = from->di_projid_lo; to->di_projid_hi = from->di_projid_hi; memcpy(to->di_pad, from->di_pad, sizeof(to->di_pad)); - to->di_atime.t_sec = from->di_atime.t_sec; - to->di_atime.t_nsec = from->di_atime.t_nsec; - to->di_mtime.t_sec = from->di_mtime.t_sec; - to->di_mtime.t_nsec = from->di_mtime.t_nsec; - to->di_ctime.t_sec = from->di_ctime.t_sec; - to->di_ctime.t_nsec = from->di_ctime.t_nsec; - to->di_size = from->di_size; - to->di_nblocks = from->di_nblocks; - to->di_extsize = from->di_extsize; - to->di_nextents = from->di_nextents; - to->di_anextents = from->di_anextents; - to->di_forkoff = from->di_forkoff; - to->di_aformat = from->di_aformat; - to->di_dmevmask = from->di_dmevmask; - to->di_dmstate = from->di_dmstate; - to->di_flags = from->di_flags; - to->di_gen = from->di_gen; - if (from->di_version == 3) { - to->di_changecount = from->di_changecount; - to->di_crtime.t_sec = from->di_crtime.t_sec; - to->di_crtime.t_nsec = from->di_crtime.t_nsec; - to->di_flags2 = from->di_flags2; - to->di_ino = from->di_ino; - to->di_lsn = from->di_lsn; - memcpy(to->di_pad2, from->di_pad2, sizeof(to->di_pad2)); - uuid_copy(&to->di_uuid, &from->di_uuid); - to->di_flushiter = 0; - } else { - to->di_flushiter = from->di_flushiter; - } -} + to->di_atime.t_sec = inode->i_atime.tv_sec; + to->di_atime.t_nsec = inode->i_atime.tv_nsec; + to->di_mtime.t_sec = inode->i_mtime.tv_sec; + to->di_mtime.t_nsec = inode->i_mtime.tv_nsec; + to->di_ctime.t_sec = inode->i_ctime.tv_sec; + to->di_ctime.t_nsec = inode->i_ctime.tv_nsec; -/* - * Recovery needs to be able to convert a log dinode back to a real dinode - * for writeback we do that by converting a log dinode to a icdinode, and - * then passing that to the formatting function. - */ -void -xfs_log_dinode_to_icdinode( - struct xfs_log_dinode *from, - struct xfs_icdinode *to) -{ - to->di_magic = from->di_magic; - to->di_mode = from->di_mode; - to->di_version = from->di_version; - to->di_format = from->di_format; - to->di_onlink = from->di_onlink; - to->di_uid = from->di_uid; - to->di_gid = from->di_gid; - to->di_nlink = from->di_nlink; - to->di_projid_lo = from->di_projid_lo; - to->di_projid_hi = from->di_projid_hi; - memset(to->di_pad, 0, sizeof(to->di_pad)); - to->di_atime.t_sec = from->di_atime.t_sec; - to->di_atime.t_nsec = from->di_atime.t_nsec; - to->di_mtime.t_sec = from->di_mtime.t_sec; - to->di_mtime.t_nsec = from->di_mtime.t_nsec; - to->di_ctime.t_sec = from->di_ctime.t_sec; - to->di_ctime.t_nsec = from->di_ctime.t_nsec; to->di_size = from->di_size; to->di_nblocks = from->di_nblocks; to->di_extsize = from->di_extsize; @@ -439,7 +390,7 @@ xfs_inode_item_format_core( struct xfs_log_dinode *dic; dic = xlog_prepare_iovec(lv, vecp, XLOG_REG_TYPE_ICORE); - xfs_icdinode_to_log_dinode(&ip->i_d, dic); + xfs_inode_to_log_dinode(ip, dic); xlog_finish_iovec(lv, *vecp, xfs_log_dinode_size(ip->i_d.di_version)); } diff --git a/fs/xfs/xfs_inode_item.h b/fs/xfs/xfs_inode_item.h index 2426118..4c7722e 100644 --- a/fs/xfs/xfs_inode_item.h +++ b/fs/xfs/xfs_inode_item.h @@ -49,8 +49,6 @@ extern void xfs_istale_done(struct xfs_buf *, struct xfs_log_item *); extern void xfs_iflush_abort(struct xfs_inode *, bool); extern int xfs_inode_item_format_convert(xfs_log_iovec_t *, xfs_inode_log_format_t *); -extern void xfs_log_dinode_to_icdinode(struct xfs_log_dinode *from, - struct xfs_icdinode *to); extern struct kmem_zone *xfs_ili_zone; diff --git a/fs/xfs/xfs_iops.c b/fs/xfs/xfs_iops.c index 76b71a1..cd27c6d 100644 --- a/fs/xfs/xfs_iops.c +++ b/fs/xfs/xfs_iops.c @@ -522,21 +522,12 @@ xfs_setattr_time( ASSERT(xfs_isilocked(ip, XFS_ILOCK_EXCL)); - if (iattr->ia_valid & ATTR_ATIME) { + if (iattr->ia_valid & ATTR_ATIME) inode->i_atime = iattr->ia_atime; - ip->i_d.di_atime.t_sec = iattr->ia_atime.tv_sec; - ip->i_d.di_atime.t_nsec = iattr->ia_atime.tv_nsec; - } - if (iattr->ia_valid & ATTR_CTIME) { + if (iattr->ia_valid & ATTR_CTIME) inode->i_ctime = iattr->ia_ctime; - ip->i_d.di_ctime.t_sec = iattr->ia_ctime.tv_sec; - ip->i_d.di_ctime.t_nsec = iattr->ia_ctime.tv_nsec; - } - if (iattr->ia_valid & ATTR_MTIME) { + if (iattr->ia_valid & ATTR_MTIME) inode->i_mtime = iattr->ia_mtime; - ip->i_d.di_mtime.t_sec = iattr->ia_mtime.tv_sec; - ip->i_d.di_mtime.t_nsec = iattr->ia_mtime.tv_nsec; - } } int @@ -991,21 +982,13 @@ xfs_vn_update_time( } xfs_ilock(ip, XFS_ILOCK_EXCL); - if (flags & S_CTIME) { + if (flags & S_CTIME) inode->i_ctime = *now; - ip->i_d.di_ctime.t_sec = (__int32_t)now->tv_sec; - ip->i_d.di_ctime.t_nsec = (__int32_t)now->tv_nsec; - } - if (flags & S_MTIME) { + if (flags & S_MTIME) inode->i_mtime = *now; - ip->i_d.di_mtime.t_sec = (__int32_t)now->tv_sec; - ip->i_d.di_mtime.t_nsec = (__int32_t)now->tv_nsec; - } - if (flags & S_ATIME) { + if (flags & S_ATIME) inode->i_atime = *now; - ip->i_d.di_atime.t_sec = (__int32_t)now->tv_sec; - ip->i_d.di_atime.t_nsec = (__int32_t)now->tv_nsec; - } + xfs_trans_ijoin(tp, ip, XFS_ILOCK_EXCL); xfs_trans_log_inode(tp, ip, XFS_ILOG_TIMESTAMP); return xfs_trans_commit(tp); @@ -1251,12 +1234,6 @@ xfs_setup_inode( inode->i_generation = ip->i_d.di_gen; i_size_write(inode, ip->i_d.di_size); - inode->i_atime.tv_sec = ip->i_d.di_atime.t_sec; - inode->i_atime.tv_nsec = ip->i_d.di_atime.t_nsec; - inode->i_mtime.tv_sec = ip->i_d.di_mtime.t_sec; - inode->i_mtime.tv_nsec = ip->i_d.di_mtime.t_nsec; - inode->i_ctime.tv_sec = ip->i_d.di_ctime.t_sec; - inode->i_ctime.tv_nsec = ip->i_d.di_ctime.t_nsec; xfs_diflags_to_iflags(inode, ip); ip->d_ops = ip->i_mount->m_nondir_inode_ops; diff --git a/fs/xfs/xfs_itable.c b/fs/xfs/xfs_itable.c index 930ebd8..2acda42 100644 --- a/fs/xfs/xfs_itable.c +++ b/fs/xfs/xfs_itable.c @@ -57,6 +57,7 @@ xfs_bulkstat_one_int( { struct xfs_icdinode *dic; /* dinode core info pointer */ struct xfs_inode *ip; /* incore inode pointer */ + struct inode *inode; struct xfs_bstat *buf; /* return buffer */ int error = 0; /* error value */ @@ -77,6 +78,7 @@ xfs_bulkstat_one_int( ASSERT(ip != NULL); ASSERT(ip->i_imap.im_blkno != 0); + inode = VFS_I(ip); dic = &ip->i_d; @@ -91,12 +93,14 @@ xfs_bulkstat_one_int( buf->bs_uid = dic->di_uid; buf->bs_gid = dic->di_gid; buf->bs_size = dic->di_size; - buf->bs_atime.tv_sec = dic->di_atime.t_sec; - buf->bs_atime.tv_nsec = dic->di_atime.t_nsec; - buf->bs_mtime.tv_sec = dic->di_mtime.t_sec; - buf->bs_mtime.tv_nsec = dic->di_mtime.t_nsec; - buf->bs_ctime.tv_sec = dic->di_ctime.t_sec; - buf->bs_ctime.tv_nsec = dic->di_ctime.t_nsec; + + buf->bs_atime.tv_sec = inode->i_atime.tv_sec; + buf->bs_atime.tv_nsec = inode->i_atime.tv_nsec; + buf->bs_mtime.tv_sec = inode->i_mtime.tv_sec; + buf->bs_mtime.tv_nsec = inode->i_mtime.tv_nsec; + buf->bs_ctime.tv_sec = inode->i_ctime.tv_sec; + buf->bs_ctime.tv_nsec = inode->i_ctime.tv_nsec; + buf->bs_xflags = xfs_ip2xflags(ip); buf->bs_extsize = dic->di_extsize << mp->m_sb.sb_blocklog; buf->bs_extents = dic->di_nextents; diff --git a/fs/xfs/xfs_log_recover.c b/fs/xfs/xfs_log_recover.c index 367012b..97bcfc8 100644 --- a/fs/xfs/xfs_log_recover.c +++ b/fs/xfs/xfs_log_recover.c @@ -2798,7 +2798,7 @@ xfs_recover_inode_owner_change( return -ENOMEM; /* instantiate the inode */ - xfs_dinode_from_disk(&ip->i_d, dip); + xfs_inode_from_disk(ip, dip); ASSERT(ip->i_d.di_version >= 3); error = xfs_iformat_fork(ip, dip); @@ -2845,7 +2845,6 @@ xlog_recover_inode_pass2( int attr_index; uint fields; struct xfs_log_dinode *ldip; - struct xfs_icdinode icic; uint isize; int need_free = 0; @@ -3012,9 +3011,8 @@ xlog_recover_inode_pass2( goto out_release; } - /* The core is in in-core format */ - xfs_log_dinode_to_icdinode(ldip, &icic); - xfs_dinode_to_disk(dip, &icic); + /* recover the log dinode inode into the on disk inode */ + xfs_log_dinode_to_disk(ldip, dip); /* the rest is in on-disk format */ if (item->ri_buf[1].i_len > isize) { diff --git a/fs/xfs/xfs_rtalloc.c b/fs/xfs/xfs_rtalloc.c index be02a68..abf4443 100644 --- a/fs/xfs/xfs_rtalloc.c +++ b/fs/xfs/xfs_rtalloc.c @@ -1272,7 +1272,7 @@ xfs_rtpick_extent( ASSERT(xfs_isilocked(mp->m_rbmip, XFS_ILOCK_EXCL)); - seqp = (__uint64_t *)&mp->m_rbmip->i_d.di_atime; + seqp = (__uint64_t *)&VFS_I(mp->m_rbmip)->i_atime; if (!(mp->m_rbmip->i_d.di_flags & XFS_DIFLAG_NEWRTBM)) { mp->m_rbmip->i_d.di_flags |= XFS_DIFLAG_NEWRTBM; *seqp = 0; diff --git a/fs/xfs/xfs_trans_inode.c b/fs/xfs/xfs_trans_inode.c index b97f1df..3f0d466 100644 --- a/fs/xfs/xfs_trans_inode.c +++ b/fs/xfs/xfs_trans_inode.c @@ -75,18 +75,10 @@ xfs_trans_ichgtime( tv = current_fs_time(inode->i_sb); - if ((flags & XFS_ICHGTIME_MOD) && - !timespec_equal(&inode->i_mtime, &tv)) { + if (flags & XFS_ICHGTIME_MOD) inode->i_mtime = tv; - ip->i_d.di_mtime.t_sec = tv.tv_sec; - ip->i_d.di_mtime.t_nsec = tv.tv_nsec; - } - if ((flags & XFS_ICHGTIME_CHG) && - !timespec_equal(&inode->i_ctime, &tv)) { + if (flags & XFS_ICHGTIME_CHG) inode->i_ctime = tv; - ip->i_d.di_ctime.t_sec = tv.tv_sec; - ip->i_d.di_ctime.t_nsec = tv.tv_nsec; - } } /* -- 2.5.0 From dave@fromorbit.com Sun Feb 7 22:24:37 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=ham version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay3.corp.sgi.com [198.149.34.15]) by oss.sgi.com (Postfix) with ESMTP id DA2BD7CAA for ; Sun, 7 Feb 2016 22:24:34 -0600 (CST) Received: from cuda.sgi.com (cuda3.sgi.com [192.48.176.15]) by relay3.corp.sgi.com (Postfix) with ESMTP id 6E577AC004 for ; Sun, 7 Feb 2016 20:24:34 -0800 (PST) X-ASG-Debug-ID: 1454905466-04cb6c2746155150003-NocioJ Received: from ipmail06.adl2.internode.on.net (ipmail06.adl2.internode.on.net [150.101.137.129]) by cuda.sgi.com with ESMTP id 25hfcSMI0SByGALV for ; Sun, 07 Feb 2016 20:24:31 -0800 (PST) X-Barracuda-Envelope-From: dave@fromorbit.com X-Barracuda-Apparent-Source-IP: 150.101.137.129 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: A2DIEQBJF7hWPBATLHleKAECgw+BP4ZjgXidQAEBAQEBAQaRKooUgSVNAQEBAQEBBwEBAQFBP0ESAYNuAQUnLzMIGDE5AwcUGYgavF2FSolXhBQFlnWcQ0SNeoIYAQs+HIFcKC6HAIFTAQEB Received: from ppp121-44-19-16.lns20.syd4.internode.on.net (HELO dastard) ([121.44.19.16]) by ipmail06.adl2.internode.on.net with ESMTP; 08 Feb 2016 14:54:24 +1030 Received: from disappointment.disaster.area ([192.168.1.110] helo=disappointment) by dastard with esmtp (Exim 4.80) (envelope-from ) id 1aSdN9-00072P-QF for xfs@oss.sgi.com; Mon, 08 Feb 2016 15:24:23 +1100 Received: from dave by disappointment with local (Exim 4.86) (envelope-from ) id 1aSdN9-0000mM-PI for xfs@oss.sgi.com; Mon, 08 Feb 2016 15:24:23 +1100 From: Dave Chinner To: xfs@oss.sgi.com Subject: [PATCH 8/9] xfs: move di_changecount to VFS inode Date: Mon, 8 Feb 2016 15:24:20 +1100 X-ASG-Orig-Subj: [PATCH 8/9] xfs: move di_changecount to VFS inode Message-Id: <1454905461-2773-9-git-send-email-david@fromorbit.com> X-Mailer: git-send-email 2.5.0 In-Reply-To: <1454905461-2773-1-git-send-email-david@fromorbit.com> References: <1454905461-2773-1-git-send-email-david@fromorbit.com> X-Barracuda-Connect: ipmail06.adl2.internode.on.net[150.101.137.129] X-Barracuda-Start-Time: 1454905471 X-Barracuda-URL: https://192.48.176.15:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-BRTS-Status: 1 X-Barracuda-Spam-Score: 0.00 X-Barracuda-Spam-Status: No, SCORE=0.00 using per-user scores of TAG_LEVEL=1000.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.7 tests= X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.3.26847 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- From: Dave Chinner We can store the di_changecount in the i_version field of the VFS inode and remove another 8 bytes from the xfs_icdinode. Signed-off-by: Dave Chinner Reviewed-by: Brian Foster Signed-off-by: Dave Chinner --- fs/xfs/libxfs/xfs_inode_buf.c | 4 ++-- fs/xfs/libxfs/xfs_inode_buf.h | 1 - fs/xfs/xfs_icache.c | 6 ++++-- fs/xfs/xfs_inode.c | 2 +- fs/xfs/xfs_inode_item.c | 2 +- fs/xfs/xfs_trans_inode.c | 2 +- 6 files changed, 9 insertions(+), 8 deletions(-) diff --git a/fs/xfs/libxfs/xfs_inode_buf.c b/fs/xfs/libxfs/xfs_inode_buf.c index 0a3f10b..9807c21 100644 --- a/fs/xfs/libxfs/xfs_inode_buf.c +++ b/fs/xfs/libxfs/xfs_inode_buf.c @@ -251,7 +251,7 @@ xfs_inode_from_disk( to->di_flags = be16_to_cpu(from->di_flags); if (to->di_version == 3) { - to->di_changecount = be64_to_cpu(from->di_changecount); + inode->i_version = be64_to_cpu(from->di_changecount); to->di_crtime.t_sec = be32_to_cpu(from->di_crtime.t_sec); to->di_crtime.t_nsec = be32_to_cpu(from->di_crtime.t_nsec); to->di_flags2 = be64_to_cpu(from->di_flags2); @@ -300,7 +300,7 @@ xfs_inode_to_disk( to->di_flags = cpu_to_be16(from->di_flags); if (from->di_version == 3) { - to->di_changecount = cpu_to_be64(from->di_changecount); + to->di_changecount = cpu_to_be64(inode->i_version); to->di_crtime.t_sec = cpu_to_be32(from->di_crtime.t_sec); to->di_crtime.t_nsec = cpu_to_be32(from->di_crtime.t_nsec); to->di_flags2 = cpu_to_be64(from->di_flags2); diff --git a/fs/xfs/libxfs/xfs_inode_buf.h b/fs/xfs/libxfs/xfs_inode_buf.h index 29fd9f1..c51bd12 100644 --- a/fs/xfs/libxfs/xfs_inode_buf.h +++ b/fs/xfs/libxfs/xfs_inode_buf.h @@ -47,7 +47,6 @@ struct xfs_icdinode { __uint16_t di_dmstate; /* DMIG state info */ __uint16_t di_flags; /* random flags, XFS_DIFLAG_... */ - __uint64_t di_changecount; /* number of attribute changes */ __uint64_t di_flags2; /* more random flags */ xfs_ictimestamp_t di_crtime; /* time created */ diff --git a/fs/xfs/xfs_icache.c b/fs/xfs/xfs_icache.c index 6401e3c..30eafad 100644 --- a/fs/xfs/xfs_icache.c +++ b/fs/xfs/xfs_icache.c @@ -138,9 +138,9 @@ xfs_inode_free( * When we recycle a reclaimable inode, we need to re-initialise the VFS inode * part of the structure. This is made more complex by the fact we store * information about the on-disk values in the VFS inode and so we can't just - * overwrite it's values unconditionally. Hence we save the parameters we + * overwrite the values unconditionally. Hence we save the parameters we * need to retain across reinitialisation, and rewrite them into the VFS inode - * after resetting it's state even if resetting fails. + * after reinitialisation even if it fails. */ static int xfs_reinit_inode( @@ -150,11 +150,13 @@ xfs_reinit_inode( int error; uint32_t nlink = inode->i_nlink; uint32_t generation = inode->i_generation; + uint64_t version = inode->i_version; error = inode_init_always(mp->m_super, inode); set_nlink(inode, nlink); inode->i_generation = generation; + inode->i_version = version; return error; } diff --git a/fs/xfs/xfs_inode.c b/fs/xfs/xfs_inode.c index e8f87c7..16fabbf 100644 --- a/fs/xfs/xfs_inode.c +++ b/fs/xfs/xfs_inode.c @@ -841,7 +841,7 @@ xfs_ialloc( ip->i_d.di_flags = 0; if (ip->i_d.di_version == 3) { - ip->i_d.di_changecount = 1; + inode->i_version = 1; ip->i_d.di_flags2 = 0; ip->i_d.di_crtime.t_sec = (__int32_t)tv.tv_sec; ip->i_d.di_crtime.t_nsec = (__int32_t)tv.tv_nsec; diff --git a/fs/xfs/xfs_inode_item.c b/fs/xfs/xfs_inode_item.c index 6367780..3415c63 100644 --- a/fs/xfs/xfs_inode_item.c +++ b/fs/xfs/xfs_inode_item.c @@ -364,7 +364,7 @@ xfs_inode_to_log_dinode( to->di_flags = from->di_flags; if (from->di_version == 3) { - to->di_changecount = from->di_changecount; + to->di_changecount = inode->i_version; to->di_crtime.t_sec = from->di_crtime.t_sec; to->di_crtime.t_nsec = from->di_crtime.t_nsec; to->di_flags2 = from->di_flags2; diff --git a/fs/xfs/xfs_trans_inode.c b/fs/xfs/xfs_trans_inode.c index 3f0d466..11a3af0 100644 --- a/fs/xfs/xfs_trans_inode.c +++ b/fs/xfs/xfs_trans_inode.c @@ -117,7 +117,7 @@ xfs_trans_log_inode( */ if (!(ip->i_itemp->ili_item.li_desc->lid_flags & XFS_LID_DIRTY) && IS_I_VERSION(VFS_I(ip))) { - ip->i_d.di_changecount = ++VFS_I(ip)->i_version; + VFS_I(ip)->i_version++; flags |= XFS_ILOG_CORE; } -- 2.5.0 From dave@fromorbit.com Sun Feb 7 22:24:39 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=ham version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay2.corp.sgi.com [137.38.102.29]) by oss.sgi.com (Postfix) with ESMTP id 66FEA7CA4 for ; Sun, 7 Feb 2016 22:24:36 -0600 (CST) Received: from cuda.sgi.com (cuda3.sgi.com [192.48.176.15]) by relay2.corp.sgi.com (Postfix) with ESMTP id 47620304048 for ; Sun, 7 Feb 2016 20:24:36 -0800 (PST) X-ASG-Debug-ID: 1454905465-04cb6c2747155150004-NocioJ Received: from ipmail06.adl2.internode.on.net (ipmail06.adl2.internode.on.net [150.101.137.129]) by cuda.sgi.com with ESMTP id fIdXTM67EDlG91UZ for ; Sun, 07 Feb 2016 20:24:33 -0800 (PST) X-Barracuda-Envelope-From: dave@fromorbit.com X-Barracuda-Apparent-Source-IP: 150.101.137.129 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: A2DMEQBJF7hWPBATLHleKAECgw+BP4ZjgXidQAEBAQEBAQaBaI9CihSBJU0BAQEBAQEHAQEBAUE/QRIBg24BBScvMwgYGRg5AwcUGYgavF2FSolXIgyDZgWHU48inEOOPoIYAQsBPQMZgVwoLocAHAcXB4ESAQEB Received: from ppp121-44-19-16.lns20.syd4.internode.on.net (HELO dastard) ([121.44.19.16]) by ipmail06.adl2.internode.on.net with ESMTP; 08 Feb 2016 14:54:24 +1030 Received: from disappointment.disaster.area ([192.168.1.110] helo=disappointment) by dastard with esmtp (Exim 4.80) (envelope-from ) id 1aSdN9-00072N-PL for xfs@oss.sgi.com; Mon, 08 Feb 2016 15:24:23 +1100 Received: from dave by disappointment with local (Exim 4.86) (envelope-from ) id 1aSdN9-0000mC-OT for xfs@oss.sgi.com; Mon, 08 Feb 2016 15:24:23 +1100 From: Dave Chinner To: xfs@oss.sgi.com Subject: [PATCH 6/9] xfs: use vfs inode nlink field everywhere Date: Mon, 8 Feb 2016 15:24:18 +1100 X-ASG-Orig-Subj: [PATCH 6/9] xfs: use vfs inode nlink field everywhere Message-Id: <1454905461-2773-7-git-send-email-david@fromorbit.com> X-Mailer: git-send-email 2.5.0 In-Reply-To: <1454905461-2773-1-git-send-email-david@fromorbit.com> References: <1454905461-2773-1-git-send-email-david@fromorbit.com> X-Barracuda-Connect: ipmail06.adl2.internode.on.net[150.101.137.129] X-Barracuda-Start-Time: 1454905472 X-Barracuda-URL: https://192.48.176.15:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-BRTS-Status: 1 X-Barracuda-Spam-Score: 0.00 X-Barracuda-Spam-Status: No, SCORE=0.00 using per-user scores of TAG_LEVEL=1000.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.7 tests= X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.3.26847 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- From: Dave Chinner The Vfs tracks the inodenlink just like the xfs_icdinode. We can remove the variable from the icdinode and use the vfs inode variable everywhere, reducing the size of the xfs_icdinode by a further 4 bytes. Signed-off-by: Dave Chinner --- fs/xfs/libxfs/xfs_inode_buf.c | 6 ++-- fs/xfs/libxfs/xfs_inode_buf.h | 1 - fs/xfs/xfs_icache.c | 2 ++ fs/xfs/xfs_inode.c | 77 ++++++++++++++++++++----------------------- fs/xfs/xfs_inode.h | 2 -- fs/xfs/xfs_inode_item.c | 2 +- fs/xfs/xfs_iops.c | 3 +- fs/xfs/xfs_itable.c | 2 +- fs/xfs/xfs_log_recover.c | 2 +- 9 files changed, 45 insertions(+), 52 deletions(-) diff --git a/fs/xfs/libxfs/xfs_inode_buf.c b/fs/xfs/libxfs/xfs_inode_buf.c index 8a1b460..0dcaa9a 100644 --- a/fs/xfs/libxfs/xfs_inode_buf.c +++ b/fs/xfs/libxfs/xfs_inode_buf.c @@ -210,12 +210,12 @@ xfs_inode_from_disk( * minimum inode version format we support in the rest of the code. */ if (to->di_version == 1) { - to->di_nlink = be16_to_cpu(from->di_onlink); + set_nlink(inode, be16_to_cpu(from->di_onlink)); to->di_projid_lo = 0; to->di_projid_hi = 0; to->di_version = 2; } else { - to->di_nlink = be32_to_cpu(from->di_nlink); + set_nlink(inode, be32_to_cpu(from->di_nlink)); to->di_projid_lo = be16_to_cpu(from->di_projid_lo); to->di_projid_hi = be16_to_cpu(from->di_projid_hi); } @@ -275,7 +275,6 @@ xfs_inode_to_disk( to->di_format = from->di_format; to->di_uid = cpu_to_be32(from->di_uid); to->di_gid = cpu_to_be32(from->di_gid); - to->di_nlink = cpu_to_be32(from->di_nlink); to->di_projid_lo = cpu_to_be16(from->di_projid_lo); to->di_projid_hi = cpu_to_be16(from->di_projid_hi); @@ -286,6 +285,7 @@ xfs_inode_to_disk( to->di_mtime.t_nsec = cpu_to_be32(inode->i_mtime.tv_nsec); to->di_ctime.t_sec = cpu_to_be32(inode->i_ctime.tv_sec); to->di_ctime.t_nsec = cpu_to_be32(inode->i_ctime.tv_nsec); + to->di_nlink = cpu_to_be32(inode->i_nlink); to->di_size = cpu_to_be64(from->di_size); to->di_nblocks = cpu_to_be64(from->di_nblocks); diff --git a/fs/xfs/libxfs/xfs_inode_buf.h b/fs/xfs/libxfs/xfs_inode_buf.h index 73ba1d8..320b723 100644 --- a/fs/xfs/libxfs/xfs_inode_buf.h +++ b/fs/xfs/libxfs/xfs_inode_buf.h @@ -34,7 +34,6 @@ struct xfs_icdinode { __uint16_t di_flushiter; /* incremented on flush */ __uint32_t di_uid; /* owner's user id */ __uint32_t di_gid; /* owner's group id */ - __uint32_t di_nlink; /* number of links to file */ __uint16_t di_projid_lo; /* lower part of owner's project id */ __uint16_t di_projid_hi; /* higher part of owner's project id */ xfs_fsize_t di_size; /* number of bytes in file */ diff --git a/fs/xfs/xfs_icache.c b/fs/xfs/xfs_icache.c index 9ca28655..4c184f7 100644 --- a/fs/xfs/xfs_icache.c +++ b/fs/xfs/xfs_icache.c @@ -148,9 +148,11 @@ xfs_reinit_inode( struct inode *inode) { int error; + uint32_t nlink = inode->i_nlink; error = inode_init_always(mp->m_super, inode); + set_nlink(inode, nlink); return error; } diff --git a/fs/xfs/xfs_inode.c b/fs/xfs/xfs_inode.c index 7d9c514..ed8e3d2 100644 --- a/fs/xfs/xfs_inode.c +++ b/fs/xfs/xfs_inode.c @@ -57,9 +57,9 @@ kmem_zone_t *xfs_inode_zone; */ #define XFS_ITRUNC_MAX_EXTENTS 2 -STATIC int xfs_iflush_int(xfs_inode_t *, xfs_buf_t *); - -STATIC int xfs_iunlink_remove(xfs_trans_t *, xfs_inode_t *); +STATIC int xfs_iflush_int(struct xfs_inode *, struct xfs_buf *); +STATIC int xfs_iunlink(struct xfs_trans *, struct xfs_inode *, bool); +STATIC int xfs_iunlink_remove(struct xfs_trans *, struct xfs_inode *); /* * helper function to extract extent size hint from inode @@ -803,7 +803,7 @@ xfs_ialloc( ip->i_d.di_version = 2; ip->i_d.di_mode = mode; - ip->i_d.di_nlink = nlink; + set_nlink(inode, nlink); ip->i_d.di_uid = xfs_kuid_to_uid(current_fsuid()); ip->i_d.di_gid = xfs_kgid_to_gid(current_fsgid()); xfs_set_projid(ip, prid); @@ -1086,35 +1086,24 @@ xfs_dir_ialloc( } /* - * Decrement the link count on an inode & log the change. - * If this causes the link count to go to zero, initiate the - * logging activity required to truncate a file. + * Decrement the link count on an inode & log the change. If this causes the + * link count to go to zero, move the inode to AGI unlinked list so that it can + * be freed when the last active reference goes away via xfs_inactive(). */ int /* error */ xfs_droplink( xfs_trans_t *tp, xfs_inode_t *ip) { - int error; - xfs_trans_ichgtime(tp, ip, XFS_ICHGTIME_CHG); - ASSERT (ip->i_d.di_nlink > 0); - ip->i_d.di_nlink--; drop_nlink(VFS_I(ip)); xfs_trans_log_inode(tp, ip, XFS_ILOG_CORE); - error = 0; - if (ip->i_d.di_nlink == 0) { - /* - * We're dropping the last link to this file. - * Move the on-disk inode to the AGI unlinked list. - * From xfs_inactive() we will pull the inode from - * the list and free it. - */ - error = xfs_iunlink(tp, ip); - } - return error; + if (VFS_I(ip)->i_nlink) + return 0; + + return xfs_iunlink(tp, ip, false); } /* @@ -1128,8 +1117,6 @@ xfs_bumplink( xfs_trans_ichgtime(tp, ip, XFS_ICHGTIME_CHG); ASSERT(ip->i_d.di_version > 1); - ASSERT(ip->i_d.di_nlink > 0 || (VFS_I(ip)->i_state & I_LINKABLE)); - ip->i_d.di_nlink++; inc_nlink(VFS_I(ip)); xfs_trans_log_inode(tp, ip, XFS_ILOG_CORE); return 0; @@ -1387,8 +1374,7 @@ xfs_create_tmpfile( */ xfs_qm_vop_create_dqattach(tp, ip, udqp, gdqp, pdqp); - ip->i_d.di_nlink--; - error = xfs_iunlink(tp, ip); + error = xfs_iunlink(tp, ip, true); if (error) goto out_trans_cancel; @@ -1486,7 +1472,10 @@ xfs_link( xfs_bmap_init(&free_list, &first_block); - if (sip->i_d.di_nlink == 0) { + /* + * Handle initial link state of O_TMPFILE inode + */ + if (VFS_I(sip)->i_nlink == 0) { error = xfs_iunlink_remove(tp, sip); if (error) goto error_return; @@ -1673,7 +1662,7 @@ xfs_release( } } - if (ip->i_d.di_nlink == 0) + if (VFS_I(ip)->i_nlink == 0) return 0; if (xfs_can_free_eofblocks(ip, false)) { @@ -1889,7 +1878,7 @@ xfs_inactive( if (mp->m_flags & XFS_MOUNT_RDONLY) return; - if (ip->i_d.di_nlink != 0) { + if (VFS_I(ip)->i_nlink != 0) { /* * force is true because we are evicting an inode from the * cache. Post-eof blocks must be freed, lest we end up with @@ -1946,14 +1935,20 @@ xfs_inactive( } /* - * This is called when the inode's link count goes to 0. - * We place the on-disk inode on a list in the AGI. It - * will be pulled from this list when the inode is freed. + * This is called when the inode's link count goes to 0 or we are creating a + * tmpfile via O_TMPFILE. In the case of a tmpfile, @ignore_linkcount will be + * set to true as the link count is dropped to zero by the VFS after we've + * created the file successfully, so we have to add it to the unlinked list + * while the link count is non-zero. + * + * We place the on-disk inode on a list in the AGI. It will be pulled from this + * list when the inode is freed. */ -int +STATIC int xfs_iunlink( - xfs_trans_t *tp, - xfs_inode_t *ip) + struct xfs_trans *tp, + struct xfs_inode *ip, + bool ignore_linkcount) { xfs_mount_t *mp; xfs_agi_t *agi; @@ -1965,7 +1960,7 @@ xfs_iunlink( int offset; int error; - ASSERT(ip->i_d.di_nlink == 0); + ASSERT(VFS_I(ip)->i_nlink == 0 || ignore_linkcount); ASSERT(ip->i_d.di_mode != 0); mp = tp->t_mountp; @@ -2406,7 +2401,7 @@ xfs_ifree( struct xfs_icluster xic = { 0 }; ASSERT(xfs_isilocked(ip, XFS_ILOCK_EXCL)); - ASSERT(ip->i_d.di_nlink == 0); + ASSERT(VFS_I(ip)->i_nlink == 0); ASSERT(ip->i_d.di_nextents == 0); ASSERT(ip->i_d.di_anextents == 0); ASSERT(ip->i_d.di_size == 0 || !S_ISREG(ip->i_d.di_mode)); @@ -2574,8 +2569,8 @@ xfs_remove( * If we're removing a directory perform some additional validation. */ if (is_dir) { - ASSERT(ip->i_d.di_nlink >= 2); - if (ip->i_d.di_nlink != 2) { + ASSERT(VFS_I(ip)->i_nlink >= 2); + if (VFS_I(ip)->i_nlink != 2) { error = -ENOTEMPTY; goto out_trans_cancel; } @@ -3031,7 +3026,7 @@ xfs_rename( * Make sure target dir is empty. */ if (!(xfs_dir_isempty(target_ip)) || - (target_ip->i_d.di_nlink > 2)) { + (VFS_I(target_ip)->i_nlink > 2)) { error = -EEXIST; goto out_trans_cancel; } @@ -3138,7 +3133,7 @@ xfs_rename( * intermediate state on disk. */ if (wip) { - ASSERT(VFS_I(wip)->i_nlink == 0 && wip->i_d.di_nlink == 0); + ASSERT(VFS_I(wip)->i_nlink == 0); error = xfs_bumplink(tp, wip); if (error) goto out_bmap_cancel; diff --git a/fs/xfs/xfs_inode.h b/fs/xfs/xfs_inode.h index 57c5947..4eaf425 100644 --- a/fs/xfs/xfs_inode.h +++ b/fs/xfs/xfs_inode.h @@ -405,8 +405,6 @@ int xfs_ifree(struct xfs_trans *, xfs_inode_t *, struct xfs_bmap_free *); int xfs_itruncate_extents(struct xfs_trans **, struct xfs_inode *, int, xfs_fsize_t); -int xfs_iunlink(struct xfs_trans *, xfs_inode_t *); - void xfs_iext_realloc(xfs_inode_t *, int, int); void xfs_iunpin_wait(xfs_inode_t *); diff --git a/fs/xfs/xfs_inode_item.c b/fs/xfs/xfs_inode_item.c index 1e5ecbc..193e0bd 100644 --- a/fs/xfs/xfs_inode_item.c +++ b/fs/xfs/xfs_inode_item.c @@ -338,7 +338,6 @@ xfs_inode_to_log_dinode( to->di_format = from->di_format; to->di_uid = from->di_uid; to->di_gid = from->di_gid; - to->di_nlink = from->di_nlink; to->di_projid_lo = from->di_projid_lo; to->di_projid_hi = from->di_projid_hi; @@ -350,6 +349,7 @@ xfs_inode_to_log_dinode( to->di_mtime.t_nsec = inode->i_mtime.tv_nsec; to->di_ctime.t_sec = inode->i_ctime.tv_sec; to->di_ctime.t_nsec = inode->i_ctime.tv_nsec; + to->di_nlink = inode->i_nlink; to->di_size = from->di_size; to->di_nblocks = from->di_nblocks; diff --git a/fs/xfs/xfs_iops.c b/fs/xfs/xfs_iops.c index cd27c6d..8982e56 100644 --- a/fs/xfs/xfs_iops.c +++ b/fs/xfs/xfs_iops.c @@ -460,7 +460,7 @@ xfs_vn_getattr( stat->size = XFS_ISIZE(ip); stat->dev = inode->i_sb->s_dev; stat->mode = ip->i_d.di_mode; - stat->nlink = ip->i_d.di_nlink; + stat->nlink = inode->i_nlink; stat->uid = inode->i_uid; stat->gid = inode->i_gid; stat->ino = ip->i_ino; @@ -1216,7 +1216,6 @@ xfs_setup_inode( hlist_add_fake(&inode->i_hash); inode->i_mode = ip->i_d.di_mode; - set_nlink(inode, ip->i_d.di_nlink); inode->i_uid = xfs_uid_to_kuid(ip->i_d.di_uid); inode->i_gid = xfs_gid_to_kgid(ip->i_d.di_gid); diff --git a/fs/xfs/xfs_itable.c b/fs/xfs/xfs_itable.c index 2acda42..cfb6527 100644 --- a/fs/xfs/xfs_itable.c +++ b/fs/xfs/xfs_itable.c @@ -85,7 +85,6 @@ xfs_bulkstat_one_int( /* xfs_iget returns the following without needing * further change. */ - buf->bs_nlink = dic->di_nlink; buf->bs_projid_lo = dic->di_projid_lo; buf->bs_projid_hi = dic->di_projid_hi; buf->bs_ino = ino; @@ -94,6 +93,7 @@ xfs_bulkstat_one_int( buf->bs_gid = dic->di_gid; buf->bs_size = dic->di_size; + buf->bs_nlink = inode->i_nlink; buf->bs_atime.tv_sec = inode->i_atime.tv_sec; buf->bs_atime.tv_nsec = inode->i_atime.tv_nsec; buf->bs_mtime.tv_sec = inode->i_mtime.tv_sec; diff --git a/fs/xfs/xfs_log_recover.c b/fs/xfs/xfs_log_recover.c index 97bcfc8..678fe6e 100644 --- a/fs/xfs/xfs_log_recover.c +++ b/fs/xfs/xfs_log_recover.c @@ -4342,7 +4342,7 @@ xlog_recover_process_one_iunlink( if (error) goto fail_iput; - ASSERT(ip->i_d.di_nlink == 0); + ASSERT(VFS_I(ip)->i_nlink == 0); ASSERT(ip->i_d.di_mode != 0); /* setup for the next pass */ -- 2.5.0 From dave@fromorbit.com Sun Feb 7 22:24:40 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=ham version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay1.corp.sgi.com [137.38.102.111]) by oss.sgi.com (Postfix) with ESMTP id 3BFF029E09 for ; Sun, 7 Feb 2016 22:24:37 -0600 (CST) Received: from cuda.sgi.com (cuda2.sgi.com [192.48.176.25]) by relay1.corp.sgi.com (Postfix) with ESMTP id 2CF658F8033 for ; Sun, 7 Feb 2016 20:24:34 -0800 (PST) X-ASG-Debug-ID: 1454905468-04cbb04cf913d100002-NocioJ Received: from ipmail06.adl2.internode.on.net (ipmail06.adl2.internode.on.net [150.101.137.129]) by cuda.sgi.com with ESMTP id ODKrOxqNNxovE4jh for ; Sun, 07 Feb 2016 20:24:32 -0800 (PST) X-Barracuda-Envelope-From: dave@fromorbit.com X-Barracuda-Apparent-Source-IP: 150.101.137.129 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: A2DFEQBJF7hWPBATLHleKAECgw+BP4ZjgXidQAEBAQEBAQaRKos5TQEBAQEBAQcBAQEBQT9BEgGDbgEFJy8zCBgxOQMHFBmIGrxdhUqIf36DbgWHUIcGiB+cQ44+ghgBC4I2KC6HABqBOQEBAQ Received: from ppp121-44-19-16.lns20.syd4.internode.on.net (HELO dastard) ([121.44.19.16]) by ipmail06.adl2.internode.on.net with ESMTP; 08 Feb 2016 14:54:25 +1030 Received: from disappointment.disaster.area ([192.168.1.110] helo=disappointment) by dastard with esmtp (Exim 4.80) (envelope-from ) id 1aSdN9-00072M-Ot for xfs@oss.sgi.com; Mon, 08 Feb 2016 15:24:23 +1100 Received: from dave by disappointment with local (Exim 4.86) (envelope-from ) id 1aSdN9-0000m7-O2 for xfs@oss.sgi.com; Mon, 08 Feb 2016 15:24:23 +1100 From: Dave Chinner To: xfs@oss.sgi.com Subject: [PATCH 5/9] xfs: reinitialise recycled VFS inode correctly Date: Mon, 8 Feb 2016 15:24:17 +1100 X-ASG-Orig-Subj: [PATCH 5/9] xfs: reinitialise recycled VFS inode correctly Message-Id: <1454905461-2773-6-git-send-email-david@fromorbit.com> X-Mailer: git-send-email 2.5.0 In-Reply-To: <1454905461-2773-1-git-send-email-david@fromorbit.com> References: <1454905461-2773-1-git-send-email-david@fromorbit.com> X-Barracuda-Connect: ipmail06.adl2.internode.on.net[150.101.137.129] X-Barracuda-Start-Time: 1454905471 X-Barracuda-URL: https://192.48.176.25:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-BRTS-Status: 1 X-Barracuda-Spam-Score: 0.00 X-Barracuda-Spam-Status: No, SCORE=0.00 using per-user scores of TAG_LEVEL=1000.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.7 tests= X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.3.26847 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- From: Dave Chinner Now that we keep certain on-disk information in the VFS inode rather than in a separate XFS specific stucture, we have to be careful of the VFS code clearing that information when we re-initialise reclaimable cached inodes during lookup. If we don't do this, then we lose critical information from the inode and that results in corruption being detected. Signed-off-by: Dave Chinner --- fs/xfs/xfs_icache.c | 22 +++++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) diff --git a/fs/xfs/xfs_icache.c b/fs/xfs/xfs_icache.c index 7c26f86..9ca28655 100644 --- a/fs/xfs/xfs_icache.c +++ b/fs/xfs/xfs_icache.c @@ -135,6 +135,26 @@ xfs_inode_free( } /* + * When we recycle a reclaimable inode, we need to re-initialise the VFS inode + * part of the structure. This is made more complex by the fact we store + * information about the on-disk values in the VFS inode and so we can't just + * overwrite it's values unconditionally. Hence we save the parameters we + * need to retain across reinitialisation, and rewrite them into the VFS inode + * after resetting it's state even if resetting fails. + */ +static int +xfs_reinit_inode( + struct xfs_mount *mp, + struct inode *inode) +{ + int error; + + error = inode_init_always(mp->m_super, inode); + + return error; +} + +/* * Check the validity of the inode we just found it the cache */ static int @@ -208,7 +228,7 @@ xfs_iget_cache_hit( spin_unlock(&ip->i_flags_lock); rcu_read_unlock(); - error = inode_init_always(mp->m_super, inode); + error = xfs_reinit_inode(mp, inode); if (error) { /* * Re-initializing the inode failed, and we are in deep -- 2.5.0 From dave@fromorbit.com Sun Feb 7 22:24:44 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=ham version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay2.corp.sgi.com [137.38.102.29]) by oss.sgi.com (Postfix) with ESMTP id 71CC27CA2 for ; Sun, 7 Feb 2016 22:24:44 -0600 (CST) Received: from cuda.sgi.com (cuda3.sgi.com [192.48.176.15]) by relay2.corp.sgi.com (Postfix) with ESMTP id 53719304039 for ; Sun, 7 Feb 2016 20:24:44 -0800 (PST) X-ASG-Debug-ID: 1454905466-04cb6c2746155150004-NocioJ Received: from ipmail06.adl2.internode.on.net (ipmail06.adl2.internode.on.net [150.101.137.129]) by cuda.sgi.com with ESMTP id rYLJrU7yzz5mQG7d for ; Sun, 07 Feb 2016 20:24:33 -0800 (PST) X-Barracuda-Envelope-From: dave@fromorbit.com X-Barracuda-Apparent-Source-IP: 150.101.137.129 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: A2DNEQBJF7hWPBATLHleKAECgw+BP4ZjgXidQAEBAQEBAQaBaI9CihSBJU0BAQEBAQEHAQEBAUE/QRIBg24BBRoNLzMIGDE5AwcUEAmIGrxdhUqJFkGEFAWHU48ijyuHaYUvRI16ghgBCwE9AxmBXCguhwAbgTgBAQE Received: from ppp121-44-19-16.lns20.syd4.internode.on.net (HELO dastard) ([121.44.19.16]) by ipmail06.adl2.internode.on.net with ESMTP; 08 Feb 2016 14:54:25 +1030 Received: from disappointment.disaster.area ([192.168.1.110] helo=disappointment) by dastard with esmtp (Exim 4.80) (envelope-from ) id 1aSdN9-00072Q-Qh for xfs@oss.sgi.com; Mon, 08 Feb 2016 15:24:23 +1100 Received: from dave by disappointment with local (Exim 4.86) (envelope-from ) id 1aSdN9-0000mR-Pm for xfs@oss.sgi.com; Mon, 08 Feb 2016 15:24:23 +1100 From: Dave Chinner To: xfs@oss.sgi.com Subject: [PATCH 9/9] xfs: mode di_mode to vfs inode Date: Mon, 8 Feb 2016 15:24:21 +1100 X-ASG-Orig-Subj: [PATCH 9/9] xfs: mode di_mode to vfs inode Message-Id: <1454905461-2773-10-git-send-email-david@fromorbit.com> X-Mailer: git-send-email 2.5.0 In-Reply-To: <1454905461-2773-1-git-send-email-david@fromorbit.com> References: <1454905461-2773-1-git-send-email-david@fromorbit.com> X-Barracuda-Connect: ipmail06.adl2.internode.on.net[150.101.137.129] X-Barracuda-Start-Time: 1454905473 X-Barracuda-URL: https://192.48.176.15:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-BRTS-Status: 1 X-Barracuda-Spam-Score: 0.00 X-Barracuda-Spam-Status: No, SCORE=0.00 using per-user scores of TAG_LEVEL=1000.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.7 tests= X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.3.26847 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- From: Dave Chinner Move the di_mode value from the xfs_icdinode to the VFS inode, reducing the xfs_icdinode byte another 2 bytes and collapsing another 2 byte hole in the structure. Signed-off-by: Dave Chinner --- fs/xfs/libxfs/xfs_bmap.c | 6 +++--- fs/xfs/libxfs/xfs_dir2.c | 12 +++++------ fs/xfs/libxfs/xfs_inode_buf.c | 8 +++---- fs/xfs/libxfs/xfs_inode_buf.h | 1 - fs/xfs/libxfs/xfs_inode_fork.c | 2 +- fs/xfs/xfs_bmap_util.c | 4 ++-- fs/xfs/xfs_dir2_readdir.c | 2 +- fs/xfs/xfs_file.c | 6 +++--- fs/xfs/xfs_filestream.c | 4 ++-- fs/xfs/xfs_icache.c | 13 ++++++++---- fs/xfs/xfs_inode.c | 48 ++++++++++++++++++++---------------------- fs/xfs/xfs_inode.h | 4 ++-- fs/xfs/xfs_inode_item.c | 2 +- fs/xfs/xfs_ioctl.c | 14 ++++++------ fs/xfs/xfs_iops.c | 12 ++++------- fs/xfs/xfs_itable.c | 2 +- fs/xfs/xfs_log_recover.c | 2 +- fs/xfs/xfs_mount.c | 2 +- 18 files changed, 71 insertions(+), 73 deletions(-) diff --git a/fs/xfs/libxfs/xfs_bmap.c b/fs/xfs/libxfs/xfs_bmap.c index ef00156..6a05166 100644 --- a/fs/xfs/libxfs/xfs_bmap.c +++ b/fs/xfs/libxfs/xfs_bmap.c @@ -912,7 +912,7 @@ xfs_bmap_local_to_extents( * We don't want to deal with the case of keeping inode data inline yet. * So sending the data fork of a regular inode is invalid. */ - ASSERT(!(S_ISREG(ip->i_d.di_mode) && whichfork == XFS_DATA_FORK)); + ASSERT(!(S_ISREG(VFS_I(ip)->i_mode) && whichfork == XFS_DATA_FORK)); ifp = XFS_IFORK_PTR(ip, whichfork); ASSERT(XFS_IFORK_FORMAT(ip, whichfork) == XFS_DINODE_FMT_LOCAL); @@ -1079,7 +1079,7 @@ xfs_bmap_add_attrfork_local( if (ip->i_df.if_bytes <= XFS_IFORK_DSIZE(ip)) return 0; - if (S_ISDIR(ip->i_d.di_mode)) { + if (S_ISDIR(VFS_I(ip)->i_mode)) { memset(&dargs, 0, sizeof(dargs)); dargs.geo = ip->i_mount->m_dir_geo; dargs.dp = ip; @@ -1091,7 +1091,7 @@ xfs_bmap_add_attrfork_local( return xfs_dir2_sf_to_block(&dargs); } - if (S_ISLNK(ip->i_d.di_mode)) + if (S_ISLNK(VFS_I(ip)->i_mode)) return xfs_bmap_local_to_extents(tp, ip, firstblock, 1, flags, XFS_DATA_FORK, xfs_symlink_local_to_remote); diff --git a/fs/xfs/libxfs/xfs_dir2.c b/fs/xfs/libxfs/xfs_dir2.c index 2fb53a5..af0f9d1 100644 --- a/fs/xfs/libxfs/xfs_dir2.c +++ b/fs/xfs/libxfs/xfs_dir2.c @@ -176,7 +176,7 @@ xfs_dir_isempty( { xfs_dir2_sf_hdr_t *sfp; - ASSERT(S_ISDIR(dp->i_d.di_mode)); + ASSERT(S_ISDIR(VFS_I(dp)->i_mode)); if (dp->i_d.di_size == 0) /* might happen during shutdown. */ return 1; if (dp->i_d.di_size > XFS_IFORK_DSIZE(dp)) @@ -231,7 +231,7 @@ xfs_dir_init( struct xfs_da_args *args; int error; - ASSERT(S_ISDIR(dp->i_d.di_mode)); + ASSERT(S_ISDIR(VFS_I(dp)->i_mode)); error = xfs_dir_ino_validate(tp->t_mountp, pdp->i_ino); if (error) return error; @@ -266,7 +266,7 @@ xfs_dir_createname( int rval; int v; /* type-checking value */ - ASSERT(S_ISDIR(dp->i_d.di_mode)); + ASSERT(S_ISDIR(VFS_I(dp)->i_mode)); if (inum) { rval = xfs_dir_ino_validate(tp->t_mountp, inum); if (rval) @@ -364,7 +364,7 @@ xfs_dir_lookup( int v; /* type-checking value */ int lock_mode; - ASSERT(S_ISDIR(dp->i_d.di_mode)); + ASSERT(S_ISDIR(VFS_I(dp)->i_mode)); XFS_STATS_INC(dp->i_mount, xs_dir_lookup); /* @@ -443,7 +443,7 @@ xfs_dir_removename( int rval; int v; /* type-checking value */ - ASSERT(S_ISDIR(dp->i_d.di_mode)); + ASSERT(S_ISDIR(VFS_I(dp)->i_mode)); XFS_STATS_INC(dp->i_mount, xs_dir_remove); args = kmem_zalloc(sizeof(*args), KM_SLEEP | KM_NOFS); @@ -505,7 +505,7 @@ xfs_dir_replace( int rval; int v; /* type-checking value */ - ASSERT(S_ISDIR(dp->i_d.di_mode)); + ASSERT(S_ISDIR(VFS_I(dp)->i_mode)); rval = xfs_dir_ino_validate(tp->t_mountp, inum); if (rval) diff --git a/fs/xfs/libxfs/xfs_inode_buf.c b/fs/xfs/libxfs/xfs_inode_buf.c index 9807c21..4a388b0 100644 --- a/fs/xfs/libxfs/xfs_inode_buf.c +++ b/fs/xfs/libxfs/xfs_inode_buf.c @@ -202,13 +202,12 @@ xfs_inode_from_disk( struct xfs_icdinode *to = &ip->i_d; struct inode *inode = VFS_I(ip); - to->di_mode = be16_to_cpu(from->di_mode); - to->di_version = from ->di_version; /* * Convert v1 inodes immediately to v2 inode format as this is the * minimum inode version format we support in the rest of the code. */ + to->di_version = from->di_version; if (to->di_version == 1) { set_nlink(inode, be16_to_cpu(from->di_onlink)); to->di_projid_lo = 0; @@ -238,6 +237,7 @@ xfs_inode_from_disk( inode->i_ctime.tv_sec = (int)be32_to_cpu(from->di_ctime.t_sec); inode->i_ctime.tv_nsec = (int)be32_to_cpu(from->di_ctime.t_nsec); inode->i_generation = be32_to_cpu(from->di_gen); + inode->i_mode = be16_to_cpu(from->di_mode); to->di_size = be64_to_cpu(from->di_size); to->di_nblocks = be64_to_cpu(from->di_nblocks); @@ -270,7 +270,6 @@ xfs_inode_to_disk( to->di_magic = cpu_to_be16(XFS_DINODE_MAGIC); to->di_onlink = 0; - to->di_mode = cpu_to_be16(from->di_mode); to->di_version = from->di_version; to->di_format = from->di_format; to->di_uid = cpu_to_be32(from->di_uid); @@ -287,6 +286,7 @@ xfs_inode_to_disk( to->di_ctime.t_nsec = cpu_to_be32(inode->i_ctime.tv_nsec); to->di_nlink = cpu_to_be32(inode->i_nlink); to->di_gen = cpu_to_be32(inode->i_generation); + to->di_mode = cpu_to_be16(inode->i_mode); to->di_size = cpu_to_be64(from->di_size); to->di_nblocks = cpu_to_be64(from->di_nblocks); @@ -501,7 +501,7 @@ xfs_iread( * the inode is already free and not try to mess * with the uninitialized part of it. */ - ip->i_d.di_mode = 0; + VFS_I(ip)->i_mode = 0; } ASSERT(ip->i_d.di_version >= 2); diff --git a/fs/xfs/libxfs/xfs_inode_buf.h b/fs/xfs/libxfs/xfs_inode_buf.h index c51bd12..7c4dd32 100644 --- a/fs/xfs/libxfs/xfs_inode_buf.h +++ b/fs/xfs/libxfs/xfs_inode_buf.h @@ -28,7 +28,6 @@ struct xfs_dinode; * format specific structures at the appropriate time. */ struct xfs_icdinode { - __uint16_t di_mode; /* mode and type of file */ __int8_t di_version; /* inode version */ __int8_t di_format; /* format of di_c data */ __uint16_t di_flushiter; /* incremented on flush */ diff --git a/fs/xfs/libxfs/xfs_inode_fork.c b/fs/xfs/libxfs/xfs_inode_fork.c index ef22a78..11faf7d 100644 --- a/fs/xfs/libxfs/xfs_inode_fork.c +++ b/fs/xfs/libxfs/xfs_inode_fork.c @@ -121,7 +121,7 @@ xfs_iformat_fork( return -EFSCORRUPTED; } - switch (ip->i_d.di_mode & S_IFMT) { + switch (VFS_I(ip)->i_mode & S_IFMT) { case S_IFIFO: case S_IFCHR: case S_IFBLK: diff --git a/fs/xfs/xfs_bmap_util.c b/fs/xfs/xfs_bmap_util.c index 07ef29b..fd7f51c 100644 --- a/fs/xfs/xfs_bmap_util.c +++ b/fs/xfs/xfs_bmap_util.c @@ -823,7 +823,7 @@ bool xfs_can_free_eofblocks(struct xfs_inode *ip, bool force) { /* prealloc/delalloc exists only on regular files */ - if (!S_ISREG(ip->i_d.di_mode)) + if (!S_ISREG(VFS_I(ip)->i_mode)) return false; /* @@ -1728,7 +1728,7 @@ xfs_swap_extents( xfs_lock_two_inodes(ip, tip, XFS_MMAPLOCK_EXCL); /* Verify that both files have the same format */ - if ((ip->i_d.di_mode & S_IFMT) != (tip->i_d.di_mode & S_IFMT)) { + if ((VFS_I(ip)->i_mode & S_IFMT) != (VFS_I(tip)->i_mode & S_IFMT)) { error = -EINVAL; goto out_unlock; } diff --git a/fs/xfs/xfs_dir2_readdir.c b/fs/xfs/xfs_dir2_readdir.c index 642d55d..93b3ab0 100644 --- a/fs/xfs/xfs_dir2_readdir.c +++ b/fs/xfs/xfs_dir2_readdir.c @@ -665,7 +665,7 @@ xfs_readdir( if (XFS_FORCED_SHUTDOWN(dp->i_mount)) return -EIO; - ASSERT(S_ISDIR(dp->i_d.di_mode)); + ASSERT(S_ISDIR(VFS_I(dp)->i_mode)); XFS_STATS_INC(dp->i_mount, xs_dir_getdents); args.dp = dp; diff --git a/fs/xfs/xfs_file.c b/fs/xfs/xfs_file.c index 70a4b5a..ac0fd32 100644 --- a/fs/xfs/xfs_file.c +++ b/fs/xfs/xfs_file.c @@ -156,9 +156,9 @@ xfs_update_prealloc_flags( xfs_trans_ijoin(tp, ip, XFS_ILOCK_EXCL); if (!(flags & XFS_PREALLOC_INVISIBLE)) { - ip->i_d.di_mode &= ~S_ISUID; - if (ip->i_d.di_mode & S_IXGRP) - ip->i_d.di_mode &= ~S_ISGID; + VFS_I(ip)->i_mode &= ~S_ISUID; + if (VFS_I(ip)->i_mode & S_IXGRP) + VFS_I(ip)->i_mode &= ~S_ISGID; xfs_trans_ichgtime(tp, ip, XFS_ICHGTIME_MOD | XFS_ICHGTIME_CHG); } diff --git a/fs/xfs/xfs_filestream.c b/fs/xfs/xfs_filestream.c index c4c130f..a51353a 100644 --- a/fs/xfs/xfs_filestream.c +++ b/fs/xfs/xfs_filestream.c @@ -151,7 +151,7 @@ xfs_filestream_pick_ag( xfs_agnumber_t ag, max_ag = NULLAGNUMBER; int err, trylock, nscan; - ASSERT(S_ISDIR(ip->i_d.di_mode)); + ASSERT(S_ISDIR(VFS_I(ip)->i_mode)); /* 2% of an AG's blocks must be free for it to be chosen. */ minfree = mp->m_sb.sb_agblocks / 50; @@ -319,7 +319,7 @@ xfs_filestream_lookup_ag( xfs_agnumber_t startag, ag = NULLAGNUMBER; struct xfs_mru_cache_elem *mru; - ASSERT(S_ISREG(ip->i_d.di_mode)); + ASSERT(S_ISREG(VFS_I(ip)->i_mode)); pip = xfs_filestream_get_parent(ip); if (!pip) diff --git a/fs/xfs/xfs_icache.c b/fs/xfs/xfs_icache.c index 30eafad..bf2d607 100644 --- a/fs/xfs/xfs_icache.c +++ b/fs/xfs/xfs_icache.c @@ -63,6 +63,9 @@ xfs_inode_alloc( return NULL; } + /* VFS doesn't initialise i_mode! */ + VFS_I(ip)->i_mode = 0; + XFS_STATS_INC(mp, vn_active); ASSERT(atomic_read(&ip->i_pincount) == 0); ASSERT(!spin_is_locked(&ip->i_flags_lock)); @@ -98,7 +101,7 @@ void xfs_inode_free( struct xfs_inode *ip) { - switch (ip->i_d.di_mode & S_IFMT) { + switch (VFS_I(ip)->i_mode & S_IFMT) { case S_IFREG: case S_IFDIR: case S_IFLNK: @@ -151,12 +154,14 @@ xfs_reinit_inode( uint32_t nlink = inode->i_nlink; uint32_t generation = inode->i_generation; uint64_t version = inode->i_version; + umode_t mode = inode->i_mode; error = inode_init_always(mp->m_super, inode); set_nlink(inode, nlink); inode->i_generation = generation; inode->i_version = version; + inode->i_mode = mode; return error; } @@ -211,7 +216,7 @@ xfs_iget_cache_hit( /* * If lookup is racing with unlink return an error immediately. */ - if (ip->i_d.di_mode == 0 && !(flags & XFS_IGET_CREATE)) { + if (VFS_I(ip)->i_mode == 0 && !(flags & XFS_IGET_CREATE)) { error = -ENOENT; goto out_error; } @@ -321,7 +326,7 @@ xfs_iget_cache_miss( trace_xfs_iget_miss(ip); - if ((ip->i_d.di_mode == 0) && !(flags & XFS_IGET_CREATE)) { + if ((VFS_I(ip)->i_mode == 0) && !(flags & XFS_IGET_CREATE)) { error = -ENOENT; goto out_destroy; } @@ -470,7 +475,7 @@ again: * If we have a real type for an on-disk inode, we can setup the inode * now. If it's a new inode being created, xfs_ialloc will handle it. */ - if (xfs_iflags_test(ip, XFS_INEW) && ip->i_d.di_mode != 0) + if (xfs_iflags_test(ip, XFS_INEW) && VFS_I(ip)->i_mode != 0) xfs_setup_existing_inode(ip); return 0; diff --git a/fs/xfs/xfs_inode.c b/fs/xfs/xfs_inode.c index 16fabbf..205796f 100644 --- a/fs/xfs/xfs_inode.c +++ b/fs/xfs/xfs_inode.c @@ -802,7 +802,7 @@ xfs_ialloc( if (ip->i_d.di_version == 1) ip->i_d.di_version = 2; - ip->i_d.di_mode = mode; + inode->i_mode = mode; set_nlink(inode, nlink); ip->i_d.di_uid = xfs_kuid_to_uid(current_fsuid()); ip->i_d.di_gid = xfs_kgid_to_gid(current_fsgid()); @@ -810,9 +810,8 @@ xfs_ialloc( if (pip && XFS_INHERIT_GID(pip)) { ip->i_d.di_gid = pip->i_d.di_gid; - if ((pip->i_d.di_mode & S_ISGID) && S_ISDIR(mode)) { - ip->i_d.di_mode |= S_ISGID; - } + if ((VFS_I(pip)->i_mode & S_ISGID) && S_ISDIR(mode)) + inode->i_mode |= S_ISGID; } /* @@ -821,10 +820,9 @@ xfs_ialloc( * (and only if the irix_sgid_inherit compatibility variable is set). */ if ((irix_sgid_inherit) && - (ip->i_d.di_mode & S_ISGID) && - (!in_group_p(xfs_gid_to_kgid(ip->i_d.di_gid)))) { - ip->i_d.di_mode &= ~S_ISGID; - } + (inode->i_mode & S_ISGID) && + (!in_group_p(xfs_gid_to_kgid(ip->i_d.di_gid)))) + inode->i_mode &= ~S_ISGID; ip->i_d.di_size = 0; ip->i_d.di_nextents = 0; @@ -1421,7 +1419,7 @@ xfs_link( trace_xfs_link(tdp, target_name); - ASSERT(!S_ISDIR(sip->i_d.di_mode)); + ASSERT(!S_ISDIR(VFS_I(sip)->i_mode)); if (XFS_FORCED_SHUTDOWN(mp)) return -EIO; @@ -1628,7 +1626,7 @@ xfs_release( xfs_mount_t *mp = ip->i_mount; int error; - if (!S_ISREG(ip->i_d.di_mode) || (ip->i_d.di_mode == 0)) + if (!S_ISREG(VFS_I(ip)->i_mode) || (VFS_I(ip)->i_mode == 0)) return 0; /* If this is a read-only mount, don't do this (would generate I/O) */ @@ -1863,7 +1861,7 @@ xfs_inactive( * If the inode is already free, then there can be nothing * to clean up here. */ - if (ip->i_d.di_mode == 0) { + if (VFS_I(ip)->i_mode == 0) { ASSERT(ip->i_df.if_real_bytes == 0); ASSERT(ip->i_df.if_broot_bytes == 0); return; @@ -1887,7 +1885,7 @@ xfs_inactive( return; } - if (S_ISREG(ip->i_d.di_mode) && + if (S_ISREG(VFS_I(ip)->i_mode) && (ip->i_d.di_size != 0 || XFS_ISIZE(ip) != 0 || ip->i_d.di_nextents > 0 || ip->i_delayed_blks > 0)) truncate = 1; @@ -1896,7 +1894,7 @@ xfs_inactive( if (error) return; - if (S_ISLNK(ip->i_d.di_mode)) + if (S_ISLNK(VFS_I(ip)->i_mode)) error = xfs_inactive_symlink(ip); else if (truncate) error = xfs_inactive_truncate(ip); @@ -1958,7 +1956,7 @@ xfs_iunlink( int error; ASSERT(VFS_I(ip)->i_nlink == 0 || ignore_linkcount); - ASSERT(ip->i_d.di_mode != 0); + ASSERT(VFS_I(ip)->i_mode != 0); mp = tp->t_mountp; @@ -2401,7 +2399,7 @@ xfs_ifree( ASSERT(VFS_I(ip)->i_nlink == 0); ASSERT(ip->i_d.di_nextents == 0); ASSERT(ip->i_d.di_anextents == 0); - ASSERT(ip->i_d.di_size == 0 || !S_ISREG(ip->i_d.di_mode)); + ASSERT(ip->i_d.di_size == 0 || !S_ISREG(VFS_I(ip)->i_mode)); ASSERT(ip->i_d.di_nblocks == 0); /* @@ -2415,7 +2413,7 @@ xfs_ifree( if (error) return error; - ip->i_d.di_mode = 0; /* mark incore inode as free */ + VFS_I(ip)->i_mode = 0; /* mark incore inode as free */ ip->i_d.di_flags = 0; ip->i_d.di_dmevmask = 0; ip->i_d.di_forkoff = 0; /* mark the attr fork not in use */ @@ -2512,7 +2510,7 @@ xfs_remove( { xfs_mount_t *mp = dp->i_mount; xfs_trans_t *tp = NULL; - int is_dir = S_ISDIR(ip->i_d.di_mode); + int is_dir = S_ISDIR(VFS_I(ip)->i_mode); int error = 0; xfs_bmap_free_t free_list; xfs_fsblock_t first_block; @@ -2757,7 +2755,7 @@ xfs_cross_rename( if (dp1 != dp2) { dp2_flags = XFS_ICHGTIME_MOD | XFS_ICHGTIME_CHG; - if (S_ISDIR(ip2->i_d.di_mode)) { + if (S_ISDIR(VFS_I(ip2)->i_mode)) { error = xfs_dir_replace(tp, ip2, &xfs_name_dotdot, dp1->i_ino, first_block, free_list, spaceres); @@ -2765,7 +2763,7 @@ xfs_cross_rename( goto out_trans_abort; /* transfer ip2 ".." reference to dp1 */ - if (!S_ISDIR(ip1->i_d.di_mode)) { + if (!S_ISDIR(VFS_I(ip1)->i_mode)) { error = xfs_droplink(tp, dp2); if (error) goto out_trans_abort; @@ -2784,7 +2782,7 @@ xfs_cross_rename( ip2_flags |= XFS_ICHGTIME_MOD | XFS_ICHGTIME_CHG; } - if (S_ISDIR(ip1->i_d.di_mode)) { + if (S_ISDIR(VFS_I(ip1)->i_mode)) { error = xfs_dir_replace(tp, ip1, &xfs_name_dotdot, dp2->i_ino, first_block, free_list, spaceres); @@ -2792,7 +2790,7 @@ xfs_cross_rename( goto out_trans_abort; /* transfer ip1 ".." reference to dp2 */ - if (!S_ISDIR(ip2->i_d.di_mode)) { + if (!S_ISDIR(VFS_I(ip2)->i_mode)) { error = xfs_droplink(tp, dp1); if (error) goto out_trans_abort; @@ -2889,7 +2887,7 @@ xfs_rename( struct xfs_inode *inodes[__XFS_SORT_INODES]; int num_inodes = __XFS_SORT_INODES; bool new_parent = (src_dp != target_dp); - bool src_is_directory = S_ISDIR(src_ip->i_d.di_mode); + bool src_is_directory = S_ISDIR(VFS_I(src_ip)->i_mode); int spaceres; int error; @@ -3018,7 +3016,7 @@ xfs_rename( * target and source are directories and that target can be * destroyed, or that neither is a directory. */ - if (S_ISDIR(target_ip->i_d.di_mode)) { + if (S_ISDIR(VFS_I(target_ip)->i_mode)) { /* * Make sure target dir is empty. */ @@ -3448,7 +3446,7 @@ xfs_iflush_int( __func__, ip->i_ino, be16_to_cpu(dip->di_magic), dip); goto corrupt_out; } - if (S_ISREG(ip->i_d.di_mode)) { + if (S_ISREG(VFS_I(ip)->i_mode)) { if (XFS_TEST_ERROR( (ip->i_d.di_format != XFS_DINODE_FMT_EXTENTS) && (ip->i_d.di_format != XFS_DINODE_FMT_BTREE), @@ -3458,7 +3456,7 @@ xfs_iflush_int( __func__, ip->i_ino, ip); goto corrupt_out; } - } else if (S_ISDIR(ip->i_d.di_mode)) { + } else if (S_ISDIR(VFS_I(ip)->i_mode)) { if (XFS_TEST_ERROR( (ip->i_d.di_format != XFS_DINODE_FMT_EXTENTS) && (ip->i_d.di_format != XFS_DINODE_FMT_BTREE) && diff --git a/fs/xfs/xfs_inode.h b/fs/xfs/xfs_inode.h index 4eaf425..43e1d51 100644 --- a/fs/xfs/xfs_inode.h +++ b/fs/xfs/xfs_inode.h @@ -88,7 +88,7 @@ static inline struct inode *VFS_I(struct xfs_inode *ip) */ static inline xfs_fsize_t XFS_ISIZE(struct xfs_inode *ip) { - if (S_ISREG(ip->i_d.di_mode)) + if (S_ISREG(VFS_I(ip)->i_mode)) return i_size_read(VFS_I(ip)); return ip->i_d.di_size; } @@ -369,7 +369,7 @@ static inline int xfs_isiflocked(struct xfs_inode *ip) */ #define XFS_INHERIT_GID(pip) \ (((pip)->i_mount->m_flags & XFS_MOUNT_GRPID) || \ - ((pip)->i_d.di_mode & S_ISGID)) + (VFS_I(pip)->i_mode & S_ISGID)) int xfs_release(struct xfs_inode *ip); void xfs_inactive(struct xfs_inode *ip); diff --git a/fs/xfs/xfs_inode_item.c b/fs/xfs/xfs_inode_item.c index 3415c63..c48b5b1 100644 --- a/fs/xfs/xfs_inode_item.c +++ b/fs/xfs/xfs_inode_item.c @@ -333,7 +333,6 @@ xfs_inode_to_log_dinode( to->di_magic = XFS_DINODE_MAGIC; - to->di_mode = from->di_mode; to->di_version = from->di_version; to->di_format = from->di_format; to->di_uid = from->di_uid; @@ -351,6 +350,7 @@ xfs_inode_to_log_dinode( to->di_ctime.t_nsec = inode->i_ctime.tv_nsec; to->di_nlink = inode->i_nlink; to->di_gen = inode->i_generation; + to->di_mode = inode->i_mode; to->di_size = from->di_size; to->di_nblocks = from->di_nblocks; diff --git a/fs/xfs/xfs_ioctl.c b/fs/xfs/xfs_ioctl.c index cdd6c31..81d6d62 100644 --- a/fs/xfs/xfs_ioctl.c +++ b/fs/xfs/xfs_ioctl.c @@ -963,7 +963,7 @@ xfs_set_diflags( di_flags |= XFS_DIFLAG_NODEFRAG; if (xflags & FS_XFLAG_FILESTREAM) di_flags |= XFS_DIFLAG_FILESTREAM; - if (S_ISDIR(ip->i_d.di_mode)) { + if (S_ISDIR(VFS_I(ip)->i_mode)) { if (xflags & FS_XFLAG_RTINHERIT) di_flags |= XFS_DIFLAG_RTINHERIT; if (xflags & FS_XFLAG_NOSYMLINKS) @@ -972,7 +972,7 @@ xfs_set_diflags( di_flags |= XFS_DIFLAG_EXTSZINHERIT; if (xflags & FS_XFLAG_PROJINHERIT) di_flags |= XFS_DIFLAG_PROJINHERIT; - } else if (S_ISREG(ip->i_d.di_mode)) { + } else if (S_ISREG(VFS_I(ip)->i_mode)) { if (xflags & FS_XFLAG_REALTIME) di_flags |= XFS_DIFLAG_REALTIME; if (xflags & FS_XFLAG_EXTSIZE) @@ -1128,14 +1128,14 @@ xfs_ioctl_setattr_check_extsize( { struct xfs_mount *mp = ip->i_mount; - if ((fa->fsx_xflags & FS_XFLAG_EXTSIZE) && !S_ISREG(ip->i_d.di_mode)) + if ((fa->fsx_xflags & FS_XFLAG_EXTSIZE) && !S_ISREG(VFS_I(ip)->i_mode)) return -EINVAL; if ((fa->fsx_xflags & FS_XFLAG_EXTSZINHERIT) && - !S_ISDIR(ip->i_d.di_mode)) + !S_ISDIR(VFS_I(ip)->i_mode)) return -EINVAL; - if (S_ISREG(ip->i_d.di_mode) && ip->i_d.di_nextents && + if (S_ISREG(VFS_I(ip)->i_mode) && ip->i_d.di_nextents && ((ip->i_d.di_extsize << mp->m_sb.sb_blocklog) != fa->fsx_extsize)) return -EINVAL; @@ -1256,9 +1256,9 @@ xfs_ioctl_setattr( * successful return from chown() */ - if ((ip->i_d.di_mode & (S_ISUID|S_ISGID)) && + if ((VFS_I(ip)->i_mode & (S_ISUID|S_ISGID)) && !capable_wrt_inode_uidgid(VFS_I(ip), CAP_FSETID)) - ip->i_d.di_mode &= ~(S_ISUID|S_ISGID); + VFS_I(ip)->i_mode &= ~(S_ISUID|S_ISGID); /* Change the ownerships and register project quota modifications */ if (xfs_get_projid(ip) != fa->fsx_projid) { diff --git a/fs/xfs/xfs_iops.c b/fs/xfs/xfs_iops.c index a4daa3f..0d38b1d 100644 --- a/fs/xfs/xfs_iops.c +++ b/fs/xfs/xfs_iops.c @@ -459,7 +459,7 @@ xfs_vn_getattr( stat->size = XFS_ISIZE(ip); stat->dev = inode->i_sb->s_dev; - stat->mode = ip->i_d.di_mode; + stat->mode = inode->i_mode; stat->nlink = inode->i_nlink; stat->uid = inode->i_uid; stat->gid = inode->i_gid; @@ -506,9 +506,6 @@ xfs_setattr_mode( ASSERT(xfs_isilocked(ip, XFS_ILOCK_EXCL)); - ip->i_d.di_mode &= S_IFMT; - ip->i_d.di_mode |= mode & ~S_IFMT; - inode->i_mode &= S_IFMT; inode->i_mode |= mode & ~S_IFMT; } @@ -652,9 +649,9 @@ xfs_setattr_nonsize( * The set-user-ID and set-group-ID bits of a file will be * cleared upon successful return from chown() */ - if ((ip->i_d.di_mode & (S_ISUID|S_ISGID)) && + if ((inode->i_mode & (S_ISUID|S_ISGID)) && !capable(CAP_FSETID)) - ip->i_d.di_mode &= ~(S_ISUID|S_ISGID); + inode->i_mode &= ~(S_ISUID|S_ISGID); /* * Change the ownerships and register quota modifications @@ -764,7 +761,7 @@ xfs_setattr_size( ASSERT(xfs_isilocked(ip, XFS_IOLOCK_EXCL)); ASSERT(xfs_isilocked(ip, XFS_MMAPLOCK_EXCL)); - ASSERT(S_ISREG(ip->i_d.di_mode)); + ASSERT(S_ISREG(inode->i_mode)); ASSERT((iattr->ia_valid & (ATTR_UID|ATTR_GID|ATTR_ATIME|ATTR_ATIME_SET| ATTR_MTIME_SET|ATTR_KILL_PRIV|ATTR_TIMES_SET)) == 0); @@ -1215,7 +1212,6 @@ xfs_setup_inode( /* make the inode look hashed for the writeback code */ hlist_add_fake(&inode->i_hash); - inode->i_mode = ip->i_d.di_mode; inode->i_uid = xfs_uid_to_kuid(ip->i_d.di_uid); inode->i_gid = xfs_gid_to_kgid(ip->i_d.di_gid); diff --git a/fs/xfs/xfs_itable.c b/fs/xfs/xfs_itable.c index 6162e65..ce73eb3 100644 --- a/fs/xfs/xfs_itable.c +++ b/fs/xfs/xfs_itable.c @@ -88,7 +88,6 @@ xfs_bulkstat_one_int( buf->bs_projid_lo = dic->di_projid_lo; buf->bs_projid_hi = dic->di_projid_hi; buf->bs_ino = ino; - buf->bs_mode = dic->di_mode; buf->bs_uid = dic->di_uid; buf->bs_gid = dic->di_gid; buf->bs_size = dic->di_size; @@ -101,6 +100,7 @@ xfs_bulkstat_one_int( buf->bs_ctime.tv_sec = inode->i_ctime.tv_sec; buf->bs_ctime.tv_nsec = inode->i_ctime.tv_nsec; buf->bs_gen = inode->i_generation; + buf->bs_mode = inode->i_mode; buf->bs_xflags = xfs_ip2xflags(ip); buf->bs_extsize = dic->di_extsize << mp->m_sb.sb_blocklog; diff --git a/fs/xfs/xfs_log_recover.c b/fs/xfs/xfs_log_recover.c index 678fe6e..04326ac 100644 --- a/fs/xfs/xfs_log_recover.c +++ b/fs/xfs/xfs_log_recover.c @@ -4343,7 +4343,7 @@ xlog_recover_process_one_iunlink( goto fail_iput; ASSERT(VFS_I(ip)->i_nlink == 0); - ASSERT(ip->i_d.di_mode != 0); + ASSERT(VFS_I(ip)->i_mode != 0); /* setup for the next pass */ agino = be32_to_cpu(dip->di_next_unlinked); diff --git a/fs/xfs/xfs_mount.c b/fs/xfs/xfs_mount.c index bb753b3..d306105 100644 --- a/fs/xfs/xfs_mount.c +++ b/fs/xfs/xfs_mount.c @@ -865,7 +865,7 @@ xfs_mountfs( ASSERT(rip != NULL); - if (unlikely(!S_ISDIR(rip->i_d.di_mode))) { + if (unlikely(!S_ISDIR(VFS_I(rip)->i_mode))) { xfs_warn(mp, "corrupted root inode %llu: not a directory", (unsigned long long)rip->i_ino); xfs_iunlock(rip, XFS_ILOCK_EXCL); -- 2.5.0 From zwisler@gmail.com Sun Feb 7 22:29:41 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=FREEMAIL_FROM, MIME_QP_LONG_LINE,T_DKIM_INVALID autolearn=ham version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay1.corp.sgi.com [137.38.102.111]) by oss.sgi.com (Postfix) with ESMTP id B30047CAA for ; Sun, 7 Feb 2016 22:29:41 -0600 (CST) Received: from cuda.sgi.com (cuda2.sgi.com [192.48.176.25]) by relay1.corp.sgi.com (Postfix) with ESMTP id A24A88F8035 for ; Sun, 7 Feb 2016 20:29:41 -0800 (PST) X-ASG-Debug-ID: 1454905780-04cbb04cfa13d260001-NocioJ Received: from mail-ob0-f195.google.com (mail-ob0-f195.google.com [209.85.214.195]) by cuda.sgi.com with ESMTP id 5yIlblzCKU35Wa5E (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128 verify=NO) for ; Sun, 07 Feb 2016 20:29:40 -0800 (PST) X-Barracuda-Envelope-From: zwisler@gmail.com X-Barracuda-RBL-Trusted-Forwarder: 209.85.214.195 Received: by mail-ob0-f195.google.com with SMTP id wg8so7338132obc.3 for ; Sun, 07 Feb 2016 20:29:40 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=content-type:mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=JvUBG0CuTZEt2gB0zzU8Nf3D377Jaw72tdDjXVYxTt8=; b=dfPnENypIuKZpuUrbIc333D3wVRf7fVa0XkPRlktQypSo3jHEwF/k2VzP9HmmpkayO jPUptq1zhhsX6oxBW+dMezvrTKs5OFM33AaD3mu9pH2UmaiykYKrSqhHkZh53bG8CQSf kob1K7DTE9Im3U/IL42G9XJZ+G4GWH7Rd2Z1N2ajNyG/CI0SOFnvmB7KLRYZu3S3Xwwr +ME7eIJqF9lWkvaqTdzY79XnmyTUTtkcpBUKbvncASQZ7Y4WBKTZupptabzeYSl7UFXv xeh7MOq/r7C7AQf51HmxH/ZUDzsc7o9ns+tUR8UsTutvEOxVjNHDrZfUrs+h9qp8LMow eQLg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:content-type:mime-version:subject:from :in-reply-to:date:cc:content-transfer-encoding:message-id:references :to; bh=JvUBG0CuTZEt2gB0zzU8Nf3D377Jaw72tdDjXVYxTt8=; b=HedX8QVX1IaStcJRnNYe+aApqVFczrTpV7nw5S+wlO8JTdcNL9nl+Mug9LjMYppR74 o3RX+kx/Ct2yoamkO7w7tEzHTmJwd5pJ7p3w5wvyQjI6jgUQ9usqeucM974kHe4S5SRP qdhfGrY6u0nHct21BhwFrz1wDVHkPmVafEDzJuXMtm6tYIXhV8Pn5r3Oj7+brxHV3Lfw 4krnO1OflDRGtW2LVo8tHZF1y8VCtrs2eGWj5u1Vi4LvATAWm6sOwQP5oZXF82e0vPUt Uk3GRj770bIT70RnZgvV4ESwZzB9GbOCQv4rRaHcZ5O7JQgMMsC4xNl8wYaq8vdTcyzL n+5Q== X-Gm-Message-State: AG10YOS3fXNkd7665GUYRM7tmwfEif3fHjQxKQszMwbLUuvoeqk1j1Q1n1SGClQUcvkECg== X-Received: by 10.182.125.129 with SMTP id mq1mr22021790obb.7.1454905780258; Sun, 07 Feb 2016 20:29:40 -0800 (PST) Received: from [192.168.1.9] (c-50-170-195-176.hsd1.co.comcast.net. [50.170.195.176]) by smtp.gmail.com with ESMTPSA id u8sm16164414obf.5.2016.02.07.20.29.39 (version=TLSv1/SSLv3 cipher=OTHER); Sun, 07 Feb 2016 20:29:39 -0800 (PST) Content-Type: text/plain; charset=us-ascii X-Barracuda-BBL-IP: 192.168.1.9 Mime-Version: 1.0 (1.0) Subject: Re: [PATCH 1/2] dax: pass bdev argument to dax_clear_blocks() From: Ross Zwisler X-ASG-Orig-Subj: Re: [PATCH 1/2] dax: pass bdev argument to dax_clear_blocks() X-Mailer: iPad Mail (13D15) In-Reply-To: <20160208014601.GB2343@linux.intel.com> Date: Sun, 7 Feb 2016 21:29:38 -0700 Cc: Dan Williams , Theodore Ts'o , "linux-nvdimm@lists.01.org" , Dave Chinner , "linux-kernel@vger.kernel.org" , XFS Developers , Linux MM , Andreas Dilger , Alexander Viro , Jan Kara , linux-fsdevel , linux-ext4 , Andrew Morton Content-Transfer-Encoding: quoted-printable Message-Id: <00FE872A-9B2A-4492-A83C-59025ACB1F4A@gmail.com> References: <1454829553-29499-1-git-send-email-ross.zwisler@linux.intel.com> <1454829553-29499-2-git-send-email-ross.zwisler@linux.intel.com> <20160208014601.GB2343@linux.intel.com> To: Ross Zwisler X-Barracuda-Connect: mail-ob0-f195.google.com[209.85.214.195] X-Barracuda-Start-Time: 1454905780 X-Barracuda-Encrypted: ECDHE-RSA-AES128-GCM-SHA256 X-Barracuda-URL: https://192.48.176.25:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-BRTS-Status: 1 X-Barracuda-Spam-Score: 0.00 X-Barracuda-Spam-Status: No, SCORE=0.00 using per-user scores of TAG_LEVEL=1000.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.7 tests=BSF_SC0_MISMATCH_TO, DKIM_SIGNED, DKIM_VERIFIED, MIME_QP_LONG_LINE X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.3.26847 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 0.00 BSF_SC0_MISMATCH_TO Envelope rcpt doesn't match header -0.00 DKIM_VERIFIED Domain Keys Identified Mail: signature passes verification 0.00 DKIM_SIGNED Domain Keys Identified Mail: message has a signature 0.00 MIME_QP_LONG_LINE RAW: Quoted-printable line longer than 76 chars > On Feb 7, 2016, at 6:46 PM, Ross Zwisler wr= ote: >=20 >> On Sun, Feb 07, 2016 at 10:19:29AM -0800, Dan Williams wrote: >> On Sat, Feb 6, 2016 at 11:19 PM, Ross Zwisler >> wrote: >>> dax_clear_blocks() needs a valid struct block_device and previously it w= as >>> using inode->i_sb->s_bdev in all cases. This is correct for normal inod= es >>> on mounted ext2, ext4 and XFS filesystems, but is incorrect for DAX raw >>> block devices and for XFS real-time devices. >>>=20 >>> Instead, have the caller pass in a struct block_device pointer which it >>> knows to be correct. >>>=20 >>> Signed-off-by: Ross Zwisler >>> --- >>> fs/dax.c | 4 ++-- >>> fs/ext2/inode.c | 5 +++-- >>> fs/xfs/xfs_aops.c | 2 +- >>> fs/xfs/xfs_aops.h | 1 + >>> fs/xfs/xfs_bmap_util.c | 4 +++- >>> include/linux/dax.h | 3 ++- >>> 6 files changed, 12 insertions(+), 7 deletions(-) >>>=20 >>> diff --git a/fs/dax.c b/fs/dax.c >>> index 227974a..4592241 100644 >>> --- a/fs/dax.c >>> +++ b/fs/dax.c >>> @@ -83,9 +83,9 @@ struct page *read_dax_sector(struct block_device *bdev= , sector_t n) >>> * and hence this means the stack from this point must follow GFP_NOFS >>> * semantics for all operations. >>> */ >>> -int dax_clear_blocks(struct inode *inode, sector_t block, long _size) >>> +int dax_clear_blocks(struct inode *inode, struct block_device *bdev, >>> + sector_t block, long _size) >>=20 >> Since this is a bdev relative routine we should also resolve the >> sector, i.e. the signature should drop the inode: >>=20 >> int dax_clear_sectors(struct block_device *bdev, sector_t sector, long _s= ize) >=20 > The inode is still needed because dax_clear_blocks() needs inode->i_blkbit= s. > Unless there is some easy way to get this from the bdev that I'm not seein= g? Never mind, you are passing in the sector, not the block. Sure, this seems b= etter - I'll fix this for v2.= From david@fromorbit.com Sun Feb 7 23:17:34 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=ham version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay2.corp.sgi.com [137.38.102.29]) by oss.sgi.com (Postfix) with ESMTP id 4AC207CA2 for ; Sun, 7 Feb 2016 23:17:34 -0600 (CST) Received: from cuda.sgi.com (cuda1.sgi.com [192.48.157.11]) by relay2.corp.sgi.com (Postfix) with ESMTP id 295FD304039 for ; Sun, 7 Feb 2016 21:17:31 -0800 (PST) X-ASG-Debug-ID: 1454908647-04bdf079c111e330001-NocioJ Received: from ipmail06.adl2.internode.on.net (ipmail06.adl2.internode.on.net [150.101.137.129]) by cuda.sgi.com with ESMTP id BrvN2lTqGT489lqh for ; Sun, 07 Feb 2016 21:17:28 -0800 (PST) X-Barracuda-Envelope-From: david@fromorbit.com X-Barracuda-Apparent-Source-IP: 150.101.137.129 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: A2AICgBLJLhWPBATLHldDhoBAoMPgT+GY4F4nUMDBotmhUSEB4YHBAICgSNNAQEBAQEBBwEBAQFBP4RCAQEEJxMcMwgDGAklDwUlAwcaARKIGrwqDB4YhTKEf4hsAQSWdY1HgWSHaYUvRIoog1KCZRmBDU8oLohTAQEB Received: from ppp121-44-19-16.lns20.syd4.internode.on.net (HELO dastard) ([121.44.19.16]) by ipmail06.adl2.internode.on.net with ESMTP; 08 Feb 2016 15:47:26 +1030 Received: from dave by dastard with local (Exim 4.80) (envelope-from ) id 1aSeCT-00078D-KE; Mon, 08 Feb 2016 16:17:25 +1100 Date: Mon, 8 Feb 2016 16:17:25 +1100 From: Dave Chinner To: Ross Zwisler , linux-kernel@vger.kernel.org, Theodore Ts'o , Alexander Viro , Andreas Dilger , Andrew Morton , Dan Williams , Jan Kara , Matthew Wilcox , linux-ext4@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux-mm@kvack.org, linux-nvdimm@lists.01.org, xfs@oss.sgi.com Subject: Re: [PATCH 1/2] dax: pass bdev argument to dax_clear_blocks() Message-ID: <20160208051725.GM31407@dastard> X-ASG-Orig-Subj: Re: [PATCH 1/2] dax: pass bdev argument to dax_clear_blocks() References: <1454829553-29499-1-git-send-email-ross.zwisler@linux.intel.com> <1454829553-29499-2-git-send-email-ross.zwisler@linux.intel.com> <20160207220329.GK31407@dastard> <20160208014409.GA2343@linux.intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20160208014409.GA2343@linux.intel.com> User-Agent: Mutt/1.5.21 (2010-09-15) X-Barracuda-Connect: ipmail06.adl2.internode.on.net[150.101.137.129] X-Barracuda-Start-Time: 1454908648 X-Barracuda-URL: https://192.48.157.11:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-BRTS-Status: 1 X-Barracuda-Spam-Score: 0.00 X-Barracuda-Spam-Status: No, SCORE=0.00 using per-user scores of TAG_LEVEL=1000.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.7 tests=BSF_SC0_MISMATCH_TO X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.3.26847 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 0.00 BSF_SC0_MISMATCH_TO Envelope rcpt doesn't match header On Sun, Feb 07, 2016 at 06:44:09PM -0700, Ross Zwisler wrote: > On Mon, Feb 08, 2016 at 09:03:29AM +1100, Dave Chinner wrote: > > On Sun, Feb 07, 2016 at 12:19:12AM -0700, Ross Zwisler wrote: > > > dax_clear_blocks() needs a valid struct block_device and previously it was > > > using inode->i_sb->s_bdev in all cases. This is correct for normal inodes > > > on mounted ext2, ext4 and XFS filesystems, but is incorrect for DAX raw > > > block devices and for XFS real-time devices. > > > > > > Instead, have the caller pass in a struct block_device pointer which it > > > knows to be correct. > > .... > > > diff --git a/fs/xfs/xfs_bmap_util.c b/fs/xfs/xfs_bmap_util.c > > > index 07ef29b..f722ba2 100644 > > > --- a/fs/xfs/xfs_bmap_util.c > > > +++ b/fs/xfs/xfs_bmap_util.c > > > @@ -73,9 +73,11 @@ xfs_zero_extent( > > > xfs_daddr_t sector = xfs_fsb_to_db(ip, start_fsb); > > > sector_t block = XFS_BB_TO_FSBT(mp, sector); > > > ssize_t size = XFS_FSB_TO_B(mp, count_fsb); > > > + struct inode *inode = VFS_I(ip); > > > > > > if (IS_DAX(VFS_I(ip))) > > > - return dax_clear_blocks(VFS_I(ip), block, size); > > > + return dax_clear_blocks(inode, xfs_find_bdev_for_inode(inode), > > > + block, size); > > > > Get rid of the local inode variable and use VFS_I(ip) like the code > > originally did. Do not change code that is unrelated to the > > modifcation being made, especially when it results in making > > the code an inconsistent mess of mixed pointer constructs.... > > The local 'inode' variable was added to avoid multiple calls for VFS_I() for > the same 'ip'. My point is you didn't achieve that. The end result of your patch is: struct inode *inode = VFS_I(ip); if (IS_DAX(VFS_I(ip))) return dax_clear_blocks(inode, xfs_find_bdev_for_inode(inode), block, size); So now we have a local variable, but we still have 2 calls to VFS_I(ip). i.e. this makes the code harder to read and understand than before for no benefit. Cheers, Dave. -- Dave Chinner david@fromorbit.com From dave@fromorbit.com Sun Feb 7 23:44:30 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=ham version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay3.corp.sgi.com [198.149.34.15]) by oss.sgi.com (Postfix) with ESMTP id 76EE97CA2 for ; Sun, 7 Feb 2016 23:44:30 -0600 (CST) Received: from cuda.sgi.com (cuda1.sgi.com [192.48.157.11]) by relay3.corp.sgi.com (Postfix) with ESMTP id 24A7FAC004 for ; Sun, 7 Feb 2016 21:44:30 -0800 (PST) X-ASG-Debug-ID: 1454910263-04bdf079c01203f0002-NocioJ Received: from ipmail06.adl2.internode.on.net (ipmail06.adl2.internode.on.net [150.101.137.129]) by cuda.sgi.com with ESMTP id MdvxMg0W3utDBXvT for ; Sun, 07 Feb 2016 21:44:28 -0800 (PST) X-Barracuda-Envelope-From: dave@fromorbit.com X-Barracuda-Apparent-Source-IP: 150.101.137.129 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: A2CUDAD8KbhWPBATLHldKAECgw+BP4ZjgXidQwMGkSqKFIElTQEBAQEBAQcBAQEBQT9BEoNvAQUnLzMIGDE5AwcUGR6HfLxRhUqJVyaDbgWHU48inENEjXqCGAELgjYoLocAgVMBAQE Received: from ppp121-44-19-16.lns20.syd4.internode.on.net (HELO dastard) ([121.44.19.16]) by ipmail06.adl2.internode.on.net with ESMTP; 08 Feb 2016 16:14:22 +1030 Received: from disappointment.disaster.area ([192.168.1.110] helo=disappointment) by dastard with esmtp (Exim 4.80) (envelope-from ) id 1aSecX-0007Ar-QG for xfs@oss.sgi.com; Mon, 08 Feb 2016 16:44:21 +1100 Received: from dave by disappointment with local (Exim 4.86) (envelope-from ) id 1aSecX-00021S-Pd for xfs@oss.sgi.com; Mon, 08 Feb 2016 16:44:21 +1100 From: Dave Chinner To: xfs@oss.sgi.com Subject: [PATCH 1/5] xfs: remove nonblocking mode from xfs_vm_writepage Date: Mon, 8 Feb 2016 16:44:14 +1100 X-ASG-Orig-Subj: [PATCH 1/5] xfs: remove nonblocking mode from xfs_vm_writepage Message-Id: <1454910258-7578-2-git-send-email-david@fromorbit.com> X-Mailer: git-send-email 2.5.0 In-Reply-To: <1454910258-7578-1-git-send-email-david@fromorbit.com> References: <1454910258-7578-1-git-send-email-david@fromorbit.com> X-Barracuda-Connect: ipmail06.adl2.internode.on.net[150.101.137.129] X-Barracuda-Start-Time: 1454910268 X-Barracuda-URL: https://192.48.157.11:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-BRTS-Status: 1 X-Barracuda-Spam-Score: 0.00 X-Barracuda-Spam-Status: No, SCORE=0.00 using per-user scores of TAG_LEVEL=1000.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.7 tests= X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.3.26848 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- From: Dave Chinner Remove the nonblocking optimisation done for mapping lookups during writeback. It's not clear that leaving a hole in the writeback range just because we couldn't get a lock is really a win, as it makes us do another small random IO later on rather than a large sequential IO now. As this gets in the way of sane error handling later on, just remove for the moment and we can re-introduce an equivalent optimisation in future if we see problems due to extent map lock contention. Signed-off-by: Dave Chinner Reviewed-by: Christoph Hellwig --- fs/xfs/xfs_aops.c | 20 +++----------------- 1 file changed, 3 insertions(+), 17 deletions(-) diff --git a/fs/xfs/xfs_aops.c b/fs/xfs/xfs_aops.c index 14ac982..00452cb 100644 --- a/fs/xfs/xfs_aops.c +++ b/fs/xfs/xfs_aops.c @@ -289,8 +289,7 @@ xfs_map_blocks( struct inode *inode, loff_t offset, struct xfs_bmbt_irec *imap, - int type, - int nonblocking) + int type) { struct xfs_inode *ip = XFS_I(inode); struct xfs_mount *mp = ip->i_mount; @@ -306,12 +305,7 @@ xfs_map_blocks( if (type == XFS_IO_UNWRITTEN) bmapi_flags |= XFS_BMAPI_IGSTATE; - if (!xfs_ilock_nowait(ip, XFS_ILOCK_SHARED)) { - if (nonblocking) - return -EAGAIN; - xfs_ilock(ip, XFS_ILOCK_SHARED); - } - + xfs_ilock(ip, XFS_ILOCK_SHARED); ASSERT(ip->i_d.di_format != XFS_DINODE_FMT_BTREE || (ip->i_df.if_flags & XFS_IFEXTENTS)); ASSERT(offset <= mp->m_super->s_maxbytes); @@ -961,7 +955,6 @@ xfs_vm_writepage( ssize_t len; int err, imap_valid = 0, uptodate = 1; int count = 0; - int nonblocking = 0; trace_xfs_writepage(inode, page, 0, 0); @@ -1061,9 +1054,6 @@ xfs_vm_writepage( offset = page_offset(page); type = XFS_IO_OVERWRITE; - if (wbc->sync_mode == WB_SYNC_NONE) - nonblocking = 1; - do { int new_ioend = 0; @@ -1123,8 +1113,7 @@ xfs_vm_writepage( * time. */ new_ioend = 1; - err = xfs_map_blocks(inode, offset, &imap, type, - nonblocking); + err = xfs_map_blocks(inode, offset, &imap, type); if (err) goto error; imap_valid = xfs_imap_valid(inode, &imap, offset); @@ -1194,9 +1183,6 @@ error: if (iohead) xfs_cancel_ioend(iohead); - if (err == -EAGAIN) - goto redirty; - xfs_aops_discard_page(page); ClearPageUptodate(page); unlock_page(page); -- 2.5.0 From dave@fromorbit.com Sun Feb 7 23:44:32 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=ham version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay1.corp.sgi.com [137.38.102.111]) by oss.sgi.com (Postfix) with ESMTP id D79097CA6 for ; Sun, 7 Feb 2016 23:44:32 -0600 (CST) Received: from cuda.sgi.com (cuda1.sgi.com [192.48.157.11]) by relay1.corp.sgi.com (Postfix) with ESMTP id A35498F8033 for ; Sun, 7 Feb 2016 21:44:32 -0800 (PST) X-ASG-Debug-ID: 1454910263-04bdf079c01203f0003-NocioJ Received: from ipmail06.adl2.internode.on.net (ipmail06.adl2.internode.on.net [150.101.137.129]) by cuda.sgi.com with ESMTP id mWBmYMOY7fvG1sAm for ; Sun, 07 Feb 2016 21:44:29 -0800 (PST) X-Barracuda-Envelope-From: dave@fromorbit.com X-Barracuda-Apparent-Source-IP: 150.101.137.129 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: A2CRDAD8KbhWPBATLHldKAECgw+BP4ZjgXidQwMGkSqLOU0BAQEBAQEHAQEBAUE/QRKDbwEFJy8zCBgxOQMHFBmIGrxRhUqJC4RgBYdTjyKcQ0SNeoIYAQs+AxmBXCguhwAagTkBAQE Received: from ppp121-44-19-16.lns20.syd4.internode.on.net (HELO dastard) ([121.44.19.16]) by ipmail06.adl2.internode.on.net with ESMTP; 08 Feb 2016 16:14:22 +1030 Received: from disappointment.disaster.area ([192.168.1.110] helo=disappointment) by dastard with esmtp (Exim 4.80) (envelope-from ) id 1aSecX-0007At-RU for xfs@oss.sgi.com; Mon, 08 Feb 2016 16:44:21 +1100 Received: from dave by disappointment with local (Exim 4.86) (envelope-from ) id 1aSecX-00021c-QV for xfs@oss.sgi.com; Mon, 08 Feb 2016 16:44:21 +1100 From: Dave Chinner To: xfs@oss.sgi.com Subject: [PATCH 3/5] xfs: xfs_cluster_write is redundant Date: Mon, 8 Feb 2016 16:44:16 +1100 X-ASG-Orig-Subj: [PATCH 3/5] xfs: xfs_cluster_write is redundant Message-Id: <1454910258-7578-4-git-send-email-david@fromorbit.com> X-Mailer: git-send-email 2.5.0 In-Reply-To: <1454910258-7578-1-git-send-email-david@fromorbit.com> References: <1454910258-7578-1-git-send-email-david@fromorbit.com> X-Barracuda-Connect: ipmail06.adl2.internode.on.net[150.101.137.129] X-Barracuda-Start-Time: 1454910269 X-Barracuda-URL: https://192.48.157.11:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-BRTS-Status: 1 X-Barracuda-Spam-Score: 0.00 X-Barracuda-Spam-Status: No, SCORE=0.00 using per-user scores of TAG_LEVEL=1000.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.7 tests= X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.3.26848 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- From: Dave Chinner xfs_cluster_write() is not necessary now that xfs_vm_writepages() aggregates writepage calls across a single mapping. This means we no longer need to do page lookups in xfs_cluster_write, so writeback only needs to look up th epage cache once per page being written. This also removes a large amount of mostly duplicate code between xfs_do_writepage() and xfs_convert_page(). Signed-off-by: Dave Chinner --- fs/xfs/xfs_aops.c | 215 ++---------------------------------------------------- 1 file changed, 6 insertions(+), 209 deletions(-) diff --git a/fs/xfs/xfs_aops.c b/fs/xfs/xfs_aops.c index 4453d1d..e473f53 100644 --- a/fs/xfs/xfs_aops.c +++ b/fs/xfs/xfs_aops.c @@ -656,179 +656,6 @@ xfs_check_page_type( return false; } -/* - * Allocate & map buffers for page given the extent map. Write it out. - * except for the original page of a writepage, this is called on - * delalloc/unwritten pages only, for the original page it is possible - * that the page has no mapping at all. - */ -STATIC int -xfs_convert_page( - struct inode *inode, - struct page *page, - loff_t tindex, - struct xfs_writepage_ctx *wpc, - struct writeback_control *wbc) -{ - struct buffer_head *bh, *head; - xfs_off_t end_offset; - unsigned long p_offset; - int len, page_dirty; - int count = 0, done = 0, uptodate = 1; - xfs_off_t offset = page_offset(page); - - if (page->index != tindex) - goto fail; - if (!trylock_page(page)) - goto fail; - if (PageWriteback(page)) - goto fail_unlock_page; - if (page->mapping != inode->i_mapping) - goto fail_unlock_page; - if (!xfs_check_page_type(page, wpc->ioend->io_type, false)) - goto fail_unlock_page; - - /* - * page_dirty is initially a count of buffers on the page before - * EOF and is decremented as we move each into a cleanable state. - * - * Derivation: - * - * End offset is the highest offset that this page should represent. - * If we are on the last page, (end_offset & (PAGE_CACHE_SIZE - 1)) - * will evaluate non-zero and be less than PAGE_CACHE_SIZE and - * hence give us the correct page_dirty count. On any other page, - * it will be zero and in that case we need page_dirty to be the - * count of buffers on the page. - */ - end_offset = min_t(unsigned long long, - (xfs_off_t)(page->index + 1) << PAGE_CACHE_SHIFT, - i_size_read(inode)); - - /* - * If the current map does not span the entire page we are about to try - * to write, then give up. The only way we can write a page that spans - * multiple mappings in a single writeback iteration is via the - * xfs_vm_writepage() function. Data integrity writeback requires the - * entire page to be written in a single attempt, otherwise the part of - * the page we don't write here doesn't get written as part of the data - * integrity sync. - * - * For normal writeback, we also don't attempt to write partial pages - * here as it simply means that write_cache_pages() will see it under - * writeback and ignore the page until some point in the future, at - * which time this will be the only page in the file that needs - * writeback. Hence for more optimal IO patterns, we should always - * avoid partial page writeback due to multiple mappings on a page here. - */ - if (!xfs_imap_valid(inode, &wpc->imap, end_offset)) - goto fail_unlock_page; - - len = 1 << inode->i_blkbits; - p_offset = min_t(unsigned long, end_offset & (PAGE_CACHE_SIZE - 1), - PAGE_CACHE_SIZE); - p_offset = p_offset ? roundup(p_offset, len) : PAGE_CACHE_SIZE; - page_dirty = p_offset / len; - - /* - * The moment we find a buffer that doesn't match our current type - * specification or can't be written, abort the loop and start - * writeback. As per the above xfs_imap_valid() check, only - * xfs_vm_writepage() can handle partial page writeback fully - we are - * limited here to the buffers that are contiguous with the current - * ioend, and hence a buffer we can't write breaks that contiguity and - * we have to defer the rest of the IO to xfs_vm_writepage(). - */ - bh = head = page_buffers(page); - do { - if (offset >= end_offset) - break; - if (!buffer_uptodate(bh)) - uptodate = 0; - if (!(PageUptodate(page) || buffer_uptodate(bh))) { - done = 1; - break; - } - - if (buffer_unwritten(bh) || buffer_delay(bh) || - buffer_mapped(bh)) { - if (buffer_unwritten(bh)) - wpc->io_type = XFS_IO_UNWRITTEN; - else if (buffer_delay(bh)) - wpc->io_type = XFS_IO_DELALLOC; - else - wpc->io_type = XFS_IO_OVERWRITE; - - /* - * imap should always be valid because of the above - * partial page end_offset check on the imap. - */ - ASSERT(xfs_imap_valid(inode, &wpc->imap, offset)); - - lock_buffer(bh); - if (wpc->io_type != XFS_IO_OVERWRITE) - xfs_map_at_offset(inode, bh, &wpc->imap, offset); - xfs_add_to_ioend(inode, bh, offset, wpc); - - page_dirty--; - count++; - } else { - done = 1; - break; - } - } while (offset += len, (bh = bh->b_this_page) != head); - - if (uptodate && bh == head) - SetPageUptodate(page); - - if (count) { - if (--wbc->nr_to_write <= 0 && - wbc->sync_mode == WB_SYNC_NONE) - done = 1; - } - xfs_start_page_writeback(page, !page_dirty, count); - - return done; - fail_unlock_page: - unlock_page(page); - fail: - return 1; -} - -/* - * Convert & write out a cluster of pages in the same extent as defined - * by mp and following the start page. - */ -STATIC void -xfs_cluster_write( - struct inode *inode, - pgoff_t tindex, - struct xfs_writepage_ctx *wpc, - struct writeback_control *wbc, - pgoff_t tlast) -{ - struct pagevec pvec; - int done = 0, i; - - pagevec_init(&pvec, 0); - while (!done && tindex <= tlast) { - unsigned len = min_t(pgoff_t, PAGEVEC_SIZE, tlast - tindex + 1); - - if (!pagevec_lookup(&pvec, inode->i_mapping, tindex, len)) - break; - - for (i = 0; i < pagevec_count(&pvec); i++) { - done = xfs_convert_page(inode, pvec.pages[i], tindex++, - wpc, wbc); - if (done) - break; - } - - pagevec_release(&pvec); - cond_resched(); - } -} - STATIC void xfs_vm_invalidatepage( struct page *page, @@ -945,7 +772,7 @@ xfs_do_writepage( struct buffer_head *bh, *head; loff_t offset; __uint64_t end_offset; - pgoff_t end_index, last_index; + pgoff_t end_index; ssize_t len; int err, uptodate = 1; int count = 0; @@ -975,12 +802,9 @@ xfs_do_writepage( if (WARN_ON_ONCE(current->flags & PF_FSTRANS)) goto redirty; - /* Is this page beyond the end of the file? */ - offset = i_size_read(inode); - end_index = offset >> PAGE_CACHE_SHIFT; - last_index = (offset - 1) >> PAGE_CACHE_SHIFT; - /* + * Is this page beyond the end of the file? + * * The page index is less than the end_index, adjust the end_offset * to the highest offset that this page should represent. * ----------------------------------------------------- @@ -991,6 +815,8 @@ xfs_do_writepage( * | desired writeback range | see else | * ---------------------------------^------------------| */ + offset = i_size_read(inode); + end_index = offset >> PAGE_CACHE_SHIFT; if (page->index < end_index) end_offset = (xfs_off_t)(page->index + 1) << PAGE_CACHE_SHIFT; else { @@ -1120,36 +946,7 @@ xfs_do_writepage( SetPageUptodate(page); xfs_start_page_writeback(page, 1, count); - - /* if there is no IO to be submitted for this page, we are done */ - if (!count) - return 0; - - ASSERT(wpc->iohead); - - /* - * Any errors from this point onwards need tobe reported through the IO - * completion path as we have marked the initial page as under writeback - * and unlocked it. - */ - if (wpc->imap_valid) { - xfs_off_t end_index; - - end_index = wpc->imap.br_startoff + wpc->imap.br_blockcount; - - /* to bytes */ - end_index <<= inode->i_blkbits; - - /* to pages */ - end_index = (end_index - 1) >> PAGE_CACHE_SHIFT; - - /* check against file size */ - if (end_index > last_index) - end_index = last_index; - - xfs_cluster_write(inode, page->index + 1, wpc, wbc, end_index); - } - + ASSERT(wpc->iohead || !count); return 0; error: -- 2.5.0 From dave@fromorbit.com Sun Feb 7 23:44:33 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=ham version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay1.corp.sgi.com [137.38.102.111]) by oss.sgi.com (Postfix) with ESMTP id 2D2FE7CA7 for ; Sun, 7 Feb 2016 23:44:33 -0600 (CST) Received: from cuda.sgi.com (cuda2.sgi.com [192.48.176.25]) by relay1.corp.sgi.com (Postfix) with ESMTP id 2406E8F8033 for ; Sun, 7 Feb 2016 21:44:33 -0800 (PST) X-ASG-Debug-ID: 1454910270-04cbb04cfa1414d0001-NocioJ Received: from ipmail06.adl2.internode.on.net (ipmail06.adl2.internode.on.net [150.101.137.129]) by cuda.sgi.com with ESMTP id wGKSmOKc6Ob8MJwv for ; Sun, 07 Feb 2016 21:44:30 -0800 (PST) X-Barracuda-Envelope-From: dave@fromorbit.com X-Barracuda-Apparent-Source-IP: 150.101.137.129 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: A2CPDAD8KbhWPBATLHlVCCgBAoMPgT+GY4F4nUMJkSqLOU0BAQEBAQEHAQEBAUE/QRKDbwEFJy8zCBgxOQMHFBmIGrxRhUqGNQGCV4ReBYdQA4cDiB+cQ44+ghgBCwFADQyBXCguhwCBUwEBAQ Received: from ppp121-44-19-16.lns20.syd4.internode.on.net (HELO dastard) ([121.44.19.16]) by ipmail06.adl2.internode.on.net with ESMTP; 08 Feb 2016 16:14:22 +1030 Received: from disappointment.disaster.area ([192.168.1.110] helo=disappointment) by dastard with esmtp (Exim 4.80) (envelope-from ) id 1aSecX-0007Av-SO for xfs@oss.sgi.com; Mon, 08 Feb 2016 16:44:21 +1100 Received: from dave by disappointment with local (Exim 4.86) (envelope-from ) id 1aSecX-00021m-Rn for xfs@oss.sgi.com; Mon, 08 Feb 2016 16:44:21 +1100 From: Dave Chinner To: xfs@oss.sgi.com Subject: [PATCH 5/5] xfs: don't chain ioends during writepage submission Date: Mon, 8 Feb 2016 16:44:18 +1100 X-ASG-Orig-Subj: [PATCH 5/5] xfs: don't chain ioends during writepage submission Message-Id: <1454910258-7578-6-git-send-email-david@fromorbit.com> X-Mailer: git-send-email 2.5.0 In-Reply-To: <1454910258-7578-1-git-send-email-david@fromorbit.com> References: <1454910258-7578-1-git-send-email-david@fromorbit.com> X-Barracuda-Connect: ipmail06.adl2.internode.on.net[150.101.137.129] X-Barracuda-Start-Time: 1454910270 X-Barracuda-URL: https://192.48.176.25:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-BRTS-Status: 1 X-Barracuda-Spam-Score: 0.00 X-Barracuda-Spam-Status: No, SCORE=0.00 using per-user scores of TAG_LEVEL=1000.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.7 tests= X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.3.26848 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- From: Dave Chinner Currently we can build a long ioend chain during ->writepages that gets attached to the writepage context. IO submission only then occurs when we finish all the writepage processing. This means we can have many ioends allocated and pending, and this violates the mempool guarantees that we need to give about forwards progress. i.e. we really should only have one ioend being built at a time, otherwise we may drain the mempool trying to allocate a new ioend and that blocks submission, completion and freeing of ioends that are already in progress. To prevent this situation from happening, we need to submit ioends for IO as soon as they are ready for dispatch rather than queuing them for later submission. This means the ioends have bios built immediately and they get queued on any plug that is current active. Hence if we schedule away from writeback, the ioends that have been built will make forwards progress due to the plug flushing on context switch. This will also prevent context switches from creating unnecessary IO submission latency. We can't completely avoid having nested IO allocation - when we have a block size smaller than a page size, we still need to hold the ioend submission until after we have marked the current page dirty. Hence we may need multiple ioends to be held while the current page is completely mapped and made ready for IO dispatch. We cannot avoid this problem - the current code already has this ioend chaining within a page so we can mostly ignore that it occurs. Signed-off-by: Dave Chinner --- fs/xfs/xfs_aops.c | 94 ++++++++++++++++++++++++++++--------------------------- 1 file changed, 48 insertions(+), 46 deletions(-) diff --git a/fs/xfs/xfs_aops.c b/fs/xfs/xfs_aops.c index e5b8214..852ecf2 100644 --- a/fs/xfs/xfs_aops.c +++ b/fs/xfs/xfs_aops.c @@ -47,7 +47,6 @@ struct xfs_writepage_ctx { struct xfs_bmbt_irec imap; bool imap_valid; unsigned int io_type; - struct xfs_ioend *iohead; struct xfs_ioend *ioend; sector_t last_block; }; @@ -461,19 +460,6 @@ static inline int xfs_bio_add_buffer(struct bio *bio, struct buffer_head *bh) * Submit all of the bios for all of the ioends we have saved up, covering the * initial writepage page and also any probed pages. * - * Because we may have multiple ioends spanning a page, we need to start - * writeback on all the buffers before we submit them for I/O. If we mark the - * buffers as we got, then we can end up with a page that only has buffers - * marked async write and I/O complete on can occur before we mark the other - * buffers async write. - * - * The end result of this is that we trip a bug in end_page_writeback() because - * we call it twice for the one page as the code in end_buffer_async_write() - * assumes that all buffers on the page are started at the same time. - * - * The fix is two passes across the ioend list - one to start writeback on the - * buffer_heads, and then submit them for I/O on the second pass. - * * If @fail is non-zero, it means that we have a situation where some part of * the submission process has failed after we have marked paged for writeback * and unlocked them. In this situation, we need to fail the ioend chain rather @@ -491,14 +477,11 @@ xfs_submit_ioend( struct bio *bio; sector_t lastblock = 0; - /* Pass 1 - start writeback */ - do { - next = ioend->io_list; - for (bh = ioend->io_buffer_head; bh; bh = bh->b_private) - xfs_start_buffer_writeback(bh); - } while ((ioend = next) != NULL); + /* Reserve log space if we might write beyond the on-disk inode size. */ + if (!fail && ioend && ioend->io_type != XFS_IO_UNWRITTEN && + xfs_ioend_is_append(ioend)) + fail = xfs_setfilesize_trans_alloc(ioend); - /* Pass 2 - submit I/O */ ioend = head; do { next = ioend->io_list; @@ -543,25 +526,28 @@ xfs_submit_ioend( * Test to see if we've been building up a completion structure for * earlier buffers -- if so, we try to append to this ioend if we * can, otherwise we finish off any current ioend and start another. - * Return true if we've finished the given ioend. + * Return the ioend we finished off so that the caller can submit it + * once it has finished processing the dirty page. */ -STATIC void +STATIC struct xfs_ioend * xfs_add_to_ioend( struct inode *inode, struct buffer_head *bh, xfs_off_t offset, struct xfs_writepage_ctx *wpc) { + struct xfs_ioend *ioend_to_submit = NULL; + if (!wpc->ioend || wpc->io_type != wpc->ioend->io_type || bh->b_blocknr != wpc->last_block + 1) { struct xfs_ioend *new; + ioend_to_submit = wpc->ioend; + new = xfs_alloc_ioend(inode, wpc->io_type); new->io_offset = offset; new->io_buffer_head = bh; new->io_buffer_tail = bh; - if (wpc->ioend) - wpc->ioend->io_list = new; wpc->ioend = new; } else { wpc->ioend->io_buffer_tail->b_private = bh; @@ -571,6 +557,8 @@ xfs_add_to_ioend( bh->b_private = NULL; wpc->ioend->io_size += bh->b_size; wpc->last_block = bh->b_blocknr; + xfs_start_buffer_writeback(bh); + return ioend_to_submit; } STATIC void @@ -738,29 +726,22 @@ xfs_writepage_submit( struct writeback_control *wbc, int status) { - struct blk_plug plug; - - /* Reserve log space if we might write beyond the on-disk inode size. */ - if (!status && wpc->ioend && wpc->ioend->io_type != XFS_IO_UNWRITTEN && - xfs_ioend_is_append(wpc->ioend)) - status = xfs_setfilesize_trans_alloc(wpc->ioend); - - if (wpc->iohead) { - blk_start_plug(&plug); - xfs_submit_ioend(wbc, wpc->iohead, status); - blk_finish_plug(&plug); - } + if (wpc->ioend) + xfs_submit_ioend(wbc, wpc->ioend, status); return status; } static int xfs_writepage_map( struct xfs_writepage_ctx *wpc, + struct writeback_control *wbc, struct inode *inode, struct page *page, loff_t offset, __uint64_t end_offset) { + struct xfs_ioend *ioend_to_submit = NULL; + struct xfs_ioend *ioend_tail = NULL; struct buffer_head *bh, *head; ssize_t len = 1 << inode->i_blkbits; int error = 0; @@ -827,23 +808,37 @@ xfs_writepage_map( offset); } if (wpc->imap_valid) { + struct xfs_ioend *ioend; + lock_buffer(bh); if (wpc->io_type != XFS_IO_OVERWRITE) xfs_map_at_offset(inode, bh, &wpc->imap, offset); - xfs_add_to_ioend(inode, bh, offset, wpc); + ioend = xfs_add_to_ioend(inode, bh, offset, wpc); + if (ioend) { + ioend->io_list = NULL; + if (!ioend_to_submit) + ioend_to_submit = ioend; + else + ioend_tail->io_list = ioend; + ioend_tail = ioend; + } count++; } - if (!wpc->iohead) - wpc->iohead = wpc->ioend; - } while (offset += len, ((bh = bh->b_this_page) != head)); if (uptodate && bh == head) SetPageUptodate(page); xfs_start_page_writeback(page, 1, count); - ASSERT(wpc->iohead || !count); + ASSERT(wpc->ioend || !count); + while (ioend_to_submit) { + struct xfs_ioend *next = ioend_to_submit->io_list; + + ioend_to_submit->io_list = NULL; + xfs_submit_ioend(wbc, ioend_to_submit, 0); + ioend_to_submit = next; + } return 0; out_error: @@ -853,9 +848,16 @@ out_error: * ioend, then we can't touch it here and need to rely on IO submission * to unlock it. */ - if (count) + if (count) { xfs_start_page_writeback(page, 0, count); - else { + while (ioend_to_submit) { + struct xfs_ioend *next = ioend_to_submit->io_list; + + ioend_to_submit->io_list = NULL; + xfs_submit_ioend(wbc, ioend_to_submit, 0); + ioend_to_submit = next; + } + } else { xfs_aops_discard_page(page); ClearPageUptodate(page); unlock_page(page); @@ -975,14 +977,14 @@ xfs_do_writepage( end_offset = offset; } - error = xfs_writepage_map(wpc, inode, page, offset, end_offset); + error = xfs_writepage_map(wpc, wbc, inode, page, offset, end_offset); if (error) goto out_error; return 0; out_error: /* - * We have to fail the iohead here because we buffers locked in the + * We have to fail the ioend here because we buffers locked in the * ioend chain. If we don't do this, we'll deadlock invalidating the * page as that tries to lock the buffers on the page. Also, because we * have set pages under writeback, we have to run IO completion to mark -- 2.5.0 From dave@fromorbit.com Sun Feb 7 23:44:34 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=ham version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay3.corp.sgi.com [198.149.34.15]) by oss.sgi.com (Postfix) with ESMTP id CC5DB7CA6 for ; Sun, 7 Feb 2016 23:44:34 -0600 (CST) Received: from cuda.sgi.com (cuda1.sgi.com [192.48.157.11]) by relay3.corp.sgi.com (Postfix) with ESMTP id 6E407AC001 for ; Sun, 7 Feb 2016 21:44:34 -0800 (PST) X-ASG-Debug-ID: 1454910263-04bdf079c01203f0001-NocioJ Received: from ipmail06.adl2.internode.on.net (ipmail06.adl2.internode.on.net [150.101.137.129]) by cuda.sgi.com with ESMTP id Fp7GqDLGemTQXuaI for ; Sun, 07 Feb 2016 21:44:23 -0800 (PST) X-Barracuda-Envelope-From: dave@fromorbit.com X-Barracuda-Apparent-Source-IP: 150.101.137.129 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: A2DfDQD8KbhWPBATLHldKAECgw9SbYhbnSgCCg8DBoEPkBuEKIcRTQEBAQEBAQcBAQEBQT9BEoRLO4ECAweIRw+eD54zhUqHU4Iqg24Fkm6EB4VMlndEjXqCGAELAUAZgVwoLgGGf4FTAQEB Received: from ppp121-44-19-16.lns20.syd4.internode.on.net (HELO dastard) ([121.44.19.16]) by ipmail06.adl2.internode.on.net with ESMTP; 08 Feb 2016 16:14:22 +1030 Received: from disappointment.disaster.area ([192.168.1.110] helo=disappointment) by dastard with esmtp (Exim 4.80) (envelope-from ) id 1aSecX-0007Aq-Pn for xfs@oss.sgi.com; Mon, 08 Feb 2016 16:44:21 +1100 Received: from dave by disappointment with local (Exim 4.86) (envelope-from ) id 1aSecX-00021P-P8 for xfs@oss.sgi.com; Mon, 08 Feb 2016 16:44:21 +1100 From: Dave Chinner To: xfs@oss.sgi.com Subject: [PATCH 0/5 v3] xfs: get rid of xfs_cluster_write() Date: Mon, 8 Feb 2016 16:44:13 +1100 X-ASG-Orig-Subj: [PATCH 0/5 v3] xfs: get rid of xfs_cluster_write() Message-Id: <1454910258-7578-1-git-send-email-david@fromorbit.com> X-Mailer: git-send-email 2.5.0 X-Barracuda-Connect: ipmail06.adl2.internode.on.net[150.101.137.129] X-Barracuda-Start-Time: 1454910263 X-Barracuda-URL: https://192.48.157.11:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-BRTS-Status: 1 X-Barracuda-Spam-Score: 0.00 X-Barracuda-Spam-Status: No, SCORE=0.00 using per-user scores of TAG_LEVEL=1000.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.7 tests= X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.3.26848 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- Hi folks, Still clearing out my pending patches. This one was last posted almost 6 months ago: http://oss.sgi.com/archives/xfs/2015-08/msg00523.html The main issue at the time was the fact that the ioends were added to the writepage context and only submitted once write_cached_pages() was done, resulting in building up a large number of writeback pages and allocated ioends before IO submission was done. hence we could potentially prevent writeback progress from being made due to mempool starvation as we weren't following the required rules for the ioend mempool. This is addressed in the new patch 5. instead of chaining ioends onto the writepage context, we submit completed ioends the moment we are done processing the page that triggered allocation of a new ioend. Hence we issue ioends as they are built, rather than as a batch once page processing is done. This ensures that writeback follows the rules required for mempools to work effectively and we won't deadlock due to mempool starvation during low memory writeback. This modified patch set has been sitting in my queue now for almost 4 months, so it's time to get it moved onwards... Cheers, Dave. From dave@fromorbit.com Sun Feb 7 23:44:35 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=ham version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay1.corp.sgi.com [137.38.102.111]) by oss.sgi.com (Postfix) with ESMTP id 270097CA6 for ; Sun, 7 Feb 2016 23:44:35 -0600 (CST) Received: from cuda.sgi.com (cuda2.sgi.com [192.48.176.25]) by relay1.corp.sgi.com (Postfix) with ESMTP id 1ECBF8F8033 for ; Sun, 7 Feb 2016 21:44:31 -0800 (PST) X-ASG-Debug-ID: 1454910268-04cbb04cf91414c0001-NocioJ Received: from ipmail06.adl2.internode.on.net (ipmail06.adl2.internode.on.net [150.101.137.129]) by cuda.sgi.com with ESMTP id deQg7BGWQbNQd0ap for ; Sun, 07 Feb 2016 21:44:29 -0800 (PST) X-Barracuda-Envelope-From: dave@fromorbit.com X-Barracuda-Apparent-Source-IP: 150.101.137.129 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: A2CRDAD8KbhWPBATLHlVCCgBAoMPgT+GY4F4nUMDBpEqizlNAQEBAQEBBwEBAQFBP0ESg28BBScvMwgYMTkDBxQZiBq8UYVKiQ2EXgWHU48inENEjXqCGAELgjYoLocAgVMBAQE Received: from ppp121-44-19-16.lns20.syd4.internode.on.net (HELO dastard) ([121.44.19.16]) by ipmail06.adl2.internode.on.net with ESMTP; 08 Feb 2016 16:14:22 +1030 Received: from disappointment.disaster.area ([192.168.1.110] helo=disappointment) by dastard with esmtp (Exim 4.80) (envelope-from ) id 1aSecX-0007Au-Rx for xfs@oss.sgi.com; Mon, 08 Feb 2016 16:44:21 +1100 Received: from dave by disappointment with local (Exim 4.86) (envelope-from ) id 1aSecX-00021h-RI for xfs@oss.sgi.com; Mon, 08 Feb 2016 16:44:21 +1100 From: Dave Chinner To: xfs@oss.sgi.com Subject: [PATCH 4/5] xfs: factor mapping out of xfs_do_writepage Date: Mon, 8 Feb 2016 16:44:17 +1100 X-ASG-Orig-Subj: [PATCH 4/5] xfs: factor mapping out of xfs_do_writepage Message-Id: <1454910258-7578-5-git-send-email-david@fromorbit.com> X-Mailer: git-send-email 2.5.0 In-Reply-To: <1454910258-7578-1-git-send-email-david@fromorbit.com> References: <1454910258-7578-1-git-send-email-david@fromorbit.com> X-Barracuda-Connect: ipmail06.adl2.internode.on.net[150.101.137.129] X-Barracuda-Start-Time: 1454910268 X-Barracuda-URL: https://192.48.176.25:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-BRTS-Status: 1 X-Barracuda-Spam-Score: 0.00 X-Barracuda-Spam-Status: No, SCORE=0.00 using per-user scores of TAG_LEVEL=1000.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.7 tests= X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.3.26848 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- From: Dave Chinner Separate out the bufferhead based mapping from the writepage code so that we have a clear separation of the page operations and the bufferhead state. Signed-off-by: Dave Chinner --- fs/xfs/xfs_aops.c | 221 +++++++++++++++++++++++++++++------------------------- 1 file changed, 119 insertions(+), 102 deletions(-) diff --git a/fs/xfs/xfs_aops.c b/fs/xfs/xfs_aops.c index e473f53..e5b8214 100644 --- a/fs/xfs/xfs_aops.c +++ b/fs/xfs/xfs_aops.c @@ -753,6 +753,116 @@ xfs_writepage_submit( return status; } +static int +xfs_writepage_map( + struct xfs_writepage_ctx *wpc, + struct inode *inode, + struct page *page, + loff_t offset, + __uint64_t end_offset) +{ + struct buffer_head *bh, *head; + ssize_t len = 1 << inode->i_blkbits; + int error = 0; + int uptodate = 1; + int count = 0; + + bh = head = page_buffers(page); + offset = page_offset(page); + + do { + if (offset >= end_offset) + break; + if (!buffer_uptodate(bh)) + uptodate = 0; + + /* + * set_page_dirty dirties all buffers in a page, independent + * of their state. The dirty state however is entirely + * meaningless for holes (!mapped && uptodate), so skip + * buffers covering holes here. + */ + if (!buffer_mapped(bh) && buffer_uptodate(bh)) { + wpc->imap_valid = false; + continue; + } + + if (buffer_unwritten(bh)) { + if (wpc->io_type != XFS_IO_UNWRITTEN) { + wpc->io_type = XFS_IO_UNWRITTEN; + wpc->imap_valid = false; + } + } else if (buffer_delay(bh)) { + if (wpc->io_type != XFS_IO_DELALLOC) { + wpc->io_type = XFS_IO_DELALLOC; + wpc->imap_valid = false; + } + } else if (buffer_uptodate(bh)) { + if (wpc->io_type != XFS_IO_OVERWRITE) { + wpc->io_type = XFS_IO_OVERWRITE; + wpc->imap_valid = false; + } + } else { + if (PageUptodate(page)) + ASSERT(buffer_mapped(bh)); + /* + * This buffer is not uptodate and will not be + * written to disk. Ensure that we will put any + * subsequent writeable buffers into a new + * ioend. + */ + wpc->imap_valid = false; + continue; + } + + if (wpc->imap_valid) + wpc->imap_valid = xfs_imap_valid(inode, &wpc->imap, + offset); + if (!wpc->imap_valid) { + error = xfs_map_blocks(inode, offset, &wpc->imap, + wpc->io_type); + if (error) + goto out_error; + wpc->imap_valid = xfs_imap_valid(inode, &wpc->imap, + offset); + } + if (wpc->imap_valid) { + lock_buffer(bh); + if (wpc->io_type != XFS_IO_OVERWRITE) + xfs_map_at_offset(inode, bh, &wpc->imap, offset); + xfs_add_to_ioend(inode, bh, offset, wpc); + count++; + } + + if (!wpc->iohead) + wpc->iohead = wpc->ioend; + + } while (offset += len, ((bh = bh->b_this_page) != head)); + + if (uptodate && bh == head) + SetPageUptodate(page); + + xfs_start_page_writeback(page, 1, count); + ASSERT(wpc->iohead || !count); + return 0; + +out_error: + /* + * We can only discard the page we had the IO error on if we haven't + * included it in the ioend above. If it has already been added to the + * ioend, then we can't touch it here and need to rely on IO submission + * to unlock it. + */ + if (count) + xfs_start_page_writeback(page, 0, count); + else { + xfs_aops_discard_page(page); + ClearPageUptodate(page); + unlock_page(page); + } + return error; +} + /* * Write out a dirty page. * @@ -769,13 +879,10 @@ xfs_do_writepage( { struct xfs_writepage_ctx *wpc = data; struct inode *inode = page->mapping->host; - struct buffer_head *bh, *head; loff_t offset; __uint64_t end_offset; pgoff_t end_index; - ssize_t len; - int err, uptodate = 1; - int count = 0; + int error = 0; trace_xfs_writepage(inode, page, 0, 0); @@ -868,113 +975,23 @@ xfs_do_writepage( end_offset = offset; } - len = 1 << inode->i_blkbits; - - bh = head = page_buffers(page); - offset = page_offset(page); - - do { - if (offset >= end_offset) - break; - if (!buffer_uptodate(bh)) - uptodate = 0; - - /* - * set_page_dirty dirties all buffers in a page, independent - * of their state. The dirty state however is entirely - * meaningless for holes (!mapped && uptodate), so skip - * buffers covering holes here. - */ - if (!buffer_mapped(bh) && buffer_uptodate(bh)) { - wpc->imap_valid = false; - continue; - } - - if (buffer_unwritten(bh)) { - if (wpc->io_type != XFS_IO_UNWRITTEN) { - wpc->io_type = XFS_IO_UNWRITTEN; - wpc->imap_valid = false; - } - } else if (buffer_delay(bh)) { - if (wpc->io_type != XFS_IO_DELALLOC) { - wpc->io_type = XFS_IO_DELALLOC; - wpc->imap_valid = false; - } - } else if (buffer_uptodate(bh)) { - if (wpc->io_type != XFS_IO_OVERWRITE) { - wpc->io_type = XFS_IO_OVERWRITE; - wpc->imap_valid = false; - } - } else { - if (PageUptodate(page)) - ASSERT(buffer_mapped(bh)); - /* - * This buffer is not uptodate and will not be - * written to disk. Ensure that we will put any - * subsequent writeable buffers into a new - * ioend. - */ - wpc->imap_valid = false; - continue; - } - - if (wpc->imap_valid) - wpc->imap_valid = xfs_imap_valid(inode, &wpc->imap, - offset); - if (!wpc->imap_valid) { - err = xfs_map_blocks(inode, offset, &wpc->imap, - wpc->io_type); - if (err) - goto error; - wpc->imap_valid = xfs_imap_valid(inode, &wpc->imap, - offset); - } - if (wpc->imap_valid) { - lock_buffer(bh); - if (wpc->io_type != XFS_IO_OVERWRITE) - xfs_map_at_offset(inode, bh, &wpc->imap, offset); - xfs_add_to_ioend(inode, bh, offset, wpc); - count++; - } - - if (!wpc->iohead) - wpc->iohead = wpc->ioend; - - } while (offset += len, ((bh = bh->b_this_page) != head)); - - if (uptodate && bh == head) - SetPageUptodate(page); - - xfs_start_page_writeback(page, 1, count); - ASSERT(wpc->iohead || !count); + error = xfs_writepage_map(wpc, inode, page, offset, end_offset); + if (error) + goto out_error; return 0; -error: +out_error: /* * We have to fail the iohead here because we buffers locked in the * ioend chain. If we don't do this, we'll deadlock invalidating the * page as that tries to lock the buffers on the page. Also, because we * have set pages under writeback, we have to run IO completion to mark * the error state of the IO appropriately, so we can't cancel the ioend - * directly here. That means we have to mark this page as under - * writeback if we included any buffers from it in the ioend chain. + * directly here. */ - if (count) - xfs_start_page_writeback(page, 0, count); - xfs_writepage_submit(wpc, wbc, err); - - /* - * We can only discard the page we had the IO error on if we haven't - * included it in the ioend above. If it has already been errored out, - * the it is unlocked and we can't touch it here. - */ - if (!count) { - xfs_aops_discard_page(page); - ClearPageUptodate(page); - unlock_page(page); - } - mapping_set_error(page->mapping, err); - return err; + xfs_writepage_submit(wpc, wbc, error); + mapping_set_error(page->mapping, error); + return error; redirty: redirty_page_for_writepage(wbc, page); -- 2.5.0 From dave@fromorbit.com Sun Feb 7 23:44:35 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=ham version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay3.corp.sgi.com [198.149.34.15]) by oss.sgi.com (Postfix) with ESMTP id B967029DFD for ; Sun, 7 Feb 2016 23:44:35 -0600 (CST) Received: from cuda.sgi.com (cuda2.sgi.com [192.48.176.25]) by relay3.corp.sgi.com (Postfix) with ESMTP id 2C969AC001 for ; Sun, 7 Feb 2016 21:44:35 -0800 (PST) X-ASG-Debug-ID: 1454910268-04cbb04cf91414c0002-NocioJ Received: from ipmail06.adl2.internode.on.net (ipmail06.adl2.internode.on.net [150.101.137.129]) by cuda.sgi.com with ESMTP id CN9zpfxWJ1ru6VtO for ; Sun, 07 Feb 2016 21:44:31 -0800 (PST) X-Barracuda-Envelope-From: dave@fromorbit.com X-Barracuda-Apparent-Source-IP: 150.101.137.129 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: A2CVDAD8KbhWPBATLHlVCCgBAoMPgT+GY4F4nUMDBpEqihSBJU0BAQEBAQEHAQEBAUE/QRKDbwEFJyAPMwgYGBk5AwcUGYgasm2JZIVKiQ1KGYN7BYdTjyKcQ44+ghgBCwE9AxmBXCguhwCBUwEBAQ Received: from ppp121-44-19-16.lns20.syd4.internode.on.net (HELO dastard) ([121.44.19.16]) by ipmail06.adl2.internode.on.net with ESMTP; 08 Feb 2016 16:14:22 +1030 Received: from disappointment.disaster.area ([192.168.1.110] helo=disappointment) by dastard with esmtp (Exim 4.80) (envelope-from ) id 1aSecX-0007As-Qh for xfs@oss.sgi.com; Mon, 08 Feb 2016 16:44:21 +1100 Received: from dave by disappointment with local (Exim 4.86) (envelope-from ) id 1aSecX-00021X-Q4 for xfs@oss.sgi.com; Mon, 08 Feb 2016 16:44:21 +1100 From: Dave Chinner To: xfs@oss.sgi.com Subject: [PATCH 2/5] xfs: Introduce writeback context for writepages Date: Mon, 8 Feb 2016 16:44:15 +1100 X-ASG-Orig-Subj: [PATCH 2/5] xfs: Introduce writeback context for writepages Message-Id: <1454910258-7578-3-git-send-email-david@fromorbit.com> X-Mailer: git-send-email 2.5.0 In-Reply-To: <1454910258-7578-1-git-send-email-david@fromorbit.com> References: <1454910258-7578-1-git-send-email-david@fromorbit.com> X-Barracuda-Connect: ipmail06.adl2.internode.on.net[150.101.137.129] X-Barracuda-Start-Time: 1454910271 X-Barracuda-URL: https://192.48.176.25:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-BRTS-Status: 1 X-Barracuda-Spam-Score: 0.00 X-Barracuda-Spam-Status: No, SCORE=0.00 using per-user scores of TAG_LEVEL=1000.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.7 tests= X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.3.26848 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- From: Dave Chinner xfs_vm_writepages() calls generic_writepages to writeback a range of a file, but then xfs_vm_writepage() clusters pages itself as it does not have any context it can pass between->writepage calls from __write_cache_pages(). Introduce a writeback context for xfs_vm_writepages() and call __write_cache_pages directly with our own writepage callback so that we can pass that context to each writepage invocation. This encapsulates the current mapping, whether it is valid or not, the current ioend and it's IO type and the ioend chain being built. This requires us to move the ioend submission up to the level where the writepage context is declared. This does mean we do not submit IO until we packaged the entire writeback range, but with the block plugging in the writepages call this is the way IO is submitted, anyway. It also means that we need to handle discontiguous page ranges. If the pages sent down by write_cache_pages to the writepage callback are discontiguous, we need to detect this and put each discontiguous page range into individual ioends. This is needed to ensure that the ioend accurately represents the range of the file that it covers so that file size updates during IO completion set the size correctly. Failure to take into account the discontiguous ranges results in files being too small when writeback patterns are non-sequential. Signed-off-by: Dave Chinner --- fs/xfs/xfs_aops.c | 277 ++++++++++++++++++++++++++++-------------------------- 1 file changed, 146 insertions(+), 131 deletions(-) diff --git a/fs/xfs/xfs_aops.c b/fs/xfs/xfs_aops.c index 00452cb..4453d1d 100644 --- a/fs/xfs/xfs_aops.c +++ b/fs/xfs/xfs_aops.c @@ -40,6 +40,18 @@ #define XFS_DIO_FLAG_UNWRITTEN (1 << 0) #define XFS_DIO_FLAG_APPEND (1 << 1) +/* + * structure owned by writepages passed to individual writepage calls + */ +struct xfs_writepage_ctx { + struct xfs_bmbt_irec imap; + bool imap_valid; + unsigned int io_type; + struct xfs_ioend *iohead; + struct xfs_ioend *ioend; + sector_t last_block; +}; + void xfs_count_page_state( struct page *page, @@ -341,7 +353,7 @@ xfs_map_blocks( return 0; } -STATIC int +STATIC bool xfs_imap_valid( struct inode *inode, struct xfs_bmbt_irec *imap, @@ -528,38 +540,6 @@ xfs_submit_ioend( } /* - * Cancel submission of all buffer_heads so far in this endio. - * Toss the endio too. Only ever called for the initial page - * in a writepage request, so only ever one page. - */ -STATIC void -xfs_cancel_ioend( - xfs_ioend_t *ioend) -{ - xfs_ioend_t *next; - struct buffer_head *bh, *next_bh; - - do { - next = ioend->io_list; - bh = ioend->io_buffer_head; - do { - next_bh = bh->b_private; - clear_buffer_async_write(bh); - /* - * The unwritten flag is cleared when added to the - * ioend. We're not submitting for I/O so mark the - * buffer unwritten again for next time around. - */ - if (ioend->io_type == XFS_IO_UNWRITTEN) - set_buffer_unwritten(bh); - unlock_buffer(bh); - } while ((bh = next_bh) != NULL); - - mempool_free(ioend, xfs_ioend_pool); - } while ((ioend = next) != NULL); -} - -/* * Test to see if we've been building up a completion structure for * earlier buffers -- if so, we try to append to this ioend if we * can, otherwise we finish off any current ioend and start another. @@ -570,29 +550,27 @@ xfs_add_to_ioend( struct inode *inode, struct buffer_head *bh, xfs_off_t offset, - unsigned int type, - xfs_ioend_t **result, - int need_ioend) + struct xfs_writepage_ctx *wpc) { - xfs_ioend_t *ioend = *result; - - if (!ioend || need_ioend || type != ioend->io_type) { - xfs_ioend_t *previous = *result; - - ioend = xfs_alloc_ioend(inode, type); - ioend->io_offset = offset; - ioend->io_buffer_head = bh; - ioend->io_buffer_tail = bh; - if (previous) - previous->io_list = ioend; - *result = ioend; + if (!wpc->ioend || wpc->io_type != wpc->ioend->io_type || + bh->b_blocknr != wpc->last_block + 1) { + struct xfs_ioend *new; + + new = xfs_alloc_ioend(inode, wpc->io_type); + new->io_offset = offset; + new->io_buffer_head = bh; + new->io_buffer_tail = bh; + if (wpc->ioend) + wpc->ioend->io_list = new; + wpc->ioend = new; } else { - ioend->io_buffer_tail->b_private = bh; - ioend->io_buffer_tail = bh; + wpc->ioend->io_buffer_tail->b_private = bh; + wpc->ioend->io_buffer_tail = bh; } bh->b_private = NULL; - ioend->io_size += bh->b_size; + wpc->ioend->io_size += bh->b_size; + wpc->last_block = bh->b_blocknr; } STATIC void @@ -689,17 +667,15 @@ xfs_convert_page( struct inode *inode, struct page *page, loff_t tindex, - struct xfs_bmbt_irec *imap, - xfs_ioend_t **ioendp, + struct xfs_writepage_ctx *wpc, struct writeback_control *wbc) { struct buffer_head *bh, *head; xfs_off_t end_offset; unsigned long p_offset; - unsigned int type; int len, page_dirty; int count = 0, done = 0, uptodate = 1; - xfs_off_t offset = page_offset(page); + xfs_off_t offset = page_offset(page); if (page->index != tindex) goto fail; @@ -709,7 +685,7 @@ xfs_convert_page( goto fail_unlock_page; if (page->mapping != inode->i_mapping) goto fail_unlock_page; - if (!xfs_check_page_type(page, (*ioendp)->io_type, false)) + if (!xfs_check_page_type(page, wpc->ioend->io_type, false)) goto fail_unlock_page; /* @@ -745,7 +721,7 @@ xfs_convert_page( * writeback. Hence for more optimal IO patterns, we should always * avoid partial page writeback due to multiple mappings on a page here. */ - if (!xfs_imap_valid(inode, imap, end_offset)) + if (!xfs_imap_valid(inode, &wpc->imap, end_offset)) goto fail_unlock_page; len = 1 << inode->i_blkbits; @@ -777,23 +753,22 @@ xfs_convert_page( if (buffer_unwritten(bh) || buffer_delay(bh) || buffer_mapped(bh)) { if (buffer_unwritten(bh)) - type = XFS_IO_UNWRITTEN; + wpc->io_type = XFS_IO_UNWRITTEN; else if (buffer_delay(bh)) - type = XFS_IO_DELALLOC; + wpc->io_type = XFS_IO_DELALLOC; else - type = XFS_IO_OVERWRITE; + wpc->io_type = XFS_IO_OVERWRITE; /* * imap should always be valid because of the above * partial page end_offset check on the imap. */ - ASSERT(xfs_imap_valid(inode, imap, offset)); + ASSERT(xfs_imap_valid(inode, &wpc->imap, offset)); lock_buffer(bh); - if (type != XFS_IO_OVERWRITE) - xfs_map_at_offset(inode, bh, imap, offset); - xfs_add_to_ioend(inode, bh, offset, type, - ioendp, done); + if (wpc->io_type != XFS_IO_OVERWRITE) + xfs_map_at_offset(inode, bh, &wpc->imap, offset); + xfs_add_to_ioend(inode, bh, offset, wpc); page_dirty--; count++; @@ -828,8 +803,7 @@ STATIC void xfs_cluster_write( struct inode *inode, pgoff_t tindex, - struct xfs_bmbt_irec *imap, - xfs_ioend_t **ioendp, + struct xfs_writepage_ctx *wpc, struct writeback_control *wbc, pgoff_t tlast) { @@ -845,7 +819,7 @@ xfs_cluster_write( for (i = 0; i < pagevec_count(&pvec); i++) { done = xfs_convert_page(inode, pvec.pages[i], tindex++, - imap, ioendp, wbc); + wpc, wbc); if (done) break; } @@ -931,6 +905,27 @@ out_invalidate: return; } +static int +xfs_writepage_submit( + struct xfs_writepage_ctx *wpc, + struct writeback_control *wbc, + int status) +{ + struct blk_plug plug; + + /* Reserve log space if we might write beyond the on-disk inode size. */ + if (!status && wpc->ioend && wpc->ioend->io_type != XFS_IO_UNWRITTEN && + xfs_ioend_is_append(wpc->ioend)) + status = xfs_setfilesize_trans_alloc(wpc->ioend); + + if (wpc->iohead) { + blk_start_plug(&plug); + xfs_submit_ioend(wbc, wpc->iohead, status); + blk_finish_plug(&plug); + } + return status; +} + /* * Write out a dirty page. * @@ -940,20 +935,19 @@ out_invalidate: * For any other dirty buffer heads on the page we should flush them. */ STATIC int -xfs_vm_writepage( +xfs_do_writepage( struct page *page, - struct writeback_control *wbc) + struct writeback_control *wbc, + void *data) { + struct xfs_writepage_ctx *wpc = data; struct inode *inode = page->mapping->host; struct buffer_head *bh, *head; - struct xfs_bmbt_irec imap; - xfs_ioend_t *ioend = NULL, *iohead = NULL; loff_t offset; - unsigned int type; __uint64_t end_offset; pgoff_t end_index, last_index; ssize_t len; - int err, imap_valid = 0, uptodate = 1; + int err, uptodate = 1; int count = 0; trace_xfs_writepage(inode, page, 0, 0); @@ -1052,11 +1046,8 @@ xfs_vm_writepage( bh = head = page_buffers(page); offset = page_offset(page); - type = XFS_IO_OVERWRITE; do { - int new_ioend = 0; - if (offset >= end_offset) break; if (!buffer_uptodate(bh)) @@ -1069,24 +1060,24 @@ xfs_vm_writepage( * buffers covering holes here. */ if (!buffer_mapped(bh) && buffer_uptodate(bh)) { - imap_valid = 0; + wpc->imap_valid = false; continue; } if (buffer_unwritten(bh)) { - if (type != XFS_IO_UNWRITTEN) { - type = XFS_IO_UNWRITTEN; - imap_valid = 0; + if (wpc->io_type != XFS_IO_UNWRITTEN) { + wpc->io_type = XFS_IO_UNWRITTEN; + wpc->imap_valid = false; } } else if (buffer_delay(bh)) { - if (type != XFS_IO_DELALLOC) { - type = XFS_IO_DELALLOC; - imap_valid = 0; + if (wpc->io_type != XFS_IO_DELALLOC) { + wpc->io_type = XFS_IO_DELALLOC; + wpc->imap_valid = false; } } else if (buffer_uptodate(bh)) { - if (type != XFS_IO_OVERWRITE) { - type = XFS_IO_OVERWRITE; - imap_valid = 0; + if (wpc->io_type != XFS_IO_OVERWRITE) { + wpc->io_type = XFS_IO_OVERWRITE; + wpc->imap_valid = false; } } else { if (PageUptodate(page)) @@ -1097,38 +1088,31 @@ xfs_vm_writepage( * subsequent writeable buffers into a new * ioend. */ - imap_valid = 0; + wpc->imap_valid = false; continue; } - if (imap_valid) - imap_valid = xfs_imap_valid(inode, &imap, offset); - if (!imap_valid) { - /* - * If we didn't have a valid mapping then we need to - * put the new mapping into a separate ioend structure. - * This ensures non-contiguous extents always have - * separate ioends, which is particularly important - * for unwritten extent conversion at I/O completion - * time. - */ - new_ioend = 1; - err = xfs_map_blocks(inode, offset, &imap, type); + if (wpc->imap_valid) + wpc->imap_valid = xfs_imap_valid(inode, &wpc->imap, + offset); + if (!wpc->imap_valid) { + err = xfs_map_blocks(inode, offset, &wpc->imap, + wpc->io_type); if (err) goto error; - imap_valid = xfs_imap_valid(inode, &imap, offset); + wpc->imap_valid = xfs_imap_valid(inode, &wpc->imap, + offset); } - if (imap_valid) { + if (wpc->imap_valid) { lock_buffer(bh); - if (type != XFS_IO_OVERWRITE) - xfs_map_at_offset(inode, bh, &imap, offset); - xfs_add_to_ioend(inode, bh, offset, type, &ioend, - new_ioend); + if (wpc->io_type != XFS_IO_OVERWRITE) + xfs_map_at_offset(inode, bh, &wpc->imap, offset); + xfs_add_to_ioend(inode, bh, offset, wpc); count++; } - if (!iohead) - iohead = ioend; + if (!wpc->iohead) + wpc->iohead = wpc->ioend; } while (offset += len, ((bh = bh->b_this_page) != head)); @@ -1138,20 +1122,20 @@ xfs_vm_writepage( xfs_start_page_writeback(page, 1, count); /* if there is no IO to be submitted for this page, we are done */ - if (!ioend) + if (!count) return 0; - ASSERT(iohead); + ASSERT(wpc->iohead); /* * Any errors from this point onwards need tobe reported through the IO * completion path as we have marked the initial page as under writeback * and unlocked it. */ - if (imap_valid) { + if (wpc->imap_valid) { xfs_off_t end_index; - end_index = imap.br_startoff + imap.br_blockcount; + end_index = wpc->imap.br_startoff + wpc->imap.br_blockcount; /* to bytes */ end_index <<= inode->i_blkbits; @@ -1163,29 +1147,36 @@ xfs_vm_writepage( if (end_index > last_index) end_index = last_index; - xfs_cluster_write(inode, page->index + 1, &imap, &ioend, - wbc, end_index); + xfs_cluster_write(inode, page->index + 1, wpc, wbc, end_index); } - - /* - * Reserve log space if we might write beyond the on-disk inode size. - */ - err = 0; - if (ioend->io_type != XFS_IO_UNWRITTEN && xfs_ioend_is_append(ioend)) - err = xfs_setfilesize_trans_alloc(ioend); - - xfs_submit_ioend(wbc, iohead, err); - return 0; error: - if (iohead) - xfs_cancel_ioend(iohead); + /* + * We have to fail the iohead here because we buffers locked in the + * ioend chain. If we don't do this, we'll deadlock invalidating the + * page as that tries to lock the buffers on the page. Also, because we + * have set pages under writeback, we have to run IO completion to mark + * the error state of the IO appropriately, so we can't cancel the ioend + * directly here. That means we have to mark this page as under + * writeback if we included any buffers from it in the ioend chain. + */ + if (count) + xfs_start_page_writeback(page, 0, count); + xfs_writepage_submit(wpc, wbc, err); - xfs_aops_discard_page(page); - ClearPageUptodate(page); - unlock_page(page); + /* + * We can only discard the page we had the IO error on if we haven't + * included it in the ioend above. If it has already been errored out, + * the it is unlocked and we can't touch it here. + */ + if (!count) { + xfs_aops_discard_page(page); + ClearPageUptodate(page); + unlock_page(page); + } + mapping_set_error(page->mapping, err); return err; redirty: @@ -1195,12 +1186,36 @@ redirty: } STATIC int +xfs_vm_writepage( + struct page *page, + struct writeback_control *wbc) +{ + struct xfs_writepage_ctx wpc = { + .io_type = XFS_IO_OVERWRITE, + }; + int ret; + + ret = xfs_do_writepage(page, wbc, &wpc); + if (ret) + return ret; + return xfs_writepage_submit(&wpc, wbc, ret); +} + +STATIC int xfs_vm_writepages( struct address_space *mapping, struct writeback_control *wbc) { + struct xfs_writepage_ctx wpc = { + .io_type = XFS_IO_OVERWRITE, + }; + int ret; + xfs_iflags_clear(XFS_I(mapping->host), XFS_ITRUNCATED); - return generic_writepages(mapping, wbc); + ret = write_cache_pages(mapping, wbc, xfs_do_writepage, &wpc); + if (ret) + return ret; + return xfs_writepage_submit(&wpc, wbc, ret); } /* -- 2.5.0 From david@fromorbit.com Mon Feb 8 00:08:33 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=ham version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay2.corp.sgi.com [137.38.102.29]) by oss.sgi.com (Postfix) with ESMTP id BE1C67CA2 for ; Mon, 8 Feb 2016 00:08:33 -0600 (CST) Received: from cuda.sgi.com (cuda2.sgi.com [192.48.176.25]) by relay2.corp.sgi.com (Postfix) with ESMTP id B9A1B304048 for ; Sun, 7 Feb 2016 22:08:33 -0800 (PST) X-ASG-Debug-ID: 1454911707-04cbb04cfb143150001-NocioJ Received: from ipmail06.adl2.internode.on.net (ipmail06.adl2.internode.on.net [150.101.137.129]) by cuda.sgi.com with ESMTP id qRcEQtFQZsxaWZrp for ; Sun, 07 Feb 2016 22:08:27 -0800 (PST) X-Barracuda-Envelope-From: david@fromorbit.com X-Barracuda-Apparent-Source-IP: 150.101.137.129 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: A2DHCwAOMLhWPBATLHldKAECgw8iMG2GY4F4nScCCg8DBoEPileFRIQHFwKFbgSBKE0BAQEBAQEHAQEBAUE/hG8THDskNAUlAwctiBqeIZ4yGIUyiRaCYwtAGIEPBYdTAo8ghUyHe456Ao4+giSCNiguhxuBOAEBAQ Received: from ppp121-44-19-16.lns20.syd4.internode.on.net (HELO dastard) ([121.44.19.16]) by ipmail06.adl2.internode.on.net with ESMTP; 08 Feb 2016 16:37:52 +1030 Received: from dave by dastard with local (Exim 4.80) (envelope-from ) id 1aSezH-0007FY-N0 for xfs@oss.sgi.com; Mon, 08 Feb 2016 17:07:51 +1100 Date: Mon, 8 Feb 2016 17:07:51 +1100 From: Dave Chinner To: xfs@oss.sgi.com Subject: [ANNOUNCE] xfs: for-next branch updated to 4a91310 Message-ID: <20160208060751.GA27429@dastard> X-ASG-Orig-Subj: [ANNOUNCE] xfs: for-next branch updated to 4a91310 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.5.21 (2010-09-15) X-Barracuda-Connect: ipmail06.adl2.internode.on.net[150.101.137.129] X-Barracuda-Start-Time: 1454911707 X-Barracuda-URL: https://192.48.176.25:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-BRTS-Status: 1 X-Barracuda-Spam-Score: 0.00 X-Barracuda-Spam-Status: No, SCORE=0.00 using per-user scores of TAG_LEVEL=1000.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.7 tests= X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.3.26848 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- Hi folks, The for-next branch of the xfs kernel repository at git://git.kernel.org/pub/scm/linux/kernel/git/dgc/linux-xfs.git has just been updated. I've pushed this out with both generic quota and direct Io modifications in it, so if they end up going into another tree expect a rebase of the for-next branch to occur to pull them in from the appropriate trees. There is still a lot of changes pending review to go into this for-next tree, and I'm hoping to get the first part of the rmap/reflink work into it as well, so there's plenty of work still to be done in this cycle.... The new head of the for-next branch is commit: 4a91310 Merge branch 'xfs-misc-fixes-4.6' into for-next New Commits: Brian Foster (2): [60630fe] xfs: clean up unwritten buffers on write failure [af055e3] xfs: fix xfs_log_ticket leak in xfs_end_io() after fs shutdown Carlos Maiolino (1): [be60794] xfs: Split default quota limits by quota type Christoph Hellwig (6): [187372a] direct-io: always call ->end_io if non-NULL [273dda7] xfs: don't use ioends for direct write completions [c19b104] xfs: fold xfs_vm_do_dio into xfs_vm_direct_IO [196328e] xfs: handle errors from ->free_blocks in xfs_btree_kill_iroot [c46ee8a] xfs: factor btree block freeing into a helper [edfd9dd] xfs: move buffer invalidation to xfs_btree_free_block Darrick J. Wong (2): [8e0bd49] xfs: fix endianness error when checking log block crc on big endian platforms [244efea] xfs: move struct xfs_attr_shortform to xfs_da_format.h Dave Chinner (7): [4b680af] xfs: lock rt summary inode on allocation [a204d07] xfs: RT bitmap and summary buffers are not typed [ca4de5c] xfs: RT bitmap and summary buffers need verifiers [e892a10] Merge branch 'xfs-rt-fixes-4.6' into for-next [ec370f5] Merge branch 'xfs-get-next-dquot-4.6' into for-next [0d077b8] Merge branch 'xfs-dio-fix-4.6' into for-next [4a91310] Merge branch 'xfs-misc-fixes-4.6' into for-next Eric Sandeen (8): [3218a3e] quota: remove unused cmd argument from quota_quotaon() [8b37524] quota: add new quotactl Q_XGETNEXTQUOTA [926132c] quota: add new quotactl Q_GETNEXTQUOTA [a484bcd] xfs: don't overflow quota ID when initializing dqblk [4d4d952] xfs: get quota inode from mp & flags rather than dqp [8aa7d37] xfs: Factor xfs_seek_hole_data into helper [296c24e] xfs: wire up Q_XGETNEXTQUOTA / get_nextdqblk [de0b85a] xfs: remove unused function definitions Michal Hocko (1): [18f1df4] xfs: Make xfsaild freezeable again Code Diffstat: fs/dax.c | 9 +- fs/direct-io.c | 9 +- fs/ext4/inode.c | 9 +- fs/ocfs2/aops.c | 7 +- fs/quota/quota.c | 66 +++++++++- fs/xfs/libxfs/xfs_alloc_btree.c | 2 - fs/xfs/libxfs/xfs_attr_sf.h | 16 --- fs/xfs/libxfs/xfs_bmap_btree.c | 1 - fs/xfs/libxfs/xfs_btree.c | 32 +++-- fs/xfs/libxfs/xfs_da_format.h | 16 +++ fs/xfs/libxfs/xfs_ialloc_btree.c | 12 +- fs/xfs/libxfs/xfs_inode_fork.c | 1 + fs/xfs/libxfs/xfs_log_format.h | 2 + fs/xfs/libxfs/xfs_quota_defs.h | 3 +- fs/xfs/libxfs/xfs_rtbitmap.c | 30 ++++- fs/xfs/libxfs/xfs_sb.h | 1 - fs/xfs/libxfs/xfs_shared.h | 1 + fs/xfs/xfs_aops.c | 274 +++++++++++++++------------------------ fs/xfs/xfs_bmap_util.c | 4 +- fs/xfs/xfs_dquot.c | 129 +++++++++++++++--- fs/xfs/xfs_file.c | 82 ++++++++---- fs/xfs/xfs_fsops.h | 1 - fs/xfs/xfs_inode.h | 2 + fs/xfs/xfs_log_recover.c | 9 +- fs/xfs/xfs_mount.h | 1 - fs/xfs/xfs_qm.c | 55 ++++++-- fs/xfs/xfs_qm.h | 48 +++++-- fs/xfs/xfs_qm_syscalls.c | 27 ++-- fs/xfs/xfs_quotaops.c | 36 ++++- fs/xfs/xfs_trace.h | 9 +- fs/xfs/xfs_trans_ail.c | 5 +- fs/xfs/xfs_trans_dquot.c | 15 ++- include/linux/fs.h | 2 +- include/linux/quota.h | 2 + include/uapi/linux/dqblk_xfs.h | 1 + include/uapi/linux/quota.h | 14 ++ 36 files changed, 615 insertions(+), 318 deletions(-) -- Dave Chinner david@fromorbit.com From david@fromorbit.com Mon Feb 8 00:15:22 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=ham version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay2.corp.sgi.com [137.38.102.29]) by oss.sgi.com (Postfix) with ESMTP id 680F87CA3 for ; Mon, 8 Feb 2016 00:15:22 -0600 (CST) Received: from cuda.sgi.com (cuda2.sgi.com [192.48.176.25]) by relay2.corp.sgi.com (Postfix) with ESMTP id 63BD8304048 for ; Sun, 7 Feb 2016 22:15:22 -0800 (PST) X-ASG-Debug-ID: 1454912119-04cbb04cfc143320001-NocioJ Received: from ipmail06.adl2.internode.on.net (ipmail06.adl2.internode.on.net [150.101.137.129]) by cuda.sgi.com with ESMTP id M316dpSCxyNC0igT for ; Sun, 07 Feb 2016 22:15:20 -0800 (PST) X-Barracuda-Envelope-From: david@fromorbit.com X-Barracuda-Apparent-Source-IP: 150.101.137.129 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: A2DcCwATMbhWPBATLHldKAECgw9SbYZjgXidMw8DBotmhUSEBxmFbgICAQECgSRNAQEBAQEBBwEBAQFBP4RCAQEEJxMcIxAIAw4KCSUPBSUDBxoTiBq8KgEBAQcCAR0YhTKEf4QXg0aBDwWNJolPhUyHe4FkjRhEiiiDUoRaKC6HG4E4AQEB Received: from ppp121-44-19-16.lns20.syd4.internode.on.net (HELO dastard) ([121.44.19.16]) by ipmail06.adl2.internode.on.net with ESMTP; 08 Feb 2016 16:45:18 +1030 Received: from dave by dastard with local (Exim 4.80) (envelope-from ) id 1aSf6U-0007G6-5u; Mon, 08 Feb 2016 17:15:18 +1100 Date: Mon, 8 Feb 2016 17:15:18 +1100 From: Dave Chinner To: Jan Kara Cc: linux-fsdevel@vger.kernel.org, ocfs2-devel@oss.oracle.com, Mark Fasheh , Joel Becker , xfs@oss.sgi.com Subject: Re: [PATCH 1/3] quota: Add support for ->get_nextdqblk() for VFS quota Message-ID: <20160208061518.GB27429@dastard> X-ASG-Orig-Subj: Re: [PATCH 1/3] quota: Add support for ->get_nextdqblk() for VFS quota References: <1454596087-6814-1-git-send-email-jack@suse.cz> <1454596087-6814-2-git-send-email-jack@suse.cz> <20160205010519.GJ459@dastard> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20160205010519.GJ459@dastard> User-Agent: Mutt/1.5.21 (2010-09-15) X-Barracuda-Connect: ipmail06.adl2.internode.on.net[150.101.137.129] X-Barracuda-Start-Time: 1454912119 X-Barracuda-URL: https://192.48.176.25:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-BRTS-Status: 1 X-Barracuda-Spam-Score: 0.00 X-Barracuda-Spam-Status: No, SCORE=0.00 using per-user scores of TAG_LEVEL=1000.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.7 tests=BSF_SC0_MISMATCH_TO X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.3.26848 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 0.00 BSF_SC0_MISMATCH_TO Envelope rcpt doesn't match header On Fri, Feb 05, 2016 at 12:05:19PM +1100, Dave Chinner wrote: > On Thu, Feb 04, 2016 at 03:28:05PM +0100, Jan Kara wrote: > > Add infrastructure for supporting get_nextdqblk() callback for VFS > > quotas. Translate the operation into a callback to appropriate > > filesystem and consequently to quota format callback. > > > > Signed-off-by: Jan Kara > > I'm a little confused here. What patchset is this dependent on? i.e. > what introduces the ->get_nextdqblk method? > > The patches I currently have in my XFS working tree introduce this > (quota: add new quotactl Q_XGETNEXTQUOTA) and everythign else is > dependent on this. I looked a coupl eof days ago and I wasnt' able > to find this in your tree. > > I'd much prefer that one of us publish a stable branch with just the > quotactl() infrastructure (i.e. commands and bits up to the > ->get_nextdqblk() callback) that we can then both base the different > subsystem implementations off, rather than one of us having to pull > in a whole tree of changes just to get the one commit we need... Jan, I've posted a stable branch with the quotactl() changes and the XFS implementation here: git://git.kernel.org/pub/scm/linux/kernel/git/dgc/linux-xfs.git xfs-get-next-dquot-4.6 It's currently in the xfs for-next branch for wider testing - I've done this because I want to get all the pending XFS code out into for-next land early in this cycle so I can move on and concentrate on rmap/reflink for the rest of the cycle. If you want to do this through your tree instead of the XFS tree then let me know when you publish a branch with quotactl changes in it so I can rebuild the XFS for-next branch to use that. Alternatively, i can pull the rest of the generic changes in this patch set into the branch I already have, so it's all in one place for ease of testing.... Cheeers, Dave. -- Dave Chinner david@fromorbit.com From david@fromorbit.com Mon Feb 8 00:17:50 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=ham version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay3.corp.sgi.com [198.149.34.15]) by oss.sgi.com (Postfix) with ESMTP id 7E6487CA2 for ; Mon, 8 Feb 2016 00:17:50 -0600 (CST) Received: from cuda.sgi.com (cuda2.sgi.com [192.48.176.25]) by relay3.corp.sgi.com (Postfix) with ESMTP id F2F7EAC001 for ; Sun, 7 Feb 2016 22:17:46 -0800 (PST) X-ASG-Debug-ID: 1454912263-04cbb04cfc143760001-NocioJ Received: from ipmail06.adl2.internode.on.net (ipmail06.adl2.internode.on.net [150.101.137.129]) by cuda.sgi.com with ESMTP id TURK6tkbRBchElBg for ; Sun, 07 Feb 2016 22:17:44 -0800 (PST) X-Barracuda-Envelope-From: david@fromorbit.com X-Barracuda-Apparent-Source-IP: 150.101.137.129 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: A2DcCwBeMrhWPBATLHldKAECgw9SbYZjgXidMw8DBotmhUSEBxmFbgICAQECgSRNAQEBAQEBBwEBAQFBP4RCAQEEOhwjEAgDDgoJJQ8FJQMHGhOIGrwrAQEBBwIBHRiFMoR/h12BDwWWdYVMh3uBZIRDiFWFbohQhFooLohTAQEB Received: from ppp121-44-19-16.lns20.syd4.internode.on.net (HELO dastard) ([121.44.19.16]) by ipmail06.adl2.internode.on.net with ESMTP; 08 Feb 2016 16:47:32 +1030 Received: from dave by dastard with local (Exim 4.80) (envelope-from ) id 1aSf8d-0007GQ-Dz; Mon, 08 Feb 2016 17:17:31 +1100 Date: Mon, 8 Feb 2016 17:17:31 +1100 From: Dave Chinner To: Christoph Hellwig Cc: linux-fsdevel@vger.kernel.org, xfs@oss.sgi.com, linux-ext4@vger.kernel.org, ocfs2-devel@oss.oracle.com Subject: Re: [PATCH 2/3] xfs: don't use ioends for direct write completions Message-ID: <20160208061731.GC27429@dastard> X-ASG-Orig-Subj: Re: [PATCH 2/3] xfs: don't use ioends for direct write completions References: <1454524816-11392-1-git-send-email-hch@lst.de> <1454524816-11392-3-git-send-email-hch@lst.de> <20160208010026.GL31407@dastard> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20160208010026.GL31407@dastard> User-Agent: Mutt/1.5.21 (2010-09-15) X-Barracuda-Connect: ipmail06.adl2.internode.on.net[150.101.137.129] X-Barracuda-Start-Time: 1454912263 X-Barracuda-URL: https://192.48.176.25:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-BRTS-Status: 1 X-Barracuda-Spam-Score: 0.00 X-Barracuda-Spam-Status: No, SCORE=0.00 using per-user scores of TAG_LEVEL=1000.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.7 tests=BSF_SC0_MISMATCH_TO X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.3.26848 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 0.00 BSF_SC0_MISMATCH_TO Envelope rcpt doesn't match header On Mon, Feb 08, 2016 at 12:00:26PM +1100, Dave Chinner wrote: > On Wed, Feb 03, 2016 at 07:40:15PM +0100, Christoph Hellwig wrote: > > We only need to communicate two bits of information to the direct I/O > > completion handler: > > > > (1) do we need to convert any unwritten extents in the range > > (2) do we need to check if we need to update the inode size based > > on the range passed to the completion handler > > > > We can use the private data passed to the get_block handler and the > > completion handler as a simple bitmask to communicate this information > > instead of the current complicated infrastructure reusing the ioends > > from the buffer I/O path, and thus avoiding a memory allocation and > > a context switch for any non-trivial direct write. As a nice side > > effect we also decouple the direct I/O path implementation from that > > of the buffered I/O path. > > > > Signed-off-by: Christoph Hellwig > > Reviewed-by: Brian Foster > > This change is now dependent on the preceeding direct IO API > changes. Do I a) take the DIO API change through the XFS tree, or > b) use the older version of the patch that didn't have this > dependency and let somebody else deal with the API change and merge > issues? > > I'm happy to take the DIO API change through the XFS tree, if that's > the fastest/easiest way to get the necessary DIO subsystem fixes > into the mainline tree for XFS. As such, the for-next tree that I'm > building right now will include the DIO API change patch.... Right now this series is in a stable branch in the XFS tree: git://git.kernel.org/pub/scm/linux/kernel/git/dgc/linux-xfs.git xfs-dio-fix-4.6 If you want to push it through some other tree, please let me know when/where it is committed so I can rebuild the XFS for-next branch appropriately from a stable commit/branch... Cheers, Dave. -- Dave Chinner david@fromorbit.com From hch@lst.de Mon Feb 8 01:31:29 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=ham version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay3.corp.sgi.com [198.149.34.15]) by oss.sgi.com (Postfix) with ESMTP id A645D7CA2 for ; Mon, 8 Feb 2016 01:31:29 -0600 (CST) Received: from cuda.sgi.com (cuda1.sgi.com [192.48.157.11]) by relay3.corp.sgi.com (Postfix) with ESMTP id 48FFEAC002 for ; Sun, 7 Feb 2016 23:31:26 -0800 (PST) X-ASG-Debug-ID: 1454916682-04bdf079c0129710001-NocioJ Received: from newverein.lst.de (verein.lst.de [213.95.11.211]) by cuda.sgi.com with ESMTP id hNXFaDMknq4e2Sgn (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO) for ; Sun, 07 Feb 2016 23:31:24 -0800 (PST) X-Barracuda-Envelope-From: hch@lst.de X-Barracuda-Apparent-Source-IP: 213.95.11.211 Received: by newverein.lst.de (Postfix, from userid 2407) id 0EA15692D7; Mon, 8 Feb 2016 08:31:22 +0100 (CET) Date: Mon, 8 Feb 2016 08:31:21 +0100 From: Christoph Hellwig To: Dave Chinner Cc: Christoph Hellwig , linux-fsdevel@vger.kernel.org, xfs@oss.sgi.com, linux-ext4@vger.kernel.org, ocfs2-devel@oss.oracle.com Subject: Re: [PATCH 2/3] xfs: don't use ioends for direct write completions Message-ID: <20160208073121.GA30092@lst.de> X-ASG-Orig-Subj: Re: [PATCH 2/3] xfs: don't use ioends for direct write completions References: <1454524816-11392-1-git-send-email-hch@lst.de> <1454524816-11392-3-git-send-email-hch@lst.de> <20160208010026.GL31407@dastard> <20160208061731.GC27429@dastard> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20160208061731.GC27429@dastard> User-Agent: Mutt/1.5.17 (2007-11-01) X-Barracuda-Connect: verein.lst.de[213.95.11.211] X-Barracuda-Start-Time: 1454916683 X-Barracuda-Encrypted: ECDHE-RSA-AES256-GCM-SHA384 X-Barracuda-URL: https://192.48.157.11:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-BRTS-Status: 1 X-Barracuda-Spam-Score: 0.00 X-Barracuda-Spam-Status: No, SCORE=0.00 using per-user scores of TAG_LEVEL=1000.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.7 tests=BSF_SC0_MISMATCH_TO X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.3.26850 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 0.00 BSF_SC0_MISMATCH_TO Envelope rcpt doesn't match header On Mon, Feb 08, 2016 at 05:17:31PM +1100, Dave Chinner wrote: > Right now this series is in a stable branch in the XFS tree: > > git://git.kernel.org/pub/scm/linux/kernel/git/dgc/linux-xfs.git xfs-dio-fix-4.6 > > If you want to push it through some other tree, please let me know > when/where it is committed so I can rebuild the XFS for-next branch > appropriately from a stable commit/branch... That's how I think it should be handled. This would also allow the ext4 and ocfs2 maintainers to depend on the stable branch to clean up their direct I/O completion handling in this merge window if they want to. From BATV+ed7a3e778fea2a49c807+4551+infradead.org+hch@bombadil.srs.infradead.org Mon Feb 8 01:36:37 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=ham version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay2.corp.sgi.com [137.38.102.29]) by oss.sgi.com (Postfix) with ESMTP id 23C357CA2 for ; Mon, 8 Feb 2016 01:36:37 -0600 (CST) Received: from cuda.sgi.com (cuda2.sgi.com [192.48.176.25]) by relay2.corp.sgi.com (Postfix) with ESMTP id 210FF304053 for ; Sun, 7 Feb 2016 23:36:33 -0800 (PST) X-ASG-Debug-ID: 1454916991-04cbb04cfc147140001-NocioJ Received: from bombadil.infradead.org ([198.137.202.9]) by cuda.sgi.com with ESMTP id nDfEdPufE7BwEISs (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128 verify=NO) for ; Sun, 07 Feb 2016 23:36:31 -0800 (PST) X-Barracuda-Envelope-From: BATV+ed7a3e778fea2a49c807+4551+infradead.org+hch@bombadil.srs.infradead.org X-Barracuda-Apparent-Source-IP: 198.137.202.9 Received: from hch by bombadil.infradead.org with local (Exim 4.80.1 #2 (Red Hat Linux)) id 1aSgN5-0000iC-5m; Mon, 08 Feb 2016 07:36:31 +0000 Date: Sun, 7 Feb 2016 23:36:31 -0800 From: Christoph Hellwig To: Dave Chinner Cc: xfs@oss.sgi.com Subject: Re: [PATCH 2/4] xfs: Introduce writeback context for writepages Message-ID: <20160208073631.GA1789@infradead.org> X-ASG-Orig-Subj: Re: [PATCH 2/4] xfs: Introduce writeback context for writepages References: <1440479153-1584-1-git-send-email-david@fromorbit.com> <1440479153-1584-3-git-send-email-david@fromorbit.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1440479153-1584-3-git-send-email-david@fromorbit.com> User-Agent: Mutt/1.5.24 (2015-08-30) X-SRS-Rewrite: SMTP reverse-path rewritten from by bombadil.infradead.org See http://www.infradead.org/rpr.html X-Barracuda-Connect: UNKNOWN[198.137.202.9] X-Barracuda-Start-Time: 1454916991 X-Barracuda-Encrypted: ECDHE-RSA-AES128-GCM-SHA256 X-Barracuda-URL: https://192.48.176.25:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-BRTS-Status: 1 X-Barracuda-Spam-Score: 0.10 X-Barracuda-Spam-Status: No, SCORE=0.10 using per-user scores of TAG_LEVEL=1000.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.7 tests=BSF_SC0_MISMATCH_TO, RDNS_NONE X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.3.26850 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 0.00 BSF_SC0_MISMATCH_TO Envelope rcpt doesn't match header 0.10 RDNS_NONE Delivered to trusted network by a host with no rDNS FYI, I recently started testing this series again after a trivial rebase to 4.5-rc2, and this patch seems to cause reproducible failures of generic/311 (fsync tester) From BATV+ed7a3e778fea2a49c807+4551+infradead.org+hch@bombadil.srs.infradead.org Mon Feb 8 01:54:09 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=ham version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay3.corp.sgi.com [198.149.34.15]) by oss.sgi.com (Postfix) with ESMTP id 1F8DB7CA2 for ; Mon, 8 Feb 2016 01:54:09 -0600 (CST) Received: from cuda.sgi.com (cuda3.sgi.com [192.48.176.15]) by relay3.corp.sgi.com (Postfix) with ESMTP id A712AAC001 for ; Sun, 7 Feb 2016 23:54:08 -0800 (PST) X-ASG-Debug-ID: 1454918043-04cb6c274415f360001-NocioJ Received: from bombadil.infradead.org ([198.137.202.9]) by cuda.sgi.com with ESMTP id 9X5Uhc5Fm15DWLrQ (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128 verify=NO) for ; Sun, 07 Feb 2016 23:54:03 -0800 (PST) X-Barracuda-Envelope-From: BATV+ed7a3e778fea2a49c807+4551+infradead.org+hch@bombadil.srs.infradead.org X-Barracuda-Apparent-Source-IP: 198.137.202.9 Received: from hch by bombadil.infradead.org with local (Exim 4.80.1 #2 (Red Hat Linux)) id 1aSge3-0007mG-B7; Mon, 08 Feb 2016 07:54:03 +0000 Date: Sun, 7 Feb 2016 23:54:03 -0800 From: Christoph Hellwig To: Dave Chinner Cc: xfs@oss.sgi.com Subject: Re: [PATCH 2/4] xfs: Introduce writeback context for writepages Message-ID: <20160208075403.GA29242@infradead.org> X-ASG-Orig-Subj: Re: [PATCH 2/4] xfs: Introduce writeback context for writepages References: <1440479153-1584-1-git-send-email-david@fromorbit.com> <1440479153-1584-3-git-send-email-david@fromorbit.com> <20160208073631.GA1789@infradead.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20160208073631.GA1789@infradead.org> User-Agent: Mutt/1.5.24 (2015-08-30) X-SRS-Rewrite: SMTP reverse-path rewritten from by bombadil.infradead.org See http://www.infradead.org/rpr.html X-Barracuda-Connect: UNKNOWN[198.137.202.9] X-Barracuda-Start-Time: 1454918043 X-Barracuda-Encrypted: ECDHE-RSA-AES128-GCM-SHA256 X-Barracuda-URL: https://192.48.176.15:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-BRTS-Status: 1 X-Barracuda-Spam-Score: 0.10 X-Barracuda-Spam-Status: No, SCORE=0.10 using per-user scores of TAG_LEVEL=1000.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.7 tests=BSF_SC0_MISMATCH_TO, RDNS_NONE X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.3.26850 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 0.00 BSF_SC0_MISMATCH_TO Envelope rcpt doesn't match header 0.10 RDNS_NONE Delivered to trusted network by a host with no rDNS On Sun, Feb 07, 2016 at 11:36:31PM -0800, Christoph Hellwig wrote: > FYI, I recently started testing this series again after a trivial > rebase to 4.5-rc2, and this patch seems to cause reproducible failures > of generic/311 (fsync tester) And by coincidence you posted a new version the night before I posted this mail. It still shows that same failure. From dan.j.williams@intel.com Mon Feb 8 02:18:18 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=T_DKIM_INVALID autolearn=ham version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay2.corp.sgi.com [137.38.102.29]) by oss.sgi.com (Postfix) with ESMTP id 2658B7CA2 for ; Mon, 8 Feb 2016 02:18:18 -0600 (CST) Received: from cuda.sgi.com (cuda3.sgi.com [192.48.176.15]) by relay2.corp.sgi.com (Postfix) with ESMTP id 1D6DF304048 for ; Mon, 8 Feb 2016 00:18:14 -0800 (PST) X-ASG-Debug-ID: 1454919492-04cb6c2745160310001-NocioJ Received: from mail-yw0-f182.google.com (mail-yw0-f182.google.com [209.85.161.182]) by cuda.sgi.com with ESMTP id EIirQHNFbBZiojwt (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128 verify=NO) for ; Mon, 08 Feb 2016 00:18:12 -0800 (PST) X-Barracuda-Envelope-From: dan.j.williams@intel.com X-Barracuda-Apparent-Source-IP: 209.85.161.182 Received: by mail-yw0-f182.google.com with SMTP id u200so18168632ywf.0 for ; Mon, 08 Feb 2016 00:18:12 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=intel-com.20150623.gappssmtp.com; s=20150623; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=mSSvzPptj1S6Gy44itSipJzCdyOGrK5ZJ+NzFj+okrE=; b=yrUBM6lFK3yhRgsue3t7iKNyccEUCCHQqASW1UT4UnzOj+D2UVteJEuXtcmRMS6MdE 6udZNtYQ4TDv0XMiDHVdaw+wUrPrNyuu8n3RU2vR6RhVB6yPTSwoiD9Xp69Qw0IHcbDN NjfFrOL29LXjH+Lejp7bje5hXJywM/d7nZ5eMYNdTv15+b+mwgNq3DbEJ9e4YiQrEo5P shlAYwpXKHAmGT3w2xR534agdCL8Sx9Nj9fyyQCYWC0cShdUIckd+w62R2Xlg6KZpRjr 8XTUS6y27ADo10OO0E17UXau/rA8Vu56Y1uq7g/5IwH1e6vuAW7XAw/+1VBO3xNR/sR8 5G8A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:date :message-id:subject:from:to:cc:content-type; bh=mSSvzPptj1S6Gy44itSipJzCdyOGrK5ZJ+NzFj+okrE=; b=Be8CeZaYcoqO/26qR89TRop7WWIO1wj7DC+kc2QU+Y5zRDp5v+atuPmmXicczSc4nx lxqk/5039ZYUgKvtrSWvHCx5rBSLIIN9G7JNYxDQ4n0FZ6aEBEdZBNS5kE6I6h8xdtqg DDmy8T72StSWByy5KyQdAMaieWYFAR/G/uRPhWFNO+Sg1UYngQXq/dj5c6TdfcASxkqQ JOGbIj7ROYQAzrhq+zqqjjn14nQplgj0pIowYS8qU7y43fUp6a5P9SFnUUjyJnM4YRER ut6LOU25Ih8fRlaYpN0xS5X6vj3Yt9OwJYVE+1yDXlGQwab+CQLHZlBr6L/psmuxVrmV 4x0w== X-Gm-Message-State: AG10YOQWw/FsQV2FZgd+3ECTb0GrsTT2Zj4UbAy00+fd4UmKs79FiI/aQoQ84gBJ8g7m+HerChZYvtNf0c7ID/qN MIME-Version: 1.0 X-Received: by 10.129.48.137 with SMTP id w131mr4344003yww.82.1454919491779; Mon, 08 Feb 2016 00:18:11 -0800 (PST) Received: by 10.37.223.199 with HTTP; Mon, 8 Feb 2016 00:18:11 -0800 (PST) In-Reply-To: <20160207215047.GJ31407@dastard> References: <1454829553-29499-1-git-send-email-ross.zwisler@linux.intel.com> <1454829553-29499-3-git-send-email-ross.zwisler@linux.intel.com> <20160207215047.GJ31407@dastard> Date: Mon, 8 Feb 2016 00:18:11 -0800 Message-ID: Subject: Re: [PATCH 2/2] dax: move writeback calls into the filesystems From: Dan Williams X-ASG-Orig-Subj: Re: [PATCH 2/2] dax: move writeback calls into the filesystems To: Dave Chinner Cc: Ross Zwisler , "linux-kernel@vger.kernel.org" , "Theodore Ts'o" , Alexander Viro , Andreas Dilger , Andrew Morton , Jan Kara , Matthew Wilcox , linux-ext4 , linux-fsdevel , Linux MM , "linux-nvdimm@lists.01.org" , XFS Developers , jmoyer Content-Type: text/plain; charset=UTF-8 X-Barracuda-Connect: mail-yw0-f182.google.com[209.85.161.182] X-Barracuda-Start-Time: 1454919492 X-Barracuda-Encrypted: ECDHE-RSA-AES128-GCM-SHA256 X-Barracuda-URL: https://192.48.176.15:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-BRTS-Status: 1 X-Barracuda-Spam-Score: 0.00 X-Barracuda-Spam-Status: No, SCORE=0.00 using per-user scores of TAG_LEVEL=1000.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.7 tests=BSF_SC0_MISMATCH_TO, DKIM_SIGNED, DKIM_VERIFIED X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.3.26851 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 0.00 BSF_SC0_MISMATCH_TO Envelope rcpt doesn't match header -0.00 DKIM_VERIFIED Domain Keys Identified Mail: signature passes verification 0.00 DKIM_SIGNED Domain Keys Identified Mail: message has a signature On Sun, Feb 7, 2016 at 1:50 PM, Dave Chinner wrote: > On Sun, Feb 07, 2016 at 11:13:51AM -0800, Dan Williams wrote: >> On Sat, Feb 6, 2016 at 11:19 PM, Ross Zwisler >> wrote: >> > Previously calls to dax_writeback_mapping_range() for all DAX filesystems >> > (ext2, ext4 & xfs) were centralized in filemap_write_and_wait_range(). >> > dax_writeback_mapping_range() needs a struct block_device, and it used to >> > get that from inode->i_sb->s_bdev. This is correct for normal inodes >> > mounted on ext2, ext4 and XFS filesystems, but is incorrect for DAX raw >> > block devices and for XFS real-time files. >> > >> > Instead, call dax_writeback_mapping_range() directly from the filesystem or >> > raw block device fsync/msync code so that they can supply us with a valid >> > block device. >> > >> > It should be noted that this will reduce the number of calls to >> > dax_writeback_mapping_range() because filemap_write_and_wait_range() is >> > called in the various filesystems for operations other than just >> > fsync/msync. Both ext4 & XFS call filemap_write_and_wait_range() outside >> > of ->fsync for hole punch, truncate, and block relocation >> > (xfs_shift_file_space() && ext4_collapse_range()/ext4_insert_range()). >> > >> > I don't believe that these extra flushes are necessary in the DAX case. In >> > the page cache case when we have dirty data in the page cache, that data >> > will be actively lost if we evict a dirty page cache page without flushing >> > it to media first. For DAX, though, the data will remain consistent with >> > the physical address to which it was written regardless of whether it's in >> > the processor cache or not - really the only reason I see to flush is in >> > response to a fsync or msync so that our data is durable on media in case >> > of a power loss. The case where we could throw dirty data out of the page >> > cache and essentially lose writes simply doesn't exist. >> > >> > Signed-off-by: Ross Zwisler >> > --- >> > fs/block_dev.c | 7 +++++++ >> > fs/dax.c | 5 ++--- >> > fs/ext2/file.c | 10 ++++++++++ >> > fs/ext4/fsync.c | 10 +++++++++- >> > fs/xfs/xfs_file.c | 12 ++++++++++-- >> > include/linux/dax.h | 4 ++-- >> > mm/filemap.c | 6 ------ >> > 7 files changed, 40 insertions(+), 14 deletions(-) >> >> This sprinkling of dax specific fixups outside of vm_operations_struct >> routines still has me thinking that we are going in the wrong >> direction for fsync/msync support. >> >> If an application is both unaware of DAX and doing mmap I/O it is >> better served by the page cache where writeback is durable by default. >> We expect DAX-aware applications to assume responsibility for cpu >> cache management [1]. Making DAX mmap semantics explicit opt-in >> solves not only durability support, but also the current problem that >> DAX gets silently disabled leaving an app to wonder if it really got a >> direct mapping. DAX also silently picks pud, pmd, or pte mappings >> which is information an application would really like to know at map >> time. >> >> The proposal: make applications explicitly request DAX semantics with >> a new MAP_DAX flag and fail if DAX is unavailable. > > No. > > As I've stated before, the entire purpose of enabling DAX through > existing filesytsems like XFS and ext4 is so that existing > applications work with DAX *without modification*. > > That is, applications can be entirely unaware of the fact that the > filesystem is giving them direct access to the storage because the > access and failure semantics of DAX enabled mmap are *identical to > the existing mmap semantics*. > > Given this, the app doesn't need to care whether DAX is enabled or > not; all that will be seen is a difference in speed of access. > Enabling and disabling DAX is, at this point, purely an > administration decision - if the hardware and filesystem supports > it, it can be turned on without having to wait years for application > developers to add support for it.... Setting aside the current block zeroing problem you seem to assuming that DAX will always be faster and that may not be true at a media level. Waiting years for some applications to determine if DAX makes sense for their use case seems completely reasonable. In the meantime the apps that are already making these changes want to know that a DAX mapping request has not silently dropped backed to page cache. They also want to know if they successfully jumped through all the hoops to get a larger than pte mapping. I agree it is useful to be able to force DAX on an unmodified application to see what happens, and it follows that if those applications want to run in that mode they will need functional fsync()... I would feel better if we were talking about specific applications and performance numbers to know if forcing DAX on application is a debug facility or a production level capability. You seem to have already made that determination and I'm curious what I'm missing. From BATV+ed7a3e778fea2a49c807+4551+infradead.org+hch@bombadil.srs.infradead.org Mon Feb 8 02:52:43 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=ham version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay2.corp.sgi.com [137.38.102.29]) by oss.sgi.com (Postfix) with ESMTP id 4F9357CA2 for ; Mon, 8 Feb 2016 02:52:43 -0600 (CST) Received: from cuda.sgi.com (cuda2.sgi.com [192.48.176.25]) by relay2.corp.sgi.com (Postfix) with ESMTP id 1E3FB304043 for ; Mon, 8 Feb 2016 00:52:43 -0800 (PST) X-ASG-Debug-ID: 1454921560-04cbb04cfb14ab30001-NocioJ Received: from bombadil.infradead.org ([198.137.202.9]) by cuda.sgi.com with ESMTP id lhlYE02mifCcEEg2 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128 verify=NO) for ; Mon, 08 Feb 2016 00:52:41 -0800 (PST) X-Barracuda-Envelope-From: BATV+ed7a3e778fea2a49c807+4551+infradead.org+hch@bombadil.srs.infradead.org X-Barracuda-Apparent-Source-IP: 198.137.202.9 Received: from hch by bombadil.infradead.org with local (Exim 4.80.1 #2 (Red Hat Linux)) id 1aShYm-0002FS-Cj; Mon, 08 Feb 2016 08:52:40 +0000 Date: Mon, 8 Feb 2016 00:52:40 -0800 From: Christoph Hellwig To: Dave Chinner Cc: xfs@oss.sgi.com Subject: Re: [PATCH 1/3] metadump: clean up btree block region zeroing Message-ID: <20160208085240.GA5534@infradead.org> X-ASG-Orig-Subj: Re: [PATCH 1/3] metadump: clean up btree block region zeroing References: <1454626858-17823-1-git-send-email-david@fromorbit.com> <1454626858-17823-2-git-send-email-david@fromorbit.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1454626858-17823-2-git-send-email-david@fromorbit.com> User-Agent: Mutt/1.5.24 (2015-08-30) X-SRS-Rewrite: SMTP reverse-path rewritten from by bombadil.infradead.org See http://www.infradead.org/rpr.html X-Barracuda-Connect: UNKNOWN[198.137.202.9] X-Barracuda-Start-Time: 1454921561 X-Barracuda-Encrypted: ECDHE-RSA-AES128-GCM-SHA256 X-Barracuda-URL: https://192.48.176.25:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-Spam-Score: 0.10 X-Barracuda-Spam-Status: No, SCORE=0.10 using per-user scores of TAG_LEVEL=1000.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.7 tests=BSF_SC0_MISMATCH_TO, RDNS_NONE X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.3.26851 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 0.00 BSF_SC0_MISMATCH_TO Envelope rcpt doesn't match header 0.10 RDNS_NONE Delivered to trusted network by a host with no rDNS Looks fine, Reviewed-by: Christoph Hellwig From BATV+ed7a3e778fea2a49c807+4551+infradead.org+hch@bombadil.srs.infradead.org Mon Feb 8 02:53:11 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=ham version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay1.corp.sgi.com [137.38.102.111]) by oss.sgi.com (Postfix) with ESMTP id 8017D7CA2 for ; Mon, 8 Feb 2016 02:53:11 -0600 (CST) Received: from cuda.sgi.com (cuda1.sgi.com [192.48.157.11]) by relay1.corp.sgi.com (Postfix) with ESMTP id 649F98F8035 for ; Mon, 8 Feb 2016 00:53:08 -0800 (PST) X-ASG-Debug-ID: 1454921585-04bdf079c512ff20001-NocioJ Received: from bombadil.infradead.org ([198.137.202.9]) by cuda.sgi.com with ESMTP id Fer7nFlDCdFkkWwd (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128 verify=NO) for ; Mon, 08 Feb 2016 00:53:06 -0800 (PST) X-Barracuda-Envelope-From: BATV+ed7a3e778fea2a49c807+4551+infradead.org+hch@bombadil.srs.infradead.org X-Barracuda-Apparent-Source-IP: 198.137.202.9 Received: from hch by bombadil.infradead.org with local (Exim 4.80.1 #2 (Red Hat Linux)) id 1aShZB-0002RI-Jo; Mon, 08 Feb 2016 08:53:05 +0000 Date: Mon, 8 Feb 2016 00:53:05 -0800 From: Christoph Hellwig To: Dave Chinner Cc: xfs@oss.sgi.com Subject: Re: [PATCH 2/3] metadump: bounds check btree block regions being zeroed Message-ID: <20160208085305.GB5534@infradead.org> X-ASG-Orig-Subj: Re: [PATCH 2/3] metadump: bounds check btree block regions being zeroed References: <1454626858-17823-1-git-send-email-david@fromorbit.com> <1454626858-17823-3-git-send-email-david@fromorbit.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1454626858-17823-3-git-send-email-david@fromorbit.com> User-Agent: Mutt/1.5.24 (2015-08-30) X-SRS-Rewrite: SMTP reverse-path rewritten from by bombadil.infradead.org See http://www.infradead.org/rpr.html X-Barracuda-Connect: UNKNOWN[198.137.202.9] X-Barracuda-Start-Time: 1454921586 X-Barracuda-Encrypted: ECDHE-RSA-AES128-GCM-SHA256 X-Barracuda-URL: https://192.48.157.11:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-Spam-Score: 0.10 X-Barracuda-Spam-Status: No, SCORE=0.10 using per-user scores of TAG_LEVEL=1000.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.7 tests=BSF_SC0_MISMATCH_TO, RDNS_NONE X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.3.26851 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 0.00 BSF_SC0_MISMATCH_TO Envelope rcpt doesn't match header 0.10 RDNS_NONE Delivered to trusted network by a host with no rDNS Looks good, Reviewed-by: Christoph Hellwig From BATV+ed7a3e778fea2a49c807+4551+infradead.org+hch@bombadil.srs.infradead.org Mon Feb 8 02:53:44 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=ham version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay2.corp.sgi.com [137.38.102.29]) by oss.sgi.com (Postfix) with ESMTP id 25A757CA2 for ; Mon, 8 Feb 2016 02:53:44 -0600 (CST) Received: from cuda.sgi.com (cuda3.sgi.com [192.48.176.15]) by relay2.corp.sgi.com (Postfix) with ESMTP id 17F86304053 for ; Mon, 8 Feb 2016 00:53:44 -0800 (PST) X-ASG-Debug-ID: 1454921621-04cb6c2745161a10001-NocioJ Received: from bombadil.infradead.org ([198.137.202.9]) by cuda.sgi.com with ESMTP id b9sx6BeN0CfA4Eul (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128 verify=NO) for ; Mon, 08 Feb 2016 00:53:42 -0800 (PST) X-Barracuda-Envelope-From: BATV+ed7a3e778fea2a49c807+4551+infradead.org+hch@bombadil.srs.infradead.org X-Barracuda-Apparent-Source-IP: 198.137.202.9 Received: from hch by bombadil.infradead.org with local (Exim 4.80.1 #2 (Red Hat Linux)) id 1aShZl-0002gM-ER; Mon, 08 Feb 2016 08:53:41 +0000 Date: Mon, 8 Feb 2016 00:53:41 -0800 From: Christoph Hellwig To: Dave Chinner Cc: xfs@oss.sgi.com Subject: Re: [PATCH 3/3] xfs_mdrestore: correctly account bytes read Message-ID: <20160208085341.GC5534@infradead.org> X-ASG-Orig-Subj: Re: [PATCH 3/3] xfs_mdrestore: correctly account bytes read References: <1454626858-17823-1-git-send-email-david@fromorbit.com> <1454626858-17823-4-git-send-email-david@fromorbit.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1454626858-17823-4-git-send-email-david@fromorbit.com> User-Agent: Mutt/1.5.24 (2015-08-30) X-SRS-Rewrite: SMTP reverse-path rewritten from by bombadil.infradead.org See http://www.infradead.org/rpr.html X-Barracuda-Connect: UNKNOWN[198.137.202.9] X-Barracuda-Start-Time: 1454921621 X-Barracuda-Encrypted: ECDHE-RSA-AES128-GCM-SHA256 X-Barracuda-URL: https://192.48.176.15:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-Spam-Score: 0.10 X-Barracuda-Spam-Status: No, SCORE=0.10 using per-user scores of TAG_LEVEL=1000.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.7 tests=BSF_SC0_MISMATCH_TO, RDNS_NONE X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.3.26851 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 0.00 BSF_SC0_MISMATCH_TO Envelope rcpt doesn't match header 0.10 RDNS_NONE Delivered to trusted network by a host with no rDNS Looks good, Reviewed-by: Christoph Hellwig From BATV+ed7a3e778fea2a49c807+4551+infradead.org+hch@bombadil.srs.infradead.org Mon Feb 8 02:55:57 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=ham version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay1.corp.sgi.com [137.38.102.111]) by oss.sgi.com (Postfix) with ESMTP id 7636A7CA2 for ; Mon, 8 Feb 2016 02:55:57 -0600 (CST) Received: from cuda.sgi.com (cuda2.sgi.com [192.48.176.25]) by relay1.corp.sgi.com (Postfix) with ESMTP id 56DF48F8035 for ; Mon, 8 Feb 2016 00:55:57 -0800 (PST) X-ASG-Debug-ID: 1454921755-04cbb04cfa14ac20001-NocioJ Received: from bombadil.infradead.org ([198.137.202.9]) by cuda.sgi.com with ESMTP id WIkR2mRXPEqIbnTY (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128 verify=NO) for ; Mon, 08 Feb 2016 00:55:55 -0800 (PST) X-Barracuda-Envelope-From: BATV+ed7a3e778fea2a49c807+4551+infradead.org+hch@bombadil.srs.infradead.org X-Barracuda-Apparent-Source-IP: 198.137.202.9 Received: from hch by bombadil.infradead.org with local (Exim 4.80.1 #2 (Red Hat Linux)) id 1aShbv-0005Ww-7t; Mon, 08 Feb 2016 08:55:55 +0000 Date: Mon, 8 Feb 2016 00:55:55 -0800 From: Christoph Hellwig To: Dave Chinner Cc: xfs@oss.sgi.com Subject: Re: [PATCH 1/7] repair: parallelise phase 7 Message-ID: <20160208085555.GD5534@infradead.org> X-ASG-Orig-Subj: Re: [PATCH 1/7] repair: parallelise phase 7 References: <1454627108-19036-1-git-send-email-david@fromorbit.com> <1454627108-19036-2-git-send-email-david@fromorbit.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1454627108-19036-2-git-send-email-david@fromorbit.com> User-Agent: Mutt/1.5.24 (2015-08-30) X-SRS-Rewrite: SMTP reverse-path rewritten from by bombadil.infradead.org See http://www.infradead.org/rpr.html X-Barracuda-Connect: UNKNOWN[198.137.202.9] X-Barracuda-Start-Time: 1454921755 X-Barracuda-Encrypted: ECDHE-RSA-AES128-GCM-SHA256 X-Barracuda-URL: https://192.48.176.25:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-BRTS-Status: 1 X-Barracuda-Spam-Score: 0.10 X-Barracuda-Spam-Status: No, SCORE=0.10 using per-user scores of TAG_LEVEL=1000.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.7 tests=BSF_SC0_MISMATCH_TO, RDNS_NONE X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.3.26851 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 0.00 BSF_SC0_MISMATCH_TO Envelope rcpt doesn't match header 0.10 RDNS_NONE Delivered to trusted network by a host with no rDNS > + irec = findfirst_inode_rec(agno); > + > + while (irec != NULL) { > + for (j = 0; j < XFS_INODES_PER_CHUNK; j++) { > + ASSERT(is_inode_confirmed(irec, j)); > + > + if (is_inode_free(irec, j)) > + continue; > + > + ASSERT(no_modify || is_inode_reached(irec, j)); > + > + nrefs = num_inode_references(irec, j); > + ASSERT(no_modify || nrefs > 0); > + > + if (get_inode_disk_nlinks(irec, j) != nrefs) > + update_inode_nlinks(wq->mp, > + XFS_AGINO_TO_INO(wq->mp, agno, > + irec->ino_startnum + j), > + nrefs); > + } > + irec = next_ino_rec(irec); Wouldn't this look be slightly cleaner as: for (irec = findfirst_inode_rec(agno); irec; irec = next_ino_rec(irec)) { ? Otherwise looks fine, Reviewed-by: Christoph Hellwig From BATV+ed7a3e778fea2a49c807+4551+infradead.org+hch@bombadil.srs.infradead.org Mon Feb 8 02:58:28 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=ham version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay3.corp.sgi.com [198.149.34.15]) by oss.sgi.com (Postfix) with ESMTP id C14877CA2 for ; Mon, 8 Feb 2016 02:58:28 -0600 (CST) Received: from cuda.sgi.com (cuda1.sgi.com [192.48.157.11]) by relay3.corp.sgi.com (Postfix) with ESMTP id 7167CAC001 for ; Mon, 8 Feb 2016 00:58:28 -0800 (PST) X-ASG-Debug-ID: 1454921906-04bdf079c11311e0001-NocioJ Received: from bombadil.infradead.org ([198.137.202.9]) by cuda.sgi.com with ESMTP id cFDULG906MEViGlD (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128 verify=NO) for ; Mon, 08 Feb 2016 00:58:26 -0800 (PST) X-Barracuda-Envelope-From: BATV+ed7a3e778fea2a49c807+4551+infradead.org+hch@bombadil.srs.infradead.org X-Barracuda-Apparent-Source-IP: 198.137.202.9 Received: from hch by bombadil.infradead.org with local (Exim 4.80.1 #2 (Red Hat Linux)) id 1aSheM-000785-4H; Mon, 08 Feb 2016 08:58:26 +0000 Date: Mon, 8 Feb 2016 00:58:26 -0800 From: Christoph Hellwig To: Dave Chinner Cc: xfs@oss.sgi.com Subject: Re: [PATCH 2/7] repair: parallelise uncertin inode processing in phase 3 Message-ID: <20160208085826.GE5534@infradead.org> X-ASG-Orig-Subj: Re: [PATCH 2/7] repair: parallelise uncertin inode processing in phase 3 References: <1454627108-19036-1-git-send-email-david@fromorbit.com> <1454627108-19036-3-git-send-email-david@fromorbit.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1454627108-19036-3-git-send-email-david@fromorbit.com> User-Agent: Mutt/1.5.24 (2015-08-30) X-SRS-Rewrite: SMTP reverse-path rewritten from by bombadil.infradead.org See http://www.infradead.org/rpr.html X-Barracuda-Connect: UNKNOWN[198.137.202.9] X-Barracuda-Start-Time: 1454921906 X-Barracuda-Encrypted: ECDHE-RSA-AES128-GCM-SHA256 X-Barracuda-URL: https://192.48.157.11:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-Spam-Score: 0.10 X-Barracuda-Spam-Status: No, SCORE=0.10 using per-user scores of TAG_LEVEL=1000.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.7 tests=BSF_SC0_MISMATCH_TO, RDNS_NONE X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.3.26851 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 0.00 BSF_SC0_MISMATCH_TO Envelope rcpt doesn't match header 0.10 RDNS_NONE Delivered to trusted network by a host with no rDNS Looks fine, Reviewed-by: Christoph Hellwig From BATV+ed7a3e778fea2a49c807+4551+infradead.org+hch@bombadil.srs.infradead.org Mon Feb 8 03:00:27 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=ham version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay3.corp.sgi.com [198.149.34.15]) by oss.sgi.com (Postfix) with ESMTP id 7A9C87CA2 for ; Mon, 8 Feb 2016 03:00:27 -0600 (CST) Received: from cuda.sgi.com (cuda1.sgi.com [192.48.157.11]) by relay3.corp.sgi.com (Postfix) with ESMTP id 260A0AC002 for ; Mon, 8 Feb 2016 01:00:27 -0800 (PST) X-ASG-Debug-ID: 1454922014-04bdf079c1131550001-NocioJ Received: from bombadil.infradead.org ([198.137.202.9]) by cuda.sgi.com with ESMTP id a3JNnCsxpPHqMmQS (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128 verify=NO) for ; Mon, 08 Feb 2016 01:00:14 -0800 (PST) X-Barracuda-Envelope-From: BATV+ed7a3e778fea2a49c807+4551+infradead.org+hch@bombadil.srs.infradead.org X-Barracuda-Apparent-Source-IP: 198.137.202.9 Received: from hch by bombadil.infradead.org with local (Exim 4.80.1 #2 (Red Hat Linux)) id 1aShg5-00007H-Mn; Mon, 08 Feb 2016 09:00:13 +0000 Date: Mon, 8 Feb 2016 01:00:13 -0800 From: Christoph Hellwig To: Dave Chinner Cc: xfs@oss.sgi.com Subject: Re: [PATCH 3/7] libxfs: directory node splitting does not have an extra block Message-ID: <20160208090013.GF5534@infradead.org> X-ASG-Orig-Subj: Re: [PATCH 3/7] libxfs: directory node splitting does not have an extra block References: <1454627108-19036-1-git-send-email-david@fromorbit.com> <1454627108-19036-4-git-send-email-david@fromorbit.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1454627108-19036-4-git-send-email-david@fromorbit.com> User-Agent: Mutt/1.5.24 (2015-08-30) X-SRS-Rewrite: SMTP reverse-path rewritten from by bombadil.infradead.org See http://www.infradead.org/rpr.html X-Barracuda-Connect: UNKNOWN[198.137.202.9] X-Barracuda-Start-Time: 1454922014 X-Barracuda-Encrypted: ECDHE-RSA-AES128-GCM-SHA256 X-Barracuda-URL: https://192.48.157.11:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-Spam-Score: 0.10 X-Barracuda-Spam-Status: No, SCORE=0.10 using per-user scores of TAG_LEVEL=1000.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.7 tests=BSF_SC0_MISMATCH_TO, RDNS_NONE X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.3.26851 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 0.00 BSF_SC0_MISMATCH_TO Envelope rcpt doesn't match header 0.10 RDNS_NONE Delivered to trusted network by a host with no rDNS Looks fine, Reviewed-by: Christoph Hellwig From BATV+ed7a3e778fea2a49c807+4551+infradead.org+hch@bombadil.srs.infradead.org Mon Feb 8 03:03:20 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=ham version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay3.corp.sgi.com [198.149.34.15]) by oss.sgi.com (Postfix) with ESMTP id 708077CA2 for ; Mon, 8 Feb 2016 03:03:20 -0600 (CST) Received: from cuda.sgi.com (cuda3.sgi.com [192.48.176.15]) by relay3.corp.sgi.com (Postfix) with ESMTP id 02183AC001 for ; Mon, 8 Feb 2016 01:03:16 -0800 (PST) X-ASG-Debug-ID: 1454922192-04cb6c2746162280001-NocioJ Received: from bombadil.infradead.org ([198.137.202.9]) by cuda.sgi.com with ESMTP id Abqgky6Ejmi46bsk (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128 verify=NO) for ; Mon, 08 Feb 2016 01:03:12 -0800 (PST) X-Barracuda-Envelope-From: BATV+ed7a3e778fea2a49c807+4551+infradead.org+hch@bombadil.srs.infradead.org X-Barracuda-Apparent-Source-IP: 198.137.202.9 Received: from hch by bombadil.infradead.org with local (Exim 4.80.1 #2 (Red Hat Linux)) id 1aShix-0000tF-V8; Mon, 08 Feb 2016 09:03:11 +0000 Date: Mon, 8 Feb 2016 01:03:11 -0800 From: Christoph Hellwig To: Dave Chinner Cc: xfs@oss.sgi.com Subject: Re: [PATCH 4/7] libxfs: don't discard dirty buffers Message-ID: <20160208090311.GG5534@infradead.org> X-ASG-Orig-Subj: Re: [PATCH 4/7] libxfs: don't discard dirty buffers References: <1454627108-19036-1-git-send-email-david@fromorbit.com> <1454627108-19036-5-git-send-email-david@fromorbit.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1454627108-19036-5-git-send-email-david@fromorbit.com> User-Agent: Mutt/1.5.24 (2015-08-30) X-SRS-Rewrite: SMTP reverse-path rewritten from by bombadil.infradead.org See http://www.infradead.org/rpr.html X-Barracuda-Connect: UNKNOWN[198.137.202.9] X-Barracuda-Start-Time: 1454922192 X-Barracuda-Encrypted: ECDHE-RSA-AES128-GCM-SHA256 X-Barracuda-URL: https://192.48.176.15:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-BRTS-Status: 1 X-Barracuda-Spam-Score: 0.10 X-Barracuda-Spam-Status: No, SCORE=0.10 using per-user scores of TAG_LEVEL=1000.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.7 tests=BSF_SC0_MISMATCH_TO, RDNS_NONE X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.3.26851 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 0.00 BSF_SC0_MISMATCH_TO Envelope rcpt doesn't match header 0.10 RDNS_NONE Delivered to trusted network by a host with no rDNS > - xfs_buf_t *bp = (xfs_buf_t *)node; > + struct xfs_buf *bp = (struct xfs_buf *)node; I'd much prefer to use container_of here (although it seems that currently only exists under the name list_entry in xfsprogs). But I guess that's better left for a later patch.. Otherwise looks fine, Reviewed-by: Christoph Hellwig From BATV+ed7a3e778fea2a49c807+4551+infradead.org+hch@bombadil.srs.infradead.org Mon Feb 8 03:03:53 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=ham version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay3.corp.sgi.com [198.149.34.15]) by oss.sgi.com (Postfix) with ESMTP id B95607CA2 for ; Mon, 8 Feb 2016 03:03:53 -0600 (CST) Received: from cuda.sgi.com (cuda2.sgi.com [192.48.176.25]) by relay3.corp.sgi.com (Postfix) with ESMTP id 49814AC004 for ; Mon, 8 Feb 2016 01:03:53 -0800 (PST) X-ASG-Debug-ID: 1454922231-04cbb04cf914b3b0001-NocioJ Received: from bombadil.infradead.org ([198.137.202.9]) by cuda.sgi.com with ESMTP id zgBMq7oNC86ViYpZ (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128 verify=NO) for ; Mon, 08 Feb 2016 01:03:51 -0800 (PST) X-Barracuda-Envelope-From: BATV+ed7a3e778fea2a49c807+4551+infradead.org+hch@bombadil.srs.infradead.org X-Barracuda-Apparent-Source-IP: 198.137.202.9 Received: from hch by bombadil.infradead.org with local (Exim 4.80.1 #2 (Red Hat Linux)) id 1aShjb-00013k-4t; Mon, 08 Feb 2016 09:03:51 +0000 Date: Mon, 8 Feb 2016 01:03:51 -0800 From: Christoph Hellwig To: Dave Chinner Cc: xfs@oss.sgi.com Subject: Re: [PATCH 5/7] libxfs: don't repeatedly shake unwritable buffers Message-ID: <20160208090351.GH5534@infradead.org> X-ASG-Orig-Subj: Re: [PATCH 5/7] libxfs: don't repeatedly shake unwritable buffers References: <1454627108-19036-1-git-send-email-david@fromorbit.com> <1454627108-19036-6-git-send-email-david@fromorbit.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1454627108-19036-6-git-send-email-david@fromorbit.com> User-Agent: Mutt/1.5.24 (2015-08-30) X-SRS-Rewrite: SMTP reverse-path rewritten from by bombadil.infradead.org See http://www.infradead.org/rpr.html X-Barracuda-Connect: UNKNOWN[198.137.202.9] X-Barracuda-Start-Time: 1454922231 X-Barracuda-Encrypted: ECDHE-RSA-AES128-GCM-SHA256 X-Barracuda-URL: https://192.48.176.25:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-Spam-Score: 0.10 X-Barracuda-Spam-Status: No, SCORE=0.10 using per-user scores of TAG_LEVEL=1000.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.7 tests=BSF_SC0_MISMATCH_TO, RDNS_NONE X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.3.26851 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 0.00 BSF_SC0_MISMATCH_TO Envelope rcpt doesn't match header 0.10 RDNS_NONE Delivered to trusted network by a host with no rDNS Looks good, Reviewed-by: Christoph Hellwig From BATV+ed7a3e778fea2a49c807+4551+infradead.org+hch@bombadil.srs.infradead.org Mon Feb 8 03:04:55 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=ham version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay2.corp.sgi.com [137.38.102.29]) by oss.sgi.com (Postfix) with ESMTP id 56D447CA2 for ; Mon, 8 Feb 2016 03:04:55 -0600 (CST) Received: from cuda.sgi.com (cuda2.sgi.com [192.48.176.25]) by relay2.corp.sgi.com (Postfix) with ESMTP id 4916F304043 for ; Mon, 8 Feb 2016 01:04:52 -0800 (PST) X-ASG-Debug-ID: 1454922290-04cbb04cf914b3e0001-NocioJ Received: from bombadil.infradead.org ([198.137.202.9]) by cuda.sgi.com with ESMTP id zFe4MY0d11venA4q (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128 verify=NO) for ; Mon, 08 Feb 2016 01:04:51 -0800 (PST) X-Barracuda-Envelope-From: BATV+ed7a3e778fea2a49c807+4551+infradead.org+hch@bombadil.srs.infradead.org X-Barracuda-Apparent-Source-IP: 198.137.202.9 Received: from hch by bombadil.infradead.org with local (Exim 4.80.1 #2 (Red Hat Linux)) id 1aShkY-0001FG-Lg; Mon, 08 Feb 2016 09:04:50 +0000 Date: Mon, 8 Feb 2016 01:04:50 -0800 From: Christoph Hellwig To: Dave Chinner Cc: xfs@oss.sgi.com Subject: Re: [PATCH 1/6] xfs: remove XBF_DONE flag wrapper macros Message-ID: <20160208090450.GI5534@infradead.org> X-ASG-Orig-Subj: Re: [PATCH 1/6] xfs: remove XBF_DONE flag wrapper macros References: <1454632683-20543-1-git-send-email-david@fromorbit.com> <1454632683-20543-2-git-send-email-david@fromorbit.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1454632683-20543-2-git-send-email-david@fromorbit.com> User-Agent: Mutt/1.5.24 (2015-08-30) X-SRS-Rewrite: SMTP reverse-path rewritten from by bombadil.infradead.org See http://www.infradead.org/rpr.html X-Barracuda-Connect: UNKNOWN[198.137.202.9] X-Barracuda-Start-Time: 1454922291 X-Barracuda-Encrypted: ECDHE-RSA-AES128-GCM-SHA256 X-Barracuda-URL: https://192.48.176.25:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-Spam-Score: 0.10 X-Barracuda-Spam-Status: No, SCORE=0.10 using per-user scores of TAG_LEVEL=1000.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.7 tests=BSF_SC0_MISMATCH_TO, RDNS_NONE X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.3.26851 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 0.00 BSF_SC0_MISMATCH_TO Envelope rcpt doesn't match header 0.10 RDNS_NONE Delivered to trusted network by a host with no rDNS Looks fine, Reviewed-by: Christoph Hellwig From BATV+ed7a3e778fea2a49c807+4551+infradead.org+hch@bombadil.srs.infradead.org Mon Feb 8 03:05:27 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=ham version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay1.corp.sgi.com [137.38.102.111]) by oss.sgi.com (Postfix) with ESMTP id C82727CA2 for ; Mon, 8 Feb 2016 03:05:27 -0600 (CST) Received: from cuda.sgi.com (cuda1.sgi.com [192.48.157.11]) by relay1.corp.sgi.com (Postfix) with ESMTP id AC3AD8F8033 for ; Mon, 8 Feb 2016 01:05:24 -0800 (PST) X-ASG-Debug-ID: 1454922322-04bdf079c5131920001-NocioJ Received: from bombadil.infradead.org ([198.137.202.9]) by cuda.sgi.com with ESMTP id 1BrkgayBmFWK6rtC (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128 verify=NO) for ; Mon, 08 Feb 2016 01:05:23 -0800 (PST) X-Barracuda-Envelope-From: BATV+ed7a3e778fea2a49c807+4551+infradead.org+hch@bombadil.srs.infradead.org X-Barracuda-Apparent-Source-IP: 198.137.202.9 Received: from hch by bombadil.infradead.org with local (Exim 4.80.1 #2 (Red Hat Linux)) id 1aShl4-0002Uu-IS; Mon, 08 Feb 2016 09:05:22 +0000 Date: Mon, 8 Feb 2016 01:05:22 -0800 From: Christoph Hellwig To: Dave Chinner Cc: xfs@oss.sgi.com Subject: Re: [PATCH 2/6] xfs: remove XBF_ASYNC flag wrapper macros Message-ID: <20160208090522.GJ5534@infradead.org> X-ASG-Orig-Subj: Re: [PATCH 2/6] xfs: remove XBF_ASYNC flag wrapper macros References: <1454632683-20543-1-git-send-email-david@fromorbit.com> <1454632683-20543-3-git-send-email-david@fromorbit.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1454632683-20543-3-git-send-email-david@fromorbit.com> User-Agent: Mutt/1.5.24 (2015-08-30) X-SRS-Rewrite: SMTP reverse-path rewritten from by bombadil.infradead.org See http://www.infradead.org/rpr.html X-Barracuda-Connect: UNKNOWN[198.137.202.9] X-Barracuda-Start-Time: 1454922323 X-Barracuda-Encrypted: ECDHE-RSA-AES128-GCM-SHA256 X-Barracuda-URL: https://192.48.157.11:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-Spam-Score: 0.10 X-Barracuda-Spam-Status: No, SCORE=0.10 using per-user scores of TAG_LEVEL=1000.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.7 tests=BSF_SC0_MISMATCH_TO, RDNS_NONE X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.3.26851 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 0.00 BSF_SC0_MISMATCH_TO Envelope rcpt doesn't match header 0.10 RDNS_NONE Delivered to trusted network by a host with no rDNS Looks good, Reviewed-by: Christoph Hellwig From BATV+ed7a3e778fea2a49c807+4551+infradead.org+hch@bombadil.srs.infradead.org Mon Feb 8 03:05:42 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=ham version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay1.corp.sgi.com [137.38.102.111]) by oss.sgi.com (Postfix) with ESMTP id 1E6FA7CA2 for ; Mon, 8 Feb 2016 03:05:42 -0600 (CST) Received: from cuda.sgi.com (cuda1.sgi.com [192.48.157.11]) by relay1.corp.sgi.com (Postfix) with ESMTP id 017BA8F8049 for ; Mon, 8 Feb 2016 01:05:42 -0800 (PST) X-ASG-Debug-ID: 1454922339-04bdf079c3131a00001-NocioJ Received: from bombadil.infradead.org ([198.137.202.9]) by cuda.sgi.com with ESMTP id sVWI0Bi2nfrF8TGI (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128 verify=NO) for ; Mon, 08 Feb 2016 01:05:40 -0800 (PST) X-Barracuda-Envelope-From: BATV+ed7a3e778fea2a49c807+4551+infradead.org+hch@bombadil.srs.infradead.org X-Barracuda-Apparent-Source-IP: 198.137.202.9 Received: from hch by bombadil.infradead.org with local (Exim 4.80.1 #2 (Red Hat Linux)) id 1aShlL-0002aM-Gx; Mon, 08 Feb 2016 09:05:39 +0000 Date: Mon, 8 Feb 2016 01:05:39 -0800 From: Christoph Hellwig To: Dave Chinner Cc: xfs@oss.sgi.com Subject: Re: [PATCH 3/6] xfs: remove XBF_READ flag wrapper macros Message-ID: <20160208090539.GK5534@infradead.org> X-ASG-Orig-Subj: Re: [PATCH 3/6] xfs: remove XBF_READ flag wrapper macros References: <1454632683-20543-1-git-send-email-david@fromorbit.com> <1454632683-20543-4-git-send-email-david@fromorbit.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1454632683-20543-4-git-send-email-david@fromorbit.com> User-Agent: Mutt/1.5.24 (2015-08-30) X-SRS-Rewrite: SMTP reverse-path rewritten from by bombadil.infradead.org See http://www.infradead.org/rpr.html X-Barracuda-Connect: UNKNOWN[198.137.202.9] X-Barracuda-Start-Time: 1454922339 X-Barracuda-Encrypted: ECDHE-RSA-AES128-GCM-SHA256 X-Barracuda-URL: https://192.48.157.11:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-Spam-Score: 0.10 X-Barracuda-Spam-Status: No, SCORE=0.10 using per-user scores of TAG_LEVEL=1000.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.7 tests=BSF_SC0_MISMATCH_TO, RDNS_NONE X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.3.26851 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 0.00 BSF_SC0_MISMATCH_TO Envelope rcpt doesn't match header 0.10 RDNS_NONE Delivered to trusted network by a host with no rDNS Looks good, Reviewed-by: Christoph Hellwig From BATV+ed7a3e778fea2a49c807+4551+infradead.org+hch@bombadil.srs.infradead.org Mon Feb 8 03:07:01 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=ham version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay3.corp.sgi.com [198.149.34.15]) by oss.sgi.com (Postfix) with ESMTP id 17BBC7CA2 for ; Mon, 8 Feb 2016 03:07:01 -0600 (CST) Received: from cuda.sgi.com (cuda2.sgi.com [192.48.176.25]) by relay3.corp.sgi.com (Postfix) with ESMTP id 99D26AC002 for ; Mon, 8 Feb 2016 01:07:00 -0800 (PST) X-ASG-Debug-ID: 1454922418-04cbb04cfc14b4c0001-NocioJ Received: from bombadil.infradead.org ([198.137.202.9]) by cuda.sgi.com with ESMTP id uBJ2gmegg4k0WGeF (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128 verify=NO) for ; Mon, 08 Feb 2016 01:06:58 -0800 (PST) X-Barracuda-Envelope-From: BATV+ed7a3e778fea2a49c807+4551+infradead.org+hch@bombadil.srs.infradead.org X-Barracuda-Apparent-Source-IP: 198.137.202.9 Received: from hch by bombadil.infradead.org with local (Exim 4.80.1 #2 (Red Hat Linux)) id 1aShmc-0002yM-8Q; Mon, 08 Feb 2016 09:06:58 +0000 Date: Mon, 8 Feb 2016 01:06:58 -0800 From: Christoph Hellwig To: Dave Chinner Cc: xfs@oss.sgi.com Subject: Re: [PATCH 4/6] xfs: remove XBF_WRITE flag wrapper macros Message-ID: <20160208090658.GL5534@infradead.org> X-ASG-Orig-Subj: Re: [PATCH 4/6] xfs: remove XBF_WRITE flag wrapper macros References: <1454632683-20543-1-git-send-email-david@fromorbit.com> <1454632683-20543-5-git-send-email-david@fromorbit.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1454632683-20543-5-git-send-email-david@fromorbit.com> User-Agent: Mutt/1.5.24 (2015-08-30) X-SRS-Rewrite: SMTP reverse-path rewritten from by bombadil.infradead.org See http://www.infradead.org/rpr.html X-Barracuda-Connect: UNKNOWN[198.137.202.9] X-Barracuda-Start-Time: 1454922418 X-Barracuda-Encrypted: ECDHE-RSA-AES128-GCM-SHA256 X-Barracuda-URL: https://192.48.176.25:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-Spam-Score: 0.10 X-Barracuda-Spam-Status: No, SCORE=0.10 using per-user scores of TAG_LEVEL=1000.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.7 tests=BSF_SC0_MISMATCH_TO, RDNS_NONE X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.3.26851 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 0.00 BSF_SC0_MISMATCH_TO Envelope rcpt doesn't match header 0.10 RDNS_NONE Delivered to trusted network by a host with no rDNS Looks good, Reviewed-by: Christoph Hellwig From BATV+ed7a3e778fea2a49c807+4551+infradead.org+hch@bombadil.srs.infradead.org Mon Feb 8 03:07:42 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=ham version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay3.corp.sgi.com [198.149.34.15]) by oss.sgi.com (Postfix) with ESMTP id F2E997CA2 for ; Mon, 8 Feb 2016 03:07:41 -0600 (CST) Received: from cuda.sgi.com (cuda1.sgi.com [192.48.157.11]) by relay3.corp.sgi.com (Postfix) with ESMTP id 95013AC001 for ; Mon, 8 Feb 2016 01:07:41 -0800 (PST) X-ASG-Debug-ID: 1454922455-04bdf079c1131b50001-NocioJ Received: from bombadil.infradead.org ([198.137.202.9]) by cuda.sgi.com with ESMTP id LMe8qbCIAr9oz3zo (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128 verify=NO) for ; Mon, 08 Feb 2016 01:07:35 -0800 (PST) X-Barracuda-Envelope-From: BATV+ed7a3e778fea2a49c807+4551+infradead.org+hch@bombadil.srs.infradead.org X-Barracuda-Apparent-Source-IP: 198.137.202.9 Received: from hch by bombadil.infradead.org with local (Exim 4.80.1 #2 (Red Hat Linux)) id 1aShnC-00039X-TO; Mon, 08 Feb 2016 09:07:34 +0000 Date: Mon, 8 Feb 2016 01:07:34 -0800 From: Christoph Hellwig To: Dave Chinner Cc: xfs@oss.sgi.com Subject: Re: [PATCH 5/6] xfs: remove XBF_STALE flag wrapper macros Message-ID: <20160208090734.GM5534@infradead.org> X-ASG-Orig-Subj: Re: [PATCH 5/6] xfs: remove XBF_STALE flag wrapper macros References: <1454632683-20543-1-git-send-email-david@fromorbit.com> <1454632683-20543-6-git-send-email-david@fromorbit.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1454632683-20543-6-git-send-email-david@fromorbit.com> User-Agent: Mutt/1.5.24 (2015-08-30) X-SRS-Rewrite: SMTP reverse-path rewritten from by bombadil.infradead.org See http://www.infradead.org/rpr.html X-Barracuda-Connect: UNKNOWN[198.137.202.9] X-Barracuda-Start-Time: 1454922455 X-Barracuda-Encrypted: ECDHE-RSA-AES128-GCM-SHA256 X-Barracuda-URL: https://192.48.157.11:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-Spam-Score: 0.10 X-Barracuda-Spam-Status: No, SCORE=0.10 using per-user scores of TAG_LEVEL=1000.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.7 tests=BSF_SC0_MISMATCH_TO, RDNS_NONE X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.3.26851 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 0.00 BSF_SC0_MISMATCH_TO Envelope rcpt doesn't match header 0.10 RDNS_NONE Delivered to trusted network by a host with no rDNS Looks good, Reviewed-by: Christoph Hellwig From BATV+ed7a3e778fea2a49c807+4551+infradead.org+hch@bombadil.srs.infradead.org Mon Feb 8 03:12:38 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=ham version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay2.corp.sgi.com [137.38.102.29]) by oss.sgi.com (Postfix) with ESMTP id 6A4657CA2 for ; Mon, 8 Feb 2016 03:12:38 -0600 (CST) Received: from cuda.sgi.com (cuda1.sgi.com [192.48.157.11]) by relay2.corp.sgi.com (Postfix) with ESMTP id 4B9D8304048 for ; Mon, 8 Feb 2016 01:12:38 -0800 (PST) X-ASG-Debug-ID: 1454922756-04bdf079c51327b0001-NocioJ Received: from bombadil.infradead.org ([198.137.202.9]) by cuda.sgi.com with ESMTP id m9EOOPvJtKjRSzsG (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128 verify=NO) for ; Mon, 08 Feb 2016 01:12:36 -0800 (PST) X-Barracuda-Envelope-From: BATV+ed7a3e778fea2a49c807+4551+infradead.org+hch@bombadil.srs.infradead.org X-Barracuda-Apparent-Source-IP: 198.137.202.9 Received: from hch by bombadil.infradead.org with local (Exim 4.80.1 #2 (Red Hat Linux)) id 1aShs4-0007Cc-1L; Mon, 08 Feb 2016 09:12:36 +0000 Date: Mon, 8 Feb 2016 01:12:36 -0800 From: Christoph Hellwig To: Dave Chinner Cc: xfs@oss.sgi.com Subject: Re: [PATCH 6/6] xfs: rename XFS_BUF_ZEROFLAGS macro Message-ID: <20160208091235.GN5534@infradead.org> X-ASG-Orig-Subj: Re: [PATCH 6/6] xfs: rename XFS_BUF_ZEROFLAGS macro References: <1454632683-20543-1-git-send-email-david@fromorbit.com> <1454632683-20543-7-git-send-email-david@fromorbit.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1454632683-20543-7-git-send-email-david@fromorbit.com> User-Agent: Mutt/1.5.24 (2015-08-30) X-SRS-Rewrite: SMTP reverse-path rewritten from by bombadil.infradead.org See http://www.infradead.org/rpr.html X-Barracuda-Connect: UNKNOWN[198.137.202.9] X-Barracuda-Start-Time: 1454922756 X-Barracuda-Encrypted: ECDHE-RSA-AES128-GCM-SHA256 X-Barracuda-URL: https://192.48.157.11:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-BRTS-Status: 1 X-Barracuda-Spam-Score: 0.10 X-Barracuda-Spam-Status: No, SCORE=0.10 using per-user scores of TAG_LEVEL=1000.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.7 tests=BSF_SC0_MISMATCH_TO, RDNS_NONE X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.3.26851 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 0.00 BSF_SC0_MISMATCH_TO Envelope rcpt doesn't match header 0.10 RDNS_NONE Delivered to trusted network by a host with no rDNS Instead of just renaming it I'd rather dig deeper. In xlog_bwrite we call xfs_bwrite, which already handles all flag clearing, so the call to XFS_BUF_ZEROFLAGS can just be removed. xlog_sync already sets a lot of these flags again, and is called on an iclog buffer which never has the READ or XBF_WRITE_FAIL set, so just replacing it with an opencoded bp->b_flags &= (XBF_FUA | XBF_FLUSH); for both instances should be enough, and even that could be moved into and else clause of the if (log->l_mp->m_flags & XFS_MOUNT_BARRIER) conditional. From david@fromorbit.com Mon Feb 8 03:17:16 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=ham version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay1.corp.sgi.com [137.38.102.111]) by oss.sgi.com (Postfix) with ESMTP id 4522D7CA2 for ; Mon, 8 Feb 2016 03:17:16 -0600 (CST) Received: from cuda.sgi.com (cuda1.sgi.com [192.48.157.11]) by relay1.corp.sgi.com (Postfix) with ESMTP id 2618F8F8039 for ; Mon, 8 Feb 2016 01:17:15 -0800 (PST) X-ASG-Debug-ID: 1454923032-04bdf079c3132ad0001-NocioJ Received: from ipmail06.adl2.internode.on.net (ipmail06.adl2.internode.on.net [150.101.137.129]) by cuda.sgi.com with ESMTP id J2TR1V6BhDK8gA80 for ; Mon, 08 Feb 2016 01:17:13 -0800 (PST) X-Barracuda-Envelope-From: david@fromorbit.com X-Barracuda-Apparent-Source-IP: 150.101.137.129 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: A2AaCgCmXLhWPBATLHleKAECgw9SbYZjgXidMwwBAQEBAQEGi2aFRIQHGYVuBAICgSVNAQEBAQEBBwEBAQFBP4RCAQEEOhwjEAgDDgoJJQ8FJQMHGhOIGrwrAQEBBwIBHRiFMoR/h12BDwWWdYVMh3uBZIRDiFWOPoRaKC6IUwEBAQ Received: from ppp121-44-19-16.lns20.syd4.internode.on.net (HELO dastard) ([121.44.19.16]) by ipmail06.adl2.internode.on.net with ESMTP; 08 Feb 2016 19:46:45 +1030 Received: from dave by dastard with local (Exim 4.80) (envelope-from ) id 1aShw4-0007Xy-CJ; Mon, 08 Feb 2016 20:16:44 +1100 Date: Mon, 8 Feb 2016 20:16:44 +1100 From: Dave Chinner To: Christoph Hellwig Cc: linux-fsdevel@vger.kernel.org, xfs@oss.sgi.com, linux-ext4@vger.kernel.org, ocfs2-devel@oss.oracle.com Subject: Re: [PATCH 2/3] xfs: don't use ioends for direct write completions Message-ID: <20160208091644.GD27429@dastard> X-ASG-Orig-Subj: Re: [PATCH 2/3] xfs: don't use ioends for direct write completions References: <1454524816-11392-1-git-send-email-hch@lst.de> <1454524816-11392-3-git-send-email-hch@lst.de> <20160208010026.GL31407@dastard> <20160208061731.GC27429@dastard> <20160208073121.GA30092@lst.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20160208073121.GA30092@lst.de> User-Agent: Mutt/1.5.21 (2010-09-15) X-Barracuda-Connect: ipmail06.adl2.internode.on.net[150.101.137.129] X-Barracuda-Start-Time: 1454923032 X-Barracuda-URL: https://192.48.157.11:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-BRTS-Status: 1 X-Barracuda-Spam-Score: 0.00 X-Barracuda-Spam-Status: No, SCORE=0.00 using per-user scores of TAG_LEVEL=1000.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.7 tests=BSF_SC0_MISMATCH_TO X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.3.26851 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 0.00 BSF_SC0_MISMATCH_TO Envelope rcpt doesn't match header On Mon, Feb 08, 2016 at 08:31:21AM +0100, Christoph Hellwig wrote: > On Mon, Feb 08, 2016 at 05:17:31PM +1100, Dave Chinner wrote: > > Right now this series is in a stable branch in the XFS tree: > > > > git://git.kernel.org/pub/scm/linux/kernel/git/dgc/linux-xfs.git xfs-dio-fix-4.6 > > > > If you want to push it through some other tree, please let me know > > when/where it is committed so I can rebuild the XFS for-next branch > > appropriately from a stable commit/branch... > > That's how I think it should be handled. This would also allow the > ext4 and ocfs2 maintainers to depend on the stable branch to clean > up their direct I/O completion handling in this merge window if they > want to. I can't tell if you are saying what I've done is fine if the xfs-dio-fix-4.6 branch is stable (so others can pull it) or whether it should be in some other tree. Can you clarify, Christoph? Cheers, Dave. -- Dave Chinner david@fromorbit.com From hch@lst.de Mon Feb 8 03:22:05 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=ham version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay3.corp.sgi.com [198.149.34.15]) by oss.sgi.com (Postfix) with ESMTP id 30A8B7CA2 for ; Mon, 8 Feb 2016 03:22:05 -0600 (CST) Received: from cuda.sgi.com (cuda3.sgi.com [192.48.176.15]) by relay3.corp.sgi.com (Postfix) with ESMTP id B37A3AC001 for ; Mon, 8 Feb 2016 01:22:04 -0800 (PST) X-ASG-Debug-ID: 1454923321-04cb6c2744162f90001-NocioJ Received: from newverein.lst.de (verein.lst.de [213.95.11.211]) by cuda.sgi.com with ESMTP id KPF1ACE4uNFPdLws (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO) for ; Mon, 08 Feb 2016 01:22:02 -0800 (PST) X-Barracuda-Envelope-From: hch@lst.de X-Barracuda-Apparent-Source-IP: 213.95.11.211 Received: by newverein.lst.de (Postfix, from userid 2407) id 5F680DE48D; Mon, 8 Feb 2016 10:22:00 +0100 (CET) Date: Mon, 8 Feb 2016 10:22:00 +0100 From: Christoph Hellwig To: Dave Chinner Cc: linux-fsdevel@vger.kernel.org, xfs@oss.sgi.com, linux-ext4@vger.kernel.org, ocfs2-devel@oss.oracle.com Subject: Re: [PATCH 2/3] xfs: don't use ioends for direct write completions Message-ID: <20160208092200.GA31881@lst.de> X-ASG-Orig-Subj: Re: [PATCH 2/3] xfs: don't use ioends for direct write completions References: <1454524816-11392-1-git-send-email-hch@lst.de> <1454524816-11392-3-git-send-email-hch@lst.de> <20160208010026.GL31407@dastard> <20160208061731.GC27429@dastard> <20160208073121.GA30092@lst.de> <20160208091644.GD27429@dastard> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20160208091644.GD27429@dastard> User-Agent: Mutt/1.5.17 (2007-11-01) X-Barracuda-Connect: verein.lst.de[213.95.11.211] X-Barracuda-Start-Time: 1454923322 X-Barracuda-Encrypted: ECDHE-RSA-AES256-GCM-SHA384 X-Barracuda-URL: https://192.48.176.15:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-BRTS-Status: 1 X-Barracuda-Spam-Score: 0.00 X-Barracuda-Spam-Status: No, SCORE=0.00 using per-user scores of TAG_LEVEL=1000.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.7 tests=BSF_SC0_MISMATCH_TO X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.3.26852 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 0.00 BSF_SC0_MISMATCH_TO Envelope rcpt doesn't match header On Mon, Feb 08, 2016 at 08:16:44PM +1100, Dave Chinner wrote: > I can't tell if you are saying what I've done is fine if the > xfs-dio-fix-4.6 branch is stable (so others can pull it) or whether > it should be in some other tree. Can you clarify, Christoph? What you are doing is fine, thanks! From BATV+ed7a3e778fea2a49c807+4551+infradead.org+hch@bombadil.srs.infradead.org Mon Feb 8 03:23:20 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=ham version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay1.corp.sgi.com [137.38.102.111]) by oss.sgi.com (Postfix) with ESMTP id 362107CA2 for ; Mon, 8 Feb 2016 03:23:20 -0600 (CST) Received: from cuda.sgi.com (cuda3.sgi.com [192.48.176.15]) by relay1.corp.sgi.com (Postfix) with ESMTP id 264B68F804C for ; Mon, 8 Feb 2016 01:23:20 -0800 (PST) X-ASG-Debug-ID: 1454923398-04cb6c2746163070001-NocioJ Received: from bombadil.infradead.org ([198.137.202.9]) by cuda.sgi.com with ESMTP id Za96jIw0vyCClpTd (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128 verify=NO) for ; Mon, 08 Feb 2016 01:23:18 -0800 (PST) X-Barracuda-Envelope-From: BATV+ed7a3e778fea2a49c807+4551+infradead.org+hch@bombadil.srs.infradead.org X-Barracuda-Apparent-Source-IP: 198.137.202.9 Received: from hch by bombadil.infradead.org with local (Exim 4.80.1 #2 (Red Hat Linux)) id 1aSi2Q-0000WU-9U; Mon, 08 Feb 2016 09:23:18 +0000 Date: Mon, 8 Feb 2016 01:23:18 -0800 From: Christoph Hellwig To: Dave Chinner Cc: xfs@oss.sgi.com Subject: Re: [PATCH 1/9] xfs: introduce inode log format object Message-ID: <20160208092318.GA28146@infradead.org> X-ASG-Orig-Subj: Re: [PATCH 1/9] xfs: introduce inode log format object References: <1454905461-2773-1-git-send-email-david@fromorbit.com> <1454905461-2773-2-git-send-email-david@fromorbit.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1454905461-2773-2-git-send-email-david@fromorbit.com> User-Agent: Mutt/1.5.24 (2015-08-30) X-SRS-Rewrite: SMTP reverse-path rewritten from by bombadil.infradead.org See http://www.infradead.org/rpr.html X-Barracuda-Connect: UNKNOWN[198.137.202.9] X-Barracuda-Start-Time: 1454923398 X-Barracuda-Encrypted: ECDHE-RSA-AES128-GCM-SHA256 X-Barracuda-URL: https://192.48.176.15:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-BRTS-Status: 1 X-Barracuda-Spam-Score: 0.10 X-Barracuda-Spam-Status: No, SCORE=0.10 using per-user scores of TAG_LEVEL=1000.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.7 tests=BSF_SC0_MISMATCH_TO, RDNS_NONE X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.3.26852 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 0.00 BSF_SC0_MISMATCH_TO Envelope rcpt doesn't match header 0.10 RDNS_NONE Delivered to trusted network by a host with no rDNS This looks fine in general: Reviewed-by: Christoph Hellwig But: this now introduce struct inode to libxfs code, what's your plan to deal with that in xfsprogs? From BATV+ed7a3e778fea2a49c807+4551+infradead.org+hch@bombadil.srs.infradead.org Mon Feb 8 03:28:19 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=ham version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay2.corp.sgi.com [137.38.102.29]) by oss.sgi.com (Postfix) with ESMTP id 99CDF7CA2 for ; Mon, 8 Feb 2016 03:28:19 -0600 (CST) Received: from cuda.sgi.com (cuda3.sgi.com [192.48.176.15]) by relay2.corp.sgi.com (Postfix) with ESMTP id 7B0B6304048 for ; Mon, 8 Feb 2016 01:28:19 -0800 (PST) X-ASG-Debug-ID: 1454923697-04cb6c2747163790001-NocioJ Received: from bombadil.infradead.org ([198.137.202.9]) by cuda.sgi.com with ESMTP id z0PgrEc7rPAjO9W2 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128 verify=NO) for ; Mon, 08 Feb 2016 01:28:17 -0800 (PST) X-Barracuda-Envelope-From: BATV+ed7a3e778fea2a49c807+4551+infradead.org+hch@bombadil.srs.infradead.org X-Barracuda-Apparent-Source-IP: 198.137.202.9 Received: from hch by bombadil.infradead.org with local (Exim 4.80.1 #2 (Red Hat Linux)) id 1aSi7F-0004Cn-74; Mon, 08 Feb 2016 09:28:17 +0000 Date: Mon, 8 Feb 2016 01:28:17 -0800 From: Christoph Hellwig To: Dave Chinner Cc: xfs@oss.sgi.com Subject: Re: [PATCH 2/9] xfs: remove timestamps from incore inode Message-ID: <20160208092817.GB28146@infradead.org> X-ASG-Orig-Subj: Re: [PATCH 2/9] xfs: remove timestamps from incore inode References: <1454905461-2773-1-git-send-email-david@fromorbit.com> <1454905461-2773-3-git-send-email-david@fromorbit.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1454905461-2773-3-git-send-email-david@fromorbit.com> User-Agent: Mutt/1.5.24 (2015-08-30) X-SRS-Rewrite: SMTP reverse-path rewritten from by bombadil.infradead.org See http://www.infradead.org/rpr.html X-Barracuda-Connect: UNKNOWN[198.137.202.9] X-Barracuda-Start-Time: 1454923697 X-Barracuda-Encrypted: ECDHE-RSA-AES128-GCM-SHA256 X-Barracuda-URL: https://192.48.176.15:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-BRTS-Status: 1 X-Barracuda-Spam-Score: 0.10 X-Barracuda-Spam-Status: No, SCORE=0.10 using per-user scores of TAG_LEVEL=1000.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.7 tests=BSF_SC0_MISMATCH_TO, RDNS_NONE X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.3.26852 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 0.00 BSF_SC0_MISMATCH_TO Envelope rcpt doesn't match header 0.10 RDNS_NONE Delivered to trusted network by a host with no rDNS > + /* > + * time is signed, so need to convert to signed 32 bit before > + * storing in inode timestamp which may be 64 bit. Otherwise > + * a time before epoch is converted to a time long after epoch > + * on 64 bit systems. > + */ Time should be captizalized at the beginning of the comment. Otherwise looks fine: Reviewed-by: Christoph Hellwig From BATV+ed7a3e778fea2a49c807+4551+infradead.org+hch@bombadil.srs.infradead.org Mon Feb 8 03:29:56 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=ham version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay2.corp.sgi.com [137.38.102.29]) by oss.sgi.com (Postfix) with ESMTP id 427337CA2 for ; Mon, 8 Feb 2016 03:29:56 -0600 (CST) Received: from cuda.sgi.com (cuda1.sgi.com [192.48.157.11]) by relay2.corp.sgi.com (Postfix) with ESMTP id 15012304043 for ; Mon, 8 Feb 2016 01:29:56 -0800 (PST) X-ASG-Debug-ID: 1454923793-04bdf079c5133660001-NocioJ Received: from bombadil.infradead.org ([198.137.202.9]) by cuda.sgi.com with ESMTP id rX5JaHf8Q4ASYxb2 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128 verify=NO) for ; Mon, 08 Feb 2016 01:29:54 -0800 (PST) X-Barracuda-Envelope-From: BATV+ed7a3e778fea2a49c807+4551+infradead.org+hch@bombadil.srs.infradead.org X-Barracuda-Apparent-Source-IP: 198.137.202.9 Received: from hch by bombadil.infradead.org with local (Exim 4.80.1 #2 (Red Hat Linux)) id 1aSi8n-0004io-Cd; Mon, 08 Feb 2016 09:29:53 +0000 Date: Mon, 8 Feb 2016 01:29:53 -0800 From: Christoph Hellwig To: Dave Chinner Cc: xfs@oss.sgi.com Subject: Re: [PATCH 3/9] xfs: cull unnecessary icdinode fields Message-ID: <20160208092953.GC28146@infradead.org> X-ASG-Orig-Subj: Re: [PATCH 3/9] xfs: cull unnecessary icdinode fields References: <1454905461-2773-1-git-send-email-david@fromorbit.com> <1454905461-2773-4-git-send-email-david@fromorbit.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1454905461-2773-4-git-send-email-david@fromorbit.com> User-Agent: Mutt/1.5.24 (2015-08-30) X-SRS-Rewrite: SMTP reverse-path rewritten from by bombadil.infradead.org See http://www.infradead.org/rpr.html X-Barracuda-Connect: UNKNOWN[198.137.202.9] X-Barracuda-Start-Time: 1454923793 X-Barracuda-Encrypted: ECDHE-RSA-AES128-GCM-SHA256 X-Barracuda-URL: https://192.48.157.11:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-Spam-Score: 0.10 X-Barracuda-Spam-Status: No, SCORE=0.10 using per-user scores of TAG_LEVEL=1000.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.7 tests=BSF_SC0_MISMATCH_TO, RDNS_NONE X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.3.26852 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 0.00 BSF_SC0_MISMATCH_TO Envelope rcpt doesn't match header 0.10 RDNS_NONE Delivered to trusted network by a host with no rDNS Looks fine, Reviewed-by: Christoph Hellwig From BATV+ed7a3e778fea2a49c807+4551+infradead.org+hch@bombadil.srs.infradead.org Mon Feb 8 03:31:52 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=ham version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay2.corp.sgi.com [137.38.102.29]) by oss.sgi.com (Postfix) with ESMTP id E67EA7CA2 for ; Mon, 8 Feb 2016 03:31:52 -0600 (CST) Received: from cuda.sgi.com (cuda3.sgi.com [192.48.176.15]) by relay2.corp.sgi.com (Postfix) with ESMTP id D602A304043 for ; Mon, 8 Feb 2016 01:31:52 -0800 (PST) X-ASG-Debug-ID: 1454923911-04cb6c2746163920001-NocioJ Received: from bombadil.infradead.org ([198.137.202.9]) by cuda.sgi.com with ESMTP id 4ddUpSD1UfkxQzu0 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128 verify=NO) for ; Mon, 08 Feb 2016 01:31:51 -0800 (PST) X-Barracuda-Envelope-From: BATV+ed7a3e778fea2a49c807+4551+infradead.org+hch@bombadil.srs.infradead.org X-Barracuda-Apparent-Source-IP: 198.137.202.9 Received: from hch by bombadil.infradead.org with local (Exim 4.80.1 #2 (Red Hat Linux)) id 1aSiAg-0006MY-RK; Mon, 08 Feb 2016 09:31:50 +0000 Date: Mon, 8 Feb 2016 01:31:50 -0800 From: Christoph Hellwig To: Dave Chinner Cc: xfs@oss.sgi.com Subject: Re: [PATCH 4/9] xfs: move v1 inode conversion to xfs_inode_from_disk Message-ID: <20160208093150.GD28146@infradead.org> X-ASG-Orig-Subj: Re: [PATCH 4/9] xfs: move v1 inode conversion to xfs_inode_from_disk References: <1454905461-2773-1-git-send-email-david@fromorbit.com> <1454905461-2773-5-git-send-email-david@fromorbit.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1454905461-2773-5-git-send-email-david@fromorbit.com> User-Agent: Mutt/1.5.24 (2015-08-30) X-SRS-Rewrite: SMTP reverse-path rewritten from by bombadil.infradead.org See http://www.infradead.org/rpr.html X-Barracuda-Connect: UNKNOWN[198.137.202.9] X-Barracuda-Start-Time: 1454923911 X-Barracuda-Encrypted: ECDHE-RSA-AES128-GCM-SHA256 X-Barracuda-URL: https://192.48.176.15:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-BRTS-Status: 1 X-Barracuda-Spam-Score: 0.10 X-Barracuda-Spam-Status: No, SCORE=0.10 using per-user scores of TAG_LEVEL=1000.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.7 tests=BSF_SC0_MISMATCH_TO, RDNS_NONE X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.3.26852 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 0.00 BSF_SC0_MISMATCH_TO Envelope rcpt doesn't match header 0.10 RDNS_NONE Delivered to trusted network by a host with no rDNS Looks fine, Reviewed-by: Christoph Hellwig Shouldn't we be able to kill off di_version as well? version 3 inodes only happen on crc enabled file systems, and version 2 only on version 4 file systems. From BATV+ed7a3e778fea2a49c807+4551+infradead.org+hch@bombadil.srs.infradead.org Mon Feb 8 03:33:52 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=ham version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay1.corp.sgi.com [137.38.102.111]) by oss.sgi.com (Postfix) with ESMTP id B80C67CA2 for ; Mon, 8 Feb 2016 03:33:52 -0600 (CST) Received: from cuda.sgi.com (cuda3.sgi.com [192.48.176.15]) by relay1.corp.sgi.com (Postfix) with ESMTP id 9C21F8F804C for ; Mon, 8 Feb 2016 01:33:52 -0800 (PST) X-ASG-Debug-ID: 1454924028-04cb6c2747163ac0001-NocioJ Received: from bombadil.infradead.org ([198.137.202.9]) by cuda.sgi.com with ESMTP id t3w21qpYuTHZMmIt (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128 verify=NO) for ; Mon, 08 Feb 2016 01:33:49 -0800 (PST) X-Barracuda-Envelope-From: BATV+ed7a3e778fea2a49c807+4551+infradead.org+hch@bombadil.srs.infradead.org X-Barracuda-Apparent-Source-IP: 198.137.202.9 Received: from hch by bombadil.infradead.org with local (Exim 4.80.1 #2 (Red Hat Linux)) id 1aSiCa-0007KD-5N; Mon, 08 Feb 2016 09:33:48 +0000 Date: Mon, 8 Feb 2016 01:33:48 -0800 From: Christoph Hellwig To: Dave Chinner Cc: xfs@oss.sgi.com Subject: Re: [PATCH 5/9] xfs: reinitialise recycled VFS inode correctly Message-ID: <20160208093348.GE28146@infradead.org> X-ASG-Orig-Subj: Re: [PATCH 5/9] xfs: reinitialise recycled VFS inode correctly References: <1454905461-2773-1-git-send-email-david@fromorbit.com> <1454905461-2773-6-git-send-email-david@fromorbit.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1454905461-2773-6-git-send-email-david@fromorbit.com> User-Agent: Mutt/1.5.24 (2015-08-30) X-SRS-Rewrite: SMTP reverse-path rewritten from by bombadil.infradead.org See http://www.infradead.org/rpr.html X-Barracuda-Connect: UNKNOWN[198.137.202.9] X-Barracuda-Start-Time: 1454924029 X-Barracuda-Encrypted: ECDHE-RSA-AES128-GCM-SHA256 X-Barracuda-URL: https://192.48.176.15:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-BRTS-Status: 1 X-Barracuda-Spam-Score: 0.10 X-Barracuda-Spam-Status: No, SCORE=0.10 using per-user scores of TAG_LEVEL=1000.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.7 tests=BSF_SC0_MISMATCH_TO, RDNS_NONE X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.3.26852 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 0.00 BSF_SC0_MISMATCH_TO Envelope rcpt doesn't match header 0.10 RDNS_NONE Delivered to trusted network by a host with no rDNS On Mon, Feb 08, 2016 at 03:24:17PM +1100, Dave Chinner wrote: > From: Dave Chinner > > Now that we keep certain on-disk information in the VFS inode rather > than in a separate XFS specific stucture, we have to be careful of > the VFS code clearing that information when we re-initialise > reclaimable cached inodes during lookup. If we don't do this, then > we lose critical information from the inode and that results in > corruption being detected. Might be worth to use future tense here? Or maybe just fold it into the next patch. Either way: Reviewed-by: Christoph Hellwig From BATV+ed7a3e778fea2a49c807+4551+infradead.org+hch@bombadil.srs.infradead.org Mon Feb 8 03:40:26 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=ham version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay3.corp.sgi.com [198.149.34.15]) by oss.sgi.com (Postfix) with ESMTP id 9DA877CA2 for ; Mon, 8 Feb 2016 03:40:26 -0600 (CST) Received: from cuda.sgi.com (cuda1.sgi.com [192.48.157.11]) by relay3.corp.sgi.com (Postfix) with ESMTP id E7161AC001 for ; Mon, 8 Feb 2016 01:40:25 -0800 (PST) X-ASG-Debug-ID: 1454924423-04bdf079c3134140001-NocioJ Received: from bombadil.infradead.org ([198.137.202.9]) by cuda.sgi.com with ESMTP id KK5ffTcXBIl5KZAz (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128 verify=NO) for ; Mon, 08 Feb 2016 01:40:24 -0800 (PST) X-Barracuda-Envelope-From: BATV+ed7a3e778fea2a49c807+4551+infradead.org+hch@bombadil.srs.infradead.org X-Barracuda-Apparent-Source-IP: 198.137.202.9 Received: from hch by bombadil.infradead.org with local (Exim 4.80.1 #2 (Red Hat Linux)) id 1aSiIv-0003Og-Sk; Mon, 08 Feb 2016 09:40:21 +0000 Date: Mon, 8 Feb 2016 01:40:21 -0800 From: Christoph Hellwig To: Dave Chinner Cc: xfs@oss.sgi.com Subject: Re: [PATCH 6/9] xfs: use vfs inode nlink field everywhere Message-ID: <20160208094021.GA4487@infradead.org> X-ASG-Orig-Subj: Re: [PATCH 6/9] xfs: use vfs inode nlink field everywhere References: <1454905461-2773-1-git-send-email-david@fromorbit.com> <1454905461-2773-7-git-send-email-david@fromorbit.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1454905461-2773-7-git-send-email-david@fromorbit.com> User-Agent: Mutt/1.5.24 (2015-08-30) X-SRS-Rewrite: SMTP reverse-path rewritten from by bombadil.infradead.org See http://www.infradead.org/rpr.html X-Barracuda-Connect: UNKNOWN[198.137.202.9] X-Barracuda-Start-Time: 1454924423 X-Barracuda-Encrypted: ECDHE-RSA-AES128-GCM-SHA256 X-Barracuda-URL: https://192.48.157.11:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-BRTS-Status: 1 X-Barracuda-Spam-Score: 0.10 X-Barracuda-Spam-Status: No, SCORE=0.10 using per-user scores of TAG_LEVEL=1000.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.7 tests=BSF_SC0_MISMATCH_TO, RDNS_NONE X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.3.26852 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 0.00 BSF_SC0_MISMATCH_TO Envelope rcpt doesn't match header 0.10 RDNS_NONE Delivered to trusted network by a host with no rDNS On Mon, Feb 08, 2016 at 03:24:18PM +1100, Dave Chinner wrote: > From: Dave Chinner > > The Vfs tracks the inodenlink just like the xfs_icdinode. We can s/Vfs/VFS/ > +STATIC int > xfs_iunlink( > - xfs_trans_t *tp, > - xfs_inode_t *ip) > + struct xfs_trans *tp, > + struct xfs_inode *ip, > + bool ignore_linkcount) I'd say kill the ignore_linkcount parameter and the assert depending on it. There are just two callers: xfs_droplink checks for i_nlink just before the call, and xfs_create_tmpfile has to set the override flag. Otherwise looks fine: Reviewed-by: Christoph Hellwig From BATV+ed7a3e778fea2a49c807+4551+infradead.org+hch@bombadil.srs.infradead.org Mon Feb 8 03:40:50 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=ham version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay3.corp.sgi.com [198.149.34.15]) by oss.sgi.com (Postfix) with ESMTP id BF2C17CA2 for ; Mon, 8 Feb 2016 03:40:50 -0600 (CST) Received: from cuda.sgi.com (cuda2.sgi.com [192.48.176.25]) by relay3.corp.sgi.com (Postfix) with ESMTP id 5C76CAC001 for ; Mon, 8 Feb 2016 01:40:50 -0800 (PST) X-ASG-Debug-ID: 1454924447-04cbb04cfa14eae0001-NocioJ Received: from bombadil.infradead.org ([198.137.202.9]) by cuda.sgi.com with ESMTP id NPoHIdV2WzrytuDi (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128 verify=NO) for ; Mon, 08 Feb 2016 01:40:47 -0800 (PST) X-Barracuda-Envelope-From: BATV+ed7a3e778fea2a49c807+4551+infradead.org+hch@bombadil.srs.infradead.org X-Barracuda-Apparent-Source-IP: 198.137.202.9 Received: from hch by bombadil.infradead.org with local (Exim 4.80.1 #2 (Red Hat Linux)) id 1aSiJL-0003Ue-3d; Mon, 08 Feb 2016 09:40:47 +0000 Date: Mon, 8 Feb 2016 01:40:47 -0800 From: Christoph Hellwig To: Dave Chinner Cc: xfs@oss.sgi.com Subject: Re: [PATCH 7/9] xfs: move inode generation count to VFS inode Message-ID: <20160208094047.GB4487@infradead.org> X-ASG-Orig-Subj: Re: [PATCH 7/9] xfs: move inode generation count to VFS inode References: <1454905461-2773-1-git-send-email-david@fromorbit.com> <1454905461-2773-8-git-send-email-david@fromorbit.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1454905461-2773-8-git-send-email-david@fromorbit.com> User-Agent: Mutt/1.5.24 (2015-08-30) X-SRS-Rewrite: SMTP reverse-path rewritten from by bombadil.infradead.org See http://www.infradead.org/rpr.html X-Barracuda-Connect: UNKNOWN[198.137.202.9] X-Barracuda-Start-Time: 1454924447 X-Barracuda-Encrypted: ECDHE-RSA-AES128-GCM-SHA256 X-Barracuda-URL: https://192.48.176.25:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-Spam-Score: 0.10 X-Barracuda-Spam-Status: No, SCORE=0.10 using per-user scores of TAG_LEVEL=1000.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.7 tests=BSF_SC0_MISMATCH_TO, RDNS_NONE X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.3.26852 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 0.00 BSF_SC0_MISMATCH_TO Envelope rcpt doesn't match header 0.10 RDNS_NONE Delivered to trusted network by a host with no rDNS Looks fine, Reviewed-by: Christoph Hellwig From BATV+ed7a3e778fea2a49c807+4551+infradead.org+hch@bombadil.srs.infradead.org Mon Feb 8 03:41:15 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=ham version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay2.corp.sgi.com [137.38.102.29]) by oss.sgi.com (Postfix) with ESMTP id 4DDEA7CA2 for ; Mon, 8 Feb 2016 03:41:15 -0600 (CST) Received: from cuda.sgi.com (cuda2.sgi.com [192.48.176.25]) by relay2.corp.sgi.com (Postfix) with ESMTP id 38E97304043 for ; Mon, 8 Feb 2016 01:41:15 -0800 (PST) X-ASG-Debug-ID: 1454924473-04cbb04cfa14eb70001-NocioJ Received: from bombadil.infradead.org ([198.137.202.9]) by cuda.sgi.com with ESMTP id 1tJmYzZ929MFFqPD (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128 verify=NO) for ; Mon, 08 Feb 2016 01:41:13 -0800 (PST) X-Barracuda-Envelope-From: BATV+ed7a3e778fea2a49c807+4551+infradead.org+hch@bombadil.srs.infradead.org X-Barracuda-Apparent-Source-IP: 198.137.202.9 Received: from hch by bombadil.infradead.org with local (Exim 4.80.1 #2 (Red Hat Linux)) id 1aSiJk-0003aY-VN; Mon, 08 Feb 2016 09:41:12 +0000 Date: Mon, 8 Feb 2016 01:41:12 -0800 From: Christoph Hellwig To: Dave Chinner Cc: xfs@oss.sgi.com Subject: Re: [PATCH 8/9] xfs: move di_changecount to VFS inode Message-ID: <20160208094112.GC4487@infradead.org> X-ASG-Orig-Subj: Re: [PATCH 8/9] xfs: move di_changecount to VFS inode References: <1454905461-2773-1-git-send-email-david@fromorbit.com> <1454905461-2773-9-git-send-email-david@fromorbit.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1454905461-2773-9-git-send-email-david@fromorbit.com> User-Agent: Mutt/1.5.24 (2015-08-30) X-SRS-Rewrite: SMTP reverse-path rewritten from by bombadil.infradead.org See http://www.infradead.org/rpr.html X-Barracuda-Connect: UNKNOWN[198.137.202.9] X-Barracuda-Start-Time: 1454924473 X-Barracuda-Encrypted: ECDHE-RSA-AES128-GCM-SHA256 X-Barracuda-URL: https://192.48.176.25:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-Spam-Score: 0.10 X-Barracuda-Spam-Status: No, SCORE=0.10 using per-user scores of TAG_LEVEL=1000.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.7 tests=BSF_SC0_MISMATCH_TO, RDNS_NONE X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.3.26852 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 0.00 BSF_SC0_MISMATCH_TO Envelope rcpt doesn't match header 0.10 RDNS_NONE Delivered to trusted network by a host with no rDNS Looks fine, Reviewed-by: Christoph Hellwig From BATV+ed7a3e778fea2a49c807+4551+infradead.org+hch@bombadil.srs.infradead.org Mon Feb 8 03:42:42 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=ham version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay3.corp.sgi.com [198.149.34.15]) by oss.sgi.com (Postfix) with ESMTP id 616CC7CA9 for ; Mon, 8 Feb 2016 03:42:42 -0600 (CST) Received: from cuda.sgi.com (cuda1.sgi.com [192.48.157.11]) by relay3.corp.sgi.com (Postfix) with ESMTP id EC7C6AC001 for ; Mon, 8 Feb 2016 01:42:41 -0800 (PST) X-ASG-Debug-ID: 1454924559-04bdf079c1134230001-NocioJ Received: from bombadil.infradead.org ([198.137.202.9]) by cuda.sgi.com with ESMTP id oOuDub8BHT3ophS6 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128 verify=NO) for ; Mon, 08 Feb 2016 01:42:40 -0800 (PST) X-Barracuda-Envelope-From: BATV+ed7a3e778fea2a49c807+4551+infradead.org+hch@bombadil.srs.infradead.org X-Barracuda-Apparent-Source-IP: 198.137.202.9 Received: from hch by bombadil.infradead.org with local (Exim 4.80.1 #2 (Red Hat Linux)) id 1aSiL9-0003oN-EQ; Mon, 08 Feb 2016 09:42:39 +0000 Date: Mon, 8 Feb 2016 01:42:39 -0800 From: Christoph Hellwig To: Dave Chinner Cc: xfs@oss.sgi.com Subject: Re: [PATCH 9/9] xfs: mode di_mode to vfs inode Message-ID: <20160208094239.GD4487@infradead.org> X-ASG-Orig-Subj: Re: [PATCH 9/9] xfs: mode di_mode to vfs inode References: <1454905461-2773-1-git-send-email-david@fromorbit.com> <1454905461-2773-10-git-send-email-david@fromorbit.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1454905461-2773-10-git-send-email-david@fromorbit.com> User-Agent: Mutt/1.5.24 (2015-08-30) X-SRS-Rewrite: SMTP reverse-path rewritten from by bombadil.infradead.org See http://www.infradead.org/rpr.html X-Barracuda-Connect: UNKNOWN[198.137.202.9] X-Barracuda-Start-Time: 1454924559 X-Barracuda-Encrypted: ECDHE-RSA-AES128-GCM-SHA256 X-Barracuda-URL: https://192.48.157.11:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-BRTS-Status: 1 X-Barracuda-Spam-Score: 0.10 X-Barracuda-Spam-Status: No, SCORE=0.10 using per-user scores of TAG_LEVEL=1000.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.7 tests=BSF_SC0_MISMATCH_TO, RDNS_NONE X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.3.26852 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 0.00 BSF_SC0_MISMATCH_TO Envelope rcpt doesn't match header 0.10 RDNS_NONE Delivered to trusted network by a host with no rDNS On Mon, Feb 08, 2016 at 03:24:21PM +1100, Dave Chinner wrote: > - ASSERT(!(S_ISREG(ip->i_d.di_mode) && whichfork == XFS_DATA_FORK)); > + ASSERT(!(S_ISREG(VFS_I(ip)->i_mode) && whichfork == XFS_DATA_FORK)); Maybe it's worth adding XFS_ISDIR/REG/.. helpers for all these checks? Otherwise looks fine: Reviewed-by: Christoph Hellwig From jack@suse.cz Mon Feb 8 03:44:23 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=ham version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay3.corp.sgi.com [198.149.34.15]) by oss.sgi.com (Postfix) with ESMTP id E46907CA9 for ; Mon, 8 Feb 2016 03:44:22 -0600 (CST) Received: from cuda.sgi.com (cuda2.sgi.com [192.48.176.25]) by relay3.corp.sgi.com (Postfix) with ESMTP id 595D8AC001 for ; Mon, 8 Feb 2016 01:44:22 -0800 (PST) X-ASG-Debug-ID: 1454924656-04cbb04cfc14eca0001-NocioJ Received: from mx2.suse.de (mx2.suse.de [195.135.220.15]) by cuda.sgi.com with ESMTP id lFPlxxOhdFzW0Kq0 (version=TLSv1 cipher=ECDHE-RSA-AES256-SHA bits=256 verify=NO) for ; Mon, 08 Feb 2016 01:44:18 -0800 (PST) X-Barracuda-Envelope-From: jack@suse.cz X-Barracuda-Apparent-Source-IP: 195.135.220.15 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay1.suse.de (charybdis-ext.suse.de [195.135.220.254]) by mx2.suse.de (Postfix) with ESMTP id 93AACAD5A; Mon, 8 Feb 2016 09:44:14 +0000 (UTC) Received: by quack.suse.cz (Postfix, from userid 1000) id 0AAF1823D6; Mon, 8 Feb 2016 10:44:31 +0100 (CET) Date: Mon, 8 Feb 2016 10:44:30 +0100 From: Jan Kara To: Dmitry Monakhov Cc: Ross Zwisler , linux-kernel@vger.kernel.org, "H. Peter Anvin" , "J. Bruce Fields" , Theodore Ts'o , Alexander Viro , Andreas Dilger , Andrew Morton , Dan Williams , Dave Chinner , Dave Hansen , Ingo Molnar , Jan Kara , Jeff Layton , Matthew Wilcox , Matthew Wilcox , Thomas Gleixner , linux-ext4@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux-mm@kvack.org, linux-nvdimm@lists.01.org, x86@kernel.org, xfs@oss.sgi.com Subject: Re: [PATCH v8 6/9] dax: add support for fsync/msync Message-ID: <20160208094430.GA9451@quack.suse.cz> X-ASG-Orig-Subj: Re: [PATCH v8 6/9] dax: add support for fsync/msync References: <1452230879-18117-1-git-send-email-ross.zwisler@linux.intel.com> <1452230879-18117-7-git-send-email-ross.zwisler@linux.intel.com> <878u2xrjrw.fsf@openvz.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <878u2xrjrw.fsf@openvz.org> User-Agent: Mutt/1.5.24 (2015-08-30) X-Barracuda-Connect: mx2.suse.de[195.135.220.15] X-Barracuda-Start-Time: 1454924657 X-Barracuda-Encrypted: ECDHE-RSA-AES256-SHA X-Barracuda-URL: https://192.48.176.25:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-BRTS-Status: 1 X-Barracuda-Spam-Score: 0.00 X-Barracuda-Spam-Status: No, SCORE=0.00 using per-user scores of TAG_LEVEL=1000.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.7 tests=BSF_SC0_MISMATCH_TO X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.3.26852 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 0.00 BSF_SC0_MISMATCH_TO Envelope rcpt doesn't match header On Sat 06-02-16 17:33:07, Dmitry Monakhov wrote: > > +int dax_writeback_mapping_range(struct address_space *mapping, loff_t start, > > + loff_t end) > > +{ > > + struct inode *inode = mapping->host; > > + struct block_device *bdev = inode->i_sb->s_bdev; > > + pgoff_t indices[PAGEVEC_SIZE]; > > + pgoff_t start_page, end_page; > > + struct pagevec pvec; > > + void *entry; > > + int i, ret = 0; > > + > > + if (WARN_ON_ONCE(inode->i_blkbits != PAGE_SHIFT)) > > + return -EIO; > > + > > + rcu_read_lock(); > > + entry = radix_tree_lookup(&mapping->page_tree, start & PMD_MASK); > > + rcu_read_unlock(); > > + > > + /* see if the start of our range is covered by a PMD entry */ > > + if (entry && RADIX_DAX_TYPE(entry) == RADIX_DAX_PMD) > > + start &= PMD_MASK; > > + > > + start_page = start >> PAGE_CACHE_SHIFT; > > + end_page = end >> PAGE_CACHE_SHIFT; > > + > > + tag_pages_for_writeback(mapping, start_page, end_page); > > + > > + pagevec_init(&pvec, 0); > > + while (1) { > > + pvec.nr = find_get_entries_tag(mapping, start_page, > > + PAGECACHE_TAG_TOWRITE, PAGEVEC_SIZE, > > + pvec.pages, indices); > > + > > + if (pvec.nr == 0) > > + break; > > + > > + for (i = 0; i < pvec.nr; i++) { > > + ret = dax_writeback_one(bdev, mapping, indices[i], > > + pvec.pages[i]); > > + if (ret < 0) > > + return ret; > > + } > I think it would be more efficient to use batched locking like follows: > spin_lock_irq(&mapping->tree_lock); > for (i = 0; i < pvec.nr; i++) { > struct blk_dax_ctl dax[PAGEVEC_SIZE]; > radix_tree_tag_clear(page_tree, indices[i], PAGECACHE_TAG_TOWRITE); > /* It is also reasonable to merge adjacent dax > * regions in to one */ > dax[i].sector = RADIX_DAX_SECTOR(entry); > dax[i].size = (type == RADIX_DAX_PMD ? PMD_SIZE : PAGE_SIZE); > > } > spin_unlock_irq(&mapping->tree_lock); > if (blk_queue_enter(q, true) != 0) > goto error; > for (i = 0; i < pvec.nr; i++) { > rc = bdev_direct_access(bdev, dax[i]); > wb_cache_pmem(dax[i].addr, dax[i].size); > } > ret = blk_queue_exit(q, true) We need to clear the radix tree tag only after flushing caches. But in principle I agree that some batching of radix tree tag manipulations should be doable. But frankly so far we have issues with correctness so speed is not our main concern. > > + } > > + wmb_pmem(); > > + return 0; > > +} > > +EXPORT_SYMBOL_GPL(dax_writeback_mapping_range); > > + > > static int dax_insert_mapping(struct inode *inode, struct buffer_head *bh, > > struct vm_area_struct *vma, struct vm_fault *vmf) > > { > > @@ -363,6 +532,11 @@ static int dax_insert_mapping(struct inode *inode, struct buffer_head *bh, > > } > > dax_unmap_atomic(bdev, &dax); > > > > + error = dax_radix_entry(mapping, vmf->pgoff, dax.sector, false, > > + vmf->flags & FAULT_FLAG_WRITE); > > + if (error) > > + goto out; > > + > > error = vm_insert_mixed(vma, vaddr, dax.pfn); > > > > out: > > @@ -487,6 +661,7 @@ int __dax_fault(struct vm_area_struct *vma, struct vm_fault *vmf, > > delete_from_page_cache(page); > > unlock_page(page); > > page_cache_release(page); > > + page = NULL; > > } > I've realized that I do not understand why dax_fault code works at all. > During dax_fault we want to remove page from mapping and insert dax-entry > Basically code looks like follows: > 0 page = find_get_page() > 1 lock_page(page) > 2 delete_from_page_cache(page); > 3 unlock_page(page); > 4 dax_insert_mapping(inode, &bh, vma, vmf); > > BUT what on earth protects us from other process to reinsert page again > after step(2) but before (4)? Nothing, it's a bug and Ross / Matthew are working on fixing it... Honza -- Jan Kara SUSE Labs, CR From BATV+ed7a3e778fea2a49c807+4551+infradead.org+hch@bombadil.srs.infradead.org Mon Feb 8 04:06:45 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=ham version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay1.corp.sgi.com [137.38.102.111]) by oss.sgi.com (Postfix) with ESMTP id A76F27CA2 for ; Mon, 8 Feb 2016 04:06:45 -0600 (CST) Received: from cuda.sgi.com (cuda3.sgi.com [192.48.176.15]) by relay1.corp.sgi.com (Postfix) with ESMTP id 95A718F8035 for ; Mon, 8 Feb 2016 02:06:42 -0800 (PST) X-ASG-Debug-ID: 1454925997-04cb6c27441661a0001-NocioJ Received: from bombadil.infradead.org ([198.137.202.9]) by cuda.sgi.com with ESMTP id dRv0mN4Xh3tijk1H (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128 verify=NO) for ; Mon, 08 Feb 2016 02:06:37 -0800 (PST) X-Barracuda-Envelope-From: BATV+ed7a3e778fea2a49c807+4551+infradead.org+hch@bombadil.srs.infradead.org X-Barracuda-Apparent-Source-IP: 198.137.202.9 Received: from hch by bombadil.infradead.org with local (Exim 4.80.1 #2 (Red Hat Linux)) id 1aSiiK-0001ii-Rw; Mon, 08 Feb 2016 10:06:36 +0000 Date: Mon, 8 Feb 2016 02:06:36 -0800 From: Christoph Hellwig To: Dave Chinner Cc: xfs@oss.sgi.com Subject: Re: [PATCH 6/7] libxfs: keep unflushable buffers off the cache MRUs Message-ID: <20160208100636.GA27683@infradead.org> X-ASG-Orig-Subj: Re: [PATCH 6/7] libxfs: keep unflushable buffers off the cache MRUs References: <1454627108-19036-1-git-send-email-david@fromorbit.com> <1454627108-19036-7-git-send-email-david@fromorbit.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1454627108-19036-7-git-send-email-david@fromorbit.com> User-Agent: Mutt/1.5.24 (2015-08-30) X-SRS-Rewrite: SMTP reverse-path rewritten from by bombadil.infradead.org See http://www.infradead.org/rpr.html X-Barracuda-Connect: UNKNOWN[198.137.202.9] X-Barracuda-Start-Time: 1454925997 X-Barracuda-Encrypted: ECDHE-RSA-AES128-GCM-SHA256 X-Barracuda-URL: https://192.48.176.15:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-BRTS-Status: 1 X-Barracuda-Spam-Score: 0.10 X-Barracuda-Spam-Status: No, SCORE=0.10 using per-user scores of TAG_LEVEL=1000.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.7 tests=BSF_SC0_MISMATCH_TO, RDNS_NONE X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.3.26852 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 0.00 BSF_SC0_MISMATCH_TO Envelope rcpt doesn't match header 0.10 RDNS_NONE Delivered to trusted network by a host with no rDNS > --- a/include/cache.h > +++ b/include/cache.h > @@ -51,6 +51,7 @@ enum { > #define CACHE_BASE_PRIORITY 0 > #define CACHE_PREFETCH_PRIORITY 8 > #define CACHE_MAX_PRIORITY 15 > +#define CACHE_DIRTY_PRIORITY (CACHE_MAX_PRIORITY + 1) Sizing arrays based on, and iterating up to CACHE_DIRTY_PRIORITY seems rather odd. Maybe add a new #define CACHE_NR_PRIORITIES CACHE_DIRTY_PRIORITY and a comment explaining the magic to make it more obvious? > +cache_move_to_dirty_mru( > + struct cache *cache, > + struct cache_node *node) > +{ > + struct cache_mru *mru; > + > + mru = &cache->c_mrus[CACHE_DIRTY_PRIORITY]; > + > + pthread_mutex_lock(&mru->cm_mutex); > + node->cn_priority = CACHE_DIRTY_PRIORITY; > + list_move(&node->cn_mru, &mru->cm_list); > + mru->cm_count++; > + pthread_mutex_unlock(&mru->cm_mutex); > +} Maybe it would better to just do a list_add here and leave the list_del to the caller to avoid needing to nest two different cm_mutex instances. From BATV+ed7a3e778fea2a49c807+4551+infradead.org+hch@bombadil.srs.infradead.org Mon Feb 8 04:08:44 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=ham version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay1.corp.sgi.com [137.38.102.111]) by oss.sgi.com (Postfix) with ESMTP id CFD507CA2 for ; Mon, 8 Feb 2016 04:08:44 -0600 (CST) Received: from cuda.sgi.com (cuda2.sgi.com [192.48.176.25]) by relay1.corp.sgi.com (Postfix) with ESMTP id B09678F8033 for ; Mon, 8 Feb 2016 02:08:44 -0800 (PST) X-ASG-Debug-ID: 1454926122-04cbb04cfc14ff70001-NocioJ Received: from bombadil.infradead.org ([198.137.202.9]) by cuda.sgi.com with ESMTP id U3nLUhUFQsbmqOc3 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128 verify=NO) for ; Mon, 08 Feb 2016 02:08:42 -0800 (PST) X-Barracuda-Envelope-From: BATV+ed7a3e778fea2a49c807+4551+infradead.org+hch@bombadil.srs.infradead.org X-Barracuda-Apparent-Source-IP: 198.137.202.9 Received: from hch by bombadil.infradead.org with local (Exim 4.80.1 #2 (Red Hat Linux)) id 1aSikM-00021G-6F; Mon, 08 Feb 2016 10:08:42 +0000 Date: Mon, 8 Feb 2016 02:08:42 -0800 From: Christoph Hellwig To: Dave Chinner Cc: xfs@oss.sgi.com Subject: Re: [PATCH 7/7] libxfs: reset dirty buffer priority on lookup Message-ID: <20160208100842.GB27683@infradead.org> X-ASG-Orig-Subj: Re: [PATCH 7/7] libxfs: reset dirty buffer priority on lookup References: <1454627108-19036-1-git-send-email-david@fromorbit.com> <1454627108-19036-8-git-send-email-david@fromorbit.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1454627108-19036-8-git-send-email-david@fromorbit.com> User-Agent: Mutt/1.5.24 (2015-08-30) X-SRS-Rewrite: SMTP reverse-path rewritten from by bombadil.infradead.org See http://www.infradead.org/rpr.html X-Barracuda-Connect: UNKNOWN[198.137.202.9] X-Barracuda-Start-Time: 1454926122 X-Barracuda-Encrypted: ECDHE-RSA-AES128-GCM-SHA256 X-Barracuda-URL: https://192.48.176.25:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-Spam-Score: 0.10 X-Barracuda-Spam-Status: No, SCORE=0.10 using per-user scores of TAG_LEVEL=1000.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.7 tests=BSF_SC0_MISMATCH_TO, RDNS_NONE X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.3.26852 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 0.00 BSF_SC0_MISMATCH_TO Envelope rcpt doesn't match header 0.10 RDNS_NONE Delivered to trusted network by a host with no rDNS Looks fine, Reviewed-by: Christoph Hellwig From jack@suse.cz Mon Feb 8 04:48:39 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=ham version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay3.corp.sgi.com [198.149.34.15]) by oss.sgi.com (Postfix) with ESMTP id 4D70E7CA2 for ; Mon, 8 Feb 2016 04:48:39 -0600 (CST) Received: from cuda.sgi.com (cuda2.sgi.com [192.48.176.25]) by relay3.corp.sgi.com (Postfix) with ESMTP id C58DCAC003 for ; Mon, 8 Feb 2016 02:48:38 -0800 (PST) X-ASG-Debug-ID: 1454928514-04cbb04cf9151fd0001-NocioJ Received: from mx2.suse.de (mx2.suse.de [195.135.220.15]) by cuda.sgi.com with ESMTP id w7xhkZIhTZew5WQj (version=TLSv1 cipher=ECDHE-RSA-AES256-SHA bits=256 verify=NO) for ; Mon, 08 Feb 2016 02:48:35 -0800 (PST) X-Barracuda-Envelope-From: jack@suse.cz X-Barracuda-Apparent-Source-IP: 195.135.220.15 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay1.suse.de (charybdis-ext.suse.de [195.135.220.254]) by mx2.suse.de (Postfix) with ESMTP id 4AE2EACDA; Mon, 8 Feb 2016 10:48:33 +0000 (UTC) Received: by quack.suse.cz (Postfix, from userid 1000) id 06D81823D6; Mon, 8 Feb 2016 11:48:50 +0100 (CET) Date: Mon, 8 Feb 2016 11:48:50 +0100 From: Jan Kara To: Ross Zwisler Cc: linux-kernel@vger.kernel.org, Theodore Ts'o , Alexander Viro , Andreas Dilger , Andrew Morton , Dan Williams , Dave Chinner , Jan Kara , Matthew Wilcox , linux-ext4@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux-mm@kvack.org, linux-nvdimm@lists.01.org, xfs@oss.sgi.com Subject: Re: [PATCH 2/2] dax: move writeback calls into the filesystems Message-ID: <20160208104849.GB9451@quack.suse.cz> X-ASG-Orig-Subj: Re: [PATCH 2/2] dax: move writeback calls into the filesystems References: <1454829553-29499-1-git-send-email-ross.zwisler@linux.intel.com> <1454829553-29499-3-git-send-email-ross.zwisler@linux.intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1454829553-29499-3-git-send-email-ross.zwisler@linux.intel.com> User-Agent: Mutt/1.5.24 (2015-08-30) X-Barracuda-Connect: mx2.suse.de[195.135.220.15] X-Barracuda-Start-Time: 1454928514 X-Barracuda-Encrypted: ECDHE-RSA-AES256-SHA X-Barracuda-URL: https://192.48.176.25:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-BRTS-Status: 1 X-Barracuda-Spam-Score: 0.00 X-Barracuda-Spam-Status: No, SCORE=0.00 using per-user scores of TAG_LEVEL=1000.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.7 tests=BSF_SC0_MISMATCH_TO X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.3.26853 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 0.00 BSF_SC0_MISMATCH_TO Envelope rcpt doesn't match header On Sun 07-02-16 00:19:13, Ross Zwisler wrote: > Previously calls to dax_writeback_mapping_range() for all DAX filesystems > (ext2, ext4 & xfs) were centralized in filemap_write_and_wait_range(). > dax_writeback_mapping_range() needs a struct block_device, and it used to > get that from inode->i_sb->s_bdev. This is correct for normal inodes > mounted on ext2, ext4 and XFS filesystems, but is incorrect for DAX raw > block devices and for XFS real-time files. > > Instead, call dax_writeback_mapping_range() directly from the filesystem or > raw block device fsync/msync code so that they can supply us with a valid > block device. > > It should be noted that this will reduce the number of calls to > dax_writeback_mapping_range() because filemap_write_and_wait_range() is > called in the various filesystems for operations other than just > fsync/msync. Both ext4 & XFS call filemap_write_and_wait_range() outside > of ->fsync for hole punch, truncate, and block relocation > (xfs_shift_file_space() && ext4_collapse_range()/ext4_insert_range()). > > I don't believe that these extra flushes are necessary in the DAX case. In > the page cache case when we have dirty data in the page cache, that data > will be actively lost if we evict a dirty page cache page without flushing > it to media first. For DAX, though, the data will remain consistent with > the physical address to which it was written regardless of whether it's in > the processor cache or not - really the only reason I see to flush is in > response to a fsync or msync so that our data is durable on media in case > of a power loss. The case where we could throw dirty data out of the page > cache and essentially lose writes simply doesn't exist. You should at least note that sync(2) won't make data durable with this patch in the changelog. Dave and Christoph have told you that Linux users depend on sync(2) to make data durable and I fully agree with them. Given current options, I think we can live with this for 4.5 but long term this is IMO unacceptable. Honza > > Signed-off-by: Ross Zwisler > --- > fs/block_dev.c | 7 +++++++ > fs/dax.c | 5 ++--- > fs/ext2/file.c | 10 ++++++++++ > fs/ext4/fsync.c | 10 +++++++++- > fs/xfs/xfs_file.c | 12 ++++++++++-- > include/linux/dax.h | 4 ++-- > mm/filemap.c | 6 ------ > 7 files changed, 40 insertions(+), 14 deletions(-) > > diff --git a/fs/block_dev.c b/fs/block_dev.c > index fa0507a..312ad44 100644 > --- a/fs/block_dev.c > +++ b/fs/block_dev.c > @@ -356,8 +356,15 @@ int blkdev_fsync(struct file *filp, loff_t start, loff_t end, int datasync) > { > struct inode *bd_inode = bdev_file_inode(filp); > struct block_device *bdev = I_BDEV(bd_inode); > + struct address_space *mapping = bd_inode->i_mapping; > int error; > > + if (dax_mapping(mapping) && mapping->nrexceptional) { > + error = dax_writeback_mapping_range(mapping, bdev, start, end); > + if (error) > + return error; > + } > + > error = filemap_write_and_wait_range(filp->f_mapping, start, end); > if (error) > return error; > diff --git a/fs/dax.c b/fs/dax.c > index 4592241..4b5006a 100644 > --- a/fs/dax.c > +++ b/fs/dax.c > @@ -484,11 +484,10 @@ static int dax_writeback_one(struct block_device *bdev, > * end]. This is required by data integrity operations to ensure file data is > * on persistent storage prior to completion of the operation. > */ > -int dax_writeback_mapping_range(struct address_space *mapping, loff_t start, > - loff_t end) > +int dax_writeback_mapping_range(struct address_space *mapping, > + struct block_device *bdev, loff_t start, loff_t end) > { > struct inode *inode = mapping->host; > - struct block_device *bdev = inode->i_sb->s_bdev; > pgoff_t start_index, end_index, pmd_index; > pgoff_t indices[PAGEVEC_SIZE]; > struct pagevec pvec; > diff --git a/fs/ext2/file.c b/fs/ext2/file.c > index 2c88d68..d1abf53 100644 > --- a/fs/ext2/file.c > +++ b/fs/ext2/file.c > @@ -162,6 +162,16 @@ int ext2_fsync(struct file *file, loff_t start, loff_t end, int datasync) > int ret; > struct super_block *sb = file->f_mapping->host->i_sb; > struct address_space *mapping = sb->s_bdev->bd_inode->i_mapping; > +#ifdef CONFIG_FS_DAX > + struct address_space *inode_mapping = file->f_inode->i_mapping; > + > + if (dax_mapping(inode_mapping) && inode_mapping->nrexceptional) { > + ret = dax_writeback_mapping_range(inode_mapping, sb->s_bdev, > + start, end); > + if (ret) > + return ret; > + } > +#endif > > ret = generic_file_fsync(file, start, end, datasync); > if (ret == -EIO || test_and_clear_bit(AS_EIO, &mapping->flags)) { > diff --git a/fs/ext4/fsync.c b/fs/ext4/fsync.c > index 8850254..e9cf53b 100644 > --- a/fs/ext4/fsync.c > +++ b/fs/ext4/fsync.c > @@ -27,6 +27,7 @@ > #include > #include > #include > +#include > > #include "ext4.h" > #include "ext4_jbd2.h" > @@ -83,10 +84,10 @@ static int ext4_sync_parent(struct inode *inode) > * What we do is just kick off a commit and wait on it. This will snapshot the > * inode to disk. > */ > - > int ext4_sync_file(struct file *file, loff_t start, loff_t end, int datasync) > { > struct inode *inode = file->f_mapping->host; > + struct address_space *mapping = inode->i_mapping; > struct ext4_inode_info *ei = EXT4_I(inode); > journal_t *journal = EXT4_SB(inode->i_sb)->s_journal; > int ret = 0, err; > @@ -97,6 +98,13 @@ int ext4_sync_file(struct file *file, loff_t start, loff_t end, int datasync) > > trace_ext4_sync_file_enter(file, datasync); > > + if (dax_mapping(mapping) && mapping->nrexceptional) { > + err = dax_writeback_mapping_range(mapping, inode->i_sb->s_bdev, > + start, end); > + if (err) > + goto out; > + } > + > if (inode->i_sb->s_flags & MS_RDONLY) { > /* Make sure that we read updated s_mount_flags value */ > smp_rmb(); > diff --git a/fs/xfs/xfs_file.c b/fs/xfs/xfs_file.c > index 52883ac..84e95cc 100644 > --- a/fs/xfs/xfs_file.c > +++ b/fs/xfs/xfs_file.c > @@ -209,7 +209,8 @@ xfs_file_fsync( > loff_t end, > int datasync) > { > - struct inode *inode = file->f_mapping->host; > + struct address_space *mapping = file->f_mapping; > + struct inode *inode = mapping->host; > struct xfs_inode *ip = XFS_I(inode); > struct xfs_mount *mp = ip->i_mount; > int error = 0; > @@ -218,7 +219,14 @@ xfs_file_fsync( > > trace_xfs_file_fsync(ip); > > - error = filemap_write_and_wait_range(inode->i_mapping, start, end); > + if (dax_mapping(mapping) && mapping->nrexceptional) { > + error = dax_writeback_mapping_range(mapping, > + xfs_find_bdev_for_inode(inode), start, end); > + if (error) > + return error; > + } > + > + error = filemap_write_and_wait_range(mapping, start, end); > if (error) > return error; > > diff --git a/include/linux/dax.h b/include/linux/dax.h > index bad27b0..8e9f114 100644 > --- a/include/linux/dax.h > +++ b/include/linux/dax.h > @@ -42,6 +42,6 @@ static inline bool dax_mapping(struct address_space *mapping) > { > return mapping->host && IS_DAX(mapping->host); > } > -int dax_writeback_mapping_range(struct address_space *mapping, loff_t start, > - loff_t end); > +int dax_writeback_mapping_range(struct address_space *mapping, > + struct block_device *bdev, loff_t start, loff_t end); > #endif > diff --git a/mm/filemap.c b/mm/filemap.c > index bc94386..c4286eb 100644 > --- a/mm/filemap.c > +++ b/mm/filemap.c > @@ -482,12 +482,6 @@ int filemap_write_and_wait_range(struct address_space *mapping, > { > int err = 0; > > - if (dax_mapping(mapping) && mapping->nrexceptional) { > - err = dax_writeback_mapping_range(mapping, lstart, lend); > - if (err) > - return err; > - } > - > if (mapping->nrpages) { > err = __filemap_fdatawrite_range(mapping, lstart, lend, > WB_SYNC_ALL); > -- > 2.5.0 > > -- Jan Kara SUSE Labs, CR From info1stsetup@gmail.com Mon Feb 8 07:09:21 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=FREEMAIL_FROM,HTML_MESSAGE, T_DKIM_INVALID autolearn=ham version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay2.corp.sgi.com [137.38.102.29]) by oss.sgi.com (Postfix) with ESMTP id 6D77229DF5 for ; Mon, 8 Feb 2016 07:09:21 -0600 (CST) Received: from cuda.sgi.com (cuda3.sgi.com [192.48.176.15]) by relay2.corp.sgi.com (Postfix) with ESMTP id 4D554304032 for ; Mon, 8 Feb 2016 05:09:18 -0800 (PST) X-ASG-Debug-ID: 1454936955-04cb6c27441741a0001-NocioJ Received: from mail-yw0-f174.google.com (mail-yw0-f174.google.com [209.85.161.174]) by cuda.sgi.com with ESMTP id kLBj5ccDxu5txF1l (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128 verify=NO) for ; Mon, 08 Feb 2016 05:09:16 -0800 (PST) X-Barracuda-Envelope-From: info1stsetup@gmail.com X-Barracuda-Apparent-Source-IP: 209.85.161.174 Received: by mail-yw0-f174.google.com with SMTP id q190so101116996ywd.3 for ; Mon, 08 Feb 2016 05:09:16 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=7En8ELjTuxDovCPhhF2pdd80XdXCNK3gCvGHQ5cdYvY=; b=cgHrtapPYTMn3bqdBfXDBgje69fYWCkIQq8SdkloJ04REkVWMPwVn8gYGzLp0lTo9D SserDnmCZJKF79UwS8HzlpaQm3sTKZx9EhUtAOcB+wK7NhbX//fZg3eyWwxMPMOqKpbm +skM5iKcOIEg7a2EWkKsP3GkC98lm4elci8liCyPyk2/b7RGHzjFg3VFEHx1Ig14UqJe gmlYYf5D0A6NAuJ/0dXnn0N/EgZf4cJJSrMSwiqNu5lrijR+4AaCtAkRGaFKtPTaZYXD ixlEWXHcIXtlg58NE1Wa34b9VQ0kK7oHKETf24KXXkxi8JmFwCZuraC8Ivx2TauDBBZM esHw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:date :message-id:subject:from:to:cc:content-type; bh=7En8ELjTuxDovCPhhF2pdd80XdXCNK3gCvGHQ5cdYvY=; b=jyoL0aPVR6dqV3gBgj2ImJfBms4uDqjye+SxDoo8g2pO6bRO9DsuhMWqNSXaIaa5o8 QNFpl1m+F4aMPQNRz6LI9orTJ+ADORrZu+zAf2Pt6i/8M4xitjy4J00fnk8QBY/fRnvD T/NwzbHivUOi2147GMtfW4lnRdCbjGkrvSRWFanaBBH3eR2JkGKGEVXcEo+htuJG7ZMJ tiSFqO25ofFFXa9cNRg5HDSnSwLldgc+xZIwqU5Bv2dOed1KrzZu6HIZsDtW9E9Mgmkj IwssPJ+0AIN0zHgY1BvZFdmu0tRM+s7LOJj0ImEDptY+guw6oCr0ViBbs6wmu284Ds9M me0A== X-Gm-Message-State: AG10YOQo1wgfcDNiRCawSl2Plg71IAeLRMKgfRAgrhn9+Zyl2mP3oUZLuwtRmI2bCIHJMkn+q+qspJCktJ/tsw== MIME-Version: 1.0 X-Received: by 10.129.0.198 with SMTP id 189mr15603235ywa.329.1454936955819; Mon, 08 Feb 2016 05:09:15 -0800 (PST) Received: by 10.37.13.145 with HTTP; Mon, 8 Feb 2016 05:09:15 -0800 (PST) In-Reply-To: <20160205223023.GL459@dastard> References: <20160205223023.GL459@dastard> Date: Mon, 8 Feb 2016 14:09:15 +0100 Message-ID: Subject: Re: Question about continous blocks for inode due to 'no space left on device' problem From: Michel Verbraak X-ASG-Orig-Subj: Re: Question about continous blocks for inode due to 'no space left on device' problem To: Dave Chinner Cc: xfs@oss.sgi.com Content-Type: multipart/alternative; boundary=001a114054466c2058052b41e8ef X-Barracuda-Connect: mail-yw0-f174.google.com[209.85.161.174] X-Barracuda-Start-Time: 1454936956 X-Barracuda-Encrypted: ECDHE-RSA-AES128-GCM-SHA256 X-Barracuda-URL: https://192.48.176.15:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-BRTS-Status: 1 X-Barracuda-Spam-Score: 0.00 X-Barracuda-Spam-Status: No, SCORE=0.00 using per-user scores of TAG_LEVEL=1000.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.7 tests=BSF_SC0_MISMATCH_TO, DKIM_SIGNED, DKIM_VERIFIED, HTML_MESSAGE X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.3.26855 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 0.00 BSF_SC0_MISMATCH_TO Envelope rcpt doesn't match header -0.00 DKIM_VERIFIED Domain Keys Identified Mail: signature passes verification 0.00 DKIM_SIGNED Domain Keys Identified Mail: message has a signature 0.00 HTML_MESSAGE BODY: HTML included in message --001a114054466c2058052b41e8ef Content-Type: text/plain; charset=UTF-8 2016-02-05 23:30 GMT+01:00 Dave Chinner : > On Fri, Feb 05, 2016 at 02:13:00PM +0100, Michel Verbraak wrote: > > All, > > > > Recently we ran into a problem where our filesystem (300GB in size) > > reported 'no space left on device' (ENOSPC) but when we looked at disk > > space usage and inode usage it was around 52% for disk space and 11% for > ....... > > > Store 03 (root@server):~# xfs_db -c freesp /dev/sdb > > from to extents blocks pct > > 1 1 3282633 3282633 9.03 > > 2 3 3416223 8372325 23.03 > > 4 7 6175009 24700036 67.94 > > Yup, no more aligned 4 block extents in the filesystem. > > Dave Thank you for your answer but are you able to explain a bit more on how you determine there are no aligned 4 block extends available? It apparently is not the 'from 4 to 7' line telling there are at least continuous extents of 4 blocks big. Or is it because 24700036 divided by 6175009 is exactly 4 and not a bit more? When I calculate the ratio between the individual AG freesp they were all four exactly 4. As said we would like to detect this problem from happening again. And we would like this detection to be done by our monitoring service. One of my colleagues mentions the following calculation to find out if there are enough aligned 4 block extents: Starting from line "from 4 to 7" calculate: - (4 * ) > 0. When not there is not enough free space for new inodes. On another system we have which does not see these problems yet we have: from to extents blocks pct 1 1 3483987 3483987 7.83 2 3 3560607 8709838 19.58 4 7 6402893 26486634 59.55 8 15 418450 5799206 13.04 26486634 / 6402893 = 4.136666 and 26486634 - (4 * 6402893) = 875062 > 0 and 5799205 - (4 * 418450) = 4125405 > 0 > into this condition. > > Cheers, > > Dave. > -- > Dave Chinner > david@fromorbit.com > Michel. --001a114054466c2058052b41e8ef Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable


2016-02-05 23:30 GMT+01:00 Dave Chinner <david@fromorbit.com&g= t;:
On Fri, Feb 05, 2016 at 02:13:00PM +0100, Michel Verbraak wrote:
> All,
>
> Recently we ran into a problem where our filesystem (300GB in size) > reported 'no space left on device' (ENOSPC) but when we looked= at disk
> space usage and inode usage it was around 52% for disk space and 11% f= or
.......

>
> Store 03 (root@server):~# xfs_db -c freesp /dev/sdb
>=C2=A0 =C2=A0 from=C2=A0 =C2=A0 =C2=A0 to extents=C2=A0 blocks=C2=A0 = =C2=A0 pct
>=C2=A0 =C2=A0 =C2=A0 =C2=A01=C2=A0 =C2=A0 =C2=A0 =C2=A01 3282633 328263= 3=C2=A0 =C2=A09.03
>=C2=A0 =C2=A0 =C2=A0 =C2=A02=C2=A0 =C2=A0 =C2=A0 =C2=A03 3416223 837232= 5=C2=A0 23.03
>=C2=A0 =C2=A0 =C2=A0 =C2=A04=C2=A0 =C2=A0 =C2=A0 =C2=A07 6175009 247000= 36=C2=A0 67.94

Yup, no more aligned 4 block extents in the filesystem.

Dave Thank you for your answer but are you able to explai= n a bit more on how you determine there are no aligned 4 block extends avai= lable?
It apparently is not the 'from 4 to 7' line te= lling there are at least continuous extents of 4 blocks big. Or is it becau= se 24700036 divided by 6175009 is = exactly 4 and not a bit more?
When I = calculate the ratio between the individual AG freesp they were all four exa= ctly 4.

As said we would like to detect this problem from happening again= . And we would like this detection to be done by our monitoring service.
One of my colleagues mentions the follo= wing calculation to find out if there are enough aligned 4 block extents:
Starting from line "from 4 to= 7" calculate: <blocks-column> - (4 * <extents-column>) &g= t; 0. When not there is not enough free space for new inodes.

On another system we have which does not see t= hese problems yet we have:

=C2=A0=C2=A0 from=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0 to extents=C2=A0 blocks=C2=A0=C2=A0=C2=A0 pct
=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0 1=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 1 3483987 3483987=C2=A0= =C2=A0 7.83
=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 2=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0 3 3560607 8709838=C2=A0 19.58
=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 4= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 7 6402893 26486634=C2=A0 59.55
=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0 8=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 15=C2=A0 418450= 5799206=C2=A0 13.04

26486634 / <= /span>6402893 =3D 4.136666 and
26486634 - (4 * 6402893) =3D 875062 >= ; 0 and
5799205 - (4 * 418450) =3D 4125405 > 0
= =C2=A0
into this= condition.

Cheers,

Dave.
--
Dave Chinner
david@fromorbit.com

Miche= l.
--001a114054466c2058052b41e8ef-- From jack@suse.cz Mon Feb 8 08:27:38 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=ham version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay1.corp.sgi.com [137.38.102.111]) by oss.sgi.com (Postfix) with ESMTP id 43BDD29DF5 for ; Mon, 8 Feb 2016 08:27:38 -0600 (CST) Received: from cuda.sgi.com (cuda3.sgi.com [192.48.176.15]) by relay1.corp.sgi.com (Postfix) with ESMTP id 338108F8035 for ; Mon, 8 Feb 2016 06:27:35 -0800 (PST) X-ASG-Debug-ID: 1454941652-04cb6c2744179e10001-NocioJ Received: from mx2.suse.de (mx2.suse.de [195.135.220.15]) by cuda.sgi.com with ESMTP id smBlhlpdPmAjX83W (version=TLSv1 cipher=ECDHE-RSA-AES256-SHA bits=256 verify=NO) for ; Mon, 08 Feb 2016 06:27:33 -0800 (PST) X-Barracuda-Envelope-From: jack@suse.cz X-Barracuda-Apparent-Source-IP: 195.135.220.15 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay1.suse.de (charybdis-ext.suse.de [195.135.220.254]) by mx2.suse.de (Postfix) with ESMTP id 2F496ACA1; Mon, 8 Feb 2016 14:27:32 +0000 (UTC) Received: by quack.suse.cz (Postfix, from userid 1000) id 3E7ED823D6; Mon, 8 Feb 2016 15:27:49 +0100 (CET) Date: Mon, 8 Feb 2016 15:27:49 +0100 From: Jan Kara To: Dave Chinner Cc: Jan Kara , linux-fsdevel@vger.kernel.org, ocfs2-devel@oss.oracle.com, Mark Fasheh , Joel Becker , xfs@oss.sgi.com Subject: Re: [PATCH 1/3] quota: Add support for ->get_nextdqblk() for VFS quota Message-ID: <20160208142749.GD9451@quack.suse.cz> X-ASG-Orig-Subj: Re: [PATCH 1/3] quota: Add support for ->get_nextdqblk() for VFS quota References: <1454596087-6814-1-git-send-email-jack@suse.cz> <1454596087-6814-2-git-send-email-jack@suse.cz> <20160205010519.GJ459@dastard> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20160205010519.GJ459@dastard> User-Agent: Mutt/1.5.24 (2015-08-30) X-Barracuda-Connect: mx2.suse.de[195.135.220.15] X-Barracuda-Start-Time: 1454941653 X-Barracuda-Encrypted: ECDHE-RSA-AES256-SHA X-Barracuda-URL: https://192.48.176.15:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-BRTS-Status: 1 X-Barracuda-Spam-Score: 0.00 X-Barracuda-Spam-Status: No, SCORE=0.00 using per-user scores of TAG_LEVEL=1000.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.7 tests=BSF_SC0_MISMATCH_TO X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.3.26857 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 0.00 BSF_SC0_MISMATCH_TO Envelope rcpt doesn't match header On Fri 05-02-16 12:05:19, Dave Chinner wrote: > On Thu, Feb 04, 2016 at 03:28:05PM +0100, Jan Kara wrote: > > Add infrastructure for supporting get_nextdqblk() callback for VFS > > quotas. Translate the operation into a callback to appropriate > > filesystem and consequently to quota format callback. > > > > Signed-off-by: Jan Kara > > I'm a little confused here. What patchset is this dependent on? i.e. > what introduces the ->get_nextdqblk method? It depends on the patches Eric sent which introduce ->get_nextdqblk. > The patches I currently have in my XFS working tree introduce this > (quota: add new quotactl Q_XGETNEXTQUOTA) and everythign else is > dependent on this. I looked a coupl eof days ago and I wasnt' able > to find this in your tree. Yeah, I have this patch as well, I just didn't push out. > I'd much prefer that one of us publish a stable branch with just the > quotactl() infrastructure (i.e. commands and bits up to the > ->get_nextdqblk() callback) that we can then both base the different > subsystem implementations off, rather than one of us having to pull > in a whole tree of changes just to get the one commit we need... Sure, I have pushed out: 'getnextquota' branch into my tree git://git.kernel.org/pub/scm/linux/kernel/git/jack/linux-fs.git which contains the patches from Eric I carry (including fixups in comments other minor stuff I have found during final review). Can you please base XFS patches on top of this branch? Thanks! Honza -- Jan Kara SUSE Labs, CR From jack@suse.cz Mon Feb 8 08:34:20 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=ham version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay3.corp.sgi.com [198.149.34.15]) by oss.sgi.com (Postfix) with ESMTP id D3A5929DF5 for ; Mon, 8 Feb 2016 08:34:19 -0600 (CST) Received: from cuda.sgi.com (cuda1.sgi.com [192.48.157.11]) by relay3.corp.sgi.com (Postfix) with ESMTP id 70D2AAC001 for ; Mon, 8 Feb 2016 06:34:19 -0800 (PST) X-ASG-Debug-ID: 1454942056-04bdf079c5144230001-NocioJ Received: from mx2.suse.de (mx2.suse.de [195.135.220.15]) by cuda.sgi.com with ESMTP id 17gaf2CwE4iKmG1c (version=TLSv1 cipher=ECDHE-RSA-AES256-SHA bits=256 verify=NO) for ; Mon, 08 Feb 2016 06:34:16 -0800 (PST) X-Barracuda-Envelope-From: jack@suse.cz X-Barracuda-Apparent-Source-IP: 195.135.220.15 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 9FE21AAB4; Mon, 8 Feb 2016 14:34:15 +0000 (UTC) Received: by quack.suse.cz (Postfix, from userid 1000) id 1D464823D6; Mon, 8 Feb 2016 15:34:33 +0100 (CET) Date: Mon, 8 Feb 2016 15:34:33 +0100 From: Jan Kara To: Dave Chinner Cc: Jan Kara , linux-fsdevel@vger.kernel.org, ocfs2-devel@oss.oracle.com, Mark Fasheh , Joel Becker , xfs@oss.sgi.com Subject: Re: [PATCH 1/3] quota: Add support for ->get_nextdqblk() for VFS quota Message-ID: <20160208143433.GA4468@quack.suse.cz> X-ASG-Orig-Subj: Re: [PATCH 1/3] quota: Add support for ->get_nextdqblk() for VFS quota References: <1454596087-6814-1-git-send-email-jack@suse.cz> <1454596087-6814-2-git-send-email-jack@suse.cz> <20160205010519.GJ459@dastard> <20160208142749.GD9451@quack.suse.cz> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20160208142749.GD9451@quack.suse.cz> User-Agent: Mutt/1.5.24 (2015-08-30) X-Barracuda-Connect: mx2.suse.de[195.135.220.15] X-Barracuda-Start-Time: 1454942056 X-Barracuda-Encrypted: ECDHE-RSA-AES256-SHA X-Barracuda-URL: https://192.48.157.11:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-BRTS-Status: 1 X-Barracuda-Spam-Score: 0.00 X-Barracuda-Spam-Status: No, SCORE=0.00 using per-user scores of TAG_LEVEL=1000.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.7 tests=BSF_SC0_MISMATCH_TO X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.3.26857 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 0.00 BSF_SC0_MISMATCH_TO Envelope rcpt doesn't match header On Mon 08-02-16 15:27:49, Jan Kara wrote: > On Fri 05-02-16 12:05:19, Dave Chinner wrote: > > On Thu, Feb 04, 2016 at 03:28:05PM +0100, Jan Kara wrote: > > > Add infrastructure for supporting get_nextdqblk() callback for VFS > > > quotas. Translate the operation into a callback to appropriate > > > filesystem and consequently to quota format callback. > > > > > > Signed-off-by: Jan Kara > > > > I'm a little confused here. What patchset is this dependent on? i.e. > > what introduces the ->get_nextdqblk method? > > It depends on the patches Eric sent which introduce ->get_nextdqblk. > > > The patches I currently have in my XFS working tree introduce this > > (quota: add new quotactl Q_XGETNEXTQUOTA) and everythign else is > > dependent on this. I looked a coupl eof days ago and I wasnt' able > > to find this in your tree. > > Yeah, I have this patch as well, I just didn't push out. > > > I'd much prefer that one of us publish a stable branch with just the > > quotactl() infrastructure (i.e. commands and bits up to the > > ->get_nextdqblk() callback) that we can then both base the different > > subsystem implementations off, rather than one of us having to pull > > in a whole tree of changes just to get the one commit we need... > > Sure, I have pushed out: > > 'getnextquota' branch into my tree > > git://git.kernel.org/pub/scm/linux/kernel/git/jack/linux-fs.git > > which contains the patches from Eric I carry (including fixups in comments > other minor stuff I have found during final review). Can you please base > XFS patches on top of this branch? Thanks! Ah, now I saw your next email and you already created the stable branch. OK, since I didn't push out anything yet, I will base my branches on top of yours. I have made some small fixups in the comments but I can push these as a separate patch. Honza -- Jan Kara SUSE Labs, CR From bfoster@redhat.com Mon Feb 8 08:35:35 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=ham version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay1.corp.sgi.com [137.38.102.111]) by oss.sgi.com (Postfix) with ESMTP id B808F29DF5 for ; Mon, 8 Feb 2016 08:35:35 -0600 (CST) Received: from cuda.sgi.com (cuda3.sgi.com [192.48.176.15]) by relay1.corp.sgi.com (Postfix) with ESMTP id 980AF8F804C for ; Mon, 8 Feb 2016 06:35:35 -0800 (PST) X-ASG-Debug-ID: 1454942133-04cb6c274417a950001-NocioJ Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by cuda.sgi.com with ESMTP id 242H7aEssxaOGcPR (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO) for ; Mon, 08 Feb 2016 06:35:34 -0800 (PST) X-Barracuda-Envelope-From: bfoster@redhat.com X-Barracuda-Apparent-Source-IP: 209.132.183.28 X-ASG-Whitelist: Client Received: from int-mx14.intmail.prod.int.phx2.redhat.com (int-mx14.intmail.prod.int.phx2.redhat.com [10.5.11.27]) by mx1.redhat.com (Postfix) with ESMTPS id CAE0196CD; Mon, 8 Feb 2016 14:35:33 +0000 (UTC) Received: from bfoster.bfoster (dhcp-41-164.bos.redhat.com [10.18.41.164]) by int-mx14.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id u18EZXsa001578; Mon, 8 Feb 2016 09:35:33 -0500 Received: by bfoster.bfoster (Postfix, from userid 1000) id 5F46F123DF8; Mon, 8 Feb 2016 09:35:32 -0500 (EST) Date: Mon, 8 Feb 2016 09:35:32 -0500 From: Brian Foster To: Michel Verbraak Cc: Dave Chinner , xfs@oss.sgi.com Subject: Re: Question about continous blocks for inode due to 'no space left on device' problem Message-ID: <20160208143531.GA19597@bfoster.bfoster> X-ASG-Orig-Subj: Re: Question about continous blocks for inode due to 'no space left on device' problem References: <20160205223023.GL459@dastard> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.24 (2015-08-30) X-Scanned-By: MIMEDefang 2.68 on 10.5.11.27 X-Barracuda-Connect: mx1.redhat.com[209.132.183.28] X-Barracuda-Start-Time: 1454942134 X-Barracuda-Encrypted: ECDHE-RSA-AES256-GCM-SHA384 X-Barracuda-URL: https://192.48.176.15:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-BRTS-Status: 1 On Mon, Feb 08, 2016 at 02:09:15PM +0100, Michel Verbraak wrote: > 2016-02-05 23:30 GMT+01:00 Dave Chinner : > > > On Fri, Feb 05, 2016 at 02:13:00PM +0100, Michel Verbraak wrote: > > > All, > > > > > > Recently we ran into a problem where our filesystem (300GB in size) > > > reported 'no space left on device' (ENOSPC) but when we looked at disk > > > space usage and inode usage it was around 52% for disk space and 11% for > > ....... > > > > > > > Store 03 (root@server):~# xfs_db -c freesp /dev/sdb > > > from to extents blocks pct > > > 1 1 3282633 3282633 9.03 > > > 2 3 3416223 8372325 23.03 > > > 4 7 6175009 24700036 67.94 > > > > Yup, no more aligned 4 block extents in the filesystem. > > > > Dave Thank you for your answer but are you able to explain a bit more on > how you determine there are no aligned 4 block extends available? > It apparently is not the 'from 4 to 7' line telling there are at least > continuous extents of 4 blocks big. Or is it because 24700036 divided > by 6175009 > is exactly 4 and not a bit more? > When I calculate the ratio between the individual AG freesp they were all > four exactly 4. > I'm not sure there is a way to determine whether these extents are aligned or not short of walking the free space btree structures with xfs_db checking directly. IIRC from doing some of the sparse inode work, the slight caveat to this whole thing is that it's technically not enough to have an aligned extent available to satisfy an inode chunk allocation. The allocation group has to have an extent large enough for the inode chunk plus some set of blocks to _guarantee_ the allocation can be aligned for the caller. If you look at the code in xfs_alloc_space_available(), you can see that in practice the allocator will start to fail when the longest free extent in the AG is less than something along the lines of + . For a 4k fsb fs w/ 256b inodes (and thus 16k inode chunks), a quick test shows that the alignment is 8k (for a 24k total required extent length). I do wonder if we could do something basic here like search the AG for an actual aligned extent, but I expect performance would be terrible so this would be a last resort (and may or may not be useful). Another option might be to scan or somehow or another track the number of inode chunk aligned extents in each AG based on the inode alignment of the fs, but I'd have to investigate how easy that is to see whether it's worth it. BTW, a metadump of your fs while it's in this ENOSPC state would be useful towards testing something like that, if you'd be willing to provide one. Note that xfs_metadump has obfuscation that hides filenames and whatnot for privacy purposes. Brian > As said we would like to detect this problem from happening again. And we > would like this detection to be done by our monitoring service. > One of my colleagues mentions the following calculation to find out if > there are enough aligned 4 block extents: > > Starting from line "from 4 to 7" calculate: - (4 * > ) > 0. When not there is not enough free space for new > inodes. > > On another system we have which does not see these problems yet we have: > > from to extents blocks pct > 1 1 3483987 3483987 7.83 > 2 3 3560607 8709838 19.58 > 4 7 6402893 26486634 59.55 > 8 15 418450 5799206 13.04 > > 26486634 / 6402893 = 4.136666 and > 26486634 - (4 * 6402893) = 875062 > 0 and > 5799205 - (4 * 418450) = 4125405 > 0 > > > > into this condition. > > > > Cheers, > > > > Dave. > > -- > > Dave Chinner > > david@fromorbit.com > > > > Michel. > _______________________________________________ > xfs mailing list > xfs@oss.sgi.com > http://oss.sgi.com/mailman/listinfo/xfs From info1stsetup@gmail.com Mon Feb 8 09:13:13 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=FREEMAIL_FROM,HTML_MESSAGE, T_DKIM_INVALID autolearn=ham version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay2.corp.sgi.com [137.38.102.29]) by oss.sgi.com (Postfix) with ESMTP id 2E6EE29DF5 for ; Mon, 8 Feb 2016 09:13:13 -0600 (CST) Received: from cuda.sgi.com (cuda3.sgi.com [192.48.176.15]) by relay2.corp.sgi.com (Postfix) with ESMTP id 0FB12304051 for ; Mon, 8 Feb 2016 07:13:13 -0800 (PST) X-ASG-Debug-ID: 1454944387-04cb6c274717d950001-NocioJ Received: from mail-yk0-f175.google.com (mail-yk0-f175.google.com [209.85.160.175]) by cuda.sgi.com with ESMTP id fHPdeoGWbXHTIHSO (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128 verify=NO) for ; Mon, 08 Feb 2016 07:13:07 -0800 (PST) X-Barracuda-Envelope-From: info1stsetup@gmail.com X-Barracuda-Apparent-Source-IP: 209.85.160.175 Received: by mail-yk0-f175.google.com with SMTP id r207so88205632ykd.2 for ; Mon, 08 Feb 2016 07:13:07 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=y5Kkr0sClTju6E8Hz5nHgxsyGU4ydJRrbptnvdNeMTY=; b=x1JoJE3psRxPWn3hXROAs93RGzHTrL2KqMO0FNdBKSIA5QLd/OE1cKcuBL1cgVRTKZ TuD96gabfyfcKxg0KGup2W3PGNfvZ+X9FrjYmIVgo2ke1ZrZ8gWIk6jB9RKwI1gn8dYT CEsLP5/ytHm4vRezDDj88Y5Eby63se69npEHZYUcPdIMbovC2zFf7oRJ/tJDSijgg9Rs EoG5rhrSOq3Ljsr9ZaMgbgS6Vi5Q1iRkT7/Yc8J0N4UUCw8WH9HpUhSFI/Rb7TQFRNN+ 5fMSw4qp7KNB70tH02A7pPYj1Jn9P+fGsqraQhh1kXGJMrIYfNiUmCuGHsHKOq5O/8vz b+GA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:date :message-id:subject:from:to:cc:content-type; bh=y5Kkr0sClTju6E8Hz5nHgxsyGU4ydJRrbptnvdNeMTY=; b=hJ/VJgCyCDHZuo7G88slXXO3V/G/5BJq53KR34Bg1TPUHqxFZKvQGWrnyEy+Wwztye csIAqKoMafdcbU62DjaILGvrv7WxqD4EToQnm+x3qb7viGpsT+VlN6BMykYfIaE6iElR eQmQRcmJWofSIFbR68Bh19MkWic8Baep/oFxH37UZMPVUnjsf5hChVQBBSdEax1k2rsc pJsGUK7OYW63Vzn+PyeQrAwukNb2y2JabPsIS/EM86L2VWteBQp37KZzK8RRbHibRaLu 7cP5J1hkTNaQSGq7gQEtIQqXR8abzbi3pSSzCAsaICk8ihT0mZhjJdbdSEDHVbEBGRoV QSSQ== X-Gm-Message-State: AG10YOSYTcq7rTk2ZrfYtpmPeT9uaAoXPtahkCWRztOaGZg7bFJC1OlhYK45gQRkSgCix6eRuRnTNOK1GhJ9pQ== MIME-Version: 1.0 X-Received: by 10.37.77.131 with SMTP id a125mr15273284ybb.174.1454944386998; Mon, 08 Feb 2016 07:13:06 -0800 (PST) Received: by 10.37.13.145 with HTTP; Mon, 8 Feb 2016 07:13:06 -0800 (PST) In-Reply-To: <20160208143531.GA19597@bfoster.bfoster> References: <20160205223023.GL459@dastard> <20160208143531.GA19597@bfoster.bfoster> Date: Mon, 8 Feb 2016 16:13:06 +0100 Message-ID: Subject: Re: Question about continous blocks for inode due to 'no space left on device' problem From: Michel Verbraak X-ASG-Orig-Subj: Re: Question about continous blocks for inode due to 'no space left on device' problem To: Brian Foster Cc: Dave Chinner , xfs@oss.sgi.com Content-Type: multipart/alternative; boundary=001a113c5fc05aedbd052b43a3c7 X-Barracuda-Connect: mail-yk0-f175.google.com[209.85.160.175] X-Barracuda-Start-Time: 1454944387 X-Barracuda-Encrypted: ECDHE-RSA-AES128-GCM-SHA256 X-Barracuda-URL: https://192.48.176.15:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-BRTS-Status: 1 X-Barracuda-Spam-Score: 0.00 X-Barracuda-Spam-Status: No, SCORE=0.00 using per-user scores of TAG_LEVEL=1000.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.7 tests=BSF_SC0_MISMATCH_TO, DKIM_SIGNED, DKIM_VERIFIED, HTML_MESSAGE X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.3.26857 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 0.00 BSF_SC0_MISMATCH_TO Envelope rcpt doesn't match header -0.00 DKIM_VERIFIED Domain Keys Identified Mail: signature passes verification 0.00 DKIM_SIGNED Domain Keys Identified Mail: message has a signature 0.00 HTML_MESSAGE BODY: HTML included in message --001a113c5fc05aedbd052b43a3c7 Content-Type: text/plain; charset=UTF-8 2016-02-08 15:35 GMT+01:00 Brian Foster : > On Mon, Feb 08, 2016 at 02:09:15PM +0100, Michel Verbraak wrote: > > 2016-02-05 23:30 GMT+01:00 Dave Chinner : > > > > > On Fri, Feb 05, 2016 at 02:13:00PM +0100, Michel Verbraak wrote: > > > > All, > > > > > > > > Recently we ran into a problem where our filesystem (300GB in size) > > > > reported 'no space left on device' (ENOSPC) but when we looked at > disk > > > > space usage and inode usage it was around 52% for disk space and 11% > for > > > ....... > > > > > > > > > > > Store 03 (root@server):~# xfs_db -c freesp /dev/sdb > > > > from to extents blocks pct > > > > 1 1 3282633 3282633 9.03 > > > > 2 3 3416223 8372325 23.03 > > > > 4 7 6175009 24700036 67.94 > > > > > > Yup, no more aligned 4 block extents in the filesystem. > > > > > > Dave Thank you for your answer but are you able to explain a bit more > on > > how you determine there are no aligned 4 block extends available? > > It apparently is not the 'from 4 to 7' line telling there are at least > > continuous extents of 4 blocks big. Or is it because 24700036 divided > > by 6175009 > > is exactly 4 and not a bit more? > > When I calculate the ratio between the individual AG freesp they were all > > four exactly 4. > > > > I'm not sure there is a way to determine whether these extents are > aligned or not short of walking the free space btree structures with > .. > BTW, a metadump of your fs while it's in this ENOSPC state would be > useful towards testing something like that, if you'd be willing to > provide one. Note that xfs_metadump has obfuscation that hides filenames > and whatnot for privacy purposes. > > If we do run into problem again, we do hope not as it is on a production system, we will create the xfs_metadump and provide it to this list. Thank you for the extra explanation. Cheers Michel. > Brian > > > As said we would like to detect this problem from happening again. And we > > would like this detection to be done by our monitoring service. > > One of my colleagues mentions the following calculation to find out if > > there are enough aligned 4 block extents: > > > > Starting from line "from 4 to 7" calculate: - (4 * > > ) > 0. When not there is not enough free space for new > > inodes. > > > > On another system we have which does not see these problems yet we have: > > > > from to extents blocks pct > > 1 1 3483987 3483987 7.83 > > 2 3 3560607 8709838 19.58 > > 4 7 6402893 26486634 59.55 > > 8 15 418450 5799206 13.04 > > > > 26486634 / 6402893 = 4.136666 and > > 26486634 - (4 * 6402893) = 875062 > 0 and > > 5799205 - (4 * 418450) = 4125405 > 0 > > > > > > > into this condition. > > > > > > Cheers, > > > > > > Dave. > > > -- > > > Dave Chinner > > > david@fromorbit.com > > > > > > > Michel. > > > _______________________________________________ > > xfs mailing list > > xfs@oss.sgi.com > > http://oss.sgi.com/mailman/listinfo/xfs > > --001a113c5fc05aedbd052b43a3c7 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable


2016-02-08 15:35 GMT+01:00 Brian Foster <bfoster@redhat.com>= :
On Mon, Feb 08, 2016 at 02:09:15PM +0100, Michel Verbraak wrote: > 2016-02-05 23:30 GMT+01:00 Dave Chinner <david@fromorbit.com>:
>
> > On Fri, Feb 05, 2016 at 02:13:00PM +0100, Michel Verbraak wrote:<= br> > > > All,
> > >
> > > Recently we ran into a problem where our filesystem (300GB i= n size)
> > > reported 'no space left on device' (ENOSPC) but when= we looked at disk
> > > space usage and inode usage it was around 52% for disk space= and 11% for
> > .......
>
>
> >
> > > Store 03 (root@server):~# xfs_db -c freesp /dev/sdb
> > >=C2=A0 =C2=A0 from=C2=A0 =C2=A0 =C2=A0 to extents=C2=A0 block= s=C2=A0 =C2=A0 pct
> > >=C2=A0 =C2=A0 =C2=A0 =C2=A01=C2=A0 =C2=A0 =C2=A0 =C2=A01 3282= 633 3282633=C2=A0 =C2=A09.03
> > >=C2=A0 =C2=A0 =C2=A0 =C2=A02=C2=A0 =C2=A0 =C2=A0 =C2=A03 3416= 223 8372325=C2=A0 23.03
> > >=C2=A0 =C2=A0 =C2=A0 =C2=A04=C2=A0 =C2=A0 =C2=A0 =C2=A07 6175= 009 24700036=C2=A0 67.94
> >
> > Yup, no more aligned 4 block extents in the filesystem.
> >
> > Dave Thank you for your answer but are you able to explain a bit = more on
> how you determine there are no aligned 4 block extends available?
> It apparently is not the 'from 4 to 7' line telling there are = at least
> continuous extents of 4 blocks big. Or is it because 24700036 divided<= br> > by 6175009
> is exactly 4 and not a bit more?
> When I calculate the ratio between the individual AG freesp they were = all
> four exactly 4.
>

I'm not sure there is a way to determine whether these extents a= re
aligned or not short of walking the free space btree structures with
..<snip>=C2=A0
=C2=A0
BTW, a metadump of your fs while it's in this ENOSPC state would be
useful towards testing something like that, if you'd be willing to
provide one. Note that xfs_metadump has obfuscation that hides filenames and whatnot for privacy purposes.

If we do run into problem again, we do hope not= as it is on a production system, we will create the xfs_metadump and provi= de it to this list.

Thank you for the extra explanation.<= br>
Cheers Michel.
=C2=A0
Brian

> As said we would like to detect this problem from happening again. And= we
> would like this detection to be done by our monitoring service.
> One of my colleagues mentions the following calculation to find out if=
> there are enough aligned 4 block extents:
>
> Starting from line "from 4 to 7" calculate: <blocks-colum= n> - (4 *
> <extents-column>) > 0. When not there is not enough free spac= e for new
> inodes.
>
> On another system we have which does not see these problems yet we hav= e:
>
>=C2=A0 =C2=A0 from=C2=A0 =C2=A0 =C2=A0 to extents=C2=A0 blocks=C2=A0 = =C2=A0 pct
>=C2=A0 =C2=A0 =C2=A0 =C2=A01=C2=A0 =C2=A0 =C2=A0 =C2=A01 3483987 348398= 7=C2=A0 =C2=A07.83
>=C2=A0 =C2=A0 =C2=A0 =C2=A02=C2=A0 =C2=A0 =C2=A0 =C2=A03 3560607 870983= 8=C2=A0 19.58
>=C2=A0 =C2=A0 =C2=A0 =C2=A04=C2=A0 =C2=A0 =C2=A0 =C2=A07 6402893 264866= 34=C2=A0 59.55
>=C2=A0 =C2=A0 =C2=A0 =C2=A08=C2=A0 =C2=A0 =C2=A0 15=C2=A0 418450 579920= 6=C2=A0 13.04
>
> 26486634 / 6402893 =3D 4.136666 and
> 26486634 - (4 * 6402893) =3D 875062 > 0 and
> 5799205 - (4 * 418450) =3D 4125405 > 0
>
>
> > into this condition.
> >
> > Cheers,
> >
> > Dave.
> > --
> > Dave Chinner
> > david@fromorbit.com > >
>
> Michel.

> _______________________________________________
> xfs mailing list
> xfs@oss.sgi.com
> http://oss.sgi.com/mailman/listinfo/xfs


--001a113c5fc05aedbd052b43a3c7-- From bfoster@redhat.com Mon Feb 8 09:29:28 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=ham version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay3.corp.sgi.com [198.149.34.15]) by oss.sgi.com (Postfix) with ESMTP id 7A5A529DF5 for ; Mon, 8 Feb 2016 09:29:28 -0600 (CST) Received: from cuda.sgi.com (cuda3.sgi.com [192.48.176.15]) by relay3.corp.sgi.com (Postfix) with ESMTP id E0F6FAC002 for ; Mon, 8 Feb 2016 07:29:24 -0800 (PST) X-ASG-Debug-ID: 1454945361-04cb6c274417f740001-NocioJ Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by cuda.sgi.com with ESMTP id EboppOBLuR8Uk77n (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO) for ; Mon, 08 Feb 2016 07:29:22 -0800 (PST) X-Barracuda-Envelope-From: bfoster@redhat.com X-Barracuda-Apparent-Source-IP: 209.132.183.28 X-ASG-Whitelist: Client Received: from int-mx14.intmail.prod.int.phx2.redhat.com (int-mx14.intmail.prod.int.phx2.redhat.com [10.5.11.27]) by mx1.redhat.com (Postfix) with ESMTPS id D95D33D1EB; Mon, 8 Feb 2016 15:29:21 +0000 (UTC) Received: from bfoster.bfoster (dhcp-41-164.bos.redhat.com [10.18.41.164]) by int-mx14.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id u18FTLvB014004; Mon, 8 Feb 2016 10:29:21 -0500 Received: by bfoster.bfoster (Postfix, from userid 1000) id 45B36123DF8; Mon, 8 Feb 2016 10:29:20 -0500 (EST) Date: Mon, 8 Feb 2016 10:29:20 -0500 From: Brian Foster To: Dave Chinner Cc: xfs@oss.sgi.com Subject: Re: [PATCH 3/9] xfs: cull unnecessary icdinode fields Message-ID: <20160208152919.GB19597@bfoster.bfoster> X-ASG-Orig-Subj: Re: [PATCH 3/9] xfs: cull unnecessary icdinode fields References: <1454905461-2773-1-git-send-email-david@fromorbit.com> <1454905461-2773-4-git-send-email-david@fromorbit.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1454905461-2773-4-git-send-email-david@fromorbit.com> User-Agent: Mutt/1.5.24 (2015-08-30) X-Scanned-By: MIMEDefang 2.68 on 10.5.11.27 X-Barracuda-Connect: mx1.redhat.com[209.132.183.28] X-Barracuda-Start-Time: 1454945362 X-Barracuda-Encrypted: ECDHE-RSA-AES256-GCM-SHA384 X-Barracuda-URL: https://192.48.176.15:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-BRTS-Status: 1 On Mon, Feb 08, 2016 at 03:24:15PM +1100, Dave Chinner wrote: > From: Dave Chinner > > Now that the struct xfs_icdinode is not directly related to the > on-disk format, we can cull things in it we really don't need to > store: > > - magic number never changes > - padding is not necessary > - next_unlinked is never used > - inode number is redundant > - uuid is redundant > - lsn is accessed directly from dinode > - inode CRC is only accessed directly from dinode > > Hence we can remove these from the struct xfs_icdinode and redirect > the code that uses them to the xfs_dinode appripriately. This > reduces the size of the struct icdinode from 152 bytes to 88 bytes, > and removes a fair chunk of unnecessary code, too. > > Signed-off-by: Dave Chinner > --- Reviewed-by: Brian Foster > fs/xfs/libxfs/xfs_inode_buf.c | 39 +++++++++++++-------------------------- > fs/xfs/libxfs/xfs_inode_buf.h | 25 ++++++------------------- > fs/xfs/xfs_inode.c | 19 +------------------ > fs/xfs/xfs_inode_item.c | 19 +++++++++++-------- > 4 files changed, 31 insertions(+), 71 deletions(-) > > diff --git a/fs/xfs/libxfs/xfs_inode_buf.c b/fs/xfs/libxfs/xfs_inode_buf.c > index 26e3c46..17ff4e8 100644 > --- a/fs/xfs/libxfs/xfs_inode_buf.c > +++ b/fs/xfs/libxfs/xfs_inode_buf.c > @@ -202,7 +202,6 @@ xfs_inode_from_disk( > struct xfs_icdinode *to = &ip->i_d; > struct inode *inode = VFS_I(ip); > > - to->di_magic = be16_to_cpu(from->di_magic); > to->di_mode = be16_to_cpu(from->di_mode); > to->di_version = from ->di_version; > to->di_format = from->di_format; > @@ -212,7 +211,6 @@ xfs_inode_from_disk( > to->di_nlink = be32_to_cpu(from->di_nlink); > to->di_projid_lo = be16_to_cpu(from->di_projid_lo); > to->di_projid_hi = be16_to_cpu(from->di_projid_hi); > - memcpy(to->di_pad, from->di_pad, sizeof(to->di_pad)); > to->di_flushiter = be16_to_cpu(from->di_flushiter); > > /* > @@ -245,24 +243,22 @@ xfs_inode_from_disk( > to->di_crtime.t_sec = be32_to_cpu(from->di_crtime.t_sec); > to->di_crtime.t_nsec = be32_to_cpu(from->di_crtime.t_nsec); > to->di_flags2 = be64_to_cpu(from->di_flags2); > - to->di_ino = be64_to_cpu(from->di_ino); > - to->di_lsn = be64_to_cpu(from->di_lsn); > - memcpy(to->di_pad2, from->di_pad2, sizeof(to->di_pad2)); > - uuid_copy(&to->di_uuid, &from->di_uuid); > } > } > > void > xfs_inode_to_disk( > struct xfs_inode *ip, > - struct xfs_dinode *to) > + struct xfs_dinode *to, > + xfs_lsn_t lsn) > { > struct xfs_icdinode *from = &ip->i_d; > struct inode *inode = VFS_I(ip); > > - to->di_magic = cpu_to_be16(from->di_magic); > + to->di_magic = cpu_to_be16(XFS_DINODE_MAGIC); > + > to->di_mode = cpu_to_be16(from->di_mode); > - to->di_version = from ->di_version; > + to->di_version = from->di_version; > to->di_format = from->di_format; > to->di_onlink = cpu_to_be16(from->di_onlink); > to->di_uid = cpu_to_be32(from->di_uid); > @@ -270,8 +266,8 @@ xfs_inode_to_disk( > to->di_nlink = cpu_to_be32(from->di_nlink); > to->di_projid_lo = cpu_to_be16(from->di_projid_lo); > to->di_projid_hi = cpu_to_be16(from->di_projid_hi); > - memcpy(to->di_pad, from->di_pad, sizeof(to->di_pad)); > > + memset(to->di_pad, 0, sizeof(to->di_pad)); > to->di_atime.t_sec = cpu_to_be32(inode->i_atime.tv_sec); > to->di_atime.t_nsec = cpu_to_be32(inode->i_atime.tv_nsec); > to->di_mtime.t_sec = cpu_to_be32(inode->i_mtime.tv_sec); > @@ -296,10 +292,11 @@ xfs_inode_to_disk( > to->di_crtime.t_sec = cpu_to_be32(from->di_crtime.t_sec); > to->di_crtime.t_nsec = cpu_to_be32(from->di_crtime.t_nsec); > to->di_flags2 = cpu_to_be64(from->di_flags2); > - to->di_ino = cpu_to_be64(from->di_ino); > - to->di_lsn = cpu_to_be64(from->di_lsn); > - memcpy(to->di_pad2, from->di_pad2, sizeof(to->di_pad2)); > - uuid_copy(&to->di_uuid, &from->di_uuid); > + > + to->di_ino = cpu_to_be64(ip->i_ino); > + to->di_lsn = cpu_to_be64(lsn); > + memset(to->di_pad2, 0, sizeof(to->di_pad2)); > + uuid_copy(&to->di_uuid, &ip->i_mount->m_sb.sb_meta_uuid); > to->di_flushiter = 0; > } else { > to->di_flushiter = cpu_to_be16(from->di_flushiter); > @@ -434,13 +431,10 @@ xfs_iread( > !(mp->m_flags & XFS_MOUNT_IKEEP)) { > /* initialise the on-disk inode core */ > memset(&ip->i_d, 0, sizeof(ip->i_d)); > - ip->i_d.di_magic = XFS_DINODE_MAGIC; > ip->i_d.di_gen = prandom_u32(); > - if (xfs_sb_version_hascrc(&mp->m_sb)) { > + if (xfs_sb_version_hascrc(&mp->m_sb)) > ip->i_d.di_version = 3; > - ip->i_d.di_ino = ip->i_ino; > - uuid_copy(&ip->i_d.di_uuid, &mp->m_sb.sb_meta_uuid); > - } else > + else > ip->i_d.di_version = 2; > return 0; > } > @@ -484,16 +478,10 @@ xfs_iread( > * Partial initialisation of the in-core inode. Just the bits > * that xfs_ialloc won't overwrite or relies on being correct. > */ > - ip->i_d.di_magic = be16_to_cpu(dip->di_magic); > ip->i_d.di_version = dip->di_version; > ip->i_d.di_gen = be32_to_cpu(dip->di_gen); > ip->i_d.di_flushiter = be16_to_cpu(dip->di_flushiter); > > - if (dip->di_version == 3) { > - ip->i_d.di_ino = be64_to_cpu(dip->di_ino); > - uuid_copy(&ip->i_d.di_uuid, &dip->di_uuid); > - } > - > /* > * Make sure to pull in the mode here as well in > * case the inode is released without being used. > @@ -514,7 +502,6 @@ xfs_iread( > */ > if (ip->i_d.di_version == 1) { > ip->i_d.di_version = 2; > - memset(&(ip->i_d.di_pad[0]), 0, sizeof(ip->i_d.di_pad)); > ip->i_d.di_nlink = ip->i_d.di_onlink; > ip->i_d.di_onlink = 0; > xfs_set_projid(ip, 0); > diff --git a/fs/xfs/libxfs/xfs_inode_buf.h b/fs/xfs/libxfs/xfs_inode_buf.h > index adcc9bf..7b8b1b9 100644 > --- a/fs/xfs/libxfs/xfs_inode_buf.h > +++ b/fs/xfs/libxfs/xfs_inode_buf.h > @@ -22,24 +22,22 @@ struct xfs_inode; > struct xfs_dinode; > > /* > - * In memory representation of the XFS inode. This is held in the in-core > - * struct xfs_inode to represent the on disk values, but no longer needs to be > - * identical to the on-disk structure as it is always translated to on-disk > + * In memory representation of the XFS inode. This is held in the in-core struct > + * xfs_inode and represents the current on disk values but the structure is not > + * in on-disk format. That is, this structure is always translated to on-disk > * format specific structures at the appropriate time. > */ > struct xfs_icdinode { > - __uint16_t di_magic; /* inode magic # = XFS_DINODE_MAGIC */ > __uint16_t di_mode; /* mode and type of file */ > __int8_t di_version; /* inode version */ > __int8_t di_format; /* format of di_c data */ > __uint16_t di_onlink; /* old number of links to file */ > + __uint16_t di_flushiter; /* incremented on flush */ > __uint32_t di_uid; /* owner's user id */ > __uint32_t di_gid; /* owner's group id */ > __uint32_t di_nlink; /* number of links to file */ > __uint16_t di_projid_lo; /* lower part of owner's project id */ > __uint16_t di_projid_hi; /* higher part of owner's project id */ > - __uint8_t di_pad[6]; /* unused, zeroed space */ > - __uint16_t di_flushiter; /* incremented on flush */ > xfs_fsize_t di_size; /* number of bytes in file */ > xfs_rfsblock_t di_nblocks; /* # of direct & btree blocks used */ > xfs_extlen_t di_extsize; /* basic/minimum extent size for file */ > @@ -52,22 +50,10 @@ struct xfs_icdinode { > __uint16_t di_flags; /* random flags, XFS_DIFLAG_... */ > __uint32_t di_gen; /* generation number */ > > - /* di_next_unlinked is the only non-core field in the old dinode */ > - xfs_agino_t di_next_unlinked;/* agi unlinked list ptr */ > - > - /* start of the extended dinode, writable fields */ > - __uint32_t di_crc; /* CRC of the inode */ > __uint64_t di_changecount; /* number of attribute changes */ > - xfs_lsn_t di_lsn; /* flush sequence */ > __uint64_t di_flags2; /* more random flags */ > - __uint8_t di_pad2[16]; /* more padding for future expansion */ > > - /* fields only written to during inode creation */ > xfs_ictimestamp_t di_crtime; /* time created */ > - xfs_ino_t di_ino; /* inode number */ > - uuid_t di_uuid; /* UUID of the filesystem */ > - > - /* structure must be padded to 64 bit alignment */ > }; > > /* > @@ -86,7 +72,8 @@ int xfs_imap_to_bp(struct xfs_mount *, struct xfs_trans *, > int xfs_iread(struct xfs_mount *, struct xfs_trans *, > struct xfs_inode *, uint); > void xfs_dinode_calc_crc(struct xfs_mount *, struct xfs_dinode *); > -void xfs_inode_to_disk(struct xfs_inode *ip, struct xfs_dinode *to); > +void xfs_inode_to_disk(struct xfs_inode *ip, struct xfs_dinode *to, > + xfs_lsn_t lsn); > void xfs_inode_from_disk(struct xfs_inode *ip, struct xfs_dinode *from); > void xfs_log_dinode_to_disk(struct xfs_log_dinode *from, > struct xfs_dinode *to); > diff --git a/fs/xfs/xfs_inode.c b/fs/xfs/xfs_inode.c > index 9ad9e35..45acdee 100644 > --- a/fs/xfs/xfs_inode.c > +++ b/fs/xfs/xfs_inode.c > @@ -809,7 +809,6 @@ xfs_ialloc( > ip->i_d.di_uid = xfs_kuid_to_uid(current_fsuid()); > ip->i_d.di_gid = xfs_kgid_to_gid(current_fsgid()); > xfs_set_projid(ip, prid); > - memset(&(ip->i_d.di_pad[0]), 0, sizeof(ip->i_d.di_pad)); > > if (pip && XFS_INHERIT_GID(pip)) { > ip->i_d.di_gid = pip->i_d.di_gid; > @@ -847,13 +846,8 @@ xfs_ialloc( > ip->i_d.di_flags = 0; > > if (ip->i_d.di_version == 3) { > - ASSERT(ip->i_d.di_ino == ino); > - ASSERT(uuid_equal(&ip->i_d.di_uuid, &mp->m_sb.sb_meta_uuid)); > - ip->i_d.di_crc = 0; > ip->i_d.di_changecount = 1; > - ip->i_d.di_lsn = 0; > ip->i_d.di_flags2 = 0; > - memset(&(ip->i_d.di_pad2[0]), 0, sizeof(ip->i_d.di_pad2)); > ip->i_d.di_crtime.t_sec = (__int32_t)tv.tv_sec; > ip->i_d.di_crtime.t_nsec = (__int32_t)tv.tv_nsec; > } > @@ -3464,13 +3458,6 @@ xfs_iflush_int( > __func__, ip->i_ino, be16_to_cpu(dip->di_magic), dip); > goto corrupt_out; > } > - if (XFS_TEST_ERROR(ip->i_d.di_magic != XFS_DINODE_MAGIC, > - mp, XFS_ERRTAG_IFLUSH_2, XFS_RANDOM_IFLUSH_2)) { > - xfs_alert_tag(mp, XFS_PTAG_IFLUSH, > - "%s: Bad inode %Lu, ptr 0x%p, magic number 0x%x", > - __func__, ip->i_ino, ip, ip->i_d.di_magic); > - goto corrupt_out; > - } > if (S_ISREG(ip->i_d.di_mode)) { > if (XFS_TEST_ERROR( > (ip->i_d.di_format != XFS_DINODE_FMT_EXTENTS) && > @@ -3529,7 +3516,7 @@ xfs_iflush_int( > * copy out the core of the inode, because if the inode is dirty at all > * the core must be. > */ > - xfs_inode_to_disk(ip, dip); > + xfs_inode_to_disk(ip, dip, iip->ili_item.li_lsn); > > /* Wrap, we never let the log put out DI_MAX_FLUSH */ > if (ip->i_d.di_flushiter == DI_MAX_FLUSH) > @@ -3581,10 +3568,6 @@ xfs_iflush_int( > */ > xfs_buf_attach_iodone(bp, xfs_iflush_done, &iip->ili_item); > > - /* update the lsn in the on disk inode if required */ > - if (ip->i_d.di_version == 3) > - dip->di_lsn = cpu_to_be64(iip->ili_item.li_lsn); > - > /* generate the checksum. */ > xfs_dinode_calc_crc(mp, dip); > > diff --git a/fs/xfs/xfs_inode_item.c b/fs/xfs/xfs_inode_item.c > index 9dcbf58..588d1b4 100644 > --- a/fs/xfs/xfs_inode_item.c > +++ b/fs/xfs/xfs_inode_item.c > @@ -325,12 +325,14 @@ xfs_inode_item_format_attr_fork( > static void > xfs_inode_to_log_dinode( > struct xfs_inode *ip, > - struct xfs_log_dinode *to) > + struct xfs_log_dinode *to, > + xfs_lsn_t lsn) > { > struct xfs_icdinode *from = &ip->i_d; > struct inode *inode = VFS_I(ip); > > - to->di_magic = from->di_magic; > + to->di_magic = XFS_DINODE_MAGIC; > + > to->di_mode = from->di_mode; > to->di_version = from->di_version; > to->di_format = from->di_format; > @@ -340,8 +342,8 @@ xfs_inode_to_log_dinode( > to->di_nlink = from->di_nlink; > to->di_projid_lo = from->di_projid_lo; > to->di_projid_hi = from->di_projid_hi; > - memcpy(to->di_pad, from->di_pad, sizeof(to->di_pad)); > > + memset(to->di_pad, 0, sizeof(to->di_pad)); > to->di_atime.t_sec = inode->i_atime.tv_sec; > to->di_atime.t_nsec = inode->i_atime.tv_nsec; > to->di_mtime.t_sec = inode->i_mtime.tv_sec; > @@ -366,10 +368,11 @@ xfs_inode_to_log_dinode( > to->di_crtime.t_sec = from->di_crtime.t_sec; > to->di_crtime.t_nsec = from->di_crtime.t_nsec; > to->di_flags2 = from->di_flags2; > - to->di_ino = from->di_ino; > - to->di_lsn = from->di_lsn; > - memcpy(to->di_pad2, from->di_pad2, sizeof(to->di_pad2)); > - uuid_copy(&to->di_uuid, &from->di_uuid); > + > + to->di_ino = ip->i_ino; > + to->di_lsn = lsn; > + memset(to->di_pad2, 0, sizeof(to->di_pad2)); > + uuid_copy(&to->di_uuid, &ip->i_mount->m_sb.sb_meta_uuid); > to->di_flushiter = 0; > } else { > to->di_flushiter = from->di_flushiter; > @@ -390,7 +393,7 @@ xfs_inode_item_format_core( > struct xfs_log_dinode *dic; > > dic = xlog_prepare_iovec(lv, vecp, XLOG_REG_TYPE_ICORE); > - xfs_inode_to_log_dinode(ip, dic); > + xfs_inode_to_log_dinode(ip, dic, ip->i_itemp->ili_item.li_lsn); > xlog_finish_iovec(lv, *vecp, xfs_log_dinode_size(ip->i_d.di_version)); > } > > -- > 2.5.0 > > _______________________________________________ > xfs mailing list > xfs@oss.sgi.com > http://oss.sgi.com/mailman/listinfo/xfs From bfoster@redhat.com Mon Feb 8 09:29:32 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=ham version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay3.corp.sgi.com [198.149.34.15]) by oss.sgi.com (Postfix) with ESMTP id 98C1D29E04 for ; Mon, 8 Feb 2016 09:29:32 -0600 (CST) Received: from cuda.sgi.com (cuda2.sgi.com [192.48.176.25]) by relay3.corp.sgi.com (Postfix) with ESMTP id 376BCAC003 for ; Mon, 8 Feb 2016 07:29:32 -0800 (PST) X-ASG-Debug-ID: 1454945367-04cbb04cfb1667f0001-NocioJ Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by cuda.sgi.com with ESMTP id YKcjqoCepLpZiayi (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO) for ; Mon, 08 Feb 2016 07:29:27 -0800 (PST) X-Barracuda-Envelope-From: bfoster@redhat.com X-Barracuda-Apparent-Source-IP: 209.132.183.28 X-ASG-Whitelist: Client Received: from int-mx09.intmail.prod.int.phx2.redhat.com (int-mx09.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by mx1.redhat.com (Postfix) with ESMTPS id 20AFF7AE89; Mon, 8 Feb 2016 15:29:27 +0000 (UTC) Received: from bfoster.bfoster (dhcp-41-164.bos.redhat.com [10.18.41.164]) by int-mx09.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id u18FTQWB016103; Mon, 8 Feb 2016 10:29:26 -0500 Received: by bfoster.bfoster (Postfix, from userid 1000) id AE20A123DF8; Mon, 8 Feb 2016 10:29:25 -0500 (EST) Date: Mon, 8 Feb 2016 10:29:25 -0500 From: Brian Foster To: Dave Chinner Cc: xfs@oss.sgi.com Subject: Re: [PATCH 5/9] xfs: reinitialise recycled VFS inode correctly Message-ID: <20160208152925.GC19597@bfoster.bfoster> X-ASG-Orig-Subj: Re: [PATCH 5/9] xfs: reinitialise recycled VFS inode correctly References: <1454905461-2773-1-git-send-email-david@fromorbit.com> <1454905461-2773-6-git-send-email-david@fromorbit.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1454905461-2773-6-git-send-email-david@fromorbit.com> User-Agent: Mutt/1.5.24 (2015-08-30) X-Scanned-By: MIMEDefang 2.68 on 10.5.11.22 X-Barracuda-Connect: mx1.redhat.com[209.132.183.28] X-Barracuda-Start-Time: 1454945367 X-Barracuda-Encrypted: ECDHE-RSA-AES256-GCM-SHA384 X-Barracuda-URL: https://192.48.176.25:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-BRTS-Status: 1 On Mon, Feb 08, 2016 at 03:24:17PM +1100, Dave Chinner wrote: > From: Dave Chinner > > Now that we keep certain on-disk information in the VFS inode rather > than in a separate XFS specific stucture, we have to be careful of > the VFS code clearing that information when we re-initialise > reclaimable cached inodes during lookup. If we don't do this, then > we lose critical information from the inode and that results in > corruption being detected. > > Signed-off-by: Dave Chinner > --- Reviewed-by: Brian Foster > fs/xfs/xfs_icache.c | 22 +++++++++++++++++++++- > 1 file changed, 21 insertions(+), 1 deletion(-) > > diff --git a/fs/xfs/xfs_icache.c b/fs/xfs/xfs_icache.c > index 7c26f86..9ca28655 100644 > --- a/fs/xfs/xfs_icache.c > +++ b/fs/xfs/xfs_icache.c > @@ -135,6 +135,26 @@ xfs_inode_free( > } > > /* > + * When we recycle a reclaimable inode, we need to re-initialise the VFS inode > + * part of the structure. This is made more complex by the fact we store > + * information about the on-disk values in the VFS inode and so we can't just > + * overwrite it's values unconditionally. Hence we save the parameters we > + * need to retain across reinitialisation, and rewrite them into the VFS inode > + * after resetting it's state even if resetting fails. > + */ > +static int > +xfs_reinit_inode( > + struct xfs_mount *mp, > + struct inode *inode) > +{ > + int error; > + > + error = inode_init_always(mp->m_super, inode); > + > + return error; > +} > + > +/* > * Check the validity of the inode we just found it the cache > */ > static int > @@ -208,7 +228,7 @@ xfs_iget_cache_hit( > spin_unlock(&ip->i_flags_lock); > rcu_read_unlock(); > > - error = inode_init_always(mp->m_super, inode); > + error = xfs_reinit_inode(mp, inode); > if (error) { > /* > * Re-initializing the inode failed, and we are in deep > -- > 2.5.0 > > _______________________________________________ > xfs mailing list > xfs@oss.sgi.com > http://oss.sgi.com/mailman/listinfo/xfs From bfoster@redhat.com Mon Feb 8 09:29:33 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=ham version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay1.corp.sgi.com [137.38.102.111]) by oss.sgi.com (Postfix) with ESMTP id 8550529DFC for ; Mon, 8 Feb 2016 09:29:33 -0600 (CST) Received: from cuda.sgi.com (cuda2.sgi.com [192.48.176.25]) by relay1.corp.sgi.com (Postfix) with ESMTP id 666278F8040 for ; Mon, 8 Feb 2016 07:29:33 -0800 (PST) X-ASG-Debug-ID: 1454945371-04cbb04cfa166800001-NocioJ Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by cuda.sgi.com with ESMTP id UhogWRtxrcxIrTdo (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO) for ; Mon, 08 Feb 2016 07:29:31 -0800 (PST) X-Barracuda-Envelope-From: bfoster@redhat.com X-Barracuda-Apparent-Source-IP: 209.132.183.28 X-ASG-Whitelist: Client Received: from int-mx14.intmail.prod.int.phx2.redhat.com (int-mx14.intmail.prod.int.phx2.redhat.com [10.5.11.27]) by mx1.redhat.com (Postfix) with ESMTPS id 301A18E3F2; Mon, 8 Feb 2016 15:29:31 +0000 (UTC) Received: from bfoster.bfoster (dhcp-41-164.bos.redhat.com [10.18.41.164]) by int-mx14.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id u18FTU4Q014232; Mon, 8 Feb 2016 10:29:30 -0500 Received: by bfoster.bfoster (Postfix, from userid 1000) id BA9C6123DF8; Mon, 8 Feb 2016 10:29:29 -0500 (EST) Date: Mon, 8 Feb 2016 10:29:29 -0500 From: Brian Foster To: Dave Chinner Cc: xfs@oss.sgi.com Subject: Re: [PATCH 6/9] xfs: use vfs inode nlink field everywhere Message-ID: <20160208152929.GD19597@bfoster.bfoster> X-ASG-Orig-Subj: Re: [PATCH 6/9] xfs: use vfs inode nlink field everywhere References: <1454905461-2773-1-git-send-email-david@fromorbit.com> <1454905461-2773-7-git-send-email-david@fromorbit.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1454905461-2773-7-git-send-email-david@fromorbit.com> User-Agent: Mutt/1.5.24 (2015-08-30) X-Scanned-By: MIMEDefang 2.68 on 10.5.11.27 X-Barracuda-Connect: mx1.redhat.com[209.132.183.28] X-Barracuda-Start-Time: 1454945371 X-Barracuda-Encrypted: ECDHE-RSA-AES256-GCM-SHA384 X-Barracuda-URL: https://192.48.176.25:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-BRTS-Status: 1 On Mon, Feb 08, 2016 at 03:24:18PM +1100, Dave Chinner wrote: > From: Dave Chinner > > The Vfs tracks the inodenlink just like the xfs_icdinode. We can > remove the variable from the icdinode and use the vfs inode variable > everywhere, reducing the size of the xfs_icdinode by a further 4 > bytes. > > Signed-off-by: Dave Chinner > --- Reviewed-by: Brian Foster > fs/xfs/libxfs/xfs_inode_buf.c | 6 ++-- > fs/xfs/libxfs/xfs_inode_buf.h | 1 - > fs/xfs/xfs_icache.c | 2 ++ > fs/xfs/xfs_inode.c | 77 ++++++++++++++++++++----------------------- > fs/xfs/xfs_inode.h | 2 -- > fs/xfs/xfs_inode_item.c | 2 +- > fs/xfs/xfs_iops.c | 3 +- > fs/xfs/xfs_itable.c | 2 +- > fs/xfs/xfs_log_recover.c | 2 +- > 9 files changed, 45 insertions(+), 52 deletions(-) > > diff --git a/fs/xfs/libxfs/xfs_inode_buf.c b/fs/xfs/libxfs/xfs_inode_buf.c > index 8a1b460..0dcaa9a 100644 > --- a/fs/xfs/libxfs/xfs_inode_buf.c > +++ b/fs/xfs/libxfs/xfs_inode_buf.c > @@ -210,12 +210,12 @@ xfs_inode_from_disk( > * minimum inode version format we support in the rest of the code. > */ > if (to->di_version == 1) { > - to->di_nlink = be16_to_cpu(from->di_onlink); > + set_nlink(inode, be16_to_cpu(from->di_onlink)); > to->di_projid_lo = 0; > to->di_projid_hi = 0; > to->di_version = 2; > } else { > - to->di_nlink = be32_to_cpu(from->di_nlink); > + set_nlink(inode, be32_to_cpu(from->di_nlink)); > to->di_projid_lo = be16_to_cpu(from->di_projid_lo); > to->di_projid_hi = be16_to_cpu(from->di_projid_hi); > } > @@ -275,7 +275,6 @@ xfs_inode_to_disk( > to->di_format = from->di_format; > to->di_uid = cpu_to_be32(from->di_uid); > to->di_gid = cpu_to_be32(from->di_gid); > - to->di_nlink = cpu_to_be32(from->di_nlink); > to->di_projid_lo = cpu_to_be16(from->di_projid_lo); > to->di_projid_hi = cpu_to_be16(from->di_projid_hi); > > @@ -286,6 +285,7 @@ xfs_inode_to_disk( > to->di_mtime.t_nsec = cpu_to_be32(inode->i_mtime.tv_nsec); > to->di_ctime.t_sec = cpu_to_be32(inode->i_ctime.tv_sec); > to->di_ctime.t_nsec = cpu_to_be32(inode->i_ctime.tv_nsec); > + to->di_nlink = cpu_to_be32(inode->i_nlink); > > to->di_size = cpu_to_be64(from->di_size); > to->di_nblocks = cpu_to_be64(from->di_nblocks); > diff --git a/fs/xfs/libxfs/xfs_inode_buf.h b/fs/xfs/libxfs/xfs_inode_buf.h > index 73ba1d8..320b723 100644 > --- a/fs/xfs/libxfs/xfs_inode_buf.h > +++ b/fs/xfs/libxfs/xfs_inode_buf.h > @@ -34,7 +34,6 @@ struct xfs_icdinode { > __uint16_t di_flushiter; /* incremented on flush */ > __uint32_t di_uid; /* owner's user id */ > __uint32_t di_gid; /* owner's group id */ > - __uint32_t di_nlink; /* number of links to file */ > __uint16_t di_projid_lo; /* lower part of owner's project id */ > __uint16_t di_projid_hi; /* higher part of owner's project id */ > xfs_fsize_t di_size; /* number of bytes in file */ > diff --git a/fs/xfs/xfs_icache.c b/fs/xfs/xfs_icache.c > index 9ca28655..4c184f7 100644 > --- a/fs/xfs/xfs_icache.c > +++ b/fs/xfs/xfs_icache.c > @@ -148,9 +148,11 @@ xfs_reinit_inode( > struct inode *inode) > { > int error; > + uint32_t nlink = inode->i_nlink; > > error = inode_init_always(mp->m_super, inode); > > + set_nlink(inode, nlink); > return error; > } > > diff --git a/fs/xfs/xfs_inode.c b/fs/xfs/xfs_inode.c > index 7d9c514..ed8e3d2 100644 > --- a/fs/xfs/xfs_inode.c > +++ b/fs/xfs/xfs_inode.c > @@ -57,9 +57,9 @@ kmem_zone_t *xfs_inode_zone; > */ > #define XFS_ITRUNC_MAX_EXTENTS 2 > > -STATIC int xfs_iflush_int(xfs_inode_t *, xfs_buf_t *); > - > -STATIC int xfs_iunlink_remove(xfs_trans_t *, xfs_inode_t *); > +STATIC int xfs_iflush_int(struct xfs_inode *, struct xfs_buf *); > +STATIC int xfs_iunlink(struct xfs_trans *, struct xfs_inode *, bool); > +STATIC int xfs_iunlink_remove(struct xfs_trans *, struct xfs_inode *); > > /* > * helper function to extract extent size hint from inode > @@ -803,7 +803,7 @@ xfs_ialloc( > ip->i_d.di_version = 2; > > ip->i_d.di_mode = mode; > - ip->i_d.di_nlink = nlink; > + set_nlink(inode, nlink); > ip->i_d.di_uid = xfs_kuid_to_uid(current_fsuid()); > ip->i_d.di_gid = xfs_kgid_to_gid(current_fsgid()); > xfs_set_projid(ip, prid); > @@ -1086,35 +1086,24 @@ xfs_dir_ialloc( > } > > /* > - * Decrement the link count on an inode & log the change. > - * If this causes the link count to go to zero, initiate the > - * logging activity required to truncate a file. > + * Decrement the link count on an inode & log the change. If this causes the > + * link count to go to zero, move the inode to AGI unlinked list so that it can > + * be freed when the last active reference goes away via xfs_inactive(). > */ > int /* error */ > xfs_droplink( > xfs_trans_t *tp, > xfs_inode_t *ip) > { > - int error; > - > xfs_trans_ichgtime(tp, ip, XFS_ICHGTIME_CHG); > > - ASSERT (ip->i_d.di_nlink > 0); > - ip->i_d.di_nlink--; > drop_nlink(VFS_I(ip)); > xfs_trans_log_inode(tp, ip, XFS_ILOG_CORE); > > - error = 0; > - if (ip->i_d.di_nlink == 0) { > - /* > - * We're dropping the last link to this file. > - * Move the on-disk inode to the AGI unlinked list. > - * From xfs_inactive() we will pull the inode from > - * the list and free it. > - */ > - error = xfs_iunlink(tp, ip); > - } > - return error; > + if (VFS_I(ip)->i_nlink) > + return 0; > + > + return xfs_iunlink(tp, ip, false); > } > > /* > @@ -1128,8 +1117,6 @@ xfs_bumplink( > xfs_trans_ichgtime(tp, ip, XFS_ICHGTIME_CHG); > > ASSERT(ip->i_d.di_version > 1); > - ASSERT(ip->i_d.di_nlink > 0 || (VFS_I(ip)->i_state & I_LINKABLE)); > - ip->i_d.di_nlink++; > inc_nlink(VFS_I(ip)); > xfs_trans_log_inode(tp, ip, XFS_ILOG_CORE); > return 0; > @@ -1387,8 +1374,7 @@ xfs_create_tmpfile( > */ > xfs_qm_vop_create_dqattach(tp, ip, udqp, gdqp, pdqp); > > - ip->i_d.di_nlink--; > - error = xfs_iunlink(tp, ip); > + error = xfs_iunlink(tp, ip, true); > if (error) > goto out_trans_cancel; > > @@ -1486,7 +1472,10 @@ xfs_link( > > xfs_bmap_init(&free_list, &first_block); > > - if (sip->i_d.di_nlink == 0) { > + /* > + * Handle initial link state of O_TMPFILE inode > + */ > + if (VFS_I(sip)->i_nlink == 0) { > error = xfs_iunlink_remove(tp, sip); > if (error) > goto error_return; > @@ -1673,7 +1662,7 @@ xfs_release( > } > } > > - if (ip->i_d.di_nlink == 0) > + if (VFS_I(ip)->i_nlink == 0) > return 0; > > if (xfs_can_free_eofblocks(ip, false)) { > @@ -1889,7 +1878,7 @@ xfs_inactive( > if (mp->m_flags & XFS_MOUNT_RDONLY) > return; > > - if (ip->i_d.di_nlink != 0) { > + if (VFS_I(ip)->i_nlink != 0) { > /* > * force is true because we are evicting an inode from the > * cache. Post-eof blocks must be freed, lest we end up with > @@ -1946,14 +1935,20 @@ xfs_inactive( > } > > /* > - * This is called when the inode's link count goes to 0. > - * We place the on-disk inode on a list in the AGI. It > - * will be pulled from this list when the inode is freed. > + * This is called when the inode's link count goes to 0 or we are creating a > + * tmpfile via O_TMPFILE. In the case of a tmpfile, @ignore_linkcount will be > + * set to true as the link count is dropped to zero by the VFS after we've > + * created the file successfully, so we have to add it to the unlinked list > + * while the link count is non-zero. > + * > + * We place the on-disk inode on a list in the AGI. It will be pulled from this > + * list when the inode is freed. > */ > -int > +STATIC int > xfs_iunlink( > - xfs_trans_t *tp, > - xfs_inode_t *ip) > + struct xfs_trans *tp, > + struct xfs_inode *ip, > + bool ignore_linkcount) > { > xfs_mount_t *mp; > xfs_agi_t *agi; > @@ -1965,7 +1960,7 @@ xfs_iunlink( > int offset; > int error; > > - ASSERT(ip->i_d.di_nlink == 0); > + ASSERT(VFS_I(ip)->i_nlink == 0 || ignore_linkcount); > ASSERT(ip->i_d.di_mode != 0); > > mp = tp->t_mountp; > @@ -2406,7 +2401,7 @@ xfs_ifree( > struct xfs_icluster xic = { 0 }; > > ASSERT(xfs_isilocked(ip, XFS_ILOCK_EXCL)); > - ASSERT(ip->i_d.di_nlink == 0); > + ASSERT(VFS_I(ip)->i_nlink == 0); > ASSERT(ip->i_d.di_nextents == 0); > ASSERT(ip->i_d.di_anextents == 0); > ASSERT(ip->i_d.di_size == 0 || !S_ISREG(ip->i_d.di_mode)); > @@ -2574,8 +2569,8 @@ xfs_remove( > * If we're removing a directory perform some additional validation. > */ > if (is_dir) { > - ASSERT(ip->i_d.di_nlink >= 2); > - if (ip->i_d.di_nlink != 2) { > + ASSERT(VFS_I(ip)->i_nlink >= 2); > + if (VFS_I(ip)->i_nlink != 2) { > error = -ENOTEMPTY; > goto out_trans_cancel; > } > @@ -3031,7 +3026,7 @@ xfs_rename( > * Make sure target dir is empty. > */ > if (!(xfs_dir_isempty(target_ip)) || > - (target_ip->i_d.di_nlink > 2)) { > + (VFS_I(target_ip)->i_nlink > 2)) { > error = -EEXIST; > goto out_trans_cancel; > } > @@ -3138,7 +3133,7 @@ xfs_rename( > * intermediate state on disk. > */ > if (wip) { > - ASSERT(VFS_I(wip)->i_nlink == 0 && wip->i_d.di_nlink == 0); > + ASSERT(VFS_I(wip)->i_nlink == 0); > error = xfs_bumplink(tp, wip); > if (error) > goto out_bmap_cancel; > diff --git a/fs/xfs/xfs_inode.h b/fs/xfs/xfs_inode.h > index 57c5947..4eaf425 100644 > --- a/fs/xfs/xfs_inode.h > +++ b/fs/xfs/xfs_inode.h > @@ -405,8 +405,6 @@ int xfs_ifree(struct xfs_trans *, xfs_inode_t *, > struct xfs_bmap_free *); > int xfs_itruncate_extents(struct xfs_trans **, struct xfs_inode *, > int, xfs_fsize_t); > -int xfs_iunlink(struct xfs_trans *, xfs_inode_t *); > - > void xfs_iext_realloc(xfs_inode_t *, int, int); > > void xfs_iunpin_wait(xfs_inode_t *); > diff --git a/fs/xfs/xfs_inode_item.c b/fs/xfs/xfs_inode_item.c > index 1e5ecbc..193e0bd 100644 > --- a/fs/xfs/xfs_inode_item.c > +++ b/fs/xfs/xfs_inode_item.c > @@ -338,7 +338,6 @@ xfs_inode_to_log_dinode( > to->di_format = from->di_format; > to->di_uid = from->di_uid; > to->di_gid = from->di_gid; > - to->di_nlink = from->di_nlink; > to->di_projid_lo = from->di_projid_lo; > to->di_projid_hi = from->di_projid_hi; > > @@ -350,6 +349,7 @@ xfs_inode_to_log_dinode( > to->di_mtime.t_nsec = inode->i_mtime.tv_nsec; > to->di_ctime.t_sec = inode->i_ctime.tv_sec; > to->di_ctime.t_nsec = inode->i_ctime.tv_nsec; > + to->di_nlink = inode->i_nlink; > > to->di_size = from->di_size; > to->di_nblocks = from->di_nblocks; > diff --git a/fs/xfs/xfs_iops.c b/fs/xfs/xfs_iops.c > index cd27c6d..8982e56 100644 > --- a/fs/xfs/xfs_iops.c > +++ b/fs/xfs/xfs_iops.c > @@ -460,7 +460,7 @@ xfs_vn_getattr( > stat->size = XFS_ISIZE(ip); > stat->dev = inode->i_sb->s_dev; > stat->mode = ip->i_d.di_mode; > - stat->nlink = ip->i_d.di_nlink; > + stat->nlink = inode->i_nlink; > stat->uid = inode->i_uid; > stat->gid = inode->i_gid; > stat->ino = ip->i_ino; > @@ -1216,7 +1216,6 @@ xfs_setup_inode( > hlist_add_fake(&inode->i_hash); > > inode->i_mode = ip->i_d.di_mode; > - set_nlink(inode, ip->i_d.di_nlink); > inode->i_uid = xfs_uid_to_kuid(ip->i_d.di_uid); > inode->i_gid = xfs_gid_to_kgid(ip->i_d.di_gid); > > diff --git a/fs/xfs/xfs_itable.c b/fs/xfs/xfs_itable.c > index 2acda42..cfb6527 100644 > --- a/fs/xfs/xfs_itable.c > +++ b/fs/xfs/xfs_itable.c > @@ -85,7 +85,6 @@ xfs_bulkstat_one_int( > /* xfs_iget returns the following without needing > * further change. > */ > - buf->bs_nlink = dic->di_nlink; > buf->bs_projid_lo = dic->di_projid_lo; > buf->bs_projid_hi = dic->di_projid_hi; > buf->bs_ino = ino; > @@ -94,6 +93,7 @@ xfs_bulkstat_one_int( > buf->bs_gid = dic->di_gid; > buf->bs_size = dic->di_size; > > + buf->bs_nlink = inode->i_nlink; > buf->bs_atime.tv_sec = inode->i_atime.tv_sec; > buf->bs_atime.tv_nsec = inode->i_atime.tv_nsec; > buf->bs_mtime.tv_sec = inode->i_mtime.tv_sec; > diff --git a/fs/xfs/xfs_log_recover.c b/fs/xfs/xfs_log_recover.c > index 97bcfc8..678fe6e 100644 > --- a/fs/xfs/xfs_log_recover.c > +++ b/fs/xfs/xfs_log_recover.c > @@ -4342,7 +4342,7 @@ xlog_recover_process_one_iunlink( > if (error) > goto fail_iput; > > - ASSERT(ip->i_d.di_nlink == 0); > + ASSERT(VFS_I(ip)->i_nlink == 0); > ASSERT(ip->i_d.di_mode != 0); > > /* setup for the next pass */ > -- > 2.5.0 > > _______________________________________________ > xfs mailing list > xfs@oss.sgi.com > http://oss.sgi.com/mailman/listinfo/xfs From bfoster@redhat.com Mon Feb 8 09:29:37 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=ham version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay1.corp.sgi.com [137.38.102.111]) by oss.sgi.com (Postfix) with ESMTP id A7A0329DF5 for ; Mon, 8 Feb 2016 09:29:37 -0600 (CST) Received: from cuda.sgi.com (cuda2.sgi.com [192.48.176.25]) by relay1.corp.sgi.com (Postfix) with ESMTP id 967238F8033 for ; Mon, 8 Feb 2016 07:29:37 -0800 (PST) X-ASG-Debug-ID: 1454945375-04cbb04cfa166810001-NocioJ Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by cuda.sgi.com with ESMTP id d3FdKYI3tVMgQcCO (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO) for ; Mon, 08 Feb 2016 07:29:36 -0800 (PST) X-Barracuda-Envelope-From: bfoster@redhat.com X-Barracuda-Apparent-Source-IP: 209.132.183.28 X-ASG-Whitelist: Client Received: from int-mx14.intmail.prod.int.phx2.redhat.com (int-mx14.intmail.prod.int.phx2.redhat.com [10.5.11.27]) by mx1.redhat.com (Postfix) with ESMTPS id 7D5C68E678; Mon, 8 Feb 2016 15:29:35 +0000 (UTC) Received: from bfoster.bfoster (dhcp-41-164.bos.redhat.com [10.18.41.164]) by int-mx14.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id u18FTZBL014290; Mon, 8 Feb 2016 10:29:35 -0500 Received: by bfoster.bfoster (Postfix, from userid 1000) id 26601123DF8; Mon, 8 Feb 2016 10:29:34 -0500 (EST) Date: Mon, 8 Feb 2016 10:29:34 -0500 From: Brian Foster To: Dave Chinner Cc: xfs@oss.sgi.com Subject: Re: [PATCH 7/9] xfs: move inode generation count to VFS inode Message-ID: <20160208152933.GE19597@bfoster.bfoster> X-ASG-Orig-Subj: Re: [PATCH 7/9] xfs: move inode generation count to VFS inode References: <1454905461-2773-1-git-send-email-david@fromorbit.com> <1454905461-2773-8-git-send-email-david@fromorbit.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1454905461-2773-8-git-send-email-david@fromorbit.com> User-Agent: Mutt/1.5.24 (2015-08-30) X-Scanned-By: MIMEDefang 2.68 on 10.5.11.27 X-Barracuda-Connect: mx1.redhat.com[209.132.183.28] X-Barracuda-Start-Time: 1454945375 X-Barracuda-Encrypted: ECDHE-RSA-AES256-GCM-SHA384 X-Barracuda-URL: https://192.48.176.25:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-BRTS-Status: 1 On Mon, Feb 08, 2016 at 03:24:19PM +1100, Dave Chinner wrote: > From: Dave Chinner > > Pull another 4 bytes out of the xfs_icdinode. > > Signed-off-by: Dave Chinner > --- Reviewed-by: Brian Foster > fs/xfs/libxfs/xfs_inode_buf.c | 8 ++++---- > fs/xfs/libxfs/xfs_inode_buf.h | 1 - > fs/xfs/xfs_export.c | 2 +- > fs/xfs/xfs_icache.c | 2 ++ > fs/xfs/xfs_inode.c | 5 +---- > fs/xfs/xfs_inode_item.c | 2 +- > fs/xfs/xfs_ioctl.c | 2 +- > fs/xfs/xfs_iops.c | 1 - > fs/xfs/xfs_itable.c | 2 +- > 9 files changed, 11 insertions(+), 14 deletions(-) > > diff --git a/fs/xfs/libxfs/xfs_inode_buf.c b/fs/xfs/libxfs/xfs_inode_buf.c > index 0dcaa9a..0a3f10b 100644 > --- a/fs/xfs/libxfs/xfs_inode_buf.c > +++ b/fs/xfs/libxfs/xfs_inode_buf.c > @@ -237,6 +237,7 @@ xfs_inode_from_disk( > inode->i_mtime.tv_nsec = (int)be32_to_cpu(from->di_mtime.t_nsec); > inode->i_ctime.tv_sec = (int)be32_to_cpu(from->di_ctime.t_sec); > inode->i_ctime.tv_nsec = (int)be32_to_cpu(from->di_ctime.t_nsec); > + inode->i_generation = be32_to_cpu(from->di_gen); > > to->di_size = be64_to_cpu(from->di_size); > to->di_nblocks = be64_to_cpu(from->di_nblocks); > @@ -248,7 +249,6 @@ xfs_inode_from_disk( > to->di_dmevmask = be32_to_cpu(from->di_dmevmask); > to->di_dmstate = be16_to_cpu(from->di_dmstate); > to->di_flags = be16_to_cpu(from->di_flags); > - to->di_gen = be32_to_cpu(from->di_gen); > > if (to->di_version == 3) { > to->di_changecount = be64_to_cpu(from->di_changecount); > @@ -286,6 +286,7 @@ xfs_inode_to_disk( > to->di_ctime.t_sec = cpu_to_be32(inode->i_ctime.tv_sec); > to->di_ctime.t_nsec = cpu_to_be32(inode->i_ctime.tv_nsec); > to->di_nlink = cpu_to_be32(inode->i_nlink); > + to->di_gen = cpu_to_be32(inode->i_generation); > > to->di_size = cpu_to_be64(from->di_size); > to->di_nblocks = cpu_to_be64(from->di_nblocks); > @@ -297,7 +298,6 @@ xfs_inode_to_disk( > to->di_dmevmask = cpu_to_be32(from->di_dmevmask); > to->di_dmstate = cpu_to_be16(from->di_dmstate); > to->di_flags = cpu_to_be16(from->di_flags); > - to->di_gen = cpu_to_be32(from->di_gen); > > if (from->di_version == 3) { > to->di_changecount = cpu_to_be64(from->di_changecount); > @@ -443,7 +443,7 @@ xfs_iread( > !(mp->m_flags & XFS_MOUNT_IKEEP)) { > /* initialise the on-disk inode core */ > memset(&ip->i_d, 0, sizeof(ip->i_d)); > - ip->i_d.di_gen = prandom_u32(); > + VFS_I(ip)->i_generation = prandom_u32(); > if (xfs_sb_version_hascrc(&mp->m_sb)) > ip->i_d.di_version = 3; > else > @@ -491,7 +491,7 @@ xfs_iread( > * that xfs_ialloc won't overwrite or relies on being correct. > */ > ip->i_d.di_version = dip->di_version; > - ip->i_d.di_gen = be32_to_cpu(dip->di_gen); > + VFS_I(ip)->i_generation = be32_to_cpu(dip->di_gen); > ip->i_d.di_flushiter = be16_to_cpu(dip->di_flushiter); > > /* > diff --git a/fs/xfs/libxfs/xfs_inode_buf.h b/fs/xfs/libxfs/xfs_inode_buf.h > index 320b723..29fd9f1 100644 > --- a/fs/xfs/libxfs/xfs_inode_buf.h > +++ b/fs/xfs/libxfs/xfs_inode_buf.h > @@ -46,7 +46,6 @@ struct xfs_icdinode { > __uint32_t di_dmevmask; /* DMIG event mask */ > __uint16_t di_dmstate; /* DMIG state info */ > __uint16_t di_flags; /* random flags, XFS_DIFLAG_... */ > - __uint32_t di_gen; /* generation number */ > > __uint64_t di_changecount; /* number of attribute changes */ > __uint64_t di_flags2; /* more random flags */ > diff --git a/fs/xfs/xfs_export.c b/fs/xfs/xfs_export.c > index 652cd3c..2816d42 100644 > --- a/fs/xfs/xfs_export.c > +++ b/fs/xfs/xfs_export.c > @@ -152,7 +152,7 @@ xfs_nfs_get_inode( > return ERR_PTR(error); > } > > - if (ip->i_d.di_gen != generation) { > + if (VFS_I(ip)->i_generation != generation) { > IRELE(ip); > return ERR_PTR(-ESTALE); > } > diff --git a/fs/xfs/xfs_icache.c b/fs/xfs/xfs_icache.c > index 4c184f7..6401e3c 100644 > --- a/fs/xfs/xfs_icache.c > +++ b/fs/xfs/xfs_icache.c > @@ -149,10 +149,12 @@ xfs_reinit_inode( > { > int error; > uint32_t nlink = inode->i_nlink; > + uint32_t generation = inode->i_generation; > > error = inode_init_always(mp->m_super, inode); > > set_nlink(inode, nlink); > + inode->i_generation = generation; > return error; > } > > diff --git a/fs/xfs/xfs_inode.c b/fs/xfs/xfs_inode.c > index ed8e3d2..e8f87c7 100644 > --- a/fs/xfs/xfs_inode.c > +++ b/fs/xfs/xfs_inode.c > @@ -835,9 +835,6 @@ xfs_ialloc( > inode->i_atime = tv; > inode->i_ctime = tv; > > - /* > - * di_gen will have been taken care of in xfs_iread. > - */ > ip->i_d.di_extsize = 0; > ip->i_d.di_dmevmask = 0; > ip->i_d.di_dmstate = 0; > @@ -2428,7 +2425,7 @@ xfs_ifree( > * Bump the generation count so no one will be confused > * by reincarnations of this inode. > */ > - ip->i_d.di_gen++; > + VFS_I(ip)->i_generation++; > xfs_trans_log_inode(tp, ip, XFS_ILOG_CORE); > > if (xic.deleted) > diff --git a/fs/xfs/xfs_inode_item.c b/fs/xfs/xfs_inode_item.c > index 193e0bd..6367780 100644 > --- a/fs/xfs/xfs_inode_item.c > +++ b/fs/xfs/xfs_inode_item.c > @@ -350,6 +350,7 @@ xfs_inode_to_log_dinode( > to->di_ctime.t_sec = inode->i_ctime.tv_sec; > to->di_ctime.t_nsec = inode->i_ctime.tv_nsec; > to->di_nlink = inode->i_nlink; > + to->di_gen = inode->i_generation; > > to->di_size = from->di_size; > to->di_nblocks = from->di_nblocks; > @@ -361,7 +362,6 @@ xfs_inode_to_log_dinode( > to->di_dmevmask = from->di_dmevmask; > to->di_dmstate = from->di_dmstate; > to->di_flags = from->di_flags; > - to->di_gen = from->di_gen; > > if (from->di_version == 3) { > to->di_changecount = from->di_changecount; > diff --git a/fs/xfs/xfs_ioctl.c b/fs/xfs/xfs_ioctl.c > index 478d04e..cdd6c31 100644 > --- a/fs/xfs/xfs_ioctl.c > +++ b/fs/xfs/xfs_ioctl.c > @@ -114,7 +114,7 @@ xfs_find_handle( > handle.ha_fid.fid_len = sizeof(xfs_fid_t) - > sizeof(handle.ha_fid.fid_len); > handle.ha_fid.fid_pad = 0; > - handle.ha_fid.fid_gen = ip->i_d.di_gen; > + handle.ha_fid.fid_gen = inode->i_generation; > handle.ha_fid.fid_ino = ip->i_ino; > > hsize = XFS_HSIZE(handle); > diff --git a/fs/xfs/xfs_iops.c b/fs/xfs/xfs_iops.c > index 8982e56..a4daa3f 100644 > --- a/fs/xfs/xfs_iops.c > +++ b/fs/xfs/xfs_iops.c > @@ -1231,7 +1231,6 @@ xfs_setup_inode( > break; > } > > - inode->i_generation = ip->i_d.di_gen; > i_size_write(inode, ip->i_d.di_size); > xfs_diflags_to_iflags(inode, ip); > > diff --git a/fs/xfs/xfs_itable.c b/fs/xfs/xfs_itable.c > index cfb6527..6162e65 100644 > --- a/fs/xfs/xfs_itable.c > +++ b/fs/xfs/xfs_itable.c > @@ -100,11 +100,11 @@ xfs_bulkstat_one_int( > buf->bs_mtime.tv_nsec = inode->i_mtime.tv_nsec; > buf->bs_ctime.tv_sec = inode->i_ctime.tv_sec; > buf->bs_ctime.tv_nsec = inode->i_ctime.tv_nsec; > + buf->bs_gen = inode->i_generation; > > buf->bs_xflags = xfs_ip2xflags(ip); > buf->bs_extsize = dic->di_extsize << mp->m_sb.sb_blocklog; > buf->bs_extents = dic->di_nextents; > - buf->bs_gen = dic->di_gen; > memset(buf->bs_pad, 0, sizeof(buf->bs_pad)); > buf->bs_dmevmask = dic->di_dmevmask; > buf->bs_dmstate = dic->di_dmstate; > -- > 2.5.0 > > _______________________________________________ > xfs mailing list > xfs@oss.sgi.com > http://oss.sgi.com/mailman/listinfo/xfs From bfoster@redhat.com Mon Feb 8 09:29:45 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=ham version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay3.corp.sgi.com [198.149.34.15]) by oss.sgi.com (Postfix) with ESMTP id BC29629E06 for ; Mon, 8 Feb 2016 09:29:44 -0600 (CST) Received: from cuda.sgi.com (cuda2.sgi.com [192.48.176.25]) by relay3.corp.sgi.com (Postfix) with ESMTP id 2AE84AC002 for ; Mon, 8 Feb 2016 07:29:44 -0800 (PST) X-ASG-Debug-ID: 1454945380-04cbb04cfc166820001-NocioJ Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by cuda.sgi.com with ESMTP id IZsJECnZUBoQl1q5 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO) for ; Mon, 08 Feb 2016 07:29:40 -0800 (PST) X-Barracuda-Envelope-From: bfoster@redhat.com X-Barracuda-Apparent-Source-IP: 209.132.183.28 X-ASG-Whitelist: Client Received: from int-mx09.intmail.prod.int.phx2.redhat.com (int-mx09.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by mx1.redhat.com (Postfix) with ESMTPS id 44F9D341AC7; Mon, 8 Feb 2016 15:29:40 +0000 (UTC) Received: from bfoster.bfoster (dhcp-41-164.bos.redhat.com [10.18.41.164]) by int-mx09.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id u18FTdGM016358; Mon, 8 Feb 2016 10:29:39 -0500 Received: by bfoster.bfoster (Postfix, from userid 1000) id BF38D123DF8; Mon, 8 Feb 2016 10:29:38 -0500 (EST) Date: Mon, 8 Feb 2016 10:29:38 -0500 From: Brian Foster To: Dave Chinner Cc: xfs@oss.sgi.com Subject: Re: [PATCH 9/9] xfs: mode di_mode to vfs inode Message-ID: <20160208152938.GF19597@bfoster.bfoster> X-ASG-Orig-Subj: Re: [PATCH 9/9] xfs: mode di_mode to vfs inode References: <1454905461-2773-1-git-send-email-david@fromorbit.com> <1454905461-2773-10-git-send-email-david@fromorbit.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1454905461-2773-10-git-send-email-david@fromorbit.com> User-Agent: Mutt/1.5.24 (2015-08-30) X-Scanned-By: MIMEDefang 2.68 on 10.5.11.22 X-Barracuda-Connect: mx1.redhat.com[209.132.183.28] X-Barracuda-Start-Time: 1454945380 X-Barracuda-Encrypted: ECDHE-RSA-AES256-GCM-SHA384 X-Barracuda-URL: https://192.48.176.25:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-BRTS-Status: 1 On Mon, Feb 08, 2016 at 03:24:21PM +1100, Dave Chinner wrote: > From: Dave Chinner > > Move the di_mode value from the xfs_icdinode to the VFS inode, reducing > the xfs_icdinode byte another 2 bytes and collapsing another 2 byte hole > in the structure. > > Signed-off-by: Dave Chinner > --- Reviewed-by: Brian Foster > fs/xfs/libxfs/xfs_bmap.c | 6 +++--- > fs/xfs/libxfs/xfs_dir2.c | 12 +++++------ > fs/xfs/libxfs/xfs_inode_buf.c | 8 +++---- > fs/xfs/libxfs/xfs_inode_buf.h | 1 - > fs/xfs/libxfs/xfs_inode_fork.c | 2 +- > fs/xfs/xfs_bmap_util.c | 4 ++-- > fs/xfs/xfs_dir2_readdir.c | 2 +- > fs/xfs/xfs_file.c | 6 +++--- > fs/xfs/xfs_filestream.c | 4 ++-- > fs/xfs/xfs_icache.c | 13 ++++++++---- > fs/xfs/xfs_inode.c | 48 ++++++++++++++++++++---------------------- > fs/xfs/xfs_inode.h | 4 ++-- > fs/xfs/xfs_inode_item.c | 2 +- > fs/xfs/xfs_ioctl.c | 14 ++++++------ > fs/xfs/xfs_iops.c | 12 ++++------- > fs/xfs/xfs_itable.c | 2 +- > fs/xfs/xfs_log_recover.c | 2 +- > fs/xfs/xfs_mount.c | 2 +- > 18 files changed, 71 insertions(+), 73 deletions(-) > > diff --git a/fs/xfs/libxfs/xfs_bmap.c b/fs/xfs/libxfs/xfs_bmap.c > index ef00156..6a05166 100644 > --- a/fs/xfs/libxfs/xfs_bmap.c > +++ b/fs/xfs/libxfs/xfs_bmap.c > @@ -912,7 +912,7 @@ xfs_bmap_local_to_extents( > * We don't want to deal with the case of keeping inode data inline yet. > * So sending the data fork of a regular inode is invalid. > */ > - ASSERT(!(S_ISREG(ip->i_d.di_mode) && whichfork == XFS_DATA_FORK)); > + ASSERT(!(S_ISREG(VFS_I(ip)->i_mode) && whichfork == XFS_DATA_FORK)); > ifp = XFS_IFORK_PTR(ip, whichfork); > ASSERT(XFS_IFORK_FORMAT(ip, whichfork) == XFS_DINODE_FMT_LOCAL); > > @@ -1079,7 +1079,7 @@ xfs_bmap_add_attrfork_local( > if (ip->i_df.if_bytes <= XFS_IFORK_DSIZE(ip)) > return 0; > > - if (S_ISDIR(ip->i_d.di_mode)) { > + if (S_ISDIR(VFS_I(ip)->i_mode)) { > memset(&dargs, 0, sizeof(dargs)); > dargs.geo = ip->i_mount->m_dir_geo; > dargs.dp = ip; > @@ -1091,7 +1091,7 @@ xfs_bmap_add_attrfork_local( > return xfs_dir2_sf_to_block(&dargs); > } > > - if (S_ISLNK(ip->i_d.di_mode)) > + if (S_ISLNK(VFS_I(ip)->i_mode)) > return xfs_bmap_local_to_extents(tp, ip, firstblock, 1, > flags, XFS_DATA_FORK, > xfs_symlink_local_to_remote); > diff --git a/fs/xfs/libxfs/xfs_dir2.c b/fs/xfs/libxfs/xfs_dir2.c > index 2fb53a5..af0f9d1 100644 > --- a/fs/xfs/libxfs/xfs_dir2.c > +++ b/fs/xfs/libxfs/xfs_dir2.c > @@ -176,7 +176,7 @@ xfs_dir_isempty( > { > xfs_dir2_sf_hdr_t *sfp; > > - ASSERT(S_ISDIR(dp->i_d.di_mode)); > + ASSERT(S_ISDIR(VFS_I(dp)->i_mode)); > if (dp->i_d.di_size == 0) /* might happen during shutdown. */ > return 1; > if (dp->i_d.di_size > XFS_IFORK_DSIZE(dp)) > @@ -231,7 +231,7 @@ xfs_dir_init( > struct xfs_da_args *args; > int error; > > - ASSERT(S_ISDIR(dp->i_d.di_mode)); > + ASSERT(S_ISDIR(VFS_I(dp)->i_mode)); > error = xfs_dir_ino_validate(tp->t_mountp, pdp->i_ino); > if (error) > return error; > @@ -266,7 +266,7 @@ xfs_dir_createname( > int rval; > int v; /* type-checking value */ > > - ASSERT(S_ISDIR(dp->i_d.di_mode)); > + ASSERT(S_ISDIR(VFS_I(dp)->i_mode)); > if (inum) { > rval = xfs_dir_ino_validate(tp->t_mountp, inum); > if (rval) > @@ -364,7 +364,7 @@ xfs_dir_lookup( > int v; /* type-checking value */ > int lock_mode; > > - ASSERT(S_ISDIR(dp->i_d.di_mode)); > + ASSERT(S_ISDIR(VFS_I(dp)->i_mode)); > XFS_STATS_INC(dp->i_mount, xs_dir_lookup); > > /* > @@ -443,7 +443,7 @@ xfs_dir_removename( > int rval; > int v; /* type-checking value */ > > - ASSERT(S_ISDIR(dp->i_d.di_mode)); > + ASSERT(S_ISDIR(VFS_I(dp)->i_mode)); > XFS_STATS_INC(dp->i_mount, xs_dir_remove); > > args = kmem_zalloc(sizeof(*args), KM_SLEEP | KM_NOFS); > @@ -505,7 +505,7 @@ xfs_dir_replace( > int rval; > int v; /* type-checking value */ > > - ASSERT(S_ISDIR(dp->i_d.di_mode)); > + ASSERT(S_ISDIR(VFS_I(dp)->i_mode)); > > rval = xfs_dir_ino_validate(tp->t_mountp, inum); > if (rval) > diff --git a/fs/xfs/libxfs/xfs_inode_buf.c b/fs/xfs/libxfs/xfs_inode_buf.c > index 9807c21..4a388b0 100644 > --- a/fs/xfs/libxfs/xfs_inode_buf.c > +++ b/fs/xfs/libxfs/xfs_inode_buf.c > @@ -202,13 +202,12 @@ xfs_inode_from_disk( > struct xfs_icdinode *to = &ip->i_d; > struct inode *inode = VFS_I(ip); > > - to->di_mode = be16_to_cpu(from->di_mode); > - to->di_version = from ->di_version; > > /* > * Convert v1 inodes immediately to v2 inode format as this is the > * minimum inode version format we support in the rest of the code. > */ > + to->di_version = from->di_version; > if (to->di_version == 1) { > set_nlink(inode, be16_to_cpu(from->di_onlink)); > to->di_projid_lo = 0; > @@ -238,6 +237,7 @@ xfs_inode_from_disk( > inode->i_ctime.tv_sec = (int)be32_to_cpu(from->di_ctime.t_sec); > inode->i_ctime.tv_nsec = (int)be32_to_cpu(from->di_ctime.t_nsec); > inode->i_generation = be32_to_cpu(from->di_gen); > + inode->i_mode = be16_to_cpu(from->di_mode); > > to->di_size = be64_to_cpu(from->di_size); > to->di_nblocks = be64_to_cpu(from->di_nblocks); > @@ -270,7 +270,6 @@ xfs_inode_to_disk( > to->di_magic = cpu_to_be16(XFS_DINODE_MAGIC); > to->di_onlink = 0; > > - to->di_mode = cpu_to_be16(from->di_mode); > to->di_version = from->di_version; > to->di_format = from->di_format; > to->di_uid = cpu_to_be32(from->di_uid); > @@ -287,6 +286,7 @@ xfs_inode_to_disk( > to->di_ctime.t_nsec = cpu_to_be32(inode->i_ctime.tv_nsec); > to->di_nlink = cpu_to_be32(inode->i_nlink); > to->di_gen = cpu_to_be32(inode->i_generation); > + to->di_mode = cpu_to_be16(inode->i_mode); > > to->di_size = cpu_to_be64(from->di_size); > to->di_nblocks = cpu_to_be64(from->di_nblocks); > @@ -501,7 +501,7 @@ xfs_iread( > * the inode is already free and not try to mess > * with the uninitialized part of it. > */ > - ip->i_d.di_mode = 0; > + VFS_I(ip)->i_mode = 0; > } > > ASSERT(ip->i_d.di_version >= 2); > diff --git a/fs/xfs/libxfs/xfs_inode_buf.h b/fs/xfs/libxfs/xfs_inode_buf.h > index c51bd12..7c4dd32 100644 > --- a/fs/xfs/libxfs/xfs_inode_buf.h > +++ b/fs/xfs/libxfs/xfs_inode_buf.h > @@ -28,7 +28,6 @@ struct xfs_dinode; > * format specific structures at the appropriate time. > */ > struct xfs_icdinode { > - __uint16_t di_mode; /* mode and type of file */ > __int8_t di_version; /* inode version */ > __int8_t di_format; /* format of di_c data */ > __uint16_t di_flushiter; /* incremented on flush */ > diff --git a/fs/xfs/libxfs/xfs_inode_fork.c b/fs/xfs/libxfs/xfs_inode_fork.c > index ef22a78..11faf7d 100644 > --- a/fs/xfs/libxfs/xfs_inode_fork.c > +++ b/fs/xfs/libxfs/xfs_inode_fork.c > @@ -121,7 +121,7 @@ xfs_iformat_fork( > return -EFSCORRUPTED; > } > > - switch (ip->i_d.di_mode & S_IFMT) { > + switch (VFS_I(ip)->i_mode & S_IFMT) { > case S_IFIFO: > case S_IFCHR: > case S_IFBLK: > diff --git a/fs/xfs/xfs_bmap_util.c b/fs/xfs/xfs_bmap_util.c > index 07ef29b..fd7f51c 100644 > --- a/fs/xfs/xfs_bmap_util.c > +++ b/fs/xfs/xfs_bmap_util.c > @@ -823,7 +823,7 @@ bool > xfs_can_free_eofblocks(struct xfs_inode *ip, bool force) > { > /* prealloc/delalloc exists only on regular files */ > - if (!S_ISREG(ip->i_d.di_mode)) > + if (!S_ISREG(VFS_I(ip)->i_mode)) > return false; > > /* > @@ -1728,7 +1728,7 @@ xfs_swap_extents( > xfs_lock_two_inodes(ip, tip, XFS_MMAPLOCK_EXCL); > > /* Verify that both files have the same format */ > - if ((ip->i_d.di_mode & S_IFMT) != (tip->i_d.di_mode & S_IFMT)) { > + if ((VFS_I(ip)->i_mode & S_IFMT) != (VFS_I(tip)->i_mode & S_IFMT)) { > error = -EINVAL; > goto out_unlock; > } > diff --git a/fs/xfs/xfs_dir2_readdir.c b/fs/xfs/xfs_dir2_readdir.c > index 642d55d..93b3ab0 100644 > --- a/fs/xfs/xfs_dir2_readdir.c > +++ b/fs/xfs/xfs_dir2_readdir.c > @@ -665,7 +665,7 @@ xfs_readdir( > if (XFS_FORCED_SHUTDOWN(dp->i_mount)) > return -EIO; > > - ASSERT(S_ISDIR(dp->i_d.di_mode)); > + ASSERT(S_ISDIR(VFS_I(dp)->i_mode)); > XFS_STATS_INC(dp->i_mount, xs_dir_getdents); > > args.dp = dp; > diff --git a/fs/xfs/xfs_file.c b/fs/xfs/xfs_file.c > index 70a4b5a..ac0fd32 100644 > --- a/fs/xfs/xfs_file.c > +++ b/fs/xfs/xfs_file.c > @@ -156,9 +156,9 @@ xfs_update_prealloc_flags( > xfs_trans_ijoin(tp, ip, XFS_ILOCK_EXCL); > > if (!(flags & XFS_PREALLOC_INVISIBLE)) { > - ip->i_d.di_mode &= ~S_ISUID; > - if (ip->i_d.di_mode & S_IXGRP) > - ip->i_d.di_mode &= ~S_ISGID; > + VFS_I(ip)->i_mode &= ~S_ISUID; > + if (VFS_I(ip)->i_mode & S_IXGRP) > + VFS_I(ip)->i_mode &= ~S_ISGID; > xfs_trans_ichgtime(tp, ip, XFS_ICHGTIME_MOD | XFS_ICHGTIME_CHG); > } > > diff --git a/fs/xfs/xfs_filestream.c b/fs/xfs/xfs_filestream.c > index c4c130f..a51353a 100644 > --- a/fs/xfs/xfs_filestream.c > +++ b/fs/xfs/xfs_filestream.c > @@ -151,7 +151,7 @@ xfs_filestream_pick_ag( > xfs_agnumber_t ag, max_ag = NULLAGNUMBER; > int err, trylock, nscan; > > - ASSERT(S_ISDIR(ip->i_d.di_mode)); > + ASSERT(S_ISDIR(VFS_I(ip)->i_mode)); > > /* 2% of an AG's blocks must be free for it to be chosen. */ > minfree = mp->m_sb.sb_agblocks / 50; > @@ -319,7 +319,7 @@ xfs_filestream_lookup_ag( > xfs_agnumber_t startag, ag = NULLAGNUMBER; > struct xfs_mru_cache_elem *mru; > > - ASSERT(S_ISREG(ip->i_d.di_mode)); > + ASSERT(S_ISREG(VFS_I(ip)->i_mode)); > > pip = xfs_filestream_get_parent(ip); > if (!pip) > diff --git a/fs/xfs/xfs_icache.c b/fs/xfs/xfs_icache.c > index 30eafad..bf2d607 100644 > --- a/fs/xfs/xfs_icache.c > +++ b/fs/xfs/xfs_icache.c > @@ -63,6 +63,9 @@ xfs_inode_alloc( > return NULL; > } > > + /* VFS doesn't initialise i_mode! */ > + VFS_I(ip)->i_mode = 0; > + > XFS_STATS_INC(mp, vn_active); > ASSERT(atomic_read(&ip->i_pincount) == 0); > ASSERT(!spin_is_locked(&ip->i_flags_lock)); > @@ -98,7 +101,7 @@ void > xfs_inode_free( > struct xfs_inode *ip) > { > - switch (ip->i_d.di_mode & S_IFMT) { > + switch (VFS_I(ip)->i_mode & S_IFMT) { > case S_IFREG: > case S_IFDIR: > case S_IFLNK: > @@ -151,12 +154,14 @@ xfs_reinit_inode( > uint32_t nlink = inode->i_nlink; > uint32_t generation = inode->i_generation; > uint64_t version = inode->i_version; > + umode_t mode = inode->i_mode; > > error = inode_init_always(mp->m_super, inode); > > set_nlink(inode, nlink); > inode->i_generation = generation; > inode->i_version = version; > + inode->i_mode = mode; > return error; > } > > @@ -211,7 +216,7 @@ xfs_iget_cache_hit( > /* > * If lookup is racing with unlink return an error immediately. > */ > - if (ip->i_d.di_mode == 0 && !(flags & XFS_IGET_CREATE)) { > + if (VFS_I(ip)->i_mode == 0 && !(flags & XFS_IGET_CREATE)) { > error = -ENOENT; > goto out_error; > } > @@ -321,7 +326,7 @@ xfs_iget_cache_miss( > > trace_xfs_iget_miss(ip); > > - if ((ip->i_d.di_mode == 0) && !(flags & XFS_IGET_CREATE)) { > + if ((VFS_I(ip)->i_mode == 0) && !(flags & XFS_IGET_CREATE)) { > error = -ENOENT; > goto out_destroy; > } > @@ -470,7 +475,7 @@ again: > * If we have a real type for an on-disk inode, we can setup the inode > * now. If it's a new inode being created, xfs_ialloc will handle it. > */ > - if (xfs_iflags_test(ip, XFS_INEW) && ip->i_d.di_mode != 0) > + if (xfs_iflags_test(ip, XFS_INEW) && VFS_I(ip)->i_mode != 0) > xfs_setup_existing_inode(ip); > return 0; > > diff --git a/fs/xfs/xfs_inode.c b/fs/xfs/xfs_inode.c > index 16fabbf..205796f 100644 > --- a/fs/xfs/xfs_inode.c > +++ b/fs/xfs/xfs_inode.c > @@ -802,7 +802,7 @@ xfs_ialloc( > if (ip->i_d.di_version == 1) > ip->i_d.di_version = 2; > > - ip->i_d.di_mode = mode; > + inode->i_mode = mode; > set_nlink(inode, nlink); > ip->i_d.di_uid = xfs_kuid_to_uid(current_fsuid()); > ip->i_d.di_gid = xfs_kgid_to_gid(current_fsgid()); > @@ -810,9 +810,8 @@ xfs_ialloc( > > if (pip && XFS_INHERIT_GID(pip)) { > ip->i_d.di_gid = pip->i_d.di_gid; > - if ((pip->i_d.di_mode & S_ISGID) && S_ISDIR(mode)) { > - ip->i_d.di_mode |= S_ISGID; > - } > + if ((VFS_I(pip)->i_mode & S_ISGID) && S_ISDIR(mode)) > + inode->i_mode |= S_ISGID; > } > > /* > @@ -821,10 +820,9 @@ xfs_ialloc( > * (and only if the irix_sgid_inherit compatibility variable is set). > */ > if ((irix_sgid_inherit) && > - (ip->i_d.di_mode & S_ISGID) && > - (!in_group_p(xfs_gid_to_kgid(ip->i_d.di_gid)))) { > - ip->i_d.di_mode &= ~S_ISGID; > - } > + (inode->i_mode & S_ISGID) && > + (!in_group_p(xfs_gid_to_kgid(ip->i_d.di_gid)))) > + inode->i_mode &= ~S_ISGID; > > ip->i_d.di_size = 0; > ip->i_d.di_nextents = 0; > @@ -1421,7 +1419,7 @@ xfs_link( > > trace_xfs_link(tdp, target_name); > > - ASSERT(!S_ISDIR(sip->i_d.di_mode)); > + ASSERT(!S_ISDIR(VFS_I(sip)->i_mode)); > > if (XFS_FORCED_SHUTDOWN(mp)) > return -EIO; > @@ -1628,7 +1626,7 @@ xfs_release( > xfs_mount_t *mp = ip->i_mount; > int error; > > - if (!S_ISREG(ip->i_d.di_mode) || (ip->i_d.di_mode == 0)) > + if (!S_ISREG(VFS_I(ip)->i_mode) || (VFS_I(ip)->i_mode == 0)) > return 0; > > /* If this is a read-only mount, don't do this (would generate I/O) */ > @@ -1863,7 +1861,7 @@ xfs_inactive( > * If the inode is already free, then there can be nothing > * to clean up here. > */ > - if (ip->i_d.di_mode == 0) { > + if (VFS_I(ip)->i_mode == 0) { > ASSERT(ip->i_df.if_real_bytes == 0); > ASSERT(ip->i_df.if_broot_bytes == 0); > return; > @@ -1887,7 +1885,7 @@ xfs_inactive( > return; > } > > - if (S_ISREG(ip->i_d.di_mode) && > + if (S_ISREG(VFS_I(ip)->i_mode) && > (ip->i_d.di_size != 0 || XFS_ISIZE(ip) != 0 || > ip->i_d.di_nextents > 0 || ip->i_delayed_blks > 0)) > truncate = 1; > @@ -1896,7 +1894,7 @@ xfs_inactive( > if (error) > return; > > - if (S_ISLNK(ip->i_d.di_mode)) > + if (S_ISLNK(VFS_I(ip)->i_mode)) > error = xfs_inactive_symlink(ip); > else if (truncate) > error = xfs_inactive_truncate(ip); > @@ -1958,7 +1956,7 @@ xfs_iunlink( > int error; > > ASSERT(VFS_I(ip)->i_nlink == 0 || ignore_linkcount); > - ASSERT(ip->i_d.di_mode != 0); > + ASSERT(VFS_I(ip)->i_mode != 0); > > mp = tp->t_mountp; > > @@ -2401,7 +2399,7 @@ xfs_ifree( > ASSERT(VFS_I(ip)->i_nlink == 0); > ASSERT(ip->i_d.di_nextents == 0); > ASSERT(ip->i_d.di_anextents == 0); > - ASSERT(ip->i_d.di_size == 0 || !S_ISREG(ip->i_d.di_mode)); > + ASSERT(ip->i_d.di_size == 0 || !S_ISREG(VFS_I(ip)->i_mode)); > ASSERT(ip->i_d.di_nblocks == 0); > > /* > @@ -2415,7 +2413,7 @@ xfs_ifree( > if (error) > return error; > > - ip->i_d.di_mode = 0; /* mark incore inode as free */ > + VFS_I(ip)->i_mode = 0; /* mark incore inode as free */ > ip->i_d.di_flags = 0; > ip->i_d.di_dmevmask = 0; > ip->i_d.di_forkoff = 0; /* mark the attr fork not in use */ > @@ -2512,7 +2510,7 @@ xfs_remove( > { > xfs_mount_t *mp = dp->i_mount; > xfs_trans_t *tp = NULL; > - int is_dir = S_ISDIR(ip->i_d.di_mode); > + int is_dir = S_ISDIR(VFS_I(ip)->i_mode); > int error = 0; > xfs_bmap_free_t free_list; > xfs_fsblock_t first_block; > @@ -2757,7 +2755,7 @@ xfs_cross_rename( > if (dp1 != dp2) { > dp2_flags = XFS_ICHGTIME_MOD | XFS_ICHGTIME_CHG; > > - if (S_ISDIR(ip2->i_d.di_mode)) { > + if (S_ISDIR(VFS_I(ip2)->i_mode)) { > error = xfs_dir_replace(tp, ip2, &xfs_name_dotdot, > dp1->i_ino, first_block, > free_list, spaceres); > @@ -2765,7 +2763,7 @@ xfs_cross_rename( > goto out_trans_abort; > > /* transfer ip2 ".." reference to dp1 */ > - if (!S_ISDIR(ip1->i_d.di_mode)) { > + if (!S_ISDIR(VFS_I(ip1)->i_mode)) { > error = xfs_droplink(tp, dp2); > if (error) > goto out_trans_abort; > @@ -2784,7 +2782,7 @@ xfs_cross_rename( > ip2_flags |= XFS_ICHGTIME_MOD | XFS_ICHGTIME_CHG; > } > > - if (S_ISDIR(ip1->i_d.di_mode)) { > + if (S_ISDIR(VFS_I(ip1)->i_mode)) { > error = xfs_dir_replace(tp, ip1, &xfs_name_dotdot, > dp2->i_ino, first_block, > free_list, spaceres); > @@ -2792,7 +2790,7 @@ xfs_cross_rename( > goto out_trans_abort; > > /* transfer ip1 ".." reference to dp2 */ > - if (!S_ISDIR(ip2->i_d.di_mode)) { > + if (!S_ISDIR(VFS_I(ip2)->i_mode)) { > error = xfs_droplink(tp, dp1); > if (error) > goto out_trans_abort; > @@ -2889,7 +2887,7 @@ xfs_rename( > struct xfs_inode *inodes[__XFS_SORT_INODES]; > int num_inodes = __XFS_SORT_INODES; > bool new_parent = (src_dp != target_dp); > - bool src_is_directory = S_ISDIR(src_ip->i_d.di_mode); > + bool src_is_directory = S_ISDIR(VFS_I(src_ip)->i_mode); > int spaceres; > int error; > > @@ -3018,7 +3016,7 @@ xfs_rename( > * target and source are directories and that target can be > * destroyed, or that neither is a directory. > */ > - if (S_ISDIR(target_ip->i_d.di_mode)) { > + if (S_ISDIR(VFS_I(target_ip)->i_mode)) { > /* > * Make sure target dir is empty. > */ > @@ -3448,7 +3446,7 @@ xfs_iflush_int( > __func__, ip->i_ino, be16_to_cpu(dip->di_magic), dip); > goto corrupt_out; > } > - if (S_ISREG(ip->i_d.di_mode)) { > + if (S_ISREG(VFS_I(ip)->i_mode)) { > if (XFS_TEST_ERROR( > (ip->i_d.di_format != XFS_DINODE_FMT_EXTENTS) && > (ip->i_d.di_format != XFS_DINODE_FMT_BTREE), > @@ -3458,7 +3456,7 @@ xfs_iflush_int( > __func__, ip->i_ino, ip); > goto corrupt_out; > } > - } else if (S_ISDIR(ip->i_d.di_mode)) { > + } else if (S_ISDIR(VFS_I(ip)->i_mode)) { > if (XFS_TEST_ERROR( > (ip->i_d.di_format != XFS_DINODE_FMT_EXTENTS) && > (ip->i_d.di_format != XFS_DINODE_FMT_BTREE) && > diff --git a/fs/xfs/xfs_inode.h b/fs/xfs/xfs_inode.h > index 4eaf425..43e1d51 100644 > --- a/fs/xfs/xfs_inode.h > +++ b/fs/xfs/xfs_inode.h > @@ -88,7 +88,7 @@ static inline struct inode *VFS_I(struct xfs_inode *ip) > */ > static inline xfs_fsize_t XFS_ISIZE(struct xfs_inode *ip) > { > - if (S_ISREG(ip->i_d.di_mode)) > + if (S_ISREG(VFS_I(ip)->i_mode)) > return i_size_read(VFS_I(ip)); > return ip->i_d.di_size; > } > @@ -369,7 +369,7 @@ static inline int xfs_isiflocked(struct xfs_inode *ip) > */ > #define XFS_INHERIT_GID(pip) \ > (((pip)->i_mount->m_flags & XFS_MOUNT_GRPID) || \ > - ((pip)->i_d.di_mode & S_ISGID)) > + (VFS_I(pip)->i_mode & S_ISGID)) > > int xfs_release(struct xfs_inode *ip); > void xfs_inactive(struct xfs_inode *ip); > diff --git a/fs/xfs/xfs_inode_item.c b/fs/xfs/xfs_inode_item.c > index 3415c63..c48b5b1 100644 > --- a/fs/xfs/xfs_inode_item.c > +++ b/fs/xfs/xfs_inode_item.c > @@ -333,7 +333,6 @@ xfs_inode_to_log_dinode( > > to->di_magic = XFS_DINODE_MAGIC; > > - to->di_mode = from->di_mode; > to->di_version = from->di_version; > to->di_format = from->di_format; > to->di_uid = from->di_uid; > @@ -351,6 +350,7 @@ xfs_inode_to_log_dinode( > to->di_ctime.t_nsec = inode->i_ctime.tv_nsec; > to->di_nlink = inode->i_nlink; > to->di_gen = inode->i_generation; > + to->di_mode = inode->i_mode; > > to->di_size = from->di_size; > to->di_nblocks = from->di_nblocks; > diff --git a/fs/xfs/xfs_ioctl.c b/fs/xfs/xfs_ioctl.c > index cdd6c31..81d6d62 100644 > --- a/fs/xfs/xfs_ioctl.c > +++ b/fs/xfs/xfs_ioctl.c > @@ -963,7 +963,7 @@ xfs_set_diflags( > di_flags |= XFS_DIFLAG_NODEFRAG; > if (xflags & FS_XFLAG_FILESTREAM) > di_flags |= XFS_DIFLAG_FILESTREAM; > - if (S_ISDIR(ip->i_d.di_mode)) { > + if (S_ISDIR(VFS_I(ip)->i_mode)) { > if (xflags & FS_XFLAG_RTINHERIT) > di_flags |= XFS_DIFLAG_RTINHERIT; > if (xflags & FS_XFLAG_NOSYMLINKS) > @@ -972,7 +972,7 @@ xfs_set_diflags( > di_flags |= XFS_DIFLAG_EXTSZINHERIT; > if (xflags & FS_XFLAG_PROJINHERIT) > di_flags |= XFS_DIFLAG_PROJINHERIT; > - } else if (S_ISREG(ip->i_d.di_mode)) { > + } else if (S_ISREG(VFS_I(ip)->i_mode)) { > if (xflags & FS_XFLAG_REALTIME) > di_flags |= XFS_DIFLAG_REALTIME; > if (xflags & FS_XFLAG_EXTSIZE) > @@ -1128,14 +1128,14 @@ xfs_ioctl_setattr_check_extsize( > { > struct xfs_mount *mp = ip->i_mount; > > - if ((fa->fsx_xflags & FS_XFLAG_EXTSIZE) && !S_ISREG(ip->i_d.di_mode)) > + if ((fa->fsx_xflags & FS_XFLAG_EXTSIZE) && !S_ISREG(VFS_I(ip)->i_mode)) > return -EINVAL; > > if ((fa->fsx_xflags & FS_XFLAG_EXTSZINHERIT) && > - !S_ISDIR(ip->i_d.di_mode)) > + !S_ISDIR(VFS_I(ip)->i_mode)) > return -EINVAL; > > - if (S_ISREG(ip->i_d.di_mode) && ip->i_d.di_nextents && > + if (S_ISREG(VFS_I(ip)->i_mode) && ip->i_d.di_nextents && > ((ip->i_d.di_extsize << mp->m_sb.sb_blocklog) != fa->fsx_extsize)) > return -EINVAL; > > @@ -1256,9 +1256,9 @@ xfs_ioctl_setattr( > * successful return from chown() > */ > > - if ((ip->i_d.di_mode & (S_ISUID|S_ISGID)) && > + if ((VFS_I(ip)->i_mode & (S_ISUID|S_ISGID)) && > !capable_wrt_inode_uidgid(VFS_I(ip), CAP_FSETID)) > - ip->i_d.di_mode &= ~(S_ISUID|S_ISGID); > + VFS_I(ip)->i_mode &= ~(S_ISUID|S_ISGID); > > /* Change the ownerships and register project quota modifications */ > if (xfs_get_projid(ip) != fa->fsx_projid) { > diff --git a/fs/xfs/xfs_iops.c b/fs/xfs/xfs_iops.c > index a4daa3f..0d38b1d 100644 > --- a/fs/xfs/xfs_iops.c > +++ b/fs/xfs/xfs_iops.c > @@ -459,7 +459,7 @@ xfs_vn_getattr( > > stat->size = XFS_ISIZE(ip); > stat->dev = inode->i_sb->s_dev; > - stat->mode = ip->i_d.di_mode; > + stat->mode = inode->i_mode; > stat->nlink = inode->i_nlink; > stat->uid = inode->i_uid; > stat->gid = inode->i_gid; > @@ -506,9 +506,6 @@ xfs_setattr_mode( > > ASSERT(xfs_isilocked(ip, XFS_ILOCK_EXCL)); > > - ip->i_d.di_mode &= S_IFMT; > - ip->i_d.di_mode |= mode & ~S_IFMT; > - > inode->i_mode &= S_IFMT; > inode->i_mode |= mode & ~S_IFMT; > } > @@ -652,9 +649,9 @@ xfs_setattr_nonsize( > * The set-user-ID and set-group-ID bits of a file will be > * cleared upon successful return from chown() > */ > - if ((ip->i_d.di_mode & (S_ISUID|S_ISGID)) && > + if ((inode->i_mode & (S_ISUID|S_ISGID)) && > !capable(CAP_FSETID)) > - ip->i_d.di_mode &= ~(S_ISUID|S_ISGID); > + inode->i_mode &= ~(S_ISUID|S_ISGID); > > /* > * Change the ownerships and register quota modifications > @@ -764,7 +761,7 @@ xfs_setattr_size( > > ASSERT(xfs_isilocked(ip, XFS_IOLOCK_EXCL)); > ASSERT(xfs_isilocked(ip, XFS_MMAPLOCK_EXCL)); > - ASSERT(S_ISREG(ip->i_d.di_mode)); > + ASSERT(S_ISREG(inode->i_mode)); > ASSERT((iattr->ia_valid & (ATTR_UID|ATTR_GID|ATTR_ATIME|ATTR_ATIME_SET| > ATTR_MTIME_SET|ATTR_KILL_PRIV|ATTR_TIMES_SET)) == 0); > > @@ -1215,7 +1212,6 @@ xfs_setup_inode( > /* make the inode look hashed for the writeback code */ > hlist_add_fake(&inode->i_hash); > > - inode->i_mode = ip->i_d.di_mode; > inode->i_uid = xfs_uid_to_kuid(ip->i_d.di_uid); > inode->i_gid = xfs_gid_to_kgid(ip->i_d.di_gid); > > diff --git a/fs/xfs/xfs_itable.c b/fs/xfs/xfs_itable.c > index 6162e65..ce73eb3 100644 > --- a/fs/xfs/xfs_itable.c > +++ b/fs/xfs/xfs_itable.c > @@ -88,7 +88,6 @@ xfs_bulkstat_one_int( > buf->bs_projid_lo = dic->di_projid_lo; > buf->bs_projid_hi = dic->di_projid_hi; > buf->bs_ino = ino; > - buf->bs_mode = dic->di_mode; > buf->bs_uid = dic->di_uid; > buf->bs_gid = dic->di_gid; > buf->bs_size = dic->di_size; > @@ -101,6 +100,7 @@ xfs_bulkstat_one_int( > buf->bs_ctime.tv_sec = inode->i_ctime.tv_sec; > buf->bs_ctime.tv_nsec = inode->i_ctime.tv_nsec; > buf->bs_gen = inode->i_generation; > + buf->bs_mode = inode->i_mode; > > buf->bs_xflags = xfs_ip2xflags(ip); > buf->bs_extsize = dic->di_extsize << mp->m_sb.sb_blocklog; > diff --git a/fs/xfs/xfs_log_recover.c b/fs/xfs/xfs_log_recover.c > index 678fe6e..04326ac 100644 > --- a/fs/xfs/xfs_log_recover.c > +++ b/fs/xfs/xfs_log_recover.c > @@ -4343,7 +4343,7 @@ xlog_recover_process_one_iunlink( > goto fail_iput; > > ASSERT(VFS_I(ip)->i_nlink == 0); > - ASSERT(ip->i_d.di_mode != 0); > + ASSERT(VFS_I(ip)->i_mode != 0); > > /* setup for the next pass */ > agino = be32_to_cpu(dip->di_next_unlinked); > diff --git a/fs/xfs/xfs_mount.c b/fs/xfs/xfs_mount.c > index bb753b3..d306105 100644 > --- a/fs/xfs/xfs_mount.c > +++ b/fs/xfs/xfs_mount.c > @@ -865,7 +865,7 @@ xfs_mountfs( > > ASSERT(rip != NULL); > > - if (unlikely(!S_ISDIR(rip->i_d.di_mode))) { > + if (unlikely(!S_ISDIR(VFS_I(rip)->i_mode))) { > xfs_warn(mp, "corrupted root inode %llu: not a directory", > (unsigned long long)rip->i_ino); > xfs_iunlock(rip, XFS_ILOCK_EXCL); > -- > 2.5.0 > > _______________________________________________ > xfs mailing list > xfs@oss.sgi.com > http://oss.sgi.com/mailman/listinfo/xfs From ross.zwisler@linux.intel.com Mon Feb 8 09:34:54 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=ham version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay3.corp.sgi.com [198.149.34.15]) by oss.sgi.com (Postfix) with ESMTP id C281A29DF5 for ; Mon, 8 Feb 2016 09:34:54 -0600 (CST) Received: from cuda.sgi.com (cuda1.sgi.com [192.48.157.11]) by relay3.corp.sgi.com (Postfix) with ESMTP id 5E44CAC001 for ; Mon, 8 Feb 2016 07:34:54 -0800 (PST) X-ASG-Debug-ID: 1454945692-04bdf079c31486a0001-NocioJ Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) by cuda.sgi.com with ESMTP id LkV3j53B2N0TXoAN for ; Mon, 08 Feb 2016 07:34:53 -0800 (PST) X-Barracuda-Envelope-From: ross.zwisler@linux.intel.com X-Barracuda-Apparent-Source-IP: 134.134.136.20 X-ASG-Whitelist: Client Received: from orsmga002.jf.intel.com ([10.7.209.21]) by orsmga101.jf.intel.com with ESMTP; 08 Feb 2016 07:34:53 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.22,416,1449561600"; d="scan'208";a="907863244" Received: from rzwisler-desk.amr.corp.intel.com (HELO linux.intel.com) ([10.254.103.197]) by orsmga002.jf.intel.com with ESMTP; 08 Feb 2016 07:34:51 -0800 Date: Mon, 8 Feb 2016 08:34:43 -0700 From: Ross Zwisler To: Dave Chinner Cc: Ross Zwisler , linux-kernel@vger.kernel.org, Theodore Ts'o , Alexander Viro , Andreas Dilger , Andrew Morton , Dan Williams , Jan Kara , Matthew Wilcox , linux-ext4@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux-mm@kvack.org, linux-nvdimm@lists.01.org, xfs@oss.sgi.com Subject: Re: [PATCH 1/2] dax: pass bdev argument to dax_clear_blocks() Message-ID: <20160208153443.GC2343@linux.intel.com> X-ASG-Orig-Subj: Re: [PATCH 1/2] dax: pass bdev argument to dax_clear_blocks() Mail-Followup-To: Ross Zwisler , Dave Chinner , linux-kernel@vger.kernel.org, Theodore Ts'o , Alexander Viro , Andreas Dilger , Andrew Morton , Dan Williams , Jan Kara , Matthew Wilcox , linux-ext4@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux-mm@kvack.org, linux-nvdimm@lists.01.org, xfs@oss.sgi.com References: <1454829553-29499-1-git-send-email-ross.zwisler@linux.intel.com> <1454829553-29499-2-git-send-email-ross.zwisler@linux.intel.com> <20160207220329.GK31407@dastard> <20160208014409.GA2343@linux.intel.com> <20160208051725.GM31407@dastard> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20160208051725.GM31407@dastard> User-Agent: Mutt/1.5.24 (2015-08-30) X-Barracuda-Connect: mga02.intel.com[134.134.136.20] X-Barracuda-Start-Time: 1454945693 X-Barracuda-URL: https://192.48.157.11:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-BRTS-Status: 1 On Mon, Feb 08, 2016 at 04:17:25PM +1100, Dave Chinner wrote: > On Sun, Feb 07, 2016 at 06:44:09PM -0700, Ross Zwisler wrote: > > On Mon, Feb 08, 2016 at 09:03:29AM +1100, Dave Chinner wrote: > > > On Sun, Feb 07, 2016 at 12:19:12AM -0700, Ross Zwisler wrote: > > > > dax_clear_blocks() needs a valid struct block_device and previously it was > > > > using inode->i_sb->s_bdev in all cases. This is correct for normal inodes > > > > on mounted ext2, ext4 and XFS filesystems, but is incorrect for DAX raw > > > > block devices and for XFS real-time devices. > > > > > > > > Instead, have the caller pass in a struct block_device pointer which it > > > > knows to be correct. > > > .... > > > > diff --git a/fs/xfs/xfs_bmap_util.c b/fs/xfs/xfs_bmap_util.c > > > > index 07ef29b..f722ba2 100644 > > > > --- a/fs/xfs/xfs_bmap_util.c > > > > +++ b/fs/xfs/xfs_bmap_util.c > > > > @@ -73,9 +73,11 @@ xfs_zero_extent( > > > > xfs_daddr_t sector = xfs_fsb_to_db(ip, start_fsb); > > > > sector_t block = XFS_BB_TO_FSBT(mp, sector); > > > > ssize_t size = XFS_FSB_TO_B(mp, count_fsb); > > > > + struct inode *inode = VFS_I(ip); > > > > > > > > if (IS_DAX(VFS_I(ip))) > > > > - return dax_clear_blocks(VFS_I(ip), block, size); > > > > + return dax_clear_blocks(inode, xfs_find_bdev_for_inode(inode), > > > > + block, size); > > > > > > Get rid of the local inode variable and use VFS_I(ip) like the code > > > originally did. Do not change code that is unrelated to the > > > modifcation being made, especially when it results in making > > > the code an inconsistent mess of mixed pointer constructs.... > > > > The local 'inode' variable was added to avoid multiple calls for VFS_I() for > > the same 'ip'. > > My point is you didn't achieve that. The end result of your patch > is: > > struct inode *inode = VFS_I(ip); > > if (IS_DAX(VFS_I(ip))) > return dax_clear_blocks(inode, xfs_find_bdev_for_inode(inode), > block, size); > > So now we have a local variable, but we still have 2 calls to > VFS_I(ip). i.e. this makes the code harder to read and understand > than before for no benefit. *facepalm* Yep, thanks for the correction. From bfoster@redhat.com Mon Feb 8 09:37:24 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=ham version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay2.corp.sgi.com [137.38.102.29]) by oss.sgi.com (Postfix) with ESMTP id 2F1BA29DF5 for ; Mon, 8 Feb 2016 09:37:24 -0600 (CST) Received: from cuda.sgi.com (cuda2.sgi.com [192.48.176.25]) by relay2.corp.sgi.com (Postfix) with ESMTP id E72B8304051 for ; Mon, 8 Feb 2016 07:37:23 -0800 (PST) X-ASG-Debug-ID: 1454945842-04cbb04cfa166bb0001-NocioJ Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by cuda.sgi.com with ESMTP id wb8pEmfpmPuWQ0iS (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO) for ; Mon, 08 Feb 2016 07:37:22 -0800 (PST) X-Barracuda-Envelope-From: bfoster@redhat.com X-Barracuda-Apparent-Source-IP: 209.132.183.28 X-ASG-Whitelist: Client Received: from int-mx11.intmail.prod.int.phx2.redhat.com (int-mx11.intmail.prod.int.phx2.redhat.com [10.5.11.24]) by mx1.redhat.com (Postfix) with ESMTPS id 4B6423B718; Mon, 8 Feb 2016 15:37:22 +0000 (UTC) Received: from bfoster.bfoster (dhcp-41-164.bos.redhat.com [10.18.41.164]) by int-mx11.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id u18FbLUL000903; Mon, 8 Feb 2016 10:37:22 -0500 Received: by bfoster.bfoster (Postfix, from userid 1000) id D60D5123DF8; Mon, 8 Feb 2016 10:37:20 -0500 (EST) Date: Mon, 8 Feb 2016 10:37:20 -0500 From: Brian Foster To: Dave Chinner Cc: xfs@oss.sgi.com Subject: Re: [ANNOUNCE] xfs: for-next branch updated to 4a91310 Message-ID: <20160208153720.GG19597@bfoster.bfoster> X-ASG-Orig-Subj: Re: [ANNOUNCE] xfs: for-next branch updated to 4a91310 References: <20160208060751.GA27429@dastard> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20160208060751.GA27429@dastard> User-Agent: Mutt/1.5.24 (2015-08-30) X-Scanned-By: MIMEDefang 2.68 on 10.5.11.24 X-Barracuda-Connect: mx1.redhat.com[209.132.183.28] X-Barracuda-Start-Time: 1454945842 X-Barracuda-Encrypted: ECDHE-RSA-AES256-GCM-SHA384 X-Barracuda-URL: https://192.48.176.25:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-BRTS-Status: 1 On Mon, Feb 08, 2016 at 05:07:51PM +1100, Dave Chinner wrote: > Hi folks, > > The for-next branch of the xfs kernel repository at > > git://git.kernel.org/pub/scm/linux/kernel/git/dgc/linux-xfs.git > > has just been updated. I've pushed this out with both generic quota > and direct Io modifications in it, so if they end up going into > another tree expect a rebase of the for-next branch to occur to pull > them in from the appropriate trees. > > There is still a lot of changes pending review to go into this > for-next tree, and I'm hoping to get the first part of the > rmap/reflink work into it as well, so there's plenty of work still > to be done in this cycle.... > > The new head of the for-next branch is commit: > > 4a91310 Merge branch 'xfs-misc-fixes-4.6' into for-next > > New Commits: > > Brian Foster (2): > [60630fe] xfs: clean up unwritten buffers on write failure > [af055e3] xfs: fix xfs_log_ticket leak in xfs_end_io() after fs shutdown > > Carlos Maiolino (1): > [be60794] xfs: Split default quota limits by quota type > > Christoph Hellwig (6): > [187372a] direct-io: always call ->end_io if non-NULL > [273dda7] xfs: don't use ioends for direct write completions > [c19b104] xfs: fold xfs_vm_do_dio into xfs_vm_direct_IO > [196328e] xfs: handle errors from ->free_blocks in xfs_btree_kill_iroot > [c46ee8a] xfs: factor btree block freeing into a helper > [edfd9dd] xfs: move buffer invalidation to xfs_btree_free_block > > Darrick J. Wong (2): > [8e0bd49] xfs: fix endianness error when checking log block crc on big endian platforms > [244efea] xfs: move struct xfs_attr_shortform to xfs_da_format.h > > Dave Chinner (7): > [4b680af] xfs: lock rt summary inode on allocation > [a204d07] xfs: RT bitmap and summary buffers are not typed > [ca4de5c] xfs: RT bitmap and summary buffers need verifiers FYI, this one ^ leads to compile failures when CONFIG_XFS_RT is not enabled. xfs_rtbuf_ops is defined in the conditionally compiled xfs_rtbitmap.c file and used unconditionally in xfs_log_recover.c. Brian > [e892a10] Merge branch 'xfs-rt-fixes-4.6' into for-next > [ec370f5] Merge branch 'xfs-get-next-dquot-4.6' into for-next > [0d077b8] Merge branch 'xfs-dio-fix-4.6' into for-next > [4a91310] Merge branch 'xfs-misc-fixes-4.6' into for-next > > Eric Sandeen (8): > [3218a3e] quota: remove unused cmd argument from quota_quotaon() > [8b37524] quota: add new quotactl Q_XGETNEXTQUOTA > [926132c] quota: add new quotactl Q_GETNEXTQUOTA > [a484bcd] xfs: don't overflow quota ID when initializing dqblk > [4d4d952] xfs: get quota inode from mp & flags rather than dqp > [8aa7d37] xfs: Factor xfs_seek_hole_data into helper > [296c24e] xfs: wire up Q_XGETNEXTQUOTA / get_nextdqblk > [de0b85a] xfs: remove unused function definitions > > Michal Hocko (1): > [18f1df4] xfs: Make xfsaild freezeable again > > > Code Diffstat: > > fs/dax.c | 9 +- > fs/direct-io.c | 9 +- > fs/ext4/inode.c | 9 +- > fs/ocfs2/aops.c | 7 +- > fs/quota/quota.c | 66 +++++++++- > fs/xfs/libxfs/xfs_alloc_btree.c | 2 - > fs/xfs/libxfs/xfs_attr_sf.h | 16 --- > fs/xfs/libxfs/xfs_bmap_btree.c | 1 - > fs/xfs/libxfs/xfs_btree.c | 32 +++-- > fs/xfs/libxfs/xfs_da_format.h | 16 +++ > fs/xfs/libxfs/xfs_ialloc_btree.c | 12 +- > fs/xfs/libxfs/xfs_inode_fork.c | 1 + > fs/xfs/libxfs/xfs_log_format.h | 2 + > fs/xfs/libxfs/xfs_quota_defs.h | 3 +- > fs/xfs/libxfs/xfs_rtbitmap.c | 30 ++++- > fs/xfs/libxfs/xfs_sb.h | 1 - > fs/xfs/libxfs/xfs_shared.h | 1 + > fs/xfs/xfs_aops.c | 274 +++++++++++++++------------------------ > fs/xfs/xfs_bmap_util.c | 4 +- > fs/xfs/xfs_dquot.c | 129 +++++++++++++++--- > fs/xfs/xfs_file.c | 82 ++++++++---- > fs/xfs/xfs_fsops.h | 1 - > fs/xfs/xfs_inode.h | 2 + > fs/xfs/xfs_log_recover.c | 9 +- > fs/xfs/xfs_mount.h | 1 - > fs/xfs/xfs_qm.c | 55 ++++++-- > fs/xfs/xfs_qm.h | 48 +++++-- > fs/xfs/xfs_qm_syscalls.c | 27 ++-- > fs/xfs/xfs_quotaops.c | 36 ++++- > fs/xfs/xfs_trace.h | 9 +- > fs/xfs/xfs_trans_ail.c | 5 +- > fs/xfs/xfs_trans_dquot.c | 15 ++- > include/linux/fs.h | 2 +- > include/linux/quota.h | 2 + > include/uapi/linux/dqblk_xfs.h | 1 + > include/uapi/linux/quota.h | 14 ++ > 36 files changed, 615 insertions(+), 318 deletions(-) > -- > Dave Chinner > david@fromorbit.com > > _______________________________________________ > xfs mailing list > xfs@oss.sgi.com > http://oss.sgi.com/mailman/listinfo/xfs From ross.zwisler@linux.intel.com Mon Feb 8 10:12:50 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=ham version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay2.corp.sgi.com [137.38.102.29]) by oss.sgi.com (Postfix) with ESMTP id E9AFD29DF5 for ; Mon, 8 Feb 2016 10:12:50 -0600 (CST) Received: from cuda.sgi.com (cuda2.sgi.com [192.48.176.25]) by relay2.corp.sgi.com (Postfix) with ESMTP id D9057304043 for ; Mon, 8 Feb 2016 08:12:47 -0800 (PST) X-ASG-Debug-ID: 1454947966-04cbb04cf91688e0001-NocioJ Received: from mga03.intel.com (mga03.intel.com [134.134.136.65]) by cuda.sgi.com with ESMTP id kxdC56C2d9zUYT6f for ; Mon, 08 Feb 2016 08:12:46 -0800 (PST) X-Barracuda-Envelope-From: ross.zwisler@linux.intel.com X-Barracuda-Apparent-Source-IP: 134.134.136.65 X-ASG-Whitelist: Client Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by orsmga103.jf.intel.com with ESMTP; 08 Feb 2016 08:12:21 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.22,416,1449561600"; d="scan'208";a="649041833" Received: from rzwisler-desk.amr.corp.intel.com (HELO linux.intel.com) ([10.254.103.197]) by FMSMGA003.fm.intel.com with ESMTP; 08 Feb 2016 08:12:20 -0800 Date: Mon, 8 Feb 2016 09:12:11 -0700 From: Ross Zwisler To: Jan Kara Cc: Ross Zwisler , linux-kernel@vger.kernel.org, Theodore Ts'o , Alexander Viro , Andreas Dilger , Andrew Morton , Dan Williams , Dave Chinner , Jan Kara , Matthew Wilcox , linux-ext4@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux-mm@kvack.org, linux-nvdimm@lists.01.org, xfs@oss.sgi.com Subject: Re: [PATCH 2/2] dax: move writeback calls into the filesystems Message-ID: <20160208161211.GE2343@linux.intel.com> X-ASG-Orig-Subj: Re: [PATCH 2/2] dax: move writeback calls into the filesystems Mail-Followup-To: Ross Zwisler , Jan Kara , linux-kernel@vger.kernel.org, Theodore Ts'o , Alexander Viro , Andreas Dilger , Andrew Morton , Dan Williams , Dave Chinner , Jan Kara , Matthew Wilcox , linux-ext4@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux-mm@kvack.org, linux-nvdimm@lists.01.org, xfs@oss.sgi.com References: <1454829553-29499-1-git-send-email-ross.zwisler@linux.intel.com> <1454829553-29499-3-git-send-email-ross.zwisler@linux.intel.com> <20160208104849.GB9451@quack.suse.cz> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20160208104849.GB9451@quack.suse.cz> User-Agent: Mutt/1.5.24 (2015-08-30) X-Barracuda-Connect: mga03.intel.com[134.134.136.65] X-Barracuda-Start-Time: 1454947966 X-Barracuda-URL: https://192.48.176.25:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-BRTS-Status: 1 On Mon, Feb 08, 2016 at 11:48:50AM +0100, Jan Kara wrote: > On Sun 07-02-16 00:19:13, Ross Zwisler wrote: > > Previously calls to dax_writeback_mapping_range() for all DAX filesystems > > (ext2, ext4 & xfs) were centralized in filemap_write_and_wait_range(). > > dax_writeback_mapping_range() needs a struct block_device, and it used to > > get that from inode->i_sb->s_bdev. This is correct for normal inodes > > mounted on ext2, ext4 and XFS filesystems, but is incorrect for DAX raw > > block devices and for XFS real-time files. > > > > Instead, call dax_writeback_mapping_range() directly from the filesystem or > > raw block device fsync/msync code so that they can supply us with a valid > > block device. > > > > It should be noted that this will reduce the number of calls to > > dax_writeback_mapping_range() because filemap_write_and_wait_range() is > > called in the various filesystems for operations other than just > > fsync/msync. Both ext4 & XFS call filemap_write_and_wait_range() outside > > of ->fsync for hole punch, truncate, and block relocation > > (xfs_shift_file_space() && ext4_collapse_range()/ext4_insert_range()). > > > > I don't believe that these extra flushes are necessary in the DAX case. In > > the page cache case when we have dirty data in the page cache, that data > > will be actively lost if we evict a dirty page cache page without flushing > > it to media first. For DAX, though, the data will remain consistent with > > the physical address to which it was written regardless of whether it's in > > the processor cache or not - really the only reason I see to flush is in > > response to a fsync or msync so that our data is durable on media in case > > of a power loss. The case where we could throw dirty data out of the page > > cache and essentially lose writes simply doesn't exist. > > You should at least note that sync(2) won't make data durable with this > patch in the changelog. Dave and Christoph have told you that Linux users > depend on sync(2) to make data durable and I fully agree with them. Given > current options, I think we can live with this for 4.5 but long term this > is IMO unacceptable. > > Honza I agree. I'll add a note to the changelog and will work on adding support for sync(2). > > > > Signed-off-by: Ross Zwisler > > --- > > fs/block_dev.c | 7 +++++++ > > fs/dax.c | 5 ++--- > > fs/ext2/file.c | 10 ++++++++++ > > fs/ext4/fsync.c | 10 +++++++++- > > fs/xfs/xfs_file.c | 12 ++++++++++-- > > include/linux/dax.h | 4 ++-- > > mm/filemap.c | 6 ------ > > 7 files changed, 40 insertions(+), 14 deletions(-) > > > > diff --git a/fs/block_dev.c b/fs/block_dev.c > > index fa0507a..312ad44 100644 > > --- a/fs/block_dev.c > > +++ b/fs/block_dev.c > > @@ -356,8 +356,15 @@ int blkdev_fsync(struct file *filp, loff_t start, loff_t end, int datasync) > > { > > struct inode *bd_inode = bdev_file_inode(filp); > > struct block_device *bdev = I_BDEV(bd_inode); > > + struct address_space *mapping = bd_inode->i_mapping; > > int error; > > > > + if (dax_mapping(mapping) && mapping->nrexceptional) { > > + error = dax_writeback_mapping_range(mapping, bdev, start, end); > > + if (error) > > + return error; > > + } > > + > > error = filemap_write_and_wait_range(filp->f_mapping, start, end); > > if (error) > > return error; > > diff --git a/fs/dax.c b/fs/dax.c > > index 4592241..4b5006a 100644 > > --- a/fs/dax.c > > +++ b/fs/dax.c > > @@ -484,11 +484,10 @@ static int dax_writeback_one(struct block_device *bdev, > > * end]. This is required by data integrity operations to ensure file data is > > * on persistent storage prior to completion of the operation. > > */ > > -int dax_writeback_mapping_range(struct address_space *mapping, loff_t start, > > - loff_t end) > > +int dax_writeback_mapping_range(struct address_space *mapping, > > + struct block_device *bdev, loff_t start, loff_t end) > > { > > struct inode *inode = mapping->host; > > - struct block_device *bdev = inode->i_sb->s_bdev; > > pgoff_t start_index, end_index, pmd_index; > > pgoff_t indices[PAGEVEC_SIZE]; > > struct pagevec pvec; > > diff --git a/fs/ext2/file.c b/fs/ext2/file.c > > index 2c88d68..d1abf53 100644 > > --- a/fs/ext2/file.c > > +++ b/fs/ext2/file.c > > @@ -162,6 +162,16 @@ int ext2_fsync(struct file *file, loff_t start, loff_t end, int datasync) > > int ret; > > struct super_block *sb = file->f_mapping->host->i_sb; > > struct address_space *mapping = sb->s_bdev->bd_inode->i_mapping; > > +#ifdef CONFIG_FS_DAX > > + struct address_space *inode_mapping = file->f_inode->i_mapping; > > + > > + if (dax_mapping(inode_mapping) && inode_mapping->nrexceptional) { > > + ret = dax_writeback_mapping_range(inode_mapping, sb->s_bdev, > > + start, end); > > + if (ret) > > + return ret; > > + } > > +#endif > > > > ret = generic_file_fsync(file, start, end, datasync); > > if (ret == -EIO || test_and_clear_bit(AS_EIO, &mapping->flags)) { > > diff --git a/fs/ext4/fsync.c b/fs/ext4/fsync.c > > index 8850254..e9cf53b 100644 > > --- a/fs/ext4/fsync.c > > +++ b/fs/ext4/fsync.c > > @@ -27,6 +27,7 @@ > > #include > > #include > > #include > > +#include > > > > #include "ext4.h" > > #include "ext4_jbd2.h" > > @@ -83,10 +84,10 @@ static int ext4_sync_parent(struct inode *inode) > > * What we do is just kick off a commit and wait on it. This will snapshot the > > * inode to disk. > > */ > > - > > int ext4_sync_file(struct file *file, loff_t start, loff_t end, int datasync) > > { > > struct inode *inode = file->f_mapping->host; > > + struct address_space *mapping = inode->i_mapping; > > struct ext4_inode_info *ei = EXT4_I(inode); > > journal_t *journal = EXT4_SB(inode->i_sb)->s_journal; > > int ret = 0, err; > > @@ -97,6 +98,13 @@ int ext4_sync_file(struct file *file, loff_t start, loff_t end, int datasync) > > > > trace_ext4_sync_file_enter(file, datasync); > > > > + if (dax_mapping(mapping) && mapping->nrexceptional) { > > + err = dax_writeback_mapping_range(mapping, inode->i_sb->s_bdev, > > + start, end); > > + if (err) > > + goto out; > > + } > > + > > if (inode->i_sb->s_flags & MS_RDONLY) { > > /* Make sure that we read updated s_mount_flags value */ > > smp_rmb(); > > diff --git a/fs/xfs/xfs_file.c b/fs/xfs/xfs_file.c > > index 52883ac..84e95cc 100644 > > --- a/fs/xfs/xfs_file.c > > +++ b/fs/xfs/xfs_file.c > > @@ -209,7 +209,8 @@ xfs_file_fsync( > > loff_t end, > > int datasync) > > { > > - struct inode *inode = file->f_mapping->host; > > + struct address_space *mapping = file->f_mapping; > > + struct inode *inode = mapping->host; > > struct xfs_inode *ip = XFS_I(inode); > > struct xfs_mount *mp = ip->i_mount; > > int error = 0; > > @@ -218,7 +219,14 @@ xfs_file_fsync( > > > > trace_xfs_file_fsync(ip); > > > > - error = filemap_write_and_wait_range(inode->i_mapping, start, end); > > + if (dax_mapping(mapping) && mapping->nrexceptional) { > > + error = dax_writeback_mapping_range(mapping, > > + xfs_find_bdev_for_inode(inode), start, end); > > + if (error) > > + return error; > > + } > > + > > + error = filemap_write_and_wait_range(mapping, start, end); > > if (error) > > return error; > > > > diff --git a/include/linux/dax.h b/include/linux/dax.h > > index bad27b0..8e9f114 100644 > > --- a/include/linux/dax.h > > +++ b/include/linux/dax.h > > @@ -42,6 +42,6 @@ static inline bool dax_mapping(struct address_space *mapping) > > { > > return mapping->host && IS_DAX(mapping->host); > > } > > -int dax_writeback_mapping_range(struct address_space *mapping, loff_t start, > > - loff_t end); > > +int dax_writeback_mapping_range(struct address_space *mapping, > > + struct block_device *bdev, loff_t start, loff_t end); > > #endif > > diff --git a/mm/filemap.c b/mm/filemap.c > > index bc94386..c4286eb 100644 > > --- a/mm/filemap.c > > +++ b/mm/filemap.c > > @@ -482,12 +482,6 @@ int filemap_write_and_wait_range(struct address_space *mapping, > > { > > int err = 0; > > > > - if (dax_mapping(mapping) && mapping->nrexceptional) { > > - err = dax_writeback_mapping_range(mapping, lstart, lend); > > - if (err) > > - return err; > > - } > > - > > if (mapping->nrpages) { > > err = __filemap_fdatawrite_range(mapping, lstart, lend, > > WB_SYNC_ALL); > > -- > > 2.5.0 > > > > > -- > Jan Kara > SUSE Labs, CR From ross.zwisler@linux.intel.com Mon Feb 8 12:31:30 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=ham version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay3.corp.sgi.com [198.149.34.15]) by oss.sgi.com (Postfix) with ESMTP id C7FAF7CA2 for ; Mon, 8 Feb 2016 12:31:30 -0600 (CST) Received: from cuda.sgi.com (cuda3.sgi.com [192.48.176.15]) by relay3.corp.sgi.com (Postfix) with ESMTP id 43F49AC003 for ; Mon, 8 Feb 2016 10:31:30 -0800 (PST) X-ASG-Debug-ID: 1454956288-04cb6c274518dc70001-NocioJ Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) by cuda.sgi.com with ESMTP id IAv8Ku4ga4L2pNle for ; Mon, 08 Feb 2016 10:31:29 -0800 (PST) X-Barracuda-Envelope-From: ross.zwisler@linux.intel.com X-Barracuda-Apparent-Source-IP: 134.134.136.20 X-ASG-Whitelist: Client Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by orsmga101.jf.intel.com with ESMTP; 08 Feb 2016 10:31:26 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.22,417,1449561600"; d="scan'208";a="911007210" Received: from rzwisler-desk.amr.corp.intel.com (HELO linux.intel.com) ([10.254.103.197]) by fmsmga002.fm.intel.com with ESMTP; 08 Feb 2016 10:31:24 -0800 Date: Mon, 8 Feb 2016 11:31:12 -0700 From: Ross Zwisler To: Dan Williams Cc: Ross Zwisler , "linux-kernel@vger.kernel.org" , Theodore Ts'o , Alexander Viro , Andreas Dilger , Andrew Morton , Dave Chinner , Jan Kara , Matthew Wilcox , linux-ext4 , linux-fsdevel , Linux MM , "linux-nvdimm@lists.01.org" , XFS Developers , jmoyer Subject: Re: [PATCH 2/2] dax: move writeback calls into the filesystems Message-ID: <20160208183112.GF2343@linux.intel.com> X-ASG-Orig-Subj: Re: [PATCH 2/2] dax: move writeback calls into the filesystems Mail-Followup-To: Ross Zwisler , Dan Williams , "linux-kernel@vger.kernel.org" , Theodore Ts'o , Alexander Viro , Andreas Dilger , Andrew Morton , Dave Chinner , Jan Kara , Matthew Wilcox , linux-ext4 , linux-fsdevel , Linux MM , "linux-nvdimm@lists.01.org" , XFS Developers , jmoyer References: <1454829553-29499-1-git-send-email-ross.zwisler@linux.intel.com> <1454829553-29499-3-git-send-email-ross.zwisler@linux.intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.24 (2015-08-30) X-Barracuda-Connect: mga02.intel.com[134.134.136.20] X-Barracuda-Start-Time: 1454956288 X-Barracuda-URL: https://192.48.176.15:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-BRTS-Status: 1 On Sun, Feb 07, 2016 at 11:13:51AM -0800, Dan Williams wrote: > The proposal: make applications explicitly request DAX semantics with > a new MAP_DAX flag and fail if DAX is unavailable. Document that a > successful MAP_DAX request mandates that the application assumes > responsibility for cpu cache management. > Require that all applications that mmap the file agree on MAP_DAX. I think this proposal could run into issues with aliasing. For example, say you have two threads accessing the same region, and one wants to use DAX and the other wants to use the page cache. What happens? If we satisfy both requests, we end up with one user reading and writing to the page cache, while the other is reading and writing directly to the media. They can't see each other's changes, and you get data corruption. If we satisfy the request of whoever asked first, sort of lock the inode into that mode, and then return an error to the second thread because they are asking for the other mode, we have now introduced a new weird failure case where mmaps can randomly fail based on the behavior of other applications. I think this is where you were going with the last line quoted above, but I don't understand how it would work in an acceptable way. It seems like we have to have the decision about whether or not to use DAX made in the same way for all users of the inode so that we don't run into these types of conflicts. > This also solves > the future problem of DAX support on virtually tagged cache > architectures where it is difficult for the kernel to know what alias > addresses need flushing. > > [1]: https://github.com/pmem/nvml From dan.j.williams@intel.com Mon Feb 8 13:24:04 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=T_DKIM_INVALID autolearn=ham version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay3.corp.sgi.com [198.149.34.15]) by oss.sgi.com (Postfix) with ESMTP id 4B1AE7CA2 for ; Mon, 8 Feb 2016 13:24:04 -0600 (CST) Received: from cuda.sgi.com (cuda1.sgi.com [192.48.157.11]) by relay3.corp.sgi.com (Postfix) with ESMTP id E0B87AC003 for ; Mon, 8 Feb 2016 11:24:00 -0800 (PST) X-ASG-Debug-ID: 1454959438-04bdf079c5154330001-NocioJ Received: from mail-yw0-f181.google.com (mail-yw0-f181.google.com [209.85.161.181]) by cuda.sgi.com with ESMTP id 8mb44bIsBi7Zzqpl (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128 verify=NO) for ; Mon, 08 Feb 2016 11:23:58 -0800 (PST) X-Barracuda-Envelope-From: dan.j.williams@intel.com X-Barracuda-Apparent-Source-IP: 209.85.161.181 Received: by mail-yw0-f181.google.com with SMTP id h129so110048181ywb.1 for ; Mon, 08 Feb 2016 11:23:58 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=intel-com.20150623.gappssmtp.com; s=20150623; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; bh=vg0IOd4efXsYw1Vv/lHCXsITJoAnry9zq/+I4CYZpE0=; b=WLQLjmLsQP+RnJ8kwyAG0S7FvjN61qi4mBHDS5Cynoc0upDZEAzce00oA+mTg/PLVj IQrzHLJmzUcMe7qbQTyJS6Vh93BaWtvo4KHenpEJeDI42bKi63B9GBnoNJKXgBOS+U1Y LnY5+/Y9rVmwRtEdJSszvsest+qa5/hwMbqGolZ3li/n69BKOv/gToOXmVbTYn0I5j5Y hv57WiZ98Dt4fOqw1iHogjvmtXsOFbo9xFLF5LdKBm/bmqwFITOMp+aHe1fUMXPzcicx oBeExOYwJBm6M8sSs8lD32V3hJ6Zo6RQnNFqWi2BtgwqL1bWKLo0FyuDh2c86Lpa4ii0 GfNw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:date :message-id:subject:from:to:content-type; bh=vg0IOd4efXsYw1Vv/lHCXsITJoAnry9zq/+I4CYZpE0=; b=CEUq4So2GimImGAk4Alc78diu5bP4SFjjILMZRHxreyXW53XKPdwG0zIVV6BVGyjXB JSngpRVEZqTe0AtMyPKCWXWiClZWxVed+K64y2FBD4s5uOEBzyyCI2y8XeZ23jBXXoqt bHSyOvUJqh9AgjLD6LQPxJLevHPZCxzdtJuL3TwwEEJu8ulCQRv/CuSKACm3KNlM8ZAl fbMWNV2VqIStEKLwaEKMj1cgp2SjnZpCvSqllgUs19NDkIdCLMN8JBc/pAOe8I3avu6J b8owdIphbGOE23TJN3mFXMleuus2yIMxsZMtrgSPOikLLKh3tnszCbEkg/pZUQHkOUuN aX7w== X-Gm-Message-State: AG10YORlbiJuW+WSR/uJPWoh1CkyozRuzURZQVPqJfqir3QoBMEc8pl4Wgm1NZw30DpXO1ED1pfMw18OIPizESgr MIME-Version: 1.0 X-Received: by 10.129.103.134 with SMTP id b128mr15451915ywc.287.1454959437114; Mon, 08 Feb 2016 11:23:57 -0800 (PST) Received: by 10.37.223.199 with HTTP; Mon, 8 Feb 2016 11:23:56 -0800 (PST) In-Reply-To: <20160208183112.GF2343@linux.intel.com> References: <1454829553-29499-1-git-send-email-ross.zwisler@linux.intel.com> <1454829553-29499-3-git-send-email-ross.zwisler@linux.intel.com> <20160208183112.GF2343@linux.intel.com> Date: Mon, 8 Feb 2016 11:23:56 -0800 Message-ID: Subject: Re: [PATCH 2/2] dax: move writeback calls into the filesystems From: Dan Williams X-ASG-Orig-Subj: Re: [PATCH 2/2] dax: move writeback calls into the filesystems To: Ross Zwisler , Dan Williams , "linux-kernel@vger.kernel.org" , "Theodore Ts'o" , Alexander Viro , Andreas Dilger , Andrew Morton , Dave Chinner , Jan Kara , Matthew Wilcox , linux-ext4 , linux-fsdevel , Linux MM , "linux-nvdimm@lists.01.org" , XFS Developers , jmoyer Content-Type: text/plain; charset=UTF-8 X-Barracuda-Connect: mail-yw0-f181.google.com[209.85.161.181] X-Barracuda-Start-Time: 1454959438 X-Barracuda-Encrypted: ECDHE-RSA-AES128-GCM-SHA256 X-Barracuda-URL: https://192.48.157.11:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-BRTS-Status: 1 X-Barracuda-Spam-Score: 0.00 X-Barracuda-Spam-Status: No, SCORE=0.00 using per-user scores of TAG_LEVEL=1000.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.7 tests=BSF_SC0_MISMATCH_TO, DKIM_SIGNED, DKIM_VERIFIED X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.3.26864 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 0.00 BSF_SC0_MISMATCH_TO Envelope rcpt doesn't match header -0.00 DKIM_VERIFIED Domain Keys Identified Mail: signature passes verification 0.00 DKIM_SIGNED Domain Keys Identified Mail: message has a signature On Mon, Feb 8, 2016 at 10:31 AM, Ross Zwisler wrote: > On Sun, Feb 07, 2016 at 11:13:51AM -0800, Dan Williams wrote: >> The proposal: make applications explicitly request DAX semantics with >> a new MAP_DAX flag and fail if DAX is unavailable. Document that a >> successful MAP_DAX request mandates that the application assumes >> responsibility for cpu cache management. > >> Require that all applications that mmap the file agree on MAP_DAX. > > I think this proposal could run into issues with aliasing. For example, say > you have two threads accessing the same region, and one wants to use DAX and > the other wants to use the page cache. What happens? > > If we satisfy both requests, we end up with one user reading and writing to > the page cache, while the other is reading and writing directly to the media. > They can't see each other's changes, and you get data corruption. > > If we satisfy the request of whoever asked first, sort of lock the inode into > that mode, and then return an error to the second thread because they are > asking for the other mode, we have now introduced a new weird failure case > where mmaps can randomly fail based on the behavior of other applications. > I think this is where you were going with the last line quoted above, but I > don't understand how it would work in an acceptable way. > > It seems like we have to have the decision about whether or not to use DAX > made in the same way for all users of the inode so that we don't run into > these types of conflicts. We haven't solved the conflict problem by pushing it out to the inode, see the recent revert of blkdev_daxset(). We're heading in a direction where an application can't develop it's own policies about DAX usage, it's always an administrative decision. However, maybe that is ok. Dave is right that if an application is using an existing filesystem it should get all the existing semantics. If the existing semantics (or overhead of maintaining the existing semantics) turn out not to fit a given pmem-aware application then we may just need new interfaces (separate from fs/dax.c) to persistent memory. I admit we're a ways off from knowing if that is needed. From david@fromorbit.com Mon Feb 8 13:28:31 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=ham version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay1.corp.sgi.com [137.38.102.111]) by oss.sgi.com (Postfix) with ESMTP id 9594B7CA2 for ; Mon, 8 Feb 2016 13:28:31 -0600 (CST) Received: from cuda.sgi.com (cuda3.sgi.com [192.48.176.15]) by relay1.corp.sgi.com (Postfix) with ESMTP id 7DC748F8049 for ; Mon, 8 Feb 2016 11:28:28 -0800 (PST) X-ASG-Debug-ID: 1454959705-04cb6c2746191f50001-NocioJ Received: from ipmail06.adl2.internode.on.net (ipmail06.adl2.internode.on.net [150.101.137.129]) by cuda.sgi.com with ESMTP id xGA2G7EtB0x2Haaa for ; Mon, 08 Feb 2016 11:28:26 -0800 (PST) X-Barracuda-Envelope-From: david@fromorbit.com X-Barracuda-Apparent-Source-IP: 150.101.137.129 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: A2CCCAAn67hWPBATLHleKAECgw+BP4ZjgXidSwaLZoVEhAeGBwICAQECgS5NAQEBAQEBBwEBAQFBP4RCAQEEOhwjEAgDDgoJJQ8FJQMHGhOIGr1zAQEBBwIBHRiFMoR/h12BDwWWdY1HgWSNGIpsg1KEWiguiFMBAQE Received: from ppp121-44-19-16.lns20.syd4.internode.on.net (HELO dastard) ([121.44.19.16]) by ipmail06.adl2.internode.on.net with ESMTP; 09 Feb 2016 05:58:24 +1030 Received: from dave by dastard with local (Exim 4.80) (envelope-from ) id 1aSrTz-0000c1-Pd; Tue, 09 Feb 2016 06:28:23 +1100 Date: Tue, 9 Feb 2016 06:28:23 +1100 From: Dave Chinner To: Christoph Hellwig Cc: xfs@oss.sgi.com Subject: Re: [PATCH 1/9] xfs: introduce inode log format object Message-ID: <20160208192823.GE27429@dastard> X-ASG-Orig-Subj: Re: [PATCH 1/9] xfs: introduce inode log format object References: <1454905461-2773-1-git-send-email-david@fromorbit.com> <1454905461-2773-2-git-send-email-david@fromorbit.com> <20160208092318.GA28146@infradead.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20160208092318.GA28146@infradead.org> User-Agent: Mutt/1.5.21 (2010-09-15) X-Barracuda-Connect: ipmail06.adl2.internode.on.net[150.101.137.129] X-Barracuda-Start-Time: 1454959705 X-Barracuda-URL: https://192.48.176.15:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-BRTS-Status: 1 X-Barracuda-Spam-Score: 0.00 X-Barracuda-Spam-Status: No, SCORE=0.00 using per-user scores of TAG_LEVEL=1000.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.7 tests=BSF_SC0_MISMATCH_TO X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.3.26863 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 0.00 BSF_SC0_MISMATCH_TO Envelope rcpt doesn't match header On Mon, Feb 08, 2016 at 01:23:18AM -0800, Christoph Hellwig wrote: > This looks fine in general: > > Reviewed-by: Christoph Hellwig > > But: this now introduce struct inode to libxfs code, what's your plan > to deal with that in xfsprogs? The struct xfs_inode is already unique between user and kernel space, so I was simply going to define all the new fields directly inside the struct xfs_inode and: #define VFS_I(ip) (ip) Or If I can't get that to work without somehow defining a struct inode, then put all the fields in a struct inode private to the struct xfs_inode and just do the same conversion as the kernel. Cheers, Dave. -- Dave Chinner david@fromorbit.com From david@fromorbit.com Mon Feb 8 13:44:23 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=ham version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay1.corp.sgi.com [137.38.102.111]) by oss.sgi.com (Postfix) with ESMTP id DB79A7CA2 for ; Mon, 8 Feb 2016 13:44:23 -0600 (CST) Received: from cuda.sgi.com (cuda1.sgi.com [192.48.157.11]) by relay1.corp.sgi.com (Postfix) with ESMTP id C24108F8035 for ; Mon, 8 Feb 2016 11:44:23 -0800 (PST) X-ASG-Debug-ID: 1454960659-04bdf079c5155090001-NocioJ Received: from ipmail06.adl2.internode.on.net (ipmail06.adl2.internode.on.net [150.101.137.129]) by cuda.sgi.com with ESMTP id RJIG5Mqu53jhwSUt for ; Mon, 08 Feb 2016 11:44:20 -0800 (PST) X-Barracuda-Envelope-From: david@fromorbit.com X-Barracuda-Apparent-Source-IP: 150.101.137.129 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: A2CCCABl7rhWPBATLHleKAECgw+BP4ZjgXidSwaLZoVEhAeGBwICAQECgS5NAQEBAQEBBwEBAQFBP4RCAQEEOhwjEAgDDgoJJQ8FJQMHGhOIGr1vAQEBBwIBHRiFMoR/h12BDwWWdY1HjnxEjXqEWiguiFMBAQE Received: from ppp121-44-19-16.lns20.syd4.internode.on.net (HELO dastard) ([121.44.19.16]) by ipmail06.adl2.internode.on.net with ESMTP; 09 Feb 2016 06:14:19 +1030 Received: from dave by dastard with local (Exim 4.80) (envelope-from ) id 1aSrjO-0000dy-Gk; Tue, 09 Feb 2016 06:44:18 +1100 Date: Tue, 9 Feb 2016 06:44:18 +1100 From: Dave Chinner To: Christoph Hellwig Cc: xfs@oss.sgi.com Subject: Re: [PATCH 4/9] xfs: move v1 inode conversion to xfs_inode_from_disk Message-ID: <20160208194418.GF27429@dastard> X-ASG-Orig-Subj: Re: [PATCH 4/9] xfs: move v1 inode conversion to xfs_inode_from_disk References: <1454905461-2773-1-git-send-email-david@fromorbit.com> <1454905461-2773-5-git-send-email-david@fromorbit.com> <20160208093150.GD28146@infradead.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20160208093150.GD28146@infradead.org> User-Agent: Mutt/1.5.21 (2010-09-15) X-Barracuda-Connect: ipmail06.adl2.internode.on.net[150.101.137.129] X-Barracuda-Start-Time: 1454960659 X-Barracuda-URL: https://192.48.157.11:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-BRTS-Status: 1 X-Barracuda-Spam-Score: 0.00 X-Barracuda-Spam-Status: No, SCORE=0.00 using per-user scores of TAG_LEVEL=1000.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.7 tests=BSF_SC0_MISMATCH_TO X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.3.26864 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 0.00 BSF_SC0_MISMATCH_TO Envelope rcpt doesn't match header On Mon, Feb 08, 2016 at 01:31:50AM -0800, Christoph Hellwig wrote: > Looks fine, > > Reviewed-by: Christoph Hellwig > > Shouldn't we be able to kill off di_version as well? version 3 inodes > only happen on crc enabled file systems, and version 2 only on > version 4 file systems. In theory, yes, though there is a lot of code that checks the di_version field and the superblock version checks are more heavyweight. I think it's also a cleaner design to base general inode formatting decisions on the inode version number and it's internal flags, because then we don't have to rely on external code to determine exactly what to do. e.g. in userspace there is no guarantee we have a superblock context we can access, even if we have a struct xfs_inode or a struct xfs_icdinode... Cheers, Dave. -- Dave Chinner david@fromorbit.com From david@fromorbit.com Mon Feb 8 13:47:37 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=ham version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay2.corp.sgi.com [137.38.102.29]) by oss.sgi.com (Postfix) with ESMTP id 85F287CA2 for ; Mon, 8 Feb 2016 13:47:37 -0600 (CST) Received: from cuda.sgi.com (cuda2.sgi.com [192.48.176.25]) by relay2.corp.sgi.com (Postfix) with ESMTP id 7F0C9304032 for ; Mon, 8 Feb 2016 11:47:37 -0800 (PST) X-ASG-Debug-ID: 1454960854-04cbb04cfa1737c0001-NocioJ Received: from ipmail06.adl2.internode.on.net (ipmail06.adl2.internode.on.net [150.101.137.129]) by cuda.sgi.com with ESMTP id v7GRPIEDzFXGWhI6 for ; Mon, 08 Feb 2016 11:47:35 -0800 (PST) X-Barracuda-Envelope-From: david@fromorbit.com X-Barracuda-Apparent-Source-IP: 150.101.137.129 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: A2CCCADa77hWPBATLHleKAECgw+BP4ZjgXidSwaLZoVEhAeGBwICAQECgS5NAQEBAQEBBwEBAQFBP4RBAQEBBDocIxAIAw4HAwklDwUlAwcaE4gavXABAQgCHhiFMoR/iGwFlnWNR458jj6EWiguiFMBAQE Received: from ppp121-44-19-16.lns20.syd4.internode.on.net (HELO dastard) ([121.44.19.16]) by ipmail06.adl2.internode.on.net with ESMTP; 09 Feb 2016 06:17:34 +1030 Received: from dave by dastard with local (Exim 4.80) (envelope-from ) id 1aSrmX-0000eJ-Jc; Tue, 09 Feb 2016 06:47:33 +1100 Date: Tue, 9 Feb 2016 06:47:33 +1100 From: Dave Chinner To: Christoph Hellwig Cc: xfs@oss.sgi.com Subject: Re: [PATCH 6/9] xfs: use vfs inode nlink field everywhere Message-ID: <20160208194733.GG27429@dastard> X-ASG-Orig-Subj: Re: [PATCH 6/9] xfs: use vfs inode nlink field everywhere References: <1454905461-2773-1-git-send-email-david@fromorbit.com> <1454905461-2773-7-git-send-email-david@fromorbit.com> <20160208094021.GA4487@infradead.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20160208094021.GA4487@infradead.org> User-Agent: Mutt/1.5.21 (2010-09-15) X-Barracuda-Connect: ipmail06.adl2.internode.on.net[150.101.137.129] X-Barracuda-Start-Time: 1454960854 X-Barracuda-URL: https://192.48.176.25:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-BRTS-Status: 1 X-Barracuda-Spam-Score: 0.00 X-Barracuda-Spam-Status: No, SCORE=0.00 using per-user scores of TAG_LEVEL=1000.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.7 tests=BSF_SC0_MISMATCH_TO X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.3.26863 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 0.00 BSF_SC0_MISMATCH_TO Envelope rcpt doesn't match header On Mon, Feb 08, 2016 at 01:40:21AM -0800, Christoph Hellwig wrote: > On Mon, Feb 08, 2016 at 03:24:18PM +1100, Dave Chinner wrote: > > From: Dave Chinner > > > > The Vfs tracks the inodenlink just like the xfs_icdinode. We can > > s/Vfs/VFS/ > > > +STATIC int > > xfs_iunlink( > > - xfs_trans_t *tp, > > - xfs_inode_t *ip) > > + struct xfs_trans *tp, > > + struct xfs_inode *ip, > > + bool ignore_linkcount) > > I'd say kill the ignore_linkcount parameter and the assert depending on it. > There are just two callers: xfs_droplink checks for i_nlink just before > the call, and xfs_create_tmpfile has to set the override flag. Will do, I think I added that when trying to track down a busy inodes after unmount bug in this patch, and then never removed it again. Cheers, Dave. -- Dave Chinner david@fromorbit.com From david@fromorbit.com Mon Feb 8 13:50:13 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=ham version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay3.corp.sgi.com [198.149.34.15]) by oss.sgi.com (Postfix) with ESMTP id 03F597CA2 for ; Mon, 8 Feb 2016 13:50:13 -0600 (CST) Received: from cuda.sgi.com (cuda3.sgi.com [192.48.176.15]) by relay3.corp.sgi.com (Postfix) with ESMTP id 93010AC004 for ; Mon, 8 Feb 2016 11:50:12 -0800 (PST) X-ASG-Debug-ID: 1454961009-04cb6c2747193d40001-NocioJ Received: from ipmail06.adl2.internode.on.net (ipmail06.adl2.internode.on.net [150.101.137.129]) by cuda.sgi.com with ESMTP id DnTpYApoAmYIWniH for ; Mon, 08 Feb 2016 11:50:09 -0800 (PST) X-Barracuda-Envelope-From: david@fromorbit.com X-Barracuda-Apparent-Source-IP: 150.101.137.129 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: A2BgDAAC8bhWPBATLHleKAECgw+BP4ZjgXidSwaLZjiFDIQHhgcEAgKBLk0BAQEBAQEHAQEBAUE/hEIBAQQnExwjEAgDDgoJJQ8FJQMHGhOIGr1yAQEIAh4YhTKEf4hsAQSWdY1HjnxEjXqEWiguiFMBAQE Received: from ppp121-44-19-16.lns20.syd4.internode.on.net (HELO dastard) ([121.44.19.16]) by ipmail06.adl2.internode.on.net with ESMTP; 09 Feb 2016 06:20:09 +1030 Received: from dave by dastard with local (Exim 4.80) (envelope-from ) id 1aSrp2-0000fL-6A; Tue, 09 Feb 2016 06:50:08 +1100 Date: Tue, 9 Feb 2016 06:50:08 +1100 From: Dave Chinner To: Christoph Hellwig Cc: xfs@oss.sgi.com Subject: Re: [PATCH 9/9] xfs: mode di_mode to vfs inode Message-ID: <20160208195008.GH27429@dastard> X-ASG-Orig-Subj: Re: [PATCH 9/9] xfs: mode di_mode to vfs inode References: <1454905461-2773-1-git-send-email-david@fromorbit.com> <1454905461-2773-10-git-send-email-david@fromorbit.com> <20160208094239.GD4487@infradead.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20160208094239.GD4487@infradead.org> User-Agent: Mutt/1.5.21 (2010-09-15) X-Barracuda-Connect: ipmail06.adl2.internode.on.net[150.101.137.129] X-Barracuda-Start-Time: 1454961009 X-Barracuda-URL: https://192.48.176.15:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-BRTS-Status: 1 X-Barracuda-Spam-Score: 0.00 X-Barracuda-Spam-Status: No, SCORE=0.00 using per-user scores of TAG_LEVEL=1000.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.7 tests=BSF_SC0_MISMATCH_TO X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.3.26864 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 0.00 BSF_SC0_MISMATCH_TO Envelope rcpt doesn't match header On Mon, Feb 08, 2016 at 01:42:39AM -0800, Christoph Hellwig wrote: > On Mon, Feb 08, 2016 at 03:24:21PM +1100, Dave Chinner wrote: > > - ASSERT(!(S_ISREG(ip->i_d.di_mode) && whichfork == XFS_DATA_FORK)); > > + ASSERT(!(S_ISREG(VFS_I(ip)->i_mode) && whichfork == XFS_DATA_FORK)); > > Maybe it's worth adding XFS_ISDIR/REG/.. helpers for all these checks? Makes sense - I think I'll do that as a followup patch, though, along with further icdinode cleanups. Cheers, Dave. -- Dave Chinner david@fromorbit.com From david@fromorbit.com Mon Feb 8 13:52:59 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=ham version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay2.corp.sgi.com [137.38.102.29]) by oss.sgi.com (Postfix) with ESMTP id 231E37CA2 for ; Mon, 8 Feb 2016 13:52:59 -0600 (CST) Received: from cuda.sgi.com (cuda3.sgi.com [192.48.176.15]) by relay2.corp.sgi.com (Postfix) with ESMTP id 1465C304032 for ; Mon, 8 Feb 2016 11:52:59 -0800 (PST) X-ASG-Debug-ID: 1454961175-04cb6c2745193e50001-NocioJ Received: from ipmail06.adl2.internode.on.net (ipmail06.adl2.internode.on.net [150.101.137.129]) by cuda.sgi.com with ESMTP id UQNu9HTfnuPJmzIT for ; Mon, 08 Feb 2016 11:52:55 -0800 (PST) X-Barracuda-Envelope-From: david@fromorbit.com X-Barracuda-Apparent-Source-IP: 150.101.137.129 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: A2AxCAAC8bhWPBATLHleKAECgw9SbYZjgXidSwaLZoVEhAcZhW4EAgKBLk0BAQEBAQEHAQEBAUE/hEIBAQQnExwjEAgDDgoJJQ8FJQMHGhOIGr1yAQEBBwIBHRiFMoR/hBeEVQWWdYVMh3uOfI4+hFooLocbgTgBAQE Received: from ppp121-44-19-16.lns20.syd4.internode.on.net (HELO dastard) ([121.44.19.16]) by ipmail06.adl2.internode.on.net with ESMTP; 09 Feb 2016 06:22:54 +1030 Received: from dave by dastard with local (Exim 4.80) (envelope-from ) id 1aSrrh-0000fa-UB; Tue, 09 Feb 2016 06:52:53 +1100 Date: Tue, 9 Feb 2016 06:52:53 +1100 From: Dave Chinner To: Brian Foster Cc: xfs@oss.sgi.com Subject: Re: [ANNOUNCE] xfs: for-next branch updated to 4a91310 Message-ID: <20160208195253.GI27429@dastard> X-ASG-Orig-Subj: Re: [ANNOUNCE] xfs: for-next branch updated to 4a91310 References: <20160208060751.GA27429@dastard> <20160208153720.GG19597@bfoster.bfoster> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20160208153720.GG19597@bfoster.bfoster> User-Agent: Mutt/1.5.21 (2010-09-15) X-Barracuda-Connect: ipmail06.adl2.internode.on.net[150.101.137.129] X-Barracuda-Start-Time: 1454961175 X-Barracuda-URL: https://192.48.176.15:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-BRTS-Status: 1 X-Barracuda-Spam-Score: 0.00 X-Barracuda-Spam-Status: No, SCORE=0.00 using per-user scores of TAG_LEVEL=1000.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.7 tests=BSF_SC0_MISMATCH_TO X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.3.26864 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 0.00 BSF_SC0_MISMATCH_TO Envelope rcpt doesn't match header On Mon, Feb 08, 2016 at 10:37:20AM -0500, Brian Foster wrote: > On Mon, Feb 08, 2016 at 05:07:51PM +1100, Dave Chinner wrote: > > Hi folks, > > > > The for-next branch of the xfs kernel repository at > > > > git://git.kernel.org/pub/scm/linux/kernel/git/dgc/linux-xfs.git > > > > has just been updated. I've pushed this out with both generic quota > > and direct Io modifications in it, so if they end up going into > > another tree expect a rebase of the for-next branch to occur to pull > > them in from the appropriate trees. > > > > There is still a lot of changes pending review to go into this > > for-next tree, and I'm hoping to get the first part of the > > rmap/reflink work into it as well, so there's plenty of work still > > to be done in this cycle.... > > > > The new head of the for-next branch is commit: > > > > 4a91310 Merge branch 'xfs-misc-fixes-4.6' into for-next > > > > New Commits: > > > > Brian Foster (2): > > [60630fe] xfs: clean up unwritten buffers on write failure > > [af055e3] xfs: fix xfs_log_ticket leak in xfs_end_io() after fs shutdown > > > > Carlos Maiolino (1): > > [be60794] xfs: Split default quota limits by quota type > > > > Christoph Hellwig (6): > > [187372a] direct-io: always call ->end_io if non-NULL > > [273dda7] xfs: don't use ioends for direct write completions > > [c19b104] xfs: fold xfs_vm_do_dio into xfs_vm_direct_IO > > [196328e] xfs: handle errors from ->free_blocks in xfs_btree_kill_iroot > > [c46ee8a] xfs: factor btree block freeing into a helper > > [edfd9dd] xfs: move buffer invalidation to xfs_btree_free_block > > > > Darrick J. Wong (2): > > [8e0bd49] xfs: fix endianness error when checking log block crc on big endian platforms > > [244efea] xfs: move struct xfs_attr_shortform to xfs_da_format.h > > > > Dave Chinner (7): > > [4b680af] xfs: lock rt summary inode on allocation > > [a204d07] xfs: RT bitmap and summary buffers are not typed > > [ca4de5c] xfs: RT bitmap and summary buffers need verifiers > > FYI, this one ^ leads to compile failures when CONFIG_XFS_RT is not > enabled. xfs_rtbuf_ops is defined in the conditionally compiled > xfs_rtbitmap.c file and used unconditionally in xfs_log_recover.c. Ah, ok. I didn't test that - there's way too many different ways to build kernels.... :/ I guess log recovery now needs #ifdef CONFIG_XFS_RT bits in it. I'll spin up a patch later today. Cheers, Dave. -- Dave Chinner david@fromorbit.com From david@fromorbit.com Mon Feb 8 13:55:08 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=ham version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay1.corp.sgi.com [137.38.102.111]) by oss.sgi.com (Postfix) with ESMTP id 487C27CA2 for ; Mon, 8 Feb 2016 13:55:08 -0600 (CST) Received: from cuda.sgi.com (cuda1.sgi.com [192.48.157.11]) by relay1.corp.sgi.com (Postfix) with ESMTP id 1F3798F8049 for ; Mon, 8 Feb 2016 11:55:07 -0800 (PST) X-ASG-Debug-ID: 1454961304-04bdf079c5156170001-NocioJ Received: from ipmail06.adl2.internode.on.net (ipmail06.adl2.internode.on.net [150.101.137.129]) by cuda.sgi.com with ESMTP id 7Ebu5Clmo1B0jCAU for ; Mon, 08 Feb 2016 11:55:05 -0800 (PST) X-Barracuda-Envelope-From: david@fromorbit.com X-Barracuda-Apparent-Source-IP: 150.101.137.129 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: A2AtCAA48rhWPBATLHleKAECgw+BP4ZjgXidSwaLZoVEhAeGBwQCAoEuTQEBAQEBAQcBAQEBQT+EQgEBBCcTHCMQCAMOCgklDwUlAwcaE4gavWoBCx4YhTKEf4hsAQSWdY1HjnyOPoRaKC6IUwEBAQ Received: from ppp121-44-19-16.lns20.syd4.internode.on.net (HELO dastard) ([121.44.19.16]) by ipmail06.adl2.internode.on.net with ESMTP; 09 Feb 2016 06:24:38 +1030 Received: from dave by dastard with local (Exim 4.80) (envelope-from ) id 1aSrtN-0000gD-Tb; Tue, 09 Feb 2016 06:54:37 +1100 Date: Tue, 9 Feb 2016 06:54:37 +1100 From: Dave Chinner To: Christoph Hellwig Cc: xfs@oss.sgi.com Subject: Re: [PATCH 6/7] libxfs: keep unflushable buffers off the cache MRUs Message-ID: <20160208195437.GJ27429@dastard> X-ASG-Orig-Subj: Re: [PATCH 6/7] libxfs: keep unflushable buffers off the cache MRUs References: <1454627108-19036-1-git-send-email-david@fromorbit.com> <1454627108-19036-7-git-send-email-david@fromorbit.com> <20160208100636.GA27683@infradead.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20160208100636.GA27683@infradead.org> User-Agent: Mutt/1.5.21 (2010-09-15) X-Barracuda-Connect: ipmail06.adl2.internode.on.net[150.101.137.129] X-Barracuda-Start-Time: 1454961304 X-Barracuda-URL: https://192.48.157.11:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-BRTS-Status: 1 X-Barracuda-Spam-Score: 0.00 X-Barracuda-Spam-Status: No, SCORE=0.00 using per-user scores of TAG_LEVEL=1000.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.7 tests=BSF_SC0_MISMATCH_TO X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.3.26865 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 0.00 BSF_SC0_MISMATCH_TO Envelope rcpt doesn't match header On Mon, Feb 08, 2016 at 02:06:36AM -0800, Christoph Hellwig wrote: > > --- a/include/cache.h > > +++ b/include/cache.h > > @@ -51,6 +51,7 @@ enum { > > #define CACHE_BASE_PRIORITY 0 > > #define CACHE_PREFETCH_PRIORITY 8 > > #define CACHE_MAX_PRIORITY 15 > > +#define CACHE_DIRTY_PRIORITY (CACHE_MAX_PRIORITY + 1) > > Sizing arrays based on, and iterating up to CACHE_DIRTY_PRIORITY seems > rather odd. Maybe add a new > > #define CACHE_NR_PRIORITIES CACHE_DIRTY_PRIORITY > > and a comment explaining the magic to make it more obvious? Ok. > > +cache_move_to_dirty_mru( > > + struct cache *cache, > > + struct cache_node *node) > > +{ > > + struct cache_mru *mru; > > + > > + mru = &cache->c_mrus[CACHE_DIRTY_PRIORITY]; > > + > > + pthread_mutex_lock(&mru->cm_mutex); > > + node->cn_priority = CACHE_DIRTY_PRIORITY; > > + list_move(&node->cn_mru, &mru->cm_list); > > + mru->cm_count++; > > + pthread_mutex_unlock(&mru->cm_mutex); > > +} > > Maybe it would better to just do a list_add here and leave the > list_del to the caller to avoid needing to nest two different > cm_mutex instances. I'll have a look at it. Cheers, Dave. -- Dave Chinner david@fromorbit.com From david@fromorbit.com Mon Feb 8 14:18:18 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=ham version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay1.corp.sgi.com [137.38.102.111]) by oss.sgi.com (Postfix) with ESMTP id 19A657CA2 for ; Mon, 8 Feb 2016 14:18:18 -0600 (CST) Received: from cuda.sgi.com (cuda2.sgi.com [192.48.176.25]) by relay1.corp.sgi.com (Postfix) with ESMTP id 0E49D8F8040 for ; Mon, 8 Feb 2016 12:18:15 -0800 (PST) X-ASG-Debug-ID: 1454962690-04cbb04cfa174cf0001-NocioJ Received: from ipmail06.adl2.internode.on.net (ipmail06.adl2.internode.on.net [150.101.137.129]) by cuda.sgi.com with ESMTP id qtkiMBN215QYiHAE for ; Mon, 08 Feb 2016 12:18:10 -0800 (PST) X-Barracuda-Envelope-From: david@fromorbit.com X-Barracuda-Apparent-Source-IP: 150.101.137.129 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: A2CCCAAL97hWPBATLHleKAECgw+BP4ZjgXidSwaLZoVEhAeGBwICAQECgS5NAQEBAQEBBwEBAQFBP4RCAQEEJxMcIxAIAxgJJQ8FJQMHGhOIGr1uAQEIAgEdGIUyhH+EFgaEUAWHUIcGiB+NR458g1KKbIJlGYFcKC4BhxqBOAEBAQ Received: from ppp121-44-19-16.lns20.syd4.internode.on.net (HELO dastard) ([121.44.19.16]) by ipmail06.adl2.internode.on.net with ESMTP; 09 Feb 2016 06:48:08 +1030 Received: from dave by dastard with local (Exim 4.80) (envelope-from ) id 1aSsG8-0000jY-9z; Tue, 09 Feb 2016 07:18:08 +1100 Date: Tue, 9 Feb 2016 07:18:08 +1100 From: Dave Chinner To: Dan Williams Cc: Ross Zwisler , "linux-kernel@vger.kernel.org" , Theodore Ts'o , Alexander Viro , Andreas Dilger , Andrew Morton , Jan Kara , Matthew Wilcox , linux-ext4 , linux-fsdevel , Linux MM , "linux-nvdimm@lists.01.org" , XFS Developers , jmoyer Subject: Re: [PATCH 2/2] dax: move writeback calls into the filesystems Message-ID: <20160208201808.GK27429@dastard> X-ASG-Orig-Subj: Re: [PATCH 2/2] dax: move writeback calls into the filesystems References: <1454829553-29499-1-git-send-email-ross.zwisler@linux.intel.com> <1454829553-29499-3-git-send-email-ross.zwisler@linux.intel.com> <20160207215047.GJ31407@dastard> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.21 (2010-09-15) X-Barracuda-Connect: ipmail06.adl2.internode.on.net[150.101.137.129] X-Barracuda-Start-Time: 1454962690 X-Barracuda-URL: https://192.48.176.25:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-BRTS-Status: 1 X-Barracuda-Spam-Score: 0.00 X-Barracuda-Spam-Status: No, SCORE=0.00 using per-user scores of TAG_LEVEL=1000.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.7 tests=BSF_SC0_MISMATCH_TO X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.3.26864 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 0.00 BSF_SC0_MISMATCH_TO Envelope rcpt doesn't match header On Mon, Feb 08, 2016 at 12:18:11AM -0800, Dan Williams wrote: > On Sun, Feb 7, 2016 at 1:50 PM, Dave Chinner wrote: > > On Sun, Feb 07, 2016 at 11:13:51AM -0800, Dan Williams wrote: > >> On Sat, Feb 6, 2016 at 11:19 PM, Ross Zwisler > >> wrote: > >> > Previously calls to dax_writeback_mapping_range() for all DAX filesystems > >> > (ext2, ext4 & xfs) were centralized in filemap_write_and_wait_range(). > >> > dax_writeback_mapping_range() needs a struct block_device, and it used to > >> > get that from inode->i_sb->s_bdev. This is correct for normal inodes > >> > mounted on ext2, ext4 and XFS filesystems, but is incorrect for DAX raw > >> > block devices and for XFS real-time files. > >> > > >> > Instead, call dax_writeback_mapping_range() directly from the filesystem or > >> > raw block device fsync/msync code so that they can supply us with a valid > >> > block device. > >> > > >> > It should be noted that this will reduce the number of calls to > >> > dax_writeback_mapping_range() because filemap_write_and_wait_range() is > >> > called in the various filesystems for operations other than just > >> > fsync/msync. Both ext4 & XFS call filemap_write_and_wait_range() outside > >> > of ->fsync for hole punch, truncate, and block relocation > >> > (xfs_shift_file_space() && ext4_collapse_range()/ext4_insert_range()). > >> > > >> > I don't believe that these extra flushes are necessary in the DAX case. In > >> > the page cache case when we have dirty data in the page cache, that data > >> > will be actively lost if we evict a dirty page cache page without flushing > >> > it to media first. For DAX, though, the data will remain consistent with > >> > the physical address to which it was written regardless of whether it's in > >> > the processor cache or not - really the only reason I see to flush is in > >> > response to a fsync or msync so that our data is durable on media in case > >> > of a power loss. The case where we could throw dirty data out of the page > >> > cache and essentially lose writes simply doesn't exist. > >> > > >> > Signed-off-by: Ross Zwisler > >> > --- > >> > fs/block_dev.c | 7 +++++++ > >> > fs/dax.c | 5 ++--- > >> > fs/ext2/file.c | 10 ++++++++++ > >> > fs/ext4/fsync.c | 10 +++++++++- > >> > fs/xfs/xfs_file.c | 12 ++++++++++-- > >> > include/linux/dax.h | 4 ++-- > >> > mm/filemap.c | 6 ------ > >> > 7 files changed, 40 insertions(+), 14 deletions(-) > >> > >> This sprinkling of dax specific fixups outside of vm_operations_struct > >> routines still has me thinking that we are going in the wrong > >> direction for fsync/msync support. > >> > >> If an application is both unaware of DAX and doing mmap I/O it is > >> better served by the page cache where writeback is durable by default. > >> We expect DAX-aware applications to assume responsibility for cpu > >> cache management [1]. Making DAX mmap semantics explicit opt-in > >> solves not only durability support, but also the current problem that > >> DAX gets silently disabled leaving an app to wonder if it really got a > >> direct mapping. DAX also silently picks pud, pmd, or pte mappings > >> which is information an application would really like to know at map > >> time. > >> > >> The proposal: make applications explicitly request DAX semantics with > >> a new MAP_DAX flag and fail if DAX is unavailable. > > > > No. > > > > As I've stated before, the entire purpose of enabling DAX through > > existing filesytsems like XFS and ext4 is so that existing > > applications work with DAX *without modification*. > > > > That is, applications can be entirely unaware of the fact that the > > filesystem is giving them direct access to the storage because the > > access and failure semantics of DAX enabled mmap are *identical to > > the existing mmap semantics*. > > > > Given this, the app doesn't need to care whether DAX is enabled or > > not; all that will be seen is a difference in speed of access. > > Enabling and disabling DAX is, at this point, purely an > > administration decision - if the hardware and filesystem supports > > it, it can be turned on without having to wait years for application > > developers to add support for it.... > > Setting aside the current block zeroing problem you seem to assuming > that DAX will always be faster and that may not be true at a media > level. Waiting years for some applications to determine if DAX makes > sense for their use case seems completely reasonable. In the meantime > the apps that are already making these changes want to know that a DAX > mapping request has not silently dropped backed to page cache. They > also want to know if they successfully jumped through all the hoops to > get a larger than pte mapping. > > I agree it is useful to be able to force DAX on an unmodified > application to see what happens, and it follows that if those > applications want to run in that mode they will need functional > fsync()... > > I would feel better if we were talking about specific applications and > performance numbers to know if forcing DAX on application is a debug > facility or a production level capability. You seem to have already > made that determination and I'm curious what I'm missing. I'm not setting any policy here at all. This whole argument is based around the DAX mount option doing "global fs enable or silently turning it off" and the application not knowing about that. The whole point of having a persistent per-inode DAX flags is that it is a policy mechanism, not a policy. The application can, if it is DAX aware, directly control whether DAX is used on a file or not. The application can even query and clear that persistent inode flag if it is configured not to (or cannot) use DAX. If the filesystem cannot support DAX, then we can error out attempts to set the DAX flag and then the app knows DAX is not available. i.e. the attempt to set policy failed. If the flag is set, then the inode will *always* use DAX - there is no "fall back to page cache" when DAX is enabled. If the applicaiton is not DAX aware, then the admin can control the DAX policy by manipulating these flags themselves, and hence control whether DAX is used by the application or not. If you think I'm dictating policy for DAX users and application, then you haven't understood anything I've previously said about why the DAX mount option needs to die before any of this is considered production ready. DAX is not an opaque "all or nothing" option. XFS will provide apps and admins with fine-grained, persistent, discoverable policy flags to allow admins and applications to set DAX policies however they see fit. This simply cannot be done if the only knob you have is a mount option that may or may not stick. Cheers, Dave. -- Dave Chinner david@fromorbit.com From david@fromorbit.com Mon Feb 8 14:21:30 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=ham version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay2.corp.sgi.com [137.38.102.29]) by oss.sgi.com (Postfix) with ESMTP id DD51F7CA2 for ; Mon, 8 Feb 2016 14:21:30 -0600 (CST) Received: from cuda.sgi.com (cuda3.sgi.com [192.48.176.15]) by relay2.corp.sgi.com (Postfix) with ESMTP id D50FD304051 for ; Mon, 8 Feb 2016 12:21:27 -0800 (PST) X-ASG-Debug-ID: 1454962885-04cb6c2745196460001-NocioJ Received: from ipmail06.adl2.internode.on.net (ipmail06.adl2.internode.on.net [150.101.137.129]) by cuda.sgi.com with ESMTP id HKLdLif77AmwGTBm for ; Mon, 08 Feb 2016 12:21:25 -0800 (PST) X-Barracuda-Envelope-From: david@fromorbit.com X-Barracuda-Apparent-Source-IP: 150.101.137.129 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: A2AtCABI+LhWPBATLHleKAECgw+BP4ZjgXidSwaLZoVEhAeGBwQCAoEuTQEBAQEBAQcBAQEBQT+EQgEBBDocIxAIAw4KCSUPBSUDBxoTiBq9cwEBCAIeGIUyhH+EEwEBhFcFlnWNR4FkjRiFboR+g1KCZRmBXCguhyOBMAEBAQ Received: from ppp121-44-19-16.lns20.syd4.internode.on.net (HELO dastard) ([121.44.19.16]) by ipmail06.adl2.internode.on.net with ESMTP; 09 Feb 2016 06:51:24 +1030 Received: from dave by dastard with local (Exim 4.80) (envelope-from ) id 1aSsJH-0000kA-Vu; Tue, 09 Feb 2016 07:21:24 +1100 Date: Tue, 9 Feb 2016 07:21:23 +1100 From: Dave Chinner To: Christoph Hellwig Cc: xfs@oss.sgi.com Subject: Re: [PATCH 2/4] xfs: Introduce writeback context for writepages Message-ID: <20160208202123.GL27429@dastard> X-ASG-Orig-Subj: Re: [PATCH 2/4] xfs: Introduce writeback context for writepages References: <1440479153-1584-1-git-send-email-david@fromorbit.com> <1440479153-1584-3-git-send-email-david@fromorbit.com> <20160208073631.GA1789@infradead.org> <20160208075403.GA29242@infradead.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20160208075403.GA29242@infradead.org> User-Agent: Mutt/1.5.21 (2010-09-15) X-Barracuda-Connect: ipmail06.adl2.internode.on.net[150.101.137.129] X-Barracuda-Start-Time: 1454962885 X-Barracuda-URL: https://192.48.176.15:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-BRTS-Status: 1 X-Barracuda-Spam-Score: 0.00 X-Barracuda-Spam-Status: No, SCORE=0.00 using per-user scores of TAG_LEVEL=1000.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.7 tests=BSF_SC0_MISMATCH_TO X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.3.26866 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 0.00 BSF_SC0_MISMATCH_TO Envelope rcpt doesn't match header On Sun, Feb 07, 2016 at 11:54:03PM -0800, Christoph Hellwig wrote: > On Sun, Feb 07, 2016 at 11:36:31PM -0800, Christoph Hellwig wrote: > > FYI, I recently started testing this series again after a trivial > > rebase to 4.5-rc2, and this patch seems to cause reproducible failures > > of generic/311 (fsync tester) > > And by coincidence you posted a new version the night before I posted > this mail. It still shows that same failure. What is your test config? The only failures I've had recently of generic/311 were caused by a bug in the fsync-tester application. This was fixed by commit 9165a84 ("fsync-tester: reopen files with correct flags") that was pushed out in the fstests update I did yesterday. Cheers, Dave. -- Dave Chinner david@fromorbit.com From dan.j.williams@intel.com Mon Feb 8 14:55:30 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=T_DKIM_INVALID autolearn=ham version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay3.corp.sgi.com [198.149.34.15]) by oss.sgi.com (Postfix) with ESMTP id C15327CA2 for ; Mon, 8 Feb 2016 14:55:30 -0600 (CST) Received: from cuda.sgi.com (cuda3.sgi.com [192.48.176.15]) by relay3.corp.sgi.com (Postfix) with ESMTP id 43C54AC005 for ; Mon, 8 Feb 2016 12:55:27 -0800 (PST) X-ASG-Debug-ID: 1454964924-04cb6c2747199200001-NocioJ Received: from mail-yw0-f170.google.com (mail-yw0-f170.google.com [209.85.161.170]) by cuda.sgi.com with ESMTP id sIznThIdF7mcEiZw (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128 verify=NO) for ; Mon, 08 Feb 2016 12:55:24 -0800 (PST) X-Barracuda-Envelope-From: dan.j.williams@intel.com X-Barracuda-Apparent-Source-IP: 209.85.161.170 Received: by mail-yw0-f170.google.com with SMTP id g127so111759114ywf.2 for ; Mon, 08 Feb 2016 12:55:24 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=intel-com.20150623.gappssmtp.com; s=20150623; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=3cjykdoarcdXmMHDyJekgNqdLOKhNhp9wC9zWgBuXFk=; b=Hpi9fa9Ba4RSKfPnmM+bkeoWDig5Jfxx+DpONqUVJCBvqRBOiSsqzQSIeg9o/B1OVS GdRaGXmrV7eMLLX39GVuZELlLgKEwhqIYsZu/q9PFyGdNNWL78qJH67qhXOP109VQi7l eOagZ6fVin7me0rGXH7A7if+6Xhe4qZ657qE25c+ZZBMVvqyQxPM5TWFPGk3kMtsNPIM izSAm7Di9ftixBMfMl7KDFWjVIT2GX1ZDDES6mYCfIVaIOkM8UF2stvQnBYxTYW5B/EX Ncf0+3hmJQloTn49eEqjETMCBDcoNZyCBJQgGjRSDV+r/hiFI+pAz0yrEbRS5u8hkSYM IZHQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:date :message-id:subject:from:to:cc:content-type; bh=3cjykdoarcdXmMHDyJekgNqdLOKhNhp9wC9zWgBuXFk=; b=C8LER2DLOQ2BGhnh/w4qhGLpZKKuQ4s4IECV4G2BXEQTwMuw9/sr5gFsliQVSUSr8H VJi2H9KcTo+e0539PgvRFj7echaDanHNXI3OnwnLtKNZv5jxG/GSuHjJuatwTht4jtgz SPlBwEKqb27Tci5Ja3uC80LA2eC+yXDgSDnOA/TPOFSkLW6AOV7FMsp2xYmuuS2A3Qvv HC50iXAHtIM1yLM/GJB0aoMpA+MpSFJE51IMdhgeg54e7O57odz9UJaM5ECay4sPcgzD WGnaOzmWNsWHh2RNMl7T5jcqjeTYH8WFr/Y7dRxjRA4wtCxCPd4gWUapvMEG8h2BxLtH RQDg== X-Gm-Message-State: AG10YOQuAlQQ+3OCftTe0KsDk8mG4q3TGviAoptF6H3BH7aK050GIYQMoZGdqTVIuG5P55tvXo1orY8Hog6Yk5/R MIME-Version: 1.0 X-Received: by 10.129.48.137 with SMTP id w131mr6268781yww.82.1454964924216; Mon, 08 Feb 2016 12:55:24 -0800 (PST) Received: by 10.37.223.199 with HTTP; Mon, 8 Feb 2016 12:55:24 -0800 (PST) In-Reply-To: <20160208201808.GK27429@dastard> References: <1454829553-29499-1-git-send-email-ross.zwisler@linux.intel.com> <1454829553-29499-3-git-send-email-ross.zwisler@linux.intel.com> <20160207215047.GJ31407@dastard> <20160208201808.GK27429@dastard> Date: Mon, 8 Feb 2016 12:55:24 -0800 Message-ID: Subject: Re: [PATCH 2/2] dax: move writeback calls into the filesystems From: Dan Williams X-ASG-Orig-Subj: Re: [PATCH 2/2] dax: move writeback calls into the filesystems To: Dave Chinner Cc: Ross Zwisler , "linux-kernel@vger.kernel.org" , "Theodore Ts'o" , Alexander Viro , Andreas Dilger , Andrew Morton , Jan Kara , Matthew Wilcox , linux-ext4 , linux-fsdevel , Linux MM , "linux-nvdimm@lists.01.org" , XFS Developers , jmoyer Content-Type: text/plain; charset=UTF-8 X-Barracuda-Connect: mail-yw0-f170.google.com[209.85.161.170] X-Barracuda-Start-Time: 1454964924 X-Barracuda-Encrypted: ECDHE-RSA-AES128-GCM-SHA256 X-Barracuda-URL: https://192.48.176.15:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-BRTS-Status: 1 X-Barracuda-Spam-Score: 0.00 X-Barracuda-Spam-Status: No, SCORE=0.00 using per-user scores of TAG_LEVEL=1000.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.7 tests=BSF_SC0_MISMATCH_TO, DKIM_SIGNED, DKIM_VERIFIED X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.3.26866 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 0.00 BSF_SC0_MISMATCH_TO Envelope rcpt doesn't match header -0.00 DKIM_VERIFIED Domain Keys Identified Mail: signature passes verification 0.00 DKIM_SIGNED Domain Keys Identified Mail: message has a signature On Mon, Feb 8, 2016 at 12:18 PM, Dave Chinner wrote: [..] >> Setting aside the current block zeroing problem you seem to assuming >> that DAX will always be faster and that may not be true at a media >> level. Waiting years for some applications to determine if DAX makes >> sense for their use case seems completely reasonable. In the meantime >> the apps that are already making these changes want to know that a DAX >> mapping request has not silently dropped backed to page cache. They >> also want to know if they successfully jumped through all the hoops to >> get a larger than pte mapping. >> >> I agree it is useful to be able to force DAX on an unmodified >> application to see what happens, and it follows that if those >> applications want to run in that mode they will need functional >> fsync()... >> >> I would feel better if we were talking about specific applications and >> performance numbers to know if forcing DAX on application is a debug >> facility or a production level capability. You seem to have already >> made that determination and I'm curious what I'm missing. > > I'm not setting any policy here at all. This whole argument is > based around the DAX mount option doing "global fs enable or > silently turning it off" and the application not knowing about that. > > The whole point of having a persistent per-inode DAX flags is that > it is a policy mechanism, not a policy. The application can, if it > is DAX aware, directly control whether DAX is used on a file or not. > The application can even query and clear that persistent inode flag > if it is configured not to (or cannot) use DAX. > > If the filesystem cannot support DAX, then we can error out attempts > to set the DAX flag and then the app knows DAX is not available. > i.e. the attempt to set policy failed. If the flag is set, then the > inode will *always* use DAX - there is no "fall back to page cache" > when DAX is enabled. > > If the applicaiton is not DAX aware, then the admin can control the > DAX policy by manipulating these flags themselves, and hence control > whether DAX is used by the application or not. > > If you think I'm dictating policy for DAX users and application, > then you haven't understood anything I've previously said about why > the DAX mount option needs to die before any of this is considered > production ready. DAX is not an opaque "all or nothing" option. XFS > will provide apps and admins with fine-grained, persistent, > discoverable policy flags to allow admins and applications to set > DAX policies however they see fit. This simply cannot be done if the > only knob you have is a mount option that may or may not stick. I agree the mount option needs to die, and I fully grok the reasoning. What I'm concerned with is that a system using fully-DAX-aware applications is forced to incur the overhead of maintaining *sync semantics, periodic sync(2) in particular, even if it is not relying on those semantics. However, like I said in my other mail, we can solve that with alternate interfaces to persistent memory if that becomes an issue and not require that "disable *sync" capability to come through DAX. From jmoyer@redhat.com Mon Feb 8 14:58:49 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=ham version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay3.corp.sgi.com [198.149.34.15]) by oss.sgi.com (Postfix) with ESMTP id 7EC347CA2 for ; Mon, 8 Feb 2016 14:58:49 -0600 (CST) Received: from cuda.sgi.com (cuda3.sgi.com [192.48.176.15]) by relay3.corp.sgi.com (Postfix) with ESMTP id 0EC91AC005 for ; Mon, 8 Feb 2016 12:58:48 -0800 (PST) X-ASG-Debug-ID: 1454965127-04cb6c2747199320001-NocioJ Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by cuda.sgi.com with ESMTP id PGDLL8VLWaqa4o6q (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO) for ; Mon, 08 Feb 2016 12:58:48 -0800 (PST) X-Barracuda-Envelope-From: jmoyer@redhat.com X-Barracuda-Apparent-Source-IP: 209.132.183.28 X-ASG-Whitelist: Client Received: from int-mx13.intmail.prod.int.phx2.redhat.com (int-mx13.intmail.prod.int.phx2.redhat.com [10.5.11.26]) by mx1.redhat.com (Postfix) with ESMTPS id DF84B8E675; Mon, 8 Feb 2016 20:58:46 +0000 (UTC) Received: from segfault.boston.devel.redhat.com (segfault.boston.devel.redhat.com [10.19.60.26]) by int-mx13.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id u18KwiQ3019335 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Mon, 8 Feb 2016 15:58:45 -0500 From: Jeff Moyer To: Dan Williams Cc: Dave Chinner , Ross Zwisler , "linux-kernel\@vger.kernel.org" , "Theodore Ts'o" , Alexander Viro , Andreas Dilger , Andrew Morton , Jan Kara , Matthew Wilcox , linux-ext4 , linux-fsdevel , Linux MM , "linux-nvdimm\@lists.01.org" , XFS Developers Subject: Re: [PATCH 2/2] dax: move writeback calls into the filesystems References: <1454829553-29499-1-git-send-email-ross.zwisler@linux.intel.com> <1454829553-29499-3-git-send-email-ross.zwisler@linux.intel.com> <20160207215047.GJ31407@dastard> <20160208201808.GK27429@dastard> X-ASG-Orig-Subj: Re: [PATCH 2/2] dax: move writeback calls into the filesystems X-PGP-KeyID: 1F78E1B4 X-PGP-CertKey: F6FE 280D 8293 F72C 65FD 5A58 1FF8 A7CA 1F78 E1B4 X-PCLoadLetter: What the f**k does that mean? Date: Mon, 08 Feb 2016 15:58:44 -0500 In-Reply-To: (Dan Williams's message of "Mon, 8 Feb 2016 12:55:24 -0800") Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Scanned-By: MIMEDefang 2.68 on 10.5.11.26 X-Barracuda-Connect: mx1.redhat.com[209.132.183.28] X-Barracuda-Start-Time: 1454965127 X-Barracuda-Encrypted: ECDHE-RSA-AES256-GCM-SHA384 X-Barracuda-URL: https://192.48.176.15:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-BRTS-Status: 1 Dan Williams writes: > I agree the mount option needs to die, and I fully grok the reasoning. > What I'm concerned with is that a system using fully-DAX-aware > applications is forced to incur the overhead of maintaining *sync > semantics, periodic sync(2) in particular, even if it is not relying > on those semantics. > > However, like I said in my other mail, we can solve that with > alternate interfaces to persistent memory if that becomes an issue and > not require that "disable *sync" capability to come through DAX. What do you envision these alternate interfaces looking like? -Jeff From dan.j.williams@intel.com Mon Feb 8 16:05:39 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=T_DKIM_INVALID autolearn=ham version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay1.corp.sgi.com [137.38.102.111]) by oss.sgi.com (Postfix) with ESMTP id 444C07CA2 for ; Mon, 8 Feb 2016 16:05:39 -0600 (CST) Received: from cuda.sgi.com (cuda3.sgi.com [192.48.176.15]) by relay1.corp.sgi.com (Postfix) with ESMTP id 343A48F8040 for ; Mon, 8 Feb 2016 14:05:36 -0800 (PST) X-ASG-Debug-ID: 1454969134-04cb6c274619e520001-NocioJ Received: from mail-yw0-f170.google.com (mail-yw0-f170.google.com [209.85.161.170]) by cuda.sgi.com with ESMTP id aX1d6S6gEX8Ov3zB (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128 verify=NO) for ; Mon, 08 Feb 2016 14:05:34 -0800 (PST) X-Barracuda-Envelope-From: dan.j.williams@intel.com X-Barracuda-Apparent-Source-IP: 209.85.161.170 Received: by mail-yw0-f170.google.com with SMTP id q190so113406520ywd.3 for ; Mon, 08 Feb 2016 14:05:34 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=intel-com.20150623.gappssmtp.com; s=20150623; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=+wrSO1vC6NIO24bHlSSDK5oEHOt29uLb2p3VKU5SLHs=; b=qzvGcEwyvO2a/66oUCnlKFxo/Acb+QNeDynSqIGX1xN0Eci04gz8XcdIhzrlmJOXum WxfMo5lIYB1+vaEUQWSUx9XlYsfRs0WjQKPYxBojTXzhnK/jPcQQLnQt3b+F2SwiVxIY X6smBafmExXP7VJ7ZzMaY/qn+Q7Wi3WyRZiivat5gi7jxHRwkI+1aLhDaZIHmMUm6oM+ DFpFCrKu5uDMFrQ6iVg9S8zf/kfLK+0AjZjsgFyAxvoosVexA+ImhsDiWzH9pLeQjOej pzIJO5wwJdZ79fmiAC/XznFt2K2pEKMJ7sv9TH/bmR29ToXeXSo961hImihofuW2aRaF ssTA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:date :message-id:subject:from:to:cc:content-type; bh=+wrSO1vC6NIO24bHlSSDK5oEHOt29uLb2p3VKU5SLHs=; b=C+VX8VTK/aky/RhsKyYAOjEbGlH3BhNBlPRJWpMUrt1x+LfDYDZ5AZ1aDBlZ+vVKzV F37g9agKHzHkpiCexdK/5uiOXA59RHyZ5HoFWmRots13H7Kccdvfd8fDAFxqLIpNnTTo dvtXhZZF1AKMrzYkMqOssiH/ws4I4a6HIwNqv667Ei8gEjivahZM9OTMq+uluEL5m0/I XzLKlSMd3k9eMS4bJWUSr3wIzWYR9PEt4bZgplgZ1e13J/9jcz3EEhAWnh9q4a5jjysK y2IQIXapLrBl8D0UVQcmXHj9C7ZWxh0R1iB9dnVSqUStc/e1ymfZmPnmebHV26C6f2fJ Fqzg== X-Gm-Message-State: AG10YOSEbBNfgvmOmzb78N1YToky+ggghIQnB0fqyGdXzAlevKZTDNt/zCmW0FiHnrxu6HKc3Dlj3ptJYzWdh9kD MIME-Version: 1.0 X-Received: by 10.129.35.6 with SMTP id j6mr16789576ywj.133.1454969134270; Mon, 08 Feb 2016 14:05:34 -0800 (PST) Received: by 10.37.223.199 with HTTP; Mon, 8 Feb 2016 14:05:34 -0800 (PST) In-Reply-To: References: <1454829553-29499-1-git-send-email-ross.zwisler@linux.intel.com> <1454829553-29499-3-git-send-email-ross.zwisler@linux.intel.com> <20160207215047.GJ31407@dastard> <20160208201808.GK27429@dastard> Date: Mon, 8 Feb 2016 14:05:34 -0800 Message-ID: Subject: Re: [PATCH 2/2] dax: move writeback calls into the filesystems From: Dan Williams X-ASG-Orig-Subj: Re: [PATCH 2/2] dax: move writeback calls into the filesystems To: Jeff Moyer Cc: Dave Chinner , Ross Zwisler , "linux-kernel@vger.kernel.org" , "Theodore Ts'o" , Alexander Viro , Andreas Dilger , Andrew Morton , Jan Kara , Matthew Wilcox , linux-ext4 , linux-fsdevel , Linux MM , "linux-nvdimm@lists.01.org" , XFS Developers Content-Type: text/plain; charset=UTF-8 X-Barracuda-Connect: mail-yw0-f170.google.com[209.85.161.170] X-Barracuda-Start-Time: 1454969134 X-Barracuda-Encrypted: ECDHE-RSA-AES128-GCM-SHA256 X-Barracuda-URL: https://192.48.176.15:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-BRTS-Status: 1 X-Barracuda-Spam-Score: 0.00 X-Barracuda-Spam-Status: No, SCORE=0.00 using per-user scores of TAG_LEVEL=1000.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.7 tests=BSF_SC0_MISMATCH_TO, DKIM_SIGNED, DKIM_VERIFIED X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.3.26868 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 0.00 BSF_SC0_MISMATCH_TO Envelope rcpt doesn't match header -0.00 DKIM_VERIFIED Domain Keys Identified Mail: signature passes verification 0.00 DKIM_SIGNED Domain Keys Identified Mail: message has a signature On Mon, Feb 8, 2016 at 12:58 PM, Jeff Moyer wrote: > Dan Williams writes: > >> I agree the mount option needs to die, and I fully grok the reasoning. >> What I'm concerned with is that a system using fully-DAX-aware >> applications is forced to incur the overhead of maintaining *sync >> semantics, periodic sync(2) in particular, even if it is not relying >> on those semantics. >> >> However, like I said in my other mail, we can solve that with >> alternate interfaces to persistent memory if that becomes an issue and >> not require that "disable *sync" capability to come through DAX. > > What do you envision these alternate interfaces looking like? Well, plan-A was making DAX be explicit opt-in for applications, I haven't thought too much about plan-B. I expect it to be driven by real performance numbers and application use cases once the *sync compat work completes. From ross.zwisler@linux.intel.com Mon Feb 8 16:07:10 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=ham version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay2.corp.sgi.com [137.38.102.29]) by oss.sgi.com (Postfix) with ESMTP id 03C0F7CA2 for ; Mon, 8 Feb 2016 16:07:10 -0600 (CST) Received: from cuda.sgi.com (cuda3.sgi.com [192.48.176.15]) by relay2.corp.sgi.com (Postfix) with ESMTP id E5DA9304039 for ; Mon, 8 Feb 2016 14:07:06 -0800 (PST) X-ASG-Debug-ID: 1454969225-04cb6c274419eb00001-NocioJ Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) by cuda.sgi.com with ESMTP id rIfTM0jLLeX2tDWj for ; Mon, 08 Feb 2016 14:07:05 -0800 (PST) X-Barracuda-Envelope-From: ross.zwisler@linux.intel.com X-Barracuda-Apparent-Source-IP: 134.134.136.20 X-ASG-Whitelist: Client Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by orsmga101.jf.intel.com with ESMTP; 08 Feb 2016 14:07:00 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.22,418,1449561600"; d="scan'208";a="649216583" Received: from rzwisler-desk.amr.corp.intel.com (HELO linux.intel.com) ([10.254.103.197]) by FMSMGA003.fm.intel.com with ESMTP; 08 Feb 2016 14:06:58 -0800 Date: Mon, 8 Feb 2016 15:06:50 -0700 From: Ross Zwisler To: Dmitry Monakhov Cc: Ross Zwisler , linux-kernel@vger.kernel.org, "H. Peter Anvin" , "J. Bruce Fields" , Theodore Ts'o , Alexander Viro , Andreas Dilger , Andrew Morton , Dan Williams , Dave Chinner , Dave Hansen , Ingo Molnar , Jan Kara , Jeff Layton , Matthew Wilcox , Matthew Wilcox , Thomas Gleixner , linux-ext4@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux-mm@kvack.org, linux-nvdimm@lists.01.org, x86@kernel.org, xfs@oss.sgi.com Subject: Re: [PATCH v8 6/9] dax: add support for fsync/msync Message-ID: <20160208220650.GG2343@linux.intel.com> X-ASG-Orig-Subj: Re: [PATCH v8 6/9] dax: add support for fsync/msync Mail-Followup-To: Ross Zwisler , Dmitry Monakhov , linux-kernel@vger.kernel.org, "H. Peter Anvin" , "J. Bruce Fields" , Theodore Ts'o , Alexander Viro , Andreas Dilger , Andrew Morton , Dan Williams , Dave Chinner , Dave Hansen , Ingo Molnar , Jan Kara , Jeff Layton , Matthew Wilcox , Matthew Wilcox , Thomas Gleixner , linux-ext4@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux-mm@kvack.org, linux-nvdimm@lists.01.org, x86@kernel.org, xfs@oss.sgi.com References: <1452230879-18117-1-git-send-email-ross.zwisler@linux.intel.com> <1452230879-18117-7-git-send-email-ross.zwisler@linux.intel.com> <878u2xrjrw.fsf@openvz.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <878u2xrjrw.fsf@openvz.org> User-Agent: Mutt/1.5.24 (2015-08-30) X-Barracuda-Connect: mga02.intel.com[134.134.136.20] X-Barracuda-Start-Time: 1454969225 X-Barracuda-URL: https://192.48.176.15:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-BRTS-Status: 1 On Sat, Feb 06, 2016 at 05:33:07PM +0300, Dmitry Monakhov wrote: > Ross Zwisler writes: <> > > +static int dax_radix_entry(struct address_space *mapping, pgoff_t index, > IMHO it would be sane to call that function as dax_radix_entry_insert() I think I may have actually had it named that at some point. :) I changed it because it doesn't always insert an entry - in the read case for example we insert a clean entry, and then on the following dax_pfn_mkwrite() we call back in and mark it as dirty. <> > > +/* > > + * Flush the mapping to the persistent domain within the byte range of [start, > > + * end]. This is required by data integrity operations to ensure file data is > > + * on persistent storage prior to completion of the operation. > > + */ > > +int dax_writeback_mapping_range(struct address_space *mapping, loff_t start, > > + loff_t end) > > +{ > > + struct inode *inode = mapping->host; > > + struct block_device *bdev = inode->i_sb->s_bdev; > > + pgoff_t indices[PAGEVEC_SIZE]; > > + pgoff_t start_page, end_page; > > + struct pagevec pvec; > > + void *entry; > > + int i, ret = 0; > > + > > + if (WARN_ON_ONCE(inode->i_blkbits != PAGE_SHIFT)) > > + return -EIO; > > + > > + rcu_read_lock(); > > + entry = radix_tree_lookup(&mapping->page_tree, start & PMD_MASK); > > + rcu_read_unlock(); > > + > > + /* see if the start of our range is covered by a PMD entry */ > > + if (entry && RADIX_DAX_TYPE(entry) == RADIX_DAX_PMD) > > + start &= PMD_MASK; > > + > > + start_page = start >> PAGE_CACHE_SHIFT; > > + end_page = end >> PAGE_CACHE_SHIFT; > > + > > + tag_pages_for_writeback(mapping, start_page, end_page); > > + > > + pagevec_init(&pvec, 0); > > + while (1) { > > + pvec.nr = find_get_entries_tag(mapping, start_page, > > + PAGECACHE_TAG_TOWRITE, PAGEVEC_SIZE, > > + pvec.pages, indices); > > + > > + if (pvec.nr == 0) > > + break; > > + > > + for (i = 0; i < pvec.nr; i++) { > > + ret = dax_writeback_one(bdev, mapping, indices[i], > > + pvec.pages[i]); > > + if (ret < 0) > > + return ret; > > + } > I think it would be more efficient to use batched locking like follows: > spin_lock_irq(&mapping->tree_lock); > for (i = 0; i < pvec.nr; i++) { > struct blk_dax_ctl dax[PAGEVEC_SIZE]; > radix_tree_tag_clear(page_tree, indices[i], PAGECACHE_TAG_TOWRITE); > /* It is also reasonable to merge adjacent dax > * regions in to one */ > dax[i].sector = RADIX_DAX_SECTOR(entry); > dax[i].size = (type == RADIX_DAX_PMD ? PMD_SIZE : PAGE_SIZE); > > } > spin_unlock_irq(&mapping->tree_lock); > if (blk_queue_enter(q, true) != 0) > goto error; > for (i = 0; i < pvec.nr; i++) { > rc = bdev_direct_access(bdev, dax[i]); > wb_cache_pmem(dax[i].addr, dax[i].size); > } > ret = blk_queue_exit(q, true) I guess this could be more efficient, but as Jan said in his response we're currently focused on correctness. I also wonder if it would be measurably better? In any case, Jan is right - you have to clear the TOWRITE tag only after you've flushed, and you also need to include the entry verification code from dax_writeback_one() after you grab the tree lock. Basically, I believe all the code in dax_writeback_one() is needed - this change would essentially just be inlining that code in dax_writeback_mapping_range() so you could do multiple operations without giving up a lock. From david@fromorbit.com Mon Feb 8 16:31:55 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=ham version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay2.corp.sgi.com [137.38.102.29]) by oss.sgi.com (Postfix) with ESMTP id 63FB57CA2 for ; Mon, 8 Feb 2016 16:31:55 -0600 (CST) Received: from cuda.sgi.com (cuda2.sgi.com [192.48.176.25]) by relay2.corp.sgi.com (Postfix) with ESMTP id 43802304039 for ; Mon, 8 Feb 2016 14:31:55 -0800 (PST) X-ASG-Debug-ID: 1454970712-04cbb04cf917b410001-NocioJ Received: from ipmail06.adl2.internode.on.net (ipmail06.adl2.internode.on.net [150.101.137.129]) by cuda.sgi.com with ESMTP id cwZwws2tVEs8G40A for ; Mon, 08 Feb 2016 14:31:52 -0800 (PST) X-Barracuda-Envelope-From: david@fromorbit.com X-Barracuda-Apparent-Source-IP: 150.101.137.129 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: A2CUCADFFrlWPBATLHleKAECgw+BP4ZjgXidTgaLZoVEhAeGBwQCAoEuTQEBAQEBAQcBAQEBQT+EQQEBAQMBJxMcIwULCAMOCgklDwUlAwcaE4gTB74AAQEIAh4YhTKEf4hsBZJuhAeNR4Fkh2mFL0SNeoRaKC6IUwEBAQ Received: from ppp121-44-19-16.lns20.syd4.internode.on.net (HELO dastard) ([121.44.19.16]) by ipmail06.adl2.internode.on.net with ESMTP; 09 Feb 2016 09:01:21 +1030 Received: from dave by dastard with local (Exim 4.80) (envelope-from ) id 1aSuL2-00017q-RC; Tue, 09 Feb 2016 09:31:20 +1100 Date: Tue, 9 Feb 2016 09:31:20 +1100 From: Dave Chinner To: Christoph Hellwig Cc: xfs@oss.sgi.com Subject: Re: [PATCH 6/6] xfs: rename XFS_BUF_ZEROFLAGS macro Message-ID: <20160208223120.GM27429@dastard> X-ASG-Orig-Subj: Re: [PATCH 6/6] xfs: rename XFS_BUF_ZEROFLAGS macro References: <1454632683-20543-1-git-send-email-david@fromorbit.com> <1454632683-20543-7-git-send-email-david@fromorbit.com> <20160208091235.GN5534@infradead.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20160208091235.GN5534@infradead.org> User-Agent: Mutt/1.5.21 (2010-09-15) X-Barracuda-Connect: ipmail06.adl2.internode.on.net[150.101.137.129] X-Barracuda-Start-Time: 1454970712 X-Barracuda-URL: https://192.48.176.25:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-BRTS-Status: 1 X-Barracuda-Spam-Score: 0.00 X-Barracuda-Spam-Status: No, SCORE=0.00 using per-user scores of TAG_LEVEL=1000.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.7 tests=BSF_SC0_MISMATCH_TO X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.3.26869 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 0.00 BSF_SC0_MISMATCH_TO Envelope rcpt doesn't match header On Mon, Feb 08, 2016 at 01:12:36AM -0800, Christoph Hellwig wrote: > Instead of just renaming it I'd rather dig deeper. > > In xlog_bwrite we call xfs_bwrite, which already handles all flag > clearing, so the call to XFS_BUF_ZEROFLAGS can just > be removed. Done. > xlog_sync already sets a lot of these flags again, and is called on an > iclog buffer which never has the READ or XBF_WRITE_FAIL set, so just > replacing it with an opencoded > > bp->b_flags &= (XBF_FUA | XBF_FLUSH); We can't do that because there are internal flags like _XBF_PAGES that are set on log buffers. Clearing such flags will cause problems when the iclog buffer is finally released on unmount. Hence I'd prefer to keep the code as it stands. Cheers, Dave. -- Dave Chinner david@fromorbit.com From david@fromorbit.com Mon Feb 8 16:59:09 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=ham version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay2.corp.sgi.com [137.38.102.29]) by oss.sgi.com (Postfix) with ESMTP id 27FA27CA2 for ; Mon, 8 Feb 2016 16:59:09 -0600 (CST) Received: from cuda.sgi.com (cuda2.sgi.com [192.48.176.25]) by relay2.corp.sgi.com (Postfix) with ESMTP id 0892F304032 for ; Mon, 8 Feb 2016 14:59:08 -0800 (PST) X-ASG-Debug-ID: 1454972343-04cbb04cfc17d150001-NocioJ Received: from ipmail06.adl2.internode.on.net (ipmail06.adl2.internode.on.net [150.101.137.129]) by cuda.sgi.com with ESMTP id f8sxAfKVFGBeyO2B for ; Mon, 08 Feb 2016 14:59:03 -0800 (PST) X-Barracuda-Envelope-From: david@fromorbit.com X-Barracuda-Apparent-Source-IP: 150.101.137.129 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: A2DrCACYHLlWPBATLHleKAECgw+BP4ZjgXidTgaLZoVEhAeGBwICAQECgSxNAQEBAQEBBwEBAQFBP4RCAQEEJxMcIxAIEQcMJQ8FJQMHGhOIGr19AQEBBwIBHRiFMo1rBZZ1jUeOfESNeoJlGYFcKC6IUwEBAQ Received: from ppp121-44-19-16.lns20.syd4.internode.on.net (HELO dastard) ([121.44.19.16]) by ipmail06.adl2.internode.on.net with ESMTP; 09 Feb 2016 09:29:02 +1030 Received: from dave by dastard with local (Exim 4.80) (envelope-from ) id 1aSulp-0001BE-Kk; Tue, 09 Feb 2016 09:59:01 +1100 Date: Tue, 9 Feb 2016 09:59:01 +1100 From: Dave Chinner To: Christoph Hellwig Cc: xfs@oss.sgi.com Subject: [PATCH 6/6 v2] xfs: rename XFS_BUF_ZEROFLAGS macro Message-ID: <20160208225901.GN27429@dastard> X-ASG-Orig-Subj: [PATCH 6/6 v2] xfs: rename XFS_BUF_ZEROFLAGS macro References: <1454632683-20543-1-git-send-email-david@fromorbit.com> <1454632683-20543-7-git-send-email-david@fromorbit.com> <20160208091235.GN5534@infradead.org> <20160208223120.GM27429@dastard> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20160208223120.GM27429@dastard> User-Agent: Mutt/1.5.21 (2010-09-15) X-Barracuda-Connect: ipmail06.adl2.internode.on.net[150.101.137.129] X-Barracuda-Start-Time: 1454972343 X-Barracuda-URL: https://192.48.176.25:443/cgi-mod/mark.cgi X-Barracuda-BRTS-Status: 1 X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-Spam-Score: 0.00 X-Barracuda-Spam-Status: No, SCORE=0.00 using per-user scores of TAG_LEVEL=1000.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.7 tests=BSF_SC0_MISMATCH_TO X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.3.26870 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 0.00 BSF_SC0_MISMATCH_TO Envelope rcpt doesn't match header From: Dave Chinner This macro is really clearing the IO flags from the buffer. Rename it appropriately and turn it into a static inline to get rid of the shoutiness. Signed-off-by: Dave Chinner --- V2 - kill call from xlog_bwrite completely as xfs_bwrite() takes care of clearing the flags appropriately. fs/xfs/xfs_buf.h | 10 ++++++---- fs/xfs/xfs_log.c | 4 ++-- fs/xfs/xfs_log_recover.c | 1 - 3 files changed, 8 insertions(+), 7 deletions(-) diff --git a/fs/xfs/xfs_buf.h b/fs/xfs/xfs_buf.h index 98b7ee9..0735096 100644 --- a/fs/xfs/xfs_buf.h +++ b/fs/xfs/xfs_buf.h @@ -313,10 +313,12 @@ extern int xfs_buf_delwri_submit_nowait(struct list_head *); extern int xfs_buf_init(void); extern void xfs_buf_terminate(void); -#define XFS_BUF_ZEROFLAGS(bp) \ - ((bp)->b_flags &= ~(XBF_READ|XBF_WRITE|XBF_ASYNC| \ - XBF_SYNCIO|XBF_FUA|XBF_FLUSH| \ - XBF_WRITE_FAIL)) +static inline void xfs_buf_clear_ioflags(struct xfs_buf *bp) +{ + bp->b_flags &= ~(XBF_READ | XBF_WRITE | XBF_ASYNC | + XBF_SYNCIO | XBF_FUA | XBF_FLUSH | + XBF_WRITE_FAIL); +} /* diff --git a/fs/xfs/xfs_log.c b/fs/xfs/xfs_log.c index edf20b2..185d1b0 100644 --- a/fs/xfs/xfs_log.c +++ b/fs/xfs/xfs_log.c @@ -1864,7 +1864,7 @@ xlog_sync( bp->b_io_length = BTOBB(count); bp->b_fspriv = iclog; - XFS_BUF_ZEROFLAGS(bp); + xfs_buf_clear_ioflags(bp); bp->b_flags |= (XBF_ASYNC | XBF_SYNCIO | XBF_WRITE); if (log->l_mp->m_flags & XFS_MOUNT_BARRIER) { @@ -1908,7 +1908,7 @@ xlog_sync( xfs_buf_associate_memory(bp, (char *)&iclog->ic_header + count, split); bp->b_fspriv = iclog; - XFS_BUF_ZEROFLAGS(bp); + xfs_buf_clear_ioflags(bp); bp->b_flags |= (XBF_ASYNC | XBF_SYNCIO | XBF_WRITE); if (log->l_mp->m_flags & XFS_MOUNT_BARRIER) bp->b_flags |= XBF_FUA; diff --git a/fs/xfs/xfs_log_recover.c b/fs/xfs/xfs_log_recover.c index bee2257..23ad143 100644 --- a/fs/xfs/xfs_log_recover.c +++ b/fs/xfs/xfs_log_recover.c @@ -275,7 +275,6 @@ xlog_bwrite( ASSERT(nbblks <= bp->b_length); XFS_BUF_SET_ADDR(bp, log->l_logBBstart + blk_no); - XFS_BUF_ZEROFLAGS(bp); xfs_buf_hold(bp); xfs_buf_lock(bp); bp->b_io_length = nbblks; -- Dave Chinner david@fromorbit.com From david@fromorbit.com Mon Feb 8 17:33:57 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=ham version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay1.corp.sgi.com [137.38.102.111]) by oss.sgi.com (Postfix) with ESMTP id E76477CA2 for ; Mon, 8 Feb 2016 17:33:57 -0600 (CST) Received: from cuda.sgi.com (cuda2.sgi.com [192.48.176.25]) by relay1.corp.sgi.com (Postfix) with ESMTP id DD3BF8F8033 for ; Mon, 8 Feb 2016 15:33:54 -0800 (PST) X-ASG-Debug-ID: 1454974432-04cbb04cfc17f3e0001-NocioJ Received: from ipmail06.adl2.internode.on.net (ipmail06.adl2.internode.on.net [150.101.137.129]) by cuda.sgi.com with ESMTP id uBzTebMpZKglB7Rm for ; Mon, 08 Feb 2016 15:33:52 -0800 (PST) X-Barracuda-Envelope-From: david@fromorbit.com X-Barracuda-Apparent-Source-IP: 150.101.137.129 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: A2DrCAALJblWPBATLHleKAECgw+BP4ZjgXidTgaLZoVEhAeGBwICAQECgS1NAQEBAQEBBwEBAQFBP4RCAQEEJxMcIxAIEQcMJQ8FJQMHGhOIGr1+AQEIAh4YhTKNawWWdY1HjnoCRI16hFooLohTAQEB Received: from ppp121-44-19-16.lns20.syd4.internode.on.net (HELO dastard) ([121.44.19.16]) by ipmail06.adl2.internode.on.net with ESMTP; 09 Feb 2016 10:03:51 +1030 Received: from dave by dastard with local (Exim 4.80) (envelope-from ) id 1aSvJW-0001Fh-Oi; Tue, 09 Feb 2016 10:33:50 +1100 Date: Tue, 9 Feb 2016 10:33:50 +1100 From: Dave Chinner To: Brian Foster Cc: xfs@oss.sgi.com Subject: [PATCH] xfs: log recovery needs to be aware of CONFIG_XFS_RT now Message-ID: <20160208233350.GO27429@dastard> X-ASG-Orig-Subj: [PATCH] xfs: log recovery needs to be aware of CONFIG_XFS_RT now References: <20160208060751.GA27429@dastard> <20160208153720.GG19597@bfoster.bfoster> <20160208195253.GI27429@dastard> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20160208195253.GI27429@dastard> User-Agent: Mutt/1.5.21 (2010-09-15) X-Barracuda-Connect: ipmail06.adl2.internode.on.net[150.101.137.129] X-Barracuda-Start-Time: 1454974432 X-Barracuda-URL: https://192.48.176.25:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-BRTS-Status: 1 X-Barracuda-Spam-Score: 0.00 X-Barracuda-Spam-Status: No, SCORE=0.00 using per-user scores of TAG_LEVEL=1000.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.7 tests=BSF_SC0_MISMATCH_TO X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.3.26871 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 0.00 BSF_SC0_MISMATCH_TO Envelope rcpt doesn't match header From: Dave Chinner As it uses buffer verifiers that only exist when CONFIG_XFS_RT=y. Signed-off-by: Dave Chinner --- Note: I will fold this back into the original patch that caused this build regression and rebuild the for-next tree. fs/xfs/xfs_log_recover.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/fs/xfs/xfs_log_recover.c b/fs/xfs/xfs_log_recover.c index 23ad143..1dc0e14 100644 --- a/fs/xfs/xfs_log_recover.c +++ b/fs/xfs/xfs_log_recover.c @@ -2472,11 +2472,13 @@ xlog_recover_validate_buf_type( } bp->b_ops = &xfs_sb_buf_ops; break; +#ifdef CONFIG_XFS_RT case XFS_BLFT_RTBITMAP_BUF: case XFS_BLFT_RTSUMMARY_BUF: /* no magic numbers for verification of RT buffers */ bp->b_ops = &xfs_rtbuf_ops; break; +#endif /* CONFIG_XFS_RT */ default: xfs_warn(mp, "Unknown buffer type %d!", xfs_blft_from_flags(buf_f)); From david@fromorbit.com Mon Feb 8 18:12:54 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=ham version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay2.corp.sgi.com [137.38.102.29]) by oss.sgi.com (Postfix) with ESMTP id A419B7CA2 for ; Mon, 8 Feb 2016 18:12:54 -0600 (CST) Received: from cuda.sgi.com (cuda1.sgi.com [192.48.157.11]) by relay2.corp.sgi.com (Postfix) with ESMTP id 83408304032 for ; Mon, 8 Feb 2016 16:12:51 -0800 (PST) X-ASG-Debug-ID: 1454976765-04bdf066ea00ce0001-NocioJ Received: from ipmail06.adl2.internode.on.net (ipmail06.adl2.internode.on.net [150.101.137.129]) by cuda.sgi.com with ESMTP id Eu3siw81xhqgGyRs for ; Mon, 08 Feb 2016 16:12:45 -0800 (PST) X-Barracuda-Envelope-From: david@fromorbit.com X-Barracuda-Apparent-Source-IP: 150.101.137.129 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: A2CTCABPLrlWPBATLHleKAECgw+BP4ZjgXidTgaLZoVEhAeGBwQCAoEwTQEBAQEBAQcBAQEBQT+EQgEBBCcTHCMQCAMOCgklDwUlAwcaE4gavX8BCx4YhTKEf4hsAQSWdY1HjnyOPoRaKC6IUwEBAQ Received: from ppp121-44-19-16.lns20.syd4.internode.on.net (HELO dastard) ([121.44.19.16]) by ipmail06.adl2.internode.on.net with ESMTP; 09 Feb 2016 10:42:35 +1030 Received: from dave by dastard with local (Exim 4.80) (envelope-from ) id 1aSvv1-0001Mq-0Z; Tue, 09 Feb 2016 11:12:35 +1100 Date: Tue, 9 Feb 2016 11:12:34 +1100 From: Dave Chinner To: Christoph Hellwig Cc: xfs@oss.sgi.com Subject: Re: [PATCH 1/7] repair: parallelise phase 7 Message-ID: <20160209001234.GP27429@dastard> X-ASG-Orig-Subj: Re: [PATCH 1/7] repair: parallelise phase 7 References: <1454627108-19036-1-git-send-email-david@fromorbit.com> <1454627108-19036-2-git-send-email-david@fromorbit.com> <20160208085555.GD5534@infradead.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20160208085555.GD5534@infradead.org> User-Agent: Mutt/1.5.21 (2010-09-15) X-Barracuda-Connect: ipmail06.adl2.internode.on.net[150.101.137.129] X-Barracuda-Start-Time: 1454976765 X-Barracuda-URL: https://192.48.157.11:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-BRTS-Status: 1 X-Barracuda-Spam-Score: 0.00 X-Barracuda-Spam-Status: No, SCORE=0.00 using per-user scores of TAG_LEVEL=1000.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.7 tests=BSF_SC0_MISMATCH_TO X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.3.26872 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 0.00 BSF_SC0_MISMATCH_TO Envelope rcpt doesn't match header On Mon, Feb 08, 2016 at 12:55:55AM -0800, Christoph Hellwig wrote: > > + irec = findfirst_inode_rec(agno); > > + > > + while (irec != NULL) { > > + for (j = 0; j < XFS_INODES_PER_CHUNK; j++) { > > + ASSERT(is_inode_confirmed(irec, j)); > > + > > + if (is_inode_free(irec, j)) > > + continue; > > + > > + ASSERT(no_modify || is_inode_reached(irec, j)); > > + > > + nrefs = num_inode_references(irec, j); > > + ASSERT(no_modify || nrefs > 0); > > + > > + if (get_inode_disk_nlinks(irec, j) != nrefs) > > + update_inode_nlinks(wq->mp, > > + XFS_AGINO_TO_INO(wq->mp, agno, > > + irec->ino_startnum + j), > > + nrefs); > > + } > > + irec = next_ino_rec(irec); > > Wouldn't this look be slightly cleaner as: > > for (irec = findfirst_inode_rec(agno); > irec; > irec = next_ino_rec(irec)) { Yup, done. Cheers, Dave. -- Dave Chinner david@fromorbit.com From sfr@canb.auug.org.au Mon Feb 8 18:17:47 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=T_DKIM_INVALID autolearn=ham version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay1.corp.sgi.com [137.38.102.111]) by oss.sgi.com (Postfix) with ESMTP id 799E57CA2 for ; Mon, 8 Feb 2016 18:17:47 -0600 (CST) Received: from cuda.sgi.com (cuda3.sgi.com [192.48.176.15]) by relay1.corp.sgi.com (Postfix) with ESMTP id 261058F8033 for ; Mon, 8 Feb 2016 16:17:46 -0800 (PST) X-ASG-Debug-ID: 1454977043-04cb6c1e5900fd0001-NocioJ Received: from ozlabs.org (ozlabs.org [103.22.144.67]) by cuda.sgi.com with ESMTP id 65txMuKWGWDu4ZB9 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO) for ; Mon, 08 Feb 2016 16:17:24 -0800 (PST) X-Barracuda-Envelope-From: sfr@canb.auug.org.au X-Barracuda-Apparent-Source-IP: 103.22.144.67 Received: from authenticated.ozlabs.org (localhost [127.0.0.1]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPSA id 9BD9C14031D; Tue, 9 Feb 2016 11:17:21 +1100 (AEDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=canb.auug.org.au; s=201601; t=1454977041; bh=XQmOQyaM85VJBjqaDdWWNx9ZPEzOIrji0dQwZY9VBkc=; h=Date:From:To:Cc:Subject:From; b=Zm0VPMCd9KSJ8gGQP6/EO8lgxj+kTT4vwOf0iMwfG4FmHW2NF1Yogpn1bvIR8NKX1 oXhIsu8222DY0IKobLugbs8z5QdsMrt46evCIU6fxZO/3l/pB0GIjRfT87bquv5IfO NCBVhcv5ekl06DEEe8pzbkcEBy8bjrvHUCvS5MiE= Date: Tue, 9 Feb 2016 11:17:21 +1100 From: Stephen Rothwell To: Ben Myers , David Chinner , xfs@oss.sgi.com Cc: linux-next@vger.kernel.org, linux-kernel@vger.kernel.org Subject: linux-next: build failure after merge of the xfs tree Message-ID: <20160209111721.359f8558@canb.auug.org.au> X-ASG-Orig-Subj: linux-next: build failure after merge of the xfs tree MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Barracuda-Connect: ozlabs.org[103.22.144.67] X-Barracuda-Start-Time: 1454977044 X-Barracuda-Encrypted: ECDHE-RSA-AES256-GCM-SHA384 X-Barracuda-URL: https://192.48.176.15:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-BRTS-Status: 1 X-Barracuda-Spam-Score: 0.00 X-Barracuda-Spam-Status: No, SCORE=0.00 using per-user scores of TAG_LEVEL=1000.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.7 tests=BSF_SC0_MISMATCH_TO, DKIM_SIGNED, DKIM_VERIFIED X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.3.26873 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 0.00 BSF_SC0_MISMATCH_TO Envelope rcpt doesn't match header -0.00 DKIM_VERIFIED Domain Keys Identified Mail: signature passes verification 0.00 DKIM_SIGNED Domain Keys Identified Mail: message has a signature Hi all, After merging the xfs tree, today's linux-next build (powerpc ppc64_defconfig) failed like this: ERROR: "xfs_rtbuf_ops" [fs/xfs/xfs.ko] undefined! Caused by commit ca4de5c7e86a ("xfs: RT bitmap and summary buffers need verifiers") CONFIG_XFS_RT is not set for this build. I have used the xfs tree from next-20160208 for today. -- Cheers, Stephen Rothwell From sandeen@sandeen.net Mon Feb 8 18:30:45 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=ham version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay2.corp.sgi.com [137.38.102.29]) by oss.sgi.com (Postfix) with ESMTP id D775F7CA2 for ; Mon, 8 Feb 2016 18:30:45 -0600 (CST) Received: from cuda.sgi.com (cuda1.sgi.com [192.48.157.11]) by relay2.corp.sgi.com (Postfix) with ESMTP id C2153304039 for ; Mon, 8 Feb 2016 16:30:45 -0800 (PST) X-ASG-Debug-ID: 1454977841-04bdf066ed01d70001-NocioJ Received: from sandeen.net (sandeen.net [63.231.237.45]) by cuda.sgi.com with ESMTP id JDqbPsNrvPu8Pkl0 for ; Mon, 08 Feb 2016 16:30:41 -0800 (PST) X-Barracuda-Envelope-From: sandeen@sandeen.net X-Barracuda-Apparent-Source-IP: 63.231.237.45 Received: from liberator.sandeen.net (liberator.sandeen.net [10.0.0.4]) (using TLSv1.2 with cipher DHE-RSA-AES128-SHA (128/128 bits)) (No client certificate requested) by sandeen.net (Postfix) with ESMTPSA id 70B60606A105; Mon, 8 Feb 2016 18:30:41 -0600 (CST) Subject: Re: linux-next: build failure after merge of the xfs tree To: Stephen Rothwell , Ben Myers , David Chinner , xfs@oss.sgi.com X-ASG-Orig-Subj: Re: linux-next: build failure after merge of the xfs tree References: <20160209111721.359f8558@canb.auug.org.au> Cc: linux-next@vger.kernel.org, linux-kernel@vger.kernel.org From: Eric Sandeen Message-ID: <56B93330.20608@sandeen.net> Date: Mon, 8 Feb 2016 18:30:40 -0600 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.11; rv:38.0) Gecko/20100101 Thunderbird/38.5.1 MIME-Version: 1.0 In-Reply-To: <20160209111721.359f8558@canb.auug.org.au> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit X-Barracuda-Connect: sandeen.net[63.231.237.45] X-Barracuda-Start-Time: 1454977841 X-Barracuda-URL: https://192.48.157.11:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-BRTS-Status: 1 X-Barracuda-Spam-Score: 0.00 X-Barracuda-Spam-Status: No, SCORE=0.00 using per-user scores of TAG_LEVEL=1000.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.7 tests=BSF_SC0_MISMATCH_TO X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.3.26873 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 0.00 BSF_SC0_MISMATCH_TO Envelope rcpt doesn't match header Dave just sent a patch to the xfs list to fix this, [PATCH] xfs: log recovery needs to be aware of CONFIG_XFS_RT now Thanks, -Eric On 2/8/16 6:17 PM, Stephen Rothwell wrote: > Hi all, > > After merging the xfs tree, today's linux-next build (powerpc > ppc64_defconfig) failed like this: > > ERROR: "xfs_rtbuf_ops" [fs/xfs/xfs.ko] undefined! > > Caused by commit > > ca4de5c7e86a ("xfs: RT bitmap and summary buffers need verifiers") > > CONFIG_XFS_RT is not set for this build. > > I have used the xfs tree from next-20160208 for today. > From sfr@canb.auug.org.au Mon Feb 8 18:41:07 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=T_DKIM_INVALID autolearn=ham version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay2.corp.sgi.com [137.38.102.29]) by oss.sgi.com (Postfix) with ESMTP id 5BE857CA2 for ; Mon, 8 Feb 2016 18:41:07 -0600 (CST) Received: from cuda.sgi.com (cuda3.sgi.com [192.48.176.15]) by relay2.corp.sgi.com (Postfix) with ESMTP id 472AA304032 for ; Mon, 8 Feb 2016 16:41:07 -0800 (PST) X-ASG-Debug-ID: 1454978463-04cb6c1e5601d20001-NocioJ Received: from ozlabs.org (ozlabs.org [103.22.144.67]) by cuda.sgi.com with ESMTP id cQ6PA9oaFaC8z6tx (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO) for ; Mon, 08 Feb 2016 16:41:04 -0800 (PST) X-Barracuda-Envelope-From: sfr@canb.auug.org.au X-Barracuda-Apparent-Source-IP: 103.22.144.67 Received: from authenticated.ozlabs.org (localhost [127.0.0.1]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPSA id 1C66914031D; Tue, 9 Feb 2016 11:41:03 +1100 (AEDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=canb.auug.org.au; s=201601; t=1454978463; bh=tIgkD8T6Caky+KRntgVkWhPaLK9hHADSDLVgXqUeImg=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=awsspq2HYcVPRYYW+SPEb6eoU2rKFRx4dzj4hwrCh2irkMIs6fZHXDii5ysmD2gJo kA0kpnJRWaDG2Q8VO0CZNLvdN5g6EC7zIBXHTOwmp1ayvcJH4GcTzKtX9wgIHhZ1Am LUm9gpl0BQIf6BgaThtDs3Z6aBln7SerJcce9/uQ= Date: Tue, 9 Feb 2016 11:41:02 +1100 From: Stephen Rothwell To: Eric Sandeen Cc: David Chinner , xfs@oss.sgi.com, linux-next@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: linux-next: build failure after merge of the xfs tree Message-ID: <20160209114102.118fdc02@canb.auug.org.au> X-ASG-Orig-Subj: Re: linux-next: build failure after merge of the xfs tree In-Reply-To: <56B93330.20608@sandeen.net> References: <20160209111721.359f8558@canb.auug.org.au> <56B93330.20608@sandeen.net> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Barracuda-Connect: ozlabs.org[103.22.144.67] X-Barracuda-Start-Time: 1454978464 X-Barracuda-Encrypted: ECDHE-RSA-AES256-GCM-SHA384 X-Barracuda-URL: https://192.48.176.15:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-BRTS-Status: 1 X-Barracuda-Spam-Score: 0.00 X-Barracuda-Spam-Status: No, SCORE=0.00 using per-user scores of TAG_LEVEL=1000.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.7 tests=BSF_SC0_MISMATCH_TO, DKIM_SIGNED, DKIM_VERIFIED X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.3.26873 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 0.00 BSF_SC0_MISMATCH_TO Envelope rcpt doesn't match header -0.00 DKIM_VERIFIED Domain Keys Identified Mail: signature passes verification 0.00 DKIM_SIGNED Domain Keys Identified Mail: message has a signature Hi Eric, On Mon, 8 Feb 2016 18:30:40 -0600 Eric Sandeen wrote: > > Dave just sent a patch to the xfs list to fix this, > > [PATCH] xfs: log recovery needs to be aware of CONFIG_XFS_RT now Thanks. Hopefully it will be fixed in the xfs tree for linux-next tomorrow, then, -- Cheers, Stephen Rothwell From darrick.wong@oracle.com Mon Feb 8 19:12:02 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay3.corp.sgi.com [198.149.34.15]) by oss.sgi.com (Postfix) with ESMTP id 2B7817CA2 for ; Mon, 8 Feb 2016 19:12:02 -0600 (CST) Received: from cuda.sgi.com (cuda2.sgi.com [192.48.176.25]) by relay3.corp.sgi.com (Postfix) with ESMTP id A43AFAC003 for ; Mon, 8 Feb 2016 17:11:58 -0800 (PST) X-ASG-Debug-ID: 1454980315-04cbb0433205920001-NocioJ Received: from userp1040.oracle.com (userp1040.oracle.com [156.151.31.81]) by cuda.sgi.com with ESMTP id MOpETrSfpIKiU6AG (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO) for ; Mon, 08 Feb 2016 17:11:56 -0800 (PST) X-Barracuda-Envelope-From: darrick.wong@oracle.com X-Barracuda-Apparent-Source-IP: 156.151.31.81 Received: from userv0022.oracle.com (userv0022.oracle.com [156.151.31.74]) by userp1040.oracle.com (Sentrion-MTA-4.3.2/Sentrion-MTA-4.3.2) with ESMTP id u191Blgk014121 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 9 Feb 2016 01:11:48 GMT Received: from aserv0121.oracle.com (aserv0121.oracle.com [141.146.126.235]) by userv0022.oracle.com (8.14.4/8.13.8) with ESMTP id u191BlqB007533 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=FAIL); Tue, 9 Feb 2016 01:11:47 GMT Received: from abhmp0002.oracle.com (abhmp0002.oracle.com [141.146.116.8]) by aserv0121.oracle.com (8.13.8/8.13.8) with ESMTP id u191BlHW027371; Tue, 9 Feb 2016 01:11:47 GMT Received: from localhost (/10.145.178.207) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Mon, 08 Feb 2016 17:11:46 -0800 Subject: [PATCH v4.1 00/23] xfstests: test the nfs/cifs/btrfs/xfs reflink/dedupe ioctls From: "Darrick J. Wong" X-ASG-Orig-Subj: [PATCH v4.1 00/23] xfstests: test the nfs/cifs/btrfs/xfs reflink/dedupe ioctls To: david@fromorbit.com, darrick.wong@oracle.com Cc: linux-btrfs@vger.kernel.org, fstests@vger.kernel.org, xfs@oss.sgi.com Date: Mon, 08 Feb 2016 17:11:45 -0800 Message-ID: <20160209011145.23099.95354.stgit@birch.djwong.org> User-Agent: StGit/0.17.1-dirty MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit X-Source-IP: userv0022.oracle.com [156.151.31.74] X-Barracuda-Connect: userp1040.oracle.com[156.151.31.81] X-Barracuda-Start-Time: 1454980316 X-Barracuda-Encrypted: ECDHE-RSA-AES256-GCM-SHA384 X-Barracuda-URL: https://192.48.176.25:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-BRTS-Status: 1 X-Barracuda-Spam-Score: 0.00 X-Barracuda-Spam-Status: No, SCORE=0.00 using per-user scores of TAG_LEVEL=1000.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.7 tests=BSF_SC0_MISMATCH_TO, UNPARSEABLE_RELAY X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.3.26874 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 0.00 BSF_SC0_MISMATCH_TO Envelope rcpt doesn't match header 0.00 UNPARSEABLE_RELAY Informational: message has unparseable relay lines Happy New Year! Dave Chinner: I've renumbered the new tests and pushed to github[3] if you'd like to pull. This is a (no longer) small patch set against the reflink/dedupe test cases in xfstests. The first four patches fix errors in the existing reflink tests, some of which are from Christoph Hellwig. Patches 5-6 refactor the dmerror code so that we can use it to simulate transient IO errors, then use this code to test that unwritten extent conversion does NOT happen after a directio write to an unwritten extent hits a disk error. Due to a bug in the VFS directio code, ext4 can disclose stale disk contents if an aio dio write fails; XFS suffers this problem for any failing dio write to an unwritten extent. Christoph's kernel patchset titled "vfs/xfs: directio updates to ease COW handling V2" (and a separate ext4 warning cleanup) is needed to fix this. Patches 7-9, 13, 15, 17, 18, 20, 21, and 23 exercise various parts of the copy on write behavior that are necessary to support shared blocks. The earlier patches focus on correct CoW behavior in the presence of IO errors during the copy-write, and the later patches focus on XFS' new cow-extent-size hint that greatly reduces fragmentation due to copy on write behavior by encouraging the allocator to allocate larger extents of replacement blocks. Patches 10-12 and 14 perform stress testing on reflink and CoW to check the behaviors when we get close to maximum refcount, when we specify obnxiously large offsets and lengths, and when we try to reflink millions of extents at a time. Patch 16 tests quota accounting behavior when reflink is enabled. Patch 19 adds a few tests for the XFS reverse mapping btree to ensure that things like metadump and growfs work correctly. Patch 22 checks that get_bmapx and fiemap (on XFS) correctly flag extents as having shared blocks. XFS now follows btrfs and ocfs2 FIEMAP behavior such that if any blocks of a file's extent are shared, the whole extent is marked shared. This is in contrast to earlier XFS-only behavior that reported shared and non-shared regions as separate extents. If you're going to start using this mess, you probably ought to just pull from my github trees for kernel[1], xfsprogs[2], xfstests[3], xfs-docs[4], and man-pages[5]. All tests should pass on XFS. I tried btrfs this weekend and it failed 166, 175, 182, 266, 271, 272, 278, 281, 297, 298, 304, 333, and 334. ocfs2 (when I jury-rigged it to run the cp_reflink tests) seemed to have a quota bug and crashes hard in 284 (but was otherwise fine). Comments and questions are, as always, welcome. --D [1] https://github.com/djwong/linux/tree/for-dave [2] https://github.com/djwong/xfsprogs/tree/for-dave [3] https://github.com/djwong/xfstests/tree/for-dave [4] https://github.com/djwong/xfs-documentation/tree/for-dave [5] https://github.com/djwong/man-pages/commits/for-mtk From darrick.wong@oracle.com Mon Feb 8 19:12:03 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay3.corp.sgi.com [198.149.34.15]) by oss.sgi.com (Postfix) with ESMTP id 0613F7CA3 for ; Mon, 8 Feb 2016 19:12:03 -0600 (CST) Received: from cuda.sgi.com (cuda1.sgi.com [192.48.157.11]) by relay3.corp.sgi.com (Postfix) with ESMTP id 9E0C6AC004 for ; Mon, 8 Feb 2016 17:12:02 -0800 (PST) X-ASG-Debug-ID: 1454980320-04bdf066ec03ac0001-NocioJ Received: from userp1040.oracle.com (userp1040.oracle.com [156.151.31.81]) by cuda.sgi.com with ESMTP id 8aZIblvkKgpx6kqB (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO) for ; Mon, 08 Feb 2016 17:12:01 -0800 (PST) X-Barracuda-Envelope-From: darrick.wong@oracle.com X-Barracuda-Apparent-Source-IP: 156.151.31.81 Received: from userv0022.oracle.com (userv0022.oracle.com [156.151.31.74]) by userp1040.oracle.com (Sentrion-MTA-4.3.2/Sentrion-MTA-4.3.2) with ESMTP id u191Bsms014215 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 9 Feb 2016 01:11:54 GMT Received: from aserv0121.oracle.com (aserv0121.oracle.com [141.146.126.235]) by userv0022.oracle.com (8.14.4/8.13.8) with ESMTP id u191BrPV007782 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=FAIL); Tue, 9 Feb 2016 01:11:53 GMT Received: from abhmp0012.oracle.com (abhmp0012.oracle.com [141.146.116.18]) by aserv0121.oracle.com (8.13.8/8.13.8) with ESMTP id u191Brkl027379; Tue, 9 Feb 2016 01:11:53 GMT Received: from localhost (/10.145.178.207) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Mon, 08 Feb 2016 17:11:53 -0800 Subject: [PATCH 01/23] generic/182: this is a dedupe test, check for dedupe From: "Darrick J. Wong" X-ASG-Orig-Subj: [PATCH 01/23] generic/182: this is a dedupe test, check for dedupe To: david@fromorbit.com, darrick.wong@oracle.com Cc: linux-btrfs@vger.kernel.org, Christoph Hellwig , fstests@vger.kernel.org, xfs@oss.sgi.com Date: Mon, 08 Feb 2016 17:11:51 -0800 Message-ID: <20160209011151.23099.17497.stgit@birch.djwong.org> In-Reply-To: <20160209011145.23099.95354.stgit@birch.djwong.org> References: <20160209011145.23099.95354.stgit@birch.djwong.org> User-Agent: StGit/0.17.1-dirty MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit X-Source-IP: userv0022.oracle.com [156.151.31.74] X-Barracuda-Connect: userp1040.oracle.com[156.151.31.81] X-Barracuda-Start-Time: 1454980320 X-Barracuda-Encrypted: ECDHE-RSA-AES256-GCM-SHA384 X-Barracuda-URL: https://192.48.157.11:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-BRTS-Status: 1 X-Barracuda-Spam-Score: 0.60 X-Barracuda-Spam-Status: No, SCORE=0.60 using per-user scores of TAG_LEVEL=1000.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.7 tests=BSF_SC0_MISMATCH_TO, MARKETING_SUBJECT, UNPARSEABLE_RELAY X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.3.26874 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 0.60 MARKETING_SUBJECT Subject contains popular marketing words 0.00 BSF_SC0_MISMATCH_TO Envelope rcpt doesn't match header 0.00 UNPARSEABLE_RELAY Informational: message has unparseable relay lines Since this test examines dedupe behavior, the documentation should say 'dedupe', not 'reflink'. Furthermore, the feature checks must look for working dedupe functionality, not reflink functionality. Signed-off-by: Darrick J. Wong [hch@lst.de: add the test for dedupe support] Signed-off-by: Christoph Hellwig --- tests/generic/182 | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/tests/generic/182 b/tests/generic/182 index bf5cd38..ef10af8 100755 --- a/tests/generic/182 +++ b/tests/generic/182 @@ -1,10 +1,10 @@ #! /bin/bash # FS QA Test No. 182 # -# Test the convention that reflink with length == 0 means "to the end of fileA" +# Test the convention that dedupe with length == 0 means "to the end of fileA" # - Create a file. -# - Try to reflink "zero" bytes (which means reflink to EOF). -# - Check that the reflink happened. +# - Try to dedupe "zero" bytes (which means dedupe to EOF). +# - Check that the dedupe happened. # #----------------------------------------------------------------------- # Copyright (c) 2015, Oracle and/or its affiliates. All Rights Reserved. @@ -45,8 +45,7 @@ _cleanup() # real QA test starts here _supported_os Linux -_require_test_reflink -_require_cp_reflink +_require_test_dedupe rm -f "$seqres.full" From darrick.wong@oracle.com Mon Feb 8 19:12:10 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay3.corp.sgi.com [198.149.34.15]) by oss.sgi.com (Postfix) with ESMTP id CE3327CA2 for ; Mon, 8 Feb 2016 19:12:09 -0600 (CST) Received: from cuda.sgi.com (cuda3.sgi.com [192.48.176.15]) by relay3.corp.sgi.com (Postfix) with ESMTP id 5279CAC004 for ; Mon, 8 Feb 2016 17:12:09 -0800 (PST) X-ASG-Debug-ID: 1454980326-04cb6c1e5903540001-NocioJ Received: from userp1040.oracle.com (userp1040.oracle.com [156.151.31.81]) by cuda.sgi.com with ESMTP id c3T3mTJMt2DxCPOk (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO) for ; Mon, 08 Feb 2016 17:12:07 -0800 (PST) X-Barracuda-Envelope-From: darrick.wong@oracle.com X-Barracuda-Apparent-Source-IP: 156.151.31.81 Received: from aserv0022.oracle.com (aserv0022.oracle.com [141.146.126.234]) by userp1040.oracle.com (Sentrion-MTA-4.3.2/Sentrion-MTA-4.3.2) with ESMTP id u191C0PW014237 (version=TLSv1 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Tue, 9 Feb 2016 01:12:00 GMT Received: from aserv0122.oracle.com (aserv0122.oracle.com [141.146.126.236]) by aserv0022.oracle.com (8.13.8/8.13.8) with ESMTP id u191Bx0t012069 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=FAIL); Tue, 9 Feb 2016 01:12:00 GMT Received: from abhmp0008.oracle.com (abhmp0008.oracle.com [141.146.116.14]) by aserv0122.oracle.com (8.13.8/8.13.8) with ESMTP id u191BxHj027486; Tue, 9 Feb 2016 01:11:59 GMT Received: from localhost (/10.145.178.207) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Mon, 08 Feb 2016 17:11:59 -0800 Subject: [PATCH 02/23] xfstests: filter whitespace in 128 and 132 From: "Darrick J. Wong" X-ASG-Orig-Subj: [PATCH 02/23] xfstests: filter whitespace in 128 and 132 To: david@fromorbit.com, darrick.wong@oracle.com Cc: linux-btrfs@vger.kernel.org, Christoph Hellwig , fstests@vger.kernel.org, xfs@oss.sgi.com Date: Mon, 08 Feb 2016 17:11:58 -0800 Message-ID: <20160209011158.23099.47980.stgit@birch.djwong.org> In-Reply-To: <20160209011145.23099.95354.stgit@birch.djwong.org> References: <20160209011145.23099.95354.stgit@birch.djwong.org> User-Agent: StGit/0.17.1-dirty MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit X-Source-IP: aserv0022.oracle.com [141.146.126.234] X-Barracuda-Connect: userp1040.oracle.com[156.151.31.81] X-Barracuda-Start-Time: 1454980327 X-Barracuda-Encrypted: ECDHE-RSA-AES256-GCM-SHA384 X-Barracuda-URL: https://192.48.176.15:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-BRTS-Status: 1 X-Barracuda-Spam-Score: 0.00 X-Barracuda-Spam-Status: No, SCORE=0.00 using per-user scores of TAG_LEVEL=1000.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.7 tests=BSF_SC0_MISMATCH_TO, UNPARSEABLE_RELAY X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.3.26874 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 0.00 BSF_SC0_MISMATCH_TO Envelope rcpt doesn't match header 0.00 UNPARSEABLE_RELAY Informational: message has unparseable relay lines Seems either I have a different lsattr version, or different mount points cause differences in the golden output. Send the lsattr output through the whitespaces filter so that it works everywhere. The lsattr output /does/ change depending on mountpoints. Ick. I'd actually changed it to the long format output because line length in the short format changes every time the flags change. Signed-off-by: Christoph Hellwig [darrick.wong@oracle.com: update changelog] Signed-off-by: Darrick J. Wong --- tests/xfs/128 | 2 +- tests/xfs/128.out | 8 ++++---- tests/xfs/132 | 10 +++++----- tests/xfs/132.out | 40 ++++++++++++++++++++-------------------- 4 files changed, 30 insertions(+), 30 deletions(-) diff --git a/tests/xfs/128 b/tests/xfs/128 index a96291a..c9547fb 100755 --- a/tests/xfs/128 +++ b/tests/xfs/128 @@ -97,7 +97,7 @@ c13=$(_md5_checksum "$testdir/file3") c14=$(_md5_checksum "$testdir/file4") echo "Defragment" -lsattr -l "$testdir/" | _filter_scratch +lsattr -l "$testdir/" | _filter_scratch | _filter_spaces xfs_fsr -v -d "$testdir/file1" >> "$seqres.full" xfs_fsr -v -d "$testdir/file2" >> "$seqres.full" # fsr probably breaks the link xfs_fsr -v -d "$testdir/file3" >> "$seqres.full" # fsr probably breaks the link diff --git a/tests/xfs/128.out b/tests/xfs/128.out index 7e72dcd..0ac06db 100644 --- a/tests/xfs/128.out +++ b/tests/xfs/128.out @@ -11,10 +11,10 @@ c650f1cf6c9f07b22e3e21ec7d49ded5 SCRATCH_MNT/test-128/file2 56ed2f712c91e035adeeb26ed105a982 SCRATCH_MNT/test-128/file3 b81534f439aac5c34ce3ed60a03eba70 SCRATCH_MNT/test-128/file4 Defragment -SCRATCH_MNT/test-128/file1 --- -SCRATCH_MNT/test-128/file2 --- -SCRATCH_MNT/test-128/file3 --- -SCRATCH_MNT/test-128/file4 --- +SCRATCH_MNT/test-128/file1 --- +SCRATCH_MNT/test-128/file2 --- +SCRATCH_MNT/test-128/file3 --- +SCRATCH_MNT/test-128/file4 --- b81534f439aac5c34ce3ed60a03eba70 SCRATCH_MNT/test-128/file1 c650f1cf6c9f07b22e3e21ec7d49ded5 SCRATCH_MNT/test-128/file2 56ed2f712c91e035adeeb26ed105a982 SCRATCH_MNT/test-128/file3 diff --git a/tests/xfs/132 b/tests/xfs/132 index 79a6d57..9c57c3b 100755 --- a/tests/xfs/132 +++ b/tests/xfs/132 @@ -87,32 +87,32 @@ for i in `seq 2 $nr`; do done _test_remount free_blocks1=$(stat -f "$testdir" -c '%f') -lsattr -l $testdir/ | _filter_test_dir +lsattr -l $testdir/ | _filter_test_dir | _filter_spaces echo "funshare part of a file" "$XFS_IO_PROG" -f -c "falloc 0 $((sz / 2))" "$testdir/file2" _test_remount -lsattr -l $testdir/ | _filter_test_dir +lsattr -l $testdir/ | _filter_test_dir | _filter_spaces echo "funshare some of the copies" "$XFS_IO_PROG" -f -c "falloc 0 $sz" "$testdir/file2" "$XFS_IO_PROG" -f -c "falloc 0 $sz" "$testdir/file3" _test_remount free_blocks2=$(stat -f "$testdir" -c '%f') -lsattr -l $testdir/ | _filter_test_dir +lsattr -l $testdir/ | _filter_test_dir | _filter_spaces echo "funshare the rest of the files" "$XFS_IO_PROG" -f -c "falloc 0 $sz" "$testdir/file4" "$XFS_IO_PROG" -f -c "falloc 0 $sz" "$testdir/file1" _test_remount free_blocks3=$(stat -f "$testdir" -c '%f') -lsattr -l $testdir/ | _filter_test_dir +lsattr -l $testdir/ | _filter_test_dir | _filter_spaces echo "Rewrite the original file" _pwrite_byte 0x65 0 $sz "$testdir/file1" >> "$seqres.full" _test_remount free_blocks4=$(stat -f "$testdir" -c '%f') -lsattr -l $testdir/ | _filter_test_dir +lsattr -l $testdir/ | _filter_test_dir | _filter_spaces #echo $free_blocks0 $free_blocks1 $free_blocks2 $free_blocks3 $free_blocks4 _within_tolerance "free blocks after reflinking" $free_blocks1 $((free_blocks0 - blks)) $margin -v diff --git a/tests/xfs/132.out b/tests/xfs/132.out index fd2b7bd..f32db7d 100644 --- a/tests/xfs/132.out +++ b/tests/xfs/132.out @@ -1,30 +1,30 @@ QA output created by 132 Create the original file blocks Create the reflink copies -TEST_DIR/test-132/file1 --- -TEST_DIR/test-132/file2 --- -TEST_DIR/test-132/file3 --- -TEST_DIR/test-132/file4 --- +TEST_DIR/test-132/file1 --- +TEST_DIR/test-132/file2 --- +TEST_DIR/test-132/file3 --- +TEST_DIR/test-132/file4 --- funshare part of a file -TEST_DIR/test-132/file1 --- -TEST_DIR/test-132/file2 --- -TEST_DIR/test-132/file3 --- -TEST_DIR/test-132/file4 --- +TEST_DIR/test-132/file1 --- +TEST_DIR/test-132/file2 --- +TEST_DIR/test-132/file3 --- +TEST_DIR/test-132/file4 --- funshare some of the copies -TEST_DIR/test-132/file1 --- -TEST_DIR/test-132/file2 No_COW -TEST_DIR/test-132/file3 No_COW -TEST_DIR/test-132/file4 --- +TEST_DIR/test-132/file1 --- +TEST_DIR/test-132/file2 No_COW +TEST_DIR/test-132/file3 No_COW +TEST_DIR/test-132/file4 --- funshare the rest of the files -TEST_DIR/test-132/file1 No_COW -TEST_DIR/test-132/file2 No_COW -TEST_DIR/test-132/file3 No_COW -TEST_DIR/test-132/file4 No_COW +TEST_DIR/test-132/file1 No_COW +TEST_DIR/test-132/file2 No_COW +TEST_DIR/test-132/file3 No_COW +TEST_DIR/test-132/file4 No_COW Rewrite the original file -TEST_DIR/test-132/file1 No_COW -TEST_DIR/test-132/file2 No_COW -TEST_DIR/test-132/file3 No_COW -TEST_DIR/test-132/file4 No_COW +TEST_DIR/test-132/file1 No_COW +TEST_DIR/test-132/file2 No_COW +TEST_DIR/test-132/file3 No_COW +TEST_DIR/test-132/file4 No_COW free blocks after reflinking is in range free blocks after nocow'ing some copies is in range free blocks after nocow'ing all copies is in range From darrick.wong@oracle.com Mon Feb 8 19:12:15 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay1.corp.sgi.com [137.38.102.111]) by oss.sgi.com (Postfix) with ESMTP id 6645129DFE for ; Mon, 8 Feb 2016 19:12:15 -0600 (CST) Received: from cuda.sgi.com (cuda2.sgi.com [192.48.176.25]) by relay1.corp.sgi.com (Postfix) with ESMTP id 5F0CB8F804C for ; Mon, 8 Feb 2016 17:12:15 -0800 (PST) X-ASG-Debug-ID: 1454980333-04cbb0433405930001-NocioJ Received: from userp1040.oracle.com (userp1040.oracle.com [156.151.31.81]) by cuda.sgi.com with ESMTP id nBYdxa4DTB60EaUA (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO) for ; Mon, 08 Feb 2016 17:12:13 -0800 (PST) X-Barracuda-Envelope-From: darrick.wong@oracle.com X-Barracuda-Apparent-Source-IP: 156.151.31.81 Received: from userv0021.oracle.com (userv0021.oracle.com [156.151.31.71]) by userp1040.oracle.com (Sentrion-MTA-4.3.2/Sentrion-MTA-4.3.2) with ESMTP id u191C6MA014647 (version=TLSv1 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Tue, 9 Feb 2016 01:12:07 GMT Received: from userv0122.oracle.com (userv0122.oracle.com [156.151.31.75]) by userv0021.oracle.com (8.13.8/8.13.8) with ESMTP id u191C66P014127 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=FAIL); Tue, 9 Feb 2016 01:12:06 GMT Received: from abhmp0006.oracle.com (abhmp0006.oracle.com [141.146.116.12]) by userv0122.oracle.com (8.14.4/8.14.4) with ESMTP id u191C64F023013; Tue, 9 Feb 2016 01:12:06 GMT Received: from localhost (/10.145.178.207) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Mon, 08 Feb 2016 17:12:06 -0800 Subject: [PATCH 03/23] xfstests: make _scratch_mkfs_blocksized usable From: "Darrick J. Wong" X-ASG-Orig-Subj: [PATCH 03/23] xfstests: make _scratch_mkfs_blocksized usable To: david@fromorbit.com, darrick.wong@oracle.com Cc: linux-btrfs@vger.kernel.org, Christoph Hellwig , fstests@vger.kernel.org, xfs@oss.sgi.com Date: Mon, 08 Feb 2016 17:12:04 -0800 Message-ID: <20160209011204.23099.75138.stgit@birch.djwong.org> In-Reply-To: <20160209011145.23099.95354.stgit@birch.djwong.org> References: <20160209011145.23099.95354.stgit@birch.djwong.org> User-Agent: StGit/0.17.1-dirty MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit X-Source-IP: userv0021.oracle.com [156.151.31.71] X-Barracuda-Connect: userp1040.oracle.com[156.151.31.81] X-Barracuda-Start-Time: 1454980333 X-Barracuda-Encrypted: ECDHE-RSA-AES256-GCM-SHA384 X-Barracuda-URL: https://192.48.176.25:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-BRTS-Status: 1 X-Barracuda-Spam-Score: 0.00 X-Barracuda-Spam-Status: No, SCORE=0.00 using per-user scores of TAG_LEVEL=1000.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.7 tests=BSF_SC0_MISMATCH_TO, UNPARSEABLE_RELAY X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.3.26874 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 0.00 BSF_SC0_MISMATCH_TO Envelope rcpt doesn't match header 0.00 UNPARSEABLE_RELAY Informational: message has unparseable relay lines The default mkfs.xfs options contain -b size=4096, so all tests using _scratch_mkfs_blocksized won't actually run unless those options are changed. As we're trying to specificly test 1k blocks we should always override the default option. v2: Move the function to common/rc Signed-off-by: Christoph Hellwig [darrick.wong@oracle.com: move function to common/rc] Signed-off-by: Darrick J. Wong --- common/rc | 24 ++++++++++++++++++++++++ common/reflink | 30 ------------------------------ 2 files changed, 24 insertions(+), 30 deletions(-) diff --git a/common/rc b/common/rc index f08cb3a..863d4b3 100644 --- a/common/rc +++ b/common/rc @@ -881,6 +881,30 @@ _scratch_mkfs_geom() _scratch_mkfs } +# Create fs of certain blocksize on scratch device +# _scratch_mkfs_blocksized blocksize +_scratch_mkfs_blocksized() +{ + blocksize=$1 + + re='^[0-9]+$' + if ! [[ $blocksize =~ $re ]] ; then + _notrun "error: _scratch_mkfs_sized: block size \"$blocksize\" not an integer." + fi + + case $FSTYP in + xfs) + _scratch_mkfs_xfs $MKFS_OPTIONS -b size=$blocksize + ;; + ext2|ext3|ext4|ocfs2) + ${MKFS_PROG}.$FSTYP -F $MKFS_OPTIONS -b $blocksize $SCRATCH_DEV + ;; + *) + _notrun "Filesystem $FSTYP not supported in _scratch_mkfs_blocksized" + ;; + esac +} + _scratch_resvblks() { case $FSTYP in diff --git a/common/reflink b/common/reflink index 8638aba..3d6a8c1 100644 --- a/common/reflink +++ b/common/reflink @@ -187,33 +187,3 @@ _dedupe_range() { "$XFS_IO_PROG" $xfs_io_args -f -c "dedupe $file1 $offset1 $offset2 $len" "$file2" } - -# Create fs of certain blocksize on scratch device -# _scratch_mkfs_blocksized blocksize -_scratch_mkfs_blocksized() -{ - blocksize=$1 - - re='^[0-9]+$' - if ! [[ $blocksize =~ $re ]] ; then - _notrun "error: _scratch_mkfs_sized: block size \"$blocksize\" not an integer." - fi - - case $FSTYP in - xfs) - # don't override MKFS_OPTIONS that set a block size. - echo $MKFS_OPTIONS |egrep -q "b?size=" - if [ $? -eq 0 ]; then - _scratch_mkfs_xfs - else - _scratch_mkfs_xfs -b size=$blocksize - fi - ;; - ext2|ext3|ext4|ocfs2) - ${MKFS_PROG}.$FSTYP -F $MKFS_OPTIONS -b $blocksize $SCRATCH_DEV - ;; - *) - _notrun "Filesystem $FSTYP not supported in _scratch_mkfs_blocksized" - ;; - esac -} From darrick.wong@oracle.com Mon Feb 8 19:12:22 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay1.corp.sgi.com [137.38.102.111]) by oss.sgi.com (Postfix) with ESMTP id A9F4F29DFE for ; Mon, 8 Feb 2016 19:12:22 -0600 (CST) Received: from cuda.sgi.com (cuda3.sgi.com [192.48.176.15]) by relay1.corp.sgi.com (Postfix) with ESMTP id A286C8F8052 for ; Mon, 8 Feb 2016 17:12:22 -0800 (PST) X-ASG-Debug-ID: 1454980338-04cb6c1e5903570001-NocioJ Received: from aserp1040.oracle.com (aserp1040.oracle.com [141.146.126.69]) by cuda.sgi.com with ESMTP id Mi9wtlXvSDOcY890 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO) for ; Mon, 08 Feb 2016 17:12:19 -0800 (PST) X-Barracuda-Envelope-From: darrick.wong@oracle.com X-Barracuda-Apparent-Source-IP: 141.146.126.69 Received: from aserv0021.oracle.com (aserv0021.oracle.com [141.146.126.233]) by aserp1040.oracle.com (Sentrion-MTA-4.3.2/Sentrion-MTA-4.3.2) with ESMTP id u191CCn4018956 (version=TLSv1 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Tue, 9 Feb 2016 01:12:13 GMT Received: from aserv0121.oracle.com (aserv0121.oracle.com [141.146.126.235]) by aserv0021.oracle.com (8.13.8/8.13.8) with ESMTP id u191CCkh000838 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=FAIL); Tue, 9 Feb 2016 01:12:12 GMT Received: from abhmp0003.oracle.com (abhmp0003.oracle.com [141.146.116.9]) by aserv0121.oracle.com (8.13.8/8.13.8) with ESMTP id u191CClD027497; Tue, 9 Feb 2016 01:12:12 GMT Received: from localhost (/10.145.178.207) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Mon, 08 Feb 2016 17:12:12 -0800 Subject: [PATCH 04/23] reflink: remove redundant filesystem checks from the end of the tests From: "Darrick J. Wong" X-ASG-Orig-Subj: [PATCH 04/23] reflink: remove redundant filesystem checks from the end of the tests To: david@fromorbit.com, darrick.wong@oracle.com Cc: linux-btrfs@vger.kernel.org, fstests@vger.kernel.org, xfs@oss.sgi.com Date: Mon, 08 Feb 2016 17:12:11 -0800 Message-ID: <20160209011211.23099.49959.stgit@birch.djwong.org> In-Reply-To: <20160209011145.23099.95354.stgit@birch.djwong.org> References: <20160209011145.23099.95354.stgit@birch.djwong.org> User-Agent: StGit/0.17.1-dirty MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit X-Source-IP: aserv0021.oracle.com [141.146.126.233] X-Barracuda-Connect: aserp1040.oracle.com[141.146.126.69] X-Barracuda-Start-Time: 1454980339 X-Barracuda-Encrypted: ECDHE-RSA-AES256-GCM-SHA384 X-Barracuda-URL: https://192.48.176.15:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-BRTS-Status: 1 X-Barracuda-Spam-Score: 0.00 X-Barracuda-Spam-Status: No, SCORE=0.00 using per-user scores of TAG_LEVEL=1000.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.7 tests=BSF_SC0_MISMATCH_TO, UNPARSEABLE_RELAY X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.3.26874 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 0.00 BSF_SC0_MISMATCH_TO Envelope rcpt doesn't match header 0.00 UNPARSEABLE_RELAY Informational: message has unparseable relay lines Turns out that check already runs _check_filesystems after each test, so we don't need to do this at the end of each test. Signed-off-by: Darrick J. Wong --- tests/generic/157 | 1 - tests/generic/158 | 1 - tests/generic/161 | 1 - tests/generic/162 | 1 - tests/generic/163 | 1 - tests/generic/164 | 1 - tests/generic/165 | 1 - tests/generic/166 | 1 - tests/generic/167 | 1 - tests/generic/168 | 1 - tests/generic/170 | 1 - tests/generic/171 | 1 - tests/generic/172 | 1 - tests/generic/173 | 1 - tests/generic/174 | 1 - tests/generic/175 | 1 - tests/generic/176 | 1 - tests/generic/183 | 1 - tests/generic/185 | 1 - tests/generic/186 | 1 - tests/generic/187 | 1 - tests/generic/188 | 1 - tests/generic/189 | 1 - tests/generic/190 | 1 - tests/generic/191 | 1 - tests/generic/194 | 1 - tests/generic/195 | 1 - tests/generic/196 | 1 - tests/generic/197 | 1 - tests/generic/199 | 1 - tests/generic/200 | 1 - tests/generic/201 | 1 - tests/generic/202 | 1 - tests/generic/203 | 1 - tests/generic/205 | 1 - tests/generic/206 | 1 - tests/generic/216 | 1 - tests/generic/217 | 1 - tests/generic/218 | 1 - tests/generic/220 | 1 - tests/generic/222 | 1 - tests/generic/227 | 1 - tests/generic/229 | 1 - tests/generic/238 | 1 - tests/generic/242 | 1 - tests/generic/243 | 1 - tests/xfs/127 | 1 - tests/xfs/128 | 1 - tests/xfs/131 | 1 - tests/xfs/139 | 1 - tests/xfs/140 | 1 - 51 files changed, 51 deletions(-) diff --git a/tests/generic/157 b/tests/generic/157 index 0150866..74314d8 100755 --- a/tests/generic/157 +++ b/tests/generic/157 @@ -123,7 +123,6 @@ _reflink_range "$testdir2/file1" 0 "$testdir2/file2" 0 $blksz >> "$seqres.full" echo "Check scratch fs" _scratch_unmount -_check_scratch_fs # success, all done status=0 diff --git a/tests/generic/158 b/tests/generic/158 index 807c247..779d55e 100755 --- a/tests/generic/158 +++ b/tests/generic/158 @@ -124,7 +124,6 @@ _dedupe_range "$testdir2/file1" 0 "$testdir2/file2" 0 $blksz >> "$seqres.full" echo "Check scratch fs" _scratch_unmount -_check_scratch_fs # success, all done status=0 diff --git a/tests/generic/161 b/tests/generic/161 index 7fb8963..b271936 100755 --- a/tests/generic/161 +++ b/tests/generic/161 @@ -71,7 +71,6 @@ wait echo "Check fs" umount "$SCRATCH_MNT" -_check_scratch_fs echo "Done" # success, all done diff --git a/tests/generic/162 b/tests/generic/162 index 2fb947a..30c761b 100755 --- a/tests/generic/162 +++ b/tests/generic/162 @@ -87,7 +87,6 @@ wait echo "Check fs" umount "$SCRATCH_MNT" -_check_scratch_fs echo "Done" # success, all done diff --git a/tests/generic/163 b/tests/generic/163 index 0186443..f2ea334 100755 --- a/tests/generic/163 +++ b/tests/generic/163 @@ -87,7 +87,6 @@ wait echo "Check fs" umount "$SCRATCH_MNT" -_check_scratch_fs echo "Done" # success, all done diff --git a/tests/generic/164 b/tests/generic/164 index 087c6ba..e97ac13 100755 --- a/tests/generic/164 +++ b/tests/generic/164 @@ -97,7 +97,6 @@ wait echo "Check fs" umount "$SCRATCH_MNT" -_check_scratch_fs echo "Done" # success, all done diff --git a/tests/generic/165 b/tests/generic/165 index 6bd15e1..b305079 100755 --- a/tests/generic/165 +++ b/tests/generic/165 @@ -97,7 +97,6 @@ wait echo "Check fs" umount "$SCRATCH_MNT" -_check_scratch_fs echo "Done" # success, all done diff --git a/tests/generic/166 b/tests/generic/166 index 6cfb821..2c2ff4e 100755 --- a/tests/generic/166 +++ b/tests/generic/166 @@ -84,7 +84,6 @@ wait echo "Check for damage" _scratch_unmount -_check_scratch_fs echo "Done" diff --git a/tests/generic/167 b/tests/generic/167 index fc5a86c..b80b481 100755 --- a/tests/generic/167 +++ b/tests/generic/167 @@ -84,7 +84,6 @@ wait echo "Check for damage" _scratch_unmount -_check_scratch_fs echo "Done" diff --git a/tests/generic/168 b/tests/generic/168 index ee3848d..0d620da 100755 --- a/tests/generic/168 +++ b/tests/generic/168 @@ -88,7 +88,6 @@ wait echo "Check for damage" umount "$SCRATCH_MNT" -_check_scratch_fs echo "Done" diff --git a/tests/generic/170 b/tests/generic/170 index 6d27810..78ed63d 100755 --- a/tests/generic/170 +++ b/tests/generic/170 @@ -88,7 +88,6 @@ wait echo "Check for damage" umount "$SCRATCH_MNT" -_check_scratch_fs echo "Done" diff --git a/tests/generic/171 b/tests/generic/171 index ec3729d..4b4f141 100755 --- a/tests/generic/171 +++ b/tests/generic/171 @@ -100,7 +100,6 @@ echo "${out}" echo "Check scratch fs" umount "$SCRATCH_MNT" -_check_scratch_fs # success, all done status=0 diff --git a/tests/generic/172 b/tests/generic/172 index 1988c8d..98eb97f 100755 --- a/tests/generic/172 +++ b/tests/generic/172 @@ -100,7 +100,6 @@ echo "${out}" echo "Check scratch fs" umount "$SCRATCH_MNT" -_check_scratch_fs # success, all done status=0 diff --git a/tests/generic/173 b/tests/generic/173 index 5bb9ce6..e26f5a9 100755 --- a/tests/generic/173 +++ b/tests/generic/173 @@ -102,7 +102,6 @@ fi echo "Check scratch fs" umount "$SCRATCH_MNT" -_check_scratch_fs # success, all done status=0 diff --git a/tests/generic/174 b/tests/generic/174 index a8e0bb5..1749a1c 100755 --- a/tests/generic/174 +++ b/tests/generic/174 @@ -100,7 +100,6 @@ echo "${out}" echo "Check scratch fs" umount "$SCRATCH_MNT" -_check_scratch_fs # success, all done status=0 diff --git a/tests/generic/175 b/tests/generic/175 index b37ff66..ac2f54f 100755 --- a/tests/generic/175 +++ b/tests/generic/175 @@ -92,7 +92,6 @@ _check_scratch_fs echo "Remove all files and recheck" _scratch_mount >> "$seqres.full" 2>&1 umount "$SCRATCH_MNT" -_check_scratch_fs # success, all done status=0 diff --git a/tests/generic/176 b/tests/generic/176 index 0ca0b17..e32f94f 100755 --- a/tests/generic/176 +++ b/tests/generic/176 @@ -74,7 +74,6 @@ done echo "Check scratch fs" umount "$SCRATCH_MNT" -_check_scratch_fs # success, all done status=0 diff --git a/tests/generic/183 b/tests/generic/183 index 8141f38..27179fd 100755 --- a/tests/generic/183 +++ b/tests/generic/183 @@ -94,7 +94,6 @@ md5sum "$testdir/file3.chk" | _filter_scratch echo "Check for damage" umount "$SCRATCH_MNT" -_check_scratch_fs # success, all done status=0 diff --git a/tests/generic/185 b/tests/generic/185 index 1d6dff2..368260d 100755 --- a/tests/generic/185 +++ b/tests/generic/185 @@ -94,7 +94,6 @@ md5sum "$testdir/file3.chk" | _filter_scratch echo "Check for damage" umount "$SCRATCH_MNT" -_check_scratch_fs # success, all done status=0 diff --git a/tests/generic/186 b/tests/generic/186 index 9aac966..67e52b5 100755 --- a/tests/generic/186 +++ b/tests/generic/186 @@ -139,7 +139,6 @@ md5sum "$testdir/file3.chk" | _filter_scratch echo "Check for damage" umount "$SCRATCH_MNT" -_check_scratch_fs # success, all done status=0 diff --git a/tests/generic/187 b/tests/generic/187 index b3f1542..c993394 100755 --- a/tests/generic/187 +++ b/tests/generic/187 @@ -139,7 +139,6 @@ md5sum "$testdir/file3.chk" | _filter_scratch echo "Check for damage" umount "$SCRATCH_MNT" -_check_scratch_fs # success, all done status=0 diff --git a/tests/generic/188 b/tests/generic/188 index c67b847..9e63388 100755 --- a/tests/generic/188 +++ b/tests/generic/188 @@ -89,7 +89,6 @@ md5sum "$testdir/file3.chk" | _filter_scratch echo "Check for damage" umount "$SCRATCH_MNT" -_check_scratch_fs # success, all done status=0 diff --git a/tests/generic/189 b/tests/generic/189 index 1954235..661129c 100755 --- a/tests/generic/189 +++ b/tests/generic/189 @@ -89,7 +89,6 @@ md5sum "$testdir/file3.chk" | _filter_scratch echo "Check for damage" umount "$SCRATCH_MNT" -_check_scratch_fs # success, all done status=0 diff --git a/tests/generic/190 b/tests/generic/190 index d3d573b..4e272c2 100755 --- a/tests/generic/190 +++ b/tests/generic/190 @@ -89,7 +89,6 @@ md5sum "$testdir/file3.chk" | _filter_scratch echo "Check for damage" umount "$SCRATCH_MNT" -_check_scratch_fs # success, all done status=0 diff --git a/tests/generic/191 b/tests/generic/191 index 8b19084..5aadded 100755 --- a/tests/generic/191 +++ b/tests/generic/191 @@ -89,7 +89,6 @@ md5sum "$testdir/file3.chk" | _filter_scratch echo "Check for damage" umount "$SCRATCH_MNT" -_check_scratch_fs # success, all done status=0 diff --git a/tests/generic/194 b/tests/generic/194 index 1fc2cd7..a17debc 100755 --- a/tests/generic/194 +++ b/tests/generic/194 @@ -94,7 +94,6 @@ md5sum "$testdir/file3.chk" | _filter_scratch echo "Check for damage" umount "$SCRATCH_MNT" -_check_scratch_fs # success, all done status=0 diff --git a/tests/generic/195 b/tests/generic/195 index 087275c..f49d0c2 100755 --- a/tests/generic/195 +++ b/tests/generic/195 @@ -94,7 +94,6 @@ md5sum "$testdir/file3.chk" | _filter_scratch echo "Check for damage" umount "$SCRATCH_MNT" -_check_scratch_fs # success, all done status=0 diff --git a/tests/generic/196 b/tests/generic/196 index d815232..4da9c76 100755 --- a/tests/generic/196 +++ b/tests/generic/196 @@ -89,7 +89,6 @@ md5sum "$testdir/file3.chk" | _filter_scratch echo "Check for damage" umount "$SCRATCH_MNT" -_check_scratch_fs # success, all done status=0 diff --git a/tests/generic/197 b/tests/generic/197 index 54005ae..54ee5ab 100755 --- a/tests/generic/197 +++ b/tests/generic/197 @@ -89,7 +89,6 @@ md5sum "$testdir/file3.chk" | _filter_scratch echo "Check for damage" umount "$SCRATCH_MNT" -_check_scratch_fs # success, all done status=0 diff --git a/tests/generic/199 b/tests/generic/199 index eb567e4..5e4bca8 100755 --- a/tests/generic/199 +++ b/tests/generic/199 @@ -118,7 +118,6 @@ md5sum "$testdir/file3.chk" | _filter_scratch echo "Check for damage" umount "$SCRATCH_MNT" -_check_scratch_fs # success, all done status=0 diff --git a/tests/generic/200 b/tests/generic/200 index 991fed0..f0521ae 100755 --- a/tests/generic/200 +++ b/tests/generic/200 @@ -118,7 +118,6 @@ md5sum "$testdir/file3.chk" | _filter_scratch echo "Check for damage" umount "$SCRATCH_MNT" -_check_scratch_fs # success, all done status=0 diff --git a/tests/generic/201 b/tests/generic/201 index ffc1ce4..db77a5e 100755 --- a/tests/generic/201 +++ b/tests/generic/201 @@ -79,7 +79,6 @@ rm "$testdir/file3" echo "Check for damage" umount "$SCRATCH_MNT" -_check_scratch_fs # success, all done status=0 diff --git a/tests/generic/202 b/tests/generic/202 index 375b65f..91f2d9b 100755 --- a/tests/generic/202 +++ b/tests/generic/202 @@ -79,7 +79,6 @@ md5sum "$testdir/file2.chk" | _filter_scratch echo "Check for damage" umount "$SCRATCH_MNT" -_check_scratch_fs # success, all done status=0 diff --git a/tests/generic/203 b/tests/generic/203 index 549f2ba..86a672b 100755 --- a/tests/generic/203 +++ b/tests/generic/203 @@ -79,7 +79,6 @@ md5sum "$testdir/file2.chk" | _filter_scratch echo "Check for damage" umount "$SCRATCH_MNT" -_check_scratch_fs # success, all done status=0 diff --git a/tests/generic/205 b/tests/generic/205 index 8f0ec45..8fed955 100755 --- a/tests/generic/205 +++ b/tests/generic/205 @@ -95,7 +95,6 @@ cmp -s "$testdir/file2" "$testdir/file2.chk" || _fail "file2 and file2.chk don't echo "Check for damage" umount "$SCRATCH_MNT" -_check_scratch_fs # success, all done status=0 diff --git a/tests/generic/206 b/tests/generic/206 index f2c4ecc..10b5285 100755 --- a/tests/generic/206 +++ b/tests/generic/206 @@ -95,7 +95,6 @@ cmp -s "$testdir/file2" "$testdir/file2.chk" || _fail "file2 and file2.chk don't echo "Check for damage" umount "$SCRATCH_MNT" -_check_scratch_fs # success, all done status=0 diff --git a/tests/generic/216 b/tests/generic/216 index 3789cb0..671f0c1 100755 --- a/tests/generic/216 +++ b/tests/generic/216 @@ -96,7 +96,6 @@ cmp -s "$testdir/file2" "$testdir/file2.chk" || _fail "file2 and file2.chk don't echo "Check for damage" umount "$SCRATCH_MNT" -_check_scratch_fs # success, all done status=0 diff --git a/tests/generic/217 b/tests/generic/217 index 4ae603f..e4d40c7 100755 --- a/tests/generic/217 +++ b/tests/generic/217 @@ -96,7 +96,6 @@ cmp -s "$testdir/file2" "$testdir/file2.chk" || _fail "file2 and file2.chk don't echo "Check for damage" umount "$SCRATCH_MNT" -_check_scratch_fs # success, all done status=0 diff --git a/tests/generic/218 b/tests/generic/218 index d63c06f..eb52fea 100755 --- a/tests/generic/218 +++ b/tests/generic/218 @@ -90,7 +90,6 @@ cmp -s "$testdir/file2" "$testdir/file2.chk" || _fail "file2 and file2.chk don't echo "Check for damage" umount "$SCRATCH_MNT" -_check_scratch_fs # success, all done status=0 diff --git a/tests/generic/220 b/tests/generic/220 index ccdb32e..fb5ecda 100755 --- a/tests/generic/220 +++ b/tests/generic/220 @@ -90,7 +90,6 @@ cmp -s "$testdir/file2" "$testdir/file2.chk" || _fail "file2 and file2.chk don't echo "Check for damage" umount "$SCRATCH_MNT" -_check_scratch_fs # success, all done status=0 diff --git a/tests/generic/222 b/tests/generic/222 index cb5a788..ab3f65f 100755 --- a/tests/generic/222 +++ b/tests/generic/222 @@ -96,7 +96,6 @@ cmp -s "$testdir/file2" "$testdir/file2.chk" || _fail "file2 and file2.chk don't echo "Check for damage" umount "$SCRATCH_MNT" -_check_scratch_fs # success, all done status=0 diff --git a/tests/generic/227 b/tests/generic/227 index d200424..387c714 100755 --- a/tests/generic/227 +++ b/tests/generic/227 @@ -96,7 +96,6 @@ cmp -s "$testdir/file2" "$testdir/file2.chk" || _fail "file2 and file2.chk don't echo "Check for damage" umount "$SCRATCH_MNT" -_check_scratch_fs # success, all done status=0 diff --git a/tests/generic/229 b/tests/generic/229 index cdaddaf..eb105a3 100755 --- a/tests/generic/229 +++ b/tests/generic/229 @@ -156,7 +156,6 @@ runtest delalloc regular "$testdir/d-r" echo "Check for damage" umount "$SCRATCH_MNT" -_check_scratch_fs # success, all done status=0 diff --git a/tests/generic/238 b/tests/generic/238 index 98530e0..02057ad 100755 --- a/tests/generic/238 +++ b/tests/generic/238 @@ -156,7 +156,6 @@ runtest delalloc regular "$testdir/d-r" echo "Check for damage" umount "$SCRATCH_MNT" -_check_scratch_fs # success, all done status=0 diff --git a/tests/generic/242 b/tests/generic/242 index a5a17c3..3023ac7 100755 --- a/tests/generic/242 +++ b/tests/generic/242 @@ -92,7 +92,6 @@ md5sum "$testdir/file2.chk" | _filter_scratch echo "Check for damage" umount "$SCRATCH_MNT" -_check_scratch_fs # success, all done status=0 diff --git a/tests/generic/243 b/tests/generic/243 index b7ca466..e65347f 100755 --- a/tests/generic/243 +++ b/tests/generic/243 @@ -92,7 +92,6 @@ md5sum "$testdir/file2.chk" | _filter_scratch echo "Check for damage" umount "$SCRATCH_MNT" -_check_scratch_fs # success, all done status=0 diff --git a/tests/xfs/127 b/tests/xfs/127 index c31cd17..63d5890 100755 --- a/tests/xfs/127 +++ b/tests/xfs/127 @@ -72,7 +72,6 @@ xfs_info "$SCRATCH_MNT" >> "$seqres.full" echo "Check scratch fs" umount "$SCRATCH_MNT" -_check_scratch_fs # success, all done status=0 diff --git a/tests/xfs/128 b/tests/xfs/128 index c9547fb..2e1da3f 100755 --- a/tests/xfs/128 +++ b/tests/xfs/128 @@ -142,7 +142,6 @@ _within_tolerance "free blocks after all tests" $free_blocks3 $((free_blocks0 - echo "Check scratch fs" umount "$SCRATCH_MNT" -_check_scratch_fs # success, all done status=0 diff --git a/tests/xfs/131 b/tests/xfs/131 index 8442821..adab31f 100755 --- a/tests/xfs/131 +++ b/tests/xfs/131 @@ -69,7 +69,6 @@ test -s "$testdir/file2" && _fail "Should not be able to reflink a realtime file echo "Check restored fs" umount "$SCRATCH_MNT" -_check_scratch_fs # success, all done status=0 diff --git a/tests/xfs/139 b/tests/xfs/139 index 51c903e..feb55bd 100755 --- a/tests/xfs/139 +++ b/tests/xfs/139 @@ -75,7 +75,6 @@ md5sum "$testdir/file2" | _filter_scratch echo "Check scratch fs" umount "$SCRATCH_MNT" -_check_scratch_fs # success, all done status=0 diff --git a/tests/xfs/140 b/tests/xfs/140 index 133bb72..309b284 100644 --- a/tests/xfs/140 +++ b/tests/xfs/140 @@ -82,7 +82,6 @@ cmp -s "$testdir/file2" "$testdir/file2.chk" || echo "file2 and file2.chk do not echo "Check scratch fs" umount "$SCRATCH_MNT" -_check_scratch_fs # success, all done status=0 From darrick.wong@oracle.com Mon Feb 8 19:12:29 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay2.corp.sgi.com [137.38.102.29]) by oss.sgi.com (Postfix) with ESMTP id C51B829DFE for ; Mon, 8 Feb 2016 19:12:29 -0600 (CST) Received: from cuda.sgi.com (cuda2.sgi.com [192.48.176.25]) by relay2.corp.sgi.com (Postfix) with ESMTP id B26C2304032 for ; Mon, 8 Feb 2016 17:12:26 -0800 (PST) X-ASG-Debug-ID: 1454980344-04cbb0433105990001-NocioJ Received: from aserp1040.oracle.com (aserp1040.oracle.com [141.146.126.69]) by cuda.sgi.com with ESMTP id a09UNprtxcReKMEz (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO) for ; Mon, 08 Feb 2016 17:12:24 -0800 (PST) X-Barracuda-Envelope-From: darrick.wong@oracle.com X-Barracuda-Apparent-Source-IP: 141.146.126.69 Received: from userv0022.oracle.com (userv0022.oracle.com [156.151.31.74]) by aserp1040.oracle.com (Sentrion-MTA-4.3.2/Sentrion-MTA-4.3.2) with ESMTP id u191CJL8019017 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 9 Feb 2016 01:12:20 GMT Received: from aserv0121.oracle.com (aserv0121.oracle.com [141.146.126.235]) by userv0022.oracle.com (8.14.4/8.13.8) with ESMTP id u191CJmR008821 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=FAIL); Tue, 9 Feb 2016 01:12:19 GMT Received: from abhmp0013.oracle.com (abhmp0013.oracle.com [141.146.116.19]) by aserv0121.oracle.com (8.13.8/8.13.8) with ESMTP id u191CJ9O027517; Tue, 9 Feb 2016 01:12:19 GMT Received: from localhost (/10.145.178.207) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Mon, 08 Feb 2016 17:12:18 -0800 Subject: [PATCH 05/23] common/dmerror: add some more dmerror routines From: "Darrick J. Wong" X-ASG-Orig-Subj: [PATCH 05/23] common/dmerror: add some more dmerror routines To: david@fromorbit.com, darrick.wong@oracle.com Cc: linux-btrfs@vger.kernel.org, fstests@vger.kernel.org, xfs@oss.sgi.com Date: Mon, 08 Feb 2016 17:12:17 -0800 Message-ID: <20160209011217.23099.26572.stgit@birch.djwong.org> In-Reply-To: <20160209011145.23099.95354.stgit@birch.djwong.org> References: <20160209011145.23099.95354.stgit@birch.djwong.org> User-Agent: StGit/0.17.1-dirty MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit X-Source-IP: userv0022.oracle.com [156.151.31.74] X-Barracuda-Connect: aserp1040.oracle.com[141.146.126.69] X-Barracuda-Start-Time: 1454980344 X-Barracuda-Encrypted: ECDHE-RSA-AES256-GCM-SHA384 X-Barracuda-URL: https://192.48.176.25:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-BRTS-Status: 1 X-Barracuda-Spam-Score: 0.00 X-Barracuda-Spam-Status: No, SCORE=0.00 using per-user scores of TAG_LEVEL=1000.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.7 tests=BSF_SC0_MISMATCH_TO, UNPARSEABLE_RELAY X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.3.26874 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 0.00 BSF_SC0_MISMATCH_TO Envelope rcpt doesn't match header 0.00 UNPARSEABLE_RELAY Informational: message has unparseable relay lines Add functions to the dmerror routine so that we can load both the error table and the linear table. This will help us with EIO testing of copy-on-write. Signed-off-by: Darrick J. Wong --- common/dmerror | 27 +++++++++++++++++++++++++-- tests/btrfs/100 | 2 +- tests/btrfs/101 | 2 +- 3 files changed, 27 insertions(+), 4 deletions(-) diff --git a/common/dmerror b/common/dmerror index 3900a4e..004530d 100644 --- a/common/dmerror +++ b/common/dmerror @@ -46,15 +46,23 @@ _dmerror_mount() _mount -t $FSTYP `_dmerror_mount_options $*` } +_dmerror_unmount() +{ + umount $SCRATCH_MNT +} + _dmerror_cleanup() { $UMOUNT_PROG $SCRATCH_MNT > /dev/null 2>&1 $DMSETUP_PROG remove error-test > /dev/null 2>&1 } -_dmerror_load_table() +_dmerror_load_error_table() { - $DMSETUP_PROG suspend error-test + suspend_opt="--nolockfs" + [ $# -gt 1 ] && [ $2 -eq 1 ] && suspend_opt="" + + $DMSETUP_PROG suspend $suspend_opt error-test [ $? -ne 0 ] && _fail "dmsetup suspend failed" $DMSETUP_PROG load error-test --table "$DMERROR_TABLE" @@ -63,3 +71,18 @@ _dmerror_load_table() $DMSETUP_PROG resume error-test [ $? -ne 0 ] && _fail "dmsetup resume failed" } + +_dmerror_load_working_table() +{ + suspend_opt="--nolockfs" + [ $# -gt 1 ] && [ $2 -eq 1 ] && suspend_opt="" + + $DMSETUP_PROG suspend $suspend_opt error-test + [ $? -ne 0 ] && _fail "dmsetup suspend failed" + + $DMSETUP_PROG load error-test --table "$DMLINEAR_TABLE" + [ $? -ne 0 ] && _fail "dmsetup failed to load error table" + + $DMSETUP_PROG resume error-test + [ $? -ne 0 ] && _fail "dmsetup resume failed" +} diff --git a/tests/btrfs/100 b/tests/btrfs/100 index 080d0ae..cd385e1 100755 --- a/tests/btrfs/100 +++ b/tests/btrfs/100 @@ -69,7 +69,7 @@ run_check $FSSTRESS_PROG -d $SCRATCH_MNT -n 200 -p 8 $FSSTRESS_AVOID -x \ "$snapshot_cmd" -X 50 # now load the error into the DMERROR_DEV -_dmerror_load_table +_dmerror_load_error_table _run_btrfs_util_prog replace start -B $error_devid $dev2 $SCRATCH_MNT diff --git a/tests/btrfs/101 b/tests/btrfs/101 index 0824de1..8d7af85 100755 --- a/tests/btrfs/101 +++ b/tests/btrfs/101 @@ -70,7 +70,7 @@ run_check $FSSTRESS_PROG -d $SCRATCH_MNT -n 200 -p 8 $FSSTRESS_AVOID -x \ "$snapshot_cmd" -X 50 # now load the error into the DMERROR_DEV -_dmerror_load_table +_dmerror_load_error_table _run_btrfs_util_prog device delete $error_devid $SCRATCH_MNT From darrick.wong@oracle.com Mon Feb 8 19:12:36 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay1.corp.sgi.com [137.38.102.111]) by oss.sgi.com (Postfix) with ESMTP id 528E229DFE for ; Mon, 8 Feb 2016 19:12:36 -0600 (CST) Received: from cuda.sgi.com (cuda1.sgi.com [192.48.157.11]) by relay1.corp.sgi.com (Postfix) with ESMTP id 198798F8059 for ; Mon, 8 Feb 2016 17:12:36 -0800 (PST) X-ASG-Debug-ID: 1454980351-04bdf066ed03ae0001-NocioJ Received: from aserp1040.oracle.com (aserp1040.oracle.com [141.146.126.69]) by cuda.sgi.com with ESMTP id J1ZLffp31Mbj5vEs (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO) for ; Mon, 08 Feb 2016 17:12:31 -0800 (PST) X-Barracuda-Envelope-From: darrick.wong@oracle.com X-Barracuda-Apparent-Source-IP: 141.146.126.69 Received: from userv0022.oracle.com (userv0022.oracle.com [156.151.31.74]) by aserp1040.oracle.com (Sentrion-MTA-4.3.2/Sentrion-MTA-4.3.2) with ESMTP id u191CQJX019066 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 9 Feb 2016 01:12:26 GMT Received: from userv0122.oracle.com (userv0122.oracle.com [156.151.31.75]) by userv0022.oracle.com (8.14.4/8.13.8) with ESMTP id u191CQaE009024 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL); Tue, 9 Feb 2016 01:12:26 GMT Received: from abhmp0012.oracle.com (abhmp0012.oracle.com [141.146.116.18]) by userv0122.oracle.com (8.14.4/8.14.4) with ESMTP id u191CPcK023064; Tue, 9 Feb 2016 01:12:25 GMT Received: from localhost (/10.145.178.207) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Mon, 08 Feb 2016 17:12:25 -0800 Subject: [PATCH 06/23] dio unwritten conversion bug tests From: "Darrick J. Wong" X-ASG-Orig-Subj: [PATCH 06/23] dio unwritten conversion bug tests To: david@fromorbit.com, darrick.wong@oracle.com Cc: linux-btrfs@vger.kernel.org, fstests@vger.kernel.org, xfs@oss.sgi.com Date: Mon, 08 Feb 2016 17:12:23 -0800 Message-ID: <20160209011223.23099.3987.stgit@birch.djwong.org> In-Reply-To: <20160209011145.23099.95354.stgit@birch.djwong.org> References: <20160209011145.23099.95354.stgit@birch.djwong.org> User-Agent: StGit/0.17.1-dirty MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit X-Source-IP: userv0022.oracle.com [156.151.31.74] X-Barracuda-Connect: aserp1040.oracle.com[141.146.126.69] X-Barracuda-Start-Time: 1454980351 X-Barracuda-Encrypted: ECDHE-RSA-AES256-GCM-SHA384 X-Barracuda-URL: https://192.48.157.11:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-BRTS-Status: 1 X-Barracuda-Spam-Score: 0.00 X-Barracuda-Spam-Status: No, SCORE=0.00 using per-user scores of TAG_LEVEL=1000.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.7 tests=BSF_SC0_MISMATCH_TO, UNPARSEABLE_RELAY X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.3.26874 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 0.00 BSF_SC0_MISMATCH_TO Envelope rcpt doesn't match header 0.00 UNPARSEABLE_RELAY Informational: message has unparseable relay lines Check that we don't expose old disk contents when a directio write to an unwritten extent fails due to IO errors. This primarily affects XFS and ext4. Signed-off-by: Darrick J. Wong --- .gitignore | 1 src/aio-dio-regress/aiocp.c | 489 +++++++++++++++++++++++++++++++++++++++++++ tests/generic/250 | 104 +++++++++ tests/generic/250.out | 10 + tests/generic/252 | 107 +++++++++ tests/generic/252.out | 10 + tests/generic/group | 2 7 files changed, 723 insertions(+) create mode 100644 src/aio-dio-regress/aiocp.c create mode 100755 tests/generic/250 create mode 100644 tests/generic/250.out create mode 100755 tests/generic/252 create mode 100644 tests/generic/252.out diff --git a/.gitignore b/.gitignore index a6f47d3..bbe7c1a 100644 --- a/.gitignore +++ b/.gitignore @@ -112,6 +112,7 @@ /src/aio-dio-regress/aio-free-ring-with-bogus-nr-pages /src/aio-dio-regress/aio-io-setup-with-nonwritable-context-pointer /src/aio-dio-regress/aio-last-ref-held-by-io +/src/aio-dio-regress/aiocp /src/aio-dio-regress/aiodio_sparse2 /src/aio-dio-regress/aio-dio-eof-race /src/cloner diff --git a/src/aio-dio-regress/aiocp.c b/src/aio-dio-regress/aiocp.c new file mode 100644 index 0000000..1abff9c --- /dev/null +++ b/src/aio-dio-regress/aiocp.c @@ -0,0 +1,489 @@ +/* + * Copyright (c) 2004 Daniel McNeil + * 2004 Open Source Development Lab + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See + * the GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * + * Module: .c + */ + +/* + * Change History: + * + * + * version of copy command using async i/o + * From: Stephen Hemminger + * Modified by Daniel McNeil for testing aio. + * - added -a alignment + * - added -b blksize option + * _ added -s size option + * - added -f open_flag option + * - added -w (no write) option (reads from source only) + * - added -n (num aio) option + * - added -z (zero dest) opton (writes zeros to dest only) + * - added -D delay_ms option + * - 2/2004 Marty Ridgeway (mridge@us.ibm.com) Changes to adapt to LTP + * + * Copy file by using a async I/O state machine. + * 1. Start read request + * 2. When read completes turn it into a write request + * 3. When write completes decrement counter and free resources + * + * + * Usage: aiocp [-b blksize] -n [num_aio] [-w] [-z] [-s filesize] + * [-f DIRECT|TRUNC|CREAT|SYNC|LARGEFILE] src dest + */ + +//#define _GNU_SOURCE +//#define DEBUG 1 +#undef DEBUG + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include + +#define AIO_BLKSIZE (64*1024) +#define AIO_MAXIO 32 + +static int aio_blksize = AIO_BLKSIZE; +static int aio_maxio = AIO_MAXIO; + +static int busy = 0; // # of I/O's in flight +static int tocopy = 0; // # of blocks left to copy +static int srcfd; // source fd +static int dstfd = -1; // destination file descriptor +static const char *dstname = NULL; +static const char *srcname = NULL; +static int source_open_flag = O_RDONLY; /* open flags on source file */ +static int dest_open_flag = O_WRONLY; /* open flags on dest file */ +static int no_write; /* do not write */ +static int zero; /* write zero's only */ + +static int debug; +static int count_io_q_waits; /* how many time io_queue_wait called */ + +struct iocb **iocb_free; /* array of pointers to iocb */ +int iocb_free_count; /* current free count */ +int alignment = 512; /* buffer alignment */ + +struct timeval delay; /* delay between i/o */ + +int init_iocb(int n, int iosize) +{ + void *buf; + int i; + + if ((iocb_free = malloc(n * sizeof(struct iocb *))) == 0) { + return -1; + } + + for (i = 0; i < n; i++) { + if (!(iocb_free[i] = (struct iocb *) malloc(sizeof(struct iocb)))) + return -1; + if (posix_memalign(&buf, alignment, iosize)) + return -1; + if (debug > 1) { + printf("buf allocated at 0x%p, align:%d\n", + buf, alignment); + } + if (zero) { + /* + * We are writing zero's to dstfd + */ + memset(buf, 0, iosize); + } + io_prep_pread(iocb_free[i], -1, buf, iosize, 0); + } + iocb_free_count = i; + return 0; +} + +struct iocb *alloc_iocb() +{ + if (!iocb_free_count) + return 0; + return iocb_free[--iocb_free_count]; +} + +void free_iocb(struct iocb *io) +{ + iocb_free[iocb_free_count++] = io; +} + +/* + * io_wait_run() - wait for an io_event and then call the callback. + */ +int io_wait_run(io_context_t ctx, struct timespec *to) +{ + struct io_event events[aio_maxio]; + struct io_event *ep; + int ret, n; + + /* + * get up to aio_maxio events at a time. + */ + ret = n = io_getevents(ctx, 1, aio_maxio, events, to); + + /* + * Call the callback functions for each event. + */ + for (ep = events; n-- > 0; ep++) { + io_callback_t cb = (io_callback_t)ep->data; + struct iocb *iocb = (struct iocb *)ep->obj; + + cb(ctx, iocb, ep->res, ep->res2); + } + return ret; +} + +/* Fatal error handler */ +static void io_error(const char *func, int rc) +{ + if (rc == -ENOSYS) + fprintf(stderr, "AIO not in this kernel\n"); + else if (rc < 0) + fprintf(stderr, "%s: %s\n", func, strerror(-rc)); + else + fprintf(stderr, "%s: error %d\n", func, rc); + + if (dstfd > 0) + close(dstfd); + if (dstname && dest_open_flag & O_CREAT) + unlink(dstname); + exit(1); +} + +/* + * Write complete callback. + * Adjust counts and free resources + */ +static void wr_done(io_context_t ctx, struct iocb *iocb, long res, long res2) +{ + if (res2 != 0) { + io_error("aio write", res2); + } + if (res != iocb->u.c.nbytes) { + fprintf(stderr, "write missed bytes expect %lu got %ld\n", + iocb->u.c.nbytes, res2); + exit(1); + } + --tocopy; + --busy; + free_iocb(iocb); + if (debug) + write(2, "w", 1); +} + +/* + * Read complete callback. + * Change read iocb into a write iocb and start it. + */ +static void rd_done(io_context_t ctx, struct iocb *iocb, long res, long res2) +{ + /* library needs accessors to look at iocb? */ + int iosize = iocb->u.c.nbytes; + char *buf = iocb->u.c.buf; + off_t offset = iocb->u.c.offset; + + if (res2 != 0) + io_error("aio read", res2); + if (res != iosize) { + fprintf(stderr, "read missing bytes expect %lu got %ld\n", + iocb->u.c.nbytes, res); + exit(1); + } + + + /* turn read into write */ + if (no_write) { + --tocopy; + --busy; + free_iocb(iocb); + } else { + io_prep_pwrite(iocb, dstfd, buf, iosize, offset); + io_set_callback(iocb, wr_done); + if (1 != (res = io_submit(ctx, 1, &iocb))) + io_error("io_submit write", res); + } + if (debug) + write(2, "r", 1); + if (debug > 1) + printf("%d", iosize); +} + +void usage() +{ + fprintf(stderr, + "Usage: aiocp [-a align] [-s size] [-b blksize] [-n num_io]" + " [-f open_flag] SOURCE DEST\n" + "This copies from SOURCE to DEST using AIO.\n\n" + "Usage: aiocp [options] -w SOURCE\n" + "This does sequential AIO reads (no writes).\n\n" + "Usage: aiocp [options] -z DEST\n" + "This does sequential AIO writes of zeros.\n"); + + exit(1); +} + +/* + * Scale value by kilo, mega, or giga. + */ +long long scale_by_kmg(long long value, char scale) +{ + switch (scale) { + case 'g': + case 'G': + value *= 1024; + case 'm': + case 'M': + value *= 1024; + case 'k': + case 'K': + value *= 1024; + break; + case '\0': + break; + default: + usage(); + break; + } + return value; +} + +int main(int argc, char *const *argv) +{ + struct stat st; + off_t length = 0, offset = 0; + io_context_t myctx; + int c; + extern char *optarg; + extern int optind, opterr, optopt; + + while ((c = getopt(argc, argv, "a:b:df:n:s:wzD:")) != -1) { + char *endp; + + switch (c) { + case 'a': /* alignment of data buffer */ + alignment = strtol(optarg, &endp, 0); + alignment = (long)scale_by_kmg((long long)alignment, + *endp); + break; + case 'f': /* use these open flags */ + if (strcmp(optarg, "LARGEFILE") == 0 || + strcmp(optarg, "O_LARGEFILE") == 0) { + source_open_flag |= O_LARGEFILE; + dest_open_flag |= O_LARGEFILE; + } else if (strcmp(optarg, "TRUNC") == 0 || + strcmp(optarg, "O_TRUNC") == 0) { + dest_open_flag |= O_TRUNC; + } else if (strcmp(optarg, "SYNC") == 0 || + strcmp(optarg, "O_SYNC") == 0) { + dest_open_flag |= O_SYNC | O_NONBLOCK; + } else if (strcmp(optarg, "DIRECT") == 0 || + strcmp(optarg, "O_DIRECT") == 0) { + source_open_flag |= O_DIRECT; + dest_open_flag |= O_DIRECT; + } else if (strncmp(optarg, "CREAT", 5) == 0 || + strncmp(optarg, "O_CREAT", 5) == 0) { + dest_open_flag |= O_CREAT; + } + break; + case 'd': + debug++; + break; + case 'D': + delay.tv_usec = atoi(optarg); + break; + case 'b': /* block size */ + aio_blksize = strtol(optarg, &endp, 0); + aio_blksize = (long)scale_by_kmg((long long)aio_blksize, *endp); + break; + + case 'n': /* num io */ + aio_maxio = strtol(optarg, &endp, 0); + break; + case 's': /* size to transfer */ + length = strtoll(optarg, &endp, 0); + length = scale_by_kmg(length, *endp); + break; + case 'w': /* no write */ + no_write = 1; + break; + case 'z': /* write zero's */ + zero = 1; + break; + + default: + usage(); + } + } + + argc -= optind; + argv += optind; + +#ifndef DEBUG + if (argc < 1) { + usage(); + } +#else + source_open_flag |= O_DIRECT; + dest_open_flag |= O_DIRECT; + aio_blksize = 1; + aio_maxio=1; + srcname = "junkdata"; + dstname = "ff2"; +#endif + if (!zero) { +#ifndef DEBUG + if ((srcfd = open(srcname = *argv, source_open_flag)) < 0) { +#else + if ((srcfd = open(srcname, source_open_flag)) < 0) { +#endif + perror(srcname); + exit(1); + } + argv++; + argc--; + if (fstat(srcfd, &st) < 0) { + perror("fstat"); + exit(1); + } + if (length == 0) + length = st.st_size; + } + + if (!no_write) { + /* + * We are either copying or writing zeros to dstname + */ +#ifndef DEBUG + if (argc < 1) { + usage(); + } + if ((dstfd = open(dstname = *argv, dest_open_flag, 0666)) < 0) { +#else + if ((dstfd = open(dstname, dest_open_flag, 0666)) < 0) { +#endif + perror(dstname); + exit(1); + } + if (zero) { + /* + * get size of dest, if we are zeroing it. + * TODO: handle devices. + */ + if (fstat(dstfd, &st) < 0) { + perror("fstat"); + exit(1); + } + if (length == 0) + length = st.st_size; + } + } + + /* initialize state machine */ + memset(&myctx, 0, sizeof(myctx)); + io_queue_init(aio_maxio, &myctx); + tocopy = howmany(length, aio_blksize); +printf("tocopy=%d len=%d blk=%d\n", tocopy, length, aio_blksize); + if (init_iocb(aio_maxio, aio_blksize) < 0) { + fprintf(stderr, "Error allocating the i/o buffers\n"); + exit(1); + } + + while (tocopy > 0) { + int i, rc; + /* Submit as many reads as once as possible upto aio_maxio */ + int n = MIN(MIN(aio_maxio - busy, aio_maxio), + howmany(length - offset, aio_blksize)); + if (n > 0) { + struct iocb *ioq[n]; + + for (i = 0; i < n; i++) { + struct iocb *io = alloc_iocb(); + int iosize = MIN(length - offset, aio_blksize); + + if (zero) { + /* + * We are writing zero's to dstfd + */ + io_prep_pwrite(io, dstfd, io->u.c.buf, + iosize, offset); + io_set_callback(io, wr_done); + } else { + io_prep_pread(io, srcfd, io->u.c.buf, + iosize, offset); + io_set_callback(io, rd_done); + } + ioq[i] = io; + offset += iosize; + } + + rc = io_submit(myctx, n, ioq); + if (rc < 0) + io_error("io_submit", rc); + + busy += n; + if (debug > 1) + printf("io_submit(%d) busy:%d\n", n, busy); + if (delay.tv_usec) { + struct timeval t = delay; + (void)select(0,0,0,0,&t); + } + } + + /* + * We have submitted all the i/o requests. Wait for at least one to complete + * and call the callbacks. + */ + count_io_q_waits++; + rc = io_wait_run(myctx, 0); + if (rc < 0) + io_error("io_wait_run", rc); + + if (debug > 1) { + printf("io_wait_run: rc == %d\n", rc); + printf("busy:%d aio_maxio:%d tocopy:%d\n", + busy, aio_maxio, tocopy); + } + } + + if (srcfd != -1) + close(srcfd); + if (dstfd != -1) + close(dstfd); + exit(0); +} + +/* + * Results look like: + * [alanm@toolbox ~/MOT3]$ ../taio -d kernel-source-2.4.8-0.4g.ppc.rpm abc + * rrrrrrrrrrrrrrrwwwrwrrwwrrwrwwrrwrwrwwrrwrwrrrrwwrwwwrrwrrrwwwwwwwwwwwwwwwww + * rrrrrrrrrrrrrrwwwrrwrwrwrwrrwwwwwwwwwwwwwwrrrrrrrrrrrrrrrrrrwwwwrwrwwrwrwrwr + * wrrrrrrrwwwwwwwwwwwwwrrrwrrrwrrwrwwwwwwwwwwrrrrwwrwrrrrrrrrrrrwwwwwwwwwwwrww + * wwwrrrrrrrrwwrrrwwrwrwrwwwrrrrrrrwwwrrwwwrrwrwwwwwwwwrrrrrrrwwwrrrrrrrwwwwww + * wwwwwwwrwrrrrrrrrwrrwrrwrrwrwrrrwrrrwrrrwrwwwwwwwwwwwwwwwwwwrrrwwwrrrrrrrrrr + * rrwrrrrrrwrrwwwwwwwwwwwwwwwwrwwwrrwrwwrrrrrrrrrrrrrrrrrrrwwwwwwwwwwwwwwwwwww + * rrrrrwrrwrwrwrrwrrrwwwwwwwwrrrrwrrrwrwwrwrrrwrrwrrrrwwwwwwwrwrwwwwrwwrrrwrrr + * rrrwwwwwwwrrrrwwrrrrrrrrrrrrwrwrrrrwwwwwwwwwwwwwwrwrrrrwwwwrwrrrrwrwwwrrrwww + * rwwrrrrrrrwrrrrrrrrrrrrwwwwrrrwwwrwrrwwwwwwwwwwwwwwwwwwwwwrrrrrrrwwwwwwwrw + */ diff --git a/tests/generic/250 b/tests/generic/250 new file mode 100755 index 0000000..0953e26 --- /dev/null +++ b/tests/generic/250 @@ -0,0 +1,104 @@ +#! /bin/bash +# FS QA Test No. 250 +# +# Create an unwritten extent, set up dm-error, try a DIO write, then +# make sure we can't read back old disk contents. +# +#----------------------------------------------------------------------- +# Copyright (c) 2016, Oracle and/or its affiliates. All Rights Reserved. +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License as +# published by the Free Software Foundation. +# +# This program is distributed in the hope that it would be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write the Free Software Foundation, +# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA +#----------------------------------------------------------------------- + +seq=`basename "$0"` +seqres="$RESULT_DIR/$seq" +echo "QA output created by $seq" + +here=`pwd` +tmp=/tmp/$$ +status=1 # failure is the default! +trap "_cleanup; exit \$status" 0 1 2 3 15 + +_cleanup() +{ + cd / + rm -rf "$tmp".* "$testdir" + _dmerror_cleanup +} + +# get standard environment, filters and checks +. ./common/rc +. ./common/filter +. ./common/dmerror + +# real QA test starts here +_supported_os Linux +_require_scratch +_require_dm_target error +_require_xfs_io_command "falloc" + +rm -f "$seqres.full" + + +echo "Format and mount" +"$XFS_IO_PROG" -d -c "pwrite -S 0x69 -b 1048576 0 $((64 * 1048576))" "$SCRATCH_DEV" >> "$seqres.full" +_scratch_mkfs_sized $((64 * 1048576)) > "$seqres.full" 2>&1 +_dmerror_init +_dmerror_mount >> "$seqres.full" 2>&1 +_dmerror_unmount +_dmerror_mount + +testdir="$SCRATCH_MNT/test-$seq" +rm -rf $testdir +mkdir $testdir + +blksz=65536 +nr=640 +bsz=128 + +free_blocks=$(stat -f -c '%a' "$testdir") +real_blksz=$(stat -f -c '%S' "$testdir") +space_needed=$(((blksz * nr) * 5 / 4)) +space_avail=$((free_blocks * real_blksz)) +test $space_needed -gt $space_avail && _notrun "Not enough space. $space_avail < $space_needed" + +echo "Create the original files" +#"$XFS_IO_PROG" -c "extsize $((blksz * bsz))" "$testdir" >> "$seqres.full" +"$XFS_IO_PROG" -f -c "falloc 0 $((blksz * nr))" "$testdir/file2" >> "$seqres.full" +_dmerror_unmount +_dmerror_mount + +echo "Compare files" +md5sum "$testdir/file2" | _filter_scratch + +echo "CoW and unmount" +"$XFS_IO_PROG" -f -c "pwrite -S 0x63 $((blksz * bsz)) 1" "$testdir/file2" >> "$seqres.full" +sync +_dmerror_load_error_table +"$XFS_IO_PROG" -d -f -c "pwrite -S 0x63 -b $((blksz * bsz)) 0 $((blksz * nr))" "$testdir/file2" >> "$seqres.full" +_dmerror_load_working_table +_dmerror_unmount +_dmerror_mount + +echo "Compare files" +md5sum "$testdir/file2" | _filter_scratch + +echo "Check for damage" +_dmerror_unmount +_dmerror_cleanup +_repair_scratch_fs >> "$seqres.full" 2>&1 + +# success, all done +status=0 +exit diff --git a/tests/generic/250.out b/tests/generic/250.out new file mode 100644 index 0000000..710c80e --- /dev/null +++ b/tests/generic/250.out @@ -0,0 +1,10 @@ +QA output created by 250 +Format and mount +Create the original files +Compare files +ec8bb3b24d5b0f1b5bdf8c8f0f541ee6 SCRATCH_MNT/test-250/file2 +CoW and unmount +pwrite64: Input/output error +Compare files +3ed86318f4ff8da26c1c2a6e3041f9be SCRATCH_MNT/test-250/file2 +Check for damage diff --git a/tests/generic/252 b/tests/generic/252 new file mode 100755 index 0000000..535b34b --- /dev/null +++ b/tests/generic/252 @@ -0,0 +1,107 @@ +#! /bin/bash +# FS QA Test No. 252 +# +# Create an unwritten extent, set up dm-error, try an AIO DIO write, then +# make sure we can't read back old disk contents. +# +#----------------------------------------------------------------------- +# Copyright (c) 2016, Oracle and/or its affiliates. All Rights Reserved. +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License as +# published by the Free Software Foundation. +# +# This program is distributed in the hope that it would be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write the Free Software Foundation, +# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA +#----------------------------------------------------------------------- + +seq=`basename "$0"` +seqres="$RESULT_DIR/$seq" +echo "QA output created by $seq" + +here=`pwd` +tmp=/tmp/$$ +status=1 # failure is the default! +trap "_cleanup; exit \$status" 0 1 2 3 15 + +_cleanup() +{ + cd / + rm -rf "$tmp".* "$testdir" "$TEST_DIR/moo" + _dmerror_cleanup +} + +# get standard environment, filters and checks +. ./common/rc +. ./common/filter +. ./common/dmerror + +# real QA test starts here +_supported_os Linux +_require_scratch +_require_dm_target error +_require_xfs_io_command "falloc" +AIO_TEST="src/aio-dio-regress/aiocp" +test -x "$AIO_TEST" || _notrun "aiocp not built" + +rm -f "$seqres.full" + + +echo "Format and mount" +"$XFS_IO_PROG" -d -c "pwrite -S 0x69 -b 1048576 0 $((64 * 1048576))" "$SCRATCH_DEV" >> "$seqres.full" +_scratch_mkfs_sized $((64 * 1048576)) > "$seqres.full" 2>&1 +_dmerror_init +_dmerror_mount >> "$seqres.full" 2>&1 +_dmerror_unmount +_dmerror_mount + +testdir="$SCRATCH_MNT/test-$seq" +rm -rf $testdir +mkdir $testdir + +blksz=65536 +nr=640 +bsz=128 + +free_blocks=$(stat -f -c '%a' "$testdir") +real_blksz=$(stat -f -c '%S' "$testdir") +space_needed=$(((blksz * nr) * 5 / 4)) +space_avail=$((free_blocks * real_blksz)) +test $space_needed -gt $space_avail && _notrun "Not enough space. $space_avail < $space_needed" + +echo "Create the original files" +#"$XFS_IO_PROG" -c "extsize $((blksz * bsz))" "$testdir" >> "$seqres.full" +"$XFS_IO_PROG" -f -c "falloc 0 $((blksz * nr))" "$testdir/file2" >> "$seqres.full" +_dmerror_unmount +_dmerror_mount + +echo "Compare files" +md5sum "$testdir/file2" | _filter_scratch + +echo "CoW and unmount" +"$XFS_IO_PROG" -f -c "pwrite -S 0x63 $((blksz * bsz)) 1" "$testdir/file2" >> "$seqres.full" +"$XFS_IO_PROG" -f -c "pwrite -S 0x63 -b $((blksz * bsz)) 0 $((blksz * nr))" "$TEST_DIR/moo" >> "$seqres.full" +sync +_dmerror_load_error_table +"$AIO_TEST" -f DIRECT -b $((blksz * bsz)) "$TEST_DIR/moo" "$testdir/file2" >> "$seqres.full" +_dmerror_load_working_table +_dmerror_unmount +_dmerror_mount + +echo "Compare files" +md5sum "$testdir/file2" | _filter_scratch + +echo "Check for damage" +_dmerror_unmount +_dmerror_cleanup +_repair_scratch_fs >> "$seqres.full" 2>&1 + +# success, all done +status=0 +exit diff --git a/tests/generic/252.out b/tests/generic/252.out new file mode 100644 index 0000000..3bc78c2 --- /dev/null +++ b/tests/generic/252.out @@ -0,0 +1,10 @@ +QA output created by 252 +Format and mount +Create the original files +Compare files +ec8bb3b24d5b0f1b5bdf8c8f0f541ee6 SCRATCH_MNT/test-252/file2 +CoW and unmount +write missed bytes expect 8388608 got 0 +Compare files +3ed86318f4ff8da26c1c2a6e3041f9be SCRATCH_MNT/test-252/file2 +Check for damage diff --git a/tests/generic/group b/tests/generic/group index 860ff4a..1767484 100644 --- a/tests/generic/group +++ b/tests/generic/group @@ -252,7 +252,9 @@ 247 auto quick rw 248 auto quick rw 249 auto quick rw +250 auto quick 251 ioctl trim +252 auto quick 255 auto quick prealloc 256 auto quick 257 dir auto quick From darrick.wong@oracle.com Mon Feb 8 19:12:42 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay3.corp.sgi.com [198.149.34.15]) by oss.sgi.com (Postfix) with ESMTP id 82E5229E0F for ; Mon, 8 Feb 2016 19:12:42 -0600 (CST) Received: from cuda.sgi.com (cuda1.sgi.com [192.48.157.11]) by relay3.corp.sgi.com (Postfix) with ESMTP id 24DF3AC006 for ; Mon, 8 Feb 2016 17:12:42 -0800 (PST) X-ASG-Debug-ID: 1454980357-04bdf066ec03ae0001-NocioJ Received: from userp1040.oracle.com (userp1040.oracle.com [156.151.31.81]) by cuda.sgi.com with ESMTP id GFrOQcLW869rE9CX (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO) for ; Mon, 08 Feb 2016 17:12:38 -0800 (PST) X-Barracuda-Envelope-From: darrick.wong@oracle.com X-Barracuda-Apparent-Source-IP: 156.151.31.81 Received: from aserv0021.oracle.com (aserv0021.oracle.com [141.146.126.233]) by userp1040.oracle.com (Sentrion-MTA-4.3.2/Sentrion-MTA-4.3.2) with ESMTP id u191CWrT014791 (version=TLSv1 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Tue, 9 Feb 2016 01:12:32 GMT Received: from aserv0122.oracle.com (aserv0122.oracle.com [141.146.126.236]) by aserv0021.oracle.com (8.13.8/8.13.8) with ESMTP id u191CWW1001467 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=FAIL); Tue, 9 Feb 2016 01:12:32 GMT Received: from abhmp0009.oracle.com (abhmp0009.oracle.com [141.146.116.15]) by aserv0122.oracle.com (8.13.8/8.13.8) with ESMTP id u191CWoX027636; Tue, 9 Feb 2016 01:12:32 GMT Received: from localhost (/10.145.178.207) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Mon, 08 Feb 2016 17:12:31 -0800 Subject: [PATCH 07/23] reflink: test intersecting CoW and falloc/fpunch/fzero/fcollapse/finsert/ftrunc From: "Darrick J. Wong" X-ASG-Orig-Subj: [PATCH 07/23] reflink: test intersecting CoW and falloc/fpunch/fzero/fcollapse/finsert/ftrunc To: david@fromorbit.com, darrick.wong@oracle.com Cc: linux-btrfs@vger.kernel.org, fstests@vger.kernel.org, xfs@oss.sgi.com Date: Mon, 08 Feb 2016 17:12:30 -0800 Message-ID: <20160209011230.23099.94317.stgit@birch.djwong.org> In-Reply-To: <20160209011145.23099.95354.stgit@birch.djwong.org> References: <20160209011145.23099.95354.stgit@birch.djwong.org> User-Agent: StGit/0.17.1-dirty MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit X-Source-IP: aserv0021.oracle.com [141.146.126.233] X-Barracuda-Connect: userp1040.oracle.com[156.151.31.81] X-Barracuda-Start-Time: 1454980358 X-Barracuda-Encrypted: ECDHE-RSA-AES256-GCM-SHA384 X-Barracuda-URL: https://192.48.157.11:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-BRTS-Status: 1 X-Barracuda-Spam-Score: 0.00 X-Barracuda-Spam-Status: No, SCORE=0.00 using per-user scores of TAG_LEVEL=1000.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.7 tests=BSF_SC0_MISMATCH_TO, UNPARSEABLE_RELAY X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.3.26874 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 0.00 BSF_SC0_MISMATCH_TO Envelope rcpt doesn't match header 0.00 UNPARSEABLE_RELAY Informational: message has unparseable relay lines Ensure that we correctly handle a CoW operation immediately followed by a truncate, falloc, fpunch, fzero, fcollapse, and finsert operation in the middle of the CoW'd region before any flush can occur. Signed-off-by: Darrick J. Wong --- tests/generic/253 | 93 +++++++++++++++++++++++++++++++++++++++++++++++ tests/generic/253.out | 13 +++++++ tests/generic/254 | 93 +++++++++++++++++++++++++++++++++++++++++++++++ tests/generic/254.out | 13 +++++++ tests/generic/259 | 93 +++++++++++++++++++++++++++++++++++++++++++++++ tests/generic/259.out | 13 +++++++ tests/generic/261 | 93 +++++++++++++++++++++++++++++++++++++++++++++++ tests/generic/261.out | 13 +++++++ tests/generic/262 | 96 +++++++++++++++++++++++++++++++++++++++++++++++++ tests/generic/262.out | 13 +++++++ tests/generic/264 | 93 +++++++++++++++++++++++++++++++++++++++++++++++ tests/generic/264.out | 13 +++++++ tests/generic/group | 6 +++ 13 files changed, 645 insertions(+) create mode 100755 tests/generic/253 create mode 100644 tests/generic/253.out create mode 100755 tests/generic/254 create mode 100644 tests/generic/254.out create mode 100755 tests/generic/259 create mode 100644 tests/generic/259.out create mode 100755 tests/generic/261 create mode 100644 tests/generic/261.out create mode 100755 tests/generic/262 create mode 100644 tests/generic/262.out create mode 100755 tests/generic/264 create mode 100644 tests/generic/264.out diff --git a/tests/generic/253 b/tests/generic/253 new file mode 100755 index 0000000..d8e0840 --- /dev/null +++ b/tests/generic/253 @@ -0,0 +1,93 @@ +#! /bin/bash +# FS QA Test No. 253 +# +# Truncate a file at midway through a CoW region. +# +# This test is dependent on the system page size, so we cannot use md5 in +# the golden output; we can only compare to a check file. +# +#----------------------------------------------------------------------- +# Copyright (c) 2016, Oracle and/or its affiliates. All Rights Reserved. +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License as +# published by the Free Software Foundation. +# +# This program is distributed in the hope that it would be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write the Free Software Foundation, +# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA +#----------------------------------------------------------------------- + +seq=`basename "$0"` +seqres="$RESULT_DIR/$seq" +echo "QA output created by $seq" + +here=`pwd` +tmp=/tmp/$$ +status=1 # failure is the default! +trap "_cleanup; exit \$status" 0 1 2 3 15 + +_cleanup() +{ + cd / + rm -rf "$tmp".* +} + +# get standard environment, filters and checks +. ./common/rc +. ./common/filter +. ./common/reflink + +# real QA test starts here +_supported_os Linux +_require_scratch_reflink +_require_cp_reflink +_require_xfs_io_command "truncate" + +rm -f "$seqres.full" + + +echo "Format and mount" +_scratch_mkfs > "$seqres.full" 2>&1 +_scratch_mount >> "$seqres.full" 2>&1 + +testdir="$SCRATCH_MNT/test-$seq" +rm -rf $testdir +mkdir $testdir + +blksz=65536 +nr=4 + +echo "Create the original files" +_pwrite_byte 0x61 0 $((blksz * nr)) "$testdir/file1" >> "$seqres.full" +_cp_reflink "$testdir/file1" "$testdir/file2" >> "$seqres.full" +_pwrite_byte 0x61 0 $((blksz * nr)) "$testdir/file2.chk" >> "$seqres.full" +_scratch_remount + +echo "Compare files" +md5sum "$testdir/file1" | _filter_scratch +md5sum "$testdir/file2" | _filter_scratch +md5sum "$testdir/file2.chk" | _filter_scratch + +echo "CoW and unmount" +"$XFS_IO_PROG" -f -c "pwrite -S 0x62 -b $((blksz * 2)) $blksz $((blksz * 2))" -c "truncate $((blksz * 2))" "$testdir/file2" >> "$seqres.full" +_scratch_remount +"$XFS_IO_PROG" -f -c "pwrite -S 0x62 -b $((blksz * 2)) $blksz $((blksz * 2))" -c "truncate $((blksz * 2))" "$testdir/file2.chk" >> "$seqres.full" +_scratch_remount + +echo "Compare files" +md5sum "$testdir/file1" | _filter_scratch +md5sum "$testdir/file2" | _filter_scratch +md5sum "$testdir/file2.chk" | _filter_scratch + +echo "Check for damage" +umount "$SCRATCH_MNT" + +# success, all done +status=0 +exit diff --git a/tests/generic/253.out b/tests/generic/253.out new file mode 100644 index 0000000..f7c07a0 --- /dev/null +++ b/tests/generic/253.out @@ -0,0 +1,13 @@ +QA output created by 253 +Format and mount +Create the original files +Compare files +c946b71bb69c07daf25470742c967e7c SCRATCH_MNT/test-253/file1 +c946b71bb69c07daf25470742c967e7c SCRATCH_MNT/test-253/file2 +c946b71bb69c07daf25470742c967e7c SCRATCH_MNT/test-253/file2.chk +CoW and unmount +Compare files +c946b71bb69c07daf25470742c967e7c SCRATCH_MNT/test-253/file1 +b5fc98f04b19fa7b2085ec1358c78760 SCRATCH_MNT/test-253/file2 +b5fc98f04b19fa7b2085ec1358c78760 SCRATCH_MNT/test-253/file2.chk +Check for damage diff --git a/tests/generic/254 b/tests/generic/254 new file mode 100755 index 0000000..c66b2f4 --- /dev/null +++ b/tests/generic/254 @@ -0,0 +1,93 @@ +#! /bin/bash +# FS QA Test No. 254 +# +# Punch a file at midway through a CoW region. +# +# This test is dependent on the system page size, so we cannot use md5 in +# the golden output; we can only compare to a check file. +# +#----------------------------------------------------------------------- +# Copyright (c) 2016, Oracle and/or its affiliates. All Rights Reserved. +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License as +# published by the Free Software Foundation. +# +# This program is distributed in the hope that it would be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write the Free Software Foundation, +# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA +#----------------------------------------------------------------------- + +seq=`basename "$0"` +seqres="$RESULT_DIR/$seq" +echo "QA output created by $seq" + +here=`pwd` +tmp=/tmp/$$ +status=1 # failure is the default! +trap "_cleanup; exit \$status" 0 1 2 3 15 + +_cleanup() +{ + cd / + rm -rf "$tmp".* +} + +# get standard environment, filters and checks +. ./common/rc +. ./common/filter +. ./common/reflink + +# real QA test starts here +_supported_os Linux +_require_scratch_reflink +_require_cp_reflink +_require_xfs_io_command "fpunch" + +rm -f "$seqres.full" + + +echo "Format and mount" +_scratch_mkfs > "$seqres.full" 2>&1 +_scratch_mount >> "$seqres.full" 2>&1 + +testdir="$SCRATCH_MNT/test-$seq" +rm -rf $testdir +mkdir $testdir + +blksz=65536 +nr=5 + +echo "Create the original files" +_pwrite_byte 0x61 0 $((blksz * nr)) "$testdir/file1" >> "$seqres.full" +_cp_reflink "$testdir/file1" "$testdir/file2" >> "$seqres.full" +_pwrite_byte 0x61 0 $((blksz * nr)) "$testdir/file2.chk" >> "$seqres.full" +_scratch_remount + +echo "Compare files" +md5sum "$testdir/file1" | _filter_scratch +md5sum "$testdir/file2" | _filter_scratch +md5sum "$testdir/file2.chk" | _filter_scratch + +echo "CoW and unmount" +"$XFS_IO_PROG" -f -c "pwrite -S 0x62 -b $((blksz * 3)) $blksz $((blksz * 3))" -c "fpunch $((blksz * 2)) $blksz" "$testdir/file2" >> "$seqres.full" +_scratch_remount +"$XFS_IO_PROG" -f -c "pwrite -S 0x62 -b $((blksz * 3)) $blksz $((blksz * 3))" -c "pwrite -S 0x00 $((blksz * 2)) $blksz" "$testdir/file2.chk" >> "$seqres.full" +_scratch_remount + +echo "Compare files" +md5sum "$testdir/file1" | _filter_scratch +md5sum "$testdir/file2" | _filter_scratch +md5sum "$testdir/file2.chk" | _filter_scratch + +echo "Check for damage" +umount "$SCRATCH_MNT" + +# success, all done +status=0 +exit diff --git a/tests/generic/254.out b/tests/generic/254.out new file mode 100644 index 0000000..00d2121 --- /dev/null +++ b/tests/generic/254.out @@ -0,0 +1,13 @@ +QA output created by 254 +Format and mount +Create the original files +Compare files +17af09af790a9b4c79cddf72f6b642cb SCRATCH_MNT/test-254/file1 +17af09af790a9b4c79cddf72f6b642cb SCRATCH_MNT/test-254/file2 +17af09af790a9b4c79cddf72f6b642cb SCRATCH_MNT/test-254/file2.chk +CoW and unmount +Compare files +17af09af790a9b4c79cddf72f6b642cb SCRATCH_MNT/test-254/file1 +b9f7a56c2ab90569cb19d8597583c6a6 SCRATCH_MNT/test-254/file2 +b9f7a56c2ab90569cb19d8597583c6a6 SCRATCH_MNT/test-254/file2.chk +Check for damage diff --git a/tests/generic/259 b/tests/generic/259 new file mode 100755 index 0000000..3307144 --- /dev/null +++ b/tests/generic/259 @@ -0,0 +1,93 @@ +#! /bin/bash +# FS QA Test No. 259 +# +# fzero a file at midway through a CoW region. +# +# This test is dependent on the system page size, so we cannot use md5 in +# the golden output; we can only compare to a check file. +# +#----------------------------------------------------------------------- +# Copyright (c) 2016, Oracle and/or its affiliates. All Rights Reserved. +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License as +# published by the Free Software Foundation. +# +# This program is distributed in the hope that it would be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write the Free Software Foundation, +# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA +#----------------------------------------------------------------------- + +seq=`basename "$0"` +seqres="$RESULT_DIR/$seq" +echo "QA output created by $seq" + +here=`pwd` +tmp=/tmp/$$ +status=1 # failure is the default! +trap "_cleanup; exit \$status" 0 1 2 3 15 + +_cleanup() +{ + cd / + rm -rf "$tmp".* +} + +# get standard environment, filters and checks +. ./common/rc +. ./common/filter +. ./common/reflink + +# real QA test starts here +_supported_os Linux +_require_scratch_reflink +_require_cp_reflink +_require_xfs_io_command "fzero" + +rm -f "$seqres.full" + + +echo "Format and mount" +_scratch_mkfs > "$seqres.full" 2>&1 +_scratch_mount >> "$seqres.full" 2>&1 + +testdir="$SCRATCH_MNT/test-$seq" +rm -rf $testdir +mkdir $testdir + +blksz=65536 +nr=5 + +echo "Create the original files" +_pwrite_byte 0x61 0 $((blksz * nr)) "$testdir/file1" >> "$seqres.full" +_cp_reflink "$testdir/file1" "$testdir/file2" >> "$seqres.full" +_pwrite_byte 0x61 0 $((blksz * nr)) "$testdir/file2.chk" >> "$seqres.full" +_scratch_remount + +echo "Compare files" +md5sum "$testdir/file1" | _filter_scratch +md5sum "$testdir/file2" | _filter_scratch +md5sum "$testdir/file2.chk" | _filter_scratch + +echo "CoW and unmount" +"$XFS_IO_PROG" -f -c "pwrite -S 0x62 -b $((blksz * 3)) $blksz $((blksz * 3))" -c "fzero $((blksz * 2)) $blksz" "$testdir/file2" >> "$seqres.full" +_scratch_remount +"$XFS_IO_PROG" -f -c "pwrite -S 0x62 -b $((blksz * 3)) $blksz $((blksz * 3))" -c "pwrite -S 0x00 $((blksz * 2)) $blksz" "$testdir/file2.chk" >> "$seqres.full" +_scratch_remount + +echo "Compare files" +md5sum "$testdir/file1" | _filter_scratch +md5sum "$testdir/file2" | _filter_scratch +md5sum "$testdir/file2.chk" | _filter_scratch + +echo "Check for damage" +umount "$SCRATCH_MNT" + +# success, all done +status=0 +exit diff --git a/tests/generic/259.out b/tests/generic/259.out new file mode 100644 index 0000000..ebe1020 --- /dev/null +++ b/tests/generic/259.out @@ -0,0 +1,13 @@ +QA output created by 259 +Format and mount +Create the original files +Compare files +17af09af790a9b4c79cddf72f6b642cb SCRATCH_MNT/test-259/file1 +17af09af790a9b4c79cddf72f6b642cb SCRATCH_MNT/test-259/file2 +17af09af790a9b4c79cddf72f6b642cb SCRATCH_MNT/test-259/file2.chk +CoW and unmount +Compare files +17af09af790a9b4c79cddf72f6b642cb SCRATCH_MNT/test-259/file1 +b9f7a56c2ab90569cb19d8597583c6a6 SCRATCH_MNT/test-259/file2 +b9f7a56c2ab90569cb19d8597583c6a6 SCRATCH_MNT/test-259/file2.chk +Check for damage diff --git a/tests/generic/261 b/tests/generic/261 new file mode 100755 index 0000000..3027a63 --- /dev/null +++ b/tests/generic/261 @@ -0,0 +1,93 @@ +#! /bin/bash +# FS QA Test No. 261 +# +# fcollapse a file at midway through a CoW region. +# +# This test is dependent on the system page size, so we cannot use md5 in +# the golden output; we can only compare to a check file. +# +#----------------------------------------------------------------------- +# Copyright (c) 2016, Oracle and/or its affiliates. All Rights Reserved. +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License as +# published by the Free Software Foundation. +# +# This program is distributed in the hope that it would be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write the Free Software Foundation, +# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA +#----------------------------------------------------------------------- + +seq=`basename "$0"` +seqres="$RESULT_DIR/$seq" +echo "QA output created by $seq" + +here=`pwd` +tmp=/tmp/$$ +status=1 # failure is the default! +trap "_cleanup; exit \$status" 0 1 2 3 15 + +_cleanup() +{ + cd / + rm -rf "$tmp".* +} + +# get standard environment, filters and checks +. ./common/rc +. ./common/filter +. ./common/reflink + +# real QA test starts here +_supported_os Linux +_require_scratch_reflink +_require_cp_reflink +_require_xfs_io_command "fcollapse" + +rm -f "$seqres.full" + + +echo "Format and mount" +_scratch_mkfs > "$seqres.full" 2>&1 +_scratch_mount >> "$seqres.full" 2>&1 + +testdir="$SCRATCH_MNT/test-$seq" +rm -rf $testdir +mkdir $testdir + +blksz=65536 +nr=5 + +echo "Create the original files" +_pwrite_byte 0x61 0 $((blksz * nr)) "$testdir/file1" >> "$seqres.full" +_cp_reflink "$testdir/file1" "$testdir/file2" >> "$seqres.full" +_pwrite_byte 0x61 0 $((blksz * nr)) "$testdir/file2.chk" >> "$seqres.full" +_scratch_remount + +echo "Compare files" +md5sum "$testdir/file1" | _filter_scratch +md5sum "$testdir/file2" | _filter_scratch +md5sum "$testdir/file2.chk" | _filter_scratch + +echo "CoW and unmount" +"$XFS_IO_PROG" -f -c "pwrite -S 0x62 -b $((blksz * 3)) $blksz $((blksz * 3))" -c "fcollapse $((blksz * 2)) $blksz" "$testdir/file2" >> "$seqres.full" +_scratch_remount +"$XFS_IO_PROG" -f -c "pwrite -S 0x62 -b $((blksz * 2)) $blksz $((blksz * 2))" -c "truncate $((blksz * (nr - 1)))" "$testdir/file2.chk" >> "$seqres.full" +_scratch_remount + +echo "Compare files" +md5sum "$testdir/file1" | _filter_scratch +md5sum "$testdir/file2" | _filter_scratch +md5sum "$testdir/file2.chk" | _filter_scratch + +echo "Check for damage" +umount "$SCRATCH_MNT" + +# success, all done +status=0 +exit diff --git a/tests/generic/261.out b/tests/generic/261.out new file mode 100644 index 0000000..7e0e562 --- /dev/null +++ b/tests/generic/261.out @@ -0,0 +1,13 @@ +QA output created by 261 +Format and mount +Create the original files +Compare files +17af09af790a9b4c79cddf72f6b642cb SCRATCH_MNT/test-261/file1 +17af09af790a9b4c79cddf72f6b642cb SCRATCH_MNT/test-261/file2 +17af09af790a9b4c79cddf72f6b642cb SCRATCH_MNT/test-261/file2.chk +CoW and unmount +Compare files +17af09af790a9b4c79cddf72f6b642cb SCRATCH_MNT/test-261/file1 +91b31bb8bffa8c3d3374445039287226 SCRATCH_MNT/test-261/file2 +91b31bb8bffa8c3d3374445039287226 SCRATCH_MNT/test-261/file2.chk +Check for damage diff --git a/tests/generic/262 b/tests/generic/262 new file mode 100755 index 0000000..4050f34 --- /dev/null +++ b/tests/generic/262 @@ -0,0 +1,96 @@ +#! /bin/bash +# FS QA Test No. 262 +# +# finsert a file at midway through a CoW region. +# +# This test is dependent on the system page size, so we cannot use md5 in +# the golden output; we can only compare to a check file. +# +#----------------------------------------------------------------------- +# Copyright (c) 2016, Oracle and/or its affiliates. All Rights Reserved. +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License as +# published by the Free Software Foundation. +# +# This program is distributed in the hope that it would be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write the Free Software Foundation, +# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA +#----------------------------------------------------------------------- + +seq=`basename "$0"` +seqres="$RESULT_DIR/$seq" +echo "QA output created by $seq" + +here=`pwd` +tmp=/tmp/$$ +status=1 # failure is the default! +trap "_cleanup; exit \$status" 0 1 2 3 15 + +_cleanup() +{ + cd / + rm -rf "$tmp".* +} + +# get standard environment, filters and checks +. ./common/rc +. ./common/filter +. ./common/reflink + +# real QA test starts here +_supported_os Linux +_require_scratch_reflink +_require_cp_reflink +_require_xfs_io_command "finsert" + +rm -f "$seqres.full" + + +echo "Format and mount" +_scratch_mkfs > "$seqres.full" 2>&1 +_scratch_mount >> "$seqres.full" 2>&1 + +testdir="$SCRATCH_MNT/test-$seq" +rm -rf $testdir +mkdir $testdir + +blksz=65536 +nr=4 + +echo "Create the original files" +_pwrite_byte 0x61 0 $((blksz * nr)) "$testdir/file1" >> "$seqres.full" +_cp_reflink "$testdir/file1" "$testdir/file2" >> "$seqres.full" +_pwrite_byte 0x61 0 $((blksz * nr)) "$testdir/file2.chk" >> "$seqres.full" +_scratch_remount + +echo "Compare files" +md5sum "$testdir/file1" | _filter_scratch +md5sum "$testdir/file2" | _filter_scratch +md5sum "$testdir/file2.chk" | _filter_scratch + +echo "CoW and unmount" +"$XFS_IO_PROG" -f -c "pwrite -S 0x62 -b $((blksz * 2)) $blksz $((blksz * 2))" -c "finsert $((blksz * 2)) $blksz" "$testdir/file2" >> "$seqres.full" +_scratch_remount +_pwrite_byte 0x62 $blksz $blksz "$testdir/file2.chk" >> "$seqres.full" +_pwrite_byte 0x00 $((blksz * 2)) $blksz "$testdir/file2.chk" >> "$seqres.full" +_pwrite_byte 0x62 $((blksz * 3)) $blksz "$testdir/file2.chk" >> "$seqres.full" +_pwrite_byte 0x61 $((blksz * 4)) $blksz "$testdir/file2.chk" >> "$seqres.full" +_scratch_remount + +echo "Compare files" +md5sum "$testdir/file1" | _filter_scratch +md5sum "$testdir/file2" | _filter_scratch +md5sum "$testdir/file2.chk" | _filter_scratch + +echo "Check for damage" +umount "$SCRATCH_MNT" + +# success, all done +status=0 +exit diff --git a/tests/generic/262.out b/tests/generic/262.out new file mode 100644 index 0000000..cc582ba --- /dev/null +++ b/tests/generic/262.out @@ -0,0 +1,13 @@ +QA output created by 262 +Format and mount +Create the original files +Compare files +c946b71bb69c07daf25470742c967e7c SCRATCH_MNT/test-262/file1 +c946b71bb69c07daf25470742c967e7c SCRATCH_MNT/test-262/file2 +c946b71bb69c07daf25470742c967e7c SCRATCH_MNT/test-262/file2.chk +CoW and unmount +Compare files +c946b71bb69c07daf25470742c967e7c SCRATCH_MNT/test-262/file1 +b9f7a56c2ab90569cb19d8597583c6a6 SCRATCH_MNT/test-262/file2 +b9f7a56c2ab90569cb19d8597583c6a6 SCRATCH_MNT/test-262/file2.chk +Check for damage diff --git a/tests/generic/264 b/tests/generic/264 new file mode 100755 index 0000000..7a81fa7 --- /dev/null +++ b/tests/generic/264 @@ -0,0 +1,93 @@ +#! /bin/bash +# FS QA Test No. 264 +# +# fallocate a file at midway through a CoW region. +# +# This test is dependent on the system page size, so we cannot use md5 in +# the golden output; we can only compare to a check file. +# +#----------------------------------------------------------------------- +# Copyright (c) 2016, Oracle and/or its affiliates. All Rights Reserved. +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License as +# published by the Free Software Foundation. +# +# This program is distributed in the hope that it would be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write the Free Software Foundation, +# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA +#----------------------------------------------------------------------- + +seq=`basename "$0"` +seqres="$RESULT_DIR/$seq" +echo "QA output created by $seq" + +here=`pwd` +tmp=/tmp/$$ +status=1 # failure is the default! +trap "_cleanup; exit \$status" 0 1 2 3 15 + +_cleanup() +{ + cd / + rm -rf "$tmp".* +} + +# get standard environment, filters and checks +. ./common/rc +. ./common/filter +. ./common/reflink + +# real QA test starts here +_supported_os Linux +_require_scratch_reflink +_require_cp_reflink +_require_xfs_io_command "falloc" + +rm -f "$seqres.full" + + +echo "Format and mount" +_scratch_mkfs > "$seqres.full" 2>&1 +_scratch_mount >> "$seqres.full" 2>&1 + +testdir="$SCRATCH_MNT/test-$seq" +rm -rf $testdir +mkdir $testdir + +blksz=65536 +nr=5 + +echo "Create the original files" +_pwrite_byte 0x61 0 $((blksz * nr)) "$testdir/file1" >> "$seqres.full" +_cp_reflink "$testdir/file1" "$testdir/file2" >> "$seqres.full" +_pwrite_byte 0x61 0 $((blksz * nr)) "$testdir/file2.chk" >> "$seqres.full" +_scratch_remount + +echo "Compare files" +md5sum "$testdir/file1" | _filter_scratch +md5sum "$testdir/file2" | _filter_scratch +md5sum "$testdir/file2.chk" | _filter_scratch + +echo "CoW and unmount" +"$XFS_IO_PROG" -f -c "pwrite -S 0x62 -b $((blksz * 3)) $blksz $((blksz * 3))" -c "falloc $((blksz * 2)) $blksz" "$testdir/file2" >> "$seqres.full" +_scratch_remount +"$XFS_IO_PROG" -f -c "pwrite -S 0x62 -b $((blksz * 3)) $blksz $((blksz * 3))" "$testdir/file2.chk" >> "$seqres.full" +_scratch_remount + +echo "Compare files" +md5sum "$testdir/file1" | _filter_scratch +md5sum "$testdir/file2" | _filter_scratch +md5sum "$testdir/file2.chk" | _filter_scratch + +echo "Check for damage" +umount "$SCRATCH_MNT" + +# success, all done +status=0 +exit diff --git a/tests/generic/264.out b/tests/generic/264.out new file mode 100644 index 0000000..de175f9 --- /dev/null +++ b/tests/generic/264.out @@ -0,0 +1,13 @@ +QA output created by 264 +Format and mount +Create the original files +Compare files +17af09af790a9b4c79cddf72f6b642cb SCRATCH_MNT/test-264/file1 +17af09af790a9b4c79cddf72f6b642cb SCRATCH_MNT/test-264/file2 +17af09af790a9b4c79cddf72f6b642cb SCRATCH_MNT/test-264/file2.chk +CoW and unmount +Compare files +17af09af790a9b4c79cddf72f6b642cb SCRATCH_MNT/test-264/file1 +3383b9c17e643acd1a9a249cf041e183 SCRATCH_MNT/test-264/file2 +3383b9c17e643acd1a9a249cf041e183 SCRATCH_MNT/test-264/file2.chk +Check for damage diff --git a/tests/generic/group b/tests/generic/group index 1767484..0b584d9 100644 --- a/tests/generic/group +++ b/tests/generic/group @@ -255,12 +255,18 @@ 250 auto quick 251 ioctl trim 252 auto quick +253 auto quick clone +254 auto quick clone 255 auto quick prealloc 256 auto quick 257 dir auto quick 258 auto quick +259 auto quick clone 260 auto quick trim +261 auto quick clone +262 auto quick clone 263 rw auto quick +264 auto quick clone 269 auto rw prealloc ioctl enospc stress 270 auto quota rw prealloc ioctl enospc stress 273 auto rw From darrick.wong@oracle.com Mon Feb 8 19:12:53 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay3.corp.sgi.com [198.149.34.15]) by oss.sgi.com (Postfix) with ESMTP id 4CB5329DF5 for ; Mon, 8 Feb 2016 19:12:53 -0600 (CST) Received: from cuda.sgi.com (cuda3.sgi.com [192.48.176.15]) by relay3.corp.sgi.com (Postfix) with ESMTP id A1702AC003 for ; Mon, 8 Feb 2016 17:12:52 -0800 (PST) X-ASG-Debug-ID: 1454980365-04cb6c1e5803580001-NocioJ Received: from aserp1040.oracle.com (aserp1040.oracle.com [141.146.126.69]) by cuda.sgi.com with ESMTP id kO5vKlFcxQbOCpOC (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO) for ; Mon, 08 Feb 2016 17:12:45 -0800 (PST) X-Barracuda-Envelope-From: darrick.wong@oracle.com X-Barracuda-Apparent-Source-IP: 141.146.126.69 Received: from aserv0021.oracle.com (aserv0021.oracle.com [141.146.126.233]) by aserp1040.oracle.com (Sentrion-MTA-4.3.2/Sentrion-MTA-4.3.2) with ESMTP id u191CeBi019230 (version=TLSv1 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Tue, 9 Feb 2016 01:12:40 GMT Received: from userv0122.oracle.com (userv0122.oracle.com [156.151.31.75]) by aserv0021.oracle.com (8.13.8/8.13.8) with ESMTP id u191Cd0g001656 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=FAIL); Tue, 9 Feb 2016 01:12:39 GMT Received: from abhmp0019.oracle.com (abhmp0019.oracle.com [141.146.116.25]) by userv0122.oracle.com (8.14.4/8.14.4) with ESMTP id u191CdkV023147; Tue, 9 Feb 2016 01:12:39 GMT Received: from localhost (/10.145.178.207) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Mon, 08 Feb 2016 17:12:38 -0800 Subject: [PATCH 08/23] reflink: test CoW behavior with IO errors From: "Darrick J. Wong" X-ASG-Orig-Subj: [PATCH 08/23] reflink: test CoW behavior with IO errors To: david@fromorbit.com, darrick.wong@oracle.com Cc: linux-btrfs@vger.kernel.org, fstests@vger.kernel.org, xfs@oss.sgi.com Date: Mon, 08 Feb 2016 17:12:36 -0800 Message-ID: <20160209011236.23099.3947.stgit@birch.djwong.org> In-Reply-To: <20160209011145.23099.95354.stgit@birch.djwong.org> References: <20160209011145.23099.95354.stgit@birch.djwong.org> User-Agent: StGit/0.17.1-dirty MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit X-Source-IP: aserv0021.oracle.com [141.146.126.233] X-Barracuda-Connect: aserp1040.oracle.com[141.146.126.69] X-Barracuda-Start-Time: 1454980365 X-Barracuda-Encrypted: ECDHE-RSA-AES256-GCM-SHA384 X-Barracuda-URL: https://192.48.176.15:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-BRTS-Status: 1 X-Barracuda-Spam-Score: 0.00 X-Barracuda-Spam-Status: No, SCORE=0.00 using per-user scores of TAG_LEVEL=1000.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.7 tests=BSF_SC0_MISMATCH_TO, UNPARSEABLE_RELAY X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.3.26874 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 0.00 BSF_SC0_MISMATCH_TO Envelope rcpt doesn't match header 0.00 UNPARSEABLE_RELAY Informational: message has unparseable relay lines Test various scenarios (with dm-flakey) where we simulate write failures during CoW, to see if the FS can get through it without blowing up or corrupting data. Plumb in a FS-generic method to sort out repairing filesystems after they get hit by IO errors. Signed-off-by: Darrick J. Wong --- common/rc | 28 +++++++++++++ tests/generic/265 | 102 +++++++++++++++++++++++++++++++++++++++++++++++ tests/generic/265.out | 11 +++++ tests/generic/266 | 103 +++++++++++++++++++++++++++++++++++++++++++++++ tests/generic/266.out | 12 +++++ tests/generic/267 | 103 +++++++++++++++++++++++++++++++++++++++++++++++ tests/generic/267.out | 10 +++++ tests/generic/268 | 106 +++++++++++++++++++++++++++++++++++++++++++++++++ tests/generic/268.out | 12 +++++ tests/generic/271 | 102 +++++++++++++++++++++++++++++++++++++++++++++++ tests/generic/271.out | 11 +++++ tests/generic/272 | 103 +++++++++++++++++++++++++++++++++++++++++++++++ tests/generic/272.out | 12 +++++ tests/generic/276 | 103 +++++++++++++++++++++++++++++++++++++++++++++++ tests/generic/276.out | 11 +++++ tests/generic/278 | 106 +++++++++++++++++++++++++++++++++++++++++++++++++ tests/generic/278.out | 12 +++++ tests/generic/279 | 103 +++++++++++++++++++++++++++++++++++++++++++++++ tests/generic/279.out | 11 +++++ tests/generic/281 | 104 ++++++++++++++++++++++++++++++++++++++++++++++++ tests/generic/281.out | 12 +++++ tests/generic/282 | 104 ++++++++++++++++++++++++++++++++++++++++++++++++ tests/generic/282.out | 10 +++++ tests/generic/283 | 107 +++++++++++++++++++++++++++++++++++++++++++++++++ tests/generic/283.out | 12 +++++ tests/generic/group | 12 +++++ 26 files changed, 1422 insertions(+) create mode 100755 tests/generic/265 create mode 100644 tests/generic/265.out create mode 100755 tests/generic/266 create mode 100644 tests/generic/266.out create mode 100755 tests/generic/267 create mode 100644 tests/generic/267.out create mode 100755 tests/generic/268 create mode 100644 tests/generic/268.out create mode 100755 tests/generic/271 create mode 100644 tests/generic/271.out create mode 100755 tests/generic/272 create mode 100644 tests/generic/272.out create mode 100755 tests/generic/276 create mode 100644 tests/generic/276.out create mode 100755 tests/generic/278 create mode 100644 tests/generic/278.out create mode 100755 tests/generic/279 create mode 100644 tests/generic/279.out create mode 100755 tests/generic/281 create mode 100644 tests/generic/281.out create mode 100755 tests/generic/282 create mode 100644 tests/generic/282.out create mode 100755 tests/generic/283 create mode 100644 tests/generic/283.out diff --git a/common/rc b/common/rc index 863d4b3..467c217 100644 --- a/common/rc +++ b/common/rc @@ -953,6 +953,34 @@ _scratch_xfs_repair() $XFS_REPAIR_PROG $SCRATCH_OPTIONS $* $SCRATCH_DEV } +_repair_scratch_fs() +{ + case $FSTYP in + xfs) + _scratch_xfs_repair "$@" + res=$? + if [ "$res" -eq 2 ]; then + echo "xfs_repair returns $res; replay log?" + _scratch_mount + res=$? + if [ "$res" -gt 0 ]; then + echo "mount returns $res; zap log?" + _scratch_xfs_repair -L + echo "log zap returns $?" + else + umount "$SCRATCH_MNT" + fi + _scratch_xfs_repair "$@" + fi + echo "error $?" + ;; + *) + # Let's hope fsck -y suffices... + fsck -t $FSTYP -y $SCRATCH_DEV + ;; + esac +} + _get_pids_by_name() { if [ $# -ne 1 ] diff --git a/tests/generic/265 b/tests/generic/265 new file mode 100755 index 0000000..e91b307 --- /dev/null +++ b/tests/generic/265 @@ -0,0 +1,102 @@ +#! /bin/bash +# FS QA Test No. 265 +# +# Test CoW behavior when the write temporarily fails. +# +#----------------------------------------------------------------------- +# Copyright (c) 2016, Oracle and/or its affiliates. All Rights Reserved. +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License as +# published by the Free Software Foundation. +# +# This program is distributed in the hope that it would be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write the Free Software Foundation, +# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA +#----------------------------------------------------------------------- + +seq=`basename "$0"` +seqres="$RESULT_DIR/$seq" +echo "QA output created by $seq" + +here=`pwd` +tmp=/tmp/$$ +status=1 # failure is the default! +trap "_cleanup; exit \$status" 0 1 2 3 15 + +_cleanup() +{ + cd / + rm -rf "$tmp".* + _dmerror_cleanup +} + +# get standard environment, filters and checks +. ./common/rc +. ./common/filter +. ./common/reflink +. ./common/dmerror + +# real QA test starts here +_supported_os Linux +_require_scratch_reflink +_require_cp_reflink +_need_to_be_root +_require_dm_target error + +rm -f "$seqres.full" + + +echo "Format and mount" +_scratch_mkfs > "$seqres.full" 2>&1 +_dmerror_init +_dmerror_mount >> "$seqres.full" 2>&1 + +testdir="$SCRATCH_MNT/test-$seq" +rm -rf $testdir +mkdir $testdir + +blksz=65536 +nr=640 +bsz=128 + +free_blocks=$(stat -f -c '%a' "$testdir") +real_blksz=$(stat -f -c '%S' "$testdir") +space_needed=$(((blksz * nr * 3) * 5 / 4)) +space_avail=$((free_blocks * real_blksz)) +test $space_needed -gt $space_avail && _notrun "Not enough space. $space_avail < $space_needed" + +echo "Create the original files" +"$XFS_IO_PROG" -f -c "pwrite -S 0x61 -b $((blksz * bsz)) 0 $((blksz * nr))" "$testdir/file1" >> "$seqres.full" +_cp_reflink "$testdir/file1" "$testdir/file2" >> "$seqres.full" +_dmerror_unmount +_dmerror_mount + +echo "Compare files" +md5sum "$testdir/file1" | _filter_scratch +md5sum "$testdir/file2" | _filter_scratch + +echo "CoW and unmount" +sync +_dmerror_load_error_table +"$XFS_IO_PROG" -f -c "pwrite -S 0x63 -b $((blksz * bsz)) 0 $((blksz * nr))" -c "fdatasync" "$testdir/file2" >> "$seqres.full" +_dmerror_load_working_table +_dmerror_unmount +_dmerror_mount + +echo "Compare files" +md5sum "$testdir/file1" | _filter_scratch + +echo "Check for damage" +_dmerror_unmount +_dmerror_cleanup +_repair_scratch_fs >> "$seqres.full" 2>&1 + +# success, all done +status=0 +exit diff --git a/tests/generic/265.out b/tests/generic/265.out new file mode 100644 index 0000000..1b67114 --- /dev/null +++ b/tests/generic/265.out @@ -0,0 +1,11 @@ +QA output created by 265 +Format and mount +Create the original files +Compare files +1886e67cf8783e89ce6ddc5bb09a3944 SCRATCH_MNT/test-265/file1 +1886e67cf8783e89ce6ddc5bb09a3944 SCRATCH_MNT/test-265/file2 +CoW and unmount +fdatasync: Input/output error +Compare files +1886e67cf8783e89ce6ddc5bb09a3944 SCRATCH_MNT/test-265/file1 +Check for damage diff --git a/tests/generic/266 b/tests/generic/266 new file mode 100755 index 0000000..a100348 --- /dev/null +++ b/tests/generic/266 @@ -0,0 +1,103 @@ +#! /bin/bash +# FS QA Test No. 266 +# +# Test CoW behavior when the write permanently fails. +# +#----------------------------------------------------------------------- +# Copyright (c) 2016, Oracle and/or its affiliates. All Rights Reserved. +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License as +# published by the Free Software Foundation. +# +# This program is distributed in the hope that it would be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write the Free Software Foundation, +# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA +#----------------------------------------------------------------------- + +seq=`basename "$0"` +seqres="$RESULT_DIR/$seq" +echo "QA output created by $seq" + +here=`pwd` +tmp=/tmp/$$ +status=1 # failure is the default! +trap "_cleanup; exit \$status" 0 1 2 3 15 + +_cleanup() +{ + cd / + rm -rf "$tmp".* + _dmerror_cleanup +} + +# get standard environment, filters and checks +. ./common/rc +. ./common/filter +. ./common/reflink +. ./common/dmerror + +# real QA test starts here +_supported_os Linux +_require_scratch_reflink +_require_cp_reflink +_need_to_be_root +_require_dm_target error + +rm -f "$seqres.full" + + +echo "Format and mount" +_scratch_mkfs > "$seqres.full" 2>&1 +_dmerror_init +_dmerror_mount >> "$seqres.full" 2>&1 + +testdir="$SCRATCH_MNT/test-$seq" +rm -rf $testdir +mkdir $testdir + +blksz=65536 +nr=640 +bsz=128 + +free_blocks=$(stat -f -c '%a' "$testdir") +real_blksz=$(stat -f -c '%S' "$testdir") +space_needed=$(((blksz * nr * 3) * 5 / 4)) +space_avail=$((free_blocks * real_blksz)) +test $space_needed -gt $space_avail && _notrun "Not enough space. $space_avail < $space_needed" + +echo "Create the original files" +"$XFS_IO_PROG" -f -c "pwrite -S 0x61 -b $((blksz * bsz)) 0 $((blksz * nr))" "$testdir/file1" >> "$seqres.full" +_cp_reflink "$testdir/file1" "$testdir/file2" >> "$seqres.full" +_dmerror_unmount +_dmerror_mount + +echo "Compare files" +md5sum "$testdir/file1" | _filter_scratch +md5sum "$testdir/file2" | _filter_scratch + +echo "CoW and unmount" +sync +_dmerror_load_error_table +"$XFS_IO_PROG" -f -c "pwrite -S 0x63 -b $((blksz * bsz)) 0 $((blksz * nr))" -c "fdatasync" "$testdir/file2" >> "$seqres.full" + +echo "Clean up the mess" +_dmerror_unmount +_dmerror_cleanup +_repair_scratch_fs >> "$seqres.full" 2>&1 +_scratch_mount >> "$seqres.full" 2>&1 + +echo "Compare files" +md5sum "$testdir/file1" | _filter_scratch + +echo "Check for damage" +umount "$SCRATCH_MNT" + +# success, all done +status=0 +exit diff --git a/tests/generic/266.out b/tests/generic/266.out new file mode 100644 index 0000000..bcfa097 --- /dev/null +++ b/tests/generic/266.out @@ -0,0 +1,12 @@ +QA output created by 266 +Format and mount +Create the original files +Compare files +1886e67cf8783e89ce6ddc5bb09a3944 SCRATCH_MNT/test-266/file1 +1886e67cf8783e89ce6ddc5bb09a3944 SCRATCH_MNT/test-266/file2 +CoW and unmount +fdatasync: Input/output error +Clean up the mess +Compare files +1886e67cf8783e89ce6ddc5bb09a3944 SCRATCH_MNT/test-266/file1 +Check for damage diff --git a/tests/generic/267 b/tests/generic/267 new file mode 100755 index 0000000..25aaed7 --- /dev/null +++ b/tests/generic/267 @@ -0,0 +1,103 @@ +#! /bin/bash +# FS QA Test No. 267 +# +# Test CoW behavior when the write temporarily fails and we unmount. +# +#----------------------------------------------------------------------- +# Copyright (c) 2016, Oracle and/or its affiliates. All Rights Reserved. +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License as +# published by the Free Software Foundation. +# +# This program is distributed in the hope that it would be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write the Free Software Foundation, +# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA +#----------------------------------------------------------------------- + +seq=`basename "$0"` +seqres="$RESULT_DIR/$seq" +echo "QA output created by $seq" + +here=`pwd` +tmp=/tmp/$$ +status=1 # failure is the default! +trap "_cleanup; exit \$status" 0 1 2 3 15 + +_cleanup() +{ + cd / + rm -rf "$tmp".* + _dmerror_cleanup +} + +# get standard environment, filters and checks +. ./common/rc +. ./common/filter +. ./common/reflink +. ./common/dmerror + +# real QA test starts here +_supported_os Linux +_require_scratch_reflink +_require_cp_reflink +_need_to_be_root +_require_dm_target error + +rm -f "$seqres.full" + + +echo "Format and mount" +_scratch_mkfs > "$seqres.full" 2>&1 +_dmerror_init +_dmerror_mount >> "$seqres.full" 2>&1 + +testdir="$SCRATCH_MNT/test-$seq" +rm -rf $testdir +mkdir $testdir + +blksz=65536 +nr=640 +bsz=128 + +free_blocks=$(stat -f -c '%a' "$testdir") +real_blksz=$(stat -f -c '%S' "$testdir") +space_needed=$(((blksz * nr * 3) * 5 / 4)) +space_avail=$((free_blocks * real_blksz)) +test $space_needed -gt $space_avail && _notrun "Not enough space. $space_avail < $space_needed" + +echo "Create the original files" +"$XFS_IO_PROG" -f -c "pwrite -S 0x61 -b $((blksz * bsz)) 0 $((blksz * nr))" "$testdir/file1" >> "$seqres.full" +_cp_reflink "$testdir/file1" "$testdir/file2" >> "$seqres.full" +_dmerror_unmount +_dmerror_mount + +echo "Compare files" +md5sum "$testdir/file1" | _filter_scratch +md5sum "$testdir/file2" | _filter_scratch + +echo "CoW and unmount" +sync +_dmerror_load_error_table +"$XFS_IO_PROG" -f -c "pwrite -S 0x63 -b $((blksz * bsz)) 0 $((blksz * nr))" "$testdir/file2" >> "$seqres.full" +_dmerror_load_working_table +rm -rf "$testdir/file2" >> "$seqres.full" 2>&1 +_dmerror_unmount +_dmerror_mount + +echo "Compare files" +md5sum "$testdir/file1" | _filter_scratch + +echo "Check for damage" +_dmerror_unmount +_dmerror_cleanup +_repair_scratch_fs >> "$seqres.full" 2>&1 + +# success, all done +status=0 +exit diff --git a/tests/generic/267.out b/tests/generic/267.out new file mode 100644 index 0000000..3c58e67 --- /dev/null +++ b/tests/generic/267.out @@ -0,0 +1,10 @@ +QA output created by 267 +Format and mount +Create the original files +Compare files +1886e67cf8783e89ce6ddc5bb09a3944 SCRATCH_MNT/test-267/file1 +1886e67cf8783e89ce6ddc5bb09a3944 SCRATCH_MNT/test-267/file2 +CoW and unmount +Compare files +1886e67cf8783e89ce6ddc5bb09a3944 SCRATCH_MNT/test-267/file1 +Check for damage diff --git a/tests/generic/268 b/tests/generic/268 new file mode 100755 index 0000000..fa3d991 --- /dev/null +++ b/tests/generic/268 @@ -0,0 +1,106 @@ +#! /bin/bash +# FS QA Test No. 268 +# +# Test CoW behavior when the write temporarily fails but the userspace +# program writes again. +# +#----------------------------------------------------------------------- +# Copyright (c) 2016, Oracle and/or its affiliates. All Rights Reserved. +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License as +# published by the Free Software Foundation. +# +# This program is distributed in the hope that it would be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write the Free Software Foundation, +# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA +#----------------------------------------------------------------------- + +seq=`basename "$0"` +seqres="$RESULT_DIR/$seq" +echo "QA output created by $seq" + +here=`pwd` +tmp=/tmp/$$ +status=1 # failure is the default! +trap "_cleanup; exit \$status" 0 1 2 3 15 + +_cleanup() +{ + cd / + rm -rf "$tmp".* + _dmerror_cleanup +} + +# get standard environment, filters and checks +. ./common/rc +. ./common/filter +. ./common/reflink +. ./common/dmerror + +# real QA test starts here +_supported_os Linux +_require_scratch_reflink +_require_cp_reflink +_need_to_be_root +_require_dm_target error + +rm -f "$seqres.full" + + +echo "Format and mount" +_scratch_mkfs > "$seqres.full" 2>&1 +_dmerror_init +_dmerror_mount >> "$seqres.full" 2>&1 + +testdir="$SCRATCH_MNT/test-$seq" +rm -rf $testdir +mkdir $testdir + +blksz=65536 +nr=640 +bsz=128 + +free_blocks=$(stat -f -c '%a' "$testdir") +real_blksz=$(stat -f -c '%S' "$testdir") +space_needed=$(((blksz * nr * 3) * 5 / 4)) +space_avail=$((free_blocks * real_blksz)) +test $space_needed -gt $space_avail && _notrun "Not enough space. $space_avail < $space_needed" + +echo "Create the original files" +"$XFS_IO_PROG" -f -c "pwrite -S 0x61 -b $((blksz * bsz)) 0 $((blksz * nr))" "$testdir/file1" >> "$seqres.full" +_cp_reflink "$testdir/file1" "$testdir/file2" >> "$seqres.full" +_dmerror_unmount +_dmerror_mount + +echo "Compare files" +md5sum "$testdir/file1" | _filter_scratch +md5sum "$testdir/file2" | _filter_scratch + +echo "CoW and unmount" +sync +_dmerror_load_error_table +"$XFS_IO_PROG" -f -c "pwrite -S 0x63 -b $((blksz * bsz)) 0 $((blksz * nr))" -c "fdatasync" "$testdir/file2" >> "$seqres.full" +_dmerror_load_working_table + +echo "Rewrite" +"$XFS_IO_PROG" -f -c "pwrite -S 0x64 -b $((blksz * bsz)) 0 $((blksz * nr))" -c "fdatasync" "$testdir/file2" >> "$seqres.full" 2>&1 +_dmerror_unmount +_dmerror_mount + +echo "Compare files" +md5sum "$testdir/file1" | _filter_scratch + +echo "Check for damage" +_dmerror_unmount +_dmerror_cleanup +_repair_scratch_fs >> "$seqres.full" 2>&1 + +# success, all done +status=0 +exit diff --git a/tests/generic/268.out b/tests/generic/268.out new file mode 100644 index 0000000..234e8be --- /dev/null +++ b/tests/generic/268.out @@ -0,0 +1,12 @@ +QA output created by 268 +Format and mount +Create the original files +Compare files +1886e67cf8783e89ce6ddc5bb09a3944 SCRATCH_MNT/test-268/file1 +1886e67cf8783e89ce6ddc5bb09a3944 SCRATCH_MNT/test-268/file2 +CoW and unmount +fdatasync: Input/output error +Rewrite +Compare files +1886e67cf8783e89ce6ddc5bb09a3944 SCRATCH_MNT/test-268/file1 +Check for damage diff --git a/tests/generic/271 b/tests/generic/271 new file mode 100755 index 0000000..efdd377 --- /dev/null +++ b/tests/generic/271 @@ -0,0 +1,102 @@ +#! /bin/bash +# FS QA Test No. 271 +# +# Test DIO CoW behavior when the write temporarily fails. +# +#----------------------------------------------------------------------- +# Copyright (c) 2016, Oracle and/or its affiliates. All Rights Reserved. +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License as +# published by the Free Software Foundation. +# +# This program is distributed in the hope that it would be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write the Free Software Foundation, +# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA +#----------------------------------------------------------------------- + +seq=`basename "$0"` +seqres="$RESULT_DIR/$seq" +echo "QA output created by $seq" + +here=`pwd` +tmp=/tmp/$$ +status=1 # failure is the default! +trap "_cleanup; exit \$status" 0 1 2 3 15 + +_cleanup() +{ + cd / + rm -rf "$tmp".* + _dmerror_cleanup +} + +# get standard environment, filters and checks +. ./common/rc +. ./common/filter +. ./common/reflink +. ./common/dmerror + +# real QA test starts here +_supported_os Linux +_require_scratch_reflink +_require_cp_reflink +_need_to_be_root +_require_dm_target error + +rm -f "$seqres.full" + + +echo "Format and mount" +_scratch_mkfs > "$seqres.full" 2>&1 +_dmerror_init +_dmerror_mount >> "$seqres.full" 2>&1 + +testdir="$SCRATCH_MNT/test-$seq" +rm -rf $testdir +mkdir $testdir + +blksz=65536 +nr=640 +bsz=128 + +free_blocks=$(stat -f -c '%a' "$testdir") +real_blksz=$(stat -f -c '%S' "$testdir") +space_needed=$(((blksz * nr * 3) * 5 / 4)) +space_avail=$((free_blocks * real_blksz)) +test $space_needed -gt $space_avail && _notrun "Not enough space. $space_avail < $space_needed" + +echo "Create the original files" +"$XFS_IO_PROG" -f -c "pwrite -S 0x61 -b $((blksz * bsz)) 0 $((blksz * nr))" "$testdir/file1" >> "$seqres.full" +_cp_reflink "$testdir/file1" "$testdir/file2" >> "$seqres.full" +_dmerror_unmount +_dmerror_mount + +echo "Compare files" +md5sum "$testdir/file1" | _filter_scratch +md5sum "$testdir/file2" | _filter_scratch + +echo "CoW and unmount" +sync +_dmerror_load_error_table +"$XFS_IO_PROG" -d -f -c "pwrite -S 0x63 -b $((blksz * bsz)) 0 $((blksz * nr))" "$testdir/file2" >> "$seqres.full" +_dmerror_load_working_table +_dmerror_unmount +_dmerror_mount + +echo "Compare files" +md5sum "$testdir/file1" | _filter_scratch + +echo "Check for damage" +_dmerror_unmount +_dmerror_cleanup +_repair_scratch_fs >> "$seqres.full" 2>&1 + +# success, all done +status=0 +exit diff --git a/tests/generic/271.out b/tests/generic/271.out new file mode 100644 index 0000000..f7ea004 --- /dev/null +++ b/tests/generic/271.out @@ -0,0 +1,11 @@ +QA output created by 271 +Format and mount +Create the original files +Compare files +1886e67cf8783e89ce6ddc5bb09a3944 SCRATCH_MNT/test-271/file1 +1886e67cf8783e89ce6ddc5bb09a3944 SCRATCH_MNT/test-271/file2 +CoW and unmount +pwrite64: Input/output error +Compare files +1886e67cf8783e89ce6ddc5bb09a3944 SCRATCH_MNT/test-271/file1 +Check for damage diff --git a/tests/generic/272 b/tests/generic/272 new file mode 100755 index 0000000..64c9834 --- /dev/null +++ b/tests/generic/272 @@ -0,0 +1,103 @@ +#! /bin/bash +# FS QA Test No. 272 +# +# Test DIO CoW behavior when the write permanently fails. +# +#----------------------------------------------------------------------- +# Copyright (c) 2016, Oracle and/or its affiliates. All Rights Reserved. +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License as +# published by the Free Software Foundation. +# +# This program is distributed in the hope that it would be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write the Free Software Foundation, +# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA +#----------------------------------------------------------------------- + +seq=`basename "$0"` +seqres="$RESULT_DIR/$seq" +echo "QA output created by $seq" + +here=`pwd` +tmp=/tmp/$$ +status=1 # failure is the default! +trap "_cleanup; exit \$status" 0 1 2 3 15 + +_cleanup() +{ + cd / + rm -rf "$tmp".* + _dmerror_cleanup +} + +# get standard environment, filters and checks +. ./common/rc +. ./common/filter +. ./common/reflink +. ./common/dmerror + +# real QA test starts here +_supported_os Linux +_require_scratch_reflink +_require_cp_reflink +_need_to_be_root +_require_dm_target error + +rm -f "$seqres.full" + + +echo "Format and mount" +_scratch_mkfs > "$seqres.full" 2>&1 +_dmerror_init +_dmerror_mount >> "$seqres.full" 2>&1 + +testdir="$SCRATCH_MNT/test-$seq" +rm -rf $testdir +mkdir $testdir + +blksz=65536 +nr=640 +bsz=128 + +free_blocks=$(stat -f -c '%a' "$testdir") +real_blksz=$(stat -f -c '%S' "$testdir") +space_needed=$(((blksz * nr * 3) * 5 / 4)) +space_avail=$((free_blocks * real_blksz)) +test $space_needed -gt $space_avail && _notrun "Not enough space. $space_avail < $space_needed" + +echo "Create the original files" +"$XFS_IO_PROG" -f -c "pwrite -S 0x61 -b $((blksz * bsz)) 0 $((blksz * nr))" "$testdir/file1" >> "$seqres.full" +_cp_reflink "$testdir/file1" "$testdir/file2" >> "$seqres.full" +_dmerror_unmount +_dmerror_mount + +echo "Compare files" +md5sum "$testdir/file1" | _filter_scratch +md5sum "$testdir/file2" | _filter_scratch + +echo "CoW and unmount" +sync +_dmerror_load_error_table +"$XFS_IO_PROG" -d -f -c "pwrite -S 0x63 -b $((blksz * bsz)) 0 $((blksz * nr))" "$testdir/file2" >> "$seqres.full" + +echo "Clean up the mess" +_dmerror_unmount +_dmerror_cleanup +_repair_scratch_fs >> "$seqres.full" 2>&1 +_scratch_mount >> "$seqres.full" 2>&1 + +echo "Compare files" +md5sum "$testdir/file1" | _filter_scratch + +echo "Check for damage" +umount "$SCRATCH_MNT" + +# success, all done +status=0 +exit diff --git a/tests/generic/272.out b/tests/generic/272.out new file mode 100644 index 0000000..4794088 --- /dev/null +++ b/tests/generic/272.out @@ -0,0 +1,12 @@ +QA output created by 272 +Format and mount +Create the original files +Compare files +1886e67cf8783e89ce6ddc5bb09a3944 SCRATCH_MNT/test-272/file1 +1886e67cf8783e89ce6ddc5bb09a3944 SCRATCH_MNT/test-272/file2 +CoW and unmount +pwrite64: Input/output error +Clean up the mess +Compare files +1886e67cf8783e89ce6ddc5bb09a3944 SCRATCH_MNT/test-272/file1 +Check for damage diff --git a/tests/generic/276 b/tests/generic/276 new file mode 100755 index 0000000..3b51ffd --- /dev/null +++ b/tests/generic/276 @@ -0,0 +1,103 @@ +#! /bin/bash +# FS QA Test No. 276 +# +# Test DIO CoW behavior when the write temporarily fails and we unmount. +# +#----------------------------------------------------------------------- +# Copyright (c) 2016, Oracle and/or its affiliates. All Rights Reserved. +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License as +# published by the Free Software Foundation. +# +# This program is distributed in the hope that it would be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write the Free Software Foundation, +# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA +#----------------------------------------------------------------------- + +seq=`basename "$0"` +seqres="$RESULT_DIR/$seq" +echo "QA output created by $seq" + +here=`pwd` +tmp=/tmp/$$ +status=1 # failure is the default! +trap "_cleanup; exit \$status" 0 1 2 3 15 + +_cleanup() +{ + cd / + rm -rf "$tmp".* + _dmerror_cleanup +} + +# get standard environment, filters and checks +. ./common/rc +. ./common/filter +. ./common/reflink +. ./common/dmerror + +# real QA test starts here +_supported_os Linux +_require_scratch_reflink +_require_cp_reflink +_need_to_be_root +_require_dm_target error + +rm -f "$seqres.full" + + +echo "Format and mount" +_scratch_mkfs > "$seqres.full" 2>&1 +_dmerror_init +_dmerror_mount >> "$seqres.full" 2>&1 + +testdir="$SCRATCH_MNT/test-$seq" +rm -rf $testdir +mkdir $testdir + +blksz=65536 +nr=640 +bsz=128 + +free_blocks=$(stat -f -c '%a' "$testdir") +real_blksz=$(stat -f -c '%S' "$testdir") +space_needed=$(((blksz * nr * 3) * 5 / 4)) +space_avail=$((free_blocks * real_blksz)) +test $space_needed -gt $space_avail && _notrun "Not enough space. $space_avail < $space_needed" + +echo "Create the original files" +"$XFS_IO_PROG" -f -c "pwrite -S 0x61 -b $((blksz * bsz)) 0 $((blksz * nr))" "$testdir/file1" >> "$seqres.full" +_cp_reflink "$testdir/file1" "$testdir/file2" >> "$seqres.full" +_dmerror_unmount +_dmerror_mount + +echo "Compare files" +md5sum "$testdir/file1" | _filter_scratch +md5sum "$testdir/file2" | _filter_scratch + +echo "CoW and unmount" +sync +_dmerror_load_error_table +"$XFS_IO_PROG" -d -f -c "pwrite -S 0x63 -b $((blksz * bsz)) 0 $((blksz * nr))" "$testdir/file2" >> "$seqres.full" +_dmerror_load_working_table +rm -rf "$testdir/file2" >> "$seqres.full" 2>&1 +_dmerror_unmount +_dmerror_mount + +echo "Compare files" +md5sum "$testdir/file1" | _filter_scratch + +echo "Check for damage" +_dmerror_unmount +_dmerror_cleanup +_repair_scratch_fs >> "$seqres.full" 2>&1 + +# success, all done +status=0 +exit diff --git a/tests/generic/276.out b/tests/generic/276.out new file mode 100644 index 0000000..e2aeacf --- /dev/null +++ b/tests/generic/276.out @@ -0,0 +1,11 @@ +QA output created by 276 +Format and mount +Create the original files +Compare files +1886e67cf8783e89ce6ddc5bb09a3944 SCRATCH_MNT/test-276/file1 +1886e67cf8783e89ce6ddc5bb09a3944 SCRATCH_MNT/test-276/file2 +CoW and unmount +pwrite64: Input/output error +Compare files +1886e67cf8783e89ce6ddc5bb09a3944 SCRATCH_MNT/test-276/file1 +Check for damage diff --git a/tests/generic/278 b/tests/generic/278 new file mode 100755 index 0000000..892320e --- /dev/null +++ b/tests/generic/278 @@ -0,0 +1,106 @@ +#! /bin/bash +# FS QA Test No. 278 +# +# Test CoW behavior when the write temporarily fails but the userspace +# program writes again. +# +#----------------------------------------------------------------------- +# Copyright (c) 2016, Oracle and/or its affiliates. All Rights Reserved. +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License as +# published by the Free Software Foundation. +# +# This program is distributed in the hope that it would be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write the Free Software Foundation, +# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA +#----------------------------------------------------------------------- + +seq=`basename "$0"` +seqres="$RESULT_DIR/$seq" +echo "QA output created by $seq" + +here=`pwd` +tmp=/tmp/$$ +status=1 # failure is the default! +trap "_cleanup; exit \$status" 0 1 2 3 15 + +_cleanup() +{ + cd / + rm -rf "$tmp".* + _dmerror_cleanup +} + +# get standard environment, filters and checks +. ./common/rc +. ./common/filter +. ./common/reflink +. ./common/dmerror + +# real QA test starts here +_supported_os Linux +_require_scratch_reflink +_require_cp_reflink +_need_to_be_root +_require_dm_target error + +rm -f "$seqres.full" + + +echo "Format and mount" +_scratch_mkfs > "$seqres.full" 2>&1 +_dmerror_init +_dmerror_mount >> "$seqres.full" 2>&1 + +testdir="$SCRATCH_MNT/test-$seq" +rm -rf $testdir +mkdir $testdir + +blksz=65536 +nr=640 +bsz=128 + +free_blocks=$(stat -f -c '%a' "$testdir") +real_blksz=$(stat -f -c '%S' "$testdir") +space_needed=$(((blksz * nr * 3) * 5 / 4)) +space_avail=$((free_blocks * real_blksz)) +test $space_needed -gt $space_avail && _notrun "Not enough space. $space_avail < $space_needed" + +echo "Create the original files" +"$XFS_IO_PROG" -f -c "pwrite -S 0x61 -b $((blksz * bsz)) 0 $((blksz * nr))" "$testdir/file1" >> "$seqres.full" +_cp_reflink "$testdir/file1" "$testdir/file2" >> "$seqres.full" +_dmerror_unmount +_dmerror_mount + +echo "Compare files" +md5sum "$testdir/file1" | _filter_scratch +md5sum "$testdir/file2" | _filter_scratch + +echo "CoW and unmount" +sync +_dmerror_load_error_table +"$XFS_IO_PROG" -d -f -c "pwrite -S 0x63 -b $((blksz * bsz)) 0 $((blksz * nr))" "$testdir/file2" >> "$seqres.full" +_dmerror_load_working_table + +echo "Rewrite" +"$XFS_IO_PROG" -d -f -c "pwrite -S 0x64 -b $((blksz * bsz)) 0 $((blksz * nr))" "$testdir/file2" >> "$seqres.full" 2>&1 +_dmerror_unmount +_dmerror_mount + +echo "Compare files" +md5sum "$testdir/file1" | _filter_scratch + +echo "Check for damage" +_dmerror_unmount +_dmerror_cleanup +_repair_scratch_fs >> "$seqres.full" 2>&1 + +# success, all done +status=0 +exit diff --git a/tests/generic/278.out b/tests/generic/278.out new file mode 100644 index 0000000..6723b73 --- /dev/null +++ b/tests/generic/278.out @@ -0,0 +1,12 @@ +QA output created by 278 +Format and mount +Create the original files +Compare files +1886e67cf8783e89ce6ddc5bb09a3944 SCRATCH_MNT/test-278/file1 +1886e67cf8783e89ce6ddc5bb09a3944 SCRATCH_MNT/test-278/file2 +CoW and unmount +pwrite64: Input/output error +Rewrite +Compare files +1886e67cf8783e89ce6ddc5bb09a3944 SCRATCH_MNT/test-278/file1 +Check for damage diff --git a/tests/generic/279 b/tests/generic/279 new file mode 100755 index 0000000..66ea000 --- /dev/null +++ b/tests/generic/279 @@ -0,0 +1,103 @@ +#! /bin/bash +# FS QA Test No. 279 +# +# Test mmap CoW behavior when the write temporarily fails. +# +#----------------------------------------------------------------------- +# Copyright (c) 2016, Oracle and/or its affiliates. All Rights Reserved. +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License as +# published by the Free Software Foundation. +# +# This program is distributed in the hope that it would be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write the Free Software Foundation, +# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA +#----------------------------------------------------------------------- + +seq=`basename "$0"` +seqres="$RESULT_DIR/$seq" +echo "QA output created by $seq" + +here=`pwd` +tmp=/tmp/$$ +status=1 # failure is the default! +trap "_cleanup; exit \$status" 0 1 2 3 15 + +_cleanup() +{ + cd / + rm -rf "$tmp".* "$TEST_DIR/mwrite.out" + _dmerror_cleanup +} + +# get standard environment, filters and checks +. ./common/rc +. ./common/filter +. ./common/reflink +. ./common/dmerror + +# real QA test starts here +_supported_os Linux +_require_scratch_reflink +_require_cp_reflink +_need_to_be_root +_require_dm_target error + +rm -f "$seqres.full" + + +echo "Format and mount" +_scratch_mkfs > "$seqres.full" 2>&1 +_dmerror_init +_dmerror_mount >> "$seqres.full" 2>&1 + +testdir="$SCRATCH_MNT/test-$seq" +rm -rf $testdir +mkdir $testdir + +blksz=65536 +nr=640 +bsz=128 + +free_blocks=$(stat -f -c '%a' "$testdir") +real_blksz=$(stat -f -c '%S' "$testdir") +space_needed=$(((blksz * nr * 3) * 5 / 4)) +space_avail=$((free_blocks * real_blksz)) +test $space_needed -gt $space_avail && _notrun "Not enough space. $space_avail < $space_needed" + +echo "Create the original files" +"$XFS_IO_PROG" -f -c "pwrite -S 0x61 -b $((blksz * bsz)) 0 $((blksz * nr))" "$testdir/file1" >> "$seqres.full" +_cp_reflink "$testdir/file1" "$testdir/file2" >> "$seqres.full" +_dmerror_unmount +_dmerror_mount + +echo "Compare files" +md5sum "$testdir/file1" | _filter_scratch +md5sum "$testdir/file2" | _filter_scratch + +echo "CoW and unmount" +sync +_dmerror_load_error_table +urk=$("$XFS_IO_PROG" -f -c "mmap -rw 0 $((blksz * nr))" -c "mwrite -S 0x63 0 $((blksz * nr))" -c "msync -s 0 $((blksz * nr))" "$testdir/file2" > "$TEST_DIR/mwrite.out" 2>&1) +cat "$TEST_DIR/mwrite.out" | tee -a "$seqres.full" +_dmerror_load_working_table +_dmerror_unmount +_dmerror_mount + +echo "Compare files" +md5sum "$testdir/file1" | _filter_scratch + +echo "Check for damage" +_dmerror_unmount +_dmerror_cleanup +_repair_scratch_fs >> "$seqres.full" 2>&1 + +# success, all done +status=0 +exit diff --git a/tests/generic/279.out b/tests/generic/279.out new file mode 100644 index 0000000..f34c2b2 --- /dev/null +++ b/tests/generic/279.out @@ -0,0 +1,11 @@ +QA output created by 279 +Format and mount +Create the original files +Compare files +1886e67cf8783e89ce6ddc5bb09a3944 SCRATCH_MNT/test-279/file1 +1886e67cf8783e89ce6ddc5bb09a3944 SCRATCH_MNT/test-279/file2 +CoW and unmount +msync: Input/output error +Compare files +1886e67cf8783e89ce6ddc5bb09a3944 SCRATCH_MNT/test-279/file1 +Check for damage diff --git a/tests/generic/281 b/tests/generic/281 new file mode 100755 index 0000000..09dc4be --- /dev/null +++ b/tests/generic/281 @@ -0,0 +1,104 @@ +#! /bin/bash +# FS QA Test No. 281 +# +# Test mmap CoW behavior when the write permanently fails. +# +#----------------------------------------------------------------------- +# Copyright (c) 2016, Oracle and/or its affiliates. All Rights Reserved. +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License as +# published by the Free Software Foundation. +# +# This program is distributed in the hope that it would be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write the Free Software Foundation, +# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA +#----------------------------------------------------------------------- + +seq=`basename "$0"` +seqres="$RESULT_DIR/$seq" +echo "QA output created by $seq" + +here=`pwd` +tmp=/tmp/$$ +status=1 # failure is the default! +trap "_cleanup; exit \$status" 0 1 2 3 15 + +_cleanup() +{ + cd / + rm -rf "$tmp".* "$TEST_DIR/mwrite.out" + _dmerror_cleanup +} + +# get standard environment, filters and checks +. ./common/rc +. ./common/filter +. ./common/reflink +. ./common/dmerror + +# real QA test starts here +_supported_os Linux +_require_scratch_reflink +_require_cp_reflink +_need_to_be_root +_require_dm_target error + +rm -f "$seqres.full" + + +echo "Format and mount" +_scratch_mkfs > "$seqres.full" 2>&1 +_dmerror_init +_dmerror_mount >> "$seqres.full" 2>&1 + +testdir="$SCRATCH_MNT/test-$seq" +rm -rf $testdir +mkdir $testdir + +blksz=65536 +nr=640 +bsz=128 + +free_blocks=$(stat -f -c '%a' "$testdir") +real_blksz=$(stat -f -c '%S' "$testdir") +space_needed=$(((blksz * nr * 3) * 5 / 4)) +space_avail=$((free_blocks * real_blksz)) +test $space_needed -gt $space_avail && _notrun "Not enough space. $space_avail < $space_needed" + +echo "Create the original files" +"$XFS_IO_PROG" -f -c "pwrite -S 0x61 -b $((blksz * bsz)) 0 $((blksz * nr))" "$testdir/file1" >> "$seqres.full" +_cp_reflink "$testdir/file1" "$testdir/file2" >> "$seqres.full" +_dmerror_unmount +_dmerror_mount + +echo "Compare files" +md5sum "$testdir/file1" | _filter_scratch +md5sum "$testdir/file2" | _filter_scratch + +echo "CoW and unmount" +sync +_dmerror_load_error_table +urk=$("$XFS_IO_PROG" -f -c "mmap -rw 0 $((blksz * nr))" -c "mwrite -S 0x63 0 $((blksz * nr))" -c "msync -s 0 $((blksz * nr))" "$testdir/file2" > "$TEST_DIR/mwrite.out" 2>&1) +cat "$TEST_DIR/mwrite.out" | tee -a "$seqres.full" + +echo "Clean up the mess" +_dmerror_unmount +_dmerror_cleanup +_repair_scratch_fs >> "$seqres.full" 2>&1 +_scratch_mount >> "$seqres.full" 2>&1 + +echo "Compare files" +md5sum "$testdir/file1" | _filter_scratch + +echo "Check for damage" +umount "$SCRATCH_MNT" + +# success, all done +status=0 +exit diff --git a/tests/generic/281.out b/tests/generic/281.out new file mode 100644 index 0000000..17a656b --- /dev/null +++ b/tests/generic/281.out @@ -0,0 +1,12 @@ +QA output created by 281 +Format and mount +Create the original files +Compare files +1886e67cf8783e89ce6ddc5bb09a3944 SCRATCH_MNT/test-281/file1 +1886e67cf8783e89ce6ddc5bb09a3944 SCRATCH_MNT/test-281/file2 +CoW and unmount +msync: Input/output error +Clean up the mess +Compare files +1886e67cf8783e89ce6ddc5bb09a3944 SCRATCH_MNT/test-281/file1 +Check for damage diff --git a/tests/generic/282 b/tests/generic/282 new file mode 100755 index 0000000..29b7c13 --- /dev/null +++ b/tests/generic/282 @@ -0,0 +1,104 @@ +#! /bin/bash +# FS QA Test No. 282 +# +# Test mmap CoW behavior when the write temporarily fails and we unmount. +# +#----------------------------------------------------------------------- +# Copyright (c) 2016, Oracle and/or its affiliates. All Rights Reserved. +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License as +# published by the Free Software Foundation. +# +# This program is distributed in the hope that it would be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write the Free Software Foundation, +# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA +#----------------------------------------------------------------------- + +seq=`basename "$0"` +seqres="$RESULT_DIR/$seq" +echo "QA output created by $seq" + +here=`pwd` +tmp=/tmp/$$ +status=1 # failure is the default! +trap "_cleanup; exit \$status" 0 1 2 3 15 + +_cleanup() +{ + cd / + rm -rf "$tmp".* "$TEST_DIR/mwrite.out" + _dmerror_cleanup +} + +# get standard environment, filters and checks +. ./common/rc +. ./common/filter +. ./common/reflink +. ./common/dmerror + +# real QA test starts here +_supported_os Linux +_require_scratch_reflink +_require_cp_reflink +_need_to_be_root +_require_dm_target error + +rm -f "$seqres.full" + + +echo "Format and mount" +_scratch_mkfs > "$seqres.full" 2>&1 +_dmerror_init +_dmerror_mount >> "$seqres.full" 2>&1 + +testdir="$SCRATCH_MNT/test-$seq" +rm -rf $testdir +mkdir $testdir + +blksz=65536 +nr=640 +bsz=128 + +free_blocks=$(stat -f -c '%a' "$testdir") +real_blksz=$(stat -f -c '%S' "$testdir") +space_needed=$(((blksz * nr * 3) * 5 / 4)) +space_avail=$((free_blocks * real_blksz)) +test $space_needed -gt $space_avail && _notrun "Not enough space. $space_avail < $space_needed" + +echo "Create the original files" +"$XFS_IO_PROG" -f -c "pwrite -S 0x61 -b $((blksz * bsz)) 0 $((blksz * nr))" "$testdir/file1" >> "$seqres.full" +_cp_reflink "$testdir/file1" "$testdir/file2" >> "$seqres.full" +_dmerror_unmount +_dmerror_mount + +echo "Compare files" +md5sum "$testdir/file1" | _filter_scratch +md5sum "$testdir/file2" | _filter_scratch + +echo "CoW and unmount" +sync +_dmerror_load_error_table +urk=$("$XFS_IO_PROG" -f -c "mmap -rw 0 $((blksz * nr))" -c "mwrite -S 0x63 0 $((blksz * nr))" "$testdir/file2" > "$TEST_DIR/mwrite.out" 2>&1) +cat "$TEST_DIR/mwrite.out" | tee -a "$seqres.full" +_dmerror_load_working_table +rm -rf "$testdir/file2" >> "$seqres.full" 2>&1 +_dmerror_unmount +_dmerror_mount + +echo "Compare files" +md5sum "$testdir/file1" | _filter_scratch + +echo "Check for damage" +_dmerror_unmount +_dmerror_cleanup +_repair_scratch_fs >> "$seqres.full" 2>&1 + +# success, all done +status=0 +exit diff --git a/tests/generic/282.out b/tests/generic/282.out new file mode 100644 index 0000000..624dbfa --- /dev/null +++ b/tests/generic/282.out @@ -0,0 +1,10 @@ +QA output created by 282 +Format and mount +Create the original files +Compare files +1886e67cf8783e89ce6ddc5bb09a3944 SCRATCH_MNT/test-282/file1 +1886e67cf8783e89ce6ddc5bb09a3944 SCRATCH_MNT/test-282/file2 +CoW and unmount +Compare files +1886e67cf8783e89ce6ddc5bb09a3944 SCRATCH_MNT/test-282/file1 +Check for damage diff --git a/tests/generic/283 b/tests/generic/283 new file mode 100755 index 0000000..3861954 --- /dev/null +++ b/tests/generic/283 @@ -0,0 +1,107 @@ +#! /bin/bash +# FS QA Test No. 283 +# +# Test mmap CoW behavior when the write temporarily fails but the userspace +# program writes again. +# +#----------------------------------------------------------------------- +# Copyright (c) 2016, Oracle and/or its affiliates. All Rights Reserved. +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License as +# published by the Free Software Foundation. +# +# This program is distributed in the hope that it would be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write the Free Software Foundation, +# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA +#----------------------------------------------------------------------- + +seq=`basename "$0"` +seqres="$RESULT_DIR/$seq" +echo "QA output created by $seq" + +here=`pwd` +tmp=/tmp/$$ +status=1 # failure is the default! +trap "_cleanup; exit \$status" 0 1 2 3 15 + +_cleanup() +{ + cd / + rm -rf "$tmp".* "$TEST_DIR/mwrite.out" + _dmerror_cleanup +} + +# get standard environment, filters and checks +. ./common/rc +. ./common/filter +. ./common/reflink +. ./common/dmerror + +# real QA test starts here +_supported_os Linux +_require_scratch_reflink +_require_cp_reflink +_need_to_be_root +_require_dm_target error + +rm -f "$seqres.full" + + +echo "Format and mount" +_scratch_mkfs > "$seqres.full" 2>&1 +_dmerror_init +_dmerror_mount >> "$seqres.full" 2>&1 + +testdir="$SCRATCH_MNT/test-$seq" +rm -rf $testdir +mkdir $testdir + +blksz=65536 +nr=640 +bsz=128 + +free_blocks=$(stat -f -c '%a' "$testdir") +real_blksz=$(stat -f -c '%S' "$testdir") +space_needed=$(((blksz * nr * 3) * 5 / 4)) +space_avail=$((free_blocks * real_blksz)) +test $space_needed -gt $space_avail && _notrun "Not enough space. $space_avail < $space_needed" + +echo "Create the original files" +"$XFS_IO_PROG" -f -c "pwrite -S 0x61 -b $((blksz * bsz)) 0 $((blksz * nr))" "$testdir/file1" >> "$seqres.full" +_cp_reflink "$testdir/file1" "$testdir/file2" >> "$seqres.full" +_dmerror_unmount +_dmerror_mount + +echo "Compare files" +md5sum "$testdir/file1" | _filter_scratch +md5sum "$testdir/file2" | _filter_scratch + +echo "CoW and unmount" +sync +_dmerror_load_error_table +urk=$("$XFS_IO_PROG" -f -c "mmap -rw 0 $((blksz * nr))" -c "mwrite -S 0x63 0 $((blksz * nr))" -c "msync -s 0 $((blksz * nr))" "$testdir/file2" > "$TEST_DIR/mwrite.out" 2>&1) +cat "$TEST_DIR/mwrite.out" | tee -a "$seqres.full" +_dmerror_load_working_table + +echo "Rewrite" +"$XFS_IO_PROG" -f -c "mmap -rw 0 $((blksz * nr))" -c "mwrite -S 0x63 0 $((blksz * nr))" -c "msync 0 $((blksz * nr))" "$testdir/file2" >> "$seqres.full" 2>&1 +_dmerror_unmount +_dmerror_mount + +echo "Compare files" +md5sum "$testdir/file1" | _filter_scratch + +echo "Check for damage" +_dmerror_unmount +_dmerror_cleanup +_repair_scratch_fs >> "$seqres.full" 2>&1 + +# success, all done +status=0 +exit diff --git a/tests/generic/283.out b/tests/generic/283.out new file mode 100644 index 0000000..f9fd5c8 --- /dev/null +++ b/tests/generic/283.out @@ -0,0 +1,12 @@ +QA output created by 283 +Format and mount +Create the original files +Compare files +1886e67cf8783e89ce6ddc5bb09a3944 SCRATCH_MNT/test-283/file1 +1886e67cf8783e89ce6ddc5bb09a3944 SCRATCH_MNT/test-283/file2 +CoW and unmount +msync: Input/output error +Rewrite +Compare files +1886e67cf8783e89ce6ddc5bb09a3944 SCRATCH_MNT/test-283/file1 +Check for damage diff --git a/tests/generic/group b/tests/generic/group index 0b584d9..c2624eb 100644 --- a/tests/generic/group +++ b/tests/generic/group @@ -267,13 +267,25 @@ 262 auto quick clone 263 rw auto quick 264 auto quick clone +265 auto quick clone +266 auto quick clone +267 auto quick clone +268 auto quick clone 269 auto rw prealloc ioctl enospc stress 270 auto quota rw prealloc ioctl enospc stress +271 auto quick clone +272 auto quick clone 273 auto rw 274 auto rw prealloc 275 auto rw enospc +276 auto quick clone 277 auto ioctl quick metadata +278 auto quick clone +279 auto quick clone 280 auto quota freeze dangerous +281 auto quick clone +282 auto quick clone +283 auto quick clone 285 auto rw 286 auto quick other 288 auto quick ioctl trim From darrick.wong@oracle.com Mon Feb 8 19:12:56 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay2.corp.sgi.com [137.38.102.29]) by oss.sgi.com (Postfix) with ESMTP id A644D29DFE for ; Mon, 8 Feb 2016 19:12:56 -0600 (CST) Received: from cuda.sgi.com (cuda2.sgi.com [192.48.176.25]) by relay2.corp.sgi.com (Postfix) with ESMTP id 9510F304043 for ; Mon, 8 Feb 2016 17:12:56 -0800 (PST) X-ASG-Debug-ID: 1454980370-04cbb04332059c0001-NocioJ Received: from aserp1040.oracle.com (aserp1040.oracle.com [141.146.126.69]) by cuda.sgi.com with ESMTP id Zp6sJn6PCoE9Tujg (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO) for ; Mon, 08 Feb 2016 17:12:51 -0800 (PST) X-Barracuda-Envelope-From: darrick.wong@oracle.com X-Barracuda-Apparent-Source-IP: 141.146.126.69 Received: from aserv0022.oracle.com (aserv0022.oracle.com [141.146.126.234]) by aserp1040.oracle.com (Sentrion-MTA-4.3.2/Sentrion-MTA-4.3.2) with ESMTP id u191CjYL019259 (version=TLSv1 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Tue, 9 Feb 2016 01:12:46 GMT Received: from aserv0121.oracle.com (aserv0121.oracle.com [141.146.126.235]) by aserv0022.oracle.com (8.13.8/8.13.8) with ESMTP id u191Cj24013793 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=FAIL); Tue, 9 Feb 2016 01:12:45 GMT Received: from abhmp0005.oracle.com (abhmp0005.oracle.com [141.146.116.11]) by aserv0121.oracle.com (8.13.8/8.13.8) with ESMTP id u191CjNF027624; Tue, 9 Feb 2016 01:12:45 GMT Received: from localhost (/10.145.178.207) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Mon, 08 Feb 2016 17:12:45 -0800 Subject: [PATCH 09/23] reflink: test CoW operations against the source file From: "Darrick J. Wong" X-ASG-Orig-Subj: [PATCH 09/23] reflink: test CoW operations against the source file To: david@fromorbit.com, darrick.wong@oracle.com Cc: linux-btrfs@vger.kernel.org, fstests@vger.kernel.org, xfs@oss.sgi.com Date: Mon, 08 Feb 2016 17:12:43 -0800 Message-ID: <20160209011243.23099.61894.stgit@birch.djwong.org> In-Reply-To: <20160209011145.23099.95354.stgit@birch.djwong.org> References: <20160209011145.23099.95354.stgit@birch.djwong.org> User-Agent: StGit/0.17.1-dirty MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit X-Source-IP: aserv0022.oracle.com [141.146.126.234] X-Barracuda-Connect: aserp1040.oracle.com[141.146.126.69] X-Barracuda-Start-Time: 1454980371 X-Barracuda-Encrypted: ECDHE-RSA-AES256-GCM-SHA384 X-Barracuda-URL: https://192.48.176.25:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-BRTS-Status: 1 X-Barracuda-Spam-Score: 0.00 X-Barracuda-Spam-Status: No, SCORE=0.00 using per-user scores of TAG_LEVEL=1000.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.7 tests=BSF_SC0_MISMATCH_TO, UNPARSEABLE_RELAY X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.3.26874 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 0.00 BSF_SC0_MISMATCH_TO Envelope rcpt doesn't match header 0.00 UNPARSEABLE_RELAY Informational: message has unparseable relay lines Ensure that CoW operations against shared blocks in the source file work correctly. v2: remove filefrag dependencies Signed-off-by: Darrick J. Wong --- tests/generic/196 | 2 - tests/generic/197 | 2 - tests/generic/284 | 95 ++++++++++++++++++++++++++++++++++++++++++++ tests/generic/284.out | 13 ++++++ tests/generic/287 | 95 ++++++++++++++++++++++++++++++++++++++++++++ tests/generic/287.out | 13 ++++++ tests/generic/289 | 102 +++++++++++++++++++++++++++++++++++++++++++++++ tests/generic/289.out | 13 ++++++ tests/generic/290 | 102 +++++++++++++++++++++++++++++++++++++++++++++++ tests/generic/290.out | 13 ++++++ tests/generic/291 | 102 +++++++++++++++++++++++++++++++++++++++++++++++ tests/generic/291.out | 13 ++++++ tests/generic/292 | 102 +++++++++++++++++++++++++++++++++++++++++++++++ tests/generic/292.out | 13 ++++++ tests/generic/293 | 107 +++++++++++++++++++++++++++++++++++++++++++++++++ tests/generic/293.out | 13 ++++++ tests/generic/295 | 107 +++++++++++++++++++++++++++++++++++++++++++++++++ tests/generic/295.out | 13 ++++++ tests/generic/296 | 96 ++++++++++++++++++++++++++++++++++++++++++++ tests/generic/296.out | 13 ++++++ tests/generic/group | 9 ++++ 21 files changed, 1036 insertions(+), 2 deletions(-) create mode 100755 tests/generic/284 create mode 100644 tests/generic/284.out create mode 100755 tests/generic/287 create mode 100644 tests/generic/287.out create mode 100755 tests/generic/289 create mode 100644 tests/generic/289.out create mode 100755 tests/generic/290 create mode 100644 tests/generic/290.out create mode 100755 tests/generic/291 create mode 100644 tests/generic/291.out create mode 100755 tests/generic/292 create mode 100644 tests/generic/292.out create mode 100755 tests/generic/293 create mode 100644 tests/generic/293.out create mode 100755 tests/generic/295 create mode 100644 tests/generic/295.out create mode 100755 tests/generic/296 create mode 100644 tests/generic/296.out diff --git a/tests/generic/196 b/tests/generic/196 index 4da9c76..11ecebb 100755 --- a/tests/generic/196 +++ b/tests/generic/196 @@ -2,7 +2,7 @@ # FS QA Test No. 196 # # Ensuring that copy on write in direct-io mode works when the CoW -# range originally covers multiple extents, some unwritten, some not. +# range originally covers multiple extents, some regular, some not. # - Create two files. # - Reflink the odd blocks of the first file into the second file. # - directio CoW across the halfway mark, starting with the unwritten extent. diff --git a/tests/generic/197 b/tests/generic/197 index 54ee5ab..72c2cb3 100755 --- a/tests/generic/197 +++ b/tests/generic/197 @@ -2,7 +2,7 @@ # FS QA Test No. 197 # # Ensuring that copy on write in buffered mode works when the CoW -# range originally covers multiple extents, some unwritten, some not. +# range originally covers multiple extents, some regular, some not. # - Create two files. # - Reflink the odd blocks of the first file into the second file. # - CoW across the halfway mark, starting with the unwritten extent. diff --git a/tests/generic/284 b/tests/generic/284 new file mode 100755 index 0000000..2a94bd1 --- /dev/null +++ b/tests/generic/284 @@ -0,0 +1,95 @@ +#! /bin/bash +# FS QA Test No. 284 +# +# Ensuring that copy on write in buffered mode to the source file when the +# CoW range covers regular unshared and regular shared blocks. +# - Create two files. +# - Reflink the odd blocks of the first file into the second file. +# - CoW the first file across the halfway mark, starting with the +# regular extent. +# - Check that the files are now different where we say they're different. +# +#----------------------------------------------------------------------- +# Copyright (c) 2016, Oracle and/or its affiliates. All Rights Reserved. +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License as +# published by the Free Software Foundation. +# +# This program is distributed in the hope that it would be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write the Free Software Foundation, +# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA +#----------------------------------------------------------------------- + +seq=`basename "$0"` +seqres="$RESULT_DIR/$seq" +echo "QA output created by $seq" + +here=`pwd` +tmp=/tmp/$$ +status=1 # failure is the default! +trap "_cleanup; exit \$status" 0 1 2 3 15 + +_cleanup() +{ + cd / + rm -rf "$tmp".* +} + +# get standard environment, filters and checks +. ./common/rc +. ./common/filter +. ./common/reflink + +# real QA test starts here +_supported_os Linux +_require_scratch_reflink +_require_xfs_io_command "falloc" + +rm -f "$seqres.full" + +echo "Format and mount" +_scratch_mkfs > "$seqres.full" 2>&1 +_scratch_mount >> "$seqres.full" 2>&1 + +testdir="$SCRATCH_MNT/test-$seq" +rm -rf $testdir +mkdir $testdir + +echo "Create the original files" +blksz=65536 +nr=64 +_pwrite_byte 0x61 0 $((blksz * nr)) "$testdir/file1" >> "$seqres.full" +_pwrite_byte 0x62 0 $((blksz * nr)) "$testdir/file3" >> "$seqres.full" +_pwrite_byte 0x61 0 $((blksz * nr)) "$testdir/file1.chk" >> "$seqres.full" +seq 1 2 $((nr-1)) | while read f; do + _reflink_range "$testdir/file1" $((blksz * f)) "$testdir/file3" $((blksz * f)) $blksz >> "$seqres.full" +done +_scratch_remount + +echo "Compare files" +md5sum "$testdir/file1" | _filter_scratch +md5sum "$testdir/file3" | _filter_scratch +md5sum "$testdir/file1.chk" | _filter_scratch + +echo "CoW across the transition" +"$XFS_IO_PROG" -f -c "pwrite -S 0x63 -b $((blksz * nr / 2)) $((blksz * nr / 4)) $((blksz * nr / 2))" "$testdir/file1" >> "$seqres.full" +_pwrite_byte 0x63 $((blksz * nr / 4)) $((blksz * nr / 2)) "$testdir/file1.chk" >> "$seqres.full" +_scratch_remount + +echo "Compare files" +md5sum "$testdir/file1" | _filter_scratch +md5sum "$testdir/file3" | _filter_scratch +md5sum "$testdir/file1.chk" | _filter_scratch + +echo "Check for damage" +umount "$SCRATCH_MNT" + +# success, all done +status=0 +exit diff --git a/tests/generic/284.out b/tests/generic/284.out new file mode 100644 index 0000000..da24b6d --- /dev/null +++ b/tests/generic/284.out @@ -0,0 +1,13 @@ +QA output created by 284 +Format and mount +Create the original files +Compare files +bdbcf02ee0aa977795a79d25fcfdccb1 SCRATCH_MNT/test-284/file1 +ce2023f765eba19677517c511886d5c9 SCRATCH_MNT/test-284/file3 +bdbcf02ee0aa977795a79d25fcfdccb1 SCRATCH_MNT/test-284/file1.chk +CoW across the transition +Compare files +2dc2b131303b2f70ddb480778caac8b7 SCRATCH_MNT/test-284/file1 +ce2023f765eba19677517c511886d5c9 SCRATCH_MNT/test-284/file3 +2dc2b131303b2f70ddb480778caac8b7 SCRATCH_MNT/test-284/file1.chk +Check for damage diff --git a/tests/generic/287 b/tests/generic/287 new file mode 100755 index 0000000..d3c740c --- /dev/null +++ b/tests/generic/287 @@ -0,0 +1,95 @@ +#! /bin/bash +# FS QA Test No. 287 +# +# Ensuring that copy on write in directio mode to the source file when the +# CoW range covers regular unshared and regular shared blocks. +# - Create two files. +# - Reflink the odd blocks of the first file into the second file. +# - dio CoW the first file across the halfway mark, starting with the +# regular extent. +# - Check that the files are now different where we say they're different. +# +#----------------------------------------------------------------------- +# Copyright (c) 2016, Oracle and/or its affiliates. All Rights Reserved. +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License as +# published by the Free Software Foundation. +# +# This program is distributed in the hope that it would be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write the Free Software Foundation, +# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA +#----------------------------------------------------------------------- + +seq=`basename "$0"` +seqres="$RESULT_DIR/$seq" +echo "QA output created by $seq" + +here=`pwd` +tmp=/tmp/$$ +status=1 # failure is the default! +trap "_cleanup; exit \$status" 0 1 2 3 15 + +_cleanup() +{ + cd / + rm -rf "$tmp".* +} + +# get standard environment, filters and checks +. ./common/rc +. ./common/filter +. ./common/reflink + +# real QA test starts here +_supported_os Linux +_require_scratch_reflink +_require_xfs_io_command "falloc" + +rm -f "$seqres.full" + +echo "Format and mount" +_scratch_mkfs > "$seqres.full" 2>&1 +_scratch_mount >> "$seqres.full" 2>&1 + +testdir="$SCRATCH_MNT/test-$seq" +rm -rf $testdir +mkdir $testdir + +echo "Create the original files" +blksz=65536 +nr=64 +_pwrite_byte 0x61 0 $((blksz * nr)) "$testdir/file1" >> "$seqres.full" +_pwrite_byte 0x62 0 $((blksz * nr)) "$testdir/file3" >> "$seqres.full" +_pwrite_byte 0x61 0 $((blksz * nr)) "$testdir/file1.chk" >> "$seqres.full" +seq 1 2 $((nr-1)) | while read f; do + _reflink_range "$testdir/file1" $((blksz * f)) "$testdir/file3" $((blksz * f)) $blksz >> "$seqres.full" +done +_scratch_remount + +echo "Compare files" +md5sum "$testdir/file1" | _filter_scratch +md5sum "$testdir/file3" | _filter_scratch +md5sum "$testdir/file1.chk" | _filter_scratch + +echo "CoW across the transition" +"$XFS_IO_PROG" -d -f -c "pwrite -S 0x63 -b $((blksz * nr / 2)) $((blksz * nr / 4)) $((blksz * nr / 2))" "$testdir/file1" >> "$seqres.full" +_pwrite_byte 0x63 $((blksz * nr / 4)) $((blksz * nr / 2)) "$testdir/file1.chk" >> "$seqres.full" +_scratch_remount + +echo "Compare files" +md5sum "$testdir/file1" | _filter_scratch +md5sum "$testdir/file3" | _filter_scratch +md5sum "$testdir/file1.chk" | _filter_scratch + +echo "Check for damage" +umount "$SCRATCH_MNT" + +# success, all done +status=0 +exit diff --git a/tests/generic/287.out b/tests/generic/287.out new file mode 100644 index 0000000..fd1dcc0 --- /dev/null +++ b/tests/generic/287.out @@ -0,0 +1,13 @@ +QA output created by 287 +Format and mount +Create the original files +Compare files +bdbcf02ee0aa977795a79d25fcfdccb1 SCRATCH_MNT/test-287/file1 +ce2023f765eba19677517c511886d5c9 SCRATCH_MNT/test-287/file3 +bdbcf02ee0aa977795a79d25fcfdccb1 SCRATCH_MNT/test-287/file1.chk +CoW across the transition +Compare files +2dc2b131303b2f70ddb480778caac8b7 SCRATCH_MNT/test-287/file1 +ce2023f765eba19677517c511886d5c9 SCRATCH_MNT/test-287/file3 +2dc2b131303b2f70ddb480778caac8b7 SCRATCH_MNT/test-287/file1.chk +Check for damage diff --git a/tests/generic/289 b/tests/generic/289 new file mode 100755 index 0000000..253782d --- /dev/null +++ b/tests/generic/289 @@ -0,0 +1,102 @@ +#! /bin/bash +# FS QA Test No. 289 +# +# Ensuring that copy on write in buffered mode to the source file when the +# CoW range covers unwritten and regular shared blocks. +# - Create two files. +# - fallocate the first file. +# - Write the odd blocks of the first file. +# - Reflink the odd blocks of the first file into the second file. +# - CoW the first file across the halfway mark, starting with the +# regular extent. +# - Check that the files are now different where we say they're different. +# +#----------------------------------------------------------------------- +# Copyright (c) 2016, Oracle and/or its affiliates. All Rights Reserved. +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License as +# published by the Free Software Foundation. +# +# This program is distributed in the hope that it would be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write the Free Software Foundation, +# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA +#----------------------------------------------------------------------- + +seq=`basename "$0"` +seqres="$RESULT_DIR/$seq" +echo "QA output created by $seq" + +here=`pwd` +tmp=/tmp/$$ +status=1 # failure is the default! +trap "_cleanup; exit \$status" 0 1 2 3 15 + +_cleanup() +{ + cd / + rm -rf "$tmp".* +} + +# get standard environment, filters and checks +. ./common/rc +. ./common/filter +. ./common/reflink + +# real QA test starts here +_supported_os Linux +_require_scratch_reflink +_require_xfs_io_command "falloc" + +rm -f "$seqres.full" + +echo "Format and mount" +_scratch_mkfs > "$seqres.full" 2>&1 +_scratch_mount >> "$seqres.full" 2>&1 + +testdir="$SCRATCH_MNT/test-$seq" +rm -rf $testdir +mkdir $testdir + +echo "Create the original files" +blksz=65536 +nr=64 +"$XFS_IO_PROG" -f -c "falloc 0 $((blksz * nr))" "$testdir/file1" >> "$seqres.full" +_pwrite_byte 0x00 0 $((blksz * nr)) "$testdir/file1.chk" >> "$seqres.full" +_pwrite_byte 0x62 0 $((blksz * nr)) "$testdir/file3" >> "$seqres.full" +seq 1 2 $((nr-1)) | while read f; do + _pwrite_byte 0x61 $((blksz * f)) $blksz "$testdir/file1" >> "$seqres.full" + _pwrite_byte 0x61 $((blksz * f)) $blksz "$testdir/file1.chk" >> "$seqres.full" +done +sync +seq 1 2 $((nr-1)) | while read f; do + _reflink_range "$testdir/file1" $((blksz * f)) "$testdir/file3" $((blksz * f)) $blksz >> "$seqres.full" +done +_scratch_remount + +echo "Compare files" +md5sum "$testdir/file1" | _filter_scratch +md5sum "$testdir/file3" | _filter_scratch +md5sum "$testdir/file1.chk" | _filter_scratch + +echo "CoW across the transition" +"$XFS_IO_PROG" -f -c "pwrite -S 0x63 -b $((blksz * nr / 2)) $((blksz * nr / 4)) $((blksz * nr / 2))" "$testdir/file1" >> "$seqres.full" +_pwrite_byte 0x63 $((blksz * nr / 4)) $((blksz * nr / 2)) "$testdir/file1.chk" >> "$seqres.full" +_scratch_remount + +echo "Compare files" +md5sum "$testdir/file1" | _filter_scratch +md5sum "$testdir/file3" | _filter_scratch +md5sum "$testdir/file1.chk" | _filter_scratch + +echo "Check for damage" +umount "$SCRATCH_MNT" + +# success, all done +status=0 +exit diff --git a/tests/generic/289.out b/tests/generic/289.out new file mode 100644 index 0000000..424ac10 --- /dev/null +++ b/tests/generic/289.out @@ -0,0 +1,13 @@ +QA output created by 289 +Format and mount +Create the original files +Compare files +b8a8a88d4c143f79900c4b4e79aa3e37 SCRATCH_MNT/test-289/file1 +ce2023f765eba19677517c511886d5c9 SCRATCH_MNT/test-289/file3 +b8a8a88d4c143f79900c4b4e79aa3e37 SCRATCH_MNT/test-289/file1.chk +CoW across the transition +Compare files +e8cf59797f0b3758c8878c368bb4cf7e SCRATCH_MNT/test-289/file1 +ce2023f765eba19677517c511886d5c9 SCRATCH_MNT/test-289/file3 +e8cf59797f0b3758c8878c368bb4cf7e SCRATCH_MNT/test-289/file1.chk +Check for damage diff --git a/tests/generic/290 b/tests/generic/290 new file mode 100755 index 0000000..76dae61 --- /dev/null +++ b/tests/generic/290 @@ -0,0 +1,102 @@ +#! /bin/bash +# FS QA Test No. 290 +# +# Ensuring that copy on write in directio mode to the source file when the +# CoW range covers unwritten and regular shared blocks. +# - Create two files. +# - fallocate the first file. +# - Write the odd blocks of the first file. +# - Reflink the odd blocks of the first file into the second file. +# - DIO CoW the first file across the halfway mark, starting with the +# regular extent. +# - Check that the files are now different where we say they're different. +# +#----------------------------------------------------------------------- +# Copyright (c) 2016, Oracle and/or its affiliates. All Rights Reserved. +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License as +# published by the Free Software Foundation. +# +# This program is distributed in the hope that it would be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write the Free Software Foundation, +# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA +#----------------------------------------------------------------------- + +seq=`basename "$0"` +seqres="$RESULT_DIR/$seq" +echo "QA output created by $seq" + +here=`pwd` +tmp=/tmp/$$ +status=1 # failure is the default! +trap "_cleanup; exit \$status" 0 1 2 3 15 + +_cleanup() +{ + cd / + rm -rf "$tmp".* +} + +# get standard environment, filters and checks +. ./common/rc +. ./common/filter +. ./common/reflink + +# real QA test starts here +_supported_os Linux +_require_scratch_reflink +_require_xfs_io_command "falloc" + +rm -f "$seqres.full" + +echo "Format and mount" +_scratch_mkfs > "$seqres.full" 2>&1 +_scratch_mount >> "$seqres.full" 2>&1 + +testdir="$SCRATCH_MNT/test-$seq" +rm -rf $testdir +mkdir $testdir + +echo "Create the original files" +blksz=65536 +nr=64 +"$XFS_IO_PROG" -f -c "falloc 0 $((blksz * nr))" "$testdir/file1" >> "$seqres.full" +_pwrite_byte 0x00 0 $((blksz * nr)) "$testdir/file1.chk" >> "$seqres.full" +_pwrite_byte 0x62 0 $((blksz * nr)) "$testdir/file3" >> "$seqres.full" +seq 1 2 $((nr-1)) | while read f; do + _pwrite_byte 0x61 $((blksz * f)) $blksz "$testdir/file1" >> "$seqres.full" + _pwrite_byte 0x61 $((blksz * f)) $blksz "$testdir/file1.chk" >> "$seqres.full" +done +sync +seq 1 2 $((nr-1)) | while read f; do + _reflink_range "$testdir/file1" $((blksz * f)) "$testdir/file3" $((blksz * f)) $blksz >> "$seqres.full" +done +_scratch_remount + +echo "Compare files" +md5sum "$testdir/file1" | _filter_scratch +md5sum "$testdir/file3" | _filter_scratch +md5sum "$testdir/file1.chk" | _filter_scratch + +echo "CoW across the transition" +"$XFS_IO_PROG" -d -f -c "pwrite -S 0x63 -b $((blksz * nr / 2)) $((blksz * nr / 4)) $((blksz * nr / 2))" "$testdir/file1" >> "$seqres.full" +_pwrite_byte 0x63 $((blksz * nr / 4)) $((blksz * nr / 2)) "$testdir/file1.chk" >> "$seqres.full" +_scratch_remount + +echo "Compare files" +md5sum "$testdir/file1" | _filter_scratch +md5sum "$testdir/file3" | _filter_scratch +md5sum "$testdir/file1.chk" | _filter_scratch + +echo "Check for damage" +umount "$SCRATCH_MNT" + +# success, all done +status=0 +exit diff --git a/tests/generic/290.out b/tests/generic/290.out new file mode 100644 index 0000000..6af6c5b --- /dev/null +++ b/tests/generic/290.out @@ -0,0 +1,13 @@ +QA output created by 290 +Format and mount +Create the original files +Compare files +b8a8a88d4c143f79900c4b4e79aa3e37 SCRATCH_MNT/test-290/file1 +ce2023f765eba19677517c511886d5c9 SCRATCH_MNT/test-290/file3 +b8a8a88d4c143f79900c4b4e79aa3e37 SCRATCH_MNT/test-290/file1.chk +CoW across the transition +Compare files +e8cf59797f0b3758c8878c368bb4cf7e SCRATCH_MNT/test-290/file1 +ce2023f765eba19677517c511886d5c9 SCRATCH_MNT/test-290/file3 +e8cf59797f0b3758c8878c368bb4cf7e SCRATCH_MNT/test-290/file1.chk +Check for damage diff --git a/tests/generic/291 b/tests/generic/291 new file mode 100755 index 0000000..a7bdd8b --- /dev/null +++ b/tests/generic/291 @@ -0,0 +1,102 @@ +#! /bin/bash +# FS QA Test No. 291 +# +# Ensuring that copy on write in buffered mode to the source file when the +# CoW range covers holes and regular shared blocks. +# - Create two files. +# - Truncate the first file. +# - Write the odd blocks of the first file. +# - Reflink the odd blocks of the first file into the second file. +# - CoW the first file across the halfway mark, starting with the +# regular extent. +# - Check that the files are now different where we say they're different. +# +#----------------------------------------------------------------------- +# Copyright (c) 2016, Oracle and/or its affiliates. All Rights Reserved. +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License as +# published by the Free Software Foundation. +# +# This program is distributed in the hope that it would be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write the Free Software Foundation, +# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA +#----------------------------------------------------------------------- + +seq=`basename "$0"` +seqres="$RESULT_DIR/$seq" +echo "QA output created by $seq" + +here=`pwd` +tmp=/tmp/$$ +status=1 # failure is the default! +trap "_cleanup; exit \$status" 0 1 2 3 15 + +_cleanup() +{ + cd / + rm -rf "$tmp".* +} + +# get standard environment, filters and checks +. ./common/rc +. ./common/filter +. ./common/reflink + +# real QA test starts here +_supported_os Linux +_require_scratch_reflink +_require_xfs_io_command "falloc" + +rm -f "$seqres.full" + +echo "Format and mount" +_scratch_mkfs > "$seqres.full" 2>&1 +_scratch_mount >> "$seqres.full" 2>&1 + +testdir="$SCRATCH_MNT/test-$seq" +rm -rf $testdir +mkdir $testdir + +echo "Create the original files" +blksz=65536 +nr=64 +"$XFS_IO_PROG" -f -c "truncate $((blksz * nr))" "$testdir/file1" >> "$seqres.full" +_pwrite_byte 0x00 0 $((blksz * nr)) "$testdir/file1.chk" >> "$seqres.full" +_pwrite_byte 0x62 0 $((blksz * nr)) "$testdir/file3" >> "$seqres.full" +seq 1 2 $((nr-1)) | while read f; do + _pwrite_byte 0x61 $((blksz * f)) $blksz "$testdir/file1" >> "$seqres.full" + _pwrite_byte 0x61 $((blksz * f)) $blksz "$testdir/file1.chk" >> "$seqres.full" +done +sync +seq 1 2 $((nr-1)) | while read f; do + _reflink_range "$testdir/file1" $((blksz * f)) "$testdir/file3" $((blksz * f)) $blksz >> "$seqres.full" +done +_scratch_remount + +echo "Compare files" +md5sum "$testdir/file1" | _filter_scratch +md5sum "$testdir/file3" | _filter_scratch +md5sum "$testdir/file1.chk" | _filter_scratch + +echo "CoW across the transition" +"$XFS_IO_PROG" -f -c "pwrite -S 0x63 -b $((blksz * nr / 2)) $((blksz * nr / 4)) $((blksz * nr / 2))" "$testdir/file1" >> "$seqres.full" +_pwrite_byte 0x63 $((blksz * nr / 4)) $((blksz * nr / 2)) "$testdir/file1.chk" >> "$seqres.full" +_scratch_remount + +echo "Compare files" +md5sum "$testdir/file1" | _filter_scratch +md5sum "$testdir/file3" | _filter_scratch +md5sum "$testdir/file1.chk" | _filter_scratch + +echo "Check for damage" +umount "$SCRATCH_MNT" + +# success, all done +status=0 +exit diff --git a/tests/generic/291.out b/tests/generic/291.out new file mode 100644 index 0000000..93b813d --- /dev/null +++ b/tests/generic/291.out @@ -0,0 +1,13 @@ +QA output created by 291 +Format and mount +Create the original files +Compare files +b8a8a88d4c143f79900c4b4e79aa3e37 SCRATCH_MNT/test-291/file1 +ce2023f765eba19677517c511886d5c9 SCRATCH_MNT/test-291/file3 +b8a8a88d4c143f79900c4b4e79aa3e37 SCRATCH_MNT/test-291/file1.chk +CoW across the transition +Compare files +e8cf59797f0b3758c8878c368bb4cf7e SCRATCH_MNT/test-291/file1 +ce2023f765eba19677517c511886d5c9 SCRATCH_MNT/test-291/file3 +e8cf59797f0b3758c8878c368bb4cf7e SCRATCH_MNT/test-291/file1.chk +Check for damage diff --git a/tests/generic/292 b/tests/generic/292 new file mode 100755 index 0000000..23e1b92 --- /dev/null +++ b/tests/generic/292 @@ -0,0 +1,102 @@ +#! /bin/bash +# FS QA Test No. 292 +# +# Ensuring that copy on write in directio mode to the source file when the +# CoW range covers holes and regular shared blocks. +# - Create two files. +# - Truncate the first file. +# - Write the odd blocks of the first file. +# - Reflink the odd blocks of the first file into the second file. +# - DIO CoW the first file across the halfway mark, starting with the +# regular extent. +# - Check that the files are now different where we say they're different. +# +#----------------------------------------------------------------------- +# Copyright (c) 2016, Oracle and/or its affiliates. All Rights Reserved. +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License as +# published by the Free Software Foundation. +# +# This program is distributed in the hope that it would be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write the Free Software Foundation, +# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA +#----------------------------------------------------------------------- + +seq=`basename "$0"` +seqres="$RESULT_DIR/$seq" +echo "QA output created by $seq" + +here=`pwd` +tmp=/tmp/$$ +status=1 # failure is the default! +trap "_cleanup; exit \$status" 0 1 2 3 15 + +_cleanup() +{ + cd / + rm -rf "$tmp".* +} + +# get standard environment, filters and checks +. ./common/rc +. ./common/filter +. ./common/reflink + +# real QA test starts here +_supported_os Linux +_require_scratch_reflink +_require_xfs_io_command "falloc" + +rm -f "$seqres.full" + +echo "Format and mount" +_scratch_mkfs > "$seqres.full" 2>&1 +_scratch_mount >> "$seqres.full" 2>&1 + +testdir="$SCRATCH_MNT/test-$seq" +rm -rf $testdir +mkdir $testdir + +echo "Create the original files" +blksz=65536 +nr=64 +"$XFS_IO_PROG" -f -c "truncate $((blksz * nr))" "$testdir/file1" >> "$seqres.full" +_pwrite_byte 0x00 0 $((blksz * nr)) "$testdir/file1.chk" >> "$seqres.full" +_pwrite_byte 0x62 0 $((blksz * nr)) "$testdir/file3" >> "$seqres.full" +seq 1 2 $((nr-1)) | while read f; do + _pwrite_byte 0x61 $((blksz * f)) $blksz "$testdir/file1" >> "$seqres.full" + _pwrite_byte 0x61 $((blksz * f)) $blksz "$testdir/file1.chk" >> "$seqres.full" +done +sync +seq 1 2 $((nr-1)) | while read f; do + _reflink_range "$testdir/file1" $((blksz * f)) "$testdir/file3" $((blksz * f)) $blksz >> "$seqres.full" +done +_scratch_remount + +echo "Compare files" +md5sum "$testdir/file1" | _filter_scratch +md5sum "$testdir/file3" | _filter_scratch +md5sum "$testdir/file1.chk" | _filter_scratch + +echo "CoW across the transition" +"$XFS_IO_PROG" -d -f -c "pwrite -S 0x63 -b $((blksz * nr / 2)) $((blksz * nr / 4)) $((blksz * nr / 2))" "$testdir/file1" >> "$seqres.full" +_pwrite_byte 0x63 $((blksz * nr / 4)) $((blksz * nr / 2)) "$testdir/file1.chk" >> "$seqres.full" +_scratch_remount + +echo "Compare files" +md5sum "$testdir/file1" | _filter_scratch +md5sum "$testdir/file3" | _filter_scratch +md5sum "$testdir/file1.chk" | _filter_scratch + +echo "Check for damage" +umount "$SCRATCH_MNT" + +# success, all done +status=0 +exit diff --git a/tests/generic/292.out b/tests/generic/292.out new file mode 100644 index 0000000..2337a46 --- /dev/null +++ b/tests/generic/292.out @@ -0,0 +1,13 @@ +QA output created by 292 +Format and mount +Create the original files +Compare files +b8a8a88d4c143f79900c4b4e79aa3e37 SCRATCH_MNT/test-292/file1 +ce2023f765eba19677517c511886d5c9 SCRATCH_MNT/test-292/file3 +b8a8a88d4c143f79900c4b4e79aa3e37 SCRATCH_MNT/test-292/file1.chk +CoW across the transition +Compare files +e8cf59797f0b3758c8878c368bb4cf7e SCRATCH_MNT/test-292/file1 +ce2023f765eba19677517c511886d5c9 SCRATCH_MNT/test-292/file3 +e8cf59797f0b3758c8878c368bb4cf7e SCRATCH_MNT/test-292/file1.chk +Check for damage diff --git a/tests/generic/293 b/tests/generic/293 new file mode 100755 index 0000000..1d2d418 --- /dev/null +++ b/tests/generic/293 @@ -0,0 +1,107 @@ +#! /bin/bash +# FS QA Test No. 293 +# +# Ensuring that copy on write in buffered mode to the source file when the +# CoW range covers delalloc blocks and regular shared blocks. +# - Create two files. +# - Truncate the first file. +# - Write the odd blocks of the first file. +# - Reflink the odd blocks of the first file into the second file. +# - Write the even blocks of the first file. +# - CoW the first file across the halfway mark, starting with the +# regular extent. +# - Check that the files are now different where we say they're different. +# +#----------------------------------------------------------------------- +# Copyright (c) 2016, Oracle and/or its affiliates. All Rights Reserved. +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License as +# published by the Free Software Foundation. +# +# This program is distributed in the hope that it would be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write the Free Software Foundation, +# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA +#----------------------------------------------------------------------- + +seq=`basename "$0"` +seqres="$RESULT_DIR/$seq" +echo "QA output created by $seq" + +here=`pwd` +tmp=/tmp/$$ +status=1 # failure is the default! +trap "_cleanup; exit \$status" 0 1 2 3 15 + +_cleanup() +{ + cd / + rm -rf "$tmp".* +} + +# get standard environment, filters and checks +. ./common/rc +. ./common/filter +. ./common/reflink + +# real QA test starts here +_supported_os Linux +_require_scratch_reflink +_require_xfs_io_command "falloc" + +rm -f "$seqres.full" + +echo "Format and mount" +_scratch_mkfs > "$seqres.full" 2>&1 +_scratch_mount >> "$seqres.full" 2>&1 + +testdir="$SCRATCH_MNT/test-$seq" +rm -rf $testdir +mkdir $testdir + +echo "Create the original files" +blksz=65536 +nr=64 +"$XFS_IO_PROG" -f -c "truncate $((blksz * nr))" "$testdir/file1" >> "$seqres.full" +_pwrite_byte 0x00 0 $((blksz * nr)) "$testdir/file1.chk" >> "$seqres.full" +_pwrite_byte 0x62 0 $((blksz * nr)) "$testdir/file3" >> "$seqres.full" +seq 1 2 $((nr-1)) | while read f; do + _pwrite_byte 0x61 $((blksz * f)) $blksz "$testdir/file1" >> "$seqres.full" + _pwrite_byte 0x61 $((blksz * f)) $blksz "$testdir/file1.chk" >> "$seqres.full" +done +sync +seq 1 2 $((nr-1)) | while read f; do + _reflink_range "$testdir/file1" $((blksz * f)) "$testdir/file3" $((blksz * f)) $blksz >> "$seqres.full" +done +_scratch_remount + +echo "Compare files" +md5sum "$testdir/file1" | _filter_scratch +md5sum "$testdir/file3" | _filter_scratch +md5sum "$testdir/file1.chk" | _filter_scratch + +echo "CoW across the transition" +seq 0 2 $((nr-1)) | while read f; do + _pwrite_byte 0x64 $((blksz * f)) $blksz "$testdir/file1" >> "$seqres.full" + _pwrite_byte 0x64 $((blksz * f)) $blksz "$testdir/file1.chk" >> "$seqres.full" +done +"$XFS_IO_PROG" -f -c "pwrite -S 0x63 -b $((blksz * nr / 2)) $((blksz * nr / 4)) $((blksz * nr / 2))" "$testdir/file1" >> "$seqres.full" +_pwrite_byte 0x63 $((blksz * nr / 4)) $((blksz * nr / 2)) "$testdir/file1.chk" >> "$seqres.full" +_scratch_remount + +echo "Compare files" +md5sum "$testdir/file1" | _filter_scratch +md5sum "$testdir/file3" | _filter_scratch +md5sum "$testdir/file1.chk" | _filter_scratch + +echo "Check for damage" +umount "$SCRATCH_MNT" + +# success, all done +status=0 +exit diff --git a/tests/generic/293.out b/tests/generic/293.out new file mode 100644 index 0000000..1f1aeb3 --- /dev/null +++ b/tests/generic/293.out @@ -0,0 +1,13 @@ +QA output created by 293 +Format and mount +Create the original files +Compare files +b8a8a88d4c143f79900c4b4e79aa3e37 SCRATCH_MNT/test-293/file1 +ce2023f765eba19677517c511886d5c9 SCRATCH_MNT/test-293/file3 +b8a8a88d4c143f79900c4b4e79aa3e37 SCRATCH_MNT/test-293/file1.chk +CoW across the transition +Compare files +35e2170e14665b780c6dec328d6a263b SCRATCH_MNT/test-293/file1 +ce2023f765eba19677517c511886d5c9 SCRATCH_MNT/test-293/file3 +35e2170e14665b780c6dec328d6a263b SCRATCH_MNT/test-293/file1.chk +Check for damage diff --git a/tests/generic/295 b/tests/generic/295 new file mode 100755 index 0000000..e8b74f2 --- /dev/null +++ b/tests/generic/295 @@ -0,0 +1,107 @@ +#! /bin/bash +# FS QA Test No. 295 +# +# Ensuring that copy on write in directio mode to the source file when the +# CoW range covers delalloc blocks and regular shared blocks. +# - Create two files. +# - Truncate the first file. +# - Write the odd blocks of the first file. +# - Reflink the odd blocks of the first file into the second file. +# - Write the even blocks of the first file. +# - DIO CoW the first file across the halfway mark, starting with the +# regular extent. +# - Check that the files are now different where we say they're different. +# +#----------------------------------------------------------------------- +# Copyright (c) 2016, Oracle and/or its affiliates. All Rights Reserved. +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License as +# published by the Free Software Foundation. +# +# This program is distributed in the hope that it would be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write the Free Software Foundation, +# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA +#----------------------------------------------------------------------- + +seq=`basename "$0"` +seqres="$RESULT_DIR/$seq" +echo "QA output created by $seq" + +here=`pwd` +tmp=/tmp/$$ +status=1 # failure is the default! +trap "_cleanup; exit \$status" 0 1 2 3 15 + +_cleanup() +{ + cd / + rm -rf "$tmp".* +} + +# get standard environment, filters and checks +. ./common/rc +. ./common/filter +. ./common/reflink + +# real QA test starts here +_supported_os Linux +_require_scratch_reflink +_require_xfs_io_command "falloc" + +rm -f "$seqres.full" + +echo "Format and mount" +_scratch_mkfs > "$seqres.full" 2>&1 +_scratch_mount >> "$seqres.full" 2>&1 + +testdir="$SCRATCH_MNT/test-$seq" +rm -rf $testdir +mkdir $testdir + +echo "Create the original files" +blksz=65536 +nr=64 +"$XFS_IO_PROG" -f -c "truncate $((blksz * nr))" "$testdir/file1" >> "$seqres.full" +_pwrite_byte 0x00 0 $((blksz * nr)) "$testdir/file1.chk" >> "$seqres.full" +_pwrite_byte 0x62 0 $((blksz * nr)) "$testdir/file3" >> "$seqres.full" +seq 1 2 $((nr-1)) | while read f; do + _pwrite_byte 0x61 $((blksz * f)) $blksz "$testdir/file1" >> "$seqres.full" + _pwrite_byte 0x61 $((blksz * f)) $blksz "$testdir/file1.chk" >> "$seqres.full" +done +sync +seq 1 2 $((nr-1)) | while read f; do + _reflink_range "$testdir/file1" $((blksz * f)) "$testdir/file3" $((blksz * f)) $blksz >> "$seqres.full" +done +_scratch_remount + +echo "Compare files" +md5sum "$testdir/file1" | _filter_scratch +md5sum "$testdir/file3" | _filter_scratch +md5sum "$testdir/file1.chk" | _filter_scratch + +echo "CoW across the transition" +seq 0 2 $((nr-1)) | while read f; do + _pwrite_byte 0x64 $((blksz * f)) $blksz "$testdir/file1" >> "$seqres.full" + _pwrite_byte 0x64 $((blksz * f)) $blksz "$testdir/file1.chk" >> "$seqres.full" +done +"$XFS_IO_PROG" -d -f -c "pwrite -S 0x63 -b $((blksz * nr / 2)) $((blksz * nr / 4)) $((blksz * nr / 2))" "$testdir/file1" >> "$seqres.full" +_pwrite_byte 0x63 $((blksz * nr / 4)) $((blksz * nr / 2)) "$testdir/file1.chk" >> "$seqres.full" +_scratch_remount + +echo "Compare files" +md5sum "$testdir/file1" | _filter_scratch +md5sum "$testdir/file3" | _filter_scratch +md5sum "$testdir/file1.chk" | _filter_scratch + +echo "Check for damage" +umount "$SCRATCH_MNT" + +# success, all done +status=0 +exit diff --git a/tests/generic/295.out b/tests/generic/295.out new file mode 100644 index 0000000..a1c9b1f --- /dev/null +++ b/tests/generic/295.out @@ -0,0 +1,13 @@ +QA output created by 295 +Format and mount +Create the original files +Compare files +b8a8a88d4c143f79900c4b4e79aa3e37 SCRATCH_MNT/test-295/file1 +ce2023f765eba19677517c511886d5c9 SCRATCH_MNT/test-295/file3 +b8a8a88d4c143f79900c4b4e79aa3e37 SCRATCH_MNT/test-295/file1.chk +CoW across the transition +Compare files +35e2170e14665b780c6dec328d6a263b SCRATCH_MNT/test-295/file1 +ce2023f765eba19677517c511886d5c9 SCRATCH_MNT/test-295/file3 +35e2170e14665b780c6dec328d6a263b SCRATCH_MNT/test-295/file1.chk +Check for damage diff --git a/tests/generic/296 b/tests/generic/296 new file mode 100755 index 0000000..f8edc1b --- /dev/null +++ b/tests/generic/296 @@ -0,0 +1,96 @@ +#! /bin/bash +# FS QA Test No. 296 +# +# - Create two reflinked files a byte longer than a block. +# - Rewrite the whole file. +# +#----------------------------------------------------------------------- +# Copyright (c) 2016, Oracle and/or its affiliates. All Rights Reserved. +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License as +# published by the Free Software Foundation. +# +# This program is distributed in the hope that it would be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write the Free Software Foundation, +# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA +#----------------------------------------------------------------------- + +seq=`basename "$0"` +seqres="$RESULT_DIR/$seq" +echo "QA output created by $seq" + +here=`pwd` +tmp=/tmp/$$ +status=1 # failure is the default! +trap "_cleanup; exit \$status" 0 1 2 3 15 + +_cleanup() +{ + cd / + #rm -rf "$tmp".* "$testdir" +} + +# get standard environment, filters and checks +. ./common/rc +. ./common/filter +. ./common/reflink + +# real QA test starts here +_supported_os Linux +_require_scratch_reflink +_require_cp_reflink + +rm -f "$seqres.full" + +echo "Format and mount" +_scratch_mkfs > "$seqres.full" 2>&1 +_scratch_mount >> "$seqres.full" 2>&1 + +testdir="$SCRATCH_MNT/test-$seq" +rm -rf $testdir +mkdir $testdir + +blksz=65536 +nr=128 +bsz=16 + +free_blocks=$(stat -f -c '%a' "$testdir") +real_blksz=$(stat -f -c '%S' "$testdir") +space_needed=$(((blksz * nr * 3) * 5 / 4)) +space_avail=$((free_blocks * real_blksz)) +internal_blks=$((blksz * nr / real_blksz)) +test $space_needed -gt $space_avail && _notrun "Not enough space. $space_avail < $space_needed" + +echo "Create the original files" +"$XFS_IO_PROG" -f -c "pwrite -S 0x61 -b $((blksz * bsz)) 0 $((blksz * nr + 1))" "$testdir/file1" >> "$seqres.full" +_cp_reflink "$testdir/file1" "$testdir/file2" >> "$seqres.full" +"$XFS_IO_PROG" -f -c "pwrite -S 0x61 -b $((blksz * bsz)) 0 $((blksz * nr + 1))" "$testdir/file2.chk" >> "$seqres.full" +_scratch_remount + +echo "Compare files" +md5sum "$testdir/file1" | _filter_scratch +md5sum "$testdir/file2" | _filter_scratch +md5sum "$testdir/file2.chk" | _filter_scratch + +echo "CoW and unmount" +"$XFS_IO_PROG" -f -c "pwrite -S 0x63 -b $real_blksz 0 $((blksz * nr + 1))" -c "fdatasync" "$testdir/file2" >> "$seqres.full" +"$XFS_IO_PROG" -f -c "pwrite -S 0x63 -b $real_blksz 0 $((blksz * nr + 1))" -c "fdatasync" "$testdir/file2.chk" >> "$seqres.full" +_scratch_remount + +echo "Compare files" +md5sum "$testdir/file1" | _filter_scratch +md5sum "$testdir/file2" | _filter_scratch +md5sum "$testdir/file2.chk" | _filter_scratch + +echo "Check for damage" +umount "$SCRATCH_MNT" + +# success, all done +status=0 +exit diff --git a/tests/generic/296.out b/tests/generic/296.out new file mode 100644 index 0000000..1b44cb4 --- /dev/null +++ b/tests/generic/296.out @@ -0,0 +1,13 @@ +QA output created by 296 +Format and mount +Create the original files +Compare files +2909feb63a37b0e95fe5cfb7f274f7b1 SCRATCH_MNT/test-296/file1 +2909feb63a37b0e95fe5cfb7f274f7b1 SCRATCH_MNT/test-296/file2 +2909feb63a37b0e95fe5cfb7f274f7b1 SCRATCH_MNT/test-296/file2.chk +CoW and unmount +Compare files +2909feb63a37b0e95fe5cfb7f274f7b1 SCRATCH_MNT/test-296/file1 +d41f6527bc8320364e12ea7076140b8b SCRATCH_MNT/test-296/file2 +d41f6527bc8320364e12ea7076140b8b SCRATCH_MNT/test-296/file2.chk +Check for damage diff --git a/tests/generic/group b/tests/generic/group index c2624eb..98242e8 100644 --- a/tests/generic/group +++ b/tests/generic/group @@ -286,10 +286,19 @@ 281 auto quick clone 282 auto quick clone 283 auto quick clone +284 auto quick clone 285 auto rw 286 auto quick other +287 auto quick clone 288 auto quick ioctl trim +289 auto quick clone +290 auto quick clone +291 auto quick clone +292 auto quick clone +293 auto quick clone 294 auto quick +295 auto quick clone +296 auto quick clone 299 auto aio enospc rw stress 300 auto aio enospc preallocrw stress 306 auto quick rw From darrick.wong@oracle.com Mon Feb 8 19:13:01 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay2.corp.sgi.com [137.38.102.29]) by oss.sgi.com (Postfix) with ESMTP id 1164629E1D for ; Mon, 8 Feb 2016 19:13:01 -0600 (CST) Received: from cuda.sgi.com (cuda3.sgi.com [192.48.176.15]) by relay2.corp.sgi.com (Postfix) with ESMTP id 0D1D8304032 for ; Mon, 8 Feb 2016 17:13:00 -0800 (PST) X-ASG-Debug-ID: 1454980377-04cb6c1e57035f0001-NocioJ Received: from userp1040.oracle.com (userp1040.oracle.com [156.151.31.81]) by cuda.sgi.com with ESMTP id p0JFbS7iBIkjQaEU (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO) for ; Mon, 08 Feb 2016 17:12:58 -0800 (PST) X-Barracuda-Envelope-From: darrick.wong@oracle.com X-Barracuda-Apparent-Source-IP: 156.151.31.81 Received: from userv0022.oracle.com (userv0022.oracle.com [156.151.31.74]) by userp1040.oracle.com (Sentrion-MTA-4.3.2/Sentrion-MTA-4.3.2) with ESMTP id u191CrEo014921 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 9 Feb 2016 01:12:53 GMT Received: from userv0122.oracle.com (userv0122.oracle.com [156.151.31.75]) by userv0022.oracle.com (8.14.4/8.13.8) with ESMTP id u191CrK1010110 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL); Tue, 9 Feb 2016 01:12:53 GMT Received: from abhmp0011.oracle.com (abhmp0011.oracle.com [141.146.116.17]) by userv0122.oracle.com (8.14.4/8.14.4) with ESMTP id u191CrYX023168; Tue, 9 Feb 2016 01:12:53 GMT Received: from localhost (/10.145.178.207) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Mon, 08 Feb 2016 17:12:51 -0800 Subject: [PATCH 10/23] xfs: more reflink tests From: "Darrick J. Wong" X-ASG-Orig-Subj: [PATCH 10/23] xfs: more reflink tests To: david@fromorbit.com, darrick.wong@oracle.com Cc: linux-btrfs@vger.kernel.org, fstests@vger.kernel.org, xfs@oss.sgi.com Date: Mon, 08 Feb 2016 17:12:50 -0800 Message-ID: <20160209011250.23099.50000.stgit@birch.djwong.org> In-Reply-To: <20160209011145.23099.95354.stgit@birch.djwong.org> References: <20160209011145.23099.95354.stgit@birch.djwong.org> User-Agent: StGit/0.17.1-dirty MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit X-Source-IP: userv0022.oracle.com [156.151.31.74] X-Barracuda-Connect: userp1040.oracle.com[156.151.31.81] X-Barracuda-Start-Time: 1454980378 X-Barracuda-Encrypted: ECDHE-RSA-AES256-GCM-SHA384 X-Barracuda-URL: https://192.48.176.15:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-BRTS-Status: 1 X-Barracuda-Spam-Score: 0.00 X-Barracuda-Spam-Status: No, SCORE=0.00 using per-user scores of TAG_LEVEL=1000.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.7 tests=BSF_SC0_MISMATCH_TO, UNPARSEABLE_RELAY X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.3.26874 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 0.00 BSF_SC0_MISMATCH_TO Envelope rcpt doesn't match header 0.00 UNPARSEABLE_RELAY Informational: message has unparseable relay lines Create a couple of XFS-specific tests -- one to check that growing and shrinking the refcount btree works and a second one to check what happens when we hit maximum refcount. Signed-off-by: Darrick J. Wong --- tests/xfs/169 | 90 ++++++++++++++++++++++++++++++++++++++++ tests/xfs/169.out | 8 ++++ tests/xfs/179 | 119 +++++++++++++++++++++++++++++++++++++++++++++++++++++ tests/xfs/179.out | 10 ++++ tests/xfs/group | 4 +- 5 files changed, 230 insertions(+), 1 deletion(-) create mode 100755 tests/xfs/169 create mode 100644 tests/xfs/169.out create mode 100755 tests/xfs/179 create mode 100644 tests/xfs/179.out diff --git a/tests/xfs/169 b/tests/xfs/169 new file mode 100755 index 0000000..e0fcc44 --- /dev/null +++ b/tests/xfs/169 @@ -0,0 +1,90 @@ +#! /bin/bash +# FS QA Test No. 169 +# +# Ensure that we can create enough distinct reflink entries to force creation +# of a multi-level refcount btree. Delete and recreate a few times to +# exercise the refcount btree grow/shrink functions. +# +#----------------------------------------------------------------------- +# Copyright (c) 2016, Oracle and/or its affiliates. All Rights Reserved. +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License as +# published by the Free Software Foundation. +# +# This program is distributed in the hope that it would be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write the Free Software Foundation, +# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA +#----------------------------------------------------------------------- + +seq=`basename "$0"` +seqres=$RESULT_DIR/$seq +echo "QA output created by $seq" + +here=`pwd` +tmp=/tmp/$$ +status=1 # failure is the default! +trap "_cleanup; exit \$status" 0 1 2 3 15 + +_cleanup() +{ + cd / + umount "$SCRATCH_MNT" > /dev/null 2>&1 + rm -rf "$tmp".* +} + +# get standard environment, filters and checks +. ./common/rc +. ./common/filter +. ./common/reflink + +# real QA test starts here +_supported_os Linux +_supported_fs xfs +_require_scratch_reflink + +rm -f "$seqres.full" + +_scratch_mkfs >/dev/null 2>&1 +_scratch_mount + +testdir="$SCRATCH_MNT/test-$seq" +rm -rf "$testdir" +mkdir "$testdir" + +echo "Create the original file blocks" +blksz="$(stat -f "$testdir" -c '%S')" +nr_blks=$((8 * blksz / 12)) + +for i in 1 2 x; do + _pwrite_byte 0x61 0 $((blksz * nr_blks)) "$testdir/file1" >> "$seqres.full" + + echo "$i: Reflink every other block" + seq 1 2 $((nr_blks - 1)) | while read nr; do + _reflink_range "$testdir/file1" $((nr * blksz)) \ + "$testdir/file2" $((nr * blksz)) $blksz >> "$seqres.full" + done + umount "$SCRATCH_MNT" + _check_scratch_fs + _scratch_mount + + test "$i" = "x" && break + + echo "$i: Delete both files" + rm -rf "$testdir/file1" "$testdir/file2" + umount "$SCRATCH_MNT" + _check_scratch_fs + _scratch_mount +done + +echo "Check for damage" +umount "$SCRATCH_MNT" + +# success, all done +status=0 +exit diff --git a/tests/xfs/169.out b/tests/xfs/169.out new file mode 100644 index 0000000..263f696 --- /dev/null +++ b/tests/xfs/169.out @@ -0,0 +1,8 @@ +QA output created by 169 +Create the original file blocks +1: Reflink every other block +1: Delete both files +2: Reflink every other block +2: Delete both files +x: Reflink every other block +Check for damage diff --git a/tests/xfs/179 b/tests/xfs/179 new file mode 100755 index 0000000..4cdf862 --- /dev/null +++ b/tests/xfs/179 @@ -0,0 +1,119 @@ +#! /bin/bash +# FS QA Test No. 179 +# +# See how well reflink handles overflowing reflink counts. +# +#----------------------------------------------------------------------- +# Copyright (c) 2016, Oracle and/or its affiliates. All Rights Reserved. +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License as +# published by the Free Software Foundation. +# +# This program is distributed in the hope that it would be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write the Free Software Foundation, +# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA +#----------------------------------------------------------------------- + +seq=`basename "$0"` +seqres="$RESULT_DIR/$seq" +echo "QA output created by $seq" + +here=`pwd` +tmp=/tmp/$$ +status=1 # failure is the default! +trap "_cleanup; exit \$status" 0 1 2 3 15 + +_cleanup() +{ + cd / + rm -rf "$tmp".* +} + +# get standard environment, filters and checks +. ./common/rc +. ./common/filter +. ./common/attr +. ./common/reflink + +# real QA test starts here +_supported_os Linux +_supported_fs xfs +_require_scratch_reflink +_require_cp_reflink + +test -x "$here/src/punch-alternating" || _notrun "punch-alternating not built" + +rm -f "$seqres.full" + +echo "Format and mount" +_scratch_mkfs -d agcount=1 > "$seqres.full" 2>&1 +_scratch_mount >> "$seqres.full" 2>&1 + +testdir="$SCRATCH_MNT/test-$seq" +rm -rf "$testdir" +mkdir "$testdir" + +blksz=65536 + +echo "Create original files" +_pwrite_byte 0x61 0 $blksz "$testdir/file1" >> "$seqres.full" +_cp_reflink "$testdir/file1" "$testdir/file2" >> "$seqres.full" + +echo "Change reference count" +umount "$SCRATCH_MNT" +echo "set refcount to -4" >> "$seqres.full" +"$XFS_DB_PROG" -x -c 'agf 0' -c 'addr refcntroot' -c 'write recs[1].refcount 4294967292' "$SCRATCH_DEV" >> "$seqres.full" +echo "check refcount after setting to -4" >> "$seqres.full" +"$XFS_DB_PROG" -c 'agf 0' -c 'addr refcntroot' -c 'p recs[1]' "$SCRATCH_DEV" >> "$seqres.full" +_scratch_mount >> "$seqres.full" + +echo "Reflink the overlinked file" +_cp_reflink "$testdir/file1" "$testdir/file3" >> "$seqres.full" +_cp_reflink "$testdir/file1" "$testdir/file4" >> "$seqres.full" +_cp_reflink "$testdir/file1" "$testdir/file5" >> "$seqres.full" +_cp_reflink "$testdir/file1" "$testdir/file6" >> "$seqres.full" +_cp_reflink "$testdir/file1" "$testdir/file7" >> "$seqres.full" + +echo "Check scratch fs" +umount "$SCRATCH_MNT" +echo "check refcount after reflinking 5 more times" >> "$seqres.full" +"$XFS_DB_PROG" -c 'agf 0' -c 'addr refcntroot' -c 'p recs[1]' "$SCRATCH_DEV" >> "$seqres.full" +_scratch_mount >> "$seqres.full" + +echo "CoW a couple files" +_pwrite_byte 0x62 0 $blksz "$testdir/file3" >> "$seqres.full" +_pwrite_byte 0x62 0 $blksz "$testdir/file5" >> "$seqres.full" +_pwrite_byte 0x62 0 $blksz "$testdir/file7" >> "$seqres.full" + +echo "Check scratch fs" +umount "$SCRATCH_MNT" +echo "check refcount after cowing 3 files" >> "$seqres.full" +"$XFS_DB_PROG" -c 'agf 0' -c 'addr refcntroot' -c 'p recs[1]' "$SCRATCH_DEV" >> "$seqres.full" +_scratch_mount >> "$seqres.full" + +echo "Remove reflinked files" +rm -rf "$testdir"/file* + +echo "Check scratch fs" +umount "$SCRATCH_MNT" +echo "check refcount after removing all files" >> "$seqres.full" +"$XFS_DB_PROG" -c 'agf 0' -c 'addr refcntroot' -c 'p recs[1]' "$SCRATCH_DEV" >> "$seqres.full" +"$XFS_REPAIR_PROG" -o force_geometry -n "$SCRATCH_DEV" >> "$seqres.full" 2>&1 +res=$? +if [ $res -eq 0 ]; then + # If repair succeeds then format the device so that the post-test + # check doesn't fail due to the single AG. + _scratch_mkfs >> "$seqres.full" 2>&1 +else + _fail "xfs_repair fails" +fi + +# success, all done +status=0 +exit diff --git a/tests/xfs/179.out b/tests/xfs/179.out new file mode 100644 index 0000000..4d3e605 --- /dev/null +++ b/tests/xfs/179.out @@ -0,0 +1,10 @@ +QA output created by 179 +Format and mount +Create original files +Change reference count +Reflink the overlinked file +Check scratch fs +CoW a couple files +Check scratch fs +Remove reflinked files +Check scratch fs diff --git a/tests/xfs/group b/tests/xfs/group index 2db3520..f0c1c2b 100644 --- a/tests/xfs/group +++ b/tests/xfs/group @@ -127,7 +127,7 @@ 127 auto quick clone 128 auto quick clone 129 auto quick clone -130 fuzzers +130 fuzzers clone 131 auto quick clone 132 auto quick clone 133 auto quick quota @@ -166,6 +166,7 @@ 166 rw metadata auto quick 167 rw metadata auto stress 168 dmapi +169 auto quick clone 170 rw filestreams auto quick 171 rw filestreams 172 rw filestreams @@ -175,6 +176,7 @@ 176 dmapi 177 dmapi 178 mkfs other auto +179 auto quick clone 181 log auto quick 183 rw other auto quick 185 dmapi From darrick.wong@oracle.com Mon Feb 8 19:13:10 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay1.corp.sgi.com [137.38.102.111]) by oss.sgi.com (Postfix) with ESMTP id 4A6FD7CA4 for ; Mon, 8 Feb 2016 19:13:10 -0600 (CST) Received: from cuda.sgi.com (cuda2.sgi.com [192.48.176.25]) by relay1.corp.sgi.com (Postfix) with ESMTP id 42CDA8F8033 for ; Mon, 8 Feb 2016 17:13:10 -0800 (PST) X-ASG-Debug-ID: 1454980386-04cbb04332059d0001-NocioJ Received: from userp1040.oracle.com (userp1040.oracle.com [156.151.31.81]) by cuda.sgi.com with ESMTP id zWORD28JOlWWBOFQ (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO) for ; Mon, 08 Feb 2016 17:13:06 -0800 (PST) X-Barracuda-Envelope-From: darrick.wong@oracle.com X-Barracuda-Apparent-Source-IP: 156.151.31.81 Received: from aserv0021.oracle.com (aserv0021.oracle.com [141.146.126.233]) by userp1040.oracle.com (Sentrion-MTA-4.3.2/Sentrion-MTA-4.3.2) with ESMTP id u191Cw1S014954 (version=TLSv1 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Tue, 9 Feb 2016 01:12:59 GMT Received: from aserv0122.oracle.com (aserv0122.oracle.com [141.146.126.236]) by aserv0021.oracle.com (8.13.8/8.13.8) with ESMTP id u191CwlM002770 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=FAIL); Tue, 9 Feb 2016 01:12:58 GMT Received: from abhmp0008.oracle.com (abhmp0008.oracle.com [141.146.116.14]) by aserv0122.oracle.com (8.13.8/8.13.8) with ESMTP id u191Cwsn027749; Tue, 9 Feb 2016 01:12:58 GMT Received: from localhost (/10.145.178.207) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Mon, 08 Feb 2016 17:12:58 -0800 Subject: [PATCH 11/23] reflink: ensure that we can handle reflinking a lot of extents From: "Darrick J. Wong" X-ASG-Orig-Subj: [PATCH 11/23] reflink: ensure that we can handle reflinking a lot of extents To: david@fromorbit.com, darrick.wong@oracle.com Cc: linux-btrfs@vger.kernel.org, Christoph Hellwig , fstests@vger.kernel.org, xfs@oss.sgi.com Date: Mon, 08 Feb 2016 17:12:56 -0800 Message-ID: <20160209011256.23099.69614.stgit@birch.djwong.org> In-Reply-To: <20160209011145.23099.95354.stgit@birch.djwong.org> References: <20160209011145.23099.95354.stgit@birch.djwong.org> User-Agent: StGit/0.17.1-dirty MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit X-Source-IP: aserv0021.oracle.com [141.146.126.233] X-Barracuda-Connect: userp1040.oracle.com[156.151.31.81] X-Barracuda-Start-Time: 1454980386 X-Barracuda-Encrypted: ECDHE-RSA-AES256-GCM-SHA384 X-Barracuda-URL: https://192.48.176.25:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-BRTS-Status: 1 X-Barracuda-Spam-Score: 0.00 X-Barracuda-Spam-Status: No, SCORE=0.00 using per-user scores of TAG_LEVEL=1000.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.7 tests=BSF_SC0_MISMATCH_TO, UNPARSEABLE_RELAY X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.3.26874 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 0.00 BSF_SC0_MISMATCH_TO Envelope rcpt doesn't match header 0.00 UNPARSEABLE_RELAY Informational: message has unparseable relay lines Update the existing stress tests to ensure that we can handle reflinking the same block a million times, and that we can handle reflinking million different extents. Add a couple of tests to ensure that we can ^C and SIGKILL our way out of long-running reflinks. v2: Don't run the signal tests on NFS, as we cannot interrupt NFS clone operations. Signed-off-by: Darrick J. Wong [hch@lst.de: don't run on NFS] Signed-off-by: Christoph Hellwig --- .gitignore | 1 src/Makefile | 2 - src/punch-alternating.c | 59 +++++++++++++++++++++++++++ tests/generic/175 | 42 +++++++------------- tests/generic/175.out | 6 +++ tests/generic/176 | 50 +++++++++++++++-------- tests/generic/176.out | 4 +- tests/generic/297 | 101 +++++++++++++++++++++++++++++++++++++++++++++++ tests/generic/297.out | 6 +++ tests/generic/298 | 101 +++++++++++++++++++++++++++++++++++++++++++++++ tests/generic/298.out | 6 +++ tests/generic/group | 6 ++- 12 files changed, 334 insertions(+), 50 deletions(-) create mode 100644 src/punch-alternating.c create mode 100755 tests/generic/297 create mode 100644 tests/generic/297.out create mode 100755 tests/generic/298 create mode 100644 tests/generic/298.out diff --git a/.gitignore b/.gitignore index bbe7c1a..c98c7bf 100644 --- a/.gitignore +++ b/.gitignore @@ -115,6 +115,7 @@ /src/aio-dio-regress/aiocp /src/aio-dio-regress/aiodio_sparse2 /src/aio-dio-regress/aio-dio-eof-race +/src/punch-alternating /src/cloner /src/renameat2 /src/t_rename_overwrite diff --git a/src/Makefile b/src/Makefile index 48e6765..3110208 100644 --- a/src/Makefile +++ b/src/Makefile @@ -19,7 +19,7 @@ LINUX_TARGETS = xfsctl bstat t_mtab getdevicesize preallo_rw_pattern_reader \ bulkstat_unlink_test_modified t_dir_offset t_futimens t_immutable \ stale_handle pwrite_mmap_blocked t_dir_offset2 seek_sanity_test \ seek_copy_test t_readdir_1 t_readdir_2 fsync-tester nsexec cloner \ - renameat2 t_getcwd e4compact test-nextquota + renameat2 t_getcwd e4compact test-nextquota punch-alternating SUBDIRS = diff --git a/src/punch-alternating.c b/src/punch-alternating.c new file mode 100644 index 0000000..9566310 --- /dev/null +++ b/src/punch-alternating.c @@ -0,0 +1,59 @@ +/* + * Punch out every other block in a file. + * Copyright (C) 2016 Oracle. + */ +#include +#include +#include +#include +#include +#include +#include +#include "global.h" + +int main(int argc, char *argv[]) +{ + struct stat s; + off_t offset; + int fd; + blksize_t blksz; + off_t sz; + int mode; + int error; + + if (argc != 2) { + printf("Usage: %s file\n", argv[0]); + printf("Punches every other block in the file.\n"); + return 1; + } + + fd = open(argv[1], O_WRONLY); + if (fd < 0) + goto err; + + error = fstat(fd, &s); + if (error) + goto err; + + sz = s.st_size; + blksz = s.st_blksize; + + mode = FALLOC_FL_PUNCH_HOLE | FALLOC_FL_KEEP_SIZE; + for (offset = 0; offset < sz; offset += blksz * 2) { + error = fallocate(fd, mode, offset, blksz); + if (error) + goto err; + } + + error = fsync(fd); + if (error) + goto err; + + error = close(fd); + if (error) + goto err; + return 0; +err: + perror(argv[1]); + return 2; +} diff --git a/tests/generic/175 b/tests/generic/175 index ac2f54f..0a6d5b8 100755 --- a/tests/generic/175 +++ b/tests/generic/175 @@ -1,12 +1,10 @@ #! /bin/bash # FS QA Test No. 175 # -# Try to hit the maximum reference count (eek!) -# -# This test runs extremely slowly, so it's not automatically run anywhere. +# See how well reflink handles reflinking the same block a million times. # #----------------------------------------------------------------------- -# Copyright (c) 2015, Oracle and/or its affiliates. All Rights Reserved. +# Copyright (c) 2016, Oracle and/or its affiliates. All Rights Reserved. # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License as @@ -34,7 +32,7 @@ trap "_cleanup; exit \$status" 0 1 2 3 15 _cleanup() { cd / - rm -rf "$tmp".* "$testdir1" + rm -rf "$tmp".* } # get standard environment, filters and checks @@ -58,40 +56,28 @@ testdir="$SCRATCH_MNT/test-$seq" rm -rf "$testdir" mkdir "$testdir" -# Well let's hope the maximum reflink count is (less than (ha!)) 2^32... - echo "Create a one block file" blksz="$(stat -f "$testdir" -c '%S')" _pwrite_byte 0x61 0 $blksz "$testdir/file1" >> "$seqres.full" -_pwrite_byte 0x62 0 $blksz "$testdir/file2" >> "$seqres.full" -_cp_reflink "$testdir/file1" "$testdir/file2" >> "$seqres.full" -nr=32 -fnr=32 +fnr=19 +echo "Create extents" +truncate -s $(( (2 ** i) * blksz)) "$testdir/file1" for i in $(seq 0 $fnr); do - echo " ++ Reflink size $i, $(( (2 ** i) * blksz)) bytes" | tee -a "$seqres.full" + echo " ++ Reflink size $i, $((2 ** i)) blocks" >> "$seqres.full" n=$(( (2 ** i) * blksz)) - _reflink_range "$testdir/file1" 0 "$testdir/file1" $n $n >> "$seqres.full" || break + _reflink_range "$testdir/file1" 0 "$testdir/file1" $n $n >> "$seqres.full" done +_scratch_remount -nrf=$((nr - fnr)) -echo "Clone $((2 ** nrf)) files" -seq 0 $((2 ** nrf)) | while read i; do - _cp-reflink "$testdir/file1" "$testdir/file1-$i" -done +echo "Reflink the big file" +blks=$((2 ** (fnr + 1) )) +bytes=$((blks * blksz)) +echo "reflinking $blks blocks, $bytes bytes" >> "$seqres.full" +_reflink_range "$testdir/file1" 0 "$testdir/file2" 0 $bytes >> "$seqres.full" echo "Check scratch fs" umount "$SCRATCH_MNT" -_check_scratch_fs - -echo "Remove big file and recheck" -_scratch_mount >> "$seqres.full" 2>&1 -umount "$SCRATCH_MNT" -_check_scratch_fs - -echo "Remove all files and recheck" -_scratch_mount >> "$seqres.full" 2>&1 -umount "$SCRATCH_MNT" # success, all done status=0 diff --git a/tests/generic/175.out b/tests/generic/175.out index e69de29..8fa5726 100644 --- a/tests/generic/175.out +++ b/tests/generic/175.out @@ -0,0 +1,6 @@ +QA output created by 175 +Format and mount +Create a one block file +Create extents +Reflink the big file +Check scratch fs diff --git a/tests/generic/176 b/tests/generic/176 index e32f94f..b1ebb83 100755 --- a/tests/generic/176 +++ b/tests/generic/176 @@ -1,10 +1,10 @@ #! /bin/bash # FS QA Test No. 176 # -# Try to run out of space while cloning? +# See how well reflink handles reflinking a file with a million extents. # #----------------------------------------------------------------------- -# Copyright (c) 2015, Oracle and/or its affiliates. All Rights Reserved. +# Copyright (c) 2016, Oracle and/or its affiliates. All Rights Reserved. # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License as @@ -32,7 +32,7 @@ trap "_cleanup; exit \$status" 0 1 2 3 15 _cleanup() { cd / - rm -rf "$tmp".* "$testdir1" + rm -rf "$tmp".* } # get standard environment, filters and checks @@ -44,6 +44,9 @@ _cleanup() # real QA test starts here _supported_os Linux _require_scratch_reflink +_require_cp_reflink + +test -x "$here/src/punch-alternating" || _notrun "punch-alternating not built" rm -f "$seqres.full" @@ -55,22 +58,35 @@ testdir="$SCRATCH_MNT/test-$seq" rm -rf "$testdir" mkdir "$testdir" -blksz="$(stat -f "$testdir" -c '%S')" -nr_free="$(stat -f -c '%f' "$testdir")" -echo "Create a big file" -touch "$testdir/file0" "$testdir/file1" -_pwrite_byte 0x61 0 $((blksz * nr_free)) "$testdir/bigfile" >> "$seqres.full" 2>&1 +# Setup for one million blocks, but we'll accept stress testing down to +# 2^17 blocks... that should be plenty for anyone. +fnr=20 +free_blocks=$(stat -f -c '%a' "$testdir") +blksz=$(stat -f -c '%S' "$testdir") +space_avail=$((free_blocks * blksz)) +calc_space() { + blocks_needed=$(( 2 ** (fnr + 1) )) + space_needed=$((blocks_needed * blksz * 5 / 4)) +} +calc_space +while test $space_needed -gt $space_avail; do + fnr=$((fnr - 1)) + calc_space +done +test $fnr -lt 17 && _notrun "Insufficient space for stress test; would only create $blocks_needed extents." + +echo "Create a many-block file" +echo "creating $blocks_needed blocks..." >> "$seqres.full" +"$XFS_IO_PROG" -d -f -c "pwrite -S 0x61 -b 4194304 0 $((2 ** (fnr + 1) * blksz))" "$testdir/file1" >> "$seqres.full" +echo "punching..." >> "$seqres.full" +"$here/src/punch-alternating" "$testdir/file1" >> "$seqres.full" +echo "...done" >> "$seqres.full" _scratch_remount -sz="$(stat -c '%s' "$testdir/bigfile")" -blks="$((sz / blksz))" -echo "Try to reflink" -seq 0 $blks | while read lblk; do - fname="$testdir/file$((lblk % 2))" - out="$(_reflink_range "$testdir/bigfile" $((lblk * blksz)) "$fname" $((lblk * blksz)) $blksz 2>&1)" - echo "$fname: $out" >> "$seqres.full" - echo "$out" | grep -q "No space left on device" && break -done +echo "Reflink the big file" +bytes=$((blocks_needed * blksz)) +echo "reflinking $((blocks_needed / 2)) blocks, $((bytes / 2)) bytes" >> "$seqres.full" +_reflink_range "$testdir/file1" 0 "$testdir/file2" 0 $bytes >> "$seqres.full" echo "Check scratch fs" umount "$SCRATCH_MNT" diff --git a/tests/generic/176.out b/tests/generic/176.out index eec98eb..90819a0 100644 --- a/tests/generic/176.out +++ b/tests/generic/176.out @@ -1,5 +1,5 @@ QA output created by 176 Format and mount -Create a big file -Try to reflink +Create a many-block file +Reflink the big file Check scratch fs diff --git a/tests/generic/297 b/tests/generic/297 new file mode 100755 index 0000000..067ade8 --- /dev/null +++ b/tests/generic/297 @@ -0,0 +1,101 @@ +#! /bin/bash +# FS QA Test No. 297 +# +# See how well reflink handles ^C in the middle of a slow reflink. +# +#----------------------------------------------------------------------- +# Copyright (c) 2016, Oracle and/or its affiliates. All Rights Reserved. +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License as +# published by the Free Software Foundation. +# +# This program is distributed in the hope that it would be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write the Free Software Foundation, +# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA +#----------------------------------------------------------------------- + +seq=`basename "$0"` +seqres="$RESULT_DIR/$seq" +echo "QA output created by $seq" + +here=`pwd` +tmp=/tmp/$$ +status=1 # failure is the default! +trap "_cleanup; exit \$status" 0 1 2 3 15 + +_cleanup() +{ + cd / + rm -rf "$tmp".* "$TEST_DIR/before" "$TEST_DIR/after" +} + +# get standard environment, filters and checks +. ./common/rc +. ./common/filter +. ./common/attr +. ./common/reflink + +# real QA test starts here +_supported_os Linux +_require_scratch_reflink +_require_cp_reflink +_require_command "$(which timeout)" "timeout" + +test "$FSTYP" == "nfs" && _notrun "NFS can't interrupt clone operations" + +rm -f "$seqres.full" + +echo "Format and mount" +_scratch_mkfs > "$seqres.full" 2>&1 +_scratch_mount >> "$seqres.full" 2>&1 + +testdir="$SCRATCH_MNT/test-$seq" +rm -rf "$testdir" +mkdir "$testdir" + +echo "Create a one block file" +blksz="$(stat -f "$testdir" -c '%S')" +_pwrite_byte 0x61 0 $blksz "$testdir/file1" >> "$seqres.full" + +fnr=26 # 2^26 reflink extents should be enough to find a slow op? +timeout=8 # guarantee a good long run... +echo "Find a reflink size that takes a long time" +truncate -s $(( (2 ** i) * blksz)) "$testdir/file1" +for i in $(seq 0 $fnr); do + echo " ++ Reflink size $i, $((2 ** i)) blocks" >> "$seqres.full" + n=$(( (2 ** i) * blksz)) + touch "$TEST_DIR/before" + "$XFS_IO_PROG" -f -c "reflink $testdir/file1 0 $n $n" "$testdir/file1" >> "$seqres.full" 2>&1 + touch "$TEST_DIR/after" + before=$(stat -c '%Y' "$TEST_DIR/before") + after=$(stat -c '%Y' "$TEST_DIR/after") + delta=$((after - before)) + test $delta -gt $timeout && break +done + +echo "Try to kill reflink after a shorter period of time" +kill_after=2 # give us a shorter time to die +n=$(stat -c '%s' "$testdir/file1") +echo "performing kill test on $n bytes..." >> "$seqres.full" +touch "$TEST_DIR/before" +timeout -s INT "${kill_after}s" "$XFS_IO_PROG" -f -c "reflink $testdir/file1 0 $n $n" "$testdir/file1" >> "$seqres.full" 2>&1 +touch "$TEST_DIR/after" +before=$(stat -c '%Y' "$TEST_DIR/before") +after=$(stat -c '%Y' "$TEST_DIR/after") +delta=$((after - before)) +echo "reflink of $n bytes took $delta seconds" >> "$seqres.full" +test $delta -gt $timeout && _fail "reflink didn't stop in time, n=$n t=$delta" + +echo "Check scratch fs" +sleep 2 # give it a few seconds to actually die... +umount "$SCRATCH_MNT" + +# success, all done +status=0 +exit diff --git a/tests/generic/297.out b/tests/generic/297.out new file mode 100644 index 0000000..cfe5b96 --- /dev/null +++ b/tests/generic/297.out @@ -0,0 +1,6 @@ +QA output created by 297 +Format and mount +Create a one block file +Find a reflink size that takes a long time +Try to kill reflink after a shorter period of time +Check scratch fs diff --git a/tests/generic/298 b/tests/generic/298 new file mode 100755 index 0000000..10bd040 --- /dev/null +++ b/tests/generic/298 @@ -0,0 +1,101 @@ +#! /bin/bash +# FS QA Test No. 298 +# +# See how well reflink handles SIGKILL in the middle of a slow reflink. +# +#----------------------------------------------------------------------- +# Copyright (c) 2016, Oracle and/or its affiliates. All Rights Reserved. +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License as +# published by the Free Software Foundation. +# +# This program is distributed in the hope that it would be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write the Free Software Foundation, +# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA +#----------------------------------------------------------------------- + +seq=`basename "$0"` +seqres="$RESULT_DIR/$seq" +echo "QA output created by $seq" + +here=`pwd` +tmp=/tmp/$$ +status=1 # failure is the default! +trap "_cleanup; exit \$status" 0 1 2 3 15 + +_cleanup() +{ + cd / + rm -rf "$tmp".* "$TEST_DIR/before" "$TEST_DIR/after" +} + +# get standard environment, filters and checks +. ./common/rc +. ./common/filter +. ./common/attr +. ./common/reflink + +# real QA test starts here +_supported_os Linux +_require_scratch_reflink +_require_cp_reflink +_require_command "$(which timeout)" "timeout" + +test "$FSTYP" == "nfs" && _notrun "NFS can't interrupt clone operations" + +rm -f "$seqres.full" + +echo "Format and mount" +_scratch_mkfs > "$seqres.full" 2>&1 +_scratch_mount >> "$seqres.full" 2>&1 + +testdir="$SCRATCH_MNT/test-$seq" +rm -rf "$testdir" +mkdir "$testdir" + +echo "Create a one block file" +blksz="$(stat -f "$testdir" -c '%S')" +_pwrite_byte 0x61 0 $blksz "$testdir/file1" >> "$seqres.full" + +fnr=26 # 2^26 reflink extents should be enough to find a slow op? +timeout=8 # guarantee a good long run... +echo "Find a reflink size that takes a long time" +truncate -s $(( (2 ** i) * blksz)) "$testdir/file1" +for i in $(seq 0 $fnr); do + echo " ++ Reflink size $i, $((2 ** i)) blocks" >> "$seqres.full" + n=$(( (2 ** i) * blksz)) + touch "$TEST_DIR/before" + "$XFS_IO_PROG" -f -c "reflink $testdir/file1 0 $n $n" "$testdir/file1" >> "$seqres.full" 2>&1 + touch "$TEST_DIR/after" + before=$(stat -c '%Y' "$TEST_DIR/before") + after=$(stat -c '%Y' "$TEST_DIR/after") + delta=$((after - before)) + test $delta -gt $timeout && break +done + +echo "Try to kill reflink after a shorter period of time" +kill_after=2 # give us a shorter time to die +n=$(stat -c '%s' "$testdir/file1") +echo "performing kill test on $n bytes..." >> "$seqres.full" +touch "$TEST_DIR/before" +urk=$(timeout -s KILL "${kill_after}s" "$XFS_IO_PROG" -f -c "reflink $testdir/file1 0 $n $n" "$testdir/file1" >> "$seqres.full" 2>&1) +touch "$TEST_DIR/after" +before=$(stat -c '%Y' "$TEST_DIR/before") +after=$(stat -c '%Y' "$TEST_DIR/after") +delta=$((after - before)) +echo "reflink of $n bytes took $delta seconds" >> "$seqres.full" +test $delta -gt $timeout && _fail "reflink didn't stop in time, n=$n t=$delta" + +echo "Check scratch fs" +sleep 2 # give it a few seconds to actually die... +umount "$SCRATCH_MNT" + +# success, all done +status=0 +exit diff --git a/tests/generic/298.out b/tests/generic/298.out new file mode 100644 index 0000000..c1cdc7d --- /dev/null +++ b/tests/generic/298.out @@ -0,0 +1,6 @@ +QA output created by 298 +Format and mount +Create a one block file +Find a reflink size that takes a long time +Try to kill reflink after a shorter period of time +Check scratch fs diff --git a/tests/generic/group b/tests/generic/group index 98242e8..3798f3b 100644 --- a/tests/generic/group +++ b/tests/generic/group @@ -177,8 +177,8 @@ 172 auto quick clone 173 auto quick clone 174 auto quick clone -175 clone_stress -176 clone_stress +175 auto quick clone +176 auto quick clone 177 auto quick prealloc metadata 178 auto quick clone 179 auto quick clone @@ -299,6 +299,8 @@ 294 auto quick 295 auto quick clone 296 auto quick clone +297 auto quick clone +298 auto quick clone 299 auto aio enospc rw stress 300 auto aio enospc preallocrw stress 306 auto quick rw From darrick.wong@oracle.com Mon Feb 8 19:13:12 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay2.corp.sgi.com [137.38.102.29]) by oss.sgi.com (Postfix) with ESMTP id C5F4A29E06 for ; Mon, 8 Feb 2016 19:13:12 -0600 (CST) Received: from cuda.sgi.com (cuda1.sgi.com [192.48.157.11]) by relay2.corp.sgi.com (Postfix) with ESMTP id 99721304039 for ; Mon, 8 Feb 2016 17:13:12 -0800 (PST) X-ASG-Debug-ID: 1454980390-04bdf066ed03b20001-NocioJ Received: from userp1040.oracle.com (userp1040.oracle.com [156.151.31.81]) by cuda.sgi.com with ESMTP id JuQiEcC2nfR6lyKD (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO) for ; Mon, 08 Feb 2016 17:13:11 -0800 (PST) X-Barracuda-Envelope-From: darrick.wong@oracle.com X-Barracuda-Apparent-Source-IP: 156.151.31.81 Received: from aserv0022.oracle.com (aserv0022.oracle.com [141.146.126.234]) by userp1040.oracle.com (Sentrion-MTA-4.3.2/Sentrion-MTA-4.3.2) with ESMTP id u191D5aT015362 (version=TLSv1 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Tue, 9 Feb 2016 01:13:06 GMT Received: from userv0122.oracle.com (userv0122.oracle.com [156.151.31.75]) by aserv0022.oracle.com (8.13.8/8.13.8) with ESMTP id u191D5f6014872 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=FAIL); Tue, 9 Feb 2016 01:13:05 GMT Received: from abhmp0004.oracle.com (abhmp0004.oracle.com [141.146.116.10]) by userv0122.oracle.com (8.14.4/8.14.4) with ESMTP id u191D4fE023314; Tue, 9 Feb 2016 01:13:05 GMT Received: from localhost (/10.145.178.207) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Mon, 08 Feb 2016 17:13:04 -0800 Subject: [PATCH 12/23] xfs/122: support refcount/rmap data structures From: "Darrick J. Wong" X-ASG-Orig-Subj: [PATCH 12/23] xfs/122: support refcount/rmap data structures To: david@fromorbit.com, darrick.wong@oracle.com Cc: linux-btrfs@vger.kernel.org, fstests@vger.kernel.org, xfs@oss.sgi.com Date: Mon, 08 Feb 2016 17:13:03 -0800 Message-ID: <20160209011303.23099.40721.stgit@birch.djwong.org> In-Reply-To: <20160209011145.23099.95354.stgit@birch.djwong.org> References: <20160209011145.23099.95354.stgit@birch.djwong.org> User-Agent: StGit/0.17.1-dirty MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit X-Source-IP: aserv0022.oracle.com [141.146.126.234] X-Barracuda-Connect: userp1040.oracle.com[156.151.31.81] X-Barracuda-Start-Time: 1454980390 X-Barracuda-Encrypted: ECDHE-RSA-AES256-GCM-SHA384 X-Barracuda-URL: https://192.48.157.11:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-BRTS-Status: 1 X-Barracuda-Spam-Score: 0.00 X-Barracuda-Spam-Status: No, SCORE=0.00 using per-user scores of TAG_LEVEL=1000.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.7 tests=BSF_SC0_MISMATCH_TO, UNPARSEABLE_RELAY X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.3.26874 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 0.00 BSF_SC0_MISMATCH_TO Envelope rcpt doesn't match header 0.00 UNPARSEABLE_RELAY Informational: message has unparseable relay lines Include the refcount and rmap structures in the golden output. Signed-off-by: Darrick J. Wong --- tests/xfs/122 | 3 +++ tests/xfs/122.out | 4 ++++ tests/xfs/group | 2 +- 3 files changed, 8 insertions(+), 1 deletion(-) diff --git a/tests/xfs/122 b/tests/xfs/122 index e6697a2..758cb50 100755 --- a/tests/xfs/122 +++ b/tests/xfs/122 @@ -90,6 +90,9 @@ xfs_da3_icnode_hdr xfs_dir3_icfree_hdr xfs_dir3_icleaf_hdr xfs_name +xfs_owner_info +xfs_refcount_irec +xfs_rmap_irec xfs_alloctype_t xfs_buf_cancel_t xfs_bmbt_rec_32_t diff --git a/tests/xfs/122.out b/tests/xfs/122.out index 8ba121e..c590166 100644 --- a/tests/xfs/122.out +++ b/tests/xfs/122.out @@ -75,6 +75,10 @@ sizeof(struct xfs_extent_data) = 24 sizeof(struct xfs_extent_data_info) = 32 sizeof(struct xfs_fs_eofblocks) = 128 sizeof(struct xfs_icreate_log) = 28 +sizeof(struct xfs_refcount_key) = 4 +sizeof(struct xfs_refcount_rec) = 12 +sizeof(struct xfs_rmap_key) = 20 +sizeof(struct xfs_rmap_rec) = 24 sizeof(xfs_agf_t) = 224 sizeof(xfs_agfl_t) = 36 sizeof(xfs_agi_t) = 336 diff --git a/tests/xfs/group b/tests/xfs/group index f0c1c2b..abf1d33 100644 --- a/tests/xfs/group +++ b/tests/xfs/group @@ -119,7 +119,7 @@ 119 log v2log auto freeze dangerous 120 fuzzers 121 log auto quick -122 other auto quick +122 other auto quick clone 123 fuzzers 124 fuzzers 125 fuzzers From darrick.wong@oracle.com Mon Feb 8 19:13:27 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay1.corp.sgi.com [137.38.102.111]) by oss.sgi.com (Postfix) with ESMTP id 67F8F7CA7 for ; Mon, 8 Feb 2016 19:13:27 -0600 (CST) Received: from cuda.sgi.com (cuda3.sgi.com [192.48.176.15]) by relay1.corp.sgi.com (Postfix) with ESMTP id 53E598F804B for ; Mon, 8 Feb 2016 17:13:27 -0800 (PST) X-ASG-Debug-ID: 1454980405-04cb6c1e5603690001-NocioJ Received: from aserp1040.oracle.com (aserp1040.oracle.com [141.146.126.69]) by cuda.sgi.com with ESMTP id fEkaTxXTzfRi0ysu (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO) for ; Mon, 08 Feb 2016 17:13:25 -0800 (PST) X-Barracuda-Envelope-From: darrick.wong@oracle.com X-Barracuda-Apparent-Source-IP: 141.146.126.69 Received: from aserv0022.oracle.com (aserv0022.oracle.com [141.146.126.234]) by aserp1040.oracle.com (Sentrion-MTA-4.3.2/Sentrion-MTA-4.3.2) with ESMTP id u191DOGg019816 (version=TLSv1 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Tue, 9 Feb 2016 01:13:24 GMT Received: from aserv0122.oracle.com (aserv0122.oracle.com [141.146.126.236]) by aserv0022.oracle.com (8.13.8/8.13.8) with ESMTP id u191DOam015765 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=FAIL); Tue, 9 Feb 2016 01:13:24 GMT Received: from abhmp0008.oracle.com (abhmp0008.oracle.com [141.146.116.14]) by aserv0122.oracle.com (8.13.8/8.13.8) with ESMTP id u191DOl8027861; Tue, 9 Feb 2016 01:13:24 GMT Received: from localhost (/10.145.178.207) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Mon, 08 Feb 2016 17:13:24 -0800 Subject: [PATCH 15/23] reflink: test xfs cow behavior when the filesystem crashes From: "Darrick J. Wong" X-ASG-Orig-Subj: [PATCH 15/23] reflink: test xfs cow behavior when the filesystem crashes To: david@fromorbit.com, darrick.wong@oracle.com Cc: linux-btrfs@vger.kernel.org, fstests@vger.kernel.org, xfs@oss.sgi.com Date: Mon, 08 Feb 2016 17:13:22 -0800 Message-ID: <20160209011322.23099.43873.stgit@birch.djwong.org> In-Reply-To: <20160209011145.23099.95354.stgit@birch.djwong.org> References: <20160209011145.23099.95354.stgit@birch.djwong.org> User-Agent: StGit/0.17.1-dirty MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit X-Source-IP: aserv0022.oracle.com [141.146.126.234] X-Barracuda-Connect: aserp1040.oracle.com[141.146.126.69] X-Barracuda-Start-Time: 1454980405 X-Barracuda-Encrypted: ECDHE-RSA-AES256-GCM-SHA384 X-Barracuda-URL: https://192.48.176.15:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-BRTS-Status: 1 X-Barracuda-Spam-Score: 0.00 X-Barracuda-Spam-Status: No, SCORE=0.00 using per-user scores of TAG_LEVEL=1000.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.7 tests=BSF_SC0_MISMATCH_TO, UNPARSEABLE_RELAY X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.3.26874 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 0.00 BSF_SC0_MISMATCH_TO Envelope rcpt doesn't match header 0.00 UNPARSEABLE_RELAY Informational: message has unparseable relay lines Use the extent size hint to force leftover CoW reservations then crash the filesystem to see how recovery works. Signed-off-by: Darrick J. Wong --- tests/xfs/212 | 106 +++++++++++++++++++++++++++++++++++++++++++++++++++++ tests/xfs/212.out | 14 +++++++ tests/xfs/group | 1 + 3 files changed, 121 insertions(+) create mode 100755 tests/xfs/212 create mode 100644 tests/xfs/212.out diff --git a/tests/xfs/212 b/tests/xfs/212 new file mode 100755 index 0000000..ccddf05 --- /dev/null +++ b/tests/xfs/212 @@ -0,0 +1,106 @@ +#! /bin/bash +# FS QA Test No. 212 +# +# Test recovery of "lost" CoW blocks after a crash: +# - Create two reflinked files. Set extsz hint on second file. +# - Dirty one byte on the second file and fsync. +# - Crash the FS to test recovery. +# +#----------------------------------------------------------------------- +# Copyright (c) 2016, Oracle and/or its affiliates. All Rights Reserved. +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License as +# published by the Free Software Foundation. +# +# This program is distributed in the hope that it would be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write the Free Software Foundation, +# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA +#----------------------------------------------------------------------- + +seq=`basename "$0"` +seqres="$RESULT_DIR/$seq" +echo "QA output created by $seq" + +here=`pwd` +tmp=/tmp/$$ +status=1 # failure is the default! +trap "_cleanup; exit \$status" 0 1 2 3 15 + +_cleanup() +{ + cd / + #rm -rf "$tmp".* "$testdir" +} + +# get standard environment, filters and checks +. ./common/rc +. ./common/filter +. ./common/reflink + +# real QA test starts here +_supported_os Linux +_supported_fs xfs +_require_scratch_reflink +_require_cp_reflink +_require_fiemap + +rm -f "$seqres.full" + +echo "Format and mount" +_scratch_mkfs > "$seqres.full" 2>&1 +_scratch_mount >> "$seqres.full" 2>&1 + +testdir="$SCRATCH_MNT/test-$seq" +rm -rf $testdir +mkdir $testdir + +blksz=65536 +nr=16 +bsz=2 + +free_blocks=$(stat -f -c '%a' "$testdir") +real_blksz=$(stat -f -c '%S' "$testdir") +space_needed=$(((blksz * nr * 3) * 5 / 4)) +space_avail=$((free_blocks * real_blksz)) +internal_blks=$((blksz * nr / real_blksz)) +test $space_needed -gt $space_avail && _notrun "Not enough space. $space_avail < $space_needed" + +echo "Create the original files" +"$XFS_IO_PROG" -f -c "pwrite -S 0x61 -b $((blksz * bsz)) 0 $((blksz * nr))" "$testdir/file1" >> "$seqres.full" +"$XFS_IO_PROG" -f -c "pwrite -S 0x61 -b $((blksz * bsz)) 0 $((blksz * nr))" "$testdir/file2.chk" >> "$seqres.full" +"$XFS_IO_PROG" -f -c "extsize $((blksz * bsz))" "$testdir/file2" +_cp_reflink "$testdir/file1" "$testdir/file2" >> "$seqres.full" +_scratch_remount + +echo "Compare files" +md5sum "$testdir/file1" | _filter_scratch +md5sum "$testdir/file2" | _filter_scratch +md5sum "$testdir/file2.chk" | _filter_scratch + +echo "CoW and leave leftovers" +"$XFS_IO_PROG" -f -c "extsize" "$testdir/file2" >> "$seqres.full" +"$XFS_IO_PROG" -f -c "pwrite -S 0x63 $((blksz * nr - 1)) 1" -c "fsync" "$testdir/file2" >> "$seqres.full" +"$XFS_IO_PROG" -f -c "pwrite -S 0x63 $((blksz * nr - 1)) 1" -c "fsync" "$testdir/file2.chk" >> "$seqres.full" +sync + +echo "Crash and recover" +"$XFS_IO_PROG" -x -c "shutdown" "$testdir/file2" >> "$seqres.full" +_scratch_remount + +echo "Compare files" +md5sum "$testdir/file1" | _filter_scratch +md5sum "$testdir/file2" | _filter_scratch +md5sum "$testdir/file2.chk" | _filter_scratch + +echo "Check for damage" +umount "$SCRATCH_MNT" + +# success, all done +status=0 +exit diff --git a/tests/xfs/212.out b/tests/xfs/212.out new file mode 100644 index 0000000..24b35e2 --- /dev/null +++ b/tests/xfs/212.out @@ -0,0 +1,14 @@ +QA output created by 212 +Format and mount +Create the original files +Compare files +7202826a7791073fe2787f0c94603278 SCRATCH_MNT/test-212/file1 +7202826a7791073fe2787f0c94603278 SCRATCH_MNT/test-212/file2 +7202826a7791073fe2787f0c94603278 SCRATCH_MNT/test-212/file2.chk +CoW and leave leftovers +Crash and recover +Compare files +7202826a7791073fe2787f0c94603278 SCRATCH_MNT/test-212/file1 +83feff041c88d5c746837552399dc27d SCRATCH_MNT/test-212/file2 +83feff041c88d5c746837552399dc27d SCRATCH_MNT/test-212/file2.chk +Check for damage diff --git a/tests/xfs/group b/tests/xfs/group index 119e1fd..d4a0d59 100644 --- a/tests/xfs/group +++ b/tests/xfs/group @@ -209,6 +209,7 @@ 209 auto quick clone 210 auto quick clone 211 clone_stress +212 auto quick clone 216 log metadata auto quick 217 log metadata auto 220 auto quota quick From darrick.wong@oracle.com Mon Feb 8 19:13:26 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=LOTS_OF_MONEY, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay2.corp.sgi.com [137.38.102.29]) by oss.sgi.com (Postfix) with ESMTP id A81547CA4 for ; Mon, 8 Feb 2016 19:13:26 -0600 (CST) Received: from cuda.sgi.com (cuda1.sgi.com [192.48.157.11]) by relay2.corp.sgi.com (Postfix) with ESMTP id 1327C304039 for ; Mon, 8 Feb 2016 17:13:26 -0800 (PST) X-ASG-Debug-ID: 1454980396-04bdf066ec03b20001-NocioJ Received: from aserp1040.oracle.com (aserp1040.oracle.com [141.146.126.69]) by cuda.sgi.com with ESMTP id 769jzOnc9sVYLbXV (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO) for ; Mon, 08 Feb 2016 17:13:17 -0800 (PST) X-Barracuda-Envelope-From: darrick.wong@oracle.com X-Barracuda-Apparent-Source-IP: 141.146.126.69 Received: from aserv0021.oracle.com (aserv0021.oracle.com [141.146.126.233]) by aserp1040.oracle.com (Sentrion-MTA-4.3.2/Sentrion-MTA-4.3.2) with ESMTP id u191DBaE019735 (version=TLSv1 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Tue, 9 Feb 2016 01:13:12 GMT Received: from aserv0122.oracle.com (aserv0122.oracle.com [141.146.126.236]) by aserv0021.oracle.com (8.13.8/8.13.8) with ESMTP id u191DBTm003423 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=FAIL); Tue, 9 Feb 2016 01:13:11 GMT Received: from abhmp0017.oracle.com (abhmp0017.oracle.com [141.146.116.23]) by aserv0122.oracle.com (8.13.8/8.13.8) with ESMTP id u191DBjb027802; Tue, 9 Feb 2016 01:13:11 GMT Received: from localhost (/10.145.178.207) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Mon, 08 Feb 2016 17:13:11 -0800 Subject: [PATCH 13/23] xfs: test fragmentation characteristics of copy-on-write From: "Darrick J. Wong" X-ASG-Orig-Subj: [PATCH 13/23] xfs: test fragmentation characteristics of copy-on-write To: david@fromorbit.com, darrick.wong@oracle.com Cc: linux-btrfs@vger.kernel.org, fstests@vger.kernel.org, xfs@oss.sgi.com Date: Mon, 08 Feb 2016 17:13:09 -0800 Message-ID: <20160209011309.23099.60912.stgit@birch.djwong.org> In-Reply-To: <20160209011145.23099.95354.stgit@birch.djwong.org> References: <20160209011145.23099.95354.stgit@birch.djwong.org> User-Agent: StGit/0.17.1-dirty MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit X-Source-IP: aserv0021.oracle.com [141.146.126.233] X-Barracuda-Connect: aserp1040.oracle.com[141.146.126.69] X-Barracuda-Start-Time: 1454980397 X-Barracuda-Encrypted: ECDHE-RSA-AES256-GCM-SHA384 X-Barracuda-URL: https://192.48.157.11:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-BRTS-Status: 1 X-Barracuda-Spam-Score: 0.00 X-Barracuda-Spam-Status: No, SCORE=0.00 using per-user scores of TAG_LEVEL=1000.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.7 tests=BSF_SC0_MISMATCH_TO, UNPARSEABLE_RELAY X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.3.26874 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 0.00 BSF_SC0_MISMATCH_TO Envelope rcpt doesn't match header 0.00 UNPARSEABLE_RELAY Informational: message has unparseable relay lines Perform copy-on-writes at random offsets to stress the CoW allocation system. Assess the effectiveness of the extent size hint at combatting fragmentation via unshare, a rewrite, and no-op after the random writes. Signed-off-by: Darrick J. Wong --- tests/generic/301 | 105 +++++++++++++++++++++++++++++++++ tests/generic/301.out | 11 ++++ tests/generic/302 | 105 +++++++++++++++++++++++++++++++++ tests/generic/302.out | 11 ++++ tests/generic/group | 2 + tests/xfs/180 | 111 +++++++++++++++++++++++++++++++++++ tests/xfs/180.out | 12 ++++ tests/xfs/182 | 111 +++++++++++++++++++++++++++++++++++ tests/xfs/182.out | 13 ++++ tests/xfs/184 | 110 +++++++++++++++++++++++++++++++++++ tests/xfs/184.out | 11 ++++ tests/xfs/192 | 110 +++++++++++++++++++++++++++++++++++ tests/xfs/192.out | 11 ++++ tests/xfs/193 | 107 ++++++++++++++++++++++++++++++++++ tests/xfs/193.out | 11 ++++ tests/xfs/198 | 107 ++++++++++++++++++++++++++++++++++ tests/xfs/198.out | 11 ++++ tests/xfs/200 | 114 ++++++++++++++++++++++++++++++++++++ tests/xfs/200.out | 11 ++++ tests/xfs/204 | 114 ++++++++++++++++++++++++++++++++++++ tests/xfs/204.out | 11 ++++ tests/xfs/207 | 104 +++++++++++++++++++++++++++++++++ tests/xfs/207.out | 10 +++ tests/xfs/208 | 154 +++++++++++++++++++++++++++++++++++++++++++++++++ tests/xfs/208.out | 15 +++++ tests/xfs/209 | 88 ++++++++++++++++++++++++++++ tests/xfs/209.out | 6 ++ tests/xfs/210 | 125 ++++++++++++++++++++++++++++++++++++++++ tests/xfs/210.out | 14 ++++ tests/xfs/211 | 111 +++++++++++++++++++++++++++++++++++ tests/xfs/211.out | 12 ++++ tests/xfs/group | 13 ++++ 32 files changed, 1861 insertions(+) create mode 100755 tests/generic/301 create mode 100644 tests/generic/301.out create mode 100755 tests/generic/302 create mode 100644 tests/generic/302.out create mode 100755 tests/xfs/180 create mode 100644 tests/xfs/180.out create mode 100755 tests/xfs/182 create mode 100644 tests/xfs/182.out create mode 100755 tests/xfs/184 create mode 100644 tests/xfs/184.out create mode 100755 tests/xfs/192 create mode 100644 tests/xfs/192.out create mode 100755 tests/xfs/193 create mode 100644 tests/xfs/193.out create mode 100755 tests/xfs/198 create mode 100644 tests/xfs/198.out create mode 100755 tests/xfs/200 create mode 100644 tests/xfs/200.out create mode 100755 tests/xfs/204 create mode 100644 tests/xfs/204.out create mode 100755 tests/xfs/207 create mode 100644 tests/xfs/207.out create mode 100755 tests/xfs/208 create mode 100644 tests/xfs/208.out create mode 100755 tests/xfs/209 create mode 100644 tests/xfs/209.out create mode 100755 tests/xfs/210 create mode 100644 tests/xfs/210.out create mode 100755 tests/xfs/211 create mode 100644 tests/xfs/211.out diff --git a/tests/generic/301 b/tests/generic/301 new file mode 100755 index 0000000..c4f70e1 --- /dev/null +++ b/tests/generic/301 @@ -0,0 +1,105 @@ +#! /bin/bash +# FS QA Test No. 301 +# +# Test fragmentation after a lot of random CoW: +# - Create two reflinked files. +# - Buffered write to random offsets to scatter CoW reservations. +# - Check the number of extents. +# +#----------------------------------------------------------------------- +# Copyright (c) 2016, Oracle and/or its affiliates. All Rights Reserved. +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License as +# published by the Free Software Foundation. +# +# This program is distributed in the hope that it would be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write the Free Software Foundation, +# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA +#----------------------------------------------------------------------- + +seq=`basename "$0"` +seqres="$RESULT_DIR/$seq" +echo "QA output created by $seq" + +here=`pwd` +tmp=/tmp/$$ +status=1 # failure is the default! +trap "_cleanup; exit \$status" 0 1 2 3 15 + +_cleanup() +{ + cd / + #rm -rf "$tmp".* "$testdir" +} + +# get standard environment, filters and checks +. ./common/rc +. ./common/filter +. ./common/reflink + +# real QA test starts here +_supported_os Linux +_require_scratch_reflink +_require_cp_reflink +_require_fiemap + +rm -f "$seqres.full" + +echo "Format and mount" +_scratch_mkfs > "$seqres.full" 2>&1 +_scratch_mount >> "$seqres.full" 2>&1 + +testdir="$SCRATCH_MNT/test-$seq" +rm -rf $testdir +mkdir $testdir + +blksz=65536 +nr=128 +bsz=16 + +free_blocks=$(stat -f -c '%a' "$testdir") +real_blksz=$(stat -f -c '%S' "$testdir") +space_needed=$(((blksz * nr * 3) * 5 / 4)) +space_avail=$((free_blocks * real_blksz)) +internal_blks=$((blksz * nr / real_blksz)) +test $space_needed -gt $space_avail && _notrun "Not enough space. $space_avail < $space_needed" + +echo "Create the original files" +"$XFS_IO_PROG" -f -c "pwrite -S 0x61 -b $((blksz * bsz)) 0 $((blksz * nr + 1))" "$testdir/file1" >> "$seqres.full" +_cp_reflink "$testdir/file1" "$testdir/file2" >> "$seqres.full" +_scratch_remount + +echo "Compare files" +md5sum "$testdir/file1" | _filter_scratch +md5sum "$testdir/file2" | _filter_scratch + +echo "CoW and unmount" +for i in `seq 1 8`; do + "$XFS_IO_PROG" -f -c "pwrite -R -S 0x63 -b $real_blksz 0 $((blksz * nr))" -c "fdatasync" "$testdir/file2" >> "$seqres.full" +done +_scratch_remount + +echo "Compare files" +md5sum "$testdir/file1" | _filter_scratch + +echo "Check extent counts" +old_extents=$(_count_extents "$testdir/file1") +new_extents=$(_count_extents "$testdir/file2") + +echo "old extents: $old_extents" >> "$seqres.full" +echo "new extents: $new_extents" >> "$seqres.full" +echo "maximum extents: $internal_blks" >> "$seqres.full" +test $new_extents -lt $((internal_blks * 2 / 3)) || _fail "file2 badly fragmented" + +echo "Check for damage" +umount "$SCRATCH_MNT" + +# success, all done +status=0 +exit diff --git a/tests/generic/301.out b/tests/generic/301.out new file mode 100644 index 0000000..668b053 --- /dev/null +++ b/tests/generic/301.out @@ -0,0 +1,11 @@ +QA output created by 301 +Format and mount +Create the original files +Compare files +2909feb63a37b0e95fe5cfb7f274f7b1 SCRATCH_MNT/test-301/file1 +2909feb63a37b0e95fe5cfb7f274f7b1 SCRATCH_MNT/test-301/file2 +CoW and unmount +Compare files +2909feb63a37b0e95fe5cfb7f274f7b1 SCRATCH_MNT/test-301/file1 +Check extent counts +Check for damage diff --git a/tests/generic/302 b/tests/generic/302 new file mode 100755 index 0000000..e0aea69 --- /dev/null +++ b/tests/generic/302 @@ -0,0 +1,105 @@ +#! /bin/bash +# FS QA Test No. 302 +# +# Test fragmentation after a lot of random CoW: +# - Create two reflinked files. +# - Directio write to random offsets to scatter CoW reservations. +# - Check the number of extents. +# +#----------------------------------------------------------------------- +# Copyright (c) 2016, Oracle and/or its affiliates. All Rights Reserved. +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License as +# published by the Free Software Foundation. +# +# This program is distributed in the hope that it would be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write the Free Software Foundation, +# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA +#----------------------------------------------------------------------- + +seq=`basename "$0"` +seqres="$RESULT_DIR/$seq" +echo "QA output created by $seq" + +here=`pwd` +tmp=/tmp/$$ +status=1 # failure is the default! +trap "_cleanup; exit \$status" 0 1 2 3 15 + +_cleanup() +{ + cd / + #rm -rf "$tmp".* "$testdir" +} + +# get standard environment, filters and checks +. ./common/rc +. ./common/filter +. ./common/reflink + +# real QA test starts here +_supported_os Linux +_require_scratch_reflink +_require_cp_reflink +_require_fiemap + +rm -f "$seqres.full" + +echo "Format and mount" +_scratch_mkfs > "$seqres.full" 2>&1 +_scratch_mount >> "$seqres.full" 2>&1 + +testdir="$SCRATCH_MNT/test-$seq" +rm -rf $testdir +mkdir $testdir + +blksz=65536 +nr=128 +bsz=16 + +free_blocks=$(stat -f -c '%a' "$testdir") +real_blksz=$(stat -f -c '%S' "$testdir") +space_needed=$(((blksz * nr * 3) * 5 / 4)) +space_avail=$((free_blocks * real_blksz)) +internal_blks=$((blksz * nr / real_blksz)) +test $space_needed -gt $space_avail && _notrun "Not enough space. $space_avail < $space_needed" + +echo "Create the original files" +"$XFS_IO_PROG" -f -c "pwrite -S 0x61 -b $((blksz * bsz)) 0 $((blksz * nr + 1))" "$testdir/file1" >> "$seqres.full" +_cp_reflink "$testdir/file1" "$testdir/file2" >> "$seqres.full" +_scratch_remount + +echo "Compare files" +md5sum "$testdir/file1" | _filter_scratch +md5sum "$testdir/file2" | _filter_scratch + +echo "CoW and unmount" +for i in `seq 1 8`; do + "$XFS_IO_PROG" -d -f -c "pwrite -R -S 0x63 -b $real_blksz 0 $((blksz * nr))" "$testdir/file2" >> "$seqres.full" +done +_scratch_remount + +echo "Compare files" +md5sum "$testdir/file1" | _filter_scratch + +echo "Check extent counts" +old_extents=$(_count_extents "$testdir/file1") +new_extents=$(_count_extents "$testdir/file2") + +echo "old extents: $old_extents" >> "$seqres.full" +echo "new extents: $new_extents" >> "$seqres.full" +echo "maximum extents: $internal_blks" >> "$seqres.full" +test $new_extents -le $internal_blks || _fail "file2 badly fragmented" + +echo "Check for damage" +umount "$SCRATCH_MNT" + +# success, all done +status=0 +exit diff --git a/tests/generic/302.out b/tests/generic/302.out new file mode 100644 index 0000000..002e54d --- /dev/null +++ b/tests/generic/302.out @@ -0,0 +1,11 @@ +QA output created by 302 +Format and mount +Create the original files +Compare files +2909feb63a37b0e95fe5cfb7f274f7b1 SCRATCH_MNT/test-302/file1 +2909feb63a37b0e95fe5cfb7f274f7b1 SCRATCH_MNT/test-302/file2 +CoW and unmount +Compare files +2909feb63a37b0e95fe5cfb7f274f7b1 SCRATCH_MNT/test-302/file1 +Check extent counts +Check for damage diff --git a/tests/generic/group b/tests/generic/group index 3798f3b..7e1ea72 100644 --- a/tests/generic/group +++ b/tests/generic/group @@ -303,6 +303,8 @@ 298 auto quick clone 299 auto aio enospc rw stress 300 auto aio enospc preallocrw stress +301 auto quick clone +302 auto quick clone 306 auto quick rw 307 auto quick 308 auto quick diff --git a/tests/xfs/180 b/tests/xfs/180 new file mode 100755 index 0000000..0bbece0 --- /dev/null +++ b/tests/xfs/180 @@ -0,0 +1,111 @@ +#! /bin/bash +# FS QA Test No. 180 +# +# Test fragmentation after a lot of random CoW: +# - Create two reflinked files. Set extsz hint on second file. +# - Buffered write to random offsets to scatter CoW reservations. +# - Rewrite the whole file to use up reservations. +# - Check the number of extents. +# +#----------------------------------------------------------------------- +# Copyright (c) 2016, Oracle and/or its affiliates. All Rights Reserved. +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License as +# published by the Free Software Foundation. +# +# This program is distributed in the hope that it would be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write the Free Software Foundation, +# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA +#----------------------------------------------------------------------- + +seq=`basename "$0"` +seqres="$RESULT_DIR/$seq" +echo "QA output created by $seq" + +here=`pwd` +tmp=/tmp/$$ +status=1 # failure is the default! +trap "_cleanup; exit \$status" 0 1 2 3 15 + +_cleanup() +{ + cd / + #rm -rf "$tmp".* "$testdir" +} + +# get standard environment, filters and checks +. ./common/rc +. ./common/filter +. ./common/reflink + +# real QA test starts here +_supported_os Linux +_supported_fs xfs +_require_scratch_reflink +_require_cp_reflink +_require_fiemap +_require_xfs_io_command "cowextsize" + +rm -f "$seqres.full" + +echo "Format and mount" +_scratch_mkfs > "$seqres.full" 2>&1 +_scratch_mount >> "$seqres.full" 2>&1 + +testdir="$SCRATCH_MNT/test-$seq" +rm -rf $testdir +mkdir $testdir + +blksz=65536 +nr=128 +bsz=16 + +free_blocks=$(stat -f -c '%a' "$testdir") +real_blksz=$(stat -f -c '%S' "$testdir") +space_needed=$(((blksz * nr * 3) * 5 / 4)) +space_avail=$((free_blocks * real_blksz)) +internal_blks=$((blksz * nr / real_blksz)) +test $space_needed -gt $space_avail && _notrun "Not enough space. $space_avail < $space_needed" + +echo "Create the original files" +"$XFS_IO_PROG" -f -c "pwrite -S 0x61 -b $((blksz * bsz)) 0 $((blksz * nr + 1))" "$testdir/file1" >> "$seqres.full" +"$XFS_IO_PROG" -f -c "cowextsize $((blksz * bsz))" "$testdir/file2" +_cp_reflink "$testdir/file1" "$testdir/file2" >> "$seqres.full" +_scratch_remount + +echo "Compare files" +md5sum "$testdir/file1" | _filter_scratch +md5sum "$testdir/file2" | _filter_scratch + +echo "CoW and unmount" +"$XFS_IO_PROG" -f -c "cowextsize" "$testdir/file2" >> "$seqres.full" +"$XFS_IO_PROG" -f -c "pwrite -R -S 0x63 -b $real_blksz 0 $((blksz * nr))" -c "fdatasync" "$testdir/file2" >> "$seqres.full" +"$XFS_IO_PROG" -f -c "pwrite -S 0x63 -b $real_blksz 0 $((blksz * nr + 1))" -c "fdatasync" "$testdir/file2" >> "$seqres.full" +_scratch_remount + +echo "Compare files" +md5sum "$testdir/file1" | _filter_scratch +md5sum "$testdir/file2" | _filter_scratch + +echo "Check extent counts" +old_extents=$(_count_extents "$testdir/file1") +new_extents=$(_count_extents "$testdir/file2") + +echo "old extents: $old_extents" >> "$seqres.full" +echo "new extents: $new_extents" >> "$seqres.full" +echo "maximum extents: $internal_blks" >> "$seqres.full" +test $new_extents -lt $((internal_blks / 20)) || test $new_extents -lt 15 \ + || _fail "file2 badly fragmented" + +echo "Check for damage" +umount "$SCRATCH_MNT" + +# success, all done +status=0 +exit diff --git a/tests/xfs/180.out b/tests/xfs/180.out new file mode 100644 index 0000000..b538430 --- /dev/null +++ b/tests/xfs/180.out @@ -0,0 +1,12 @@ +QA output created by 180 +Format and mount +Create the original files +Compare files +2909feb63a37b0e95fe5cfb7f274f7b1 SCRATCH_MNT/test-180/file1 +2909feb63a37b0e95fe5cfb7f274f7b1 SCRATCH_MNT/test-180/file2 +CoW and unmount +Compare files +2909feb63a37b0e95fe5cfb7f274f7b1 SCRATCH_MNT/test-180/file1 +d41f6527bc8320364e12ea7076140b8b SCRATCH_MNT/test-180/file2 +Check extent counts +Check for damage diff --git a/tests/xfs/182 b/tests/xfs/182 new file mode 100755 index 0000000..8a32671 --- /dev/null +++ b/tests/xfs/182 @@ -0,0 +1,111 @@ +#! /bin/bash +# FS QA Test No. 182 +# +# Test fragmentation after a lot of random CoW: +# - Create two reflinked files. Set extsz hint on second file. +# - Directio write to random offsets to scatter CoW reservations. +# - Rewrite the whole file to use up reservations. +# - Check the number of extents. +# +#----------------------------------------------------------------------- +# Copyright (c) 2016, Oracle and/or its affiliates. All Rights Reserved. +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License as +# published by the Free Software Foundation. +# +# This program is distributed in the hope that it would be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write the Free Software Foundation, +# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA +#----------------------------------------------------------------------- + +seq=`basename "$0"` +seqres="$RESULT_DIR/$seq" +echo "QA output created by $seq" + +here=`pwd` +tmp=/tmp/$$ +status=1 # failure is the default! +trap "_cleanup; exit \$status" 0 1 2 3 15 + +_cleanup() +{ + cd / + #rm -rf "$tmp".* "$testdir" +} + +# get standard environment, filters and checks +. ./common/rc +. ./common/filter +. ./common/reflink + +# real QA test starts here +_supported_os Linux +_supported_fs xfs +_require_scratch_reflink +_require_cp_reflink +_require_fiemap +_require_xfs_io_command "cowextsize" + +rm -f "$seqres.full" + +echo "Format and mount" +_scratch_mkfs > "$seqres.full" 2>&1 +_scratch_mount >> "$seqres.full" 2>&1 + +testdir="$SCRATCH_MNT/test-$seq" +rm -rf $testdir +mkdir $testdir + +blksz=65536 +nr=128 +bsz=16 + +free_blocks=$(stat -f -c '%a' "$testdir") +real_blksz=$(stat -f -c '%S' "$testdir") +space_needed=$(((blksz * nr * 3) * 5 / 4)) +space_avail=$((free_blocks * real_blksz)) +internal_blks=$((blksz * nr / real_blksz)) +test $space_needed -gt $space_avail && _notrun "Not enough space. $space_avail < $space_needed" + +echo "Create the original files" +"$XFS_IO_PROG" -f -c "pwrite -S 0x61 -b $((blksz * bsz)) 0 $((blksz * nr + 1))" "$testdir/file1" >> "$seqres.full" +"$XFS_IO_PROG" -f -c "cowextsize $((blksz * bsz))" "$testdir/file2" +_cp_reflink "$testdir/file1" "$testdir/file2" >> "$seqres.full" +_scratch_remount + +echo "Compare files" +md5sum "$testdir/file1" | _filter_scratch +md5sum "$testdir/file2" | _filter_scratch + +echo "CoW and unmount" +"$XFS_IO_PROG" -f -c "cowextsize" "$testdir/file2" >> "$seqres.full" +"$XFS_IO_PROG" -d -f -c "pwrite -R -S 0x63 -b $real_blksz 0 $((blksz * nr + 1))" "$testdir/file2" >> "$seqres.full" +"$XFS_IO_PROG" -d -f -c "pwrite -S 0x63 -b $real_blksz 0 $((blksz * nr + 1))" "$testdir/file2" >> "$seqres.full" +_scratch_remount + +echo "Compare files" +md5sum "$testdir/file1" | _filter_scratch +md5sum "$testdir/file2" | _filter_scratch + +echo "Check extent counts" +old_extents=$(_count_extents "$testdir/file1") +new_extents=$(_count_extents "$testdir/file2") + +echo "old extents: $old_extents" >> "$seqres.full" +echo "new extents: $new_extents" >> "$seqres.full" +echo "maximum extents: $internal_blks" >> "$seqres.full" +test $new_extents -lt $((internal_blks / 20)) || test $new_extents -lt 15 \ + || _fail "file2 badly fragmented" + +echo "Check for damage" +umount "$SCRATCH_MNT" + +# success, all done +status=0 +exit diff --git a/tests/xfs/182.out b/tests/xfs/182.out new file mode 100644 index 0000000..49a18e6 --- /dev/null +++ b/tests/xfs/182.out @@ -0,0 +1,13 @@ +QA output created by 182 +Format and mount +Create the original files +Compare files +2909feb63a37b0e95fe5cfb7f274f7b1 SCRATCH_MNT/test-182/file1 +2909feb63a37b0e95fe5cfb7f274f7b1 SCRATCH_MNT/test-182/file2 +CoW and unmount +pwrite64: Invalid argument +Compare files +2909feb63a37b0e95fe5cfb7f274f7b1 SCRATCH_MNT/test-182/file1 +c6ba35da9f73ced20d7781a448cc11d4 SCRATCH_MNT/test-182/file2 +Check extent counts +Check for damage diff --git a/tests/xfs/184 b/tests/xfs/184 new file mode 100755 index 0000000..27bd00f --- /dev/null +++ b/tests/xfs/184 @@ -0,0 +1,110 @@ +#! /bin/bash +# FS QA Test No. 184 +# +# Test fragmentation after a lot of random CoW: +# - Create two reflinked files. Set extsz hint on second file. +# - Buffered write to random offsets to scatter CoW reservations. +# - falloc the whole file to unshare blocks. +# - Check the number of extents. +# +#----------------------------------------------------------------------- +# Copyright (c) 2016, Oracle and/or its affiliates. All Rights Reserved. +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License as +# published by the Free Software Foundation. +# +# This program is distributed in the hope that it would be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write the Free Software Foundation, +# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA +#----------------------------------------------------------------------- + +seq=`basename "$0"` +seqres="$RESULT_DIR/$seq" +echo "QA output created by $seq" + +here=`pwd` +tmp=/tmp/$$ +status=1 # failure is the default! +trap "_cleanup; exit \$status" 0 1 2 3 15 + +_cleanup() +{ + cd / + #rm -rf "$tmp".* "$testdir" +} + +# get standard environment, filters and checks +. ./common/rc +. ./common/filter +. ./common/reflink + +# real QA test starts here +_supported_os Linux +_supported_fs xfs +_require_scratch_reflink +_require_cp_reflink +_require_fiemap +_require_xfs_io_command "cowextsize" + +rm -f "$seqres.full" + +echo "Format and mount" +_scratch_mkfs > "$seqres.full" 2>&1 +_scratch_mount >> "$seqres.full" 2>&1 + +testdir="$SCRATCH_MNT/test-$seq" +rm -rf $testdir +mkdir $testdir + +blksz=65536 +nr=128 +bsz=16 + +free_blocks=$(stat -f -c '%a' "$testdir") +real_blksz=$(stat -f -c '%S' "$testdir") +space_needed=$(((blksz * nr * 3) * 5 / 4)) +space_avail=$((free_blocks * real_blksz)) +internal_blks=$((blksz * nr / real_blksz)) +test $space_needed -gt $space_avail && _notrun "Not enough space. $space_avail < $space_needed" + +echo "Create the original files" +"$XFS_IO_PROG" -f -c "pwrite -S 0x61 -b $((blksz * bsz)) 0 $((blksz * nr + 1))" "$testdir/file1" >> "$seqres.full" +"$XFS_IO_PROG" -f -c "cowextsize $((blksz * bsz))" "$testdir/file2" +_cp_reflink "$testdir/file1" "$testdir/file2" >> "$seqres.full" +_scratch_remount + +echo "Compare files" +md5sum "$testdir/file1" | _filter_scratch +md5sum "$testdir/file2" | _filter_scratch + +echo "CoW and unmount" +"$XFS_IO_PROG" -f -c "cowextsize" "$testdir/file2" >> "$seqres.full" +"$XFS_IO_PROG" -f -c "pwrite -R -S 0x63 -b $real_blksz 0 $((blksz * nr + 1))" -c "fdatasync" "$testdir/file2" >> "$seqres.full" +"$XFS_IO_PROG" -f -c "falloc 0 $((blksz * nr + 1))" "$testdir/file2" >> "$seqres.full" +_scratch_remount + +echo "Compare files" +md5sum "$testdir/file1" | _filter_scratch + +echo "Check extent counts" +old_extents=$(_count_extents "$testdir/file1") +new_extents=$(_count_extents "$testdir/file2") + +echo "old extents: $old_extents" >> "$seqres.full" +echo "new extents: $new_extents" >> "$seqres.full" +echo "maximum extents: $internal_blks" >> "$seqres.full" +test $new_extents -lt $((internal_blks / 20)) || test $new_extents -lt 15 \ + || _fail "file2 badly fragmented" + +echo "Check for damage" +umount "$SCRATCH_MNT" + +# success, all done +status=0 +exit diff --git a/tests/xfs/184.out b/tests/xfs/184.out new file mode 100644 index 0000000..8a329c2 --- /dev/null +++ b/tests/xfs/184.out @@ -0,0 +1,11 @@ +QA output created by 184 +Format and mount +Create the original files +Compare files +2909feb63a37b0e95fe5cfb7f274f7b1 SCRATCH_MNT/test-184/file1 +2909feb63a37b0e95fe5cfb7f274f7b1 SCRATCH_MNT/test-184/file2 +CoW and unmount +Compare files +2909feb63a37b0e95fe5cfb7f274f7b1 SCRATCH_MNT/test-184/file1 +Check extent counts +Check for damage diff --git a/tests/xfs/192 b/tests/xfs/192 new file mode 100755 index 0000000..7cdd707 --- /dev/null +++ b/tests/xfs/192 @@ -0,0 +1,110 @@ +#! /bin/bash +# FS QA Test No. 192 +# +# Test fragmentation after a lot of random CoW: +# - Create two reflinked files. Set extsz hint on second file. +# - Directio write to random offsets to scatter CoW reservations. +# - falloc the whole file to unshare blocks. +# - Check the number of extents. +# +#----------------------------------------------------------------------- +# Copyright (c) 2016, Oracle and/or its affiliates. All Rights Reserved. +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License as +# published by the Free Software Foundation. +# +# This program is distributed in the hope that it would be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write the Free Software Foundation, +# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA +#----------------------------------------------------------------------- + +seq=`basename "$0"` +seqres="$RESULT_DIR/$seq" +echo "QA output created by $seq" + +here=`pwd` +tmp=/tmp/$$ +status=1 # failure is the default! +trap "_cleanup; exit \$status" 0 1 2 3 15 + +_cleanup() +{ + cd / + #rm -rf "$tmp".* "$testdir" +} + +# get standard environment, filters and checks +. ./common/rc +. ./common/filter +. ./common/reflink + +# real QA test starts here +_supported_os Linux +_supported_fs xfs +_require_scratch_reflink +_require_cp_reflink +_require_fiemap +_require_xfs_io_command "cowextsize" + +rm -f "$seqres.full" + +echo "Format and mount" +_scratch_mkfs > "$seqres.full" 2>&1 +_scratch_mount >> "$seqres.full" 2>&1 + +testdir="$SCRATCH_MNT/test-$seq" +rm -rf $testdir +mkdir $testdir + +blksz=65536 +nr=128 +bsz=16 + +free_blocks=$(stat -f -c '%a' "$testdir") +real_blksz=$(stat -f -c '%S' "$testdir") +space_needed=$(((blksz * nr * 3) * 5 / 4)) +space_avail=$((free_blocks * real_blksz)) +internal_blks=$((blksz * nr / real_blksz)) +test $space_needed -gt $space_avail && _notrun "Not enough space. $space_avail < $space_needed" + +echo "Create the original files" +"$XFS_IO_PROG" -f -c "pwrite -S 0x61 -b $((blksz * bsz)) 0 $((blksz * nr + 1))" "$testdir/file1" >> "$seqres.full" +"$XFS_IO_PROG" -f -c "cowextsize $((blksz * bsz))" "$testdir/file2" +_cp_reflink "$testdir/file1" "$testdir/file2" >> "$seqres.full" +_scratch_remount + +echo "Compare files" +md5sum "$testdir/file1" | _filter_scratch +md5sum "$testdir/file2" | _filter_scratch + +echo "CoW and unmount" +"$XFS_IO_PROG" -f -c "cowextsize" "$testdir/file2" >> "$seqres.full" +"$XFS_IO_PROG" -d -f -c "pwrite -R -S 0x63 -b $real_blksz 0 $((blksz * nr))" "$testdir/file2" >> "$seqres.full" +"$XFS_IO_PROG" -d -f -c "falloc 0 $((blksz * nr))" "$testdir/file2" >> "$seqres.full" +_scratch_remount + +echo "Compare files" +md5sum "$testdir/file1" | _filter_scratch + +echo "Check extent counts" +old_extents=$(_count_extents "$testdir/file1") +new_extents=$(_count_extents "$testdir/file2") + +echo "old extents: $old_extents" >> "$seqres.full" +echo "new extents: $new_extents" >> "$seqres.full" +echo "maximum extents: $internal_blks" >> "$seqres.full" +test $new_extents -lt $((internal_blks / 20)) || test $new_extents -lt 15 \ + || _fail "file2 badly fragmented" + +echo "Check for damage" +umount "$SCRATCH_MNT" + +# success, all done +status=0 +exit diff --git a/tests/xfs/192.out b/tests/xfs/192.out new file mode 100644 index 0000000..b65e107 --- /dev/null +++ b/tests/xfs/192.out @@ -0,0 +1,11 @@ +QA output created by 192 +Format and mount +Create the original files +Compare files +2909feb63a37b0e95fe5cfb7f274f7b1 SCRATCH_MNT/test-192/file1 +2909feb63a37b0e95fe5cfb7f274f7b1 SCRATCH_MNT/test-192/file2 +CoW and unmount +Compare files +2909feb63a37b0e95fe5cfb7f274f7b1 SCRATCH_MNT/test-192/file1 +Check extent counts +Check for damage diff --git a/tests/xfs/193 b/tests/xfs/193 new file mode 100755 index 0000000..d42c3da --- /dev/null +++ b/tests/xfs/193 @@ -0,0 +1,107 @@ +#! /bin/bash +# FS QA Test No. 193 +# +# Test fragmentation after a lot of random CoW: +# - Create two reflinked files. Set extsz hint on second file. +# - Buffered write to random offsets to scatter CoW reservations. +# - Check the number of extents. +# +#----------------------------------------------------------------------- +# Copyright (c) 2016, Oracle and/or its affiliates. All Rights Reserved. +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License as +# published by the Free Software Foundation. +# +# This program is distributed in the hope that it would be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write the Free Software Foundation, +# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA +#----------------------------------------------------------------------- + +seq=`basename "$0"` +seqres="$RESULT_DIR/$seq" +echo "QA output created by $seq" + +here=`pwd` +tmp=/tmp/$$ +status=1 # failure is the default! +trap "_cleanup; exit \$status" 0 1 2 3 15 + +_cleanup() +{ + cd / + #rm -rf "$tmp".* "$testdir" +} + +# get standard environment, filters and checks +. ./common/rc +. ./common/filter +. ./common/reflink + +# real QA test starts here +_supported_os Linux +_supported_fs xfs +_require_scratch_reflink +_require_cp_reflink +_require_fiemap +_require_xfs_io_command "cowextsize" + +rm -f "$seqres.full" + +echo "Format and mount" +_scratch_mkfs > "$seqres.full" 2>&1 +_scratch_mount >> "$seqres.full" 2>&1 + +testdir="$SCRATCH_MNT/test-$seq" +rm -rf $testdir +mkdir $testdir + +blksz=65536 +nr=128 +bsz=16 + +free_blocks=$(stat -f -c '%a' "$testdir") +real_blksz=$(stat -f -c '%S' "$testdir") +space_needed=$(((blksz * nr * 3) * 5 / 4)) +space_avail=$((free_blocks * real_blksz)) +internal_blks=$((blksz * nr / real_blksz)) +test $space_needed -gt $space_avail && _notrun "Not enough space. $space_avail < $space_needed" + +echo "Create the original files" +"$XFS_IO_PROG" -f -c "pwrite -S 0x61 -b $((blksz * bsz)) 0 $((blksz * nr + 1))" "$testdir/file1" >> "$seqres.full" +"$XFS_IO_PROG" -f -c "cowextsize $((blksz * bsz))" "$testdir/file2" +_cp_reflink "$testdir/file1" "$testdir/file2" >> "$seqres.full" +_scratch_remount + +echo "Compare files" +md5sum "$testdir/file1" | _filter_scratch +md5sum "$testdir/file2" | _filter_scratch + +echo "CoW and unmount" +"$XFS_IO_PROG" -f -c "cowextsize" "$testdir/file2" >> "$seqres.full" +"$XFS_IO_PROG" -f -c "pwrite -R -S 0x63 -b $real_blksz 0 $((blksz * nr))" -c "fdatasync" "$testdir/file2" >> "$seqres.full" +_scratch_remount + +echo "Compare files" +md5sum "$testdir/file1" | _filter_scratch + +echo "Check extent counts" +old_extents=$(_count_extents "$testdir/file1") +new_extents=$(_count_extents "$testdir/file2") + +echo "old extents: $old_extents" >> "$seqres.full" +echo "new extents: $new_extents" >> "$seqres.full" +echo "maximum extents: $internal_blks" >> "$seqres.full" +test $new_extents -lt $((internal_blks * 2 / 3)) || _fail "file2 badly fragmented" + +echo "Check for damage" +umount "$SCRATCH_MNT" + +# success, all done +status=0 +exit diff --git a/tests/xfs/193.out b/tests/xfs/193.out new file mode 100644 index 0000000..9ba6ea5 --- /dev/null +++ b/tests/xfs/193.out @@ -0,0 +1,11 @@ +QA output created by 193 +Format and mount +Create the original files +Compare files +2909feb63a37b0e95fe5cfb7f274f7b1 SCRATCH_MNT/test-193/file1 +2909feb63a37b0e95fe5cfb7f274f7b1 SCRATCH_MNT/test-193/file2 +CoW and unmount +Compare files +2909feb63a37b0e95fe5cfb7f274f7b1 SCRATCH_MNT/test-193/file1 +Check extent counts +Check for damage diff --git a/tests/xfs/198 b/tests/xfs/198 new file mode 100755 index 0000000..aade7b8 --- /dev/null +++ b/tests/xfs/198 @@ -0,0 +1,107 @@ +#! /bin/bash +# FS QA Test No. 198 +# +# Test fragmentation after a lot of random CoW: +# - Create two reflinked files. Set extsz hint on second file. +# - Directio write to random offsets to scatter CoW reservations. +# - Check the number of extents. +# +#----------------------------------------------------------------------- +# Copyright (c) 2016, Oracle and/or its affiliates. All Rights Reserved. +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License as +# published by the Free Software Foundation. +# +# This program is distributed in the hope that it would be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write the Free Software Foundation, +# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA +#----------------------------------------------------------------------- + +seq=`basename "$0"` +seqres="$RESULT_DIR/$seq" +echo "QA output created by $seq" + +here=`pwd` +tmp=/tmp/$$ +status=1 # failure is the default! +trap "_cleanup; exit \$status" 0 1 2 3 15 + +_cleanup() +{ + cd / + #rm -rf "$tmp".* "$testdir" +} + +# get standard environment, filters and checks +. ./common/rc +. ./common/filter +. ./common/reflink + +# real QA test starts here +_supported_os Linux +_supported_fs xfs +_require_scratch_reflink +_require_cp_reflink +_require_fiemap +_require_xfs_io_command "cowextsize" + +rm -f "$seqres.full" + +echo "Format and mount" +_scratch_mkfs > "$seqres.full" 2>&1 +_scratch_mount >> "$seqres.full" 2>&1 + +testdir="$SCRATCH_MNT/test-$seq" +rm -rf $testdir +mkdir $testdir + +blksz=65536 +nr=128 +bsz=16 + +free_blocks=$(stat -f -c '%a' "$testdir") +real_blksz=$(stat -f -c '%S' "$testdir") +space_needed=$(((blksz * nr * 3) * 5 / 4)) +space_avail=$((free_blocks * real_blksz)) +internal_blks=$((blksz * nr / real_blksz)) +test $space_needed -gt $space_avail && _notrun "Not enough space. $space_avail < $space_needed" + +echo "Create the original files" +"$XFS_IO_PROG" -f -c "pwrite -S 0x61 -b $((blksz * bsz)) 0 $((blksz * nr + 1))" "$testdir/file1" >> "$seqres.full" +"$XFS_IO_PROG" -f -c "cowextsize $((blksz * bsz))" "$testdir/file2" +_cp_reflink "$testdir/file1" "$testdir/file2" >> "$seqres.full" +_scratch_remount + +echo "Compare files" +md5sum "$testdir/file1" | _filter_scratch +md5sum "$testdir/file2" | _filter_scratch + +echo "CoW and unmount" +"$XFS_IO_PROG" -f -c "cowextsize" "$testdir/file2" >> "$seqres.full" +"$XFS_IO_PROG" -d -f -c "pwrite -R -S 0x63 -b $real_blksz 0 $((blksz * nr))" "$testdir/file2" >> "$seqres.full" +_scratch_remount + +echo "Compare files" +md5sum "$testdir/file1" | _filter_scratch + +echo "Check extent counts" +old_extents=$(_count_extents "$testdir/file1") +new_extents=$(_count_extents "$testdir/file2") + +echo "old extents: $old_extents" >> "$seqres.full" +echo "new extents: $new_extents" >> "$seqres.full" +echo "maximum extents: $internal_blks" >> "$seqres.full" +test $new_extents -lt $((internal_blks * 2 / 3)) || _fail "file2 badly fragmented" + +echo "Check for damage" +umount "$SCRATCH_MNT" + +# success, all done +status=0 +exit diff --git a/tests/xfs/198.out b/tests/xfs/198.out new file mode 100644 index 0000000..9e05a17 --- /dev/null +++ b/tests/xfs/198.out @@ -0,0 +1,11 @@ +QA output created by 198 +Format and mount +Create the original files +Compare files +2909feb63a37b0e95fe5cfb7f274f7b1 SCRATCH_MNT/test-198/file1 +2909feb63a37b0e95fe5cfb7f274f7b1 SCRATCH_MNT/test-198/file2 +CoW and unmount +Compare files +2909feb63a37b0e95fe5cfb7f274f7b1 SCRATCH_MNT/test-198/file1 +Check extent counts +Check for damage diff --git a/tests/xfs/200 b/tests/xfs/200 new file mode 100755 index 0000000..1d0e415 --- /dev/null +++ b/tests/xfs/200 @@ -0,0 +1,114 @@ +#! /bin/bash +# FS QA Test No. 200 +# +# Test fragmentation after a lot of random CoW: +# - Create two reflinked files. Set extsz hint on second file. +# - Read the whole file into memory. +# - Buffered write to random offsets to scatter CoW reservations. +# - fadvise(dontneed) the whole file to evict the pages. +# - falloc the whole fle to see if the extsz hints still apply. +# - Check the number of extents. +# +#----------------------------------------------------------------------- +# Copyright (c) 2016, Oracle and/or its affiliates. All Rights Reserved. +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License as +# published by the Free Software Foundation. +# +# This program is distributed in the hope that it would be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write the Free Software Foundation, +# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA +#----------------------------------------------------------------------- + +seq=`basename "$0"` +seqres="$RESULT_DIR/$seq" +echo "QA output created by $seq" + +here=`pwd` +tmp=/tmp/$$ +status=1 # failure is the default! +trap "_cleanup; exit \$status" 0 1 2 3 15 + +_cleanup() +{ + cd / + #rm -rf "$tmp".* "$testdir" +} + +# get standard environment, filters and checks +. ./common/rc +. ./common/filter +. ./common/reflink + +# real QA test starts here +_supported_os Linux +_supported_fs xfs +_require_scratch_reflink +_require_cp_reflink +_require_fiemap +_require_xfs_io_command "cowextsize" + +rm -f "$seqres.full" + +echo "Format and mount" +_scratch_mkfs > "$seqres.full" 2>&1 +_scratch_mount >> "$seqres.full" 2>&1 + +testdir="$SCRATCH_MNT/test-$seq" +rm -rf $testdir +mkdir $testdir + +blksz=65536 +nr=128 +bsz=16 + +free_blocks=$(stat -f -c '%a' "$testdir") +real_blksz=$(stat -f -c '%S' "$testdir") +space_needed=$(((blksz * nr * 3) * 5 / 4)) +space_avail=$((free_blocks * real_blksz)) +internal_blks=$((blksz * nr / real_blksz)) +test $space_needed -gt $space_avail && _notrun "Not enough space. $space_avail < $space_needed" + +echo "Create the original files" +"$XFS_IO_PROG" -f -c "pwrite -S 0x61 -b $((blksz * bsz)) 0 $((blksz * nr + 1))" "$testdir/file1" >> "$seqres.full" +"$XFS_IO_PROG" -f -c "cowextsize $((blksz * bsz))" "$testdir/file2" +_cp_reflink "$testdir/file1" "$testdir/file2" >> "$seqres.full" +_scratch_remount + +echo "Compare files" +md5sum "$testdir/file1" | _filter_scratch +md5sum "$testdir/file2" | _filter_scratch + +echo "CoW and unmount" +"$XFS_IO_PROG" -f -c "cowextsize" "$testdir/file2" >> "$seqres.full" +cat "$testdir/file2" > /dev/null +"$XFS_IO_PROG" -f -c "pwrite -R -S 0x63 -b $real_blksz 0 $((blksz * nr))" -c "fdatasync" "$testdir/file2" >> "$seqres.full" +"$XFS_IO_PROG" -f -c "fadvise -d 0 $((blksz * nr))" -c "fsync" "$testdir/file2" >> "$seqres.full" +"$XFS_IO_PROG" -f -c "falloc 0 $((blksz * nr))" "$testdir/file2" >> "$seqres.full" +_scratch_remount + +echo "Compare files" +md5sum "$testdir/file1" | _filter_scratch + +echo "Check extent counts" +old_extents=$(_count_extents "$testdir/file1") +new_extents=$(_count_extents "$testdir/file2") + +echo "old extents: $old_extents" >> "$seqres.full" +echo "new extents: $new_extents" >> "$seqres.full" +echo "maximum extents: $internal_blks" >> "$seqres.full" +test $new_extents -lt $((internal_blks / 20)) || test $new_extents -lt 15 \ + || _fail "file2 badly fragmented" + +echo "Check for damage" +umount "$SCRATCH_MNT" + +# success, all done +status=0 +exit diff --git a/tests/xfs/200.out b/tests/xfs/200.out new file mode 100644 index 0000000..57a2726 --- /dev/null +++ b/tests/xfs/200.out @@ -0,0 +1,11 @@ +QA output created by 200 +Format and mount +Create the original files +Compare files +2909feb63a37b0e95fe5cfb7f274f7b1 SCRATCH_MNT/test-200/file1 +2909feb63a37b0e95fe5cfb7f274f7b1 SCRATCH_MNT/test-200/file2 +CoW and unmount +Compare files +2909feb63a37b0e95fe5cfb7f274f7b1 SCRATCH_MNT/test-200/file1 +Check extent counts +Check for damage diff --git a/tests/xfs/204 b/tests/xfs/204 new file mode 100755 index 0000000..507cfc3 --- /dev/null +++ b/tests/xfs/204 @@ -0,0 +1,114 @@ +#! /bin/bash +# FS QA Test No. 204 +# +# Test fragmentation after a lot of random CoW: +# - Create two reflinked files. Set extsz hint on second file. +# - Read the whole file into memory. +# - DIO write to random offsets to scatter CoW reservations. +# - fadvise(dontneed) the whole file to evict the pages. +# - falloc the whole fle to see if the extsz hints still apply. +# - Check the number of extents. +# +#----------------------------------------------------------------------- +# Copyright (c) 2016, Oracle and/or its affiliates. All Rights Reserved. +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License as +# published by the Free Software Foundation. +# +# This program is distributed in the hope that it would be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write the Free Software Foundation, +# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA +#----------------------------------------------------------------------- + +seq=`basename "$0"` +seqres="$RESULT_DIR/$seq" +echo "QA output created by $seq" + +here=`pwd` +tmp=/tmp/$$ +status=1 # failure is the default! +trap "_cleanup; exit \$status" 0 1 2 3 15 + +_cleanup() +{ + cd / + #rm -rf "$tmp".* "$testdir" +} + +# get standard environment, filters and checks +. ./common/rc +. ./common/filter +. ./common/reflink + +# real QA test starts here +_supported_os Linux +_supported_fs xfs +_require_scratch_reflink +_require_cp_reflink +_require_fiemap +_require_xfs_io_command "cowextsize" + +rm -f "$seqres.full" + +echo "Format and mount" +_scratch_mkfs > "$seqres.full" 2>&1 +_scratch_mount >> "$seqres.full" 2>&1 + +testdir="$SCRATCH_MNT/test-$seq" +rm -rf $testdir +mkdir $testdir + +blksz=65536 +nr=128 +bsz=16 + +free_blocks=$(stat -f -c '%a' "$testdir") +real_blksz=$(stat -f -c '%S' "$testdir") +space_needed=$(((blksz * nr * 3) * 5 / 4)) +space_avail=$((free_blocks * real_blksz)) +internal_blks=$((blksz * nr / real_blksz)) +test $space_needed -gt $space_avail && _notrun "Not enough space. $space_avail < $space_needed" + +echo "Create the original files" +"$XFS_IO_PROG" -f -c "pwrite -S 0x61 -b $((blksz * bsz)) 0 $((blksz * nr + 1))" "$testdir/file1" >> "$seqres.full" +"$XFS_IO_PROG" -f -c "cowextsize $((blksz * bsz))" "$testdir/file2" +_cp_reflink "$testdir/file1" "$testdir/file2" >> "$seqres.full" +_scratch_remount + +echo "Compare files" +md5sum "$testdir/file1" | _filter_scratch +md5sum "$testdir/file2" | _filter_scratch + +echo "CoW and unmount" +"$XFS_IO_PROG" -f -c "cowextsize" "$testdir/file2" >> "$seqres.full" +cat "$testdir/file2" > /dev/null +"$XFS_IO_PROG" -d -f -c "pwrite -R -S 0x63 -b $real_blksz 0 $((blksz * nr))" -c "fdatasync" "$testdir/file2" >> "$seqres.full" +"$XFS_IO_PROG" -f -c "fadvise -d 0 $((blksz * nr))" -c "fsync" "$testdir/file2" >> "$seqres.full" +"$XFS_IO_PROG" -f -c "falloc 0 $((blksz * nr))" "$testdir/file2" >> "$seqres.full" +_scratch_remount + +echo "Compare files" +md5sum "$testdir/file1" | _filter_scratch + +echo "Check extent counts" +old_extents=$(_count_extents "$testdir/file1") +new_extents=$(_count_extents "$testdir/file2") + +echo "old extents: $old_extents" >> "$seqres.full" +echo "new extents: $new_extents" >> "$seqres.full" +echo "maximum extents: $internal_blks" >> "$seqres.full" +test $new_extents -lt $((internal_blks / 20)) || test $new_extents -lt 15 \ + || _fail "file2 badly fragmented" + +echo "Check for damage" +umount "$SCRATCH_MNT" + +# success, all done +status=0 +exit diff --git a/tests/xfs/204.out b/tests/xfs/204.out new file mode 100644 index 0000000..0b46503 --- /dev/null +++ b/tests/xfs/204.out @@ -0,0 +1,11 @@ +QA output created by 204 +Format and mount +Create the original files +Compare files +2909feb63a37b0e95fe5cfb7f274f7b1 SCRATCH_MNT/test-204/file1 +2909feb63a37b0e95fe5cfb7f274f7b1 SCRATCH_MNT/test-204/file2 +CoW and unmount +Compare files +2909feb63a37b0e95fe5cfb7f274f7b1 SCRATCH_MNT/test-204/file1 +Check extent counts +Check for damage diff --git a/tests/xfs/207 b/tests/xfs/207 new file mode 100755 index 0000000..d8d7e90 --- /dev/null +++ b/tests/xfs/207 @@ -0,0 +1,104 @@ +#! /bin/bash +# FS QA Test No. 207 +# +# Test setting the extsz and cowextsz hints: +# - Ensure that we can set both on a zero-byte file. +# - Ensure that we can set only cowextsz on a many-byte file. +# - Ensure that whatever we set we get back later. +# +#----------------------------------------------------------------------- +# Copyright (c) 2016, Oracle and/or its affiliates. All Rights Reserved. +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License as +# published by the Free Software Foundation. +# +# This program is distributed in the hope that it would be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write the Free Software Foundation, +# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA +#----------------------------------------------------------------------- + +seq=`basename "$0"` +seqres="$RESULT_DIR/$seq" +echo "QA output created by $seq" + +here=`pwd` +tmp=/tmp/$$ +status=1 # failure is the default! +trap "_cleanup; exit \$status" 0 1 2 3 15 + +_cleanup() +{ + cd / + #rm -rf "$tmp".* "$testdir" +} + +# get standard environment, filters and checks +. ./common/rc +. ./common/filter +. ./common/reflink + +# real QA test starts here +_supported_os Linux +_supported_fs xfs +_require_scratch_reflink +_require_cp_reflink +_require_fiemap +_require_xfs_io_command "cowextsize" + +rm -f "$seqres.full" + +echo "Format and mount" +_scratch_mkfs > "$seqres.full" 2>&1 +_scratch_mount >> "$seqres.full" 2>&1 + +testdir="$SCRATCH_MNT/test-$seq" +rm -rf $testdir +mkdir $testdir + +echo "Create the original files" +"$XFS_IO_PROG" -f -c "pwrite -S 0x61 0 0" "$testdir/file1" >> "$seqres.full" +"$XFS_IO_PROG" -f -c "pwrite -S 0x61 0 1048576" "$testdir/file2" >> "$seqres.full" +_scratch_remount + +echo "Set extsz and cowextsz on zero byte file" +"$XFS_IO_PROG" -f -c "extsize 1048576" "$testdir/file1" | _filter_scratch +"$XFS_IO_PROG" -f -c "cowextsize 1048576" "$testdir/file1" | _filter_scratch + +echo "Set extsz and cowextsz on 1Mbyte file" +"$XFS_IO_PROG" -f -c "extsize 1048576" "$testdir/file2" | _filter_scratch +"$XFS_IO_PROG" -f -c "cowextsize 1048576" "$testdir/file2" | _filter_scratch +_scratch_remount + +fn() { + "$XFS_IO_PROG" -c "$1" "$2" | sed -e 's/.\([0-9]*\).*$/\1/g' +} +echo "Check extsz and cowextsz settings on zero byte file" +test $(fn extsize "$testdir/file1") -eq 1048576 || echo "file1 extsize not set" +test $(fn cowextsize "$testdir/file1") -eq 1048576 || echo "file1 cowextsize not set" + +echo "Check extsz and cowextsz settings on 1Mbyte file" +test $(fn extsize "$testdir/file2") -eq 0 || echo "file2 extsize not set" +test $(fn cowextsize "$testdir/file2") -eq 1048576 || echo "file2 cowextsize not set" + +echo "Set cowextsize and check flag" +"$XFS_IO_PROG" -f -c "cowextsize 1048576" "$testdir/file3" | _filter_scratch +_scratch_remount +test $("$XFS_IO_PROG" -c "stat" "$testdir/file3" | grep 'fsxattr.xflags' | awk '{print $4}' | grep -c 'C') -eq 1 || echo "file3 cowextsz flag not set" +test $(fn cowextsize "$testdir/file3") -eq 1048576 || echo "file3 cowextsize not set" +"$XFS_IO_PROG" -f -c "cowextsize 0" "$testdir/file3" | _filter_scratch +_scratch_remount +test $(fn cowextsize "$testdir/file3") -eq 0 || echo "file3 cowextsize not set" +test $("$XFS_IO_PROG" -c "stat" "$testdir/file3" | grep 'fsxattr.xflags' | awk '{print $4}' | grep -c 'C') -eq 0 || echo "file3 cowextsz flag not set" + +echo "Check for damage" +umount "$SCRATCH_MNT" + +# success, all done +status=0 +exit diff --git a/tests/xfs/207.out b/tests/xfs/207.out new file mode 100644 index 0000000..6fc0105 --- /dev/null +++ b/tests/xfs/207.out @@ -0,0 +1,10 @@ +QA output created by 207 +Format and mount +Create the original files +Set extsz and cowextsz on zero byte file +Set extsz and cowextsz on 1Mbyte file +xfs_io: XFS_IOC_FSSETXATTR SCRATCH_MNT/test-207/file2: Invalid argument +Check extsz and cowextsz settings on zero byte file +Check extsz and cowextsz settings on 1Mbyte file +Set cowextsize and check flag +Check for damage diff --git a/tests/xfs/208 b/tests/xfs/208 new file mode 100755 index 0000000..6b470f4 --- /dev/null +++ b/tests/xfs/208 @@ -0,0 +1,154 @@ +#! /bin/bash +# FS QA Test No. 208 +# +# Ensure that the effective cow extent allocation size hint is the maximum of +# the cowextsize and extsize inode fields. +# - Create two reflinked files. Set extsz hint on second file to $blocksize +# and cowextsize hint to 1MB. +# - Buffered write to random offsets to scatter CoW reservations. +# - Rewrite the whole file to use up reservations. +# - Check the number of extents. +# - Repeat, but with extsz = 1MB and cowextsz = $blocksize. +# +#----------------------------------------------------------------------- +# Copyright (c) 2016, Oracle and/or its affiliates. All Rights Reserved. +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License as +# published by the Free Software Foundation. +# +# This program is distributed in the hope that it would be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write the Free Software Foundation, +# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA +#----------------------------------------------------------------------- + +seq=`basename "$0"` +seqres="$RESULT_DIR/$seq" +echo "QA output created by $seq" + +here=`pwd` +tmp=/tmp/$$ +status=1 # failure is the default! +trap "_cleanup; exit \$status" 0 1 2 3 15 + +_cleanup() +{ + cd / + #rm -rf "$tmp".* "$testdir" +} + +# get standard environment, filters and checks +. ./common/rc +. ./common/filter +. ./common/reflink + +# real QA test starts here +_supported_os Linux +_supported_fs xfs +_require_scratch_reflink +_require_cp_reflink +_require_fiemap +_require_xfs_io_command "cowextsize" + +rm -f "$seqres.full" + +echo "Format and mount" +_scratch_mkfs > "$seqres.full" 2>&1 +_scratch_mount >> "$seqres.full" 2>&1 + +testdir="$SCRATCH_MNT/test-$seq" +rm -rf $testdir +mkdir $testdir + +blksz=65536 +nr=128 +bsz=16 + +free_blocks=$(stat -f -c '%a' "$testdir") +real_blksz=$(stat -f -c '%S' "$testdir") +space_needed=$(((blksz * nr * 3) * 5 / 4)) +space_avail=$((free_blocks * real_blksz)) +internal_blks=$((blksz * nr / real_blksz)) +test $space_needed -gt $space_avail && _notrun "Not enough space. $space_avail < $space_needed" + +echo "Create the original files" +"$XFS_IO_PROG" -f -c "pwrite -S 0x61 -b $((blksz * bsz)) 0 $((blksz * nr + 1))" "$testdir/file1" >> "$seqres.full" + +"$XFS_IO_PROG" -f -c "extsize $real_blksz" "$testdir/file2" +"$XFS_IO_PROG" -f -c "cowextsize $((blksz * bsz))" "$testdir/file2" +_cp_reflink "$testdir/file1" "$testdir/file2" >> "$seqres.full" +_cp_reflink "$testdir/file1" "$testdir/file2" >> "$seqres.full" + +"$XFS_IO_PROG" -f -c "extsize $((blksz * bsz))" "$testdir/file3" +"$XFS_IO_PROG" -f -c "cowextsize $real_blksz" "$testdir/file3" +_cp_reflink "$testdir/file1" "$testdir/file3" >> "$seqres.full" +_scratch_remount + +echo "Check extsize and cowextsize" +expected="[$real_blksz] $testdir/file2" +test "$expected" = "$("$XFS_IO_PROG" -f -c "extsize" "$testdir/file2")" || echo "file2 extsize setting failed" +expected="[$((blksz * bsz))] $testdir/file2" +test "$expected" = "$("$XFS_IO_PROG" -f -c "cowextsize" "$testdir/file2")" || echo "file2 cowextsize setting failed" + +expected="[$real_blksz] $testdir/file3" +test "$expected" = "$("$XFS_IO_PROG" -f -c "cowextsize" "$testdir/file3")" || echo "file3 extsize setting failed" +expected="[$((blksz * bsz))] $testdir/file3" +test "$expected" = "$("$XFS_IO_PROG" -f -c "extsize" "$testdir/file3")" || echo "file3 cowextsize setting failed" + +echo "Compare files" +md5sum "$testdir/file1" | _filter_scratch +md5sum "$testdir/file2" | _filter_scratch +md5sum "$testdir/file3" | _filter_scratch + +echo "CoW and unmount" +echo "extsize" >> "$seqres.full" +"$XFS_IO_PROG" -f -c "extsize" "$testdir/file2" >> "$seqres.full" +echo "cowextsize" >> "$seqres.full" +"$XFS_IO_PROG" -f -c "cowextsize" "$testdir/file2" >> "$seqres.full" + +"$XFS_IO_PROG" -f -c "pwrite -R -S 0x63 -b $real_blksz 0 $((blksz * nr))" -c "fdatasync" "$testdir/file2" >> "$seqres.full" +"$XFS_IO_PROG" -f -c "pwrite -S 0x63 -b $real_blksz 0 $((blksz * nr + 1))" -c "fdatasync" "$testdir/file2" >> "$seqres.full" + +echo "extsize" >> "$seqres.full" +"$XFS_IO_PROG" -f -c "extsize" "$testdir/file3" >> "$seqres.full" +echo "cowextsize" >> "$seqres.full" +"$XFS_IO_PROG" -f -c "cowextsize" "$testdir/file3" >> "$seqres.full" + +"$XFS_IO_PROG" -f -c "pwrite -R -S 0x63 -b $real_blksz 0 $((blksz * nr))" -c "fdatasync" "$testdir/file3" >> "$seqres.full" +"$XFS_IO_PROG" -f -c "pwrite -S 0x63 -b $real_blksz 0 $((blksz * nr + 1))" -c "fdatasync" "$testdir/file3" >> "$seqres.full" +_scratch_remount + +echo "Compare files" +md5sum "$testdir/file1" | _filter_scratch +md5sum "$testdir/file2" | _filter_scratch +md5sum "$testdir/file3" | _filter_scratch + +echo "Check extent counts" +old_extents=$(_count_extents "$testdir/file1") +new_extents=$(_count_extents "$testdir/file2") + +echo "old extents: $old_extents" >> "$seqres.full" +echo "new extents: $new_extents" >> "$seqres.full" +echo "maximum extents: $internal_blks" >> "$seqres.full" +test $new_extents -lt $((internal_blks / 20)) || test $new_extents -lt 15 \ + || echo "file2 badly fragmented" + +new_extents=$(_count_extents "$testdir/file3") + +echo "old extents: $old_extents" >> "$seqres.full" +echo "new extents: $new_extents" >> "$seqres.full" +echo "maximum extents: $internal_blks" >> "$seqres.full" +test $new_extents -lt $((internal_blks / 20)) || test $new_extents -lt 15 \ + || echo "file3 badly fragmented" + +echo "Check for damage" +umount "$SCRATCH_MNT" + +# success, all done +status=0 +exit diff --git a/tests/xfs/208.out b/tests/xfs/208.out new file mode 100644 index 0000000..0a31249 --- /dev/null +++ b/tests/xfs/208.out @@ -0,0 +1,15 @@ +QA output created by 208 +Format and mount +Create the original files +Check extsize and cowextsize +Compare files +2909feb63a37b0e95fe5cfb7f274f7b1 SCRATCH_MNT/test-208/file1 +2909feb63a37b0e95fe5cfb7f274f7b1 SCRATCH_MNT/test-208/file2 +2909feb63a37b0e95fe5cfb7f274f7b1 SCRATCH_MNT/test-208/file3 +CoW and unmount +Compare files +2909feb63a37b0e95fe5cfb7f274f7b1 SCRATCH_MNT/test-208/file1 +d41f6527bc8320364e12ea7076140b8b SCRATCH_MNT/test-208/file2 +d41f6527bc8320364e12ea7076140b8b SCRATCH_MNT/test-208/file3 +Check extent counts +Check for damage diff --git a/tests/xfs/209 b/tests/xfs/209 new file mode 100755 index 0000000..ef47e74 --- /dev/null +++ b/tests/xfs/209 @@ -0,0 +1,88 @@ +#! /bin/bash +# FS QA Test No. 209 +# +# Make sure setting cowextsz on a directory propagates it to subfiles. +# +#----------------------------------------------------------------------- +# Copyright (c) 2016, Oracle and/or its affiliates. All Rights Reserved. +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License as +# published by the Free Software Foundation. +# +# This program is distributed in the hope that it would be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write the Free Software Foundation, +# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA +#----------------------------------------------------------------------- + +seq=`basename "$0"` +seqres="$RESULT_DIR/$seq" +echo "QA output created by $seq" + +here=`pwd` +tmp=/tmp/$$ +status=1 # failure is the default! +trap "_cleanup; exit \$status" 0 1 2 3 15 + +_cleanup() +{ + cd / + #rm -rf "$tmp".* "$testdir" +} + +# get standard environment, filters and checks +. ./common/rc +. ./common/filter +. ./common/reflink + +# real QA test starts here +_supported_os Linux +_supported_fs xfs +_require_scratch_reflink +_require_cp_reflink +_require_fiemap +_require_xfs_io_command "cowextsize" + +rm -f "$seqres.full" + +echo "Format and mount" +_scratch_mkfs > "$seqres.full" 2>&1 +_scratch_mount >> "$seqres.full" 2>&1 + +testdir="$SCRATCH_MNT/test-$seq" +rm -rf $testdir +mkdir $testdir + +echo "Set extsz and cowextsz on directory" +"$XFS_IO_PROG" -c "cowextsize 1048576" "$testdir" >> "$seqres.full" + +echo "Create a fake tree structure" +seq 1 32 | while read nr; do + mkdir "$testdir/dir-$nr" + seq 1 8 | while read nnr; do + touch "$testdir/dir-$nr/file-$nnr" + done +done +_scratch_remount + +echo "Check cowextsize settings" +seq 1 32 | while read nr; do + seq 1 8 | while read nnr; do + file="$testdir/dir-$nr/file-$nnr" + expected="[1048576] $file" + actual="$("$XFS_IO_PROG" -c "cowextsize" "$file")" + test "$expected" = "$actual" || echo "cowextsize didn't propagate to $file" + done +done + +echo "Check for damage" +umount "$SCRATCH_MNT" + +# success, all done +status=0 +exit diff --git a/tests/xfs/209.out b/tests/xfs/209.out new file mode 100644 index 0000000..ffb0609 --- /dev/null +++ b/tests/xfs/209.out @@ -0,0 +1,6 @@ +QA output created by 209 +Format and mount +Set extsz and cowextsz on directory +Create a fake tree structure +Check cowextsize settings +Check for damage diff --git a/tests/xfs/210 b/tests/xfs/210 new file mode 100755 index 0000000..95e73b2 --- /dev/null +++ b/tests/xfs/210 @@ -0,0 +1,125 @@ +#! /bin/bash +# FS QA Test No. 210 +# +# During reflink, XFS should carry the cowextsz setting to the destination file +# if the destination file size is less than the size of the source file, the +# length is the size of the source file, both offsets are zero, and the +# destination does not already have a cowextsz setting. It should not do so +# otherwise. +# +#----------------------------------------------------------------------- +# Copyright (c) 2016, Oracle and/or its affiliates. All Rights Reserved. +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License as +# published by the Free Software Foundation. +# +# This program is distributed in the hope that it would be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write the Free Software Foundation, +# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA +#----------------------------------------------------------------------- + +seq=`basename "$0"` +seqres="$RESULT_DIR/$seq" +echo "QA output created by $seq" + +here=`pwd` +tmp=/tmp/$$ +status=1 # failure is the default! +trap "_cleanup; exit \$status" 0 1 2 3 15 + +_cleanup() +{ + cd / + #rm -rf "$tmp".* "$testdir" +} + +# get standard environment, filters and checks +. ./common/rc +. ./common/filter +. ./common/reflink + +# real QA test starts here +_supported_os Linux +_supported_fs xfs +_require_scratch_reflink +_require_cp_reflink +_require_fiemap +_require_xfs_io_command "cowextsize" + +rm -f "$seqres.full" + +echo "Format and mount" +_scratch_mkfs > "$seqres.full" 2>&1 +_scratch_mount >> "$seqres.full" 2>&1 + +testdir="$SCRATCH_MNT/test-$seq" +rm -rf $testdir +mkdir $testdir + +echo "Create initial file" +"$XFS_IO_PROG" -f -c "pwrite -S 0x61 0 131072" "$testdir/file1" >> "$seqres.full" +"$XFS_IO_PROG" -c "cowextsize 1048576" "$testdir/file1" >> "$seqres.full" +"$XFS_IO_PROG" -f -c "pwrite -S 0x61 0 1" "$testdir/file4" >> "$seqres.full" +"$XFS_IO_PROG" -f -c "pwrite -S 0x61 0 262144" "$testdir/file7" >> "$seqres.full" +"$XFS_IO_PROG" -f -c "pwrite -S 0x61 0 262144" "$testdir/file9" >> "$seqres.full" +"$XFS_IO_PROG" -f -c "pwrite -S 0x61 0 262144" "$testdir/file10" >> "$seqres.full" + +echo "Reflink to an empty file" +_reflink_range "$testdir/file1" 0 "$testdir/file2" 0 0 >> "$seqres.full" + +echo "Reflink to an empty file that already has cowextsz" +"$XFS_IO_PROG" -f -c "cowextsize 524288" "$testdir/file3" >> "$seqres.full" +_reflink_range "$testdir/file1" 0 "$testdir/file3" 0 0 >> "$seqres.full" + +echo "Reflink to a small file" +_reflink_range "$testdir/file1" 0 "$testdir/file4" 0 0 >> "$seqres.full" + +echo "Reflink to a nonzero offset" +_reflink_range "$testdir/file1" 0 "$testdir/file5" 65536 0 >> "$seqres.full" + +echo "Reflink from a nonzero offset" +_reflink_range "$testdir/file1" 65536 "$testdir/file6" 0 0 >> "$seqres.full" + +echo "Reflink to a large file" +_reflink_range "$testdir/file1" 0 "$testdir/file7" 0 0 >> "$seqres.full" + +echo "Reflink less than the whole source file" +_reflink_range "$testdir/file1" 0 "$testdir/file8" 0 65536 >> "$seqres.full" + +echo "cp reflink to a large file" +_cp_reflink "$testdir/file1" "$testdir/file9" >> "$seqres.full" + +echo "cp reflink to a large file with cowextsize" +"$XFS_IO_PROG" -f -c "cowextsize 524288" "$testdir/file10" >> "$seqres.full" +_cp_reflink "$testdir/file1" "$testdir/file10" >> "$seqres.full" + +fn() { + "$XFS_IO_PROG" -c "cowextsize" "$1" | sed -e 's/.\([0-9]*\).*$/\1/g' +} +echo "Check cowextsz" +test "$(fn "$testdir/file1")" -eq 1048576 || echo "file1 cowextsize wrong" +test "$(fn "$testdir/file2")" -eq 1048576 || echo "file2 cowextsize wrong" +test "$(fn "$testdir/file3")" -eq 524288 || echo "file3 cowextsize wrong" +test "$(fn "$testdir/file4")" -eq 1048576 || echo "file4 cowextsize wrong" +test "$(fn "$testdir/file5")" -eq 0 || echo "file5 cowextsize wrong" +test "$(fn "$testdir/file6")" -eq 0 || echo "file6 cowextsize wrong" +test "$(fn "$testdir/file7")" -eq 0 || echo "file7 cowextsize wrong" +test "$(fn "$testdir/file8")" -eq 0 || echo "file8 cowextsize wrong" +test "$(fn "$testdir/file9")" -eq 1048576 || echo "file9 cowextsize wrong" +test "$(fn "$testdir/file10")" -eq 524288 || echo "file10 cowextsize wrong" +for i in $(seq 1 10); do + echo "$testdir/file$i $(fn "$testdir/file$i")" >> "$seqres.full" +done + +echo "Check for damage" +umount "$SCRATCH_MNT" + +# success, all done +status=0 +exit diff --git a/tests/xfs/210.out b/tests/xfs/210.out new file mode 100644 index 0000000..ca5086b --- /dev/null +++ b/tests/xfs/210.out @@ -0,0 +1,14 @@ +QA output created by 210 +Format and mount +Create initial file +Reflink to an empty file +Reflink to an empty file that already has cowextsz +Reflink to a small file +Reflink to a nonzero offset +Reflink from a nonzero offset +Reflink to a large file +Reflink less than the whole source file +cp reflink to a large file +cp reflink to a large file with cowextsize +Check cowextsz +Check for damage diff --git a/tests/xfs/211 b/tests/xfs/211 new file mode 100755 index 0000000..abc9a07 --- /dev/null +++ b/tests/xfs/211 @@ -0,0 +1,111 @@ +#! /bin/bash +# FS QA Test No. 211 +# +# Test fragmentation in a big file after a lot of random CoW: +# - Create two reflinked files. Set extsz hint on second file. +# - Directio write to random offsets to scatter CoW reservations. +# - Rewrite the whole file to use up reservations. +# - Check the number of extents. +# +#----------------------------------------------------------------------- +# Copyright (c) 2016, Oracle and/or its affiliates. All Rights Reserved. +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License as +# published by the Free Software Foundation. +# +# This program is distributed in the hope that it would be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write the Free Software Foundation, +# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA +#----------------------------------------------------------------------- + +seq=`basename "$0"` +seqres="$RESULT_DIR/$seq" +echo "QA output created by $seq" + +here=`pwd` +tmp=/tmp/$$ +status=1 # failure is the default! +trap "_cleanup; exit \$status" 0 1 2 3 15 + +_cleanup() +{ + cd / + #rm -rf "$tmp".* "$testdir" +} + +# get standard environment, filters and checks +. ./common/rc +. ./common/filter +. ./common/reflink + +# real QA test starts here +_supported_os Linux +_supported_fs xfs +_require_scratch_reflink +_require_cp_reflink +_require_fiemap +_require_xfs_io_command "cowextsize" + +rm -f "$seqres.full" + +echo "Format and mount" +_scratch_mkfs > "$seqres.full" 2>&1 +_scratch_mount >> "$seqres.full" 2>&1 + +testdir="$SCRATCH_MNT/test-$seq" +rm -rf $testdir +mkdir $testdir + +blksz=65536 +nr=50000 +bsz=16 + +free_blocks=$(stat -f -c '%a' "$testdir") +real_blksz=$(stat -f -c '%S' "$testdir") +space_needed=$(((blksz * nr * 2) * 5 / 4)) +space_avail=$((free_blocks * real_blksz)) +internal_blks=$((blksz * nr / real_blksz)) +test $space_needed -gt $space_avail && _notrun "Not enough space. $space_avail < $space_needed" + +echo "Create the original files" +"$XFS_IO_PROG" -f -c "pwrite -S 0x61 -b $((blksz * bsz)) 0 $((blksz * nr + 1))" "$testdir/file1" >> "$seqres.full" +"$XFS_IO_PROG" -f -c "cowextsize $((blksz * bsz))" "$testdir/file2" +_cp_reflink "$testdir/file1" "$testdir/file2" >> "$seqres.full" +_scratch_remount + +echo "Compare files" +md5sum "$testdir/file1" | _filter_scratch +md5sum "$testdir/file2" | _filter_scratch + +echo "CoW and unmount" +"$XFS_IO_PROG" -f -c "cowextsize" "$testdir/file2" >> "$seqres.full" +"$XFS_IO_PROG" -d -f -c "pwrite -R -S 0x63 -b $real_blksz 0 $((blksz * nr + 1))" "$testdir/file2" >> "$seqres.full" +"$XFS_IO_PROG" -d -f -c "pwrite -S 0x63 -b 8388608 0 $((blksz * nr))" "$testdir/file2" >> "$seqres.full" +_scratch_remount + +echo "Compare files" +md5sum "$testdir/file1" | _filter_scratch +md5sum "$testdir/file2" | _filter_scratch + +echo "Check extent counts" +old_extents=$(_count_extents "$testdir/file1") +new_extents=$(_count_extents "$testdir/file2") + +echo "old extents: $old_extents" >> "$seqres.full" +echo "new extents: $new_extents" >> "$seqres.full" +echo "maximum extents: $internal_blks" >> "$seqres.full" +test $new_extents -lt $((internal_blks / 20)) || test $new_extents -lt 15 \ + || _fail "file2 badly fragmented" + +echo "Check for damage" +umount "$SCRATCH_MNT" + +# success, all done +status=0 +exit diff --git a/tests/xfs/211.out b/tests/xfs/211.out new file mode 100644 index 0000000..3d912a8 --- /dev/null +++ b/tests/xfs/211.out @@ -0,0 +1,12 @@ +QA output created by 211 +Format and mount +Create the original files +Compare files +07415406aea963ab8e005f1d3744fded SCRATCH_MNT/test-211/file1 +07415406aea963ab8e005f1d3744fded SCRATCH_MNT/test-211/file2 +CoW and unmount +Compare files +07415406aea963ab8e005f1d3744fded SCRATCH_MNT/test-211/file1 +7d8ab127adfc1f745a7d1cd5e44d10d8 SCRATCH_MNT/test-211/file2 +Check extent counts +Check for damage diff --git a/tests/xfs/group b/tests/xfs/group index abf1d33..119e1fd 100644 --- a/tests/xfs/group +++ b/tests/xfs/group @@ -177,8 +177,11 @@ 177 dmapi 178 mkfs other auto 179 auto quick clone +180 auto quick clone 181 log auto quick +182 auto quick clone 183 rw other auto quick +184 auto quick clone 185 dmapi 186 attr auto quick 187 attr auto quick @@ -186,16 +189,26 @@ 189 mount auto quick 190 rw auto quick 191 nfs4acl auto +192 auto quick clone +193 auto quick clone 194 rw auto 195 ioctl dump auto quick 196 quota auto quick 197 dir auto quick +198 auto quick clone 199 mount auto quick +200 auto quick clone 201 metadata auto quick 202 repair auto quick 203 ioctl auto +204 auto quick clone 205 metadata rw auto 206 growfs auto quick +207 auto quick clone +208 auto quick clone +209 auto quick clone +210 auto quick clone +211 clone_stress 216 log metadata auto quick 217 log metadata auto 220 auto quota quick From darrick.wong@oracle.com Mon Feb 8 19:13:28 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=LOTS_OF_MONEY, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay1.corp.sgi.com [137.38.102.111]) by oss.sgi.com (Postfix) with ESMTP id ED18829DFA for ; Mon, 8 Feb 2016 19:13:27 -0600 (CST) Received: from cuda.sgi.com (cuda3.sgi.com [192.48.176.15]) by relay1.corp.sgi.com (Postfix) with ESMTP id DDEDD8F804B for ; Mon, 8 Feb 2016 17:13:27 -0800 (PST) X-ASG-Debug-ID: 1454980405-04cb6c1e5703690001-NocioJ Received: from userp1040.oracle.com (userp1040.oracle.com [156.151.31.81]) by cuda.sgi.com with ESMTP id DGpA69Uu2Ci3A433 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO) for ; Mon, 08 Feb 2016 17:13:25 -0800 (PST) X-Barracuda-Envelope-From: darrick.wong@oracle.com X-Barracuda-Apparent-Source-IP: 156.151.31.81 Received: from userv0021.oracle.com (userv0021.oracle.com [156.151.31.71]) by userp1040.oracle.com (Sentrion-MTA-4.3.2/Sentrion-MTA-4.3.2) with ESMTP id u191DIIt015460 (version=TLSv1 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Tue, 9 Feb 2016 01:13:19 GMT Received: from aserv0121.oracle.com (aserv0121.oracle.com [141.146.126.235]) by userv0021.oracle.com (8.13.8/8.13.8) with ESMTP id u191DINt017169 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=FAIL); Tue, 9 Feb 2016 01:13:18 GMT Received: from abhmp0015.oracle.com (abhmp0015.oracle.com [141.146.116.21]) by aserv0121.oracle.com (8.13.8/8.13.8) with ESMTP id u191DIVm027771; Tue, 9 Feb 2016 01:13:18 GMT Received: from localhost (/10.145.178.207) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Mon, 08 Feb 2016 17:13:17 -0800 Subject: [PATCH 14/23] reflink: high offset reflink and dedupe tests From: "Darrick J. Wong" X-ASG-Orig-Subj: [PATCH 14/23] reflink: high offset reflink and dedupe tests To: david@fromorbit.com, darrick.wong@oracle.com Cc: linux-btrfs@vger.kernel.org, Christoph Hellwig , fstests@vger.kernel.org, xfs@oss.sgi.com Date: Mon, 08 Feb 2016 17:13:16 -0800 Message-ID: <20160209011316.23099.62123.stgit@birch.djwong.org> In-Reply-To: <20160209011145.23099.95354.stgit@birch.djwong.org> References: <20160209011145.23099.95354.stgit@birch.djwong.org> User-Agent: StGit/0.17.1-dirty MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit X-Source-IP: userv0021.oracle.com [156.151.31.71] X-Barracuda-Connect: userp1040.oracle.com[156.151.31.81] X-Barracuda-Start-Time: 1454980405 X-Barracuda-Encrypted: ECDHE-RSA-AES256-GCM-SHA384 X-Barracuda-URL: https://192.48.176.15:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-BRTS-Status: 1 X-Barracuda-Spam-Score: 0.00 X-Barracuda-Spam-Status: No, SCORE=0.00 using per-user scores of TAG_LEVEL=1000.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.7 tests=BSF_SC0_MISMATCH_TO, UNPARSEABLE_RELAY X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.3.26874 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 0.00 BSF_SC0_MISMATCH_TO Envelope rcpt doesn't match header 0.00 UNPARSEABLE_RELAY Informational: message has unparseable relay lines Ensure that we can pass absurdly enormous offsets and lengths to reflink/dedupe and it'll survive. v2: Ask for dedupe in the dedupe test. Signed-off-by: Darrick J. Wong [hch@lst.de: call _require_test_dedupe] Signed-off-by: Christoph Hellwig --- tests/generic/303 | 99 +++++++++++++++++++++++++++++++++++++++++++++++++ tests/generic/303.out | 21 ++++++++++ tests/generic/304 | 100 +++++++++++++++++++++++++++++++++++++++++++++++++ tests/generic/304.out | 22 +++++++++++ tests/generic/group | 2 + 5 files changed, 244 insertions(+) create mode 100755 tests/generic/303 create mode 100644 tests/generic/303.out create mode 100755 tests/generic/304 create mode 100644 tests/generic/304.out diff --git a/tests/generic/303 b/tests/generic/303 new file mode 100755 index 0000000..c337483 --- /dev/null +++ b/tests/generic/303 @@ -0,0 +1,99 @@ +#! /bin/bash +# FS QA Test No. 303 +# +# Check that high-offset reflinks work. +# +#----------------------------------------------------------------------- +# Copyright (c) 2016, Oracle and/or its affiliates. All Rights Reserved. +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License as +# published by the Free Software Foundation. +# +# This program is distributed in the hope that it would be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write the Free Software Foundation, +# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA +#----------------------------------------------------------------------- + +seq=`basename "$0"` +seqres="$RESULT_DIR/$seq" +echo "QA output created by $seq" + +here=`pwd` +tmp=/tmp/$$ +status=1 # failure is the default! +trap "_cleanup; exit \$status" 0 1 2 3 15 + +_cleanup() +{ + cd / + rm -rf "$tmp".* "$testdir" +} + +# get standard environment, filters and checks +. ./common/rc +. ./common/filter +. ./common/attr +. ./common/reflink + +# real QA test starts here +_supported_os Linux +_require_test_reflink +_require_cp_reflink + +rm -f "$seqres.full" + +echo "Format and mount" +testdir="$TEST_DIR/test-$seq" +rm -rf "$testdir" +mkdir "$testdir" + +echo "Create the original files" +bigoff=9223372036854775806 +len=9223372036854775807 +bigoff_64k=9223372036854710272 # bigoff rounded down to 64k +"$XFS_IO_PROG" -f -c "truncate $len" "$testdir/file0" >> "$seqres.full" +test -s "$testdir/file0" || _notrun "High offset ftruncate failed" +_pwrite_byte 0x61 $bigoff 1 "$testdir/file1" >> "$seqres.full" +_pwrite_byte 0x61 1048575 1 "$testdir/file2" >> "$seqres.full" + +echo "Reflink large single byte file" +_cp_reflink "$testdir/file1" "$testdir/file3" >> "$seqres.full" + +echo "Reflink large empty file" +_cp_reflink "$testdir/file0" "$testdir/file4" >> "$seqres.full" + +echo "Reflink past maximum file size in dest file (should fail)" +_reflink_range "$testdir/file1" 0 "$testdir/file5" 4611686018427322368 $len >> "$seqres.full" + +echo "Reflink high offset to low offset" +_reflink_range "$testdir/file1" $bigoff_64k "$testdir/file6" 1048576 65535 >> "$seqres.full" + +echo "Reflink past source file EOF (should fail)" +_reflink_range "$testdir/file2" 524288 "$testdir/file7" 0 1048576 >> "$seqres.full" + +echo "Reflink max size at nonzero offset (should fail)" +_reflink_range "$testdir/file2" 524288 "$testdir/file8" 0 $len >> "$seqres.full" + +echo "Reflink with huge off/len (should fail)" +_reflink_range "$testdir/file2" $bigoff_64k "$testdir/file9" 0 $bigoff_64k >> "$seqres.full" + +echo "Check file creation" +_test_remount +echo "file3" +"$XFS_IO_PROG" -c "pread -v -q $bigoff 1" "$testdir/file3" +echo "file4" +"$XFS_IO_PROG" -c "pread -v -q $bigoff 1" "$testdir/file4" +# file5 should fail above +echo "file6" +"$XFS_IO_PROG" -c "pread -v -q 1114110 1" "$testdir/file6" +# file7 should fail above + +# success, all done +status=0 +exit diff --git a/tests/generic/303.out b/tests/generic/303.out new file mode 100644 index 0000000..39a8803 --- /dev/null +++ b/tests/generic/303.out @@ -0,0 +1,21 @@ +QA output created by 303 +Format and mount +Create the original files +Reflink large single byte file +Reflink large empty file +Reflink past maximum file size in dest file (should fail) +XFS_IOC_CLONE_RANGE: Invalid argument +Reflink high offset to low offset +Reflink past source file EOF (should fail) +XFS_IOC_CLONE_RANGE: Invalid argument +Reflink max size at nonzero offset (should fail) +XFS_IOC_CLONE_RANGE: Invalid argument +Reflink with huge off/len (should fail) +XFS_IOC_CLONE_RANGE: Invalid argument +Check file creation +file3 +7ffffffffffffffe: 61 a +file4 +7ffffffffffffffe: 00 . +file6 +0010fffe: 61 a diff --git a/tests/generic/304 b/tests/generic/304 new file mode 100755 index 0000000..443ed21 --- /dev/null +++ b/tests/generic/304 @@ -0,0 +1,100 @@ +#! /bin/bash +# FS QA Test No. 304 +# +# Check that high-offset dedupes work. +# +#----------------------------------------------------------------------- +# Copyright (c) 2016, Oracle and/or its affiliates. All Rights Reserved. +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License as +# published by the Free Software Foundation. +# +# This program is distributed in the hope that it would be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write the Free Software Foundation, +# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA +#----------------------------------------------------------------------- + +seq=`basename "$0"` +seqres="$RESULT_DIR/$seq" +echo "QA output created by $seq" + +here=`pwd` +tmp=/tmp/$$ +status=1 # failure is the default! +trap "_cleanup; exit \$status" 0 1 2 3 15 + +_cleanup() +{ + cd / + rm -rf "$tmp".* "$testdir" +} + +# get standard environment, filters and checks +. ./common/rc +. ./common/filter +. ./common/attr +. ./common/reflink + +# real QA test starts here +_supported_os Linux +_require_test_dedupe +_require_cp_reflink + +rm -f "$seqres.full" + +echo "Format and mount" +testdir="$TEST_DIR/test-$seq" +rm -rf "$testdir" +mkdir "$testdir" + +echo "Create the original files" +bigoff=9223372036854775806 +len=9223372036854775807 +bigoff_64k=9223372036854710272 # bigoff rounded down to 64k +"$XFS_IO_PROG" -f -c "truncate $len" "$testdir/file0" >> "$seqres.full" +test -s "$testdir/file0" || _notrun "High offset ftruncate failed" +_pwrite_byte 0x61 $bigoff 1 "$testdir/file1" >> "$seqres.full" +_pwrite_byte 0x61 $bigoff 1 "$testdir/file3" >> "$seqres.full" +_pwrite_byte 0x61 1048575 1 "$testdir/file2" >> "$seqres.full" + +echo "Dedupe large single byte file" +_dedupe_range "$testdir/file1" 0 "$testdir/file3" 0 $len >> "$seqres.full" + +echo "Dedupe large empty file" +_dedupe_range "$testdir/file0" 0 "$testdir/file4" 0 $len >> "$seqres.full" + +echo "Dedupe past maximum file size in dest file (should fail)" +_dedupe_range "$testdir/file1" 0 "$testdir/file5" 4611686018427322368 $len >> "$seqres.full" + +echo "Dedupe high offset to low offset" +_dedupe_range "$testdir/file1" $bigoff_64k "$testdir/file6" 1048576 65535 >> "$seqres.full" + +echo "Dedupe past source file EOF (should fail)" +_dedupe_range "$testdir/file2" 524288 "$testdir/file7" 0 1048576 >> "$seqres.full" + +echo "Dedupe max size at nonzero offset (should fail)" +_dedupe_range "$testdir/file2" 524288 "$testdir/file8" 0 $len >> "$seqres.full" + +echo "Dedupe with huge off/len (should fail)" +_dedupe_range "$testdir/file2" $bigoff_64k "$testdir/file9" 0 $bigoff_64k >> "$seqres.full" + +echo "Check file creation" +_test_remount +echo "file3" +"$XFS_IO_PROG" -c "pread -v -q $bigoff 1" "$testdir/file3" +echo "file4" +"$XFS_IO_PROG" -c "pread -v -q $bigoff 1" "$testdir/file4" +# file5 should fail above +echo "file6" +"$XFS_IO_PROG" -c "pread -v -q 1114110 1" "$testdir/file6" +# file7 should fail above + +# success, all done +status=0 +exit diff --git a/tests/generic/304.out b/tests/generic/304.out new file mode 100644 index 0000000..4af2a39 --- /dev/null +++ b/tests/generic/304.out @@ -0,0 +1,22 @@ +QA output created by 304 +Format and mount +Create the original files +Dedupe large single byte file +dedupe: Invalid argument +Dedupe large empty file +dedupe: Invalid argument +Dedupe past maximum file size in dest file (should fail) +dedupe: Invalid argument +Dedupe high offset to low offset +dedupe: Extents did not match. +Dedupe past source file EOF (should fail) +dedupe: Invalid argument +Dedupe max size at nonzero offset (should fail) +dedupe: Invalid argument +Dedupe with huge off/len (should fail) +XFS_IOC_FILE_EXTENT_SAME: Invalid argument +Check file creation +file3 +7ffffffffffffffe: 61 a +file4 +file6 diff --git a/tests/generic/group b/tests/generic/group index 7e1ea72..3229dad 100644 --- a/tests/generic/group +++ b/tests/generic/group @@ -305,6 +305,8 @@ 300 auto aio enospc preallocrw stress 301 auto quick clone 302 auto quick clone +303 auto quick clone +304 auto quick clone 306 auto quick rw 307 auto quick 308 auto quick From darrick.wong@oracle.com Mon Feb 8 19:13:37 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay1.corp.sgi.com [137.38.102.111]) by oss.sgi.com (Postfix) with ESMTP id A127A29E1B for ; Mon, 8 Feb 2016 19:13:37 -0600 (CST) Received: from cuda.sgi.com (cuda2.sgi.com [192.48.176.25]) by relay1.corp.sgi.com (Postfix) with ESMTP id 9A4EF8F804B for ; Mon, 8 Feb 2016 17:13:37 -0800 (PST) X-ASG-Debug-ID: 1454980412-04cbb0433405a10001-NocioJ Received: from userp1040.oracle.com (userp1040.oracle.com [156.151.31.81]) by cuda.sgi.com with ESMTP id A8IthRQoULgRSaCK (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO) for ; Mon, 08 Feb 2016 17:13:33 -0800 (PST) X-Barracuda-Envelope-From: darrick.wong@oracle.com X-Barracuda-Apparent-Source-IP: 156.151.31.81 Received: from aserv0021.oracle.com (aserv0021.oracle.com [141.146.126.233]) by userp1040.oracle.com (Sentrion-MTA-4.3.2/Sentrion-MTA-4.3.2) with ESMTP id u191DVIF015527 (version=TLSv1 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Tue, 9 Feb 2016 01:13:31 GMT Received: from aserv0122.oracle.com (aserv0122.oracle.com [141.146.126.236]) by aserv0021.oracle.com (8.13.8/8.13.8) with ESMTP id u191DVQg004333 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=FAIL); Tue, 9 Feb 2016 01:13:31 GMT Received: from abhmp0013.oracle.com (abhmp0013.oracle.com [141.146.116.19]) by aserv0122.oracle.com (8.13.8/8.13.8) with ESMTP id u191DVrp027881; Tue, 9 Feb 2016 01:13:31 GMT Received: from localhost (/10.145.178.207) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Mon, 08 Feb 2016 17:13:30 -0800 Subject: [PATCH 16/23] reflink: test quota accounting From: "Darrick J. Wong" X-ASG-Orig-Subj: [PATCH 16/23] reflink: test quota accounting To: david@fromorbit.com, darrick.wong@oracle.com Cc: linux-btrfs@vger.kernel.org, fstests@vger.kernel.org, xfs@oss.sgi.com Date: Mon, 08 Feb 2016 17:13:29 -0800 Message-ID: <20160209011329.23099.8307.stgit@birch.djwong.org> In-Reply-To: <20160209011145.23099.95354.stgit@birch.djwong.org> References: <20160209011145.23099.95354.stgit@birch.djwong.org> User-Agent: StGit/0.17.1-dirty MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit X-Source-IP: aserv0021.oracle.com [141.146.126.233] X-Barracuda-Connect: userp1040.oracle.com[156.151.31.81] X-Barracuda-Start-Time: 1454980413 X-Barracuda-Encrypted: ECDHE-RSA-AES256-GCM-SHA384 X-Barracuda-URL: https://192.48.176.25:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-BRTS-Status: 1 X-Barracuda-Spam-Score: 0.00 X-Barracuda-Spam-Status: No, SCORE=0.00 using per-user scores of TAG_LEVEL=1000.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.7 tests=BSF_SC0_MISMATCH_TO, UNPARSEABLE_RELAY X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.3.26874 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 0.00 BSF_SC0_MISMATCH_TO Envelope rcpt doesn't match header 0.00 UNPARSEABLE_RELAY Informational: message has unparseable relay lines Signed-off-by: Darrick J. Wong --- common/reflink | 2 - tests/generic/305 | 105 +++++++++++++++++++++++++++++++++++++++++++++++ tests/generic/305.out | 23 ++++++++++ tests/generic/326 | 105 +++++++++++++++++++++++++++++++++++++++++++++++ tests/generic/326.out | 23 ++++++++++ tests/generic/327 | 92 +++++++++++++++++++++++++++++++++++++++++ tests/generic/327.out | 13 ++++++ tests/generic/328 | 109 +++++++++++++++++++++++++++++++++++++++++++++++++ tests/generic/328.out | 26 ++++++++++++ tests/generic/group | 4 ++ tests/xfs/213 | 110 +++++++++++++++++++++++++++++++++++++++++++++++++ tests/xfs/213.out | 23 ++++++++++ tests/xfs/214 | 109 +++++++++++++++++++++++++++++++++++++++++++++++++ tests/xfs/214.out | 23 ++++++++++ tests/xfs/group | 2 + 15 files changed, 768 insertions(+), 1 deletion(-) create mode 100755 tests/generic/305 create mode 100644 tests/generic/305.out create mode 100755 tests/generic/326 create mode 100644 tests/generic/326.out create mode 100755 tests/generic/327 create mode 100644 tests/generic/327.out create mode 100755 tests/generic/328 create mode 100644 tests/generic/328.out create mode 100755 tests/xfs/213 create mode 100644 tests/xfs/213.out create mode 100755 tests/xfs/214 create mode 100644 tests/xfs/214.out diff --git a/common/reflink b/common/reflink index 3d6a8c1..139e00e 100644 --- a/common/reflink +++ b/common/reflink @@ -153,7 +153,7 @@ _cp_reflink() { file1="$1" file2="$2" - cp --reflink=always "$file1" "$file2" + cp --reflink=always -p "$file1" "$file2" } # Reflink some file1 into file2 diff --git a/tests/generic/305 b/tests/generic/305 new file mode 100755 index 0000000..5721dd0 --- /dev/null +++ b/tests/generic/305 @@ -0,0 +1,105 @@ +#! /bin/bash +# FS QA Test No. 305 +# +# Ensure that quota charges us for reflinking a file and that we're not +# charged for buffered copy on write. +# +#----------------------------------------------------------------------- +# Copyright (c) 2016, Oracle and/or its affiliates. All Rights Reserved. +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License as +# published by the Free Software Foundation. +# +# This program is distributed in the hope that it would be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write the Free Software Foundation, +# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA +#----------------------------------------------------------------------- + +seq=`basename "$0"` +seqres="$RESULT_DIR/$seq" +echo "QA output created by $seq" + +here=`pwd` +tmp=/tmp/$$ +status=1 # failure is the default! +trap "_cleanup; exit \$status" 0 1 2 3 15 + +_cleanup() +{ + cd / + #rm -rf "$tmp".* "$testdir" +} + +# get standard environment, filters and checks +. ./common/rc +. ./common/filter +. ./common/reflink +. ./common/quota + +# real QA test starts here +_supported_os Linux +_require_scratch_reflink +_require_cp_reflink +_require_fiemap +_require_quota +_need_to_be_root +_require_nobody + +_repquota() { + repquota "$SCRATCH_MNT" | egrep '^(fsgqa|root|nobody)' +} +rm -f "$seqres.full" + +echo "Format and mount" +_scratch_mkfs > "$seqres.full" 2>&1 +export MOUNT_OPTIONS="-o usrquota,grpquota $MOUNT_OPTIONS" +_scratch_mount >> "$seqres.full" 2>&1 +quotacheck -u -g "$SCRATCH_MNT" 2> /dev/null +quotaon "$SCRATCH_MNT" 2> /dev/null + +testdir="$SCRATCH_MNT/test-$seq" +rm -rf $testdir +mkdir $testdir + +sz=1048576 +echo "Create the original files" +"$XFS_IO_PROG" -f -c "pwrite -S 0x61 -b $sz 0 $sz" "$testdir/file1" >> "$seqres.full" +_cp_reflink "$testdir/file1" "$testdir/file2" >> "$seqres.full" +_cp_reflink "$testdir/file1" "$testdir/file3" >> "$seqres.full" +touch "$testdir/urk" +chown nobody "$testdir/urk" +touch "$testdir/erk" +chown fsgqa "$testdir/erk" +_repquota +_scratch_remount + +echo "Change file ownership" +chown fsgqa "$testdir/file1" +chown fsgqa "$testdir/file2" +chown fsgqa "$testdir/file3" +_repquota + +echo "CoW one of the files" +"$XFS_IO_PROG" -f -c "pwrite -S 0x63 -b $((sz/2)) 0 $((sz/2))" -c "fsync" "$testdir/file2" >> "$seqres.full" +_repquota + +echo "Remount the FS to see if accounting changes" +_scratch_remount +_repquota + +echo "Chown one of the files" +chown nobody "$testdir/file3" +_repquota + +echo "Check for damage" +umount "$SCRATCH_MNT" + +# success, all done +status=0 +exit diff --git a/tests/generic/305.out b/tests/generic/305.out new file mode 100644 index 0000000..2acfe04 --- /dev/null +++ b/tests/generic/305.out @@ -0,0 +1,23 @@ +QA output created by 305 +Format and mount +Create the original files +root -- 3072 0 0 7 0 0 +nobody -- 0 0 0 1 0 0 +fsgqa -- 0 0 0 1 0 0 +Change file ownership +root -- 0 0 0 4 0 0 +nobody -- 0 0 0 1 0 0 +fsgqa -- 3072 0 0 4 0 0 +CoW one of the files +root -- 0 0 0 4 0 0 +nobody -- 0 0 0 1 0 0 +fsgqa -- 3072 0 0 4 0 0 +Remount the FS to see if accounting changes +root -- 0 0 0 4 0 0 +nobody -- 0 0 0 1 0 0 +fsgqa -- 3072 0 0 4 0 0 +Chown one of the files +root -- 0 0 0 4 0 0 +nobody -- 1024 0 0 2 0 0 +fsgqa -- 2048 0 0 3 0 0 +Check for damage diff --git a/tests/generic/326 b/tests/generic/326 new file mode 100755 index 0000000..b71d4bb --- /dev/null +++ b/tests/generic/326 @@ -0,0 +1,105 @@ +#! /bin/bash +# FS QA Test No. 326 +# +# Ensure that quota charges us for reflinking a file and that we're not +# charged for directio copy on write. +# +#----------------------------------------------------------------------- +# Copyright (c) 2016, Oracle and/or its affiliates. All Rights Reserved. +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License as +# published by the Free Software Foundation. +# +# This program is distributed in the hope that it would be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write the Free Software Foundation, +# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA +#----------------------------------------------------------------------- + +seq=`basename "$0"` +seqres="$RESULT_DIR/$seq" +echo "QA output created by $seq" + +here=`pwd` +tmp=/tmp/$$ +status=1 # failure is the default! +trap "_cleanup; exit \$status" 0 1 2 3 15 + +_cleanup() +{ + cd / + #rm -rf "$tmp".* "$testdir" +} + +# get standard environment, filters and checks +. ./common/rc +. ./common/filter +. ./common/reflink +. ./common/quota + +# real QA test starts here +_supported_os Linux +_require_scratch_reflink +_require_cp_reflink +_require_fiemap +_require_quota +_need_to_be_root +_require_nobody + +_repquota() { + repquota "$SCRATCH_MNT" | egrep '^(fsgqa|root|nobody)' +} +rm -f "$seqres.full" + +echo "Format and mount" +_scratch_mkfs > "$seqres.full" 2>&1 +export MOUNT_OPTIONS="-o usrquota,grpquota $MOUNT_OPTIONS" +_scratch_mount >> "$seqres.full" 2>&1 +quotacheck -u -g "$SCRATCH_MNT" 2> /dev/null +quotaon "$SCRATCH_MNT" 2> /dev/null + +testdir="$SCRATCH_MNT/test-$seq" +rm -rf $testdir +mkdir $testdir + +sz=1048576 +echo "Create the original files" +"$XFS_IO_PROG" -f -c "pwrite -S 0x61 -b $sz 0 $sz" "$testdir/file1" >> "$seqres.full" +_cp_reflink "$testdir/file1" "$testdir/file2" >> "$seqres.full" +_cp_reflink "$testdir/file1" "$testdir/file3" >> "$seqres.full" +touch "$testdir/urk" +chown nobody "$testdir/urk" +touch "$testdir/erk" +chown fsgqa "$testdir/erk" +_repquota +_scratch_remount + +echo "Change file ownership" +chown fsgqa "$testdir/file1" +chown fsgqa "$testdir/file2" +chown fsgqa "$testdir/file3" +_repquota + +echo "CoW one of the files" +"$XFS_IO_PROG" -d -f -c "pwrite -S 0x63 -b $((sz/2)) 0 $((sz/2))" -c "fsync" "$testdir/file2" >> "$seqres.full" +_repquota + +echo "Remount the FS to see if accounting changes" +_scratch_remount +_repquota + +echo "Chown one of the files" +chown nobody "$testdir/file3" +_repquota + +echo "Check for damage" +umount "$SCRATCH_MNT" + +# success, all done +status=0 +exit diff --git a/tests/generic/326.out b/tests/generic/326.out new file mode 100644 index 0000000..950d8f8 --- /dev/null +++ b/tests/generic/326.out @@ -0,0 +1,23 @@ +QA output created by 326 +Format and mount +Create the original files +root -- 3072 0 0 7 0 0 +nobody -- 0 0 0 1 0 0 +fsgqa -- 0 0 0 1 0 0 +Change file ownership +root -- 0 0 0 4 0 0 +nobody -- 0 0 0 1 0 0 +fsgqa -- 3072 0 0 4 0 0 +CoW one of the files +root -- 0 0 0 4 0 0 +nobody -- 0 0 0 1 0 0 +fsgqa -- 3072 0 0 4 0 0 +Remount the FS to see if accounting changes +root -- 0 0 0 4 0 0 +nobody -- 0 0 0 1 0 0 +fsgqa -- 3072 0 0 4 0 0 +Chown one of the files +root -- 0 0 0 4 0 0 +nobody -- 1024 0 0 2 0 0 +fsgqa -- 2048 0 0 3 0 0 +Check for damage diff --git a/tests/generic/327 b/tests/generic/327 new file mode 100755 index 0000000..95fa223 --- /dev/null +++ b/tests/generic/327 @@ -0,0 +1,92 @@ +#! /bin/bash +# FS QA Test No. 327 +# +# Ensure that we can't go over the hard block limit when reflinking. +# +#----------------------------------------------------------------------- +# Copyright (c) 2016, Oracle and/or its affiliates. All Rights Reserved. +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License as +# published by the Free Software Foundation. +# +# This program is distributed in the hope that it would be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write the Free Software Foundation, +# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA +#----------------------------------------------------------------------- + +seq=`basename "$0"` +seqres="$RESULT_DIR/$seq" +echo "QA output created by $seq" + +here=`pwd` +tmp=/tmp/$$ +status=1 # failure is the default! +trap "_cleanup; exit \$status" 0 1 2 3 15 + +_cleanup() +{ + cd / + #rm -rf "$tmp".* "$testdir" +} + +# get standard environment, filters and checks +. ./common/rc +. ./common/filter +. ./common/reflink +. ./common/quota + +# real QA test starts here +_supported_os Linux +_require_scratch_reflink +_require_cp_reflink +_require_fiemap +_require_quota +_need_to_be_root +_require_nobody + +_repquota() { + repquota "$SCRATCH_MNT" | egrep '^(fsgqa|root|nobody)' +} +rm -f "$seqres.full" + +echo "Format and mount" +_scratch_mkfs > "$seqres.full" 2>&1 +export MOUNT_OPTIONS="-o usrquota,grpquota $MOUNT_OPTIONS" +_scratch_mount >> "$seqres.full" 2>&1 +quotacheck -u -g "$SCRATCH_MNT" 2> /dev/null +quotaon "$SCRATCH_MNT" 2> /dev/null + +testdir="$SCRATCH_MNT/test-$seq" +rm -rf $testdir +mkdir $testdir + +sz=1048576 +echo "Create the original files" +"$XFS_IO_PROG" -f -c "pwrite -S 0x61 -b $sz 0 $sz" "$testdir/file1" >> "$seqres.full" +chown fsgqa "$testdir/file1" +_cp_reflink "$testdir/file1" "$testdir/file2" >> "$seqres.full" +_repquota +_scratch_remount + +echo "Set hard quota to prevent third reflink" +setquota -u fsgqa 0 1024 0 0 "$SCRATCH_MNT" +_repquota + +echo "Try to reflink again" +touch "$testdir/file3" +chown fsgqa "$testdir/file3" +_cp_reflink "$testdir/file1" "$testdir/file3" 2>&1 | _filter_scratch +_repquota + +echo "Check for damage" +umount "$SCRATCH_MNT" + +# success, all done +status=0 +exit diff --git a/tests/generic/327.out b/tests/generic/327.out new file mode 100644 index 0000000..32e5eab --- /dev/null +++ b/tests/generic/327.out @@ -0,0 +1,13 @@ +QA output created by 327 +Format and mount +Create the original files +root -- 0 0 0 4 0 0 +fsgqa -- 2048 0 0 2 0 0 +Set hard quota to prevent third reflink +root -- 0 0 0 4 0 0 +fsgqa +- 2048 0 1024 2 0 0 +Try to reflink again +cp: failed to clone 'SCRATCH_MNT/test-327/file3' from 'SCRATCH_MNT/test-327/file1': Disk quota exceeded +root -- 0 0 0 4 0 0 +fsgqa +- 2048 0 1024 3 0 0 +Check for damage diff --git a/tests/generic/328 b/tests/generic/328 new file mode 100755 index 0000000..506ca7f --- /dev/null +++ b/tests/generic/328 @@ -0,0 +1,109 @@ +#! /bin/bash +# FS QA Test No. 328 +# +# Ensure that we can't go over the hard block limit when CoWing a file. +# +#----------------------------------------------------------------------- +# Copyright (c) 2016, Oracle and/or its affiliates. All Rights Reserved. +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License as +# published by the Free Software Foundation. +# +# This program is distributed in the hope that it would be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write the Free Software Foundation, +# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA +#----------------------------------------------------------------------- + +seq=`basename "$0"` +seqres="$RESULT_DIR/$seq" +echo "QA output created by $seq" + +here=`pwd` +tmp=/tmp/$$ +status=1 # failure is the default! +trap "_cleanup; exit \$status" 0 1 2 3 15 + +_cleanup() +{ + cd / + #rm -rf "$tmp".* "$testdir" +} + +# get standard environment, filters and checks +. ./common/rc +. ./common/filter +. ./common/reflink +. ./common/quota + +# real QA test starts here +_supported_os Linux +_require_scratch_reflink +_require_cp_reflink +_require_fiemap +_require_quota +_need_to_be_root +_require_nobody + +_repquota() { + repquota "$SCRATCH_MNT" | egrep '^(fsgqa|root|nobody)' +} +rm -f "$seqres.full" + +echo "Format and mount" +_scratch_mkfs > "$seqres.full" 2>&1 +export MOUNT_OPTIONS="-o usrquota,grpquota $MOUNT_OPTIONS" +_scratch_mount >> "$seqres.full" 2>&1 +quotacheck -u -g "$SCRATCH_MNT" 2> /dev/null +quotaon "$SCRATCH_MNT" 2> /dev/null + +testdir="$SCRATCH_MNT/test-$seq" +rm -rf $testdir +mkdir $testdir + +sz=1048576 +echo "Create the original files" +"$XFS_IO_PROG" -f -c "pwrite -S 0x61 -b $sz 0 $sz" "$testdir/file1" >> "$seqres.full" +chown fsgqa "$testdir/file1" +_cp_reflink "$testdir/file1" "$testdir/file2" >> "$seqres.full" +_cp_reflink "$testdir/file1" "$testdir/file3" >> "$seqres.full" +_repquota +_scratch_remount + +echo "Set hard quota to prevent rewrite" +setquota -u fsgqa 0 1024 0 0 "$SCRATCH_MNT" +_repquota + +echo "Try to dio write the whole file" +_pwrite_byte 0x62 0 $sz "$testdir/file1" -d >> "$seqres.full" +_repquota + +echo "Try to write the whole file" +_pwrite_byte 0x62 0 $sz "$testdir/file1" >> "$seqres.full" +_repquota + +echo "Set hard quota to allow rewrite" +setquota -u fsgqa 0 8192 0 0 "$SCRATCH_MNT" +_repquota + +echo "Try to dio write the whole file" +_pwrite_byte 0x62 0 $sz "$testdir/file1" -d >> "$seqres.full" +sync +_repquota + +echo "Try to write the whole file" +_pwrite_byte 0x62 0 $sz "$testdir/file3" >> "$seqres.full" +sync +_repquota + +echo "Check for damage" +umount "$SCRATCH_MNT" + +# success, all done +status=0 +exit diff --git a/tests/generic/328.out b/tests/generic/328.out new file mode 100644 index 0000000..e5dcb67 --- /dev/null +++ b/tests/generic/328.out @@ -0,0 +1,26 @@ +QA output created by 328 +Format and mount +Create the original files +root -- 0 0 0 4 0 0 +fsgqa -- 3072 0 0 3 0 0 +Set hard quota to prevent rewrite +root -- 0 0 0 4 0 0 +fsgqa +- 3072 0 1024 3 0 0 +Try to dio write the whole file +pwrite64: Disk quota exceeded +root -- 0 0 0 4 0 0 +fsgqa +- 3072 0 1024 3 0 0 +Try to write the whole file +pwrite64: Disk quota exceeded +root -- 0 0 0 4 0 0 +fsgqa +- 3072 0 1024 3 0 0 +Set hard quota to allow rewrite +root -- 0 0 0 4 0 0 +fsgqa -- 3072 0 8192 3 0 0 +Try to dio write the whole file +root -- 0 0 0 4 0 0 +fsgqa -- 3072 0 8192 3 0 0 +Try to write the whole file +root -- 0 0 0 4 0 0 +fsgqa -- 3072 0 8192 3 0 0 +Check for damage diff --git a/tests/generic/group b/tests/generic/group index 3229dad..d4531f8 100644 --- a/tests/generic/group +++ b/tests/generic/group @@ -307,6 +307,7 @@ 302 auto quick clone 303 auto quick clone 304 auto quick clone +305 auto quick clone 306 auto quick rw 307 auto quick 308 auto quick @@ -327,3 +328,6 @@ 323 auto aio stress 324 auto fsr quick 325 auto quick data log +326 auto quick clone +327 auto quick clone +328 auto quick clone diff --git a/tests/xfs/213 b/tests/xfs/213 new file mode 100755 index 0000000..7441e78 --- /dev/null +++ b/tests/xfs/213 @@ -0,0 +1,110 @@ +#! /bin/bash +# FS QA Test No. 213 +# +# Ensure that quota charges us for reflnking a file and that we're not +# charged for buffered copy on write. Same test as 822, but we get to +# play with cowextsz. +# +#----------------------------------------------------------------------- +# Copyright (c) 2016, Oracle and/or its affiliates. All Rights Reserved. +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License as +# published by the Free Software Foundation. +# +# This program is distributed in the hope that it would be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write the Free Software Foundation, +# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA +#----------------------------------------------------------------------- + +seq=`basename "$0"` +seqres="$RESULT_DIR/$seq" +echo "QA output created by $seq" + +here=`pwd` +tmp=/tmp/$$ +status=1 # failure is the default! +trap "_cleanup; exit \$status" 0 1 2 3 15 + +_cleanup() +{ + cd / + #rm -rf "$tmp".* "$testdir" +} + +# get standard environment, filters and checks +. ./common/rc +. ./common/filter +. ./common/reflink +. ./common/quota + +# real QA test starts here +_supported_os Linux +_supported_fs xfs +_require_scratch_reflink +_require_cp_reflink +_require_fiemap +_require_quota +_need_to_be_root +_require_nobody +_require_xfs_io_command "cowextsize" + +_repquota() { + repquota "$SCRATCH_MNT" | egrep '^(fsgqa|root|nobody)' +} +rm -f "$seqres.full" + +echo "Format and mount" +_scratch_mkfs > "$seqres.full" 2>&1 +export MOUNT_OPTIONS="-o usrquota,grpquota $MOUNT_OPTIONS" +_scratch_mount >> "$seqres.full" 2>&1 +quotacheck -u -g "$SCRATCH_MNT" 2> /dev/null +quotaon "$SCRATCH_MNT" 2> /dev/null + +testdir="$SCRATCH_MNT/test-$seq" +rm -rf $testdir +mkdir $testdir + +sz=1048576 +blksz=65536 +echo "Create the original files" +"$XFS_IO_PROG" -c "cowextsize $((sz/2))" "$testdir" >> "$seqres.full" +"$XFS_IO_PROG" -f -c "pwrite -S 0x61 -b $sz 0 $sz" "$testdir/file1" >> "$seqres.full" +_cp_reflink "$testdir/file1" "$testdir/file2" >> "$seqres.full" +_cp_reflink "$testdir/file1" "$testdir/file3" >> "$seqres.full" +touch "$testdir/urk" +chown nobody "$testdir/urk" +touch "$testdir/erk" +chown fsgqa "$testdir/erk" +_repquota +_scratch_remount + +echo "Change file ownership" +chown fsgqa "$testdir/file1" +chown fsgqa "$testdir/file2" +chown fsgqa "$testdir/file3" +_repquota + +echo "CoW one of the files" +"$XFS_IO_PROG" -f -c "pwrite -S 0x63 -b $blksz $((sz - blksz)) $blksz" -c "fsync" "$testdir/file2" >> "$seqres.full" +_repquota + +echo "Remount the FS to see if accounting changes" +_scratch_remount +_repquota + +echo "Chown one of the files" +chown nobody "$testdir/file3" +_repquota + +echo "Check for damage" +umount "$SCRATCH_MNT" + +# success, all done +status=0 +exit diff --git a/tests/xfs/213.out b/tests/xfs/213.out new file mode 100644 index 0000000..0028bd1 --- /dev/null +++ b/tests/xfs/213.out @@ -0,0 +1,23 @@ +QA output created by 213 +Format and mount +Create the original files +root -- 3072 0 0 7 0 0 +nobody -- 0 0 0 1 0 0 +fsgqa -- 0 0 0 1 0 0 +Change file ownership +root -- 0 0 0 4 0 0 +nobody -- 0 0 0 1 0 0 +fsgqa -- 3072 0 0 4 0 0 +CoW one of the files +root -- 0 0 0 4 0 0 +nobody -- 0 0 0 1 0 0 +fsgqa -- 3520 0 0 4 0 0 +Remount the FS to see if accounting changes +root -- 0 0 0 4 0 0 +nobody -- 0 0 0 1 0 0 +fsgqa -- 3072 0 0 4 0 0 +Chown one of the files +root -- 0 0 0 4 0 0 +nobody -- 1024 0 0 2 0 0 +fsgqa -- 2048 0 0 3 0 0 +Check for damage diff --git a/tests/xfs/214 b/tests/xfs/214 new file mode 100755 index 0000000..0cfd69b --- /dev/null +++ b/tests/xfs/214 @@ -0,0 +1,109 @@ +#! /bin/bash +# FS QA Test No. 214 +# +# Ensure that quota charges us for reflnking a file and that we're not +# charged for directio copy on write. +# +#----------------------------------------------------------------------- +# Copyright (c) 2016, Oracle and/or its affiliates. All Rights Reserved. +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License as +# published by the Free Software Foundation. +# +# This program is distributed in the hope that it would be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write the Free Software Foundation, +# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA +#----------------------------------------------------------------------- + +seq=`basename "$0"` +seqres="$RESULT_DIR/$seq" +echo "QA output created by $seq" + +here=`pwd` +tmp=/tmp/$$ +status=1 # failure is the default! +trap "_cleanup; exit \$status" 0 1 2 3 15 + +_cleanup() +{ + cd / + #rm -rf "$tmp".* "$testdir" +} + +# get standard environment, filters and checks +. ./common/rc +. ./common/filter +. ./common/reflink +. ./common/quota + +# real QA test starts here +_supported_os Linux +_supported_fs xfs +_require_scratch_reflink +_require_cp_reflink +_require_fiemap +_require_quota +_need_to_be_root +_require_nobody +_require_xfs_io_command "cowextsize" + +_repquota() { + repquota "$SCRATCH_MNT" | egrep '^(fsgqa|root|nobody)' +} +rm -f "$seqres.full" + +echo "Format and mount" +_scratch_mkfs > "$seqres.full" 2>&1 +export MOUNT_OPTIONS="-o usrquota,grpquota $MOUNT_OPTIONS" +_scratch_mount >> "$seqres.full" 2>&1 +quotacheck -u -g "$SCRATCH_MNT" 2> /dev/null +quotaon "$SCRATCH_MNT" 2> /dev/null + +testdir="$SCRATCH_MNT/test-$seq" +rm -rf $testdir +mkdir $testdir + +sz=1048576 +blksz=65536 +echo "Create the original files" +"$XFS_IO_PROG" -c "cowextsize $((sz/2))" "$testdir" >> "$seqres.full" +"$XFS_IO_PROG" -f -c "pwrite -S 0x61 -b $sz 0 $sz" "$testdir/file1" >> "$seqres.full" +_cp_reflink "$testdir/file1" "$testdir/file2" >> "$seqres.full" +_cp_reflink "$testdir/file1" "$testdir/file3" >> "$seqres.full" +touch "$testdir/urk" +chown nobody "$testdir/urk" +touch "$testdir/erk" +chown fsgqa "$testdir/erk" +_repquota +_scratch_remount + +echo "Change file ownership" +chown fsgqa "$testdir/file1" +chown fsgqa "$testdir/file2" +chown fsgqa "$testdir/file3" +_repquota + +echo "CoW one of the files" +"$XFS_IO_PROG" -d -f -c "pwrite -S 0x63 -b $blksz $((sz - blksz)) $blksz" -c "fsync" "$testdir/file2" >> "$seqres.full" +_repquota + +echo "Remount the FS to see if accounting changes" +_scratch_remount +_repquota + +echo "Chown one of the files" +chown nobody "$testdir/file3" +_repquota + +echo "Check for damage" +umount "$SCRATCH_MNT" + +# success, all done +status=0 +exit diff --git a/tests/xfs/214.out b/tests/xfs/214.out new file mode 100644 index 0000000..8f6bb0f --- /dev/null +++ b/tests/xfs/214.out @@ -0,0 +1,23 @@ +QA output created by 214 +Format and mount +Create the original files +root -- 3072 0 0 7 0 0 +nobody -- 0 0 0 1 0 0 +fsgqa -- 0 0 0 1 0 0 +Change file ownership +root -- 0 0 0 4 0 0 +nobody -- 0 0 0 1 0 0 +fsgqa -- 3072 0 0 4 0 0 +CoW one of the files +root -- 0 0 0 4 0 0 +nobody -- 0 0 0 1 0 0 +fsgqa -- 3520 0 0 4 0 0 +Remount the FS to see if accounting changes +root -- 0 0 0 4 0 0 +nobody -- 0 0 0 1 0 0 +fsgqa -- 3072 0 0 4 0 0 +Chown one of the files +root -- 0 0 0 4 0 0 +nobody -- 1024 0 0 2 0 0 +fsgqa -- 2048 0 0 3 0 0 +Check for damage diff --git a/tests/xfs/group b/tests/xfs/group index d4a0d59..afd960f 100644 --- a/tests/xfs/group +++ b/tests/xfs/group @@ -210,6 +210,8 @@ 210 auto quick clone 211 clone_stress 212 auto quick clone +213 auto quick clone +214 auto quick clone 216 log metadata auto quick 217 log metadata auto 220 auto quota quick From darrick.wong@oracle.com Mon Feb 8 19:13:47 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay1.corp.sgi.com [137.38.102.111]) by oss.sgi.com (Postfix) with ESMTP id 095D77CA4 for ; Mon, 8 Feb 2016 19:13:47 -0600 (CST) Received: from cuda.sgi.com (cuda1.sgi.com [192.48.157.11]) by relay1.corp.sgi.com (Postfix) with ESMTP id B4FAC8F804C for ; Mon, 8 Feb 2016 17:13:46 -0800 (PST) X-ASG-Debug-ID: 1454980419-04bdf066ed03b40001-NocioJ Received: from userp1040.oracle.com (userp1040.oracle.com [156.151.31.81]) by cuda.sgi.com with ESMTP id XcrbigL8nNojMydt (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO) for ; Mon, 08 Feb 2016 17:13:40 -0800 (PST) X-Barracuda-Envelope-From: darrick.wong@oracle.com X-Barracuda-Apparent-Source-IP: 156.151.31.81 Received: from userv0021.oracle.com (userv0021.oracle.com [156.151.31.71]) by userp1040.oracle.com (Sentrion-MTA-4.3.2/Sentrion-MTA-4.3.2) with ESMTP id u191DcN6015621 (version=TLSv1 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Tue, 9 Feb 2016 01:13:38 GMT Received: from aserv0121.oracle.com (aserv0121.oracle.com [141.146.126.235]) by userv0021.oracle.com (8.13.8/8.13.8) with ESMTP id u191DbJQ018012 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=FAIL); Tue, 9 Feb 2016 01:13:38 GMT Received: from abhmp0013.oracle.com (abhmp0013.oracle.com [141.146.116.19]) by aserv0121.oracle.com (8.13.8/8.13.8) with ESMTP id u191DbEj027892; Tue, 9 Feb 2016 01:13:37 GMT Received: from localhost (/10.145.178.207) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Mon, 08 Feb 2016 17:13:37 -0800 Subject: [PATCH 17/23] reflink: test CoW across a mixed range of block types with cowextsize set From: "Darrick J. Wong" X-ASG-Orig-Subj: [PATCH 17/23] reflink: test CoW across a mixed range of block types with cowextsize set To: david@fromorbit.com, darrick.wong@oracle.com Cc: linux-btrfs@vger.kernel.org, fstests@vger.kernel.org, xfs@oss.sgi.com Date: Mon, 08 Feb 2016 17:13:35 -0800 Message-ID: <20160209011335.23099.47260.stgit@birch.djwong.org> In-Reply-To: <20160209011145.23099.95354.stgit@birch.djwong.org> References: <20160209011145.23099.95354.stgit@birch.djwong.org> User-Agent: StGit/0.17.1-dirty MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit X-Source-IP: userv0021.oracle.com [156.151.31.71] X-Barracuda-Connect: userp1040.oracle.com[156.151.31.81] X-Barracuda-Start-Time: 1454980419 X-Barracuda-Encrypted: ECDHE-RSA-AES256-GCM-SHA384 X-Barracuda-URL: https://192.48.157.11:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-BRTS-Status: 1 X-Barracuda-Spam-Score: 0.00 X-Barracuda-Spam-Status: No, SCORE=0.00 using per-user scores of TAG_LEVEL=1000.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.7 tests=BSF_SC0_MISMATCH_TO, UNPARSEABLE_RELAY X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.3.26874 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 0.00 BSF_SC0_MISMATCH_TO Envelope rcpt doesn't match header 0.00 UNPARSEABLE_RELAY Informational: message has unparseable relay lines Signed-off-by: Darrick J. Wong --- tests/xfs/215 | 108 ++++++++++++++++++++++++++++++++++++++++++ tests/xfs/215.out | 14 +++++ tests/xfs/218 | 108 ++++++++++++++++++++++++++++++++++++++++++ tests/xfs/218.out | 14 +++++ tests/xfs/219 | 108 ++++++++++++++++++++++++++++++++++++++++++ tests/xfs/219.out | 14 +++++ tests/xfs/221 | 108 ++++++++++++++++++++++++++++++++++++++++++ tests/xfs/221.out | 14 +++++ tests/xfs/223 | 113 ++++++++++++++++++++++++++++++++++++++++++++ tests/xfs/223.out | 14 +++++ tests/xfs/224 | 113 ++++++++++++++++++++++++++++++++++++++++++++ tests/xfs/224.out | 14 +++++ tests/xfs/225 | 108 ++++++++++++++++++++++++++++++++++++++++++ tests/xfs/225.out | 14 +++++ tests/xfs/226 | 108 ++++++++++++++++++++++++++++++++++++++++++ tests/xfs/226.out | 14 +++++ tests/xfs/228 | 137 +++++++++++++++++++++++++++++++++++++++++++++++++++++ tests/xfs/228.out | 14 +++++ tests/xfs/230 | 137 +++++++++++++++++++++++++++++++++++++++++++++++++++++ tests/xfs/230.out | 14 +++++ tests/xfs/group | 10 ++++ 21 files changed, 1298 insertions(+) create mode 100755 tests/xfs/215 create mode 100644 tests/xfs/215.out create mode 100755 tests/xfs/218 create mode 100644 tests/xfs/218.out create mode 100755 tests/xfs/219 create mode 100644 tests/xfs/219.out create mode 100755 tests/xfs/221 create mode 100644 tests/xfs/221.out create mode 100755 tests/xfs/223 create mode 100644 tests/xfs/223.out create mode 100755 tests/xfs/224 create mode 100644 tests/xfs/224.out create mode 100755 tests/xfs/225 create mode 100644 tests/xfs/225.out create mode 100755 tests/xfs/226 create mode 100644 tests/xfs/226.out create mode 100755 tests/xfs/228 create mode 100644 tests/xfs/228.out create mode 100755 tests/xfs/230 create mode 100644 tests/xfs/230.out diff --git a/tests/xfs/215 b/tests/xfs/215 new file mode 100755 index 0000000..8dd5cb5 --- /dev/null +++ b/tests/xfs/215 @@ -0,0 +1,108 @@ +#! /bin/bash +# FS QA Test No. 215 +# +# Ensuring that copy on write in direct-io mode works when the CoW +# range originally covers multiple extents, some unwritten, some not. +# - Set cowextsize hint. +# - Create a file and fallocate a second file. +# - Reflink the odd blocks of the first file into the second file. +# - directio CoW across the halfway mark, starting with the unwritten extent. +# - Check that the files are now different where we say they're different. +# +#----------------------------------------------------------------------- +# Copyright (c) 2016, Oracle and/or its affiliates. All Rights Reserved. +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License as +# published by the Free Software Foundation. +# +# This program is distributed in the hope that it would be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write the Free Software Foundation, +# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA +#----------------------------------------------------------------------- + +seq=`basename "$0"` +seqres="$RESULT_DIR/$seq" +echo "QA output created by $seq" + +here=`pwd` +tmp=/tmp/$$ +status=1 # failure is the default! +trap "_cleanup; exit \$status" 0 1 2 3 15 + +_cleanup() +{ + cd / + rm -rf "$tmp".* +} + +# get standard environment, filters and checks +. ./common/rc +. ./common/filter +. ./common/reflink + +# real QA test starts here +_supported_os Linux +_require_scratch_reflink +_require_xfs_io_command "falloc" + +rm -f "$seqres.full" + +echo "Format and mount" +_scratch_mkfs > "$seqres.full" 2>&1 +_scratch_mount >> "$seqres.full" 2>&1 + +testdir="$SCRATCH_MNT/test-$seq" +rm -rf $testdir +mkdir $testdir + +echo "Create the original files" +blksz=65536 +nr=64 +real_blksz=$(stat -f -c '%S' "$testdir") +internal_blks=$((blksz * nr / real_blksz)) +"$XFS_IO_PROG" -c "cowextsize $((blksz * 16))" "$testdir" >> "$seqres.full" +_pwrite_byte 0x61 0 $((blksz * nr)) "$testdir/file1" >> "$seqres.full" +$XFS_IO_PROG -f -c "falloc 0 $((blksz * nr))" "$testdir/file3" >> "$seqres.full" +_pwrite_byte 0x00 0 $((blksz * nr)) "$testdir/file3.chk" >> "$seqres.full" +seq 0 2 $((nr-1)) | while read f; do + _reflink_range "$testdir/file1" $((blksz * f)) "$testdir/file3" $((blksz * f)) $blksz >> "$seqres.full" + _pwrite_byte 0x61 $((blksz * f)) $blksz "$testdir/file3.chk" >> "$seqres.full" +done +_scratch_remount + +echo "Compare files" +md5sum "$testdir/file1" | _filter_scratch +md5sum "$testdir/file3" | _filter_scratch +md5sum "$testdir/file3.chk" | _filter_scratch + +echo "directio CoW across the transition" +"$XFS_IO_PROG" -d -f -c "pwrite -S 0x63 -b $((blksz * nr / 2)) $((blksz * nr / 4)) $((blksz * nr / 2))" "$testdir/file3" >> "$seqres.full" +_pwrite_byte 0x63 $((blksz * nr / 4)) $((blksz * nr / 2)) "$testdir/file3.chk" >> "$seqres.full" +_scratch_remount + +echo "Compare files" +md5sum "$testdir/file1" | _filter_scratch +md5sum "$testdir/file3" | _filter_scratch +md5sum "$testdir/file3.chk" | _filter_scratch + +echo "Check extent counts" +old_extents=$(_count_extents "$testdir/file1") +new_extents=$(_count_extents "$testdir/file3") + +echo "old extents: $old_extents" >> "$seqres.full" +echo "new extents: $new_extents" >> "$seqres.full" +echo "maximum extents: $internal_blks" >> "$seqres.full" +test $new_extents -lt $((internal_blks / 20)) || _fail "file3 badly fragmented" + +echo "Check for damage" +umount "$SCRATCH_MNT" + +# success, all done +status=0 +exit diff --git a/tests/xfs/215.out b/tests/xfs/215.out new file mode 100644 index 0000000..5412722 --- /dev/null +++ b/tests/xfs/215.out @@ -0,0 +1,14 @@ +QA output created by 215 +Format and mount +Create the original files +Compare files +bdbcf02ee0aa977795a79d25fcfdccb1 SCRATCH_MNT/test-215/file1 +fa50dba51826899c372464a153cb2117 SCRATCH_MNT/test-215/file3 +fa50dba51826899c372464a153cb2117 SCRATCH_MNT/test-215/file3.chk +directio CoW across the transition +Compare files +bdbcf02ee0aa977795a79d25fcfdccb1 SCRATCH_MNT/test-215/file1 +09101629908f9bdd5d178e7ce20bb1bb SCRATCH_MNT/test-215/file3 +09101629908f9bdd5d178e7ce20bb1bb SCRATCH_MNT/test-215/file3.chk +Check extent counts +Check for damage diff --git a/tests/xfs/218 b/tests/xfs/218 new file mode 100755 index 0000000..fb61652 --- /dev/null +++ b/tests/xfs/218 @@ -0,0 +1,108 @@ +#! /bin/bash +# FS QA Test No. 218 +# +# Ensuring that copy on write in buffered mode works when the CoW +# range originally covers multiple extents, some unwritten, some not. +# - Set cowextsize hint. +# - Create a file and fallocate a second file. +# - Reflink the odd blocks of the first file into the second file. +# - CoW across the halfway mark, starting with the unwritten extent. +# - Check that the files are now different where we say they're different. +# +#----------------------------------------------------------------------- +# Copyright (c) 2016, Oracle and/or its affiliates. All Rights Reserved. +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License as +# published by the Free Software Foundation. +# +# This program is distributed in the hope that it would be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write the Free Software Foundation, +# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA +#----------------------------------------------------------------------- + +seq=`basename "$0"` +seqres="$RESULT_DIR/$seq" +echo "QA output created by $seq" + +here=`pwd` +tmp=/tmp/$$ +status=1 # failure is the default! +trap "_cleanup; exit \$status" 0 1 2 3 15 + +_cleanup() +{ + cd / + rm -rf "$tmp".* +} + +# get standard environment, filters and checks +. ./common/rc +. ./common/filter +. ./common/reflink + +# real QA test starts here +_supported_os Linux +_require_scratch_reflink +_require_xfs_io_command "falloc" + +rm -f "$seqres.full" + +echo "Format and mount" +_scratch_mkfs > "$seqres.full" 2>&1 +_scratch_mount >> "$seqres.full" 2>&1 + +testdir="$SCRATCH_MNT/test-$seq" +rm -rf $testdir +mkdir $testdir + +echo "Create the original files" +blksz=65536 +nr=64 +real_blksz=$(stat -f -c '%S' "$testdir") +internal_blks=$((blksz * nr / real_blksz)) +"$XFS_IO_PROG" -c "cowextsize $((blksz * 16))" "$testdir" >> "$seqres.full" +_pwrite_byte 0x61 0 $((blksz * nr)) "$testdir/file1" >> "$seqres.full" +$XFS_IO_PROG -f -c "falloc 0 $((blksz * nr))" "$testdir/file3" >> "$seqres.full" +_pwrite_byte 0x00 0 $((blksz * nr)) "$testdir/file3.chk" >> "$seqres.full" +seq 0 2 $((nr-1)) | while read f; do + _reflink_range "$testdir/file1" $((blksz * f)) "$testdir/file3" $((blksz * f)) $blksz >> "$seqres.full" + _pwrite_byte 0x61 $((blksz * f)) $blksz "$testdir/file3.chk" >> "$seqres.full" +done +_scratch_remount + +echo "Compare files" +md5sum "$testdir/file1" | _filter_scratch +md5sum "$testdir/file3" | _filter_scratch +md5sum "$testdir/file3.chk" | _filter_scratch + +echo "CoW across the transition" +"$XFS_IO_PROG" -f -c "pwrite -S 0x63 -b $((blksz * nr / 2)) $((blksz * nr / 4)) $((blksz * nr / 2))" "$testdir/file3" >> "$seqres.full" +_pwrite_byte 0x63 $((blksz * nr / 4)) $((blksz * nr / 2)) "$testdir/file3.chk" >> "$seqres.full" +_scratch_remount + +echo "Compare files" +md5sum "$testdir/file1" | _filter_scratch +md5sum "$testdir/file3" | _filter_scratch +md5sum "$testdir/file3.chk" | _filter_scratch + +echo "Check extent counts" +old_extents=$(_count_extents "$testdir/file1") +new_extents=$(_count_extents "$testdir/file3") + +echo "old extents: $old_extents" >> "$seqres.full" +echo "new extents: $new_extents" >> "$seqres.full" +echo "maximum extents: $internal_blks" >> "$seqres.full" +test $new_extents -lt $((internal_blks / 20)) || _fail "file3 badly fragmented" + +echo "Check for damage" +umount "$SCRATCH_MNT" + +# success, all done +status=0 +exit diff --git a/tests/xfs/218.out b/tests/xfs/218.out new file mode 100644 index 0000000..4b70fb9 --- /dev/null +++ b/tests/xfs/218.out @@ -0,0 +1,14 @@ +QA output created by 218 +Format and mount +Create the original files +Compare files +bdbcf02ee0aa977795a79d25fcfdccb1 SCRATCH_MNT/test-218/file1 +fa50dba51826899c372464a153cb2117 SCRATCH_MNT/test-218/file3 +fa50dba51826899c372464a153cb2117 SCRATCH_MNT/test-218/file3.chk +CoW across the transition +Compare files +bdbcf02ee0aa977795a79d25fcfdccb1 SCRATCH_MNT/test-218/file1 +09101629908f9bdd5d178e7ce20bb1bb SCRATCH_MNT/test-218/file3 +09101629908f9bdd5d178e7ce20bb1bb SCRATCH_MNT/test-218/file3.chk +Check extent counts +Check for damage diff --git a/tests/xfs/219 b/tests/xfs/219 new file mode 100755 index 0000000..df3a3b4 --- /dev/null +++ b/tests/xfs/219 @@ -0,0 +1,108 @@ +#! /bin/bash +# FS QA Test No. 219 +# +# Ensuring that copy on write in direct-io mode works when the CoW +# range originally covers multiple extents, some holes, some not. +# - Set cowextsize hint. +# - Create a file and truncate a second file. +# - Reflink the odd blocks of the first file into the second file. +# - directio CoW across the halfway mark, starting with the unwritten extent. +# - Check that the files are now different where we say they're different. +# +#----------------------------------------------------------------------- +# Copyright (c) 2016, Oracle and/or its affiliates. All Rights Reserved. +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License as +# published by the Free Software Foundation. +# +# This program is distributed in the hope that it would be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write the Free Software Foundation, +# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA +#----------------------------------------------------------------------- + +seq=`basename "$0"` +seqres="$RESULT_DIR/$seq" +echo "QA output created by $seq" + +here=`pwd` +tmp=/tmp/$$ +status=1 # failure is the default! +trap "_cleanup; exit \$status" 0 1 2 3 15 + +_cleanup() +{ + cd / + rm -rf "$tmp".* +} + +# get standard environment, filters and checks +. ./common/rc +. ./common/filter +. ./common/reflink + +# real QA test starts here +_supported_os Linux +_require_scratch_reflink +_require_xfs_io_command "falloc" + +rm -f "$seqres.full" + +echo "Format and mount" +_scratch_mkfs > "$seqres.full" 2>&1 +_scratch_mount >> "$seqres.full" 2>&1 + +testdir="$SCRATCH_MNT/test-$seq" +rm -rf $testdir +mkdir $testdir + +echo "Create the original files" +blksz=65536 +nr=64 +real_blksz=$(stat -f -c '%S' "$testdir") +internal_blks=$((blksz * nr / real_blksz)) +"$XFS_IO_PROG" -c "cowextsize $((blksz * 16))" "$testdir" >> "$seqres.full" +_pwrite_byte 0x61 0 $((blksz * nr)) "$testdir/file1" >> "$seqres.full" +$XFS_IO_PROG -f -c "truncate $((blksz * nr))" "$testdir/file3" >> "$seqres.full" +_pwrite_byte 0x00 0 $((blksz * nr)) "$testdir/file3.chk" >> "$seqres.full" +seq 0 2 $((nr-1)) | while read f; do + _reflink_range "$testdir/file1" $((blksz * f)) "$testdir/file3" $((blksz * f)) $blksz >> "$seqres.full" + _pwrite_byte 0x61 $((blksz * f)) $blksz "$testdir/file3.chk" >> "$seqres.full" +done +_scratch_remount + +echo "Compare files" +md5sum "$testdir/file1" | _filter_scratch +md5sum "$testdir/file3" | _filter_scratch +md5sum "$testdir/file3.chk" | _filter_scratch + +echo "directio CoW across the transition" +"$XFS_IO_PROG" -d -f -c "pwrite -S 0x63 -b $((blksz * nr / 2)) $((blksz * nr / 4)) $((blksz * nr / 2))" "$testdir/file3" >> "$seqres.full" +_pwrite_byte 0x63 $((blksz * nr / 4)) $((blksz * nr / 2)) "$testdir/file3.chk" >> "$seqres.full" +_scratch_remount + +echo "Compare files" +md5sum "$testdir/file1" | _filter_scratch +md5sum "$testdir/file3" | _filter_scratch +md5sum "$testdir/file3.chk" | _filter_scratch + +echo "Check extent counts" +old_extents=$(_count_extents "$testdir/file1") +new_extents=$(_count_extents "$testdir/file3") + +echo "old extents: $old_extents" >> "$seqres.full" +echo "new extents: $new_extents" >> "$seqres.full" +echo "maximum extents: $internal_blks" >> "$seqres.full" +test $new_extents -lt $((internal_blks / 20)) || _fail "file3 badly fragmented" + +echo "Check for damage" +umount "$SCRATCH_MNT" + +# success, all done +status=0 +exit diff --git a/tests/xfs/219.out b/tests/xfs/219.out new file mode 100644 index 0000000..b6fc64b --- /dev/null +++ b/tests/xfs/219.out @@ -0,0 +1,14 @@ +QA output created by 219 +Format and mount +Create the original files +Compare files +bdbcf02ee0aa977795a79d25fcfdccb1 SCRATCH_MNT/test-219/file1 +fa50dba51826899c372464a153cb2117 SCRATCH_MNT/test-219/file3 +fa50dba51826899c372464a153cb2117 SCRATCH_MNT/test-219/file3.chk +directio CoW across the transition +Compare files +bdbcf02ee0aa977795a79d25fcfdccb1 SCRATCH_MNT/test-219/file1 +09101629908f9bdd5d178e7ce20bb1bb SCRATCH_MNT/test-219/file3 +09101629908f9bdd5d178e7ce20bb1bb SCRATCH_MNT/test-219/file3.chk +Check extent counts +Check for damage diff --git a/tests/xfs/221 b/tests/xfs/221 new file mode 100755 index 0000000..298ecdf --- /dev/null +++ b/tests/xfs/221 @@ -0,0 +1,108 @@ +#! /bin/bash +# FS QA Test No. 221 +# +# Ensuring that copy on write in buffered mode works when the CoW +# range originally covers multiple extents, some holes, some not. +# - Set cowextsize hint. +# - Create a file and truncate a second file. +# - Reflink the odd blocks of the first file into the second file. +# - CoW across the halfway mark, starting with the unwritten extent. +# - Check that the files are now different where we say they're different. +# +#----------------------------------------------------------------------- +# Copyright (c) 2016, Oracle and/or its affiliates. All Rights Reserved. +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License as +# published by the Free Software Foundation. +# +# This program is distributed in the hope that it would be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write the Free Software Foundation, +# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA +#----------------------------------------------------------------------- + +seq=`basename "$0"` +seqres="$RESULT_DIR/$seq" +echo "QA output created by $seq" + +here=`pwd` +tmp=/tmp/$$ +status=1 # failure is the default! +trap "_cleanup; exit \$status" 0 1 2 3 15 + +_cleanup() +{ + cd / + rm -rf "$tmp".* +} + +# get standard environment, filters and checks +. ./common/rc +. ./common/filter +. ./common/reflink + +# real QA test starts here +_supported_os Linux +_require_scratch_reflink +_require_xfs_io_command "falloc" + +rm -f "$seqres.full" + +echo "Format and mount" +_scratch_mkfs > "$seqres.full" 2>&1 +_scratch_mount >> "$seqres.full" 2>&1 + +testdir="$SCRATCH_MNT/test-$seq" +rm -rf $testdir +mkdir $testdir + +echo "Create the original files" +blksz=65536 +nr=64 +real_blksz=$(stat -f -c '%S' "$testdir") +internal_blks=$((blksz * nr / real_blksz)) +"$XFS_IO_PROG" -c "cowextsize $((blksz * 16))" "$testdir" >> "$seqres.full" +_pwrite_byte 0x61 0 $((blksz * nr)) "$testdir/file1" >> "$seqres.full" +$XFS_IO_PROG -f -c "truncate $((blksz * nr))" "$testdir/file3" >> "$seqres.full" +_pwrite_byte 0x00 0 $((blksz * nr)) "$testdir/file3.chk" >> "$seqres.full" +seq 0 2 $((nr-1)) | while read f; do + _reflink_range "$testdir/file1" $((blksz * f)) "$testdir/file3" $((blksz * f)) $blksz >> "$seqres.full" + _pwrite_byte 0x61 $((blksz * f)) $blksz "$testdir/file3.chk" >> "$seqres.full" +done +_scratch_remount + +echo "Compare files" +md5sum "$testdir/file1" | _filter_scratch +md5sum "$testdir/file3" | _filter_scratch +md5sum "$testdir/file3.chk" | _filter_scratch + +echo "CoW across the transition" +"$XFS_IO_PROG" -f -c "pwrite -S 0x63 -b $((blksz * nr / 2)) $((blksz * nr / 4)) $((blksz * nr / 2))" "$testdir/file3" >> "$seqres.full" +_pwrite_byte 0x63 $((blksz * nr / 4)) $((blksz * nr / 2)) "$testdir/file3.chk" >> "$seqres.full" +_scratch_remount + +echo "Compare files" +md5sum "$testdir/file1" | _filter_scratch +md5sum "$testdir/file3" | _filter_scratch +md5sum "$testdir/file3.chk" | _filter_scratch + +echo "Check extent counts" +old_extents=$(_count_extents "$testdir/file1") +new_extents=$(_count_extents "$testdir/file3") + +echo "old extents: $old_extents" >> "$seqres.full" +echo "new extents: $new_extents" >> "$seqres.full" +echo "maximum extents: $internal_blks" >> "$seqres.full" +test $new_extents -lt $((internal_blks / 20)) || _fail "file3 badly fragmented" + +echo "Check for damage" +umount "$SCRATCH_MNT" + +# success, all done +status=0 +exit diff --git a/tests/xfs/221.out b/tests/xfs/221.out new file mode 100644 index 0000000..09ece61 --- /dev/null +++ b/tests/xfs/221.out @@ -0,0 +1,14 @@ +QA output created by 221 +Format and mount +Create the original files +Compare files +bdbcf02ee0aa977795a79d25fcfdccb1 SCRATCH_MNT/test-221/file1 +fa50dba51826899c372464a153cb2117 SCRATCH_MNT/test-221/file3 +fa50dba51826899c372464a153cb2117 SCRATCH_MNT/test-221/file3.chk +CoW across the transition +Compare files +bdbcf02ee0aa977795a79d25fcfdccb1 SCRATCH_MNT/test-221/file1 +09101629908f9bdd5d178e7ce20bb1bb SCRATCH_MNT/test-221/file3 +09101629908f9bdd5d178e7ce20bb1bb SCRATCH_MNT/test-221/file3.chk +Check extent counts +Check for damage diff --git a/tests/xfs/223 b/tests/xfs/223 new file mode 100755 index 0000000..c9903c6 --- /dev/null +++ b/tests/xfs/223 @@ -0,0 +1,113 @@ +#! /bin/bash +# FS QA Test No. 223 +# +# Ensuring that copy on write in direct-io mode works when the CoW +# range originally covers multiple extents, some delalloc, some not. +# - Set cowextsize hint. +# - Create a file. +# - Reflink the odd blocks of the first file into the second file. +# - Buffered write the even blocks of the second file. +# - directio CoW across the halfway mark, starting with the unwritten extent. +# - Check that the files are now different where we say they're different. +# +#----------------------------------------------------------------------- +# Copyright (c) 2016, Oracle and/or its affiliates. All Rights Reserved. +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License as +# published by the Free Software Foundation. +# +# This program is distributed in the hope that it would be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write the Free Software Foundation, +# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA +#----------------------------------------------------------------------- + +seq=`basename "$0"` +seqres="$RESULT_DIR/$seq" +echo "QA output created by $seq" + +here=`pwd` +tmp=/tmp/$$ +status=1 # failure is the default! +trap "_cleanup; exit \$status" 0 1 2 3 15 + +_cleanup() +{ + cd / + rm -rf "$tmp".* +} + +# get standard environment, filters and checks +. ./common/rc +. ./common/filter +. ./common/reflink + +# real QA test starts here +_supported_os Linux +_require_scratch_reflink +_require_xfs_io_command "falloc" + +rm -f "$seqres.full" + +echo "Format and mount" +_scratch_mkfs > "$seqres.full" 2>&1 +_scratch_mount >> "$seqres.full" 2>&1 + +testdir="$SCRATCH_MNT/test-$seq" +rm -rf $testdir +mkdir $testdir + +echo "Create the original files" +blksz=65536 +nr=64 +real_blksz=$(stat -f -c '%S' "$testdir") +internal_blks=$((blksz * nr / real_blksz)) +"$XFS_IO_PROG" -c "cowextsize $((blksz * 16))" "$testdir" >> "$seqres.full" +_pwrite_byte 0x61 0 $((blksz * nr)) "$testdir/file1" >> "$seqres.full" +$XFS_IO_PROG -f -c "truncate $((blksz * nr))" "$testdir/file3" >> "$seqres.full" +_pwrite_byte 0x00 0 $((blksz * nr)) "$testdir/file3.chk" >> "$seqres.full" +seq 0 2 $((nr-1)) | while read f; do + _reflink_range "$testdir/file1" $((blksz * f)) "$testdir/file3" $((blksz * f)) $blksz >> "$seqres.full" + _pwrite_byte 0x61 $((blksz * f)) $blksz "$testdir/file3.chk" >> "$seqres.full" +done +_scratch_remount + +echo "Compare files" +md5sum "$testdir/file1" | _filter_scratch +md5sum "$testdir/file3" | _filter_scratch +md5sum "$testdir/file3.chk" | _filter_scratch + +echo "directio CoW across the transition" +seq 1 2 $((nr-1)) | while read f; do + _pwrite_byte 0x62 $((blksz * f)) $blksz "$testdir/file3" >> "$seqres.full" + _pwrite_byte 0x62 $((blksz * f)) $blksz "$testdir/file3.chk" >> "$seqres.full" +done +"$XFS_IO_PROG" -d -f -c "pwrite -S 0x63 -b $((blksz * nr / 2)) $((blksz * nr / 4)) $((blksz * nr / 2))" "$testdir/file3" >> "$seqres.full" +_pwrite_byte 0x63 $((blksz * nr / 4)) $((blksz * nr / 2)) "$testdir/file3.chk" >> "$seqres.full" +_scratch_remount + +echo "Compare files" +md5sum "$testdir/file1" | _filter_scratch +md5sum "$testdir/file3" | _filter_scratch +md5sum "$testdir/file3.chk" | _filter_scratch + +echo "Check extent counts" +old_extents=$(_count_extents "$testdir/file1") +new_extents=$(_count_extents "$testdir/file3") + +echo "old extents: $old_extents" >> "$seqres.full" +echo "new extents: $new_extents" >> "$seqres.full" +echo "maximum extents: $internal_blks" >> "$seqres.full" +test $new_extents -lt $((internal_blks / 20)) || _fail "file3 badly fragmented" + +echo "Check for damage" +umount "$SCRATCH_MNT" + +# success, all done +status=0 +exit diff --git a/tests/xfs/223.out b/tests/xfs/223.out new file mode 100644 index 0000000..4454fd8 --- /dev/null +++ b/tests/xfs/223.out @@ -0,0 +1,14 @@ +QA output created by 223 +Format and mount +Create the original files +Compare files +bdbcf02ee0aa977795a79d25fcfdccb1 SCRATCH_MNT/test-223/file1 +fa50dba51826899c372464a153cb2117 SCRATCH_MNT/test-223/file3 +fa50dba51826899c372464a153cb2117 SCRATCH_MNT/test-223/file3.chk +directio CoW across the transition +Compare files +bdbcf02ee0aa977795a79d25fcfdccb1 SCRATCH_MNT/test-223/file1 +55968a95dfc0120df4e8485576514320 SCRATCH_MNT/test-223/file3 +55968a95dfc0120df4e8485576514320 SCRATCH_MNT/test-223/file3.chk +Check extent counts +Check for damage diff --git a/tests/xfs/224 b/tests/xfs/224 new file mode 100755 index 0000000..cff8f5b --- /dev/null +++ b/tests/xfs/224 @@ -0,0 +1,113 @@ +#! /bin/bash +# FS QA Test No. 224 +# +# Ensuring that copy on write in buffered mode works when the CoW +# range originally covers multiple extents, some delalloc, some not. +# - Set cowextsize hint. +# - Create a file. +# - Reflink the odd blocks of the first file into the second file. +# - Buffered write the even blocks of the second file. +# - CoW across the halfway mark, starting with the unwritten extent. +# - Check that the files are now different where we say they're different. +# +#----------------------------------------------------------------------- +# Copyright (c) 2016, Oracle and/or its affiliates. All Rights Reserved. +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License as +# published by the Free Software Foundation. +# +# This program is distributed in the hope that it would be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write the Free Software Foundation, +# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA +#----------------------------------------------------------------------- + +seq=`basename "$0"` +seqres="$RESULT_DIR/$seq" +echo "QA output created by $seq" + +here=`pwd` +tmp=/tmp/$$ +status=1 # failure is the default! +trap "_cleanup; exit \$status" 0 1 2 3 15 + +_cleanup() +{ + cd / + rm -rf "$tmp".* +} + +# get standard environment, filters and checks +. ./common/rc +. ./common/filter +. ./common/reflink + +# real QA test starts here +_supported_os Linux +_require_scratch_reflink +_require_xfs_io_command "falloc" + +rm -f "$seqres.full" + +echo "Format and mount" +_scratch_mkfs > "$seqres.full" 2>&1 +_scratch_mount >> "$seqres.full" 2>&1 + +testdir="$SCRATCH_MNT/test-$seq" +rm -rf $testdir +mkdir $testdir + +echo "Create the original files" +blksz=65536 +nr=64 +real_blksz=$(stat -f -c '%S' "$testdir") +internal_blks=$((blksz * nr / real_blksz)) +"$XFS_IO_PROG" -c "cowextsize $((blksz * 16))" "$testdir" >> "$seqres.full" +_pwrite_byte 0x61 0 $((blksz * nr)) "$testdir/file1" >> "$seqres.full" +$XFS_IO_PROG -f -c "truncate $((blksz * nr))" "$testdir/file3" >> "$seqres.full" +_pwrite_byte 0x00 0 $((blksz * nr)) "$testdir/file3.chk" >> "$seqres.full" +seq 0 2 $((nr-1)) | while read f; do + _reflink_range "$testdir/file1" $((blksz * f)) "$testdir/file3" $((blksz * f)) $blksz >> "$seqres.full" + _pwrite_byte 0x61 $((blksz * f)) $blksz "$testdir/file3.chk" >> "$seqres.full" +done +_scratch_remount + +echo "Compare files" +md5sum "$testdir/file1" | _filter_scratch +md5sum "$testdir/file3" | _filter_scratch +md5sum "$testdir/file3.chk" | _filter_scratch + +echo "CoW across the transition" +seq 1 2 $((nr-1)) | while read f; do + _pwrite_byte 0x62 $((blksz * f)) $blksz "$testdir/file3" >> "$seqres.full" + _pwrite_byte 0x62 $((blksz * f)) $blksz "$testdir/file3.chk" >> "$seqres.full" +done +"$XFS_IO_PROG" -f -c "pwrite -S 0x63 -b $((blksz * nr / 2)) $((blksz * nr / 4)) $((blksz * nr / 2))" "$testdir/file3" >> "$seqres.full" +_pwrite_byte 0x63 $((blksz * nr / 4)) $((blksz * nr / 2)) "$testdir/file3.chk" >> "$seqres.full" +_scratch_remount + +echo "Compare files" +md5sum "$testdir/file1" | _filter_scratch +md5sum "$testdir/file3" | _filter_scratch +md5sum "$testdir/file3.chk" | _filter_scratch + +echo "Check extent counts" +old_extents=$(_count_extents "$testdir/file1") +new_extents=$(_count_extents "$testdir/file3") + +echo "old extents: $old_extents" >> "$seqres.full" +echo "new extents: $new_extents" >> "$seqres.full" +echo "maximum extents: $internal_blks" >> "$seqres.full" +test $new_extents -lt $((internal_blks / 20)) || _fail "file3 badly fragmented" + +echo "Check for damage" +umount "$SCRATCH_MNT" + +# success, all done +status=0 +exit diff --git a/tests/xfs/224.out b/tests/xfs/224.out new file mode 100644 index 0000000..aa7d8a5 --- /dev/null +++ b/tests/xfs/224.out @@ -0,0 +1,14 @@ +QA output created by 224 +Format and mount +Create the original files +Compare files +bdbcf02ee0aa977795a79d25fcfdccb1 SCRATCH_MNT/test-224/file1 +fa50dba51826899c372464a153cb2117 SCRATCH_MNT/test-224/file3 +fa50dba51826899c372464a153cb2117 SCRATCH_MNT/test-224/file3.chk +CoW across the transition +Compare files +bdbcf02ee0aa977795a79d25fcfdccb1 SCRATCH_MNT/test-224/file1 +55968a95dfc0120df4e8485576514320 SCRATCH_MNT/test-224/file3 +55968a95dfc0120df4e8485576514320 SCRATCH_MNT/test-224/file3.chk +Check extent counts +Check for damage diff --git a/tests/xfs/225 b/tests/xfs/225 new file mode 100755 index 0000000..2474df7 --- /dev/null +++ b/tests/xfs/225 @@ -0,0 +1,108 @@ +#! /bin/bash +# FS QA Test No. 225 +# +# Ensuring that copy on write in direct-io mode works when the CoW +# range originally covers multiple extents, some regular, some not. +# - Set cowextsize hint. +# - Create two files. +# - Reflink the odd blocks of the first file into the second file. +# - directio CoW across the halfway mark, starting with the unwritten extent. +# - Check that the files are now different where we say they're different. +# +#----------------------------------------------------------------------- +# Copyright (c) 2016, Oracle and/or its affiliates. All Rights Reserved. +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License as +# published by the Free Software Foundation. +# +# This program is distributed in the hope that it would be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write the Free Software Foundation, +# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA +#----------------------------------------------------------------------- + +seq=`basename "$0"` +seqres="$RESULT_DIR/$seq" +echo "QA output created by $seq" + +here=`pwd` +tmp=/tmp/$$ +status=1 # failure is the default! +trap "_cleanup; exit \$status" 0 1 2 3 15 + +_cleanup() +{ + cd / + rm -rf "$tmp".* +} + +# get standard environment, filters and checks +. ./common/rc +. ./common/filter +. ./common/reflink + +# real QA test starts here +_supported_os Linux +_require_scratch_reflink +_require_xfs_io_command "falloc" + +rm -f "$seqres.full" + +echo "Format and mount" +_scratch_mkfs > "$seqres.full" 2>&1 +_scratch_mount >> "$seqres.full" 2>&1 + +testdir="$SCRATCH_MNT/test-$seq" +rm -rf $testdir +mkdir $testdir + +echo "Create the original files" +blksz=65536 +nr=64 +real_blksz=$(stat -f -c '%S' "$testdir") +internal_blks=$((blksz * nr / real_blksz)) +"$XFS_IO_PROG" -c "cowextsize $((blksz * 16))" "$testdir" >> "$seqres.full" +_pwrite_byte 0x61 0 $((blksz * nr)) "$testdir/file1" >> "$seqres.full" +_pwrite_byte 0x62 0 $((blksz * nr)) "$testdir/file3" >> "$seqres.full" +_pwrite_byte 0x62 0 $((blksz * nr)) "$testdir/file3.chk" >> "$seqres.full" +seq 0 2 $((nr-1)) | while read f; do + _reflink_range "$testdir/file1" $((blksz * f)) "$testdir/file3" $((blksz * f)) $blksz >> "$seqres.full" + _pwrite_byte 0x61 $((blksz * f)) $blksz "$testdir/file3.chk" >> "$seqres.full" +done +_scratch_remount + +echo "Compare files" +md5sum "$testdir/file1" | _filter_scratch +md5sum "$testdir/file3" | _filter_scratch +md5sum "$testdir/file3.chk" | _filter_scratch + +echo "directio CoW across the transition" +"$XFS_IO_PROG" -d -f -c "pwrite -S 0x63 -b $((blksz * nr / 2)) $((blksz * nr / 4)) $((blksz * nr / 2))" "$testdir/file3" >> "$seqres.full" +_pwrite_byte 0x63 $((blksz * nr / 4)) $((blksz * nr / 2)) "$testdir/file3.chk" >> "$seqres.full" +_scratch_remount + +echo "Compare files" +md5sum "$testdir/file1" | _filter_scratch +md5sum "$testdir/file3" | _filter_scratch +md5sum "$testdir/file3.chk" | _filter_scratch + +echo "Check extent counts" +old_extents=$(_count_extents "$testdir/file1") +new_extents=$(_count_extents "$testdir/file3") + +echo "old extents: $old_extents" >> "$seqres.full" +echo "new extents: $new_extents" >> "$seqres.full" +echo "maximum extents: $internal_blks" >> "$seqres.full" +test $new_extents -lt $((internal_blks / 20)) || _fail "file3 badly fragmented" + +echo "Check for damage" +umount "$SCRATCH_MNT" + +# success, all done +status=0 +exit diff --git a/tests/xfs/225.out b/tests/xfs/225.out new file mode 100644 index 0000000..1355465 --- /dev/null +++ b/tests/xfs/225.out @@ -0,0 +1,14 @@ +QA output created by 225 +Format and mount +Create the original files +Compare files +bdbcf02ee0aa977795a79d25fcfdccb1 SCRATCH_MNT/test-225/file1 +d3959a68638c50af07f0258e032cb554 SCRATCH_MNT/test-225/file3 +d3959a68638c50af07f0258e032cb554 SCRATCH_MNT/test-225/file3.chk +directio CoW across the transition +Compare files +bdbcf02ee0aa977795a79d25fcfdccb1 SCRATCH_MNT/test-225/file1 +55968a95dfc0120df4e8485576514320 SCRATCH_MNT/test-225/file3 +55968a95dfc0120df4e8485576514320 SCRATCH_MNT/test-225/file3.chk +Check extent counts +Check for damage diff --git a/tests/xfs/226 b/tests/xfs/226 new file mode 100755 index 0000000..3cff26b --- /dev/null +++ b/tests/xfs/226 @@ -0,0 +1,108 @@ +#! /bin/bash +# FS QA Test No. 226 +# +# Ensuring that copy on write in buffered mode works when the CoW +# range originally covers multiple extents, some regular, some not. +# - Set cowextsize hint. +# - Create two files. +# - Reflink the odd blocks of the first file into the second file. +# - CoW across the halfway mark, starting with the unwritten extent. +# - Check that the files are now different where we say they're different. +# +#----------------------------------------------------------------------- +# Copyright (c) 2016, Oracle and/or its affiliates. All Rights Reserved. +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License as +# published by the Free Software Foundation. +# +# This program is distributed in the hope that it would be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write the Free Software Foundation, +# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA +#----------------------------------------------------------------------- + +seq=`basename "$0"` +seqres="$RESULT_DIR/$seq" +echo "QA output created by $seq" + +here=`pwd` +tmp=/tmp/$$ +status=1 # failure is the default! +trap "_cleanup; exit \$status" 0 1 2 3 15 + +_cleanup() +{ + cd / + rm -rf "$tmp".* +} + +# get standard environment, filters and checks +. ./common/rc +. ./common/filter +. ./common/reflink + +# real QA test starts here +_supported_os Linux +_require_scratch_reflink +_require_xfs_io_command "falloc" + +rm -f "$seqres.full" + +echo "Format and mount" +_scratch_mkfs > "$seqres.full" 2>&1 +_scratch_mount >> "$seqres.full" 2>&1 + +testdir="$SCRATCH_MNT/test-$seq" +rm -rf $testdir +mkdir $testdir + +echo "Create the original files" +blksz=65536 +nr=64 +real_blksz=$(stat -f -c '%S' "$testdir") +internal_blks=$((blksz * nr / real_blksz)) +"$XFS_IO_PROG" -c "cowextsize $((blksz * 16))" "$testdir" >> "$seqres.full" +_pwrite_byte 0x61 0 $((blksz * nr)) "$testdir/file1" >> "$seqres.full" +_pwrite_byte 0x62 0 $((blksz * nr)) "$testdir/file3" >> "$seqres.full" +_pwrite_byte 0x62 0 $((blksz * nr)) "$testdir/file3.chk" >> "$seqres.full" +seq 0 2 $((nr-1)) | while read f; do + _reflink_range "$testdir/file1" $((blksz * f)) "$testdir/file3" $((blksz * f)) $blksz >> "$seqres.full" + _pwrite_byte 0x61 $((blksz * f)) $blksz "$testdir/file3.chk" >> "$seqres.full" +done +_scratch_remount + +echo "Compare files" +md5sum "$testdir/file1" | _filter_scratch +md5sum "$testdir/file3" | _filter_scratch +md5sum "$testdir/file3.chk" | _filter_scratch + +echo "CoW across the transition" +"$XFS_IO_PROG" -f -c "pwrite -S 0x63 -b $((blksz * nr / 2)) $((blksz * nr / 4)) $((blksz * nr / 2))" "$testdir/file3" >> "$seqres.full" +_pwrite_byte 0x63 $((blksz * nr / 4)) $((blksz * nr / 2)) "$testdir/file3.chk" >> "$seqres.full" +_scratch_remount + +echo "Compare files" +md5sum "$testdir/file1" | _filter_scratch +md5sum "$testdir/file3" | _filter_scratch +md5sum "$testdir/file3.chk" | _filter_scratch + +echo "Check extent counts" +old_extents=$(_count_extents "$testdir/file1") +new_extents=$(_count_extents "$testdir/file3") + +echo "old extents: $old_extents" >> "$seqres.full" +echo "new extents: $new_extents" >> "$seqres.full" +echo "maximum extents: $internal_blks" >> "$seqres.full" +test $new_extents -lt $((internal_blks / 20)) || _fail "file3 badly fragmented" + +echo "Check for damage" +umount "$SCRATCH_MNT" + +# success, all done +status=0 +exit diff --git a/tests/xfs/226.out b/tests/xfs/226.out new file mode 100644 index 0000000..120b62f --- /dev/null +++ b/tests/xfs/226.out @@ -0,0 +1,14 @@ +QA output created by 226 +Format and mount +Create the original files +Compare files +bdbcf02ee0aa977795a79d25fcfdccb1 SCRATCH_MNT/test-226/file1 +d3959a68638c50af07f0258e032cb554 SCRATCH_MNT/test-226/file3 +d3959a68638c50af07f0258e032cb554 SCRATCH_MNT/test-226/file3.chk +CoW across the transition +Compare files +bdbcf02ee0aa977795a79d25fcfdccb1 SCRATCH_MNT/test-226/file1 +55968a95dfc0120df4e8485576514320 SCRATCH_MNT/test-226/file3 +55968a95dfc0120df4e8485576514320 SCRATCH_MNT/test-226/file3.chk +Check extent counts +Check for damage diff --git a/tests/xfs/228 b/tests/xfs/228 new file mode 100755 index 0000000..f0d79ef --- /dev/null +++ b/tests/xfs/228 @@ -0,0 +1,137 @@ +#! /bin/bash +# FS QA Test No. 228 +# +# Ensuring that copy on write in direct-io mode works when the CoW +# range originally covers multiple extents, some unwritten, some not. +# - Set cowextsize hint. +# - Create a file with the following repeating sequence of blocks: +# 1. reflinked +# 2. unwritten +# 3. hole +# 4. regular block +# 5. delalloc +# - directio CoW across the halfway mark, starting with the unwritten extent. +# - Check that the files are now different where we say they're different. +# +#----------------------------------------------------------------------- +# Copyright (c) 2016, Oracle and/or its affiliates. All Rights Reserved. +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License as +# published by the Free Software Foundation. +# +# This program is distributed in the hope that it would be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write the Free Software Foundation, +# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA +#----------------------------------------------------------------------- + +seq=`basename "$0"` +seqres="$RESULT_DIR/$seq" +echo "QA output created by $seq" + +here=`pwd` +tmp=/tmp/$$ +status=1 # failure is the default! +trap "_cleanup; exit \$status" 0 1 2 3 15 + +_cleanup() +{ + cd / + rm -rf "$tmp".* +} + +# get standard environment, filters and checks +. ./common/rc +. ./common/filter +. ./common/reflink + +# real QA test starts here +_supported_os Linux +_require_scratch_reflink +_require_xfs_io_command "falloc" +_require_xfs_io_command "fpunch" +_require_cp_reflink + +rm -f "$seqres.full" + +echo "Format and mount" +_scratch_mkfs > "$seqres.full" 2>&1 +_scratch_mount >> "$seqres.full" 2>&1 + +testdir="$SCRATCH_MNT/test-$seq" +rm -rf $testdir +mkdir $testdir + +echo "Create the original files" +blksz=65536 +nr=64 +real_blksz=$(stat -f -c '%S' "$testdir") +internal_blks=$((blksz * nr / real_blksz)) +"$XFS_IO_PROG" -c "cowextsize $((blksz * 16))" "$testdir" >> "$seqres.full" +_pwrite_byte 0x61 0 $((blksz * nr)) "$testdir/file1" >> "$seqres.full" +$XFS_IO_PROG -f -c "truncate $((blksz * nr))" "$testdir/file3" >> "$seqres.full" +# 0 blocks are reflinked +seq 0 5 $nr | while read f; do + _reflink_range "$testdir/file1" $((blksz * f)) "$testdir/file3" $((blksz * f)) $blksz >> "$seqres.full" + _pwrite_byte 0x61 $((blksz * f)) $blksz "$testdir/file3.chk" >> "$seqres.full" +done +sync +# 1 blocks are unwritten +seq 1 5 $nr | while read f; do + $XFS_IO_PROG -f -c "falloc $((blksz * f)) $blksz" "$testdir/file3" >> "$seqres.full" + _pwrite_byte 0x00 $((blksz * f)) $blksz "$testdir/file3.chk" >> "$seqres.full" +done +sync +# 2 blocks are holes +seq 2 5 $nr | while read f; do + _pwrite_byte 0x00 $((blksz * f)) $blksz "$testdir/file3.chk" >> "$seqres.full" +done +# 3 blocks are regular +seq 3 5 $nr | while read f; do + _pwrite_byte 0x71 $((blksz * f)) $blksz "$testdir/file3" >> "$seqres.full" + _pwrite_byte 0x71 $((blksz * f)) $blksz "$testdir/file3.chk" >> "$seqres.full" +done +sync +_scratch_remount + +echo "Compare files" +md5sum "$testdir/file1" | _filter_scratch +md5sum "$testdir/file3" | _filter_scratch +md5sum "$testdir/file3.chk" | _filter_scratch + +echo "directio CoW across the transition" +# 4 blocks are delalloc (do later) +seq 4 5 $nr | while read f; do + _pwrite_byte 0x62 $((blksz * f)) $blksz "$testdir/file3" >> "$seqres.full" + _pwrite_byte 0x62 $((blksz * f)) $blksz "$testdir/file3.chk" >> "$seqres.full" +done +# now cow +"$XFS_IO_PROG" -d -f -c "pwrite -S 0x63 -b $((blksz * nr / 2)) $((blksz * nr / 4)) $((blksz * nr / 2))" "$testdir/file3" >> "$seqres.full" +_pwrite_byte 0x63 $((blksz * nr / 4)) $((blksz * nr / 2)) "$testdir/file3.chk" >> "$seqres.full" +_scratch_remount + +echo "Compare files" +md5sum "$testdir/file1" | _filter_scratch +md5sum "$testdir/file3" | _filter_scratch +md5sum "$testdir/file3.chk" | _filter_scratch + +echo "Check extent counts" +old_extents=$(_count_extents "$testdir/file1") +new_extents=$(_count_extents "$testdir/file3") + +echo "old extents: $old_extents" >> "$seqres.full" +echo "new extents: $new_extents" >> "$seqres.full" +echo "maximum extents: $internal_blks" >> "$seqres.full" +test $new_extents -lt $((internal_blks / 20)) || _fail "file3 badly fragmented" + +echo "Check for damage" +umount "$SCRATCH_MNT" + +# success, all done +status=0 +exit diff --git a/tests/xfs/228.out b/tests/xfs/228.out new file mode 100644 index 0000000..8fa4267 --- /dev/null +++ b/tests/xfs/228.out @@ -0,0 +1,14 @@ +QA output created by 228 +Format and mount +Create the original files +Compare files +bdbcf02ee0aa977795a79d25fcfdccb1 SCRATCH_MNT/test-228/file1 +6366fd359371414186688a0ef6988893 SCRATCH_MNT/test-228/file3 +6366fd359371414186688a0ef6988893 SCRATCH_MNT/test-228/file3.chk +directio CoW across the transition +Compare files +bdbcf02ee0aa977795a79d25fcfdccb1 SCRATCH_MNT/test-228/file1 +36f6b5317a9a921fc91175390ccf7f69 SCRATCH_MNT/test-228/file3 +36f6b5317a9a921fc91175390ccf7f69 SCRATCH_MNT/test-228/file3.chk +Check extent counts +Check for damage diff --git a/tests/xfs/230 b/tests/xfs/230 new file mode 100755 index 0000000..89cbc54 --- /dev/null +++ b/tests/xfs/230 @@ -0,0 +1,137 @@ +#! /bin/bash +# FS QA Test No. 230 +# +# Ensuring that copy on write in buffered mode works when the CoW +# range originally covers multiple extents, some unwritten, some not. +# - Set cowextsize hint. +# - Create a file with the following repeating sequence of blocks: +# 1. reflinked +# 2. unwritten +# 3. hole +# 4. regular block +# 5. delalloc +# - CoW across the halfway mark, starting with the unwritten extent. +# - Check that the files are now different where we say they're different. +# +#----------------------------------------------------------------------- +# Copyright (c) 2016, Oracle and/or its affiliates. All Rights Reserved. +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License as +# published by the Free Software Foundation. +# +# This program is distributed in the hope that it would be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write the Free Software Foundation, +# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA +#----------------------------------------------------------------------- + +seq=`basename "$0"` +seqres="$RESULT_DIR/$seq" +echo "QA output created by $seq" + +here=`pwd` +tmp=/tmp/$$ +status=1 # failure is the default! +trap "_cleanup; exit \$status" 0 1 2 3 15 + +_cleanup() +{ + cd / + rm -rf "$tmp".* +} + +# get standard environment, filters and checks +. ./common/rc +. ./common/filter +. ./common/reflink + +# real QA test starts here +_supported_os Linux +_require_scratch_reflink +_require_xfs_io_command "falloc" +_require_xfs_io_command "fpunch" +_require_cp_reflink + +rm -f "$seqres.full" + +echo "Format and mount" +_scratch_mkfs > "$seqres.full" 2>&1 +_scratch_mount >> "$seqres.full" 2>&1 + +testdir="$SCRATCH_MNT/test-$seq" +rm -rf $testdir +mkdir $testdir + +echo "Create the original files" +blksz=65536 +nr=64 +real_blksz=$(stat -f -c '%S' "$testdir") +internal_blks=$((blksz * nr / real_blksz)) +"$XFS_IO_PROG" -c "cowextsize $((blksz * 16))" "$testdir" >> "$seqres.full" +_pwrite_byte 0x61 0 $((blksz * nr)) "$testdir/file1" >> "$seqres.full" +$XFS_IO_PROG -f -c "truncate $((blksz * nr))" "$testdir/file3" >> "$seqres.full" +# 0 blocks are reflinked +seq 0 5 $nr | while read f; do + _reflink_range "$testdir/file1" $((blksz * f)) "$testdir/file3" $((blksz * f)) $blksz >> "$seqres.full" + _pwrite_byte 0x61 $((blksz * f)) $blksz "$testdir/file3.chk" >> "$seqres.full" +done +sync +# 1 blocks are unwritten +seq 1 5 $nr | while read f; do + $XFS_IO_PROG -f -c "falloc $((blksz * f)) $blksz" "$testdir/file3" >> "$seqres.full" + _pwrite_byte 0x00 $((blksz * f)) $blksz "$testdir/file3.chk" >> "$seqres.full" +done +sync +# 2 blocks are holes +seq 2 5 $nr | while read f; do + _pwrite_byte 0x00 $((blksz * f)) $blksz "$testdir/file3.chk" >> "$seqres.full" +done +# 3 blocks are regular +seq 3 5 $nr | while read f; do + _pwrite_byte 0x71 $((blksz * f)) $blksz "$testdir/file3" >> "$seqres.full" + _pwrite_byte 0x71 $((blksz * f)) $blksz "$testdir/file3.chk" >> "$seqres.full" +done +sync +_scratch_remount + +echo "Compare files" +md5sum "$testdir/file1" | _filter_scratch +md5sum "$testdir/file3" | _filter_scratch +md5sum "$testdir/file3.chk" | _filter_scratch + +echo "directio CoW across the transition" +# 4 blocks are delalloc (do later) +seq 4 5 $nr | while read f; do + _pwrite_byte 0x62 $((blksz * f)) $blksz "$testdir/file3" >> "$seqres.full" + _pwrite_byte 0x62 $((blksz * f)) $blksz "$testdir/file3.chk" >> "$seqres.full" +done +# now cow +"$XFS_IO_PROG" -f -c "pwrite -S 0x63 -b $((blksz * nr / 2)) $((blksz * nr / 4)) $((blksz * nr / 2))" "$testdir/file3" >> "$seqres.full" +_pwrite_byte 0x63 $((blksz * nr / 4)) $((blksz * nr / 2)) "$testdir/file3.chk" >> "$seqres.full" +_scratch_remount + +echo "Compare files" +md5sum "$testdir/file1" | _filter_scratch +md5sum "$testdir/file3" | _filter_scratch +md5sum "$testdir/file3.chk" | _filter_scratch + +echo "Check extent counts" +old_extents=$(_count_extents "$testdir/file1") +new_extents=$(_count_extents "$testdir/file3") + +echo "old extents: $old_extents" >> "$seqres.full" +echo "new extents: $new_extents" >> "$seqres.full" +echo "maximum extents: $internal_blks" >> "$seqres.full" +test $new_extents -lt $((internal_blks / 20)) || _fail "file3 badly fragmented" + +echo "Check for damage" +umount "$SCRATCH_MNT" + +# success, all done +status=0 +exit diff --git a/tests/xfs/230.out b/tests/xfs/230.out new file mode 100644 index 0000000..32c8fd2 --- /dev/null +++ b/tests/xfs/230.out @@ -0,0 +1,14 @@ +QA output created by 230 +Format and mount +Create the original files +Compare files +bdbcf02ee0aa977795a79d25fcfdccb1 SCRATCH_MNT/test-230/file1 +6366fd359371414186688a0ef6988893 SCRATCH_MNT/test-230/file3 +6366fd359371414186688a0ef6988893 SCRATCH_MNT/test-230/file3.chk +directio CoW across the transition +Compare files +bdbcf02ee0aa977795a79d25fcfdccb1 SCRATCH_MNT/test-230/file1 +36f6b5317a9a921fc91175390ccf7f69 SCRATCH_MNT/test-230/file3 +36f6b5317a9a921fc91175390ccf7f69 SCRATCH_MNT/test-230/file3.chk +Check extent counts +Check for damage diff --git a/tests/xfs/group b/tests/xfs/group index afd960f..da83274 100644 --- a/tests/xfs/group +++ b/tests/xfs/group @@ -212,12 +212,22 @@ 212 auto quick clone 213 auto quick clone 214 auto quick clone +215 auto quick clone 216 log metadata auto quick 217 log metadata auto +218 auto quick clone +219 auto quick clone 220 auto quota quick +221 auto quick clone 222 auto fsr ioctl quick +223 auto quick clone +224 auto quick clone +225 auto quick clone +226 auto quick clone 227 auto fsr +228 auto quick clone 229 auto rw +230 auto quick clone 238 auto quick metadata ioctl 242 auto quick prealloc 244 auto quota quick From darrick.wong@oracle.com Mon Feb 8 19:13:48 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay2.corp.sgi.com [137.38.102.29]) by oss.sgi.com (Postfix) with ESMTP id D724129E1C for ; Mon, 8 Feb 2016 19:13:48 -0600 (CST) Received: from cuda.sgi.com (cuda3.sgi.com [192.48.176.15]) by relay2.corp.sgi.com (Postfix) with ESMTP id C0001304032 for ; Mon, 8 Feb 2016 17:13:48 -0800 (PST) X-ASG-Debug-ID: 1454980425-04cb6c1e56036b0001-NocioJ Received: from userp1040.oracle.com (userp1040.oracle.com [156.151.31.81]) by cuda.sgi.com with ESMTP id nTkFj2nhZqUaF1C5 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO) for ; Mon, 08 Feb 2016 17:13:46 -0800 (PST) X-Barracuda-Envelope-From: darrick.wong@oracle.com X-Barracuda-Apparent-Source-IP: 156.151.31.81 Received: from userv0022.oracle.com (userv0022.oracle.com [156.151.31.74]) by userp1040.oracle.com (Sentrion-MTA-4.3.2/Sentrion-MTA-4.3.2) with ESMTP id u191DiGO015671 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 9 Feb 2016 01:13:44 GMT Received: from aserv0122.oracle.com (aserv0122.oracle.com [141.146.126.236]) by userv0022.oracle.com (8.14.4/8.13.8) with ESMTP id u191DiPR012325 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=FAIL); Tue, 9 Feb 2016 01:13:44 GMT Received: from abhmp0010.oracle.com (abhmp0010.oracle.com [141.146.116.16]) by aserv0122.oracle.com (8.13.8/8.13.8) with ESMTP id u191Di59027975; Tue, 9 Feb 2016 01:13:44 GMT Received: from localhost (/10.145.178.207) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Mon, 08 Feb 2016 17:13:43 -0800 Subject: [PATCH 18/23] xfs: test the automatic cowextsize extent garbage collector From: "Darrick J. Wong" X-ASG-Orig-Subj: [PATCH 18/23] xfs: test the automatic cowextsize extent garbage collector To: david@fromorbit.com, darrick.wong@oracle.com Cc: linux-btrfs@vger.kernel.org, fstests@vger.kernel.org, xfs@oss.sgi.com Date: Mon, 08 Feb 2016 17:13:42 -0800 Message-ID: <20160209011342.23099.23019.stgit@birch.djwong.org> In-Reply-To: <20160209011145.23099.95354.stgit@birch.djwong.org> References: <20160209011145.23099.95354.stgit@birch.djwong.org> User-Agent: StGit/0.17.1-dirty MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit X-Source-IP: userv0022.oracle.com [156.151.31.74] X-Barracuda-Connect: userp1040.oracle.com[156.151.31.81] X-Barracuda-Start-Time: 1454980425 X-Barracuda-Encrypted: ECDHE-RSA-AES256-GCM-SHA384 X-Barracuda-URL: https://192.48.176.15:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-BRTS-Status: 1 X-Barracuda-Spam-Score: 0.00 X-Barracuda-Spam-Status: No, SCORE=0.00 using per-user scores of TAG_LEVEL=1000.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.7 tests=BSF_SC0_MISMATCH_TO, UNPARSEABLE_RELAY X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.3.26874 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 0.00 BSF_SC0_MISMATCH_TO Envelope rcpt doesn't match header 0.00 UNPARSEABLE_RELAY Informational: message has unparseable relay lines Signed-off-by: Darrick J. Wong --- tests/xfs/231 | 135 ++++++++++++++++++++++++++++++++++++++++++++++++++++ tests/xfs/231.out | 17 +++++++ tests/xfs/232 | 137 +++++++++++++++++++++++++++++++++++++++++++++++++++++ tests/xfs/232.out | 17 +++++++ tests/xfs/group | 2 + 5 files changed, 308 insertions(+) create mode 100755 tests/xfs/231 create mode 100644 tests/xfs/231.out create mode 100755 tests/xfs/232 create mode 100644 tests/xfs/232.out diff --git a/tests/xfs/231 b/tests/xfs/231 new file mode 100755 index 0000000..d9ae102 --- /dev/null +++ b/tests/xfs/231 @@ -0,0 +1,135 @@ +#! /bin/bash +# FS QA Test No. 231 +# +# Test recovery of unused CoW reservations: +# - Create two reflinked files. Set extsz hint on second file. +# - Dirty a single byte on a number of CoW reservations in the second file. +# - Fsync to flush out the dirty pages. +# - Wait for the reclaim to run. +# - Write more and see how bad fragmentation is. +# +#----------------------------------------------------------------------- +# Copyright (c) 2016, Oracle and/or its affiliates. All Rights Reserved. +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License as +# published by the Free Software Foundation. +# +# This program is distributed in the hope that it would be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write the Free Software Foundation, +# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA +#----------------------------------------------------------------------- + +seq=`basename "$0"` +seqres="$RESULT_DIR/$seq" +echo "QA output created by $seq" + +here=`pwd` +tmp=/tmp/$$ +status=1 # failure is the default! +trap "_cleanup; exit \$status" 0 1 2 3 15 + +_cleanup() +{ + cd / + echo $old_cow_lifetime > /proc/sys/fs/xfs/speculative_cow_prealloc_lifetime + #rm -rf "$tmp".* "$testdir" +} + +# get standard environment, filters and checks +. ./common/rc +. ./common/filter +. ./common/reflink + +# real QA test starts here +_supported_os Linux +_supported_fs xfs +_require_scratch_reflink +_require_cp_reflink +_require_fiemap + +old_cow_lifetime=$(cat /proc/sys/fs/xfs/speculative_cow_prealloc_lifetime) + +rm -f "$seqres.full" + +echo "Format and mount" +_scratch_mkfs > "$seqres.full" 2>&1 +_scratch_mount >> "$seqres.full" 2>&1 + +testdir="$SCRATCH_MNT/test-$seq" +rm -rf $testdir +mkdir $testdir + +blksz=65536 +nr=64 +bsz=2 + +free_blocks=$(stat -f -c '%a' "$testdir") +real_blksz=$(stat -f -c '%S' "$testdir") +space_needed=$(((blksz * nr * 3) * 5 / 4)) +space_avail=$((free_blocks * real_blksz)) +internal_blks=$((blksz * nr / real_blksz)) +test $space_needed -gt $space_avail && _notrun "Not enough space. $space_avail < $space_needed" + +echo "Create the original files" +"$XFS_IO_PROG" -c "cowextsize $((blksz * bsz))" "$testdir" +"$XFS_IO_PROG" -f -c "pwrite -S 0x61 -b $((blksz * bsz)) 0 $((blksz * nr))" "$testdir/file1" >> "$seqres.full" +"$XFS_IO_PROG" -f -c "pwrite -S 0x61 -b $((blksz * bsz)) 0 $((blksz * nr))" "$testdir/file2.chk" >> "$seqres.full" +_cp_reflink "$testdir/file1" "$testdir/file2" >> "$seqres.full" +_scratch_remount + +echo "Compare files" +md5sum "$testdir/file1" | _filter_scratch +md5sum "$testdir/file2" | _filter_scratch +md5sum "$testdir/file2.chk" | _filter_scratch + +echo "CoW and leave leftovers" +echo 2 > /proc/sys/fs/xfs/speculative_cow_prealloc_lifetime +seq 2 2 $((nr - 1)) | while read f; do + "$XFS_IO_PROG" -f -c "pwrite -S 0x63 $((blksz * f - 1)) 1" "$testdir/file2" >> "$seqres.full" + "$XFS_IO_PROG" -f -c "pwrite -S 0x63 $((blksz * f - 1)) 1" "$testdir/file2.chk" >> "$seqres.full" +done +sync + +echo "Wait for CoW expiration" +sleep 3 + +echo "Allocate free space" +for i in $(seq 1 32); do + "$XFS_IO_PROG" -f -c "falloc 0 1" "$testdir/junk.$i" >> "$seqres.full" +done +"$XFS_IO_PROG" -f -c "falloc 0 $((blksz * nr))" "$testdir/junk" >> "$seqres.full" + +echo "CoW and leave leftovers" +echo $old_cow_lifetime > /proc/sys/fs/xfs/speculative_cow_prealloc_lifetime +seq 2 2 $((nr - 1)) | while read f; do + "$XFS_IO_PROG" -f -c "pwrite -S 0x63 $((blksz * f)) 1" "$testdir/file2" >> "$seqres.full" + "$XFS_IO_PROG" -f -c "pwrite -S 0x63 $((blksz * f)) 1" "$testdir/file2.chk" >> "$seqres.full" +done +sync + +echo "Compare files" +md5sum "$testdir/file1" | _filter_scratch +md5sum "$testdir/file2" | _filter_scratch +md5sum "$testdir/file2.chk" | _filter_scratch + +echo "Check extent counts" +old_extents=$(_count_extents "$testdir/file1") +new_extents=$(_count_extents "$testdir/file2") + +echo "old extents: $old_extents" >> "$seqres.full" +echo "new extents: $new_extents" >> "$seqres.full" +echo "maximum extents: $internal_blks" >> "$seqres.full" +test $new_extents -lt $((internal_blks / 7)) || _fail "file2 badly fragmented" + +echo "Check for damage" +umount "$SCRATCH_MNT" + +# success, all done +status=0 +exit diff --git a/tests/xfs/231.out b/tests/xfs/231.out new file mode 100644 index 0000000..872ce7b --- /dev/null +++ b/tests/xfs/231.out @@ -0,0 +1,17 @@ +QA output created by 231 +Format and mount +Create the original files +Compare files +bdbcf02ee0aa977795a79d25fcfdccb1 SCRATCH_MNT/test-231/file1 +bdbcf02ee0aa977795a79d25fcfdccb1 SCRATCH_MNT/test-231/file2 +bdbcf02ee0aa977795a79d25fcfdccb1 SCRATCH_MNT/test-231/file2.chk +CoW and leave leftovers +Wait for CoW expiration +Allocate free space +CoW and leave leftovers +Compare files +bdbcf02ee0aa977795a79d25fcfdccb1 SCRATCH_MNT/test-231/file1 +211b0f725e67149d75104a747365eb70 SCRATCH_MNT/test-231/file2 +211b0f725e67149d75104a747365eb70 SCRATCH_MNT/test-231/file2.chk +Check extent counts +Check for damage diff --git a/tests/xfs/232 b/tests/xfs/232 new file mode 100755 index 0000000..1cbc791 --- /dev/null +++ b/tests/xfs/232 @@ -0,0 +1,137 @@ +#! /bin/bash +# FS QA Test No. 232 +# +# Test non-recovery of unused CoW reservations for dirty files: +# - Create two reflinked files. Set extsz hint on second file. +# - Dirty a single byte on a number of CoW reservations in the second file. +# - Fsync to flush out the dirty pages. +# - Dirty a single byte anywhere in the second file. +# - Wait for the reclaim to run. +# - Write more and see how bad fragmentation is. +# +#----------------------------------------------------------------------- +# Copyright (c) 2016, Oracle and/or its affiliates. All Rights Reserved. +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License as +# published by the Free Software Foundation. +# +# This program is distributed in the hope that it would be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write the Free Software Foundation, +# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA +#----------------------------------------------------------------------- + +seq=`basename "$0"` +seqres="$RESULT_DIR/$seq" +echo "QA output created by $seq" + +here=`pwd` +tmp=/tmp/$$ +status=1 # failure is the default! +trap "_cleanup; exit \$status" 0 1 2 3 15 + +_cleanup() +{ + cd / + echo $old_cow_lifetime > /proc/sys/fs/xfs/speculative_cow_prealloc_lifetime + #rm -rf "$tmp".* "$testdir" +} + +# get standard environment, filters and checks +. ./common/rc +. ./common/filter +. ./common/reflink + +# real QA test starts here +_supported_os Linux +_supported_fs xfs +_require_scratch_reflink +_require_cp_reflink +_require_fiemap + +old_cow_lifetime=$(cat /proc/sys/fs/xfs/speculative_cow_prealloc_lifetime) + +rm -f "$seqres.full" + +echo "Format and mount" +_scratch_mkfs > "$seqres.full" 2>&1 +_scratch_mount >> "$seqres.full" 2>&1 + +testdir="$SCRATCH_MNT/test-$seq" +rm -rf $testdir +mkdir $testdir + +blksz=65536 +nr=64 +bsz=2 + +free_blocks=$(stat -f -c '%a' "$testdir") +real_blksz=$(stat -f -c '%S' "$testdir") +space_needed=$(((blksz * nr * 3) * 5 / 4)) +space_avail=$((free_blocks * real_blksz)) +internal_blks=$((blksz * nr / real_blksz)) +test $space_needed -gt $space_avail && _notrun "Not enough space. $space_avail < $space_needed" + +echo "Create the original files" +"$XFS_IO_PROG" -c "cowextsize $((blksz * bsz))" "$testdir" +"$XFS_IO_PROG" -f -c "pwrite -S 0x61 -b $((blksz * bsz)) 0 $((blksz * nr))" "$testdir/file1" >> "$seqres.full" +"$XFS_IO_PROG" -f -c "pwrite -S 0x61 -b $((blksz * bsz)) 0 $((blksz * nr))" "$testdir/file2.chk" >> "$seqres.full" +_cp_reflink "$testdir/file1" "$testdir/file2" >> "$seqres.full" +_scratch_remount + +echo "Compare files" +md5sum "$testdir/file1" | _filter_scratch +md5sum "$testdir/file2" | _filter_scratch +md5sum "$testdir/file2.chk" | _filter_scratch + +echo "CoW and leave leftovers" +echo 2 > /proc/sys/fs/xfs/speculative_cow_prealloc_lifetime +seq 2 2 $((nr - 1)) | while read f; do + "$XFS_IO_PROG" -f -c "pwrite -S 0x63 $((blksz * f - 1)) 1" "$testdir/file2" >> "$seqres.full" + "$XFS_IO_PROG" -f -c "pwrite -S 0x63 $((blksz * f - 1)) 1" "$testdir/file2.chk" >> "$seqres.full" +done +sync + +echo "Wait for CoW expiration" +"$XFS_IO_PROG" -f -c "pwrite -S 0x63 $((blksz * 2)) 1" "$testdir/file2" >> "$seqres.full" +sleep 3 + +echo "Allocate free space" +for i in $(seq 1 32); do + "$XFS_IO_PROG" -f -c "falloc 0 1" "$testdir/junk.$i" >> "$seqres.full" +done +"$XFS_IO_PROG" -f -c "falloc 0 $((blksz * nr))" "$testdir/junk" >> "$seqres.full" + +echo "CoW and leave leftovers" +echo $old_cow_lifetime > /proc/sys/fs/xfs/speculative_cow_prealloc_lifetime +seq 2 2 $((nr - 1)) | while read f; do + "$XFS_IO_PROG" -f -c "pwrite -S 0x63 $((blksz * f)) 1" "$testdir/file2" >> "$seqres.full" + "$XFS_IO_PROG" -f -c "pwrite -S 0x63 $((blksz * f)) 1" "$testdir/file2.chk" >> "$seqres.full" +done +sync + +echo "Compare files" +md5sum "$testdir/file1" | _filter_scratch +md5sum "$testdir/file2" | _filter_scratch +md5sum "$testdir/file2.chk" | _filter_scratch + +echo "Check extent counts" +old_extents=$(_count_extents "$testdir/file1") +new_extents=$(_count_extents "$testdir/file2") + +echo "old extents: $old_extents" >> "$seqres.full" +echo "new extents: $new_extents" >> "$seqres.full" +echo "maximum extents: $internal_blks" >> "$seqres.full" +test $new_extents -lt $((internal_blks / 12)) || _fail "file2 not sufficiently fragmented" + +echo "Check for damage" +umount "$SCRATCH_MNT" + +# success, all done +status=0 +exit diff --git a/tests/xfs/232.out b/tests/xfs/232.out new file mode 100644 index 0000000..ccabdaa --- /dev/null +++ b/tests/xfs/232.out @@ -0,0 +1,17 @@ +QA output created by 232 +Format and mount +Create the original files +Compare files +bdbcf02ee0aa977795a79d25fcfdccb1 SCRATCH_MNT/test-232/file1 +bdbcf02ee0aa977795a79d25fcfdccb1 SCRATCH_MNT/test-232/file2 +bdbcf02ee0aa977795a79d25fcfdccb1 SCRATCH_MNT/test-232/file2.chk +CoW and leave leftovers +Wait for CoW expiration +Allocate free space +CoW and leave leftovers +Compare files +bdbcf02ee0aa977795a79d25fcfdccb1 SCRATCH_MNT/test-232/file1 +211b0f725e67149d75104a747365eb70 SCRATCH_MNT/test-232/file2 +211b0f725e67149d75104a747365eb70 SCRATCH_MNT/test-232/file2.chk +Check extent counts +Check for damage diff --git a/tests/xfs/group b/tests/xfs/group index da83274..de3c7d6 100644 --- a/tests/xfs/group +++ b/tests/xfs/group @@ -228,6 +228,8 @@ 228 auto quick clone 229 auto rw 230 auto quick clone +231 auto quick clone +232 auto quick clone 238 auto quick metadata ioctl 242 auto quick prealloc 244 auto quota quick From darrick.wong@oracle.com Mon Feb 8 19:13:55 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay2.corp.sgi.com [137.38.102.29]) by oss.sgi.com (Postfix) with ESMTP id 14F6729E25 for ; Mon, 8 Feb 2016 19:13:55 -0600 (CST) Received: from cuda.sgi.com (cuda2.sgi.com [192.48.176.25]) by relay2.corp.sgi.com (Postfix) with ESMTP id 02E17304032 for ; Mon, 8 Feb 2016 17:13:55 -0800 (PST) X-ASG-Debug-ID: 1454980431-04cbb0433205a20001-NocioJ Received: from aserp1040.oracle.com (aserp1040.oracle.com [141.146.126.69]) by cuda.sgi.com with ESMTP id QB5wv1HilsJX2rUx (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO) for ; Mon, 08 Feb 2016 17:13:51 -0800 (PST) X-Barracuda-Envelope-From: darrick.wong@oracle.com X-Barracuda-Apparent-Source-IP: 141.146.126.69 Received: from aserv0022.oracle.com (aserv0022.oracle.com [141.146.126.234]) by aserp1040.oracle.com (Sentrion-MTA-4.3.2/Sentrion-MTA-4.3.2) with ESMTP id u191Do5X020100 (version=TLSv1 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Tue, 9 Feb 2016 01:13:50 GMT Received: from aserv0121.oracle.com (aserv0121.oracle.com [141.146.126.235]) by aserv0022.oracle.com (8.13.8/8.13.8) with ESMTP id u191DoZp016660 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=FAIL); Tue, 9 Feb 2016 01:13:50 GMT Received: from abhmp0008.oracle.com (abhmp0008.oracle.com [141.146.116.14]) by aserv0121.oracle.com (8.13.8/8.13.8) with ESMTP id u191DoPg027917; Tue, 9 Feb 2016 01:13:50 GMT Received: from localhost (/10.145.178.207) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Mon, 08 Feb 2016 17:13:50 -0800 Subject: [PATCH 19/23] xfs: test rmapbt functionality From: "Darrick J. Wong" X-ASG-Orig-Subj: [PATCH 19/23] xfs: test rmapbt functionality To: david@fromorbit.com, darrick.wong@oracle.com Cc: linux-btrfs@vger.kernel.org, fstests@vger.kernel.org, xfs@oss.sgi.com Date: Mon, 08 Feb 2016 17:13:48 -0800 Message-ID: <20160209011348.23099.30668.stgit@birch.djwong.org> In-Reply-To: <20160209011145.23099.95354.stgit@birch.djwong.org> References: <20160209011145.23099.95354.stgit@birch.djwong.org> User-Agent: StGit/0.17.1-dirty MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit X-Source-IP: aserv0022.oracle.com [141.146.126.234] X-Barracuda-Connect: aserp1040.oracle.com[141.146.126.69] X-Barracuda-Start-Time: 1454980431 X-Barracuda-Encrypted: ECDHE-RSA-AES256-GCM-SHA384 X-Barracuda-URL: https://192.48.176.25:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-BRTS-Status: 1 X-Barracuda-Spam-Score: 0.00 X-Barracuda-Spam-Status: No, SCORE=0.00 using per-user scores of TAG_LEVEL=1000.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.7 tests=BSF_SC0_MISMATCH_TO, UNPARSEABLE_RELAY X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.3.26874 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 0.00 BSF_SC0_MISMATCH_TO Envelope rcpt doesn't match header 0.00 UNPARSEABLE_RELAY Informational: message has unparseable relay lines Signed-off-by: Darrick J. Wong --- common/xfs | 44 ++++++++++++++++++++++ tests/xfs/233 | 78 ++++++++++++++++++++++++++++++++++++++ tests/xfs/233.out | 6 +++ tests/xfs/234 | 89 ++++++++++++++++++++++++++++++++++++++++++++ tests/xfs/234.out | 6 +++ tests/xfs/235 | 108 +++++++++++++++++++++++++++++++++++++++++++++++++++++ tests/xfs/235.out | 14 +++++++ tests/xfs/236 | 93 ++++++++++++++++++++++++++++++++++++++++++++++ tests/xfs/236.out | 8 ++++ tests/xfs/group | 4 ++ 10 files changed, 450 insertions(+) create mode 100644 common/xfs create mode 100755 tests/xfs/233 create mode 100644 tests/xfs/233.out create mode 100755 tests/xfs/234 create mode 100644 tests/xfs/234.out create mode 100755 tests/xfs/235 create mode 100644 tests/xfs/235.out create mode 100755 tests/xfs/236 create mode 100644 tests/xfs/236.out diff --git a/common/xfs b/common/xfs new file mode 100644 index 0000000..2d1a76f --- /dev/null +++ b/common/xfs @@ -0,0 +1,44 @@ +##/bin/bash +# Routines for handling XFS +#----------------------------------------------------------------------- +# Copyright (c) 2015 Oracle. All Rights Reserved. +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 +# USA +# +# Contact information: Oracle Corporation, 500 Oracle Parkway, +# Redwood Shores, CA 94065, USA, or: http://www.oracle.com/ +#----------------------------------------------------------------------- + +_require_xfs_test_rmapbt() +{ + _require_test + + if [ "$(xfs_info "$TEST_DIR" | grep -c "rmapbt=1")" -ne 1 ]; then + _notrun "rmapbt not supported by test filesystem type: $FSTYP" + fi +} + +_require_xfs_scratch_rmapbt() +{ + _require_scratch + + _scratch_mkfs > /dev/null + _scratch_mount + if [ "$(xfs_info "$SCRATCH_MNT" | grep -c "rmapbt=1")" -ne 1 ]; then + _scratch_unmount + _notrun "rmapbt not supported by scratch filesystem type: $FSTYP" + fi + _scratch_unmount +} diff --git a/tests/xfs/233 b/tests/xfs/233 new file mode 100755 index 0000000..2e61275 --- /dev/null +++ b/tests/xfs/233 @@ -0,0 +1,78 @@ +#! /bin/bash +# FS QA Test No. 233 +# +# Tests xfs_growfs on a rmapbt filesystem +# +#----------------------------------------------------------------------- +# Copyright (c) 2016, Oracle and/or its affiliates. All Rights Reserved. +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License as +# published by the Free Software Foundation. +# +# This program is distributed in the hope that it would be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write the Free Software Foundation, +# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA +#----------------------------------------------------------------------- +# + +seq=`basename "$0"` +seqres="$RESULT_DIR/$seq" +echo "QA output created by $seq" + +here=`pwd` +tmp=/tmp/$$ +status=1 # failure is the default! +trap "_cleanup; exit \$status" 0 1 2 3 15 + +_cleanup() +{ + cd / + rm -f "$tmp".* +} + +# get standard environment, filters and checks +. ./common/rc +. ./common/filter +. ./common/xfs + +# real QA test starts here +_supported_os Linux +_supported_fs xfs +_require_xfs_scratch_rmapbt + +echo "Format and mount" +_scratch_mkfs -d size=$((2 * 4096 * 4096)) -l size=4194304 > "$seqres.full" 2>&1 +_scratch_mount >> "$seqres.full" 2>&1 + +testdir="$SCRATCH_MNT/test-$seq" +rm -rf "$testdir" +mkdir "$testdir" + +echo "Create the original files" +blksz="$(stat -f "$testdir" -c '%S')" +_pwrite_byte 0x61 0 $((blksz * 14 + 71)) "$testdir/original" >> "$seqres.full" +cp -p "$testdir/original" "$testdir/copy1" +cp -p "$testdir/copy1" "$testdir/copy2" + +echo "Grow fs" +"$XFS_GROWFS_PROG" "$SCRATCH_MNT" 2>&1 | _filter_growfs >> "$seqres.full" +_scratch_remount + +echo "Create more copies" +cp -p "$testdir/original" "$testdir/copy3" + +xfs_info "$SCRATCH_MNT" >> "$seqres.full" + +echo "Check scratch fs" +umount "$SCRATCH_MNT" +_check_scratch_fs + +# success, all done +status=0 +exit diff --git a/tests/xfs/233.out b/tests/xfs/233.out new file mode 100644 index 0000000..7a7b991 --- /dev/null +++ b/tests/xfs/233.out @@ -0,0 +1,6 @@ +QA output created by 233 +Format and mount +Create the original files +Grow fs +Create more copies +Check scratch fs diff --git a/tests/xfs/234 b/tests/xfs/234 new file mode 100755 index 0000000..1bdf8b2 --- /dev/null +++ b/tests/xfs/234 @@ -0,0 +1,89 @@ +#! /bin/bash +# FS QA Test No. 234 +# +# Ensure that we can create enough distinct rmap entries to force creation +# of a multi-level rmap btree, and that metadump will successfully copy +# said block. +# +#----------------------------------------------------------------------- +# Copyright (c) 2016, Oracle and/or its affiliates. All Rights Reserved. +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License as +# published by the Free Software Foundation. +# +# This program is distributed in the hope that it would be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write the Free Software Foundation, +# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA +#----------------------------------------------------------------------- + +seq=`basename "$0"` +seqres=$RESULT_DIR/$seq +echo "QA output created by $seq" + +here=`pwd` +tmp=/tmp/$$ +status=1 # failure is the default! +trap "_cleanup; exit \$status" 0 1 2 3 15 + +_cleanup() +{ + cd / + umount "$SCRATCH_MNT" > /dev/null 2>&1 + rm -rf "$tmp".* "$testdir" "$metadump_file" "$TEST_DIR/image" +} + +# get standard environment, filters and checks +. ./common/rc +. ./common/filter +. ./common/xfs + +# real QA test starts here +_supported_os Linux +_supported_fs xfs +_require_loop +_require_xfs_scratch_rmapbt +_require_xfs_io_command "fpunch" + +rm -f "$seqres.full" + +_scratch_mkfs >/dev/null 2>&1 +_scratch_mount + +testdir="$SCRATCH_MNT/test-$seq" +rm -rf "$testdir" +mkdir "$testdir" +metadump_file="$TEST_DIR/${seq}_metadump" + +echo "Create the original file blocks" +blksz="$(stat -f "$testdir" -c '%S')" +nr_blks=$((4 * blksz / 12)) +_pwrite_byte 0x61 0 $((blksz * nr_blks)) "$testdir/file1" >> "$seqres.full" +sync + +echo "Punch every other block" +seq 1 2 $((nr_blks - 1)) | while read nr; do + "$XFS_IO_PROG" -c "fpunch $((nr * blksz)) $blksz" "$testdir/file1" >> "$seqres.full" +done + +echo "Create metadump file" +_scratch_unmount +_scratch_metadump "$metadump_file" + +# Now restore the obfuscated one back and take a look around +echo "Restore metadump" +xfs_mdrestore "$metadump_file" "$TEST_DIR/image" +_mount -t $FSTYP "$TEST_DIR/image" "$SCRATCH_MNT" +umount "$SCRATCH_MNT" + +echo "Check restored fs" +_check_generic_filesystem "$metadump_file" + +# success, all done +status=0 +exit diff --git a/tests/xfs/234.out b/tests/xfs/234.out new file mode 100644 index 0000000..463d466 --- /dev/null +++ b/tests/xfs/234.out @@ -0,0 +1,6 @@ +QA output created by 234 +Create the original file blocks +Punch every other block +Create metadump file +Restore metadump +Check restored fs diff --git a/tests/xfs/235 b/tests/xfs/235 new file mode 100755 index 0000000..4e34d3c --- /dev/null +++ b/tests/xfs/235 @@ -0,0 +1,108 @@ +#! /bin/bash +# FS QA Test No. 235 +# +# Create and populate an XFS filesystem, corrupt the rmap btree, +# then see how the kernel and xfs_repair deal with it. +# +#----------------------------------------------------------------------- +# Copyright (c) 2016 Oracle, Inc. All Rights Reserved. +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License as +# published by the Free Software Foundation. +# +# This program is distributed in the hope that it would be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write the Free Software Foundation, +# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-7031 USA +#----------------------------------------------------------------------- +# + +seq=`basename "$0"` +seqres="$RESULT_DIR/$seq" +echo "QA output created by $seq" + +here=`pwd` +tmp=/tmp/$$ +status=1 # failure is the default! +trap "_cleanup; exit \$status" 0 1 2 3 15 + +_cleanup() +{ + cd / + #rm -f $tmp.* +} + +# get standard environment, filters and checks +. ./common/rc +. ./common/filter +. ./common/attr +. ./common/xfs + +# real QA test starts here +_supported_os Linux +_supported_fs xfs +_require_xfs_scratch_rmapbt +test -n "${FORCE_FUZZ}" || _require_scratch_xfs_crc + +rm -f "$seqres.full" + +echo "+ create scratch fs" +_scratch_mkfs_xfs > /dev/null + +echo "+ mount fs image" +_scratch_mount +blksz="$(stat -f -c '%s' "${SCRATCH_MNT}")" +agcount="$(xfs_info "${SCRATCH_MNT}" | grep agcount= | sed -e 's/^.*agcount=\([0-9]*\),.*$/\1/g')" + +echo "+ make some files" +_pwrite_byte 0x62 0 $((blksz * 64)) "${SCRATCH_MNT}/file0" >> "$seqres.full" +_pwrite_byte 0x61 0 $((blksz * 64)) "${SCRATCH_MNT}/file1" >> "$seqres.full" +cp -p "${SCRATCH_MNT}/file0" "${SCRATCH_MNT}/file2" +cp -p "${SCRATCH_MNT}/file1" "${SCRATCH_MNT}/file3" +umount "${SCRATCH_MNT}" + +echo "+ check fs" +_scratch_xfs_repair -n >> "$seqres.full" 2>&1 || \ + _fail "xfs_repair should not fail" + +echo "+ corrupt image" +seq 0 $((agcount - 1)) | while read ag; do + $XFS_DB_PROG -x -c "agf ${ag}" -c "agf ${ag}" -c "addr rmaproot" \ + -c "stack" -c "blocktrash -x 4096 -y 4096 -z -n 8 -3" \ + "${SCRATCH_DEV}" >> "$seqres.full" 2>&1 +done + +echo "+ mount image" +_scratch_mount + +echo "+ copy more" +"$XFS_IO_PROG" -f -c "pwrite -S 0x63 0 $((blksz * 64))" -c "fsync" "${SCRATCH_MNT}/file4" >> "$seqres.full" +test -s "${SCRATCH_MNT}/file4" || _fail "should not be able to copy with busted rmap btree" +umount "${SCRATCH_MNT}" + +echo "+ repair fs" +_scratch_xfs_repair >> "$seqres.full" 2>&1 +_scratch_xfs_repair >> "$seqres.full" 2>&1 + +echo "+ mount image (2)" +_scratch_mount + +echo "+ chattr -R -i" +chattr -R -f -i "${SCRATCH_MNT}/" + +echo "+ copy more (2)" +cp -p "${SCRATCH_MNT}/file1" "${SCRATCH_MNT}/file5" || \ + _fail "modified rmap tree" +umount "${SCRATCH_MNT}" + +echo "+ check fs (2)" +_scratch_xfs_repair -n >> "$seqres.full" 2>&1 || \ + _fail "xfs_repair should not fail" + +status=0 +exit diff --git a/tests/xfs/235.out b/tests/xfs/235.out new file mode 100644 index 0000000..89a11d6 --- /dev/null +++ b/tests/xfs/235.out @@ -0,0 +1,14 @@ +QA output created by 235 ++ create scratch fs ++ mount fs image ++ make some files ++ check fs ++ corrupt image ++ mount image ++ copy more +fsync: Structure needs cleaning ++ repair fs ++ mount image (2) ++ chattr -R -i ++ copy more (2) ++ check fs (2) diff --git a/tests/xfs/236 b/tests/xfs/236 new file mode 100755 index 0000000..d3a9edc --- /dev/null +++ b/tests/xfs/236 @@ -0,0 +1,93 @@ +#! /bin/bash +# FS QA Test No. 236 +# +# Ensure that we can create enough distinct rmapbt entries to force creation +# of a multi-level rmap btree. Delete and recreate a few times to +# exercise the rmap btree grow/shrink functions. +# +#----------------------------------------------------------------------- +# Copyright (c) 2016, Oracle and/or its affiliates. All Rights Reserved. +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License as +# published by the Free Software Foundation. +# +# This program is distributed in the hope that it would be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write the Free Software Foundation, +# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA +#----------------------------------------------------------------------- + +seq=`basename "$0"` +seqres=$RESULT_DIR/$seq +echo "QA output created by $seq" + +here=`pwd` +tmp=/tmp/$$ +status=1 # failure is the default! +trap "_cleanup; exit \$status" 0 1 2 3 15 + +_cleanup() +{ + cd / + umount "$SCRATCH_MNT" > /dev/null 2>&1 + rm -rf "$tmp".* "$testdir" +} + +# get standard environment, filters and checks +. ./common/rc +. ./common/filter +. ./common/xfs + +# real QA test starts here +_supported_os Linux +_supported_fs xfs +_require_xfs_scratch_rmapbt +_require_xfs_io_command "fpunch" + +rm -f "$seqres.full" + +_scratch_mkfs >/dev/null 2>&1 +_scratch_mount + +testdir="$SCRATCH_MNT/test-$seq" +rm -rf "$testdir" +mkdir "$testdir" + +echo "Create the original file blocks" +blksz="$(stat -f "$testdir" -c '%S')" +nr_blks=$((8 * blksz / 12)) + +for i in 1 2 x; do + _pwrite_byte 0x61 0 $((blksz * nr_blks)) "$testdir/file1" >> "$seqres.full" + _pwrite_byte 0x62 0 $((blksz * nr_blks)) "$testdir/file2" >> "$seqres.full" + sync + + echo "$i: Reflink every other block" + seq 1 2 $((nr_blks - 1)) | while read nr; do + "$XFS_IO_PROG" -c "fpunch $((nr * blksz)) $blksz" "$testdir/file2" >> "$seqres.full" + done + umount "$SCRATCH_MNT" + _check_scratch_fs + _scratch_mount + + test "$i" = "x" && break + + echo "$i: Delete both files" + rm -rf "$testdir/file1" "$testdir/file2" + umount "$SCRATCH_MNT" + _check_scratch_fs + _scratch_mount +done + +echo "Check for damage" +umount "$SCRATCH_MNT" +_check_scratch_fs + +# success, all done +status=0 +exit diff --git a/tests/xfs/236.out b/tests/xfs/236.out new file mode 100644 index 0000000..237a7e1 --- /dev/null +++ b/tests/xfs/236.out @@ -0,0 +1,8 @@ +QA output created by 236 +Create the original file blocks +1: Reflink every other block +1: Delete both files +2: Reflink every other block +2: Delete both files +x: Reflink every other block +Check for damage diff --git a/tests/xfs/group b/tests/xfs/group index de3c7d6..1d08065 100644 --- a/tests/xfs/group +++ b/tests/xfs/group @@ -230,6 +230,10 @@ 230 auto quick clone 231 auto quick clone 232 auto quick clone +233 auto quick rmap +234 auto quick rmap +235 fuzzers rmap +236 auto quick rmap 238 auto quick metadata ioctl 242 auto quick prealloc 244 auto quota quick From darrick.wong@oracle.com Mon Feb 8 19:14:02 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay1.corp.sgi.com [137.38.102.111]) by oss.sgi.com (Postfix) with ESMTP id 5452B7CA4 for ; Mon, 8 Feb 2016 19:14:02 -0600 (CST) Received: from cuda.sgi.com (cuda2.sgi.com [192.48.176.25]) by relay1.corp.sgi.com (Postfix) with ESMTP id 4B2018F804B for ; Mon, 8 Feb 2016 17:14:02 -0800 (PST) X-ASG-Debug-ID: 1454980438-04cbb0433405a30001-NocioJ Received: from userp1040.oracle.com (userp1040.oracle.com [156.151.31.81]) by cuda.sgi.com with ESMTP id H1czSfINb93pcXbE (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO) for ; Mon, 08 Feb 2016 17:13:59 -0800 (PST) X-Barracuda-Envelope-From: darrick.wong@oracle.com X-Barracuda-Apparent-Source-IP: 156.151.31.81 Received: from userv0022.oracle.com (userv0022.oracle.com [156.151.31.74]) by userp1040.oracle.com (Sentrion-MTA-4.3.2/Sentrion-MTA-4.3.2) with ESMTP id u191Dv9B015787 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 9 Feb 2016 01:13:57 GMT Received: from userv0121.oracle.com (userv0121.oracle.com [156.151.31.72]) by userv0022.oracle.com (8.14.4/8.13.8) with ESMTP id u191Dv8k012763 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=FAIL); Tue, 9 Feb 2016 01:13:57 GMT Received: from abhmp0005.oracle.com (abhmp0005.oracle.com [141.146.116.11]) by userv0121.oracle.com (8.13.8/8.13.8) with ESMTP id u191DvR1025535; Tue, 9 Feb 2016 01:13:57 GMT Received: from localhost (/10.145.178.207) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Mon, 08 Feb 2016 17:13:56 -0800 Subject: [PATCH 20/23] reflink: test aio copy on write From: "Darrick J. Wong" X-ASG-Orig-Subj: [PATCH 20/23] reflink: test aio copy on write To: david@fromorbit.com, darrick.wong@oracle.com Cc: linux-btrfs@vger.kernel.org, fstests@vger.kernel.org, xfs@oss.sgi.com Date: Mon, 08 Feb 2016 17:13:55 -0800 Message-ID: <20160209011355.23099.80973.stgit@birch.djwong.org> In-Reply-To: <20160209011145.23099.95354.stgit@birch.djwong.org> References: <20160209011145.23099.95354.stgit@birch.djwong.org> User-Agent: StGit/0.17.1-dirty MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit X-Source-IP: userv0022.oracle.com [156.151.31.74] X-Barracuda-Connect: userp1040.oracle.com[156.151.31.81] X-Barracuda-Start-Time: 1454980439 X-Barracuda-Encrypted: ECDHE-RSA-AES256-GCM-SHA384 X-Barracuda-URL: https://192.48.176.25:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-BRTS-Status: 1 X-Barracuda-Spam-Score: 0.00 X-Barracuda-Spam-Status: No, SCORE=0.00 using per-user scores of TAG_LEVEL=1000.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.7 tests=BSF_SC0_MISMATCH_TO, UNPARSEABLE_RELAY X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.3.26874 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 0.00 BSF_SC0_MISMATCH_TO Envelope rcpt doesn't match header 0.00 UNPARSEABLE_RELAY Informational: message has unparseable relay lines Make sure that copy on write works with the AIO path. Signed-off-by: Darrick J. Wong --- tests/generic/329 | 105 ++++++++++++++++++++++++++++++++++++++++++++++++ tests/generic/329.out | 12 +++++ tests/generic/330 | 96 ++++++++++++++++++++++++++++++++++++++++++++ tests/generic/330.out | 11 +++++ tests/generic/331 | 107 +++++++++++++++++++++++++++++++++++++++++++++++++ tests/generic/331.out | 12 +++++ tests/generic/332 | 97 ++++++++++++++++++++++++++++++++++++++++++++ tests/generic/332.out | 11 +++++ tests/generic/group | 4 ++ 9 files changed, 455 insertions(+) create mode 100755 tests/generic/329 create mode 100644 tests/generic/329.out create mode 100755 tests/generic/330 create mode 100644 tests/generic/330.out create mode 100755 tests/generic/331 create mode 100644 tests/generic/331.out create mode 100755 tests/generic/332 create mode 100644 tests/generic/332.out diff --git a/tests/generic/329 b/tests/generic/329 new file mode 100755 index 0000000..cf6dab0 --- /dev/null +++ b/tests/generic/329 @@ -0,0 +1,105 @@ +#! /bin/bash +# FS QA Test No. 329 +# +# Test AIO DIO CoW behavior when the write temporarily fails. +# +#----------------------------------------------------------------------- +# Copyright (c) 2016, Oracle and/or its affiliates. All Rights Reserved. +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License as +# published by the Free Software Foundation. +# +# This program is distributed in the hope that it would be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write the Free Software Foundation, +# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA +#----------------------------------------------------------------------- + +seq=`basename "$0"` +seqres="$RESULT_DIR/$seq" +echo "QA output created by $seq" + +here=`pwd` +tmp=/tmp/$$ +status=1 # failure is the default! +trap "_cleanup; exit \$status" 0 1 2 3 15 + +_cleanup() +{ + cd / + rm -rf "$tmp".* "$TEST_DIR/moo" + _dmerror_cleanup +} + +# get standard environment, filters and checks +. ./common/rc +. ./common/filter +. ./common/reflink +. ./common/dmerror + +# real QA test starts here +_supported_os Linux +_require_scratch_reflink +_require_cp_reflink +_require_dm_target error +_require_aiodio "aiocp" + +rm -f "$seqres.full" + + +echo "Format and mount" +_scratch_mkfs > "$seqres.full" 2>&1 +_dmerror_init +_dmerror_mount >> "$seqres.full" 2>&1 + +testdir="$SCRATCH_MNT/test-$seq" +rm -rf $testdir +mkdir $testdir + +blksz=65536 +nr=640 +bsz=128 + +free_blocks=$(stat -f -c '%a' "$testdir") +real_blksz=$(stat -f -c '%S' "$testdir") +space_needed=$(((blksz * nr * 3) * 5 / 4)) +space_avail=$((free_blocks * real_blksz)) +test $space_needed -gt $space_avail && _notrun "Not enough space. $space_avail < $space_needed" + +echo "Create the original files" +"$XFS_IO_PROG" -f -c "pwrite -S 0x61 -b $((blksz * bsz)) 0 $((blksz * nr))" "$testdir/file1" >> "$seqres.full" +_cp_reflink "$testdir/file1" "$testdir/file2" >> "$seqres.full" +_dmerror_unmount +_dmerror_mount + +echo "Compare files" +md5sum "$testdir/file1" | _filter_scratch +md5sum "$testdir/file2" | _filter_scratch + +echo "CoW and unmount" +"$XFS_IO_PROG" -f -c "pwrite -S 0x63 $((blksz * bsz)) 1" "$testdir/file2" >> "$seqres.full" +"$XFS_IO_PROG" -f -c "pwrite -S 0x63 -b $((blksz * bsz)) 0 $((blksz * nr))" "$TEST_DIR/moo" >> "$seqres.full" +sync +_dmerror_load_error_table +"$AIO_TEST" -f DIRECT -b $((blksz * bsz)) "$TEST_DIR/moo" "$testdir/file2" >> "$seqres.full" +_dmerror_load_working_table +_dmerror_unmount +_dmerror_mount + +echo "Compare files" +md5sum "$testdir/file1" | _filter_scratch +md5sum "$testdir/file2" | _filter_scratch + +echo "Check for damage" +_dmerror_unmount +_dmerror_cleanup +_repair_scratch_fs >> "$seqres.full" 2>&1 + +# success, all done +status=0 +exit diff --git a/tests/generic/329.out b/tests/generic/329.out new file mode 100644 index 0000000..f14726c --- /dev/null +++ b/tests/generic/329.out @@ -0,0 +1,12 @@ +QA output created by 329 +Format and mount +Create the original files +Compare files +1886e67cf8783e89ce6ddc5bb09a3944 SCRATCH_MNT/test-329/file1 +1886e67cf8783e89ce6ddc5bb09a3944 SCRATCH_MNT/test-329/file2 +CoW and unmount +write missed bytes expect 8388608 got 0 +Compare files +1886e67cf8783e89ce6ddc5bb09a3944 SCRATCH_MNT/test-329/file1 +d94b0ab13385aba594411c174b1cc13c SCRATCH_MNT/test-329/file2 +Check for damage diff --git a/tests/generic/330 b/tests/generic/330 new file mode 100755 index 0000000..d720f58 --- /dev/null +++ b/tests/generic/330 @@ -0,0 +1,96 @@ +#! /bin/bash +# FS QA Test No. 330 +# +# Test AIO DIO CoW behavior. +# +#----------------------------------------------------------------------- +# Copyright (c) 2016, Oracle and/or its affiliates. All Rights Reserved. +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License as +# published by the Free Software Foundation. +# +# This program is distributed in the hope that it would be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write the Free Software Foundation, +# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA +#----------------------------------------------------------------------- + +seq=`basename "$0"` +seqres="$RESULT_DIR/$seq" +echo "QA output created by $seq" + +here=`pwd` +tmp=/tmp/$$ +status=1 # failure is the default! +trap "_cleanup; exit \$status" 0 1 2 3 15 + +_cleanup() +{ + cd / + rm -rf "$tmp".* "$TEST_DIR/moo" +} + +# get standard environment, filters and checks +. ./common/rc +. ./common/filter +. ./common/reflink + +# real QA test starts here +_supported_os Linux +_require_scratch_reflink +_require_cp_reflink +_require_aiodio "aiocp" + +rm -f "$seqres.full" + + +echo "Format and mount" +_scratch_mkfs > "$seqres.full" 2>&1 +_scratch_mount >> "$seqres.full" 2>&1 + +testdir="$SCRATCH_MNT/test-$seq" +rm -rf $testdir +mkdir $testdir + +blksz=65536 +nr=640 +bsz=128 + +free_blocks=$(stat -f -c '%a' "$testdir") +real_blksz=$(stat -f -c '%S' "$testdir") +space_needed=$(((blksz * nr * 3) * 5 / 4)) +space_avail=$((free_blocks * real_blksz)) +test $space_needed -gt $space_avail && _notrun "Not enough space. $space_avail < $space_needed" + +echo "Create the original files" +"$XFS_IO_PROG" -f -c "pwrite -S 0x61 -b $((blksz * bsz)) 0 $((blksz * nr))" "$testdir/file1" >> "$seqres.full" +_cp_reflink "$testdir/file1" "$testdir/file2" >> "$seqres.full" +_scratch_remount + +echo "Compare files" +md5sum "$testdir/file1" | _filter_scratch +md5sum "$testdir/file2" | _filter_scratch + +echo "CoW and unmount" +"$XFS_IO_PROG" -f -c "pwrite -S 0x63 $((blksz * bsz)) 1" "$testdir/file2" >> "$seqres.full" +sync +"$XFS_IO_PROG" -f -c "pwrite -S 0x63 -b $((blksz * bsz)) 0 $((blksz * nr))" "$TEST_DIR/moo" >> "$seqres.full" +"$AIO_TEST" -f DIRECT -b $((blksz * bsz)) "$TEST_DIR/moo" "$testdir/file2" >> "$seqres.full" +_scratch_remount + +echo "Compare files" +md5sum "$testdir/file1" | _filter_scratch +md5sum "$testdir/file2" | _filter_scratch + +echo "Check for damage" +umount "$SCRATCH_MNT" +_repair_scratch_fs >> "$seqres.full" 2>&1 + +# success, all done +status=0 +exit diff --git a/tests/generic/330.out b/tests/generic/330.out new file mode 100644 index 0000000..9a33a22 --- /dev/null +++ b/tests/generic/330.out @@ -0,0 +1,11 @@ +QA output created by 330 +Format and mount +Create the original files +Compare files +1886e67cf8783e89ce6ddc5bb09a3944 SCRATCH_MNT/test-330/file1 +1886e67cf8783e89ce6ddc5bb09a3944 SCRATCH_MNT/test-330/file2 +CoW and unmount +Compare files +1886e67cf8783e89ce6ddc5bb09a3944 SCRATCH_MNT/test-330/file1 +7a4d22297e80ff3c92cb1b3e4566d234 SCRATCH_MNT/test-330/file2 +Check for damage diff --git a/tests/generic/331 b/tests/generic/331 new file mode 100755 index 0000000..589150b --- /dev/null +++ b/tests/generic/331 @@ -0,0 +1,107 @@ +#! /bin/bash +# FS QA Test No. 331 +# +# Test AIO CoW behavior when the write temporarily fails. +# +#----------------------------------------------------------------------- +# Copyright (c) 2016, Oracle and/or its affiliates. All Rights Reserved. +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License as +# published by the Free Software Foundation. +# +# This program is distributed in the hope that it would be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write the Free Software Foundation, +# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA +#----------------------------------------------------------------------- + +seq=`basename "$0"` +seqres="$RESULT_DIR/$seq" +echo "QA output created by $seq" + +here=`pwd` +tmp=/tmp/$$ +status=1 # failure is the default! +trap "_cleanup; exit \$status" 0 1 2 3 15 + +_cleanup() +{ + cd / + rm -rf "$tmp".* "$TEST_DIR/moo" + _dmerror_cleanup +} + +# get standard environment, filters and checks +. ./common/rc +. ./common/filter +. ./common/reflink +. ./common/dmerror + +# real QA test starts here +_supported_os Linux +_require_scratch_reflink +_require_cp_reflink +_require_dm_target error +AIO_TEST="src/aio-dio-regress/aiocp" +test -x "$AIO_TEST" || _notrun "aiocp not built" + +rm -f "$seqres.full" + + +echo "Format and mount" +_scratch_mkfs > "$seqres.full" 2>&1 +_dmerror_init +_dmerror_mount >> "$seqres.full" 2>&1 + +testdir="$SCRATCH_MNT/test-$seq" +rm -rf $testdir +mkdir $testdir + +blksz=65536 +nr=640 +bsz=128 + +free_blocks=$(stat -f -c '%a' "$testdir") +real_blksz=$(stat -f -c '%S' "$testdir") +space_needed=$(((blksz * nr * 3) * 5 / 4)) +space_avail=$((free_blocks * real_blksz)) +test $space_needed -gt $space_avail && _notrun "Not enough space. $space_avail < $space_needed" + +echo "Create the original files" +"$XFS_IO_PROG" -f -c "pwrite -S 0x61 -b $((blksz * bsz)) 0 $((blksz * nr))" "$testdir/file1" >> "$seqres.full" +_cp_reflink "$testdir/file1" "$testdir/file2" >> "$seqres.full" +_dmerror_unmount +_dmerror_mount + +echo "Compare files" +md5sum "$testdir/file1" | _filter_scratch +md5sum "$testdir/file2" | _filter_scratch + +echo "CoW and unmount" +"$XFS_IO_PROG" -f -c "pwrite -S 0x63 $((blksz * bsz)) 1" "$testdir/file2" >> "$seqres.full" +"$XFS_IO_PROG" -f -c "pwrite -S 0x63 -b $((blksz * bsz)) 0 $((blksz * nr))" "$TEST_DIR/moo" >> "$seqres.full" +sync +_dmerror_load_error_table +"$AIO_TEST" -b $((blksz * bsz)) "$TEST_DIR/moo" "$testdir/file2" >> "$seqres.full" +"$XFS_IO_PROG" -c "fdatasync" "$testdir/file2" +_dmerror_load_working_table +_dmerror_unmount +_dmerror_mount + +echo "Compare files" +md5sum "$testdir/file1" | _filter_scratch +md5sum "$testdir/file2" | _filter_scratch + +echo "Check for damage" +_dmerror_unmount +_dmerror_cleanup +_repair_scratch_fs >> "$seqres.full" 2>&1 + +# success, all done +status=0 +exit diff --git a/tests/generic/331.out b/tests/generic/331.out new file mode 100644 index 0000000..adbf841 --- /dev/null +++ b/tests/generic/331.out @@ -0,0 +1,12 @@ +QA output created by 331 +Format and mount +Create the original files +Compare files +1886e67cf8783e89ce6ddc5bb09a3944 SCRATCH_MNT/test-331/file1 +1886e67cf8783e89ce6ddc5bb09a3944 SCRATCH_MNT/test-331/file2 +CoW and unmount +fdatasync: Input/output error +Compare files +1886e67cf8783e89ce6ddc5bb09a3944 SCRATCH_MNT/test-331/file1 +d94b0ab13385aba594411c174b1cc13c SCRATCH_MNT/test-331/file2 +Check for damage diff --git a/tests/generic/332 b/tests/generic/332 new file mode 100755 index 0000000..7c24a61 --- /dev/null +++ b/tests/generic/332 @@ -0,0 +1,97 @@ +#! /bin/bash +# FS QA Test No. 332 +# +# Test AIO CoW behavior. +# +#----------------------------------------------------------------------- +# Copyright (c) 2016, Oracle and/or its affiliates. All Rights Reserved. +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License as +# published by the Free Software Foundation. +# +# This program is distributed in the hope that it would be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write the Free Software Foundation, +# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA +#----------------------------------------------------------------------- + +seq=`basename "$0"` +seqres="$RESULT_DIR/$seq" +echo "QA output created by $seq" + +here=`pwd` +tmp=/tmp/$$ +status=1 # failure is the default! +trap "_cleanup; exit \$status" 0 1 2 3 15 + +_cleanup() +{ + cd / + rm -rf "$tmp".* "$TEST_DIR/moo" +} + +# get standard environment, filters and checks +. ./common/rc +. ./common/filter +. ./common/reflink + +# real QA test starts here +_supported_os Linux +_require_scratch_reflink +_require_cp_reflink +AIO_TEST="src/aio-dio-regress/aiocp" +test -x "$AIO_TEST" || _notrun "aiocp not built" + +rm -f "$seqres.full" + + +echo "Format and mount" +_scratch_mkfs > "$seqres.full" 2>&1 +_scratch_mount >> "$seqres.full" 2>&1 + +testdir="$SCRATCH_MNT/test-$seq" +rm -rf $testdir +mkdir $testdir + +blksz=65536 +nr=640 +bsz=128 + +free_blocks=$(stat -f -c '%a' "$testdir") +real_blksz=$(stat -f -c '%S' "$testdir") +space_needed=$(((blksz * nr * 3) * 5 / 4)) +space_avail=$((free_blocks * real_blksz)) +test $space_needed -gt $space_avail && _notrun "Not enough space. $space_avail < $space_needed" + +echo "Create the original files" +"$XFS_IO_PROG" -f -c "pwrite -S 0x61 -b $((blksz * bsz)) 0 $((blksz * nr))" "$testdir/file1" >> "$seqres.full" +_cp_reflink "$testdir/file1" "$testdir/file2" >> "$seqres.full" +_scratch_remount + +echo "Compare files" +md5sum "$testdir/file1" | _filter_scratch +md5sum "$testdir/file2" | _filter_scratch + +echo "CoW and unmount" +"$XFS_IO_PROG" -f -c "pwrite -S 0x63 $((blksz * bsz)) 1" "$testdir/file2" >> "$seqres.full" +"$XFS_IO_PROG" -f -c "pwrite -S 0x63 -b $((blksz * bsz)) 0 $((blksz * nr))" "$TEST_DIR/moo" >> "$seqres.full" +sync +"$AIO_TEST" -b $((blksz * bsz)) "$TEST_DIR/moo" "$testdir/file2" >> "$seqres.full" +_scratch_remount + +echo "Compare files" +md5sum "$testdir/file1" | _filter_scratch +md5sum "$testdir/file2" | _filter_scratch + +echo "Check for damage" +umount "$SCRATCH_MNT" +_repair_scratch_fs >> "$seqres.full" 2>&1 + +# success, all done +status=0 +exit diff --git a/tests/generic/332.out b/tests/generic/332.out new file mode 100644 index 0000000..b584b1e --- /dev/null +++ b/tests/generic/332.out @@ -0,0 +1,11 @@ +QA output created by 332 +Format and mount +Create the original files +Compare files +1886e67cf8783e89ce6ddc5bb09a3944 SCRATCH_MNT/test-332/file1 +1886e67cf8783e89ce6ddc5bb09a3944 SCRATCH_MNT/test-332/file2 +CoW and unmount +Compare files +1886e67cf8783e89ce6ddc5bb09a3944 SCRATCH_MNT/test-332/file1 +7a4d22297e80ff3c92cb1b3e4566d234 SCRATCH_MNT/test-332/file2 +Check for damage diff --git a/tests/generic/group b/tests/generic/group index d4531f8..b5ae5ad 100644 --- a/tests/generic/group +++ b/tests/generic/group @@ -331,3 +331,7 @@ 326 auto quick clone 327 auto quick clone 328 auto quick clone +329 auto quick clone +330 auto quick clone +331 auto quick clone +332 auto quick clone From darrick.wong@oracle.com Mon Feb 8 19:14:08 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay2.corp.sgi.com [137.38.102.29]) by oss.sgi.com (Postfix) with ESMTP id E3D9B29E2C for ; Mon, 8 Feb 2016 19:14:08 -0600 (CST) Received: from cuda.sgi.com (cuda1.sgi.com [192.48.157.11]) by relay2.corp.sgi.com (Postfix) with ESMTP id 9CFB3304032 for ; Mon, 8 Feb 2016 17:14:08 -0800 (PST) X-ASG-Debug-ID: 1454980445-04bdf066eb03b60001-NocioJ Received: from aserp1040.oracle.com (aserp1040.oracle.com [141.146.126.69]) by cuda.sgi.com with ESMTP id gL7vKXNohyJVDPDr (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO) for ; Mon, 08 Feb 2016 17:14:05 -0800 (PST) X-Barracuda-Envelope-From: darrick.wong@oracle.com X-Barracuda-Apparent-Source-IP: 141.146.126.69 Received: from userv0022.oracle.com (userv0022.oracle.com [156.151.31.74]) by aserp1040.oracle.com (Sentrion-MTA-4.3.2/Sentrion-MTA-4.3.2) with ESMTP id u191E4KF020551 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 9 Feb 2016 01:14:04 GMT Received: from userv0121.oracle.com (userv0121.oracle.com [156.151.31.72]) by userv0022.oracle.com (8.14.4/8.13.8) with ESMTP id u191E46H013142 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=FAIL); Tue, 9 Feb 2016 01:14:04 GMT Received: from abhmp0017.oracle.com (abhmp0017.oracle.com [141.146.116.23]) by userv0121.oracle.com (8.13.8/8.13.8) with ESMTP id u191E3VB025588; Tue, 9 Feb 2016 01:14:03 GMT Received: from localhost (/10.145.178.207) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Mon, 08 Feb 2016 17:14:03 -0800 Subject: [PATCH 21/23] xfs: aio cow tests From: "Darrick J. Wong" X-ASG-Orig-Subj: [PATCH 21/23] xfs: aio cow tests To: david@fromorbit.com, darrick.wong@oracle.com Cc: linux-btrfs@vger.kernel.org, fstests@vger.kernel.org, xfs@oss.sgi.com Date: Mon, 08 Feb 2016 17:14:01 -0800 Message-ID: <20160209011401.23099.38.stgit@birch.djwong.org> In-Reply-To: <20160209011145.23099.95354.stgit@birch.djwong.org> References: <20160209011145.23099.95354.stgit@birch.djwong.org> User-Agent: StGit/0.17.1-dirty MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit X-Source-IP: userv0022.oracle.com [156.151.31.74] X-Barracuda-Connect: aserp1040.oracle.com[141.146.126.69] X-Barracuda-Start-Time: 1454980445 X-Barracuda-Encrypted: ECDHE-RSA-AES256-GCM-SHA384 X-Barracuda-URL: https://192.48.157.11:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-BRTS-Status: 1 X-Barracuda-Spam-Score: 0.00 X-Barracuda-Spam-Status: No, SCORE=0.00 using per-user scores of TAG_LEVEL=1000.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.7 tests=BSF_SC0_MISMATCH_TO, UNPARSEABLE_RELAY X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.3.26874 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 0.00 BSF_SC0_MISMATCH_TO Envelope rcpt doesn't match header 0.00 UNPARSEABLE_RELAY Informational: message has unparseable relay lines Signed-off-by: Darrick J. Wong --- tests/xfs/237 | 107 ++++++++++++++++++++++++++++++++++++++++++++++++++++ tests/xfs/237.out | 12 ++++++ tests/xfs/239 | 98 ++++++++++++++++++++++++++++++++++++++++++++++++ tests/xfs/239.out | 11 +++++ tests/xfs/240 | 109 +++++++++++++++++++++++++++++++++++++++++++++++++++++ tests/xfs/240.out | 12 ++++++ tests/xfs/241 | 99 ++++++++++++++++++++++++++++++++++++++++++++++++ tests/xfs/241.out | 11 +++++ tests/xfs/group | 4 ++ 9 files changed, 463 insertions(+) create mode 100755 tests/xfs/237 create mode 100644 tests/xfs/237.out create mode 100755 tests/xfs/239 create mode 100644 tests/xfs/239.out create mode 100755 tests/xfs/240 create mode 100644 tests/xfs/240.out create mode 100755 tests/xfs/241 create mode 100644 tests/xfs/241.out diff --git a/tests/xfs/237 b/tests/xfs/237 new file mode 100755 index 0000000..8288724 --- /dev/null +++ b/tests/xfs/237 @@ -0,0 +1,107 @@ +#! /bin/bash +# FS QA Test No. 237 +# +# Test AIO DIO CoW behavior when the write temporarily fails. +# +#----------------------------------------------------------------------- +# Copyright (c) 2016, Oracle and/or its affiliates. All Rights Reserved. +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License as +# published by the Free Software Foundation. +# +# This program is distributed in the hope that it would be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write the Free Software Foundation, +# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA +#----------------------------------------------------------------------- + +seq=`basename "$0"` +seqres="$RESULT_DIR/$seq" +echo "QA output created by $seq" + +here=`pwd` +tmp=/tmp/$$ +status=1 # failure is the default! +trap "_cleanup; exit \$status" 0 1 2 3 15 + +_cleanup() +{ + cd / + rm -rf "$tmp".* "$testdir" "$TEST_DIR/moo" + _dmerror_cleanup +} + +# get standard environment, filters and checks +. ./common/rc +. ./common/filter +. ./common/reflink +. ./common/dmerror + +# real QA test starts here +_supported_os Linux +_require_scratch_reflink +_require_cp_reflink +_require_dm_target error +_require_xfs_io_command "cowextsize" +_require_aiodio "aiocp" + +rm -f "$seqres.full" + + +echo "Format and mount" +_scratch_mkfs > "$seqres.full" 2>&1 +_dmerror_init +_dmerror_mount >> "$seqres.full" 2>&1 + +testdir="$SCRATCH_MNT/test-$seq" +rm -rf $testdir +mkdir $testdir + +blksz=65536 +nr=640 +bsz=128 + +free_blocks=$(stat -f -c '%a' "$testdir") +real_blksz=$(stat -f -c '%S' "$testdir") +space_needed=$(((blksz * nr * 3) * 5 / 4)) +space_avail=$((free_blocks * real_blksz)) +test $space_needed -gt $space_avail && _notrun "Not enough space. $space_avail < $space_needed" + +echo "Create the original files" +"$XFS_IO_PROG" -c "cowextsize $((blksz * bsz * 2))" "$testdir" +"$XFS_IO_PROG" -f -c "pwrite -S 0x61 -b $((blksz * bsz)) 0 $((blksz * nr))" "$testdir/file1" >> "$seqres.full" +_cp_reflink "$testdir/file1" "$testdir/file2" >> "$seqres.full" +_dmerror_unmount +_dmerror_mount + +echo "Compare files" +md5sum "$testdir/file1" | _filter_scratch +md5sum "$testdir/file2" | _filter_scratch + +echo "CoW and unmount" +"$XFS_IO_PROG" -f -c "pwrite -S 0x63 $((blksz * bsz)) 1" "$testdir/file2" >> "$seqres.full" +"$XFS_IO_PROG" -f -c "pwrite -S 0x63 -b $((blksz * bsz)) 0 $((blksz * nr))" "$TEST_DIR/moo" >> "$seqres.full" +sync +_dmerror_load_error_table +"$AIO_TEST" -f DIRECT -b $((blksz * bsz)) "$TEST_DIR/moo" "$testdir/file2" >> "$seqres.full" +_dmerror_load_working_table +_dmerror_unmount +_dmerror_mount + +echo "Compare files" +md5sum "$testdir/file1" | _filter_scratch +md5sum "$testdir/file2" | _filter_scratch + +echo "Check for damage" +_dmerror_unmount +_dmerror_cleanup +_repair_scratch_fs >> "$seqres.full" 2>&1 + +# success, all done +status=0 +exit diff --git a/tests/xfs/237.out b/tests/xfs/237.out new file mode 100644 index 0000000..c83dd8b --- /dev/null +++ b/tests/xfs/237.out @@ -0,0 +1,12 @@ +QA output created by 237 +Format and mount +Create the original files +Compare files +1886e67cf8783e89ce6ddc5bb09a3944 SCRATCH_MNT/test-237/file1 +1886e67cf8783e89ce6ddc5bb09a3944 SCRATCH_MNT/test-237/file2 +CoW and unmount +write missed bytes expect 8388608 got 0 +Compare files +1886e67cf8783e89ce6ddc5bb09a3944 SCRATCH_MNT/test-237/file1 +d94b0ab13385aba594411c174b1cc13c SCRATCH_MNT/test-237/file2 +Check for damage diff --git a/tests/xfs/239 b/tests/xfs/239 new file mode 100755 index 0000000..dfb1107 --- /dev/null +++ b/tests/xfs/239 @@ -0,0 +1,98 @@ +#! /bin/bash +# FS QA Test No. 239 +# +# Test AIO DIO CoW behavior. +# +#----------------------------------------------------------------------- +# Copyright (c) 2016, Oracle and/or its affiliates. All Rights Reserved. +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License as +# published by the Free Software Foundation. +# +# This program is distributed in the hope that it would be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write the Free Software Foundation, +# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA +#----------------------------------------------------------------------- + +seq=`basename "$0"` +seqres="$RESULT_DIR/$seq" +echo "QA output created by $seq" + +here=`pwd` +tmp=/tmp/$$ +status=1 # failure is the default! +trap "_cleanup; exit \$status" 0 1 2 3 15 + +_cleanup() +{ + cd / + rm -rf "$tmp".* "$testdir" "$TEST_DIR/moo" +} + +# get standard environment, filters and checks +. ./common/rc +. ./common/filter +. ./common/reflink + +# real QA test starts here +_supported_os Linux +_require_scratch_reflink +_require_cp_reflink +_require_xfs_io_command "cowextsize" +_require_aiodio "aiocp" + +rm -f "$seqres.full" + + +echo "Format and mount" +_scratch_mkfs > "$seqres.full" 2>&1 +_scratch_mount >> "$seqres.full" 2>&1 + +testdir="$SCRATCH_MNT/test-$seq" +rm -rf $testdir +mkdir $testdir + +blksz=65536 +nr=640 +bsz=128 + +free_blocks=$(stat -f -c '%a' "$testdir") +real_blksz=$(stat -f -c '%S' "$testdir") +space_needed=$(((blksz * nr * 3) * 5 / 4)) +space_avail=$((free_blocks * real_blksz)) +test $space_needed -gt $space_avail && _notrun "Not enough space. $space_avail < $space_needed" + +echo "Create the original files" +"$XFS_IO_PROG" -c "cowextsize $((blksz * bsz * 2))" "$testdir" +"$XFS_IO_PROG" -f -c "pwrite -S 0x61 -b $((blksz * bsz)) 0 $((blksz * nr))" "$testdir/file1" >> "$seqres.full" +_cp_reflink "$testdir/file1" "$testdir/file2" >> "$seqres.full" +_scratch_remount + +echo "Compare files" +md5sum "$testdir/file1" | _filter_scratch +md5sum "$testdir/file2" | _filter_scratch + +echo "CoW and unmount" +"$XFS_IO_PROG" -f -c "pwrite -S 0x63 $((blksz * bsz)) 1" "$testdir/file2" >> "$seqres.full" +sync +"$XFS_IO_PROG" -f -c "pwrite -S 0x63 -b $((blksz * bsz)) 0 $((blksz * nr))" "$TEST_DIR/moo" >> "$seqres.full" +"$AIO_TEST" -f DIRECT -b $((blksz * bsz)) "$TEST_DIR/moo" "$testdir/file2" >> "$seqres.full" +_scratch_remount + +echo "Compare files" +md5sum "$testdir/file1" | _filter_scratch +md5sum "$testdir/file2" | _filter_scratch + +echo "Check for damage" +umount "$SCRATCH_MNT" +_repair_scratch_fs >> "$seqres.full" 2>&1 + +# success, all done +status=0 +exit diff --git a/tests/xfs/239.out b/tests/xfs/239.out new file mode 100644 index 0000000..a123da9 --- /dev/null +++ b/tests/xfs/239.out @@ -0,0 +1,11 @@ +QA output created by 239 +Format and mount +Create the original files +Compare files +1886e67cf8783e89ce6ddc5bb09a3944 SCRATCH_MNT/test-239/file1 +1886e67cf8783e89ce6ddc5bb09a3944 SCRATCH_MNT/test-239/file2 +CoW and unmount +Compare files +1886e67cf8783e89ce6ddc5bb09a3944 SCRATCH_MNT/test-239/file1 +7a4d22297e80ff3c92cb1b3e4566d234 SCRATCH_MNT/test-239/file2 +Check for damage diff --git a/tests/xfs/240 b/tests/xfs/240 new file mode 100755 index 0000000..100beba --- /dev/null +++ b/tests/xfs/240 @@ -0,0 +1,109 @@ +#! /bin/bash +# FS QA Test No. 240 +# +# Test AIO CoW behavior when the write temporarily fails. +# +#----------------------------------------------------------------------- +# Copyright (c) 2016, Oracle and/or its affiliates. All Rights Reserved. +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License as +# published by the Free Software Foundation. +# +# This program is distributed in the hope that it would be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write the Free Software Foundation, +# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA +#----------------------------------------------------------------------- + +seq=`basename "$0"` +seqres="$RESULT_DIR/$seq" +echo "QA output created by $seq" + +here=`pwd` +tmp=/tmp/$$ +status=1 # failure is the default! +trap "_cleanup; exit \$status" 0 1 2 3 15 + +_cleanup() +{ + cd / + rm -rf "$tmp".* "$testdir" "$TEST_DIR/moo" + _dmerror_cleanup +} + +# get standard environment, filters and checks +. ./common/rc +. ./common/filter +. ./common/reflink +. ./common/dmerror + +# real QA test starts here +_supported_os Linux +_require_scratch_reflink +_require_cp_reflink +_require_dm_target error +_require_xfs_io_command "cowextsize" +AIO_TEST="src/aio-dio-regress/aiocp" +test -x "$AIO_TEST" || _notrun "aiocp not built" + +rm -f "$seqres.full" + + +echo "Format and mount" +_scratch_mkfs > "$seqres.full" 2>&1 +_dmerror_init +_dmerror_mount >> "$seqres.full" 2>&1 + +testdir="$SCRATCH_MNT/test-$seq" +rm -rf $testdir +mkdir $testdir + +blksz=65536 +nr=640 +bsz=128 + +free_blocks=$(stat -f -c '%a' "$testdir") +real_blksz=$(stat -f -c '%S' "$testdir") +space_needed=$(((blksz * nr * 3) * 5 / 4)) +space_avail=$((free_blocks * real_blksz)) +test $space_needed -gt $space_avail && _notrun "Not enough space. $space_avail < $space_needed" + +echo "Create the original files" +"$XFS_IO_PROG" -c "cowextsize $((blksz * bsz * 2))" "$testdir" +"$XFS_IO_PROG" -f -c "pwrite -S 0x61 -b $((blksz * bsz)) 0 $((blksz * nr))" "$testdir/file1" >> "$seqres.full" +_cp_reflink "$testdir/file1" "$testdir/file2" >> "$seqres.full" +_dmerror_unmount +_dmerror_mount + +echo "Compare files" +md5sum "$testdir/file1" | _filter_scratch +md5sum "$testdir/file2" | _filter_scratch + +echo "CoW and unmount" +"$XFS_IO_PROG" -f -c "pwrite -S 0x63 $((blksz * bsz)) 1" "$testdir/file2" >> "$seqres.full" +"$XFS_IO_PROG" -f -c "pwrite -S 0x63 -b $((blksz * bsz)) 0 $((blksz * nr))" "$TEST_DIR/moo" >> "$seqres.full" +sync +_dmerror_load_error_table +"$AIO_TEST" -b $((blksz * bsz)) "$TEST_DIR/moo" "$testdir/file2" >> "$seqres.full" +"$XFS_IO_PROG" -c "fdatasync" "$testdir/file2" +_dmerror_load_working_table +_dmerror_unmount +_dmerror_mount + +echo "Compare files" +md5sum "$testdir/file1" | _filter_scratch +md5sum "$testdir/file2" | _filter_scratch + +echo "Check for damage" +_dmerror_unmount +_dmerror_cleanup +_repair_scratch_fs >> "$seqres.full" 2>&1 + +# success, all done +status=0 +exit diff --git a/tests/xfs/240.out b/tests/xfs/240.out new file mode 100644 index 0000000..1a22e8a --- /dev/null +++ b/tests/xfs/240.out @@ -0,0 +1,12 @@ +QA output created by 240 +Format and mount +Create the original files +Compare files +1886e67cf8783e89ce6ddc5bb09a3944 SCRATCH_MNT/test-240/file1 +1886e67cf8783e89ce6ddc5bb09a3944 SCRATCH_MNT/test-240/file2 +CoW and unmount +fdatasync: Input/output error +Compare files +1886e67cf8783e89ce6ddc5bb09a3944 SCRATCH_MNT/test-240/file1 +d94b0ab13385aba594411c174b1cc13c SCRATCH_MNT/test-240/file2 +Check for damage diff --git a/tests/xfs/241 b/tests/xfs/241 new file mode 100755 index 0000000..3fdb9c3 --- /dev/null +++ b/tests/xfs/241 @@ -0,0 +1,99 @@ +#! /bin/bash +# FS QA Test No. 241 +# +# Test AIO CoW behavior. +# +#----------------------------------------------------------------------- +# Copyright (c) 2016, Oracle and/or its affiliates. All Rights Reserved. +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License as +# published by the Free Software Foundation. +# +# This program is distributed in the hope that it would be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write the Free Software Foundation, +# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA +#----------------------------------------------------------------------- + +seq=`basename "$0"` +seqres="$RESULT_DIR/$seq" +echo "QA output created by $seq" + +here=`pwd` +tmp=/tmp/$$ +status=1 # failure is the default! +trap "_cleanup; exit \$status" 0 1 2 3 15 + +_cleanup() +{ + cd / + rm -rf "$tmp".* "$testdir" "$TEST_DIR/moo" +} + +# get standard environment, filters and checks +. ./common/rc +. ./common/filter +. ./common/reflink + +# real QA test starts here +_supported_os Linux +_require_scratch_reflink +_require_cp_reflink +_require_xfs_io_command "cowextsize" +AIO_TEST="src/aio-dio-regress/aiocp" +test -x "$AIO_TEST" || _notrun "aiocp not built" + +rm -f "$seqres.full" + + +echo "Format and mount" +_scratch_mkfs > "$seqres.full" 2>&1 +_scratch_mount >> "$seqres.full" 2>&1 + +testdir="$SCRATCH_MNT/test-$seq" +rm -rf $testdir +mkdir $testdir + +blksz=65536 +nr=640 +bsz=128 + +free_blocks=$(stat -f -c '%a' "$testdir") +real_blksz=$(stat -f -c '%S' "$testdir") +space_needed=$(((blksz * nr * 3) * 5 / 4)) +space_avail=$((free_blocks * real_blksz)) +test $space_needed -gt $space_avail && _notrun "Not enough space. $space_avail < $space_needed" + +echo "Create the original files" +"$XFS_IO_PROG" -c "cowextsize $((blksz * bsz * 2))" "$testdir" +"$XFS_IO_PROG" -f -c "pwrite -S 0x61 -b $((blksz * bsz)) 0 $((blksz * nr))" "$testdir/file1" >> "$seqres.full" +_cp_reflink "$testdir/file1" "$testdir/file2" >> "$seqres.full" +_scratch_remount + +echo "Compare files" +md5sum "$testdir/file1" | _filter_scratch +md5sum "$testdir/file2" | _filter_scratch + +echo "CoW and unmount" +"$XFS_IO_PROG" -f -c "pwrite -S 0x63 $((blksz * bsz)) 1" "$testdir/file2" >> "$seqres.full" +"$XFS_IO_PROG" -f -c "pwrite -S 0x63 -b $((blksz * bsz)) 0 $((blksz * nr))" "$TEST_DIR/moo" >> "$seqres.full" +sync +"$AIO_TEST" -b $((blksz * bsz)) "$TEST_DIR/moo" "$testdir/file2" >> "$seqres.full" +_scratch_remount + +echo "Compare files" +md5sum "$testdir/file1" | _filter_scratch +md5sum "$testdir/file2" | _filter_scratch + +echo "Check for damage" +umount "$SCRATCH_MNT" +_repair_scratch_fs >> "$seqres.full" 2>&1 + +# success, all done +status=0 +exit diff --git a/tests/xfs/241.out b/tests/xfs/241.out new file mode 100644 index 0000000..a7e7df2 --- /dev/null +++ b/tests/xfs/241.out @@ -0,0 +1,11 @@ +QA output created by 241 +Format and mount +Create the original files +Compare files +1886e67cf8783e89ce6ddc5bb09a3944 SCRATCH_MNT/test-241/file1 +1886e67cf8783e89ce6ddc5bb09a3944 SCRATCH_MNT/test-241/file2 +CoW and unmount +Compare files +1886e67cf8783e89ce6ddc5bb09a3944 SCRATCH_MNT/test-241/file1 +7a4d22297e80ff3c92cb1b3e4566d234 SCRATCH_MNT/test-241/file2 +Check for damage diff --git a/tests/xfs/group b/tests/xfs/group index 1d08065..c0ce1f4 100644 --- a/tests/xfs/group +++ b/tests/xfs/group @@ -234,7 +234,11 @@ 234 auto quick rmap 235 fuzzers rmap 236 auto quick rmap +237 auto quick clone 238 auto quick metadata ioctl +239 auto quick clone +240 auto quick clone +241 auto quick clone 242 auto quick prealloc 244 auto quota quick 250 auto quick rw prealloc metadata From darrick.wong@oracle.com Mon Feb 8 19:14:15 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay1.corp.sgi.com [137.38.102.111]) by oss.sgi.com (Postfix) with ESMTP id 8DD7829E22 for ; Mon, 8 Feb 2016 19:14:15 -0600 (CST) Received: from cuda.sgi.com (cuda2.sgi.com [192.48.176.25]) by relay1.corp.sgi.com (Postfix) with ESMTP id 871EB8F8033 for ; Mon, 8 Feb 2016 17:14:15 -0800 (PST) X-ASG-Debug-ID: 1454980451-04cbb0433305a40001-NocioJ Received: from userp1040.oracle.com (userp1040.oracle.com [156.151.31.81]) by cuda.sgi.com with ESMTP id UhMnmY6shU0vXhfe (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO) for ; Mon, 08 Feb 2016 17:14:12 -0800 (PST) X-Barracuda-Envelope-From: darrick.wong@oracle.com X-Barracuda-Apparent-Source-IP: 156.151.31.81 Received: from aserv0022.oracle.com (aserv0022.oracle.com [141.146.126.234]) by userp1040.oracle.com (Sentrion-MTA-4.3.2/Sentrion-MTA-4.3.2) with ESMTP id u191EANs016267 (version=TLSv1 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Tue, 9 Feb 2016 01:14:10 GMT Received: from aserv0121.oracle.com (aserv0121.oracle.com [141.146.126.235]) by aserv0022.oracle.com (8.13.8/8.13.8) with ESMTP id u191EAVi017412 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=FAIL); Tue, 9 Feb 2016 01:14:10 GMT Received: from abhmp0001.oracle.com (abhmp0001.oracle.com [141.146.116.7]) by aserv0121.oracle.com (8.13.8/8.13.8) with ESMTP id u191E90Y028076; Tue, 9 Feb 2016 01:14:09 GMT Received: from localhost (/10.145.178.207) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Mon, 08 Feb 2016 17:14:09 -0800 Subject: [PATCH 22/23] xfs: test xfs_getbmapx behavior with shared extents From: "Darrick J. Wong" X-ASG-Orig-Subj: [PATCH 22/23] xfs: test xfs_getbmapx behavior with shared extents To: david@fromorbit.com, darrick.wong@oracle.com Cc: linux-btrfs@vger.kernel.org, fstests@vger.kernel.org, xfs@oss.sgi.com Date: Mon, 08 Feb 2016 17:14:08 -0800 Message-ID: <20160209011408.23099.85443.stgit@birch.djwong.org> In-Reply-To: <20160209011145.23099.95354.stgit@birch.djwong.org> References: <20160209011145.23099.95354.stgit@birch.djwong.org> User-Agent: StGit/0.17.1-dirty MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit X-Source-IP: aserv0022.oracle.com [141.146.126.234] X-Barracuda-Connect: userp1040.oracle.com[156.151.31.81] X-Barracuda-Start-Time: 1454980452 X-Barracuda-Encrypted: ECDHE-RSA-AES256-GCM-SHA384 X-Barracuda-URL: https://192.48.176.25:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-BRTS-Status: 1 X-Barracuda-Spam-Score: 0.00 X-Barracuda-Spam-Status: No, SCORE=0.00 using per-user scores of TAG_LEVEL=1000.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.7 tests=BSF_SC0_MISMATCH_TO, UNPARSEABLE_RELAY X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.3.26874 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 0.00 BSF_SC0_MISMATCH_TO Envelope rcpt doesn't match header 0.00 UNPARSEABLE_RELAY Informational: message has unparseable relay lines Make sure that xfs_getbmapx behaves properly w.r.t. shared extents and CoW fork reporting. Signed-off-by: Darrick J. Wong --- common/xfs | 19 ++++++ tests/xfs/243 | 169 +++++++++++++++++++++++++++++++++++++++++++++++++++++ tests/xfs/243.out | 27 ++++++++ tests/xfs/245 | 99 +++++++++++++++++++++++++++++++ tests/xfs/245.out | 13 ++++ tests/xfs/group | 2 + 6 files changed, 329 insertions(+) create mode 100755 tests/xfs/243 create mode 100644 tests/xfs/243.out create mode 100755 tests/xfs/245 create mode 100644 tests/xfs/245.out diff --git a/common/xfs b/common/xfs index 2d1a76f..91b7916 100644 --- a/common/xfs +++ b/common/xfs @@ -42,3 +42,22 @@ _require_xfs_scratch_rmapbt() fi _scratch_unmount } + +_xfs_bmapx_find() { + case "$1" in + "attr") + param="a" + ;; + "cow") + param="c" + ;; + *) + param="e" + ;; + esac + shift + file="$1" + shift + + "$XFS_IO_PROG" -c "bmap -${param}lpv" "$file" | grep -c "$@" +} diff --git a/tests/xfs/243 b/tests/xfs/243 new file mode 100755 index 0000000..a97e87e --- /dev/null +++ b/tests/xfs/243 @@ -0,0 +1,169 @@ +#! /bin/bash +# FS QA Test No. 243 +# +# Ensuring that copy on write in buffered mode works when the CoW +# range originally covers multiple extents, some unwritten, some not. +# - Set cowextsize hint. +# - Create a file with the following repeating sequence of blocks: +# 1. reflinked +# 2. unwritten +# 3. hole +# 4. regular block +# 5. delalloc +# - CoW across the halfway mark, starting with the unwritten extent. +# - Check that the files are now different where we say they're different. +# +#----------------------------------------------------------------------- +# Copyright (c) 2016, Oracle and/or its affiliates. All Rights Reserved. +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License as +# published by the Free Software Foundation. +# +# This program is distributed in the hope that it would be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write the Free Software Foundation, +# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA +#----------------------------------------------------------------------- + +seq=`basename "$0"` +seqres="$RESULT_DIR/$seq" +echo "QA output created by $seq" + +here=`pwd` +tmp=/tmp/$$ +status=1 # failure is the default! +trap "_cleanup; exit \$status" 0 1 2 3 15 + +_cleanup() +{ + cd / + rm -rf "$tmp".* +} + +# get standard environment, filters and checks +. ./common/rc +. ./common/filter +. ./common/reflink +. ./common/xfs + +# real QA test starts here +_supported_os Linux +_require_scratch_reflink +_require_xfs_io_command "falloc" +_require_xfs_io_command "fpunch" +_require_cp_reflink + +rm -f "$seqres.full" + +echo "Format and mount" +_scratch_mkfs > "$seqres.full" 2>&1 +_scratch_mount >> "$seqres.full" 2>&1 + +testdir="$SCRATCH_MNT/test-$seq" +rm -rf $testdir +mkdir $testdir + +echo "Create the original files" +blksz=65536 +nr=64 +real_blksz=$(stat -f -c '%S' "$testdir") +internal_blks=$((blksz * nr / real_blksz)) +"$XFS_IO_PROG" -c "cowextsize $((blksz * 16))" "$testdir" >> "$seqres.full" +_pwrite_byte 0x61 0 $((blksz * nr)) "$testdir/file1" >> "$seqres.full" +$XFS_IO_PROG -f -c "truncate $((blksz * nr))" "$testdir/file3" >> "$seqres.full" +# 0 blocks are reflinked +seq 0 5 $nr | while read f; do + _reflink_range "$testdir/file1" $((blksz * f)) "$testdir/file3" $((blksz * f)) $blksz >> "$seqres.full" + _pwrite_byte 0x61 $((blksz * f)) $blksz "$testdir/file3.chk" >> "$seqres.full" +done +# 1 blocks are unwritten +seq 1 5 $nr | while read f; do + $XFS_IO_PROG -f -c "falloc $((blksz * f)) $blksz" "$testdir/file3" >> "$seqres.full" + _pwrite_byte 0x00 $((blksz * f)) $blksz "$testdir/file3.chk" >> "$seqres.full" +done +# 2 blocks are holes +seq 2 5 $nr | while read f; do + _pwrite_byte 0x00 $((blksz * f)) $blksz "$testdir/file3.chk" >> "$seqres.full" +done +# 3 blocks are regular +seq 3 5 $nr | while read f; do + _pwrite_byte 0x71 $((blksz * f)) $blksz "$testdir/file3" >> "$seqres.full" + _pwrite_byte 0x71 $((blksz * f)) $blksz "$testdir/file3.chk" >> "$seqres.full" +done +sync +# 4 blocks are delalloc (do later) +seq 4 5 $nr | while read f; do + _pwrite_byte 0x62 $((blksz * f)) $blksz "$testdir/file3" >> "$seqres.full" + _pwrite_byte 0x62 $((blksz * f)) $blksz "$testdir/file3.chk" >> "$seqres.full" +done + +# 10 blocks are cow'd +seq 0 10 $((nr/2)) | while read f; do + _pwrite_byte 0x61 $((blksz * f)) 1 "$testdir/file3" >> "$seqres.full" + _pwrite_byte 0x61 $((blksz * f)) 1 "$testdir/file3.chk" >> "$seqres.full" +done + +echo "Compare files" +md5sum "$testdir/file1" | _filter_scratch +md5sum "$testdir/file3" | _filter_scratch +md5sum "$testdir/file3.chk" | _filter_scratch + +echo "Dump extents" +"$XFS_IO_PROG" -c "cowextsize" "$testdir/file3" | _filter_scratch +echo "Delayed allocation CoW extents:" +test $(_xfs_bmapx_find cow "$testdir/file3" delalloc) -gt 0 || \ + echo "Expected to find a delalloc CoW extent" +echo "Shared data extents:" +test $(_xfs_bmapx_find data "$testdir/file3" '100000$') -gt 0 || \ + echo "Expected to find a shared data extent" +echo "Unwritten data extents:" +test $(_xfs_bmapx_find data "$testdir/file3" '10000$') -gt 0 || \ + echo "Expected to find an unwritten data extent" +echo "Hole data extents:" +test $(_xfs_bmapx_find data "$testdir/file3" hole) -gt 0 || \ + echo "Expected to find a hole data extent" +echo "Regular data extents:" +test $(_xfs_bmapx_find data "$testdir/file3" '000000$') -gt 0 || \ + echo "Expected to find a regular data extent" + +sync + +echo "Dump extents after sync" +"$XFS_IO_PROG" -c "cowextsize" "$testdir/file3" | _filter_scratch +echo "Delayed allocation CoW extents:" +test $(_xfs_bmapx_find cow "$testdir/file3" -v hole ) -gt 0 || \ + echo "Expected to find a regular CoW extent" +echo "Real CoW extents:" +test $(_xfs_bmapx_find cow "$testdir/file3" delalloc ) -eq 0 || \ + echo "Expected to find zero delalloc CoW extent" +echo "Shared data extents:" +test $(_xfs_bmapx_find data "$testdir/file3" '100000$') -gt 0 || \ + echo "Expected to find a shared data extent" +echo "Unwritten data extents:" +test $(_xfs_bmapx_find data "$testdir/file3" '10000$') -gt 0 || \ + echo "Expected to find an unwritten data extent" +echo "Hole data extents:" +test $(_xfs_bmapx_find data "$testdir/file3" hole) -gt 0 || \ + echo "Expected to find a hole data extent" +echo "Regular data extents:" +test $(_xfs_bmapx_find data "$testdir/file3" '000000$') -gt 0 || \ + echo "Expected to find a regular data extent" + +_scratch_remount + +echo "Compare files" +md5sum "$testdir/file1" | _filter_scratch +md5sum "$testdir/file3" | _filter_scratch +md5sum "$testdir/file3.chk" | _filter_scratch + +echo "Check for damage" +umount "$SCRATCH_MNT" + +# success, all done +status=0 +exit diff --git a/tests/xfs/243.out b/tests/xfs/243.out new file mode 100644 index 0000000..0390be7 --- /dev/null +++ b/tests/xfs/243.out @@ -0,0 +1,27 @@ +QA output created by 243 +Format and mount +Create the original files +Compare files +bdbcf02ee0aa977795a79d25fcfdccb1 SCRATCH_MNT/test-243/file1 +d0fda5bf5d4fd70904ef1c1c56db28d0 SCRATCH_MNT/test-243/file3 +d0fda5bf5d4fd70904ef1c1c56db28d0 SCRATCH_MNT/test-243/file3.chk +Dump extents +[1048576] SCRATCH_MNT/test-243/file3 +Delayed allocation CoW extents: +Shared data extents: +Unwritten data extents: +Hole data extents: +Regular data extents: +Dump extents after sync +[1048576] SCRATCH_MNT/test-243/file3 +Delayed allocation CoW extents: +Real CoW extents: +Shared data extents: +Unwritten data extents: +Hole data extents: +Regular data extents: +Compare files +bdbcf02ee0aa977795a79d25fcfdccb1 SCRATCH_MNT/test-243/file1 +d0fda5bf5d4fd70904ef1c1c56db28d0 SCRATCH_MNT/test-243/file3 +d0fda5bf5d4fd70904ef1c1c56db28d0 SCRATCH_MNT/test-243/file3.chk +Check for damage diff --git a/tests/xfs/245 b/tests/xfs/245 new file mode 100755 index 0000000..8da1abe --- /dev/null +++ b/tests/xfs/245 @@ -0,0 +1,99 @@ +#! /bin/bash +# FS QA Test No. 245 +# +# Make sure that reflink deals with extents going beyond EOF. +# - fallocate 256k in file1 +# - pwrite 252-257k to cause it to speculatively prealloc file1 +# - reflink file1 to file2 +# - compare file[12] +# +#----------------------------------------------------------------------- +# Copyright (c) 2016, Oracle and/or its affiliates. All Rights Reserved. +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License as +# published by the Free Software Foundation. +# +# This program is distributed in the hope that it would be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write the Free Software Foundation, +# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA +#----------------------------------------------------------------------- + +seq=`basename "$0"` +seqres="$RESULT_DIR/$seq" +echo "QA output created by $seq" + +here=`pwd` +tmp=/tmp/$$ +status=1 # failure is the default! +trap "_cleanup; exit \$status" 0 1 2 3 15 + +_cleanup() +{ + cd / + rm -rf "$tmp".* +} + +# get standard environment, filters and checks +. ./common/rc +. ./common/filter +. ./common/reflink +. ./common/xfs + +# real QA test starts here +_supported_os Linux +_require_scratch_reflink +_require_xfs_io_command "falloc" +_require_cp_reflink + +rm -f "$seqres.full" + +echo "Format and mount" +_scratch_mkfs > "$seqres.full" 2>&1 +_scratch_mount >> "$seqres.full" 2>&1 + +testdir="$SCRATCH_MNT/test-$seq" +rm -rf $testdir +mkdir $testdir + +echo "Create the original files" +"$XFS_IO_PROG" -f -c "falloc 0 256k" -c "pwrite 252k 6k" "$testdir/file1" >> "$seqres.full" +_scratch_remount +_cp_reflink "$testdir/file1" "$testdir/file2" >> "$seqres.full" + +echo "Compare files" +md5sum "$testdir/file1" | _filter_scratch +md5sum "$testdir/file2" | _filter_scratch + +echo "Unwritten data extents" +test $(_xfs_bmapx_find data "$testdir/file1" '10000$') -gt 0 || \ + echo "Expected to find an unwritten file1 extent" +echo "Shared data extents" +test $(_xfs_bmapx_find data "$testdir/file1" '100000$') -gt 0 || \ + echo "Expected to find a shared data extent" + +echo "Hole data extents" +test $(_xfs_bmapx_find data "$testdir/file2" 'hole') -gt 0 || \ + echo "Expected to find a hole data extent" +echo "Shared data extents" +test $(_xfs_bmapx_find data "$testdir/file2" '100000$') -gt 0 || \ + echo "Expected to find a shared data extent" + +echo "Hole cow extents" +test $(_xfs_bmapx_find cow "$testdir/file1" 'hole') -gt 0 || \ + echo "Expected to find a hole cow extent" +echo "Hole cow extents" +test $(_xfs_bmapx_find cow "$testdir/file2" 'hole') -gt 0 || \ + echo "Expected to find a hole cow extent" + +echo "Check for damage" +umount "$SCRATCH_MNT" + +# success, all done +status=0 +exit diff --git a/tests/xfs/245.out b/tests/xfs/245.out new file mode 100644 index 0000000..92a2cbe --- /dev/null +++ b/tests/xfs/245.out @@ -0,0 +1,13 @@ +QA output created by 245 +Format and mount +Create the original files +Compare files +b0b91e1a18165fcd6549f2f5f3ef4823 SCRATCH_MNT/test-245/file1 +b0b91e1a18165fcd6549f2f5f3ef4823 SCRATCH_MNT/test-245/file2 +Unwritten data extents +Shared data extents +Hole data extents +Shared data extents +Hole cow extents +Hole cow extents +Check for damage diff --git a/tests/xfs/group b/tests/xfs/group index c0ce1f4..23fc180 100644 --- a/tests/xfs/group +++ b/tests/xfs/group @@ -240,7 +240,9 @@ 240 auto quick clone 241 auto quick clone 242 auto quick prealloc +243 auto quick clone 244 auto quota quick +245 auto quick clone 250 auto quick rw prealloc metadata 252 auto quick prealloc 253 auto quick From darrick.wong@oracle.com Mon Feb 8 19:14:21 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay1.corp.sgi.com [137.38.102.111]) by oss.sgi.com (Postfix) with ESMTP id 849BD29E21 for ; Mon, 8 Feb 2016 19:14:21 -0600 (CST) Received: from cuda.sgi.com (cuda1.sgi.com [192.48.157.11]) by relay1.corp.sgi.com (Postfix) with ESMTP id 600C88F8033 for ; Mon, 8 Feb 2016 17:14:21 -0800 (PST) X-ASG-Debug-ID: 1454980458-04bdf066eb03b70001-NocioJ Received: from userp1040.oracle.com (userp1040.oracle.com [156.151.31.81]) by cuda.sgi.com with ESMTP id uDAtv2WRbYfclzUx (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO) for ; Mon, 08 Feb 2016 17:14:18 -0800 (PST) X-Barracuda-Envelope-From: darrick.wong@oracle.com X-Barracuda-Apparent-Source-IP: 156.151.31.81 Received: from aserv0022.oracle.com (aserv0022.oracle.com [141.146.126.234]) by userp1040.oracle.com (Sentrion-MTA-4.3.2/Sentrion-MTA-4.3.2) with ESMTP id u191EGBf016299 (version=TLSv1 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Tue, 9 Feb 2016 01:14:17 GMT Received: from aserv0122.oracle.com (aserv0122.oracle.com [141.146.126.236]) by aserv0022.oracle.com (8.13.8/8.13.8) with ESMTP id u191EGVJ017526 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=FAIL); Tue, 9 Feb 2016 01:14:16 GMT Received: from abhmp0009.oracle.com (abhmp0009.oracle.com [141.146.116.15]) by aserv0122.oracle.com (8.13.8/8.13.8) with ESMTP id u191EGd9028119; Tue, 9 Feb 2016 01:14:16 GMT Received: from localhost (/10.145.178.207) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Mon, 08 Feb 2016 17:14:16 -0800 Subject: [PATCH 23/23] reflink: test reflink+cow+enospc all at the same time From: "Darrick J. Wong" X-ASG-Orig-Subj: [PATCH 23/23] reflink: test reflink+cow+enospc all at the same time To: david@fromorbit.com, darrick.wong@oracle.com Cc: linux-btrfs@vger.kernel.org, fstests@vger.kernel.org, xfs@oss.sgi.com Date: Mon, 08 Feb 2016 17:14:14 -0800 Message-ID: <20160209011414.23099.38917.stgit@birch.djwong.org> In-Reply-To: <20160209011145.23099.95354.stgit@birch.djwong.org> References: <20160209011145.23099.95354.stgit@birch.djwong.org> User-Agent: StGit/0.17.1-dirty MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit X-Source-IP: aserv0022.oracle.com [141.146.126.234] X-Barracuda-Connect: userp1040.oracle.com[156.151.31.81] X-Barracuda-Start-Time: 1454980458 X-Barracuda-Encrypted: ECDHE-RSA-AES256-GCM-SHA384 X-Barracuda-URL: https://192.48.157.11:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-BRTS-Status: 1 X-Barracuda-Spam-Score: 0.00 X-Barracuda-Spam-Status: No, SCORE=0.00 using per-user scores of TAG_LEVEL=1000.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.7 tests=BSF_SC0_MISMATCH_TO, UNPARSEABLE_RELAY X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.3.26874 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 0.00 BSF_SC0_MISMATCH_TO Envelope rcpt doesn't match header 0.00 UNPARSEABLE_RELAY Informational: message has unparseable relay lines Set up an impossibly small filesystem and try to reflink and rewrite a file on it to see what happens when we ENOSPC. Basically generic/16[67] but with a constrained fs size. Signed-off-by: Darrick J. Wong --- tests/generic/166 | 6 ++- tests/generic/167 | 6 ++- tests/generic/333 | 104 +++++++++++++++++++++++++++++++++++++++++++++++++ tests/generic/333.out | 6 +++ tests/generic/334 | 104 +++++++++++++++++++++++++++++++++++++++++++++++++ tests/generic/334.out | 6 +++ tests/generic/group | 2 + 7 files changed, 232 insertions(+), 2 deletions(-) create mode 100755 tests/generic/333 create mode 100644 tests/generic/333.out create mode 100755 tests/generic/334 create mode 100644 tests/generic/334.out diff --git a/tests/generic/166 b/tests/generic/166 index 2c2ff4e..30d76a0 100755 --- a/tests/generic/166 +++ b/tests/generic/166 @@ -69,7 +69,11 @@ _scratch_remount snappy() { n=0 while [ ! -e "$testdir/finished" ]; do - _cp_reflink "$testdir/file1" "$testdir/snap_$n" || break + out="$(_cp_reflink "$testdir/file1" "$testdir/snap_$n" 2>&1)" + res=$? + echo "$out" | grep -q "No space left" && break + test -n "$out" && echo "$out" + test $res -ne 0 && break n=$((n + 1)) done } diff --git a/tests/generic/167 b/tests/generic/167 index b80b481..5198a81 100755 --- a/tests/generic/167 +++ b/tests/generic/167 @@ -69,7 +69,11 @@ _scratch_remount snappy() { n=0 while [ ! -e "$testdir/finished" ]; do - _cp_reflink "$testdir/file1" "$testdir/snap_$n" || break + out="$(_cp_reflink "$testdir/file1" "$testdir/snap_$n" 2>&1)" + res=$? + echo "$out" | grep -q "No space left" && break + test -n "$out" && echo "$out" + test $res -ne 0 && break n=$((n + 1)) done } diff --git a/tests/generic/333 b/tests/generic/333 new file mode 100755 index 0000000..4ca7803 --- /dev/null +++ b/tests/generic/333 @@ -0,0 +1,104 @@ +#! /bin/bash +# FS QA Test No. 333 +# +# Test for races or FS corruption when trying to hit ENOSPC while DIO writing +# to a file that's also the source of a reflink operation. +# +#----------------------------------------------------------------------- +# Copyright (c) 2016 Oracle, Inc. All Rights Reserved. +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License as +# published by the Free Software Foundation. +# +# This program is distributed in the hope that it would be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write the Free Software Foundation, +# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA +#----------------------------------------------------------------------- +# + +seq=`basename "$0"` +seqres="$RESULT_DIR/$seq" +echo "QA output created by $seq" + +here=`pwd` +tmp=/tmp/$$ +status=1 # failure is the default! +trap "_cleanup; exit \$status" 0 1 2 3 7 15 + +_cleanup() +{ + cd / + rm -rf "$tmp".* + wait +} + +# get standard environment, filters and checks +. ./common/rc +. ./common/filter +. ./common/reflink + +# real QA test starts here +_supported_os Linux +_require_scratch_reflink +_require_cp_reflink + +echo "Format and mount" +_scratch_mkfs_sized $((400 * 1048576)) > "$seqres.full" 2>&1 +_scratch_mount >> "$seqres.full" 2>&1 + +testdir="$SCRATCH_MNT/test-$seq" +rm -rf "$testdir" +mkdir "$testdir" + +loops=1024 +nr_loops=$((loops - 1)) +blksz=65536 + +echo "Initialize file" +echo > "$seqres.full" +_pwrite_byte 0x61 0 $((loops * blksz)) "$testdir/file1" >> "$seqres.full" +_scratch_remount + +# Snapshot creator... +snappy() { + n=0 + while [ ! -e "$testdir/finished" ]; do + out="$(_cp_reflink "$testdir/file1" "$testdir/snap_$n" 2>&1)" + res=$? + echo "$out" | grep -q "No space left" && break + test -n "$out" && echo "$out" + test $res -ne 0 && break + n=$((n + 1)) + done + touch "$testdir/abort" +} + +echo "Snapshot a file undergoing directio rewrite" +snappy & +seq 1 1000 | while read i; do + seq $nr_loops -1 0 | while read i; do + out="$(_pwrite_byte 0x63 $((i * blksz)) $blksz -d "$testdir/file1" 2>&1)" + echo "$out" >> "$seqres.full" + echo "$out" | grep -q "No space left" && touch "$testdir/abort" + echo "$out" | grep -qi "error" && touch "$testdir/abort" + test -e "$testdir/abort" && break + done + test -e "$testdir/abort" && break +done +touch "$testdir/finished" +wait + +echo "Check for damage" +_scratch_unmount + +echo "Done" + +# success, all done +status=0 +exit diff --git a/tests/generic/333.out b/tests/generic/333.out new file mode 100644 index 0000000..501f2d6 --- /dev/null +++ b/tests/generic/333.out @@ -0,0 +1,6 @@ +QA output created by 333 +Format and mount +Initialize file +Snapshot a file undergoing directio rewrite +Check for damage +Done diff --git a/tests/generic/334 b/tests/generic/334 new file mode 100755 index 0000000..a246711 --- /dev/null +++ b/tests/generic/334 @@ -0,0 +1,104 @@ +#! /bin/bash +# FS QA Test No. 334 +# +# Test for races or FS corruption when trying to hit ENOSPC while DIO writing +# to a file that's also the source of a reflink operation. +# +#----------------------------------------------------------------------- +# Copyright (c) 2016 Oracle, Inc. All Rights Reserved. +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License as +# published by the Free Software Foundation. +# +# This program is distributed in the hope that it would be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write the Free Software Foundation, +# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA +#----------------------------------------------------------------------- +# + +seq=`basename "$0"` +seqres="$RESULT_DIR/$seq" +echo "QA output created by $seq" + +here=`pwd` +tmp=/tmp/$$ +status=1 # failure is the default! +trap "_cleanup; exit \$status" 0 1 2 3 7 15 + +_cleanup() +{ + cd / + rm -rf "$tmp".* + wait +} + +# get standard environment, filters and checks +. ./common/rc +. ./common/filter +. ./common/reflink + +# real QA test starts here +_supported_os Linux +_require_scratch_reflink +_require_cp_reflink + +echo "Format and mount" +_scratch_mkfs_sized $((400 * 1048576)) > "$seqres.full" 2>&1 +_scratch_mount >> "$seqres.full" 2>&1 + +testdir="$SCRATCH_MNT/test-$seq" +rm -rf "$testdir" +mkdir "$testdir" + +loops=1024 +nr_loops=$((loops - 1)) +blksz=65536 + +echo "Initialize file" +echo > "$seqres.full" +_pwrite_byte 0x61 0 $((loops * blksz)) "$testdir/file1" >> "$seqres.full" +_scratch_remount + +# Snapshot creator... +snappy() { + n=0 + while [ ! -e "$testdir/finished" ]; do + out="$(_cp_reflink "$testdir/file1" "$testdir/snap_$n" 2>&1)" + res=$? + echo "$out" | grep -q "No space left" && break + test -n "$out" && echo "$out" + test $res -ne 0 && break + n=$((n + 1)) + done + touch "$testdir/abort" +} + +echo "Snapshot a file undergoing buffered rewrite" +snappy & +seq 1 1000 | while read i; do + seq $nr_loops -1 0 | while read i; do + out="$(_pwrite_byte 0x63 $((i * blksz)) $blksz "$testdir/file1" 2>&1)" + echo "$out" >> "$seqres.full" + echo "$out" | grep -q "No space left" && touch "$testdir/abort" + echo "$out" | grep -qi "error" && touch "$testdir/abort" + test -e "$testdir/abort" && break + done + test -e "$testdir/abort" && break +done +touch "$testdir/finished" +wait + +echo "Check for damage" +_scratch_unmount + +echo "Done" + +# success, all done +status=0 +exit diff --git a/tests/generic/334.out b/tests/generic/334.out new file mode 100644 index 0000000..c196ff1 --- /dev/null +++ b/tests/generic/334.out @@ -0,0 +1,6 @@ +QA output created by 334 +Format and mount +Initialize file +Snapshot a file undergoing buffered rewrite +Check for damage +Done diff --git a/tests/generic/group b/tests/generic/group index b5ae5ad..a23ffc9 100644 --- a/tests/generic/group +++ b/tests/generic/group @@ -335,3 +335,5 @@ 330 auto quick clone 331 auto quick clone 332 auto quick clone +333 auto quick clone +334 auto quick clone From sandeen@sandeen.net Mon Feb 8 20:06:18 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=ham version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay1.corp.sgi.com [137.38.102.111]) by oss.sgi.com (Postfix) with ESMTP id B58B229DF5 for ; Mon, 8 Feb 2016 20:06:18 -0600 (CST) Received: from cuda.sgi.com (cuda3.sgi.com [192.48.176.15]) by relay1.corp.sgi.com (Postfix) with ESMTP id 99E0A8F8040 for ; Mon, 8 Feb 2016 18:06:15 -0800 (PST) X-ASG-Debug-ID: 1454983568-04cb6c1e5605ab0001-NocioJ Received: from sandeen.net (sandeen.net [63.231.237.45]) by cuda.sgi.com with ESMTP id 6imGEV3ykGZCB0dT for ; Mon, 08 Feb 2016 18:06:08 -0800 (PST) X-Barracuda-Envelope-From: sandeen@sandeen.net X-Barracuda-Apparent-Source-IP: 63.231.237.45 Received: from liberator.sandeen.net (liberator.sandeen.net [10.0.0.4]) (using TLSv1.2 with cipher DHE-RSA-AES128-SHA (128/128 bits)) (No client certificate requested) by sandeen.net (Postfix) with ESMTPSA id 8EEBA6131005 for ; Mon, 8 Feb 2016 20:06:08 -0600 (CST) Subject: Re: [PATCH] xfs: log recovery needs to be aware of CONFIG_XFS_RT now To: xfs@oss.sgi.com X-ASG-Orig-Subj: Re: [PATCH] xfs: log recovery needs to be aware of CONFIG_XFS_RT now References: <20160208060751.GA27429@dastard> <20160208153720.GG19597@bfoster.bfoster> <20160208195253.GI27429@dastard> <20160208233350.GO27429@dastard> From: Eric Sandeen Message-ID: <56B94990.5080707@sandeen.net> Date: Mon, 8 Feb 2016 20:06:08 -0600 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.11; rv:38.0) Gecko/20100101 Thunderbird/38.5.1 MIME-Version: 1.0 In-Reply-To: <20160208233350.GO27429@dastard> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit X-Barracuda-Connect: sandeen.net[63.231.237.45] X-Barracuda-Start-Time: 1454983568 X-Barracuda-URL: https://192.48.176.15:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-BRTS-Status: 1 X-Barracuda-Spam-Score: 0.00 X-Barracuda-Spam-Status: No, SCORE=0.00 using per-user scores of TAG_LEVEL=1000.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.7 tests= X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.3.26875 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- On 2/8/16 5:33 PM, Dave Chinner wrote: > From: Dave Chinner > > As it uses buffer verifiers that only exist when CONFIG_XFS_RT=y. > > Signed-off-by: Dave Chinner Reviewed-by: Eric Sandeen > --- > Note: I will fold this back into the original patch that caused > this build regression and rebuild the for-next tree. > > fs/xfs/xfs_log_recover.c | 2 ++ > 1 file changed, 2 insertions(+) > > diff --git a/fs/xfs/xfs_log_recover.c b/fs/xfs/xfs_log_recover.c > index 23ad143..1dc0e14 100644 > --- a/fs/xfs/xfs_log_recover.c > +++ b/fs/xfs/xfs_log_recover.c > @@ -2472,11 +2472,13 @@ xlog_recover_validate_buf_type( > } > bp->b_ops = &xfs_sb_buf_ops; > break; > +#ifdef CONFIG_XFS_RT > case XFS_BLFT_RTBITMAP_BUF: > case XFS_BLFT_RTSUMMARY_BUF: > /* no magic numbers for verification of RT buffers */ > bp->b_ops = &xfs_rtbuf_ops; > break; > +#endif /* CONFIG_XFS_RT */ > default: > xfs_warn(mp, "Unknown buffer type %d!", > xfs_blft_from_flags(buf_f)); > > _______________________________________________ > xfs mailing list > xfs@oss.sgi.com > http://oss.sgi.com/mailman/listinfo/xfs > From david@fromorbit.com Tue Feb 9 00:49:50 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=ham version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay3.corp.sgi.com [198.149.34.15]) by oss.sgi.com (Postfix) with ESMTP id EDD2F7CA2 for ; Tue, 9 Feb 2016 00:49:49 -0600 (CST) Received: from cuda.sgi.com (cuda3.sgi.com [192.48.176.15]) by relay3.corp.sgi.com (Postfix) with ESMTP id 6CDDAAC005 for ; Mon, 8 Feb 2016 22:49:46 -0800 (PST) X-ASG-Debug-ID: 1455000582-04cb6c1e5911e40001-NocioJ Received: from ipmail06.adl2.internode.on.net (ipmail06.adl2.internode.on.net [150.101.137.129]) by cuda.sgi.com with ESMTP id JvqgcHyCz5Qx5PeY for ; Mon, 08 Feb 2016 22:49:43 -0800 (PST) X-Barracuda-Envelope-From: david@fromorbit.com X-Barracuda-Apparent-Source-IP: 150.101.137.129 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: A2DECQBNi7lWPBATLHleKAECgw8iMG2GY4F5nTACChIGgQ+KWIVFhAcXAoVuBIE4TQEBAQEBAQcBAQEBQT+FHjskNAUlAwctiBqfGp50CBiFMol9gXwLQIEnBYdTjySFTId7jnoCjj+CGAsBAQGCNCguiFMBAQE Received: from ppp121-44-19-16.lns20.syd4.internode.on.net (HELO dastard) ([121.44.19.16]) by ipmail06.adl2.internode.on.net with ESMTP; 09 Feb 2016 17:19:41 +1030 Received: from dave by dastard with local (Exim 4.80) (envelope-from ) id 1aT27I-00024F-QR for xfs@oss.sgi.com; Tue, 09 Feb 2016 17:49:40 +1100 Date: Tue, 9 Feb 2016 17:49:40 +1100 From: Dave Chinner To: xfs@oss.sgi.com Subject: [ANNOUNCE] xfs: for-next branch rebased to 4faac78 Message-ID: <20160209064940.GQ27429@dastard> X-ASG-Orig-Subj: [ANNOUNCE] xfs: for-next branch rebased to 4faac78 MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="DocE+STaALJfprDB" Content-Disposition: inline User-Agent: Mutt/1.5.21 (2010-09-15) X-Barracuda-Connect: ipmail06.adl2.internode.on.net[150.101.137.129] X-Barracuda-Start-Time: 1455000582 X-Barracuda-URL: https://192.48.176.15:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-BRTS-Status: 1 X-Barracuda-Spam-Score: 0.00 X-Barracuda-Spam-Status: No, SCORE=0.00 using per-user scores of TAG_LEVEL=1000.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.7 tests= X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.3.26880 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- --DocE+STaALJfprDB Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Hi folks, The for-next branch of the xfs kernel repository at git://git.kernel.org/pub/scm/linux/kernel/git/dgc/linux-xfs.git has just been updated. This is a rebase due to needing to fix the commits in the xfs-rt-fixes-4.6 branch due to a build failure. It also includes the struct xfs_icdinode size reduction patchset. See the commit list below for all the new commits compared to the previous for-next branch. -Dave. The new head of the for-next branch is commit: 4faac78 Merge branch 'xfs-gut-icdinode-4.6' into for-next New Commits: Dave Chinner (16): [f67ca6e] xfs: RT bitmap and summary buffers are not typed [bf85e09] xfs: RT bitmap and summary buffers need verifiers [f8d55aa] xfs: introduce inode log format object [3987848] xfs: remove timestamps from incore inode [93f958f] xfs: cull unnecessary icdinode fields [faeb4e4] xfs: move v1 inode conversion to xfs_inode_from_disk [5099747] xfs: reinitialise recycled VFS inode correctly [54d7b5c] xfs: use vfs inode nlink field everywhere [9e9a267] xfs: move inode generation count to VFS inode [83e06f2] xfs: move di_changecount to VFS inode [c19b3b05] xfs: mode di_mode to vfs inode [fc0f49c] Merge branch 'xfs-rt-fixes-4.6' into for-next [4f22770] Merge branch 'xfs-get-next-dquot-4.6' into for-next [0294f79] Merge branch 'xfs-dio-fix-4.6' into for-next [18c5e03] Merge branch 'xfs-misc-fixes-4.6' into for-next [4faac78] Merge branch 'xfs-gut-icdinode-4.6' into for-next Code Diffstat: fs/xfs/libxfs/xfs_bmap.c | 6 +- fs/xfs/libxfs/xfs_dir2.c | 12 +-- fs/xfs/libxfs/xfs_inode_buf.c | 170 ++++++++++++++++++++++++++-----------= --- fs/xfs/libxfs/xfs_inode_buf.h | 38 ++++++++- fs/xfs/libxfs/xfs_inode_fork.c | 2 +- fs/xfs/libxfs/xfs_log_format.h | 17 ++-- fs/xfs/libxfs/xfs_rtbitmap.c | 2 +- fs/xfs/xfs_bmap_util.c | 4 +- fs/xfs/xfs_dir2_readdir.c | 2 +- fs/xfs/xfs_export.c | 2 +- fs/xfs/xfs_file.c | 6 +- fs/xfs/xfs_filestream.c | 4 +- fs/xfs/xfs_icache.c | 43 +++++++++-- fs/xfs/xfs_inode.c | 172 +++++++++++++++++--------------------= ---- fs/xfs/xfs_inode.h | 8 +- fs/xfs/xfs_inode_item.c | 82 ++++++++++++++++++-- fs/xfs/xfs_ioctl.c | 16 ++-- fs/xfs/xfs_iops.c | 53 +++---------- fs/xfs/xfs_itable.c | 22 +++--- fs/xfs/xfs_log_recover.c | 60 +++++++------- fs/xfs/xfs_mount.c | 2 +- fs/xfs/xfs_rtalloc.c | 2 +- fs/xfs/xfs_trans_inode.c | 14 +--- 23 files changed, 431 insertions(+), 308 deletions(-) --=20 Dave Chinner david@fromorbit.com --DocE+STaALJfprDB Content-Type: application/pgp-signature; name="signature.asc" Content-Description: Digital signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.12 (GNU/Linux) iQIcBAEBAgAGBQJWuYwEAAoJEK3oKUf0dfodurUP/1EATQ+mGOPZsR3ZCXVquDQJ 2SSuGFpaMC/LqKMZzYhv5/vV+jWagNPOZ3+xqTC22Gl6SldhR7EBDKDe4pwgEJUA S3wNXXwOxWD79CbmcqDVHSofnnZgCaegCGYen4H3I8H7iurM9RPz0h8ClB8VYLNk QQHEEzfO3ahnHyZr5lsY2718RZjXjqvkugEkT/cH5ve/iRscA7gMeLogXUl8WIMS jwuYDIWUWkYN6vo5T2vdVQAXrUeTfRrM5sfYmfdM40UlVlFoQtCB7pu3oy/O5Fcz wg+d9eEHzRD56gA2wRC1I0IO5wtffxgg+OUdWYnsSMLgtLJr8zKQh/whPQUgRtNu oXQCyaFwZu75Y8tMcf/KuX2nyvhX1hgcpYbZbKC+zwYhq4DmyDtEfte2VlXdBnx9 LHdhp7EuMmQLMV45GyrSPdUwzbFkaXJRcTjTY3vLW+5AbhrZzgvtPjinsE71LNEq Vqeh+iz4cUh3JUokpgQu3lqAVvHFtier43v4Z71qjrxhgapZaja6yZOMPoa7FoL2 7F6eeUyB7GuiI0e9Dh5PcYij+DCU6ZDXy1WUCfbWEbjzJC+cERgNbHqJoeBY1Xcw O9nj4Ziijv0rukUMpY3bSM71Gnd13VqWonMtqMp1cOIKfDlMmCWAtXGq56vH9StW aCHT/vQy7CWX2U+37CmV =+aFs -----END PGP SIGNATURE----- --DocE+STaALJfprDB-- From david@fromorbit.com Tue Feb 9 01:21:15 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=ham version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay2.corp.sgi.com [137.38.102.29]) by oss.sgi.com (Postfix) with ESMTP id A4B917CA2 for ; Tue, 9 Feb 2016 01:21:15 -0600 (CST) Received: from cuda.sgi.com (cuda1.sgi.com [192.48.157.11]) by relay2.corp.sgi.com (Postfix) with ESMTP id 784B8304039 for ; Mon, 8 Feb 2016 23:21:12 -0800 (PST) X-ASG-Debug-ID: 1455002467-04bdf066ec13a00001-NocioJ Received: from ipmail06.adl2.internode.on.net (ipmail06.adl2.internode.on.net [150.101.137.129]) by cuda.sgi.com with ESMTP id AAmogCG8tlANwEzg for ; Mon, 08 Feb 2016 23:21:08 -0800 (PST) X-Barracuda-Envelope-From: david@fromorbit.com X-Barracuda-Apparent-Source-IP: 150.101.137.129 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: A2CNBwB2krlWPBATLHleKAECgw9SbYhcnU4Gi2eFRYQHIYVmBAICgTRNAQEBAQEBBwEBAQFBP4RBAQEBAwE6HCMFCwgDGAklDwUlAwcaExuHeAcPvVcBAQEBAQUCARkEGIUyhH+EF4RVBYdQhVeBL4QYhAmFTId7jnyOP4MSgUgoLocbgTgBAQE Received: from ppp121-44-19-16.lns20.syd4.internode.on.net (HELO dastard) ([121.44.19.16]) by ipmail06.adl2.internode.on.net with ESMTP; 09 Feb 2016 17:51:07 +1030 Received: from dave by dastard with local (Exim 4.80) (envelope-from ) id 1aT2bi-00026q-7B; Tue, 09 Feb 2016 18:21:06 +1100 Date: Tue, 9 Feb 2016 18:21:06 +1100 From: Dave Chinner To: "Darrick J. Wong" Cc: linux-btrfs@vger.kernel.org, fstests@vger.kernel.org, xfs@oss.sgi.com Subject: Re: [PATCH v4.1 00/23] xfstests: test the nfs/cifs/btrfs/xfs reflink/dedupe ioctls Message-ID: <20160209072106.GH19486@dastard> X-ASG-Orig-Subj: Re: [PATCH v4.1 00/23] xfstests: test the nfs/cifs/btrfs/xfs reflink/dedupe ioctls References: <20160209011145.23099.95354.stgit@birch.djwong.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20160209011145.23099.95354.stgit@birch.djwong.org> User-Agent: Mutt/1.5.21 (2010-09-15) X-Barracuda-Connect: ipmail06.adl2.internode.on.net[150.101.137.129] X-Barracuda-Start-Time: 1455002467 X-Barracuda-URL: https://192.48.157.11:443/cgi-mod/mark.cgi X-Barracuda-BRTS-Status: 1 X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-Spam-Score: 0.00 X-Barracuda-Spam-Status: No, SCORE=0.00 using per-user scores of TAG_LEVEL=1000.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.7 tests=BSF_SC0_MISMATCH_TO X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.3.26881 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 0.00 BSF_SC0_MISMATCH_TO Envelope rcpt doesn't match header On Mon, Feb 08, 2016 at 05:11:45PM -0800, Darrick J. Wong wrote: > Happy New Year! > > Dave Chinner: I've renumbered the new tests and pushed to github[3] if > you'd like to pull. Can you include the commit ID I should see at the head of the tree so I can confirm I'm pulling the right branch? BTW, git doesn't like this: https://github.com/djwong/xfstests/tree/for-dave What git really wants is the tree url with a separate branch name like so: https://github.com/djwong/xfstests.git for-dave (i.e. the typical output from a git request-pull command) > This is a (no longer) small patch set against the reflink/dedupe test > cases in xfstests. The first four patches fix errors in the existing > reflink tests, some of which are from Christoph Hellwig. > > Patches 5-6 refactor the dmerror code so that we can use it to > simulate transient IO errors, then use this code to test that > unwritten extent conversion does NOT happen after a directio write to > an unwritten extent hits a disk error. Due to a bug in the VFS > directio code, ext4 can disclose stale disk contents if an aio dio > write fails; XFS suffers this problem for any failing dio write to an > unwritten extent. Christoph's kernel patchset titled "vfs/xfs: > directio updates to ease COW handling V2" (and a separate ext4 warning > cleanup) is needed to fix this. > > Patches 7-9, 13, 15, 17, 18, 20, 21, and 23 exercise various parts > of the copy on write behavior that are necessary to support shared > blocks. The earlier patches focus on correct CoW behavior in the > presence of IO errors during the copy-write, and the later patches > focus on XFS' new cow-extent-size hint that greatly reduces > fragmentation due to copy on write behavior by encouraging the > allocator to allocate larger extents of replacement blocks. > > Patches 10-12 and 14 perform stress testing on reflink and CoW to > check the behaviors when we get close to maximum refcount, when we > specify obnxiously large offsets and lengths, and when we try to > reflink millions of extents at a time. > > Patch 16 tests quota accounting behavior when reflink is enabled. > > Patch 19 adds a few tests for the XFS reverse mapping btree to ensure > that things like metadump and growfs work correctly. > > Patch 22 checks that get_bmapx and fiemap (on XFS) correctly flag > extents as having shared blocks. XFS now follows btrfs and ocfs2 > FIEMAP behavior such that if any blocks of a file's extent are shared, > the whole extent is marked shared. This is in contrast to earlier > XFS-only behavior that reported shared and non-shared regions as > separate extents. This may change - xfs_bmap doesn't combine extents in it's output even if they are adjacent. For debugging purposes (which is what xfs_bmap/fiemap is for), it's much better to be able to see the exact extent layout and block sharing. I suspect the solution of least surprise is to make fiemap behave like the other filesystems, and make xfs_bmap behave in a manner that is useful to us.... :P > If you're going to start using this mess, you probably ought to just > pull from my github trees for kernel[1], xfsprogs[2], xfstests[3], > xfs-docs[4], and man-pages[5]. All tests should pass on XFS. I > tried btrfs this weekend and it failed 166, 175, 182, 266, 271, 272, > 278, 281, 297, 298, 304, 333, and 334. ocfs2 (when I jury-rigged it > to run the cp_reflink tests) seemed to have a quota bug and crashes > hard in 284 (but was otherwise fine). Fun fun fun. I'll look through the patchs, and if there's nothing major I'll pull it in once I get a commit ID from you. Cheers, Dave. -- Dave Chinner david@fromorbit.com From darrick.wong@oracle.com Tue Feb 9 01:25:20 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay1.corp.sgi.com [137.38.102.111]) by oss.sgi.com (Postfix) with ESMTP id 355537CA2 for ; Tue, 9 Feb 2016 01:25:20 -0600 (CST) Received: from cuda.sgi.com (cuda2.sgi.com [192.48.176.25]) by relay1.corp.sgi.com (Postfix) with ESMTP id 1685F8F8035 for ; Mon, 8 Feb 2016 23:25:17 -0800 (PST) X-ASG-Debug-ID: 1455002714-04cbb0433420100001-NocioJ Received: from aserp1040.oracle.com (aserp1040.oracle.com [141.146.126.69]) by cuda.sgi.com with ESMTP id 84rBg3gqHqYOrXuc (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO) for ; Mon, 08 Feb 2016 23:25:14 -0800 (PST) X-Barracuda-Envelope-From: darrick.wong@oracle.com X-Barracuda-Apparent-Source-IP: 141.146.126.69 Received: from aserv0021.oracle.com (aserv0021.oracle.com [141.146.126.233]) by aserp1040.oracle.com (Sentrion-MTA-4.3.2/Sentrion-MTA-4.3.2) with ESMTP id u197PDdk015075 (version=TLSv1 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Tue, 9 Feb 2016 07:25:13 GMT Received: from aserv0122.oracle.com (aserv0122.oracle.com [141.146.126.236]) by aserv0021.oracle.com (8.13.8/8.13.8) with ESMTP id u197PCiH009590 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=FAIL); Tue, 9 Feb 2016 07:25:13 GMT Received: from abhmp0019.oracle.com (abhmp0019.oracle.com [141.146.116.25]) by aserv0122.oracle.com (8.13.8/8.13.8) with ESMTP id u197PCKf018450; Tue, 9 Feb 2016 07:25:12 GMT Received: from localhost (/24.21.154.84) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Mon, 08 Feb 2016 23:25:12 -0800 Date: Mon, 8 Feb 2016 23:25:11 -0800 From: "Darrick J. Wong" To: Dave Chinner Cc: linux-btrfs@vger.kernel.org, fstests@vger.kernel.org, xfs@oss.sgi.com Subject: Re: [PATCH v4.1 00/23] xfstests: test the nfs/cifs/btrfs/xfs reflink/dedupe ioctls Message-ID: <20160209072511.GA23904@birch.djwong.org> X-ASG-Orig-Subj: Re: [PATCH v4.1 00/23] xfstests: test the nfs/cifs/btrfs/xfs reflink/dedupe ioctls References: <20160209011145.23099.95354.stgit@birch.djwong.org> <20160209072106.GH19486@dastard> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20160209072106.GH19486@dastard> User-Agent: Mutt/1.5.21 (2010-09-15) X-Source-IP: aserv0021.oracle.com [141.146.126.233] X-Barracuda-Connect: aserp1040.oracle.com[141.146.126.69] X-Barracuda-Start-Time: 1455002714 X-Barracuda-Encrypted: ECDHE-RSA-AES256-GCM-SHA384 X-Barracuda-URL: https://192.48.176.25:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-BRTS-Status: 1 X-Barracuda-Spam-Score: 0.00 X-Barracuda-Spam-Status: No, SCORE=0.00 using per-user scores of TAG_LEVEL=1000.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.7 tests=BSF_SC0_MISMATCH_TO, UNPARSEABLE_RELAY X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.3.26881 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 0.00 BSF_SC0_MISMATCH_TO Envelope rcpt doesn't match header 0.00 UNPARSEABLE_RELAY Informational: message has unparseable relay lines On Tue, Feb 09, 2016 at 06:21:06PM +1100, Dave Chinner wrote: > On Mon, Feb 08, 2016 at 05:11:45PM -0800, Darrick J. Wong wrote: > > Happy New Year! > > > > Dave Chinner: I've renumbered the new tests and pushed to github[3] if > > you'd like to pull. > > Can you include the commit ID I should see at the head of the > tree so I can confirm I'm pulling the right branch? Heh, surprisingly, I've never ever sent a pull request to anyone, anywhere. :) HEAD is 9799e5c5397b7aa14dbc660645ef4ccaf5418c78 > BTW, git doesn't like this: > > https://github.com/djwong/xfstests/tree/for-dave > > What git really wants is the tree url with a separate branch name > like so: > > https://github.com/djwong/xfstests.git for-dave > > (i.e. the typical output from a git request-pull command) > > > This is a (no longer) small patch set against the reflink/dedupe test > > cases in xfstests. The first four patches fix errors in the existing > > reflink tests, some of which are from Christoph Hellwig. > > > > Patches 5-6 refactor the dmerror code so that we can use it to > > simulate transient IO errors, then use this code to test that > > unwritten extent conversion does NOT happen after a directio write to > > an unwritten extent hits a disk error. Due to a bug in the VFS > > directio code, ext4 can disclose stale disk contents if an aio dio > > write fails; XFS suffers this problem for any failing dio write to an > > unwritten extent. Christoph's kernel patchset titled "vfs/xfs: > > directio updates to ease COW handling V2" (and a separate ext4 warning > > cleanup) is needed to fix this. > > > > Patches 7-9, 13, 15, 17, 18, 20, 21, and 23 exercise various parts > > of the copy on write behavior that are necessary to support shared > > blocks. The earlier patches focus on correct CoW behavior in the > > presence of IO errors during the copy-write, and the later patches > > focus on XFS' new cow-extent-size hint that greatly reduces > > fragmentation due to copy on write behavior by encouraging the > > allocator to allocate larger extents of replacement blocks. > > > > Patches 10-12 and 14 perform stress testing on reflink and CoW to > > check the behaviors when we get close to maximum refcount, when we > > specify obnxiously large offsets and lengths, and when we try to > > reflink millions of extents at a time. > > > > Patch 16 tests quota accounting behavior when reflink is enabled. > > > > Patch 19 adds a few tests for the XFS reverse mapping btree to ensure > > that things like metadump and growfs work correctly. > > > > Patch 22 checks that get_bmapx and fiemap (on XFS) correctly flag > > extents as having shared blocks. XFS now follows btrfs and ocfs2 > > FIEMAP behavior such that if any blocks of a file's extent are shared, > > the whole extent is marked shared. This is in contrast to earlier > > XFS-only behavior that reported shared and non-shared regions as > > separate extents. > > This may change - xfs_bmap doesn't combine extents in it's output > even if they are adjacent. For debugging purposes (which is what > xfs_bmap/fiemap is for), it's much better to be able to see the > exact extent layout and block sharing. > > I suspect the solution of least surprise is to make fiemap behave > like the other filesystems, and make xfs_bmap behave in a manner > that is useful to us.... :P Hehe. Well... FIEMAP now /does/ act like the other filesystems. But perhaps we can do better with getbmapx and show the exact shared regions. I thought about adding a flag for that, but... > > If you're going to start using this mess, you probably ought to just > > pull from my github trees for kernel[1], xfsprogs[2], xfstests[3], > > xfs-docs[4], and man-pages[5]. All tests should pass on XFS. I > > tried btrfs this weekend and it failed 166, 175, 182, 266, 271, 272, > > 278, 281, 297, 298, 304, 333, and 334. ocfs2 (when I jury-rigged it > > to run the cp_reflink tests) seemed to have a quota bug and crashes > > hard in 284 (but was otherwise fine). > > Fun fun fun. I'll look through the patchs, and if there's nothing > major I'll pull it in once I get a commit ID from you. :) --D > > Cheers, > > Dave. > -- > Dave Chinner > david@fromorbit.com From darrick.wong@oracle.com Tue Feb 9 01:50:28 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay1.corp.sgi.com [137.38.102.111]) by oss.sgi.com (Postfix) with ESMTP id D35AE7CA2 for ; Tue, 9 Feb 2016 01:50:28 -0600 (CST) Received: from cuda.sgi.com (cuda1.sgi.com [192.48.157.11]) by relay1.corp.sgi.com (Postfix) with ESMTP id 95AE88F8040 for ; Mon, 8 Feb 2016 23:50:28 -0800 (PST) X-ASG-Debug-ID: 1455004224-04bdf066ec15210001-NocioJ Received: from aserp1040.oracle.com (aserp1040.oracle.com [141.146.126.69]) by cuda.sgi.com with ESMTP id 0dxE2r7CDvMYfNoD (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO) for ; Mon, 08 Feb 2016 23:50:24 -0800 (PST) X-Barracuda-Envelope-From: darrick.wong@oracle.com X-Barracuda-Apparent-Source-IP: 141.146.126.69 Received: from userv0022.oracle.com (userv0022.oracle.com [156.151.31.74]) by aserp1040.oracle.com (Sentrion-MTA-4.3.2/Sentrion-MTA-4.3.2) with ESMTP id u197oMa1006157 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 9 Feb 2016 07:50:23 GMT Received: from userv0122.oracle.com (userv0122.oracle.com [156.151.31.75]) by userv0022.oracle.com (8.14.4/8.13.8) with ESMTP id u197oMt3026528 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL); Tue, 9 Feb 2016 07:50:22 GMT Received: from abhmp0012.oracle.com (abhmp0012.oracle.com [141.146.116.18]) by userv0122.oracle.com (8.14.4/8.14.4) with ESMTP id u197oL87012710; Tue, 9 Feb 2016 07:50:21 GMT Received: from localhost (/24.21.154.84) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Mon, 08 Feb 2016 23:50:20 -0800 Date: Mon, 8 Feb 2016 23:50:19 -0800 From: "Darrick J. Wong" To: Dave Chinner Cc: linux-btrfs@vger.kernel.org, fstests@vger.kernel.org, xfs@oss.sgi.com Subject: Re: [PATCH v4.1 00/23] xfstests: test the nfs/cifs/btrfs/xfs reflink/dedupe ioctls Message-ID: <20160209075019.GA6346@birch.djwong.org> X-ASG-Orig-Subj: Re: [PATCH v4.1 00/23] xfstests: test the nfs/cifs/btrfs/xfs reflink/dedupe ioctls References: <20160209011145.23099.95354.stgit@birch.djwong.org> <20160209072106.GH19486@dastard> <20160209072511.GA23904@birch.djwong.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20160209072511.GA23904@birch.djwong.org> User-Agent: Mutt/1.5.21 (2010-09-15) X-Source-IP: userv0022.oracle.com [156.151.31.74] X-Barracuda-Connect: aserp1040.oracle.com[141.146.126.69] X-Barracuda-Start-Time: 1455004224 X-Barracuda-Encrypted: ECDHE-RSA-AES256-GCM-SHA384 X-Barracuda-URL: https://192.48.157.11:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-BRTS-Status: 1 X-Barracuda-Spam-Score: 0.00 X-Barracuda-Spam-Status: No, SCORE=0.00 using per-user scores of TAG_LEVEL=1000.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.7 tests=BSF_SC0_MISMATCH_TO, UNPARSEABLE_RELAY X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.3.26881 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 0.00 BSF_SC0_MISMATCH_TO Envelope rcpt doesn't match header 0.00 UNPARSEABLE_RELAY Informational: message has unparseable relay lines Aha, /me finds git request-pull. Sorry for the noise. --D The following changes since commit d98149c205559950c03d6b1d539e45fd35b5630e: Fix prerequisite packages to build fstests on Ubuntu (2016-02-08 09:27:15 +1100) are available in the git repository at: https://github.com/djwong/xfstests for-dave for you to fetch changes up to 9799e5c5397b7aa14dbc660645ef4ccaf5418c78: reflink: test reflink+cow+enospc all at the same time (2016-02-08 17:07:36 -0800) ---------------------------------------------------------------- Darrick J. Wong (23): generic/182: this is a dedupe test, check for dedupe xfstests: filter whitespace in 128 and 132 xfstests: make _scratch_mkfs_blocksized usable reflink: remove redundant filesystem checks from the end of the tests common/dmerror: add some more dmerror routines dio unwritten conversion bug tests reflink: test intersecting CoW and falloc/fpunch/fzero/fcollapse/finsert/ftrunc reflink: test CoW behavior with IO errors reflink: test CoW operations against the source file xfs: more reflink tests reflink: ensure that we can handle reflinking a lot of extents xfs/122: support refcount/rmap data structures xfs: test fragmentation characteristics of copy-on-write reflink: high offset reflink and dedupe tests reflink: test xfs cow behavior when the filesystem crashes reflink: test quota accounting reflink: test CoW across a mixed range of block types with cowextsize set xfs: test the automatic cowextsize extent garbage collector xfs: test rmapbt functionality reflink: test aio copy on write xfs: aio cow tests xfs: test xfs_getbmapx behavior with shared extents reflink: test reflink+cow+enospc all at the same time .gitignore | 2 + common/dmerror | 27 ++- common/rc | 52 +++++ common/reflink | 32 +-- common/xfs | 63 ++++++ src/Makefile | 2 +- src/aio-dio-regress/aiocp.c | 489 ++++++++++++++++++++++++++++++++++++++++++++ src/punch-alternating.c | 59 ++++++ tests/btrfs/100 | 2 +- tests/btrfs/101 | 2 +- tests/generic/157 | 1 - tests/generic/158 | 1 - tests/generic/161 | 1 - tests/generic/162 | 1 - tests/generic/163 | 1 - tests/generic/164 | 1 - tests/generic/165 | 1 - tests/generic/166 | 7 +- tests/generic/167 | 7 +- tests/generic/168 | 1 - tests/generic/170 | 1 - tests/generic/171 | 1 - tests/generic/172 | 1 - tests/generic/173 | 1 - tests/generic/174 | 1 - tests/generic/175 | 43 ++-- tests/generic/175.out | 6 + tests/generic/176 | 51 +++-- tests/generic/176.out | 4 +- tests/generic/182 | 9 +- tests/generic/183 | 1 - tests/generic/185 | 1 - tests/generic/186 | 1 - tests/generic/187 | 1 - tests/generic/188 | 1 - tests/generic/189 | 1 - tests/generic/190 | 1 - tests/generic/191 | 1 - tests/generic/194 | 1 - tests/generic/195 | 1 - tests/generic/196 | 3 +- tests/generic/197 | 3 +- tests/generic/199 | 1 - tests/generic/200 | 1 - tests/generic/201 | 1 - tests/generic/202 | 1 - tests/generic/203 | 1 - tests/generic/205 | 1 - tests/generic/206 | 1 - tests/generic/216 | 1 - tests/generic/217 | 1 - tests/generic/218 | 1 - tests/generic/220 | 1 - tests/generic/222 | 1 - tests/generic/227 | 1 - tests/generic/229 | 1 - tests/generic/238 | 1 - tests/generic/242 | 1 - tests/generic/243 | 1 - tests/generic/250 | 104 ++++++++++ tests/generic/250.out | 10 + tests/generic/252 | 107 ++++++++++ tests/generic/252.out | 10 + tests/generic/253 | 93 +++++++++ tests/generic/253.out | 13 ++ tests/generic/254 | 93 +++++++++ tests/generic/254.out | 13 ++ tests/generic/259 | 93 +++++++++ tests/generic/259.out | 13 ++ tests/generic/261 | 93 +++++++++ tests/generic/261.out | 13 ++ tests/generic/262 | 96 +++++++++ tests/generic/262.out | 13 ++ tests/generic/264 | 93 +++++++++ tests/generic/264.out | 13 ++ tests/generic/265 | 102 +++++++++ tests/generic/265.out | 11 + tests/generic/266 | 103 ++++++++++ tests/generic/266.out | 12 ++ tests/generic/267 | 103 ++++++++++ tests/generic/267.out | 10 + tests/generic/268 | 106 ++++++++++ tests/generic/268.out | 12 ++ tests/generic/271 | 102 +++++++++ tests/generic/271.out | 11 + tests/generic/272 | 103 ++++++++++ tests/generic/272.out | 12 ++ tests/generic/276 | 103 ++++++++++ tests/generic/276.out | 11 + tests/generic/278 | 106 ++++++++++ tests/generic/278.out | 12 ++ tests/generic/279 | 103 ++++++++++ tests/generic/279.out | 11 + tests/generic/281 | 104 ++++++++++ tests/generic/281.out | 12 ++ tests/generic/282 | 104 ++++++++++ tests/generic/282.out | 10 + tests/generic/283 | 107 ++++++++++ tests/generic/283.out | 12 ++ tests/generic/284 | 95 +++++++++ tests/generic/284.out | 13 ++ tests/generic/287 | 95 +++++++++ tests/generic/287.out | 13 ++ tests/generic/289 | 102 +++++++++ tests/generic/289.out | 13 ++ tests/generic/290 | 102 +++++++++ tests/generic/290.out | 13 ++ tests/generic/291 | 102 +++++++++ tests/generic/291.out | 13 ++ tests/generic/292 | 102 +++++++++ tests/generic/292.out | 13 ++ tests/generic/293 | 107 ++++++++++ tests/generic/293.out | 13 ++ tests/generic/295 | 107 ++++++++++ tests/generic/295.out | 13 ++ tests/generic/296 | 96 +++++++++ tests/generic/296.out | 13 ++ tests/generic/297 | 101 +++++++++ tests/generic/297.out | 6 + tests/generic/298 | 101 +++++++++ tests/generic/298.out | 6 + tests/generic/301 | 105 ++++++++++ tests/generic/301.out | 11 + tests/generic/302 | 105 ++++++++++ tests/generic/302.out | 11 + tests/generic/303 | 99 +++++++++ tests/generic/303.out | 21 ++ tests/generic/304 | 100 +++++++++ tests/generic/304.out | 22 ++ tests/generic/305 | 105 ++++++++++ tests/generic/305.out | 23 +++ tests/generic/326 | 105 ++++++++++ tests/generic/326.out | 23 +++ tests/generic/327 | 92 +++++++++ tests/generic/327.out | 13 ++ tests/generic/328 | 109 ++++++++++ tests/generic/328.out | 26 +++ tests/generic/329 | 105 ++++++++++ tests/generic/329.out | 12 ++ tests/generic/330 | 96 +++++++++ tests/generic/330.out | 11 + tests/generic/331 | 107 ++++++++++ tests/generic/331.out | 12 ++ tests/generic/332 | 97 +++++++++ tests/generic/332.out | 11 + tests/generic/333 | 104 ++++++++++ tests/generic/333.out | 6 + tests/generic/334 | 104 ++++++++++ tests/generic/334.out | 6 + tests/generic/group | 49 ++++- tests/xfs/122 | 3 + tests/xfs/122.out | 4 + tests/xfs/127 | 1 - tests/xfs/128 | 3 +- tests/xfs/128.out | 8 +- tests/xfs/131 | 1 - tests/xfs/132 | 10 +- tests/xfs/132.out | 40 ++-- tests/xfs/139 | 1 - tests/xfs/140 | 1 - tests/xfs/169 | 90 ++++++++ tests/xfs/169.out | 8 + tests/xfs/179 | 119 +++++++++++ tests/xfs/179.out | 10 + tests/xfs/180 | 111 ++++++++++ tests/xfs/180.out | 12 ++ tests/xfs/182 | 111 ++++++++++ tests/xfs/182.out | 13 ++ tests/xfs/184 | 110 ++++++++++ tests/xfs/184.out | 11 + tests/xfs/192 | 110 ++++++++++ tests/xfs/192.out | 11 + tests/xfs/193 | 107 ++++++++++ tests/xfs/193.out | 11 + tests/xfs/198 | 107 ++++++++++ tests/xfs/198.out | 11 + tests/xfs/200 | 114 +++++++++++ tests/xfs/200.out | 11 + tests/xfs/204 | 114 +++++++++++ tests/xfs/204.out | 11 + tests/xfs/207 | 104 ++++++++++ tests/xfs/207.out | 10 + tests/xfs/208 | 154 ++++++++++++++ tests/xfs/208.out | 15 ++ tests/xfs/209 | 88 ++++++++ tests/xfs/209.out | 6 + tests/xfs/210 | 125 +++++++++++ tests/xfs/210.out | 14 ++ tests/xfs/211 | 111 ++++++++++ tests/xfs/211.out | 12 ++ tests/xfs/212 | 106 ++++++++++ tests/xfs/212.out | 14 ++ tests/xfs/213 | 110 ++++++++++ tests/xfs/213.out | 23 +++ tests/xfs/214 | 109 ++++++++++ tests/xfs/214.out | 23 +++ tests/xfs/215 | 108 ++++++++++ tests/xfs/215.out | 14 ++ tests/xfs/218 | 108 ++++++++++ tests/xfs/218.out | 14 ++ tests/xfs/219 | 108 ++++++++++ tests/xfs/219.out | 14 ++ tests/xfs/221 | 108 ++++++++++ tests/xfs/221.out | 14 ++ tests/xfs/223 | 113 ++++++++++ tests/xfs/223.out | 14 ++ tests/xfs/224 | 113 ++++++++++ tests/xfs/224.out | 14 ++ tests/xfs/225 | 108 ++++++++++ tests/xfs/225.out | 14 ++ tests/xfs/226 | 108 ++++++++++ tests/xfs/226.out | 14 ++ tests/xfs/228 | 137 +++++++++++++ tests/xfs/228.out | 14 ++ tests/xfs/230 | 137 +++++++++++++ tests/xfs/230.out | 14 ++ tests/xfs/231 | 135 ++++++++++++ tests/xfs/231.out | 17 ++ tests/xfs/232 | 137 +++++++++++++ tests/xfs/232.out | 17 ++ tests/xfs/233 | 78 +++++++ tests/xfs/233.out | 6 + tests/xfs/234 | 89 ++++++++ tests/xfs/234.out | 6 + tests/xfs/235 | 108 ++++++++++ tests/xfs/235.out | 14 ++ tests/xfs/236 | 93 +++++++++ tests/xfs/236.out | 8 + tests/xfs/237 | 107 ++++++++++ tests/xfs/237.out | 12 ++ tests/xfs/239 | 98 +++++++++ tests/xfs/239.out | 11 + tests/xfs/240 | 109 ++++++++++ tests/xfs/240.out | 12 ++ tests/xfs/241 | 99 +++++++++ tests/xfs/241.out | 11 + tests/xfs/243 | 169 +++++++++++++++ tests/xfs/243.out | 27 +++ tests/xfs/245 | 99 +++++++++ tests/xfs/245.out | 13 ++ tests/xfs/group | 44 +++- 241 files changed, 11012 insertions(+), 177 deletions(-) create mode 100644 common/xfs create mode 100644 src/aio-dio-regress/aiocp.c create mode 100644 src/punch-alternating.c create mode 100755 tests/generic/250 create mode 100644 tests/generic/250.out create mode 100755 tests/generic/252 create mode 100644 tests/generic/252.out create mode 100755 tests/generic/253 create mode 100644 tests/generic/253.out create mode 100755 tests/generic/254 create mode 100644 tests/generic/254.out create mode 100755 tests/generic/259 create mode 100644 tests/generic/259.out create mode 100755 tests/generic/261 create mode 100644 tests/generic/261.out create mode 100755 tests/generic/262 create mode 100644 tests/generic/262.out create mode 100755 tests/generic/264 create mode 100644 tests/generic/264.out create mode 100755 tests/generic/265 create mode 100644 tests/generic/265.out create mode 100755 tests/generic/266 create mode 100644 tests/generic/266.out create mode 100755 tests/generic/267 create mode 100644 tests/generic/267.out create mode 100755 tests/generic/268 create mode 100644 tests/generic/268.out create mode 100755 tests/generic/271 create mode 100644 tests/generic/271.out create mode 100755 tests/generic/272 create mode 100644 tests/generic/272.out create mode 100755 tests/generic/276 create mode 100644 tests/generic/276.out create mode 100755 tests/generic/278 create mode 100644 tests/generic/278.out create mode 100755 tests/generic/279 create mode 100644 tests/generic/279.out create mode 100755 tests/generic/281 create mode 100644 tests/generic/281.out create mode 100755 tests/generic/282 create mode 100644 tests/generic/282.out create mode 100755 tests/generic/283 create mode 100644 tests/generic/283.out create mode 100755 tests/generic/284 create mode 100644 tests/generic/284.out create mode 100755 tests/generic/287 create mode 100644 tests/generic/287.out create mode 100755 tests/generic/289 create mode 100644 tests/generic/289.out create mode 100755 tests/generic/290 create mode 100644 tests/generic/290.out create mode 100755 tests/generic/291 create mode 100644 tests/generic/291.out create mode 100755 tests/generic/292 create mode 100644 tests/generic/292.out create mode 100755 tests/generic/293 create mode 100644 tests/generic/293.out create mode 100755 tests/generic/295 create mode 100644 tests/generic/295.out create mode 100755 tests/generic/296 create mode 100644 tests/generic/296.out create mode 100755 tests/generic/297 create mode 100644 tests/generic/297.out create mode 100755 tests/generic/298 create mode 100644 tests/generic/298.out create mode 100755 tests/generic/301 create mode 100644 tests/generic/301.out create mode 100755 tests/generic/302 create mode 100644 tests/generic/302.out create mode 100755 tests/generic/303 create mode 100644 tests/generic/303.out create mode 100755 tests/generic/304 create mode 100644 tests/generic/304.out create mode 100755 tests/generic/305 create mode 100644 tests/generic/305.out create mode 100755 tests/generic/326 create mode 100644 tests/generic/326.out create mode 100755 tests/generic/327 create mode 100644 tests/generic/327.out create mode 100755 tests/generic/328 create mode 100644 tests/generic/328.out create mode 100755 tests/generic/329 create mode 100644 tests/generic/329.out create mode 100755 tests/generic/330 create mode 100644 tests/generic/330.out create mode 100755 tests/generic/331 create mode 100644 tests/generic/331.out create mode 100755 tests/generic/332 create mode 100644 tests/generic/332.out create mode 100755 tests/generic/333 create mode 100644 tests/generic/333.out create mode 100755 tests/generic/334 create mode 100644 tests/generic/334.out create mode 100755 tests/xfs/169 create mode 100644 tests/xfs/169.out create mode 100755 tests/xfs/179 create mode 100644 tests/xfs/179.out create mode 100755 tests/xfs/180 create mode 100644 tests/xfs/180.out create mode 100755 tests/xfs/182 create mode 100644 tests/xfs/182.out create mode 100755 tests/xfs/184 create mode 100644 tests/xfs/184.out create mode 100755 tests/xfs/192 create mode 100644 tests/xfs/192.out create mode 100755 tests/xfs/193 create mode 100644 tests/xfs/193.out create mode 100755 tests/xfs/198 create mode 100644 tests/xfs/198.out create mode 100755 tests/xfs/200 create mode 100644 tests/xfs/200.out create mode 100755 tests/xfs/204 create mode 100644 tests/xfs/204.out create mode 100755 tests/xfs/207 create mode 100644 tests/xfs/207.out create mode 100755 tests/xfs/208 create mode 100644 tests/xfs/208.out create mode 100755 tests/xfs/209 create mode 100644 tests/xfs/209.out create mode 100755 tests/xfs/210 create mode 100644 tests/xfs/210.out create mode 100755 tests/xfs/211 create mode 100644 tests/xfs/211.out create mode 100755 tests/xfs/212 create mode 100644 tests/xfs/212.out create mode 100755 tests/xfs/213 create mode 100644 tests/xfs/213.out create mode 100755 tests/xfs/214 create mode 100644 tests/xfs/214.out create mode 100755 tests/xfs/215 create mode 100644 tests/xfs/215.out create mode 100755 tests/xfs/218 create mode 100644 tests/xfs/218.out create mode 100755 tests/xfs/219 create mode 100644 tests/xfs/219.out create mode 100755 tests/xfs/221 create mode 100644 tests/xfs/221.out create mode 100755 tests/xfs/223 create mode 100644 tests/xfs/223.out create mode 100755 tests/xfs/224 create mode 100644 tests/xfs/224.out create mode 100755 tests/xfs/225 create mode 100644 tests/xfs/225.out create mode 100755 tests/xfs/226 create mode 100644 tests/xfs/226.out create mode 100755 tests/xfs/228 create mode 100644 tests/xfs/228.out create mode 100755 tests/xfs/230 create mode 100644 tests/xfs/230.out create mode 100755 tests/xfs/231 create mode 100644 tests/xfs/231.out create mode 100755 tests/xfs/232 create mode 100644 tests/xfs/232.out create mode 100755 tests/xfs/233 create mode 100644 tests/xfs/233.out create mode 100755 tests/xfs/234 create mode 100644 tests/xfs/234.out create mode 100755 tests/xfs/235 create mode 100644 tests/xfs/235.out create mode 100755 tests/xfs/236 create mode 100644 tests/xfs/236.out create mode 100755 tests/xfs/237 create mode 100644 tests/xfs/237.out create mode 100755 tests/xfs/239 create mode 100644 tests/xfs/239.out create mode 100755 tests/xfs/240 create mode 100644 tests/xfs/240.out create mode 100755 tests/xfs/241 create mode 100644 tests/xfs/241.out create mode 100755 tests/xfs/243 create mode 100644 tests/xfs/243.out create mode 100755 tests/xfs/245 create mode 100644 tests/xfs/245.out From david@fromorbit.com Tue Feb 9 01:51:30 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=ham version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay2.corp.sgi.com [137.38.102.29]) by oss.sgi.com (Postfix) with ESMTP id A22887CA2 for ; Tue, 9 Feb 2016 01:51:30 -0600 (CST) Received: from cuda.sgi.com (cuda1.sgi.com [192.48.157.11]) by relay2.corp.sgi.com (Postfix) with ESMTP id 74C49304048 for ; Mon, 8 Feb 2016 23:51:30 -0800 (PST) X-ASG-Debug-ID: 1455004287-04bdf066ec152e0001-NocioJ Received: from ipmail06.adl2.internode.on.net (ipmail06.adl2.internode.on.net [150.101.137.129]) by cuda.sgi.com with ESMTP id 7KBgWhhGIiEjuwtx for ; Mon, 08 Feb 2016 23:51:28 -0800 (PST) X-Barracuda-Envelope-From: david@fromorbit.com X-Barracuda-Apparent-Source-IP: 150.101.137.129 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: A2AXCACDmblWPBATLHleKAECgw+BP4ZjgXmdTgaLZ4VFhAeGBwICAQECgTRNAQEBAQEBBwEBAQFBP4RCAQEEOhwjEAgDGAklDwUlAwcaE4gavW4BAQgCHhiFMoR/iGwBBJZ3jUeOfI4/hFooLohTAQEB Received: from ppp121-44-19-16.lns20.syd4.internode.on.net (HELO dastard) ([121.44.19.16]) by ipmail06.adl2.internode.on.net with ESMTP; 09 Feb 2016 18:21:27 +1030 Received: from dave by dastard with local (Exim 4.80) (envelope-from ) id 1aT2rc-00028i-3x; Tue, 09 Feb 2016 18:37:32 +1100 Date: Tue, 9 Feb 2016 18:37:32 +1100 From: Dave Chinner To: "Darrick J. Wong" Cc: linux-btrfs@vger.kernel.org, fstests@vger.kernel.org, xfs@oss.sgi.com Subject: Re: [PATCH 06/23] dio unwritten conversion bug tests Message-ID: <20160209073732.GJ19486@dastard> X-ASG-Orig-Subj: Re: [PATCH 06/23] dio unwritten conversion bug tests References: <20160209011145.23099.95354.stgit@birch.djwong.org> <20160209011223.23099.3987.stgit@birch.djwong.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20160209011223.23099.3987.stgit@birch.djwong.org> User-Agent: Mutt/1.5.21 (2010-09-15) X-Barracuda-Connect: ipmail06.adl2.internode.on.net[150.101.137.129] X-Barracuda-Start-Time: 1455004287 X-Barracuda-URL: https://192.48.157.11:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-BRTS-Status: 1 X-Barracuda-Spam-Score: 0.00 X-Barracuda-Spam-Status: No, SCORE=0.00 using per-user scores of TAG_LEVEL=1000.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.7 tests=BSF_SC0_MISMATCH_TO X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.3.26881 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 0.00 BSF_SC0_MISMATCH_TO Envelope rcpt doesn't match header On Mon, Feb 08, 2016 at 05:12:23PM -0800, Darrick J. Wong wrote: > Check that we don't expose old disk contents when a directio write to > an unwritten extent fails due to IO errors. This primarily affects > XFS and ext4. > > Signed-off-by: Darrick J. Wong ..... > --- a/tests/generic/group > +++ b/tests/generic/group > @@ -252,7 +252,9 @@ > 247 auto quick rw > 248 auto quick rw > 249 auto quick rw > +250 auto quick > 251 ioctl trim > +252 auto quick Also should be in the prealloc group if we are testing unwritten extent behaviour and the rw group because it's testing IO. Cheers, Dave. -- Dave Chinner david@fromorbit.com From david@fromorbit.com Tue Feb 9 01:51:32 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=ham version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay1.corp.sgi.com [137.38.102.111]) by oss.sgi.com (Postfix) with ESMTP id 2BF507CA7 for ; Tue, 9 Feb 2016 01:51:32 -0600 (CST) Received: from cuda.sgi.com (cuda1.sgi.com [192.48.157.11]) by relay1.corp.sgi.com (Postfix) with ESMTP id 0DAAD8F8049 for ; Mon, 8 Feb 2016 23:51:31 -0800 (PST) X-ASG-Debug-ID: 1455004287-04bdf066ec152e0002-NocioJ Received: from ipmail06.adl2.internode.on.net (ipmail06.adl2.internode.on.net [150.101.137.129]) by cuda.sgi.com with ESMTP id eCHO7kZ8Ln3aJl8a for ; Mon, 08 Feb 2016 23:51:29 -0800 (PST) X-Barracuda-Envelope-From: david@fromorbit.com X-Barracuda-Apparent-Source-IP: 150.101.137.129 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: A2AXCACDmblWPBATLHleKAECgw+BP4ZjgXmdTgaLZ4VFhAeGBwICAQECgTRNAQEBAQEBBwEBAQFBP4RCAQEEOhwjEAgDGAklDwUlAwcaE4gavW4BAQgCHhiFMoR/hACEbAEEkm6ECY1HjnyOP4RaKC6HGoE5AQEB Received: from ppp121-44-19-16.lns20.syd4.internode.on.net (HELO dastard) ([121.44.19.16]) by ipmail06.adl2.internode.on.net with ESMTP; 09 Feb 2016 18:21:27 +1030 Received: from dave by dastard with local (Exim 4.80) (envelope-from ) id 1aT2xO-00029T-Ra; Tue, 09 Feb 2016 18:43:30 +1100 Date: Tue, 9 Feb 2016 18:43:30 +1100 From: Dave Chinner To: "Darrick J. Wong" Cc: linux-btrfs@vger.kernel.org, fstests@vger.kernel.org, xfs@oss.sgi.com Subject: Re: [PATCH 12/23] xfs/122: support refcount/rmap data structures Message-ID: <20160209074330.GK19486@dastard> X-ASG-Orig-Subj: Re: [PATCH 12/23] xfs/122: support refcount/rmap data structures References: <20160209011145.23099.95354.stgit@birch.djwong.org> <20160209011303.23099.40721.stgit@birch.djwong.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20160209011303.23099.40721.stgit@birch.djwong.org> User-Agent: Mutt/1.5.21 (2010-09-15) X-Barracuda-Connect: ipmail06.adl2.internode.on.net[150.101.137.129] X-Barracuda-Start-Time: 1455004289 X-Barracuda-URL: https://192.48.157.11:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-BRTS-Status: 1 X-Barracuda-Spam-Score: 0.00 X-Barracuda-Spam-Status: No, SCORE=0.00 using per-user scores of TAG_LEVEL=1000.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.7 tests=BSF_SC0_MISMATCH_TO X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.3.26881 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 0.00 BSF_SC0_MISMATCH_TO Envelope rcpt doesn't match header On Mon, Feb 08, 2016 at 05:13:03PM -0800, Darrick J. Wong wrote: > Include the refcount and rmap structures in the golden output. > > Signed-off-by: Darrick J. Wong > --- > tests/xfs/122 | 3 +++ > tests/xfs/122.out | 4 ++++ > tests/xfs/group | 2 +- > 3 files changed, 8 insertions(+), 1 deletion(-) > > > diff --git a/tests/xfs/122 b/tests/xfs/122 > index e6697a2..758cb50 100755 > --- a/tests/xfs/122 > +++ b/tests/xfs/122 > @@ -90,6 +90,9 @@ xfs_da3_icnode_hdr > xfs_dir3_icfree_hdr > xfs_dir3_icleaf_hdr > xfs_name > +xfs_owner_info > +xfs_refcount_irec > +xfs_rmap_irec > xfs_alloctype_t > xfs_buf_cancel_t > xfs_bmbt_rec_32_t So this is going to cause failures on any userspace that doesn't know about these new types, right? Should these be conditional in some way? Cheers, Dave. -- Dave Chinner david@fromorbit.com From david@fromorbit.com Tue Feb 9 01:51:35 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=ham version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay3.corp.sgi.com [198.149.34.15]) by oss.sgi.com (Postfix) with ESMTP id 5044D7CA4 for ; Tue, 9 Feb 2016 01:51:35 -0600 (CST) Received: from cuda.sgi.com (cuda1.sgi.com [192.48.157.11]) by relay3.corp.sgi.com (Postfix) with ESMTP id F0F88AC00A for ; Mon, 8 Feb 2016 23:51:31 -0800 (PST) X-ASG-Debug-ID: 1455004290-04bdf066ea152e0001-NocioJ Received: from ipmail06.adl2.internode.on.net (ipmail06.adl2.internode.on.net [150.101.137.129]) by cuda.sgi.com with ESMTP id bclGROBXh34Y488K for ; Mon, 08 Feb 2016 23:51:30 -0800 (PST) X-Barracuda-Envelope-From: david@fromorbit.com X-Barracuda-Apparent-Source-IP: 150.101.137.129 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: A2AXCACDmblWPBATLHleKAECgw+BP4ZjgXmdTgaLZ4VFhAeGBwICAQECgTRNAQEBAQEBBwEBAQFBP4RCAQEEOhwjEAgDGAklDwUlAwcaE4gavW4BAQgCAR0YhTKEf4hsBZZ3jUeOfI4/hFooLohTAQEB Received: from ppp121-44-19-16.lns20.syd4.internode.on.net (HELO dastard) ([121.44.19.16]) by ipmail06.adl2.internode.on.net with ESMTP; 09 Feb 2016 18:21:28 +1030 Received: from dave by dastard with local (Exim 4.80) (envelope-from ) id 1aT2qU-00028R-VI; Tue, 09 Feb 2016 18:36:23 +1100 Date: Tue, 9 Feb 2016 18:36:22 +1100 From: Dave Chinner To: "Darrick J. Wong" Cc: linux-btrfs@vger.kernel.org, fstests@vger.kernel.org, xfs@oss.sgi.com Subject: Re: [PATCH 10/23] xfs: more reflink tests Message-ID: <20160209073622.GI19486@dastard> X-ASG-Orig-Subj: Re: [PATCH 10/23] xfs: more reflink tests References: <20160209011145.23099.95354.stgit@birch.djwong.org> <20160209011250.23099.50000.stgit@birch.djwong.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20160209011250.23099.50000.stgit@birch.djwong.org> User-Agent: Mutt/1.5.21 (2010-09-15) X-Barracuda-Connect: ipmail06.adl2.internode.on.net[150.101.137.129] X-Barracuda-Start-Time: 1455004290 X-Barracuda-URL: https://192.48.157.11:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-BRTS-Status: 1 X-Barracuda-Spam-Score: 0.00 X-Barracuda-Spam-Status: No, SCORE=0.00 using per-user scores of TAG_LEVEL=1000.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.7 tests=BSF_SC0_MISMATCH_TO X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.3.26881 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 0.00 BSF_SC0_MISMATCH_TO Envelope rcpt doesn't match header On Mon, Feb 08, 2016 at 05:12:50PM -0800, Darrick J. Wong wrote: > Create a couple of XFS-specific tests -- one to check that growing > and shrinking the refcount btree works and a second one to check > what happens when we hit maximum refcount. > > Signed-off-by: Darrick J. Wong ..... > +# real QA test starts here > +_supported_os Linux > +_supported_fs xfs > +_require_scratch_reflink > +_require_cp_reflink .... > + > +test -x "$here/src/punch-alternating" || _notrun "punch-alternating not built" I suspect we need a _require rule for checking that something in the test src directory has been built. > +echo "Check scratch fs" > +umount "$SCRATCH_MNT" > +echo "check refcount after removing all files" >> "$seqres.full" > +"$XFS_DB_PROG" -c 'agf 0' -c 'addr refcntroot' -c 'p recs[1]' "$SCRATCH_DEV" >> "$seqres.full" > +"$XFS_REPAIR_PROG" -o force_geometry -n "$SCRATCH_DEV" >> "$seqres.full" 2>&1 > +res=$? > +if [ $res -eq 0 ]; then > + # If repair succeeds then format the device so that the post-test > + # check doesn't fail due to the single AG. > + _scratch_mkfs >> "$seqres.full" 2>&1 > +else > + _fail "xfs_repair fails" > +fi > + > +# success, all done > +status=0 > +exit This is what _require_scratch_nocheck avoids. i.e. do this instead: _require_scratch_nocheck ..... "$XFS_REPAIR_PROG" -o force_geometry -n "$SCRATCH_DEV" >> "$seqres.full" 2>&1 status=$? exit Also, we really don't need the quotes around these global variables. They are just noise and lots of stuff will break if those variables are set to something that requires them to be quoted. Cheers, Dave. -- Dave Chinner david@fromorbit.com From darrick.wong@oracle.com Tue Feb 9 01:55:18 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay2.corp.sgi.com [137.38.102.29]) by oss.sgi.com (Postfix) with ESMTP id A32197CA2 for ; Tue, 9 Feb 2016 01:55:18 -0600 (CST) Received: from cuda.sgi.com (cuda3.sgi.com [192.48.176.15]) by relay2.corp.sgi.com (Postfix) with ESMTP id 8D98F304039 for ; Mon, 8 Feb 2016 23:55:18 -0800 (PST) X-ASG-Debug-ID: 1455004514-04cb6c1e5914a20001-NocioJ Received: from aserp1040.oracle.com (aserp1040.oracle.com [141.146.126.69]) by cuda.sgi.com with ESMTP id KwsZ1EiKeaEALh8Q (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO) for ; Mon, 08 Feb 2016 23:55:14 -0800 (PST) X-Barracuda-Envelope-From: darrick.wong@oracle.com X-Barracuda-Apparent-Source-IP: 141.146.126.69 Received: from aserv0021.oracle.com (aserv0021.oracle.com [141.146.126.233]) by aserp1040.oracle.com (Sentrion-MTA-4.3.2/Sentrion-MTA-4.3.2) with ESMTP id u197t9mR010489 (version=TLSv1 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Tue, 9 Feb 2016 07:55:09 GMT Received: from userv0122.oracle.com (userv0122.oracle.com [156.151.31.75]) by aserv0021.oracle.com (8.13.8/8.13.8) with ESMTP id u197t9EV012035 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=FAIL); Tue, 9 Feb 2016 07:55:09 GMT Received: from abhmp0011.oracle.com (abhmp0011.oracle.com [141.146.116.17]) by userv0122.oracle.com (8.14.4/8.14.4) with ESMTP id u197t8Qt014864; Tue, 9 Feb 2016 07:55:08 GMT Received: from localhost (/24.21.154.84) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Mon, 08 Feb 2016 23:55:07 -0800 Date: Mon, 8 Feb 2016 23:55:06 -0800 From: "Darrick J. Wong" To: Dave Chinner Cc: linux-btrfs@vger.kernel.org, fstests@vger.kernel.org, xfs@oss.sgi.com Subject: Re: [PATCH 12/23] xfs/122: support refcount/rmap data structures Message-ID: <20160209075506.GB6346@birch.djwong.org> X-ASG-Orig-Subj: Re: [PATCH 12/23] xfs/122: support refcount/rmap data structures References: <20160209011145.23099.95354.stgit@birch.djwong.org> <20160209011303.23099.40721.stgit@birch.djwong.org> <20160209074330.GK19486@dastard> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20160209074330.GK19486@dastard> User-Agent: Mutt/1.5.21 (2010-09-15) X-Source-IP: aserv0021.oracle.com [141.146.126.233] X-Barracuda-Connect: aserp1040.oracle.com[141.146.126.69] X-Barracuda-Start-Time: 1455004514 X-Barracuda-Encrypted: ECDHE-RSA-AES256-GCM-SHA384 X-Barracuda-URL: https://192.48.176.15:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-BRTS-Status: 1 X-Barracuda-Spam-Score: 0.00 X-Barracuda-Spam-Status: No, SCORE=0.00 using per-user scores of TAG_LEVEL=1000.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.7 tests=BSF_SC0_MISMATCH_TO, UNPARSEABLE_RELAY X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.3.26881 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 0.00 BSF_SC0_MISMATCH_TO Envelope rcpt doesn't match header 0.00 UNPARSEABLE_RELAY Informational: message has unparseable relay lines On Tue, Feb 09, 2016 at 06:43:30PM +1100, Dave Chinner wrote: > On Mon, Feb 08, 2016 at 05:13:03PM -0800, Darrick J. Wong wrote: > > Include the refcount and rmap structures in the golden output. > > > > Signed-off-by: Darrick J. Wong > > --- > > tests/xfs/122 | 3 +++ > > tests/xfs/122.out | 4 ++++ > > tests/xfs/group | 2 +- > > 3 files changed, 8 insertions(+), 1 deletion(-) > > > > > > diff --git a/tests/xfs/122 b/tests/xfs/122 > > index e6697a2..758cb50 100755 > > --- a/tests/xfs/122 > > +++ b/tests/xfs/122 > > @@ -90,6 +90,9 @@ xfs_da3_icnode_hdr > > xfs_dir3_icfree_hdr > > xfs_dir3_icleaf_hdr > > xfs_name > > +xfs_owner_info > > +xfs_refcount_irec > > +xfs_rmap_irec > > xfs_alloctype_t > > xfs_buf_cancel_t > > xfs_bmbt_rec_32_t > > So this is going to cause failures on any userspace that doesn't > know about these new types, right? > > Should these be conditional in some way? I wasn't sure how to handle this -- I could just keep the patch at the head of my stack (unreleased) until xfsprogs pulls in the appropriate libxfs pieces? So long as we're not dead certain of the final format of the rmapbt and refcountbt, there's probably not a lot of value in putting this in (yet). --D > > Cheers, > > Dave. > > -- > Dave Chinner > david@fromorbit.com > -- > To unsubscribe from this list: send the line "unsubscribe fstests" in > the body of a message to majordomo@vger.kernel.org > More majordomo info at http://vger.kernel.org/majordomo-info.html From david@fromorbit.com Tue Feb 9 02:01:52 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=ham version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay1.corp.sgi.com [137.38.102.111]) by oss.sgi.com (Postfix) with ESMTP id 02A0A7CA2 for ; Tue, 9 Feb 2016 02:01:52 -0600 (CST) Received: from cuda.sgi.com (cuda2.sgi.com [192.48.176.25]) by relay1.corp.sgi.com (Postfix) with ESMTP id E5DF18F8033 for ; Tue, 9 Feb 2016 00:01:48 -0800 (PST) X-ASG-Debug-ID: 1455004905-04cbb0433122850001-NocioJ Received: from ipmail06.adl2.internode.on.net (ipmail06.adl2.internode.on.net [150.101.137.129]) by cuda.sgi.com with ESMTP id wrzG7mAXEGKb852p for ; Tue, 09 Feb 2016 00:01:46 -0800 (PST) X-Barracuda-Envelope-From: david@fromorbit.com X-Barracuda-Apparent-Source-IP: 150.101.137.129 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: A2AXCADdm7lWPBATLHleKAECgw+BP4ZjgXmdTwaLZ4VFhAeGBwICAQECgTRNAQEBAQEBBwEBAQFBP4RCAQEEOhwjEAgDGAklDwUlAwcaE4gavXMBAQEHAgEdGIUyhH+IbAWWd41HgWSHaYUvjj+EWiguiFMBAQE Received: from ppp121-44-19-16.lns20.syd4.internode.on.net (HELO dastard) ([121.44.19.16]) by ipmail06.adl2.internode.on.net with ESMTP; 09 Feb 2016 18:31:44 +1030 Received: from dave by dastard with local (Exim 4.80) (envelope-from ) id 1aT3F2-0002CA-Ac; Tue, 09 Feb 2016 19:01:44 +1100 Date: Tue, 9 Feb 2016 19:01:44 +1100 From: Dave Chinner To: "Darrick J. Wong" Cc: linux-btrfs@vger.kernel.org, fstests@vger.kernel.org, xfs@oss.sgi.com Subject: Re: [PATCH 13/23] xfs: test fragmentation characteristics of copy-on-write Message-ID: <20160209080144.GL19486@dastard> X-ASG-Orig-Subj: Re: [PATCH 13/23] xfs: test fragmentation characteristics of copy-on-write References: <20160209011145.23099.95354.stgit@birch.djwong.org> <20160209011309.23099.60912.stgit@birch.djwong.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20160209011309.23099.60912.stgit@birch.djwong.org> User-Agent: Mutt/1.5.21 (2010-09-15) X-Barracuda-Connect: ipmail06.adl2.internode.on.net[150.101.137.129] X-Barracuda-Start-Time: 1455004905 X-Barracuda-URL: https://192.48.176.25:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-BRTS-Status: 1 X-Barracuda-Spam-Score: 0.00 X-Barracuda-Spam-Status: No, SCORE=0.00 using per-user scores of TAG_LEVEL=1000.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.7 tests=BSF_SC0_MISMATCH_TO X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.3.26881 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 0.00 BSF_SC0_MISMATCH_TO Envelope rcpt doesn't match header On Mon, Feb 08, 2016 at 05:13:09PM -0800, Darrick J. Wong wrote: > Perform copy-on-writes at random offsets to stress the CoW allocation > system. Assess the effectiveness of the extent size hint at > combatting fragmentation via unshare, a rewrite, and no-op after the > random writes. > > Signed-off-by: Darrick J. Wong .... > +seq=`basename "$0"` > +seqres="$RESULT_DIR/$seq" > +echo "QA output created by $seq" > + > +here=`pwd` > +tmp=/tmp/$$ > +status=1 # failure is the default! > +trap "_cleanup; exit \$status" 0 1 2 3 15 > + > +_cleanup() > +{ > + cd / > + #rm -rf "$tmp".* "$testdir" Now that I've noticed it, a few tests have this line commented out. Probably should remove the tmp files, at least. > +rm -f "$seqres.full" > + > +echo "Format and mount" > +_scratch_mkfs > "$seqres.full" 2>&1 > +_scratch_mount >> "$seqres.full" 2>&1 > + > +testdir="$SCRATCH_MNT/test-$seq" > +rm -rf $testdir > +mkdir $testdir Again, somthing that is repeated - we just mkfs'd the scratch device, so the $testdir is guaranteed not to exist... > +echo "Check for damage" > +umount "$SCRATCH_MNT" I've also noticed this in a lot of tests - the scratch device will be unmounted by the harness, so I don't think this is necessary.... > +free_blocks=$(stat -f -c '%a' "$testdir") > +real_blksz=$(stat -f -c '%S' "$testdir") > +space_needed=$(((blksz * nr * 3) * 5 / 4)) > +space_avail=$((free_blocks * real_blksz)) > +internal_blks=$((blksz * nr / real_blksz)) > +test $space_needed -gt $space_avail && _notrun "Not enough space. $space_avail < $space_needed" Why not: _require_fs_space $space_needed At minimum, it seems to be a repeated hunk of code, so it shoul dbe factored. > +testdir="$SCRATCH_MNT/test-$seq" > +rm -rf $testdir > +mkdir $testdir > + > +echo "Create the original files" > +"$XFS_IO_PROG" -f -c "pwrite -S 0x61 0 0" "$testdir/file1" >> "$seqres.full" > +"$XFS_IO_PROG" -f -c "pwrite -S 0x61 0 1048576" "$testdir/file2" >> "$seqres.full" > +_scratch_remount > + > +echo "Set extsz and cowextsz on zero byte file" > +"$XFS_IO_PROG" -f -c "extsize 1048576" "$testdir/file1" | _filter_scratch > +"$XFS_IO_PROG" -f -c "cowextsize 1048576" "$testdir/file1" | _filter_scratch > + > +echo "Set extsz and cowextsz on 1Mbyte file" > +"$XFS_IO_PROG" -f -c "extsize 1048576" "$testdir/file2" | _filter_scratch > +"$XFS_IO_PROG" -f -c "cowextsize 1048576" "$testdir/file2" | _filter_scratch > +_scratch_remount > + > +fn() { > + "$XFS_IO_PROG" -c "$1" "$2" | sed -e 's/.\([0-9]*\).*$/\1/g' > +} > +echo "Check extsz and cowextsz settings on zero byte file" > +test $(fn extsize "$testdir/file1") -eq 1048576 || echo "file1 extsize not set" > +test $(fn cowextsize "$testdir/file1") -eq 1048576 || echo "file1 cowextsize not set" For this sort of thing, just dump the extent size value to the golden output. i.e. echo "Check extsz and cowextsz settings on zero byte file" $XFS_IO_PROG -c extsize $testdir/file1 $XFS_IO_PROG -c cowextsize $testdir/file1 is all that is needed. that way if it fails, we see what value it had instead of the expected 1MB. This also makes the test much less verbose and easier to read > + > +echo "Check extsz and cowextsz settings on 1Mbyte file" > +test $(fn extsize "$testdir/file2") -eq 0 || echo "file2 extsize not set" > +test $(fn cowextsize "$testdir/file2") -eq 1048576 || echo "file2 cowextsize not set" > + > +echo "Set cowextsize and check flag" > +"$XFS_IO_PROG" -f -c "cowextsize 1048576" "$testdir/file3" | _filter_scratch > +_scratch_remount > +test $("$XFS_IO_PROG" -c "stat" "$testdir/file3" | grep 'fsxattr.xflags' | awk '{print $4}' | grep -c 'C') -eq 1 || echo "file3 cowextsz flag not set" > +test $(fn cowextsize "$testdir/file3") -eq 1048576 || echo "file3 cowextsize not set" > +"$XFS_IO_PROG" -f -c "cowextsize 0" "$testdir/file3" | _filter_scratch > +_scratch_remount > +test $(fn cowextsize "$testdir/file3") -eq 0 || echo "file3 cowextsize not set" > +test $("$XFS_IO_PROG" -c "stat" "$testdir/file3" | grep 'fsxattr.xflags' | awk '{print $4}' | grep -c 'C') -eq 0 || echo "file3 cowextsz flag not set" Same with all these - just grep the output for the line you want, and the golden output matching does everything else. e.g. the flag check simply becomes: $XFS_IO_PROG -c "stat" $testdir/file3 | grep 'fsxattr.xflags' Again, this tells us what the wrong flags are if it fails... There are quite a few bits of these tests where the same thing applies.... -Dave. -- Dave Chinner david@fromorbit.com From darrick.wong@oracle.com Tue Feb 9 02:08:19 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay2.corp.sgi.com [137.38.102.29]) by oss.sgi.com (Postfix) with ESMTP id 2216E7CA2 for ; Tue, 9 Feb 2016 02:08:19 -0600 (CST) Received: from cuda.sgi.com (cuda2.sgi.com [192.48.176.25]) by relay2.corp.sgi.com (Postfix) with ESMTP id 107E8304039 for ; Tue, 9 Feb 2016 00:08:15 -0800 (PST) X-ASG-Debug-ID: 1455005292-04cbb0433122f80001-NocioJ Received: from userp1040.oracle.com (userp1040.oracle.com [156.151.31.81]) by cuda.sgi.com with ESMTP id g1ffjlxLpW2zIEsd (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO) for ; Tue, 09 Feb 2016 00:08:12 -0800 (PST) X-Barracuda-Envelope-From: darrick.wong@oracle.com X-Barracuda-Apparent-Source-IP: 156.151.31.81 Received: from userv0022.oracle.com (userv0022.oracle.com [156.151.31.74]) by userp1040.oracle.com (Sentrion-MTA-4.3.2/Sentrion-MTA-4.3.2) with ESMTP id u1988BGo007951 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 9 Feb 2016 08:08:11 GMT Received: from userv0122.oracle.com (userv0122.oracle.com [156.151.31.75]) by userv0022.oracle.com (8.14.4/8.13.8) with ESMTP id u1988B4D009480 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL); Tue, 9 Feb 2016 08:08:11 GMT Received: from abhmp0011.oracle.com (abhmp0011.oracle.com [141.146.116.17]) by userv0122.oracle.com (8.14.4/8.14.4) with ESMTP id u1988AZS021758; Tue, 9 Feb 2016 08:08:10 GMT Received: from localhost (/24.21.154.84) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Tue, 09 Feb 2016 00:08:10 -0800 Date: Tue, 9 Feb 2016 00:08:09 -0800 From: "Darrick J. Wong" To: Dave Chinner Cc: fstests@vger.kernel.org, linux-btrfs@vger.kernel.org, xfs@oss.sgi.com Subject: Re: [PATCH 06/23] dio unwritten conversion bug tests Message-ID: <20160209080809.GA6350@birch.djwong.org> X-ASG-Orig-Subj: Re: [PATCH 06/23] dio unwritten conversion bug tests References: <20160209011145.23099.95354.stgit@birch.djwong.org> <20160209011223.23099.3987.stgit@birch.djwong.org> <20160209073732.GJ19486@dastard> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20160209073732.GJ19486@dastard> User-Agent: Mutt/1.5.21 (2010-09-15) X-Source-IP: userv0022.oracle.com [156.151.31.74] X-Barracuda-Connect: userp1040.oracle.com[156.151.31.81] X-Barracuda-Start-Time: 1455005292 X-Barracuda-Encrypted: ECDHE-RSA-AES256-GCM-SHA384 X-Barracuda-URL: https://192.48.176.25:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-BRTS-Status: 1 X-Barracuda-Spam-Score: 0.00 X-Barracuda-Spam-Status: No, SCORE=0.00 using per-user scores of TAG_LEVEL=1000.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.7 tests=BSF_SC0_MISMATCH_TO, UNPARSEABLE_RELAY X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.3.26881 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 0.00 BSF_SC0_MISMATCH_TO Envelope rcpt doesn't match header 0.00 UNPARSEABLE_RELAY Informational: message has unparseable relay lines On Tue, Feb 09, 2016 at 06:37:32PM +1100, Dave Chinner wrote: > On Mon, Feb 08, 2016 at 05:12:23PM -0800, Darrick J. Wong wrote: > > Check that we don't expose old disk contents when a directio write to > > an unwritten extent fails due to IO errors. This primarily affects > > XFS and ext4. > > > > Signed-off-by: Darrick J. Wong > ..... > > --- a/tests/generic/group > > +++ b/tests/generic/group > > @@ -252,7 +252,9 @@ > > 247 auto quick rw > > 248 auto quick rw > > 249 auto quick rw > > +250 auto quick > > 251 ioctl trim > > +252 auto quick > > Also should be in the prealloc group if we are testing unwritten > extent behaviour and the rw group because it's testing IO. Done. Should the CoW tests be in 'rw' too? They're testing IO, but otoh they (most probably) require shared blocks to have much of a point. --D > > Cheers, > > Dave. > -- > Dave Chinner > david@fromorbit.com > > _______________________________________________ > xfs mailing list > xfs@oss.sgi.com > http://oss.sgi.com/mailman/listinfo/xfs From david@fromorbit.com Tue Feb 9 02:09:45 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=ham version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay2.corp.sgi.com [137.38.102.29]) by oss.sgi.com (Postfix) with ESMTP id D04D17CA2 for ; Tue, 9 Feb 2016 02:09:45 -0600 (CST) Received: from cuda.sgi.com (cuda1.sgi.com [192.48.157.11]) by relay2.corp.sgi.com (Postfix) with ESMTP id A19C5304039 for ; Tue, 9 Feb 2016 00:09:45 -0800 (PST) X-ASG-Debug-ID: 1455005379-04bdf066eb15d80001-NocioJ Received: from ipmail06.adl2.internode.on.net (ipmail06.adl2.internode.on.net [150.101.137.129]) by cuda.sgi.com with ESMTP id fHOtg4sRKlm6upaH for ; Tue, 09 Feb 2016 00:09:39 -0800 (PST) X-Barracuda-Envelope-From: david@fromorbit.com X-Barracuda-Apparent-Source-IP: 150.101.137.129 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: A2AYCAA2nrlWPBATLHleKAECgw+BP4ZjgXmdTwaLZ4VFhAeCXYMqAgIBAQKBNE0BAQEBAQEHAQEBAUE/hEIBAQQ6HCMQCAMYCSUPBSUDBxoTiBq9dgELAR0YhTKEf4hsBYdTjmNBjUeBZIdphS+OP4JmGBSBSCguiFMBAQE Received: from ppp121-44-19-16.lns20.syd4.internode.on.net (HELO dastard) ([121.44.19.16]) by ipmail06.adl2.internode.on.net with ESMTP; 09 Feb 2016 18:39:23 +1030 Received: from dave by dastard with local (Exim 4.80) (envelope-from ) id 1aT3MR-0002D9-BQ; Tue, 09 Feb 2016 19:09:23 +1100 Date: Tue, 9 Feb 2016 19:09:23 +1100 From: Dave Chinner To: "Darrick J. Wong" Cc: linux-btrfs@vger.kernel.org, fstests@vger.kernel.org, xfs@oss.sgi.com Subject: Re: [PATCH 17/23] reflink: test CoW across a mixed range of block types with cowextsize set Message-ID: <20160209080923.GM19486@dastard> X-ASG-Orig-Subj: Re: [PATCH 17/23] reflink: test CoW across a mixed range of block types with cowextsize set References: <20160209011145.23099.95354.stgit@birch.djwong.org> <20160209011335.23099.47260.stgit@birch.djwong.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20160209011335.23099.47260.stgit@birch.djwong.org> User-Agent: Mutt/1.5.21 (2010-09-15) X-Barracuda-Connect: ipmail06.adl2.internode.on.net[150.101.137.129] X-Barracuda-Start-Time: 1455005379 X-Barracuda-URL: https://192.48.157.11:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-BRTS-Status: 1 X-Barracuda-Spam-Score: 0.00 X-Barracuda-Spam-Status: No, SCORE=0.00 using per-user scores of TAG_LEVEL=1000.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.7 tests=BSF_SC0_MISMATCH_TO X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.3.26881 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 0.00 BSF_SC0_MISMATCH_TO Envelope rcpt doesn't match header On Mon, Feb 08, 2016 at 05:13:35PM -0800, Darrick J. Wong wrote: > Signed-off-by: Darrick J. Wong > --- > tests/xfs/215 | 108 ++++++++++++++++++++++++++++++++++++++++++ > tests/xfs/215.out | 14 +++++ > tests/xfs/218 | 108 ++++++++++++++++++++++++++++++++++++++++++ > tests/xfs/218.out | 14 +++++ > tests/xfs/219 | 108 ++++++++++++++++++++++++++++++++++++++++++ > tests/xfs/219.out | 14 +++++ > tests/xfs/221 | 108 ++++++++++++++++++++++++++++++++++++++++++ > tests/xfs/221.out | 14 +++++ > tests/xfs/223 | 113 ++++++++++++++++++++++++++++++++++++++++++++ > tests/xfs/223.out | 14 +++++ > tests/xfs/224 | 113 ++++++++++++++++++++++++++++++++++++++++++++ > tests/xfs/224.out | 14 +++++ > tests/xfs/225 | 108 ++++++++++++++++++++++++++++++++++++++++++ > tests/xfs/225.out | 14 +++++ > tests/xfs/226 | 108 ++++++++++++++++++++++++++++++++++++++++++ > tests/xfs/226.out | 14 +++++ > tests/xfs/228 | 137 +++++++++++++++++++++++++++++++++++++++++++++++++++++ > tests/xfs/228.out | 14 +++++ > tests/xfs/230 | 137 +++++++++++++++++++++++++++++++++++++++++++++++++++++ > tests/xfs/230.out | 14 +++++ > tests/xfs/group | 10 ++++ > 21 files changed, 1298 insertions(+) > create mode 100755 tests/xfs/215 > create mode 100644 tests/xfs/215.out > create mode 100755 tests/xfs/218 > create mode 100644 tests/xfs/218.out > create mode 100755 tests/xfs/219 > create mode 100644 tests/xfs/219.out > create mode 100755 tests/xfs/221 > create mode 100644 tests/xfs/221.out > create mode 100755 tests/xfs/223 > create mode 100644 tests/xfs/223.out > create mode 100755 tests/xfs/224 > create mode 100644 tests/xfs/224.out > create mode 100755 tests/xfs/225 > create mode 100644 tests/xfs/225.out > create mode 100755 tests/xfs/226 > create mode 100644 tests/xfs/226.out > create mode 100755 tests/xfs/228 > create mode 100644 tests/xfs/228.out > create mode 100755 tests/xfs/230 > create mode 100644 tests/xfs/230.out > > > diff --git a/tests/xfs/215 b/tests/xfs/215 > new file mode 100755 > index 0000000..8dd5cb5 > --- /dev/null > +++ b/tests/xfs/215 > @@ -0,0 +1,108 @@ > +#! /bin/bash > +# FS QA Test No. 215 > +# > +# Ensuring that copy on write in direct-io mode works when the CoW > +# range originally covers multiple extents, some unwritten, some not. > +# - Set cowextsize hint. > +# - Create a file and fallocate a second file. > +# - Reflink the odd blocks of the first file into the second file. > +# - directio CoW across the halfway mark, starting with the unwritten extent. > +# - Check that the files are now different where we say they're different. > +# > +#----------------------------------------------------------------------- > +# Copyright (c) 2016, Oracle and/or its affiliates. All Rights Reserved. > +# > +# This program is free software; you can redistribute it and/or > +# modify it under the terms of the GNU General Public License as > +# published by the Free Software Foundation. > +# > +# This program is distributed in the hope that it would be useful, > +# but WITHOUT ANY WARRANTY; without even the implied warranty of > +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the > +# GNU General Public License for more details. > +# > +# You should have received a copy of the GNU General Public License > +# along with this program; if not, write the Free Software Foundation, > +# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA > +#----------------------------------------------------------------------- > + > +seq=`basename "$0"` > +seqres="$RESULT_DIR/$seq" > +echo "QA output created by $seq" > + > +here=`pwd` > +tmp=/tmp/$$ > +status=1 # failure is the default! > +trap "_cleanup; exit \$status" 0 1 2 3 15 > + > +_cleanup() > +{ > + cd / > + rm -rf "$tmp".* > +} > + > +# get standard environment, filters and checks > +. ./common/rc > +. ./common/filter > +. ./common/reflink > + > +# real QA test starts here > +_supported_os Linux > +_require_scratch_reflink > +_require_xfs_io_command "falloc" > + > +rm -f "$seqres.full" > + > +echo "Format and mount" > +_scratch_mkfs > "$seqres.full" 2>&1 > +_scratch_mount >> "$seqres.full" 2>&1 > + > +testdir="$SCRATCH_MNT/test-$seq" > +rm -rf $testdir > +mkdir $testdir > + > +echo "Create the original files" > +blksz=65536 > +nr=64 > +real_blksz=$(stat -f -c '%S' "$testdir") > +internal_blks=$((blksz * nr / real_blksz)) > +"$XFS_IO_PROG" -c "cowextsize $((blksz * 16))" "$testdir" >> "$seqres.full" > +_pwrite_byte 0x61 0 $((blksz * nr)) "$testdir/file1" >> "$seqres.full" > +$XFS_IO_PROG -f -c "falloc 0 $((blksz * nr))" "$testdir/file3" >> "$seqres.full" > +_pwrite_byte 0x00 0 $((blksz * nr)) "$testdir/file3.chk" >> "$seqres.full" > +seq 0 2 $((nr-1)) | while read f; do > + _reflink_range "$testdir/file1" $((blksz * f)) "$testdir/file3" $((blksz * f)) $blksz >> "$seqres.full" > + _pwrite_byte 0x61 $((blksz * f)) $blksz "$testdir/file3.chk" >> "$seqres.full" > +done This looks like several tests use this setup. Factor? > +_scratch_remount > + > +echo "Compare files" > +md5sum "$testdir/file1" | _filter_scratch > +md5sum "$testdir/file3" | _filter_scratch > +md5sum "$testdir/file3.chk" | _filter_scratch > + > +echo "directio CoW across the transition" > +"$XFS_IO_PROG" -d -f -c "pwrite -S 0x63 -b $((blksz * nr / 2)) $((blksz * nr / 4)) $((blksz * nr / 2))" "$testdir/file3" >> "$seqres.full" > +_pwrite_byte 0x63 $((blksz * nr / 4)) $((blksz * nr / 2)) "$testdir/file3.chk" >> "$seqres.full" > +_scratch_remount These could really do with local variables to keep the verbosity down and make it easy to change in future. off=$((blksz * nr / 4)) iosz=$((blksz * nr / 2)) $XFS_IO_PROG -d -c "pwrite -S 0x63 -b $iosz $off $iosz" $testdir/file3 _pwrite_byte 0x63 $off $iosz $testdir/file3.chk -Dave. -- Dave Chinner david@fromorbit.com From david@fromorbit.com Tue Feb 9 02:15:52 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=ham version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay3.corp.sgi.com [198.149.34.15]) by oss.sgi.com (Postfix) with ESMTP id 096FC7CA2 for ; Tue, 9 Feb 2016 02:15:52 -0600 (CST) Received: from cuda.sgi.com (cuda1.sgi.com [192.48.157.11]) by relay3.corp.sgi.com (Postfix) with ESMTP id A6F04AC007 for ; Tue, 9 Feb 2016 00:15:51 -0800 (PST) X-ASG-Debug-ID: 1455005748-04bdf066ed163f0001-NocioJ Received: from ipmail06.adl2.internode.on.net (ipmail06.adl2.internode.on.net [150.101.137.129]) by cuda.sgi.com with ESMTP id 6BzrjIhel8ruadu7 for ; Tue, 09 Feb 2016 00:15:49 -0800 (PST) X-Barracuda-Envelope-From: david@fromorbit.com X-Barracuda-Apparent-Source-IP: 150.101.137.129 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: A2AXCABin7lWPBATLHleKAECgw+BP4ZjgXmdTwaLZ4VFhAeGBwICAQECgTRNAQEBAQEBBwEBAQFBP4RCAQEEOhwjEAgDGAklDwUlAwcaE4gavWkBAQgCAR0YhTKEf4hsBZJuhAmNR4Fkh2mFL44/gmUZgVwoLohTAQEB Received: from ppp121-44-19-16.lns20.syd4.internode.on.net (HELO dastard) ([121.44.19.16]) by ipmail06.adl2.internode.on.net with ESMTP; 09 Feb 2016 18:45:48 +1030 Received: from dave by dastard with local (Exim 4.80) (envelope-from ) id 1aT3Sd-0002Dm-NN; Tue, 09 Feb 2016 19:15:47 +1100 Date: Tue, 9 Feb 2016 19:15:47 +1100 From: Dave Chinner To: "Darrick J. Wong" Cc: linux-btrfs@vger.kernel.org, fstests@vger.kernel.org, xfs@oss.sgi.com Subject: Re: [PATCH 18/23] xfs: test the automatic cowextsize extent garbage collector Message-ID: <20160209081547.GN19486@dastard> X-ASG-Orig-Subj: Re: [PATCH 18/23] xfs: test the automatic cowextsize extent garbage collector References: <20160209011145.23099.95354.stgit@birch.djwong.org> <20160209011342.23099.23019.stgit@birch.djwong.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20160209011342.23099.23019.stgit@birch.djwong.org> User-Agent: Mutt/1.5.21 (2010-09-15) X-Barracuda-Connect: ipmail06.adl2.internode.on.net[150.101.137.129] X-Barracuda-Start-Time: 1455005748 X-Barracuda-URL: https://192.48.157.11:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-BRTS-Status: 1 X-Barracuda-Spam-Score: 0.00 X-Barracuda-Spam-Status: No, SCORE=0.00 using per-user scores of TAG_LEVEL=1000.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.7 tests=BSF_SC0_MISMATCH_TO X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.3.26881 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 0.00 BSF_SC0_MISMATCH_TO Envelope rcpt doesn't match header On Mon, Feb 08, 2016 at 05:13:42PM -0800, Darrick J. Wong wrote: > Signed-off-by: Darrick J. Wong > + > +_cleanup() > +{ > + cd / > + echo $old_cow_lifetime > /proc/sys/fs/xfs/speculative_cow_prealloc_lifetime > + #rm -rf "$tmp".* "$testdir" uncomment. > +echo "CoW and leave leftovers" > +echo $old_cow_lifetime > /proc/sys/fs/xfs/speculative_cow_prealloc_lifetime > +seq 2 2 $((nr - 1)) | while read f; do > + "$XFS_IO_PROG" -f -c "pwrite -S 0x63 $((blksz * f)) 1" "$testdir/file2" >> "$seqres.full" > + "$XFS_IO_PROG" -f -c "pwrite -S 0x63 $((blksz * f)) 1" "$testdir/file2.chk" >> "$seqres.full" > +done Ok, I just realised what was bugging me about these loops: "f" is not a typical loop iterator for a count. Normally we'd use "i" for these.... > +echo "old extents: $old_extents" >> "$seqres.full" > +echo "new extents: $new_extents" >> "$seqres.full" > +echo "maximum extents: $internal_blks" >> "$seqres.full" > +test $new_extents -lt $((internal_blks / 7)) || _fail "file2 badly fragmented" I wouldn't use _fail like this, echo is sufficient to cause the test to fail. > +echo "Check for damage" > +umount "$SCRATCH_MNT" > + > +# success, all done > +status=0 > +exit As would getting rid of the unmount and just setting status appropriately... /repeat -Dave. -- Dave Chinner david@fromorbit.com From darrick.wong@oracle.com Tue Feb 9 02:16:51 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay3.corp.sgi.com [198.149.34.15]) by oss.sgi.com (Postfix) with ESMTP id B49B87CA2 for ; Tue, 9 Feb 2016 02:16:51 -0600 (CST) Received: from cuda.sgi.com (cuda3.sgi.com [192.48.176.15]) by relay3.corp.sgi.com (Postfix) with ESMTP id 1F9C3AC004 for ; Tue, 9 Feb 2016 00:16:50 -0800 (PST) X-ASG-Debug-ID: 1455005808-04cb6c1e5815e60001-NocioJ Received: from userp1040.oracle.com (userp1040.oracle.com [156.151.31.81]) by cuda.sgi.com with ESMTP id S359FaoFtFvLgskS (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO) for ; Tue, 09 Feb 2016 00:16:49 -0800 (PST) X-Barracuda-Envelope-From: darrick.wong@oracle.com X-Barracuda-Apparent-Source-IP: 156.151.31.81 Received: from aserv0022.oracle.com (aserv0022.oracle.com [141.146.126.234]) by userp1040.oracle.com (Sentrion-MTA-4.3.2/Sentrion-MTA-4.3.2) with ESMTP id u198GlHT018517 (version=TLSv1 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Tue, 9 Feb 2016 08:16:47 GMT Received: from userv0121.oracle.com (userv0121.oracle.com [156.151.31.72]) by aserv0022.oracle.com (8.13.8/8.13.8) with ESMTP id u198Gkmb014103 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=FAIL); Tue, 9 Feb 2016 08:16:46 GMT Received: from abhmp0012.oracle.com (abhmp0012.oracle.com [141.146.116.18]) by userv0121.oracle.com (8.13.8/8.13.8) with ESMTP id u198GjYN019175; Tue, 9 Feb 2016 08:16:46 GMT Received: from localhost (/24.21.154.84) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Tue, 09 Feb 2016 00:16:45 -0800 Date: Tue, 9 Feb 2016 00:16:44 -0800 From: "Darrick J. Wong" To: Dave Chinner Cc: fstests@vger.kernel.org, linux-btrfs@vger.kernel.org, xfs@oss.sgi.com Subject: Re: [PATCH 10/23] xfs: more reflink tests Message-ID: <20160209081644.GB6350@birch.djwong.org> X-ASG-Orig-Subj: Re: [PATCH 10/23] xfs: more reflink tests References: <20160209011145.23099.95354.stgit@birch.djwong.org> <20160209011250.23099.50000.stgit@birch.djwong.org> <20160209073622.GI19486@dastard> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20160209073622.GI19486@dastard> User-Agent: Mutt/1.5.21 (2010-09-15) X-Source-IP: aserv0022.oracle.com [141.146.126.234] X-Barracuda-Connect: userp1040.oracle.com[156.151.31.81] X-Barracuda-Start-Time: 1455005808 X-Barracuda-Encrypted: ECDHE-RSA-AES256-GCM-SHA384 X-Barracuda-URL: https://192.48.176.15:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-BRTS-Status: 1 X-Barracuda-Spam-Score: 0.00 X-Barracuda-Spam-Status: No, SCORE=0.00 using per-user scores of TAG_LEVEL=1000.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.7 tests=BSF_SC0_MISMATCH_TO, UNPARSEABLE_RELAY X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.3.26881 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 0.00 BSF_SC0_MISMATCH_TO Envelope rcpt doesn't match header 0.00 UNPARSEABLE_RELAY Informational: message has unparseable relay lines On Tue, Feb 09, 2016 at 06:36:22PM +1100, Dave Chinner wrote: > On Mon, Feb 08, 2016 at 05:12:50PM -0800, Darrick J. Wong wrote: > > Create a couple of XFS-specific tests -- one to check that growing > > and shrinking the refcount btree works and a second one to check > > what happens when we hit maximum refcount. > > > > Signed-off-by: Darrick J. Wong > ..... > > +# real QA test starts here > > +_supported_os Linux > > +_supported_fs xfs > > +_require_scratch_reflink > > +_require_cp_reflink > .... > > + > > +test -x "$here/src/punch-alternating" || _notrun "punch-alternating not built" > > I suspect we need a _require rule for checking that something in > the test src directory has been built. Crapola, we also need punch-alternating, which doesn't appear until the next patch. Guess I'll go move it out of the next patch (or swap the order of these two I guess.) I added _require_test_program() which complains if src/$1 isn't built. > > +echo "Check scratch fs" > > +umount "$SCRATCH_MNT" > > +echo "check refcount after removing all files" >> "$seqres.full" > > +"$XFS_DB_PROG" -c 'agf 0' -c 'addr refcntroot' -c 'p recs[1]' "$SCRATCH_DEV" >> "$seqres.full" > > +"$XFS_REPAIR_PROG" -o force_geometry -n "$SCRATCH_DEV" >> "$seqres.full" 2>&1 > > +res=$? > > +if [ $res -eq 0 ]; then > > + # If repair succeeds then format the device so that the post-test > > + # check doesn't fail due to the single AG. > > + _scratch_mkfs >> "$seqres.full" 2>&1 > > +else > > + _fail "xfs_repair fails" > > +fi > > + > > +# success, all done > > +status=0 > > +exit > > This is what _require_scratch_nocheck avoids. > > i.e. do this instead: > > _require_scratch_nocheck > ..... > > "$XFS_REPAIR_PROG" -o force_geometry -n "$SCRATCH_DEV" >> "$seqres.full" 2>&1 > status=$? > exit Ok. > Also, we really don't need the quotes around these global > variables. They are just noise and lots of stuff will break if > those variables are set to something that requires them to be > quoted. --D > > Cheers, > > Dave. > -- > Dave Chinner > david@fromorbit.com > > _______________________________________________ > xfs mailing list > xfs@oss.sgi.com > http://oss.sgi.com/mailman/listinfo/xfs From david@fromorbit.com Tue Feb 9 02:26:45 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=ham version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay1.corp.sgi.com [137.38.102.111]) by oss.sgi.com (Postfix) with ESMTP id A7EE87CA2 for ; Tue, 9 Feb 2016 02:26:45 -0600 (CST) Received: from cuda.sgi.com (cuda3.sgi.com [192.48.176.15]) by relay1.corp.sgi.com (Postfix) with ESMTP id 79B148F8033 for ; Tue, 9 Feb 2016 00:26:45 -0800 (PST) X-ASG-Debug-ID: 1455006401-04cb6c1e5716240001-NocioJ Received: from ipmail06.adl2.internode.on.net (ipmail06.adl2.internode.on.net [150.101.137.129]) by cuda.sgi.com with ESMTP id fGRrDTNd5gMAXC0G for ; Tue, 09 Feb 2016 00:26:42 -0800 (PST) X-Barracuda-Envelope-From: david@fromorbit.com X-Barracuda-Apparent-Source-IP: 150.101.137.129 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: A2AzCAC5oblWPBATLHleKAECgw9SbYhcnT0SBotnhUWEBxmCRIMqAgIBAQKBNU0BAQEBAQEHAQEBAUE/hEIBAQQ6HCMQCAMHEQklDwUlAwcaE4gavWkBAQEBBgEBAQEcGIUyhH+IbAWHU4VfhTyDSEGNR4FkjRiKbYNShFooLohTAQEB Received: from ppp121-44-19-16.lns20.syd4.internode.on.net (HELO dastard) ([121.44.19.16]) by ipmail06.adl2.internode.on.net with ESMTP; 09 Feb 2016 18:56:40 +1030 Received: from dave by dastard with local (Exim 4.80) (envelope-from ) id 1aT3dA-0002Ez-20; Tue, 09 Feb 2016 19:26:40 +1100 Date: Tue, 9 Feb 2016 19:26:40 +1100 From: Dave Chinner To: "Darrick J. Wong" Cc: linux-btrfs@vger.kernel.org, fstests@vger.kernel.org, xfs@oss.sgi.com Subject: Re: [PATCH 19/23] xfs: test rmapbt functionality Message-ID: <20160209082639.GO19486@dastard> X-ASG-Orig-Subj: Re: [PATCH 19/23] xfs: test rmapbt functionality References: <20160209011145.23099.95354.stgit@birch.djwong.org> <20160209011348.23099.30668.stgit@birch.djwong.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20160209011348.23099.30668.stgit@birch.djwong.org> User-Agent: Mutt/1.5.21 (2010-09-15) X-Barracuda-Connect: ipmail06.adl2.internode.on.net[150.101.137.129] X-Barracuda-Start-Time: 1455006401 X-Barracuda-URL: https://192.48.176.15:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-BRTS-Status: 1 X-Barracuda-Spam-Score: 0.00 X-Barracuda-Spam-Status: No, SCORE=0.00 using per-user scores of TAG_LEVEL=1000.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.7 tests=BSF_SC0_MISMATCH_TO X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.3.26882 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 0.00 BSF_SC0_MISMATCH_TO Envelope rcpt doesn't match header On Mon, Feb 08, 2016 at 05:13:48PM -0800, Darrick J. Wong wrote: > Signed-off-by: Darrick J. Wong > --- > common/xfs | 44 ++++++++++++++++++++++ > tests/xfs/233 | 78 ++++++++++++++++++++++++++++++++++++++ > tests/xfs/233.out | 6 +++ > tests/xfs/234 | 89 ++++++++++++++++++++++++++++++++++++++++++++ > tests/xfs/234.out | 6 +++ > tests/xfs/235 | 108 +++++++++++++++++++++++++++++++++++++++++++++++++++++ > tests/xfs/235.out | 14 +++++++ > tests/xfs/236 | 93 ++++++++++++++++++++++++++++++++++++++++++++++ > tests/xfs/236.out | 8 ++++ > tests/xfs/group | 4 ++ > 10 files changed, 450 insertions(+) > create mode 100644 common/xfs > create mode 100755 tests/xfs/233 > create mode 100644 tests/xfs/233.out > create mode 100755 tests/xfs/234 > create mode 100644 tests/xfs/234.out > create mode 100755 tests/xfs/235 > create mode 100644 tests/xfs/235.out > create mode 100755 tests/xfs/236 > create mode 100644 tests/xfs/236.out > > > diff --git a/common/xfs b/common/xfs > new file mode 100644 > index 0000000..2d1a76f > --- /dev/null > +++ b/common/xfs > @@ -0,0 +1,44 @@ > +##/bin/bash > +# Routines for handling XFS > +#----------------------------------------------------------------------- > +# Copyright (c) 2015 Oracle. All Rights Reserved. > +# This program is free software; you can redistribute it and/or modify > +# it under the terms of the GNU General Public License as published by > +# the Free Software Foundation; either version 2 of the License, or > +# (at your option) any later version. > +# > +# This program is distributed in the hope that it will be useful, > +# but WITHOUT ANY WARRANTY; without even the implied warranty of > +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the > +# GNU General Public License for more details. > +# > +# You should have received a copy of the GNU General Public License > +# along with this program; if not, write to the Free Software > +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 > +# USA > +# > +# Contact information: Oracle Corporation, 500 Oracle Parkway, > +# Redwood Shores, CA 94065, USA, or: http://www.oracle.com/ > +#----------------------------------------------------------------------- > + > +_require_xfs_test_rmapbt() > +{ > + _require_test > + > + if [ "$(xfs_info "$TEST_DIR" | grep -c "rmapbt=1")" -ne 1 ]; then > + _notrun "rmapbt not supported by test filesystem type: $FSTYP" > + fi > +} > + > +_require_xfs_scratch_rmapbt() > +{ > + _require_scratch > + > + _scratch_mkfs > /dev/null > + _scratch_mount > + if [ "$(xfs_info "$SCRATCH_MNT" | grep -c "rmapbt=1")" -ne 1 ]; then > + _scratch_unmount > + _notrun "rmapbt not supported by scratch filesystem type: $FSTYP" > + fi > + _scratch_unmount > +} No, not yet. :) Wait until I get my "split common/rc" patchset out there, because it does not require: > +# get standard environment, filters and checks > +. ./common/rc > +. ./common/filter > +. ./common/xfs This. And i don't want to have to undo a bunch of stuff in tests yet. Just lump it all in common/rc for the moment. > + > +# real QA test starts here > +_supported_os Linux > +_supported_fs xfs > +_require_xfs_scratch_rmapbt > + > +echo "Format and mount" > +_scratch_mkfs -d size=$((2 * 4096 * 4096)) -l size=4194304 > "$seqres.full" 2>&1 > +_scratch_mount >> "$seqres.full" 2>&1 _scratch_mkfs_sized ? > +here=`pwd` > +tmp=/tmp/$$ > +status=1 # failure is the default! > +trap "_cleanup; exit \$status" 0 1 2 3 15 > + > +_cleanup() > +{ > + cd / > + #rm -f $tmp.* More random uncommenting needed. > + > +echo "Check for damage" > +umount "$SCRATCH_MNT" > +_check_scratch_fs > + > +# success, all done > +status=0 > +exit Cull. -Dave. -- Dave Chinner david@fromorbit.com From david@fromorbit.com Tue Feb 9 02:32:19 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=ham version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay1.corp.sgi.com [137.38.102.111]) by oss.sgi.com (Postfix) with ESMTP id B13447CA2 for ; Tue, 9 Feb 2016 02:32:19 -0600 (CST) Received: from cuda.sgi.com (cuda2.sgi.com [192.48.176.25]) by relay1.corp.sgi.com (Postfix) with ESMTP id 9E4428F8040 for ; Tue, 9 Feb 2016 00:32:19 -0800 (PST) X-ASG-Debug-ID: 1455006737-04cbb0433124e70001-NocioJ Received: from ipmail06.adl2.internode.on.net (ipmail06.adl2.internode.on.net [150.101.137.129]) by cuda.sgi.com with ESMTP id Xi4pbL5DbIFi4EH4 for ; Tue, 09 Feb 2016 00:32:17 -0800 (PST) X-Barracuda-Envelope-From: david@fromorbit.com X-Barracuda-Apparent-Source-IP: 150.101.137.129 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: A2DGBwDjorlWPBATLHleKAECgw+BP4ZjgXmdTwaLZ4VFhAeGBwQCAoE1TQEBAQEBAQcBAQEBQT+EQgEBBDocIxAIAyElDwUlAwcaE4gavWwBAQgCHhiFMoR/iGwBBJZ3jUeOfI4/hFooLohTAQEB Received: from ppp121-44-19-16.lns20.syd4.internode.on.net (HELO dastard) ([121.44.19.16]) by ipmail06.adl2.internode.on.net with ESMTP; 09 Feb 2016 19:02:16 +1030 Received: from dave by dastard with local (Exim 4.80) (envelope-from ) id 1aT3iZ-0002Fs-N6; Tue, 09 Feb 2016 19:32:15 +1100 Date: Tue, 9 Feb 2016 19:32:15 +1100 From: Dave Chinner To: "Darrick J. Wong" Cc: linux-btrfs@vger.kernel.org, fstests@vger.kernel.org, xfs@oss.sgi.com Subject: Re: [PATCH 21/23] xfs: aio cow tests Message-ID: <20160209083215.GP19486@dastard> X-ASG-Orig-Subj: Re: [PATCH 21/23] xfs: aio cow tests References: <20160209011145.23099.95354.stgit@birch.djwong.org> <20160209011401.23099.38.stgit@birch.djwong.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20160209011401.23099.38.stgit@birch.djwong.org> User-Agent: Mutt/1.5.21 (2010-09-15) X-Barracuda-Connect: ipmail06.adl2.internode.on.net[150.101.137.129] X-Barracuda-Start-Time: 1455006737 X-Barracuda-URL: https://192.48.176.25:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-BRTS-Status: 1 X-Barracuda-Spam-Score: 0.00 X-Barracuda-Spam-Status: No, SCORE=0.00 using per-user scores of TAG_LEVEL=1000.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.7 tests=BSF_SC0_MISMATCH_TO X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.3.26882 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 0.00 BSF_SC0_MISMATCH_TO Envelope rcpt doesn't match header On Mon, Feb 08, 2016 at 05:14:01PM -0800, Darrick J. Wong wrote: .,,, > + > +echo "Check for damage" > +_dmerror_unmount > +_dmerror_cleanup > +_repair_scratch_fs >> "$seqres.full" 2>&1 Are you testing repair here? If so, why doesn't failure matter. If not, why do it? Or is _require_scratch_nocheck all that is needed here? > +echo "CoW and unmount" > +"$XFS_IO_PROG" -f -c "pwrite -S 0x63 $((blksz * bsz)) 1" "$testdir/file2" >> "$seqres.full" > +"$XFS_IO_PROG" -f -c "pwrite -S 0x63 -b $((blksz * bsz)) 0 $((blksz * nr))" "$TEST_DIR/moo" >> "$seqres.full" offset = block size times block size? I think some better names might be needed... Cheers, Dave. -- Dave Chinner david@fromorbit.com From david@fromorbit.com Tue Feb 9 02:54:01 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=ham version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay1.corp.sgi.com [137.38.102.111]) by oss.sgi.com (Postfix) with ESMTP id 852957CA2 for ; Tue, 9 Feb 2016 02:54:01 -0600 (CST) Received: from cuda.sgi.com (cuda2.sgi.com [192.48.176.25]) by relay1.corp.sgi.com (Postfix) with ESMTP id 73C4F8F8040 for ; Tue, 9 Feb 2016 00:54:01 -0800 (PST) X-ASG-Debug-ID: 1455008038-04cbb0433226a70001-NocioJ Received: from ipmail06.adl2.internode.on.net (ipmail06.adl2.internode.on.net [150.101.137.129]) by cuda.sgi.com with ESMTP id kKhGjEvD9m8Zaul6 for ; Tue, 09 Feb 2016 00:53:58 -0800 (PST) X-Barracuda-Envelope-From: david@fromorbit.com X-Barracuda-Apparent-Source-IP: 150.101.137.129 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: A2AXCADEqLlWPBATLHleKAECgw+BP4ZjgXmdTwaLZ4VFhAeGBwICAQECgTVNAQEBAQEBBwEBAQFBP4RCAQEEOhwjEAgDGAklDwUlAwcaExuHf71/AQEBBwIBHRiFMoR/hACEbAWWd41HjnyOP4RaKC6HGoE5AQEB Received: from ppp121-44-19-16.lns20.syd4.internode.on.net (HELO dastard) ([121.44.19.16]) by ipmail06.adl2.internode.on.net with ESMTP; 09 Feb 2016 19:23:29 +1030 Received: from dave by dastard with local (Exim 4.80) (envelope-from ) id 1aT436-0002Hb-3g; Tue, 09 Feb 2016 19:53:28 +1100 Date: Tue, 9 Feb 2016 19:53:28 +1100 From: Dave Chinner To: "Darrick J. Wong" Cc: linux-btrfs@vger.kernel.org, fstests@vger.kernel.org, xfs@oss.sgi.com Subject: Re: [PATCH 12/23] xfs/122: support refcount/rmap data structures Message-ID: <20160209085328.GQ19486@dastard> X-ASG-Orig-Subj: Re: [PATCH 12/23] xfs/122: support refcount/rmap data structures References: <20160209011145.23099.95354.stgit@birch.djwong.org> <20160209011303.23099.40721.stgit@birch.djwong.org> <20160209074330.GK19486@dastard> <20160209075506.GB6346@birch.djwong.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20160209075506.GB6346@birch.djwong.org> User-Agent: Mutt/1.5.21 (2010-09-15) X-Barracuda-Connect: ipmail06.adl2.internode.on.net[150.101.137.129] X-Barracuda-Start-Time: 1455008038 X-Barracuda-URL: https://192.48.176.25:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-BRTS-Status: 1 X-Barracuda-Spam-Score: 0.00 X-Barracuda-Spam-Status: No, SCORE=0.00 using per-user scores of TAG_LEVEL=1000.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.7 tests=BSF_SC0_MISMATCH_TO X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.3.26882 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 0.00 BSF_SC0_MISMATCH_TO Envelope rcpt doesn't match header On Mon, Feb 08, 2016 at 11:55:06PM -0800, Darrick J. Wong wrote: > On Tue, Feb 09, 2016 at 06:43:30PM +1100, Dave Chinner wrote: > > On Mon, Feb 08, 2016 at 05:13:03PM -0800, Darrick J. Wong wrote: > > > Include the refcount and rmap structures in the golden output. > > > > > > Signed-off-by: Darrick J. Wong > > > --- > > > tests/xfs/122 | 3 +++ > > > tests/xfs/122.out | 4 ++++ > > > tests/xfs/group | 2 +- > > > 3 files changed, 8 insertions(+), 1 deletion(-) > > > > > > > > > diff --git a/tests/xfs/122 b/tests/xfs/122 > > > index e6697a2..758cb50 100755 > > > --- a/tests/xfs/122 > > > +++ b/tests/xfs/122 > > > @@ -90,6 +90,9 @@ xfs_da3_icnode_hdr > > > xfs_dir3_icfree_hdr > > > xfs_dir3_icleaf_hdr > > > xfs_name > > > +xfs_owner_info > > > +xfs_refcount_irec > > > +xfs_rmap_irec > > > xfs_alloctype_t > > > xfs_buf_cancel_t > > > xfs_bmbt_rec_32_t > > > > So this is going to cause failures on any userspace that doesn't > > know about these new types, right? > > > > Should these be conditional in some way? > > I wasn't sure how to handle this -- I could just keep the patch at the head of > my stack (unreleased) until xfsprogs pulls in the appropriate libxfs pieces? > So long as we're not dead certain of the final format of the rmapbt and > refcountbt, there's probably not a lot of value in putting this in (yet). Well, I'm more concerned about running on older/current distros that don't have support for them in userspace. My brain is mush right now, so I don't have any brilliant ideas (hence the question, rather than also presenting a posible solution). I'll have a think; maybe we can make use of the configurable .out file code we have now? Cheers, Dave. -- Dave Chinner david@fromorbit.com From BATV+8a0f1d4024691c30ef87+4552+infradead.org+hch@bombadil.srs.infradead.org Tue Feb 9 03:11:09 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=ham version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay1.corp.sgi.com [137.38.102.111]) by oss.sgi.com (Postfix) with ESMTP id BF9527CA2 for ; Tue, 9 Feb 2016 03:11:09 -0600 (CST) Received: from cuda.sgi.com (cuda2.sgi.com [192.48.176.25]) by relay1.corp.sgi.com (Postfix) with ESMTP id AD9F48F8033 for ; Tue, 9 Feb 2016 01:11:06 -0800 (PST) X-ASG-Debug-ID: 1455009063-04cbb0433127c10001-NocioJ Received: from bombadil.infradead.org ([198.137.202.9]) by cuda.sgi.com with ESMTP id pxqlPh11iKBU3syO (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128 verify=NO) for ; Tue, 09 Feb 2016 01:11:04 -0800 (PST) X-Barracuda-Envelope-From: BATV+8a0f1d4024691c30ef87+4552+infradead.org+hch@bombadil.srs.infradead.org X-Barracuda-Apparent-Source-IP: 198.137.202.9 Received: from hch by bombadil.infradead.org with local (Exim 4.80.1 #2 (Red Hat Linux)) id 1aT4K7-0007Ve-Jm; Tue, 09 Feb 2016 09:11:03 +0000 Date: Tue, 9 Feb 2016 01:11:03 -0800 From: Christoph Hellwig To: Dave Chinner Cc: xfs@oss.sgi.com Subject: Re: [PATCH 2/4] xfs: Introduce writeback context for writepages Message-ID: <20160209091103.GA23349@infradead.org> X-ASG-Orig-Subj: Re: [PATCH 2/4] xfs: Introduce writeback context for writepages References: <1440479153-1584-1-git-send-email-david@fromorbit.com> <1440479153-1584-3-git-send-email-david@fromorbit.com> <20160208073631.GA1789@infradead.org> <20160208075403.GA29242@infradead.org> <20160208202123.GL27429@dastard> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20160208202123.GL27429@dastard> User-Agent: Mutt/1.5.24 (2015-08-30) X-SRS-Rewrite: SMTP reverse-path rewritten from by bombadil.infradead.org See http://www.infradead.org/rpr.html X-Barracuda-Connect: UNKNOWN[198.137.202.9] X-Barracuda-Start-Time: 1455009064 X-Barracuda-Encrypted: ECDHE-RSA-AES128-GCM-SHA256 X-Barracuda-URL: https://192.48.176.25:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-BRTS-Status: 1 X-Barracuda-Spam-Score: 0.10 X-Barracuda-Spam-Status: No, SCORE=0.10 using per-user scores of TAG_LEVEL=1000.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.7 tests=BSF_SC0_MISMATCH_TO, RDNS_NONE X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.3.26882 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 0.00 BSF_SC0_MISMATCH_TO Envelope rcpt doesn't match header 0.10 RDNS_NONE Delivered to trusted network by a host with no rDNS On Tue, Feb 09, 2016 at 07:21:23AM +1100, Dave Chinner wrote: > What is your test config? The only failures I've had recently of > generic/311 were caused by a bug in the fsync-tester application. > This was fixed by commit 9165a84 ("fsync-tester: reopen files with > correct flags") that was pushed out in the fstests update I did > yesterday. Yeah, that seems to fix it. From BATV+8a0f1d4024691c30ef87+4552+infradead.org+hch@bombadil.srs.infradead.org Tue Feb 9 03:16:37 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=ham version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay3.corp.sgi.com [198.149.34.15]) by oss.sgi.com (Postfix) with ESMTP id 84A337CA2 for ; Tue, 9 Feb 2016 03:16:37 -0600 (CST) Received: from cuda.sgi.com (cuda1.sgi.com [192.48.157.11]) by relay3.corp.sgi.com (Postfix) with ESMTP id 24899AC003 for ; Tue, 9 Feb 2016 01:16:34 -0800 (PST) X-ASG-Debug-ID: 1455009392-04bdf066ea18df0001-NocioJ Received: from bombadil.infradead.org ([198.137.202.9]) by cuda.sgi.com with ESMTP id ELkcUK3JL1KusYeP (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128 verify=NO) for ; Tue, 09 Feb 2016 01:16:32 -0800 (PST) X-Barracuda-Envelope-From: BATV+8a0f1d4024691c30ef87+4552+infradead.org+hch@bombadil.srs.infradead.org X-Barracuda-Apparent-Source-IP: 198.137.202.9 Received: from hch by bombadil.infradead.org with local (Exim 4.80.1 #2 (Red Hat Linux)) id 1aT4PQ-0002EK-Q7; Tue, 09 Feb 2016 09:16:32 +0000 Date: Tue, 9 Feb 2016 01:16:32 -0800 From: Christoph Hellwig To: Dave Chinner Cc: Christoph Hellwig , xfs@oss.sgi.com Subject: Re: [PATCH 6/6] xfs: rename XFS_BUF_ZEROFLAGS macro Message-ID: <20160209091632.GB23349@infradead.org> X-ASG-Orig-Subj: Re: [PATCH 6/6] xfs: rename XFS_BUF_ZEROFLAGS macro References: <1454632683-20543-1-git-send-email-david@fromorbit.com> <1454632683-20543-7-git-send-email-david@fromorbit.com> <20160208091235.GN5534@infradead.org> <20160208223120.GM27429@dastard> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20160208223120.GM27429@dastard> User-Agent: Mutt/1.5.24 (2015-08-30) X-SRS-Rewrite: SMTP reverse-path rewritten from by bombadil.infradead.org See http://www.infradead.org/rpr.html X-Barracuda-Connect: UNKNOWN[198.137.202.9] X-Barracuda-Start-Time: 1455009392 X-Barracuda-Encrypted: ECDHE-RSA-AES128-GCM-SHA256 X-Barracuda-URL: https://192.48.157.11:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-BRTS-Status: 1 X-Barracuda-Spam-Score: 0.10 X-Barracuda-Spam-Status: No, SCORE=0.10 using per-user scores of TAG_LEVEL=1000.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.7 tests=BSF_SC0_MISMATCH_TO, RDNS_NONE X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.3.26882 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 0.00 BSF_SC0_MISMATCH_TO Envelope rcpt doesn't match header 0.10 RDNS_NONE Delivered to trusted network by a host with no rDNS On Tue, Feb 09, 2016 at 09:31:20AM +1100, Dave Chinner wrote: > > xlog_sync already sets a lot of these flags again, and is called on an > > iclog buffer which never has the READ or XBF_WRITE_FAIL set, so just > > replacing it with an opencoded > > > > bp->b_flags &= (XBF_FUA | XBF_FLUSH); > > We can't do that because there are internal flags like _XBF_PAGES > that are set on log buffers. Clearing such flags will cause problems > when the iclog buffer is finally released on unmount. Hence I'd > prefer to keep the code as it stands. Sorry - meabt to write: bp->b_flags &= ~(XBF_FUA | XBF_FLUSH); which is all we'll need. All other flags cleared by XFS_BUF_ZEROFLAGS are either never set for log buffers (XBF_READ, XBF_WRITE_FAIL), or always set for log buffers (XBF_WRITE, XBF_ASYNC, XBF_SYNCIO). From jack@suse.cz Tue Feb 9 03:43:45 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=ham version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay3.corp.sgi.com [198.149.34.15]) by oss.sgi.com (Postfix) with ESMTP id F10EC7CA2 for ; Tue, 9 Feb 2016 03:43:44 -0600 (CST) Received: from cuda.sgi.com (cuda3.sgi.com [192.48.176.15]) by relay3.corp.sgi.com (Postfix) with ESMTP id 6B86EAC004 for ; Tue, 9 Feb 2016 01:43:44 -0800 (PST) X-ASG-Debug-ID: 1455011019-04cb6c1e5919d70001-NocioJ Received: from mx2.suse.de (mx2.suse.de [195.135.220.15]) by cuda.sgi.com with ESMTP id NC5Jbw1i4SZt9PFW (version=TLSv1 cipher=ECDHE-RSA-AES256-SHA bits=256 verify=NO) for ; Tue, 09 Feb 2016 01:43:40 -0800 (PST) X-Barracuda-Envelope-From: jack@suse.cz X-Barracuda-Apparent-Source-IP: 195.135.220.15 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay1.suse.de (charybdis-ext.suse.de [195.135.220.254]) by mx2.suse.de (Postfix) with ESMTP id 8E1FEAD5E; Tue, 9 Feb 2016 09:43:37 +0000 (UTC) Received: by quack.suse.cz (Postfix, from userid 1000) id E9277823D6; Tue, 9 Feb 2016 10:43:53 +0100 (CET) Date: Tue, 9 Feb 2016 10:43:53 +0100 From: Jan Kara To: Dan Williams Cc: Dave Chinner , Ross Zwisler , "linux-kernel@vger.kernel.org" , Theodore Ts'o , Alexander Viro , Andreas Dilger , Andrew Morton , Jan Kara , Matthew Wilcox , linux-ext4 , linux-fsdevel , Linux MM , "linux-nvdimm@lists.01.org" , XFS Developers , jmoyer Subject: Re: [PATCH 2/2] dax: move writeback calls into the filesystems Message-ID: <20160209094353.GF9451@quack.suse.cz> X-ASG-Orig-Subj: Re: [PATCH 2/2] dax: move writeback calls into the filesystems References: <1454829553-29499-1-git-send-email-ross.zwisler@linux.intel.com> <1454829553-29499-3-git-send-email-ross.zwisler@linux.intel.com> <20160207215047.GJ31407@dastard> <20160208201808.GK27429@dastard> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.24 (2015-08-30) X-Barracuda-Connect: mx2.suse.de[195.135.220.15] X-Barracuda-Start-Time: 1455011020 X-Barracuda-Encrypted: ECDHE-RSA-AES256-SHA X-Barracuda-URL: https://192.48.176.15:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-BRTS-Status: 1 X-Barracuda-Spam-Score: 0.00 X-Barracuda-Spam-Status: No, SCORE=0.00 using per-user scores of TAG_LEVEL=1000.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.7 tests=BSF_SC0_MISMATCH_TO X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.3.26883 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 0.00 BSF_SC0_MISMATCH_TO Envelope rcpt doesn't match header On Mon 08-02-16 12:55:24, Dan Williams wrote: > On Mon, Feb 8, 2016 at 12:18 PM, Dave Chinner wrote: > [..] > >> Setting aside the current block zeroing problem you seem to assuming > >> that DAX will always be faster and that may not be true at a media > >> level. Waiting years for some applications to determine if DAX makes > >> sense for their use case seems completely reasonable. In the meantime > >> the apps that are already making these changes want to know that a DAX > >> mapping request has not silently dropped backed to page cache. They > >> also want to know if they successfully jumped through all the hoops to > >> get a larger than pte mapping. > >> > >> I agree it is useful to be able to force DAX on an unmodified > >> application to see what happens, and it follows that if those > >> applications want to run in that mode they will need functional > >> fsync()... > >> > >> I would feel better if we were talking about specific applications and > >> performance numbers to know if forcing DAX on application is a debug > >> facility or a production level capability. You seem to have already > >> made that determination and I'm curious what I'm missing. > > > > I'm not setting any policy here at all. This whole argument is > > based around the DAX mount option doing "global fs enable or > > silently turning it off" and the application not knowing about that. > > > > The whole point of having a persistent per-inode DAX flags is that > > it is a policy mechanism, not a policy. The application can, if it > > is DAX aware, directly control whether DAX is used on a file or not. > > The application can even query and clear that persistent inode flag > > if it is configured not to (or cannot) use DAX. > > > > If the filesystem cannot support DAX, then we can error out attempts > > to set the DAX flag and then the app knows DAX is not available. > > i.e. the attempt to set policy failed. If the flag is set, then the > > inode will *always* use DAX - there is no "fall back to page cache" > > when DAX is enabled. > > > > If the applicaiton is not DAX aware, then the admin can control the > > DAX policy by manipulating these flags themselves, and hence control > > whether DAX is used by the application or not. > > > > If you think I'm dictating policy for DAX users and application, > > then you haven't understood anything I've previously said about why > > the DAX mount option needs to die before any of this is considered > > production ready. DAX is not an opaque "all or nothing" option. XFS > > will provide apps and admins with fine-grained, persistent, > > discoverable policy flags to allow admins and applications to set > > DAX policies however they see fit. This simply cannot be done if the > > only knob you have is a mount option that may or may not stick. > > I agree the mount option needs to die, and I fully grok the reasoning. > What I'm concerned with is that a system using fully-DAX-aware > applications is forced to incur the overhead of maintaining *sync > semantics, periodic sync(2) in particular, even if it is not relying > on those semantics. Let me somewhat correct this: IMO hard requirement is maintaining sync(2) semantics. Periodic writeback does not have any hard durability guarantees and we are free to ignore such requests in ->writepages() (that function has enough information in the writeback_control structure to differentiate between periodic writeback and data integrity sync) if we decide it is useful. Actually, we could do that even for 4.5. Honza -- Jan Kara SUSE Labs, CR From BATV+8a0f1d4024691c30ef87+4552+infradead.org+hch@bombadil.srs.infradead.org Tue Feb 9 07:39:48 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=ham version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay1.corp.sgi.com [137.38.102.111]) by oss.sgi.com (Postfix) with ESMTP id 0203329DF5 for ; Tue, 9 Feb 2016 07:39:48 -0600 (CST) Received: from cuda.sgi.com (cuda1.sgi.com [192.48.157.11]) by relay1.corp.sgi.com (Postfix) with ESMTP id CA8C58F8049 for ; Tue, 9 Feb 2016 05:39:44 -0800 (PST) X-ASG-Debug-ID: 1455025182-04bdf066ed25c10001-NocioJ Received: from bombadil.infradead.org ([198.137.202.9]) by cuda.sgi.com with ESMTP id Ob67UF7bhRSU1kv7 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128 verify=NO) for ; Tue, 09 Feb 2016 05:39:42 -0800 (PST) X-Barracuda-Envelope-From: BATV+8a0f1d4024691c30ef87+4552+infradead.org+hch@bombadil.srs.infradead.org X-Barracuda-Apparent-Source-IP: 198.137.202.9 Received: from hch by bombadil.infradead.org with local (Exim 4.80.1 #2 (Red Hat Linux)) id 1aT8W5-0006MP-PL; Tue, 09 Feb 2016 13:39:41 +0000 Date: Tue, 9 Feb 2016 05:39:41 -0800 From: Christoph Hellwig To: Dave Chinner Cc: xfs@oss.sgi.com Subject: Re: [PATCH 2/5] xfs: Introduce writeback context for writepages Message-ID: <20160209133941.GA13357@infradead.org> X-ASG-Orig-Subj: Re: [PATCH 2/5] xfs: Introduce writeback context for writepages References: <1454910258-7578-1-git-send-email-david@fromorbit.com> <1454910258-7578-3-git-send-email-david@fromorbit.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1454910258-7578-3-git-send-email-david@fromorbit.com> User-Agent: Mutt/1.5.24 (2015-08-30) X-SRS-Rewrite: SMTP reverse-path rewritten from by bombadil.infradead.org See http://www.infradead.org/rpr.html X-Barracuda-Connect: UNKNOWN[198.137.202.9] X-Barracuda-Start-Time: 1455025182 X-Barracuda-Encrypted: ECDHE-RSA-AES128-GCM-SHA256 X-Barracuda-URL: https://192.48.157.11:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-BRTS-Status: 1 X-Barracuda-Spam-Score: 0.10 X-Barracuda-Spam-Status: No, SCORE=0.10 using per-user scores of TAG_LEVEL=1000.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.7 tests=BSF_SC0_MISMATCH_TO, RDNS_NONE X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.3.26887 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 0.00 BSF_SC0_MISMATCH_TO Envelope rcpt doesn't match header 0.10 RDNS_NONE Delivered to trusted network by a host with no rDNS This looks good in general and now passes testing for me. A couple comments below: > > /* > - * Cancel submission of all buffer_heads so far in this endio. > - * Toss the endio too. Only ever called for the initial page > - * in a writepage request, so only ever one page. > - */ > -STATIC void > -xfs_cancel_ioend( > - xfs_ioend_t *ioend) > -{ > - xfs_ioend_t *next; > - struct buffer_head *bh, *next_bh; > - > - do { > - next = ioend->io_list; > - bh = ioend->io_buffer_head; > - do { > - next_bh = bh->b_private; > - clear_buffer_async_write(bh); > - /* > - * The unwritten flag is cleared when added to the > - * ioend. We're not submitting for I/O so mark the > - * buffer unwritten again for next time around. > - */ > - if (ioend->io_type == XFS_IO_UNWRITTEN) > - set_buffer_unwritten(bh); > - unlock_buffer(bh); > - } while ((bh = next_bh) != NULL); > - > - mempool_free(ioend, xfs_ioend_pool); > - } while ((ioend = next) != NULL); > -} Removing xfs_cancel_ioend and replacing it with the start and cancel writeback scheme that we currently only use for xfs_setfilesize_trans_alloc failures actually seems to be the biggest change in this patch and is entirely undocumented. Any chance you could split this into a prep patch and properly document it? > - > - if (!ioend || need_ioend || type != ioend->io_type) { > - xfs_ioend_t *previous = *result; > - > - ioend = xfs_alloc_ioend(inode, type); > - ioend->io_offset = offset; > - ioend->io_buffer_head = bh; > - ioend->io_buffer_tail = bh; > - if (previous) > - previous->io_list = ioend; > - *result = ioend; > + if (!wpc->ioend || wpc->io_type != wpc->ioend->io_type || > + bh->b_blocknr != wpc->last_block + 1) { We now start a new ioend if the blocks aren't contiguous, which seems reasonable. But this also means the similar check in xfs_submit_ioend should be removed at the same time. From BATV+8a0f1d4024691c30ef87+4552+infradead.org+hch@bombadil.srs.infradead.org Tue Feb 9 07:40:12 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=ham version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay3.corp.sgi.com [198.149.34.15]) by oss.sgi.com (Postfix) with ESMTP id 832DC29DF5 for ; Tue, 9 Feb 2016 07:40:12 -0600 (CST) Received: from cuda.sgi.com (cuda1.sgi.com [192.48.157.11]) by relay3.corp.sgi.com (Postfix) with ESMTP id 22A9DAC004 for ; Tue, 9 Feb 2016 05:40:09 -0800 (PST) X-ASG-Debug-ID: 1455025206-04bdf066ed25c30001-NocioJ Received: from bombadil.infradead.org ([198.137.202.9]) by cuda.sgi.com with ESMTP id SkPuS4JqYodAxXLA (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128 verify=NO) for ; Tue, 09 Feb 2016 05:40:06 -0800 (PST) X-Barracuda-Envelope-From: BATV+8a0f1d4024691c30ef87+4552+infradead.org+hch@bombadil.srs.infradead.org X-Barracuda-Apparent-Source-IP: 198.137.202.9 Received: from hch by bombadil.infradead.org with local (Exim 4.80.1 #2 (Red Hat Linux)) id 1aT8WU-0006sk-K7; Tue, 09 Feb 2016 13:40:06 +0000 Date: Tue, 9 Feb 2016 05:40:06 -0800 From: Christoph Hellwig To: Dave Chinner Cc: xfs@oss.sgi.com Subject: Re: [PATCH 3/5] xfs: xfs_cluster_write is redundant Message-ID: <20160209134006.GB13357@infradead.org> X-ASG-Orig-Subj: Re: [PATCH 3/5] xfs: xfs_cluster_write is redundant References: <1454910258-7578-1-git-send-email-david@fromorbit.com> <1454910258-7578-4-git-send-email-david@fromorbit.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1454910258-7578-4-git-send-email-david@fromorbit.com> User-Agent: Mutt/1.5.24 (2015-08-30) X-SRS-Rewrite: SMTP reverse-path rewritten from by bombadil.infradead.org See http://www.infradead.org/rpr.html X-Barracuda-Connect: UNKNOWN[198.137.202.9] X-Barracuda-Start-Time: 1455025206 X-Barracuda-Encrypted: ECDHE-RSA-AES128-GCM-SHA256 X-Barracuda-URL: https://192.48.157.11:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-Spam-Score: 0.10 X-Barracuda-Spam-Status: No, SCORE=0.10 using per-user scores of TAG_LEVEL=1000.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.7 tests=BSF_SC0_MISMATCH_TO, RDNS_NONE X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.3.26887 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 0.00 BSF_SC0_MISMATCH_TO Envelope rcpt doesn't match header 0.10 RDNS_NONE Delivered to trusted network by a host with no rDNS Looks fine, Reviewed-by: Christoph Hellwig From BATV+8a0f1d4024691c30ef87+4552+infradead.org+hch@bombadil.srs.infradead.org Tue Feb 9 07:40:49 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=ham version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay1.corp.sgi.com [137.38.102.111]) by oss.sgi.com (Postfix) with ESMTP id C75A929DF5 for ; Tue, 9 Feb 2016 07:40:49 -0600 (CST) Received: from cuda.sgi.com (cuda2.sgi.com [192.48.176.25]) by relay1.corp.sgi.com (Postfix) with ESMTP id AA1AD8F8035 for ; Tue, 9 Feb 2016 05:40:49 -0800 (PST) X-ASG-Debug-ID: 1455025247-04cbb043343bd70001-NocioJ Received: from bombadil.infradead.org ([198.137.202.9]) by cuda.sgi.com with ESMTP id 9YU6XNEBqt4HsjBG (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128 verify=NO) for ; Tue, 09 Feb 2016 05:40:48 -0800 (PST) X-Barracuda-Envelope-From: BATV+8a0f1d4024691c30ef87+4552+infradead.org+hch@bombadil.srs.infradead.org X-Barracuda-Apparent-Source-IP: 198.137.202.9 Received: from hch by bombadil.infradead.org with local (Exim 4.80.1 #2 (Red Hat Linux)) id 1aT8X9-00088y-Dc; Tue, 09 Feb 2016 13:40:47 +0000 Date: Tue, 9 Feb 2016 05:40:47 -0800 From: Christoph Hellwig To: Dave Chinner Cc: xfs@oss.sgi.com Subject: Re: [PATCH 4/5] xfs: factor mapping out of xfs_do_writepage Message-ID: <20160209134047.GC13357@infradead.org> X-ASG-Orig-Subj: Re: [PATCH 4/5] xfs: factor mapping out of xfs_do_writepage References: <1454910258-7578-1-git-send-email-david@fromorbit.com> <1454910258-7578-5-git-send-email-david@fromorbit.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1454910258-7578-5-git-send-email-david@fromorbit.com> User-Agent: Mutt/1.5.24 (2015-08-30) X-SRS-Rewrite: SMTP reverse-path rewritten from by bombadil.infradead.org See http://www.infradead.org/rpr.html X-Barracuda-Connect: UNKNOWN[198.137.202.9] X-Barracuda-Start-Time: 1455025248 X-Barracuda-Encrypted: ECDHE-RSA-AES128-GCM-SHA256 X-Barracuda-URL: https://192.48.176.25:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-Spam-Score: 0.10 X-Barracuda-Spam-Status: No, SCORE=0.10 using per-user scores of TAG_LEVEL=1000.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.7 tests=BSF_SC0_MISMATCH_TO, RDNS_NONE X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.3.26887 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 0.00 BSF_SC0_MISMATCH_TO Envelope rcpt doesn't match header 0.10 RDNS_NONE Delivered to trusted network by a host with no rDNS Looks fine, Reviewed-by: Christoph Hellwig From BATV+8a0f1d4024691c30ef87+4552+infradead.org+hch@bombadil.srs.infradead.org Tue Feb 9 07:49:34 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=ham version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay3.corp.sgi.com [198.149.34.15]) by oss.sgi.com (Postfix) with ESMTP id 4B9B829DF5 for ; Tue, 9 Feb 2016 07:49:34 -0600 (CST) Received: from cuda.sgi.com (cuda2.sgi.com [192.48.176.25]) by relay3.corp.sgi.com (Postfix) with ESMTP id BE007AC006 for ; Tue, 9 Feb 2016 05:49:33 -0800 (PST) X-ASG-Debug-ID: 1455025770-04cbb043333c060001-NocioJ Received: from bombadil.infradead.org ([198.137.202.9]) by cuda.sgi.com with ESMTP id JBJRXIH3VwaMDQKf (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128 verify=NO) for ; Tue, 09 Feb 2016 05:49:31 -0800 (PST) X-Barracuda-Envelope-From: BATV+8a0f1d4024691c30ef87+4552+infradead.org+hch@bombadil.srs.infradead.org X-Barracuda-Apparent-Source-IP: 198.137.202.9 Received: from hch by bombadil.infradead.org with local (Exim 4.80.1 #2 (Red Hat Linux)) id 1aT8fa-0002c6-IR; Tue, 09 Feb 2016 13:49:30 +0000 Date: Tue, 9 Feb 2016 05:49:30 -0800 From: Christoph Hellwig To: Dave Chinner Cc: xfs@oss.sgi.com Subject: Re: [PATCH 5/5] xfs: don't chain ioends during writepage submission Message-ID: <20160209134930.GD13357@infradead.org> X-ASG-Orig-Subj: Re: [PATCH 5/5] xfs: don't chain ioends during writepage submission References: <1454910258-7578-1-git-send-email-david@fromorbit.com> <1454910258-7578-6-git-send-email-david@fromorbit.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1454910258-7578-6-git-send-email-david@fromorbit.com> User-Agent: Mutt/1.5.24 (2015-08-30) X-SRS-Rewrite: SMTP reverse-path rewritten from by bombadil.infradead.org See http://www.infradead.org/rpr.html X-Barracuda-Connect: UNKNOWN[198.137.202.9] X-Barracuda-Start-Time: 1455025771 X-Barracuda-Encrypted: ECDHE-RSA-AES128-GCM-SHA256 X-Barracuda-URL: https://192.48.176.25:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-BRTS-Status: 1 X-Barracuda-Spam-Score: 0.10 X-Barracuda-Spam-Status: No, SCORE=0.10 using per-user scores of TAG_LEVEL=1000.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.7 tests=BSF_SC0_MISMATCH_TO, RDNS_NONE X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.3.26887 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 0.00 BSF_SC0_MISMATCH_TO Envelope rcpt doesn't match header 0.10 RDNS_NONE Delivered to trusted network by a host with no rDNS > +STATIC struct xfs_ioend * > xfs_add_to_ioend( > struct inode *inode, > struct buffer_head *bh, > xfs_off_t offset, > struct xfs_writepage_ctx *wpc) > { > + struct xfs_ioend *ioend_to_submit = NULL; Maybe just struct xfs_ioend *prev = NULL; to be a little less verbose? > @@ -738,29 +726,22 @@ xfs_writepage_submit( > struct writeback_control *wbc, > int status) > { > - struct blk_plug plug; > - > - /* Reserve log space if we might write beyond the on-disk inode size. */ > - if (!status && wpc->ioend && wpc->ioend->io_type != XFS_IO_UNWRITTEN && > - xfs_ioend_is_append(wpc->ioend)) > - status = xfs_setfilesize_trans_alloc(wpc->ioend); > - > - if (wpc->iohead) { > - blk_start_plug(&plug); > - xfs_submit_ioend(wbc, wpc->iohead, status); > - blk_finish_plug(&plug); > - } > + if (wpc->ioend) > + xfs_submit_ioend(wbc, wpc->ioend, status); > return status; > } With this change xfs_writepage_submit is rather pointless, I'd rather open code it in the callers. > + ioend = xfs_add_to_ioend(inode, bh, offset, wpc); > + if (ioend) { > + ioend->io_list = NULL; > + if (!ioend_to_submit) > + ioend_to_submit = ioend; > + else > + ioend_tail->io_list = ioend; > + ioend_tail = ioend; > + } Just using a list_head for this is a lot easier to read and less error prone at the cost of a single additional pointer in the ioend. > + while (ioend_to_submit) { > + struct xfs_ioend *next = ioend_to_submit->io_list; > + > + ioend_to_submit->io_list = NULL; > + xfs_submit_ioend(wbc, ioend_to_submit, 0); > + ioend_to_submit = next; > + } > return 0; > > out_error: > @@ -853,9 +848,16 @@ out_error: > * ioend, then we can't touch it here and need to rely on IO submission > * to unlock it. > */ > - if (count) > + if (count) { > xfs_start_page_writeback(page, 0, count); > - else { > + while (ioend_to_submit) { > + struct xfs_ioend *next = ioend_to_submit->io_list; > + > + ioend_to_submit->io_list = NULL; > + xfs_submit_ioend(wbc, ioend_to_submit, 0); > + ioend_to_submit = next; > + } I think this code cold be consolidated: ASSERT(wpc->ioend || !count); out: if (count) { xfs_start_page_writeback(page, !error, count); while (ioend_to_submit) { struct xfs_ioend *next = ioend_to_submit->io_list; ioend_to_submit->io_list = NULL; xfs_submit_ioend(wbc, ioend_to_submit, 0); ioend_to_submit = next; } } else { xfs_aops_discard_page(page); ClearPageUptodate(page); unlock_page(page); } return error; From bfoster@redhat.com Tue Feb 9 08:22:32 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=ham version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay2.corp.sgi.com [137.38.102.29]) by oss.sgi.com (Postfix) with ESMTP id E827C29DF5 for ; Tue, 9 Feb 2016 08:22:32 -0600 (CST) Received: from cuda.sgi.com (cuda2.sgi.com [192.48.176.25]) by relay2.corp.sgi.com (Postfix) with ESMTP id C984C304043 for ; Tue, 9 Feb 2016 06:22:29 -0800 (PST) X-ASG-Debug-ID: 1455027747-04cbb043313caf0001-NocioJ Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by cuda.sgi.com with ESMTP id OlcKOAbqKwiNFF6A (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO) for ; Tue, 09 Feb 2016 06:22:28 -0800 (PST) X-Barracuda-Envelope-From: bfoster@redhat.com X-Barracuda-Apparent-Source-IP: 209.132.183.28 X-ASG-Whitelist: Client Received: from int-mx11.intmail.prod.int.phx2.redhat.com (int-mx11.intmail.prod.int.phx2.redhat.com [10.5.11.24]) by mx1.redhat.com (Postfix) with ESMTPS id 856E535416C; Tue, 9 Feb 2016 14:22:27 +0000 (UTC) Received: from bfoster.bfoster (dhcp-41-164.bos.redhat.com [10.18.41.164]) by int-mx11.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id u19EMRjM020698; Tue, 9 Feb 2016 09:22:27 -0500 Received: by bfoster.bfoster (Postfix, from userid 1000) id 39CF0123DF8; Tue, 9 Feb 2016 09:22:26 -0500 (EST) Date: Tue, 9 Feb 2016 09:22:26 -0500 From: Brian Foster To: Dave Chinner Cc: xfs@oss.sgi.com Subject: Re: [PATCH 2/5] xfs: Introduce writeback context for writepages Message-ID: <20160209142224.GA25829@bfoster.bfoster> X-ASG-Orig-Subj: Re: [PATCH 2/5] xfs: Introduce writeback context for writepages References: <1454910258-7578-1-git-send-email-david@fromorbit.com> <1454910258-7578-3-git-send-email-david@fromorbit.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1454910258-7578-3-git-send-email-david@fromorbit.com> User-Agent: Mutt/1.5.24 (2015-08-30) X-Scanned-By: MIMEDefang 2.68 on 10.5.11.24 X-Barracuda-Connect: mx1.redhat.com[209.132.183.28] X-Barracuda-Start-Time: 1455027748 X-Barracuda-Encrypted: ECDHE-RSA-AES256-GCM-SHA384 X-Barracuda-URL: https://192.48.176.25:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-BRTS-Status: 1 On Mon, Feb 08, 2016 at 04:44:15PM +1100, Dave Chinner wrote: > From: Dave Chinner > > xfs_vm_writepages() calls generic_writepages to writeback a range of > a file, but then xfs_vm_writepage() clusters pages itself as it does > not have any context it can pass between->writepage calls from > __write_cache_pages(). > > Introduce a writeback context for xfs_vm_writepages() and call > __write_cache_pages directly with our own writepage callback so that > we can pass that context to each writepage invocation. This > encapsulates the current mapping, whether it is valid or not, the > current ioend and it's IO type and the ioend chain being built. > > This requires us to move the ioend submission up to the level where > the writepage context is declared. This does mean we do not submit > IO until we packaged the entire writeback range, but with the block > plugging in the writepages call this is the way IO is submitted, > anyway. > > It also means that we need to handle discontiguous page ranges. If > the pages sent down by write_cache_pages to the writepage callback > are discontiguous, we need to detect this and put each discontiguous > page range into individual ioends. This is needed to ensure that the > ioend accurately represents the range of the file that it covers so > that file size updates during IO completion set the size correctly. > Failure to take into account the discontiguous ranges results in > files being too small when writeback patterns are non-sequential. > > Signed-off-by: Dave Chinner > --- > fs/xfs/xfs_aops.c | 277 ++++++++++++++++++++++++++++-------------------------- > 1 file changed, 146 insertions(+), 131 deletions(-) > > diff --git a/fs/xfs/xfs_aops.c b/fs/xfs/xfs_aops.c > index 00452cb..4453d1d 100644 > --- a/fs/xfs/xfs_aops.c > +++ b/fs/xfs/xfs_aops.c ... > @@ -1163,29 +1147,36 @@ xfs_vm_writepage( > if (end_index > last_index) > end_index = last_index; > > - xfs_cluster_write(inode, page->index + 1, &imap, &ioend, > - wbc, end_index); > + xfs_cluster_write(inode, page->index + 1, wpc, wbc, end_index); > } > > - > - /* > - * Reserve log space if we might write beyond the on-disk inode size. > - */ > - err = 0; > - if (ioend->io_type != XFS_IO_UNWRITTEN && xfs_ioend_is_append(ioend)) > - err = xfs_setfilesize_trans_alloc(ioend); > - > - xfs_submit_ioend(wbc, iohead, err); > - > return 0; > > error: > - if (iohead) > - xfs_cancel_ioend(iohead); > + /* > + * We have to fail the iohead here because we buffers locked in the > + * ioend chain. If we don't do this, we'll deadlock invalidating the > + * page as that tries to lock the buffers on the page. Also, because we > + * have set pages under writeback, we have to run IO completion to mark > + * the error state of the IO appropriately, so we can't cancel the ioend > + * directly here. That means we have to mark this page as under > + * writeback if we included any buffers from it in the ioend chain. > + */ > + if (count) > + xfs_start_page_writeback(page, 0, count); > + xfs_writepage_submit(wpc, wbc, err); We make the xfs_writepage_submit() error case call here because... > > - xfs_aops_discard_page(page); > - ClearPageUptodate(page); > - unlock_page(page); > + /* > + * We can only discard the page we had the IO error on if we haven't > + * included it in the ioend above. If it has already been errored out, > + * the it is unlocked and we can't touch it here. > + */ > + if (!count) { > + xfs_aops_discard_page(page); > + ClearPageUptodate(page); > + unlock_page(page); > + } > + mapping_set_error(page->mapping, err); > return err; > > redirty: > @@ -1195,12 +1186,36 @@ redirty: > } > > STATIC int > +xfs_vm_writepage( > + struct page *page, > + struct writeback_control *wbc) > +{ > + struct xfs_writepage_ctx wpc = { > + .io_type = XFS_IO_OVERWRITE, > + }; > + int ret; > + > + ret = xfs_do_writepage(page, wbc, &wpc); > + if (ret) > + return ret; > + return xfs_writepage_submit(&wpc, wbc, ret); ... the callers only call it when ret == 0. Can we eliminate the error call down in xfs_do_writepage() and just invoke this consistently from the writepage(s) callers? Brian > +} > + > +STATIC int > xfs_vm_writepages( > struct address_space *mapping, > struct writeback_control *wbc) > { > + struct xfs_writepage_ctx wpc = { > + .io_type = XFS_IO_OVERWRITE, > + }; > + int ret; > + > xfs_iflags_clear(XFS_I(mapping->host), XFS_ITRUNCATED); > - return generic_writepages(mapping, wbc); > + ret = write_cache_pages(mapping, wbc, xfs_do_writepage, &wpc); > + if (ret) > + return ret; > + return xfs_writepage_submit(&wpc, wbc, ret); > } > > /* > -- > 2.5.0 > > _______________________________________________ > xfs mailing list > xfs@oss.sgi.com > http://oss.sgi.com/mailman/listinfo/xfs From bfoster@redhat.com Tue Feb 9 08:23:58 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=ham version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay2.corp.sgi.com [137.38.102.29]) by oss.sgi.com (Postfix) with ESMTP id E436529DF5 for ; Tue, 9 Feb 2016 08:23:58 -0600 (CST) Received: from cuda.sgi.com (cuda2.sgi.com [192.48.176.25]) by relay2.corp.sgi.com (Postfix) with ESMTP id D347E304048 for ; Tue, 9 Feb 2016 06:23:58 -0800 (PST) X-ASG-Debug-ID: 1455027836-04cbb043313cb60001-NocioJ Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by cuda.sgi.com with ESMTP id FYHC2Dz6lH6n8QGu (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO) for ; Tue, 09 Feb 2016 06:23:57 -0800 (PST) X-Barracuda-Envelope-From: bfoster@redhat.com X-Barracuda-Apparent-Source-IP: 209.132.183.28 X-ASG-Whitelist: Client Received: from int-mx13.intmail.prod.int.phx2.redhat.com (int-mx13.intmail.prod.int.phx2.redhat.com [10.5.11.26]) by mx1.redhat.com (Postfix) with ESMTPS id D4629C0C234B; Tue, 9 Feb 2016 14:23:56 +0000 (UTC) Received: from bfoster.bfoster (dhcp-41-164.bos.redhat.com [10.18.41.164]) by int-mx13.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id u19ENub5007413; Tue, 9 Feb 2016 09:23:56 -0500 Received: by bfoster.bfoster (Postfix, from userid 1000) id 8EE01123DF8; Tue, 9 Feb 2016 09:23:55 -0500 (EST) Date: Tue, 9 Feb 2016 09:23:55 -0500 From: Brian Foster To: Dave Chinner Cc: xfs@oss.sgi.com Subject: Re: [PATCH 5/5] xfs: don't chain ioends during writepage submission Message-ID: <20160209142355.GB25829@bfoster.bfoster> X-ASG-Orig-Subj: Re: [PATCH 5/5] xfs: don't chain ioends during writepage submission References: <1454910258-7578-1-git-send-email-david@fromorbit.com> <1454910258-7578-6-git-send-email-david@fromorbit.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1454910258-7578-6-git-send-email-david@fromorbit.com> User-Agent: Mutt/1.5.24 (2015-08-30) X-Scanned-By: MIMEDefang 2.68 on 10.5.11.26 X-Barracuda-Connect: mx1.redhat.com[209.132.183.28] X-Barracuda-Start-Time: 1455027837 X-Barracuda-Encrypted: ECDHE-RSA-AES256-GCM-SHA384 X-Barracuda-URL: https://192.48.176.25:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-BRTS-Status: 1 On Mon, Feb 08, 2016 at 04:44:18PM +1100, Dave Chinner wrote: > From: Dave Chinner > > Currently we can build a long ioend chain during ->writepages that > gets attached to the writepage context. IO submission only then > occurs when we finish all the writepage processing. This means we > can have many ioends allocated and pending, and this violates the > mempool guarantees that we need to give about forwards progress. > i.e. we really should only have one ioend being built at a time, > otherwise we may drain the mempool trying to allocate a new ioend > and that blocks submission, completion and freeing of ioends that > are already in progress. > > To prevent this situation from happening, we need to submit ioends > for IO as soon as they are ready for dispatch rather than queuing > them for later submission. This means the ioends have bios built > immediately and they get queued on any plug that is current active. > Hence if we schedule away from writeback, the ioends that have been > built will make forwards progress due to the plug flushing on > context switch. This will also prevent context switches from > creating unnecessary IO submission latency. > > We can't completely avoid having nested IO allocation - when we have > a block size smaller than a page size, we still need to hold the > ioend submission until after we have marked the current page dirty. > Hence we may need multiple ioends to be held while the current page > is completely mapped and made ready for IO dispatch. We cannot avoid > this problem - the current code already has this ioend chaining > within a page so we can mostly ignore that it occurs. > > Signed-off-by: Dave Chinner > --- > fs/xfs/xfs_aops.c | 94 ++++++++++++++++++++++++++++--------------------------- > 1 file changed, 48 insertions(+), 46 deletions(-) > > diff --git a/fs/xfs/xfs_aops.c b/fs/xfs/xfs_aops.c > index e5b8214..852ecf2 100644 > --- a/fs/xfs/xfs_aops.c > +++ b/fs/xfs/xfs_aops.c ... > @@ -738,29 +726,22 @@ xfs_writepage_submit( > struct writeback_control *wbc, > int status) > { > - struct blk_plug plug; > - > - /* Reserve log space if we might write beyond the on-disk inode size. */ > - if (!status && wpc->ioend && wpc->ioend->io_type != XFS_IO_UNWRITTEN && > - xfs_ioend_is_append(wpc->ioend)) > - status = xfs_setfilesize_trans_alloc(wpc->ioend); > - > - if (wpc->iohead) { > - blk_start_plug(&plug); > - xfs_submit_ioend(wbc, wpc->iohead, status); > - blk_finish_plug(&plug); > - } We've dropped our plug here but I don't see anything added in xfs_vm_writepages(). Shouldn't we have one there now that ioends are submitted as we go? generic_writepages() uses one around its write_cache_pages() call.. > + if (wpc->ioend) > + xfs_submit_ioend(wbc, wpc->ioend, status); > return status; > } > > static int > xfs_writepage_map( > struct xfs_writepage_ctx *wpc, > + struct writeback_control *wbc, > struct inode *inode, > struct page *page, > loff_t offset, > __uint64_t end_offset) > { > + struct xfs_ioend *ioend_to_submit = NULL; > + struct xfs_ioend *ioend_tail = NULL; > struct buffer_head *bh, *head; > ssize_t len = 1 << inode->i_blkbits; > int error = 0; > @@ -827,23 +808,37 @@ xfs_writepage_map( > offset); > } > if (wpc->imap_valid) { > + struct xfs_ioend *ioend; > + > lock_buffer(bh); > if (wpc->io_type != XFS_IO_OVERWRITE) > xfs_map_at_offset(inode, bh, &wpc->imap, offset); > - xfs_add_to_ioend(inode, bh, offset, wpc); "Big picture" comment here please, i.e. something along the lines of (feel free to rewrite/fix/enhance): "This implements an immediate ioend submission policy. If a new ioend is required, the old ioend is returned and slated for submission on function exit. The purpose of this policy is to avoid creating and holding large chains of ioend objects in memory. While ioends are submitted immediately after they are completed, block plugging helps provide batching." > + ioend = xfs_add_to_ioend(inode, bh, offset, wpc); > + if (ioend) { > + ioend->io_list = NULL; > + if (!ioend_to_submit) > + ioend_to_submit = ioend; > + else > + ioend_tail->io_list = ioend; > + ioend_tail = ioend; > + } > count++; > } > > - if (!wpc->iohead) > - wpc->iohead = wpc->ioend; > - > } while (offset += len, ((bh = bh->b_this_page) != head)); > > if (uptodate && bh == head) > SetPageUptodate(page); > > xfs_start_page_writeback(page, 1, count); > - ASSERT(wpc->iohead || !count); > + ASSERT(wpc->ioend || !count); > + while (ioend_to_submit) { > + struct xfs_ioend *next = ioend_to_submit->io_list; > + > + ioend_to_submit->io_list = NULL; > + xfs_submit_ioend(wbc, ioend_to_submit, 0); > + ioend_to_submit = next; > + } > return 0; > > out_error: > @@ -853,9 +848,16 @@ out_error: > * ioend, then we can't touch it here and need to rely on IO submission > * to unlock it. > */ > - if (count) > + if (count) { > xfs_start_page_writeback(page, 0, count); > - else { > + while (ioend_to_submit) { > + struct xfs_ioend *next = ioend_to_submit->io_list; > + > + ioend_to_submit->io_list = NULL; > + xfs_submit_ioend(wbc, ioend_to_submit, 0); > + ioend_to_submit = next; > + } > + } else { > xfs_aops_discard_page(page); > ClearPageUptodate(page); > unlock_page(page); If we have an error and count == 0, we know that ioend_to_submit is NULL because that is only potentially set once the first buffer is added. That said, this doesn't mean that we don't have an ioend waiting on the wpc. If we do, we still return the error and the ioend is errored out. I wonder if that is really necessary if we haven't added any buffers from the page..? Could we submit the ioend properly in that case? OTOH, that might complicate the error reporting and an error here might be serious enough that it isn't worth it, as opposed to just making sure we clean up everything appropriately. Brian > @@ -975,14 +977,14 @@ xfs_do_writepage( > end_offset = offset; > } > > - error = xfs_writepage_map(wpc, inode, page, offset, end_offset); > + error = xfs_writepage_map(wpc, wbc, inode, page, offset, end_offset); > if (error) > goto out_error; > return 0; > > out_error: > /* > - * We have to fail the iohead here because we buffers locked in the > + * We have to fail the ioend here because we buffers locked in the > * ioend chain. If we don't do this, we'll deadlock invalidating the > * page as that tries to lock the buffers on the page. Also, because we > * have set pages under writeback, we have to run IO completion to mark > -- > 2.5.0 > > _______________________________________________ > xfs mailing list > xfs@oss.sgi.com > http://oss.sgi.com/mailman/listinfo/xfs From jack@suse.cz Tue Feb 9 10:01:31 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=ham version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay1.corp.sgi.com [137.38.102.111]) by oss.sgi.com (Postfix) with ESMTP id B418B29DF5 for ; Tue, 9 Feb 2016 10:01:31 -0600 (CST) Received: from cuda.sgi.com (cuda1.sgi.com [192.48.157.11]) by relay1.corp.sgi.com (Postfix) with ESMTP id 79D298F804C for ; Tue, 9 Feb 2016 08:01:28 -0800 (PST) X-ASG-Debug-ID: 1455033681-04bdf066ed28f80001-NocioJ Received: from mx2.suse.de (mx2.suse.de [195.135.220.15]) by cuda.sgi.com with ESMTP id eg8HO4iDUsDLwfQz (version=TLSv1 cipher=ECDHE-RSA-AES256-SHA bits=256 verify=NO) for ; Tue, 09 Feb 2016 08:01:22 -0800 (PST) X-Barracuda-Envelope-From: jack@suse.cz X-Barracuda-Apparent-Source-IP: 195.135.220.15 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay1.suse.de (charybdis-ext.suse.de [195.135.220.254]) by mx2.suse.de (Postfix) with ESMTP id DCF59ABD3; Tue, 9 Feb 2016 16:01:19 +0000 (UTC) Received: by quack.suse.cz (Postfix, from userid 1000) id 0ADD6823D6; Tue, 9 Feb 2016 17:01:34 +0100 (CET) Date: Tue, 9 Feb 2016 17:01:34 +0100 From: Jan Kara To: Dan Williams Cc: Dave Chinner , Ross Zwisler , "linux-kernel@vger.kernel.org" , Theodore Ts'o , Alexander Viro , Andreas Dilger , Andrew Morton , Jan Kara , Matthew Wilcox , linux-ext4 , linux-fsdevel , Linux MM , "linux-nvdimm@lists.01.org" , XFS Developers , jmoyer Subject: Re: [PATCH 2/2] dax: move writeback calls into the filesystems Message-ID: <20160209160134.GA12245@quack.suse.cz> X-ASG-Orig-Subj: Re: [PATCH 2/2] dax: move writeback calls into the filesystems References: <1454829553-29499-1-git-send-email-ross.zwisler@linux.intel.com> <1454829553-29499-3-git-send-email-ross.zwisler@linux.intel.com> <20160207215047.GJ31407@dastard> <20160208201808.GK27429@dastard> <20160209094353.GF9451@quack.suse.cz> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="LQksG6bCIzRHxTLp" Content-Disposition: inline In-Reply-To: <20160209094353.GF9451@quack.suse.cz> User-Agent: Mutt/1.5.24 (2015-08-30) X-Barracuda-Connect: mx2.suse.de[195.135.220.15] X-Barracuda-Start-Time: 1455033682 X-Barracuda-Encrypted: ECDHE-RSA-AES256-SHA X-Barracuda-URL: https://192.48.157.11:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-BRTS-Status: 1 X-Barracuda-Spam-Score: 0.00 X-Barracuda-Spam-Status: No, SCORE=0.00 using per-user scores of TAG_LEVEL=1000.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.7 tests=BSF_SC0_MISMATCH_TO X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.3.26889 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 0.00 BSF_SC0_MISMATCH_TO Envelope rcpt doesn't match header --LQksG6bCIzRHxTLp Content-Type: text/plain; charset=us-ascii Content-Disposition: inline On Tue 09-02-16 10:43:53, Jan Kara wrote: > On Mon 08-02-16 12:55:24, Dan Williams wrote: > > On Mon, Feb 8, 2016 at 12:18 PM, Dave Chinner wrote: > > [..] > > >> Setting aside the current block zeroing problem you seem to assuming > > >> that DAX will always be faster and that may not be true at a media > > >> level. Waiting years for some applications to determine if DAX makes > > >> sense for their use case seems completely reasonable. In the meantime > > >> the apps that are already making these changes want to know that a DAX > > >> mapping request has not silently dropped backed to page cache. They > > >> also want to know if they successfully jumped through all the hoops to > > >> get a larger than pte mapping. > > >> > > >> I agree it is useful to be able to force DAX on an unmodified > > >> application to see what happens, and it follows that if those > > >> applications want to run in that mode they will need functional > > >> fsync()... > > >> > > >> I would feel better if we were talking about specific applications and > > >> performance numbers to know if forcing DAX on application is a debug > > >> facility or a production level capability. You seem to have already > > >> made that determination and I'm curious what I'm missing. > > > > > > I'm not setting any policy here at all. This whole argument is > > > based around the DAX mount option doing "global fs enable or > > > silently turning it off" and the application not knowing about that. > > > > > > The whole point of having a persistent per-inode DAX flags is that > > > it is a policy mechanism, not a policy. The application can, if it > > > is DAX aware, directly control whether DAX is used on a file or not. > > > The application can even query and clear that persistent inode flag > > > if it is configured not to (or cannot) use DAX. > > > > > > If the filesystem cannot support DAX, then we can error out attempts > > > to set the DAX flag and then the app knows DAX is not available. > > > i.e. the attempt to set policy failed. If the flag is set, then the > > > inode will *always* use DAX - there is no "fall back to page cache" > > > when DAX is enabled. > > > > > > If the applicaiton is not DAX aware, then the admin can control the > > > DAX policy by manipulating these flags themselves, and hence control > > > whether DAX is used by the application or not. > > > > > > If you think I'm dictating policy for DAX users and application, > > > then you haven't understood anything I've previously said about why > > > the DAX mount option needs to die before any of this is considered > > > production ready. DAX is not an opaque "all or nothing" option. XFS > > > will provide apps and admins with fine-grained, persistent, > > > discoverable policy flags to allow admins and applications to set > > > DAX policies however they see fit. This simply cannot be done if the > > > only knob you have is a mount option that may or may not stick. > > > > I agree the mount option needs to die, and I fully grok the reasoning. > > What I'm concerned with is that a system using fully-DAX-aware > > applications is forced to incur the overhead of maintaining *sync > > semantics, periodic sync(2) in particular, even if it is not relying > > on those semantics. > > Let me somewhat correct this: IMO hard requirement is maintaining sync(2) > semantics. Periodic writeback does not have any hard durability guarantees > and we are free to ignore such requests in ->writepages() (that function > has enough information in the writeback_control structure to differentiate > between periodic writeback and data integrity sync) if we decide it is > useful. Actually, we could do that even for 4.5. Attached is a version of Ross' patch that will work for sync(2) and fsync(2) and we won't flush caches during periodic writeback. The patch is only compile-tested. Ross? Honza -- Jan Kara SUSE Labs, CR --LQksG6bCIzRHxTLp Content-Type: text/x-patch; charset=us-ascii Content-Disposition: attachment; filename="0001-dax-move-writeback-calls-into-the-filesystems.patch" >From f7280a34d235031c5dbf3f5a345c4b64e452f097 Mon Sep 17 00:00:00 2001 From: Ross Zwisler Date: Sun, 7 Feb 2016 00:19:13 -0700 Subject: [PATCH] dax: move writeback calls into the filesystems Previously calls to dax_writeback_mapping_range() for all DAX filesystems (ext2, ext4 & xfs) were centralized in filemap_write_and_wait_range(). dax_writeback_mapping_range() needs a struct block_device, and it used to get that from inode->i_sb->s_bdev. This is correct for normal inodes mounted on ext2, ext4 and XFS filesystems, but is incorrect for DAX raw block devices and for XFS real-time files. Instead, call dax_writeback_mapping_range() directly from the filesystem ->writepages function so that it can supply us with a valid block device. This also fixes DAX code to properly flush caches in response to sync(2). Signed-off-by: Ross Zwisler Signed-off-by: Jan Kara --- fs/block_dev.c | 13 ++++++++++++- fs/dax.c | 12 +++++++----- fs/ext2/inode.c | 8 ++++++++ fs/ext4/fsync.c | 1 - fs/ext4/inode.c | 4 ++++ fs/xfs/xfs_aops.c | 5 +++++ include/linux/dax.h | 7 +++++-- mm/filemap.c | 12 ++++-------- 8 files changed, 45 insertions(+), 17 deletions(-) diff --git a/fs/block_dev.c b/fs/block_dev.c index 39b3a174a425..271d38aa6cbb 100644 --- a/fs/block_dev.c +++ b/fs/block_dev.c @@ -1693,13 +1693,24 @@ static int blkdev_releasepage(struct page *page, gfp_t wait) return try_to_free_buffers(page); } +static int blkdev_writepages(struct address_space *mapping, + struct writeback_control *wbc) +{ + if (dax_mapping(mapping)) { + struct block_device *bdev = I_BDEV(mapping->host); + + return dax_writeback_mapping_range(mapping, bdev, wbc); + } + return generic_writepages(mapping, wbc); +} + static const struct address_space_operations def_blk_aops = { .readpage = blkdev_readpage, .readpages = blkdev_readpages, .writepage = blkdev_writepage, .write_begin = blkdev_write_begin, .write_end = blkdev_write_end, - .writepages = generic_writepages, + .writepages = blkdev_writepages, .releasepage = blkdev_releasepage, .direct_IO = blkdev_direct_IO, .is_dirty_writeback = buffer_check_dirty_writeback, diff --git a/fs/dax.c b/fs/dax.c index fc2e3141138b..2f4965214783 100644 --- a/fs/dax.c +++ b/fs/dax.c @@ -485,11 +485,10 @@ static int dax_writeback_one(struct block_device *bdev, * end]. This is required by data integrity operations to ensure file data is * on persistent storage prior to completion of the operation. */ -int dax_writeback_mapping_range(struct address_space *mapping, loff_t start, - loff_t end) +int dax_writeback_mapping_range(struct address_space *mapping, + struct block_device *bdev, struct writeback_control *wbc) { struct inode *inode = mapping->host; - struct block_device *bdev = inode->i_sb->s_bdev; pgoff_t start_index, end_index, pmd_index; pgoff_t indices[PAGEVEC_SIZE]; struct pagevec pvec; @@ -500,8 +499,11 @@ int dax_writeback_mapping_range(struct address_space *mapping, loff_t start, if (WARN_ON_ONCE(inode->i_blkbits != PAGE_SHIFT)) return -EIO; - start_index = start >> PAGE_CACHE_SHIFT; - end_index = end >> PAGE_CACHE_SHIFT; + if (!mapping->nrexceptional || wbc->sync_mode != WB_SYNC_ALL) + return 0; + + start_index = wbc->range_start >> PAGE_CACHE_SHIFT; + end_index = wbc->range_end >> PAGE_CACHE_SHIFT; pmd_index = DAX_PMD_INDEX(start_index); rcu_read_lock(); diff --git a/fs/ext2/inode.c b/fs/ext2/inode.c index 338eefda70c6..ee05e945f40c 100644 --- a/fs/ext2/inode.c +++ b/fs/ext2/inode.c @@ -874,6 +874,14 @@ ext2_direct_IO(struct kiocb *iocb, struct iov_iter *iter, loff_t offset) static int ext2_writepages(struct address_space *mapping, struct writeback_control *wbc) { +#ifdef CONFIG_FS_DAX + if (dax_mapping(mapping)) { + return dax_writeback_mapping_range(mapping, + mapping->host->i_sb->s_bdev, + wbc); + } +#endif + return mpage_writepages(mapping, wbc, ext2_get_block); } diff --git a/fs/ext4/fsync.c b/fs/ext4/fsync.c index 8850254136ae..b7136227d0f8 100644 --- a/fs/ext4/fsync.c +++ b/fs/ext4/fsync.c @@ -83,7 +83,6 @@ static int ext4_sync_parent(struct inode *inode) * What we do is just kick off a commit and wait on it. This will snapshot the * inode to disk. */ - int ext4_sync_file(struct file *file, loff_t start, loff_t end, int datasync) { struct inode *inode = file->f_mapping->host; diff --git a/fs/ext4/inode.c b/fs/ext4/inode.c index 83bc8bfb3bea..19989c12187a 100644 --- a/fs/ext4/inode.c +++ b/fs/ext4/inode.c @@ -2450,6 +2450,10 @@ static int ext4_writepages(struct address_space *mapping, trace_ext4_writepages(inode, wbc); + if (dax_mapping(mapping)) + return dax_writeback_mapping_range(mapping, inode->i_sb->s_bdev, + wbc); + /* * No pages to write? This is mainly a kludge to avoid starting * a transaction for special inodes like journal inode on last iput() diff --git a/fs/xfs/xfs_aops.c b/fs/xfs/xfs_aops.c index 379c089fb051..fd0839278442 100644 --- a/fs/xfs/xfs_aops.c +++ b/fs/xfs/xfs_aops.c @@ -1208,6 +1208,11 @@ xfs_vm_writepages( struct writeback_control *wbc) { xfs_iflags_clear(XFS_I(mapping->host), XFS_ITRUNCATED); + if (dax_mapping(mapping)) { + return dax_writeback_mapping_range(mapping, + xfs_find_bdev_for_inode(mapping->host), wbc); + } + return generic_writepages(mapping, wbc); } diff --git a/include/linux/dax.h b/include/linux/dax.h index 818e45078929..05d7d043d3bd 100644 --- a/include/linux/dax.h +++ b/include/linux/dax.h @@ -52,6 +52,9 @@ static inline bool dax_mapping(struct address_space *mapping) { return mapping->host && IS_DAX(mapping->host); } -int dax_writeback_mapping_range(struct address_space *mapping, loff_t start, - loff_t end); + +struct writeback_control; + +int dax_writeback_mapping_range(struct address_space *mapping, + struct block_device *bdev, struct writeback_control *wbc); #endif diff --git a/mm/filemap.c b/mm/filemap.c index bc943867d68c..af3eec1a8c5e 100644 --- a/mm/filemap.c +++ b/mm/filemap.c @@ -446,7 +446,8 @@ int filemap_write_and_wait(struct address_space *mapping) { int err = 0; - if (mapping->nrpages) { + if ((!dax_mapping(mapping) && mapping->nrpages) || + (dax_mapping(mapping) && mapping->nrexceptional)) { err = filemap_fdatawrite(mapping); /* * Even if the above returned error, the pages may be @@ -482,13 +483,8 @@ int filemap_write_and_wait_range(struct address_space *mapping, { int err = 0; - if (dax_mapping(mapping) && mapping->nrexceptional) { - err = dax_writeback_mapping_range(mapping, lstart, lend); - if (err) - return err; - } - - if (mapping->nrpages) { + if ((!dax_mapping(mapping) && mapping->nrpages) || + (dax_mapping(mapping) && mapping->nrexceptional)) { err = __filemap_fdatawrite_range(mapping, lstart, lend, WB_SYNC_ALL); /* See comment of filemap_write_and_wait() */ -- 2.6.2 --LQksG6bCIzRHxTLp-- From hch@lst.de Tue Feb 9 10:31:35 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=ham version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay2.corp.sgi.com [137.38.102.29]) by oss.sgi.com (Postfix) with ESMTP id 04F2329DF5 for ; Tue, 9 Feb 2016 10:31:35 -0600 (CST) Received: from cuda.sgi.com (cuda2.sgi.com [192.48.176.25]) by relay2.corp.sgi.com (Postfix) with ESMTP id D51DB304043 for ; Tue, 9 Feb 2016 08:31:34 -0800 (PST) X-ASG-Debug-ID: 1455035491-04cbb043333fa80001-NocioJ Received: from newverein.lst.de (verein.lst.de [213.95.11.211]) by cuda.sgi.com with ESMTP id rsBbNVppxOB9whOf (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO) for ; Tue, 09 Feb 2016 08:31:32 -0800 (PST) X-Barracuda-Envelope-From: hch@lst.de X-Barracuda-Apparent-Source-IP: 213.95.11.211 Received: by newverein.lst.de (Postfix, from userid 2407) id E55C3691D6; Tue, 9 Feb 2016 17:31:30 +0100 (CET) Date: Tue, 9 Feb 2016 17:31:30 +0100 From: Christoph Hellwig To: "Darrick J. Wong" Cc: xfs@oss.sgi.com Subject: Re: reflink log reservations Message-ID: <20160209163130.GA29654@lst.de> X-ASG-Orig-Subj: Re: reflink log reservations References: <20160204074617.GB20496@lst.de> <20160204081620.GL20038@birch.djwong.org> <20160204133133.GA28701@lst.de> <20160204180551.GB27899@birch.djwong.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20160204180551.GB27899@birch.djwong.org> User-Agent: Mutt/1.5.17 (2007-11-01) X-Barracuda-Connect: verein.lst.de[213.95.11.211] X-Barracuda-Start-Time: 1455035492 X-Barracuda-Encrypted: ECDHE-RSA-AES256-GCM-SHA384 X-Barracuda-URL: https://192.48.176.25:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-BRTS-Status: 1 X-Barracuda-Spam-Score: 0.00 X-Barracuda-Spam-Status: No, SCORE=0.00 using per-user scores of TAG_LEVEL=1000.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.7 tests=BSF_SC0_MISMATCH_TO X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.3.26890 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 0.00 BSF_SC0_MISMATCH_TO Envelope rcpt doesn't match header I've still seen the assert a couple of times with the fix, and with yesterdays tree update they are back reproducibly (always in generic/168 over NFS). I suspect the problem is that xfs_refcountbt_alloc_block fully recurses into the allocator and thus could basically double the log reservation. From BATV+41243c0284956f46c838+4552+infradead.org+hch@casper.srs.infradead.org Tue Feb 9 10:32:26 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=ham version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay2.corp.sgi.com [137.38.102.29]) by oss.sgi.com (Postfix) with ESMTP id 7C38C29DF5 for ; Tue, 9 Feb 2016 10:32:26 -0600 (CST) Received: from cuda.sgi.com (cuda3.sgi.com [192.48.176.15]) by relay2.corp.sgi.com (Postfix) with ESMTP id 68D2E304048 for ; Tue, 9 Feb 2016 08:32:26 -0800 (PST) X-ASG-Debug-ID: 1455035543-04cb6c1e5629150001-NocioJ Received: from casper.infradead.org (casper.infradead.org [85.118.1.10]) by cuda.sgi.com with ESMTP id YH6PdouVyFvibrA1 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128 verify=NO) for ; Tue, 09 Feb 2016 08:32:24 -0800 (PST) X-Barracuda-Envelope-From: BATV+41243c0284956f46c838+4552+infradead.org+hch@casper.srs.infradead.org X-Barracuda-Apparent-Source-IP: 85.118.1.10 Received: from chello080109146114.tirol.surfer.at ([80.109.146.114] helo=localhost) by casper.infradead.org with esmtpsa (Exim 4.85 #2 (Red Hat Linux)) id 1aTBDC-0002Nf-If; Tue, 09 Feb 2016 16:32:22 +0000 From: Christoph Hellwig To: "Darrick J. Wong" Cc: xfs@oss.sgi.com Subject: a small fix for the reflink tree Date: Tue, 9 Feb 2016 17:32:18 +0100 X-ASG-Orig-Subj: a small fix for the reflink tree Message-Id: <1455035539-24535-1-git-send-email-hch@lst.de> X-Mailer: git-send-email 2.1.4 X-SRS-Rewrite: SMTP reverse-path rewritten from by casper.infradead.org X-Barracuda-Connect: casper.infradead.org[85.118.1.10] X-Barracuda-Start-Time: 1455035544 X-Barracuda-Encrypted: ECDHE-RSA-AES128-GCM-SHA256 X-Barracuda-URL: https://192.48.176.15:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-BRTS-Status: 1 X-Barracuda-Spam-Score: 0.00 X-Barracuda-Spam-Status: No, SCORE=0.00 using per-user scores of TAG_LEVEL=1000.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.7 tests=BSF_SC0_MISMATCH_TO X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.3.26890 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 0.00 BSF_SC0_MISMATCH_TO Envelope rcpt doesn't match header Otherwise xfstests is rather unhappy. From BATV+41243c0284956f46c838+4552+infradead.org+hch@casper.srs.infradead.org Tue Feb 9 10:32:30 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=ham version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay3.corp.sgi.com [198.149.34.15]) by oss.sgi.com (Postfix) with ESMTP id 3659729DFD for ; Tue, 9 Feb 2016 10:32:30 -0600 (CST) Received: from cuda.sgi.com (cuda1.sgi.com [192.48.157.11]) by relay3.corp.sgi.com (Postfix) with ESMTP id C6C44AC004 for ; Tue, 9 Feb 2016 08:32:26 -0800 (PST) X-ASG-Debug-ID: 1455035543-04bdf066ec29f70001-NocioJ Received: from casper.infradead.org (casper.infradead.org [85.118.1.10]) by cuda.sgi.com with ESMTP id ZyzoFDiWPewfCYo4 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128 verify=NO) for ; Tue, 09 Feb 2016 08:32:25 -0800 (PST) X-Barracuda-Envelope-From: BATV+41243c0284956f46c838+4552+infradead.org+hch@casper.srs.infradead.org X-Barracuda-Apparent-Source-IP: 85.118.1.10 Received: from chello080109146114.tirol.surfer.at ([80.109.146.114] helo=localhost) by casper.infradead.org with esmtpsa (Exim 4.85 #2 (Red Hat Linux)) id 1aTBDD-0002Nn-Gm; Tue, 09 Feb 2016 16:32:23 +0000 From: Christoph Hellwig To: "Darrick J. Wong" Cc: xfs@oss.sgi.com Subject: [PATCH] xfs: handle AGs without reservation in xfs_refcountbt_free_reserve_pool Date: Tue, 9 Feb 2016 17:32:19 +0100 X-ASG-Orig-Subj: [PATCH] xfs: handle AGs without reservation in xfs_refcountbt_free_reserve_pool Message-Id: <1455035539-24535-2-git-send-email-hch@lst.de> X-Mailer: git-send-email 2.1.4 In-Reply-To: <1455035539-24535-1-git-send-email-hch@lst.de> References: <1455035539-24535-1-git-send-email-hch@lst.de> X-SRS-Rewrite: SMTP reverse-path rewritten from by casper.infradead.org X-Barracuda-Connect: casper.infradead.org[85.118.1.10] X-Barracuda-Start-Time: 1455035544 X-Barracuda-Encrypted: ECDHE-RSA-AES128-GCM-SHA256 X-Barracuda-URL: https://192.48.157.11:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-BRTS-Status: 1 X-Barracuda-Spam-Score: 0.00 X-Barracuda-Spam-Status: No, SCORE=0.00 using per-user scores of TAG_LEVEL=1000.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.7 tests=BSF_SC0_MISMATCH_TO X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.3.26890 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 0.00 BSF_SC0_MISMATCH_TO Envelope rcpt doesn't match header Without this xfstests starts crashing and burning in generic/003. Signed-off-by: Christoph Hellwig --- fs/xfs/libxfs/xfs_refcount_btree.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/fs/xfs/libxfs/xfs_refcount_btree.c b/fs/xfs/libxfs/xfs_refcount_btree.c index 31e1b2d..f78041c 100644 --- a/fs/xfs/libxfs/xfs_refcount_btree.c +++ b/fs/xfs/libxfs/xfs_refcount_btree.c @@ -539,6 +539,10 @@ xfs_refcountbt_free_reserve_pool( pool_len = 0; for (agno = 0; agno < mp->m_sb.sb_agcount; agno++) { pag = xfs_perag_get(mp, agno); + if (!pag->pagf_refcountbt_resv) { + xfs_perag_put(pag); + continue; + } i = xfs_ag_resv_blocks(pag->pagf_refcountbt_resv); if (pool_len < i) pool_len = i; -- 2.1.4 From billodo@redhat.com Tue Feb 9 11:13:41 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=ham version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay1.corp.sgi.com [137.38.102.111]) by oss.sgi.com (Postfix) with ESMTP id 3AE1429DF5 for ; Tue, 9 Feb 2016 11:13:41 -0600 (CST) Received: from cuda.sgi.com (cuda1.sgi.com [192.48.157.11]) by relay1.corp.sgi.com (Postfix) with ESMTP id 103628F8050 for ; Tue, 9 Feb 2016 09:13:41 -0800 (PST) X-ASG-Debug-ID: 1455038019-04bdf066eb2b150001-NocioJ Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by cuda.sgi.com with ESMTP id 9FGLeclpffSaSK9D (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO) for ; Tue, 09 Feb 2016 09:13:39 -0800 (PST) X-Barracuda-Envelope-From: billodo@redhat.com X-Barracuda-Apparent-Source-IP: 209.132.183.28 X-ASG-Whitelist: Client Received: from int-mx11.intmail.prod.int.phx2.redhat.com (int-mx11.intmail.prod.int.phx2.redhat.com [10.5.11.24]) by mx1.redhat.com (Postfix) with ESMTPS id 3A6968F2E4 for ; Tue, 9 Feb 2016 17:13:39 +0000 (UTC) Received: from localhost.localdomain.com (unused [10.10.50.117] (may be forged)) by int-mx11.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id u19HDbgr004812 for ; Tue, 9 Feb 2016 12:13:38 -0500 From: "Bill O'Donnell" To: xfs@oss.sgi.com Subject: [PATCH 2/2] xfs_repair: new secondary superblock search method Date: Tue, 9 Feb 2016 11:13:08 -0600 X-ASG-Orig-Subj: [PATCH 2/2] xfs_repair: new secondary superblock search method Message-Id: <1455037988-7213-3-git-send-email-billodo@redhat.com> In-Reply-To: <1455037988-7213-1-git-send-email-billodo@redhat.com> References: <1455037988-7213-1-git-send-email-billodo@redhat.com> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.24 X-Barracuda-Connect: mx1.redhat.com[209.132.183.28] X-Barracuda-Start-Time: 1455038019 X-Barracuda-Encrypted: ECDHE-RSA-AES256-GCM-SHA384 X-Barracuda-URL: https://192.48.157.11:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-BRTS-Status: 1 Optimize secondary sb search, using similar method to find fs geometry as that of xfs_mkfs. If this faster method fails in finding a secondary sb, fall back to original brute force slower search. Signed-off-by: Bill O'Donnell --- Makefile | 2 +- include/libxcmd.h | 4 +++- libxcmd/topology.c | 28 +++++++++++++++++++++++++++- repair/Makefile | 4 ++-- repair/phase1.c | 25 +++++++++++++++++++++++-- repair/protos.h | 2 +- repair/sb.c | 27 +++++++++++++++++++++------ 7 files changed, 78 insertions(+), 14 deletions(-) diff --git a/Makefile b/Makefile index fca0a42..1d60d9c 100644 --- a/Makefile +++ b/Makefile @@ -80,7 +80,7 @@ fsr: libhandle growfs: libxcmd io: libxcmd libhandle quota: libxcmd -repair: libxlog +repair: libxlog libxcmd copy: libxlog ifeq ($(HAVE_BUILDDEFS), yes) diff --git a/include/libxcmd.h b/include/libxcmd.h index df7046e..b140adb 100644 --- a/include/libxcmd.h +++ b/include/libxcmd.h @@ -50,6 +50,8 @@ extern int check_overwrite( char *device); - +extern int guess_default_geometry(__uint64_t *agsize, + __uint64_t *agcount, + libxfs_init_t x); #endif /* __LIBXCMD_H__ */ diff --git a/libxcmd/topology.c b/libxcmd/topology.c index 0eeea28..4a8ab8b 100644 --- a/libxcmd/topology.c +++ b/libxcmd/topology.c @@ -302,7 +302,6 @@ static void blkid_get_topology( #endif /* ENABLE_BLKID */ - void get_topology( libxfs_init_t *xi, struct fs_topology *ft, @@ -346,3 +345,30 @@ void get_topology( &lsectorsize, &psectorsize, force_overwrite); } } + +/* + * Use this macro before we have superblock and mount structure + */ +#define DTOBT(d) ((xfs_rfsblock_t)((d) >> (blocklog - BBSHIFT))) + +int guess_default_geometry(__uint64_t *agsize, __uint64_t *agcount, libxfs_init_t x) { + struct fs_topology ft; + int blocklog; + __uint64_t dblocks; + int multidisk; + memset(&ft, 0, sizeof(ft)); + get_topology(&x, &ft, 1); + + /* + * get geometry from get_topology result. + * Use default block size (2^12) + */ + blocklog = 12; + multidisk = ft.dswidth | ft.dsunit; + printf("x.dsize = %lu\n",(long unsigned int)x.dsize); + dblocks = DTOBT(x.dsize); + calc_default_ag_geometry(blocklog, dblocks, multidisk, + agsize, agcount); + + return(blocklog); +} diff --git a/repair/Makefile b/repair/Makefile index 251722b..d24ab1f 100644 --- a/repair/Makefile +++ b/repair/Makefile @@ -20,8 +20,8 @@ CFILES = agheader.c attr_repair.c avl.c avl64.c bmap.c btree.c \ progress.c prefetch.c rt.c sb.c scan.c threads.c \ versions.c xfs_repair.c -LLDLIBS = $(LIBXFS) $(LIBXLOG) $(LIBUUID) $(LIBRT) $(LIBPTHREAD) -LTDEPENDENCIES = $(LIBXFS) $(LIBXLOG) +LLDLIBS = $(LIBBLKID) $(LIBXFS) $(LIBXLOG) $(LIBUUID) $(LIBRT) $(LIBPTHREAD) $(LIBXCMD) +LTDEPENDENCIES = $(LIBXFS) $(LIBXLOG) $(LIBXCMD) LLDFLAGS = -static-libtool-libs default: depend $(LTCOMMAND) diff --git a/repair/phase1.c b/repair/phase1.c index 126d0b3..c27033d 100644 --- a/repair/phase1.c +++ b/repair/phase1.c @@ -21,6 +21,7 @@ #include "agheader.h" #include "protos.h" #include "err_protos.h" +#include "libxcmd.h" static void no_sb(void) @@ -47,6 +48,9 @@ alloc_ag_buf(int size) */ #define MAX_SECTSIZE (512 * 1024) +extern libxfs_init_t x; + + /* ARGSUSED */ void phase1(xfs_mount_t *mp) @@ -54,6 +58,10 @@ phase1(xfs_mount_t *mp) xfs_sb_t *sb; char *ag_bp; int rval; + int blocklog; + __uint64_t agcount; + __uint64_t agsize; + __uint64_t skipsize; do_log(_("Phase 1 - find and verify superblock...\n")); @@ -65,6 +73,18 @@ phase1(xfs_mount_t *mp) lost_quotas = 0; /* + * divine the geometry ;) + */ + blocklog = guess_default_geometry(&agsize, &agcount, x); + + /* + * use found ag geometry to quickly find secondary sb + */ + skipsize = agsize << blocklog; + do_log("agsize = %d agcount = %d skipsize = %d\n", + (int)agsize, (int)agcount, (int)skipsize); + + /* * get AG 0 into ag header buf */ ag_bp = alloc_ag_buf(MAX_SECTSIZE); @@ -80,14 +100,15 @@ phase1(xfs_mount_t *mp) if (rval != XR_OK) { do_warn(_("bad primary superblock - %s !!!\n"), err_string(rval)); - if (!find_secondary_sb(sb)) + + if (!find_secondary_sb(sb, skipsize)) no_sb(); primary_sb_modified = 1; } else if ((rval = verify_set_primary_sb(sb, 0, &primary_sb_modified)) != XR_OK) { do_warn(_("couldn't verify primary superblock - %s !!!\n"), err_string(rval)); - if (!find_secondary_sb(sb)) + if (!find_secondary_sb(sb, skipsize)) no_sb(); primary_sb_modified = 1; } diff --git a/repair/protos.h b/repair/protos.h index 9d5a2a6..d96373e 100644 --- a/repair/protos.h +++ b/repair/protos.h @@ -31,7 +31,7 @@ int get_sb(xfs_sb_t *sbp, void write_primary_sb(xfs_sb_t *sbp, int size); -int find_secondary_sb(xfs_sb_t *sb); +int find_secondary_sb(xfs_sb_t *sb, __uint64_t skipsize); struct fs_geometry; void get_sb_geometry(struct fs_geometry *geo, diff --git a/repair/sb.c b/repair/sb.c index 4eef14a..4386479 100644 --- a/repair/sb.c +++ b/repair/sb.c @@ -87,8 +87,7 @@ copy_sb(xfs_sb_t *source, xfs_sb_t *dest) /* * find a secondary superblock, copy it into the sb buffer */ -int -find_secondary_sb(xfs_sb_t *rsb) +static int __find_secondary_sb(xfs_sb_t *rsb, __uint64_t skipsize ) { xfs_off_t off; xfs_sb_t *sb; @@ -101,7 +100,6 @@ find_secondary_sb(xfs_sb_t *rsb) int bsize; do_warn(_("\nattempting to find secondary superblock...\n")); - sb = (xfs_sb_t *)memalign(libxfs_device_alignment(), BSIZE); if (!sb) { do_error( @@ -117,7 +115,7 @@ find_secondary_sb(xfs_sb_t *rsb) /* * skip first sector since we know that's bad */ - for (done = 0, off = XFS_AG_MIN_BYTES; !done ; off += bsize) { + for (done = 0, off = skipsize; !done ; off += bsize) { /* * read disk 1 MByte at a time. */ @@ -130,7 +128,6 @@ find_secondary_sb(xfs_sb_t *rsb) } do_warn("."); - /* * check the buffer 512 bytes at a time since * we don't know how big the sectors really are. @@ -164,11 +161,29 @@ find_secondary_sb(xfs_sb_t *rsb) } } } - free(sb); return(retval); } +int +find_secondary_sb(xfs_sb_t *rsb, __uint64_t skipsize) +{ + int retval; + + /* + * Attempt to find secondary sb with a coarse approach, + * using a large skipsize (agsize in bytes). Failing that, + * fallback to the fine-grained approach using min agsize. + */ + retval = __find_secondary_sb(rsb, skipsize); + if (!retval) + /* + * fallback: use minimum agsize for skipsize + */ + retval = __find_secondary_sb(rsb, XFS_AG_MIN_BYTES); + return(retval); +} + /* * Calculate what the inode alignment field ought to be based on internal * superblock info and determine if it is valid. -- 2.5.0 From billodo@redhat.com Tue Feb 9 11:13:42 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=ham version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay1.corp.sgi.com [137.38.102.111]) by oss.sgi.com (Postfix) with ESMTP id C04B629DFD for ; Tue, 9 Feb 2016 11:13:42 -0600 (CST) Received: from cuda.sgi.com (cuda1.sgi.com [192.48.157.11]) by relay1.corp.sgi.com (Postfix) with ESMTP id A084C8F804C for ; Tue, 9 Feb 2016 09:13:39 -0800 (PST) X-ASG-Debug-ID: 1455038018-04bdf066ed2b150001-NocioJ Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by cuda.sgi.com with ESMTP id qeDOpNDYTLugrgak (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO) for ; Tue, 09 Feb 2016 09:13:38 -0800 (PST) X-Barracuda-Envelope-From: billodo@redhat.com X-Barracuda-Apparent-Source-IP: 209.132.183.28 X-ASG-Whitelist: Client Received: from int-mx11.intmail.prod.int.phx2.redhat.com (int-mx11.intmail.prod.int.phx2.redhat.com [10.5.11.24]) by mx1.redhat.com (Postfix) with ESMTPS id 422528F296 for ; Tue, 9 Feb 2016 17:13:38 +0000 (UTC) Received: from localhost.localdomain.com (unused [10.10.50.117] (may be forged)) by int-mx11.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id u19HDbgp004812 for ; Tue, 9 Feb 2016 12:13:37 -0500 From: "Bill O'Donnell" To: xfs@oss.sgi.com Subject: [PATCH 0/2] xfs_repair: improved secondary sb search Date: Tue, 9 Feb 2016 11:13:06 -0600 X-ASG-Orig-Subj: [PATCH 0/2] xfs_repair: improved secondary sb search Message-Id: <1455037988-7213-1-git-send-email-billodo@redhat.com> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.24 X-Barracuda-Connect: mx1.redhat.com[209.132.183.28] X-Barracuda-Start-Time: 1455038018 X-Barracuda-Encrypted: ECDHE-RSA-AES256-GCM-SHA384 X-Barracuda-URL: https://192.48.157.11:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-BRTS-Status: 1 Hello - Current xfs_repair uses a brute force approach to find a valid secondary sb. This series optimizes the secondary sb search, using similar method to determine geometry as that of xfs_mkfs. If the faster method fails in its search, fall back to original brute force slower search. patch 1 has some general infrastructure adjustments, moving general topology functions from mkfs to libxcmd. patch 2 adds the new secondary superblock search method. Questions, comments are welcome. Thanks- Bill From billodo@redhat.com Tue Feb 9 11:13:42 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=ham version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay1.corp.sgi.com [137.38.102.111]) by oss.sgi.com (Postfix) with ESMTP id 7AC9F29DFA for ; Tue, 9 Feb 2016 11:13:42 -0600 (CST) Received: from cuda.sgi.com (cuda2.sgi.com [192.48.176.25]) by relay1.corp.sgi.com (Postfix) with ESMTP id 675218F8050 for ; Tue, 9 Feb 2016 09:13:42 -0800 (PST) X-ASG-Debug-ID: 1455038018-04cbb04332408c0001-NocioJ Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by cuda.sgi.com with ESMTP id 9xQQcC2Cx77oqSHe (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO) for ; Tue, 09 Feb 2016 09:13:39 -0800 (PST) X-Barracuda-Envelope-From: billodo@redhat.com X-Barracuda-Apparent-Source-IP: 209.132.183.28 X-ASG-Whitelist: Client Received: from int-mx11.intmail.prod.int.phx2.redhat.com (int-mx11.intmail.prod.int.phx2.redhat.com [10.5.11.24]) by mx1.redhat.com (Postfix) with ESMTPS id C3D8B19CBD1 for ; Tue, 9 Feb 2016 17:13:38 +0000 (UTC) Received: from localhost.localdomain.com (unused [10.10.50.117] (may be forged)) by int-mx11.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id u19HDbgq004812 for ; Tue, 9 Feb 2016 12:13:38 -0500 From: "Bill O'Donnell" To: xfs@oss.sgi.com Subject: [PATCH 1/2] libxcmd: generalize topology functions Date: Tue, 9 Feb 2016 11:13:07 -0600 X-ASG-Orig-Subj: [PATCH 1/2] libxcmd: generalize topology functions Message-Id: <1455037988-7213-2-git-send-email-billodo@redhat.com> In-Reply-To: <1455037988-7213-1-git-send-email-billodo@redhat.com> References: <1455037988-7213-1-git-send-email-billodo@redhat.com> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.24 X-Barracuda-Connect: mx1.redhat.com[209.132.183.28] X-Barracuda-Start-Time: 1455038019 X-Barracuda-Encrypted: ECDHE-RSA-AES256-GCM-SHA384 X-Barracuda-URL: https://192.48.176.25:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-BRTS-Status: 1 Move general topology functions from xfs_mkfs to new topology collection in libxcmd. Signed-off-by: Bill O'Donnell --- include/Makefile | 1 + include/libxcmd.h | 55 +++++++++ libxcmd/Makefile | 2 +- libxcmd/topology.c | 348 +++++++++++++++++++++++++++++++++++++++++++++++++++++ mkfs/Makefile | 2 +- mkfs/xfs_mkfs.c | 321 +----------------------------------------------- 6 files changed, 407 insertions(+), 322 deletions(-) create mode 100644 include/libxcmd.h create mode 100644 libxcmd/topology.c diff --git a/include/Makefile b/include/Makefile index 6148756..2671f07 100644 --- a/include/Makefile +++ b/include/Makefile @@ -20,6 +20,7 @@ include $(TOPDIR)/include/builddefs LIBHFILES = libxfs.h \ libxlog.h \ + libxcmd.h \ atomic.h \ bitops.h \ cache.h \ diff --git a/include/libxcmd.h b/include/libxcmd.h new file mode 100644 index 0000000..df7046e --- /dev/null +++ b/include/libxcmd.h @@ -0,0 +1,55 @@ +/* + * Copyright (c) 2000-2005 Silicon Graphics, Inc. + * All Rights Reserved. + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License as + * published by the Free Software Foundation. + * + * This program is distributed in the hope that it would be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + */ + +#ifndef __LIBXCMD_H__ +#define __LIBXCMD_H__ + +#include "libxfs.h" +#include + +/* + * Device topology information. + */ +typedef struct fs_topology { + int dsunit; /* stripe unit - data subvolume */ + int dswidth; /* stripe width - data subvolume */ + int rtswidth; /* stripe width - rt subvolume */ + int lsectorsize; /* logical sector size &*/ + int psectorsize; /* physical sector size */ +} fs_topology_t; + +extern void get_topology( + libxfs_init_t *xi, + struct fs_topology *ft, + int force_overwrite); + +extern void +calc_default_ag_geometry( + int blocklog, + __uint64_t dblocks, + int multidisk, + __uint64_t *agsize, + __uint64_t *agcount); + +extern int +check_overwrite( + char *device); + + + +#endif /* __LIBXCMD_H__ */ diff --git a/libxcmd/Makefile b/libxcmd/Makefile index 7701ed9..aab8d6d 100644 --- a/libxcmd/Makefile +++ b/libxcmd/Makefile @@ -10,7 +10,7 @@ LT_CURRENT = 0 LT_REVISION = 0 LT_AGE = 0 -CFILES = command.c input.c paths.c projects.c help.c quit.c +CFILES = command.c input.c paths.c projects.c help.c quit.c topology.c ifeq ($(HAVE_GETMNTENT),yes) LCFLAGS += -DHAVE_GETMNTENT diff --git a/libxcmd/topology.c b/libxcmd/topology.c new file mode 100644 index 0000000..0eeea28 --- /dev/null +++ b/libxcmd/topology.c @@ -0,0 +1,348 @@ +/* + * Copyright (c) 2000-2001,2005 Silicon Graphics, Inc. + * All Rights Reserved. + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License as + * published by the Free Software Foundation. + * + * This program is distributed in the hope that it would be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + */ + +#include "libxfs.h" +#ifdef ENABLE_BLKID +# include +#endif /* ENABLE_BLKID */ +#include "../mkfs/xfs_mkfs.h" + +#define TERABYTES(count, blog) ((__uint64_t)(count) << (40 - (blog))) +#define GIGABYTES(count, blog) ((__uint64_t)(count) << (30 - (blog))) +#define MEGABYTES(count, blog) ((__uint64_t)(count) << (20 - (blog))) + +void +calc_default_ag_geometry( + int blocklog, + __uint64_t dblocks, + int multidisk, + __uint64_t *agsize, + __uint64_t *agcount) +{ + __uint64_t blocks = 0; + int shift = 0; + + /* + * First handle the high extreme - the point at which we will + * always use the maximum AG size. + * + * This applies regardless of storage configuration. + */ + if (dblocks >= TERABYTES(32, blocklog)) { + blocks = XFS_AG_MAX_BLOCKS(blocklog); + goto done; + } + + /* + * For the remainder we choose an AG size based on the + * number of data blocks available, trying to keep the + * number of AGs relatively small (especially compared + * to the original algorithm). AG count is calculated + * based on the preferred AG size, not vice-versa - the + * count can be increased by growfs, so prefer to use + * smaller counts at mkfs time. + * + * For a single underlying storage device between 128MB + * and 4TB in size, just use 4 AGs, otherwise scale up + * smoothly between min/max AG sizes. + */ + + if (!multidisk && dblocks >= MEGABYTES(128, blocklog)) { + if (dblocks >= TERABYTES(4, blocklog)) { + blocks = XFS_AG_MAX_BLOCKS(blocklog); + goto done; + } + shift = 2; + } else if (dblocks > GIGABYTES(512, blocklog)) + shift = 5; + else if (dblocks > GIGABYTES(8, blocklog)) + shift = 4; + else if (dblocks >= MEGABYTES(128, blocklog)) + shift = 3; + else if (dblocks >= MEGABYTES(64, blocklog)) + shift = 2; + else if (dblocks >= MEGABYTES(32, blocklog)) + shift = 1; + else + shift = 0; + /* + * If dblocks is not evenly divisible by the number of + * desired AGs, round "blocks" up so we don't lose the + * last bit of the filesystem. The same principle applies + * to the AG count, so we don't lose the last AG! + */ + blocks = dblocks >> shift; + if (dblocks & xfs_mask32lo(shift)) { + if (blocks < XFS_AG_MAX_BLOCKS(blocklog)) + blocks++; + } +done: + *agsize = blocks; + *agcount = dblocks / blocks + (dblocks % blocks != 0); +} + +/* + * Device topology information. + */ +struct fs_topology { + int dsunit; /* stripe unit - data subvolume */ + int dswidth; /* stripe width - data subvolume */ + int rtswidth; /* stripe width - rt subvolume */ + int lsectorsize; /* logical sector size &*/ + int psectorsize; /* physical sector size */ +}; + +/* + * Check for existing filesystem or partition table on device. + * Returns: + * 1 for existing fs or partition + * 0 for nothing found + * -1 for internal error + */ +#ifdef ENABLE_BLKID +int +check_overwrite( + char *device) +{ + const char *type; + blkid_probe pr = NULL; + int ret; + int fd; + long long size; + int bsz; + + if (!device || !*device) + return 0; + + ret = -1; /* will reset on success of all setup calls */ + + fd = open(device, O_RDONLY); + if (fd < 0) + goto out; + platform_findsizes(device, fd, &size, &bsz); + close(fd); + + /* nothing to overwrite on a 0-length device */ + if (size == 0) { + ret = 0; + goto out; + } + + pr = blkid_new_probe_from_filename(device); + if (!pr) + goto out; + + ret = blkid_probe_enable_partitions(pr, 1); + if (ret < 0) + goto out; + + ret = blkid_do_fullprobe(pr); + if (ret < 0) + goto out; + + /* + * Blkid returns 1 for nothing found and 0 when it finds a signature, + * but we want the exact opposite, so reverse the return value here. + * + * In addition print some useful diagnostics about what actually is + * on the device. + */ + if (ret) { + ret = 0; + goto out; + } + + if (!blkid_probe_lookup_value(pr, "TYPE", &type, NULL)) { + fprintf(stderr, + _("%s: %s appears to contain an existing " + "filesystem (%s).\n"), progname, device, type); + } else if (!blkid_probe_lookup_value(pr, "PTTYPE", &type, NULL)) { + fprintf(stderr, + _("%s: %s appears to contain a partition " + "table (%s).\n"), progname, device, type); + } else { + fprintf(stderr, + _("%s: %s appears to contain something weird " + "according to blkid\n"), progname, device); + } + ret = 1; + +out: + if (pr) + blkid_free_probe(pr); + if (ret == -1) + fprintf(stderr, + _("%s: probe of %s failed, cannot detect " + "existing filesystem.\n"), progname, device); + return ret; +} + +static void blkid_get_topology( + const char *device, + int *sunit, + int *swidth, + int *lsectorsize, + int *psectorsize, + int force_overwrite) +{ + + blkid_topology tp; + blkid_probe pr; + unsigned long val; + struct stat statbuf; + + /* can't get topology info from a file */ + if (!stat(device, &statbuf) && S_ISREG(statbuf.st_mode)) + return; + + pr = blkid_new_probe_from_filename(device); + if (!pr) + return; + + tp = blkid_probe_get_topology(pr); + if (!tp) + goto out_free_probe; + + val = blkid_topology_get_logical_sector_size(tp); + *lsectorsize = val; + val = blkid_topology_get_physical_sector_size(tp); + *psectorsize = val; + val = blkid_topology_get_minimum_io_size(tp); + *sunit = val; + val = blkid_topology_get_optimal_io_size(tp); + *swidth = val; + + /* + * If the reported values are the same as the physical sector size + * do not bother to report anything. It will only cause warnings + * if people specify larger stripe units or widths manually. + */ + if (*sunit == *psectorsize || *swidth == *psectorsize) { + *sunit = 0; + *swidth = 0; + } + + /* + * Blkid reports the information in terms of bytes, but we want it in + * terms of 512 bytes blocks (only to convert it to bytes later..) + */ + *sunit = *sunit >> 9; + *swidth = *swidth >> 9; + + if (blkid_topology_get_alignment_offset(tp) != 0) { + fprintf(stderr, + _("warning: device is not properly aligned %s\n"), + device); + + if (!force_overwrite) { + fprintf(stderr, + _("Use -f to force usage of a misaligned device\n")); + + exit(EXIT_FAILURE); + } + /* Do not use physical sector size if the device is misaligned */ + *psectorsize = *lsectorsize; + } + + blkid_free_probe(pr); + return; + +out_free_probe: + blkid_free_probe(pr); + fprintf(stderr, + _("warning: unable to probe device topology for device %s\n"), + device); +} +#else /* ifdef ENABLE_BLKID */ +/* + * Without blkid, we can't do a good check for signatures. + * So instead of some messy attempts, just disable any checks + * and always return 'nothing found'. + */ +# warning BLKID is disabled, so signature detection and block device\ + access are not working! + +int +check_overwrite( + char *device) +{ + return 1; +} + +static void blkid_get_topology( + const char *device, + int *sunit, + int *swidth, + int *lsectorsize, + int *psectorsize, + int force_overwrite) +{ + /* + * Shouldn't make any difference (no blkid = no block device access), + * but make sure this dummy replacement returns with at least some + * sanity. + */ + *lsectorsize = *psectorsize = 512; +} + +#endif /* ENABLE_BLKID */ + + +void get_topology( + libxfs_init_t *xi, + struct fs_topology *ft, + int force_overwrite) +{ + struct stat statbuf; + char *dfile = xi->volname ? xi->volname : xi->dname; + + /* + * If our target is a regular file, use platform_findsizes + * to try to obtain the underlying filesystem's requirements + * for direct IO; we'll set our sector size to that if possible. + */ + if (xi->disfile || + (!stat(dfile, &statbuf) && S_ISREG(statbuf.st_mode))) { + int fd; + int flags = O_RDONLY; + long long dummy; + + /* with xi->disfile we may not have the file yet! */ + if (xi->disfile) + flags |= O_CREAT; + + fd = open(dfile, flags, 0666); + if (fd >= 0) { + platform_findsizes(dfile, fd, &dummy, &ft->lsectorsize); + close(fd); + ft->psectorsize = ft->lsectorsize; + } else + ft->psectorsize = ft->lsectorsize = BBSIZE; + } else { + blkid_get_topology(dfile, &ft->dsunit, &ft->dswidth, + &ft->lsectorsize, &ft->psectorsize, + force_overwrite); + } + + if (xi->rtname && !xi->risfile) { + int sunit, lsectorsize, psectorsize; + + blkid_get_topology(xi->rtname, &sunit, &ft->rtswidth, + &lsectorsize, &psectorsize, force_overwrite); + } +} diff --git a/mkfs/Makefile b/mkfs/Makefile index 570ab07..2997398 100644 --- a/mkfs/Makefile +++ b/mkfs/Makefile @@ -10,7 +10,7 @@ LTCOMMAND = mkfs.xfs HFILES = xfs_mkfs.h CFILES = maxtrres.c proto.c xfs_mkfs.c -LLDLIBS += $(LIBBLKID) $(LIBXFS) $(LIBUUID) $(LIBRT) $(LIBPTHREAD) +LLDLIBS += $(LIBBLKID) $(LIBXFS) $(LIBUUID) $(LIBRT) $(LIBPTHREAD) $(LIBXCMD) LTDEPENDENCIES += $(LIBXFS) LLDFLAGS = -static-libtool-libs diff --git a/mkfs/xfs_mkfs.c b/mkfs/xfs_mkfs.c index 700d12c..2ca7e5c 100644 --- a/mkfs/xfs_mkfs.c +++ b/mkfs/xfs_mkfs.c @@ -22,17 +22,7 @@ # include #endif /* ENABLE_BLKID */ #include "xfs_mkfs.h" - -/* - * Device topology information. - */ -struct fs_topology { - int dsunit; /* stripe unit - data subvolume */ - int dswidth; /* stripe width - data subvolume */ - int rtswidth; /* stripe width - rt subvolume */ - int lsectorsize; /* logical sector size &*/ - int psectorsize; /* physical sector size */ -}; +#include "libxcmd.h" /* * Prototypes for internal functions. @@ -295,244 +285,6 @@ calc_stripe_factors( } } -/* - * Check for existing filesystem or partition table on device. - * Returns: - * 1 for existing fs or partition - * 0 for nothing found - * -1 for internal error - */ -#ifdef ENABLE_BLKID -static int -check_overwrite( - char *device) -{ - const char *type; - blkid_probe pr = NULL; - int ret; - int fd; - long long size; - int bsz; - - if (!device || !*device) - return 0; - - ret = -1; /* will reset on success of all setup calls */ - - fd = open(device, O_RDONLY); - if (fd < 0) - goto out; - platform_findsizes(device, fd, &size, &bsz); - close(fd); - - /* nothing to overwrite on a 0-length device */ - if (size == 0) { - ret = 0; - goto out; - } - - pr = blkid_new_probe_from_filename(device); - if (!pr) - goto out; - - ret = blkid_probe_enable_partitions(pr, 1); - if (ret < 0) - goto out; - - ret = blkid_do_fullprobe(pr); - if (ret < 0) - goto out; - - /* - * Blkid returns 1 for nothing found and 0 when it finds a signature, - * but we want the exact opposite, so reverse the return value here. - * - * In addition print some useful diagnostics about what actually is - * on the device. - */ - if (ret) { - ret = 0; - goto out; - } - - if (!blkid_probe_lookup_value(pr, "TYPE", &type, NULL)) { - fprintf(stderr, - _("%s: %s appears to contain an existing " - "filesystem (%s).\n"), progname, device, type); - } else if (!blkid_probe_lookup_value(pr, "PTTYPE", &type, NULL)) { - fprintf(stderr, - _("%s: %s appears to contain a partition " - "table (%s).\n"), progname, device, type); - } else { - fprintf(stderr, - _("%s: %s appears to contain something weird " - "according to blkid\n"), progname, device); - } - ret = 1; - -out: - if (pr) - blkid_free_probe(pr); - if (ret == -1) - fprintf(stderr, - _("%s: probe of %s failed, cannot detect " - "existing filesystem.\n"), progname, device); - return ret; -} - -static void blkid_get_topology( - const char *device, - int *sunit, - int *swidth, - int *lsectorsize, - int *psectorsize, - int force_overwrite) -{ - - blkid_topology tp; - blkid_probe pr; - unsigned long val; - struct stat statbuf; - - /* can't get topology info from a file */ - if (!stat(device, &statbuf) && S_ISREG(statbuf.st_mode)) - return; - - pr = blkid_new_probe_from_filename(device); - if (!pr) - return; - - tp = blkid_probe_get_topology(pr); - if (!tp) - goto out_free_probe; - - val = blkid_topology_get_logical_sector_size(tp); - *lsectorsize = val; - val = blkid_topology_get_physical_sector_size(tp); - *psectorsize = val; - val = blkid_topology_get_minimum_io_size(tp); - *sunit = val; - val = blkid_topology_get_optimal_io_size(tp); - *swidth = val; - - /* - * If the reported values are the same as the physical sector size - * do not bother to report anything. It will only cause warnings - * if people specify larger stripe units or widths manually. - */ - if (*sunit == *psectorsize || *swidth == *psectorsize) { - *sunit = 0; - *swidth = 0; - } - - /* - * Blkid reports the information in terms of bytes, but we want it in - * terms of 512 bytes blocks (only to convert it to bytes later..) - */ - *sunit = *sunit >> 9; - *swidth = *swidth >> 9; - - if (blkid_topology_get_alignment_offset(tp) != 0) { - fprintf(stderr, - _("warning: device is not properly aligned %s\n"), - device); - - if (!force_overwrite) { - fprintf(stderr, - _("Use -f to force usage of a misaligned device\n")); - - exit(EXIT_FAILURE); - } - /* Do not use physical sector size if the device is misaligned */ - *psectorsize = *lsectorsize; - } - - blkid_free_probe(pr); - return; - -out_free_probe: - blkid_free_probe(pr); - fprintf(stderr, - _("warning: unable to probe device topology for device %s\n"), - device); -} -#else /* ifdef ENABLE_BLKID */ -/* - * Without blkid, we can't do a good check for signatures. - * So instead of some messy attempts, just disable any checks - * and always return 'nothing found'. - */ -# warning BLKID is disabled, so signature detection and block device\ - access are not working! -static int -check_overwrite( - char *device) -{ - return 1; -} - -static void blkid_get_topology( - const char *device, - int *sunit, - int *swidth, - int *lsectorsize, - int *psectorsize, - int force_overwrite) -{ - /* - * Shouldn't make any difference (no blkid = no block device access), - * but make sure this dummy replacement returns with at least some - * sanity. - */ - *lsectorsize = *psectorsize = 512; -} - -#endif /* ENABLE_BLKID */ - -static void get_topology( - libxfs_init_t *xi, - struct fs_topology *ft, - int force_overwrite) -{ - struct stat statbuf; - char *dfile = xi->volname ? xi->volname : xi->dname; - - /* - * If our target is a regular file, use platform_findsizes - * to try to obtain the underlying filesystem's requirements - * for direct IO; we'll set our sector size to that if possible. - */ - if (xi->disfile || - (!stat(dfile, &statbuf) && S_ISREG(statbuf.st_mode))) { - int fd; - int flags = O_RDONLY; - long long dummy; - - /* with xi->disfile we may not have the file yet! */ - if (xi->disfile) - flags |= O_CREAT; - - fd = open(dfile, flags, 0666); - if (fd >= 0) { - platform_findsizes(dfile, fd, &dummy, &ft->lsectorsize); - close(fd); - ft->psectorsize = ft->lsectorsize; - } else - ft->psectorsize = ft->lsectorsize = BBSIZE; - } else { - blkid_get_topology(dfile, &ft->dsunit, &ft->dswidth, - &ft->lsectorsize, &ft->psectorsize, - force_overwrite); - } - - if (xi->rtname && !xi->risfile) { - int sunit, lsectorsize, psectorsize; - - blkid_get_topology(xi->rtname, &sunit, &ft->rtswidth, - &lsectorsize, &psectorsize, force_overwrite); - } -} - static void fixup_log_stripe_unit( int lsflag, @@ -640,77 +392,6 @@ calc_default_imaxpct( return 1; } - -void -calc_default_ag_geometry( - int blocklog, - __uint64_t dblocks, - int multidisk, - __uint64_t *agsize, - __uint64_t *agcount) -{ - __uint64_t blocks = 0; - int shift = 0; - - /* - * First handle the high extreme - the point at which we will - * always use the maximum AG size. - * - * This applies regardless of storage configuration. - */ - if (dblocks >= TERABYTES(32, blocklog)) { - blocks = XFS_AG_MAX_BLOCKS(blocklog); - goto done; - } - - /* - * For the remainder we choose an AG size based on the - * number of data blocks available, trying to keep the - * number of AGs relatively small (especially compared - * to the original algorithm). AG count is calculated - * based on the preferred AG size, not vice-versa - the - * count can be increased by growfs, so prefer to use - * smaller counts at mkfs time. - * - * For a single underlying storage device between 128MB - * and 4TB in size, just use 4 AGs, otherwise scale up - * smoothly between min/max AG sizes. - */ - - if (!multidisk && dblocks >= MEGABYTES(128, blocklog)) { - if (dblocks >= TERABYTES(4, blocklog)) { - blocks = XFS_AG_MAX_BLOCKS(blocklog); - goto done; - } - shift = 2; - } else if (dblocks > GIGABYTES(512, blocklog)) - shift = 5; - else if (dblocks > GIGABYTES(8, blocklog)) - shift = 4; - else if (dblocks >= MEGABYTES(128, blocklog)) - shift = 3; - else if (dblocks >= MEGABYTES(64, blocklog)) - shift = 2; - else if (dblocks >= MEGABYTES(32, blocklog)) - shift = 1; - else - shift = 0; - /* - * If dblocks is not evenly divisible by the number of - * desired AGs, round "blocks" up so we don't lose the - * last bit of the filesystem. The same principle applies - * to the AG count, so we don't lose the last AG! - */ - blocks = dblocks >> shift; - if (dblocks & xfs_mask32lo(shift)) { - if (blocks < XFS_AG_MAX_BLOCKS(blocklog)) - blocks++; - } -done: - *agsize = blocks; - *agcount = dblocks / blocks + (dblocks % blocks != 0); -} - static void validate_ag_geometry( int blocklog, -- 2.5.0 From sandeen@redhat.com Tue Feb 9 11:41:00 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=ham version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay1.corp.sgi.com [137.38.102.111]) by oss.sgi.com (Postfix) with ESMTP id A17B729DF5 for ; Tue, 9 Feb 2016 11:41:00 -0600 (CST) Received: from cuda.sgi.com (cuda3.sgi.com [192.48.176.15]) by relay1.corp.sgi.com (Postfix) with ESMTP id 8FC068F8052 for ; Tue, 9 Feb 2016 09:41:00 -0800 (PST) X-ASG-Debug-ID: 1455039659-04cb6c1e572a870001-NocioJ Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by cuda.sgi.com with ESMTP id xX8qTjOzmxqxAZss (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO) for ; Tue, 09 Feb 2016 09:40:59 -0800 (PST) X-Barracuda-Envelope-From: sandeen@redhat.com X-Barracuda-Apparent-Source-IP: 209.132.183.28 X-ASG-Whitelist: Client Received: from int-mx14.intmail.prod.int.phx2.redhat.com (int-mx14.intmail.prod.int.phx2.redhat.com [10.5.11.27]) by mx1.redhat.com (Postfix) with ESMTPS id EB5F580504 for ; Tue, 9 Feb 2016 17:40:58 +0000 (UTC) Received: from liberator.sandeen.net (ovpn01.gateway.prod.ext.phx2.redhat.com [10.5.9.1]) by int-mx14.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id u19HewqI016686 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Tue, 9 Feb 2016 12:40:58 -0500 To: xfs@oss.sgi.com From: Eric Sandeen Subject: [PATCH] xfsprogs: guard fsxattr definition for newer kernels Message-ID: <56BA24A9.4090403@redhat.com> X-ASG-Orig-Subj: [PATCH] xfsprogs: guard fsxattr definition for newer kernels Date: Tue, 9 Feb 2016 11:40:57 -0600 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.11; rv:38.0) Gecko/20100101 Thunderbird/38.5.1 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-Scanned-By: MIMEDefang 2.68 on 10.5.11.27 X-Barracuda-Connect: mx1.redhat.com[209.132.183.28] X-Barracuda-Start-Time: 1455039659 X-Barracuda-Encrypted: ECDHE-RSA-AES256-GCM-SHA384 X-Barracuda-URL: https://192.48.176.15:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-BRTS-Status: 1 After 334e580, fs: XFS_IOC_FS[SG]SETXATTR to FS_IOC_FS[SG]ETXATTR promotion the file include/linux/fs.h now defines struct fsxattr. It defines FS_IOC_FSGETXATTR as well, so use that to wrap our local definition, and skip it if the kernel is providing it so that we don't get multiple definitions. Signed-off-by: Eric Sandeen --- Should the kernel also #define HAVE_FSXATTR to help existing xfsprogs-devel installations? (And what if headers are included in the other order? Should we try to guard on the kernel side or no?) diff --git a/libxfs/xfs_fs.h b/libxfs/xfs_fs.h index d8b733a..f4858df 100644 --- a/libxfs/xfs_fs.h +++ b/libxfs/xfs_fs.h @@ -37,8 +37,10 @@ struct dioattr { /* * Structure for XFS_IOC_FSGETXATTR[A] and XFS_IOC_FSSETXATTR. + * If FS_IOC_FSGETXATTR is defined, the kernel is now providing + * this structure definition. */ -#ifndef HAVE_FSXATTR +#if (!defined(HAVE_FSXATTR) && !defined(FS_IOC_FSGETXATTR)) struct fsxattr { __u32 fsx_xflags; /* xflags field value (get/set) */ __u32 fsx_extsize; /* extsize field value (get/set)*/ From ross.zwisler@linux.intel.com Tue Feb 9 12:07:30 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=ham version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay1.corp.sgi.com [137.38.102.111]) by oss.sgi.com (Postfix) with ESMTP id 40B6D29DF5 for ; Tue, 9 Feb 2016 12:07:30 -0600 (CST) Received: from cuda.sgi.com (cuda2.sgi.com [192.48.176.25]) by relay1.corp.sgi.com (Postfix) with ESMTP id 1F68E8F8064 for ; Tue, 9 Feb 2016 10:07:27 -0800 (PST) X-ASG-Debug-ID: 1455041245-04cbb0433441a10001-NocioJ Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) by cuda.sgi.com with ESMTP id KZGJZgHn7eePIpDn for ; Tue, 09 Feb 2016 10:07:26 -0800 (PST) X-Barracuda-Envelope-From: ross.zwisler@linux.intel.com X-Barracuda-Apparent-Source-IP: 134.134.136.24 X-ASG-Whitelist: Client Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by orsmga102.jf.intel.com with ESMTP; 09 Feb 2016 10:06:52 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.22,421,1449561600"; d="scan'208";a="45097506" Received: from tarkir.lm.intel.com (HELO linux.intel.com) ([10.232.112.142]) by fmsmga004.fm.intel.com with ESMTP; 09 Feb 2016 10:06:50 -0800 Date: Tue, 9 Feb 2016 11:06:47 -0700 From: Ross Zwisler To: Jan Kara Cc: Dan Williams , Dave Chinner , Ross Zwisler , "linux-kernel@vger.kernel.org" , Theodore Ts'o , Alexander Viro , Andreas Dilger , Andrew Morton , Jan Kara , Matthew Wilcox , linux-ext4 , linux-fsdevel , Linux MM , "linux-nvdimm@lists.01.org" , XFS Developers , jmoyer Subject: Re: [PATCH 2/2] dax: move writeback calls into the filesystems Message-ID: <20160209180647.GA2450@linux.intel.com> X-ASG-Orig-Subj: Re: [PATCH 2/2] dax: move writeback calls into the filesystems Mail-Followup-To: Ross Zwisler , Jan Kara , Dan Williams , Dave Chinner , "linux-kernel@vger.kernel.org" , Theodore Ts'o , Alexander Viro , Andreas Dilger , Andrew Morton , Jan Kara , Matthew Wilcox , linux-ext4 , linux-fsdevel , Linux MM , "linux-nvdimm@lists.01.org" , XFS Developers , jmoyer References: <1454829553-29499-1-git-send-email-ross.zwisler@linux.intel.com> <1454829553-29499-3-git-send-email-ross.zwisler@linux.intel.com> <20160207215047.GJ31407@dastard> <20160208201808.GK27429@dastard> <20160209094353.GF9451@quack.suse.cz> <20160209160134.GA12245@quack.suse.cz> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20160209160134.GA12245@quack.suse.cz> User-Agent: Mutt/1.5.24 (2015-08-30) X-Barracuda-Connect: mga09.intel.com[134.134.136.24] X-Barracuda-Start-Time: 1455041246 X-Barracuda-URL: https://192.48.176.25:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-BRTS-Status: 1 On Tue, Feb 09, 2016 at 05:01:34PM +0100, Jan Kara wrote: > On Tue 09-02-16 10:43:53, Jan Kara wrote: > > On Mon 08-02-16 12:55:24, Dan Williams wrote: > > > On Mon, Feb 8, 2016 at 12:18 PM, Dave Chinner wrote: > > > [..] > > > >> Setting aside the current block zeroing problem you seem to assuming > > > >> that DAX will always be faster and that may not be true at a media > > > >> level. Waiting years for some applications to determine if DAX makes > > > >> sense for their use case seems completely reasonable. In the meantime > > > >> the apps that are already making these changes want to know that a DAX > > > >> mapping request has not silently dropped backed to page cache. They > > > >> also want to know if they successfully jumped through all the hoops to > > > >> get a larger than pte mapping. > > > >> > > > >> I agree it is useful to be able to force DAX on an unmodified > > > >> application to see what happens, and it follows that if those > > > >> applications want to run in that mode they will need functional > > > >> fsync()... > > > >> > > > >> I would feel better if we were talking about specific applications and > > > >> performance numbers to know if forcing DAX on application is a debug > > > >> facility or a production level capability. You seem to have already > > > >> made that determination and I'm curious what I'm missing. > > > > > > > > I'm not setting any policy here at all. This whole argument is > > > > based around the DAX mount option doing "global fs enable or > > > > silently turning it off" and the application not knowing about that. > > > > > > > > The whole point of having a persistent per-inode DAX flags is that > > > > it is a policy mechanism, not a policy. The application can, if it > > > > is DAX aware, directly control whether DAX is used on a file or not. > > > > The application can even query and clear that persistent inode flag > > > > if it is configured not to (or cannot) use DAX. > > > > > > > > If the filesystem cannot support DAX, then we can error out attempts > > > > to set the DAX flag and then the app knows DAX is not available. > > > > i.e. the attempt to set policy failed. If the flag is set, then the > > > > inode will *always* use DAX - there is no "fall back to page cache" > > > > when DAX is enabled. > > > > > > > > If the applicaiton is not DAX aware, then the admin can control the > > > > DAX policy by manipulating these flags themselves, and hence control > > > > whether DAX is used by the application or not. > > > > > > > > If you think I'm dictating policy for DAX users and application, > > > > then you haven't understood anything I've previously said about why > > > > the DAX mount option needs to die before any of this is considered > > > > production ready. DAX is not an opaque "all or nothing" option. XFS > > > > will provide apps and admins with fine-grained, persistent, > > > > discoverable policy flags to allow admins and applications to set > > > > DAX policies however they see fit. This simply cannot be done if the > > > > only knob you have is a mount option that may or may not stick. > > > > > > I agree the mount option needs to die, and I fully grok the reasoning. > > > What I'm concerned with is that a system using fully-DAX-aware > > > applications is forced to incur the overhead of maintaining *sync > > > semantics, periodic sync(2) in particular, even if it is not relying > > > on those semantics. > > > > Let me somewhat correct this: IMO hard requirement is maintaining sync(2) > > semantics. Periodic writeback does not have any hard durability guarantees > > and we are free to ignore such requests in ->writepages() (that function > > has enough information in the writeback_control structure to differentiate > > between periodic writeback and data integrity sync) if we decide it is > > useful. Actually, we could do that even for 4.5. > > Attached is a version of Ross' patch that will work for sync(2) and > fsync(2) and we won't flush caches during periodic writeback. The patch is > only compile-tested. Ross? This looks great. I'll send out a v2 with this and with the dax_clear_sectors() changes after I'm done testing. From sandeen@sandeen.net Tue Feb 9 13:05:22 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=ham version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay3.corp.sgi.com [198.149.34.15]) by oss.sgi.com (Postfix) with ESMTP id 8942D29DF5 for ; Tue, 9 Feb 2016 13:05:22 -0600 (CST) Received: from cuda.sgi.com (cuda1.sgi.com [192.48.157.11]) by relay3.corp.sgi.com (Postfix) with ESMTP id 35A2FAC006 for ; Tue, 9 Feb 2016 11:05:18 -0800 (PST) X-ASG-Debug-ID: 1455044713-04bdf066ec2d940001-NocioJ Received: from sandeen.net (sandeen.net [63.231.237.45]) by cuda.sgi.com with ESMTP id BJlnNvQyowfGjDbM for ; Tue, 09 Feb 2016 11:05:13 -0800 (PST) X-Barracuda-Envelope-From: sandeen@sandeen.net X-Barracuda-Apparent-Source-IP: 63.231.237.45 Received: from liberator.sandeen.net (liberator.sandeen.net [10.0.0.4]) (using TLSv1.2 with cipher DHE-RSA-AES128-SHA (128/128 bits)) (No client certificate requested) by sandeen.net (Postfix) with ESMTPSA id E81C563C607A for ; Tue, 9 Feb 2016 13:05:12 -0600 (CST) Subject: Re: [PATCH 2/2] xfs_repair: new secondary superblock search method To: xfs@oss.sgi.com X-ASG-Orig-Subj: Re: [PATCH 2/2] xfs_repair: new secondary superblock search method References: <1455037988-7213-1-git-send-email-billodo@redhat.com> <1455037988-7213-3-git-send-email-billodo@redhat.com> From: Eric Sandeen X-Enigmail-Draft-Status: N1110 Message-ID: <56BA3868.7090900@sandeen.net> Date: Tue, 9 Feb 2016 13:05:12 -0600 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.11; rv:38.0) Gecko/20100101 Thunderbird/38.5.1 MIME-Version: 1.0 In-Reply-To: <1455037988-7213-3-git-send-email-billodo@redhat.com> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 8bit X-Barracuda-Connect: sandeen.net[63.231.237.45] X-Barracuda-Start-Time: 1455044713 X-Barracuda-URL: https://192.48.157.11:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-BRTS-Status: 1 X-Barracuda-Spam-Score: 0.00 X-Barracuda-Spam-Status: No, SCORE=0.00 using per-user scores of TAG_LEVEL=1000.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.7 tests= X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.3.26894 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- On 2/9/16 11:13 AM, Bill O'Donnell wrote: > Optimize secondary sb search, using similar method to find > fs geometry as that of xfs_mkfs. If this faster method fails > in finding a secondary sb, fall back to original brute force > slower search. > > Signed-off-by: Bill O'Donnell > --- > Makefile | 2 +- > include/libxcmd.h | 4 +++- > libxcmd/topology.c | 28 +++++++++++++++++++++++++++- > repair/Makefile | 4 ++-- > repair/phase1.c | 25 +++++++++++++++++++++++-- > repair/protos.h | 2 +- > repair/sb.c | 27 +++++++++++++++++++++------ > 7 files changed, 78 insertions(+), 14 deletions(-) > > diff --git a/Makefile b/Makefile > index fca0a42..1d60d9c 100644 > --- a/Makefile > +++ b/Makefile > @@ -80,7 +80,7 @@ fsr: libhandle > growfs: libxcmd > io: libxcmd libhandle > quota: libxcmd > -repair: libxlog > +repair: libxlog libxcmd > copy: libxlog > > ifeq ($(HAVE_BUILDDEFS), yes) > diff --git a/include/libxcmd.h b/include/libxcmd.h > index df7046e..b140adb 100644 > --- a/include/libxcmd.h > +++ b/include/libxcmd.h > @@ -50,6 +50,8 @@ extern int > check_overwrite( > char *device); > > - > +extern int guess_default_geometry(__uint64_t *agsize, > + __uint64_t *agcount, > + libxfs_init_t x); > > #endif /* __LIBXCMD_H__ */ > diff --git a/libxcmd/topology.c b/libxcmd/topology.c > index 0eeea28..4a8ab8b 100644 > --- a/libxcmd/topology.c > +++ b/libxcmd/topology.c > @@ -302,7 +302,6 @@ static void blkid_get_topology( > > #endif /* ENABLE_BLKID */ > > - > void get_topology( > libxfs_init_t *xi, > struct fs_topology *ft, > @@ -346,3 +345,30 @@ void get_topology( > &lsectorsize, &psectorsize, force_overwrite); > } > } > + > +/* > + * Use this macro before we have superblock and mount structure > + */ > +#define DTOBT(d) ((xfs_rfsblock_t)((d) >> (blocklog - BBSHIFT))) Hm, I hate this macro. ;) I know it lives in xfs_mkfs.c too... depending on a local variable is ick. Since you only use it once below, it might be best to just open-code it, see below. > + > +int guess_default_geometry(__uint64_t *agsize, __uint64_t *agcount, libxfs_init_t x) { Move the "{" down to this line, please, and wrap the args so it doesn't go over 80 chars. > + struct fs_topology ft; > + int blocklog; > + __uint64_t dblocks; ^tab here please > + int multidisk; ^tabs here please ... and a newline here to separate variable declarations... > + memset(&ft, 0, sizeof(ft)); ... from this call. Tab this call in... > + get_topology(&x, &ft, 1); ^^^^ as well as this one. > + > + /* ^ tab here too > + * get geometry from get_topology result. > + * Use default block size (2^12) > + */ > + blocklog = 12; > + multidisk = ft.dswidth | ft.dsunit; > + printf("x.dsize = %lu\n",(long unsigned int)x.dsize); drop the debug printf > + dblocks = DTOBT(x.dsize); maybe best to just: dblocks = x.dsize >> (blocklog - BBSHIFT); > + calc_default_ag_geometry(blocklog, dblocks, multidisk, > + agsize, agcount); general whitespace problems above; use tabs not spaces please, as appropriate. > + > + return(blocklog); while we're at it it'd be nice to make return not a function; just "return blocklog;" > +} > diff --git a/repair/Makefile b/repair/Makefile > index 251722b..d24ab1f 100644 > --- a/repair/Makefile > +++ b/repair/Makefile > @@ -20,8 +20,8 @@ CFILES = agheader.c attr_repair.c avl.c avl64.c bmap.c btree.c \ > progress.c prefetch.c rt.c sb.c scan.c threads.c \ > versions.c xfs_repair.c > > -LLDLIBS = $(LIBXFS) $(LIBXLOG) $(LIBUUID) $(LIBRT) $(LIBPTHREAD) > -LTDEPENDENCIES = $(LIBXFS) $(LIBXLOG) > +LLDLIBS = $(LIBBLKID) $(LIBXFS) $(LIBXLOG) $(LIBUUID) $(LIBRT) $(LIBPTHREAD) $(LIBXCMD) > +LTDEPENDENCIES = $(LIBXFS) $(LIBXLOG) $(LIBXCMD) > LLDFLAGS = -static-libtool-libs > > default: depend $(LTCOMMAND) > diff --git a/repair/phase1.c b/repair/phase1.c > index 126d0b3..c27033d 100644 > --- a/repair/phase1.c > +++ b/repair/phase1.c > @@ -21,6 +21,7 @@ > #include "agheader.h" > #include "protos.h" > #include "err_protos.h" > +#include "libxcmd.h" > > static void > no_sb(void) > @@ -47,6 +48,9 @@ alloc_ag_buf(int size) > */ > #define MAX_SECTSIZE (512 * 1024) > > +extern libxfs_init_t x; It would be better to #include "libxlog.h" after the inclusion of libxfs.h at the top of this file, and you won't need this extern. That's how the main file/function gets "x" for xfs_repair. but actually, see more below. > + > + > /* ARGSUSED */ > void > phase1(xfs_mount_t *mp) > @@ -54,6 +58,10 @@ phase1(xfs_mount_t *mp) > xfs_sb_t *sb; > char *ag_bp; > int rval; > + int blocklog; > + __uint64_t agcount; > + __uint64_t agsize; > + __uint64_t skipsize; > > do_log(_("Phase 1 - find and verify superblock...\n")); > > @@ -65,6 +73,18 @@ phase1(xfs_mount_t *mp) > lost_quotas = 0; > > /* > + * divine the geometry > + */ > + blocklog = guess_default_geometry(&agsize, &agcount, x); > + > + /* > + * use found ag geometry to quickly find secondary sb > + */ > + skipsize = agsize << blocklog; > + do_log("agsize = %d agcount = %d skipsize = %d\n", > + (int)agsize, (int)agcount, (int)skipsize); Since this is just a guess, I wouldn't log. It may well print out geometry that is not correct, and that would be confusing. And actually - looking at how you have refactored find_secondary_sb(), you can move the above 12 or so lines into find_secondary_sb(), and you don't need to pre-compute skipsize etc here. You can do it all in find_secondary_sb() when it gets called. Then this file (phase1.c) can be completely unchanged, and all the magic happens in repair/sb.c. > + > + /* > * get AG 0 into ag header buf > */ > ag_bp = alloc_ag_buf(MAX_SECTSIZE); > @@ -80,14 +100,15 @@ phase1(xfs_mount_t *mp) > if (rval != XR_OK) { > do_warn(_("bad primary superblock - %s !!!\n"), > err_string(rval)); > - if (!find_secondary_sb(sb)) > + > + if (!find_secondary_sb(sb, skipsize)) > no_sb(); > primary_sb_modified = 1; > } else if ((rval = verify_set_primary_sb(sb, 0, > &primary_sb_modified)) != XR_OK) { > do_warn(_("couldn't verify primary superblock - %s !!!\n"), > err_string(rval)); > - if (!find_secondary_sb(sb)) > + if (!find_secondary_sb(sb, skipsize)) > no_sb(); > primary_sb_modified = 1; > } > diff --git a/repair/protos.h b/repair/protos.h > index 9d5a2a6..d96373e 100644 > --- a/repair/protos.h > +++ b/repair/protos.h > @@ -31,7 +31,7 @@ int get_sb(xfs_sb_t *sbp, > void write_primary_sb(xfs_sb_t *sbp, > int size); > > -int find_secondary_sb(xfs_sb_t *sb); > +int find_secondary_sb(xfs_sb_t *sb, __uint64_t skipsize); this would be unchanged as well. > > struct fs_geometry; > void get_sb_geometry(struct fs_geometry *geo, > diff --git a/repair/sb.c b/repair/sb.c > index 4eef14a..4386479 100644 > --- a/repair/sb.c/d > +++ b/repair/sb.c > @@ -87,8 +87,7 @@ copy_sb(xfs_sb_t *source, xfs_sb_t *dest) > /* > * find a secondary superblock, copy it into the sb buffer It'd be good to document "skipsize" here - units, and purpose. > */ > -int > -find_secondary_sb(xfs_sb_t *rsb) > +static int __find_secondary_sb(xfs_sb_t *rsb, __uint64_t skipsize ) no space between skipsize and ")" please. > { > xfs_off_t off; > xfs_sb_t *sb; > @@ -101,7 +100,6 @@ find_secondary_sb(xfs_sb_t *rsb) > int bsize; > > do_warn(_("\nattempting to find secondary superblock...\n")); > - > sb = (xfs_sb_t *)memalign(libxfs_device_alignment(), BSIZE); > if (!sb) { > do_error( > @@ -117,7 +115,7 @@ find_secondary_sb(xfs_sb_t *rsb) > /* > * skip first sector since we know that's bad > */ > - for (done = 0, off = XFS_AG_MIN_BYTES; !done ; off += bsize) { > + for (done = 0, off = skipsize; !done ; off += bsize) { Ok, so you jump out "skipsize" for the first read, but after that you only move the offset by bsize, which is BSIZE (or 1MB). That works OK if the 2nd superblock (at skipsize) is OK, but if it's not, you'll start from there doing smaller reads like before, and then this loop isn't really any more efficient than it was. If skipsize is set, you need to start out 1x skipsize, then read at 2x skipsize, 3x skipsize, etc. So you need to change the loop increment as well. i.e. fast path: start at skipsize, advance by skipsize each loop slow path: start at XFS_AG_MIN_BYTES, advance by BSIZE each loop If you make a 4t sparse file, mkfs it, and corrupt the first *2* superblocks, then point repair at it you'll see what I mean. > /* > * read disk 1 MByte at a time. > */ > @@ -130,7 +128,6 @@ find_secondary_sb(xfs_sb_t *rsb) > } > > do_warn("."); > - > /* > * check the buffer 512 bytes at a time since > * we don't know how big the sectors really are. > @@ -164,11 +161,29 @@ find_secondary_sb(xfs_sb_t *rsb) > } > } > } > - > free(sb); > return(retval); > } > > +int > +find_secondary_sb(xfs_sb_t *rsb, __uint64_t skipsize) > +{ > + int retval; > + > + /* > + * Attempt to find secondary sb with a coarse approach, > + * using a large skipsize (agsize in bytes). Failing that, > + * fallback to the fine-grained approach using min agsize. > + */ > + retval = __find_secondary_sb(rsb, skipsize); > + if (!retval) With the comment below, it's safest to wrap these multiple lines after the conditional in { .... } > + /* > + * fallback: use minimum agsize for skipsize > + */ > + retval = __find_secondary_sb(rsb, XFS_AG_MIN_BYTES); > + return(retval); again drop the () on the return, please. > +} > + > /* > * Calculate what the inode alignment field ought to be based on internal > * superblock info and determine if it is valid. > From darrick.wong@oracle.com Tue Feb 9 13:14:20 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay1.corp.sgi.com [137.38.102.111]) by oss.sgi.com (Postfix) with ESMTP id 8BD8929DF5 for ; Tue, 9 Feb 2016 13:14:20 -0600 (CST) Received: from cuda.sgi.com (cuda3.sgi.com [192.48.176.15]) by relay1.corp.sgi.com (Postfix) with ESMTP id 7EFDE8F8066 for ; Tue, 9 Feb 2016 11:14:17 -0800 (PST) X-ASG-Debug-ID: 1455045254-04cb6c1e582cd00001-NocioJ Received: from userp1040.oracle.com (userp1040.oracle.com [156.151.31.81]) by cuda.sgi.com with ESMTP id oTEb0SA1THy4Ekpv (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO) for ; Tue, 09 Feb 2016 11:14:14 -0800 (PST) X-Barracuda-Envelope-From: darrick.wong@oracle.com X-Barracuda-Apparent-Source-IP: 156.151.31.81 Received: from aserv0021.oracle.com (aserv0021.oracle.com [141.146.126.233]) by userp1040.oracle.com (Sentrion-MTA-4.3.2/Sentrion-MTA-4.3.2) with ESMTP id u19JEDBt002852 (version=TLSv1 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Tue, 9 Feb 2016 19:14:13 GMT Received: from userv0122.oracle.com (userv0122.oracle.com [156.151.31.75]) by aserv0021.oracle.com (8.13.8/8.13.8) with ESMTP id u19JECwQ025464 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=FAIL); Tue, 9 Feb 2016 19:14:13 GMT Received: from abhmp0014.oracle.com (abhmp0014.oracle.com [141.146.116.20]) by userv0122.oracle.com (8.14.4/8.14.4) with ESMTP id u19JECxW032329; Tue, 9 Feb 2016 19:14:12 GMT Received: from localhost (/10.145.178.207) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Tue, 09 Feb 2016 11:14:11 -0800 Date: Tue, 9 Feb 2016 11:14:09 -0800 From: "Darrick J. Wong" To: Eric Sandeen Cc: xfs@oss.sgi.com Subject: Re: [PATCH 2/2] xfs_repair: new secondary superblock search method Message-ID: <20160209191409.GC6350@birch.djwong.org> X-ASG-Orig-Subj: Re: [PATCH 2/2] xfs_repair: new secondary superblock search method References: <1455037988-7213-1-git-send-email-billodo@redhat.com> <1455037988-7213-3-git-send-email-billodo@redhat.com> <56BA3868.7090900@sandeen.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <56BA3868.7090900@sandeen.net> User-Agent: Mutt/1.5.21 (2010-09-15) X-Source-IP: aserv0021.oracle.com [141.146.126.233] X-Barracuda-Connect: userp1040.oracle.com[156.151.31.81] X-Barracuda-Start-Time: 1455045254 X-Barracuda-Encrypted: ECDHE-RSA-AES256-GCM-SHA384 X-Barracuda-URL: https://192.48.176.15:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-BRTS-Status: 1 X-Barracuda-Spam-Score: 0.00 X-Barracuda-Spam-Status: No, SCORE=0.00 using per-user scores of TAG_LEVEL=1000.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.7 tests=BSF_SC0_MISMATCH_TO, UNPARSEABLE_RELAY X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.3.26894 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 0.00 BSF_SC0_MISMATCH_TO Envelope rcpt doesn't match header 0.00 UNPARSEABLE_RELAY Informational: message has unparseable relay lines On Tue, Feb 09, 2016 at 01:05:12PM -0600, Eric Sandeen wrote: > On 2/9/16 11:13 AM, Bill O'Donnell wrote: > > Optimize secondary sb search, using similar method to find > > fs geometry as that of xfs_mkfs. If this faster method fails > > in finding a secondary sb, fall back to original brute force > > slower search. > > > > Signed-off-by: Bill O'Donnell > > --- > > Makefile | 2 +- > > include/libxcmd.h | 4 +++- > > libxcmd/topology.c | 28 +++++++++++++++++++++++++++- > > repair/Makefile | 4 ++-- > > repair/phase1.c | 25 +++++++++++++++++++++++-- > > repair/protos.h | 2 +- > > repair/sb.c | 27 +++++++++++++++++++++------ > > 7 files changed, 78 insertions(+), 14 deletions(-) > > > > diff --git a/Makefile b/Makefile > > index fca0a42..1d60d9c 100644 > > --- a/Makefile > > +++ b/Makefile > > @@ -80,7 +80,7 @@ fsr: libhandle > > growfs: libxcmd > > io: libxcmd libhandle > > quota: libxcmd > > -repair: libxlog > > +repair: libxlog libxcmd > > copy: libxlog > > > > ifeq ($(HAVE_BUILDDEFS), yes) > > diff --git a/include/libxcmd.h b/include/libxcmd.h > > index df7046e..b140adb 100644 > > --- a/include/libxcmd.h > > +++ b/include/libxcmd.h > > @@ -50,6 +50,8 @@ extern int > > check_overwrite( > > char *device); > > > > - > > +extern int guess_default_geometry(__uint64_t *agsize, > > + __uint64_t *agcount, > > + libxfs_init_t x); > > > > #endif /* __LIBXCMD_H__ */ > > diff --git a/libxcmd/topology.c b/libxcmd/topology.c > > index 0eeea28..4a8ab8b 100644 > > --- a/libxcmd/topology.c > > +++ b/libxcmd/topology.c > > @@ -302,7 +302,6 @@ static void blkid_get_topology( > > > > #endif /* ENABLE_BLKID */ > > > > - > > void get_topology( > > libxfs_init_t *xi, > > struct fs_topology *ft, > > @@ -346,3 +345,30 @@ void get_topology( > > &lsectorsize, &psectorsize, force_overwrite); > > } > > } > > + > > +/* > > + * Use this macro before we have superblock and mount structure > > + */ > > +#define DTOBT(d) ((xfs_rfsblock_t)((d) >> (blocklog - BBSHIFT))) > > Hm, I hate this macro. ;) I know it lives in xfs_mkfs.c too... depending > on a local variable is ick. Since you only use it once below, it might be best > to just open-code it, see below. > > > + > > +int guess_default_geometry(__uint64_t *agsize, __uint64_t *agcount, libxfs_init_t x) { > > Move the "{" down to this line, please, and wrap the args so it doesn't go > over 80 chars. Also, please put the function name at the start of a line like most of the other XFS code: int guess_default_geometry( __uint64_t *agsize, __uint64_t *agcount, libxfs_init_t x) { /* ... */ } This makes it wayyyy easier to grep-hunt for function definitions. (Try wading through the mishmash of ext4/e2fsprogs until your brain fades...) --D > > > + struct fs_topology ft; > > + int blocklog; > > + __uint64_t dblocks; > ^tab here please > > + int multidisk; > ^tabs here please > > ... and a newline here to separate variable declarations... > > > + memset(&ft, 0, sizeof(ft)); > > ... from this call. Tab this call in... > > > > + get_topology(&x, &ft, 1); > ^^^^ as well as this one. > > > + > > + /* > ^ tab here too > > + * get geometry from get_topology result. > > + * Use default block size (2^12) > > + */ > > + blocklog = 12; > > + multidisk = ft.dswidth | ft.dsunit; > > + printf("x.dsize = %lu\n",(long unsigned int)x.dsize); > > drop the debug printf > > > + dblocks = DTOBT(x.dsize); > > maybe best to just: > > dblocks = x.dsize >> (blocklog - BBSHIFT); > > > + calc_default_ag_geometry(blocklog, dblocks, multidisk, > > + agsize, agcount); > > general whitespace problems above; use tabs not spaces please, > as appropriate. > > > + > > + return(blocklog); > > while we're at it it'd be nice to make return not a function; > just "return blocklog;" > > > +} > > diff --git a/repair/Makefile b/repair/Makefile > > index 251722b..d24ab1f 100644 > > --- a/repair/Makefile > > +++ b/repair/Makefile > > @@ -20,8 +20,8 @@ CFILES = agheader.c attr_repair.c avl.c avl64.c bmap.c btree.c \ > > progress.c prefetch.c rt.c sb.c scan.c threads.c \ > > versions.c xfs_repair.c > > > > -LLDLIBS = $(LIBXFS) $(LIBXLOG) $(LIBUUID) $(LIBRT) $(LIBPTHREAD) > > -LTDEPENDENCIES = $(LIBXFS) $(LIBXLOG) > > +LLDLIBS = $(LIBBLKID) $(LIBXFS) $(LIBXLOG) $(LIBUUID) $(LIBRT) $(LIBPTHREAD) $(LIBXCMD) > > +LTDEPENDENCIES = $(LIBXFS) $(LIBXLOG) $(LIBXCMD) > > LLDFLAGS = -static-libtool-libs > > > > default: depend $(LTCOMMAND) > > diff --git a/repair/phase1.c b/repair/phase1.c > > index 126d0b3..c27033d 100644 > > --- a/repair/phase1.c > > +++ b/repair/phase1.c > > @@ -21,6 +21,7 @@ > > #include "agheader.h" > > #include "protos.h" > > #include "err_protos.h" > > +#include "libxcmd.h" > > > > static void > > no_sb(void) > > @@ -47,6 +48,9 @@ alloc_ag_buf(int size) > > */ > > #define MAX_SECTSIZE (512 * 1024) > > > > +extern libxfs_init_t x; > > It would be better to > > #include "libxlog.h" > > after the inclusion of libxfs.h at the top of this file, and you won't > need this extern. That's how the main file/function gets "x" for > xfs_repair. but actually, see more below. > > > + > > + > > /* ARGSUSED */ > > void > > phase1(xfs_mount_t *mp) > > @@ -54,6 +58,10 @@ phase1(xfs_mount_t *mp) > > xfs_sb_t *sb; > > char *ag_bp; > > int rval; > > + int blocklog; > > + __uint64_t agcount; > > + __uint64_t agsize; > > + __uint64_t skipsize; > > > > do_log(_("Phase 1 - find and verify superblock...\n")); > > > > @@ -65,6 +73,18 @@ phase1(xfs_mount_t *mp) > > lost_quotas = 0; > > > > /* > > + * divine the geometry > > + */ > > + blocklog = guess_default_geometry(&agsize, &agcount, x); > > + > > + /* > > + * use found ag geometry to quickly find secondary sb > > + */ > > + skipsize = agsize << blocklog; > > + do_log("agsize = %d agcount = %d skipsize = %d\n", > > + (int)agsize, (int)agcount, (int)skipsize); > > Since this is just a guess, I wouldn't log. It may well > print out geometry that is not correct, and that would be confusing. > > And actually - looking at how you have refactored find_secondary_sb(), > you can move the above 12 or so lines into find_secondary_sb(), > and you don't need to pre-compute skipsize etc here. You can do it > all in find_secondary_sb() when it gets called. > > Then this file (phase1.c) can be completely unchanged, and all the > magic happens in repair/sb.c. > > > + > > + /* > > * get AG 0 into ag header buf > > */ > > ag_bp = alloc_ag_buf(MAX_SECTSIZE); > > @@ -80,14 +100,15 @@ phase1(xfs_mount_t *mp) > > if (rval != XR_OK) { > > do_warn(_("bad primary superblock - %s !!!\n"), > > err_string(rval)); > > - if (!find_secondary_sb(sb)) > > + > > + if (!find_secondary_sb(sb, skipsize)) > > no_sb(); > > primary_sb_modified = 1; > > } else if ((rval = verify_set_primary_sb(sb, 0, > > &primary_sb_modified)) != XR_OK) { > > do_warn(_("couldn't verify primary superblock - %s !!!\n"), > > err_string(rval)); > > - if (!find_secondary_sb(sb)) > > + if (!find_secondary_sb(sb, skipsize)) > > no_sb(); > > primary_sb_modified = 1; > > } > > diff --git a/repair/protos.h b/repair/protos.h > > index 9d5a2a6..d96373e 100644 > > --- a/repair/protos.h > > +++ b/repair/protos.h > > @@ -31,7 +31,7 @@ int get_sb(xfs_sb_t *sbp, > > void write_primary_sb(xfs_sb_t *sbp, > > int size); > > > > -int find_secondary_sb(xfs_sb_t *sb); > > +int find_secondary_sb(xfs_sb_t *sb, __uint64_t skipsize); > > this would be unchanged as well. > > > > > struct fs_geometry; > > void get_sb_geometry(struct fs_geometry *geo, > > diff --git a/repair/sb.c b/repair/sb.c > > index 4eef14a..4386479 100644 > > --- a/repair/sb.c/d > > +++ b/repair/sb.c > > @@ -87,8 +87,7 @@ copy_sb(xfs_sb_t *source, xfs_sb_t *dest) > > /* > > * find a secondary superblock, copy it into the sb buffer > > It'd be good to document "skipsize" here - units, and purpose. > > > */ > > -int > > -find_secondary_sb(xfs_sb_t *rsb) > > +static int __find_secondary_sb(xfs_sb_t *rsb, __uint64_t skipsize ) > > no space between skipsize and ")" please. > > > { > > xfs_off_t off; > > xfs_sb_t *sb; > > @@ -101,7 +100,6 @@ find_secondary_sb(xfs_sb_t *rsb) > > int bsize; > > > > do_warn(_("\nattempting to find secondary superblock...\n")); > > - > > sb = (xfs_sb_t *)memalign(libxfs_device_alignment(), BSIZE); > > if (!sb) { > > do_error( > > @@ -117,7 +115,7 @@ find_secondary_sb(xfs_sb_t *rsb) > > /* > > * skip first sector since we know that's bad > > */ > > - for (done = 0, off = XFS_AG_MIN_BYTES; !done ; off += bsize) { > > + for (done = 0, off = skipsize; !done ; off += bsize) { > > Ok, so you jump out "skipsize" for the first read, but after that you > only move the offset by bsize, which is BSIZE (or 1MB). > > That works OK if the 2nd superblock (at skipsize) is OK, but if it's > not, you'll start from there doing smaller reads like before, and > then this loop isn't really any more efficient than it was. > > If skipsize is set, you need to start out 1x skipsize, then read > at 2x skipsize, 3x skipsize, etc. So you need to change the > loop increment as well. > > i.e. fast path: start at skipsize, advance by skipsize each loop > > slow path: start at XFS_AG_MIN_BYTES, advance by BSIZE each loop > > If you make a 4t sparse file, mkfs it, and corrupt the first *2* > superblocks, then point repair at it you'll see what I mean. > > > /* > > * read disk 1 MByte at a time. > > */ > > @@ -130,7 +128,6 @@ find_secondary_sb(xfs_sb_t *rsb) > > } > > > > do_warn("."); > > - > > /* > > * check the buffer 512 bytes at a time since > > * we don't know how big the sectors really are. > > @@ -164,11 +161,29 @@ find_secondary_sb(xfs_sb_t *rsb) > > } > > } > > } > > - > > free(sb); > > return(retval); > > } > > > > +int > > +find_secondary_sb(xfs_sb_t *rsb, __uint64_t skipsize) > > +{ > > + int retval; > > + > > + /* > > + * Attempt to find secondary sb with a coarse approach, > > + * using a large skipsize (agsize in bytes). Failing that, > > + * fallback to the fine-grained approach using min agsize. > > + */ > > + retval = __find_secondary_sb(rsb, skipsize); > > + if (!retval) > > With the comment below, it's safest to wrap these multiple lines after > the conditional in { .... } > > > + /* > > + * fallback: use minimum agsize for skipsize > > + */ > > + retval = __find_secondary_sb(rsb, XFS_AG_MIN_BYTES); > > + return(retval); > > again drop the () on the return, please. > > > +} > > + > > /* > > * Calculate what the inode alignment field ought to be based on internal > > * superblock info and determine if it is valid. > > > > _______________________________________________ > xfs mailing list > xfs@oss.sgi.com > http://oss.sgi.com/mailman/listinfo/xfs From david@fromorbit.com Tue Feb 9 13:55:08 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=ham version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay3.corp.sgi.com [198.149.34.15]) by oss.sgi.com (Postfix) with ESMTP id F22A229DF5 for ; Tue, 9 Feb 2016 13:55:07 -0600 (CST) Received: from cuda.sgi.com (cuda3.sgi.com [192.48.176.15]) by relay3.corp.sgi.com (Postfix) with ESMTP id 6ECC4AC006 for ; Tue, 9 Feb 2016 11:55:07 -0800 (PST) X-ASG-Debug-ID: 1455047703-04cb6c1e592d980001-NocioJ Received: from ipmail06.adl2.internode.on.net (ipmail06.adl2.internode.on.net [150.101.137.129]) by cuda.sgi.com with ESMTP id 4eE1Ka0WECkVuZsa for ; Tue, 09 Feb 2016 11:55:04 -0800 (PST) X-Barracuda-Envelope-From: david@fromorbit.com X-Barracuda-Apparent-Source-IP: 150.101.137.129 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: A2AACAAXQ7pWPBATLHldKAECgw+BP4ZjgXmdWAaLZ4VFhAeGBwICAQECgTZNAQEBAQEBBwEBAQFBP4RCAQEEOhwjEAgDGAklDwUlAwcaE4gavxsBAQgCHhiFMoR/iGwFlniIOIUPjnyOP4RaKC6IUwEBAQ Received: from ppp121-44-19-16.lns20.syd4.internode.on.net (HELO dastard) ([121.44.19.16]) by ipmail06.adl2.internode.on.net with ESMTP; 10 Feb 2016 06:25:03 +1030 Received: from dave by dastard with local (Exim 4.80) (envelope-from ) id 1aTENK-0003o3-P9; Wed, 10 Feb 2016 06:55:02 +1100 Date: Wed, 10 Feb 2016 06:55:02 +1100 From: Dave Chinner To: Eric Sandeen Cc: xfs@oss.sgi.com Subject: Re: [PATCH] xfsprogs: guard fsxattr definition for newer kernels Message-ID: <20160209195502.GR27429@dastard> X-ASG-Orig-Subj: Re: [PATCH] xfsprogs: guard fsxattr definition for newer kernels References: <56BA24A9.4090403@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <56BA24A9.4090403@redhat.com> User-Agent: Mutt/1.5.21 (2010-09-15) X-Barracuda-Connect: ipmail06.adl2.internode.on.net[150.101.137.129] X-Barracuda-Start-Time: 1455047703 X-Barracuda-URL: https://192.48.176.15:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-BRTS-Status: 1 X-Barracuda-Spam-Score: 0.00 X-Barracuda-Spam-Status: No, SCORE=0.00 using per-user scores of TAG_LEVEL=1000.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.7 tests=BSF_SC0_MISMATCH_TO X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.3.26895 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 0.00 BSF_SC0_MISMATCH_TO Envelope rcpt doesn't match header On Tue, Feb 09, 2016 at 11:40:57AM -0600, Eric Sandeen wrote: > After 334e580, > fs: XFS_IOC_FS[SG]SETXATTR to FS_IOC_FS[SG]ETXATTR promotion > > the file include/linux/fs.h now defines struct fsxattr. > > It defines FS_IOC_FSGETXATTR as well, so use that to wrap > our local definition, and skip it if the kernel is providing > it so that we don't get multiple definitions. > > Signed-off-by: Eric Sandeen > --- > > Should the kernel also #define HAVE_FSXATTR to help existing > xfsprogs-devel installations? > > (And what if headers are included in the other order? Should > we try to guard on the kernel side or no?) I've already sent a patch to fix this - it was with the foreign filesystem xfs_quota patch.... Cheers, Dave. -- Dave Chinner david@fromorbit.com From sandeen@redhat.com Tue Feb 9 13:57:12 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=ham version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay1.corp.sgi.com [137.38.102.111]) by oss.sgi.com (Postfix) with ESMTP id EFAAC29DF5 for ; Tue, 9 Feb 2016 13:57:12 -0600 (CST) Received: from cuda.sgi.com (cuda1.sgi.com [192.48.157.11]) by relay1.corp.sgi.com (Postfix) with ESMTP id D6D538F8059 for ; Tue, 9 Feb 2016 11:57:12 -0800 (PST) X-ASG-Debug-ID: 1455047831-04bdf066eb2ed20001-NocioJ Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by cuda.sgi.com with ESMTP id 1OeEX9x2NXUoDS5I (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO) for ; Tue, 09 Feb 2016 11:57:12 -0800 (PST) X-Barracuda-Envelope-From: sandeen@redhat.com X-Barracuda-Apparent-Source-IP: 209.132.183.28 X-ASG-Whitelist: Client Received: from int-mx10.intmail.prod.int.phx2.redhat.com (int-mx10.intmail.prod.int.phx2.redhat.com [10.5.11.23]) by mx1.redhat.com (Postfix) with ESMTPS id A04E3C0C2345; Tue, 9 Feb 2016 19:57:11 +0000 (UTC) Received: from liberator.sandeen.net (ovpn01.gateway.prod.ext.phx2.redhat.com [10.5.9.1]) by int-mx10.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id u19JvASB009556 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Tue, 9 Feb 2016 14:57:11 -0500 Subject: Re: [PATCH] xfsprogs: guard fsxattr definition for newer kernels To: Dave Chinner X-ASG-Orig-Subj: Re: [PATCH] xfsprogs: guard fsxattr definition for newer kernels References: <56BA24A9.4090403@redhat.com> <20160209195502.GR27429@dastard> Cc: xfs@oss.sgi.com From: Eric Sandeen Message-ID: <56BA4495.9060304@redhat.com> Date: Tue, 9 Feb 2016 13:57:09 -0600 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.11; rv:38.0) Gecko/20100101 Thunderbird/38.5.1 MIME-Version: 1.0 In-Reply-To: <20160209195502.GR27429@dastard> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit X-Scanned-By: MIMEDefang 2.68 on 10.5.11.23 X-Barracuda-Connect: mx1.redhat.com[209.132.183.28] X-Barracuda-Start-Time: 1455047831 X-Barracuda-Encrypted: ECDHE-RSA-AES256-GCM-SHA384 X-Barracuda-URL: https://192.48.157.11:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-BRTS-Status: 1 On 2/9/16 1:55 PM, Dave Chinner wrote: > On Tue, Feb 09, 2016 at 11:40:57AM -0600, Eric Sandeen wrote: >> After 334e580, >> fs: XFS_IOC_FS[SG]SETXATTR to FS_IOC_FS[SG]ETXATTR promotion >> >> the file include/linux/fs.h now defines struct fsxattr. >> >> It defines FS_IOC_FSGETXATTR as well, so use that to wrap >> our local definition, and skip it if the kernel is providing >> it so that we don't get multiple definitions. >> >> Signed-off-by: Eric Sandeen >> --- >> >> Should the kernel also #define HAVE_FSXATTR to help existing >> xfsprogs-devel installations? >> >> (And what if headers are included in the other order? Should >> we try to guard on the kernel side or no?) > > I've already sent a patch to fix this - it was with the foreign > filesystem xfs_quota patch.... Oh, sorry, spaced it. What do you think of the HAVE_FSXATTR definition in fs.h? -Eric From david@fromorbit.com Tue Feb 9 15:10:21 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=ham version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay1.corp.sgi.com [137.38.102.111]) by oss.sgi.com (Postfix) with ESMTP id 9F30729DF5 for ; Tue, 9 Feb 2016 15:10:21 -0600 (CST) Received: from cuda.sgi.com (cuda2.sgi.com [192.48.176.25]) by relay1.corp.sgi.com (Postfix) with ESMTP id 823CA8F8049 for ; Tue, 9 Feb 2016 13:10:18 -0800 (PST) X-ASG-Debug-ID: 1455052211-04cbb0433145860001-NocioJ Received: from ipmail06.adl2.internode.on.net (ipmail06.adl2.internode.on.net [150.101.137.129]) by cuda.sgi.com with ESMTP id StQMDGcK2a7QnGod for ; Tue, 09 Feb 2016 13:10:12 -0800 (PST) X-Barracuda-Envelope-From: david@fromorbit.com X-Barracuda-Apparent-Source-IP: 150.101.137.129 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: A2AACACJVLpWPBATLHldKAECgw+BP4ZjgXmdWgaLZ4VFhAeGBwICAQECgTZNAQEBAQEBBwEBAQFBP4RCAQEEOhwjEAgDGAklDwUlAwcaE4gavy0BAQEBBgIBHRiFMoR/h12BDwWWeIg4hQ+OfI4/hFooLohTAQEB Received: from ppp121-44-19-16.lns20.syd4.internode.on.net (HELO dastard) ([121.44.19.16]) by ipmail06.adl2.internode.on.net with ESMTP; 10 Feb 2016 07:40:11 +1030 Received: from dave by dastard with local (Exim 4.80) (envelope-from ) id 1aTFY2-0003zt-C0; Wed, 10 Feb 2016 08:10:10 +1100 Date: Wed, 10 Feb 2016 08:10:10 +1100 From: Dave Chinner To: Eric Sandeen Cc: xfs@oss.sgi.com Subject: Re: [PATCH] xfsprogs: guard fsxattr definition for newer kernels Message-ID: <20160209211010.GA14668@dastard> X-ASG-Orig-Subj: Re: [PATCH] xfsprogs: guard fsxattr definition for newer kernels References: <56BA24A9.4090403@redhat.com> <20160209195502.GR27429@dastard> <56BA4495.9060304@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <56BA4495.9060304@redhat.com> User-Agent: Mutt/1.5.21 (2010-09-15) X-Barracuda-Connect: ipmail06.adl2.internode.on.net[150.101.137.129] X-Barracuda-Start-Time: 1455052211 X-Barracuda-URL: https://192.48.176.25:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-BRTS-Status: 1 X-Barracuda-Spam-Score: 0.00 X-Barracuda-Spam-Status: No, SCORE=0.00 using per-user scores of TAG_LEVEL=1000.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.7 tests=BSF_SC0_MISMATCH_TO X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.3.26896 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 0.00 BSF_SC0_MISMATCH_TO Envelope rcpt doesn't match header On Tue, Feb 09, 2016 at 01:57:09PM -0600, Eric Sandeen wrote: > On 2/9/16 1:55 PM, Dave Chinner wrote: > > On Tue, Feb 09, 2016 at 11:40:57AM -0600, Eric Sandeen wrote: > >> After 334e580, > >> fs: XFS_IOC_FS[SG]SETXATTR to FS_IOC_FS[SG]ETXATTR promotion > >> > >> the file include/linux/fs.h now defines struct fsxattr. > >> > >> It defines FS_IOC_FSGETXATTR as well, so use that to wrap > >> our local definition, and skip it if the kernel is providing > >> it so that we don't get multiple definitions. > >> > >> Signed-off-by: Eric Sandeen > >> --- > >> > >> Should the kernel also #define HAVE_FSXATTR to help existing > >> xfsprogs-devel installations? > >> > >> (And what if headers are included in the other order? Should > >> we try to guard on the kernel side or no?) > > > > I've already sent a patch to fix this - it was with the foreign > > filesystem xfs_quota patch.... > > Oh, sorry, spaced it. > > What do you think of the HAVE_FSXATTR definition in fs.h? Which fs.h? The include/linux/fs.h file does not have such guards... Cheers, Dave. -- Dave Chinner david@fromorbit.com From david@fromorbit.com Tue Feb 9 15:23:42 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=ham version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay1.corp.sgi.com [137.38.102.111]) by oss.sgi.com (Postfix) with ESMTP id D680229DF6 for ; Tue, 9 Feb 2016 15:23:42 -0600 (CST) Received: from cuda.sgi.com (cuda1.sgi.com [192.48.157.11]) by relay1.corp.sgi.com (Postfix) with ESMTP id B46348F8065 for ; Tue, 9 Feb 2016 13:23:42 -0800 (PST) X-ASG-Debug-ID: 1455053019-04bdf066eb30730001-NocioJ Received: from ipmail06.adl2.internode.on.net (ipmail06.adl2.internode.on.net [150.101.137.129]) by cuda.sgi.com with ESMTP id EEcxBaSSiEBZGsnR for ; Tue, 09 Feb 2016 13:23:39 -0800 (PST) X-Barracuda-Envelope-From: david@fromorbit.com X-Barracuda-Apparent-Source-IP: 150.101.137.129 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: A2CxBwA6WLpWPBATLHldKAECgw+BP4ZjgXmdWgaLZ4VFhAeGBwQCAoE2TQEBAQEBAQcBAQEBQT+EQgEBBCcTHCMQCAMOCgklDwUlAwcaE4gavzQBAQEBBgIBHRiFMoR/h12BDwWWeI1HgWSHaYUvRIopg1KEWiguiFMBAQE Received: from ppp121-44-19-16.lns20.syd4.internode.on.net (HELO dastard) ([121.44.19.16]) by ipmail06.adl2.internode.on.net with ESMTP; 10 Feb 2016 07:53:37 +1030 Received: from dave by dastard with local (Exim 4.80) (envelope-from ) id 1aTFl2-00040y-N7; Wed, 10 Feb 2016 08:23:36 +1100 Date: Wed, 10 Feb 2016 08:23:36 +1100 From: Dave Chinner To: Christoph Hellwig Cc: xfs@oss.sgi.com Subject: Re: [PATCH 6/6] xfs: rename XFS_BUF_ZEROFLAGS macro Message-ID: <20160209212336.GB14668@dastard> X-ASG-Orig-Subj: Re: [PATCH 6/6] xfs: rename XFS_BUF_ZEROFLAGS macro References: <1454632683-20543-1-git-send-email-david@fromorbit.com> <1454632683-20543-7-git-send-email-david@fromorbit.com> <20160208091235.GN5534@infradead.org> <20160208223120.GM27429@dastard> <20160209091632.GB23349@infradead.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20160209091632.GB23349@infradead.org> User-Agent: Mutt/1.5.21 (2010-09-15) X-Barracuda-Connect: ipmail06.adl2.internode.on.net[150.101.137.129] X-Barracuda-Start-Time: 1455053019 X-Barracuda-URL: https://192.48.157.11:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-BRTS-Status: 1 X-Barracuda-Spam-Score: 0.00 X-Barracuda-Spam-Status: No, SCORE=0.00 using per-user scores of TAG_LEVEL=1000.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.7 tests=BSF_SC0_MISMATCH_TO X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.3.26897 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 0.00 BSF_SC0_MISMATCH_TO Envelope rcpt doesn't match header On Tue, Feb 09, 2016 at 01:16:32AM -0800, Christoph Hellwig wrote: > On Tue, Feb 09, 2016 at 09:31:20AM +1100, Dave Chinner wrote: > > > xlog_sync already sets a lot of these flags again, and is called on an > > > iclog buffer which never has the READ or XBF_WRITE_FAIL set, so just > > > replacing it with an opencoded > > > > > > bp->b_flags &= (XBF_FUA | XBF_FLUSH); > > > > We can't do that because there are internal flags like _XBF_PAGES > > that are set on log buffers. Clearing such flags will cause problems > > when the iclog buffer is finally released on unmount. Hence I'd > > prefer to keep the code as it stands. > > Sorry - meabt to write: > > bp->b_flags &= ~(XBF_FUA | XBF_FLUSH); > > which is all we'll need. All other flags cleared by XFS_BUF_ZEROFLAGS > are either never set for log buffers (XBF_READ, XBF_WRITE_FAIL), or > always set for log buffers (XBF_WRITE, XBF_ASYNC, XBF_SYNCIO). Ah, that makes more sense. I should have realised that, but there are places where we do clear buffer flags like your original suggestion so it didn't occur to me it was just a typo. I'll fix it up. Cheers, Dave. -- Dave Chinner david@fromorbit.com From sandeen@sandeen.net Tue Feb 9 15:27:22 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=ham version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay1.corp.sgi.com [137.38.102.111]) by oss.sgi.com (Postfix) with ESMTP id 2839D29DF5 for ; Tue, 9 Feb 2016 15:27:22 -0600 (CST) Received: from cuda.sgi.com (cuda2.sgi.com [192.48.176.25]) by relay1.corp.sgi.com (Postfix) with ESMTP id 192148F8064 for ; Tue, 9 Feb 2016 13:27:21 -0800 (PST) X-ASG-Debug-ID: 1455053239-04cbb0433345dc0001-NocioJ Received: from sandeen.net (sandeen.net [63.231.237.45]) by cuda.sgi.com with ESMTP id N1eENqGcmofQ739P for ; Tue, 09 Feb 2016 13:27:19 -0800 (PST) X-Barracuda-Envelope-From: sandeen@sandeen.net X-Barracuda-Apparent-Source-IP: 63.231.237.45 Received: from liberator.sandeen.net (liberator.sandeen.net [10.0.0.4]) (using TLSv1.2 with cipher DHE-RSA-AES128-SHA (128/128 bits)) (No client certificate requested) by sandeen.net (Postfix) with ESMTPSA id 0B76263C5B52 for ; Tue, 9 Feb 2016 15:27:19 -0600 (CST) Subject: Re: [PATCH] xfsprogs: guard fsxattr definition for newer kernels To: xfs@oss.sgi.com X-ASG-Orig-Subj: Re: [PATCH] xfsprogs: guard fsxattr definition for newer kernels References: <56BA24A9.4090403@redhat.com> <20160209195502.GR27429@dastard> <56BA4495.9060304@redhat.com> <20160209211010.GA14668@dastard> From: Eric Sandeen Message-ID: <56BA59B6.3030803@sandeen.net> Date: Tue, 9 Feb 2016 15:27:18 -0600 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.11; rv:38.0) Gecko/20100101 Thunderbird/38.5.1 MIME-Version: 1.0 In-Reply-To: <20160209211010.GA14668@dastard> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit X-Barracuda-Connect: sandeen.net[63.231.237.45] X-Barracuda-Start-Time: 1455053239 X-Barracuda-URL: https://192.48.176.25:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-BRTS-Status: 1 X-Barracuda-Spam-Score: 0.00 X-Barracuda-Spam-Status: No, SCORE=0.00 using per-user scores of TAG_LEVEL=1000.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.7 tests= X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.3.26897 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- On 2/9/16 3:10 PM, Dave Chinner wrote: > On Tue, Feb 09, 2016 at 01:57:09PM -0600, Eric Sandeen wrote: >> On 2/9/16 1:55 PM, Dave Chinner wrote: >>> On Tue, Feb 09, 2016 at 11:40:57AM -0600, Eric Sandeen wrote: >>>> After 334e580, >>>> fs: XFS_IOC_FS[SG]SETXATTR to FS_IOC_FS[SG]ETXATTR promotion >>>> >>>> the file include/linux/fs.h now defines struct fsxattr. >>>> >>>> It defines FS_IOC_FSGETXATTR as well, so use that to wrap >>>> our local definition, and skip it if the kernel is providing >>>> it so that we don't get multiple definitions. >>>> >>>> Signed-off-by: Eric Sandeen >>>> --- >>>> >>>> Should the kernel also #define HAVE_FSXATTR to help existing >>>> xfsprogs-devel installations? >>>> >>>> (And what if headers are included in the other order? Should >>>> we try to guard on the kernel side or no?) >>> >>> I've already sent a patch to fix this - it was with the foreign >>> filesystem xfs_quota patch.... >> >> Oh, sorry, spaced it. >> >> What do you think of the HAVE_FSXATTR definition in fs.h? > > Which fs.h? The include/linux/fs.h file does not have such > guards... If include/linux/fs.h defined HAVE_FSXATTR, a subsequent inclusion of xfs_fs.h would not redefine the structure, because it is guarded with that (for irix!) -Eric From david@fromorbit.com Tue Feb 9 15:38:05 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=ham version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay1.corp.sgi.com [137.38.102.111]) by oss.sgi.com (Postfix) with ESMTP id 98D4529DF5 for ; Tue, 9 Feb 2016 15:38:05 -0600 (CST) Received: from cuda.sgi.com (cuda3.sgi.com [192.48.176.15]) by relay1.corp.sgi.com (Postfix) with ESMTP id 77B0A8F8070 for ; Tue, 9 Feb 2016 13:38:05 -0800 (PST) X-ASG-Debug-ID: 1455053882-04cb6c1e582f780001-NocioJ Received: from ipmail06.adl2.internode.on.net (ipmail06.adl2.internode.on.net [150.101.137.129]) by cuda.sgi.com with ESMTP id OJeMDfDN7FDppuj3 for ; Tue, 09 Feb 2016 13:38:03 -0800 (PST) X-Barracuda-Envelope-From: david@fromorbit.com X-Barracuda-Apparent-Source-IP: 150.101.137.129 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: A2ABCAC5W7pWPBATLHldKAECgw+BP4ZjgXmdWgaLZ4VFhAeGBwICAQECgTZNAQEBAQEBBwEBAQFBP4RCAQEEJxMcIxAIEQcMJQ8FJQMHGhOIGr82AQEBAQEFAQEBARwYhTKMXIEPBZZ4jUeOfESNe4JlGYFcKC6IUwEBAQ Received: from ppp121-44-19-16.lns20.syd4.internode.on.net (HELO dastard) ([121.44.19.16]) by ipmail06.adl2.internode.on.net with ESMTP; 10 Feb 2016 08:08:02 +1030 Received: from dave by dastard with local (Exim 4.80) (envelope-from ) id 1aTFyz-00042q-5n; Wed, 10 Feb 2016 08:38:01 +1100 Date: Wed, 10 Feb 2016 08:38:01 +1100 From: Dave Chinner To: Christoph Hellwig Cc: xfs@oss.sgi.com Subject: [PATCH 6/6 v3] xfs: remove XFS_BUF_ZEROFLAGS macro Message-ID: <20160209213801.GC14668@dastard> X-ASG-Orig-Subj: [PATCH 6/6 v3] xfs: remove XFS_BUF_ZEROFLAGS macro References: <1454632683-20543-1-git-send-email-david@fromorbit.com> <1454632683-20543-7-git-send-email-david@fromorbit.com> <20160208091235.GN5534@infradead.org> <20160208223120.GM27429@dastard> <20160209091632.GB23349@infradead.org> <20160209212336.GB14668@dastard> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20160209212336.GB14668@dastard> User-Agent: Mutt/1.5.21 (2010-09-15) X-Barracuda-Connect: ipmail06.adl2.internode.on.net[150.101.137.129] X-Barracuda-Start-Time: 1455053882 X-Barracuda-URL: https://192.48.176.15:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-BRTS-Status: 1 X-Barracuda-Spam-Score: 0.00 X-Barracuda-Spam-Status: No, SCORE=0.00 using per-user scores of TAG_LEVEL=1000.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.7 tests=BSF_SC0_MISMATCH_TO X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.3.26897 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 0.00 BSF_SC0_MISMATCH_TO Envelope rcpt doesn't match header xfs: remove XFS_BUF_ZEROFLAGS macro From: Dave Chinner The places where we use this macro already clear unnecessary IO flags (e.g. through xfs_bwrite()) or never have unexpected IO flags set on them in the first place (e.g. iclog buffers). Remove the macro from these locations, and where necessary clear only the specific flags that are conditional in the current buffer use context. Signed-off-by: Dave Chinner --- Version 3 - completely remove the macro as Christoph originally intended. fs/xfs/xfs_buf.h | 6 ------ fs/xfs/xfs_log.c | 4 ++-- fs/xfs/xfs_log_recover.c | 1 - 3 files changed, 2 insertions(+), 9 deletions(-) diff --git a/fs/xfs/xfs_buf.h b/fs/xfs/xfs_buf.h index 98b7ee9..4eb89bd 100644 --- a/fs/xfs/xfs_buf.h +++ b/fs/xfs/xfs_buf.h @@ -313,12 +313,6 @@ extern int xfs_buf_delwri_submit_nowait(struct list_head *); extern int xfs_buf_init(void); extern void xfs_buf_terminate(void); -#define XFS_BUF_ZEROFLAGS(bp) \ - ((bp)->b_flags &= ~(XBF_READ|XBF_WRITE|XBF_ASYNC| \ - XBF_SYNCIO|XBF_FUA|XBF_FLUSH| \ - XBF_WRITE_FAIL)) - - /* * These macros use the IO block map rather than b_bn. b_bn is now really * just for the buffer cache index for cached buffers. As IO does not use b_bn diff --git a/fs/xfs/xfs_log.c b/fs/xfs/xfs_log.c index edf20b2..40b700d 100644 --- a/fs/xfs/xfs_log.c +++ b/fs/xfs/xfs_log.c @@ -1864,7 +1864,7 @@ xlog_sync( bp->b_io_length = BTOBB(count); bp->b_fspriv = iclog; - XFS_BUF_ZEROFLAGS(bp); + bp->b_flags &= ~(XBF_FUA | XBF_FLUSH); bp->b_flags |= (XBF_ASYNC | XBF_SYNCIO | XBF_WRITE); if (log->l_mp->m_flags & XFS_MOUNT_BARRIER) { @@ -1908,7 +1908,7 @@ xlog_sync( xfs_buf_associate_memory(bp, (char *)&iclog->ic_header + count, split); bp->b_fspriv = iclog; - XFS_BUF_ZEROFLAGS(bp); + bp->b_flags &= ~(XBF_FUA | XBF_FLUSH); bp->b_flags |= (XBF_ASYNC | XBF_SYNCIO | XBF_WRITE); if (log->l_mp->m_flags & XFS_MOUNT_BARRIER) bp->b_flags |= XBF_FUA; diff --git a/fs/xfs/xfs_log_recover.c b/fs/xfs/xfs_log_recover.c index 70e4c1e..1dc0e14 100644 --- a/fs/xfs/xfs_log_recover.c +++ b/fs/xfs/xfs_log_recover.c @@ -275,7 +275,6 @@ xlog_bwrite( ASSERT(nbblks <= bp->b_length); XFS_BUF_SET_ADDR(bp, log->l_logBBstart + blk_no); - XFS_BUF_ZEROFLAGS(bp); xfs_buf_hold(bp); xfs_buf_lock(bp); bp->b_io_length = nbblks; From david@fromorbit.com Tue Feb 9 15:44:40 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=ham version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay2.corp.sgi.com [137.38.102.29]) by oss.sgi.com (Postfix) with ESMTP id 187E229DF5 for ; Tue, 9 Feb 2016 15:44:40 -0600 (CST) Received: from cuda.sgi.com (cuda1.sgi.com [192.48.157.11]) by relay2.corp.sgi.com (Postfix) with ESMTP id EF13A304039 for ; Tue, 9 Feb 2016 13:44:36 -0800 (PST) X-ASG-Debug-ID: 1455054274-04bdf066ea30c80001-NocioJ Received: from ipmail06.adl2.internode.on.net (ipmail06.adl2.internode.on.net [150.101.137.129]) by cuda.sgi.com with ESMTP id YEitfvxbisyiSc0f for ; Tue, 09 Feb 2016 13:44:34 -0800 (PST) X-Barracuda-Envelope-From: david@fromorbit.com X-Barracuda-Apparent-Source-IP: 150.101.137.129 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: A2AACACuXLpWPBATLHldKAECgw+BP4ZjgXmdWgaLZ4VFhAeGBwICAQECgTZNAQEBAQEBBwEBAQFBP4RCAQEEOhwjEAgDGAklDwUlAwcaE4gavzYBAQEBBgIBHRiFMoR/h12BDwWWeIg4hQ+OfI4/hFooLohTAQEB Received: from ppp121-44-19-16.lns20.syd4.internode.on.net (HELO dastard) ([121.44.19.16]) by ipmail06.adl2.internode.on.net with ESMTP; 10 Feb 2016 08:14:34 +1030 Received: from dave by dastard with local (Exim 4.80) (envelope-from ) id 1aTG5J-00043X-3h; Wed, 10 Feb 2016 08:44:33 +1100 Date: Wed, 10 Feb 2016 08:44:33 +1100 From: Dave Chinner To: Eric Sandeen Cc: xfs@oss.sgi.com Subject: Re: [PATCH] xfsprogs: guard fsxattr definition for newer kernels Message-ID: <20160209214433.GD14668@dastard> X-ASG-Orig-Subj: Re: [PATCH] xfsprogs: guard fsxattr definition for newer kernels References: <56BA24A9.4090403@redhat.com> <20160209195502.GR27429@dastard> <56BA4495.9060304@redhat.com> <20160209211010.GA14668@dastard> <56BA59B6.3030803@sandeen.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <56BA59B6.3030803@sandeen.net> User-Agent: Mutt/1.5.21 (2010-09-15) X-Barracuda-Connect: ipmail06.adl2.internode.on.net[150.101.137.129] X-Barracuda-Start-Time: 1455054274 X-Barracuda-URL: https://192.48.157.11:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-BRTS-Status: 1 X-Barracuda-Spam-Score: 0.00 X-Barracuda-Spam-Status: No, SCORE=0.00 using per-user scores of TAG_LEVEL=1000.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.7 tests=BSF_SC0_MISMATCH_TO X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.3.26897 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 0.00 BSF_SC0_MISMATCH_TO Envelope rcpt doesn't match header On Tue, Feb 09, 2016 at 03:27:18PM -0600, Eric Sandeen wrote: > > > On 2/9/16 3:10 PM, Dave Chinner wrote: > > On Tue, Feb 09, 2016 at 01:57:09PM -0600, Eric Sandeen wrote: > >> On 2/9/16 1:55 PM, Dave Chinner wrote: > >>> On Tue, Feb 09, 2016 at 11:40:57AM -0600, Eric Sandeen wrote: > >>>> After 334e580, > >>>> fs: XFS_IOC_FS[SG]SETXATTR to FS_IOC_FS[SG]ETXATTR promotion > >>>> > >>>> the file include/linux/fs.h now defines struct fsxattr. > >>>> > >>>> It defines FS_IOC_FSGETXATTR as well, so use that to wrap > >>>> our local definition, and skip it if the kernel is providing > >>>> it so that we don't get multiple definitions. > >>>> > >>>> Signed-off-by: Eric Sandeen > >>>> --- > >>>> > >>>> Should the kernel also #define HAVE_FSXATTR to help existing > >>>> xfsprogs-devel installations? > >>>> > >>>> (And what if headers are included in the other order? Should > >>>> we try to guard on the kernel side or no?) > >>> > >>> I've already sent a patch to fix this - it was with the foreign > >>> filesystem xfs_quota patch.... > >> > >> Oh, sorry, spaced it. > >> > >> What do you think of the HAVE_FSXATTR definition in fs.h? > > > > Which fs.h? The include/linux/fs.h file does not have such > > guards... > > If include/linux/fs.h defined HAVE_FSXATTR, a subsequent inclusion > of xfs_fs.h would not redefine the structure, because it is > guarded with that (for irix!) That's why I changed it to check if the ioctl is defined, rather than checking for HAVE_FSXATTR. Looking at it, what I probably should do is something more "special" in the platform headers, so the xfs_fs.h is kept identical across kernel and userspace... Cheers, Dave. -- Dave Chinner david@fromorbit.com From sandeen@sandeen.net Tue Feb 9 15:45:53 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=ham version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay2.corp.sgi.com [137.38.102.29]) by oss.sgi.com (Postfix) with ESMTP id C630729DF5 for ; Tue, 9 Feb 2016 15:45:53 -0600 (CST) Received: from cuda.sgi.com (cuda3.sgi.com [192.48.176.15]) by relay2.corp.sgi.com (Postfix) with ESMTP id A86C7304039 for ; Tue, 9 Feb 2016 13:45:53 -0800 (PST) X-ASG-Debug-ID: 1455054351-04cb6c1e592f9b0001-NocioJ Received: from sandeen.net (sandeen.net [63.231.237.45]) by cuda.sgi.com with ESMTP id i76CEnWEiCaWvn8e for ; Tue, 09 Feb 2016 13:45:51 -0800 (PST) X-Barracuda-Envelope-From: sandeen@sandeen.net X-Barracuda-Apparent-Source-IP: 63.231.237.45 Received: from liberator.sandeen.net (liberator.sandeen.net [10.0.0.4]) (using TLSv1.2 with cipher DHE-RSA-AES128-SHA (128/128 bits)) (No client certificate requested) by sandeen.net (Postfix) with ESMTPSA id 91FF363C607A; Tue, 9 Feb 2016 15:45:51 -0600 (CST) Subject: Re: [PATCH] xfsprogs: guard fsxattr definition for newer kernels To: Dave Chinner X-ASG-Orig-Subj: Re: [PATCH] xfsprogs: guard fsxattr definition for newer kernels References: <56BA24A9.4090403@redhat.com> <20160209195502.GR27429@dastard> <56BA4495.9060304@redhat.com> <20160209211010.GA14668@dastard> <56BA59B6.3030803@sandeen.net> <20160209214433.GD14668@dastard> Cc: xfs@oss.sgi.com From: Eric Sandeen Message-ID: <56BA5E0E.7030209@sandeen.net> Date: Tue, 9 Feb 2016 15:45:50 -0600 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.11; rv:38.0) Gecko/20100101 Thunderbird/38.5.1 MIME-Version: 1.0 In-Reply-To: <20160209214433.GD14668@dastard> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit X-Barracuda-Connect: sandeen.net[63.231.237.45] X-Barracuda-Start-Time: 1455054351 X-Barracuda-URL: https://192.48.176.15:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-BRTS-Status: 1 X-Barracuda-Spam-Score: 0.00 X-Barracuda-Spam-Status: No, SCORE=0.00 using per-user scores of TAG_LEVEL=1000.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.7 tests=BSF_SC0_MISMATCH_TO X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.3.26897 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 0.00 BSF_SC0_MISMATCH_TO Envelope rcpt doesn't match header On 2/9/16 3:44 PM, Dave Chinner wrote: > On Tue, Feb 09, 2016 at 03:27:18PM -0600, Eric Sandeen wrote: >> >> >> On 2/9/16 3:10 PM, Dave Chinner wrote: >>> On Tue, Feb 09, 2016 at 01:57:09PM -0600, Eric Sandeen wrote: >>>> On 2/9/16 1:55 PM, Dave Chinner wrote: >>>>> On Tue, Feb 09, 2016 at 11:40:57AM -0600, Eric Sandeen wrote: >>>>>> After 334e580, >>>>>> fs: XFS_IOC_FS[SG]SETXATTR to FS_IOC_FS[SG]ETXATTR promotion >>>>>> >>>>>> the file include/linux/fs.h now defines struct fsxattr. >>>>>> >>>>>> It defines FS_IOC_FSGETXATTR as well, so use that to wrap >>>>>> our local definition, and skip it if the kernel is providing >>>>>> it so that we don't get multiple definitions. >>>>>> >>>>>> Signed-off-by: Eric Sandeen >>>>>> --- >>>>>> >>>>>> Should the kernel also #define HAVE_FSXATTR to help existing >>>>>> xfsprogs-devel installations? >>>>>> >>>>>> (And what if headers are included in the other order? Should >>>>>> we try to guard on the kernel side or no?) >>>>> >>>>> I've already sent a patch to fix this - it was with the foreign >>>>> filesystem xfs_quota patch.... >>>> >>>> Oh, sorry, spaced it. >>>> >>>> What do you think of the HAVE_FSXATTR definition in fs.h? >>> >>> Which fs.h? The include/linux/fs.h file does not have such >>> guards... >> >> If include/linux/fs.h defined HAVE_FSXATTR, a subsequent inclusion >> of xfs_fs.h would not redefine the structure, because it is >> guarded with that (for irix!) > > That's why I changed it to check if the ioctl is defined, rather > than checking for HAVE_FSXATTR. Right, but I'm talking about protecting older, existing versions of xfsprogs headers which use HAVE_FSXATTR as the guard. -Eric From david@fromorbit.com Tue Feb 9 15:48:54 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=ham version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay3.corp.sgi.com [198.149.34.15]) by oss.sgi.com (Postfix) with ESMTP id 8BA8329DF5 for ; Tue, 9 Feb 2016 15:48:54 -0600 (CST) Received: from cuda.sgi.com (cuda1.sgi.com [192.48.157.11]) by relay3.corp.sgi.com (Postfix) with ESMTP id 3B473AC005 for ; Tue, 9 Feb 2016 13:48:54 -0800 (PST) X-ASG-Debug-ID: 1455054531-04bdf066ed30df0001-NocioJ Received: from ipmail06.adl2.internode.on.net (ipmail06.adl2.internode.on.net [150.101.137.129]) by cuda.sgi.com with ESMTP id SympHHJR636AqXdW for ; Tue, 09 Feb 2016 13:48:51 -0800 (PST) X-Barracuda-Envelope-From: david@fromorbit.com X-Barracuda-Apparent-Source-IP: 150.101.137.129 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: A2CxBwAfXrpWPBATLHldKAECgw+BP4ZjgXmdWgaLZ4VFhAeGBwQCAoE2TQEBAQEBAQcBAQEBQT+EQgEBBCcTHCMQCAMOCgklDwUlAwcaE4gavzYBAQEBBgIBHRiFMoR/h12BDwWSboQKjUeOfI4/hFooLohTAQEB Received: from ppp121-44-19-16.lns20.syd4.internode.on.net (HELO dastard) ([121.44.19.16]) by ipmail06.adl2.internode.on.net with ESMTP; 10 Feb 2016 08:18:51 +1030 Received: from dave by dastard with local (Exim 4.80) (envelope-from ) id 1aTG9S-000444-Ia; Wed, 10 Feb 2016 08:48:50 +1100 Date: Wed, 10 Feb 2016 08:48:50 +1100 From: Dave Chinner To: Christoph Hellwig Cc: xfs@oss.sgi.com Subject: Re: [PATCH 2/5] xfs: Introduce writeback context for writepages Message-ID: <20160209214850.GE14668@dastard> X-ASG-Orig-Subj: Re: [PATCH 2/5] xfs: Introduce writeback context for writepages References: <1454910258-7578-1-git-send-email-david@fromorbit.com> <1454910258-7578-3-git-send-email-david@fromorbit.com> <20160209133941.GA13357@infradead.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20160209133941.GA13357@infradead.org> User-Agent: Mutt/1.5.21 (2010-09-15) X-Barracuda-Connect: ipmail06.adl2.internode.on.net[150.101.137.129] X-Barracuda-Start-Time: 1455054531 X-Barracuda-URL: https://192.48.157.11:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-BRTS-Status: 1 X-Barracuda-Spam-Score: 0.00 X-Barracuda-Spam-Status: No, SCORE=0.00 using per-user scores of TAG_LEVEL=1000.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.7 tests=BSF_SC0_MISMATCH_TO X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.3.26897 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 0.00 BSF_SC0_MISMATCH_TO Envelope rcpt doesn't match header On Tue, Feb 09, 2016 at 05:39:41AM -0800, Christoph Hellwig wrote: > Removing xfs_cancel_ioend and replacing it with the start and cancel > writeback scheme that we currently only use for > xfs_setfilesize_trans_alloc failures actually seems to be the biggest > change in this patch and is entirely undocumented. Any chance you > could split this into a prep patch and properly document it? I can try. > > - > > - if (!ioend || need_ioend || type != ioend->io_type) { > > - xfs_ioend_t *previous = *result; > > - > > - ioend = xfs_alloc_ioend(inode, type); > > - ioend->io_offset = offset; > > - ioend->io_buffer_head = bh; > > - ioend->io_buffer_tail = bh; > > - if (previous) > > - previous->io_list = ioend; > > - *result = ioend; > > + if (!wpc->ioend || wpc->io_type != wpc->ioend->io_type || > > + bh->b_blocknr != wpc->last_block + 1) { > > We now start a new ioend if the blocks aren't contiguous, which seems > reasonable. But this also means the similar check in xfs_submit_ioend > should be removed at the same time. OK. -Dave. -- Dave Chinner david@fromorbit.com From BATV+8a0f1d4024691c30ef87+4552+infradead.org+hch@bombadil.srs.infradead.org Tue Feb 9 15:49:25 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=ham version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay3.corp.sgi.com [198.149.34.15]) by oss.sgi.com (Postfix) with ESMTP id 37DB629DF5 for ; Tue, 9 Feb 2016 15:49:25 -0600 (CST) Received: from cuda.sgi.com (cuda1.sgi.com [192.48.157.11]) by relay3.corp.sgi.com (Postfix) with ESMTP id CBAF7AC006 for ; Tue, 9 Feb 2016 13:49:24 -0800 (PST) X-ASG-Debug-ID: 1455054563-04bdf066ed30e10001-NocioJ Received: from bombadil.infradead.org ([198.137.202.9]) by cuda.sgi.com with ESMTP id PhrrfbmmOVHkNq1V (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128 verify=NO) for ; Tue, 09 Feb 2016 13:49:23 -0800 (PST) X-Barracuda-Envelope-From: BATV+8a0f1d4024691c30ef87+4552+infradead.org+hch@bombadil.srs.infradead.org X-Barracuda-Apparent-Source-IP: 198.137.202.9 Received: from hch by bombadil.infradead.org with local (Exim 4.80.1 #2 (Red Hat Linux)) id 1aTG9z-0008Pk-2j; Tue, 09 Feb 2016 21:49:23 +0000 Date: Tue, 9 Feb 2016 13:49:23 -0800 From: Christoph Hellwig To: Dave Chinner Cc: Christoph Hellwig , xfs@oss.sgi.com Subject: Re: [PATCH 6/6 v3] xfs: remove XFS_BUF_ZEROFLAGS macro Message-ID: <20160209214923.GA32201@infradead.org> X-ASG-Orig-Subj: Re: [PATCH 6/6 v3] xfs: remove XFS_BUF_ZEROFLAGS macro References: <1454632683-20543-1-git-send-email-david@fromorbit.com> <1454632683-20543-7-git-send-email-david@fromorbit.com> <20160208091235.GN5534@infradead.org> <20160208223120.GM27429@dastard> <20160209091632.GB23349@infradead.org> <20160209212336.GB14668@dastard> <20160209213801.GC14668@dastard> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20160209213801.GC14668@dastard> User-Agent: Mutt/1.5.24 (2015-08-30) X-SRS-Rewrite: SMTP reverse-path rewritten from by bombadil.infradead.org See http://www.infradead.org/rpr.html X-Barracuda-Connect: UNKNOWN[198.137.202.9] X-Barracuda-Start-Time: 1455054563 X-Barracuda-Encrypted: ECDHE-RSA-AES128-GCM-SHA256 X-Barracuda-URL: https://192.48.157.11:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-Spam-Score: 0.10 X-Barracuda-Spam-Status: No, SCORE=0.10 using per-user scores of TAG_LEVEL=1000.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.7 tests=BSF_SC0_MISMATCH_TO, RDNS_NONE X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.3.26897 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 0.00 BSF_SC0_MISMATCH_TO Envelope rcpt doesn't match header 0.10 RDNS_NONE Delivered to trusted network by a host with no rDNS Looks good, Reviewed-by: Christoph Hellwig From david@fromorbit.com Tue Feb 9 15:51:39 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=ham version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay2.corp.sgi.com [137.38.102.29]) by oss.sgi.com (Postfix) with ESMTP id C586229DF5 for ; Tue, 9 Feb 2016 15:51:39 -0600 (CST) Received: from cuda.sgi.com (cuda1.sgi.com [192.48.157.11]) by relay2.corp.sgi.com (Postfix) with ESMTP id 8A789304048 for ; Tue, 9 Feb 2016 13:51:39 -0800 (PST) X-ASG-Debug-ID: 1455054695-04bdf066ed30eb0001-NocioJ Received: from ipmail06.adl2.internode.on.net (ipmail06.adl2.internode.on.net [150.101.137.129]) by cuda.sgi.com with ESMTP id 6TgFFFEBg0CPGfJr for ; Tue, 09 Feb 2016 13:51:36 -0800 (PST) X-Barracuda-Envelope-From: david@fromorbit.com X-Barracuda-Apparent-Source-IP: 150.101.137.129 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: A2CxBwAfXrpWPBATLHlVCCgBAoMPgT+GY4F5nVoGi2eFRYQHhgcEAgKBNk0BAQEBAQEHAQEBAUE/hEIBAQQ6HCMQCAMOCgklDwUlAwcaE4gavzYBAQEBBgIBHRiFMoR/hA6DT4EPBZZ4jUeOfI4/hFooLohTAQEB Received: from ppp121-44-19-16.lns20.syd4.internode.on.net (HELO dastard) ([121.44.19.16]) by ipmail06.adl2.internode.on.net with ESMTP; 10 Feb 2016 08:21:35 +1030 Received: from dave by dastard with local (Exim 4.80) (envelope-from ) id 1aTGC6-00044t-Ra; Wed, 10 Feb 2016 08:51:34 +1100 Date: Wed, 10 Feb 2016 08:51:34 +1100 From: Dave Chinner To: Brian Foster Cc: xfs@oss.sgi.com Subject: Re: [PATCH 2/5] xfs: Introduce writeback context for writepages Message-ID: <20160209215134.GF14668@dastard> X-ASG-Orig-Subj: Re: [PATCH 2/5] xfs: Introduce writeback context for writepages References: <1454910258-7578-1-git-send-email-david@fromorbit.com> <1454910258-7578-3-git-send-email-david@fromorbit.com> <20160209142224.GA25829@bfoster.bfoster> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20160209142224.GA25829@bfoster.bfoster> User-Agent: Mutt/1.5.21 (2010-09-15) X-Barracuda-Connect: ipmail06.adl2.internode.on.net[150.101.137.129] X-Barracuda-Start-Time: 1455054695 X-Barracuda-URL: https://192.48.157.11:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-BRTS-Status: 1 X-Barracuda-Spam-Score: 0.00 X-Barracuda-Spam-Status: No, SCORE=0.00 using per-user scores of TAG_LEVEL=1000.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.7 tests=BSF_SC0_MISMATCH_TO X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.3.26898 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 0.00 BSF_SC0_MISMATCH_TO Envelope rcpt doesn't match header On Tue, Feb 09, 2016 at 09:22:26AM -0500, Brian Foster wrote: > On Mon, Feb 08, 2016 at 04:44:15PM +1100, Dave Chinner wrote: > > + /* > > + * We have to fail the iohead here because we buffers locked in the > > + * ioend chain. If we don't do this, we'll deadlock invalidating the > > + * page as that tries to lock the buffers on the page. Also, because we > > + * have set pages under writeback, we have to run IO completion to mark > > + * the error state of the IO appropriately, so we can't cancel the ioend > > + * directly here. That means we have to mark this page as under > > + * writeback if we included any buffers from it in the ioend chain. > > + */ > > + if (count) > > + xfs_start_page_writeback(page, 0, count); > > + xfs_writepage_submit(wpc, wbc, err); > > We make the xfs_writepage_submit() error case call here because... ... > > STATIC int > > +xfs_vm_writepage( > > + struct page *page, > > + struct writeback_control *wbc) > > +{ > > + struct xfs_writepage_ctx wpc = { > > + .io_type = XFS_IO_OVERWRITE, > > + }; > > + int ret; > > + > > + ret = xfs_do_writepage(page, wbc, &wpc); > > + if (ret) > > + return ret; > > + return xfs_writepage_submit(&wpc, wbc, ret); > > > ... the callers only call it when ret == 0. Can we eliminate the error > call down in xfs_do_writepage() and just invoke this consistently from > the writepage(s) callers? Probably - I think this is left over from an early concoction that exploded badly when it was stirred too vigorously... Cheers, Dave. -- Dave Chinner david@fromorbit.com From darrick.wong@oracle.com Tue Feb 9 15:51:58 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay2.corp.sgi.com [137.38.102.29]) by oss.sgi.com (Postfix) with ESMTP id 140F729DFE for ; Tue, 9 Feb 2016 15:51:58 -0600 (CST) Received: from cuda.sgi.com (cuda1.sgi.com [192.48.157.11]) by relay2.corp.sgi.com (Postfix) with ESMTP id DB5F7304051 for ; Tue, 9 Feb 2016 13:51:57 -0800 (PST) X-ASG-Debug-ID: 1455054714-04bdf066ed30ee0001-NocioJ Received: from userp1040.oracle.com (userp1040.oracle.com [156.151.31.81]) by cuda.sgi.com with ESMTP id qbCqG8bnQfGs7DId (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO) for ; Tue, 09 Feb 2016 13:51:55 -0800 (PST) X-Barracuda-Envelope-From: darrick.wong@oracle.com X-Barracuda-Apparent-Source-IP: 156.151.31.81 Received: from aserv0022.oracle.com (aserv0022.oracle.com [141.146.126.234]) by userp1040.oracle.com (Sentrion-MTA-4.3.2/Sentrion-MTA-4.3.2) with ESMTP id u19LpqxX016872 (version=TLSv1 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Tue, 9 Feb 2016 21:51:53 GMT Received: from userv0122.oracle.com (userv0122.oracle.com [156.151.31.75]) by aserv0022.oracle.com (8.13.8/8.13.8) with ESMTP id u19Lpqn8018860 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=FAIL); Tue, 9 Feb 2016 21:51:52 GMT Received: from abhmp0012.oracle.com (abhmp0012.oracle.com [141.146.116.18]) by userv0122.oracle.com (8.14.4/8.14.4) with ESMTP id u19Lppo5025467; Tue, 9 Feb 2016 21:51:51 GMT Received: from localhost (/10.145.178.207) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Tue, 09 Feb 2016 13:51:51 -0800 Date: Tue, 9 Feb 2016 13:51:49 -0800 From: "Darrick J. Wong" To: Dave Chinner Cc: fstests@vger.kernel.org, linux-btrfs@vger.kernel.org, xfs@oss.sgi.com Subject: Re: [PATCH 21/23] xfs: aio cow tests Message-ID: <20160209215149.GD6350@birch.djwong.org> X-ASG-Orig-Subj: Re: [PATCH 21/23] xfs: aio cow tests References: <20160209011145.23099.95354.stgit@birch.djwong.org> <20160209011401.23099.38.stgit@birch.djwong.org> <20160209083215.GP19486@dastard> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20160209083215.GP19486@dastard> User-Agent: Mutt/1.5.21 (2010-09-15) X-Source-IP: aserv0022.oracle.com [141.146.126.234] X-Barracuda-Connect: userp1040.oracle.com[156.151.31.81] X-Barracuda-Start-Time: 1455054714 X-Barracuda-Encrypted: ECDHE-RSA-AES256-GCM-SHA384 X-Barracuda-URL: https://192.48.157.11:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-BRTS-Status: 1 X-Barracuda-Spam-Score: 0.00 X-Barracuda-Spam-Status: No, SCORE=0.00 using per-user scores of TAG_LEVEL=1000.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.7 tests=BSF_SC0_MISMATCH_TO, UNPARSEABLE_RELAY X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.3.26898 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 0.00 BSF_SC0_MISMATCH_TO Envelope rcpt doesn't match header 0.00 UNPARSEABLE_RELAY Informational: message has unparseable relay lines On Tue, Feb 09, 2016 at 07:32:15PM +1100, Dave Chinner wrote: > On Mon, Feb 08, 2016 at 05:14:01PM -0800, Darrick J. Wong wrote: > .,,, > > + > > +echo "Check for damage" > > +_dmerror_unmount > > +_dmerror_cleanup > > +_repair_scratch_fs >> "$seqres.full" 2>&1 > > Are you testing repair here? If so, why doesn't failure matter. > If not, why do it? Or is _require_scratch_nocheck all that is needed > here? Uggghhh.... so xfs_repair dumps its regular output to stderr, so the "2>&1" pushes the output to $seqres.full. The return codes from xfs_repair seem to be: 0: fs is ok now 1: fs is probably broken 2: log needs to be replayed The return codes from fsck seem to be: 0: no errors found 1: errors fixed 2: errors fixed, reboot required (etc) So I guess the way out is to provide a better wrapper to the repair tools so that _repair_scratch_fs always returns 0 for "fs should be ok now" and nonzero otherwise: _repair_scratch_fs() { case $FSTYP in xfs) _scratch_xfs_repair "$@" 2>&1 res=$? if [ "$res" -eq 2 ]; then echo "xfs_repair returns $res; replay log?" _scratch_mount res=$? if [ "$res" -gt 0 ]; then echo "mount returns $res; zap log?" _scratch_xfs_repair -L 2>&1 echo "log zap returns $?" else umount "$SCRATCH_MNT" fi _scratch_xfs_repair "$@" 2>&1 res=$? fi test $res -ne 0 && >&2 echo "xfs_repair failed, err=$res" return $res ;; *) # Let's hope fsck -y suffices... fsck -t $FSTYP -y $SCRATCH_DEV 2>&1 res=$? case $res in 0|1|2) res=0 ;; *) >&2 echo "fsck.$FSTYP failed, err=$res" ;; esac return $res ;; esac } > > +echo "CoW and unmount" > > +"$XFS_IO_PROG" -f -c "pwrite -S 0x63 $((blksz * bsz)) 1" "$testdir/file2" >> "$seqres.full" > > +"$XFS_IO_PROG" -f -c "pwrite -S 0x63 -b $((blksz * bsz)) 0 $((blksz * nr))" "$TEST_DIR/moo" >> "$seqres.full" > > offset = block size times block size? > > I think some better names might be needed... Yes. Is now "bufnr" and bufsize=$((blksz * bufnr)). --D > > Cheers, > > Dave. > -- > Dave Chinner > david@fromorbit.com > > _______________________________________________ > xfs mailing list > xfs@oss.sgi.com > http://oss.sgi.com/mailman/listinfo/xfs From david@fromorbit.com Tue Feb 9 15:52:47 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=ham version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay1.corp.sgi.com [137.38.102.111]) by oss.sgi.com (Postfix) with ESMTP id 63C3C29DF6 for ; Tue, 9 Feb 2016 15:52:47 -0600 (CST) Received: from cuda.sgi.com (cuda1.sgi.com [192.48.157.11]) by relay1.corp.sgi.com (Postfix) with ESMTP id 4713A8F8064 for ; Tue, 9 Feb 2016 13:52:47 -0800 (PST) X-ASG-Debug-ID: 1455054761-04bdf066ec30f10001-NocioJ Received: from ipmail06.adl2.internode.on.net (ipmail06.adl2.internode.on.net [150.101.137.129]) by cuda.sgi.com with ESMTP id ee6bG7mBA9H4HTmF for ; Tue, 09 Feb 2016 13:52:41 -0800 (PST) X-Barracuda-Envelope-From: david@fromorbit.com X-Barracuda-Apparent-Source-IP: 150.101.137.129 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: A2CwBwBBX7pWPBATLHldKAECgw+BP4ZjgXmdYItnhUWEB4YHBAICgTZNAQEBAQEBBwEBAQFBP4RCAQEEJxMcIxAIAw4KCSUPBSUDBxoTiBq/NAEBCAIeGIUyhH+BNgGHNQWWeI1HgWSHaYUvjj+CcoFoKC6IUwEBAQ Received: from ppp121-44-19-16.lns20.syd4.internode.on.net (HELO dastard) ([121.44.19.16]) by ipmail06.adl2.internode.on.net with ESMTP; 10 Feb 2016 08:22:41 +1030 Received: from dave by dastard with local (Exim 4.80) (envelope-from ) id 1aTGDA-000454-GX; Wed, 10 Feb 2016 08:52:40 +1100 Date: Wed, 10 Feb 2016 08:52:40 +1100 From: Dave Chinner To: Christoph Hellwig Cc: xfs@oss.sgi.com Subject: Re: [PATCH 5/5] xfs: don't chain ioends during writepage submission Message-ID: <20160209215240.GG14668@dastard> X-ASG-Orig-Subj: Re: [PATCH 5/5] xfs: don't chain ioends during writepage submission References: <1454910258-7578-1-git-send-email-david@fromorbit.com> <1454910258-7578-6-git-send-email-david@fromorbit.com> <20160209134930.GD13357@infradead.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20160209134930.GD13357@infradead.org> User-Agent: Mutt/1.5.21 (2010-09-15) X-Barracuda-Connect: ipmail06.adl2.internode.on.net[150.101.137.129] X-Barracuda-Start-Time: 1455054761 X-Barracuda-URL: https://192.48.157.11:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-BRTS-Status: 1 X-Barracuda-Spam-Score: 0.00 X-Barracuda-Spam-Status: No, SCORE=0.00 using per-user scores of TAG_LEVEL=1000.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.7 tests=BSF_SC0_MISMATCH_TO X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.3.26898 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 0.00 BSF_SC0_MISMATCH_TO Envelope rcpt doesn't match header On Tue, Feb 09, 2016 at 05:49:30AM -0800, Christoph Hellwig wrote: > > +STATIC struct xfs_ioend * > > xfs_add_to_ioend( > > struct inode *inode, > > struct buffer_head *bh, > > xfs_off_t offset, > > struct xfs_writepage_ctx *wpc) > > { > > + struct xfs_ioend *ioend_to_submit = NULL; > > Maybe just > > struct xfs_ioend *prev = NULL; > > to be a little less verbose? *nod* > > + if (wpc->ioend) > > + xfs_submit_ioend(wbc, wpc->ioend, status); > > return status; > > } > > With this change xfs_writepage_submit is rather pointless, I'd > rather open code it in the callers. Yup. > > > + ioend = xfs_add_to_ioend(inode, bh, offset, wpc); > > + if (ioend) { > > + ioend->io_list = NULL; > > + if (!ioend_to_submit) > > + ioend_to_submit = ioend; > > + else > > + ioend_tail->io_list = ioend; > > + ioend_tail = ioend; > > + } > > Just using a list_head for this is a lot easier to read and less > error prone at the cost of a single additional pointer in the ioend. OK. I'll see what I can do here. Cheers, Dave. -- Dave Chinner david@fromorbit.com From david@fromorbit.com Tue Feb 9 15:59:04 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=ham version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay1.corp.sgi.com [137.38.102.111]) by oss.sgi.com (Postfix) with ESMTP id D3F5C29DF6 for ; Tue, 9 Feb 2016 15:59:04 -0600 (CST) Received: from cuda.sgi.com (cuda2.sgi.com [192.48.176.25]) by relay1.corp.sgi.com (Postfix) with ESMTP id C36618F804B for ; Tue, 9 Feb 2016 13:59:04 -0800 (PST) X-ASG-Debug-ID: 1455055141-04cbb0433346600001-NocioJ Received: from ipmail06.adl2.internode.on.net (ipmail06.adl2.internode.on.net [150.101.137.129]) by cuda.sgi.com with ESMTP id gJocx9nEvIaERWXX for ; Tue, 09 Feb 2016 13:59:02 -0800 (PST) X-Barracuda-Envelope-From: david@fromorbit.com X-Barracuda-Apparent-Source-IP: 150.101.137.129 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: A2CwBwB8YLpWPBATLHldKAECgw+BP4ZjgXmdYItnhUWEB4YHBAICgTdNAQEBAQEBBwEBAQFBP4RCAQEEJxMcIxAIAw4KCSUPBSUDBxoTiBq/MQEBAQcCHhiFMoR/gTYBhzUFlniNR4FkhEOIVY4/gmUNDIFcKC6IUwEBAQ Received: from ppp121-44-19-16.lns20.syd4.internode.on.net (HELO dastard) ([121.44.19.16]) by ipmail06.adl2.internode.on.net with ESMTP; 10 Feb 2016 08:29:00 +1030 Received: from dave by dastard with local (Exim 4.80) (envelope-from ) id 1aTGJI-000468-Ar; Wed, 10 Feb 2016 08:59:00 +1100 Date: Wed, 10 Feb 2016 08:59:00 +1100 From: Dave Chinner To: Brian Foster Cc: xfs@oss.sgi.com Subject: Re: [PATCH 5/5] xfs: don't chain ioends during writepage submission Message-ID: <20160209215900.GH14668@dastard> X-ASG-Orig-Subj: Re: [PATCH 5/5] xfs: don't chain ioends during writepage submission References: <1454910258-7578-1-git-send-email-david@fromorbit.com> <1454910258-7578-6-git-send-email-david@fromorbit.com> <20160209142355.GB25829@bfoster.bfoster> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20160209142355.GB25829@bfoster.bfoster> User-Agent: Mutt/1.5.21 (2010-09-15) X-Barracuda-Connect: ipmail06.adl2.internode.on.net[150.101.137.129] X-Barracuda-Start-Time: 1455055141 X-Barracuda-URL: https://192.48.176.25:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-BRTS-Status: 1 X-Barracuda-Spam-Score: 0.00 X-Barracuda-Spam-Status: No, SCORE=0.00 using per-user scores of TAG_LEVEL=1000.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.7 tests=BSF_SC0_MISMATCH_TO X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.3.26898 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 0.00 BSF_SC0_MISMATCH_TO Envelope rcpt doesn't match header On Tue, Feb 09, 2016 at 09:23:55AM -0500, Brian Foster wrote: > On Mon, Feb 08, 2016 at 04:44:18PM +1100, Dave Chinner wrote: > > @@ -738,29 +726,22 @@ xfs_writepage_submit( > > struct writeback_control *wbc, > > int status) > > { > > - struct blk_plug plug; > > - > > - /* Reserve log space if we might write beyond the on-disk inode size. */ > > - if (!status && wpc->ioend && wpc->ioend->io_type != XFS_IO_UNWRITTEN && > > - xfs_ioend_is_append(wpc->ioend)) > > - status = xfs_setfilesize_trans_alloc(wpc->ioend); > > - > > - if (wpc->iohead) { > > - blk_start_plug(&plug); > > - xfs_submit_ioend(wbc, wpc->iohead, status); > > - blk_finish_plug(&plug); > > - } > > We've dropped our plug here but I don't see anything added in > xfs_vm_writepages(). Shouldn't we have one there now that ioends are > submitted as we go? generic_writepages() uses one around its > write_cache_pages() call.. It's not really necessary, as we now have higher level plugging in the writeback go will get flushed on context switch, and if we don't have a high level plug (e.g. fsync triggered writeback), then we submit the IO immediately, just like flushing the plug here would do anyway.... > > @@ -827,23 +808,37 @@ xfs_writepage_map( > > offset); > > } > > if (wpc->imap_valid) { > > + struct xfs_ioend *ioend; > > + > > lock_buffer(bh); > > if (wpc->io_type != XFS_IO_OVERWRITE) > > xfs_map_at_offset(inode, bh, &wpc->imap, offset); > > - xfs_add_to_ioend(inode, bh, offset, wpc); > > "Big picture" comment here please, i.e. something along the lines of > (feel free to rewrite/fix/enhance): > > "This implements an immediate ioend submission policy. If a new ioend is > required, the old ioend is returned and slated for submission on > function exit. The purpose of this policy is to avoid creating and > holding large chains of ioend objects in memory. While ioends are > submitted immediately after they are completed, block plugging helps > provide batching." I can add something like that to the function. > > - else { > > + while (ioend_to_submit) { > > + struct xfs_ioend *next = ioend_to_submit->io_list; > > + > > + ioend_to_submit->io_list = NULL; > > + xfs_submit_ioend(wbc, ioend_to_submit, 0); > > + ioend_to_submit = next; > > + } > > + } else { > > xfs_aops_discard_page(page); > > ClearPageUptodate(page); > > unlock_page(page); > > If we have an error and count == 0, we know that ioend_to_submit is NULL > because that is only potentially set once the first buffer is added. > That said, this doesn't mean that we don't have an ioend waiting on the > wpc. If we do, we still return the error and the ioend is errored out. > > I wonder if that is really necessary if we haven't added any buffers > from the page..? Could we submit the ioend properly in that case? OTOH, > that might complicate the error reporting and an error here might be > serious enough that it isn't worth it, as opposed to just making sure we > clean up everything appropriately. The way I've done it is the same as the existing code - on error the entire ioend chain that has been built is errored out. I'd prefer to keep it that way right now to minimise the potential behavioural changes of the patch series. We can look to changing to partial submission in a separate patch set if it makes sense to do so. Cheers, Dave. -- Dave Chinner david@fromorbit.com From david@fromorbit.com Tue Feb 9 16:38:05 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=ham version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay3.corp.sgi.com [198.149.34.15]) by oss.sgi.com (Postfix) with ESMTP id 8BFAF29DF5 for ; Tue, 9 Feb 2016 16:38:05 -0600 (CST) Received: from cuda.sgi.com (cuda2.sgi.com [192.48.176.25]) by relay3.corp.sgi.com (Postfix) with ESMTP id 0BCE3AC006 for ; Tue, 9 Feb 2016 14:38:01 -0800 (PST) X-ASG-Debug-ID: 1455057478-04cbb0433247120001-NocioJ Received: from ipmail06.adl2.internode.on.net (ipmail06.adl2.internode.on.net [150.101.137.129]) by cuda.sgi.com with ESMTP id 9G2n4w8RVMiIXiii for ; Tue, 09 Feb 2016 14:37:58 -0800 (PST) X-Barracuda-Envelope-From: david@fromorbit.com X-Barracuda-Apparent-Source-IP: 150.101.137.129 Received: from ppp121-44-19-16.lns20.syd4.internode.on.net (HELO dastard) ([121.44.19.16]) by ipmail06.adl2.internode.on.net with ESMTP; 10 Feb 2016 09:07:30 +1030 Received: from dave by dastard with local (Exim 4.80) (envelope-from ) id 1aTGuH-0004Ar-49; Wed, 10 Feb 2016 09:37:13 +1100 Date: Wed, 10 Feb 2016 09:37:13 +1100 From: Dave Chinner To: Eric Sandeen Cc: xfs@oss.sgi.com Subject: Re: [PATCH] xfsprogs: guard fsxattr definition for newer kernels Message-ID: <20160209223713.GI14668@dastard> X-ASG-Orig-Subj: Re: [PATCH] xfsprogs: guard fsxattr definition for newer kernels References: <56BA24A9.4090403@redhat.com> <20160209195502.GR27429@dastard> <56BA4495.9060304@redhat.com> <20160209211010.GA14668@dastard> <56BA59B6.3030803@sandeen.net> <20160209214433.GD14668@dastard> <56BA5E0E.7030209@sandeen.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <56BA5E0E.7030209@sandeen.net> User-Agent: Mutt/1.5.21 (2010-09-15) X-Barracuda-Connect: ipmail06.adl2.internode.on.net[150.101.137.129] X-Barracuda-Start-Time: 1455057478 X-Barracuda-URL: https://192.48.176.25:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-BRTS-Status: 1 X-Barracuda-Spam-Score: 0.00 X-Barracuda-Spam-Status: No, SCORE=0.00 using per-user scores of TAG_LEVEL=1000.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.7 tests=BSF_SC0_MISMATCH_TO X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.3.26899 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 0.00 BSF_SC0_MISMATCH_TO Envelope rcpt doesn't match header On Tue, Feb 09, 2016 at 03:45:50PM -0600, Eric Sandeen wrote: > > > On 2/9/16 3:44 PM, Dave Chinner wrote: > > On Tue, Feb 09, 2016 at 03:27:18PM -0600, Eric Sandeen wrote: > >> > >> > >> On 2/9/16 3:10 PM, Dave Chinner wrote: > >>> On Tue, Feb 09, 2016 at 01:57:09PM -0600, Eric Sandeen wrote: > >>>> On 2/9/16 1:55 PM, Dave Chinner wrote: > >>>>> On Tue, Feb 09, 2016 at 11:40:57AM -0600, Eric Sandeen wrote: > >>>>>> After 334e580, > >>>>>> fs: XFS_IOC_FS[SG]SETXATTR to FS_IOC_FS[SG]ETXATTR promotion > >>>>>> > >>>>>> the file include/linux/fs.h now defines struct fsxattr. > >>>>>> > >>>>>> It defines FS_IOC_FSGETXATTR as well, so use that to wrap > >>>>>> our local definition, and skip it if the kernel is providing > >>>>>> it so that we don't get multiple definitions. > >>>>>> > >>>>>> Signed-off-by: Eric Sandeen > >>>>>> --- > >>>>>> > >>>>>> Should the kernel also #define HAVE_FSXATTR to help existing > >>>>>> xfsprogs-devel installations? > >>>>>> > >>>>>> (And what if headers are included in the other order? Should > >>>>>> we try to guard on the kernel side or no?) > >>>>> > >>>>> I've already sent a patch to fix this - it was with the foreign > >>>>> filesystem xfs_quota patch.... > >>>> > >>>> Oh, sorry, spaced it. > >>>> > >>>> What do you think of the HAVE_FSXATTR definition in fs.h? > >>> > >>> Which fs.h? The include/linux/fs.h file does not have such > >>> guards... > >> > >> If include/linux/fs.h defined HAVE_FSXATTR, a subsequent inclusion > >> of xfs_fs.h would not redefine the structure, because it is > >> guarded with that (for irix!) > > > > That's why I changed it to check if the ioctl is defined, rather > > than checking for HAVE_FSXATTR. > > Right, but I'm talking about protecting older, existing versions of > xfsprogs headers which use HAVE_FSXATTR as the guard. Nothing we can really do about that. There's no way we can get random unused defines into general linux uapi header files. If a distro updates their kernel to 4.5 and hence introduces this general definition, then they also be upgrading xfsprogs to match. If a user has upgraded their kernel and then tries to build xfsprogs from source, then they are also going to need to update xfsprogs... Cheers, Dave. -- Dave Chinner david@fromorbit.com From manr@utem.com Tue Feb 9 16:54:11 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: ** X-Spam-Status: No, score=2.0 required=5.0 tests=DEAR_SOMETHING,HTML_MESSAGE autolearn=no version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay2.corp.sgi.com [137.38.102.29]) by oss.sgi.com (Postfix) with ESMTP id 0B1A629DF5 for ; Tue, 9 Feb 2016 16:54:11 -0600 (CST) Received: from cuda.sgi.com (cuda1.sgi.com [192.48.157.11]) by relay2.corp.sgi.com (Postfix) with ESMTP id A726D304043 for ; Tue, 9 Feb 2016 14:54:10 -0800 (PST) X-ASG-Debug-ID: 1455058444-04bdf066ec32130001-NocioJ Received: from dimj.com (67.229.225.53.static.krypt.com [67.229.225.53]) by cuda.sgi.com with ESMTP id EIftAFGIBImHReyh for ; Tue, 09 Feb 2016 14:54:05 -0800 (PST) X-Barracuda-Envelope-From: manr@utem.com X-Barracuda-Apparent-Source-IP: 67.229.225.53 Received: from sunny-PC ([127.0.0.1]) by localhost via TCP with ESMTPA; Wed, 10 Feb 2016 06:54:27 +0800 Disposition-Notification-To: mrrcym@126.com MIME-Version: 1.0 From: "Emma Ma" Sender: "Emma Ma" To: xfs@oss.sgi.com Reply-To: "Emma Ma" Date: 10 Feb 2016 06:54:27 +0800 Subject: =?utf-8?B?QWxOaUNPIG1hZ25ldCBhbmQgRmVDckNvIG1hZ25ldCB0byB4ZnM=?= Content-Type: multipart/alternative; boundary=--boundary_53430_bc01a750-dd61-47d5-8d0e-7a2a965f2d53 X-ASG-Orig-Subj: =?utf-8?B?QWxOaUNPIG1hZ25ldCBhbmQgRmVDckNvIG1hZ25ldCB0byB4ZnM=?= X-Barracuda-Connect: 67.229.225.53.static.krypt.com[67.229.225.53] X-Barracuda-Start-Time: 1455058444 X-Barracuda-URL: https://192.48.157.11:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-BRTS-Status: 1 X-Barracuda-Spam-Score: 0.14 X-Barracuda-Spam-Status: No, SCORE=0.14 using per-user scores of TAG_LEVEL=1000.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.7 tests=HTML_MESSAGE, MISSING_MID X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.3.26899 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 0.14 MISSING_MID Missing Message-Id: header 0.00 HTML_MESSAGE BODY: HTML included in message Message-Id: <20160209225410.500DDA420A8@cuda.sgi.com> ----boundary_53430_bc01a750-dd61-47d5-8d0e-7a2a965f2d53 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: base64 DQoNCkRlYXIgU2lyIG9yIE1hZGFtLA0KDQombmJzcDsNCg0KJm5ic3A7DQoNCiZuYnNwOw0K DQombmJzcDsNCg0KJm5ic3A7DQoNCiZuYnNwOw0KDQombmJzcDsNCg0KJm5ic3A7DQoNCiZu YnNwOw0KDQoNCg0KDQoNCiZuYnNwOw0KV2UgcHJvZHVjZSBBbE5pQ28gbWFnbmV0IGFuZCZu YnNwO0ZlQ3JDbyZuYnNwO21hZ25ldCB3aXRoIGNvbXBldGl0aXZlIHByaWNlIGFuZCBiZXN0 IHF1YWxpdHkgaW4gQ2hpbmEuDQombmJzcDsNCktpbmRseSBwbGVhc2UgY29udGFjdCBtZSBp ZiB5b3UgaW50ZXJlc3RlZC4NCiZuYnNwOw0KQmVzdCByZWdhcmRzLA0KJm5ic3A7DQombmJz cDsNCkVtbWEgTWENCiZuYnNwOw0KDQpOaW5nYm8gU1NEIE1hZ25ldGljcyBDbyBMdGQNCkFk ZDpTaW1lbiBpbmR1c3RyaWFsIHBhcmsseXV5YW8mbmJzcDssWmhlamlhbmcsQ2hpbmENClRl bDombmJzcDsrODYtNTc0LTYyMTU4ODgzRmF4OiZuYnNwOys4Ni01NzQtNjIxNTg4ODUNCk1v YmlsZTorODYtMTU4NTc0Njk2MDkNCldlYnNpdGU6Jm5ic3A7d3d3Lm1hZ25ldC1uYnNzZC5j b20mbmJzcDtFbWFpbDpFbW1hQG1hZ25ldC1uYnNzZC5jb20NCiZuYnNwOw0KJm5ic3A7DQoN Cg0KDQoNCiZuYnNwOw0KDQombmJzcDsNCklmIGRpc3R1cmIgLHBscyB1bnN1YnNjcmliZQ0K Jm5ic3A7DQombmJzcDs= ----boundary_53430_bc01a750-dd61-47d5-8d0e-7a2a965f2d53 Content-Type: text/html; charset=utf-8 Content-Transfer-Encoding: base64 PERJViBzdHlsZT0iRk9OVC1GQU1JTFk6IGFyaWFsIj4NCjxESVYgc3R5bGU9IkZPTlQtRkFN SUxZOiBhcmlhbCI+DQo8RElWIHN0eWxlPSJURVhULVRSQU5TRk9STTogbm9uZTsgQkFDS0dS T1VORC1DT0xPUjogcmdiKDI1NSwyNTUsMjU1KTsgRk9OVC1WQVJJQU5UOiBub3JtYWw7IEZP TlQtU1RZTEU6IG5vcm1hbDsgVEVYVC1JTkRFTlQ6IDBweDsgRElTUExBWTogaW5saW5lOyBG T05ULUZBTUlMWTogQ2FsaWJyaTsgV0hJVEUtU1BBQ0U6IG5vcm1hbDsgTEVUVEVSLVNQQUNJ Tkc6IG5vcm1hbDsgQ09MT1I6IHJnYigwLDAsMCk7IEZPTlQtU0laRTogc21hbGw7IEZPTlQt V0VJR0hUOiBub3JtYWw7IFdPUkQtU1BBQ0lORzogMHB4OyBURVhULURFQ09SQVRJT046IG5v bmU7IC13ZWJraXQtdGV4dC1zdHJva2Utd2lkdGg6IDBweCI+PEZPTlQgZmFjZT0iVGltZXMg TmV3IFJvbWFuIj5EZWFyIFNpciBvciBNYWRhbSw8L0ZPTlQ+PC9ESVY+PC9ESVY+DQo8RElW IHN0eWxlPSJGT05ULUZBTUlMWTogYXJpYWwiPg0KPERJViBzdHlsZT0iVEVYVC1UUkFOU0ZP Uk06IG5vbmU7IEJBQ0tHUk9VTkQtQ09MT1I6IHJnYigyNTUsMjU1LDI1NSk7IEZPTlQtVkFS SUFOVDogbm9ybWFsOyBGT05ULVNUWUxFOiBub3JtYWw7IFRFWFQtSU5ERU5UOiAwcHg7IERJ U1BMQVk6IGlubGluZTsgRk9OVC1GQU1JTFk6IENhbGlicmk7IFdISVRFLVNQQUNFOiBub3Jt YWw7IExFVFRFUi1TUEFDSU5HOiBub3JtYWw7IENPTE9SOiByZ2IoMCwwLDApOyBGT05ULVNJ WkU6IHNtYWxsOyBGT05ULVdFSUdIVDogbm9ybWFsOyBXT1JELVNQQUNJTkc6IDBweDsgVEVY VC1ERUNPUkFUSU9OOiBub25lOyAtd2Via2l0LXRleHQtc3Ryb2tlLXdpZHRoOiAwcHgiPjxG T05UIGZhY2U9IlRpbWVzIE5ldyBSb21hbiI+PC9GT05UPiZuYnNwOzwvRElWPjwvRElWPg0K PERJViBzdHlsZT0iRk9OVC1GQU1JTFk6IGFyaWFsIj4NCjxESVYgc3R5bGU9IlRFWFQtVFJB TlNGT1JNOiBub25lOyBCQUNLR1JPVU5ELUNPTE9SOiByZ2IoMjU1LDI1NSwyNTUpOyBGT05U LVZBUklBTlQ6IG5vcm1hbDsgRk9OVC1TVFlMRTogbm9ybWFsOyBURVhULUlOREVOVDogMHB4 OyBESVNQTEFZOiBpbmxpbmU7IEZPTlQtRkFNSUxZOiBDYWxpYnJpOyBXSElURS1TUEFDRTog bm9ybWFsOyBMRVRURVItU1BBQ0lORzogbm9ybWFsOyBDT0xPUjogcmdiKDAsMCwwKTsgRk9O VC1TSVpFOiBzbWFsbDsgRk9OVC1XRUlHSFQ6IG5vcm1hbDsgV09SRC1TUEFDSU5HOiAwcHg7 IFRFWFQtREVDT1JBVElPTjogbm9uZTsgLXdlYmtpdC10ZXh0LXN0cm9rZS13aWR0aDogMHB4 Ij48Rk9OVCBmYWNlPSJUaW1lcyBOZXcgUm9tYW4iPjwvRk9OVD4mbmJzcDs8L0RJVj48L0RJ Vj4NCjxESVYgc3R5bGU9IkZPTlQtRkFNSUxZOiBhcmlhbCI+DQo8RElWIHN0eWxlPSJURVhU LVRSQU5TRk9STTogbm9uZTsgQkFDS0dST1VORC1DT0xPUjogcmdiKDI1NSwyNTUsMjU1KTsg Rk9OVC1WQVJJQU5UOiBub3JtYWw7IEZPTlQtU1RZTEU6IG5vcm1hbDsgVEVYVC1JTkRFTlQ6 IDBweDsgRElTUExBWTogaW5saW5lOyBGT05ULUZBTUlMWTogQ2FsaWJyaTsgV0hJVEUtU1BB Q0U6IG5vcm1hbDsgTEVUVEVSLVNQQUNJTkc6IG5vcm1hbDsgQ09MT1I6IHJnYigwLDAsMCk7 IEZPTlQtU0laRTogc21hbGw7IEZPTlQtV0VJR0hUOiBub3JtYWw7IFdPUkQtU1BBQ0lORzog MHB4OyBURVhULURFQ09SQVRJT046IG5vbmU7IC13ZWJraXQtdGV4dC1zdHJva2Utd2lkdGg6 IDBweCI+PEZPTlQgZmFjZT0iVGltZXMgTmV3IFJvbWFuIj48L0ZPTlQ+Jm5ic3A7PC9ESVY+ PC9ESVY+DQo8RElWIHN0eWxlPSJGT05ULUZBTUlMWTogYXJpYWwiPg0KPERJViBzdHlsZT0i VEVYVC1UUkFOU0ZPUk06IG5vbmU7IEJBQ0tHUk9VTkQtQ09MT1I6IHJnYigyNTUsMjU1LDI1 NSk7IEZPTlQtVkFSSUFOVDogbm9ybWFsOyBGT05ULVNUWUxFOiBub3JtYWw7IFRFWFQtSU5E RU5UOiAwcHg7IERJU1BMQVk6IGlubGluZTsgRk9OVC1GQU1JTFk6IENhbGlicmk7IFdISVRF LVNQQUNFOiBub3JtYWw7IExFVFRFUi1TUEFDSU5HOiBub3JtYWw7IENPTE9SOiByZ2IoMCww LDApOyBGT05ULVNJWkU6IHNtYWxsOyBGT05ULVdFSUdIVDogbm9ybWFsOyBXT1JELVNQQUNJ Tkc6IDBweDsgVEVYVC1ERUNPUkFUSU9OOiBub25lOyAtd2Via2l0LXRleHQtc3Ryb2tlLXdp ZHRoOiAwcHgiPjxGT05UIGZhY2U9IlRpbWVzIE5ldyBSb21hbiI+PC9GT05UPiZuYnNwOzwv RElWPjwvRElWPg0KPERJViBzdHlsZT0iRk9OVC1GQU1JTFk6IGFyaWFsIj4NCjxESVYgc3R5 bGU9IlRFWFQtVFJBTlNGT1JNOiBub25lOyBCQUNLR1JPVU5ELUNPTE9SOiByZ2IoMjU1LDI1 NSwyNTUpOyBGT05ULVZBUklBTlQ6IG5vcm1hbDsgRk9OVC1TVFlMRTogbm9ybWFsOyBURVhU LUlOREVOVDogMHB4OyBESVNQTEFZOiBpbmxpbmU7IEZPTlQtRkFNSUxZOiBDYWxpYnJpOyBX SElURS1TUEFDRTogbm9ybWFsOyBMRVRURVItU1BBQ0lORzogbm9ybWFsOyBDT0xPUjogcmdi KDAsMCwwKTsgRk9OVC1TSVpFOiBzbWFsbDsgRk9OVC1XRUlHSFQ6IG5vcm1hbDsgV09SRC1T UEFDSU5HOiAwcHg7IFRFWFQtREVDT1JBVElPTjogbm9uZTsgLXdlYmtpdC10ZXh0LXN0cm9r ZS13aWR0aDogMHB4Ij48Rk9OVCBmYWNlPSJUaW1lcyBOZXcgUm9tYW4iPjwvRk9OVD4mbmJz cDs8L0RJVj48L0RJVj4NCjxESVYgc3R5bGU9IkZPTlQtRkFNSUxZOiBhcmlhbCI+DQo8RElW IHN0eWxlPSJURVhULVRSQU5TRk9STTogbm9uZTsgQkFDS0dST1VORC1DT0xPUjogcmdiKDI1 NSwyNTUsMjU1KTsgRk9OVC1WQVJJQU5UOiBub3JtYWw7IEZPTlQtU1RZTEU6IG5vcm1hbDsg VEVYVC1JTkRFTlQ6IDBweDsgRElTUExBWTogaW5saW5lOyBGT05ULUZBTUlMWTogQ2FsaWJy aTsgV0hJVEUtU1BBQ0U6IG5vcm1hbDsgTEVUVEVSLVNQQUNJTkc6IG5vcm1hbDsgQ09MT1I6 IHJnYigwLDAsMCk7IEZPTlQtU0laRTogc21hbGw7IEZPTlQtV0VJR0hUOiBub3JtYWw7IFdP UkQtU1BBQ0lORzogMHB4OyBURVhULURFQ09SQVRJT046IG5vbmU7IC13ZWJraXQtdGV4dC1z dHJva2Utd2lkdGg6IDBweCI+PEZPTlQgZmFjZT0iVGltZXMgTmV3IFJvbWFuIj48L0ZPTlQ+ Jm5ic3A7PC9ESVY+PC9ESVY+DQo8RElWIHN0eWxlPSJGT05ULUZBTUlMWTogYXJpYWwiPg0K PERJViBzdHlsZT0iVEVYVC1UUkFOU0ZPUk06IG5vbmU7IEJBQ0tHUk9VTkQtQ09MT1I6IHJn YigyNTUsMjU1LDI1NSk7IEZPTlQtVkFSSUFOVDogbm9ybWFsOyBGT05ULVNUWUxFOiBub3Jt YWw7IFRFWFQtSU5ERU5UOiAwcHg7IERJU1BMQVk6IGlubGluZTsgRk9OVC1GQU1JTFk6IENh bGlicmk7IFdISVRFLVNQQUNFOiBub3JtYWw7IExFVFRFUi1TUEFDSU5HOiBub3JtYWw7IENP TE9SOiByZ2IoMCwwLDApOyBGT05ULVNJWkU6IHNtYWxsOyBGT05ULVdFSUdIVDogbm9ybWFs OyBXT1JELVNQQUNJTkc6IDBweDsgVEVYVC1ERUNPUkFUSU9OOiBub25lOyAtd2Via2l0LXRl eHQtc3Ryb2tlLXdpZHRoOiAwcHgiPjxGT05UIGZhY2U9IlRpbWVzIE5ldyBSb21hbiI+PC9G T05UPiZuYnNwOzwvRElWPjwvRElWPg0KPERJViBzdHlsZT0iRk9OVC1GQU1JTFk6IGFyaWFs Ij4NCjxESVYgc3R5bGU9IlRFWFQtVFJBTlNGT1JNOiBub25lOyBCQUNLR1JPVU5ELUNPTE9S OiByZ2IoMjU1LDI1NSwyNTUpOyBGT05ULVZBUklBTlQ6IG5vcm1hbDsgRk9OVC1TVFlMRTog bm9ybWFsOyBURVhULUlOREVOVDogMHB4OyBESVNQTEFZOiBpbmxpbmU7IEZPTlQtRkFNSUxZ OiBDYWxpYnJpOyBXSElURS1TUEFDRTogbm9ybWFsOyBMRVRURVItU1BBQ0lORzogbm9ybWFs OyBDT0xPUjogcmdiKDAsMCwwKTsgRk9OVC1TSVpFOiBzbWFsbDsgRk9OVC1XRUlHSFQ6IG5v cm1hbDsgV09SRC1TUEFDSU5HOiAwcHg7IFRFWFQtREVDT1JBVElPTjogbm9uZTsgLXdlYmtp dC10ZXh0LXN0cm9rZS13aWR0aDogMHB4Ij48Rk9OVCBmYWNlPSJUaW1lcyBOZXcgUm9tYW4i PjwvRk9OVD4mbmJzcDs8L0RJVj48L0RJVj4NCjxESVYgc3R5bGU9IkZPTlQtRkFNSUxZOiBh cmlhbCI+DQo8RElWIHN0eWxlPSJURVhULVRSQU5TRk9STTogbm9uZTsgQkFDS0dST1VORC1D T0xPUjogcmdiKDI1NSwyNTUsMjU1KTsgRk9OVC1WQVJJQU5UOiBub3JtYWw7IEZPTlQtU1RZ TEU6IG5vcm1hbDsgVEVYVC1JTkRFTlQ6IDBweDsgRElTUExBWTogaW5saW5lOyBGT05ULUZB TUlMWTogQ2FsaWJyaTsgV0hJVEUtU1BBQ0U6IG5vcm1hbDsgTEVUVEVSLVNQQUNJTkc6IG5v cm1hbDsgQ09MT1I6IHJnYigwLDAsMCk7IEZPTlQtU0laRTogc21hbGw7IEZPTlQtV0VJR0hU OiBub3JtYWw7IFdPUkQtU1BBQ0lORzogMHB4OyBURVhULURFQ09SQVRJT046IG5vbmU7IC13 ZWJraXQtdGV4dC1zdHJva2Utd2lkdGg6IDBweCI+PEZPTlQgZmFjZT0iVGltZXMgTmV3IFJv bWFuIj48L0ZPTlQ+Jm5ic3A7PC9ESVY+PC9ESVY+DQo8RElWIHN0eWxlPSJGT05ULUZBTUlM WTogYXJpYWwiPg0KPERJViBzdHlsZT0iVEVYVC1UUkFOU0ZPUk06IG5vbmU7IEJBQ0tHUk9V TkQtQ09MT1I6IHJnYigyNTUsMjU1LDI1NSk7IEZPTlQtVkFSSUFOVDogbm9ybWFsOyBGT05U LVNUWUxFOiBub3JtYWw7IFRFWFQtSU5ERU5UOiAwcHg7IERJU1BMQVk6IGlubGluZTsgRk9O VC1GQU1JTFk6IENhbGlicmk7IFdISVRFLVNQQUNFOiBub3JtYWw7IExFVFRFUi1TUEFDSU5H OiBub3JtYWw7IENPTE9SOiByZ2IoMCwwLDApOyBGT05ULVNJWkU6IHNtYWxsOyBGT05ULVdF SUdIVDogbm9ybWFsOyBXT1JELVNQQUNJTkc6IDBweDsgVEVYVC1ERUNPUkFUSU9OOiBub25l OyAtd2Via2l0LXRleHQtc3Ryb2tlLXdpZHRoOiAwcHgiPjwvRElWPg0KPERJVj4NCjxESVYg c3R5bGU9IkZPTlQtU0laRTogMTYuNXB0Ij4NCjxESVYgc3R5bGU9IlBPU0lUSU9OOiBzdGF0 aWMgIWltcG9ydGFudDsgRk9OVC1TSVpFOiAyMi41cHQiPg0KPERJViBzdHlsZT0iRk9OVC1G QU1JTFk6IGFyaWFsOyBGT05ULVNJWkU6IDEycHQiPjxGT05UIGZhY2U9IlRpbWVzIE5ldyBS b21hbiI+PC9GT05UPiZuYnNwOzwvRElWPg0KPERJViBzdHlsZT0iRk9OVC1GQU1JTFk6IGFy aWFsOyBGT05ULVNJWkU6IDEycHQiPjxGT05UIGZhY2U9IlRpbWVzIE5ldyBSb21hbiI+V2Ug cHJvZHVjZSA8U1BBTiBzdHlsZT0iRk9OVC1GQU1JTFk6IGFyaWFsOyBDT0xPUjogcmdiKDI1 NSwwLDI1NSk7IEZPTlQtU0laRTogMTJwdCI+QWxOaUNvIDwvU1BBTj48U1BBTiBzdHlsZT0i Rk9OVC1GQU1JTFk6IGFyaWFsOyBDT0xPUjogcmdiKDI1NSwwLDI1NSk7IEZPTlQtU0laRTog MTJwdCI+PC9TUEFOPm1hZ25ldCBhbmQ8U1BBTiBzdHlsZT0iRk9OVC1GQU1JTFk6IGFyaWFs OyBDT0xPUjogcmdiKDI1NSwwLDI1NSk7IEZPTlQtU0laRTogMTJwdCI+PFNQQU4gY2xhc3M9 QXBwbGUtY29udmVydGVkLXNwYWNlPiZuYnNwOzwvU1BBTj5GZUNyQ288L1NQQU4+PFNQQU4g Y2xhc3M9QXBwbGUtY29udmVydGVkLXNwYWNlPiZuYnNwOzwvU1BBTj5tYWduZXQgd2l0aCBj b21wZXRpdGl2ZSBwcmljZSBhbmQgYmVzdCBxdWFsaXR5IGluIENoaW5hLjwvRk9OVD48L0RJ Vj4NCjxESVYgc3R5bGU9IkZPTlQtRkFNSUxZOiBhcmlhbDsgRk9OVC1TSVpFOiAxMnB0Ij48 Rk9OVCBmYWNlPSJUaW1lcyBOZXcgUm9tYW4iPjwvRk9OVD4mbmJzcDs8L0RJVj4NCjxESVYg c3R5bGU9IkZPTlQtRkFNSUxZOiBhcmlhbDsgRk9OVC1TSVpFOiAxMnB0Ij48Rk9OVCBmYWNl PSJUaW1lcyBOZXcgUm9tYW4iPktpbmRseSBwbGVhc2UgY29udGFjdCBtZSBpZiB5b3UgaW50 ZXJlc3RlZC48L0ZPTlQ+PC9ESVY+DQo8RElWIHN0eWxlPSJGT05ULUZBTUlMWTogYXJpYWw7 IEZPTlQtU0laRTogMTJwdCI+PEZPTlQgZmFjZT0iVGltZXMgTmV3IFJvbWFuIj48L0ZPTlQ+ Jm5ic3A7PC9ESVY+DQo8RElWIHN0eWxlPSJGT05ULUZBTUlMWTogYXJpYWw7IEZPTlQtU0la RTogMTJwdCI+PEZPTlQgZmFjZT0iVGltZXMgTmV3IFJvbWFuIj5CZXN0IHJlZ2FyZHMsPC9G T05UPjwvRElWPg0KPERJViBzdHlsZT0iRk9OVC1GQU1JTFk6IGFyaWFsOyBGT05ULVNJWkU6 IDEycHQiPjxGT05UIGZhY2U9IlRpbWVzIE5ldyBSb21hbiI+PC9GT05UPiZuYnNwOzwvRElW Pg0KPERJViBzdHlsZT0iRk9OVC1GQU1JTFk6IGFyaWFsOyBGT05ULVNJWkU6IDEycHQiPjxG T05UIGZhY2U9IlRpbWVzIE5ldyBSb21hbiI+PC9GT05UPiZuYnNwOzwvRElWPg0KPERJViBz dHlsZT0iRk9OVC1GQU1JTFk6IGFyaWFsOyBGT05ULVNJWkU6IDEycHQiPjxGT05UIGZhY2U9 IlRpbWVzIE5ldyBSb21hbiI+PFNUUk9ORz5FbW1hIE1hPC9TVFJPTkc+PC9GT05UPjwvRElW PjwvRElWPjwvRElWPjwvRElWPjwvRElWPjwvRElWPg0KPERJViBzdHlsZT0iRk9OVC1GQU1J TFk6IGFyaWFsIj4mbmJzcDs8L0RJVj4NCjxESVYgc3R5bGU9IkZPTlQtRkFNSUxZOiBhcmlh bCI+DQo8UCBzdHlsZT0iVEVYVC1UUkFOU0ZPUk06IG5vbmU7IEJBQ0tHUk9VTkQtQ09MT1I6 IHJnYigyNTUsMjU1LDI1NSk7IEZPTlQtVkFSSUFOVDogbm9ybWFsOyBGT05ULVNUWUxFOiBu b3JtYWw7IFRFWFQtSU5ERU5UOiAwcHg7IE1BUkdJTjogMGNtIDBjbSAwcHQ7IEZPTlQtRkFN SUxZOiAnVGltZXMgTmV3IFJvbWFuJywgc2VyaWY7IFdISVRFLVNQQUNFOiBub3JtYWw7IExF VFRFUi1TUEFDSU5HOiBub3JtYWw7IENPTE9SOiByZ2IoMCwwLDApOyBGT05ULVNJWkU6IDEy cHQ7IEZPTlQtV0VJR0hUOiBub3JtYWw7IFdPUkQtU1BBQ0lORzogMHB4OyAtd2Via2l0LXRl eHQtc3Ryb2tlLXdpZHRoOiAwcHgiIGNsYXNzPU1zb05vcm1hbD48U1BBTiBzdHlsZT0iQ09M T1I6IGJsdWUiPjxTVFJPTkc+TmluZ2JvIFNTRCBNYWduZXRpY3MgQ28gTHRkPC9TVFJPTkc+ PC9TUEFOPjwvUD4NCjxQIHN0eWxlPSJURVhULVRSQU5TRk9STTogbm9uZTsgQkFDS0dST1VO RC1DT0xPUjogcmdiKDI1NSwyNTUsMjU1KTsgRk9OVC1WQVJJQU5UOiBub3JtYWw7IEZPTlQt U1RZTEU6IG5vcm1hbDsgVEVYVC1JTkRFTlQ6IDBweDsgTUFSR0lOOiAwY20gMGNtIDBwdDsg Rk9OVC1GQU1JTFk6ICdUaW1lcyBOZXcgUm9tYW4nLCBzZXJpZjsgV0hJVEUtU1BBQ0U6IG5v cm1hbDsgTEVUVEVSLVNQQUNJTkc6IG5vcm1hbDsgQ09MT1I6IHJnYigwLDAsMCk7IEZPTlQt U0laRTogMTJwdDsgRk9OVC1XRUlHSFQ6IG5vcm1hbDsgV09SRC1TUEFDSU5HOiAwcHg7IC13 ZWJraXQtdGV4dC1zdHJva2Utd2lkdGg6IDBweCIgY2xhc3M9TXNvTm9ybWFsPjxTUEFOIHN0 eWxlPSJDT0xPUjogYmx1ZSI+PFNUUk9ORz5BZGQ6PC9TVFJPTkc+U2ltZW4gaW5kdXN0cmlh bCBwYXJrLHl1eWFvJm5ic3A7LFpoZWppYW5nLENoaW5hPC9TUEFOPjw/eG1sOm5hbWVzcGFj ZSBwcmVmaXggPSBvIC8+PG86cD48L286cD48L1A+DQo8UCBzdHlsZT0iVEVYVC1UUkFOU0ZP Uk06IG5vbmU7IEJBQ0tHUk9VTkQtQ09MT1I6IHJnYigyNTUsMjU1LDI1NSk7IEZPTlQtVkFS SUFOVDogbm9ybWFsOyBGT05ULVNUWUxFOiBub3JtYWw7IFRFWFQtSU5ERU5UOiAwcHg7IE1B UkdJTjogMGNtIDBjbSAwcHQ7IEZPTlQtRkFNSUxZOiAnVGltZXMgTmV3IFJvbWFuJywgc2Vy aWY7IFdISVRFLVNQQUNFOiBub3JtYWw7IExFVFRFUi1TUEFDSU5HOiBub3JtYWw7IENPTE9S OiByZ2IoMCwwLDApOyBGT05ULVNJWkU6IDEycHQ7IEZPTlQtV0VJR0hUOiBub3JtYWw7IFdP UkQtU1BBQ0lORzogMHB4OyAtd2Via2l0LXRleHQtc3Ryb2tlLXdpZHRoOiAwcHgiIGNsYXNz PU1zb05vcm1hbD48U1RST05HPjxTUEFOIHN0eWxlPSJDT0xPUjogYmx1ZSI+VGVsOjwvU1BB Tj48L1NUUk9ORz48U1BBTiBzdHlsZT0iQ09MT1I6IGJsdWUiPjxTUEFOIGNsYXNzPUFwcGxl LWNvbnZlcnRlZC1zcGFjZT4mbmJzcDs8L1NQQU4+Kzg2LTU3NC02MjE1ODg4MzxCUj48U1RS T05HPkZheDo8L1NUUk9ORz48U1BBTiBjbGFzcz1BcHBsZS1jb252ZXJ0ZWQtc3BhY2U+Jm5i c3A7PC9TUEFOPis4Ni01NzQtNjIxNTg4ODU8L1NQQU4+PC9QPg0KPFAgc3R5bGU9IlRFWFQt VFJBTlNGT1JNOiBub25lOyBCQUNLR1JPVU5ELUNPTE9SOiByZ2IoMjU1LDI1NSwyNTUpOyBG T05ULVZBUklBTlQ6IG5vcm1hbDsgRk9OVC1TVFlMRTogbm9ybWFsOyBURVhULUlOREVOVDog MHB4OyBNQVJHSU46IDBjbSAwY20gMHB0OyBGT05ULUZBTUlMWTogJ1RpbWVzIE5ldyBSb21h bicsIHNlcmlmOyBXSElURS1TUEFDRTogbm9ybWFsOyBMRVRURVItU1BBQ0lORzogbm9ybWFs OyBDT0xPUjogcmdiKDAsMCwwKTsgRk9OVC1TSVpFOiAxMnB0OyBGT05ULVdFSUdIVDogbm9y bWFsOyBXT1JELVNQQUNJTkc6IDBweDsgLXdlYmtpdC10ZXh0LXN0cm9rZS13aWR0aDogMHB4 IiBjbGFzcz1Nc29Ob3JtYWw+PFNQQU4gc3R5bGU9IkNPTE9SOiBibHVlIj5Nb2JpbGU6Kzg2 LTE1ODU3NDY5NjA5PC9TUEFOPjwvUD4NCjxQIHN0eWxlPSJURVhULVRSQU5TRk9STTogbm9u ZTsgQkFDS0dST1VORC1DT0xPUjogcmdiKDI1NSwyNTUsMjU1KTsgVEVYVC1JTkRFTlQ6IDBw eDsgTUFSR0lOOiAwY20gMGNtIDBwdDsgRk9OVDogMTJwdC8xMy41cHQgJ1RpbWVzIE5ldyBS b21hbicsIHNlcmlmOyBXSElURS1TUEFDRTogbm9ybWFsOyBMRVRURVItU1BBQ0lORzogbm9y bWFsOyBDT0xPUjogcmdiKDAsMCwwKTsgV09SRC1TUEFDSU5HOiAwcHg7IC13ZWJraXQtdGV4 dC1zdHJva2Utd2lkdGg6IDBweCIgY2xhc3M9TXNvTm9ybWFsPjxTVFJPTkc+PFNQQU4gc3R5 bGU9IkNPTE9SOiBibHVlIj5XZWJzaXRlPC9TUEFOPjwvU1RST05HPjxTUEFOIHN0eWxlPSJD T0xPUjogYmx1ZSI+OjxTUEFOIGNsYXNzPUFwcGxlLWNvbnZlcnRlZC1zcGFjZT4mbmJzcDs8 L1NQQU4+PC9TUEFOPjxTUEFOIHN0eWxlPSJGT05ULUZBTUlMWTogQXJpYWwsIHNhbnMtc2Vy aWY7IEZPTlQtU0laRTogOXB0Ij48U1BBTiBzdHlsZT0iRk9OVC1GQU1JTFk6ICdUaW1lcyBO ZXcgUm9tYW4nLCBzZXJpZjsgRk9OVC1TSVpFOiAxMnB0Ij48QSBocmVmPSJodHRwOi8vd3d3 Lm1hZ25ldC1uYnNzZC5jb20iPnd3dy5tYWduZXQtbmJzc2QuY29tPC9BPjwvU1BBTj48L1NQ QU4+PFNQQU4gc3R5bGU9IkNPTE9SOiBibHVlIj48U1BBTiBjbGFzcz1BcHBsZS1jb252ZXJ0 ZWQtc3BhY2U+Jm5ic3A7PC9TUEFOPjxTVFJPTkc+RW1haWw6RW1tYUBtYWduZXQtbmJzc2Qu Y29tPC9TVFJPTkc+PC9TUEFOPjwvUD4NCjxQIHN0eWxlPSJURVhULVRSQU5TRk9STTogbm9u ZTsgQkFDS0dST1VORC1DT0xPUjogcmdiKDI1NSwyNTUsMjU1KTsgRk9OVC1WQVJJQU5UOiBu b3JtYWw7IEZPTlQtU1RZTEU6IG5vcm1hbDsgVEVYVC1JTkRFTlQ6IDBweDsgTUFSR0lOOiAw Y20gMGNtIDBwdDsgRk9OVC1GQU1JTFk6ICdUaW1lcyBOZXcgUm9tYW4nLCBzZXJpZjsgV0hJ VEUtU1BBQ0U6IG5vcm1hbDsgTEVUVEVSLVNQQUNJTkc6IG5vcm1hbDsgQ09MT1I6IHJnYigw LDAsMCk7IEZPTlQtU0laRTogMTJwdDsgRk9OVC1XRUlHSFQ6IG5vcm1hbDsgV09SRC1TUEFD SU5HOiAwcHg7IC13ZWJraXQtdGV4dC1zdHJva2Utd2lkdGg6IDBweCIgY2xhc3M9TXNvTm9y bWFsPiZuYnNwOzxvOnA+PC9vOnA+PC9QPg0KPFAgc3R5bGU9IlRFWFQtVFJBTlNGT1JNOiBu b25lOyBCQUNLR1JPVU5ELUNPTE9SOiByZ2IoMjU1LDI1NSwyNTUpOyBGT05ULVZBUklBTlQ6 IG5vcm1hbDsgRk9OVC1TVFlMRTogbm9ybWFsOyBURVhULUlOREVOVDogMHB4OyBNQVJHSU46 IDBjbSAwY20gMHB0OyBGT05ULUZBTUlMWTogJ1RpbWVzIE5ldyBSb21hbicsIHNlcmlmOyBX SElURS1TUEFDRTogbm9ybWFsOyBMRVRURVItU1BBQ0lORzogbm9ybWFsOyBDT0xPUjogcmdi KDAsMCwwKTsgRk9OVC1TSVpFOiAxMnB0OyBGT05ULVdFSUdIVDogbm9ybWFsOyBXT1JELVNQ QUNJTkc6IDBweDsgLXdlYmtpdC10ZXh0LXN0cm9rZS13aWR0aDogMHB4IiBjbGFzcz1Nc29O b3JtYWw+Jm5ic3A7PC9QPjwvRElWPg0KPERJViBzdHlsZT0iRk9OVC1GQU1JTFk6IGFyaWFs Ij4NCjxESVY+DQo8RElWIHN0eWxlPSJGT05ULVNJWkU6IDE2LjVwdCI+DQo8RElWIHN0eWxl PSJQT1NJVElPTjogc3RhdGljICFpbXBvcnRhbnQ7IEZPTlQtU0laRTogMjIuNXB0Ij4NCjxE SVYgc3R5bGU9IkZPTlQtRkFNSUxZOiBhcmlhbDsgRk9OVC1TSVpFOiAxMnB0Ij4mbmJzcDs8 L0RJVj4NCjxESVYgc3R5bGU9IkZPTlQtRkFNSUxZOiBhcmlhbDsgRk9OVC1TSVpFOiAxMnB0 Ij4NCjxESVYgc3R5bGU9IlRFWFQtVFJBTlNGT1JNOiBub25lOyBCQUNLR1JPVU5ELUNPTE9S OiByZ2IoMjU1LDI1NSwyNTUpOyBURVhULUlOREVOVDogMHB4OyBGT05UOiAxNHB4IOW+rui9 r+mbhem7kSwgVGFob21hOyBXSElURS1TUEFDRTogbm9ybWFsOyBMRVRURVItU1BBQ0lORzog bm9ybWFsOyBDT0xPUjogcmdiKDAsMCwwKTsgV09SRC1TUEFDSU5HOiAwcHg7IC13ZWJraXQt dGV4dC1zdHJva2Utd2lkdGg6IDBweCI+PEZPTlQgc2l6ZT0zIGZhY2U9QXJpYWw+PC9GT05U PiZuYnNwOzwvRElWPjwvRElWPg0KPERJViBzdHlsZT0iRk9OVC1GQU1JTFk6IGFyaWFsOyBG T05ULVNJWkU6IDEycHQiPjxTUEFOIHN0eWxlPSJGT05ULUZBTUlMWTogJ1RpbWVzIE5ldyBS b21hbic7IEZPTlQtU0laRTogMTZwdDsgbXNvLWJpZGktZm9udC1zaXplOiAxMi4wcHQ7IG1z by1mYXJlYXN0LWZvbnQtZmFtaWx5OiDlrovkvZM7IG1zby1mb250LWtlcm5pbmc6IDEuMHB0 OyBtc28tYW5zaS1sYW5ndWFnZTogRU4tVVM7IG1zby1mYXJlYXN0LWxhbmd1YWdlOiBaSC1D TjsgbXNvLWJpZGktbGFuZ3VhZ2U6IEFSLVNBIiBsYW5nPUVOLVVTPjxGT05UIHNpemU9Mz48 Rk9OVCBjb2xvcj0jNDA4MDgwPklmIGRpc3R1cmIgLHBscyA8L0ZPTlQ+PEEgaHJlZj0ibWFp bHRvOmVtbWEubWFnbmV0aWNzQHlhaG9vLmNvbSI+PEZPTlQgY29sb3I9IzQwODA4MD51bnN1 YnNjcmliZTwvRk9OVD48L0E+PC9GT05UPjwvU1BBTj48L0RJVj48L0RJVj48L0RJVj4NCjxE SVYgc3R5bGU9IkZPTlQtRkFNSUxZOiBhcmlhbDsgRk9OVC1TSVpFOiAxMnB0Ij4mbmJzcDs8 L0RJVj48L0RJVj4NCjxESVYgc3R5bGU9IkZPTlQtRkFNSUxZOiBhcmlhbCI+Jm5ic3A7PC9E SVY+PC9ESVY+ ----boundary_53430_bc01a750-dd61-47d5-8d0e-7a2a965f2d53-- From david@fromorbit.com Tue Feb 9 17:24:38 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=ham version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay3.corp.sgi.com [198.149.34.15]) by oss.sgi.com (Postfix) with ESMTP id A853F29DF6 for ; Tue, 9 Feb 2016 17:24:38 -0600 (CST) Received: from cuda.sgi.com (cuda2.sgi.com [192.48.176.25]) by relay3.corp.sgi.com (Postfix) with ESMTP id 3B03CAC005 for ; Tue, 9 Feb 2016 15:24:35 -0800 (PST) X-ASG-Debug-ID: 1455060272-04cbb0433447d10001-NocioJ Received: from ipmail06.adl2.internode.on.net (ipmail06.adl2.internode.on.net [150.101.137.129]) by cuda.sgi.com with ESMTP id W0W9sc18adaMIZ4x for ; Tue, 09 Feb 2016 15:24:32 -0800 (PST) X-Barracuda-Envelope-From: david@fromorbit.com X-Barracuda-Apparent-Source-IP: 150.101.137.129 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: A2AECACKdLpWPBATLHldKAECgw+BP4Jpg3qBeZ1UAQEBAQEBBotphUWEB4YHBAICgTRNAQEBAQEBBwEBAQFBP4RCAQEEJxMcIxAIAw4KCSUPBSUDBxoTiBq/QwEBCAIeGIUyhH+IbAWSboQKjUeOfY4/gmUZgVwoLohTAQEB Received: from ppp121-44-19-16.lns20.syd4.internode.on.net (HELO dastard) ([121.44.19.16]) by ipmail06.adl2.internode.on.net with ESMTP; 10 Feb 2016 09:46:49 +1030 Received: from dave by dastard with local (Exim 4.80) (envelope-from ) id 1aTHWP-0004Ir-IY; Wed, 10 Feb 2016 10:16:37 +1100 Date: Wed, 10 Feb 2016 10:16:37 +1100 From: Dave Chinner To: Christoph Hellwig Cc: xfs@oss.sgi.com Subject: Re: [PATCH 2/5] xfs: Introduce writeback context for writepages Message-ID: <20160209231637.GJ14668@dastard> X-ASG-Orig-Subj: Re: [PATCH 2/5] xfs: Introduce writeback context for writepages References: <1454910258-7578-1-git-send-email-david@fromorbit.com> <1454910258-7578-3-git-send-email-david@fromorbit.com> <20160209133941.GA13357@infradead.org> <20160209214850.GE14668@dastard> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20160209214850.GE14668@dastard> User-Agent: Mutt/1.5.21 (2010-09-15) X-Barracuda-Connect: ipmail06.adl2.internode.on.net[150.101.137.129] X-Barracuda-Start-Time: 1455060272 X-Barracuda-URL: https://192.48.176.25:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-BRTS-Status: 1 X-Barracuda-Spam-Score: 0.00 X-Barracuda-Spam-Status: No, SCORE=0.00 using per-user scores of TAG_LEVEL=1000.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.7 tests=BSF_SC0_MISMATCH_TO X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.3.26900 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 0.00 BSF_SC0_MISMATCH_TO Envelope rcpt doesn't match header On Wed, Feb 10, 2016 at 08:48:50AM +1100, Dave Chinner wrote: > On Tue, Feb 09, 2016 at 05:39:41AM -0800, Christoph Hellwig wrote: > > > - if (!ioend || need_ioend || type != ioend->io_type) { > > > - xfs_ioend_t *previous = *result; > > > - > > > - ioend = xfs_alloc_ioend(inode, type); > > > - ioend->io_offset = offset; > > > - ioend->io_buffer_head = bh; > > > - ioend->io_buffer_tail = bh; > > > - if (previous) > > > - previous->io_list = ioend; > > > - *result = ioend; > > > + if (!wpc->ioend || wpc->io_type != wpc->ioend->io_type || > > > + bh->b_blocknr != wpc->last_block + 1) { > > > > We now start a new ioend if the blocks aren't contiguous, which seems > > reasonable. But this also means the similar check in xfs_submit_ioend > > should be removed at the same time. > > OK. On second thoughts, I have another patch I haven't posted yet that builds bios directly in xfs_add_to_ioend() that gets rid of the buffer head chain walk during submission, so I'll leave changing the submission code to that patch rather than changing here... Cheers, Dave. -- Dave Chinner david@fromorbit.com From darrick.wong@oracle.com Tue Feb 9 19:02:29 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay1.corp.sgi.com [137.38.102.111]) by oss.sgi.com (Postfix) with ESMTP id 2FD5E29DF6 for ; Tue, 9 Feb 2016 19:02:29 -0600 (CST) Received: from cuda.sgi.com (cuda2.sgi.com [192.48.176.25]) by relay1.corp.sgi.com (Postfix) with ESMTP id 218EA8F8040 for ; Tue, 9 Feb 2016 17:02:25 -0800 (PST) X-ASG-Debug-ID: 1455066141-04cbb0433249470001-NocioJ Received: from aserp1040.oracle.com (aserp1040.oracle.com [141.146.126.69]) by cuda.sgi.com with ESMTP id cSW4mmSZC766MUFF (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO) for ; Tue, 09 Feb 2016 17:02:21 -0800 (PST) X-Barracuda-Envelope-From: darrick.wong@oracle.com X-Barracuda-Apparent-Source-IP: 141.146.126.69 Received: from userv0022.oracle.com (userv0022.oracle.com [156.151.31.74]) by aserp1040.oracle.com (Sentrion-MTA-4.3.2/Sentrion-MTA-4.3.2) with ESMTP id u1A12J5E003680 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 10 Feb 2016 01:02:19 GMT Received: from userv0122.oracle.com (userv0122.oracle.com [156.151.31.75]) by userv0022.oracle.com (8.14.4/8.13.8) with ESMTP id u1A12JU5006383 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL); Wed, 10 Feb 2016 01:02:19 GMT Received: from abhmp0015.oracle.com (abhmp0015.oracle.com [141.146.116.21]) by userv0122.oracle.com (8.14.4/8.14.4) with ESMTP id u1A12HnC017582; Wed, 10 Feb 2016 01:02:17 GMT Received: from localhost (/10.145.178.207) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Tue, 09 Feb 2016 17:02:17 -0800 Date: Tue, 9 Feb 2016 17:02:13 -0800 From: "Darrick J. Wong" To: Dave Chinner Cc: fstests@vger.kernel.org, linux-btrfs@vger.kernel.org, xfs@oss.sgi.com Subject: Re: [PATCH 13/23] xfs: test fragmentation characteristics of copy-on-write Message-ID: <20160210010213.GE6350@birch.djwong.org> X-ASG-Orig-Subj: Re: [PATCH 13/23] xfs: test fragmentation characteristics of copy-on-write References: <20160209011145.23099.95354.stgit@birch.djwong.org> <20160209011309.23099.60912.stgit@birch.djwong.org> <20160209080144.GL19486@dastard> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20160209080144.GL19486@dastard> User-Agent: Mutt/1.5.21 (2010-09-15) X-Source-IP: userv0022.oracle.com [156.151.31.74] X-Barracuda-Connect: aserp1040.oracle.com[141.146.126.69] X-Barracuda-Start-Time: 1455066141 X-Barracuda-Encrypted: ECDHE-RSA-AES256-GCM-SHA384 X-Barracuda-URL: https://192.48.176.25:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-BRTS-Status: 1 X-Barracuda-Spam-Score: 0.00 X-Barracuda-Spam-Status: No, SCORE=0.00 using per-user scores of TAG_LEVEL=1000.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.7 tests=BSF_SC0_MISMATCH_TO, UNPARSEABLE_RELAY X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.3.26903 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 0.00 BSF_SC0_MISMATCH_TO Envelope rcpt doesn't match header 0.00 UNPARSEABLE_RELAY Informational: message has unparseable relay lines On Tue, Feb 09, 2016 at 07:01:44PM +1100, Dave Chinner wrote: > On Mon, Feb 08, 2016 at 05:13:09PM -0800, Darrick J. Wong wrote: > > Perform copy-on-writes at random offsets to stress the CoW allocation > > system. Assess the effectiveness of the extent size hint at > > combatting fragmentation via unshare, a rewrite, and no-op after the > > random writes. > > > > Signed-off-by: Darrick J. Wong > .... > > +seq=`basename "$0"` > > +seqres="$RESULT_DIR/$seq" > > +echo "QA output created by $seq" > > + > > +here=`pwd` > > +tmp=/tmp/$$ > > +status=1 # failure is the default! > > +trap "_cleanup; exit \$status" 0 1 2 3 15 > > + > > +_cleanup() > > +{ > > + cd / > > + #rm -rf "$tmp".* "$testdir" > > Now that I've noticed it, a few tests have this line commented out. > Probably should remove the tmp files, at least. Done. > > +rm -f "$seqres.full" > > + > > +echo "Format and mount" > > +_scratch_mkfs > "$seqres.full" 2>&1 > > +_scratch_mount >> "$seqres.full" 2>&1 > > + > > +testdir="$SCRATCH_MNT/test-$seq" > > +rm -rf $testdir > > +mkdir $testdir > > Again, somthing that is repeated - we just mkfs'd the scratch > device, so the $testdir is guaranteed not to exist... I've done that to the new tests, will do to the existing ones. > > +echo "Check for damage" > > +umount "$SCRATCH_MNT" > > I've also noticed this in a lot of tests - the scratch device will > be unmounted by the harness, so I don't think this is necessary.... Done. > > +free_blocks=$(stat -f -c '%a' "$testdir") > > +real_blksz=$(stat -f -c '%S' "$testdir") > > +space_needed=$(((blksz * nr * 3) * 5 / 4)) > > +space_avail=$((free_blocks * real_blksz)) > > +internal_blks=$((blksz * nr / real_blksz)) > > +test $space_needed -gt $space_avail && _notrun "Not enough space. $space_avail < $space_needed" > > Why not: > > _require_fs_space $space_needed > > At minimum, it seems to be a repeated hunk of code, so it shoul dbe > factored. Ok, done. > > +testdir="$SCRATCH_MNT/test-$seq" > > +rm -rf $testdir > > +mkdir $testdir > > + > > +echo "Create the original files" > > +"$XFS_IO_PROG" -f -c "pwrite -S 0x61 0 0" "$testdir/file1" >> "$seqres.full" > > +"$XFS_IO_PROG" -f -c "pwrite -S 0x61 0 1048576" "$testdir/file2" >> "$seqres.full" > > +_scratch_remount > > + > > +echo "Set extsz and cowextsz on zero byte file" > > +"$XFS_IO_PROG" -f -c "extsize 1048576" "$testdir/file1" | _filter_scratch > > +"$XFS_IO_PROG" -f -c "cowextsize 1048576" "$testdir/file1" | _filter_scratch > > + > > +echo "Set extsz and cowextsz on 1Mbyte file" > > +"$XFS_IO_PROG" -f -c "extsize 1048576" "$testdir/file2" | _filter_scratch > > +"$XFS_IO_PROG" -f -c "cowextsize 1048576" "$testdir/file2" | _filter_scratch > > +_scratch_remount > > + > > +fn() { > > + "$XFS_IO_PROG" -c "$1" "$2" | sed -e 's/.\([0-9]*\).*$/\1/g' > > +} > > +echo "Check extsz and cowextsz settings on zero byte file" > > +test $(fn extsize "$testdir/file1") -eq 1048576 || echo "file1 extsize not set" > > +test $(fn cowextsize "$testdir/file1") -eq 1048576 || echo "file1 cowextsize not set" > > For this sort of thing, just dump the extent size value to the > golden output. i.e. > > echo "Check extsz and cowextsz settings on zero byte file" > $XFS_IO_PROG -c extsize $testdir/file1 > $XFS_IO_PROG -c cowextsize $testdir/file1 > > is all that is needed. that way if it fails, we see what value it > had instead of the expected 1MB. This also makes the test much less > verbose and easier to read Done. > > + > > +echo "Check extsz and cowextsz settings on 1Mbyte file" > > +test $(fn extsize "$testdir/file2") -eq 0 || echo "file2 extsize not set" > > +test $(fn cowextsize "$testdir/file2") -eq 1048576 || echo "file2 cowextsize not set" > > + > > +echo "Set cowextsize and check flag" > > +"$XFS_IO_PROG" -f -c "cowextsize 1048576" "$testdir/file3" | _filter_scratch > > +_scratch_remount > > +test $("$XFS_IO_PROG" -c "stat" "$testdir/file3" | grep 'fsxattr.xflags' | awk '{print $4}' | grep -c 'C') -eq 1 || echo "file3 cowextsz flag not set" > > +test $(fn cowextsize "$testdir/file3") -eq 1048576 || echo "file3 cowextsize not set" > > +"$XFS_IO_PROG" -f -c "cowextsize 0" "$testdir/file3" | _filter_scratch > > +_scratch_remount > > +test $(fn cowextsize "$testdir/file3") -eq 0 || echo "file3 cowextsize not set" > > +test $("$XFS_IO_PROG" -c "stat" "$testdir/file3" | grep 'fsxattr.xflags' | awk '{print $4}' | grep -c 'C') -eq 0 || echo "file3 cowextsz flag not set" > > Same with all these - just grep the output for the line you want, > and the golden output matching does everything else. e.g. the flag > check simply becomes: > > $XFS_IO_PROG -c "stat" $testdir/file3 | grep 'fsxattr.xflags' > > Again, this tells us what the wrong flags are if it fails... Done. It'll probably break whenever we add new flags, but that can be fixed. --D > > There are quite a few bits of these tests where the same thing > applies.... > > -Dave. > -- > Dave Chinner > david@fromorbit.com > > _______________________________________________ > xfs mailing list > xfs@oss.sgi.com > http://oss.sgi.com/mailman/listinfo/xfs From darrick.wong@oracle.com Tue Feb 9 19:03:19 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay3.corp.sgi.com [198.149.34.15]) by oss.sgi.com (Postfix) with ESMTP id 1D8C229DF6 for ; Tue, 9 Feb 2016 19:03:19 -0600 (CST) Received: from cuda.sgi.com (cuda1.sgi.com [192.48.157.11]) by relay3.corp.sgi.com (Postfix) with ESMTP id B2592AC006 for ; Tue, 9 Feb 2016 17:03:15 -0800 (PST) X-ASG-Debug-ID: 1455066189-04bdf066eb34170001-NocioJ Received: from aserp1040.oracle.com (aserp1040.oracle.com [141.146.126.69]) by cuda.sgi.com with ESMTP id JJg5ucmbqxV3ljoT (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO) for ; Tue, 09 Feb 2016 17:03:10 -0800 (PST) X-Barracuda-Envelope-From: darrick.wong@oracle.com X-Barracuda-Apparent-Source-IP: 141.146.126.69 Received: from aserv0022.oracle.com (aserv0022.oracle.com [141.146.126.234]) by aserp1040.oracle.com (Sentrion-MTA-4.3.2/Sentrion-MTA-4.3.2) with ESMTP id u1A135QZ004626 (version=TLSv1 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Wed, 10 Feb 2016 01:03:05 GMT Received: from aserv0121.oracle.com (aserv0121.oracle.com [141.146.126.235]) by aserv0022.oracle.com (8.13.8/8.13.8) with ESMTP id u1A135XP025015 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=FAIL); Wed, 10 Feb 2016 01:03:05 GMT Received: from abhmp0004.oracle.com (abhmp0004.oracle.com [141.146.116.10]) by aserv0121.oracle.com (8.13.8/8.13.8) with ESMTP id u1A1358C018990; Wed, 10 Feb 2016 01:03:05 GMT Received: from localhost (/10.145.178.207) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Tue, 09 Feb 2016 17:03:05 -0800 Date: Tue, 9 Feb 2016 17:03:03 -0800 From: "Darrick J. Wong" To: Dave Chinner Cc: fstests@vger.kernel.org, linux-btrfs@vger.kernel.org, xfs@oss.sgi.com Subject: Re: [PATCH 17/23] reflink: test CoW across a mixed range of block types with cowextsize set Message-ID: <20160210010303.GF6350@birch.djwong.org> X-ASG-Orig-Subj: Re: [PATCH 17/23] reflink: test CoW across a mixed range of block types with cowextsize set References: <20160209011145.23099.95354.stgit@birch.djwong.org> <20160209011335.23099.47260.stgit@birch.djwong.org> <20160209080923.GM19486@dastard> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20160209080923.GM19486@dastard> User-Agent: Mutt/1.5.21 (2010-09-15) X-Source-IP: aserv0022.oracle.com [141.146.126.234] X-Barracuda-Connect: aserp1040.oracle.com[141.146.126.69] X-Barracuda-Start-Time: 1455066190 X-Barracuda-Encrypted: ECDHE-RSA-AES256-GCM-SHA384 X-Barracuda-URL: https://192.48.157.11:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-BRTS-Status: 1 X-Barracuda-Spam-Score: 0.00 X-Barracuda-Spam-Status: No, SCORE=0.00 using per-user scores of TAG_LEVEL=1000.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.7 tests=BSF_SC0_MISMATCH_TO, UNPARSEABLE_RELAY X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.3.26903 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 0.00 BSF_SC0_MISMATCH_TO Envelope rcpt doesn't match header 0.00 UNPARSEABLE_RELAY Informational: message has unparseable relay lines On Tue, Feb 09, 2016 at 07:09:23PM +1100, Dave Chinner wrote: > On Mon, Feb 08, 2016 at 05:13:35PM -0800, Darrick J. Wong wrote: > > Signed-off-by: Darrick J. Wong > > --- > > tests/xfs/215 | 108 ++++++++++++++++++++++++++++++++++++++++++ > > tests/xfs/215.out | 14 +++++ > > tests/xfs/218 | 108 ++++++++++++++++++++++++++++++++++++++++++ > > tests/xfs/218.out | 14 +++++ > > tests/xfs/219 | 108 ++++++++++++++++++++++++++++++++++++++++++ > > tests/xfs/219.out | 14 +++++ > > tests/xfs/221 | 108 ++++++++++++++++++++++++++++++++++++++++++ > > tests/xfs/221.out | 14 +++++ > > tests/xfs/223 | 113 ++++++++++++++++++++++++++++++++++++++++++++ > > tests/xfs/223.out | 14 +++++ > > tests/xfs/224 | 113 ++++++++++++++++++++++++++++++++++++++++++++ > > tests/xfs/224.out | 14 +++++ > > tests/xfs/225 | 108 ++++++++++++++++++++++++++++++++++++++++++ > > tests/xfs/225.out | 14 +++++ > > tests/xfs/226 | 108 ++++++++++++++++++++++++++++++++++++++++++ > > tests/xfs/226.out | 14 +++++ > > tests/xfs/228 | 137 +++++++++++++++++++++++++++++++++++++++++++++++++++++ > > tests/xfs/228.out | 14 +++++ > > tests/xfs/230 | 137 +++++++++++++++++++++++++++++++++++++++++++++++++++++ > > tests/xfs/230.out | 14 +++++ > > tests/xfs/group | 10 ++++ > > 21 files changed, 1298 insertions(+) > > create mode 100755 tests/xfs/215 > > create mode 100644 tests/xfs/215.out > > create mode 100755 tests/xfs/218 > > create mode 100644 tests/xfs/218.out > > create mode 100755 tests/xfs/219 > > create mode 100644 tests/xfs/219.out > > create mode 100755 tests/xfs/221 > > create mode 100644 tests/xfs/221.out > > create mode 100755 tests/xfs/223 > > create mode 100644 tests/xfs/223.out > > create mode 100755 tests/xfs/224 > > create mode 100644 tests/xfs/224.out > > create mode 100755 tests/xfs/225 > > create mode 100644 tests/xfs/225.out > > create mode 100755 tests/xfs/226 > > create mode 100644 tests/xfs/226.out > > create mode 100755 tests/xfs/228 > > create mode 100644 tests/xfs/228.out > > create mode 100755 tests/xfs/230 > > create mode 100644 tests/xfs/230.out > > > > > > diff --git a/tests/xfs/215 b/tests/xfs/215 > > new file mode 100755 > > index 0000000..8dd5cb5 > > --- /dev/null > > +++ b/tests/xfs/215 > > @@ -0,0 +1,108 @@ > > +#! /bin/bash > > +# FS QA Test No. 215 > > +# > > +# Ensuring that copy on write in direct-io mode works when the CoW > > +# range originally covers multiple extents, some unwritten, some not. > > +# - Set cowextsize hint. > > +# - Create a file and fallocate a second file. > > +# - Reflink the odd blocks of the first file into the second file. > > +# - directio CoW across the halfway mark, starting with the unwritten extent. > > +# - Check that the files are now different where we say they're different. > > +# > > +#----------------------------------------------------------------------- > > +# Copyright (c) 2016, Oracle and/or its affiliates. All Rights Reserved. > > +# > > +# This program is free software; you can redistribute it and/or > > +# modify it under the terms of the GNU General Public License as > > +# published by the Free Software Foundation. > > +# > > +# This program is distributed in the hope that it would be useful, > > +# but WITHOUT ANY WARRANTY; without even the implied warranty of > > +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the > > +# GNU General Public License for more details. > > +# > > +# You should have received a copy of the GNU General Public License > > +# along with this program; if not, write the Free Software Foundation, > > +# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA > > +#----------------------------------------------------------------------- > > + > > +seq=`basename "$0"` > > +seqres="$RESULT_DIR/$seq" > > +echo "QA output created by $seq" > > + > > +here=`pwd` > > +tmp=/tmp/$$ > > +status=1 # failure is the default! > > +trap "_cleanup; exit \$status" 0 1 2 3 15 > > + > > +_cleanup() > > +{ > > + cd / > > + rm -rf "$tmp".* > > +} > > + > > +# get standard environment, filters and checks > > +. ./common/rc > > +. ./common/filter > > +. ./common/reflink > > + > > +# real QA test starts here > > +_supported_os Linux > > +_require_scratch_reflink > > +_require_xfs_io_command "falloc" > > + > > +rm -f "$seqres.full" > > + > > +echo "Format and mount" > > +_scratch_mkfs > "$seqres.full" 2>&1 > > +_scratch_mount >> "$seqres.full" 2>&1 > > + > > +testdir="$SCRATCH_MNT/test-$seq" > > +rm -rf $testdir > > +mkdir $testdir > > + > > +echo "Create the original files" > > +blksz=65536 > > +nr=64 > > +real_blksz=$(stat -f -c '%S' "$testdir") > > +internal_blks=$((blksz * nr / real_blksz)) > > +"$XFS_IO_PROG" -c "cowextsize $((blksz * 16))" "$testdir" >> "$seqres.full" > > +_pwrite_byte 0x61 0 $((blksz * nr)) "$testdir/file1" >> "$seqres.full" > > +$XFS_IO_PROG -f -c "falloc 0 $((blksz * nr))" "$testdir/file3" >> "$seqres.full" > > +_pwrite_byte 0x00 0 $((blksz * nr)) "$testdir/file3.chk" >> "$seqres.full" > > +seq 0 2 $((nr-1)) | while read f; do > > + _reflink_range "$testdir/file1" $((blksz * f)) "$testdir/file3" $((blksz * f)) $blksz >> "$seqres.full" > > + _pwrite_byte 0x61 $((blksz * f)) $blksz "$testdir/file3.chk" >> "$seqres.full" > > +done > > This looks like several tests use this setup. Factor? Will tackle before I resubmit. > > > +_scratch_remount > > + > > +echo "Compare files" > > +md5sum "$testdir/file1" | _filter_scratch > > +md5sum "$testdir/file3" | _filter_scratch > > +md5sum "$testdir/file3.chk" | _filter_scratch > > + > > +echo "directio CoW across the transition" > > +"$XFS_IO_PROG" -d -f -c "pwrite -S 0x63 -b $((blksz * nr / 2)) $((blksz * nr / 4)) $((blksz * nr / 2))" "$testdir/file3" >> "$seqres.full" > > +_pwrite_byte 0x63 $((blksz * nr / 4)) $((blksz * nr / 2)) "$testdir/file3.chk" >> "$seqres.full" > > +_scratch_remount > > These could really do with local variables to keep the verbosity > down and make it easy to change in future. > > off=$((blksz * nr / 4)) > iosz=$((blksz * nr / 2)) > > $XFS_IO_PROG -d -c "pwrite -S 0x63 -b $iosz $off $iosz" $testdir/file3 > _pwrite_byte 0x63 $off $iosz $testdir/file3.chk Done. I decided on cowoff and cowsz since that's what we're doing. --D > > -Dave. > -- > Dave Chinner > david@fromorbit.com > > _______________________________________________ > xfs mailing list > xfs@oss.sgi.com > http://oss.sgi.com/mailman/listinfo/xfs From darrick.wong@oracle.com Tue Feb 9 19:06:41 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay1.corp.sgi.com [137.38.102.111]) by oss.sgi.com (Postfix) with ESMTP id 2744A29DF5 for ; Tue, 9 Feb 2016 19:06:41 -0600 (CST) Received: from cuda.sgi.com (cuda3.sgi.com [192.48.176.15]) by relay1.corp.sgi.com (Postfix) with ESMTP id 15C0E8F8040 for ; Tue, 9 Feb 2016 17:06:41 -0800 (PST) X-ASG-Debug-ID: 1455066398-04cb6c1e5932800001-NocioJ Received: from aserp1040.oracle.com (aserp1040.oracle.com [141.146.126.69]) by cuda.sgi.com with ESMTP id cdSdbHvsfZXDApp4 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO) for ; Tue, 09 Feb 2016 17:06:39 -0800 (PST) X-Barracuda-Envelope-From: darrick.wong@oracle.com X-Barracuda-Apparent-Source-IP: 141.146.126.69 Received: from userv0021.oracle.com (userv0021.oracle.com [156.151.31.71]) by aserp1040.oracle.com (Sentrion-MTA-4.3.2/Sentrion-MTA-4.3.2) with ESMTP id u1A16YPA008115 (version=TLSv1 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Wed, 10 Feb 2016 01:06:34 GMT Received: from userv0121.oracle.com (userv0121.oracle.com [156.151.31.72]) by userv0021.oracle.com (8.13.8/8.13.8) with ESMTP id u1A16X5G004313 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=FAIL); Wed, 10 Feb 2016 01:06:33 GMT Received: from abhmp0005.oracle.com (abhmp0005.oracle.com [141.146.116.11]) by userv0121.oracle.com (8.13.8/8.13.8) with ESMTP id u1A16XQ4032743; Wed, 10 Feb 2016 01:06:33 GMT Received: from localhost (/10.145.178.207) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Tue, 09 Feb 2016 17:06:33 -0800 Date: Tue, 9 Feb 2016 17:06:31 -0800 From: "Darrick J. Wong" To: Dave Chinner Cc: fstests@vger.kernel.org, linux-btrfs@vger.kernel.org, xfs@oss.sgi.com Subject: Re: [PATCH 18/23] xfs: test the automatic cowextsize extent garbage collector Message-ID: <20160210010631.GG6350@birch.djwong.org> X-ASG-Orig-Subj: Re: [PATCH 18/23] xfs: test the automatic cowextsize extent garbage collector References: <20160209011145.23099.95354.stgit@birch.djwong.org> <20160209011342.23099.23019.stgit@birch.djwong.org> <20160209081547.GN19486@dastard> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20160209081547.GN19486@dastard> User-Agent: Mutt/1.5.21 (2010-09-15) X-Source-IP: userv0021.oracle.com [156.151.31.71] X-Barracuda-Connect: aserp1040.oracle.com[141.146.126.69] X-Barracuda-Start-Time: 1455066399 X-Barracuda-Encrypted: ECDHE-RSA-AES256-GCM-SHA384 X-Barracuda-URL: https://192.48.176.15:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-BRTS-Status: 1 X-Barracuda-Spam-Score: 0.00 X-Barracuda-Spam-Status: No, SCORE=0.00 using per-user scores of TAG_LEVEL=1000.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.7 tests=BSF_SC0_MISMATCH_TO, UNPARSEABLE_RELAY X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.3.26903 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 0.00 BSF_SC0_MISMATCH_TO Envelope rcpt doesn't match header 0.00 UNPARSEABLE_RELAY Informational: message has unparseable relay lines On Tue, Feb 09, 2016 at 07:15:47PM +1100, Dave Chinner wrote: > On Mon, Feb 08, 2016 at 05:13:42PM -0800, Darrick J. Wong wrote: > > Signed-off-by: Darrick J. Wong > > + > > +_cleanup() > > +{ > > + cd / > > + echo $old_cow_lifetime > /proc/sys/fs/xfs/speculative_cow_prealloc_lifetime > > + #rm -rf "$tmp".* "$testdir" > > uncomment. > > > +echo "CoW and leave leftovers" > > +echo $old_cow_lifetime > /proc/sys/fs/xfs/speculative_cow_prealloc_lifetime > > +seq 2 2 $((nr - 1)) | while read f; do > > + "$XFS_IO_PROG" -f -c "pwrite -S 0x63 $((blksz * f)) 1" "$testdir/file2" >> "$seqres.full" > > + "$XFS_IO_PROG" -f -c "pwrite -S 0x63 $((blksz * f)) 1" "$testdir/file2.chk" >> "$seqres.full" > > +done > > Ok, I just realised what was bugging me about these loops: "f" is > not a typical loop iterator for a count. Normally we'd use "i" for > these.... > > > +echo "old extents: $old_extents" >> "$seqres.full" > > +echo "new extents: $new_extents" >> "$seqres.full" > > +echo "maximum extents: $internal_blks" >> "$seqres.full" > > +test $new_extents -lt $((internal_blks / 7)) || _fail "file2 badly fragmented" > > I wouldn't use _fail like this, echo is sufficient to cause the test > to fail. Ok, fixed. --D > > +echo "Check for damage" > > +umount "$SCRATCH_MNT" > > + > > +# success, all done > > +status=0 > > +exit > > As would getting rid of the unmount and just setting status > appropriately... > > /repeat > > -Dave. > -- > Dave Chinner > david@fromorbit.com > > _______________________________________________ > xfs mailing list > xfs@oss.sgi.com > http://oss.sgi.com/mailman/listinfo/xfs From darrick.wong@oracle.com Tue Feb 9 19:07:36 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay2.corp.sgi.com [137.38.102.29]) by oss.sgi.com (Postfix) with ESMTP id 18ACD29DF5 for ; Tue, 9 Feb 2016 19:07:36 -0600 (CST) Received: from cuda.sgi.com (cuda1.sgi.com [192.48.157.11]) by relay2.corp.sgi.com (Postfix) with ESMTP id D5EEC304039 for ; Tue, 9 Feb 2016 17:07:35 -0800 (PST) X-ASG-Debug-ID: 1455066450-04bdf066ea34310001-NocioJ Received: from userp1040.oracle.com (userp1040.oracle.com [156.151.31.81]) by cuda.sgi.com with ESMTP id yjVHWZ17DNxklpaU (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO) for ; Tue, 09 Feb 2016 17:07:30 -0800 (PST) X-Barracuda-Envelope-From: darrick.wong@oracle.com X-Barracuda-Apparent-Source-IP: 156.151.31.81 Received: from userv0022.oracle.com (userv0022.oracle.com [156.151.31.74]) by userp1040.oracle.com (Sentrion-MTA-4.3.2/Sentrion-MTA-4.3.2) with ESMTP id u1A17PUB029000 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 10 Feb 2016 01:07:25 GMT Received: from userv0122.oracle.com (userv0122.oracle.com [156.151.31.75]) by userv0022.oracle.com (8.14.4/8.13.8) with ESMTP id u1A17PCe019871 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL); Wed, 10 Feb 2016 01:07:25 GMT Received: from abhmp0007.oracle.com (abhmp0007.oracle.com [141.146.116.13]) by userv0122.oracle.com (8.14.4/8.14.4) with ESMTP id u1A17PKY019550; Wed, 10 Feb 2016 01:07:25 GMT Received: from localhost (/10.145.178.207) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Tue, 09 Feb 2016 17:07:24 -0800 Date: Tue, 9 Feb 2016 17:07:23 -0800 From: "Darrick J. Wong" To: Dave Chinner Cc: fstests@vger.kernel.org, linux-btrfs@vger.kernel.org, xfs@oss.sgi.com Subject: Re: [PATCH 19/23] xfs: test rmapbt functionality Message-ID: <20160210010723.GH6350@birch.djwong.org> X-ASG-Orig-Subj: Re: [PATCH 19/23] xfs: test rmapbt functionality References: <20160209011145.23099.95354.stgit@birch.djwong.org> <20160209011348.23099.30668.stgit@birch.djwong.org> <20160209082639.GO19486@dastard> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20160209082639.GO19486@dastard> User-Agent: Mutt/1.5.21 (2010-09-15) X-Source-IP: userv0022.oracle.com [156.151.31.74] X-Barracuda-Connect: userp1040.oracle.com[156.151.31.81] X-Barracuda-Start-Time: 1455066450 X-Barracuda-Encrypted: ECDHE-RSA-AES256-GCM-SHA384 X-Barracuda-URL: https://192.48.157.11:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-BRTS-Status: 1 X-Barracuda-Spam-Score: 0.00 X-Barracuda-Spam-Status: No, SCORE=0.00 using per-user scores of TAG_LEVEL=1000.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.7 tests=BSF_SC0_MISMATCH_TO, UNPARSEABLE_RELAY X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.3.26903 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 0.00 BSF_SC0_MISMATCH_TO Envelope rcpt doesn't match header 0.00 UNPARSEABLE_RELAY Informational: message has unparseable relay lines On Tue, Feb 09, 2016 at 07:26:40PM +1100, Dave Chinner wrote: > On Mon, Feb 08, 2016 at 05:13:48PM -0800, Darrick J. Wong wrote: > > Signed-off-by: Darrick J. Wong > > --- > > common/xfs | 44 ++++++++++++++++++++++ > > tests/xfs/233 | 78 ++++++++++++++++++++++++++++++++++++++ > > tests/xfs/233.out | 6 +++ > > tests/xfs/234 | 89 ++++++++++++++++++++++++++++++++++++++++++++ > > tests/xfs/234.out | 6 +++ > > tests/xfs/235 | 108 +++++++++++++++++++++++++++++++++++++++++++++++++++++ > > tests/xfs/235.out | 14 +++++++ > > tests/xfs/236 | 93 ++++++++++++++++++++++++++++++++++++++++++++++ > > tests/xfs/236.out | 8 ++++ > > tests/xfs/group | 4 ++ > > 10 files changed, 450 insertions(+) > > create mode 100644 common/xfs > > create mode 100755 tests/xfs/233 > > create mode 100644 tests/xfs/233.out > > create mode 100755 tests/xfs/234 > > create mode 100644 tests/xfs/234.out > > create mode 100755 tests/xfs/235 > > create mode 100644 tests/xfs/235.out > > create mode 100755 tests/xfs/236 > > create mode 100644 tests/xfs/236.out > > > > > > diff --git a/common/xfs b/common/xfs > > new file mode 100644 > > index 0000000..2d1a76f > > --- /dev/null > > +++ b/common/xfs > > @@ -0,0 +1,44 @@ > > +##/bin/bash > > +# Routines for handling XFS > > +#----------------------------------------------------------------------- > > +# Copyright (c) 2015 Oracle. All Rights Reserved. > > +# This program is free software; you can redistribute it and/or modify > > +# it under the terms of the GNU General Public License as published by > > +# the Free Software Foundation; either version 2 of the License, or > > +# (at your option) any later version. > > +# > > +# This program is distributed in the hope that it will be useful, > > +# but WITHOUT ANY WARRANTY; without even the implied warranty of > > +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the > > +# GNU General Public License for more details. > > +# > > +# You should have received a copy of the GNU General Public License > > +# along with this program; if not, write to the Free Software > > +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 > > +# USA > > +# > > +# Contact information: Oracle Corporation, 500 Oracle Parkway, > > +# Redwood Shores, CA 94065, USA, or: http://www.oracle.com/ > > +#----------------------------------------------------------------------- > > + > > +_require_xfs_test_rmapbt() > > +{ > > + _require_test > > + > > + if [ "$(xfs_info "$TEST_DIR" | grep -c "rmapbt=1")" -ne 1 ]; then > > + _notrun "rmapbt not supported by test filesystem type: $FSTYP" > > + fi > > +} > > + > > +_require_xfs_scratch_rmapbt() > > +{ > > + _require_scratch > > + > > + _scratch_mkfs > /dev/null > > + _scratch_mount > > + if [ "$(xfs_info "$SCRATCH_MNT" | grep -c "rmapbt=1")" -ne 1 ]; then > > + _scratch_unmount > > + _notrun "rmapbt not supported by scratch filesystem type: $FSTYP" > > + fi > > + _scratch_unmount > > +} > > No, not yet. :) > > Wait until I get my "split common/rc" patchset out there, because it > does not require: Ok, I moved all the common/xfs stuff back to common/rc. > > > +# get standard environment, filters and checks > > +. ./common/rc > > +. ./common/filter > > +. ./common/xfs > > This. > > And i don't want to have to undo a bunch of stuff in tests yet. Just > lump it all in common/rc for the moment. > > > + > > +# real QA test starts here > > +_supported_os Linux > > +_supported_fs xfs > > +_require_xfs_scratch_rmapbt > > + > > +echo "Format and mount" > > +_scratch_mkfs -d size=$((2 * 4096 * 4096)) -l size=4194304 > "$seqres.full" 2>&1 > > +_scratch_mount >> "$seqres.full" 2>&1 > > _scratch_mkfs_sized ? Done. > > > +here=`pwd` > > +tmp=/tmp/$$ > > +status=1 # failure is the default! > > +trap "_cleanup; exit \$status" 0 1 2 3 15 > > + > > +_cleanup() > > +{ > > + cd / > > + #rm -f $tmp.* > > More random uncommenting needed. > > > + > > +echo "Check for damage" > > +umount "$SCRATCH_MNT" > > +_check_scratch_fs > > + > > +# success, all done > > +status=0 > > +exit > > Cull. Done --D > > -Dave. > -- > Dave Chinner > david@fromorbit.com > > _______________________________________________ > xfs mailing list > xfs@oss.sgi.com > http://oss.sgi.com/mailman/listinfo/xfs From billodo@redhat.com Tue Feb 9 19:35:02 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=ham version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay2.corp.sgi.com [137.38.102.29]) by oss.sgi.com (Postfix) with ESMTP id CD67E29DF5 for ; Tue, 9 Feb 2016 19:35:02 -0600 (CST) Received: from cuda.sgi.com (cuda1.sgi.com [192.48.157.11]) by relay2.corp.sgi.com (Postfix) with ESMTP id 9E6E6304051 for ; Tue, 9 Feb 2016 17:35:02 -0800 (PST) X-ASG-Debug-ID: 1455068100-04bdf066ea34a70001-NocioJ Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by cuda.sgi.com with ESMTP id Sz7nU59pV8rRgQsc (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO) for ; Tue, 09 Feb 2016 17:35:01 -0800 (PST) X-Barracuda-Envelope-From: billodo@redhat.com X-Barracuda-Apparent-Source-IP: 209.132.183.28 X-ASG-Whitelist: Client Received: from int-mx09.intmail.prod.int.phx2.redhat.com (int-mx09.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by mx1.redhat.com (Postfix) with ESMTPS id C396BC0C234B for ; Wed, 10 Feb 2016 01:35:00 +0000 (UTC) Received: from localhost.localdomain.com (unused [10.10.50.117] (may be forged)) by int-mx09.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id u1A1Z0jF010438 for ; Tue, 9 Feb 2016 20:35:00 -0500 From: "Bill O'Donnell" To: xfs@oss.sgi.com Subject: [[PATCH 2/2 v2] xfs_repair: new secondary superblock search method] xfs_repair: new secondary superblock search method Date: Tue, 9 Feb 2016 19:34:59 -0600 X-ASG-Orig-Subj: [[PATCH 2/2 v2] xfs_repair: new secondary superblock search method] xfs_repair: new secondary superblock search method Message-Id: <1455068099-26992-1-git-send-email-billodo@redhat.com> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.22 X-Barracuda-Connect: mx1.redhat.com[209.132.183.28] X-Barracuda-Start-Time: 1455068101 X-Barracuda-Encrypted: ECDHE-RSA-AES256-GCM-SHA384 X-Barracuda-URL: https://192.48.157.11:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-BRTS-Status: 1 Optimize secondary sb search, using similar method to find fs geometry as that of xfs_mkfs. If this faster method fails in finding a secondary sb, fall back to original brute force slower search. Signed-off-by: Bill O'Donnell --- Makefile | 2 +- include/libxcmd.h | 4 +++- libxcmd/topology.c | 35 ++++++++++++++++++++++++++++---- repair/Makefile | 4 ++-- repair/sb.c | 58 ++++++++++++++++++++++++++++++++++++++++++++---------- 5 files changed, 85 insertions(+), 18 deletions(-) diff --git a/Makefile b/Makefile index fca0a42..1d60d9c 100644 --- a/Makefile +++ b/Makefile @@ -80,7 +80,7 @@ fsr: libhandle growfs: libxcmd io: libxcmd libhandle quota: libxcmd -repair: libxlog +repair: libxlog libxcmd copy: libxlog ifeq ($(HAVE_BUILDDEFS), yes) diff --git a/include/libxcmd.h b/include/libxcmd.h index df7046e..b140adb 100644 --- a/include/libxcmd.h +++ b/include/libxcmd.h @@ -50,6 +50,8 @@ extern int check_overwrite( char *device); - +extern int guess_default_geometry(__uint64_t *agsize, + __uint64_t *agcount, + libxfs_init_t x); #endif /* __LIBXCMD_H__ */ diff --git a/libxcmd/topology.c b/libxcmd/topology.c index 0eeea28..b98d9b9 100644 --- a/libxcmd/topology.c +++ b/libxcmd/topology.c @@ -192,7 +192,8 @@ out: return ret; } -static void blkid_get_topology( +static void +blkid_get_topology( const char *device, int *sunit, int *swidth, @@ -284,7 +285,8 @@ check_overwrite( return 1; } -static void blkid_get_topology( +static void +blkid_get_topology( const char *device, int *sunit, int *swidth, @@ -302,8 +304,8 @@ static void blkid_get_topology( #endif /* ENABLE_BLKID */ - -void get_topology( +void +get_topology( libxfs_init_t *xi, struct fs_topology *ft, int force_overwrite) @@ -346,3 +348,28 @@ void get_topology( &lsectorsize, &psectorsize, force_overwrite); } } + +int +guess_default_geometry(__uint64_t *agsize, __uint64_t *agcount, + libxfs_init_t x) +{ + struct fs_topology ft; + int blocklog; + __uint64_t dblocks; + int multidisk; + + memset(&ft, 0, sizeof(ft)); + get_topology(&x, &ft, 1); + + /* + * get geometry from get_topology result. + * Use default block size (2^12) + */ + blocklog = 12; + multidisk = ft.dswidth | ft.dsunit; + dblocks = x.dsize >> (blocklog - BBSHIFT); + calc_default_ag_geometry(blocklog, dblocks, multidisk, + agsize, agcount); + + return blocklog; +} diff --git a/repair/Makefile b/repair/Makefile index 251722b..d24ab1f 100644 --- a/repair/Makefile +++ b/repair/Makefile @@ -20,8 +20,8 @@ CFILES = agheader.c attr_repair.c avl.c avl64.c bmap.c btree.c \ progress.c prefetch.c rt.c sb.c scan.c threads.c \ versions.c xfs_repair.c -LLDLIBS = $(LIBXFS) $(LIBXLOG) $(LIBUUID) $(LIBRT) $(LIBPTHREAD) -LTDEPENDENCIES = $(LIBXFS) $(LIBXLOG) +LLDLIBS = $(LIBBLKID) $(LIBXFS) $(LIBXLOG) $(LIBUUID) $(LIBRT) $(LIBPTHREAD) $(LIBXCMD) +LTDEPENDENCIES = $(LIBXFS) $(LIBXLOG) $(LIBXCMD) LLDFLAGS = -static-libtool-libs default: depend $(LTCOMMAND) diff --git a/repair/sb.c b/repair/sb.c index 4eef14a..8bc246e 100644 --- a/repair/sb.c +++ b/repair/sb.c @@ -22,6 +22,7 @@ #include "globals.h" #include "protos.h" #include "err_protos.h" +#include "libxcmd.h" #define BSIZE (1024 * 1024) @@ -85,10 +86,11 @@ copy_sb(xfs_sb_t *source, xfs_sb_t *dest) } /* - * find a secondary superblock, copy it into the sb buffer + * find a secondary superblock, copy it into the sb buffer. + * skipsize units is bytes, it contains either the agsize in bytes + * (if known), or the minimum agsize in bytes if agsize unknown. */ -int -find_secondary_sb(xfs_sb_t *rsb) +static int __find_secondary_sb(xfs_sb_t *rsb, __uint64_t skipsize) { xfs_off_t off; xfs_sb_t *sb; @@ -99,9 +101,9 @@ find_secondary_sb(xfs_sb_t *rsb) int dirty; int retval; int bsize; + int readsize; do_warn(_("\nattempting to find secondary superblock...\n")); - sb = (xfs_sb_t *)memalign(libxfs_device_alignment(), BSIZE); if (!sb) { do_error( @@ -113,13 +115,16 @@ find_secondary_sb(xfs_sb_t *rsb) retval = 0; dirty = 0; bsize = 0; + readsize = 0; /* * skip first sector since we know that's bad */ - for (done = 0, off = XFS_AG_MIN_BYTES; !done ; off += bsize) { + for (done = 0, off = skipsize; !done ; off += readsize) { /* - * read disk 1 MByte at a time. + * read disk using readsize interval + * (either the bytecount of actual agsize or bsize if + * agsize undetermined.) */ if (lseek64(x.dfd, off, SEEK_SET) != off) { done = 1; @@ -128,9 +133,13 @@ find_secondary_sb(xfs_sb_t *rsb) if (!done && (bsize = read(x.dfd, sb, BSIZE)) <= 0) { done = 1; } - + if (skipsize == XFS_AG_MIN_BYTES) { + readsize = bsize; + } + else { + readsize = skipsize; + } do_warn("."); - /* * check the buffer 512 bytes at a time since * we don't know how big the sectors really are. @@ -164,9 +173,38 @@ find_secondary_sb(xfs_sb_t *rsb) } } } - free(sb); - return(retval); + return retval; +} + +int +find_secondary_sb(xfs_sb_t *rsb) +{ + int retval; + __uint64_t skipsize; + __uint64_t agcount; + __uint64_t agsize; + int blocklog; + + /* + * Attempt to find secondary sb with a coarse approach, + * using a large skipsize (agsize in bytes). Failing that, + * fallback to the fine-grained approach using min agsize. + */ + blocklog = guess_default_geometry(&agsize, &agcount, x); + + /* + * use found ag geometry to quickly find secondary sb + */ + skipsize = agsize << blocklog; + retval = __find_secondary_sb(rsb, skipsize); + if (!retval) { + /* + * fallback: use minimum agsize for skipsize + */ + retval = __find_secondary_sb(rsb, XFS_AG_MIN_BYTES); + } + return retval; } /* -- 2.5.0 From darrick.wong@oracle.com Tue Feb 9 19:39:00 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay1.corp.sgi.com [137.38.102.111]) by oss.sgi.com (Postfix) with ESMTP id 0A56C29DF5 for ; Tue, 9 Feb 2016 19:39:00 -0600 (CST) Received: from cuda.sgi.com (cuda2.sgi.com [192.48.176.25]) by relay1.corp.sgi.com (Postfix) with ESMTP id EE67D8F804C for ; Tue, 9 Feb 2016 17:38:59 -0800 (PST) X-ASG-Debug-ID: 1455068333-04cbb0433449cc0001-NocioJ Received: from aserp1040.oracle.com (aserp1040.oracle.com [141.146.126.69]) by cuda.sgi.com with ESMTP id wuMLWfvHLSlwahwT (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO) for ; Tue, 09 Feb 2016 17:38:53 -0800 (PST) X-Barracuda-Envelope-From: darrick.wong@oracle.com X-Barracuda-Apparent-Source-IP: 141.146.126.69 Received: from aserv0021.oracle.com (aserv0021.oracle.com [141.146.126.233]) by aserp1040.oracle.com (Sentrion-MTA-4.3.2/Sentrion-MTA-4.3.2) with ESMTP id u1A1cpU0003031 (version=TLSv1 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Wed, 10 Feb 2016 01:38:51 GMT Received: from aserv0122.oracle.com (aserv0122.oracle.com [141.146.126.236]) by aserv0021.oracle.com (8.13.8/8.13.8) with ESMTP id u1A1coER006314 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=FAIL); Wed, 10 Feb 2016 01:38:51 GMT Received: from abhmp0002.oracle.com (abhmp0002.oracle.com [141.146.116.8]) by aserv0122.oracle.com (8.13.8/8.13.8) with ESMTP id u1A1coPU030595; Wed, 10 Feb 2016 01:38:50 GMT Received: from localhost (/10.145.178.207) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Tue, 09 Feb 2016 17:38:50 -0800 Date: Tue, 9 Feb 2016 17:38:49 -0800 From: "Darrick J. Wong" To: Christoph Hellwig Cc: xfs@oss.sgi.com Subject: Re: [PATCH] xfs: handle AGs without reservation in xfs_refcountbt_free_reserve_pool Message-ID: <20160210013849.GB23904@birch.djwong.org> X-ASG-Orig-Subj: Re: [PATCH] xfs: handle AGs without reservation in xfs_refcountbt_free_reserve_pool References: <1455035539-24535-1-git-send-email-hch@lst.de> <1455035539-24535-2-git-send-email-hch@lst.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1455035539-24535-2-git-send-email-hch@lst.de> User-Agent: Mutt/1.5.21 (2010-09-15) X-Source-IP: aserv0021.oracle.com [141.146.126.233] X-Barracuda-Connect: aserp1040.oracle.com[141.146.126.69] X-Barracuda-Start-Time: 1455068333 X-Barracuda-Encrypted: ECDHE-RSA-AES256-GCM-SHA384 X-Barracuda-URL: https://192.48.176.25:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-BRTS-Status: 1 X-Barracuda-Spam-Score: 0.00 X-Barracuda-Spam-Status: No, SCORE=0.00 using per-user scores of TAG_LEVEL=1000.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.7 tests=BSF_SC0_MISMATCH_TO, UNPARSEABLE_RELAY X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.3.26904 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 0.00 BSF_SC0_MISMATCH_TO Envelope rcpt doesn't match header 0.00 UNPARSEABLE_RELAY Informational: message has unparseable relay lines On Tue, Feb 09, 2016 at 05:32:19PM +0100, Christoph Hellwig wrote: > See http://www.infradead.org/rpr.html > > Without this xfstests starts crashing and burning in generic/003. Good catch, thanks. Will apply. --D > > Signed-off-by: Christoph Hellwig > --- > fs/xfs/libxfs/xfs_refcount_btree.c | 4 ++++ > 1 file changed, 4 insertions(+) > > diff --git a/fs/xfs/libxfs/xfs_refcount_btree.c b/fs/xfs/libxfs/xfs_refcount_btree.c > index 31e1b2d..f78041c 100644 > --- a/fs/xfs/libxfs/xfs_refcount_btree.c > +++ b/fs/xfs/libxfs/xfs_refcount_btree.c > @@ -539,6 +539,10 @@ xfs_refcountbt_free_reserve_pool( > pool_len = 0; > for (agno = 0; agno < mp->m_sb.sb_agcount; agno++) { > pag = xfs_perag_get(mp, agno); > + if (!pag->pagf_refcountbt_resv) { > + xfs_perag_put(pag); > + continue; > + } > i = xfs_ag_resv_blocks(pag->pagf_refcountbt_resv); > if (pool_len < i) > pool_len = i; > -- > 2.1.4 > From debbugs@buxtehude.debian.org Tue Feb 9 21:21:16 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=ham version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay1.corp.sgi.com [137.38.102.111]) by oss.sgi.com (Postfix) with ESMTP id 2DA5529DF5 for ; Tue, 9 Feb 2016 21:21:16 -0600 (CST) Received: from cuda.sgi.com (cuda1.sgi.com [192.48.157.11]) by relay1.corp.sgi.com (Postfix) with ESMTP id 0444E8F8033 for ; Tue, 9 Feb 2016 19:21:12 -0800 (PST) X-ASG-Debug-ID: 1455074465-04bdf066eb36450001-NocioJ Received: from buxtehude.debian.org (buxtehude.debian.org [206.12.19.147]) by cuda.sgi.com with ESMTP id VGeO90NIdWfdYwSB (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128 verify=NO) for ; Tue, 09 Feb 2016 19:21:06 -0800 (PST) X-Barracuda-Envelope-From: debbugs@buxtehude.debian.org X-Barracuda-Apparent-Source-IP: 206.12.19.147 Received: from debbugs by buxtehude.debian.org with local (Exim 4.84) (envelope-from ) id 1aTLKx-00020n-If; Wed, 10 Feb 2016 03:21:03 +0000 X-Loop: owner@bugs.debian.org Subject: Bug#766811: spurious library links Reply-To: Marco d'Itri , 766811@bugs.debian.org X-ASG-Orig-Subj: Bug#766811: spurious library links Resent-From: Marco d'Itri Resent-To: debian-bugs-dist@lists.debian.org Resent-CC: XFS Development Team X-Loop: owner@bugs.debian.org Resent-Date: Wed, 10 Feb 2016 03:21:01 +0000 Resent-Message-ID: X-Debian-PR-Message: followup 766811 X-Debian-PR-Package: xfslibs-dev X-Debian-PR-Keywords: X-Debian-PR-Source: xfsprogs Received: via spool by 766811-submit@bugs.debian.org id=B766811.14550742356531 (code B ref 766811); Wed, 10 Feb 2016 03:21:01 +0000 Received: (at 766811) by bugs.debian.org; 10 Feb 2016 03:17:15 +0000 Received: from attila.bofh.it ([85.94.204.146] ident=postfix) by buxtehude.debian.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84) (envelope-from ) id 1aTLHH-0001h9-1M for 766811@bugs.debian.org; Wed, 10 Feb 2016 03:17:15 +0000 Received: by attila.bofh.it (Postfix, from userid 10) id 54C842E79A; Wed, 10 Feb 2016 04:17:12 +0100 (CET) Received: by bongo.bofh.it (Postfix, from userid 1000) id 2E7472C06E3; Wed, 10 Feb 2016 04:17:03 +0100 (CET) Date: Wed, 10 Feb 2016 04:17:03 +0100 From: Marco d'Itri To: Jakub Wilk , 766811@bugs.debian.org Cc: Nathan Scott Message-ID: <20160210031703.GA28092@bongo.bofh.it> References: <20141026004825.GA27863@bongo.bofh.it> <20160124151308.GA7620@jwilk.net> <20160206005821.GA11551@bongo.bofh.it> <20160206132241.GA2869@jwilk.net> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="lrZ03NoBR/3+SXJZ" Content-Disposition: inline In-Reply-To: <20160206132241.GA2869@jwilk.net> User-Agent: Mutt/1.5.24 (2015-08-30) X-Barracuda-Connect: buxtehude.debian.org[206.12.19.147] X-Barracuda-Start-Time: 1455074466 X-Barracuda-Encrypted: ECDHE-RSA-AES128-GCM-SHA256 X-Barracuda-URL: https://192.48.157.11:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-BRTS-Status: 1 X-Barracuda-Spam-Score: 0.00 X-Barracuda-Spam-Status: No, SCORE=0.00 using per-user scores of TAG_LEVEL=1000.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.7 tests=BSF_SC0_MISMATCH_TO X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.3.26906 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 0.00 BSF_SC0_MISMATCH_TO Envelope rcpt doesn't match header --lrZ03NoBR/3+SXJZ Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Feb 06, Jakub Wilk wrote: > AFAICS this is the code responsible for creating /lib/libfoo <-> > /usr/lib/libfoo symlinks (see include/buildmacros:79): >=20 > if [ "x$(shell readlink -f $(PKG_LIB_DIR))" !=3D \ > "x$(shell readlink -f $(PKG_ROOT_LIB_DIR))" ]; then \ > ../$(INSTALL) -S $(PKG_LIB_DIR)/$(LIBNAME).a $(PKG_ROOT_LIB_DIR)/$= (LIBNAME).a; \ > ../$(INSTALL) -S $(PKG_LIB_DIR)/$(LIBNAME).la $(PKG_ROOT_LIB_DIR)/= $(LIBNAME).la; \ > ../$(INSTALL) -S $(PKG_ROOT_LIB_DIR)/$(LIBNAME).so $(PKG_LIB_DIR)/= $(LIBNAME).so; \ > fi Right. Nathan, this code path is not used on Red Hat and SuSE, which=20 already implemented a merged /usr, and it has always been wrong on=20 Debian: I think it should just be removed from the upstream package. Should I NMU? --=20 ciao, Marco --lrZ03NoBR/3+SXJZ Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQGcBAABCAAGBQJWuquuAAoJECv1pcEixPekwqYL/ibZvMwsMHnY/EEQrMZ/dWfS sxjYZ92PK4lTygL6HhnTOgvoRoYudG9y0RCXHaFt8oorpqVWr9KBXkfPZCrVGDzW oniT/6Nf3PDv9EeCtdCMLCS1CnjafxMXZZjC0YFj3/gtbnaAe8/X4nEldH4xV6U5 xrecDDqHRPcE+M3Ep+oLs7Bmmh9hBNNXiGZ33S8qCZ2lPzakzhLiqCIPP7X4vfUR MXI6YxgGJiKl9j1KvYCGnf5CkG1Rs0t3NOCd3bEuZbecFjckWSaqSgdtXZ7GaXCK 02Yh+nWKEe1iSWc8dHt1CocNXAv2zxkD4DnBMhCIWGB05cCWDRCUbYpaiSx7Xblc xfHv8Cb+QUiNzVIGA20sj4DFAoji6gtMs+Xfcq9ETKQ/utjhAmRyscVuv39Wzgi7 TFShOzeG3RjtEyEIYo5lnNy3QbclMWcQ8f6rv7JiW8uh7ULXameF4X8L3kITOkhw /AmaI80AFrmYVX1sJfm7GNq0OOkv+gZSvf7e80/rOQ== =aLcJ -----END PGP SIGNATURE----- --lrZ03NoBR/3+SXJZ-- From debbugs@buxtehude.debian.org Tue Feb 9 21:24:08 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=ham version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay1.corp.sgi.com [137.38.102.111]) by oss.sgi.com (Postfix) with ESMTP id 4A98829DF5 for ; Tue, 9 Feb 2016 21:24:08 -0600 (CST) Received: from cuda.sgi.com (cuda3.sgi.com [192.48.176.15]) by relay1.corp.sgi.com (Postfix) with ESMTP id 320DE8F8040 for ; Tue, 9 Feb 2016 19:24:08 -0800 (PST) X-ASG-Debug-ID: 1455074646-04cb6c1e5634890001-NocioJ Received: from buxtehude.debian.org (buxtehude.debian.org [206.12.19.147]) by cuda.sgi.com with ESMTP id KNGWWY9OagXK9vZu (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128 verify=NO) for ; Tue, 09 Feb 2016 19:24:06 -0800 (PST) X-Barracuda-Envelope-From: debbugs@buxtehude.debian.org X-Barracuda-Apparent-Source-IP: 206.12.19.147 Received: from debbugs by buxtehude.debian.org with local (Exim 4.84) (envelope-from ) id 1aTLNs-00026p-9O; Wed, 10 Feb 2016 03:24:04 +0000 X-Loop: owner@bugs.debian.org Subject: Bug#766811: spurious library links Reply-To: Nathan Scott , 766811@bugs.debian.org X-ASG-Orig-Subj: Bug#766811: spurious library links Resent-From: Nathan Scott Resent-To: debian-bugs-dist@lists.debian.org Resent-CC: XFS Development Team X-Loop: owner@bugs.debian.org Resent-Date: Wed, 10 Feb 2016 03:24:02 +0000 Resent-Message-ID: X-Debian-PR-Message: followup 766811 X-Debian-PR-Package: xfslibs-dev X-Debian-PR-Keywords: X-Debian-PR-Source: xfsprogs Received: via spool by 766811-submit@bugs.debian.org id=B766811.14550744297682 (code B ref 766811); Wed, 10 Feb 2016 03:24:02 +0000 Received: (at 766811) by bugs.debian.org; 10 Feb 2016 03:20:29 +0000 Received: from mx6-phx2.redhat.com ([209.132.183.39]) by buxtehude.debian.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84) (envelope-from ) id 1aTLKP-0001zf-MJ for 766811@bugs.debian.org; Wed, 10 Feb 2016 03:20:29 +0000 Received: from zmail20.collab.prod.int.phx2.redhat.com (zmail20.collab.prod.int.phx2.redhat.com [10.5.83.23]) by mx6-phx2.redhat.com (8.14.4/8.14.4) with ESMTP id u1A3KN7W029537; Tue, 9 Feb 2016 22:20:24 -0500 Date: Tue, 9 Feb 2016 22:20:23 -0500 (EST) From: Nathan Scott To: "Marco d'Itri" Cc: Jakub Wilk , 766811@bugs.debian.org Message-ID: <822351939.19802495.1455074423707.JavaMail.zimbra@redhat.com> In-Reply-To: <20160210031703.GA28092@bongo.bofh.it> References: <20141026004825.GA27863@bongo.bofh.it> <20160124151308.GA7620@jwilk.net> <20160206005821.GA11551@bongo.bofh.it> <20160206132241.GA2869@jwilk.net> <20160210031703.GA28092@bongo.bofh.it> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-Originating-IP: [10.64.51.217] X-Mailer: Zimbra 8.0.6_GA_5922 (ZimbraWebClient - FF44 (Linux)/8.0.6_GA_5922) Thread-Topic: Bug#766811: spurious library links Thread-Index: JDBy8CxL5awVIts4gTSqOhP6OiQjDw== X-Barracuda-Connect: buxtehude.debian.org[206.12.19.147] X-Barracuda-Start-Time: 1455074646 X-Barracuda-Encrypted: ECDHE-RSA-AES128-GCM-SHA256 X-Barracuda-URL: https://192.48.176.15:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-BRTS-Status: 1 X-Barracuda-Spam-Score: 0.02 X-Barracuda-Spam-Status: No, SCORE=0.02 using per-user scores of TAG_LEVEL=1000.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.7 tests=BSF_SC0_MISMATCH_TO, THREAD_INDEX, THREAD_TOPIC X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.3.26906 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 0.01 THREAD_INDEX thread-index: AcO7Y8iR61tzADqsRmmc5wNiFHEOig== 0.01 THREAD_TOPIC Thread-Topic: ...(Japanese Subject)... 0.00 BSF_SC0_MISMATCH_TO Envelope rcpt doesn't match header ----- Original Message ----- > [..] > Right. Nathan, this code path is not used on Red Hat and SuSE, which > already implemented a merged /usr, and it has always been wrong on > Debian: I think it should just be removed from the upstream package. > Should I NMU? Please go right ahead Marco - many thanks! -- Nathan From ftpmaster@ftp-master.debian.org Tue Feb 9 21:49:41 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=ham version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay1.corp.sgi.com [137.38.102.111]) by oss.sgi.com (Postfix) with ESMTP id 3827329DF5 for ; Tue, 9 Feb 2016 21:49:41 -0600 (CST) Received: from cuda.sgi.com (cuda1.sgi.com [192.48.157.11]) by relay1.corp.sgi.com (Postfix) with ESMTP id 1A9A48F8033 for ; Tue, 9 Feb 2016 19:49:40 -0800 (PST) X-ASG-Debug-ID: 1455076177-04bdf066ea36a50001-NocioJ Received: from muffat.debian.org (muffat.debian.org [206.12.19.146]) by cuda.sgi.com with ESMTP id ojKLJMjm5iGgkiOg (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128 verify=NO) for ; Tue, 09 Feb 2016 19:49:38 -0800 (PST) X-Barracuda-Envelope-From: ftpmaster@ftp-master.debian.org X-Barracuda-Apparent-Source-IP: 206.12.19.146 Received: from franck.debian.org ([138.16.160.12]) from C=NA,ST=NA,L=Ankh Morpork,O=Debian SMTP,OU=Debian SMTP CA,CN=franck.debian.org,EMAIL=hostmaster@franck.debian.org (verified) by muffat.debian.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.84) (envelope-from ) id 1aTLmb-0007nx-2o for xfs@oss.sgi.com; Wed, 10 Feb 2016 03:49:37 +0000 Received: from dak-unpriv by franck.debian.org with local (Exim 4.84) (envelope-from ) id 1aTLma-0003ci-6g for xfs@oss.sgi.com; Wed, 10 Feb 2016 03:49:36 +0000 To: xfs@oss.sgi.com From: Debian FTP Masters Subject: Processing of xfsprogs_4.3.0+nmu1_amd64.changes Date: Wed, 10 Feb 2016 03:49:36 +0000 X-ASG-Orig-Subj: Processing of xfsprogs_4.3.0+nmu1_amd64.changes X-Debian: DAK X-DAK: DAK Precedence: bulk Auto-Submitted: auto-generated X-Debian-Package: xfsprogs Message-Id: X-Barracuda-Connect: muffat.debian.org[206.12.19.146] X-Barracuda-Start-Time: 1455076178 X-Barracuda-Encrypted: ECDHE-RSA-AES128-GCM-SHA256 X-Barracuda-URL: https://192.48.157.11:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-BRTS-Status: 1 X-Barracuda-Spam-Score: 0.00 X-Barracuda-Spam-Status: No, SCORE=0.00 using per-user scores of TAG_LEVEL=1000.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.7 tests= X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.3.26906 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- xfsprogs_4.3.0+nmu1_amd64.changes uploaded successfully to localhost along with the files: xfsprogs_4.3.0+nmu1.dsc xfsprogs_4.3.0+nmu1.tar.gz xfslibs-dev_4.3.0+nmu1_amd64.deb xfsprogs-dbgsym_4.3.0+nmu1_amd64.deb xfsprogs-udeb_4.3.0+nmu1_amd64.udeb xfsprogs_4.3.0+nmu1_amd64.deb Greetings, Your Debian queue daemon (running on host franck.debian.org) From envelope@ftp-master.debian.org Tue Feb 9 22:08:04 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=ham version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay3.corp.sgi.com [198.149.34.15]) by oss.sgi.com (Postfix) with ESMTP id 695AE29DF5 for ; Tue, 9 Feb 2016 22:08:04 -0600 (CST) Received: from cuda.sgi.com (cuda1.sgi.com [192.48.157.11]) by relay3.corp.sgi.com (Postfix) with ESMTP id 01A86AC008 for ; Tue, 9 Feb 2016 20:08:00 -0800 (PST) X-ASG-Debug-ID: 1455077277-04bdf066eb36e40001-NocioJ Received: from muffat.debian.org (muffat.debian.org [206.12.19.146]) by cuda.sgi.com with ESMTP id qPFfZKGBh48mCKd3 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128 verify=NO) for ; Tue, 09 Feb 2016 20:07:58 -0800 (PST) X-Barracuda-Envelope-From: envelope@ftp-master.debian.org X-Barracuda-Apparent-Source-IP: 206.12.19.146 Received: from franck.debian.org ([138.16.160.12]) from C=NA,ST=NA,L=Ankh Morpork,O=Debian SMTP,OU=Debian SMTP CA,CN=franck.debian.org,EMAIL=hostmaster@franck.debian.org (verified) by muffat.debian.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.84) (envelope-from ) id 1aTM4L-00009B-8F; Wed, 10 Feb 2016 04:07:57 +0000 Received: from dak by franck.debian.org with local (Exim 4.84) (envelope-from ) id 1aTM4K-0005Sp-77; Wed, 10 Feb 2016 04:07:56 +0000 From: Debian FTP Masters To: XFS Development Team , Marco d'Itri X-DAK: dak process-upload X-Debian: DAK X-Debian-Package: xfsprogs Precedence: bulk Auto-Submitted: auto-generated MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 8bit Subject: xfsprogs_4.3.0+nmu1_amd64.changes ACCEPTED into unstable Message-Id: X-ASG-Orig-Subj: xfsprogs_4.3.0+nmu1_amd64.changes ACCEPTED into unstable Date: Wed, 10 Feb 2016 04:07:56 +0000 X-Barracuda-Connect: muffat.debian.org[206.12.19.146] X-Barracuda-Start-Time: 1455077278 X-Barracuda-Encrypted: ECDHE-RSA-AES128-GCM-SHA256 X-Barracuda-URL: https://192.48.157.11:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-BRTS-Status: 1 X-Barracuda-Spam-Score: 0.00 X-Barracuda-Spam-Status: No, SCORE=0.00 using per-user scores of TAG_LEVEL=1000.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.7 tests= X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.3.26906 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- Accepted: -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA256 Format: 1.8 Date: Wed, 10 Feb 2016 04:24:23 +0100 Source: xfsprogs Binary: xfsprogs xfslibs-dev xfsprogs-udeb Architecture: source amd64 Version: 4.3.0+nmu1 Distribution: unstable Urgency: medium Maintainer: XFS Development Team Changed-By: Marco d'Itri Description: xfslibs-dev - XFS filesystem-specific static libraries and headers xfsprogs - Utilities for managing the XFS filesystem xfsprogs-udeb - A stripped-down version of xfsprogs, for debian-installer (udeb) Closes: 766811 Changes: xfsprogs (4.3.0+nmu1) unstable; urgency=medium . * Non-maintainer upload. * Disabled the code in include/buildmacros which creates bogus symlinks for libraries. (Closes: #766811) Checksums-Sha1: e7ab9e37de40b7ec796ee7699202d7694b82c449 1612 xfsprogs_4.3.0+nmu1.dsc da46a0c33d081895e84a8f08f4e5d9b088bb91ca 1525950 xfsprogs_4.3.0+nmu1.tar.gz 6786a598e9718db2e871059059709c6fad0c5987 55278 xfslibs-dev_4.3.0+nmu1_amd64.deb 5cf3ce94ed683cdcece29acebdc72bdac6a63d27 4415864 xfsprogs-dbgsym_4.3.0+nmu1_amd64.deb 7e408685693cea85b70339498e98306192ca1efc 134984 xfsprogs-udeb_4.3.0+nmu1_amd64.udeb 32fd66e743c994d077e01786fc80c11ee9571163 725966 xfsprogs_4.3.0+nmu1_amd64.deb Checksums-Sha256: f46c7321b01c967a7c0aeccc730c3341288c15209c96907e88eb7cc77e3189d5 1612 xfsprogs_4.3.0+nmu1.dsc 441865bccd805797456093df460e42635b0e7bf8a2e091d17cbd3093655af5cc 1525950 xfsprogs_4.3.0+nmu1.tar.gz d521a17c64282f82768ca07005840c230e187b9eaeea5aa49d1e919388f1fbf9 55278 xfslibs-dev_4.3.0+nmu1_amd64.deb 9d8f43a1ee55d8240c9e93152e1e0c1c37319db19658de5efd3e0882c9b59c17 4415864 xfsprogs-dbgsym_4.3.0+nmu1_amd64.deb f23fbaa4475b2acd79fa2a1c455c671a3b0af4907b8689be8b44f96e456196fb 134984 xfsprogs-udeb_4.3.0+nmu1_amd64.udeb eda7a21bcc06dc4c5a2615261f0d9ca72f88cb0d050b70cdce7d692c053ec331 725966 xfsprogs_4.3.0+nmu1_amd64.deb Files: 1797bb95895c6d50445a918a0c733916 1612 admin optional xfsprogs_4.3.0+nmu1.dsc ec2437b96786bf7da8a41d2a8af15906 1525950 admin optional xfsprogs_4.3.0+nmu1.tar.gz 9e5f82404556827506c5a8b6ad548b3b 55278 libdevel extra xfslibs-dev_4.3.0+nmu1_amd64.deb 30a43366db62eba660507e7bb0101593 4415864 debug extra xfsprogs-dbgsym_4.3.0+nmu1_amd64.deb 03e5cc5a89a8b8240ae41348a2fa4de4 134984 debian-installer optional xfsprogs-udeb_4.3.0+nmu1_amd64.udeb 52343e93d42bcdb5e53ba28c30224a97 725966 admin optional xfsprogs_4.3.0+nmu1_amd64.deb Package-Type: udeb -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQGcBAEBCAAGBQJWurH+AAoJECv1pcEixPekchgMAIyQSNEE2EV7zpYyZRTdrD/J NqsoYfA7nEUMt+n3lcJBnqEKthcxyljRYpaBW96fFm5SMToe45mW0GR8QRW9tFGu top9SDXplKQVKNbCUv9BJRVtH5JOufducppVuD21XIPu7uB8FKwDHuYSDdta+UW3 bT31RQ6KLxHGvNoFeMljbscmarVeKioVo8G3BrJGOEnxv3Vfy/JBJXp/jnCmNz7z lCCkDUnAf4qZAjJ7FgxKC90SC42KyU42Cw6h2BmVVlT9zfqdzBnBqZmTQsvMJF2+ BlovBJ69JOrwy68tr9mmpbE0vcnCgakYid3h+TaAg0DBJDkVeR2llTwlN93dLGDl tyou6Yyt+LCT1iTqXnhSY1U2W5T0xHYpW4OARTLvXC4nHb7Tbw5SVyjlrEEMGLCx 0HFAeH1ksV4mK6xMokA814MMBavwmUMXa7VYIrQa4qeVriqrDVMmZNrO1guaNgzI WObmEFg89xJ8c/wC76B8BJgdKDrIhRe9YIhIZ3pN8A== =j4S+ -----END PGP SIGNATURE----- Thank you for your contribution to Debian. From debbugs@buxtehude.debian.org Tue Feb 9 22:09:20 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=ham version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay1.corp.sgi.com [137.38.102.111]) by oss.sgi.com (Postfix) with ESMTP id 2327029DF5 for ; Tue, 9 Feb 2016 22:09:20 -0600 (CST) Received: from cuda.sgi.com (cuda3.sgi.com [192.48.176.15]) by relay1.corp.sgi.com (Postfix) with ESMTP id 114708F8033 for ; Tue, 9 Feb 2016 20:09:16 -0800 (PST) X-ASG-Debug-ID: 1455077353-04cb6c1e5735230001-NocioJ Received: from buxtehude.debian.org (buxtehude.debian.org [206.12.19.147]) by cuda.sgi.com with ESMTP id eEaIkbrnwUoKmZC9 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128 verify=NO) for ; Tue, 09 Feb 2016 20:09:14 -0800 (PST) X-Barracuda-Envelope-From: debbugs@buxtehude.debian.org X-Barracuda-Apparent-Source-IP: 206.12.19.147 Received: from debbugs by buxtehude.debian.org with local (Exim 4.84) (envelope-from ) id 1aTM5X-0005ZA-U9; Wed, 10 Feb 2016 04:09:11 +0000 MIME-Version: 1.0 X-Mailer: MIME-tools 5.505 (Entity 5.505) X-Loop: owner@bugs.debian.org From: owner@bugs.debian.org (Debian Bug Tracking System) To: Marco d'Itri Subject: Bug#766811: marked as done (spurious library links) Message-ID: X-ASG-Orig-Subj: Bug#766811: marked as done (spurious library links) References: <20141026004825.GA27863@bongo.bofh.it> X-Debian-PR-Message: closed 766811 X-Debian-PR-Package: xfslibs-dev X-Debian-PR-Source: xfsprogs Date: Wed, 10 Feb 2016 04:09:11 +0000 Content-Type: multipart/mixed; boundary="----------=_1455077351-21395-0" X-Barracuda-Connect: buxtehude.debian.org[206.12.19.147] X-Barracuda-Start-Time: 1455077353 X-Barracuda-Encrypted: ECDHE-RSA-AES128-GCM-SHA256 X-Barracuda-URL: https://192.48.176.15:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-BRTS-Status: 1 X-Barracuda-Spam-Score: 0.00 X-Barracuda-Spam-Status: No, SCORE=0.00 using per-user scores of TAG_LEVEL=1000.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.7 tests=BSF_SC0_MISMATCH_TO X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.3.26906 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 0.00 BSF_SC0_MISMATCH_TO Envelope rcpt doesn't match header This is a multi-part message in MIME format... ------------=_1455077351-21395-0 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=utf-8 Your message dated Wed, 10 Feb 2016 04:07:56 +0000 with message-id and subject line Bug#766811: fixed in xfsprogs 4.3.0+nmu1 has caused the Debian Bug report #766811, regarding spurious library links to be marked as done. This means that you claim that the problem has been dealt with. If this is not the case it is now your responsibility to reopen the Bug report if necessary, and/or fix the problem forthwith. (NB: If you are a system administrator and have no idea what this message is talking about, this may indicate a serious mail system misconfiguration somewhere. Please contact owner@bugs.debian.org immediately.) --=20 766811: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=3D766811 Debian Bug Tracking System Contact owner@bugs.debian.org with problems ------------=_1455077351-21395-0 Content-Type: message/rfc822 Content-Disposition: inline Content-Transfer-Encoding: 7bit Received: (at submit) by bugs.debian.org; 26 Oct 2014 00:48:49 +0000 X-Spam-Checker-Version: SpamAssassin 3.3.2-bugs.debian.org_2005_01_02 (2011-06-06) on buxtehude.debian.org X-Spam-Level: X-Spam-Status: No, score=-18.0 required=4.0 tests=BAYES_00,HAS_PACKAGE, PGPSIGNATURE,X_DEBBUGS_CC autolearn=ham version=3.3.2-bugs.debian.org_2005_01_02 X-Spam-Bayes: score:0.0000 Tokens: new, 13; hammy, 74; neutral, 24; spammy, 0. spammytokens: hammytokens:0.000-+--H*c:pgp-sha256, 0.000-+--H*u:2014-03-12, 0.000-+--H*UA:2014-03-12, 0.000-+--H*u:1.5.23, 0.000-+--H*UA:1.5.23 Return-path: Received: from attila.bofh.it ([85.94.204.146] ident=postfix) by buxtehude.debian.org with esmtp (Exim 4.80) (envelope-from ) id 1XiC0n-000744-4E for submit@bugs.debian.org; Sun, 26 Oct 2014 00:48:49 +0000 Received: by attila.bofh.it (Postfix, from userid 10) id 166B82E384; Sun, 26 Oct 2014 02:48:46 +0200 (CEST) Received: by bongo.bofh.it (Postfix, from userid 1000) id 762652C26AC; Sun, 26 Oct 2014 02:48:25 +0200 (CEST) Date: Sun, 26 Oct 2014 02:48:25 +0200 From: Marco d'Itri To: Debian Bug Tracking System Subject: spurious library links Message-ID: <20141026004825.GA27863@bongo.bofh.it> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="T4sUOijqQbZv57TR" Content-Disposition: inline X-Reportbug-Version: 6.5.1 X-Debbugs-Cc: md@linux.it User-Agent: Mutt/1.5.23 (2014-03-12) Delivered-To: submit@bugs.debian.org --T4sUOijqQbZv57TR Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Package: xfslibs-dev Version: 3.2.1 Severity: normal These links do not appear to have any purpose and should be removed: /lib/libhandle.a -> /usr/lib/libhandle.a /lib/libhandle.la -> /usr/lib/libhandle.la /usr/lib/libhandle.so -> /lib/libhandle.so Also, policy forbids to thip the .la files at all for normal libraries. --=20 ciao, Marco --T4sUOijqQbZv57TR Content-Type: application/pgp-signature; name="signature.asc" Content-Description: Digital signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iQGcBAEBCAAGBQJUTETZAAoJECv1pcEixPekDUAL/1ZETnJTeLt6DTKimbHXxsJW gXC5vyI9/x50gPeGZM0QZDeoOqXkmn2NHww24ljtlar7SjyyKcsHVvWQ3e6h2GoW vrfTfpAmsFNlx9QqolFiiLFExJbPVUFLTuINWTzDIPR+UjMlz3k0H1x5adrRbmmX 7KfscCiEVBbo+QSdFFVd3oiBriwsBLPhLxIEVwBOvBKzG5Vx+SIfPIcbS1VMMi3L 895Xj2cq4ZCOMb7bCOFybRUm6lpzK9y5gvkW7JyF56KHCr+wzXqy+NXmv6IbyoA5 G63gITsd9lwZ+f3kTYAFgZvirSVKt30deotZTmo0L8uFjMfvN4RcaeH7JP9pN37k xgKoHeJRYPfI/scpQqNVBrGhrNke9FSbBpZt0qKBUg7NBuuncy4c1c8OUWCxehP5 iVzkTCMHzii1BtqjqiVhuwj6LZTj2hR170O1Sw2uRVFO++YVpyaQWt+zYSZkEptZ 5qQ3RGngc5ddu1V9SxTldZR0RoB/KvGruCzecNewBw== =1jn8 -----END PGP SIGNATURE----- --T4sUOijqQbZv57TR-- ------------=_1455077351-21395-0 Content-Type: message/rfc822 Content-Disposition: inline Content-Transfer-Encoding: 7bit Received: (at 766811-close) by bugs.debian.org; 10 Feb 2016 04:07:58 +0000 X-Spam-Checker-Version: SpamAssassin 3.4.0-bugs.debian.org_2005_01_02 (2014-02-07) on buxtehude.debian.org X-Spam-Level: X-Spam-Status: No, score=-9.7 required=4.0 tests=BAYES_00,DIGITS_LETTERS, FVGT_m_MULTI_ODD,HAS_BUG_NUMBER,HEADER_FROM_DIFFERENT_DOMAINS,PGPSIGNATURE, RCVD_IN_DNSWL_MED,RP_MATCHES_RCVD,URIBL_CNKR autolearn=ham autolearn_force=no version=3.4.0-bugs.debian.org_2005_01_02 X-Spam-Bayes: score:0.0000 Tokens: new, 61; hammy, 150; neutral, 162; spammy, 0. spammytokens: hammytokens:0.000-+--HX-Debian:DAK, 0.000-+--H*rp:D*ftp-master.debian.org, 0.000-+--H*MI:franck, 0.000-+--H*m:franck, 0.000-+--HX-DAK:process-upload Return-path: Received: from muffat.debian.org ([2607:f8f0:610:4000:6564:a62:ce0c:1392]) from C=NA,ST=NA,L=Ankh Morpork,O=Debian SMTP,OU=Debian SMTP CA,CN=muffat.debian.org,EMAIL=hostmaster@muffat.debian.org (verified) by buxtehude.debian.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.84) (envelope-from ) id 1aTM4M-0005Uj-4d for 766811-close@bugs.debian.org; Wed, 10 Feb 2016 04:07:58 +0000 Received: from franck.debian.org ([138.16.160.12]) from C=NA,ST=NA,L=Ankh Morpork,O=Debian SMTP,OU=Debian SMTP CA,CN=franck.debian.org,EMAIL=hostmaster@franck.debian.org (verified) by muffat.debian.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.84) (envelope-from ) id 1aTM4L-00009C-99; Wed, 10 Feb 2016 04:07:57 +0000 Received: from dak by franck.debian.org with local (Exim 4.84) (envelope-from ) id 1aTM4K-0005T8-Au; Wed, 10 Feb 2016 04:07:56 +0000 From: Marco d'Itri To: 766811-close@bugs.debian.org X-DAK: dak process-upload X-Debian: DAK X-Debian-Package: xfsprogs MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 8bit Subject: Bug#766811: fixed in xfsprogs 4.3.0+nmu1 Message-Id: Date: Wed, 10 Feb 2016 04:07:56 +0000 Source: xfsprogs Source-Version: 4.3.0+nmu1 We believe that the bug you reported is fixed in the latest version of xfsprogs, which is due to be installed in the Debian FTP archive. A summary of the changes between this version and the previous one is attached. Thank you for reporting the bug, which will now be closed. If you have further comments please address them to 766811@bugs.debian.org, and the maintainer will reopen the bug report if appropriate. Debian distribution maintenance software pp. Marco d'Itri (supplier of updated xfsprogs package) (This message was generated automatically at their request; if you believe that there is a problem with it please contact the archive administrators by mailing ftpmaster@ftp-master.debian.org) -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA256 Format: 1.8 Date: Wed, 10 Feb 2016 04:24:23 +0100 Source: xfsprogs Binary: xfsprogs xfslibs-dev xfsprogs-udeb Architecture: source amd64 Version: 4.3.0+nmu1 Distribution: unstable Urgency: medium Maintainer: XFS Development Team Changed-By: Marco d'Itri Description: xfslibs-dev - XFS filesystem-specific static libraries and headers xfsprogs - Utilities for managing the XFS filesystem xfsprogs-udeb - A stripped-down version of xfsprogs, for debian-installer (udeb) Closes: 766811 Changes: xfsprogs (4.3.0+nmu1) unstable; urgency=medium . * Non-maintainer upload. * Disabled the code in include/buildmacros which creates bogus symlinks for libraries. (Closes: #766811) Checksums-Sha1: e7ab9e37de40b7ec796ee7699202d7694b82c449 1612 xfsprogs_4.3.0+nmu1.dsc da46a0c33d081895e84a8f08f4e5d9b088bb91ca 1525950 xfsprogs_4.3.0+nmu1.tar.gz 6786a598e9718db2e871059059709c6fad0c5987 55278 xfslibs-dev_4.3.0+nmu1_amd64.deb 5cf3ce94ed683cdcece29acebdc72bdac6a63d27 4415864 xfsprogs-dbgsym_4.3.0+nmu1_amd64.deb 7e408685693cea85b70339498e98306192ca1efc 134984 xfsprogs-udeb_4.3.0+nmu1_amd64.udeb 32fd66e743c994d077e01786fc80c11ee9571163 725966 xfsprogs_4.3.0+nmu1_amd64.deb Checksums-Sha256: f46c7321b01c967a7c0aeccc730c3341288c15209c96907e88eb7cc77e3189d5 1612 xfsprogs_4.3.0+nmu1.dsc 441865bccd805797456093df460e42635b0e7bf8a2e091d17cbd3093655af5cc 1525950 xfsprogs_4.3.0+nmu1.tar.gz d521a17c64282f82768ca07005840c230e187b9eaeea5aa49d1e919388f1fbf9 55278 xfslibs-dev_4.3.0+nmu1_amd64.deb 9d8f43a1ee55d8240c9e93152e1e0c1c37319db19658de5efd3e0882c9b59c17 4415864 xfsprogs-dbgsym_4.3.0+nmu1_amd64.deb f23fbaa4475b2acd79fa2a1c455c671a3b0af4907b8689be8b44f96e456196fb 134984 xfsprogs-udeb_4.3.0+nmu1_amd64.udeb eda7a21bcc06dc4c5a2615261f0d9ca72f88cb0d050b70cdce7d692c053ec331 725966 xfsprogs_4.3.0+nmu1_amd64.deb Files: 1797bb95895c6d50445a918a0c733916 1612 admin optional xfsprogs_4.3.0+nmu1.dsc ec2437b96786bf7da8a41d2a8af15906 1525950 admin optional xfsprogs_4.3.0+nmu1.tar.gz 9e5f82404556827506c5a8b6ad548b3b 55278 libdevel extra xfslibs-dev_4.3.0+nmu1_amd64.deb 30a43366db62eba660507e7bb0101593 4415864 debug extra xfsprogs-dbgsym_4.3.0+nmu1_amd64.deb 03e5cc5a89a8b8240ae41348a2fa4de4 134984 debian-installer optional xfsprogs-udeb_4.3.0+nmu1_amd64.udeb 52343e93d42bcdb5e53ba28c30224a97 725966 admin optional xfsprogs_4.3.0+nmu1_amd64.deb Package-Type: udeb -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQGcBAEBCAAGBQJWurH+AAoJECv1pcEixPekchgMAIyQSNEE2EV7zpYyZRTdrD/J NqsoYfA7nEUMt+n3lcJBnqEKthcxyljRYpaBW96fFm5SMToe45mW0GR8QRW9tFGu top9SDXplKQVKNbCUv9BJRVtH5JOufducppVuD21XIPu7uB8FKwDHuYSDdta+UW3 bT31RQ6KLxHGvNoFeMljbscmarVeKioVo8G3BrJGOEnxv3Vfy/JBJXp/jnCmNz7z lCCkDUnAf4qZAjJ7FgxKC90SC42KyU42Cw6h2BmVVlT9zfqdzBnBqZmTQsvMJF2+ BlovBJ69JOrwy68tr9mmpbE0vcnCgakYid3h+TaAg0DBJDkVeR2llTwlN93dLGDl tyou6Yyt+LCT1iTqXnhSY1U2W5T0xHYpW4OARTLvXC4nHb7Tbw5SVyjlrEEMGLCx 0HFAeH1ksV4mK6xMokA814MMBavwmUMXa7VYIrQa4qeVriqrDVMmZNrO1guaNgzI WObmEFg89xJ8c/wC76B8BJgdKDrIhRe9YIhIZ3pN8A== =j4S+ -----END PGP SIGNATURE----- ------------=_1455077351-21395-0-- From sandeen@sandeen.net Tue Feb 9 22:49:27 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=ham version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay3.corp.sgi.com [198.149.34.15]) by oss.sgi.com (Postfix) with ESMTP id 0DAB929DF5 for ; Tue, 9 Feb 2016 22:49:27 -0600 (CST) Received: from cuda.sgi.com (cuda2.sgi.com [192.48.176.25]) by relay3.corp.sgi.com (Postfix) with ESMTP id 92C16AC005 for ; Tue, 9 Feb 2016 20:49:25 -0800 (PST) X-ASG-Debug-ID: 1455079761-04cbb043324ccb0001-NocioJ Received: from sandeen.net (sandeen.net [63.231.237.45]) by cuda.sgi.com with ESMTP id TWh594ffnCwW2dNu for ; Tue, 09 Feb 2016 20:49:21 -0800 (PST) X-Barracuda-Envelope-From: sandeen@sandeen.net X-Barracuda-Apparent-Source-IP: 63.231.237.45 Received: from liberator.sandeen.net (liberator.sandeen.net [10.0.0.4]) (using TLSv1.2 with cipher DHE-RSA-AES128-SHA (128/128 bits)) (No client certificate requested) by sandeen.net (Postfix) with ESMTPSA id 596AF63C607A for ; Tue, 9 Feb 2016 22:49:21 -0600 (CST) Subject: Re: [PATCH 2/2 v2] xfs_repair: new secondary superblock search method] xfs_repair: new secondary superblock search method To: xfs@oss.sgi.com X-ASG-Orig-Subj: Re: [PATCH 2/2 v2] xfs_repair: new secondary superblock search method] xfs_repair: new secondary superblock search method References: <1455068099-26992-1-git-send-email-billodo@redhat.com> From: Eric Sandeen X-Enigmail-Draft-Status: N1110 Message-ID: <56BAC150.7070808@sandeen.net> Date: Tue, 9 Feb 2016 22:49:20 -0600 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.11; rv:38.0) Gecko/20100101 Thunderbird/38.5.1 MIME-Version: 1.0 In-Reply-To: <1455068099-26992-1-git-send-email-billodo@redhat.com> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 8bit X-Barracuda-Connect: sandeen.net[63.231.237.45] X-Barracuda-Start-Time: 1455079761 X-Barracuda-URL: https://192.48.176.25:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-BRTS-Status: 1 X-Barracuda-Spam-Score: 0.00 X-Barracuda-Spam-Status: No, SCORE=0.00 using per-user scores of TAG_LEVEL=1000.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.7 tests= X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.3.26907 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- On 2/9/16 7:34 PM, Bill O'Donnell wrote: > Optimize secondary sb search, using similar method to find > fs geometry as that of xfs_mkfs. If this faster method fails > in finding a secondary sb, fall back to original brute force > slower search. > > Signed-off-by: Bill O'Donnell > --- > Makefile | 2 +- > include/libxcmd.h | 4 +++- > libxcmd/topology.c | 35 ++++++++++++++++++++++++++++---- > repair/Makefile | 4 ++-- > repair/sb.c | 58 ++++++++++++++++++++++++++++++++++++++++++++---------- > 5 files changed, 85 insertions(+), 18 deletions(-) > > diff --git a/Makefile b/Makefile > index fca0a42..1d60d9c 100644 > --- a/Makefile > +++ b/Makefile > @@ -80,7 +80,7 @@ fsr: libhandle > growfs: libxcmd > io: libxcmd libhandle > quota: libxcmd > -repair: libxlog > +repair: libxlog libxcmd > copy: libxlog > > ifeq ($(HAVE_BUILDDEFS), yes) > diff --git a/include/libxcmd.h b/include/libxcmd.h > index df7046e..b140adb 100644 > --- a/include/libxcmd.h > +++ b/include/libxcmd.h > @@ -50,6 +50,8 @@ extern int > check_overwrite( > char *device); > > - > +extern int guess_default_geometry(__uint64_t *agsize, > + __uint64_t *agcount, > + libxfs_init_t x); > > #endif /* __LIBXCMD_H__ */ > diff --git a/libxcmd/topology.c b/libxcmd/topology.c > index 0eeea28..b98d9b9 100644 > --- a/libxcmd/topology.c > +++ b/libxcmd/topology.c > @@ -192,7 +192,8 @@ out: > return ret; > } > > -static void blkid_get_topology( > +static void > +blkid_get_topology( > const char *device, > int *sunit, > int *swidth, > @@ -284,7 +285,8 @@ check_overwrite( > return 1; > } > > -static void blkid_get_topology( > +static void > +blkid_get_topology( > const char *device, > int *sunit, > int *swidth, > @@ -302,8 +304,8 @@ static void blkid_get_topology( > > #endif /* ENABLE_BLKID */ > > - > -void get_topology( > +void > +get_topology( > libxfs_init_t *xi, > struct fs_topology *ft, > int force_overwrite) > @@ -346,3 +348,28 @@ void get_topology( > &lsectorsize, &psectorsize, force_overwrite); > } > } > + > +int > +guess_default_geometry(__uint64_t *agsize, __uint64_t *agcount, > + libxfs_init_t x) > +{ > + struct fs_topology ft; > + int blocklog; When in Rome: :) int guess_default_geometry( __uint64_t *agsize, __uint64_t *agcount, libxfs_init_t x) { ... (sorry, forgot to mention that last time, but other functions in the file are laid out this way; it is easier to read) > + __uint64_t dblocks; > + int multidisk; > + > + memset(&ft, 0, sizeof(ft)); > + get_topology(&x, &ft, 1); > + > + /* > + * get geometry from get_topology result. > + * Use default block size (2^12) > + */ > + blocklog = 12; > + multidisk = ft.dswidth | ft.dsunit; > + dblocks = x.dsize >> (blocklog - BBSHIFT); > + calc_default_ag_geometry(blocklog, dblocks, multidisk, > + agsize, agcount); > + > + return blocklog; > +} > diff --git a/repair/Makefile b/repair/Makefile > index 251722b..d24ab1f 100644 > --- a/repair/Makefile > +++ b/repair/Makefile > @@ -20,8 +20,8 @@ CFILES = agheader.c attr_repair.c avl.c avl64.c bmap.c btree.c \ > progress.c prefetch.c rt.c sb.c scan.c threads.c \ > versions.c xfs_repair.c > > -LLDLIBS = $(LIBXFS) $(LIBXLOG) $(LIBUUID) $(LIBRT) $(LIBPTHREAD) > -LTDEPENDENCIES = $(LIBXFS) $(LIBXLOG) > +LLDLIBS = $(LIBBLKID) $(LIBXFS) $(LIBXLOG) $(LIBUUID) $(LIBRT) $(LIBPTHREAD) $(LIBXCMD) > +LTDEPENDENCIES = $(LIBXFS) $(LIBXLOG) $(LIBXCMD) > LLDFLAGS = -static-libtool-libs > > default: depend $(LTCOMMAND) > diff --git a/repair/sb.c b/repair/sb.c > index 4eef14a..8bc246e 100644 > --- a/repair/sb.c > +++ b/repair/sb.c > @@ -22,6 +22,7 @@ > #include "globals.h" > #include "protos.h" > #include "err_protos.h" > +#include "libxcmd.h" Nitpick, we usually include that right after libxfs.h. > #define BSIZE (1024 * 1024) > > @@ -85,10 +86,11 @@ copy_sb(xfs_sb_t *source, xfs_sb_t *dest) > } > > /* > - * find a secondary superblock, copy it into the sb buffer > + * find a secondary superblock, copy it into the sb buffer. > + * skipsize units is bytes, it contains either the agsize in bytes > + * (if known), or the minimum agsize in bytes if agsize unknown. > */ Ok, so this is a little confused. There are actually 3 relevant parameters here: 1) The place to start reading 2) The number of bytes to read at that point 3) How far to seek forward for the next read In the old world, it's: 1) XFS_MIN_AG_BYTES 2) BSIZE (1MB) 3) BSIZE (i.e. it does sequential reads) In the new world, it's: 1) the guessed AG size (skipsize?) 2) BSIZE (more than we need, but not expensive, so leave it) 3) the guessed AG size (skipsize) You really have 2 different pieces of info: Where to do the first read, and how far forward to skip for the next read. I don't think you can convey that with a single argument, "skipsize." > -int > -find_secondary_sb(xfs_sb_t *rsb) > +static int __find_secondary_sb(xfs_sb_t *rsb, __uint64_t skipsize) better to format as: static int __find_secondary_sb( xfs_sb_t *rsb, __uint64_t skipsize) { but ... > { > xfs_off_t off; > xfs_sb_t *sb; > @@ -99,9 +101,9 @@ find_secondary_sb(xfs_sb_t *rsb) > int dirty; > int retval; > int bsize; > + int readsize; > > do_warn(_("\nattempting to find secondary superblock...\n")); > - > sb = (xfs_sb_t *)memalign(libxfs_device_alignment(), BSIZE); > if (!sb) { > do_error( > @@ -113,13 +115,16 @@ find_secondary_sb(xfs_sb_t *rsb) > retval = 0; > dirty = 0; > bsize = 0; > + readsize = 0; > > /* > * skip first sector since we know that's bad > */ > - for (done = 0, off = XFS_AG_MIN_BYTES; !done ; off += bsize) { > + for (done = 0, off = skipsize; !done ; off += readsize) { > /* > - * read disk 1 MByte at a time. we are actually still doing that, read(x.dfd, sb, BSIZE), so I'd leave the comment... > + * read disk using readsize interval > + * (either the bytecount of actual agsize or bsize if > + * agsize undetermined.) > */ > if (lseek64(x.dfd, off, SEEK_SET) != off) { > done = 1; > @@ -128,9 +133,13 @@ find_secondary_sb(xfs_sb_t *rsb) > if (!done && (bsize = read(x.dfd, sb, BSIZE)) <= 0) { > done = 1; > } > - > + if (skipsize == XFS_AG_MIN_BYTES) { > + readsize = bsize; > + } > + else { better as: } else { > + readsize = skipsize; > + } I wouldn't call this "readsize" - we are only ever reading BSIZE at a time. This is how much we advance each loop, so skipsize is a bit better. But the _functional_ problem here is that it is possible and permissible to have a filesystem with an AG size of XFS_AG_MIN_BYTES (16MB). So if you guessed a default geometry with an agsize of XFS_AG_MIN_BYTES, you've gone back to the fine-grained scanning. The fs probably isn't very big as a result, so it's not the end of the world, but ... see below. > do_warn("."); > - > /* > * check the buffer 512 bytes at a time since > * we don't know how big the sectors really are. > @@ -164,9 +173,38 @@ find_secondary_sb(xfs_sb_t *rsb) > } > } > } > - > free(sb); > - return(retval); > + return retval; > +} > + > +int > +find_secondary_sb(xfs_sb_t *rsb) > +{ > + int retval; > + __uint64_t skipsize; > + __uint64_t agcount; > + __uint64_t agsize; > + int blocklog; > + > + /* > + * Attempt to find secondary sb with a coarse approach, > + * using a large skipsize (agsize in bytes). Failing that, > + * fallback to the fine-grained approach using min agsize. > + */ > + blocklog = guess_default_geometry(&agsize, &agcount, x); > + > + /* > + * use found ag geometry to quickly find secondary sb > + */ > + skipsize = agsize << blocklog; > + retval = __find_secondary_sb(rsb, skipsize); > + if (!retval) { > + /* > + * fallback: use minimum agsize for skipsize > + */ > + retval = __find_secondary_sb(rsb, XFS_AG_MIN_BYTES); > + } > + return retval; > } I'd make __find_secondary_sb() take (sb, start, skip) i.e. send in this: > + retval = __find_secondary_sb(rsb, agsize, agsize); > + if (!retval) { > + /* > + * fallback: use minimum agsize for skipsize > + */ > + retval = __find_secondary_sb(rsb, XFS_AG_MIN_BYTES, BSIZE); > + } and the function is something like: static int __find_secondary_sb( xfs_sb_t *rsb, xfs_off_t start, xfs_off_t skip) { ... for (done = 0, off = start; !done ; off += skip) { ... if (lseek64(x.dfd, off, SEEK_SET) != off) done = 1; if (!done && (read(x.dfd, sb, BSIZE)) <= 0) done = 1; because you really can't deduce both the starting point and the skip-ahead size from just one parameter. -Eric From sglover@toucanprospectuk.co.uk Tue Feb 9 23:15:38 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=HTML_MESSAGE,T_DKIM_INVALID autolearn=ham version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay3.corp.sgi.com [198.149.34.15]) by oss.sgi.com (Postfix) with ESMTP id C171B29DF5 for ; Tue, 9 Feb 2016 23:15:38 -0600 (CST) Received: from cuda.sgi.com (cuda2.sgi.com [192.48.176.25]) by relay3.corp.sgi.com (Postfix) with ESMTP id 46060AC005 for ; Tue, 9 Feb 2016 21:15:35 -0800 (PST) X-ASG-Debug-ID: 1455081330-04cbb043344d230001-NocioJ Received: from mail-n01-b07.smtpmark.com (mail-n01-b07.smtpmark.com [79.170.198.107]) by cuda.sgi.com with ESMTP id NYEOFXpeEvfbasaV (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO) for ; Tue, 09 Feb 2016 21:15:31 -0800 (PST) X-Barracuda-Envelope-From: sglover@toucanprospectuk.co.uk X-Barracuda-Apparent-Source-IP: 79.170.198.107 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed; s=default; d=smtpmark.com; h=From:Subject:To:Content-Type:MIME-Version:Date:Message-ID; bh=Jl4NTjK8n5HdC42WKT6IprqPwSI/BxwY91PUwCswa3M=; b=FS/f3we/un76e2WZQ2EmAFgBUpsGOdiQ4d7rWDK56P3HjTIJ5cCtYON45DpjxkgCIvQbgeU9CvbF rPFs2nZmxVAtfqDFo/kyTNvubkLcD3SRE6j0ceOGfkSwMXTNCTfRSSN3uQl/Z1OcL04wPr5wVq4S W1TKd9v2IKJjwNpxpUQ= Received: from 95-210-69-10.ip.skylogicnet.com (95.210.69.10) by mail-n01-b07.smtpmark.com id hnb3n41uu34r for ; Wed, 10 Feb 2016 05:15:28 +0000 (envelope-from ) From: "Data Package" Subject: Data Package To: "xfs" X-ASG-Orig-Subj: Data Package Content-Type: multipart/alternative; boundary="8g=_lm0aip5iytcPhZxbPSxZDwnleOY6IL" MIME-Version: 1.0 Organization: Data Package Date: Wed, 10 Feb 2016 05:16:25 +0000 Message-ID: <0.0.7.6BF.1D163C20DFF7296.0@mail-n01-b07.smtpmark.com> X-Barracuda-Connect: mail-n01-b07.smtpmark.com[79.170.198.107] X-Barracuda-Start-Time: 1455081331 X-Barracuda-Encrypted: ECDHE-RSA-AES256-GCM-SHA384 X-Barracuda-URL: https://192.48.176.25:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-BRTS-Status: 1 X-Barracuda-Spam-Score: 0.00 X-Barracuda-Spam-Status: No, SCORE=0.00 using per-user scores of TAG_LEVEL=1000.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.7 tests=DKIM_SIGNED, DKIM_VERIFIED, HTML_MESSAGE X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.3.26907 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- -0.00 DKIM_VERIFIED Domain Keys Identified Mail: signature passes verification 0.00 DKIM_SIGNED Domain Keys Identified Mail: message has a signature 0.00 HTML_MESSAGE BODY: HTML included in message This is a multi-part message in MIME format --8g=_lm0aip5iytcPhZxbPSxZDwnleOY6IL Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Content-Disposition: inline =EF=BB=BFHi there, =20 Due to our current circumstances I=E2=80=99ve decided to close the dat= a business sales for a period of time and sell all my data as a comple= te portfolio for one fixed price. The business isn't closing, just da= ta sales. The databases I have which will be included are: =20 Big Business File =E2=80=93 645,000 UK Businesses CEO Contact File =E2=80=93 5,791 records Academia Contacts File =E2=80=93 297 records Corporate Companies 50+ Employees =E2=80=93 40,000 records Directors Contact File =E2=80=93 188,895 records Facilities Contacts File =E2=80=93 378 records Finance Contacts File =E2=80=93 20,085 records Fleet Contacts File =E2=80=93 782 records HR Contacts File =E2=80=93 12,596 records IT Contacts File =E2=80=93 10,000 records Legal Contact File =E2=80=93 1,060 records Management Contacts File =E2=80=93 85,747 records Managing Director Contact File =E2=80=93 153,096 records Marketing Contacts File =E2=80=93 9,574 records Purchasing Decision Makers =E2=80=93 2,338 records Training Contacts File =E2=80=93 862 records UK Estate Agent File =E2=80=93 20,000 records Residential Landlords File =E2=80=93 80,000 records =20 Data not listed on website but included: Employment Agencies - 20,000 records=20 High Net Worth Individuals =E2=80=93 307,502 records Pension Transfer Leads =E2=80=93 approx. 200,000 records Personal Debt Leads =E2=80=93 10,000 records PPI Leads =E2=80=93 44,641 records Re-mortgage Leads =E2=80=93 400,000 records Business Mobile Contract Renewals =E2=80=93 9,278 records UK Hotels =E2=80=93 13,516 records Manufacturing Companies =E2=80=93 48,884 records =20 The fixed price for the complete portfolio of databases is =C2=A3600. = However if you purchase prior to Friday 12th February you can reduce = this further to =C2=A3300 by using the code 2016 when checking out. O= nly ten copies of the Full Portfolio are being sold and therefore the = offer may end early. Your order is guaranteed for 30 days from your day of purchase. There= fore should you not be happy for any reason during this time then a fu= ll refund will be issued immediately upon request. To proceed go to toucanprospects.com and click on the Full Portfolio t= ab at the top. Add the Full Portfolio to your cart and continue throu= gh the payment process. Bacs details can be found in the product desc= ription if you would prefer to pay by bank transfer. =20 All the data is supplied in excel format and is sent by download link = to your email address immediately following your order. =20 The data is all UK based. New as of October 2015 and cleansed, verifi= ed and updated within the last few weeks. All records contain an emai= l address along with other fully populated data fields. The business = data is single opt in and the consumer data is double opt in. Website: toucanprospects.com Many thanks Toucan=20 Tel: 01332 806896 Mob: 07738 893708 Unsubscribe by email --8g=_lm0aip5iytcPhZxbPSxZDwnleOY6IL Content-Type: text/html; charset="utf-8" Content-Transfer-Encoding: quoted-printable Content-Disposition: inline =EF=BB=BF<= HEAD>

Hi there,
 
Due to our current circ= umstances I=E2=80=99ve decided to close the data business sales for a = period of time and sell all my data as a complete portfolio for one fi= xed price.  The business isn't closing, just data sales.  Th= e databases I have which will be included are:
 
Big Busine= ss File =E2=80=93 645,000 UK Businesses
CEO Contact File =E2=80=93 = 5,791 records
Academia Contacts File =E2=80=93 297 records
Corpo= rate Companies 50+ Employees =E2=80=93 40,000 records
Directors Con= tact File =E2=80=93 188,895 records
Facilities Contacts File =E2=80= =93 378 records
Finance Contacts File =E2=80=93 20,085 records
F= leet Contacts File =E2=80=93 782 records
HR Contacts File =E2=80=93= 12,596 records
IT Contacts File =E2=80=93 10,000 records
Legal = Contact File =E2=80=93 1,060 records
Management Contacts File =E2=80= =93 85,747 records
Managing Director Contact File =E2=80=93 153,096= records
Marketing Contacts File =E2=80=93 9,574 records
Purchas= ing Decision Makers =E2=80=93 2,338 records
Training Contacts File = =E2=80=93 862 records
UK Estate Agent File =E2=80=93 20,000 records=
Residential Landlords File =E2=80=93 80,000 records
 
D= ata not listed on website but included:
Employment Agencies - 20,000 records = ;
High Net Worth Individuals =E2=80=93 307,502 records

Pension Transfer Leads =E2=80=93 approx. 200,000 re= cords
Personal Debt Leads =E2=80=93 10,000 records
PPI Leads =E2= =80=93 44,641 records
Re-mortgage Leads =E2=80=93 400,000 recordsBusiness Mobile Contract Renewals =E2=80=93 9,278 records

UK Hotels =E2=80=93 13,516 records
Manufacturi= ng Companies =E2=80=93 48,884 records

&= nbsp;
The fixed price for the complete portfolio of databas= es is =C2=A3600.  However if you purchase prior to Frid= ay 12th February you can reduce this further to =C2=A3300 by= using the code 2016 when checking out.  Only ten copies of = the Full Portfolio are being sold and therefore the offer may end earl= y.

Your order is guaranteed for 30 days from your= day of purchase.  Therefore should you not be happy for any reas= on during this time then a full refund will be issued immediately upon= request.

To proceed go to toucanprospects.com and click= on the Full Portfolio tab at the top.  Add the Full Portfolio to= your cart and continue through the payment process.  Bacs detail= s can be found in the product description if you would prefer to pay b= y bank transfer. 

All the data is supplied in excel format and i= s sent by download link to your email address immediately following yo= ur order. 

The data is all UK based.  New as of Octo= ber 2015 and cleansed, verified and updated within the last few weeks.=   All records contain an email address along with other fully&nbs= p;populated data fields.  The business data is single opt in and = the consumer data is double opt in.

Website: toucanprospects.com

Many thanks

Toucan

Tel:  01332 806896  Mob: 07738 89370= 8

Unsubscribe by email

--8g=_lm0aip5iytcPhZxbPSxZDwnleOY6IL-- From sfr@canb.auug.org.au Tue Feb 9 23:24:31 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=T_DKIM_INVALID autolearn=ham version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay2.corp.sgi.com [137.38.102.29]) by oss.sgi.com (Postfix) with ESMTP id DAE0629DF5 for ; Tue, 9 Feb 2016 23:24:31 -0600 (CST) Received: from cuda.sgi.com (cuda3.sgi.com [192.48.176.15]) by relay2.corp.sgi.com (Postfix) with ESMTP id CA81F304048 for ; Tue, 9 Feb 2016 21:24:31 -0800 (PST) X-ASG-Debug-ID: 1455081862-04cb6c1e58361a0001-NocioJ Received: from ozlabs.org (ozlabs.org [103.22.144.67]) by cuda.sgi.com with ESMTP id jrAJouPMqn7Y9xSV (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO) for ; Tue, 09 Feb 2016 21:24:23 -0800 (PST) X-Barracuda-Envelope-From: sfr@canb.auug.org.au X-Barracuda-Apparent-Source-IP: 103.22.144.67 Received: from authenticated.ozlabs.org (localhost [127.0.0.1]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPSA id A47301402ED; Wed, 10 Feb 2016 16:24:20 +1100 (AEDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=canb.auug.org.au; s=201601; t=1455081860; bh=C08gaqBnQ76egw/7LntHVWMx7KMj26X49JHSC6RQYM4=; h=Date:From:To:Cc:Subject:From; b=CXZCrcvrcbd53LukW7XprWO5NRwpa0+uvK2V1mdKxye64t7OvfrA/MLivta1jw4w/ QSwx4oyOuV8JqvbB15ePcDH4NCp16u65zOa4s+1NIxso8hywhh/aO3cg1PzYaCeUoa F8kHJ/56jW3m8m+krPYgkcN+TWbnQJ/YcQk022Ro= Date: Wed, 10 Feb 2016 16:24:20 +1100 From: Stephen Rothwell To: Andrew Morton , David Chinner , xfs@oss.sgi.com Cc: linux-next@vger.kernel.org, linux-kernel@vger.kernel.org, Christoph Hellwig , Ryan Ding Subject: linux-next: manual merge of the akpm-current tree with the xfs tree Message-ID: <20160210162420.2d1a352a@canb.auug.org.au> X-ASG-Orig-Subj: linux-next: manual merge of the akpm-current tree with the xfs tree MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Barracuda-Connect: ozlabs.org[103.22.144.67] X-Barracuda-Start-Time: 1455081863 X-Barracuda-Encrypted: ECDHE-RSA-AES256-GCM-SHA384 X-Barracuda-URL: https://192.48.176.15:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-BRTS-Status: 1 X-Barracuda-Spam-Score: 0.00 X-Barracuda-Spam-Status: No, SCORE=0.00 using per-user scores of TAG_LEVEL=1000.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.7 tests=BSF_SC0_MISMATCH_TO, DKIM_SIGNED, DKIM_VERIFIED X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.3.26908 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 0.00 BSF_SC0_MISMATCH_TO Envelope rcpt doesn't match header -0.00 DKIM_VERIFIED Domain Keys Identified Mail: signature passes verification 0.00 DKIM_SIGNED Domain Keys Identified Mail: message has a signature Hi Andrew, Today's linux-next merge of the akpm-current tree got a conflict in: fs/ocfs2/aops.c between commit: 187372a3b9fa ("direct-io: always call ->end_io if non-NULL") from the xfs tree and commit: 8e1fbb488a18 ("ocfs2: fix sparse file & data ordering issue in direct io") from the akpm-current tree. I fixed it up (I think - see below) and can carry the fix as necessary (no action is required). -- Cheers, Stephen Rothwell diff --cc fs/ocfs2/aops.c index 5dcc5f5a842e,3d3952ebe101..000000000000 --- a/fs/ocfs2/aops.c +++ b/fs/ocfs2/aops.c @@@ -2476,6 -2099,356 +2099,361 @@@ static int ocfs2_write_end(struct file return ret; } + struct ocfs2_dio_write_ctxt { + struct list_head dw_zero_list; + unsigned dw_zero_count; + int dw_orphaned; + pid_t dw_writer_pid; + }; + + static struct ocfs2_dio_write_ctxt * + ocfs2_dio_alloc_write_ctx(struct buffer_head *bh, int *alloc) + { + struct ocfs2_dio_write_ctxt *dwc = NULL; + + if (bh->b_private) + return bh->b_private; + + dwc = kmalloc(sizeof(struct ocfs2_dio_write_ctxt), GFP_NOFS); + if (dwc == NULL) + return NULL; + INIT_LIST_HEAD(&dwc->dw_zero_list); + dwc->dw_zero_count = 0; + dwc->dw_orphaned = 0; + dwc->dw_writer_pid = task_pid_nr(current); + bh->b_private = dwc; + *alloc = 1; + + return dwc; + } + + static void ocfs2_dio_free_write_ctx(struct inode *inode, + struct ocfs2_dio_write_ctxt *dwc) + { + ocfs2_free_unwritten_list(inode, &dwc->dw_zero_list); + kfree(dwc); + } + + /* + * TODO: Make this into a generic get_blocks function. + * + * From do_direct_io in direct-io.c: + * "So what we do is to permit the ->get_blocks function to populate + * bh.b_size with the size of IO which is permitted at this offset and + * this i_blkbits." + * + * This function is called directly from get_more_blocks in direct-io.c. + * + * called like this: dio->get_blocks(dio->inode, fs_startblk, + * fs_count, map_bh, dio->rw == WRITE); + */ + static int ocfs2_dio_get_block(struct inode *inode, sector_t iblock, + struct buffer_head *bh_result, int create) + { + struct ocfs2_super *osb = OCFS2_SB(inode->i_sb); + struct ocfs2_inode_info *oi = OCFS2_I(inode); + struct ocfs2_write_ctxt *wc; + struct ocfs2_write_cluster_desc *desc = NULL; + struct ocfs2_dio_write_ctxt *dwc = NULL; + struct buffer_head *di_bh = NULL; + u64 p_blkno; + loff_t pos = iblock << inode->i_sb->s_blocksize_bits; + unsigned len, total_len = bh_result->b_size; + int ret = 0, first_get_block = 0; + + len = osb->s_clustersize - (pos & (osb->s_clustersize - 1)); + len = min(total_len, len); + + mlog(0, "get block of %lu at %llu:%u req %u\n", + inode->i_ino, pos, len, total_len); + + /* + * Because we need to change file size in ocfs2_dio_end_io_write(), or + * we may need to add it to orphan dir. So can not fall to fast path + * while file size will be changed. + */ + if (pos + total_len <= i_size_read(inode)) { + down_read(&oi->ip_alloc_sem); + /* This is the fast path for re-write. */ + ret = ocfs2_get_block(inode, iblock, bh_result, create); + + up_read(&oi->ip_alloc_sem); + + if (buffer_mapped(bh_result) && + !buffer_new(bh_result) && + ret == 0) + goto out; + + /* Clear state set by ocfs2_get_block. */ + bh_result->b_state = 0; + } + + dwc = ocfs2_dio_alloc_write_ctx(bh_result, &first_get_block); + if (unlikely(dwc == NULL)) { + ret = -ENOMEM; + mlog_errno(ret); + goto out; + } + + if (ocfs2_clusters_for_bytes(inode->i_sb, pos + total_len) > + ocfs2_clusters_for_bytes(inode->i_sb, i_size_read(inode)) && + !dwc->dw_orphaned) { + /* + * when we are going to alloc extents beyond file size, add the + * inode to orphan dir, so we can recall those spaces when + * system crashed during write. + */ + ret = ocfs2_add_inode_to_orphan(osb, inode); + if (ret < 0) { + mlog_errno(ret); + goto out; + } + dwc->dw_orphaned = 1; + } + + ret = ocfs2_inode_lock(inode, &di_bh, 1); + if (ret) { + mlog_errno(ret); + goto out; + } + + down_write(&oi->ip_alloc_sem); + + if (first_get_block) { + if (ocfs2_sparse_alloc(OCFS2_SB(inode->i_sb))) + ret = ocfs2_zero_tail(inode, di_bh, pos); + else + ret = ocfs2_expand_nonsparse_inode(inode, di_bh, pos, + total_len, NULL); + if (ret < 0) { + mlog_errno(ret); + goto unlock; + } + } + + ret = ocfs2_write_begin_nolock(inode->i_mapping, pos, len, + OCFS2_WRITE_DIRECT, NULL, + (void **)&wc, di_bh, NULL); + if (ret) { + mlog_errno(ret); + goto unlock; + } + + desc = &wc->w_desc[0]; + + p_blkno = ocfs2_clusters_to_blocks(inode->i_sb, desc->c_phys); + BUG_ON(p_blkno == 0); + p_blkno += iblock & (u64)(ocfs2_clusters_to_blocks(inode->i_sb, 1) - 1); + + map_bh(bh_result, inode->i_sb, p_blkno); + bh_result->b_size = len; + if (desc->c_needs_zero) + set_buffer_new(bh_result); + + /* May sleep in end_io. It should not happen in a irq context. So defer + * it to dio work queue. */ + set_buffer_defer_completion(bh_result); + + if (!list_empty(&wc->w_unwritten_list)) { + struct ocfs2_unwritten_extent *ue = NULL; + + ue = list_first_entry(&wc->w_unwritten_list, + struct ocfs2_unwritten_extent, + ue_node); + BUG_ON(ue->ue_cpos != desc->c_cpos); + /* The physical address may be 0, fill it. */ + ue->ue_phys = desc->c_phys; + + list_splice_tail_init(&wc->w_unwritten_list, &dwc->dw_zero_list); + dwc->dw_zero_count++; + } + + ret = ocfs2_write_end_nolock(inode->i_mapping, pos, len, len, NULL, wc); + BUG_ON(ret != len); + ret = 0; + unlock: + up_write(&oi->ip_alloc_sem); + ocfs2_inode_unlock(inode, 1); + brelse(di_bh); + out: + if (ret < 0) + ret = -EIO; + return ret; + } + + static void ocfs2_dio_end_io_write(struct inode *inode, + struct ocfs2_dio_write_ctxt *dwc, + loff_t offset, + ssize_t bytes) + { + struct ocfs2_cached_dealloc_ctxt dealloc; + struct ocfs2_extent_tree et; + struct ocfs2_super *osb = OCFS2_SB(inode->i_sb); + struct ocfs2_inode_info *oi = OCFS2_I(inode); + struct ocfs2_unwritten_extent *ue = NULL; + struct buffer_head *di_bh = NULL; + struct ocfs2_dinode *di; + struct ocfs2_alloc_context *data_ac = NULL; + struct ocfs2_alloc_context *meta_ac = NULL; + handle_t *handle = NULL; + loff_t end = offset + bytes; + int ret = 0, credits = 0, locked = 0; + + ocfs2_init_dealloc_ctxt(&dealloc); + + /* We do clear unwritten, delete orphan, change i_size here. If neither + * of these happen, we can skip all this. */ + if (list_empty(&dwc->dw_zero_list) && + end <= i_size_read(inode) && + !dwc->dw_orphaned) + goto out; + + /* ocfs2_file_write_iter will get i_mutex, so we need not lock if we + * are in that context. */ + if (dwc->dw_writer_pid != task_pid_nr(current)) { + mutex_lock(&inode->i_mutex); + locked = 1; + } + + ret = ocfs2_inode_lock(inode, &di_bh, 1); + if (ret < 0) { + mlog_errno(ret); + goto out; + } + + down_write(&oi->ip_alloc_sem); + + /* Delete orphan before acquire i_mutex. */ + if (dwc->dw_orphaned) { + BUG_ON(dwc->dw_writer_pid != task_pid_nr(current)); + + end = end > i_size_read(inode) ? end : 0; + + ret = ocfs2_del_inode_from_orphan(osb, inode, di_bh, + !!end, end); + if (ret < 0) + mlog_errno(ret); + } + + di = (struct ocfs2_dinode *)di_bh; + + ocfs2_init_dinode_extent_tree(&et, INODE_CACHE(inode), di_bh); + + ret = ocfs2_lock_allocators(inode, &et, 0, dwc->dw_zero_count*2, + &data_ac, &meta_ac); + if (ret) { + mlog_errno(ret); + goto unlock; + } + + credits = ocfs2_calc_extend_credits(inode->i_sb, &di->id2.i_list); + + handle = ocfs2_start_trans(osb, credits); + if (IS_ERR(handle)) { + ret = PTR_ERR(handle); + mlog_errno(ret); + goto unlock; + } + ret = ocfs2_journal_access_di(handle, INODE_CACHE(inode), di_bh, + OCFS2_JOURNAL_ACCESS_WRITE); + if (ret) { + mlog_errno(ret); + goto commit; + } + + list_for_each_entry(ue, &dwc->dw_zero_list, ue_node) { + ret = ocfs2_mark_extent_written(inode, &et, handle, + ue->ue_cpos, 1, + ue->ue_phys, + meta_ac, &dealloc); + if (ret < 0) { + mlog_errno(ret); + break; + } + } + + if (end > i_size_read(inode)) { + ret = ocfs2_set_inode_size(handle, inode, di_bh, end); + if (ret < 0) + mlog_errno(ret); + } + commit: + ocfs2_commit_trans(osb, handle); + unlock: + up_write(&oi->ip_alloc_sem); + ocfs2_inode_unlock(inode, 1); + brelse(di_bh); + out: + if (data_ac) + ocfs2_free_alloc_context(data_ac); + if (meta_ac) + ocfs2_free_alloc_context(meta_ac); + ocfs2_run_deallocs(osb, &dealloc); + if (locked) + mutex_unlock(&inode->i_mutex); + ocfs2_dio_free_write_ctx(inode, dwc); + } + + /* + * ocfs2_dio_end_io is called by the dio core when a dio is finished. We're + * particularly interested in the aio/dio case. We use the rw_lock DLM lock + * to protect io on one node from truncation on another. + */ -static void ocfs2_dio_end_io(struct kiocb *iocb, - loff_t offset, - ssize_t bytes, - void *private) ++static int ocfs2_dio_end_io(struct kiocb *iocb, ++ loff_t offset, ++ ssize_t bytes, ++ void *private) + { + struct inode *inode = file_inode(iocb->ki_filp); + int level; + ++ if (bytes <= 0) ++ return 0; ++ + /* this io's submitter should not have unlocked this before we could */ + BUG_ON(!ocfs2_iocb_is_rw_locked(iocb)); + + if (private) + ocfs2_dio_end_io_write(inode, private, offset, bytes); + + ocfs2_iocb_clear_rw_locked(iocb); + + level = ocfs2_iocb_rw_locked_level(iocb); + ocfs2_rw_unlock(inode, level); ++ ++ return 0; + } + + static ssize_t ocfs2_direct_IO(struct kiocb *iocb, struct iov_iter *iter, + loff_t offset) + { + struct file *file = iocb->ki_filp; + struct inode *inode = file_inode(file)->i_mapping->host; + struct ocfs2_super *osb = OCFS2_SB(inode->i_sb); + loff_t end = offset + iter->count; + get_block_t *get_block; + + /* + * Fallback to buffered I/O if we see an inode without + * extents. + */ + if (OCFS2_I(inode)->ip_dyn_features & OCFS2_INLINE_DATA_FL) + return 0; + + /* Fallback to buffered I/O if we do not support append dio. */ + if (end > i_size_read(inode) && !ocfs2_supports_append_dio(osb)) + return 0; + + if (iov_iter_rw(iter) == READ) + get_block = ocfs2_get_block; + else + get_block = ocfs2_dio_get_block; + + return __blockdev_direct_IO(iocb, inode, inode->i_sb->s_bdev, + iter, offset, get_block, + ocfs2_dio_end_io, NULL, 0); + } + const struct address_space_operations ocfs2_aops = { .readpage = ocfs2_readpage, .readpages = ocfs2_readpages, From david@fromorbit.com Tue Feb 9 23:41:27 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=ham version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay1.corp.sgi.com [137.38.102.111]) by oss.sgi.com (Postfix) with ESMTP id 8C99329DF5 for ; Tue, 9 Feb 2016 23:41:27 -0600 (CST) Received: from cuda.sgi.com (cuda2.sgi.com [192.48.176.25]) by relay1.corp.sgi.com (Postfix) with ESMTP id 7795B8F8040 for ; Tue, 9 Feb 2016 21:41:27 -0800 (PST) X-ASG-Debug-ID: 1455082883-04cbb043344da60001-NocioJ Received: from ipmail06.adl2.internode.on.net (ipmail06.adl2.internode.on.net [150.101.137.129]) by cuda.sgi.com with ESMTP id 097Q4qJj4tYW7LyG for ; Tue, 09 Feb 2016 21:41:24 -0800 (PST) X-Barracuda-Envelope-From: david@fromorbit.com X-Barracuda-Apparent-Source-IP: 150.101.137.129 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: A2DNCwDyzLpWPBATLHleKAECgw8iMG2GY4F5nTsCCgwBAQEBAQEGgQ+KWoVFhAcXAoVuBIEyTQEBAQEBAQcBAQEBQT+FHjskNAUlAwctiBqhBJ52CBiFMol9gXwLQIEnBYdTixuECoVMh3uOewKOP4IYDII2KC6IUwEBAQ Received: from ppp121-44-19-16.lns20.syd4.internode.on.net (HELO dastard) ([121.44.19.16]) by ipmail06.adl2.internode.on.net with ESMTP; 10 Feb 2016 16:11:23 +1030 Received: from dave by dastard with local (Exim 4.80) (envelope-from ) id 1aTNWk-0004vn-53 for xfs@oss.sgi.com; Wed, 10 Feb 2016 16:41:22 +1100 Date: Wed, 10 Feb 2016 16:41:22 +1100 From: Dave Chinner To: xfs@oss.sgi.com Subject: [ANNOUNCE] xfs: for-next branch updated to 63a1962 Message-ID: <20160210054122.GK14668@dastard> X-ASG-Orig-Subj: [ANNOUNCE] xfs: for-next branch updated to 63a1962 MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="5vNYLRcllDrimb99" Content-Disposition: inline User-Agent: Mutt/1.5.21 (2010-09-15) X-Barracuda-Connect: ipmail06.adl2.internode.on.net[150.101.137.129] X-Barracuda-Start-Time: 1455082884 X-Barracuda-URL: https://192.48.176.25:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-BRTS-Status: 1 X-Barracuda-Spam-Score: 0.00 X-Barracuda-Spam-Status: No, SCORE=0.00 using per-user scores of TAG_LEVEL=1000.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.7 tests= X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.3.26908 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- --5vNYLRcllDrimb99 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Hi folks, The for-next branch of the xfs kernel repository at git://git.kernel.org/pub/scm/linux/kernel/git/dgc/linux-xfs.git has just been updated. The new head of the for-next branch is commit: 63a1962 Merge branch 'xfs-buf-macro-cleanup-4.6' into for-next New Commits: Dave Chinner (7): [b0388bf] xfs: remove XBF_DONE flag wrapper macros [1157b32c] xfs: remove XBF_ASYNC flag wrapper macros [0cac682] xfs: remove XBF_READ flag wrapper macros [b68c082] xfs: remove XBF_WRITE flag wrapper macros [5cfd28b] xfs: remove XBF_STALE flag wrapper macros [12877da] xfs: remove XFS_BUF_ZEROFLAGS macro [63a1962] Merge branch 'xfs-buf-macro-cleanup-4.6' into for-next Code Diffstat: fs/xfs/xfs_buf.c | 2 +- fs/xfs/xfs_buf.h | 26 +------------------------- fs/xfs/xfs_buf_item.c | 10 +++++----- fs/xfs/xfs_inode.c | 2 +- fs/xfs/xfs_log.c | 20 ++++++++------------ fs/xfs/xfs_log_recover.c | 10 ++++------ fs/xfs/xfs_mount.c | 2 +- fs/xfs/xfs_trans_buf.c | 10 +++++----- 8 files changed, 26 insertions(+), 56 deletions(-) --=20 Dave Chinner david@fromorbit.com --5vNYLRcllDrimb99 Content-Type: application/pgp-signature; name="signature.asc" Content-Description: Digital signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.12 (GNU/Linux) iQIcBAEBAgAGBQJWus2BAAoJEK3oKUf0dfodELkQAM2br4Y+pNXX4mWWDfriOT0y yH4FDDFa25elSvXeo7hni7ievF/z827QUIyXoeSPQIhKF75K8XDlSX779IGB8HE6 ENiMOwhwjT0boPt4L/BOFj6GtBK3f8Gu1Si4ioWB/GVNkTCn20mF8evMUflEAZZv Tce974CmXQy68EuirzyiElwce8zuayNMb46z27H3+6dS0CmKv94iw9FZoZmvcjtW +tGWKfy+uDFAf8zjEXukOIVPiT721u8tBuiHDsFlRql6W8dYVbuoZV9j+x4sPaCy BkvL6BG3L2BV42WUPbcNZTgMTdqnCnVTkmUFzjpFMP0he25HiMjxaEo7T8ysGjwi Ih3K7xkJhVe62eY7aXGa7szrwbvgeco0cLBaPZfm8WqIPbkAciCgt2ARBQ/CcVl8 rRMRC1qzxrcmChNtmFuQRhlLgrvy07OcR2qw0zLnXg7ckt0vyZMoHibKlwB38NsK trTypL4U5405Vw+g/utsnG4rRIFeCiajCXCU/EhadwNtJ+LV1CgpIVBbDlu1opGn 8CaygQ2jhbIGk3LrW0IrtziduTcrco9O3C3saHv1u5L6FZkWj39j/3e4c63Mkq+G wBYoFkOcQUPtAy9Eu5BtFMRyDl1R9gDXOnKVHJWubQ2QeHdh6yr0OkogHCiwKdx9 qPhn8NTYvyuJCZSVCz6l =BYFL -----END PGP SIGNATURE----- --5vNYLRcllDrimb99-- From dave@fromorbit.com Wed Feb 10 02:47:57 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=ham version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay2.corp.sgi.com [137.38.102.29]) by oss.sgi.com (Postfix) with ESMTP id 0BB247CA3 for ; Wed, 10 Feb 2016 02:47:57 -0600 (CST) Received: from cuda.sgi.com (cuda1.sgi.com [192.48.157.11]) by relay2.corp.sgi.com (Postfix) with ESMTP id E268B304039 for ; Wed, 10 Feb 2016 00:47:56 -0800 (PST) X-ASG-Debug-ID: 1455094074-04bdf066ec3bbb0001-NocioJ Received: from ipmail06.adl2.internode.on.net (ipmail06.adl2.internode.on.net [150.101.137.129]) by cuda.sgi.com with ESMTP id 81QD4SpjCd3MDx7R for ; Wed, 10 Feb 2016 00:47:55 -0800 (PST) X-Barracuda-Envelope-From: dave@fromorbit.com X-Barracuda-Apparent-Source-IP: 150.101.137.129 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: A2AdCgBg+LpWPBATLHleKAECgw+IIoF5nVkGkS+LR00BAQEBAQEHAQEBAUE/QRIBhEo7gQIDB4hHoQqfBIVKiX2DbgWWeJxFRI17ghgBCwFAGYFcKIcuGgSBNQEBAQ Received: from ppp121-44-19-16.lns20.syd4.internode.on.net (HELO dastard) ([121.44.19.16]) by ipmail06.adl2.internode.on.net with ESMTP; 10 Feb 2016 19:17:51 +1030 Received: from disappointment.disaster.area ([192.168.1.110] helo=disappointment) by dastard with esmtp (Exim 4.80) (envelope-from ) id 1aTQQo-0005Bf-7L for xfs@oss.sgi.com; Wed, 10 Feb 2016 19:47:26 +1100 Received: from dave by disappointment with local (Exim 4.86) (envelope-from ) id 1aTQQo-0002aI-6Y for xfs@oss.sgi.com; Wed, 10 Feb 2016 19:47:26 +1100 From: Dave Chinner To: xfs@oss.sgi.com Subject: [PATCH 0/8 v4] xfs: get rid of xfs_cluster_write Date: Wed, 10 Feb 2016 19:47:15 +1100 X-ASG-Orig-Subj: [PATCH 0/8 v4] xfs: get rid of xfs_cluster_write Message-Id: <1455094043-9694-1-git-send-email-david@fromorbit.com> X-Mailer: git-send-email 2.5.0 X-Barracuda-Connect: ipmail06.adl2.internode.on.net[150.101.137.129] X-Barracuda-Start-Time: 1455094074 X-Barracuda-URL: https://192.48.157.11:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-BRTS-Status: 1 X-Barracuda-Spam-Score: 0.00 X-Barracuda-Spam-Status: No, SCORE=0.00 using per-user scores of TAG_LEVEL=1000.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.7 tests= X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.3.26911 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- Hi folks, This is the 4th version of this series to followup on review comments from Brian and Christoph. There are three new patches in this series. Patch 2/8 is split out from patch 3/8 to document the removal of the ioend cancelling code, spearate from the introduction of the writepage context. Patches 7 and 8 are new patches (as in the first time I've posted them) to demonstrate how to remove the IO completion dependency on recording the bufferehads attached to the ioend. This is the first step in removing bufferheads from the writepage IO path - these are FYI patches, not patches I want to have committed immediately. The changes all run through xfstests on 4k and 1k block size filesystems fine, and I think i addressed all the review comments. Patch 6/8 changed enough that I removed Brian's reviewed-by from it and so it will need to be looked at completely again. -Dave. Version 4: - split xfs_ioend_cancel removal into it's own patch (patch 2) - cleaned up submission of ioends to be consistent w.r.t. success and error paths (patch 3) - made variables names less verbose (patch 6) - got rid of xfs_writepage_submit() (patch 6) - use a struct list_head for ioend chaining (patch 6) - consolidated ioend submission paths to use common code (patch 6) From dave@fromorbit.com Wed Feb 10 02:47:56 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=ham version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay3.corp.sgi.com [198.149.34.15]) by oss.sgi.com (Postfix) with ESMTP id 853A47CA2 for ; Wed, 10 Feb 2016 02:47:56 -0600 (CST) Received: from cuda.sgi.com (cuda2.sgi.com [192.48.176.25]) by relay3.corp.sgi.com (Postfix) with ESMTP id 01FF4AC006 for ; Wed, 10 Feb 2016 00:47:55 -0800 (PST) X-ASG-Debug-ID: 1455094071-04cbb04332508b0001-NocioJ Received: from ipmail06.adl2.internode.on.net (ipmail06.adl2.internode.on.net [150.101.137.129]) by cuda.sgi.com with ESMTP id w3DqJDOnPey9CacO for ; Wed, 10 Feb 2016 00:47:51 -0800 (PST) X-Barracuda-Envelope-From: dave@fromorbit.com X-Barracuda-Apparent-Source-IP: 150.101.137.129 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: A2AjCgBg+LpWPBATLHlWCCgBAoMPgT+GY4F5nVkGkS+KFIEzTQEBAQEBAQcBAQEBQT9BEgGDbgEFJyAPMwgYGBk5AwcUGYgatVmKNYVKiQ1KGYN7BYdTjyWcRY4/ghgBCwE9AxmBXCguhwCBUwEBAQ Received: from ppp121-44-19-16.lns20.syd4.internode.on.net (HELO dastard) ([121.44.19.16]) by ipmail06.adl2.internode.on.net with ESMTP; 10 Feb 2016 19:17:33 +1030 Received: from disappointment.disaster.area ([192.168.1.110] helo=disappointment) by dastard with esmtp (Exim 4.80) (envelope-from ) id 1aTQQo-0005Bi-8J for xfs@oss.sgi.com; Wed, 10 Feb 2016 19:47:26 +1100 Received: from dave by disappointment with local (Exim 4.86) (envelope-from ) id 1aTQQo-0002aV-7b for xfs@oss.sgi.com; Wed, 10 Feb 2016 19:47:26 +1100 From: Dave Chinner To: xfs@oss.sgi.com Subject: [PATCH 3/8] xfs: Introduce writeback context for writepages Date: Wed, 10 Feb 2016 19:47:18 +1100 X-ASG-Orig-Subj: [PATCH 3/8] xfs: Introduce writeback context for writepages Message-Id: <1455094043-9694-4-git-send-email-david@fromorbit.com> X-Mailer: git-send-email 2.5.0 In-Reply-To: <1455094043-9694-1-git-send-email-david@fromorbit.com> References: <1455094043-9694-1-git-send-email-david@fromorbit.com> X-Barracuda-Connect: ipmail06.adl2.internode.on.net[150.101.137.129] X-Barracuda-Start-Time: 1455094071 X-Barracuda-URL: https://192.48.176.25:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-BRTS-Status: 1 X-Barracuda-Spam-Score: 0.00 X-Barracuda-Spam-Status: No, SCORE=0.00 using per-user scores of TAG_LEVEL=1000.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.7 tests= X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.3.26911 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- From: Dave Chinner xfs_vm_writepages() calls generic_writepages to writeback a range of a file, but then xfs_vm_writepage() clusters pages itself as it does not have any context it can pass between->writepage calls from __write_cache_pages(). Introduce a writeback context for xfs_vm_writepages() and call __write_cache_pages directly with our own writepage callback so that we can pass that context to each writepage invocation. This encapsulates the current mapping, whether it is valid or not, the current ioend and it's IO type and the ioend chain being built. This requires us to move the ioend submission up to the level where the writepage context is declared. This does mean we do not submit IO until we packaged the entire writeback range, but with the block plugging in the writepages call this is the way IO is submitted, anyway. It also means that we need to handle discontiguous page ranges. If the pages sent down by write_cache_pages to the writepage callback are discontiguous, we need to detect this and put each discontiguous page range into individual ioends. This is needed to ensure that the ioend accurately represents the range of the file that it covers so that file size updates during IO completion set the size correctly. Failure to take into account the discontiguous ranges results in files being too small when writeback patterns are non-sequential. Signed-off-by: Dave Chinner --- fs/xfs/xfs_aops.c | 219 ++++++++++++++++++++++++++++-------------------------- 1 file changed, 114 insertions(+), 105 deletions(-) diff --git a/fs/xfs/xfs_aops.c b/fs/xfs/xfs_aops.c index 4fe74727..c93de73 100644 --- a/fs/xfs/xfs_aops.c +++ b/fs/xfs/xfs_aops.c @@ -40,6 +40,18 @@ #define XFS_DIO_FLAG_UNWRITTEN (1 << 0) #define XFS_DIO_FLAG_APPEND (1 << 1) +/* + * structure owned by writepages passed to individual writepage calls + */ +struct xfs_writepage_ctx { + struct xfs_bmbt_irec imap; + bool imap_valid; + unsigned int io_type; + struct xfs_ioend *iohead; + struct xfs_ioend *ioend; + sector_t last_block; +}; + void xfs_count_page_state( struct page *page, @@ -341,7 +353,7 @@ xfs_map_blocks( return 0; } -STATIC int +STATIC bool xfs_imap_valid( struct inode *inode, struct xfs_bmbt_irec *imap, @@ -538,29 +550,27 @@ xfs_add_to_ioend( struct inode *inode, struct buffer_head *bh, xfs_off_t offset, - unsigned int type, - xfs_ioend_t **result, - int need_ioend) + struct xfs_writepage_ctx *wpc) { - xfs_ioend_t *ioend = *result; - - if (!ioend || need_ioend || type != ioend->io_type) { - xfs_ioend_t *previous = *result; - - ioend = xfs_alloc_ioend(inode, type); - ioend->io_offset = offset; - ioend->io_buffer_head = bh; - ioend->io_buffer_tail = bh; - if (previous) - previous->io_list = ioend; - *result = ioend; + if (!wpc->ioend || wpc->io_type != wpc->ioend->io_type || + bh->b_blocknr != wpc->last_block + 1) { + struct xfs_ioend *new; + + new = xfs_alloc_ioend(inode, wpc->io_type); + new->io_offset = offset; + new->io_buffer_head = bh; + new->io_buffer_tail = bh; + if (wpc->ioend) + wpc->ioend->io_list = new; + wpc->ioend = new; } else { - ioend->io_buffer_tail->b_private = bh; - ioend->io_buffer_tail = bh; + wpc->ioend->io_buffer_tail->b_private = bh; + wpc->ioend->io_buffer_tail = bh; } bh->b_private = NULL; - ioend->io_size += bh->b_size; + wpc->ioend->io_size += bh->b_size; + wpc->last_block = bh->b_blocknr; } STATIC void @@ -657,17 +667,15 @@ xfs_convert_page( struct inode *inode, struct page *page, loff_t tindex, - struct xfs_bmbt_irec *imap, - xfs_ioend_t **ioendp, + struct xfs_writepage_ctx *wpc, struct writeback_control *wbc) { struct buffer_head *bh, *head; xfs_off_t end_offset; unsigned long p_offset; - unsigned int type; int len, page_dirty; int count = 0, done = 0, uptodate = 1; - xfs_off_t offset = page_offset(page); + xfs_off_t offset = page_offset(page); if (page->index != tindex) goto fail; @@ -677,7 +685,7 @@ xfs_convert_page( goto fail_unlock_page; if (page->mapping != inode->i_mapping) goto fail_unlock_page; - if (!xfs_check_page_type(page, (*ioendp)->io_type, false)) + if (!xfs_check_page_type(page, wpc->ioend->io_type, false)) goto fail_unlock_page; /* @@ -713,7 +721,7 @@ xfs_convert_page( * writeback. Hence for more optimal IO patterns, we should always * avoid partial page writeback due to multiple mappings on a page here. */ - if (!xfs_imap_valid(inode, imap, end_offset)) + if (!xfs_imap_valid(inode, &wpc->imap, end_offset)) goto fail_unlock_page; len = 1 << inode->i_blkbits; @@ -745,23 +753,22 @@ xfs_convert_page( if (buffer_unwritten(bh) || buffer_delay(bh) || buffer_mapped(bh)) { if (buffer_unwritten(bh)) - type = XFS_IO_UNWRITTEN; + wpc->io_type = XFS_IO_UNWRITTEN; else if (buffer_delay(bh)) - type = XFS_IO_DELALLOC; + wpc->io_type = XFS_IO_DELALLOC; else - type = XFS_IO_OVERWRITE; + wpc->io_type = XFS_IO_OVERWRITE; /* * imap should always be valid because of the above * partial page end_offset check on the imap. */ - ASSERT(xfs_imap_valid(inode, imap, offset)); + ASSERT(xfs_imap_valid(inode, &wpc->imap, offset)); lock_buffer(bh); - if (type != XFS_IO_OVERWRITE) - xfs_map_at_offset(inode, bh, imap, offset); - xfs_add_to_ioend(inode, bh, offset, type, - ioendp, done); + if (wpc->io_type != XFS_IO_OVERWRITE) + xfs_map_at_offset(inode, bh, &wpc->imap, offset); + xfs_add_to_ioend(inode, bh, offset, wpc); page_dirty--; count++; @@ -796,8 +803,7 @@ STATIC void xfs_cluster_write( struct inode *inode, pgoff_t tindex, - struct xfs_bmbt_irec *imap, - xfs_ioend_t **ioendp, + struct xfs_writepage_ctx *wpc, struct writeback_control *wbc, pgoff_t tlast) { @@ -813,7 +819,7 @@ xfs_cluster_write( for (i = 0; i < pagevec_count(&pvec); i++) { done = xfs_convert_page(inode, pvec.pages[i], tindex++, - imap, ioendp, wbc); + wpc, wbc); if (done) break; } @@ -901,21 +907,20 @@ out_invalidate: static int xfs_writepage_submit( - struct xfs_ioend *ioend, - struct xfs_ioend *iohead, + struct xfs_writepage_ctx *wpc, struct writeback_control *wbc, int status) { struct blk_plug plug; /* Reserve log space if we might write beyond the on-disk inode size. */ - if (!status && ioend && ioend->io_type != XFS_IO_UNWRITTEN && - xfs_ioend_is_append(ioend)) - status = xfs_setfilesize_trans_alloc(ioend); + if (!status && wpc->ioend && wpc->ioend->io_type != XFS_IO_UNWRITTEN && + xfs_ioend_is_append(wpc->ioend)) + status = xfs_setfilesize_trans_alloc(wpc->ioend); - if (iohead) { + if (wpc->iohead) { blk_start_plug(&plug); - xfs_submit_ioend(wbc, iohead, status); + xfs_submit_ioend(wbc, wpc->iohead, status); blk_finish_plug(&plug); } return status; @@ -930,20 +935,19 @@ xfs_writepage_submit( * For any other dirty buffer heads on the page we should flush them. */ STATIC int -xfs_vm_writepage( +xfs_do_writepage( struct page *page, - struct writeback_control *wbc) + struct writeback_control *wbc, + void *data) { + struct xfs_writepage_ctx *wpc = data; struct inode *inode = page->mapping->host; struct buffer_head *bh, *head; - struct xfs_bmbt_irec imap; - xfs_ioend_t *ioend = NULL, *iohead = NULL; loff_t offset; - unsigned int type; __uint64_t end_offset; pgoff_t end_index, last_index; ssize_t len; - int err, imap_valid = 0, uptodate = 1; + int err, uptodate = 1; int count = 0; trace_xfs_writepage(inode, page, 0, 0); @@ -1042,11 +1046,8 @@ xfs_vm_writepage( bh = head = page_buffers(page); offset = page_offset(page); - type = XFS_IO_OVERWRITE; do { - int new_ioend = 0; - if (offset >= end_offset) break; if (!buffer_uptodate(bh)) @@ -1059,24 +1060,24 @@ xfs_vm_writepage( * buffers covering holes here. */ if (!buffer_mapped(bh) && buffer_uptodate(bh)) { - imap_valid = 0; + wpc->imap_valid = false; continue; } if (buffer_unwritten(bh)) { - if (type != XFS_IO_UNWRITTEN) { - type = XFS_IO_UNWRITTEN; - imap_valid = 0; + if (wpc->io_type != XFS_IO_UNWRITTEN) { + wpc->io_type = XFS_IO_UNWRITTEN; + wpc->imap_valid = false; } } else if (buffer_delay(bh)) { - if (type != XFS_IO_DELALLOC) { - type = XFS_IO_DELALLOC; - imap_valid = 0; + if (wpc->io_type != XFS_IO_DELALLOC) { + wpc->io_type = XFS_IO_DELALLOC; + wpc->imap_valid = false; } } else if (buffer_uptodate(bh)) { - if (type != XFS_IO_OVERWRITE) { - type = XFS_IO_OVERWRITE; - imap_valid = 0; + if (wpc->io_type != XFS_IO_OVERWRITE) { + wpc->io_type = XFS_IO_OVERWRITE; + wpc->imap_valid = false; } } else { if (PageUptodate(page)) @@ -1087,38 +1088,29 @@ xfs_vm_writepage( * subsequent writeable buffers into a new * ioend. */ - imap_valid = 0; + wpc->imap_valid = 0; continue; } - if (imap_valid) - imap_valid = xfs_imap_valid(inode, &imap, offset); - if (!imap_valid) { - /* - * If we didn't have a valid mapping then we need to - * put the new mapping into a separate ioend structure. - * This ensures non-contiguous extents always have - * separate ioends, which is particularly important - * for unwritten extent conversion at I/O completion - * time. - */ - new_ioend = 1; - err = xfs_map_blocks(inode, offset, &imap, type); + if (wpc->imap_valid) + wpc->imap_valid = xfs_imap_valid(inode, &wpc->imap, offset); + if (!wpc->imap_valid) { + err = xfs_map_blocks(inode, offset, &wpc->imap, + wpc->io_type); if (err) goto error; - imap_valid = xfs_imap_valid(inode, &imap, offset); + wpc->imap_valid = xfs_imap_valid(inode, &wpc->imap, offset); } - if (imap_valid) { + if (wpc->imap_valid) { lock_buffer(bh); - if (type != XFS_IO_OVERWRITE) - xfs_map_at_offset(inode, bh, &imap, offset); - xfs_add_to_ioend(inode, bh, offset, type, &ioend, - new_ioend); + if (wpc->io_type != XFS_IO_OVERWRITE) + xfs_map_at_offset(inode, bh, &wpc->imap, offset); + xfs_add_to_ioend(inode, bh, offset, wpc); count++; } - if (!iohead) - iohead = ioend; + if (!wpc->iohead) + wpc->iohead = wpc->ioend; } while (offset += len, ((bh = bh->b_this_page) != head)); @@ -1128,10 +1120,10 @@ xfs_vm_writepage( xfs_start_page_writeback(page, 1, count); /* if there is no IO to be submitted for this page, we are done */ - if (!ioend) + if (!count) return 0; - ASSERT(iohead); + ASSERT(wpc->iohead); ASSERT(err == 0); /* @@ -1139,10 +1131,10 @@ xfs_vm_writepage( * completion path as we have marked the initial page as under writeback * and unlocked it. */ - if (imap_valid) { + if (wpc->imap_valid) { xfs_off_t end_index; - end_index = imap.br_startoff + imap.br_blockcount; + end_index = wpc->imap.br_startoff + wpc->imap.br_blockcount; /* to bytes */ end_index <<= inode->i_blkbits; @@ -1154,11 +1146,8 @@ xfs_vm_writepage( if (end_index > last_index) end_index = last_index; - xfs_cluster_write(inode, page->index + 1, &imap, &ioend, - wbc, end_index); + xfs_cluster_write(inode, page->index + 1, wpc, wbc, end_index); } - - xfs_writepage_submit(ioend, iohead, wbc, err); return 0; error: @@ -1166,21 +1155,21 @@ error: * On error, we have to fail the iohead here because we buffers locked * in the ioend chain. If we don't do this, we'll deadlock invalidating * the page as that tries to lock the buffers on the page. Also, because - * we may have set pages under writeback, we have to run IO completion to - * mark the error state of the IO appropriately, so we can't cancel the - * ioend directly here. That means we have to mark this page as under - * writeback if we included any buffers from it in the ioend chain. + * we may have set pages under writeback, we have to make sure we run + * IO completion to mark the error state of the IO appropriately, so we + * can't cancel the ioend directly here. That means we have to mark this + * page as under writeback if we included any buffers from it in the + * ioend chain so that completion treats it correctly. + * + * If we didn't include the page in the ioend, then we can simply + * discard and unlock it as there are no other users of the page or it's + * buffers right now. The caller will still need to trigger submission + * of outstanding ioends on the writepage context so they are treated + * correctly on error. */ if (count) xfs_start_page_writeback(page, 0, count); - xfs_writepage_submit(ioend, iohead, wbc, err); - - /* - * We can only discard the page we had the IO error on if we haven't - * included it in the ioend above. If it has already been errored out, - * the it is unlocked and we can't touch it here. - */ - if (!count) { + else { xfs_aops_discard_page(page); ClearPageUptodate(page); unlock_page(page); @@ -1195,12 +1184,32 @@ redirty: } STATIC int +xfs_vm_writepage( + struct page *page, + struct writeback_control *wbc) +{ + struct xfs_writepage_ctx wpc = { + .io_type = XFS_IO_OVERWRITE, + }; + int ret; + + ret = xfs_do_writepage(page, wbc, &wpc); + return xfs_writepage_submit(&wpc, wbc, ret); +} + +STATIC int xfs_vm_writepages( struct address_space *mapping, struct writeback_control *wbc) { + struct xfs_writepage_ctx wpc = { + .io_type = XFS_IO_OVERWRITE, + }; + int ret; + xfs_iflags_clear(XFS_I(mapping->host), XFS_ITRUNCATED); - return generic_writepages(mapping, wbc); + ret = write_cache_pages(mapping, wbc, xfs_do_writepage, &wpc); + return xfs_writepage_submit(&wpc, wbc, ret); } /* -- 2.5.0 From dave@fromorbit.com Wed Feb 10 02:48:00 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=ham version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay1.corp.sgi.com [137.38.102.111]) by oss.sgi.com (Postfix) with ESMTP id 56F317CA2 for ; Wed, 10 Feb 2016 02:48:00 -0600 (CST) Received: from cuda.sgi.com (cuda2.sgi.com [192.48.176.25]) by relay1.corp.sgi.com (Postfix) with ESMTP id 309428F804B for ; Wed, 10 Feb 2016 00:47:57 -0800 (PST) X-ASG-Debug-ID: 1455094071-04cbb04332508b0002-NocioJ Received: from ipmail06.adl2.internode.on.net (ipmail06.adl2.internode.on.net [150.101.137.129]) by cuda.sgi.com with ESMTP id dT4x3Vq95DuRZA8r for ; Wed, 10 Feb 2016 00:47:54 -0800 (PST) X-Barracuda-Envelope-From: dave@fromorbit.com X-Barracuda-Apparent-Source-IP: 150.101.137.129 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: A2AhCgBg+LpWPBATLHlWCCgBAoMPgT+GY4F5nVkGkS+LR00BAQEBAQEHAQEBAUE/QRIBg24BBScvMwgYMTkDBxQZiBrADoVKiQ2EXgWHSQqHA4ginEVEjXuCGAELQRmBXCguhwAaBIE1AQEB Received: from ppp121-44-19-16.lns20.syd4.internode.on.net (HELO dastard) ([121.44.19.16]) by ipmail06.adl2.internode.on.net with ESMTP; 10 Feb 2016 19:17:51 +1030 Received: from disappointment.disaster.area ([192.168.1.110] helo=disappointment) by dastard with esmtp (Exim 4.80) (envelope-from ) id 1aTQQo-0005Bh-83 for xfs@oss.sgi.com; Wed, 10 Feb 2016 19:47:26 +1100 Received: from dave by disappointment with local (Exim 4.86) (envelope-from ) id 1aTQQo-0002aQ-7I for xfs@oss.sgi.com; Wed, 10 Feb 2016 19:47:26 +1100 From: Dave Chinner To: xfs@oss.sgi.com Subject: [PATCH 2/8] xfs: remove xfs_cancel_ioend Date: Wed, 10 Feb 2016 19:47:17 +1100 X-ASG-Orig-Subj: [PATCH 2/8] xfs: remove xfs_cancel_ioend Message-Id: <1455094043-9694-3-git-send-email-david@fromorbit.com> X-Mailer: git-send-email 2.5.0 In-Reply-To: <1455094043-9694-1-git-send-email-david@fromorbit.com> References: <1455094043-9694-1-git-send-email-david@fromorbit.com> X-Barracuda-Connect: ipmail06.adl2.internode.on.net[150.101.137.129] X-Barracuda-Start-Time: 1455094074 X-Barracuda-URL: https://192.48.176.25:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-BRTS-Status: 1 X-Barracuda-Spam-Score: 0.00 X-Barracuda-Spam-Status: No, SCORE=0.00 using per-user scores of TAG_LEVEL=1000.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.7 tests= X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.3.26911 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- From: Dave Chinner We currently have code to cancel ioends being built because we change bufferhead state as we build the ioend. On error, this needs to be unwound and so we have cancelling code that walks the buffers on the ioend chain and undoes these state changes. However, the IO submission path already handles state changes for buffers when a submission error occurs, so we don't really need a separate cancel function to do this - we can simply submit the ioend chain with the specific error and it will be cancelled rather than submitted. Hence we can remove the explicit cancel code and just rely on submission to deal with the error correctly. Signed-off-by: Dave Chinner --- fs/xfs/xfs_aops.c | 94 +++++++++++++++++++++++++++---------------------------- 1 file changed, 47 insertions(+), 47 deletions(-) diff --git a/fs/xfs/xfs_aops.c b/fs/xfs/xfs_aops.c index 00452cb..4fe74727 100644 --- a/fs/xfs/xfs_aops.c +++ b/fs/xfs/xfs_aops.c @@ -528,38 +528,6 @@ xfs_submit_ioend( } /* - * Cancel submission of all buffer_heads so far in this endio. - * Toss the endio too. Only ever called for the initial page - * in a writepage request, so only ever one page. - */ -STATIC void -xfs_cancel_ioend( - xfs_ioend_t *ioend) -{ - xfs_ioend_t *next; - struct buffer_head *bh, *next_bh; - - do { - next = ioend->io_list; - bh = ioend->io_buffer_head; - do { - next_bh = bh->b_private; - clear_buffer_async_write(bh); - /* - * The unwritten flag is cleared when added to the - * ioend. We're not submitting for I/O so mark the - * buffer unwritten again for next time around. - */ - if (ioend->io_type == XFS_IO_UNWRITTEN) - set_buffer_unwritten(bh); - unlock_buffer(bh); - } while ((bh = next_bh) != NULL); - - mempool_free(ioend, xfs_ioend_pool); - } while ((ioend = next) != NULL); -} - -/* * Test to see if we've been building up a completion structure for * earlier buffers -- if so, we try to append to this ioend if we * can, otherwise we finish off any current ioend and start another. @@ -931,6 +899,28 @@ out_invalidate: return; } +static int +xfs_writepage_submit( + struct xfs_ioend *ioend, + struct xfs_ioend *iohead, + struct writeback_control *wbc, + int status) +{ + struct blk_plug plug; + + /* Reserve log space if we might write beyond the on-disk inode size. */ + if (!status && ioend && ioend->io_type != XFS_IO_UNWRITTEN && + xfs_ioend_is_append(ioend)) + status = xfs_setfilesize_trans_alloc(ioend); + + if (iohead) { + blk_start_plug(&plug); + xfs_submit_ioend(wbc, iohead, status); + blk_finish_plug(&plug); + } + return status; +} + /* * Write out a dirty page. * @@ -1142,6 +1132,7 @@ xfs_vm_writepage( return 0; ASSERT(iohead); + ASSERT(err == 0); /* * Any errors from this point onwards need tobe reported through the IO @@ -1167,25 +1158,34 @@ xfs_vm_writepage( wbc, end_index); } - - /* - * Reserve log space if we might write beyond the on-disk inode size. - */ - err = 0; - if (ioend->io_type != XFS_IO_UNWRITTEN && xfs_ioend_is_append(ioend)) - err = xfs_setfilesize_trans_alloc(ioend); - - xfs_submit_ioend(wbc, iohead, err); - + xfs_writepage_submit(ioend, iohead, wbc, err); return 0; error: - if (iohead) - xfs_cancel_ioend(iohead); + /* + * On error, we have to fail the iohead here because we buffers locked + * in the ioend chain. If we don't do this, we'll deadlock invalidating + * the page as that tries to lock the buffers on the page. Also, because + * we may have set pages under writeback, we have to run IO completion to + * mark the error state of the IO appropriately, so we can't cancel the + * ioend directly here. That means we have to mark this page as under + * writeback if we included any buffers from it in the ioend chain. + */ + if (count) + xfs_start_page_writeback(page, 0, count); + xfs_writepage_submit(ioend, iohead, wbc, err); - xfs_aops_discard_page(page); - ClearPageUptodate(page); - unlock_page(page); + /* + * We can only discard the page we had the IO error on if we haven't + * included it in the ioend above. If it has already been errored out, + * the it is unlocked and we can't touch it here. + */ + if (!count) { + xfs_aops_discard_page(page); + ClearPageUptodate(page); + unlock_page(page); + } + mapping_set_error(page->mapping, err); return err; redirty: -- 2.5.0 From dave@fromorbit.com Wed Feb 10 02:48:00 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=ham version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay3.corp.sgi.com [198.149.34.15]) by oss.sgi.com (Postfix) with ESMTP id 7B4FB7CA7 for ; Wed, 10 Feb 2016 02:48:00 -0600 (CST) Received: from cuda.sgi.com (cuda1.sgi.com [192.48.157.11]) by relay3.corp.sgi.com (Postfix) with ESMTP id DA22AAC005 for ; Wed, 10 Feb 2016 00:47:59 -0800 (PST) X-ASG-Debug-ID: 1455094077-04bdf066eb3bbe0001-NocioJ Received: from ipmail06.adl2.internode.on.net (ipmail06.adl2.internode.on.net [150.101.137.129]) by cuda.sgi.com with ESMTP id JIdk5H6AHjjFqirr for ; Wed, 10 Feb 2016 00:47:58 -0800 (PST) X-Barracuda-Envelope-From: dave@fromorbit.com X-Barracuda-Apparent-Source-IP: 150.101.137.129 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: A2AjCgBg+LpWPBATLHleKAECgw+BP4ZjgXmdWQaRL4oUgTNNAQEBAQEBBwEBAQFBP0ESAYNuAQUnLzMIGDE5AwcUGR6HfMAOhUqJVyaDbgWHU48lnEVEjXuCGAELgjYoLocAgVMBAQE Received: from ppp121-44-19-16.lns20.syd4.internode.on.net (HELO dastard) ([121.44.19.16]) by ipmail06.adl2.internode.on.net with ESMTP; 10 Feb 2016 19:17:40 +1030 Received: from disappointment.disaster.area ([192.168.1.110] helo=disappointment) by dastard with esmtp (Exim 4.80) (envelope-from ) id 1aTQQo-0005Bg-7j for xfs@oss.sgi.com; Wed, 10 Feb 2016 19:47:26 +1100 Received: from dave by disappointment with local (Exim 4.86) (envelope-from ) id 1aTQQo-0002aL-6y for xfs@oss.sgi.com; Wed, 10 Feb 2016 19:47:26 +1100 From: Dave Chinner To: xfs@oss.sgi.com Subject: [PATCH 1/8] xfs: remove nonblocking mode from xfs_vm_writepage Date: Wed, 10 Feb 2016 19:47:16 +1100 X-ASG-Orig-Subj: [PATCH 1/8] xfs: remove nonblocking mode from xfs_vm_writepage Message-Id: <1455094043-9694-2-git-send-email-david@fromorbit.com> X-Mailer: git-send-email 2.5.0 In-Reply-To: <1455094043-9694-1-git-send-email-david@fromorbit.com> References: <1455094043-9694-1-git-send-email-david@fromorbit.com> X-Barracuda-Connect: ipmail06.adl2.internode.on.net[150.101.137.129] X-Barracuda-Start-Time: 1455094077 X-Barracuda-URL: https://192.48.157.11:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-BRTS-Status: 1 X-Barracuda-Spam-Score: 0.00 X-Barracuda-Spam-Status: No, SCORE=0.00 using per-user scores of TAG_LEVEL=1000.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.7 tests= X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.3.26911 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- From: Dave Chinner Remove the nonblocking optimisation done for mapping lookups during writeback. It's not clear that leaving a hole in the writeback range just because we couldn't get a lock is really a win, as it makes us do another small random IO later on rather than a large sequential IO now. As this gets in the way of sane error handling later on, just remove for the moment and we can re-introduce an equivalent optimisation in future if we see problems due to extent map lock contention. Signed-off-by: Dave Chinner Reviewed-by: Christoph Hellwig --- fs/xfs/xfs_aops.c | 20 +++----------------- 1 file changed, 3 insertions(+), 17 deletions(-) diff --git a/fs/xfs/xfs_aops.c b/fs/xfs/xfs_aops.c index 14ac982..00452cb 100644 --- a/fs/xfs/xfs_aops.c +++ b/fs/xfs/xfs_aops.c @@ -289,8 +289,7 @@ xfs_map_blocks( struct inode *inode, loff_t offset, struct xfs_bmbt_irec *imap, - int type, - int nonblocking) + int type) { struct xfs_inode *ip = XFS_I(inode); struct xfs_mount *mp = ip->i_mount; @@ -306,12 +305,7 @@ xfs_map_blocks( if (type == XFS_IO_UNWRITTEN) bmapi_flags |= XFS_BMAPI_IGSTATE; - if (!xfs_ilock_nowait(ip, XFS_ILOCK_SHARED)) { - if (nonblocking) - return -EAGAIN; - xfs_ilock(ip, XFS_ILOCK_SHARED); - } - + xfs_ilock(ip, XFS_ILOCK_SHARED); ASSERT(ip->i_d.di_format != XFS_DINODE_FMT_BTREE || (ip->i_df.if_flags & XFS_IFEXTENTS)); ASSERT(offset <= mp->m_super->s_maxbytes); @@ -961,7 +955,6 @@ xfs_vm_writepage( ssize_t len; int err, imap_valid = 0, uptodate = 1; int count = 0; - int nonblocking = 0; trace_xfs_writepage(inode, page, 0, 0); @@ -1061,9 +1054,6 @@ xfs_vm_writepage( offset = page_offset(page); type = XFS_IO_OVERWRITE; - if (wbc->sync_mode == WB_SYNC_NONE) - nonblocking = 1; - do { int new_ioend = 0; @@ -1123,8 +1113,7 @@ xfs_vm_writepage( * time. */ new_ioend = 1; - err = xfs_map_blocks(inode, offset, &imap, type, - nonblocking); + err = xfs_map_blocks(inode, offset, &imap, type); if (err) goto error; imap_valid = xfs_imap_valid(inode, &imap, offset); @@ -1194,9 +1183,6 @@ error: if (iohead) xfs_cancel_ioend(iohead); - if (err == -EAGAIN) - goto redirty; - xfs_aops_discard_page(page); ClearPageUptodate(page); unlock_page(page); -- 2.5.0 From dave@fromorbit.com Wed Feb 10 02:48:08 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=ham version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay2.corp.sgi.com [137.38.102.29]) by oss.sgi.com (Postfix) with ESMTP id 875207CA2 for ; Wed, 10 Feb 2016 02:48:08 -0600 (CST) Received: from cuda.sgi.com (cuda2.sgi.com [192.48.176.25]) by relay2.corp.sgi.com (Postfix) with ESMTP id 781A8304039 for ; Wed, 10 Feb 2016 00:48:08 -0800 (PST) X-ASG-Debug-ID: 1455094085-04cbb04332508c0001-NocioJ Received: from ipmail06.adl2.internode.on.net (ipmail06.adl2.internode.on.net [150.101.137.129]) by cuda.sgi.com with ESMTP id vEJsSBT3XQWCZia5 for ; Wed, 10 Feb 2016 00:48:05 -0800 (PST) X-Barracuda-Envelope-From: dave@fromorbit.com X-Barracuda-Apparent-Source-IP: 150.101.137.129 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: A2AhCgBg+LpWPBATLHleKAECgw+BP4ZjgXmdWQaRL4tHTQEBAQEBAQcBAQEBQT9BEgGDbgEFJy8zCBgxOQMHFBmIGsAOhUqJC4RgBYdTjyWcRUSNe4IYAQs+AxmBXCguhwAagTkBAQE Received: from ppp121-44-19-16.lns20.syd4.internode.on.net (HELO dastard) ([121.44.19.16]) by ipmail06.adl2.internode.on.net with ESMTP; 10 Feb 2016 19:18:03 +1030 Received: from disappointment.disaster.area ([192.168.1.110] helo=disappointment) by dastard with esmtp (Exim 4.80) (envelope-from ) id 1aTQQo-0005Bj-9A for xfs@oss.sgi.com; Wed, 10 Feb 2016 19:47:26 +1100 Received: from dave by disappointment with local (Exim 4.86) (envelope-from ) id 1aTQQo-0002aa-7v for xfs@oss.sgi.com; Wed, 10 Feb 2016 19:47:26 +1100 From: Dave Chinner To: xfs@oss.sgi.com Subject: [PATCH 4/8] xfs: xfs_cluster_write is redundant Date: Wed, 10 Feb 2016 19:47:19 +1100 X-ASG-Orig-Subj: [PATCH 4/8] xfs: xfs_cluster_write is redundant Message-Id: <1455094043-9694-5-git-send-email-david@fromorbit.com> X-Mailer: git-send-email 2.5.0 In-Reply-To: <1455094043-9694-1-git-send-email-david@fromorbit.com> References: <1455094043-9694-1-git-send-email-david@fromorbit.com> X-Barracuda-Connect: ipmail06.adl2.internode.on.net[150.101.137.129] X-Barracuda-Start-Time: 1455094085 X-Barracuda-URL: https://192.48.176.25:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-BRTS-Status: 1 X-Barracuda-Spam-Score: 0.00 X-Barracuda-Spam-Status: No, SCORE=0.00 using per-user scores of TAG_LEVEL=1000.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.7 tests= X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.3.26911 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- From: Dave Chinner xfs_cluster_write() is not necessary now that xfs_vm_writepages() aggregates writepage calls across a single mapping. This means we no longer need to do page lookups in xfs_cluster_write, so writeback only needs to look up th epage cache once per page being written. This also removes a large amount of mostly duplicate code between xfs_do_writepage() and xfs_convert_page(). Signed-off-by: Dave Chinner Reviewed-by: Christoph Hellwig Signed-off-by: Dave Chinner --- fs/xfs/xfs_aops.c | 214 ++---------------------------------------------------- 1 file changed, 6 insertions(+), 208 deletions(-) diff --git a/fs/xfs/xfs_aops.c b/fs/xfs/xfs_aops.c index c93de73..c9e14d3 100644 --- a/fs/xfs/xfs_aops.c +++ b/fs/xfs/xfs_aops.c @@ -656,179 +656,6 @@ xfs_check_page_type( return false; } -/* - * Allocate & map buffers for page given the extent map. Write it out. - * except for the original page of a writepage, this is called on - * delalloc/unwritten pages only, for the original page it is possible - * that the page has no mapping at all. - */ -STATIC int -xfs_convert_page( - struct inode *inode, - struct page *page, - loff_t tindex, - struct xfs_writepage_ctx *wpc, - struct writeback_control *wbc) -{ - struct buffer_head *bh, *head; - xfs_off_t end_offset; - unsigned long p_offset; - int len, page_dirty; - int count = 0, done = 0, uptodate = 1; - xfs_off_t offset = page_offset(page); - - if (page->index != tindex) - goto fail; - if (!trylock_page(page)) - goto fail; - if (PageWriteback(page)) - goto fail_unlock_page; - if (page->mapping != inode->i_mapping) - goto fail_unlock_page; - if (!xfs_check_page_type(page, wpc->ioend->io_type, false)) - goto fail_unlock_page; - - /* - * page_dirty is initially a count of buffers on the page before - * EOF and is decremented as we move each into a cleanable state. - * - * Derivation: - * - * End offset is the highest offset that this page should represent. - * If we are on the last page, (end_offset & (PAGE_CACHE_SIZE - 1)) - * will evaluate non-zero and be less than PAGE_CACHE_SIZE and - * hence give us the correct page_dirty count. On any other page, - * it will be zero and in that case we need page_dirty to be the - * count of buffers on the page. - */ - end_offset = min_t(unsigned long long, - (xfs_off_t)(page->index + 1) << PAGE_CACHE_SHIFT, - i_size_read(inode)); - - /* - * If the current map does not span the entire page we are about to try - * to write, then give up. The only way we can write a page that spans - * multiple mappings in a single writeback iteration is via the - * xfs_vm_writepage() function. Data integrity writeback requires the - * entire page to be written in a single attempt, otherwise the part of - * the page we don't write here doesn't get written as part of the data - * integrity sync. - * - * For normal writeback, we also don't attempt to write partial pages - * here as it simply means that write_cache_pages() will see it under - * writeback and ignore the page until some point in the future, at - * which time this will be the only page in the file that needs - * writeback. Hence for more optimal IO patterns, we should always - * avoid partial page writeback due to multiple mappings on a page here. - */ - if (!xfs_imap_valid(inode, &wpc->imap, end_offset)) - goto fail_unlock_page; - - len = 1 << inode->i_blkbits; - p_offset = min_t(unsigned long, end_offset & (PAGE_CACHE_SIZE - 1), - PAGE_CACHE_SIZE); - p_offset = p_offset ? roundup(p_offset, len) : PAGE_CACHE_SIZE; - page_dirty = p_offset / len; - - /* - * The moment we find a buffer that doesn't match our current type - * specification or can't be written, abort the loop and start - * writeback. As per the above xfs_imap_valid() check, only - * xfs_vm_writepage() can handle partial page writeback fully - we are - * limited here to the buffers that are contiguous with the current - * ioend, and hence a buffer we can't write breaks that contiguity and - * we have to defer the rest of the IO to xfs_vm_writepage(). - */ - bh = head = page_buffers(page); - do { - if (offset >= end_offset) - break; - if (!buffer_uptodate(bh)) - uptodate = 0; - if (!(PageUptodate(page) || buffer_uptodate(bh))) { - done = 1; - break; - } - - if (buffer_unwritten(bh) || buffer_delay(bh) || - buffer_mapped(bh)) { - if (buffer_unwritten(bh)) - wpc->io_type = XFS_IO_UNWRITTEN; - else if (buffer_delay(bh)) - wpc->io_type = XFS_IO_DELALLOC; - else - wpc->io_type = XFS_IO_OVERWRITE; - - /* - * imap should always be valid because of the above - * partial page end_offset check on the imap. - */ - ASSERT(xfs_imap_valid(inode, &wpc->imap, offset)); - - lock_buffer(bh); - if (wpc->io_type != XFS_IO_OVERWRITE) - xfs_map_at_offset(inode, bh, &wpc->imap, offset); - xfs_add_to_ioend(inode, bh, offset, wpc); - - page_dirty--; - count++; - } else { - done = 1; - break; - } - } while (offset += len, (bh = bh->b_this_page) != head); - - if (uptodate && bh == head) - SetPageUptodate(page); - - if (count) { - if (--wbc->nr_to_write <= 0 && - wbc->sync_mode == WB_SYNC_NONE) - done = 1; - } - xfs_start_page_writeback(page, !page_dirty, count); - - return done; - fail_unlock_page: - unlock_page(page); - fail: - return 1; -} - -/* - * Convert & write out a cluster of pages in the same extent as defined - * by mp and following the start page. - */ -STATIC void -xfs_cluster_write( - struct inode *inode, - pgoff_t tindex, - struct xfs_writepage_ctx *wpc, - struct writeback_control *wbc, - pgoff_t tlast) -{ - struct pagevec pvec; - int done = 0, i; - - pagevec_init(&pvec, 0); - while (!done && tindex <= tlast) { - unsigned len = min_t(pgoff_t, PAGEVEC_SIZE, tlast - tindex + 1); - - if (!pagevec_lookup(&pvec, inode->i_mapping, tindex, len)) - break; - - for (i = 0; i < pagevec_count(&pvec); i++) { - done = xfs_convert_page(inode, pvec.pages[i], tindex++, - wpc, wbc); - if (done) - break; - } - - pagevec_release(&pvec); - cond_resched(); - } -} - STATIC void xfs_vm_invalidatepage( struct page *page, @@ -945,7 +772,7 @@ xfs_do_writepage( struct buffer_head *bh, *head; loff_t offset; __uint64_t end_offset; - pgoff_t end_index, last_index; + pgoff_t end_index; ssize_t len; int err, uptodate = 1; int count = 0; @@ -975,12 +802,9 @@ xfs_do_writepage( if (WARN_ON_ONCE(current->flags & PF_FSTRANS)) goto redirty; - /* Is this page beyond the end of the file? */ - offset = i_size_read(inode); - end_index = offset >> PAGE_CACHE_SHIFT; - last_index = (offset - 1) >> PAGE_CACHE_SHIFT; - /* + * Is this page beyond the end of the file? + * * The page index is less than the end_index, adjust the end_offset * to the highest offset that this page should represent. * ----------------------------------------------------- @@ -991,6 +815,8 @@ xfs_do_writepage( * | desired writeback range | see else | * ---------------------------------^------------------| */ + offset = i_size_read(inode); + end_index = offset >> PAGE_CACHE_SHIFT; if (page->index < end_index) end_offset = (xfs_off_t)(page->index + 1) << PAGE_CACHE_SHIFT; else { @@ -1119,35 +945,7 @@ xfs_do_writepage( xfs_start_page_writeback(page, 1, count); - /* if there is no IO to be submitted for this page, we are done */ - if (!count) - return 0; - - ASSERT(wpc->iohead); - ASSERT(err == 0); - - /* - * Any errors from this point onwards need tobe reported through the IO - * completion path as we have marked the initial page as under writeback - * and unlocked it. - */ - if (wpc->imap_valid) { - xfs_off_t end_index; - - end_index = wpc->imap.br_startoff + wpc->imap.br_blockcount; - - /* to bytes */ - end_index <<= inode->i_blkbits; - - /* to pages */ - end_index = (end_index - 1) >> PAGE_CACHE_SHIFT; - - /* check against file size */ - if (end_index > last_index) - end_index = last_index; - - xfs_cluster_write(inode, page->index + 1, wpc, wbc, end_index); - } + ASSERT(wpc->iohead || !count); return 0; error: -- 2.5.0 From BATV+379ae17216066e1ae70b+4553+infradead.org+hch@bombadil.srs.infradead.org Wed Feb 10 03:05:13 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=ham version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay1.corp.sgi.com [137.38.102.111]) by oss.sgi.com (Postfix) with ESMTP id 0C2047CA3 for ; Wed, 10 Feb 2016 03:05:13 -0600 (CST) Received: from cuda.sgi.com (cuda1.sgi.com [192.48.157.11]) by relay1.corp.sgi.com (Postfix) with ESMTP id E2D498F8049 for ; Wed, 10 Feb 2016 01:05:09 -0800 (PST) X-ASG-Debug-ID: 1455095106-04bdf066ec3c180001-NocioJ Received: from bombadil.infradead.org ([198.137.202.9]) by cuda.sgi.com with ESMTP id JbFvocT3OyUh2c9g (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128 verify=NO) for ; Wed, 10 Feb 2016 01:05:06 -0800 (PST) X-Barracuda-Envelope-From: BATV+379ae17216066e1ae70b+4553+infradead.org+hch@bombadil.srs.infradead.org X-Barracuda-Apparent-Source-IP: 198.137.202.9 Received: from hch by bombadil.infradead.org with local (Exim 4.80.1 #2 (Red Hat Linux)) id 1aTQhu-00018e-Ao; Wed, 10 Feb 2016 09:05:06 +0000 Date: Wed, 10 Feb 2016 01:05:06 -0800 From: Christoph Hellwig To: Dave Chinner Cc: xfs@oss.sgi.com Subject: Re: [PATCH 0/8 v4] xfs: get rid of xfs_cluster_write Message-ID: <20160210090506.GA1508@infradead.org> X-ASG-Orig-Subj: Re: [PATCH 0/8 v4] xfs: get rid of xfs_cluster_write References: <1455094043-9694-1-git-send-email-david@fromorbit.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1455094043-9694-1-git-send-email-david@fromorbit.com> User-Agent: Mutt/1.5.24 (2015-08-30) X-SRS-Rewrite: SMTP reverse-path rewritten from by bombadil.infradead.org See http://www.infradead.org/rpr.html X-Barracuda-Connect: UNKNOWN[198.137.202.9] X-Barracuda-Start-Time: 1455095106 X-Barracuda-Encrypted: ECDHE-RSA-AES128-GCM-SHA256 X-Barracuda-URL: https://192.48.157.11:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-BRTS-Status: 1 X-Barracuda-Spam-Score: 2.60 X-Barracuda-Spam-Status: No, SCORE=2.60 using per-user scores of TAG_LEVEL=1000.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.7 tests=BSF_SC0_MISMATCH_TO, BSF_SC7_SA_HREF_FROM_MISMATCH_TEXT_URIx1_HL, RDNS_NONE X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.3.26911 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 0.00 BSF_SC0_MISMATCH_TO Envelope rcpt doesn't match header 0.10 RDNS_NONE Delivered to trusted network by a host with no rDNS 2.50 BSF_SC7_SA_HREF_FROM_MISMATCH_TEXT_URIx1_HL Custom Rule HREF_FROM_MISMATCH_TEXT_URIx1_HL Seems like only 4 patches made it through.. On Wed, Feb 10, 2016 at 07:47:15PM +1100, Dave Chinner wrote: > > Hi folks, > > This is the 4th version of this series to followup on review > comments from Brian and Christoph. There are three new patches in > this series. Patch 2/8 is split out from patch 3/8 to document the > removal of the ioend cancelling code, spearate from the introduction > of the writepage context. Patches 7 and 8 are new patches (as in the > first time I've posted them) to demonstrate how to remove the IO > completion dependency on recording the bufferehads attached to the > ioend. This is the first step in removing bufferheads from the > writepage IO path - these are FYI patches, not patches I want to > have committed immediately. > > The changes all run through xfstests on 4k and 1k block size > filesystems fine, and I think i addressed all the review comments. > Patch 6/8 changed enough that I removed Brian's reviewed-by from it > and so it will need to be looked at completely again. > > -Dave. > > Version 4: > - split xfs_ioend_cancel removal into it's own patch (patch 2) > - cleaned up submission of ioends to be consistent w.r.t. success > and error paths (patch 3) > - made variables names less verbose (patch 6) > - got rid of xfs_writepage_submit() (patch 6) > - use a struct list_head for ioend chaining (patch 6) > - consolidated ioend submission paths to use common code (patch 6) > > _______________________________________________ > xfs mailing list > xfs@oss.sgi.com > http://oss.sgi.com/mailman/listinfo/xfs ---end quoted text--- From dave@fromorbit.com Wed Feb 10 03:08:36 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=ham version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay1.corp.sgi.com [137.38.102.111]) by oss.sgi.com (Postfix) with ESMTP id 9E0517CA2 for ; Wed, 10 Feb 2016 03:08:36 -0600 (CST) Received: from cuda.sgi.com (cuda2.sgi.com [192.48.176.25]) by relay1.corp.sgi.com (Postfix) with ESMTP id 7F3808F8049 for ; Wed, 10 Feb 2016 01:08:36 -0800 (PST) X-ASG-Debug-ID: 1455095310-04cbb0433450ed0002-NocioJ Received: from ipmail06.adl2.internode.on.net (ipmail06.adl2.internode.on.net [150.101.137.129]) by cuda.sgi.com with ESMTP id NaiTZ7JDYdgXHhDb for ; Wed, 10 Feb 2016 01:08:33 -0800 (PST) X-Barracuda-Envelope-From: dave@fromorbit.com X-Barracuda-Apparent-Source-IP: 150.101.137.129 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: A2AhCgA2/bpWPBATLHlWCCgBAoMPgT+GY4F5nVkGkS+LR00BAQEBAQEHAQEBAUE/QRIBg24BBScvMwgYMTkDBxQZiBrAFIVKiQ2EXgWHU48lnEVEjXuCGAELgjYoLocAgVMBAQE Received: from ppp121-44-19-16.lns20.syd4.internode.on.net (HELO dastard) ([121.44.19.16]) by ipmail06.adl2.internode.on.net with ESMTP; 10 Feb 2016 19:38:29 +1030 Received: from disappointment.disaster.area ([192.168.1.110] helo=disappointment) by dastard with esmtp (Exim 4.80) (envelope-from ) id 1aTQQo-0005Bk-9g for xfs@oss.sgi.com; Wed, 10 Feb 2016 19:47:26 +1100 Received: from dave by disappointment with local (Exim 4.86) (envelope-from ) id 1aTQQo-0002af-8n for xfs@oss.sgi.com; Wed, 10 Feb 2016 19:47:26 +1100 From: Dave Chinner To: xfs@oss.sgi.com Subject: [PATCH 5/8] xfs: factor mapping out of xfs_do_writepage Date: Wed, 10 Feb 2016 19:47:20 +1100 X-ASG-Orig-Subj: [PATCH 5/8] xfs: factor mapping out of xfs_do_writepage Message-Id: <1455094043-9694-6-git-send-email-david@fromorbit.com> X-Mailer: git-send-email 2.5.0 In-Reply-To: <1455094043-9694-1-git-send-email-david@fromorbit.com> References: <1455094043-9694-1-git-send-email-david@fromorbit.com> X-Barracuda-Connect: ipmail06.adl2.internode.on.net[150.101.137.129] X-Barracuda-Start-Time: 1455095313 X-Barracuda-URL: https://192.48.176.25:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-BRTS-Status: 1 X-Barracuda-Spam-Score: 0.00 X-Barracuda-Spam-Status: No, SCORE=0.00 using per-user scores of TAG_LEVEL=1000.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.7 tests= X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.3.26911 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- From: Dave Chinner Separate out the bufferhead based mapping from the writepage code so that we have a clear separation of the page operations and the bufferhead state. Signed-off-by: Dave Chinner Reviewed-by: Christoph Hellwig Signed-off-by: Dave Chinner --- fs/xfs/xfs_aops.c | 232 ++++++++++++++++++++++++++++-------------------------- 1 file changed, 122 insertions(+), 110 deletions(-) diff --git a/fs/xfs/xfs_aops.c b/fs/xfs/xfs_aops.c index c9e14d3..95cfb27 100644 --- a/fs/xfs/xfs_aops.c +++ b/fs/xfs/xfs_aops.c @@ -753,6 +753,127 @@ xfs_writepage_submit( return status; } +static int +xfs_writepage_map( + struct xfs_writepage_ctx *wpc, + struct inode *inode, + struct page *page, + loff_t offset, + __uint64_t end_offset) +{ + struct buffer_head *bh, *head; + ssize_t len = 1 << inode->i_blkbits; + int error = 0; + int uptodate = 1; + int count = 0; + + bh = head = page_buffers(page); + offset = page_offset(page); + + do { + if (offset >= end_offset) + break; + if (!buffer_uptodate(bh)) + uptodate = 0; + + /* + * set_page_dirty dirties all buffers in a page, independent + * of their state. The dirty state however is entirely + * meaningless for holes (!mapped && uptodate), so skip + * buffers covering holes here. + */ + if (!buffer_mapped(bh) && buffer_uptodate(bh)) { + wpc->imap_valid = false; + continue; + } + + if (buffer_unwritten(bh)) { + if (wpc->io_type != XFS_IO_UNWRITTEN) { + wpc->io_type = XFS_IO_UNWRITTEN; + wpc->imap_valid = false; + } + } else if (buffer_delay(bh)) { + if (wpc->io_type != XFS_IO_DELALLOC) { + wpc->io_type = XFS_IO_DELALLOC; + wpc->imap_valid = false; + } + } else if (buffer_uptodate(bh)) { + if (wpc->io_type != XFS_IO_OVERWRITE) { + wpc->io_type = XFS_IO_OVERWRITE; + wpc->imap_valid = false; + } + } else { + if (PageUptodate(page)) + ASSERT(buffer_mapped(bh)); + /* + * This buffer is not uptodate and will not be + * written to disk. Ensure that we will put any + * subsequent writeable buffers into a new + * ioend. + */ + wpc->imap_valid = false; + continue; + } + + if (wpc->imap_valid) + wpc->imap_valid = xfs_imap_valid(inode, &wpc->imap, + offset); + if (!wpc->imap_valid) { + error = xfs_map_blocks(inode, offset, &wpc->imap, + wpc->io_type); + if (error) + goto out_error; + wpc->imap_valid = xfs_imap_valid(inode, &wpc->imap, + offset); + } + if (wpc->imap_valid) { + lock_buffer(bh); + if (wpc->io_type != XFS_IO_OVERWRITE) + xfs_map_at_offset(inode, bh, &wpc->imap, offset); + xfs_add_to_ioend(inode, bh, offset, wpc); + count++; + } + + if (!wpc->iohead) + wpc->iohead = wpc->ioend; + + } while (offset += len, ((bh = bh->b_this_page) != head)); + + if (uptodate && bh == head) + SetPageUptodate(page); + + xfs_start_page_writeback(page, 1, count); + ASSERT(wpc->iohead || !count); + return 0; + +out_error: + /* + * On error, we have to fail the iohead here because we locked buffers + * in the ioend chain. If we don't do this, we'll deadlock invalidating + * the page as that tries to lock the buffers on the page. Also, because + * we may have set pages under writeback, we have to make sure we run + * IO completion to mark the error state of the IO appropriately, so we + * can't cancel the ioend directly here. That means we have to mark this + * page as under writeback if we included any buffers from it in the + * ioend chain so that completion treats it correctly. + * + * If we didn't include the page in the ioend, then we can simply + * discard and unlock it as there are no other users of the page or it's + * buffers right now. The caller will still need to trigger submission + * of outstanding ioends on the writepage context so they are treated + * correctly on error. + */ + if (count) + xfs_start_page_writeback(page, 0, count); + else { + xfs_aops_discard_page(page); + ClearPageUptodate(page); + unlock_page(page); + } + mapping_set_error(page->mapping, error); + return error; +} + /* * Write out a dirty page. * @@ -769,13 +890,9 @@ xfs_do_writepage( { struct xfs_writepage_ctx *wpc = data; struct inode *inode = page->mapping->host; - struct buffer_head *bh, *head; loff_t offset; __uint64_t end_offset; pgoff_t end_index; - ssize_t len; - int err, uptodate = 1; - int count = 0; trace_xfs_writepage(inode, page, 0, 0); @@ -868,112 +985,7 @@ xfs_do_writepage( end_offset = offset; } - len = 1 << inode->i_blkbits; - - bh = head = page_buffers(page); - offset = page_offset(page); - - do { - if (offset >= end_offset) - break; - if (!buffer_uptodate(bh)) - uptodate = 0; - - /* - * set_page_dirty dirties all buffers in a page, independent - * of their state. The dirty state however is entirely - * meaningless for holes (!mapped && uptodate), so skip - * buffers covering holes here. - */ - if (!buffer_mapped(bh) && buffer_uptodate(bh)) { - wpc->imap_valid = false; - continue; - } - - if (buffer_unwritten(bh)) { - if (wpc->io_type != XFS_IO_UNWRITTEN) { - wpc->io_type = XFS_IO_UNWRITTEN; - wpc->imap_valid = false; - } - } else if (buffer_delay(bh)) { - if (wpc->io_type != XFS_IO_DELALLOC) { - wpc->io_type = XFS_IO_DELALLOC; - wpc->imap_valid = false; - } - } else if (buffer_uptodate(bh)) { - if (wpc->io_type != XFS_IO_OVERWRITE) { - wpc->io_type = XFS_IO_OVERWRITE; - wpc->imap_valid = false; - } - } else { - if (PageUptodate(page)) - ASSERT(buffer_mapped(bh)); - /* - * This buffer is not uptodate and will not be - * written to disk. Ensure that we will put any - * subsequent writeable buffers into a new - * ioend. - */ - wpc->imap_valid = 0; - continue; - } - - if (wpc->imap_valid) - wpc->imap_valid = xfs_imap_valid(inode, &wpc->imap, offset); - if (!wpc->imap_valid) { - err = xfs_map_blocks(inode, offset, &wpc->imap, - wpc->io_type); - if (err) - goto error; - wpc->imap_valid = xfs_imap_valid(inode, &wpc->imap, offset); - } - if (wpc->imap_valid) { - lock_buffer(bh); - if (wpc->io_type != XFS_IO_OVERWRITE) - xfs_map_at_offset(inode, bh, &wpc->imap, offset); - xfs_add_to_ioend(inode, bh, offset, wpc); - count++; - } - - if (!wpc->iohead) - wpc->iohead = wpc->ioend; - - } while (offset += len, ((bh = bh->b_this_page) != head)); - - if (uptodate && bh == head) - SetPageUptodate(page); - - xfs_start_page_writeback(page, 1, count); - - ASSERT(wpc->iohead || !count); - return 0; - -error: - /* - * On error, we have to fail the iohead here because we buffers locked - * in the ioend chain. If we don't do this, we'll deadlock invalidating - * the page as that tries to lock the buffers on the page. Also, because - * we may have set pages under writeback, we have to make sure we run - * IO completion to mark the error state of the IO appropriately, so we - * can't cancel the ioend directly here. That means we have to mark this - * page as under writeback if we included any buffers from it in the - * ioend chain so that completion treats it correctly. - * - * If we didn't include the page in the ioend, then we can simply - * discard and unlock it as there are no other users of the page or it's - * buffers right now. The caller will still need to trigger submission - * of outstanding ioends on the writepage context so they are treated - * correctly on error. - */ - if (count) - xfs_start_page_writeback(page, 0, count); - else { - xfs_aops_discard_page(page); - ClearPageUptodate(page); - unlock_page(page); - } - mapping_set_error(page->mapping, err); - return err; + return xfs_writepage_map(wpc, inode, page, offset, end_offset); redirty: redirty_page_for_writepage(wbc, page); -- 2.5.0 From dave@fromorbit.com Wed Feb 10 03:08:37 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=ham version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay3.corp.sgi.com [198.149.34.15]) by oss.sgi.com (Postfix) with ESMTP id CD2B67CA2 for ; Wed, 10 Feb 2016 03:08:37 -0600 (CST) Received: from cuda.sgi.com (cuda2.sgi.com [192.48.176.25]) by relay3.corp.sgi.com (Postfix) with ESMTP id 4ED82AC005 for ; Wed, 10 Feb 2016 01:08:34 -0800 (PST) X-ASG-Debug-ID: 1455095310-04cbb0433450ed0001-NocioJ Received: from ipmail06.adl2.internode.on.net (ipmail06.adl2.internode.on.net [150.101.137.129]) by cuda.sgi.com with ESMTP id Hp3hAOdcf0YzaFt6 for ; Wed, 10 Feb 2016 01:08:31 -0800 (PST) X-Barracuda-Envelope-From: dave@fromorbit.com X-Barracuda-Apparent-Source-IP: 150.101.137.129 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: A2AhCgA2/bpWPBATLHleKAECgw+BP4ZjgXmdWQaRL4tHTQEBAQEBAQcBAQEBQT9BEgGDbgEFJy8zCBgxOQMHFBmIGsAUhUqNawWHUAOHA4gijy2NGESFK4hQghgBC4I2KC6HAIFTAQEB Received: from ppp121-44-19-16.lns20.syd4.internode.on.net (HELO dastard) ([121.44.19.16]) by ipmail06.adl2.internode.on.net with ESMTP; 10 Feb 2016 19:38:28 +1030 Received: from disappointment.disaster.area ([192.168.1.110] helo=disappointment) by dastard with esmtp (Exim 4.80) (envelope-from ) id 1aTQQo-0005Bm-AY for xfs@oss.sgi.com; Wed, 10 Feb 2016 19:47:26 +1100 Received: from dave by disappointment with local (Exim 4.86) (envelope-from ) id 1aTQQo-0002ap-9h for xfs@oss.sgi.com; Wed, 10 Feb 2016 19:47:26 +1100 From: Dave Chinner To: xfs@oss.sgi.com Subject: [PATCH 7/8] [RFC] xfs: build bios directly in xfs_add_to_ioend Date: Wed, 10 Feb 2016 19:47:22 +1100 X-ASG-Orig-Subj: [PATCH 7/8] [RFC] xfs: build bios directly in xfs_add_to_ioend Message-Id: <1455094043-9694-8-git-send-email-david@fromorbit.com> X-Mailer: git-send-email 2.5.0 In-Reply-To: <1455094043-9694-1-git-send-email-david@fromorbit.com> References: <1455094043-9694-1-git-send-email-david@fromorbit.com> X-Barracuda-Connect: ipmail06.adl2.internode.on.net[150.101.137.129] X-Barracuda-Start-Time: 1455095310 X-Barracuda-URL: https://192.48.176.25:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-BRTS-Status: 1 X-Barracuda-Spam-Score: 0.00 X-Barracuda-Spam-Status: No, SCORE=0.00 using per-user scores of TAG_LEVEL=1000.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.7 tests= X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.3.26911 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- From: Dave Chinner Currently adding a buffer to the ioend and then building a bio from the buffer list are two separate operations. We don't build the bios and submit them until the ioend is submitted, and this places a fixed dependency on bufferhead chaining in the ioend. The first step to removing the bufferhead chaining in the ioend is on the IO submission side. We can build the bio directly as we add the buffers to the ioend chain, thereby removing the need for a latter "buffer-to-bio" submission loop. This allows us to submit bios on large ioends as soon as we cannot add more data to the bio. These bios then get captured by the active plug, and hence will be dispatched as soon as either the plug overflows or we schedule away from the writeback context. This will reduce submission latency for large IOs, but will also allow more timely request queue based writeback blocking when the device becomes congested. Signed-off-by: Dave Chinner --- fs/xfs/xfs_aops.c | 118 ++++++++++++++++++++++++++---------------------------- fs/xfs/xfs_aops.h | 1 + 2 files changed, 58 insertions(+), 61 deletions(-) diff --git a/fs/xfs/xfs_aops.c b/fs/xfs/xfs_aops.c index 210f18e..91dd65b 100644 --- a/fs/xfs/xfs_aops.c +++ b/fs/xfs/xfs_aops.c @@ -274,6 +274,7 @@ xfs_alloc_ioend( xfs_ioend_t *ioend; ioend = mempool_alloc(xfs_ioend_pool, GFP_NOFS); + memset(ioend, 0, sizeof(*ioend)); /* * Set the count to 1 initially, which will prevent an I/O @@ -281,16 +282,9 @@ xfs_alloc_ioend( * all the I/O from calling the completion routine too early. */ atomic_set(&ioend->io_remaining, 1); - ioend->io_error = 0; INIT_LIST_HEAD(&ioend->io_list); ioend->io_type = type; ioend->io_inode = inode; - ioend->io_buffer_head = NULL; - ioend->io_buffer_tail = NULL; - ioend->io_offset = 0; - ioend->io_size = 0; - ioend->io_append_trans = NULL; - INIT_WORK(&ioend->io_work, xfs_end_io); return ioend; } @@ -457,13 +451,18 @@ static inline int xfs_bio_add_buffer(struct bio *bio, struct buffer_head *bh) } /* - * Submit all of the bios for an ioend. We are only passed a single ioend at a - * time; the caller is responsible for chaining prior to submission. + * Submit the bio for an ioend. We are passed an ioend with a bio attached to + * it, and we submit that bio. The ioend may be used for multiple bio + * submissions, so we only want to allocate an append transaction for the ioend + * once. In the case of multiple bio submission, each bio will take an IO + * reference to the ioend to ensure that the ioend completion is only done once + * all bios have been submitted and the ioend is really done. * * If @fail is non-zero, it means that we have a situation where some part of * the submission process has failed after we have marked paged for writeback - * and unlocked them. In this situation, we need to fail the ioend chain rather - * than submit it to IO. This typically only happens on a filesystem shutdown. + * and unlocked them. In this situation, we need to fail the bio and ioend + * rather than submit it to IO. This typically only happens on a filesystem + * shutdown. */ STATIC int xfs_submit_ioend( @@ -471,48 +470,34 @@ xfs_submit_ioend( xfs_ioend_t *ioend, int fail) { - struct buffer_head *bh; - struct bio *bio; - sector_t lastblock = 0; + if (!ioend->io_bio || fail) + goto error_finish; /* Reserve log space if we might write beyond the on-disk inode size. */ - if (!fail && - ioend->io_type != XFS_IO_UNWRITTEN && xfs_ioend_is_append(ioend)) + if (ioend->io_type != XFS_IO_UNWRITTEN && + xfs_ioend_is_append(ioend) && !ioend->io_append_trans) { fail = xfs_setfilesize_trans_alloc(ioend); - /* - * If we are failing the IO now, just mark the ioend with an - * error and finish it. This will run IO completion immediately - * as there is only one reference to the ioend at this point in - * time. - */ - if (fail) { - ioend->io_error = fail; - xfs_finish_ioend(ioend); - return fail; + if (fail) + goto error_finish; } - bio = NULL; - for (bh = ioend->io_buffer_head; bh; bh = bh->b_private) { - - if (!bio) { -retry: - bio = xfs_alloc_ioend_bio(bh); - } else if (bh->b_blocknr != lastblock + 1) { - xfs_submit_ioend_bio(wbc, ioend, bio); - goto retry; - } - - if (xfs_bio_add_buffer(bio, bh) != bh->b_size) { - xfs_submit_ioend_bio(wbc, ioend, bio); - goto retry; - } - - lastblock = bh->b_blocknr; - } - if (bio) - xfs_submit_ioend_bio(wbc, ioend, bio); + xfs_submit_ioend_bio(wbc, ioend, ioend->io_bio); + ioend->io_bio = NULL; xfs_finish_ioend(ioend); return 0; + + /* + * If we are failing the IO now, just mark the ioend with an error and + * finish it, releasing the active bio if there is one. This will run + * IO completion immediately as there is only one reference to the ioend + * at this point in time. + */ +error_finish: + if (ioend->io_bio) + bio_put(ioend->io_bio); + ioend->io_error = fail; + xfs_finish_ioend(ioend); + return fail; } /* @@ -527,30 +512,41 @@ xfs_add_to_ioend( struct inode *inode, struct buffer_head *bh, xfs_off_t offset, - struct xfs_writepage_ctx *wpc) + struct xfs_writepage_ctx *wpc, + struct writeback_control *wbc) { struct xfs_ioend *prev = NULL; + struct xfs_ioend *ioend = wpc->ioend; - if (!wpc->ioend || wpc->io_type != wpc->ioend->io_type || + if (!ioend || wpc->io_type != ioend->io_type || bh->b_blocknr != wpc->last_block + 1) { - struct xfs_ioend *new; + prev = ioend; + ioend = xfs_alloc_ioend(inode, wpc->io_type); + ioend->io_offset = offset; + ioend->io_buffer_head = bh; + ioend->io_buffer_tail = bh; + wpc->ioend = ioend; + } else { + ioend->io_buffer_tail->b_private = bh; + ioend->io_buffer_tail = bh; + } + bh->b_private = NULL; - prev = wpc->ioend; + /* add the bh to the current bio */ +retry: + if (!ioend->io_bio) + ioend->io_bio = xfs_alloc_ioend_bio(bh); - new = xfs_alloc_ioend(inode, wpc->io_type); - new->io_offset = offset; - new->io_buffer_head = bh; - new->io_buffer_tail = bh; - wpc->ioend = new; - } else { - wpc->ioend->io_buffer_tail->b_private = bh; - wpc->ioend->io_buffer_tail = bh; + if (xfs_bio_add_buffer(ioend->io_bio, bh) != bh->b_size) { + xfs_submit_ioend_bio(wbc, ioend, ioend->io_bio); + ioend->io_bio = NULL; + goto retry; } - bh->b_private = NULL; - wpc->ioend->io_size += bh->b_size; + ioend->io_size += bh->b_size; wpc->last_block = bh->b_blocknr; xfs_start_buffer_writeback(bh); + ASSERT(wpc->ioend != prev); return prev; } @@ -810,7 +806,7 @@ xfs_writepage_map( lock_buffer(bh); if (wpc->io_type != XFS_IO_OVERWRITE) xfs_map_at_offset(inode, bh, &wpc->imap, offset); - ioend = xfs_add_to_ioend(inode, bh, offset, wpc); + ioend = xfs_add_to_ioend(inode, bh, offset, wpc, wbc); if (ioend) list_add_tail(&ioend->io_list, &submit_list); count++; diff --git a/fs/xfs/xfs_aops.h b/fs/xfs/xfs_aops.h index d76e15d..dac64c2 100644 --- a/fs/xfs/xfs_aops.h +++ b/fs/xfs/xfs_aops.h @@ -50,6 +50,7 @@ typedef struct xfs_ioend { xfs_off_t io_offset; /* offset in the file */ struct work_struct io_work; /* xfsdatad work queue */ struct xfs_trans *io_append_trans;/* xact. for size update */ + struct bio *io_bio; /* bio being built */ } xfs_ioend_t; extern const struct address_space_operations xfs_address_space_operations; -- 2.5.0 From dave@fromorbit.com Wed Feb 10 03:08:40 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=ham version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay3.corp.sgi.com [198.149.34.15]) by oss.sgi.com (Postfix) with ESMTP id 5B1557CAA for ; Wed, 10 Feb 2016 03:08:40 -0600 (CST) Received: from cuda.sgi.com (cuda1.sgi.com [192.48.157.11]) by relay3.corp.sgi.com (Postfix) with ESMTP id ED4E7AC005 for ; Wed, 10 Feb 2016 01:08:39 -0800 (PST) X-ASG-Debug-ID: 1455095309-04bdf066ea3c260002-NocioJ Received: from ipmail06.adl2.internode.on.net (ipmail06.adl2.internode.on.net [150.101.137.129]) by cuda.sgi.com with ESMTP id 76ufFEOY9kcQ8gsH for ; Wed, 10 Feb 2016 01:08:33 -0800 (PST) X-Barracuda-Envelope-From: dave@fromorbit.com X-Barracuda-Apparent-Source-IP: 150.101.137.129 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: A2AhCgA2/bpWPBATLHleKAECgw+BP4ZjgXmdWQaRL4tHTQEBAQEBAQcBAQEBQT9BEgGDbgEFJy8zCBgxOQMHFBmIGsAUhUqNawWFTYIGjyWLHIQRjRiFb4hQghgBC0EZgVwoLocAgVMBAQE Received: from ppp121-44-19-16.lns20.syd4.internode.on.net (HELO dastard) ([121.44.19.16]) by ipmail06.adl2.internode.on.net with ESMTP; 10 Feb 2016 19:38:29 +1030 Received: from disappointment.disaster.area ([192.168.1.110] helo=disappointment) by dastard with esmtp (Exim 4.80) (envelope-from ) id 1aTQQo-0005Bn-Az for xfs@oss.sgi.com; Wed, 10 Feb 2016 19:47:26 +1100 Received: from dave by disappointment with local (Exim 4.86) (envelope-from ) id 1aTQQo-0002au-AE for xfs@oss.sgi.com; Wed, 10 Feb 2016 19:47:26 +1100 From: Dave Chinner To: xfs@oss.sgi.com Subject: [PATCH 8/8] [RFC] xfs: don't release bios on completion immediately Date: Wed, 10 Feb 2016 19:47:23 +1100 X-ASG-Orig-Subj: [PATCH 8/8] [RFC] xfs: don't release bios on completion immediately Message-Id: <1455094043-9694-9-git-send-email-david@fromorbit.com> X-Mailer: git-send-email 2.5.0 In-Reply-To: <1455094043-9694-1-git-send-email-david@fromorbit.com> References: <1455094043-9694-1-git-send-email-david@fromorbit.com> X-Barracuda-Connect: ipmail06.adl2.internode.on.net[150.101.137.129] X-Barracuda-Start-Time: 1455095312 X-Barracuda-URL: https://192.48.157.11:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-BRTS-Status: 1 X-Barracuda-Spam-Score: 0.00 X-Barracuda-Spam-Status: No, SCORE=0.00 using per-user scores of TAG_LEVEL=1000.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.7 tests= X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.3.26911 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- From: Dave Chinner Completion of an ioend requires us to walk the bufferhead list to end writback on all the bufferheads. This, in turn, is needed so that we can end writeback on all the pages we just did IO on. To remove our dependency on bufferheads in writeback, we need to turn this around the other way - we need to walk the pages we've just completed IO on, and then walk the buffers attached to the pages and complete their IO. In doing this, we remove the requirement for the ioend to track bufferheads directly. To enable IO completion to walk all the pages we've submitted IO on, we need to keep the bios that we used for IO around until the ioend has been completed. We can do this simply by chaining the bios to the ioend at completion time, and then walking their pages directly just before destroying the ioend. Signed-off-by: Dave Chinner --- fs/xfs/xfs_aops.c | 88 ++++++++++++++++++++++++++++++++++++++++++------------- fs/xfs/xfs_aops.h | 5 ++-- 2 files changed, 71 insertions(+), 22 deletions(-) diff --git a/fs/xfs/xfs_aops.c b/fs/xfs/xfs_aops.c index 91dd65b..a15a032 100644 --- a/fs/xfs/xfs_aops.c +++ b/fs/xfs/xfs_aops.c @@ -84,25 +84,71 @@ xfs_find_bdev_for_inode( } /* - * We're now finished for good with this ioend structure. - * Update the page state via the associated buffer_heads, - * release holds on the inode and bio, and finally free - * up memory. Do not use the ioend after this. + * We're now finished for good with this page. Update the page state via the + * associated buffer_heads, paying attention to the start and end offsets that + * we need to process on the page. + */ +static void +xfs_finish_page_writeback( + struct page *page, + unsigned int start, + unsigned int end, + int error) +{ + struct buffer_head *head, *bh; + unsigned int off = 0; + + bh = head = page_buffers(page); + + do { + if (start > off) + goto next_bh; + if (off > end) + break; + bh->b_end_io(bh, !error); +next_bh: + off += bh->b_size; + } while ((bh = bh->b_this_page) != head); +} + +/* + * We're now finished for good with this ioend structure. Update the page + * state, release holds on bios, and finally free up memory. Do not use the + * ioend after this. */ STATIC void xfs_destroy_ioend( - xfs_ioend_t *ioend) + struct xfs_ioend *ioend) { - struct buffer_head *bh, *next; + struct bio *bio, *next; - for (bh = ioend->io_buffer_head; bh; bh = next) { - next = bh->b_private; - bh->b_end_io(bh, !ioend->io_error); + for (bio = ioend->io_bio_done; bio; bio = next) { + struct bio_vec *bvec; + int i; + + next = bio->bi_private; + bio->bi_private = NULL; + + /* walk each page on bio, ending page IO on them */ + bio_for_each_segment_all(bvec, bio, i) { + struct page *page = bvec->bv_page; + unsigned int off, end_off; + + off = bvec->bv_offset; + end_off = off + bvec->bv_len - 1; + ASSERT(off < PAGE_SIZE); + ASSERT(end_off <= PAGE_SIZE); + xfs_finish_page_writeback(page, off, end_off, + ioend->io_error); + + } + bio_put(bio); } mempool_free(ioend, xfs_ioend_pool); } + /* * Fast and loose check if this write could update the on-disk inode size. */ @@ -286,6 +332,7 @@ xfs_alloc_ioend( ioend->io_type = type; ioend->io_inode = inode; INIT_WORK(&ioend->io_work, xfs_end_io); + spin_lock_init(&ioend->io_lock); return ioend; } @@ -365,15 +412,21 @@ STATIC void xfs_end_bio( struct bio *bio) { - xfs_ioend_t *ioend = bio->bi_private; + struct xfs_ioend *ioend = bio->bi_private; + unsigned long flags; - if (!ioend->io_error) - ioend->io_error = bio->bi_error; - - /* Toss bio and pass work off to an xfsdatad thread */ bio->bi_private = NULL; bio->bi_end_io = NULL; - bio_put(bio); + + spin_lock_irqsave(&ioend->io_lock, flags); + if (!ioend->io_error) + ioend->io_error = bio->bi_error; + if (!ioend->io_bio_done) + ioend->io_bio_done = bio; + else + ioend->io_bio_done_tail->bi_private = bio; + ioend->io_bio_done_tail = bio; + spin_unlock_irqrestore(&ioend->io_lock, flags); xfs_finish_ioend(ioend); } @@ -523,12 +576,7 @@ xfs_add_to_ioend( prev = ioend; ioend = xfs_alloc_ioend(inode, wpc->io_type); ioend->io_offset = offset; - ioend->io_buffer_head = bh; - ioend->io_buffer_tail = bh; wpc->ioend = ioend; - } else { - ioend->io_buffer_tail->b_private = bh; - ioend->io_buffer_tail = bh; } bh->b_private = NULL; diff --git a/fs/xfs/xfs_aops.h b/fs/xfs/xfs_aops.h index dac64c2..aaa74cb 100644 --- a/fs/xfs/xfs_aops.h +++ b/fs/xfs/xfs_aops.h @@ -44,13 +44,14 @@ typedef struct xfs_ioend { int io_error; /* I/O error code */ atomic_t io_remaining; /* hold count */ struct inode *io_inode; /* file being written to */ - struct buffer_head *io_buffer_head;/* buffer linked list head */ - struct buffer_head *io_buffer_tail;/* buffer linked list tail */ size_t io_size; /* size of the extent */ xfs_off_t io_offset; /* offset in the file */ struct work_struct io_work; /* xfsdatad work queue */ struct xfs_trans *io_append_trans;/* xact. for size update */ struct bio *io_bio; /* bio being built */ + struct bio *io_bio_done; /* bios completed */ + struct bio *io_bio_done_tail; /* bios completed */ + spinlock_t io_lock; /* for bio completion list */ } xfs_ioend_t; extern const struct address_space_operations xfs_address_space_operations; -- 2.5.0 From dave@fromorbit.com Wed Feb 10 03:08:41 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=ham version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay1.corp.sgi.com [137.38.102.111]) by oss.sgi.com (Postfix) with ESMTP id F01857CB0 for ; Wed, 10 Feb 2016 03:08:40 -0600 (CST) Received: from cuda.sgi.com (cuda1.sgi.com [192.48.157.11]) by relay1.corp.sgi.com (Postfix) with ESMTP id A60BB8F8049 for ; Wed, 10 Feb 2016 01:08:40 -0800 (PST) X-ASG-Debug-ID: 1455095309-04bdf066ea3c260001-NocioJ Received: from ipmail06.adl2.internode.on.net (ipmail06.adl2.internode.on.net [150.101.137.129]) by cuda.sgi.com with ESMTP id 0zOhbAMz44DDB34N for ; Wed, 10 Feb 2016 01:08:30 -0800 (PST) X-Barracuda-Envelope-From: dave@fromorbit.com X-Barracuda-Apparent-Source-IP: 150.101.137.129 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: A2AhCgA2/bpWPBATLHlWCCgBAoMPgT+GY4F5nV+RL4oUgTNNAQEBAQEBBwEBAQFBP0ESAYNuAQUnLzMIGDE5AwcUGYgawBSFSoY1AYJXSoQUBYdQA4cDiCKcRY4/ghgBCwFADQyBXCguhwCBUwEBAQ Received: from ppp121-44-19-16.lns20.syd4.internode.on.net (HELO dastard) ([121.44.19.16]) by ipmail06.adl2.internode.on.net with ESMTP; 10 Feb 2016 19:38:28 +1030 Received: from disappointment.disaster.area ([192.168.1.110] helo=disappointment) by dastard with esmtp (Exim 4.80) (envelope-from ) id 1aTQQo-0005Bl-A7 for xfs@oss.sgi.com; Wed, 10 Feb 2016 19:47:26 +1100 Received: from dave by disappointment with local (Exim 4.86) (envelope-from ) id 1aTQQo-0002ak-9G for xfs@oss.sgi.com; Wed, 10 Feb 2016 19:47:26 +1100 From: Dave Chinner To: xfs@oss.sgi.com Subject: [PATCH 6/8] xfs: don't chain ioends during writepage submission Date: Wed, 10 Feb 2016 19:47:21 +1100 X-ASG-Orig-Subj: [PATCH 6/8] xfs: don't chain ioends during writepage submission Message-Id: <1455094043-9694-7-git-send-email-david@fromorbit.com> X-Mailer: git-send-email 2.5.0 In-Reply-To: <1455094043-9694-1-git-send-email-david@fromorbit.com> References: <1455094043-9694-1-git-send-email-david@fromorbit.com> X-Barracuda-Connect: ipmail06.adl2.internode.on.net[150.101.137.129] X-Barracuda-Start-Time: 1455095309 X-Barracuda-URL: https://192.48.157.11:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-BRTS-Status: 1 X-Barracuda-Spam-Score: 0.00 X-Barracuda-Spam-Status: No, SCORE=0.00 using per-user scores of TAG_LEVEL=1000.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.7 tests= X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.3.26911 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- From: Dave Chinner Currently we can build a long ioend chain during ->writepages that gets attached to the writepage context. IO submission only then occurs when we finish all the writepage processing. This means we can have many ioends allocated and pending, and this violates the mempool guarantees that we need to give about forwards progress. i.e. we really should only have one ioend being built at a time, otherwise we may drain the mempool trying to allocate a new ioend and that blocks submission, completion and freeing of ioends that are already in progress. To prevent this situation from happening, we need to submit ioends for IO as soon as they are ready for dispatch rather than queuing them for later submission. This means the ioends have bios built immediately and they get queued on any plug that is current active. Hence if we schedule away from writeback, the ioends that have been built will make forwards progress due to the plug flushing on context switch. This will also prevent context switches from creating unnecessary IO submission latency. We can't completely avoid having nested IO allocation - when we have a block size smaller than a page size, we still need to hold the ioend submission until after we have marked the current page dirty. Hence we may need multiple ioends to be held while the current page is completely mapped and made ready for IO dispatch. We cannot avoid this problem - the current code already has this ioend chaining within a page so we can mostly ignore that it occurs. Signed-off-by: Dave Chinner --- fs/xfs/xfs_aops.c | 233 ++++++++++++++++++++++++++++-------------------------- fs/xfs/xfs_aops.h | 2 +- 2 files changed, 120 insertions(+), 115 deletions(-) diff --git a/fs/xfs/xfs_aops.c b/fs/xfs/xfs_aops.c index 95cfb27..210f18e 100644 --- a/fs/xfs/xfs_aops.c +++ b/fs/xfs/xfs_aops.c @@ -47,7 +47,6 @@ struct xfs_writepage_ctx { struct xfs_bmbt_irec imap; bool imap_valid; unsigned int io_type; - struct xfs_ioend *iohead; struct xfs_ioend *ioend; sector_t last_block; }; @@ -283,7 +282,7 @@ xfs_alloc_ioend( */ atomic_set(&ioend->io_remaining, 1); ioend->io_error = 0; - ioend->io_list = NULL; + INIT_LIST_HEAD(&ioend->io_list); ioend->io_type = type; ioend->io_inode = inode; ioend->io_buffer_head = NULL; @@ -458,110 +457,90 @@ static inline int xfs_bio_add_buffer(struct bio *bio, struct buffer_head *bh) } /* - * Submit all of the bios for all of the ioends we have saved up, covering the - * initial writepage page and also any probed pages. - * - * Because we may have multiple ioends spanning a page, we need to start - * writeback on all the buffers before we submit them for I/O. If we mark the - * buffers as we got, then we can end up with a page that only has buffers - * marked async write and I/O complete on can occur before we mark the other - * buffers async write. - * - * The end result of this is that we trip a bug in end_page_writeback() because - * we call it twice for the one page as the code in end_buffer_async_write() - * assumes that all buffers on the page are started at the same time. - * - * The fix is two passes across the ioend list - one to start writeback on the - * buffer_heads, and then submit them for I/O on the second pass. + * Submit all of the bios for an ioend. We are only passed a single ioend at a + * time; the caller is responsible for chaining prior to submission. * * If @fail is non-zero, it means that we have a situation where some part of * the submission process has failed after we have marked paged for writeback * and unlocked them. In this situation, we need to fail the ioend chain rather * than submit it to IO. This typically only happens on a filesystem shutdown. */ -STATIC void +STATIC int xfs_submit_ioend( struct writeback_control *wbc, xfs_ioend_t *ioend, int fail) { - xfs_ioend_t *head = ioend; - xfs_ioend_t *next; struct buffer_head *bh; struct bio *bio; sector_t lastblock = 0; - /* Pass 1 - start writeback */ - do { - next = ioend->io_list; - for (bh = ioend->io_buffer_head; bh; bh = bh->b_private) - xfs_start_buffer_writeback(bh); - } while ((ioend = next) != NULL); + /* Reserve log space if we might write beyond the on-disk inode size. */ + if (!fail && + ioend->io_type != XFS_IO_UNWRITTEN && xfs_ioend_is_append(ioend)) + fail = xfs_setfilesize_trans_alloc(ioend); + /* + * If we are failing the IO now, just mark the ioend with an + * error and finish it. This will run IO completion immediately + * as there is only one reference to the ioend at this point in + * time. + */ + if (fail) { + ioend->io_error = fail; + xfs_finish_ioend(ioend); + return fail; + } - /* Pass 2 - submit I/O */ - ioend = head; - do { - next = ioend->io_list; - bio = NULL; + bio = NULL; + for (bh = ioend->io_buffer_head; bh; bh = bh->b_private) { - /* - * If we are failing the IO now, just mark the ioend with an - * error and finish it. This will run IO completion immediately - * as there is only one reference to the ioend at this point in - * time. - */ - if (fail) { - ioend->io_error = fail; - xfs_finish_ioend(ioend); - continue; + if (!bio) { +retry: + bio = xfs_alloc_ioend_bio(bh); + } else if (bh->b_blocknr != lastblock + 1) { + xfs_submit_ioend_bio(wbc, ioend, bio); + goto retry; } - for (bh = ioend->io_buffer_head; bh; bh = bh->b_private) { - - if (!bio) { - retry: - bio = xfs_alloc_ioend_bio(bh); - } else if (bh->b_blocknr != lastblock + 1) { - xfs_submit_ioend_bio(wbc, ioend, bio); - goto retry; - } - - if (xfs_bio_add_buffer(bio, bh) != bh->b_size) { - xfs_submit_ioend_bio(wbc, ioend, bio); - goto retry; - } - - lastblock = bh->b_blocknr; - } - if (bio) + if (xfs_bio_add_buffer(bio, bh) != bh->b_size) { xfs_submit_ioend_bio(wbc, ioend, bio); - xfs_finish_ioend(ioend); - } while ((ioend = next) != NULL); + goto retry; + } + + lastblock = bh->b_blocknr; + } + if (bio) + xfs_submit_ioend_bio(wbc, ioend, bio); + xfs_finish_ioend(ioend); + return 0; } /* * Test to see if we've been building up a completion structure for * earlier buffers -- if so, we try to append to this ioend if we * can, otherwise we finish off any current ioend and start another. - * Return true if we've finished the given ioend. + * Return the ioend we finished off so that the caller can submit it + * once it has finished processing the dirty page. */ -STATIC void +STATIC struct xfs_ioend * xfs_add_to_ioend( struct inode *inode, struct buffer_head *bh, xfs_off_t offset, struct xfs_writepage_ctx *wpc) { + struct xfs_ioend *prev = NULL; + if (!wpc->ioend || wpc->io_type != wpc->ioend->io_type || bh->b_blocknr != wpc->last_block + 1) { struct xfs_ioend *new; + prev = wpc->ioend; + new = xfs_alloc_ioend(inode, wpc->io_type); new->io_offset = offset; new->io_buffer_head = bh; new->io_buffer_tail = bh; - if (wpc->ioend) - wpc->ioend->io_list = new; wpc->ioend = new; } else { wpc->ioend->io_buffer_tail->b_private = bh; @@ -571,6 +550,8 @@ xfs_add_to_ioend( bh->b_private = NULL; wpc->ioend->io_size += bh->b_size; wpc->last_block = bh->b_blocknr; + xfs_start_buffer_writeback(bh); + return prev; } STATIC void @@ -732,41 +713,40 @@ out_invalidate: return; } -static int -xfs_writepage_submit( - struct xfs_writepage_ctx *wpc, - struct writeback_control *wbc, - int status) -{ - struct blk_plug plug; - - /* Reserve log space if we might write beyond the on-disk inode size. */ - if (!status && wpc->ioend && wpc->ioend->io_type != XFS_IO_UNWRITTEN && - xfs_ioend_is_append(wpc->ioend)) - status = xfs_setfilesize_trans_alloc(wpc->ioend); - - if (wpc->iohead) { - blk_start_plug(&plug); - xfs_submit_ioend(wbc, wpc->iohead, status); - blk_finish_plug(&plug); - } - return status; -} - +/* + * We implement an immediate ioend submission policy here to avoid needing to + * chain multiple ioends and hence nest mempool allocations which can violate + * forward progress guarantees we need to provide. The current ioend we are + * adding buffers to is cached on the writepage context, and if the new buffer + * does not append to the cached ioend it will create a new ioend and cache that + * instead. + * + * If a new ioend is created and cached, the old ioend is returned and queued + * locally for submission once the entire page is processed or an error has been + * detected. While ioends are submitted immediately after they are completed, + * batching optimisations are provided by higher level block plugging. + * + * At the end of a writeback pass, there will be a cached ioend remaining on the + * writepage context that the caller will need to submit. + */ static int xfs_writepage_map( struct xfs_writepage_ctx *wpc, + struct writeback_control *wbc, struct inode *inode, struct page *page, loff_t offset, __uint64_t end_offset) { + LIST_HEAD(submit_list); + struct xfs_ioend *ioend, *next; struct buffer_head *bh, *head; ssize_t len = 1 << inode->i_blkbits; int error = 0; int uptodate = 1; int count = 0; + bh = head = page_buffers(page); offset = page_offset(page); @@ -830,46 +810,67 @@ xfs_writepage_map( lock_buffer(bh); if (wpc->io_type != XFS_IO_OVERWRITE) xfs_map_at_offset(inode, bh, &wpc->imap, offset); - xfs_add_to_ioend(inode, bh, offset, wpc); + ioend = xfs_add_to_ioend(inode, bh, offset, wpc); + if (ioend) + list_add_tail(&ioend->io_list, &submit_list); count++; } - if (!wpc->iohead) - wpc->iohead = wpc->ioend; - } while (offset += len, ((bh = bh->b_this_page) != head)); if (uptodate && bh == head) SetPageUptodate(page); - xfs_start_page_writeback(page, 1, count); - ASSERT(wpc->iohead || !count); - return 0; + ASSERT(wpc->ioend || !count); out_error: /* - * On error, we have to fail the iohead here because we locked buffers - * in the ioend chain. If we don't do this, we'll deadlock invalidating - * the page as that tries to lock the buffers on the page. Also, because - * we may have set pages under writeback, we have to make sure we run - * IO completion to mark the error state of the IO appropriately, so we - * can't cancel the ioend directly here. That means we have to mark this - * page as under writeback if we included any buffers from it in the - * ioend chain so that completion treats it correctly. + * On error, we have to fail the ioend here because we have locked + * buffers in the ioend. If we don't do this, we'll deadlock + * invalidating the page as that tries to lock the buffers on the page. + * Also, because we may have set pages under writeback, we have to make + * sure we run IO completion to mark the error state of the IO + * appropriately, so we can't cancel the ioend directly here. That means + * we have to mark this page as under writeback if we included any + * buffers from it in the ioend chain so that completion treats it + * correctly. * - * If we didn't include the page in the ioend, then we can simply - * discard and unlock it as there are no other users of the page or it's - * buffers right now. The caller will still need to trigger submission - * of outstanding ioends on the writepage context so they are treated - * correctly on error. + * If we didn't include the page in the ioend, the on error we can + * simply discard and unlock it as there are no other users of the page + * or it's buffers right now. The caller will still need to trigger + * submission of outstanding ioends on the writepage context so they are + * treated correctly on error. */ - if (count) - xfs_start_page_writeback(page, 0, count); - else { - xfs_aops_discard_page(page); - ClearPageUptodate(page); + if (count) { + xfs_start_page_writeback(page, !error, count); + + /* + * Preserve the original error if there was one, otherwise catch + * submission errors here and propagate into subsequent ioend + * submissions. + */ + list_for_each_entry_safe(ioend, next, &submit_list, io_list) { + int error2; + + list_del_init(&ioend->io_list); + error2 = xfs_submit_ioend(wbc, ioend, error); + if (error2 && !error) + error = error2; + } + } else { + /* + * We can end up here with no error and nothing to write if we + * race with a partial page truncate on a sub-page block sized + * filesystem + */ + ASSERT(list_empty(&submit_list)); + if (error) { + xfs_aops_discard_page(page); + ClearPageUptodate(page); + } unlock_page(page); } + mapping_set_error(page->mapping, error); return error; } @@ -985,7 +986,7 @@ xfs_do_writepage( end_offset = offset; } - return xfs_writepage_map(wpc, inode, page, offset, end_offset); + return xfs_writepage_map(wpc, wbc, inode, page, offset, end_offset); redirty: redirty_page_for_writepage(wbc, page); @@ -1004,7 +1005,9 @@ xfs_vm_writepage( int ret; ret = xfs_do_writepage(page, wbc, &wpc); - return xfs_writepage_submit(&wpc, wbc, ret); + if (wpc.ioend) + xfs_submit_ioend(wbc, wpc.ioend, ret); + return ret; } STATIC int @@ -1019,7 +1022,9 @@ xfs_vm_writepages( xfs_iflags_clear(XFS_I(mapping->host), XFS_ITRUNCATED); ret = write_cache_pages(mapping, wbc, xfs_do_writepage, &wpc); - return xfs_writepage_submit(&wpc, wbc, ret); + if (wpc.ioend) + xfs_submit_ioend(wbc, wpc.ioend, ret); + return ret; } /* diff --git a/fs/xfs/xfs_aops.h b/fs/xfs/xfs_aops.h index f6ffc9a..d76e15d 100644 --- a/fs/xfs/xfs_aops.h +++ b/fs/xfs/xfs_aops.h @@ -39,7 +39,7 @@ enum { * It can manage several multi-page bio's at once. */ typedef struct xfs_ioend { - struct xfs_ioend *io_list; /* next ioend in chain */ + struct list_head io_list; /* next ioend in chain */ unsigned int io_type; /* delalloc / unwritten */ int io_error; /* I/O error code */ atomic_t io_remaining; /* hold count */ -- 2.5.0 From BATV+379ae17216066e1ae70b+4553+infradead.org+hch@bombadil.srs.infradead.org Wed Feb 10 03:30:18 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=ham version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay1.corp.sgi.com [137.38.102.111]) by oss.sgi.com (Postfix) with ESMTP id 3775B7CA2 for ; Wed, 10 Feb 2016 03:30:18 -0600 (CST) Received: from cuda.sgi.com (cuda1.sgi.com [192.48.157.11]) by relay1.corp.sgi.com (Postfix) with ESMTP id 08A638F8049 for ; Wed, 10 Feb 2016 01:30:17 -0800 (PST) X-ASG-Debug-ID: 1455096615-04bdf066ea3cb00001-NocioJ Received: from bombadil.infradead.org ([198.137.202.9]) by cuda.sgi.com with ESMTP id 8YHTD4jbcdzqI3yA (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128 verify=NO) for ; Wed, 10 Feb 2016 01:30:15 -0800 (PST) X-Barracuda-Envelope-From: BATV+379ae17216066e1ae70b+4553+infradead.org+hch@bombadil.srs.infradead.org X-Barracuda-Apparent-Source-IP: 198.137.202.9 Received: from hch by bombadil.infradead.org with local (Exim 4.80.1 #2 (Red Hat Linux)) id 1aTR6B-0006E1-IK; Wed, 10 Feb 2016 09:30:11 +0000 Date: Wed, 10 Feb 2016 01:30:11 -0800 From: Christoph Hellwig To: "Darrick J. Wong" , Dave Chinner Cc: xfs@oss.sgi.com Subject: block allocations for the refcount btree Message-ID: <20160210093011.GA19147@infradead.org> X-ASG-Orig-Subj: block allocations for the refcount btree MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.5.24 (2015-08-30) X-SRS-Rewrite: SMTP reverse-path rewritten from by bombadil.infradead.org See http://www.infradead.org/rpr.html X-Barracuda-Connect: UNKNOWN[198.137.202.9] X-Barracuda-Start-Time: 1455096615 X-Barracuda-Encrypted: ECDHE-RSA-AES128-GCM-SHA256 X-Barracuda-URL: https://192.48.157.11:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-BRTS-Status: 1 X-Barracuda-Spam-Score: 0.10 X-Barracuda-Spam-Status: No, SCORE=0.10 using per-user scores of TAG_LEVEL=1000.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.7 tests=BSF_SC0_MISMATCH_TO, RDNS_NONE X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.3.26912 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 0.00 BSF_SC0_MISMATCH_TO Envelope rcpt doesn't match header 0.10 RDNS_NONE Delivered to trusted network by a host with no rDNS I've been chasing asserts about reserved blocks when testing the reflink feature over NFS. I was right with my suspicion that the full allocator recursion from xfs_refcountbt_alloc_block was the culprit, but I should have read the assert before jumping to conclusions: we're running out of space reservations, not log reservations. The problem is that we need reserve the space for these normal allocator block pools used by the refcount btree, which we may use up for allocations and frees given that we use the normal space allocator for it. This means we need a reservation for each transaction that truncates extents, including those allocated in xfs_trans_roll. The patch below demonstrates a local hack that makes things work for me so far, but I don't think it's a viable solution. Darrick, Dave - can you explain the design decisions behind the refcount btree block allocations to me? This whole area still seems to be in constant flux, so it seems there are lots of tradeoffs to make. diff --git a/fs/xfs/xfs_bmap_util.c b/fs/xfs/xfs_bmap_util.c index 338c457..3b8a25e 100644 --- a/fs/xfs/xfs_bmap_util.c +++ b/fs/xfs/xfs_bmap_util.c @@ -967,7 +967,7 @@ xfs_free_eofblocks( } } - error = xfs_trans_reserve(tp, &M_RES(mp)->tr_itruncate, 0, 0); + error = xfs_trans_reserve(tp, &M_RES(mp)->tr_itruncate, 2, 0); if (error) { ASSERT(XFS_FORCED_SHUTDOWN(mp)); xfs_trans_cancel(tp); diff --git a/fs/xfs/xfs_inode.c b/fs/xfs/xfs_inode.c index d1311ef..ec530d7 100644 --- a/fs/xfs/xfs_inode.c +++ b/fs/xfs/xfs_inode.c @@ -1783,7 +1783,7 @@ xfs_inactive_truncate( int error; tp = xfs_trans_alloc(mp, XFS_TRANS_INACTIVE); - error = xfs_trans_reserve(tp, &M_RES(mp)->tr_itruncate, 0, 0); + error = xfs_trans_reserve(tp, &M_RES(mp)->tr_itruncate, 2, 0); if (error) { ASSERT(XFS_FORCED_SHUTDOWN(mp)); xfs_trans_cancel(tp); diff --git a/fs/xfs/xfs_iops.c b/fs/xfs/xfs_iops.c index ab3619c..a8c55bd 100644 --- a/fs/xfs/xfs_iops.c +++ b/fs/xfs/xfs_iops.c @@ -871,7 +871,7 @@ xfs_setattr_size( truncate_setsize(inode, newsize); tp = xfs_trans_alloc(mp, XFS_TRANS_SETATTR_SIZE); - error = xfs_trans_reserve(tp, &M_RES(mp)->tr_itruncate, 0, 0); + error = xfs_trans_reserve(tp, &M_RES(mp)->tr_itruncate, 2, 0); if (error) goto out_trans_cancel; diff --git a/fs/xfs/xfs_log_recover.c b/fs/xfs/xfs_log_recover.c index 4d63836..a661430 100644 --- a/fs/xfs/xfs_log_recover.c +++ b/fs/xfs/xfs_log_recover.c @@ -4144,7 +4144,7 @@ xlog_recover_process_efi( } tp = xfs_trans_alloc(mp, 0); - error = xfs_trans_reserve(tp, &M_RES(mp)->tr_itruncate, 0, 0); + error = xfs_trans_reserve(tp, &M_RES(mp)->tr_itruncate, 2, 0); if (error) goto abort_error; efdp = xfs_trans_get_efd(tp, efip, efip->efi_format.efi_nextents); diff --git a/fs/xfs/xfs_qm_syscalls.c b/fs/xfs/xfs_qm_syscalls.c index 3640c6e..33ff98f 100644 --- a/fs/xfs/xfs_qm_syscalls.c +++ b/fs/xfs/xfs_qm_syscalls.c @@ -237,7 +237,7 @@ xfs_qm_scall_trunc_qfile( xfs_ilock(ip, XFS_IOLOCK_EXCL); tp = xfs_trans_alloc(mp, XFS_TRANS_TRUNCATE_FILE); - error = xfs_trans_reserve(tp, &M_RES(mp)->tr_itruncate, 0, 0); + error = xfs_trans_reserve(tp, &M_RES(mp)->tr_itruncate, 2, 0); if (error) { xfs_trans_cancel(tp); xfs_iunlock(ip, XFS_IOLOCK_EXCL); diff --git a/fs/xfs/xfs_reflink.c b/fs/xfs/xfs_reflink.c index 9503ccc..585a94a 100644 --- a/fs/xfs/xfs_reflink.c +++ b/fs/xfs/xfs_reflink.c @@ -1026,7 +1026,7 @@ xfs_reflink_update_dest( return 0; tp = xfs_trans_alloc(mp, XFS_TRANS_SETATTR_SIZE); - error = xfs_trans_reserve(tp, &M_RES(mp)->tr_itruncate, 0, 0); + error = xfs_trans_reserve(tp, &M_RES(mp)->tr_itruncate, 2, 0); /* * check for running out of space diff --git a/fs/xfs/xfs_symlink.c b/fs/xfs/xfs_symlink.c index b44284c..7538f39 100644 --- a/fs/xfs/xfs_symlink.c +++ b/fs/xfs/xfs_symlink.c @@ -456,7 +456,7 @@ xfs_inactive_symlink_rmt( ASSERT(ip->i_d.di_nextents > 0 && ip->i_d.di_nextents <= 2); tp = xfs_trans_alloc(mp, XFS_TRANS_INACTIVE); - error = xfs_trans_reserve(tp, &M_RES(mp)->tr_itruncate, 0, 0); + error = xfs_trans_reserve(tp, &M_RES(mp)->tr_itruncate, 2, 0); if (error) { xfs_trans_cancel(tp); return error; diff --git a/fs/xfs/xfs_trans.c b/fs/xfs/xfs_trans.c index 748b16a..2ef46de 100644 --- a/fs/xfs/xfs_trans.c +++ b/fs/xfs/xfs_trans.c @@ -1065,7 +1065,7 @@ __xfs_trans_roll( * the prior and the next transactions. */ tres.tr_logflags = XFS_TRANS_PERM_LOG_RES; - error = xfs_trans_reserve(trans, &tres, 0, 0); + error = xfs_trans_reserve(trans, &tres, 2, 0); /* * Ensure that the inode is in the new transaction and locked. */ From darrick.wong@oracle.com Wed Feb 10 03:50:50 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay2.corp.sgi.com [137.38.102.29]) by oss.sgi.com (Postfix) with ESMTP id 2BEA47CA2 for ; Wed, 10 Feb 2016 03:50:50 -0600 (CST) Received: from cuda.sgi.com (cuda2.sgi.com [192.48.176.25]) by relay2.corp.sgi.com (Postfix) with ESMTP id 1C819304053 for ; Wed, 10 Feb 2016 01:50:46 -0800 (PST) X-ASG-Debug-ID: 1455097844-04cbb0433251f60001-NocioJ Received: from aserp1040.oracle.com (aserp1040.oracle.com [141.146.126.69]) by cuda.sgi.com with ESMTP id WLIwKnGKDAryOyZA (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO) for ; Wed, 10 Feb 2016 01:50:45 -0800 (PST) X-Barracuda-Envelope-From: darrick.wong@oracle.com X-Barracuda-Apparent-Source-IP: 141.146.126.69 Received: from aserv0022.oracle.com (aserv0022.oracle.com [141.146.126.234]) by aserp1040.oracle.com (Sentrion-MTA-4.3.2/Sentrion-MTA-4.3.2) with ESMTP id u1A9oEH0006212 (version=TLSv1 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Wed, 10 Feb 2016 09:50:15 GMT Received: from userv0122.oracle.com (userv0122.oracle.com [156.151.31.75]) by aserv0022.oracle.com (8.13.8/8.13.8) with ESMTP id u1A9oDYr014954 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=FAIL); Wed, 10 Feb 2016 09:50:14 GMT Received: from abhmp0014.oracle.com (abhmp0014.oracle.com [141.146.116.20]) by userv0122.oracle.com (8.14.4/8.14.4) with ESMTP id u1A9oB81031750; Wed, 10 Feb 2016 09:50:12 GMT Received: from localhost (/24.21.154.84) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Wed, 10 Feb 2016 01:50:11 -0800 Date: Wed, 10 Feb 2016 01:50:10 -0800 From: "Darrick J. Wong" To: Christoph Hellwig Cc: Dave Chinner , xfs@oss.sgi.com Subject: Re: block allocations for the refcount btree Message-ID: <20160210095010.GC23904@birch.djwong.org> X-ASG-Orig-Subj: Re: block allocations for the refcount btree References: <20160210093011.GA19147@infradead.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20160210093011.GA19147@infradead.org> User-Agent: Mutt/1.5.21 (2010-09-15) X-Source-IP: aserv0022.oracle.com [141.146.126.234] X-Barracuda-Connect: aserp1040.oracle.com[141.146.126.69] X-Barracuda-Start-Time: 1455097844 X-Barracuda-Encrypted: ECDHE-RSA-AES256-GCM-SHA384 X-Barracuda-URL: https://192.48.176.25:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-BRTS-Status: 1 X-Barracuda-Spam-Score: 0.00 X-Barracuda-Spam-Status: No, SCORE=0.00 using per-user scores of TAG_LEVEL=1000.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.7 tests=BSF_SC0_MISMATCH_TO, UNPARSEABLE_RELAY X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.3.26912 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 0.00 BSF_SC0_MISMATCH_TO Envelope rcpt doesn't match header 0.00 UNPARSEABLE_RELAY Informational: message has unparseable relay lines [past-1am posting, reader beware...] On Wed, Feb 10, 2016 at 01:30:11AM -0800, Christoph Hellwig wrote: > I've been chasing asserts about reserved blocks when testing the reflink > feature over NFS. I was right with my suspicion that the full allocator > recursion from xfs_refcountbt_alloc_block was the culprit, but I should > have read the assert before jumping to conclusions: we're running out > of space reservations, not log reservations. Oh, there are ways to run out of log reservation too, and fixing that is also on my todo lits. > The problem is that we need reserve the space for these normal allocator > block pools used by the refcount btree, which we may use up for allocations > and frees given that we use the normal space allocator for it. > > This means we need a reservation for each transaction that truncates > extents, including those allocated in xfs_trans_roll. The patch below > demonstrates a local hack that makes things work for me so far, but > I don't think it's a viable solution. That's odd... I'd have thought that the AG reservation would always be able to handle a refcount btree expansion, since it calculates how many blocks are needed to handle the worst case of 1 record per extent. There's also a bug where we undercount the number of blocks already used, so it should have an extra big reservation. OTOH I've seen occasional ENOSPCs in generic/186 and generic/168 too, so I guess something's going wrong. Maybe the xfs_ag_resv* tracepoints can help? > Darrick, Dave - can you explain the design decisions behind the > refcount btree block allocations to me? This whole area still seems > to be in constant flux, so it seems there are lots of tradeoffs to make. ISTR Dave told me to use the regular allocator (instead of the AGFL) for the refcount btree because it's not a free space btree and exists at a higher level than, say, the rmap btree. The per-AG reservation code selectively hides part of an AG's free space from the regular allocator so that regular file requests can't eat up so much space in the AG that future cow/reflink/whatever operations encounter ENOSPC during a btree split and take the FS offline. ------ WRT xfstests, I think I fixed all the things Dave was complaining about. Running tests overnight to make sure I didn't break anything, and I'll be ready to send another pull req (I can patchbomb too, but know that there are even more tests now that I cleaned up the style problems) tomorrow morning if nothing breaks. --D > > diff --git a/fs/xfs/xfs_bmap_util.c b/fs/xfs/xfs_bmap_util.c > index 338c457..3b8a25e 100644 > --- a/fs/xfs/xfs_bmap_util.c > +++ b/fs/xfs/xfs_bmap_util.c > @@ -967,7 +967,7 @@ xfs_free_eofblocks( > } > } > > - error = xfs_trans_reserve(tp, &M_RES(mp)->tr_itruncate, 0, 0); > + error = xfs_trans_reserve(tp, &M_RES(mp)->tr_itruncate, 2, 0); > if (error) { > ASSERT(XFS_FORCED_SHUTDOWN(mp)); > xfs_trans_cancel(tp); > diff --git a/fs/xfs/xfs_inode.c b/fs/xfs/xfs_inode.c > index d1311ef..ec530d7 100644 > --- a/fs/xfs/xfs_inode.c > +++ b/fs/xfs/xfs_inode.c > @@ -1783,7 +1783,7 @@ xfs_inactive_truncate( > int error; > > tp = xfs_trans_alloc(mp, XFS_TRANS_INACTIVE); > - error = xfs_trans_reserve(tp, &M_RES(mp)->tr_itruncate, 0, 0); > + error = xfs_trans_reserve(tp, &M_RES(mp)->tr_itruncate, 2, 0); > if (error) { > ASSERT(XFS_FORCED_SHUTDOWN(mp)); > xfs_trans_cancel(tp); > diff --git a/fs/xfs/xfs_iops.c b/fs/xfs/xfs_iops.c > index ab3619c..a8c55bd 100644 > --- a/fs/xfs/xfs_iops.c > +++ b/fs/xfs/xfs_iops.c > @@ -871,7 +871,7 @@ xfs_setattr_size( > truncate_setsize(inode, newsize); > > tp = xfs_trans_alloc(mp, XFS_TRANS_SETATTR_SIZE); > - error = xfs_trans_reserve(tp, &M_RES(mp)->tr_itruncate, 0, 0); > + error = xfs_trans_reserve(tp, &M_RES(mp)->tr_itruncate, 2, 0); > if (error) > goto out_trans_cancel; > > diff --git a/fs/xfs/xfs_log_recover.c b/fs/xfs/xfs_log_recover.c > index 4d63836..a661430 100644 > --- a/fs/xfs/xfs_log_recover.c > +++ b/fs/xfs/xfs_log_recover.c > @@ -4144,7 +4144,7 @@ xlog_recover_process_efi( > } > > tp = xfs_trans_alloc(mp, 0); > - error = xfs_trans_reserve(tp, &M_RES(mp)->tr_itruncate, 0, 0); > + error = xfs_trans_reserve(tp, &M_RES(mp)->tr_itruncate, 2, 0); > if (error) > goto abort_error; > efdp = xfs_trans_get_efd(tp, efip, efip->efi_format.efi_nextents); > diff --git a/fs/xfs/xfs_qm_syscalls.c b/fs/xfs/xfs_qm_syscalls.c > index 3640c6e..33ff98f 100644 > --- a/fs/xfs/xfs_qm_syscalls.c > +++ b/fs/xfs/xfs_qm_syscalls.c > @@ -237,7 +237,7 @@ xfs_qm_scall_trunc_qfile( > xfs_ilock(ip, XFS_IOLOCK_EXCL); > > tp = xfs_trans_alloc(mp, XFS_TRANS_TRUNCATE_FILE); > - error = xfs_trans_reserve(tp, &M_RES(mp)->tr_itruncate, 0, 0); > + error = xfs_trans_reserve(tp, &M_RES(mp)->tr_itruncate, 2, 0); > if (error) { > xfs_trans_cancel(tp); > xfs_iunlock(ip, XFS_IOLOCK_EXCL); > diff --git a/fs/xfs/xfs_reflink.c b/fs/xfs/xfs_reflink.c > index 9503ccc..585a94a 100644 > --- a/fs/xfs/xfs_reflink.c > +++ b/fs/xfs/xfs_reflink.c > @@ -1026,7 +1026,7 @@ xfs_reflink_update_dest( > return 0; > > tp = xfs_trans_alloc(mp, XFS_TRANS_SETATTR_SIZE); > - error = xfs_trans_reserve(tp, &M_RES(mp)->tr_itruncate, 0, 0); > + error = xfs_trans_reserve(tp, &M_RES(mp)->tr_itruncate, 2, 0); > > /* > * check for running out of space > diff --git a/fs/xfs/xfs_symlink.c b/fs/xfs/xfs_symlink.c > index b44284c..7538f39 100644 > --- a/fs/xfs/xfs_symlink.c > +++ b/fs/xfs/xfs_symlink.c > @@ -456,7 +456,7 @@ xfs_inactive_symlink_rmt( > ASSERT(ip->i_d.di_nextents > 0 && ip->i_d.di_nextents <= 2); > > tp = xfs_trans_alloc(mp, XFS_TRANS_INACTIVE); > - error = xfs_trans_reserve(tp, &M_RES(mp)->tr_itruncate, 0, 0); > + error = xfs_trans_reserve(tp, &M_RES(mp)->tr_itruncate, 2, 0); > if (error) { > xfs_trans_cancel(tp); > return error; > diff --git a/fs/xfs/xfs_trans.c b/fs/xfs/xfs_trans.c > index 748b16a..2ef46de 100644 > --- a/fs/xfs/xfs_trans.c > +++ b/fs/xfs/xfs_trans.c > @@ -1065,7 +1065,7 @@ __xfs_trans_roll( > * the prior and the next transactions. > */ > tres.tr_logflags = XFS_TRANS_PERM_LOG_RES; > - error = xfs_trans_reserve(trans, &tres, 0, 0); > + error = xfs_trans_reserve(trans, &tres, 2, 0); > /* > * Ensure that the inode is in the new transaction and locked. > */ From penguin-kernel@I-love.SAKURA.ne.jp Wed Feb 10 04:53:28 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=ham version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay2.corp.sgi.com [137.38.102.29]) by oss.sgi.com (Postfix) with ESMTP id C31CF7CA2 for ; Wed, 10 Feb 2016 04:53:28 -0600 (CST) Received: from cuda.sgi.com (cuda3.sgi.com [192.48.176.15]) by relay2.corp.sgi.com (Postfix) with ESMTP id A4276304051 for ; Wed, 10 Feb 2016 02:53:25 -0800 (PST) X-ASG-Debug-ID: 1455101600-04cb6c1e593b8e0001-NocioJ Received: from www262.sakura.ne.jp (www262.sakura.ne.jp [202.181.97.72]) by cuda.sgi.com with ESMTP id on4HP2nBxhwCw0id (version=TLSv1 cipher=DHE-RSA-CAMELLIA256-SHA bits=256 verify=NO) for ; Wed, 10 Feb 2016 02:53:22 -0800 (PST) X-Barracuda-Envelope-From: penguin-kernel@I-love.SAKURA.ne.jp X-Barracuda-Apparent-Source-IP: 202.181.97.72 Received: from fsav104.sakura.ne.jp (fsav104.sakura.ne.jp [27.133.134.231]) by www262.sakura.ne.jp (8.14.5/8.14.5) with ESMTP id u1AArKVv066746 for ; Wed, 10 Feb 2016 19:53:20 +0900 (JST) (envelope-from penguin-kernel@I-love.SAKURA.ne.jp) Received: from www262.sakura.ne.jp (202.181.97.72) by fsav104.sakura.ne.jp (F-Secure/fsigk_smtp/522/fsav104.sakura.ne.jp); Wed, 10 Feb 2016 19:53:20 +0900 (JST) X-Virus-Status: clean(F-Secure/fsigk_smtp/522/fsav104.sakura.ne.jp) Received: from AQUA (softbank126072091035.bbtec.net [126.72.91.35]) (authenticated bits=0) by www262.sakura.ne.jp (8.14.5/8.14.5) with ESMTP id u1AArK7H066743 for ; Wed, 10 Feb 2016 19:53:20 +0900 (JST) (envelope-from penguin-kernel@I-love.SAKURA.ne.jp) To: xfs@oss.sgi.com Subject: xfs_nondir_ilock_class lockdep warning From: Tetsuo Handa X-ASG-Orig-Subj: xfs_nondir_ilock_class lockdep warning Message-Id: <201602101953.HEB13075.HFLOOFQVStOJFM@I-love.SAKURA.ne.jp> X-Mailer: Winbiff [Version 2.51 PL2] X-Accept-Language: ja,en,zh Date: Wed, 10 Feb 2016 19:53:21 +0900 Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Barracuda-Connect: www262.sakura.ne.jp[202.181.97.72] X-Barracuda-Start-Time: 1455101601 X-Barracuda-Encrypted: DHE-RSA-CAMELLIA256-SHA X-Barracuda-URL: https://192.48.176.15:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-BRTS-Status: 1 X-Barracuda-Spam-Score: 0.00 X-Barracuda-Spam-Status: No, SCORE=0.00 using per-user scores of TAG_LEVEL=1000.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.7 tests= X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.3.26913 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- Hello. I'm getting xfs_nondir_ilock_class lockdep warning. I reported this because google hits little. Please reply if this is not a known false positive. [ 68.427630] [ 68.430639] ================================= [ 68.432328] [ INFO: inconsistent lock state ] [ 68.433981] 4.5.0-rc3-next-20160209+ #297 Not tainted [ 68.435768] --------------------------------- [ 68.437417] inconsistent {IN-RECLAIM_FS-W} -> {RECLAIM_FS-ON-W} usage. [ 68.439481] a.out/3934 [HC0[0]:SC0[0]:HE1:SE1] takes: [ 68.441284] (&xfs_nondir_ilock_class){++++?-}, at: [] xfs_ilock+0x7f/0xe0 [ 68.443947] {IN-RECLAIM_FS-W} state was registered at: [ 68.445770] [] __lock_acquire+0x391/0x1f70 [ 68.447749] [] lock_acquire+0x6d/0x90 [ 68.449684] [] down_write_nested+0x45/0x80 [ 68.451661] [] xfs_ilock+0x7f/0xe0 [ 68.453526] [] xfs_reclaim_inode+0x12d/0x350 [ 68.455551] [] xfs_reclaim_inodes_ag+0x2ca/0x4f0 [ 68.457615] [] xfs_reclaim_inodes_nr+0x2e/0x40 [ 68.460051] [] xfs_fs_free_cached_objects+0x14/0x20 [ 68.462163] [] super_cache_scan+0x17c/0x190 [ 68.464179] [] shrink_slab.part.41+0x1db/0x2a0 [ 68.466202] [] shrink_zone+0x2dd/0x2f0 [ 68.468102] [] kswapd+0x4cc/0x920 [ 68.469894] [] kthread+0xf9/0x110 [ 68.471656] [] ret_from_fork+0x22/0x50 [ 68.473465] irq event stamp: 3425 [ 68.474841] hardirqs last enabled at (3425): [] _raw_spin_unlock_irqrestore+0x31/0x60 [ 68.477381] hardirqs last disabled at (3424): [] _raw_spin_lock_irqsave+0x24/0x60 [ 68.479820] softirqs last enabled at (2240): [] __do_softirq+0x1bd/0x290 [ 68.482099] softirqs last disabled at (2215): [] irq_exit+0xeb/0x100 [ 68.484281] [ 68.484281] other info that might help us debug this: [ 68.486785] Possible unsafe locking scenario: [ 68.486785] [ 68.489118] CPU0 [ 68.490158] ---- [ 68.491180] lock(&xfs_nondir_ilock_class); [ 68.492600] [ 68.493639] lock(&xfs_nondir_ilock_class); [ 68.495072] [ 68.495072] *** DEADLOCK *** [ 68.495072] [ 68.497766] 4 locks held by a.out/3934: [ 68.499027] #0: (sb_writers#8){.+.+.+}, at: [] __sb_start_write+0xcc/0xe0 [ 68.501349] #1: (&sb->s_type->i_mutex_key#11){+.+.+.}, at: [] xfs_file_buffered_aio_write+0x5f/0x1f0 [ 68.504102] #2: (&(&ip->i_iolock)->mr_lock#2){++++++}, at: [] xfs_ilock+0x99/0xe0 [ 68.506564] #3: (&xfs_nondir_ilock_class){++++?-}, at: [] xfs_ilock+0x7f/0xe0 [ 68.509059] [ 68.509059] stack backtrace: [ 68.511014] CPU: 1 PID: 3934 Comm: a.out Not tainted 4.5.0-rc3-next-20160209+ #297 [ 68.512961] Hardware name: VMware, Inc. VMware Virtual Platform/440BX Desktop Reference Platform, BIOS 6.00 07/31/2013 [ 68.515481] 0000000000000086 00000000b6c05ee8 ffff88007bb3b928 ffffffff8139d91d [ 68.517565] ffff8800362f8000 ffffffff82574ee0 ffff88007bb3b978 ffffffff8113dc64 [ 68.519631] 0000000000000000 ffff880000000001 ffff880000000001 0000000000000008 [ 68.521695] Call Trace: [ 68.522759] [] dump_stack+0x85/0xc8 [ 68.524778] [] print_usage_bug+0x2b0/0x2c1 [ 68.527086] [] ? check_usage_forwards+0x130/0x130 [ 68.532840] [] mark_lock+0x193/0x680 [ 68.534422] [] mark_held_locks+0x66/0x90 [ 68.536056] [] ? kmem_zone_alloc+0x91/0x120 [ 68.537742] [] lockdep_trace_alloc+0x6f/0xd0 [ 68.539459] [] kmem_cache_alloc+0x26/0x170 [ 68.541289] [] kmem_zone_alloc+0x91/0x120 [ 68.542954] [] xfs_bmbt_init_cursor+0x36/0x150 [ 68.544710] [] xfs_bunmapi+0x71a/0x970 [ 68.546365] [] xfs_bmap_punch_delalloc_range+0xd5/0x150 [ 68.548254] [] xfs_vm_kill_delalloc_range+0x5a/0x99 [ 68.550148] [] xfs_vm_write_end+0x5b/0x70 [ 68.551826] [] ? xfs_ilock+0x99/0xe0 [ 68.553421] [] generic_perform_write+0x113/0x1d0 [ 68.555204] [] ? xfs_ilock+0x99/0xe0 [ 68.556791] [] ? xfs_ilock+0x99/0xe0 [ 68.558366] [] xfs_file_buffered_aio_write+0xce/0x1f0 [ 68.560782] [] xfs_file_write_iter+0x84/0x140 [ 68.562544] [] __vfs_write+0xc7/0x100 [ 68.564113] [] vfs_write+0x9d/0x190 [ 68.565649] [] ? __fget_light+0x6a/0x90 [ 68.567240] [] SyS_write+0x53/0xd0 [ 68.568752] [] do_syscall_64+0x5d/0x180 [ 68.570361] [] entry_SYSCALL64_slow_path+0x25/0x25 [ 177.931915] [ 177.931915] ================================= [ 177.931916] [ INFO: inconsistent lock state ] [ 177.931917] 4.5.0-rc3-next-20160209+ #298 Not tainted [ 177.931917] --------------------------------- [ 177.931918] inconsistent {IN-RECLAIM_FS-W} -> {RECLAIM_FS-ON-W} usage. [ 177.931919] a.out/9565 [HC0[0]:SC0[0]:HE1:SE1] takes: [ 177.931925] (&xfs_nondir_ilock_class){++++?-}, at: [] xfs_ilock+0x7f/0xe0 [ 177.931925] {IN-RECLAIM_FS-W} state was registered at: [ 177.931928] [] __lock_acquire+0x391/0x1f70 [ 177.931929] [] lock_acquire+0x6d/0x90 [ 177.931932] [] down_write_nested+0x45/0x80 [ 177.931933] [] xfs_ilock+0x7f/0xe0 [ 177.931935] [] xfs_reclaim_inode+0x12d/0x350 [ 177.931937] [] xfs_reclaim_inodes_ag+0x2ca/0x4f0 [ 177.931938] [] xfs_reclaim_inodes_nr+0x2e/0x40 [ 177.931939] [] xfs_fs_free_cached_objects+0x14/0x20 [ 177.931942] [] super_cache_scan+0x17c/0x190 [ 177.931944] [] shrink_slab.part.41+0x1db/0x2a0 [ 177.931946] [] shrink_zone+0x2dd/0x2f0 [ 177.931947] [] kswapd+0x4cc/0x920 [ 177.931949] [] kthread+0xf9/0x110 [ 177.931952] [] ret_from_fork+0x22/0x50 [ 177.931953] irq event stamp: 284513 [ 177.931955] hardirqs last enabled at (284513): [] _raw_spin_unlock_irqrestore+0x31/0x60 [ 177.931956] hardirqs last disabled at (284512): [] _raw_spin_lock_irqsave+0x24/0x60 [ 177.931959] softirqs last enabled at (283876): [] __do_softirq+0x1bd/0x290 [ 177.931961] softirqs last disabled at (283863): [] irq_exit+0xeb/0x100 [ 177.931961] [ 177.931961] other info that might help us debug this: [ 177.931961] Possible unsafe locking scenario: [ 177.931961] [ 177.931962] CPU0 [ 177.931962] ---- [ 177.931962] lock(&xfs_nondir_ilock_class); [ 177.931963] [ 177.931963] lock(&xfs_nondir_ilock_class); [ 177.931963] [ 177.931963] *** DEADLOCK *** [ 177.931963] [ 177.931964] 4 locks held by a.out/9565: [ 177.931976] #0: (sb_writers#8){.+.+.+}, at: [] __sb_start_write+0xcc/0xe0 [ 177.931979] #1: (&sb->s_type->i_mutex_key#11){+.+.+.}, at: [] xfs_file_buffered_aio_write+0x5f/0x1f0 [ 177.931984] #2: (&(&ip->i_iolock)->mr_lock){++++++}, at: [] xfs_ilock+0x99/0xe0 [ 177.931986] #3: (&xfs_nondir_ilock_class){++++?-}, at: [] xfs_ilock+0x7f/0xe0 [ 177.931987] [ 177.931987] stack backtrace: [ 177.931988] CPU: 3 PID: 9565 Comm: a.out Not tainted 4.5.0-rc3-next-20160209+ #298 [ 177.931989] Hardware name: VMware, Inc. VMware Virtual Platform/440BX Desktop Reference Platform, BIOS 6.00 07/31/2013 [ 177.931991] 0000000000000086 000000009bcbb437 ffff88007af47928 ffffffff8139d90d [ 177.931992] ffff88007af48000 ffffffff82575240 ffff88007af47978 ffffffff8113dc64 [ 177.931993] 0000000000000000 ffff880000000001 ffff880000000001 0000000000000008 [ 177.931993] Call Trace: [ 177.931997] [] dump_stack+0x85/0xc8 [ 177.931999] [] print_usage_bug+0x2b0/0x2c1 [ 177.932000] [] ? check_usage_forwards+0x130/0x130 [ 177.932001] [] mark_lock+0x193/0x680 [ 177.932001] [] mark_held_locks+0x66/0x90 [ 177.932003] [] ? kmem_zone_alloc+0x91/0x120 [ 177.932003] [] lockdep_trace_alloc+0x6f/0xd0 [ 177.932006] [] kmem_cache_alloc+0x26/0x170 [ 177.932007] [] kmem_zone_alloc+0x91/0x120 [ 177.932009] [] xfs_bmbt_init_cursor+0x36/0x150 [ 177.932010] [] xfs_bunmapi+0x71a/0x970 [ 177.932011] [] xfs_bmap_punch_delalloc_range+0xd5/0x150 [ 177.932013] [] xfs_vm_kill_delalloc_range+0x5a/0x99 [ 177.932014] [] xfs_vm_write_end+0x5b/0x70 [ 177.932015] [] ? xfs_ilock+0x99/0xe0 [ 177.932017] [] generic_perform_write+0x113/0x1d0 [ 177.932017] [] ? xfs_ilock+0x99/0xe0 [ 177.932018] [] ? xfs_ilock+0x99/0xe0 [ 177.932020] [] xfs_file_buffered_aio_write+0xce/0x1f0 [ 177.932021] [] xfs_file_write_iter+0x84/0x140 [ 177.932023] [] __vfs_write+0xc7/0x100 [ 177.932025] [] vfs_write+0x9d/0x190 [ 177.932027] [] ? __fget_light+0x6a/0x90 [ 177.932028] [] SyS_write+0x53/0xd0 [ 177.932030] [] do_syscall_64+0x5d/0x180 [ 177.932032] [] entry_SYSCALL64_slow_path+0x25/0x25 From BATV+379ae17216066e1ae70b+4553+infradead.org+hch@bombadil.srs.infradead.org Wed Feb 10 05:28:06 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=ham version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay1.corp.sgi.com [137.38.102.111]) by oss.sgi.com (Postfix) with ESMTP id 6DE897CA2 for ; Wed, 10 Feb 2016 05:28:06 -0600 (CST) Received: from cuda.sgi.com (cuda3.sgi.com [192.48.176.15]) by relay1.corp.sgi.com (Postfix) with ESMTP id 5C1FB8F8049 for ; Wed, 10 Feb 2016 03:28:03 -0800 (PST) X-ASG-Debug-ID: 1455103680-04cb6c1e573c270001-NocioJ Received: from bombadil.infradead.org ([198.137.202.9]) by cuda.sgi.com with ESMTP id i86t3xMIdWZXz9eY (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128 verify=NO) for ; Wed, 10 Feb 2016 03:28:01 -0800 (PST) X-Barracuda-Envelope-From: BATV+379ae17216066e1ae70b+4553+infradead.org+hch@bombadil.srs.infradead.org X-Barracuda-Apparent-Source-IP: 198.137.202.9 Received: from hch by bombadil.infradead.org with local (Exim 4.80.1 #2 (Red Hat Linux)) id 1aTSwC-00045x-9N; Wed, 10 Feb 2016 11:28:00 +0000 Date: Wed, 10 Feb 2016 03:28:00 -0800 From: Christoph Hellwig To: Dave Chinner Cc: xfs@oss.sgi.com Subject: Re: [PATCH 2/8] xfs: remove xfs_cancel_ioend Message-ID: <20160210112800.GA15221@infradead.org> X-ASG-Orig-Subj: Re: [PATCH 2/8] xfs: remove xfs_cancel_ioend References: <1455094043-9694-1-git-send-email-david@fromorbit.com> <1455094043-9694-3-git-send-email-david@fromorbit.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1455094043-9694-3-git-send-email-david@fromorbit.com> User-Agent: Mutt/1.5.24 (2015-08-30) X-SRS-Rewrite: SMTP reverse-path rewritten from by bombadil.infradead.org See http://www.infradead.org/rpr.html X-Barracuda-Connect: UNKNOWN[198.137.202.9] X-Barracuda-Start-Time: 1455103681 X-Barracuda-Encrypted: ECDHE-RSA-AES128-GCM-SHA256 X-Barracuda-URL: https://192.48.176.15:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-BRTS-Status: 1 X-Barracuda-Spam-Score: 0.10 X-Barracuda-Spam-Status: No, SCORE=0.10 using per-user scores of TAG_LEVEL=1000.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.7 tests=BSF_SC0_MISMATCH_TO, RDNS_NONE X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.3.26914 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 0.00 BSF_SC0_MISMATCH_TO Envelope rcpt doesn't match header 0.10 RDNS_NONE Delivered to trusted network by a host with no rDNS > +static int > +xfs_writepage_submit( > + struct xfs_ioend *ioend, > + struct xfs_ioend *iohead, > + struct writeback_control *wbc, > + int status) > +{ > + struct blk_plug plug; > + > + /* Reserve log space if we might write beyond the on-disk inode size. */ > + if (!status && ioend && ioend->io_type != XFS_IO_UNWRITTEN && > + xfs_ioend_is_append(ioend)) > + status = xfs_setfilesize_trans_alloc(ioend); > + > + if (iohead) { > + blk_start_plug(&plug); > + xfs_submit_ioend(wbc, iohead, status); > + blk_finish_plug(&plug); > + } > + return status; > +} We return the xfs_setfilesize_trans_alloc failure status here, but none of the callers pick it up. The way this is handled later changes a bit, but even at the end of the series only 1 of the three callers handles the error. From BATV+379ae17216066e1ae70b+4553+infradead.org+hch@bombadil.srs.infradead.org Wed Feb 10 05:31:29 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=ham version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay2.corp.sgi.com [137.38.102.29]) by oss.sgi.com (Postfix) with ESMTP id B22837CA2 for ; Wed, 10 Feb 2016 05:31:29 -0600 (CST) Received: from cuda.sgi.com (cuda3.sgi.com [192.48.176.15]) by relay2.corp.sgi.com (Postfix) with ESMTP id 91F11304066 for ; Wed, 10 Feb 2016 03:31:29 -0800 (PST) X-ASG-Debug-ID: 1455103887-04cb6c1e573c390001-NocioJ Received: from bombadil.infradead.org ([198.137.202.9]) by cuda.sgi.com with ESMTP id nINsPc7cDzsqURRg (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128 verify=NO) for ; Wed, 10 Feb 2016 03:31:27 -0800 (PST) X-Barracuda-Envelope-From: BATV+379ae17216066e1ae70b+4553+infradead.org+hch@bombadil.srs.infradead.org X-Barracuda-Apparent-Source-IP: 198.137.202.9 Received: from hch by bombadil.infradead.org with local (Exim 4.80.1 #2 (Red Hat Linux)) id 1aTSzW-0005Vo-Na; Wed, 10 Feb 2016 11:31:26 +0000 Date: Wed, 10 Feb 2016 03:31:26 -0800 From: Christoph Hellwig To: Dave Chinner Cc: xfs@oss.sgi.com Subject: Re: [PATCH 3/8] xfs: Introduce writeback context for writepages Message-ID: <20160210113126.GB15221@infradead.org> X-ASG-Orig-Subj: Re: [PATCH 3/8] xfs: Introduce writeback context for writepages References: <1455094043-9694-1-git-send-email-david@fromorbit.com> <1455094043-9694-4-git-send-email-david@fromorbit.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1455094043-9694-4-git-send-email-david@fromorbit.com> User-Agent: Mutt/1.5.24 (2015-08-30) X-SRS-Rewrite: SMTP reverse-path rewritten from by bombadil.infradead.org See http://www.infradead.org/rpr.html X-Barracuda-Connect: UNKNOWN[198.137.202.9] X-Barracuda-Start-Time: 1455103887 X-Barracuda-Encrypted: ECDHE-RSA-AES128-GCM-SHA256 X-Barracuda-URL: https://192.48.176.15:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-BRTS-Status: 1 X-Barracuda-Spam-Score: 0.10 X-Barracuda-Spam-Status: No, SCORE=0.10 using per-user scores of TAG_LEVEL=1000.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.7 tests=BSF_SC0_MISMATCH_TO, RDNS_NONE X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.3.26914 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 0.00 BSF_SC0_MISMATCH_TO Envelope rcpt doesn't match header 0.10 RDNS_NONE Delivered to trusted network by a host with no rDNS > + struct xfs_writepage_ctx wpc = { > + .io_type = XFS_IO_OVERWRITE, > + }; > + int ret; > + > + ret = xfs_do_writepage(page, wbc, &wpc); > + return xfs_writepage_submit(&wpc, wbc, ret); > +} > + > +STATIC int > xfs_vm_writepages( > struct address_space *mapping, > struct writeback_control *wbc) > { > + struct xfs_writepage_ctx wpc = { > + .io_type = XFS_IO_OVERWRITE, > + }; Shouldn't we start out with an invalid (0) state, and just move the actual states up to start from 1? Otherwise looks fine, Reviewed-by: Christoph Hellwig From BATV+379ae17216066e1ae70b+4553+infradead.org+hch@bombadil.srs.infradead.org Wed Feb 10 05:36:12 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=ham version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay2.corp.sgi.com [137.38.102.29]) by oss.sgi.com (Postfix) with ESMTP id 98A0D7CA2 for ; Wed, 10 Feb 2016 05:36:12 -0600 (CST) Received: from cuda.sgi.com (cuda2.sgi.com [192.48.176.25]) by relay2.corp.sgi.com (Postfix) with ESMTP id 7567B304062 for ; Wed, 10 Feb 2016 03:36:12 -0800 (PST) X-ASG-Debug-ID: 1455104169-04cbb0433254260001-NocioJ Received: from bombadil.infradead.org ([198.137.202.9]) by cuda.sgi.com with ESMTP id iycftzDZjf3ECCuv (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128 verify=NO) for ; Wed, 10 Feb 2016 03:36:10 -0800 (PST) X-Barracuda-Envelope-From: BATV+379ae17216066e1ae70b+4553+infradead.org+hch@bombadil.srs.infradead.org X-Barracuda-Apparent-Source-IP: 198.137.202.9 Received: from hch by bombadil.infradead.org with local (Exim 4.80.1 #2 (Red Hat Linux)) id 1aTT45-0006zj-9f; Wed, 10 Feb 2016 11:36:09 +0000 Date: Wed, 10 Feb 2016 03:36:09 -0800 From: Christoph Hellwig To: Dave Chinner Cc: xfs@oss.sgi.com Subject: Re: [PATCH 6/8] xfs: don't chain ioends during writepage submission Message-ID: <20160210113609.GC15221@infradead.org> X-ASG-Orig-Subj: Re: [PATCH 6/8] xfs: don't chain ioends during writepage submission References: <1455094043-9694-1-git-send-email-david@fromorbit.com> <1455094043-9694-7-git-send-email-david@fromorbit.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1455094043-9694-7-git-send-email-david@fromorbit.com> User-Agent: Mutt/1.5.24 (2015-08-30) X-SRS-Rewrite: SMTP reverse-path rewritten from by bombadil.infradead.org See http://www.infradead.org/rpr.html X-Barracuda-Connect: UNKNOWN[198.137.202.9] X-Barracuda-Start-Time: 1455104170 X-Barracuda-Encrypted: ECDHE-RSA-AES128-GCM-SHA256 X-Barracuda-URL: https://192.48.176.25:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-BRTS-Status: 1 X-Barracuda-Spam-Score: 0.10 X-Barracuda-Spam-Status: No, SCORE=0.10 using per-user scores of TAG_LEVEL=1000.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.7 tests=BSF_SC0_MISMATCH_TO, RDNS_NONE X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.3.26914 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 0.00 BSF_SC0_MISMATCH_TO Envelope rcpt doesn't match header 0.10 RDNS_NONE Delivered to trusted network by a host with no rDNS > -STATIC void > +STATIC int > xfs_submit_ioend( > struct writeback_control *wbc, > xfs_ioend_t *ioend, > int fail) No that almost all of the function is rewritten can you rename fail to error or status? fail always suggests a boolean to me and is rather confusing. > + * Return the ioend we finished off so that the caller can submit it > + * once it has finished processing the dirty page. > */ > -STATIC void > +STATIC struct xfs_ioend * > xfs_add_to_ioend( > struct inode *inode, > struct buffer_head *bh, > xfs_off_t offset, > struct xfs_writepage_ctx *wpc) > { > + struct xfs_ioend *prev = NULL; > + > if (!wpc->ioend || wpc->io_type != wpc->ioend->io_type || > bh->b_blocknr != wpc->last_block + 1) { > struct xfs_ioend *new; > > + prev = wpc->ioend; Looking at the new list_head based code it might be either to just pass in a pointer to the submit_list and just add the previous ioend here directly. > + LIST_HEAD(submit_list); > + struct xfs_ioend *ioend, *next; > struct buffer_head *bh, *head; > ssize_t len = 1 << inode->i_blkbits; > int error = 0; > int uptodate = 1; > int count = 0; The count variable is pointless now - we only check for it being non-zero, and we can do the same with a list_emptry on submit_list. > > + > bh = head = page_buffers(page); > offset = page_offset(page); nit: pointless second empty line added above > ret = xfs_do_writepage(page, wbc, &wpc); > - return xfs_writepage_submit(&wpc, wbc, ret); > + if (wpc.ioend) > + xfs_submit_ioend(wbc, wpc.ioend, ret); > + return ret; > } > > STATIC int > @@ -1019,7 +1022,9 @@ xfs_vm_writepages( > > xfs_iflags_clear(XFS_I(mapping->host), XFS_ITRUNCATED); > ret = write_cache_pages(mapping, wbc, xfs_do_writepage, &wpc); > - return xfs_writepage_submit(&wpc, wbc, ret); > + if (wpc.ioend) > + xfs_submit_ioend(wbc, wpc.ioend, ret); > + return ret; And this is where ignoreing the xfs_setfilesize_trans_alloc errors reappears after a previous patch mostly fixed it up. From bfoster@redhat.com Wed Feb 10 07:18:23 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=ham version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay1.corp.sgi.com [137.38.102.111]) by oss.sgi.com (Postfix) with ESMTP id 353157CA4 for ; Wed, 10 Feb 2016 07:18:23 -0600 (CST) Received: from cuda.sgi.com (cuda1.sgi.com [192.48.157.11]) by relay1.corp.sgi.com (Postfix) with ESMTP id 098358F8033 for ; Wed, 10 Feb 2016 05:18:20 -0800 (PST) X-ASG-Debug-ID: 1455110298-04bdf066ed41460001-NocioJ Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by cuda.sgi.com with ESMTP id OhcCZvlfsyQVXMf4 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO) for ; Wed, 10 Feb 2016 05:18:18 -0800 (PST) X-Barracuda-Envelope-From: bfoster@redhat.com X-Barracuda-Apparent-Source-IP: 209.132.183.28 X-ASG-Whitelist: Client Received: from int-mx11.intmail.prod.int.phx2.redhat.com (int-mx11.intmail.prod.int.phx2.redhat.com [10.5.11.24]) by mx1.redhat.com (Postfix) with ESMTPS id 8E398C0C2379; Wed, 10 Feb 2016 13:18:18 +0000 (UTC) Received: from bfoster.bfoster (dhcp-41-164.bos.redhat.com [10.18.41.164]) by int-mx11.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id u1ADIIrY008073; Wed, 10 Feb 2016 08:18:18 -0500 Received: by bfoster.bfoster (Postfix, from userid 1000) id 4E029123DF8; Wed, 10 Feb 2016 08:18:17 -0500 (EST) Date: Wed, 10 Feb 2016 08:18:17 -0500 From: Brian Foster To: Dave Chinner Cc: xfs@oss.sgi.com Subject: Re: [PATCH 5/5] xfs: don't chain ioends during writepage submission Message-ID: <20160210131816.GB48974@bfoster.bfoster> X-ASG-Orig-Subj: Re: [PATCH 5/5] xfs: don't chain ioends during writepage submission References: <1454910258-7578-1-git-send-email-david@fromorbit.com> <1454910258-7578-6-git-send-email-david@fromorbit.com> <20160209142355.GB25829@bfoster.bfoster> <20160209215900.GH14668@dastard> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20160209215900.GH14668@dastard> User-Agent: Mutt/1.5.24 (2015-08-30) X-Scanned-By: MIMEDefang 2.68 on 10.5.11.24 X-Barracuda-Connect: mx1.redhat.com[209.132.183.28] X-Barracuda-Start-Time: 1455110298 X-Barracuda-Encrypted: ECDHE-RSA-AES256-GCM-SHA384 X-Barracuda-URL: https://192.48.157.11:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-BRTS-Status: 1 On Wed, Feb 10, 2016 at 08:59:00AM +1100, Dave Chinner wrote: > On Tue, Feb 09, 2016 at 09:23:55AM -0500, Brian Foster wrote: > > On Mon, Feb 08, 2016 at 04:44:18PM +1100, Dave Chinner wrote: > > > @@ -738,29 +726,22 @@ xfs_writepage_submit( > > > struct writeback_control *wbc, > > > int status) > > > { > > > - struct blk_plug plug; > > > - > > > - /* Reserve log space if we might write beyond the on-disk inode size. */ > > > - if (!status && wpc->ioend && wpc->ioend->io_type != XFS_IO_UNWRITTEN && > > > - xfs_ioend_is_append(wpc->ioend)) > > > - status = xfs_setfilesize_trans_alloc(wpc->ioend); > > > - > > > - if (wpc->iohead) { > > > - blk_start_plug(&plug); > > > - xfs_submit_ioend(wbc, wpc->iohead, status); > > > - blk_finish_plug(&plug); > > > - } > > > > We've dropped our plug here but I don't see anything added in > > xfs_vm_writepages(). Shouldn't we have one there now that ioends are > > submitted as we go? generic_writepages() uses one around its > > write_cache_pages() call.. > > It's not really necessary, as we now have higher level plugging in > the writeback go will get flushed on context switch, and if we don't > have a high level plug (e.g. fsync triggered writeback), then we > submit the IO immediately, just like flushing the plug here would do > anyway.... > Ok, I'm digging around the wb code a bit and I see plugs in/around wb_writeback(), so I assume that's what you're referring to in the first case. I'm not quite following the fsync case though... In the current upstream code, fsync() leads to the following call chain: filemap_write_and_wait_range() __filemap_fdatawrite_range() do_writepages() xfs_vm_writepages() generic_writepages() blk_start_plug() write_cache_pages() blk_finish_plug() After this series, we have the following: filemap_write_and_wait_range() __filemap_fdatawrite_range() do_writepages() xfs_vm_writepages() write_cache_pages() ... with no plug that I can see. What am I missing? ... > > > - else { > > > + while (ioend_to_submit) { > > > + struct xfs_ioend *next = ioend_to_submit->io_list; > > > + > > > + ioend_to_submit->io_list = NULL; > > > + xfs_submit_ioend(wbc, ioend_to_submit, 0); > > > + ioend_to_submit = next; > > > + } > > > + } else { > > > xfs_aops_discard_page(page); > > > ClearPageUptodate(page); > > > unlock_page(page); > > > > If we have an error and count == 0, we know that ioend_to_submit is NULL > > because that is only potentially set once the first buffer is added. > > That said, this doesn't mean that we don't have an ioend waiting on the > > wpc. If we do, we still return the error and the ioend is errored out. > > > > I wonder if that is really necessary if we haven't added any buffers > > from the page..? Could we submit the ioend properly in that case? OTOH, > > that might complicate the error reporting and an error here might be > > serious enough that it isn't worth it, as opposed to just making sure we > > clean up everything appropriately. > > The way I've done it is the same as the existing code - on error the > entire ioend chain that has been built is errored out. I'd prefer to > keep it that way right now to minimise the potential behavioural > changes of the patch series. We can look to changing to partial > submission in a separate patch set if it makes sense to do so. > I noticed that the existing code is roughly equivalent, so that's fair I think. Thanks. Brian > Cheers, > > Dave. > -- > Dave Chinner > david@fromorbit.com From billodo@redhat.com Wed Feb 10 09:43:11 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=ham version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay1.corp.sgi.com [137.38.102.111]) by oss.sgi.com (Postfix) with ESMTP id E11FC7CA2 for ; Wed, 10 Feb 2016 09:43:11 -0600 (CST) Received: from cuda.sgi.com (cuda3.sgi.com [192.48.176.15]) by relay1.corp.sgi.com (Postfix) with ESMTP id C10628F8039 for ; Wed, 10 Feb 2016 07:43:08 -0800 (PST) X-ASG-Debug-ID: 1455118983-04cb6c1e57419f0001-NocioJ Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by cuda.sgi.com with ESMTP id gBiLcuIQOVeam006 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO) for ; Wed, 10 Feb 2016 07:43:03 -0800 (PST) X-Barracuda-Envelope-From: billodo@redhat.com X-Barracuda-Apparent-Source-IP: 209.132.183.28 X-ASG-Whitelist: Client Received: from int-mx09.intmail.prod.int.phx2.redhat.com (int-mx09.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by mx1.redhat.com (Postfix) with ESMTPS id EB0595A4D; Wed, 10 Feb 2016 15:43:02 +0000 (UTC) Received: from redhat.com (vpn-57-23.rdu2.redhat.com [10.10.57.23]) by int-mx09.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id u1AFh0Eb020343 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Wed, 10 Feb 2016 10:43:02 -0500 Date: Wed, 10 Feb 2016 09:43:00 -0600 From: "Bill O'Donnell" To: Eric Sandeen Cc: xfs@oss.sgi.com Subject: Re: [PATCH 2/2 v2] xfs_repair: new secondary superblock search method] xfs_repair: new secondary superblock search method Message-ID: <20160210154300.GA9472@redhat.com> X-ASG-Orig-Subj: Re: [PATCH 2/2 v2] xfs_repair: new secondary superblock search method] xfs_repair: new secondary superblock search method References: <1455068099-26992-1-git-send-email-billodo@redhat.com> <56BAC150.7070808@sandeen.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <56BAC150.7070808@sandeen.net> User-Agent: Mutt/1.5.24 (2015-08-30) X-Scanned-By: MIMEDefang 2.68 on 10.5.11.22 X-Barracuda-Connect: mx1.redhat.com[209.132.183.28] X-Barracuda-Start-Time: 1455118983 X-Barracuda-Encrypted: ECDHE-RSA-AES256-GCM-SHA384 X-Barracuda-URL: https://192.48.176.15:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-BRTS-Status: 1 On Tue, Feb 09, 2016 at 10:49:20PM -0600, Eric Sandeen wrote: > On 2/9/16 7:34 PM, Bill O'Donnell wrote: > > Optimize secondary sb search, using similar method to find > > fs geometry as that of xfs_mkfs. If this faster method fails > > in finding a secondary sb, fall back to original brute force > > slower search. > > > > Signed-off-by: Bill O'Donnell > > --- > > Makefile | 2 +- > > include/libxcmd.h | 4 +++- > > libxcmd/topology.c | 35 ++++++++++++++++++++++++++++---- > > repair/Makefile | 4 ++-- > > repair/sb.c | 58 ++++++++++++++++++++++++++++++++++++++++++++---------- > > 5 files changed, 85 insertions(+), 18 deletions(-) > > > > diff --git a/Makefile b/Makefile > > index fca0a42..1d60d9c 100644 > > --- a/Makefile > > +++ b/Makefile > > @@ -80,7 +80,7 @@ fsr: libhandle > > growfs: libxcmd > > io: libxcmd libhandle > > quota: libxcmd > > -repair: libxlog > > +repair: libxlog libxcmd > > copy: libxlog > > > > ifeq ($(HAVE_BUILDDEFS), yes) > > diff --git a/include/libxcmd.h b/include/libxcmd.h > > index df7046e..b140adb 100644 > > --- a/include/libxcmd.h > > +++ b/include/libxcmd.h > > @@ -50,6 +50,8 @@ extern int > > check_overwrite( > > char *device); > > > > - > > +extern int guess_default_geometry(__uint64_t *agsize, > > + __uint64_t *agcount, > > + libxfs_init_t x); > > > > #endif /* __LIBXCMD_H__ */ > > diff --git a/libxcmd/topology.c b/libxcmd/topology.c > > index 0eeea28..b98d9b9 100644 > > --- a/libxcmd/topology.c > > +++ b/libxcmd/topology.c > > @@ -192,7 +192,8 @@ out: > > return ret; > > } > > > > -static void blkid_get_topology( > > +static void > > +blkid_get_topology( > > const char *device, > > int *sunit, > > int *swidth, > > @@ -284,7 +285,8 @@ check_overwrite( > > return 1; > > } > > > > -static void blkid_get_topology( > > +static void > > +blkid_get_topology( > > const char *device, > > int *sunit, > > int *swidth, > > @@ -302,8 +304,8 @@ static void blkid_get_topology( > > > > #endif /* ENABLE_BLKID */ > > > > - > > -void get_topology( > > +void > > +get_topology( > > libxfs_init_t *xi, > > struct fs_topology *ft, > > int force_overwrite) > > @@ -346,3 +348,28 @@ void get_topology( > > &lsectorsize, &psectorsize, force_overwrite); > > } > > } > > + > > +int > > +guess_default_geometry(__uint64_t *agsize, __uint64_t *agcount, > > + libxfs_init_t x) > > +{ > > + struct fs_topology ft; > > + int blocklog; > > When in Rome: :) > > int > guess_default_geometry( > __uint64_t *agsize, > __uint64_t *agcount, > libxfs_init_t x) > { > ... > > (sorry, forgot to mention that last time, but other functions in the > file are laid out this way; it is easier to read) > > > + __uint64_t dblocks; > > + int multidisk; > > + > > + memset(&ft, 0, sizeof(ft)); > > + get_topology(&x, &ft, 1); > > + > > + /* > > + * get geometry from get_topology result. > > + * Use default block size (2^12) > > + */ > > + blocklog = 12; > > + multidisk = ft.dswidth | ft.dsunit; > > + dblocks = x.dsize >> (blocklog - BBSHIFT); > > + calc_default_ag_geometry(blocklog, dblocks, multidisk, > > + agsize, agcount); > > + > > + return blocklog; > > +} > > diff --git a/repair/Makefile b/repair/Makefile > > index 251722b..d24ab1f 100644 > > --- a/repair/Makefile > > +++ b/repair/Makefile > > @@ -20,8 +20,8 @@ CFILES = agheader.c attr_repair.c avl.c avl64.c bmap.c btree.c \ > > progress.c prefetch.c rt.c sb.c scan.c threads.c \ > > versions.c xfs_repair.c > > > > -LLDLIBS = $(LIBXFS) $(LIBXLOG) $(LIBUUID) $(LIBRT) $(LIBPTHREAD) > > -LTDEPENDENCIES = $(LIBXFS) $(LIBXLOG) > > +LLDLIBS = $(LIBBLKID) $(LIBXFS) $(LIBXLOG) $(LIBUUID) $(LIBRT) $(LIBPTHREAD) $(LIBXCMD) > > +LTDEPENDENCIES = $(LIBXFS) $(LIBXLOG) $(LIBXCMD) > > LLDFLAGS = -static-libtool-libs > > > > default: depend $(LTCOMMAND) > > diff --git a/repair/sb.c b/repair/sb.c > > index 4eef14a..8bc246e 100644 > > --- a/repair/sb.c > > +++ b/repair/sb.c > > @@ -22,6 +22,7 @@ > > #include "globals.h" > > #include "protos.h" > > #include "err_protos.h" > > +#include "libxcmd.h" > > Nitpick, we usually include that right after libxfs.h. > > > #define BSIZE (1024 * 1024) > > > > @@ -85,10 +86,11 @@ copy_sb(xfs_sb_t *source, xfs_sb_t *dest) > > } > > > > /* > > - * find a secondary superblock, copy it into the sb buffer > > + * find a secondary superblock, copy it into the sb buffer. > > + * skipsize units is bytes, it contains either the agsize in bytes > > + * (if known), or the minimum agsize in bytes if agsize unknown. > > */ > > Ok, so this is a little confused. There are actually 3 relevant > parameters here: > > 1) The place to start reading > 2) The number of bytes to read at that point > 3) How far to seek forward for the next read > > In the old world, it's: > > 1) XFS_MIN_AG_BYTES > 2) BSIZE (1MB) > 3) BSIZE (i.e. it does sequential reads) > > In the new world, it's: > > 1) the guessed AG size (skipsize?) > 2) BSIZE (more than we need, but not expensive, so leave it) > 3) the guessed AG size (skipsize) > > You really have 2 different pieces of info: Where to do the first read, > and how far forward to skip for the next read. I don't think you > can convey that with a single argument, "skipsize." > > > -int > > -find_secondary_sb(xfs_sb_t *rsb) > > +static int __find_secondary_sb(xfs_sb_t *rsb, __uint64_t skipsize) > > better to format as: > > static int > __find_secondary_sb( > xfs_sb_t *rsb, > __uint64_t skipsize) > { > > but ... > > > { > > xfs_off_t off; > > xfs_sb_t *sb; > > @@ -99,9 +101,9 @@ find_secondary_sb(xfs_sb_t *rsb) > > int dirty; > > int retval; > > int bsize; > > + int readsize; > > > > do_warn(_("\nattempting to find secondary superblock...\n")); > > - > > sb = (xfs_sb_t *)memalign(libxfs_device_alignment(), BSIZE); > > if (!sb) { > > do_error( > > @@ -113,13 +115,16 @@ find_secondary_sb(xfs_sb_t *rsb) > > retval = 0; > > dirty = 0; > > bsize = 0; > > + readsize = 0; > > > > /* > > * skip first sector since we know that's bad > > */ > > - for (done = 0, off = XFS_AG_MIN_BYTES; !done ; off += bsize) { > > + for (done = 0, off = skipsize; !done ; off += readsize) { > > /* > > - * read disk 1 MByte at a time. > > we are actually still doing that, read(x.dfd, sb, BSIZE), so I'd > leave the comment... > > > + * read disk using readsize interval > > + * (either the bytecount of actual agsize or bsize if > > + * agsize undetermined.) > > > > */ > > if (lseek64(x.dfd, off, SEEK_SET) != off) { > > done = 1; > > @@ -128,9 +133,13 @@ find_secondary_sb(xfs_sb_t *rsb) > > if (!done && (bsize = read(x.dfd, sb, BSIZE)) <= 0) { > > done = 1; > > } > > - > > + if (skipsize == XFS_AG_MIN_BYTES) { > > + readsize = bsize; > > + } > > + else { > > better as: > } else { > > > + readsize = skipsize; > > + } > > I wouldn't call this "readsize" - we are only ever reading BSIZE at a time. > This is how much we advance each loop, so skipsize is a bit better. > > But the _functional_ problem here is that it is possible and permissible > to have a filesystem with an AG size of XFS_AG_MIN_BYTES (16MB). > > So if you guessed a default geometry with an agsize of XFS_AG_MIN_BYTES, > you've gone back to the fine-grained scanning. The fs probably isn't > very big as a result, so it's not the end of the world, but ... > see below. > > > do_warn("."); > > - > > /* > > * check the buffer 512 bytes at a time since > > * we don't know how big the sectors really are. > > @@ -164,9 +173,38 @@ find_secondary_sb(xfs_sb_t *rsb) > > } > > } > > } > > - > > free(sb); > > - return(retval); > > + return retval; > > +} > > + > > +int > > +find_secondary_sb(xfs_sb_t *rsb) > > +{ > > + int retval; > > + __uint64_t skipsize; > > + __uint64_t agcount; > > + __uint64_t agsize; > > + int blocklog; > > + > > + /* > > + * Attempt to find secondary sb with a coarse approach, > > + * using a large skipsize (agsize in bytes). Failing that, > > + * fallback to the fine-grained approach using min agsize. > > + */ > > + blocklog = guess_default_geometry(&agsize, &agcount, x); > > + > > + /* > > + * use found ag geometry to quickly find secondary sb > > + */ > > + skipsize = agsize << blocklog; > > + retval = __find_secondary_sb(rsb, skipsize); > > + if (!retval) { > > + /* > > + * fallback: use minimum agsize for skipsize > > + */ > > + retval = __find_secondary_sb(rsb, XFS_AG_MIN_BYTES); > > + } > > + return retval; > > } > > I'd make __find_secondary_sb() take (sb, start, skip) i.e. send in > this: > > > + retval = __find_secondary_sb(rsb, agsize, agsize); > > + if (!retval) { > > + /* > > + * fallback: use minimum agsize for skipsize > > + */ > > + retval = __find_secondary_sb(rsb, XFS_AG_MIN_BYTES, BSIZE); > > + } > > and the function is something like: > > static int > __find_secondary_sb( > xfs_sb_t *rsb, > xfs_off_t start, > xfs_off_t skip) > > { > > ... > > for (done = 0, off = start; !done ; off += skip) { > ... > if (lseek64(x.dfd, off, SEEK_SET) != off) > done = 1; > > if (!done && (read(x.dfd, sb, BSIZE)) <= 0) > done = 1; But, bsize is used here: ... * check the buffer 512 bytes at a time since * we don't know how big the sectors really are. */ for (i = 0; !done && i < bsize; i += BBSIZE) { ... so, don't we still need to populate bsize? Or does it make more sense to just use BBSIZE in the conditional, ala: for (i = 0; !done && i < BBSIZE; i += BBSIZE) > > > because you really can't deduce both the starting point and the skip-ahead > size from just one parameter. Agreed. Thanks for your thorough reviews :) Bill > > _______________________________________________ > xfs mailing list > xfs@oss.sgi.com > http://oss.sgi.com/mailman/listinfo/xfs From sandeen@sandeen.net Wed Feb 10 09:51:10 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=ham version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay2.corp.sgi.com [137.38.102.29]) by oss.sgi.com (Postfix) with ESMTP id C27CD7CA2 for ; Wed, 10 Feb 2016 09:51:10 -0600 (CST) Received: from cuda.sgi.com (cuda2.sgi.com [192.48.176.25]) by relay2.corp.sgi.com (Postfix) with ESMTP id A1678304059 for ; Wed, 10 Feb 2016 07:51:07 -0800 (PST) X-ASG-Debug-ID: 1455119464-04cbb043315ad60001-NocioJ Received: from sandeen.net (sandeen.net [63.231.237.45]) by cuda.sgi.com with ESMTP id 31woxhKFGgNF2PTt for ; Wed, 10 Feb 2016 07:51:04 -0800 (PST) X-Barracuda-Envelope-From: sandeen@sandeen.net X-Barracuda-Apparent-Source-IP: 63.231.237.45 Received: from liberator.sandeen.net (liberator.sandeen.net [10.0.0.4]) (using TLSv1.2 with cipher DHE-RSA-AES128-SHA (128/128 bits)) (No client certificate requested) by sandeen.net (Postfix) with ESMTPSA id 76CB863C607A; Wed, 10 Feb 2016 09:51:04 -0600 (CST) Subject: Re: [PATCH 2/2 v2] xfs_repair: new secondary superblock search method] xfs_repair: new secondary superblock search method To: Bill O'Donnell X-ASG-Orig-Subj: Re: [PATCH 2/2 v2] xfs_repair: new secondary superblock search method] xfs_repair: new secondary superblock search method References: <1455068099-26992-1-git-send-email-billodo@redhat.com> <56BAC150.7070808@sandeen.net> <20160210154300.GA9472@redhat.com> Cc: xfs@oss.sgi.com From: Eric Sandeen Message-ID: <56BB5C67.6040906@sandeen.net> Date: Wed, 10 Feb 2016 09:51:03 -0600 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.11; rv:38.0) Gecko/20100101 Thunderbird/38.5.1 MIME-Version: 1.0 In-Reply-To: <20160210154300.GA9472@redhat.com> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit X-Barracuda-Connect: sandeen.net[63.231.237.45] X-Barracuda-Start-Time: 1455119464 X-Barracuda-URL: https://192.48.176.25:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-BRTS-Status: 1 X-Barracuda-Spam-Score: 0.00 X-Barracuda-Spam-Status: No, SCORE=0.00 using per-user scores of TAG_LEVEL=1000.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.7 tests=BSF_SC0_MISMATCH_TO X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.3.26918 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 0.00 BSF_SC0_MISMATCH_TO Envelope rcpt doesn't match header On 2/10/16 9:43 AM, Bill O'Donnell wrote: >> I'd make __find_secondary_sb() take (sb, start, skip) i.e. send in >> > this: >> > >>> > > + retval = __find_secondary_sb(rsb, agsize, agsize); >>> > > + if (!retval) { >>> > > + /* >>> > > + * fallback: use minimum agsize for skipsize >>> > > + */ >>> > > + retval = __find_secondary_sb(rsb, XFS_AG_MIN_BYTES, BSIZE); >>> > > + } >> > >> > and the function is something like: >> > >> > static int >> > __find_secondary_sb( >> > xfs_sb_t *rsb, >> > xfs_off_t start, >> > xfs_off_t skip) >> > >> > { >> > >> > ... >> > >> > for (done = 0, off = start; !done ; off += skip) { >> > ... >> > if (lseek64(x.dfd, off, SEEK_SET) != off) >> > done = 1; >> > >> > if (!done && (read(x.dfd, sb, BSIZE)) <= 0) >> > done = 1; > But, bsize is used here: > ... > * check the buffer 512 bytes at a time since > * we don't know how big the sectors really are. > */ > for (i = 0; !done && i < bsize; i += BBSIZE) { > ... > so, don't we still need to populate bsize? Or does it make more > sense to just use BBSIZE in the conditional, ala: > for (i = 0; !done && i < BBSIZE; i += BBSIZE) Oh, right, sorry. yes, keep the assignment: if (!done && (bsize = read(x.dfd, sb, BSIZE)) <= 0) { That handles a short read at the end; we ask for BSIZE, actually read bsize, and then we need to iterate over what actually got read (bsize). BSIZE, bsize ... clear as mud. :( -Eric >> > >> > >> > because you really can't deduce both the starting point and the skip-ahead >> > size from just one parameter. > Agreed. > Thanks for your thorough reviews :) > Bill > From BATV+379ae17216066e1ae70b+4553+infradead.org+hch@bombadil.srs.infradead.org Wed Feb 10 12:25:42 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=ham version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay3.corp.sgi.com [198.149.34.15]) by oss.sgi.com (Postfix) with ESMTP id 6169B7CA2 for ; Wed, 10 Feb 2016 12:25:42 -0600 (CST) Received: from cuda.sgi.com (cuda1.sgi.com [192.48.157.11]) by relay3.corp.sgi.com (Postfix) with ESMTP id F28FEAC007 for ; Wed, 10 Feb 2016 10:25:41 -0800 (PST) X-ASG-Debug-ID: 1455128738-04bdf066ec49a90001-NocioJ Received: from bombadil.infradead.org ([198.137.202.9]) by cuda.sgi.com with ESMTP id M2I3HYuLI7zoqItd (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128 verify=NO) for ; Wed, 10 Feb 2016 10:25:39 -0800 (PST) X-Barracuda-Envelope-From: BATV+379ae17216066e1ae70b+4553+infradead.org+hch@bombadil.srs.infradead.org X-Barracuda-Apparent-Source-IP: 198.137.202.9 Received: from hch by bombadil.infradead.org with local (Exim 4.80.1 #2 (Red Hat Linux)) id 1aTZSM-0004Ad-SP; Wed, 10 Feb 2016 18:25:38 +0000 Date: Wed, 10 Feb 2016 10:25:38 -0800 From: Christoph Hellwig To: Dave Chinner Cc: xfs@oss.sgi.com Subject: Re: [PATCH 0/8 v4] xfs: get rid of xfs_cluster_write Message-ID: <20160210182538.GA7481@infradead.org> X-ASG-Orig-Subj: Re: [PATCH 0/8 v4] xfs: get rid of xfs_cluster_write References: <1455094043-9694-1-git-send-email-david@fromorbit.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1455094043-9694-1-git-send-email-david@fromorbit.com> User-Agent: Mutt/1.5.24 (2015-08-30) X-SRS-Rewrite: SMTP reverse-path rewritten from by bombadil.infradead.org See http://www.infradead.org/rpr.html X-Barracuda-Connect: UNKNOWN[198.137.202.9] X-Barracuda-Start-Time: 1455128739 X-Barracuda-Encrypted: ECDHE-RSA-AES128-GCM-SHA256 X-Barracuda-URL: https://192.48.157.11:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-BRTS-Status: 1 X-Barracuda-Spam-Score: 0.10 X-Barracuda-Spam-Status: No, SCORE=0.10 using per-user scores of TAG_LEVEL=1000.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.7 tests=BSF_SC0_MISMATCH_TO, RDNS_NONE X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.3.26922 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 0.00 BSF_SC0_MISMATCH_TO Envelope rcpt doesn't match header 0.10 RDNS_NONE Delivered to trusted network by a host with no rDNS On Wed, Feb 10, 2016 at 07:47:15PM +1100, Dave Chinner wrote: > of the writepage context. Patches 7 and 8 are new patches (as in the > first time I've posted them) to demonstrate how to remove the IO > completion dependency on recording the bufferehads attached to the > ioend. This is the first step in removing bufferheads from the > writepage IO path - these are FYI patches, not patches I want to > have committed immediately. This looks interesting. I played around with this a bit and ported my patch to embedd the main bio into struct ioend to it. My older version allowed to chain additional bios to get ioends larger than 1MB (or PAGE_SIZE * 256), but that will require additional work in the new completion handler. It does however simplify things quite a bit, and I suspect a lot of that simplification could be kept even with chained bios. I've attached the patch below for reference: diff --git a/fs/xfs/xfs_aops.c b/fs/xfs/xfs_aops.c index a15a032..53c04a2 100644 --- a/fs/xfs/xfs_aops.c +++ b/fs/xfs/xfs_aops.c @@ -111,44 +111,29 @@ next_bh: } while ((bh = bh->b_this_page) != head); } -/* - * We're now finished for good with this ioend structure. Update the page - * state, release holds on bios, and finally free up memory. Do not use the - * ioend after this. - */ STATIC void -xfs_destroy_ioend( - struct xfs_ioend *ioend) +__xfs_end_bio( + struct bio *bio, + int error) { - struct bio *bio, *next; - - for (bio = ioend->io_bio_done; bio; bio = next) { - struct bio_vec *bvec; - int i; - - next = bio->bi_private; - bio->bi_private = NULL; + struct bio_vec *bvec; + int i; - /* walk each page on bio, ending page IO on them */ - bio_for_each_segment_all(bvec, bio, i) { - struct page *page = bvec->bv_page; - unsigned int off, end_off; + /* walk each page on bio, ending page IO on them */ + bio_for_each_segment_all(bvec, bio, i) { + struct page *page = bvec->bv_page; + unsigned int off = bvec->bv_offset; + unsigned int end_off = off + bvec->bv_len - 1; - off = bvec->bv_offset; - end_off = off + bvec->bv_len - 1; - ASSERT(off < PAGE_SIZE); - ASSERT(end_off <= PAGE_SIZE); - xfs_finish_page_writeback(page, off, end_off, - ioend->io_error); + ASSERT(off < PAGE_SIZE); + ASSERT(end_off <= PAGE_SIZE); - } - bio_put(bio); + xfs_finish_page_writeback(page, off, end_off, error); } - mempool_free(ioend, xfs_ioend_pool); + bio_put(bio); } - /* * Fast and loose check if this write could update the on-disk inode size. */ @@ -220,7 +205,8 @@ xfs_setfilesize( STATIC int xfs_setfilesize_ioend( - struct xfs_ioend *ioend) + struct xfs_ioend *ioend, + int error) { struct xfs_inode *ip = XFS_I(ioend->io_inode); struct xfs_trans *tp = ioend->io_append_trans; @@ -234,53 +220,32 @@ xfs_setfilesize_ioend( __sb_writers_acquired(VFS_I(ip)->i_sb, SB_FREEZE_FS); /* we abort the update if there was an IO error */ - if (ioend->io_error) { + if (error) { xfs_trans_cancel(tp); - return ioend->io_error; + return error; } return xfs_setfilesize(ip, tp, ioend->io_offset, ioend->io_size); } /* - * Schedule IO completion handling on the final put of an ioend. - * - * If there is no work to do we might as well call it a day and free the - * ioend right now. - */ -STATIC void -xfs_finish_ioend( - struct xfs_ioend *ioend) -{ - if (atomic_dec_and_test(&ioend->io_remaining)) { - struct xfs_mount *mp = XFS_I(ioend->io_inode)->i_mount; - - if (ioend->io_type == XFS_IO_UNWRITTEN) - queue_work(mp->m_unwritten_workqueue, &ioend->io_work); - else if (ioend->io_append_trans) - queue_work(mp->m_data_workqueue, &ioend->io_work); - else - xfs_destroy_ioend(ioend); - } -} - -/* * IO write completion. */ STATIC void xfs_end_io( struct work_struct *work) { - xfs_ioend_t *ioend = container_of(work, xfs_ioend_t, io_work); - struct xfs_inode *ip = XFS_I(ioend->io_inode); - int error = 0; + struct xfs_ioend *ioend = + container_of(work, struct xfs_ioend, io_work); + struct xfs_inode *ip = XFS_I(ioend->io_inode); + int error = ioend->io_bio.bi_error; /* * Set an error if the mount has shut down and proceed with end I/O * processing so it can perform whatever cleanups are necessary. */ if (XFS_FORCED_SHUTDOWN(ip->i_mount)) - ioend->io_error = -EIO; + error = -EIO; /* * For unwritten extents we need to issue transactions to convert a @@ -290,20 +255,34 @@ xfs_end_io( * on error. */ if (ioend->io_type == XFS_IO_UNWRITTEN) { - if (ioend->io_error) + if (error) goto done; error = xfs_iomap_write_unwritten(ip, ioend->io_offset, ioend->io_size); } else if (ioend->io_append_trans) { - error = xfs_setfilesize_ioend(ioend); + error = xfs_setfilesize_ioend(ioend, error); } else { ASSERT(!xfs_ioend_is_append(ioend)); } done: - if (error) - ioend->io_error = error; - xfs_destroy_ioend(ioend); + __xfs_end_bio(&ioend->io_bio, error); +} + +STATIC void +xfs_end_bio( + struct bio *bio) +{ + struct xfs_ioend *ioend = + container_of(bio, struct xfs_ioend, io_bio); + struct xfs_mount *mp = XFS_I(ioend->io_inode)->i_mount; + + if (ioend->io_type == XFS_IO_UNWRITTEN) + queue_work(mp->m_unwritten_workqueue, &ioend->io_work); + else if (ioend->io_append_trans) + queue_work(mp->m_data_workqueue, &ioend->io_work); + else + __xfs_end_bio(bio, bio->bi_error); } /* @@ -312,27 +291,24 @@ done: * We'll need to extend this for updating the ondisk inode size later * (vs. incore size). */ -STATIC xfs_ioend_t * +STATIC struct xfs_ioend * xfs_alloc_ioend( struct inode *inode, unsigned int type) { - xfs_ioend_t *ioend; + struct xfs_ioend *ioend; + struct bio *bio; - ioend = mempool_alloc(xfs_ioend_pool, GFP_NOFS); - memset(ioend, 0, sizeof(*ioend)); + bio = bio_alloc_bioset(GFP_NOFS, BIO_MAX_PAGES, xfs_ioend_bioset); + bio->bi_end_io = xfs_end_bio; + + ioend = container_of(bio, struct xfs_ioend, io_bio); + memset(ioend, 0, offsetof(struct xfs_ioend, io_bio)); - /* - * Set the count to 1 initially, which will prevent an I/O - * completion callback from happening before we have started - * all the I/O from calling the completion routine too early. - */ - atomic_set(&ioend->io_remaining, 1); INIT_LIST_HEAD(&ioend->io_list); ioend->io_type = type; ioend->io_inode = inode; INIT_WORK(&ioend->io_work, xfs_end_io); - spin_lock_init(&ioend->io_lock); return ioend; } @@ -405,56 +381,6 @@ xfs_imap_valid( offset < imap->br_startoff + imap->br_blockcount; } -/* - * BIO completion handler for buffered IO. - */ -STATIC void -xfs_end_bio( - struct bio *bio) -{ - struct xfs_ioend *ioend = bio->bi_private; - unsigned long flags; - - bio->bi_private = NULL; - bio->bi_end_io = NULL; - - spin_lock_irqsave(&ioend->io_lock, flags); - if (!ioend->io_error) - ioend->io_error = bio->bi_error; - if (!ioend->io_bio_done) - ioend->io_bio_done = bio; - else - ioend->io_bio_done_tail->bi_private = bio; - ioend->io_bio_done_tail = bio; - spin_unlock_irqrestore(&ioend->io_lock, flags); - - xfs_finish_ioend(ioend); -} - -STATIC void -xfs_submit_ioend_bio( - struct writeback_control *wbc, - xfs_ioend_t *ioend, - struct bio *bio) -{ - atomic_inc(&ioend->io_remaining); - bio->bi_private = ioend; - bio->bi_end_io = xfs_end_bio; - submit_bio(wbc->sync_mode == WB_SYNC_ALL ? WRITE_SYNC : WRITE, bio); -} - -STATIC struct bio * -xfs_alloc_ioend_bio( - struct buffer_head *bh) -{ - struct bio *bio = bio_alloc(GFP_NOIO, BIO_MAX_PAGES); - - ASSERT(bio->bi_private == NULL); - bio->bi_iter.bi_sector = bh->b_blocknr * (bh->b_size >> 9); - bio->bi_bdev = bh->b_bdev; - return bio; -} - STATIC void xfs_start_buffer_writeback( struct buffer_head *bh) @@ -520,10 +446,10 @@ static inline int xfs_bio_add_buffer(struct bio *bio, struct buffer_head *bh) STATIC int xfs_submit_ioend( struct writeback_control *wbc, - xfs_ioend_t *ioend, + struct xfs_ioend *ioend, int fail) { - if (!ioend->io_bio || fail) + if (fail) goto error_finish; /* Reserve log space if we might write beyond the on-disk inode size. */ @@ -534,9 +460,8 @@ xfs_submit_ioend( goto error_finish; } - xfs_submit_ioend_bio(wbc, ioend, ioend->io_bio); - ioend->io_bio = NULL; - xfs_finish_ioend(ioend); + submit_bio(wbc->sync_mode == WB_SYNC_ALL ? WRITE_SYNC : WRITE, + &ioend->io_bio); return 0; /* @@ -546,10 +471,8 @@ xfs_submit_ioend( * at this point in time. */ error_finish: - if (ioend->io_bio) - bio_put(ioend->io_bio); - ioend->io_error = fail; - xfs_finish_ioend(ioend); + ioend->io_bio.bi_error = fail; + bio_endio(&ioend->io_bio); return fail; } @@ -573,23 +496,22 @@ xfs_add_to_ioend( if (!ioend || wpc->io_type != ioend->io_type || bh->b_blocknr != wpc->last_block + 1) { +retry: prev = ioend; + ioend = xfs_alloc_ioend(inode, wpc->io_type); ioend->io_offset = offset; + + ioend->io_bio.bi_iter.bi_sector = + bh->b_blocknr * (bh->b_size >> 9); + ioend->io_bio.bi_bdev = bh->b_bdev; + wpc->ioend = ioend; } - bh->b_private = NULL; /* add the bh to the current bio */ -retry: - if (!ioend->io_bio) - ioend->io_bio = xfs_alloc_ioend_bio(bh); - - if (xfs_bio_add_buffer(ioend->io_bio, bh) != bh->b_size) { - xfs_submit_ioend_bio(wbc, ioend, ioend->io_bio); - ioend->io_bio = NULL; + if (xfs_bio_add_buffer(&ioend->io_bio, bh) != bh->b_size) goto retry; - } ioend->io_size += bh->b_size; wpc->last_block = bh->b_blocknr; diff --git a/fs/xfs/xfs_aops.h b/fs/xfs/xfs_aops.h index aaa74cb..acc5716 100644 --- a/fs/xfs/xfs_aops.h +++ b/fs/xfs/xfs_aops.h @@ -18,7 +18,7 @@ #ifndef __XFS_AOPS_H__ #define __XFS_AOPS_H__ -extern mempool_t *xfs_ioend_pool; +extern struct bio_set *xfs_ioend_bioset; /* * Types of I/O for bmap clustering and I/O completion tracking. @@ -35,24 +35,18 @@ enum { { XFS_IO_OVERWRITE, "overwrite" } /* - * xfs_ioend struct manages large extent writes for XFS. - * It can manage several multi-page bio's at once. + * Structure for buffered I/O completions. */ -typedef struct xfs_ioend { +struct xfs_ioend { struct list_head io_list; /* next ioend in chain */ unsigned int io_type; /* delalloc / unwritten */ - int io_error; /* I/O error code */ - atomic_t io_remaining; /* hold count */ struct inode *io_inode; /* file being written to */ size_t io_size; /* size of the extent */ xfs_off_t io_offset; /* offset in the file */ struct work_struct io_work; /* xfsdatad work queue */ struct xfs_trans *io_append_trans;/* xact. for size update */ - struct bio *io_bio; /* bio being built */ - struct bio *io_bio_done; /* bios completed */ - struct bio *io_bio_done_tail; /* bios completed */ - spinlock_t io_lock; /* for bio completion list */ -} xfs_ioend_t; + struct bio io_bio; +}; extern const struct address_space_operations xfs_address_space_operations; diff --git a/fs/xfs/xfs_super.c b/fs/xfs/xfs_super.c index 59c9b7b..725c36c 100644 --- a/fs/xfs/xfs_super.c +++ b/fs/xfs/xfs_super.c @@ -57,8 +57,7 @@ #include static const struct super_operations xfs_super_operations; -static kmem_zone_t *xfs_ioend_zone; -mempool_t *xfs_ioend_pool; +struct bio_set *xfs_ioend_bioset; static struct kset *xfs_kset; /* top-level xfs sysfs dir */ #ifdef DEBUG @@ -1646,20 +1645,15 @@ MODULE_ALIAS_FS("xfs"); STATIC int __init xfs_init_zones(void) { - - xfs_ioend_zone = kmem_zone_init(sizeof(xfs_ioend_t), "xfs_ioend"); - if (!xfs_ioend_zone) + xfs_ioend_bioset = bioset_create(4 * MAX_BUF_PER_PAGE, + offsetof(struct xfs_ioend, io_bio)); + if (!xfs_ioend_bioset) goto out; - xfs_ioend_pool = mempool_create_slab_pool(4 * MAX_BUF_PER_PAGE, - xfs_ioend_zone); - if (!xfs_ioend_pool) - goto out_destroy_ioend_zone; - xfs_log_ticket_zone = kmem_zone_init(sizeof(xlog_ticket_t), "xfs_log_ticket"); if (!xfs_log_ticket_zone) - goto out_destroy_ioend_pool; + goto out_free_ioend_bioset; xfs_bmap_free_item_zone = kmem_zone_init(sizeof(xfs_bmap_free_item_t), "xfs_bmap_free_item"); @@ -1755,10 +1749,8 @@ xfs_init_zones(void) kmem_zone_destroy(xfs_bmap_free_item_zone); out_destroy_log_ticket_zone: kmem_zone_destroy(xfs_log_ticket_zone); - out_destroy_ioend_pool: - mempool_destroy(xfs_ioend_pool); - out_destroy_ioend_zone: - kmem_zone_destroy(xfs_ioend_zone); + out_free_ioend_bioset: + bioset_free(xfs_ioend_bioset); out: return -ENOMEM; } @@ -1784,9 +1776,7 @@ xfs_destroy_zones(void) kmem_zone_destroy(xfs_btree_cur_zone); kmem_zone_destroy(xfs_bmap_free_item_zone); kmem_zone_destroy(xfs_log_ticket_zone); - mempool_destroy(xfs_ioend_pool); - kmem_zone_destroy(xfs_ioend_zone); - + bioset_free(xfs_ioend_bioset); } STATIC int __init From mguzik@redhat.com Wed Feb 10 12:35:46 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=ham version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay1.corp.sgi.com [137.38.102.111]) by oss.sgi.com (Postfix) with ESMTP id 705B37CA4 for ; Wed, 10 Feb 2016 12:35:46 -0600 (CST) Received: from cuda.sgi.com (cuda3.sgi.com [192.48.176.15]) by relay1.corp.sgi.com (Postfix) with ESMTP id 65CC68F804C for ; Wed, 10 Feb 2016 10:35:43 -0800 (PST) X-ASG-Debug-ID: 1455129341-04cb6c1e58461b0001-NocioJ Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by cuda.sgi.com with ESMTP id dTFHk73dLcrzTObs (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO) for ; Wed, 10 Feb 2016 10:35:42 -0800 (PST) X-Barracuda-Envelope-From: mguzik@redhat.com X-Barracuda-Apparent-Source-IP: 209.132.183.28 X-ASG-Whitelist: Client Received: from int-mx13.intmail.prod.int.phx2.redhat.com (int-mx13.intmail.prod.int.phx2.redhat.com [10.5.11.26]) by mx1.redhat.com (Postfix) with ESMTPS id 65926C0C2345; Wed, 10 Feb 2016 18:35:41 +0000 (UTC) Received: from mguzik.localdomain (ovpn-116-31.ams2.redhat.com [10.36.116.31]) by int-mx13.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id u1AIZcQd005153; Wed, 10 Feb 2016 13:35:39 -0500 From: Mateusz Guzik To: xfs@oss.sgi.com Cc: Subject: [PATCH] xfs: fix two memory leaks in xfs_attr_list.c error paths Date: Wed, 10 Feb 2016 19:35:37 +0100 X-ASG-Orig-Subj: [PATCH] xfs: fix two memory leaks in xfs_attr_list.c error paths Message-Id: <1455129337-19255-1-git-send-email-mguzik@redhat.com> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.26 X-Barracuda-Connect: mx1.redhat.com[209.132.183.28] X-Barracuda-Start-Time: 1455129342 X-Barracuda-Encrypted: ECDHE-RSA-AES256-GCM-SHA384 X-Barracuda-URL: https://192.48.176.15:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-BRTS-Status: 1 This plugs 2 trivial leaks in xfs_attr_shortform_list and xfs_attr3_leaf_list_int. Signed-off-by: Mateusz Guzik Cc: --- fs/xfs/xfs_attr_list.c | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/fs/xfs/xfs_attr_list.c b/fs/xfs/xfs_attr_list.c index 0ef7c2e..4fa1482 100644 --- a/fs/xfs/xfs_attr_list.c +++ b/fs/xfs/xfs_attr_list.c @@ -202,8 +202,10 @@ xfs_attr_shortform_list(xfs_attr_list_context_t *context) sbp->namelen, sbp->valuelen, &sbp->name[sbp->namelen]); - if (error) + if (error) { + kmem_free(sbuf); return error; + } if (context->seen_enough) break; cursor->offset++; @@ -454,14 +456,13 @@ xfs_attr3_leaf_list_int( args.rmtblkcnt = xfs_attr3_rmt_blocks( args.dp->i_mount, valuelen); retval = xfs_attr_rmtval_get(&args); - if (retval) - return retval; - retval = context->put_listent(context, - entry->flags, - name_rmt->name, - (int)name_rmt->namelen, - valuelen, - args.value); + if (!retval) + retval = context->put_listent(context, + entry->flags, + name_rmt->name, + (int)name_rmt->namelen, + valuelen, + args.value); kmem_free(args.value); } else { retval = context->put_listent(context, -- 1.8.3.1 From billodo@redhat.com Wed Feb 10 12:50:25 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=ham version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay2.corp.sgi.com [137.38.102.29]) by oss.sgi.com (Postfix) with ESMTP id 3DB937CA6 for ; Wed, 10 Feb 2016 12:50:25 -0600 (CST) Received: from cuda.sgi.com (cuda2.sgi.com [192.48.176.25]) by relay2.corp.sgi.com (Postfix) with ESMTP id 25090304043 for ; Wed, 10 Feb 2016 10:50:22 -0800 (PST) X-ASG-Debug-ID: 1455130220-04cbb043315f010001-NocioJ Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by cuda.sgi.com with ESMTP id lWPtxctJhi2ctKfD (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO) for ; Wed, 10 Feb 2016 10:50:20 -0800 (PST) X-Barracuda-Envelope-From: billodo@redhat.com X-Barracuda-Apparent-Source-IP: 209.132.183.28 X-ASG-Whitelist: Client Received: from int-mx10.intmail.prod.int.phx2.redhat.com (int-mx10.intmail.prod.int.phx2.redhat.com [10.5.11.23]) by mx1.redhat.com (Postfix) with ESMTPS id 1EF9BC60EB for ; Wed, 10 Feb 2016 18:50:19 +0000 (UTC) Received: from localhost.localdomain.com (vpn-57-23.rdu2.redhat.com [10.10.57.23]) by int-mx10.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id u1AIoJKd013703 for ; Wed, 10 Feb 2016 13:50:19 -0500 From: "Bill O'Donnell" To: xfs@oss.sgi.com Subject: [PATCH 2/2 v3] xfs_repair: new secondary superblock search method Date: Wed, 10 Feb 2016 12:50:18 -0600 X-ASG-Orig-Subj: [PATCH 2/2 v3] xfs_repair: new secondary superblock search method Message-Id: <1455130218-8683-1-git-send-email-billodo@redhat.com> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.23 X-Barracuda-Connect: mx1.redhat.com[209.132.183.28] X-Barracuda-Start-Time: 1455130220 X-Barracuda-Encrypted: ECDHE-RSA-AES256-GCM-SHA384 X-Barracuda-URL: https://192.48.176.25:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-BRTS-Status: 1 Optimize secondary sb search, using similar method to find fs geometry as that of xfs_mkfs. If this faster method fails in finding a secondary sb, fall back to original brute force slower search. Signed-off-by: Bill O'Donnell --- Makefile | 2 +- include/libxcmd.h | 4 +++- libxcmd/topology.c | 36 ++++++++++++++++++++++++++++++++---- repair/Makefile | 4 ++-- repair/sb.c | 50 +++++++++++++++++++++++++++++++++++++++++--------- 5 files changed, 79 insertions(+), 17 deletions(-) diff --git a/Makefile b/Makefile index fca0a42..1d60d9c 100644 --- a/Makefile +++ b/Makefile @@ -80,7 +80,7 @@ fsr: libhandle growfs: libxcmd io: libxcmd libhandle quota: libxcmd -repair: libxlog +repair: libxlog libxcmd copy: libxlog ifeq ($(HAVE_BUILDDEFS), yes) diff --git a/include/libxcmd.h b/include/libxcmd.h index df7046e..b140adb 100644 --- a/include/libxcmd.h +++ b/include/libxcmd.h @@ -50,6 +50,8 @@ extern int check_overwrite( char *device); - +extern int guess_default_geometry(__uint64_t *agsize, + __uint64_t *agcount, + libxfs_init_t x); #endif /* __LIBXCMD_H__ */ diff --git a/libxcmd/topology.c b/libxcmd/topology.c index 0eeea28..5f06be5 100644 --- a/libxcmd/topology.c +++ b/libxcmd/topology.c @@ -192,7 +192,8 @@ out: return ret; } -static void blkid_get_topology( +static void +blkid_get_topology( const char *device, int *sunit, int *swidth, @@ -284,7 +285,8 @@ check_overwrite( return 1; } -static void blkid_get_topology( +static void +blkid_get_topology( const char *device, int *sunit, int *swidth, @@ -302,8 +304,8 @@ static void blkid_get_topology( #endif /* ENABLE_BLKID */ - -void get_topology( +void +get_topology( libxfs_init_t *xi, struct fs_topology *ft, int force_overwrite) @@ -346,3 +348,29 @@ void get_topology( &lsectorsize, &psectorsize, force_overwrite); } } + +int +guess_default_geometry( + __uint64_t *agsize, __uint64_t *agcount, + libxfs_init_t x) +{ + struct fs_topology ft; + int blocklog; + __uint64_t dblocks; + int multidisk; + + memset(&ft, 0, sizeof(ft)); + get_topology(&x, &ft, 1); + + /* + * get geometry from get_topology result. + * Use default block size (2^12) + */ + blocklog = 12; + multidisk = ft.dswidth | ft.dsunit; + dblocks = x.dsize >> (blocklog - BBSHIFT); + calc_default_ag_geometry(blocklog, dblocks, multidisk, + agsize, agcount); + + return blocklog; +} diff --git a/repair/Makefile b/repair/Makefile index 251722b..d24ab1f 100644 --- a/repair/Makefile +++ b/repair/Makefile @@ -20,8 +20,8 @@ CFILES = agheader.c attr_repair.c avl.c avl64.c bmap.c btree.c \ progress.c prefetch.c rt.c sb.c scan.c threads.c \ versions.c xfs_repair.c -LLDLIBS = $(LIBXFS) $(LIBXLOG) $(LIBUUID) $(LIBRT) $(LIBPTHREAD) -LTDEPENDENCIES = $(LIBXFS) $(LIBXLOG) +LLDLIBS = $(LIBBLKID) $(LIBXFS) $(LIBXLOG) $(LIBUUID) $(LIBRT) $(LIBPTHREAD) $(LIBXCMD) +LTDEPENDENCIES = $(LIBXFS) $(LIBXLOG) $(LIBXCMD) LLDFLAGS = -static-libtool-libs default: depend $(LTCOMMAND) diff --git a/repair/sb.c b/repair/sb.c index 4eef14a..d91990a 100644 --- a/repair/sb.c +++ b/repair/sb.c @@ -17,6 +17,7 @@ */ #include "libxfs.h" +#include "libxcmd.h" #include "libxlog.h" #include "agheader.h" #include "globals.h" @@ -85,10 +86,15 @@ copy_sb(xfs_sb_t *source, xfs_sb_t *dest) } /* - * find a secondary superblock, copy it into the sb buffer + * find a secondary superblock, copy it into the sb buffer. + * start is the point to begin reading BSIZE bytes. + * skip contains a byte-count of how far to advance for next read. */ -int -find_secondary_sb(xfs_sb_t *rsb) +static int +__find_secondary_sb( + xfs_sb_t *rsb, + __uint64_t start, + __uint64_t skip) { xfs_off_t off; xfs_sb_t *sb; @@ -101,7 +107,6 @@ find_secondary_sb(xfs_sb_t *rsb) int bsize; do_warn(_("\nattempting to find secondary superblock...\n")); - sb = (xfs_sb_t *)memalign(libxfs_device_alignment(), BSIZE); if (!sb) { do_error( @@ -117,7 +122,7 @@ find_secondary_sb(xfs_sb_t *rsb) /* * skip first sector since we know that's bad */ - for (done = 0, off = XFS_AG_MIN_BYTES; !done ; off += bsize) { + for (done = 0, off = start; !done ; off += skip) { /* * read disk 1 MByte at a time. */ @@ -128,9 +133,7 @@ find_secondary_sb(xfs_sb_t *rsb) if (!done && (bsize = read(x.dfd, sb, BSIZE)) <= 0) { done = 1; } - do_warn("."); - /* * check the buffer 512 bytes at a time since * we don't know how big the sectors really are. @@ -164,9 +167,38 @@ find_secondary_sb(xfs_sb_t *rsb) } } } - free(sb); - return(retval); + return retval; +} + +int +find_secondary_sb(xfs_sb_t *rsb) +{ + int retval; + __uint64_t agcount; + __uint64_t agsize; + __uint64_t skip; + int blocklog; + + /* + * Attempt to find secondary sb with a coarse approach, + * using a large skip (agsize in bytes). Failing that, + * fallback to the fine-grained approach using min agsize. + */ + blocklog = guess_default_geometry(&agsize, &agcount, x); + + /* + * use found ag geometry to quickly find secondary sb + */ + skip = agsize << blocklog; + retval = __find_secondary_sb(rsb, skip, skip); + if (!retval) { + /* + * fallback: use minimum agsize for skipsize + */ + retval = __find_secondary_sb(rsb, XFS_AG_MIN_BYTES, BSIZE); + } + return retval; } /* -- 2.5.0 From BATV+379ae17216066e1ae70b+4553+infradead.org+hch@bombadil.srs.infradead.org Wed Feb 10 13:07:43 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=ham version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay1.corp.sgi.com [137.38.102.111]) by oss.sgi.com (Postfix) with ESMTP id C53797CA8 for ; Wed, 10 Feb 2016 13:07:43 -0600 (CST) Received: from cuda.sgi.com (cuda2.sgi.com [192.48.176.25]) by relay1.corp.sgi.com (Postfix) with ESMTP id AE07C8F8050 for ; Wed, 10 Feb 2016 11:07:40 -0800 (PST) X-ASG-Debug-ID: 1455131258-04cbb043335f590001-NocioJ Received: from bombadil.infradead.org ([198.137.202.9]) by cuda.sgi.com with ESMTP id bcHripAoJA0JWVaP (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128 verify=NO) for ; Wed, 10 Feb 2016 11:07:39 -0800 (PST) X-Barracuda-Envelope-From: BATV+379ae17216066e1ae70b+4553+infradead.org+hch@bombadil.srs.infradead.org X-Barracuda-Apparent-Source-IP: 198.137.202.9 Received: from hch by bombadil.infradead.org with local (Exim 4.80.1 #2 (Red Hat Linux)) id 1aTa70-0005PZ-BP; Wed, 10 Feb 2016 19:07:38 +0000 Date: Wed, 10 Feb 2016 11:07:38 -0800 From: Christoph Hellwig To: "Darrick J. Wong" Cc: Dave Chinner , xfs@oss.sgi.com Subject: Re: block allocations for the refcount btree Message-ID: <20160210190738.GA13051@infradead.org> X-ASG-Orig-Subj: Re: block allocations for the refcount btree References: <20160210093011.GA19147@infradead.org> <20160210095010.GC23904@birch.djwong.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20160210095010.GC23904@birch.djwong.org> User-Agent: Mutt/1.5.24 (2015-08-30) X-SRS-Rewrite: SMTP reverse-path rewritten from by bombadil.infradead.org See http://www.infradead.org/rpr.html X-Barracuda-Connect: UNKNOWN[198.137.202.9] X-Barracuda-Start-Time: 1455131259 X-Barracuda-Encrypted: ECDHE-RSA-AES128-GCM-SHA256 X-Barracuda-URL: https://192.48.176.25:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-BRTS-Status: 1 X-Barracuda-Spam-Score: 0.10 X-Barracuda-Spam-Status: No, SCORE=0.10 using per-user scores of TAG_LEVEL=1000.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.7 tests=BSF_SC0_MISMATCH_TO, RDNS_NONE X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.3.26922 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 0.00 BSF_SC0_MISMATCH_TO Envelope rcpt doesn't match header 0.10 RDNS_NONE Delivered to trusted network by a host with no rDNS On Wed, Feb 10, 2016 at 01:50:10AM -0800, Darrick J. Wong wrote: > That's odd... I'd have thought that the AG reservation would always be able > to handle a refcount btree expansion, since it calculates how many blocks > are needed to handle the worst case of 1 record per extent. There's also > a bug where we undercount the number of blocks already used, so it should > have an extra big reservation. > > OTOH I've seen occasional ENOSPCs in generic/186 and generic/168 too, so I > guess something's going wrong. Maybe the xfs_ag_resv* tracepoints can help? I'm not seeing an ENOSPC, I run into: [ 640.924891] XFS: Assertion failed: tp->t_blk_res_used <= tp->t_blk_res, file: fs/xfs/xfs_trans.c, line: 315 Which asserts that the current transaction is using up more blocks from its reservation than it reserved. The AG reservation seems to operate on a different level than that. From darrick.wong@oracle.com Wed Feb 10 13:19:02 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay3.corp.sgi.com [198.149.34.15]) by oss.sgi.com (Postfix) with ESMTP id BE7907CAA for ; Wed, 10 Feb 2016 13:19:02 -0600 (CST) Received: from cuda.sgi.com (cuda2.sgi.com [192.48.176.25]) by relay3.corp.sgi.com (Postfix) with ESMTP id 5B4BFAC002 for ; Wed, 10 Feb 2016 11:18:59 -0800 (PST) X-ASG-Debug-ID: 1455131933-04cbb043315f970001-NocioJ Received: from aserp1040.oracle.com (aserp1040.oracle.com [141.146.126.69]) by cuda.sgi.com with ESMTP id Ir5CCVrsmk6RU1Zg (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO) for ; Wed, 10 Feb 2016 11:18:53 -0800 (PST) X-Barracuda-Envelope-From: darrick.wong@oracle.com X-Barracuda-Apparent-Source-IP: 141.146.126.69 Received: from aserv0021.oracle.com (aserv0021.oracle.com [141.146.126.233]) by aserp1040.oracle.com (Sentrion-MTA-4.3.2/Sentrion-MTA-4.3.2) with ESMTP id u1AJIpP2014564 (version=TLSv1 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Wed, 10 Feb 2016 19:18:51 GMT Received: from userv0122.oracle.com (userv0122.oracle.com [156.151.31.75]) by aserv0021.oracle.com (8.13.8/8.13.8) with ESMTP id u1AJIp0W003402 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=FAIL); Wed, 10 Feb 2016 19:18:51 GMT Received: from abhmp0007.oracle.com (abhmp0007.oracle.com [141.146.116.13]) by userv0122.oracle.com (8.14.4/8.14.4) with ESMTP id u1AJIoDX027520; Wed, 10 Feb 2016 19:18:50 GMT Received: from localhost (/24.21.154.84) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Wed, 10 Feb 2016 11:18:50 -0800 Date: Wed, 10 Feb 2016 11:18:48 -0800 From: "Darrick J. Wong" To: lsf-pc@lists.linux-foundation.org Cc: xfs , linux-fsdevel , linux-ext4 , linux-btrfs , ocfs2-devel@oss.oracle.com Subject: [LFS/MM TOPIC] fs reflink issues, fs online scrub/check, etc Message-ID: <20160210191848.GC6346@birch.djwong.org> X-ASG-Orig-Subj: [LFS/MM TOPIC] fs reflink issues, fs online scrub/check, etc References: <20160210191715.GB6339@birch.djwong.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20160210191715.GB6339@birch.djwong.org> User-Agent: Mutt/1.5.21 (2010-09-15) X-Source-IP: aserv0021.oracle.com [141.146.126.233] X-Barracuda-Connect: aserp1040.oracle.com[141.146.126.69] X-Barracuda-Start-Time: 1455131933 X-Barracuda-Encrypted: ECDHE-RSA-AES256-GCM-SHA384 X-Barracuda-URL: https://192.48.176.25:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-BRTS-Status: 1 X-Barracuda-Spam-Score: 0.00 X-Barracuda-Spam-Status: No, SCORE=0.00 using per-user scores of TAG_LEVEL=1000.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.7 tests=BSF_SC0_MISMATCH_TO, UNPARSEABLE_RELAY X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.3.26923 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 0.00 BSF_SC0_MISMATCH_TO Envelope rcpt doesn't match header 0.00 UNPARSEABLE_RELAY Informational: message has unparseable relay lines [resend, email exploded, sorry...] Hi, I want to discuss a few FS related topics that I haven't already seen on the mailing lists: * Shared pagecache pages for reflinked files (and by extension making dax work with reflink on xfs) * Providing a simple interface for scrubbing filesystem metadata in the background (the online check thing). Ideally we'd make it easy to discover what kind of metadata there is to check and provide a simple interface to check the metadata, once discovered. This is a tricky interface topic since FS design differs pretty widely. * Rudimentary online repair and rebuilding (xfs) from secondary metadata * Working out the variances in the btrfs/xfs/ocfs2/nfs reflink implementations and making sure they all get test coverage I would also like participate in some of the proposed discussions: * The ext4 summit (and whatever meeting of XFS devs may happen) * Integrating existing filesystems into pmem, or hallway bofs about designing new filesystems for pmem * Actually seeing the fs developers (well, everyone!) in person again :) --Darrick From bfields@fieldses.org Wed Feb 10 13:34:07 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=ham version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay1.corp.sgi.com [137.38.102.111]) by oss.sgi.com (Postfix) with ESMTP id 647967CAC for ; Wed, 10 Feb 2016 13:34:07 -0600 (CST) Received: from cuda.sgi.com (cuda1.sgi.com [192.48.157.11]) by relay1.corp.sgi.com (Postfix) with ESMTP id 23DD68F8052 for ; Wed, 10 Feb 2016 11:34:06 -0800 (PST) X-ASG-Debug-ID: 1455132844-04bdf066eb4bae0001-NocioJ Received: from fieldses.org (fieldses.org [173.255.197.46]) by cuda.sgi.com with ESMTP id cDwZ5J0IivgZZOPc for ; Wed, 10 Feb 2016 11:34:04 -0800 (PST) X-Barracuda-Envelope-From: bfields@fieldses.org X-Barracuda-Apparent-Source-IP: 173.255.197.46 Received: by fieldses.org (Postfix, from userid 2815) id 13DC31C5A; Wed, 10 Feb 2016 14:34:04 -0500 (EST) Date: Wed, 10 Feb 2016 14:34:04 -0500 From: "J. Bruce Fields" To: "Michael Kerrisk (man-pages)" Cc: Andreas Gruenbacher , linux-ext4@vger.kernel.org, xfs@oss.sgi.com, lkml , linux-fsdevel@vger.kernel.org, linux-nfs@vger.kernel.org, linux-cifs@vger.kernel.org, Linux API , Dave Chinner , Christoph Hellwig , Anna Schumaker , Trond Myklebust , Jeff Layton , Andreas Dilger Subject: Re: richacl(7) man page review comments Message-ID: <20160210193404.GA13989@fieldses.org> X-ASG-Orig-Subj: Re: richacl(7) man page review comments References: <56B770B6.7040803@gmail.com> <56B77262.7090107@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <56B77262.7090107@gmail.com> User-Agent: Mutt/1.5.21 (2010-09-15) X-Barracuda-Connect: fieldses.org[173.255.197.46] X-Barracuda-Start-Time: 1455132844 X-Barracuda-URL: https://192.48.157.11:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-BRTS-Status: 1 X-Barracuda-Spam-Score: 0.00 X-Barracuda-Spam-Status: No, SCORE=0.00 using per-user scores of TAG_LEVEL=1000.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.7 tests=BSF_SC0_MISMATCH_TO X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.3.26923 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 0.00 BSF_SC0_MISMATCH_TO Envelope rcpt doesn't match header On Sun, Feb 07, 2016 at 05:35:46PM +0100, Michael Kerrisk (man-pages) wrote: > > This permission is always implicitly granted. > > .HP > > .B write_attributes > > .RB ( A ): > > Change the times associated with a file or directory to an arbitrary value. > > This permission is always implicitly granted to the file owner. > > .HP > > .B read_acl > > .RB ( c ): > > Read the ACL of a file or directory. This permission is always > > implicitly granted. > > .HP > > .B write_acl > > .RB ( C ): > > Change the ACL or file mode of a file or directory. > > .HP > > .B write_owner > > .RB ( o ): > > Take ownership of a file or directory. Change the owning group of a file or > > directory to a group of which the calling process is a member. > > .HP > > .B read_named_attrs > > .RB ( R ), > > .B write_named_attrs > > .RB ( W ), > > .B synchronize > > .RB ( S ), > > .B write_retention > > .RB ( e ), > > .B write_retention_hold > > .RB ( E ): > > These permissions can be stored, but do not have a local meaning. > > So, I thenk that a sentence here should explain why these permissions > exist. Is if for future extension, because they are meaningful in NFS, > or something else? Yeah, "synchronize" is something only Windows clients care about, as I understand it. The others are for NFS features that nobody has tried to implement yet. It's useful to store those bits but they don't do anything at this point. We could provie FC references, I guess, but it's probably not worth going into much detail about. > > Automatic Inheritance allows permission changes to propagate from a directory > > to files and subdirectories inside that directory, recursively. Carrying out > > this propagation of permissions is the responsibility of the process changing > > the directory permissions (usually, setrichacl(1)). > > I'm confused by the previous sentence. the feature is labeled "Automatic > Inheritance", implying that the user/process need do nothing. The next > sentence says "propagation ... is the responsibility of the process". > These two points seem contradictory. I think something more needs to be > said here. Yeah, the "automatic" name is probably misleading, but I think we're stuck with that name and just need to make the point a bit more forcefully. Userland utilities take responsibility for the actual recursive propagation of changes, all the kernel does is provide a few bits which help to do it correctly (e.g. to distinguish between ACEs that ewre inherited inherited (and can be blown away by propagation) and those that were added locally). --b. From sandeen@sandeen.net Wed Feb 10 14:38:32 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=ham version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay1.corp.sgi.com [137.38.102.111]) by oss.sgi.com (Postfix) with ESMTP id 6190B7CAE for ; Wed, 10 Feb 2016 14:38:32 -0600 (CST) Received: from cuda.sgi.com (cuda3.sgi.com [192.48.176.15]) by relay1.corp.sgi.com (Postfix) with ESMTP id 550648F8059 for ; Wed, 10 Feb 2016 12:38:32 -0800 (PST) X-ASG-Debug-ID: 1455136705-04cb6c1e5848970001-NocioJ Received: from sandeen.net (sandeen.net [63.231.237.45]) by cuda.sgi.com with ESMTP id Qm5SgjpFOCFcAtTT for ; Wed, 10 Feb 2016 12:38:26 -0800 (PST) X-Barracuda-Envelope-From: sandeen@sandeen.net X-Barracuda-Apparent-Source-IP: 63.231.237.45 Received: from liberator.sandeen.net (liberator.sandeen.net [10.0.0.4]) (using TLSv1.2 with cipher DHE-RSA-AES128-SHA (128/128 bits)) (No client certificate requested) by sandeen.net (Postfix) with ESMTPSA id B299663C607A for ; Wed, 10 Feb 2016 14:38:25 -0600 (CST) Subject: Re: [PATCH] xfs: fix two memory leaks in xfs_attr_list.c error paths To: xfs@oss.sgi.com X-ASG-Orig-Subj: Re: [PATCH] xfs: fix two memory leaks in xfs_attr_list.c error paths References: <1455129337-19255-1-git-send-email-mguzik@redhat.com> From: Eric Sandeen Message-ID: <56BB9FC0.1080202@sandeen.net> Date: Wed, 10 Feb 2016 14:38:24 -0600 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.11; rv:38.0) Gecko/20100101 Thunderbird/38.5.1 MIME-Version: 1.0 In-Reply-To: <1455129337-19255-1-git-send-email-mguzik@redhat.com> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit X-Barracuda-Connect: sandeen.net[63.231.237.45] X-Barracuda-Start-Time: 1455136706 X-Barracuda-URL: https://192.48.176.15:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-BRTS-Status: 1 X-Barracuda-Spam-Score: 0.00 X-Barracuda-Spam-Status: No, SCORE=0.00 using per-user scores of TAG_LEVEL=1000.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.7 tests= X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.3.26924 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- On 2/10/16 12:35 PM, Mateusz Guzik wrote: > This plugs 2 trivial leaks in xfs_attr_shortform_list and > xfs_attr3_leaf_list_int. > > Signed-off-by: Mateusz Guzik > Cc: Looks good (tho I wonder why coverity didn't spot...) Reviewed-by: Eric Sandeen > > --- > fs/xfs/xfs_attr_list.c | 19 ++++++++++--------- > 1 file changed, 10 insertions(+), 9 deletions(-) > > diff --git a/fs/xfs/xfs_attr_list.c b/fs/xfs/xfs_attr_list.c > index 0ef7c2e..4fa1482 100644 > --- a/fs/xfs/xfs_attr_list.c > +++ b/fs/xfs/xfs_attr_list.c > @@ -202,8 +202,10 @@ xfs_attr_shortform_list(xfs_attr_list_context_t *context) > sbp->namelen, > sbp->valuelen, > &sbp->name[sbp->namelen]); > - if (error) > + if (error) { > + kmem_free(sbuf); > return error; > + } > if (context->seen_enough) > break; > cursor->offset++; > @@ -454,14 +456,13 @@ xfs_attr3_leaf_list_int( > args.rmtblkcnt = xfs_attr3_rmt_blocks( > args.dp->i_mount, valuelen); > retval = xfs_attr_rmtval_get(&args); > - if (retval) > - return retval; > - retval = context->put_listent(context, > - entry->flags, > - name_rmt->name, > - (int)name_rmt->namelen, > - valuelen, > - args.value); > + if (!retval) > + retval = context->put_listent(context, > + entry->flags, > + name_rmt->name, > + (int)name_rmt->namelen, > + valuelen, > + args.value); > kmem_free(args.value); > } else { > retval = context->put_listent(context, > From ross.zwisler@linux.intel.com Wed Feb 10 14:49:17 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=ham version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay1.corp.sgi.com [137.38.102.111]) by oss.sgi.com (Postfix) with ESMTP id 801DB7CB0 for ; Wed, 10 Feb 2016 14:49:17 -0600 (CST) Received: from cuda.sgi.com (cuda2.sgi.com [192.48.176.25]) by relay1.corp.sgi.com (Postfix) with ESMTP id 7443D8F8033 for ; Wed, 10 Feb 2016 12:49:17 -0800 (PST) X-ASG-Debug-ID: 1455137356-04cbb0433261bb0001-NocioJ Received: from mga11.intel.com ([192.55.52.93]) by cuda.sgi.com with ESMTP id TXPVbDPvxGEv49Wk for ; Wed, 10 Feb 2016 12:49:16 -0800 (PST) X-Barracuda-Envelope-From: ross.zwisler@linux.intel.com X-Barracuda-Apparent-Source-IP: 192.55.52.93 X-ASG-Whitelist: Client Received: from orsmga001.jf.intel.com ([10.7.209.18]) by fmsmga102.fm.intel.com with ESMTP; 10 Feb 2016 12:49:16 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.22,427,1449561600"; d="scan'208";a="881530460" Received: from rzwisler-desk.amr.corp.intel.com (HELO phyrexia.intel.com) ([10.252.193.228]) by orsmga001.jf.intel.com with ESMTP; 10 Feb 2016 12:49:15 -0800 From: Ross Zwisler To: linux-kernel@vger.kernel.org Cc: Ross Zwisler , "Theodore Ts'o" , Alexander Viro , Andreas Dilger , Andrew Morton , Dan Williams , Dave Chinner , Jan Kara , Matthew Wilcox , linux-ext4@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux-mm@kvack.org, linux-nvdimm@lists.01.org, xfs@oss.sgi.com Subject: [PATCH v2 0/2] DAX bdev fixes - move flushing calls to FS Date: Wed, 10 Feb 2016 13:48:54 -0700 X-ASG-Orig-Subj: [PATCH v2 0/2] DAX bdev fixes - move flushing calls to FS Message-Id: <1455137336-28720-1-git-send-email-ross.zwisler@linux.intel.com> X-Mailer: git-send-email 2.5.0 X-Barracuda-Connect: UNKNOWN[192.55.52.93] X-Barracuda-Start-Time: 1455137356 X-Barracuda-URL: https://192.48.176.25:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-BRTS-Status: 1 During testing of raw block devices + DAX I noticed that the struct block_device that we were using for DAX operations was incorrect. For the fault handlers, etc. we can just get the correct bdev via get_block(), which is passed in as a function pointer, but for the *sync code and for sector zeroing we don't have access to get_block(). This is also an issue for XFS real-time devices, whenever we get those working. Patch one of this series fixes the DAX sector zeroing code by explicitly passing in a valid struct block_device. Patch two of this series fixes DAX *sync support by moving calls to dax_writeback_mapping_range() out of filemap_write_and_wait_range() and into the filesystem/block device ->writepages function so that it can supply us with a valid block device. This also fixes DAX code to properly flush caches in response to sync(2). Thanks to Jan Kara for his initial draft of patch 2: https://lkml.org/lkml/2016/2/9/485 Here are the changes that I've made to that patch: 1) For DAX mappings, only return after calling dax_writeback_mapping_range() if we encountered an error. In the non-error case we still need to write back normal pages, else we lose metadata updates. 2) In dax_writeback_mapping_range(), move the new check for if (!mapping->nrexceptional || wbc->sync_mode != WB_SYNC_ALL) above the i_blkbits check. In my testing I found cases where dax_writeback_mapping_range() was called for inodes with i_blkbits != PAGE_SHIFT - I'm assuming these are internal metadata inodes? They have no exceptional DAX entries to flush, so we have no work to do, but if we return error from the i_blkbits check we will fail the overall writeback operation. Please let me know if it seems wrong for us to be seeing inodes set to use DAX but with i_blkbits != PAGE_SHIFT and I'll get more info. 3) In filemap_write_and_wait() and filemap_write_and_wait_range(), continue the writeback in the case that DAX is enabled but we only have a nonzero mapping->nrpages. As with 1) and 2), I believe this is necessary to properly writeback metadata changes. If this sounds wrong, please let me know and I'll get more info. A working tree can be found here: https://git.kernel.org/cgit/linux/kernel/git/zwisler/linux.git/log/?h=fsync_bdev_v2 Ross Zwisler (2): dax: supply DAX clearing code with correct bdev dax: move writeback calls into the filesystems fs/block_dev.c | 16 +++++++++++++++- fs/dax.c | 22 ++++++++++++---------- fs/ext2/inode.c | 17 +++++++++++++++-- fs/ext4/inode.c | 7 +++++++ fs/xfs/xfs_aops.c | 11 ++++++++++- fs/xfs/xfs_aops.h | 1 + fs/xfs/xfs_bmap_util.c | 3 ++- include/linux/dax.h | 8 +++++--- mm/filemap.c | 12 ++++-------- 9 files changed, 71 insertions(+), 26 deletions(-) -- 2.5.0 From ross.zwisler@linux.intel.com Wed Feb 10 14:49:19 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=ham version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay3.corp.sgi.com [198.149.34.15]) by oss.sgi.com (Postfix) with ESMTP id 7FD9B7CB4 for ; Wed, 10 Feb 2016 14:49:19 -0600 (CST) Received: from cuda.sgi.com (cuda2.sgi.com [192.48.176.25]) by relay3.corp.sgi.com (Postfix) with ESMTP id E6C7BAC008 for ; Wed, 10 Feb 2016 12:49:18 -0800 (PST) X-ASG-Debug-ID: 1455137356-04cbb0433261bb0002-NocioJ Received: from mga11.intel.com ([192.55.52.93]) by cuda.sgi.com with ESMTP id 8GEG3NQp3drXhPy5 for ; Wed, 10 Feb 2016 12:49:17 -0800 (PST) X-Barracuda-Envelope-From: ross.zwisler@linux.intel.com X-Barracuda-Apparent-Source-IP: 192.55.52.93 X-ASG-Whitelist: Client Received: from orsmga001.jf.intel.com ([10.7.209.18]) by fmsmga102.fm.intel.com with ESMTP; 10 Feb 2016 12:49:16 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.22,427,1449561600"; d="scan'208";a="881530468" Received: from rzwisler-desk.amr.corp.intel.com (HELO phyrexia.intel.com) ([10.252.193.228]) by orsmga001.jf.intel.com with ESMTP; 10 Feb 2016 12:49:15 -0800 From: Ross Zwisler To: linux-kernel@vger.kernel.org Cc: Ross Zwisler , "Theodore Ts'o" , Alexander Viro , Andreas Dilger , Andrew Morton , Dan Williams , Dave Chinner , Jan Kara , Matthew Wilcox , linux-ext4@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux-mm@kvack.org, linux-nvdimm@lists.01.org, xfs@oss.sgi.com Subject: [PATCH v2 1/2] dax: supply DAX clearing code with correct bdev Date: Wed, 10 Feb 2016 13:48:55 -0700 X-ASG-Orig-Subj: [PATCH v2 1/2] dax: supply DAX clearing code with correct bdev Message-Id: <1455137336-28720-2-git-send-email-ross.zwisler@linux.intel.com> X-Mailer: git-send-email 2.5.0 In-Reply-To: <1455137336-28720-1-git-send-email-ross.zwisler@linux.intel.com> References: <1455137336-28720-1-git-send-email-ross.zwisler@linux.intel.com> X-Barracuda-Connect: UNKNOWN[192.55.52.93] X-Barracuda-Start-Time: 1455137356 X-Barracuda-URL: https://192.48.176.25:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-BRTS-Status: 1 dax_clear_blocks() needs a valid struct block_device and previously it was using inode->i_sb->s_bdev in all cases. This is correct for normal inodes on mounted ext2, ext4 and XFS filesystems, but is incorrect for DAX raw block devices and for XFS real-time devices. Instead, rename dax_clear_blocks() to dax_clear_sectors(), and change its arguments to take a bdev and a sector instead of an inode and a block. This better reflects what the function does, and it allows the filesystem and raw block device code to pass in an appropriate struct block_device. Signed-off-by: Ross Zwisler Suggested-by: Dan Williams --- fs/dax.c | 9 ++++----- fs/ext2/inode.c | 6 ++++-- fs/xfs/xfs_aops.c | 2 +- fs/xfs/xfs_aops.h | 1 + fs/xfs/xfs_bmap_util.c | 3 ++- include/linux/dax.h | 2 +- 6 files changed, 13 insertions(+), 10 deletions(-) diff --git a/fs/dax.c b/fs/dax.c index fc2e314..9a173dd 100644 --- a/fs/dax.c +++ b/fs/dax.c @@ -79,15 +79,14 @@ struct page *read_dax_sector(struct block_device *bdev, sector_t n) } /* - * dax_clear_blocks() is called from within transaction context from XFS, + * dax_clear_sectors() is called from within transaction context from XFS, * and hence this means the stack from this point must follow GFP_NOFS * semantics for all operations. */ -int dax_clear_blocks(struct inode *inode, sector_t block, long _size) +int dax_clear_sectors(struct block_device *bdev, sector_t _sector, long _size) { - struct block_device *bdev = inode->i_sb->s_bdev; struct blk_dax_ctl dax = { - .sector = block << (inode->i_blkbits - 9), + .sector = _sector, .size = _size, }; @@ -109,7 +108,7 @@ int dax_clear_blocks(struct inode *inode, sector_t block, long _size) wmb_pmem(); return 0; } -EXPORT_SYMBOL_GPL(dax_clear_blocks); +EXPORT_SYMBOL_GPL(dax_clear_sectors); /* the clear_pmem() calls are ordered by a wmb_pmem() in the caller */ static void dax_new_buf(void __pmem *addr, unsigned size, unsigned first, diff --git a/fs/ext2/inode.c b/fs/ext2/inode.c index 338eefd..b6b965b 100644 --- a/fs/ext2/inode.c +++ b/fs/ext2/inode.c @@ -737,8 +737,10 @@ static int ext2_get_blocks(struct inode *inode, * so that it's not found by another thread before it's * initialised */ - err = dax_clear_blocks(inode, le32_to_cpu(chain[depth-1].key), - 1 << inode->i_blkbits); + err = dax_clear_sectors(inode->i_sb->s_bdev, + le32_to_cpu(chain[depth-1].key) << + (inode->i_blkbits - 9), + 1 << inode->i_blkbits); if (err) { mutex_unlock(&ei->truncate_mutex); goto cleanup; diff --git a/fs/xfs/xfs_aops.c b/fs/xfs/xfs_aops.c index 379c089..fc20518 100644 --- a/fs/xfs/xfs_aops.c +++ b/fs/xfs/xfs_aops.c @@ -55,7 +55,7 @@ xfs_count_page_state( } while ((bh = bh->b_this_page) != head); } -STATIC struct block_device * +struct block_device * xfs_find_bdev_for_inode( struct inode *inode) { diff --git a/fs/xfs/xfs_aops.h b/fs/xfs/xfs_aops.h index f6ffc9a..a4343c6 100644 --- a/fs/xfs/xfs_aops.h +++ b/fs/xfs/xfs_aops.h @@ -62,5 +62,6 @@ int xfs_get_blocks_dax_fault(struct inode *inode, sector_t offset, struct buffer_head *map_bh, int create); extern void xfs_count_page_state(struct page *, int *, int *); +extern struct block_device *xfs_find_bdev_for_inode(struct inode *); #endif /* __XFS_AOPS_H__ */ diff --git a/fs/xfs/xfs_bmap_util.c b/fs/xfs/xfs_bmap_util.c index 07ef29b..ae9d755 100644 --- a/fs/xfs/xfs_bmap_util.c +++ b/fs/xfs/xfs_bmap_util.c @@ -75,7 +75,8 @@ xfs_zero_extent( ssize_t size = XFS_FSB_TO_B(mp, count_fsb); if (IS_DAX(VFS_I(ip))) - return dax_clear_blocks(VFS_I(ip), block, size); + return dax_clear_sectors(xfs_find_bdev_for_inode(VFS_I(ip)), + sector, size); /* * let the block layer decide on the fastest method of diff --git a/include/linux/dax.h b/include/linux/dax.h index 818e450..7b6bced 100644 --- a/include/linux/dax.h +++ b/include/linux/dax.h @@ -7,7 +7,7 @@ ssize_t dax_do_io(struct kiocb *, struct inode *, struct iov_iter *, loff_t, get_block_t, dio_iodone_t, int flags); -int dax_clear_blocks(struct inode *, sector_t block, long size); +int dax_clear_sectors(struct block_device *bdev, sector_t _sector, long _size); int dax_zero_page_range(struct inode *, loff_t from, unsigned len, get_block_t); int dax_truncate_page(struct inode *, loff_t from, get_block_t); int dax_fault(struct vm_area_struct *, struct vm_fault *, get_block_t, -- 2.5.0 From ross.zwisler@linux.intel.com Wed Feb 10 14:49:22 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=ham version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay2.corp.sgi.com [137.38.102.29]) by oss.sgi.com (Postfix) with ESMTP id DF0307CB8 for ; Wed, 10 Feb 2016 14:49:22 -0600 (CST) Received: from cuda.sgi.com (cuda2.sgi.com [192.48.176.25]) by relay2.corp.sgi.com (Postfix) with ESMTP id D0637304039 for ; Wed, 10 Feb 2016 12:49:19 -0800 (PST) X-ASG-Debug-ID: 1455137356-04cbb0433261bb0003-NocioJ Received: from mga11.intel.com ([192.55.52.93]) by cuda.sgi.com with ESMTP id rLl0668mEENoPR2r for ; Wed, 10 Feb 2016 12:49:18 -0800 (PST) X-Barracuda-Envelope-From: ross.zwisler@linux.intel.com X-Barracuda-Apparent-Source-IP: 192.55.52.93 X-ASG-Whitelist: Client Received: from orsmga001.jf.intel.com ([10.7.209.18]) by fmsmga102.fm.intel.com with ESMTP; 10 Feb 2016 12:49:17 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.22,427,1449561600"; d="scan'208";a="881530481" Received: from rzwisler-desk.amr.corp.intel.com (HELO phyrexia.intel.com) ([10.252.193.228]) by orsmga001.jf.intel.com with ESMTP; 10 Feb 2016 12:49:16 -0800 From: Ross Zwisler To: linux-kernel@vger.kernel.org Cc: Ross Zwisler , "Theodore Ts'o" , Alexander Viro , Andreas Dilger , Andrew Morton , Dan Williams , Dave Chinner , Jan Kara , Matthew Wilcox , linux-ext4@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux-mm@kvack.org, linux-nvdimm@lists.01.org, xfs@oss.sgi.com, Jan Kara Subject: [PATCH v2 2/2] dax: move writeback calls into the filesystems Date: Wed, 10 Feb 2016 13:48:56 -0700 X-ASG-Orig-Subj: [PATCH v2 2/2] dax: move writeback calls into the filesystems Message-Id: <1455137336-28720-3-git-send-email-ross.zwisler@linux.intel.com> X-Mailer: git-send-email 2.5.0 In-Reply-To: <1455137336-28720-1-git-send-email-ross.zwisler@linux.intel.com> References: <1455137336-28720-1-git-send-email-ross.zwisler@linux.intel.com> X-Barracuda-Connect: UNKNOWN[192.55.52.93] X-Barracuda-Start-Time: 1455137358 X-Barracuda-URL: https://192.48.176.25:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-BRTS-Status: 1 Previously calls to dax_writeback_mapping_range() for all DAX filesystems (ext2, ext4 & xfs) were centralized in filemap_write_and_wait_range(). dax_writeback_mapping_range() needs a struct block_device, and it used to get that from inode->i_sb->s_bdev. This is correct for normal inodes mounted on ext2, ext4 and XFS filesystems, but is incorrect for DAX raw block devices and for XFS real-time files. Instead, call dax_writeback_mapping_range() directly from the filesystem ->writepages function so that it can supply us with a valid block device. This also fixes DAX code to properly flush caches in response to sync(2). Signed-off-by: Ross Zwisler Signed-off-by: Jan Kara --- fs/block_dev.c | 16 +++++++++++++++- fs/dax.c | 13 ++++++++----- fs/ext2/inode.c | 11 +++++++++++ fs/ext4/inode.c | 7 +++++++ fs/xfs/xfs_aops.c | 9 +++++++++ include/linux/dax.h | 6 ++++-- mm/filemap.c | 12 ++++-------- 7 files changed, 58 insertions(+), 16 deletions(-) diff --git a/fs/block_dev.c b/fs/block_dev.c index 39b3a17..fc01e43 100644 --- a/fs/block_dev.c +++ b/fs/block_dev.c @@ -1693,13 +1693,27 @@ static int blkdev_releasepage(struct page *page, gfp_t wait) return try_to_free_buffers(page); } +static int blkdev_writepages(struct address_space *mapping, + struct writeback_control *wbc) +{ + if (dax_mapping(mapping)) { + struct block_device *bdev = I_BDEV(mapping->host); + int error; + + error = dax_writeback_mapping_range(mapping, bdev, wbc); + if (error) + return error; + } + return generic_writepages(mapping, wbc); +} + static const struct address_space_operations def_blk_aops = { .readpage = blkdev_readpage, .readpages = blkdev_readpages, .writepage = blkdev_writepage, .write_begin = blkdev_write_begin, .write_end = blkdev_write_end, - .writepages = generic_writepages, + .writepages = blkdev_writepages, .releasepage = blkdev_releasepage, .direct_IO = blkdev_direct_IO, .is_dirty_writeback = buffer_check_dirty_writeback, diff --git a/fs/dax.c b/fs/dax.c index 9a173dd..034dd02 100644 --- a/fs/dax.c +++ b/fs/dax.c @@ -484,11 +484,10 @@ static int dax_writeback_one(struct block_device *bdev, * end]. This is required by data integrity operations to ensure file data is * on persistent storage prior to completion of the operation. */ -int dax_writeback_mapping_range(struct address_space *mapping, loff_t start, - loff_t end) +int dax_writeback_mapping_range(struct address_space *mapping, + struct block_device *bdev, struct writeback_control *wbc) { struct inode *inode = mapping->host; - struct block_device *bdev = inode->i_sb->s_bdev; pgoff_t start_index, end_index, pmd_index; pgoff_t indices[PAGEVEC_SIZE]; struct pagevec pvec; @@ -496,11 +495,15 @@ int dax_writeback_mapping_range(struct address_space *mapping, loff_t start, int i, ret = 0; void *entry; + + if (!mapping->nrexceptional || wbc->sync_mode != WB_SYNC_ALL) + return 0; + if (WARN_ON_ONCE(inode->i_blkbits != PAGE_SHIFT)) return -EIO; - start_index = start >> PAGE_CACHE_SHIFT; - end_index = end >> PAGE_CACHE_SHIFT; + start_index = wbc->range_start >> PAGE_CACHE_SHIFT; + end_index = wbc->range_end >> PAGE_CACHE_SHIFT; pmd_index = DAX_PMD_INDEX(start_index); rcu_read_lock(); diff --git a/fs/ext2/inode.c b/fs/ext2/inode.c index b6b965b..7e44fc3 100644 --- a/fs/ext2/inode.c +++ b/fs/ext2/inode.c @@ -876,6 +876,17 @@ ext2_direct_IO(struct kiocb *iocb, struct iov_iter *iter, loff_t offset) static int ext2_writepages(struct address_space *mapping, struct writeback_control *wbc) { +#ifdef CONFIG_FS_DAX + if (dax_mapping(mapping)) { + int error; + + error = dax_writeback_mapping_range(mapping, + mapping->host->i_sb->s_bdev, wbc); + if (error) + return error; + } +#endif + return mpage_writepages(mapping, wbc, ext2_get_block); } diff --git a/fs/ext4/inode.c b/fs/ext4/inode.c index 83bc8bf..8c42020 100644 --- a/fs/ext4/inode.c +++ b/fs/ext4/inode.c @@ -2450,6 +2450,13 @@ static int ext4_writepages(struct address_space *mapping, trace_ext4_writepages(inode, wbc); + if (dax_mapping(mapping)) { + ret = dax_writeback_mapping_range(mapping, inode->i_sb->s_bdev, + wbc); + if (ret) + goto out_writepages; + } + /* * No pages to write? This is mainly a kludge to avoid starting * a transaction for special inodes like journal inode on last iput() diff --git a/fs/xfs/xfs_aops.c b/fs/xfs/xfs_aops.c index fc20518..1139ecd 100644 --- a/fs/xfs/xfs_aops.c +++ b/fs/xfs/xfs_aops.c @@ -1208,6 +1208,15 @@ xfs_vm_writepages( struct writeback_control *wbc) { xfs_iflags_clear(XFS_I(mapping->host), XFS_ITRUNCATED); + if (dax_mapping(mapping)) { + int error; + + error = dax_writeback_mapping_range(mapping, + xfs_find_bdev_for_inode(mapping->host), wbc); + if (error) + return error; + } + return generic_writepages(mapping, wbc); } diff --git a/include/linux/dax.h b/include/linux/dax.h index 7b6bced..636dd59 100644 --- a/include/linux/dax.h +++ b/include/linux/dax.h @@ -52,6 +52,8 @@ static inline bool dax_mapping(struct address_space *mapping) { return mapping->host && IS_DAX(mapping->host); } -int dax_writeback_mapping_range(struct address_space *mapping, loff_t start, - loff_t end); + +struct writeback_control; +int dax_writeback_mapping_range(struct address_space *mapping, + struct block_device *bdev, struct writeback_control *wbc); #endif diff --git a/mm/filemap.c b/mm/filemap.c index bc94386..a829779 100644 --- a/mm/filemap.c +++ b/mm/filemap.c @@ -446,7 +446,8 @@ int filemap_write_and_wait(struct address_space *mapping) { int err = 0; - if (mapping->nrpages) { + if (mapping->nrpages || + (dax_mapping(mapping) && mapping->nrexceptional)) { err = filemap_fdatawrite(mapping); /* * Even if the above returned error, the pages may be @@ -482,13 +483,8 @@ int filemap_write_and_wait_range(struct address_space *mapping, { int err = 0; - if (dax_mapping(mapping) && mapping->nrexceptional) { - err = dax_writeback_mapping_range(mapping, lstart, lend); - if (err) - return err; - } - - if (mapping->nrpages) { + if (mapping->nrpages || + (dax_mapping(mapping) && mapping->nrexceptional)) { err = __filemap_fdatawrite_range(mapping, lstart, lend, WB_SYNC_ALL); /* See comment of filemap_write_and_wait() */ -- 2.5.0 From david@fromorbit.com Wed Feb 10 15:10:03 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=ham version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay2.corp.sgi.com [137.38.102.29]) by oss.sgi.com (Postfix) with ESMTP id CAA157CB4 for ; Wed, 10 Feb 2016 15:10:03 -0600 (CST) Received: from cuda.sgi.com (cuda1.sgi.com [192.48.157.11]) by relay2.corp.sgi.com (Postfix) with ESMTP id 93D38304059 for ; Wed, 10 Feb 2016 13:10:00 -0800 (PST) X-ASG-Debug-ID: 1455138597-04bdf066ec4db40001-NocioJ Received: from ipmail06.adl2.internode.on.net (ipmail06.adl2.internode.on.net [150.101.137.129]) by cuda.sgi.com with ESMTP id sInXNLB9xOcyH2Lh for ; Wed, 10 Feb 2016 13:09:57 -0800 (PST) X-Barracuda-Envelope-From: david@fromorbit.com X-Barracuda-Apparent-Source-IP: 150.101.137.129 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: A2C+CADBprtWPBATLHleKAECgw+BP4ZjgXmdVgEBAQEBB4tqhUWEB4YHBAICgTdNAQEBAQEBBwEBAQFBP4RCAQEEJxMcIxAIAw4KCSUPBSUDBxoTiBrAYwEBAQcCHhiFMoR/gTYBhzUFlniNSI59jj+CcoFoKC6IUwEBAQ Received: from ppp121-44-19-16.lns20.syd4.internode.on.net (HELO dastard) ([121.44.19.16]) by ipmail06.adl2.internode.on.net with ESMTP; 11 Feb 2016 07:39:27 +1030 Received: from dave by dastard with local (Exim 4.80) (envelope-from ) id 1aTc0t-0006r3-0F; Thu, 11 Feb 2016 08:09:27 +1100 Date: Thu, 11 Feb 2016 08:09:26 +1100 From: Dave Chinner To: Brian Foster Cc: xfs@oss.sgi.com Subject: Re: [PATCH 5/5] xfs: don't chain ioends during writepage submission Message-ID: <20160210210926.GL14668@dastard> X-ASG-Orig-Subj: Re: [PATCH 5/5] xfs: don't chain ioends during writepage submission References: <1454910258-7578-1-git-send-email-david@fromorbit.com> <1454910258-7578-6-git-send-email-david@fromorbit.com> <20160209142355.GB25829@bfoster.bfoster> <20160209215900.GH14668@dastard> <20160210131816.GB48974@bfoster.bfoster> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20160210131816.GB48974@bfoster.bfoster> User-Agent: Mutt/1.5.21 (2010-09-15) X-Barracuda-Connect: ipmail06.adl2.internode.on.net[150.101.137.129] X-Barracuda-Start-Time: 1455138597 X-Barracuda-URL: https://192.48.157.11:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-BRTS-Status: 1 X-Barracuda-Spam-Score: 0.00 X-Barracuda-Spam-Status: No, SCORE=0.00 using per-user scores of TAG_LEVEL=1000.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.7 tests=BSF_SC0_MISMATCH_TO X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.3.26925 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 0.00 BSF_SC0_MISMATCH_TO Envelope rcpt doesn't match header On Wed, Feb 10, 2016 at 08:18:17AM -0500, Brian Foster wrote: > On Wed, Feb 10, 2016 at 08:59:00AM +1100, Dave Chinner wrote: > > On Tue, Feb 09, 2016 at 09:23:55AM -0500, Brian Foster wrote: > > > On Mon, Feb 08, 2016 at 04:44:18PM +1100, Dave Chinner wrote: > > > > @@ -738,29 +726,22 @@ xfs_writepage_submit( > > > > struct writeback_control *wbc, > > > > int status) > > > > { > > > > - struct blk_plug plug; > > > > - > > > > - /* Reserve log space if we might write beyond the on-disk inode size. */ > > > > - if (!status && wpc->ioend && wpc->ioend->io_type != XFS_IO_UNWRITTEN && > > > > - xfs_ioend_is_append(wpc->ioend)) > > > > - status = xfs_setfilesize_trans_alloc(wpc->ioend); > > > > - > > > > - if (wpc->iohead) { > > > > - blk_start_plug(&plug); > > > > - xfs_submit_ioend(wbc, wpc->iohead, status); > > > > - blk_finish_plug(&plug); > > > > - } > > > > > > We've dropped our plug here but I don't see anything added in > > > xfs_vm_writepages(). Shouldn't we have one there now that ioends are > > > submitted as we go? generic_writepages() uses one around its > > > write_cache_pages() call.. > > > > It's not really necessary, as we now have higher level plugging in > > the writeback go will get flushed on context switch, and if we don't > > have a high level plug (e.g. fsync triggered writeback), then we > > submit the IO immediately, just like flushing the plug here would do > > anyway.... > > > > Ok, I'm digging around the wb code a bit and I see plugs in/around > wb_writeback(), so I assume that's what you're referring to in the first > case. I'm not quite following the fsync case though... > > In the current upstream code, fsync() leads to the following call chain: > > filemap_write_and_wait_range() > __filemap_fdatawrite_range() > do_writepages() > xfs_vm_writepages() > generic_writepages() > blk_start_plug() > write_cache_pages() > blk_finish_plug() > > After this series, we have the following: > > filemap_write_and_wait_range() > __filemap_fdatawrite_range() > do_writepages() > xfs_vm_writepages() > write_cache_pages() > > ... with no plug that I can see. What am I missing? fsync tends to be a latency sensitive operation, not a bandwidth maximising operation. Plugging trades off IO submission latency for maximising IO bandwidth. For fsync and other single inode operations that block waiting for the IO to complete, maximising bandwidth is not necessarily the right thing to do. For single inode IO commands (such as through __filemap_fdatawrite_range), block plugging will only improve performance if the filesystem does not form large bios to begin with. XFS always builds maximally sized bios if it can, so plugging cannot improve the IO throughput from such writeback behaviour because the bios it builds cannot be further merged. Such bios are better served being pushed straight in the the IO scheduler queues. IOWs, plugging only makes a difference when the IO being formed is small but is mergable in the IO scheduler. This what happens with small file delayed allocation in writeback in XFS, and nowdays we have a high level plug for this (i.e. in writeback_inodes_wb() and wb_writeback()). Hence those one-bio-per-inode-but-all-sequential IO will be merged in the plug before dispatch, thereby improving write bandwidth under such small file writeback workloads. (See the numbers in commmit d353d75 writeback: plug writeback at a high level").) IOWs, block plugging is not a magical "make everything go faster" knob. Different filesystems have different IO dispatch methods, and so require different plugging strategies to optimise their IO patterns. It may be that plugging in xfs_vm_writepages is advantageous in some workloads for fsync, but I haven't been able to measure them. Cheers, Dave. -- Dave Chinner david@fromorbit.com From david@fromorbit.com Wed Feb 10 15:25:59 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=ham version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay3.corp.sgi.com [198.149.34.15]) by oss.sgi.com (Postfix) with ESMTP id 202AB7CB7 for ; Wed, 10 Feb 2016 15:25:59 -0600 (CST) Received: from cuda.sgi.com (cuda3.sgi.com [192.48.176.15]) by relay3.corp.sgi.com (Postfix) with ESMTP id B0F6FAC002 for ; Wed, 10 Feb 2016 13:25:55 -0800 (PST) X-ASG-Debug-ID: 1455139552-04cb6c1e5849710001-NocioJ Received: from ipmail06.adl2.internode.on.net (ipmail06.adl2.internode.on.net [150.101.137.129]) by cuda.sgi.com with ESMTP id shVtc64o1c8PzqGL for ; Wed, 10 Feb 2016 13:25:52 -0800 (PST) X-Barracuda-Envelope-From: david@fromorbit.com X-Barracuda-Apparent-Source-IP: 150.101.137.129 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: A2AUCwAhqrtWPBATLHleKAECgw+BP4ZjgXmdVQEBAQEBAQaLaoVFhAeGBwQCAoE3TQEBAQEBAQcBAQEBQT9BEoNvAQEEOhwjEAgDDgoJJQ8FJQMHGhMZiAHAZwEBAQcCHhiFMoR/iGwFlniNSI59RI17gmUZgVwoLocHgUwBAQE Received: from ppp121-44-19-16.lns20.syd4.internode.on.net (HELO dastard) ([121.44.19.16]) by ipmail06.adl2.internode.on.net with ESMTP; 11 Feb 2016 07:55:51 +1030 Received: from dave by dastard with local (Exim 4.80) (envelope-from ) id 1aTcGl-0006sf-21; Thu, 11 Feb 2016 08:25:51 +1100 Date: Thu, 11 Feb 2016 08:25:51 +1100 From: Dave Chinner To: Christoph Hellwig Cc: xfs@oss.sgi.com Subject: Re: [PATCH 0/8 v4] xfs: get rid of xfs_cluster_write Message-ID: <20160210212550.GM14668@dastard> X-ASG-Orig-Subj: Re: [PATCH 0/8 v4] xfs: get rid of xfs_cluster_write References: <1455094043-9694-1-git-send-email-david@fromorbit.com> <20160210182538.GA7481@infradead.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20160210182538.GA7481@infradead.org> User-Agent: Mutt/1.5.21 (2010-09-15) X-Barracuda-Connect: ipmail06.adl2.internode.on.net[150.101.137.129] X-Barracuda-Start-Time: 1455139552 X-Barracuda-URL: https://192.48.176.15:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-BRTS-Status: 1 X-Barracuda-Spam-Score: 0.00 X-Barracuda-Spam-Status: No, SCORE=0.00 using per-user scores of TAG_LEVEL=1000.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.7 tests=BSF_SC0_MISMATCH_TO X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.3.26926 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 0.00 BSF_SC0_MISMATCH_TO Envelope rcpt doesn't match header On Wed, Feb 10, 2016 at 10:25:38AM -0800, Christoph Hellwig wrote: > On Wed, Feb 10, 2016 at 07:47:15PM +1100, Dave Chinner wrote: > > of the writepage context. Patches 7 and 8 are new patches (as in the > > first time I've posted them) to demonstrate how to remove the IO > > completion dependency on recording the bufferehads attached to the > > ioend. This is the first step in removing bufferheads from the > > writepage IO path - these are FYI patches, not patches I want to > > have committed immediately. > > This looks interesting. I played around with this a bit and ported > my patch to embedd the main bio into struct ioend to it. My older > version allowed to chain additional bios to get ioends larger than > 1MB (or PAGE_SIZE * 256), but that will require additional work > in the new completion handler. It does however simplify things quite > a bit, and I suspect a lot of that simplification could be kept even > with chained bios. I've attached the patch below for reference: I really like the idea, especially how using a bioset encapsulates the ioend and binds the life cycle to the bio. It also removes a heap of code, too. We really do need some form of chaining here, though. If we don't, then we'll be doing unwritten extent of set file size transactions for ever 1MB bio completion instead of once for however large writepages can build an ioend. I think this is definitely worth pursuing - are you going to get any time to work on this in the next couple of months, Christoph (i.e. to target the 4.7 merge window)? Cheers, Dave. -- Dave Chinner david@fromorbit.com From david@fromorbit.com Wed Feb 10 15:41:06 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=ham version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay1.corp.sgi.com [137.38.102.111]) by oss.sgi.com (Postfix) with ESMTP id 01F757CBA for ; Wed, 10 Feb 2016 15:41:06 -0600 (CST) Received: from cuda.sgi.com (cuda3.sgi.com [192.48.176.15]) by relay1.corp.sgi.com (Postfix) with ESMTP id DAAAE8F8040 for ; Wed, 10 Feb 2016 13:41:02 -0800 (PST) X-ASG-Debug-ID: 1455140459-04cb6c1e5849bb0001-NocioJ Received: from ipmail06.adl2.internode.on.net (ipmail06.adl2.internode.on.net [150.101.137.129]) by cuda.sgi.com with ESMTP id CyhHLtkBnVzTR37R for ; Wed, 10 Feb 2016 13:41:00 -0800 (PST) X-Barracuda-Envelope-From: david@fromorbit.com X-Barracuda-Apparent-Source-IP: 150.101.137.129 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: A2ASCAC2rbtWPBATLHleKAECgw9SbYhchE2ZCAEBAQEBAQaLaolMIYVmBAICgTdNAQEBAQEBBwEBAQFBP4RCAQEEJxMcIxAIAw4KCSUPBSUDBxoTiBoPwEcBAQgCHhiFMoR/glSGGAWHUIcGiCKFTId8jn2OP4RaKC4BiFIBAQE Received: from ppp121-44-19-16.lns20.syd4.internode.on.net (HELO dastard) ([121.44.19.16]) by ipmail06.adl2.internode.on.net with ESMTP; 11 Feb 2016 08:10:59 +1030 Received: from dave by dastard with local (Exim 4.80) (envelope-from ) id 1aTcVO-0006uB-GT; Thu, 11 Feb 2016 08:40:58 +1100 Date: Thu, 11 Feb 2016 08:40:58 +1100 From: Dave Chinner To: Christoph Hellwig Cc: "Darrick J. Wong" , xfs@oss.sgi.com Subject: Re: block allocations for the refcount btree Message-ID: <20160210214058.GN14668@dastard> X-ASG-Orig-Subj: Re: block allocations for the refcount btree References: <20160210093011.GA19147@infradead.org> <20160210095010.GC23904@birch.djwong.org> <20160210190738.GA13051@infradead.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20160210190738.GA13051@infradead.org> User-Agent: Mutt/1.5.21 (2010-09-15) X-Barracuda-Connect: ipmail06.adl2.internode.on.net[150.101.137.129] X-Barracuda-Start-Time: 1455140459 X-Barracuda-URL: https://192.48.176.15:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-BRTS-Status: 1 X-Barracuda-Spam-Score: 0.00 X-Barracuda-Spam-Status: No, SCORE=0.00 using per-user scores of TAG_LEVEL=1000.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.7 tests=BSF_SC0_MISMATCH_TO X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.3.26926 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 0.00 BSF_SC0_MISMATCH_TO Envelope rcpt doesn't match header On Wed, Feb 10, 2016 at 11:07:38AM -0800, Christoph Hellwig wrote: > On Wed, Feb 10, 2016 at 01:50:10AM -0800, Darrick J. Wong wrote: > > That's odd... I'd have thought that the AG reservation would always be able > > to handle a refcount btree expansion, since it calculates how many blocks > > are needed to handle the worst case of 1 record per extent. There's also > > a bug where we undercount the number of blocks already used, so it should > > have an extra big reservation. > > > > OTOH I've seen occasional ENOSPCs in generic/186 and generic/168 too, so I > > guess something's going wrong. Maybe the xfs_ag_resv* tracepoints can help? > > I'm not seeing an ENOSPC, I run into: > > [ 640.924891] XFS: Assertion failed: tp->t_blk_res_used <= tp->t_blk_res, file: fs/xfs/xfs_trans.c, line: 315 I run into that from time to time (maybe once a month) on a vanilla kernel. IIRC, the problem is the delayed allocation extent split runs out of it's reserved block count if you split it enough times. The case I've seen is that the indlen calculated in xfs_bmap_worst_indlen() ends up too small for a subsequent allocation after we've called xfs_bmap_del_extent() to delete the middle of a delalloc extent too many times. Brian had some patches that attempted to solve it - we may have simply dropped the ball on this (again). http://oss.sgi.com/archives/xfs/2014-09/msg00337.html Cheers, Dave. -- Dave Chinner david@fromorbit.com From david@fromorbit.com Wed Feb 10 15:45:12 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=ham version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay3.corp.sgi.com [198.149.34.15]) by oss.sgi.com (Postfix) with ESMTP id B99AF7CBC for ; Wed, 10 Feb 2016 15:45:12 -0600 (CST) Received: from cuda.sgi.com (cuda2.sgi.com [192.48.176.25]) by relay3.corp.sgi.com (Postfix) with ESMTP id 422F1AC006 for ; Wed, 10 Feb 2016 13:45:12 -0800 (PST) X-ASG-Debug-ID: 1455140708-04cbb0433362d10001-NocioJ Received: from ipmail06.adl2.internode.on.net (ipmail06.adl2.internode.on.net [150.101.137.129]) by cuda.sgi.com with ESMTP id mD5OlwsfYFHdWXS5 for ; Wed, 10 Feb 2016 13:45:09 -0800 (PST) X-Barracuda-Envelope-From: david@fromorbit.com X-Barracuda-Apparent-Source-IP: 150.101.137.129 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: A2DnDADirrtWPBATLHleKAECgw+BP4ZjgXmdVQEBAQEBAQaLajiJFIYHBAICgTdNAQEBAQEBBwEBAQFBP4RCAQEEOhwjEAgDDgoJJQ8FJQMHGhOIGsBXAQEIAh4YhTKEf4hsBZZ4jUiBZYRDiFVEjXuEWiguiFMBAQE Received: from ppp121-44-19-16.lns20.syd4.internode.on.net (HELO dastard) ([121.44.19.16]) by ipmail06.adl2.internode.on.net with ESMTP; 11 Feb 2016 08:14:53 +1030 Received: from dave by dastard with local (Exim 4.80) (envelope-from ) id 1aTcZA-0006ui-KP; Thu, 11 Feb 2016 08:44:52 +1100 Date: Thu, 11 Feb 2016 08:44:52 +1100 From: Dave Chinner To: Tetsuo Handa Cc: xfs@oss.sgi.com Subject: Re: xfs_nondir_ilock_class lockdep warning Message-ID: <20160210214452.GO14668@dastard> X-ASG-Orig-Subj: Re: xfs_nondir_ilock_class lockdep warning References: <201602101953.HEB13075.HFLOOFQVStOJFM@I-love.SAKURA.ne.jp> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201602101953.HEB13075.HFLOOFQVStOJFM@I-love.SAKURA.ne.jp> User-Agent: Mutt/1.5.21 (2010-09-15) X-Barracuda-Connect: ipmail06.adl2.internode.on.net[150.101.137.129] X-Barracuda-Start-Time: 1455140708 X-Barracuda-URL: https://192.48.176.25:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-BRTS-Status: 1 X-Barracuda-Spam-Score: 0.00 X-Barracuda-Spam-Status: No, SCORE=0.00 using per-user scores of TAG_LEVEL=1000.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.7 tests=BSF_SC0_MISMATCH_TO X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.3.26926 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 0.00 BSF_SC0_MISMATCH_TO Envelope rcpt doesn't match header On Wed, Feb 10, 2016 at 07:53:21PM +0900, Tetsuo Handa wrote: > Hello. > > I'm getting xfs_nondir_ilock_class lockdep warning. > I reported this because google hits little. > Please reply if this is not a known false positive. False positive. The XFS inode memory reclaim code will never try to reclaim (and hence lock) an inode with an active reference. Hence no deadlock is possible. -Dave. -- Dave Chinner david@fromorbit.com From david@fromorbit.com Wed Feb 10 16:03:23 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=ham version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay2.corp.sgi.com [137.38.102.29]) by oss.sgi.com (Postfix) with ESMTP id 812427CBE for ; Wed, 10 Feb 2016 16:03:23 -0600 (CST) Received: from cuda.sgi.com (cuda1.sgi.com [192.48.157.11]) by relay2.corp.sgi.com (Postfix) with ESMTP id 52FA6304053 for ; Wed, 10 Feb 2016 14:03:20 -0800 (PST) X-ASG-Debug-ID: 1455141794-04bdf066eb4efa0001-NocioJ Received: from ipmail06.adl2.internode.on.net (ipmail06.adl2.internode.on.net [150.101.137.129]) by cuda.sgi.com with ESMTP id wLuWHK0WJHUlJ8wM for ; Wed, 10 Feb 2016 14:03:14 -0800 (PST) X-Barracuda-Envelope-From: david@fromorbit.com X-Barracuda-Apparent-Source-IP: 150.101.137.129 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: A2AkCQBlsrtWPBATLHleKAECgw+BP4ZjgXmdVQEBAQEBAQaLaoVFhAeGBwICAQECgThNAQEBAQEBBwEBAQFBP4RCAQEEJxMcIxAIAxgJJQ8FJQMHGhOIGsBTAQEBBwIBHRiFMoR/iGwBBJZ4jUiOfYNTimyEWiguAYhSAQEB Received: from ppp121-44-19-16.lns20.syd4.internode.on.net (HELO dastard) ([121.44.19.16]) by ipmail06.adl2.internode.on.net with ESMTP; 11 Feb 2016 08:33:12 +1030 Received: from dave by dastard with local (Exim 4.80) (envelope-from ) id 1aTcqu-0006yr-HC; Thu, 11 Feb 2016 09:03:12 +1100 Date: Thu, 11 Feb 2016 09:03:12 +1100 From: Dave Chinner To: Ross Zwisler Cc: linux-kernel@vger.kernel.org, Theodore Ts'o , Alexander Viro , Andreas Dilger , Andrew Morton , Dan Williams , Jan Kara , Matthew Wilcox , linux-ext4@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux-mm@kvack.org, linux-nvdimm@lists.01.org, xfs@oss.sgi.com, Jan Kara Subject: Re: [PATCH v2 2/2] dax: move writeback calls into the filesystems Message-ID: <20160210220312.GP14668@dastard> X-ASG-Orig-Subj: Re: [PATCH v2 2/2] dax: move writeback calls into the filesystems References: <1455137336-28720-1-git-send-email-ross.zwisler@linux.intel.com> <1455137336-28720-3-git-send-email-ross.zwisler@linux.intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1455137336-28720-3-git-send-email-ross.zwisler@linux.intel.com> User-Agent: Mutt/1.5.21 (2010-09-15) X-Barracuda-Connect: ipmail06.adl2.internode.on.net[150.101.137.129] X-Barracuda-Start-Time: 1455141794 X-Barracuda-URL: https://192.48.157.11:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-BRTS-Status: 1 X-Barracuda-Spam-Score: 0.00 X-Barracuda-Spam-Status: No, SCORE=0.00 using per-user scores of TAG_LEVEL=1000.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.7 tests=BSF_SC0_MISMATCH_TO X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.3.26927 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 0.00 BSF_SC0_MISMATCH_TO Envelope rcpt doesn't match header On Wed, Feb 10, 2016 at 01:48:56PM -0700, Ross Zwisler wrote: > Previously calls to dax_writeback_mapping_range() for all DAX filesystems > (ext2, ext4 & xfs) were centralized in filemap_write_and_wait_range(). > dax_writeback_mapping_range() needs a struct block_device, and it used to > get that from inode->i_sb->s_bdev. This is correct for normal inodes > mounted on ext2, ext4 and XFS filesystems, but is incorrect for DAX raw > block devices and for XFS real-time files. > > Instead, call dax_writeback_mapping_range() directly from the filesystem > ->writepages function so that it can supply us with a valid block > device. This also fixes DAX code to properly flush caches in response to > sync(2). > > Signed-off-by: Ross Zwisler > Signed-off-by: Jan Kara > --- > fs/block_dev.c | 16 +++++++++++++++- > fs/dax.c | 13 ++++++++----- > fs/ext2/inode.c | 11 +++++++++++ > fs/ext4/inode.c | 7 +++++++ > fs/xfs/xfs_aops.c | 9 +++++++++ > include/linux/dax.h | 6 ++++-- > mm/filemap.c | 12 ++++-------- > 7 files changed, 58 insertions(+), 16 deletions(-) > > diff --git a/fs/block_dev.c b/fs/block_dev.c > index 39b3a17..fc01e43 100644 > --- a/fs/block_dev.c > +++ b/fs/block_dev.c > @@ -1693,13 +1693,27 @@ static int blkdev_releasepage(struct page *page, gfp_t wait) > return try_to_free_buffers(page); > } > > +static int blkdev_writepages(struct address_space *mapping, > + struct writeback_control *wbc) > +{ > + if (dax_mapping(mapping)) { > + struct block_device *bdev = I_BDEV(mapping->host); > + int error; > + > + error = dax_writeback_mapping_range(mapping, bdev, wbc); > + if (error) > + return error; > + } > + return generic_writepages(mapping, wbc); > +} Can you remind of the reason for calling generic_writepages() on DAX enabled address spaces? Cheers, Dave. -- Dave Chinner david@fromorbit.com From ross.zwisler@linux.intel.com Wed Feb 10 16:43:57 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=ham version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay1.corp.sgi.com [137.38.102.111]) by oss.sgi.com (Postfix) with ESMTP id 0D61729DF5 for ; Wed, 10 Feb 2016 16:43:57 -0600 (CST) Received: from cuda.sgi.com (cuda3.sgi.com [192.48.176.15]) by relay1.corp.sgi.com (Postfix) with ESMTP id EE8C48F8064 for ; Wed, 10 Feb 2016 14:43:53 -0800 (PST) X-ASG-Debug-ID: 1455144232-04cb6c1e574ad00001-NocioJ Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) by cuda.sgi.com with ESMTP id u04Ybtxq1t0oItc4 for ; Wed, 10 Feb 2016 14:43:52 -0800 (PST) X-Barracuda-Envelope-From: ross.zwisler@linux.intel.com X-Barracuda-Apparent-Source-IP: 134.134.136.20 X-ASG-Whitelist: Client Received: from orsmga003.jf.intel.com ([10.7.209.27]) by orsmga101.jf.intel.com with ESMTP; 10 Feb 2016 14:43:52 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.22,427,1449561600"; d="scan'208";a="743926718" Received: from rzwisler-desk.amr.corp.intel.com (HELO linux.intel.com) ([10.252.193.228]) by orsmga003.jf.intel.com with ESMTP; 10 Feb 2016 14:43:51 -0800 Date: Wed, 10 Feb 2016 15:43:40 -0700 From: Ross Zwisler To: Dave Chinner Cc: Ross Zwisler , linux-kernel@vger.kernel.org, Theodore Ts'o , Alexander Viro , Andreas Dilger , Andrew Morton , Dan Williams , Jan Kara , Matthew Wilcox , linux-ext4@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux-mm@kvack.org, linux-nvdimm@lists.01.org, xfs@oss.sgi.com, Jan Kara Subject: Re: [PATCH v2 2/2] dax: move writeback calls into the filesystems Message-ID: <20160210224340.GA30938@linux.intel.com> X-ASG-Orig-Subj: Re: [PATCH v2 2/2] dax: move writeback calls into the filesystems Mail-Followup-To: Ross Zwisler , Dave Chinner , linux-kernel@vger.kernel.org, Theodore Ts'o , Alexander Viro , Andreas Dilger , Andrew Morton , Dan Williams , Jan Kara , Matthew Wilcox , linux-ext4@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux-mm@kvack.org, linux-nvdimm@lists.01.org, xfs@oss.sgi.com, Jan Kara References: <1455137336-28720-1-git-send-email-ross.zwisler@linux.intel.com> <1455137336-28720-3-git-send-email-ross.zwisler@linux.intel.com> <20160210220312.GP14668@dastard> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20160210220312.GP14668@dastard> User-Agent: Mutt/1.5.24 (2015-08-30) X-Barracuda-Connect: mga02.intel.com[134.134.136.20] X-Barracuda-Start-Time: 1455144232 X-Barracuda-URL: https://192.48.176.15:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-BRTS-Status: 1 On Thu, Feb 11, 2016 at 09:03:12AM +1100, Dave Chinner wrote: > On Wed, Feb 10, 2016 at 01:48:56PM -0700, Ross Zwisler wrote: > > Previously calls to dax_writeback_mapping_range() for all DAX filesystems > > (ext2, ext4 & xfs) were centralized in filemap_write_and_wait_range(). > > dax_writeback_mapping_range() needs a struct block_device, and it used to > > get that from inode->i_sb->s_bdev. This is correct for normal inodes > > mounted on ext2, ext4 and XFS filesystems, but is incorrect for DAX raw > > block devices and for XFS real-time files. > > > > Instead, call dax_writeback_mapping_range() directly from the filesystem > > ->writepages function so that it can supply us with a valid block > > device. This also fixes DAX code to properly flush caches in response to > > sync(2). > > > > Signed-off-by: Ross Zwisler > > Signed-off-by: Jan Kara > > --- > > fs/block_dev.c | 16 +++++++++++++++- > > fs/dax.c | 13 ++++++++----- > > fs/ext2/inode.c | 11 +++++++++++ > > fs/ext4/inode.c | 7 +++++++ > > fs/xfs/xfs_aops.c | 9 +++++++++ > > include/linux/dax.h | 6 ++++-- > > mm/filemap.c | 12 ++++-------- > > 7 files changed, 58 insertions(+), 16 deletions(-) > > > > diff --git a/fs/block_dev.c b/fs/block_dev.c > > index 39b3a17..fc01e43 100644 > > --- a/fs/block_dev.c > > +++ b/fs/block_dev.c > > @@ -1693,13 +1693,27 @@ static int blkdev_releasepage(struct page *page, gfp_t wait) > > return try_to_free_buffers(page); > > } > > > > +static int blkdev_writepages(struct address_space *mapping, > > + struct writeback_control *wbc) > > +{ > > + if (dax_mapping(mapping)) { > > + struct block_device *bdev = I_BDEV(mapping->host); > > + int error; > > + > > + error = dax_writeback_mapping_range(mapping, bdev, wbc); > > + if (error) > > + return error; > > + } > > + return generic_writepages(mapping, wbc); > > +} > > Can you remind of the reason for calling generic_writepages() on DAX > enabled address spaces? Sure. The initial version of this patch didn't do this, and during testing I hit a bunch of xfstests failures. In ext2 at least I believe these were happening because we were skipping the call into generic_writepages() for DAX inodes. Without a lot of data to back this up, my guess is that this is due to metadata inodes or something being marked as DAX (so dax_mapping(mapping) returns true), but having dirty page cache pages that need to be written back as part of the writeback. Changing this so we always call generic_writepages() even in the DAX case solved the xfstest failures. If this sounds incorrect, please let me know and I'll go and gather more data. - Ross From sandeen@redhat.com Wed Feb 10 17:36:40 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=ham version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay3.corp.sgi.com [198.149.34.15]) by oss.sgi.com (Postfix) with ESMTP id 6FB3D7CB0 for ; Wed, 10 Feb 2016 17:36:40 -0600 (CST) Received: from cuda.sgi.com (cuda1.sgi.com [192.48.157.11]) by relay3.corp.sgi.com (Postfix) with ESMTP id 11ABDAC001 for ; Wed, 10 Feb 2016 15:36:36 -0800 (PST) X-ASG-Debug-ID: 1455147395-04bdf066ec50fd0001-NocioJ Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by cuda.sgi.com with ESMTP id wohm9WJkEQImkUfJ (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO) for ; Wed, 10 Feb 2016 15:36:35 -0800 (PST) X-Barracuda-Envelope-From: sandeen@redhat.com X-Barracuda-Apparent-Source-IP: 209.132.183.28 X-ASG-Whitelist: Client Received: from int-mx14.intmail.prod.int.phx2.redhat.com (int-mx14.intmail.prod.int.phx2.redhat.com [10.5.11.27]) by mx1.redhat.com (Postfix) with ESMTPS id 015ED13A6A for ; Wed, 10 Feb 2016 23:36:34 +0000 (UTC) Received: from Liberator.local (ovpn01.gateway.prod.ext.phx2.redhat.com [10.5.9.1]) by int-mx14.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id u1ANaYNi013243 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Wed, 10 Feb 2016 18:36:34 -0500 To: xfs@oss.sgi.com From: Eric Sandeen Subject: [PATCH 0/3] xfs: mount option handling fixups Message-ID: <56BBC982.50804@redhat.com> X-ASG-Orig-Subj: [PATCH 0/3] xfs: mount option handling fixups Date: Wed, 10 Feb 2016 17:36:34 -0600 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.11; rv:38.0) Gecko/20100101 Thunderbird/38.5.1 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-Scanned-By: MIMEDefang 2.68 on 10.5.11.27 X-Barracuda-Connect: mx1.redhat.com[209.132.183.28] X-Barracuda-Start-Time: 1455147395 X-Barracuda-Encrypted: ECDHE-RSA-AES256-GCM-SHA384 X-Barracuda-URL: https://192.48.157.11:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-BRTS-Status: 1 1) convert to token parsing 2) basic sanitization of remount options, via normal option parsing 3) attempt (this is RFE-ish) to discern remount problems with otherwise valid options From sandeen@sandeen.net Wed Feb 10 17:38:24 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=ham version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay1.corp.sgi.com [137.38.102.111]) by oss.sgi.com (Postfix) with ESMTP id B85C67CBC for ; Wed, 10 Feb 2016 17:38:24 -0600 (CST) Received: from cuda.sgi.com (cuda1.sgi.com [192.48.157.11]) by relay1.corp.sgi.com (Postfix) with ESMTP id 7B5FB8F8059 for ; Wed, 10 Feb 2016 15:38:21 -0800 (PST) X-ASG-Debug-ID: 1455147494-04bdf066eb51040001-NocioJ Received: from sandeen.net (sandeen.net [63.231.237.45]) by cuda.sgi.com with ESMTP id CuG0cRbH1YHzk4UK for ; Wed, 10 Feb 2016 15:38:14 -0800 (PST) X-Barracuda-Envelope-From: sandeen@sandeen.net X-Barracuda-Apparent-Source-IP: 63.231.237.45 Received: from Liberator.local (70-90-76-85-BusName-mn.hfc.comcastbusiness.net [70.90.76.85]) (using TLSv1.2 with cipher DHE-RSA-AES128-SHA (128/128 bits)) (No client certificate requested) by sandeen.net (Postfix) with ESMTPSA id 572C263C607A for ; Wed, 10 Feb 2016 17:38:14 -0600 (CST) Subject: [PATCH 1/3] xfs: convert mount option parsing to tokens To: xfs@oss.sgi.com X-ASG-Orig-Subj: [PATCH 1/3] xfs: convert mount option parsing to tokens References: <56BBC982.50804@redhat.com> From: Eric Sandeen Message-ID: <56BBC9E6.5030100@sandeen.net> Date: Wed, 10 Feb 2016 17:38:14 -0600 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.11; rv:38.0) Gecko/20100101 Thunderbird/38.5.1 MIME-Version: 1.0 In-Reply-To: <56BBC982.50804@redhat.com> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit X-Barracuda-Connect: sandeen.net[63.231.237.45] X-Barracuda-Start-Time: 1455147494 X-Barracuda-URL: https://192.48.157.11:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-BRTS-Status: 1 X-Barracuda-Spam-Score: 0.00 X-Barracuda-Spam-Status: No, SCORE=0.00 using per-user scores of TAG_LEVEL=1000.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.7 tests= X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.3.26929 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- This should be a no-op change, just switch to token parsing like every other respectable filesystem does. Signed-off-by: Eric Sandeen --- diff --git a/fs/xfs/xfs_super.c b/fs/xfs/xfs_super.c index 59c9b7b..934233a 100644 --- a/fs/xfs/xfs_super.c +++ b/fs/xfs/xfs_super.c @@ -65,83 +65,82 @@ static struct kset *xfs_kset; /* top-level xfs sysfs dir */ static struct xfs_kobj xfs_dbg_kobj; /* global debug sysfs attrs */ #endif -#define MNTOPT_LOGBUFS "logbufs" /* number of XFS log buffers */ -#define MNTOPT_LOGBSIZE "logbsize" /* size of XFS log buffers */ -#define MNTOPT_LOGDEV "logdev" /* log device */ -#define MNTOPT_RTDEV "rtdev" /* realtime I/O device */ -#define MNTOPT_BIOSIZE "biosize" /* log2 of preferred buffered io size */ -#define MNTOPT_WSYNC "wsync" /* safe-mode nfs compatible mount */ -#define MNTOPT_NOALIGN "noalign" /* turn off stripe alignment */ -#define MNTOPT_SWALLOC "swalloc" /* turn on stripe width allocation */ -#define MNTOPT_SUNIT "sunit" /* data volume stripe unit */ -#define MNTOPT_SWIDTH "swidth" /* data volume stripe width */ -#define MNTOPT_NOUUID "nouuid" /* ignore filesystem UUID */ -#define MNTOPT_MTPT "mtpt" /* filesystem mount point */ -#define MNTOPT_GRPID "grpid" /* group-ID from parent directory */ -#define MNTOPT_NOGRPID "nogrpid" /* group-ID from current process */ -#define MNTOPT_BSDGROUPS "bsdgroups" /* group-ID from parent directory */ -#define MNTOPT_SYSVGROUPS "sysvgroups" /* group-ID from current process */ -#define MNTOPT_ALLOCSIZE "allocsize" /* preferred allocation size */ -#define MNTOPT_NORECOVERY "norecovery" /* don't run XFS recovery */ -#define MNTOPT_BARRIER "barrier" /* use writer barriers for log write and - * unwritten extent conversion */ -#define MNTOPT_NOBARRIER "nobarrier" /* .. disable */ -#define MNTOPT_64BITINODE "inode64" /* inodes can be allocated anywhere */ -#define MNTOPT_32BITINODE "inode32" /* inode allocation limited to - * XFS_MAXINUMBER_32 */ -#define MNTOPT_IKEEP "ikeep" /* do not free empty inode clusters */ -#define MNTOPT_NOIKEEP "noikeep" /* free empty inode clusters */ -#define MNTOPT_LARGEIO "largeio" /* report large I/O sizes in stat() */ -#define MNTOPT_NOLARGEIO "nolargeio" /* do not report large I/O sizes - * in stat(). */ -#define MNTOPT_ATTR2 "attr2" /* do use attr2 attribute format */ -#define MNTOPT_NOATTR2 "noattr2" /* do not use attr2 attribute format */ -#define MNTOPT_FILESTREAM "filestreams" /* use filestreams allocator */ -#define MNTOPT_QUOTA "quota" /* disk quotas (user) */ -#define MNTOPT_NOQUOTA "noquota" /* no quotas */ -#define MNTOPT_USRQUOTA "usrquota" /* user quota enabled */ -#define MNTOPT_GRPQUOTA "grpquota" /* group quota enabled */ -#define MNTOPT_PRJQUOTA "prjquota" /* project quota enabled */ -#define MNTOPT_UQUOTA "uquota" /* user quota (IRIX variant) */ -#define MNTOPT_GQUOTA "gquota" /* group quota (IRIX variant) */ -#define MNTOPT_PQUOTA "pquota" /* project quota (IRIX variant) */ -#define MNTOPT_UQUOTANOENF "uqnoenforce"/* user quota limit enforcement */ -#define MNTOPT_GQUOTANOENF "gqnoenforce"/* group quota limit enforcement */ -#define MNTOPT_PQUOTANOENF "pqnoenforce"/* project quota limit enforcement */ -#define MNTOPT_QUOTANOENF "qnoenforce" /* same as uqnoenforce */ -#define MNTOPT_DISCARD "discard" /* Discard unused blocks */ -#define MNTOPT_NODISCARD "nodiscard" /* Do not discard unused blocks */ - -#define MNTOPT_DAX "dax" /* Enable direct access to bdev pages */ - /* * Table driven mount option parser. - * - * Currently only used for remount, but it will be used for mount - * in the future, too. */ enum { - Opt_barrier, - Opt_nobarrier, - Opt_inode64, - Opt_inode32, - Opt_err + Opt_logbufs, Opt_logbsize, Opt_logdev, Opt_rtdev, Opt_biosize, + Opt_wsync, Opt_noalign, Opt_swalloc, Opt_sunit, Opt_swidth, Opt_nouuid, + Opt_mtpt, Opt_grpid, Opt_nogrpid, Opt_bsdgroups, Opt_sysvgroups, + Opt_allocsize, Opt_norecovery, Opt_barrier, Opt_nobarrier, + Opt_inode64, Opt_inode32, Opt_ikeep, Opt_noikeep, + Opt_largeio, Opt_nolargeio, Opt_attr2, Opt_noattr2, Opt_filestreams, + Opt_quota, Opt_noquota, Opt_usrquota, Opt_grpquota, Opt_prjquota, + Opt_uquota, Opt_gquota, Opt_pquota, + Opt_uqnoenforce, Opt_gqnoenforce, Opt_pqnoenforce, Opt_qnoenforce, + Opt_discard, Opt_nodiscard, Opt_dax, Opt_err, }; static const match_table_t tokens = { - {Opt_barrier, "barrier"}, - {Opt_nobarrier, "nobarrier"}, - {Opt_inode64, "inode64"}, - {Opt_inode32, "inode32"}, - {Opt_err, NULL} + {Opt_logbufs, "logbufs=%u"}, /* number of XFS log buffers */ + {Opt_logbsize, "logbsize=%s"}, /* size of XFS log buffers */ + {Opt_logdev, "logdev=%s"}, /* log device */ + {Opt_rtdev, "rtdev=%s"}, /* realtime I/O device */ + {Opt_biosize, "biosize=%u"}, /* log2 of preferred buffered io size */ + {Opt_wsync, "wsync"}, /* safe-mode nfs compatible mount */ + {Opt_noalign, "noalign"}, /* turn off stripe alignment */ + {Opt_swalloc, "swalloc"}, /* turn on stripe width allocation */ + {Opt_sunit, "sunit=%u"}, /* data volume stripe unit */ + {Opt_swidth, "swidth=%u"}, /* data volume stripe width */ + {Opt_nouuid, "nouuid"}, /* ignore filesystem UUID */ + {Opt_mtpt, "mtpt"}, /* filesystem mount point */ + {Opt_grpid, "grpid"}, /* group-ID from parent directory */ + {Opt_nogrpid, "nogrpid"}, /* group-ID from current process */ + {Opt_bsdgroups, "bsdgroups"}, /* group-ID from parent directory */ + {Opt_sysvgroups,"sysvgroups"}, /* group-ID from current process */ + {Opt_allocsize, "allocsize=%s"},/* preferred allocation size */ + {Opt_norecovery,"norecovery"}, /* don't run XFS recovery */ + {Opt_barrier, "barrier"}, /* use writer barriers for log write and + * unwritten extent conversion */ + {Opt_nobarrier, "nobarrier"}, /* .. disable */ + {Opt_inode64, "inode64"}, /* inodes can be allocated anywhere */ + {Opt_inode32, "inode32"}, /* inode allocation limited to + * XFS_MAXINUMBER_32 */ + {Opt_ikeep, "ikeep"}, /* do not free empty inode clusters */ + {Opt_noikeep, "noikeep"}, /* free empty inode clusters */ + {Opt_largeio, "largeio"}, /* report large I/O sizes in stat() */ + {Opt_nolargeio, "nolargeio"}, /* do not report large I/O sizes + * in stat(). */ + {Opt_attr2, "attr2"}, /* do use attr2 attribute format */ + {Opt_noattr2, "noattr2"}, /* do not use attr2 attribute format */ + {Opt_filestreams,"filestreams"},/* use filestreams allocator */ + {Opt_quota, "quota"}, /* disk quotas (user) */ + {Opt_noquota, "noquota"}, /* no quotas */ + {Opt_usrquota, "usrquota"}, /* user quota enabled */ + {Opt_grpquota, "grpquota"}, /* group quota enabled */ + {Opt_prjquota, "prjquota"}, /* project quota enabled */ + {Opt_uquota, "uquota"}, /* user quota (IRIX variant) */ + {Opt_gquota, "gquota"}, /* group quota (IRIX variant) */ + {Opt_pquota, "pquota"}, /* project quota (IRIX variant) */ + {Opt_uqnoenforce,"uqnoenforce"},/* user quota limit enforcement */ + {Opt_gqnoenforce,"gqnoenforce"},/* group quota limit enforcement */ + {Opt_pqnoenforce,"pqnoenforce"},/* project quota limit enforcement */ + {Opt_qnoenforce, "qnoenforce"}, /* same as uqnoenforce */ + {Opt_discard, "discard"}, /* Discard unused blocks */ + {Opt_nodiscard, "nodiscard"}, /* Do not discard unused blocks */ + + {Opt_dax, "dax"}, /* Enable direct access to bdev pages */ + {Opt_err, NULL}, }; STATIC int -suffix_kstrtoint(char *s, unsigned int base, int *res) +suffix_kstrtoint(const substring_t *s, unsigned int base, int *res) { int last, shift_left_factor = 0, _res; - char *value = s; + char *value = match_strdup(s); + int ret = 0; + last = strlen(value) - 1; if (value[last] == 'K' || value[last] == 'k') { @@ -157,10 +156,11 @@ suffix_kstrtoint(char *s, unsigned int base, int *res) value[last] = '\0'; } - if (kstrtoint(s, base, &_res)) - return -EINVAL; + if (kstrtoint(value, base, &_res)) + ret = -EINVAL; + kfree(value); *res = _res << shift_left_factor; - return 0; + return ret; } /* @@ -176,7 +176,8 @@ xfs_parseargs( char *options) { struct super_block *sb = mp->m_super; - char *this_char, *value; + char *p; + substring_t args[MAX_OPT_ARGS]; int dsunit = 0; int dswidth = 0; int iosize = 0; @@ -217,152 +218,153 @@ xfs_parseargs( if (!options) goto done; - while ((this_char = strsep(&options, ",")) != NULL) { - if (!*this_char) + while ((p = strsep(&options, ",")) != NULL) { + int token; + + if (!*p) continue; - if ((value = strchr(this_char, '=')) != NULL) - *value++ = 0; - if (!strcmp(this_char, MNTOPT_LOGBUFS)) { - if (!value || !*value) { - xfs_warn(mp, "%s option requires an argument", - this_char); - return -EINVAL; - } - if (kstrtoint(value, 10, &mp->m_logbufs)) - return -EINVAL; - } else if (!strcmp(this_char, MNTOPT_LOGBSIZE)) { - if (!value || !*value) { - xfs_warn(mp, "%s option requires an argument", - this_char); - return -EINVAL; - } - if (suffix_kstrtoint(value, 10, &mp->m_logbsize)) + token = match_token(p, tokens, args); + switch (token) { + case Opt_logbufs: + if (match_int(args, &mp->m_logbufs)) return -EINVAL; - } else if (!strcmp(this_char, MNTOPT_LOGDEV)) { - if (!value || !*value) { - xfs_warn(mp, "%s option requires an argument", - this_char); + break; + case Opt_logbsize: + if (suffix_kstrtoint(args, 10, &mp->m_logbsize)) return -EINVAL; - } - mp->m_logname = kstrndup(value, MAXNAMELEN, GFP_KERNEL); + break; + case Opt_logdev: + mp->m_logname = match_strdup(args); if (!mp->m_logname) return -ENOMEM; - } else if (!strcmp(this_char, MNTOPT_MTPT)) { - xfs_warn(mp, "%s option not allowed on this system", - this_char); + break; + case Opt_mtpt: + xfs_warn(mp, "%s option not allowed on this system", p); return -EINVAL; - } else if (!strcmp(this_char, MNTOPT_RTDEV)) { - if (!value || !*value) { - xfs_warn(mp, "%s option requires an argument", - this_char); - return -EINVAL; - } - mp->m_rtname = kstrndup(value, MAXNAMELEN, GFP_KERNEL); + break; + case Opt_rtdev: + mp->m_rtname = match_strdup(args); if (!mp->m_rtname) return -ENOMEM; - } else if (!strcmp(this_char, MNTOPT_ALLOCSIZE) || - !strcmp(this_char, MNTOPT_BIOSIZE)) { - if (!value || !*value) { - xfs_warn(mp, "%s option requires an argument", - this_char); - return -EINVAL; - } - if (suffix_kstrtoint(value, 10, &iosize)) + break; + case Opt_allocsize: + case Opt_biosize: + if (suffix_kstrtoint(args, 10, &iosize)) return -EINVAL; iosizelog = ffs(iosize) - 1; - } else if (!strcmp(this_char, MNTOPT_GRPID) || - !strcmp(this_char, MNTOPT_BSDGROUPS)) { + break; + case Opt_grpid: + case Opt_bsdgroups: mp->m_flags |= XFS_MOUNT_GRPID; - } else if (!strcmp(this_char, MNTOPT_NOGRPID) || - !strcmp(this_char, MNTOPT_SYSVGROUPS)) { + break; + case Opt_nogrpid: + case Opt_sysvgroups: mp->m_flags &= ~XFS_MOUNT_GRPID; - } else if (!strcmp(this_char, MNTOPT_WSYNC)) { + break; + case Opt_wsync: mp->m_flags |= XFS_MOUNT_WSYNC; - } else if (!strcmp(this_char, MNTOPT_NORECOVERY)) { + break; + case Opt_norecovery: mp->m_flags |= XFS_MOUNT_NORECOVERY; - } else if (!strcmp(this_char, MNTOPT_NOALIGN)) { + break; + case Opt_noalign: mp->m_flags |= XFS_MOUNT_NOALIGN; - } else if (!strcmp(this_char, MNTOPT_SWALLOC)) { + break; + case Opt_swalloc: mp->m_flags |= XFS_MOUNT_SWALLOC; - } else if (!strcmp(this_char, MNTOPT_SUNIT)) { - if (!value || !*value) { - xfs_warn(mp, "%s option requires an argument", - this_char); - return -EINVAL; - } - if (kstrtoint(value, 10, &dsunit)) - return -EINVAL; - } else if (!strcmp(this_char, MNTOPT_SWIDTH)) { - if (!value || !*value) { - xfs_warn(mp, "%s option requires an argument", - this_char); + break; + case Opt_sunit: + if (match_int(args, &dsunit)) return -EINVAL; - } - if (kstrtoint(value, 10, &dswidth)) + break; + case Opt_swidth: + if (match_int(args, &dswidth)) return -EINVAL; - } else if (!strcmp(this_char, MNTOPT_32BITINODE)) { + break; + case Opt_inode32: mp->m_flags |= XFS_MOUNT_SMALL_INUMS; - } else if (!strcmp(this_char, MNTOPT_64BITINODE)) { + break; + case Opt_inode64: mp->m_flags &= ~XFS_MOUNT_SMALL_INUMS; - } else if (!strcmp(this_char, MNTOPT_NOUUID)) { + break; + case Opt_nouuid: mp->m_flags |= XFS_MOUNT_NOUUID; - } else if (!strcmp(this_char, MNTOPT_BARRIER)) { + break; + case Opt_barrier: mp->m_flags |= XFS_MOUNT_BARRIER; - } else if (!strcmp(this_char, MNTOPT_NOBARRIER)) { + break; + case Opt_nobarrier: mp->m_flags &= ~XFS_MOUNT_BARRIER; - } else if (!strcmp(this_char, MNTOPT_IKEEP)) { + break; + case Opt_ikeep: mp->m_flags |= XFS_MOUNT_IKEEP; - } else if (!strcmp(this_char, MNTOPT_NOIKEEP)) { + break; + case Opt_noikeep: mp->m_flags &= ~XFS_MOUNT_IKEEP; - } else if (!strcmp(this_char, MNTOPT_LARGEIO)) { + break; + case Opt_largeio: mp->m_flags &= ~XFS_MOUNT_COMPAT_IOSIZE; - } else if (!strcmp(this_char, MNTOPT_NOLARGEIO)) { + break; + case Opt_nolargeio: mp->m_flags |= XFS_MOUNT_COMPAT_IOSIZE; - } else if (!strcmp(this_char, MNTOPT_ATTR2)) { + break; + case Opt_attr2: mp->m_flags |= XFS_MOUNT_ATTR2; - } else if (!strcmp(this_char, MNTOPT_NOATTR2)) { + break; + case Opt_noattr2: mp->m_flags &= ~XFS_MOUNT_ATTR2; mp->m_flags |= XFS_MOUNT_NOATTR2; - } else if (!strcmp(this_char, MNTOPT_FILESTREAM)) { + break; + case Opt_filestreams: mp->m_flags |= XFS_MOUNT_FILESTREAMS; - } else if (!strcmp(this_char, MNTOPT_NOQUOTA)) { + break; + case Opt_noquota: mp->m_qflags &= ~XFS_ALL_QUOTA_ACCT; mp->m_qflags &= ~XFS_ALL_QUOTA_ENFD; mp->m_qflags &= ~XFS_ALL_QUOTA_ACTIVE; - } else if (!strcmp(this_char, MNTOPT_QUOTA) || - !strcmp(this_char, MNTOPT_UQUOTA) || - !strcmp(this_char, MNTOPT_USRQUOTA)) { + break; + case Opt_quota: + case Opt_uquota: + case Opt_usrquota: mp->m_qflags |= (XFS_UQUOTA_ACCT | XFS_UQUOTA_ACTIVE | XFS_UQUOTA_ENFD); - } else if (!strcmp(this_char, MNTOPT_QUOTANOENF) || - !strcmp(this_char, MNTOPT_UQUOTANOENF)) { + break; + case Opt_qnoenforce: + case Opt_uqnoenforce: mp->m_qflags |= (XFS_UQUOTA_ACCT | XFS_UQUOTA_ACTIVE); mp->m_qflags &= ~XFS_UQUOTA_ENFD; - } else if (!strcmp(this_char, MNTOPT_PQUOTA) || - !strcmp(this_char, MNTOPT_PRJQUOTA)) { + break; + case Opt_pquota: + case Opt_prjquota: mp->m_qflags |= (XFS_PQUOTA_ACCT | XFS_PQUOTA_ACTIVE | XFS_PQUOTA_ENFD); - } else if (!strcmp(this_char, MNTOPT_PQUOTANOENF)) { + break; + case Opt_pqnoenforce: mp->m_qflags |= (XFS_PQUOTA_ACCT | XFS_PQUOTA_ACTIVE); mp->m_qflags &= ~XFS_PQUOTA_ENFD; - } else if (!strcmp(this_char, MNTOPT_GQUOTA) || - !strcmp(this_char, MNTOPT_GRPQUOTA)) { + case Opt_gquota: + case Opt_grpquota: mp->m_qflags |= (XFS_GQUOTA_ACCT | XFS_GQUOTA_ACTIVE | XFS_GQUOTA_ENFD); - } else if (!strcmp(this_char, MNTOPT_GQUOTANOENF)) { + break; + case Opt_gqnoenforce: mp->m_qflags |= (XFS_GQUOTA_ACCT | XFS_GQUOTA_ACTIVE); mp->m_qflags &= ~XFS_GQUOTA_ENFD; - } else if (!strcmp(this_char, MNTOPT_DISCARD)) { + break; + case Opt_discard: mp->m_flags |= XFS_MOUNT_DISCARD; - } else if (!strcmp(this_char, MNTOPT_NODISCARD)) { + break; + case Opt_nodiscard: mp->m_flags &= ~XFS_MOUNT_DISCARD; + break; #ifdef CONFIG_FS_DAX - } else if (!strcmp(this_char, MNTOPT_DAX)) { + case Opt_dax: mp->m_flags |= XFS_MOUNT_DAX; + break; #endif - } else { - xfs_warn(mp, "unknown mount option [%s].", this_char); + default: + xfs_warn(mp, "unknown mount option [%s].", p); return -EINVAL; } } @@ -461,25 +463,25 @@ xfs_showargs( { static struct proc_xfs_info xfs_info_set[] = { /* the few simple ones we can get from the mount struct */ - { XFS_MOUNT_IKEEP, "," MNTOPT_IKEEP }, - { XFS_MOUNT_WSYNC, "," MNTOPT_WSYNC }, - { XFS_MOUNT_NOALIGN, "," MNTOPT_NOALIGN }, - { XFS_MOUNT_SWALLOC, "," MNTOPT_SWALLOC }, - { XFS_MOUNT_NOUUID, "," MNTOPT_NOUUID }, - { XFS_MOUNT_NORECOVERY, "," MNTOPT_NORECOVERY }, - { XFS_MOUNT_ATTR2, "," MNTOPT_ATTR2 }, - { XFS_MOUNT_FILESTREAMS, "," MNTOPT_FILESTREAM }, - { XFS_MOUNT_GRPID, "," MNTOPT_GRPID }, - { XFS_MOUNT_DISCARD, "," MNTOPT_DISCARD }, - { XFS_MOUNT_SMALL_INUMS, "," MNTOPT_32BITINODE }, - { XFS_MOUNT_DAX, "," MNTOPT_DAX }, + { XFS_MOUNT_IKEEP, ",ikeep" }, + { XFS_MOUNT_WSYNC, ",wsync" }, + { XFS_MOUNT_NOALIGN, ",noalign" }, + { XFS_MOUNT_SWALLOC, ",swalloc" }, + { XFS_MOUNT_NOUUID, ",nouuid" }, + { XFS_MOUNT_NORECOVERY, ",norecovery" }, + { XFS_MOUNT_ATTR2, ",attr2" }, + { XFS_MOUNT_FILESTREAMS, ",filestreams" }, + { XFS_MOUNT_GRPID, ",grpid" }, + { XFS_MOUNT_DISCARD, ",discard" }, + { XFS_MOUNT_SMALL_INUMS, ",inode32" }, + { XFS_MOUNT_DAX, ",dax" }, { 0, NULL } }; static struct proc_xfs_info xfs_info_unset[] = { /* the few simple ones we can get from the mount struct */ - { XFS_MOUNT_COMPAT_IOSIZE, "," MNTOPT_LARGEIO }, - { XFS_MOUNT_BARRIER, "," MNTOPT_NOBARRIER }, - { XFS_MOUNT_SMALL_INUMS, "," MNTOPT_64BITINODE }, + { XFS_MOUNT_COMPAT_IOSIZE, ",largeio" }, + { XFS_MOUNT_BARRIER, ",nobarrier" }, + { XFS_MOUNT_SMALL_INUMS, ",inode64" }, { 0, NULL } }; struct proc_xfs_info *xfs_infop; @@ -494,46 +496,46 @@ xfs_showargs( } if (mp->m_flags & XFS_MOUNT_DFLT_IOSIZE) - seq_printf(m, "," MNTOPT_ALLOCSIZE "=%dk", + seq_printf(m, ",allocsize=%dk", (int)(1 << mp->m_writeio_log) >> 10); if (mp->m_logbufs > 0) - seq_printf(m, "," MNTOPT_LOGBUFS "=%d", mp->m_logbufs); + seq_printf(m, ",logbufs=%d", mp->m_logbufs); if (mp->m_logbsize > 0) - seq_printf(m, "," MNTOPT_LOGBSIZE "=%dk", mp->m_logbsize >> 10); + seq_printf(m, ",logbsize=%dk", mp->m_logbsize >> 10); if (mp->m_logname) - seq_show_option(m, MNTOPT_LOGDEV, mp->m_logname); + seq_show_option(m, "logdev", mp->m_logname); if (mp->m_rtname) - seq_show_option(m, MNTOPT_RTDEV, mp->m_rtname); + seq_show_option(m, "rtdev", mp->m_rtname); if (mp->m_dalign > 0) - seq_printf(m, "," MNTOPT_SUNIT "=%d", + seq_printf(m, ",sunit=%d", (int)XFS_FSB_TO_BB(mp, mp->m_dalign)); if (mp->m_swidth > 0) - seq_printf(m, "," MNTOPT_SWIDTH "=%d", + seq_printf(m, ",swidth=%d", (int)XFS_FSB_TO_BB(mp, mp->m_swidth)); if (mp->m_qflags & (XFS_UQUOTA_ACCT|XFS_UQUOTA_ENFD)) - seq_puts(m, "," MNTOPT_USRQUOTA); + seq_puts(m, ",usrquota"); else if (mp->m_qflags & XFS_UQUOTA_ACCT) - seq_puts(m, "," MNTOPT_UQUOTANOENF); + seq_puts(m, ",uqnoenforce"); if (mp->m_qflags & XFS_PQUOTA_ACCT) { if (mp->m_qflags & XFS_PQUOTA_ENFD) - seq_puts(m, "," MNTOPT_PRJQUOTA); + seq_puts(m, ",prjquota"); else - seq_puts(m, "," MNTOPT_PQUOTANOENF); + seq_puts(m, ",pqnoenforce"); } if (mp->m_qflags & XFS_GQUOTA_ACCT) { if (mp->m_qflags & XFS_GQUOTA_ENFD) - seq_puts(m, "," MNTOPT_GRPQUOTA); + seq_puts(m, ",grpquota"); else - seq_puts(m, "," MNTOPT_GQUOTANOENF); + seq_puts(m, ",gqnoenforce"); } if (!(mp->m_qflags & XFS_ALL_QUOTA_ACCT)) - seq_puts(m, "," MNTOPT_NOQUOTA); + seq_puts(m, ",noquota"); return 0; } @@ -1344,9 +1346,8 @@ xfs_finish_flags( */ if (xfs_sb_version_hascrc(&mp->m_sb) && (mp->m_flags & XFS_MOUNT_NOATTR2)) { - xfs_warn(mp, -"Cannot mount a V5 filesystem as %s. %s is always enabled for V5 filesystems.", - MNTOPT_NOATTR2, MNTOPT_ATTR2); + xfs_warn(mp, "Cannot mount a V5 filesystem as noattr2. " + "attr2 is always enabled for V5 filesystems."); return -EINVAL; } From sandeen@sandeen.net Wed Feb 10 17:40:08 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=ham version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay3.corp.sgi.com [198.149.34.15]) by oss.sgi.com (Postfix) with ESMTP id 54F7C7CBC for ; Wed, 10 Feb 2016 17:40:08 -0600 (CST) Received: from cuda.sgi.com (cuda1.sgi.com [192.48.157.11]) by relay3.corp.sgi.com (Postfix) with ESMTP id D4BEAAC00B for ; Wed, 10 Feb 2016 15:40:07 -0800 (PST) X-ASG-Debug-ID: 1455147605-04bdf066ea510d0001-NocioJ Received: from sandeen.net (sandeen.net [63.231.237.45]) by cuda.sgi.com with ESMTP id kPLpo4jCnSLg2vmV for ; Wed, 10 Feb 2016 15:40:05 -0800 (PST) X-Barracuda-Envelope-From: sandeen@sandeen.net X-Barracuda-Apparent-Source-IP: 63.231.237.45 Received: from Liberator.local (70-90-76-85-BusName-mn.hfc.comcastbusiness.net [70.90.76.85]) (using TLSv1.2 with cipher DHE-RSA-AES128-SHA (128/128 bits)) (No client certificate requested) by sandeen.net (Postfix) with ESMTPSA id 9B65863C607A for ; Wed, 10 Feb 2016 17:40:05 -0600 (CST) Subject: [PATCH 2/3] xfs: sanitize remount options To: xfs@oss.sgi.com X-ASG-Orig-Subj: [PATCH 2/3] xfs: sanitize remount options References: <56BBC982.50804@redhat.com> From: Eric Sandeen Message-ID: <56BBCA55.3000506@sandeen.net> Date: Wed, 10 Feb 2016 17:40:05 -0600 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.11; rv:38.0) Gecko/20100101 Thunderbird/38.5.1 MIME-Version: 1.0 In-Reply-To: <56BBC982.50804@redhat.com> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit X-Barracuda-Connect: sandeen.net[63.231.237.45] X-Barracuda-Start-Time: 1455147605 X-Barracuda-URL: https://192.48.157.11:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-BRTS-Status: 1 X-Barracuda-Spam-Score: 0.00 X-Barracuda-Spam-Status: No, SCORE=0.00 using per-user scores of TAG_LEVEL=1000.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.7 tests= X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.3.26929 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- Perform basic sanitization of remount options by passing the option string and a dummy mount structure through xfs_parseargs and returning the result. Signed-off-by: Eric Sandeen --- diff --git a/fs/xfs/xfs_super.c b/fs/xfs/xfs_super.c index 934233a..d1cd4fa 100644 --- a/fs/xfs/xfs_super.c +++ b/fs/xfs/xfs_super.c @@ -1168,6 +1168,27 @@ xfs_quiesce_attr( } STATIC int +xfs_test_remount_options( + struct super_block *sb, + struct xfs_mount *mp, + char *options) +{ + int error = 0; + struct xfs_mount *tmp; + + tmp = kmem_zalloc(sizeof(*tmp), KM_MAYFAIL); + if (!tmp) + return -ENOMEM; + + tmp->m_super = sb; + error = xfs_parseargs(tmp, options); + xfs_free_fsname(tmp); + kfree(tmp); + + return error; +} + +STATIC int xfs_fs_remount( struct super_block *sb, int *flags, @@ -1179,6 +1200,11 @@ xfs_fs_remount( char *p; int error; + /* First, check for complete junk; i.e. invalid options */ + error = xfs_test_remount_options(sb, mp, options); + if (error) + return error; + sync_filesystem(sb); while ((p = strsep(&options, ",")) != NULL) { int token; From david@fromorbit.com Wed Feb 10 17:44:08 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=ham version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay2.corp.sgi.com [137.38.102.29]) by oss.sgi.com (Postfix) with ESMTP id 1DA7B7CBC for ; Wed, 10 Feb 2016 17:44:08 -0600 (CST) Received: from cuda.sgi.com (cuda3.sgi.com [192.48.176.15]) by relay2.corp.sgi.com (Postfix) with ESMTP id 0A357304051 for ; Wed, 10 Feb 2016 15:44:04 -0800 (PST) X-ASG-Debug-ID: 1455147842-04cb6c1e574c060001-NocioJ Received: from ipmail06.adl2.internode.on.net (ipmail06.adl2.internode.on.net [150.101.137.129]) by cuda.sgi.com with ESMTP id 5bcoaQAcGgF6rqCo for ; Wed, 10 Feb 2016 15:44:02 -0800 (PST) X-Barracuda-Envelope-From: david@fromorbit.com X-Barracuda-Apparent-Source-IP: 150.101.137.129 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: A2CYDADqybtWPBATLHleDhoBAoMPgT+CaIN6gXmdVAEBAQEBAQaLZ4VFhAeGBwICAQECgThNAQEBAQEBBwEBAQFBP4RBAQEBAwEnExwoCwgDGAklDwUlAwcaARKIEwfAXQELHhiFMoR+iGwFlneNSIFkhEODJoUvg1OKbIQLTyguAYhSAQEB Received: from ppp121-44-19-16.lns20.syd4.internode.on.net (HELO dastard) ([121.44.19.16]) by ipmail06.adl2.internode.on.net with ESMTP; 11 Feb 2016 10:14:01 +1030 Received: from dave by dastard with local (Exim 4.80) (envelope-from ) id 1aTeQS-0007Bc-6F; Thu, 11 Feb 2016 10:44:00 +1100 Date: Thu, 11 Feb 2016 10:44:00 +1100 From: Dave Chinner To: Ross Zwisler , linux-kernel@vger.kernel.org, Theodore Ts'o , Alexander Viro , Andreas Dilger , Andrew Morton , Dan Williams , Jan Kara , Matthew Wilcox , linux-ext4@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux-mm@kvack.org, linux-nvdimm@lists.01.org, xfs@oss.sgi.com, Jan Kara Subject: Re: [PATCH v2 2/2] dax: move writeback calls into the filesystems Message-ID: <20160210234400.GQ14668@dastard> X-ASG-Orig-Subj: Re: [PATCH v2 2/2] dax: move writeback calls into the filesystems References: <1455137336-28720-1-git-send-email-ross.zwisler@linux.intel.com> <1455137336-28720-3-git-send-email-ross.zwisler@linux.intel.com> <20160210220312.GP14668@dastard> <20160210224340.GA30938@linux.intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20160210224340.GA30938@linux.intel.com> User-Agent: Mutt/1.5.21 (2010-09-15) X-Barracuda-Connect: ipmail06.adl2.internode.on.net[150.101.137.129] X-Barracuda-Start-Time: 1455147842 X-Barracuda-URL: https://192.48.176.15:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-BRTS-Status: 1 X-Barracuda-Spam-Score: 0.00 X-Barracuda-Spam-Status: No, SCORE=0.00 using per-user scores of TAG_LEVEL=1000.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.7 tests=BSF_SC0_MISMATCH_TO X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.3.26929 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 0.00 BSF_SC0_MISMATCH_TO Envelope rcpt doesn't match header On Wed, Feb 10, 2016 at 03:43:40PM -0700, Ross Zwisler wrote: > On Thu, Feb 11, 2016 at 09:03:12AM +1100, Dave Chinner wrote: > > On Wed, Feb 10, 2016 at 01:48:56PM -0700, Ross Zwisler wrote: > > > Previously calls to dax_writeback_mapping_range() for all DAX filesystems > > > (ext2, ext4 & xfs) were centralized in filemap_write_and_wait_range(). > > > dax_writeback_mapping_range() needs a struct block_device, and it used to > > > get that from inode->i_sb->s_bdev. This is correct for normal inodes > > > mounted on ext2, ext4 and XFS filesystems, but is incorrect for DAX raw > > > block devices and for XFS real-time files. > > > > > > Instead, call dax_writeback_mapping_range() directly from the filesystem > > > ->writepages function so that it can supply us with a valid block > > > device. This also fixes DAX code to properly flush caches in response to > > > sync(2). > > > > > > Signed-off-by: Ross Zwisler > > > Signed-off-by: Jan Kara > > > --- > > > fs/block_dev.c | 16 +++++++++++++++- > > > fs/dax.c | 13 ++++++++----- > > > fs/ext2/inode.c | 11 +++++++++++ > > > fs/ext4/inode.c | 7 +++++++ > > > fs/xfs/xfs_aops.c | 9 +++++++++ > > > include/linux/dax.h | 6 ++++-- > > > mm/filemap.c | 12 ++++-------- > > > 7 files changed, 58 insertions(+), 16 deletions(-) > > > > > > diff --git a/fs/block_dev.c b/fs/block_dev.c > > > index 39b3a17..fc01e43 100644 > > > --- a/fs/block_dev.c > > > +++ b/fs/block_dev.c > > > @@ -1693,13 +1693,27 @@ static int blkdev_releasepage(struct page *page, gfp_t wait) > > > return try_to_free_buffers(page); > > > } > > > > > > +static int blkdev_writepages(struct address_space *mapping, > > > + struct writeback_control *wbc) > > > +{ > > > + if (dax_mapping(mapping)) { > > > + struct block_device *bdev = I_BDEV(mapping->host); > > > + int error; > > > + > > > + error = dax_writeback_mapping_range(mapping, bdev, wbc); > > > + if (error) > > > + return error; > > > + } > > > + return generic_writepages(mapping, wbc); > > > +} > > > > Can you remind of the reason for calling generic_writepages() on DAX > > enabled address spaces? > > Sure. The initial version of this patch didn't do this, and during testing I > hit a bunch of xfstests failures. In ext2 at least I believe these were > happening because we were skipping the call into generic_writepages() for DAX > inodes. Without a lot of data to back this up, my guess is that this is due > to metadata inodes or something being marked as DAX (so dax_mapping(mapping) > returns true), but having dirty page cache pages that need to be written back > as part of the writeback. Hmmm - the ext2 filesystem metadata uses the block device page cache to buffer inode writeback, and so writeback doesn't occur until sync_blockdev() is called. But the data access should be through the ext2 inode address space, not the block device address space, so DAX flushing occurs in ext2_writepages. So how is the block device inode being marked as a DAX inode? If it is being marked as a DAX inode, how is this valid when the filesystem metadata uses bufferheads and requires struct pages to be found in the block device mapping tree? e.g. mkfs writes the metadata into the bdev via DAX, resulting in an DAX exceptional entry in the bdev radix tree, then __bread_gfp() comes along to read the same metadata after mount and expects to find pages in the blockdev radix tree? FWIW, this seems to be specifically a block device inode issue, though, not something that affects regular files in a filesystem. i.e. filesystem inodes can only be either DAX or non-DAX, and so there is no mixed mode flushing required, right? > Changing this so we always call generic_writepages() even in the > DAX case solved the xfstest failures. > > If this sounds incorrect, please let me know and I'll go and > gather more data. It seems to me that there's a problem here with DAX on block device inodes, but not for the filesystem mappings. At minimum, the block device needs a bloody big comment explaining this landmine so people don't forget why it is a special snowflake... Cheers, Dave. -- Dave Chinner david@fromorbit.com From sandeen@sandeen.net Wed Feb 10 17:45:36 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=ham version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay1.corp.sgi.com [137.38.102.111]) by oss.sgi.com (Postfix) with ESMTP id 7C62C7F53 for ; Wed, 10 Feb 2016 17:45:36 -0600 (CST) Received: from cuda.sgi.com (cuda3.sgi.com [192.48.176.15]) by relay1.corp.sgi.com (Postfix) with ESMTP id 695698F8050 for ; Wed, 10 Feb 2016 15:45:36 -0800 (PST) X-ASG-Debug-ID: 1455147934-04cb6c1e584c0e0001-NocioJ Received: from sandeen.net (sandeen.net [63.231.237.45]) by cuda.sgi.com with ESMTP id 6nDvDQkZYmKc4bLG for ; Wed, 10 Feb 2016 15:45:34 -0800 (PST) X-Barracuda-Envelope-From: sandeen@sandeen.net X-Barracuda-Apparent-Source-IP: 63.231.237.45 Received: from Liberator.local (70-90-76-85-BusName-mn.hfc.comcastbusiness.net [70.90.76.85]) (using TLSv1.2 with cipher DHE-RSA-AES128-SHA (128/128 bits)) (No client certificate requested) by sandeen.net (Postfix) with ESMTPSA id C4A3963C5B52 for ; Wed, 10 Feb 2016 17:45:33 -0600 (CST) Subject: [PATCH 3/3] xfs: test for valid remount options, error if not To: xfs@oss.sgi.com X-ASG-Orig-Subj: [PATCH 3/3] xfs: test for valid remount options, error if not References: <56BBC982.50804@redhat.com> From: Eric Sandeen Message-ID: <56BBCB9D.6080404@sandeen.net> Date: Wed, 10 Feb 2016 17:45:33 -0600 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.11; rv:38.0) Gecko/20100101 Thunderbird/38.5.1 MIME-Version: 1.0 In-Reply-To: <56BBC982.50804@redhat.com> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit X-Barracuda-Connect: sandeen.net[63.231.237.45] X-Barracuda-Start-Time: 1455147934 X-Barracuda-URL: https://192.48.176.15:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-BRTS-Status: 1 X-Barracuda-Spam-Score: 0.00 X-Barracuda-Spam-Status: No, SCORE=0.00 using per-user scores of TAG_LEVEL=1000.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.7 tests= X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.3.26929 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- This patch attempts to check for a valid set of remount options. As far as I can tell, it's tricky; as the old comment says, on remount we may get a long string of options from /proc/mounts and/or /etc/mtab, as well as options specified on the commandline. Later options may negate previous options, etc. At the most basic level, we may be handed a mount option which we do not handle on remount, but which may not actually be a change from the current mount option set. Unfortunately our mount option state is somewhat far flung; a combinations of m_flags, and values in various other mount structure members; see the showargs function for a taste of that. So this extends xfs_test_remount_options() to do a full set of mount processing of the options remount sees, to arrive at a final state, then compares that state to the current state, and determines if we can proceed. Signed-off-by: Eric Sandeen --- This is lightly tested; mostly just a sanity check to see if this approach is a "wtf?" or a "yeah, seems ok." diff --git a/fs/xfs/xfs_mount.c b/fs/xfs/xfs_mount.c index 986290c..3d4187c 100644 --- a/fs/xfs/xfs_mount.c +++ b/fs/xfs/xfs_mount.c @@ -455,7 +455,7 @@ xfs_set_maxicount(xfs_mount_t *mp) * We use smaller I/O sizes when the file system * is being used for NFS service (wsync mount option). */ -STATIC void +void xfs_set_rw_sizes(xfs_mount_t *mp) { xfs_sb_t *sbp = &(mp->m_sb); diff --git a/fs/xfs/xfs_mount.h b/fs/xfs/xfs_mount.h index a4e03ab..bee9284 100644 --- a/fs/xfs/xfs_mount.h +++ b/fs/xfs/xfs_mount.h @@ -335,6 +335,7 @@ extern int xfs_sb_validate_fsb_count(struct xfs_sb *, __uint64_t); extern int xfs_dev_is_read_only(struct xfs_mount *, char *); +extern void xfs_set_rw_sizes(xfs_mount_t *); extern void xfs_set_low_space_thresholds(struct xfs_mount *); int xfs_zero_extent(struct xfs_inode *ip, xfs_fsblock_t start_fsb, diff --git a/fs/xfs/xfs_super.c b/fs/xfs/xfs_super.c index d1cd4fa..50e15d8 100644 --- a/fs/xfs/xfs_super.c +++ b/fs/xfs/xfs_super.c @@ -65,6 +65,8 @@ static struct kset *xfs_kset; /* top-level xfs sysfs dir */ static struct xfs_kobj xfs_dbg_kobj; /* global debug sysfs attrs */ #endif +STATIC int xfs_finish_flags(struct xfs_mount *mp); + /* * Table driven mount option parser. */ @@ -1167,24 +1169,87 @@ xfs_quiesce_attr( xfs_log_quiesce(mp); } +#define XFS_BAD_REMOUNT_GOTO(mp, option, l) \ + { \ + xfs_warn(mp, \ + option " options may not be changed via remount"); \ + goto l; \ + } +/* + * Remount can only handle a few options today. + * First, check for completely bogus options by looking for errors + * from xfs_parseargs. + * But if that passes, look at the result to make sure we're not changin + * anything that is not, in fact, remountable. Do this by parsing all + * options into a dummy mount structure, and compare the final result + * to the current one so we can see what actually changed. + */ STATIC int xfs_test_remount_options( struct super_block *sb, struct xfs_mount *mp, char *options) { - int error = 0; - struct xfs_mount *tmp; + int error; + struct xfs_mount *tmp_mp; + + __uint64_t ok_flags, changed_flags; - tmp = kmem_zalloc(sizeof(*tmp), KM_MAYFAIL); - if (!tmp) + tmp_mp = kmem_zalloc(sizeof(*tmp_mp), KM_MAYFAIL); + if (!tmp_mp) return -ENOMEM; - tmp->m_super = sb; - error = xfs_parseargs(tmp, options); - xfs_free_fsname(tmp); - kfree(tmp); + tmp_mp->m_super = sb; + /* structure copy */ + tmp_mp->m_sb = mp->m_sb; + + /* Emulate mount parsing & flag setting on tmp_mp */ + error = xfs_parseargs(tmp_mp, options); + if (error) + goto out; + + error = xfs_finish_flags(tmp_mp); + if (error) + goto out; + + xfs_set_rw_sizes(tmp_mp); + /* The only flags we can change on remount */ + ok_flags = XFS_MOUNT_BARRIER | XFS_MOUNT_RDONLY | + XFS_MOUNT_SMALL_INUMS | XFS_MOUNT_32BITINODES; + /* This is only used internally, so OK as well */ + ok_flags |= XFS_MOUNT_WAS_CLEAN; + + /* The flags that *did* change */ + changed_flags = (tmp_mp->m_flags ^ mp->m_flags); + + error = -EINVAL; + + if (tmp_mp->m_qflags != mp->m_qflags) + XFS_BAD_REMOUNT_GOTO(mp, "quota", out); + + if (tmp_mp->m_logbufs != mp->m_logbufs || + tmp_mp->m_logbsize != mp->m_logbsize) + XFS_BAD_REMOUNT_GOTO(mp, "logbufs/logbsize", out); + + if (tmp_mp->m_readio_log != mp->m_readio_log || + tmp_mp->m_writeio_log != mp->m_writeio_log) + XFS_BAD_REMOUNT_GOTO(mp, "allocsize/biosize", out); + + if ((tmp_mp->m_logname && mp->m_logname && + strcmp(tmp_mp->m_logname, mp->m_logname)) || + (tmp_mp->m_rtname && mp->m_rtname && + strcmp(tmp_mp->m_rtname, mp->m_rtname))) + XFS_BAD_REMOUNT_GOTO(mp, "logdev/rtdev", out); + + /* Catch-all for anything else */ + if (changed_flags & ~ok_flags) + XFS_BAD_REMOUNT_GOTO(mp, "specified", out); + + error = 0; +out: + xfs_free_fsname(tmp_mp); + kfree(tmp_mp); return error; } @@ -1200,7 +1265,12 @@ xfs_fs_remount( char *p; int error; - /* First, check for complete junk; i.e. invalid options */ + /* + * Remounting is tricky; we get various combinations + * of options, both pre-existing and changed, here. + * This function tries to ensure that what we got + * is a sane set for remounting, and errors if not. + */ error = xfs_test_remount_options(sb, mp, options); if (error) return error; @@ -1228,28 +1298,13 @@ xfs_fs_remount( break; default: /* - * Logically we would return an error here to prevent - * users from believing they might have changed - * mount options using remount which can't be changed. - * - * But unfortunately mount(8) adds all options from - * mtab and fstab to the mount arguments in some cases - * so we can't blindly reject options, but have to - * check for each specified option if it actually - * differs from the currently set option and only - * reject it if that's the case. - * - * Until that is implemented we return success for - * every remount request, and silently ignore all - * options that we can't actually change. + * xfs_test_remount_options really should have errored + * out on any non-remountable options; anything that got + * here should be a no-op; a re-statement of existing + * options. If something slipped through: too bad! + * We'll just ignore it. */ -#if 0 - xfs_info(mp, - "mount option \"%s\" not supported for remount", p); - return -EINVAL; -#else break; -#endif } } From david@fromorbit.com Wed Feb 10 18:23:33 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=ham version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay3.corp.sgi.com [198.149.34.15]) by oss.sgi.com (Postfix) with ESMTP id A793C7F58 for ; Wed, 10 Feb 2016 18:23:33 -0600 (CST) Received: from cuda.sgi.com (cuda1.sgi.com [192.48.157.11]) by relay3.corp.sgi.com (Postfix) with ESMTP id DB160AC001 for ; Wed, 10 Feb 2016 16:23:25 -0800 (PST) X-ASG-Debug-ID: 1455150198-04bdf066ec51bd0001-NocioJ Received: from ipmail06.adl2.internode.on.net (ipmail06.adl2.internode.on.net [150.101.137.129]) by cuda.sgi.com with ESMTP id alpQ0CVw2quzyhen for ; Wed, 10 Feb 2016 16:23:19 -0800 (PST) X-Barracuda-Envelope-From: david@fromorbit.com X-Barracuda-Apparent-Source-IP: 150.101.137.129 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: A2AdDAB107tWPBATLHleKAECgw+BP4Jog3qBeZ1UAQEBAQEBBotnhUWEB4YHBAICgTlNAQEBAQEBBwEBAQFBP4RCAQEEJxMcIxAIAw4KCSUPBSUDBxoTiBrAYQEBCAIeGIUyhH6IbAWWd41IjnxEjXuEWiguiFMBAQE Received: from ppp121-44-19-16.lns20.syd4.internode.on.net (HELO dastard) ([121.44.19.16]) by ipmail06.adl2.internode.on.net with ESMTP; 11 Feb 2016 10:51:38 +1030 Received: from dave by dastard with local (Exim 4.80) (envelope-from ) id 1aTf0r-0007Ff-Pf; Thu, 11 Feb 2016 11:21:37 +1100 Date: Thu, 11 Feb 2016 11:21:37 +1100 From: Dave Chinner To: Christoph Hellwig Cc: xfs@oss.sgi.com Subject: Re: [PATCH 2/8] xfs: remove xfs_cancel_ioend Message-ID: <20160211002137.GR14668@dastard> X-ASG-Orig-Subj: Re: [PATCH 2/8] xfs: remove xfs_cancel_ioend References: <1455094043-9694-1-git-send-email-david@fromorbit.com> <1455094043-9694-3-git-send-email-david@fromorbit.com> <20160210112800.GA15221@infradead.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20160210112800.GA15221@infradead.org> User-Agent: Mutt/1.5.21 (2010-09-15) X-Barracuda-Connect: ipmail06.adl2.internode.on.net[150.101.137.129] X-Barracuda-Start-Time: 1455150198 X-Barracuda-URL: https://192.48.157.11:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-BRTS-Status: 1 X-Barracuda-Spam-Score: 0.00 X-Barracuda-Spam-Status: No, SCORE=0.00 using per-user scores of TAG_LEVEL=1000.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.7 tests=BSF_SC0_MISMATCH_TO X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.3.26930 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 0.00 BSF_SC0_MISMATCH_TO Envelope rcpt doesn't match header On Wed, Feb 10, 2016 at 03:28:00AM -0800, Christoph Hellwig wrote: > > +static int > > +xfs_writepage_submit( > > + struct xfs_ioend *ioend, > > + struct xfs_ioend *iohead, > > + struct writeback_control *wbc, > > + int status) > > +{ > > + struct blk_plug plug; > > + > > + /* Reserve log space if we might write beyond the on-disk inode size. */ > > + if (!status && ioend && ioend->io_type != XFS_IO_UNWRITTEN && > > + xfs_ioend_is_append(ioend)) > > + status = xfs_setfilesize_trans_alloc(ioend); > > + > > + if (iohead) { > > + blk_start_plug(&plug); > > + xfs_submit_ioend(wbc, iohead, status); > > + blk_finish_plug(&plug); > > + } > > + return status; > > +} > > We return the xfs_setfilesize_trans_alloc failure status here, > but none of the callers pick it up. The way this is handled later > changes a bit, but even at the end of the series only 1 of the > three callers handles the error. I'll propagate it through where it makes sense. If we alrady have an error, then we aren't going to call xfs_setfilesize_trans_alloc() anyway, so checking the return value only matters in the non-error cases. Cheers, Dave. -- Dave Chinner david@fromorbit.com From david@fromorbit.com Wed Feb 10 18:25:52 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=ham version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay2.corp.sgi.com [137.38.102.29]) by oss.sgi.com (Postfix) with ESMTP id CFA767F5A for ; Wed, 10 Feb 2016 18:25:52 -0600 (CST) Received: from cuda.sgi.com (cuda2.sgi.com [192.48.176.25]) by relay2.corp.sgi.com (Postfix) with ESMTP id BDF73304039 for ; Wed, 10 Feb 2016 16:25:49 -0800 (PST) X-ASG-Debug-ID: 1455150345-04cbb0433365770001-NocioJ Received: from ipmail06.adl2.internode.on.net (ipmail06.adl2.internode.on.net [150.101.137.129]) by cuda.sgi.com with ESMTP id WXxsisaSqtxwDdX6 for ; Wed, 10 Feb 2016 16:25:46 -0800 (PST) X-Barracuda-Envelope-From: david@fromorbit.com X-Barracuda-Apparent-Source-IP: 150.101.137.129 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: A2AdDABv1LtWPBATLHleKAECgw+BP4Jog3qBeZ1UAQEBAQEBBotnhUWEB4YHBAICgTlNAQEBAQEBBwEBAQFBP4RCAQEEOhwjEAgDDgoJJQ8FJQMHGhOIGsBgAQEIAh4YhTKEfohsBZZ3jUiOfI4/hFooLohTAQEB Received: from ppp121-44-19-16.lns20.syd4.internode.on.net (HELO dastard) ([121.44.19.16]) by ipmail06.adl2.internode.on.net with ESMTP; 11 Feb 2016 10:55:45 +1030 Received: from dave by dastard with local (Exim 4.80) (envelope-from ) id 1aTf4q-0007GK-QT; Thu, 11 Feb 2016 11:25:44 +1100 Date: Thu, 11 Feb 2016 11:25:44 +1100 From: Dave Chinner To: Christoph Hellwig Cc: xfs@oss.sgi.com Subject: Re: [PATCH 3/8] xfs: Introduce writeback context for writepages Message-ID: <20160211002544.GS14668@dastard> X-ASG-Orig-Subj: Re: [PATCH 3/8] xfs: Introduce writeback context for writepages References: <1455094043-9694-1-git-send-email-david@fromorbit.com> <1455094043-9694-4-git-send-email-david@fromorbit.com> <20160210113126.GB15221@infradead.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20160210113126.GB15221@infradead.org> User-Agent: Mutt/1.5.21 (2010-09-15) X-Barracuda-Connect: ipmail06.adl2.internode.on.net[150.101.137.129] X-Barracuda-Start-Time: 1455150346 X-Barracuda-URL: https://192.48.176.25:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-BRTS-Status: 1 X-Barracuda-Spam-Score: 0.00 X-Barracuda-Spam-Status: No, SCORE=0.00 using per-user scores of TAG_LEVEL=1000.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.7 tests=BSF_SC0_MISMATCH_TO X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.3.26930 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 0.00 BSF_SC0_MISMATCH_TO Envelope rcpt doesn't match header On Wed, Feb 10, 2016 at 03:31:26AM -0800, Christoph Hellwig wrote: > > + struct xfs_writepage_ctx wpc = { > > + .io_type = XFS_IO_OVERWRITE, > > + }; > > + int ret; > > + > > + ret = xfs_do_writepage(page, wbc, &wpc); > > + return xfs_writepage_submit(&wpc, wbc, ret); > > +} > > + > > +STATIC int > > xfs_vm_writepages( > > struct address_space *mapping, > > struct writeback_control *wbc) > > { > > + struct xfs_writepage_ctx wpc = { > > + .io_type = XFS_IO_OVERWRITE, > > + }; > > Shouldn't we start out with an invalid (0) state, and just move > the actual states up to start from 1? This is just a translation of the existing code - the imap_valid flag being initialised to zero ensures the io_type is correctly initialised if it differs from XFS_IO_OVERWRITE. I guess there's no harm in changing it. Cheers, Dave. -- Dave Chinner david@fromorbit.com From david@fromorbit.com Wed Feb 10 18:26:52 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=ham version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay2.corp.sgi.com [137.38.102.29]) by oss.sgi.com (Postfix) with ESMTP id C51E27CB2 for ; Wed, 10 Feb 2016 18:26:52 -0600 (CST) Received: from cuda.sgi.com (cuda1.sgi.com [192.48.157.11]) by relay2.corp.sgi.com (Postfix) with ESMTP id 82F83304039 for ; Wed, 10 Feb 2016 16:26:52 -0800 (PST) X-ASG-Debug-ID: 1455150408-04bdf066ea51cf0001-NocioJ Received: from ipmail06.adl2.internode.on.net (ipmail06.adl2.internode.on.net [150.101.137.129]) by cuda.sgi.com with ESMTP id DmsgHsScKV8ufGxW for ; Wed, 10 Feb 2016 16:26:49 -0800 (PST) X-Barracuda-Envelope-From: david@fromorbit.com X-Barracuda-Apparent-Source-IP: 150.101.137.129 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: A2DsCQBv1LtWPBATLHleKAECgw+BP4Jog3qBeZ1UAQEBAQEHi2eFRYQHhgcEAgKBOU0BAQEBAQEHAQEBAUE/hEEBAQEDAScTHCMQCAMOCgklDwUlAwcaE4gTB8BgAQEBBwIeGIUyhH6BNgGHNQWSboQJjUiOfI4/gmUNDIFcKC6IUwEBAQ Received: from ppp121-44-19-16.lns20.syd4.internode.on.net (HELO dastard) ([121.44.19.16]) by ipmail06.adl2.internode.on.net with ESMTP; 11 Feb 2016 10:56:48 +1030 Received: from dave by dastard with local (Exim 4.80) (envelope-from ) id 1aTf5r-0007GV-Ma; Thu, 11 Feb 2016 11:26:47 +1100 Date: Thu, 11 Feb 2016 11:26:47 +1100 From: Dave Chinner To: Christoph Hellwig Cc: xfs@oss.sgi.com Subject: Re: [PATCH 6/8] xfs: don't chain ioends during writepage submission Message-ID: <20160211002647.GT14668@dastard> X-ASG-Orig-Subj: Re: [PATCH 6/8] xfs: don't chain ioends during writepage submission References: <1455094043-9694-1-git-send-email-david@fromorbit.com> <1455094043-9694-7-git-send-email-david@fromorbit.com> <20160210113609.GC15221@infradead.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20160210113609.GC15221@infradead.org> User-Agent: Mutt/1.5.21 (2010-09-15) X-Barracuda-Connect: ipmail06.adl2.internode.on.net[150.101.137.129] X-Barracuda-Start-Time: 1455150408 X-Barracuda-URL: https://192.48.157.11:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-BRTS-Status: 1 X-Barracuda-Spam-Score: 0.00 X-Barracuda-Spam-Status: No, SCORE=0.00 using per-user scores of TAG_LEVEL=1000.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.7 tests=BSF_SC0_MISMATCH_TO X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.3.26930 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 0.00 BSF_SC0_MISMATCH_TO Envelope rcpt doesn't match header On Wed, Feb 10, 2016 at 03:36:09AM -0800, Christoph Hellwig wrote: > > -STATIC void > > +STATIC int > > xfs_submit_ioend( > > struct writeback_control *wbc, > > xfs_ioend_t *ioend, > > int fail) > > No that almost all of the function is rewritten can you rename > fail to error or status? fail always suggests a boolean to me and > is rather confusing. *nod* > > + * Return the ioend we finished off so that the caller can submit it > > + * once it has finished processing the dirty page. > > */ > > -STATIC void > > +STATIC struct xfs_ioend * > > xfs_add_to_ioend( > > struct inode *inode, > > struct buffer_head *bh, > > xfs_off_t offset, > > struct xfs_writepage_ctx *wpc) > > { > > + struct xfs_ioend *prev = NULL; > > + > > if (!wpc->ioend || wpc->io_type != wpc->ioend->io_type || > > bh->b_blocknr != wpc->last_block + 1) { > > struct xfs_ioend *new; > > > > + prev = wpc->ioend; > > Looking at the new list_head based code it might be either to just > pass in a pointer to the submit_list and just add the previous ioend > here directly. OK. > > ret = xfs_do_writepage(page, wbc, &wpc); > > - return xfs_writepage_submit(&wpc, wbc, ret); > > + if (wpc.ioend) > > + xfs_submit_ioend(wbc, wpc.ioend, ret); > > + return ret; > > } > > > > STATIC int > > @@ -1019,7 +1022,9 @@ xfs_vm_writepages( > > > > xfs_iflags_clear(XFS_I(mapping->host), XFS_ITRUNCATED); > > ret = write_cache_pages(mapping, wbc, xfs_do_writepage, &wpc); > > - return xfs_writepage_submit(&wpc, wbc, ret); > > + if (wpc.ioend) > > + xfs_submit_ioend(wbc, wpc.ioend, ret); > > + return ret; > > And this is where ignoreing the xfs_setfilesize_trans_alloc errors > reappears after a previous patch mostly fixed it up. will fix. Cheers, Dave. -- Dave Chinner david@fromorbit.com From david@fromorbit.com Thu Feb 11 00:39:34 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=ham version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay3.corp.sgi.com [198.149.34.15]) by oss.sgi.com (Postfix) with ESMTP id 21E437CA2 for ; Thu, 11 Feb 2016 00:39:34 -0600 (CST) Received: from cuda.sgi.com (cuda2.sgi.com [192.48.176.25]) by relay3.corp.sgi.com (Postfix) with ESMTP id A42B0AC002 for ; Wed, 10 Feb 2016 22:39:30 -0800 (PST) X-ASG-Debug-ID: 1455172766-04cbb04332704f0001-NocioJ Received: from ipmail06.adl2.internode.on.net (ipmail06.adl2.internode.on.net [150.101.137.129]) by cuda.sgi.com with ESMTP id Zhn4ks42uhgHCoNA for ; Wed, 10 Feb 2016 22:39:27 -0800 (PST) X-Barracuda-Envelope-From: david@fromorbit.com X-Barracuda-Apparent-Source-IP: 150.101.137.129 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: A2CwCACjK7xWPBATLHleKAECgw+BP4ZigXmdVQEBAQEBB4tohUWEB4YHBAICgTJNAQEBAQEBBwEBAQFBP4RCAQEEJxMcIxAIAw4KCSUPBSUDBxoTiBrAXQEBAQEGAgEdGIUyhH6BNgGGJoEPBZZ3jUmOfY4/gmUNDIFeKC6IUwEBAQ Received: from ppp121-44-19-16.lns20.syd4.internode.on.net (HELO dastard) ([121.44.19.16]) by ipmail06.adl2.internode.on.net with ESMTP; 11 Feb 2016 17:09:11 +1030 Received: from dave by dastard with local (Exim 4.80) (envelope-from ) id 1aTkuE-0007nW-IF; Thu, 11 Feb 2016 17:39:10 +1100 Date: Thu, 11 Feb 2016 17:39:10 +1100 From: Dave Chinner To: Christoph Hellwig Cc: xfs@oss.sgi.com Subject: Re: [PATCH 6/8] xfs: don't chain ioends during writepage submission Message-ID: <20160211063910.GF19486@dastard> X-ASG-Orig-Subj: Re: [PATCH 6/8] xfs: don't chain ioends during writepage submission References: <1455094043-9694-1-git-send-email-david@fromorbit.com> <1455094043-9694-7-git-send-email-david@fromorbit.com> <20160210113609.GC15221@infradead.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20160210113609.GC15221@infradead.org> User-Agent: Mutt/1.5.21 (2010-09-15) X-Barracuda-Connect: ipmail06.adl2.internode.on.net[150.101.137.129] X-Barracuda-Start-Time: 1455172766 X-Barracuda-URL: https://192.48.176.25:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-BRTS-Status: 1 X-Barracuda-Spam-Score: 0.00 X-Barracuda-Spam-Status: No, SCORE=0.00 using per-user scores of TAG_LEVEL=1000.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.7 tests=BSF_SC0_MISMATCH_TO X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.3.26937 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 0.00 BSF_SC0_MISMATCH_TO Envelope rcpt doesn't match header On Wed, Feb 10, 2016 at 03:36:09AM -0800, Christoph Hellwig wrote: > > + LIST_HEAD(submit_list); > > + struct xfs_ioend *ioend, *next; > > struct buffer_head *bh, *head; > > ssize_t len = 1 << inode->i_blkbits; > > int error = 0; > > int uptodate = 1; > > int count = 0; > > The count variable is pointless now - we only check for it being > non-zero, and we can do the same with a list_emptry on submit_list. Actually, it's not pointless - we need it to determine what to with the page. We have to start writeback on the page if there were no errors, but the number of buffers we added to the ioend determines if we need to end page writeback immediately (i.e. no buffers added). This is spearate to whether we allocated a new ioend on the page and hence have an ioend to submit on the submit_list. That said, looking at this did point out a bug in this version of the patch - if no buffers were added to the ioends, then we didn't clear the dirty bit on the page and transition through the writeback state, as the original code was doing. I did trip over this in a test run, so it's a real problem that needed to be fixed. Cheers, Dave. -- Dave Chinner david@fromorbit.com From dave@fromorbit.com Thu Feb 11 00:45:54 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=ham version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay1.corp.sgi.com [137.38.102.111]) by oss.sgi.com (Postfix) with ESMTP id 22C5D7CA2 for ; Thu, 11 Feb 2016 00:45:54 -0600 (CST) Received: from cuda.sgi.com (cuda2.sgi.com [192.48.176.25]) by relay1.corp.sgi.com (Postfix) with ESMTP id 10FCF8F8050 for ; Wed, 10 Feb 2016 22:45:53 -0800 (PST) X-ASG-Debug-ID: 1455173151-04cbb0433270a50001-NocioJ Received: from ipmail06.adl2.internode.on.net (ipmail06.adl2.internode.on.net [150.101.137.129]) by cuda.sgi.com with ESMTP id qXUHuoUPkGygAOHW for ; Wed, 10 Feb 2016 22:45:51 -0800 (PST) X-Barracuda-Envelope-From: dave@fromorbit.com X-Barracuda-Apparent-Source-IP: 150.101.137.129 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: A2AEDQDlLLxWPBATLHlWCCgBAoMPgT+GYoF5nVUBAQEBAQEGkS2LSE0BAQEBAQEHAQEBAUE/QRIBg24BBScvMwgYMTkDBxQZiBrBCIVKiQyEXgWHSQqHA4ghnEZEjXuCGAELQRmBXiguhwAaBIE1AQEB Received: from ppp121-44-19-16.lns20.syd4.internode.on.net (HELO dastard) ([121.44.19.16]) by ipmail06.adl2.internode.on.net with ESMTP; 11 Feb 2016 17:15:49 +1030 Received: from disappointment.disaster.area ([192.168.1.110] helo=disappointment) by dastard with esmtp (Exim 4.80) (envelope-from ) id 1aTl0e-0007o8-S2 for xfs@oss.sgi.com; Thu, 11 Feb 2016 17:45:48 +1100 Received: from dave by disappointment with local (Exim 4.86) (envelope-from ) id 1aTl0e-00057O-RH for xfs@oss.sgi.com; Thu, 11 Feb 2016 17:45:48 +1100 From: Dave Chinner To: xfs@oss.sgi.com Subject: [PATCH 2/6] xfs: remove xfs_cancel_ioend Date: Thu, 11 Feb 2016 17:45:42 +1100 X-ASG-Orig-Subj: [PATCH 2/6] xfs: remove xfs_cancel_ioend Message-Id: <1455173146-19535-3-git-send-email-david@fromorbit.com> X-Mailer: git-send-email 2.5.0 In-Reply-To: <1455173146-19535-1-git-send-email-david@fromorbit.com> References: <1455173146-19535-1-git-send-email-david@fromorbit.com> X-Barracuda-Connect: ipmail06.adl2.internode.on.net[150.101.137.129] X-Barracuda-Start-Time: 1455173151 X-Barracuda-URL: https://192.48.176.25:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-BRTS-Status: 1 X-Barracuda-Spam-Score: 0.00 X-Barracuda-Spam-Status: No, SCORE=0.00 using per-user scores of TAG_LEVEL=1000.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.7 tests= X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.3.26937 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- From: Dave Chinner We currently have code to cancel ioends being built because we change bufferhead state as we build the ioend. On error, this needs to be unwound and so we have cancelling code that walks the buffers on the ioend chain and undoes these state changes. However, the IO submission path already handles state changes for buffers when a submission error occurs, so we don't really need a separate cancel function to do this - we can simply submit the ioend chain with the specific error and it will be cancelled rather than submitted. Hence we can remove the explicit cancel code and just rely on submission to deal with the error correctly. Signed-off-by: Dave Chinner --- fs/xfs/xfs_aops.c | 93 +++++++++++++++++++++++++++---------------------------- 1 file changed, 46 insertions(+), 47 deletions(-) diff --git a/fs/xfs/xfs_aops.c b/fs/xfs/xfs_aops.c index 00452cb..4941efd 100644 --- a/fs/xfs/xfs_aops.c +++ b/fs/xfs/xfs_aops.c @@ -528,38 +528,6 @@ xfs_submit_ioend( } /* - * Cancel submission of all buffer_heads so far in this endio. - * Toss the endio too. Only ever called for the initial page - * in a writepage request, so only ever one page. - */ -STATIC void -xfs_cancel_ioend( - xfs_ioend_t *ioend) -{ - xfs_ioend_t *next; - struct buffer_head *bh, *next_bh; - - do { - next = ioend->io_list; - bh = ioend->io_buffer_head; - do { - next_bh = bh->b_private; - clear_buffer_async_write(bh); - /* - * The unwritten flag is cleared when added to the - * ioend. We're not submitting for I/O so mark the - * buffer unwritten again for next time around. - */ - if (ioend->io_type == XFS_IO_UNWRITTEN) - set_buffer_unwritten(bh); - unlock_buffer(bh); - } while ((bh = next_bh) != NULL); - - mempool_free(ioend, xfs_ioend_pool); - } while ((ioend = next) != NULL); -} - -/* * Test to see if we've been building up a completion structure for * earlier buffers -- if so, we try to append to this ioend if we * can, otherwise we finish off any current ioend and start another. @@ -931,6 +899,28 @@ out_invalidate: return; } +static int +xfs_writepage_submit( + struct xfs_ioend *ioend, + struct xfs_ioend *iohead, + struct writeback_control *wbc, + int status) +{ + struct blk_plug plug; + + /* Reserve log space if we might write beyond the on-disk inode size. */ + if (!status && ioend && ioend->io_type != XFS_IO_UNWRITTEN && + xfs_ioend_is_append(ioend)) + status = xfs_setfilesize_trans_alloc(ioend); + + if (iohead) { + blk_start_plug(&plug); + xfs_submit_ioend(wbc, iohead, status); + blk_finish_plug(&plug); + } + return status; +} + /* * Write out a dirty page. * @@ -1142,6 +1132,7 @@ xfs_vm_writepage( return 0; ASSERT(iohead); + ASSERT(err == 0); /* * Any errors from this point onwards need tobe reported through the IO @@ -1167,25 +1158,33 @@ xfs_vm_writepage( wbc, end_index); } + return xfs_writepage_submit(ioend, iohead, wbc, 0); +error: /* - * Reserve log space if we might write beyond the on-disk inode size. + * On error, we have to fail the iohead here because we buffers locked + * in the ioend chain. If we don't do this, we'll deadlock invalidating + * the page as that tries to lock the buffers on the page. Also, because + * we may have set pages under writeback, we have to run IO completion to + * mark the error state of the IO appropriately, so we can't cancel the + * ioend directly here. That means we have to mark this page as under + * writeback if we included any buffers from it in the ioend chain. */ - err = 0; - if (ioend->io_type != XFS_IO_UNWRITTEN && xfs_ioend_is_append(ioend)) - err = xfs_setfilesize_trans_alloc(ioend); + if (count) + xfs_start_page_writeback(page, 0, count); + xfs_writepage_submit(ioend, iohead, wbc, err); - xfs_submit_ioend(wbc, iohead, err); - - return 0; - -error: - if (iohead) - xfs_cancel_ioend(iohead); - - xfs_aops_discard_page(page); - ClearPageUptodate(page); - unlock_page(page); + /* + * We can only discard the page we had the IO error on if we haven't + * included it in the ioend above. If it has already been errored out, + * the it is unlocked and we can't touch it here. + */ + if (!count) { + xfs_aops_discard_page(page); + ClearPageUptodate(page); + unlock_page(page); + } + mapping_set_error(page->mapping, err); return err; redirty: -- 2.5.0 From dave@fromorbit.com Thu Feb 11 00:45:55 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=ham version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay1.corp.sgi.com [137.38.102.111]) by oss.sgi.com (Postfix) with ESMTP id 3DAB47CA2 for ; Thu, 11 Feb 2016 00:45:55 -0600 (CST) Received: from cuda.sgi.com (cuda1.sgi.com [192.48.157.11]) by relay1.corp.sgi.com (Postfix) with ESMTP id 0FABA8F8050 for ; Wed, 10 Feb 2016 22:45:55 -0800 (PST) X-ASG-Debug-ID: 1455173149-04bdf066ec5ba70002-NocioJ Received: from ipmail06.adl2.internode.on.net (ipmail06.adl2.internode.on.net [150.101.137.129]) by cuda.sgi.com with ESMTP id jtS8H0odAkAFwZHY for ; Wed, 10 Feb 2016 22:45:51 -0800 (PST) X-Barracuda-Envelope-From: dave@fromorbit.com X-Barracuda-Apparent-Source-IP: 150.101.137.129 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: A2AHDQDlLLxWPBATLHleKAECgw+BP4ZigXmdVQEBAQEBAQaRLYoUgTRNAQEBAQEBBwEBAQFBP0ESAYNuAQUnLzMIGDE5AwcUGR6HfMEIhUqJViaDbgWHU48knEZEjXuCGAELgjgoLocAgVMBAQE Received: from ppp121-44-19-16.lns20.syd4.internode.on.net (HELO dastard) ([121.44.19.16]) by ipmail06.adl2.internode.on.net with ESMTP; 11 Feb 2016 17:15:49 +1030 Received: from disappointment.disaster.area ([192.168.1.110] helo=disappointment) by dastard with esmtp (Exim 4.80) (envelope-from ) id 1aTl0e-0007o7-Ra for xfs@oss.sgi.com; Thu, 11 Feb 2016 17:45:48 +1100 Received: from dave by disappointment with local (Exim 4.86) (envelope-from ) id 1aTl0e-00057J-Qp for xfs@oss.sgi.com; Thu, 11 Feb 2016 17:45:48 +1100 From: Dave Chinner To: xfs@oss.sgi.com Subject: [PATCH 1/6] xfs: remove nonblocking mode from xfs_vm_writepage Date: Thu, 11 Feb 2016 17:45:41 +1100 X-ASG-Orig-Subj: [PATCH 1/6] xfs: remove nonblocking mode from xfs_vm_writepage Message-Id: <1455173146-19535-2-git-send-email-david@fromorbit.com> X-Mailer: git-send-email 2.5.0 In-Reply-To: <1455173146-19535-1-git-send-email-david@fromorbit.com> References: <1455173146-19535-1-git-send-email-david@fromorbit.com> X-Barracuda-Connect: ipmail06.adl2.internode.on.net[150.101.137.129] X-Barracuda-Start-Time: 1455173151 X-Barracuda-URL: https://192.48.157.11:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-BRTS-Status: 1 X-Barracuda-Spam-Score: 0.00 X-Barracuda-Spam-Status: No, SCORE=0.00 using per-user scores of TAG_LEVEL=1000.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.7 tests= X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.3.26937 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- From: Dave Chinner Remove the nonblocking optimisation done for mapping lookups during writeback. It's not clear that leaving a hole in the writeback range just because we couldn't get a lock is really a win, as it makes us do another small random IO later on rather than a large sequential IO now. As this gets in the way of sane error handling later on, just remove for the moment and we can re-introduce an equivalent optimisation in future if we see problems due to extent map lock contention. Signed-off-by: Dave Chinner Reviewed-by: Christoph Hellwig --- fs/xfs/xfs_aops.c | 20 +++----------------- 1 file changed, 3 insertions(+), 17 deletions(-) diff --git a/fs/xfs/xfs_aops.c b/fs/xfs/xfs_aops.c index 14ac982..00452cb 100644 --- a/fs/xfs/xfs_aops.c +++ b/fs/xfs/xfs_aops.c @@ -289,8 +289,7 @@ xfs_map_blocks( struct inode *inode, loff_t offset, struct xfs_bmbt_irec *imap, - int type, - int nonblocking) + int type) { struct xfs_inode *ip = XFS_I(inode); struct xfs_mount *mp = ip->i_mount; @@ -306,12 +305,7 @@ xfs_map_blocks( if (type == XFS_IO_UNWRITTEN) bmapi_flags |= XFS_BMAPI_IGSTATE; - if (!xfs_ilock_nowait(ip, XFS_ILOCK_SHARED)) { - if (nonblocking) - return -EAGAIN; - xfs_ilock(ip, XFS_ILOCK_SHARED); - } - + xfs_ilock(ip, XFS_ILOCK_SHARED); ASSERT(ip->i_d.di_format != XFS_DINODE_FMT_BTREE || (ip->i_df.if_flags & XFS_IFEXTENTS)); ASSERT(offset <= mp->m_super->s_maxbytes); @@ -961,7 +955,6 @@ xfs_vm_writepage( ssize_t len; int err, imap_valid = 0, uptodate = 1; int count = 0; - int nonblocking = 0; trace_xfs_writepage(inode, page, 0, 0); @@ -1061,9 +1054,6 @@ xfs_vm_writepage( offset = page_offset(page); type = XFS_IO_OVERWRITE; - if (wbc->sync_mode == WB_SYNC_NONE) - nonblocking = 1; - do { int new_ioend = 0; @@ -1123,8 +1113,7 @@ xfs_vm_writepage( * time. */ new_ioend = 1; - err = xfs_map_blocks(inode, offset, &imap, type, - nonblocking); + err = xfs_map_blocks(inode, offset, &imap, type); if (err) goto error; imap_valid = xfs_imap_valid(inode, &imap, offset); @@ -1194,9 +1183,6 @@ error: if (iohead) xfs_cancel_ioend(iohead); - if (err == -EAGAIN) - goto redirty; - xfs_aops_discard_page(page); ClearPageUptodate(page); unlock_page(page); -- 2.5.0 From dave@fromorbit.com Thu Feb 11 00:45:55 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=ham version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay1.corp.sgi.com [137.38.102.111]) by oss.sgi.com (Postfix) with ESMTP id F2AF37CA6 for ; Thu, 11 Feb 2016 00:45:55 -0600 (CST) Received: from cuda.sgi.com (cuda1.sgi.com [192.48.157.11]) by relay1.corp.sgi.com (Postfix) with ESMTP id D10E48F8050 for ; Wed, 10 Feb 2016 22:45:52 -0800 (PST) X-ASG-Debug-ID: 1455173149-04bdf066ec5ba70001-NocioJ Received: from ipmail06.adl2.internode.on.net (ipmail06.adl2.internode.on.net [150.101.137.129]) by cuda.sgi.com with ESMTP id gv9ILGOuS045ese3 for ; Wed, 10 Feb 2016 22:45:50 -0800 (PST) X-Barracuda-Envelope-From: dave@fromorbit.com X-Barracuda-Apparent-Source-IP: 150.101.137.129 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: A2D/DADlLLxWPBATLHleKAECgw+IIYF5nVUBAQEBAQEGkS2LSE0BAQEBAQEHAQEBAUE/QRIBhEo7gQIDB4hHoiKeZoVKiXyDbgWSboQJnEZEjXuCGAEBCAEBAQE/GYFeKIcugVMBAQE Received: from ppp121-44-19-16.lns20.syd4.internode.on.net (HELO dastard) ([121.44.19.16]) by ipmail06.adl2.internode.on.net with ESMTP; 11 Feb 2016 17:15:49 +1030 Received: from disappointment.disaster.area ([192.168.1.110] helo=disappointment) by dastard with esmtp (Exim 4.80) (envelope-from ) id 1aTl0e-0007o6-RF for xfs@oss.sgi.com; Thu, 11 Feb 2016 17:45:48 +1100 Received: from dave by disappointment with local (Exim 4.86) (envelope-from ) id 1aTl0e-00057G-QO for xfs@oss.sgi.com; Thu, 11 Feb 2016 17:45:48 +1100 From: Dave Chinner To: xfs@oss.sgi.com Subject: [PATCH 0/6 v5] xfs: get rid of xfs_cluster_write() Date: Thu, 11 Feb 2016 17:45:40 +1100 X-ASG-Orig-Subj: [PATCH 0/6 v5] xfs: get rid of xfs_cluster_write() Message-Id: <1455173146-19535-1-git-send-email-david@fromorbit.com> X-Mailer: git-send-email 2.5.0 X-Barracuda-Connect: ipmail06.adl2.internode.on.net[150.101.137.129] X-Barracuda-Start-Time: 1455173149 X-Barracuda-URL: https://192.48.157.11:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-BRTS-Status: 1 X-Barracuda-Spam-Score: 0.00 X-Barracuda-Spam-Status: No, SCORE=0.00 using per-user scores of TAG_LEVEL=1000.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.7 tests= X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.3.26937 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- Hi folks, Version 5 of the patchset, hopefully addressing all the remaining review comments. I dropped the two RFC patches from this posting - they are not necessary at this point. Cheers, Dave. Version 5: - return errors currectly when transaction allocation fails (patch 2, patch 3, patch 6) - Added XFS_IO_INVALID to the iotype enum, and initialised the writepage context with it. (patch 3) - s/fail/status/ in xfs_submit_ioend (patch 6) - pass submit_list into xfs_add_to_ioend() rather than returning the ioend to add to the submit list (patch 6) - fixed bug where dirty pages that are not added to an ioend would remain dirty rather than being marked clean and transitioning through the writeback state before returning (patch 6) From dave@fromorbit.com Thu Feb 11 00:45:57 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=ham version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay2.corp.sgi.com [137.38.102.29]) by oss.sgi.com (Postfix) with ESMTP id 11ACA7CAE for ; Thu, 11 Feb 2016 00:45:57 -0600 (CST) Received: from cuda.sgi.com (cuda2.sgi.com [192.48.176.25]) by relay2.corp.sgi.com (Postfix) with ESMTP id DF1EA304039 for ; Wed, 10 Feb 2016 22:45:56 -0800 (PST) X-ASG-Debug-ID: 1455173151-04cbb0433270a50002-NocioJ Received: from ipmail06.adl2.internode.on.net (ipmail06.adl2.internode.on.net [150.101.137.129]) by cuda.sgi.com with ESMTP id zIB4z9rsL63te5kO for ; Wed, 10 Feb 2016 22:45:53 -0800 (PST) X-Barracuda-Envelope-From: dave@fromorbit.com X-Barracuda-Apparent-Source-IP: 150.101.137.129 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: A2AHDQDlLLxWPBATLHlWCCgBAoMPgT+GYoF5nVUBAQEBAQEGkS2KFIE0TQEBAQEBAQcBAQEBQT9BEgGDbgEFJyAPMwgYGBk5AwcUGYgatnGKF4VKiQxKGYN7BYdTjyScRo4/ghgBCwE9AxmBXiguhwCBUwEBAQ Received: from ppp121-44-19-16.lns20.syd4.internode.on.net (HELO dastard) ([121.44.19.16]) by ipmail06.adl2.internode.on.net with ESMTP; 11 Feb 2016 17:15:49 +1030 Received: from disappointment.disaster.area ([192.168.1.110] helo=disappointment) by dastard with esmtp (Exim 4.80) (envelope-from ) id 1aTl0e-0007o9-Sv for xfs@oss.sgi.com; Thu, 11 Feb 2016 17:45:48 +1100 Received: from dave by disappointment with local (Exim 4.86) (envelope-from ) id 1aTl0e-00057T-Rk for xfs@oss.sgi.com; Thu, 11 Feb 2016 17:45:48 +1100 From: Dave Chinner To: xfs@oss.sgi.com Subject: [PATCH 3/6] xfs: Introduce writeback context for writepages Date: Thu, 11 Feb 2016 17:45:43 +1100 X-ASG-Orig-Subj: [PATCH 3/6] xfs: Introduce writeback context for writepages Message-Id: <1455173146-19535-4-git-send-email-david@fromorbit.com> X-Mailer: git-send-email 2.5.0 In-Reply-To: <1455173146-19535-1-git-send-email-david@fromorbit.com> References: <1455173146-19535-1-git-send-email-david@fromorbit.com> X-Barracuda-Connect: ipmail06.adl2.internode.on.net[150.101.137.129] X-Barracuda-Start-Time: 1455173153 X-Barracuda-URL: https://192.48.176.25:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-BRTS-Status: 1 X-Barracuda-Spam-Score: 0.00 X-Barracuda-Spam-Status: No, SCORE=0.00 using per-user scores of TAG_LEVEL=1000.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.7 tests= X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.3.26937 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- From: Dave Chinner xfs_vm_writepages() calls generic_writepages to writeback a range of a file, but then xfs_vm_writepage() clusters pages itself as it does not have any context it can pass between->writepage calls from __write_cache_pages(). Introduce a writeback context for xfs_vm_writepages() and call __write_cache_pages directly with our own writepage callback so that we can pass that context to each writepage invocation. This encapsulates the current mapping, whether it is valid or not, the current ioend and it's IO type and the ioend chain being built. This requires us to move the ioend submission up to the level where the writepage context is declared. This does mean we do not submit IO until we packaged the entire writeback range, but with the block plugging in the writepages call this is the way IO is submitted, anyway. It also means that we need to handle discontiguous page ranges. If the pages sent down by write_cache_pages to the writepage callback are discontiguous, we need to detect this and put each discontiguous page range into individual ioends. This is needed to ensure that the ioend accurately represents the range of the file that it covers so that file size updates during IO completion set the size correctly. Failure to take into account the discontiguous ranges results in files being too small when writeback patterns are non-sequential. Signed-off-by: Dave Chinner Reviewed-by: Christoph Hellwig Signed-off-by: Dave Chinner --- fs/xfs/xfs_aops.c | 220 ++++++++++++++++++++++++++++-------------------------- fs/xfs/xfs_aops.h | 2 + 2 files changed, 117 insertions(+), 105 deletions(-) diff --git a/fs/xfs/xfs_aops.c b/fs/xfs/xfs_aops.c index 4941efd..ea2f4f8 100644 --- a/fs/xfs/xfs_aops.c +++ b/fs/xfs/xfs_aops.c @@ -40,6 +40,18 @@ #define XFS_DIO_FLAG_UNWRITTEN (1 << 0) #define XFS_DIO_FLAG_APPEND (1 << 1) +/* + * structure owned by writepages passed to individual writepage calls + */ +struct xfs_writepage_ctx { + struct xfs_bmbt_irec imap; + bool imap_valid; + unsigned int io_type; + struct xfs_ioend *iohead; + struct xfs_ioend *ioend; + sector_t last_block; +}; + void xfs_count_page_state( struct page *page, @@ -341,7 +353,7 @@ xfs_map_blocks( return 0; } -STATIC int +STATIC bool xfs_imap_valid( struct inode *inode, struct xfs_bmbt_irec *imap, @@ -538,29 +550,27 @@ xfs_add_to_ioend( struct inode *inode, struct buffer_head *bh, xfs_off_t offset, - unsigned int type, - xfs_ioend_t **result, - int need_ioend) + struct xfs_writepage_ctx *wpc) { - xfs_ioend_t *ioend = *result; - - if (!ioend || need_ioend || type != ioend->io_type) { - xfs_ioend_t *previous = *result; - - ioend = xfs_alloc_ioend(inode, type); - ioend->io_offset = offset; - ioend->io_buffer_head = bh; - ioend->io_buffer_tail = bh; - if (previous) - previous->io_list = ioend; - *result = ioend; + if (!wpc->ioend || wpc->io_type != wpc->ioend->io_type || + bh->b_blocknr != wpc->last_block + 1) { + struct xfs_ioend *new; + + new = xfs_alloc_ioend(inode, wpc->io_type); + new->io_offset = offset; + new->io_buffer_head = bh; + new->io_buffer_tail = bh; + if (wpc->ioend) + wpc->ioend->io_list = new; + wpc->ioend = new; } else { - ioend->io_buffer_tail->b_private = bh; - ioend->io_buffer_tail = bh; + wpc->ioend->io_buffer_tail->b_private = bh; + wpc->ioend->io_buffer_tail = bh; } bh->b_private = NULL; - ioend->io_size += bh->b_size; + wpc->ioend->io_size += bh->b_size; + wpc->last_block = bh->b_blocknr; } STATIC void @@ -657,17 +667,15 @@ xfs_convert_page( struct inode *inode, struct page *page, loff_t tindex, - struct xfs_bmbt_irec *imap, - xfs_ioend_t **ioendp, + struct xfs_writepage_ctx *wpc, struct writeback_control *wbc) { struct buffer_head *bh, *head; xfs_off_t end_offset; unsigned long p_offset; - unsigned int type; int len, page_dirty; int count = 0, done = 0, uptodate = 1; - xfs_off_t offset = page_offset(page); + xfs_off_t offset = page_offset(page); if (page->index != tindex) goto fail; @@ -677,7 +685,7 @@ xfs_convert_page( goto fail_unlock_page; if (page->mapping != inode->i_mapping) goto fail_unlock_page; - if (!xfs_check_page_type(page, (*ioendp)->io_type, false)) + if (!xfs_check_page_type(page, wpc->ioend->io_type, false)) goto fail_unlock_page; /* @@ -713,7 +721,7 @@ xfs_convert_page( * writeback. Hence for more optimal IO patterns, we should always * avoid partial page writeback due to multiple mappings on a page here. */ - if (!xfs_imap_valid(inode, imap, end_offset)) + if (!xfs_imap_valid(inode, &wpc->imap, end_offset)) goto fail_unlock_page; len = 1 << inode->i_blkbits; @@ -745,23 +753,22 @@ xfs_convert_page( if (buffer_unwritten(bh) || buffer_delay(bh) || buffer_mapped(bh)) { if (buffer_unwritten(bh)) - type = XFS_IO_UNWRITTEN; + wpc->io_type = XFS_IO_UNWRITTEN; else if (buffer_delay(bh)) - type = XFS_IO_DELALLOC; + wpc->io_type = XFS_IO_DELALLOC; else - type = XFS_IO_OVERWRITE; + wpc->io_type = XFS_IO_OVERWRITE; /* * imap should always be valid because of the above * partial page end_offset check on the imap. */ - ASSERT(xfs_imap_valid(inode, imap, offset)); + ASSERT(xfs_imap_valid(inode, &wpc->imap, offset)); lock_buffer(bh); - if (type != XFS_IO_OVERWRITE) - xfs_map_at_offset(inode, bh, imap, offset); - xfs_add_to_ioend(inode, bh, offset, type, - ioendp, done); + if (wpc->io_type != XFS_IO_OVERWRITE) + xfs_map_at_offset(inode, bh, &wpc->imap, offset); + xfs_add_to_ioend(inode, bh, offset, wpc); page_dirty--; count++; @@ -796,8 +803,7 @@ STATIC void xfs_cluster_write( struct inode *inode, pgoff_t tindex, - struct xfs_bmbt_irec *imap, - xfs_ioend_t **ioendp, + struct xfs_writepage_ctx *wpc, struct writeback_control *wbc, pgoff_t tlast) { @@ -813,7 +819,7 @@ xfs_cluster_write( for (i = 0; i < pagevec_count(&pvec); i++) { done = xfs_convert_page(inode, pvec.pages[i], tindex++, - imap, ioendp, wbc); + wpc, wbc); if (done) break; } @@ -901,21 +907,20 @@ out_invalidate: static int xfs_writepage_submit( - struct xfs_ioend *ioend, - struct xfs_ioend *iohead, + struct xfs_writepage_ctx *wpc, struct writeback_control *wbc, int status) { struct blk_plug plug; /* Reserve log space if we might write beyond the on-disk inode size. */ - if (!status && ioend && ioend->io_type != XFS_IO_UNWRITTEN && - xfs_ioend_is_append(ioend)) - status = xfs_setfilesize_trans_alloc(ioend); + if (!status && wpc->ioend && wpc->ioend->io_type != XFS_IO_UNWRITTEN && + xfs_ioend_is_append(wpc->ioend)) + status = xfs_setfilesize_trans_alloc(wpc->ioend); - if (iohead) { + if (wpc->iohead) { blk_start_plug(&plug); - xfs_submit_ioend(wbc, iohead, status); + xfs_submit_ioend(wbc, wpc->iohead, status); blk_finish_plug(&plug); } return status; @@ -930,20 +935,19 @@ xfs_writepage_submit( * For any other dirty buffer heads on the page we should flush them. */ STATIC int -xfs_vm_writepage( +xfs_do_writepage( struct page *page, - struct writeback_control *wbc) + struct writeback_control *wbc, + void *data) { + struct xfs_writepage_ctx *wpc = data; struct inode *inode = page->mapping->host; struct buffer_head *bh, *head; - struct xfs_bmbt_irec imap; - xfs_ioend_t *ioend = NULL, *iohead = NULL; loff_t offset; - unsigned int type; __uint64_t end_offset; pgoff_t end_index, last_index; ssize_t len; - int err, imap_valid = 0, uptodate = 1; + int err, uptodate = 1; int count = 0; trace_xfs_writepage(inode, page, 0, 0); @@ -1042,11 +1046,8 @@ xfs_vm_writepage( bh = head = page_buffers(page); offset = page_offset(page); - type = XFS_IO_OVERWRITE; do { - int new_ioend = 0; - if (offset >= end_offset) break; if (!buffer_uptodate(bh)) @@ -1059,24 +1060,24 @@ xfs_vm_writepage( * buffers covering holes here. */ if (!buffer_mapped(bh) && buffer_uptodate(bh)) { - imap_valid = 0; + wpc->imap_valid = false; continue; } if (buffer_unwritten(bh)) { - if (type != XFS_IO_UNWRITTEN) { - type = XFS_IO_UNWRITTEN; - imap_valid = 0; + if (wpc->io_type != XFS_IO_UNWRITTEN) { + wpc->io_type = XFS_IO_UNWRITTEN; + wpc->imap_valid = false; } } else if (buffer_delay(bh)) { - if (type != XFS_IO_DELALLOC) { - type = XFS_IO_DELALLOC; - imap_valid = 0; + if (wpc->io_type != XFS_IO_DELALLOC) { + wpc->io_type = XFS_IO_DELALLOC; + wpc->imap_valid = false; } } else if (buffer_uptodate(bh)) { - if (type != XFS_IO_OVERWRITE) { - type = XFS_IO_OVERWRITE; - imap_valid = 0; + if (wpc->io_type != XFS_IO_OVERWRITE) { + wpc->io_type = XFS_IO_OVERWRITE; + wpc->imap_valid = false; } } else { if (PageUptodate(page)) @@ -1087,38 +1088,29 @@ xfs_vm_writepage( * subsequent writeable buffers into a new * ioend. */ - imap_valid = 0; + wpc->imap_valid = 0; continue; } - if (imap_valid) - imap_valid = xfs_imap_valid(inode, &imap, offset); - if (!imap_valid) { - /* - * If we didn't have a valid mapping then we need to - * put the new mapping into a separate ioend structure. - * This ensures non-contiguous extents always have - * separate ioends, which is particularly important - * for unwritten extent conversion at I/O completion - * time. - */ - new_ioend = 1; - err = xfs_map_blocks(inode, offset, &imap, type); + if (wpc->imap_valid) + wpc->imap_valid = xfs_imap_valid(inode, &wpc->imap, offset); + if (!wpc->imap_valid) { + err = xfs_map_blocks(inode, offset, &wpc->imap, + wpc->io_type); if (err) goto error; - imap_valid = xfs_imap_valid(inode, &imap, offset); + wpc->imap_valid = xfs_imap_valid(inode, &wpc->imap, offset); } - if (imap_valid) { + if (wpc->imap_valid) { lock_buffer(bh); - if (type != XFS_IO_OVERWRITE) - xfs_map_at_offset(inode, bh, &imap, offset); - xfs_add_to_ioend(inode, bh, offset, type, &ioend, - new_ioend); + if (wpc->io_type != XFS_IO_OVERWRITE) + xfs_map_at_offset(inode, bh, &wpc->imap, offset); + xfs_add_to_ioend(inode, bh, offset, wpc); count++; } - if (!iohead) - iohead = ioend; + if (!wpc->iohead) + wpc->iohead = wpc->ioend; } while (offset += len, ((bh = bh->b_this_page) != head)); @@ -1128,10 +1120,10 @@ xfs_vm_writepage( xfs_start_page_writeback(page, 1, count); /* if there is no IO to be submitted for this page, we are done */ - if (!ioend) + if (!count) return 0; - ASSERT(iohead); + ASSERT(wpc->iohead); ASSERT(err == 0); /* @@ -1139,10 +1131,10 @@ xfs_vm_writepage( * completion path as we have marked the initial page as under writeback * and unlocked it. */ - if (imap_valid) { + if (wpc->imap_valid) { xfs_off_t end_index; - end_index = imap.br_startoff + imap.br_blockcount; + end_index = wpc->imap.br_startoff + wpc->imap.br_blockcount; /* to bytes */ end_index <<= inode->i_blkbits; @@ -1154,32 +1146,30 @@ xfs_vm_writepage( if (end_index > last_index) end_index = last_index; - xfs_cluster_write(inode, page->index + 1, &imap, &ioend, - wbc, end_index); + xfs_cluster_write(inode, page->index + 1, wpc, wbc, end_index); } - - return xfs_writepage_submit(ioend, iohead, wbc, 0); + return 0; error: /* * On error, we have to fail the iohead here because we buffers locked * in the ioend chain. If we don't do this, we'll deadlock invalidating * the page as that tries to lock the buffers on the page. Also, because - * we may have set pages under writeback, we have to run IO completion to - * mark the error state of the IO appropriately, so we can't cancel the - * ioend directly here. That means we have to mark this page as under - * writeback if we included any buffers from it in the ioend chain. + * we may have set pages under writeback, we have to make sure we run + * IO completion to mark the error state of the IO appropriately, so we + * can't cancel the ioend directly here. That means we have to mark this + * page as under writeback if we included any buffers from it in the + * ioend chain so that completion treats it correctly. + * + * If we didn't include the page in the ioend, then we can simply + * discard and unlock it as there are no other users of the page or it's + * buffers right now. The caller will still need to trigger submission + * of outstanding ioends on the writepage context so they are treated + * correctly on error. */ if (count) xfs_start_page_writeback(page, 0, count); - xfs_writepage_submit(ioend, iohead, wbc, err); - - /* - * We can only discard the page we had the IO error on if we haven't - * included it in the ioend above. If it has already been errored out, - * the it is unlocked and we can't touch it here. - */ - if (!count) { + else { xfs_aops_discard_page(page); ClearPageUptodate(page); unlock_page(page); @@ -1194,12 +1184,32 @@ redirty: } STATIC int +xfs_vm_writepage( + struct page *page, + struct writeback_control *wbc) +{ + struct xfs_writepage_ctx wpc = { + .io_type = XFS_IO_INVALID, + }; + int ret; + + ret = xfs_do_writepage(page, wbc, &wpc); + return xfs_writepage_submit(&wpc, wbc, ret); +} + +STATIC int xfs_vm_writepages( struct address_space *mapping, struct writeback_control *wbc) { + struct xfs_writepage_ctx wpc = { + .io_type = XFS_IO_INVALID, + }; + int ret; + xfs_iflags_clear(XFS_I(mapping->host), XFS_ITRUNCATED); - return generic_writepages(mapping, wbc); + ret = write_cache_pages(mapping, wbc, xfs_do_writepage, &wpc); + return xfs_writepage_submit(&wpc, wbc, ret); } /* diff --git a/fs/xfs/xfs_aops.h b/fs/xfs/xfs_aops.h index f6ffc9a..3c3f1a3 100644 --- a/fs/xfs/xfs_aops.h +++ b/fs/xfs/xfs_aops.h @@ -24,12 +24,14 @@ extern mempool_t *xfs_ioend_pool; * Types of I/O for bmap clustering and I/O completion tracking. */ enum { + XFS_IO_INVALID, /* initial state */ XFS_IO_DELALLOC, /* covers delalloc region */ XFS_IO_UNWRITTEN, /* covers allocated but uninitialized data */ XFS_IO_OVERWRITE, /* covers already allocated extent */ }; #define XFS_IO_TYPES \ + { XFS_IO_INVALID, "invalid" }, \ { XFS_IO_DELALLOC, "delalloc" }, \ { XFS_IO_UNWRITTEN, "unwritten" }, \ { XFS_IO_OVERWRITE, "overwrite" } -- 2.5.0 From dave@fromorbit.com Thu Feb 11 00:45:57 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=ham version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay3.corp.sgi.com [198.149.34.15]) by oss.sgi.com (Postfix) with ESMTP id 768A47CB4 for ; Thu, 11 Feb 2016 00:45:57 -0600 (CST) Received: from cuda.sgi.com (cuda1.sgi.com [192.48.157.11]) by relay3.corp.sgi.com (Postfix) with ESMTP id 117C9AC002 for ; Wed, 10 Feb 2016 22:45:56 -0800 (PST) X-ASG-Debug-ID: 1455173149-04bdf066ec5ba70003-NocioJ Received: from ipmail06.adl2.internode.on.net (ipmail06.adl2.internode.on.net [150.101.137.129]) by cuda.sgi.com with ESMTP id fTMpDmjqPgWunFpS for ; Wed, 10 Feb 2016 22:45:54 -0800 (PST) X-Barracuda-Envelope-From: dave@fromorbit.com X-Barracuda-Apparent-Source-IP: 150.101.137.129 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: A2AEDQDlLLxWPBATLHlWCCgBAoMPgT+GYoF5nVUBAQEBAQEGkS2LSE0BAQEBAQEHAQEBAUE/QRIBg24BBScvMwgYMTkDBxQZiBrBCIVKiQyEXgWHU48knEZEjXuCGAELgjgoLocAgVMBAQE Received: from ppp121-44-19-16.lns20.syd4.internode.on.net (HELO dastard) ([121.44.19.16]) by ipmail06.adl2.internode.on.net with ESMTP; 11 Feb 2016 17:15:49 +1030 Received: from disappointment.disaster.area ([192.168.1.110] helo=disappointment) by dastard with esmtp (Exim 4.80) (envelope-from ) id 1aTl0e-0007oB-Tq for xfs@oss.sgi.com; Thu, 11 Feb 2016 17:45:48 +1100 Received: from dave by disappointment with local (Exim 4.86) (envelope-from ) id 1aTl0e-00057d-T7 for xfs@oss.sgi.com; Thu, 11 Feb 2016 17:45:48 +1100 From: Dave Chinner To: xfs@oss.sgi.com Subject: [PATCH 5/6] xfs: factor mapping out of xfs_do_writepage Date: Thu, 11 Feb 2016 17:45:45 +1100 X-ASG-Orig-Subj: [PATCH 5/6] xfs: factor mapping out of xfs_do_writepage Message-Id: <1455173146-19535-6-git-send-email-david@fromorbit.com> X-Mailer: git-send-email 2.5.0 In-Reply-To: <1455173146-19535-1-git-send-email-david@fromorbit.com> References: <1455173146-19535-1-git-send-email-david@fromorbit.com> X-Barracuda-Connect: ipmail06.adl2.internode.on.net[150.101.137.129] X-Barracuda-Start-Time: 1455173153 X-Barracuda-URL: https://192.48.157.11:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-BRTS-Status: 1 X-Barracuda-Spam-Score: 0.00 X-Barracuda-Spam-Status: No, SCORE=0.00 using per-user scores of TAG_LEVEL=1000.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.7 tests= X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.3.26937 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- From: Dave Chinner Separate out the bufferhead based mapping from the writepage code so that we have a clear separation of the page operations and the bufferhead state. Signed-off-by: Dave Chinner Reviewed-by: Christoph Hellwig Signed-off-by: Dave Chinner --- fs/xfs/xfs_aops.c | 232 ++++++++++++++++++++++++++++-------------------------- 1 file changed, 122 insertions(+), 110 deletions(-) diff --git a/fs/xfs/xfs_aops.c b/fs/xfs/xfs_aops.c index 01e1663..691cdf9 100644 --- a/fs/xfs/xfs_aops.c +++ b/fs/xfs/xfs_aops.c @@ -753,6 +753,127 @@ xfs_writepage_submit( return status; } +static int +xfs_writepage_map( + struct xfs_writepage_ctx *wpc, + struct inode *inode, + struct page *page, + loff_t offset, + __uint64_t end_offset) +{ + struct buffer_head *bh, *head; + ssize_t len = 1 << inode->i_blkbits; + int error = 0; + int uptodate = 1; + int count = 0; + + bh = head = page_buffers(page); + offset = page_offset(page); + + do { + if (offset >= end_offset) + break; + if (!buffer_uptodate(bh)) + uptodate = 0; + + /* + * set_page_dirty dirties all buffers in a page, independent + * of their state. The dirty state however is entirely + * meaningless for holes (!mapped && uptodate), so skip + * buffers covering holes here. + */ + if (!buffer_mapped(bh) && buffer_uptodate(bh)) { + wpc->imap_valid = false; + continue; + } + + if (buffer_unwritten(bh)) { + if (wpc->io_type != XFS_IO_UNWRITTEN) { + wpc->io_type = XFS_IO_UNWRITTEN; + wpc->imap_valid = false; + } + } else if (buffer_delay(bh)) { + if (wpc->io_type != XFS_IO_DELALLOC) { + wpc->io_type = XFS_IO_DELALLOC; + wpc->imap_valid = false; + } + } else if (buffer_uptodate(bh)) { + if (wpc->io_type != XFS_IO_OVERWRITE) { + wpc->io_type = XFS_IO_OVERWRITE; + wpc->imap_valid = false; + } + } else { + if (PageUptodate(page)) + ASSERT(buffer_mapped(bh)); + /* + * This buffer is not uptodate and will not be + * written to disk. Ensure that we will put any + * subsequent writeable buffers into a new + * ioend. + */ + wpc->imap_valid = false; + continue; + } + + if (wpc->imap_valid) + wpc->imap_valid = xfs_imap_valid(inode, &wpc->imap, + offset); + if (!wpc->imap_valid) { + error = xfs_map_blocks(inode, offset, &wpc->imap, + wpc->io_type); + if (error) + goto out_error; + wpc->imap_valid = xfs_imap_valid(inode, &wpc->imap, + offset); + } + if (wpc->imap_valid) { + lock_buffer(bh); + if (wpc->io_type != XFS_IO_OVERWRITE) + xfs_map_at_offset(inode, bh, &wpc->imap, offset); + xfs_add_to_ioend(inode, bh, offset, wpc); + count++; + } + + if (!wpc->iohead) + wpc->iohead = wpc->ioend; + + } while (offset += len, ((bh = bh->b_this_page) != head)); + + if (uptodate && bh == head) + SetPageUptodate(page); + + xfs_start_page_writeback(page, 1, count); + ASSERT(wpc->iohead || !count); + return 0; + +out_error: + /* + * On error, we have to fail the iohead here because we locked buffers + * in the ioend chain. If we don't do this, we'll deadlock invalidating + * the page as that tries to lock the buffers on the page. Also, because + * we may have set pages under writeback, we have to make sure we run + * IO completion to mark the error state of the IO appropriately, so we + * can't cancel the ioend directly here. That means we have to mark this + * page as under writeback if we included any buffers from it in the + * ioend chain so that completion treats it correctly. + * + * If we didn't include the page in the ioend, then we can simply + * discard and unlock it as there are no other users of the page or it's + * buffers right now. The caller will still need to trigger submission + * of outstanding ioends on the writepage context so they are treated + * correctly on error. + */ + if (count) + xfs_start_page_writeback(page, 0, count); + else { + xfs_aops_discard_page(page); + ClearPageUptodate(page); + unlock_page(page); + } + mapping_set_error(page->mapping, error); + return error; +} + /* * Write out a dirty page. * @@ -769,13 +890,9 @@ xfs_do_writepage( { struct xfs_writepage_ctx *wpc = data; struct inode *inode = page->mapping->host; - struct buffer_head *bh, *head; loff_t offset; __uint64_t end_offset; pgoff_t end_index; - ssize_t len; - int err, uptodate = 1; - int count = 0; trace_xfs_writepage(inode, page, 0, 0); @@ -868,112 +985,7 @@ xfs_do_writepage( end_offset = offset; } - len = 1 << inode->i_blkbits; - - bh = head = page_buffers(page); - offset = page_offset(page); - - do { - if (offset >= end_offset) - break; - if (!buffer_uptodate(bh)) - uptodate = 0; - - /* - * set_page_dirty dirties all buffers in a page, independent - * of their state. The dirty state however is entirely - * meaningless for holes (!mapped && uptodate), so skip - * buffers covering holes here. - */ - if (!buffer_mapped(bh) && buffer_uptodate(bh)) { - wpc->imap_valid = false; - continue; - } - - if (buffer_unwritten(bh)) { - if (wpc->io_type != XFS_IO_UNWRITTEN) { - wpc->io_type = XFS_IO_UNWRITTEN; - wpc->imap_valid = false; - } - } else if (buffer_delay(bh)) { - if (wpc->io_type != XFS_IO_DELALLOC) { - wpc->io_type = XFS_IO_DELALLOC; - wpc->imap_valid = false; - } - } else if (buffer_uptodate(bh)) { - if (wpc->io_type != XFS_IO_OVERWRITE) { - wpc->io_type = XFS_IO_OVERWRITE; - wpc->imap_valid = false; - } - } else { - if (PageUptodate(page)) - ASSERT(buffer_mapped(bh)); - /* - * This buffer is not uptodate and will not be - * written to disk. Ensure that we will put any - * subsequent writeable buffers into a new - * ioend. - */ - wpc->imap_valid = 0; - continue; - } - - if (wpc->imap_valid) - wpc->imap_valid = xfs_imap_valid(inode, &wpc->imap, offset); - if (!wpc->imap_valid) { - err = xfs_map_blocks(inode, offset, &wpc->imap, - wpc->io_type); - if (err) - goto error; - wpc->imap_valid = xfs_imap_valid(inode, &wpc->imap, offset); - } - if (wpc->imap_valid) { - lock_buffer(bh); - if (wpc->io_type != XFS_IO_OVERWRITE) - xfs_map_at_offset(inode, bh, &wpc->imap, offset); - xfs_add_to_ioend(inode, bh, offset, wpc); - count++; - } - - if (!wpc->iohead) - wpc->iohead = wpc->ioend; - - } while (offset += len, ((bh = bh->b_this_page) != head)); - - if (uptodate && bh == head) - SetPageUptodate(page); - - xfs_start_page_writeback(page, 1, count); - - ASSERT(wpc->iohead || !count); - return 0; - -error: - /* - * On error, we have to fail the iohead here because we buffers locked - * in the ioend chain. If we don't do this, we'll deadlock invalidating - * the page as that tries to lock the buffers on the page. Also, because - * we may have set pages under writeback, we have to make sure we run - * IO completion to mark the error state of the IO appropriately, so we - * can't cancel the ioend directly here. That means we have to mark this - * page as under writeback if we included any buffers from it in the - * ioend chain so that completion treats it correctly. - * - * If we didn't include the page in the ioend, then we can simply - * discard and unlock it as there are no other users of the page or it's - * buffers right now. The caller will still need to trigger submission - * of outstanding ioends on the writepage context so they are treated - * correctly on error. - */ - if (count) - xfs_start_page_writeback(page, 0, count); - else { - xfs_aops_discard_page(page); - ClearPageUptodate(page); - unlock_page(page); - } - mapping_set_error(page->mapping, err); - return err; + return xfs_writepage_map(wpc, inode, page, offset, end_offset); redirty: redirty_page_for_writepage(wbc, page); -- 2.5.0 From dave@fromorbit.com Thu Feb 11 00:45:58 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=ham version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay3.corp.sgi.com [198.149.34.15]) by oss.sgi.com (Postfix) with ESMTP id 0FBE27CB5 for ; Thu, 11 Feb 2016 00:45:58 -0600 (CST) Received: from cuda.sgi.com (cuda1.sgi.com [192.48.157.11]) by relay3.corp.sgi.com (Postfix) with ESMTP id B3300AC002 for ; Wed, 10 Feb 2016 22:45:57 -0800 (PST) X-ASG-Debug-ID: 1455173153-04bdf066ed5ba80001-NocioJ Received: from ipmail06.adl2.internode.on.net (ipmail06.adl2.internode.on.net [150.101.137.129]) by cuda.sgi.com with ESMTP id Uffe6VcjEhd5TDox for ; Wed, 10 Feb 2016 22:45:54 -0800 (PST) X-Barracuda-Envelope-From: dave@fromorbit.com X-Barracuda-Apparent-Source-IP: 150.101.137.129 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: A2DFCwDlLLxWPBATLHlWCCgBAoMPgT+GYoF5nVUBAQEBAQeRLYoUgTRNAQEBAQEBBwEBAQFBP0ESAYNuAQUnLzMIGDE5AwcUGYgawQiFSoY0AYJXSoQUBYdQA4cDiCGcRo4/ghgBCwFADQyBXiguhwCBUwEBAQ Received: from ppp121-44-19-16.lns20.syd4.internode.on.net (HELO dastard) ([121.44.19.16]) by ipmail06.adl2.internode.on.net with ESMTP; 11 Feb 2016 17:15:49 +1030 Received: from disappointment.disaster.area ([192.168.1.110] helo=disappointment) by dastard with esmtp (Exim 4.80) (envelope-from ) id 1aTl0e-0007oC-Uh for xfs@oss.sgi.com; Thu, 11 Feb 2016 17:45:49 +1100 Received: from dave by disappointment with local (Exim 4.86) (envelope-from ) id 1aTl0e-00057i-TU for xfs@oss.sgi.com; Thu, 11 Feb 2016 17:45:48 +1100 From: Dave Chinner To: xfs@oss.sgi.com Subject: [PATCH 6/6] xfs: don't chain ioends during writepage submission Date: Thu, 11 Feb 2016 17:45:46 +1100 X-ASG-Orig-Subj: [PATCH 6/6] xfs: don't chain ioends during writepage submission Message-Id: <1455173146-19535-7-git-send-email-david@fromorbit.com> X-Mailer: git-send-email 2.5.0 In-Reply-To: <1455173146-19535-1-git-send-email-david@fromorbit.com> References: <1455173146-19535-1-git-send-email-david@fromorbit.com> X-Barracuda-Connect: ipmail06.adl2.internode.on.net[150.101.137.129] X-Barracuda-Start-Time: 1455173153 X-Barracuda-URL: https://192.48.157.11:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-BRTS-Status: 1 X-Barracuda-Spam-Score: 0.00 X-Barracuda-Spam-Status: No, SCORE=0.00 using per-user scores of TAG_LEVEL=1000.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.7 tests= X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.3.26937 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- From: Dave Chinner Currently we can build a long ioend chain during ->writepages that gets attached to the writepage context. IO submission only then occurs when we finish all the writepage processing. This means we can have many ioends allocated and pending, and this violates the mempool guarantees that we need to give about forwards progress. i.e. we really should only have one ioend being built at a time, otherwise we may drain the mempool trying to allocate a new ioend and that blocks submission, completion and freeing of ioends that are already in progress. To prevent this situation from happening, we need to submit ioends for IO as soon as they are ready for dispatch rather than queuing them for later submission. This means the ioends have bios built immediately and they get queued on any plug that is current active. Hence if we schedule away from writeback, the ioends that have been built will make forwards progress due to the plug flushing on context switch. This will also prevent context switches from creating unnecessary IO submission latency. We can't completely avoid having nested IO allocation - when we have a block size smaller than a page size, we still need to hold the ioend submission until after we have marked the current page dirty. Hence we may need multiple ioends to be held while the current page is completely mapped and made ready for IO dispatch. We cannot avoid this problem - the current code already has this ioend chaining within a page so we can mostly ignore that it occurs. Signed-off-by: Dave Chinner --- fs/xfs/xfs_aops.c | 237 ++++++++++++++++++++++++++---------------------------- fs/xfs/xfs_aops.h | 2 +- 2 files changed, 117 insertions(+), 122 deletions(-) diff --git a/fs/xfs/xfs_aops.c b/fs/xfs/xfs_aops.c index 691cdf9..114a8a5 100644 --- a/fs/xfs/xfs_aops.c +++ b/fs/xfs/xfs_aops.c @@ -47,7 +47,6 @@ struct xfs_writepage_ctx { struct xfs_bmbt_irec imap; bool imap_valid; unsigned int io_type; - struct xfs_ioend *iohead; struct xfs_ioend *ioend; sector_t last_block; }; @@ -283,7 +282,7 @@ xfs_alloc_ioend( */ atomic_set(&ioend->io_remaining, 1); ioend->io_error = 0; - ioend->io_list = NULL; + INIT_LIST_HEAD(&ioend->io_list); ioend->io_type = type; ioend->io_inode = inode; ioend->io_buffer_head = NULL; @@ -426,8 +425,7 @@ xfs_start_buffer_writeback( STATIC void xfs_start_page_writeback( struct page *page, - int clear_dirty, - int buffers) + int clear_dirty) { ASSERT(PageLocked(page)); ASSERT(!PageWriteback(page)); @@ -446,10 +444,6 @@ xfs_start_page_writeback( set_page_writeback_keepwrite(page); unlock_page(page); - - /* If no buffers on the page are to be written, finish it here */ - if (!buffers) - end_page_writeback(page); } static inline int xfs_bio_add_buffer(struct bio *bio, struct buffer_head *bh) @@ -458,110 +452,90 @@ static inline int xfs_bio_add_buffer(struct bio *bio, struct buffer_head *bh) } /* - * Submit all of the bios for all of the ioends we have saved up, covering the - * initial writepage page and also any probed pages. - * - * Because we may have multiple ioends spanning a page, we need to start - * writeback on all the buffers before we submit them for I/O. If we mark the - * buffers as we got, then we can end up with a page that only has buffers - * marked async write and I/O complete on can occur before we mark the other - * buffers async write. - * - * The end result of this is that we trip a bug in end_page_writeback() because - * we call it twice for the one page as the code in end_buffer_async_write() - * assumes that all buffers on the page are started at the same time. - * - * The fix is two passes across the ioend list - one to start writeback on the - * buffer_heads, and then submit them for I/O on the second pass. + * Submit all of the bios for an ioend. We are only passed a single ioend at a + * time; the caller is responsible for chaining prior to submission. * * If @fail is non-zero, it means that we have a situation where some part of * the submission process has failed after we have marked paged for writeback * and unlocked them. In this situation, we need to fail the ioend chain rather * than submit it to IO. This typically only happens on a filesystem shutdown. */ -STATIC void +STATIC int xfs_submit_ioend( struct writeback_control *wbc, xfs_ioend_t *ioend, - int fail) + int status) { - xfs_ioend_t *head = ioend; - xfs_ioend_t *next; struct buffer_head *bh; struct bio *bio; sector_t lastblock = 0; - /* Pass 1 - start writeback */ - do { - next = ioend->io_list; - for (bh = ioend->io_buffer_head; bh; bh = bh->b_private) - xfs_start_buffer_writeback(bh); - } while ((ioend = next) != NULL); + /* Reserve log space if we might write beyond the on-disk inode size. */ + if (!status && + ioend->io_type != XFS_IO_UNWRITTEN && xfs_ioend_is_append(ioend)) + status = xfs_setfilesize_trans_alloc(ioend); + /* + * If we are failing the IO now, just mark the ioend with an + * error and finish it. This will run IO completion immediately + * as there is only one reference to the ioend at this point in + * time. + */ + if (status) { + ioend->io_error = status; + xfs_finish_ioend(ioend); + return status; + } - /* Pass 2 - submit I/O */ - ioend = head; - do { - next = ioend->io_list; - bio = NULL; + bio = NULL; + for (bh = ioend->io_buffer_head; bh; bh = bh->b_private) { - /* - * If we are failing the IO now, just mark the ioend with an - * error and finish it. This will run IO completion immediately - * as there is only one reference to the ioend at this point in - * time. - */ - if (fail) { - ioend->io_error = fail; - xfs_finish_ioend(ioend); - continue; + if (!bio) { +retry: + bio = xfs_alloc_ioend_bio(bh); + } else if (bh->b_blocknr != lastblock + 1) { + xfs_submit_ioend_bio(wbc, ioend, bio); + goto retry; } - for (bh = ioend->io_buffer_head; bh; bh = bh->b_private) { - - if (!bio) { - retry: - bio = xfs_alloc_ioend_bio(bh); - } else if (bh->b_blocknr != lastblock + 1) { - xfs_submit_ioend_bio(wbc, ioend, bio); - goto retry; - } - - if (xfs_bio_add_buffer(bio, bh) != bh->b_size) { - xfs_submit_ioend_bio(wbc, ioend, bio); - goto retry; - } - - lastblock = bh->b_blocknr; - } - if (bio) + if (xfs_bio_add_buffer(bio, bh) != bh->b_size) { xfs_submit_ioend_bio(wbc, ioend, bio); - xfs_finish_ioend(ioend); - } while ((ioend = next) != NULL); + goto retry; + } + + lastblock = bh->b_blocknr; + } + if (bio) + xfs_submit_ioend_bio(wbc, ioend, bio); + xfs_finish_ioend(ioend); + return 0; } /* * Test to see if we've been building up a completion structure for * earlier buffers -- if so, we try to append to this ioend if we * can, otherwise we finish off any current ioend and start another. - * Return true if we've finished the given ioend. + * Return the ioend we finished off so that the caller can submit it + * once it has finished processing the dirty page. */ STATIC void xfs_add_to_ioend( struct inode *inode, struct buffer_head *bh, xfs_off_t offset, - struct xfs_writepage_ctx *wpc) + struct xfs_writepage_ctx *wpc, + struct list_head *iolist) { if (!wpc->ioend || wpc->io_type != wpc->ioend->io_type || bh->b_blocknr != wpc->last_block + 1) { struct xfs_ioend *new; + if (wpc->ioend) + list_add(&wpc->ioend->io_list, iolist); + new = xfs_alloc_ioend(inode, wpc->io_type); new->io_offset = offset; new->io_buffer_head = bh; new->io_buffer_tail = bh; - if (wpc->ioend) - wpc->ioend->io_list = new; wpc->ioend = new; } else { wpc->ioend->io_buffer_tail->b_private = bh; @@ -571,6 +545,7 @@ xfs_add_to_ioend( bh->b_private = NULL; wpc->ioend->io_size += bh->b_size; wpc->last_block = bh->b_blocknr; + xfs_start_buffer_writeback(bh); } STATIC void @@ -732,44 +707,41 @@ out_invalidate: return; } -static int -xfs_writepage_submit( - struct xfs_writepage_ctx *wpc, - struct writeback_control *wbc, - int status) -{ - struct blk_plug plug; - - /* Reserve log space if we might write beyond the on-disk inode size. */ - if (!status && wpc->ioend && wpc->ioend->io_type != XFS_IO_UNWRITTEN && - xfs_ioend_is_append(wpc->ioend)) - status = xfs_setfilesize_trans_alloc(wpc->ioend); - - if (wpc->iohead) { - blk_start_plug(&plug); - xfs_submit_ioend(wbc, wpc->iohead, status); - blk_finish_plug(&plug); - } - return status; -} - +/* + * We implement an immediate ioend submission policy here to avoid needing to + * chain multiple ioends and hence nest mempool allocations which can violate + * forward progress guarantees we need to provide. The current ioend we are + * adding buffers to is cached on the writepage context, and if the new buffer + * does not append to the cached ioend it will create a new ioend and cache that + * instead. + * + * If a new ioend is created and cached, the old ioend is returned and queued + * locally for submission once the entire page is processed or an error has been + * detected. While ioends are submitted immediately after they are completed, + * batching optimisations are provided by higher level block plugging. + * + * At the end of a writeback pass, there will be a cached ioend remaining on the + * writepage context that the caller will need to submit. + */ static int xfs_writepage_map( struct xfs_writepage_ctx *wpc, + struct writeback_control *wbc, struct inode *inode, struct page *page, loff_t offset, __uint64_t end_offset) { + LIST_HEAD(submit_list); + struct xfs_ioend *ioend, *next; struct buffer_head *bh, *head; ssize_t len = 1 << inode->i_blkbits; int error = 0; - int uptodate = 1; int count = 0; + int uptodate = 1; bh = head = page_buffers(page); offset = page_offset(page); - do { if (offset >= end_offset) break; @@ -830,46 +802,65 @@ xfs_writepage_map( lock_buffer(bh); if (wpc->io_type != XFS_IO_OVERWRITE) xfs_map_at_offset(inode, bh, &wpc->imap, offset); - xfs_add_to_ioend(inode, bh, offset, wpc); + xfs_add_to_ioend(inode, bh, offset, wpc, &submit_list); count++; } - if (!wpc->iohead) - wpc->iohead = wpc->ioend; - } while (offset += len, ((bh = bh->b_this_page) != head)); if (uptodate && bh == head) SetPageUptodate(page); - xfs_start_page_writeback(page, 1, count); - ASSERT(wpc->iohead || !count); - return 0; + ASSERT(wpc->ioend || list_empty(&submit_list)); out_error: /* - * On error, we have to fail the iohead here because we locked buffers - * in the ioend chain. If we don't do this, we'll deadlock invalidating - * the page as that tries to lock the buffers on the page. Also, because - * we may have set pages under writeback, we have to make sure we run - * IO completion to mark the error state of the IO appropriately, so we - * can't cancel the ioend directly here. That means we have to mark this - * page as under writeback if we included any buffers from it in the - * ioend chain so that completion treats it correctly. + * On error, we have to fail the ioend here because we have locked + * buffers in the ioend. If we don't do this, we'll deadlock + * invalidating the page as that tries to lock the buffers on the page. + * Also, because we may have set pages under writeback, we have to make + * sure we run IO completion to mark the error state of the IO + * appropriately, so we can't cancel the ioend directly here. That means + * we have to mark this page as under writeback if we included any + * buffers from it in the ioend chain so that completion treats it + * correctly. * - * If we didn't include the page in the ioend, then we can simply - * discard and unlock it as there are no other users of the page or it's - * buffers right now. The caller will still need to trigger submission - * of outstanding ioends on the writepage context so they are treated - * correctly on error. + * If we didn't include the page in the ioend, the on error we can + * simply discard and unlock it as there are no other users of the page + * or it's buffers right now. The caller will still need to trigger + * submission of outstanding ioends on the writepage context so they are + * treated correctly on error. */ - if (count) - xfs_start_page_writeback(page, 0, count); - else { + if (count) { + xfs_start_page_writeback(page, !error); + + /* + * Preserve the original error if there was one, otherwise catch + * submission errors here and propagate into subsequent ioend + * submissions. + */ + list_for_each_entry_safe(ioend, next, &submit_list, io_list) { + int error2; + + list_del_init(&ioend->io_list); + error2 = xfs_submit_ioend(wbc, ioend, error); + if (error2 && !error) + error = error2; + } + } else if (error) { xfs_aops_discard_page(page); ClearPageUptodate(page); unlock_page(page); + } else { + /* + * We can end up here with no error and nothing to write if we + * race with a partial page truncate on a sub-page block sized + * filesystem. In that case we need to mark the page clean. + */ + xfs_start_page_writeback(page, 1); + end_page_writeback(page); } + mapping_set_error(page->mapping, error); return error; } @@ -985,7 +976,7 @@ xfs_do_writepage( end_offset = offset; } - return xfs_writepage_map(wpc, inode, page, offset, end_offset); + return xfs_writepage_map(wpc, wbc, inode, page, offset, end_offset); redirty: redirty_page_for_writepage(wbc, page); @@ -1004,7 +995,9 @@ xfs_vm_writepage( int ret; ret = xfs_do_writepage(page, wbc, &wpc); - return xfs_writepage_submit(&wpc, wbc, ret); + if (wpc.ioend) + ret = xfs_submit_ioend(wbc, wpc.ioend, ret); + return ret; } STATIC int @@ -1019,7 +1012,9 @@ xfs_vm_writepages( xfs_iflags_clear(XFS_I(mapping->host), XFS_ITRUNCATED); ret = write_cache_pages(mapping, wbc, xfs_do_writepage, &wpc); - return xfs_writepage_submit(&wpc, wbc, ret); + if (wpc.ioend) + ret = xfs_submit_ioend(wbc, wpc.ioend, ret); + return ret; } /* diff --git a/fs/xfs/xfs_aops.h b/fs/xfs/xfs_aops.h index 3c3f1a3..4e01bd5 100644 --- a/fs/xfs/xfs_aops.h +++ b/fs/xfs/xfs_aops.h @@ -41,7 +41,7 @@ enum { * It can manage several multi-page bio's at once. */ typedef struct xfs_ioend { - struct xfs_ioend *io_list; /* next ioend in chain */ + struct list_head io_list; /* next ioend in chain */ unsigned int io_type; /* delalloc / unwritten */ int io_error; /* I/O error code */ atomic_t io_remaining; /* hold count */ -- 2.5.0 From dave@fromorbit.com Thu Feb 11 00:45:59 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=ham version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay1.corp.sgi.com [137.38.102.111]) by oss.sgi.com (Postfix) with ESMTP id 424D27CA6 for ; Thu, 11 Feb 2016 00:45:59 -0600 (CST) Received: from cuda.sgi.com (cuda2.sgi.com [192.48.176.25]) by relay1.corp.sgi.com (Postfix) with ESMTP id 20D8A8F8050 for ; Wed, 10 Feb 2016 22:45:59 -0800 (PST) X-ASG-Debug-ID: 1455173151-04cbb0433270a50003-NocioJ Received: from ipmail06.adl2.internode.on.net (ipmail06.adl2.internode.on.net [150.101.137.129]) by cuda.sgi.com with ESMTP id X2B1jSLQjnrPJT6C for ; Wed, 10 Feb 2016 22:45:56 -0800 (PST) X-Barracuda-Envelope-From: dave@fromorbit.com X-Barracuda-Apparent-Source-IP: 150.101.137.129 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: A2ADDQDlLLxWPBATLHleKAECgw+BP4ZigXmdVQEBAQEBAQaRLYtITQEBAQEBAQcBAQEBQT9BEgGDbgEFJy8zCBgxOQMHFBmIGsEIhUqJCoRgBYdTjyScRkSNe4IYAQs+AxmBXiguhwAagTkBAQE Received: from ppp121-44-19-16.lns20.syd4.internode.on.net (HELO dastard) ([121.44.19.16]) by ipmail06.adl2.internode.on.net with ESMTP; 11 Feb 2016 17:15:49 +1030 Received: from disappointment.disaster.area ([192.168.1.110] helo=disappointment) by dastard with esmtp (Exim 4.80) (envelope-from ) id 1aTl0e-0007oA-TS for xfs@oss.sgi.com; Thu, 11 Feb 2016 17:45:48 +1100 Received: from dave by disappointment with local (Exim 4.86) (envelope-from ) id 1aTl0e-00057Y-Se for xfs@oss.sgi.com; Thu, 11 Feb 2016 17:45:48 +1100 From: Dave Chinner To: xfs@oss.sgi.com Subject: [PATCH 4/6] xfs: xfs_cluster_write is redundant Date: Thu, 11 Feb 2016 17:45:44 +1100 X-ASG-Orig-Subj: [PATCH 4/6] xfs: xfs_cluster_write is redundant Message-Id: <1455173146-19535-5-git-send-email-david@fromorbit.com> X-Mailer: git-send-email 2.5.0 In-Reply-To: <1455173146-19535-1-git-send-email-david@fromorbit.com> References: <1455173146-19535-1-git-send-email-david@fromorbit.com> X-Barracuda-Connect: ipmail06.adl2.internode.on.net[150.101.137.129] X-Barracuda-Start-Time: 1455173155 X-Barracuda-URL: https://192.48.176.25:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-BRTS-Status: 1 X-Barracuda-Spam-Score: 0.00 X-Barracuda-Spam-Status: No, SCORE=0.00 using per-user scores of TAG_LEVEL=1000.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.7 tests= X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.3.26937 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- From: Dave Chinner xfs_cluster_write() is not necessary now that xfs_vm_writepages() aggregates writepage calls across a single mapping. This means we no longer need to do page lookups in xfs_cluster_write, so writeback only needs to look up th epage cache once per page being written. This also removes a large amount of mostly duplicate code between xfs_do_writepage() and xfs_convert_page(). Signed-off-by: Dave Chinner Reviewed-by: Christoph Hellwig Signed-off-by: Dave Chinner --- fs/xfs/xfs_aops.c | 214 ++---------------------------------------------------- 1 file changed, 6 insertions(+), 208 deletions(-) diff --git a/fs/xfs/xfs_aops.c b/fs/xfs/xfs_aops.c index ea2f4f8..01e1663 100644 --- a/fs/xfs/xfs_aops.c +++ b/fs/xfs/xfs_aops.c @@ -656,179 +656,6 @@ xfs_check_page_type( return false; } -/* - * Allocate & map buffers for page given the extent map. Write it out. - * except for the original page of a writepage, this is called on - * delalloc/unwritten pages only, for the original page it is possible - * that the page has no mapping at all. - */ -STATIC int -xfs_convert_page( - struct inode *inode, - struct page *page, - loff_t tindex, - struct xfs_writepage_ctx *wpc, - struct writeback_control *wbc) -{ - struct buffer_head *bh, *head; - xfs_off_t end_offset; - unsigned long p_offset; - int len, page_dirty; - int count = 0, done = 0, uptodate = 1; - xfs_off_t offset = page_offset(page); - - if (page->index != tindex) - goto fail; - if (!trylock_page(page)) - goto fail; - if (PageWriteback(page)) - goto fail_unlock_page; - if (page->mapping != inode->i_mapping) - goto fail_unlock_page; - if (!xfs_check_page_type(page, wpc->ioend->io_type, false)) - goto fail_unlock_page; - - /* - * page_dirty is initially a count of buffers on the page before - * EOF and is decremented as we move each into a cleanable state. - * - * Derivation: - * - * End offset is the highest offset that this page should represent. - * If we are on the last page, (end_offset & (PAGE_CACHE_SIZE - 1)) - * will evaluate non-zero and be less than PAGE_CACHE_SIZE and - * hence give us the correct page_dirty count. On any other page, - * it will be zero and in that case we need page_dirty to be the - * count of buffers on the page. - */ - end_offset = min_t(unsigned long long, - (xfs_off_t)(page->index + 1) << PAGE_CACHE_SHIFT, - i_size_read(inode)); - - /* - * If the current map does not span the entire page we are about to try - * to write, then give up. The only way we can write a page that spans - * multiple mappings in a single writeback iteration is via the - * xfs_vm_writepage() function. Data integrity writeback requires the - * entire page to be written in a single attempt, otherwise the part of - * the page we don't write here doesn't get written as part of the data - * integrity sync. - * - * For normal writeback, we also don't attempt to write partial pages - * here as it simply means that write_cache_pages() will see it under - * writeback and ignore the page until some point in the future, at - * which time this will be the only page in the file that needs - * writeback. Hence for more optimal IO patterns, we should always - * avoid partial page writeback due to multiple mappings on a page here. - */ - if (!xfs_imap_valid(inode, &wpc->imap, end_offset)) - goto fail_unlock_page; - - len = 1 << inode->i_blkbits; - p_offset = min_t(unsigned long, end_offset & (PAGE_CACHE_SIZE - 1), - PAGE_CACHE_SIZE); - p_offset = p_offset ? roundup(p_offset, len) : PAGE_CACHE_SIZE; - page_dirty = p_offset / len; - - /* - * The moment we find a buffer that doesn't match our current type - * specification or can't be written, abort the loop and start - * writeback. As per the above xfs_imap_valid() check, only - * xfs_vm_writepage() can handle partial page writeback fully - we are - * limited here to the buffers that are contiguous with the current - * ioend, and hence a buffer we can't write breaks that contiguity and - * we have to defer the rest of the IO to xfs_vm_writepage(). - */ - bh = head = page_buffers(page); - do { - if (offset >= end_offset) - break; - if (!buffer_uptodate(bh)) - uptodate = 0; - if (!(PageUptodate(page) || buffer_uptodate(bh))) { - done = 1; - break; - } - - if (buffer_unwritten(bh) || buffer_delay(bh) || - buffer_mapped(bh)) { - if (buffer_unwritten(bh)) - wpc->io_type = XFS_IO_UNWRITTEN; - else if (buffer_delay(bh)) - wpc->io_type = XFS_IO_DELALLOC; - else - wpc->io_type = XFS_IO_OVERWRITE; - - /* - * imap should always be valid because of the above - * partial page end_offset check on the imap. - */ - ASSERT(xfs_imap_valid(inode, &wpc->imap, offset)); - - lock_buffer(bh); - if (wpc->io_type != XFS_IO_OVERWRITE) - xfs_map_at_offset(inode, bh, &wpc->imap, offset); - xfs_add_to_ioend(inode, bh, offset, wpc); - - page_dirty--; - count++; - } else { - done = 1; - break; - } - } while (offset += len, (bh = bh->b_this_page) != head); - - if (uptodate && bh == head) - SetPageUptodate(page); - - if (count) { - if (--wbc->nr_to_write <= 0 && - wbc->sync_mode == WB_SYNC_NONE) - done = 1; - } - xfs_start_page_writeback(page, !page_dirty, count); - - return done; - fail_unlock_page: - unlock_page(page); - fail: - return 1; -} - -/* - * Convert & write out a cluster of pages in the same extent as defined - * by mp and following the start page. - */ -STATIC void -xfs_cluster_write( - struct inode *inode, - pgoff_t tindex, - struct xfs_writepage_ctx *wpc, - struct writeback_control *wbc, - pgoff_t tlast) -{ - struct pagevec pvec; - int done = 0, i; - - pagevec_init(&pvec, 0); - while (!done && tindex <= tlast) { - unsigned len = min_t(pgoff_t, PAGEVEC_SIZE, tlast - tindex + 1); - - if (!pagevec_lookup(&pvec, inode->i_mapping, tindex, len)) - break; - - for (i = 0; i < pagevec_count(&pvec); i++) { - done = xfs_convert_page(inode, pvec.pages[i], tindex++, - wpc, wbc); - if (done) - break; - } - - pagevec_release(&pvec); - cond_resched(); - } -} - STATIC void xfs_vm_invalidatepage( struct page *page, @@ -945,7 +772,7 @@ xfs_do_writepage( struct buffer_head *bh, *head; loff_t offset; __uint64_t end_offset; - pgoff_t end_index, last_index; + pgoff_t end_index; ssize_t len; int err, uptodate = 1; int count = 0; @@ -975,12 +802,9 @@ xfs_do_writepage( if (WARN_ON_ONCE(current->flags & PF_FSTRANS)) goto redirty; - /* Is this page beyond the end of the file? */ - offset = i_size_read(inode); - end_index = offset >> PAGE_CACHE_SHIFT; - last_index = (offset - 1) >> PAGE_CACHE_SHIFT; - /* + * Is this page beyond the end of the file? + * * The page index is less than the end_index, adjust the end_offset * to the highest offset that this page should represent. * ----------------------------------------------------- @@ -991,6 +815,8 @@ xfs_do_writepage( * | desired writeback range | see else | * ---------------------------------^------------------| */ + offset = i_size_read(inode); + end_index = offset >> PAGE_CACHE_SHIFT; if (page->index < end_index) end_offset = (xfs_off_t)(page->index + 1) << PAGE_CACHE_SHIFT; else { @@ -1119,35 +945,7 @@ xfs_do_writepage( xfs_start_page_writeback(page, 1, count); - /* if there is no IO to be submitted for this page, we are done */ - if (!count) - return 0; - - ASSERT(wpc->iohead); - ASSERT(err == 0); - - /* - * Any errors from this point onwards need tobe reported through the IO - * completion path as we have marked the initial page as under writeback - * and unlocked it. - */ - if (wpc->imap_valid) { - xfs_off_t end_index; - - end_index = wpc->imap.br_startoff + wpc->imap.br_blockcount; - - /* to bytes */ - end_index <<= inode->i_blkbits; - - /* to pages */ - end_index = (end_index - 1) >> PAGE_CACHE_SHIFT; - - /* check against file size */ - if (end_index > last_index) - end_index = last_index; - - xfs_cluster_write(inode, page->index + 1, wpc, wbc, end_index); - } + ASSERT(wpc->iohead || !count); return 0; error: -- 2.5.0 From bfoster@redhat.com Thu Feb 11 06:24:23 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=ham version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay3.corp.sgi.com [198.149.34.15]) by oss.sgi.com (Postfix) with ESMTP id 6D59B7CA2 for ; Thu, 11 Feb 2016 06:24:23 -0600 (CST) Received: from cuda.sgi.com (cuda2.sgi.com [192.48.176.25]) by relay3.corp.sgi.com (Postfix) with ESMTP id E9394AC001 for ; Thu, 11 Feb 2016 04:24:19 -0800 (PST) X-ASG-Debug-ID: 1455193455-04cbb0433478b30001-NocioJ Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by cuda.sgi.com with ESMTP id A8zb5q9ncTBRENIt (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO) for ; Thu, 11 Feb 2016 04:24:15 -0800 (PST) X-Barracuda-Envelope-From: bfoster@redhat.com X-Barracuda-Apparent-Source-IP: 209.132.183.28 X-ASG-Whitelist: Client Received: from int-mx09.intmail.prod.int.phx2.redhat.com (int-mx09.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by mx1.redhat.com (Postfix) with ESMTPS id DA1677AE94; Thu, 11 Feb 2016 12:24:14 +0000 (UTC) Received: from bfoster.bfoster (dhcp-41-164.bos.redhat.com [10.18.41.164]) by int-mx09.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id u1BCOEnu025483; Thu, 11 Feb 2016 07:24:14 -0500 Received: by bfoster.bfoster (Postfix, from userid 1000) id 9A05B123DF8; Thu, 11 Feb 2016 07:24:13 -0500 (EST) Date: Thu, 11 Feb 2016 07:24:13 -0500 From: Brian Foster To: Dave Chinner Cc: xfs@oss.sgi.com Subject: Re: [PATCH 5/5] xfs: don't chain ioends during writepage submission Message-ID: <20160211122413.GA4156@bfoster.bfoster> X-ASG-Orig-Subj: Re: [PATCH 5/5] xfs: don't chain ioends during writepage submission References: <1454910258-7578-1-git-send-email-david@fromorbit.com> <1454910258-7578-6-git-send-email-david@fromorbit.com> <20160209142355.GB25829@bfoster.bfoster> <20160209215900.GH14668@dastard> <20160210131816.GB48974@bfoster.bfoster> <20160210210926.GL14668@dastard> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20160210210926.GL14668@dastard> User-Agent: Mutt/1.5.24 (2015-08-30) X-Scanned-By: MIMEDefang 2.68 on 10.5.11.22 X-Barracuda-Connect: mx1.redhat.com[209.132.183.28] X-Barracuda-Start-Time: 1455193455 X-Barracuda-Encrypted: ECDHE-RSA-AES256-GCM-SHA384 X-Barracuda-URL: https://192.48.176.25:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-BRTS-Status: 1 On Thu, Feb 11, 2016 at 08:09:26AM +1100, Dave Chinner wrote: > On Wed, Feb 10, 2016 at 08:18:17AM -0500, Brian Foster wrote: > > On Wed, Feb 10, 2016 at 08:59:00AM +1100, Dave Chinner wrote: > > > On Tue, Feb 09, 2016 at 09:23:55AM -0500, Brian Foster wrote: > > > > On Mon, Feb 08, 2016 at 04:44:18PM +1100, Dave Chinner wrote: > > > > > @@ -738,29 +726,22 @@ xfs_writepage_submit( > > > > > struct writeback_control *wbc, > > > > > int status) > > > > > { > > > > > - struct blk_plug plug; > > > > > - > > > > > - /* Reserve log space if we might write beyond the on-disk inode size. */ > > > > > - if (!status && wpc->ioend && wpc->ioend->io_type != XFS_IO_UNWRITTEN && > > > > > - xfs_ioend_is_append(wpc->ioend)) > > > > > - status = xfs_setfilesize_trans_alloc(wpc->ioend); > > > > > - > > > > > - if (wpc->iohead) { > > > > > - blk_start_plug(&plug); > > > > > - xfs_submit_ioend(wbc, wpc->iohead, status); > > > > > - blk_finish_plug(&plug); > > > > > - } > > > > > > > > We've dropped our plug here but I don't see anything added in > > > > xfs_vm_writepages(). Shouldn't we have one there now that ioends are > > > > submitted as we go? generic_writepages() uses one around its > > > > write_cache_pages() call.. > > > > > > It's not really necessary, as we now have higher level plugging in > > > the writeback go will get flushed on context switch, and if we don't > > > have a high level plug (e.g. fsync triggered writeback), then we > > > submit the IO immediately, just like flushing the plug here would do > > > anyway.... > > > > > > > Ok, I'm digging around the wb code a bit and I see plugs in/around > > wb_writeback(), so I assume that's what you're referring to in the first > > case. I'm not quite following the fsync case though... > > > > In the current upstream code, fsync() leads to the following call chain: > > > > filemap_write_and_wait_range() > > __filemap_fdatawrite_range() > > do_writepages() > > xfs_vm_writepages() > > generic_writepages() > > blk_start_plug() > > write_cache_pages() > > blk_finish_plug() > > > > After this series, we have the following: > > > > filemap_write_and_wait_range() > > __filemap_fdatawrite_range() > > do_writepages() > > xfs_vm_writepages() > > write_cache_pages() > > > > ... with no plug that I can see. What am I missing? > > fsync tends to be a latency sensitive operation, not a bandwidth > maximising operation. Plugging trades off IO submission latency for > maximising IO bandwidth. For fsync and other single inode operations > that block waiting for the IO to complete, maximising bandwidth is > not necessarily the right thing to do. > Ok. > For single inode IO commands (such as through > __filemap_fdatawrite_range), block plugging will only improve > performance if the filesystem does not form large bios to begin > with. XFS always builds maximally sized bios if it can, so plugging > cannot improve the IO throughput from such writeback behaviour > because the bios it builds cannot be further merged. Such bios are > better served being pushed straight in the the IO scheduler queues. > > IOWs, plugging only makes a difference when the IO being formed is > small but is mergable in the IO scheduler. This what happens with > small file delayed allocation in writeback in XFS, and nowdays we > have a high level plug for this (i.e. in writeback_inodes_wb() and > wb_writeback()). Hence those one-bio-per-inode-but-all-sequential IO > will be merged in the plug before dispatch, thereby improving write > bandwidth under such small file writeback workloads. (See the > numbers in commmit d353d75 writeback: plug writeback at a high > level").) > Makes sense. > IOWs, block plugging is not a magical "make everything go faster" > knob. Different filesystems have different IO dispatch methods, and > so require different plugging strategies to optimise their IO > patterns. It may be that plugging in xfs_vm_writepages is > advantageous in some workloads for fsync, but I haven't been able to > measure them. > I don't think I suggested it was magical in any way. ;) My initial feedback was simply based on the fact that it looked like the behavior changed without notice, so it wasn't clear if that was intentional. You pointed out the higher level wb plug but at the same time implied not having a plug in the fsync case, which we previously did have (granted, only for the mapping). Perhaps I read into that wrong. It would be nice if the commit log made a quick mention about the plug situation (one context has a separate plug, for the other it is unnecessary), but otherwise the explanation addresses my concerns. Thanks! Brian > Cheers, > > Dave. > -- > Dave Chinner > david@fromorbit.com > > _______________________________________________ > xfs mailing list > xfs@oss.sgi.com > http://oss.sgi.com/mailman/listinfo/xfs From jack@suse.cz Thu Feb 11 06:42:53 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=ham version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay2.corp.sgi.com [137.38.102.29]) by oss.sgi.com (Postfix) with ESMTP id 186C57CA2 for ; Thu, 11 Feb 2016 06:42:53 -0600 (CST) Received: from cuda.sgi.com (cuda1.sgi.com [192.48.157.11]) by relay2.corp.sgi.com (Postfix) with ESMTP id DFB31304043 for ; Thu, 11 Feb 2016 04:42:52 -0800 (PST) X-ASG-Debug-ID: 1455194569-04bdf066ea62fe0001-NocioJ Received: from mx2.suse.de (mx2.suse.de [195.135.220.15]) by cuda.sgi.com with ESMTP id FmQNBp2HikIcmb5N (version=TLSv1 cipher=ECDHE-RSA-AES256-SHA bits=256 verify=NO) for ; Thu, 11 Feb 2016 04:42:50 -0800 (PST) X-Barracuda-Envelope-From: jack@suse.cz X-Barracuda-Apparent-Source-IP: 195.135.220.15 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 319C2ACAD; Thu, 11 Feb 2016 12:42:48 +0000 (UTC) Received: by quack.suse.cz (Postfix, from userid 1000) id 97FF7823D6; Thu, 11 Feb 2016 13:43:04 +0100 (CET) Date: Thu, 11 Feb 2016 13:43:04 +0100 From: Jan Kara To: Ross Zwisler Cc: linux-kernel@vger.kernel.org, Theodore Ts'o , Alexander Viro , Andreas Dilger , Andrew Morton , Dan Williams , Dave Chinner , Jan Kara , Matthew Wilcox , linux-ext4@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux-mm@kvack.org, linux-nvdimm@lists.01.org, xfs@oss.sgi.com Subject: Re: [PATCH v2 0/2] DAX bdev fixes - move flushing calls to FS Message-ID: <20160211124304.GI21760@quack.suse.cz> X-ASG-Orig-Subj: Re: [PATCH v2 0/2] DAX bdev fixes - move flushing calls to FS References: <1455137336-28720-1-git-send-email-ross.zwisler@linux.intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1455137336-28720-1-git-send-email-ross.zwisler@linux.intel.com> User-Agent: Mutt/1.5.24 (2015-08-30) X-Barracuda-Connect: mx2.suse.de[195.135.220.15] X-Barracuda-Start-Time: 1455194570 X-Barracuda-Encrypted: ECDHE-RSA-AES256-SHA X-Barracuda-URL: https://192.48.157.11:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-BRTS-Status: 1 X-Barracuda-Spam-Score: 0.00 X-Barracuda-Spam-Status: No, SCORE=0.00 using per-user scores of TAG_LEVEL=1000.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.7 tests=BSF_SC0_MISMATCH_TO X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.3.26943 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 0.00 BSF_SC0_MISMATCH_TO Envelope rcpt doesn't match header On Wed 10-02-16 13:48:54, Ross Zwisler wrote: > During testing of raw block devices + DAX I noticed that the struct > block_device that we were using for DAX operations was incorrect. For the > fault handlers, etc. we can just get the correct bdev via get_block(), > which is passed in as a function pointer, but for the *sync code and for > sector zeroing we don't have access to get_block(). This is also an issue > for XFS real-time devices, whenever we get those working. > > Patch one of this series fixes the DAX sector zeroing code by explicitly > passing in a valid struct block_device. > > Patch two of this series fixes DAX *sync support by moving calls to > dax_writeback_mapping_range() out of filemap_write_and_wait_range() and > into the filesystem/block device ->writepages function so that it can > supply us with a valid block device. This also fixes DAX code to properly > flush caches in response to sync(2). > > Thanks to Jan Kara for his initial draft of patch 2: > https://lkml.org/lkml/2016/2/9/485 > > Here are the changes that I've made to that patch: > > 1) For DAX mappings, only return after calling > dax_writeback_mapping_range() if we encountered an error. In the non-error > case we still need to write back normal pages, else we lose metadata > updates. > > 2) In dax_writeback_mapping_range(), move the new check for > if (!mapping->nrexceptional || wbc->sync_mode != WB_SYNC_ALL) > above the i_blkbits check. In my testing I found cases where > dax_writeback_mapping_range() was called for inodes with i_blkbits != > PAGE_SHIFT - I'm assuming these are internal metadata inodes? They have no > exceptional DAX entries to flush, so we have no work to do, but if we > return error from the i_blkbits check we will fail the overall writeback > operation. Please let me know if it seems wrong for us to be seeing inodes > set to use DAX but with i_blkbits != PAGE_SHIFT and I'll get more info. So I'm wondering - how come S_DAX flag got set for inode where i_blkbis != PAGE_SHIFT? That would seem to be a bug? I specifically ordered the checks like this to catch such issues. > 3) In filemap_write_and_wait() and filemap_write_and_wait_range(), continue > the writeback in the case that DAX is enabled but we only have a nonzero > mapping->nrpages. As with 1) and 2), I believe this is necessary to > properly writeback metadata changes. If this sounds wrong, please let me > know and I'll get more info. And I'm surprised here as well. If there are dax_mapping() inodes that have pagecache pages, then we have issues with radix tree handling as well. So how come dax_mapping() inodes have pages attached? If it is about block device inodes, then I find it buggy, that S_DAX gets set for such inodes when filesystem is mounted on them because in such cases we are IMO asking for data corruption sooner rather than later... Honza -- Jan Kara SUSE Labs, CR From jack@suse.cz Thu Feb 11 06:50:36 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=ham version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay1.corp.sgi.com [137.38.102.111]) by oss.sgi.com (Postfix) with ESMTP id EE1C87CA2 for ; Thu, 11 Feb 2016 06:50:36 -0600 (CST) Received: from cuda.sgi.com (cuda3.sgi.com [192.48.176.15]) by relay1.corp.sgi.com (Postfix) with ESMTP id F020E8F804C for ; Thu, 11 Feb 2016 04:50:30 -0800 (PST) X-ASG-Debug-ID: 1455195027-04cb6c1e565a9d0001-NocioJ Received: from mx2.suse.de (mx2.suse.de [195.135.220.15]) by cuda.sgi.com with ESMTP id 6rMwEWvyIOAwLSXj (version=TLSv1 cipher=ECDHE-RSA-AES256-SHA bits=256 verify=NO) for ; Thu, 11 Feb 2016 04:50:28 -0800 (PST) X-Barracuda-Envelope-From: jack@suse.cz X-Barracuda-Apparent-Source-IP: 195.135.220.15 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay1.suse.de (charybdis-ext.suse.de [195.135.220.254]) by mx2.suse.de (Postfix) with ESMTP id 5F791ACAD; Thu, 11 Feb 2016 12:50:27 +0000 (UTC) Received: by quack.suse.cz (Postfix, from userid 1000) id 93D0F823D6; Thu, 11 Feb 2016 13:50:44 +0100 (CET) Date: Thu, 11 Feb 2016 13:50:44 +0100 From: Jan Kara To: Ross Zwisler Cc: Dave Chinner , linux-kernel@vger.kernel.org, Theodore Ts'o , Alexander Viro , Andreas Dilger , Andrew Morton , Dan Williams , Jan Kara , Matthew Wilcox , linux-ext4@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux-mm@kvack.org, linux-nvdimm@lists.01.org, xfs@oss.sgi.com, Jan Kara Subject: Re: [PATCH v2 2/2] dax: move writeback calls into the filesystems Message-ID: <20160211125044.GJ21760@quack.suse.cz> X-ASG-Orig-Subj: Re: [PATCH v2 2/2] dax: move writeback calls into the filesystems References: <1455137336-28720-1-git-send-email-ross.zwisler@linux.intel.com> <1455137336-28720-3-git-send-email-ross.zwisler@linux.intel.com> <20160210220312.GP14668@dastard> <20160210224340.GA30938@linux.intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20160210224340.GA30938@linux.intel.com> User-Agent: Mutt/1.5.24 (2015-08-30) X-Barracuda-Connect: mx2.suse.de[195.135.220.15] X-Barracuda-Start-Time: 1455195028 X-Barracuda-Encrypted: ECDHE-RSA-AES256-SHA X-Barracuda-URL: https://192.48.176.15:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-BRTS-Status: 1 X-Barracuda-Spam-Score: 0.00 X-Barracuda-Spam-Status: No, SCORE=0.00 using per-user scores of TAG_LEVEL=1000.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.7 tests=BSF_SC0_MISMATCH_TO X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.3.26944 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 0.00 BSF_SC0_MISMATCH_TO Envelope rcpt doesn't match header On Wed 10-02-16 15:43:40, Ross Zwisler wrote: > On Thu, Feb 11, 2016 at 09:03:12AM +1100, Dave Chinner wrote: > > On Wed, Feb 10, 2016 at 01:48:56PM -0700, Ross Zwisler wrote: > > > Previously calls to dax_writeback_mapping_range() for all DAX filesystems > > > (ext2, ext4 & xfs) were centralized in filemap_write_and_wait_range(). > > > dax_writeback_mapping_range() needs a struct block_device, and it used to > > > get that from inode->i_sb->s_bdev. This is correct for normal inodes > > > mounted on ext2, ext4 and XFS filesystems, but is incorrect for DAX raw > > > block devices and for XFS real-time files. > > > > > > Instead, call dax_writeback_mapping_range() directly from the filesystem > > > ->writepages function so that it can supply us with a valid block > > > device. This also fixes DAX code to properly flush caches in response to > > > sync(2). > > > > > > Signed-off-by: Ross Zwisler > > > Signed-off-by: Jan Kara > > > --- > > > fs/block_dev.c | 16 +++++++++++++++- > > > fs/dax.c | 13 ++++++++----- > > > fs/ext2/inode.c | 11 +++++++++++ > > > fs/ext4/inode.c | 7 +++++++ > > > fs/xfs/xfs_aops.c | 9 +++++++++ > > > include/linux/dax.h | 6 ++++-- > > > mm/filemap.c | 12 ++++-------- > > > 7 files changed, 58 insertions(+), 16 deletions(-) > > > > > > diff --git a/fs/block_dev.c b/fs/block_dev.c > > > index 39b3a17..fc01e43 100644 > > > --- a/fs/block_dev.c > > > +++ b/fs/block_dev.c > > > @@ -1693,13 +1693,27 @@ static int blkdev_releasepage(struct page *page, gfp_t wait) > > > return try_to_free_buffers(page); > > > } > > > > > > +static int blkdev_writepages(struct address_space *mapping, > > > + struct writeback_control *wbc) > > > +{ > > > + if (dax_mapping(mapping)) { > > > + struct block_device *bdev = I_BDEV(mapping->host); > > > + int error; > > > + > > > + error = dax_writeback_mapping_range(mapping, bdev, wbc); > > > + if (error) > > > + return error; > > > + } > > > + return generic_writepages(mapping, wbc); > > > +} > > > > Can you remind of the reason for calling generic_writepages() on DAX > > enabled address spaces? > > Sure. The initial version of this patch didn't do this, and during testing I > hit a bunch of xfstests failures. In ext2 at least I believe these were > happening because we were skipping the call into generic_writepages() for DAX > inodes. Without a lot of data to back this up, my guess is that this is due > to metadata inodes or something being marked as DAX (so dax_mapping(mapping) > returns true), but having dirty page cache pages that need to be written back > as part of the writeback. > > Changing this so we always call generic_writepages() even in the DAX case > solved the xfstest failures. > > If this sounds incorrect, please let me know and I'll go and gather more data. So I think a more correct fix it to not set S_DAX for inodes that will have any pagecache pages - e.g. don't set S_DAX for block device inodes when filesystem is mounted on it (probably the easiest is to just refuse to mount filesystem on block device which has S_DAX set). Honza -- Jan Kara SUSE Labs, CR From bfoster@redhat.com Thu Feb 11 08:09:44 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=ham version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay3.corp.sgi.com [198.149.34.15]) by oss.sgi.com (Postfix) with ESMTP id A21077CA2 for ; Thu, 11 Feb 2016 08:09:44 -0600 (CST) Received: from cuda.sgi.com (cuda2.sgi.com [192.48.176.25]) by relay3.corp.sgi.com (Postfix) with ESMTP id 24D81AC007 for ; Thu, 11 Feb 2016 06:09:40 -0800 (PST) X-ASG-Debug-ID: 1455199779-04cbb043337baa0001-NocioJ Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by cuda.sgi.com with ESMTP id UUkN8HyvU0aK0oxG (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO) for ; Thu, 11 Feb 2016 06:09:39 -0800 (PST) X-Barracuda-Envelope-From: bfoster@redhat.com X-Barracuda-Apparent-Source-IP: 209.132.183.28 X-ASG-Whitelist: Client Received: from int-mx11.intmail.prod.int.phx2.redhat.com (int-mx11.intmail.prod.int.phx2.redhat.com [10.5.11.24]) by mx1.redhat.com (Postfix) with ESMTPS id 015E33C88D6; Thu, 11 Feb 2016 14:09:38 +0000 (UTC) Received: from bfoster.bfoster (dhcp-41-164.bos.redhat.com [10.18.41.164]) by int-mx11.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id u1BE9cLV008829; Thu, 11 Feb 2016 09:09:38 -0500 Received: by bfoster.bfoster (Postfix, from userid 1000) id AA93B123DF8; Thu, 11 Feb 2016 09:09:37 -0500 (EST) Date: Thu, 11 Feb 2016 09:09:37 -0500 From: Brian Foster To: Dave Chinner Cc: Christoph Hellwig , xfs@oss.sgi.com, "Darrick J. Wong" Subject: Re: block allocations for the refcount btree Message-ID: <20160211140936.GB4156@bfoster.bfoster> X-ASG-Orig-Subj: Re: block allocations for the refcount btree References: <20160210093011.GA19147@infradead.org> <20160210095010.GC23904@birch.djwong.org> <20160210190738.GA13051@infradead.org> <20160210214058.GN14668@dastard> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20160210214058.GN14668@dastard> User-Agent: Mutt/1.5.24 (2015-08-30) X-Scanned-By: MIMEDefang 2.68 on 10.5.11.24 X-Barracuda-Connect: mx1.redhat.com[209.132.183.28] X-Barracuda-Start-Time: 1455199779 X-Barracuda-Encrypted: ECDHE-RSA-AES256-GCM-SHA384 X-Barracuda-URL: https://192.48.176.25:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-BRTS-Status: 1 On Thu, Feb 11, 2016 at 08:40:58AM +1100, Dave Chinner wrote: > On Wed, Feb 10, 2016 at 11:07:38AM -0800, Christoph Hellwig wrote: > > On Wed, Feb 10, 2016 at 01:50:10AM -0800, Darrick J. Wong wrote: > > > That's odd... I'd have thought that the AG reservation would always be able > > > to handle a refcount btree expansion, since it calculates how many blocks > > > are needed to handle the worst case of 1 record per extent. There's also > > > a bug where we undercount the number of blocks already used, so it should > > > have an extra big reservation. > > > > > > OTOH I've seen occasional ENOSPCs in generic/186 and generic/168 too, so I > > > guess something's going wrong. Maybe the xfs_ag_resv* tracepoints can help? > > > > I'm not seeing an ENOSPC, I run into: > > > > [ 640.924891] XFS: Assertion failed: tp->t_blk_res_used <= tp->t_blk_res, file: fs/xfs/xfs_trans.c, line: 315 > > I run into that from time to time (maybe once a month) on a vanilla > kernel. > Any idea which test reproduces? I see that generic/033 resulted from the discussion below on the rfc. I don't currently reproduce with that test, however. The test mentions it uses fzero because zero range doesn't do writeback (comments ftw :) and thus allows splitting of delalloc extents, but it looks like that might no longer be the case in the kernel (since zero range was simplified to reuse punch/alloc). > IIRC, the problem is the delayed allocation extent split runs out of > it's reserved block count if you split it enough times. The case > I've seen is that the indlen calculated in xfs_bmap_worst_indlen() > ends up too small for a subsequent allocation after we've called > xfs_bmap_del_extent() to delete the middle of a delalloc extent too > many times. > > Brian had some patches that attempted to solve it - we may have > simply dropped the ball on this (again). > > http://oss.sgi.com/archives/xfs/2014-09/msg00337.html > I recall working on this, but not quite where it left off. If I dig back to my old tree from before the oss.sgi.com->vger switchover, I have a v1 branch for this work that was posted here: http://oss.sgi.com/archives/xfs/2014-10/msg00294.html It looks like we just never got it reviewed and I since lost track of it. I can resurrect it if warranted. I would like to nail down a current reproducer though... Brian > Cheers, > > Dave. > -- > Dave Chinner > david@fromorbit.com > > _______________________________________________ > xfs mailing list > xfs@oss.sgi.com > http://oss.sgi.com/mailman/listinfo/xfs From BATV+1d2dc591c5a2632e1edf+4554+infradead.org+hch@bombadil.srs.infradead.org Thu Feb 11 09:13:06 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=ham version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay1.corp.sgi.com [137.38.102.111]) by oss.sgi.com (Postfix) with ESMTP id B7CE67CA2 for ; Thu, 11 Feb 2016 09:13:06 -0600 (CST) Received: from cuda.sgi.com (cuda1.sgi.com [192.48.157.11]) by relay1.corp.sgi.com (Postfix) with ESMTP id 914C58F8033 for ; Thu, 11 Feb 2016 07:13:03 -0800 (PST) X-ASG-Debug-ID: 1455203581-04bdf066ed67f00001-NocioJ Received: from bombadil.infradead.org ([198.137.202.9]) by cuda.sgi.com with ESMTP id FtHTKnvAXTAT6yJv (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128 verify=NO) for ; Thu, 11 Feb 2016 07:13:01 -0800 (PST) X-Barracuda-Envelope-From: BATV+1d2dc591c5a2632e1edf+4554+infradead.org+hch@bombadil.srs.infradead.org X-Barracuda-Apparent-Source-IP: 198.137.202.9 Received: from hch by bombadil.infradead.org with local (Exim 4.80.1 #2 (Red Hat Linux)) id 1aTsvV-0004rM-Gl; Thu, 11 Feb 2016 15:13:01 +0000 Date: Thu, 11 Feb 2016 07:13:01 -0800 From: Christoph Hellwig To: Dave Chinner Cc: Christoph Hellwig , xfs@oss.sgi.com Subject: Re: [PATCH 0/8 v4] xfs: get rid of xfs_cluster_write Message-ID: <20160211151301.GA13515@infradead.org> X-ASG-Orig-Subj: Re: [PATCH 0/8 v4] xfs: get rid of xfs_cluster_write References: <1455094043-9694-1-git-send-email-david@fromorbit.com> <20160210182538.GA7481@infradead.org> <20160210212550.GM14668@dastard> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20160210212550.GM14668@dastard> User-Agent: Mutt/1.5.24 (2015-08-30) X-SRS-Rewrite: SMTP reverse-path rewritten from by bombadil.infradead.org See http://www.infradead.org/rpr.html X-Barracuda-Connect: UNKNOWN[198.137.202.9] X-Barracuda-Start-Time: 1455203581 X-Barracuda-Encrypted: ECDHE-RSA-AES128-GCM-SHA256 X-Barracuda-URL: https://192.48.157.11:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-BRTS-Status: 1 X-Barracuda-Spam-Score: 0.10 X-Barracuda-Spam-Status: No, SCORE=0.10 using per-user scores of TAG_LEVEL=1000.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.7 tests=BSF_SC0_MISMATCH_TO, RDNS_NONE X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.3.26946 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 0.00 BSF_SC0_MISMATCH_TO Envelope rcpt doesn't match header 0.10 RDNS_NONE Delivered to trusted network by a host with no rDNS On Thu, Feb 11, 2016 at 08:25:51AM +1100, Dave Chinner wrote: > I really like the idea, especially how using a bioset encapsulates > the ioend and binds the life cycle to the bio. It also removes a > heap of code, too. > > We really do need some form of chaining here, though. If we don't, > then we'll be doing unwritten extent of set file size transactions > for ever 1MB bio completion instead of once for however large > writepages can build an ioend. > > I think this is definitely worth pursuing - are you going to get any > time to work on this in the next couple of months, Christoph (i.e. > to target the 4.7 merge window)? Yes, I've just started working on this and would love to get it off my table ASAP. I was doing this ontop of your initial writeback changes, so let me know if I should go back to that version, or you think the last two patches will be ready in time as well? From BATV+1d2dc591c5a2632e1edf+4554+infradead.org+hch@bombadil.srs.infradead.org Thu Feb 11 09:14:33 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=ham version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay2.corp.sgi.com [137.38.102.29]) by oss.sgi.com (Postfix) with ESMTP id EFC017CA2 for ; Thu, 11 Feb 2016 09:14:33 -0600 (CST) Received: from cuda.sgi.com (cuda2.sgi.com [192.48.176.25]) by relay2.corp.sgi.com (Postfix) with ESMTP id E27AA304039 for ; Thu, 11 Feb 2016 07:14:30 -0800 (PST) X-ASG-Debug-ID: 1455203665-04cbb043317dbc0001-NocioJ Received: from bombadil.infradead.org ([198.137.202.9]) by cuda.sgi.com with ESMTP id rXnC56a6RyC3jESq (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128 verify=NO) for ; Thu, 11 Feb 2016 07:14:26 -0800 (PST) X-Barracuda-Envelope-From: BATV+1d2dc591c5a2632e1edf+4554+infradead.org+hch@bombadil.srs.infradead.org X-Barracuda-Apparent-Source-IP: 198.137.202.9 Received: from hch by bombadil.infradead.org with local (Exim 4.80.1 #2 (Red Hat Linux)) id 1aTswr-0005uj-Mz; Thu, 11 Feb 2016 15:14:25 +0000 Date: Thu, 11 Feb 2016 07:14:25 -0800 From: Christoph Hellwig To: Dave Chinner Cc: Christoph Hellwig , xfs@oss.sgi.com Subject: Re: [PATCH 2/8] xfs: remove xfs_cancel_ioend Message-ID: <20160211151425.GB13515@infradead.org> X-ASG-Orig-Subj: Re: [PATCH 2/8] xfs: remove xfs_cancel_ioend References: <1455094043-9694-1-git-send-email-david@fromorbit.com> <1455094043-9694-3-git-send-email-david@fromorbit.com> <20160210112800.GA15221@infradead.org> <20160211002137.GR14668@dastard> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20160211002137.GR14668@dastard> User-Agent: Mutt/1.5.24 (2015-08-30) X-SRS-Rewrite: SMTP reverse-path rewritten from by bombadil.infradead.org See http://www.infradead.org/rpr.html X-Barracuda-Connect: UNKNOWN[198.137.202.9] X-Barracuda-Start-Time: 1455203666 X-Barracuda-Encrypted: ECDHE-RSA-AES128-GCM-SHA256 X-Barracuda-URL: https://192.48.176.25:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-BRTS-Status: 1 X-Barracuda-Spam-Score: 0.10 X-Barracuda-Spam-Status: No, SCORE=0.10 using per-user scores of TAG_LEVEL=1000.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.7 tests=BSF_SC0_MISMATCH_TO, RDNS_NONE X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.3.26946 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 0.00 BSF_SC0_MISMATCH_TO Envelope rcpt doesn't match header 0.10 RDNS_NONE Delivered to trusted network by a host with no rDNS On Thu, Feb 11, 2016 at 11:21:37AM +1100, Dave Chinner wrote: > I'll propagate it through where it makes sense. If we alrady have an > error, then we aren't going to call xfs_setfilesize_trans_alloc() > anyway, so checking the return value only matters in the non-error > cases. Oh, I missed that we don't care about the failure case. Maybe we should just call xfs_setfilesize_trans_alloc instead, and just move the conditionals to it so that it's a no-op if no transaction is needed? From dan.j.williams@intel.com Thu Feb 11 09:22:04 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=T_DKIM_INVALID autolearn=ham version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay1.corp.sgi.com [137.38.102.111]) by oss.sgi.com (Postfix) with ESMTP id 3FBFD7CA2 for ; Thu, 11 Feb 2016 09:22:04 -0600 (CST) Received: from cuda.sgi.com (cuda2.sgi.com [192.48.176.25]) by relay1.corp.sgi.com (Postfix) with ESMTP id 167288F8033 for ; Thu, 11 Feb 2016 07:22:04 -0800 (PST) X-ASG-Debug-ID: 1455204121-04cbb043317df10001-NocioJ Received: from mail-yk0-f180.google.com (mail-yk0-f180.google.com [209.85.160.180]) by cuda.sgi.com with ESMTP id 419PoBdZFQI9JSxB (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128 verify=NO) for ; Thu, 11 Feb 2016 07:22:01 -0800 (PST) X-Barracuda-Envelope-From: dan.j.williams@intel.com X-Barracuda-Apparent-Source-IP: 209.85.160.180 Received: by mail-yk0-f180.google.com with SMTP id z13so21939551ykd.0 for ; Thu, 11 Feb 2016 07:22:01 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=intel-com.20150623.gappssmtp.com; s=20150623; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=3HqV8crj7C4ySqIMciPLhRt4RGLT0H/BmpbPlcXPy0Y=; b=fR9MmotFHKQZ6qcvgBuYE85YjLKD8IcRb4dg/y03KIKWqnvxF1GK52pVdKhpKXCFMV xxz9INq+hdxf4hbANLOSHgw9bLUZR1p4IdBYwtHRWEjjqE8fllgbi0YZeaqh2IRVzHut PUWZkXAzG/m59dHdwTM0dbVBLDQg/+FTVrN1N4Q046YdXpwgJ0+lyH3gzC/B0A2kwUaz x9poPalPX+L+B1MpCXWc/Md1OCkiOmmJZJTziwhtM7A2WVU5gqsv4Q9BW4Kyy+x6HXdX qSoBxSyk0aL2Yh6lYhFWox0BwFN2vNURArtr05yiZNHvoKxv+1YhNgPhoI5p5eCVJxsH gTeA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:date :message-id:subject:from:to:cc:content-type; bh=3HqV8crj7C4ySqIMciPLhRt4RGLT0H/BmpbPlcXPy0Y=; b=fi8WcC7tt49ZttckDRbUrDfl2x2CPN9lctilH2JkDEFIoAss/05iGsOuI3pB45LB8O KbrRdEtD01P4FHJ+XVdgG88wPYPZRT4CQVNDQts0ocGl7ygAVEFc7AFNfzCnoPmUSHIA 3l9maZfz9uumky/zLKkY1hNOuI8lfwIvsZd7LvI1lbNG8/bPRmAbn40x2mUxBZR/x0Yn 2JrFaKEGQOrnGt6VNBJcMkX2e7Ndovcl5A7HROqRxLRWQ/TCLUOVowfFTiMaqk9ndaCm PQypb6OALlDclhWQYYFCsAWoMjzG5V69I/wL5Sf4bPRiZJYWGegAsM66o0cq/GydVck8 JjWw== X-Gm-Message-State: AG10YOSOKI8tU5MapBnNcAv2oi+tC3xSoeYAg1Wo9j5Jq0vP+spWFIkVmLH4i0E+Ko2fO7AlyMPCa/MT9Wku4cfs MIME-Version: 1.0 X-Received: by 10.37.94.198 with SMTP id s189mr25353763ybb.62.1455204120884; Thu, 11 Feb 2016 07:22:00 -0800 (PST) Received: by 10.37.223.199 with HTTP; Thu, 11 Feb 2016 07:22:00 -0800 (PST) In-Reply-To: <20160211125044.GJ21760@quack.suse.cz> References: <1455137336-28720-1-git-send-email-ross.zwisler@linux.intel.com> <1455137336-28720-3-git-send-email-ross.zwisler@linux.intel.com> <20160210220312.GP14668@dastard> <20160210224340.GA30938@linux.intel.com> <20160211125044.GJ21760@quack.suse.cz> Date: Thu, 11 Feb 2016 07:22:00 -0800 Message-ID: Subject: Re: [PATCH v2 2/2] dax: move writeback calls into the filesystems From: Dan Williams X-ASG-Orig-Subj: Re: [PATCH v2 2/2] dax: move writeback calls into the filesystems To: Jan Kara Cc: Ross Zwisler , Dave Chinner , "linux-kernel@vger.kernel.org" , "Theodore Ts'o" , Alexander Viro , Andreas Dilger , Andrew Morton , Jan Kara , Matthew Wilcox , linux-ext4 , linux-fsdevel , Linux MM , "linux-nvdimm@lists.01.org" , XFS Developers Content-Type: text/plain; charset=UTF-8 X-Barracuda-Connect: mail-yk0-f180.google.com[209.85.160.180] X-Barracuda-Start-Time: 1455204121 X-Barracuda-Encrypted: ECDHE-RSA-AES128-GCM-SHA256 X-Barracuda-URL: https://192.48.176.25:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-BRTS-Status: 1 X-Barracuda-Spam-Score: 0.00 X-Barracuda-Spam-Status: No, SCORE=0.00 using per-user scores of TAG_LEVEL=1000.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.7 tests=BSF_SC0_MISMATCH_TO, DKIM_SIGNED, DKIM_VERIFIED X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.3.26946 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 0.00 BSF_SC0_MISMATCH_TO Envelope rcpt doesn't match header -0.00 DKIM_VERIFIED Domain Keys Identified Mail: signature passes verification 0.00 DKIM_SIGNED Domain Keys Identified Mail: message has a signature On Thu, Feb 11, 2016 at 4:50 AM, Jan Kara wrote: > On Wed 10-02-16 15:43:40, Ross Zwisler wrote: >> On Thu, Feb 11, 2016 at 09:03:12AM +1100, Dave Chinner wrote: >> > On Wed, Feb 10, 2016 at 01:48:56PM -0700, Ross Zwisler wrote: >> > > Previously calls to dax_writeback_mapping_range() for all DAX filesystems >> > > (ext2, ext4 & xfs) were centralized in filemap_write_and_wait_range(). >> > > dax_writeback_mapping_range() needs a struct block_device, and it used to >> > > get that from inode->i_sb->s_bdev. This is correct for normal inodes >> > > mounted on ext2, ext4 and XFS filesystems, but is incorrect for DAX raw >> > > block devices and for XFS real-time files. >> > > >> > > Instead, call dax_writeback_mapping_range() directly from the filesystem >> > > ->writepages function so that it can supply us with a valid block >> > > device. This also fixes DAX code to properly flush caches in response to >> > > sync(2). >> > > >> > > Signed-off-by: Ross Zwisler >> > > Signed-off-by: Jan Kara >> > > --- >> > > fs/block_dev.c | 16 +++++++++++++++- >> > > fs/dax.c | 13 ++++++++----- >> > > fs/ext2/inode.c | 11 +++++++++++ >> > > fs/ext4/inode.c | 7 +++++++ >> > > fs/xfs/xfs_aops.c | 9 +++++++++ >> > > include/linux/dax.h | 6 ++++-- >> > > mm/filemap.c | 12 ++++-------- >> > > 7 files changed, 58 insertions(+), 16 deletions(-) >> > > >> > > diff --git a/fs/block_dev.c b/fs/block_dev.c >> > > index 39b3a17..fc01e43 100644 >> > > --- a/fs/block_dev.c >> > > +++ b/fs/block_dev.c >> > > @@ -1693,13 +1693,27 @@ static int blkdev_releasepage(struct page *page, gfp_t wait) >> > > return try_to_free_buffers(page); >> > > } >> > > >> > > +static int blkdev_writepages(struct address_space *mapping, >> > > + struct writeback_control *wbc) >> > > +{ >> > > + if (dax_mapping(mapping)) { >> > > + struct block_device *bdev = I_BDEV(mapping->host); >> > > + int error; >> > > + >> > > + error = dax_writeback_mapping_range(mapping, bdev, wbc); >> > > + if (error) >> > > + return error; >> > > + } >> > > + return generic_writepages(mapping, wbc); >> > > +} >> > >> > Can you remind of the reason for calling generic_writepages() on DAX >> > enabled address spaces? >> >> Sure. The initial version of this patch didn't do this, and during testing I >> hit a bunch of xfstests failures. In ext2 at least I believe these were >> happening because we were skipping the call into generic_writepages() for DAX >> inodes. Without a lot of data to back this up, my guess is that this is due >> to metadata inodes or something being marked as DAX (so dax_mapping(mapping) >> returns true), but having dirty page cache pages that need to be written back >> as part of the writeback. >> >> Changing this so we always call generic_writepages() even in the DAX case >> solved the xfstest failures. >> >> If this sounds incorrect, please let me know and I'll go and gather more data. > > So I think a more correct fix it to not set S_DAX for inodes that will have > any pagecache pages - e.g. don't set S_DAX for block device inodes when > filesystem is mounted on it (probably the easiest is to just refuse to > mount filesystem on block device which has S_DAX set). I think we have a wider problem here. See __blkdev_get, we set S_DAX on all block devices that have ->direct_access() and have a page-aligned starting address. It seems to me we need to modify the metadata i/o paths to bypass the page cache, or teach the fsync code how to flush populated data pages out of the radix. From jack@suse.cz Thu Feb 11 10:22:19 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=ham version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay3.corp.sgi.com [198.149.34.15]) by oss.sgi.com (Postfix) with ESMTP id CDDC57CA2 for ; Thu, 11 Feb 2016 10:22:18 -0600 (CST) Received: from cuda.sgi.com (cuda2.sgi.com [192.48.176.25]) by relay3.corp.sgi.com (Postfix) with ESMTP id 51B40AC003 for ; Thu, 11 Feb 2016 08:22:15 -0800 (PST) X-ASG-Debug-ID: 1455207731-04cbb043317f420001-NocioJ Received: from mx2.suse.de (mx2.suse.de [195.135.220.15]) by cuda.sgi.com with ESMTP id OPBlvCK6DVGHariU (version=TLSv1 cipher=ECDHE-RSA-AES256-SHA bits=256 verify=NO) for ; Thu, 11 Feb 2016 08:22:12 -0800 (PST) X-Barracuda-Envelope-From: jack@suse.cz X-Barracuda-Apparent-Source-IP: 195.135.220.15 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay1.suse.de (charybdis-ext.suse.de [195.135.220.254]) by mx2.suse.de (Postfix) with ESMTP id 27E64AC0D; Thu, 11 Feb 2016 16:22:10 +0000 (UTC) Received: by quack.suse.cz (Postfix, from userid 1000) id B0B95823D6; Thu, 11 Feb 2016 17:22:26 +0100 (CET) Date: Thu, 11 Feb 2016 17:22:26 +0100 From: Jan Kara To: Dan Williams Cc: Jan Kara , Ross Zwisler , Dave Chinner , "linux-kernel@vger.kernel.org" , Theodore Ts'o , Alexander Viro , Andreas Dilger , Andrew Morton , Jan Kara , Matthew Wilcox , linux-ext4 , linux-fsdevel , Linux MM , "linux-nvdimm@lists.01.org" , XFS Developers Subject: Re: [PATCH v2 2/2] dax: move writeback calls into the filesystems Message-ID: <20160211162226.GR21760@quack.suse.cz> X-ASG-Orig-Subj: Re: [PATCH v2 2/2] dax: move writeback calls into the filesystems References: <1455137336-28720-1-git-send-email-ross.zwisler@linux.intel.com> <1455137336-28720-3-git-send-email-ross.zwisler@linux.intel.com> <20160210220312.GP14668@dastard> <20160210224340.GA30938@linux.intel.com> <20160211125044.GJ21760@quack.suse.cz> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.24 (2015-08-30) X-Barracuda-Connect: mx2.suse.de[195.135.220.15] X-Barracuda-Start-Time: 1455207732 X-Barracuda-Encrypted: ECDHE-RSA-AES256-SHA X-Barracuda-URL: https://192.48.176.25:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-BRTS-Status: 1 X-Barracuda-Spam-Score: 0.00 X-Barracuda-Spam-Status: No, SCORE=0.00 using per-user scores of TAG_LEVEL=1000.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.7 tests=BSF_SC0_MISMATCH_TO X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.3.26947 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 0.00 BSF_SC0_MISMATCH_TO Envelope rcpt doesn't match header On Thu 11-02-16 07:22:00, Dan Williams wrote: > On Thu, Feb 11, 2016 at 4:50 AM, Jan Kara wrote: > > On Wed 10-02-16 15:43:40, Ross Zwisler wrote: > >> On Thu, Feb 11, 2016 at 09:03:12AM +1100, Dave Chinner wrote: > >> > On Wed, Feb 10, 2016 at 01:48:56PM -0700, Ross Zwisler wrote: > >> > > Previously calls to dax_writeback_mapping_range() for all DAX filesystems > >> > > (ext2, ext4 & xfs) were centralized in filemap_write_and_wait_range(). > >> > > dax_writeback_mapping_range() needs a struct block_device, and it used to > >> > > get that from inode->i_sb->s_bdev. This is correct for normal inodes > >> > > mounted on ext2, ext4 and XFS filesystems, but is incorrect for DAX raw > >> > > block devices and for XFS real-time files. > >> > > > >> > > Instead, call dax_writeback_mapping_range() directly from the filesystem > >> > > ->writepages function so that it can supply us with a valid block > >> > > device. This also fixes DAX code to properly flush caches in response to > >> > > sync(2). > >> > > > >> > > Signed-off-by: Ross Zwisler > >> > > Signed-off-by: Jan Kara > >> > > --- > >> > > fs/block_dev.c | 16 +++++++++++++++- > >> > > fs/dax.c | 13 ++++++++----- > >> > > fs/ext2/inode.c | 11 +++++++++++ > >> > > fs/ext4/inode.c | 7 +++++++ > >> > > fs/xfs/xfs_aops.c | 9 +++++++++ > >> > > include/linux/dax.h | 6 ++++-- > >> > > mm/filemap.c | 12 ++++-------- > >> > > 7 files changed, 58 insertions(+), 16 deletions(-) > >> > > > >> > > diff --git a/fs/block_dev.c b/fs/block_dev.c > >> > > index 39b3a17..fc01e43 100644 > >> > > --- a/fs/block_dev.c > >> > > +++ b/fs/block_dev.c > >> > > @@ -1693,13 +1693,27 @@ static int blkdev_releasepage(struct page *page, gfp_t wait) > >> > > return try_to_free_buffers(page); > >> > > } > >> > > > >> > > +static int blkdev_writepages(struct address_space *mapping, > >> > > + struct writeback_control *wbc) > >> > > +{ > >> > > + if (dax_mapping(mapping)) { > >> > > + struct block_device *bdev = I_BDEV(mapping->host); > >> > > + int error; > >> > > + > >> > > + error = dax_writeback_mapping_range(mapping, bdev, wbc); > >> > > + if (error) > >> > > + return error; > >> > > + } > >> > > + return generic_writepages(mapping, wbc); > >> > > +} > >> > > >> > Can you remind of the reason for calling generic_writepages() on DAX > >> > enabled address spaces? > >> > >> Sure. The initial version of this patch didn't do this, and during testing I > >> hit a bunch of xfstests failures. In ext2 at least I believe these were > >> happening because we were skipping the call into generic_writepages() for DAX > >> inodes. Without a lot of data to back this up, my guess is that this is due > >> to metadata inodes or something being marked as DAX (so dax_mapping(mapping) > >> returns true), but having dirty page cache pages that need to be written back > >> as part of the writeback. > >> > >> Changing this so we always call generic_writepages() even in the DAX case > >> solved the xfstest failures. > >> > >> If this sounds incorrect, please let me know and I'll go and gather more data. > > > > So I think a more correct fix it to not set S_DAX for inodes that will have > > any pagecache pages - e.g. don't set S_DAX for block device inodes when > > filesystem is mounted on it (probably the easiest is to just refuse to > > mount filesystem on block device which has S_DAX set). > > I think we have a wider problem here. See __blkdev_get, we set S_DAX > on all block devices that have ->direct_access() and have a > page-aligned starting address. It seems to me we need to modify the > metadata i/o paths to bypass the page cache Heh, no way to do that easily. All the journalling machinery depends on buffers and pages... >, or teach the fsync code > how to flush populated data pages out of the radix. This might be doable but it will be difficult to avoid aliasing issues and data corruption. And mainly I don't see the point: When you mount a filesystem on top of block device, you do not want to mess with the block device directly, even less using DAX. So we just have to find a way how to set S_DAX for normal open but clear it from fs path. At worst, we could clear S_DAX on the block device in mount_bdev() or something like that... Honza -- Jan Kara SUSE Labs, CR From ross.zwisler@linux.intel.com Thu Feb 11 13:49:42 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=ham version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay2.corp.sgi.com [137.38.102.29]) by oss.sgi.com (Postfix) with ESMTP id C02BB7CA2 for ; Thu, 11 Feb 2016 13:49:42 -0600 (CST) Received: from cuda.sgi.com (cuda1.sgi.com [192.48.157.11]) by relay2.corp.sgi.com (Postfix) with ESMTP id 981D0304059 for ; Thu, 11 Feb 2016 11:49:39 -0800 (PST) X-ASG-Debug-ID: 1455220178-04bdf066eb6e9f0001-NocioJ Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) by cuda.sgi.com with ESMTP id ojBYR5DLPvUPkNcq for ; Thu, 11 Feb 2016 11:49:38 -0800 (PST) X-Barracuda-Envelope-From: ross.zwisler@linux.intel.com X-Barracuda-Apparent-Source-IP: 134.134.136.20 X-ASG-Whitelist: Client Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by orsmga101.jf.intel.com with ESMTP; 11 Feb 2016 11:49:34 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.22,432,1449561600"; d="scan'208";a="650842291" Received: from rzwisler-desk.amr.corp.intel.com (HELO linux.intel.com) ([10.252.193.228]) by FMSMGA003.fm.intel.com with ESMTP; 11 Feb 2016 11:49:32 -0800 Date: Thu, 11 Feb 2016 12:49:22 -0700 From: Ross Zwisler To: Jan Kara Cc: Ross Zwisler , linux-kernel@vger.kernel.org, Theodore Ts'o , Alexander Viro , Andreas Dilger , Andrew Morton , Dan Williams , Dave Chinner , Jan Kara , Matthew Wilcox , linux-ext4@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux-mm@kvack.org, linux-nvdimm@lists.01.org, xfs@oss.sgi.com Subject: Re: [PATCH v2 0/2] DAX bdev fixes - move flushing calls to FS Message-ID: <20160211194922.GA5260@linux.intel.com> X-ASG-Orig-Subj: Re: [PATCH v2 0/2] DAX bdev fixes - move flushing calls to FS Mail-Followup-To: Ross Zwisler , Jan Kara , linux-kernel@vger.kernel.org, Theodore Ts'o , Alexander Viro , Andreas Dilger , Andrew Morton , Dan Williams , Dave Chinner , Jan Kara , Matthew Wilcox , linux-ext4@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux-mm@kvack.org, linux-nvdimm@lists.01.org, xfs@oss.sgi.com References: <1455137336-28720-1-git-send-email-ross.zwisler@linux.intel.com> <20160211124304.GI21760@quack.suse.cz> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20160211124304.GI21760@quack.suse.cz> User-Agent: Mutt/1.5.24 (2015-08-30) X-Barracuda-Connect: mga02.intel.com[134.134.136.20] X-Barracuda-Start-Time: 1455220178 X-Barracuda-URL: https://192.48.157.11:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-BRTS-Status: 1 On Thu, Feb 11, 2016 at 01:43:04PM +0100, Jan Kara wrote: > On Wed 10-02-16 13:48:54, Ross Zwisler wrote: > > During testing of raw block devices + DAX I noticed that the struct > > block_device that we were using for DAX operations was incorrect. For the > > fault handlers, etc. we can just get the correct bdev via get_block(), > > which is passed in as a function pointer, but for the *sync code and for > > sector zeroing we don't have access to get_block(). This is also an issue > > for XFS real-time devices, whenever we get those working. > > > > Patch one of this series fixes the DAX sector zeroing code by explicitly > > passing in a valid struct block_device. > > > > Patch two of this series fixes DAX *sync support by moving calls to > > dax_writeback_mapping_range() out of filemap_write_and_wait_range() and > > into the filesystem/block device ->writepages function so that it can > > supply us with a valid block device. This also fixes DAX code to properly > > flush caches in response to sync(2). > > > > Thanks to Jan Kara for his initial draft of patch 2: > > https://lkml.org/lkml/2016/2/9/485 > > > > Here are the changes that I've made to that patch: > > > > 1) For DAX mappings, only return after calling > > dax_writeback_mapping_range() if we encountered an error. In the non-error > > case we still need to write back normal pages, else we lose metadata > > updates. > > > > 2) In dax_writeback_mapping_range(), move the new check for > > if (!mapping->nrexceptional || wbc->sync_mode != WB_SYNC_ALL) > > above the i_blkbits check. In my testing I found cases where > > dax_writeback_mapping_range() was called for inodes with i_blkbits != > > PAGE_SHIFT - I'm assuming these are internal metadata inodes? They have no > > exceptional DAX entries to flush, so we have no work to do, but if we > > return error from the i_blkbits check we will fail the overall writeback > > operation. Please let me know if it seems wrong for us to be seeing inodes > > set to use DAX but with i_blkbits != PAGE_SHIFT and I'll get more info. > > So I'm wondering - how come S_DAX flag got set for inode where i_blkbis != > PAGE_SHIFT? That would seem to be a bug? I specifically ordered the checks > like this to catch such issues. I've isolated this one - this happens for all three filesystems (ext2, ext4 & XFS), and does indeed have to do with the fact that S_DAX is set for bdev->bd_inode. Here is one failure path: [ 102.866637] [] dump_stack+0x85/0xc2 [ 102.867101] [] dax_writeback_mapping_range+0x60/0xe0 [ 102.867738] [] blkdev_writepages+0x3f/0x50 [ 102.868272] [] do_writepages+0x21/0x30 [ 102.868784] [] __filemap_fdatawrite_range+0xc6/0x100 [ 102.869378] [] filemap_write_and_wait+0x4a/0xa0 [ 102.869933] [] set_blocksize+0x70/0xd0 [ 102.870424] [] sb_set_blocksize+0x1d/0x50 [ 102.870933] [] ext4_fill_super+0x75b/0x3360 [ 102.871487] [] ? vsnprintf+0x201/0x4c0 [ 102.872005] [] ? snprintf+0x49/0x60 [ 102.872499] [] mount_bdev+0x180/0x1b0 [ 102.872981] [] ? ext4_calculate_overhead+0x370/0x370 [ 102.873580] [] ext4_mount+0x15/0x20 [ 102.874042] [] mount_fs+0x38/0x170 [ 102.874524] [] vfs_kern_mount+0x6b/0x150 [ 102.875041] [] do_mount+0x24f/0xe90 [ 102.875508] [] ? mntput+0x24/0x40 [ 102.875958] [] ? __kmalloc_track_caller+0xea/0x240 [ 102.876542] [] ? copy_mount_options+0x2c/0x210 [ 102.877087] [] SyS_mount+0x95/0xe0 [ 102.877573] [] entry_SYSCALL_64_fastpath+0x12/0x76 In set_blocksize() we are actually updating bdev->bd_inode->i_blkbits to be 12, but before that happens we do a sync_blockdev() with i_blkbits at 10, which causes the failure. This can be reproduced easily just by mounting an ext2 or ext4 filesystem. I think the plan of unsetting S_DAX on bdev->bd_inode when we mount will save us from this, as long as we do it super early in the mount process. From david@fromorbit.com Thu Feb 11 14:14:58 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=ham version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay2.corp.sgi.com [137.38.102.29]) by oss.sgi.com (Postfix) with ESMTP id 69C827CA2 for ; Thu, 11 Feb 2016 14:14:58 -0600 (CST) Received: from cuda.sgi.com (cuda3.sgi.com [192.48.176.15]) by relay2.corp.sgi.com (Postfix) with ESMTP id 3BC1F30405F for ; Thu, 11 Feb 2016 12:14:58 -0800 (PST) X-ASG-Debug-ID: 1455221694-04cb6c1e5766690001-NocioJ Received: from ipmail06.adl2.internode.on.net (ipmail06.adl2.internode.on.net [150.101.137.129]) by cuda.sgi.com with ESMTP id 6sxEjHNgvnIhZjiB for ; Thu, 11 Feb 2016 12:14:55 -0800 (PST) X-Barracuda-Envelope-From: david@fromorbit.com X-Barracuda-Apparent-Source-IP: 150.101.137.129 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: A2BTDgBS6rxWPBATLHleKAECgw+BP4ZigXmdYAEBBotrhUWECIYHBAICgTRNAQEBAQEBBwEBAQFBP0ESAYNuAQEEOhwjEAgDDgoJJQ8FJQMHGhMZiADBOgEBCAIeGIUyhH6IbAWWd41Kjn5EjXqCZBmBXiguhweBTAEBAQ Received: from ppp121-44-19-16.lns20.syd4.internode.on.net (HELO dastard) ([121.44.19.16]) by ipmail06.adl2.internode.on.net with ESMTP; 12 Feb 2016 06:42:39 +1030 Received: from dave by dastard with local (Exim 4.80) (envelope-from ) id 1aTxbS-00016R-Mj; Fri, 12 Feb 2016 07:12:38 +1100 Date: Fri, 12 Feb 2016 07:12:38 +1100 From: Dave Chinner To: Christoph Hellwig Cc: xfs@oss.sgi.com Subject: Re: [PATCH 0/8 v4] xfs: get rid of xfs_cluster_write Message-ID: <20160211201238.GG19486@dastard> X-ASG-Orig-Subj: Re: [PATCH 0/8 v4] xfs: get rid of xfs_cluster_write References: <1455094043-9694-1-git-send-email-david@fromorbit.com> <20160210182538.GA7481@infradead.org> <20160210212550.GM14668@dastard> <20160211151301.GA13515@infradead.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20160211151301.GA13515@infradead.org> User-Agent: Mutt/1.5.21 (2010-09-15) X-Barracuda-Connect: ipmail06.adl2.internode.on.net[150.101.137.129] X-Barracuda-Start-Time: 1455221694 X-Barracuda-URL: https://192.48.176.15:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-BRTS-Status: 1 X-Barracuda-Spam-Score: 0.00 X-Barracuda-Spam-Status: No, SCORE=0.00 using per-user scores of TAG_LEVEL=1000.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.7 tests=BSF_SC0_MISMATCH_TO X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.3.26953 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 0.00 BSF_SC0_MISMATCH_TO Envelope rcpt doesn't match header On Thu, Feb 11, 2016 at 07:13:01AM -0800, Christoph Hellwig wrote: > On Thu, Feb 11, 2016 at 08:25:51AM +1100, Dave Chinner wrote: > > I really like the idea, especially how using a bioset encapsulates > > the ioend and binds the life cycle to the bio. It also removes a > > heap of code, too. > > > > We really do need some form of chaining here, though. If we don't, > > then we'll be doing unwritten extent of set file size transactions > > for ever 1MB bio completion instead of once for however large > > writepages can build an ioend. > > > > I think this is definitely worth pursuing - are you going to get any > > time to work on this in the next couple of months, Christoph (i.e. > > to target the 4.7 merge window)? > > Yes, I've just started working on this and would love to get it off > my table ASAP. I was doing this ontop of your initial writeback > changes, so let me know if I should go back to that version, or > you think the last two patches will be ready in time as well? Keep my extra two patches in your series. I'm going to try to spend the rest of this cycle (for the 4.6 merge window) on Darrick's reflink patchset, but I can carry whatever patches you finish off until the appropriate time to merge them is. Cheers, Dave. -- Dave Chinner david@fromorbit.com From david@fromorbit.com Thu Feb 11 14:24:45 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=ham version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay3.corp.sgi.com [198.149.34.15]) by oss.sgi.com (Postfix) with ESMTP id A21827CA2 for ; Thu, 11 Feb 2016 14:24:45 -0600 (CST) Received: from cuda.sgi.com (cuda1.sgi.com [192.48.157.11]) by relay3.corp.sgi.com (Postfix) with ESMTP id 3D70AAC002 for ; Thu, 11 Feb 2016 12:24:42 -0800 (PST) X-ASG-Debug-ID: 1455222278-04bdf066ec6f4d0001-NocioJ Received: from ipmail06.adl2.internode.on.net (ipmail06.adl2.internode.on.net [150.101.137.129]) by cuda.sgi.com with ESMTP id KaiCe3ypI68uOCcA for ; Thu, 11 Feb 2016 12:24:39 -0800 (PST) X-Barracuda-Envelope-From: david@fromorbit.com X-Barracuda-Apparent-Source-IP: 150.101.137.129 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: A2DkCADL7LxWPBATLHleKAECgw9SbYhbnVAQAQEGi2uJTSGFZgQCAoE0TQEBAQEBAQcBAQEBQT+EQQEBAQMBJxMcIxAIAw4KCSUPBSUDBxoTiBIHD8EsAQEIAh4YhTKEfoJUhhgFh1CHBoghhU6HfI5+jj6EWyguAYhSAQEB Received: from ppp121-44-19-16.lns20.syd4.internode.on.net (HELO dastard) ([121.44.19.16]) by ipmail06.adl2.internode.on.net with ESMTP; 12 Feb 2016 06:51:48 +1030 Received: from dave by dastard with local (Exim 4.80) (envelope-from ) id 1aTxkK-00017F-5v; Fri, 12 Feb 2016 07:21:48 +1100 Date: Fri, 12 Feb 2016 07:21:48 +1100 From: Dave Chinner To: Brian Foster Cc: Christoph Hellwig , xfs@oss.sgi.com, "Darrick J. Wong" Subject: Re: block allocations for the refcount btree Message-ID: <20160211202148.GH19486@dastard> X-ASG-Orig-Subj: Re: block allocations for the refcount btree References: <20160210093011.GA19147@infradead.org> <20160210095010.GC23904@birch.djwong.org> <20160210190738.GA13051@infradead.org> <20160210214058.GN14668@dastard> <20160211140936.GB4156@bfoster.bfoster> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20160211140936.GB4156@bfoster.bfoster> User-Agent: Mutt/1.5.21 (2010-09-15) X-Barracuda-Connect: ipmail06.adl2.internode.on.net[150.101.137.129] X-Barracuda-Start-Time: 1455222278 X-Barracuda-URL: https://192.48.157.11:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-BRTS-Status: 1 X-Barracuda-Spam-Score: 0.00 X-Barracuda-Spam-Status: No, SCORE=0.00 using per-user scores of TAG_LEVEL=1000.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.7 tests=BSF_SC0_MISMATCH_TO X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.3.26954 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 0.00 BSF_SC0_MISMATCH_TO Envelope rcpt doesn't match header On Thu, Feb 11, 2016 at 09:09:37AM -0500, Brian Foster wrote: > On Thu, Feb 11, 2016 at 08:40:58AM +1100, Dave Chinner wrote: > > On Wed, Feb 10, 2016 at 11:07:38AM -0800, Christoph Hellwig wrote: > > > On Wed, Feb 10, 2016 at 01:50:10AM -0800, Darrick J. Wong wrote: > > > > That's odd... I'd have thought that the AG reservation would always be able > > > > to handle a refcount btree expansion, since it calculates how many blocks > > > > are needed to handle the worst case of 1 record per extent. There's also > > > > a bug where we undercount the number of blocks already used, so it should > > > > have an extra big reservation. > > > > > > > > OTOH I've seen occasional ENOSPCs in generic/186 and generic/168 too, so I > > > > guess something's going wrong. Maybe the xfs_ag_resv* tracepoints can help? > > > > > > I'm not seeing an ENOSPC, I run into: > > > > > > [ 640.924891] XFS: Assertion failed: tp->t_blk_res_used <= tp->t_blk_res, file: fs/xfs/xfs_trans.c, line: 315 > > > > I run into that from time to time (maybe once a month) on a vanilla > > kernel. > > > > Any idea which test reproduces? I see that generic/033 resulted from the > discussion below on the rfc. I don't currently reproduce with that test, > however. The test mentions it uses fzero because zero range doesn't do > writeback (comments ftw :) and thus allows splitting of delalloc > extents, but it looks like that might no longer be the case in the > kernel (since zero range was simplified to reuse punch/alloc). It's usually one of the fsstress tests that triggers it. For some reason generic/233 sticks in my mind, but it's a pretty rare failure these days... > > IIRC, the problem is the delayed allocation extent split runs out of > > it's reserved block count if you split it enough times. The case > > I've seen is that the indlen calculated in xfs_bmap_worst_indlen() > > ends up too small for a subsequent allocation after we've called > > xfs_bmap_del_extent() to delete the middle of a delalloc extent too > > many times. > > > > Brian had some patches that attempted to solve it - we may have > > simply dropped the ball on this (again). > > > > http://oss.sgi.com/archives/xfs/2014-09/msg00337.html > > > > I recall working on this, but not quite where it left off. If I dig back > to my old tree from before the oss.sgi.com->vger switchover, I have a v1 > branch for this work that was posted here: > > http://oss.sgi.com/archives/xfs/2014-10/msg00294.html > > It looks like we just never got it reviewed and I since lost track of > it. I can resurrect it if warranted. I would like to nail down a current > reproducer though... *nod*. Not sure what we can use to trigger it, though. Cheers, Dave. -- Dave Chinner david@fromorbit.com From david@fromorbit.com Thu Feb 11 14:46:41 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=ham version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay2.corp.sgi.com [137.38.102.29]) by oss.sgi.com (Postfix) with ESMTP id 219CF7CA2 for ; Thu, 11 Feb 2016 14:46:41 -0600 (CST) Received: from cuda.sgi.com (cuda3.sgi.com [192.48.176.15]) by relay2.corp.sgi.com (Postfix) with ESMTP id 0301F30405F for ; Thu, 11 Feb 2016 12:46:40 -0800 (PST) X-ASG-Debug-ID: 1455223597-04cb6c1e5666fe0001-NocioJ Received: from ipmail06.adl2.internode.on.net (ipmail06.adl2.internode.on.net [150.101.137.129]) by cuda.sgi.com with ESMTP id RZxlNlBjmBgbqt71 for ; Thu, 11 Feb 2016 12:46:38 -0800 (PST) X-Barracuda-Envelope-From: david@fromorbit.com X-Barracuda-Apparent-Source-IP: 150.101.137.129 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: A2D9CgDL8rxWPBATLHleKAECgw+BP4ZigXmdYAEBBoFoigOFRYQIhgcCAgEBAoE0TQEBAQEBAQcBAQEBQT+EQQEBAQMBJxMcIwULCAMSBgklDwUlAwcGFBOIEgfBSQEBAQcCAR0YhTKEfohsBZZ3jUqBZoRDiFWDU4prhFsoLgGIUgEBAQ Received: from ppp121-44-19-16.lns20.syd4.internode.on.net (HELO dastard) ([121.44.19.16]) by ipmail06.adl2.internode.on.net with ESMTP; 12 Feb 2016 07:16:36 +1030 Received: from dave by dastard with local (Exim 4.80) (envelope-from ) id 1aTy8J-0001CR-F2; Fri, 12 Feb 2016 07:46:35 +1100 Date: Fri, 12 Feb 2016 07:46:35 +1100 From: Dave Chinner To: Dan Williams Cc: Jan Kara , Ross Zwisler , "linux-kernel@vger.kernel.org" , Theodore Ts'o , Alexander Viro , Andreas Dilger , Andrew Morton , Jan Kara , Matthew Wilcox , linux-ext4 , linux-fsdevel , Linux MM , "linux-nvdimm@lists.01.org" , XFS Developers Subject: Re: [PATCH v2 2/2] dax: move writeback calls into the filesystems Message-ID: <20160211204635.GI19486@dastard> X-ASG-Orig-Subj: Re: [PATCH v2 2/2] dax: move writeback calls into the filesystems References: <1455137336-28720-1-git-send-email-ross.zwisler@linux.intel.com> <1455137336-28720-3-git-send-email-ross.zwisler@linux.intel.com> <20160210220312.GP14668@dastard> <20160210224340.GA30938@linux.intel.com> <20160211125044.GJ21760@quack.suse.cz> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.21 (2010-09-15) X-Barracuda-Connect: ipmail06.adl2.internode.on.net[150.101.137.129] X-Barracuda-Start-Time: 1455223597 X-Barracuda-URL: https://192.48.176.15:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-BRTS-Status: 1 X-Barracuda-Spam-Score: 0.00 X-Barracuda-Spam-Status: No, SCORE=0.00 using per-user scores of TAG_LEVEL=1000.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.7 tests=BSF_SC0_MISMATCH_TO X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.3.26954 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 0.00 BSF_SC0_MISMATCH_TO Envelope rcpt doesn't match header On Thu, Feb 11, 2016 at 07:22:00AM -0800, Dan Williams wrote: > On Thu, Feb 11, 2016 at 4:50 AM, Jan Kara wrote: > > On Wed 10-02-16 15:43:40, Ross Zwisler wrote: > >> On Thu, Feb 11, 2016 at 09:03:12AM +1100, Dave Chinner wrote: > >> > On Wed, Feb 10, 2016 at 01:48:56PM -0700, Ross Zwisler wrote: > >> > > Previously calls to dax_writeback_mapping_range() for all DAX filesystems > >> > > (ext2, ext4 & xfs) were centralized in filemap_write_and_wait_range(). > >> > > dax_writeback_mapping_range() needs a struct block_device, and it used to > >> > > get that from inode->i_sb->s_bdev. This is correct for normal inodes > >> > > mounted on ext2, ext4 and XFS filesystems, but is incorrect for DAX raw > >> > > block devices and for XFS real-time files. > >> > > > >> > > Instead, call dax_writeback_mapping_range() directly from the filesystem > >> > > ->writepages function so that it can supply us with a valid block > >> > > device. This also fixes DAX code to properly flush caches in response to > >> > > sync(2). > >> > > > >> > > Signed-off-by: Ross Zwisler > >> > > Signed-off-by: Jan Kara > >> > > --- > >> > > fs/block_dev.c | 16 +++++++++++++++- > >> > > fs/dax.c | 13 ++++++++----- > >> > > fs/ext2/inode.c | 11 +++++++++++ > >> > > fs/ext4/inode.c | 7 +++++++ > >> > > fs/xfs/xfs_aops.c | 9 +++++++++ > >> > > include/linux/dax.h | 6 ++++-- > >> > > mm/filemap.c | 12 ++++-------- > >> > > 7 files changed, 58 insertions(+), 16 deletions(-) > >> > > > >> > > diff --git a/fs/block_dev.c b/fs/block_dev.c > >> > > index 39b3a17..fc01e43 100644 > >> > > --- a/fs/block_dev.c > >> > > +++ b/fs/block_dev.c > >> > > @@ -1693,13 +1693,27 @@ static int blkdev_releasepage(struct page *page, gfp_t wait) > >> > > return try_to_free_buffers(page); > >> > > } > >> > > > >> > > +static int blkdev_writepages(struct address_space *mapping, > >> > > + struct writeback_control *wbc) > >> > > +{ > >> > > + if (dax_mapping(mapping)) { > >> > > + struct block_device *bdev = I_BDEV(mapping->host); > >> > > + int error; > >> > > + > >> > > + error = dax_writeback_mapping_range(mapping, bdev, wbc); > >> > > + if (error) > >> > > + return error; > >> > > + } > >> > > + return generic_writepages(mapping, wbc); > >> > > +} > >> > > >> > Can you remind of the reason for calling generic_writepages() on DAX > >> > enabled address spaces? > >> > >> Sure. The initial version of this patch didn't do this, and during testing I > >> hit a bunch of xfstests failures. In ext2 at least I believe these were > >> happening because we were skipping the call into generic_writepages() for DAX > >> inodes. Without a lot of data to back this up, my guess is that this is due > >> to metadata inodes or something being marked as DAX (so dax_mapping(mapping) > >> returns true), but having dirty page cache pages that need to be written back > >> as part of the writeback. > >> > >> Changing this so we always call generic_writepages() even in the DAX case > >> solved the xfstest failures. > >> > >> If this sounds incorrect, please let me know and I'll go and gather more data. > > > > So I think a more correct fix it to not set S_DAX for inodes that will have > > any pagecache pages - e.g. don't set S_DAX for block device inodes when > > filesystem is mounted on it (probably the easiest is to just refuse to > > mount filesystem on block device which has S_DAX set). > > I think we have a wider problem here. See __blkdev_get, we set S_DAX > on all block devices that have ->direct_access() and have a > page-aligned starting address. That's seeming like a premature optimisation to me now. I didn't say anything at the time because I was busy with other things and it didn't affect XFS. > It seems to me we need to modify the > metadata i/o paths to bypass the page cache, XFS doesn't use the block device page cache for it's metadata - it has it's own internal metadata cache structures and uses get_pages or heap memory to back it's metadata. But that doesn't make mixing DAX and pages in the block device mapping tree sane. What you are missing here is that the underlying architecture of journalling filesystems mean they can't use DAX for their metadata. Modifications have to be buffered, because they have to be written to the journal first before they are written back in place. IOWs, we need to buffer changes in volatile memory for some time, and that means we can't use DAX during transactional modifications. And to put the final nail in that coffin, metadata in XFS can be discontiguous multi-block objects - in those situations we vmap the underlying pages so they appear to the code to be a contiguous buffer, and that's something we can't do with DAX.... > or teach the fsync code > how to flush populated data pages out of the radix. That doesn't solve the problem. Filesystems free and reallocate filesystem blocks without intermediate block device mapping invalidation calls, so what is one minute a data block accessed by DAX may become a metadata block that accessed via buffered IO. It all goes to crap very quickly.... However, I'd say fsync is not the place to address this. This block device cache aliasing issue is supposed to be what unmap_underlying_metadata() solves, right? Cheers, Dave. -- Dave Chinner david@fromorbit.com From david@fromorbit.com Thu Feb 11 14:51:21 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=ham version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay1.corp.sgi.com [137.38.102.111]) by oss.sgi.com (Postfix) with ESMTP id B9F0E7CA3 for ; Thu, 11 Feb 2016 14:51:21 -0600 (CST) Received: from cuda.sgi.com (cuda2.sgi.com [192.48.176.25]) by relay1.corp.sgi.com (Postfix) with ESMTP id 9BC568F8050 for ; Thu, 11 Feb 2016 12:51:18 -0800 (PST) X-ASG-Debug-ID: 1455223875-04cbb04333863e0001-NocioJ Received: from ipmail06.adl2.internode.on.net (ipmail06.adl2.internode.on.net [150.101.137.129]) by cuda.sgi.com with ESMTP id fK1SOtjezfBUBy7Y for ; Thu, 11 Feb 2016 12:51:16 -0800 (PST) X-Barracuda-Envelope-From: david@fromorbit.com X-Barracuda-Apparent-Source-IP: 150.101.137.129 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: A2AMDwDw87xWPBATLHleDhoBAoMPgT+GYoF5nWABAQaLaziFDYQIhgcEAgKBNE0BAQEBAQEHAQEBAUE/hEIBAQQnExwzCAMYCSUPBSUDBxoBEogZwUQqGIUyhH6IbAEElneNSo5+jj6EDE8oLohTAQEB Received: from ppp121-44-19-16.lns20.syd4.internode.on.net (HELO dastard) ([121.44.19.16]) by ipmail06.adl2.internode.on.net with ESMTP; 12 Feb 2016 07:20:50 +1030 Received: from dave by dastard with local (Exim 4.80) (envelope-from ) id 1aTyCP-0001D5-3f; Fri, 12 Feb 2016 07:50:49 +1100 Date: Fri, 12 Feb 2016 07:50:49 +1100 From: Dave Chinner To: Ross Zwisler , Jan Kara , linux-kernel@vger.kernel.org, Theodore Ts'o , Alexander Viro , Andreas Dilger , Andrew Morton , Dan Williams , Jan Kara , Matthew Wilcox , linux-ext4@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux-mm@kvack.org, linux-nvdimm@lists.01.org, xfs@oss.sgi.com Subject: Re: [PATCH v2 0/2] DAX bdev fixes - move flushing calls to FS Message-ID: <20160211205049.GJ19486@dastard> X-ASG-Orig-Subj: Re: [PATCH v2 0/2] DAX bdev fixes - move flushing calls to FS References: <1455137336-28720-1-git-send-email-ross.zwisler@linux.intel.com> <20160211124304.GI21760@quack.suse.cz> <20160211194922.GA5260@linux.intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20160211194922.GA5260@linux.intel.com> User-Agent: Mutt/1.5.21 (2010-09-15) X-Barracuda-Connect: ipmail06.adl2.internode.on.net[150.101.137.129] X-Barracuda-Start-Time: 1455223875 X-Barracuda-URL: https://192.48.176.25:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-BRTS-Status: 1 X-Barracuda-Spam-Score: 1.00 X-Barracuda-Spam-Status: No, SCORE=1.00 using per-user scores of TAG_LEVEL=1000.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.7 tests=BSF_SC0_MISMATCH_TO, BSF_SC2_SA016_OB X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.3.26955 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 0.00 BSF_SC0_MISMATCH_TO Envelope rcpt doesn't match header 1.00 BSF_SC2_SA016_OB Custom Rule SA016_OB On Thu, Feb 11, 2016 at 12:49:22PM -0700, Ross Zwisler wrote: > I think the plan of unsetting S_DAX on bdev->bd_inode when we mount will save > us from this, as long as we do it super early in the mount process. I think that S_DAX should not be set on the block device by default in the first place. If we've been surprised by unexpected behaviour, then I'm sure there are going to be other surprises waiting for us. DAX default policy should be opt-in, not opt-out. Cheers, Dave. -- Dave Chinner david@fromorbit.com From dan.j.williams@intel.com Thu Feb 11 14:58:42 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=T_DKIM_INVALID autolearn=ham version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay3.corp.sgi.com [198.149.34.15]) by oss.sgi.com (Postfix) with ESMTP id 3B9A37CA2 for ; Thu, 11 Feb 2016 14:58:42 -0600 (CST) Received: from cuda.sgi.com (cuda3.sgi.com [192.48.176.15]) by relay3.corp.sgi.com (Postfix) with ESMTP id A8882AC002 for ; Thu, 11 Feb 2016 12:58:41 -0800 (PST) X-ASG-Debug-ID: 1455224318-04cb6c1e57673a0001-NocioJ Received: from mail-yw0-f174.google.com (mail-yw0-f174.google.com [209.85.161.174]) by cuda.sgi.com with ESMTP id DOREEMIjVfBNLCU2 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128 verify=NO) for ; Thu, 11 Feb 2016 12:58:39 -0800 (PST) X-Barracuda-Envelope-From: dan.j.williams@intel.com X-Barracuda-Apparent-Source-IP: 209.85.161.174 Received: by mail-yw0-f174.google.com with SMTP id u200so49601002ywf.0 for ; Thu, 11 Feb 2016 12:58:39 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=intel-com.20150623.gappssmtp.com; s=20150623; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=mYKAAskfwNuOOv/XBblSu6oxzm1xEQajzN90PWPbBjk=; b=zHQFU4oRfolDcTWVqpo5uLz2dJl7RQUEmm8tFrbyYQ+gfT18KpgyyxGelIXyrGo9T9 2I0tffw3794dpeNeFeDRWNsRwiboJR0zH4Veq7cx5K/vQwnJEo50l5Zauh8zBs5E2XL4 I+aZ9+9FOIMkS4Eoe4IlC+ICbHe46UfX+EZD6u3pTxoNFrMDLyumaY+pmwx/kIJAbf2q PSmbzagmWo29v7WZcSgWK+K+gfjhLDLfI4QcwrhMFJzdlLZ0PGIrcXQ9QOxJUmZeOIUz kcyBXvyJTlKi22MoxqBi9fMQ4kqvDw1Z1pApzm66aZyrSeei/d4ihuXWXDLITM5MKE07 aQAA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:date :message-id:subject:from:to:cc:content-type; bh=mYKAAskfwNuOOv/XBblSu6oxzm1xEQajzN90PWPbBjk=; b=EYymRB/xEQgqB6Cm5eCy3T/hM7lagDzVGEeOM+L/dP/g+q8Fa3dm1MnMlzZDsIM2WJ DaV9VTAYz11hXMg5iGB8oXyxiktIDJPamnfllOQ5EJZa53hJrDTXZBYSCO0WebLWSdIs lVlqyCUxG7TwDSOpguLrtr0eujqzmH2ZMOkyt+W4dxUQQHP5MEirrB+8rtVk7guJjpMV fFXkpGcNVtTOuXfeS5wVFW3RUv8ATgHeejXCgY6B02lHRN+R9wuLYsZZI+oRaXkPRjs0 Mqm2XosIpZqgYg441RC0As6QFObeK5x7ACxLWsHMuj/kvfK9MmLjmKWVhDQXpl7Q/TFk Fm/w== X-Gm-Message-State: AG10YOTqy7wktWhbkzgqiHClgxBO7Tam+RwkEmkYedvUTXlZ7LokIbl7AyMCz3w2GwysatWQu6shHhC4O8oU/uu4 MIME-Version: 1.0 X-Received: by 10.129.85.85 with SMTP id j82mr25174823ywb.28.1455224318635; Thu, 11 Feb 2016 12:58:38 -0800 (PST) Received: by 10.37.223.199 with HTTP; Thu, 11 Feb 2016 12:58:38 -0800 (PST) In-Reply-To: <20160211204635.GI19486@dastard> References: <1455137336-28720-1-git-send-email-ross.zwisler@linux.intel.com> <1455137336-28720-3-git-send-email-ross.zwisler@linux.intel.com> <20160210220312.GP14668@dastard> <20160210224340.GA30938@linux.intel.com> <20160211125044.GJ21760@quack.suse.cz> <20160211204635.GI19486@dastard> Date: Thu, 11 Feb 2016 12:58:38 -0800 Message-ID: Subject: Re: [PATCH v2 2/2] dax: move writeback calls into the filesystems From: Dan Williams X-ASG-Orig-Subj: Re: [PATCH v2 2/2] dax: move writeback calls into the filesystems To: Dave Chinner Cc: Jan Kara , Ross Zwisler , "linux-kernel@vger.kernel.org" , "Theodore Ts'o" , Alexander Viro , Andreas Dilger , Andrew Morton , Jan Kara , Matthew Wilcox , linux-ext4 , linux-fsdevel , Linux MM , "linux-nvdimm@lists.01.org" , XFS Developers Content-Type: text/plain; charset=UTF-8 X-Barracuda-Connect: mail-yw0-f174.google.com[209.85.161.174] X-Barracuda-Start-Time: 1455224319 X-Barracuda-Encrypted: ECDHE-RSA-AES128-GCM-SHA256 X-Barracuda-URL: https://192.48.176.15:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-BRTS-Status: 1 X-Barracuda-Spam-Score: 0.00 X-Barracuda-Spam-Status: No, SCORE=0.00 using per-user scores of TAG_LEVEL=1000.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.7 tests=BSF_SC0_MISMATCH_TO, DKIM_SIGNED, DKIM_VERIFIED X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.3.26955 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 0.00 BSF_SC0_MISMATCH_TO Envelope rcpt doesn't match header -0.00 DKIM_VERIFIED Domain Keys Identified Mail: signature passes verification 0.00 DKIM_SIGNED Domain Keys Identified Mail: message has a signature On Thu, Feb 11, 2016 at 12:46 PM, Dave Chinner wrote: [..] >> It seems to me we need to modify the >> metadata i/o paths to bypass the page cache, > > XFS doesn't use the block device page cache for it's metadata - it > has it's own internal metadata cache structures and uses get_pages > or heap memory to back it's metadata. But that doesn't make mixing > DAX and pages in the block device mapping tree sane. > > What you are missing here is that the underlying architecture of > journalling filesystems mean they can't use DAX for their metadata. > Modifications have to be buffered, because they have to be written > to the journal first before they are written back in place. IOWs, we > need to buffer changes in volatile memory for some time, and that > means we can't use DAX during transactional modifications. > > And to put the final nail in that coffin, metadata in XFS can be > discontiguous multi-block objects - in those situations we vmap the > underlying pages so they appear to the code to be a contiguous > buffer, and that's something we can't do with DAX.... Sorry, I wasn't clear when I said "bypass page cache" I meant a solution similar to commit d1a5f2b4d8a1 "block: use DAX for partition table reads". However, I suspect that is broken if the filesystem is not ready to see a new page allocated for every I/O. I assume one thread will want to insert a page in the radix for another thread to find/manipulate before metadata gets written back to storage. >> or teach the fsync code >> how to flush populated data pages out of the radix. > > That doesn't solve the problem. Filesystems free and reallocate > filesystem blocks without intermediate block device mapping > invalidation calls, so what is one minute a data block accessed by > DAX may become a metadata block that accessed via buffered IO. It > all goes to crap very quickly.... > > However, I'd say fsync is not the place to address this. This block > device cache aliasing issue is supposed to be what > unmap_underlying_metadata() solves, right? I'll take a look at this. Right now I'm trying to implement the "clear block-device-inode S_DAX on fs mount" approach. My concern though is that we need to disable block device mmap while a filesystem is mounted... Maybe I don't need to worry because it's already the case that a mmap of the raw device may not see the most up to date data for a file that has dirty fs-page-cache data. From david@fromorbit.com Thu Feb 11 14:59:19 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=ham version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay1.corp.sgi.com [137.38.102.111]) by oss.sgi.com (Postfix) with ESMTP id E2B317CA8 for ; Thu, 11 Feb 2016 14:59:19 -0600 (CST) Received: from cuda.sgi.com (cuda3.sgi.com [192.48.176.15]) by relay1.corp.sgi.com (Postfix) with ESMTP id C306F8F8050 for ; Thu, 11 Feb 2016 12:59:19 -0800 (PST) X-ASG-Debug-ID: 1455224357-04cb6c1e5967400001-NocioJ Received: from ipmail06.adl2.internode.on.net (ipmail06.adl2.internode.on.net [150.101.137.129]) by cuda.sgi.com with ESMTP id wQOQFesTED42SsaI for ; Thu, 11 Feb 2016 12:59:17 -0800 (PST) X-Barracuda-Envelope-From: david@fromorbit.com X-Barracuda-Apparent-Source-IP: 150.101.137.129 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: A2COCgAb9bxWPBATLHleKAECgw+BP4ZigXmdYAEBBotrhUWECIYHBAICgTRNAQEBAQEBBwEBAQFBP4RCAQEEOhwjEAgDDgoJJQ8FJQMHGhOIGcFFAQEIAh4YhTKEfohsBZZ3jUqOfkSNeoRbKC6IUwEBAQ Received: from ppp121-44-19-16.lns20.syd4.internode.on.net (HELO dastard) ([121.44.19.16]) by ipmail06.adl2.internode.on.net with ESMTP; 12 Feb 2016 07:29:16 +1030 Received: from dave by dastard with local (Exim 4.80) (envelope-from ) id 1aTyKa-0001E3-2g; Fri, 12 Feb 2016 07:59:16 +1100 Date: Fri, 12 Feb 2016 07:59:16 +1100 From: Dave Chinner To: Christoph Hellwig Cc: xfs@oss.sgi.com Subject: Re: [PATCH 2/8] xfs: remove xfs_cancel_ioend Message-ID: <20160211205916.GK19486@dastard> X-ASG-Orig-Subj: Re: [PATCH 2/8] xfs: remove xfs_cancel_ioend References: <1455094043-9694-1-git-send-email-david@fromorbit.com> <1455094043-9694-3-git-send-email-david@fromorbit.com> <20160210112800.GA15221@infradead.org> <20160211002137.GR14668@dastard> <20160211151425.GB13515@infradead.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20160211151425.GB13515@infradead.org> User-Agent: Mutt/1.5.21 (2010-09-15) X-Barracuda-Connect: ipmail06.adl2.internode.on.net[150.101.137.129] X-Barracuda-Start-Time: 1455224357 X-Barracuda-URL: https://192.48.176.15:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-BRTS-Status: 1 X-Barracuda-Spam-Score: 0.00 X-Barracuda-Spam-Status: No, SCORE=0.00 using per-user scores of TAG_LEVEL=1000.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.7 tests=BSF_SC0_MISMATCH_TO X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.3.26955 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 0.00 BSF_SC0_MISMATCH_TO Envelope rcpt doesn't match header On Thu, Feb 11, 2016 at 07:14:25AM -0800, Christoph Hellwig wrote: > On Thu, Feb 11, 2016 at 11:21:37AM +1100, Dave Chinner wrote: > > I'll propagate it through where it makes sense. If we alrady have an > > error, then we aren't going to call xfs_setfilesize_trans_alloc() > > anyway, so checking the return value only matters in the non-error > > cases. > > Oh, I missed that we don't care about the failure case. Maybe we > should just call xfs_setfilesize_trans_alloc instead, and just move > the conditionals to it so that it's a no-op if no transaction is needed? OK, but let's make cleanups like this at the start of the next batch of work we are already working on for this code so this can be finalised and made available for wider testing.... Cheers, Dave. -- Dave Chinner david@fromorbit.com From david@fromorbit.com Thu Feb 11 16:47:15 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=ham version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay1.corp.sgi.com [137.38.102.111]) by oss.sgi.com (Postfix) with ESMTP id ADF7D7CA2 for ; Thu, 11 Feb 2016 16:47:15 -0600 (CST) Received: from cuda.sgi.com (cuda1.sgi.com [192.48.157.11]) by relay1.corp.sgi.com (Postfix) with ESMTP id 74A808F8035 for ; Thu, 11 Feb 2016 14:47:12 -0800 (PST) X-ASG-Debug-ID: 1455230829-04bdf066ed72810001-NocioJ Received: from ipmail06.adl2.internode.on.net (ipmail06.adl2.internode.on.net [150.101.137.129]) by cuda.sgi.com with ESMTP id BogmEtesoEHeQLsM for ; Thu, 11 Feb 2016 14:47:09 -0800 (PST) X-Barracuda-Envelope-From: david@fromorbit.com X-Barracuda-Apparent-Source-IP: 150.101.137.129 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: A2D8CgDlDr1WPBATLHleKAECgw+BP4ZigXmdYgEBBotrhUWECIYHAgIBAQKBNE0BAQEBAQEHAQEBAUE/hEEBAQEDATocEQsHBQsIAxIGCSUPBSUDBwYUExuHdwfBVgEBAQcCAR0YhTKEfoQchFAFlneNSoFmh2mFL44+gmQZgV4oLocbgTgBAQE Received: from ppp121-44-19-16.lns20.syd4.internode.on.net (HELO dastard) ([121.44.19.16]) by ipmail06.adl2.internode.on.net with ESMTP; 12 Feb 2016 09:16:28 +1030 Received: from dave by dastard with local (Exim 4.80) (envelope-from ) id 1aU008-0001PH-A3; Fri, 12 Feb 2016 09:46:16 +1100 Date: Fri, 12 Feb 2016 09:46:16 +1100 From: Dave Chinner To: Dan Williams Cc: Jan Kara , Ross Zwisler , "linux-kernel@vger.kernel.org" , Theodore Ts'o , Alexander Viro , Andreas Dilger , Andrew Morton , Jan Kara , Matthew Wilcox , linux-ext4 , linux-fsdevel , Linux MM , "linux-nvdimm@lists.01.org" , XFS Developers Subject: Re: [PATCH v2 2/2] dax: move writeback calls into the filesystems Message-ID: <20160211224616.GL19486@dastard> X-ASG-Orig-Subj: Re: [PATCH v2 2/2] dax: move writeback calls into the filesystems References: <1455137336-28720-1-git-send-email-ross.zwisler@linux.intel.com> <1455137336-28720-3-git-send-email-ross.zwisler@linux.intel.com> <20160210220312.GP14668@dastard> <20160210224340.GA30938@linux.intel.com> <20160211125044.GJ21760@quack.suse.cz> <20160211204635.GI19486@dastard> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.21 (2010-09-15) X-Barracuda-Connect: ipmail06.adl2.internode.on.net[150.101.137.129] X-Barracuda-Start-Time: 1455230829 X-Barracuda-URL: https://192.48.157.11:443/cgi-mod/mark.cgi X-Barracuda-BRTS-Status: 1 X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-Spam-Score: 0.00 X-Barracuda-Spam-Status: No, SCORE=0.00 using per-user scores of TAG_LEVEL=1000.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.7 tests=BSF_SC0_MISMATCH_TO X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.3.26956 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 0.00 BSF_SC0_MISMATCH_TO Envelope rcpt doesn't match header On Thu, Feb 11, 2016 at 12:58:38PM -0800, Dan Williams wrote: > On Thu, Feb 11, 2016 at 12:46 PM, Dave Chinner wrote: > [..] > >> It seems to me we need to modify the > >> metadata i/o paths to bypass the page cache, > > > > XFS doesn't use the block device page cache for it's metadata - it > > has it's own internal metadata cache structures and uses get_pages > > or heap memory to back it's metadata. But that doesn't make mixing > > DAX and pages in the block device mapping tree sane. > > > > What you are missing here is that the underlying architecture of > > journalling filesystems mean they can't use DAX for their metadata. > > Modifications have to be buffered, because they have to be written > > to the journal first before they are written back in place. IOWs, we > > need to buffer changes in volatile memory for some time, and that > > means we can't use DAX during transactional modifications. > > > > And to put the final nail in that coffin, metadata in XFS can be > > discontiguous multi-block objects - in those situations we vmap the > > underlying pages so they appear to the code to be a contiguous > > buffer, and that's something we can't do with DAX.... > > Sorry, I wasn't clear when I said "bypass page cache" I meant a > solution similar to commit d1a5f2b4d8a1 "block: use DAX for partition > table reads". So there's already bandaids to prevent bad shit from happening in the block layer, let alone when we consider all the ways that userspace can screw this all up. > However, I suspect that is broken if the filesystem is not ready > to see a new page allocated for every I/O. I assume one > thread will want to insert a page in the radix for another thread > to find/manipulate before metadata gets written back to storage. Right, you can't do that, especially as the struct page has a 1-1 relationship with the bufferhead that is attached to it as the bufferhead carries the filesystem state for the given cached page. > >> or teach the fsync code how to flush populated data pages out > >> of the radix. > > > > That doesn't solve the problem. Filesystems free and reallocate > > filesystem blocks without intermediate block device mapping > > invalidation calls, so what is one minute a data block accessed > > by DAX may become a metadata block that accessed via buffered > > IO. It all goes to crap very quickly.... > > > > However, I'd say fsync is not the place to address this. This > > block device cache aliasing issue is supposed to be what > > unmap_underlying_metadata() solves, right? > > I'll take a look at this. Right now I'm trying to implement the > "clear block-device-inode S_DAX on fs mount" approach. My concern > though is that we need to disable block device mmap while a > filesystem is mounted... /me chokes on his coffee. When did mmaping the block device behind the back of a mounted fileystem become a valid use case? It's not supported for normal block devices and for the same reasons it won't be supported for DAX enabled block devices, either. i.e. I'm going to tell anyone who has an application that does this to go and take a hike when (not if!) they report filesystem corruption problems. > Maybe I don't need to worry because it's already the case that a > mmap of the raw device may not see the most up to date data for a > file that has dirty fs-page-cache data. It goes both ways. What happens if mkfs or fsck modifies the block device via mmap+DAX and then the filesystem mounts the block device and tries to read that metadata via the block device page cache? Quite frankly, DAX on the block device is a can of worms we really don't need to deal with right now. IMO it's a solution looking for a problem to solve, the "default to on" policy is wrong (DAX is opt-in, not opt-out) and given this we should turn it off until we've solved the more important problems we need to solve. i.e. We need to concentrate on getting data integrity working correctly first, then address the cache aliasing issues, then address the "safe access" issues, and then we can re-introduce block device DAX access... Cheers, Dave. -- Dave Chinner david@fromorbit.com From dan.j.williams@intel.com Thu Feb 11 16:59:18 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=T_DKIM_INVALID autolearn=ham version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay1.corp.sgi.com [137.38.102.111]) by oss.sgi.com (Postfix) with ESMTP id 7BCCA7CA2 for ; Thu, 11 Feb 2016 16:59:18 -0600 (CST) Received: from cuda.sgi.com (cuda1.sgi.com [192.48.157.11]) by relay1.corp.sgi.com (Postfix) with ESMTP id 382368F804B for ; Thu, 11 Feb 2016 14:59:18 -0800 (PST) X-ASG-Debug-ID: 1455231554-04bdf066ed72c90001-NocioJ Received: from mail-yk0-f177.google.com (mail-yk0-f177.google.com [209.85.160.177]) by cuda.sgi.com with ESMTP id 4VkwH3odHbfsQ2rG (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128 verify=NO) for ; Thu, 11 Feb 2016 14:59:14 -0800 (PST) X-Barracuda-Envelope-From: dan.j.williams@intel.com X-Barracuda-Apparent-Source-IP: 209.85.160.177 Received: by mail-yk0-f177.google.com with SMTP id z7so27549583yka.3 for ; Thu, 11 Feb 2016 14:59:15 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=intel-com.20150623.gappssmtp.com; s=20150623; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=pWlY/wAm4epetfdu5faDBRBQBKKZVi21avR8ela4rhE=; b=d0FFHnqoGHoFIhv64YzqBrrj71T7tgxs6zghGxonio69hFN0eKihydEUhtx+fsPdAQ WNAPExq4PFZwv6CSAy706aewRsirq9V3CnfTRdKpRFzOSl6syX7TFKMA52xQs6cCLIyt XhHVF6v5IRoLlTay36Et2deZauBUsxbVNSO6En3VpiKtTmml6nTZYuPeTl9ukZsnzkuY 1K79kANVKHdWglcHaenIme8+uY/qrBMh2ujf82chB0YY/qIhLtLyih+VTo+t+tOCQi+X v+JJ/lrV3TNjwl7gw0WEQhTSrTTFALCGUOpJp97DGAqih2d/IPUYaHeeAd5TqMEjWx6y uFMA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:date :message-id:subject:from:to:cc:content-type; bh=pWlY/wAm4epetfdu5faDBRBQBKKZVi21avR8ela4rhE=; b=IvtfjGnS0B8v6JqJOyGwiBupOfL/lbe/ijkCO0rqBfOtKOcf6aihlHlHU1xq2CUC5j mXih3mLakwgQBeEP4D2FnZP5DyU0vERFFtw3RG4gVznQPt4Gi80MzJa50lcVnu2Yj4np T2DCvsXYvrTZLD0FroGjarvHx08zKgiTyiKRJlg0kkOOK+PMiw9yj9kXBHOcGCNMwij8 q54kSnvPMNP2u3hHvY2G1WndYMaUhomA8UrNAIbgC45t+Tzjk7fEnIFXaIVKJMgnkvin bHiKPJgHJX27GaKL74z98b66MsaZ92O1QFmkNMI/bgNcaOl/ZMimaZLEqhCBaXhi/3DD JhQA== X-Gm-Message-State: AG10YORzrDsfrrBi0j550FpOxjbheyBcBzmyICBNk4+KBMxqDYUDeNO2QbXoRDUbDmsNjYjl8RT0dc0cmDhBwpK0 MIME-Version: 1.0 X-Received: by 10.37.87.65 with SMTP id l62mr26433923ybb.116.1455231554152; Thu, 11 Feb 2016 14:59:14 -0800 (PST) Received: by 10.37.223.199 with HTTP; Thu, 11 Feb 2016 14:59:14 -0800 (PST) In-Reply-To: <20160211224616.GL19486@dastard> References: <1455137336-28720-1-git-send-email-ross.zwisler@linux.intel.com> <1455137336-28720-3-git-send-email-ross.zwisler@linux.intel.com> <20160210220312.GP14668@dastard> <20160210224340.GA30938@linux.intel.com> <20160211125044.GJ21760@quack.suse.cz> <20160211204635.GI19486@dastard> <20160211224616.GL19486@dastard> Date: Thu, 11 Feb 2016 14:59:14 -0800 Message-ID: Subject: Re: [PATCH v2 2/2] dax: move writeback calls into the filesystems From: Dan Williams X-ASG-Orig-Subj: Re: [PATCH v2 2/2] dax: move writeback calls into the filesystems To: Dave Chinner Cc: Jan Kara , Ross Zwisler , "linux-kernel@vger.kernel.org" , "Theodore Ts'o" , Alexander Viro , Andreas Dilger , Andrew Morton , Jan Kara , Matthew Wilcox , linux-ext4 , linux-fsdevel , Linux MM , "linux-nvdimm@lists.01.org" , XFS Developers Content-Type: text/plain; charset=UTF-8 X-Barracuda-Connect: mail-yk0-f177.google.com[209.85.160.177] X-Barracuda-Start-Time: 1455231554 X-Barracuda-Encrypted: ECDHE-RSA-AES128-GCM-SHA256 X-Barracuda-URL: https://192.48.157.11:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-BRTS-Status: 1 X-Barracuda-Spam-Score: 0.00 X-Barracuda-Spam-Status: No, SCORE=0.00 using per-user scores of TAG_LEVEL=1000.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.7 tests=BSF_SC0_MISMATCH_TO, DKIM_SIGNED, DKIM_VERIFIED X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.3.26958 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 0.00 BSF_SC0_MISMATCH_TO Envelope rcpt doesn't match header -0.00 DKIM_VERIFIED Domain Keys Identified Mail: signature passes verification 0.00 DKIM_SIGNED Domain Keys Identified Mail: message has a signature On Thu, Feb 11, 2016 at 2:46 PM, Dave Chinner wrote: > On Thu, Feb 11, 2016 at 12:58:38PM -0800, Dan Williams wrote: >> On Thu, Feb 11, 2016 at 12:46 PM, Dave Chinner wrote: >> [..] >> >> It seems to me we need to modify the >> >> metadata i/o paths to bypass the page cache, >> > >> > XFS doesn't use the block device page cache for it's metadata - it >> > has it's own internal metadata cache structures and uses get_pages >> > or heap memory to back it's metadata. But that doesn't make mixing >> > DAX and pages in the block device mapping tree sane. >> > >> > What you are missing here is that the underlying architecture of >> > journalling filesystems mean they can't use DAX for their metadata. >> > Modifications have to be buffered, because they have to be written >> > to the journal first before they are written back in place. IOWs, we >> > need to buffer changes in volatile memory for some time, and that >> > means we can't use DAX during transactional modifications. >> > >> > And to put the final nail in that coffin, metadata in XFS can be >> > discontiguous multi-block objects - in those situations we vmap the >> > underlying pages so they appear to the code to be a contiguous >> > buffer, and that's something we can't do with DAX.... >> >> Sorry, I wasn't clear when I said "bypass page cache" I meant a >> solution similar to commit d1a5f2b4d8a1 "block: use DAX for partition >> table reads". > > So there's already bandaids to prevent bad shit from happening in > the block layer, let alone when we consider all the ways that > userspace can screw this all up. > >> However, I suspect that is broken if the filesystem is not ready >> to see a new page allocated for every I/O. I assume one >> thread will want to insert a page in the radix for another thread >> to find/manipulate before metadata gets written back to storage. > > Right, you can't do that, especially as the struct page has a 1-1 > relationship with the bufferhead that is attached to it as the > bufferhead carries the filesystem state for the given cached page. > >> >> or teach the fsync code how to flush populated data pages out >> >> of the radix. >> > >> > That doesn't solve the problem. Filesystems free and reallocate >> > filesystem blocks without intermediate block device mapping >> > invalidation calls, so what is one minute a data block accessed >> > by DAX may become a metadata block that accessed via buffered >> > IO. It all goes to crap very quickly.... >> > >> > However, I'd say fsync is not the place to address this. This >> > block device cache aliasing issue is supposed to be what >> > unmap_underlying_metadata() solves, right? >> >> I'll take a look at this. Right now I'm trying to implement the >> "clear block-device-inode S_DAX on fs mount" approach. My concern >> though is that we need to disable block device mmap while a >> filesystem is mounted... > > /me chokes on his coffee. > > When did mmaping the block device behind the back of a mounted > fileystem become a valid use case? It's not supported for normal > block devices and for the same reasons it won't be supported for DAX > enabled block devices, either. i.e. I'm going to tell anyone who has > an application that does this to go and take a hike when (not if!) > they report filesystem corruption problems. Right, but we need to not confuse the fsync code regardless of how bad of an idea this is ::-). >> Maybe I don't need to worry because it's already the case that a >> mmap of the raw device may not see the most up to date data for a >> file that has dirty fs-page-cache data. > > It goes both ways. What happens if mkfs or fsck modifies the > block device via mmap+DAX and then the filesystem mounts the block > device and tries to read that metadata via the block device page > cache? > > Quite frankly, DAX on the block device is a can of worms we really > don't need to deal with right now. IMO it's a solution looking for a > problem to solve, Virtualization use cases want to give large ranges to guest-VMs, and it is currently the only way to reliably get 1GiB mappings. > the "default to on" policy is wrong (DAX is > opt-in, not opt-out) and given this we should turn it off until > we've solved the more important problems we need to solve. i.e. We > need to concentrate on getting data integrity working correctly > first, then address the cache aliasing issues, then address the > "safe access" issues, and then we can re-introduce block device DAX > access... Agreed. Note that the "default-on policy" came from commit bbab37ddc20b "block: Add support for DAX reads/writes to block devices" way back in 4.2. We're just now noticing. Credit Ross for good sanity checking. From darrick.wong@oracle.com Thu Feb 11 17:39:29 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay3.corp.sgi.com [198.149.34.15]) by oss.sgi.com (Postfix) with ESMTP id 1308B7CA3 for ; Thu, 11 Feb 2016 17:39:29 -0600 (CST) Received: from cuda.sgi.com (cuda1.sgi.com [192.48.157.11]) by relay3.corp.sgi.com (Postfix) with ESMTP id B4FC6AC003 for ; Thu, 11 Feb 2016 15:39:25 -0800 (PST) X-ASG-Debug-ID: 1455233961-04bdf066eb73860001-NocioJ Received: from userp1040.oracle.com (userp1040.oracle.com [156.151.31.81]) by cuda.sgi.com with ESMTP id 5aihXUSwCSaDK00X (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO) for ; Thu, 11 Feb 2016 15:39:21 -0800 (PST) X-Barracuda-Envelope-From: darrick.wong@oracle.com X-Barracuda-Apparent-Source-IP: 156.151.31.81 Received: from userv0022.oracle.com (userv0022.oracle.com [156.151.31.74]) by userp1040.oracle.com (Sentrion-MTA-4.3.2/Sentrion-MTA-4.3.2) with ESMTP id u1BNdJa6031315 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 11 Feb 2016 23:39:19 GMT Received: from aserv0122.oracle.com (aserv0122.oracle.com [141.146.126.236]) by userv0022.oracle.com (8.14.4/8.13.8) with ESMTP id u1BNdJeQ019909 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=FAIL); Thu, 11 Feb 2016 23:39:19 GMT Received: from abhmp0010.oracle.com (abhmp0010.oracle.com [141.146.116.16]) by aserv0122.oracle.com (8.13.8/8.13.8) with ESMTP id u1BNdIqF026560; Thu, 11 Feb 2016 23:39:18 GMT Received: from localhost (/10.145.178.207) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Thu, 11 Feb 2016 15:39:18 -0800 Subject: [PATCH v4.2 00/32] xfstests: test the nfs/cifs/btrfs/xfs reflink/dedupe ioctls From: "Darrick J. Wong" X-ASG-Orig-Subj: [PATCH v4.2 00/32] xfstests: test the nfs/cifs/btrfs/xfs reflink/dedupe ioctls To: david@fromorbit.com, darrick.wong@oracle.com Cc: linux-btrfs@vger.kernel.org, fstests@vger.kernel.org, xfs@oss.sgi.com Date: Thu, 11 Feb 2016 15:39:16 -0800 Message-ID: <20160211233916.2202.40961.stgit@birch.djwong.org> User-Agent: StGit/0.17.1-dirty MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit X-Source-IP: userv0022.oracle.com [156.151.31.74] X-Barracuda-Connect: userp1040.oracle.com[156.151.31.81] X-Barracuda-Start-Time: 1455233961 X-Barracuda-Encrypted: ECDHE-RSA-AES256-GCM-SHA384 X-Barracuda-URL: https://192.48.157.11:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-BRTS-Status: 1 X-Barracuda-Spam-Score: 0.00 X-Barracuda-Spam-Status: No, SCORE=0.00 using per-user scores of TAG_LEVEL=1000.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.7 tests=BSF_SC0_MISMATCH_TO, UNPARSEABLE_RELAY X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.3.26959 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 0.00 BSF_SC0_MISMATCH_TO Envelope rcpt doesn't match header 0.00 UNPARSEABLE_RELAY Informational: message has unparseable relay lines Dave Chinner: I've renumbered the new tests and pushed to github[3] if you'd like to pull. See the pull request at the end of this message. This is a patch set against the reflink/dedupe test cases in xfstests. The first three patches fix errors in the existing reflink tests, some of which are from Christoph Hellwig. The next eight patches fix style errors, refactor commonly used code, remove unnecessary clutter, and add missing _require* checks to the existing reflink tests. Patch 12 adds a test checking that unwritten extent conversion does NOT happen after a directio write to an unwritten extent hits a disk error. Due to a bug in the VFS directio code, ext4 can disclose stale disk contents if an aio dio write fails; XFS suffers this problem for any failing dio write to an unwritten extent. Christoph's kernel patchset titled "vfs/xfs: directio updates to ease COW handling V2" (and a separate ext4 warning cleanup) is needed to fix this. Patches 13-31 add more reflink tests focusing on correct CoW behavior particularly with the CoW extent size hint enabled. It also provides a few regression tests for bugs that have been hit while running XFS reflink, a few tests of the quota accounting when various reflink operations happen, and a few tests for get_bmapx to ensure that what it reports is at least somewhat accurate. Patch 25 adds a few basic reverse-mapping tests for XFS. If you're going to start using this mess, you probably ought to just pull from my github trees for kernel[1], xfsprogs[2], xfstests[3], xfs-docs[4], and man-pages[5]. All tests should pass on XFS, YMWV on btrfs and ocfs2. Comments and questions are, as always, welcome. --D [1] https://github.com/djwong/linux/tree/for-dave [2] https://github.com/djwong/xfsprogs/tree/for-dave [3] https://github.com/djwong/xfstests/tree/for-dave [4] https://github.com/djwong/xfs-documentation/tree/for-dave [5] https://github.com/djwong/man-pages/commits/for-mtk --- The following changes since commit d98149c205559950c03d6b1d539e45fd35b5630e: Fix prerequisite packages to build fstests on Ubuntu (2016-02-08 09:27:15 +1100) are available in the git repository at: https://github.com/djwong/xfstests for-dave for you to fetch changes up to 6e560dc336d857bc589b1debbf610fd2a3344ccd: reflink: kick the slow tests out of the 'quick' group (2016-02-11 15:27:47 -0800) ---------------------------------------------------------------- Darrick J. Wong (32): generic/182: this is a dedupe test, check for dedupe xfstests: filter whitespace in 128 and 132 xfstests: make _scratch_mkfs_blocksized usable reflink: remove redundant filesystem checks from the end of the tests reflink: remove unnecessary umounts from test code common/dmerror: add some more dmerror routines common: create _require_test_program to look for programs in src/ common: provide a method to repair the scratch fs reflink: refactor mixed block creation code reflink: fix style problems in existing tests reflink: add _require_odirect to the directio tests dio: unwritten conversion bug tests reflink: test intersecting CoW and falloc/fpunch/fzero/fcollapse/finsert/ftrunc reflink: test CoW behavior with IO errors reflink: test CoW operations against the source file reflink: ensure that we can handle reflinking a lot of extents xfs: more reflink tests xfs/122: support refcount/rmap data structures xfs: test fragmentation characteristics of copy-on-write reflink: high offset reflink and dedupe tests reflink: test xfs cow behavior when the filesystem crashes reflink: test quota accounting reflink: test CoW across a mixed range of block types with cowextsize set xfs: test the automatic cowextsize extent garbage collector xfs: test rmapbt functionality reflink: test aio copy on write xfs: aio cow tests xfs: test xfs_getbmapx behavior with shared extents reflink: test reflink+cow+enospc all at the same time xfs: ensure that we don't crash when freeing the ag reservations on a ro mount xfs: test source CoW across mixed block types with cowextsz set reflink: kick the slow tests out of the 'quick' group .gitignore | 2 + common/dmerror | 27 ++- common/rc | 117 +++++++++++ common/reflink | 202 +++++++++++++++--- src/Makefile | 2 +- src/aio-dio-regress/aiocp.c | 489 ++++++++++++++++++++++++++++++++++++++++++++ src/punch-alternating.c | 59 ++++++ tests/btrfs/100 | 2 +- tests/btrfs/101 | 2 +- tests/generic/010 | 2 +- tests/generic/094 | 2 +- tests/generic/110 | 2 +- tests/generic/111 | 2 +- tests/generic/115 | 2 +- tests/generic/116 | 44 ++-- tests/generic/118 | 42 ++-- tests/generic/119 | 102 ++++----- tests/generic/121 | 44 ++-- tests/generic/122 | 44 ++-- tests/generic/134 | 78 +++---- tests/generic/136 | 78 +++---- tests/generic/137 | 44 ++-- tests/generic/138 | 104 +++++----- tests/generic/139 | 99 ++++----- tests/generic/140 | 104 +++++----- tests/generic/142 | 37 ++-- tests/generic/143 | 38 ++-- tests/generic/144 | 124 +++++------ tests/generic/145 | 150 +++++++------- tests/generic/146 | 132 ++++++------ tests/generic/147 | 146 ++++++------- tests/generic/148 | 84 ++++---- tests/generic/149 | 132 ++++++------ tests/generic/150 | 23 ++- tests/generic/151 | 35 ++-- tests/generic/152 | 39 ++-- tests/generic/153 | 41 ++-- tests/generic/154 | 43 ++-- tests/generic/155 | 40 ++-- tests/generic/156 | 43 ++-- tests/generic/157 | 64 +++--- tests/generic/157.out | 1 - tests/generic/158 | 66 +++--- tests/generic/158.out | 1 - tests/generic/159 | 19 +- tests/generic/160 | 19 +- tests/generic/161 | 30 ++- tests/generic/161.out | 2 - tests/generic/162 | 36 ++-- tests/generic/162.out | 2 - tests/generic/163 | 36 ++-- tests/generic/163.out | 2 - tests/generic/164 | 40 ++-- tests/generic/164.out | 2 - tests/generic/165 | 39 ++-- tests/generic/165.out | 2 - tests/generic/166 | 36 ++-- tests/generic/166.out | 2 - tests/generic/167 | 35 ++-- tests/generic/167.out | 2 - tests/generic/168 | 37 ++-- tests/generic/168.out | 2 - tests/generic/170 | 38 ++-- tests/generic/170.out | 2 - tests/generic/171 | 62 +++--- tests/generic/171.out | 1 - tests/generic/172 | 62 +++--- tests/generic/172.out | 1 - tests/generic/173 | 54 +++-- tests/generic/173.out | 1 - tests/generic/174 | 63 +++--- tests/generic/174.out | 1 - tests/generic/175 | 47 ++--- tests/generic/175.out | 5 + tests/generic/176 | 54 +++-- tests/generic/176.out | 5 +- tests/generic/178 | 31 +-- tests/generic/179 | 50 ++--- tests/generic/180 | 50 ++--- tests/generic/181 | 38 ++-- tests/generic/182 | 89 ++++---- tests/generic/183 | 55 +++-- tests/generic/183.out | 1 - tests/generic/185 | 54 +++-- tests/generic/185.out | 1 - tests/generic/186 | 73 ++++--- tests/generic/186.out | 1 - tests/generic/187 | 74 +++---- tests/generic/187.out | 1 - tests/generic/188 | 47 ++--- tests/generic/188.out | 1 - tests/generic/189 | 46 ++--- tests/generic/189.out | 1 - tests/generic/190 | 47 ++--- tests/generic/190.out | 1 - tests/generic/191 | 46 ++--- tests/generic/191.out | 1 - tests/generic/194 | 52 ++--- tests/generic/194.out | 1 - tests/generic/195 | 51 ++--- tests/generic/195.out | 1 - tests/generic/196 | 49 ++--- tests/generic/196.out | 1 - tests/generic/197 | 48 ++--- tests/generic/197.out | 1 - tests/generic/199 | 70 ++----- tests/generic/199.out | 5 +- tests/generic/200 | 70 ++----- tests/generic/200.out | 5 +- tests/generic/201 | 42 ++-- tests/generic/201.out | 1 - tests/generic/202 | 41 ++-- tests/generic/202.out | 1 - tests/generic/203 | 42 ++-- tests/generic/203.out | 1 - tests/generic/205 | 51 +++-- tests/generic/205.out | 1 - tests/generic/206 | 52 +++-- tests/generic/206.out | 1 - tests/generic/216 | 51 +++-- tests/generic/216.out | 1 - tests/generic/217 | 52 +++-- tests/generic/217.out | 1 - tests/generic/218 | 43 ++-- tests/generic/218.out | 1 - tests/generic/220 | 44 ++-- tests/generic/220.out | 1 - tests/generic/222 | 51 +++-- tests/generic/222.out | 1 - tests/generic/225 | 2 +- tests/generic/227 | 52 +++-- tests/generic/227.out | 1 - tests/generic/229 | 77 ++++--- tests/generic/229.out | 1 - tests/generic/238 | 78 ++++--- tests/generic/238.out | 1 - tests/generic/242 | 51 +++-- tests/generic/242.out | 1 - tests/generic/243 | 52 +++-- tests/generic/243.out | 1 - tests/generic/250 | 100 +++++++++ tests/generic/250.out | 10 + tests/generic/252 | 103 ++++++++++ tests/generic/252.out | 10 + tests/generic/253 | 90 ++++++++ tests/generic/253.out | 12 ++ tests/generic/254 | 90 ++++++++ tests/generic/254.out | 12 ++ tests/generic/259 | 90 ++++++++ tests/generic/259.out | 12 ++ tests/generic/261 | 90 ++++++++ tests/generic/261.out | 12 ++ tests/generic/262 | 93 +++++++++ tests/generic/262.out | 12 ++ tests/generic/264 | 90 ++++++++ tests/generic/264.out | 12 ++ tests/generic/265 | 99 +++++++++ tests/generic/265.out | 11 + tests/generic/266 | 97 +++++++++ tests/generic/266.out | 11 + tests/generic/267 | 100 +++++++++ tests/generic/267.out | 10 + tests/generic/268 | 103 ++++++++++ tests/generic/268.out | 12 ++ tests/generic/271 | 100 +++++++++ tests/generic/271.out | 11 + tests/generic/272 | 98 +++++++++ tests/generic/272.out | 11 + tests/generic/276 | 101 +++++++++ tests/generic/276.out | 11 + tests/generic/278 | 104 ++++++++++ tests/generic/278.out | 12 ++ tests/generic/279 | 100 +++++++++ tests/generic/279.out | 11 + tests/generic/281 | 98 +++++++++ tests/generic/281.out | 11 + tests/generic/282 | 101 +++++++++ tests/generic/282.out | 10 + tests/generic/283 | 104 ++++++++++ tests/generic/283.out | 12 ++ tests/generic/284 | 89 ++++++++ tests/generic/284.out | 12 ++ tests/generic/285 | 2 +- tests/generic/286 | 2 +- tests/generic/287 | 90 ++++++++ tests/generic/287.out | 12 ++ tests/generic/289 | 91 +++++++++ tests/generic/289.out | 12 ++ tests/generic/290 | 92 +++++++++ tests/generic/290.out | 12 ++ tests/generic/291 | 91 +++++++++ tests/generic/291.out | 12 ++ tests/generic/292 | 92 +++++++++ tests/generic/292.out | 12 ++ tests/generic/293 | 93 +++++++++ tests/generic/293.out | 12 ++ tests/generic/295 | 94 +++++++++ tests/generic/295.out | 12 ++ tests/generic/296 | 90 ++++++++ tests/generic/296.out | 12 ++ tests/generic/297 | 99 +++++++++ tests/generic/297.out | 6 + tests/generic/298 | 99 +++++++++ tests/generic/298.out | 6 + tests/generic/301 | 100 +++++++++ tests/generic/301.out | 10 + tests/generic/302 | 101 +++++++++ tests/generic/302.out | 10 + tests/generic/303 | 98 +++++++++ tests/generic/303.out | 21 ++ tests/generic/304 | 99 +++++++++ tests/generic/304.out | 22 ++ tests/generic/305 | 100 +++++++++ tests/generic/305.out | 22 ++ tests/generic/311 | 2 +- tests/generic/326 | 101 +++++++++ tests/generic/326.out | 22 ++ tests/generic/327 | 87 ++++++++ tests/generic/327.out | 12 ++ tests/generic/328 | 105 ++++++++++ tests/generic/328.out | 25 +++ tests/generic/329 | 102 +++++++++ tests/generic/329.out | 12 ++ tests/generic/330 | 93 +++++++++ tests/generic/330.out | 11 + tests/generic/331 | 104 ++++++++++ tests/generic/331.out | 12 ++ tests/generic/332 | 94 +++++++++ tests/generic/332.out | 11 + tests/generic/333 | 99 +++++++++ tests/generic/333.out | 4 + tests/generic/334 | 98 +++++++++ tests/generic/334.out | 4 + tests/generic/group | 71 +++++-- tests/xfs/032 | 3 +- tests/xfs/044 | 2 +- tests/xfs/122 | 3 + tests/xfs/122.out | 4 + tests/xfs/127 | 33 ++- tests/xfs/127.out | 1 - tests/xfs/128 | 97 +++++---- tests/xfs/128.out | 9 +- tests/xfs/129 | 33 ++- tests/xfs/131 | 25 +-- tests/xfs/131.out | 1 - tests/xfs/132 | 53 ++--- tests/xfs/132.out | 40 ++-- tests/xfs/139 | 35 ++-- tests/xfs/139.out | 1 - tests/xfs/140 | 41 ++-- tests/xfs/140.out | 1 - tests/xfs/169 | 86 ++++++++ tests/xfs/169.out | 7 + tests/xfs/179 | 118 +++++++++++ tests/xfs/179.out | 10 + tests/xfs/180 | 106 ++++++++++ tests/xfs/180.out | 11 + tests/xfs/182 | 107 ++++++++++ tests/xfs/182.out | 12 ++ tests/xfs/184 | 105 ++++++++++ tests/xfs/184.out | 10 + tests/xfs/192 | 106 ++++++++++ tests/xfs/192.out | 10 + tests/xfs/193 | 102 +++++++++ tests/xfs/193.out | 10 + tests/xfs/198 | 103 ++++++++++ tests/xfs/198.out | 10 + tests/xfs/200 | 109 ++++++++++ tests/xfs/200.out | 10 + tests/xfs/204 | 110 ++++++++++ tests/xfs/204.out | 10 + tests/xfs/207 | 101 +++++++++ tests/xfs/207.out | 18 ++ tests/xfs/208 | 138 +++++++++++++ tests/xfs/208.out | 13 ++ tests/xfs/209 | 82 ++++++++ tests/xfs/209.out | 13 ++ tests/xfs/210 | 108 ++++++++++ tests/xfs/210.out | 23 +++ tests/xfs/211 | 107 ++++++++++ tests/xfs/211.out | 11 + tests/xfs/212 | 99 +++++++++ tests/xfs/212.out | 13 ++ tests/xfs/213 | 105 ++++++++++ tests/xfs/213.out | 22 ++ tests/xfs/214 | 106 ++++++++++ tests/xfs/214.out | 22 ++ tests/xfs/215 | 102 +++++++++ tests/xfs/215.out | 13 ++ tests/xfs/218 | 101 +++++++++ tests/xfs/218.out | 13 ++ tests/xfs/219 | 102 +++++++++ tests/xfs/219.out | 13 ++ tests/xfs/221 | 101 +++++++++ tests/xfs/221.out | 13 ++ tests/xfs/223 | 104 ++++++++++ tests/xfs/223.out | 13 ++ tests/xfs/224 | 103 ++++++++++ tests/xfs/224.out | 13 ++ tests/xfs/225 | 102 +++++++++ tests/xfs/225.out | 13 ++ tests/xfs/226 | 101 +++++++++ tests/xfs/226.out | 13 ++ tests/xfs/228 | 110 ++++++++++ tests/xfs/228.out | 13 ++ tests/xfs/230 | 110 ++++++++++ tests/xfs/230.out | 13 ++ tests/xfs/231 | 130 ++++++++++++ tests/xfs/231.out | 16 ++ tests/xfs/232 | 132 ++++++++++++ tests/xfs/232.out | 16 ++ tests/xfs/233 | 73 +++++++ tests/xfs/233.out | 5 + tests/xfs/234 | 88 ++++++++ tests/xfs/234.out | 6 + tests/xfs/235 | 108 ++++++++++ tests/xfs/235.out | 14 ++ tests/xfs/236 | 88 ++++++++ tests/xfs/236.out | 7 + tests/xfs/237 | 105 ++++++++++ tests/xfs/237.out | 12 ++ tests/xfs/239 | 98 +++++++++ tests/xfs/239.out | 11 + tests/xfs/240 | 110 ++++++++++ tests/xfs/240.out | 12 ++ tests/xfs/241 | 100 +++++++++ tests/xfs/241.out | 11 + tests/xfs/243 | 165 +++++++++++++++ tests/xfs/243.out | 26 +++ tests/xfs/245 | 95 +++++++++ tests/xfs/245.out | 12 ++ tests/xfs/246 | 65 ++++++ tests/xfs/246.out | 6 + tests/xfs/247 | 57 ++++++ tests/xfs/247.out | 2 + tests/xfs/248 | 91 +++++++++ tests/xfs/248.out | 12 ++ tests/xfs/249 | 92 +++++++++ tests/xfs/249.out | 12 ++ tests/xfs/251 | 93 +++++++++ tests/xfs/251.out | 12 ++ tests/xfs/254 | 94 +++++++++ tests/xfs/254.out | 12 ++ tests/xfs/255 | 93 +++++++++ tests/xfs/255.out | 12 ++ tests/xfs/256 | 94 +++++++++ tests/xfs/256.out | 12 ++ tests/xfs/257 | 95 +++++++++ tests/xfs/257.out | 12 ++ tests/xfs/258 | 96 +++++++++ tests/xfs/258.out | 12 ++ tests/xfs/group | 56 ++++- 352 files changed, 13925 insertions(+), 2729 deletions(-) create mode 100644 src/aio-dio-regress/aiocp.c create mode 100644 src/punch-alternating.c create mode 100755 tests/generic/250 create mode 100644 tests/generic/250.out create mode 100755 tests/generic/252 create mode 100644 tests/generic/252.out create mode 100755 tests/generic/253 create mode 100644 tests/generic/253.out create mode 100755 tests/generic/254 create mode 100644 tests/generic/254.out create mode 100755 tests/generic/259 create mode 100644 tests/generic/259.out create mode 100755 tests/generic/261 create mode 100644 tests/generic/261.out create mode 100755 tests/generic/262 create mode 100644 tests/generic/262.out create mode 100755 tests/generic/264 create mode 100644 tests/generic/264.out create mode 100755 tests/generic/265 create mode 100644 tests/generic/265.out create mode 100755 tests/generic/266 create mode 100644 tests/generic/266.out create mode 100755 tests/generic/267 create mode 100644 tests/generic/267.out create mode 100755 tests/generic/268 create mode 100644 tests/generic/268.out create mode 100755 tests/generic/271 create mode 100644 tests/generic/271.out create mode 100755 tests/generic/272 create mode 100644 tests/generic/272.out create mode 100755 tests/generic/276 create mode 100644 tests/generic/276.out create mode 100755 tests/generic/278 create mode 100644 tests/generic/278.out create mode 100755 tests/generic/279 create mode 100644 tests/generic/279.out create mode 100755 tests/generic/281 create mode 100644 tests/generic/281.out create mode 100755 tests/generic/282 create mode 100644 tests/generic/282.out create mode 100755 tests/generic/283 create mode 100644 tests/generic/283.out create mode 100755 tests/generic/284 create mode 100644 tests/generic/284.out create mode 100755 tests/generic/287 create mode 100644 tests/generic/287.out create mode 100755 tests/generic/289 create mode 100644 tests/generic/289.out create mode 100755 tests/generic/290 create mode 100644 tests/generic/290.out create mode 100755 tests/generic/291 create mode 100644 tests/generic/291.out create mode 100755 tests/generic/292 create mode 100644 tests/generic/292.out create mode 100755 tests/generic/293 create mode 100644 tests/generic/293.out create mode 100755 tests/generic/295 create mode 100644 tests/generic/295.out create mode 100755 tests/generic/296 create mode 100644 tests/generic/296.out create mode 100755 tests/generic/297 create mode 100644 tests/generic/297.out create mode 100755 tests/generic/298 create mode 100644 tests/generic/298.out create mode 100755 tests/generic/301 create mode 100644 tests/generic/301.out create mode 100755 tests/generic/302 create mode 100644 tests/generic/302.out create mode 100755 tests/generic/303 create mode 100644 tests/generic/303.out create mode 100755 tests/generic/304 create mode 100644 tests/generic/304.out create mode 100755 tests/generic/305 create mode 100644 tests/generic/305.out create mode 100755 tests/generic/326 create mode 100644 tests/generic/326.out create mode 100755 tests/generic/327 create mode 100644 tests/generic/327.out create mode 100755 tests/generic/328 create mode 100644 tests/generic/328.out create mode 100755 tests/generic/329 create mode 100644 tests/generic/329.out create mode 100755 tests/generic/330 create mode 100644 tests/generic/330.out create mode 100755 tests/generic/331 create mode 100644 tests/generic/331.out create mode 100755 tests/generic/332 create mode 100644 tests/generic/332.out create mode 100755 tests/generic/333 create mode 100644 tests/generic/333.out create mode 100755 tests/generic/334 create mode 100644 tests/generic/334.out create mode 100755 tests/xfs/169 create mode 100644 tests/xfs/169.out create mode 100755 tests/xfs/179 create mode 100644 tests/xfs/179.out create mode 100755 tests/xfs/180 create mode 100644 tests/xfs/180.out create mode 100755 tests/xfs/182 create mode 100644 tests/xfs/182.out create mode 100755 tests/xfs/184 create mode 100644 tests/xfs/184.out create mode 100755 tests/xfs/192 create mode 100644 tests/xfs/192.out create mode 100755 tests/xfs/193 create mode 100644 tests/xfs/193.out create mode 100755 tests/xfs/198 create mode 100644 tests/xfs/198.out create mode 100755 tests/xfs/200 create mode 100644 tests/xfs/200.out create mode 100755 tests/xfs/204 create mode 100644 tests/xfs/204.out create mode 100755 tests/xfs/207 create mode 100644 tests/xfs/207.out create mode 100755 tests/xfs/208 create mode 100644 tests/xfs/208.out create mode 100755 tests/xfs/209 create mode 100644 tests/xfs/209.out create mode 100755 tests/xfs/210 create mode 100644 tests/xfs/210.out create mode 100755 tests/xfs/211 create mode 100644 tests/xfs/211.out create mode 100755 tests/xfs/212 create mode 100644 tests/xfs/212.out create mode 100755 tests/xfs/213 create mode 100644 tests/xfs/213.out create mode 100755 tests/xfs/214 create mode 100644 tests/xfs/214.out create mode 100755 tests/xfs/215 create mode 100644 tests/xfs/215.out create mode 100755 tests/xfs/218 create mode 100644 tests/xfs/218.out create mode 100755 tests/xfs/219 create mode 100644 tests/xfs/219.out create mode 100755 tests/xfs/221 create mode 100644 tests/xfs/221.out create mode 100755 tests/xfs/223 create mode 100644 tests/xfs/223.out create mode 100755 tests/xfs/224 create mode 100644 tests/xfs/224.out create mode 100755 tests/xfs/225 create mode 100644 tests/xfs/225.out create mode 100755 tests/xfs/226 create mode 100644 tests/xfs/226.out create mode 100755 tests/xfs/228 create mode 100644 tests/xfs/228.out create mode 100755 tests/xfs/230 create mode 100644 tests/xfs/230.out create mode 100755 tests/xfs/231 create mode 100644 tests/xfs/231.out create mode 100755 tests/xfs/232 create mode 100644 tests/xfs/232.out create mode 100755 tests/xfs/233 create mode 100644 tests/xfs/233.out create mode 100755 tests/xfs/234 create mode 100644 tests/xfs/234.out create mode 100755 tests/xfs/235 create mode 100644 tests/xfs/235.out create mode 100755 tests/xfs/236 create mode 100644 tests/xfs/236.out create mode 100755 tests/xfs/237 create mode 100644 tests/xfs/237.out create mode 100755 tests/xfs/239 create mode 100644 tests/xfs/239.out create mode 100755 tests/xfs/240 create mode 100644 tests/xfs/240.out create mode 100755 tests/xfs/241 create mode 100644 tests/xfs/241.out create mode 100755 tests/xfs/243 create mode 100644 tests/xfs/243.out create mode 100755 tests/xfs/245 create mode 100644 tests/xfs/245.out create mode 100755 tests/xfs/246 create mode 100644 tests/xfs/246.out create mode 100755 tests/xfs/247 create mode 100644 tests/xfs/247.out create mode 100755 tests/xfs/248 create mode 100644 tests/xfs/248.out create mode 100755 tests/xfs/249 create mode 100644 tests/xfs/249.out create mode 100755 tests/xfs/251 create mode 100644 tests/xfs/251.out create mode 100755 tests/xfs/254 create mode 100644 tests/xfs/254.out create mode 100755 tests/xfs/255 create mode 100644 tests/xfs/255.out create mode 100755 tests/xfs/256 create mode 100644 tests/xfs/256.out create mode 100755 tests/xfs/257 create mode 100644 tests/xfs/257.out create mode 100755 tests/xfs/258 create mode 100644 tests/xfs/258.out From darrick.wong@oracle.com Thu Feb 11 17:39:36 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay1.corp.sgi.com [137.38.102.111]) by oss.sgi.com (Postfix) with ESMTP id 719307CA9 for ; Thu, 11 Feb 2016 17:39:36 -0600 (CST) Received: from cuda.sgi.com (cuda3.sgi.com [192.48.176.15]) by relay1.corp.sgi.com (Postfix) with ESMTP id 637588F804B for ; Thu, 11 Feb 2016 15:39:33 -0800 (PST) X-ASG-Debug-ID: 1455233971-04cb6c1e5872e90001-NocioJ Received: from userp1040.oracle.com (userp1040.oracle.com [156.151.31.81]) by cuda.sgi.com with ESMTP id C5XlN17JgYkCdLlw (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO) for ; Thu, 11 Feb 2016 15:39:31 -0800 (PST) X-Barracuda-Envelope-From: darrick.wong@oracle.com X-Barracuda-Apparent-Source-IP: 156.151.31.81 Received: from aserv0022.oracle.com (aserv0022.oracle.com [141.146.126.234]) by userp1040.oracle.com (Sentrion-MTA-4.3.2/Sentrion-MTA-4.3.2) with ESMTP id u1BNdRPG031445 (version=TLSv1 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Thu, 11 Feb 2016 23:39:28 GMT Received: from aserv0121.oracle.com (aserv0121.oracle.com [141.146.126.235]) by aserv0022.oracle.com (8.13.8/8.13.8) with ESMTP id u1BNdRCM001859 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=FAIL); Thu, 11 Feb 2016 23:39:27 GMT Received: from abhmp0008.oracle.com (abhmp0008.oracle.com [141.146.116.14]) by aserv0121.oracle.com (8.13.8/8.13.8) with ESMTP id u1BNdQck025874; Thu, 11 Feb 2016 23:39:26 GMT Received: from localhost (/10.145.178.207) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Thu, 11 Feb 2016 15:39:24 -0800 Subject: [PATCH 01/32] generic/182: this is a dedupe test, check for dedupe From: "Darrick J. Wong" X-ASG-Orig-Subj: [PATCH 01/32] generic/182: this is a dedupe test, check for dedupe To: david@fromorbit.com, darrick.wong@oracle.com Cc: linux-btrfs@vger.kernel.org, Christoph Hellwig , fstests@vger.kernel.org, xfs@oss.sgi.com Date: Thu, 11 Feb 2016 15:39:23 -0800 Message-ID: <20160211233923.2202.16359.stgit@birch.djwong.org> In-Reply-To: <20160211233916.2202.40961.stgit@birch.djwong.org> References: <20160211233916.2202.40961.stgit@birch.djwong.org> User-Agent: StGit/0.17.1-dirty MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit X-Source-IP: aserv0022.oracle.com [141.146.126.234] X-Barracuda-Connect: userp1040.oracle.com[156.151.31.81] X-Barracuda-Start-Time: 1455233971 X-Barracuda-Encrypted: ECDHE-RSA-AES256-GCM-SHA384 X-Barracuda-URL: https://192.48.176.15:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-BRTS-Status: 1 X-Barracuda-Spam-Score: 0.60 X-Barracuda-Spam-Status: No, SCORE=0.60 using per-user scores of TAG_LEVEL=1000.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.7 tests=BSF_SC0_MISMATCH_TO, MARKETING_SUBJECT, UNPARSEABLE_RELAY X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.3.26959 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 0.60 MARKETING_SUBJECT Subject contains popular marketing words 0.00 BSF_SC0_MISMATCH_TO Envelope rcpt doesn't match header 0.00 UNPARSEABLE_RELAY Informational: message has unparseable relay lines Since this test examines dedupe behavior, the documentation should say 'dedupe', not 'reflink'. Furthermore, the feature checks must look for working dedupe functionality, not reflink functionality. Signed-off-by: Darrick J. Wong [hch@lst.de: add the test for dedupe support] Signed-off-by: Christoph Hellwig --- tests/generic/182 | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/tests/generic/182 b/tests/generic/182 index bf5cd38..ef10af8 100755 --- a/tests/generic/182 +++ b/tests/generic/182 @@ -1,10 +1,10 @@ #! /bin/bash # FS QA Test No. 182 # -# Test the convention that reflink with length == 0 means "to the end of fileA" +# Test the convention that dedupe with length == 0 means "to the end of fileA" # - Create a file. -# - Try to reflink "zero" bytes (which means reflink to EOF). -# - Check that the reflink happened. +# - Try to dedupe "zero" bytes (which means dedupe to EOF). +# - Check that the dedupe happened. # #----------------------------------------------------------------------- # Copyright (c) 2015, Oracle and/or its affiliates. All Rights Reserved. @@ -45,8 +45,7 @@ _cleanup() # real QA test starts here _supported_os Linux -_require_test_reflink -_require_cp_reflink +_require_test_dedupe rm -f "$seqres.full" From darrick.wong@oracle.com Thu Feb 11 17:39:40 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay2.corp.sgi.com [137.38.102.29]) by oss.sgi.com (Postfix) with ESMTP id 341767CAC for ; Thu, 11 Feb 2016 17:39:40 -0600 (CST) Received: from cuda.sgi.com (cuda2.sgi.com [192.48.176.25]) by relay2.corp.sgi.com (Postfix) with ESMTP id 26749304059 for ; Thu, 11 Feb 2016 15:39:37 -0800 (PST) X-ASG-Debug-ID: 1455233975-04cbb0433389fb0001-NocioJ Received: from userp1040.oracle.com (userp1040.oracle.com [156.151.31.81]) by cuda.sgi.com with ESMTP id D330zFLYhaTD871x (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO) for ; Thu, 11 Feb 2016 15:39:35 -0800 (PST) X-Barracuda-Envelope-From: darrick.wong@oracle.com X-Barracuda-Apparent-Source-IP: 156.151.31.81 Received: from aserv0021.oracle.com (aserv0021.oracle.com [141.146.126.233]) by userp1040.oracle.com (Sentrion-MTA-4.3.2/Sentrion-MTA-4.3.2) with ESMTP id u1BNdV4O031492 (version=TLSv1 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Thu, 11 Feb 2016 23:39:32 GMT Received: from aserv0121.oracle.com (aserv0121.oracle.com [141.146.126.235]) by aserv0021.oracle.com (8.13.8/8.13.8) with ESMTP id u1BNdVL1022512 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=FAIL); Thu, 11 Feb 2016 23:39:31 GMT Received: from abhmp0017.oracle.com (abhmp0017.oracle.com [141.146.116.23]) by aserv0121.oracle.com (8.13.8/8.13.8) with ESMTP id u1BNdV3J025897; Thu, 11 Feb 2016 23:39:31 GMT Received: from localhost (/10.145.178.207) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Thu, 11 Feb 2016 15:39:31 -0800 Subject: [PATCH 02/32] xfstests: filter whitespace in 128 and 132 From: "Darrick J. Wong" X-ASG-Orig-Subj: [PATCH 02/32] xfstests: filter whitespace in 128 and 132 To: david@fromorbit.com, darrick.wong@oracle.com Cc: linux-btrfs@vger.kernel.org, Christoph Hellwig , fstests@vger.kernel.org, xfs@oss.sgi.com Date: Thu, 11 Feb 2016 15:39:29 -0800 Message-ID: <20160211233929.2202.11011.stgit@birch.djwong.org> In-Reply-To: <20160211233916.2202.40961.stgit@birch.djwong.org> References: <20160211233916.2202.40961.stgit@birch.djwong.org> User-Agent: StGit/0.17.1-dirty MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit X-Source-IP: aserv0021.oracle.com [141.146.126.233] X-Barracuda-Connect: userp1040.oracle.com[156.151.31.81] X-Barracuda-Start-Time: 1455233975 X-Barracuda-Encrypted: ECDHE-RSA-AES256-GCM-SHA384 X-Barracuda-URL: https://192.48.176.25:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-BRTS-Status: 1 X-Barracuda-Spam-Score: 0.00 X-Barracuda-Spam-Status: No, SCORE=0.00 using per-user scores of TAG_LEVEL=1000.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.7 tests=BSF_SC0_MISMATCH_TO, UNPARSEABLE_RELAY X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.3.26959 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 0.00 BSF_SC0_MISMATCH_TO Envelope rcpt doesn't match header 0.00 UNPARSEABLE_RELAY Informational: message has unparseable relay lines Seems either I have a different lsattr version, or different mount points cause differences in the golden output. Send the lsattr output through the whitespaces filter so that it works everywhere. The lsattr output /does/ change depending on mountpoints. Ick. I'd actually changed it to the long format output because line length in the short format changes every time the flags change. Signed-off-by: Christoph Hellwig [darrick.wong@oracle.com: update changelog] Signed-off-by: Darrick J. Wong --- tests/xfs/128 | 2 +- tests/xfs/128.out | 8 ++++---- tests/xfs/132 | 10 +++++----- tests/xfs/132.out | 40 ++++++++++++++++++++-------------------- 4 files changed, 30 insertions(+), 30 deletions(-) diff --git a/tests/xfs/128 b/tests/xfs/128 index a96291a..c9547fb 100755 --- a/tests/xfs/128 +++ b/tests/xfs/128 @@ -97,7 +97,7 @@ c13=$(_md5_checksum "$testdir/file3") c14=$(_md5_checksum "$testdir/file4") echo "Defragment" -lsattr -l "$testdir/" | _filter_scratch +lsattr -l "$testdir/" | _filter_scratch | _filter_spaces xfs_fsr -v -d "$testdir/file1" >> "$seqres.full" xfs_fsr -v -d "$testdir/file2" >> "$seqres.full" # fsr probably breaks the link xfs_fsr -v -d "$testdir/file3" >> "$seqres.full" # fsr probably breaks the link diff --git a/tests/xfs/128.out b/tests/xfs/128.out index 7e72dcd..0ac06db 100644 --- a/tests/xfs/128.out +++ b/tests/xfs/128.out @@ -11,10 +11,10 @@ c650f1cf6c9f07b22e3e21ec7d49ded5 SCRATCH_MNT/test-128/file2 56ed2f712c91e035adeeb26ed105a982 SCRATCH_MNT/test-128/file3 b81534f439aac5c34ce3ed60a03eba70 SCRATCH_MNT/test-128/file4 Defragment -SCRATCH_MNT/test-128/file1 --- -SCRATCH_MNT/test-128/file2 --- -SCRATCH_MNT/test-128/file3 --- -SCRATCH_MNT/test-128/file4 --- +SCRATCH_MNT/test-128/file1 --- +SCRATCH_MNT/test-128/file2 --- +SCRATCH_MNT/test-128/file3 --- +SCRATCH_MNT/test-128/file4 --- b81534f439aac5c34ce3ed60a03eba70 SCRATCH_MNT/test-128/file1 c650f1cf6c9f07b22e3e21ec7d49ded5 SCRATCH_MNT/test-128/file2 56ed2f712c91e035adeeb26ed105a982 SCRATCH_MNT/test-128/file3 diff --git a/tests/xfs/132 b/tests/xfs/132 index 79a6d57..9c57c3b 100755 --- a/tests/xfs/132 +++ b/tests/xfs/132 @@ -87,32 +87,32 @@ for i in `seq 2 $nr`; do done _test_remount free_blocks1=$(stat -f "$testdir" -c '%f') -lsattr -l $testdir/ | _filter_test_dir +lsattr -l $testdir/ | _filter_test_dir | _filter_spaces echo "funshare part of a file" "$XFS_IO_PROG" -f -c "falloc 0 $((sz / 2))" "$testdir/file2" _test_remount -lsattr -l $testdir/ | _filter_test_dir +lsattr -l $testdir/ | _filter_test_dir | _filter_spaces echo "funshare some of the copies" "$XFS_IO_PROG" -f -c "falloc 0 $sz" "$testdir/file2" "$XFS_IO_PROG" -f -c "falloc 0 $sz" "$testdir/file3" _test_remount free_blocks2=$(stat -f "$testdir" -c '%f') -lsattr -l $testdir/ | _filter_test_dir +lsattr -l $testdir/ | _filter_test_dir | _filter_spaces echo "funshare the rest of the files" "$XFS_IO_PROG" -f -c "falloc 0 $sz" "$testdir/file4" "$XFS_IO_PROG" -f -c "falloc 0 $sz" "$testdir/file1" _test_remount free_blocks3=$(stat -f "$testdir" -c '%f') -lsattr -l $testdir/ | _filter_test_dir +lsattr -l $testdir/ | _filter_test_dir | _filter_spaces echo "Rewrite the original file" _pwrite_byte 0x65 0 $sz "$testdir/file1" >> "$seqres.full" _test_remount free_blocks4=$(stat -f "$testdir" -c '%f') -lsattr -l $testdir/ | _filter_test_dir +lsattr -l $testdir/ | _filter_test_dir | _filter_spaces #echo $free_blocks0 $free_blocks1 $free_blocks2 $free_blocks3 $free_blocks4 _within_tolerance "free blocks after reflinking" $free_blocks1 $((free_blocks0 - blks)) $margin -v diff --git a/tests/xfs/132.out b/tests/xfs/132.out index fd2b7bd..f32db7d 100644 --- a/tests/xfs/132.out +++ b/tests/xfs/132.out @@ -1,30 +1,30 @@ QA output created by 132 Create the original file blocks Create the reflink copies -TEST_DIR/test-132/file1 --- -TEST_DIR/test-132/file2 --- -TEST_DIR/test-132/file3 --- -TEST_DIR/test-132/file4 --- +TEST_DIR/test-132/file1 --- +TEST_DIR/test-132/file2 --- +TEST_DIR/test-132/file3 --- +TEST_DIR/test-132/file4 --- funshare part of a file -TEST_DIR/test-132/file1 --- -TEST_DIR/test-132/file2 --- -TEST_DIR/test-132/file3 --- -TEST_DIR/test-132/file4 --- +TEST_DIR/test-132/file1 --- +TEST_DIR/test-132/file2 --- +TEST_DIR/test-132/file3 --- +TEST_DIR/test-132/file4 --- funshare some of the copies -TEST_DIR/test-132/file1 --- -TEST_DIR/test-132/file2 No_COW -TEST_DIR/test-132/file3 No_COW -TEST_DIR/test-132/file4 --- +TEST_DIR/test-132/file1 --- +TEST_DIR/test-132/file2 No_COW +TEST_DIR/test-132/file3 No_COW +TEST_DIR/test-132/file4 --- funshare the rest of the files -TEST_DIR/test-132/file1 No_COW -TEST_DIR/test-132/file2 No_COW -TEST_DIR/test-132/file3 No_COW -TEST_DIR/test-132/file4 No_COW +TEST_DIR/test-132/file1 No_COW +TEST_DIR/test-132/file2 No_COW +TEST_DIR/test-132/file3 No_COW +TEST_DIR/test-132/file4 No_COW Rewrite the original file -TEST_DIR/test-132/file1 No_COW -TEST_DIR/test-132/file2 No_COW -TEST_DIR/test-132/file3 No_COW -TEST_DIR/test-132/file4 No_COW +TEST_DIR/test-132/file1 No_COW +TEST_DIR/test-132/file2 No_COW +TEST_DIR/test-132/file3 No_COW +TEST_DIR/test-132/file4 No_COW free blocks after reflinking is in range free blocks after nocow'ing some copies is in range free blocks after nocow'ing all copies is in range From darrick.wong@oracle.com Thu Feb 11 17:39:48 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay3.corp.sgi.com [198.149.34.15]) by oss.sgi.com (Postfix) with ESMTP id F0B297CA3 for ; Thu, 11 Feb 2016 17:39:47 -0600 (CST) Received: from cuda.sgi.com (cuda1.sgi.com [192.48.157.11]) by relay3.corp.sgi.com (Postfix) with ESMTP id 9C550AC007 for ; Thu, 11 Feb 2016 15:39:47 -0800 (PST) X-ASG-Debug-ID: 1455233984-04bdf066ec73870001-NocioJ Received: from userp1040.oracle.com (userp1040.oracle.com [156.151.31.81]) by cuda.sgi.com with ESMTP id 67TwIHaZymsNvauo (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO) for ; Thu, 11 Feb 2016 15:39:44 -0800 (PST) X-Barracuda-Envelope-From: darrick.wong@oracle.com X-Barracuda-Apparent-Source-IP: 156.151.31.81 Received: from aserv0021.oracle.com (aserv0021.oracle.com [141.146.126.233]) by userp1040.oracle.com (Sentrion-MTA-4.3.2/Sentrion-MTA-4.3.2) with ESMTP id u1BNdep9031586 (version=TLSv1 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Thu, 11 Feb 2016 23:39:41 GMT Received: from userv0121.oracle.com (userv0121.oracle.com [156.151.31.72]) by aserv0021.oracle.com (8.13.8/8.13.8) with ESMTP id u1BNdelQ022852 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=FAIL); Thu, 11 Feb 2016 23:39:40 GMT Received: from abhmp0007.oracle.com (abhmp0007.oracle.com [141.146.116.13]) by userv0121.oracle.com (8.13.8/8.13.8) with ESMTP id u1BNdc2s005839; Thu, 11 Feb 2016 23:39:38 GMT Received: from localhost (/10.145.178.207) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Thu, 11 Feb 2016 15:39:37 -0800 Subject: [PATCH 03/32] xfstests: make _scratch_mkfs_blocksized usable From: "Darrick J. Wong" X-ASG-Orig-Subj: [PATCH 03/32] xfstests: make _scratch_mkfs_blocksized usable To: david@fromorbit.com, darrick.wong@oracle.com Cc: linux-btrfs@vger.kernel.org, Christoph Hellwig , fstests@vger.kernel.org, xfs@oss.sgi.com Date: Thu, 11 Feb 2016 15:39:36 -0800 Message-ID: <20160211233936.2202.96907.stgit@birch.djwong.org> In-Reply-To: <20160211233916.2202.40961.stgit@birch.djwong.org> References: <20160211233916.2202.40961.stgit@birch.djwong.org> User-Agent: StGit/0.17.1-dirty MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit X-Source-IP: aserv0021.oracle.com [141.146.126.233] X-Barracuda-Connect: userp1040.oracle.com[156.151.31.81] X-Barracuda-Start-Time: 1455233984 X-Barracuda-Encrypted: ECDHE-RSA-AES256-GCM-SHA384 X-Barracuda-URL: https://192.48.157.11:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-BRTS-Status: 1 X-Barracuda-Spam-Score: 0.00 X-Barracuda-Spam-Status: No, SCORE=0.00 using per-user scores of TAG_LEVEL=1000.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.7 tests=BSF_SC0_MISMATCH_TO, UNPARSEABLE_RELAY X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.3.26959 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 0.00 BSF_SC0_MISMATCH_TO Envelope rcpt doesn't match header 0.00 UNPARSEABLE_RELAY Informational: message has unparseable relay lines The default mkfs.xfs options contain -b size=4096, so all tests using _scratch_mkfs_blocksized won't actually run unless those options are changed. As we're trying to specificly test 1k blocks we should always override the default option. v2: Move the function to common/rc Signed-off-by: Christoph Hellwig [darrick.wong@oracle.com: move function to common/rc] Signed-off-by: Darrick J. Wong --- common/rc | 24 ++++++++++++++++++++++++ common/reflink | 30 ------------------------------ 2 files changed, 24 insertions(+), 30 deletions(-) diff --git a/common/rc b/common/rc index b742785..84f794a 100644 --- a/common/rc +++ b/common/rc @@ -881,6 +881,30 @@ _scratch_mkfs_geom() _scratch_mkfs } +# Create fs of certain blocksize on scratch device +# _scratch_mkfs_blocksized blocksize +_scratch_mkfs_blocksized() +{ + blocksize=$1 + + re='^[0-9]+$' + if ! [[ $blocksize =~ $re ]] ; then + _notrun "error: _scratch_mkfs_sized: block size \"$blocksize\" not an integer." + fi + + case $FSTYP in + xfs) + _scratch_mkfs_xfs $MKFS_OPTIONS -b size=$blocksize + ;; + ext2|ext3|ext4|ocfs2) + ${MKFS_PROG}.$FSTYP -F $MKFS_OPTIONS -b $blocksize $SCRATCH_DEV + ;; + *) + _notrun "Filesystem $FSTYP not supported in _scratch_mkfs_blocksized" + ;; + esac +} + _scratch_resvblks() { case $FSTYP in diff --git a/common/reflink b/common/reflink index 8638aba..3d6a8c1 100644 --- a/common/reflink +++ b/common/reflink @@ -187,33 +187,3 @@ _dedupe_range() { "$XFS_IO_PROG" $xfs_io_args -f -c "dedupe $file1 $offset1 $offset2 $len" "$file2" } - -# Create fs of certain blocksize on scratch device -# _scratch_mkfs_blocksized blocksize -_scratch_mkfs_blocksized() -{ - blocksize=$1 - - re='^[0-9]+$' - if ! [[ $blocksize =~ $re ]] ; then - _notrun "error: _scratch_mkfs_sized: block size \"$blocksize\" not an integer." - fi - - case $FSTYP in - xfs) - # don't override MKFS_OPTIONS that set a block size. - echo $MKFS_OPTIONS |egrep -q "b?size=" - if [ $? -eq 0 ]; then - _scratch_mkfs_xfs - else - _scratch_mkfs_xfs -b size=$blocksize - fi - ;; - ext2|ext3|ext4|ocfs2) - ${MKFS_PROG}.$FSTYP -F $MKFS_OPTIONS -b $blocksize $SCRATCH_DEV - ;; - *) - _notrun "Filesystem $FSTYP not supported in _scratch_mkfs_blocksized" - ;; - esac -} From darrick.wong@oracle.com Thu Feb 11 17:39:51 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay3.corp.sgi.com [198.149.34.15]) by oss.sgi.com (Postfix) with ESMTP id 3FBE87CB4 for ; Thu, 11 Feb 2016 17:39:51 -0600 (CST) Received: from cuda.sgi.com (cuda3.sgi.com [192.48.176.15]) by relay3.corp.sgi.com (Postfix) with ESMTP id A4101AC009 for ; Thu, 11 Feb 2016 15:39:50 -0800 (PST) X-ASG-Debug-ID: 1455233986-04cb6c1e5972ea0001-NocioJ Received: from aserp1040.oracle.com (aserp1040.oracle.com [141.146.126.69]) by cuda.sgi.com with ESMTP id z75hRXfgp4B74vNe (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO) for ; Thu, 11 Feb 2016 15:39:46 -0800 (PST) X-Barracuda-Envelope-From: darrick.wong@oracle.com X-Barracuda-Apparent-Source-IP: 141.146.126.69 Received: from userv0021.oracle.com (userv0021.oracle.com [156.151.31.71]) by aserp1040.oracle.com (Sentrion-MTA-4.3.2/Sentrion-MTA-4.3.2) with ESMTP id u1BNdjOQ022441 (version=TLSv1 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Thu, 11 Feb 2016 23:39:45 GMT Received: from userv0122.oracle.com (userv0122.oracle.com [156.151.31.75]) by userv0021.oracle.com (8.13.8/8.13.8) with ESMTP id u1BNdj56009010 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=FAIL); Thu, 11 Feb 2016 23:39:45 GMT Received: from abhmp0019.oracle.com (abhmp0019.oracle.com [141.146.116.25]) by userv0122.oracle.com (8.14.4/8.14.4) with ESMTP id u1BNdiMA029888; Thu, 11 Feb 2016 23:39:44 GMT Received: from localhost (/10.145.178.207) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Thu, 11 Feb 2016 15:39:44 -0800 Subject: [PATCH 04/32] reflink: remove redundant filesystem checks from the end of the tests From: "Darrick J. Wong" X-ASG-Orig-Subj: [PATCH 04/32] reflink: remove redundant filesystem checks from the end of the tests To: david@fromorbit.com, darrick.wong@oracle.com Cc: linux-btrfs@vger.kernel.org, fstests@vger.kernel.org, xfs@oss.sgi.com Date: Thu, 11 Feb 2016 15:39:42 -0800 Message-ID: <20160211233942.2202.55344.stgit@birch.djwong.org> In-Reply-To: <20160211233916.2202.40961.stgit@birch.djwong.org> References: <20160211233916.2202.40961.stgit@birch.djwong.org> User-Agent: StGit/0.17.1-dirty MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit X-Source-IP: userv0021.oracle.com [156.151.31.71] X-Barracuda-Connect: aserp1040.oracle.com[141.146.126.69] X-Barracuda-Start-Time: 1455233986 X-Barracuda-Encrypted: ECDHE-RSA-AES256-GCM-SHA384 X-Barracuda-URL: https://192.48.176.15:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-BRTS-Status: 1 X-Barracuda-Spam-Score: 0.00 X-Barracuda-Spam-Status: No, SCORE=0.00 using per-user scores of TAG_LEVEL=1000.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.7 tests=BSF_SC0_MISMATCH_TO, UNPARSEABLE_RELAY X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.3.26959 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 0.00 BSF_SC0_MISMATCH_TO Envelope rcpt doesn't match header 0.00 UNPARSEABLE_RELAY Informational: message has unparseable relay lines Turns out that check already runs _check_filesystems after each test, so we don't need to do this at the end of each test. Signed-off-by: Darrick J. Wong --- tests/generic/157 | 1 - tests/generic/158 | 1 - tests/generic/161 | 1 - tests/generic/162 | 1 - tests/generic/163 | 1 - tests/generic/164 | 1 - tests/generic/165 | 1 - tests/generic/166 | 1 - tests/generic/167 | 1 - tests/generic/168 | 1 - tests/generic/170 | 1 - tests/generic/171 | 1 - tests/generic/172 | 1 - tests/generic/173 | 1 - tests/generic/174 | 1 - tests/generic/175 | 1 - tests/generic/176 | 1 - tests/generic/183 | 1 - tests/generic/185 | 1 - tests/generic/186 | 1 - tests/generic/187 | 1 - tests/generic/188 | 1 - tests/generic/189 | 1 - tests/generic/190 | 1 - tests/generic/191 | 1 - tests/generic/194 | 1 - tests/generic/195 | 1 - tests/generic/196 | 1 - tests/generic/197 | 1 - tests/generic/199 | 1 - tests/generic/200 | 1 - tests/generic/201 | 1 - tests/generic/202 | 1 - tests/generic/203 | 1 - tests/generic/205 | 1 - tests/generic/206 | 1 - tests/generic/216 | 1 - tests/generic/217 | 1 - tests/generic/218 | 1 - tests/generic/220 | 1 - tests/generic/222 | 1 - tests/generic/227 | 1 - tests/generic/229 | 1 - tests/generic/238 | 1 - tests/generic/242 | 1 - tests/generic/243 | 1 - tests/xfs/127 | 1 - tests/xfs/128 | 1 - tests/xfs/131 | 1 - tests/xfs/139 | 1 - tests/xfs/140 | 1 - 51 files changed, 51 deletions(-) diff --git a/tests/generic/157 b/tests/generic/157 index 0150866..74314d8 100755 --- a/tests/generic/157 +++ b/tests/generic/157 @@ -123,7 +123,6 @@ _reflink_range "$testdir2/file1" 0 "$testdir2/file2" 0 $blksz >> "$seqres.full" echo "Check scratch fs" _scratch_unmount -_check_scratch_fs # success, all done status=0 diff --git a/tests/generic/158 b/tests/generic/158 index 807c247..779d55e 100755 --- a/tests/generic/158 +++ b/tests/generic/158 @@ -124,7 +124,6 @@ _dedupe_range "$testdir2/file1" 0 "$testdir2/file2" 0 $blksz >> "$seqres.full" echo "Check scratch fs" _scratch_unmount -_check_scratch_fs # success, all done status=0 diff --git a/tests/generic/161 b/tests/generic/161 index 7fb8963..b271936 100755 --- a/tests/generic/161 +++ b/tests/generic/161 @@ -71,7 +71,6 @@ wait echo "Check fs" umount "$SCRATCH_MNT" -_check_scratch_fs echo "Done" # success, all done diff --git a/tests/generic/162 b/tests/generic/162 index 2fb947a..30c761b 100755 --- a/tests/generic/162 +++ b/tests/generic/162 @@ -87,7 +87,6 @@ wait echo "Check fs" umount "$SCRATCH_MNT" -_check_scratch_fs echo "Done" # success, all done diff --git a/tests/generic/163 b/tests/generic/163 index 0186443..f2ea334 100755 --- a/tests/generic/163 +++ b/tests/generic/163 @@ -87,7 +87,6 @@ wait echo "Check fs" umount "$SCRATCH_MNT" -_check_scratch_fs echo "Done" # success, all done diff --git a/tests/generic/164 b/tests/generic/164 index 087c6ba..e97ac13 100755 --- a/tests/generic/164 +++ b/tests/generic/164 @@ -97,7 +97,6 @@ wait echo "Check fs" umount "$SCRATCH_MNT" -_check_scratch_fs echo "Done" # success, all done diff --git a/tests/generic/165 b/tests/generic/165 index 6bd15e1..b305079 100755 --- a/tests/generic/165 +++ b/tests/generic/165 @@ -97,7 +97,6 @@ wait echo "Check fs" umount "$SCRATCH_MNT" -_check_scratch_fs echo "Done" # success, all done diff --git a/tests/generic/166 b/tests/generic/166 index 6cfb821..2c2ff4e 100755 --- a/tests/generic/166 +++ b/tests/generic/166 @@ -84,7 +84,6 @@ wait echo "Check for damage" _scratch_unmount -_check_scratch_fs echo "Done" diff --git a/tests/generic/167 b/tests/generic/167 index fc5a86c..b80b481 100755 --- a/tests/generic/167 +++ b/tests/generic/167 @@ -84,7 +84,6 @@ wait echo "Check for damage" _scratch_unmount -_check_scratch_fs echo "Done" diff --git a/tests/generic/168 b/tests/generic/168 index ee3848d..0d620da 100755 --- a/tests/generic/168 +++ b/tests/generic/168 @@ -88,7 +88,6 @@ wait echo "Check for damage" umount "$SCRATCH_MNT" -_check_scratch_fs echo "Done" diff --git a/tests/generic/170 b/tests/generic/170 index 6d27810..78ed63d 100755 --- a/tests/generic/170 +++ b/tests/generic/170 @@ -88,7 +88,6 @@ wait echo "Check for damage" umount "$SCRATCH_MNT" -_check_scratch_fs echo "Done" diff --git a/tests/generic/171 b/tests/generic/171 index ec3729d..4b4f141 100755 --- a/tests/generic/171 +++ b/tests/generic/171 @@ -100,7 +100,6 @@ echo "${out}" echo "Check scratch fs" umount "$SCRATCH_MNT" -_check_scratch_fs # success, all done status=0 diff --git a/tests/generic/172 b/tests/generic/172 index 1988c8d..98eb97f 100755 --- a/tests/generic/172 +++ b/tests/generic/172 @@ -100,7 +100,6 @@ echo "${out}" echo "Check scratch fs" umount "$SCRATCH_MNT" -_check_scratch_fs # success, all done status=0 diff --git a/tests/generic/173 b/tests/generic/173 index 5bb9ce6..e26f5a9 100755 --- a/tests/generic/173 +++ b/tests/generic/173 @@ -102,7 +102,6 @@ fi echo "Check scratch fs" umount "$SCRATCH_MNT" -_check_scratch_fs # success, all done status=0 diff --git a/tests/generic/174 b/tests/generic/174 index a8e0bb5..1749a1c 100755 --- a/tests/generic/174 +++ b/tests/generic/174 @@ -100,7 +100,6 @@ echo "${out}" echo "Check scratch fs" umount "$SCRATCH_MNT" -_check_scratch_fs # success, all done status=0 diff --git a/tests/generic/175 b/tests/generic/175 index b37ff66..ac2f54f 100755 --- a/tests/generic/175 +++ b/tests/generic/175 @@ -92,7 +92,6 @@ _check_scratch_fs echo "Remove all files and recheck" _scratch_mount >> "$seqres.full" 2>&1 umount "$SCRATCH_MNT" -_check_scratch_fs # success, all done status=0 diff --git a/tests/generic/176 b/tests/generic/176 index 0ca0b17..e32f94f 100755 --- a/tests/generic/176 +++ b/tests/generic/176 @@ -74,7 +74,6 @@ done echo "Check scratch fs" umount "$SCRATCH_MNT" -_check_scratch_fs # success, all done status=0 diff --git a/tests/generic/183 b/tests/generic/183 index 8141f38..27179fd 100755 --- a/tests/generic/183 +++ b/tests/generic/183 @@ -94,7 +94,6 @@ md5sum "$testdir/file3.chk" | _filter_scratch echo "Check for damage" umount "$SCRATCH_MNT" -_check_scratch_fs # success, all done status=0 diff --git a/tests/generic/185 b/tests/generic/185 index 1d6dff2..368260d 100755 --- a/tests/generic/185 +++ b/tests/generic/185 @@ -94,7 +94,6 @@ md5sum "$testdir/file3.chk" | _filter_scratch echo "Check for damage" umount "$SCRATCH_MNT" -_check_scratch_fs # success, all done status=0 diff --git a/tests/generic/186 b/tests/generic/186 index 9aac966..67e52b5 100755 --- a/tests/generic/186 +++ b/tests/generic/186 @@ -139,7 +139,6 @@ md5sum "$testdir/file3.chk" | _filter_scratch echo "Check for damage" umount "$SCRATCH_MNT" -_check_scratch_fs # success, all done status=0 diff --git a/tests/generic/187 b/tests/generic/187 index b3f1542..c993394 100755 --- a/tests/generic/187 +++ b/tests/generic/187 @@ -139,7 +139,6 @@ md5sum "$testdir/file3.chk" | _filter_scratch echo "Check for damage" umount "$SCRATCH_MNT" -_check_scratch_fs # success, all done status=0 diff --git a/tests/generic/188 b/tests/generic/188 index c67b847..9e63388 100755 --- a/tests/generic/188 +++ b/tests/generic/188 @@ -89,7 +89,6 @@ md5sum "$testdir/file3.chk" | _filter_scratch echo "Check for damage" umount "$SCRATCH_MNT" -_check_scratch_fs # success, all done status=0 diff --git a/tests/generic/189 b/tests/generic/189 index 1954235..661129c 100755 --- a/tests/generic/189 +++ b/tests/generic/189 @@ -89,7 +89,6 @@ md5sum "$testdir/file3.chk" | _filter_scratch echo "Check for damage" umount "$SCRATCH_MNT" -_check_scratch_fs # success, all done status=0 diff --git a/tests/generic/190 b/tests/generic/190 index d3d573b..4e272c2 100755 --- a/tests/generic/190 +++ b/tests/generic/190 @@ -89,7 +89,6 @@ md5sum "$testdir/file3.chk" | _filter_scratch echo "Check for damage" umount "$SCRATCH_MNT" -_check_scratch_fs # success, all done status=0 diff --git a/tests/generic/191 b/tests/generic/191 index 8b19084..5aadded 100755 --- a/tests/generic/191 +++ b/tests/generic/191 @@ -89,7 +89,6 @@ md5sum "$testdir/file3.chk" | _filter_scratch echo "Check for damage" umount "$SCRATCH_MNT" -_check_scratch_fs # success, all done status=0 diff --git a/tests/generic/194 b/tests/generic/194 index 1fc2cd7..a17debc 100755 --- a/tests/generic/194 +++ b/tests/generic/194 @@ -94,7 +94,6 @@ md5sum "$testdir/file3.chk" | _filter_scratch echo "Check for damage" umount "$SCRATCH_MNT" -_check_scratch_fs # success, all done status=0 diff --git a/tests/generic/195 b/tests/generic/195 index 087275c..f49d0c2 100755 --- a/tests/generic/195 +++ b/tests/generic/195 @@ -94,7 +94,6 @@ md5sum "$testdir/file3.chk" | _filter_scratch echo "Check for damage" umount "$SCRATCH_MNT" -_check_scratch_fs # success, all done status=0 diff --git a/tests/generic/196 b/tests/generic/196 index d815232..4da9c76 100755 --- a/tests/generic/196 +++ b/tests/generic/196 @@ -89,7 +89,6 @@ md5sum "$testdir/file3.chk" | _filter_scratch echo "Check for damage" umount "$SCRATCH_MNT" -_check_scratch_fs # success, all done status=0 diff --git a/tests/generic/197 b/tests/generic/197 index 54005ae..54ee5ab 100755 --- a/tests/generic/197 +++ b/tests/generic/197 @@ -89,7 +89,6 @@ md5sum "$testdir/file3.chk" | _filter_scratch echo "Check for damage" umount "$SCRATCH_MNT" -_check_scratch_fs # success, all done status=0 diff --git a/tests/generic/199 b/tests/generic/199 index eb567e4..5e4bca8 100755 --- a/tests/generic/199 +++ b/tests/generic/199 @@ -118,7 +118,6 @@ md5sum "$testdir/file3.chk" | _filter_scratch echo "Check for damage" umount "$SCRATCH_MNT" -_check_scratch_fs # success, all done status=0 diff --git a/tests/generic/200 b/tests/generic/200 index 991fed0..f0521ae 100755 --- a/tests/generic/200 +++ b/tests/generic/200 @@ -118,7 +118,6 @@ md5sum "$testdir/file3.chk" | _filter_scratch echo "Check for damage" umount "$SCRATCH_MNT" -_check_scratch_fs # success, all done status=0 diff --git a/tests/generic/201 b/tests/generic/201 index ffc1ce4..db77a5e 100755 --- a/tests/generic/201 +++ b/tests/generic/201 @@ -79,7 +79,6 @@ rm "$testdir/file3" echo "Check for damage" umount "$SCRATCH_MNT" -_check_scratch_fs # success, all done status=0 diff --git a/tests/generic/202 b/tests/generic/202 index 375b65f..91f2d9b 100755 --- a/tests/generic/202 +++ b/tests/generic/202 @@ -79,7 +79,6 @@ md5sum "$testdir/file2.chk" | _filter_scratch echo "Check for damage" umount "$SCRATCH_MNT" -_check_scratch_fs # success, all done status=0 diff --git a/tests/generic/203 b/tests/generic/203 index 549f2ba..86a672b 100755 --- a/tests/generic/203 +++ b/tests/generic/203 @@ -79,7 +79,6 @@ md5sum "$testdir/file2.chk" | _filter_scratch echo "Check for damage" umount "$SCRATCH_MNT" -_check_scratch_fs # success, all done status=0 diff --git a/tests/generic/205 b/tests/generic/205 index 8f0ec45..8fed955 100755 --- a/tests/generic/205 +++ b/tests/generic/205 @@ -95,7 +95,6 @@ cmp -s "$testdir/file2" "$testdir/file2.chk" || _fail "file2 and file2.chk don't echo "Check for damage" umount "$SCRATCH_MNT" -_check_scratch_fs # success, all done status=0 diff --git a/tests/generic/206 b/tests/generic/206 index f2c4ecc..10b5285 100755 --- a/tests/generic/206 +++ b/tests/generic/206 @@ -95,7 +95,6 @@ cmp -s "$testdir/file2" "$testdir/file2.chk" || _fail "file2 and file2.chk don't echo "Check for damage" umount "$SCRATCH_MNT" -_check_scratch_fs # success, all done status=0 diff --git a/tests/generic/216 b/tests/generic/216 index 3789cb0..671f0c1 100755 --- a/tests/generic/216 +++ b/tests/generic/216 @@ -96,7 +96,6 @@ cmp -s "$testdir/file2" "$testdir/file2.chk" || _fail "file2 and file2.chk don't echo "Check for damage" umount "$SCRATCH_MNT" -_check_scratch_fs # success, all done status=0 diff --git a/tests/generic/217 b/tests/generic/217 index 4ae603f..e4d40c7 100755 --- a/tests/generic/217 +++ b/tests/generic/217 @@ -96,7 +96,6 @@ cmp -s "$testdir/file2" "$testdir/file2.chk" || _fail "file2 and file2.chk don't echo "Check for damage" umount "$SCRATCH_MNT" -_check_scratch_fs # success, all done status=0 diff --git a/tests/generic/218 b/tests/generic/218 index d63c06f..eb52fea 100755 --- a/tests/generic/218 +++ b/tests/generic/218 @@ -90,7 +90,6 @@ cmp -s "$testdir/file2" "$testdir/file2.chk" || _fail "file2 and file2.chk don't echo "Check for damage" umount "$SCRATCH_MNT" -_check_scratch_fs # success, all done status=0 diff --git a/tests/generic/220 b/tests/generic/220 index ccdb32e..fb5ecda 100755 --- a/tests/generic/220 +++ b/tests/generic/220 @@ -90,7 +90,6 @@ cmp -s "$testdir/file2" "$testdir/file2.chk" || _fail "file2 and file2.chk don't echo "Check for damage" umount "$SCRATCH_MNT" -_check_scratch_fs # success, all done status=0 diff --git a/tests/generic/222 b/tests/generic/222 index cb5a788..ab3f65f 100755 --- a/tests/generic/222 +++ b/tests/generic/222 @@ -96,7 +96,6 @@ cmp -s "$testdir/file2" "$testdir/file2.chk" || _fail "file2 and file2.chk don't echo "Check for damage" umount "$SCRATCH_MNT" -_check_scratch_fs # success, all done status=0 diff --git a/tests/generic/227 b/tests/generic/227 index d200424..387c714 100755 --- a/tests/generic/227 +++ b/tests/generic/227 @@ -96,7 +96,6 @@ cmp -s "$testdir/file2" "$testdir/file2.chk" || _fail "file2 and file2.chk don't echo "Check for damage" umount "$SCRATCH_MNT" -_check_scratch_fs # success, all done status=0 diff --git a/tests/generic/229 b/tests/generic/229 index cdaddaf..eb105a3 100755 --- a/tests/generic/229 +++ b/tests/generic/229 @@ -156,7 +156,6 @@ runtest delalloc regular "$testdir/d-r" echo "Check for damage" umount "$SCRATCH_MNT" -_check_scratch_fs # success, all done status=0 diff --git a/tests/generic/238 b/tests/generic/238 index 98530e0..02057ad 100755 --- a/tests/generic/238 +++ b/tests/generic/238 @@ -156,7 +156,6 @@ runtest delalloc regular "$testdir/d-r" echo "Check for damage" umount "$SCRATCH_MNT" -_check_scratch_fs # success, all done status=0 diff --git a/tests/generic/242 b/tests/generic/242 index a5a17c3..3023ac7 100755 --- a/tests/generic/242 +++ b/tests/generic/242 @@ -92,7 +92,6 @@ md5sum "$testdir/file2.chk" | _filter_scratch echo "Check for damage" umount "$SCRATCH_MNT" -_check_scratch_fs # success, all done status=0 diff --git a/tests/generic/243 b/tests/generic/243 index b7ca466..e65347f 100755 --- a/tests/generic/243 +++ b/tests/generic/243 @@ -92,7 +92,6 @@ md5sum "$testdir/file2.chk" | _filter_scratch echo "Check for damage" umount "$SCRATCH_MNT" -_check_scratch_fs # success, all done status=0 diff --git a/tests/xfs/127 b/tests/xfs/127 index c31cd17..63d5890 100755 --- a/tests/xfs/127 +++ b/tests/xfs/127 @@ -72,7 +72,6 @@ xfs_info "$SCRATCH_MNT" >> "$seqres.full" echo "Check scratch fs" umount "$SCRATCH_MNT" -_check_scratch_fs # success, all done status=0 diff --git a/tests/xfs/128 b/tests/xfs/128 index c9547fb..2e1da3f 100755 --- a/tests/xfs/128 +++ b/tests/xfs/128 @@ -142,7 +142,6 @@ _within_tolerance "free blocks after all tests" $free_blocks3 $((free_blocks0 - echo "Check scratch fs" umount "$SCRATCH_MNT" -_check_scratch_fs # success, all done status=0 diff --git a/tests/xfs/131 b/tests/xfs/131 index 8442821..adab31f 100755 --- a/tests/xfs/131 +++ b/tests/xfs/131 @@ -69,7 +69,6 @@ test -s "$testdir/file2" && _fail "Should not be able to reflink a realtime file echo "Check restored fs" umount "$SCRATCH_MNT" -_check_scratch_fs # success, all done status=0 diff --git a/tests/xfs/139 b/tests/xfs/139 index 51c903e..feb55bd 100755 --- a/tests/xfs/139 +++ b/tests/xfs/139 @@ -75,7 +75,6 @@ md5sum "$testdir/file2" | _filter_scratch echo "Check scratch fs" umount "$SCRATCH_MNT" -_check_scratch_fs # success, all done status=0 diff --git a/tests/xfs/140 b/tests/xfs/140 index 133bb72..309b284 100644 --- a/tests/xfs/140 +++ b/tests/xfs/140 @@ -82,7 +82,6 @@ cmp -s "$testdir/file2" "$testdir/file2.chk" || echo "file2 and file2.chk do not echo "Check scratch fs" umount "$SCRATCH_MNT" -_check_scratch_fs # success, all done status=0 From darrick.wong@oracle.com Thu Feb 11 17:39:58 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay1.corp.sgi.com [137.38.102.111]) by oss.sgi.com (Postfix) with ESMTP id 0F37D7CA3 for ; Thu, 11 Feb 2016 17:39:58 -0600 (CST) Received: from cuda.sgi.com (cuda2.sgi.com [192.48.176.25]) by relay1.corp.sgi.com (Postfix) with ESMTP id F23048F8052 for ; Thu, 11 Feb 2016 15:39:57 -0800 (PST) X-ASG-Debug-ID: 1455233992-04cbb0433389fc0001-NocioJ Received: from aserp1040.oracle.com (aserp1040.oracle.com [141.146.126.69]) by cuda.sgi.com with ESMTP id To1ZcK6X4GqvyG6d (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO) for ; Thu, 11 Feb 2016 15:39:52 -0800 (PST) X-Barracuda-Envelope-From: darrick.wong@oracle.com X-Barracuda-Apparent-Source-IP: 141.146.126.69 Received: from aserv0021.oracle.com (aserv0021.oracle.com [141.146.126.233]) by aserp1040.oracle.com (Sentrion-MTA-4.3.2/Sentrion-MTA-4.3.2) with ESMTP id u1BNdpmP022488 (version=TLSv1 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Thu, 11 Feb 2016 23:39:51 GMT Received: from aserv0122.oracle.com (aserv0122.oracle.com [141.146.126.236]) by aserv0021.oracle.com (8.13.8/8.13.8) with ESMTP id u1BNdpba023376 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=FAIL); Thu, 11 Feb 2016 23:39:51 GMT Received: from abhmp0008.oracle.com (abhmp0008.oracle.com [141.146.116.14]) by aserv0122.oracle.com (8.13.8/8.13.8) with ESMTP id u1BNdpD9026740; Thu, 11 Feb 2016 23:39:51 GMT Received: from localhost (/10.145.178.207) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Thu, 11 Feb 2016 15:39:50 -0800 Subject: [PATCH 05/32] reflink: remove unnecessary umounts from test code From: "Darrick J. Wong" X-ASG-Orig-Subj: [PATCH 05/32] reflink: remove unnecessary umounts from test code To: david@fromorbit.com, darrick.wong@oracle.com Cc: linux-btrfs@vger.kernel.org, fstests@vger.kernel.org, xfs@oss.sgi.com Date: Thu, 11 Feb 2016 15:39:49 -0800 Message-ID: <20160211233949.2202.99446.stgit@birch.djwong.org> In-Reply-To: <20160211233916.2202.40961.stgit@birch.djwong.org> References: <20160211233916.2202.40961.stgit@birch.djwong.org> User-Agent: StGit/0.17.1-dirty MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit X-Source-IP: aserv0021.oracle.com [141.146.126.233] X-Barracuda-Connect: aserp1040.oracle.com[141.146.126.69] X-Barracuda-Start-Time: 1455233992 X-Barracuda-Encrypted: ECDHE-RSA-AES256-GCM-SHA384 X-Barracuda-URL: https://192.48.176.25:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-BRTS-Status: 1 X-Barracuda-Spam-Score: 0.00 X-Barracuda-Spam-Status: No, SCORE=0.00 using per-user scores of TAG_LEVEL=1000.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.7 tests=BSF_SC0_MISMATCH_TO, UNPARSEABLE_RELAY X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.3.26959 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 0.00 BSF_SC0_MISMATCH_TO Envelope rcpt doesn't match header 0.00 UNPARSEABLE_RELAY Informational: message has unparseable relay lines The test harness already takes care of this, so get rid of it. Signed-off-by: Darrick J. Wong --- tests/generic/157 | 3 --- tests/generic/157.out | 1 - tests/generic/158 | 3 --- tests/generic/158.out | 1 - tests/generic/161 | 4 ---- tests/generic/161.out | 2 -- tests/generic/162 | 4 ---- tests/generic/162.out | 2 -- tests/generic/163 | 4 ---- tests/generic/163.out | 2 -- tests/generic/164 | 4 ---- tests/generic/164.out | 2 -- tests/generic/165 | 4 ---- tests/generic/165.out | 2 -- tests/generic/166 | 5 ----- tests/generic/166.out | 2 -- tests/generic/167 | 5 ----- tests/generic/167.out | 2 -- tests/generic/168 | 5 ----- tests/generic/168.out | 2 -- tests/generic/170 | 5 ----- tests/generic/170.out | 2 -- tests/generic/171 | 6 ------ tests/generic/171.out | 1 - tests/generic/172 | 6 ------ tests/generic/172.out | 1 - tests/generic/173 | 6 ------ tests/generic/173.out | 1 - tests/generic/174 | 6 ------ tests/generic/174.out | 1 - tests/generic/183 | 3 --- tests/generic/183.out | 1 - tests/generic/185 | 3 --- tests/generic/185.out | 1 - tests/generic/186 | 3 --- tests/generic/186.out | 1 - tests/generic/187 | 3 --- tests/generic/187.out | 1 - tests/generic/188 | 3 --- tests/generic/188.out | 1 - tests/generic/189 | 3 --- tests/generic/189.out | 1 - tests/generic/190 | 3 --- tests/generic/190.out | 1 - tests/generic/191 | 3 --- tests/generic/191.out | 1 - tests/generic/194 | 3 --- tests/generic/194.out | 1 - tests/generic/195 | 3 --- tests/generic/195.out | 1 - tests/generic/196 | 3 --- tests/generic/196.out | 1 - tests/generic/197 | 3 --- tests/generic/197.out | 1 - tests/generic/199 | 3 --- tests/generic/199.out | 1 - tests/generic/200 | 3 --- tests/generic/200.out | 1 - tests/generic/201 | 3 --- tests/generic/201.out | 1 - tests/generic/202 | 3 --- tests/generic/202.out | 1 - tests/generic/203 | 3 --- tests/generic/203.out | 1 - tests/generic/205 | 3 --- tests/generic/205.out | 1 - tests/generic/206 | 3 --- tests/generic/206.out | 1 - tests/generic/216 | 3 --- tests/generic/216.out | 1 - tests/generic/217 | 3 --- tests/generic/217.out | 1 - tests/generic/218 | 3 --- tests/generic/218.out | 1 - tests/generic/220 | 3 --- tests/generic/220.out | 1 - tests/generic/222 | 3 --- tests/generic/222.out | 1 - tests/generic/227 | 3 --- tests/generic/227.out | 1 - tests/generic/229 | 3 --- tests/generic/229.out | 1 - tests/generic/238 | 3 --- tests/generic/238.out | 1 - tests/generic/242 | 3 --- tests/generic/242.out | 1 - tests/generic/243 | 3 --- tests/generic/243.out | 1 - tests/xfs/127 | 3 --- tests/xfs/127.out | 1 - tests/xfs/128 | 3 --- tests/xfs/128.out | 1 - tests/xfs/131 | 3 --- tests/xfs/131.out | 1 - tests/xfs/139 | 3 --- tests/xfs/139.out | 1 - tests/xfs/140 | 3 --- tests/xfs/140.out | 1 - 98 files changed, 230 deletions(-) diff --git a/tests/generic/157 b/tests/generic/157 index 74314d8..19a9a18 100755 --- a/tests/generic/157 +++ b/tests/generic/157 @@ -121,9 +121,6 @@ echo "Reflink two files" _reflink_range "$testdir1/file1" 0 "$testdir1/file2" 0 $blksz >> "$seqres.full" _reflink_range "$testdir2/file1" 0 "$testdir2/file2" 0 $blksz >> "$seqres.full" -echo "Check scratch fs" -_scratch_unmount - # success, all done status=0 exit diff --git a/tests/generic/157.out b/tests/generic/157.out index ac3c440..d4f64b4 100644 --- a/tests/generic/157.out +++ b/tests/generic/157.out @@ -22,4 +22,3 @@ XFS_IOC_CLONE_RANGE: Invalid argument Try to reflink an append-only file XFS_IOC_CLONE_RANGE: Bad file descriptor Reflink two files -Check scratch fs diff --git a/tests/generic/158 b/tests/generic/158 index 779d55e..4b51973 100755 --- a/tests/generic/158 +++ b/tests/generic/158 @@ -122,9 +122,6 @@ echo "Dedupe two files" _dedupe_range "$testdir1/file1" 0 "$testdir1/file2" 0 $blksz >> "$seqres.full" _dedupe_range "$testdir2/file1" 0 "$testdir2/file2" 0 $blksz >> "$seqres.full" -echo "Check scratch fs" -_scratch_unmount - # success, all done status=0 exit diff --git a/tests/generic/158.out b/tests/generic/158.out index dff3692..7f88403 100644 --- a/tests/generic/158.out +++ b/tests/generic/158.out @@ -21,4 +21,3 @@ Try to dedupe to a fifo dedupe: Invalid argument Try to dedupe an append-only file Dedupe two files -Check scratch fs diff --git a/tests/generic/161 b/tests/generic/161 index b271936..1d5364e 100755 --- a/tests/generic/161 +++ b/tests/generic/161 @@ -69,10 +69,6 @@ rm -rf "$testdir/file1" & _pwrite_byte 0x62 0 $((loops * blksz)) "$testdir/file1" >> "$seqres.full" wait -echo "Check fs" -umount "$SCRATCH_MNT" - -echo "Done" # success, all done status=0 exit diff --git a/tests/generic/161.out b/tests/generic/161.out index 1db11c3..34cb6f2 100644 --- a/tests/generic/161.out +++ b/tests/generic/161.out @@ -2,5 +2,3 @@ QA output created by 161 Format and mount Initialize files Delete while rewriting -Check fs -Done diff --git a/tests/generic/162 b/tests/generic/162 index 30c761b..9044545 100755 --- a/tests/generic/162 +++ b/tests/generic/162 @@ -85,10 +85,6 @@ echo "Finished dedupeing" touch "$testdir/finished" wait -echo "Check fs" -umount "$SCRATCH_MNT" - -echo "Done" # success, all done status=0 exit diff --git a/tests/generic/162.out b/tests/generic/162.out index 4481f8c..e57db12 100644 --- a/tests/generic/162.out +++ b/tests/generic/162.out @@ -3,5 +3,3 @@ Format and mount Initialize files Dedupe and rewrite the file! Finished dedupeing -Check fs -Done diff --git a/tests/generic/163 b/tests/generic/163 index f2ea334..651d445 100755 --- a/tests/generic/163 +++ b/tests/generic/163 @@ -85,10 +85,6 @@ echo "Finished dedupeing" touch "$testdir/finished" wait -echo "Check fs" -umount "$SCRATCH_MNT" - -echo "Done" # success, all done status=0 exit diff --git a/tests/generic/163.out b/tests/generic/163.out index 2d27d1b..604e53b 100644 --- a/tests/generic/163.out +++ b/tests/generic/163.out @@ -3,5 +3,3 @@ Format and mount Initialize files Dedupe and rewrite the file! Finished dedupeing -Check fs -Done diff --git a/tests/generic/164 b/tests/generic/164 index e97ac13..6c19c7d 100755 --- a/tests/generic/164 +++ b/tests/generic/164 @@ -95,10 +95,6 @@ echo "Finished reflinking" touch "$testdir/finished" wait -echo "Check fs" -umount "$SCRATCH_MNT" - -echo "Done" # success, all done status=0 exit diff --git a/tests/generic/164.out b/tests/generic/164.out index 0b4ed70..f4ff869 100644 --- a/tests/generic/164.out +++ b/tests/generic/164.out @@ -3,5 +3,3 @@ Format and mount Initialize files Reflink and reread the files! Finished reflinking -Check fs -Done diff --git a/tests/generic/165 b/tests/generic/165 index b305079..2e380a9 100755 --- a/tests/generic/165 +++ b/tests/generic/165 @@ -95,10 +95,6 @@ echo "Finished reflinking" touch "$testdir/finished" wait -echo "Check fs" -umount "$SCRATCH_MNT" - -echo "Done" # success, all done status=0 exit diff --git a/tests/generic/165.out b/tests/generic/165.out index a89071d..31e9bef 100644 --- a/tests/generic/165.out +++ b/tests/generic/165.out @@ -3,5 +3,3 @@ Format and mount Initialize files Reflink and dio reread the files! Finished reflinking -Check fs -Done diff --git a/tests/generic/166 b/tests/generic/166 index 2c2ff4e..028ee11 100755 --- a/tests/generic/166 +++ b/tests/generic/166 @@ -82,11 +82,6 @@ done touch $testdir/finished wait -echo "Check for damage" -_scratch_unmount - -echo "Done" - # success, all done status=0 exit diff --git a/tests/generic/166.out b/tests/generic/166.out index a2ba34e..8cb81a0 100644 --- a/tests/generic/166.out +++ b/tests/generic/166.out @@ -2,5 +2,3 @@ QA output created by 166 Format and mount Initialize file Snapshot a file undergoing directio rewrite -Check for damage -Done diff --git a/tests/generic/167 b/tests/generic/167 index b80b481..a4bf4f4 100755 --- a/tests/generic/167 +++ b/tests/generic/167 @@ -82,11 +82,6 @@ done touch $testdir/finished wait -echo "Check for damage" -_scratch_unmount - -echo "Done" - # success, all done status=0 exit diff --git a/tests/generic/167.out b/tests/generic/167.out index 7cfb14e..a0e90b1 100644 --- a/tests/generic/167.out +++ b/tests/generic/167.out @@ -2,5 +2,3 @@ QA output created by 167 Format and mount Initialize file Snapshot a file undergoing buffered rewrite -Check for damage -Done diff --git a/tests/generic/168 b/tests/generic/168 index 0d620da..2ffc5b6 100755 --- a/tests/generic/168 +++ b/tests/generic/168 @@ -86,11 +86,6 @@ done touch "$testdir/finished" wait -echo "Check for damage" -umount "$SCRATCH_MNT" - -echo "Done" - # success, all done status=0 exit diff --git a/tests/generic/168.out b/tests/generic/168.out index d0dd08e..2687e7c 100644 --- a/tests/generic/168.out +++ b/tests/generic/168.out @@ -2,5 +2,3 @@ QA output created by 168 Format and mount Initialize files Reflink and write the target -Check for damage -Done diff --git a/tests/generic/170 b/tests/generic/170 index 78ed63d..2a81cad 100755 --- a/tests/generic/170 +++ b/tests/generic/170 @@ -86,11 +86,6 @@ done touch "$testdir/finished" wait -echo "Check for damage" -umount "$SCRATCH_MNT" - -echo "Done" - # success, all done status=0 exit diff --git a/tests/generic/170.out b/tests/generic/170.out index 103aaa5..debd6ca 100644 --- a/tests/generic/170.out +++ b/tests/generic/170.out @@ -2,5 +2,3 @@ QA output created by 170 Format and mount Initialize files Reflink and dio write the target -Check for damage -Done diff --git a/tests/generic/171 b/tests/generic/171 index 4b4f141..d865f64 100755 --- a/tests/generic/171 +++ b/tests/generic/171 @@ -95,12 +95,6 @@ echo "${out}" | grep -q "No space left on device" || echo "CoW should have faile echo "${out}" >> "$seqres.full" 2>&1 echo "${out}" -#filefrag -v $testdir/bigfile -#filefrag -v $testdir/clonefile - -echo "Check scratch fs" -umount "$SCRATCH_MNT" - # success, all done status=0 exit diff --git a/tests/generic/171.out b/tests/generic/171.out index c2b0ddd..a999eb0 100644 --- a/tests/generic/171.out +++ b/tests/generic/171.out @@ -7,4 +7,3 @@ CoW the big file pwrite64: No space left on device Remount and try CoW again pwrite64: No space left on device -Check scratch fs diff --git a/tests/generic/172 b/tests/generic/172 index 98eb97f..e6020f1 100755 --- a/tests/generic/172 +++ b/tests/generic/172 @@ -95,12 +95,6 @@ echo "${out}" | grep -q "No space left on device" || echo "CoW should have faile echo "${out}" >> "$seqres.full" 2>&1 echo "${out}" -#filefrag -v $testdir/bigfile -#filefrag -v $testdir/clonefile - -echo "Check scratch fs" -umount "$SCRATCH_MNT" - # success, all done status=0 exit diff --git a/tests/generic/172.out b/tests/generic/172.out index 3913dd7..4d3f710 100644 --- a/tests/generic/172.out +++ b/tests/generic/172.out @@ -7,4 +7,3 @@ CoW the big file pwrite64: No space left on device Remount and try CoW again pwrite64: No space left on device -Check scratch fs diff --git a/tests/generic/173 b/tests/generic/173 index e26f5a9..61c6b32 100755 --- a/tests/generic/173 +++ b/tests/generic/173 @@ -97,12 +97,6 @@ if [ "$err" -lt 128 ]; then echo "mmap CoW should have failed with SIGBUS, got SIG$(kill -l $err)" fi -#filefrag -v $testdir/bigfile -#filefrag -v $testdir/clonefile - -echo "Check scratch fs" -umount "$SCRATCH_MNT" - # success, all done status=0 exit diff --git a/tests/generic/173.out b/tests/generic/173.out index 49abb17..5235548 100644 --- a/tests/generic/173.out +++ b/tests/generic/173.out @@ -5,4 +5,3 @@ Create a big file and reflink it Allocate the rest of the space mmap CoW the big file Remount and try CoW again -Check scratch fs diff --git a/tests/generic/174 b/tests/generic/174 index 1749a1c..dd6fe5a 100755 --- a/tests/generic/174 +++ b/tests/generic/174 @@ -95,12 +95,6 @@ echo "${out}" | grep -q "No space left on device" || echo "CoW should have faile echo "${out}" >> "$seqres.full" 2>&1 echo "${out}" -#filefrag -v $testdir/bigfile -#filefrag -v $testdir/clonefile - -echo "Check scratch fs" -umount "$SCRATCH_MNT" - # success, all done status=0 exit diff --git a/tests/generic/174.out b/tests/generic/174.out index 702d067..1490ca4 100644 --- a/tests/generic/174.out +++ b/tests/generic/174.out @@ -7,4 +7,3 @@ CoW the big file pwrite64: No space left on device Remount and try CoW again pwrite64: No space left on device -Check scratch fs diff --git a/tests/generic/183 b/tests/generic/183 index 27179fd..c928acd 100755 --- a/tests/generic/183 +++ b/tests/generic/183 @@ -92,9 +92,6 @@ md5sum "$testdir/file2" | _filter_scratch md5sum "$testdir/file3" | _filter_scratch md5sum "$testdir/file3.chk" | _filter_scratch -echo "Check for damage" -umount "$SCRATCH_MNT" - # success, all done status=0 exit diff --git a/tests/generic/183.out b/tests/generic/183.out index e5d0322..b777908 100644 --- a/tests/generic/183.out +++ b/tests/generic/183.out @@ -12,4 +12,3 @@ bdbcf02ee0aa977795a79d25fcfdccb1 SCRATCH_MNT/test-183/file1 b83f9394092e15bdcda585cd8e776dc6 SCRATCH_MNT/test-183/file2 55968a95dfc0120df4e8485576514320 SCRATCH_MNT/test-183/file3 55968a95dfc0120df4e8485576514320 SCRATCH_MNT/test-183/file3.chk -Check for damage diff --git a/tests/generic/185 b/tests/generic/185 index 368260d..fb05e6d 100755 --- a/tests/generic/185 +++ b/tests/generic/185 @@ -92,9 +92,6 @@ md5sum "$testdir/file2" | _filter_scratch md5sum "$testdir/file3" | _filter_scratch md5sum "$testdir/file3.chk" | _filter_scratch -echo "Check for damage" -umount "$SCRATCH_MNT" - # success, all done status=0 exit diff --git a/tests/generic/185.out b/tests/generic/185.out index e505c90..4d1839a 100644 --- a/tests/generic/185.out +++ b/tests/generic/185.out @@ -12,4 +12,3 @@ bdbcf02ee0aa977795a79d25fcfdccb1 SCRATCH_MNT/test-185/file1 b83f9394092e15bdcda585cd8e776dc6 SCRATCH_MNT/test-185/file2 55968a95dfc0120df4e8485576514320 SCRATCH_MNT/test-185/file3 55968a95dfc0120df4e8485576514320 SCRATCH_MNT/test-185/file3.chk -Check for damage diff --git a/tests/generic/186 b/tests/generic/186 index 67e52b5..e495cbc 100755 --- a/tests/generic/186 +++ b/tests/generic/186 @@ -137,9 +137,6 @@ md5sum "$testdir/file2" | _filter_scratch md5sum "$testdir/file3" | _filter_scratch md5sum "$testdir/file3.chk" | _filter_scratch -echo "Check for damage" -umount "$SCRATCH_MNT" - # success, all done status=0 exit diff --git a/tests/generic/186.out b/tests/generic/186.out index adfae9c..961673a 100644 --- a/tests/generic/186.out +++ b/tests/generic/186.out @@ -12,4 +12,3 @@ Compare files 35219c511215d00a857243965ea5ed9c SCRATCH_MNT/test-186/file2 1801718b8daeb8d3ad4900bd9137b3e8 SCRATCH_MNT/test-186/file3 1801718b8daeb8d3ad4900bd9137b3e8 SCRATCH_MNT/test-186/file3.chk -Check for damage diff --git a/tests/generic/187 b/tests/generic/187 index c993394..e3461ab 100755 --- a/tests/generic/187 +++ b/tests/generic/187 @@ -137,9 +137,6 @@ md5sum "$testdir/file2" | _filter_scratch md5sum "$testdir/file3" | _filter_scratch md5sum "$testdir/file3.chk" | _filter_scratch -echo "Check for damage" -umount "$SCRATCH_MNT" - # success, all done status=0 exit diff --git a/tests/generic/187.out b/tests/generic/187.out index a3c05a5..8ad56f8 100644 --- a/tests/generic/187.out +++ b/tests/generic/187.out @@ -12,4 +12,3 @@ Compare files 35219c511215d00a857243965ea5ed9c SCRATCH_MNT/test-187/file2 1801718b8daeb8d3ad4900bd9137b3e8 SCRATCH_MNT/test-187/file3 1801718b8daeb8d3ad4900bd9137b3e8 SCRATCH_MNT/test-187/file3.chk -Check for damage diff --git a/tests/generic/188 b/tests/generic/188 index 9e63388..7596c4b 100755 --- a/tests/generic/188 +++ b/tests/generic/188 @@ -87,9 +87,6 @@ md5sum "$testdir/file1" | _filter_scratch md5sum "$testdir/file3" | _filter_scratch md5sum "$testdir/file3.chk" | _filter_scratch -echo "Check for damage" -umount "$SCRATCH_MNT" - # success, all done status=0 exit diff --git a/tests/generic/188.out b/tests/generic/188.out index 135e69c..904f383 100644 --- a/tests/generic/188.out +++ b/tests/generic/188.out @@ -10,4 +10,3 @@ Compare files bdbcf02ee0aa977795a79d25fcfdccb1 SCRATCH_MNT/test-188/file1 09101629908f9bdd5d178e7ce20bb1bb SCRATCH_MNT/test-188/file3 09101629908f9bdd5d178e7ce20bb1bb SCRATCH_MNT/test-188/file3.chk -Check for damage diff --git a/tests/generic/189 b/tests/generic/189 index 661129c..130dc58 100755 --- a/tests/generic/189 +++ b/tests/generic/189 @@ -87,9 +87,6 @@ md5sum "$testdir/file1" | _filter_scratch md5sum "$testdir/file3" | _filter_scratch md5sum "$testdir/file3.chk" | _filter_scratch -echo "Check for damage" -umount "$SCRATCH_MNT" - # success, all done status=0 exit diff --git a/tests/generic/189.out b/tests/generic/189.out index ce868bd..feff605 100644 --- a/tests/generic/189.out +++ b/tests/generic/189.out @@ -10,4 +10,3 @@ Compare files bdbcf02ee0aa977795a79d25fcfdccb1 SCRATCH_MNT/test-189/file1 09101629908f9bdd5d178e7ce20bb1bb SCRATCH_MNT/test-189/file3 09101629908f9bdd5d178e7ce20bb1bb SCRATCH_MNT/test-189/file3.chk -Check for damage diff --git a/tests/generic/190 b/tests/generic/190 index 4e272c2..0171475 100755 --- a/tests/generic/190 +++ b/tests/generic/190 @@ -87,9 +87,6 @@ md5sum "$testdir/file1" | _filter_scratch md5sum "$testdir/file3" | _filter_scratch md5sum "$testdir/file3.chk" | _filter_scratch -echo "Check for damage" -umount "$SCRATCH_MNT" - # success, all done status=0 exit diff --git a/tests/generic/190.out b/tests/generic/190.out index abe5d89..ad8ecb0 100644 --- a/tests/generic/190.out +++ b/tests/generic/190.out @@ -10,4 +10,3 @@ Compare files bdbcf02ee0aa977795a79d25fcfdccb1 SCRATCH_MNT/test-190/file1 09101629908f9bdd5d178e7ce20bb1bb SCRATCH_MNT/test-190/file3 09101629908f9bdd5d178e7ce20bb1bb SCRATCH_MNT/test-190/file3.chk -Check for damage diff --git a/tests/generic/191 b/tests/generic/191 index 5aadded..34d96f9 100755 --- a/tests/generic/191 +++ b/tests/generic/191 @@ -87,9 +87,6 @@ md5sum "$testdir/file1" | _filter_scratch md5sum "$testdir/file3" | _filter_scratch md5sum "$testdir/file3.chk" | _filter_scratch -echo "Check for damage" -umount "$SCRATCH_MNT" - # success, all done status=0 exit diff --git a/tests/generic/191.out b/tests/generic/191.out index 8116eab..1b5e175 100644 --- a/tests/generic/191.out +++ b/tests/generic/191.out @@ -10,4 +10,3 @@ Compare files bdbcf02ee0aa977795a79d25fcfdccb1 SCRATCH_MNT/test-191/file1 09101629908f9bdd5d178e7ce20bb1bb SCRATCH_MNT/test-191/file3 09101629908f9bdd5d178e7ce20bb1bb SCRATCH_MNT/test-191/file3.chk -Check for damage diff --git a/tests/generic/194 b/tests/generic/194 index a17debc..e9feaad 100755 --- a/tests/generic/194 +++ b/tests/generic/194 @@ -92,9 +92,6 @@ md5sum "$testdir/file1" | _filter_scratch md5sum "$testdir/file3" | _filter_scratch md5sum "$testdir/file3.chk" | _filter_scratch -echo "Check for damage" -umount "$SCRATCH_MNT" - # success, all done status=0 exit diff --git a/tests/generic/194.out b/tests/generic/194.out index fdfda23..d370b4c 100644 --- a/tests/generic/194.out +++ b/tests/generic/194.out @@ -10,4 +10,3 @@ Compare files bdbcf02ee0aa977795a79d25fcfdccb1 SCRATCH_MNT/test-194/file1 55968a95dfc0120df4e8485576514320 SCRATCH_MNT/test-194/file3 55968a95dfc0120df4e8485576514320 SCRATCH_MNT/test-194/file3.chk -Check for damage diff --git a/tests/generic/195 b/tests/generic/195 index f49d0c2..32548ba 100755 --- a/tests/generic/195 +++ b/tests/generic/195 @@ -92,9 +92,6 @@ md5sum "$testdir/file1" | _filter_scratch md5sum "$testdir/file3" | _filter_scratch md5sum "$testdir/file3.chk" | _filter_scratch -echo "Check for damage" -umount "$SCRATCH_MNT" - # success, all done status=0 exit diff --git a/tests/generic/195.out b/tests/generic/195.out index 9495058..8a6d760 100644 --- a/tests/generic/195.out +++ b/tests/generic/195.out @@ -10,4 +10,3 @@ Compare files bdbcf02ee0aa977795a79d25fcfdccb1 SCRATCH_MNT/test-195/file1 55968a95dfc0120df4e8485576514320 SCRATCH_MNT/test-195/file3 55968a95dfc0120df4e8485576514320 SCRATCH_MNT/test-195/file3.chk -Check for damage diff --git a/tests/generic/196 b/tests/generic/196 index 4da9c76..4ec2cff 100755 --- a/tests/generic/196 +++ b/tests/generic/196 @@ -87,9 +87,6 @@ md5sum "$testdir/file1" | _filter_scratch md5sum "$testdir/file3" | _filter_scratch md5sum "$testdir/file3.chk" | _filter_scratch -echo "Check for damage" -umount "$SCRATCH_MNT" - # success, all done status=0 exit diff --git a/tests/generic/196.out b/tests/generic/196.out index 6ee052b..545b72b 100644 --- a/tests/generic/196.out +++ b/tests/generic/196.out @@ -10,4 +10,3 @@ Compare files bdbcf02ee0aa977795a79d25fcfdccb1 SCRATCH_MNT/test-196/file1 55968a95dfc0120df4e8485576514320 SCRATCH_MNT/test-196/file3 55968a95dfc0120df4e8485576514320 SCRATCH_MNT/test-196/file3.chk -Check for damage diff --git a/tests/generic/197 b/tests/generic/197 index 54ee5ab..356a587 100755 --- a/tests/generic/197 +++ b/tests/generic/197 @@ -87,9 +87,6 @@ md5sum "$testdir/file1" | _filter_scratch md5sum "$testdir/file3" | _filter_scratch md5sum "$testdir/file3.chk" | _filter_scratch -echo "Check for damage" -umount "$SCRATCH_MNT" - # success, all done status=0 exit diff --git a/tests/generic/197.out b/tests/generic/197.out index bec294b..05edad9 100644 --- a/tests/generic/197.out +++ b/tests/generic/197.out @@ -10,4 +10,3 @@ Compare files bdbcf02ee0aa977795a79d25fcfdccb1 SCRATCH_MNT/test-197/file1 55968a95dfc0120df4e8485576514320 SCRATCH_MNT/test-197/file3 55968a95dfc0120df4e8485576514320 SCRATCH_MNT/test-197/file3.chk -Check for damage diff --git a/tests/generic/199 b/tests/generic/199 index 5e4bca8..03b8fda 100755 --- a/tests/generic/199 +++ b/tests/generic/199 @@ -116,9 +116,6 @@ md5sum "$testdir/file1" | _filter_scratch md5sum "$testdir/file3" | _filter_scratch md5sum "$testdir/file3.chk" | _filter_scratch -echo "Check for damage" -umount "$SCRATCH_MNT" - # success, all done status=0 exit diff --git a/tests/generic/199.out b/tests/generic/199.out index 752742d..b35c135 100644 --- a/tests/generic/199.out +++ b/tests/generic/199.out @@ -10,4 +10,3 @@ Compare files bdbcf02ee0aa977795a79d25fcfdccb1 SCRATCH_MNT/test-199/file1 36f6b5317a9a921fc91175390ccf7f69 SCRATCH_MNT/test-199/file3 36f6b5317a9a921fc91175390ccf7f69 SCRATCH_MNT/test-199/file3.chk -Check for damage diff --git a/tests/generic/200 b/tests/generic/200 index f0521ae..e71eedc 100755 --- a/tests/generic/200 +++ b/tests/generic/200 @@ -116,9 +116,6 @@ md5sum "$testdir/file1" | _filter_scratch md5sum "$testdir/file3" | _filter_scratch md5sum "$testdir/file3.chk" | _filter_scratch -echo "Check for damage" -umount "$SCRATCH_MNT" - # success, all done status=0 exit diff --git a/tests/generic/200.out b/tests/generic/200.out index e4ab7e0..140eff9 100644 --- a/tests/generic/200.out +++ b/tests/generic/200.out @@ -10,4 +10,3 @@ Compare files bdbcf02ee0aa977795a79d25fcfdccb1 SCRATCH_MNT/test-200/file1 36f6b5317a9a921fc91175390ccf7f69 SCRATCH_MNT/test-200/file3 36f6b5317a9a921fc91175390ccf7f69 SCRATCH_MNT/test-200/file3.chk -Check for damage diff --git a/tests/generic/201 b/tests/generic/201 index db77a5e..90087ef 100755 --- a/tests/generic/201 +++ b/tests/generic/201 @@ -77,9 +77,6 @@ echo "CoW and unmount" "$XFS_IO_PROG" -f -c "pwrite -S 0x63 -b $((blksz * nr / 2)) $((blksz * nr / 4)) $((blksz * nr / 2))" "$testdir/file3" >> "$seqres.full" rm "$testdir/file3" -echo "Check for damage" -umount "$SCRATCH_MNT" - # success, all done status=0 exit diff --git a/tests/generic/201.out b/tests/generic/201.out index 80629b6..52669d2 100644 --- a/tests/generic/201.out +++ b/tests/generic/201.out @@ -6,4 +6,3 @@ bdbcf02ee0aa977795a79d25fcfdccb1 SCRATCH_MNT/test-201/file1 d3959a68638c50af07f0258e032cb554 SCRATCH_MNT/test-201/file3 d3959a68638c50af07f0258e032cb554 SCRATCH_MNT/test-201/file3.chk CoW and unmount -Check for damage diff --git a/tests/generic/202 b/tests/generic/202 index 91f2d9b..e034e4e 100755 --- a/tests/generic/202 +++ b/tests/generic/202 @@ -77,9 +77,6 @@ md5sum "$testdir/file1" | _filter_scratch md5sum "$testdir/file2" | _filter_scratch md5sum "$testdir/file2.chk" | _filter_scratch -echo "Check for damage" -umount "$SCRATCH_MNT" - # success, all done status=0 exit diff --git a/tests/generic/202.out b/tests/generic/202.out index 8973abe..2dbd4b0 100644 --- a/tests/generic/202.out +++ b/tests/generic/202.out @@ -10,4 +10,3 @@ Compare files 75f550706b7d54e6ae59a8220b532285 SCRATCH_MNT/test-202/file1 7cd112044b63b2c979f45e7c1e7cc85f SCRATCH_MNT/test-202/file2 7cd112044b63b2c979f45e7c1e7cc85f SCRATCH_MNT/test-202/file2.chk -Check for damage diff --git a/tests/generic/203 b/tests/generic/203 index 86a672b..2b6db7e 100755 --- a/tests/generic/203 +++ b/tests/generic/203 @@ -77,9 +77,6 @@ md5sum "$testdir/file1" | _filter_scratch md5sum "$testdir/file2" | _filter_scratch md5sum "$testdir/file2.chk" | _filter_scratch -echo "Check for damage" -umount "$SCRATCH_MNT" - # success, all done status=0 exit diff --git a/tests/generic/203.out b/tests/generic/203.out index 84ac0e8..ddde511 100644 --- a/tests/generic/203.out +++ b/tests/generic/203.out @@ -10,4 +10,3 @@ Compare files 75f550706b7d54e6ae59a8220b532285 SCRATCH_MNT/test-203/file1 227f44bb2dcf251ebf0217edaeb1e365 SCRATCH_MNT/test-203/file2 227f44bb2dcf251ebf0217edaeb1e365 SCRATCH_MNT/test-203/file2.chk -Check for damage diff --git a/tests/generic/205 b/tests/generic/205 index 8fed955..8955e67 100755 --- a/tests/generic/205 +++ b/tests/generic/205 @@ -93,9 +93,6 @@ echo "Compare files" ! cmp -s "$testdir/file1" "$testdir/file2" || _fail "file1 and file2 don't match." cmp -s "$testdir/file2" "$testdir/file2.chk" || _fail "file2 and file2.chk don't match." -echo "Check for damage" -umount "$SCRATCH_MNT" - # success, all done status=0 exit diff --git a/tests/generic/205.out b/tests/generic/205.out index 1a22515..c65d1bd 100644 --- a/tests/generic/205.out +++ b/tests/generic/205.out @@ -4,4 +4,3 @@ Create the original files Compare files CoW and unmount Compare files -Check for damage diff --git a/tests/generic/206 b/tests/generic/206 index 10b5285..12ad745 100755 --- a/tests/generic/206 +++ b/tests/generic/206 @@ -93,9 +93,6 @@ echo "Compare files" ! cmp -s "$testdir/file1" "$testdir/file2" || _fail "file1 and file2 don't match." cmp -s "$testdir/file2" "$testdir/file2.chk" || _fail "file2 and file2.chk don't match." -echo "Check for damage" -umount "$SCRATCH_MNT" - # success, all done status=0 exit diff --git a/tests/generic/206.out b/tests/generic/206.out index 0b1ec60..38c7b09 100644 --- a/tests/generic/206.out +++ b/tests/generic/206.out @@ -4,4 +4,3 @@ Create the original files Compare files CoW and unmount Compare files -Check for damage diff --git a/tests/generic/216 b/tests/generic/216 index 671f0c1..3e0084e 100755 --- a/tests/generic/216 +++ b/tests/generic/216 @@ -94,9 +94,6 @@ echo "Compare files" ! cmp -s "$testdir/file1" "$testdir/file2" || _fail "file1 and file2 don't match." cmp -s "$testdir/file2" "$testdir/file2.chk" || _fail "file2 and file2.chk don't match." -echo "Check for damage" -umount "$SCRATCH_MNT" - # success, all done status=0 exit diff --git a/tests/generic/216.out b/tests/generic/216.out index 2d43c3a..85db001 100644 --- a/tests/generic/216.out +++ b/tests/generic/216.out @@ -4,4 +4,3 @@ Create the original files Compare files CoW and unmount Compare files -Check for damage diff --git a/tests/generic/217 b/tests/generic/217 index e4d40c7..3470d25 100755 --- a/tests/generic/217 +++ b/tests/generic/217 @@ -94,9 +94,6 @@ echo "Compare files" ! cmp -s "$testdir/file1" "$testdir/file2" || _fail "file1 and file2 don't match." cmp -s "$testdir/file2" "$testdir/file2.chk" || _fail "file2 and file2.chk don't match." -echo "Check for damage" -umount "$SCRATCH_MNT" - # success, all done status=0 exit diff --git a/tests/generic/217.out b/tests/generic/217.out index d8eb1be..bf8bb4f 100644 --- a/tests/generic/217.out +++ b/tests/generic/217.out @@ -4,4 +4,3 @@ Create the original files Compare files CoW and unmount Compare files -Check for damage diff --git a/tests/generic/218 b/tests/generic/218 index eb52fea..220cda3 100755 --- a/tests/generic/218 +++ b/tests/generic/218 @@ -88,9 +88,6 @@ echo "Compare files" ! cmp -s "$testdir/file1" "$testdir/file2" || _fail "file1 and file2 don't match." cmp -s "$testdir/file2" "$testdir/file2.chk" || _fail "file2 and file2.chk don't match." -echo "Check for damage" -umount "$SCRATCH_MNT" - # success, all done status=0 exit diff --git a/tests/generic/218.out b/tests/generic/218.out index 0173be0..0142747 100644 --- a/tests/generic/218.out +++ b/tests/generic/218.out @@ -4,4 +4,3 @@ Create the original files Compare files CoW and unmount Compare files -Check for damage diff --git a/tests/generic/220 b/tests/generic/220 index fb5ecda..151bf76 100755 --- a/tests/generic/220 +++ b/tests/generic/220 @@ -88,9 +88,6 @@ echo "Compare files" ! cmp -s "$testdir/file1" "$testdir/file2" || _fail "file1 and file2 don't match." cmp -s "$testdir/file2" "$testdir/file2.chk" || _fail "file2 and file2.chk don't match." -echo "Check for damage" -umount "$SCRATCH_MNT" - # success, all done status=0 exit diff --git a/tests/generic/220.out b/tests/generic/220.out index 9dcb9d6..a7123e1 100644 --- a/tests/generic/220.out +++ b/tests/generic/220.out @@ -4,4 +4,3 @@ Create the original files Compare files CoW and unmount Compare files -Check for damage diff --git a/tests/generic/222 b/tests/generic/222 index ab3f65f..c95a1d6 100755 --- a/tests/generic/222 +++ b/tests/generic/222 @@ -94,9 +94,6 @@ echo "Compare files" ! cmp -s "$testdir/file1" "$testdir/file2" || _fail "file1 and file2 don't match." cmp -s "$testdir/file2" "$testdir/file2.chk" || _fail "file2 and file2.chk don't match." -echo "Check for damage" -umount "$SCRATCH_MNT" - # success, all done status=0 exit diff --git a/tests/generic/222.out b/tests/generic/222.out index 47bad10..895b3a1 100644 --- a/tests/generic/222.out +++ b/tests/generic/222.out @@ -4,4 +4,3 @@ Create the original files Compare files CoW and unmount Compare files -Check for damage diff --git a/tests/generic/227 b/tests/generic/227 index 387c714..d62ab52 100755 --- a/tests/generic/227 +++ b/tests/generic/227 @@ -94,9 +94,6 @@ echo "Compare files" ! cmp -s "$testdir/file1" "$testdir/file2" || _fail "file1 and file2 don't match." cmp -s "$testdir/file2" "$testdir/file2.chk" || _fail "file2 and file2.chk don't match." -echo "Check for damage" -umount "$SCRATCH_MNT" - # success, all done status=0 exit diff --git a/tests/generic/227.out b/tests/generic/227.out index 69cb88f..bed3e48 100644 --- a/tests/generic/227.out +++ b/tests/generic/227.out @@ -4,4 +4,3 @@ Create the original files Compare files CoW and unmount Compare files -Check for damage diff --git a/tests/generic/229 b/tests/generic/229 index eb105a3..cc86b4e 100755 --- a/tests/generic/229 +++ b/tests/generic/229 @@ -154,9 +154,6 @@ runtest delalloc unwritten "$testdir/d-u" runtest delalloc hole "$testdir/d-h" runtest delalloc regular "$testdir/d-r" -echo "Check for damage" -umount "$SCRATCH_MNT" - # success, all done status=0 exit diff --git a/tests/generic/229.out b/tests/generic/229.out index 07750ac..4955ecd 100644 --- a/tests/generic/229.out +++ b/tests/generic/229.out @@ -80,4 +80,3 @@ Create the original files Compare files CoW and unmount Compare files -Check for damage diff --git a/tests/generic/238 b/tests/generic/238 index 02057ad..c726770 100755 --- a/tests/generic/238 +++ b/tests/generic/238 @@ -154,9 +154,6 @@ runtest delalloc unwritten "$testdir/d-u" runtest delalloc hole "$testdir/d-h" runtest delalloc regular "$testdir/d-r" -echo "Check for damage" -umount "$SCRATCH_MNT" - # success, all done status=0 exit diff --git a/tests/generic/238.out b/tests/generic/238.out index dcfcc8e..5f97fb1 100644 --- a/tests/generic/238.out +++ b/tests/generic/238.out @@ -80,4 +80,3 @@ Create the original files Compare files CoW and unmount Compare files -Check for damage diff --git a/tests/generic/242 b/tests/generic/242 index 3023ac7..1141aa4 100755 --- a/tests/generic/242 +++ b/tests/generic/242 @@ -90,9 +90,6 @@ md5sum "$testdir/file1" | _filter_scratch md5sum "$testdir/file2" | _filter_scratch md5sum "$testdir/file2.chk" | _filter_scratch -echo "Check for damage" -umount "$SCRATCH_MNT" - # success, all done status=0 exit diff --git a/tests/generic/242.out b/tests/generic/242.out index ef9a574..34dac8b 100644 --- a/tests/generic/242.out +++ b/tests/generic/242.out @@ -10,4 +10,3 @@ Compare files 01768a16d33c9bd21dc67a7fac006ee1 SCRATCH_MNT/test-242/file1 c835fd53fa27b72511b250d51595c053 SCRATCH_MNT/test-242/file2 c835fd53fa27b72511b250d51595c053 SCRATCH_MNT/test-242/file2.chk -Check for damage diff --git a/tests/generic/243 b/tests/generic/243 index e65347f..a514591 100755 --- a/tests/generic/243 +++ b/tests/generic/243 @@ -90,9 +90,6 @@ md5sum "$testdir/file1" | _filter_scratch md5sum "$testdir/file2" | _filter_scratch md5sum "$testdir/file2.chk" | _filter_scratch -echo "Check for damage" -umount "$SCRATCH_MNT" - # success, all done status=0 exit diff --git a/tests/generic/243.out b/tests/generic/243.out index 8e13fab..d76ce6f 100644 --- a/tests/generic/243.out +++ b/tests/generic/243.out @@ -10,4 +10,3 @@ Compare files 01768a16d33c9bd21dc67a7fac006ee1 SCRATCH_MNT/test-243/file1 c835fd53fa27b72511b250d51595c053 SCRATCH_MNT/test-243/file2 c835fd53fa27b72511b250d51595c053 SCRATCH_MNT/test-243/file2.chk -Check for damage diff --git a/tests/xfs/127 b/tests/xfs/127 index 63d5890..392e63c 100755 --- a/tests/xfs/127 +++ b/tests/xfs/127 @@ -70,9 +70,6 @@ _cp_reflink "$testdir/original" "$testdir/copy3" xfs_info "$SCRATCH_MNT" >> "$seqres.full" -echo "Check scratch fs" -umount "$SCRATCH_MNT" - # success, all done status=0 exit diff --git a/tests/xfs/127.out b/tests/xfs/127.out index e4e76e2..317fbdc 100644 --- a/tests/xfs/127.out +++ b/tests/xfs/127.out @@ -3,4 +3,3 @@ Format and mount Create the original file and reflink to copy1, copy2 Grow fs Create more reflink copies -Check scratch fs diff --git a/tests/xfs/128 b/tests/xfs/128 index 2e1da3f..f230adf 100755 --- a/tests/xfs/128 +++ b/tests/xfs/128 @@ -140,9 +140,6 @@ _within_tolerance "free blocks after CoW some reflink copies" $free_blocks2 $((f _within_tolerance "free blocks after defragging all reflink copies" $free_blocks3 $((free_blocks2 - (blks * 2 * blksz_factor))) $margin -v _within_tolerance "free blocks after all tests" $free_blocks3 $((free_blocks0 - (blks * 3 * blksz_factor))) $margin -v -echo "Check scratch fs" -umount "$SCRATCH_MNT" - # success, all done status=0 exit diff --git a/tests/xfs/128.out b/tests/xfs/128.out index 0ac06db..9c80746 100644 --- a/tests/xfs/128.out +++ b/tests/xfs/128.out @@ -24,4 +24,3 @@ free blocks after creating some reflink copies is in range free blocks after CoW some reflink copies is in range free blocks after defragging all reflink copies is in range free blocks after all tests is in range -Check scratch fs diff --git a/tests/xfs/131 b/tests/xfs/131 index adab31f..f553a44 100755 --- a/tests/xfs/131 +++ b/tests/xfs/131 @@ -67,9 +67,6 @@ _cp_reflink "$testdir/file1" "$testdir/file2" 2>&1 | _filter_scratch test -s "$testdir/file2" && _fail "Should not be able to reflink a realtime file." -echo "Check restored fs" -umount "$SCRATCH_MNT" - # success, all done status=0 exit diff --git a/tests/xfs/131.out b/tests/xfs/131.out index 7b700c9..3c0186f 100644 --- a/tests/xfs/131.out +++ b/tests/xfs/131.out @@ -3,4 +3,3 @@ Format and mount scratch device Create the original file blocks Reflink every block cp: failed to clone 'SCRATCH_MNT/test-131/file2' from 'SCRATCH_MNT/test-131/file1': Invalid argument -Check restored fs diff --git a/tests/xfs/139 b/tests/xfs/139 index feb55bd..55dd7d0 100755 --- a/tests/xfs/139 +++ b/tests/xfs/139 @@ -73,9 +73,6 @@ md5sum "$testdir/file1" | _filter_scratch md5sum "$testdir/file2" | _filter_scratch #filefrag -v "$testdir/file1" "$testdir/file2" -echo "Check scratch fs" -umount "$SCRATCH_MNT" - # success, all done status=0 exit diff --git a/tests/xfs/139.out b/tests/xfs/139.out index 090e3af..dc6a31e 100644 --- a/tests/xfs/139.out +++ b/tests/xfs/139.out @@ -5,4 +5,3 @@ CoW every other block Compare files 673c759fb131ccf3336c4f8c549a497e SCRATCH_MNT/test-139/file1 dc802351f6717547cbf4c951b294f952 SCRATCH_MNT/test-139/file2 -Check scratch fs diff --git a/tests/xfs/140 b/tests/xfs/140 index 309b284..a379ca7 100644 --- a/tests/xfs/140 +++ b/tests/xfs/140 @@ -80,9 +80,6 @@ echo "Compare files" ! cmp -s "$testdir/file1" "$testdir/file2" || echo "file1 and file2 must not match" cmp -s "$testdir/file2" "$testdir/file2.chk" || echo "file2 and file2.chk do not match" -echo "Check scratch fs" -umount "$SCRATCH_MNT" - # success, all done status=0 exit diff --git a/tests/xfs/140.out b/tests/xfs/140.out index 5d00ea2..4d9e6a1 100644 --- a/tests/xfs/140.out +++ b/tests/xfs/140.out @@ -4,4 +4,3 @@ Create the original files Compare files CoW every other block Compare files -Check scratch fs From darrick.wong@oracle.com Thu Feb 11 17:40:01 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay2.corp.sgi.com [137.38.102.29]) by oss.sgi.com (Postfix) with ESMTP id 08A937CB5 for ; Thu, 11 Feb 2016 17:40:01 -0600 (CST) Received: from cuda.sgi.com (cuda3.sgi.com [192.48.176.15]) by relay2.corp.sgi.com (Postfix) with ESMTP id D2309304051 for ; Thu, 11 Feb 2016 15:40:00 -0800 (PST) X-ASG-Debug-ID: 1455233999-04cb6c1e5972eb0001-NocioJ Received: from userp1040.oracle.com (userp1040.oracle.com [156.151.31.81]) by cuda.sgi.com with ESMTP id 7DCC8pYWa1te3079 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO) for ; Thu, 11 Feb 2016 15:39:59 -0800 (PST) X-Barracuda-Envelope-From: darrick.wong@oracle.com X-Barracuda-Apparent-Source-IP: 156.151.31.81 Received: from aserv0021.oracle.com (aserv0021.oracle.com [141.146.126.233]) by userp1040.oracle.com (Sentrion-MTA-4.3.2/Sentrion-MTA-4.3.2) with ESMTP id u1BNdv9l031752 (version=TLSv1 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Thu, 11 Feb 2016 23:39:58 GMT Received: from aserv0121.oracle.com (aserv0121.oracle.com [141.146.126.235]) by aserv0021.oracle.com (8.13.8/8.13.8) with ESMTP id u1BNdvFa023647 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=FAIL); Thu, 11 Feb 2016 23:39:57 GMT Received: from abhmp0013.oracle.com (abhmp0013.oracle.com [141.146.116.19]) by aserv0121.oracle.com (8.13.8/8.13.8) with ESMTP id u1BNdvpi026006; Thu, 11 Feb 2016 23:39:57 GMT Received: from localhost (/10.145.178.207) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Thu, 11 Feb 2016 15:39:57 -0800 Subject: [PATCH 06/32] common/dmerror: add some more dmerror routines From: "Darrick J. Wong" X-ASG-Orig-Subj: [PATCH 06/32] common/dmerror: add some more dmerror routines To: david@fromorbit.com, darrick.wong@oracle.com Cc: linux-btrfs@vger.kernel.org, fstests@vger.kernel.org, xfs@oss.sgi.com Date: Thu, 11 Feb 2016 15:39:55 -0800 Message-ID: <20160211233955.2202.37204.stgit@birch.djwong.org> In-Reply-To: <20160211233916.2202.40961.stgit@birch.djwong.org> References: <20160211233916.2202.40961.stgit@birch.djwong.org> User-Agent: StGit/0.17.1-dirty MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit X-Source-IP: aserv0021.oracle.com [141.146.126.233] X-Barracuda-Connect: userp1040.oracle.com[156.151.31.81] X-Barracuda-Start-Time: 1455233999 X-Barracuda-Encrypted: ECDHE-RSA-AES256-GCM-SHA384 X-Barracuda-URL: https://192.48.176.15:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-BRTS-Status: 1 X-Barracuda-Spam-Score: 0.00 X-Barracuda-Spam-Status: No, SCORE=0.00 using per-user scores of TAG_LEVEL=1000.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.7 tests=BSF_SC0_MISMATCH_TO, UNPARSEABLE_RELAY X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.3.26959 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 0.00 BSF_SC0_MISMATCH_TO Envelope rcpt doesn't match header 0.00 UNPARSEABLE_RELAY Informational: message has unparseable relay lines Add functions to the dmerror routine so that we can load both the error table and the linear table. This will help us with EIO testing of copy-on-write. Signed-off-by: Darrick J. Wong --- common/dmerror | 27 +++++++++++++++++++++++++-- tests/btrfs/100 | 2 +- tests/btrfs/101 | 2 +- 3 files changed, 27 insertions(+), 4 deletions(-) diff --git a/common/dmerror b/common/dmerror index 3900a4e..004530d 100644 --- a/common/dmerror +++ b/common/dmerror @@ -46,15 +46,23 @@ _dmerror_mount() _mount -t $FSTYP `_dmerror_mount_options $*` } +_dmerror_unmount() +{ + umount $SCRATCH_MNT +} + _dmerror_cleanup() { $UMOUNT_PROG $SCRATCH_MNT > /dev/null 2>&1 $DMSETUP_PROG remove error-test > /dev/null 2>&1 } -_dmerror_load_table() +_dmerror_load_error_table() { - $DMSETUP_PROG suspend error-test + suspend_opt="--nolockfs" + [ $# -gt 1 ] && [ $2 -eq 1 ] && suspend_opt="" + + $DMSETUP_PROG suspend $suspend_opt error-test [ $? -ne 0 ] && _fail "dmsetup suspend failed" $DMSETUP_PROG load error-test --table "$DMERROR_TABLE" @@ -63,3 +71,18 @@ _dmerror_load_table() $DMSETUP_PROG resume error-test [ $? -ne 0 ] && _fail "dmsetup resume failed" } + +_dmerror_load_working_table() +{ + suspend_opt="--nolockfs" + [ $# -gt 1 ] && [ $2 -eq 1 ] && suspend_opt="" + + $DMSETUP_PROG suspend $suspend_opt error-test + [ $? -ne 0 ] && _fail "dmsetup suspend failed" + + $DMSETUP_PROG load error-test --table "$DMLINEAR_TABLE" + [ $? -ne 0 ] && _fail "dmsetup failed to load error table" + + $DMSETUP_PROG resume error-test + [ $? -ne 0 ] && _fail "dmsetup resume failed" +} diff --git a/tests/btrfs/100 b/tests/btrfs/100 index 080d0ae..cd385e1 100755 --- a/tests/btrfs/100 +++ b/tests/btrfs/100 @@ -69,7 +69,7 @@ run_check $FSSTRESS_PROG -d $SCRATCH_MNT -n 200 -p 8 $FSSTRESS_AVOID -x \ "$snapshot_cmd" -X 50 # now load the error into the DMERROR_DEV -_dmerror_load_table +_dmerror_load_error_table _run_btrfs_util_prog replace start -B $error_devid $dev2 $SCRATCH_MNT diff --git a/tests/btrfs/101 b/tests/btrfs/101 index 0824de1..8d7af85 100755 --- a/tests/btrfs/101 +++ b/tests/btrfs/101 @@ -70,7 +70,7 @@ run_check $FSSTRESS_PROG -d $SCRATCH_MNT -n 200 -p 8 $FSSTRESS_AVOID -x \ "$snapshot_cmd" -X 50 # now load the error into the DMERROR_DEV -_dmerror_load_table +_dmerror_load_error_table _run_btrfs_util_prog device delete $error_devid $SCRATCH_MNT From darrick.wong@oracle.com Thu Feb 11 17:40:08 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay1.corp.sgi.com [137.38.102.111]) by oss.sgi.com (Postfix) with ESMTP id 214547CA3 for ; Thu, 11 Feb 2016 17:40:08 -0600 (CST) Received: from cuda.sgi.com (cuda2.sgi.com [192.48.176.25]) by relay1.corp.sgi.com (Postfix) with ESMTP id 10DD88F8033 for ; Thu, 11 Feb 2016 15:40:08 -0800 (PST) X-ASG-Debug-ID: 1455234005-04cbb0433189fd0001-NocioJ Received: from userp1040.oracle.com (userp1040.oracle.com [156.151.31.81]) by cuda.sgi.com with ESMTP id XYBHgH9Ch70LO4sx (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO) for ; Thu, 11 Feb 2016 15:40:06 -0800 (PST) X-Barracuda-Envelope-From: darrick.wong@oracle.com X-Barracuda-Apparent-Source-IP: 156.151.31.81 Received: from aserv0021.oracle.com (aserv0021.oracle.com [141.146.126.233]) by userp1040.oracle.com (Sentrion-MTA-4.3.2/Sentrion-MTA-4.3.2) with ESMTP id u1BNe4SP032126 (version=TLSv1 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Thu, 11 Feb 2016 23:40:04 GMT Received: from aserv0121.oracle.com (aserv0121.oracle.com [141.146.126.235]) by aserv0021.oracle.com (8.13.8/8.13.8) with ESMTP id u1BNe4nG024251 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=FAIL); Thu, 11 Feb 2016 23:40:04 GMT Received: from abhmp0011.oracle.com (abhmp0011.oracle.com [141.146.116.17]) by aserv0121.oracle.com (8.13.8/8.13.8) with ESMTP id u1BNe3Si026052; Thu, 11 Feb 2016 23:40:04 GMT Received: from localhost (/10.145.178.207) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Thu, 11 Feb 2016 15:40:03 -0800 Subject: [PATCH 07/32] common: create _require_test_program to look for programs in src/ From: "Darrick J. Wong" X-ASG-Orig-Subj: [PATCH 07/32] common: create _require_test_program to look for programs in src/ To: david@fromorbit.com, darrick.wong@oracle.com Cc: linux-btrfs@vger.kernel.org, fstests@vger.kernel.org, xfs@oss.sgi.com Date: Thu, 11 Feb 2016 15:40:02 -0800 Message-ID: <20160211234002.2202.899.stgit@birch.djwong.org> In-Reply-To: <20160211233916.2202.40961.stgit@birch.djwong.org> References: <20160211233916.2202.40961.stgit@birch.djwong.org> User-Agent: StGit/0.17.1-dirty MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit X-Source-IP: aserv0021.oracle.com [141.146.126.233] X-Barracuda-Connect: userp1040.oracle.com[156.151.31.81] X-Barracuda-Start-Time: 1455234005 X-Barracuda-Encrypted: ECDHE-RSA-AES256-GCM-SHA384 X-Barracuda-URL: https://192.48.176.25:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-BRTS-Status: 1 X-Barracuda-Spam-Score: 0.00 X-Barracuda-Spam-Status: No, SCORE=0.00 using per-user scores of TAG_LEVEL=1000.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.7 tests=BSF_SC0_MISMATCH_TO, UNPARSEABLE_RELAY X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.3.26959 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 0.00 BSF_SC0_MISMATCH_TO Envelope rcpt doesn't match header 0.00 UNPARSEABLE_RELAY Informational: message has unparseable relay lines Create a helper that looks for a test program in src/ and fails the test if it doesn't exist. Refactor the existing testcases to use it. Signed-off-by: Darrick J. Wong --- common/rc | 9 +++++++++ tests/generic/010 | 2 +- tests/generic/094 | 2 +- tests/generic/225 | 2 +- tests/generic/285 | 2 +- tests/generic/286 | 2 +- tests/generic/311 | 2 +- tests/xfs/032 | 3 +-- tests/xfs/044 | 2 +- 9 files changed, 17 insertions(+), 9 deletions(-) diff --git a/common/rc b/common/rc index 84f794a..63eb90b 100644 --- a/common/rc +++ b/common/rc @@ -1684,6 +1684,15 @@ _require_aiodio() _require_odirect } +# this test requires that a test program exists under src/ +# $1 - command (require) +# +_require_test_program() +{ + SRC_TEST=src/$1 + [ -x $SRC_TEST ] || _notrun "$SRC_TEST not built" +} + # run an aio-dio program # $1 - command _run_aiodio() diff --git a/tests/generic/010 b/tests/generic/010 index ea8ea50..1c9d8f7 100755 --- a/tests/generic/010 +++ b/tests/generic/010 @@ -51,7 +51,7 @@ _filter_dbtest() . ./common/rc . ./common/filter -[ -x $here/src/dbtest ] || _notrun "dbtest was not built for this platform" +_require_test_program "dbtest" # real QA test starts here _supported_fs generic diff --git a/tests/generic/094 b/tests/generic/094 index 4e4b668..a51738a 100644 --- a/tests/generic/094 +++ b/tests/generic/094 @@ -53,7 +53,7 @@ _scratch_mount > /dev/null 2>&1 rm -f $seqres.full fiemapfile=$SCRATCH_MNT/$seq.fiemap -[ -x $here/src/fiemap-tester ] || _notrun "fiemap-tester not built" +_require_test_program "fiemap-tester" seed=`date +%s` diff --git a/tests/generic/225 b/tests/generic/225 index 6134c8c..c8e0f64 100755 --- a/tests/generic/225 +++ b/tests/generic/225 @@ -53,7 +53,7 @@ rm -f $seqres.full fiemapfile=$SCRATCH_MNT/$seq.fiemap fiemaplog=$SCRATCH_MNT/$seq.log -[ -x $here/src/fiemap-tester ] || _notrun "fiemap-tester not built" +_require_test_program "fiemap-tester" seed=`date +%s` diff --git a/tests/generic/285 b/tests/generic/285 index d6275b5..16e70b1 100755 --- a/tests/generic/285 +++ b/tests/generic/285 @@ -45,7 +45,7 @@ _require_seek_data_hole BASE_TEST_FILE=$TEST_DIR/seek_sanity_testfile -[ -x $here/src/seek_sanity_test ] || _notrun "seek_sanitfy_tester not built" +_require_test_program "seek_sanity_test" # Disable extent zeroing for ext4 as that change where holes are created if [ "$FSTYP" = "ext4" ]; then diff --git a/tests/generic/286 b/tests/generic/286 index f6bf356..f88f079 100755 --- a/tests/generic/286 +++ b/tests/generic/286 @@ -44,7 +44,7 @@ _require_seek_data_hole src=$TEST_DIR/seek_copy_testfile dest=$TEST_DIR/seek_copy_testfile.dest -[ -x $here/src/seek_copy_test ] || _notrun "seek_copy_test not built" +_require_test_program "seek_copy_test" _cleanup() { diff --git a/tests/generic/311 b/tests/generic/311 index f552011..69bc1bf 100755 --- a/tests/generic/311 +++ b/tests/generic/311 @@ -62,7 +62,7 @@ _require_metadata_journaling $SCRATCH_DEV # the test system supports fallocate() for allocation _require_xfs_io_command "falloc" -[ -x $here/src/fsync-tester ] || _notrun "fsync-tester not built" +_require_test_program "fsync-tester" rm -f $seqres.full SEED=1 diff --git a/tests/xfs/032 b/tests/xfs/032 index 063f272..6216379 100755 --- a/tests/xfs/032 +++ b/tests/xfs/032 @@ -40,8 +40,7 @@ _supported_fs xfs _supported_os IRIX Linux _require_scratch - -[ $here/src/feature ] || _notrun "src/feature not built, skipping this test" +_require_test_program "feature" [ "$USE_EXTERNAL" = yes ] && _notrun "Cannot xfs_copy with external devices" [ -n "$XFS_COPY_PROG" ] || _notrun "xfs_copy binary not yet installed" diff --git a/tests/xfs/044 b/tests/xfs/044 index 2ffd74f..ea58c07 100755 --- a/tests/xfs/044 +++ b/tests/xfs/044 @@ -124,7 +124,7 @@ _filter_mkfs <$tmp.mkfs0 2>$tmp.mkfs1 [ $lversion -ne 1 ] && \ _notrun "Cannot run this test yet using MKFS_OPTIONS specified" -[ $here/src/loggen ] || _notrun "loggen not built, skipping test" +_require_test_program "loggen" _check_mount _check_require_logdev From darrick.wong@oracle.com Thu Feb 11 17:40:14 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay1.corp.sgi.com [137.38.102.111]) by oss.sgi.com (Postfix) with ESMTP id 397C37CA3 for ; Thu, 11 Feb 2016 17:40:14 -0600 (CST) Received: from cuda.sgi.com (cuda1.sgi.com [192.48.157.11]) by relay1.corp.sgi.com (Postfix) with ESMTP id EA81C8F804C for ; Thu, 11 Feb 2016 15:40:13 -0800 (PST) X-ASG-Debug-ID: 1455234012-04bdf066ed738a0001-NocioJ Received: from aserp1040.oracle.com (aserp1040.oracle.com [141.146.126.69]) by cuda.sgi.com with ESMTP id cI4K1DaRUjMBXNoD (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO) for ; Thu, 11 Feb 2016 15:40:12 -0800 (PST) X-Barracuda-Envelope-From: darrick.wong@oracle.com X-Barracuda-Apparent-Source-IP: 141.146.126.69 Received: from userv0021.oracle.com (userv0021.oracle.com [156.151.31.71]) by aserp1040.oracle.com (Sentrion-MTA-4.3.2/Sentrion-MTA-4.3.2) with ESMTP id u1BNeBVW022979 (version=TLSv1 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Thu, 11 Feb 2016 23:40:11 GMT Received: from aserv0121.oracle.com (aserv0121.oracle.com [141.146.126.235]) by userv0021.oracle.com (8.13.8/8.13.8) with ESMTP id u1BNeAQQ010353 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=FAIL); Thu, 11 Feb 2016 23:40:10 GMT Received: from abhmp0011.oracle.com (abhmp0011.oracle.com [141.146.116.17]) by aserv0121.oracle.com (8.13.8/8.13.8) with ESMTP id u1BNeAAE026084; Thu, 11 Feb 2016 23:40:10 GMT Received: from localhost (/10.145.178.207) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Thu, 11 Feb 2016 15:40:10 -0800 Subject: [PATCH 08/32] common: provide a method to repair the scratch fs From: "Darrick J. Wong" X-ASG-Orig-Subj: [PATCH 08/32] common: provide a method to repair the scratch fs To: david@fromorbit.com, darrick.wong@oracle.com Cc: linux-btrfs@vger.kernel.org, fstests@vger.kernel.org, xfs@oss.sgi.com Date: Thu, 11 Feb 2016 15:40:08 -0800 Message-ID: <20160211234008.2202.30511.stgit@birch.djwong.org> In-Reply-To: <20160211233916.2202.40961.stgit@birch.djwong.org> References: <20160211233916.2202.40961.stgit@birch.djwong.org> User-Agent: StGit/0.17.1-dirty MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit X-Source-IP: userv0021.oracle.com [156.151.31.71] X-Barracuda-Connect: aserp1040.oracle.com[141.146.126.69] X-Barracuda-Start-Time: 1455234012 X-Barracuda-Encrypted: ECDHE-RSA-AES256-GCM-SHA384 X-Barracuda-URL: https://192.48.157.11:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-BRTS-Status: 1 X-Barracuda-Spam-Score: 0.00 X-Barracuda-Spam-Status: No, SCORE=0.00 using per-user scores of TAG_LEVEL=1000.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.7 tests=BSF_SC0_MISMATCH_TO, UNPARSEABLE_RELAY X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.3.26959 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 0.00 BSF_SC0_MISMATCH_TO Envelope rcpt doesn't match header 0.00 UNPARSEABLE_RELAY Informational: message has unparseable relay lines Create a wrapper function that repairs any damage to the scratch filesystem and returns a standard result. We will use this to clean up after IO error testing and other weird corruption tests. Signed-off-by: Darrick J. Wong --- common/rc | 43 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 43 insertions(+) diff --git a/common/rc b/common/rc index 63eb90b..e05df74 100644 --- a/common/rc +++ b/common/rc @@ -953,6 +953,49 @@ _scratch_xfs_repair() $XFS_REPAIR_PROG $SCRATCH_OPTIONS $* $SCRATCH_DEV } +# Repair scratch filesystem. Returns 0 if the FS is good to go (either no +# errors found or errors were fixed) and nonzero otherwise; also spits out +# a complaint on stderr if fsck didn't tell us that the FS is good to go. +_repair_scratch_fs() +{ + case $FSTYP in + xfs) + _scratch_xfs_repair "$@" 2>&1 + res=$? + if [ "$res" -eq 2 ]; then + echo "xfs_repair returns $res; replay log?" + _scratch_mount + res=$? + if [ "$res" -gt 0 ]; then + echo "mount returns $res; zap log?" + _scratch_xfs_repair -L 2>&1 + echo "log zap returns $?" + else + umount "$SCRATCH_MNT" + fi + _scratch_xfs_repair "$@" 2>&1 + res=$? + fi + test $res -ne 0 && >&2 echo "xfs_repair failed, err=$res" + return $res + ;; + *) + # Let's hope fsck -y suffices... + fsck -t $FSTYP -y $SCRATCH_DEV 2>&1 + res=$? + case $res in + 0|1|2) + res=0 + ;; + *) + >&2 echo "fsck.$FSTYP failed, err=$res" + ;; + esac + return $res + ;; + esac +} + _get_pids_by_name() { if [ $# -ne 1 ] From darrick.wong@oracle.com Thu Feb 11 17:40:21 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay2.corp.sgi.com [137.38.102.29]) by oss.sgi.com (Postfix) with ESMTP id 9C5B27CBB for ; Thu, 11 Feb 2016 17:40:21 -0600 (CST) Received: from cuda.sgi.com (cuda3.sgi.com [192.48.176.15]) by relay2.corp.sgi.com (Postfix) with ESMTP id 8DAE2304059 for ; Thu, 11 Feb 2016 15:40:21 -0800 (PST) X-ASG-Debug-ID: 1455234018-04cb6c1e5672eb0001-NocioJ Received: from aserp1040.oracle.com (aserp1040.oracle.com [141.146.126.69]) by cuda.sgi.com with ESMTP id VsslWDKGELitvuiN (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO) for ; Thu, 11 Feb 2016 15:40:18 -0800 (PST) X-Barracuda-Envelope-From: darrick.wong@oracle.com X-Barracuda-Apparent-Source-IP: 141.146.126.69 Received: from aserv0021.oracle.com (aserv0021.oracle.com [141.146.126.233]) by aserp1040.oracle.com (Sentrion-MTA-4.3.2/Sentrion-MTA-4.3.2) with ESMTP id u1BNeHQx023066 (version=TLSv1 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Thu, 11 Feb 2016 23:40:18 GMT Received: from userv0122.oracle.com (userv0122.oracle.com [156.151.31.75]) by aserv0021.oracle.com (8.13.8/8.13.8) with ESMTP id u1BNeHTc024635 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=FAIL); Thu, 11 Feb 2016 23:40:17 GMT Received: from abhmp0003.oracle.com (abhmp0003.oracle.com [141.146.116.9]) by userv0122.oracle.com (8.14.4/8.14.4) with ESMTP id u1BNeHTv030078; Thu, 11 Feb 2016 23:40:17 GMT Received: from localhost (/10.145.178.207) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Thu, 11 Feb 2016 15:40:16 -0800 Subject: [PATCH 09/32] reflink: refactor mixed block creation code From: "Darrick J. Wong" X-ASG-Orig-Subj: [PATCH 09/32] reflink: refactor mixed block creation code To: david@fromorbit.com, darrick.wong@oracle.com Cc: linux-btrfs@vger.kernel.org, fstests@vger.kernel.org, xfs@oss.sgi.com Date: Thu, 11 Feb 2016 15:40:15 -0800 Message-ID: <20160211234015.2202.41362.stgit@birch.djwong.org> In-Reply-To: <20160211233916.2202.40961.stgit@birch.djwong.org> References: <20160211233916.2202.40961.stgit@birch.djwong.org> User-Agent: StGit/0.17.1-dirty MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit X-Source-IP: aserv0021.oracle.com [141.146.126.233] X-Barracuda-Connect: aserp1040.oracle.com[141.146.126.69] X-Barracuda-Start-Time: 1455234018 X-Barracuda-Encrypted: ECDHE-RSA-AES256-GCM-SHA384 X-Barracuda-URL: https://192.48.176.15:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-BRTS-Status: 1 X-Barracuda-Spam-Score: 0.00 X-Barracuda-Spam-Status: No, SCORE=0.00 using per-user scores of TAG_LEVEL=1000.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.7 tests=BSF_SC0_MISMATCH_TO, UNPARSEABLE_RELAY X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.3.26959 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 0.00 BSF_SC0_MISMATCH_TO Envelope rcpt doesn't match header 0.00 UNPARSEABLE_RELAY Informational: message has unparseable relay lines Refactor the code that creates files with mixed block types that we feed into CoW tests to make sure that we can tiptoe around that kind of stuff. Signed-off-by: Darrick J. Wong --- common/reflink | 108 +++++++++++++++++++++++++++++++++++++++++++++++++ tests/generic/188 | 8 ---- tests/generic/189 | 8 ---- tests/generic/190 | 8 ---- tests/generic/191 | 8 ---- tests/generic/194 | 13 +----- tests/generic/195 | 13 +----- tests/generic/196 | 8 ---- tests/generic/197 | 8 ---- tests/generic/199 | 31 +------------- tests/generic/199.out | 4 +- tests/generic/200 | 31 +------------- tests/generic/200.out | 4 +- 13 files changed, 126 insertions(+), 126 deletions(-) diff --git a/common/reflink b/common/reflink index 3d6a8c1..b92f664 100644 --- a/common/reflink +++ b/common/reflink @@ -187,3 +187,111 @@ _dedupe_range() { "$XFS_IO_PROG" $xfs_io_args -f -c "dedupe $file1 $offset1 $offset2 $len" "$file2" } + +# Create a file of interleaved unwritten and reflinked blocks +_weave_reflink_unwritten() { + blksz=$1 + nr=$2 + sfile=$3 + dfile=$4 + + _pwrite_byte 0x61 0 $((blksz * nr)) $sfile + $XFS_IO_PROG -f -c "falloc 0 $((blksz * nr))" $dfile + _pwrite_byte 0x00 0 $((blksz * nr)) $dfile.chk + seq 0 2 $((nr - 1)) | while read i; do + _reflink_range $sfile $((blksz * i)) $dfile $((blksz * i)) $blksz + _pwrite_byte 0x61 $((blksz * i)) $blksz $dfile.chk + done +} + +# Create a file of interleaved holes and reflinked blocks +_weave_reflink_holes() { + blksz=$1 + nr=$2 + sfile=$3 + dfile=$4 + + _pwrite_byte 0x61 0 $((blksz * nr)) $sfile + $XFS_IO_PROG -f -c "truncate $((blksz * nr))" $dfile + _pwrite_byte 0x00 0 $((blksz * nr)) $dfile.chk + seq 0 2 $((nr - 1)) | while read i; do + _reflink_range $sfile $((blksz * i)) $dfile $((blksz * i)) $blksz + _pwrite_byte 0x61 $((blksz * i)) $blksz $dfile.chk + done +} + +# For a file created with _weave_reflink_holes, fill the holes with delalloc +# extents +_weave_reflink_holes_delalloc() { + blksz=$1 + nr=$2 + dfile=$3 + + seq 1 2 $((nr - 1)) | while read i; do + _pwrite_byte 0x62 $((blksz * i)) $blksz $dfile + _pwrite_byte 0x62 $((blksz * i)) $blksz $dfile.chk + done +} + +# Create a file of interleaved regular blocks and reflinked blocks +_weave_reflink_regular() { + blksz=$1 + nr=$2 + sfile=$3 + dfile=$4 + + _pwrite_byte 0x61 0 $((blksz * nr)) $sfile + _pwrite_byte 0x62 0 $((blksz * nr)) $dfile + _pwrite_byte 0x62 0 $((blksz * nr)) $dfile.chk + seq 0 2 $((nr - 1)) | while read i; do + _reflink_range $sfile $((blksz * i)) $dfile $((blksz * i)) $blksz + _pwrite_byte 0x61 $((blksz * i)) $blksz $dfile.chk + done +} + +# Create a file of interleaved holes, unwritten blocks, regular blocks, and +# reflinked blocks +_weave_reflink_rainbow() { + blksz=$1 + nr=$2 + sfile=$3 + dfile=$4 + + _pwrite_byte 0x61 0 $((blksz * nr)) $sfile + $XFS_IO_PROG -f -c "truncate $((blksz * nr))" $dfile + _pwrite_byte 0x00 0 $((blksz * nr)) $dfile.chk + # 0 blocks are reflinked + seq 0 5 $((nr - 1)) | while read i; do + _reflink_range $sfile $((blksz * i)) $dfile $((blksz * i)) $blksz + _pwrite_byte 0x61 $((blksz * i)) $blksz $dfile.chk + done + # 1 blocks are unwritten + seq 1 5 $((nr - 1)) | while read i; do + $XFS_IO_PROG -f -c "falloc $((blksz * i)) $blksz" $dfile + _pwrite_byte 0x00 $((blksz * i)) $blksz $dfile.chk + done + # 2 blocks are holes + seq 2 5 $((nr - 1)) | while read i; do + _pwrite_byte 0x00 $((blksz * i)) $blksz $dfile.chk + done + # 3 blocks are regular + seq 3 5 $((nr - 1)) | while read i; do + _pwrite_byte 0x71 $((blksz * i)) $blksz $dfile + _pwrite_byte 0x71 $((blksz * i)) $blksz $dfile.chk + done + # 4 blocks will be delalloc later +} + +# For a file created with _weave_reflink_rainbow, fill the holes with delalloc +# extents +_weave_reflink_rainbow_delalloc() { + blksz=$1 + nr=$2 + dfile=$3 + + # 4 blocks are delalloc (do later) + seq 4 5 $((nr - 1)) | while read i; do + _pwrite_byte 0x62 $((blksz * i)) $blksz $dfile + _pwrite_byte 0x62 $((blksz * i)) $blksz $dfile.chk + done +} diff --git a/tests/generic/188 b/tests/generic/188 index 7596c4b..86980cc 100755 --- a/tests/generic/188 +++ b/tests/generic/188 @@ -63,13 +63,7 @@ mkdir $testdir echo "Create the original files" blksz=65536 nr=64 -_pwrite_byte 0x61 0 $((blksz * nr)) "$testdir/file1" >> "$seqres.full" -$XFS_IO_PROG -f -c "falloc 0 $((blksz * nr))" "$testdir/file3" >> "$seqres.full" -_pwrite_byte 0x00 0 $((blksz * nr)) "$testdir/file3.chk" >> "$seqres.full" -seq 0 2 $((nr-1)) | while read f; do - _reflink_range "$testdir/file1" $((blksz * f)) "$testdir/file3" $((blksz * f)) $blksz >> "$seqres.full" - _pwrite_byte 0x61 $((blksz * f)) $blksz "$testdir/file3.chk" >> "$seqres.full" -done +_weave_reflink_unwritten $blksz $nr $testdir/file1 $testdir/file3 >> $seqres.full _scratch_remount echo "Compare files" diff --git a/tests/generic/189 b/tests/generic/189 index 130dc58..8f5a338 100755 --- a/tests/generic/189 +++ b/tests/generic/189 @@ -63,13 +63,7 @@ mkdir $testdir echo "Create the original files" blksz=65536 nr=64 -_pwrite_byte 0x61 0 $((blksz * nr)) "$testdir/file1" >> "$seqres.full" -$XFS_IO_PROG -f -c "falloc 0 $((blksz * nr))" "$testdir/file3" >> "$seqres.full" -_pwrite_byte 0x00 0 $((blksz * nr)) "$testdir/file3.chk" >> "$seqres.full" -seq 0 2 $((nr-1)) | while read f; do - _reflink_range "$testdir/file1" $((blksz * f)) "$testdir/file3" $((blksz * f)) $blksz >> "$seqres.full" - _pwrite_byte 0x61 $((blksz * f)) $blksz "$testdir/file3.chk" >> "$seqres.full" -done +_weave_reflink_unwritten $blksz $nr $testdir/file1 $testdir/file3 >> $seqres.full _scratch_remount echo "Compare files" diff --git a/tests/generic/190 b/tests/generic/190 index 0171475..8edfeb7 100755 --- a/tests/generic/190 +++ b/tests/generic/190 @@ -63,13 +63,7 @@ mkdir $testdir echo "Create the original files" blksz=65536 nr=64 -_pwrite_byte 0x61 0 $((blksz * nr)) "$testdir/file1" >> "$seqres.full" -$XFS_IO_PROG -f -c "truncate $((blksz * nr))" "$testdir/file3" >> "$seqres.full" -_pwrite_byte 0x00 0 $((blksz * nr)) "$testdir/file3.chk" >> "$seqres.full" -seq 0 2 $((nr-1)) | while read f; do - _reflink_range "$testdir/file1" $((blksz * f)) "$testdir/file3" $((blksz * f)) $blksz >> "$seqres.full" - _pwrite_byte 0x61 $((blksz * f)) $blksz "$testdir/file3.chk" >> "$seqres.full" -done +_weave_reflink_holes $blksz $nr $testdir/file1 $testdir/file3 >> $seqres.full _scratch_remount echo "Compare files" diff --git a/tests/generic/191 b/tests/generic/191 index 34d96f9..dd97baa 100755 --- a/tests/generic/191 +++ b/tests/generic/191 @@ -63,13 +63,7 @@ mkdir $testdir echo "Create the original files" blksz=65536 nr=64 -_pwrite_byte 0x61 0 $((blksz * nr)) "$testdir/file1" >> "$seqres.full" -$XFS_IO_PROG -f -c "truncate $((blksz * nr))" "$testdir/file3" >> "$seqres.full" -_pwrite_byte 0x00 0 $((blksz * nr)) "$testdir/file3.chk" >> "$seqres.full" -seq 0 2 $((nr-1)) | while read f; do - _reflink_range "$testdir/file1" $((blksz * f)) "$testdir/file3" $((blksz * f)) $blksz >> "$seqres.full" - _pwrite_byte 0x61 $((blksz * f)) $blksz "$testdir/file3.chk" >> "$seqres.full" -done +_weave_reflink_holes $blksz $nr $testdir/file1 $testdir/file3 >> $seqres.full _scratch_remount echo "Compare files" diff --git a/tests/generic/194 b/tests/generic/194 index e9feaad..82b3100 100755 --- a/tests/generic/194 +++ b/tests/generic/194 @@ -64,13 +64,7 @@ mkdir $testdir echo "Create the original files" blksz=65536 nr=64 -_pwrite_byte 0x61 0 $((blksz * nr)) "$testdir/file1" >> "$seqres.full" -$XFS_IO_PROG -f -c "truncate $((blksz * nr))" "$testdir/file3" >> "$seqres.full" -_pwrite_byte 0x00 0 $((blksz * nr)) "$testdir/file3.chk" >> "$seqres.full" -seq 0 2 $((nr-1)) | while read f; do - _reflink_range "$testdir/file1" $((blksz * f)) "$testdir/file3" $((blksz * f)) $blksz >> "$seqres.full" - _pwrite_byte 0x61 $((blksz * f)) $blksz "$testdir/file3.chk" >> "$seqres.full" -done +_weave_reflink_holes $blksz $nr $testdir/file1 $testdir/file3 >> $seqres.full _scratch_remount echo "Compare files" @@ -79,10 +73,7 @@ md5sum "$testdir/file3" | _filter_scratch md5sum "$testdir/file3.chk" | _filter_scratch echo "directio CoW across the transition" -seq 1 2 $((nr-1)) | while read f; do - _pwrite_byte 0x62 $((blksz * f)) $blksz "$testdir/file3" >> "$seqres.full" - _pwrite_byte 0x62 $((blksz * f)) $blksz "$testdir/file3.chk" >> "$seqres.full" -done +_weave_reflink_holes_delalloc $blksz $nr $testdir/file3 >> $seqres.full "$XFS_IO_PROG" -d -f -c "pwrite -S 0x63 -b $((blksz * nr / 2)) $((blksz * nr / 4)) $((blksz * nr / 2))" "$testdir/file3" >> "$seqres.full" _pwrite_byte 0x63 $((blksz * nr / 4)) $((blksz * nr / 2)) "$testdir/file3.chk" >> "$seqres.full" _scratch_remount diff --git a/tests/generic/195 b/tests/generic/195 index 32548ba..ce4c0a9 100755 --- a/tests/generic/195 +++ b/tests/generic/195 @@ -64,13 +64,7 @@ mkdir $testdir echo "Create the original files" blksz=65536 nr=64 -_pwrite_byte 0x61 0 $((blksz * nr)) "$testdir/file1" >> "$seqres.full" -$XFS_IO_PROG -f -c "truncate $((blksz * nr))" "$testdir/file3" >> "$seqres.full" -_pwrite_byte 0x00 0 $((blksz * nr)) "$testdir/file3.chk" >> "$seqres.full" -seq 0 2 $((nr-1)) | while read f; do - _reflink_range "$testdir/file1" $((blksz * f)) "$testdir/file3" $((blksz * f)) $blksz >> "$seqres.full" - _pwrite_byte 0x61 $((blksz * f)) $blksz "$testdir/file3.chk" >> "$seqres.full" -done +_weave_reflink_holes $blksz $nr $testdir/file1 $testdir/file3 >> $seqres.full _scratch_remount echo "Compare files" @@ -79,10 +73,7 @@ md5sum "$testdir/file3" | _filter_scratch md5sum "$testdir/file3.chk" | _filter_scratch echo "CoW across the transition" -seq 1 2 $((nr-1)) | while read f; do - _pwrite_byte 0x62 $((blksz * f)) $blksz "$testdir/file3" >> "$seqres.full" - _pwrite_byte 0x62 $((blksz * f)) $blksz "$testdir/file3.chk" >> "$seqres.full" -done +_weave_reflink_holes_delalloc $blksz $nr $testdir/file3 >> $seqres.full "$XFS_IO_PROG" -f -c "pwrite -S 0x63 -b $((blksz * nr / 2)) $((blksz * nr / 4)) $((blksz * nr / 2))" "$testdir/file3" >> "$seqres.full" _pwrite_byte 0x63 $((blksz * nr / 4)) $((blksz * nr / 2)) "$testdir/file3.chk" >> "$seqres.full" _scratch_remount diff --git a/tests/generic/196 b/tests/generic/196 index 4ec2cff..a7a0035 100755 --- a/tests/generic/196 +++ b/tests/generic/196 @@ -63,13 +63,7 @@ mkdir $testdir echo "Create the original files" blksz=65536 nr=64 -_pwrite_byte 0x61 0 $((blksz * nr)) "$testdir/file1" >> "$seqres.full" -_pwrite_byte 0x62 0 $((blksz * nr)) "$testdir/file3" >> "$seqres.full" -_pwrite_byte 0x62 0 $((blksz * nr)) "$testdir/file3.chk" >> "$seqres.full" -seq 0 2 $((nr-1)) | while read f; do - _reflink_range "$testdir/file1" $((blksz * f)) "$testdir/file3" $((blksz * f)) $blksz >> "$seqres.full" - _pwrite_byte 0x61 $((blksz * f)) $blksz "$testdir/file3.chk" >> "$seqres.full" -done +_weave_reflink_regular $blksz $nr $testdir/file1 $testdir/file3 >> $seqres.full _scratch_remount echo "Compare files" diff --git a/tests/generic/197 b/tests/generic/197 index 356a587..84a14ff 100755 --- a/tests/generic/197 +++ b/tests/generic/197 @@ -63,13 +63,7 @@ mkdir $testdir echo "Create the original files" blksz=65536 nr=64 -_pwrite_byte 0x61 0 $((blksz * nr)) "$testdir/file1" >> "$seqres.full" -_pwrite_byte 0x62 0 $((blksz * nr)) "$testdir/file3" >> "$seqres.full" -_pwrite_byte 0x62 0 $((blksz * nr)) "$testdir/file3.chk" >> "$seqres.full" -seq 0 2 $((nr-1)) | while read f; do - _reflink_range "$testdir/file1" $((blksz * f)) "$testdir/file3" $((blksz * f)) $blksz >> "$seqres.full" - _pwrite_byte 0x61 $((blksz * f)) $blksz "$testdir/file3.chk" >> "$seqres.full" -done +_weave_reflink_regular $blksz $nr $testdir/file1 $testdir/file3 >> $seqres.full _scratch_remount echo "Compare files" diff --git a/tests/generic/199 b/tests/generic/199 index 03b8fda..6a65533 100755 --- a/tests/generic/199 +++ b/tests/generic/199 @@ -69,30 +69,7 @@ mkdir $testdir echo "Create the original files" blksz=65536 nr=64 -_pwrite_byte 0x61 0 $((blksz * nr)) "$testdir/file1" >> "$seqres.full" -$XFS_IO_PROG -f -c "truncate $((blksz * nr))" "$testdir/file3" >> "$seqres.full" -# 0 blocks are reflinked -seq 0 5 $nr | while read f; do - _reflink_range "$testdir/file1" $((blksz * f)) "$testdir/file3" $((blksz * f)) $blksz >> "$seqres.full" - _pwrite_byte 0x61 $((blksz * f)) $blksz "$testdir/file3.chk" >> "$seqres.full" -done -sync -# 1 blocks are unwritten -seq 1 5 $nr | while read f; do - $XFS_IO_PROG -f -c "falloc $((blksz * f)) $blksz" "$testdir/file3" >> "$seqres.full" - _pwrite_byte 0x00 $((blksz * f)) $blksz "$testdir/file3.chk" >> "$seqres.full" -done -sync -# 2 blocks are holes -seq 2 5 $nr | while read f; do - _pwrite_byte 0x00 $((blksz * f)) $blksz "$testdir/file3.chk" >> "$seqres.full" -done -# 3 blocks are regular -seq 3 5 $nr | while read f; do - _pwrite_byte 0x71 $((blksz * f)) $blksz "$testdir/file3" >> "$seqres.full" - _pwrite_byte 0x71 $((blksz * f)) $blksz "$testdir/file3.chk" >> "$seqres.full" -done -sync +_weave_reflink_rainbow $blksz $nr $testdir/file1 $testdir/file3 >> $seqres.full _scratch_remount echo "Compare files" @@ -101,11 +78,7 @@ md5sum "$testdir/file3" | _filter_scratch md5sum "$testdir/file3.chk" | _filter_scratch echo "directio CoW across the transition" -# 4 blocks are delalloc (do later) -seq 4 5 $nr | while read f; do - _pwrite_byte 0x62 $((blksz * f)) $blksz "$testdir/file3" >> "$seqres.full" - _pwrite_byte 0x62 $((blksz * f)) $blksz "$testdir/file3.chk" >> "$seqres.full" -done +_weave_reflink_rainbow_delalloc $blksz $nr $testdir/file3 >> $seqres.full # now cow "$XFS_IO_PROG" -d -f -c "pwrite -S 0x63 -b $((blksz * nr / 2)) $((blksz * nr / 4)) $((blksz * nr / 2))" "$testdir/file3" >> "$seqres.full" _pwrite_byte 0x63 $((blksz * nr / 4)) $((blksz * nr / 2)) "$testdir/file3.chk" >> "$seqres.full" diff --git a/tests/generic/199.out b/tests/generic/199.out index b35c135..a1016ac 100644 --- a/tests/generic/199.out +++ b/tests/generic/199.out @@ -8,5 +8,5 @@ bdbcf02ee0aa977795a79d25fcfdccb1 SCRATCH_MNT/test-199/file1 directio CoW across the transition Compare files bdbcf02ee0aa977795a79d25fcfdccb1 SCRATCH_MNT/test-199/file1 -36f6b5317a9a921fc91175390ccf7f69 SCRATCH_MNT/test-199/file3 -36f6b5317a9a921fc91175390ccf7f69 SCRATCH_MNT/test-199/file3.chk +26aa3a0749b867ec58363c8539ee5471 SCRATCH_MNT/test-199/file3 +26aa3a0749b867ec58363c8539ee5471 SCRATCH_MNT/test-199/file3.chk diff --git a/tests/generic/200 b/tests/generic/200 index e71eedc..541d16d 100755 --- a/tests/generic/200 +++ b/tests/generic/200 @@ -69,30 +69,7 @@ mkdir $testdir echo "Create the original files" blksz=65536 nr=64 -_pwrite_byte 0x61 0 $((blksz * nr)) "$testdir/file1" >> "$seqres.full" -$XFS_IO_PROG -f -c "truncate $((blksz * nr))" "$testdir/file3" >> "$seqres.full" -# 0 blocks are reflinked -seq 0 5 $nr | while read f; do - _reflink_range "$testdir/file1" $((blksz * f)) "$testdir/file3" $((blksz * f)) $blksz >> "$seqres.full" - _pwrite_byte 0x61 $((blksz * f)) $blksz "$testdir/file3.chk" >> "$seqres.full" -done -sync -# 1 blocks are unwritten -seq 1 5 $nr | while read f; do - $XFS_IO_PROG -f -c "falloc $((blksz * f)) $blksz" "$testdir/file3" >> "$seqres.full" - _pwrite_byte 0x00 $((blksz * f)) $blksz "$testdir/file3.chk" >> "$seqres.full" -done -sync -# 2 blocks are holes -seq 2 5 $nr | while read f; do - _pwrite_byte 0x00 $((blksz * f)) $blksz "$testdir/file3.chk" >> "$seqres.full" -done -# 3 blocks are regular -seq 3 5 $nr | while read f; do - _pwrite_byte 0x71 $((blksz * f)) $blksz "$testdir/file3" >> "$seqres.full" - _pwrite_byte 0x71 $((blksz * f)) $blksz "$testdir/file3.chk" >> "$seqres.full" -done -sync +_weave_reflink_rainbow $blksz $nr $testdir/file1 $testdir/file3 >> $seqres.full _scratch_remount echo "Compare files" @@ -101,11 +78,7 @@ md5sum "$testdir/file3" | _filter_scratch md5sum "$testdir/file3.chk" | _filter_scratch echo "directio CoW across the transition" -# 4 blocks are delalloc (do later) -seq 4 5 $nr | while read f; do - _pwrite_byte 0x62 $((blksz * f)) $blksz "$testdir/file3" >> "$seqres.full" - _pwrite_byte 0x62 $((blksz * f)) $blksz "$testdir/file3.chk" >> "$seqres.full" -done +_weave_reflink_rainbow_delalloc $blksz $nr $testdir/file3 >> $seqres.full # now cow "$XFS_IO_PROG" -f -c "pwrite -S 0x63 -b $((blksz * nr / 2)) $((blksz * nr / 4)) $((blksz * nr / 2))" "$testdir/file3" >> "$seqres.full" _pwrite_byte 0x63 $((blksz * nr / 4)) $((blksz * nr / 2)) "$testdir/file3.chk" >> "$seqres.full" diff --git a/tests/generic/200.out b/tests/generic/200.out index 140eff9..76c01c7 100644 --- a/tests/generic/200.out +++ b/tests/generic/200.out @@ -8,5 +8,5 @@ bdbcf02ee0aa977795a79d25fcfdccb1 SCRATCH_MNT/test-200/file1 directio CoW across the transition Compare files bdbcf02ee0aa977795a79d25fcfdccb1 SCRATCH_MNT/test-200/file1 -36f6b5317a9a921fc91175390ccf7f69 SCRATCH_MNT/test-200/file3 -36f6b5317a9a921fc91175390ccf7f69 SCRATCH_MNT/test-200/file3.chk +26aa3a0749b867ec58363c8539ee5471 SCRATCH_MNT/test-200/file3 +26aa3a0749b867ec58363c8539ee5471 SCRATCH_MNT/test-200/file3.chk From darrick.wong@oracle.com Thu Feb 11 17:40:37 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay3.corp.sgi.com [198.149.34.15]) by oss.sgi.com (Postfix) with ESMTP id C49387CAE for ; Thu, 11 Feb 2016 17:40:37 -0600 (CST) Received: from cuda.sgi.com (cuda3.sgi.com [192.48.176.15]) by relay3.corp.sgi.com (Postfix) with ESMTP id 47105AC006 for ; Thu, 11 Feb 2016 15:40:37 -0800 (PST) X-ASG-Debug-ID: 1455234034-04cb6c1e5872ee0001-NocioJ Received: from userp1040.oracle.com (userp1040.oracle.com [156.151.31.81]) by cuda.sgi.com with ESMTP id mDQE2PhrDK9gxSrl (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO) for ; Thu, 11 Feb 2016 15:40:34 -0800 (PST) X-Barracuda-Envelope-From: darrick.wong@oracle.com X-Barracuda-Apparent-Source-IP: 156.151.31.81 Received: from userv0021.oracle.com (userv0021.oracle.com [156.151.31.71]) by userp1040.oracle.com (Sentrion-MTA-4.3.2/Sentrion-MTA-4.3.2) with ESMTP id u1BNeXpO032523 (version=TLSv1 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Thu, 11 Feb 2016 23:40:33 GMT Received: from aserv0122.oracle.com (aserv0122.oracle.com [141.146.126.236]) by userv0021.oracle.com (8.13.8/8.13.8) with ESMTP id u1BNeXla011369 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=FAIL); Thu, 11 Feb 2016 23:40:33 GMT Received: from abhmp0018.oracle.com (abhmp0018.oracle.com [141.146.116.24]) by aserv0122.oracle.com (8.13.8/8.13.8) with ESMTP id u1BNeWWo026974; Thu, 11 Feb 2016 23:40:32 GMT Received: from localhost (/10.145.178.207) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Thu, 11 Feb 2016 15:40:32 -0800 Subject: [PATCH 11/32] reflink: add _require_odirect to the directio tests From: "Darrick J. Wong" X-ASG-Orig-Subj: [PATCH 11/32] reflink: add _require_odirect to the directio tests To: david@fromorbit.com, darrick.wong@oracle.com Cc: linux-btrfs@vger.kernel.org, fstests@vger.kernel.org, xfs@oss.sgi.com Date: Thu, 11 Feb 2016 15:40:29 -0800 Message-ID: <20160211234029.2202.82743.stgit@birch.djwong.org> In-Reply-To: <20160211233916.2202.40961.stgit@birch.djwong.org> References: <20160211233916.2202.40961.stgit@birch.djwong.org> User-Agent: StGit/0.17.1-dirty MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit X-Source-IP: userv0021.oracle.com [156.151.31.71] X-Barracuda-Connect: userp1040.oracle.com[156.151.31.81] X-Barracuda-Start-Time: 1455234034 X-Barracuda-Encrypted: ECDHE-RSA-AES256-GCM-SHA384 X-Barracuda-URL: https://192.48.176.15:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-BRTS-Status: 1 X-Barracuda-Spam-Score: 0.00 X-Barracuda-Spam-Status: No, SCORE=0.00 using per-user scores of TAG_LEVEL=1000.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.7 tests=BSF_SC0_MISMATCH_TO, UNPARSEABLE_RELAY X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.3.26959 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 0.00 BSF_SC0_MISMATCH_TO Envelope rcpt doesn't match header 0.00 UNPARSEABLE_RELAY Informational: message has unparseable relay lines For the tests that test O_DIRECT, we need to _require_odirect. Signed-off-by: Darrick J. Wong --- tests/generic/139 | 1 + tests/generic/143 | 1 + tests/generic/155 | 1 + tests/generic/165 | 1 + tests/generic/166 | 1 + tests/generic/170 | 1 + tests/generic/174 | 1 + tests/generic/183 | 1 + tests/generic/187 | 1 + tests/generic/188 | 1 + tests/generic/190 | 1 + tests/generic/194 | 1 + tests/generic/196 | 1 + tests/generic/199 | 1 + tests/generic/200 | 1 + tests/generic/203 | 1 + tests/generic/206 | 1 + tests/generic/217 | 1 + tests/generic/220 | 1 + tests/generic/227 | 1 + tests/generic/238 | 1 + tests/generic/243 | 1 + 22 files changed, 22 insertions(+) diff --git a/tests/generic/139 b/tests/generic/139 index 5e7b631..989b054 100755 --- a/tests/generic/139 +++ b/tests/generic/139 @@ -47,6 +47,7 @@ _cleanup() _supported_os Linux _require_test_reflink _require_cp_reflink +_require_odirect rm -f $seqres.full diff --git a/tests/generic/143 b/tests/generic/143 index 586cf5c..703b585 100755 --- a/tests/generic/143 +++ b/tests/generic/143 @@ -49,6 +49,7 @@ _cleanup() _supported_os Linux _require_test_reflink _require_cp_reflink +_require_odirect rm -f $seqres.full diff --git a/tests/generic/155 b/tests/generic/155 index c6416a1..e96bda7 100755 --- a/tests/generic/155 +++ b/tests/generic/155 @@ -55,6 +55,7 @@ _supported_os Linux _require_test_reflink _require_cp_reflink _require_xfs_io_command "fzero" +_require_odirect rm -f $seqres.full diff --git a/tests/generic/165 b/tests/generic/165 index e4c9a9d..1ae08a4 100755 --- a/tests/generic/165 +++ b/tests/generic/165 @@ -47,6 +47,7 @@ _cleanup() _supported_os Linux _require_scratch_reflink _require_cp_reflink +_require_odirect echo "Format and mount" _scratch_mkfs > $seqres.full 2>&1 diff --git a/tests/generic/166 b/tests/generic/166 index 9be753d..9b177be 100755 --- a/tests/generic/166 +++ b/tests/generic/166 @@ -47,6 +47,7 @@ _cleanup() _supported_os Linux _require_scratch_reflink _require_cp_reflink +_require_odirect echo "Format and mount" _scratch_mkfs > $seqres.full 2>&1 diff --git a/tests/generic/170 b/tests/generic/170 index dbf1564..0f29b3a 100755 --- a/tests/generic/170 +++ b/tests/generic/170 @@ -46,6 +46,7 @@ _cleanup() # real QA test starts here _supported_os Linux _require_scratch_reflink +_require_odirect echo "Format and mount" _scratch_mkfs > $seqres.full 2>&1 diff --git a/tests/generic/174 b/tests/generic/174 index cec2f05..edfc2bc 100755 --- a/tests/generic/174 +++ b/tests/generic/174 @@ -46,6 +46,7 @@ _cleanup() _supported_os Linux _require_scratch_reflink _require_cp_reflink +_require_odirect rm -f $seqres.full diff --git a/tests/generic/183 b/tests/generic/183 index 0f35da2..0ab4afe 100755 --- a/tests/generic/183 +++ b/tests/generic/183 @@ -49,6 +49,7 @@ _cleanup() # real QA test starts here _supported_os Linux _require_scratch_reflink +_require_odirect rm -f $seqres.full diff --git a/tests/generic/187 b/tests/generic/187 index b8fade2..ac6037d 100755 --- a/tests/generic/187 +++ b/tests/generic/187 @@ -55,6 +55,7 @@ _require_cp_reflink _require_xfs_io_command "falloc" _require_xfs_io_command "fpunch" test $FSTYP = "btrfs" && _notrun "Can't fragment free space on btrfs." +_require_odirect rm -f $seqres.full diff --git a/tests/generic/188 b/tests/generic/188 index 7be1080..bb293b1 100755 --- a/tests/generic/188 +++ b/tests/generic/188 @@ -49,6 +49,7 @@ _cleanup() _supported_os Linux _require_scratch_reflink _require_xfs_io_command "falloc" +_require_odirect rm -f $seqres.full diff --git a/tests/generic/190 b/tests/generic/190 index a5c2137..b4de3ed 100755 --- a/tests/generic/190 +++ b/tests/generic/190 @@ -49,6 +49,7 @@ _cleanup() _supported_os Linux _require_scratch_reflink _require_xfs_io_command "falloc" +_require_odirect rm -f $seqres.full diff --git a/tests/generic/194 b/tests/generic/194 index 69a3e6c..f67e567 100755 --- a/tests/generic/194 +++ b/tests/generic/194 @@ -50,6 +50,7 @@ _cleanup() _supported_os Linux _require_scratch_reflink _require_xfs_io_command "falloc" +_require_odirect rm -f $seqres.full diff --git a/tests/generic/196 b/tests/generic/196 index 951079c..1505de8 100755 --- a/tests/generic/196 +++ b/tests/generic/196 @@ -49,6 +49,7 @@ _cleanup() _supported_os Linux _require_scratch_reflink _require_xfs_io_command "falloc" +_require_odirect rm -f $seqres.full diff --git a/tests/generic/199 b/tests/generic/199 index f457245..04380ed 100755 --- a/tests/generic/199 +++ b/tests/generic/199 @@ -55,6 +55,7 @@ _require_scratch_reflink _require_xfs_io_command "falloc" _require_xfs_io_command "fpunch" _require_cp_reflink +_require_odirect rm -f $seqres.full diff --git a/tests/generic/200 b/tests/generic/200 index ffb5869..2aa0315 100755 --- a/tests/generic/200 +++ b/tests/generic/200 @@ -55,6 +55,7 @@ _require_scratch_reflink _require_xfs_io_command "falloc" _require_xfs_io_command "fpunch" _require_cp_reflink +_require_odirect rm -f $seqres.full diff --git a/tests/generic/203 b/tests/generic/203 index 5d9bfc4..2ffb311 100755 --- a/tests/generic/203 +++ b/tests/generic/203 @@ -44,6 +44,7 @@ _cleanup() _supported_os Linux _require_scratch_reflink _require_cp_reflink +_require_odirect rm -f $seqres.full diff --git a/tests/generic/206 b/tests/generic/206 index 4054626..6b3e200 100755 --- a/tests/generic/206 +++ b/tests/generic/206 @@ -47,6 +47,7 @@ _cleanup() # real QA test starts here _supported_os Linux _require_scratch_reflink +_require_odirect rm -f $seqres.full diff --git a/tests/generic/217 b/tests/generic/217 index b1bd635..ce8e0a1 100755 --- a/tests/generic/217 +++ b/tests/generic/217 @@ -48,6 +48,7 @@ _cleanup() _supported_os Linux _require_scratch_reflink _require_xfs_io_command "falloc" +_require_odirect rm -f $seqres.full diff --git a/tests/generic/220 b/tests/generic/220 index edb8432..3bce21b 100755 --- a/tests/generic/220 +++ b/tests/generic/220 @@ -48,6 +48,7 @@ _cleanup() _supported_os Linux _require_scratch_reflink _require_xfs_io_command "falloc" +_require_odirect rm -f $seqres.full diff --git a/tests/generic/227 b/tests/generic/227 index abaf8f7..00985d3 100755 --- a/tests/generic/227 +++ b/tests/generic/227 @@ -48,6 +48,7 @@ _cleanup() _supported_os Linux _require_scratch_reflink _require_xfs_io_command "falloc" +_require_odirect rm -f $seqres.full diff --git a/tests/generic/238 b/tests/generic/238 index ce7408c..3b46492 100755 --- a/tests/generic/238 +++ b/tests/generic/238 @@ -48,6 +48,7 @@ _cleanup() _supported_os Linux _require_scratch_reflink _require_xfs_io_command "falloc" +_require_odirect rm -f $seqres.full diff --git a/tests/generic/243 b/tests/generic/243 index 127070e..e1d698b 100755 --- a/tests/generic/243 +++ b/tests/generic/243 @@ -47,6 +47,7 @@ _cleanup() _supported_os Linux _require_scratch_reflink _require_cp_reflink +_require_odirect rm -f $seqres.full From darrick.wong@oracle.com Thu Feb 11 17:40:46 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay3.corp.sgi.com [198.149.34.15]) by oss.sgi.com (Postfix) with ESMTP id 1CE1A7F5E for ; Thu, 11 Feb 2016 17:40:46 -0600 (CST) Received: from cuda.sgi.com (cuda2.sgi.com [192.48.176.25]) by relay3.corp.sgi.com (Postfix) with ESMTP id 939D9AC002 for ; Thu, 11 Feb 2016 15:40:45 -0800 (PST) X-ASG-Debug-ID: 1455234041-04cbb043318a020001-NocioJ Received: from userp1040.oracle.com (userp1040.oracle.com [156.151.31.81]) by cuda.sgi.com with ESMTP id Kvr2AGnzELYFCD9D (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO) for ; Thu, 11 Feb 2016 15:40:41 -0800 (PST) X-Barracuda-Envelope-From: darrick.wong@oracle.com X-Barracuda-Apparent-Source-IP: 156.151.31.81 Received: from aserv0022.oracle.com (aserv0022.oracle.com [141.146.126.234]) by userp1040.oracle.com (Sentrion-MTA-4.3.2/Sentrion-MTA-4.3.2) with ESMTP id u1BNed8B032558 (version=TLSv1 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Thu, 11 Feb 2016 23:40:40 GMT Received: from aserv0122.oracle.com (aserv0122.oracle.com [141.146.126.236]) by aserv0022.oracle.com (8.13.8/8.13.8) with ESMTP id u1BNedcP004526 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=FAIL); Thu, 11 Feb 2016 23:40:39 GMT Received: from abhmp0007.oracle.com (abhmp0007.oracle.com [141.146.116.13]) by aserv0122.oracle.com (8.13.8/8.13.8) with ESMTP id u1BNedAc026993; Thu, 11 Feb 2016 23:40:39 GMT Received: from localhost (/10.145.178.207) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Thu, 11 Feb 2016 15:40:38 -0800 Subject: [PATCH 12/32] dio: unwritten conversion bug tests From: "Darrick J. Wong" X-ASG-Orig-Subj: [PATCH 12/32] dio: unwritten conversion bug tests To: david@fromorbit.com, darrick.wong@oracle.com Cc: linux-btrfs@vger.kernel.org, fstests@vger.kernel.org, xfs@oss.sgi.com Date: Thu, 11 Feb 2016 15:40:37 -0800 Message-ID: <20160211234037.2202.93885.stgit@birch.djwong.org> In-Reply-To: <20160211233916.2202.40961.stgit@birch.djwong.org> References: <20160211233916.2202.40961.stgit@birch.djwong.org> User-Agent: StGit/0.17.1-dirty MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit X-Source-IP: aserv0022.oracle.com [141.146.126.234] X-Barracuda-Connect: userp1040.oracle.com[156.151.31.81] X-Barracuda-Start-Time: 1455234041 X-Barracuda-Encrypted: ECDHE-RSA-AES256-GCM-SHA384 X-Barracuda-URL: https://192.48.176.25:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-BRTS-Status: 1 X-Barracuda-Spam-Score: 0.00 X-Barracuda-Spam-Status: No, SCORE=0.00 using per-user scores of TAG_LEVEL=1000.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.7 tests=BSF_SC0_MISMATCH_TO, UNPARSEABLE_RELAY X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.3.26959 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 0.00 BSF_SC0_MISMATCH_TO Envelope rcpt doesn't match header 0.00 UNPARSEABLE_RELAY Informational: message has unparseable relay lines Check that we don't expose old disk contents when a directio write to an unwritten extent fails due to IO errors. This primarily affects XFS and ext4. Signed-off-by: Darrick J. Wong --- .gitignore | 1 src/aio-dio-regress/aiocp.c | 489 +++++++++++++++++++++++++++++++++++++++++++ tests/generic/250 | 100 +++++++++ tests/generic/250.out | 10 + tests/generic/252 | 103 +++++++++ tests/generic/252.out | 10 + tests/generic/group | 2 7 files changed, 715 insertions(+) create mode 100644 src/aio-dio-regress/aiocp.c create mode 100755 tests/generic/250 create mode 100644 tests/generic/250.out create mode 100755 tests/generic/252 create mode 100644 tests/generic/252.out diff --git a/.gitignore b/.gitignore index a6f47d3..bbe7c1a 100644 --- a/.gitignore +++ b/.gitignore @@ -112,6 +112,7 @@ /src/aio-dio-regress/aio-free-ring-with-bogus-nr-pages /src/aio-dio-regress/aio-io-setup-with-nonwritable-context-pointer /src/aio-dio-regress/aio-last-ref-held-by-io +/src/aio-dio-regress/aiocp /src/aio-dio-regress/aiodio_sparse2 /src/aio-dio-regress/aio-dio-eof-race /src/cloner diff --git a/src/aio-dio-regress/aiocp.c b/src/aio-dio-regress/aiocp.c new file mode 100644 index 0000000..1abff9c --- /dev/null +++ b/src/aio-dio-regress/aiocp.c @@ -0,0 +1,489 @@ +/* + * Copyright (c) 2004 Daniel McNeil + * 2004 Open Source Development Lab + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See + * the GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * + * Module: .c + */ + +/* + * Change History: + * + * + * version of copy command using async i/o + * From: Stephen Hemminger + * Modified by Daniel McNeil for testing aio. + * - added -a alignment + * - added -b blksize option + * _ added -s size option + * - added -f open_flag option + * - added -w (no write) option (reads from source only) + * - added -n (num aio) option + * - added -z (zero dest) opton (writes zeros to dest only) + * - added -D delay_ms option + * - 2/2004 Marty Ridgeway (mridge@us.ibm.com) Changes to adapt to LTP + * + * Copy file by using a async I/O state machine. + * 1. Start read request + * 2. When read completes turn it into a write request + * 3. When write completes decrement counter and free resources + * + * + * Usage: aiocp [-b blksize] -n [num_aio] [-w] [-z] [-s filesize] + * [-f DIRECT|TRUNC|CREAT|SYNC|LARGEFILE] src dest + */ + +//#define _GNU_SOURCE +//#define DEBUG 1 +#undef DEBUG + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include + +#define AIO_BLKSIZE (64*1024) +#define AIO_MAXIO 32 + +static int aio_blksize = AIO_BLKSIZE; +static int aio_maxio = AIO_MAXIO; + +static int busy = 0; // # of I/O's in flight +static int tocopy = 0; // # of blocks left to copy +static int srcfd; // source fd +static int dstfd = -1; // destination file descriptor +static const char *dstname = NULL; +static const char *srcname = NULL; +static int source_open_flag = O_RDONLY; /* open flags on source file */ +static int dest_open_flag = O_WRONLY; /* open flags on dest file */ +static int no_write; /* do not write */ +static int zero; /* write zero's only */ + +static int debug; +static int count_io_q_waits; /* how many time io_queue_wait called */ + +struct iocb **iocb_free; /* array of pointers to iocb */ +int iocb_free_count; /* current free count */ +int alignment = 512; /* buffer alignment */ + +struct timeval delay; /* delay between i/o */ + +int init_iocb(int n, int iosize) +{ + void *buf; + int i; + + if ((iocb_free = malloc(n * sizeof(struct iocb *))) == 0) { + return -1; + } + + for (i = 0; i < n; i++) { + if (!(iocb_free[i] = (struct iocb *) malloc(sizeof(struct iocb)))) + return -1; + if (posix_memalign(&buf, alignment, iosize)) + return -1; + if (debug > 1) { + printf("buf allocated at 0x%p, align:%d\n", + buf, alignment); + } + if (zero) { + /* + * We are writing zero's to dstfd + */ + memset(buf, 0, iosize); + } + io_prep_pread(iocb_free[i], -1, buf, iosize, 0); + } + iocb_free_count = i; + return 0; +} + +struct iocb *alloc_iocb() +{ + if (!iocb_free_count) + return 0; + return iocb_free[--iocb_free_count]; +} + +void free_iocb(struct iocb *io) +{ + iocb_free[iocb_free_count++] = io; +} + +/* + * io_wait_run() - wait for an io_event and then call the callback. + */ +int io_wait_run(io_context_t ctx, struct timespec *to) +{ + struct io_event events[aio_maxio]; + struct io_event *ep; + int ret, n; + + /* + * get up to aio_maxio events at a time. + */ + ret = n = io_getevents(ctx, 1, aio_maxio, events, to); + + /* + * Call the callback functions for each event. + */ + for (ep = events; n-- > 0; ep++) { + io_callback_t cb = (io_callback_t)ep->data; + struct iocb *iocb = (struct iocb *)ep->obj; + + cb(ctx, iocb, ep->res, ep->res2); + } + return ret; +} + +/* Fatal error handler */ +static void io_error(const char *func, int rc) +{ + if (rc == -ENOSYS) + fprintf(stderr, "AIO not in this kernel\n"); + else if (rc < 0) + fprintf(stderr, "%s: %s\n", func, strerror(-rc)); + else + fprintf(stderr, "%s: error %d\n", func, rc); + + if (dstfd > 0) + close(dstfd); + if (dstname && dest_open_flag & O_CREAT) + unlink(dstname); + exit(1); +} + +/* + * Write complete callback. + * Adjust counts and free resources + */ +static void wr_done(io_context_t ctx, struct iocb *iocb, long res, long res2) +{ + if (res2 != 0) { + io_error("aio write", res2); + } + if (res != iocb->u.c.nbytes) { + fprintf(stderr, "write missed bytes expect %lu got %ld\n", + iocb->u.c.nbytes, res2); + exit(1); + } + --tocopy; + --busy; + free_iocb(iocb); + if (debug) + write(2, "w", 1); +} + +/* + * Read complete callback. + * Change read iocb into a write iocb and start it. + */ +static void rd_done(io_context_t ctx, struct iocb *iocb, long res, long res2) +{ + /* library needs accessors to look at iocb? */ + int iosize = iocb->u.c.nbytes; + char *buf = iocb->u.c.buf; + off_t offset = iocb->u.c.offset; + + if (res2 != 0) + io_error("aio read", res2); + if (res != iosize) { + fprintf(stderr, "read missing bytes expect %lu got %ld\n", + iocb->u.c.nbytes, res); + exit(1); + } + + + /* turn read into write */ + if (no_write) { + --tocopy; + --busy; + free_iocb(iocb); + } else { + io_prep_pwrite(iocb, dstfd, buf, iosize, offset); + io_set_callback(iocb, wr_done); + if (1 != (res = io_submit(ctx, 1, &iocb))) + io_error("io_submit write", res); + } + if (debug) + write(2, "r", 1); + if (debug > 1) + printf("%d", iosize); +} + +void usage() +{ + fprintf(stderr, + "Usage: aiocp [-a align] [-s size] [-b blksize] [-n num_io]" + " [-f open_flag] SOURCE DEST\n" + "This copies from SOURCE to DEST using AIO.\n\n" + "Usage: aiocp [options] -w SOURCE\n" + "This does sequential AIO reads (no writes).\n\n" + "Usage: aiocp [options] -z DEST\n" + "This does sequential AIO writes of zeros.\n"); + + exit(1); +} + +/* + * Scale value by kilo, mega, or giga. + */ +long long scale_by_kmg(long long value, char scale) +{ + switch (scale) { + case 'g': + case 'G': + value *= 1024; + case 'm': + case 'M': + value *= 1024; + case 'k': + case 'K': + value *= 1024; + break; + case '\0': + break; + default: + usage(); + break; + } + return value; +} + +int main(int argc, char *const *argv) +{ + struct stat st; + off_t length = 0, offset = 0; + io_context_t myctx; + int c; + extern char *optarg; + extern int optind, opterr, optopt; + + while ((c = getopt(argc, argv, "a:b:df:n:s:wzD:")) != -1) { + char *endp; + + switch (c) { + case 'a': /* alignment of data buffer */ + alignment = strtol(optarg, &endp, 0); + alignment = (long)scale_by_kmg((long long)alignment, + *endp); + break; + case 'f': /* use these open flags */ + if (strcmp(optarg, "LARGEFILE") == 0 || + strcmp(optarg, "O_LARGEFILE") == 0) { + source_open_flag |= O_LARGEFILE; + dest_open_flag |= O_LARGEFILE; + } else if (strcmp(optarg, "TRUNC") == 0 || + strcmp(optarg, "O_TRUNC") == 0) { + dest_open_flag |= O_TRUNC; + } else if (strcmp(optarg, "SYNC") == 0 || + strcmp(optarg, "O_SYNC") == 0) { + dest_open_flag |= O_SYNC | O_NONBLOCK; + } else if (strcmp(optarg, "DIRECT") == 0 || + strcmp(optarg, "O_DIRECT") == 0) { + source_open_flag |= O_DIRECT; + dest_open_flag |= O_DIRECT; + } else if (strncmp(optarg, "CREAT", 5) == 0 || + strncmp(optarg, "O_CREAT", 5) == 0) { + dest_open_flag |= O_CREAT; + } + break; + case 'd': + debug++; + break; + case 'D': + delay.tv_usec = atoi(optarg); + break; + case 'b': /* block size */ + aio_blksize = strtol(optarg, &endp, 0); + aio_blksize = (long)scale_by_kmg((long long)aio_blksize, *endp); + break; + + case 'n': /* num io */ + aio_maxio = strtol(optarg, &endp, 0); + break; + case 's': /* size to transfer */ + length = strtoll(optarg, &endp, 0); + length = scale_by_kmg(length, *endp); + break; + case 'w': /* no write */ + no_write = 1; + break; + case 'z': /* write zero's */ + zero = 1; + break; + + default: + usage(); + } + } + + argc -= optind; + argv += optind; + +#ifndef DEBUG + if (argc < 1) { + usage(); + } +#else + source_open_flag |= O_DIRECT; + dest_open_flag |= O_DIRECT; + aio_blksize = 1; + aio_maxio=1; + srcname = "junkdata"; + dstname = "ff2"; +#endif + if (!zero) { +#ifndef DEBUG + if ((srcfd = open(srcname = *argv, source_open_flag)) < 0) { +#else + if ((srcfd = open(srcname, source_open_flag)) < 0) { +#endif + perror(srcname); + exit(1); + } + argv++; + argc--; + if (fstat(srcfd, &st) < 0) { + perror("fstat"); + exit(1); + } + if (length == 0) + length = st.st_size; + } + + if (!no_write) { + /* + * We are either copying or writing zeros to dstname + */ +#ifndef DEBUG + if (argc < 1) { + usage(); + } + if ((dstfd = open(dstname = *argv, dest_open_flag, 0666)) < 0) { +#else + if ((dstfd = open(dstname, dest_open_flag, 0666)) < 0) { +#endif + perror(dstname); + exit(1); + } + if (zero) { + /* + * get size of dest, if we are zeroing it. + * TODO: handle devices. + */ + if (fstat(dstfd, &st) < 0) { + perror("fstat"); + exit(1); + } + if (length == 0) + length = st.st_size; + } + } + + /* initialize state machine */ + memset(&myctx, 0, sizeof(myctx)); + io_queue_init(aio_maxio, &myctx); + tocopy = howmany(length, aio_blksize); +printf("tocopy=%d len=%d blk=%d\n", tocopy, length, aio_blksize); + if (init_iocb(aio_maxio, aio_blksize) < 0) { + fprintf(stderr, "Error allocating the i/o buffers\n"); + exit(1); + } + + while (tocopy > 0) { + int i, rc; + /* Submit as many reads as once as possible upto aio_maxio */ + int n = MIN(MIN(aio_maxio - busy, aio_maxio), + howmany(length - offset, aio_blksize)); + if (n > 0) { + struct iocb *ioq[n]; + + for (i = 0; i < n; i++) { + struct iocb *io = alloc_iocb(); + int iosize = MIN(length - offset, aio_blksize); + + if (zero) { + /* + * We are writing zero's to dstfd + */ + io_prep_pwrite(io, dstfd, io->u.c.buf, + iosize, offset); + io_set_callback(io, wr_done); + } else { + io_prep_pread(io, srcfd, io->u.c.buf, + iosize, offset); + io_set_callback(io, rd_done); + } + ioq[i] = io; + offset += iosize; + } + + rc = io_submit(myctx, n, ioq); + if (rc < 0) + io_error("io_submit", rc); + + busy += n; + if (debug > 1) + printf("io_submit(%d) busy:%d\n", n, busy); + if (delay.tv_usec) { + struct timeval t = delay; + (void)select(0,0,0,0,&t); + } + } + + /* + * We have submitted all the i/o requests. Wait for at least one to complete + * and call the callbacks. + */ + count_io_q_waits++; + rc = io_wait_run(myctx, 0); + if (rc < 0) + io_error("io_wait_run", rc); + + if (debug > 1) { + printf("io_wait_run: rc == %d\n", rc); + printf("busy:%d aio_maxio:%d tocopy:%d\n", + busy, aio_maxio, tocopy); + } + } + + if (srcfd != -1) + close(srcfd); + if (dstfd != -1) + close(dstfd); + exit(0); +} + +/* + * Results look like: + * [alanm@toolbox ~/MOT3]$ ../taio -d kernel-source-2.4.8-0.4g.ppc.rpm abc + * rrrrrrrrrrrrrrrwwwrwrrwwrrwrwwrrwrwrwwrrwrwrrrrwwrwwwrrwrrrwwwwwwwwwwwwwwwww + * rrrrrrrrrrrrrrwwwrrwrwrwrwrrwwwwwwwwwwwwwwrrrrrrrrrrrrrrrrrrwwwwrwrwwrwrwrwr + * wrrrrrrrwwwwwwwwwwwwwrrrwrrrwrrwrwwwwwwwwwwrrrrwwrwrrrrrrrrrrrwwwwwwwwwwwrww + * wwwrrrrrrrrwwrrrwwrwrwrwwwrrrrrrrwwwrrwwwrrwrwwwwwwwwrrrrrrrwwwrrrrrrrwwwwww + * wwwwwwwrwrrrrrrrrwrrwrrwrrwrwrrrwrrrwrrrwrwwwwwwwwwwwwwwwwwwrrrwwwrrrrrrrrrr + * rrwrrrrrrwrrwwwwwwwwwwwwwwwwrwwwrrwrwwrrrrrrrrrrrrrrrrrrrwwwwwwwwwwwwwwwwwww + * rrrrrwrrwrwrwrrwrrrwwwwwwwwrrrrwrrrwrwwrwrrrwrrwrrrrwwwwwwwrwrwwwwrwwrrrwrrr + * rrrwwwwwwwrrrrwwrrrrrrrrrrrrwrwrrrrwwwwwwwwwwwwwwrwrrrrwwwwrwrrrrwrwwwrrrwww + * rwwrrrrrrrwrrrrrrrrrrrrwwwwrrrwwwrwrrwwwwwwwwwwwwwwwwwwwwwrrrrrrrwwwwwwwrw + */ diff --git a/tests/generic/250 b/tests/generic/250 new file mode 100755 index 0000000..b0b175a --- /dev/null +++ b/tests/generic/250 @@ -0,0 +1,100 @@ +#! /bin/bash +# FS QA Test No. 250 +# +# Create an unwritten extent, set up dm-error, try a DIO write, then +# make sure we can't read back old disk contents. +# +#----------------------------------------------------------------------- +# Copyright (c) 2016, Oracle and/or its affiliates. All Rights Reserved. +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License as +# published by the Free Software Foundation. +# +# This program is distributed in the hope that it would be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write the Free Software Foundation, +# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA +#----------------------------------------------------------------------- + +seq=`basename $0` +seqres=$RESULT_DIR/$seq +echo "QA output created by $seq" + +here=`pwd` +tmp=/tmp/$$ +status=1 # failure is the default! +trap "_cleanup; exit \$status" 0 1 2 3 15 + +_cleanup() +{ + cd / + rm -rf $tmp.* $testdir + _dmerror_cleanup +} + +# get standard environment, filters and checks +. ./common/rc +. ./common/filter +. ./common/dmerror + +# real QA test starts here +_supported_os Linux +_require_scratch +_require_dm_target error +_require_xfs_io_command "falloc" + +rm -f $seqres.full + + +echo "Format and mount" +$XFS_IO_PROG -d -c "pwrite -S 0x69 -b 1048576 0 $((64 * 1048576))" $SCRATCH_DEV >> $seqres.full +_scratch_mkfs_sized $((64 * 1048576)) > $seqres.full 2>&1 +_dmerror_init +_dmerror_mount >> $seqres.full 2>&1 +_dmerror_unmount +_dmerror_mount + +testdir=$SCRATCH_MNT/test-$seq +mkdir $testdir + +blksz=65536 +nr=640 +bufnr=128 +filesize=$((blksz * nr)) +bufsize=$((blksz * bufnr)) + +_require_fs_space $SCRATCH_MNT $((filesize / 1024 * 5 / 4)) + +echo "Create the original files" +$XFS_IO_PROG -f -c "falloc 0 $filesize" $testdir/file2 >> $seqres.full +_dmerror_unmount +_dmerror_mount + +echo "Compare files" +md5sum $testdir/file2 | _filter_scratch + +echo "CoW and unmount" +$XFS_IO_PROG -f -c "pwrite -S 0x63 $bufsize 1" $testdir/file2 >> $seqres.full +sync +_dmerror_load_error_table +$XFS_IO_PROG -d -f -c "pwrite -S 0x63 -b $bufsize 0 $filesize" $testdir/file2 >> $seqres.full +_dmerror_load_working_table +_dmerror_unmount +_dmerror_mount + +echo "Compare files" +md5sum $testdir/file2 | _filter_scratch + +echo "Check for damage" +_dmerror_unmount +_dmerror_cleanup +_repair_scratch_fs >> $seqres.full + +# success, all done +status=0 +exit diff --git a/tests/generic/250.out b/tests/generic/250.out new file mode 100644 index 0000000..710c80e --- /dev/null +++ b/tests/generic/250.out @@ -0,0 +1,10 @@ +QA output created by 250 +Format and mount +Create the original files +Compare files +ec8bb3b24d5b0f1b5bdf8c8f0f541ee6 SCRATCH_MNT/test-250/file2 +CoW and unmount +pwrite64: Input/output error +Compare files +3ed86318f4ff8da26c1c2a6e3041f9be SCRATCH_MNT/test-250/file2 +Check for damage diff --git a/tests/generic/252 b/tests/generic/252 new file mode 100755 index 0000000..fc9a723 --- /dev/null +++ b/tests/generic/252 @@ -0,0 +1,103 @@ +#! /bin/bash +# FS QA Test No. 252 +# +# Create an unwritten extent, set up dm-error, try an AIO DIO write, then +# make sure we can't read back old disk contents. +# +#----------------------------------------------------------------------- +# Copyright (c) 2016, Oracle and/or its affiliates. All Rights Reserved. +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License as +# published by the Free Software Foundation. +# +# This program is distributed in the hope that it would be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write the Free Software Foundation, +# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA +#----------------------------------------------------------------------- + +seq=`basename $0` +seqres=$RESULT_DIR/$seq +echo "QA output created by $seq" + +here=`pwd` +tmp=/tmp/$$ +status=1 # failure is the default! +trap "_cleanup; exit \$status" 0 1 2 3 15 + +_cleanup() +{ + cd / + rm -rf $tmp.* $testdir $TEST_DIR/moo + _dmerror_cleanup +} + +# get standard environment, filters and checks +. ./common/rc +. ./common/filter +. ./common/dmerror + +# real QA test starts here +_supported_os Linux +_require_scratch +_require_dm_target error +_require_xfs_io_command "falloc" +_require_test_program "aio-dio-regress/aiocp" +AIO_TEST="src/aio-dio-regress/aiocp" + +rm -f $seqres.full + + +echo "Format and mount" +$XFS_IO_PROG -d -c "pwrite -S 0x69 -b 1048576 0 $((64 * 1048576))" $SCRATCH_DEV >> $seqres.full +_scratch_mkfs_sized $((64 * 1048576)) > $seqres.full 2>&1 +_dmerror_init +_dmerror_mount >> $seqres.full 2>&1 +_dmerror_unmount +_dmerror_mount + +testdir=$SCRATCH_MNT/test-$seq +mkdir $testdir + +blksz=65536 +nr=640 +bufnr=128 +filesize=$((blksz * nr)) +bufsize=$((blksz * bufnr)) + +_require_fs_space $SCRATCH_MNT $((filesize / 1024 * 5 / 4)) + +echo "Create the original files" +$XFS_IO_PROG -f -c "falloc 0 $filesize" $testdir/file2 >> $seqres.full +_dmerror_unmount +_dmerror_mount + +echo "Compare files" +md5sum $testdir/file2 | _filter_scratch + +echo "CoW and unmount" +$XFS_IO_PROG -f -c "pwrite -S 0x63 $bufsize 1" $testdir/file2 >> $seqres.full +$XFS_IO_PROG -f -c "pwrite -S 0x63 -b $bufsize 0 $filesize" $TEST_DIR/moo >> $seqres.full +sync +_dmerror_load_error_table +$AIO_TEST -f DIRECT -b $bufsize $TEST_DIR/moo $testdir/file2 >> $seqres.full +_dmerror_load_working_table +_dmerror_unmount +_dmerror_mount + +echo "Compare files" +md5sum $testdir/file2 | _filter_scratch + +echo "Check for damage" +_dmerror_unmount +_dmerror_cleanup +_repair_scratch_fs >> $seqres.full + +# success, all done +status=0 +exit diff --git a/tests/generic/252.out b/tests/generic/252.out new file mode 100644 index 0000000..3bc78c2 --- /dev/null +++ b/tests/generic/252.out @@ -0,0 +1,10 @@ +QA output created by 252 +Format and mount +Create the original files +Compare files +ec8bb3b24d5b0f1b5bdf8c8f0f541ee6 SCRATCH_MNT/test-252/file2 +CoW and unmount +write missed bytes expect 8388608 got 0 +Compare files +3ed86318f4ff8da26c1c2a6e3041f9be SCRATCH_MNT/test-252/file2 +Check for damage diff --git a/tests/generic/group b/tests/generic/group index 860ff4a..0e4e7d3 100644 --- a/tests/generic/group +++ b/tests/generic/group @@ -252,7 +252,9 @@ 247 auto quick rw 248 auto quick rw 249 auto quick rw +250 auto quick prealloc rw 251 ioctl trim +252 auto quick prealloc rw 255 auto quick prealloc 256 auto quick 257 dir auto quick From darrick.wong@oracle.com Thu Feb 11 17:40:52 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay3.corp.sgi.com [198.149.34.15]) by oss.sgi.com (Postfix) with ESMTP id 073AA7F75 for ; Thu, 11 Feb 2016 17:40:52 -0600 (CST) Received: from cuda.sgi.com (cuda2.sgi.com [192.48.176.25]) by relay3.corp.sgi.com (Postfix) with ESMTP id 74956AC002 for ; Thu, 11 Feb 2016 15:40:51 -0800 (PST) X-ASG-Debug-ID: 1455234047-04cbb043318a030001-NocioJ Received: from aserp1040.oracle.com (aserp1040.oracle.com [141.146.126.69]) by cuda.sgi.com with ESMTP id vZkGKYHhZh2Zaim5 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO) for ; Thu, 11 Feb 2016 15:40:47 -0800 (PST) X-Barracuda-Envelope-From: darrick.wong@oracle.com X-Barracuda-Apparent-Source-IP: 141.146.126.69 Received: from aserv0022.oracle.com (aserv0022.oracle.com [141.146.126.234]) by aserp1040.oracle.com (Sentrion-MTA-4.3.2/Sentrion-MTA-4.3.2) with ESMTP id u1BNekgd023478 (version=TLSv1 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Thu, 11 Feb 2016 23:40:46 GMT Received: from aserv0121.oracle.com (aserv0121.oracle.com [141.146.126.235]) by aserv0022.oracle.com (8.13.8/8.13.8) with ESMTP id u1BNekGW004755 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=FAIL); Thu, 11 Feb 2016 23:40:46 GMT Received: from abhmp0006.oracle.com (abhmp0006.oracle.com [141.146.116.12]) by aserv0121.oracle.com (8.13.8/8.13.8) with ESMTP id u1BNekMj026310; Thu, 11 Feb 2016 23:40:46 GMT Received: from localhost (/10.145.178.207) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Thu, 11 Feb 2016 15:40:45 -0800 Subject: [PATCH 13/32] reflink: test intersecting CoW and falloc/fpunch/fzero/fcollapse/finsert/ftrunc From: "Darrick J. Wong" X-ASG-Orig-Subj: [PATCH 13/32] reflink: test intersecting CoW and falloc/fpunch/fzero/fcollapse/finsert/ftrunc To: david@fromorbit.com, darrick.wong@oracle.com Cc: linux-btrfs@vger.kernel.org, fstests@vger.kernel.org, xfs@oss.sgi.com Date: Thu, 11 Feb 2016 15:40:44 -0800 Message-ID: <20160211234044.2202.25667.stgit@birch.djwong.org> In-Reply-To: <20160211233916.2202.40961.stgit@birch.djwong.org> References: <20160211233916.2202.40961.stgit@birch.djwong.org> User-Agent: StGit/0.17.1-dirty MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit X-Source-IP: aserv0022.oracle.com [141.146.126.234] X-Barracuda-Connect: aserp1040.oracle.com[141.146.126.69] X-Barracuda-Start-Time: 1455234047 X-Barracuda-Encrypted: ECDHE-RSA-AES256-GCM-SHA384 X-Barracuda-URL: https://192.48.176.25:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-BRTS-Status: 1 X-Barracuda-Spam-Score: 0.00 X-Barracuda-Spam-Status: No, SCORE=0.00 using per-user scores of TAG_LEVEL=1000.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.7 tests=BSF_SC0_MISMATCH_TO, UNPARSEABLE_RELAY X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.3.26959 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 0.00 BSF_SC0_MISMATCH_TO Envelope rcpt doesn't match header 0.00 UNPARSEABLE_RELAY Informational: message has unparseable relay lines Ensure that we correctly handle a CoW operation immediately followed by a truncate, falloc, fpunch, fzero, fcollapse, and finsert operation in the middle of the CoW'd region before any flush can occur. Signed-off-by: Darrick J. Wong --- tests/generic/253 | 90 +++++++++++++++++++++++++++++++++++++++++++++++ tests/generic/253.out | 12 ++++++ tests/generic/254 | 90 +++++++++++++++++++++++++++++++++++++++++++++++ tests/generic/254.out | 12 ++++++ tests/generic/259 | 90 +++++++++++++++++++++++++++++++++++++++++++++++ tests/generic/259.out | 12 ++++++ tests/generic/261 | 90 +++++++++++++++++++++++++++++++++++++++++++++++ tests/generic/261.out | 12 ++++++ tests/generic/262 | 93 +++++++++++++++++++++++++++++++++++++++++++++++++ tests/generic/262.out | 12 ++++++ tests/generic/264 | 90 +++++++++++++++++++++++++++++++++++++++++++++++ tests/generic/264.out | 12 ++++++ tests/generic/group | 6 +++ 13 files changed, 621 insertions(+) create mode 100755 tests/generic/253 create mode 100644 tests/generic/253.out create mode 100755 tests/generic/254 create mode 100644 tests/generic/254.out create mode 100755 tests/generic/259 create mode 100644 tests/generic/259.out create mode 100755 tests/generic/261 create mode 100644 tests/generic/261.out create mode 100755 tests/generic/262 create mode 100644 tests/generic/262.out create mode 100755 tests/generic/264 create mode 100644 tests/generic/264.out diff --git a/tests/generic/253 b/tests/generic/253 new file mode 100755 index 0000000..bfb91a3 --- /dev/null +++ b/tests/generic/253 @@ -0,0 +1,90 @@ +#! /bin/bash +# FS QA Test No. 253 +# +# Truncate a file at midway through a CoW region. +# +# This test is dependent on the system page size, so we cannot use md5 in +# the golden output; we can only compare to a check file. +# +#----------------------------------------------------------------------- +# Copyright (c) 2016, Oracle and/or its affiliates. All Rights Reserved. +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License as +# published by the Free Software Foundation. +# +# This program is distributed in the hope that it would be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write the Free Software Foundation, +# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA +#----------------------------------------------------------------------- + +seq=`basename $0` +seqres=$RESULT_DIR/$seq +echo "QA output created by $seq" + +here=`pwd` +tmp=/tmp/$$ +status=1 # failure is the default! +trap "_cleanup; exit \$status" 0 1 2 3 15 + +_cleanup() +{ + cd / + rm -rf $tmp.* +} + +# get standard environment, filters and checks +. ./common/rc +. ./common/filter +. ./common/reflink + +# real QA test starts here +_supported_os Linux +_require_scratch_reflink +_require_cp_reflink +_require_xfs_io_command "truncate" + +rm -f $seqres.full + + +echo "Format and mount" +_scratch_mkfs > $seqres.full 2>&1 +_scratch_mount >> $seqres.full 2>&1 + +testdir=$SCRATCH_MNT/test-$seq +mkdir $testdir + +blksz=65536 +nr=4 +filesize=$((blksz * nr)) + +echo "Create the original files" +_pwrite_byte 0x61 0 $filesize $testdir/file1 >> $seqres.full +_cp_reflink $testdir/file1 $testdir/file2 >> $seqres.full +_pwrite_byte 0x61 0 $filesize $testdir/file2.chk >> $seqres.full +_scratch_remount + +echo "Compare files" +md5sum $testdir/file1 | _filter_scratch +md5sum $testdir/file2 | _filter_scratch +md5sum $testdir/file2.chk | _filter_scratch + +echo "CoW and unmount" +$XFS_IO_PROG -f -c "pwrite -S 0x62 -b $((blksz * 2)) $blksz $((blksz * 2))" -c "truncate $((blksz * 2))" $testdir/file2 >> $seqres.full +_scratch_remount +$XFS_IO_PROG -f -c "pwrite -S 0x62 -b $((blksz * 2)) $blksz $((blksz * 2))" -c "truncate $((blksz * 2))" $testdir/file2.chk >> $seqres.full +_scratch_remount + +echo "Compare files" +md5sum $testdir/file1 | _filter_scratch +md5sum $testdir/file2 | _filter_scratch +md5sum $testdir/file2.chk | _filter_scratch + +# success, all done +status=0 +exit diff --git a/tests/generic/253.out b/tests/generic/253.out new file mode 100644 index 0000000..3364ba0 --- /dev/null +++ b/tests/generic/253.out @@ -0,0 +1,12 @@ +QA output created by 253 +Format and mount +Create the original files +Compare files +c946b71bb69c07daf25470742c967e7c SCRATCH_MNT/test-253/file1 +c946b71bb69c07daf25470742c967e7c SCRATCH_MNT/test-253/file2 +c946b71bb69c07daf25470742c967e7c SCRATCH_MNT/test-253/file2.chk +CoW and unmount +Compare files +c946b71bb69c07daf25470742c967e7c SCRATCH_MNT/test-253/file1 +b5fc98f04b19fa7b2085ec1358c78760 SCRATCH_MNT/test-253/file2 +b5fc98f04b19fa7b2085ec1358c78760 SCRATCH_MNT/test-253/file2.chk diff --git a/tests/generic/254 b/tests/generic/254 new file mode 100755 index 0000000..f16cdd3 --- /dev/null +++ b/tests/generic/254 @@ -0,0 +1,90 @@ +#! /bin/bash +# FS QA Test No. 254 +# +# Punch a file at midway through a CoW region. +# +# This test is dependent on the system page size, so we cannot use md5 in +# the golden output; we can only compare to a check file. +# +#----------------------------------------------------------------------- +# Copyright (c) 2016, Oracle and/or its affiliates. All Rights Reserved. +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License as +# published by the Free Software Foundation. +# +# This program is distributed in the hope that it would be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write the Free Software Foundation, +# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA +#----------------------------------------------------------------------- + +seq=`basename $0` +seqres=$RESULT_DIR/$seq +echo "QA output created by $seq" + +here=`pwd` +tmp=/tmp/$$ +status=1 # failure is the default! +trap "_cleanup; exit \$status" 0 1 2 3 15 + +_cleanup() +{ + cd / + rm -rf $tmp.* +} + +# get standard environment, filters and checks +. ./common/rc +. ./common/filter +. ./common/reflink + +# real QA test starts here +_supported_os Linux +_require_scratch_reflink +_require_cp_reflink +_require_xfs_io_command "fpunch" + +rm -f $seqres.full + + +echo "Format and mount" +_scratch_mkfs > $seqres.full 2>&1 +_scratch_mount >> $seqres.full 2>&1 + +testdir=$SCRATCH_MNT/test-$seq +mkdir $testdir + +blksz=65536 +nr=5 +filesize=$((blksz * nr)) + +echo "Create the original files" +_pwrite_byte 0x61 0 $filesize $testdir/file1 >> $seqres.full +_cp_reflink $testdir/file1 $testdir/file2 >> $seqres.full +_pwrite_byte 0x61 0 $filesize $testdir/file2.chk >> $seqres.full +_scratch_remount + +echo "Compare files" +md5sum $testdir/file1 | _filter_scratch +md5sum $testdir/file2 | _filter_scratch +md5sum $testdir/file2.chk | _filter_scratch + +echo "CoW and unmount" +$XFS_IO_PROG -f -c "pwrite -S 0x62 -b $((blksz * 3)) $blksz $((blksz * 3))" -c "fpunch $((blksz * 2)) $blksz" $testdir/file2 >> $seqres.full +_scratch_remount +$XFS_IO_PROG -f -c "pwrite -S 0x62 -b $((blksz * 3)) $blksz $((blksz * 3))" -c "pwrite -S 0x00 $((blksz * 2)) $blksz" $testdir/file2.chk >> $seqres.full +_scratch_remount + +echo "Compare files" +md5sum $testdir/file1 | _filter_scratch +md5sum $testdir/file2 | _filter_scratch +md5sum $testdir/file2.chk | _filter_scratch + +# success, all done +status=0 +exit diff --git a/tests/generic/254.out b/tests/generic/254.out new file mode 100644 index 0000000..97a8b5a --- /dev/null +++ b/tests/generic/254.out @@ -0,0 +1,12 @@ +QA output created by 254 +Format and mount +Create the original files +Compare files +17af09af790a9b4c79cddf72f6b642cb SCRATCH_MNT/test-254/file1 +17af09af790a9b4c79cddf72f6b642cb SCRATCH_MNT/test-254/file2 +17af09af790a9b4c79cddf72f6b642cb SCRATCH_MNT/test-254/file2.chk +CoW and unmount +Compare files +17af09af790a9b4c79cddf72f6b642cb SCRATCH_MNT/test-254/file1 +b9f7a56c2ab90569cb19d8597583c6a6 SCRATCH_MNT/test-254/file2 +b9f7a56c2ab90569cb19d8597583c6a6 SCRATCH_MNT/test-254/file2.chk diff --git a/tests/generic/259 b/tests/generic/259 new file mode 100755 index 0000000..6718c50 --- /dev/null +++ b/tests/generic/259 @@ -0,0 +1,90 @@ +#! /bin/bash +# FS QA Test No. 259 +# +# fzero a file at midway through a CoW region. +# +# This test is dependent on the system page size, so we cannot use md5 in +# the golden output; we can only compare to a check file. +# +#----------------------------------------------------------------------- +# Copyright (c) 2016, Oracle and/or its affiliates. All Rights Reserved. +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License as +# published by the Free Software Foundation. +# +# This program is distributed in the hope that it would be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write the Free Software Foundation, +# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA +#----------------------------------------------------------------------- + +seq=`basename $0` +seqres=$RESULT_DIR/$seq +echo "QA output created by $seq" + +here=`pwd` +tmp=/tmp/$$ +status=1 # failure is the default! +trap "_cleanup; exit \$status" 0 1 2 3 15 + +_cleanup() +{ + cd / + rm -rf $tmp.* +} + +# get standard environment, filters and checks +. ./common/rc +. ./common/filter +. ./common/reflink + +# real QA test starts here +_supported_os Linux +_require_scratch_reflink +_require_cp_reflink +_require_xfs_io_command "fzero" + +rm -f $seqres.full + + +echo "Format and mount" +_scratch_mkfs > $seqres.full 2>&1 +_scratch_mount >> $seqres.full 2>&1 + +testdir=$SCRATCH_MNT/test-$seq +mkdir $testdir + +blksz=65536 +nr=5 +filesize=$((blksz * nr)) + +echo "Create the original files" +_pwrite_byte 0x61 0 $filesize $testdir/file1 >> $seqres.full +_cp_reflink $testdir/file1 $testdir/file2 >> $seqres.full +_pwrite_byte 0x61 0 $filesize $testdir/file2.chk >> $seqres.full +_scratch_remount + +echo "Compare files" +md5sum $testdir/file1 | _filter_scratch +md5sum $testdir/file2 | _filter_scratch +md5sum $testdir/file2.chk | _filter_scratch + +echo "CoW and unmount" +$XFS_IO_PROG -f -c "pwrite -S 0x62 -b $((blksz * 3)) $blksz $((blksz * 3))" -c "fzero $((blksz * 2)) $blksz" $testdir/file2 >> $seqres.full +_scratch_remount +$XFS_IO_PROG -f -c "pwrite -S 0x62 -b $((blksz * 3)) $blksz $((blksz * 3))" -c "pwrite -S 0x00 $((blksz * 2)) $blksz" $testdir/file2.chk >> $seqres.full +_scratch_remount + +echo "Compare files" +md5sum $testdir/file1 | _filter_scratch +md5sum $testdir/file2 | _filter_scratch +md5sum $testdir/file2.chk | _filter_scratch + +# success, all done +status=0 +exit diff --git a/tests/generic/259.out b/tests/generic/259.out new file mode 100644 index 0000000..3517fb1 --- /dev/null +++ b/tests/generic/259.out @@ -0,0 +1,12 @@ +QA output created by 259 +Format and mount +Create the original files +Compare files +17af09af790a9b4c79cddf72f6b642cb SCRATCH_MNT/test-259/file1 +17af09af790a9b4c79cddf72f6b642cb SCRATCH_MNT/test-259/file2 +17af09af790a9b4c79cddf72f6b642cb SCRATCH_MNT/test-259/file2.chk +CoW and unmount +Compare files +17af09af790a9b4c79cddf72f6b642cb SCRATCH_MNT/test-259/file1 +b9f7a56c2ab90569cb19d8597583c6a6 SCRATCH_MNT/test-259/file2 +b9f7a56c2ab90569cb19d8597583c6a6 SCRATCH_MNT/test-259/file2.chk diff --git a/tests/generic/261 b/tests/generic/261 new file mode 100755 index 0000000..28d0e0b --- /dev/null +++ b/tests/generic/261 @@ -0,0 +1,90 @@ +#! /bin/bash +# FS QA Test No. 261 +# +# fcollapse a file at midway through a CoW region. +# +# This test is dependent on the system page size, so we cannot use md5 in +# the golden output; we can only compare to a check file. +# +#----------------------------------------------------------------------- +# Copyright (c) 2016, Oracle and/or its affiliates. All Rights Reserved. +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License as +# published by the Free Software Foundation. +# +# This program is distributed in the hope that it would be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write the Free Software Foundation, +# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA +#----------------------------------------------------------------------- + +seq=`basename $0` +seqres=$RESULT_DIR/$seq +echo "QA output created by $seq" + +here=`pwd` +tmp=/tmp/$$ +status=1 # failure is the default! +trap "_cleanup; exit \$status" 0 1 2 3 15 + +_cleanup() +{ + cd / + rm -rf $tmp.* +} + +# get standard environment, filters and checks +. ./common/rc +. ./common/filter +. ./common/reflink + +# real QA test starts here +_supported_os Linux +_require_scratch_reflink +_require_cp_reflink +_require_xfs_io_command "fcollapse" + +rm -f $seqres.full + + +echo "Format and mount" +_scratch_mkfs > $seqres.full 2>&1 +_scratch_mount >> $seqres.full 2>&1 + +testdir=$SCRATCH_MNT/test-$seq +mkdir $testdir + +blksz=65536 +nr=5 +filesize=$((blksz * nr)) + +echo "Create the original files" +_pwrite_byte 0x61 0 $filesize $testdir/file1 >> $seqres.full +_cp_reflink $testdir/file1 $testdir/file2 >> $seqres.full +_pwrite_byte 0x61 0 $filesize $testdir/file2.chk >> $seqres.full +_scratch_remount + +echo "Compare files" +md5sum $testdir/file1 | _filter_scratch +md5sum $testdir/file2 | _filter_scratch +md5sum $testdir/file2.chk | _filter_scratch + +echo "CoW and unmount" +$XFS_IO_PROG -f -c "pwrite -S 0x62 -b $((blksz * 3)) $blksz $((blksz * 3))" -c "fcollapse $((blksz * 2)) $blksz" $testdir/file2 >> $seqres.full +_scratch_remount +$XFS_IO_PROG -f -c "pwrite -S 0x62 -b $((blksz * 2)) $blksz $((blksz * 2))" -c "truncate $((blksz * (nr - 1)))" $testdir/file2.chk >> $seqres.full +_scratch_remount + +echo "Compare files" +md5sum $testdir/file1 | _filter_scratch +md5sum $testdir/file2 | _filter_scratch +md5sum $testdir/file2.chk | _filter_scratch + +# success, all done +status=0 +exit diff --git a/tests/generic/261.out b/tests/generic/261.out new file mode 100644 index 0000000..43691ad --- /dev/null +++ b/tests/generic/261.out @@ -0,0 +1,12 @@ +QA output created by 261 +Format and mount +Create the original files +Compare files +17af09af790a9b4c79cddf72f6b642cb SCRATCH_MNT/test-261/file1 +17af09af790a9b4c79cddf72f6b642cb SCRATCH_MNT/test-261/file2 +17af09af790a9b4c79cddf72f6b642cb SCRATCH_MNT/test-261/file2.chk +CoW and unmount +Compare files +17af09af790a9b4c79cddf72f6b642cb SCRATCH_MNT/test-261/file1 +91b31bb8bffa8c3d3374445039287226 SCRATCH_MNT/test-261/file2 +91b31bb8bffa8c3d3374445039287226 SCRATCH_MNT/test-261/file2.chk diff --git a/tests/generic/262 b/tests/generic/262 new file mode 100755 index 0000000..aaf38cf --- /dev/null +++ b/tests/generic/262 @@ -0,0 +1,93 @@ +#! /bin/bash +# FS QA Test No. 262 +# +# finsert a file at midway through a CoW region. +# +# This test is dependent on the system page size, so we cannot use md5 in +# the golden output; we can only compare to a check file. +# +#----------------------------------------------------------------------- +# Copyright (c) 2016, Oracle and/or its affiliates. All Rights Reserved. +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License as +# published by the Free Software Foundation. +# +# This program is distributed in the hope that it would be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write the Free Software Foundation, +# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA +#----------------------------------------------------------------------- + +seq=`basename $0` +seqres=$RESULT_DIR/$seq +echo "QA output created by $seq" + +here=`pwd` +tmp=/tmp/$$ +status=1 # failure is the default! +trap "_cleanup; exit \$status" 0 1 2 3 15 + +_cleanup() +{ + cd / + rm -rf $tmp.* +} + +# get standard environment, filters and checks +. ./common/rc +. ./common/filter +. ./common/reflink + +# real QA test starts here +_supported_os Linux +_require_scratch_reflink +_require_cp_reflink +_require_xfs_io_command "finsert" + +rm -f $seqres.full + + +echo "Format and mount" +_scratch_mkfs > $seqres.full 2>&1 +_scratch_mount >> $seqres.full 2>&1 + +testdir=$SCRATCH_MNT/test-$seq +mkdir $testdir + +blksz=65536 +nr=4 +filesize=$((blksz * nr)) + +echo "Create the original files" +_pwrite_byte 0x61 0 $filesize $testdir/file1 >> $seqres.full +_cp_reflink $testdir/file1 $testdir/file2 >> $seqres.full +_pwrite_byte 0x61 0 $filesize $testdir/file2.chk >> $seqres.full +_scratch_remount + +echo "Compare files" +md5sum $testdir/file1 | _filter_scratch +md5sum $testdir/file2 | _filter_scratch +md5sum $testdir/file2.chk | _filter_scratch + +echo "CoW and unmount" +$XFS_IO_PROG -f -c "pwrite -S 0x62 -b $((blksz * 2)) $blksz $((blksz * 2))" -c "finsert $((blksz * 2)) $blksz" $testdir/file2 >> $seqres.full +_scratch_remount +_pwrite_byte 0x62 $blksz $blksz $testdir/file2.chk >> $seqres.full +_pwrite_byte 0x00 $((blksz * 2)) $blksz $testdir/file2.chk >> $seqres.full +_pwrite_byte 0x62 $((blksz * 3)) $blksz $testdir/file2.chk >> $seqres.full +_pwrite_byte 0x61 $((blksz * 4)) $blksz $testdir/file2.chk >> $seqres.full +_scratch_remount + +echo "Compare files" +md5sum $testdir/file1 | _filter_scratch +md5sum $testdir/file2 | _filter_scratch +md5sum $testdir/file2.chk | _filter_scratch + +# success, all done +status=0 +exit diff --git a/tests/generic/262.out b/tests/generic/262.out new file mode 100644 index 0000000..32c7503 --- /dev/null +++ b/tests/generic/262.out @@ -0,0 +1,12 @@ +QA output created by 262 +Format and mount +Create the original files +Compare files +c946b71bb69c07daf25470742c967e7c SCRATCH_MNT/test-262/file1 +c946b71bb69c07daf25470742c967e7c SCRATCH_MNT/test-262/file2 +c946b71bb69c07daf25470742c967e7c SCRATCH_MNT/test-262/file2.chk +CoW and unmount +Compare files +c946b71bb69c07daf25470742c967e7c SCRATCH_MNT/test-262/file1 +b9f7a56c2ab90569cb19d8597583c6a6 SCRATCH_MNT/test-262/file2 +b9f7a56c2ab90569cb19d8597583c6a6 SCRATCH_MNT/test-262/file2.chk diff --git a/tests/generic/264 b/tests/generic/264 new file mode 100755 index 0000000..d5bcca6 --- /dev/null +++ b/tests/generic/264 @@ -0,0 +1,90 @@ +#! /bin/bash +# FS QA Test No. 264 +# +# fallocate a file at midway through a CoW region. +# +# This test is dependent on the system page size, so we cannot use md5 in +# the golden output; we can only compare to a check file. +# +#----------------------------------------------------------------------- +# Copyright (c) 2016, Oracle and/or its affiliates. All Rights Reserved. +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License as +# published by the Free Software Foundation. +# +# This program is distributed in the hope that it would be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write the Free Software Foundation, +# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA +#----------------------------------------------------------------------- + +seq=`basename $0` +seqres=$RESULT_DIR/$seq +echo "QA output created by $seq" + +here=`pwd` +tmp=/tmp/$$ +status=1 # failure is the default! +trap "_cleanup; exit \$status" 0 1 2 3 15 + +_cleanup() +{ + cd / + rm -rf $tmp.* +} + +# get standard environment, filters and checks +. ./common/rc +. ./common/filter +. ./common/reflink + +# real QA test starts here +_supported_os Linux +_require_scratch_reflink +_require_cp_reflink +_require_xfs_io_command "falloc" + +rm -f $seqres.full + + +echo "Format and mount" +_scratch_mkfs > $seqres.full 2>&1 +_scratch_mount >> $seqres.full 2>&1 + +testdir=$SCRATCH_MNT/test-$seq +mkdir $testdir + +blksz=65536 +nr=5 +filesize=$((blksz * nr)) + +echo "Create the original files" +_pwrite_byte 0x61 0 $filesize $testdir/file1 >> $seqres.full +_cp_reflink $testdir/file1 $testdir/file2 >> $seqres.full +_pwrite_byte 0x61 0 $filesize $testdir/file2.chk >> $seqres.full +_scratch_remount + +echo "Compare files" +md5sum $testdir/file1 | _filter_scratch +md5sum $testdir/file2 | _filter_scratch +md5sum $testdir/file2.chk | _filter_scratch + +echo "CoW and unmount" +$XFS_IO_PROG -f -c "pwrite -S 0x62 -b $((blksz * 3)) $blksz $((blksz * 3))" -c "falloc $((blksz * 2)) $blksz" $testdir/file2 >> $seqres.full +_scratch_remount +$XFS_IO_PROG -f -c "pwrite -S 0x62 -b $((blksz * 3)) $blksz $((blksz * 3))" $testdir/file2.chk >> $seqres.full +_scratch_remount + +echo "Compare files" +md5sum $testdir/file1 | _filter_scratch +md5sum $testdir/file2 | _filter_scratch +md5sum $testdir/file2.chk | _filter_scratch + +# success, all done +status=0 +exit diff --git a/tests/generic/264.out b/tests/generic/264.out new file mode 100644 index 0000000..cd6904b --- /dev/null +++ b/tests/generic/264.out @@ -0,0 +1,12 @@ +QA output created by 264 +Format and mount +Create the original files +Compare files +17af09af790a9b4c79cddf72f6b642cb SCRATCH_MNT/test-264/file1 +17af09af790a9b4c79cddf72f6b642cb SCRATCH_MNT/test-264/file2 +17af09af790a9b4c79cddf72f6b642cb SCRATCH_MNT/test-264/file2.chk +CoW and unmount +Compare files +17af09af790a9b4c79cddf72f6b642cb SCRATCH_MNT/test-264/file1 +3383b9c17e643acd1a9a249cf041e183 SCRATCH_MNT/test-264/file2 +3383b9c17e643acd1a9a249cf041e183 SCRATCH_MNT/test-264/file2.chk diff --git a/tests/generic/group b/tests/generic/group index 0e4e7d3..b768882 100644 --- a/tests/generic/group +++ b/tests/generic/group @@ -255,12 +255,18 @@ 250 auto quick prealloc rw 251 ioctl trim 252 auto quick prealloc rw +253 auto quick clone +254 auto quick clone 255 auto quick prealloc 256 auto quick 257 dir auto quick 258 auto quick +259 auto quick clone 260 auto quick trim +261 auto quick clone +262 auto quick clone 263 rw auto quick +264 auto quick clone 269 auto rw prealloc ioctl enospc stress 270 auto quota rw prealloc ioctl enospc stress 273 auto rw From darrick.wong@oracle.com Thu Feb 11 17:41:02 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay2.corp.sgi.com [137.38.102.29]) by oss.sgi.com (Postfix) with ESMTP id C327D7F6D for ; Thu, 11 Feb 2016 17:41:02 -0600 (CST) Received: from cuda.sgi.com (cuda1.sgi.com [192.48.157.11]) by relay2.corp.sgi.com (Postfix) with ESMTP id 78897304059 for ; Thu, 11 Feb 2016 15:41:02 -0800 (PST) X-ASG-Debug-ID: 1455234055-04bdf066ea738f0001-NocioJ Received: from aserp1040.oracle.com (aserp1040.oracle.com [141.146.126.69]) by cuda.sgi.com with ESMTP id t0S0RLLj5xlZMDNq (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO) for ; Thu, 11 Feb 2016 15:40:55 -0800 (PST) X-Barracuda-Envelope-From: darrick.wong@oracle.com X-Barracuda-Apparent-Source-IP: 141.146.126.69 Received: from aserv0022.oracle.com (aserv0022.oracle.com [141.146.126.234]) by aserp1040.oracle.com (Sentrion-MTA-4.3.2/Sentrion-MTA-4.3.2) with ESMTP id u1BNes7e023583 (version=TLSv1 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Thu, 11 Feb 2016 23:40:54 GMT Received: from userv0122.oracle.com (userv0122.oracle.com [156.151.31.75]) by aserv0022.oracle.com (8.13.8/8.13.8) with ESMTP id u1BNerK8004980 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=FAIL); Thu, 11 Feb 2016 23:40:54 GMT Received: from abhmp0012.oracle.com (abhmp0012.oracle.com [141.146.116.18]) by userv0122.oracle.com (8.14.4/8.14.4) with ESMTP id u1BNermt030339; Thu, 11 Feb 2016 23:40:53 GMT Received: from localhost (/10.145.178.207) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Thu, 11 Feb 2016 15:40:52 -0800 Subject: [PATCH 14/32] reflink: test CoW behavior with IO errors From: "Darrick J. Wong" X-ASG-Orig-Subj: [PATCH 14/32] reflink: test CoW behavior with IO errors To: david@fromorbit.com, darrick.wong@oracle.com Cc: linux-btrfs@vger.kernel.org, fstests@vger.kernel.org, xfs@oss.sgi.com Date: Thu, 11 Feb 2016 15:40:50 -0800 Message-ID: <20160211234050.2202.4569.stgit@birch.djwong.org> In-Reply-To: <20160211233916.2202.40961.stgit@birch.djwong.org> References: <20160211233916.2202.40961.stgit@birch.djwong.org> User-Agent: StGit/0.17.1-dirty MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit X-Source-IP: aserv0022.oracle.com [141.146.126.234] X-Barracuda-Connect: aserp1040.oracle.com[141.146.126.69] X-Barracuda-Start-Time: 1455234055 X-Barracuda-Encrypted: ECDHE-RSA-AES256-GCM-SHA384 X-Barracuda-URL: https://192.48.157.11:443/cgi-mod/mark.cgi X-Barracuda-BRTS-Status: 1 X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-Spam-Score: 0.00 X-Barracuda-Spam-Status: No, SCORE=0.00 using per-user scores of TAG_LEVEL=1000.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.7 tests=BSF_SC0_MISMATCH_TO, UNPARSEABLE_RELAY X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.3.26959 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 0.00 BSF_SC0_MISMATCH_TO Envelope rcpt doesn't match header 0.00 UNPARSEABLE_RELAY Informational: message has unparseable relay lines Test various scenarios (with dm-flakey) where we simulate write failures during CoW, to see if the FS can get through it without blowing up or corrupting data. Plumb in a FS-generic method to sort out repairing filesystems after they get hit by IO errors. Signed-off-by: Darrick J. Wong --- tests/generic/265 | 99 +++++++++++++++++++++++++++++++++++++++++++++++ tests/generic/265.out | 11 +++++ tests/generic/266 | 97 ++++++++++++++++++++++++++++++++++++++++++++++ tests/generic/266.out | 11 +++++ tests/generic/267 | 100 +++++++++++++++++++++++++++++++++++++++++++++++ tests/generic/267.out | 10 +++++ tests/generic/268 | 103 +++++++++++++++++++++++++++++++++++++++++++++++++ tests/generic/268.out | 12 ++++++ tests/generic/271 | 100 +++++++++++++++++++++++++++++++++++++++++++++++ tests/generic/271.out | 11 +++++ tests/generic/272 | 98 ++++++++++++++++++++++++++++++++++++++++++++++ tests/generic/272.out | 11 +++++ tests/generic/276 | 101 ++++++++++++++++++++++++++++++++++++++++++++++++ tests/generic/276.out | 11 +++++ tests/generic/278 | 104 +++++++++++++++++++++++++++++++++++++++++++++++++ tests/generic/278.out | 12 ++++++ tests/generic/279 | 100 +++++++++++++++++++++++++++++++++++++++++++++++ tests/generic/279.out | 11 +++++ tests/generic/281 | 98 ++++++++++++++++++++++++++++++++++++++++++++++ tests/generic/281.out | 11 +++++ tests/generic/282 | 101 ++++++++++++++++++++++++++++++++++++++++++++++++ tests/generic/282.out | 10 +++++ tests/generic/283 | 104 +++++++++++++++++++++++++++++++++++++++++++++++++ tests/generic/283.out | 12 ++++++ tests/generic/group | 12 ++++++ 25 files changed, 1350 insertions(+) create mode 100755 tests/generic/265 create mode 100644 tests/generic/265.out create mode 100755 tests/generic/266 create mode 100644 tests/generic/266.out create mode 100755 tests/generic/267 create mode 100644 tests/generic/267.out create mode 100755 tests/generic/268 create mode 100644 tests/generic/268.out create mode 100755 tests/generic/271 create mode 100644 tests/generic/271.out create mode 100755 tests/generic/272 create mode 100644 tests/generic/272.out create mode 100755 tests/generic/276 create mode 100644 tests/generic/276.out create mode 100755 tests/generic/278 create mode 100644 tests/generic/278.out create mode 100755 tests/generic/279 create mode 100644 tests/generic/279.out create mode 100755 tests/generic/281 create mode 100644 tests/generic/281.out create mode 100755 tests/generic/282 create mode 100644 tests/generic/282.out create mode 100755 tests/generic/283 create mode 100644 tests/generic/283.out diff --git a/tests/generic/265 b/tests/generic/265 new file mode 100755 index 0000000..607867d --- /dev/null +++ b/tests/generic/265 @@ -0,0 +1,99 @@ +#! /bin/bash +# FS QA Test No. 265 +# +# Test CoW behavior when the write temporarily fails. +# +#----------------------------------------------------------------------- +# Copyright (c) 2016, Oracle and/or its affiliates. All Rights Reserved. +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License as +# published by the Free Software Foundation. +# +# This program is distributed in the hope that it would be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write the Free Software Foundation, +# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA +#----------------------------------------------------------------------- + +seq=`basename $0` +seqres=$RESULT_DIR/$seq +echo "QA output created by $seq" + +here=`pwd` +tmp=/tmp/$$ +status=1 # failure is the default! +trap "_cleanup; exit \$status" 0 1 2 3 15 + +_cleanup() +{ + cd / + rm -rf $tmp.* + _dmerror_cleanup +} + +# get standard environment, filters and checks +. ./common/rc +. ./common/filter +. ./common/reflink +. ./common/dmerror + +# real QA test starts here +_supported_os Linux +_require_scratch_reflink +_require_cp_reflink +_need_to_be_root +_require_dm_target error + +rm -f $seqres.full + + +echo "Format and mount" +_scratch_mkfs > $seqres.full 2>&1 +_dmerror_init +_dmerror_mount >> $seqres.full 2>&1 + +testdir=$SCRATCH_MNT/test-$seq +mkdir $testdir + +blksz=65536 +nr=640 +bufnr=128 +filesize=$((blksz * nr)) +bufsize=$((blksz * bufnr)) + +_require_fs_space $SCRATCH_MNT $((filesize / 1024 * 3 * 5 / 4)) + +echo "Create the original files" +$XFS_IO_PROG -f -c "pwrite -S 0x61 -b $bufsize 0 $filesize" $testdir/file1 >> $seqres.full +_cp_reflink $testdir/file1 $testdir/file2 >> $seqres.full +_dmerror_unmount +_dmerror_mount + +echo "Compare files" +md5sum $testdir/file1 | _filter_scratch +md5sum $testdir/file2 | _filter_scratch + +echo "CoW and unmount" +sync +_dmerror_load_error_table +$XFS_IO_PROG -f -c "pwrite -S 0x63 -b $bufsize 0 $filesize" -c "fdatasync" $testdir/file2 >> $seqres.full +_dmerror_load_working_table +_dmerror_unmount +_dmerror_mount + +echo "Compare files" +md5sum $testdir/file1 | _filter_scratch + +echo "Check for damage" +_dmerror_unmount +_dmerror_cleanup +_repair_scratch_fs >> $seqres.full + +# success, all done +status=0 +exit diff --git a/tests/generic/265.out b/tests/generic/265.out new file mode 100644 index 0000000..1b67114 --- /dev/null +++ b/tests/generic/265.out @@ -0,0 +1,11 @@ +QA output created by 265 +Format and mount +Create the original files +Compare files +1886e67cf8783e89ce6ddc5bb09a3944 SCRATCH_MNT/test-265/file1 +1886e67cf8783e89ce6ddc5bb09a3944 SCRATCH_MNT/test-265/file2 +CoW and unmount +fdatasync: Input/output error +Compare files +1886e67cf8783e89ce6ddc5bb09a3944 SCRATCH_MNT/test-265/file1 +Check for damage diff --git a/tests/generic/266 b/tests/generic/266 new file mode 100755 index 0000000..102df76 --- /dev/null +++ b/tests/generic/266 @@ -0,0 +1,97 @@ +#! /bin/bash +# FS QA Test No. 266 +# +# Test CoW behavior when the write permanently fails. +# +#----------------------------------------------------------------------- +# Copyright (c) 2016, Oracle and/or its affiliates. All Rights Reserved. +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License as +# published by the Free Software Foundation. +# +# This program is distributed in the hope that it would be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write the Free Software Foundation, +# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA +#----------------------------------------------------------------------- + +seq=`basename $0` +seqres=$RESULT_DIR/$seq +echo "QA output created by $seq" + +here=`pwd` +tmp=/tmp/$$ +status=1 # failure is the default! +trap "_cleanup; exit \$status" 0 1 2 3 15 + +_cleanup() +{ + cd / + rm -rf $tmp.* + _dmerror_cleanup +} + +# get standard environment, filters and checks +. ./common/rc +. ./common/filter +. ./common/reflink +. ./common/dmerror + +# real QA test starts here +_supported_os Linux +_require_scratch_reflink +_require_cp_reflink +_need_to_be_root +_require_dm_target error + +rm -f $seqres.full + + +echo "Format and mount" +_scratch_mkfs > $seqres.full 2>&1 +_dmerror_init +_dmerror_mount >> $seqres.full 2>&1 + +testdir=$SCRATCH_MNT/test-$seq +mkdir $testdir + +blksz=65536 +nr=640 +bufnr=128 +filesize=$((blksz * nr)) +bufsize=$((blksz * bufnr)) + +_require_fs_space $SCRATCH_MNT $((filesize / 1024 * 3 * 5 / 4)) + +echo "Create the original files" +$XFS_IO_PROG -f -c "pwrite -S 0x61 -b $bufsize 0 $filesize" $testdir/file1 >> $seqres.full +_cp_reflink $testdir/file1 $testdir/file2 >> $seqres.full +_dmerror_unmount +_dmerror_mount + +echo "Compare files" +md5sum $testdir/file1 | _filter_scratch +md5sum $testdir/file2 | _filter_scratch + +echo "CoW and unmount" +sync +_dmerror_load_error_table +$XFS_IO_PROG -f -c "pwrite -S 0x63 -b $bufsize 0 $filesize" -c "fdatasync" $testdir/file2 >> $seqres.full + +echo "Clean up the mess" +_dmerror_unmount +_dmerror_cleanup +_repair_scratch_fs >> $seqres.full +_scratch_mount >> $seqres.full 2>&1 + +echo "Compare files" +md5sum $testdir/file1 | _filter_scratch + +# success, all done +status=0 +exit diff --git a/tests/generic/266.out b/tests/generic/266.out new file mode 100644 index 0000000..dd34ad3 --- /dev/null +++ b/tests/generic/266.out @@ -0,0 +1,11 @@ +QA output created by 266 +Format and mount +Create the original files +Compare files +1886e67cf8783e89ce6ddc5bb09a3944 SCRATCH_MNT/test-266/file1 +1886e67cf8783e89ce6ddc5bb09a3944 SCRATCH_MNT/test-266/file2 +CoW and unmount +fdatasync: Input/output error +Clean up the mess +Compare files +1886e67cf8783e89ce6ddc5bb09a3944 SCRATCH_MNT/test-266/file1 diff --git a/tests/generic/267 b/tests/generic/267 new file mode 100755 index 0000000..24b7b7c --- /dev/null +++ b/tests/generic/267 @@ -0,0 +1,100 @@ +#! /bin/bash +# FS QA Test No. 267 +# +# Test CoW behavior when the write temporarily fails and we unmount. +# +#----------------------------------------------------------------------- +# Copyright (c) 2016, Oracle and/or its affiliates. All Rights Reserved. +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License as +# published by the Free Software Foundation. +# +# This program is distributed in the hope that it would be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write the Free Software Foundation, +# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA +#----------------------------------------------------------------------- + +seq=`basename $0` +seqres=$RESULT_DIR/$seq +echo "QA output created by $seq" + +here=`pwd` +tmp=/tmp/$$ +status=1 # failure is the default! +trap "_cleanup; exit \$status" 0 1 2 3 15 + +_cleanup() +{ + cd / + rm -rf $tmp.* + _dmerror_cleanup +} + +# get standard environment, filters and checks +. ./common/rc +. ./common/filter +. ./common/reflink +. ./common/dmerror + +# real QA test starts here +_supported_os Linux +_require_scratch_reflink +_require_cp_reflink +_need_to_be_root +_require_dm_target error + +rm -f $seqres.full + + +echo "Format and mount" +_scratch_mkfs > $seqres.full 2>&1 +_dmerror_init +_dmerror_mount >> $seqres.full 2>&1 + +testdir=$SCRATCH_MNT/test-$seq +mkdir $testdir + +blksz=65536 +nr=640 +bufnr=128 +filesize=$((blksz * nr)) +bufsize=$((blksz * bufnr)) + +_require_fs_space $SCRATCH_MNT $((filesize / 1024 * 3 * 5 / 4)) + +echo "Create the original files" +$XFS_IO_PROG -f -c "pwrite -S 0x61 -b $bufsize 0 $filesize" $testdir/file1 >> $seqres.full +_cp_reflink $testdir/file1 $testdir/file2 >> $seqres.full +_dmerror_unmount +_dmerror_mount + +echo "Compare files" +md5sum $testdir/file1 | _filter_scratch +md5sum $testdir/file2 | _filter_scratch + +echo "CoW and unmount" +sync +_dmerror_load_error_table +$XFS_IO_PROG -f -c "pwrite -S 0x63 -b $bufsize 0 $filesize" $testdir/file2 >> $seqres.full +_dmerror_load_working_table +rm -rf $testdir/file2 >> $seqres.full 2>&1 +_dmerror_unmount +_dmerror_mount + +echo "Compare files" +md5sum $testdir/file1 | _filter_scratch + +echo "Check for damage" +_dmerror_unmount +_dmerror_cleanup +_repair_scratch_fs >> $seqres.full + +# success, all done +status=0 +exit diff --git a/tests/generic/267.out b/tests/generic/267.out new file mode 100644 index 0000000..3c58e67 --- /dev/null +++ b/tests/generic/267.out @@ -0,0 +1,10 @@ +QA output created by 267 +Format and mount +Create the original files +Compare files +1886e67cf8783e89ce6ddc5bb09a3944 SCRATCH_MNT/test-267/file1 +1886e67cf8783e89ce6ddc5bb09a3944 SCRATCH_MNT/test-267/file2 +CoW and unmount +Compare files +1886e67cf8783e89ce6ddc5bb09a3944 SCRATCH_MNT/test-267/file1 +Check for damage diff --git a/tests/generic/268 b/tests/generic/268 new file mode 100755 index 0000000..c17ea57 --- /dev/null +++ b/tests/generic/268 @@ -0,0 +1,103 @@ +#! /bin/bash +# FS QA Test No. 268 +# +# Test CoW behavior when the write temporarily fails but the userspace +# program writes again. +# +#----------------------------------------------------------------------- +# Copyright (c) 2016, Oracle and/or its affiliates. All Rights Reserved. +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License as +# published by the Free Software Foundation. +# +# This program is distributed in the hope that it would be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write the Free Software Foundation, +# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA +#----------------------------------------------------------------------- + +seq=`basename $0` +seqres=$RESULT_DIR/$seq +echo "QA output created by $seq" + +here=`pwd` +tmp=/tmp/$$ +status=1 # failure is the default! +trap "_cleanup; exit \$status" 0 1 2 3 15 + +_cleanup() +{ + cd / + rm -rf $tmp.* + _dmerror_cleanup +} + +# get standard environment, filters and checks +. ./common/rc +. ./common/filter +. ./common/reflink +. ./common/dmerror + +# real QA test starts here +_supported_os Linux +_require_scratch_reflink +_require_cp_reflink +_need_to_be_root +_require_dm_target error + +rm -f $seqres.full + + +echo "Format and mount" +_scratch_mkfs > $seqres.full 2>&1 +_dmerror_init +_dmerror_mount >> $seqres.full 2>&1 + +testdir=$SCRATCH_MNT/test-$seq +mkdir $testdir + +blksz=65536 +nr=640 +bufnr=128 +filesize=$((blksz * nr)) +bufsize=$((blksz * bufnr)) + +_require_fs_space $SCRATCH_MNT $((filesize / 1024 * 3 * 5 / 4)) + +echo "Create the original files" +$XFS_IO_PROG -f -c "pwrite -S 0x61 -b $bufsize 0 $filesize" $testdir/file1 >> $seqres.full +_cp_reflink $testdir/file1 $testdir/file2 >> $seqres.full +_dmerror_unmount +_dmerror_mount + +echo "Compare files" +md5sum $testdir/file1 | _filter_scratch +md5sum $testdir/file2 | _filter_scratch + +echo "CoW and unmount" +sync +_dmerror_load_error_table +$XFS_IO_PROG -f -c "pwrite -S 0x63 -b $bufsize 0 $filesize" -c "fdatasync" $testdir/file2 >> $seqres.full +_dmerror_load_working_table + +echo "Rewrite" +$XFS_IO_PROG -f -c "pwrite -S 0x64 -b $bufsize 0 $filesize" -c "fdatasync" $testdir/file2 >> $seqres.full 2>&1 +_dmerror_unmount +_dmerror_mount + +echo "Compare files" +md5sum $testdir/file1 | _filter_scratch + +echo "Check for damage" +_dmerror_unmount +_dmerror_cleanup +_repair_scratch_fs >> $seqres.full + +# success, all done +status=0 +exit diff --git a/tests/generic/268.out b/tests/generic/268.out new file mode 100644 index 0000000..234e8be --- /dev/null +++ b/tests/generic/268.out @@ -0,0 +1,12 @@ +QA output created by 268 +Format and mount +Create the original files +Compare files +1886e67cf8783e89ce6ddc5bb09a3944 SCRATCH_MNT/test-268/file1 +1886e67cf8783e89ce6ddc5bb09a3944 SCRATCH_MNT/test-268/file2 +CoW and unmount +fdatasync: Input/output error +Rewrite +Compare files +1886e67cf8783e89ce6ddc5bb09a3944 SCRATCH_MNT/test-268/file1 +Check for damage diff --git a/tests/generic/271 b/tests/generic/271 new file mode 100755 index 0000000..955478e --- /dev/null +++ b/tests/generic/271 @@ -0,0 +1,100 @@ +#! /bin/bash +# FS QA Test No. 271 +# +# Test DIO CoW behavior when the write temporarily fails. +# +#----------------------------------------------------------------------- +# Copyright (c) 2016, Oracle and/or its affiliates. All Rights Reserved. +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License as +# published by the Free Software Foundation. +# +# This program is distributed in the hope that it would be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write the Free Software Foundation, +# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA +#----------------------------------------------------------------------- + +seq=`basename $0` +seqres=$RESULT_DIR/$seq +echo "QA output created by $seq" + +here=`pwd` +tmp=/tmp/$$ +status=1 # failure is the default! +trap "_cleanup; exit \$status" 0 1 2 3 15 + +_cleanup() +{ + cd / + rm -rf $tmp.* + _dmerror_cleanup +} + +# get standard environment, filters and checks +. ./common/rc +. ./common/filter +. ./common/reflink +. ./common/dmerror + +# real QA test starts here +_supported_os Linux +_require_scratch_reflink +_require_cp_reflink +_need_to_be_root +_require_dm_target error +_require_odirect + +rm -f $seqres.full + + +echo "Format and mount" +_scratch_mkfs > $seqres.full 2>&1 +_dmerror_init +_dmerror_mount >> $seqres.full 2>&1 + +testdir=$SCRATCH_MNT/test-$seq +mkdir $testdir + +blksz=65536 +nr=640 +bufnr=128 +filesize=$((blksz * nr)) +bufsize=$((blksz * bufnr)) + +_require_fs_space $SCRATCH_MNT $((filesize / 1024 * 3 * 5 / 4)) + +echo "Create the original files" +$XFS_IO_PROG -f -c "pwrite -S 0x61 -b $bufsize 0 $filesize" $testdir/file1 >> $seqres.full +_cp_reflink $testdir/file1 $testdir/file2 >> $seqres.full +_dmerror_unmount +_dmerror_mount + +echo "Compare files" +md5sum $testdir/file1 | _filter_scratch +md5sum $testdir/file2 | _filter_scratch + +echo "CoW and unmount" +sync +_dmerror_load_error_table +$XFS_IO_PROG -d -f -c "pwrite -S 0x63 -b $bufsize 0 $filesize" $testdir/file2 >> $seqres.full +_dmerror_load_working_table +_dmerror_unmount +_dmerror_mount + +echo "Compare files" +md5sum $testdir/file1 | _filter_scratch + +echo "Check for damage" +_dmerror_unmount +_dmerror_cleanup +_repair_scratch_fs >> $seqres.full + +# success, all done +status=0 +exit diff --git a/tests/generic/271.out b/tests/generic/271.out new file mode 100644 index 0000000..f7ea004 --- /dev/null +++ b/tests/generic/271.out @@ -0,0 +1,11 @@ +QA output created by 271 +Format and mount +Create the original files +Compare files +1886e67cf8783e89ce6ddc5bb09a3944 SCRATCH_MNT/test-271/file1 +1886e67cf8783e89ce6ddc5bb09a3944 SCRATCH_MNT/test-271/file2 +CoW and unmount +pwrite64: Input/output error +Compare files +1886e67cf8783e89ce6ddc5bb09a3944 SCRATCH_MNT/test-271/file1 +Check for damage diff --git a/tests/generic/272 b/tests/generic/272 new file mode 100755 index 0000000..7560214 --- /dev/null +++ b/tests/generic/272 @@ -0,0 +1,98 @@ +#! /bin/bash +# FS QA Test No. 272 +# +# Test DIO CoW behavior when the write permanently fails. +# +#----------------------------------------------------------------------- +# Copyright (c) 2016, Oracle and/or its affiliates. All Rights Reserved. +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License as +# published by the Free Software Foundation. +# +# This program is distributed in the hope that it would be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write the Free Software Foundation, +# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA +#----------------------------------------------------------------------- + +seq=`basename $0` +seqres=$RESULT_DIR/$seq +echo "QA output created by $seq" + +here=`pwd` +tmp=/tmp/$$ +status=1 # failure is the default! +trap "_cleanup; exit \$status" 0 1 2 3 15 + +_cleanup() +{ + cd / + rm -rf $tmp.* + _dmerror_cleanup +} + +# get standard environment, filters and checks +. ./common/rc +. ./common/filter +. ./common/reflink +. ./common/dmerror + +# real QA test starts here +_supported_os Linux +_require_scratch_reflink +_require_cp_reflink +_need_to_be_root +_require_dm_target error +_require_odirect + +rm -f $seqres.full + + +echo "Format and mount" +_scratch_mkfs > $seqres.full 2>&1 +_dmerror_init +_dmerror_mount >> $seqres.full 2>&1 + +testdir=$SCRATCH_MNT/test-$seq +mkdir $testdir + +blksz=65536 +nr=640 +bufnr=128 +filesize=$((blksz * nr)) +bufsize=$((blksz * bufnr)) + +_require_fs_space $SCRATCH_MNT $((filesize / 1024 * 3 * 5 / 4)) + +echo "Create the original files" +$XFS_IO_PROG -f -c "pwrite -S 0x61 -b $bufsize 0 $filesize" $testdir/file1 >> $seqres.full +_cp_reflink $testdir/file1 $testdir/file2 >> $seqres.full +_dmerror_unmount +_dmerror_mount + +echo "Compare files" +md5sum $testdir/file1 | _filter_scratch +md5sum $testdir/file2 | _filter_scratch + +echo "CoW and unmount" +sync +_dmerror_load_error_table +$XFS_IO_PROG -d -f -c "pwrite -S 0x63 -b $bufsize 0 $filesize" $testdir/file2 >> $seqres.full + +echo "Clean up the mess" +_dmerror_unmount +_dmerror_cleanup +_repair_scratch_fs >> $seqres.full +_scratch_mount >> $seqres.full 2>&1 + +echo "Compare files" +md5sum $testdir/file1 | _filter_scratch + +# success, all done +status=0 +exit diff --git a/tests/generic/272.out b/tests/generic/272.out new file mode 100644 index 0000000..e21e4a8 --- /dev/null +++ b/tests/generic/272.out @@ -0,0 +1,11 @@ +QA output created by 272 +Format and mount +Create the original files +Compare files +1886e67cf8783e89ce6ddc5bb09a3944 SCRATCH_MNT/test-272/file1 +1886e67cf8783e89ce6ddc5bb09a3944 SCRATCH_MNT/test-272/file2 +CoW and unmount +pwrite64: Input/output error +Clean up the mess +Compare files +1886e67cf8783e89ce6ddc5bb09a3944 SCRATCH_MNT/test-272/file1 diff --git a/tests/generic/276 b/tests/generic/276 new file mode 100755 index 0000000..560daba --- /dev/null +++ b/tests/generic/276 @@ -0,0 +1,101 @@ +#! /bin/bash +# FS QA Test No. 276 +# +# Test DIO CoW behavior when the write temporarily fails and we unmount. +# +#----------------------------------------------------------------------- +# Copyright (c) 2016, Oracle and/or its affiliates. All Rights Reserved. +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License as +# published by the Free Software Foundation. +# +# This program is distributed in the hope that it would be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write the Free Software Foundation, +# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA +#----------------------------------------------------------------------- + +seq=`basename $0` +seqres=$RESULT_DIR/$seq +echo "QA output created by $seq" + +here=`pwd` +tmp=/tmp/$$ +status=1 # failure is the default! +trap "_cleanup; exit \$status" 0 1 2 3 15 + +_cleanup() +{ + cd / + rm -rf $tmp.* + _dmerror_cleanup +} + +# get standard environment, filters and checks +. ./common/rc +. ./common/filter +. ./common/reflink +. ./common/dmerror + +# real QA test starts here +_supported_os Linux +_require_scratch_reflink +_require_cp_reflink +_need_to_be_root +_require_dm_target error +_require_odirect + +rm -f $seqres.full + + +echo "Format and mount" +_scratch_mkfs > $seqres.full 2>&1 +_dmerror_init +_dmerror_mount >> $seqres.full 2>&1 + +testdir=$SCRATCH_MNT/test-$seq +mkdir $testdir + +blksz=65536 +nr=640 +bufnr=128 +filesize=$((blksz * nr)) +bufsize=$((blksz * bufnr)) + +_require_fs_space $SCRATCH_MNT $((filesize / 1024 * 3 * 5 / 4)) + +echo "Create the original files" +$XFS_IO_PROG -f -c "pwrite -S 0x61 -b $bufsize 0 $filesize" $testdir/file1 >> $seqres.full +_cp_reflink $testdir/file1 $testdir/file2 >> $seqres.full +_dmerror_unmount +_dmerror_mount + +echo "Compare files" +md5sum $testdir/file1 | _filter_scratch +md5sum $testdir/file2 | _filter_scratch + +echo "CoW and unmount" +sync +_dmerror_load_error_table +$XFS_IO_PROG -d -f -c "pwrite -S 0x63 -b $bufsize 0 $filesize" $testdir/file2 >> $seqres.full +_dmerror_load_working_table +rm -rf $testdir/file2 >> $seqres.full 2>&1 +_dmerror_unmount +_dmerror_mount + +echo "Compare files" +md5sum $testdir/file1 | _filter_scratch + +echo "Check for damage" +_dmerror_unmount +_dmerror_cleanup +_repair_scratch_fs >> $seqres.full + +# success, all done +status=0 +exit diff --git a/tests/generic/276.out b/tests/generic/276.out new file mode 100644 index 0000000..e2aeacf --- /dev/null +++ b/tests/generic/276.out @@ -0,0 +1,11 @@ +QA output created by 276 +Format and mount +Create the original files +Compare files +1886e67cf8783e89ce6ddc5bb09a3944 SCRATCH_MNT/test-276/file1 +1886e67cf8783e89ce6ddc5bb09a3944 SCRATCH_MNT/test-276/file2 +CoW and unmount +pwrite64: Input/output error +Compare files +1886e67cf8783e89ce6ddc5bb09a3944 SCRATCH_MNT/test-276/file1 +Check for damage diff --git a/tests/generic/278 b/tests/generic/278 new file mode 100755 index 0000000..6d0c828 --- /dev/null +++ b/tests/generic/278 @@ -0,0 +1,104 @@ +#! /bin/bash +# FS QA Test No. 278 +# +# Test DIO CoW behavior when the write temporarily fails but the userspace +# program writes again. +# +#----------------------------------------------------------------------- +# Copyright (c) 2016, Oracle and/or its affiliates. All Rights Reserved. +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License as +# published by the Free Software Foundation. +# +# This program is distributed in the hope that it would be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write the Free Software Foundation, +# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA +#----------------------------------------------------------------------- + +seq=`basename $0` +seqres=$RESULT_DIR/$seq +echo "QA output created by $seq" + +here=`pwd` +tmp=/tmp/$$ +status=1 # failure is the default! +trap "_cleanup; exit \$status" 0 1 2 3 15 + +_cleanup() +{ + cd / + rm -rf $tmp.* + _dmerror_cleanup +} + +# get standard environment, filters and checks +. ./common/rc +. ./common/filter +. ./common/reflink +. ./common/dmerror + +# real QA test starts here +_supported_os Linux +_require_scratch_reflink +_require_cp_reflink +_need_to_be_root +_require_dm_target error +_require_odirect + +rm -f $seqres.full + + +echo "Format and mount" +_scratch_mkfs > $seqres.full 2>&1 +_dmerror_init +_dmerror_mount >> $seqres.full 2>&1 + +testdir=$SCRATCH_MNT/test-$seq +mkdir $testdir + +blksz=65536 +nr=640 +filesize=$((blksz * nr)) +bufnr=128 +bufsize=$((blksz * bufnr)) + +_require_fs_space $SCRATCH_MNT $((filesize / 1024 * 3 * 5 / 4)) + +echo "Create the original files" +$XFS_IO_PROG -f -c "pwrite -S 0x61 -b $bufsize 0 $filesize" $testdir/file1 >> $seqres.full +_cp_reflink $testdir/file1 $testdir/file2 >> $seqres.full +_dmerror_unmount +_dmerror_mount + +echo "Compare files" +md5sum $testdir/file1 | _filter_scratch +md5sum $testdir/file2 | _filter_scratch + +echo "CoW and unmount" +sync +_dmerror_load_error_table +$XFS_IO_PROG -d -f -c "pwrite -S 0x63 -b $bufsize 0 $filesize" $testdir/file2 >> $seqres.full +_dmerror_load_working_table + +echo "Rewrite" +$XFS_IO_PROG -d -f -c "pwrite -S 0x64 -b $bufsize 0 $filesize" $testdir/file2 >> $seqres.full 2>&1 +_dmerror_unmount +_dmerror_mount + +echo "Compare files" +md5sum $testdir/file1 | _filter_scratch + +echo "Check for damage" +_dmerror_unmount +_dmerror_cleanup +_repair_scratch_fs >> $seqres.full + +# success, all done +status=0 +exit diff --git a/tests/generic/278.out b/tests/generic/278.out new file mode 100644 index 0000000..6723b73 --- /dev/null +++ b/tests/generic/278.out @@ -0,0 +1,12 @@ +QA output created by 278 +Format and mount +Create the original files +Compare files +1886e67cf8783e89ce6ddc5bb09a3944 SCRATCH_MNT/test-278/file1 +1886e67cf8783e89ce6ddc5bb09a3944 SCRATCH_MNT/test-278/file2 +CoW and unmount +pwrite64: Input/output error +Rewrite +Compare files +1886e67cf8783e89ce6ddc5bb09a3944 SCRATCH_MNT/test-278/file1 +Check for damage diff --git a/tests/generic/279 b/tests/generic/279 new file mode 100755 index 0000000..67da34b --- /dev/null +++ b/tests/generic/279 @@ -0,0 +1,100 @@ +#! /bin/bash +# FS QA Test No. 279 +# +# Test mmap CoW behavior when the write temporarily fails. +# +#----------------------------------------------------------------------- +# Copyright (c) 2016, Oracle and/or its affiliates. All Rights Reserved. +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License as +# published by the Free Software Foundation. +# +# This program is distributed in the hope that it would be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write the Free Software Foundation, +# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA +#----------------------------------------------------------------------- + +seq=`basename $0` +seqres=$RESULT_DIR/$seq +echo "QA output created by $seq" + +here=`pwd` +tmp=/tmp/$$ +status=1 # failure is the default! +trap "_cleanup; exit \$status" 0 1 2 3 15 + +_cleanup() +{ + cd / + rm -rf $tmp.* $TEST_DIR/mwrite.out + _dmerror_cleanup +} + +# get standard environment, filters and checks +. ./common/rc +. ./common/filter +. ./common/reflink +. ./common/dmerror + +# real QA test starts here +_supported_os Linux +_require_scratch_reflink +_require_cp_reflink +_need_to_be_root +_require_dm_target error + +rm -f $seqres.full + + +echo "Format and mount" +_scratch_mkfs > $seqres.full 2>&1 +_dmerror_init +_dmerror_mount >> $seqres.full 2>&1 + +testdir=$SCRATCH_MNT/test-$seq +mkdir $testdir + +blksz=65536 +nr=640 +bufnr=128 +filesize=$((blksz * nr)) +bufsize=$((blksz * bufnr)) + +_require_fs_space $SCRATCH_MNT $((filesize / 1024 * 3 * 5 / 4)) + +echo "Create the original files" +$XFS_IO_PROG -f -c "pwrite -S 0x61 -b $bufsize 0 $filesize" $testdir/file1 >> $seqres.full +_cp_reflink $testdir/file1 $testdir/file2 >> $seqres.full +_dmerror_unmount +_dmerror_mount + +echo "Compare files" +md5sum $testdir/file1 | _filter_scratch +md5sum $testdir/file2 | _filter_scratch + +echo "CoW and unmount" +sync +_dmerror_load_error_table +urk=$($XFS_IO_PROG -f -c "mmap -rw 0 $filesize" -c "mwrite -S 0x63 0 $filesize" -c "msync -s 0 $filesize" $testdir/file2 > $TEST_DIR/mwrite.out 2>&1) +cat $TEST_DIR/mwrite.out | tee -a $seqres.full +_dmerror_load_working_table +_dmerror_unmount +_dmerror_mount + +echo "Compare files" +md5sum $testdir/file1 | _filter_scratch + +echo "Check for damage" +_dmerror_unmount +_dmerror_cleanup +_repair_scratch_fs >> $seqres.full + +# success, all done +status=0 +exit diff --git a/tests/generic/279.out b/tests/generic/279.out new file mode 100644 index 0000000..f34c2b2 --- /dev/null +++ b/tests/generic/279.out @@ -0,0 +1,11 @@ +QA output created by 279 +Format and mount +Create the original files +Compare files +1886e67cf8783e89ce6ddc5bb09a3944 SCRATCH_MNT/test-279/file1 +1886e67cf8783e89ce6ddc5bb09a3944 SCRATCH_MNT/test-279/file2 +CoW and unmount +msync: Input/output error +Compare files +1886e67cf8783e89ce6ddc5bb09a3944 SCRATCH_MNT/test-279/file1 +Check for damage diff --git a/tests/generic/281 b/tests/generic/281 new file mode 100755 index 0000000..71e3dd7 --- /dev/null +++ b/tests/generic/281 @@ -0,0 +1,98 @@ +#! /bin/bash +# FS QA Test No. 281 +# +# Test mmap CoW behavior when the write permanently fails. +# +#----------------------------------------------------------------------- +# Copyright (c) 2016, Oracle and/or its affiliates. All Rights Reserved. +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License as +# published by the Free Software Foundation. +# +# This program is distributed in the hope that it would be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write the Free Software Foundation, +# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA +#----------------------------------------------------------------------- + +seq=`basename $0` +seqres=$RESULT_DIR/$seq +echo "QA output created by $seq" + +here=`pwd` +tmp=/tmp/$$ +status=1 # failure is the default! +trap "_cleanup; exit \$status" 0 1 2 3 15 + +_cleanup() +{ + cd / + rm -rf $tmp.* $TEST_DIR/mwrite.out + _dmerror_cleanup +} + +# get standard environment, filters and checks +. ./common/rc +. ./common/filter +. ./common/reflink +. ./common/dmerror + +# real QA test starts here +_supported_os Linux +_require_scratch_reflink +_require_cp_reflink +_need_to_be_root +_require_dm_target error + +rm -f $seqres.full + + +echo "Format and mount" +_scratch_mkfs > $seqres.full 2>&1 +_dmerror_init +_dmerror_mount >> $seqres.full 2>&1 + +testdir=$SCRATCH_MNT/test-$seq +mkdir $testdir + +blksz=65536 +nr=640 +bufnr=128 +filesize=$((blksz * nr)) +bufsize=$((blksz * bufnr)) + +_require_fs_space $SCRATCH_MNT $((filesize / 1024 * 3 * 5 / 4)) + +echo "Create the original files" +$XFS_IO_PROG -f -c "pwrite -S 0x61 -b $bufsize 0 $filesize" $testdir/file1 >> $seqres.full +_cp_reflink $testdir/file1 $testdir/file2 >> $seqres.full +_dmerror_unmount +_dmerror_mount + +echo "Compare files" +md5sum $testdir/file1 | _filter_scratch +md5sum $testdir/file2 | _filter_scratch + +echo "CoW and unmount" +sync +_dmerror_load_error_table +urk=$($XFS_IO_PROG -f -c "mmap -rw 0 $filesize" -c "mwrite -S 0x63 0 $filesize" -c "msync -s 0 $filesize" $testdir/file2 > $TEST_DIR/mwrite.out 2>&1) +cat $TEST_DIR/mwrite.out | tee -a $seqres.full + +echo "Clean up the mess" +_dmerror_unmount +_dmerror_cleanup +_repair_scratch_fs >> $seqres.full +_scratch_mount >> $seqres.full 2>&1 + +echo "Compare files" +md5sum $testdir/file1 | _filter_scratch + +# success, all done +status=0 +exit diff --git a/tests/generic/281.out b/tests/generic/281.out new file mode 100644 index 0000000..a2d8e3f --- /dev/null +++ b/tests/generic/281.out @@ -0,0 +1,11 @@ +QA output created by 281 +Format and mount +Create the original files +Compare files +1886e67cf8783e89ce6ddc5bb09a3944 SCRATCH_MNT/test-281/file1 +1886e67cf8783e89ce6ddc5bb09a3944 SCRATCH_MNT/test-281/file2 +CoW and unmount +msync: Input/output error +Clean up the mess +Compare files +1886e67cf8783e89ce6ddc5bb09a3944 SCRATCH_MNT/test-281/file1 diff --git a/tests/generic/282 b/tests/generic/282 new file mode 100755 index 0000000..38714e0 --- /dev/null +++ b/tests/generic/282 @@ -0,0 +1,101 @@ +#! /bin/bash +# FS QA Test No. 282 +# +# Test mmap CoW behavior when the write temporarily fails and we unmount. +# +#----------------------------------------------------------------------- +# Copyright (c) 2016, Oracle and/or its affiliates. All Rights Reserved. +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License as +# published by the Free Software Foundation. +# +# This program is distributed in the hope that it would be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write the Free Software Foundation, +# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA +#----------------------------------------------------------------------- + +seq=`basename $0` +seqres=$RESULT_DIR/$seq +echo "QA output created by $seq" + +here=`pwd` +tmp=/tmp/$$ +status=1 # failure is the default! +trap "_cleanup; exit \$status" 0 1 2 3 15 + +_cleanup() +{ + cd / + rm -rf $tmp.* $TEST_DIR/mwrite.out + _dmerror_cleanup +} + +# get standard environment, filters and checks +. ./common/rc +. ./common/filter +. ./common/reflink +. ./common/dmerror + +# real QA test starts here +_supported_os Linux +_require_scratch_reflink +_require_cp_reflink +_need_to_be_root +_require_dm_target error + +rm -f $seqres.full + + +echo "Format and mount" +_scratch_mkfs > $seqres.full 2>&1 +_dmerror_init +_dmerror_mount >> $seqres.full 2>&1 + +testdir=$SCRATCH_MNT/test-$seq +mkdir $testdir + +blksz=65536 +nr=640 +bufnr=128 +filesize=$((blksz * nr)) +bufsize=$((blksz * bufnr)) + +_require_fs_space $SCRATCH_MNT $((filesize / 1024 * 3 * 5 / 4)) + +echo "Create the original files" +$XFS_IO_PROG -f -c "pwrite -S 0x61 -b $bufsize 0 $filesize" $testdir/file1 >> $seqres.full +_cp_reflink $testdir/file1 $testdir/file2 >> $seqres.full +_dmerror_unmount +_dmerror_mount + +echo "Compare files" +md5sum $testdir/file1 | _filter_scratch +md5sum $testdir/file2 | _filter_scratch + +echo "CoW and unmount" +sync +_dmerror_load_error_table +urk=$($XFS_IO_PROG -f -c "mmap -rw 0 $filesize" -c "mwrite -S 0x63 0 $filesize" $testdir/file2 > $TEST_DIR/mwrite.out 2>&1) +cat $TEST_DIR/mwrite.out | tee -a $seqres.full +_dmerror_load_working_table +rm -rf $testdir/file2 >> $seqres.full 2>&1 +_dmerror_unmount +_dmerror_mount + +echo "Compare files" +md5sum $testdir/file1 | _filter_scratch + +echo "Check for damage" +_dmerror_unmount +_dmerror_cleanup +_repair_scratch_fs >> $seqres.full + +# success, all done +status=0 +exit diff --git a/tests/generic/282.out b/tests/generic/282.out new file mode 100644 index 0000000..624dbfa --- /dev/null +++ b/tests/generic/282.out @@ -0,0 +1,10 @@ +QA output created by 282 +Format and mount +Create the original files +Compare files +1886e67cf8783e89ce6ddc5bb09a3944 SCRATCH_MNT/test-282/file1 +1886e67cf8783e89ce6ddc5bb09a3944 SCRATCH_MNT/test-282/file2 +CoW and unmount +Compare files +1886e67cf8783e89ce6ddc5bb09a3944 SCRATCH_MNT/test-282/file1 +Check for damage diff --git a/tests/generic/283 b/tests/generic/283 new file mode 100755 index 0000000..6d8701f --- /dev/null +++ b/tests/generic/283 @@ -0,0 +1,104 @@ +#! /bin/bash +# FS QA Test No. 283 +# +# Test mmap CoW behavior when the write temporarily fails but the userspace +# program writes again. +# +#----------------------------------------------------------------------- +# Copyright (c) 2016, Oracle and/or its affiliates. All Rights Reserved. +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License as +# published by the Free Software Foundation. +# +# This program is distributed in the hope that it would be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write the Free Software Foundation, +# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA +#----------------------------------------------------------------------- + +seq=`basename $0` +seqres=$RESULT_DIR/$seq +echo "QA output created by $seq" + +here=`pwd` +tmp=/tmp/$$ +status=1 # failure is the default! +trap "_cleanup; exit \$status" 0 1 2 3 15 + +_cleanup() +{ + cd / + rm -rf $tmp.* $TEST_DIR/mwrite.out + _dmerror_cleanup +} + +# get standard environment, filters and checks +. ./common/rc +. ./common/filter +. ./common/reflink +. ./common/dmerror + +# real QA test starts here +_supported_os Linux +_require_scratch_reflink +_require_cp_reflink +_need_to_be_root +_require_dm_target error + +rm -f $seqres.full + + +echo "Format and mount" +_scratch_mkfs > $seqres.full 2>&1 +_dmerror_init +_dmerror_mount >> $seqres.full 2>&1 + +testdir=$SCRATCH_MNT/test-$seq +mkdir $testdir + +blksz=65536 +nr=640 +bufnr=128 +filesize=$((blksz * nr)) +bufsize=$((blksz * bufnr)) + +_require_fs_space $SCRATCH_MNT $((filesize / 1024 * 3 * 5 / 4)) + +echo "Create the original files" +$XFS_IO_PROG -f -c "pwrite -S 0x61 -b $bufsize 0 $filesize" $testdir/file1 >> $seqres.full +_cp_reflink $testdir/file1 $testdir/file2 >> $seqres.full +_dmerror_unmount +_dmerror_mount + +echo "Compare files" +md5sum $testdir/file1 | _filter_scratch +md5sum $testdir/file2 | _filter_scratch + +echo "CoW and unmount" +sync +_dmerror_load_error_table +urk=$($XFS_IO_PROG -f -c "mmap -rw 0 $filesize" -c "mwrite -S 0x63 0 $filesize" -c "msync -s 0 $filesize" $testdir/file2 > $TEST_DIR/mwrite.out 2>&1) +cat $TEST_DIR/mwrite.out | tee -a $seqres.full +_dmerror_load_working_table + +echo "Rewrite" +$XFS_IO_PROG -f -c "mmap -rw 0 $filesize" -c "mwrite -S 0x63 0 $filesize" -c "msync 0 $filesize" $testdir/file2 >> $seqres.full 2>&1 +_dmerror_unmount +_dmerror_mount + +echo "Compare files" +md5sum $testdir/file1 | _filter_scratch + +echo "Check for damage" +_dmerror_unmount +_dmerror_cleanup +_repair_scratch_fs >> $seqres.full + +# success, all done +status=0 +exit diff --git a/tests/generic/283.out b/tests/generic/283.out new file mode 100644 index 0000000..f9fd5c8 --- /dev/null +++ b/tests/generic/283.out @@ -0,0 +1,12 @@ +QA output created by 283 +Format and mount +Create the original files +Compare files +1886e67cf8783e89ce6ddc5bb09a3944 SCRATCH_MNT/test-283/file1 +1886e67cf8783e89ce6ddc5bb09a3944 SCRATCH_MNT/test-283/file2 +CoW and unmount +msync: Input/output error +Rewrite +Compare files +1886e67cf8783e89ce6ddc5bb09a3944 SCRATCH_MNT/test-283/file1 +Check for damage diff --git a/tests/generic/group b/tests/generic/group index b768882..b4a180e 100644 --- a/tests/generic/group +++ b/tests/generic/group @@ -267,13 +267,25 @@ 262 auto quick clone 263 rw auto quick 264 auto quick clone +265 auto quick clone +266 auto quick clone +267 auto quick clone +268 auto quick clone 269 auto rw prealloc ioctl enospc stress 270 auto quota rw prealloc ioctl enospc stress +271 auto quick clone +272 auto quick clone 273 auto rw 274 auto rw prealloc 275 auto rw enospc +276 auto quick clone 277 auto ioctl quick metadata +278 auto quick clone +279 auto quick clone 280 auto quota freeze dangerous +281 auto quick clone +282 auto quick clone +283 auto quick clone 285 auto rw 286 auto quick other 288 auto quick ioctl trim From darrick.wong@oracle.com Thu Feb 11 17:41:07 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay2.corp.sgi.com [137.38.102.29]) by oss.sgi.com (Postfix) with ESMTP id 980917F86 for ; Thu, 11 Feb 2016 17:41:07 -0600 (CST) Received: from cuda.sgi.com (cuda3.sgi.com [192.48.176.15]) by relay2.corp.sgi.com (Postfix) with ESMTP id 8A408304066 for ; Thu, 11 Feb 2016 15:41:07 -0800 (PST) X-ASG-Debug-ID: 1455234061-04cb6c1e5872f00001-NocioJ Received: from aserp1040.oracle.com (aserp1040.oracle.com [141.146.126.69]) by cuda.sgi.com with ESMTP id 6PJU1xnC18UTKSWA (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO) for ; Thu, 11 Feb 2016 15:41:02 -0800 (PST) X-Barracuda-Envelope-From: darrick.wong@oracle.com X-Barracuda-Apparent-Source-IP: 141.146.126.69 Received: from userv0021.oracle.com (userv0021.oracle.com [156.151.31.71]) by aserp1040.oracle.com (Sentrion-MTA-4.3.2/Sentrion-MTA-4.3.2) with ESMTP id u1BNf0Xg023682 (version=TLSv1 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Thu, 11 Feb 2016 23:41:01 GMT Received: from userv0122.oracle.com (userv0122.oracle.com [156.151.31.75]) by userv0021.oracle.com (8.13.8/8.13.8) with ESMTP id u1BNf0b2012878 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=FAIL); Thu, 11 Feb 2016 23:41:00 GMT Received: from abhmp0001.oracle.com (abhmp0001.oracle.com [141.146.116.7]) by userv0122.oracle.com (8.14.4/8.14.4) with ESMTP id u1BNf03f030365; Thu, 11 Feb 2016 23:41:00 GMT Received: from localhost (/10.145.178.207) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Thu, 11 Feb 2016 15:40:59 -0800 Subject: [PATCH 15/32] reflink: test CoW operations against the source file From: "Darrick J. Wong" X-ASG-Orig-Subj: [PATCH 15/32] reflink: test CoW operations against the source file To: david@fromorbit.com, darrick.wong@oracle.com Cc: linux-btrfs@vger.kernel.org, fstests@vger.kernel.org, xfs@oss.sgi.com Date: Thu, 11 Feb 2016 15:40:58 -0800 Message-ID: <20160211234057.2202.16147.stgit@birch.djwong.org> In-Reply-To: <20160211233916.2202.40961.stgit@birch.djwong.org> References: <20160211233916.2202.40961.stgit@birch.djwong.org> User-Agent: StGit/0.17.1-dirty MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit X-Source-IP: userv0021.oracle.com [156.151.31.71] X-Barracuda-Connect: aserp1040.oracle.com[141.146.126.69] X-Barracuda-Start-Time: 1455234062 X-Barracuda-Encrypted: ECDHE-RSA-AES256-GCM-SHA384 X-Barracuda-URL: https://192.48.176.15:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-BRTS-Status: 1 X-Barracuda-Spam-Score: 0.00 X-Barracuda-Spam-Status: No, SCORE=0.00 using per-user scores of TAG_LEVEL=1000.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.7 tests=BSF_SC0_MISMATCH_TO, UNPARSEABLE_RELAY X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.3.26959 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 0.00 BSF_SC0_MISMATCH_TO Envelope rcpt doesn't match header 0.00 UNPARSEABLE_RELAY Informational: message has unparseable relay lines Ensure that CoW operations against shared blocks in the source file work correctly. v2: remove filefrag dependencies Signed-off-by: Darrick J. Wong --- common/reflink | 66 ++++++++++++++++++++++++++++++++++ tests/generic/196 | 2 + tests/generic/197 | 2 + tests/generic/284 | 89 ++++++++++++++++++++++++++++++++++++++++++++++ tests/generic/284.out | 12 ++++++ tests/generic/287 | 90 +++++++++++++++++++++++++++++++++++++++++++++++ tests/generic/287.out | 12 ++++++ tests/generic/289 | 91 +++++++++++++++++++++++++++++++++++++++++++++++ tests/generic/289.out | 12 ++++++ tests/generic/290 | 92 ++++++++++++++++++++++++++++++++++++++++++++++++ tests/generic/290.out | 12 ++++++ tests/generic/291 | 91 +++++++++++++++++++++++++++++++++++++++++++++++ tests/generic/291.out | 12 ++++++ tests/generic/292 | 92 ++++++++++++++++++++++++++++++++++++++++++++++++ tests/generic/292.out | 12 ++++++ tests/generic/293 | 93 ++++++++++++++++++++++++++++++++++++++++++++++++ tests/generic/293.out | 12 ++++++ tests/generic/295 | 94 +++++++++++++++++++++++++++++++++++++++++++++++++ tests/generic/295.out | 12 ++++++ tests/generic/296 | 90 +++++++++++++++++++++++++++++++++++++++++++++++ tests/generic/296.out | 12 ++++++ tests/generic/group | 9 +++++ 22 files changed, 1007 insertions(+), 2 deletions(-) create mode 100755 tests/generic/284 create mode 100644 tests/generic/284.out create mode 100755 tests/generic/287 create mode 100644 tests/generic/287.out create mode 100755 tests/generic/289 create mode 100644 tests/generic/289.out create mode 100755 tests/generic/290 create mode 100644 tests/generic/290.out create mode 100755 tests/generic/291 create mode 100644 tests/generic/291.out create mode 100755 tests/generic/292 create mode 100644 tests/generic/292.out create mode 100755 tests/generic/293 create mode 100644 tests/generic/293.out create mode 100755 tests/generic/295 create mode 100644 tests/generic/295.out create mode 100755 tests/generic/296 create mode 100644 tests/generic/296.out diff --git a/common/reflink b/common/reflink index b92f664..5d92a88 100644 --- a/common/reflink +++ b/common/reflink @@ -295,3 +295,69 @@ _weave_reflink_rainbow_delalloc() { _pwrite_byte 0x62 $((blksz * i)) $blksz $dfile.chk done } + +# Make the source file have interleaved regular blocks and reflinked blocks +_sweave_reflink_regular() { + blksz=$1 + nr=$2 + sfile=$3 + dfile=$4 + + _pwrite_byte 0x61 0 $((blksz * nr)) $sfile + _pwrite_byte 0x62 0 $((blksz * nr)) $dfile + _pwrite_byte 0x61 0 $((blksz * nr)) $sfile.chk + seq 1 2 $((nr - 1)) | while read i; do + _reflink_range $sfile $((blksz * i)) $dfile $((blksz * i)) $blksz + done +} + +# Make the source file have interleaved unwritten blocks and reflinked blocks +_sweave_reflink_unwritten() { + blksz=$1 + nr=$2 + sfile=$3 + dfile=$4 + + $XFS_IO_PROG -f -c "falloc 0 $((blksz * nr))" $sfile + _pwrite_byte 0x00 0 $((blksz * nr)) $sfile.chk + _pwrite_byte 0x62 0 $((blksz * nr)) $dfile + seq 1 2 $((nr - 1)) | while read i; do + _pwrite_byte 0x61 $((blksz * i)) $blksz $sfile + _pwrite_byte 0x61 $((blksz * i)) $blksz $sfile.chk + done + seq 1 2 $((nr - 1)) | while read i; do + _reflink_range $sfile $((blksz * i)) $dfile $((blksz * i)) $blksz + done +} + +# Make the source file have interleaved holes and reflinked blocks +_sweave_reflink_holes() { + blksz=$1 + nr=$2 + sfile=$3 + dfile=$4 + + $XFS_IO_PROG -f -c "truncate $((blksz * nr))" $sfile + _pwrite_byte 0x00 0 $((blksz * nr)) $sfile.chk + _pwrite_byte 0x62 0 $((blksz * nr)) $dfile + seq 1 2 $((nr - 1)) | while read i; do + _pwrite_byte 0x61 $((blksz * i)) $blksz $sfile + _pwrite_byte 0x61 $((blksz * i)) $blksz $sfile.chk + done + seq 1 2 $((nr - 1)) | while read i; do + _reflink_range $sfile $((blksz * i)) $dfile $((blksz * i)) $blksz + done +} + +# For a file created with _sweave_reflink_holes, fill the holes with delalloc +# extents +_sweave_reflink_holes_delalloc() { + blksz=$1 + nr=$2 + sfile=$3 + + seq 0 2 $((nr - 1)) | while read i; do + _pwrite_byte 0x64 $((blksz * i)) $blksz $sfile + _pwrite_byte 0x64 $((blksz * i)) $blksz $sfile.chk + done +} diff --git a/tests/generic/196 b/tests/generic/196 index 1505de8..3fcf522 100755 --- a/tests/generic/196 +++ b/tests/generic/196 @@ -2,7 +2,7 @@ # FS QA Test No. 196 # # Ensuring that copy on write in direct-io mode works when the CoW -# range originally covers multiple extents, some unwritten, some not. +# range originally covers multiple extents, some regular, some not. # - Create two files. # - Reflink the odd blocks of the first file into the second file. # - directio CoW across the halfway mark, starting with the unwritten extent. diff --git a/tests/generic/197 b/tests/generic/197 index cfdbf1b..b40ea93 100755 --- a/tests/generic/197 +++ b/tests/generic/197 @@ -2,7 +2,7 @@ # FS QA Test No. 197 # # Ensuring that copy on write in buffered mode works when the CoW -# range originally covers multiple extents, some unwritten, some not. +# range originally covers multiple extents, some regular, some not. # - Create two files. # - Reflink the odd blocks of the first file into the second file. # - CoW across the halfway mark, starting with the unwritten extent. diff --git a/tests/generic/284 b/tests/generic/284 new file mode 100755 index 0000000..aae4bb0 --- /dev/null +++ b/tests/generic/284 @@ -0,0 +1,89 @@ +#! /bin/bash +# FS QA Test No. 284 +# +# Ensuring that copy on write in buffered mode to the source file when the +# CoW range covers regular unshared and regular shared blocks. +# - Create two files. +# - Reflink the odd blocks of the first file into the second file. +# - CoW the first file across the halfway mark, starting with the +# regular extent. +# - Check that the files are now different where we say they're different. +# +#----------------------------------------------------------------------- +# Copyright (c) 2016, Oracle and/or its affiliates. All Rights Reserved. +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License as +# published by the Free Software Foundation. +# +# This program is distributed in the hope that it would be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write the Free Software Foundation, +# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA +#----------------------------------------------------------------------- + +seq=`basename $0` +seqres=$RESULT_DIR/$seq +echo "QA output created by $seq" + +here=`pwd` +tmp=/tmp/$$ +status=1 # failure is the default! +trap "_cleanup; exit \$status" 0 1 2 3 15 + +_cleanup() +{ + cd / + rm -rf $tmp.* +} + +# get standard environment, filters and checks +. ./common/rc +. ./common/filter +. ./common/reflink + +# real QA test starts here +_supported_os Linux +_require_scratch_reflink +_require_xfs_io_command "falloc" + +rm -f $seqres.full + +echo "Format and mount" +_scratch_mkfs > $seqres.full 2>&1 +_scratch_mount >> $seqres.full 2>&1 + +testdir=$SCRATCH_MNT/test-$seq +mkdir $testdir + +echo "Create the original files" +blksz=65536 +nr=64 +filesize=$((blksz * nr)) +_sweave_reflink_regular $blksz $nr $testdir/file1 $testdir/file3 >> $seqres.full +_scratch_remount + +echo "Compare files" +md5sum $testdir/file1 | _filter_scratch +md5sum $testdir/file3 | _filter_scratch +md5sum $testdir/file1.chk | _filter_scratch + +echo "CoW across the transition" +cowoff=$((filesize / 4)) +cowsz=$((filesize / 2)) +$XFS_IO_PROG -f -c "pwrite -S 0x63 -b $cowsz $cowoff $cowsz" $testdir/file1 >> $seqres.full +_pwrite_byte 0x63 $cowoff $cowsz $testdir/file1.chk >> $seqres.full +_scratch_remount + +echo "Compare files" +md5sum $testdir/file1 | _filter_scratch +md5sum $testdir/file3 | _filter_scratch +md5sum $testdir/file1.chk | _filter_scratch + +# success, all done +status=0 +exit diff --git a/tests/generic/284.out b/tests/generic/284.out new file mode 100644 index 0000000..cc0054d --- /dev/null +++ b/tests/generic/284.out @@ -0,0 +1,12 @@ +QA output created by 284 +Format and mount +Create the original files +Compare files +bdbcf02ee0aa977795a79d25fcfdccb1 SCRATCH_MNT/test-284/file1 +ce2023f765eba19677517c511886d5c9 SCRATCH_MNT/test-284/file3 +bdbcf02ee0aa977795a79d25fcfdccb1 SCRATCH_MNT/test-284/file1.chk +CoW across the transition +Compare files +2dc2b131303b2f70ddb480778caac8b7 SCRATCH_MNT/test-284/file1 +ce2023f765eba19677517c511886d5c9 SCRATCH_MNT/test-284/file3 +2dc2b131303b2f70ddb480778caac8b7 SCRATCH_MNT/test-284/file1.chk diff --git a/tests/generic/287 b/tests/generic/287 new file mode 100755 index 0000000..11e3c9f --- /dev/null +++ b/tests/generic/287 @@ -0,0 +1,90 @@ +#! /bin/bash +# FS QA Test No. 287 +# +# Ensuring that copy on write in directio mode to the source file when the +# CoW range covers regular unshared and regular shared blocks. +# - Create two files. +# - Reflink the odd blocks of the first file into the second file. +# - dio CoW the first file across the halfway mark, starting with the +# regular extent. +# - Check that the files are now different where we say they're different. +# +#----------------------------------------------------------------------- +# Copyright (c) 2016, Oracle and/or its affiliates. All Rights Reserved. +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License as +# published by the Free Software Foundation. +# +# This program is distributed in the hope that it would be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write the Free Software Foundation, +# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA +#----------------------------------------------------------------------- + +seq=`basename $0` +seqres=$RESULT_DIR/$seq +echo "QA output created by $seq" + +here=`pwd` +tmp=/tmp/$$ +status=1 # failure is the default! +trap "_cleanup; exit \$status" 0 1 2 3 15 + +_cleanup() +{ + cd / + rm -rf $tmp.* +} + +# get standard environment, filters and checks +. ./common/rc +. ./common/filter +. ./common/reflink + +# real QA test starts here +_supported_os Linux +_require_scratch_reflink +_require_xfs_io_command "falloc" +_require_odirect + +rm -f $seqres.full + +echo "Format and mount" +_scratch_mkfs > $seqres.full 2>&1 +_scratch_mount >> $seqres.full 2>&1 + +testdir=$SCRATCH_MNT/test-$seq +mkdir $testdir + +echo "Create the original files" +blksz=65536 +nr=64 +filesize=$((blksz * nr)) +_sweave_reflink_regular $blksz $nr $testdir/file1 $testdir/file3 >> $seqres.full +_scratch_remount + +echo "Compare files" +md5sum $testdir/file1 | _filter_scratch +md5sum $testdir/file3 | _filter_scratch +md5sum $testdir/file1.chk | _filter_scratch + +echo "CoW across the transition" +cowoff=$((filesize / 4)) +cowsz=$((filesize / 2)) +$XFS_IO_PROG -d -f -c "pwrite -S 0x63 -b $cowsz $cowoff $cowsz" $testdir/file1 >> $seqres.full +_pwrite_byte 0x63 $cowoff $cowsz $testdir/file1.chk >> $seqres.full +_scratch_remount + +echo "Compare files" +md5sum $testdir/file1 | _filter_scratch +md5sum $testdir/file3 | _filter_scratch +md5sum $testdir/file1.chk | _filter_scratch + +# success, all done +status=0 +exit diff --git a/tests/generic/287.out b/tests/generic/287.out new file mode 100644 index 0000000..b7d47e8 --- /dev/null +++ b/tests/generic/287.out @@ -0,0 +1,12 @@ +QA output created by 287 +Format and mount +Create the original files +Compare files +bdbcf02ee0aa977795a79d25fcfdccb1 SCRATCH_MNT/test-287/file1 +ce2023f765eba19677517c511886d5c9 SCRATCH_MNT/test-287/file3 +bdbcf02ee0aa977795a79d25fcfdccb1 SCRATCH_MNT/test-287/file1.chk +CoW across the transition +Compare files +2dc2b131303b2f70ddb480778caac8b7 SCRATCH_MNT/test-287/file1 +ce2023f765eba19677517c511886d5c9 SCRATCH_MNT/test-287/file3 +2dc2b131303b2f70ddb480778caac8b7 SCRATCH_MNT/test-287/file1.chk diff --git a/tests/generic/289 b/tests/generic/289 new file mode 100755 index 0000000..31df1b8 --- /dev/null +++ b/tests/generic/289 @@ -0,0 +1,91 @@ +#! /bin/bash +# FS QA Test No. 289 +# +# Ensuring that copy on write in buffered mode to the source file when the +# CoW range covers unwritten and regular shared blocks. +# - Create two files. +# - fallocate the first file. +# - Write the odd blocks of the first file. +# - Reflink the odd blocks of the first file into the second file. +# - CoW the first file across the halfway mark, starting with the +# regular extent. +# - Check that the files are now different where we say they're different. +# +#----------------------------------------------------------------------- +# Copyright (c) 2016, Oracle and/or its affiliates. All Rights Reserved. +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License as +# published by the Free Software Foundation. +# +# This program is distributed in the hope that it would be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write the Free Software Foundation, +# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA +#----------------------------------------------------------------------- + +seq=`basename $0` +seqres=$RESULT_DIR/$seq +echo "QA output created by $seq" + +here=`pwd` +tmp=/tmp/$$ +status=1 # failure is the default! +trap "_cleanup; exit \$status" 0 1 2 3 15 + +_cleanup() +{ + cd / + rm -rf $tmp.* +} + +# get standard environment, filters and checks +. ./common/rc +. ./common/filter +. ./common/reflink + +# real QA test starts here +_supported_os Linux +_require_scratch_reflink +_require_xfs_io_command "falloc" + +rm -f $seqres.full + +echo "Format and mount" +_scratch_mkfs > $seqres.full 2>&1 +_scratch_mount >> $seqres.full 2>&1 + +testdir=$SCRATCH_MNT/test-$seq +mkdir $testdir + +echo "Create the original files" +blksz=65536 +nr=64 +filesize=$((blksz * nr)) +_sweave_reflink_unwritten $blksz $nr $testdir/file1 $testdir/file3 >> $seqres.full +_scratch_remount + +echo "Compare files" +md5sum $testdir/file1 | _filter_scratch +md5sum $testdir/file3 | _filter_scratch +md5sum $testdir/file1.chk | _filter_scratch + +echo "CoW across the transition" +cowoff=$((filesize / 4)) +cowsz=$((filesize / 2)) +$XFS_IO_PROG -f -c "pwrite -S 0x63 -b $cowsz $cowoff $cowsz" $testdir/file1 >> $seqres.full +_pwrite_byte 0x63 $cowoff $cowsz $testdir/file1.chk >> $seqres.full +_scratch_remount + +echo "Compare files" +md5sum $testdir/file1 | _filter_scratch +md5sum $testdir/file3 | _filter_scratch +md5sum $testdir/file1.chk | _filter_scratch + +# success, all done +status=0 +exit diff --git a/tests/generic/289.out b/tests/generic/289.out new file mode 100644 index 0000000..e7e37a7 --- /dev/null +++ b/tests/generic/289.out @@ -0,0 +1,12 @@ +QA output created by 289 +Format and mount +Create the original files +Compare files +b8a8a88d4c143f79900c4b4e79aa3e37 SCRATCH_MNT/test-289/file1 +ce2023f765eba19677517c511886d5c9 SCRATCH_MNT/test-289/file3 +b8a8a88d4c143f79900c4b4e79aa3e37 SCRATCH_MNT/test-289/file1.chk +CoW across the transition +Compare files +e8cf59797f0b3758c8878c368bb4cf7e SCRATCH_MNT/test-289/file1 +ce2023f765eba19677517c511886d5c9 SCRATCH_MNT/test-289/file3 +e8cf59797f0b3758c8878c368bb4cf7e SCRATCH_MNT/test-289/file1.chk diff --git a/tests/generic/290 b/tests/generic/290 new file mode 100755 index 0000000..4a576c5 --- /dev/null +++ b/tests/generic/290 @@ -0,0 +1,92 @@ +#! /bin/bash +# FS QA Test No. 290 +# +# Ensuring that copy on write in directio mode to the source file when the +# CoW range covers unwritten and regular shared blocks. +# - Create two files. +# - fallocate the first file. +# - Write the odd blocks of the first file. +# - Reflink the odd blocks of the first file into the second file. +# - DIO CoW the first file across the halfway mark, starting with the +# regular extent. +# - Check that the files are now different where we say they're different. +# +#----------------------------------------------------------------------- +# Copyright (c) 2016, Oracle and/or its affiliates. All Rights Reserved. +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License as +# published by the Free Software Foundation. +# +# This program is distributed in the hope that it would be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write the Free Software Foundation, +# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA +#----------------------------------------------------------------------- + +seq=`basename $0` +seqres=$RESULT_DIR/$seq +echo "QA output created by $seq" + +here=`pwd` +tmp=/tmp/$$ +status=1 # failure is the default! +trap "_cleanup; exit \$status" 0 1 2 3 15 + +_cleanup() +{ + cd / + rm -rf $tmp.* +} + +# get standard environment, filters and checks +. ./common/rc +. ./common/filter +. ./common/reflink + +# real QA test starts here +_supported_os Linux +_require_scratch_reflink +_require_xfs_io_command "falloc" +_require_odirect + +rm -f $seqres.full + +echo "Format and mount" +_scratch_mkfs > $seqres.full 2>&1 +_scratch_mount >> $seqres.full 2>&1 + +testdir=$SCRATCH_MNT/test-$seq +mkdir $testdir + +echo "Create the original files" +blksz=65536 +nr=64 +filesize=$((blksz * nr)) +_sweave_reflink_unwritten $blksz $nr $testdir/file1 $testdir/file3 >> $seqres.full +_scratch_remount + +echo "Compare files" +md5sum $testdir/file1 | _filter_scratch +md5sum $testdir/file3 | _filter_scratch +md5sum $testdir/file1.chk | _filter_scratch + +echo "CoW across the transition" +cowoff=$((filesize / 4)) +cowsz=$((filesize / 2)) +$XFS_IO_PROG -d -f -c "pwrite -S 0x63 -b $cowsz $cowoff $cowsz" $testdir/file1 >> $seqres.full +_pwrite_byte 0x63 $cowoff $cowsz $testdir/file1.chk >> $seqres.full +_scratch_remount + +echo "Compare files" +md5sum $testdir/file1 | _filter_scratch +md5sum $testdir/file3 | _filter_scratch +md5sum $testdir/file1.chk | _filter_scratch + +# success, all done +status=0 +exit diff --git a/tests/generic/290.out b/tests/generic/290.out new file mode 100644 index 0000000..2343695 --- /dev/null +++ b/tests/generic/290.out @@ -0,0 +1,12 @@ +QA output created by 290 +Format and mount +Create the original files +Compare files +b8a8a88d4c143f79900c4b4e79aa3e37 SCRATCH_MNT/test-290/file1 +ce2023f765eba19677517c511886d5c9 SCRATCH_MNT/test-290/file3 +b8a8a88d4c143f79900c4b4e79aa3e37 SCRATCH_MNT/test-290/file1.chk +CoW across the transition +Compare files +e8cf59797f0b3758c8878c368bb4cf7e SCRATCH_MNT/test-290/file1 +ce2023f765eba19677517c511886d5c9 SCRATCH_MNT/test-290/file3 +e8cf59797f0b3758c8878c368bb4cf7e SCRATCH_MNT/test-290/file1.chk diff --git a/tests/generic/291 b/tests/generic/291 new file mode 100755 index 0000000..0f35ee0 --- /dev/null +++ b/tests/generic/291 @@ -0,0 +1,91 @@ +#! /bin/bash +# FS QA Test No. 291 +# +# Ensuring that copy on write in buffered mode to the source file when the +# CoW range covers holes and regular shared blocks. +# - Create two files. +# - Truncate the first file. +# - Write the odd blocks of the first file. +# - Reflink the odd blocks of the first file into the second file. +# - CoW the first file across the halfway mark, starting with the +# regular extent. +# - Check that the files are now different where we say they're different. +# +#----------------------------------------------------------------------- +# Copyright (c) 2016, Oracle and/or its affiliates. All Rights Reserved. +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License as +# published by the Free Software Foundation. +# +# This program is distributed in the hope that it would be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write the Free Software Foundation, +# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA +#----------------------------------------------------------------------- + +seq=`basename $0` +seqres=$RESULT_DIR/$seq +echo "QA output created by $seq" + +here=`pwd` +tmp=/tmp/$$ +status=1 # failure is the default! +trap "_cleanup; exit \$status" 0 1 2 3 15 + +_cleanup() +{ + cd / + rm -rf $tmp.* +} + +# get standard environment, filters and checks +. ./common/rc +. ./common/filter +. ./common/reflink + +# real QA test starts here +_supported_os Linux +_require_scratch_reflink +_require_xfs_io_command "falloc" + +rm -f $seqres.full + +echo "Format and mount" +_scratch_mkfs > $seqres.full 2>&1 +_scratch_mount >> $seqres.full 2>&1 + +testdir=$SCRATCH_MNT/test-$seq +mkdir $testdir + +echo "Create the original files" +blksz=65536 +nr=64 +filesize=$((blksz * nr)) +_sweave_reflink_holes $blksz $nr $testdir/file1 $testdir/file3 >> $seqres.full +_scratch_remount + +echo "Compare files" +md5sum $testdir/file1 | _filter_scratch +md5sum $testdir/file3 | _filter_scratch +md5sum $testdir/file1.chk | _filter_scratch + +echo "CoW across the transition" +cowoff=$((filesize / 4)) +cowsz=$((filesize / 2)) +$XFS_IO_PROG -f -c "pwrite -S 0x63 -b $cowsz $cowoff $cowsz" $testdir/file1 >> $seqres.full +_pwrite_byte 0x63 $cowoff $cowsz $testdir/file1.chk >> $seqres.full +_scratch_remount + +echo "Compare files" +md5sum $testdir/file1 | _filter_scratch +md5sum $testdir/file3 | _filter_scratch +md5sum $testdir/file1.chk | _filter_scratch + +# success, all done +status=0 +exit diff --git a/tests/generic/291.out b/tests/generic/291.out new file mode 100644 index 0000000..6ac3d0e --- /dev/null +++ b/tests/generic/291.out @@ -0,0 +1,12 @@ +QA output created by 291 +Format and mount +Create the original files +Compare files +b8a8a88d4c143f79900c4b4e79aa3e37 SCRATCH_MNT/test-291/file1 +ce2023f765eba19677517c511886d5c9 SCRATCH_MNT/test-291/file3 +b8a8a88d4c143f79900c4b4e79aa3e37 SCRATCH_MNT/test-291/file1.chk +CoW across the transition +Compare files +e8cf59797f0b3758c8878c368bb4cf7e SCRATCH_MNT/test-291/file1 +ce2023f765eba19677517c511886d5c9 SCRATCH_MNT/test-291/file3 +e8cf59797f0b3758c8878c368bb4cf7e SCRATCH_MNT/test-291/file1.chk diff --git a/tests/generic/292 b/tests/generic/292 new file mode 100755 index 0000000..c3d9f11 --- /dev/null +++ b/tests/generic/292 @@ -0,0 +1,92 @@ +#! /bin/bash +# FS QA Test No. 292 +# +# Ensuring that copy on write in directio mode to the source file when the +# CoW range covers holes and regular shared blocks. +# - Create two files. +# - Truncate the first file. +# - Write the odd blocks of the first file. +# - Reflink the odd blocks of the first file into the second file. +# - DIO CoW the first file across the halfway mark, starting with the +# regular extent. +# - Check that the files are now different where we say they're different. +# +#----------------------------------------------------------------------- +# Copyright (c) 2016, Oracle and/or its affiliates. All Rights Reserved. +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License as +# published by the Free Software Foundation. +# +# This program is distributed in the hope that it would be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write the Free Software Foundation, +# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA +#----------------------------------------------------------------------- + +seq=`basename $0` +seqres=$RESULT_DIR/$seq +echo "QA output created by $seq" + +here=`pwd` +tmp=/tmp/$$ +status=1 # failure is the default! +trap "_cleanup; exit \$status" 0 1 2 3 15 + +_cleanup() +{ + cd / + rm -rf $tmp.* +} + +# get standard environment, filters and checks +. ./common/rc +. ./common/filter +. ./common/reflink + +# real QA test starts here +_supported_os Linux +_require_scratch_reflink +_require_xfs_io_command "falloc" +_require_odirect + +rm -f $seqres.full + +echo "Format and mount" +_scratch_mkfs > $seqres.full 2>&1 +_scratch_mount >> $seqres.full 2>&1 + +testdir=$SCRATCH_MNT/test-$seq +mkdir $testdir + +echo "Create the original files" +blksz=65536 +nr=64 +filesize=$((blksz * nr)) +_sweave_reflink_holes $blksz $nr $testdir/file1 $testdir/file3 >> $seqres.full +_scratch_remount + +echo "Compare files" +md5sum $testdir/file1 | _filter_scratch +md5sum $testdir/file3 | _filter_scratch +md5sum $testdir/file1.chk | _filter_scratch + +echo "CoW across the transition" +cowoff=$((filesize / 4)) +cowsz=$((filesize / 2)) +$XFS_IO_PROG -d -f -c "pwrite -S 0x63 -b $cowsz $cowoff $cowsz" $testdir/file1 >> $seqres.full +_pwrite_byte 0x63 $cowoff $cowsz $testdir/file1.chk >> $seqres.full +_scratch_remount + +echo "Compare files" +md5sum $testdir/file1 | _filter_scratch +md5sum $testdir/file3 | _filter_scratch +md5sum $testdir/file1.chk | _filter_scratch + +# success, all done +status=0 +exit diff --git a/tests/generic/292.out b/tests/generic/292.out new file mode 100644 index 0000000..a50e54f --- /dev/null +++ b/tests/generic/292.out @@ -0,0 +1,12 @@ +QA output created by 292 +Format and mount +Create the original files +Compare files +b8a8a88d4c143f79900c4b4e79aa3e37 SCRATCH_MNT/test-292/file1 +ce2023f765eba19677517c511886d5c9 SCRATCH_MNT/test-292/file3 +b8a8a88d4c143f79900c4b4e79aa3e37 SCRATCH_MNT/test-292/file1.chk +CoW across the transition +Compare files +e8cf59797f0b3758c8878c368bb4cf7e SCRATCH_MNT/test-292/file1 +ce2023f765eba19677517c511886d5c9 SCRATCH_MNT/test-292/file3 +e8cf59797f0b3758c8878c368bb4cf7e SCRATCH_MNT/test-292/file1.chk diff --git a/tests/generic/293 b/tests/generic/293 new file mode 100755 index 0000000..f6579d9 --- /dev/null +++ b/tests/generic/293 @@ -0,0 +1,93 @@ +#! /bin/bash +# FS QA Test No. 293 +# +# Ensuring that copy on write in buffered mode to the source file when the +# CoW range covers delalloc blocks and regular shared blocks. +# - Create two files. +# - Truncate the first file. +# - Write the odd blocks of the first file. +# - Reflink the odd blocks of the first file into the second file. +# - Write the even blocks of the first file. +# - CoW the first file across the halfway mark, starting with the +# regular extent. +# - Check that the files are now different where we say they're different. +# +#----------------------------------------------------------------------- +# Copyright (c) 2016, Oracle and/or its affiliates. All Rights Reserved. +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License as +# published by the Free Software Foundation. +# +# This program is distributed in the hope that it would be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write the Free Software Foundation, +# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA +#----------------------------------------------------------------------- + +seq=`basename $0` +seqres=$RESULT_DIR/$seq +echo "QA output created by $seq" + +here=`pwd` +tmp=/tmp/$$ +status=1 # failure is the default! +trap "_cleanup; exit \$status" 0 1 2 3 15 + +_cleanup() +{ + cd / + rm -rf $tmp.* +} + +# get standard environment, filters and checks +. ./common/rc +. ./common/filter +. ./common/reflink + +# real QA test starts here +_supported_os Linux +_require_scratch_reflink +_require_xfs_io_command "falloc" + +rm -f $seqres.full + +echo "Format and mount" +_scratch_mkfs > $seqres.full 2>&1 +_scratch_mount >> $seqres.full 2>&1 + +testdir=$SCRATCH_MNT/test-$seq +mkdir $testdir + +echo "Create the original files" +blksz=65536 +nr=64 +filesize=$((blksz * nr)) +_sweave_reflink_holes $blksz $nr $testdir/file1 $testdir/file3 >> $seqres.full +_scratch_remount + +echo "Compare files" +md5sum $testdir/file1 | _filter_scratch +md5sum $testdir/file3 | _filter_scratch +md5sum $testdir/file1.chk | _filter_scratch + +echo "CoW across the transition" +cowoff=$((filesize / 4)) +cowsz=$((filesize / 2)) +_sweave_reflink_holes_delalloc $blksz $nr $testdir/file1 >> $seqres.full +$XFS_IO_PROG -f -c "pwrite -S 0x63 -b $cowsz $cowoff $cowsz" $testdir/file1 >> $seqres.full +_pwrite_byte 0x63 $cowoff $cowsz $testdir/file1.chk >> $seqres.full +_scratch_remount + +echo "Compare files" +md5sum $testdir/file1 | _filter_scratch +md5sum $testdir/file3 | _filter_scratch +md5sum $testdir/file1.chk | _filter_scratch + +# success, all done +status=0 +exit diff --git a/tests/generic/293.out b/tests/generic/293.out new file mode 100644 index 0000000..aaf4fe2 --- /dev/null +++ b/tests/generic/293.out @@ -0,0 +1,12 @@ +QA output created by 293 +Format and mount +Create the original files +Compare files +b8a8a88d4c143f79900c4b4e79aa3e37 SCRATCH_MNT/test-293/file1 +ce2023f765eba19677517c511886d5c9 SCRATCH_MNT/test-293/file3 +b8a8a88d4c143f79900c4b4e79aa3e37 SCRATCH_MNT/test-293/file1.chk +CoW across the transition +Compare files +35e2170e14665b780c6dec328d6a263b SCRATCH_MNT/test-293/file1 +ce2023f765eba19677517c511886d5c9 SCRATCH_MNT/test-293/file3 +35e2170e14665b780c6dec328d6a263b SCRATCH_MNT/test-293/file1.chk diff --git a/tests/generic/295 b/tests/generic/295 new file mode 100755 index 0000000..e7cfaa0 --- /dev/null +++ b/tests/generic/295 @@ -0,0 +1,94 @@ +#! /bin/bash +# FS QA Test No. 295 +# +# Ensuring that copy on write in directio mode to the source file when the +# CoW range covers delalloc blocks and regular shared blocks. +# - Create two files. +# - Truncate the first file. +# - Write the odd blocks of the first file. +# - Reflink the odd blocks of the first file into the second file. +# - Write the even blocks of the first file. +# - DIO CoW the first file across the halfway mark, starting with the +# regular extent. +# - Check that the files are now different where we say they're different. +# +#----------------------------------------------------------------------- +# Copyright (c) 2016, Oracle and/or its affiliates. All Rights Reserved. +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License as +# published by the Free Software Foundation. +# +# This program is distributed in the hope that it would be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write the Free Software Foundation, +# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA +#----------------------------------------------------------------------- + +seq=`basename $0` +seqres=$RESULT_DIR/$seq +echo "QA output created by $seq" + +here=`pwd` +tmp=/tmp/$$ +status=1 # failure is the default! +trap "_cleanup; exit \$status" 0 1 2 3 15 + +_cleanup() +{ + cd / + rm -rf $tmp.* +} + +# get standard environment, filters and checks +. ./common/rc +. ./common/filter +. ./common/reflink + +# real QA test starts here +_supported_os Linux +_require_scratch_reflink +_require_xfs_io_command "falloc" +_require_odirect + +rm -f $seqres.full + +echo "Format and mount" +_scratch_mkfs > $seqres.full 2>&1 +_scratch_mount >> $seqres.full 2>&1 + +testdir=$SCRATCH_MNT/test-$seq +mkdir $testdir + +echo "Create the original files" +blksz=65536 +nr=64 +filesize=$((blksz * nr)) +_sweave_reflink_holes $blksz $nr $testdir/file1 $testdir/file3 >> $seqres.full +_scratch_remount + +echo "Compare files" +md5sum $testdir/file1 | _filter_scratch +md5sum $testdir/file3 | _filter_scratch +md5sum $testdir/file1.chk | _filter_scratch + +echo "CoW across the transition" +cowoff=$((filesize / 4)) +cowsz=$((filesize / 2)) +_sweave_reflink_holes_delalloc $blksz $nr $testdir/file1 >> $seqres.full +$XFS_IO_PROG -d -f -c "pwrite -S 0x63 -b $cowsz $cowoff $cowsz" $testdir/file1 >> $seqres.full +_pwrite_byte 0x63 $cowoff $cowsz $testdir/file1.chk >> $seqres.full +_scratch_remount + +echo "Compare files" +md5sum $testdir/file1 | _filter_scratch +md5sum $testdir/file3 | _filter_scratch +md5sum $testdir/file1.chk | _filter_scratch + +# success, all done +status=0 +exit diff --git a/tests/generic/295.out b/tests/generic/295.out new file mode 100644 index 0000000..cdc2b10 --- /dev/null +++ b/tests/generic/295.out @@ -0,0 +1,12 @@ +QA output created by 295 +Format and mount +Create the original files +Compare files +b8a8a88d4c143f79900c4b4e79aa3e37 SCRATCH_MNT/test-295/file1 +ce2023f765eba19677517c511886d5c9 SCRATCH_MNT/test-295/file3 +b8a8a88d4c143f79900c4b4e79aa3e37 SCRATCH_MNT/test-295/file1.chk +CoW across the transition +Compare files +35e2170e14665b780c6dec328d6a263b SCRATCH_MNT/test-295/file1 +ce2023f765eba19677517c511886d5c9 SCRATCH_MNT/test-295/file3 +35e2170e14665b780c6dec328d6a263b SCRATCH_MNT/test-295/file1.chk diff --git a/tests/generic/296 b/tests/generic/296 new file mode 100755 index 0000000..53eceb2 --- /dev/null +++ b/tests/generic/296 @@ -0,0 +1,90 @@ +#! /bin/bash +# FS QA Test No. 296 +# +# - Create two reflinked files a byte longer than a block. +# - Rewrite the whole file. +# +#----------------------------------------------------------------------- +# Copyright (c) 2016, Oracle and/or its affiliates. All Rights Reserved. +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License as +# published by the Free Software Foundation. +# +# This program is distributed in the hope that it would be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write the Free Software Foundation, +# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA +#----------------------------------------------------------------------- + +seq=`basename $0` +seqres=$RESULT_DIR/$seq +echo "QA output created by $seq" + +here=`pwd` +tmp=/tmp/$$ +status=1 # failure is the default! +trap "_cleanup; exit \$status" 0 1 2 3 15 + +_cleanup() +{ + cd / + rm -rf $tmp.* +} + +# get standard environment, filters and checks +. ./common/rc +. ./common/filter +. ./common/reflink + +# real QA test starts here +_supported_os Linux +_require_scratch_reflink +_require_cp_reflink + +rm -f $seqres.full + +echo "Format and mount" +_scratch_mkfs > $seqres.full 2>&1 +_scratch_mount >> $seqres.full 2>&1 + +testdir=$SCRATCH_MNT/test-$seq +mkdir $testdir + +blksz=65536 +nr=128 +filesize=$((blksz * nr)) +bufnr=16 +bufsize=$((blksz * bufnr)) + +real_blksz=$(stat -f -c '%S' "$testdir") +_require_fs_space $SCRATCH_MNT $((filesize / 1024 * 3 * 5 / 4)) + +echo "Create the original files" +$XFS_IO_PROG -f -c "pwrite -S 0x61 -b $bufsize 0 $((filesize + 1))" $testdir/file1 >> $seqres.full +_cp_reflink $testdir/file1 $testdir/file2 >> $seqres.full +$XFS_IO_PROG -f -c "pwrite -S 0x61 -b $bufsize 0 $((filesize + 1))" $testdir/file2.chk >> $seqres.full +_scratch_remount + +echo "Compare files" +md5sum $testdir/file1 | _filter_scratch +md5sum $testdir/file2 | _filter_scratch +md5sum $testdir/file2.chk | _filter_scratch + +echo "CoW and unmount" +$XFS_IO_PROG -f -c "pwrite -S 0x63 -b $real_blksz 0 $((filesize + 1))" -c "fdatasync" $testdir/file2 >> $seqres.full +$XFS_IO_PROG -f -c "pwrite -S 0x63 -b $real_blksz 0 $((filesize + 1))" -c "fdatasync" $testdir/file2.chk >> $seqres.full +_scratch_remount + +echo "Compare files" +md5sum $testdir/file1 | _filter_scratch +md5sum $testdir/file2 | _filter_scratch +md5sum $testdir/file2.chk | _filter_scratch + +# success, all done +status=0 +exit diff --git a/tests/generic/296.out b/tests/generic/296.out new file mode 100644 index 0000000..4f9ed60 --- /dev/null +++ b/tests/generic/296.out @@ -0,0 +1,12 @@ +QA output created by 296 +Format and mount +Create the original files +Compare files +2909feb63a37b0e95fe5cfb7f274f7b1 SCRATCH_MNT/test-296/file1 +2909feb63a37b0e95fe5cfb7f274f7b1 SCRATCH_MNT/test-296/file2 +2909feb63a37b0e95fe5cfb7f274f7b1 SCRATCH_MNT/test-296/file2.chk +CoW and unmount +Compare files +2909feb63a37b0e95fe5cfb7f274f7b1 SCRATCH_MNT/test-296/file1 +d41f6527bc8320364e12ea7076140b8b SCRATCH_MNT/test-296/file2 +d41f6527bc8320364e12ea7076140b8b SCRATCH_MNT/test-296/file2.chk diff --git a/tests/generic/group b/tests/generic/group index b4a180e..c256617 100644 --- a/tests/generic/group +++ b/tests/generic/group @@ -286,10 +286,19 @@ 281 auto quick clone 282 auto quick clone 283 auto quick clone +284 auto quick clone 285 auto rw 286 auto quick other +287 auto quick clone 288 auto quick ioctl trim +289 auto quick clone +290 auto quick clone +291 auto quick clone +292 auto quick clone +293 auto quick clone 294 auto quick +295 auto quick clone +296 auto quick clone 299 auto aio enospc rw stress 300 auto aio enospc preallocrw stress 306 auto quick rw From darrick.wong@oracle.com Thu Feb 11 17:41:01 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=LOTS_OF_MONEY, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay2.corp.sgi.com [137.38.102.29]) by oss.sgi.com (Postfix) with ESMTP id 5FE097F61 for ; Thu, 11 Feb 2016 17:41:01 -0600 (CST) Received: from cuda.sgi.com (cuda1.sgi.com [192.48.157.11]) by relay2.corp.sgi.com (Postfix) with ESMTP id D0C3E30405F for ; Thu, 11 Feb 2016 15:41:00 -0800 (PST) X-ASG-Debug-ID: 1455234027-04bdf066ea738c0001-NocioJ Received: from userp1040.oracle.com (userp1040.oracle.com [156.151.31.81]) by cuda.sgi.com with ESMTP id le0RIQ03KmI1jcmx (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO) for ; Thu, 11 Feb 2016 15:40:28 -0800 (PST) X-Barracuda-Envelope-From: darrick.wong@oracle.com X-Barracuda-Apparent-Source-IP: 156.151.31.81 Received: from userv0022.oracle.com (userv0022.oracle.com [156.151.31.74]) by userp1040.oracle.com (Sentrion-MTA-4.3.2/Sentrion-MTA-4.3.2) with ESMTP id u1BNeQEx032376 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 11 Feb 2016 23:40:26 GMT Received: from aserv0122.oracle.com (aserv0122.oracle.com [141.146.126.236]) by userv0022.oracle.com (8.14.4/8.13.8) with ESMTP id u1BNePUH023265 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=FAIL); Thu, 11 Feb 2016 23:40:25 GMT Received: from abhmp0013.oracle.com (abhmp0013.oracle.com [141.146.116.19]) by aserv0122.oracle.com (8.13.8/8.13.8) with ESMTP id u1BNeOQL026943; Thu, 11 Feb 2016 23:40:24 GMT Received: from localhost (/10.145.178.207) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Thu, 11 Feb 2016 15:40:23 -0800 Subject: [PATCH 10/32] reflink: fix style problems in existing tests From: "Darrick J. Wong" X-ASG-Orig-Subj: [PATCH 10/32] reflink: fix style problems in existing tests To: david@fromorbit.com, darrick.wong@oracle.com Cc: linux-btrfs@vger.kernel.org, fstests@vger.kernel.org, xfs@oss.sgi.com Date: Thu, 11 Feb 2016 15:40:21 -0800 Message-ID: <20160211234021.2202.2919.stgit@birch.djwong.org> In-Reply-To: <20160211233916.2202.40961.stgit@birch.djwong.org> References: <20160211233916.2202.40961.stgit@birch.djwong.org> User-Agent: StGit/0.17.1-dirty MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit X-Source-IP: userv0022.oracle.com [156.151.31.74] X-Barracuda-Connect: userp1040.oracle.com[156.151.31.81] X-Barracuda-Start-Time: 1455234027 X-Barracuda-Encrypted: ECDHE-RSA-AES256-GCM-SHA384 X-Barracuda-URL: https://192.48.157.11:443/cgi-mod/mark.cgi X-Barracuda-BRTS-Status: 1 X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-Spam-Score: 0.00 X-Barracuda-Spam-Status: No, SCORE=0.00 using per-user scores of TAG_LEVEL=1000.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.7 tests=BSF_SC0_MISMATCH_TO, UNPARSEABLE_RELAY X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.3.26959 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 0.00 BSF_SC0_MISMATCH_TO Envelope rcpt doesn't match header 0.00 UNPARSEABLE_RELAY Informational: message has unparseable relay lines Fix style problems such as unnecessary use of quotes, add helper variables to reduce visual clutter, and other minor fixes to make the first batch of tests more closely resemble the second round tests. Signed-off-by: Darrick J. Wong --- tests/generic/110 | 2 - tests/generic/111 | 2 - tests/generic/115 | 2 - tests/generic/116 | 44 ++++++++-------- tests/generic/118 | 42 +++++++-------- tests/generic/119 | 102 ++++++++++++++++++------------------ tests/generic/121 | 44 ++++++++-------- tests/generic/122 | 44 ++++++++-------- tests/generic/134 | 78 ++++++++++++++-------------- tests/generic/136 | 78 ++++++++++++++-------------- tests/generic/137 | 44 ++++++++-------- tests/generic/138 | 104 ++++++++++++++++++------------------- tests/generic/139 | 98 +++++++++++++++++------------------ tests/generic/140 | 104 ++++++++++++++++++------------------- tests/generic/142 | 37 +++++++------ tests/generic/143 | 37 +++++++------ tests/generic/144 | 124 ++++++++++++++++++++++---------------------- tests/generic/145 | 150 +++++++++++++++++++++++++++-------------------------- tests/generic/146 | 132 +++++++++++++++++++++++------------------------ tests/generic/147 | 146 ++++++++++++++++++++++++++-------------------------- tests/generic/148 | 84 +++++++++++++++--------------- tests/generic/149 | 132 +++++++++++++++++++++++------------------------ tests/generic/150 | 23 ++++---- tests/generic/151 | 35 ++++++------ tests/generic/152 | 39 +++++++------- tests/generic/153 | 41 +++++++------- tests/generic/154 | 43 ++++++++------- tests/generic/155 | 39 +++++++------- tests/generic/156 | 43 ++++++++------- tests/generic/157 | 60 +++++++++++---------- tests/generic/158 | 62 +++++++++++----------- tests/generic/159 | 19 ++++--- tests/generic/160 | 19 ++++--- tests/generic/161 | 25 ++++----- tests/generic/162 | 31 +++++------ tests/generic/163 | 31 +++++------ tests/generic/164 | 35 ++++++------ tests/generic/165 | 33 ++++++------ tests/generic/166 | 25 ++++----- tests/generic/167 | 25 ++++----- tests/generic/168 | 31 +++++------ tests/generic/170 | 31 +++++------ tests/generic/171 | 55 ++++++++++--------- tests/generic/172 | 55 ++++++++++--------- tests/generic/173 | 47 ++++++++--------- tests/generic/174 | 55 ++++++++++--------- tests/generic/178 | 31 ++++++----- tests/generic/179 | 50 +++++++++--------- tests/generic/180 | 50 +++++++++--------- tests/generic/181 | 38 +++++++------ tests/generic/182 | 80 ++++++++++++++-------------- tests/generic/183 | 50 +++++++++--------- tests/generic/185 | 50 +++++++++--------- tests/generic/186 | 69 +++++++++++++----------- tests/generic/187 | 69 +++++++++++++----------- tests/generic/188 | 34 ++++++------ tests/generic/189 | 34 ++++++------ tests/generic/190 | 34 ++++++------ tests/generic/191 | 34 ++++++------ tests/generic/194 | 34 ++++++------ tests/generic/195 | 34 ++++++------ tests/generic/196 | 34 ++++++------ tests/generic/197 | 34 ++++++------ tests/generic/199 | 34 ++++++------ tests/generic/200 | 34 ++++++------ tests/generic/201 | 38 +++++++------ tests/generic/202 | 37 ++++++------- tests/generic/203 | 37 ++++++------- tests/generic/205 | 47 ++++++++--------- tests/generic/206 | 47 ++++++++--------- tests/generic/216 | 47 ++++++++--------- tests/generic/217 | 47 ++++++++--------- tests/generic/218 | 39 +++++++------- tests/generic/220 | 39 +++++++------- tests/generic/222 | 47 ++++++++--------- tests/generic/227 | 47 ++++++++--------- tests/generic/229 | 73 +++++++++++++------------- tests/generic/238 | 73 +++++++++++++------------- tests/generic/242 | 47 ++++++++--------- tests/generic/243 | 47 ++++++++--------- tests/xfs/127 | 29 +++++----- tests/xfs/128 | 93 ++++++++++++++++----------------- tests/xfs/129 | 33 ++++++------ tests/xfs/131 | 21 ++++--- tests/xfs/132 | 43 ++++++++------- tests/xfs/139 | 31 +++++------ tests/xfs/140 | 37 ++++++------- 87 files changed, 2187 insertions(+), 2171 deletions(-) diff --git a/tests/generic/110 b/tests/generic/110 index a43f02d..1fcdb56 100755 --- a/tests/generic/110 +++ b/tests/generic/110 @@ -37,7 +37,7 @@ trap "_cleanup; exit \$status" 0 1 2 3 15 _cleanup() { cd / - rm -f $tmp.* "$testdir" + rm -f $tmp.* $testdir } # get standard environment, filters and checks diff --git a/tests/generic/111 b/tests/generic/111 index ef9c424..dce9c84 100755 --- a/tests/generic/111 +++ b/tests/generic/111 @@ -37,7 +37,7 @@ trap "_cleanup; exit \$status" 0 1 2 3 15 _cleanup() { cd / - rm -f $tmp.* "$testdir" + rm -f $tmp.* $testdir } # get standard environment, filters and checks diff --git a/tests/generic/115 b/tests/generic/115 index 578d5bd..43ce59c 100755 --- a/tests/generic/115 +++ b/tests/generic/115 @@ -35,7 +35,7 @@ trap "_cleanup; exit \$status" 0 1 2 3 15 _cleanup() { cd / - rm -f $tmp.* "$testdir" + rm -f $tmp.* $testdir } # get standard environment, filters and checks diff --git a/tests/generic/116 b/tests/generic/116 index 5c361e2..18f8073 100755 --- a/tests/generic/116 +++ b/tests/generic/116 @@ -22,8 +22,8 @@ # Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA #----------------------------------------------------------------------- -seq=`basename "$0"` -seqres="$RESULT_DIR/$seq" +seq=`basename $0` +seqres=$RESULT_DIR/$seq echo "QA output created by $seq" here=`pwd` @@ -34,7 +34,7 @@ trap "_cleanup; exit \$status" 0 1 2 3 15 _cleanup() { cd / - rm -rf "$tmp".* "$testdir" + rm -rf $tmp.* $testdir } # get standard environment, filters and checks @@ -46,44 +46,44 @@ _cleanup() _supported_os Linux _require_test_reflink -rm -f "$seqres.full" +rm -f $seqres.full -testdir="$TEST_DIR/test-$seq" -rm -rf "$testdir" -mkdir "$testdir" +testdir=$TEST_DIR/test-$seq +rm -rf $testdir +mkdir $testdir echo "Create the original files" blksz=65536 -_pwrite_byte 0x61 $((blksz * 2)) $((blksz * 6)) "$testdir/file1" >> "$seqres.full" -_pwrite_byte 0x61 $((blksz * 2)) $((blksz * 6)) "$testdir/file2" >> "$seqres.full" +_pwrite_byte 0x61 $((blksz * 2)) $((blksz * 6)) $testdir/file1 >> $seqres.full +_pwrite_byte 0x61 $((blksz * 2)) $((blksz * 6)) $testdir/file2 >> $seqres.full _test_remount -md5sum "$testdir/file1" | _filter_test_dir -md5sum "$testdir/file2" | _filter_test_dir +md5sum $testdir/file1 | _filter_test_dir +md5sum $testdir/file2 | _filter_test_dir -_compare_range "$testdir/file1" 0 "$testdir/file2" 0 $((blksz * 8)) \ +_compare_range $testdir/file1 0 $testdir/file2 0 $((blksz * 8)) \ || echo "Files do not match" echo "Reflink the middle blocks together" -free_before="$(stat -f -c '%a' "$testdir")" -_reflink_range "$testdir/file1" $((blksz * 4)) "$testdir/file2" \ - $((blksz * 4)) $((blksz * 2)) >> "$seqres.full" +free_before=$(stat -f -c '%a' $testdir) +_reflink_range $testdir/file1 $((blksz * 4)) $testdir/file2 \ + $((blksz * 4)) $((blksz * 2)) >> $seqres.full _test_remount -free_after="$(stat -f -c '%a' "$testdir")" -echo "freesp changed by $free_before -> $free_after" >> "$seqres.full" +free_after=$(stat -f -c '%a' $testdir) +echo "freesp changed by $free_before -> $free_after" >> $seqres.full echo "Compare sections" -md5sum "$testdir/file1" | _filter_test_dir -md5sum "$testdir/file2" | _filter_test_dir +md5sum $testdir/file1 | _filter_test_dir +md5sum $testdir/file2 | _filter_test_dir -_compare_range "$testdir/file1" 0 "$testdir/file2" 0 $((blksz * 4)) \ +_compare_range $testdir/file1 0 $testdir/file2 0 $((blksz * 4)) \ || echo "Start sections do not match" -_compare_range "$testdir/file1" $((blksz * 4)) "$testdir/file2" \ +_compare_range $testdir/file1 $((blksz * 4)) $testdir/file2 \ $((blksz * 4)) $((blksz * 2)) \ || echo "Middle sections do not match" -_compare_range "$testdir/file1" $((blksz * 6)) "$testdir/file2" \ +_compare_range $testdir/file1 $((blksz * 6)) $testdir/file2 \ $((blksz * 6)) $((blksz * 2)) \ || echo "End sections do not match" diff --git a/tests/generic/118 b/tests/generic/118 index 41e525c..6b6478b 100755 --- a/tests/generic/118 +++ b/tests/generic/118 @@ -23,7 +23,7 @@ # Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA #----------------------------------------------------------------------- -seq=`basename "$0"` +seq=`basename $0` seqres=$RESULT_DIR/$seq echo "QA output created by $seq" @@ -35,7 +35,7 @@ trap "_cleanup; exit \$status" 0 1 2 3 15 _cleanup() { cd / - rm -rf "$tmp".* "$testdir" + rm -rf $tmp.* $testdir } # get standard environment, filters and checks @@ -47,44 +47,44 @@ _cleanup() _supported_os Linux _require_test_reflink -rm -f "$seqres.full" +rm -f $seqres.full -testdir="$TEST_DIR/test-$seq" -rm -rf "$testdir" -mkdir "$testdir" +testdir=$TEST_DIR/test-$seq +rm -rf $testdir +mkdir $testdir echo "Create the original files" blksz=65536 -_pwrite_byte 0x61 $((blksz * 2)) $((blksz * 6)) "$testdir/file1" >> "$seqres.full" -_pwrite_byte 0x62 $((blksz * 2)) $((blksz * 6)) "$testdir/file2" >> "$seqres.full" +_pwrite_byte 0x61 $((blksz * 2)) $((blksz * 6)) $testdir/file1 >> $seqres.full +_pwrite_byte 0x62 $((blksz * 2)) $((blksz * 6)) $testdir/file2 >> $seqres.full _test_remount -md5sum "$testdir/file1" | _filter_test_dir -md5sum "$testdir/file2" | _filter_test_dir +md5sum $testdir/file1 | _filter_test_dir +md5sum $testdir/file2 | _filter_test_dir -_compare_range "$testdir/file1" 0 "$testdir/file2" 0 $((blksz * 8)) \ +_compare_range $testdir/file1 0 $testdir/file2 0 $((blksz * 8)) \ || echo "Files do not match (intentional)" echo "Reflink the middle blocks together" -free_before="$(stat -f -c '%a' "$testdir")" -_reflink_range "$testdir/file1" $((blksz * 4)) "$testdir/file2" \ - $((blksz * 4)) $((blksz * 2)) >> "$seqres.full" +free_before=$(stat -f -c '%a' $testdir) +_reflink_range $testdir/file1 $((blksz * 4)) $testdir/file2 \ + $((blksz * 4)) $((blksz * 2)) >> $seqres.full _test_remount -free_after="$(stat -f -c '%a' "$testdir")" -echo "freesp changed by $free_before -> $free_after" >> "$seqres.full" +free_after=$(stat -f -c '%a' $testdir) +echo "freesp changed by $free_before -> $free_after" >> $seqres.full echo "Compare sections" -md5sum "$testdir/file1" | _filter_test_dir -md5sum "$testdir/file2" | _filter_test_dir +md5sum $testdir/file1 | _filter_test_dir +md5sum $testdir/file2 | _filter_test_dir -_compare_range "$testdir/file1" 0 "$testdir/file2" 0 $((blksz * 4)) \ +_compare_range $testdir/file1 0 $testdir/file2 0 $((blksz * 4)) \ || echo "Start sections do not match (intentional)" -_compare_range "$testdir/file1" $((blksz * 4)) "$testdir/file2" \ +_compare_range $testdir/file1 $((blksz * 4)) $testdir/file2 \ $((blksz * 4)) $((blksz * 2)) \ || echo "Middle sections do not match" -_compare_range "$testdir/file1" $((blksz * 6)) "$testdir/file2" \ +_compare_range $testdir/file1 $((blksz * 6)) $testdir/file2 \ $((blksz * 6)) $((blksz * 2)) \ || echo "End sections do not match (intentional)" diff --git a/tests/generic/119 b/tests/generic/119 index 27e7604..1a7d26e 100755 --- a/tests/generic/119 +++ b/tests/generic/119 @@ -24,8 +24,8 @@ # Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA #----------------------------------------------------------------------- -seq=`basename "$0"` -seqres="$RESULT_DIR/$seq" +seq=`basename $0` +seqres=$RESULT_DIR/$seq echo "QA output created by $seq" here=`pwd` @@ -36,7 +36,7 @@ trap "_cleanup; exit \$status" 0 1 2 3 15 _cleanup() { cd / - rm -rf "$tmp".* "$testdir" + rm -rf $tmp.* $testdir } # get standard environment, filters and checks @@ -48,7 +48,7 @@ _cleanup() _supported_os Linux _require_test_reflink -rm -f "$seqres.full" +rm -f $seqres.full testdir=$TEST_DIR/test-$seq rm -rf $testdir @@ -56,112 +56,112 @@ mkdir $testdir echo "Create the original files" blksz=65536 -_pwrite_byte 0x61 0 $((blksz * 8)) "$testdir/file1" >> "$seqres.full" -_pwrite_byte 0x62 0 $((blksz * 8)) "$testdir/file2" >> "$seqres.full" -_pwrite_byte 0x63 0 $((blksz * 8)) "$testdir/file3" >> "$seqres.full" -_pwrite_byte 0x64 0 $((blksz * 8)) "$testdir/file4" >> "$seqres.full" +_pwrite_byte 0x61 0 $((blksz * 8)) $testdir/file1 >> $seqres.full +_pwrite_byte 0x62 0 $((blksz * 8)) $testdir/file2 >> $seqres.full +_pwrite_byte 0x63 0 $((blksz * 8)) $testdir/file3 >> $seqres.full +_pwrite_byte 0x64 0 $((blksz * 8)) $testdir/file4 >> $seqres.full _test_remount -md5sum "$testdir/file1" | _filter_test_dir -md5sum "$testdir/file2" | _filter_test_dir -md5sum "$testdir/file3" | _filter_test_dir -md5sum "$testdir/file4" | _filter_test_dir +md5sum $testdir/file1 | _filter_test_dir +md5sum $testdir/file2 | _filter_test_dir +md5sum $testdir/file3 | _filter_test_dir +md5sum $testdir/file4 | _filter_test_dir -_compare_range "$testdir/file1" 0 "$testdir/file2" 0 $((blksz * 8)) \ +_compare_range $testdir/file1 0 $testdir/file2 0 $((blksz * 8)) \ || echo "Files 1-2 do not match (intentional)" -_compare_range "$testdir/file1" 0 "$testdir/file3" 0 $((blksz * 8)) \ +_compare_range $testdir/file1 0 $testdir/file3 0 $((blksz * 8)) \ || echo "Files 1-3 do not match (intentional)" -_compare_range "$testdir/file1" 0 "$testdir/file4" 0 $((blksz * 8)) \ +_compare_range $testdir/file1 0 $testdir/file4 0 $((blksz * 8)) \ || echo "Files 1-4 do not match (intentional)" echo "Reflink the first four blocks together, 1-2 3-4" -free_before="$(stat -f -c '%a' "$testdir")" -_reflink_range "$testdir/file1" 0 "$testdir/file2" 0 $((blksz * 4)) >> "$seqres.full" -_reflink_range "$testdir/file3" 0 "$testdir/file4" 0 $((blksz * 4)) >> "$seqres.full" +free_before=$(stat -f -c '%a' $testdir) +_reflink_range $testdir/file1 0 $testdir/file2 0 $((blksz * 4)) >> $seqres.full +_reflink_range $testdir/file3 0 $testdir/file4 0 $((blksz * 4)) >> $seqres.full _test_remount -free_after="$(stat -f -c '%a' "$testdir")" -echo "freesp changed by $free_before -> $free_after" >> "$seqres.full" +free_after=$(stat -f -c '%a' $testdir) +echo "freesp changed by $free_before -> $free_after" >> $seqres.full echo "Compare sections" -md5sum "$testdir/file1" | _filter_test_dir -md5sum "$testdir/file2" | _filter_test_dir -md5sum "$testdir/file3" | _filter_test_dir -md5sum "$testdir/file4" | _filter_test_dir +md5sum $testdir/file1 | _filter_test_dir +md5sum $testdir/file2 | _filter_test_dir +md5sum $testdir/file3 | _filter_test_dir +md5sum $testdir/file4 | _filter_test_dir -_compare_range "$testdir/file1" 0 "$testdir/file2" 0 $((blksz * 4)) \ +_compare_range $testdir/file1 0 $testdir/file2 0 $((blksz * 4)) \ || echo "Sections of file 1-2 do not match" -_compare_range "$testdir/file1" 0 "$testdir/file3" 0 $((blksz * 4)) \ +_compare_range $testdir/file1 0 $testdir/file3 0 $((blksz * 4)) \ || echo "Sections of file 1-3 do not match (intentional)" -_compare_range "$testdir/file1" 0 "$testdir/file4" 0 $((blksz * 4)) \ +_compare_range $testdir/file1 0 $testdir/file4 0 $((blksz * 4)) \ || echo "Sections of file 1-4 do not match (intentional)" -_compare_range "$testdir/file2" 0 "$testdir/file3" 0 $((blksz * 4)) \ +_compare_range $testdir/file2 0 $testdir/file3 0 $((blksz * 4)) \ || echo "Sections of file 2-3 do not match (intentional)" -_compare_range "$testdir/file2" 0 "$testdir/file4" 0 $((blksz * 4)) \ +_compare_range $testdir/file2 0 $testdir/file4 0 $((blksz * 4)) \ || echo "Sections of file 2-4 do not match (intentional)" -_compare_range "$testdir/file3" 0 "$testdir/file4" 0 $((blksz * 4)) \ +_compare_range $testdir/file3 0 $testdir/file4 0 $((blksz * 4)) \ || echo "Sections of file 3-4 do not match" echo "Reflink the first two blocks together, 1-3 1-4" -free_before="$(stat -f -c '%a' $testdir)" -_reflink_range "$testdir/file1" 0 "$testdir/file3" 0 $((blksz * 2)) >> "$seqres.full" -_reflink_range "$testdir/file1" 0 "$testdir/file4" 0 $((blksz * 2)) >> "$seqres.full" +free_before=$(stat -f -c '%a' $testdir) +_reflink_range $testdir/file1 0 $testdir/file3 0 $((blksz * 2)) >> $seqres.full +_reflink_range $testdir/file1 0 $testdir/file4 0 $((blksz * 2)) >> $seqres.full _test_remount -free_after="$(stat -f -c '%a' $testdir)" -echo "freesp changed by $free_before -> $free_after" >> "$seqres.full" +free_after=$(stat -f -c '%a' $testdir) +echo "freesp changed by $free_before -> $free_after" >> $seqres.full echo "Compare sections" -md5sum "$testdir/file1" | _filter_test_dir -md5sum "$testdir/file2" | _filter_test_dir -md5sum "$testdir/file3" | _filter_test_dir -md5sum "$testdir/file4" | _filter_test_dir +md5sum $testdir/file1 | _filter_test_dir +md5sum $testdir/file2 | _filter_test_dir +md5sum $testdir/file3 | _filter_test_dir +md5sum $testdir/file4 | _filter_test_dir -_compare_range "$testdir/file1" 0 "$testdir/file2" 0 $((blksz * 2)) \ +_compare_range $testdir/file1 0 $testdir/file2 0 $((blksz * 2)) \ || echo "Sections of files 1-2 do not match" -_compare_range "$testdir/file1" 0 "$testdir/file3" 0 $((blksz * 2)) \ +_compare_range $testdir/file1 0 $testdir/file3 0 $((blksz * 2)) \ || echo "Sections of files 1-3 do not match" -_compare_range "$testdir/file1" 0 "$testdir/file4" 0 $((blksz * 2)) \ +_compare_range $testdir/file1 0 $testdir/file4 0 $((blksz * 2)) \ || echo "Sections of files 1-4 do not match" -_compare_range "$testdir/file2" 0 "$testdir/file3" 0 $((blksz * 2)) \ +_compare_range $testdir/file2 0 $testdir/file3 0 $((blksz * 2)) \ || echo "Sections of files 2-3 do not match" -_compare_range "$testdir/file2" 0 "$testdir/file4" 0 $((blksz * 2)) \ +_compare_range $testdir/file2 0 $testdir/file4 0 $((blksz * 2)) \ || echo "Sections of files 2-4 do not match" -_compare_range "$testdir/file3" 0 "$testdir/file4" 0 $((blksz * 2)) \ +_compare_range $testdir/file3 0 $testdir/file4 0 $((blksz * 2)) \ || echo "Sections of files 3-4 do not match" echo "Compare previously reflinked sections" -_compare_range "$testdir/file1" $((blksz * 2)) "$testdir/file2" \ +_compare_range $testdir/file1 $((blksz * 2)) $testdir/file2 \ $((blksz * 2)) $((blksz * 2)) \ || echo "Sections of file 1-2 do not match" -_compare_range "$testdir/file1" $((blksz * 2)) "$testdir/file3" \ +_compare_range $testdir/file1 $((blksz * 2)) $testdir/file3 \ $((blksz * 2)) $((blksz * 2)) \ || echo "Sections of file 1-3 do not match (intentional)" -_compare_range "$testdir/file1" $((blksz * 2)) "$testdir/file4" \ +_compare_range $testdir/file1 $((blksz * 2)) $testdir/file4 \ $((blksz * 2)) $((blksz * 2)) \ || echo "Sections of file 1-4 do not match (intentional)" -_compare_range "$testdir/file2" $((blksz * 2)) "$testdir/file3" \ +_compare_range $testdir/file2 $((blksz * 2)) $testdir/file3 \ $((blksz * 2)) $((blksz * 2)) \ || echo "Sections of file 2-3 do not match (intentional)" -_compare_range "$testdir/file2" $((blksz * 2)) "$testdir/file4" \ +_compare_range $testdir/file2 $((blksz * 2)) $testdir/file4 \ $((blksz * 2)) $((blksz * 2)) \ || echo "Sections of file 2-4 do not match (intentional)" -_compare_range "$testdir/file3" $((blksz * 2)) "$testdir/file4" \ +_compare_range $testdir/file3 $((blksz * 2)) $testdir/file4 \ $((blksz * 2)) $((blksz * 2)) \ || echo "Sections of file 3-4 do not match" diff --git a/tests/generic/121 b/tests/generic/121 index 0e15e8d..7d6f982 100755 --- a/tests/generic/121 +++ b/tests/generic/121 @@ -22,8 +22,8 @@ # Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA #----------------------------------------------------------------------- -seq=`basename "$0"` -seqres="$RESULT_DIR/$seq" +seq=`basename $0` +seqres=$RESULT_DIR/$seq echo "QA output created by $seq" here=`pwd` @@ -34,7 +34,7 @@ trap "_cleanup; exit \$status" 0 1 2 3 15 _cleanup() { cd / - rm -rf "$tmp".* "$testdir" + rm -rf $tmp.* $testdir } # get standard environment, filters and checks @@ -46,44 +46,44 @@ _cleanup() _supported_os Linux _require_test_dedupe -rm -f "$seqres.full" +rm -f $seqres.full -testdir="$TEST_DIR/test-$seq" -rm -rf "$testdir" -mkdir "$testdir" +testdir=$TEST_DIR/test-$seq +rm -rf $testdir +mkdir $testdir echo "Create the original files" blksz=65536 -_pwrite_byte 0x61 $((blksz * 2)) $((blksz * 6)) "$testdir/file1" >> "$seqres.full" -_pwrite_byte 0x61 $((blksz * 2)) $((blksz * 6)) "$testdir/file2" >> "$seqres.full" +_pwrite_byte 0x61 $((blksz * 2)) $((blksz * 6)) $testdir/file1 >> $seqres.full +_pwrite_byte 0x61 $((blksz * 2)) $((blksz * 6)) $testdir/file2 >> $seqres.full _test_remount -md5sum "$testdir/file1" | _filter_test_dir -md5sum "$testdir/file2" | _filter_test_dir +md5sum $testdir/file1 | _filter_test_dir +md5sum $testdir/file2 | _filter_test_dir -_compare_range "$testdir/file1" 0 "$testdir/file2" 0 $((blksz * 8)) \ +_compare_range $testdir/file1 0 $testdir/file2 0 $((blksz * 8)) \ || echo "Files 1-2 do not match (intentional)" echo "Dedupe the middle blocks together" -free_before="$(stat -f -c '%a' "$testdir")" -_dedupe_range "$testdir/file1" $((blksz * 4)) "$testdir/file2" \ - $((blksz * 4)) $((blksz * 2)) >> "$seqres.full" +free_before=$(stat -f -c '%a' $testdir) +_dedupe_range $testdir/file1 $((blksz * 4)) $testdir/file2 \ + $((blksz * 4)) $((blksz * 2)) >> $seqres.full _test_remount -free_after="$(stat -f -c '%a' "$testdir")" -echo "freesp changed by $free_before -> $free_after" >> "$seqres.full" +free_after=$(stat -f -c '%a' $testdir) +echo "freesp changed by $free_before -> $free_after" >> $seqres.full echo "Compare sections" -md5sum "$testdir/file1" | _filter_test_dir -md5sum "$testdir/file2" | _filter_test_dir +md5sum $testdir/file1 | _filter_test_dir +md5sum $testdir/file2 | _filter_test_dir -_compare_range "$testdir/file1" 0 "$testdir/file2" 0 $((blksz * 4)) \ +_compare_range $testdir/file1 0 $testdir/file2 0 $((blksz * 4)) \ || echo "Start sections do not match" -_compare_range "$testdir/file1" $((blksz * 4)) "$testdir/file2" \ +_compare_range $testdir/file1 $((blksz * 4)) $testdir/file2 \ $((blksz * 4)) $((blksz * 2)) \ || echo "Middle sections do not match" -_compare_range "$testdir/file1" $((blksz * 6)) "$testdir/file2" \ +_compare_range $testdir/file1 $((blksz * 6)) $testdir/file2 \ $((blksz * 6)) $((blksz * 2)) \ || echo "End sections do not match" diff --git a/tests/generic/122 b/tests/generic/122 index e7585f7..d5cc3a2 100755 --- a/tests/generic/122 +++ b/tests/generic/122 @@ -22,8 +22,8 @@ # Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA #----------------------------------------------------------------------- -seq=`basename "$0"` -seqres="$RESULT_DIR/$seq" +seq=`basename $0` +seqres=$RESULT_DIR/$seq echo "QA output created by $seq" here=`pwd` @@ -34,7 +34,7 @@ trap "_cleanup; exit \$status" 0 1 2 3 15 _cleanup() { cd / - rm -rf "$tmp".* "$testdir" + rm -rf $tmp.* $testdir } # get standard environment, filters and checks @@ -46,44 +46,44 @@ _cleanup() _supported_os Linux _require_test_dedupe -rm -f "$seqres.full" +rm -f $seqres.full -testdir="$TEST_DIR/test-$seq" -rm -rf "$testdir" -mkdir "$testdir" +testdir=$TEST_DIR/test-$seq +rm -rf $testdir +mkdir $testdir echo "Create the original files" blksz=65536 -_pwrite_byte 0x61 $((blksz * 2)) $((blksz * 6)) "$testdir/file1" >> "$seqres.full" -_pwrite_byte 0x62 $((blksz * 2)) $((blksz * 6)) "$testdir/file2" >> "$seqres.full" +_pwrite_byte 0x61 $((blksz * 2)) $((blksz * 6)) $testdir/file1 >> $seqres.full +_pwrite_byte 0x62 $((blksz * 2)) $((blksz * 6)) $testdir/file2 >> $seqres.full _test_remount -md5sum "$testdir/file1" | _filter_test_dir -md5sum "$testdir/file2" | _filter_test_dir +md5sum $testdir/file1 | _filter_test_dir +md5sum $testdir/file2 | _filter_test_dir -_compare_range "$testdir/file1" 0 "$testdir/file2" 0 "$((blksz * 8))" \ +_compare_range $testdir/file1 0 $testdir/file2 0 "$((blksz * 8))" \ || echo "Files 1-2 do not match (intentional)" echo "(Fail to) dedupe the middle blocks together" -free_before="$(stat -f -c '%a' "$testdir")" -_dedupe_range "$testdir/file1" $((blksz * 4)) "$testdir/file2" \ - $((blksz * 4)) $((blksz * 2)) >> "$seqres.full" +free_before=$(stat -f -c '%a' $testdir) +_dedupe_range $testdir/file1 $((blksz * 4)) $testdir/file2 \ + $((blksz * 4)) $((blksz * 2)) >> $seqres.full _test_remount -free_after="$(stat -f -c '%a' "$testdir")" -echo "freesp changed by $free_before -> $free_after" >> "$seqres.full" +free_after=$(stat -f -c '%a' $testdir) +echo "freesp changed by $free_before -> $free_after" >> $seqres.full echo "Compare sections" -md5sum "$testdir/file1" | _filter_test_dir -md5sum "$testdir/file2" | _filter_test_dir +md5sum $testdir/file1 | _filter_test_dir +md5sum $testdir/file2 | _filter_test_dir -_compare_range "$testdir/file1" 0 "$testdir/file2" 0 $((blksz * 4)) \ +_compare_range $testdir/file1 0 $testdir/file2 0 $((blksz * 4)) \ || echo "Start sections do not match (intentional)" -_compare_range "$testdir/file1" $((blksz * 4)) "$testdir/file2" \ +_compare_range $testdir/file1 $((blksz * 4)) $testdir/file2 \ $((blksz * 4)) $((blksz * 2)) \ || echo "Middle sections do not match (intentional)" -_compare_range "$testdir/file1" $((blksz * 6)) "$testdir/file2" \ +_compare_range $testdir/file1 $((blksz * 6)) $testdir/file2 \ $((blksz * 6)) $((blksz * 2)) \ || echo "End sections do not match (intentional)" diff --git a/tests/generic/134 b/tests/generic/134 index 1dda839..b1b1fa7 100755 --- a/tests/generic/134 +++ b/tests/generic/134 @@ -26,8 +26,8 @@ # Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA #----------------------------------------------------------------------- -seq=`basename "$0"` -seqres="$RESULT_DIR/$seq" +seq=`basename $0` +seqres=$RESULT_DIR/$seq echo "QA output created by $seq" here=`pwd` @@ -38,7 +38,7 @@ trap "_cleanup; exit \$status" 0 1 2 3 15 _cleanup() { cd / - rm -rf "$tmp".* "$testdir" + rm -rf $tmp.* $testdir } # get standard environment, filters and checks @@ -50,46 +50,46 @@ _cleanup() _supported_os Linux _require_test_reflink -rm -f "$seqres.full" +rm -f $seqres.full -testdir="$TEST_DIR/test-$seq" -rm -rf "$testdir" -mkdir "$testdir" +testdir=$TEST_DIR/test-$seq +rm -rf $testdir +mkdir $testdir echo "Create the original files" blksz=65536 -_pwrite_byte 0x61 0 $((blksz + 37)) "$testdir/file1" >> "$seqres.full" -_pwrite_byte 0x61 0 $((blksz + 37)) "$testdir/file2" >> "$seqres.full" -_pwrite_byte 0x62 0 $((blksz + 37)) "$testdir/file3" >> "$seqres.full" -_pwrite_byte 0x62 0 $((blksz + 37)) "$testdir/file4" >> "$seqres.full" +_pwrite_byte 0x61 0 $((blksz + 37)) $testdir/file1 >> $seqres.full +_pwrite_byte 0x61 0 $((blksz + 37)) $testdir/file2 >> $seqres.full +_pwrite_byte 0x62 0 $((blksz + 37)) $testdir/file3 >> $seqres.full +_pwrite_byte 0x62 0 $((blksz + 37)) $testdir/file4 >> $seqres.full _test_remount -md5sum "$testdir/file1" | _filter_test_dir -md5sum "$testdir/file2" | _filter_test_dir -md5sum "$testdir/file3" | _filter_test_dir -md5sum "$testdir/file4" | _filter_test_dir +md5sum $testdir/file1 | _filter_test_dir +md5sum $testdir/file2 | _filter_test_dir +md5sum $testdir/file3 | _filter_test_dir +md5sum $testdir/file4 | _filter_test_dir c1="$(_md5_checksum $testdir/file1)" c2="$(_md5_checksum $testdir/file2)" c3="$(_md5_checksum $testdir/file3)" c4="$(_md5_checksum $testdir/file4)" -test "${c1}" = "${c2}" || echo "file1 and file2 should match" -test "${c1}" != "${c3}" || echo "file1 and file3 should not match" -test "${c1}" != "${c4}" || echo "file1 and file4 should not match" -test "${c2}" != "${c3}" || echo "file2 and file3 should not match" -test "${c2}" != "${c4}" || echo "file2 and file4 should not match" -test "${c3}" = "${c4}" || echo "file3 and file4 should match" +test ${c1} = ${c2} || echo "file1 and file2 should match" +test ${c1} != ${c3} || echo "file1 and file3 should not match" +test ${c1} != ${c4} || echo "file1 and file4 should not match" +test ${c2} != ${c3} || echo "file2 and file3 should not match" +test ${c2} != ${c4} || echo "file2 and file4 should not match" +test ${c3} = ${c4} || echo "file3 and file4 should match" echo "Reflink the last blocks together, 1-2 1-3" -_reflink_range "$testdir/file1" $blksz "$testdir/file2" $blksz 37 >> "$seqres.full" -_reflink_range "$testdir/file1" $blksz "$testdir/file3" $blksz 37 >> "$seqres.full" +_reflink_range $testdir/file1 $blksz $testdir/file2 $blksz 37 >> $seqres.full +_reflink_range $testdir/file1 $blksz $testdir/file3 $blksz 37 >> $seqres.full _test_remount -md5sum "$testdir/file1" | _filter_test_dir -md5sum "$testdir/file2" | _filter_test_dir -md5sum "$testdir/file3" | _filter_test_dir -md5sum "$testdir/file4" | _filter_test_dir +md5sum $testdir/file1 | _filter_test_dir +md5sum $testdir/file2 | _filter_test_dir +md5sum $testdir/file3 | _filter_test_dir +md5sum $testdir/file4 | _filter_test_dir c1="$(_md5_checksum $testdir/file1)" c2="$(_md5_checksum $testdir/file2)" @@ -97,30 +97,30 @@ c3="$(_md5_checksum $testdir/file3)" c4="$(_md5_checksum $testdir/file4)" echo "Compare files" -test "${c1}" = "${c2}" || echo "file1 and file2 should match" -test "${c1}" != "${c3}" || echo "file1 and file3 should not match" -test "${c1}" != "${c4}" || echo "file1 and file4 should not match" -test "${c2}" != "${c3}" || echo "file2 and file3 should not match" -test "${c2}" != "${c4}" || echo "file2 and file4 should not match" -test "${c3}" != "${c4}" || echo "file3 and file4 should match" +test ${c1} = ${c2} || echo "file1 and file2 should match" +test ${c1} != ${c3} || echo "file1 and file3 should not match" +test ${c1} != ${c4} || echo "file1 and file4 should not match" +test ${c2} != ${c3} || echo "file2 and file3 should not match" +test ${c2} != ${c4} || echo "file2 and file4 should not match" +test ${c3} != ${c4} || echo "file3 and file4 should match" echo "Compare sections" -_compare_range "$testdir/file1" $blksz "$testdir/file2" $blksz 37 \ +_compare_range $testdir/file1 $blksz $testdir/file2 $blksz 37 \ || echo "End sections of files 1-2 do not match" -_compare_range "$testdir/file1" $blksz "$testdir/file3" $blksz 37 \ +_compare_range $testdir/file1 $blksz $testdir/file3 $blksz 37 \ || echo "End sections of files 1-3 do not match" -_compare_range "$testdir/file1" $blksz "$testdir/file4" $blksz 37 \ +_compare_range $testdir/file1 $blksz $testdir/file4 $blksz 37 \ || echo "End sections of files 1-4 do not match (intentional)" -_compare_range "$testdir/file2" $blksz "$testdir/file3" $blksz 37 \ +_compare_range $testdir/file2 $blksz $testdir/file3 $blksz 37 \ || echo "End sections of files 2-3 do not match" -_compare_range "$testdir/file2" $blksz "$testdir/file4" $blksz 37 \ +_compare_range $testdir/file2 $blksz $testdir/file4 $blksz 37 \ || echo "End sections of files 2-4 do not match (intentional)" -_compare_range "$testdir/file3" $blksz "$testdir/file4" $blksz 37 \ +_compare_range $testdir/file3 $blksz $testdir/file4 $blksz 37 \ || echo "End sections of files 3-4 do not match (intentional)" # success, all done diff --git a/tests/generic/136 b/tests/generic/136 index 6bd6b14..bc69fa7 100755 --- a/tests/generic/136 +++ b/tests/generic/136 @@ -26,8 +26,8 @@ # Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA #----------------------------------------------------------------------- -seq=`basename "$0"` -seqres="$RESULT_DIR/$seq" +seq=`basename $0` +seqres=$RESULT_DIR/$seq echo "QA output created by $seq" here=`pwd` @@ -38,7 +38,7 @@ trap "_cleanup; exit \$status" 0 1 2 3 15 _cleanup() { cd / - rm -rf "$tmp".* "$testdir" + rm -rf $tmp.* $testdir } # get standard environment, filters and checks @@ -50,48 +50,48 @@ _cleanup() _supported_os Linux _require_test_dedupe -rm -f "$seqres.full" +rm -f $seqres.full -testdir="$TEST_DIR/test-$seq" -rm -rf "$testdir" -mkdir "$testdir" +testdir=$TEST_DIR/test-$seq +rm -rf $testdir +mkdir $testdir echo "Create the original files" blksz=65536 -_pwrite_byte 0x61 0 $((blksz + 37)) "$testdir/file1" >> "$seqres.full" -_pwrite_byte 0x61 0 $((blksz + 37)) "$testdir/file2" >> "$seqres.full" -_pwrite_byte 0x62 0 $((blksz + 37)) "$testdir/file3" >> "$seqres.full" -_pwrite_byte 0x62 0 $((blksz + 37)) "$testdir/file4" >> "$seqres.full" +_pwrite_byte 0x61 0 $((blksz + 37)) $testdir/file1 >> $seqres.full +_pwrite_byte 0x61 0 $((blksz + 37)) $testdir/file2 >> $seqres.full +_pwrite_byte 0x62 0 $((blksz + 37)) $testdir/file3 >> $seqres.full +_pwrite_byte 0x62 0 $((blksz + 37)) $testdir/file4 >> $seqres.full _test_remount -md5sum "$testdir/file1" | _filter_test_dir -md5sum "$testdir/file2" | _filter_test_dir -md5sum "$testdir/file3" | _filter_test_dir -md5sum "$testdir/file4" | _filter_test_dir +md5sum $testdir/file1 | _filter_test_dir +md5sum $testdir/file2 | _filter_test_dir +md5sum $testdir/file3 | _filter_test_dir +md5sum $testdir/file4 | _filter_test_dir c1="$(_md5_checksum $testdir/file1)" c2="$(_md5_checksum $testdir/file2)" c3="$(_md5_checksum $testdir/file3)" c4="$(_md5_checksum $testdir/file4)" -test "${c1}" = "${c2}" || echo "file1 and file2 should match" -test "${c1}" != "${c3}" || echo "file1 and file3 should not match" -test "${c1}" != "${c4}" || echo "file1 and file4 should not match" -test "${c2}" != "${c3}" || echo "file2 and file3 should not match" -test "${c2}" != "${c4}" || echo "file2 and file4 should not match" -test "${c3}" = "${c4}" || echo "file3 and file4 should match" +test ${c1} = ${c2} || echo "file1 and file2 should match" +test ${c1} != ${c3} || echo "file1 and file3 should not match" +test ${c1} != ${c4} || echo "file1 and file4 should not match" +test ${c2} != ${c3} || echo "file2 and file3 should not match" +test ${c2} != ${c4} || echo "file2 and file4 should not match" +test ${c3} = ${c4} || echo "file3 and file4 should match" echo "Dedupe the last blocks together" echo "1->2" -_dedupe_range "$testdir/file1" $blksz "$testdir/file2" $blksz 37 >> "$seqres.full" +_dedupe_range $testdir/file1 $blksz $testdir/file2 $blksz 37 >> $seqres.full echo "1->3" -_dedupe_range "$testdir/file1" $blksz "$testdir/file3" $blksz 37 >> "$seqres.full" +_dedupe_range $testdir/file1 $blksz $testdir/file3 $blksz 37 >> $seqres.full _test_remount -md5sum "$testdir/file1" | _filter_test_dir -md5sum "$testdir/file2" | _filter_test_dir -md5sum "$testdir/file3" | _filter_test_dir -md5sum "$testdir/file4" | _filter_test_dir +md5sum $testdir/file1 | _filter_test_dir +md5sum $testdir/file2 | _filter_test_dir +md5sum $testdir/file3 | _filter_test_dir +md5sum $testdir/file4 | _filter_test_dir c1="$(_md5_checksum $testdir/file1)" c2="$(_md5_checksum $testdir/file2)" @@ -99,30 +99,30 @@ c3="$(_md5_checksum $testdir/file3)" c4="$(_md5_checksum $testdir/file4)" echo "Compare files" -test "${c1}" = "${c2}" || echo "file1 and file2 should match" -test "${c1}" != "${c3}" || echo "file1 and file3 should not match" -test "${c1}" != "${c4}" || echo "file1 and file4 should not match" -test "${c2}" != "${c3}" || echo "file2 and file3 should not match" -test "${c2}" != "${c4}" || echo "file2 and file4 should not match" -test "${c3}" = "${c4}" || echo "file3 and file4 should match" +test ${c1} = ${c2} || echo "file1 and file2 should match" +test ${c1} != ${c3} || echo "file1 and file3 should not match" +test ${c1} != ${c4} || echo "file1 and file4 should not match" +test ${c2} != ${c3} || echo "file2 and file3 should not match" +test ${c2} != ${c4} || echo "file2 and file4 should not match" +test ${c3} = ${c4} || echo "file3 and file4 should match" echo "Compare sections" -_compare_range "$testdir/file1" $blksz "$testdir/file2" $blksz 37 \ +_compare_range $testdir/file1 $blksz $testdir/file2 $blksz 37 \ || echo "End sections of files 1-2 do not match" -_compare_range "$testdir/file1" $blksz "$testdir/file3" $blksz 37 \ +_compare_range $testdir/file1 $blksz $testdir/file3 $blksz 37 \ || echo "End sections of files 1-3 do not match (intentional)" -_compare_range "$testdir/file1" $blksz "$testdir/file4" $blksz 37 \ +_compare_range $testdir/file1 $blksz $testdir/file4 $blksz 37 \ || echo "End sections of files 1-4 do not match (intentional)" -_compare_range "$testdir/file2" $blksz "$testdir/file3" $blksz 37 \ +_compare_range $testdir/file2 $blksz $testdir/file3 $blksz 37 \ || echo "End sections of files 2-3 do not match (intentional)" -_compare_range "$testdir/file2" $blksz "$testdir/file4" $blksz 37 \ +_compare_range $testdir/file2 $blksz $testdir/file4 $blksz 37 \ || echo "End sections of files 2-4 do not match (intentional)" -_compare_range "$testdir/file3" $blksz "$testdir/file4" $blksz 37 \ +_compare_range $testdir/file3 $blksz $testdir/file4 $blksz 37 \ || echo "End sections of files 3-4 do not match" # success, all done diff --git a/tests/generic/137 b/tests/generic/137 index dcfd90d..19a7ab4 100755 --- a/tests/generic/137 +++ b/tests/generic/137 @@ -26,8 +26,8 @@ # Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA #----------------------------------------------------------------------- -seq=`basename "$0"` -seqres="$RESULT_DIR/$seq" +seq=`basename $0` +seqres=$RESULT_DIR/$seq echo "QA output created by $seq" here=`pwd` @@ -38,7 +38,7 @@ trap "_cleanup; exit \$status" 0 1 2 3 15 _cleanup() { cd / - rm -rf "$tmp".* "$testdir" + rm -rf $tmp.* $testdir } # get standard environment, filters and checks @@ -52,57 +52,57 @@ _require_test_reflink _require_test_dedupe _require_xfs_io_command "falloc" -rm -f "$seqres.full" +rm -f $seqres.full -testdir="$TEST_DIR/test-$seq" -rm -rf "$testdir" -mkdir "$testdir" +testdir=$TEST_DIR/test-$seq +rm -rf $testdir +mkdir $testdir echo "Create the original file blocks" blksz=65536 -_pwrite_byte 0x61 0 $blksz "$testdir/file1" >> "$seqres.full" -_pwrite_byte 0x62 $blksz $((blksz * 2)) "$testdir/file1" >> "$seqres.full" +_pwrite_byte 0x61 0 $blksz $testdir/file1 >> $seqres.full +_pwrite_byte 0x62 $blksz $((blksz * 2)) $testdir/file1 >> $seqres.full nr_blks=1024 echo "fallocate half the file" -"$XFS_IO_PROG" -f -c "falloc $((nr_blks * blksz / 2)) $((nr_blks * blksz / 2))" "$testdir/file1" >> "$seqres.full" +$XFS_IO_PROG -f -c "falloc $((nr_blks * blksz / 2)) $((nr_blks * blksz / 2))" $testdir/file1 >> $seqres.full echo "Reflink block zero to the threes" seq 1 $((nr_blks / 3)) | while read nr; do - _reflink_range "$testdir/file1" 0 "$testdir/file1" $((nr * 3 * blksz)) \ - $blksz >> "$seqres.full" + _reflink_range $testdir/file1 0 $testdir/file1 $((nr * 3 * blksz)) \ + $blksz >> $seqres.full done echo "Reflink block one to the fives" seq 1 $((nr_blks / 5)) | while read nr; do - _reflink_range "$testdir/file1" $blksz "$testdir/file1" \ - $((nr * 5 * blksz)) $blksz >> "$seqres.full" + _reflink_range $testdir/file1 $blksz $testdir/file1 \ + $((nr * 5 * blksz)) $blksz >> $seqres.full done echo "Dedupe block two to the sevens" seq 1 $((nr_blks / 7)) | while read nr; do - _dedupe_range "$testdir/file1" $((blksz * 2)) "$testdir/file1" \ - $((nr * 7 * blksz)) $blksz >> "$seqres.full" 2>&1 + _dedupe_range $testdir/file1 $((blksz * 2)) $testdir/file1 \ + $((nr * 7 * blksz)) $blksz >> $seqres.full 2>&1 done _test_remount echo "Check block mappings" -md5sum "$testdir/file1" | _filter_test_dir +md5sum $testdir/file1 | _filter_test_dir crcZ=$(_md5_range_checksum /dev/zero 0 $blksz) -crc0=$(_md5_range_checksum "$testdir/file1" 0 $blksz) -crc1=$(_md5_range_checksum "$testdir/file1" $blksz $blksz) -crc2=$(_md5_range_checksum "$testdir/file1" $((blksz * 2)) $blksz) +crc0=$(_md5_range_checksum $testdir/file1 0 $blksz) +crc1=$(_md5_range_checksum $testdir/file1 $blksz $blksz) +crc2=$(_md5_range_checksum $testdir/file1 $((blksz * 2)) $blksz) check_block() { - lblk="$1" + lblk=$1 rem7=$((lblk % 7)) rem5=$((lblk % 5)) rem3=$((lblk % 3)) - crc=$(_md5_range_checksum "$testdir/file1" $((lblk * blksz)) $blksz) + crc=$(_md5_range_checksum $testdir/file1 $((lblk * blksz)) $blksz) if [ $rem7 -eq 0 ]; then if [ $rem5 -eq 0 ]; then diff --git a/tests/generic/138 b/tests/generic/138 index 59d23e9..c8b4255 100755 --- a/tests/generic/138 +++ b/tests/generic/138 @@ -23,8 +23,8 @@ # Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA #----------------------------------------------------------------------- -seq=`basename "$0"` -seqres="$RESULT_DIR/$seq" +seq=`basename $0` +seqres=$RESULT_DIR/$seq echo "QA output created by $seq" here=`pwd` @@ -35,7 +35,7 @@ trap "_cleanup; exit \$status" 0 1 2 3 15 _cleanup() { cd / - rm -rf "$tmp".* "$testdir" + rm -rf $tmp.* $testdir } # get standard environment, filters and checks @@ -48,103 +48,103 @@ _supported_os Linux _require_test_reflink _require_cp_reflink -rm -f "$seqres.full" +rm -f $seqres.full -testdir="$TEST_DIR/test-$seq" -rm -rf "$testdir" -mkdir "$testdir" +testdir=$TEST_DIR/test-$seq +rm -rf $testdir +mkdir $testdir echo "Create the original files" blksz=65536 -_pwrite_byte 0x61 0 $((blksz * 48 - 3)) "$testdir/file1" >> "$seqres.full" -_cp_reflink "$testdir/file1" "$testdir/file2" >> "$seqres.full" -_pwrite_byte 0x61 0 $((blksz * 48 - 3)) "$testdir/file3" >> "$seqres.full" +_pwrite_byte 0x61 0 $((blksz * 48 - 3)) $testdir/file1 >> $seqres.full +_cp_reflink $testdir/file1 $testdir/file2 >> $seqres.full +_pwrite_byte 0x61 0 $((blksz * 48 - 3)) $testdir/file3 >> $seqres.full _test_remount echo "Compare files" -md5sum "$testdir/file1" | _filter_test_dir -md5sum "$testdir/file2" | _filter_test_dir -md5sum "$testdir/file3" | _filter_test_dir +md5sum $testdir/file1 | _filter_test_dir +md5sum $testdir/file2 | _filter_test_dir +md5sum $testdir/file3 | _filter_test_dir -cmp -s "$testdir/file1" "$testdir/file2" || echo "Files 1-2 do not match" -cmp -s "$testdir/file1" "$testdir/file3" || echo "Files 1-3 do not match" -cmp -s "$testdir/file2" "$testdir/file3" || echo "Files 2-3 do not match" +cmp -s $testdir/file1 $testdir/file2 || echo "Files 1-2 do not match" +cmp -s $testdir/file1 $testdir/file3 || echo "Files 1-3 do not match" +cmp -s $testdir/file2 $testdir/file3 || echo "Files 2-3 do not match" echo "pagecache CoW the second file" -_pwrite_byte 0x62 0 17 "$testdir/file2" >> "$seqres.full" -_pwrite_byte 0x62 0 17 "$testdir/file3" >> "$seqres.full" +_pwrite_byte 0x62 0 17 $testdir/file2 >> $seqres.full +_pwrite_byte 0x62 0 17 $testdir/file3 >> $seqres.full -_pwrite_byte 0x62 $((blksz * 16 - 34)) 17 "$testdir/file2" >> "$seqres.full" -_pwrite_byte 0x62 $((blksz * 16 - 34)) 17 "$testdir/file3" >> "$seqres.full" +_pwrite_byte 0x62 $((blksz * 16 - 34)) 17 $testdir/file2 >> $seqres.full +_pwrite_byte 0x62 $((blksz * 16 - 34)) 17 $testdir/file3 >> $seqres.full -_pwrite_byte 0x62 $((blksz * 48 - 8)) 17 "$testdir/file2" >> "$seqres.full" -_pwrite_byte 0x62 $((blksz * 48 - 8)) 17 "$testdir/file3" >> "$seqres.full" +_pwrite_byte 0x62 $((blksz * 48 - 8)) 17 $testdir/file2 >> $seqres.full +_pwrite_byte 0x62 $((blksz * 48 - 8)) 17 $testdir/file3 >> $seqres.full _test_remount echo "Compare files" -md5sum "$testdir/file1" | _filter_test_dir -md5sum "$testdir/file2" | _filter_test_dir -md5sum "$testdir/file3" | _filter_test_dir +md5sum $testdir/file1 | _filter_test_dir +md5sum $testdir/file2 | _filter_test_dir +md5sum $testdir/file3 | _filter_test_dir -cmp -s "$testdir/file1" "$testdir/file2" || echo "Files 1-2 do not match (intentional)" -cmp -s "$testdir/file1" "$testdir/file3" || echo "Files 1-3 do not match (intentional)" -cmp -s "$testdir/file2" "$testdir/file3" || echo "Files 2-3 do not match" +cmp -s $testdir/file1 $testdir/file2 || echo "Files 1-2 do not match (intentional)" +cmp -s $testdir/file1 $testdir/file3 || echo "Files 1-3 do not match (intentional)" +cmp -s $testdir/file2 $testdir/file3 || echo "Files 2-3 do not match" echo "Compare the CoW'd section to the before file" -_compare_range "$testdir/file1" 0 "$testdir/file2" 0 17 \ +_compare_range $testdir/file1 0 $testdir/file2 0 17 \ || echo "Start sections do not match (intentional)" -_compare_range "$testdir/file1" $((blksz * 16 - 34)) \ - "$testdir/file2" $((blksz * 16 - 34)) 17 \ +_compare_range $testdir/file1 $((blksz * 16 - 34)) \ + $testdir/file2 $((blksz * 16 - 34)) 17 \ || echo "Middle sections do not match (intentional)" -_compare_range "$testdir/file1" $((blksz * 48 - 8)) \ - "$testdir/file2" $((blksz * 48 - 8)) 17 \ +_compare_range $testdir/file1 $((blksz * 48 - 8)) \ + $testdir/file2 $((blksz * 48 - 8)) 17 \ || echo "End sections do not match (intentional)" echo "Compare the CoW'd section to the after file" -_compare_range "$testdir/file2" 0 "$testdir/file3" 0 17 \ +_compare_range $testdir/file2 0 $testdir/file3 0 17 \ || echo "Start sections do not match" -_compare_range "$testdir/file2" $((blksz * 16 - 34)) \ - "$testdir/file3" $((blksz * 16 - 34)) 17 \ +_compare_range $testdir/file2 $((blksz * 16 - 34)) \ + $testdir/file3 $((blksz * 16 - 34)) 17 \ || echo "Middle sections do not match" -_compare_range "$testdir/file2" $((blksz * 48 - 8)) \ - "$testdir/file3" $((blksz * 48 - 8)) 17 \ +_compare_range $testdir/file2 $((blksz * 48 - 8)) \ + $testdir/file3 $((blksz * 48 - 8)) 17 \ || echo "End sections do not match" echo "Compare the not CoW'd sections" -_compare_range "$testdir/file1" 18 "$testdir/file2" 18 17 \ +_compare_range $testdir/file1 18 $testdir/file2 18 17 \ || echo "Start sections of 1-2 do not match" -_compare_range "$testdir/file2" 18 "$testdir/file3" 18 17 \ +_compare_range $testdir/file2 18 $testdir/file3 18 17 \ || echo "Start sections of 2-3 do not match" -_compare_range "$testdir/file1" $((blksz * 16 - 17)) \ - "$testdir/file2" $((blksz * 16 - 17)) 82 \ +_compare_range $testdir/file1 $((blksz * 16 - 17)) \ + $testdir/file2 $((blksz * 16 - 17)) 82 \ || echo "Middle sections of 1-2 do not match" -_compare_range "$testdir/file2" $((blksz * 16 - 17)) \ - "$testdir/file3" $((blksz * 16 - 17)) 82 \ +_compare_range $testdir/file2 $((blksz * 16 - 17)) \ + $testdir/file3 $((blksz * 16 - 17)) 82 \ || echo "Middle sections of 2-3 do not match" -_compare_range "$testdir/file1" $((blksz * 48 - 108)) \ - "$testdir/file2" $((blksz * 48 - 108)) 100 \ +_compare_range $testdir/file1 $((blksz * 48 - 108)) \ + $testdir/file2 $((blksz * 48 - 108)) 100 \ || echo "End sections of 1-2 do not match" -_compare_range "$testdir/file2" $((blksz * 48 - 108)) \ - "$testdir/file3" $((blksz * 48 - 108)) 100 \ +_compare_range $testdir/file2 $((blksz * 48 - 108)) \ + $testdir/file3 $((blksz * 48 - 108)) 100 \ || echo "End sections of 2-3 do not match" -_compare_range "$testdir/file1" $((blksz * 14)) \ - "$testdir/file2" $((blksz * 14)) $blksz \ +_compare_range $testdir/file1 $((blksz * 14)) \ + $testdir/file2 $((blksz * 14)) $blksz \ || echo "Untouched sections of 1-2 do not match" -_compare_range "$testdir/file2" $((blksz * 14)) \ - "$testdir/file3" $((blksz * 14)) $blksz \ +_compare_range $testdir/file2 $((blksz * 14)) \ + $testdir/file3 $((blksz * 14)) $blksz \ || echo "Untouched sections of 2-3 do not match" # success, all done diff --git a/tests/generic/139 b/tests/generic/139 index 59e5bff..5e7b631 100755 --- a/tests/generic/139 +++ b/tests/generic/139 @@ -23,8 +23,8 @@ # Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA #----------------------------------------------------------------------- -seq=`basename "$0"` -seqres="$RESULT_DIR/$seq" +seq=`basename $0` +seqres=$RESULT_DIR/$seq echo "QA output created by $seq" here=`pwd` @@ -35,7 +35,7 @@ trap "_cleanup; exit \$status" 0 1 2 3 15 _cleanup() { cd / - rm -rf "$tmp".* "$testdir" + rm -rf $tmp.* $testdir } # get standard environment, filters and checks @@ -48,7 +48,7 @@ _supported_os Linux _require_test_reflink _require_cp_reflink -rm -f "$seqres.full" +rm -f $seqres.full testdir=$TEST_DIR/test-$seq rm -rf $testdir @@ -56,94 +56,94 @@ mkdir $testdir echo "Create the original files" blksz=65536 -_pwrite_byte 0x61 0 $((blksz * 48 - 3)) "$testdir/file1" >> "$seqres.full" -_cp_reflink "$testdir/file1" "$testdir/file2" >> "$seqres.full" -_pwrite_byte 0x61 0 $((blksz * 48 - 3)) "$testdir/file3" >> "$seqres.full" +_pwrite_byte 0x61 0 $((blksz * 48 - 3)) $testdir/file1 >> $seqres.full +_cp_reflink $testdir/file1 $testdir/file2 >> $seqres.full +_pwrite_byte 0x61 0 $((blksz * 48 - 3)) $testdir/file3 >> $seqres.full _test_remount echo "Compare files" -md5sum "$testdir/file1" | _filter_test_dir -md5sum "$testdir/file2" | _filter_test_dir -md5sum "$testdir/file3" | _filter_test_dir +md5sum $testdir/file1 | _filter_test_dir +md5sum $testdir/file2 | _filter_test_dir +md5sum $testdir/file3 | _filter_test_dir -cmp -s "$testdir/file1" "$testdir/file2" || echo "Files 1-2 should match" -cmp -s "$testdir/file1" "$testdir/file3" || echo "Files 1-3 should match" -cmp -s "$testdir/file2" "$testdir/file3" || echo "Files 2-3 should match" +cmp -s $testdir/file1 $testdir/file2 || echo "Files 1-2 should match" +cmp -s $testdir/file1 $testdir/file3 || echo "Files 1-3 should match" +cmp -s $testdir/file2 $testdir/file3 || echo "Files 2-3 should match" echo "directio CoW the second file" -_pwrite_byte 0x62 0 $blksz "$testdir/file2" -d >> "$seqres.full" -_pwrite_byte 0x62 0 $blksz "$testdir/file3" -d >> "$seqres.full" +_pwrite_byte 0x62 0 $blksz $testdir/file2 -d >> $seqres.full +_pwrite_byte 0x62 0 $blksz $testdir/file3 -d >> $seqres.full -_pwrite_byte 0x62 $((blksz * 16 - 512)) 512 "$testdir/file2" -d >> "$seqres.full" -_pwrite_byte 0x62 $((blksz * 16 - 512)) 512 "$testdir/file3" -d >> "$seqres.full" +_pwrite_byte 0x62 $((blksz * 16 - 512)) 512 $testdir/file2 -d >> $seqres.full +_pwrite_byte 0x62 $((blksz * 16 - 512)) 512 $testdir/file3 -d >> $seqres.full -_pwrite_byte 0x62 $((blksz * 48)) $blksz "$testdir/file2" -d >> "$seqres.full" -_pwrite_byte 0x62 $((blksz * 48)) $blksz "$testdir/file3" -d >> "$seqres.full" +_pwrite_byte 0x62 $((blksz * 48)) $blksz $testdir/file2 -d >> $seqres.full +_pwrite_byte 0x62 $((blksz * 48)) $blksz $testdir/file3 -d >> $seqres.full _test_remount echo "Compare files" -md5sum "$testdir/file1" | _filter_test_dir -md5sum "$testdir/file2" | _filter_test_dir -md5sum "$testdir/file3" | _filter_test_dir +md5sum $testdir/file1 | _filter_test_dir +md5sum $testdir/file2 | _filter_test_dir +md5sum $testdir/file3 | _filter_test_dir -cmp -s "$testdir/file1" "$testdir/file2" || echo "Files 1-2 should not match (intentional)" -cmp -s "$testdir/file1" "$testdir/file3" || echo "Files 1-3 should not match (intentional)" -cmp -s "$testdir/file2" "$testdir/file3" || echo "Files 2-3 should match" +cmp -s $testdir/file1 $testdir/file2 || echo "Files 1-2 should not match (intentional)" +cmp -s $testdir/file1 $testdir/file3 || echo "Files 1-3 should not match (intentional)" +cmp -s $testdir/file2 $testdir/file3 || echo "Files 2-3 should match" echo "Compare the CoW'd section to the before file" -_compare_range "$testdir/file1" 0 "$testdir/file2" 0 $blksz \ +_compare_range $testdir/file1 0 $testdir/file2 0 $blksz \ || echo "Start sections do not match (intentional)" -_compare_range "$testdir/file1" $((blksz * 16 - 512)) \ - "$testdir/file2" $((blksz * 16 - 512)) 512 \ +_compare_range $testdir/file1 $((blksz * 16 - 512)) \ + $testdir/file2 $((blksz * 16 - 512)) 512 \ || echo "Middle sections do not match (intentional)" -_compare_range "$testdir/file1" $((blksz * 48 - 512)) \ - "$testdir/file2" $((blksz * 48 - 512)) $blksz \ +_compare_range $testdir/file1 $((blksz * 48 - 512)) \ + $testdir/file2 $((blksz * 48 - 512)) $blksz \ || echo "End sections do not match (intentional)" echo "Compare the CoW'd section to the after file" -_compare_range "$testdir/file2" 0 "$testdir/file3" 0 $blksz \ +_compare_range $testdir/file2 0 $testdir/file3 0 $blksz \ || echo "Start sections do not match" -_compare_range "$testdir/file2" $((blksz * 16 - 512)) \ - "$testdir/file3" $((blksz * 16 - 512)) 512 \ +_compare_range $testdir/file2 $((blksz * 16 - 512)) \ + $testdir/file3 $((blksz * 16 - 512)) 512 \ || echo "Middle sections do not match" -_compare_range "$testdir/file2" $((blksz * 48 - 512)) \ - "$testdir/file3" $((blksz * 48 - 512)) $blksz \ +_compare_range $testdir/file2 $((blksz * 48 - 512)) \ + $testdir/file3 $((blksz * 48 - 512)) $blksz \ || echo "End sections do not match" echo "Compare the not CoW'd sections" -_compare_range "$testdir/file1" $blksz "$testdir/file2" $blksz 512 \ +_compare_range $testdir/file1 $blksz $testdir/file2 $blksz 512 \ || echo "Start sections of 1-2 do not match" -_compare_range "$testdir/file2" $blksz "$testdir/file3" $blksz 512 \ +_compare_range $testdir/file2 $blksz $testdir/file3 $blksz 512 \ || echo "Start sections of 2-3 do not match" -_compare_range "$testdir/file1" $((blksz * 16 - 1024)) \ - "$testdir/file2" $((blksz * 16 - 1024)) 512 \ +_compare_range $testdir/file1 $((blksz * 16 - 1024)) \ + $testdir/file2 $((blksz * 16 - 1024)) 512 \ || echo "Middle sections of 1-2 do not match" -_compare_range "$testdir/file2" $((blksz * 16 - 1024)) \ - "$testdir/file3" $((blksz * 16 - 1024)) 512 \ +_compare_range $testdir/file2 $((blksz * 16 - 1024)) \ + $testdir/file3 $((blksz * 16 - 1024)) 512 \ || echo "Middle sections of 2-3 do not match" -_compare_range "$testdir/file1" $((blksz * 48 - 1024)) \ - "$testdir/file2" $((blksz * 48 - 1024)) 512 \ +_compare_range $testdir/file1 $((blksz * 48 - 1024)) \ + $testdir/file2 $((blksz * 48 - 1024)) 512 \ || echo "End sections of 1-2 do not match" -_compare_range "$testdir/file2" $((blksz * 48 - 1024)) \ - "$testdir/file3" $((blksz * 48 - 1024)) 512 \ +_compare_range $testdir/file2 $((blksz * 48 - 1024)) \ + $testdir/file3 $((blksz * 48 - 1024)) 512 \ || echo "End sections of 2-3 do not match" -_compare_range "$testdir/file1" $((blksz * 16)) \ - "$testdir/file2" $((blksz * 16)) 512 \ +_compare_range $testdir/file1 $((blksz * 16)) \ + $testdir/file2 $((blksz * 16)) 512 \ || echo "Untouched sections of 1-2 do not match" -_compare_range "$testdir/file2" $((blksz * 16)) \ - "$testdir/file3" $((blksz * 16)) 512 \ +_compare_range $testdir/file2 $((blksz * 16)) \ + $testdir/file3 $((blksz * 16)) 512 \ || echo "Untouched sections of 2-3 do not match" # success, all done diff --git a/tests/generic/140 b/tests/generic/140 index e8e7655..5bcd4ef 100755 --- a/tests/generic/140 +++ b/tests/generic/140 @@ -23,8 +23,8 @@ # Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA #----------------------------------------------------------------------- -seq=`basename "$0"` -seqres="$RESULT_DIR/$seq" +seq=`basename $0` +seqres=$RESULT_DIR/$seq echo "QA output created by $seq" here=`pwd` @@ -35,7 +35,7 @@ trap "_cleanup; exit \$status" 0 1 2 3 15 _cleanup() { cd / - rm -rf "$tmp".* "$testdir" + rm -rf $tmp.* $testdir } # get standard environment, filters and checks @@ -48,103 +48,103 @@ _supported_os Linux _require_test_reflink _require_cp_reflink -rm -f "$seqres.full" +rm -f $seqres.full -testdir="$TEST_DIR/test-$seq" -rm -rf "$testdir" -mkdir "$testdir" +testdir=$TEST_DIR/test-$seq +rm -rf $testdir +mkdir $testdir echo "Create the original files" blksz=65536 -_pwrite_byte 0x61 0 $((blksz * 48 - 3)) "$testdir/file1" >> "$seqres.full" -_cp_reflink "$testdir/file1" "$testdir/file2" >> "$seqres.full" -_pwrite_byte 0x61 0 $((blksz * 48 - 3)) "$testdir/file3" >> "$seqres.full" +_pwrite_byte 0x61 0 $((blksz * 48 - 3)) $testdir/file1 >> $seqres.full +_cp_reflink $testdir/file1 $testdir/file2 >> $seqres.full +_pwrite_byte 0x61 0 $((blksz * 48 - 3)) $testdir/file3 >> $seqres.full _test_remount echo "Compare files" -md5sum "$testdir/file1" | _filter_test_dir -md5sum "$testdir/file2" | _filter_test_dir -md5sum "$testdir/file3" | _filter_test_dir +md5sum $testdir/file1 | _filter_test_dir +md5sum $testdir/file2 | _filter_test_dir +md5sum $testdir/file3 | _filter_test_dir -cmp -s "$testdir/file1" "$testdir/file2" || echo "Files 1-2 do not match" -cmp -s "$testdir/file1" "$testdir/file3" || echo "Files 1-3 do not match" -cmp -s "$testdir/file2" "$testdir/file3" || echo "Files 2-3 do not match" +cmp -s $testdir/file1 $testdir/file2 || echo "Files 1-2 do not match" +cmp -s $testdir/file1 $testdir/file3 || echo "Files 1-3 do not match" +cmp -s $testdir/file2 $testdir/file3 || echo "Files 2-3 do not match" echo "mmap CoW the second file" -_mwrite_byte 0x62 0 17 $((blksz * 48 - 3)) "$testdir/file2" >> "$seqres.full" -_mwrite_byte 0x62 0 17 $((blksz * 48 - 3)) "$testdir/file3" >> "$seqres.full" +_mwrite_byte 0x62 0 17 $((blksz * 48 - 3)) $testdir/file2 >> $seqres.full +_mwrite_byte 0x62 0 17 $((blksz * 48 - 3)) $testdir/file3 >> $seqres.full -_mwrite_byte 0x62 $((blksz * 16 - 34)) 17 $((blksz * 48 - 3)) "$testdir/file2" >> "$seqres.full" -_mwrite_byte 0x62 $((blksz * 16 - 34)) 17 $((blksz * 48 - 3)) "$testdir/file3" >> "$seqres.full" +_mwrite_byte 0x62 $((blksz * 16 - 34)) 17 $((blksz * 48 - 3)) $testdir/file2 >> $seqres.full +_mwrite_byte 0x62 $((blksz * 16 - 34)) 17 $((blksz * 48 - 3)) $testdir/file3 >> $seqres.full -_mwrite_byte 0x62 $((blksz * 48 - 20)) 17 $((blksz * 48 - 3)) "$testdir/file2" >> "$seqres.full" -_mwrite_byte 0x62 $((blksz * 48 - 20)) 17 $((blksz * 48 - 3)) "$testdir/file3" >> "$seqres.full" +_mwrite_byte 0x62 $((blksz * 48 - 20)) 17 $((blksz * 48 - 3)) $testdir/file2 >> $seqres.full +_mwrite_byte 0x62 $((blksz * 48 - 20)) 17 $((blksz * 48 - 3)) $testdir/file3 >> $seqres.full _test_remount echo "Compare files" -md5sum "$testdir/file1" | _filter_test_dir -md5sum "$testdir/file2" | _filter_test_dir -md5sum "$testdir/file3" | _filter_test_dir +md5sum $testdir/file1 | _filter_test_dir +md5sum $testdir/file2 | _filter_test_dir +md5sum $testdir/file3 | _filter_test_dir -cmp -s "$testdir/file1" "$testdir/file2" || echo "Files 1-2 do not match (intentional)" -cmp -s "$testdir/file1" "$testdir/file3" || echo "Files 1-3 do not match (intentional)" -cmp -s "$testdir/file2" "$testdir/file3" || echo "Files 2-3 do not match" +cmp -s $testdir/file1 $testdir/file2 || echo "Files 1-2 do not match (intentional)" +cmp -s $testdir/file1 $testdir/file3 || echo "Files 1-3 do not match (intentional)" +cmp -s $testdir/file2 $testdir/file3 || echo "Files 2-3 do not match" echo "Compare the CoW'd section to the before file" -_compare_range "$testdir/file1" 0 "$testdir/file2" 0 17 \ +_compare_range $testdir/file1 0 $testdir/file2 0 17 \ || echo "Start sections do not match (intentional)" -_compare_range "$testdir/file1" $((blksz * 16 - 34)) \ - "$testdir/file2" $((blksz * 16 - 34)) 17 \ +_compare_range $testdir/file1 $((blksz * 16 - 34)) \ + $testdir/file2 $((blksz * 16 - 34)) 17 \ || echo "Middle sections do not match (intentional)" -_compare_range "$testdir/file1" $((blksz * 48 - 20)) \ - "$testdir/file2" $((blksz * 48 - 20)) 17 \ +_compare_range $testdir/file1 $((blksz * 48 - 20)) \ + $testdir/file2 $((blksz * 48 - 20)) 17 \ || echo "End sections do not match (intentional)" echo "Compare the CoW'd section to the after file" -_compare_range "$testdir/file2" 0 "$testdir/file3" 0 17 \ +_compare_range $testdir/file2 0 $testdir/file3 0 17 \ || echo "Start sections do not match" -_compare_range "$testdir/file2" $((blksz * 16 - 34)) \ - "$testdir/file3" $((blksz * 16 - 34)) 17 \ +_compare_range $testdir/file2 $((blksz * 16 - 34)) \ + $testdir/file3 $((blksz * 16 - 34)) 17 \ || echo "Middle sections do not match" -_compare_range "$testdir/file2" $((blksz * 48 - 20)) \ - "$testdir/file3" $((blksz * 48 - 20)) 17 \ +_compare_range $testdir/file2 $((blksz * 48 - 20)) \ + $testdir/file3 $((blksz * 48 - 20)) 17 \ || echo "End sections do not match" echo "Compare the not CoW'd sections" -_compare_range "$testdir/file1" 18 "$testdir/file2" 18 17 \ +_compare_range $testdir/file1 18 $testdir/file2 18 17 \ || echo "Start sections of 1-2 do not match" -_compare_range "$testdir/file2" 18 "$testdir/file3" 18 17 \ +_compare_range $testdir/file2 18 $testdir/file3 18 17 \ || echo "Start sections of 2-3 do not match" -_compare_range "$testdir/file1" $((blksz * 16 - 17)) \ - "$testdir/file2" $((blksz * 16 - 17)) 82 \ +_compare_range $testdir/file1 $((blksz * 16 - 17)) \ + $testdir/file2 $((blksz * 16 - 17)) 82 \ || echo "Middle sections of 1-2 do not match" -_compare_range "$testdir/file2" $((blksz * 16 - 17)) \ - "$testdir/file3" $((blksz * 16 - 17)) 82 \ +_compare_range $testdir/file2 $((blksz * 16 - 17)) \ + $testdir/file3 $((blksz * 16 - 17)) 82 \ || echo "Middle sections of 2-3 do not match" -_compare_range "$testdir/file1" $((blksz * 48 - 120)) \ - "$testdir/file2" $((blksz * 48 - 120)) 100 \ +_compare_range $testdir/file1 $((blksz * 48 - 120)) \ + $testdir/file2 $((blksz * 48 - 120)) 100 \ || echo "End sections of 1-2 do not match" -_compare_range "$testdir/file2" $((blksz * 48 - 120)) \ - "$testdir/file3" $((blksz * 48 - 120)) 100 \ +_compare_range $testdir/file2 $((blksz * 48 - 120)) \ + $testdir/file3 $((blksz * 48 - 120)) 100 \ || echo "End sections of 2-3 do not match" -_compare_range "$testdir/file1" $((blksz * 14)) \ - "$testdir/file2" $((blksz * 14)) $blksz \ +_compare_range $testdir/file1 $((blksz * 14)) \ + $testdir/file2 $((blksz * 14)) $blksz \ || echo "Untouched sections of 1-2 do not match" -_compare_range "$testdir/file2" $((blksz * 14)) \ - "$testdir/file3" $((blksz * 14)) $blksz \ +_compare_range $testdir/file2 $((blksz * 14)) \ + $testdir/file3 $((blksz * 14)) $blksz \ || echo "Untouched sections of 2-3 do not match" # success, all done diff --git a/tests/generic/142 b/tests/generic/142 index 2ac4d10..e9a2d5e 100755 --- a/tests/generic/142 +++ b/tests/generic/142 @@ -25,8 +25,8 @@ # Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA #----------------------------------------------------------------------- -seq=`basename "$0"` -seqres="$RESULT_DIR/$seq" +seq=`basename $0` +seqres=$RESULT_DIR/$seq echo "QA output created by $seq" here=`pwd` @@ -37,7 +37,7 @@ trap "_cleanup; exit \$status" 0 1 2 3 15 _cleanup() { cd / - rm -rf "$tmp".* "$testdir" + rm -rf $tmp.* $testdir } # get standard environment, filters and checks @@ -50,41 +50,42 @@ _supported_os Linux _require_test_reflink _require_cp_reflink -rm -f "$seqres.full" +rm -f $seqres.full -testdir="$TEST_DIR/test-$seq" -rm -rf "$testdir" -mkdir "$testdir" +testdir=$TEST_DIR/test-$seq +rm -rf $testdir +mkdir $testdir echo "Create the original file blocks" blksz=65536 nr=9 -_pwrite_byte 0x61 0 $((blksz * 256)) "$testdir/file1" >> "$seqres.full" +filesize=$((blksz * nr)) +_pwrite_byte 0x61 0 $((blksz * 256)) $testdir/file1 >> $seqres.full _test_remount -md5sum "$testdir/file1" | _filter_test_dir -csum="$(_md5_checksum "$testdir/file1")" +md5sum $testdir/file1 | _filter_test_dir +csum=$(_md5_checksum $testdir/file1) echo "Create the reflink copies" seq 2 $nr | while read i; do - _cp_reflink "$testdir/file1" "$testdir/file$i" + _cp_reflink $testdir/file1 $testdir/file$i done _test_remount echo "Rewrite the copies" seq 2 $nr | while read i; do - _pwrite_byte 0x62 0 $((blksz * 256)) "$testdir/file$i" >> "$seqres.full" + _pwrite_byte 0x62 0 $((blksz * 256)) $testdir/file$i >> $seqres.full done _test_remount echo "Examine original file" -md5sum "$testdir/file1" | _filter_test_dir -md5sum "$testdir/file2" | _filter_test_dir +md5sum $testdir/file1 | _filter_test_dir +md5sum $testdir/file2 | _filter_test_dir -mod_csum="$(_md5_checksum "$testdir/file2")" -new_csum="$(_md5_checksum "$testdir/file1")" -test "${csum}" != "${mod_csum}" || echo "checksums do not match" -test "${csum}" = "${new_csum}" || echo "checksums do not match" +mod_csum=$(_md5_checksum $testdir/file2) +new_csum=$(_md5_checksum $testdir/file1) +test ${csum} != ${mod_csum} || echo "checksums do not match" +test ${csum} = ${new_csum} || echo "checksums do not match" # success, all done status=0 diff --git a/tests/generic/143 b/tests/generic/143 index c0bc672..586cf5c 100755 --- a/tests/generic/143 +++ b/tests/generic/143 @@ -25,8 +25,8 @@ # Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA #----------------------------------------------------------------------- -seq=`basename "$0"` -seqres="$RESULT_DIR/$seq" +seq=`basename $0` +seqres=$RESULT_DIR/$seq echo "QA output created by $seq" here=`pwd` @@ -37,7 +37,7 @@ trap "_cleanup; exit \$status" 0 1 2 3 15 _cleanup() { cd / - rm -rf "$tmp".* "$testdir" + rm -rf $tmp.* $testdir } # get standard environment, filters and checks @@ -50,41 +50,42 @@ _supported_os Linux _require_test_reflink _require_cp_reflink -rm -f "$seqres.full" +rm -f $seqres.full -testdir="$TEST_DIR/test-$seq" -rm -rf "$testdir" -mkdir "$testdir" +testdir=$TEST_DIR/test-$seq +rm -rf $testdir +mkdir $testdir echo "Create the original file blocks" blksz=65536 nr=9 -_pwrite_byte 0x61 0 $((blksz * 256)) "$testdir/file1" >> "$seqres.full" +filesize=$((blksz * nr)) +_pwrite_byte 0x61 0 $((blksz * 256)) $testdir/file1 >> $seqres.full _test_remount -md5sum "$testdir/file1" | _filter_test_dir -csum="$(_md5_checksum "$testdir/file1")" +md5sum $testdir/file1 | _filter_test_dir +csum=$(_md5_checksum $testdir/file1) echo "Create the reflink copies" seq 2 $nr | while read i; do - _cp_reflink "$testdir/file1" "$testdir/file$i" + _cp_reflink $testdir/file1 $testdir/file$i done _test_remount echo "Rewrite the copies" seq 2 $nr | while read i; do - _pwrite_byte 0x62 0 $((blksz * 256)) "$testdir/file$i" -d >> "$seqres.full" + _pwrite_byte 0x62 0 $((blksz * 256)) $testdir/file$i -d >> $seqres.full done _test_remount echo "Examine original file" -md5sum "$testdir/file1" | _filter_test_dir -md5sum "$testdir/file2" | _filter_test_dir +md5sum $testdir/file1 | _filter_test_dir +md5sum $testdir/file2 | _filter_test_dir -mod_csum="$(_md5_checksum "$testdir/file2")" -new_csum="$(_md5_checksum "$testdir/file1")" -test "${csum}" != "${mod_csum}" || echo "checksums do not match" -test "${csum}" = "${new_csum}" || echo "checksums do not match" +mod_csum=$(_md5_checksum $testdir/file2) +new_csum=$(_md5_checksum $testdir/file1) +test ${csum} != ${mod_csum} || echo "checksums do not match" +test ${csum} = ${new_csum} || echo "checksums do not match" # success, all done status=0 diff --git a/tests/generic/144 b/tests/generic/144 index 631fa33..71020ab 100755 --- a/tests/generic/144 +++ b/tests/generic/144 @@ -23,8 +23,8 @@ # Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA #----------------------------------------------------------------------- -seq=`basename "$0"` -seqres="$RESULT_DIR/$seq" +seq=`basename $0` +seqres=$RESULT_DIR/$seq echo "QA output created by $seq" here=`pwd` @@ -35,7 +35,7 @@ trap "_cleanup; exit \$status" 0 1 2 3 15 _cleanup() { cd / - rm -rf "$tmp".* "$testdir" + rm -rf $tmp.* $testdir } # get standard environment, filters and checks @@ -50,92 +50,92 @@ _require_cp_reflink _require_xfs_io_command "falloc" _require_xfs_io_command "truncate" -rm -f "$seqres.full" +rm -f $seqres.full -testdir="$TEST_DIR/test-$seq" -rm -rf "$testdir" -mkdir "$testdir" +testdir=$TEST_DIR/test-$seq +rm -rf $testdir +mkdir $testdir echo "Create the original files" blksz=65536 -_pwrite_byte 0x61 0 $((blksz * 5 + 37)) "$testdir/file1" >> "$seqres.full" +_pwrite_byte 0x61 0 $((blksz * 5 + 37)) $testdir/file1 >> $seqres.full -_reflink_range "$testdir/file1" $blksz "$testdir/file2" $blksz \ - $((blksz * 4 + 37)) >> "$seqres.full" +_reflink_range $testdir/file1 $blksz $testdir/file2 $blksz \ + $((blksz * 4 + 37)) >> $seqres.full -"$XFS_IO_PROG" -f -c "truncate $((blksz * 5 + 37))" "$testdir/file3" >> "$seqres.full" -_reflink_range "$testdir/file1" 0 "$testdir/file3" 0 $blksz >> "$seqres.full" +$XFS_IO_PROG -f -c "truncate $((blksz * 5 + 37))" $testdir/file3 >> $seqres.full +_reflink_range $testdir/file1 0 $testdir/file3 0 $blksz >> $seqres.full -"$XFS_IO_PROG" -f -c "truncate $((blksz * 5 + 37))" "$testdir/file4" >> "$seqres.full" -_reflink_range "$testdir/file1" $blksz "$testdir/file4" $blksz $blksz >> "$seqres.full" -_reflink_range "$testdir/file1" $((blksz * 3)) "$testdir/file4" $((blksz * 3)) \ - $blksz >> "$seqres.full" +$XFS_IO_PROG -f -c "truncate $((blksz * 5 + 37))" $testdir/file4 >> $seqres.full +_reflink_range $testdir/file1 $blksz $testdir/file4 $blksz $blksz >> $seqres.full +_reflink_range $testdir/file1 $((blksz * 3)) $testdir/file4 $((blksz * 3)) \ + $blksz >> $seqres.full -_cp_reflink "$testdir/file1" "$testdir/file5" +_cp_reflink $testdir/file1 $testdir/file5 _test_remount echo "Compare sections" -md5sum "$testdir/file1" | _filter_test_dir -md5sum "$testdir/file2" | _filter_test_dir -md5sum "$testdir/file3" | _filter_test_dir -md5sum "$testdir/file4" | _filter_test_dir -md5sum "$testdir/file5" | _filter_test_dir +md5sum $testdir/file1 | _filter_test_dir +md5sum $testdir/file2 | _filter_test_dir +md5sum $testdir/file3 | _filter_test_dir +md5sum $testdir/file4 | _filter_test_dir +md5sum $testdir/file5 | _filter_test_dir -_compare_range "$testdir/file1" $blksz "$testdir/file2" $blksz \ +_compare_range $testdir/file1 $blksz $testdir/file2 $blksz \ $((blksz * 4 + 37)) \ || echo "shared parts of files 1-2 changed" -_compare_range "$testdir/file1" 0 "$testdir/file3" 0 $blksz \ +_compare_range $testdir/file1 0 $testdir/file3 0 $blksz \ || echo "shared parts of files 1-3 changed" -_compare_range "$testdir/file1" $blksz "$testdir/file4" $blksz $blksz \ +_compare_range $testdir/file1 $blksz $testdir/file4 $blksz $blksz \ || echo "shared parts of files 1-4 changed" -_compare_range "$testdir/file1" 0 "$testdir/file5" 0 $((blksz * 5 + 37)) \ +_compare_range $testdir/file1 0 $testdir/file5 0 $((blksz * 5 + 37)) \ || echo "shared parts of files 1-5 changed" echo "Compare files" -c1="$(_md5_checksum "$testdir/file1")" -c2="$(_md5_checksum "$testdir/file2")" -c3="$(_md5_checksum "$testdir/file3")" -c4="$(_md5_checksum "$testdir/file4")" -c5="$(_md5_checksum "$testdir/file5")" - -test "${c1}" != "${c2}" || echo "file1 and file2 should not match" -test "${c1}" != "${c3}" || echo "file1 and file3 should not match" -test "${c1}" != "${c4}" || echo "file1 and file4 should not match" -test "${c1}" = "${c5}" || echo "file1 and file5 should match" -test "${c2}" != "${c3}" || echo "file2 and file3 should not match" -test "${c2}" != "${c4}" || echo "file2 and file4 should not match" -test "${c2}" != "${c5}" || echo "file2 and file5 should not match" -test "${c3}" != "${c4}" || echo "file3 and file4 should not match" -test "${c3}" != "${c5}" || echo "file3 and file5 should not match" -test "${c4}" != "${c5}" || echo "file4 and file5 should not match" +c1=$(_md5_checksum $testdir/file1) +c2=$(_md5_checksum $testdir/file2) +c3=$(_md5_checksum $testdir/file3) +c4=$(_md5_checksum $testdir/file4) +c5=$(_md5_checksum $testdir/file5) + +test ${c1} != ${c2} || echo "file1 and file2 should not match" +test ${c1} != ${c3} || echo "file1 and file3 should not match" +test ${c1} != ${c4} || echo "file1 and file4 should not match" +test ${c1} = ${c5} || echo "file1 and file5 should match" +test ${c2} != ${c3} || echo "file2 and file3 should not match" +test ${c2} != ${c4} || echo "file2 and file4 should not match" +test ${c2} != ${c5} || echo "file2 and file5 should not match" +test ${c3} != ${c4} || echo "file3 and file4 should not match" +test ${c3} != ${c5} || echo "file3 and file5 should not match" +test ${c4} != ${c5} || echo "file4 and file5 should not match" echo "falloc everything" -"$XFS_IO_PROG" -f -c "falloc 0 $((blksz * 5))" "$testdir/file2" >> "$seqres.full" -"$XFS_IO_PROG" -f -c "falloc 0 $((blksz * 5))" "$testdir/file3" >> "$seqres.full" -"$XFS_IO_PROG" -f -c "falloc 0 $((blksz * 5))" "$testdir/file4" >> "$seqres.full" +$XFS_IO_PROG -f -c "falloc 0 $((blksz * 5))" $testdir/file2 >> $seqres.full +$XFS_IO_PROG -f -c "falloc 0 $((blksz * 5))" $testdir/file3 >> $seqres.full +$XFS_IO_PROG -f -c "falloc 0 $((blksz * 5))" $testdir/file4 >> $seqres.full _test_remount echo "Compare files" -md5sum "$testdir/file1" | _filter_test_dir -md5sum "$testdir/file2" | _filter_test_dir -md5sum "$testdir/file3" | _filter_test_dir -md5sum "$testdir/file4" | _filter_test_dir -md5sum "$testdir/file5" | _filter_test_dir - -d1="$(_md5_checksum "$testdir/file1")" -d2="$(_md5_checksum "$testdir/file2")" -d3="$(_md5_checksum "$testdir/file3")" -d4="$(_md5_checksum "$testdir/file4")" -d5="$(_md5_checksum "$testdir/file5")" - -test "${c1}" = "${d1}" || echo "file1 should not change" -test "${c2}" = "${d2}" || echo "file2 should not change" -test "${c3}" = "${d3}" || echo "file3 should not change" -test "${c4}" = "${d4}" || echo "file4 should not change" -test "${c5}" = "${d5}" || echo "file2 should not change" +md5sum $testdir/file1 | _filter_test_dir +md5sum $testdir/file2 | _filter_test_dir +md5sum $testdir/file3 | _filter_test_dir +md5sum $testdir/file4 | _filter_test_dir +md5sum $testdir/file5 | _filter_test_dir + +d1=$(_md5_checksum $testdir/file1) +d2=$(_md5_checksum $testdir/file2) +d3=$(_md5_checksum $testdir/file3) +d4=$(_md5_checksum $testdir/file4) +d5=$(_md5_checksum $testdir/file5) + +test ${c1} = ${d1} || echo "file1 should not change" +test ${c2} = ${d2} || echo "file2 should not change" +test ${c3} = ${d3} || echo "file3 should not change" +test ${c4} = ${d4} || echo "file4 should not change" +test ${c5} = ${d5} || echo "file2 should not change" # success, all done status=0 diff --git a/tests/generic/145 b/tests/generic/145 index 2b8d74f..dac2b27 100755 --- a/tests/generic/145 +++ b/tests/generic/145 @@ -24,8 +24,8 @@ # Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA #----------------------------------------------------------------------- -seq=`basename "$0"` -seqres="$RESULT_DIR/$seq" +seq=`basename $0` +seqres=$RESULT_DIR/$seq echo "QA output created by $seq" here=`pwd` @@ -36,7 +36,7 @@ trap "_cleanup; exit \$status" 0 1 2 3 15 _cleanup() { cd / - rm -rf "$tmp".* "$testdir" + rm -rf $tmp.* $testdir } # get standard environment, filters and checks @@ -51,91 +51,91 @@ _require_cp_reflink _require_xfs_io_command "falloc" _require_xfs_io_command "fcollapse" -rm -f "$seqres.full" +rm -f $seqres.full -testdir="$TEST_DIR/test-$seq" -rm -rf "$testdir" -mkdir "$testdir" +testdir=$TEST_DIR/test-$seq +rm -rf $testdir +mkdir $testdir echo "Create the original files" blksz=65536 -_pwrite_byte 0x61 0 $blksz "$testdir/file1" >> "$seqres.full" -_pwrite_byte 0x62 $blksz $blksz "$testdir/file1" >> "$seqres.full" -_pwrite_byte 0x63 $((blksz * 2)) $blksz "$testdir/file1" >> "$seqres.full" - -_cp_reflink "$testdir/file1" "$testdir/file2" -_cp_reflink "$testdir/file1" "$testdir/file3" -_cp_reflink "$testdir/file1" "$testdir/file4" - -"$XFS_IO_PROG" -f -c "falloc 0 $((blksz * 4))" "$testdir/file1" -"$XFS_IO_PROG" -f -c "falloc 0 $((blksz * 4))" "$testdir/file2" -"$XFS_IO_PROG" -f -c "falloc 0 $((blksz * 4))" "$testdir/file3" -"$XFS_IO_PROG" -f -c "falloc 0 $((blksz * 4))" "$testdir/file4" - -_pwrite_byte 0x62 0 $blksz "$testdir/file2.chk" >> "$seqres.full" -_pwrite_byte 0x63 $blksz $blksz "$testdir/file2.chk" >> "$seqres.full" -_pwrite_byte 0x00 $((blksz * 2)) $blksz "$testdir/file2.chk" >> "$seqres.full" - -_pwrite_byte 0x61 0 $blksz "$testdir/file3.chk" >> "$seqres.full" -_pwrite_byte 0x63 $blksz $blksz "$testdir/file3.chk" >> "$seqres.full" -_pwrite_byte 0x00 $((blksz * 2)) $blksz "$testdir/file3.chk" >> "$seqres.full" - -_pwrite_byte 0x61 0 $blksz "$testdir/file4.chk" >> "$seqres.full" -_pwrite_byte 0x62 $blksz $blksz "$testdir/file4.chk" >> "$seqres.full" -_pwrite_byte 0x00 $((blksz * 2)) $blksz "$testdir/file4.chk" >> "$seqres.full" +_pwrite_byte 0x61 0 $blksz $testdir/file1 >> $seqres.full +_pwrite_byte 0x62 $blksz $blksz $testdir/file1 >> $seqres.full +_pwrite_byte 0x63 $((blksz * 2)) $blksz $testdir/file1 >> $seqres.full + +_cp_reflink $testdir/file1 $testdir/file2 +_cp_reflink $testdir/file1 $testdir/file3 +_cp_reflink $testdir/file1 $testdir/file4 + +$XFS_IO_PROG -f -c "falloc 0 $((blksz * 4))" $testdir/file1 +$XFS_IO_PROG -f -c "falloc 0 $((blksz * 4))" $testdir/file2 +$XFS_IO_PROG -f -c "falloc 0 $((blksz * 4))" $testdir/file3 +$XFS_IO_PROG -f -c "falloc 0 $((blksz * 4))" $testdir/file4 + +_pwrite_byte 0x62 0 $blksz $testdir/file2.chk >> $seqres.full +_pwrite_byte 0x63 $blksz $blksz $testdir/file2.chk >> $seqres.full +_pwrite_byte 0x00 $((blksz * 2)) $blksz $testdir/file2.chk >> $seqres.full + +_pwrite_byte 0x61 0 $blksz $testdir/file3.chk >> $seqres.full +_pwrite_byte 0x63 $blksz $blksz $testdir/file3.chk >> $seqres.full +_pwrite_byte 0x00 $((blksz * 2)) $blksz $testdir/file3.chk >> $seqres.full + +_pwrite_byte 0x61 0 $blksz $testdir/file4.chk >> $seqres.full +_pwrite_byte 0x62 $blksz $blksz $testdir/file4.chk >> $seqres.full +_pwrite_byte 0x00 $((blksz * 2)) $blksz $testdir/file4.chk >> $seqres.full _test_remount -md5sum "$testdir/file1" | _filter_test_dir -md5sum "$testdir/file2" | _filter_test_dir -md5sum "$testdir/file3" | _filter_test_dir -md5sum "$testdir/file4" | _filter_test_dir -md5sum "$testdir/file2.chk" | _filter_test_dir -md5sum "$testdir/file3.chk" | _filter_test_dir -md5sum "$testdir/file4.chk" | _filter_test_dir - -c1="$(_md5_checksum "$testdir/file1")" -c2="$(_md5_checksum "$testdir/file2")" -c3="$(_md5_checksum "$testdir/file3")" -c4="$(_md5_checksum "$testdir/file4")" - -test "${c1}" = "${c2}" || echo "file1 and file2 should match" -test "${c1}" = "${c3}" || echo "file1 and file3 should match" -test "${c1}" = "${c4}" || echo "file1 and file4 should match" -test "${c2}" = "${c3}" || echo "file2 and file3 should match" -test "${c2}" = "${c4}" || echo "file2 and file4 should match" -test "${c3}" = "${c4}" || echo "file3 and file4 should match" +md5sum $testdir/file1 | _filter_test_dir +md5sum $testdir/file2 | _filter_test_dir +md5sum $testdir/file3 | _filter_test_dir +md5sum $testdir/file4 | _filter_test_dir +md5sum $testdir/file2.chk | _filter_test_dir +md5sum $testdir/file3.chk | _filter_test_dir +md5sum $testdir/file4.chk | _filter_test_dir + +c1=$(_md5_checksum $testdir/file1) +c2=$(_md5_checksum $testdir/file2) +c3=$(_md5_checksum $testdir/file3) +c4=$(_md5_checksum $testdir/file4) + +test ${c1} = ${c2} || echo "file1 and file2 should match" +test ${c1} = ${c3} || echo "file1 and file3 should match" +test ${c1} = ${c4} || echo "file1 and file4 should match" +test ${c2} = ${c3} || echo "file2 and file3 should match" +test ${c2} = ${c4} || echo "file2 and file4 should match" +test ${c3} = ${c4} || echo "file3 and file4 should match" echo "fcollapse files" -"$XFS_IO_PROG" -f -c "fcollapse 0 $blksz" "$testdir/file2" -"$XFS_IO_PROG" -f -c "fcollapse $blksz $blksz" "$testdir/file3" -"$XFS_IO_PROG" -f -c "fcollapse $((blksz * 2)) $blksz" "$testdir/file4" +$XFS_IO_PROG -f -c "fcollapse 0 $blksz" $testdir/file2 +$XFS_IO_PROG -f -c "fcollapse $blksz $blksz" $testdir/file3 +$XFS_IO_PROG -f -c "fcollapse $((blksz * 2)) $blksz" $testdir/file4 _test_remount echo "Compare files" -md5sum "$testdir/file1" | _filter_test_dir -md5sum "$testdir/file2" | _filter_test_dir -md5sum "$testdir/file3" | _filter_test_dir -md5sum "$testdir/file4" | _filter_test_dir -md5sum "$testdir/file2.chk" | _filter_test_dir -md5sum "$testdir/file3.chk" | _filter_test_dir -md5sum "$testdir/file4.chk" | _filter_test_dir - -c1="$(_md5_checksum "$testdir/file1")" -c2="$(_md5_checksum "$testdir/file2")" -c3="$(_md5_checksum "$testdir/file3")" -c4="$(_md5_checksum "$testdir/file4")" - -test "${c1}" != "${c2}" || echo "file1 and file2 should not match" -test "${c1}" != "${c3}" || echo "file1 and file3 should not match" -test "${c1}" != "${c4}" || echo "file1 and file4 should not match" -test "${c2}" != "${c3}" || echo "file2 and file3 should not match" -test "${c2}" != "${c4}" || echo "file2 and file4 should not match" -test "${c3}" != "${c4}" || echo "file3 and file4 should not match" +md5sum $testdir/file1 | _filter_test_dir +md5sum $testdir/file2 | _filter_test_dir +md5sum $testdir/file3 | _filter_test_dir +md5sum $testdir/file4 | _filter_test_dir +md5sum $testdir/file2.chk | _filter_test_dir +md5sum $testdir/file3.chk | _filter_test_dir +md5sum $testdir/file4.chk | _filter_test_dir + +c1=$(_md5_checksum $testdir/file1) +c2=$(_md5_checksum $testdir/file2) +c3=$(_md5_checksum $testdir/file3) +c4=$(_md5_checksum $testdir/file4) + +test ${c1} != ${c2} || echo "file1 and file2 should not match" +test ${c1} != ${c3} || echo "file1 and file3 should not match" +test ${c1} != ${c4} || echo "file1 and file4 should not match" +test ${c2} != ${c3} || echo "file2 and file3 should not match" +test ${c2} != ${c4} || echo "file2 and file4 should not match" +test ${c3} != ${c4} || echo "file3 and file4 should not match" echo "Compare against check files" -cmp -s "$testdir/file2" "$testdir/file2.chk" || echo "file2 and file2.chk do not match" -cmp -s "$testdir/file3" "$testdir/file3.chk" || echo "file3 and file3.chk do not match" -cmp -s "$testdir/file4" "$testdir/file4.chk" || echo "file4 and file4.chk do not match" +cmp -s $testdir/file2 $testdir/file2.chk || echo "file2 and file2.chk do not match" +cmp -s $testdir/file3 $testdir/file3.chk || echo "file3 and file3.chk do not match" +cmp -s $testdir/file4 $testdir/file4.chk || echo "file4 and file4.chk do not match" # success, all done status=0 diff --git a/tests/generic/146 b/tests/generic/146 index 17dc306..98f0621 100755 --- a/tests/generic/146 +++ b/tests/generic/146 @@ -24,8 +24,8 @@ # Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA #----------------------------------------------------------------------- -seq=`basename "$0"` -seqres="$RESULT_DIR/$seq" +seq=`basename $0` +seqres=$RESULT_DIR/$seq echo "QA output created by $seq" here=`pwd` @@ -36,7 +36,7 @@ trap "_cleanup; exit \$status" 0 1 2 3 15 _cleanup() { cd / - rm -rf "$tmp".* "$testdir" + rm -rf $tmp.* $testdir } # get standard environment, filters and checks @@ -50,86 +50,86 @@ _require_test_reflink _require_cp_reflink _require_xfs_io_command "fpunch" -rm -f "$seqres.full" +rm -f $seqres.full -testdir="$TEST_DIR/test-$seq" -rm -rf "$testdir" -mkdir "$testdir" +testdir=$TEST_DIR/test-$seq +rm -rf $testdir +mkdir $testdir echo "Create the original files" blksz=65536 -_pwrite_byte 0x61 0 $blksz "$testdir/file1" >> "$seqres.full" -_pwrite_byte 0x62 $blksz $blksz "$testdir/file1" >> "$seqres.full" -_pwrite_byte 0x63 $((blksz * 2)) $blksz "$testdir/file1" >> "$seqres.full" +_pwrite_byte 0x61 0 $blksz $testdir/file1 >> $seqres.full +_pwrite_byte 0x62 $blksz $blksz $testdir/file1 >> $seqres.full +_pwrite_byte 0x63 $((blksz * 2)) $blksz $testdir/file1 >> $seqres.full -_cp_reflink "$testdir/file1" "$testdir/file2" -_cp_reflink "$testdir/file1" "$testdir/file3" -_cp_reflink "$testdir/file1" "$testdir/file4" +_cp_reflink $testdir/file1 $testdir/file2 +_cp_reflink $testdir/file1 $testdir/file3 +_cp_reflink $testdir/file1 $testdir/file4 -_pwrite_byte 0x00 0 $blksz "$testdir/file2.chk" >> "$seqres.full" -_pwrite_byte 0x62 $blksz $blksz "$testdir/file2.chk" >> "$seqres.full" -_pwrite_byte 0x63 $((blksz * 2)) $blksz "$testdir/file2.chk" >> "$seqres.full" +_pwrite_byte 0x00 0 $blksz $testdir/file2.chk >> $seqres.full +_pwrite_byte 0x62 $blksz $blksz $testdir/file2.chk >> $seqres.full +_pwrite_byte 0x63 $((blksz * 2)) $blksz $testdir/file2.chk >> $seqres.full -_pwrite_byte 0x61 0 $blksz "$testdir/file3.chk" >> "$seqres.full" -_pwrite_byte 0x00 $blksz $blksz "$testdir/file3.chk" >> "$seqres.full" -_pwrite_byte 0x63 $((blksz * 2)) $blksz "$testdir/file3.chk" >> "$seqres.full" +_pwrite_byte 0x61 0 $blksz $testdir/file3.chk >> $seqres.full +_pwrite_byte 0x00 $blksz $blksz $testdir/file3.chk >> $seqres.full +_pwrite_byte 0x63 $((blksz * 2)) $blksz $testdir/file3.chk >> $seqres.full -_pwrite_byte 0x61 0 $blksz "$testdir/file4.chk" >> "$seqres.full" -_pwrite_byte 0x62 $blksz $blksz "$testdir/file4.chk" >> "$seqres.full" -_pwrite_byte 0x00 $((blksz * 2)) $blksz "$testdir/file4.chk" >> "$seqres.full" +_pwrite_byte 0x61 0 $blksz $testdir/file4.chk >> $seqres.full +_pwrite_byte 0x62 $blksz $blksz $testdir/file4.chk >> $seqres.full +_pwrite_byte 0x00 $((blksz * 2)) $blksz $testdir/file4.chk >> $seqres.full _test_remount -md5sum "$testdir/file1" | _filter_test_dir -md5sum "$testdir/file2" | _filter_test_dir -md5sum "$testdir/file3" | _filter_test_dir -md5sum "$testdir/file4" | _filter_test_dir -md5sum "$testdir/file2.chk" | _filter_test_dir -md5sum "$testdir/file3.chk" | _filter_test_dir -md5sum "$testdir/file4.chk" | _filter_test_dir - -c1="$(_md5_checksum "$testdir/file1")" -c2="$(_md5_checksum "$testdir/file2")" -c3="$(_md5_checksum "$testdir/file3")" -c4="$(_md5_checksum "$testdir/file4")" - -test "${c1}" = "${c2}" || echo "file1 and file2 should match" -test "${c1}" = "${c3}" || echo "file1 and file3 should match" -test "${c1}" = "${c4}" || echo "file1 and file4 should match" -test "${c2}" = "${c3}" || echo "file2 and file3 should match" -test "${c2}" = "${c4}" || echo "file2 and file4 should match" -test "${c3}" = "${c4}" || echo "file3 and file4 should match" +md5sum $testdir/file1 | _filter_test_dir +md5sum $testdir/file2 | _filter_test_dir +md5sum $testdir/file3 | _filter_test_dir +md5sum $testdir/file4 | _filter_test_dir +md5sum $testdir/file2.chk | _filter_test_dir +md5sum $testdir/file3.chk | _filter_test_dir +md5sum $testdir/file4.chk | _filter_test_dir + +c1=$(_md5_checksum $testdir/file1) +c2=$(_md5_checksum $testdir/file2) +c3=$(_md5_checksum $testdir/file3) +c4=$(_md5_checksum $testdir/file4) + +test ${c1} = ${c2} || echo "file1 and file2 should match" +test ${c1} = ${c3} || echo "file1 and file3 should match" +test ${c1} = ${c4} || echo "file1 and file4 should match" +test ${c2} = ${c3} || echo "file2 and file3 should match" +test ${c2} = ${c4} || echo "file2 and file4 should match" +test ${c3} = ${c4} || echo "file3 and file4 should match" echo "fpunch files" -"$XFS_IO_PROG" -f -c "fpunch 0 $blksz" "$testdir/file2" -"$XFS_IO_PROG" -f -c "fpunch $blksz $blksz" "$testdir/file3" -"$XFS_IO_PROG" -f -c "fpunch $((blksz * 2)) $blksz" "$testdir/file4" +$XFS_IO_PROG -f -c "fpunch 0 $blksz" $testdir/file2 +$XFS_IO_PROG -f -c "fpunch $blksz $blksz" $testdir/file3 +$XFS_IO_PROG -f -c "fpunch $((blksz * 2)) $blksz" $testdir/file4 _test_remount echo "Compare files" -md5sum "$testdir/file1" | _filter_test_dir -md5sum "$testdir/file2" | _filter_test_dir -md5sum "$testdir/file3" | _filter_test_dir -md5sum "$testdir/file4" | _filter_test_dir -md5sum "$testdir/file2.chk" | _filter_test_dir -md5sum "$testdir/file3.chk" | _filter_test_dir -md5sum "$testdir/file4.chk" | _filter_test_dir - -c1="$(_md5_checksum "$testdir/file1")" -c2="$(_md5_checksum "$testdir/file2")" -c3="$(_md5_checksum "$testdir/file3")" -c4="$(_md5_checksum "$testdir/file4")" - -test "${c1}" != "${c2}" || echo "file1 and file2 should not match" -test "${c1}" != "${c3}" || echo "file1 and file3 should not match" -test "${c1}" != "${c4}" || echo "file1 and file4 should not match" -test "${c2}" != "${c3}" || echo "file2 and file3 should not match" -test "${c2}" != "${c4}" || echo "file2 and file4 should not match" -test "${c3}" != "${c4}" || echo "file3 and file4 should not match" +md5sum $testdir/file1 | _filter_test_dir +md5sum $testdir/file2 | _filter_test_dir +md5sum $testdir/file3 | _filter_test_dir +md5sum $testdir/file4 | _filter_test_dir +md5sum $testdir/file2.chk | _filter_test_dir +md5sum $testdir/file3.chk | _filter_test_dir +md5sum $testdir/file4.chk | _filter_test_dir + +c1=$(_md5_checksum $testdir/file1) +c2=$(_md5_checksum $testdir/file2) +c3=$(_md5_checksum $testdir/file3) +c4=$(_md5_checksum $testdir/file4) + +test ${c1} != ${c2} || echo "file1 and file2 should not match" +test ${c1} != ${c3} || echo "file1 and file3 should not match" +test ${c1} != ${c4} || echo "file1 and file4 should not match" +test ${c2} != ${c3} || echo "file2 and file3 should not match" +test ${c2} != ${c4} || echo "file2 and file4 should not match" +test ${c3} != ${c4} || echo "file3 and file4 should not match" echo "Compare against check files" -cmp -s "$testdir/file2" "$testdir/file2.chk" || echo "file2 and file2.chk do not match" -cmp -s "$testdir/file3" "$testdir/file3.chk" || echo "file3 and file3.chk do not match" -cmp -s "$testdir/file4" "$testdir/file4.chk" || echo "file4 and file4.chk do not match" +cmp -s $testdir/file2 $testdir/file2.chk || echo "file2 and file2.chk do not match" +cmp -s $testdir/file3 $testdir/file3.chk || echo "file3 and file3.chk do not match" +cmp -s $testdir/file4 $testdir/file4.chk || echo "file4 and file4.chk do not match" # success, all done status=0 diff --git a/tests/generic/147 b/tests/generic/147 index b160131..8706f83 100755 --- a/tests/generic/147 +++ b/tests/generic/147 @@ -24,8 +24,8 @@ # Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA #----------------------------------------------------------------------- -seq=`basename "$0"` -seqres="$RESULT_DIR/$seq" +seq=`basename $0` +seqres=$RESULT_DIR/$seq echo "QA output created by $seq" here=`pwd` @@ -36,7 +36,7 @@ trap "_cleanup; exit \$status" 0 1 2 3 15 _cleanup() { cd / - rm -rf "$tmp".* "$testdir" + rm -rf $tmp.* $testdir } # get standard environment, filters and checks @@ -50,89 +50,89 @@ _require_test_reflink _require_cp_reflink _require_xfs_io_command "finsert" -rm -f "$seqres.full" +rm -f $seqres.full -testdir="$TEST_DIR/test-$seq" -rm -rf "$testdir" -mkdir "$testdir" +testdir=$TEST_DIR/test-$seq +rm -rf $testdir +mkdir $testdir echo "Create the original files" blksz=65536 -_pwrite_byte 0x61 0 $blksz "$testdir/file1" >> "$seqres.full" -_pwrite_byte 0x62 $blksz $blksz "$testdir/file1" >> "$seqres.full" -_pwrite_byte 0x63 $((blksz * 2)) $blksz "$testdir/file1" >> "$seqres.full" - -_cp_reflink "$testdir/file1" "$testdir/file2" -_cp_reflink "$testdir/file1" "$testdir/file3" -_cp_reflink "$testdir/file1" "$testdir/file4" - -_pwrite_byte 0x00 0 $blksz "$testdir/file2.chk" >> "$seqres.full" -_pwrite_byte 0x61 $blksz $blksz "$testdir/file2.chk" >> "$seqres.full" -_pwrite_byte 0x62 $((blksz * 2)) $blksz "$testdir/file2.chk" >> "$seqres.full" -_pwrite_byte 0x63 $((blksz * 3)) $blksz "$testdir/file2.chk" >> "$seqres.full" - -_pwrite_byte 0x61 0 $blksz "$testdir/file3.chk" >> "$seqres.full" -_pwrite_byte 0x00 $blksz $blksz "$testdir/file3.chk" >> "$seqres.full" -_pwrite_byte 0x62 $((blksz * 2)) $blksz "$testdir/file3.chk" >> "$seqres.full" -_pwrite_byte 0x63 $((blksz * 3)) $blksz "$testdir/file3.chk" >> "$seqres.full" - -_pwrite_byte 0x61 0 $blksz "$testdir/file4.chk" >> "$seqres.full" -_pwrite_byte 0x62 $blksz $blksz "$testdir/file4.chk" >> "$seqres.full" -_pwrite_byte 0x00 $((blksz * 2)) $blksz "$testdir/file4.chk" >> "$seqres.full" -_pwrite_byte 0x63 $((blksz * 3)) $blksz "$testdir/file4.chk" >> "$seqres.full" +_pwrite_byte 0x61 0 $blksz $testdir/file1 >> $seqres.full +_pwrite_byte 0x62 $blksz $blksz $testdir/file1 >> $seqres.full +_pwrite_byte 0x63 $((blksz * 2)) $blksz $testdir/file1 >> $seqres.full + +_cp_reflink $testdir/file1 $testdir/file2 +_cp_reflink $testdir/file1 $testdir/file3 +_cp_reflink $testdir/file1 $testdir/file4 + +_pwrite_byte 0x00 0 $blksz $testdir/file2.chk >> $seqres.full +_pwrite_byte 0x61 $blksz $blksz $testdir/file2.chk >> $seqres.full +_pwrite_byte 0x62 $((blksz * 2)) $blksz $testdir/file2.chk >> $seqres.full +_pwrite_byte 0x63 $((blksz * 3)) $blksz $testdir/file2.chk >> $seqres.full + +_pwrite_byte 0x61 0 $blksz $testdir/file3.chk >> $seqres.full +_pwrite_byte 0x00 $blksz $blksz $testdir/file3.chk >> $seqres.full +_pwrite_byte 0x62 $((blksz * 2)) $blksz $testdir/file3.chk >> $seqres.full +_pwrite_byte 0x63 $((blksz * 3)) $blksz $testdir/file3.chk >> $seqres.full + +_pwrite_byte 0x61 0 $blksz $testdir/file4.chk >> $seqres.full +_pwrite_byte 0x62 $blksz $blksz $testdir/file4.chk >> $seqres.full +_pwrite_byte 0x00 $((blksz * 2)) $blksz $testdir/file4.chk >> $seqres.full +_pwrite_byte 0x63 $((blksz * 3)) $blksz $testdir/file4.chk >> $seqres.full _test_remount -md5sum "$testdir/file1" | _filter_test_dir -md5sum "$testdir/file2" | _filter_test_dir -md5sum "$testdir/file3" | _filter_test_dir -md5sum "$testdir/file4" | _filter_test_dir -md5sum "$testdir/file2.chk" | _filter_test_dir -md5sum "$testdir/file3.chk" | _filter_test_dir -md5sum "$testdir/file4.chk" | _filter_test_dir - -c1="$(_md5_checksum "$testdir/file1")" -c2="$(_md5_checksum "$testdir/file2")" -c3="$(_md5_checksum "$testdir/file3")" -c4="$(_md5_checksum "$testdir/file4")" - -test "${c1}" = "${c2}" || echo "file1 and file2 should match" -test "${c1}" = "${c3}" || echo "file1 and file3 should match" -test "${c1}" = "${c4}" || echo "file1 and file4 should match" -test "${c2}" = "${c3}" || echo "file2 and file3 should match" -test "${c2}" = "${c4}" || echo "file2 and file4 should match" -test "${c3}" = "${c4}" || echo "file3 and file4 should match" +md5sum $testdir/file1 | _filter_test_dir +md5sum $testdir/file2 | _filter_test_dir +md5sum $testdir/file3 | _filter_test_dir +md5sum $testdir/file4 | _filter_test_dir +md5sum $testdir/file2.chk | _filter_test_dir +md5sum $testdir/file3.chk | _filter_test_dir +md5sum $testdir/file4.chk | _filter_test_dir + +c1=$(_md5_checksum $testdir/file1) +c2=$(_md5_checksum $testdir/file2) +c3=$(_md5_checksum $testdir/file3) +c4=$(_md5_checksum $testdir/file4) + +test ${c1} = ${c2} || echo "file1 and file2 should match" +test ${c1} = ${c3} || echo "file1 and file3 should match" +test ${c1} = ${c4} || echo "file1 and file4 should match" +test ${c2} = ${c3} || echo "file2 and file3 should match" +test ${c2} = ${c4} || echo "file2 and file4 should match" +test ${c3} = ${c4} || echo "file3 and file4 should match" echo "finsert files" -"$XFS_IO_PROG" -f -c "finsert 0 $blksz" "$testdir/file2" -"$XFS_IO_PROG" -f -c "finsert $blksz $blksz" "$testdir/file3" -"$XFS_IO_PROG" -f -c "finsert $((blksz * 2)) $blksz" "$testdir/file4" +$XFS_IO_PROG -f -c "finsert 0 $blksz" $testdir/file2 +$XFS_IO_PROG -f -c "finsert $blksz $blksz" $testdir/file3 +$XFS_IO_PROG -f -c "finsert $((blksz * 2)) $blksz" $testdir/file4 _test_remount echo "Compare files" -md5sum "$testdir/file1" | _filter_test_dir -md5sum "$testdir/file2" | _filter_test_dir -md5sum "$testdir/file3" | _filter_test_dir -md5sum "$testdir/file4" | _filter_test_dir -md5sum "$testdir/file2.chk" | _filter_test_dir -md5sum "$testdir/file3.chk" | _filter_test_dir -md5sum "$testdir/file4.chk" | _filter_test_dir - -c1="$(_md5_checksum "$testdir/file1")" -c2="$(_md5_checksum "$testdir/file2")" -c3="$(_md5_checksum "$testdir/file3")" -c4="$(_md5_checksum "$testdir/file4")" - -test "${c1}" != "${c2}" || echo "file1 and file2 should not match" -test "${c1}" != "${c3}" || echo "file1 and file3 should not match" -test "${c1}" != "${c4}" || echo "file1 and file4 should not match" -test "${c2}" != "${c3}" || echo "file2 and file3 should not match" -test "${c2}" != "${c4}" || echo "file2 and file4 should not match" -test "${c3}" != "${c4}" || echo "file3 and file4 should not match" +md5sum $testdir/file1 | _filter_test_dir +md5sum $testdir/file2 | _filter_test_dir +md5sum $testdir/file3 | _filter_test_dir +md5sum $testdir/file4 | _filter_test_dir +md5sum $testdir/file2.chk | _filter_test_dir +md5sum $testdir/file3.chk | _filter_test_dir +md5sum $testdir/file4.chk | _filter_test_dir + +c1=$(_md5_checksum $testdir/file1) +c2=$(_md5_checksum $testdir/file2) +c3=$(_md5_checksum $testdir/file3) +c4=$(_md5_checksum $testdir/file4) + +test ${c1} != ${c2} || echo "file1 and file2 should not match" +test ${c1} != ${c3} || echo "file1 and file3 should not match" +test ${c1} != ${c4} || echo "file1 and file4 should not match" +test ${c2} != ${c3} || echo "file2 and file3 should not match" +test ${c2} != ${c4} || echo "file2 and file4 should not match" +test ${c3} != ${c4} || echo "file3 and file4 should not match" echo "Compare against check files" -cmp -s "$testdir/file2" "$testdir/file2.chk" || echo "file2 and file2.chk do not match" -cmp -s "$testdir/file3" "$testdir/file3.chk" || echo "file3 and file3.chk do not match" -cmp -s "$testdir/file4" "$testdir/file4.chk" || echo "file4 and file4.chk do not match" +cmp -s $testdir/file2 $testdir/file2.chk || echo "file2 and file2.chk do not match" +cmp -s $testdir/file3 $testdir/file3.chk || echo "file3 and file3.chk do not match" +cmp -s $testdir/file4 $testdir/file4.chk || echo "file4 and file4.chk do not match" # success, all done status=0 diff --git a/tests/generic/148 b/tests/generic/148 index cf5567b..af60ab8 100755 --- a/tests/generic/148 +++ b/tests/generic/148 @@ -25,8 +25,8 @@ # Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA #----------------------------------------------------------------------- -seq=`basename "$0"` -seqres="$RESULT_DIR/$seq" +seq=`basename $0` +seqres=$RESULT_DIR/$seq echo "QA output created by $seq" here=`pwd` @@ -37,7 +37,7 @@ trap "_cleanup; exit \$status" 0 1 2 3 15 _cleanup() { cd / - rm -rf "$tmp".* "$testdir" + rm -rf $tmp.* $testdir } # get standard environment, filters and checks @@ -51,65 +51,65 @@ _require_test_reflink _require_cp_reflink _require_xfs_io_command "truncate" -rm -f "$seqres.full" +rm -f $seqres.full -testdir="$TEST_DIR/test-$seq" -rm -rf "$testdir" -mkdir "$testdir" +testdir=$TEST_DIR/test-$seq +rm -rf $testdir +mkdir $testdir echo "Create the original files" blksz=65536 -_pwrite_byte 0x61 0 $blksz "$testdir/file1" >> "$seqres.full" -_pwrite_byte 0x62 $blksz 37 "$testdir/file1" >> "$seqres.full" +_pwrite_byte 0x61 0 $blksz $testdir/file1 >> $seqres.full +_pwrite_byte 0x62 $blksz 37 $testdir/file1 >> $seqres.full -_cp_reflink "$testdir/file1" "$testdir/file2" -_cp_reflink "$testdir/file1" "$testdir/file3" +_cp_reflink $testdir/file1 $testdir/file2 +_cp_reflink $testdir/file1 $testdir/file3 -_pwrite_byte 0x61 0 $blksz "$testdir/file2.chk" >> "$seqres.full" -_pwrite_byte 0x62 $blksz 34 "$testdir/file2.chk" >> "$seqres.full" +_pwrite_byte 0x61 0 $blksz $testdir/file2.chk >> $seqres.full +_pwrite_byte 0x62 $blksz 34 $testdir/file2.chk >> $seqres.full -_pwrite_byte 0x61 0 $blksz "$testdir/file3.chk" >> "$seqres.full" -_pwrite_byte 0x62 $blksz 37 "$testdir/file3.chk" >> "$seqres.full" -_pwrite_byte 0x00 $((blksz + 37)) 3 "$testdir/file3.chk" >> "$seqres.full" +_pwrite_byte 0x61 0 $blksz $testdir/file3.chk >> $seqres.full +_pwrite_byte 0x62 $blksz 37 $testdir/file3.chk >> $seqres.full +_pwrite_byte 0x00 $((blksz + 37)) 3 $testdir/file3.chk >> $seqres.full _test_remount -md5sum "$testdir/file1" | _filter_test_dir -md5sum "$testdir/file2" | _filter_test_dir -md5sum "$testdir/file3" | _filter_test_dir -md5sum "$testdir/file2.chk" | _filter_test_dir -md5sum "$testdir/file3.chk" | _filter_test_dir +md5sum $testdir/file1 | _filter_test_dir +md5sum $testdir/file2 | _filter_test_dir +md5sum $testdir/file3 | _filter_test_dir +md5sum $testdir/file2.chk | _filter_test_dir +md5sum $testdir/file3.chk | _filter_test_dir -c1="$(_md5_checksum "$testdir/file1")" -c2="$(_md5_checksum "$testdir/file2")" -c3="$(_md5_checksum "$testdir/file3")" +c1=$(_md5_checksum $testdir/file1) +c2=$(_md5_checksum $testdir/file2) +c3=$(_md5_checksum $testdir/file3) -test "${c1}" = "${c2}" || echo "file1 and file2 should match" -test "${c1}" = "${c3}" || echo "file1 and file3 should match" -test "${c2}" = "${c3}" || echo "file2 and file3 should match" +test ${c1} = ${c2} || echo "file1 and file2 should match" +test ${c1} = ${c3} || echo "file1 and file3 should match" +test ${c2} = ${c3} || echo "file2 and file3 should match" echo "truncate files" -"$XFS_IO_PROG" -f -c "truncate $((blksz + 34))" "$testdir/file2" -"$XFS_IO_PROG" -f -c "truncate $((blksz + 40))" "$testdir/file3" +$XFS_IO_PROG -f -c "truncate $((blksz + 34))" $testdir/file2 +$XFS_IO_PROG -f -c "truncate $((blksz + 40))" $testdir/file3 _test_remount echo "Compare files" -md5sum "$testdir/file1" | _filter_test_dir -md5sum "$testdir/file2" | _filter_test_dir -md5sum "$testdir/file3" | _filter_test_dir -md5sum "$testdir/file2.chk" | _filter_test_dir -md5sum "$testdir/file3.chk" | _filter_test_dir +md5sum $testdir/file1 | _filter_test_dir +md5sum $testdir/file2 | _filter_test_dir +md5sum $testdir/file3 | _filter_test_dir +md5sum $testdir/file2.chk | _filter_test_dir +md5sum $testdir/file3.chk | _filter_test_dir -c1="$(_md5_checksum "$testdir/file1")" -c2="$(_md5_checksum "$testdir/file2")" -c3="$(_md5_checksum "$testdir/file3")" +c1=$(_md5_checksum $testdir/file1) +c2=$(_md5_checksum $testdir/file2) +c3=$(_md5_checksum $testdir/file3) -test "${c1}" != "${c2}" || echo "file1 and file2 should not match" -test "${c1}" != "${c3}" || echo "file1 and file3 should not match" -test "${c2}" != "${c3}" || echo "file2 and file3 should not match" +test ${c1} != ${c2} || echo "file1 and file2 should not match" +test ${c1} != ${c3} || echo "file1 and file3 should not match" +test ${c2} != ${c3} || echo "file2 and file3 should not match" echo "Compare against check files" -cmp -s "$testdir/file2" "$testdir/file2.chk" || echo "file2 and file2.chk do not match" -cmp -s "$testdir/file3" "$testdir/file3.chk" || echo "file3 and file3.chk do not match" +cmp -s $testdir/file2 $testdir/file2.chk || echo "file2 and file2.chk do not match" +cmp -s $testdir/file3 $testdir/file3.chk || echo "file3 and file3.chk do not match" # success, all done status=0 diff --git a/tests/generic/149 b/tests/generic/149 index 7d3189e..b5f9f4a 100755 --- a/tests/generic/149 +++ b/tests/generic/149 @@ -24,8 +24,8 @@ # Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA #----------------------------------------------------------------------- -seq=`basename "$0"` -seqres="$RESULT_DIR/$seq" +seq=`basename $0` +seqres=$RESULT_DIR/$seq echo "QA output created by $seq" here=`pwd` @@ -36,7 +36,7 @@ trap "_cleanup; exit \$status" 0 1 2 3 15 _cleanup() { cd / - rm -rf "$tmp".* "$testdir" + rm -rf $tmp.* $testdir } # get standard environment, filters and checks @@ -50,86 +50,86 @@ _require_test_reflink _require_cp_reflink _require_xfs_io_command "fzero" -rm -f "$seqres.full" +rm -f $seqres.full -testdir="$TEST_DIR/test-$seq" -rm -rf "$testdir" -mkdir "$testdir" +testdir=$TEST_DIR/test-$seq +rm -rf $testdir +mkdir $testdir echo "Create the original files" blksz=65536 -_pwrite_byte 0x61 0 $blksz "$testdir/file1" >> "$seqres.full" -_pwrite_byte 0x62 $blksz $blksz "$testdir/file1" >> "$seqres.full" -_pwrite_byte 0x63 $((blksz * 2)) $blksz "$testdir/file1" >> "$seqres.full" +_pwrite_byte 0x61 0 $blksz $testdir/file1 >> $seqres.full +_pwrite_byte 0x62 $blksz $blksz $testdir/file1 >> $seqres.full +_pwrite_byte 0x63 $((blksz * 2)) $blksz $testdir/file1 >> $seqres.full -_cp_reflink "$testdir/file1" "$testdir/file2" -_cp_reflink "$testdir/file1" "$testdir/file3" -_cp_reflink "$testdir/file1" "$testdir/file4" +_cp_reflink $testdir/file1 $testdir/file2 +_cp_reflink $testdir/file1 $testdir/file3 +_cp_reflink $testdir/file1 $testdir/file4 -_pwrite_byte 0x00 0 $blksz "$testdir/file2.chk" >> "$seqres.full" -_pwrite_byte 0x62 $blksz $blksz "$testdir/file2.chk" >> "$seqres.full" -_pwrite_byte 0x63 $((blksz * 2)) $blksz "$testdir/file2.chk" >> "$seqres.full" +_pwrite_byte 0x00 0 $blksz $testdir/file2.chk >> $seqres.full +_pwrite_byte 0x62 $blksz $blksz $testdir/file2.chk >> $seqres.full +_pwrite_byte 0x63 $((blksz * 2)) $blksz $testdir/file2.chk >> $seqres.full -_pwrite_byte 0x61 0 $blksz "$testdir/file3.chk" >> "$seqres.full" -_pwrite_byte 0x00 $blksz $blksz "$testdir/file3.chk" >> "$seqres.full" -_pwrite_byte 0x63 $((blksz * 2)) $blksz "$testdir/file3.chk" >> "$seqres.full" +_pwrite_byte 0x61 0 $blksz $testdir/file3.chk >> $seqres.full +_pwrite_byte 0x00 $blksz $blksz $testdir/file3.chk >> $seqres.full +_pwrite_byte 0x63 $((blksz * 2)) $blksz $testdir/file3.chk >> $seqres.full -_pwrite_byte 0x61 0 $blksz "$testdir/file4.chk" >> "$seqres.full" -_pwrite_byte 0x62 $blksz $blksz "$testdir/file4.chk" >> "$seqres.full" -_pwrite_byte 0x00 $((blksz * 2)) $blksz "$testdir/file4.chk" >> "$seqres.full" +_pwrite_byte 0x61 0 $blksz $testdir/file4.chk >> $seqres.full +_pwrite_byte 0x62 $blksz $blksz $testdir/file4.chk >> $seqres.full +_pwrite_byte 0x00 $((blksz * 2)) $blksz $testdir/file4.chk >> $seqres.full _test_remount -md5sum "$testdir/file1" | _filter_test_dir -md5sum "$testdir/file2" | _filter_test_dir -md5sum "$testdir/file3" | _filter_test_dir -md5sum "$testdir/file4" | _filter_test_dir -md5sum "$testdir/file2.chk" | _filter_test_dir -md5sum "$testdir/file3.chk" | _filter_test_dir -md5sum "$testdir/file4.chk" | _filter_test_dir - -c1="$(_md5_checksum "$testdir/file1")" -c2="$(_md5_checksum "$testdir/file2")" -c3="$(_md5_checksum "$testdir/file3")" -c4="$(_md5_checksum "$testdir/file4")" - -test "${c1}" = "${c2}" || echo "file1 and file2 should match" -test "${c1}" = "${c3}" || echo "file1 and file3 should match" -test "${c1}" = "${c4}" || echo "file1 and file4 should match" -test "${c2}" = "${c3}" || echo "file2 and file3 should match" -test "${c2}" = "${c4}" || echo "file2 and file4 should match" -test "${c3}" = "${c4}" || echo "file3 and file4 should match" +md5sum $testdir/file1 | _filter_test_dir +md5sum $testdir/file2 | _filter_test_dir +md5sum $testdir/file3 | _filter_test_dir +md5sum $testdir/file4 | _filter_test_dir +md5sum $testdir/file2.chk | _filter_test_dir +md5sum $testdir/file3.chk | _filter_test_dir +md5sum $testdir/file4.chk | _filter_test_dir + +c1=$(_md5_checksum $testdir/file1) +c2=$(_md5_checksum $testdir/file2) +c3=$(_md5_checksum $testdir/file3) +c4=$(_md5_checksum $testdir/file4) + +test ${c1} = ${c2} || echo "file1 and file2 should match" +test ${c1} = ${c3} || echo "file1 and file3 should match" +test ${c1} = ${c4} || echo "file1 and file4 should match" +test ${c2} = ${c3} || echo "file2 and file3 should match" +test ${c2} = ${c4} || echo "file2 and file4 should match" +test ${c3} = ${c4} || echo "file3 and file4 should match" echo "fzero files" -"$XFS_IO_PROG" -f -c "fzero 0 $blksz" "$testdir/file2" -"$XFS_IO_PROG" -f -c "fzero $blksz $blksz" "$testdir/file3" -"$XFS_IO_PROG" -f -c "fzero $((blksz * 2)) $blksz" "$testdir/file4" +$XFS_IO_PROG -f -c "fzero 0 $blksz" $testdir/file2 +$XFS_IO_PROG -f -c "fzero $blksz $blksz" $testdir/file3 +$XFS_IO_PROG -f -c "fzero $((blksz * 2)) $blksz" $testdir/file4 _test_remount echo "Compare files" -md5sum "$testdir/file1" | _filter_test_dir -md5sum "$testdir/file2" | _filter_test_dir -md5sum "$testdir/file3" | _filter_test_dir -md5sum "$testdir/file4" | _filter_test_dir -md5sum "$testdir/file2.chk" | _filter_test_dir -md5sum "$testdir/file3.chk" | _filter_test_dir -md5sum "$testdir/file4.chk" | _filter_test_dir - -c1="$(_md5_checksum "$testdir/file1")" -c2="$(_md5_checksum "$testdir/file2")" -c3="$(_md5_checksum "$testdir/file3")" -c4="$(_md5_checksum "$testdir/file4")" - -test "${c1}" != "${c2}" || echo "file1 and file2 should not match" -test "${c1}" != "${c3}" || echo "file1 and file3 should not match" -test "${c1}" != "${c4}" || echo "file1 and file4 should not match" -test "${c2}" != "${c3}" || echo "file2 and file3 should not match" -test "${c2}" != "${c4}" || echo "file2 and file4 should not match" -test "${c3}" != "${c4}" || echo "file3 and file4 should not match" +md5sum $testdir/file1 | _filter_test_dir +md5sum $testdir/file2 | _filter_test_dir +md5sum $testdir/file3 | _filter_test_dir +md5sum $testdir/file4 | _filter_test_dir +md5sum $testdir/file2.chk | _filter_test_dir +md5sum $testdir/file3.chk | _filter_test_dir +md5sum $testdir/file4.chk | _filter_test_dir + +c1=$(_md5_checksum $testdir/file1) +c2=$(_md5_checksum $testdir/file2) +c3=$(_md5_checksum $testdir/file3) +c4=$(_md5_checksum $testdir/file4) + +test ${c1} != ${c2} || echo "file1 and file2 should not match" +test ${c1} != ${c3} || echo "file1 and file3 should not match" +test ${c1} != ${c4} || echo "file1 and file4 should not match" +test ${c2} != ${c3} || echo "file2 and file3 should not match" +test ${c2} != ${c4} || echo "file2 and file4 should not match" +test ${c3} != ${c4} || echo "file3 and file4 should not match" echo "Compare against check files" -cmp -s "$testdir/file2" "$testdir/file2.chk" || echo "file2 and file2.chk do not match" -cmp -s "$testdir/file3" "$testdir/file3.chk" || echo "file3 and file3.chk do not match" -cmp -s "$testdir/file4" "$testdir/file4.chk" || echo "file4 and file4.chk do not match" +cmp -s $testdir/file2 $testdir/file2.chk || echo "file2 and file2.chk do not match" +cmp -s $testdir/file3 $testdir/file3.chk || echo "file3 and file3.chk do not match" +cmp -s $testdir/file4 $testdir/file4.chk || echo "file4 and file4.chk do not match" # success, all done status=0 diff --git a/tests/generic/150 b/tests/generic/150 index 90ac46b..88814b1 100755 --- a/tests/generic/150 +++ b/tests/generic/150 @@ -23,8 +23,8 @@ # Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA #----------------------------------------------------------------------- -seq=`basename "$0"` -seqres="$RESULT_DIR/$seq" +seq=`basename $0` +seqres=$RESULT_DIR/$seq echo "QA output created by $seq" here=`pwd` @@ -35,7 +35,7 @@ trap "_cleanup; exit \$status" 0 1 2 3 15 _cleanup() { cd / - rm -rf "$tmp".* "$testdir" + rm -rf $tmp.* $testdir } # get standard environment, filters and checks @@ -48,11 +48,11 @@ _supported_os Linux _require_test_reflink _require_cp_reflink -rm -f "$seqres.full" +rm -f $seqres.full -testdir="$TEST_DIR/test-$seq" -rm -rf "$testdir" -mkdir "$testdir" +testdir=$TEST_DIR/test-$seq +rm -rf $testdir +mkdir $testdir echo "Create the original file blocks" blksz="$(stat -f $testdir -c '%S')" @@ -60,16 +60,17 @@ blks=2000 margin='15%' sz=$((blksz * blks)) nr=7 -_pwrite_byte 0x61 0 $sz "$testdir/file1" >> "$seqres.full" +filesize=$((blksz * nr)) +_pwrite_byte 0x61 0 $sz $testdir/file1 >> $seqres.full sync -free_blocks0=$(stat -f "$testdir" -c '%f') +free_blocks0=$(stat -f $testdir -c '%f') echo "Create the reflink copies" for i in `seq 2 $nr`; do - _cp_reflink "$testdir/file1" "$testdir/file.$i" + _cp_reflink $testdir/file1 $testdir/file.$i done _test_remount -free_blocks1=$(stat -f "$testdir" -c '%f') +free_blocks1=$(stat -f $testdir -c '%f') _within_tolerance "free blocks after reflink" $free_blocks1 $free_blocks0 $margin -v diff --git a/tests/generic/151 b/tests/generic/151 index c67a12c..207378c 100755 --- a/tests/generic/151 +++ b/tests/generic/151 @@ -27,8 +27,8 @@ # Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA #----------------------------------------------------------------------- -seq=`basename "$0"` -seqres="$RESULT_DIR/$seq" +seq=`basename $0` +seqres=$RESULT_DIR/$seq echo "QA output created by $seq" here=`pwd` @@ -39,7 +39,7 @@ trap "_cleanup; exit \$status" 0 1 2 3 15 _cleanup() { cd / - rm -rf "$tmp".* "$testdir" + rm -rf $tmp.* $testdir } # get standard environment, filters and checks @@ -52,39 +52,40 @@ _supported_os Linux _require_test_reflink _require_cp_reflink -rm -f "$seqres.full" +rm -f $seqres.full -testdir="$TEST_DIR/test-$seq" -rm -rf "$testdir" -mkdir "$testdir" +testdir=$TEST_DIR/test-$seq +rm -rf $testdir +mkdir $testdir echo "Create the original file blocks" -blksz="$(stat -f "$testdir" -c '%S')" +blksz="$(stat -f $testdir -c '%S')" blks=2000 margin='15%' sz=$((blksz * blks)) -free_blocks0=$(stat -f "$testdir" -c '%f') +free_blocks0=$(stat -f $testdir -c '%f') nr=7 -_pwrite_byte 0x61 0 $sz "$testdir/file1" >> "$seqres.full" +filesize=$((blksz * nr)) +_pwrite_byte 0x61 0 $sz $testdir/file1 >> $seqres.full sync echo "Create the reflink copies" for i in `seq 2 $nr`; do - _cp_reflink "$testdir/file1" "$testdir/file.$i" + _cp_reflink $testdir/file1 $testdir/file.$i done -_cp_reflink "$testdir/file1" "$testdir/survivor" +_cp_reflink $testdir/file1 $testdir/survivor _test_remount -free_blocks1=$(stat -f "$testdir" -c '%f') +free_blocks1=$(stat -f $testdir -c '%f') echo "Delete most of the files" -rm -rf "$testdir"/file* +rm -rf $testdir/file* _test_remount -free_blocks2=$(stat -f "$testdir" -c '%f') +free_blocks2=$(stat -f $testdir -c '%f') echo "Delete all the files" -rm -rf "$testdir"/* +rm -rf $testdir/* _test_remount -free_blocks3=$(stat -f "$testdir" -c '%f') +free_blocks3=$(stat -f $testdir -c '%f') #echo $free_blocks0 $free_blocks1 $free_blocks2 $free_blocks3 _within_tolerance "free blocks after reflink" $free_blocks1 $((free_blocks0 - blks)) $margin -v diff --git a/tests/generic/152 b/tests/generic/152 index cdb2bf9..b221f8f 100755 --- a/tests/generic/152 +++ b/tests/generic/152 @@ -27,8 +27,8 @@ # Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA #----------------------------------------------------------------------- -seq=`basename "$0"` -seqres="$RESULT_DIR/$seq" +seq=`basename $0` +seqres=$RESULT_DIR/$seq echo "QA output created by $seq" here=`pwd` @@ -39,7 +39,7 @@ trap "_cleanup; exit \$status" 0 1 2 3 15 _cleanup() { cd / - rm -rf "$tmp".* "$testdir" + rm -rf $tmp.* $testdir } # get standard environment, filters and checks @@ -53,43 +53,44 @@ _require_test_reflink _require_cp_reflink _require_xfs_io_command "fpunch" -rm -f "$seqres.full" +rm -f $seqres.full -testdir="$TEST_DIR/test-$seq" -rm -rf "$testdir" -mkdir "$testdir" +testdir=$TEST_DIR/test-$seq +rm -rf $testdir +mkdir $testdir echo "Create the original file blocks" -blksz="$(stat -f "$testdir" -c '%S')" +blksz="$(stat -f $testdir -c '%S')" blks=2000 margin='15%' sz=$((blksz * blks)) -free_blocks0=$(stat -f "$testdir" -c '%f') +free_blocks0=$(stat -f $testdir -c '%f') nr=4 -_pwrite_byte 0x61 0 $sz "$testdir/file1" >> "$seqres.full" +filesize=$((blksz * nr)) +_pwrite_byte 0x61 0 $sz $testdir/file1 >> $seqres.full sync echo "Create the reflink copies" for i in `seq 2 $nr`; do - _cp_reflink "$testdir/file1" "$testdir/file$i" + _cp_reflink $testdir/file1 $testdir/file$i done _test_remount -free_blocks1=$(stat -f "$testdir" -c '%f') +free_blocks1=$(stat -f $testdir -c '%f') echo "Punch most of the blocks" -"$XFS_IO_PROG" -f -c "fpunch 0 $sz" "$testdir/file2" -"$XFS_IO_PROG" -f -c "fpunch 0 $((sz / 2))" "$testdir/file3" -"$XFS_IO_PROG" -f -c "fpunch $((sz / 2)) $((sz / 2))" "$testdir/file4" +$XFS_IO_PROG -f -c "fpunch 0 $sz" $testdir/file2 +$XFS_IO_PROG -f -c "fpunch 0 $((sz / 2))" $testdir/file3 +$XFS_IO_PROG -f -c "fpunch $((sz / 2)) $((sz / 2))" $testdir/file4 _test_remount -free_blocks2=$(stat -f "$testdir" -c '%f') +free_blocks2=$(stat -f $testdir -c '%f') echo "Punch all the files" for i in `seq 2 $nr`; do - "$XFS_IO_PROG" -f -c "fpunch 0 $sz" "$testdir/file$i" + $XFS_IO_PROG -f -c "fpunch 0 $sz" $testdir/file$i done -"$XFS_IO_PROG" -f -c "fpunch 0 $sz" "$testdir/file1" +$XFS_IO_PROG -f -c "fpunch 0 $sz" $testdir/file1 _test_remount -free_blocks3=$(stat -f "$testdir" -c '%f') +free_blocks3=$(stat -f $testdir -c '%f') #echo $free_blocks0 $free_blocks1 $free_blocks2 $free_blocks3 _within_tolerance "free blocks after reflink" $free_blocks1 $((free_blocks0 - blks)) $margin -v diff --git a/tests/generic/153 b/tests/generic/153 index b2f4022..550aa95 100755 --- a/tests/generic/153 +++ b/tests/generic/153 @@ -27,8 +27,8 @@ # Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA #----------------------------------------------------------------------- -seq=`basename "$0"` -seqres="$RESULT_DIR/$seq" +seq=`basename $0` +seqres=$RESULT_DIR/$seq echo "QA output created by $seq" here=`pwd` @@ -39,7 +39,7 @@ trap "_cleanup; exit \$status" 0 1 2 3 15 _cleanup() { cd / - rm -rf "$tmp".* "$testdir" + rm -rf $tmp.* $testdir } # get standard environment, filters and checks @@ -53,42 +53,43 @@ _require_test_reflink _require_cp_reflink _require_xfs_io_command "fcollapse" -rm -f "$seqres.full" +rm -f $seqres.full -testdir="$TEST_DIR/test-$seq" -rm -rf "$testdir" -mkdir "$testdir" +testdir=$TEST_DIR/test-$seq +rm -rf $testdir +mkdir $testdir echo "Create the original file blocks" -blksz="$(stat -f "$testdir" -c '%S')" +blksz="$(stat -f $testdir -c '%S')" blks=2000 margin='15%' sz=$((blksz * blks)) -free_blocks0=$(stat -f "$testdir" -c '%f') +free_blocks0=$(stat -f $testdir -c '%f') nr=4 -_pwrite_byte 0x61 0 $sz "$testdir/file1" >> "$seqres.full" +filesize=$((blksz * nr)) +_pwrite_byte 0x61 0 $sz $testdir/file1 >> $seqres.full _test_remount echo "Create the reflink copies" for i in `seq 2 $nr`; do - _cp_reflink "$testdir/file1" "$testdir/file$i" + _cp_reflink $testdir/file1 $testdir/file$i done _test_remount -free_blocks1=$(stat -f "$testdir" -c '%f') +free_blocks1=$(stat -f $testdir -c '%f') echo "Collapse most of the blocks" -"$XFS_IO_PROG" -f -c "fcollapse 0 $(((blks - 1) * blksz))" $testdir/file2 -"$XFS_IO_PROG" -f -c "fcollapse 0 $((sz / 2))" $testdir/file3 -"$XFS_IO_PROG" -f -c "fcollapse $((sz / 2)) $(( ((blks / 2) - 1) * blksz))" $testdir/file4 +$XFS_IO_PROG -f -c "fcollapse 0 $(((blks - 1) * blksz))" $testdir/file2 +$XFS_IO_PROG -f -c "fcollapse 0 $((sz / 2))" $testdir/file3 +$XFS_IO_PROG -f -c "fcollapse $((sz / 2)) $(( ((blks / 2) - 1) * blksz))" $testdir/file4 _test_remount -free_blocks2=$(stat -f "$testdir" -c '%f') +free_blocks2=$(stat -f $testdir -c '%f') echo "Collpase nearly all the files" -"$XFS_IO_PROG" -f -c "fcollapse 0 $(( ((blks / 2) - 1) * blksz))" $testdir/file3 -"$XFS_IO_PROG" -f -c "fcollapse 0 $((sz / 2))" $testdir/file4 -"$XFS_IO_PROG" -f -c "fcollapse 0 $(( (blks - 1) * blksz))" $testdir/file1 +$XFS_IO_PROG -f -c "fcollapse 0 $(( ((blks / 2) - 1) * blksz))" $testdir/file3 +$XFS_IO_PROG -f -c "fcollapse 0 $((sz / 2))" $testdir/file4 +$XFS_IO_PROG -f -c "fcollapse 0 $(( (blks - 1) * blksz))" $testdir/file1 _test_remount -free_blocks3=$(stat -f "$testdir" -c '%f') +free_blocks3=$(stat -f $testdir -c '%f') #echo $free_blocks0 $free_blocks1 $free_blocks2 $free_blocks3 _within_tolerance "free blocks after reflink" $free_blocks1 $((free_blocks0 - blks)) $margin -v diff --git a/tests/generic/154 b/tests/generic/154 index 579f78b..c0c3142 100755 --- a/tests/generic/154 +++ b/tests/generic/154 @@ -28,7 +28,7 @@ #----------------------------------------------------------------------- seq=`basename $0` -seqres="$RESULT_DIR/$seq" +seqres=$RESULT_DIR/$seq echo "QA output created by $seq" here=`pwd` @@ -39,7 +39,7 @@ trap "_cleanup; exit \$status" 0 1 2 3 15 _cleanup() { cd / - rm -rf "$tmp".* "$testdir" + rm -rf $tmp.* $testdir } # get standard environment, filters and checks @@ -52,47 +52,48 @@ _supported_os Linux _require_test_reflink _require_cp_reflink -rm -f "$seqres.full" +rm -f $seqres.full -testdir="$TEST_DIR/test-$seq" -rm -rf "$testdir" -mkdir "$testdir" +testdir=$TEST_DIR/test-$seq +rm -rf $testdir +mkdir $testdir echo "Create the original file blocks" -blksz="$(stat -f "$testdir" -c '%S')" +blksz="$(stat -f $testdir -c '%S')" blks=2000 margin='15%' -free_blocks0=$(stat -f "$testdir" -c '%f') +free_blocks0=$(stat -f $testdir -c '%f') nr=4 +filesize=$((blksz * nr)) sz=$((blks * blksz)) -_pwrite_byte 0x61 0 $sz "$testdir/file1" >> "$seqres.full" +_pwrite_byte 0x61 0 $sz $testdir/file1 >> $seqres.full _test_remount echo "Create the reflink copies" for i in `seq 2 $nr`; do - _cp_reflink "$testdir/file1" "$testdir/file$i" + _cp_reflink $testdir/file1 $testdir/file$i done _test_remount -free_blocks1=$(stat -f "$testdir" -c '%f') +free_blocks1=$(stat -f $testdir -c '%f') echo "Rewrite some of the blocks" -_pwrite_byte 0x62 0 $sz "$testdir/file2" >> "$seqres.full" -_pwrite_byte 0x63 0 $((sz / 2)) "$testdir/file3" >> "$seqres.full" -_pwrite_byte 0x64 $((sz / 2)) $((sz / 2)) "$testdir/file4" >> "$seqres.full" +_pwrite_byte 0x62 0 $sz $testdir/file2 >> $seqres.full +_pwrite_byte 0x63 0 $((sz / 2)) $testdir/file3 >> $seqres.full +_pwrite_byte 0x64 $((sz / 2)) $((sz / 2)) $testdir/file4 >> $seqres.full _test_remount -free_blocks2=$(stat -f "$testdir" -c '%f') +free_blocks2=$(stat -f $testdir -c '%f') echo "Rewrite all the files" -_pwrite_byte 0x62 0 $sz "$testdir/file2" >> "$seqres.full" -_pwrite_byte 0x63 0 $sz "$testdir/file3" >> "$seqres.full" -_pwrite_byte 0x64 0 $sz "$testdir/file4" >> "$seqres.full" +_pwrite_byte 0x62 0 $sz $testdir/file2 >> $seqres.full +_pwrite_byte 0x63 0 $sz $testdir/file3 >> $seqres.full +_pwrite_byte 0x64 0 $sz $testdir/file4 >> $seqres.full _test_remount -free_blocks3=$(stat -f "$testdir" -c '%f') +free_blocks3=$(stat -f $testdir -c '%f') echo "Rewrite the original file" -_pwrite_byte 0x65 0 $sz "$testdir/file1" >> "$seqres.full" +_pwrite_byte 0x65 0 $sz $testdir/file1 >> $seqres.full _test_remount -free_blocks4=$(stat -f "$testdir" -c '%f') +free_blocks4=$(stat -f $testdir -c '%f') #echo $free_blocks0 $free_blocks1 $free_blocks2 $free_blocks3 $free_blocks4 _within_tolerance "free blocks after reflinking" $free_blocks1 $((free_blocks0 - blks)) $margin -v diff --git a/tests/generic/155 b/tests/generic/155 index 56d2912..c6416a1 100755 --- a/tests/generic/155 +++ b/tests/generic/155 @@ -30,8 +30,8 @@ # Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA #----------------------------------------------------------------------- -seq=`basename "$0"` -seqres="$RESULT_DIR/$seq" +seq=`basename $0` +seqres=$RESULT_DIR/$seq echo "QA output created by $seq" here=`pwd` @@ -42,7 +42,7 @@ trap "_cleanup; exit \$status" 0 1 2 3 15 _cleanup() { cd / - rm -rf "$tmp".* "$testdir" + rm -rf $tmp.* $testdir } # get standard environment, filters and checks @@ -56,47 +56,48 @@ _require_test_reflink _require_cp_reflink _require_xfs_io_command "fzero" -rm -f "$seqres.full" +rm -f $seqres.full testdir=$TEST_DIR/test-$seq rm -rf $testdir mkdir $testdir echo "Create the original file blocks" -blksz="$(stat -f "$testdir" -c '%S')" +blksz="$(stat -f $testdir -c '%S')" blks=2000 margin='15%' sz=$((blksz * blks)) -free_blocks0=$(stat -f "$testdir" -c '%f') +free_blocks0=$(stat -f $testdir -c '%f') nr=4 -_pwrite_byte 0x61 0 $sz "$testdir/file1" >> "$seqres.full" +filesize=$((blksz * nr)) +_pwrite_byte 0x61 0 $sz $testdir/file1 >> $seqres.full _test_remount echo "Create the reflink copies" for i in `seq 2 $nr`; do - _cp_reflink "$testdir/file1" "$testdir/file$i" + _cp_reflink $testdir/file1 $testdir/file$i done _test_remount -free_blocks1=$(stat -f "$testdir" -c '%f') +free_blocks1=$(stat -f $testdir -c '%f') echo "Rewrite some of the blocks" -"$XFS_IO_PROG" -f -c "fzero 0 $sz" "$testdir/file2" >> "$seqres.full" -_pwrite_byte 0x63 0 $((sz / 2)) "$testdir/file3" -d >> "$seqres.full" -_mwrite_byte 0x64 $((sz / 2)) $((sz / 2)) $sz "$testdir/file4" >> "$seqres.full" +$XFS_IO_PROG -f -c "fzero 0 $sz" $testdir/file2 >> $seqres.full +_pwrite_byte 0x63 0 $((sz / 2)) $testdir/file3 -d >> $seqres.full +_mwrite_byte 0x64 $((sz / 2)) $((sz / 2)) $sz $testdir/file4 >> $seqres.full _test_remount -free_blocks2=$(stat -f "$testdir" -c '%f') +free_blocks2=$(stat -f $testdir -c '%f') echo "Rewrite all the files" -_pwrite_byte 0x62 0 $sz "$testdir/file2" -d >> "$seqres.full" -_mwrite_byte 0x63 0 $sz $sz "$testdir/file3" >> "$seqres.full" -"$XFS_IO_PROG" -f -c "fzero 0 $sz" $testdir/file4 >> "$seqres.full" +_pwrite_byte 0x62 0 $sz $testdir/file2 -d >> $seqres.full +_mwrite_byte 0x63 0 $sz $sz $testdir/file3 >> $seqres.full +$XFS_IO_PROG -f -c "fzero 0 $sz" $testdir/file4 >> $seqres.full _test_remount -free_blocks3=$(stat -f "$testdir" -c '%f') +free_blocks3=$(stat -f $testdir -c '%f') echo "Rewrite the original file" -_pwrite_byte 0x65 0 $sz "$testdir/file1" >> "$seqres.full" +_pwrite_byte 0x65 0 $sz $testdir/file1 >> $seqres.full _test_remount -free_blocks4=$(stat -f "$testdir" -c '%f') +free_blocks4=$(stat -f $testdir -c '%f') #echo $free_blocks0 $free_blocks1 $free_blocks2 $free_blocks3 $free_blocks4 _within_tolerance "free blocks after reflinking" $free_blocks1 $((free_blocks0 - blks)) $margin -v diff --git a/tests/generic/156 b/tests/generic/156 index 9fea988..de2d9b1 100755 --- a/tests/generic/156 +++ b/tests/generic/156 @@ -33,8 +33,8 @@ # Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA #----------------------------------------------------------------------- -seq=`basename "$0"` -seqres="$RESULT_DIR/$seq" +seq=`basename $0` +seqres=$RESULT_DIR/$seq echo "QA output created by $seq" here=`pwd` @@ -45,7 +45,7 @@ trap "_cleanup; exit \$status" 0 1 2 3 15 _cleanup() { cd / - rm -rf "$tmp".* "$testdir" + rm -rf $tmp.* $testdir } # get standard environment, filters and checks @@ -64,49 +64,50 @@ _require_test_reflink _require_cp_reflink _require_xfs_io_command "falloc" -rm -f "$seqres.full" +rm -f $seqres.full -testdir="$TEST_DIR/test-$seq" -rm -rf "$testdir" -mkdir "$testdir" +testdir=$TEST_DIR/test-$seq +rm -rf $testdir +mkdir $testdir echo "Create the original file blocks" -blksz="$(stat -f "$testdir" -c '%S')" +blksz="$(stat -f $testdir -c '%S')" blks=2000 margin='15%' sz=$((blksz * blks)) -free_blocks0=$(stat -f "$testdir" -c '%f') +free_blocks0=$(stat -f $testdir -c '%f') nr=4 -_pwrite_byte 0x61 0 $sz "$testdir/file1" >> "$seqres.full" +filesize=$((blksz * nr)) +_pwrite_byte 0x61 0 $sz $testdir/file1 >> $seqres.full _test_remount echo "Create the reflink copies" for i in `seq 2 $nr`; do - _cp_reflink "$testdir/file1" "$testdir/file$i" + _cp_reflink $testdir/file1 $testdir/file$i done _test_remount -free_blocks1=$(stat -f "$testdir" -c '%f') +free_blocks1=$(stat -f $testdir -c '%f') echo "funshare part of a file" -"$XFS_IO_PROG" -f -c "falloc 0 $((sz / 2))" "$testdir/file2" +$XFS_IO_PROG -f -c "falloc 0 $((sz / 2))" $testdir/file2 _test_remount echo "funshare some of the copies" -"$XFS_IO_PROG" -f -c "falloc 0 $sz" "$testdir/file2" -"$XFS_IO_PROG" -f -c "falloc 0 $sz" "$testdir/file3" +$XFS_IO_PROG -f -c "falloc 0 $sz" $testdir/file2 +$XFS_IO_PROG -f -c "falloc 0 $sz" $testdir/file3 _test_remount -free_blocks2=$(stat -f "$testdir" -c '%f') +free_blocks2=$(stat -f $testdir -c '%f') echo "funshare the rest of the files" -"$XFS_IO_PROG" -f -c "falloc 0 $sz" "$testdir/file4" -"$XFS_IO_PROG" -f -c "falloc 0 $sz" "$testdir/file1" +$XFS_IO_PROG -f -c "falloc 0 $sz" $testdir/file4 +$XFS_IO_PROG -f -c "falloc 0 $sz" $testdir/file1 _test_remount -free_blocks3=$(stat -f "$testdir" -c '%f') +free_blocks3=$(stat -f $testdir -c '%f') echo "Rewrite the original file" -_pwrite_byte 0x65 0 $sz "$testdir/file1" >> "$seqres.full" +_pwrite_byte 0x65 0 $sz $testdir/file1 >> $seqres.full _test_remount -free_blocks4=$(stat -f "$testdir" -c '%f') +free_blocks4=$(stat -f $testdir -c '%f') #echo $free_blocks0 $free_blocks1 $free_blocks2 $free_blocks3 $free_blocks4 _within_tolerance "free blocks after reflinking" $free_blocks1 $((free_blocks0 - blks)) $margin -v diff --git a/tests/generic/157 b/tests/generic/157 index 19a9a18..fe294c8 100755 --- a/tests/generic/157 +++ b/tests/generic/157 @@ -20,8 +20,8 @@ # Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA #----------------------------------------------------------------------- -seq=`basename "$0"` -seqres="$RESULT_DIR/$seq" +seq=`basename $0` +seqres=$RESULT_DIR/$seq echo "QA output created by $seq" here=`pwd` @@ -32,7 +32,7 @@ trap "_cleanup; exit \$status" 0 1 2 3 15 _cleanup() { cd / - rm -rf "$tmp".* "$testdir1" + rm -rf $tmp.* $testdir1 } # get standard environment, filters and checks @@ -46,19 +46,18 @@ _supported_os Linux _require_test_reflink _require_scratch_reflink -rm -f "$seqres.full" +rm -f $seqres.full echo "Format and mount" -_scratch_mkfs > "$seqres.full" 2>&1 -_scratch_mount >> "$seqres.full" 2>&1 +_scratch_mkfs > $seqres.full 2>&1 +_scratch_mount >> $seqres.full 2>&1 testdir1="$TEST_DIR/test-$seq" -rm -rf "$testdir1" -mkdir "$testdir1" +rm -rf $testdir1 +mkdir $testdir1 testdir2=$SCRATCH_MNT/test-$seq -rm -rf "$testdir2" -mkdir "$testdir2" +mkdir $testdir2 echo "Create the original files" blksz="$(stat -f $testdir1 -c '%S')" @@ -67,16 +66,17 @@ margin='7%' sz=$((blksz * blks)) free_blocks0=$(stat -f $testdir1 -c '%f') nr=4 -_pwrite_byte 0x61 0 $sz "$testdir1/file1" >> "$seqres.full" -_pwrite_byte 0x61 0 $sz "$testdir1/file2" >> "$seqres.full" -_pwrite_byte 0x61 0 $sz "$testdir2/file1" >> "$seqres.full" -_pwrite_byte 0x61 0 $sz "$testdir2/file2" >> "$seqres.full" -mkdir "$testdir1/dir1" +filesize=$((blksz * nr)) +_pwrite_byte 0x61 0 $sz $testdir1/file1 >> $seqres.full +_pwrite_byte 0x61 0 $sz $testdir1/file2 >> $seqres.full +_pwrite_byte 0x61 0 $sz $testdir2/file1 >> $seqres.full +_pwrite_byte 0x61 0 $sz $testdir2/file2 >> $seqres.full +mkdir $testdir1/dir1 seq 1 $((2 * blksz / 250)) | while read f; do - touch "$testdir1/dir1/$f" + touch $testdir1/dir1/$f done -mknod "$testdir1/dev1" c 1 3 -mkfifo "$testdir1/fifo1" +mknod $testdir1/dev1 c 1 3 +mkfifo $testdir1/fifo1 sync _filter_enotty() { @@ -88,38 +88,38 @@ _filter_einval() { } echo "Try cross-device reflink" -_reflink_range "$testdir1/file1" 0 "$testdir2/file1" 0 $blksz +_reflink_range $testdir1/file1 0 $testdir2/file1 0 $blksz echo "Try unaligned reflink" -_reflink_range "$testdir1/file1" 37 "$testdir1/file1" 59 23 +_reflink_range $testdir1/file1 37 $testdir1/file1 59 23 echo "Try overlapping reflink" -_reflink_range "$testdir1/file1" 0 "$testdir1/file1" 1 $((blksz * 2)) +_reflink_range $testdir1/file1 0 $testdir1/file1 1 $((blksz * 2)) echo "Try reflink past EOF" -_reflink_range "$testdir1/file1" $(( (blks + 10) * blksz)) "$testdir1/file1" 0 $blksz +_reflink_range $testdir1/file1 $(( (blks + 10) * blksz)) $testdir1/file1 0 $blksz echo "Try to reflink a dir" -_reflink_range "$testdir1/dir1" 0 "$testdir1/file2" 0 $blksz +_reflink_range $testdir1/dir1 0 $testdir1/file2 0 $blksz echo "Try to reflink a device" -_reflink_range "$testdir1/dev1" 0 "$testdir1/file2" 0 $blksz +_reflink_range $testdir1/dev1 0 $testdir1/file2 0 $blksz echo "Try to reflink to a dir" -_reflink_range "$testdir1/file1" 0 "$testdir1/dir1" 0 $blksz 2>&1 | _filter_test_dir +_reflink_range $testdir1/file1 0 $testdir1/dir1 0 $blksz 2>&1 | _filter_test_dir echo "Try to reflink to a device" -_reflink_range "$testdir1/file1" 0 "$testdir1/dev1" 0 $blksz 2>&1 | _filter_enotty +_reflink_range $testdir1/file1 0 $testdir1/dev1 0 $blksz 2>&1 | _filter_enotty echo "Try to reflink to a fifo" -_reflink_range "$testdir1/file1" 0 "$testdir1/fifo1" 0 $blksz -n 2>&1 | _filter_enotty +_reflink_range $testdir1/file1 0 $testdir1/fifo1 0 $blksz -n 2>&1 | _filter_enotty echo "Try to reflink an append-only file" -_reflink_range "$testdir1/file1" 0 "$testdir1/file3" 0 $blksz -a 2>&1 | _filter_einval +_reflink_range $testdir1/file1 0 $testdir1/file3 0 $blksz -a 2>&1 | _filter_einval echo "Reflink two files" -_reflink_range "$testdir1/file1" 0 "$testdir1/file2" 0 $blksz >> "$seqres.full" -_reflink_range "$testdir2/file1" 0 "$testdir2/file2" 0 $blksz >> "$seqres.full" +_reflink_range $testdir1/file1 0 $testdir1/file2 0 $blksz >> $seqres.full +_reflink_range $testdir2/file1 0 $testdir2/file2 0 $blksz >> $seqres.full # success, all done status=0 diff --git a/tests/generic/158 b/tests/generic/158 index 4b51973..0da5daa 100755 --- a/tests/generic/158 +++ b/tests/generic/158 @@ -20,8 +20,8 @@ # Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA #----------------------------------------------------------------------- -seq=`basename "$0"` -seqres="$RESULT_DIR/$seq" +seq=`basename $0` +seqres=$RESULT_DIR/$seq echo "QA output created by $seq" here=`pwd` @@ -32,7 +32,7 @@ trap "_cleanup; exit \$status" 0 1 2 3 15 _cleanup() { cd / - rm -rf "$tmp".* "$testdir1" + rm -rf $tmp.* $testdir1 } # get standard environment, filters and checks @@ -46,19 +46,18 @@ _supported_os Linux _require_test_dedupe _require_scratch_dedupe -rm -f "$seqres.full" +rm -f $seqres.full echo "Format and mount" -_scratch_mkfs > "$seqres.full" 2>&1 -_scratch_mount >> "$seqres.full" 2>&1 +_scratch_mkfs > $seqres.full 2>&1 +_scratch_mount >> $seqres.full 2>&1 testdir1="$TEST_DIR/test-$seq" -rm -rf "$testdir1" -mkdir "$testdir1" +rm -rf $testdir1 +mkdir $testdir1 testdir2=$SCRATCH_MNT/test-$seq -rm -rf "$testdir2" -mkdir "$testdir2" +mkdir $testdir2 echo "Create the original files" blksz="$(stat -f $testdir1 -c '%S')" @@ -67,17 +66,18 @@ margin='7%' sz=$((blksz * blks)) free_blocks0=$(stat -f $testdir1 -c '%f') nr=4 -_pwrite_byte 0x61 0 $sz "$testdir1/file1" >> "$seqres.full" -_pwrite_byte 0x61 0 $sz "$testdir1/file2" >> "$seqres.full" -_pwrite_byte 0x61 0 $sz "$testdir1/file3" >> "$seqres.full" -_pwrite_byte 0x61 0 $sz "$testdir2/file1" >> "$seqres.full" -_pwrite_byte 0x61 0 $sz "$testdir2/file2" >> "$seqres.full" -mkdir "$testdir1/dir1" +filesize=$((blksz * nr)) +_pwrite_byte 0x61 0 $sz $testdir1/file1 >> $seqres.full +_pwrite_byte 0x61 0 $sz $testdir1/file2 >> $seqres.full +_pwrite_byte 0x61 0 $sz $testdir1/file3 >> $seqres.full +_pwrite_byte 0x61 0 $sz $testdir2/file1 >> $seqres.full +_pwrite_byte 0x61 0 $sz $testdir2/file2 >> $seqres.full +mkdir $testdir1/dir1 seq 1 $((2 * blksz / 250)) | while read f; do - touch "$testdir1/dir1/$f" + touch $testdir1/dir1/$f done -mknod "$testdir1/dev1" c 1 3 -mkfifo "$testdir1/fifo1" +mknod $testdir1/dev1 c 1 3 +mkfifo $testdir1/fifo1 sync _filter_enotty() { @@ -89,38 +89,38 @@ _filter_eperm() { } echo "Try cross-device dedupe" -_dedupe_range "$testdir1/file1" 0 "$testdir2/file1" 0 $blksz +_dedupe_range $testdir1/file1 0 $testdir2/file1 0 $blksz echo "Try unaligned dedupe" -_dedupe_range "$testdir1/file1" 37 "$testdir1/file1" 59 23 +_dedupe_range $testdir1/file1 37 $testdir1/file1 59 23 echo "Try overlapping dedupe" -_dedupe_range "$testdir1/file1" 0 "$testdir1/file1" 1 $((blksz * 2)) +_dedupe_range $testdir1/file1 0 $testdir1/file1 1 $((blksz * 2)) echo "Try dedupe past EOF" -_dedupe_range "$testdir1/file1" $(( (blks + 10) * blksz)) "$testdir1/file1" 0 $blksz +_dedupe_range $testdir1/file1 $(( (blks + 10) * blksz)) $testdir1/file1 0 $blksz echo "Try to dedupe a dir" -_dedupe_range "$testdir1/dir1" 0 "$testdir1/file2" 0 $blksz +_dedupe_range $testdir1/dir1 0 $testdir1/file2 0 $blksz echo "Try to dedupe a device" -_dedupe_range "$testdir1/dev1" 0 "$testdir1/file2" 0 $blksz 2>&1 | _filter_enotty +_dedupe_range $testdir1/dev1 0 $testdir1/file2 0 $blksz 2>&1 | _filter_enotty echo "Try to dedupe to a dir" -_dedupe_range "$testdir1/file1" 0 "$testdir1/dir1" 0 $blksz 2>&1 | _filter_test_dir +_dedupe_range $testdir1/file1 0 $testdir1/dir1 0 $blksz 2>&1 | _filter_test_dir echo "Try to dedupe to a device" -_dedupe_range "$testdir1/file1" 0 "$testdir1/dev1" 0 $blksz 2>&1 | _filter_eperm +_dedupe_range $testdir1/file1 0 $testdir1/dev1 0 $blksz 2>&1 | _filter_eperm echo "Try to dedupe to a fifo" -_dedupe_range "$testdir1/file1" 0 "$testdir1/fifo1" 0 $blksz -n 2>&1 | _filter_eperm +_dedupe_range $testdir1/file1 0 $testdir1/fifo1 0 $blksz -n 2>&1 | _filter_eperm echo "Try to dedupe an append-only file" -_dedupe_range "$testdir1/file1" 0 "$testdir1/file3" 0 $blksz -a >> "$seqres.full" +_dedupe_range $testdir1/file1 0 $testdir1/file3 0 $blksz -a >> $seqres.full echo "Dedupe two files" -_dedupe_range "$testdir1/file1" 0 "$testdir1/file2" 0 $blksz >> "$seqres.full" -_dedupe_range "$testdir2/file1" 0 "$testdir2/file2" 0 $blksz >> "$seqres.full" +_dedupe_range $testdir1/file1 0 $testdir1/file2 0 $blksz >> $seqres.full +_dedupe_range $testdir2/file1 0 $testdir2/file2 0 $blksz >> $seqres.full # success, all done status=0 diff --git a/tests/generic/159 b/tests/generic/159 index 88a0c7e..8898d58 100755 --- a/tests/generic/159 +++ b/tests/generic/159 @@ -20,8 +20,8 @@ # Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA #----------------------------------------------------------------------- -seq=`basename "$0"` -seqres="$RESULT_DIR/$seq" +seq=`basename $0` +seqres=$RESULT_DIR/$seq echo "QA output created by $seq" here=`pwd` @@ -32,7 +32,7 @@ trap "_cleanup; exit \$status" 0 1 2 3 15 _cleanup() { cd / - rm -rf "$tmp".* "$testdir1" + rm -rf $tmp.* $testdir1 } # get standard environment, filters and checks @@ -46,12 +46,12 @@ _supported_os Linux _require_test_lsattr _require_test_reflink -rm -f "$seqres.full" +rm -f $seqres.full echo "Format and mount" testdir1="$TEST_DIR/test-$seq" -rm -rf "$testdir1" -mkdir "$testdir1" +rm -rf $testdir1 +mkdir $testdir1 echo "Create the original files" blksz="$(stat -f $testdir1 -c '%S')" @@ -60,13 +60,14 @@ margin='7%' sz=$((blksz * blks)) free_blocks0=$(stat -f $testdir1 -c '%f') nr=4 -_pwrite_byte 0x61 0 $sz "$testdir1/file1" >> "$seqres.full" -_pwrite_byte 0x61 0 $sz "$testdir1/file2" >> "$seqres.full" +filesize=$((blksz * nr)) +_pwrite_byte 0x61 0 $sz $testdir1/file1 >> $seqres.full +_pwrite_byte 0x61 0 $sz $testdir1/file2 >> $seqres.full sync echo "Try reflink on immutable files" $CHATTR_PROG +i $testdir1/file1 $testdir1/file2 -_reflink_range "$testdir1/file1" 0 "$testdir1/file2" 0 $blksz 2>&1 | _filter_test_dir +_reflink_range $testdir1/file1 0 $testdir1/file2 0 $blksz 2>&1 | _filter_test_dir $CHATTR_PROG -i $testdir1/file1 $testdir1/file2 # success, all done diff --git a/tests/generic/160 b/tests/generic/160 index 83325d5..3a91dc8 100755 --- a/tests/generic/160 +++ b/tests/generic/160 @@ -20,8 +20,8 @@ # Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA #----------------------------------------------------------------------- -seq=`basename "$0"` -seqres="$RESULT_DIR/$seq" +seq=`basename $0` +seqres=$RESULT_DIR/$seq echo "QA output created by $seq" here=`pwd` @@ -32,7 +32,7 @@ trap "_cleanup; exit \$status" 0 1 2 3 15 _cleanup() { cd / - rm -rf "$tmp".* "$testdir1" + rm -rf $tmp.* $testdir1 } # get standard environment, filters and checks @@ -46,12 +46,12 @@ _supported_os Linux _require_test_lsattr _require_test_dedupe -rm -f "$seqres.full" +rm -f $seqres.full echo "Format and mount" testdir1="$TEST_DIR/test-$seq" -rm -rf "$testdir1" -mkdir "$testdir1" +rm -rf $testdir1 +mkdir $testdir1 echo "Create the original files" blksz="$(stat -f $testdir1 -c '%S')" @@ -60,13 +60,14 @@ margin='7%' sz=$((blksz * blks)) free_blocks0=$(stat -f $testdir1 -c '%f') nr=4 -_pwrite_byte 0x61 0 $sz "$testdir1/file1" >> "$seqres.full" -_pwrite_byte 0x61 0 $sz "$testdir1/file2" >> "$seqres.full" +filesize=$((blksz * nr)) +_pwrite_byte 0x61 0 $sz $testdir1/file1 >> $seqres.full +_pwrite_byte 0x61 0 $sz $testdir1/file2 >> $seqres.full sync echo "Try dedupe on immutable files" $CHATTR_PROG +i $testdir1/file1 $testdir1/file2 -_dedupe_range "$testdir1/file1" 0 "$testdir1/file2" 0 $blksz 2>&1 | _filter_test_dir +_dedupe_range $testdir1/file1 0 $testdir1/file2 0 $blksz 2>&1 | _filter_test_dir $CHATTR_PROG -i $testdir1/file1 $testdir1/file2 # success, all done diff --git a/tests/generic/161 b/tests/generic/161 index 1d5364e..7776b83 100755 --- a/tests/generic/161 +++ b/tests/generic/161 @@ -21,8 +21,8 @@ #----------------------------------------------------------------------- # -seq=`basename "$0"` -seqres="$RESULT_DIR/$seq" +seq=`basename $0` +seqres=$RESULT_DIR/$seq echo "QA output created by $seq" here=`pwd` @@ -33,7 +33,7 @@ trap "_cleanup; exit \$status" 0 1 2 3 7 15 _cleanup() { cd / - rm -rf "$tmp".* + rm -rf $tmp.* wait } @@ -48,25 +48,24 @@ _require_scratch_reflink _require_cp_reflink echo "Format and mount" -_scratch_mkfs > "$seqres.full" 2>&1 -_scratch_mount >> "$seqres.full" 2>&1 +_scratch_mkfs > $seqres.full 2>&1 +_scratch_mount >> $seqres.full 2>&1 -testdir="$SCRATCH_MNT/test-$seq" -rm -rf "$testdir" -mkdir "$testdir" +testdir=$SCRATCH_MNT/test-$seq +mkdir $testdir loops=4096 blksz=65536 echo "Initialize files" -echo > "$seqres.full" -_pwrite_byte 0x61 0 $((loops * blksz)) "$testdir/file1" >> "$seqres.full" -_cp_reflink "$testdir/file1" "$testdir/file2" +echo > $seqres.full +_pwrite_byte 0x61 0 $((loops * blksz)) $testdir/file1 >> $seqres.full +_cp_reflink $testdir/file1 $testdir/file2 _scratch_remount echo "Delete while rewriting" -rm -rf "$testdir/file1" & -_pwrite_byte 0x62 0 $((loops * blksz)) "$testdir/file1" >> "$seqres.full" +rm -rf $testdir/file1 & +_pwrite_byte 0x62 0 $((loops * blksz)) $testdir/file1 >> $seqres.full wait # success, all done diff --git a/tests/generic/162 b/tests/generic/162 index 9044545..6d5bb7a 100755 --- a/tests/generic/162 +++ b/tests/generic/162 @@ -21,8 +21,8 @@ #----------------------------------------------------------------------- # -seq=`basename "$0"` -seqres="$RESULT_DIR/$seq" +seq=`basename $0` +seqres=$RESULT_DIR/$seq echo "QA output created by $seq" here=`pwd` @@ -33,7 +33,7 @@ trap "_cleanup; exit \$status" 0 1 2 3 7 15 _cleanup() { cd / - rm -rf "$tmp".* + rm -rf $tmp.* wait } @@ -47,27 +47,26 @@ _supported_os Linux _require_scratch_dedupe echo "Format and mount" -_scratch_mkfs > "$seqres.full" 2>&1 -_scratch_mount >> "$seqres.full" 2>&1 +_scratch_mkfs > $seqres.full 2>&1 +_scratch_mount >> $seqres.full 2>&1 -testdir="$SCRATCH_MNT/test-$seq" -rm -rf "$testdir" -mkdir "$testdir" +testdir=$SCRATCH_MNT/test-$seq +mkdir $testdir loops=512 nr_loops=$((loops - 1)) blksz=65536 echo "Initialize files" -echo > "$seqres.full" -_pwrite_byte 0x61 0 $((loops * blksz)) "$testdir/file1" >> "$seqres.full" -_pwrite_byte 0x61 0 $((loops * blksz)) "$testdir/file2" >> "$seqres.full" +echo > $seqres.full +_pwrite_byte 0x61 0 $((loops * blksz)) $testdir/file1 >> $seqres.full +_pwrite_byte 0x61 0 $((loops * blksz)) $testdir/file2 >> $seqres.full _scratch_remount overwrite() { - while [ ! -e "$testdir/finished" ]; do + while [ ! -e $testdir/finished ]; do seq $nr_loops -1 0 | while read i; do - _pwrite_byte 0x61 $((i * blksz)) $blksz "$testdir/file2" >> "$seqres.full" + _pwrite_byte 0x61 $((i * blksz)) $blksz $testdir/file2 >> $seqres.full done done } @@ -76,13 +75,13 @@ echo "Dedupe and rewrite the file!" overwrite & for i in `seq 1 2`; do seq $nr_loops -1 0 | while read i; do - _dedupe_range "$testdir/file1" $((i * blksz)) \ - "$testdir/file2" $((i * blksz)) $blksz >> "$seqres.full" + _dedupe_range $testdir/file1 $((i * blksz)) \ + $testdir/file2 $((i * blksz)) $blksz >> $seqres.full [ $? -ne 0 ] && break done done echo "Finished dedupeing" -touch "$testdir/finished" +touch $testdir/finished wait # success, all done diff --git a/tests/generic/163 b/tests/generic/163 index 651d445..b9b0cd7 100755 --- a/tests/generic/163 +++ b/tests/generic/163 @@ -21,8 +21,8 @@ #----------------------------------------------------------------------- # -seq=`basename "$0"` -seqres="$RESULT_DIR/$seq" +seq=`basename $0` +seqres=$RESULT_DIR/$seq echo "QA output created by $seq" here=`pwd` @@ -33,7 +33,7 @@ trap "_cleanup; exit \$status" 0 1 2 3 7 15 _cleanup() { cd / - rm -rf "$tmp".* + rm -rf $tmp.* wait } @@ -47,27 +47,26 @@ _supported_os Linux _require_scratch_dedupe echo "Format and mount" -_scratch_mkfs > "$seqres.full" 2>&1 -_scratch_mount >> "$seqres.full" 2>&1 +_scratch_mkfs > $seqres.full 2>&1 +_scratch_mount >> $seqres.full 2>&1 -testdir="$SCRATCH_MNT/test-$seq" -rm -rf "$testdir" -mkdir "$testdir" +testdir=$SCRATCH_MNT/test-$seq +mkdir $testdir loops=512 nr_loops=$((loops - 1)) blksz=65536 echo "Initialize files" -echo > "$seqres.full" -_pwrite_byte 0x61 0 $((loops * blksz)) "$testdir/file1" >> "$seqres.full" -_pwrite_byte 0x61 0 $((loops * blksz)) "$testdir/file2" >> "$seqres.full" +echo > $seqres.full +_pwrite_byte 0x61 0 $((loops * blksz)) $testdir/file1 >> $seqres.full +_pwrite_byte 0x61 0 $((loops * blksz)) $testdir/file2 >> $seqres.full _scratch_remount overwrite() { - while [ ! -e "$testdir/finished" ]; do + while [ ! -e $testdir/finished ]; do seq $nr_loops -1 0 | while read i; do - _pwrite_byte 0x61 $((i * blksz)) $blksz "$testdir/file1" >> "$seqres.full" + _pwrite_byte 0x61 $((i * blksz)) $blksz $testdir/file1 >> $seqres.full done done } @@ -76,13 +75,13 @@ echo "Dedupe and rewrite the file!" overwrite & for i in `seq 1 2`; do seq $nr_loops -1 0 | while read i; do - _dedupe_range "$testdir/file1" $((i * blksz)) \ - "$testdir/file2" $((i * blksz)) $blksz >> "$seqres.full" + _dedupe_range $testdir/file1 $((i * blksz)) \ + $testdir/file2 $((i * blksz)) $blksz >> $seqres.full [ $? -ne 0 ] && break done done echo "Finished dedupeing" -touch "$testdir/finished" +touch $testdir/finished wait # success, all done diff --git a/tests/generic/164 b/tests/generic/164 index 6c19c7d..6c12724 100755 --- a/tests/generic/164 +++ b/tests/generic/164 @@ -22,7 +22,7 @@ #----------------------------------------------------------------------- # -seq=`basename "$0"` +seq=`basename $0` seqres=$RESULT_DIR/$seq echo "QA output created by $seq" @@ -34,7 +34,7 @@ trap "_cleanup; exit \$status" 0 1 2 3 7 15 _cleanup() { cd / - rm -rf "$tmp".* + rm -rf $tmp.* wait } @@ -49,22 +49,21 @@ _require_scratch_reflink _require_cp_reflink echo "Format and mount" -_scratch_mkfs > "$seqres.full" 2>&1 -_scratch_mount >> "$seqres.full" 2>&1 +_scratch_mkfs > $seqres.full 2>&1 +_scratch_mount >> $seqres.full 2>&1 -testdir="$SCRATCH_MNT/test-$seq" -rm -rf "$testdir" -mkdir "$testdir" +testdir=$SCRATCH_MNT/test-$seq +mkdir $testdir loops=512 nr_loops=$((loops - 1)) blksz=65536 echo "Initialize files" -echo > "$seqres.full" -_pwrite_byte 0x61 0 $((loops * blksz)) "$testdir/file1" >> "$seqres.full" -_pwrite_byte 0x62 0 $((loops * blksz)) "$testdir/file2" >> "$seqres.full" -_cp_reflink "$testdir/file1" "$testdir/file3" +echo > $seqres.full +_pwrite_byte 0x61 0 $((loops * blksz)) $testdir/file1 >> $seqres.full +_pwrite_byte 0x62 0 $((loops * blksz)) $testdir/file2 >> $seqres.full +_cp_reflink $testdir/file1 $testdir/file3 _scratch_remount fbytes() { @@ -72,8 +71,8 @@ fbytes() { } reader() { - while [ ! -e "$testdir/finished" ]; do - _read_range "$testdir/file3" 0 $((loops * blksz)) | fbytes + while [ ! -e $testdir/finished ]; do + _read_range $testdir/file3 0 $((loops * blksz)) | fbytes done } @@ -81,18 +80,18 @@ echo "Reflink and reread the files!" reader & for i in `seq 1 2`; do seq $nr_loops -1 0 | while read i; do - _reflink_range "$testdir/file1" $((i * blksz)) \ - "$testdir/file3" $((i * blksz)) $blksz >> "$seqres.full" + _reflink_range $testdir/file1 $((i * blksz)) \ + $testdir/file3 $((i * blksz)) $blksz >> $seqres.full [ $? -ne 0 ] && break done seq $nr_loops -1 0 | while read i; do - _reflink_range "$testdir/file2" $((i * blksz)) \ - "$testdir/file3" $((i * blksz)) $blksz >> "$seqres.full" + _reflink_range $testdir/file2 $((i * blksz)) \ + $testdir/file3 $((i * blksz)) $blksz >> $seqres.full [ $? -ne 0 ] && break done done echo "Finished reflinking" -touch "$testdir/finished" +touch $testdir/finished wait # success, all done diff --git a/tests/generic/165 b/tests/generic/165 index 2e380a9..e4c9a9d 100755 --- a/tests/generic/165 +++ b/tests/generic/165 @@ -22,7 +22,7 @@ #----------------------------------------------------------------------- # -seq=`basename "$0"` +seq=`basename $0` seqres=$RESULT_DIR/$seq echo "QA output created by $seq" @@ -34,7 +34,7 @@ trap "_cleanup; exit \$status" 0 1 2 3 7 15 _cleanup() { cd / - rm -rf "$tmp".* + rm -rf $tmp.* wait } @@ -49,21 +49,20 @@ _require_scratch_reflink _require_cp_reflink echo "Format and mount" -_scratch_mkfs > "$seqres.full" 2>&1 -_scratch_mount >> "$seqres.full" 2>&1 +_scratch_mkfs > $seqres.full 2>&1 +_scratch_mount >> $seqres.full 2>&1 -testdir="$SCRATCH_MNT/test-$seq" -rm -rf "$testdir" -mkdir "$testdir" +testdir=$SCRATCH_MNT/test-$seq +mkdir $testdir loops=512 nr_loops=$((loops - 1)) blksz=65536 echo "Initialize files" -echo > "$seqres.full" -_pwrite_byte 0x61 0 $((loops * blksz)) "$testdir/file1" >> "$seqres.full" -_pwrite_byte 0x62 0 $((loops * blksz)) "$testdir/file2" >> "$seqres.full" +echo > $seqres.full +_pwrite_byte 0x61 0 $((loops * blksz)) $testdir/file1 >> $seqres.full +_pwrite_byte 0x62 0 $((loops * blksz)) $testdir/file2 >> $seqres.full _cp_reflink $testdir/file1 $testdir/file3 _scratch_remount @@ -72,8 +71,8 @@ fbytes() { } reader() { - while [ ! -e "$testdir/finished" ]; do - _read_range "$testdir/file3" 0 $((loops * blksz)) -d | fbytes + while [ ! -e $testdir/finished ]; do + _read_range $testdir/file3 0 $((loops * blksz)) -d | fbytes done } @@ -81,18 +80,18 @@ echo "Reflink and dio reread the files!" reader & for i in `seq 1 2`; do seq $nr_loops -1 0 | while read i; do - _reflink_range "$testdir/file1" $((i * blksz)) \ - "$testdir/file3" $((i * blksz)) $blksz >> "$seqres.full" + _reflink_range $testdir/file1 $((i * blksz)) \ + $testdir/file3 $((i * blksz)) $blksz >> $seqres.full [ $? -ne 0 ] && break done seq $nr_loops -1 0 | while read i; do - _reflink_range "$testdir/file2" $((i * blksz)) \ - "$testdir/file3" $((i * blksz)) $blksz >> "$seqres.full" + _reflink_range $testdir/file2 $((i * blksz)) \ + $testdir/file3 $((i * blksz)) $blksz >> $seqres.full [ $? -ne 0 ] && break done done echo "Finished reflinking" -touch "$testdir/finished" +touch $testdir/finished wait # success, all done diff --git a/tests/generic/166 b/tests/generic/166 index 028ee11..9be753d 100755 --- a/tests/generic/166 +++ b/tests/generic/166 @@ -22,8 +22,8 @@ #----------------------------------------------------------------------- # -seq=`basename "$0"` -seqres="$RESULT_DIR/$seq" +seq=`basename $0` +seqres=$RESULT_DIR/$seq echo "QA output created by $seq" here=`pwd` @@ -34,7 +34,7 @@ trap "_cleanup; exit \$status" 0 1 2 3 7 15 _cleanup() { cd / - rm -rf "$tmp".* + rm -rf $tmp.* wait } @@ -49,27 +49,26 @@ _require_scratch_reflink _require_cp_reflink echo "Format and mount" -_scratch_mkfs > "$seqres.full" 2>&1 -_scratch_mount >> "$seqres.full" 2>&1 +_scratch_mkfs > $seqres.full 2>&1 +_scratch_mount >> $seqres.full 2>&1 -testdir="$SCRATCH_MNT/test-$seq" -rm -rf "$testdir" -mkdir "$testdir" +testdir=$SCRATCH_MNT/test-$seq +mkdir $testdir loops=1024 nr_loops=$((loops - 1)) blksz=65536 echo "Initialize file" -echo > "$seqres.full" -_pwrite_byte 0x61 0 $((loops * blksz)) "$testdir/file1" >> "$seqres.full" +echo > $seqres.full +_pwrite_byte 0x61 0 $((loops * blksz)) $testdir/file1 >> $seqres.full _scratch_remount # Snapshot creator... snappy() { n=0 - while [ ! -e "$testdir/finished" ]; do - _cp_reflink "$testdir/file1" "$testdir/snap_$n" || break + while [ ! -e $testdir/finished ]; do + _cp_reflink $testdir/file1 $testdir/snap_$n || break n=$((n + 1)) done } @@ -77,7 +76,7 @@ snappy() { echo "Snapshot a file undergoing directio rewrite" snappy & seq $nr_loops -1 0 | while read i; do - _pwrite_byte 0x63 $((i * blksz)) $blksz -d "$testdir/file1" >> "$seqres.full" + _pwrite_byte 0x63 $((i * blksz)) $blksz -d $testdir/file1 >> $seqres.full done touch $testdir/finished wait diff --git a/tests/generic/167 b/tests/generic/167 index a4bf4f4..ef8e75b 100755 --- a/tests/generic/167 +++ b/tests/generic/167 @@ -22,8 +22,8 @@ #----------------------------------------------------------------------- # -seq=`basename "$0"` -seqres="$RESULT_DIR/$seq" +seq=`basename $0` +seqres=$RESULT_DIR/$seq echo "QA output created by $seq" here=`pwd` @@ -34,7 +34,7 @@ trap "_cleanup; exit \$status" 0 1 2 3 7 15 _cleanup() { cd / - rm -rf "$tmp".* + rm -rf $tmp.* wait } @@ -49,27 +49,26 @@ _require_scratch_reflink _require_cp_reflink echo "Format and mount" -_scratch_mkfs > "$seqres.full" 2>&1 -_scratch_mount >> "$seqres.full" 2>&1 +_scratch_mkfs > $seqres.full 2>&1 +_scratch_mount >> $seqres.full 2>&1 -testdir="$SCRATCH_MNT/test-$seq" -rm -rf "$testdir" -mkdir "$testdir" +testdir=$SCRATCH_MNT/test-$seq +mkdir $testdir loops=1024 nr_loops=$((loops - 1)) blksz=65536 echo "Initialize file" -echo > "$seqres.full" -_pwrite_byte 0x61 0 $((loops * blksz)) "$testdir/file1" >> "$seqres.full" +echo > $seqres.full +_pwrite_byte 0x61 0 $((loops * blksz)) $testdir/file1 >> $seqres.full _scratch_remount # Snapshot creator... snappy() { n=0 - while [ ! -e "$testdir/finished" ]; do - _cp_reflink "$testdir/file1" "$testdir/snap_$n" || break + while [ ! -e $testdir/finished ]; do + _cp_reflink $testdir/file1 $testdir/snap_$n || break n=$((n + 1)) done } @@ -77,7 +76,7 @@ snappy() { echo "Snapshot a file undergoing buffered rewrite" snappy & seq $nr_loops -1 0 | while read i; do - _pwrite_byte 0x63 $((i * blksz)) $blksz "$testdir/file1" >> "$seqres.full" + _pwrite_byte 0x63 $((i * blksz)) $blksz $testdir/file1 >> $seqres.full done touch $testdir/finished wait diff --git a/tests/generic/168 b/tests/generic/168 index 2ffc5b6..bb4a5a1 100755 --- a/tests/generic/168 +++ b/tests/generic/168 @@ -22,8 +22,8 @@ #----------------------------------------------------------------------- # -seq=`basename "$0"` -seqres="$RESULT_DIR/$seq" +seq=`basename $0` +seqres=$RESULT_DIR/$seq echo "QA output created by $seq" here=`pwd` @@ -34,7 +34,7 @@ trap "_cleanup; exit \$status" 0 1 2 3 7 15 _cleanup() { cd / - rm -rf "$tmp".* + rm -rf $tmp.* wait } @@ -48,28 +48,27 @@ _supported_os Linux _require_scratch_reflink echo "Format and mount" -_scratch_mkfs > "$seqres.full" 2>&1 -_scratch_mount >> "$seqres.full" 2>&1 +_scratch_mkfs > $seqres.full 2>&1 +_scratch_mount >> $seqres.full 2>&1 -testdir="$SCRATCH_MNT/test-$seq" -rm -rf "$testdir" -mkdir "$testdir" +testdir=$SCRATCH_MNT/test-$seq +mkdir $testdir loops=1024 nr_loops=$((loops - 1)) blksz=65536 echo "Initialize files" -echo > "$seqres.full" -_pwrite_byte 0x61 0 $((loops * blksz)) "$testdir/file1" >> "$seqres.full" -_pwrite_byte 0x62 0 $((loops * blksz)) "$testdir/file2" >> "$seqres.full" +echo > $seqres.full +_pwrite_byte 0x61 0 $((loops * blksz)) $testdir/file1 >> $seqres.full +_pwrite_byte 0x62 0 $((loops * blksz)) $testdir/file2 >> $seqres.full _scratch_remount # Direct I/O overwriter... overwrite() { - while [ ! -e "$testdir/finished" ]; do + while [ ! -e $testdir/finished ]; do seq $nr_loops -1 0 | while read i; do - _pwrite_byte 0x63 $((i * blksz)) $blksz "$testdir/file2" >> "$seqres.full" + _pwrite_byte 0x63 $((i * blksz)) $blksz $testdir/file2 >> $seqres.full done done } @@ -78,12 +77,12 @@ echo "Reflink and write the target" overwrite & seq 1 10 | while read j; do seq 0 $nr_loops | while read i; do - _reflink_range "$testdir/file1" $((i * blksz)) \ - "$testdir/file2" $((i * blksz)) $blksz >> "$seqres.full" + _reflink_range $testdir/file1 $((i * blksz)) \ + $testdir/file2 $((i * blksz)) $blksz >> $seqres.full [ $? -ne 0 ] && exit done done -touch "$testdir/finished" +touch $testdir/finished wait # success, all done diff --git a/tests/generic/170 b/tests/generic/170 index 2a81cad..dbf1564 100755 --- a/tests/generic/170 +++ b/tests/generic/170 @@ -22,8 +22,8 @@ #----------------------------------------------------------------------- # -seq=`basename "$0"` -seqres="$RESULT_DIR/$seq" +seq=`basename $0` +seqres=$RESULT_DIR/$seq echo "QA output created by $seq" here=`pwd` @@ -34,7 +34,7 @@ trap "_cleanup; exit \$status" 0 1 2 3 7 15 _cleanup() { cd / - rm -rf "$tmp".* + rm -rf $tmp.* wait } @@ -48,28 +48,27 @@ _supported_os Linux _require_scratch_reflink echo "Format and mount" -_scratch_mkfs > "$seqres.full" 2>&1 -_scratch_mount >> "$seqres.full" 2>&1 +_scratch_mkfs > $seqres.full 2>&1 +_scratch_mount >> $seqres.full 2>&1 -testdir="$SCRATCH_MNT/test-$seq" -rm -rf "$testdir" -mkdir "$testdir" +testdir=$SCRATCH_MNT/test-$seq +mkdir $testdir loops=1024 nr_loops=$((loops - 1)) blksz=65536 echo "Initialize files" -echo > "$seqres.full" -_pwrite_byte 0x61 0 $((loops * blksz)) "$testdir/file1" >> "$seqres.full" -_pwrite_byte 0x62 0 $((loops * blksz)) "$testdir/file2" >> "$seqres.full" +echo > $seqres.full +_pwrite_byte 0x61 0 $((loops * blksz)) $testdir/file1 >> $seqres.full +_pwrite_byte 0x62 0 $((loops * blksz)) $testdir/file2 >> $seqres.full _scratch_remount # Direct I/O overwriter... overwrite() { - while [ ! -e "$testdir/finished" ]; do + while [ ! -e $testdir/finished ]; do seq $nr_loops -1 0 | while read i; do - _pwrite_byte 0x63 $((i * blksz)) $blksz -d "$testdir/file2" >> "$seqres.full" + _pwrite_byte 0x63 $((i * blksz)) $blksz -d $testdir/file2 >> $seqres.full done done } @@ -78,12 +77,12 @@ echo "Reflink and dio write the target" overwrite & seq 1 10 | while read j; do seq 0 $nr_loops | while read i; do - _reflink_range "$testdir/file1" $((i * blksz)) \ - "$testdir/file2" $((i * blksz)) $blksz >> "$seqres.full" + _reflink_range $testdir/file1 $((i * blksz)) \ + $testdir/file2 $((i * blksz)) $blksz >> $seqres.full [ $? -ne 0 ] && exit done done -touch "$testdir/finished" +touch $testdir/finished wait # success, all done diff --git a/tests/generic/171 b/tests/generic/171 index d865f64..8a3f246 100755 --- a/tests/generic/171 +++ b/tests/generic/171 @@ -21,8 +21,8 @@ # Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA #----------------------------------------------------------------------- -seq=`basename "$0"` -seqres="$RESULT_DIR/$seq" +seq=`basename $0` +seqres=$RESULT_DIR/$seq echo "QA output created by $seq" here=`pwd` @@ -33,7 +33,7 @@ trap "_cleanup; exit \$status" 0 1 2 3 15 _cleanup() { cd / - rm -rf "$tmp".* "$testdir1" + rm -rf $tmp.* $testdir1 } # get standard environment, filters and checks @@ -47,53 +47,52 @@ _supported_os Linux _require_scratch_reflink _require_cp_reflink -rm -f "$seqres.full" +rm -f $seqres.full echo "Format and mount" -_scratch_mkfs > "$seqres.full" 2>&1 -_scratch_mount >> "$seqres.full" 2>&1 +_scratch_mkfs > $seqres.full 2>&1 +_scratch_mount >> $seqres.full 2>&1 -testdir="$SCRATCH_MNT/test-$seq" -rm -rf "$testdir" -mkdir "$testdir" +testdir=$SCRATCH_MNT/test-$seq +mkdir $testdir echo "Reformat with appropriate size" -blksz="$(stat -f "$testdir" -c '%S')" +blksz="$(stat -f $testdir -c '%S')" nr_blks=10240 -umount "$SCRATCH_MNT" +umount $SCRATCH_MNT sz_bytes=$((nr_blks * 8 * blksz)) if [ $sz_bytes -lt $((32 * 1048576)) ]; then sz_bytes=$((32 * 1048576)) fi -_scratch_mkfs_sized $sz_bytes >> "$seqres.full" 2>&1 -_scratch_mount >> "$seqres.full" 2>&1 -rm -rf "$testdir" -mkdir "$testdir" +_scratch_mkfs_sized $sz_bytes >> $seqres.full 2>&1 +_scratch_mount >> $seqres.full 2>&1 +rm -rf $testdir +mkdir $testdir echo "Create a big file and reflink it" -_pwrite_byte 0x61 0 $((blksz * nr_blks)) "$testdir/bigfile" >> "$seqres.full" 2>&1 -_cp_reflink "$testdir/bigfile" "$testdir/clonefile" +_pwrite_byte 0x61 0 $((blksz * nr_blks)) $testdir/bigfile >> $seqres.full 2>&1 +_cp_reflink $testdir/bigfile $testdir/clonefile sync echo "Allocate the rest of the space" -nr_free="$(stat -f -c '%f' "$testdir")" -touch "$testdir/file0" "$testdir/file1" -_pwrite_byte 0x61 0 $((blksz * nr_free)) "$testdir/eat_my_space" >> "$seqres.full" 2>&1 +nr_free=$(stat -f -c '%f' $testdir) +touch $testdir/file0 $testdir/file1 +_pwrite_byte 0x61 0 $((blksz * nr_free)) $testdir/eat_my_space >> $seqres.full 2>&1 sync echo "CoW the big file" -out="$(_pwrite_byte 0x62 0 $((blksz * nr_blks)) "$testdir/bigfile" 2>&1)" -echo "${out}" | grep -q "No space left on device" || echo "CoW should have failed with ENOSPC" -echo "${out}" >> "$seqres.full" 2>&1 -echo "${out}" +out="$(_pwrite_byte 0x62 0 $((blksz * nr_blks)) $testdir/bigfile 2>&1)" +echo ${out} | grep -q "No space left on device" || echo "CoW should have failed with ENOSPC" +echo ${out} >> $seqres.full 2>&1 +echo ${out} echo "Remount and try CoW again" _scratch_remount -out="$(_pwrite_byte 0x62 0 $((blksz * nr_blks)) "$testdir/bigfile" 2>&1)" -echo "${out}" | grep -q "No space left on device" || echo "CoW should have failed with ENOSPC" -echo "${out}" >> "$seqres.full" 2>&1 -echo "${out}" +out="$(_pwrite_byte 0x62 0 $((blksz * nr_blks)) $testdir/bigfile 2>&1)" +echo ${out} | grep -q "No space left on device" || echo "CoW should have failed with ENOSPC" +echo ${out} >> $seqres.full 2>&1 +echo ${out} # success, all done status=0 diff --git a/tests/generic/172 b/tests/generic/172 index e6020f1..3e32644 100755 --- a/tests/generic/172 +++ b/tests/generic/172 @@ -21,8 +21,8 @@ # Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA #----------------------------------------------------------------------- -seq=`basename "$0"` -seqres="$RESULT_DIR/$seq" +seq=`basename $0` +seqres=$RESULT_DIR/$seq echo "QA output created by $seq" here=`pwd` @@ -33,7 +33,7 @@ trap "_cleanup; exit \$status" 0 1 2 3 15 _cleanup() { cd / - rm -rf "$tmp".* "$testdir1" + rm -rf $tmp.* $testdir1 } # get standard environment, filters and checks @@ -47,53 +47,52 @@ _supported_os Linux _require_scratch_reflink _require_cp_reflink -rm -f "$seqres.full" +rm -f $seqres.full echo "Format and mount" -_scratch_mkfs > "$seqres.full" 2>&1 -_scratch_mount >> "$seqres.full" 2>&1 +_scratch_mkfs > $seqres.full 2>&1 +_scratch_mount >> $seqres.full 2>&1 -testdir="$SCRATCH_MNT/test-$seq" -rm -rf "$testdir" -mkdir "$testdir" +testdir=$SCRATCH_MNT/test-$seq +mkdir $testdir echo "Reformat with appropriate size" -blksz="$(stat -f "$testdir" -c '%S')" +blksz="$(stat -f $testdir -c '%S')" nr_blks=10240 -umount "$SCRATCH_MNT" +umount $SCRATCH_MNT sz_bytes=$((nr_blks * 3 / 2 * blksz)) if [ $sz_bytes -lt $((32 * 1048576)) ]; then sz_bytes=$((32 * 1048576)) fi -_scratch_mkfs_sized $sz_bytes >> "$seqres.full" 2>&1 -_scratch_mount >> "$seqres.full" 2>&1 -rm -rf "$testdir" -mkdir "$testdir" +_scratch_mkfs_sized $sz_bytes >> $seqres.full 2>&1 +_scratch_mount >> $seqres.full 2>&1 +rm -rf $testdir +mkdir $testdir echo "Create a big file and reflink it" -_pwrite_byte 0x61 0 $((blksz * nr_blks)) "$testdir/bigfile" >> "$seqres.full" 2>&1 -_cp_reflink "$testdir/bigfile" "$testdir/clonefile" +_pwrite_byte 0x61 0 $((blksz * nr_blks)) $testdir/bigfile >> $seqres.full 2>&1 +_cp_reflink $testdir/bigfile $testdir/clonefile sync echo "Allocate the rest of the space" -nr_free="$(stat -f -c '%f' "$testdir")" -touch "$testdir/file0" "$testdir/file1" -_pwrite_byte 0x61 0 $((blksz * nr_free)) "$testdir/eat_my_space" >> "$seqres.full" 2>&1 +nr_free=$(stat -f -c '%f' $testdir) +touch $testdir/file0 $testdir/file1 +_pwrite_byte 0x61 0 $((blksz * nr_free)) $testdir/eat_my_space >> $seqres.full 2>&1 sync echo "CoW the big file" -out="$(_pwrite_byte 0x62 0 $((blksz * nr_blks)) "$testdir/bigfile" 2>&1)" -echo "${out}" | grep -q "No space left on device" || echo "CoW should have failed with ENOSPC" -echo "${out}" >> "$seqres.full" 2>&1 -echo "${out}" +out="$(_pwrite_byte 0x62 0 $((blksz * nr_blks)) $testdir/bigfile 2>&1)" +echo ${out} | grep -q "No space left on device" || echo "CoW should have failed with ENOSPC" +echo ${out} >> $seqres.full 2>&1 +echo ${out} echo "Remount and try CoW again" _scratch_remount -out="$(_pwrite_byte 0x62 0 $((blksz * nr_blks)) "$testdir/bigfile" 2>&1)" -echo "${out}" | grep -q "No space left on device" || echo "CoW should have failed with ENOSPC" -echo "${out}" >> "$seqres.full" 2>&1 -echo "${out}" +out="$(_pwrite_byte 0x62 0 $((blksz * nr_blks)) $testdir/bigfile 2>&1)" +echo ${out} | grep -q "No space left on device" || echo "CoW should have failed with ENOSPC" +echo ${out} >> $seqres.full 2>&1 +echo ${out} # success, all done status=0 diff --git a/tests/generic/173 b/tests/generic/173 index 61c6b32..fe085a6 100755 --- a/tests/generic/173 +++ b/tests/generic/173 @@ -21,8 +21,8 @@ # Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA #----------------------------------------------------------------------- -seq=`basename "$0"` -seqres="$RESULT_DIR/$seq" +seq=`basename $0` +seqres=$RESULT_DIR/$seq echo "QA output created by $seq" here=`pwd` @@ -33,7 +33,7 @@ trap "_cleanup; exit \$status" 0 1 2 3 15 _cleanup() { cd / - rm -rf "$tmp".* "$testdir1" + rm -rf $tmp.* $testdir1 } # get standard environment, filters and checks @@ -47,53 +47,52 @@ _supported_os Linux _require_scratch_reflink _require_cp_reflink -rm -f "$seqres.full" +rm -f $seqres.full echo "Format and mount" -_scratch_mkfs > "$seqres.full" 2>&1 -_scratch_mount >> "$seqres.full" 2>&1 +_scratch_mkfs > $seqres.full 2>&1 +_scratch_mount >> $seqres.full 2>&1 -testdir="$SCRATCH_MNT/test-$seq" -rm -rf "$testdir" -mkdir "$testdir" +testdir=$SCRATCH_MNT/test-$seq +mkdir $testdir echo "Reformat with appropriate size" -blksz="$(stat -f "$testdir" -c '%S')" +blksz="$(stat -f $testdir -c '%S')" nr_blks=10240 -umount "$SCRATCH_MNT" +umount $SCRATCH_MNT sz_bytes=$((nr_blks * 8 * blksz)) if [ $sz_bytes -lt $((32 * 1048576)) ]; then sz_bytes=$((32 * 1048576)) fi -_scratch_mkfs_sized $sz_bytes >> "$seqres.full" 2>&1 -_scratch_mount >> "$seqres.full" 2>&1 -rm -rf "$testdir" -mkdir "$testdir" +_scratch_mkfs_sized $sz_bytes >> $seqres.full 2>&1 +_scratch_mount >> $seqres.full 2>&1 +rm -rf $testdir +mkdir $testdir echo "Create a big file and reflink it" -_pwrite_byte 0x61 0 $((blksz * nr_blks)) "$testdir/bigfile" >> "$seqres.full" 2>&1 -_cp_reflink "$testdir/bigfile" "$testdir/clonefile" +_pwrite_byte 0x61 0 $((blksz * nr_blks)) $testdir/bigfile >> $seqres.full 2>&1 +_cp_reflink $testdir/bigfile $testdir/clonefile sync echo "Allocate the rest of the space" -nr_free="$(stat -f -c '%f' "$testdir")" -touch "$testdir/file0" "$testdir/file1" -_pwrite_byte 0x61 0 $((blksz * nr_free)) "$testdir/eat_my_space" >> "$seqres.full" 2>&1 +nr_free=$(stat -f -c '%f' $testdir) +touch $testdir/file0 $testdir/file1 +_pwrite_byte 0x61 0 $((blksz * nr_free)) $testdir/eat_my_space >> $seqres.full 2>&1 sync echo "mmap CoW the big file" -out="$(_mwrite_byte 0x62 0 $((blksz * nr_blks)) $((blksz * nr_blks)) "$testdir/bigfile" 2>&1)" +out="$(_mwrite_byte 0x62 0 $((blksz * nr_blks)) $((blksz * nr_blks)) $testdir/bigfile 2>&1)" err="$?" -if [ "$err" -lt 128 ]; then +if [ $err -lt 128 ]; then echo "mmap CoW should have failed with SIGBUS, got SIG$(kill -l $err)" fi echo "Remount and try CoW again" _scratch_remount -out="$(_mwrite_byte 0x62 0 $((blksz * nr_blks)) $((blksz * nr_blks)) "$testdir/bigfile" 2>&1)" +out="$(_mwrite_byte 0x62 0 $((blksz * nr_blks)) $((blksz * nr_blks)) $testdir/bigfile 2>&1)" err="$?" -if [ "$err" -lt 128 ]; then +if [ $err -lt 128 ]; then echo "mmap CoW should have failed with SIGBUS, got SIG$(kill -l $err)" fi diff --git a/tests/generic/174 b/tests/generic/174 index dd6fe5a..cec2f05 100755 --- a/tests/generic/174 +++ b/tests/generic/174 @@ -21,8 +21,8 @@ # Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA #----------------------------------------------------------------------- -seq=`basename "$0"` -seqres="$RESULT_DIR/$seq" +seq=`basename $0` +seqres=$RESULT_DIR/$seq echo "QA output created by $seq" here=`pwd` @@ -33,7 +33,7 @@ trap "_cleanup; exit \$status" 0 1 2 3 15 _cleanup() { cd / - rm -rf "$tmp".* "$testdir1" + rm -rf $tmp.* $testdir1 } # get standard environment, filters and checks @@ -47,53 +47,52 @@ _supported_os Linux _require_scratch_reflink _require_cp_reflink -rm -f "$seqres.full" +rm -f $seqres.full echo "Format and mount" -_scratch_mkfs > "$seqres.full" 2>&1 -_scratch_mount >> "$seqres.full" 2>&1 +_scratch_mkfs > $seqres.full 2>&1 +_scratch_mount >> $seqres.full 2>&1 -testdir="$SCRATCH_MNT/test-$seq" -rm -rf "$testdir" -mkdir "$testdir" +testdir=$SCRATCH_MNT/test-$seq +mkdir $testdir echo "Reformat with appropriate size" -blksz="$(stat -f "$testdir" -c '%S')" +blksz="$(stat -f $testdir -c '%S')" nr_blks=10240 -umount "$SCRATCH_MNT" +umount $SCRATCH_MNT sz_bytes=$((nr_blks * 8 * blksz)) if [ $sz_bytes -lt $((32 * 1048576)) ]; then sz_bytes=$((32 * 1048576)) fi -_scratch_mkfs_sized $sz_bytes >> "$seqres.full" 2>&1 -_scratch_mount >> "$seqres.full" 2>&1 -rm -rf "$testdir" -mkdir "$testdir" +_scratch_mkfs_sized $sz_bytes >> $seqres.full 2>&1 +_scratch_mount >> $seqres.full 2>&1 +rm -rf $testdir +mkdir $testdir echo "Create a big file and reflink it" -_pwrite_byte 0x61 0 $((blksz * nr_blks)) "$testdir/bigfile" >> "$seqres.full" 2>&1 -_cp_reflink "$testdir/bigfile" "$testdir/clonefile" +_pwrite_byte 0x61 0 $((blksz * nr_blks)) $testdir/bigfile >> $seqres.full 2>&1 +_cp_reflink $testdir/bigfile $testdir/clonefile sync echo "Allocate the rest of the space" -nr_free="$(stat -f -c '%f' "$testdir")" -touch "$testdir/file0" "$testdir/file1" -_pwrite_byte 0x61 0 $((blksz * nr_free)) "$testdir/eat_my_space" >> "$seqres.full" 2>&1 +nr_free=$(stat -f -c '%f' $testdir) +touch $testdir/file0 $testdir/file1 +_pwrite_byte 0x61 0 $((blksz * nr_free)) $testdir/eat_my_space >> $seqres.full 2>&1 sync echo "CoW the big file" -out="$(_pwrite_byte 0x62 0 $((blksz * nr_blks)) "$testdir/bigfile" -d 2>&1)" -echo "${out}" | grep -q "No space left on device" || echo "CoW should have failed with ENOSPC" -echo "${out}" >> "$seqres.full" 2>&1 -echo "${out}" +out="$(_pwrite_byte 0x62 0 $((blksz * nr_blks)) $testdir/bigfile -d 2>&1)" +echo ${out} | grep -q "No space left on device" || echo "CoW should have failed with ENOSPC" +echo ${out} >> $seqres.full 2>&1 +echo ${out} echo "Remount and try CoW again" _scratch_remount -out="$(_pwrite_byte 0x62 0 $((blksz * nr_blks)) "$testdir/bigfile" -d 2>&1)" -echo "${out}" | grep -q "No space left on device" || echo "CoW should have failed with ENOSPC" -echo "${out}" >> "$seqres.full" 2>&1 -echo "${out}" +out="$(_pwrite_byte 0x62 0 $((blksz * nr_blks)) $testdir/bigfile -d 2>&1)" +echo ${out} | grep -q "No space left on device" || echo "CoW should have failed with ENOSPC" +echo ${out} >> $seqres.full 2>&1 +echo ${out} # success, all done status=0 diff --git a/tests/generic/178 b/tests/generic/178 index f1bc963..68432e7 100755 --- a/tests/generic/178 +++ b/tests/generic/178 @@ -20,8 +20,8 @@ # Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA #----------------------------------------------------------------------- -seq=`basename "$0"` -seqres="$RESULT_DIR/$seq" +seq=`basename $0` +seqres=$RESULT_DIR/$seq echo "QA output created by $seq" here=`pwd` @@ -32,7 +32,7 @@ trap "_cleanup; exit \$status" 0 1 2 3 15 _cleanup() { cd / - rm -rf "$tmp".* "$testdir" + rm -rf $tmp.* $testdir } # get standard environment, filters and checks @@ -46,31 +46,32 @@ _require_test_reflink _require_cp_reflink _require_xfs_io_command "fpunch" -rm -f "$seqres.full" +rm -f $seqres.full -testdir="$TEST_DIR/test-$seq" -rm -rf "$testdir" -mkdir "$testdir" +testdir=$TEST_DIR/test-$seq +rm -rf $testdir +mkdir $testdir echo "Create the original files" blksz=65536 nr=512 -_pwrite_byte 0x61 0 $((blksz * nr)) "$testdir/file1" >> "$seqres.full" +filesize=$((blksz * nr)) +_pwrite_byte 0x61 0 $filesize $testdir/file1 >> $seqres.full -_cp_reflink "$testdir/file1" "$testdir/file2" +_cp_reflink $testdir/file1 $testdir/file2 _test_remount -md5sum "$testdir/file1" | _filter_test_dir -md5sum "$testdir/file2" | _filter_test_dir +md5sum $testdir/file1 | _filter_test_dir +md5sum $testdir/file2 | _filter_test_dir echo "Write and punch" -_pwrite_byte 0x62 0 $((blksz * 256)) "$testdir/file2" >> "$seqres.full" -"$XFS_IO_PROG" -f -c "fpunch $blksz $((blksz * 254))" "$testdir/file2" +_pwrite_byte 0x62 0 $((blksz * 256)) $testdir/file2 >> $seqres.full +$XFS_IO_PROG -f -c "fpunch $blksz $((blksz * 254))" $testdir/file2 _test_remount echo "Compare results" -md5sum "$testdir/file1" | _filter_test_dir -md5sum "$testdir/file2" | _filter_test_dir +md5sum $testdir/file1 | _filter_test_dir +md5sum $testdir/file2 | _filter_test_dir # success, all done status=0 diff --git a/tests/generic/179 b/tests/generic/179 index 8e1e059..27c25e7 100755 --- a/tests/generic/179 +++ b/tests/generic/179 @@ -23,8 +23,8 @@ # Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA #----------------------------------------------------------------------- -seq=`basename "$0"` -seqres="$RESULT_DIR/$seq" +seq=`basename $0` +seqres=$RESULT_DIR/$seq echo "QA output created by $seq" here=`pwd` @@ -35,7 +35,7 @@ trap "_cleanup; exit \$status" 0 1 2 3 15 _cleanup() { cd / - rm -rf "$tmp".* "$testdir" + rm -rf $tmp.* $testdir } # get standard environment, filters and checks @@ -49,47 +49,47 @@ _require_test_reflink _require_cp_reflink _require_xfs_io_command "fpunch" -rm -f "$seqres.full" +rm -f $seqres.full -testdir="$TEST_DIR/test-$seq" -rm -rf "$testdir" -mkdir "$testdir" +testdir=$TEST_DIR/test-$seq +rm -rf $testdir +mkdir $testdir echo "Create the original files" blksz=65536 -_pwrite_byte 0x61 0 $((blksz * 3)) "$testdir/file1" >> "$seqres.full" +_pwrite_byte 0x61 0 $((blksz * 3)) $testdir/file1 >> $seqres.full -_cp_reflink "$testdir/file1" "$testdir/file2" +_cp_reflink $testdir/file1 $testdir/file2 -_pwrite_byte 0x61 0 $((blksz * 3)) "$testdir/file2.chk" >> "$seqres.full" -_pwrite_byte 0x00 $((blksz - 17)) $((blksz + 17)) "$testdir/file2.chk" >> "$seqres.full" +_pwrite_byte 0x61 0 $((blksz * 3)) $testdir/file2.chk >> $seqres.full +_pwrite_byte 0x00 $((blksz - 17)) $((blksz + 17)) $testdir/file2.chk >> $seqres.full _test_remount -md5sum "$testdir/file1" | _filter_test_dir -md5sum "$testdir/file2" | _filter_test_dir -md5sum "$testdir/file2.chk" | _filter_test_dir +md5sum $testdir/file1 | _filter_test_dir +md5sum $testdir/file2 | _filter_test_dir +md5sum $testdir/file2.chk | _filter_test_dir -c1="$(_md5_checksum "$testdir/file1")" -c2="$(_md5_checksum "$testdir/file2")" +c1=$(_md5_checksum $testdir/file1) +c2=$(_md5_checksum $testdir/file2) -test "${c1}" = "${c2}" || echo "file1 and file2 should match" +test ${c1} = ${c2} || echo "file1 and file2 should match" echo "fpunch files" -"$XFS_IO_PROG" -f -c "fpunch $((blksz - 17)) $((blksz + 17))" "$testdir/file2" +$XFS_IO_PROG -f -c "fpunch $((blksz - 17)) $((blksz + 17))" $testdir/file2 _test_remount echo "Compare files" -md5sum "$testdir/file1" | _filter_test_dir -md5sum "$testdir/file2" | _filter_test_dir -md5sum "$testdir/file2.chk" | _filter_test_dir +md5sum $testdir/file1 | _filter_test_dir +md5sum $testdir/file2 | _filter_test_dir +md5sum $testdir/file2.chk | _filter_test_dir -c1="$(_md5_checksum "$testdir/file1")" -c2="$(_md5_checksum "$testdir/file2")" +c1=$(_md5_checksum $testdir/file1) +c2=$(_md5_checksum $testdir/file2) -test "${c1}" != "${c2}" || echo "file1 and file2 should not match" +test ${c1} != ${c2} || echo "file1 and file2 should not match" echo "Compare against check files" -cmp -s "$testdir/file2" "$testdir/file2.chk" || echo "file2 and file2.chk do not match" +cmp -s $testdir/file2 $testdir/file2.chk || echo "file2 and file2.chk do not match" # success, all done status=0 diff --git a/tests/generic/180 b/tests/generic/180 index dc6cbbb..a0f30a2 100755 --- a/tests/generic/180 +++ b/tests/generic/180 @@ -23,8 +23,8 @@ # Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA #----------------------------------------------------------------------- -seq=`basename "$0"` -seqres="$RESULT_DIR/$seq" +seq=`basename $0` +seqres=$RESULT_DIR/$seq echo "QA output created by $seq" here=`pwd` @@ -35,7 +35,7 @@ trap "_cleanup; exit \$status" 0 1 2 3 15 _cleanup() { cd / - rm -rf "$tmp".* "$testdir" + rm -rf $tmp.* $testdir } # get standard environment, filters and checks @@ -49,47 +49,47 @@ _require_test_reflink _require_cp_reflink _require_xfs_io_command "fzero" -rm -f "$seqres.full" +rm -f $seqres.full -testdir="$TEST_DIR/test-$seq" -rm -rf "$testdir" -mkdir "$testdir" +testdir=$TEST_DIR/test-$seq +rm -rf $testdir +mkdir $testdir echo "Create the original files" blksz=65536 -_pwrite_byte 0x61 0 $((blksz * 3)) "$testdir/file1" >> "$seqres.full" +_pwrite_byte 0x61 0 $((blksz * 3)) $testdir/file1 >> $seqres.full -_cp_reflink "$testdir/file1" "$testdir/file2" +_cp_reflink $testdir/file1 $testdir/file2 -_pwrite_byte 0x61 0 $((blksz * 3)) "$testdir/file2.chk" >> "$seqres.full" -_pwrite_byte 0x00 $((blksz - 17)) $((blksz + 17)) "$testdir/file2.chk" >> "$seqres.full" +_pwrite_byte 0x61 0 $((blksz * 3)) $testdir/file2.chk >> $seqres.full +_pwrite_byte 0x00 $((blksz - 17)) $((blksz + 17)) $testdir/file2.chk >> $seqres.full _test_remount -md5sum "$testdir/file1" | _filter_test_dir -md5sum "$testdir/file2" | _filter_test_dir -md5sum "$testdir/file2.chk" | _filter_test_dir +md5sum $testdir/file1 | _filter_test_dir +md5sum $testdir/file2 | _filter_test_dir +md5sum $testdir/file2.chk | _filter_test_dir -c1="$(_md5_checksum "$testdir/file1")" -c2="$(_md5_checksum "$testdir/file2")" +c1=$(_md5_checksum $testdir/file1) +c2=$(_md5_checksum $testdir/file2) -test "${c1}" = "${c2}" || echo "file1 and file2 should match" +test ${c1} = ${c2} || echo "file1 and file2 should match" echo "fzero files" -"$XFS_IO_PROG" -f -c "fzero $((blksz - 17)) $((blksz + 17))" "$testdir/file2" +$XFS_IO_PROG -f -c "fzero $((blksz - 17)) $((blksz + 17))" $testdir/file2 _test_remount echo "Compare files" -md5sum "$testdir/file1" | _filter_test_dir -md5sum "$testdir/file2" | _filter_test_dir -md5sum "$testdir/file2.chk" | _filter_test_dir +md5sum $testdir/file1 | _filter_test_dir +md5sum $testdir/file2 | _filter_test_dir +md5sum $testdir/file2.chk | _filter_test_dir -c1="$(_md5_checksum "$testdir/file1")" -c2="$(_md5_checksum "$testdir/file2")" +c1=$(_md5_checksum $testdir/file1) +c2=$(_md5_checksum $testdir/file2) -test "${c1}" != "${c2}" || echo "file1 and file2 should not match" +test ${c1} != ${c2} || echo "file1 and file2 should not match" echo "Compare against check files" -cmp -s "$testdir/file2" "$testdir/file2.chk" || echo "file2 and file2.chk do not match" +cmp -s $testdir/file2 $testdir/file2.chk || echo "file2 and file2.chk do not match" # success, all done status=0 diff --git a/tests/generic/181 b/tests/generic/181 index cb6639f..9c640e4 100755 --- a/tests/generic/181 +++ b/tests/generic/181 @@ -23,8 +23,8 @@ # Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA #----------------------------------------------------------------------- -seq=`basename "$0"` -seqres="$RESULT_DIR/$seq" +seq=`basename $0` +seqres=$RESULT_DIR/$seq echo "QA output created by $seq" here=`pwd` @@ -35,7 +35,7 @@ trap "_cleanup; exit \$status" 0 1 2 3 15 _cleanup() { cd / - rm -rf "$tmp".* "$testdir" + rm -rf $tmp.* $testdir } # get standard environment, filters and checks @@ -48,32 +48,32 @@ _supported_os Linux _require_test_reflink _require_cp_reflink -rm -f "$seqres.full" +rm -f $seqres.full -testdir="$TEST_DIR/test-$seq" -rm -rf "$testdir" -mkdir "$testdir" +testdir=$TEST_DIR/test-$seq +rm -rf $testdir +mkdir $testdir echo "Create the original files" blksz=65536 -_pwrite_byte 0x61 0 $((blksz * 256)) "$testdir/file1" >> "$seqres.full" -_pwrite_byte 0x62 0 $((blksz * 256)) "$testdir/file2" >> "$seqres.full" -_pwrite_byte 0x62 0 $((blksz * 2)) "$testdir/file2.chk" >> "$seqres.full" -_pwrite_byte 0x61 $((blksz * 2)) $((blksz * 255)) "$testdir/file2.chk" >> "$seqres.full" -_reflink_range "$testdir/file1" $blksz "$testdir/file2" $((blksz * 2)) 0 >> "$seqres.full" +_pwrite_byte 0x61 0 $((blksz * 256)) $testdir/file1 >> $seqres.full +_pwrite_byte 0x62 0 $((blksz * 256)) $testdir/file2 >> $seqres.full +_pwrite_byte 0x62 0 $((blksz * 2)) $testdir/file2.chk >> $seqres.full +_pwrite_byte 0x61 $((blksz * 2)) $((blksz * 255)) $testdir/file2.chk >> $seqres.full +_reflink_range $testdir/file1 $blksz $testdir/file2 $((blksz * 2)) 0 >> $seqres.full _test_remount -md5sum "$testdir/file1" | _filter_test_dir -md5sum "$testdir/file2" | _filter_test_dir -md5sum "$testdir/file2.chk" | _filter_test_dir +md5sum $testdir/file1 | _filter_test_dir +md5sum $testdir/file2 | _filter_test_dir +md5sum $testdir/file2.chk | _filter_test_dir -c1="$(_md5_checksum "$testdir/file1")" -c2="$(_md5_checksum "$testdir/file2")" +c1=$(_md5_checksum $testdir/file1) +c2=$(_md5_checksum $testdir/file2) -test "${c1}" != "${c2}" || echo "file1 and file2 should not match" +test ${c1} != ${c2} || echo "file1 and file2 should not match" echo "Compare against check files" -cmp -s "$testdir/file2" "$testdir/file2.chk" || echo "file2 and file2.chk do not match" +cmp -s $testdir/file2 $testdir/file2.chk || echo "file2 and file2.chk do not match" # success, all done status=0 diff --git a/tests/generic/182 b/tests/generic/182 index ef10af8..fddacc4 100755 --- a/tests/generic/182 +++ b/tests/generic/182 @@ -23,8 +23,8 @@ # Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA #----------------------------------------------------------------------- -seq=`basename "$0"` -seqres="$RESULT_DIR/$seq" +seq=`basename $0` +seqres=$RESULT_DIR/$seq echo "QA output created by $seq" here=`pwd` @@ -35,7 +35,7 @@ trap "_cleanup; exit \$status" 0 1 2 3 15 _cleanup() { cd / - rm -rf "$tmp".* "$testdir" + rm -rf $tmp.* $testdir } # get standard environment, filters and checks @@ -47,69 +47,69 @@ _cleanup() _supported_os Linux _require_test_dedupe -rm -f "$seqres.full" +rm -f $seqres.full -testdir="$TEST_DIR/test-$seq" -rm -rf "$testdir" -mkdir "$testdir" +testdir=$TEST_DIR/test-$seq +rm -rf $testdir +mkdir $testdir echo "Create the original files" blksz=65536 -_pwrite_byte 0x61 0 $((blksz * 256)) "$testdir/file1" >> "$seqres.full" -_pwrite_byte 0x62 0 $((blksz * 257)) "$testdir/file2" >> "$seqres.full" -_pwrite_byte 0x62 0 $((blksz * 257)) "$testdir/file2.chk" >> "$seqres.full" -_dedupe_range "$testdir/file1" $blksz "$testdir/file2" $((blksz * 2)) 0 >> "$seqres.full" +_pwrite_byte 0x61 0 $((blksz * 256)) $testdir/file1 >> $seqres.full +_pwrite_byte 0x62 0 $((blksz * 257)) $testdir/file2 >> $seqres.full +_pwrite_byte 0x62 0 $((blksz * 257)) $testdir/file2.chk >> $seqres.full +_dedupe_range $testdir/file1 $blksz $testdir/file2 $((blksz * 2)) 0 >> $seqres.full _test_remount -md5sum "$testdir/file1" | _filter_test_dir -md5sum "$testdir/file2" | _filter_test_dir -md5sum "$testdir/file2.chk" | _filter_test_dir +md5sum $testdir/file1 | _filter_test_dir +md5sum $testdir/file2 | _filter_test_dir +md5sum $testdir/file2.chk | _filter_test_dir -c1="$(_md5_checksum "$testdir/file1")" -c2="$(_md5_checksum "$testdir/file2")" +c1=$(_md5_checksum $testdir/file1) +c2=$(_md5_checksum $testdir/file2) -test "${c1}" != "${c2}" || echo "file1 and file2 should not match" +test ${c1} != ${c2} || echo "file1 and file2 should not match" echo "Compare against check files" -cmp -s "$testdir/file2" "$testdir/file2.chk" || echo "file2 and file2.chk do not match" +cmp -s $testdir/file2 $testdir/file2.chk || echo "file2 and file2.chk do not match" echo "Make the original file almost dedup-able" -_pwrite_byte 0x61 0 $((blksz * 256)) "$testdir/file1" >> "$seqres.full" -_pwrite_byte 0x61 0 $((blksz * 256)) "$testdir/file2" >> "$seqres.full" -_pwrite_byte 0x61 0 $((blksz * 256)) "$testdir/file2.chk" >> "$seqres.full" -_dedupe_range "$testdir/file1" $blksz "$testdir/file2" $((blksz * 2)) 0 >> "$seqres.full" +_pwrite_byte 0x61 0 $((blksz * 256)) $testdir/file1 >> $seqres.full +_pwrite_byte 0x61 0 $((blksz * 256)) $testdir/file2 >> $seqres.full +_pwrite_byte 0x61 0 $((blksz * 256)) $testdir/file2.chk >> $seqres.full +_dedupe_range $testdir/file1 $blksz $testdir/file2 $((blksz * 2)) 0 >> $seqres.full _test_remount -md5sum "$testdir/file1" | _filter_test_dir -md5sum "$testdir/file2" | _filter_test_dir -md5sum "$testdir/file2.chk" | _filter_test_dir +md5sum $testdir/file1 | _filter_test_dir +md5sum $testdir/file2 | _filter_test_dir +md5sum $testdir/file2.chk | _filter_test_dir -c1="$(_md5_checksum "$testdir/file1")" -c2="$(_md5_checksum "$testdir/file2")" +c1=$(_md5_checksum $testdir/file1) +c2=$(_md5_checksum $testdir/file2) -test "${c1}" != "${c2}" || echo "file1 and file2 should not match" +test ${c1} != ${c2} || echo "file1 and file2 should not match" echo "Compare against check files" -cmp -s "$testdir/file2" "$testdir/file2.chk" || echo "file2 and file2.chk do not match" +cmp -s $testdir/file2 $testdir/file2.chk || echo "file2 and file2.chk do not match" echo "Make the original file dedup-able" -_pwrite_byte 0x61 0 $((blksz * 256)) "$testdir/file1" >> "$seqres.full" -_pwrite_byte 0x61 0 $((blksz * 257)) "$testdir/file2" >> "$seqres.full" -_pwrite_byte 0x61 0 $((blksz * 257)) "$testdir/file2.chk" >> "$seqres.full" -_dedupe_range "$testdir/file1" $blksz "$testdir/file2" $((blksz * 2)) 0 >> "$seqres.full" +_pwrite_byte 0x61 0 $((blksz * 256)) $testdir/file1 >> $seqres.full +_pwrite_byte 0x61 0 $((blksz * 257)) $testdir/file2 >> $seqres.full +_pwrite_byte 0x61 0 $((blksz * 257)) $testdir/file2.chk >> $seqres.full +_dedupe_range $testdir/file1 $blksz $testdir/file2 $((blksz * 2)) 0 >> $seqres.full _test_remount -md5sum "$testdir/file1" | _filter_test_dir -md5sum "$testdir/file2" | _filter_test_dir -md5sum "$testdir/file2.chk" | _filter_test_dir +md5sum $testdir/file1 | _filter_test_dir +md5sum $testdir/file2 | _filter_test_dir +md5sum $testdir/file2.chk | _filter_test_dir -c1="$(_md5_checksum "$testdir/file1")" -c2="$(_md5_checksum "$testdir/file2")" +c1=$(_md5_checksum $testdir/file1) +c2=$(_md5_checksum $testdir/file2) -test "${c1}" = "${c2}" || echo "file1 and file2 should match" +test ${c1} = ${c2} || echo "file1 and file2 should match" echo "Compare against check files" -cmp -s "$testdir/file2" "$testdir/file2.chk" || echo "file2 and file2.chk do not match" +cmp -s $testdir/file2 $testdir/file2.chk || echo "file2 and file2.chk do not match" # success, all done status=0 diff --git a/tests/generic/183 b/tests/generic/183 index c928acd..0f35da2 100755 --- a/tests/generic/183 +++ b/tests/generic/183 @@ -26,8 +26,8 @@ # Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA #----------------------------------------------------------------------- -seq=`basename "$0"` -seqres="$RESULT_DIR/$seq" +seq=`basename $0` +seqres=$RESULT_DIR/$seq echo "QA output created by $seq" here=`pwd` @@ -38,7 +38,7 @@ trap "_cleanup; exit \$status" 0 1 2 3 15 _cleanup() { cd / - rm -rf "$tmp".* "$testdir" + rm -rf $tmp.* $testdir } # get standard environment, filters and checks @@ -50,47 +50,49 @@ _cleanup() _supported_os Linux _require_scratch_reflink -rm -f "$seqres.full" +rm -f $seqres.full echo "Format and mount" -_scratch_mkfs > "$seqres.full" 2>&1 -_scratch_mount >> "$seqres.full" 2>&1 +_scratch_mkfs > $seqres.full 2>&1 +_scratch_mount >> $seqres.full 2>&1 -testdir="$SCRATCH_MNT/test-$seq" -rm -rf $testdir +testdir=$SCRATCH_MNT/test-$seq mkdir $testdir echo "Create the original files" blksz=65536 nr=64 -_pwrite_byte 0x61 0 $((blksz * nr)) "$testdir/file1" >> "$seqres.full" -_pwrite_byte 0x62 0 $((blksz * nr)) "$testdir/file2" >> "$seqres.full" +filesize=$((blksz * nr)) +_pwrite_byte 0x61 0 $filesize $testdir/file1 >> $seqres.full +_pwrite_byte 0x62 0 $filesize $testdir/file2 >> $seqres.full seq 0 2 $((nr-1)) | while read f; do - _reflink_range "$testdir/file1" $((blksz * f)) "$testdir/file3" $((blksz * f)) $blksz >> "$seqres.full" - _pwrite_byte 0x61 $((blksz * f)) $blksz "$testdir/file3.chk" >> "$seqres.full" + _reflink_range $testdir/file1 $((blksz * f)) $testdir/file3 $((blksz * f)) $blksz >> $seqres.full + _pwrite_byte 0x61 $((blksz * f)) $blksz $testdir/file3.chk >> $seqres.full done seq 1 2 $((nr-1)) | while read f; do - _reflink_range "$testdir/file2" $((blksz * f)) "$testdir/file3" $((blksz * f)) $blksz >> "$seqres.full" - _pwrite_byte 0x62 $((blksz * f)) $blksz "$testdir/file3.chk" >> "$seqres.full" + _reflink_range $testdir/file2 $((blksz * f)) $testdir/file3 $((blksz * f)) $blksz >> $seqres.full + _pwrite_byte 0x62 $((blksz * f)) $blksz $testdir/file3.chk >> $seqres.full done _scratch_remount echo "Compare files" -md5sum "$testdir/file1" | _filter_scratch -md5sum "$testdir/file2" | _filter_scratch -md5sum "$testdir/file3" | _filter_scratch -md5sum "$testdir/file3.chk" | _filter_scratch +md5sum $testdir/file1 | _filter_scratch +md5sum $testdir/file2 | _filter_scratch +md5sum $testdir/file3 | _filter_scratch +md5sum $testdir/file3.chk | _filter_scratch echo "directio CoW across the transition" -"$XFS_IO_PROG" -d -f -c "pwrite -S 0x63 -b $((blksz * nr / 2)) $((blksz * nr / 4)) $((blksz * nr / 2))" "$testdir/file3" >> "$seqres.full" -_pwrite_byte 0x63 $((blksz * nr / 4)) $((blksz * nr / 2)) "$testdir/file3.chk" >> "$seqres.full" +cowoff=$((filesize / 4)) +cowsz=$((filesize / 2)) +$XFS_IO_PROG -d -f -c "pwrite -S 0x63 -b $cowsz $cowoff $cowsz" $testdir/file3 >> $seqres.full +_pwrite_byte 0x63 $cowoff $cowsz $testdir/file3.chk >> $seqres.full _scratch_remount echo "Compare files" -md5sum "$testdir/file1" | _filter_scratch -md5sum "$testdir/file2" | _filter_scratch -md5sum "$testdir/file3" | _filter_scratch -md5sum "$testdir/file3.chk" | _filter_scratch +md5sum $testdir/file1 | _filter_scratch +md5sum $testdir/file2 | _filter_scratch +md5sum $testdir/file3 | _filter_scratch +md5sum $testdir/file3.chk | _filter_scratch # success, all done status=0 diff --git a/tests/generic/185 b/tests/generic/185 index fb05e6d..28826d0 100755 --- a/tests/generic/185 +++ b/tests/generic/185 @@ -26,8 +26,8 @@ # Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA #----------------------------------------------------------------------- -seq=`basename "$0"` -seqres="$RESULT_DIR/$seq" +seq=`basename $0` +seqres=$RESULT_DIR/$seq echo "QA output created by $seq" here=`pwd` @@ -38,7 +38,7 @@ trap "_cleanup; exit \$status" 0 1 2 3 15 _cleanup() { cd / - rm -rf "$tmp".* "$testdir" + rm -rf $tmp.* $testdir } # get standard environment, filters and checks @@ -50,47 +50,49 @@ _cleanup() _supported_os Linux _require_scratch_reflink -rm -f "$seqres.full" +rm -f $seqres.full echo "Format and mount" -_scratch_mkfs > "$seqres.full" 2>&1 -_scratch_mount >> "$seqres.full" 2>&1 +_scratch_mkfs > $seqres.full 2>&1 +_scratch_mount >> $seqres.full 2>&1 -testdir="$SCRATCH_MNT/test-$seq" -rm -rf $testdir +testdir=$SCRATCH_MNT/test-$seq mkdir $testdir echo "Create the original files" blksz=65536 nr=64 -_pwrite_byte 0x61 0 $((blksz * nr)) "$testdir/file1" >> "$seqres.full" -_pwrite_byte 0x62 0 $((blksz * nr)) "$testdir/file2" >> "$seqres.full" +filesize=$((blksz * nr)) +_pwrite_byte 0x61 0 $filesize $testdir/file1 >> $seqres.full +_pwrite_byte 0x62 0 $filesize $testdir/file2 >> $seqres.full seq 0 2 $((nr-1)) | while read f; do - _reflink_range "$testdir/file1" $((blksz * f)) "$testdir/file3" $((blksz * f)) $blksz >> "$seqres.full" - _pwrite_byte 0x61 $((blksz * f)) $blksz "$testdir/file3.chk" >> "$seqres.full" + _reflink_range $testdir/file1 $((blksz * f)) $testdir/file3 $((blksz * f)) $blksz >> $seqres.full + _pwrite_byte 0x61 $((blksz * f)) $blksz $testdir/file3.chk >> $seqres.full done seq 1 2 $((nr-1)) | while read f; do - _reflink_range "$testdir/file2" $((blksz * f)) "$testdir/file3" $((blksz * f)) $blksz >> "$seqres.full" - _pwrite_byte 0x62 $((blksz * f)) $blksz "$testdir/file3.chk" >> "$seqres.full" + _reflink_range $testdir/file2 $((blksz * f)) $testdir/file3 $((blksz * f)) $blksz >> $seqres.full + _pwrite_byte 0x62 $((blksz * f)) $blksz $testdir/file3.chk >> $seqres.full done _scratch_remount echo "Compare files" -md5sum "$testdir/file1" | _filter_scratch -md5sum "$testdir/file2" | _filter_scratch -md5sum "$testdir/file3" | _filter_scratch -md5sum "$testdir/file3.chk" | _filter_scratch +md5sum $testdir/file1 | _filter_scratch +md5sum $testdir/file2 | _filter_scratch +md5sum $testdir/file3 | _filter_scratch +md5sum $testdir/file3.chk | _filter_scratch echo "CoW across the transition" -_pwrite_byte 0x63 $((blksz * nr / 4)) $((blksz * nr / 2)) "$testdir/file3" >> "$seqres.full" -_pwrite_byte 0x63 $((blksz * nr / 4)) $((blksz * nr / 2)) "$testdir/file3.chk" >> "$seqres.full" +cowoff=$((filesize / 4)) +cowsz=$((filesize / 2)) +_pwrite_byte 0x63 $cowoff $cowsz $testdir/file3 >> $seqres.full +_pwrite_byte 0x63 $cowoff $cowsz $testdir/file3.chk >> $seqres.full _scratch_remount echo "Compare files" -md5sum "$testdir/file1" | _filter_scratch -md5sum "$testdir/file2" | _filter_scratch -md5sum "$testdir/file3" | _filter_scratch -md5sum "$testdir/file3.chk" | _filter_scratch +md5sum $testdir/file1 | _filter_scratch +md5sum $testdir/file2 | _filter_scratch +md5sum $testdir/file3 | _filter_scratch +md5sum $testdir/file3.chk | _filter_scratch # success, all done status=0 diff --git a/tests/generic/186 b/tests/generic/186 index e495cbc..9839a22 100755 --- a/tests/generic/186 +++ b/tests/generic/186 @@ -28,8 +28,8 @@ # Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA #----------------------------------------------------------------------- -seq=`basename "$0"` -seqres="$RESULT_DIR/$seq" +seq=`basename $0` +seqres=$RESULT_DIR/$seq echo "QA output created by $seq" here=`pwd` @@ -40,7 +40,7 @@ trap "_cleanup; exit \$status" 0 1 2 3 15 _cleanup() { cd / -# rm -rf "$tmp".* "$testdir" +# rm -rf $tmp.* $testdir } # get standard environment, filters and checks @@ -54,88 +54,91 @@ _require_scratch_reflink _require_cp_reflink _require_xfs_io_command "falloc" _require_xfs_io_command "fpunch" -test "$FSTYP" = "btrfs" && _notrun "Can't fragment free space on btrfs." +test $FSTYP = "btrfs" && _notrun "Can't fragment free space on btrfs." -rm -f "$seqres.full" +rm -f $seqres.full _fragment_freesp() { - file="$1" + file=$1 # consume nearly all available space (leave ~1MB) avail=`_get_available_space $SCRATCH_MNT` echo "$avail bytes left" filesize=$((avail - 1048576)) - $XFS_IO_PROG -fc "truncate $filesize" "$file" + $XFS_IO_PROG -fc "truncate $filesize" $file chunks=20 chunksizemb=$((filesize / chunks / 1048576)) seq 1 $chunks | while read f; do echo "$((f * chunksizemb)) file size $f / 20" - $XFS_IO_PROG -fc "falloc -k $(( (f - 1) * chunksizemb))m ${chunksizemb}m" "$file" + $XFS_IO_PROG -fc "falloc -k $(( (f - 1) * chunksizemb))m ${chunksizemb}m" $file done chunks=100 chunksizemb=$((filesize / chunks / 1048576)) seq 80 $chunks | while read f; do echo "$((f * chunksizemb)) file size $f / $chunks" - $XFS_IO_PROG -fc "falloc -k $(( (f - 1) * chunksizemb))m ${chunksizemb}m" "$file" + $XFS_IO_PROG -fc "falloc -k $(( (f - 1) * chunksizemb))m ${chunksizemb}m" $file done filesizemb=$((filesize / 1048576)) - $XFS_IO_PROG -fc "falloc -k 0 ${filesizemb}m" "$file" + $XFS_IO_PROG -fc "falloc -k 0 ${filesizemb}m" $file # Try again anyway avail=`_get_available_space $SCRATCH_MNT` - $XFS_IO_PROG -fc "pwrite -S 0x65 0 $avail" "${file}.${i}" + $XFS_IO_PROG -fc "pwrite -S 0x65 0 $avail" ${file}.${i} # Punch out whatever we need seq 1 $((nr * 4)) | while read f; do - $XFS_IO_PROG -f -c "fpunch $((f * 2 * blksz)) $blksz" "$file" + $XFS_IO_PROG -f -c "fpunch $((f * 2 * blksz)) $blksz" $file done } echo "Format and mount" -_scratch_mkfs > "$seqres.full" 2>&1 -_scratch_mount >> "$seqres.full" 2>&1 +_scratch_mkfs > $seqres.full 2>&1 +_scratch_mount >> $seqres.full 2>&1 -testdir="$SCRATCH_MNT/test-$seq" -rm -rf $testdir +testdir=$SCRATCH_MNT/test-$seq mkdir $testdir echo "Create the original files" blksz=65536 nr=1024 -_pwrite_byte 0x61 0 $((blksz * nr)) "$testdir/file1" >> "$seqres.full" -_pwrite_byte 0x62 0 $((blksz * nr)) "$testdir/file2" >> "$seqres.full" +filesize=$((blksz * nr)) +_pwrite_byte 0x61 0 $filesize $testdir/file1 >> $seqres.full +_pwrite_byte 0x62 0 $filesize $testdir/file2 >> $seqres.full seq 0 2 $((nr-1)) | while read f; do - _reflink_range "$testdir/file1" $((blksz * f)) "$testdir/file3" $((blksz * f)) $blksz >> "$seqres.full" - _pwrite_byte 0x61 $((blksz * f)) $blksz "$testdir/file3.chk" >> "$seqres.full" + _reflink_range $testdir/file1 $((blksz * f)) $testdir/file3 $((blksz * f)) $blksz >> $seqres.full + _pwrite_byte 0x61 $((blksz * f)) $blksz $testdir/file3.chk >> $seqres.full done seq 1 2 $((nr-1)) | while read f; do - _reflink_range "$testdir/file2" $((blksz * f)) "$testdir/file3" $((blksz * f)) $blksz >> "$seqres.full" - _pwrite_byte 0x62 $((blksz * f)) $blksz "$testdir/file3.chk" >> "$seqres.full" + _reflink_range $testdir/file2 $((blksz * f)) $testdir/file3 $((blksz * f)) $blksz >> $seqres.full + _pwrite_byte 0x62 $((blksz * f)) $blksz $testdir/file3.chk >> $seqres.full done _scratch_remount -_fragment_freesp "$testdir/bigfile" >> "$seqres.full" 2>&1 +_fragment_freesp $testdir/bigfile >> $seqres.full 2>&1 +filesize=$((blksz * nr)) _scratch_remount echo "Compare files" -md5sum "$testdir/file1" | _filter_scratch -md5sum "$testdir/file2" | _filter_scratch -md5sum "$testdir/file3" | _filter_scratch -md5sum "$testdir/file3.chk" | _filter_scratch +md5sum $testdir/file1 | _filter_scratch +md5sum $testdir/file2 | _filter_scratch +md5sum $testdir/file3 | _filter_scratch +md5sum $testdir/file3.chk | _filter_scratch echo "CoW with multiple extents?" -"$XFS_IO_PROG" -f -c "pwrite -S 0x63 -b $((blksz * nr / 2)) $((blksz * nr / 4)) $((blksz * nr / 2))" "$testdir/file3" >> "$seqres.full" -_pwrite_byte 0x63 $((blksz * nr / 4)) $((blksz * nr / 2)) "$testdir/file3.chk" >> "$seqres.full" +cowoff=$((filesize / 4)) +cowsz=$((filesize / 2)) +$XFS_IO_PROG -f -c "pwrite -S 0x63 -b $cowsz $cowoff $cowsz" $testdir/file3 >> $seqres.full +_pwrite_byte 0x63 $cowoff $cowsz $testdir/file3.chk >> $seqres.full _scratch_remount echo "Compare files" -md5sum "$testdir/file1" | _filter_scratch -md5sum "$testdir/file2" | _filter_scratch -md5sum "$testdir/file3" | _filter_scratch -md5sum "$testdir/file3.chk" | _filter_scratch +md5sum $testdir/file1 | _filter_scratch +md5sum $testdir/file2 | _filter_scratch +md5sum $testdir/file3 | _filter_scratch +md5sum $testdir/file3.chk | _filter_scratch # success, all done status=0 diff --git a/tests/generic/187 b/tests/generic/187 index e3461ab..b8fade2 100755 --- a/tests/generic/187 +++ b/tests/generic/187 @@ -28,8 +28,8 @@ # Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA #----------------------------------------------------------------------- -seq=`basename "$0"` -seqres="$RESULT_DIR/$seq" +seq=`basename $0` +seqres=$RESULT_DIR/$seq echo "QA output created by $seq" here=`pwd` @@ -40,7 +40,7 @@ trap "_cleanup; exit \$status" 0 1 2 3 15 _cleanup() { cd / -# rm -rf "$tmp".* "$testdir" +# rm -rf $tmp.* $testdir } # get standard environment, filters and checks @@ -54,88 +54,91 @@ _require_scratch_reflink _require_cp_reflink _require_xfs_io_command "falloc" _require_xfs_io_command "fpunch" -test "$FSTYP" = "btrfs" && _notrun "Can't fragment free space on btrfs." +test $FSTYP = "btrfs" && _notrun "Can't fragment free space on btrfs." -rm -f "$seqres.full" +rm -f $seqres.full _fragment_freesp() { - file="$1" + file=$1 # consume nearly all available space (leave ~1MB) avail=`_get_available_space $SCRATCH_MNT` echo "$avail bytes left" filesize=$((avail - 1048576)) - $XFS_IO_PROG -fc "truncate $filesize" "$file" + $XFS_IO_PROG -fc "truncate $filesize" $file chunks=20 chunksizemb=$((filesize / chunks / 1048576)) seq 1 $chunks | while read f; do echo "$((f * chunksizemb)) file size $f / 20" - $XFS_IO_PROG -fc "falloc -k $(( (f - 1) * chunksizemb))m ${chunksizemb}m" "$file" + $XFS_IO_PROG -fc "falloc -k $(( (f - 1) * chunksizemb))m ${chunksizemb}m" $file done chunks=100 chunksizemb=$((filesize / chunks / 1048576)) seq 80 $chunks | while read f; do echo "$((f * chunksizemb)) file size $f / $chunks" - $XFS_IO_PROG -fc "falloc -k $(( (f - 1) * chunksizemb))m ${chunksizemb}m" "$file" + $XFS_IO_PROG -fc "falloc -k $(( (f - 1) * chunksizemb))m ${chunksizemb}m" $file done filesizemb=$((filesize / 1048576)) - $XFS_IO_PROG -fc "falloc -k 0 ${filesizemb}m" "$file" + $XFS_IO_PROG -fc "falloc -k 0 ${filesizemb}m" $file # Try again anyway avail=`_get_available_space $SCRATCH_MNT` - $XFS_IO_PROG -fc "pwrite -S 0x65 0 $avail" "${file}.${i}" + $XFS_IO_PROG -fc "pwrite -S 0x65 0 $avail" ${file}.${i} # Punch out whatever we need seq 1 $((nr * 4)) | while read f; do - $XFS_IO_PROG -f -c "fpunch $((f * 2 * blksz)) $blksz" "$file" + $XFS_IO_PROG -f -c "fpunch $((f * 2 * blksz)) $blksz" $file done } echo "Format and mount" -_scratch_mkfs > "$seqres.full" 2>&1 -_scratch_mount >> "$seqres.full" 2>&1 +_scratch_mkfs > $seqres.full 2>&1 +_scratch_mount >> $seqres.full 2>&1 -testdir="$SCRATCH_MNT/test-$seq" -rm -rf $testdir +testdir=$SCRATCH_MNT/test-$seq mkdir $testdir echo "Create the original files" blksz=65536 nr=1024 -_pwrite_byte 0x61 0 $((blksz * nr)) "$testdir/file1" >> "$seqres.full" -_pwrite_byte 0x62 0 $((blksz * nr)) "$testdir/file2" >> "$seqres.full" +filesize=$((blksz * nr)) +_pwrite_byte 0x61 0 $filesize $testdir/file1 >> $seqres.full +_pwrite_byte 0x62 0 $filesize $testdir/file2 >> $seqres.full seq 0 2 $((nr-1)) | while read f; do - _reflink_range "$testdir/file1" $((blksz * f)) "$testdir/file3" $((blksz * f)) $blksz >> "$seqres.full" - _pwrite_byte 0x61 $((blksz * f)) $blksz "$testdir/file3.chk" >> "$seqres.full" + _reflink_range $testdir/file1 $((blksz * f)) $testdir/file3 $((blksz * f)) $blksz >> $seqres.full + _pwrite_byte 0x61 $((blksz * f)) $blksz $testdir/file3.chk >> $seqres.full done seq 1 2 $((nr-1)) | while read f; do - _reflink_range "$testdir/file2" $((blksz * f)) "$testdir/file3" $((blksz * f)) $blksz >> "$seqres.full" - _pwrite_byte 0x62 $((blksz * f)) $blksz "$testdir/file3.chk" >> "$seqres.full" + _reflink_range $testdir/file2 $((blksz * f)) $testdir/file3 $((blksz * f)) $blksz >> $seqres.full + _pwrite_byte 0x62 $((blksz * f)) $blksz $testdir/file3.chk >> $seqres.full done _scratch_remount -_fragment_freesp "$testdir/bigfile" >> "$seqres.full" 2>&1 +_fragment_freesp $testdir/bigfile >> $seqres.full 2>&1 +filesize=$((blksz * nr)) _scratch_remount echo "Compare files" -md5sum "$testdir/file1" | _filter_scratch -md5sum "$testdir/file2" | _filter_scratch -md5sum "$testdir/file3" | _filter_scratch -md5sum "$testdir/file3.chk" | _filter_scratch +md5sum $testdir/file1 | _filter_scratch +md5sum $testdir/file2 | _filter_scratch +md5sum $testdir/file3 | _filter_scratch +md5sum $testdir/file3.chk | _filter_scratch echo "CoW with multiple extents?" -"$XFS_IO_PROG" -d -f -c "pwrite -S 0x63 -b $((blksz * nr / 2)) $((blksz * nr / 4)) $((blksz * nr / 2))" "$testdir/file3" >> "$seqres.full" -_pwrite_byte 0x63 $((blksz * nr / 4)) $((blksz * nr / 2)) "$testdir/file3.chk" >> "$seqres.full" +cowoff=$((filesize / 4)) +cowsz=$((filesize / 2)) +$XFS_IO_PROG -d -f -c "pwrite -S 0x63 -b $cowsz $cowoff $cowsz" $testdir/file3 >> $seqres.full +_pwrite_byte 0x63 $cowoff $cowsz $testdir/file3.chk >> $seqres.full _scratch_remount echo "Compare files" -md5sum "$testdir/file1" | _filter_scratch -md5sum "$testdir/file2" | _filter_scratch -md5sum "$testdir/file3" | _filter_scratch -md5sum "$testdir/file3.chk" | _filter_scratch +md5sum $testdir/file1 | _filter_scratch +md5sum $testdir/file2 | _filter_scratch +md5sum $testdir/file3 | _filter_scratch +md5sum $testdir/file3.chk | _filter_scratch # success, all done status=0 diff --git a/tests/generic/188 b/tests/generic/188 index 86980cc..7be1080 100755 --- a/tests/generic/188 +++ b/tests/generic/188 @@ -25,8 +25,8 @@ # Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA #----------------------------------------------------------------------- -seq=`basename "$0"` -seqres="$RESULT_DIR/$seq" +seq=`basename $0` +seqres=$RESULT_DIR/$seq echo "QA output created by $seq" here=`pwd` @@ -37,7 +37,7 @@ trap "_cleanup; exit \$status" 0 1 2 3 15 _cleanup() { cd / - rm -rf "$tmp".* "$testdir" + rm -rf $tmp.* $testdir } # get standard environment, filters and checks @@ -50,36 +50,38 @@ _supported_os Linux _require_scratch_reflink _require_xfs_io_command "falloc" -rm -f "$seqres.full" +rm -f $seqres.full echo "Format and mount" -_scratch_mkfs > "$seqres.full" 2>&1 -_scratch_mount >> "$seqres.full" 2>&1 +_scratch_mkfs > $seqres.full 2>&1 +_scratch_mount >> $seqres.full 2>&1 -testdir="$SCRATCH_MNT/test-$seq" -rm -rf $testdir +testdir=$SCRATCH_MNT/test-$seq mkdir $testdir echo "Create the original files" blksz=65536 nr=64 +filesize=$((blksz * nr)) _weave_reflink_unwritten $blksz $nr $testdir/file1 $testdir/file3 >> $seqres.full _scratch_remount echo "Compare files" -md5sum "$testdir/file1" | _filter_scratch -md5sum "$testdir/file3" | _filter_scratch -md5sum "$testdir/file3.chk" | _filter_scratch +md5sum $testdir/file1 | _filter_scratch +md5sum $testdir/file3 | _filter_scratch +md5sum $testdir/file3.chk | _filter_scratch echo "directio CoW across the transition" -"$XFS_IO_PROG" -d -f -c "pwrite -S 0x63 -b $((blksz * nr / 2)) $((blksz * nr / 4)) $((blksz * nr / 2))" "$testdir/file3" >> "$seqres.full" -_pwrite_byte 0x63 $((blksz * nr / 4)) $((blksz * nr / 2)) "$testdir/file3.chk" >> "$seqres.full" +cowoff=$((filesize / 4)) +cowsz=$((filesize / 2)) +$XFS_IO_PROG -d -f -c "pwrite -S 0x63 -b $cowsz $cowoff $cowsz" $testdir/file3 >> $seqres.full +_pwrite_byte 0x63 $cowoff $cowsz $testdir/file3.chk >> $seqres.full _scratch_remount echo "Compare files" -md5sum "$testdir/file1" | _filter_scratch -md5sum "$testdir/file3" | _filter_scratch -md5sum "$testdir/file3.chk" | _filter_scratch +md5sum $testdir/file1 | _filter_scratch +md5sum $testdir/file3 | _filter_scratch +md5sum $testdir/file3.chk | _filter_scratch # success, all done status=0 diff --git a/tests/generic/189 b/tests/generic/189 index 8f5a338..5b409be 100755 --- a/tests/generic/189 +++ b/tests/generic/189 @@ -25,8 +25,8 @@ # Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA #----------------------------------------------------------------------- -seq=`basename "$0"` -seqres="$RESULT_DIR/$seq" +seq=`basename $0` +seqres=$RESULT_DIR/$seq echo "QA output created by $seq" here=`pwd` @@ -37,7 +37,7 @@ trap "_cleanup; exit \$status" 0 1 2 3 15 _cleanup() { cd / - rm -rf "$tmp".* "$testdir" + rm -rf $tmp.* $testdir } # get standard environment, filters and checks @@ -50,36 +50,38 @@ _supported_os Linux _require_scratch_reflink _require_xfs_io_command "falloc" -rm -f "$seqres.full" +rm -f $seqres.full echo "Format and mount" -_scratch_mkfs > "$seqres.full" 2>&1 -_scratch_mount >> "$seqres.full" 2>&1 +_scratch_mkfs > $seqres.full 2>&1 +_scratch_mount >> $seqres.full 2>&1 -testdir="$SCRATCH_MNT/test-$seq" -rm -rf $testdir +testdir=$SCRATCH_MNT/test-$seq mkdir $testdir echo "Create the original files" blksz=65536 nr=64 +filesize=$((blksz * nr)) _weave_reflink_unwritten $blksz $nr $testdir/file1 $testdir/file3 >> $seqres.full _scratch_remount echo "Compare files" -md5sum "$testdir/file1" | _filter_scratch -md5sum "$testdir/file3" | _filter_scratch -md5sum "$testdir/file3.chk" | _filter_scratch +md5sum $testdir/file1 | _filter_scratch +md5sum $testdir/file3 | _filter_scratch +md5sum $testdir/file3.chk | _filter_scratch echo "CoW across the transition" -"$XFS_IO_PROG" -f -c "pwrite -S 0x63 -b $((blksz * nr / 2)) $((blksz * nr / 4)) $((blksz * nr / 2))" "$testdir/file3" >> "$seqres.full" -_pwrite_byte 0x63 $((blksz * nr / 4)) $((blksz * nr / 2)) "$testdir/file3.chk" >> "$seqres.full" +cowoff=$((filesize / 4)) +cowsz=$((filesize / 2)) +$XFS_IO_PROG -f -c "pwrite -S 0x63 -b $cowsz $cowoff $cowsz" $testdir/file3 >> $seqres.full +_pwrite_byte 0x63 $cowoff $cowsz $testdir/file3.chk >> $seqres.full _scratch_remount echo "Compare files" -md5sum "$testdir/file1" | _filter_scratch -md5sum "$testdir/file3" | _filter_scratch -md5sum "$testdir/file3.chk" | _filter_scratch +md5sum $testdir/file1 | _filter_scratch +md5sum $testdir/file3 | _filter_scratch +md5sum $testdir/file3.chk | _filter_scratch # success, all done status=0 diff --git a/tests/generic/190 b/tests/generic/190 index 8edfeb7..a5c2137 100755 --- a/tests/generic/190 +++ b/tests/generic/190 @@ -25,8 +25,8 @@ # Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA #----------------------------------------------------------------------- -seq=`basename "$0"` -seqres="$RESULT_DIR/$seq" +seq=`basename $0` +seqres=$RESULT_DIR/$seq echo "QA output created by $seq" here=`pwd` @@ -37,7 +37,7 @@ trap "_cleanup; exit \$status" 0 1 2 3 15 _cleanup() { cd / - rm -rf "$tmp".* "$testdir" + rm -rf $tmp.* $testdir } # get standard environment, filters and checks @@ -50,36 +50,38 @@ _supported_os Linux _require_scratch_reflink _require_xfs_io_command "falloc" -rm -f "$seqres.full" +rm -f $seqres.full echo "Format and mount" -_scratch_mkfs > "$seqres.full" 2>&1 -_scratch_mount >> "$seqres.full" 2>&1 +_scratch_mkfs > $seqres.full 2>&1 +_scratch_mount >> $seqres.full 2>&1 -testdir="$SCRATCH_MNT/test-$seq" -rm -rf $testdir +testdir=$SCRATCH_MNT/test-$seq mkdir $testdir echo "Create the original files" blksz=65536 nr=64 +filesize=$((blksz * nr)) _weave_reflink_holes $blksz $nr $testdir/file1 $testdir/file3 >> $seqres.full _scratch_remount echo "Compare files" -md5sum "$testdir/file1" | _filter_scratch -md5sum "$testdir/file3" | _filter_scratch -md5sum "$testdir/file3.chk" | _filter_scratch +md5sum $testdir/file1 | _filter_scratch +md5sum $testdir/file3 | _filter_scratch +md5sum $testdir/file3.chk | _filter_scratch echo "directio CoW across the transition" -"$XFS_IO_PROG" -d -f -c "pwrite -S 0x63 -b $((blksz * nr / 2)) $((blksz * nr / 4)) $((blksz * nr / 2))" "$testdir/file3" >> "$seqres.full" -_pwrite_byte 0x63 $((blksz * nr / 4)) $((blksz * nr / 2)) "$testdir/file3.chk" >> "$seqres.full" +cowoff=$((filesize / 4)) +cowsz=$((filesize / 2)) +$XFS_IO_PROG -d -f -c "pwrite -S 0x63 -b $cowsz $cowoff $cowsz" $testdir/file3 >> $seqres.full +_pwrite_byte 0x63 $cowoff $cowsz $testdir/file3.chk >> $seqres.full _scratch_remount echo "Compare files" -md5sum "$testdir/file1" | _filter_scratch -md5sum "$testdir/file3" | _filter_scratch -md5sum "$testdir/file3.chk" | _filter_scratch +md5sum $testdir/file1 | _filter_scratch +md5sum $testdir/file3 | _filter_scratch +md5sum $testdir/file3.chk | _filter_scratch # success, all done status=0 diff --git a/tests/generic/191 b/tests/generic/191 index dd97baa..cfedcde 100755 --- a/tests/generic/191 +++ b/tests/generic/191 @@ -25,8 +25,8 @@ # Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA #----------------------------------------------------------------------- -seq=`basename "$0"` -seqres="$RESULT_DIR/$seq" +seq=`basename $0` +seqres=$RESULT_DIR/$seq echo "QA output created by $seq" here=`pwd` @@ -37,7 +37,7 @@ trap "_cleanup; exit \$status" 0 1 2 3 15 _cleanup() { cd / - rm -rf "$tmp".* "$testdir" + rm -rf $tmp.* $testdir } # get standard environment, filters and checks @@ -50,36 +50,38 @@ _supported_os Linux _require_scratch_reflink _require_xfs_io_command "falloc" -rm -f "$seqres.full" +rm -f $seqres.full echo "Format and mount" -_scratch_mkfs > "$seqres.full" 2>&1 -_scratch_mount >> "$seqres.full" 2>&1 +_scratch_mkfs > $seqres.full 2>&1 +_scratch_mount >> $seqres.full 2>&1 -testdir="$SCRATCH_MNT/test-$seq" -rm -rf $testdir +testdir=$SCRATCH_MNT/test-$seq mkdir $testdir echo "Create the original files" blksz=65536 nr=64 +filesize=$((blksz * nr)) _weave_reflink_holes $blksz $nr $testdir/file1 $testdir/file3 >> $seqres.full _scratch_remount echo "Compare files" -md5sum "$testdir/file1" | _filter_scratch -md5sum "$testdir/file3" | _filter_scratch -md5sum "$testdir/file3.chk" | _filter_scratch +md5sum $testdir/file1 | _filter_scratch +md5sum $testdir/file3 | _filter_scratch +md5sum $testdir/file3.chk | _filter_scratch echo "CoW across the transition" -"$XFS_IO_PROG" -f -c "pwrite -S 0x63 -b $((blksz * nr / 2)) $((blksz * nr / 4)) $((blksz * nr / 2))" "$testdir/file3" >> "$seqres.full" -_pwrite_byte 0x63 $((blksz * nr / 4)) $((blksz * nr / 2)) "$testdir/file3.chk" >> "$seqres.full" +cowoff=$((filesize / 4)) +cowsz=$((filesize / 2)) +$XFS_IO_PROG -f -c "pwrite -S 0x63 -b $cowsz $cowoff $cowsz" $testdir/file3 >> $seqres.full +_pwrite_byte 0x63 $cowoff $cowsz $testdir/file3.chk >> $seqres.full _scratch_remount echo "Compare files" -md5sum "$testdir/file1" | _filter_scratch -md5sum "$testdir/file3" | _filter_scratch -md5sum "$testdir/file3.chk" | _filter_scratch +md5sum $testdir/file1 | _filter_scratch +md5sum $testdir/file3 | _filter_scratch +md5sum $testdir/file3.chk | _filter_scratch # success, all done status=0 diff --git a/tests/generic/194 b/tests/generic/194 index 82b3100..69a3e6c 100755 --- a/tests/generic/194 +++ b/tests/generic/194 @@ -26,8 +26,8 @@ # Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA #----------------------------------------------------------------------- -seq=`basename "$0"` -seqres="$RESULT_DIR/$seq" +seq=`basename $0` +seqres=$RESULT_DIR/$seq echo "QA output created by $seq" here=`pwd` @@ -38,7 +38,7 @@ trap "_cleanup; exit \$status" 0 1 2 3 15 _cleanup() { cd / - rm -rf "$tmp".* "$testdir" + rm -rf $tmp.* $testdir } # get standard environment, filters and checks @@ -51,37 +51,39 @@ _supported_os Linux _require_scratch_reflink _require_xfs_io_command "falloc" -rm -f "$seqres.full" +rm -f $seqres.full echo "Format and mount" -_scratch_mkfs > "$seqres.full" 2>&1 -_scratch_mount >> "$seqres.full" 2>&1 +_scratch_mkfs > $seqres.full 2>&1 +_scratch_mount >> $seqres.full 2>&1 -testdir="$SCRATCH_MNT/test-$seq" -rm -rf $testdir +testdir=$SCRATCH_MNT/test-$seq mkdir $testdir echo "Create the original files" blksz=65536 nr=64 +filesize=$((blksz * nr)) _weave_reflink_holes $blksz $nr $testdir/file1 $testdir/file3 >> $seqres.full _scratch_remount echo "Compare files" -md5sum "$testdir/file1" | _filter_scratch -md5sum "$testdir/file3" | _filter_scratch -md5sum "$testdir/file3.chk" | _filter_scratch +md5sum $testdir/file1 | _filter_scratch +md5sum $testdir/file3 | _filter_scratch +md5sum $testdir/file3.chk | _filter_scratch echo "directio CoW across the transition" +cowoff=$((filesize / 4)) +cowsz=$((filesize / 2)) _weave_reflink_holes_delalloc $blksz $nr $testdir/file3 >> $seqres.full -"$XFS_IO_PROG" -d -f -c "pwrite -S 0x63 -b $((blksz * nr / 2)) $((blksz * nr / 4)) $((blksz * nr / 2))" "$testdir/file3" >> "$seqres.full" -_pwrite_byte 0x63 $((blksz * nr / 4)) $((blksz * nr / 2)) "$testdir/file3.chk" >> "$seqres.full" +$XFS_IO_PROG -d -f -c "pwrite -S 0x63 -b $cowsz $cowoff $cowsz" $testdir/file3 >> $seqres.full +_pwrite_byte 0x63 $cowoff $cowsz $testdir/file3.chk >> $seqres.full _scratch_remount echo "Compare files" -md5sum "$testdir/file1" | _filter_scratch -md5sum "$testdir/file3" | _filter_scratch -md5sum "$testdir/file3.chk" | _filter_scratch +md5sum $testdir/file1 | _filter_scratch +md5sum $testdir/file3 | _filter_scratch +md5sum $testdir/file3.chk | _filter_scratch # success, all done status=0 diff --git a/tests/generic/195 b/tests/generic/195 index ce4c0a9..51f10f3 100755 --- a/tests/generic/195 +++ b/tests/generic/195 @@ -26,8 +26,8 @@ # Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA #----------------------------------------------------------------------- -seq=`basename "$0"` -seqres="$RESULT_DIR/$seq" +seq=`basename $0` +seqres=$RESULT_DIR/$seq echo "QA output created by $seq" here=`pwd` @@ -38,7 +38,7 @@ trap "_cleanup; exit \$status" 0 1 2 3 15 _cleanup() { cd / - rm -rf "$tmp".* "$testdir" + rm -rf $tmp.* $testdir } # get standard environment, filters and checks @@ -51,37 +51,39 @@ _supported_os Linux _require_scratch_reflink _require_xfs_io_command "falloc" -rm -f "$seqres.full" +rm -f $seqres.full echo "Format and mount" -_scratch_mkfs > "$seqres.full" 2>&1 -_scratch_mount >> "$seqres.full" 2>&1 +_scratch_mkfs > $seqres.full 2>&1 +_scratch_mount >> $seqres.full 2>&1 -testdir="$SCRATCH_MNT/test-$seq" -rm -rf $testdir +testdir=$SCRATCH_MNT/test-$seq mkdir $testdir echo "Create the original files" blksz=65536 nr=64 +filesize=$((blksz * nr)) _weave_reflink_holes $blksz $nr $testdir/file1 $testdir/file3 >> $seqres.full _scratch_remount echo "Compare files" -md5sum "$testdir/file1" | _filter_scratch -md5sum "$testdir/file3" | _filter_scratch -md5sum "$testdir/file3.chk" | _filter_scratch +md5sum $testdir/file1 | _filter_scratch +md5sum $testdir/file3 | _filter_scratch +md5sum $testdir/file3.chk | _filter_scratch echo "CoW across the transition" +cowoff=$((filesize / 4)) +cowsz=$((filesize / 2)) _weave_reflink_holes_delalloc $blksz $nr $testdir/file3 >> $seqres.full -"$XFS_IO_PROG" -f -c "pwrite -S 0x63 -b $((blksz * nr / 2)) $((blksz * nr / 4)) $((blksz * nr / 2))" "$testdir/file3" >> "$seqres.full" -_pwrite_byte 0x63 $((blksz * nr / 4)) $((blksz * nr / 2)) "$testdir/file3.chk" >> "$seqres.full" +$XFS_IO_PROG -f -c "pwrite -S 0x63 -b $cowsz $cowoff $cowsz" $testdir/file3 >> $seqres.full +_pwrite_byte 0x63 $cowoff $cowsz $testdir/file3.chk >> $seqres.full _scratch_remount echo "Compare files" -md5sum "$testdir/file1" | _filter_scratch -md5sum "$testdir/file3" | _filter_scratch -md5sum "$testdir/file3.chk" | _filter_scratch +md5sum $testdir/file1 | _filter_scratch +md5sum $testdir/file3 | _filter_scratch +md5sum $testdir/file3.chk | _filter_scratch # success, all done status=0 diff --git a/tests/generic/196 b/tests/generic/196 index a7a0035..951079c 100755 --- a/tests/generic/196 +++ b/tests/generic/196 @@ -25,8 +25,8 @@ # Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA #----------------------------------------------------------------------- -seq=`basename "$0"` -seqres="$RESULT_DIR/$seq" +seq=`basename $0` +seqres=$RESULT_DIR/$seq echo "QA output created by $seq" here=`pwd` @@ -37,7 +37,7 @@ trap "_cleanup; exit \$status" 0 1 2 3 15 _cleanup() { cd / - rm -rf "$tmp".* "$testdir" + rm -rf $tmp.* $testdir } # get standard environment, filters and checks @@ -50,36 +50,38 @@ _supported_os Linux _require_scratch_reflink _require_xfs_io_command "falloc" -rm -f "$seqres.full" +rm -f $seqres.full echo "Format and mount" -_scratch_mkfs > "$seqres.full" 2>&1 -_scratch_mount >> "$seqres.full" 2>&1 +_scratch_mkfs > $seqres.full 2>&1 +_scratch_mount >> $seqres.full 2>&1 -testdir="$SCRATCH_MNT/test-$seq" -rm -rf $testdir +testdir=$SCRATCH_MNT/test-$seq mkdir $testdir echo "Create the original files" blksz=65536 nr=64 +filesize=$((blksz * nr)) _weave_reflink_regular $blksz $nr $testdir/file1 $testdir/file3 >> $seqres.full _scratch_remount echo "Compare files" -md5sum "$testdir/file1" | _filter_scratch -md5sum "$testdir/file3" | _filter_scratch -md5sum "$testdir/file3.chk" | _filter_scratch +md5sum $testdir/file1 | _filter_scratch +md5sum $testdir/file3 | _filter_scratch +md5sum $testdir/file3.chk | _filter_scratch echo "directio CoW across the transition" -"$XFS_IO_PROG" -d -f -c "pwrite -S 0x63 -b $((blksz * nr / 2)) $((blksz * nr / 4)) $((blksz * nr / 2))" "$testdir/file3" >> "$seqres.full" -_pwrite_byte 0x63 $((blksz * nr / 4)) $((blksz * nr / 2)) "$testdir/file3.chk" >> "$seqres.full" +cowoff=$((filesize / 4)) +cowsz=$((filesize / 2)) +$XFS_IO_PROG -d -f -c "pwrite -S 0x63 -b $cowsz $cowoff $cowsz" $testdir/file3 >> $seqres.full +_pwrite_byte 0x63 $cowoff $cowsz $testdir/file3.chk >> $seqres.full _scratch_remount echo "Compare files" -md5sum "$testdir/file1" | _filter_scratch -md5sum "$testdir/file3" | _filter_scratch -md5sum "$testdir/file3.chk" | _filter_scratch +md5sum $testdir/file1 | _filter_scratch +md5sum $testdir/file3 | _filter_scratch +md5sum $testdir/file3.chk | _filter_scratch # success, all done status=0 diff --git a/tests/generic/197 b/tests/generic/197 index 84a14ff..cfdbf1b 100755 --- a/tests/generic/197 +++ b/tests/generic/197 @@ -25,8 +25,8 @@ # Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA #----------------------------------------------------------------------- -seq=`basename "$0"` -seqres="$RESULT_DIR/$seq" +seq=`basename $0` +seqres=$RESULT_DIR/$seq echo "QA output created by $seq" here=`pwd` @@ -37,7 +37,7 @@ trap "_cleanup; exit \$status" 0 1 2 3 15 _cleanup() { cd / - rm -rf "$tmp".* "$testdir" + rm -rf $tmp.* $testdir } # get standard environment, filters and checks @@ -50,36 +50,38 @@ _supported_os Linux _require_scratch_reflink _require_xfs_io_command "falloc" -rm -f "$seqres.full" +rm -f $seqres.full echo "Format and mount" -_scratch_mkfs > "$seqres.full" 2>&1 -_scratch_mount >> "$seqres.full" 2>&1 +_scratch_mkfs > $seqres.full 2>&1 +_scratch_mount >> $seqres.full 2>&1 -testdir="$SCRATCH_MNT/test-$seq" -rm -rf $testdir +testdir=$SCRATCH_MNT/test-$seq mkdir $testdir echo "Create the original files" blksz=65536 nr=64 +filesize=$((blksz * nr)) _weave_reflink_regular $blksz $nr $testdir/file1 $testdir/file3 >> $seqres.full _scratch_remount echo "Compare files" -md5sum "$testdir/file1" | _filter_scratch -md5sum "$testdir/file3" | _filter_scratch -md5sum "$testdir/file3.chk" | _filter_scratch +md5sum $testdir/file1 | _filter_scratch +md5sum $testdir/file3 | _filter_scratch +md5sum $testdir/file3.chk | _filter_scratch echo "CoW across the transition" -"$XFS_IO_PROG" -f -c "pwrite -S 0x63 -b $((blksz * nr / 2)) $((blksz * nr / 4)) $((blksz * nr / 2))" "$testdir/file3" >> "$seqres.full" -_pwrite_byte 0x63 $((blksz * nr / 4)) $((blksz * nr / 2)) "$testdir/file3.chk" >> "$seqres.full" +cowoff=$((filesize / 4)) +cowsz=$((filesize / 2)) +$XFS_IO_PROG -f -c "pwrite -S 0x63 -b $cowsz $cowoff $cowsz" $testdir/file3 >> $seqres.full +_pwrite_byte 0x63 $cowoff $cowsz $testdir/file3.chk >> $seqres.full _scratch_remount echo "Compare files" -md5sum "$testdir/file1" | _filter_scratch -md5sum "$testdir/file3" | _filter_scratch -md5sum "$testdir/file3.chk" | _filter_scratch +md5sum $testdir/file1 | _filter_scratch +md5sum $testdir/file3 | _filter_scratch +md5sum $testdir/file3.chk | _filter_scratch # success, all done status=0 diff --git a/tests/generic/199 b/tests/generic/199 index 6a65533..f457245 100755 --- a/tests/generic/199 +++ b/tests/generic/199 @@ -29,8 +29,8 @@ # Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA #----------------------------------------------------------------------- -seq=`basename "$0"` -seqres="$RESULT_DIR/$seq" +seq=`basename $0` +seqres=$RESULT_DIR/$seq echo "QA output created by $seq" here=`pwd` @@ -41,7 +41,7 @@ trap "_cleanup; exit \$status" 0 1 2 3 15 _cleanup() { cd / - rm -rf "$tmp".* "$testdir" + rm -rf $tmp.* $testdir } # get standard environment, filters and checks @@ -56,38 +56,40 @@ _require_xfs_io_command "falloc" _require_xfs_io_command "fpunch" _require_cp_reflink -rm -f "$seqres.full" +rm -f $seqres.full echo "Format and mount" -_scratch_mkfs > "$seqres.full" 2>&1 -_scratch_mount >> "$seqres.full" 2>&1 +_scratch_mkfs > $seqres.full 2>&1 +_scratch_mount >> $seqres.full 2>&1 -testdir="$SCRATCH_MNT/test-$seq" -rm -rf $testdir +testdir=$SCRATCH_MNT/test-$seq mkdir $testdir echo "Create the original files" blksz=65536 nr=64 +filesize=$((blksz * nr)) _weave_reflink_rainbow $blksz $nr $testdir/file1 $testdir/file3 >> $seqres.full _scratch_remount echo "Compare files" -md5sum "$testdir/file1" | _filter_scratch -md5sum "$testdir/file3" | _filter_scratch -md5sum "$testdir/file3.chk" | _filter_scratch +md5sum $testdir/file1 | _filter_scratch +md5sum $testdir/file3 | _filter_scratch +md5sum $testdir/file3.chk | _filter_scratch echo "directio CoW across the transition" +cowoff=$((filesize / 4)) +cowsz=$((filesize / 2)) _weave_reflink_rainbow_delalloc $blksz $nr $testdir/file3 >> $seqres.full # now cow -"$XFS_IO_PROG" -d -f -c "pwrite -S 0x63 -b $((blksz * nr / 2)) $((blksz * nr / 4)) $((blksz * nr / 2))" "$testdir/file3" >> "$seqres.full" -_pwrite_byte 0x63 $((blksz * nr / 4)) $((blksz * nr / 2)) "$testdir/file3.chk" >> "$seqres.full" +$XFS_IO_PROG -d -f -c "pwrite -S 0x63 -b $cowsz $cowoff $cowsz" $testdir/file3 >> $seqres.full +_pwrite_byte 0x63 $cowoff $cowsz $testdir/file3.chk >> $seqres.full _scratch_remount echo "Compare files" -md5sum "$testdir/file1" | _filter_scratch -md5sum "$testdir/file3" | _filter_scratch -md5sum "$testdir/file3.chk" | _filter_scratch +md5sum $testdir/file1 | _filter_scratch +md5sum $testdir/file3 | _filter_scratch +md5sum $testdir/file3.chk | _filter_scratch # success, all done status=0 diff --git a/tests/generic/200 b/tests/generic/200 index 541d16d..ffb5869 100755 --- a/tests/generic/200 +++ b/tests/generic/200 @@ -29,8 +29,8 @@ # Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA #----------------------------------------------------------------------- -seq=`basename "$0"` -seqres="$RESULT_DIR/$seq" +seq=`basename $0` +seqres=$RESULT_DIR/$seq echo "QA output created by $seq" here=`pwd` @@ -41,7 +41,7 @@ trap "_cleanup; exit \$status" 0 1 2 3 15 _cleanup() { cd / - rm -rf "$tmp".* "$testdir" + rm -rf $tmp.* $testdir } # get standard environment, filters and checks @@ -56,38 +56,40 @@ _require_xfs_io_command "falloc" _require_xfs_io_command "fpunch" _require_cp_reflink -rm -f "$seqres.full" +rm -f $seqres.full echo "Format and mount" -_scratch_mkfs > "$seqres.full" 2>&1 -_scratch_mount >> "$seqres.full" 2>&1 +_scratch_mkfs > $seqres.full 2>&1 +_scratch_mount >> $seqres.full 2>&1 -testdir="$SCRATCH_MNT/test-$seq" -rm -rf $testdir +testdir=$SCRATCH_MNT/test-$seq mkdir $testdir echo "Create the original files" blksz=65536 nr=64 +filesize=$((blksz * nr)) _weave_reflink_rainbow $blksz $nr $testdir/file1 $testdir/file3 >> $seqres.full _scratch_remount echo "Compare files" -md5sum "$testdir/file1" | _filter_scratch -md5sum "$testdir/file3" | _filter_scratch -md5sum "$testdir/file3.chk" | _filter_scratch +md5sum $testdir/file1 | _filter_scratch +md5sum $testdir/file3 | _filter_scratch +md5sum $testdir/file3.chk | _filter_scratch echo "directio CoW across the transition" +cowoff=$((filesize / 4)) +cowsz=$((filesize / 2)) _weave_reflink_rainbow_delalloc $blksz $nr $testdir/file3 >> $seqres.full # now cow -"$XFS_IO_PROG" -f -c "pwrite -S 0x63 -b $((blksz * nr / 2)) $((blksz * nr / 4)) $((blksz * nr / 2))" "$testdir/file3" >> "$seqres.full" -_pwrite_byte 0x63 $((blksz * nr / 4)) $((blksz * nr / 2)) "$testdir/file3.chk" >> "$seqres.full" +$XFS_IO_PROG -f -c "pwrite -S 0x63 -b $cowsz $cowoff $cowsz" $testdir/file3 >> $seqres.full +_pwrite_byte 0x63 $cowoff $cowsz $testdir/file3.chk >> $seqres.full _scratch_remount echo "Compare files" -md5sum "$testdir/file1" | _filter_scratch -md5sum "$testdir/file3" | _filter_scratch -md5sum "$testdir/file3.chk" | _filter_scratch +md5sum $testdir/file1 | _filter_scratch +md5sum $testdir/file3 | _filter_scratch +md5sum $testdir/file3.chk | _filter_scratch # success, all done status=0 diff --git a/tests/generic/201 b/tests/generic/201 index 90087ef..634dec9 100755 --- a/tests/generic/201 +++ b/tests/generic/201 @@ -21,8 +21,8 @@ # Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA #----------------------------------------------------------------------- -seq=`basename "$0"` -seqres="$RESULT_DIR/$seq" +seq=`basename $0` +seqres=$RESULT_DIR/$seq echo "QA output created by $seq" here=`pwd` @@ -33,7 +33,7 @@ trap "_cleanup; exit \$status" 0 1 2 3 15 _cleanup() { cd / - rm -rf "$tmp".* "$testdir" + rm -rf $tmp.* $testdir } # get standard environment, filters and checks @@ -46,36 +46,38 @@ _supported_os Linux _require_scratch_reflink _require_xfs_io_command "falloc" -rm -f "$seqres.full" +rm -f $seqres.full echo "Format and mount" -_scratch_mkfs > "$seqres.full" 2>&1 -_scratch_mount >> "$seqres.full" 2>&1 +_scratch_mkfs > $seqres.full 2>&1 +_scratch_mount >> $seqres.full 2>&1 -testdir="$SCRATCH_MNT/test-$seq" -rm -rf $testdir +testdir=$SCRATCH_MNT/test-$seq mkdir $testdir echo "Create the original files" blksz=65536 nr=64 -_pwrite_byte 0x61 0 $((blksz * nr)) "$testdir/file1" >> "$seqres.full" -_pwrite_byte 0x62 0 $((blksz * nr)) "$testdir/file3" >> "$seqres.full" -_pwrite_byte 0x62 0 $((blksz * nr)) "$testdir/file3.chk" >> "$seqres.full" +filesize=$((blksz * nr)) +_pwrite_byte 0x61 0 $filesize $testdir/file1 >> $seqres.full +_pwrite_byte 0x62 0 $filesize $testdir/file3 >> $seqres.full +_pwrite_byte 0x62 0 $filesize $testdir/file3.chk >> $seqres.full seq 0 2 $((nr-1)) | while read f; do - _reflink_range "$testdir/file1" $((blksz * f)) "$testdir/file3" $((blksz * f)) $blksz >> "$seqres.full" - _pwrite_byte 0x61 $((blksz * f)) $blksz "$testdir/file3.chk" >> "$seqres.full" + _reflink_range $testdir/file1 $((blksz * f)) $testdir/file3 $((blksz * f)) $blksz >> $seqres.full + _pwrite_byte 0x61 $((blksz * f)) $blksz $testdir/file3.chk >> $seqres.full done _scratch_remount echo "Compare files" -md5sum "$testdir/file1" | _filter_scratch -md5sum "$testdir/file3" | _filter_scratch -md5sum "$testdir/file3.chk" | _filter_scratch +md5sum $testdir/file1 | _filter_scratch +md5sum $testdir/file3 | _filter_scratch +md5sum $testdir/file3.chk | _filter_scratch echo "CoW and unmount" -"$XFS_IO_PROG" -f -c "pwrite -S 0x63 -b $((blksz * nr / 2)) $((blksz * nr / 4)) $((blksz * nr / 2))" "$testdir/file3" >> "$seqres.full" -rm "$testdir/file3" +cowoff=$((filesize / 4)) +cowsz=$((filesize / 2)) +$XFS_IO_PROG -f -c "pwrite -S 0x63 -b $cowsz $cowoff $cowsz" $testdir/file3 >> $seqres.full +rm $testdir/file3 # success, all done status=0 diff --git a/tests/generic/202 b/tests/generic/202 index e034e4e..a7f4004 100755 --- a/tests/generic/202 +++ b/tests/generic/202 @@ -20,8 +20,8 @@ # Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA #----------------------------------------------------------------------- -seq=`basename "$0"` -seqres="$RESULT_DIR/$seq" +seq=`basename $0` +seqres=$RESULT_DIR/$seq echo "QA output created by $seq" here=`pwd` @@ -32,7 +32,7 @@ trap "_cleanup; exit \$status" 0 1 2 3 15 _cleanup() { cd / - rm -rf "$tmp".* "$testdir" + rm -rf $tmp.* $testdir } # get standard environment, filters and checks @@ -45,37 +45,36 @@ _supported_os Linux _require_scratch_reflink _require_cp_reflink -rm -f "$seqres.full" +rm -f $seqres.full echo "Format and mount" -_scratch_mkfs > "$seqres.full" 2>&1 -_scratch_mount >> "$seqres.full" 2>&1 +_scratch_mkfs > $seqres.full 2>&1 +_scratch_mount >> $seqres.full 2>&1 -testdir="$SCRATCH_MNT/test-$seq" -rm -rf $testdir +testdir=$SCRATCH_MNT/test-$seq mkdir $testdir echo "Create the original files" blksz=65536 -_pwrite_byte 0x61 0 $((blksz + 17)) "$testdir/file1" >> "$seqres.full" -_cp_reflink "$testdir/file1" "$testdir/file2" -_pwrite_byte 0x61 0 $((blksz + 17)) "$testdir/file2.chk" >> "$seqres.full" +_pwrite_byte 0x61 0 $((blksz + 17)) $testdir/file1 >> $seqres.full +_cp_reflink $testdir/file1 $testdir/file2 +_pwrite_byte 0x61 0 $((blksz + 17)) $testdir/file2.chk >> $seqres.full _scratch_remount echo "Compare files" -md5sum "$testdir/file1" | _filter_scratch -md5sum "$testdir/file2" | _filter_scratch -md5sum "$testdir/file2.chk" | _filter_scratch +md5sum $testdir/file1 | _filter_scratch +md5sum $testdir/file2 | _filter_scratch +md5sum $testdir/file2.chk | _filter_scratch echo "CoW and unmount" -"$XFS_IO_PROG" -f -c "pwrite -S 0x63 $((blksz + 17)) 17" "$testdir/file2" >> "$seqres.full" -"$XFS_IO_PROG" -f -c "pwrite -S 0x63 $((blksz + 17)) 17" "$testdir/file2.chk" >> "$seqres.full" +$XFS_IO_PROG -f -c "pwrite -S 0x63 $((blksz + 17)) 17" $testdir/file2 >> $seqres.full +$XFS_IO_PROG -f -c "pwrite -S 0x63 $((blksz + 17)) 17" $testdir/file2.chk >> $seqres.full _scratch_remount echo "Compare files" -md5sum "$testdir/file1" | _filter_scratch -md5sum "$testdir/file2" | _filter_scratch -md5sum "$testdir/file2.chk" | _filter_scratch +md5sum $testdir/file1 | _filter_scratch +md5sum $testdir/file2 | _filter_scratch +md5sum $testdir/file2.chk | _filter_scratch # success, all done status=0 diff --git a/tests/generic/203 b/tests/generic/203 index 2b6db7e..5d9bfc4 100755 --- a/tests/generic/203 +++ b/tests/generic/203 @@ -20,8 +20,8 @@ # Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA #----------------------------------------------------------------------- -seq=`basename "$0"` -seqres="$RESULT_DIR/$seq" +seq=`basename $0` +seqres=$RESULT_DIR/$seq echo "QA output created by $seq" here=`pwd` @@ -32,7 +32,7 @@ trap "_cleanup; exit \$status" 0 1 2 3 15 _cleanup() { cd / - rm -rf "$tmp".* "$testdir" + rm -rf $tmp.* $testdir } # get standard environment, filters and checks @@ -45,37 +45,36 @@ _supported_os Linux _require_scratch_reflink _require_cp_reflink -rm -f "$seqres.full" +rm -f $seqres.full echo "Format and mount" -_scratch_mkfs > "$seqres.full" 2>&1 -_scratch_mount >> "$seqres.full" 2>&1 +_scratch_mkfs > $seqres.full 2>&1 +_scratch_mount >> $seqres.full 2>&1 -testdir="$SCRATCH_MNT/test-$seq" -rm -rf $testdir +testdir=$SCRATCH_MNT/test-$seq mkdir $testdir echo "Create the original files" blksz=65536 -_pwrite_byte 0x61 0 $((blksz + 17)) "$testdir/file1" >> "$seqres.full" -_cp_reflink "$testdir/file1" "$testdir/file2" -_pwrite_byte 0x61 0 $((blksz + 17)) "$testdir/file2.chk" >> "$seqres.full" +_pwrite_byte 0x61 0 $((blksz + 17)) $testdir/file1 >> $seqres.full +_cp_reflink $testdir/file1 $testdir/file2 +_pwrite_byte 0x61 0 $((blksz + 17)) $testdir/file2.chk >> $seqres.full _scratch_remount echo "Compare files" -md5sum "$testdir/file1" | _filter_scratch -md5sum "$testdir/file2" | _filter_scratch -md5sum "$testdir/file2.chk" | _filter_scratch +md5sum $testdir/file1 | _filter_scratch +md5sum $testdir/file2 | _filter_scratch +md5sum $testdir/file2.chk | _filter_scratch echo "CoW and unmount" -"$XFS_IO_PROG" -d -f -c "pwrite -S 0x63 $blksz $blksz" "$testdir/file2" >> "$seqres.full" -"$XFS_IO_PROG" -f -c "pwrite -S 0x63 $blksz $blksz" "$testdir/file2.chk" >> "$seqres.full" +$XFS_IO_PROG -d -f -c "pwrite -S 0x63 $blksz $blksz" $testdir/file2 >> $seqres.full +$XFS_IO_PROG -f -c "pwrite -S 0x63 $blksz $blksz" $testdir/file2.chk >> $seqres.full _scratch_remount echo "Compare files" -md5sum "$testdir/file1" | _filter_scratch -md5sum "$testdir/file2" | _filter_scratch -md5sum "$testdir/file2.chk" | _filter_scratch +md5sum $testdir/file1 | _filter_scratch +md5sum $testdir/file2 | _filter_scratch +md5sum $testdir/file2.chk | _filter_scratch # success, all done status=0 diff --git a/tests/generic/205 b/tests/generic/205 index 8955e67..683849e 100755 --- a/tests/generic/205 +++ b/tests/generic/205 @@ -24,8 +24,8 @@ # Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA #----------------------------------------------------------------------- -seq=`basename "$0"` -seqres="$RESULT_DIR/$seq" +seq=`basename $0` +seqres=$RESULT_DIR/$seq echo "QA output created by $seq" here=`pwd` @@ -36,7 +36,7 @@ trap "_cleanup; exit \$status" 0 1 2 3 15 _cleanup() { cd / - rm -rf "$tmp".* "$testdir" + rm -rf $tmp.* $testdir } # get standard environment, filters and checks @@ -48,50 +48,49 @@ _cleanup() _supported_os Linux _require_scratch_reflink -rm -f "$seqres.full" +rm -f $seqres.full pagesz=$(getconf PAGE_SIZE) blksz=$((pagesz / 4)) echo "Format and mount" -_scratch_mkfs_blocksized $blksz > "$seqres.full" 2>&1 -_scratch_mount >> "$seqres.full" 2>&1 +_scratch_mkfs_blocksized $blksz > $seqres.full 2>&1 +_scratch_mount >> $seqres.full 2>&1 -testdir="$SCRATCH_MNT/test-$seq" -rm -rf $testdir +testdir=$SCRATCH_MNT/test-$seq mkdir $testdir real_blksz=$(stat -f -c '%S' $testdir) -test "$real_blksz" != "$blksz" && _notrun "Failed to format with small blocksize." +test $real_blksz != $blksz && _notrun "Failed to format with small blocksize." echo "Create the original files" -_pwrite_byte 0x61 0 $pagesz "$testdir/file1" >> "$seqres.full" +_pwrite_byte 0x61 0 $pagesz $testdir/file1 >> $seqres.full -"$XFS_IO_PROG" -f -c "truncate $pagesz" "$testdir/file2" >> "$seqres.full" -"$XFS_IO_PROG" -f -c "truncate $pagesz" "$testdir/file2.chk" >> "$seqres.full" +$XFS_IO_PROG -f -c "truncate $pagesz" $testdir/file2 >> $seqres.full +$XFS_IO_PROG -f -c "truncate $pagesz" $testdir/file2.chk >> $seqres.full -_pwrite_byte 0x61 $blksz $blksz "$testdir/file2" >> "$seqres.full" -_pwrite_byte 0x61 $blksz $blksz "$testdir/file2.chk" >> "$seqres.full" +_pwrite_byte 0x61 $blksz $blksz $testdir/file2 >> $seqres.full +_pwrite_byte 0x61 $blksz $blksz $testdir/file2.chk >> $seqres.full -_pwrite_byte 0x61 $((blksz * 3)) $blksz "$testdir/file2" >> "$seqres.full" -_pwrite_byte 0x61 $((blksz * 3)) $blksz "$testdir/file2.chk" >> "$seqres.full" +_pwrite_byte 0x61 $((blksz * 3)) $blksz $testdir/file2 >> $seqres.full +_pwrite_byte 0x61 $((blksz * 3)) $blksz $testdir/file2.chk >> $seqres.full -_reflink_range "$testdir/file1" $blksz "$testdir/file2" $((blksz * 2)) $blksz >> "$seqres.full" -_pwrite_byte 0x61 $((blksz * 2)) $blksz "$testdir/file2.chk" >> "$seqres.full" +_reflink_range $testdir/file1 $blksz $testdir/file2 $((blksz * 2)) $blksz >> $seqres.full +_pwrite_byte 0x61 $((blksz * 2)) $blksz $testdir/file2.chk >> $seqres.full _scratch_remount echo "Compare files" -! cmp -s "$testdir/file1" "$testdir/file2" || _fail "file1 and file2 don't match." -cmp -s "$testdir/file2" "$testdir/file2.chk" || _fail "file2 and file2.chk don't match." +! cmp -s $testdir/file1 $testdir/file2 || _fail "file1 and file2 don't match." +cmp -s $testdir/file2 $testdir/file2.chk || _fail "file2 and file2.chk don't match." echo "CoW and unmount" -"$XFS_IO_PROG" -f -c "pwrite -S 0x63 $((blksz + 17)) $((blksz * 3 - 34))" "$testdir/file2" >> "$seqres.full" -"$XFS_IO_PROG" -f -c "pwrite -S 0x63 $((blksz + 17)) $((blksz * 3 - 34))" "$testdir/file2.chk" >> "$seqres.full" +$XFS_IO_PROG -f -c "pwrite -S 0x63 $((blksz + 17)) $((blksz * 3 - 34))" $testdir/file2 >> $seqres.full +$XFS_IO_PROG -f -c "pwrite -S 0x63 $((blksz + 17)) $((blksz * 3 - 34))" $testdir/file2.chk >> $seqres.full _scratch_remount echo "Compare files" -! cmp -s "$testdir/file1" "$testdir/file2" || _fail "file1 and file2 don't match." -cmp -s "$testdir/file2" "$testdir/file2.chk" || _fail "file2 and file2.chk don't match." +! cmp -s $testdir/file1 $testdir/file2 || _fail "file1 and file2 don't match." +cmp -s $testdir/file2 $testdir/file2.chk || _fail "file2 and file2.chk don't match." # success, all done status=0 diff --git a/tests/generic/206 b/tests/generic/206 index 12ad745..4054626 100755 --- a/tests/generic/206 +++ b/tests/generic/206 @@ -24,8 +24,8 @@ # Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA #----------------------------------------------------------------------- -seq=`basename "$0"` -seqres="$RESULT_DIR/$seq" +seq=`basename $0` +seqres=$RESULT_DIR/$seq echo "QA output created by $seq" here=`pwd` @@ -36,7 +36,7 @@ trap "_cleanup; exit \$status" 0 1 2 3 15 _cleanup() { cd / - rm -rf "$tmp".* "$testdir" + rm -rf $tmp.* $testdir } # get standard environment, filters and checks @@ -48,50 +48,49 @@ _cleanup() _supported_os Linux _require_scratch_reflink -rm -f "$seqres.full" +rm -f $seqres.full pagesz=$(getconf PAGE_SIZE) blksz=$((pagesz / 4)) echo "Format and mount" -_scratch_mkfs_blocksized $blksz > "$seqres.full" 2>&1 -_scratch_mount >> "$seqres.full" 2>&1 +_scratch_mkfs_blocksized $blksz > $seqres.full 2>&1 +_scratch_mount >> $seqres.full 2>&1 -testdir="$SCRATCH_MNT/test-$seq" -rm -rf $testdir +testdir=$SCRATCH_MNT/test-$seq mkdir $testdir real_blksz=$(stat -f -c '%S' $testdir) -test "$real_blksz" != "$blksz" && _notrun "Failed to format with small blocksize." +test $real_blksz != $blksz && _notrun "Failed to format with small blocksize." echo "Create the original files" -_pwrite_byte 0x61 0 $pagesz "$testdir/file1" >> "$seqres.full" +_pwrite_byte 0x61 0 $pagesz $testdir/file1 >> $seqres.full -"$XFS_IO_PROG" -f -c "truncate $pagesz" "$testdir/file2" >> "$seqres.full" -"$XFS_IO_PROG" -f -c "truncate $pagesz" "$testdir/file2.chk" >> "$seqres.full" +$XFS_IO_PROG -f -c "truncate $pagesz" $testdir/file2 >> $seqres.full +$XFS_IO_PROG -f -c "truncate $pagesz" $testdir/file2.chk >> $seqres.full -_pwrite_byte 0x61 $blksz $blksz "$testdir/file2" >> "$seqres.full" -_pwrite_byte 0x61 $blksz $blksz "$testdir/file2.chk" >> "$seqres.full" +_pwrite_byte 0x61 $blksz $blksz $testdir/file2 >> $seqres.full +_pwrite_byte 0x61 $blksz $blksz $testdir/file2.chk >> $seqres.full -_pwrite_byte 0x61 $((blksz * 3)) $blksz "$testdir/file2" >> "$seqres.full" -_pwrite_byte 0x61 $((blksz * 3)) $blksz "$testdir/file2.chk" >> "$seqres.full" +_pwrite_byte 0x61 $((blksz * 3)) $blksz $testdir/file2 >> $seqres.full +_pwrite_byte 0x61 $((blksz * 3)) $blksz $testdir/file2.chk >> $seqres.full -_reflink_range "$testdir/file1" $blksz "$testdir/file2" $((blksz * 2)) $blksz >> "$seqres.full" -_pwrite_byte 0x61 $((blksz * 2)) $blksz "$testdir/file2.chk" >> "$seqres.full" +_reflink_range $testdir/file1 $blksz $testdir/file2 $((blksz * 2)) $blksz >> $seqres.full +_pwrite_byte 0x61 $((blksz * 2)) $blksz $testdir/file2.chk >> $seqres.full _scratch_remount echo "Compare files" -! cmp -s "$testdir/file1" "$testdir/file2" || _fail "file1 and file2 don't match." -cmp -s "$testdir/file2" "$testdir/file2.chk" || _fail "file2 and file2.chk don't match." +! cmp -s $testdir/file1 $testdir/file2 || _fail "file1 and file2 don't match." +cmp -s $testdir/file2 $testdir/file2.chk || _fail "file2 and file2.chk don't match." echo "CoW and unmount" -"$XFS_IO_PROG" -d -f -c "pwrite -S 0x63 $blksz $((blksz * 3))" "$testdir/file2" >> "$seqres.full" -"$XFS_IO_PROG" -f -c "pwrite -S 0x63 $blksz $((blksz * 3))" "$testdir/file2.chk" >> "$seqres.full" +$XFS_IO_PROG -d -f -c "pwrite -S 0x63 $blksz $((blksz * 3))" $testdir/file2 >> $seqres.full +$XFS_IO_PROG -f -c "pwrite -S 0x63 $blksz $((blksz * 3))" $testdir/file2.chk >> $seqres.full _scratch_remount echo "Compare files" -! cmp -s "$testdir/file1" "$testdir/file2" || _fail "file1 and file2 don't match." -cmp -s "$testdir/file2" "$testdir/file2.chk" || _fail "file2 and file2.chk don't match." +! cmp -s $testdir/file1 $testdir/file2 || _fail "file1 and file2 don't match." +cmp -s $testdir/file2 $testdir/file2.chk || _fail "file2 and file2.chk don't match." # success, all done status=0 diff --git a/tests/generic/216 b/tests/generic/216 index 3e0084e..d9f7e21 100755 --- a/tests/generic/216 +++ b/tests/generic/216 @@ -24,8 +24,8 @@ # Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA #----------------------------------------------------------------------- -seq=`basename "$0"` -seqres="$RESULT_DIR/$seq" +seq=`basename $0` +seqres=$RESULT_DIR/$seq echo "QA output created by $seq" here=`pwd` @@ -36,7 +36,7 @@ trap "_cleanup; exit \$status" 0 1 2 3 15 _cleanup() { cd / - rm -rf "$tmp".* "$testdir" + rm -rf $tmp.* $testdir } # get standard environment, filters and checks @@ -49,50 +49,49 @@ _supported_os Linux _require_scratch_reflink _require_xfs_io_command "falloc" -rm -f "$seqres.full" +rm -f $seqres.full pagesz=$(getconf PAGE_SIZE) blksz=$((pagesz / 4)) echo "Format and mount" -_scratch_mkfs_blocksized $blksz > "$seqres.full" 2>&1 -_scratch_mount >> "$seqres.full" 2>&1 +_scratch_mkfs_blocksized $blksz > $seqres.full 2>&1 +_scratch_mount >> $seqres.full 2>&1 -testdir="$SCRATCH_MNT/test-$seq" -rm -rf $testdir +testdir=$SCRATCH_MNT/test-$seq mkdir $testdir real_blksz=$(stat -f -c '%S' $testdir) -test "$real_blksz" != "$blksz" && _notrun "Failed to format with small blocksize." +test $real_blksz != $blksz && _notrun "Failed to format with small blocksize." echo "Create the original files" -_pwrite_byte 0x61 0 $pagesz "$testdir/file1" >> "$seqres.full" +_pwrite_byte 0x61 0 $pagesz $testdir/file1 >> $seqres.full -"$XFS_IO_PROG" -f -c "truncate $pagesz" "$testdir/file2" >> "$seqres.full" -"$XFS_IO_PROG" -f -c "truncate $pagesz" "$testdir/file2.chk" >> "$seqres.full" +$XFS_IO_PROG -f -c "truncate $pagesz" $testdir/file2 >> $seqres.full +$XFS_IO_PROG -f -c "truncate $pagesz" $testdir/file2.chk >> $seqres.full -"$XFS_IO_PROG" -f -c "falloc -k $blksz $blksz" "$testdir/file2" >> "$seqres.full" -_pwrite_byte 0x00 $blksz $blksz "$testdir/file2.chk" >> "$seqres.full" +$XFS_IO_PROG -f -c "falloc -k $blksz $blksz" $testdir/file2 >> $seqres.full +_pwrite_byte 0x00 $blksz $blksz $testdir/file2.chk >> $seqres.full -"$XFS_IO_PROG" -f -c "falloc -k $((blksz * 3)) $blksz" "$testdir/file2" >> "$seqres.full" -_pwrite_byte 0x00 $((blksz * 3)) $blksz "$testdir/file2.chk" >> "$seqres.full" +$XFS_IO_PROG -f -c "falloc -k $((blksz * 3)) $blksz" $testdir/file2 >> $seqres.full +_pwrite_byte 0x00 $((blksz * 3)) $blksz $testdir/file2.chk >> $seqres.full -_reflink_range "$testdir/file1" $blksz "$testdir/file2" $((blksz * 2)) $blksz >> "$seqres.full" -_pwrite_byte 0x61 $((blksz * 2)) $blksz "$testdir/file2.chk" >> "$seqres.full" +_reflink_range $testdir/file1 $blksz $testdir/file2 $((blksz * 2)) $blksz >> $seqres.full +_pwrite_byte 0x61 $((blksz * 2)) $blksz $testdir/file2.chk >> $seqres.full _scratch_remount echo "Compare files" -! cmp -s "$testdir/file1" "$testdir/file2" || _fail "file1 and file2 don't match." -cmp -s "$testdir/file2" "$testdir/file2.chk" || _fail "file2 and file2.chk don't match." +! cmp -s $testdir/file1 $testdir/file2 || _fail "file1 and file2 don't match." +cmp -s $testdir/file2 $testdir/file2.chk || _fail "file2 and file2.chk don't match." echo "CoW and unmount" -"$XFS_IO_PROG" -f -c "pwrite -S 0x63 $((blksz + 17)) $((blksz * 3 - 34))" "$testdir/file2" >> "$seqres.full" -"$XFS_IO_PROG" -f -c "pwrite -S 0x63 $((blksz + 17)) $((blksz * 3 - 34))" "$testdir/file2.chk" >> "$seqres.full" +$XFS_IO_PROG -f -c "pwrite -S 0x63 $((blksz + 17)) $((blksz * 3 - 34))" $testdir/file2 >> $seqres.full +$XFS_IO_PROG -f -c "pwrite -S 0x63 $((blksz + 17)) $((blksz * 3 - 34))" $testdir/file2.chk >> $seqres.full _scratch_remount echo "Compare files" -! cmp -s "$testdir/file1" "$testdir/file2" || _fail "file1 and file2 don't match." -cmp -s "$testdir/file2" "$testdir/file2.chk" || _fail "file2 and file2.chk don't match." +! cmp -s $testdir/file1 $testdir/file2 || _fail "file1 and file2 don't match." +cmp -s $testdir/file2 $testdir/file2.chk || _fail "file2 and file2.chk don't match." # success, all done status=0 diff --git a/tests/generic/217 b/tests/generic/217 index 3470d25..b1bd635 100755 --- a/tests/generic/217 +++ b/tests/generic/217 @@ -24,8 +24,8 @@ # Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA #----------------------------------------------------------------------- -seq=`basename "$0"` -seqres="$RESULT_DIR/$seq" +seq=`basename $0` +seqres=$RESULT_DIR/$seq echo "QA output created by $seq" here=`pwd` @@ -36,7 +36,7 @@ trap "_cleanup; exit \$status" 0 1 2 3 15 _cleanup() { cd / - rm -rf "$tmp".* "$testdir" + rm -rf $tmp.* $testdir } # get standard environment, filters and checks @@ -49,50 +49,49 @@ _supported_os Linux _require_scratch_reflink _require_xfs_io_command "falloc" -rm -f "$seqres.full" +rm -f $seqres.full pagesz=$(getconf PAGE_SIZE) blksz=$((pagesz / 4)) echo "Format and mount" -_scratch_mkfs_blocksized $blksz > "$seqres.full" 2>&1 -_scratch_mount >> "$seqres.full" 2>&1 +_scratch_mkfs_blocksized $blksz > $seqres.full 2>&1 +_scratch_mount >> $seqres.full 2>&1 -testdir="$SCRATCH_MNT/test-$seq" -rm -rf $testdir +testdir=$SCRATCH_MNT/test-$seq mkdir $testdir real_blksz=$(stat -f -c '%S' $testdir) -test "$real_blksz" != "$blksz" && _notrun "Failed to format with small blocksize." +test $real_blksz != $blksz && _notrun "Failed to format with small blocksize." echo "Create the original files" -_pwrite_byte 0x61 0 $pagesz "$testdir/file1" >> "$seqres.full" +_pwrite_byte 0x61 0 $pagesz $testdir/file1 >> $seqres.full -"$XFS_IO_PROG" -f -c "truncate $pagesz" "$testdir/file2" >> "$seqres.full" -"$XFS_IO_PROG" -f -c "truncate $pagesz" "$testdir/file2.chk" >> "$seqres.full" +$XFS_IO_PROG -f -c "truncate $pagesz" $testdir/file2 >> $seqres.full +$XFS_IO_PROG -f -c "truncate $pagesz" $testdir/file2.chk >> $seqres.full -"$XFS_IO_PROG" -f -c "falloc -k $blksz $blksz" "$testdir/file2" >> "$seqres.full" -_pwrite_byte 0x00 $blksz $blksz "$testdir/file2.chk" >> "$seqres.full" +$XFS_IO_PROG -f -c "falloc -k $blksz $blksz" $testdir/file2 >> $seqres.full +_pwrite_byte 0x00 $blksz $blksz $testdir/file2.chk >> $seqres.full -"$XFS_IO_PROG" -f -c "falloc -k $((blksz * 3)) $blksz" "$testdir/file2" >> "$seqres.full" -_pwrite_byte 0x00 $((blksz * 3)) $blksz "$testdir/file2.chk" >> "$seqres.full" +$XFS_IO_PROG -f -c "falloc -k $((blksz * 3)) $blksz" $testdir/file2 >> $seqres.full +_pwrite_byte 0x00 $((blksz * 3)) $blksz $testdir/file2.chk >> $seqres.full -_reflink_range "$testdir/file1" $blksz "$testdir/file2" $((blksz * 2)) $blksz >> "$seqres.full" -_pwrite_byte 0x61 $((blksz * 2)) $blksz "$testdir/file2.chk" >> "$seqres.full" +_reflink_range $testdir/file1 $blksz $testdir/file2 $((blksz * 2)) $blksz >> $seqres.full +_pwrite_byte 0x61 $((blksz * 2)) $blksz $testdir/file2.chk >> $seqres.full _scratch_remount echo "Compare files" -! cmp -s "$testdir/file1" "$testdir/file2" || _fail "file1 and file2 don't match." -cmp -s "$testdir/file2" "$testdir/file2.chk" || _fail "file2 and file2.chk don't match." +! cmp -s $testdir/file1 $testdir/file2 || _fail "file1 and file2 don't match." +cmp -s $testdir/file2 $testdir/file2.chk || _fail "file2 and file2.chk don't match." echo "CoW and unmount" -"$XFS_IO_PROG" -d -f -c "pwrite -S 0x63 $blksz $((blksz * 3))" "$testdir/file2" >> "$seqres.full" -"$XFS_IO_PROG" -f -c "pwrite -S 0x63 $blksz $((blksz * 3))" "$testdir/file2.chk" >> "$seqres.full" +$XFS_IO_PROG -d -f -c "pwrite -S 0x63 $blksz $((blksz * 3))" $testdir/file2 >> $seqres.full +$XFS_IO_PROG -f -c "pwrite -S 0x63 $blksz $((blksz * 3))" $testdir/file2.chk >> $seqres.full _scratch_remount echo "Compare files" -! cmp -s "$testdir/file1" "$testdir/file2" || _fail "file1 and file2 don't match." -cmp -s "$testdir/file2" "$testdir/file2.chk" || _fail "file2 and file2.chk don't match." +! cmp -s $testdir/file1 $testdir/file2 || _fail "file1 and file2 don't match." +cmp -s $testdir/file2 $testdir/file2.chk || _fail "file2 and file2.chk don't match." # success, all done status=0 diff --git a/tests/generic/218 b/tests/generic/218 index 220cda3..ecc009a 100755 --- a/tests/generic/218 +++ b/tests/generic/218 @@ -24,8 +24,8 @@ # Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA #----------------------------------------------------------------------- -seq=`basename "$0"` -seqres="$RESULT_DIR/$seq" +seq=`basename $0` +seqres=$RESULT_DIR/$seq echo "QA output created by $seq" here=`pwd` @@ -36,7 +36,7 @@ trap "_cleanup; exit \$status" 0 1 2 3 15 _cleanup() { cd / - rm -rf "$tmp".* "$testdir" + rm -rf $tmp.* $testdir } # get standard environment, filters and checks @@ -49,44 +49,43 @@ _supported_os Linux _require_scratch_reflink _require_xfs_io_command "falloc" -rm -f "$seqres.full" +rm -f $seqres.full pagesz=$(getconf PAGE_SIZE) blksz=$((pagesz / 4)) echo "Format and mount" -_scratch_mkfs_blocksized $blksz > "$seqres.full" 2>&1 -_scratch_mount >> "$seqres.full" 2>&1 +_scratch_mkfs_blocksized $blksz > $seqres.full 2>&1 +_scratch_mount >> $seqres.full 2>&1 -testdir="$SCRATCH_MNT/test-$seq" -rm -rf $testdir +testdir=$SCRATCH_MNT/test-$seq mkdir $testdir real_blksz=$(stat -f -c '%S' $testdir) -test "$real_blksz" != "$blksz" && _notrun "Failed to format with small blocksize." +test $real_blksz != $blksz && _notrun "Failed to format with small blocksize." echo "Create the original files" -_pwrite_byte 0x61 0 $pagesz "$testdir/file1" >> "$seqres.full" +_pwrite_byte 0x61 0 $pagesz $testdir/file1 >> $seqres.full -"$XFS_IO_PROG" -f -c "truncate $pagesz" "$testdir/file2" >> "$seqres.full" -"$XFS_IO_PROG" -f -c "truncate $pagesz" "$testdir/file2.chk" >> "$seqres.full" +$XFS_IO_PROG -f -c "truncate $pagesz" $testdir/file2 >> $seqres.full +$XFS_IO_PROG -f -c "truncate $pagesz" $testdir/file2.chk >> $seqres.full -_reflink_range "$testdir/file1" $blksz "$testdir/file2" $((blksz * 2)) $blksz >> "$seqres.full" -_pwrite_byte 0x61 $((blksz * 2)) $blksz "$testdir/file2.chk" >> "$seqres.full" +_reflink_range $testdir/file1 $blksz $testdir/file2 $((blksz * 2)) $blksz >> $seqres.full +_pwrite_byte 0x61 $((blksz * 2)) $blksz $testdir/file2.chk >> $seqres.full _scratch_remount echo "Compare files" -! cmp -s "$testdir/file1" "$testdir/file2" || _fail "file1 and file2 don't match." -cmp -s "$testdir/file2" "$testdir/file2.chk" || _fail "file2 and file2.chk don't match." +! cmp -s $testdir/file1 $testdir/file2 || _fail "file1 and file2 don't match." +cmp -s $testdir/file2 $testdir/file2.chk || _fail "file2 and file2.chk don't match." echo "CoW and unmount" -"$XFS_IO_PROG" -f -c "pwrite -S 0x63 $((blksz + 17)) $((blksz * 3 - 34))" "$testdir/file2" >> "$seqres.full" -"$XFS_IO_PROG" -f -c "pwrite -S 0x63 $((blksz + 17)) $((blksz * 3 - 34))" "$testdir/file2.chk" >> "$seqres.full" +$XFS_IO_PROG -f -c "pwrite -S 0x63 $((blksz + 17)) $((blksz * 3 - 34))" $testdir/file2 >> $seqres.full +$XFS_IO_PROG -f -c "pwrite -S 0x63 $((blksz + 17)) $((blksz * 3 - 34))" $testdir/file2.chk >> $seqres.full _scratch_remount echo "Compare files" -! cmp -s "$testdir/file1" "$testdir/file2" || _fail "file1 and file2 don't match." -cmp -s "$testdir/file2" "$testdir/file2.chk" || _fail "file2 and file2.chk don't match." +! cmp -s $testdir/file1 $testdir/file2 || _fail "file1 and file2 don't match." +cmp -s $testdir/file2 $testdir/file2.chk || _fail "file2 and file2.chk don't match." # success, all done status=0 diff --git a/tests/generic/220 b/tests/generic/220 index 151bf76..edb8432 100755 --- a/tests/generic/220 +++ b/tests/generic/220 @@ -24,8 +24,8 @@ # Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA #----------------------------------------------------------------------- -seq=`basename "$0"` -seqres="$RESULT_DIR/$seq" +seq=`basename $0` +seqres=$RESULT_DIR/$seq echo "QA output created by $seq" here=`pwd` @@ -36,7 +36,7 @@ trap "_cleanup; exit \$status" 0 1 2 3 15 _cleanup() { cd / - rm -rf "$tmp".* "$testdir" + rm -rf $tmp.* $testdir } # get standard environment, filters and checks @@ -49,44 +49,43 @@ _supported_os Linux _require_scratch_reflink _require_xfs_io_command "falloc" -rm -f "$seqres.full" +rm -f $seqres.full pagesz=$(getconf PAGE_SIZE) blksz=$((pagesz / 4)) echo "Format and mount" -_scratch_mkfs_blocksized $blksz > "$seqres.full" 2>&1 -_scratch_mount >> "$seqres.full" 2>&1 +_scratch_mkfs_blocksized $blksz > $seqres.full 2>&1 +_scratch_mount >> $seqres.full 2>&1 -testdir="$SCRATCH_MNT/test-$seq" -rm -rf $testdir +testdir=$SCRATCH_MNT/test-$seq mkdir $testdir real_blksz=$(stat -f -c '%S' $testdir) -test "$real_blksz" != "$blksz" && _notrun "Failed to format with small blocksize." +test $real_blksz != $blksz && _notrun "Failed to format with small blocksize." echo "Create the original files" -_pwrite_byte 0x61 0 $pagesz "$testdir/file1" >> "$seqres.full" +_pwrite_byte 0x61 0 $pagesz $testdir/file1 >> $seqres.full -"$XFS_IO_PROG" -f -c "truncate $pagesz" "$testdir/file2" >> "$seqres.full" -"$XFS_IO_PROG" -f -c "truncate $pagesz" "$testdir/file2.chk" >> "$seqres.full" +$XFS_IO_PROG -f -c "truncate $pagesz" $testdir/file2 >> $seqres.full +$XFS_IO_PROG -f -c "truncate $pagesz" $testdir/file2.chk >> $seqres.full -_reflink_range "$testdir/file1" $blksz "$testdir/file2" $((blksz * 2)) $blksz >> "$seqres.full" -_pwrite_byte 0x61 $((blksz * 2)) $blksz "$testdir/file2.chk" >> "$seqres.full" +_reflink_range $testdir/file1 $blksz $testdir/file2 $((blksz * 2)) $blksz >> $seqres.full +_pwrite_byte 0x61 $((blksz * 2)) $blksz $testdir/file2.chk >> $seqres.full _scratch_remount echo "Compare files" -! cmp -s "$testdir/file1" "$testdir/file2" || _fail "file1 and file2 don't match." -cmp -s "$testdir/file2" "$testdir/file2.chk" || _fail "file2 and file2.chk don't match." +! cmp -s $testdir/file1 $testdir/file2 || _fail "file1 and file2 don't match." +cmp -s $testdir/file2 $testdir/file2.chk || _fail "file2 and file2.chk don't match." echo "CoW and unmount" -"$XFS_IO_PROG" -d -f -c "pwrite -S 0x63 $blksz $((blksz * 3))" "$testdir/file2" >> "$seqres.full" -"$XFS_IO_PROG" -f -c "pwrite -S 0x63 $blksz $((blksz * 3))" "$testdir/file2.chk" >> "$seqres.full" +$XFS_IO_PROG -d -f -c "pwrite -S 0x63 $blksz $((blksz * 3))" $testdir/file2 >> $seqres.full +$XFS_IO_PROG -f -c "pwrite -S 0x63 $blksz $((blksz * 3))" $testdir/file2.chk >> $seqres.full _scratch_remount echo "Compare files" -! cmp -s "$testdir/file1" "$testdir/file2" || _fail "file1 and file2 don't match." -cmp -s "$testdir/file2" "$testdir/file2.chk" || _fail "file2 and file2.chk don't match." +! cmp -s $testdir/file1 $testdir/file2 || _fail "file1 and file2 don't match." +cmp -s $testdir/file2 $testdir/file2.chk || _fail "file2 and file2.chk don't match." # success, all done status=0 diff --git a/tests/generic/222 b/tests/generic/222 index c95a1d6..58ca8f5 100755 --- a/tests/generic/222 +++ b/tests/generic/222 @@ -24,8 +24,8 @@ # Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA #----------------------------------------------------------------------- -seq=`basename "$0"` -seqres="$RESULT_DIR/$seq" +seq=`basename $0` +seqres=$RESULT_DIR/$seq echo "QA output created by $seq" here=`pwd` @@ -36,7 +36,7 @@ trap "_cleanup; exit \$status" 0 1 2 3 15 _cleanup() { cd / - rm -rf "$tmp".* "$testdir" + rm -rf $tmp.* $testdir } # get standard environment, filters and checks @@ -49,50 +49,49 @@ _supported_os Linux _require_scratch_reflink _require_xfs_io_command "falloc" -rm -f "$seqres.full" +rm -f $seqres.full pagesz=$(getconf PAGE_SIZE) blksz=$((pagesz / 4)) echo "Format and mount" -_scratch_mkfs_blocksized $blksz > "$seqres.full" 2>&1 -_scratch_mount >> "$seqres.full" 2>&1 +_scratch_mkfs_blocksized $blksz > $seqres.full 2>&1 +_scratch_mount >> $seqres.full 2>&1 -testdir="$SCRATCH_MNT/test-$seq" -rm -rf $testdir +testdir=$SCRATCH_MNT/test-$seq mkdir $testdir real_blksz=$(stat -f -c '%S' $testdir) -test "$real_blksz" != "$blksz" && _notrun "Failed to format with small blocksize." +test $real_blksz != $blksz && _notrun "Failed to format with small blocksize." echo "Create the original files" -_pwrite_byte 0x61 0 $pagesz "$testdir/file1" >> "$seqres.full" +_pwrite_byte 0x61 0 $pagesz $testdir/file1 >> $seqres.full -"$XFS_IO_PROG" -f -c "truncate $pagesz" "$testdir/file2" >> "$seqres.full" -"$XFS_IO_PROG" -f -c "truncate $pagesz" "$testdir/file2.chk" >> "$seqres.full" +$XFS_IO_PROG -f -c "truncate $pagesz" $testdir/file2 >> $seqres.full +$XFS_IO_PROG -f -c "truncate $pagesz" $testdir/file2.chk >> $seqres.full -_reflink_range "$testdir/file1" $blksz "$testdir/file2" $((blksz * 2)) $blksz >> "$seqres.full" -_pwrite_byte 0x61 $((blksz * 2)) $blksz "$testdir/file2.chk" >> "$seqres.full" +_reflink_range $testdir/file1 $blksz $testdir/file2 $((blksz * 2)) $blksz >> $seqres.full +_pwrite_byte 0x61 $((blksz * 2)) $blksz $testdir/file2.chk >> $seqres.full _scratch_remount echo "Compare files" -! cmp -s "$testdir/file1" "$testdir/file2" || _fail "file1 and file2 don't match." -cmp -s "$testdir/file2" "$testdir/file2.chk" || _fail "file2 and file2.chk don't match." +! cmp -s $testdir/file1 $testdir/file2 || _fail "file1 and file2 don't match." +cmp -s $testdir/file2 $testdir/file2.chk || _fail "file2 and file2.chk don't match." echo "CoW and unmount" -_pwrite_byte 0x61 $blksz $blksz "$testdir/file2" >> "$seqres.full" -_pwrite_byte 0x61 $blksz $blksz "$testdir/file2.chk" >> "$seqres.full" +_pwrite_byte 0x61 $blksz $blksz $testdir/file2 >> $seqres.full +_pwrite_byte 0x61 $blksz $blksz $testdir/file2.chk >> $seqres.full -_pwrite_byte 0x61 $((blksz * 3)) $blksz "$testdir/file2" >> "$seqres.full" -_pwrite_byte 0x61 $((blksz * 3)) $blksz "$testdir/file2.chk" >> "$seqres.full" +_pwrite_byte 0x61 $((blksz * 3)) $blksz $testdir/file2 >> $seqres.full +_pwrite_byte 0x61 $((blksz * 3)) $blksz $testdir/file2.chk >> $seqres.full -"$XFS_IO_PROG" -f -c "pwrite -S 0x63 $((blksz + 17)) $((blksz * 3 - 34))" "$testdir/file2" >> "$seqres.full" -"$XFS_IO_PROG" -f -c "pwrite -S 0x63 $((blksz + 17)) $((blksz * 3 - 34))" "$testdir/file2.chk" >> "$seqres.full" +$XFS_IO_PROG -f -c "pwrite -S 0x63 $((blksz + 17)) $((blksz * 3 - 34))" $testdir/file2 >> $seqres.full +$XFS_IO_PROG -f -c "pwrite -S 0x63 $((blksz + 17)) $((blksz * 3 - 34))" $testdir/file2.chk >> $seqres.full _scratch_remount echo "Compare files" -! cmp -s "$testdir/file1" "$testdir/file2" || _fail "file1 and file2 don't match." -cmp -s "$testdir/file2" "$testdir/file2.chk" || _fail "file2 and file2.chk don't match." +! cmp -s $testdir/file1 $testdir/file2 || _fail "file1 and file2 don't match." +cmp -s $testdir/file2 $testdir/file2.chk || _fail "file2 and file2.chk don't match." # success, all done status=0 diff --git a/tests/generic/227 b/tests/generic/227 index d62ab52..abaf8f7 100755 --- a/tests/generic/227 +++ b/tests/generic/227 @@ -24,8 +24,8 @@ # Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA #----------------------------------------------------------------------- -seq=`basename "$0"` -seqres="$RESULT_DIR/$seq" +seq=`basename $0` +seqres=$RESULT_DIR/$seq echo "QA output created by $seq" here=`pwd` @@ -36,7 +36,7 @@ trap "_cleanup; exit \$status" 0 1 2 3 15 _cleanup() { cd / - rm -rf "$tmp".* "$testdir" + rm -rf $tmp.* $testdir } # get standard environment, filters and checks @@ -49,50 +49,49 @@ _supported_os Linux _require_scratch_reflink _require_xfs_io_command "falloc" -rm -f "$seqres.full" +rm -f $seqres.full pagesz=$(getconf PAGE_SIZE) blksz=$((pagesz / 4)) echo "Format and mount" -_scratch_mkfs_blocksized $blksz > "$seqres.full" 2>&1 -_scratch_mount >> "$seqres.full" 2>&1 +_scratch_mkfs_blocksized $blksz > $seqres.full 2>&1 +_scratch_mount >> $seqres.full 2>&1 -testdir="$SCRATCH_MNT/test-$seq" -rm -rf $testdir +testdir=$SCRATCH_MNT/test-$seq mkdir $testdir real_blksz=$(stat -f -c '%S' $testdir) -test "$real_blksz" != "$blksz" && _notrun "Failed to format with small blocksize." +test $real_blksz != $blksz && _notrun "Failed to format with small blocksize." echo "Create the original files" -_pwrite_byte 0x61 0 $pagesz "$testdir/file1" >> "$seqres.full" +_pwrite_byte 0x61 0 $pagesz $testdir/file1 >> $seqres.full -"$XFS_IO_PROG" -f -c "truncate $pagesz" "$testdir/file2" >> "$seqres.full" -"$XFS_IO_PROG" -f -c "truncate $pagesz" "$testdir/file2.chk" >> "$seqres.full" +$XFS_IO_PROG -f -c "truncate $pagesz" $testdir/file2 >> $seqres.full +$XFS_IO_PROG -f -c "truncate $pagesz" $testdir/file2.chk >> $seqres.full -_reflink_range "$testdir/file1" $blksz "$testdir/file2" $((blksz * 2)) $blksz >> "$seqres.full" -_pwrite_byte 0x61 $((blksz * 2)) $blksz "$testdir/file2.chk" >> "$seqres.full" +_reflink_range $testdir/file1 $blksz $testdir/file2 $((blksz * 2)) $blksz >> $seqres.full +_pwrite_byte 0x61 $((blksz * 2)) $blksz $testdir/file2.chk >> $seqres.full _scratch_remount echo "Compare files" -! cmp -s "$testdir/file1" "$testdir/file2" || _fail "file1 and file2 don't match." -cmp -s "$testdir/file2" "$testdir/file2.chk" || _fail "file2 and file2.chk don't match." +! cmp -s $testdir/file1 $testdir/file2 || _fail "file1 and file2 don't match." +cmp -s $testdir/file2 $testdir/file2.chk || _fail "file2 and file2.chk don't match." echo "CoW and unmount" -_pwrite_byte 0x61 $blksz $blksz "$testdir/file2" >> "$seqres.full" -_pwrite_byte 0x61 $blksz $blksz "$testdir/file2.chk" >> "$seqres.full" +_pwrite_byte 0x61 $blksz $blksz $testdir/file2 >> $seqres.full +_pwrite_byte 0x61 $blksz $blksz $testdir/file2.chk >> $seqres.full -_pwrite_byte 0x61 $((blksz * 3)) $blksz "$testdir/file2" >> "$seqres.full" -_pwrite_byte 0x61 $((blksz * 3)) $blksz "$testdir/file2.chk" >> "$seqres.full" +_pwrite_byte 0x61 $((blksz * 3)) $blksz $testdir/file2 >> $seqres.full +_pwrite_byte 0x61 $((blksz * 3)) $blksz $testdir/file2.chk >> $seqres.full -"$XFS_IO_PROG" -d -f -c "pwrite -S 0x63 $blksz $((blksz * 3))" "$testdir/file2" >> "$seqres.full" -"$XFS_IO_PROG" -f -c "pwrite -S 0x63 $blksz $((blksz * 3))" "$testdir/file2.chk" >> "$seqres.full" +$XFS_IO_PROG -d -f -c "pwrite -S 0x63 $blksz $((blksz * 3))" $testdir/file2 >> $seqres.full +$XFS_IO_PROG -f -c "pwrite -S 0x63 $blksz $((blksz * 3))" $testdir/file2.chk >> $seqres.full _scratch_remount echo "Compare files" -! cmp -s "$testdir/file1" "$testdir/file2" || _fail "file1 and file2 don't match." -cmp -s "$testdir/file2" "$testdir/file2.chk" || _fail "file2 and file2.chk don't match." +! cmp -s $testdir/file1 $testdir/file2 || _fail "file1 and file2 don't match." +cmp -s $testdir/file2 $testdir/file2.chk || _fail "file2 and file2.chk don't match." # success, all done status=0 diff --git a/tests/generic/229 b/tests/generic/229 index cc86b4e..b6359e8 100755 --- a/tests/generic/229 +++ b/tests/generic/229 @@ -24,8 +24,8 @@ # Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA #----------------------------------------------------------------------- -seq=`basename "$0"` -seqres="$RESULT_DIR/$seq" +seq=`basename $0` +seqres=$RESULT_DIR/$seq echo "QA output created by $seq" here=`pwd` @@ -36,7 +36,7 @@ trap "_cleanup; exit \$status" 0 1 2 3 15 _cleanup() { cd / - rm -rf "$tmp".* "$testdir" + rm -rf $tmp.* $testdir } # get standard environment, filters and checks @@ -49,21 +49,20 @@ _supported_os Linux _require_scratch_reflink _require_xfs_io_command "falloc" -rm -f "$seqres.full" +rm -f $seqres.full pagesz=$(getconf PAGE_SIZE) blksz=$((pagesz / 4)) echo "Format and mount" -_scratch_mkfs_blocksized $blksz > "$seqres.full" 2>&1 -_scratch_mount >> "$seqres.full" 2>&1 +_scratch_mkfs_blocksized $blksz > $seqres.full 2>&1 +_scratch_mount >> $seqres.full 2>&1 -testdir="$SCRATCH_MNT/test-$seq" -rm -rf $testdir +testdir=$SCRATCH_MNT/test-$seq mkdir $testdir real_blksz=$(stat -f -c '%S' $testdir) -test "$real_blksz" != "$blksz" && _notrun "Failed to format with small blocksize." +test $real_blksz != $blksz && _notrun "Failed to format with small blocksize." runtest() { echo "runtest $1 $2" @@ -72,20 +71,20 @@ runtest() { dir=$3 echo "Create the original files" - mkdir -p "$dir" - _pwrite_byte 0x61 0 $pagesz "$dir/file1" >> "$seqres.full" + mkdir -p $dir + _pwrite_byte 0x61 0 $pagesz $dir/file1 >> $seqres.full - "$XFS_IO_PROG" -f -c "truncate $pagesz" "$dir/file2" >> "$seqres.full" - "$XFS_IO_PROG" -f -c "truncate $pagesz" "$dir/file2.chk" >> "$seqres.full" + $XFS_IO_PROG -f -c "truncate $pagesz" $dir/file2 >> $seqres.full + $XFS_IO_PROG -f -c "truncate $pagesz" $dir/file2.chk >> $seqres.full - case "$b2" in + case $b2 in "regular") - _pwrite_byte 0x61 $blksz $blksz "$dir/file2" >> "$seqres.full" - _pwrite_byte 0x61 $blksz $blksz "$dir/file2.chk" >> "$seqres.full" + _pwrite_byte 0x61 $blksz $blksz $dir/file2 >> $seqres.full + _pwrite_byte 0x61 $blksz $blksz $dir/file2.chk >> $seqres.full ;; "unwritten") - "$XFS_IO_PROG" -f -c "falloc -k $blksz $blksz" "$dir/file2" >> "$seqres.full" - _pwrite_byte 0x00 $blksz $blksz "$dir/file2.chk" >> "$seqres.full" + $XFS_IO_PROG -f -c "falloc -k $blksz $blksz" $dir/file2 >> $seqres.full + _pwrite_byte 0x00 $blksz $blksz $dir/file2.chk >> $seqres.full ;; "hole") ;; @@ -93,45 +92,45 @@ runtest() { - case "$b4" in + case $b4 in "regular") - _pwrite_byte 0x61 $((blksz * 3)) $blksz "$dir/file2" >> "$seqres.full" - _pwrite_byte 0x61 $((blksz * 3)) $blksz "$dir/file2.chk" >> "$seqres.full" + _pwrite_byte 0x61 $((blksz * 3)) $blksz $dir/file2 >> $seqres.full + _pwrite_byte 0x61 $((blksz * 3)) $blksz $dir/file2.chk >> $seqres.full ;; "unwritten") - "$XFS_IO_PROG" -f -c "falloc -k $((blksz * 3)) $blksz" "$dir/file2" >> "$seqres.full" - _pwrite_byte 0x00 $((blksz * 3)) $blksz "$dir/file2.chk" >> "$seqres.full" + $XFS_IO_PROG -f -c "falloc -k $((blksz * 3)) $blksz" $dir/file2 >> $seqres.full + _pwrite_byte 0x00 $((blksz * 3)) $blksz $dir/file2.chk >> $seqres.full ;; "hole") ;; esac - _reflink_range "$dir/file1" $blksz "$dir/file2" $((blksz * 2)) $blksz >> "$seqres.full" - _pwrite_byte 0x61 $((blksz * 2)) $blksz "$dir/file2.chk" >> "$seqres.full" + _reflink_range $dir/file1 $blksz $dir/file2 $((blksz * 2)) $blksz >> $seqres.full + _pwrite_byte 0x61 $((blksz * 2)) $blksz $dir/file2.chk >> $seqres.full _scratch_remount echo "Compare files" - ! cmp -s "$dir/file1" "$dir/file2" || _fail "file1 and file2 don't match." - cmp -s "$dir/file2" "$dir/file2.chk" || _fail "file2 and file2.chk don't match." + ! cmp -s $dir/file1 $dir/file2 || _fail "file1 and file2 don't match." + cmp -s $dir/file2 $dir/file2.chk || _fail "file2 and file2.chk don't match." echo "CoW and unmount" - if [ "$b2" = "delalloc" ]; then - _pwrite_byte 0x61 $blksz $blksz "$dir/file2" >> "$seqres.full" - _pwrite_byte 0x61 $blksz $blksz "$dir/file2.chk" >> "$seqres.full" + if [ $b2 = "delalloc" ]; then + _pwrite_byte 0x61 $blksz $blksz $dir/file2 >> $seqres.full + _pwrite_byte 0x61 $blksz $blksz $dir/file2.chk >> $seqres.full fi - if [ "$b4" = "delalloc" ]; then - _pwrite_byte 0x61 $((blksz * 3)) $blksz "$dir/file2" >> "$seqres.full" - _pwrite_byte 0x61 $((blksz * 3)) $blksz "$dir/file2.chk" >> "$seqres.full" + if [ $b4 = "delalloc" ]; then + _pwrite_byte 0x61 $((blksz * 3)) $blksz $dir/file2 >> $seqres.full + _pwrite_byte 0x61 $((blksz * 3)) $blksz $dir/file2.chk >> $seqres.full fi - "$XFS_IO_PROG" -f -c "pwrite -S 0x63 $((blksz + 17)) $((blksz * 3 - 34))" "$dir/file2" >> "$seqres.full" - "$XFS_IO_PROG" -f -c "pwrite -S 0x63 $((blksz + 17)) $((blksz * 3 - 34))" "$dir/file2.chk" >> "$seqres.full" + $XFS_IO_PROG -f -c "pwrite -S 0x63 $((blksz + 17)) $((blksz * 3 - 34))" $dir/file2 >> $seqres.full + $XFS_IO_PROG -f -c "pwrite -S 0x63 $((blksz + 17)) $((blksz * 3 - 34))" $dir/file2.chk >> $seqres.full _scratch_remount echo "Compare files" - ! cmp -s "$dir/file1" "$dir/file2" || _fail "file1 and file2 don't match." - cmp -s "$dir/file2" "$dir/file2.chk" || _fail "file2 and file2.chk don't match." + ! cmp -s $dir/file1 $dir/file2 || _fail "file1 and file2 don't match." + cmp -s $dir/file2 $dir/file2.chk || _fail "file2 and file2.chk don't match." } runtest regular delalloc "$testdir/r-d" diff --git a/tests/generic/238 b/tests/generic/238 index c726770..ce7408c 100755 --- a/tests/generic/238 +++ b/tests/generic/238 @@ -24,8 +24,8 @@ # Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA #----------------------------------------------------------------------- -seq=`basename "$0"` -seqres="$RESULT_DIR/$seq" +seq=`basename $0` +seqres=$RESULT_DIR/$seq echo "QA output created by $seq" here=`pwd` @@ -36,7 +36,7 @@ trap "_cleanup; exit \$status" 0 1 2 3 15 _cleanup() { cd / - rm -rf "$tmp".* "$testdir" + rm -rf $tmp.* $testdir } # get standard environment, filters and checks @@ -49,21 +49,20 @@ _supported_os Linux _require_scratch_reflink _require_xfs_io_command "falloc" -rm -f "$seqres.full" +rm -f $seqres.full pagesz=$(getconf PAGE_SIZE) blksz=$((pagesz / 4)) echo "Format and mount" -_scratch_mkfs_blocksized $blksz > "$seqres.full" 2>&1 -_scratch_mount >> "$seqres.full" 2>&1 +_scratch_mkfs_blocksized $blksz > $seqres.full 2>&1 +_scratch_mount >> $seqres.full 2>&1 -testdir="$SCRATCH_MNT/test-$seq" -rm -rf $testdir +testdir=$SCRATCH_MNT/test-$seq mkdir $testdir real_blksz=$(stat -f -c '%S' $testdir) -test "$real_blksz" != "$blksz" && _notrun "Failed to format with small blocksize." +test $real_blksz != $blksz && _notrun "Failed to format with small blocksize." runtest() { echo "runtest $1 $2" @@ -72,20 +71,20 @@ runtest() { dir=$3 echo "Create the original files" - mkdir -p "$dir" - _pwrite_byte 0x61 0 $pagesz "$dir/file1" >> "$seqres.full" + mkdir -p $dir + _pwrite_byte 0x61 0 $pagesz $dir/file1 >> $seqres.full - "$XFS_IO_PROG" -f -c "truncate $pagesz" "$dir/file2" >> "$seqres.full" - "$XFS_IO_PROG" -f -c "truncate $pagesz" "$dir/file2.chk" >> "$seqres.full" + $XFS_IO_PROG -f -c "truncate $pagesz" $dir/file2 >> $seqres.full + $XFS_IO_PROG -f -c "truncate $pagesz" $dir/file2.chk >> $seqres.full - case "$b2" in + case $b2 in "regular") - _pwrite_byte 0x61 $blksz $blksz "$dir/file2" >> "$seqres.full" - _pwrite_byte 0x61 $blksz $blksz "$dir/file2.chk" >> "$seqres.full" + _pwrite_byte 0x61 $blksz $blksz $dir/file2 >> $seqres.full + _pwrite_byte 0x61 $blksz $blksz $dir/file2.chk >> $seqres.full ;; "unwritten") - "$XFS_IO_PROG" -f -c "falloc -k $blksz $blksz" "$dir/file2" >> "$seqres.full" - _pwrite_byte 0x00 $blksz $blksz "$dir/file2.chk" >> "$seqres.full" + $XFS_IO_PROG -f -c "falloc -k $blksz $blksz" $dir/file2 >> $seqres.full + _pwrite_byte 0x00 $blksz $blksz $dir/file2.chk >> $seqres.full ;; "hole") ;; @@ -93,45 +92,45 @@ runtest() { - case "$b4" in + case $b4 in "regular") - _pwrite_byte 0x61 $((blksz * 3)) $blksz "$dir/file2" >> "$seqres.full" - _pwrite_byte 0x61 $((blksz * 3)) $blksz "$dir/file2.chk" >> "$seqres.full" + _pwrite_byte 0x61 $((blksz * 3)) $blksz $dir/file2 >> $seqres.full + _pwrite_byte 0x61 $((blksz * 3)) $blksz $dir/file2.chk >> $seqres.full ;; "unwritten") - "$XFS_IO_PROG" -f -c "falloc -k $((blksz * 3)) $blksz" "$dir/file2" >> "$seqres.full" - _pwrite_byte 0x00 $((blksz * 3)) $blksz "$dir/file2.chk" >> "$seqres.full" + $XFS_IO_PROG -f -c "falloc -k $((blksz * 3)) $blksz" $dir/file2 >> $seqres.full + _pwrite_byte 0x00 $((blksz * 3)) $blksz $dir/file2.chk >> $seqres.full ;; "hole") ;; esac - _reflink_range "$dir/file1" $blksz "$dir/file2" $((blksz * 2)) $blksz >> "$seqres.full" - _pwrite_byte 0x61 $((blksz * 2)) $blksz "$dir/file2.chk" >> "$seqres.full" + _reflink_range $dir/file1 $blksz $dir/file2 $((blksz * 2)) $blksz >> $seqres.full + _pwrite_byte 0x61 $((blksz * 2)) $blksz $dir/file2.chk >> $seqres.full _scratch_remount echo "Compare files" - ! cmp -s "$dir/file1" "$dir/file2" || _fail "file1 and file2 don't match." - cmp -s "$dir/file2" "$dir/file2.chk" || _fail "file2 and file2.chk don't match." + ! cmp -s $dir/file1 $dir/file2 || _fail "file1 and file2 don't match." + cmp -s $dir/file2 $dir/file2.chk || _fail "file2 and file2.chk don't match." echo "CoW and unmount" - if [ "$b2" = "delalloc" ]; then - _pwrite_byte 0x61 $blksz $blksz "$dir/file2" >> "$seqres.full" - _pwrite_byte 0x61 $blksz $blksz "$dir/file2.chk" >> "$seqres.full" + if [ $b2 = "delalloc" ]; then + _pwrite_byte 0x61 $blksz $blksz $dir/file2 >> $seqres.full + _pwrite_byte 0x61 $blksz $blksz $dir/file2.chk >> $seqres.full fi - if [ "$b4" = "delalloc" ]; then - _pwrite_byte 0x61 $((blksz * 3)) $blksz "$dir/file2" >> "$seqres.full" - _pwrite_byte 0x61 $((blksz * 3)) $blksz "$dir/file2.chk" >> "$seqres.full" + if [ $b4 = "delalloc" ]; then + _pwrite_byte 0x61 $((blksz * 3)) $blksz $dir/file2 >> $seqres.full + _pwrite_byte 0x61 $((blksz * 3)) $blksz $dir/file2.chk >> $seqres.full fi - "$XFS_IO_PROG" -d -f -c "pwrite -S 0x63 $blksz $((blksz * 3))" "$dir/file2" >> "$seqres.full" - "$XFS_IO_PROG" -f -c "pwrite -S 0x63 $blksz $((blksz * 3))" "$dir/file2.chk" >> "$seqres.full" + $XFS_IO_PROG -d -f -c "pwrite -S 0x63 $blksz $((blksz * 3))" $dir/file2 >> $seqres.full + $XFS_IO_PROG -f -c "pwrite -S 0x63 $blksz $((blksz * 3))" $dir/file2.chk >> $seqres.full _scratch_remount echo "Compare files" - ! cmp -s "$dir/file1" "$dir/file2" || _fail "file1 and file2 don't match." - cmp -s "$dir/file2" "$dir/file2.chk" || _fail "file2 and file2.chk don't match." + ! cmp -s $dir/file1 $dir/file2 || _fail "file1 and file2 don't match." + cmp -s $dir/file2 $dir/file2.chk || _fail "file2 and file2.chk don't match." } runtest regular delalloc "$testdir/r-d" diff --git a/tests/generic/242 b/tests/generic/242 index 1141aa4..1f174df 100755 --- a/tests/generic/242 +++ b/tests/generic/242 @@ -23,8 +23,8 @@ # Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA #----------------------------------------------------------------------- -seq=`basename "$0"` -seqres="$RESULT_DIR/$seq" +seq=`basename $0` +seqres=$RESULT_DIR/$seq echo "QA output created by $seq" here=`pwd` @@ -35,7 +35,7 @@ trap "_cleanup; exit \$status" 0 1 2 3 15 _cleanup() { cd / - rm -rf "$tmp".* "$testdir" + rm -rf $tmp.* $testdir } # get standard environment, filters and checks @@ -48,47 +48,48 @@ _supported_os Linux _require_scratch_reflink _require_cp_reflink -rm -f "$seqres.full" +rm -f $seqres.full echo "Format and mount" -_scratch_mkfs > "$seqres.full" 2>&1 -_scratch_mount >> "$seqres.full" 2>&1 +_scratch_mkfs > $seqres.full 2>&1 +_scratch_mount >> $seqres.full 2>&1 -testdir="$SCRATCH_MNT/test-$seq" -rm -rf $testdir +testdir=$SCRATCH_MNT/test-$seq mkdir $testdir blksz=65536 nr=6400 -bsz=1280 +filesize=$((blksz * nr)) +bufnr=1280 +bufsize=$((blksz * bufnr)) -free_blocks=$(stat -f -c '%a' "$testdir") -real_blksz=$(stat -f -c '%S' "$testdir") -space_needed=$(((blksz * nr * 3) * 5 / 4)) +free_blocks=$(stat -f -c '%a' $testdir) +real_blksz=$(stat -f -c '%S' $testdir) +space_needed=$(((filesize * 3) * 5 / 4)) space_avail=$((free_blocks * real_blksz)) test $space_needed -gt $space_avail && _notrun "Not enough space. $space_avail < $space_needed" echo "Create the original files" -"$XFS_IO_PROG" -f -c "pwrite -S 0x61 -b $((blksz * bsz)) 0 $((blksz * nr))" "$testdir/file1" >> "$seqres.full" -_cp_reflink "$testdir/file1" "$testdir/file2" >> "$seqres.full" -"$XFS_IO_PROG" -f -c "pwrite -S 0x61 -b $((blksz * bsz)) 0 $((blksz * nr))" "$testdir/file2.chk" >> "$seqres.full" +$XFS_IO_PROG -f -c "pwrite -S 0x61 -b $bufsize 0 $filesize" $testdir/file1 >> $seqres.full +_cp_reflink $testdir/file1 $testdir/file2 >> $seqres.full +$XFS_IO_PROG -f -c "pwrite -S 0x61 -b $bufsize 0 $filesize" $testdir/file2.chk >> $seqres.full _scratch_remount echo "Compare files" -md5sum "$testdir/file1" | _filter_scratch -md5sum "$testdir/file2" | _filter_scratch -md5sum "$testdir/file2.chk" | _filter_scratch +md5sum $testdir/file1 | _filter_scratch +md5sum $testdir/file2 | _filter_scratch +md5sum $testdir/file2.chk | _filter_scratch echo "CoW and unmount" -"$XFS_IO_PROG" -f -c "pwrite -S 0x63 -b $((blksz * bsz)) 0 $((blksz * nr))" "$testdir/file2" >> "$seqres.full" -"$XFS_IO_PROG" -f -c "pwrite -S 0x63 -b $((blksz * bsz)) 0 $((blksz * nr))" "$testdir/file2.chk" >> "$seqres.full" +$XFS_IO_PROG -f -c "pwrite -S 0x63 -b $bufsize 0 $filesize" $testdir/file2 >> $seqres.full +$XFS_IO_PROG -f -c "pwrite -S 0x63 -b $bufsize 0 $filesize" $testdir/file2.chk >> $seqres.full _scratch_remount echo "Compare files" -md5sum "$testdir/file1" | _filter_scratch -md5sum "$testdir/file2" | _filter_scratch -md5sum "$testdir/file2.chk" | _filter_scratch +md5sum $testdir/file1 | _filter_scratch +md5sum $testdir/file2 | _filter_scratch +md5sum $testdir/file2.chk | _filter_scratch # success, all done status=0 diff --git a/tests/generic/243 b/tests/generic/243 index a514591..127070e 100755 --- a/tests/generic/243 +++ b/tests/generic/243 @@ -23,8 +23,8 @@ # Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA #----------------------------------------------------------------------- -seq=`basename "$0"` -seqres="$RESULT_DIR/$seq" +seq=`basename $0` +seqres=$RESULT_DIR/$seq echo "QA output created by $seq" here=`pwd` @@ -35,7 +35,7 @@ trap "_cleanup; exit \$status" 0 1 2 3 15 _cleanup() { cd / - rm -rf "$tmp".* "$testdir" + rm -rf $tmp.* $testdir } # get standard environment, filters and checks @@ -48,47 +48,48 @@ _supported_os Linux _require_scratch_reflink _require_cp_reflink -rm -f "$seqres.full" +rm -f $seqres.full echo "Format and mount" -_scratch_mkfs > "$seqres.full" 2>&1 -_scratch_mount >> "$seqres.full" 2>&1 +_scratch_mkfs > $seqres.full 2>&1 +_scratch_mount >> $seqres.full 2>&1 -testdir="$SCRATCH_MNT/test-$seq" -rm -rf $testdir +testdir=$SCRATCH_MNT/test-$seq mkdir $testdir blksz=65536 nr=6400 -bsz=1280 +filesize=$((blksz * nr)) +bufnr=1280 +bufsize=$((blksz * bufnr)) -free_blocks=$(stat -f -c '%a' "$testdir") -real_blksz=$(stat -f -c '%S' "$testdir") -space_needed=$(((blksz * nr * 3) * 5 / 4)) +free_blocks=$(stat -f -c '%a' $testdir) +real_blksz=$(stat -f -c '%S' $testdir) +space_needed=$(((filesize * 3) * 5 / 4)) space_avail=$((free_blocks * real_blksz)) test $space_needed -gt $space_avail && _notrun "Not enough space. $space_avail < $space_needed" echo "Create the original files" -"$XFS_IO_PROG" -f -c "pwrite -S 0x61 -b $((blksz * bsz)) 0 $((blksz * nr))" "$testdir/file1" >> "$seqres.full" -_cp_reflink "$testdir/file1" "$testdir/file2" >> "$seqres.full" -"$XFS_IO_PROG" -f -c "pwrite -S 0x61 -b $((blksz * bsz)) 0 $((blksz * nr))" "$testdir/file2.chk" >> "$seqres.full" +$XFS_IO_PROG -f -c "pwrite -S 0x61 -b $bufsize 0 $filesize" $testdir/file1 >> $seqres.full +_cp_reflink $testdir/file1 $testdir/file2 >> $seqres.full +$XFS_IO_PROG -f -c "pwrite -S 0x61 -b $bufsize 0 $filesize" $testdir/file2.chk >> $seqres.full _scratch_remount echo "Compare files" -md5sum "$testdir/file1" | _filter_scratch -md5sum "$testdir/file2" | _filter_scratch -md5sum "$testdir/file2.chk" | _filter_scratch +md5sum $testdir/file1 | _filter_scratch +md5sum $testdir/file2 | _filter_scratch +md5sum $testdir/file2.chk | _filter_scratch echo "CoW and unmount" -"$XFS_IO_PROG" -d -f -c "pwrite -S 0x63 -b $((blksz * bsz)) 0 $((blksz * nr))" "$testdir/file2" >> "$seqres.full" -"$XFS_IO_PROG" -f -c "pwrite -S 0x63 -b $((blksz * bsz)) 0 $((blksz * nr))" "$testdir/file2.chk" >> "$seqres.full" +$XFS_IO_PROG -d -f -c "pwrite -S 0x63 -b $bufsize 0 $filesize" $testdir/file2 >> $seqres.full +$XFS_IO_PROG -f -c "pwrite -S 0x63 -b $bufsize 0 $filesize" $testdir/file2.chk >> $seqres.full _scratch_remount echo "Compare files" -md5sum "$testdir/file1" | _filter_scratch -md5sum "$testdir/file2" | _filter_scratch -md5sum "$testdir/file2.chk" | _filter_scratch +md5sum $testdir/file1 | _filter_scratch +md5sum $testdir/file2 | _filter_scratch +md5sum $testdir/file2.chk | _filter_scratch # success, all done status=0 diff --git a/tests/xfs/127 b/tests/xfs/127 index 392e63c..67a8c96 100755 --- a/tests/xfs/127 +++ b/tests/xfs/127 @@ -21,8 +21,8 @@ #----------------------------------------------------------------------- # -seq=`basename "$0"` -seqres="$RESULT_DIR/$seq" +seq=`basename $0` +seqres=$RESULT_DIR/$seq echo "QA output created by $seq" here=`pwd` @@ -33,7 +33,7 @@ trap "_cleanup; exit \$status" 0 1 2 3 15 _cleanup() { cd / - rm -f "$tmp".* + rm -f $tmp.* } # get standard environment, filters and checks @@ -48,27 +48,26 @@ _require_scratch_reflink _require_cp_reflink echo "Format and mount" -_scratch_mkfs -d size=$((2 * 4096 * 4096)) -l size=4194304 > "$seqres.full" 2>&1 -_scratch_mount >> "$seqres.full" 2>&1 +_scratch_mkfs -d size=$((2 * 4096 * 4096)) -l size=4194304 > $seqres.full 2>&1 +_scratch_mount >> $seqres.full 2>&1 -testdir="$SCRATCH_MNT/test-$seq" -rm -rf "$testdir" -mkdir "$testdir" +testdir=$SCRATCH_MNT/test-$seq +mkdir $testdir echo "Create the original file and reflink to copy1, copy2" -blksz="$(stat -f "$testdir" -c '%S')" -_pwrite_byte 0x61 0 $((blksz * 14 + 71)) "$testdir/original" >> "$seqres.full" -_cp_reflink "$testdir/original" "$testdir/copy1" -_cp_reflink "$testdir/copy1" "$testdir/copy2" +blksz="$(stat -f $testdir -c '%S')" +_pwrite_byte 0x61 0 $((blksz * 14 + 71)) $testdir/original >> $seqres.full +_cp_reflink $testdir/original $testdir/copy1 +_cp_reflink $testdir/copy1 $testdir/copy2 echo "Grow fs" -"$XFS_GROWFS_PROG" "$SCRATCH_MNT" 2>&1 | _filter_growfs >> "$seqres.full" +$XFS_GROWFS_PROG $SCRATCH_MNT 2>&1 | _filter_growfs >> $seqres.full _scratch_remount echo "Create more reflink copies" -_cp_reflink "$testdir/original" "$testdir/copy3" +_cp_reflink $testdir/original $testdir/copy3 -xfs_info "$SCRATCH_MNT" >> "$seqres.full" +xfs_info $SCRATCH_MNT >> $seqres.full # success, all done status=0 diff --git a/tests/xfs/128 b/tests/xfs/128 index f230adf..56778fc 100755 --- a/tests/xfs/128 +++ b/tests/xfs/128 @@ -21,8 +21,8 @@ #----------------------------------------------------------------------- # -seq=`basename "$0"` -seqres="$RESULT_DIR/$seq" +seq=`basename $0` +seqres=$RESULT_DIR/$seq echo "QA output created by $seq" here=`pwd` @@ -33,7 +33,7 @@ trap "_cleanup; exit \$status" 0 1 2 3 15 _cleanup() { cd / - rm -f "$tmp".* + rm -f $tmp.* } # get standard environment, filters and checks @@ -49,13 +49,12 @@ _require_scratch_reflink _require_cp_reflink echo "Format and mount" -_scratch_mkfs > "$seqres.full" 2>&1 -_scratch_mount >> "$seqres.full" 2>&1 +_scratch_mkfs > $seqres.full 2>&1 +_scratch_mount >> $seqres.full 2>&1 -testdir="$SCRATCH_MNT/test-$seq" -rm -rf "$testdir" -mkdir "$testdir" -free_blocks0=$(stat -f "$testdir" -c '%f') +testdir=$SCRATCH_MNT/test-$seq +mkdir $testdir +free_blocks0=$(stat -f $testdir -c '%f') echo "Create the original file and reflink to file2, file3" blks=2000 @@ -63,57 +62,57 @@ margin=160 blksz=65536 real_blksz="$(stat -f $testdir -c '%S')" blksz_factor=$((blksz / real_blksz)) -_pwrite_byte 0x61 0 $((blks * blksz)) "$testdir/file1" >> "$seqres.full" -_cp_reflink "$testdir/file1" "$testdir/file2" -_cp_reflink "$testdir/file2" "$testdir/file3" -_cp_reflink "$testdir/file3" "$testdir/file4" +_pwrite_byte 0x61 0 $((blks * blksz)) $testdir/file1 >> $seqres.full +_cp_reflink $testdir/file1 $testdir/file2 +_cp_reflink $testdir/file2 $testdir/file3 +_cp_reflink $testdir/file3 $testdir/file4 _test_remount -free_blocks1=$(stat -f "$testdir" -c '%f') +free_blocks1=$(stat -f $testdir -c '%f') -md5sum "$testdir/file1" | _filter_scratch -md5sum "$testdir/file2" | _filter_scratch -md5sum "$testdir/file3" | _filter_scratch -md5sum "$testdir/file4" | _filter_scratch +md5sum $testdir/file1 | _filter_scratch +md5sum $testdir/file2 | _filter_scratch +md5sum $testdir/file3 | _filter_scratch +md5sum $testdir/file4 | _filter_scratch -c01=$(_md5_checksum "$testdir/file1") -c02=$(_md5_checksum "$testdir/file2") -c03=$(_md5_checksum "$testdir/file3") -c04=$(_md5_checksum "$testdir/file4") +c01=$(_md5_checksum $testdir/file1) +c02=$(_md5_checksum $testdir/file2) +c03=$(_md5_checksum $testdir/file3) +c04=$(_md5_checksum $testdir/file4) echo "CoW the reflink copies" -_pwrite_byte 0x62 $blksz $blksz "$testdir/file2" >> "$seqres.full" -_pwrite_byte 0x63 $(( blksz * (blks - 1) )) $blksz "$testdir/file3" >> "$seqres.full" +_pwrite_byte 0x62 $blksz $blksz $testdir/file2 >> $seqres.full +_pwrite_byte 0x63 $(( blksz * (blks - 1) )) $blksz $testdir/file3 >> $seqres.full _test_remount -free_blocks2=$(stat -f "$testdir" -c '%f') +free_blocks2=$(stat -f $testdir -c '%f') -md5sum "$testdir/file1" | _filter_scratch -md5sum "$testdir/file2" | _filter_scratch -md5sum "$testdir/file3" | _filter_scratch -md5sum "$testdir/file4" | _filter_scratch +md5sum $testdir/file1 | _filter_scratch +md5sum $testdir/file2 | _filter_scratch +md5sum $testdir/file3 | _filter_scratch +md5sum $testdir/file4 | _filter_scratch -c11=$(_md5_checksum "$testdir/file1") -c12=$(_md5_checksum "$testdir/file2") -c13=$(_md5_checksum "$testdir/file3") -c14=$(_md5_checksum "$testdir/file4") +c11=$(_md5_checksum $testdir/file1) +c12=$(_md5_checksum $testdir/file2) +c13=$(_md5_checksum $testdir/file3) +c14=$(_md5_checksum $testdir/file4) echo "Defragment" -lsattr -l "$testdir/" | _filter_scratch | _filter_spaces -xfs_fsr -v -d "$testdir/file1" >> "$seqres.full" -xfs_fsr -v -d "$testdir/file2" >> "$seqres.full" # fsr probably breaks the link -xfs_fsr -v -d "$testdir/file3" >> "$seqres.full" # fsr probably breaks the link -xfs_fsr -v -d "$testdir/file4" >> "$seqres.full" # fsr probably ignores this file +lsattr -l $testdir/ | _filter_scratch | _filter_spaces +xfs_fsr -v -d $testdir/file1 >> $seqres.full +xfs_fsr -v -d $testdir/file2 >> $seqres.full # fsr probably breaks the link +xfs_fsr -v -d $testdir/file3 >> $seqres.full # fsr probably breaks the link +xfs_fsr -v -d $testdir/file4 >> $seqres.full # fsr probably ignores this file _test_remount -free_blocks3=$(stat -f "$testdir" -c '%f') +free_blocks3=$(stat -f $testdir -c '%f') -md5sum "$testdir/file1" | _filter_scratch -md5sum "$testdir/file2" | _filter_scratch -md5sum "$testdir/file3" | _filter_scratch -md5sum "$testdir/file4" | _filter_scratch +md5sum $testdir/file1 | _filter_scratch +md5sum $testdir/file2 | _filter_scratch +md5sum $testdir/file3 | _filter_scratch +md5sum $testdir/file4 | _filter_scratch -c21=$(_md5_checksum "$testdir/file1") -c22=$(_md5_checksum "$testdir/file2") -c23=$(_md5_checksum "$testdir/file3") -c24=$(_md5_checksum "$testdir/file4") +c21=$(_md5_checksum $testdir/file1) +c22=$(_md5_checksum $testdir/file2) +c23=$(_md5_checksum $testdir/file3) +c24=$(_md5_checksum $testdir/file4) echo "Check files" test $c01 = $c02 || echo "Files 1-2 do not match" diff --git a/tests/xfs/129 b/tests/xfs/129 index 8d608f2..d29f842 100755 --- a/tests/xfs/129 +++ b/tests/xfs/129 @@ -22,7 +22,7 @@ # Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA #----------------------------------------------------------------------- -seq=`basename "$0"` +seq=`basename $0` seqres=$RESULT_DIR/$seq echo "QA output created by $seq" @@ -34,8 +34,8 @@ trap "_cleanup; exit \$status" 0 1 2 3 15 _cleanup() { cd / - umount "$SCRATCH_MNT" > /dev/null 2>&1 - rm -rf "$tmp".* "$testdir" "$metadump_file" "$TEST_DIR/image" + umount $SCRATCH_MNT > /dev/null 2>&1 + rm -rf $tmp.* $testdir $metadump_file $TEST_DIR/image } # get standard environment, filters and checks @@ -49,39 +49,38 @@ _supported_fs xfs _require_loop _require_scratch_reflink -rm -f "$seqres.full" +rm -f $seqres.full _scratch_mkfs >/dev/null 2>&1 _scratch_mount -testdir="$SCRATCH_MNT/test-$seq" -rm -rf "$testdir" -mkdir "$testdir" -metadump_file="$TEST_DIR/${seq}_metadump" +testdir=$SCRATCH_MNT/test-$seq +mkdir $testdir +metadump_file=$TEST_DIR/${seq}_metadump echo "Create the original file blocks" -blksz="$(stat -f "$testdir" -c '%S')" +blksz="$(stat -f $testdir -c '%S')" nr_blks=$((4 * blksz / 12)) -_pwrite_byte 0x61 0 $((blksz * nr_blks)) "$testdir/file1" >> "$seqres.full" +_pwrite_byte 0x61 0 $((blksz * nr_blks)) $testdir/file1 >> $seqres.full echo "Reflink every other block" seq 1 2 $((nr_blks - 1)) | while read nr; do - _reflink_range "$testdir/file1" $((nr * blksz)) \ - "$testdir/file2" $((nr * blksz)) $blksz >> "$seqres.full" + _reflink_range $testdir/file1 $((nr * blksz)) \ + $testdir/file2 $((nr * blksz)) $blksz >> $seqres.full done echo "Create metadump file" _scratch_unmount -_scratch_metadump "$metadump_file" +_scratch_metadump $metadump_file # Now restore the obfuscated one back and take a look around echo "Restore metadump" -xfs_mdrestore "$metadump_file" "$TEST_DIR/image" -_mount -t $FSTYP "$TEST_DIR/image" "$SCRATCH_MNT" -umount "$SCRATCH_MNT" +xfs_mdrestore $metadump_file $TEST_DIR/image +_mount -t $FSTYP $TEST_DIR/image $SCRATCH_MNT +umount $SCRATCH_MNT echo "Check restored fs" -_check_generic_filesystem "$metadump_file" +_check_generic_filesystem $metadump_file # success, all done status=0 diff --git a/tests/xfs/131 b/tests/xfs/131 index f553a44..8df77ff 100755 --- a/tests/xfs/131 +++ b/tests/xfs/131 @@ -20,7 +20,7 @@ # Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA #----------------------------------------------------------------------- -seq=`basename "$0"` +seq=`basename $0` seqres=$RESULT_DIR/$seq echo "QA output created by $seq" @@ -32,8 +32,8 @@ trap "_cleanup; exit \$status" 0 1 2 3 15 _cleanup() { cd / - umount "$SCRATCH_MNT" > /dev/null 2>&1 - rm -rf "$tmp".* "$testdir" "$metadump_file" + umount $SCRATCH_MNT > /dev/null 2>&1 + rm -rf $tmp.* $testdir $metadump_file } # get standard environment, filters and checks @@ -48,24 +48,23 @@ _require_realtime _require_scratch_reflink _require_cp_reflink -rm -f "$seqres.full" +rm -f $seqres.full echo "Format and mount scratch device" -_scratch_mkfs >> "$seqres.full" +_scratch_mkfs >> $seqres.full _scratch_mount -testdir="$SCRATCH_MNT/test-$seq" -rm -rf "$testdir" -mkdir "$testdir" +testdir=$SCRATCH_MNT/test-$seq +mkdir $testdir echo "Create the original file blocks" blksz=65536 -$XFS_IO_PROG -R -f -c "truncate $blksz" "$testdir/file1" +$XFS_IO_PROG -R -f -c "truncate $blksz" $testdir/file1 echo "Reflink every block" -_cp_reflink "$testdir/file1" "$testdir/file2" 2>&1 | _filter_scratch +_cp_reflink $testdir/file1 $testdir/file2 2>&1 | _filter_scratch -test -s "$testdir/file2" && _fail "Should not be able to reflink a realtime file." +test -s $testdir/file2 && _fail "Should not be able to reflink a realtime file." # success, all done status=0 diff --git a/tests/xfs/132 b/tests/xfs/132 index 9c57c3b..cf3d645 100755 --- a/tests/xfs/132 +++ b/tests/xfs/132 @@ -37,8 +37,8 @@ # Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA #----------------------------------------------------------------------- -seq=`basename "$0"` -seqres="$RESULT_DIR/$seq" +seq=`basename $0` +seqres=$RESULT_DIR/$seq echo "QA output created by $seq" here=`pwd` @@ -49,7 +49,7 @@ trap "_cleanup; exit \$status" 0 1 2 3 15 _cleanup() { cd / - rm -rf "$tmp".* "$testdir" + rm -rf $tmp.* $testdir } # get standard environment, filters and checks @@ -65,53 +65,54 @@ _require_test_lsattr _require_cp_reflink _require_xfs_io_command "falloc" -rm -f "$seqres.full" +rm -f $seqres.full -testdir="$TEST_DIR/test-$seq" -rm -rf "$testdir" -mkdir "$testdir" +testdir=$TEST_DIR/test-$seq +rm -rf $testdir +mkdir $testdir echo "Create the original file blocks" -blksz="$(stat -f "$testdir" -c '%S')" +blksz="$(stat -f $testdir -c '%S')" blks=2000 margin=100 sz=$((blksz * blks)) -free_blocks0=$(stat -f "$testdir" -c '%f') +free_blocks0=$(stat -f $testdir -c '%f') nr=4 -_pwrite_byte 0x61 0 $sz "$testdir/file1" >> "$seqres.full" +filesize=$((blksz * nr)) +_pwrite_byte 0x61 0 $sz $testdir/file1 >> $seqres.full _test_remount echo "Create the reflink copies" for i in `seq 2 $nr`; do - _cp_reflink "$testdir/file1" "$testdir/file$i" + _cp_reflink $testdir/file1 $testdir/file$i done _test_remount -free_blocks1=$(stat -f "$testdir" -c '%f') +free_blocks1=$(stat -f $testdir -c '%f') lsattr -l $testdir/ | _filter_test_dir | _filter_spaces echo "funshare part of a file" -"$XFS_IO_PROG" -f -c "falloc 0 $((sz / 2))" "$testdir/file2" +$XFS_IO_PROG -f -c "falloc 0 $((sz / 2))" $testdir/file2 _test_remount lsattr -l $testdir/ | _filter_test_dir | _filter_spaces echo "funshare some of the copies" -"$XFS_IO_PROG" -f -c "falloc 0 $sz" "$testdir/file2" -"$XFS_IO_PROG" -f -c "falloc 0 $sz" "$testdir/file3" +$XFS_IO_PROG -f -c "falloc 0 $sz" $testdir/file2 +$XFS_IO_PROG -f -c "falloc 0 $sz" $testdir/file3 _test_remount -free_blocks2=$(stat -f "$testdir" -c '%f') +free_blocks2=$(stat -f $testdir -c '%f') lsattr -l $testdir/ | _filter_test_dir | _filter_spaces echo "funshare the rest of the files" -"$XFS_IO_PROG" -f -c "falloc 0 $sz" "$testdir/file4" -"$XFS_IO_PROG" -f -c "falloc 0 $sz" "$testdir/file1" +$XFS_IO_PROG -f -c "falloc 0 $sz" $testdir/file4 +$XFS_IO_PROG -f -c "falloc 0 $sz" $testdir/file1 _test_remount -free_blocks3=$(stat -f "$testdir" -c '%f') +free_blocks3=$(stat -f $testdir -c '%f') lsattr -l $testdir/ | _filter_test_dir | _filter_spaces echo "Rewrite the original file" -_pwrite_byte 0x65 0 $sz "$testdir/file1" >> "$seqres.full" +_pwrite_byte 0x65 0 $sz $testdir/file1 >> $seqres.full _test_remount -free_blocks4=$(stat -f "$testdir" -c '%f') +free_blocks4=$(stat -f $testdir -c '%f') lsattr -l $testdir/ | _filter_test_dir | _filter_spaces #echo $free_blocks0 $free_blocks1 $free_blocks2 $free_blocks3 $free_blocks4 diff --git a/tests/xfs/139 b/tests/xfs/139 index 55dd7d0..ecd88e6 100755 --- a/tests/xfs/139 +++ b/tests/xfs/139 @@ -21,8 +21,8 @@ # Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA #----------------------------------------------------------------------- -seq=`basename "$0"` -seqres="$RESULT_DIR/$seq" +seq=`basename $0` +seqres=$RESULT_DIR/$seq echo "QA output created by $seq" here=`pwd` @@ -33,7 +33,7 @@ trap "_cleanup; exit \$status" 0 1 2 3 15 _cleanup() { cd / - rm -rf "$tmp".* "$testdir" + rm -rf $tmp.* $testdir } # get standard environment, filters and checks @@ -46,32 +46,31 @@ _supported_os Linux _require_scratch_reflink _require_cp_reflink -rm -f "$seqres.full" +rm -f $seqres.full echo "Format and mount" -_scratch_mkfs -d agsize=$((32 * 1048576)) > "$seqres.full" 2>&1 -_scratch_mount >> "$seqres.full" 2>&1 +_scratch_mkfs -d agsize=$((32 * 1048576)) > $seqres.full 2>&1 +_scratch_mount >> $seqres.full 2>&1 -testdir="$SCRATCH_MNT/test-$seq" -rm -rf "$testdir" -mkdir "$testdir" -blksz="$(stat -f "$testdir" -c '%S')" +testdir=$SCRATCH_MNT/test-$seq +mkdir $testdir +blksz="$(stat -f $testdir -c '%S')" echo "Create the original files" sz=$((48 * 1048576)) nr=$((sz / blksz)) -_pwrite_byte 0x61 0 $sz "$testdir/file1" >> "$seqres.full" -_cp_reflink "$testdir/file1" "$testdir/file2" >> "$seqres.full" +_pwrite_byte 0x61 0 $sz $testdir/file1 >> $seqres.full +_cp_reflink $testdir/file1 $testdir/file2 >> $seqres.full _scratch_remount echo "CoW every other block" -_pwrite_byte 0x62 0 $sz "$testdir/file1" >> "$seqres.full" +_pwrite_byte 0x62 0 $sz $testdir/file1 >> $seqres.full _scratch_remount echo "Compare files" -md5sum "$testdir/file1" | _filter_scratch -md5sum "$testdir/file2" | _filter_scratch -#filefrag -v "$testdir/file1" "$testdir/file2" +md5sum $testdir/file1 | _filter_scratch +md5sum $testdir/file2 | _filter_scratch +#filefrag -v $testdir/file1 $testdir/file2 # success, all done status=0 diff --git a/tests/xfs/140 b/tests/xfs/140 index a379ca7..6dfe581 100644 --- a/tests/xfs/140 +++ b/tests/xfs/140 @@ -21,8 +21,8 @@ # Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA #----------------------------------------------------------------------- -seq=`basename "$0"` -seqres="$RESULT_DIR/$seq" +seq=`basename $0` +seqres=$RESULT_DIR/$seq echo "QA output created by $seq" here=`pwd` @@ -33,7 +33,7 @@ trap "_cleanup; exit \$status" 0 1 2 3 15 _cleanup() { cd / - rm -rf "$tmp".* "$testdir" + rm -rf $tmp.* $testdir } # get standard environment, filters and checks @@ -46,39 +46,38 @@ _supported_os Linux _require_scratch_reflink _require_cp_reflink -rm -f "$seqres.full" +rm -f $seqres.full echo "Format and mount" -_scratch_mkfs -d agsize=$((32 * 1048576)) > "$seqres.full" 2>&1 -_scratch_mount >> "$seqres.full" 2>&1 +_scratch_mkfs -d agsize=$((32 * 1048576)) > $seqres.full 2>&1 +_scratch_mount >> $seqres.full 2>&1 -testdir="$SCRATCH_MNT/test-$seq" -rm -rf "$testdir" -mkdir "$testdir" -blksz="$(stat -f -c '%S' "$testdir")" +testdir=$SCRATCH_MNT/test-$seq +mkdir $testdir +blksz=$(stat -f -c '%S' $testdir) echo "Create the original files" sz=$((48 * 1048576)) nr=$((sz / blksz)) -_pwrite_byte 0x61 0 $sz "$testdir/file1" >> "$seqres.full" -_cp_reflink "$testdir/file1" "$testdir/file2" >> "$seqres.full" -_pwrite_byte 0x61 0 $sz "$testdir/file2.chk" >> "$seqres.full" +_pwrite_byte 0x61 0 $sz $testdir/file1 >> $seqres.full +_cp_reflink $testdir/file1 $testdir/file2 >> $seqres.full +_pwrite_byte 0x61 0 $sz $testdir/file2.chk >> $seqres.full _scratch_remount echo "Compare files" -cmp -s "$testdir/file1" "$testdir/file2" || echo "file1 and file2 do not match" -cmp -s "$testdir/file2" "$testdir/file2.chk" || echo "file2 and file2.chk do not match" +cmp -s $testdir/file1 $testdir/file2 || echo "file1 and file2 do not match" +cmp -s $testdir/file2 $testdir/file2.chk || echo "file2 and file2.chk do not match" echo "CoW every other block" seq 1 2 $((nr - 1)) | while read f; do - _pwrite_byte 0x62 $((f * blksz)) $blksz "$testdir/file2" >> "$seqres.full" - _pwrite_byte 0x62 $((f * blksz)) $blksz "$testdir/file2.chk" >> "$seqres.full" + _pwrite_byte 0x62 $((f * blksz)) $blksz $testdir/file2 >> $seqres.full + _pwrite_byte 0x62 $((f * blksz)) $blksz $testdir/file2.chk >> $seqres.full done _scratch_remount echo "Compare files" -! cmp -s "$testdir/file1" "$testdir/file2" || echo "file1 and file2 must not match" -cmp -s "$testdir/file2" "$testdir/file2.chk" || echo "file2 and file2.chk do not match" +! cmp -s $testdir/file1 $testdir/file2 || echo "file1 and file2 must not match" +cmp -s $testdir/file2 $testdir/file2.chk || echo "file2 and file2.chk do not match" # success, all done status=0 From darrick.wong@oracle.com Thu Feb 11 17:41:14 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay3.corp.sgi.com [198.149.34.15]) by oss.sgi.com (Postfix) with ESMTP id 3574B7F51 for ; Thu, 11 Feb 2016 17:41:14 -0600 (CST) Received: from cuda.sgi.com (cuda1.sgi.com [192.48.157.11]) by relay3.corp.sgi.com (Postfix) with ESMTP id D5180AC006 for ; Thu, 11 Feb 2016 15:41:13 -0800 (PST) X-ASG-Debug-ID: 1455234070-04bdf066ec73910001-NocioJ Received: from userp1040.oracle.com (userp1040.oracle.com [156.151.31.81]) by cuda.sgi.com with ESMTP id WqM4xXAbNw15k46G (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO) for ; Thu, 11 Feb 2016 15:41:10 -0800 (PST) X-Barracuda-Envelope-From: darrick.wong@oracle.com X-Barracuda-Apparent-Source-IP: 156.151.31.81 Received: from userv0022.oracle.com (userv0022.oracle.com [156.151.31.74]) by userp1040.oracle.com (Sentrion-MTA-4.3.2/Sentrion-MTA-4.3.2) with ESMTP id u1BNf7Lt000702 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 11 Feb 2016 23:41:07 GMT Received: from userv0121.oracle.com (userv0121.oracle.com [156.151.31.72]) by userv0022.oracle.com (8.14.4/8.13.8) with ESMTP id u1BNf7sf025172 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=FAIL); Thu, 11 Feb 2016 23:41:07 GMT Received: from abhmp0009.oracle.com (abhmp0009.oracle.com [141.146.116.15]) by userv0121.oracle.com (8.13.8/8.13.8) with ESMTP id u1BNf66Q006430; Thu, 11 Feb 2016 23:41:06 GMT Received: from localhost (/10.145.178.207) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Thu, 11 Feb 2016 15:41:06 -0800 Subject: [PATCH 16/32] reflink: ensure that we can handle reflinking a lot of extents From: "Darrick J. Wong" X-ASG-Orig-Subj: [PATCH 16/32] reflink: ensure that we can handle reflinking a lot of extents To: david@fromorbit.com, darrick.wong@oracle.com Cc: linux-btrfs@vger.kernel.org, Christoph Hellwig , fstests@vger.kernel.org, xfs@oss.sgi.com Date: Thu, 11 Feb 2016 15:41:04 -0800 Message-ID: <20160211234104.2202.3715.stgit@birch.djwong.org> In-Reply-To: <20160211233916.2202.40961.stgit@birch.djwong.org> References: <20160211233916.2202.40961.stgit@birch.djwong.org> User-Agent: StGit/0.17.1-dirty MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit X-Source-IP: userv0022.oracle.com [156.151.31.74] X-Barracuda-Connect: userp1040.oracle.com[156.151.31.81] X-Barracuda-Start-Time: 1455234070 X-Barracuda-Encrypted: ECDHE-RSA-AES256-GCM-SHA384 X-Barracuda-URL: https://192.48.157.11:443/cgi-mod/mark.cgi X-Barracuda-BRTS-Status: 1 X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-Spam-Score: 0.00 X-Barracuda-Spam-Status: No, SCORE=0.00 using per-user scores of TAG_LEVEL=1000.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.7 tests=BSF_SC0_MISMATCH_TO, UNPARSEABLE_RELAY X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.3.26959 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 0.00 BSF_SC0_MISMATCH_TO Envelope rcpt doesn't match header 0.00 UNPARSEABLE_RELAY Informational: message has unparseable relay lines Update the existing stress tests to ensure that we can handle reflinking the same block a million times, and that we can handle reflinking million different extents. Add a couple of tests to ensure that we can ^C and SIGKILL our way out of long-running reflinks. v2: Don't run the signal tests on NFS, as we cannot interrupt NFS clone operations. Signed-off-by: Darrick J. Wong [hch@lst.de: don't run on NFS] Signed-off-by: Christoph Hellwig --- .gitignore | 1 src/Makefile | 2 - src/punch-alternating.c | 59 ++++++++++++++++++++++++++++ tests/generic/175 | 46 +++++++--------------- tests/generic/175.out | 5 ++ tests/generic/176 | 53 +++++++++++++++---------- tests/generic/176.out | 5 +- tests/generic/297 | 99 +++++++++++++++++++++++++++++++++++++++++++++++ tests/generic/297.out | 6 +++ tests/generic/298 | 99 +++++++++++++++++++++++++++++++++++++++++++++++ tests/generic/298.out | 6 +++ tests/generic/group | 6 ++- 12 files changed, 328 insertions(+), 59 deletions(-) create mode 100644 src/punch-alternating.c create mode 100755 tests/generic/297 create mode 100644 tests/generic/297.out create mode 100755 tests/generic/298 create mode 100644 tests/generic/298.out diff --git a/.gitignore b/.gitignore index bbe7c1a..c98c7bf 100644 --- a/.gitignore +++ b/.gitignore @@ -115,6 +115,7 @@ /src/aio-dio-regress/aiocp /src/aio-dio-regress/aiodio_sparse2 /src/aio-dio-regress/aio-dio-eof-race +/src/punch-alternating /src/cloner /src/renameat2 /src/t_rename_overwrite diff --git a/src/Makefile b/src/Makefile index 48e6765..3110208 100644 --- a/src/Makefile +++ b/src/Makefile @@ -19,7 +19,7 @@ LINUX_TARGETS = xfsctl bstat t_mtab getdevicesize preallo_rw_pattern_reader \ bulkstat_unlink_test_modified t_dir_offset t_futimens t_immutable \ stale_handle pwrite_mmap_blocked t_dir_offset2 seek_sanity_test \ seek_copy_test t_readdir_1 t_readdir_2 fsync-tester nsexec cloner \ - renameat2 t_getcwd e4compact test-nextquota + renameat2 t_getcwd e4compact test-nextquota punch-alternating SUBDIRS = diff --git a/src/punch-alternating.c b/src/punch-alternating.c new file mode 100644 index 0000000..9566310 --- /dev/null +++ b/src/punch-alternating.c @@ -0,0 +1,59 @@ +/* + * Punch out every other block in a file. + * Copyright (C) 2016 Oracle. + */ +#include +#include +#include +#include +#include +#include +#include +#include "global.h" + +int main(int argc, char *argv[]) +{ + struct stat s; + off_t offset; + int fd; + blksize_t blksz; + off_t sz; + int mode; + int error; + + if (argc != 2) { + printf("Usage: %s file\n", argv[0]); + printf("Punches every other block in the file.\n"); + return 1; + } + + fd = open(argv[1], O_WRONLY); + if (fd < 0) + goto err; + + error = fstat(fd, &s); + if (error) + goto err; + + sz = s.st_size; + blksz = s.st_blksize; + + mode = FALLOC_FL_PUNCH_HOLE | FALLOC_FL_KEEP_SIZE; + for (offset = 0; offset < sz; offset += blksz * 2) { + error = fallocate(fd, mode, offset, blksz); + if (error) + goto err; + } + + error = fsync(fd); + if (error) + goto err; + + error = close(fd); + if (error) + goto err; + return 0; +err: + perror(argv[1]); + return 2; +} diff --git a/tests/generic/175 b/tests/generic/175 index ac2f54f..56e9919 100755 --- a/tests/generic/175 +++ b/tests/generic/175 @@ -1,12 +1,10 @@ #! /bin/bash # FS QA Test No. 175 # -# Try to hit the maximum reference count (eek!) -# -# This test runs extremely slowly, so it's not automatically run anywhere. +# See how well reflink handles reflinking the same block a million times. # #----------------------------------------------------------------------- -# Copyright (c) 2015, Oracle and/or its affiliates. All Rights Reserved. +# Copyright (c) 2016, Oracle and/or its affiliates. All Rights Reserved. # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License as @@ -34,7 +32,7 @@ trap "_cleanup; exit \$status" 0 1 2 3 15 _cleanup() { cd / - rm -rf "$tmp".* "$testdir1" + rm -rf "$tmp".* } # get standard environment, filters and checks @@ -55,43 +53,27 @@ _scratch_mkfs > "$seqres.full" 2>&1 _scratch_mount >> "$seqres.full" 2>&1 testdir="$SCRATCH_MNT/test-$seq" -rm -rf "$testdir" mkdir "$testdir" -# Well let's hope the maximum reflink count is (less than (ha!)) 2^32... - echo "Create a one block file" blksz="$(stat -f "$testdir" -c '%S')" _pwrite_byte 0x61 0 $blksz "$testdir/file1" >> "$seqres.full" -_pwrite_byte 0x62 0 $blksz "$testdir/file2" >> "$seqres.full" -_cp_reflink "$testdir/file1" "$testdir/file2" >> "$seqres.full" -nr=32 -fnr=32 +fnr=19 +echo "Create extents" +truncate -s $(( (2 ** i) * blksz)) "$testdir/file1" for i in $(seq 0 $fnr); do - echo " ++ Reflink size $i, $(( (2 ** i) * blksz)) bytes" | tee -a "$seqres.full" + echo " ++ Reflink size $i, $((2 ** i)) blocks" >> "$seqres.full" n=$(( (2 ** i) * blksz)) - _reflink_range "$testdir/file1" 0 "$testdir/file1" $n $n >> "$seqres.full" || break -done - -nrf=$((nr - fnr)) -echo "Clone $((2 ** nrf)) files" -seq 0 $((2 ** nrf)) | while read i; do - _cp-reflink "$testdir/file1" "$testdir/file1-$i" + _reflink_range "$testdir/file1" 0 "$testdir/file1" $n $n >> "$seqres.full" done +_scratch_remount -echo "Check scratch fs" -umount "$SCRATCH_MNT" -_check_scratch_fs - -echo "Remove big file and recheck" -_scratch_mount >> "$seqres.full" 2>&1 -umount "$SCRATCH_MNT" -_check_scratch_fs - -echo "Remove all files and recheck" -_scratch_mount >> "$seqres.full" 2>&1 -umount "$SCRATCH_MNT" +echo "Reflink the big file" +blks=$((2 ** (fnr + 1) )) +bytes=$((blks * blksz)) +echo "reflinking $blks blocks, $bytes bytes" >> "$seqres.full" +_reflink_range "$testdir/file1" 0 "$testdir/file2" 0 $bytes >> "$seqres.full" # success, all done status=0 diff --git a/tests/generic/175.out b/tests/generic/175.out index e69de29..78031a5 100644 --- a/tests/generic/175.out +++ b/tests/generic/175.out @@ -0,0 +1,5 @@ +QA output created by 175 +Format and mount +Create a one block file +Create extents +Reflink the big file diff --git a/tests/generic/176 b/tests/generic/176 index e32f94f..a77a16d 100755 --- a/tests/generic/176 +++ b/tests/generic/176 @@ -1,10 +1,10 @@ #! /bin/bash # FS QA Test No. 176 # -# Try to run out of space while cloning? +# See how well reflink handles reflinking a file with a million extents. # #----------------------------------------------------------------------- -# Copyright (c) 2015, Oracle and/or its affiliates. All Rights Reserved. +# Copyright (c) 2016, Oracle and/or its affiliates. All Rights Reserved. # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License as @@ -32,7 +32,7 @@ trap "_cleanup; exit \$status" 0 1 2 3 15 _cleanup() { cd / - rm -rf "$tmp".* "$testdir1" + rm -rf "$tmp".* } # get standard environment, filters and checks @@ -44,6 +44,8 @@ _cleanup() # real QA test starts here _supported_os Linux _require_scratch_reflink +_require_cp_reflink +_require_test_program "punch-alternating" rm -f "$seqres.full" @@ -52,28 +54,37 @@ _scratch_mkfs > "$seqres.full" 2>&1 _scratch_mount >> "$seqres.full" 2>&1 testdir="$SCRATCH_MNT/test-$seq" -rm -rf "$testdir" mkdir "$testdir" -blksz="$(stat -f "$testdir" -c '%S')" -nr_free="$(stat -f -c '%f' "$testdir")" -echo "Create a big file" -touch "$testdir/file0" "$testdir/file1" -_pwrite_byte 0x61 0 $((blksz * nr_free)) "$testdir/bigfile" >> "$seqres.full" 2>&1 -_scratch_remount -sz="$(stat -c '%s' "$testdir/bigfile")" - -blks="$((sz / blksz))" -echo "Try to reflink" -seq 0 $blks | while read lblk; do - fname="$testdir/file$((lblk % 2))" - out="$(_reflink_range "$testdir/bigfile" $((lblk * blksz)) "$fname" $((lblk * blksz)) $blksz 2>&1)" - echo "$fname: $out" >> "$seqres.full" - echo "$out" | grep -q "No space left on device" && break +# Setup for one million blocks, but we'll accept stress testing down to +# 2^17 blocks... that should be plenty for anyone. +fnr=20 +free_blocks=$(stat -f -c '%a' "$testdir") +blksz=$(stat -f -c '%S' "$testdir") +space_avail=$((free_blocks * blksz)) +calc_space() { + blocks_needed=$(( 2 ** (fnr + 1) )) + space_needed=$((blocks_needed * blksz * 5 / 4)) +} +calc_space +while test $space_needed -gt $space_avail; do + fnr=$((fnr - 1)) + calc_space done +test $fnr -lt 17 && _notrun "Insufficient space for stress test; would only create $blocks_needed extents." + +echo "Create a many-block file" +echo "creating $blocks_needed blocks..." >> "$seqres.full" +"$XFS_IO_PROG" -f -c "pwrite -S 0x61 -b 4194304 0 $((2 ** (fnr + 1) * blksz))" "$testdir/file1" >> "$seqres.full" +echo "punching..." >> "$seqres.full" +"$here/src/punch-alternating" "$testdir/file1" >> "$seqres.full" +echo "...done" >> "$seqres.full" +_scratch_remount -echo "Check scratch fs" -umount "$SCRATCH_MNT" +echo "Reflink the big file" +bytes=$((blocks_needed * blksz)) +echo "reflinking $((blocks_needed / 2)) blocks, $((bytes / 2)) bytes" >> "$seqres.full" +_reflink_range "$testdir/file1" 0 "$testdir/file2" 0 $bytes >> "$seqres.full" # success, all done status=0 diff --git a/tests/generic/176.out b/tests/generic/176.out index eec98eb..538cc17 100644 --- a/tests/generic/176.out +++ b/tests/generic/176.out @@ -1,5 +1,4 @@ QA output created by 176 Format and mount -Create a big file -Try to reflink -Check scratch fs +Create a many-block file +Reflink the big file diff --git a/tests/generic/297 b/tests/generic/297 new file mode 100755 index 0000000..4ae2b9c --- /dev/null +++ b/tests/generic/297 @@ -0,0 +1,99 @@ +#! /bin/bash +# FS QA Test No. 297 +# +# See how well reflink handles ^C in the middle of a slow reflink. +# +#----------------------------------------------------------------------- +# Copyright (c) 2016, Oracle and/or its affiliates. All Rights Reserved. +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License as +# published by the Free Software Foundation. +# +# This program is distributed in the hope that it would be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write the Free Software Foundation, +# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA +#----------------------------------------------------------------------- + +seq=`basename $0` +seqres=$RESULT_DIR/$seq +echo "QA output created by $seq" + +here=`pwd` +tmp=/tmp/$$ +status=1 # failure is the default! +trap "_cleanup; exit \$status" 0 1 2 3 15 + +_cleanup() +{ + cd / + rm -rf $tmp.* $TEST_DIR/before $TEST_DIR/after +} + +# get standard environment, filters and checks +. ./common/rc +. ./common/filter +. ./common/attr +. ./common/reflink + +# real QA test starts here +_supported_os Linux +_require_scratch_reflink +_require_cp_reflink +_require_command "$(which timeout)" "timeout" + +test $FSTYP == "nfs" && _notrun "NFS can't interrupt clone operations" + +rm -f $seqres.full + +echo "Format and mount" +_scratch_mkfs > $seqres.full 2>&1 +_scratch_mount >> $seqres.full 2>&1 + +testdir=$SCRATCH_MNT/test-$seq +mkdir $testdir + +echo "Create a one block file" +blksz="$(stat -f $testdir -c '%S')" +_pwrite_byte 0x61 0 $blksz $testdir/file1 >> $seqres.full + +fnr=26 # 2^26 reflink extents should be enough to find a slow op? +timeout=8 # guarantee a good long run... +echo "Find a reflink size that takes a long time" +truncate -s $(( (2 ** i) * blksz)) $testdir/file1 +for i in $(seq 0 $fnr); do + echo " ++ Reflink size $i, $((2 ** i)) blocks" >> $seqres.full + n=$(( (2 ** i) * blksz)) + touch $TEST_DIR/before + $XFS_IO_PROG -f -c "reflink $testdir/file1 0 $n $n" $testdir/file1 >> $seqres.full 2>&1 + touch $TEST_DIR/after + before=$(stat -c '%Y' $TEST_DIR/before) + after=$(stat -c '%Y' $TEST_DIR/after) + delta=$((after - before)) + test $delta -gt $timeout && break +done + +echo "Try to kill reflink after a shorter period of time" +kill_after=2 # give us a shorter time to die +n=$(stat -c '%s' $testdir/file1) +echo "performing kill test on $n bytes..." >> $seqres.full +touch $TEST_DIR/before +timeout -s INT ${kill_after}s $XFS_IO_PROG -f -c "reflink $testdir/file1 0 $n $n" $testdir/file1 >> $seqres.full 2>&1 +touch $TEST_DIR/after +before=$(stat -c '%Y' $TEST_DIR/before) +after=$(stat -c '%Y' $TEST_DIR/after) +delta=$((after - before)) +echo "reflink of $n bytes took $delta seconds" >> $seqres.full +test $delta -gt $timeout && _fail "reflink didn't stop in time, n=$n t=$delta" + +echo "Check scratch fs" +sleep 2 # give it a few seconds to actually die... + +# success, all done +status=0 +exit diff --git a/tests/generic/297.out b/tests/generic/297.out new file mode 100644 index 0000000..cfe5b96 --- /dev/null +++ b/tests/generic/297.out @@ -0,0 +1,6 @@ +QA output created by 297 +Format and mount +Create a one block file +Find a reflink size that takes a long time +Try to kill reflink after a shorter period of time +Check scratch fs diff --git a/tests/generic/298 b/tests/generic/298 new file mode 100755 index 0000000..e85db12 --- /dev/null +++ b/tests/generic/298 @@ -0,0 +1,99 @@ +#! /bin/bash +# FS QA Test No. 298 +# +# See how well reflink handles SIGKILL in the middle of a slow reflink. +# +#----------------------------------------------------------------------- +# Copyright (c) 2016, Oracle and/or its affiliates. All Rights Reserved. +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License as +# published by the Free Software Foundation. +# +# This program is distributed in the hope that it would be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write the Free Software Foundation, +# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA +#----------------------------------------------------------------------- + +seq=`basename $0` +seqres=$RESULT_DIR/$seq +echo "QA output created by $seq" + +here=`pwd` +tmp=/tmp/$$ +status=1 # failure is the default! +trap "_cleanup; exit \$status" 0 1 2 3 15 + +_cleanup() +{ + cd / + rm -rf $tmp.* $TEST_DIR/before $TEST_DIR/after +} + +# get standard environment, filters and checks +. ./common/rc +. ./common/filter +. ./common/attr +. ./common/reflink + +# real QA test starts here +_supported_os Linux +_require_scratch_reflink +_require_cp_reflink +_require_command "$(which timeout)" "timeout" + +test $FSTYP == "nfs" && _notrun "NFS can't interrupt clone operations" + +rm -f $seqres.full + +echo "Format and mount" +_scratch_mkfs > $seqres.full 2>&1 +_scratch_mount >> $seqres.full 2>&1 + +testdir=$SCRATCH_MNT/test-$seq +mkdir $testdir + +echo "Create a one block file" +blksz="$(stat -f $testdir -c '%S')" +_pwrite_byte 0x61 0 $blksz $testdir/file1 >> $seqres.full + +fnr=26 # 2^26 reflink extents should be enough to find a slow op? +timeout=8 # guarantee a good long run... +echo "Find a reflink size that takes a long time" +truncate -s $(( (2 ** i) * blksz)) $testdir/file1 +for i in $(seq 0 $fnr); do + echo " ++ Reflink size $i, $((2 ** i)) blocks" >> $seqres.full + n=$(( (2 ** i) * blksz)) + touch $TEST_DIR/before + $XFS_IO_PROG -f -c "reflink $testdir/file1 0 $n $n" $testdir/file1 >> $seqres.full 2>&1 + touch $TEST_DIR/after + before=$(stat -c '%Y' $TEST_DIR/before) + after=$(stat -c '%Y' $TEST_DIR/after) + delta=$((after - before)) + test $delta -gt $timeout && break +done + +echo "Try to kill reflink after a shorter period of time" +kill_after=2 # give us a shorter time to die +n=$(stat -c '%s' $testdir/file1) +echo "performing kill test on $n bytes..." >> $seqres.full +touch $TEST_DIR/before +urk=$(timeout -s KILL ${kill_after}s $XFS_IO_PROG -f -c "reflink $testdir/file1 0 $n $n" $testdir/file1 >> $seqres.full 2>&1) +touch $TEST_DIR/after +before=$(stat -c '%Y' $TEST_DIR/before) +after=$(stat -c '%Y' $TEST_DIR/after) +delta=$((after - before)) +echo "reflink of $n bytes took $delta seconds" >> $seqres.full +test $delta -gt $timeout && _fail "reflink didn't stop in time, n=$n t=$delta" + +echo "Check scratch fs" +sleep 2 # give it a few seconds to actually die... + +# success, all done +status=0 +exit diff --git a/tests/generic/298.out b/tests/generic/298.out new file mode 100644 index 0000000..c1cdc7d --- /dev/null +++ b/tests/generic/298.out @@ -0,0 +1,6 @@ +QA output created by 298 +Format and mount +Create a one block file +Find a reflink size that takes a long time +Try to kill reflink after a shorter period of time +Check scratch fs diff --git a/tests/generic/group b/tests/generic/group index c256617..f1a398c 100644 --- a/tests/generic/group +++ b/tests/generic/group @@ -177,8 +177,8 @@ 172 auto quick clone 173 auto quick clone 174 auto quick clone -175 clone_stress -176 clone_stress +175 auto quick clone +176 auto quick clone 177 auto quick prealloc metadata 178 auto quick clone 179 auto quick clone @@ -299,6 +299,8 @@ 294 auto quick 295 auto quick clone 296 auto quick clone +297 auto quick clone +298 auto quick clone 299 auto aio enospc rw stress 300 auto aio enospc preallocrw stress 306 auto quick rw From darrick.wong@oracle.com Thu Feb 11 17:41:17 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay1.corp.sgi.com [137.38.102.111]) by oss.sgi.com (Postfix) with ESMTP id 813F87F93 for ; Thu, 11 Feb 2016 17:41:17 -0600 (CST) Received: from cuda.sgi.com (cuda2.sgi.com [192.48.176.25]) by relay1.corp.sgi.com (Postfix) with ESMTP id 65A718F804B for ; Thu, 11 Feb 2016 15:41:17 -0800 (PST) X-ASG-Debug-ID: 1455234075-04cbb043348a060001-NocioJ Received: from aserp1040.oracle.com (aserp1040.oracle.com [141.146.126.69]) by cuda.sgi.com with ESMTP id 4nVNF09n5It9nebg (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO) for ; Thu, 11 Feb 2016 15:41:15 -0800 (PST) X-Barracuda-Envelope-From: darrick.wong@oracle.com X-Barracuda-Apparent-Source-IP: 141.146.126.69 Received: from aserv0021.oracle.com (aserv0021.oracle.com [141.146.126.233]) by aserp1040.oracle.com (Sentrion-MTA-4.3.2/Sentrion-MTA-4.3.2) with ESMTP id u1BNfExh024166 (version=TLSv1 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Thu, 11 Feb 2016 23:41:14 GMT Received: from aserv0121.oracle.com (aserv0121.oracle.com [141.146.126.235]) by aserv0021.oracle.com (8.13.8/8.13.8) with ESMTP id u1BNfEX4026935 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=FAIL); Thu, 11 Feb 2016 23:41:14 GMT Received: from abhmp0003.oracle.com (abhmp0003.oracle.com [141.146.116.9]) by aserv0121.oracle.com (8.13.8/8.13.8) with ESMTP id u1BNfE4O026499; Thu, 11 Feb 2016 23:41:14 GMT Received: from localhost (/10.145.178.207) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Thu, 11 Feb 2016 15:41:13 -0800 Subject: [PATCH 17/32] xfs: more reflink tests From: "Darrick J. Wong" X-ASG-Orig-Subj: [PATCH 17/32] xfs: more reflink tests To: david@fromorbit.com, darrick.wong@oracle.com Cc: linux-btrfs@vger.kernel.org, fstests@vger.kernel.org, xfs@oss.sgi.com Date: Thu, 11 Feb 2016 15:41:11 -0800 Message-ID: <20160211234111.2202.97746.stgit@birch.djwong.org> In-Reply-To: <20160211233916.2202.40961.stgit@birch.djwong.org> References: <20160211233916.2202.40961.stgit@birch.djwong.org> User-Agent: StGit/0.17.1-dirty MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit X-Source-IP: aserv0021.oracle.com [141.146.126.233] X-Barracuda-Connect: aserp1040.oracle.com[141.146.126.69] X-Barracuda-Start-Time: 1455234075 X-Barracuda-Encrypted: ECDHE-RSA-AES256-GCM-SHA384 X-Barracuda-URL: https://192.48.176.25:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-BRTS-Status: 1 X-Barracuda-Spam-Score: 0.00 X-Barracuda-Spam-Status: No, SCORE=0.00 using per-user scores of TAG_LEVEL=1000.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.7 tests=BSF_SC0_MISMATCH_TO, UNPARSEABLE_RELAY X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.3.26959 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 0.00 BSF_SC0_MISMATCH_TO Envelope rcpt doesn't match header 0.00 UNPARSEABLE_RELAY Informational: message has unparseable relay lines Create a couple of XFS-specific tests -- one to check that growing and shrinking the refcount btree works and a second one to check what happens when we hit maximum refcount. Signed-off-by: Darrick J. Wong --- tests/xfs/169 | 86 +++++++++++++++++++++++++++++++++++++++ tests/xfs/169.out | 7 +++ tests/xfs/179 | 118 +++++++++++++++++++++++++++++++++++++++++++++++++++++ tests/xfs/179.out | 10 ++++ tests/xfs/group | 4 +- 5 files changed, 224 insertions(+), 1 deletion(-) create mode 100755 tests/xfs/169 create mode 100644 tests/xfs/169.out create mode 100755 tests/xfs/179 create mode 100644 tests/xfs/179.out diff --git a/tests/xfs/169 b/tests/xfs/169 new file mode 100755 index 0000000..996500e --- /dev/null +++ b/tests/xfs/169 @@ -0,0 +1,86 @@ +#! /bin/bash +# FS QA Test No. 169 +# +# Ensure that we can create enough distinct reflink entries to force creation +# of a multi-level refcount btree. Delete and recreate a few times to +# exercise the refcount btree grow/shrink functions. +# +#----------------------------------------------------------------------- +# Copyright (c) 2016, Oracle and/or its affiliates. All Rights Reserved. +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License as +# published by the Free Software Foundation. +# +# This program is distributed in the hope that it would be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write the Free Software Foundation, +# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA +#----------------------------------------------------------------------- + +seq=`basename $0` +seqres=$RESULT_DIR/$seq +echo "QA output created by $seq" + +here=`pwd` +tmp=/tmp/$$ +status=1 # failure is the default! +trap "_cleanup; exit \$status" 0 1 2 3 15 + +_cleanup() +{ + cd / + umount $SCRATCH_MNT > /dev/null 2>&1 + rm -rf $tmp.* +} + +# get standard environment, filters and checks +. ./common/rc +. ./common/filter +. ./common/reflink + +# real QA test starts here +_supported_os Linux +_supported_fs xfs +_require_scratch_reflink + +rm -f $seqres.full + +_scratch_mkfs >/dev/null 2>&1 +_scratch_mount + +testdir=$SCRATCH_MNT/test-$seq +mkdir $testdir + +echo "Create the original file blocks" +blksz="$(stat -f $testdir -c '%S')" +nr_blks=$((8 * blksz / 12)) + +for i in 1 2 x; do + _pwrite_byte 0x61 0 $((blksz * nr_blks)) $testdir/file1 >> $seqres.full + + echo "$i: Reflink every other block" + seq 1 2 $((nr_blks - 1)) | while read nr; do + _reflink_range $testdir/file1 $((nr * blksz)) \ + $testdir/file2 $((nr * blksz)) $blksz >> $seqres.full + done + umount $SCRATCH_MNT + _check_scratch_fs + _scratch_mount + + test $i = "x" && break + + echo "$i: Delete both files" + rm -rf $testdir/file1 $testdir/file2 + umount $SCRATCH_MNT + _check_scratch_fs + _scratch_mount +done + +# success, all done +status=0 +exit diff --git a/tests/xfs/169.out b/tests/xfs/169.out new file mode 100644 index 0000000..1159e30 --- /dev/null +++ b/tests/xfs/169.out @@ -0,0 +1,7 @@ +QA output created by 169 +Create the original file blocks +1: Reflink every other block +1: Delete both files +2: Reflink every other block +2: Delete both files +x: Reflink every other block diff --git a/tests/xfs/179 b/tests/xfs/179 new file mode 100755 index 0000000..e0b0af8 --- /dev/null +++ b/tests/xfs/179 @@ -0,0 +1,118 @@ +#! /bin/bash +# FS QA Test No. 179 +# +# See how well reflink handles overflowing reflink counts. +# +#----------------------------------------------------------------------- +# Copyright (c) 2016, Oracle and/or its affiliates. All Rights Reserved. +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License as +# published by the Free Software Foundation. +# +# This program is distributed in the hope that it would be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write the Free Software Foundation, +# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA +#----------------------------------------------------------------------- + +seq=`basename $0` +seqres=$RESULT_DIR/$seq +echo "QA output created by $seq" + +here=`pwd` +tmp=/tmp/$$ +status=1 # failure is the default! +trap "_cleanup; exit \$status" 0 1 2 3 15 + +_cleanup() +{ + cd / + rm -rf $tmp.* +} + +# get standard environment, filters and checks +. ./common/rc +. ./common/filter +. ./common/attr +. ./common/reflink + +# real QA test starts here +_supported_os Linux +_supported_fs xfs +_require_scratch_reflink +_require_scratch_nocheck +_require_cp_reflink +_require_test_program "punch-alternating" + +rm -f $seqres.full + +echo "Format and mount" +_scratch_mkfs -d agcount=1 > $seqres.full 2>&1 +_scratch_mount >> $seqres.full 2>&1 + +testdir=$SCRATCH_MNT/test-$seq +mkdir $testdir + +blksz=65536 + +echo "Create original files" +_pwrite_byte 0x61 0 $blksz $testdir/file1 >> $seqres.full +_cp_reflink $testdir/file1 $testdir/file2 >> $seqres.full + +echo "Change reference count" +umount $SCRATCH_MNT +echo "set refcount to -4" >> $seqres.full +$XFS_DB_PROG -x -c 'agf 0' -c 'addr refcntroot' -c 'write recs[1].refcount 4294967292' $SCRATCH_DEV >> $seqres.full +echo "check refcount after setting to -4" >> $seqres.full +$XFS_DB_PROG -c 'agf 0' -c 'addr refcntroot' -c 'p recs[1]' $SCRATCH_DEV >> $seqres.full +_scratch_mount >> $seqres.full + +echo "Reflink the overlinked file" +_cp_reflink $testdir/file1 $testdir/file3 >> $seqres.full +_cp_reflink $testdir/file1 $testdir/file4 >> $seqres.full +_cp_reflink $testdir/file1 $testdir/file5 >> $seqres.full +_cp_reflink $testdir/file1 $testdir/file6 >> $seqres.full +_cp_reflink $testdir/file1 $testdir/file7 >> $seqres.full + +echo "Check scratch fs" +umount $SCRATCH_MNT +echo "check refcount after reflinking 5 more times" >> $seqres.full +$XFS_DB_PROG -c 'agf 0' -c 'addr refcntroot' -c 'p recs[1]' $SCRATCH_DEV >> $seqres.full +_scratch_mount >> $seqres.full + +echo "CoW a couple files" +_pwrite_byte 0x62 0 $blksz $testdir/file3 >> $seqres.full +_pwrite_byte 0x62 0 $blksz $testdir/file5 >> $seqres.full +_pwrite_byte 0x62 0 $blksz $testdir/file7 >> $seqres.full + +echo "Check scratch fs" +umount $SCRATCH_MNT +echo "check refcount after cowing 3 files" >> $seqres.full +$XFS_DB_PROG -c 'agf 0' -c 'addr refcntroot' -c 'p recs[1]' $SCRATCH_DEV >> $seqres.full +_scratch_mount >> $seqres.full + +echo "Remove reflinked files" +rm -rf $testdir/file* + +echo "Check scratch fs" +umount $SCRATCH_MNT +echo "check refcount after removing all files" >> $seqres.full +$XFS_DB_PROG -c 'agf 0' -c 'addr refcntroot' -c 'p recs[1]' $SCRATCH_DEV >> $seqres.full +$XFS_REPAIR_PROG -o force_geometry -n $SCRATCH_DEV >> $seqres.full 2>&1 +res=$? +if [ $res -eq 0 ]; then + # If repair succeeds then format the device so that the post-test + # check doesn't fail due to the single AG. + _scratch_mkfs >> $seqres.full 2>&1 +else + _fail "xfs_repair fails" +fi + +# success, all done +status=0 +exit diff --git a/tests/xfs/179.out b/tests/xfs/179.out new file mode 100644 index 0000000..4d3e605 --- /dev/null +++ b/tests/xfs/179.out @@ -0,0 +1,10 @@ +QA output created by 179 +Format and mount +Create original files +Change reference count +Reflink the overlinked file +Check scratch fs +CoW a couple files +Check scratch fs +Remove reflinked files +Check scratch fs diff --git a/tests/xfs/group b/tests/xfs/group index 2db3520..f0c1c2b 100644 --- a/tests/xfs/group +++ b/tests/xfs/group @@ -127,7 +127,7 @@ 127 auto quick clone 128 auto quick clone 129 auto quick clone -130 fuzzers +130 fuzzers clone 131 auto quick clone 132 auto quick clone 133 auto quick quota @@ -166,6 +166,7 @@ 166 rw metadata auto quick 167 rw metadata auto stress 168 dmapi +169 auto quick clone 170 rw filestreams auto quick 171 rw filestreams 172 rw filestreams @@ -175,6 +176,7 @@ 176 dmapi 177 dmapi 178 mkfs other auto +179 auto quick clone 181 log auto quick 183 rw other auto quick 185 dmapi From darrick.wong@oracle.com Thu Feb 11 17:41:27 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay1.corp.sgi.com [137.38.102.111]) by oss.sgi.com (Postfix) with ESMTP id CD7D97F81 for ; Thu, 11 Feb 2016 17:41:27 -0600 (CST) Received: from cuda.sgi.com (cuda1.sgi.com [192.48.157.11]) by relay1.corp.sgi.com (Postfix) with ESMTP id 990F08F8033 for ; Thu, 11 Feb 2016 15:41:27 -0800 (PST) X-ASG-Debug-ID: 1455234085-04bdf066eb73920001-NocioJ Received: from aserp1040.oracle.com (aserp1040.oracle.com [141.146.126.69]) by cuda.sgi.com with ESMTP id GVn6z3qZf1jwGj7E (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO) for ; Thu, 11 Feb 2016 15:41:25 -0800 (PST) X-Barracuda-Envelope-From: darrick.wong@oracle.com X-Barracuda-Apparent-Source-IP: 141.146.126.69 Received: from userv0021.oracle.com (userv0021.oracle.com [156.151.31.71]) by aserp1040.oracle.com (Sentrion-MTA-4.3.2/Sentrion-MTA-4.3.2) with ESMTP id u1BNfOQH024288 (version=TLSv1 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Thu, 11 Feb 2016 23:41:25 GMT Received: from userv0121.oracle.com (userv0121.oracle.com [156.151.31.72]) by userv0021.oracle.com (8.13.8/8.13.8) with ESMTP id u1BNfOkh014372 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=FAIL); Thu, 11 Feb 2016 23:41:24 GMT Received: from abhmp0008.oracle.com (abhmp0008.oracle.com [141.146.116.14]) by userv0121.oracle.com (8.13.8/8.13.8) with ESMTP id u1BNfNoe006618; Thu, 11 Feb 2016 23:41:24 GMT Received: from localhost (/10.145.178.207) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Thu, 11 Feb 2016 15:41:23 -0800 Subject: [PATCH 18/32] xfs/122: support refcount/rmap data structures From: "Darrick J. Wong" X-ASG-Orig-Subj: [PATCH 18/32] xfs/122: support refcount/rmap data structures To: david@fromorbit.com, darrick.wong@oracle.com Cc: linux-btrfs@vger.kernel.org, fstests@vger.kernel.org, xfs@oss.sgi.com Date: Thu, 11 Feb 2016 15:41:19 -0800 Message-ID: <20160211234119.2202.11023.stgit@birch.djwong.org> In-Reply-To: <20160211233916.2202.40961.stgit@birch.djwong.org> References: <20160211233916.2202.40961.stgit@birch.djwong.org> User-Agent: StGit/0.17.1-dirty MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit X-Source-IP: userv0021.oracle.com [156.151.31.71] X-Barracuda-Connect: aserp1040.oracle.com[141.146.126.69] X-Barracuda-Start-Time: 1455234085 X-Barracuda-Encrypted: ECDHE-RSA-AES256-GCM-SHA384 X-Barracuda-URL: https://192.48.157.11:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-BRTS-Status: 1 X-Barracuda-Spam-Score: 0.00 X-Barracuda-Spam-Status: No, SCORE=0.00 using per-user scores of TAG_LEVEL=1000.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.7 tests=BSF_SC0_MISMATCH_TO, UNPARSEABLE_RELAY X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.3.26959 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 0.00 BSF_SC0_MISMATCH_TO Envelope rcpt doesn't match header 0.00 UNPARSEABLE_RELAY Informational: message has unparseable relay lines Include the refcount and rmap structures in the golden output. Signed-off-by: Darrick J. Wong --- tests/xfs/122 | 3 +++ tests/xfs/122.out | 4 ++++ tests/xfs/group | 2 +- 3 files changed, 8 insertions(+), 1 deletion(-) diff --git a/tests/xfs/122 b/tests/xfs/122 index e6697a2..758cb50 100755 --- a/tests/xfs/122 +++ b/tests/xfs/122 @@ -90,6 +90,9 @@ xfs_da3_icnode_hdr xfs_dir3_icfree_hdr xfs_dir3_icleaf_hdr xfs_name +xfs_owner_info +xfs_refcount_irec +xfs_rmap_irec xfs_alloctype_t xfs_buf_cancel_t xfs_bmbt_rec_32_t diff --git a/tests/xfs/122.out b/tests/xfs/122.out index 8ba121e..c590166 100644 --- a/tests/xfs/122.out +++ b/tests/xfs/122.out @@ -75,6 +75,10 @@ sizeof(struct xfs_extent_data) = 24 sizeof(struct xfs_extent_data_info) = 32 sizeof(struct xfs_fs_eofblocks) = 128 sizeof(struct xfs_icreate_log) = 28 +sizeof(struct xfs_refcount_key) = 4 +sizeof(struct xfs_refcount_rec) = 12 +sizeof(struct xfs_rmap_key) = 20 +sizeof(struct xfs_rmap_rec) = 24 sizeof(xfs_agf_t) = 224 sizeof(xfs_agfl_t) = 36 sizeof(xfs_agi_t) = 336 diff --git a/tests/xfs/group b/tests/xfs/group index f0c1c2b..abf1d33 100644 --- a/tests/xfs/group +++ b/tests/xfs/group @@ -119,7 +119,7 @@ 119 log v2log auto freeze dangerous 120 fuzzers 121 log auto quick -122 other auto quick +122 other auto quick clone 123 fuzzers 124 fuzzers 125 fuzzers From darrick.wong@oracle.com Thu Feb 11 17:41:40 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=LOTS_OF_MONEY, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay1.corp.sgi.com [137.38.102.111]) by oss.sgi.com (Postfix) with ESMTP id E20547F82 for ; Thu, 11 Feb 2016 17:41:40 -0600 (CST) Received: from cuda.sgi.com (cuda3.sgi.com [192.48.176.15]) by relay1.corp.sgi.com (Postfix) with ESMTP id D37FB8F804C for ; Thu, 11 Feb 2016 15:41:40 -0800 (PST) X-ASG-Debug-ID: 1455234092-04cb6c1e5872f20001-NocioJ Received: from aserp1040.oracle.com (aserp1040.oracle.com [141.146.126.69]) by cuda.sgi.com with ESMTP id EtKAHJEwrHV1OJuB (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO) for ; Thu, 11 Feb 2016 15:41:32 -0800 (PST) X-Barracuda-Envelope-From: darrick.wong@oracle.com X-Barracuda-Apparent-Source-IP: 141.146.126.69 Received: from aserv0021.oracle.com (aserv0021.oracle.com [141.146.126.233]) by aserp1040.oracle.com (Sentrion-MTA-4.3.2/Sentrion-MTA-4.3.2) with ESMTP id u1BNfVZ6024348 (version=TLSv1 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Thu, 11 Feb 2016 23:41:31 GMT Received: from aserv0121.oracle.com (aserv0121.oracle.com [141.146.126.235]) by aserv0021.oracle.com (8.13.8/8.13.8) with ESMTP id u1BNfVHo027709 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=FAIL); Thu, 11 Feb 2016 23:41:31 GMT Received: from abhmp0003.oracle.com (abhmp0003.oracle.com [141.146.116.9]) by aserv0121.oracle.com (8.13.8/8.13.8) with ESMTP id u1BNfUuk026684; Thu, 11 Feb 2016 23:41:30 GMT Received: from localhost (/10.145.178.207) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Thu, 11 Feb 2016 15:41:30 -0800 Subject: [PATCH 19/32] xfs: test fragmentation characteristics of copy-on-write From: "Darrick J. Wong" X-ASG-Orig-Subj: [PATCH 19/32] xfs: test fragmentation characteristics of copy-on-write To: david@fromorbit.com, darrick.wong@oracle.com Cc: linux-btrfs@vger.kernel.org, fstests@vger.kernel.org, xfs@oss.sgi.com Date: Thu, 11 Feb 2016 15:41:28 -0800 Message-ID: <20160211234128.2202.17455.stgit@birch.djwong.org> In-Reply-To: <20160211233916.2202.40961.stgit@birch.djwong.org> References: <20160211233916.2202.40961.stgit@birch.djwong.org> User-Agent: StGit/0.17.1-dirty MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit X-Source-IP: aserv0021.oracle.com [141.146.126.233] X-Barracuda-Connect: aserp1040.oracle.com[141.146.126.69] X-Barracuda-Start-Time: 1455234092 X-Barracuda-Encrypted: ECDHE-RSA-AES256-GCM-SHA384 X-Barracuda-URL: https://192.48.176.15:443/cgi-mod/mark.cgi X-Barracuda-BRTS-Status: 1 X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-Spam-Score: 0.00 X-Barracuda-Spam-Status: No, SCORE=0.00 using per-user scores of TAG_LEVEL=1000.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.7 tests=BSF_SC0_MISMATCH_TO, UNPARSEABLE_RELAY X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.3.26959 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 0.00 BSF_SC0_MISMATCH_TO Envelope rcpt doesn't match header 0.00 UNPARSEABLE_RELAY Informational: message has unparseable relay lines Perform copy-on-writes at random offsets to stress the CoW allocation system. Assess the effectiveness of the extent size hint at combatting fragmentation via unshare, a rewrite, and no-op after the random writes. Signed-off-by: Darrick J. Wong --- tests/generic/301 | 100 ++++++++++++++++++++++++++++++++++++ tests/generic/301.out | 10 ++++ tests/generic/302 | 101 ++++++++++++++++++++++++++++++++++++ tests/generic/302.out | 10 ++++ tests/generic/group | 2 + tests/xfs/180 | 106 ++++++++++++++++++++++++++++++++++++++ tests/xfs/180.out | 11 ++++ tests/xfs/182 | 107 ++++++++++++++++++++++++++++++++++++++ tests/xfs/182.out | 12 ++++ tests/xfs/184 | 105 +++++++++++++++++++++++++++++++++++++ tests/xfs/184.out | 10 ++++ tests/xfs/192 | 106 ++++++++++++++++++++++++++++++++++++++ tests/xfs/192.out | 10 ++++ tests/xfs/193 | 102 ++++++++++++++++++++++++++++++++++++ tests/xfs/193.out | 10 ++++ tests/xfs/198 | 103 +++++++++++++++++++++++++++++++++++++ tests/xfs/198.out | 10 ++++ tests/xfs/200 | 109 +++++++++++++++++++++++++++++++++++++++ tests/xfs/200.out | 10 ++++ tests/xfs/204 | 110 +++++++++++++++++++++++++++++++++++++++ tests/xfs/204.out | 10 ++++ tests/xfs/207 | 101 ++++++++++++++++++++++++++++++++++++ tests/xfs/207.out | 18 ++++++ tests/xfs/208 | 138 +++++++++++++++++++++++++++++++++++++++++++++++++ tests/xfs/208.out | 13 +++++ tests/xfs/209 | 82 +++++++++++++++++++++++++++++ tests/xfs/209.out | 13 +++++ tests/xfs/210 | 108 ++++++++++++++++++++++++++++++++++++++ tests/xfs/210.out | 23 ++++++++ tests/xfs/211 | 107 ++++++++++++++++++++++++++++++++++++++ tests/xfs/211.out | 11 ++++ tests/xfs/group | 13 +++++ 32 files changed, 1781 insertions(+) create mode 100755 tests/generic/301 create mode 100644 tests/generic/301.out create mode 100755 tests/generic/302 create mode 100644 tests/generic/302.out create mode 100755 tests/xfs/180 create mode 100644 tests/xfs/180.out create mode 100755 tests/xfs/182 create mode 100644 tests/xfs/182.out create mode 100755 tests/xfs/184 create mode 100644 tests/xfs/184.out create mode 100755 tests/xfs/192 create mode 100644 tests/xfs/192.out create mode 100755 tests/xfs/193 create mode 100644 tests/xfs/193.out create mode 100755 tests/xfs/198 create mode 100644 tests/xfs/198.out create mode 100755 tests/xfs/200 create mode 100644 tests/xfs/200.out create mode 100755 tests/xfs/204 create mode 100644 tests/xfs/204.out create mode 100755 tests/xfs/207 create mode 100644 tests/xfs/207.out create mode 100755 tests/xfs/208 create mode 100644 tests/xfs/208.out create mode 100755 tests/xfs/209 create mode 100644 tests/xfs/209.out create mode 100755 tests/xfs/210 create mode 100644 tests/xfs/210.out create mode 100755 tests/xfs/211 create mode 100644 tests/xfs/211.out diff --git a/tests/generic/301 b/tests/generic/301 new file mode 100755 index 0000000..0201d0b --- /dev/null +++ b/tests/generic/301 @@ -0,0 +1,100 @@ +#! /bin/bash +# FS QA Test No. 301 +# +# Test fragmentation after a lot of random CoW: +# - Create two reflinked files. +# - Buffered write to random offsets to scatter CoW reservations. +# - Check the number of extents. +# +#----------------------------------------------------------------------- +# Copyright (c) 2016, Oracle and/or its affiliates. All Rights Reserved. +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License as +# published by the Free Software Foundation. +# +# This program is distributed in the hope that it would be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write the Free Software Foundation, +# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA +#----------------------------------------------------------------------- + +seq=`basename $0` +seqres=$RESULT_DIR/$seq +echo "QA output created by $seq" + +here=`pwd` +tmp=/tmp/$$ +status=1 # failure is the default! +trap "_cleanup; exit \$status" 0 1 2 3 15 + +_cleanup() +{ + cd / + rm -rf $tmp.* +} + +# get standard environment, filters and checks +. ./common/rc +. ./common/filter +. ./common/reflink + +# real QA test starts here +_supported_os Linux +_require_scratch_reflink +_require_cp_reflink +_require_fiemap + +rm -f $seqres.full + +echo "Format and mount" +_scratch_mkfs > $seqres.full 2>&1 +_scratch_mount >> $seqres.full 2>&1 + +testdir=$SCRATCH_MNT/test-$seq +mkdir $testdir + +blksz=65536 +nr=128 +filesize=$((blksz * nr)) +bufnr=16 +bufsize=$((blksz * bufnr)) + +_require_fs_space $SCRATCH_MNT $((filesize / 1024 * 3 * 5 / 4)) +real_blksz=$(stat -f -c '%S' $testdir) +internal_blks=$((filesize / real_blksz)) + +echo "Create the original files" +$XFS_IO_PROG -f -c "pwrite -S 0x61 -b $bufsize 0 $((filesize + 1))" $testdir/file1 >> $seqres.full +_cp_reflink $testdir/file1 $testdir/file2 >> $seqres.full +_scratch_remount + +echo "Compare files" +md5sum $testdir/file1 | _filter_scratch +md5sum $testdir/file2 | _filter_scratch + +echo "CoW and unmount" +for i in `seq 1 8`; do + $XFS_IO_PROG -f -c "pwrite -R -S 0x63 -b $real_blksz 0 $filesize" -c "fdatasync" $testdir/file2 >> $seqres.full +done +_scratch_remount + +echo "Compare files" +md5sum $testdir/file1 | _filter_scratch + +echo "Check extent counts" +old_extents=$(_count_extents $testdir/file1) +new_extents=$(_count_extents $testdir/file2) + +echo "old extents: $old_extents" >> $seqres.full +echo "new extents: $new_extents" >> $seqres.full +echo "maximum extents: $internal_blks" >> $seqres.full +test $new_extents -lt $((internal_blks * 2 / 3)) || echo "file2 badly fragmented" + +# success, all done +status=0 +exit diff --git a/tests/generic/301.out b/tests/generic/301.out new file mode 100644 index 0000000..3b677cb --- /dev/null +++ b/tests/generic/301.out @@ -0,0 +1,10 @@ +QA output created by 301 +Format and mount +Create the original files +Compare files +2909feb63a37b0e95fe5cfb7f274f7b1 SCRATCH_MNT/test-301/file1 +2909feb63a37b0e95fe5cfb7f274f7b1 SCRATCH_MNT/test-301/file2 +CoW and unmount +Compare files +2909feb63a37b0e95fe5cfb7f274f7b1 SCRATCH_MNT/test-301/file1 +Check extent counts diff --git a/tests/generic/302 b/tests/generic/302 new file mode 100755 index 0000000..c48da0a --- /dev/null +++ b/tests/generic/302 @@ -0,0 +1,101 @@ +#! /bin/bash +# FS QA Test No. 302 +# +# Test fragmentation after a lot of random CoW: +# - Create two reflinked files. +# - Directio write to random offsets to scatter CoW reservations. +# - Check the number of extents. +# +#----------------------------------------------------------------------- +# Copyright (c) 2016, Oracle and/or its affiliates. All Rights Reserved. +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License as +# published by the Free Software Foundation. +# +# This program is distributed in the hope that it would be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write the Free Software Foundation, +# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA +#----------------------------------------------------------------------- + +seq=`basename $0` +seqres=$RESULT_DIR/$seq +echo "QA output created by $seq" + +here=`pwd` +tmp=/tmp/$$ +status=1 # failure is the default! +trap "_cleanup; exit \$status" 0 1 2 3 15 + +_cleanup() +{ + cd / + rm -rf $tmp.* +} + +# get standard environment, filters and checks +. ./common/rc +. ./common/filter +. ./common/reflink + +# real QA test starts here +_supported_os Linux +_require_scratch_reflink +_require_cp_reflink +_require_fiemap +_require_odirect + +rm -f $seqres.full + +echo "Format and mount" +_scratch_mkfs > $seqres.full 2>&1 +_scratch_mount >> $seqres.full 2>&1 + +testdir=$SCRATCH_MNT/test-$seq +mkdir $testdir + +blksz=65536 +nr=128 +filesize=$((blksz * nr)) +bufnr=16 +bufsize=$((blksz * bufnr)) + +_require_fs_space $SCRATCH_MNT $((filesize / 1024 * 3 * 5 / 4)) +real_blksz=$(stat -f -c '%S' $testdir) +internal_blks=$((filesize / real_blksz)) + +echo "Create the original files" +$XFS_IO_PROG -f -c "pwrite -S 0x61 -b $bufsize 0 $((filesize + 1))" $testdir/file1 >> $seqres.full +_cp_reflink $testdir/file1 $testdir/file2 >> $seqres.full +_scratch_remount + +echo "Compare files" +md5sum $testdir/file1 | _filter_scratch +md5sum $testdir/file2 | _filter_scratch + +echo "CoW and unmount" +for i in `seq 1 8`; do + $XFS_IO_PROG -d -f -c "pwrite -R -S 0x63 -b $real_blksz 0 $filesize" $testdir/file2 >> $seqres.full +done +_scratch_remount + +echo "Compare files" +md5sum $testdir/file1 | _filter_scratch + +echo "Check extent counts" +old_extents=$(_count_extents $testdir/file1) +new_extents=$(_count_extents $testdir/file2) + +echo "old extents: $old_extents" >> $seqres.full +echo "new extents: $new_extents" >> $seqres.full +echo "maximum extents: $internal_blks" >> $seqres.full +test $new_extents -le $internal_blks || echo "file2 badly fragmented" + +# success, all done +status=0 +exit diff --git a/tests/generic/302.out b/tests/generic/302.out new file mode 100644 index 0000000..6a46fd7 --- /dev/null +++ b/tests/generic/302.out @@ -0,0 +1,10 @@ +QA output created by 302 +Format and mount +Create the original files +Compare files +2909feb63a37b0e95fe5cfb7f274f7b1 SCRATCH_MNT/test-302/file1 +2909feb63a37b0e95fe5cfb7f274f7b1 SCRATCH_MNT/test-302/file2 +CoW and unmount +Compare files +2909feb63a37b0e95fe5cfb7f274f7b1 SCRATCH_MNT/test-302/file1 +Check extent counts diff --git a/tests/generic/group b/tests/generic/group index f1a398c..7edc963 100644 --- a/tests/generic/group +++ b/tests/generic/group @@ -303,6 +303,8 @@ 298 auto quick clone 299 auto aio enospc rw stress 300 auto aio enospc preallocrw stress +301 auto quick clone +302 auto quick clone 306 auto quick rw 307 auto quick 308 auto quick diff --git a/tests/xfs/180 b/tests/xfs/180 new file mode 100755 index 0000000..fdb24eb --- /dev/null +++ b/tests/xfs/180 @@ -0,0 +1,106 @@ +#! /bin/bash +# FS QA Test No. 180 +# +# Test fragmentation after a lot of random CoW: +# - Create two reflinked files. Set extsz hint on second file. +# - Buffered write to random offsets to scatter CoW reservations. +# - Rewrite the whole file to use up reservations. +# - Check the number of extents. +# +#----------------------------------------------------------------------- +# Copyright (c) 2016, Oracle and/or its affiliates. All Rights Reserved. +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License as +# published by the Free Software Foundation. +# +# This program is distributed in the hope that it would be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write the Free Software Foundation, +# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA +#----------------------------------------------------------------------- + +seq=`basename $0` +seqres=$RESULT_DIR/$seq +echo "QA output created by $seq" + +here=`pwd` +tmp=/tmp/$$ +status=1 # failure is the default! +trap "_cleanup; exit \$status" 0 1 2 3 15 + +_cleanup() +{ + cd / + rm -rf $tmp.* +} + +# get standard environment, filters and checks +. ./common/rc +. ./common/filter +. ./common/reflink + +# real QA test starts here +_supported_os Linux +_supported_fs xfs +_require_scratch_reflink +_require_cp_reflink +_require_fiemap +_require_xfs_io_command "cowextsize" + +rm -f $seqres.full + +echo "Format and mount" +_scratch_mkfs > $seqres.full 2>&1 +_scratch_mount >> $seqres.full 2>&1 + +testdir=$SCRATCH_MNT/test-$seq +mkdir $testdir + +blksz=65536 +nr=128 +filesize=$((blksz * nr)) +bufnr=16 +bufsize=$((blksz * bufnr)) + +_require_fs_space $SCRATCH_MNT $((filesize / 1024 * 3 * 5 / 4)) +real_blksz=$(stat -f -c '%S' $testdir) +internal_blks=$((filesize / real_blksz)) + +echo "Create the original files" +$XFS_IO_PROG -f -c "pwrite -S 0x61 -b $bufsize 0 $((filesize + 1))" $testdir/file1 >> $seqres.full +$XFS_IO_PROG -f -c "cowextsize $bufsize" $testdir/file2 +_cp_reflink $testdir/file1 $testdir/file2 >> $seqres.full +_scratch_remount + +echo "Compare files" +md5sum $testdir/file1 | _filter_scratch +md5sum $testdir/file2 | _filter_scratch + +echo "CoW and unmount" +$XFS_IO_PROG -f -c "cowextsize" $testdir/file2 >> $seqres.full +$XFS_IO_PROG -f -c "pwrite -R -S 0x63 -b $real_blksz 0 $filesize" -c "fdatasync" $testdir/file2 >> $seqres.full +$XFS_IO_PROG -f -c "pwrite -S 0x63 -b $real_blksz 0 $((filesize + 1))" -c "fdatasync" $testdir/file2 >> $seqres.full +_scratch_remount + +echo "Compare files" +md5sum $testdir/file1 | _filter_scratch +md5sum $testdir/file2 | _filter_scratch + +echo "Check extent counts" +old_extents=$(_count_extents $testdir/file1) +new_extents=$(_count_extents $testdir/file2) + +echo "old extents: $old_extents" >> $seqres.full +echo "new extents: $new_extents" >> $seqres.full +echo "maximum extents: $internal_blks" >> $seqres.full +test $new_extents -lt $((internal_blks / 20)) || test $new_extents -lt 15 \ + || echo "file2 badly fragmented" + +# success, all done +status=0 +exit diff --git a/tests/xfs/180.out b/tests/xfs/180.out new file mode 100644 index 0000000..a1cc4fd --- /dev/null +++ b/tests/xfs/180.out @@ -0,0 +1,11 @@ +QA output created by 180 +Format and mount +Create the original files +Compare files +2909feb63a37b0e95fe5cfb7f274f7b1 SCRATCH_MNT/test-180/file1 +2909feb63a37b0e95fe5cfb7f274f7b1 SCRATCH_MNT/test-180/file2 +CoW and unmount +Compare files +2909feb63a37b0e95fe5cfb7f274f7b1 SCRATCH_MNT/test-180/file1 +d41f6527bc8320364e12ea7076140b8b SCRATCH_MNT/test-180/file2 +Check extent counts diff --git a/tests/xfs/182 b/tests/xfs/182 new file mode 100755 index 0000000..c1bfc02 --- /dev/null +++ b/tests/xfs/182 @@ -0,0 +1,107 @@ +#! /bin/bash +# FS QA Test No. 182 +# +# Test fragmentation after a lot of random CoW: +# - Create two reflinked files. Set extsz hint on second file. +# - Directio write to random offsets to scatter CoW reservations. +# - Rewrite the whole file to use up reservations. +# - Check the number of extents. +# +#----------------------------------------------------------------------- +# Copyright (c) 2016, Oracle and/or its affiliates. All Rights Reserved. +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License as +# published by the Free Software Foundation. +# +# This program is distributed in the hope that it would be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write the Free Software Foundation, +# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA +#----------------------------------------------------------------------- + +seq=`basename $0` +seqres=$RESULT_DIR/$seq +echo "QA output created by $seq" + +here=`pwd` +tmp=/tmp/$$ +status=1 # failure is the default! +trap "_cleanup; exit \$status" 0 1 2 3 15 + +_cleanup() +{ + cd / + rm -rf $tmp.* +} + +# get standard environment, filters and checks +. ./common/rc +. ./common/filter +. ./common/reflink + +# real QA test starts here +_supported_os Linux +_supported_fs xfs +_require_scratch_reflink +_require_cp_reflink +_require_fiemap +_require_xfs_io_command "cowextsize" +_require_odirect + +rm -f $seqres.full + +echo "Format and mount" +_scratch_mkfs > $seqres.full 2>&1 +_scratch_mount >> $seqres.full 2>&1 + +testdir=$SCRATCH_MNT/test-$seq +mkdir $testdir + +blksz=65536 +nr=128 +filesize=$((blksz * nr)) +bufnr=16 +bufsize=$((blksz * bufnr)) + +_require_fs_space $SCRATCH_MNT $((filesize / 1024 * 3 * 5 / 4)) +real_blksz=$(stat -f -c '%S' $testdir) +internal_blks=$((filesize / real_blksz)) + +echo "Create the original files" +$XFS_IO_PROG -f -c "pwrite -S 0x61 -b $bufsize 0 $((filesize + 1))" $testdir/file1 >> $seqres.full +$XFS_IO_PROG -f -c "cowextsize $bufsize" $testdir/file2 +_cp_reflink $testdir/file1 $testdir/file2 >> $seqres.full +_scratch_remount + +echo "Compare files" +md5sum $testdir/file1 | _filter_scratch +md5sum $testdir/file2 | _filter_scratch + +echo "CoW and unmount" +$XFS_IO_PROG -f -c "cowextsize" $testdir/file2 >> $seqres.full +$XFS_IO_PROG -d -f -c "pwrite -R -S 0x63 -b $real_blksz 0 $((filesize + 1))" $testdir/file2 >> $seqres.full +$XFS_IO_PROG -d -f -c "pwrite -S 0x63 -b $real_blksz 0 $((filesize + 1))" $testdir/file2 >> $seqres.full +_scratch_remount + +echo "Compare files" +md5sum $testdir/file1 | _filter_scratch +md5sum $testdir/file2 | _filter_scratch + +echo "Check extent counts" +old_extents=$(_count_extents $testdir/file1) +new_extents=$(_count_extents $testdir/file2) + +echo "old extents: $old_extents" >> $seqres.full +echo "new extents: $new_extents" >> $seqres.full +echo "maximum extents: $internal_blks" >> $seqres.full +test $new_extents -lt $((internal_blks / 20)) || test $new_extents -lt 15 \ + || echo "file2 badly fragmented" + +# success, all done +status=0 +exit diff --git a/tests/xfs/182.out b/tests/xfs/182.out new file mode 100644 index 0000000..7b0af93 --- /dev/null +++ b/tests/xfs/182.out @@ -0,0 +1,12 @@ +QA output created by 182 +Format and mount +Create the original files +Compare files +2909feb63a37b0e95fe5cfb7f274f7b1 SCRATCH_MNT/test-182/file1 +2909feb63a37b0e95fe5cfb7f274f7b1 SCRATCH_MNT/test-182/file2 +CoW and unmount +pwrite64: Invalid argument +Compare files +2909feb63a37b0e95fe5cfb7f274f7b1 SCRATCH_MNT/test-182/file1 +c6ba35da9f73ced20d7781a448cc11d4 SCRATCH_MNT/test-182/file2 +Check extent counts diff --git a/tests/xfs/184 b/tests/xfs/184 new file mode 100755 index 0000000..50674ff --- /dev/null +++ b/tests/xfs/184 @@ -0,0 +1,105 @@ +#! /bin/bash +# FS QA Test No. 184 +# +# Test fragmentation after a lot of random CoW: +# - Create two reflinked files. Set extsz hint on second file. +# - Buffered write to random offsets to scatter CoW reservations. +# - falloc the whole file to unshare blocks. +# - Check the number of extents. +# +#----------------------------------------------------------------------- +# Copyright (c) 2016, Oracle and/or its affiliates. All Rights Reserved. +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License as +# published by the Free Software Foundation. +# +# This program is distributed in the hope that it would be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write the Free Software Foundation, +# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA +#----------------------------------------------------------------------- + +seq=`basename $0` +seqres=$RESULT_DIR/$seq +echo "QA output created by $seq" + +here=`pwd` +tmp=/tmp/$$ +status=1 # failure is the default! +trap "_cleanup; exit \$status" 0 1 2 3 15 + +_cleanup() +{ + cd / + rm -rf $tmp.* +} + +# get standard environment, filters and checks +. ./common/rc +. ./common/filter +. ./common/reflink + +# real QA test starts here +_supported_os Linux +_supported_fs xfs +_require_scratch_reflink +_require_cp_reflink +_require_fiemap +_require_xfs_io_command "cowextsize" + +rm -f $seqres.full + +echo "Format and mount" +_scratch_mkfs > $seqres.full 2>&1 +_scratch_mount >> $seqres.full 2>&1 + +testdir=$SCRATCH_MNT/test-$seq +mkdir $testdir + +blksz=65536 +nr=128 +filesize=$((blksz * nr)) +bufnr=16 +bufsize=$((blksz * bufnr)) + +_require_fs_space $SCRATCH_MNT $((filesize / 1024 * 3 * 5 / 4)) +real_blksz=$(stat -f -c '%S' $testdir) +internal_blks=$((filesize / real_blksz)) + +echo "Create the original files" +$XFS_IO_PROG -f -c "pwrite -S 0x61 -b $bufsize 0 $((filesize + 1))" $testdir/file1 >> $seqres.full +$XFS_IO_PROG -f -c "cowextsize $bufsize" $testdir/file2 +_cp_reflink $testdir/file1 $testdir/file2 >> $seqres.full +_scratch_remount + +echo "Compare files" +md5sum $testdir/file1 | _filter_scratch +md5sum $testdir/file2 | _filter_scratch + +echo "CoW and unmount" +$XFS_IO_PROG -f -c "cowextsize" $testdir/file2 >> $seqres.full +$XFS_IO_PROG -f -c "pwrite -R -S 0x63 -b $real_blksz 0 $((filesize + 1))" -c "fdatasync" $testdir/file2 >> $seqres.full +$XFS_IO_PROG -f -c "falloc 0 $((filesize + 1))" $testdir/file2 >> $seqres.full +_scratch_remount + +echo "Compare files" +md5sum $testdir/file1 | _filter_scratch + +echo "Check extent counts" +old_extents=$(_count_extents $testdir/file1) +new_extents=$(_count_extents $testdir/file2) + +echo "old extents: $old_extents" >> $seqres.full +echo "new extents: $new_extents" >> $seqres.full +echo "maximum extents: $internal_blks" >> $seqres.full +test $new_extents -lt $((internal_blks / 20)) || test $new_extents -lt 15 \ + || echo "file2 badly fragmented" + +# success, all done +status=0 +exit diff --git a/tests/xfs/184.out b/tests/xfs/184.out new file mode 100644 index 0000000..f6f6061 --- /dev/null +++ b/tests/xfs/184.out @@ -0,0 +1,10 @@ +QA output created by 184 +Format and mount +Create the original files +Compare files +2909feb63a37b0e95fe5cfb7f274f7b1 SCRATCH_MNT/test-184/file1 +2909feb63a37b0e95fe5cfb7f274f7b1 SCRATCH_MNT/test-184/file2 +CoW and unmount +Compare files +2909feb63a37b0e95fe5cfb7f274f7b1 SCRATCH_MNT/test-184/file1 +Check extent counts diff --git a/tests/xfs/192 b/tests/xfs/192 new file mode 100755 index 0000000..6429def --- /dev/null +++ b/tests/xfs/192 @@ -0,0 +1,106 @@ +#! /bin/bash +# FS QA Test No. 192 +# +# Test fragmentation after a lot of random CoW: +# - Create two reflinked files. Set extsz hint on second file. +# - Directio write to random offsets to scatter CoW reservations. +# - falloc the whole file to unshare blocks. +# - Check the number of extents. +# +#----------------------------------------------------------------------- +# Copyright (c) 2016, Oracle and/or its affiliates. All Rights Reserved. +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License as +# published by the Free Software Foundation. +# +# This program is distributed in the hope that it would be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write the Free Software Foundation, +# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA +#----------------------------------------------------------------------- + +seq=`basename $0` +seqres=$RESULT_DIR/$seq +echo "QA output created by $seq" + +here=`pwd` +tmp=/tmp/$$ +status=1 # failure is the default! +trap "_cleanup; exit \$status" 0 1 2 3 15 + +_cleanup() +{ + cd / + rm -rf $tmp.* +} + +# get standard environment, filters and checks +. ./common/rc +. ./common/filter +. ./common/reflink + +# real QA test starts here +_supported_os Linux +_supported_fs xfs +_require_scratch_reflink +_require_cp_reflink +_require_fiemap +_require_xfs_io_command "cowextsize" +_require_odirect + +rm -f $seqres.full + +echo "Format and mount" +_scratch_mkfs > $seqres.full 2>&1 +_scratch_mount >> $seqres.full 2>&1 + +testdir=$SCRATCH_MNT/test-$seq +mkdir $testdir + +blksz=65536 +nr=128 +filesize=$((blksz * nr)) +bufnr=16 +bufsize=$((blksz * bufnr)) + +_require_fs_space $SCRATCH_MNT $((filesize / 1024 * 3 * 5 / 4)) +real_blksz=$(stat -f -c '%S' $testdir) +internal_blks=$((filesize / real_blksz)) + +echo "Create the original files" +$XFS_IO_PROG -f -c "pwrite -S 0x61 -b $bufsize 0 $((filesize + 1))" $testdir/file1 >> $seqres.full +$XFS_IO_PROG -f -c "cowextsize $bufsize" $testdir/file2 +_cp_reflink $testdir/file1 $testdir/file2 >> $seqres.full +_scratch_remount + +echo "Compare files" +md5sum $testdir/file1 | _filter_scratch +md5sum $testdir/file2 | _filter_scratch + +echo "CoW and unmount" +$XFS_IO_PROG -f -c "cowextsize" $testdir/file2 >> $seqres.full +$XFS_IO_PROG -d -f -c "pwrite -R -S 0x63 -b $real_blksz 0 $filesize" $testdir/file2 >> $seqres.full +$XFS_IO_PROG -d -f -c "falloc 0 $filesize" $testdir/file2 >> $seqres.full +_scratch_remount + +echo "Compare files" +md5sum $testdir/file1 | _filter_scratch + +echo "Check extent counts" +old_extents=$(_count_extents $testdir/file1) +new_extents=$(_count_extents $testdir/file2) + +echo "old extents: $old_extents" >> $seqres.full +echo "new extents: $new_extents" >> $seqres.full +echo "maximum extents: $internal_blks" >> $seqres.full +test $new_extents -lt $((internal_blks / 20)) || test $new_extents -lt 15 \ + || echo "file2 badly fragmented" + +# success, all done +status=0 +exit diff --git a/tests/xfs/192.out b/tests/xfs/192.out new file mode 100644 index 0000000..13c8061 --- /dev/null +++ b/tests/xfs/192.out @@ -0,0 +1,10 @@ +QA output created by 192 +Format and mount +Create the original files +Compare files +2909feb63a37b0e95fe5cfb7f274f7b1 SCRATCH_MNT/test-192/file1 +2909feb63a37b0e95fe5cfb7f274f7b1 SCRATCH_MNT/test-192/file2 +CoW and unmount +Compare files +2909feb63a37b0e95fe5cfb7f274f7b1 SCRATCH_MNT/test-192/file1 +Check extent counts diff --git a/tests/xfs/193 b/tests/xfs/193 new file mode 100755 index 0000000..974f1eb --- /dev/null +++ b/tests/xfs/193 @@ -0,0 +1,102 @@ +#! /bin/bash +# FS QA Test No. 193 +# +# Test fragmentation after a lot of random CoW: +# - Create two reflinked files. Set extsz hint on second file. +# - Buffered write to random offsets to scatter CoW reservations. +# - Check the number of extents. +# +#----------------------------------------------------------------------- +# Copyright (c) 2016, Oracle and/or its affiliates. All Rights Reserved. +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License as +# published by the Free Software Foundation. +# +# This program is distributed in the hope that it would be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write the Free Software Foundation, +# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA +#----------------------------------------------------------------------- + +seq=`basename $0` +seqres=$RESULT_DIR/$seq +echo "QA output created by $seq" + +here=`pwd` +tmp=/tmp/$$ +status=1 # failure is the default! +trap "_cleanup; exit \$status" 0 1 2 3 15 + +_cleanup() +{ + cd / + rm -rf $tmp.* +} + +# get standard environment, filters and checks +. ./common/rc +. ./common/filter +. ./common/reflink + +# real QA test starts here +_supported_os Linux +_supported_fs xfs +_require_scratch_reflink +_require_cp_reflink +_require_fiemap +_require_xfs_io_command "cowextsize" + +rm -f $seqres.full + +echo "Format and mount" +_scratch_mkfs > $seqres.full 2>&1 +_scratch_mount >> $seqres.full 2>&1 + +testdir=$SCRATCH_MNT/test-$seq +mkdir $testdir + +blksz=65536 +nr=128 +filesize=$((blksz * nr)) +bufnr=16 +bufsize=$((blksz * bufnr)) + +_require_fs_space $SCRATCH_MNT $((filesize / 1024 * 3 * 5 / 4)) +real_blksz=$(stat -f -c '%S' $testdir) +internal_blks=$((filesize / real_blksz)) + +echo "Create the original files" +$XFS_IO_PROG -f -c "pwrite -S 0x61 -b $bufsize 0 $((filesize + 1))" $testdir/file1 >> $seqres.full +$XFS_IO_PROG -f -c "cowextsize $bufsize" $testdir/file2 +_cp_reflink $testdir/file1 $testdir/file2 >> $seqres.full +_scratch_remount + +echo "Compare files" +md5sum $testdir/file1 | _filter_scratch +md5sum $testdir/file2 | _filter_scratch + +echo "CoW and unmount" +$XFS_IO_PROG -f -c "cowextsize" $testdir/file2 >> $seqres.full +$XFS_IO_PROG -f -c "pwrite -R -S 0x63 -b $real_blksz 0 $filesize" -c "fdatasync" $testdir/file2 >> $seqres.full +_scratch_remount + +echo "Compare files" +md5sum $testdir/file1 | _filter_scratch + +echo "Check extent counts" +old_extents=$(_count_extents $testdir/file1) +new_extents=$(_count_extents $testdir/file2) + +echo "old extents: $old_extents" >> $seqres.full +echo "new extents: $new_extents" >> $seqres.full +echo "maximum extents: $internal_blks" >> $seqres.full +test $new_extents -lt $((internal_blks * 2 / 3)) || echo "file2 badly fragmented" + +# success, all done +status=0 +exit diff --git a/tests/xfs/193.out b/tests/xfs/193.out new file mode 100644 index 0000000..cc12b6b --- /dev/null +++ b/tests/xfs/193.out @@ -0,0 +1,10 @@ +QA output created by 193 +Format and mount +Create the original files +Compare files +2909feb63a37b0e95fe5cfb7f274f7b1 SCRATCH_MNT/test-193/file1 +2909feb63a37b0e95fe5cfb7f274f7b1 SCRATCH_MNT/test-193/file2 +CoW and unmount +Compare files +2909feb63a37b0e95fe5cfb7f274f7b1 SCRATCH_MNT/test-193/file1 +Check extent counts diff --git a/tests/xfs/198 b/tests/xfs/198 new file mode 100755 index 0000000..7f3c105 --- /dev/null +++ b/tests/xfs/198 @@ -0,0 +1,103 @@ +#! /bin/bash +# FS QA Test No. 198 +# +# Test fragmentation after a lot of random CoW: +# - Create two reflinked files. Set extsz hint on second file. +# - Directio write to random offsets to scatter CoW reservations. +# - Check the number of extents. +# +#----------------------------------------------------------------------- +# Copyright (c) 2016, Oracle and/or its affiliates. All Rights Reserved. +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License as +# published by the Free Software Foundation. +# +# This program is distributed in the hope that it would be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write the Free Software Foundation, +# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA +#----------------------------------------------------------------------- + +seq=`basename $0` +seqres=$RESULT_DIR/$seq +echo "QA output created by $seq" + +here=`pwd` +tmp=/tmp/$$ +status=1 # failure is the default! +trap "_cleanup; exit \$status" 0 1 2 3 15 + +_cleanup() +{ + cd / + rm -rf $tmp.* +} + +# get standard environment, filters and checks +. ./common/rc +. ./common/filter +. ./common/reflink + +# real QA test starts here +_supported_os Linux +_supported_fs xfs +_require_scratch_reflink +_require_cp_reflink +_require_fiemap +_require_xfs_io_command "cowextsize" +_require_odirect + +rm -f $seqres.full + +echo "Format and mount" +_scratch_mkfs > $seqres.full 2>&1 +_scratch_mount >> $seqres.full 2>&1 + +testdir=$SCRATCH_MNT/test-$seq +mkdir $testdir + +blksz=65536 +nr=128 +filesize=$((blksz * nr)) +bufnr=16 +bufsize=$((blksz * bufnr)) + +_require_fs_space $SCRATCH_MNT $((filesize / 1024 * 3 * 5 / 4)) +real_blksz=$(stat -f -c '%S' $testdir) +internal_blks=$((filesize / real_blksz)) + +echo "Create the original files" +$XFS_IO_PROG -f -c "pwrite -S 0x61 -b $bufsize 0 $((filesize + 1))" $testdir/file1 >> $seqres.full +$XFS_IO_PROG -f -c "cowextsize $bufsize" $testdir/file2 +_cp_reflink $testdir/file1 $testdir/file2 >> $seqres.full +_scratch_remount + +echo "Compare files" +md5sum $testdir/file1 | _filter_scratch +md5sum $testdir/file2 | _filter_scratch + +echo "CoW and unmount" +$XFS_IO_PROG -f -c "cowextsize" $testdir/file2 >> $seqres.full +$XFS_IO_PROG -d -f -c "pwrite -R -S 0x63 -b $real_blksz 0 $filesize" $testdir/file2 >> $seqres.full +_scratch_remount + +echo "Compare files" +md5sum $testdir/file1 | _filter_scratch + +echo "Check extent counts" +old_extents=$(_count_extents $testdir/file1) +new_extents=$(_count_extents $testdir/file2) + +echo "old extents: $old_extents" >> $seqres.full +echo "new extents: $new_extents" >> $seqres.full +echo "maximum extents: $internal_blks" >> $seqres.full +test $new_extents -lt $((internal_blks * 2 / 3)) || echo "file2 badly fragmented" + +# success, all done +status=0 +exit diff --git a/tests/xfs/198.out b/tests/xfs/198.out new file mode 100644 index 0000000..e1d1831 --- /dev/null +++ b/tests/xfs/198.out @@ -0,0 +1,10 @@ +QA output created by 198 +Format and mount +Create the original files +Compare files +2909feb63a37b0e95fe5cfb7f274f7b1 SCRATCH_MNT/test-198/file1 +2909feb63a37b0e95fe5cfb7f274f7b1 SCRATCH_MNT/test-198/file2 +CoW and unmount +Compare files +2909feb63a37b0e95fe5cfb7f274f7b1 SCRATCH_MNT/test-198/file1 +Check extent counts diff --git a/tests/xfs/200 b/tests/xfs/200 new file mode 100755 index 0000000..99bcf31 --- /dev/null +++ b/tests/xfs/200 @@ -0,0 +1,109 @@ +#! /bin/bash +# FS QA Test No. 200 +# +# Test fragmentation after a lot of random CoW: +# - Create two reflinked files. Set extsz hint on second file. +# - Read the whole file into memory. +# - Buffered write to random offsets to scatter CoW reservations. +# - fadvise(dontneed) the whole file to evict the pages. +# - falloc the whole fle to see if the extsz hints still apply. +# - Check the number of extents. +# +#----------------------------------------------------------------------- +# Copyright (c) 2016, Oracle and/or its affiliates. All Rights Reserved. +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License as +# published by the Free Software Foundation. +# +# This program is distributed in the hope that it would be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write the Free Software Foundation, +# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA +#----------------------------------------------------------------------- + +seq=`basename $0` +seqres=$RESULT_DIR/$seq +echo "QA output created by $seq" + +here=`pwd` +tmp=/tmp/$$ +status=1 # failure is the default! +trap "_cleanup; exit \$status" 0 1 2 3 15 + +_cleanup() +{ + cd / + rm -rf $tmp.* +} + +# get standard environment, filters and checks +. ./common/rc +. ./common/filter +. ./common/reflink + +# real QA test starts here +_supported_os Linux +_supported_fs xfs +_require_scratch_reflink +_require_cp_reflink +_require_fiemap +_require_xfs_io_command "cowextsize" + +rm -f $seqres.full + +echo "Format and mount" +_scratch_mkfs > $seqres.full 2>&1 +_scratch_mount >> $seqres.full 2>&1 + +testdir=$SCRATCH_MNT/test-$seq +mkdir $testdir + +blksz=65536 +nr=128 +filesize=$((blksz * nr)) +bufnr=16 +bufsize=$((blksz * bufnr)) + +_require_fs_space $SCRATCH_MNT $((filesize / 1024 * 3 * 5 / 4)) +real_blksz=$(stat -f -c '%S' $testdir) +internal_blks=$((filesize / real_blksz)) + +echo "Create the original files" +$XFS_IO_PROG -f -c "pwrite -S 0x61 -b $bufsize 0 $((filesize + 1))" $testdir/file1 >> $seqres.full +$XFS_IO_PROG -f -c "cowextsize $bufsize" $testdir/file2 +_cp_reflink $testdir/file1 $testdir/file2 >> $seqres.full +_scratch_remount + +echo "Compare files" +md5sum $testdir/file1 | _filter_scratch +md5sum $testdir/file2 | _filter_scratch + +echo "CoW and unmount" +$XFS_IO_PROG -f -c "cowextsize" $testdir/file2 >> $seqres.full +cat $testdir/file2 > /dev/null +$XFS_IO_PROG -f -c "pwrite -R -S 0x63 -b $real_blksz 0 $filesize" -c "fdatasync" $testdir/file2 >> $seqres.full +$XFS_IO_PROG -f -c "fadvise -d 0 $filesize" -c "fsync" $testdir/file2 >> $seqres.full +$XFS_IO_PROG -f -c "falloc 0 $filesize" $testdir/file2 >> $seqres.full +_scratch_remount + +echo "Compare files" +md5sum $testdir/file1 | _filter_scratch + +echo "Check extent counts" +old_extents=$(_count_extents $testdir/file1) +new_extents=$(_count_extents $testdir/file2) + +echo "old extents: $old_extents" >> $seqres.full +echo "new extents: $new_extents" >> $seqres.full +echo "maximum extents: $internal_blks" >> $seqres.full +test $new_extents -lt $((internal_blks / 20)) || test $new_extents -lt 15 \ + || echo "file2 badly fragmented" + +# success, all done +status=0 +exit diff --git a/tests/xfs/200.out b/tests/xfs/200.out new file mode 100644 index 0000000..6e0a1ee --- /dev/null +++ b/tests/xfs/200.out @@ -0,0 +1,10 @@ +QA output created by 200 +Format and mount +Create the original files +Compare files +2909feb63a37b0e95fe5cfb7f274f7b1 SCRATCH_MNT/test-200/file1 +2909feb63a37b0e95fe5cfb7f274f7b1 SCRATCH_MNT/test-200/file2 +CoW and unmount +Compare files +2909feb63a37b0e95fe5cfb7f274f7b1 SCRATCH_MNT/test-200/file1 +Check extent counts diff --git a/tests/xfs/204 b/tests/xfs/204 new file mode 100755 index 0000000..3159849 --- /dev/null +++ b/tests/xfs/204 @@ -0,0 +1,110 @@ +#! /bin/bash +# FS QA Test No. 204 +# +# Test fragmentation after a lot of random CoW: +# - Create two reflinked files. Set extsz hint on second file. +# - Read the whole file into memory. +# - DIO write to random offsets to scatter CoW reservations. +# - fadvise(dontneed) the whole file to evict the pages. +# - falloc the whole fle to see if the extsz hints still apply. +# - Check the number of extents. +# +#----------------------------------------------------------------------- +# Copyright (c) 2016, Oracle and/or its affiliates. All Rights Reserved. +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License as +# published by the Free Software Foundation. +# +# This program is distributed in the hope that it would be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write the Free Software Foundation, +# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA +#----------------------------------------------------------------------- + +seq=`basename $0` +seqres=$RESULT_DIR/$seq +echo "QA output created by $seq" + +here=`pwd` +tmp=/tmp/$$ +status=1 # failure is the default! +trap "_cleanup; exit \$status" 0 1 2 3 15 + +_cleanup() +{ + cd / + rm -rf $tmp.* +} + +# get standard environment, filters and checks +. ./common/rc +. ./common/filter +. ./common/reflink + +# real QA test starts here +_supported_os Linux +_supported_fs xfs +_require_scratch_reflink +_require_cp_reflink +_require_fiemap +_require_xfs_io_command "cowextsize" +_require_odirect + +rm -f $seqres.full + +echo "Format and mount" +_scratch_mkfs > $seqres.full 2>&1 +_scratch_mount >> $seqres.full 2>&1 + +testdir=$SCRATCH_MNT/test-$seq +mkdir $testdir + +blksz=65536 +nr=128 +filesize=$((blksz * nr)) +bufnr=16 +bufsize=$((blksz * bufnr)) + +_require_fs_space $SCRATCH_MNT $((filesize / 1024 * 3 * 5 / 4)) +real_blksz=$(stat -f -c '%S' $testdir) +internal_blks=$((filesize / real_blksz)) + +echo "Create the original files" +$XFS_IO_PROG -f -c "pwrite -S 0x61 -b $bufsize 0 $((filesize + 1))" $testdir/file1 >> $seqres.full +$XFS_IO_PROG -f -c "cowextsize $bufsize" $testdir/file2 +_cp_reflink $testdir/file1 $testdir/file2 >> $seqres.full +_scratch_remount + +echo "Compare files" +md5sum $testdir/file1 | _filter_scratch +md5sum $testdir/file2 | _filter_scratch + +echo "CoW and unmount" +$XFS_IO_PROG -f -c "cowextsize" $testdir/file2 >> $seqres.full +cat $testdir/file2 > /dev/null +$XFS_IO_PROG -d -f -c "pwrite -R -S 0x63 -b $real_blksz 0 $filesize" -c "fdatasync" $testdir/file2 >> $seqres.full +$XFS_IO_PROG -f -c "fadvise -d 0 $filesize" -c "fsync" $testdir/file2 >> $seqres.full +$XFS_IO_PROG -f -c "falloc 0 $filesize" $testdir/file2 >> $seqres.full +_scratch_remount + +echo "Compare files" +md5sum $testdir/file1 | _filter_scratch + +echo "Check extent counts" +old_extents=$(_count_extents $testdir/file1) +new_extents=$(_count_extents $testdir/file2) + +echo "old extents: $old_extents" >> $seqres.full +echo "new extents: $new_extents" >> $seqres.full +echo "maximum extents: $internal_blks" >> $seqres.full +test $new_extents -lt $((internal_blks / 20)) || test $new_extents -lt 15 \ + || echo "file2 badly fragmented" + +# success, all done +status=0 +exit diff --git a/tests/xfs/204.out b/tests/xfs/204.out new file mode 100644 index 0000000..702cd72 --- /dev/null +++ b/tests/xfs/204.out @@ -0,0 +1,10 @@ +QA output created by 204 +Format and mount +Create the original files +Compare files +2909feb63a37b0e95fe5cfb7f274f7b1 SCRATCH_MNT/test-204/file1 +2909feb63a37b0e95fe5cfb7f274f7b1 SCRATCH_MNT/test-204/file2 +CoW and unmount +Compare files +2909feb63a37b0e95fe5cfb7f274f7b1 SCRATCH_MNT/test-204/file1 +Check extent counts diff --git a/tests/xfs/207 b/tests/xfs/207 new file mode 100755 index 0000000..d416f79 --- /dev/null +++ b/tests/xfs/207 @@ -0,0 +1,101 @@ +#! /bin/bash +# FS QA Test No. 207 +# +# Test setting the extsz and cowextsz hints: +# - Ensure that we can set both on a zero-byte file. +# - Ensure that we can set only cowextsz on a many-byte file. +# - Ensure that whatever we set we get back later. +# +#----------------------------------------------------------------------- +# Copyright (c) 2016, Oracle and/or its affiliates. All Rights Reserved. +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License as +# published by the Free Software Foundation. +# +# This program is distributed in the hope that it would be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write the Free Software Foundation, +# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA +#----------------------------------------------------------------------- + +seq=`basename $0` +seqres=$RESULT_DIR/$seq +echo "QA output created by $seq" + +here=`pwd` +tmp=/tmp/$$ +status=1 # failure is the default! +trap "_cleanup; exit \$status" 0 1 2 3 15 + +_cleanup() +{ + cd / + rm -rf $tmp.* +} + +# get standard environment, filters and checks +. ./common/rc +. ./common/filter +. ./common/reflink + +# real QA test starts here +_supported_os Linux +_supported_fs xfs +_require_scratch_reflink +_require_cp_reflink +_require_fiemap +_require_xfs_io_command "cowextsize" + +rm -f $seqres.full + +echo "Format and mount" +_scratch_mkfs > $seqres.full 2>&1 +_scratch_mount >> $seqres.full 2>&1 + +testdir=$SCRATCH_MNT/test-$seq +mkdir $testdir + +echo "Create the original files" +$XFS_IO_PROG -f -c "pwrite -S 0x61 0 0" $testdir/file1 >> $seqres.full +$XFS_IO_PROG -f -c "pwrite -S 0x61 0 1048576" $testdir/file2 >> $seqres.full +$XFS_IO_PROG -f -c "pwrite -S 0x61 0 0" $testdir/file3 >> $seqres.full +_scratch_remount + +echo "Set extsz and cowextsz on zero byte file" +$XFS_IO_PROG -c "extsize 1048576" $testdir/file1 | _filter_scratch +$XFS_IO_PROG -c "cowextsize 1048576" $testdir/file1 | _filter_scratch + +echo "Set extsz and cowextsz on 1Mbyte file" +$XFS_IO_PROG -c "extsize 1048576" $testdir/file2 | _filter_scratch +$XFS_IO_PROG -c "cowextsize 1048576" $testdir/file2 | _filter_scratch +_scratch_remount + +echo "Check extsz and cowextsz settings on zero byte file" +$XFS_IO_PROG -c "extsize" $testdir/file1 | _filter_scratch +$XFS_IO_PROG -c "cowextsize" $testdir/file1 | _filter_scratch + +echo "Check extsz and cowextsz settings on 1Mbyte file" +$XFS_IO_PROG -c "extsize" $testdir/file2 | _filter_scratch +$XFS_IO_PROG -c "cowextsize" $testdir/file2 | _filter_scratch + +echo "Set cowextsize and check flag" +$XFS_IO_PROG -c "cowextsize 1048576" $testdir/file3 | _filter_scratch +_scratch_remount + +$XFS_IO_PROG -c "stat" $testdir/file3 | grep 'fsxattr.xflags' | _filter_scratch +$XFS_IO_PROG -c "cowextsize" $testdir/file3 | _filter_scratch + +echo "Unset cowextsize and check flag" +$XFS_IO_PROG -c "cowextsize 0" $testdir/file3 | _filter_scratch +_scratch_remount + +$XFS_IO_PROG -c "stat" $testdir/file3 | grep 'fsxattr.xflags' | _filter_scratch +$XFS_IO_PROG -c "cowextsize" $testdir/file3 | _filter_scratch + +status=0 +exit diff --git a/tests/xfs/207.out b/tests/xfs/207.out new file mode 100644 index 0000000..14eede4 --- /dev/null +++ b/tests/xfs/207.out @@ -0,0 +1,18 @@ +QA output created by 207 +Format and mount +Create the original files +Set extsz and cowextsz on zero byte file +Set extsz and cowextsz on 1Mbyte file +xfs_io: XFS_IOC_FSSETXATTR SCRATCH_MNT/test-207/file2: Invalid argument +Check extsz and cowextsz settings on zero byte file +[1048576] SCRATCH_MNT/test-207/file1 +[1048576] SCRATCH_MNT/test-207/file1 +Check extsz and cowextsz settings on 1Mbyte file +[0] SCRATCH_MNT/test-207/file2 +[1048576] SCRATCH_MNT/test-207/file2 +Set cowextsize and check flag +fsxattr.xflags = 0x20000 [---------------C] +[1048576] SCRATCH_MNT/test-207/file3 +Unset cowextsize and check flag +fsxattr.xflags = 0x0 [----------------] +[0] SCRATCH_MNT/test-207/file3 diff --git a/tests/xfs/208 b/tests/xfs/208 new file mode 100755 index 0000000..d876898 --- /dev/null +++ b/tests/xfs/208 @@ -0,0 +1,138 @@ +#! /bin/bash +# FS QA Test No. 208 +# +# Ensure that the effective cow extent allocation size hint is the maximum of +# the cowextsize and extsize inode fields. +# - Create two reflinked files. Set extsz hint on second file to $blocksize +# and cowextsize hint to 1MB. +# - Buffered write to random offsets to scatter CoW reservations. +# - Rewrite the whole file to use up reservations. +# - Check the number of extents. +# - Repeat, but with extsz = 1MB and cowextsz = $blocksize. +# +#----------------------------------------------------------------------- +# Copyright (c) 2016, Oracle and/or its affiliates. All Rights Reserved. +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License as +# published by the Free Software Foundation. +# +# This program is distributed in the hope that it would be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write the Free Software Foundation, +# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA +#----------------------------------------------------------------------- + +seq=`basename $0` +seqres=$RESULT_DIR/$seq +echo "QA output created by $seq" + +here=`pwd` +tmp=/tmp/$$ +status=1 # failure is the default! +trap "_cleanup; exit \$status" 0 1 2 3 15 + +_cleanup() +{ + cd / + rm -rf $tmp.* +} + +# get standard environment, filters and checks +. ./common/rc +. ./common/filter +. ./common/reflink + +# real QA test starts here +_supported_os Linux +_supported_fs xfs +_require_scratch_reflink +_require_cp_reflink +_require_fiemap +_require_xfs_io_command "cowextsize" + +rm -f $seqres.full + +echo "Format and mount" +_scratch_mkfs > $seqres.full 2>&1 +_scratch_mount >> $seqres.full 2>&1 + +testdir=$SCRATCH_MNT/test-$seq +mkdir $testdir + +blksz=65536 +nr=128 +filesize=$((blksz * nr)) +bufnr=16 +bufsize=$((blksz * bufnr)) + +_require_fs_space $SCRATCH_MNT $((filesize / 1024 * 3 * 5 / 4)) +real_blksz=$(stat -f -c '%S' $testdir) +internal_blks=$((filesize / real_blksz)) + +echo "Create the original files" +$XFS_IO_PROG -f -c "pwrite -S 0x61 -b $bufsize 0 $((filesize + 1))" $testdir/file1 >> $seqres.full + +$XFS_IO_PROG -f -c "extsize $real_blksz" $testdir/file2 +$XFS_IO_PROG -f -c "cowextsize $bufsize" $testdir/file2 +_cp_reflink $testdir/file1 $testdir/file2 >> $seqres.full +_cp_reflink $testdir/file1 $testdir/file2 >> $seqres.full + +$XFS_IO_PROG -f -c "extsize $bufsize" $testdir/file3 +$XFS_IO_PROG -f -c "cowextsize $real_blksz" $testdir/file3 +_cp_reflink $testdir/file1 $testdir/file3 >> $seqres.full +_scratch_remount + +echo "Compare files" +md5sum $testdir/file1 | _filter_scratch +md5sum $testdir/file2 | _filter_scratch +md5sum $testdir/file3 | _filter_scratch + +echo "CoW and unmount" +echo "extsize" >> $seqres.full +$XFS_IO_PROG -f -c "extsize" $testdir/file2 >> $seqres.full +echo "cowextsize" >> $seqres.full +$XFS_IO_PROG -f -c "cowextsize" $testdir/file2 >> $seqres.full + +$XFS_IO_PROG -f -c "pwrite -R -S 0x63 -b $real_blksz 0 $filesize" -c "fdatasync" $testdir/file2 >> $seqres.full +$XFS_IO_PROG -f -c "pwrite -S 0x63 -b $real_blksz 0 $((filesize + 1))" -c "fdatasync" $testdir/file2 >> $seqres.full + +echo "extsize" >> $seqres.full +$XFS_IO_PROG -f -c "extsize" $testdir/file3 >> $seqres.full +echo "cowextsize" >> $seqres.full +$XFS_IO_PROG -f -c "cowextsize" $testdir/file3 >> $seqres.full + +$XFS_IO_PROG -f -c "pwrite -R -S 0x63 -b $real_blksz 0 $filesize" -c "fdatasync" $testdir/file3 >> $seqres.full +$XFS_IO_PROG -f -c "pwrite -S 0x63 -b $real_blksz 0 $((filesize + 1))" -c "fdatasync" $testdir/file3 >> $seqres.full +_scratch_remount + +echo "Compare files" +md5sum $testdir/file1 | _filter_scratch +md5sum $testdir/file2 | _filter_scratch +md5sum $testdir/file3 | _filter_scratch + +echo "Check extent counts" +old_extents=$(_count_extents $testdir/file1) +new_extents=$(_count_extents $testdir/file2) + +echo "old extents: $old_extents" >> $seqres.full +echo "new extents: $new_extents" >> $seqres.full +echo "maximum extents: $internal_blks" >> $seqres.full +test $new_extents -lt $((internal_blks / 20)) || test $new_extents -lt 15 \ + || echo "file2 badly fragmented" + +new_extents=$(_count_extents $testdir/file3) + +echo "old extents: $old_extents" >> $seqres.full +echo "new extents: $new_extents" >> $seqres.full +echo "maximum extents: $internal_blks" >> $seqres.full +test $new_extents -lt $((internal_blks / 20)) || test $new_extents -lt 15 \ + || echo "file3 badly fragmented" + +# success, all done +status=0 +exit diff --git a/tests/xfs/208.out b/tests/xfs/208.out new file mode 100644 index 0000000..a344036 --- /dev/null +++ b/tests/xfs/208.out @@ -0,0 +1,13 @@ +QA output created by 208 +Format and mount +Create the original files +Compare files +2909feb63a37b0e95fe5cfb7f274f7b1 SCRATCH_MNT/test-208/file1 +2909feb63a37b0e95fe5cfb7f274f7b1 SCRATCH_MNT/test-208/file2 +2909feb63a37b0e95fe5cfb7f274f7b1 SCRATCH_MNT/test-208/file3 +CoW and unmount +Compare files +2909feb63a37b0e95fe5cfb7f274f7b1 SCRATCH_MNT/test-208/file1 +d41f6527bc8320364e12ea7076140b8b SCRATCH_MNT/test-208/file2 +d41f6527bc8320364e12ea7076140b8b SCRATCH_MNT/test-208/file3 +Check extent counts diff --git a/tests/xfs/209 b/tests/xfs/209 new file mode 100755 index 0000000..684187e --- /dev/null +++ b/tests/xfs/209 @@ -0,0 +1,82 @@ +#! /bin/bash +# FS QA Test No. 209 +# +# Make sure setting cowextsz on a directory propagates it to subfiles. +# +#----------------------------------------------------------------------- +# Copyright (c) 2016, Oracle and/or its affiliates. All Rights Reserved. +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License as +# published by the Free Software Foundation. +# +# This program is distributed in the hope that it would be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write the Free Software Foundation, +# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA +#----------------------------------------------------------------------- + +seq=`basename $0` +seqres=$RESULT_DIR/$seq +echo "QA output created by $seq" + +here=`pwd` +tmp=/tmp/$$ +status=1 # failure is the default! +trap "_cleanup; exit \$status" 0 1 2 3 15 + +_cleanup() +{ + cd / + rm -rf $tmp.* +} + +# get standard environment, filters and checks +. ./common/rc +. ./common/filter +. ./common/reflink + +# real QA test starts here +_supported_os Linux +_supported_fs xfs +_require_scratch_reflink +_require_cp_reflink +_require_fiemap +_require_xfs_io_command "cowextsize" + +rm -f $seqres.full + +echo "Format and mount" +_scratch_mkfs > $seqres.full 2>&1 +_scratch_mount >> $seqres.full 2>&1 + +testdir=$SCRATCH_MNT/test-$seq +mkdir $testdir + +echo "Set extsz and cowextsz on directory" +$XFS_IO_PROG -c "cowextsize 1048576" $testdir >> $seqres.full + +echo "Create a fake tree structure" +seq 1 2 | while read nr; do + mkdir "$testdir/dir-$nr" + seq 1 4 | while read nnr; do + touch "$testdir/dir-$nr/file-$nnr" + done +done +_scratch_remount + +echo "Check cowextsize settings" +seq 1 2 | while read nr; do + seq 1 4 | while read nnr; do + file="$testdir/dir-$nr/file-$nnr" + $XFS_IO_PROG -c "cowextsize" $file + done +done + +# success, all done +status=0 +exit diff --git a/tests/xfs/209.out b/tests/xfs/209.out new file mode 100644 index 0000000..109af34 --- /dev/null +++ b/tests/xfs/209.out @@ -0,0 +1,13 @@ +QA output created by 209 +Format and mount +Set extsz and cowextsz on directory +Create a fake tree structure +Check cowextsize settings +[1048576] /opt/test-209/dir-1/file-1 +[1048576] /opt/test-209/dir-1/file-2 +[1048576] /opt/test-209/dir-1/file-3 +[1048576] /opt/test-209/dir-1/file-4 +[1048576] /opt/test-209/dir-2/file-1 +[1048576] /opt/test-209/dir-2/file-2 +[1048576] /opt/test-209/dir-2/file-3 +[1048576] /opt/test-209/dir-2/file-4 diff --git a/tests/xfs/210 b/tests/xfs/210 new file mode 100755 index 0000000..d3a2716 --- /dev/null +++ b/tests/xfs/210 @@ -0,0 +1,108 @@ +#! /bin/bash +# FS QA Test No. 210 +# +# During reflink, XFS should carry the cowextsz setting to the destination file +# if the destination file size is less than the size of the source file, the +# length is the size of the source file, both offsets are zero, and the +# destination does not already have a cowextsz setting. It should not do so +# otherwise. +# +#----------------------------------------------------------------------- +# Copyright (c) 2016, Oracle and/or its affiliates. All Rights Reserved. +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License as +# published by the Free Software Foundation. +# +# This program is distributed in the hope that it would be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write the Free Software Foundation, +# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA +#----------------------------------------------------------------------- + +seq=`basename $0` +seqres=$RESULT_DIR/$seq +echo "QA output created by $seq" + +here=`pwd` +tmp=/tmp/$$ +status=1 # failure is the default! +trap "_cleanup; exit \$status" 0 1 2 3 15 + +_cleanup() +{ + cd / + rm -rf $tmp.* +} + +# get standard environment, filters and checks +. ./common/rc +. ./common/filter +. ./common/reflink + +# real QA test starts here +_supported_os Linux +_supported_fs xfs +_require_scratch_reflink +_require_cp_reflink +_require_fiemap +_require_xfs_io_command "cowextsize" + +rm -f $seqres.full + +echo "Format and mount" +_scratch_mkfs > $seqres.full 2>&1 +_scratch_mount >> $seqres.full 2>&1 + +testdir=$SCRATCH_MNT/test-$seq +mkdir $testdir + +echo "Create initial file" +$XFS_IO_PROG -f -c "pwrite -S 0x61 0 131072" $testdir/file1 >> $seqres.full +$XFS_IO_PROG -c "cowextsize 1048576" $testdir/file1 >> $seqres.full +$XFS_IO_PROG -f -c "pwrite -S 0x61 0 1" $testdir/file4 >> $seqres.full +$XFS_IO_PROG -f -c "pwrite -S 0x61 0 262144" $testdir/file7 >> $seqres.full +$XFS_IO_PROG -f -c "pwrite -S 0x61 0 262144" $testdir/file9 >> $seqres.full +$XFS_IO_PROG -f -c "pwrite -S 0x61 0 262144" $testdir/file10 >> $seqres.full + +echo "Reflink to an empty file" +_reflink_range $testdir/file1 0 $testdir/file2 0 0 >> $seqres.full + +echo "Reflink to an empty file that already has cowextsz" +$XFS_IO_PROG -f -c "cowextsize 524288" $testdir/file3 >> $seqres.full +_reflink_range $testdir/file1 0 $testdir/file3 0 0 >> $seqres.full + +echo "Reflink to a small file" +_reflink_range $testdir/file1 0 $testdir/file4 0 0 >> $seqres.full + +echo "Reflink to a nonzero offset" +_reflink_range $testdir/file1 0 $testdir/file5 65536 0 >> $seqres.full + +echo "Reflink from a nonzero offset" +_reflink_range $testdir/file1 65536 $testdir/file6 0 0 >> $seqres.full + +echo "Reflink to a larger file" +_reflink_range $testdir/file1 0 $testdir/file7 0 0 >> $seqres.full + +echo "Reflink less than the whole source file" +_reflink_range $testdir/file1 0 $testdir/file8 0 65536 >> $seqres.full + +echo "cp reflink to a larger file" +_cp_reflink $testdir/file1 $testdir/file9 >> $seqres.full + +echo "cp reflink to a larger file with cowextsize" +$XFS_IO_PROG -f -c "cowextsize 524288" $testdir/file10 >> $seqres.full +_cp_reflink $testdir/file1 $testdir/file10 >> $seqres.full + +echo "Check cowextsz" +for i in `seq 1 10`; do + $XFS_IO_PROG -c "cowextsize" $testdir/file$i | _filter_scratch +done + +# success, all done +status=0 +exit diff --git a/tests/xfs/210.out b/tests/xfs/210.out new file mode 100644 index 0000000..46d28d9 --- /dev/null +++ b/tests/xfs/210.out @@ -0,0 +1,23 @@ +QA output created by 210 +Format and mount +Create initial file +Reflink to an empty file +Reflink to an empty file that already has cowextsz +Reflink to a small file +Reflink to a nonzero offset +Reflink from a nonzero offset +Reflink to a larger file +Reflink less than the whole source file +cp reflink to a larger file +cp reflink to a larger file with cowextsize +Check cowextsz +[1048576] SCRATCH_MNT/test-210/file1 +[1048576] SCRATCH_MNT/test-210/file2 +[524288] SCRATCH_MNT/test-210/file3 +[1048576] SCRATCH_MNT/test-210/file4 +[0] SCRATCH_MNT/test-210/file5 +[0] SCRATCH_MNT/test-210/file6 +[0] SCRATCH_MNT/test-210/file7 +[0] SCRATCH_MNT/test-210/file8 +[1048576] SCRATCH_MNT/test-210/file9 +[524288] SCRATCH_MNT/test-210/file10 diff --git a/tests/xfs/211 b/tests/xfs/211 new file mode 100755 index 0000000..cb0f17a --- /dev/null +++ b/tests/xfs/211 @@ -0,0 +1,107 @@ +#! /bin/bash +# FS QA Test No. 211 +# +# Test fragmentation in a big file after a lot of random CoW: +# - Create two reflinked files. Set extsz hint on second file. +# - Directio write to random offsets to scatter CoW reservations. +# - Rewrite the whole file to use up reservations. +# - Check the number of extents. +# +#----------------------------------------------------------------------- +# Copyright (c) 2016, Oracle and/or its affiliates. All Rights Reserved. +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License as +# published by the Free Software Foundation. +# +# This program is distributed in the hope that it would be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write the Free Software Foundation, +# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA +#----------------------------------------------------------------------- + +seq=`basename $0` +seqres=$RESULT_DIR/$seq +echo "QA output created by $seq" + +here=`pwd` +tmp=/tmp/$$ +status=1 # failure is the default! +trap "_cleanup; exit \$status" 0 1 2 3 15 + +_cleanup() +{ + cd / + rm -rf $tmp.* +} + +# get standard environment, filters and checks +. ./common/rc +. ./common/filter +. ./common/reflink + +# real QA test starts here +_supported_os Linux +_supported_fs xfs +_require_scratch_reflink +_require_cp_reflink +_require_fiemap +_require_xfs_io_command "cowextsize" +_require_odirect + +rm -f $seqres.full + +echo "Format and mount" +_scratch_mkfs > $seqres.full 2>&1 +_scratch_mount >> $seqres.full 2>&1 + +testdir=$SCRATCH_MNT/test-$seq +mkdir $testdir + +blksz=65536 +nr=50000 +filesize=$((blksz * nr)) +bufnr=16 +bufsize=$((blksz * bufnr)) + +_require_fs_space $SCRATCH_MNT $((filesize / 1024 * 2 * 5 / 4)) +real_blksz=$(stat -f -c '%S' $testdir) +internal_blks=$((filesize / real_blksz)) + +echo "Create the original files" +$XFS_IO_PROG -f -c "pwrite -S 0x61 -b $bufsize 0 $((filesize + 1))" $testdir/file1 >> $seqres.full +$XFS_IO_PROG -f -c "cowextsize $bufsize" $testdir/file2 +_cp_reflink $testdir/file1 $testdir/file2 >> $seqres.full +_scratch_remount + +echo "Compare files" +md5sum $testdir/file1 | _filter_scratch +md5sum $testdir/file2 | _filter_scratch + +echo "CoW and unmount" +$XFS_IO_PROG -f -c "cowextsize" $testdir/file2 >> $seqres.full +$XFS_IO_PROG -d -f -c "pwrite -R -S 0x63 -b $real_blksz 0 $((filesize + 1))" $testdir/file2 >> $seqres.full +$XFS_IO_PROG -d -f -c "pwrite -S 0x63 -b 8388608 0 $filesize" $testdir/file2 >> $seqres.full +_scratch_remount + +echo "Compare files" +md5sum $testdir/file1 | _filter_scratch +md5sum $testdir/file2 | _filter_scratch + +echo "Check extent counts" +old_extents=$(_count_extents $testdir/file1) +new_extents=$(_count_extents $testdir/file2) + +echo "old extents: $old_extents" >> $seqres.full +echo "new extents: $new_extents" >> $seqres.full +echo "maximum extents: $internal_blks" >> $seqres.full +test $new_extents -lt $((internal_blks / 20)) || test $new_extents -lt 15 \ + || echo "file2 badly fragmented" + +# success, all done +status=0 +exit diff --git a/tests/xfs/211.out b/tests/xfs/211.out new file mode 100644 index 0000000..7371c5b --- /dev/null +++ b/tests/xfs/211.out @@ -0,0 +1,11 @@ +QA output created by 211 +Format and mount +Create the original files +Compare files +07415406aea963ab8e005f1d3744fded SCRATCH_MNT/test-211/file1 +07415406aea963ab8e005f1d3744fded SCRATCH_MNT/test-211/file2 +CoW and unmount +Compare files +07415406aea963ab8e005f1d3744fded SCRATCH_MNT/test-211/file1 +7d8ab127adfc1f745a7d1cd5e44d10d8 SCRATCH_MNT/test-211/file2 +Check extent counts diff --git a/tests/xfs/group b/tests/xfs/group index abf1d33..119e1fd 100644 --- a/tests/xfs/group +++ b/tests/xfs/group @@ -177,8 +177,11 @@ 177 dmapi 178 mkfs other auto 179 auto quick clone +180 auto quick clone 181 log auto quick +182 auto quick clone 183 rw other auto quick +184 auto quick clone 185 dmapi 186 attr auto quick 187 attr auto quick @@ -186,16 +189,26 @@ 189 mount auto quick 190 rw auto quick 191 nfs4acl auto +192 auto quick clone +193 auto quick clone 194 rw auto 195 ioctl dump auto quick 196 quota auto quick 197 dir auto quick +198 auto quick clone 199 mount auto quick +200 auto quick clone 201 metadata auto quick 202 repair auto quick 203 ioctl auto +204 auto quick clone 205 metadata rw auto 206 growfs auto quick +207 auto quick clone +208 auto quick clone +209 auto quick clone +210 auto quick clone +211 clone_stress 216 log metadata auto quick 217 log metadata auto 220 auto quota quick From darrick.wong@oracle.com Thu Feb 11 17:41:44 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=LOTS_OF_MONEY, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay1.corp.sgi.com [137.38.102.111]) by oss.sgi.com (Postfix) with ESMTP id 0887A7F84 for ; Thu, 11 Feb 2016 17:41:44 -0600 (CST) Received: from cuda.sgi.com (cuda3.sgi.com [192.48.176.15]) by relay1.corp.sgi.com (Postfix) with ESMTP id EF3E28F804B for ; Thu, 11 Feb 2016 15:41:43 -0800 (PST) X-ASG-Debug-ID: 1455234101-04cb6c1e5972f30001-NocioJ Received: from userp1040.oracle.com (userp1040.oracle.com [156.151.31.81]) by cuda.sgi.com with ESMTP id qUlFlyBaS1ue1NIa (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO) for ; Thu, 11 Feb 2016 15:41:41 -0800 (PST) X-Barracuda-Envelope-From: darrick.wong@oracle.com X-Barracuda-Apparent-Source-IP: 156.151.31.81 Received: from aserv0021.oracle.com (aserv0021.oracle.com [141.146.126.233]) by userp1040.oracle.com (Sentrion-MTA-4.3.2/Sentrion-MTA-4.3.2) with ESMTP id u1BNfbYv001206 (version=TLSv1 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Thu, 11 Feb 2016 23:41:38 GMT Received: from aserv0122.oracle.com (aserv0122.oracle.com [141.146.126.236]) by aserv0021.oracle.com (8.13.8/8.13.8) with ESMTP id u1BNfblg027985 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=FAIL); Thu, 11 Feb 2016 23:41:37 GMT Received: from abhmp0018.oracle.com (abhmp0018.oracle.com [141.146.116.24]) by aserv0122.oracle.com (8.13.8/8.13.8) with ESMTP id u1BNfbLR027411; Thu, 11 Feb 2016 23:41:37 GMT Received: from localhost (/10.145.178.207) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Thu, 11 Feb 2016 15:41:37 -0800 Subject: [PATCH 20/32] reflink: high offset reflink and dedupe tests From: "Darrick J. Wong" X-ASG-Orig-Subj: [PATCH 20/32] reflink: high offset reflink and dedupe tests To: david@fromorbit.com, darrick.wong@oracle.com Cc: linux-btrfs@vger.kernel.org, Christoph Hellwig , fstests@vger.kernel.org, xfs@oss.sgi.com Date: Thu, 11 Feb 2016 15:41:35 -0800 Message-ID: <20160211234135.2202.25346.stgit@birch.djwong.org> In-Reply-To: <20160211233916.2202.40961.stgit@birch.djwong.org> References: <20160211233916.2202.40961.stgit@birch.djwong.org> User-Agent: StGit/0.17.1-dirty MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit X-Source-IP: aserv0021.oracle.com [141.146.126.233] X-Barracuda-Connect: userp1040.oracle.com[156.151.31.81] X-Barracuda-Start-Time: 1455234101 X-Barracuda-Encrypted: ECDHE-RSA-AES256-GCM-SHA384 X-Barracuda-URL: https://192.48.176.15:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-BRTS-Status: 1 X-Barracuda-Spam-Score: 0.00 X-Barracuda-Spam-Status: No, SCORE=0.00 using per-user scores of TAG_LEVEL=1000.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.7 tests=BSF_SC0_MISMATCH_TO, UNPARSEABLE_RELAY X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.3.26959 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 0.00 BSF_SC0_MISMATCH_TO Envelope rcpt doesn't match header 0.00 UNPARSEABLE_RELAY Informational: message has unparseable relay lines Ensure that we can pass absurdly enormous offsets and lengths to reflink/dedupe and it'll survive. v2: Ask for dedupe in the dedupe test. Signed-off-by: Darrick J. Wong [hch@lst.de: call _require_test_dedupe] Signed-off-by: Christoph Hellwig --- tests/generic/303 | 98 +++++++++++++++++++++++++++++++++++++++++++++++++ tests/generic/303.out | 21 ++++++++++ tests/generic/304 | 99 +++++++++++++++++++++++++++++++++++++++++++++++++ tests/generic/304.out | 22 +++++++++++ tests/generic/group | 2 + 5 files changed, 242 insertions(+) create mode 100755 tests/generic/303 create mode 100644 tests/generic/303.out create mode 100755 tests/generic/304 create mode 100644 tests/generic/304.out diff --git a/tests/generic/303 b/tests/generic/303 new file mode 100755 index 0000000..2283b5e --- /dev/null +++ b/tests/generic/303 @@ -0,0 +1,98 @@ +#! /bin/bash +# FS QA Test No. 303 +# +# Check that high-offset reflinks work. +# +#----------------------------------------------------------------------- +# Copyright (c) 2016, Oracle and/or its affiliates. All Rights Reserved. +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License as +# published by the Free Software Foundation. +# +# This program is distributed in the hope that it would be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write the Free Software Foundation, +# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA +#----------------------------------------------------------------------- + +seq=`basename $0` +seqres=$RESULT_DIR/$seq +echo "QA output created by $seq" + +here=`pwd` +tmp=/tmp/$$ +status=1 # failure is the default! +trap "_cleanup; exit \$status" 0 1 2 3 15 + +_cleanup() +{ + cd / + rm -rf $tmp.* $testdir +} + +# get standard environment, filters and checks +. ./common/rc +. ./common/filter +. ./common/attr +. ./common/reflink + +# real QA test starts here +_supported_os Linux +_require_test_reflink +_require_cp_reflink + +rm -f $seqres.full + +echo "Format and mount" +testdir=$TEST_DIR/test-$seq +mkdir $testdir + +echo "Create the original files" +bigoff=9223372036854775806 +len=9223372036854775807 +bigoff_64k=9223372036854710272 # bigoff rounded down to 64k +$XFS_IO_PROG -f -c "truncate $len" $testdir/file0 >> $seqres.full +test -s $testdir/file0 || _notrun "High offset ftruncate failed" +_pwrite_byte 0x61 $bigoff 1 $testdir/file1 >> $seqres.full +_pwrite_byte 0x61 1048575 1 $testdir/file2 >> $seqres.full + +echo "Reflink large single byte file" +_cp_reflink $testdir/file1 $testdir/file3 >> $seqres.full + +echo "Reflink large empty file" +_cp_reflink $testdir/file0 $testdir/file4 >> $seqres.full + +echo "Reflink past maximum file size in dest file (should fail)" +_reflink_range $testdir/file1 0 $testdir/file5 4611686018427322368 $len >> $seqres.full + +echo "Reflink high offset to low offset" +_reflink_range $testdir/file1 $bigoff_64k $testdir/file6 1048576 65535 >> $seqres.full + +echo "Reflink past source file EOF (should fail)" +_reflink_range $testdir/file2 524288 $testdir/file7 0 1048576 >> $seqres.full + +echo "Reflink max size at nonzero offset (should fail)" +_reflink_range $testdir/file2 524288 $testdir/file8 0 $len >> $seqres.full + +echo "Reflink with huge off/len (should fail)" +_reflink_range $testdir/file2 $bigoff_64k $testdir/file9 0 $bigoff_64k >> $seqres.full + +echo "Check file creation" +_test_remount +echo "file3" +$XFS_IO_PROG -c "pread -v -q $bigoff 1" $testdir/file3 +echo "file4" +$XFS_IO_PROG -c "pread -v -q $bigoff 1" $testdir/file4 +# file5 should fail above +echo "file6" +$XFS_IO_PROG -c "pread -v -q 1114110 1" $testdir/file6 +# file7 should fail above + +# success, all done +status=0 +exit diff --git a/tests/generic/303.out b/tests/generic/303.out new file mode 100644 index 0000000..39a8803 --- /dev/null +++ b/tests/generic/303.out @@ -0,0 +1,21 @@ +QA output created by 303 +Format and mount +Create the original files +Reflink large single byte file +Reflink large empty file +Reflink past maximum file size in dest file (should fail) +XFS_IOC_CLONE_RANGE: Invalid argument +Reflink high offset to low offset +Reflink past source file EOF (should fail) +XFS_IOC_CLONE_RANGE: Invalid argument +Reflink max size at nonzero offset (should fail) +XFS_IOC_CLONE_RANGE: Invalid argument +Reflink with huge off/len (should fail) +XFS_IOC_CLONE_RANGE: Invalid argument +Check file creation +file3 +7ffffffffffffffe: 61 a +file4 +7ffffffffffffffe: 00 . +file6 +0010fffe: 61 a diff --git a/tests/generic/304 b/tests/generic/304 new file mode 100755 index 0000000..e50fc2a --- /dev/null +++ b/tests/generic/304 @@ -0,0 +1,99 @@ +#! /bin/bash +# FS QA Test No. 304 +# +# Check that high-offset dedupes work. +# +#----------------------------------------------------------------------- +# Copyright (c) 2016, Oracle and/or its affiliates. All Rights Reserved. +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License as +# published by the Free Software Foundation. +# +# This program is distributed in the hope that it would be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write the Free Software Foundation, +# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA +#----------------------------------------------------------------------- + +seq=`basename $0` +seqres=$RESULT_DIR/$seq +echo "QA output created by $seq" + +here=`pwd` +tmp=/tmp/$$ +status=1 # failure is the default! +trap "_cleanup; exit \$status" 0 1 2 3 15 + +_cleanup() +{ + cd / + rm -rf $tmp.* $testdir +} + +# get standard environment, filters and checks +. ./common/rc +. ./common/filter +. ./common/attr +. ./common/reflink + +# real QA test starts here +_supported_os Linux +_require_test_dedupe +_require_cp_reflink + +rm -f $seqres.full + +echo "Format and mount" +testdir=$TEST_DIR/test-$seq +mkdir $testdir + +echo "Create the original files" +bigoff=9223372036854775806 +len=9223372036854775807 +bigoff_64k=9223372036854710272 # bigoff rounded down to 64k +$XFS_IO_PROG -f -c "truncate $len" $testdir/file0 >> $seqres.full +test -s $testdir/file0 || _notrun "High offset ftruncate failed" +_pwrite_byte 0x61 $bigoff 1 $testdir/file1 >> $seqres.full +_pwrite_byte 0x61 $bigoff 1 $testdir/file3 >> $seqres.full +_pwrite_byte 0x61 1048575 1 $testdir/file2 >> $seqres.full + +echo "Dedupe large single byte file" +_dedupe_range $testdir/file1 0 $testdir/file3 0 $len >> $seqres.full + +echo "Dedupe large empty file" +_dedupe_range $testdir/file0 0 $testdir/file4 0 $len >> $seqres.full + +echo "Dedupe past maximum file size in dest file (should fail)" +_dedupe_range $testdir/file1 0 $testdir/file5 4611686018427322368 $len >> $seqres.full + +echo "Dedupe high offset to low offset" +_dedupe_range $testdir/file1 $bigoff_64k $testdir/file6 1048576 65535 >> $seqres.full + +echo "Dedupe past source file EOF (should fail)" +_dedupe_range $testdir/file2 524288 $testdir/file7 0 1048576 >> $seqres.full + +echo "Dedupe max size at nonzero offset (should fail)" +_dedupe_range $testdir/file2 524288 $testdir/file8 0 $len >> $seqres.full + +echo "Dedupe with huge off/len (should fail)" +_dedupe_range $testdir/file2 $bigoff_64k $testdir/file9 0 $bigoff_64k >> $seqres.full + +echo "Check file creation" +_test_remount +echo "file3" +$XFS_IO_PROG -c "pread -v -q $bigoff 1" $testdir/file3 +echo "file4" +$XFS_IO_PROG -c "pread -v -q $bigoff 1" $testdir/file4 +# file5 should fail above +echo "file6" +$XFS_IO_PROG -c "pread -v -q 1114110 1" $testdir/file6 +# file7 should fail above + +# success, all done +status=0 +exit diff --git a/tests/generic/304.out b/tests/generic/304.out new file mode 100644 index 0000000..4af2a39 --- /dev/null +++ b/tests/generic/304.out @@ -0,0 +1,22 @@ +QA output created by 304 +Format and mount +Create the original files +Dedupe large single byte file +dedupe: Invalid argument +Dedupe large empty file +dedupe: Invalid argument +Dedupe past maximum file size in dest file (should fail) +dedupe: Invalid argument +Dedupe high offset to low offset +dedupe: Extents did not match. +Dedupe past source file EOF (should fail) +dedupe: Invalid argument +Dedupe max size at nonzero offset (should fail) +dedupe: Invalid argument +Dedupe with huge off/len (should fail) +XFS_IOC_FILE_EXTENT_SAME: Invalid argument +Check file creation +file3 +7ffffffffffffffe: 61 a +file4 +file6 diff --git a/tests/generic/group b/tests/generic/group index 7edc963..4a1cce4 100644 --- a/tests/generic/group +++ b/tests/generic/group @@ -305,6 +305,8 @@ 300 auto aio enospc preallocrw stress 301 auto quick clone 302 auto quick clone +303 auto quick clone +304 auto quick clone 306 auto quick rw 307 auto quick 308 auto quick From darrick.wong@oracle.com Thu Feb 11 17:41:48 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay3.corp.sgi.com [198.149.34.15]) by oss.sgi.com (Postfix) with ESMTP id A09577F84 for ; Thu, 11 Feb 2016 17:41:48 -0600 (CST) Received: from cuda.sgi.com (cuda2.sgi.com [192.48.176.25]) by relay3.corp.sgi.com (Postfix) with ESMTP id 2C773AC002 for ; Thu, 11 Feb 2016 15:41:48 -0800 (PST) X-ASG-Debug-ID: 1455234105-04cbb043338a080001-NocioJ Received: from aserp1040.oracle.com (aserp1040.oracle.com [141.146.126.69]) by cuda.sgi.com with ESMTP id 4mC6Atf3fKo6T1Qb (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO) for ; Thu, 11 Feb 2016 15:41:45 -0800 (PST) X-Barracuda-Envelope-From: darrick.wong@oracle.com X-Barracuda-Apparent-Source-IP: 141.146.126.69 Received: from userv0022.oracle.com (userv0022.oracle.com [156.151.31.74]) by aserp1040.oracle.com (Sentrion-MTA-4.3.2/Sentrion-MTA-4.3.2) with ESMTP id u1BNfiHp024535 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 11 Feb 2016 23:41:44 GMT Received: from aserv0122.oracle.com (aserv0122.oracle.com [141.146.126.236]) by userv0022.oracle.com (8.14.4/8.13.8) with ESMTP id u1BNfhet027244 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=FAIL); Thu, 11 Feb 2016 23:41:44 GMT Received: from abhmp0005.oracle.com (abhmp0005.oracle.com [141.146.116.11]) by aserv0122.oracle.com (8.13.8/8.13.8) with ESMTP id u1BNfhK2027448; Thu, 11 Feb 2016 23:41:43 GMT Received: from localhost (/10.145.178.207) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Thu, 11 Feb 2016 15:41:43 -0800 Subject: [PATCH 21/32] reflink: test xfs cow behavior when the filesystem crashes From: "Darrick J. Wong" X-ASG-Orig-Subj: [PATCH 21/32] reflink: test xfs cow behavior when the filesystem crashes To: david@fromorbit.com, darrick.wong@oracle.com Cc: linux-btrfs@vger.kernel.org, fstests@vger.kernel.org, xfs@oss.sgi.com Date: Thu, 11 Feb 2016 15:41:42 -0800 Message-ID: <20160211234142.2202.57779.stgit@birch.djwong.org> In-Reply-To: <20160211233916.2202.40961.stgit@birch.djwong.org> References: <20160211233916.2202.40961.stgit@birch.djwong.org> User-Agent: StGit/0.17.1-dirty MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit X-Source-IP: userv0022.oracle.com [156.151.31.74] X-Barracuda-Connect: aserp1040.oracle.com[141.146.126.69] X-Barracuda-Start-Time: 1455234105 X-Barracuda-Encrypted: ECDHE-RSA-AES256-GCM-SHA384 X-Barracuda-URL: https://192.48.176.25:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-BRTS-Status: 1 X-Barracuda-Spam-Score: 0.00 X-Barracuda-Spam-Status: No, SCORE=0.00 using per-user scores of TAG_LEVEL=1000.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.7 tests=BSF_SC0_MISMATCH_TO, UNPARSEABLE_RELAY X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.3.26959 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 0.00 BSF_SC0_MISMATCH_TO Envelope rcpt doesn't match header 0.00 UNPARSEABLE_RELAY Informational: message has unparseable relay lines Use the extent size hint to force leftover CoW reservations then crash the filesystem to see how recovery works. Signed-off-by: Darrick J. Wong --- tests/xfs/212 | 99 +++++++++++++++++++++++++++++++++++++++++++++++++++++ tests/xfs/212.out | 13 +++++++ tests/xfs/group | 1 + 3 files changed, 113 insertions(+) create mode 100755 tests/xfs/212 create mode 100644 tests/xfs/212.out diff --git a/tests/xfs/212 b/tests/xfs/212 new file mode 100755 index 0000000..4e3bcd4 --- /dev/null +++ b/tests/xfs/212 @@ -0,0 +1,99 @@ +#! /bin/bash +# FS QA Test No. 212 +# +# Test recovery of "lost" CoW blocks after a crash: +# - Create two reflinked files. Set extsz hint on second file. +# - Dirty one byte on the second file and fsync. +# - Crash the FS to test recovery. +# +#----------------------------------------------------------------------- +# Copyright (c) 2016, Oracle and/or its affiliates. All Rights Reserved. +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License as +# published by the Free Software Foundation. +# +# This program is distributed in the hope that it would be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write the Free Software Foundation, +# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA +#----------------------------------------------------------------------- + +seq=`basename $0` +seqres=$RESULT_DIR/$seq +echo "QA output created by $seq" + +here=`pwd` +tmp=/tmp/$$ +status=1 # failure is the default! +trap "_cleanup; exit \$status" 0 1 2 3 15 + +_cleanup() +{ + cd / + rm -rf $tmp.* +} + +# get standard environment, filters and checks +. ./common/rc +. ./common/filter +. ./common/reflink + +# real QA test starts here +_supported_os Linux +_supported_fs xfs +_require_scratch_reflink +_require_cp_reflink +_require_fiemap + +rm -f $seqres.full + +echo "Format and mount" +_scratch_mkfs > $seqres.full 2>&1 +_scratch_mount >> $seqres.full 2>&1 + +testdir=$SCRATCH_MNT/test-$seq +mkdir $testdir + +blksz=65536 +nr=16 +filesize=$((blksz * nr)) +bufnr=2 +bufsize=$((blksz * bufnr)) + +_require_fs_space $SCRATCH_MNT $((filesize / 1024 * 3 * 5 / 4)) + +echo "Create the original files" +$XFS_IO_PROG -f -c "pwrite -S 0x61 -b $bufsize 0 $filesize" $testdir/file1 >> $seqres.full +$XFS_IO_PROG -f -c "pwrite -S 0x61 -b $bufsize 0 $filesize" $testdir/file2.chk >> $seqres.full +$XFS_IO_PROG -f -c "extsize $bufsize" $testdir/file2 +_cp_reflink $testdir/file1 $testdir/file2 >> $seqres.full +_scratch_remount + +echo "Compare files" +md5sum $testdir/file1 | _filter_scratch +md5sum $testdir/file2 | _filter_scratch +md5sum $testdir/file2.chk | _filter_scratch + +echo "CoW and leave leftovers" +$XFS_IO_PROG -f -c "extsize" $testdir/file2 >> $seqres.full +$XFS_IO_PROG -f -c "pwrite -S 0x63 $((filesize - 1)) 1" -c "fsync" $testdir/file2 >> $seqres.full +$XFS_IO_PROG -f -c "pwrite -S 0x63 $((filesize - 1)) 1" -c "fsync" $testdir/file2.chk >> $seqres.full +sync + +echo "Crash and recover" +$XFS_IO_PROG -x -c "shutdown" $testdir/file2 >> $seqres.full +_scratch_remount + +echo "Compare files" +md5sum $testdir/file1 | _filter_scratch +md5sum $testdir/file2 | _filter_scratch +md5sum $testdir/file2.chk | _filter_scratch + +# success, all done +status=0 +exit diff --git a/tests/xfs/212.out b/tests/xfs/212.out new file mode 100644 index 0000000..97e8425 --- /dev/null +++ b/tests/xfs/212.out @@ -0,0 +1,13 @@ +QA output created by 212 +Format and mount +Create the original files +Compare files +7202826a7791073fe2787f0c94603278 SCRATCH_MNT/test-212/file1 +7202826a7791073fe2787f0c94603278 SCRATCH_MNT/test-212/file2 +7202826a7791073fe2787f0c94603278 SCRATCH_MNT/test-212/file2.chk +CoW and leave leftovers +Crash and recover +Compare files +7202826a7791073fe2787f0c94603278 SCRATCH_MNT/test-212/file1 +83feff041c88d5c746837552399dc27d SCRATCH_MNT/test-212/file2 +83feff041c88d5c746837552399dc27d SCRATCH_MNT/test-212/file2.chk diff --git a/tests/xfs/group b/tests/xfs/group index 119e1fd..d4a0d59 100644 --- a/tests/xfs/group +++ b/tests/xfs/group @@ -209,6 +209,7 @@ 209 auto quick clone 210 auto quick clone 211 clone_stress +212 auto quick clone 216 log metadata auto quick 217 log metadata auto 220 auto quota quick From darrick.wong@oracle.com Thu Feb 11 17:41:57 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=LOTS_OF_MONEY, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay2.corp.sgi.com [137.38.102.29]) by oss.sgi.com (Postfix) with ESMTP id 970E97FA3 for ; Thu, 11 Feb 2016 17:41:57 -0600 (CST) Received: from cuda.sgi.com (cuda1.sgi.com [192.48.157.11]) by relay2.corp.sgi.com (Postfix) with ESMTP id 5CC6C304051 for ; Thu, 11 Feb 2016 15:41:57 -0800 (PST) X-ASG-Debug-ID: 1455234112-04bdf066ea73940001-NocioJ Received: from aserp1040.oracle.com (aserp1040.oracle.com [141.146.126.69]) by cuda.sgi.com with ESMTP id CQsJ8vTXK6bA25sy (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO) for ; Thu, 11 Feb 2016 15:41:52 -0800 (PST) X-Barracuda-Envelope-From: darrick.wong@oracle.com X-Barracuda-Apparent-Source-IP: 141.146.126.69 Received: from userv0021.oracle.com (userv0021.oracle.com [156.151.31.71]) by aserp1040.oracle.com (Sentrion-MTA-4.3.2/Sentrion-MTA-4.3.2) with ESMTP id u1BNfpa8024594 (version=TLSv1 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Thu, 11 Feb 2016 23:41:51 GMT Received: from userv0121.oracle.com (userv0121.oracle.com [156.151.31.72]) by userv0021.oracle.com (8.13.8/8.13.8) with ESMTP id u1BNfplp015746 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=FAIL); Thu, 11 Feb 2016 23:41:51 GMT Received: from abhmp0015.oracle.com (abhmp0015.oracle.com [141.146.116.21]) by userv0121.oracle.com (8.13.8/8.13.8) with ESMTP id u1BNfoDl006872; Thu, 11 Feb 2016 23:41:50 GMT Received: from localhost (/10.145.178.207) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Thu, 11 Feb 2016 15:41:49 -0800 Subject: [PATCH 22/32] reflink: test quota accounting From: "Darrick J. Wong" X-ASG-Orig-Subj: [PATCH 22/32] reflink: test quota accounting To: david@fromorbit.com, darrick.wong@oracle.com Cc: linux-btrfs@vger.kernel.org, fstests@vger.kernel.org, xfs@oss.sgi.com Date: Thu, 11 Feb 2016 15:41:48 -0800 Message-ID: <20160211234148.2202.94396.stgit@birch.djwong.org> In-Reply-To: <20160211233916.2202.40961.stgit@birch.djwong.org> References: <20160211233916.2202.40961.stgit@birch.djwong.org> User-Agent: StGit/0.17.1-dirty MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit X-Source-IP: userv0021.oracle.com [156.151.31.71] X-Barracuda-Connect: aserp1040.oracle.com[141.146.126.69] X-Barracuda-Start-Time: 1455234112 X-Barracuda-Encrypted: ECDHE-RSA-AES256-GCM-SHA384 X-Barracuda-URL: https://192.48.157.11:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-BRTS-Status: 1 X-Barracuda-Spam-Score: 0.00 X-Barracuda-Spam-Status: No, SCORE=0.00 using per-user scores of TAG_LEVEL=1000.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.7 tests=BSF_SC0_MISMATCH_TO, UNPARSEABLE_RELAY X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.3.26959 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 0.00 BSF_SC0_MISMATCH_TO Envelope rcpt doesn't match header 0.00 UNPARSEABLE_RELAY Informational: message has unparseable relay lines Signed-off-by: Darrick J. Wong --- common/reflink | 2 - tests/generic/305 | 100 ++++++++++++++++++++++++++++++++++++++++++++++ tests/generic/305.out | 22 ++++++++++ tests/generic/326 | 101 +++++++++++++++++++++++++++++++++++++++++++++++ tests/generic/326.out | 22 ++++++++++ tests/generic/327 | 87 ++++++++++++++++++++++++++++++++++++++++ tests/generic/327.out | 12 ++++++ tests/generic/328 | 105 +++++++++++++++++++++++++++++++++++++++++++++++++ tests/generic/328.out | 25 ++++++++++++ tests/generic/group | 4 ++ tests/xfs/213 | 105 +++++++++++++++++++++++++++++++++++++++++++++++++ tests/xfs/213.out | 22 ++++++++++ tests/xfs/214 | 106 +++++++++++++++++++++++++++++++++++++++++++++++++ tests/xfs/214.out | 22 ++++++++++ tests/xfs/group | 2 + 15 files changed, 736 insertions(+), 1 deletion(-) create mode 100755 tests/generic/305 create mode 100644 tests/generic/305.out create mode 100755 tests/generic/326 create mode 100644 tests/generic/326.out create mode 100755 tests/generic/327 create mode 100644 tests/generic/327.out create mode 100755 tests/generic/328 create mode 100644 tests/generic/328.out create mode 100755 tests/xfs/213 create mode 100644 tests/xfs/213.out create mode 100755 tests/xfs/214 create mode 100644 tests/xfs/214.out diff --git a/common/reflink b/common/reflink index 5d92a88..4ec390d 100644 --- a/common/reflink +++ b/common/reflink @@ -153,7 +153,7 @@ _cp_reflink() { file1="$1" file2="$2" - cp --reflink=always "$file1" "$file2" + cp --reflink=always -p "$file1" "$file2" } # Reflink some file1 into file2 diff --git a/tests/generic/305 b/tests/generic/305 new file mode 100755 index 0000000..9356a86 --- /dev/null +++ b/tests/generic/305 @@ -0,0 +1,100 @@ +#! /bin/bash +# FS QA Test No. 305 +# +# Ensure that quota charges us for reflinking a file and that we're not +# charged for buffered copy on write. +# +#----------------------------------------------------------------------- +# Copyright (c) 2016, Oracle and/or its affiliates. All Rights Reserved. +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License as +# published by the Free Software Foundation. +# +# This program is distributed in the hope that it would be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write the Free Software Foundation, +# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA +#----------------------------------------------------------------------- + +seq=`basename $0` +seqres=$RESULT_DIR/$seq +echo "QA output created by $seq" + +here=`pwd` +tmp=/tmp/$$ +status=1 # failure is the default! +trap "_cleanup; exit \$status" 0 1 2 3 15 + +_cleanup() +{ + cd / + rm -rf $tmp.* +} + +# get standard environment, filters and checks +. ./common/rc +. ./common/filter +. ./common/reflink +. ./common/quota + +# real QA test starts here +_supported_os Linux +_require_scratch_reflink +_require_cp_reflink +_require_fiemap +_require_quota +_require_nobody + +_repquota() { + repquota $SCRATCH_MNT | egrep '^(fsgqa|root|nobody)' +} +rm -f $seqres.full + +echo "Format and mount" +_scratch_mkfs > $seqres.full 2>&1 +export MOUNT_OPTIONS="-o usrquota,grpquota $MOUNT_OPTIONS" +_scratch_mount >> $seqres.full 2>&1 +quotacheck -u -g $SCRATCH_MNT 2> /dev/null +quotaon $SCRATCH_MNT 2> /dev/null + +testdir=$SCRATCH_MNT/test-$seq +mkdir $testdir + +sz=1048576 +echo "Create the original files" +$XFS_IO_PROG -f -c "pwrite -S 0x61 -b $sz 0 $sz" $testdir/file1 >> $seqres.full +_cp_reflink $testdir/file1 $testdir/file2 >> $seqres.full +_cp_reflink $testdir/file1 $testdir/file3 >> $seqres.full +touch $testdir/urk +chown nobody $testdir/urk +touch $testdir/erk +chown fsgqa $testdir/erk +_repquota +_scratch_remount + +echo "Change file ownership" +chown fsgqa $testdir/file1 +chown fsgqa $testdir/file2 +chown fsgqa $testdir/file3 +_repquota + +echo "CoW one of the files" +$XFS_IO_PROG -f -c "pwrite -S 0x63 -b $((sz/2)) 0 $((sz/2))" -c "fsync" $testdir/file2 >> $seqres.full +_repquota + +echo "Remount the FS to see if accounting changes" +_scratch_remount +_repquota + +echo "Chown one of the files" +chown nobody $testdir/file3 +_repquota + +# success, all done +status=0 +exit diff --git a/tests/generic/305.out b/tests/generic/305.out new file mode 100644 index 0000000..0bfd620 --- /dev/null +++ b/tests/generic/305.out @@ -0,0 +1,22 @@ +QA output created by 305 +Format and mount +Create the original files +root -- 3072 0 0 7 0 0 +nobody -- 0 0 0 1 0 0 +fsgqa -- 0 0 0 1 0 0 +Change file ownership +root -- 0 0 0 4 0 0 +nobody -- 0 0 0 1 0 0 +fsgqa -- 3072 0 0 4 0 0 +CoW one of the files +root -- 0 0 0 4 0 0 +nobody -- 0 0 0 1 0 0 +fsgqa -- 3072 0 0 4 0 0 +Remount the FS to see if accounting changes +root -- 0 0 0 4 0 0 +nobody -- 0 0 0 1 0 0 +fsgqa -- 3072 0 0 4 0 0 +Chown one of the files +root -- 0 0 0 4 0 0 +nobody -- 1024 0 0 2 0 0 +fsgqa -- 2048 0 0 3 0 0 diff --git a/tests/generic/326 b/tests/generic/326 new file mode 100755 index 0000000..b6c748c --- /dev/null +++ b/tests/generic/326 @@ -0,0 +1,101 @@ +#! /bin/bash +# FS QA Test No. 326 +# +# Ensure that quota charges us for reflinking a file and that we're not +# charged for directio copy on write. +# +#----------------------------------------------------------------------- +# Copyright (c) 2016, Oracle and/or its affiliates. All Rights Reserved. +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License as +# published by the Free Software Foundation. +# +# This program is distributed in the hope that it would be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write the Free Software Foundation, +# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA +#----------------------------------------------------------------------- + +seq=`basename $0` +seqres=$RESULT_DIR/$seq +echo "QA output created by $seq" + +here=`pwd` +tmp=/tmp/$$ +status=1 # failure is the default! +trap "_cleanup; exit \$status" 0 1 2 3 15 + +_cleanup() +{ + cd / + rm -rf $tmp.* +} + +# get standard environment, filters and checks +. ./common/rc +. ./common/filter +. ./common/reflink +. ./common/quota + +# real QA test starts here +_supported_os Linux +_require_scratch_reflink +_require_cp_reflink +_require_fiemap +_require_quota +_require_nobody +_require_odirect + +_repquota() { + repquota $SCRATCH_MNT | egrep '^(fsgqa|root|nobody)' +} +rm -f $seqres.full + +echo "Format and mount" +_scratch_mkfs > $seqres.full 2>&1 +export MOUNT_OPTIONS="-o usrquota,grpquota $MOUNT_OPTIONS" +_scratch_mount >> $seqres.full 2>&1 +quotacheck -u -g $SCRATCH_MNT 2> /dev/null +quotaon $SCRATCH_MNT 2> /dev/null + +testdir=$SCRATCH_MNT/test-$seq +mkdir $testdir + +sz=1048576 +echo "Create the original files" +$XFS_IO_PROG -f -c "pwrite -S 0x61 -b $sz 0 $sz" $testdir/file1 >> $seqres.full +_cp_reflink $testdir/file1 $testdir/file2 >> $seqres.full +_cp_reflink $testdir/file1 $testdir/file3 >> $seqres.full +touch $testdir/urk +chown nobody $testdir/urk +touch $testdir/erk +chown fsgqa $testdir/erk +_repquota +_scratch_remount + +echo "Change file ownership" +chown fsgqa $testdir/file1 +chown fsgqa $testdir/file2 +chown fsgqa $testdir/file3 +_repquota + +echo "CoW one of the files" +$XFS_IO_PROG -d -f -c "pwrite -S 0x63 -b $((sz/2)) 0 $((sz/2))" -c "fsync" $testdir/file2 >> $seqres.full +_repquota + +echo "Remount the FS to see if accounting changes" +_scratch_remount +_repquota + +echo "Chown one of the files" +chown nobody $testdir/file3 +_repquota + +# success, all done +status=0 +exit diff --git a/tests/generic/326.out b/tests/generic/326.out new file mode 100644 index 0000000..e771eb7 --- /dev/null +++ b/tests/generic/326.out @@ -0,0 +1,22 @@ +QA output created by 326 +Format and mount +Create the original files +root -- 3072 0 0 7 0 0 +nobody -- 0 0 0 1 0 0 +fsgqa -- 0 0 0 1 0 0 +Change file ownership +root -- 0 0 0 4 0 0 +nobody -- 0 0 0 1 0 0 +fsgqa -- 3072 0 0 4 0 0 +CoW one of the files +root -- 0 0 0 4 0 0 +nobody -- 0 0 0 1 0 0 +fsgqa -- 3072 0 0 4 0 0 +Remount the FS to see if accounting changes +root -- 0 0 0 4 0 0 +nobody -- 0 0 0 1 0 0 +fsgqa -- 3072 0 0 4 0 0 +Chown one of the files +root -- 0 0 0 4 0 0 +nobody -- 1024 0 0 2 0 0 +fsgqa -- 2048 0 0 3 0 0 diff --git a/tests/generic/327 b/tests/generic/327 new file mode 100755 index 0000000..90d2aca --- /dev/null +++ b/tests/generic/327 @@ -0,0 +1,87 @@ +#! /bin/bash +# FS QA Test No. 327 +# +# Ensure that we can't go over the hard block limit when reflinking. +# +#----------------------------------------------------------------------- +# Copyright (c) 2016, Oracle and/or its affiliates. All Rights Reserved. +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License as +# published by the Free Software Foundation. +# +# This program is distributed in the hope that it would be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write the Free Software Foundation, +# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA +#----------------------------------------------------------------------- + +seq=`basename $0` +seqres=$RESULT_DIR/$seq +echo "QA output created by $seq" + +here=`pwd` +tmp=/tmp/$$ +status=1 # failure is the default! +trap "_cleanup; exit \$status" 0 1 2 3 15 + +_cleanup() +{ + cd / + rm -rf $tmp.* +} + +# get standard environment, filters and checks +. ./common/rc +. ./common/filter +. ./common/reflink +. ./common/quota + +# real QA test starts here +_supported_os Linux +_require_scratch_reflink +_require_cp_reflink +_require_fiemap +_require_quota +_require_nobody + +_repquota() { + repquota $SCRATCH_MNT | egrep '^(fsgqa|root|nobody)' +} +rm -f $seqres.full + +echo "Format and mount" +_scratch_mkfs > $seqres.full 2>&1 +export MOUNT_OPTIONS="-o usrquota,grpquota $MOUNT_OPTIONS" +_scratch_mount >> $seqres.full 2>&1 +quotacheck -u -g $SCRATCH_MNT 2> /dev/null +quotaon $SCRATCH_MNT 2> /dev/null + +testdir=$SCRATCH_MNT/test-$seq +mkdir $testdir + +sz=1048576 +echo "Create the original files" +$XFS_IO_PROG -f -c "pwrite -S 0x61 -b $sz 0 $sz" $testdir/file1 >> $seqres.full +chown fsgqa $testdir/file1 +_cp_reflink $testdir/file1 $testdir/file2 >> $seqres.full +_repquota +_scratch_remount + +echo "Set hard quota to prevent third reflink" +setquota -u fsgqa 0 1024 0 0 $SCRATCH_MNT +_repquota + +echo "Try to reflink again" +touch $testdir/file3 +chown fsgqa $testdir/file3 +_cp_reflink $testdir/file1 $testdir/file3 2>&1 | _filter_scratch +_repquota + +# success, all done +status=0 +exit diff --git a/tests/generic/327.out b/tests/generic/327.out new file mode 100644 index 0000000..7160ff2 --- /dev/null +++ b/tests/generic/327.out @@ -0,0 +1,12 @@ +QA output created by 327 +Format and mount +Create the original files +root -- 0 0 0 4 0 0 +fsgqa -- 2048 0 0 2 0 0 +Set hard quota to prevent third reflink +root -- 0 0 0 4 0 0 +fsgqa +- 2048 0 1024 2 0 0 +Try to reflink again +cp: failed to clone 'SCRATCH_MNT/test-327/file3' from 'SCRATCH_MNT/test-327/file1': Disk quota exceeded +root -- 0 0 0 4 0 0 +fsgqa +- 2048 0 1024 3 0 0 diff --git a/tests/generic/328 b/tests/generic/328 new file mode 100755 index 0000000..46cfa66 --- /dev/null +++ b/tests/generic/328 @@ -0,0 +1,105 @@ +#! /bin/bash +# FS QA Test No. 328 +# +# Ensure that we can't go over the hard block limit when CoWing a file. +# +#----------------------------------------------------------------------- +# Copyright (c) 2016, Oracle and/or its affiliates. All Rights Reserved. +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License as +# published by the Free Software Foundation. +# +# This program is distributed in the hope that it would be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write the Free Software Foundation, +# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA +#----------------------------------------------------------------------- + +seq=`basename $0` +seqres=$RESULT_DIR/$seq +echo "QA output created by $seq" + +here=`pwd` +tmp=/tmp/$$ +status=1 # failure is the default! +trap "_cleanup; exit \$status" 0 1 2 3 15 + +_cleanup() +{ + cd / + rm -rf $tmp.* +} + +# get standard environment, filters and checks +. ./common/rc +. ./common/filter +. ./common/reflink +. ./common/quota + +# real QA test starts here +_supported_os Linux +_require_scratch_reflink +_require_cp_reflink +_require_fiemap +_require_quota +_require_nobody +_require_odirect + +_repquota() { + repquota $SCRATCH_MNT | egrep '^(fsgqa|root|nobody)' +} +rm -f $seqres.full + +echo "Format and mount" +_scratch_mkfs > $seqres.full 2>&1 +export MOUNT_OPTIONS="-o usrquota,grpquota $MOUNT_OPTIONS" +_scratch_mount >> $seqres.full 2>&1 +quotacheck -u -g $SCRATCH_MNT 2> /dev/null +quotaon $SCRATCH_MNT 2> /dev/null + +testdir=$SCRATCH_MNT/test-$seq +mkdir $testdir + +sz=1048576 +echo "Create the original files" +$XFS_IO_PROG -f -c "pwrite -S 0x61 -b $sz 0 $sz" $testdir/file1 >> $seqres.full +chown fsgqa $testdir/file1 +_cp_reflink $testdir/file1 $testdir/file2 >> $seqres.full +_cp_reflink $testdir/file1 $testdir/file3 >> $seqres.full +_repquota +_scratch_remount + +echo "Set hard quota to prevent rewrite" +setquota -u fsgqa 0 1024 0 0 $SCRATCH_MNT +_repquota + +echo "Try to dio write the whole file" +_pwrite_byte 0x62 0 $sz $testdir/file1 -d >> $seqres.full +_repquota + +echo "Try to write the whole file" +_pwrite_byte 0x62 0 $sz $testdir/file1 >> $seqres.full +_repquota + +echo "Set hard quota to allow rewrite" +setquota -u fsgqa 0 8192 0 0 $SCRATCH_MNT +_repquota + +echo "Try to dio write the whole file" +_pwrite_byte 0x62 0 $sz $testdir/file1 -d >> $seqres.full +sync +_repquota + +echo "Try to write the whole file" +_pwrite_byte 0x62 0 $sz $testdir/file3 >> $seqres.full +sync +_repquota + +# success, all done +status=0 +exit diff --git a/tests/generic/328.out b/tests/generic/328.out new file mode 100644 index 0000000..5e99255 --- /dev/null +++ b/tests/generic/328.out @@ -0,0 +1,25 @@ +QA output created by 328 +Format and mount +Create the original files +root -- 0 0 0 4 0 0 +fsgqa -- 3072 0 0 3 0 0 +Set hard quota to prevent rewrite +root -- 0 0 0 4 0 0 +fsgqa +- 3072 0 1024 3 0 0 +Try to dio write the whole file +pwrite64: Disk quota exceeded +root -- 0 0 0 4 0 0 +fsgqa +- 3072 0 1024 3 0 0 +Try to write the whole file +pwrite64: Disk quota exceeded +root -- 0 0 0 4 0 0 +fsgqa +- 3072 0 1024 3 0 0 +Set hard quota to allow rewrite +root -- 0 0 0 4 0 0 +fsgqa -- 3072 0 8192 3 0 0 +Try to dio write the whole file +root -- 0 0 0 4 0 0 +fsgqa -- 3072 0 8192 3 0 0 +Try to write the whole file +root -- 0 0 0 4 0 0 +fsgqa -- 3072 0 8192 3 0 0 diff --git a/tests/generic/group b/tests/generic/group index 4a1cce4..8b9e0e5 100644 --- a/tests/generic/group +++ b/tests/generic/group @@ -307,6 +307,7 @@ 302 auto quick clone 303 auto quick clone 304 auto quick clone +305 auto quick clone 306 auto quick rw 307 auto quick 308 auto quick @@ -327,3 +328,6 @@ 323 auto aio stress 324 auto fsr quick 325 auto quick data log +326 auto quick clone +327 auto quick clone +328 auto quick clone diff --git a/tests/xfs/213 b/tests/xfs/213 new file mode 100755 index 0000000..2450097 --- /dev/null +++ b/tests/xfs/213 @@ -0,0 +1,105 @@ +#! /bin/bash +# FS QA Test No. 213 +# +# Ensure that quota charges us for reflnking a file and that we're not +# charged for buffered copy on write. Same test as g/305, but we get to +# play with cowextsz. +# +#----------------------------------------------------------------------- +# Copyright (c) 2016, Oracle and/or its affiliates. All Rights Reserved. +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License as +# published by the Free Software Foundation. +# +# This program is distributed in the hope that it would be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write the Free Software Foundation, +# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA +#----------------------------------------------------------------------- + +seq=`basename $0` +seqres=$RESULT_DIR/$seq +echo "QA output created by $seq" + +here=`pwd` +tmp=/tmp/$$ +status=1 # failure is the default! +trap "_cleanup; exit \$status" 0 1 2 3 15 + +_cleanup() +{ + cd / + rm -rf $tmp.* +} + +# get standard environment, filters and checks +. ./common/rc +. ./common/filter +. ./common/reflink +. ./common/quota + +# real QA test starts here +_supported_os Linux +_supported_fs xfs +_require_scratch_reflink +_require_cp_reflink +_require_fiemap +_require_quota +_require_nobody +_require_xfs_io_command "cowextsize" + +_repquota() { + repquota $SCRATCH_MNT | egrep '^(fsgqa|root|nobody)' +} +rm -f $seqres.full + +echo "Format and mount" +_scratch_mkfs > $seqres.full 2>&1 +export MOUNT_OPTIONS="-o usrquota,grpquota $MOUNT_OPTIONS" +_scratch_mount >> $seqres.full 2>&1 +quotacheck -u -g $SCRATCH_MNT 2> /dev/null +quotaon $SCRATCH_MNT 2> /dev/null + +testdir=$SCRATCH_MNT/test-$seq +mkdir $testdir + +sz=1048576 +blksz=65536 +echo "Create the original files" +$XFS_IO_PROG -c "cowextsize $((sz/2))" $testdir >> $seqres.full +$XFS_IO_PROG -f -c "pwrite -S 0x61 -b $sz 0 $sz" $testdir/file1 >> $seqres.full +_cp_reflink $testdir/file1 $testdir/file2 >> $seqres.full +_cp_reflink $testdir/file1 $testdir/file3 >> $seqres.full +touch $testdir/urk +chown nobody $testdir/urk +touch $testdir/erk +chown fsgqa $testdir/erk +_repquota +_scratch_remount + +echo "Change file ownership" +chown fsgqa $testdir/file1 +chown fsgqa $testdir/file2 +chown fsgqa $testdir/file3 +_repquota + +echo "CoW one of the files" +$XFS_IO_PROG -f -c "pwrite -S 0x63 -b $blksz $((sz - blksz)) $blksz" -c "fsync" $testdir/file2 >> $seqres.full +_repquota + +echo "Remount the FS to see if accounting changes" +_scratch_remount +_repquota + +echo "Chown one of the files" +chown nobody $testdir/file3 +_repquota + +# success, all done +status=0 +exit diff --git a/tests/xfs/213.out b/tests/xfs/213.out new file mode 100644 index 0000000..be8d56c --- /dev/null +++ b/tests/xfs/213.out @@ -0,0 +1,22 @@ +QA output created by 213 +Format and mount +Create the original files +root -- 3072 0 0 7 0 0 +nobody -- 0 0 0 1 0 0 +fsgqa -- 0 0 0 1 0 0 +Change file ownership +root -- 0 0 0 4 0 0 +nobody -- 0 0 0 1 0 0 +fsgqa -- 3072 0 0 4 0 0 +CoW one of the files +root -- 0 0 0 4 0 0 +nobody -- 0 0 0 1 0 0 +fsgqa -- 3520 0 0 4 0 0 +Remount the FS to see if accounting changes +root -- 0 0 0 4 0 0 +nobody -- 0 0 0 1 0 0 +fsgqa -- 3072 0 0 4 0 0 +Chown one of the files +root -- 0 0 0 4 0 0 +nobody -- 1024 0 0 2 0 0 +fsgqa -- 2048 0 0 3 0 0 diff --git a/tests/xfs/214 b/tests/xfs/214 new file mode 100755 index 0000000..847f489 --- /dev/null +++ b/tests/xfs/214 @@ -0,0 +1,106 @@ +#! /bin/bash +# FS QA Test No. 214 +# +# Ensure that quota charges us for reflnking a file and that we're not +# charged for directio copy on write. Same as g/326, but we get to play +# with cowextsz. +# +#----------------------------------------------------------------------- +# Copyright (c) 2016, Oracle and/or its affiliates. All Rights Reserved. +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License as +# published by the Free Software Foundation. +# +# This program is distributed in the hope that it would be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write the Free Software Foundation, +# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA +#----------------------------------------------------------------------- + +seq=`basename $0` +seqres=$RESULT_DIR/$seq +echo "QA output created by $seq" + +here=`pwd` +tmp=/tmp/$$ +status=1 # failure is the default! +trap "_cleanup; exit \$status" 0 1 2 3 15 + +_cleanup() +{ + cd / + rm -rf $tmp.* +} + +# get standard environment, filters and checks +. ./common/rc +. ./common/filter +. ./common/reflink +. ./common/quota + +# real QA test starts here +_supported_os Linux +_supported_fs xfs +_require_scratch_reflink +_require_cp_reflink +_require_fiemap +_require_quota +_require_nobody +_require_xfs_io_command "cowextsize" +_require_odirect + +_repquota() { + repquota $SCRATCH_MNT | egrep '^(fsgqa|root|nobody)' +} +rm -f $seqres.full + +echo "Format and mount" +_scratch_mkfs > $seqres.full 2>&1 +export MOUNT_OPTIONS="-o usrquota,grpquota $MOUNT_OPTIONS" +_scratch_mount >> $seqres.full 2>&1 +quotacheck -u -g $SCRATCH_MNT 2> /dev/null +quotaon $SCRATCH_MNT 2> /dev/null + +testdir=$SCRATCH_MNT/test-$seq +mkdir $testdir + +sz=1048576 +blksz=65536 +echo "Create the original files" +$XFS_IO_PROG -c "cowextsize $((sz/2))" $testdir >> $seqres.full +$XFS_IO_PROG -f -c "pwrite -S 0x61 -b $sz 0 $sz" $testdir/file1 >> $seqres.full +_cp_reflink $testdir/file1 $testdir/file2 >> $seqres.full +_cp_reflink $testdir/file1 $testdir/file3 >> $seqres.full +touch $testdir/urk +chown nobody $testdir/urk +touch $testdir/erk +chown fsgqa $testdir/erk +_repquota +_scratch_remount + +echo "Change file ownership" +chown fsgqa $testdir/file1 +chown fsgqa $testdir/file2 +chown fsgqa $testdir/file3 +_repquota + +echo "CoW one of the files" +$XFS_IO_PROG -d -f -c "pwrite -S 0x63 -b $blksz $((sz - blksz)) $blksz" -c "fsync" $testdir/file2 >> $seqres.full +_repquota + +echo "Remount the FS to see if accounting changes" +_scratch_remount +_repquota + +echo "Chown one of the files" +chown nobody $testdir/file3 +_repquota + +# success, all done +status=0 +exit diff --git a/tests/xfs/214.out b/tests/xfs/214.out new file mode 100644 index 0000000..496a503 --- /dev/null +++ b/tests/xfs/214.out @@ -0,0 +1,22 @@ +QA output created by 214 +Format and mount +Create the original files +root -- 3072 0 0 7 0 0 +nobody -- 0 0 0 1 0 0 +fsgqa -- 0 0 0 1 0 0 +Change file ownership +root -- 0 0 0 4 0 0 +nobody -- 0 0 0 1 0 0 +fsgqa -- 3072 0 0 4 0 0 +CoW one of the files +root -- 0 0 0 4 0 0 +nobody -- 0 0 0 1 0 0 +fsgqa -- 3520 0 0 4 0 0 +Remount the FS to see if accounting changes +root -- 0 0 0 4 0 0 +nobody -- 0 0 0 1 0 0 +fsgqa -- 3072 0 0 4 0 0 +Chown one of the files +root -- 0 0 0 4 0 0 +nobody -- 1024 0 0 2 0 0 +fsgqa -- 2048 0 0 3 0 0 diff --git a/tests/xfs/group b/tests/xfs/group index d4a0d59..afd960f 100644 --- a/tests/xfs/group +++ b/tests/xfs/group @@ -210,6 +210,8 @@ 210 auto quick clone 211 clone_stress 212 auto quick clone +213 auto quick clone +214 auto quick clone 216 log metadata auto quick 217 log metadata auto 220 auto quota quick From darrick.wong@oracle.com Thu Feb 11 17:42:06 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay3.corp.sgi.com [198.149.34.15]) by oss.sgi.com (Postfix) with ESMTP id 500BC7F84 for ; Thu, 11 Feb 2016 17:42:06 -0600 (CST) Received: from cuda.sgi.com (cuda3.sgi.com [192.48.176.15]) by relay3.corp.sgi.com (Postfix) with ESMTP id A38F9AC003 for ; Thu, 11 Feb 2016 15:42:05 -0800 (PST) X-ASG-Debug-ID: 1455234119-04cb6c1e5772f40001-NocioJ Received: from aserp1040.oracle.com (aserp1040.oracle.com [141.146.126.69]) by cuda.sgi.com with ESMTP id rE06CVnDBj3Ga20h (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO) for ; Thu, 11 Feb 2016 15:41:59 -0800 (PST) X-Barracuda-Envelope-From: darrick.wong@oracle.com X-Barracuda-Apparent-Source-IP: 141.146.126.69 Received: from userv0022.oracle.com (userv0022.oracle.com [156.151.31.74]) by aserp1040.oracle.com (Sentrion-MTA-4.3.2/Sentrion-MTA-4.3.2) with ESMTP id u1BNfvPM024693 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 11 Feb 2016 23:41:58 GMT Received: from userv0121.oracle.com (userv0121.oracle.com [156.151.31.72]) by userv0022.oracle.com (8.14.4/8.13.8) with ESMTP id u1BNfvm3027995 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=FAIL); Thu, 11 Feb 2016 23:41:57 GMT Received: from abhmp0003.oracle.com (abhmp0003.oracle.com [141.146.116.9]) by userv0121.oracle.com (8.13.8/8.13.8) with ESMTP id u1BNfvcm006927; Thu, 11 Feb 2016 23:41:57 GMT Received: from localhost (/10.145.178.207) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Thu, 11 Feb 2016 15:41:56 -0800 Subject: [PATCH 23/32] reflink: test CoW across a mixed range of block types with cowextsize set From: "Darrick J. Wong" X-ASG-Orig-Subj: [PATCH 23/32] reflink: test CoW across a mixed range of block types with cowextsize set To: david@fromorbit.com, darrick.wong@oracle.com Cc: linux-btrfs@vger.kernel.org, fstests@vger.kernel.org, xfs@oss.sgi.com Date: Thu, 11 Feb 2016 15:41:55 -0800 Message-ID: <20160211234155.2202.25679.stgit@birch.djwong.org> In-Reply-To: <20160211233916.2202.40961.stgit@birch.djwong.org> References: <20160211233916.2202.40961.stgit@birch.djwong.org> User-Agent: StGit/0.17.1-dirty MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit X-Source-IP: userv0022.oracle.com [156.151.31.74] X-Barracuda-Connect: aserp1040.oracle.com[141.146.126.69] X-Barracuda-Start-Time: 1455234119 X-Barracuda-Encrypted: ECDHE-RSA-AES256-GCM-SHA384 X-Barracuda-URL: https://192.48.176.15:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-BRTS-Status: 1 X-Barracuda-Spam-Score: 0.00 X-Barracuda-Spam-Status: No, SCORE=0.00 using per-user scores of TAG_LEVEL=1000.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.7 tests=BSF_SC0_MISMATCH_TO, UNPARSEABLE_RELAY X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.3.26959 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 0.00 BSF_SC0_MISMATCH_TO Envelope rcpt doesn't match header 0.00 UNPARSEABLE_RELAY Informational: message has unparseable relay lines Signed-off-by: Darrick J. Wong --- tests/xfs/215 | 102 +++++++++++++++++++++++++++++++++++++++++++++++++ tests/xfs/215.out | 13 ++++++ tests/xfs/218 | 101 +++++++++++++++++++++++++++++++++++++++++++++++++ tests/xfs/218.out | 13 ++++++ tests/xfs/219 | 102 +++++++++++++++++++++++++++++++++++++++++++++++++ tests/xfs/219.out | 13 ++++++ tests/xfs/221 | 101 +++++++++++++++++++++++++++++++++++++++++++++++++ tests/xfs/221.out | 13 ++++++ tests/xfs/223 | 104 ++++++++++++++++++++++++++++++++++++++++++++++++++ tests/xfs/223.out | 13 ++++++ tests/xfs/224 | 103 ++++++++++++++++++++++++++++++++++++++++++++++++++ tests/xfs/224.out | 13 ++++++ tests/xfs/225 | 102 +++++++++++++++++++++++++++++++++++++++++++++++++ tests/xfs/225.out | 13 ++++++ tests/xfs/226 | 101 +++++++++++++++++++++++++++++++++++++++++++++++++ tests/xfs/226.out | 13 ++++++ tests/xfs/228 | 110 +++++++++++++++++++++++++++++++++++++++++++++++++++++ tests/xfs/228.out | 13 ++++++ tests/xfs/230 | 110 +++++++++++++++++++++++++++++++++++++++++++++++++++++ tests/xfs/230.out | 13 ++++++ tests/xfs/group | 10 +++++ 21 files changed, 1176 insertions(+) create mode 100755 tests/xfs/215 create mode 100644 tests/xfs/215.out create mode 100755 tests/xfs/218 create mode 100644 tests/xfs/218.out create mode 100755 tests/xfs/219 create mode 100644 tests/xfs/219.out create mode 100755 tests/xfs/221 create mode 100644 tests/xfs/221.out create mode 100755 tests/xfs/223 create mode 100644 tests/xfs/223.out create mode 100755 tests/xfs/224 create mode 100644 tests/xfs/224.out create mode 100755 tests/xfs/225 create mode 100644 tests/xfs/225.out create mode 100755 tests/xfs/226 create mode 100644 tests/xfs/226.out create mode 100755 tests/xfs/228 create mode 100644 tests/xfs/228.out create mode 100755 tests/xfs/230 create mode 100644 tests/xfs/230.out diff --git a/tests/xfs/215 b/tests/xfs/215 new file mode 100755 index 0000000..9ed842e --- /dev/null +++ b/tests/xfs/215 @@ -0,0 +1,102 @@ +#! /bin/bash +# FS QA Test No. 215 +# +# Ensuring that copy on write in direct-io mode works when the CoW +# range originally covers multiple extents, some unwritten, some not. +# - Set cowextsize hint. +# - Create a file and fallocate a second file. +# - Reflink the odd blocks of the first file into the second file. +# - directio CoW across the halfway mark, starting with the unwritten extent. +# - Check that the files are now different where we say they're different. +# +#----------------------------------------------------------------------- +# Copyright (c) 2016, Oracle and/or its affiliates. All Rights Reserved. +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License as +# published by the Free Software Foundation. +# +# This program is distributed in the hope that it would be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write the Free Software Foundation, +# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA +#----------------------------------------------------------------------- + +seq=`basename $0` +seqres=$RESULT_DIR/$seq +echo "QA output created by $seq" + +here=`pwd` +tmp=/tmp/$$ +status=1 # failure is the default! +trap "_cleanup; exit \$status" 0 1 2 3 15 + +_cleanup() +{ + cd / + rm -rf $tmp.* +} + +# get standard environment, filters and checks +. ./common/rc +. ./common/filter +. ./common/reflink + +# real QA test starts here +_supported_os Linux +_require_scratch_reflink +_require_xfs_io_command "falloc" +_require_odirect + +rm -f $seqres.full + +echo "Format and mount" +_scratch_mkfs > $seqres.full 2>&1 +_scratch_mount >> $seqres.full 2>&1 + +testdir=$SCRATCH_MNT/test-$seq +mkdir $testdir + +echo "Create the original files" +blksz=65536 +nr=64 +filesize=$((blksz * nr)) +real_blksz=$(stat -f -c '%S' $testdir) +internal_blks=$((filesize / real_blksz)) +$XFS_IO_PROG -c "cowextsize $((blksz * 16))" $testdir >> $seqres.full +_weave_reflink_unwritten $blksz $nr $testdir/file1 $testdir/file3 >> $seqres.full +_scratch_remount + +echo "Compare files" +md5sum $testdir/file1 | _filter_scratch +md5sum $testdir/file3 | _filter_scratch +md5sum $testdir/file3.chk | _filter_scratch + +echo "directio CoW across the transition" +cowoff=$((filesize / 4)) +cowsz=$((filesize / 2)) +$XFS_IO_PROG -d -f -c "pwrite -S 0x63 -b $cowsz $cowoff $cowsz" $testdir/file3 >> $seqres.full +_pwrite_byte 0x63 $cowoff $cowsz $testdir/file3.chk >> $seqres.full +_scratch_remount + +echo "Compare files" +md5sum $testdir/file1 | _filter_scratch +md5sum $testdir/file3 | _filter_scratch +md5sum $testdir/file3.chk | _filter_scratch + +echo "Check extent counts" +old_extents=$(_count_extents $testdir/file1) +new_extents=$(_count_extents $testdir/file3) + +echo "old extents: $old_extents" >> $seqres.full +echo "new extents: $new_extents" >> $seqres.full +echo "maximum extents: $internal_blks" >> $seqres.full +test $new_extents -lt $((internal_blks / 20)) || echo "file3 badly fragmented" + +# success, all done +status=0 +exit diff --git a/tests/xfs/215.out b/tests/xfs/215.out new file mode 100644 index 0000000..ce3a08b --- /dev/null +++ b/tests/xfs/215.out @@ -0,0 +1,13 @@ +QA output created by 215 +Format and mount +Create the original files +Compare files +bdbcf02ee0aa977795a79d25fcfdccb1 SCRATCH_MNT/test-215/file1 +fa50dba51826899c372464a153cb2117 SCRATCH_MNT/test-215/file3 +fa50dba51826899c372464a153cb2117 SCRATCH_MNT/test-215/file3.chk +directio CoW across the transition +Compare files +bdbcf02ee0aa977795a79d25fcfdccb1 SCRATCH_MNT/test-215/file1 +09101629908f9bdd5d178e7ce20bb1bb SCRATCH_MNT/test-215/file3 +09101629908f9bdd5d178e7ce20bb1bb SCRATCH_MNT/test-215/file3.chk +Check extent counts diff --git a/tests/xfs/218 b/tests/xfs/218 new file mode 100755 index 0000000..e98b14e --- /dev/null +++ b/tests/xfs/218 @@ -0,0 +1,101 @@ +#! /bin/bash +# FS QA Test No. 218 +# +# Ensuring that copy on write in buffered mode works when the CoW +# range originally covers multiple extents, some unwritten, some not. +# - Set cowextsize hint. +# - Create a file and fallocate a second file. +# - Reflink the odd blocks of the first file into the second file. +# - CoW across the halfway mark, starting with the unwritten extent. +# - Check that the files are now different where we say they're different. +# +#----------------------------------------------------------------------- +# Copyright (c) 2016, Oracle and/or its affiliates. All Rights Reserved. +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License as +# published by the Free Software Foundation. +# +# This program is distributed in the hope that it would be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write the Free Software Foundation, +# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA +#----------------------------------------------------------------------- + +seq=`basename $0` +seqres=$RESULT_DIR/$seq +echo "QA output created by $seq" + +here=`pwd` +tmp=/tmp/$$ +status=1 # failure is the default! +trap "_cleanup; exit \$status" 0 1 2 3 15 + +_cleanup() +{ + cd / + rm -rf $tmp.* +} + +# get standard environment, filters and checks +. ./common/rc +. ./common/filter +. ./common/reflink + +# real QA test starts here +_supported_os Linux +_require_scratch_reflink +_require_xfs_io_command "falloc" + +rm -f $seqres.full + +echo "Format and mount" +_scratch_mkfs > $seqres.full 2>&1 +_scratch_mount >> $seqres.full 2>&1 + +testdir=$SCRATCH_MNT/test-$seq +mkdir $testdir + +echo "Create the original files" +blksz=65536 +nr=64 +filesize=$((blksz * nr)) +real_blksz=$(stat -f -c '%S' $testdir) +internal_blks=$((filesize / real_blksz)) +$XFS_IO_PROG -c "cowextsize $((blksz * 16))" $testdir >> $seqres.full +_weave_reflink_unwritten $blksz $nr $testdir/file1 $testdir/file3 >> $seqres.full +_scratch_remount + +echo "Compare files" +md5sum $testdir/file1 | _filter_scratch +md5sum $testdir/file3 | _filter_scratch +md5sum $testdir/file3.chk | _filter_scratch + +echo "CoW across the transition" +cowoff=$((filesize / 4)) +cowsz=$((filesize / 2)) +$XFS_IO_PROG -f -c "pwrite -S 0x63 -b $cowsz $cowoff $cowsz" $testdir/file3 >> $seqres.full +_pwrite_byte 0x63 $cowoff $cowsz $testdir/file3.chk >> $seqres.full +_scratch_remount + +echo "Compare files" +md5sum $testdir/file1 | _filter_scratch +md5sum $testdir/file3 | _filter_scratch +md5sum $testdir/file3.chk | _filter_scratch + +echo "Check extent counts" +old_extents=$(_count_extents $testdir/file1) +new_extents=$(_count_extents $testdir/file3) + +echo "old extents: $old_extents" >> $seqres.full +echo "new extents: $new_extents" >> $seqres.full +echo "maximum extents: $internal_blks" >> $seqres.full +test $new_extents -lt $((internal_blks / 20)) || echo "file3 badly fragmented" + +# success, all done +status=0 +exit diff --git a/tests/xfs/218.out b/tests/xfs/218.out new file mode 100644 index 0000000..ad1efda --- /dev/null +++ b/tests/xfs/218.out @@ -0,0 +1,13 @@ +QA output created by 218 +Format and mount +Create the original files +Compare files +bdbcf02ee0aa977795a79d25fcfdccb1 SCRATCH_MNT/test-218/file1 +fa50dba51826899c372464a153cb2117 SCRATCH_MNT/test-218/file3 +fa50dba51826899c372464a153cb2117 SCRATCH_MNT/test-218/file3.chk +CoW across the transition +Compare files +bdbcf02ee0aa977795a79d25fcfdccb1 SCRATCH_MNT/test-218/file1 +09101629908f9bdd5d178e7ce20bb1bb SCRATCH_MNT/test-218/file3 +09101629908f9bdd5d178e7ce20bb1bb SCRATCH_MNT/test-218/file3.chk +Check extent counts diff --git a/tests/xfs/219 b/tests/xfs/219 new file mode 100755 index 0000000..25c0bb4 --- /dev/null +++ b/tests/xfs/219 @@ -0,0 +1,102 @@ +#! /bin/bash +# FS QA Test No. 219 +# +# Ensuring that copy on write in direct-io mode works when the CoW +# range originally covers multiple extents, some holes, some not. +# - Set cowextsize hint. +# - Create a file and truncate a second file. +# - Reflink the odd blocks of the first file into the second file. +# - directio CoW across the halfway mark, starting with the unwritten extent. +# - Check that the files are now different where we say they're different. +# +#----------------------------------------------------------------------- +# Copyright (c) 2016, Oracle and/or its affiliates. All Rights Reserved. +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License as +# published by the Free Software Foundation. +# +# This program is distributed in the hope that it would be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write the Free Software Foundation, +# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA +#----------------------------------------------------------------------- + +seq=`basename $0` +seqres=$RESULT_DIR/$seq +echo "QA output created by $seq" + +here=`pwd` +tmp=/tmp/$$ +status=1 # failure is the default! +trap "_cleanup; exit \$status" 0 1 2 3 15 + +_cleanup() +{ + cd / + rm -rf $tmp.* +} + +# get standard environment, filters and checks +. ./common/rc +. ./common/filter +. ./common/reflink + +# real QA test starts here +_supported_os Linux +_require_scratch_reflink +_require_xfs_io_command "falloc" +_require_odirect + +rm -f $seqres.full + +echo "Format and mount" +_scratch_mkfs > $seqres.full 2>&1 +_scratch_mount >> $seqres.full 2>&1 + +testdir=$SCRATCH_MNT/test-$seq +mkdir $testdir + +echo "Create the original files" +blksz=65536 +nr=64 +filesize=$((blksz * nr)) +real_blksz=$(stat -f -c '%S' $testdir) +internal_blks=$((filesize / real_blksz)) +$XFS_IO_PROG -c "cowextsize $((blksz * 16))" $testdir >> $seqres.full +_weave_reflink_holes $blksz $nr $testdir/file1 $testdir/file3 >> $seqres.full +_scratch_remount + +echo "Compare files" +md5sum $testdir/file1 | _filter_scratch +md5sum $testdir/file3 | _filter_scratch +md5sum $testdir/file3.chk | _filter_scratch + +echo "directio CoW across the transition" +cowoff=$((filesize / 4)) +cowsz=$((filesize / 2)) +$XFS_IO_PROG -d -f -c "pwrite -S 0x63 -b $cowsz $cowoff $cowsz" $testdir/file3 >> $seqres.full +_pwrite_byte 0x63 $cowoff $cowsz $testdir/file3.chk >> $seqres.full +_scratch_remount + +echo "Compare files" +md5sum $testdir/file1 | _filter_scratch +md5sum $testdir/file3 | _filter_scratch +md5sum $testdir/file3.chk | _filter_scratch + +echo "Check extent counts" +old_extents=$(_count_extents $testdir/file1) +new_extents=$(_count_extents $testdir/file3) + +echo "old extents: $old_extents" >> $seqres.full +echo "new extents: $new_extents" >> $seqres.full +echo "maximum extents: $internal_blks" >> $seqres.full +test $new_extents -lt $((internal_blks / 20)) || echo "file3 badly fragmented" + +# success, all done +status=0 +exit diff --git a/tests/xfs/219.out b/tests/xfs/219.out new file mode 100644 index 0000000..9052f1f --- /dev/null +++ b/tests/xfs/219.out @@ -0,0 +1,13 @@ +QA output created by 219 +Format and mount +Create the original files +Compare files +bdbcf02ee0aa977795a79d25fcfdccb1 SCRATCH_MNT/test-219/file1 +fa50dba51826899c372464a153cb2117 SCRATCH_MNT/test-219/file3 +fa50dba51826899c372464a153cb2117 SCRATCH_MNT/test-219/file3.chk +directio CoW across the transition +Compare files +bdbcf02ee0aa977795a79d25fcfdccb1 SCRATCH_MNT/test-219/file1 +09101629908f9bdd5d178e7ce20bb1bb SCRATCH_MNT/test-219/file3 +09101629908f9bdd5d178e7ce20bb1bb SCRATCH_MNT/test-219/file3.chk +Check extent counts diff --git a/tests/xfs/221 b/tests/xfs/221 new file mode 100755 index 0000000..dc00331 --- /dev/null +++ b/tests/xfs/221 @@ -0,0 +1,101 @@ +#! /bin/bash +# FS QA Test No. 221 +# +# Ensuring that copy on write in buffered mode works when the CoW +# range originally covers multiple extents, some holes, some not. +# - Set cowextsize hint. +# - Create a file and truncate a second file. +# - Reflink the odd blocks of the first file into the second file. +# - CoW across the halfway mark, starting with the unwritten extent. +# - Check that the files are now different where we say they're different. +# +#----------------------------------------------------------------------- +# Copyright (c) 2016, Oracle and/or its affiliates. All Rights Reserved. +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License as +# published by the Free Software Foundation. +# +# This program is distributed in the hope that it would be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write the Free Software Foundation, +# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA +#----------------------------------------------------------------------- + +seq=`basename $0` +seqres=$RESULT_DIR/$seq +echo "QA output created by $seq" + +here=`pwd` +tmp=/tmp/$$ +status=1 # failure is the default! +trap "_cleanup; exit \$status" 0 1 2 3 15 + +_cleanup() +{ + cd / + rm -rf $tmp.* +} + +# get standard environment, filters and checks +. ./common/rc +. ./common/filter +. ./common/reflink + +# real QA test starts here +_supported_os Linux +_require_scratch_reflink +_require_xfs_io_command "falloc" + +rm -f $seqres.full + +echo "Format and mount" +_scratch_mkfs > $seqres.full 2>&1 +_scratch_mount >> $seqres.full 2>&1 + +testdir=$SCRATCH_MNT/test-$seq +mkdir $testdir + +echo "Create the original files" +blksz=65536 +nr=64 +filesize=$((blksz * nr)) +real_blksz=$(stat -f -c '%S' $testdir) +internal_blks=$((filesize / real_blksz)) +$XFS_IO_PROG -c "cowextsize $((blksz * 16))" $testdir >> $seqres.full +_weave_reflink_holes $blksz $nr $testdir/file1 $testdir/file3 >> $seqres.full +_scratch_remount + +echo "Compare files" +md5sum $testdir/file1 | _filter_scratch +md5sum $testdir/file3 | _filter_scratch +md5sum $testdir/file3.chk | _filter_scratch + +echo "CoW across the transition" +cowoff=$((filesize / 4)) +cowsz=$((filesize / 2)) +$XFS_IO_PROG -f -c "pwrite -S 0x63 -b $cowsz $cowoff $cowsz" $testdir/file3 >> $seqres.full +_pwrite_byte 0x63 $cowoff $cowsz $testdir/file3.chk >> $seqres.full +_scratch_remount + +echo "Compare files" +md5sum $testdir/file1 | _filter_scratch +md5sum $testdir/file3 | _filter_scratch +md5sum $testdir/file3.chk | _filter_scratch + +echo "Check extent counts" +old_extents=$(_count_extents $testdir/file1) +new_extents=$(_count_extents $testdir/file3) + +echo "old extents: $old_extents" >> $seqres.full +echo "new extents: $new_extents" >> $seqres.full +echo "maximum extents: $internal_blks" >> $seqres.full +test $new_extents -lt $((internal_blks / 20)) || echo "file3 badly fragmented" + +# success, all done +status=0 +exit diff --git a/tests/xfs/221.out b/tests/xfs/221.out new file mode 100644 index 0000000..63963ec --- /dev/null +++ b/tests/xfs/221.out @@ -0,0 +1,13 @@ +QA output created by 221 +Format and mount +Create the original files +Compare files +bdbcf02ee0aa977795a79d25fcfdccb1 SCRATCH_MNT/test-221/file1 +fa50dba51826899c372464a153cb2117 SCRATCH_MNT/test-221/file3 +fa50dba51826899c372464a153cb2117 SCRATCH_MNT/test-221/file3.chk +CoW across the transition +Compare files +bdbcf02ee0aa977795a79d25fcfdccb1 SCRATCH_MNT/test-221/file1 +09101629908f9bdd5d178e7ce20bb1bb SCRATCH_MNT/test-221/file3 +09101629908f9bdd5d178e7ce20bb1bb SCRATCH_MNT/test-221/file3.chk +Check extent counts diff --git a/tests/xfs/223 b/tests/xfs/223 new file mode 100755 index 0000000..2bb1fcb --- /dev/null +++ b/tests/xfs/223 @@ -0,0 +1,104 @@ +#! /bin/bash +# FS QA Test No. 223 +# +# Ensuring that copy on write in direct-io mode works when the CoW +# range originally covers multiple extents, some delalloc, some not. +# - Set cowextsize hint. +# - Create a file. +# - Reflink the odd blocks of the first file into the second file. +# - Buffered write the even blocks of the second file. +# - directio CoW across the halfway mark, starting with the unwritten extent. +# - Check that the files are now different where we say they're different. +# +#----------------------------------------------------------------------- +# Copyright (c) 2016, Oracle and/or its affiliates. All Rights Reserved. +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License as +# published by the Free Software Foundation. +# +# This program is distributed in the hope that it would be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write the Free Software Foundation, +# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA +#----------------------------------------------------------------------- + +seq=`basename $0` +seqres=$RESULT_DIR/$seq +echo "QA output created by $seq" + +here=`pwd` +tmp=/tmp/$$ +status=1 # failure is the default! +trap "_cleanup; exit \$status" 0 1 2 3 15 + +_cleanup() +{ + cd / + rm -rf $tmp.* +} + +# get standard environment, filters and checks +. ./common/rc +. ./common/filter +. ./common/reflink + +# real QA test starts here +_supported_os Linux +_require_scratch_reflink +_require_xfs_io_command "falloc" +_require_odirect + +rm -f $seqres.full + +echo "Format and mount" +_scratch_mkfs > $seqres.full 2>&1 +_scratch_mount >> $seqres.full 2>&1 + +testdir=$SCRATCH_MNT/test-$seq +mkdir $testdir + +echo "Create the original files" +blksz=65536 +nr=64 +filesize=$((blksz * nr)) +real_blksz=$(stat -f -c '%S' $testdir) +internal_blks=$((filesize / real_blksz)) +$XFS_IO_PROG -c "cowextsize $((blksz * 16))" $testdir >> $seqres.full +_weave_reflink_holes $blksz $nr $testdir/file1 $testdir/file3 >> $seqres.full +_scratch_remount + +echo "Compare files" +md5sum $testdir/file1 | _filter_scratch +md5sum $testdir/file3 | _filter_scratch +md5sum $testdir/file3.chk | _filter_scratch + +echo "directio CoW across the transition" +cowoff=$((filesize / 4)) +cowsz=$((filesize / 2)) +_weave_reflink_holes_delalloc $blksz $nr $testdir/file3 >> $seqres.full +$XFS_IO_PROG -d -f -c "pwrite -S 0x63 -b $cowsz $cowoff $cowsz" $testdir/file3 >> $seqres.full +_pwrite_byte 0x63 $cowoff $cowsz $testdir/file3.chk >> $seqres.full +_scratch_remount + +echo "Compare files" +md5sum $testdir/file1 | _filter_scratch +md5sum $testdir/file3 | _filter_scratch +md5sum $testdir/file3.chk | _filter_scratch + +echo "Check extent counts" +old_extents=$(_count_extents $testdir/file1) +new_extents=$(_count_extents $testdir/file3) + +echo "old extents: $old_extents" >> $seqres.full +echo "new extents: $new_extents" >> $seqres.full +echo "maximum extents: $internal_blks" >> $seqres.full +test $new_extents -lt $((internal_blks / 20)) || echo "file3 badly fragmented" + +# success, all done +status=0 +exit diff --git a/tests/xfs/223.out b/tests/xfs/223.out new file mode 100644 index 0000000..e07b33e --- /dev/null +++ b/tests/xfs/223.out @@ -0,0 +1,13 @@ +QA output created by 223 +Format and mount +Create the original files +Compare files +bdbcf02ee0aa977795a79d25fcfdccb1 SCRATCH_MNT/test-223/file1 +fa50dba51826899c372464a153cb2117 SCRATCH_MNT/test-223/file3 +fa50dba51826899c372464a153cb2117 SCRATCH_MNT/test-223/file3.chk +directio CoW across the transition +Compare files +bdbcf02ee0aa977795a79d25fcfdccb1 SCRATCH_MNT/test-223/file1 +55968a95dfc0120df4e8485576514320 SCRATCH_MNT/test-223/file3 +55968a95dfc0120df4e8485576514320 SCRATCH_MNT/test-223/file3.chk +Check extent counts diff --git a/tests/xfs/224 b/tests/xfs/224 new file mode 100755 index 0000000..92d3b05 --- /dev/null +++ b/tests/xfs/224 @@ -0,0 +1,103 @@ +#! /bin/bash +# FS QA Test No. 224 +# +# Ensuring that copy on write in buffered mode works when the CoW +# range originally covers multiple extents, some delalloc, some not. +# - Set cowextsize hint. +# - Create a file. +# - Reflink the odd blocks of the first file into the second file. +# - Buffered write the even blocks of the second file. +# - CoW across the halfway mark, starting with the unwritten extent. +# - Check that the files are now different where we say they're different. +# +#----------------------------------------------------------------------- +# Copyright (c) 2016, Oracle and/or its affiliates. All Rights Reserved. +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License as +# published by the Free Software Foundation. +# +# This program is distributed in the hope that it would be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write the Free Software Foundation, +# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA +#----------------------------------------------------------------------- + +seq=`basename $0` +seqres=$RESULT_DIR/$seq +echo "QA output created by $seq" + +here=`pwd` +tmp=/tmp/$$ +status=1 # failure is the default! +trap "_cleanup; exit \$status" 0 1 2 3 15 + +_cleanup() +{ + cd / + rm -rf $tmp.* +} + +# get standard environment, filters and checks +. ./common/rc +. ./common/filter +. ./common/reflink + +# real QA test starts here +_supported_os Linux +_require_scratch_reflink +_require_xfs_io_command "falloc" + +rm -f $seqres.full + +echo "Format and mount" +_scratch_mkfs > $seqres.full 2>&1 +_scratch_mount >> $seqres.full 2>&1 + +testdir=$SCRATCH_MNT/test-$seq +mkdir $testdir + +echo "Create the original files" +blksz=65536 +nr=64 +filesize=$((blksz * nr)) +real_blksz=$(stat -f -c '%S' $testdir) +internal_blks=$((filesize / real_blksz)) +$XFS_IO_PROG -c "cowextsize $((blksz * 16))" $testdir >> $seqres.full +_weave_reflink_holes $blksz $nr $testdir/file1 $testdir/file3 >> $seqres.full +_scratch_remount + +echo "Compare files" +md5sum $testdir/file1 | _filter_scratch +md5sum $testdir/file3 | _filter_scratch +md5sum $testdir/file3.chk | _filter_scratch + +echo "CoW across the transition" +cowoff=$((filesize / 4)) +cowsz=$((filesize / 2)) +_weave_reflink_holes_delalloc $blksz $nr $testdir/file3 >> $seqres.full +$XFS_IO_PROG -f -c "pwrite -S 0x63 -b $cowsz $cowoff $cowsz" $testdir/file3 >> $seqres.full +_pwrite_byte 0x63 $cowoff $cowsz $testdir/file3.chk >> $seqres.full +_scratch_remount + +echo "Compare files" +md5sum $testdir/file1 | _filter_scratch +md5sum $testdir/file3 | _filter_scratch +md5sum $testdir/file3.chk | _filter_scratch + +echo "Check extent counts" +old_extents=$(_count_extents $testdir/file1) +new_extents=$(_count_extents $testdir/file3) + +echo "old extents: $old_extents" >> $seqres.full +echo "new extents: $new_extents" >> $seqres.full +echo "maximum extents: $internal_blks" >> $seqres.full +test $new_extents -lt $((internal_blks / 20)) || echo "file3 badly fragmented" + +# success, all done +status=0 +exit diff --git a/tests/xfs/224.out b/tests/xfs/224.out new file mode 100644 index 0000000..749b3c9 --- /dev/null +++ b/tests/xfs/224.out @@ -0,0 +1,13 @@ +QA output created by 224 +Format and mount +Create the original files +Compare files +bdbcf02ee0aa977795a79d25fcfdccb1 SCRATCH_MNT/test-224/file1 +fa50dba51826899c372464a153cb2117 SCRATCH_MNT/test-224/file3 +fa50dba51826899c372464a153cb2117 SCRATCH_MNT/test-224/file3.chk +CoW across the transition +Compare files +bdbcf02ee0aa977795a79d25fcfdccb1 SCRATCH_MNT/test-224/file1 +55968a95dfc0120df4e8485576514320 SCRATCH_MNT/test-224/file3 +55968a95dfc0120df4e8485576514320 SCRATCH_MNT/test-224/file3.chk +Check extent counts diff --git a/tests/xfs/225 b/tests/xfs/225 new file mode 100755 index 0000000..b8e7712 --- /dev/null +++ b/tests/xfs/225 @@ -0,0 +1,102 @@ +#! /bin/bash +# FS QA Test No. 225 +# +# Ensuring that copy on write in direct-io mode works when the CoW +# range originally covers multiple extents, some regular, some not. +# - Set cowextsize hint. +# - Create two files. +# - Reflink the odd blocks of the first file into the second file. +# - directio CoW across the halfway mark, starting with the unwritten extent. +# - Check that the files are now different where we say they're different. +# +#----------------------------------------------------------------------- +# Copyright (c) 2016, Oracle and/or its affiliates. All Rights Reserved. +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License as +# published by the Free Software Foundation. +# +# This program is distributed in the hope that it would be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write the Free Software Foundation, +# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA +#----------------------------------------------------------------------- + +seq=`basename $0` +seqres=$RESULT_DIR/$seq +echo "QA output created by $seq" + +here=`pwd` +tmp=/tmp/$$ +status=1 # failure is the default! +trap "_cleanup; exit \$status" 0 1 2 3 15 + +_cleanup() +{ + cd / + rm -rf $tmp.* +} + +# get standard environment, filters and checks +. ./common/rc +. ./common/filter +. ./common/reflink + +# real QA test starts here +_supported_os Linux +_require_scratch_reflink +_require_xfs_io_command "falloc" +_require_odirect + +rm -f $seqres.full + +echo "Format and mount" +_scratch_mkfs > $seqres.full 2>&1 +_scratch_mount >> $seqres.full 2>&1 + +testdir=$SCRATCH_MNT/test-$seq +mkdir $testdir + +echo "Create the original files" +blksz=65536 +nr=64 +filesize=$((blksz * nr)) +real_blksz=$(stat -f -c '%S' $testdir) +internal_blks=$((filesize / real_blksz)) +$XFS_IO_PROG -c "cowextsize $((blksz * 16))" $testdir >> $seqres.full +_weave_reflink_regular $blksz $nr $testdir/file1 $testdir/file3 >> $seqres.full +_scratch_remount + +echo "Compare files" +md5sum $testdir/file1 | _filter_scratch +md5sum $testdir/file3 | _filter_scratch +md5sum $testdir/file3.chk | _filter_scratch + +echo "directio CoW across the transition" +cowoff=$((filesize / 4)) +cowsz=$((filesize / 2)) +$XFS_IO_PROG -d -f -c "pwrite -S 0x63 -b $cowsz $cowoff $cowsz" $testdir/file3 >> $seqres.full +_pwrite_byte 0x63 $cowoff $cowsz $testdir/file3.chk >> $seqres.full +_scratch_remount + +echo "Compare files" +md5sum $testdir/file1 | _filter_scratch +md5sum $testdir/file3 | _filter_scratch +md5sum $testdir/file3.chk | _filter_scratch + +echo "Check extent counts" +old_extents=$(_count_extents $testdir/file1) +new_extents=$(_count_extents $testdir/file3) + +echo "old extents: $old_extents" >> $seqres.full +echo "new extents: $new_extents" >> $seqres.full +echo "maximum extents: $internal_blks" >> $seqres.full +test $new_extents -lt $((internal_blks / 20)) || echo "file3 badly fragmented" + +# success, all done +status=0 +exit diff --git a/tests/xfs/225.out b/tests/xfs/225.out new file mode 100644 index 0000000..da70fbc --- /dev/null +++ b/tests/xfs/225.out @@ -0,0 +1,13 @@ +QA output created by 225 +Format and mount +Create the original files +Compare files +bdbcf02ee0aa977795a79d25fcfdccb1 SCRATCH_MNT/test-225/file1 +d3959a68638c50af07f0258e032cb554 SCRATCH_MNT/test-225/file3 +d3959a68638c50af07f0258e032cb554 SCRATCH_MNT/test-225/file3.chk +directio CoW across the transition +Compare files +bdbcf02ee0aa977795a79d25fcfdccb1 SCRATCH_MNT/test-225/file1 +55968a95dfc0120df4e8485576514320 SCRATCH_MNT/test-225/file3 +55968a95dfc0120df4e8485576514320 SCRATCH_MNT/test-225/file3.chk +Check extent counts diff --git a/tests/xfs/226 b/tests/xfs/226 new file mode 100755 index 0000000..ef4226e --- /dev/null +++ b/tests/xfs/226 @@ -0,0 +1,101 @@ +#! /bin/bash +# FS QA Test No. 226 +# +# Ensuring that copy on write in buffered mode works when the CoW +# range originally covers multiple extents, some regular, some not. +# - Set cowextsize hint. +# - Create two files. +# - Reflink the odd blocks of the first file into the second file. +# - CoW across the halfway mark, starting with the unwritten extent. +# - Check that the files are now different where we say they're different. +# +#----------------------------------------------------------------------- +# Copyright (c) 2016, Oracle and/or its affiliates. All Rights Reserved. +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License as +# published by the Free Software Foundation. +# +# This program is distributed in the hope that it would be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write the Free Software Foundation, +# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA +#----------------------------------------------------------------------- + +seq=`basename $0` +seqres=$RESULT_DIR/$seq +echo "QA output created by $seq" + +here=`pwd` +tmp=/tmp/$$ +status=1 # failure is the default! +trap "_cleanup; exit \$status" 0 1 2 3 15 + +_cleanup() +{ + cd / + rm -rf $tmp.* +} + +# get standard environment, filters and checks +. ./common/rc +. ./common/filter +. ./common/reflink + +# real QA test starts here +_supported_os Linux +_require_scratch_reflink +_require_xfs_io_command "falloc" + +rm -f $seqres.full + +echo "Format and mount" +_scratch_mkfs > $seqres.full 2>&1 +_scratch_mount >> $seqres.full 2>&1 + +testdir=$SCRATCH_MNT/test-$seq +mkdir $testdir + +echo "Create the original files" +blksz=65536 +nr=64 +filesize=$((blksz * nr)) +real_blksz=$(stat -f -c '%S' $testdir) +internal_blks=$((filesize / real_blksz)) +$XFS_IO_PROG -c "cowextsize $((blksz * 16))" $testdir >> $seqres.full +_weave_reflink_regular $blksz $nr $testdir/file1 $testdir/file3 >> $seqres.full +_scratch_remount + +echo "Compare files" +md5sum $testdir/file1 | _filter_scratch +md5sum $testdir/file3 | _filter_scratch +md5sum $testdir/file3.chk | _filter_scratch + +echo "CoW across the transition" +cowoff=$((filesize / 4)) +cowsz=$((filesize / 2)) +$XFS_IO_PROG -f -c "pwrite -S 0x63 -b $cowsz $cowoff $cowsz" $testdir/file3 >> $seqres.full +_pwrite_byte 0x63 $cowoff $cowsz $testdir/file3.chk >> $seqres.full +_scratch_remount + +echo "Compare files" +md5sum $testdir/file1 | _filter_scratch +md5sum $testdir/file3 | _filter_scratch +md5sum $testdir/file3.chk | _filter_scratch + +echo "Check extent counts" +old_extents=$(_count_extents $testdir/file1) +new_extents=$(_count_extents $testdir/file3) + +echo "old extents: $old_extents" >> $seqres.full +echo "new extents: $new_extents" >> $seqres.full +echo "maximum extents: $internal_blks" >> $seqres.full +test $new_extents -lt $((internal_blks / 20)) || echo "file3 badly fragmented" + +# success, all done +status=0 +exit diff --git a/tests/xfs/226.out b/tests/xfs/226.out new file mode 100644 index 0000000..d413e8b --- /dev/null +++ b/tests/xfs/226.out @@ -0,0 +1,13 @@ +QA output created by 226 +Format and mount +Create the original files +Compare files +bdbcf02ee0aa977795a79d25fcfdccb1 SCRATCH_MNT/test-226/file1 +d3959a68638c50af07f0258e032cb554 SCRATCH_MNT/test-226/file3 +d3959a68638c50af07f0258e032cb554 SCRATCH_MNT/test-226/file3.chk +CoW across the transition +Compare files +bdbcf02ee0aa977795a79d25fcfdccb1 SCRATCH_MNT/test-226/file1 +55968a95dfc0120df4e8485576514320 SCRATCH_MNT/test-226/file3 +55968a95dfc0120df4e8485576514320 SCRATCH_MNT/test-226/file3.chk +Check extent counts diff --git a/tests/xfs/228 b/tests/xfs/228 new file mode 100755 index 0000000..ecbe35f --- /dev/null +++ b/tests/xfs/228 @@ -0,0 +1,110 @@ +#! /bin/bash +# FS QA Test No. 228 +# +# Ensuring that copy on write in direct-io mode works when the CoW +# range originally covers multiple extents, some unwritten, some not. +# - Set cowextsize hint. +# - Create a file with the following repeating sequence of blocks: +# 1. reflinked +# 2. unwritten +# 3. hole +# 4. regular block +# 5. delalloc +# - directio CoW across the halfway mark, starting with the unwritten extent. +# - Check that the files are now different where we say they're different. +# +#----------------------------------------------------------------------- +# Copyright (c) 2016, Oracle and/or its affiliates. All Rights Reserved. +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License as +# published by the Free Software Foundation. +# +# This program is distributed in the hope that it would be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write the Free Software Foundation, +# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA +#----------------------------------------------------------------------- + +seq=`basename $0` +seqres=$RESULT_DIR/$seq +echo "QA output created by $seq" + +here=`pwd` +tmp=/tmp/$$ +status=1 # failure is the default! +trap "_cleanup; exit \$status" 0 1 2 3 15 + +_cleanup() +{ + cd / + rm -rf $tmp.* +} + +# get standard environment, filters and checks +. ./common/rc +. ./common/filter +. ./common/reflink + +# real QA test starts here +_supported_os Linux +_require_scratch_reflink +_require_xfs_io_command "falloc" +_require_xfs_io_command "fpunch" +_require_cp_reflink +_require_odirect + +rm -f $seqres.full + +echo "Format and mount" +_scratch_mkfs > $seqres.full 2>&1 +_scratch_mount >> $seqres.full 2>&1 + +testdir=$SCRATCH_MNT/test-$seq +mkdir $testdir + +echo "Create the original files" +blksz=65536 +nr=64 +filesize=$((blksz * nr)) +real_blksz=$(stat -f -c '%S' $testdir) +internal_blks=$((filesize / real_blksz)) +$XFS_IO_PROG -c "cowextsize $((blksz * 16))" $testdir >> $seqres.full +_weave_reflink_rainbow $blksz $nr $testdir/file1 $testdir/file3 >> $seqres.full +_scratch_remount + +echo "Compare files" +md5sum $testdir/file1 | _filter_scratch +md5sum $testdir/file3 | _filter_scratch +md5sum $testdir/file3.chk | _filter_scratch + +echo "directio CoW across the transition" +cowoff=$((filesize / 4)) +cowsz=$((filesize / 2)) +_weave_reflink_rainbow_delalloc $blksz $nr $testdir/file3 >> $seqres.full +# now cow +$XFS_IO_PROG -d -f -c "pwrite -S 0x63 -b $cowsz $cowoff $cowsz" $testdir/file3 >> $seqres.full +_pwrite_byte 0x63 $cowoff $cowsz $testdir/file3.chk >> $seqres.full +_scratch_remount + +echo "Compare files" +md5sum $testdir/file1 | _filter_scratch +md5sum $testdir/file3 | _filter_scratch +md5sum $testdir/file3.chk | _filter_scratch + +echo "Check extent counts" +old_extents=$(_count_extents $testdir/file1) +new_extents=$(_count_extents $testdir/file3) + +echo "old extents: $old_extents" >> $seqres.full +echo "new extents: $new_extents" >> $seqres.full +echo "maximum extents: $internal_blks" >> $seqres.full +test $new_extents -lt $((internal_blks / 20)) || echo "file3 badly fragmented" + +# success, all done +status=0 +exit diff --git a/tests/xfs/228.out b/tests/xfs/228.out new file mode 100644 index 0000000..13b0aee --- /dev/null +++ b/tests/xfs/228.out @@ -0,0 +1,13 @@ +QA output created by 228 +Format and mount +Create the original files +Compare files +bdbcf02ee0aa977795a79d25fcfdccb1 SCRATCH_MNT/test-228/file1 +6366fd359371414186688a0ef6988893 SCRATCH_MNT/test-228/file3 +6366fd359371414186688a0ef6988893 SCRATCH_MNT/test-228/file3.chk +directio CoW across the transition +Compare files +bdbcf02ee0aa977795a79d25fcfdccb1 SCRATCH_MNT/test-228/file1 +26aa3a0749b867ec58363c8539ee5471 SCRATCH_MNT/test-228/file3 +26aa3a0749b867ec58363c8539ee5471 SCRATCH_MNT/test-228/file3.chk +Check extent counts diff --git a/tests/xfs/230 b/tests/xfs/230 new file mode 100755 index 0000000..e09b52e --- /dev/null +++ b/tests/xfs/230 @@ -0,0 +1,110 @@ +#! /bin/bash +# FS QA Test No. 230 +# +# Ensuring that copy on write in buffered mode works when the CoW +# range originally covers multiple extents, some unwritten, some not. +# - Set cowextsize hint. +# - Create a file with the following repeating sequence of blocks: +# 1. reflinked +# 2. unwritten +# 3. hole +# 4. regular block +# 5. delalloc +# - CoW across the halfway mark, starting with the unwritten extent. +# - Check that the files are now different where we say they're different. +# +#----------------------------------------------------------------------- +# Copyright (c) 2016, Oracle and/or its affiliates. All Rights Reserved. +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License as +# published by the Free Software Foundation. +# +# This program is distributed in the hope that it would be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write the Free Software Foundation, +# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA +#----------------------------------------------------------------------- + +seq=`basename $0` +seqres=$RESULT_DIR/$seq +echo "QA output created by $seq" + +here=`pwd` +tmp=/tmp/$$ +status=1 # failure is the default! +trap "_cleanup; exit \$status" 0 1 2 3 15 + +_cleanup() +{ + cd / + rm -rf $tmp.* +} + +# get standard environment, filters and checks +. ./common/rc +. ./common/filter +. ./common/reflink + +# real QA test starts here +_supported_os Linux +_require_scratch_reflink +_require_xfs_io_command "falloc" +_require_xfs_io_command "fpunch" +_require_cp_reflink +_require_odirect + +rm -f $seqres.full + +echo "Format and mount" +_scratch_mkfs > $seqres.full 2>&1 +_scratch_mount >> $seqres.full 2>&1 + +testdir=$SCRATCH_MNT/test-$seq +mkdir $testdir + +echo "Create the original files" +blksz=65536 +nr=64 +filesize=$((blksz * nr)) +real_blksz=$(stat -f -c '%S' $testdir) +internal_blks=$((filesize / real_blksz)) +$XFS_IO_PROG -c "cowextsize $((blksz * 16))" $testdir >> $seqres.full +_weave_reflink_rainbow $blksz $nr $testdir/file1 $testdir/file3 >> $seqres.full +_scratch_remount + +echo "Compare files" +md5sum $testdir/file1 | _filter_scratch +md5sum $testdir/file3 | _filter_scratch +md5sum $testdir/file3.chk | _filter_scratch + +echo "directio CoW across the transition" +cowoff=$((filesize / 4)) +cowsz=$((filesize / 2)) +_weave_reflink_rainbow_delalloc $blksz $nr $testdir/file3 >> $seqres.full +# now cow +$XFS_IO_PROG -f -c "pwrite -S 0x63 -b $cowsz $cowoff $cowsz" $testdir/file3 >> $seqres.full +_pwrite_byte 0x63 $cowoff $cowsz $testdir/file3.chk >> $seqres.full +_scratch_remount + +echo "Compare files" +md5sum $testdir/file1 | _filter_scratch +md5sum $testdir/file3 | _filter_scratch +md5sum $testdir/file3.chk | _filter_scratch + +echo "Check extent counts" +old_extents=$(_count_extents $testdir/file1) +new_extents=$(_count_extents $testdir/file3) + +echo "old extents: $old_extents" >> $seqres.full +echo "new extents: $new_extents" >> $seqres.full +echo "maximum extents: $internal_blks" >> $seqres.full +test $new_extents -lt $((internal_blks / 20)) || echo "file3 badly fragmented" + +# success, all done +status=0 +exit diff --git a/tests/xfs/230.out b/tests/xfs/230.out new file mode 100644 index 0000000..439427c --- /dev/null +++ b/tests/xfs/230.out @@ -0,0 +1,13 @@ +QA output created by 230 +Format and mount +Create the original files +Compare files +bdbcf02ee0aa977795a79d25fcfdccb1 SCRATCH_MNT/test-230/file1 +6366fd359371414186688a0ef6988893 SCRATCH_MNT/test-230/file3 +6366fd359371414186688a0ef6988893 SCRATCH_MNT/test-230/file3.chk +directio CoW across the transition +Compare files +bdbcf02ee0aa977795a79d25fcfdccb1 SCRATCH_MNT/test-230/file1 +26aa3a0749b867ec58363c8539ee5471 SCRATCH_MNT/test-230/file3 +26aa3a0749b867ec58363c8539ee5471 SCRATCH_MNT/test-230/file3.chk +Check extent counts diff --git a/tests/xfs/group b/tests/xfs/group index afd960f..da83274 100644 --- a/tests/xfs/group +++ b/tests/xfs/group @@ -212,12 +212,22 @@ 212 auto quick clone 213 auto quick clone 214 auto quick clone +215 auto quick clone 216 log metadata auto quick 217 log metadata auto +218 auto quick clone +219 auto quick clone 220 auto quota quick +221 auto quick clone 222 auto fsr ioctl quick +223 auto quick clone +224 auto quick clone +225 auto quick clone +226 auto quick clone 227 auto fsr +228 auto quick clone 229 auto rw +230 auto quick clone 238 auto quick metadata ioctl 242 auto quick prealloc 244 auto quota quick From darrick.wong@oracle.com Thu Feb 11 17:42:08 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay1.corp.sgi.com [137.38.102.111]) by oss.sgi.com (Postfix) with ESMTP id 283E87FA5 for ; Thu, 11 Feb 2016 17:42:08 -0600 (CST) Received: from cuda.sgi.com (cuda2.sgi.com [192.48.176.25]) by relay1.corp.sgi.com (Postfix) with ESMTP id 177D48F8050 for ; Thu, 11 Feb 2016 15:42:08 -0800 (PST) X-ASG-Debug-ID: 1455234125-04cbb043338a0b0001-NocioJ Received: from aserp1040.oracle.com (aserp1040.oracle.com [141.146.126.69]) by cuda.sgi.com with ESMTP id WcoQBIFpgEMPqVMO (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO) for ; Thu, 11 Feb 2016 15:42:05 -0800 (PST) X-Barracuda-Envelope-From: darrick.wong@oracle.com X-Barracuda-Apparent-Source-IP: 141.146.126.69 Received: from userv0022.oracle.com (userv0022.oracle.com [156.151.31.74]) by aserp1040.oracle.com (Sentrion-MTA-4.3.2/Sentrion-MTA-4.3.2) with ESMTP id u1BNg4Vb025019 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 11 Feb 2016 23:42:04 GMT Received: from userv0121.oracle.com (userv0121.oracle.com [156.151.31.72]) by userv0022.oracle.com (8.14.4/8.13.8) with ESMTP id u1BNg4xG028618 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=FAIL); Thu, 11 Feb 2016 23:42:04 GMT Received: from abhmp0017.oracle.com (abhmp0017.oracle.com [141.146.116.23]) by userv0121.oracle.com (8.13.8/8.13.8) with ESMTP id u1BNg3wG006953; Thu, 11 Feb 2016 23:42:03 GMT Received: from localhost (/10.145.178.207) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Thu, 11 Feb 2016 15:42:03 -0800 Subject: [PATCH 24/32] xfs: test the automatic cowextsize extent garbage collector From: "Darrick J. Wong" X-ASG-Orig-Subj: [PATCH 24/32] xfs: test the automatic cowextsize extent garbage collector To: david@fromorbit.com, darrick.wong@oracle.com Cc: linux-btrfs@vger.kernel.org, fstests@vger.kernel.org, xfs@oss.sgi.com Date: Thu, 11 Feb 2016 15:42:01 -0800 Message-ID: <20160211234201.2202.59992.stgit@birch.djwong.org> In-Reply-To: <20160211233916.2202.40961.stgit@birch.djwong.org> References: <20160211233916.2202.40961.stgit@birch.djwong.org> User-Agent: StGit/0.17.1-dirty MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit X-Source-IP: userv0022.oracle.com [156.151.31.74] X-Barracuda-Connect: aserp1040.oracle.com[141.146.126.69] X-Barracuda-Start-Time: 1455234125 X-Barracuda-Encrypted: ECDHE-RSA-AES256-GCM-SHA384 X-Barracuda-URL: https://192.48.176.25:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-BRTS-Status: 1 X-Barracuda-Spam-Score: 0.00 X-Barracuda-Spam-Status: No, SCORE=0.00 using per-user scores of TAG_LEVEL=1000.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.7 tests=BSF_SC0_MISMATCH_TO, UNPARSEABLE_RELAY X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.3.26959 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 0.00 BSF_SC0_MISMATCH_TO Envelope rcpt doesn't match header 0.00 UNPARSEABLE_RELAY Informational: message has unparseable relay lines Signed-off-by: Darrick J. Wong --- tests/xfs/231 | 130 ++++++++++++++++++++++++++++++++++++++++++++++++++++ tests/xfs/231.out | 16 ++++++ tests/xfs/232 | 132 +++++++++++++++++++++++++++++++++++++++++++++++++++++ tests/xfs/232.out | 16 ++++++ tests/xfs/group | 2 + 5 files changed, 296 insertions(+) create mode 100755 tests/xfs/231 create mode 100644 tests/xfs/231.out create mode 100755 tests/xfs/232 create mode 100644 tests/xfs/232.out diff --git a/tests/xfs/231 b/tests/xfs/231 new file mode 100755 index 0000000..3672887 --- /dev/null +++ b/tests/xfs/231 @@ -0,0 +1,130 @@ +#! /bin/bash +# FS QA Test No. 231 +# +# Test recovery of unused CoW reservations: +# - Create two reflinked files. Set extsz hint on second file. +# - Dirty a single byte on a number of CoW reservations in the second file. +# - Fsync to flush out the dirty pages. +# - Wait for the reclaim to run. +# - Write more and see how bad fragmentation is. +# +#----------------------------------------------------------------------- +# Copyright (c) 2016, Oracle and/or its affiliates. All Rights Reserved. +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License as +# published by the Free Software Foundation. +# +# This program is distributed in the hope that it would be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write the Free Software Foundation, +# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA +#----------------------------------------------------------------------- + +seq=`basename $0` +seqres=$RESULT_DIR/$seq +echo "QA output created by $seq" + +here=`pwd` +tmp=/tmp/$$ +status=1 # failure is the default! +trap "_cleanup; exit \$status" 0 1 2 3 15 + +_cleanup() +{ + cd / + echo $old_cow_lifetime > /proc/sys/fs/xfs/speculative_cow_prealloc_lifetime + rm -rf $tmp.* +} + +# get standard environment, filters and checks +. ./common/rc +. ./common/filter +. ./common/reflink + +# real QA test starts here +_supported_os Linux +_supported_fs xfs +_require_scratch_reflink +_require_cp_reflink +_require_fiemap + +old_cow_lifetime=$(cat /proc/sys/fs/xfs/speculative_cow_prealloc_lifetime) + +rm -f $seqres.full + +echo "Format and mount" +_scratch_mkfs > $seqres.full 2>&1 +_scratch_mount >> $seqres.full 2>&1 + +testdir=$SCRATCH_MNT/test-$seq +mkdir $testdir + +blksz=65536 +nr=64 +filesize=$((blksz * nr)) +bufnr=2 +bufsize=$((blksz * bufnr)) + +_require_fs_space $SCRATCH_MNT $((filesize / 1024 * 3 * 5 / 4)) +real_blksz=$(stat -f -c '%S' $testdir) +internal_blks=$((filesize / real_blksz)) + +echo "Create the original files" +$XFS_IO_PROG -c "cowextsize $bufsize" $testdir +$XFS_IO_PROG -f -c "pwrite -S 0x61 -b $bufsize 0 $filesize" $testdir/file1 >> $seqres.full +$XFS_IO_PROG -f -c "pwrite -S 0x61 -b $bufsize 0 $filesize" $testdir/file2.chk >> $seqres.full +_cp_reflink $testdir/file1 $testdir/file2 >> $seqres.full +_scratch_remount + +echo "Compare files" +md5sum $testdir/file1 | _filter_scratch +md5sum $testdir/file2 | _filter_scratch +md5sum $testdir/file2.chk | _filter_scratch + +echo "CoW and leave leftovers" +echo 2 > /proc/sys/fs/xfs/speculative_cow_prealloc_lifetime +seq 2 2 $((nr - 1)) | while read f; do + $XFS_IO_PROG -f -c "pwrite -S 0x63 $((blksz * f - 1)) 1" $testdir/file2 >> $seqres.full + $XFS_IO_PROG -f -c "pwrite -S 0x63 $((blksz * f - 1)) 1" $testdir/file2.chk >> $seqres.full +done +sync + +echo "Wait for CoW expiration" +sleep 3 + +echo "Allocate free space" +for i in $(seq 1 32); do + $XFS_IO_PROG -f -c "falloc 0 1" $testdir/junk.$i >> $seqres.full +done +$XFS_IO_PROG -f -c "falloc 0 $filesize" $testdir/junk >> $seqres.full + +echo "CoW and leave leftovers" +echo $old_cow_lifetime > /proc/sys/fs/xfs/speculative_cow_prealloc_lifetime +seq 2 2 $((nr - 1)) | while read f; do + $XFS_IO_PROG -f -c "pwrite -S 0x63 $((blksz * f)) 1" $testdir/file2 >> $seqres.full + $XFS_IO_PROG -f -c "pwrite -S 0x63 $((blksz * f)) 1" $testdir/file2.chk >> $seqres.full +done +sync + +echo "Compare files" +md5sum $testdir/file1 | _filter_scratch +md5sum $testdir/file2 | _filter_scratch +md5sum $testdir/file2.chk | _filter_scratch + +echo "Check extent counts" +old_extents=$(_count_extents $testdir/file1) +new_extents=$(_count_extents $testdir/file2) + +echo "old extents: $old_extents" >> $seqres.full +echo "new extents: $new_extents" >> $seqres.full +echo "maximum extents: $internal_blks" >> $seqres.full +test $new_extents -lt $((internal_blks / 7)) || echo "file2 badly fragmented" + +# success, all done +status=0 +exit diff --git a/tests/xfs/231.out b/tests/xfs/231.out new file mode 100644 index 0000000..0dcaba3 --- /dev/null +++ b/tests/xfs/231.out @@ -0,0 +1,16 @@ +QA output created by 231 +Format and mount +Create the original files +Compare files +bdbcf02ee0aa977795a79d25fcfdccb1 SCRATCH_MNT/test-231/file1 +bdbcf02ee0aa977795a79d25fcfdccb1 SCRATCH_MNT/test-231/file2 +bdbcf02ee0aa977795a79d25fcfdccb1 SCRATCH_MNT/test-231/file2.chk +CoW and leave leftovers +Wait for CoW expiration +Allocate free space +CoW and leave leftovers +Compare files +bdbcf02ee0aa977795a79d25fcfdccb1 SCRATCH_MNT/test-231/file1 +211b0f725e67149d75104a747365eb70 SCRATCH_MNT/test-231/file2 +211b0f725e67149d75104a747365eb70 SCRATCH_MNT/test-231/file2.chk +Check extent counts diff --git a/tests/xfs/232 b/tests/xfs/232 new file mode 100755 index 0000000..7219a64 --- /dev/null +++ b/tests/xfs/232 @@ -0,0 +1,132 @@ +#! /bin/bash +# FS QA Test No. 232 +# +# Test non-recovery of unused CoW reservations for dirty files: +# - Create two reflinked files. Set extsz hint on second file. +# - Dirty a single byte on a number of CoW reservations in the second file. +# - Fsync to flush out the dirty pages. +# - Dirty a single byte anywhere in the second file. +# - Wait for the reclaim to run. +# - Write more and see how bad fragmentation is. +# +#----------------------------------------------------------------------- +# Copyright (c) 2016, Oracle and/or its affiliates. All Rights Reserved. +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License as +# published by the Free Software Foundation. +# +# This program is distributed in the hope that it would be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write the Free Software Foundation, +# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA +#----------------------------------------------------------------------- + +seq=`basename $0` +seqres=$RESULT_DIR/$seq +echo "QA output created by $seq" + +here=`pwd` +tmp=/tmp/$$ +status=1 # failure is the default! +trap "_cleanup; exit \$status" 0 1 2 3 15 + +_cleanup() +{ + cd / + echo $old_cow_lifetime > /proc/sys/fs/xfs/speculative_cow_prealloc_lifetime + rm -rf $tmp.* +} + +# get standard environment, filters and checks +. ./common/rc +. ./common/filter +. ./common/reflink + +# real QA test starts here +_supported_os Linux +_supported_fs xfs +_require_scratch_reflink +_require_cp_reflink +_require_fiemap + +old_cow_lifetime=$(cat /proc/sys/fs/xfs/speculative_cow_prealloc_lifetime) + +rm -f $seqres.full + +echo "Format and mount" +_scratch_mkfs > $seqres.full 2>&1 +_scratch_mount >> $seqres.full 2>&1 + +testdir=$SCRATCH_MNT/test-$seq +mkdir $testdir + +blksz=65536 +nr=64 +filesize=$((blksz * nr)) +bufnr=2 +bufsize=$((blksz * bufnr)) + +_require_fs_space $SCRATCH_MNT $((filesize / 1024 * 3 * 5 / 4)) +real_blksz=$(stat -f -c '%S' $testdir) +internal_blks=$((filesize / real_blksz)) + +echo "Create the original files" +$XFS_IO_PROG -c "cowextsize $bufsize" $testdir +$XFS_IO_PROG -f -c "pwrite -S 0x61 -b $bufsize 0 $filesize" $testdir/file1 >> $seqres.full +$XFS_IO_PROG -f -c "pwrite -S 0x61 -b $bufsize 0 $filesize" $testdir/file2.chk >> $seqres.full +_cp_reflink $testdir/file1 $testdir/file2 >> $seqres.full +_scratch_remount + +echo "Compare files" +md5sum $testdir/file1 | _filter_scratch +md5sum $testdir/file2 | _filter_scratch +md5sum $testdir/file2.chk | _filter_scratch + +echo "CoW and leave leftovers" +echo 2 > /proc/sys/fs/xfs/speculative_cow_prealloc_lifetime +seq 2 2 $((nr - 1)) | while read f; do + $XFS_IO_PROG -f -c "pwrite -S 0x63 $((blksz * f - 1)) 1" $testdir/file2 >> $seqres.full + $XFS_IO_PROG -f -c "pwrite -S 0x63 $((blksz * f - 1)) 1" $testdir/file2.chk >> $seqres.full +done +sync + +echo "Wait for CoW expiration" +$XFS_IO_PROG -f -c "pwrite -S 0x63 $((blksz * 2)) 1" $testdir/file2 >> $seqres.full +sleep 3 + +echo "Allocate free space" +for i in $(seq 1 32); do + $XFS_IO_PROG -f -c "falloc 0 1" $testdir/junk.$i >> $seqres.full +done +$XFS_IO_PROG -f -c "falloc 0 $filesize" $testdir/junk >> $seqres.full + +echo "CoW and leave leftovers" +echo $old_cow_lifetime > /proc/sys/fs/xfs/speculative_cow_prealloc_lifetime +seq 2 2 $((nr - 1)) | while read f; do + $XFS_IO_PROG -f -c "pwrite -S 0x63 $((blksz * f)) 1" $testdir/file2 >> $seqres.full + $XFS_IO_PROG -f -c "pwrite -S 0x63 $((blksz * f)) 1" $testdir/file2.chk >> $seqres.full +done +sync + +echo "Compare files" +md5sum $testdir/file1 | _filter_scratch +md5sum $testdir/file2 | _filter_scratch +md5sum $testdir/file2.chk | _filter_scratch + +echo "Check extent counts" +old_extents=$(_count_extents $testdir/file1) +new_extents=$(_count_extents $testdir/file2) + +echo "old extents: $old_extents" >> $seqres.full +echo "new extents: $new_extents" >> $seqres.full +echo "maximum extents: $internal_blks" >> $seqres.full +test $new_extents -lt $((internal_blks / 12)) || echo "file2 not sufficiently fragmented" + +# success, all done +status=0 +exit diff --git a/tests/xfs/232.out b/tests/xfs/232.out new file mode 100644 index 0000000..0fb9fb9 --- /dev/null +++ b/tests/xfs/232.out @@ -0,0 +1,16 @@ +QA output created by 232 +Format and mount +Create the original files +Compare files +bdbcf02ee0aa977795a79d25fcfdccb1 SCRATCH_MNT/test-232/file1 +bdbcf02ee0aa977795a79d25fcfdccb1 SCRATCH_MNT/test-232/file2 +bdbcf02ee0aa977795a79d25fcfdccb1 SCRATCH_MNT/test-232/file2.chk +CoW and leave leftovers +Wait for CoW expiration +Allocate free space +CoW and leave leftovers +Compare files +bdbcf02ee0aa977795a79d25fcfdccb1 SCRATCH_MNT/test-232/file1 +211b0f725e67149d75104a747365eb70 SCRATCH_MNT/test-232/file2 +211b0f725e67149d75104a747365eb70 SCRATCH_MNT/test-232/file2.chk +Check extent counts diff --git a/tests/xfs/group b/tests/xfs/group index da83274..de3c7d6 100644 --- a/tests/xfs/group +++ b/tests/xfs/group @@ -228,6 +228,8 @@ 228 auto quick clone 229 auto rw 230 auto quick clone +231 auto quick clone +232 auto quick clone 238 auto quick metadata ioctl 242 auto quick prealloc 244 auto quota quick From darrick.wong@oracle.com Thu Feb 11 17:42:16 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay3.corp.sgi.com [198.149.34.15]) by oss.sgi.com (Postfix) with ESMTP id BD3407FA5 for ; Thu, 11 Feb 2016 17:42:15 -0600 (CST) Received: from cuda.sgi.com (cuda1.sgi.com [192.48.157.11]) by relay3.corp.sgi.com (Postfix) with ESMTP id 66987AC002 for ; Thu, 11 Feb 2016 15:42:15 -0800 (PST) X-ASG-Debug-ID: 1455234132-04bdf066ed73960001-NocioJ Received: from aserp1040.oracle.com (aserp1040.oracle.com [141.146.126.69]) by cuda.sgi.com with ESMTP id kruGEDlc6qFVZClp (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO) for ; Thu, 11 Feb 2016 15:42:12 -0800 (PST) X-Barracuda-Envelope-From: darrick.wong@oracle.com X-Barracuda-Apparent-Source-IP: 141.146.126.69 Received: from userv0022.oracle.com (userv0022.oracle.com [156.151.31.74]) by aserp1040.oracle.com (Sentrion-MTA-4.3.2/Sentrion-MTA-4.3.2) with ESMTP id u1BNgAuJ025138 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 11 Feb 2016 23:42:11 GMT Received: from aserv0121.oracle.com (aserv0121.oracle.com [141.146.126.235]) by userv0022.oracle.com (8.14.4/8.13.8) with ESMTP id u1BNgAlx028903 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=FAIL); Thu, 11 Feb 2016 23:42:10 GMT Received: from abhmp0010.oracle.com (abhmp0010.oracle.com [141.146.116.16]) by aserv0121.oracle.com (8.13.8/8.13.8) with ESMTP id u1BNgABt026865; Thu, 11 Feb 2016 23:42:10 GMT Received: from localhost (/10.145.178.207) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Thu, 11 Feb 2016 15:42:09 -0800 Subject: [PATCH 25/32] xfs: test rmapbt functionality From: "Darrick J. Wong" X-ASG-Orig-Subj: [PATCH 25/32] xfs: test rmapbt functionality To: david@fromorbit.com, darrick.wong@oracle.com Cc: linux-btrfs@vger.kernel.org, fstests@vger.kernel.org, xfs@oss.sgi.com Date: Thu, 11 Feb 2016 15:42:08 -0800 Message-ID: <20160211234208.2202.66877.stgit@birch.djwong.org> In-Reply-To: <20160211233916.2202.40961.stgit@birch.djwong.org> References: <20160211233916.2202.40961.stgit@birch.djwong.org> User-Agent: StGit/0.17.1-dirty MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit X-Source-IP: userv0022.oracle.com [156.151.31.74] X-Barracuda-Connect: aserp1040.oracle.com[141.146.126.69] X-Barracuda-Start-Time: 1455234132 X-Barracuda-Encrypted: ECDHE-RSA-AES256-GCM-SHA384 X-Barracuda-URL: https://192.48.157.11:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-BRTS-Status: 1 X-Barracuda-Spam-Score: 0.00 X-Barracuda-Spam-Status: No, SCORE=0.00 using per-user scores of TAG_LEVEL=1000.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.7 tests=BSF_SC0_MISMATCH_TO, UNPARSEABLE_RELAY X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.3.26959 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 0.00 BSF_SC0_MISMATCH_TO Envelope rcpt doesn't match header 0.00 UNPARSEABLE_RELAY Informational: message has unparseable relay lines Signed-off-by: Darrick J. Wong --- common/rc | 22 +++++++++++ tests/xfs/233 | 73 ++++++++++++++++++++++++++++++++++++ tests/xfs/233.out | 5 ++ tests/xfs/234 | 88 +++++++++++++++++++++++++++++++++++++++++++ tests/xfs/234.out | 6 +++ tests/xfs/235 | 108 +++++++++++++++++++++++++++++++++++++++++++++++++++++ tests/xfs/235.out | 14 +++++++ tests/xfs/236 | 88 +++++++++++++++++++++++++++++++++++++++++++ tests/xfs/236.out | 7 +++ tests/xfs/group | 4 ++ 10 files changed, 415 insertions(+) create mode 100755 tests/xfs/233 create mode 100644 tests/xfs/233.out create mode 100755 tests/xfs/234 create mode 100644 tests/xfs/234.out create mode 100755 tests/xfs/235 create mode 100644 tests/xfs/235.out create mode 100755 tests/xfs/236 create mode 100644 tests/xfs/236.out diff --git a/common/rc b/common/rc index e05df74..7e83d6e 100644 --- a/common/rc +++ b/common/rc @@ -3053,6 +3053,28 @@ _require_test_lsattr() _notrun "lsattr not supported by test filesystem type: $FSTYP" } +_require_xfs_test_rmapbt() +{ + _require_test + + if [ "$(xfs_info "$TEST_DIR" | grep -c "rmapbt=1")" -ne 1 ]; then + _notrun "rmapbt not supported by test filesystem type: $FSTYP" + fi +} + +_require_xfs_scratch_rmapbt() +{ + _require_scratch + + _scratch_mkfs > /dev/null + _scratch_mount + if [ "$(xfs_info "$SCRATCH_MNT" | grep -c "rmapbt=1")" -ne 1 ]; then + _scratch_unmount + _notrun "rmapbt not supported by scratch filesystem type: $FSTYP" + fi + _scratch_unmount +} + _get_total_inode() { if [ -z "$1" ]; then diff --git a/tests/xfs/233 b/tests/xfs/233 new file mode 100755 index 0000000..f821004 --- /dev/null +++ b/tests/xfs/233 @@ -0,0 +1,73 @@ +#! /bin/bash +# FS QA Test No. 233 +# +# Tests xfs_growfs on a rmapbt filesystem +# +#----------------------------------------------------------------------- +# Copyright (c) 2016, Oracle and/or its affiliates. All Rights Reserved. +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License as +# published by the Free Software Foundation. +# +# This program is distributed in the hope that it would be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write the Free Software Foundation, +# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA +#----------------------------------------------------------------------- +# + +seq=`basename $0` +seqres=$RESULT_DIR/$seq +echo "QA output created by $seq" + +here=`pwd` +tmp=/tmp/$$ +status=1 # failure is the default! +trap "_cleanup; exit \$status" 0 1 2 3 15 + +_cleanup() +{ + cd / + rm -f $tmp.* +} + +# get standard environment, filters and checks +. ./common/rc +. ./common/filter +. ./common/xfs + +# real QA test starts here +_supported_os Linux +_supported_fs xfs +_require_xfs_scratch_rmapbt + +echo "Format and mount" +_scratch_mkfs_sized $((2 * 4096 * 4096)) > $seqres.full 2>&1 +_scratch_mount >> $seqres.full 2>&1 + +testdir=$SCRATCH_MNT/test-$seq +mkdir $testdir + +echo "Create the original files" +blksz="$(stat -f $testdir -c '%S')" +_pwrite_byte 0x61 0 $((blksz * 14 + 71)) $testdir/original >> $seqres.full +cp -p $testdir/original $testdir/copy1 +cp -p $testdir/copy1 $testdir/copy2 + +echo "Grow fs" +$XFS_GROWFS_PROG $SCRATCH_MNT 2>&1 | _filter_growfs >> $seqres.full +_scratch_remount + +echo "Create more copies" +cp -p $testdir/original $testdir/copy3 + +xfs_info $SCRATCH_MNT >> $seqres.full + +# success, all done +status=0 +exit diff --git a/tests/xfs/233.out b/tests/xfs/233.out new file mode 100644 index 0000000..4a4fc3a --- /dev/null +++ b/tests/xfs/233.out @@ -0,0 +1,5 @@ +QA output created by 233 +Format and mount +Create the original files +Grow fs +Create more copies diff --git a/tests/xfs/234 b/tests/xfs/234 new file mode 100755 index 0000000..649cb7e --- /dev/null +++ b/tests/xfs/234 @@ -0,0 +1,88 @@ +#! /bin/bash +# FS QA Test No. 234 +# +# Ensure that we can create enough distinct rmap entries to force creation +# of a multi-level rmap btree, and that metadump will successfully copy +# said block. +# +#----------------------------------------------------------------------- +# Copyright (c) 2016, Oracle and/or its affiliates. All Rights Reserved. +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License as +# published by the Free Software Foundation. +# +# This program is distributed in the hope that it would be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write the Free Software Foundation, +# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA +#----------------------------------------------------------------------- + +seq=`basename $0` +seqres=$RESULT_DIR/$seq +echo "QA output created by $seq" + +here=`pwd` +tmp=/tmp/$$ +status=1 # failure is the default! +trap "_cleanup; exit \$status" 0 1 2 3 15 + +_cleanup() +{ + cd / + umount $SCRATCH_MNT > /dev/null 2>&1 + rm -rf $tmp.* $metadump_file $TEST_DIR/image +} + +# get standard environment, filters and checks +. ./common/rc +. ./common/filter +. ./common/xfs + +# real QA test starts here +_supported_os Linux +_supported_fs xfs +_require_loop +_require_xfs_scratch_rmapbt +_require_xfs_io_command "fpunch" + +rm -f $seqres.full + +_scratch_mkfs >/dev/null 2>&1 +_scratch_mount + +testdir=$SCRATCH_MNT/test-$seq +mkdir $testdir +metadump_file=$TEST_DIR/${seq}_metadump + +echo "Create the original file blocks" +blksz="$(stat -f $testdir -c '%S')" +nr_blks=$((4 * blksz / 12)) +_pwrite_byte 0x61 0 $((blksz * nr_blks)) $testdir/file1 >> $seqres.full +sync + +echo "Punch every other block" +seq 1 2 $((nr_blks - 1)) | while read nr; do + $XFS_IO_PROG -c "fpunch $((nr * blksz)) $blksz" $testdir/file1 >> $seqres.full +done + +echo "Create metadump file" +_scratch_unmount +_scratch_metadump $metadump_file + +# Now restore the obfuscated one back and take a look around +echo "Restore metadump" +xfs_mdrestore $metadump_file $TEST_DIR/image +_mount -t $FSTYP $TEST_DIR/image $SCRATCH_MNT +umount $SCRATCH_MNT + +echo "Check restored fs" +_check_generic_filesystem $metadump_file + +# success, all done +status=0 +exit diff --git a/tests/xfs/234.out b/tests/xfs/234.out new file mode 100644 index 0000000..463d466 --- /dev/null +++ b/tests/xfs/234.out @@ -0,0 +1,6 @@ +QA output created by 234 +Create the original file blocks +Punch every other block +Create metadump file +Restore metadump +Check restored fs diff --git a/tests/xfs/235 b/tests/xfs/235 new file mode 100755 index 0000000..5af72a6 --- /dev/null +++ b/tests/xfs/235 @@ -0,0 +1,108 @@ +#! /bin/bash +# FS QA Test No. 235 +# +# Create and populate an XFS filesystem, corrupt the rmap btree, +# then see how the kernel and xfs_repair deal with it. +# +#----------------------------------------------------------------------- +# Copyright (c) 2016 Oracle, Inc. All Rights Reserved. +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License as +# published by the Free Software Foundation. +# +# This program is distributed in the hope that it would be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write the Free Software Foundation, +# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-7031 USA +#----------------------------------------------------------------------- +# + +seq=`basename $0` +seqres=$RESULT_DIR/$seq +echo "QA output created by $seq" + +here=`pwd` +tmp=/tmp/$$ +status=1 # failure is the default! +trap "_cleanup; exit \$status" 0 1 2 3 15 + +_cleanup() +{ + cd / + rm -f $tmp.* +} + +# get standard environment, filters and checks +. ./common/rc +. ./common/filter +. ./common/attr +. ./common/xfs + +# real QA test starts here +_supported_os Linux +_supported_fs xfs +_require_xfs_scratch_rmapbt +test -n ${FORCE_FUZZ} || _require_scratch_xfs_crc + +rm -f $seqres.full + +echo "+ create scratch fs" +_scratch_mkfs_xfs > /dev/null + +echo "+ mount fs image" +_scratch_mount +blksz=$(stat -f -c '%s' ${SCRATCH_MNT}) +agcount=$(xfs_info ${SCRATCH_MNT} | grep agcount= | sed -e 's/^.*agcount=\([0-9]*\),.*$/\1/g') + +echo "+ make some files" +_pwrite_byte 0x62 0 $((blksz * 64)) ${SCRATCH_MNT}/file0 >> $seqres.full +_pwrite_byte 0x61 0 $((blksz * 64)) ${SCRATCH_MNT}/file1 >> $seqres.full +cp -p ${SCRATCH_MNT}/file0 ${SCRATCH_MNT}/file2 +cp -p ${SCRATCH_MNT}/file1 ${SCRATCH_MNT}/file3 +umount ${SCRATCH_MNT} + +echo "+ check fs" +_scratch_xfs_repair -n >> $seqres.full 2>&1 || \ + _fail "xfs_repair should not fail" + +echo "+ corrupt image" +seq 0 $((agcount - 1)) | while read ag; do + $XFS_DB_PROG -x -c "agf ${ag}" -c "agf ${ag}" -c "addr rmaproot" \ + -c "stack" -c "blocktrash -x 4096 -y 4096 -z -n 8 -3" \ + ${SCRATCH_DEV} >> $seqres.full 2>&1 +done + +echo "+ mount image" +_scratch_mount + +echo "+ copy more" +$XFS_IO_PROG -f -c "pwrite -S 0x63 0 $((blksz * 64))" -c "fsync" ${SCRATCH_MNT}/file4 >> $seqres.full +test -s ${SCRATCH_MNT}/file4 || _fail "should not be able to copy with busted rmap btree" +umount ${SCRATCH_MNT} + +echo "+ repair fs" +_scratch_xfs_repair >> $seqres.full 2>&1 +_scratch_xfs_repair >> $seqres.full 2>&1 + +echo "+ mount image (2)" +_scratch_mount + +echo "+ chattr -R -i" +chattr -R -f -i ${SCRATCH_MNT}/ + +echo "+ copy more (2)" +cp -p ${SCRATCH_MNT}/file1 ${SCRATCH_MNT}/file5 || \ + _fail "modified rmap tree" +umount ${SCRATCH_MNT} + +echo "+ check fs (2)" +_scratch_xfs_repair -n >> $seqres.full 2>&1 || \ + _fail "xfs_repair should not fail" + +status=0 +exit diff --git a/tests/xfs/235.out b/tests/xfs/235.out new file mode 100644 index 0000000..89a11d6 --- /dev/null +++ b/tests/xfs/235.out @@ -0,0 +1,14 @@ +QA output created by 235 ++ create scratch fs ++ mount fs image ++ make some files ++ check fs ++ corrupt image ++ mount image ++ copy more +fsync: Structure needs cleaning ++ repair fs ++ mount image (2) ++ chattr -R -i ++ copy more (2) ++ check fs (2) diff --git a/tests/xfs/236 b/tests/xfs/236 new file mode 100755 index 0000000..99e9a75 --- /dev/null +++ b/tests/xfs/236 @@ -0,0 +1,88 @@ +#! /bin/bash +# FS QA Test No. 236 +# +# Ensure that we can create enough distinct rmapbt entries to force creation +# of a multi-level rmap btree. Delete and recreate a few times to +# exercise the rmap btree grow/shrink functions. +# +#----------------------------------------------------------------------- +# Copyright (c) 2016, Oracle and/or its affiliates. All Rights Reserved. +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License as +# published by the Free Software Foundation. +# +# This program is distributed in the hope that it would be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write the Free Software Foundation, +# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA +#----------------------------------------------------------------------- + +seq=`basename $0` +seqres=$RESULT_DIR/$seq +echo "QA output created by $seq" + +here=`pwd` +tmp=/tmp/$$ +status=1 # failure is the default! +trap "_cleanup; exit \$status" 0 1 2 3 15 + +_cleanup() +{ + cd / + umount $SCRATCH_MNT > /dev/null 2>&1 + rm -rf $tmp.* +} + +# get standard environment, filters and checks +. ./common/rc +. ./common/filter +. ./common/xfs + +# real QA test starts here +_supported_os Linux +_supported_fs xfs +_require_xfs_scratch_rmapbt +_require_xfs_io_command "fpunch" + +rm -f $seqres.full + +_scratch_mkfs >/dev/null 2>&1 +_scratch_mount + +testdir=$SCRATCH_MNT/test-$seq +mkdir $testdir + +echo "Create the original file blocks" +blksz="$(stat -f $testdir -c '%S')" +nr_blks=$((8 * blksz / 12)) + +for i in 1 2 x; do + _pwrite_byte 0x61 0 $((blksz * nr_blks)) $testdir/file1 >> $seqres.full + _pwrite_byte 0x62 0 $((blksz * nr_blks)) $testdir/file2 >> $seqres.full + sync + + echo "$i: Reflink every other block" + seq 1 2 $((nr_blks - 1)) | while read nr; do + $XFS_IO_PROG -c "fpunch $((nr * blksz)) $blksz" $testdir/file2 >> $seqres.full + done + umount $SCRATCH_MNT + _check_scratch_fs + _scratch_mount + + test $i = "x" && break + + echo "$i: Delete both files" + rm -rf $testdir/file1 $testdir/file2 + umount $SCRATCH_MNT + _check_scratch_fs + _scratch_mount +done + +# success, all done +status=0 +exit diff --git a/tests/xfs/236.out b/tests/xfs/236.out new file mode 100644 index 0000000..272246d --- /dev/null +++ b/tests/xfs/236.out @@ -0,0 +1,7 @@ +QA output created by 236 +Create the original file blocks +1: Reflink every other block +1: Delete both files +2: Reflink every other block +2: Delete both files +x: Reflink every other block diff --git a/tests/xfs/group b/tests/xfs/group index de3c7d6..1d08065 100644 --- a/tests/xfs/group +++ b/tests/xfs/group @@ -230,6 +230,10 @@ 230 auto quick clone 231 auto quick clone 232 auto quick clone +233 auto quick rmap +234 auto quick rmap +235 fuzzers rmap +236 auto quick rmap 238 auto quick metadata ioctl 242 auto quick prealloc 244 auto quota quick From darrick.wong@oracle.com Thu Feb 11 17:42:22 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay3.corp.sgi.com [198.149.34.15]) by oss.sgi.com (Postfix) with ESMTP id A6AD17FB5 for ; Thu, 11 Feb 2016 17:42:22 -0600 (CST) Received: from cuda.sgi.com (cuda2.sgi.com [192.48.176.25]) by relay3.corp.sgi.com (Postfix) with ESMTP id 1B7BEAC002 for ; Thu, 11 Feb 2016 15:42:21 -0800 (PST) X-ASG-Debug-ID: 1455234138-04cbb043318a0c0001-NocioJ Received: from userp1040.oracle.com (userp1040.oracle.com [156.151.31.81]) by cuda.sgi.com with ESMTP id 9MPuqoJy6uqsVr3J (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO) for ; Thu, 11 Feb 2016 15:42:18 -0800 (PST) X-Barracuda-Envelope-From: darrick.wong@oracle.com X-Barracuda-Apparent-Source-IP: 156.151.31.81 Received: from aserv0022.oracle.com (aserv0022.oracle.com [141.146.126.234]) by userp1040.oracle.com (Sentrion-MTA-4.3.2/Sentrion-MTA-4.3.2) with ESMTP id u1BNgHJP001942 (version=TLSv1 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Thu, 11 Feb 2016 23:42:17 GMT Received: from aserv0122.oracle.com (aserv0122.oracle.com [141.146.126.236]) by aserv0022.oracle.com (8.13.8/8.13.8) with ESMTP id u1BNgHn8008829 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=FAIL); Thu, 11 Feb 2016 23:42:17 GMT Received: from abhmp0003.oracle.com (abhmp0003.oracle.com [141.146.116.9]) by aserv0122.oracle.com (8.13.8/8.13.8) with ESMTP id u1BNgGuI027662; Thu, 11 Feb 2016 23:42:16 GMT Received: from localhost (/10.145.178.207) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Thu, 11 Feb 2016 15:42:16 -0800 Subject: [PATCH 26/32] reflink: test aio copy on write From: "Darrick J. Wong" X-ASG-Orig-Subj: [PATCH 26/32] reflink: test aio copy on write To: david@fromorbit.com, darrick.wong@oracle.com Cc: linux-btrfs@vger.kernel.org, fstests@vger.kernel.org, xfs@oss.sgi.com Date: Thu, 11 Feb 2016 15:42:14 -0800 Message-ID: <20160211234214.2202.32501.stgit@birch.djwong.org> In-Reply-To: <20160211233916.2202.40961.stgit@birch.djwong.org> References: <20160211233916.2202.40961.stgit@birch.djwong.org> User-Agent: StGit/0.17.1-dirty MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit X-Source-IP: aserv0022.oracle.com [141.146.126.234] X-Barracuda-Connect: userp1040.oracle.com[156.151.31.81] X-Barracuda-Start-Time: 1455234138 X-Barracuda-Encrypted: ECDHE-RSA-AES256-GCM-SHA384 X-Barracuda-URL: https://192.48.176.25:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-BRTS-Status: 1 X-Barracuda-Spam-Score: 0.00 X-Barracuda-Spam-Status: No, SCORE=0.00 using per-user scores of TAG_LEVEL=1000.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.7 tests=BSF_SC0_MISMATCH_TO, UNPARSEABLE_RELAY X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.3.26959 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 0.00 BSF_SC0_MISMATCH_TO Envelope rcpt doesn't match header 0.00 UNPARSEABLE_RELAY Informational: message has unparseable relay lines Make sure that copy on write works with the AIO path. Signed-off-by: Darrick J. Wong --- tests/generic/329 | 102 ++++++++++++++++++++++++++++++++++++++++++++++++ tests/generic/329.out | 12 ++++++ tests/generic/330 | 93 ++++++++++++++++++++++++++++++++++++++++++++ tests/generic/330.out | 11 +++++ tests/generic/331 | 104 +++++++++++++++++++++++++++++++++++++++++++++++++ tests/generic/331.out | 12 ++++++ tests/generic/332 | 94 ++++++++++++++++++++++++++++++++++++++++++++ tests/generic/332.out | 11 +++++ tests/generic/group | 4 ++ 9 files changed, 443 insertions(+) create mode 100755 tests/generic/329 create mode 100644 tests/generic/329.out create mode 100755 tests/generic/330 create mode 100644 tests/generic/330.out create mode 100755 tests/generic/331 create mode 100644 tests/generic/331.out create mode 100755 tests/generic/332 create mode 100644 tests/generic/332.out diff --git a/tests/generic/329 b/tests/generic/329 new file mode 100755 index 0000000..3991672 --- /dev/null +++ b/tests/generic/329 @@ -0,0 +1,102 @@ +#! /bin/bash +# FS QA Test No. 329 +# +# Test AIO DIO CoW behavior when the write temporarily fails. +# +#----------------------------------------------------------------------- +# Copyright (c) 2016, Oracle and/or its affiliates. All Rights Reserved. +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License as +# published by the Free Software Foundation. +# +# This program is distributed in the hope that it would be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write the Free Software Foundation, +# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA +#----------------------------------------------------------------------- + +seq=`basename $0` +seqres=$RESULT_DIR/$seq +echo "QA output created by $seq" + +here=`pwd` +tmp=/tmp/$$ +status=1 # failure is the default! +trap "_cleanup; exit \$status" 0 1 2 3 15 + +_cleanup() +{ + cd / + rm -rf $tmp.* $TEST_DIR/moo + _dmerror_cleanup +} + +# get standard environment, filters and checks +. ./common/rc +. ./common/filter +. ./common/reflink +. ./common/dmerror + +# real QA test starts here +_supported_os Linux +_require_scratch_reflink +_require_cp_reflink +_require_dm_target error +_require_aiodio "aiocp" + +rm -f $seqres.full + + +echo "Format and mount" +_scratch_mkfs > $seqres.full 2>&1 +_dmerror_init +_dmerror_mount >> $seqres.full 2>&1 + +testdir=$SCRATCH_MNT/test-$seq +mkdir $testdir + +blksz=65536 +nr=640 +bufnr=128 +filesize=$((blksz * nr)) +bufsize=$((blksz * bufnr)) + +_require_fs_space $SCRATCH_MNT $((filesize / 1024 * 3 * 5 / 4)) + +echo "Create the original files" +$XFS_IO_PROG -f -c "pwrite -S 0x61 -b $bufsize 0 $filesize" $testdir/file1 >> $seqres.full +_cp_reflink $testdir/file1 $testdir/file2 >> $seqres.full +_dmerror_unmount +_dmerror_mount + +echo "Compare files" +md5sum $testdir/file1 | _filter_scratch +md5sum $testdir/file2 | _filter_scratch + +echo "CoW and unmount" +$XFS_IO_PROG -f -c "pwrite -S 0x63 $bufsize 1" $testdir/file2 >> $seqres.full +$XFS_IO_PROG -f -c "pwrite -S 0x63 -b $bufsize 0 $filesize" $TEST_DIR/moo >> $seqres.full +sync +_dmerror_load_error_table +$AIO_TEST -f DIRECT -b $bufsize $TEST_DIR/moo $testdir/file2 >> $seqres.full +_dmerror_load_working_table +_dmerror_unmount +_dmerror_mount + +echo "Compare files" +md5sum $testdir/file1 | _filter_scratch +md5sum $testdir/file2 | _filter_scratch + +echo "Check for damage" +_dmerror_unmount +_dmerror_cleanup +_repair_scratch_fs >> $seqres.full + +# success, all done +status=0 +exit diff --git a/tests/generic/329.out b/tests/generic/329.out new file mode 100644 index 0000000..f14726c --- /dev/null +++ b/tests/generic/329.out @@ -0,0 +1,12 @@ +QA output created by 329 +Format and mount +Create the original files +Compare files +1886e67cf8783e89ce6ddc5bb09a3944 SCRATCH_MNT/test-329/file1 +1886e67cf8783e89ce6ddc5bb09a3944 SCRATCH_MNT/test-329/file2 +CoW and unmount +write missed bytes expect 8388608 got 0 +Compare files +1886e67cf8783e89ce6ddc5bb09a3944 SCRATCH_MNT/test-329/file1 +d94b0ab13385aba594411c174b1cc13c SCRATCH_MNT/test-329/file2 +Check for damage diff --git a/tests/generic/330 b/tests/generic/330 new file mode 100755 index 0000000..377d822 --- /dev/null +++ b/tests/generic/330 @@ -0,0 +1,93 @@ +#! /bin/bash +# FS QA Test No. 330 +# +# Test AIO DIO CoW behavior. +# +#----------------------------------------------------------------------- +# Copyright (c) 2016, Oracle and/or its affiliates. All Rights Reserved. +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License as +# published by the Free Software Foundation. +# +# This program is distributed in the hope that it would be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write the Free Software Foundation, +# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA +#----------------------------------------------------------------------- + +seq=`basename $0` +seqres=$RESULT_DIR/$seq +echo "QA output created by $seq" + +here=`pwd` +tmp=/tmp/$$ +status=1 # failure is the default! +trap "_cleanup; exit \$status" 0 1 2 3 15 + +_cleanup() +{ + cd / + rm -rf $tmp.* $TEST_DIR/moo +} + +# get standard environment, filters and checks +. ./common/rc +. ./common/filter +. ./common/reflink + +# real QA test starts here +_supported_os Linux +_require_scratch_reflink +_require_cp_reflink +_require_aiodio "aiocp" + +rm -f $seqres.full + + +echo "Format and mount" +_scratch_mkfs > $seqres.full 2>&1 +_scratch_mount >> $seqres.full 2>&1 + +testdir=$SCRATCH_MNT/test-$seq +mkdir $testdir + +blksz=65536 +nr=640 +bufnr=128 +filesize=$((blksz * nr)) +bufsize=$((blksz * bufnr)) + +_require_fs_space $SCRATCH_MNT $((filesize / 1024 * 3 * 5 / 4)) + +echo "Create the original files" +$XFS_IO_PROG -f -c "pwrite -S 0x61 -b $bufsize 0 $filesize" $testdir/file1 >> $seqres.full +_cp_reflink $testdir/file1 $testdir/file2 >> $seqres.full +_scratch_remount + +echo "Compare files" +md5sum $testdir/file1 | _filter_scratch +md5sum $testdir/file2 | _filter_scratch + +echo "CoW and unmount" +$XFS_IO_PROG -f -c "pwrite -S 0x63 $bufsize 1" $testdir/file2 >> $seqres.full +sync +$XFS_IO_PROG -f -c "pwrite -S 0x63 -b $bufsize 0 $filesize" $TEST_DIR/moo >> $seqres.full +$AIO_TEST -f DIRECT -b $bufsize $TEST_DIR/moo $testdir/file2 >> $seqres.full +_scratch_remount + +echo "Compare files" +md5sum $testdir/file1 | _filter_scratch +md5sum $testdir/file2 | _filter_scratch + +echo "Check for damage" +umount $SCRATCH_MNT +_repair_scratch_fs >> $seqres.full + +# success, all done +status=0 +exit diff --git a/tests/generic/330.out b/tests/generic/330.out new file mode 100644 index 0000000..9a33a22 --- /dev/null +++ b/tests/generic/330.out @@ -0,0 +1,11 @@ +QA output created by 330 +Format and mount +Create the original files +Compare files +1886e67cf8783e89ce6ddc5bb09a3944 SCRATCH_MNT/test-330/file1 +1886e67cf8783e89ce6ddc5bb09a3944 SCRATCH_MNT/test-330/file2 +CoW and unmount +Compare files +1886e67cf8783e89ce6ddc5bb09a3944 SCRATCH_MNT/test-330/file1 +7a4d22297e80ff3c92cb1b3e4566d234 SCRATCH_MNT/test-330/file2 +Check for damage diff --git a/tests/generic/331 b/tests/generic/331 new file mode 100755 index 0000000..8d8fd6a --- /dev/null +++ b/tests/generic/331 @@ -0,0 +1,104 @@ +#! /bin/bash +# FS QA Test No. 331 +# +# Test AIO CoW behavior when the write temporarily fails. +# +#----------------------------------------------------------------------- +# Copyright (c) 2016, Oracle and/or its affiliates. All Rights Reserved. +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License as +# published by the Free Software Foundation. +# +# This program is distributed in the hope that it would be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write the Free Software Foundation, +# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA +#----------------------------------------------------------------------- + +seq=`basename $0` +seqres=$RESULT_DIR/$seq +echo "QA output created by $seq" + +here=`pwd` +tmp=/tmp/$$ +status=1 # failure is the default! +trap "_cleanup; exit \$status" 0 1 2 3 15 + +_cleanup() +{ + cd / + rm -rf $tmp.* $TEST_DIR/moo + _dmerror_cleanup +} + +# get standard environment, filters and checks +. ./common/rc +. ./common/filter +. ./common/reflink +. ./common/dmerror + +# real QA test starts here +_supported_os Linux +_require_scratch_reflink +_require_cp_reflink +_require_dm_target error +_require_test_program "aio-dio-regress/aiocp" +AIO_TEST="src/aio-dio-regress/aiocp" + +rm -f $seqres.full + + +echo "Format and mount" +_scratch_mkfs > $seqres.full 2>&1 +_dmerror_init +_dmerror_mount >> $seqres.full 2>&1 + +testdir=$SCRATCH_MNT/test-$seq +mkdir $testdir + +blksz=65536 +nr=640 +bufnr=128 +filesize=$((blksz * nr)) +bufsize=$((blksz * bufnr)) + +_require_fs_space $SCRATCH_MNT $((filesize / 1024 * 3 * 5 / 4)) + +echo "Create the original files" +$XFS_IO_PROG -f -c "pwrite -S 0x61 -b $bufsize 0 $filesize" $testdir/file1 >> $seqres.full +_cp_reflink $testdir/file1 $testdir/file2 >> $seqres.full +_dmerror_unmount +_dmerror_mount + +echo "Compare files" +md5sum $testdir/file1 | _filter_scratch +md5sum $testdir/file2 | _filter_scratch + +echo "CoW and unmount" +$XFS_IO_PROG -f -c "pwrite -S 0x63 $bufsize 1" $testdir/file2 >> $seqres.full +$XFS_IO_PROG -f -c "pwrite -S 0x63 -b $bufsize 0 $filesize" $TEST_DIR/moo >> $seqres.full +sync +_dmerror_load_error_table +$AIO_TEST -b $bufsize $TEST_DIR/moo $testdir/file2 >> $seqres.full +$XFS_IO_PROG -c "fdatasync" $testdir/file2 +_dmerror_load_working_table +_dmerror_unmount +_dmerror_mount + +echo "Compare files" +md5sum $testdir/file1 | _filter_scratch +md5sum $testdir/file2 | _filter_scratch + +echo "Check for damage" +_dmerror_unmount +_dmerror_cleanup +_repair_scratch_fs >> $seqres.full + +# success, all done +status=0 +exit diff --git a/tests/generic/331.out b/tests/generic/331.out new file mode 100644 index 0000000..adbf841 --- /dev/null +++ b/tests/generic/331.out @@ -0,0 +1,12 @@ +QA output created by 331 +Format and mount +Create the original files +Compare files +1886e67cf8783e89ce6ddc5bb09a3944 SCRATCH_MNT/test-331/file1 +1886e67cf8783e89ce6ddc5bb09a3944 SCRATCH_MNT/test-331/file2 +CoW and unmount +fdatasync: Input/output error +Compare files +1886e67cf8783e89ce6ddc5bb09a3944 SCRATCH_MNT/test-331/file1 +d94b0ab13385aba594411c174b1cc13c SCRATCH_MNT/test-331/file2 +Check for damage diff --git a/tests/generic/332 b/tests/generic/332 new file mode 100755 index 0000000..f9b5f6f --- /dev/null +++ b/tests/generic/332 @@ -0,0 +1,94 @@ +#! /bin/bash +# FS QA Test No. 332 +# +# Test AIO CoW behavior. +# +#----------------------------------------------------------------------- +# Copyright (c) 2016, Oracle and/or its affiliates. All Rights Reserved. +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License as +# published by the Free Software Foundation. +# +# This program is distributed in the hope that it would be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write the Free Software Foundation, +# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA +#----------------------------------------------------------------------- + +seq=`basename $0` +seqres=$RESULT_DIR/$seq +echo "QA output created by $seq" + +here=`pwd` +tmp=/tmp/$$ +status=1 # failure is the default! +trap "_cleanup; exit \$status" 0 1 2 3 15 + +_cleanup() +{ + cd / + rm -rf $tmp.* $TEST_DIR/moo +} + +# get standard environment, filters and checks +. ./common/rc +. ./common/filter +. ./common/reflink + +# real QA test starts here +_supported_os Linux +_require_scratch_reflink +_require_cp_reflink +_require_test_program "aio-dio-regress/aiocp" +AIO_TEST="src/aio-dio-regress/aiocp" + +rm -f $seqres.full + + +echo "Format and mount" +_scratch_mkfs > $seqres.full 2>&1 +_scratch_mount >> $seqres.full 2>&1 + +testdir=$SCRATCH_MNT/test-$seq +mkdir $testdir + +blksz=65536 +nr=640 +bufnr=128 +filesize=$((blksz * nr)) +bufsize=$((blksz * bufnr)) + +_require_fs_space $SCRATCH_MNT $((filesize / 1024 * 3 * 5 / 4)) + +echo "Create the original files" +$XFS_IO_PROG -f -c "pwrite -S 0x61 -b $bufsize 0 $filesize" $testdir/file1 >> $seqres.full +_cp_reflink $testdir/file1 $testdir/file2 >> $seqres.full +_scratch_remount + +echo "Compare files" +md5sum $testdir/file1 | _filter_scratch +md5sum $testdir/file2 | _filter_scratch + +echo "CoW and unmount" +$XFS_IO_PROG -f -c "pwrite -S 0x63 $bufsize 1" $testdir/file2 >> $seqres.full +$XFS_IO_PROG -f -c "pwrite -S 0x63 -b $bufsize 0 $filesize" $TEST_DIR/moo >> $seqres.full +sync +$AIO_TEST -b $bufsize $TEST_DIR/moo $testdir/file2 >> $seqres.full +_scratch_remount + +echo "Compare files" +md5sum $testdir/file1 | _filter_scratch +md5sum $testdir/file2 | _filter_scratch + +echo "Check for damage" +umount $SCRATCH_MNT +_repair_scratch_fs >> $seqres.full + +# success, all done +status=0 +exit diff --git a/tests/generic/332.out b/tests/generic/332.out new file mode 100644 index 0000000..b584b1e --- /dev/null +++ b/tests/generic/332.out @@ -0,0 +1,11 @@ +QA output created by 332 +Format and mount +Create the original files +Compare files +1886e67cf8783e89ce6ddc5bb09a3944 SCRATCH_MNT/test-332/file1 +1886e67cf8783e89ce6ddc5bb09a3944 SCRATCH_MNT/test-332/file2 +CoW and unmount +Compare files +1886e67cf8783e89ce6ddc5bb09a3944 SCRATCH_MNT/test-332/file1 +7a4d22297e80ff3c92cb1b3e4566d234 SCRATCH_MNT/test-332/file2 +Check for damage diff --git a/tests/generic/group b/tests/generic/group index 8b9e0e5..e7ed475 100644 --- a/tests/generic/group +++ b/tests/generic/group @@ -331,3 +331,7 @@ 326 auto quick clone 327 auto quick clone 328 auto quick clone +329 auto quick clone +330 auto quick clone +331 auto quick clone +332 auto quick clone From darrick.wong@oracle.com Thu Feb 11 17:42:27 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay1.corp.sgi.com [137.38.102.111]) by oss.sgi.com (Postfix) with ESMTP id EBF2E7FCD for ; Thu, 11 Feb 2016 17:42:27 -0600 (CST) Received: from cuda.sgi.com (cuda3.sgi.com [192.48.176.15]) by relay1.corp.sgi.com (Postfix) with ESMTP id D8ED08F804B for ; Thu, 11 Feb 2016 15:42:27 -0800 (PST) X-ASG-Debug-ID: 1455234144-04cb6c1e5772f70001-NocioJ Received: from aserp1040.oracle.com (aserp1040.oracle.com [141.146.126.69]) by cuda.sgi.com with ESMTP id BGkx3n3aMCkwOVwL (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO) for ; Thu, 11 Feb 2016 15:42:24 -0800 (PST) X-Barracuda-Envelope-From: darrick.wong@oracle.com X-Barracuda-Apparent-Source-IP: 141.146.126.69 Received: from aserv0022.oracle.com (aserv0022.oracle.com [141.146.126.234]) by aserp1040.oracle.com (Sentrion-MTA-4.3.2/Sentrion-MTA-4.3.2) with ESMTP id u1BNgNb3025304 (version=TLSv1 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Thu, 11 Feb 2016 23:42:24 GMT Received: from aserv0121.oracle.com (aserv0121.oracle.com [141.146.126.235]) by aserv0022.oracle.com (8.13.8/8.13.8) with ESMTP id u1BNgN8T009164 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=FAIL); Thu, 11 Feb 2016 23:42:23 GMT Received: from abhmp0011.oracle.com (abhmp0011.oracle.com [141.146.116.17]) by aserv0121.oracle.com (8.13.8/8.13.8) with ESMTP id u1BNgNQ3026915; Thu, 11 Feb 2016 23:42:23 GMT Received: from localhost (/10.145.178.207) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Thu, 11 Feb 2016 15:42:23 -0800 Subject: [PATCH 27/32] xfs: aio cow tests From: "Darrick J. Wong" X-ASG-Orig-Subj: [PATCH 27/32] xfs: aio cow tests To: david@fromorbit.com, darrick.wong@oracle.com Cc: linux-btrfs@vger.kernel.org, fstests@vger.kernel.org, xfs@oss.sgi.com Date: Thu, 11 Feb 2016 15:42:21 -0800 Message-ID: <20160211234221.2202.14857.stgit@birch.djwong.org> In-Reply-To: <20160211233916.2202.40961.stgit@birch.djwong.org> References: <20160211233916.2202.40961.stgit@birch.djwong.org> User-Agent: StGit/0.17.1-dirty MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit X-Source-IP: aserv0022.oracle.com [141.146.126.234] X-Barracuda-Connect: aserp1040.oracle.com[141.146.126.69] X-Barracuda-Start-Time: 1455234144 X-Barracuda-Encrypted: ECDHE-RSA-AES256-GCM-SHA384 X-Barracuda-URL: https://192.48.176.15:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-BRTS-Status: 1 X-Barracuda-Spam-Score: 0.00 X-Barracuda-Spam-Status: No, SCORE=0.00 using per-user scores of TAG_LEVEL=1000.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.7 tests=BSF_SC0_MISMATCH_TO, UNPARSEABLE_RELAY X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.3.26959 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 0.00 BSF_SC0_MISMATCH_TO Envelope rcpt doesn't match header 0.00 UNPARSEABLE_RELAY Informational: message has unparseable relay lines Test what happens when AIO writes fail when we have a cowextsize hint set on the files. Signed-off-by: Darrick J. Wong --- tests/xfs/237 | 105 +++++++++++++++++++++++++++++++++++++++++++++++++++ tests/xfs/237.out | 12 ++++++ tests/xfs/239 | 98 +++++++++++++++++++++++++++++++++++++++++++++++ tests/xfs/239.out | 11 +++++ tests/xfs/240 | 110 +++++++++++++++++++++++++++++++++++++++++++++++++++++ tests/xfs/240.out | 12 ++++++ tests/xfs/241 | 100 ++++++++++++++++++++++++++++++++++++++++++++++++ tests/xfs/241.out | 11 +++++ tests/xfs/group | 4 ++ 9 files changed, 463 insertions(+) create mode 100755 tests/xfs/237 create mode 100644 tests/xfs/237.out create mode 100755 tests/xfs/239 create mode 100644 tests/xfs/239.out create mode 100755 tests/xfs/240 create mode 100644 tests/xfs/240.out create mode 100755 tests/xfs/241 create mode 100644 tests/xfs/241.out diff --git a/tests/xfs/237 b/tests/xfs/237 new file mode 100755 index 0000000..f961de3 --- /dev/null +++ b/tests/xfs/237 @@ -0,0 +1,105 @@ +#! /bin/bash +# FS QA Test No. 237 +# +# Test AIO DIO CoW behavior when the write temporarily fails. +# +#----------------------------------------------------------------------- +# Copyright (c) 2016, Oracle and/or its affiliates. All Rights Reserved. +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License as +# published by the Free Software Foundation. +# +# This program is distributed in the hope that it would be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write the Free Software Foundation, +# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA +#----------------------------------------------------------------------- + +seq=`basename $0` +seqres=$RESULT_DIR/$seq +echo "QA output created by $seq" + +here=`pwd` +tmp=/tmp/$$ +status=1 # failure is the default! +trap "_cleanup; exit \$status" 0 1 2 3 15 + +_cleanup() +{ + cd / + rm -rf $tmp.* $TEST_DIR/moo + _dmerror_cleanup +} + +# get standard environment, filters and checks +. ./common/rc +. ./common/filter +. ./common/reflink +. ./common/dmerror + +# real QA test starts here +_supported_os Linux +_supported_fs xfs +_require_scratch_reflink +_require_cp_reflink +_require_dm_target error +_require_xfs_io_command "cowextsize" +_require_aiodio "aiocp" + +rm -f $seqres.full + + +echo "Format and mount" +_scratch_mkfs > $seqres.full 2>&1 +_dmerror_init +_dmerror_mount >> $seqres.full 2>&1 + +testdir=$SCRATCH_MNT/test-$seq +mkdir $testdir + +blksz=65536 +nr=640 +bufnr=128 +filesize=$((blksz * nr)) +bufsize=$((blksz * bufnr)) + +_require_fs_space $SCRATCH_MNT $((filesize / 1024 * 3 * 5 / 4)) + +echo "Create the original files" +$XFS_IO_PROG -c "cowextsize $((bufsize * 2))" $testdir +$XFS_IO_PROG -f -c "pwrite -S 0x61 -b $bufsize 0 $filesize" $testdir/file1 >> $seqres.full +_cp_reflink $testdir/file1 $testdir/file2 >> $seqres.full +_dmerror_unmount +_dmerror_mount + +echo "Compare files" +md5sum $testdir/file1 | _filter_scratch +md5sum $testdir/file2 | _filter_scratch + +echo "CoW and unmount" +$XFS_IO_PROG -f -c "pwrite -S 0x63 $bufsize 1" $testdir/file2 >> $seqres.full +$XFS_IO_PROG -f -c "pwrite -S 0x63 -b $bufsize 0 $filesize" $TEST_DIR/moo >> $seqres.full +sync +_dmerror_load_error_table +$AIO_TEST -f DIRECT -b $bufsize $TEST_DIR/moo $testdir/file2 >> $seqres.full +_dmerror_load_working_table +_dmerror_unmount +_dmerror_mount + +echo "Compare files" +md5sum $testdir/file1 | _filter_scratch +md5sum $testdir/file2 | _filter_scratch + +echo "Check for damage" +_dmerror_unmount +_dmerror_cleanup +_repair_scratch_fs >> $seqres.full + +# success, all done +status=0 +exit diff --git a/tests/xfs/237.out b/tests/xfs/237.out new file mode 100644 index 0000000..c83dd8b --- /dev/null +++ b/tests/xfs/237.out @@ -0,0 +1,12 @@ +QA output created by 237 +Format and mount +Create the original files +Compare files +1886e67cf8783e89ce6ddc5bb09a3944 SCRATCH_MNT/test-237/file1 +1886e67cf8783e89ce6ddc5bb09a3944 SCRATCH_MNT/test-237/file2 +CoW and unmount +write missed bytes expect 8388608 got 0 +Compare files +1886e67cf8783e89ce6ddc5bb09a3944 SCRATCH_MNT/test-237/file1 +d94b0ab13385aba594411c174b1cc13c SCRATCH_MNT/test-237/file2 +Check for damage diff --git a/tests/xfs/239 b/tests/xfs/239 new file mode 100755 index 0000000..5bab633 --- /dev/null +++ b/tests/xfs/239 @@ -0,0 +1,98 @@ +#! /bin/bash +# FS QA Test No. 239 +# +# Test AIO DIO CoW behavior. +# +#----------------------------------------------------------------------- +# Copyright (c) 2016, Oracle and/or its affiliates. All Rights Reserved. +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License as +# published by the Free Software Foundation. +# +# This program is distributed in the hope that it would be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write the Free Software Foundation, +# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA +#----------------------------------------------------------------------- + +seq=`basename $0` +seqres=$RESULT_DIR/$seq +echo "QA output created by $seq" + +here=`pwd` +tmp=/tmp/$$ +status=1 # failure is the default! +trap "_cleanup; exit \$status" 0 1 2 3 15 + +_cleanup() +{ + cd / + rm -rf $tmp.* $TEST_DIR/moo +} + +# get standard environment, filters and checks +. ./common/rc +. ./common/filter +. ./common/reflink + +# real QA test starts here +_supported_os Linux +_supported_fs xfs +_require_scratch_reflink +_require_cp_reflink +_require_xfs_io_command "cowextsize" +_require_aiodio "aiocp" + +rm -f $seqres.full + + +echo "Format and mount" +_scratch_mkfs > $seqres.full 2>&1 +_scratch_mount >> $seqres.full 2>&1 + +testdir=$SCRATCH_MNT/test-$seq +mkdir $testdir + +blksz=65536 +nr=640 +bufnr=128 +filesize=$((blksz * nr)) +bufsize=$((blksz * bufnr)) +filesize=$filesize +bufsize=$bufsize + +_require_fs_space $SCRATCH_MNT $((filesize / 1024 * 3 * 5 / 4)) + +echo "Create the original files" +$XFS_IO_PROG -c "cowextsize $((bufsize * 2))" $testdir +$XFS_IO_PROG -f -c "pwrite -S 0x61 -b $bufsize 0 $filesize" $testdir/file1 >> $seqres.full +_cp_reflink $testdir/file1 $testdir/file2 >> $seqres.full +_scratch_remount + +echo "Compare files" +md5sum $testdir/file1 | _filter_scratch +md5sum $testdir/file2 | _filter_scratch + +echo "CoW and unmount" +$XFS_IO_PROG -f -c "pwrite -S 0x63 $bufsize 1" $testdir/file2 >> $seqres.full +sync +$XFS_IO_PROG -f -c "pwrite -S 0x63 -b $bufsize 0 $filesize" $TEST_DIR/moo >> $seqres.full +$AIO_TEST -f DIRECT -b $bufsize $TEST_DIR/moo $testdir/file2 >> $seqres.full +_scratch_remount + +echo "Compare files" +md5sum $testdir/file1 | _filter_scratch +md5sum $testdir/file2 | _filter_scratch + +echo "Check for damage" +umount $SCRATCH_MNT +_repair_scratch_fs >> $seqres.full + +# success, all done +status=0 +exit diff --git a/tests/xfs/239.out b/tests/xfs/239.out new file mode 100644 index 0000000..a123da9 --- /dev/null +++ b/tests/xfs/239.out @@ -0,0 +1,11 @@ +QA output created by 239 +Format and mount +Create the original files +Compare files +1886e67cf8783e89ce6ddc5bb09a3944 SCRATCH_MNT/test-239/file1 +1886e67cf8783e89ce6ddc5bb09a3944 SCRATCH_MNT/test-239/file2 +CoW and unmount +Compare files +1886e67cf8783e89ce6ddc5bb09a3944 SCRATCH_MNT/test-239/file1 +7a4d22297e80ff3c92cb1b3e4566d234 SCRATCH_MNT/test-239/file2 +Check for damage diff --git a/tests/xfs/240 b/tests/xfs/240 new file mode 100755 index 0000000..62a7735 --- /dev/null +++ b/tests/xfs/240 @@ -0,0 +1,110 @@ +#! /bin/bash +# FS QA Test No. 240 +# +# Test AIO CoW behavior when the write temporarily fails. +# +#----------------------------------------------------------------------- +# Copyright (c) 2016, Oracle and/or its affiliates. All Rights Reserved. +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License as +# published by the Free Software Foundation. +# +# This program is distributed in the hope that it would be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write the Free Software Foundation, +# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA +#----------------------------------------------------------------------- + +seq=`basename $0` +seqres=$RESULT_DIR/$seq +echo "QA output created by $seq" + +here=`pwd` +tmp=/tmp/$$ +status=1 # failure is the default! +trap "_cleanup; exit \$status" 0 1 2 3 15 + +_cleanup() +{ + cd / + rm -rf $tmp.* $TEST_DIR/moo + _dmerror_cleanup +} + +# get standard environment, filters and checks +. ./common/rc +. ./common/filter +. ./common/reflink +. ./common/dmerror + +# real QA test starts here +_supported_os Linux +_supported_fs xfs +_require_scratch_reflink +_require_cp_reflink +_require_dm_target error +_require_xfs_io_command "cowextsize" +_require_test_program "aio-dio-regress/aiocp" +AIO_TEST="src/aio-dio-regress/aiocp" +_require_odirect + +rm -f $seqres.full + + +echo "Format and mount" +_scratch_mkfs > $seqres.full 2>&1 +_dmerror_init +_dmerror_mount >> $seqres.full 2>&1 + +testdir=$SCRATCH_MNT/test-$seq +mkdir $testdir + +blksz=65536 +nr=640 +bufnr=128 +filesize=$((blksz * nr)) +bufsize=$((blksz * bufnr)) +filesize=$filesize +bufsize=$bufsize + +_require_fs_space $SCRATCH_MNT $((filesize / 1024 * 3 * 5 / 4)) + +echo "Create the original files" +$XFS_IO_PROG -c "cowextsize $((bufsize * 2))" $testdir +$XFS_IO_PROG -f -c "pwrite -S 0x61 -b $bufsize 0 $filesize" $testdir/file1 >> $seqres.full +_cp_reflink $testdir/file1 $testdir/file2 >> $seqres.full +_dmerror_unmount +_dmerror_mount + +echo "Compare files" +md5sum $testdir/file1 | _filter_scratch +md5sum $testdir/file2 | _filter_scratch + +echo "CoW and unmount" +$XFS_IO_PROG -f -c "pwrite -S 0x63 $bufsize 1" $testdir/file2 >> $seqres.full +$XFS_IO_PROG -f -c "pwrite -S 0x63 -b $bufsize 0 $filesize" $TEST_DIR/moo >> $seqres.full +sync +_dmerror_load_error_table +$AIO_TEST -b $bufsize $TEST_DIR/moo $testdir/file2 >> $seqres.full +$XFS_IO_PROG -c "fdatasync" $testdir/file2 +_dmerror_load_working_table +_dmerror_unmount +_dmerror_mount + +echo "Compare files" +md5sum $testdir/file1 | _filter_scratch +md5sum $testdir/file2 | _filter_scratch + +echo "Check for damage" +_dmerror_unmount +_dmerror_cleanup +_repair_scratch_fs >> $seqres.full + +# success, all done +status=0 +exit diff --git a/tests/xfs/240.out b/tests/xfs/240.out new file mode 100644 index 0000000..1a22e8a --- /dev/null +++ b/tests/xfs/240.out @@ -0,0 +1,12 @@ +QA output created by 240 +Format and mount +Create the original files +Compare files +1886e67cf8783e89ce6ddc5bb09a3944 SCRATCH_MNT/test-240/file1 +1886e67cf8783e89ce6ddc5bb09a3944 SCRATCH_MNT/test-240/file2 +CoW and unmount +fdatasync: Input/output error +Compare files +1886e67cf8783e89ce6ddc5bb09a3944 SCRATCH_MNT/test-240/file1 +d94b0ab13385aba594411c174b1cc13c SCRATCH_MNT/test-240/file2 +Check for damage diff --git a/tests/xfs/241 b/tests/xfs/241 new file mode 100755 index 0000000..090f913 --- /dev/null +++ b/tests/xfs/241 @@ -0,0 +1,100 @@ +#! /bin/bash +# FS QA Test No. 241 +# +# Test AIO CoW behavior. +# +#----------------------------------------------------------------------- +# Copyright (c) 2016, Oracle and/or its affiliates. All Rights Reserved. +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License as +# published by the Free Software Foundation. +# +# This program is distributed in the hope that it would be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write the Free Software Foundation, +# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA +#----------------------------------------------------------------------- + +seq=`basename $0` +seqres=$RESULT_DIR/$seq +echo "QA output created by $seq" + +here=`pwd` +tmp=/tmp/$$ +status=1 # failure is the default! +trap "_cleanup; exit \$status" 0 1 2 3 15 + +_cleanup() +{ + cd / + rm -rf $tmp.* $TEST_DIR/moo +} + +# get standard environment, filters and checks +. ./common/rc +. ./common/filter +. ./common/reflink + +# real QA test starts here +_supported_os Linux +_supported_fs xfs +_require_scratch_reflink +_require_cp_reflink +_require_xfs_io_command "cowextsize" +_require_test_program "aio-dio-regress/aiocp" +AIO_TEST="src/aio-dio-regress/aiocp" +_require_odirect + +rm -f $seqres.full + + +echo "Format and mount" +_scratch_mkfs > $seqres.full 2>&1 +_scratch_mount >> $seqres.full 2>&1 + +testdir=$SCRATCH_MNT/test-$seq +mkdir $testdir + +blksz=65536 +nr=640 +bufnr=128 +filesize=$((blksz * nr)) +bufsize=$((blksz * bufnr)) +filesize=$filesize +bufsize=$bufsize + +_require_fs_space $SCRATCH_MNT $((filesize / 1024 * 3 * 5 / 4)) + +echo "Create the original files" +$XFS_IO_PROG -c "cowextsize $((bufsize * 2))" $testdir +$XFS_IO_PROG -f -c "pwrite -S 0x61 -b $bufsize 0 $filesize" $testdir/file1 >> $seqres.full +_cp_reflink $testdir/file1 $testdir/file2 >> $seqres.full +_scratch_remount + +echo "Compare files" +md5sum $testdir/file1 | _filter_scratch +md5sum $testdir/file2 | _filter_scratch + +echo "CoW and unmount" +$XFS_IO_PROG -f -c "pwrite -S 0x63 $bufsize 1" $testdir/file2 >> $seqres.full +$XFS_IO_PROG -f -c "pwrite -S 0x63 -b $bufsize 0 $filesize" $TEST_DIR/moo >> $seqres.full +sync +$AIO_TEST -b $bufsize $TEST_DIR/moo $testdir/file2 >> $seqres.full +_scratch_remount + +echo "Compare files" +md5sum $testdir/file1 | _filter_scratch +md5sum $testdir/file2 | _filter_scratch + +echo "Check for damage" +umount $SCRATCH_MNT +_repair_scratch_fs >> $seqres.full + +# success, all done +status=0 +exit diff --git a/tests/xfs/241.out b/tests/xfs/241.out new file mode 100644 index 0000000..a7e7df2 --- /dev/null +++ b/tests/xfs/241.out @@ -0,0 +1,11 @@ +QA output created by 241 +Format and mount +Create the original files +Compare files +1886e67cf8783e89ce6ddc5bb09a3944 SCRATCH_MNT/test-241/file1 +1886e67cf8783e89ce6ddc5bb09a3944 SCRATCH_MNT/test-241/file2 +CoW and unmount +Compare files +1886e67cf8783e89ce6ddc5bb09a3944 SCRATCH_MNT/test-241/file1 +7a4d22297e80ff3c92cb1b3e4566d234 SCRATCH_MNT/test-241/file2 +Check for damage diff --git a/tests/xfs/group b/tests/xfs/group index 1d08065..c0ce1f4 100644 --- a/tests/xfs/group +++ b/tests/xfs/group @@ -234,7 +234,11 @@ 234 auto quick rmap 235 fuzzers rmap 236 auto quick rmap +237 auto quick clone 238 auto quick metadata ioctl +239 auto quick clone +240 auto quick clone +241 auto quick clone 242 auto quick prealloc 244 auto quota quick 250 auto quick rw prealloc metadata From darrick.wong@oracle.com Thu Feb 11 17:42:35 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay1.corp.sgi.com [137.38.102.111]) by oss.sgi.com (Postfix) with ESMTP id 212137FB5 for ; Thu, 11 Feb 2016 17:42:35 -0600 (CST) Received: from cuda.sgi.com (cuda2.sgi.com [192.48.176.25]) by relay1.corp.sgi.com (Postfix) with ESMTP id 03F5E8F804B for ; Thu, 11 Feb 2016 15:42:34 -0800 (PST) X-ASG-Debug-ID: 1455234151-04cbb043318a0d0001-NocioJ Received: from aserp1040.oracle.com (aserp1040.oracle.com [141.146.126.69]) by cuda.sgi.com with ESMTP id CRi1f3HZIDoI5iba (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO) for ; Thu, 11 Feb 2016 15:42:32 -0800 (PST) X-Barracuda-Envelope-From: darrick.wong@oracle.com X-Barracuda-Apparent-Source-IP: 141.146.126.69 Received: from userv0022.oracle.com (userv0022.oracle.com [156.151.31.74]) by aserp1040.oracle.com (Sentrion-MTA-4.3.2/Sentrion-MTA-4.3.2) with ESMTP id u1BNgUMD025412 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 11 Feb 2016 23:42:31 GMT Received: from aserv0122.oracle.com (aserv0122.oracle.com [141.146.126.236]) by userv0022.oracle.com (8.14.4/8.13.8) with ESMTP id u1BNgUxF029953 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=FAIL); Thu, 11 Feb 2016 23:42:30 GMT Received: from abhmp0007.oracle.com (abhmp0007.oracle.com [141.146.116.13]) by aserv0122.oracle.com (8.13.8/8.13.8) with ESMTP id u1BNgUb6027716; Thu, 11 Feb 2016 23:42:30 GMT Received: from localhost (/10.145.178.207) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Thu, 11 Feb 2016 15:42:29 -0800 Subject: [PATCH 28/32] xfs: test xfs_getbmapx behavior with shared extents From: "Darrick J. Wong" X-ASG-Orig-Subj: [PATCH 28/32] xfs: test xfs_getbmapx behavior with shared extents To: david@fromorbit.com, darrick.wong@oracle.com Cc: linux-btrfs@vger.kernel.org, fstests@vger.kernel.org, xfs@oss.sgi.com Date: Thu, 11 Feb 2016 15:42:28 -0800 Message-ID: <20160211234228.2202.88430.stgit@birch.djwong.org> In-Reply-To: <20160211233916.2202.40961.stgit@birch.djwong.org> References: <20160211233916.2202.40961.stgit@birch.djwong.org> User-Agent: StGit/0.17.1-dirty MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit X-Source-IP: userv0022.oracle.com [156.151.31.74] X-Barracuda-Connect: aserp1040.oracle.com[141.146.126.69] X-Barracuda-Start-Time: 1455234152 X-Barracuda-Encrypted: ECDHE-RSA-AES256-GCM-SHA384 X-Barracuda-URL: https://192.48.176.25:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-BRTS-Status: 1 X-Barracuda-Spam-Score: 0.00 X-Barracuda-Spam-Status: No, SCORE=0.00 using per-user scores of TAG_LEVEL=1000.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.7 tests=BSF_SC0_MISMATCH_TO, UNPARSEABLE_RELAY X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.3.26959 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 0.00 BSF_SC0_MISMATCH_TO Envelope rcpt doesn't match header 0.00 UNPARSEABLE_RELAY Informational: message has unparseable relay lines Make sure that xfs_getbmapx behaves properly w.r.t. shared extents and CoW fork reporting. Signed-off-by: Darrick J. Wong --- common/rc | 19 ++++++ tests/xfs/243 | 165 +++++++++++++++++++++++++++++++++++++++++++++++++++++ tests/xfs/243.out | 26 ++++++++ tests/xfs/245 | 95 +++++++++++++++++++++++++++++++ tests/xfs/245.out | 12 ++++ tests/xfs/246 | 65 +++++++++++++++++++++ tests/xfs/246.out | 6 ++ tests/xfs/group | 3 + 8 files changed, 391 insertions(+) create mode 100755 tests/xfs/243 create mode 100644 tests/xfs/243.out create mode 100755 tests/xfs/245 create mode 100644 tests/xfs/245.out create mode 100755 tests/xfs/246 create mode 100644 tests/xfs/246.out diff --git a/common/rc b/common/rc index 7e83d6e..52c4a36 100644 --- a/common/rc +++ b/common/rc @@ -3075,6 +3075,25 @@ _require_xfs_scratch_rmapbt() _scratch_unmount } +_xfs_bmapx_find() { + case "$1" in + "attr") + param="a" + ;; + "cow") + param="c" + ;; + *) + param="e" + ;; + esac + shift + file="$1" + shift + + "$XFS_IO_PROG" -c "bmap -${param}lpv" "$file" | grep -c "$@" +} + _get_total_inode() { if [ -z "$1" ]; then diff --git a/tests/xfs/243 b/tests/xfs/243 new file mode 100755 index 0000000..629173e --- /dev/null +++ b/tests/xfs/243 @@ -0,0 +1,165 @@ +#! /bin/bash +# FS QA Test No. 243 +# +# Ensuring that copy on write in buffered mode works when the CoW +# range originally covers multiple extents, some unwritten, some not. +# - Set cowextsize hint. +# - Create a file with the following repeating sequence of blocks: +# 1. reflinked +# 2. unwritten +# 3. hole +# 4. regular block +# 5. delalloc +# - CoW across the halfway mark, starting with the unwritten extent. +# - Check that the files are now different where we say they're different. +# +#----------------------------------------------------------------------- +# Copyright (c) 2016, Oracle and/or its affiliates. All Rights Reserved. +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License as +# published by the Free Software Foundation. +# +# This program is distributed in the hope that it would be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write the Free Software Foundation, +# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA +#----------------------------------------------------------------------- + +seq=`basename $0` +seqres=$RESULT_DIR/$seq +echo "QA output created by $seq" + +here=`pwd` +tmp=/tmp/$$ +status=1 # failure is the default! +trap "_cleanup; exit \$status" 0 1 2 3 15 + +_cleanup() +{ + cd / + rm -rf $tmp.* +} + +# get standard environment, filters and checks +. ./common/rc +. ./common/filter +. ./common/reflink + +# real QA test starts here +_supported_os Linux +_supported_fs xfs +_require_scratch_reflink +_require_xfs_io_command "falloc" +_require_xfs_io_command "fpunch" +_require_cp_reflink + +rm -f $seqres.full + +echo "Format and mount" +_scratch_mkfs > $seqres.full 2>&1 +_scratch_mount >> $seqres.full 2>&1 + +testdir=$SCRATCH_MNT/test-$seq +mkdir $testdir + +echo "Create the original files" +blksz=65536 +nr=64 +filesize=$((blksz * nr)) + +$XFS_IO_PROG -c "cowextsize $((blksz * 16))" $testdir >> $seqres.full +_pwrite_byte 0x61 0 $filesize $testdir/file1 >> $seqres.full +$XFS_IO_PROG -f -c "truncate $filesize" $testdir/file3 >> $seqres.full +# 0 blocks are reflinked +seq 0 5 $nr | while read f; do + _reflink_range $testdir/file1 $((blksz * f)) $testdir/file3 $((blksz * f)) $blksz >> $seqres.full + _pwrite_byte 0x61 $((blksz * f)) $blksz $testdir/file3.chk >> $seqres.full +done +# 1 blocks are unwritten +seq 1 5 $nr | while read f; do + $XFS_IO_PROG -f -c "falloc $((blksz * f)) $blksz" $testdir/file3 >> $seqres.full + _pwrite_byte 0x00 $((blksz * f)) $blksz $testdir/file3.chk >> $seqres.full +done +# 2 blocks are holes +seq 2 5 $nr | while read f; do + _pwrite_byte 0x00 $((blksz * f)) $blksz $testdir/file3.chk >> $seqres.full +done +# 3 blocks are regular +seq 3 5 $nr | while read f; do + _pwrite_byte 0x71 $((blksz * f)) $blksz $testdir/file3 >> $seqres.full + _pwrite_byte 0x71 $((blksz * f)) $blksz $testdir/file3.chk >> $seqres.full +done +sync +# 4 blocks are delalloc (do later) +seq 4 5 $nr | while read f; do + _pwrite_byte 0x62 $((blksz * f)) $blksz $testdir/file3 >> $seqres.full + _pwrite_byte 0x62 $((blksz * f)) $blksz $testdir/file3.chk >> $seqres.full +done + +# 10 blocks are cow'd +seq 0 10 $((nr/2)) | while read f; do + _pwrite_byte 0x61 $((blksz * f)) 1 $testdir/file3 >> $seqres.full + _pwrite_byte 0x61 $((blksz * f)) 1 $testdir/file3.chk >> $seqres.full +done + +echo "Compare files" +md5sum $testdir/file1 | _filter_scratch +md5sum $testdir/file3 | _filter_scratch +md5sum $testdir/file3.chk | _filter_scratch + +echo "Dump extents" +$XFS_IO_PROG -c "cowextsize" $testdir/file3 | _filter_scratch +echo "Delayed allocation CoW extents:" +test $(_xfs_bmapx_find cow $testdir/file3 delalloc) -gt 0 || \ + echo "Expected to find a delalloc CoW extent" +echo "Shared data extents:" +test $(_xfs_bmapx_find data $testdir/file3 '100000$') -gt 0 || \ + echo "Expected to find a shared data extent" +echo "Unwritten data extents:" +test $(_xfs_bmapx_find data $testdir/file3 '10000$') -gt 0 || \ + echo "Expected to find an unwritten data extent" +echo "Hole data extents:" +test $(_xfs_bmapx_find data $testdir/file3 hole) -gt 0 || \ + echo "Expected to find a hole data extent" +echo "Regular data extents:" +test $(_xfs_bmapx_find data $testdir/file3 '000000$') -gt 0 || \ + echo "Expected to find a regular data extent" + +sync + +echo "Dump extents after sync" +$XFS_IO_PROG -c "cowextsize" $testdir/file3 | _filter_scratch +echo "Delayed allocation CoW extents:" +test $(_xfs_bmapx_find cow $testdir/file3 -v hole ) -gt 0 || \ + echo "Expected to find a regular CoW extent" +echo "Real CoW extents:" +test $(_xfs_bmapx_find cow $testdir/file3 delalloc ) -eq 0 || \ + echo "Expected to find zero delalloc CoW extent" +echo "Shared data extents:" +test $(_xfs_bmapx_find data $testdir/file3 '100000$') -gt 0 || \ + echo "Expected to find a shared data extent" +echo "Unwritten data extents:" +test $(_xfs_bmapx_find data $testdir/file3 '10000$') -gt 0 || \ + echo "Expected to find an unwritten data extent" +echo "Hole data extents:" +test $(_xfs_bmapx_find data $testdir/file3 hole) -gt 0 || \ + echo "Expected to find a hole data extent" +echo "Regular data extents:" +test $(_xfs_bmapx_find data $testdir/file3 '000000$') -gt 0 || \ + echo "Expected to find a regular data extent" + +_scratch_remount + +echo "Compare files" +md5sum $testdir/file1 | _filter_scratch +md5sum $testdir/file3 | _filter_scratch +md5sum $testdir/file3.chk | _filter_scratch + +# success, all done +status=0 +exit diff --git a/tests/xfs/243.out b/tests/xfs/243.out new file mode 100644 index 0000000..e6e5326 --- /dev/null +++ b/tests/xfs/243.out @@ -0,0 +1,26 @@ +QA output created by 243 +Format and mount +Create the original files +Compare files +bdbcf02ee0aa977795a79d25fcfdccb1 SCRATCH_MNT/test-243/file1 +d0fda5bf5d4fd70904ef1c1c56db28d0 SCRATCH_MNT/test-243/file3 +d0fda5bf5d4fd70904ef1c1c56db28d0 SCRATCH_MNT/test-243/file3.chk +Dump extents +[1048576] SCRATCH_MNT/test-243/file3 +Delayed allocation CoW extents: +Shared data extents: +Unwritten data extents: +Hole data extents: +Regular data extents: +Dump extents after sync +[1048576] SCRATCH_MNT/test-243/file3 +Delayed allocation CoW extents: +Real CoW extents: +Shared data extents: +Unwritten data extents: +Hole data extents: +Regular data extents: +Compare files +bdbcf02ee0aa977795a79d25fcfdccb1 SCRATCH_MNT/test-243/file1 +d0fda5bf5d4fd70904ef1c1c56db28d0 SCRATCH_MNT/test-243/file3 +d0fda5bf5d4fd70904ef1c1c56db28d0 SCRATCH_MNT/test-243/file3.chk diff --git a/tests/xfs/245 b/tests/xfs/245 new file mode 100755 index 0000000..6da701d --- /dev/null +++ b/tests/xfs/245 @@ -0,0 +1,95 @@ +#! /bin/bash +# FS QA Test No. 245 +# +# Make sure that reflink deals with extents going beyond EOF. +# - fallocate 256k in file1 +# - pwrite 252-257k to cause it to speculatively prealloc file1 +# - reflink file1 to file2 +# - compare file[12] +# +#----------------------------------------------------------------------- +# Copyright (c) 2016, Oracle and/or its affiliates. All Rights Reserved. +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License as +# published by the Free Software Foundation. +# +# This program is distributed in the hope that it would be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write the Free Software Foundation, +# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA +#----------------------------------------------------------------------- + +seq=`basename $0` +seqres=$RESULT_DIR/$seq +echo "QA output created by $seq" + +here=`pwd` +tmp=/tmp/$$ +status=1 # failure is the default! +trap "_cleanup; exit \$status" 0 1 2 3 15 + +_cleanup() +{ + cd / + rm -rf $tmp.* +} + +# get standard environment, filters and checks +. ./common/rc +. ./common/filter +. ./common/reflink + +# real QA test starts here +_supported_os Linux +_supported_fs xfs +_require_scratch_reflink +_require_xfs_io_command "falloc" +_require_cp_reflink + +rm -f $seqres.full + +echo "Format and mount" +_scratch_mkfs > $seqres.full 2>&1 +_scratch_mount >> $seqres.full 2>&1 + +testdir=$SCRATCH_MNT/test-$seq +mkdir $testdir + +echo "Create the original files" +$XFS_IO_PROG -f -c "falloc 0 256k" -c "pwrite 252k 6k" $testdir/file1 >> $seqres.full +_scratch_remount +_cp_reflink $testdir/file1 $testdir/file2 >> $seqres.full + +echo "Compare files" +md5sum $testdir/file1 | _filter_scratch +md5sum $testdir/file2 | _filter_scratch + +echo "Unwritten data extents" +test $(_xfs_bmapx_find data $testdir/file1 '10000$') -gt 0 || \ + echo "Expected to find an unwritten file1 extent" +echo "Shared data extents" +test $(_xfs_bmapx_find data $testdir/file1 '100000$') -gt 0 || \ + echo "Expected to find a shared data extent" + +echo "Hole data extents" +test $(_xfs_bmapx_find data $testdir/file2 'hole') -gt 0 || \ + echo "Expected to find a hole data extent" +echo "Shared data extents" +test $(_xfs_bmapx_find data $testdir/file2 '100000$') -gt 0 || \ + echo "Expected to find a shared data extent" + +echo "Hole cow extents" +test $(_xfs_bmapx_find cow $testdir/file1 'hole') -gt 0 || \ + echo "Expected to find a hole cow extent" +echo "Hole cow extents" +test $(_xfs_bmapx_find cow $testdir/file2 'hole') -gt 0 || \ + echo "Expected to find a hole cow extent" + +# success, all done +status=0 +exit diff --git a/tests/xfs/245.out b/tests/xfs/245.out new file mode 100644 index 0000000..9a5fa5f --- /dev/null +++ b/tests/xfs/245.out @@ -0,0 +1,12 @@ +QA output created by 245 +Format and mount +Create the original files +Compare files +b0b91e1a18165fcd6549f2f5f3ef4823 SCRATCH_MNT/test-245/file1 +b0b91e1a18165fcd6549f2f5f3ef4823 SCRATCH_MNT/test-245/file2 +Unwritten data extents +Shared data extents +Hole data extents +Shared data extents +Hole cow extents +Hole cow extents diff --git a/tests/xfs/246 b/tests/xfs/246 new file mode 100755 index 0000000..13b0c98 --- /dev/null +++ b/tests/xfs/246 @@ -0,0 +1,65 @@ +#! /bin/bash +# FS QA Test No. 246 +# +# Create an empty file and try to query the (nonexistant) CoW fork. +# +#----------------------------------------------------------------------- +# Copyright (c) 2016, Oracle and/or its affiliates. All Rights Reserved. +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License as +# published by the Free Software Foundation. +# +# This program is distributed in the hope that it would be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write the Free Software Foundation, +# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA +#----------------------------------------------------------------------- + +seq=`basename $0` +seqres=$RESULT_DIR/$seq +echo "QA output created by $seq" + +here=`pwd` +tmp=/tmp/$$ +status=1 # failure is the default! +trap "_cleanup; exit \$status" 0 1 2 3 15 + +_cleanup() +{ + cd / + rm -rf $tmp.* +} + +# get standard environment, filters and checks +. ./common/rc +. ./common/filter + +# real QA test starts here +_supported_os Linux +_supported_fs xfs + +rm -f $seqres.full + +echo "Format and mount" +_scratch_mkfs > $seqres.full 2>&1 +_scratch_mount >> $seqres.full 2>&1 + +testdir=$SCRATCH_MNT/test-$seq +mkdir $testdir + +echo "Create the original files" +touch $testdir/file1 +sync + +echo "Dump extents after sync" +echo "Hole CoW extents:" +$XFS_IO_PROG -c "bmap -clpv" $testdir/file1 | _filter_scratch + +# success, all done +status=0 +exit diff --git a/tests/xfs/246.out b/tests/xfs/246.out new file mode 100644 index 0000000..c543e74 --- /dev/null +++ b/tests/xfs/246.out @@ -0,0 +1,6 @@ +QA output created by 246 +Format and mount +Create the original files +Dump extents after sync +Hole CoW extents: +SCRATCH_MNT/test-246/file1: no extents diff --git a/tests/xfs/group b/tests/xfs/group index c0ce1f4..f6c7db8 100644 --- a/tests/xfs/group +++ b/tests/xfs/group @@ -240,7 +240,10 @@ 240 auto quick clone 241 auto quick clone 242 auto quick prealloc +243 auto quick clone 244 auto quota quick +245 auto quick clone +246 auto quick clone 250 auto quick rw prealloc metadata 252 auto quick prealloc 253 auto quick From darrick.wong@oracle.com Thu Feb 11 17:42:41 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay1.corp.sgi.com [137.38.102.111]) by oss.sgi.com (Postfix) with ESMTP id EBBFF7FC8 for ; Thu, 11 Feb 2016 17:42:41 -0600 (CST) Received: from cuda.sgi.com (cuda1.sgi.com [192.48.157.11]) by relay1.corp.sgi.com (Postfix) with ESMTP id BAA388F8033 for ; Thu, 11 Feb 2016 15:42:41 -0800 (PST) X-ASG-Debug-ID: 1455234158-04bdf066ec73980001-NocioJ Received: from aserp1040.oracle.com (aserp1040.oracle.com [141.146.126.69]) by cuda.sgi.com with ESMTP id BWTw1uhCxgzHE8sP (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO) for ; Thu, 11 Feb 2016 15:42:38 -0800 (PST) X-Barracuda-Envelope-From: darrick.wong@oracle.com X-Barracuda-Apparent-Source-IP: 141.146.126.69 Received: from userv0022.oracle.com (userv0022.oracle.com [156.151.31.74]) by aserp1040.oracle.com (Sentrion-MTA-4.3.2/Sentrion-MTA-4.3.2) with ESMTP id u1BNgbEm025509 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 11 Feb 2016 23:42:37 GMT Received: from userv0121.oracle.com (userv0121.oracle.com [156.151.31.72]) by userv0022.oracle.com (8.14.4/8.13.8) with ESMTP id u1BNgbXp030301 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=FAIL); Thu, 11 Feb 2016 23:42:37 GMT Received: from abhmp0010.oracle.com (abhmp0010.oracle.com [141.146.116.16]) by userv0121.oracle.com (8.13.8/8.13.8) with ESMTP id u1BNgaid007128; Thu, 11 Feb 2016 23:42:36 GMT Received: from localhost (/10.145.178.207) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Thu, 11 Feb 2016 15:42:36 -0800 Subject: [PATCH 29/32] reflink: test reflink+cow+enospc all at the same time From: "Darrick J. Wong" X-ASG-Orig-Subj: [PATCH 29/32] reflink: test reflink+cow+enospc all at the same time To: david@fromorbit.com, darrick.wong@oracle.com Cc: linux-btrfs@vger.kernel.org, fstests@vger.kernel.org, xfs@oss.sgi.com Date: Thu, 11 Feb 2016 15:42:34 -0800 Message-ID: <20160211234234.2202.62281.stgit@birch.djwong.org> In-Reply-To: <20160211233916.2202.40961.stgit@birch.djwong.org> References: <20160211233916.2202.40961.stgit@birch.djwong.org> User-Agent: StGit/0.17.1-dirty MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit X-Source-IP: userv0022.oracle.com [156.151.31.74] X-Barracuda-Connect: aserp1040.oracle.com[141.146.126.69] X-Barracuda-Start-Time: 1455234158 X-Barracuda-Encrypted: ECDHE-RSA-AES256-GCM-SHA384 X-Barracuda-URL: https://192.48.157.11:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-BRTS-Status: 1 X-Barracuda-Spam-Score: 0.00 X-Barracuda-Spam-Status: No, SCORE=0.00 using per-user scores of TAG_LEVEL=1000.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.7 tests=BSF_SC0_MISMATCH_TO, UNPARSEABLE_RELAY X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.3.26959 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 0.00 BSF_SC0_MISMATCH_TO Envelope rcpt doesn't match header 0.00 UNPARSEABLE_RELAY Informational: message has unparseable relay lines Set up an impossibly small filesystem and try to reflink and rewrite a file on it to see what happens when we ENOSPC. Basically generic/16[67] but with a constrained fs size. Signed-off-by: Darrick J. Wong --- tests/generic/166 | 6 ++- tests/generic/167 | 6 ++- tests/generic/333 | 99 +++++++++++++++++++++++++++++++++++++++++++++++++ tests/generic/333.out | 4 ++ tests/generic/334 | 98 +++++++++++++++++++++++++++++++++++++++++++++++++ tests/generic/334.out | 4 ++ tests/generic/group | 2 + 7 files changed, 217 insertions(+), 2 deletions(-) create mode 100755 tests/generic/333 create mode 100644 tests/generic/333.out create mode 100755 tests/generic/334 create mode 100644 tests/generic/334.out diff --git a/tests/generic/166 b/tests/generic/166 index 9b177be..a1e4ff4 100755 --- a/tests/generic/166 +++ b/tests/generic/166 @@ -69,7 +69,11 @@ _scratch_remount snappy() { n=0 while [ ! -e $testdir/finished ]; do - _cp_reflink $testdir/file1 $testdir/snap_$n || break + out="$(_cp_reflink $testdir/file1 $testdir/snap_$n 2>&1)" + res=$? + echo "$out" | grep -q "No space left" && break + test -n "$out" && echo "$out" + test $res -ne 0 && break n=$((n + 1)) done } diff --git a/tests/generic/167 b/tests/generic/167 index ef8e75b..76969c1 100755 --- a/tests/generic/167 +++ b/tests/generic/167 @@ -68,7 +68,11 @@ _scratch_remount snappy() { n=0 while [ ! -e $testdir/finished ]; do - _cp_reflink $testdir/file1 $testdir/snap_$n || break + out="$(_cp_reflink $testdir/file1 $testdir/snap_$n 2>&1)" + res=$? + echo "$out" | grep -q "No space left" && break + test -n "$out" && echo "$out" + test $res -ne 0 && break n=$((n + 1)) done } diff --git a/tests/generic/333 b/tests/generic/333 new file mode 100755 index 0000000..b8a1ea8 --- /dev/null +++ b/tests/generic/333 @@ -0,0 +1,99 @@ +#! /bin/bash +# FS QA Test No. 333 +# +# Test for races or FS corruption when trying to hit ENOSPC while DIO writing +# to a file that's also the source of a reflink operation. +# +#----------------------------------------------------------------------- +# Copyright (c) 2016 Oracle, Inc. All Rights Reserved. +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License as +# published by the Free Software Foundation. +# +# This program is distributed in the hope that it would be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write the Free Software Foundation, +# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA +#----------------------------------------------------------------------- +# + +seq=`basename $0` +seqres=$RESULT_DIR/$seq +echo "QA output created by $seq" + +here=`pwd` +tmp=/tmp/$$ +status=1 # failure is the default! +trap "_cleanup; exit \$status" 0 1 2 3 7 15 + +_cleanup() +{ + cd / + rm -rf $tmp.* + wait +} + +# get standard environment, filters and checks +. ./common/rc +. ./common/filter +. ./common/reflink + +# real QA test starts here +_supported_os Linux +_require_scratch_reflink +_require_cp_reflink +_require_odirect + +echo "Format and mount" +_scratch_mkfs_sized $((400 * 1048576)) > $seqres.full 2>&1 +_scratch_mount >> $seqres.full 2>&1 + +testdir=$SCRATCH_MNT/test-$seq +mkdir $testdir + +loops=1024 +nr_loops=$((loops - 1)) +blksz=65536 + +echo "Initialize file" +echo > $seqres.full +_pwrite_byte 0x61 0 $((loops * blksz)) $testdir/file1 >> $seqres.full +_scratch_remount + +# Snapshot creator... +snappy() { + n=0 + while [ ! -e $testdir/finished ]; do + out="$(_cp_reflink $testdir/file1 $testdir/snap_$n 2>&1)" + res=$? + echo $out | grep -q "No space left" && break + test -n "$out" && echo $out + test $res -ne 0 && break + n=$((n + 1)) + done + touch $testdir/abort +} + +echo "Snapshot a file undergoing directio rewrite" +snappy & +seq 1 1000 | while read j; do + seq $nr_loops -1 0 | while read i; do + out="$(_pwrite_byte 0x63 $((i * blksz)) $blksz -d $testdir/file1 2>&1)" + echo $out >> $seqres.full + echo $out | grep -q "No space left" && touch $testdir/abort + echo $out | grep -qi "error" && touch $testdir/abort + test -e $testdir/abort && break + done + test -e $testdir/abort && break +done +touch $testdir/finished +wait + +# success, all done +status=0 +exit diff --git a/tests/generic/333.out b/tests/generic/333.out new file mode 100644 index 0000000..3354c98 --- /dev/null +++ b/tests/generic/333.out @@ -0,0 +1,4 @@ +QA output created by 333 +Format and mount +Initialize file +Snapshot a file undergoing directio rewrite diff --git a/tests/generic/334 b/tests/generic/334 new file mode 100755 index 0000000..89601be --- /dev/null +++ b/tests/generic/334 @@ -0,0 +1,98 @@ +#! /bin/bash +# FS QA Test No. 334 +# +# Test for races or FS corruption when trying to hit ENOSPC while writing +# to a file that's also the source of a reflink operation. +# +#----------------------------------------------------------------------- +# Copyright (c) 2016 Oracle, Inc. All Rights Reserved. +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License as +# published by the Free Software Foundation. +# +# This program is distributed in the hope that it would be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write the Free Software Foundation, +# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA +#----------------------------------------------------------------------- +# + +seq=`basename $0` +seqres=$RESULT_DIR/$seq +echo "QA output created by $seq" + +here=`pwd` +tmp=/tmp/$$ +status=1 # failure is the default! +trap "_cleanup; exit \$status" 0 1 2 3 7 15 + +_cleanup() +{ + cd / + rm -rf $tmp.* + wait +} + +# get standard environment, filters and checks +. ./common/rc +. ./common/filter +. ./common/reflink + +# real QA test starts here +_supported_os Linux +_require_scratch_reflink +_require_cp_reflink + +echo "Format and mount" +_scratch_mkfs_sized $((400 * 1048576)) > $seqres.full 2>&1 +_scratch_mount >> $seqres.full 2>&1 + +testdir=$SCRATCH_MNT/test-$seq +mkdir $testdir + +loops=1024 +nr_loops=$((loops - 1)) +blksz=65536 + +echo "Initialize file" +echo > $seqres.full +_pwrite_byte 0x61 0 $((loops * blksz)) $testdir/file1 >> $seqres.full +_scratch_remount + +# Snapshot creator... +snappy() { + n=0 + while [ ! -e $testdir/finished ]; do + out="$(_cp_reflink $testdir/file1 $testdir/snap_$n 2>&1)" + res=$? + echo $out | grep -q "No space left" && break + test -n "$out" && echo $out + test $res -ne 0 && break + n=$((n + 1)) + done + touch $testdir/abort +} + +echo "Snapshot a file undergoing buffered rewrite" +snappy & +seq 1 1000 | while read j; do + seq $nr_loops -1 0 | while read i; do + out="$(_pwrite_byte 0x63 $((i * blksz)) $blksz $testdir/file1 2>&1)" + echo $out >> $seqres.full + echo $out | grep -q "No space left" && touch $testdir/abort + echo $out | grep -qi "error" && touch $testdir/abort + test -e $testdir/abort && break + done + test -e $testdir/abort && break +done +touch $testdir/finished +wait + +# success, all done +status=0 +exit diff --git a/tests/generic/334.out b/tests/generic/334.out new file mode 100644 index 0000000..c2c40fd --- /dev/null +++ b/tests/generic/334.out @@ -0,0 +1,4 @@ +QA output created by 334 +Format and mount +Initialize file +Snapshot a file undergoing buffered rewrite diff --git a/tests/generic/group b/tests/generic/group index e7ed475..e3c4e8a 100644 --- a/tests/generic/group +++ b/tests/generic/group @@ -335,3 +335,5 @@ 330 auto quick clone 331 auto quick clone 332 auto quick clone +333 auto quick clone +334 auto quick clone From darrick.wong@oracle.com Thu Feb 11 17:42:47 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay3.corp.sgi.com [198.149.34.15]) by oss.sgi.com (Postfix) with ESMTP id 7E70F7FE0 for ; Thu, 11 Feb 2016 17:42:47 -0600 (CST) Received: from cuda.sgi.com (cuda1.sgi.com [192.48.157.11]) by relay3.corp.sgi.com (Postfix) with ESMTP id 1A9D7AC003 for ; Thu, 11 Feb 2016 15:42:47 -0800 (PST) X-ASG-Debug-ID: 1455234164-04bdf066ea73980001-NocioJ Received: from userp1040.oracle.com (userp1040.oracle.com [156.151.31.81]) by cuda.sgi.com with ESMTP id BwrM9efyebJPio1z (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO) for ; Thu, 11 Feb 2016 15:42:45 -0800 (PST) X-Barracuda-Envelope-From: darrick.wong@oracle.com X-Barracuda-Apparent-Source-IP: 156.151.31.81 Received: from userv0021.oracle.com (userv0021.oracle.com [156.151.31.71]) by userp1040.oracle.com (Sentrion-MTA-4.3.2/Sentrion-MTA-4.3.2) with ESMTP id u1BNghZJ002304 (version=TLSv1 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Thu, 11 Feb 2016 23:42:43 GMT Received: from aserv0121.oracle.com (aserv0121.oracle.com [141.146.126.235]) by userv0021.oracle.com (8.13.8/8.13.8) with ESMTP id u1BNgh3l018714 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=FAIL); Thu, 11 Feb 2016 23:42:43 GMT Received: from abhmp0017.oracle.com (abhmp0017.oracle.com [141.146.116.23]) by aserv0121.oracle.com (8.13.8/8.13.8) with ESMTP id u1BNggWF027044; Thu, 11 Feb 2016 23:42:43 GMT Received: from localhost (/10.145.178.207) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Thu, 11 Feb 2016 15:42:42 -0800 Subject: [PATCH 30/32] xfs: ensure that we don't crash when freeing the ag reservations on a ro mount From: "Darrick J. Wong" X-ASG-Orig-Subj: [PATCH 30/32] xfs: ensure that we don't crash when freeing the ag reservations on a ro mount To: david@fromorbit.com, darrick.wong@oracle.com Cc: linux-btrfs@vger.kernel.org, fstests@vger.kernel.org, xfs@oss.sgi.com Date: Thu, 11 Feb 2016 15:42:41 -0800 Message-ID: <20160211234241.2202.1427.stgit@birch.djwong.org> In-Reply-To: <20160211233916.2202.40961.stgit@birch.djwong.org> References: <20160211233916.2202.40961.stgit@birch.djwong.org> User-Agent: StGit/0.17.1-dirty MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit X-Source-IP: userv0021.oracle.com [156.151.31.71] X-Barracuda-Connect: userp1040.oracle.com[156.151.31.81] X-Barracuda-Start-Time: 1455234165 X-Barracuda-Encrypted: ECDHE-RSA-AES256-GCM-SHA384 X-Barracuda-URL: https://192.48.157.11:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-BRTS-Status: 1 X-Barracuda-Spam-Score: 0.00 X-Barracuda-Spam-Status: No, SCORE=0.00 using per-user scores of TAG_LEVEL=1000.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.7 tests=BSF_SC0_MISMATCH_TO, UNPARSEABLE_RELAY X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.3.26959 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 0.00 BSF_SC0_MISMATCH_TO Envelope rcpt doesn't match header 0.00 UNPARSEABLE_RELAY Informational: message has unparseable relay lines Christoph Hellwig discovered that the kernel crashed trying to free the refcount btree per-ag reservation on a ro mount (because we don't create the reservation except for rw mounts and ro->rw remounts). So, test this to make sure we never do that again. :) Signed-off-by: Darrick J. Wong --- tests/xfs/247 | 57 +++++++++++++++++++++++++++++++++++++++++++++++++++++ tests/xfs/247.out | 2 ++ tests/xfs/group | 1 + 3 files changed, 60 insertions(+) create mode 100755 tests/xfs/247 create mode 100644 tests/xfs/247.out diff --git a/tests/xfs/247 b/tests/xfs/247 new file mode 100755 index 0000000..1581dd3 --- /dev/null +++ b/tests/xfs/247 @@ -0,0 +1,57 @@ +#! /bin/bash +# FS QA Test No. 247 +# +# Mount a reflink/rmap filesystem ro (so the per-AG reservation isn't +# created) and unmount, to ensure that we free correctly. +# +#----------------------------------------------------------------------- +# Copyright (c) 2016, Oracle and/or its affiliates. All Rights Reserved. +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License as +# published by the Free Software Foundation. +# +# This program is distributed in the hope that it would be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write the Free Software Foundation, +# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA +#----------------------------------------------------------------------- + +seq=`basename $0` +seqres=$RESULT_DIR/$seq +echo "QA output created by $seq" + +here=`pwd` +tmp=/tmp/$$ +status=1 # failure is the default! +trap "_cleanup; exit \$status" 0 1 2 3 15 + +_cleanup() +{ + cd / + rm -rf $tmp.* +} + +# get standard environment, filters and checks +. ./common/rc +. ./common/filter +. ./common/reflink + +# real QA test starts here +_supported_os Linux +_supported_fs xfs +_require_scratch_reflink + +rm -f $seqres.full + +echo "Format and mount" +_scratch_mkfs > $seqres.full 2>&1 +_scratch_mount -o ro >> $seqres.full 2>&1 + +# success, all done +status=0 +exit diff --git a/tests/xfs/247.out b/tests/xfs/247.out new file mode 100644 index 0000000..a65574f --- /dev/null +++ b/tests/xfs/247.out @@ -0,0 +1,2 @@ +QA output created by 247 +Format and mount diff --git a/tests/xfs/group b/tests/xfs/group index f6c7db8..6f43c79 100644 --- a/tests/xfs/group +++ b/tests/xfs/group @@ -244,6 +244,7 @@ 244 auto quota quick 245 auto quick clone 246 auto quick clone +247 auto quick clone 250 auto quick rw prealloc metadata 252 auto quick prealloc 253 auto quick From darrick.wong@oracle.com Thu Feb 11 17:42:58 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay1.corp.sgi.com [137.38.102.111]) by oss.sgi.com (Postfix) with ESMTP id B11387FE7 for ; Thu, 11 Feb 2016 17:42:58 -0600 (CST) Received: from cuda.sgi.com (cuda3.sgi.com [192.48.176.15]) by relay1.corp.sgi.com (Postfix) with ESMTP id 9AA778F8033 for ; Thu, 11 Feb 2016 15:42:58 -0800 (PST) X-ASG-Debug-ID: 1455234171-04cb6c1e5972fa0001-NocioJ Received: from aserp1040.oracle.com (aserp1040.oracle.com [141.146.126.69]) by cuda.sgi.com with ESMTP id hbDKx7nCCE27FRCc (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO) for ; Thu, 11 Feb 2016 15:42:51 -0800 (PST) X-Barracuda-Envelope-From: darrick.wong@oracle.com X-Barracuda-Apparent-Source-IP: 141.146.126.69 Received: from aserv0022.oracle.com (aserv0022.oracle.com [141.146.126.234]) by aserp1040.oracle.com (Sentrion-MTA-4.3.2/Sentrion-MTA-4.3.2) with ESMTP id u1BNgoRo025729 (version=TLSv1 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Thu, 11 Feb 2016 23:42:51 GMT Received: from userv0121.oracle.com (userv0121.oracle.com [156.151.31.72]) by aserv0022.oracle.com (8.13.8/8.13.8) with ESMTP id u1BNgoZ0010399 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=FAIL); Thu, 11 Feb 2016 23:42:50 GMT Received: from abhmp0012.oracle.com (abhmp0012.oracle.com [141.146.116.18]) by userv0121.oracle.com (8.13.8/8.13.8) with ESMTP id u1BNgncK007246; Thu, 11 Feb 2016 23:42:49 GMT Received: from localhost (/10.145.178.207) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Thu, 11 Feb 2016 15:42:49 -0800 Subject: [PATCH 31/32] xfs: test source CoW across mixed block types with cowextsz set From: "Darrick J. Wong" X-ASG-Orig-Subj: [PATCH 31/32] xfs: test source CoW across mixed block types with cowextsz set To: david@fromorbit.com, darrick.wong@oracle.com Cc: linux-btrfs@vger.kernel.org, fstests@vger.kernel.org, xfs@oss.sgi.com Date: Thu, 11 Feb 2016 15:42:47 -0800 Message-ID: <20160211234247.2202.84676.stgit@birch.djwong.org> In-Reply-To: <20160211233916.2202.40961.stgit@birch.djwong.org> References: <20160211233916.2202.40961.stgit@birch.djwong.org> User-Agent: StGit/0.17.1-dirty MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit X-Source-IP: aserv0022.oracle.com [141.146.126.234] X-Barracuda-Connect: aserp1040.oracle.com[141.146.126.69] X-Barracuda-Start-Time: 1455234171 X-Barracuda-Encrypted: ECDHE-RSA-AES256-GCM-SHA384 X-Barracuda-URL: https://192.48.176.15:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-BRTS-Status: 1 X-Barracuda-Spam-Score: 0.00 X-Barracuda-Spam-Status: No, SCORE=0.00 using per-user scores of TAG_LEVEL=1000.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.7 tests=BSF_SC0_MISMATCH_TO, UNPARSEABLE_RELAY X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.3.26959 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 0.00 BSF_SC0_MISMATCH_TO Envelope rcpt doesn't match header 0.00 UNPARSEABLE_RELAY Informational: message has unparseable relay lines Ensure that we can CoW the source file when the source file consists of a range of mixed block types and there's a cowextsize hint set. Signed-off-by: Darrick J. Wong --- tests/xfs/248 | 91 ++++++++++++++++++++++++++++++++++++++++++++++++++ tests/xfs/248.out | 12 +++++++ tests/xfs/249 | 92 +++++++++++++++++++++++++++++++++++++++++++++++++++ tests/xfs/249.out | 12 +++++++ tests/xfs/251 | 93 +++++++++++++++++++++++++++++++++++++++++++++++++++ tests/xfs/251.out | 12 +++++++ tests/xfs/254 | 94 ++++++++++++++++++++++++++++++++++++++++++++++++++++ tests/xfs/254.out | 12 +++++++ tests/xfs/255 | 93 +++++++++++++++++++++++++++++++++++++++++++++++++++ tests/xfs/255.out | 12 +++++++ tests/xfs/256 | 94 ++++++++++++++++++++++++++++++++++++++++++++++++++++ tests/xfs/256.out | 12 +++++++ tests/xfs/257 | 95 ++++++++++++++++++++++++++++++++++++++++++++++++++++ tests/xfs/257.out | 12 +++++++ tests/xfs/258 | 96 +++++++++++++++++++++++++++++++++++++++++++++++++++++ tests/xfs/258.out | 12 +++++++ tests/xfs/group | 8 ++++ 17 files changed, 852 insertions(+) create mode 100755 tests/xfs/248 create mode 100644 tests/xfs/248.out create mode 100755 tests/xfs/249 create mode 100644 tests/xfs/249.out create mode 100755 tests/xfs/251 create mode 100644 tests/xfs/251.out create mode 100755 tests/xfs/254 create mode 100644 tests/xfs/254.out create mode 100755 tests/xfs/255 create mode 100644 tests/xfs/255.out create mode 100755 tests/xfs/256 create mode 100644 tests/xfs/256.out create mode 100755 tests/xfs/257 create mode 100644 tests/xfs/257.out create mode 100755 tests/xfs/258 create mode 100644 tests/xfs/258.out diff --git a/tests/xfs/248 b/tests/xfs/248 new file mode 100755 index 0000000..50771a1 --- /dev/null +++ b/tests/xfs/248 @@ -0,0 +1,91 @@ +#! /bin/bash +# FS QA Test No. 248 +# +# Ensuring that copy on write in buffered mode to the source file when the +# CoW range covers regular unshared and regular shared blocks. +# - Set cowextsz. +# - Create two files. +# - Reflink the odd blocks of the first file into the second file. +# - CoW the first file across the halfway mark, starting with the +# regular extent. +# - Check that the files are now different where we say they're different. +# +#----------------------------------------------------------------------- +# Copyright (c) 2016, Oracle and/or its affiliates. All Rights Reserved. +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License as +# published by the Free Software Foundation. +# +# This program is distributed in the hope that it would be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write the Free Software Foundation, +# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA +#----------------------------------------------------------------------- + +seq=`basename $0` +seqres=$RESULT_DIR/$seq +echo "QA output created by $seq" + +here=`pwd` +tmp=/tmp/$$ +status=1 # failure is the default! +trap "_cleanup; exit \$status" 0 1 2 3 15 + +_cleanup() +{ + cd / + rm -rf $tmp.* +} + +# get standard environment, filters and checks +. ./common/rc +. ./common/filter +. ./common/reflink + +# real QA test starts here +_supported_os Linux +_require_scratch_reflink +_require_xfs_io_command "falloc" + +rm -f $seqres.full + +echo "Format and mount" +_scratch_mkfs > $seqres.full 2>&1 +_scratch_mount >> $seqres.full 2>&1 + +testdir=$SCRATCH_MNT/test-$seq +mkdir $testdir + +echo "Create the original files" +blksz=65536 +nr=64 +filesize=$((blksz * nr)) +$XFS_IO_PROG -c "cowextsize $((blksz * 16))" $testdir >> $seqres.full +_sweave_reflink_regular $blksz $nr $testdir/file1 $testdir/file3 >> $seqres.full +_scratch_remount + +echo "Compare files" +md5sum $testdir/file1 | _filter_scratch +md5sum $testdir/file3 | _filter_scratch +md5sum $testdir/file1.chk | _filter_scratch + +echo "CoW across the transition" +cowoff=$((filesize / 4)) +cowsz=$((filesize / 2)) +$XFS_IO_PROG -f -c "pwrite -S 0x63 -b $cowsz $cowoff $cowsz" $testdir/file1 >> $seqres.full +_pwrite_byte 0x63 $cowoff $cowsz $testdir/file1.chk >> $seqres.full +_scratch_remount + +echo "Compare files" +md5sum $testdir/file1 | _filter_scratch +md5sum $testdir/file3 | _filter_scratch +md5sum $testdir/file1.chk | _filter_scratch + +# success, all done +status=0 +exit diff --git a/tests/xfs/248.out b/tests/xfs/248.out new file mode 100644 index 0000000..bb668ad --- /dev/null +++ b/tests/xfs/248.out @@ -0,0 +1,12 @@ +QA output created by 248 +Format and mount +Create the original files +Compare files +bdbcf02ee0aa977795a79d25fcfdccb1 SCRATCH_MNT/test-248/file1 +ce2023f765eba19677517c511886d5c9 SCRATCH_MNT/test-248/file3 +bdbcf02ee0aa977795a79d25fcfdccb1 SCRATCH_MNT/test-248/file1.chk +CoW across the transition +Compare files +2dc2b131303b2f70ddb480778caac8b7 SCRATCH_MNT/test-248/file1 +ce2023f765eba19677517c511886d5c9 SCRATCH_MNT/test-248/file3 +2dc2b131303b2f70ddb480778caac8b7 SCRATCH_MNT/test-248/file1.chk diff --git a/tests/xfs/249 b/tests/xfs/249 new file mode 100755 index 0000000..f2088ee --- /dev/null +++ b/tests/xfs/249 @@ -0,0 +1,92 @@ +#! /bin/bash +# FS QA Test No. 249 +# +# Ensuring that copy on write in directio mode to the source file when the +# CoW range covers regular unshared and regular shared blocks. +# - Set cowextsz. +# - Create two files. +# - Reflink the odd blocks of the first file into the second file. +# - dio CoW the first file across the halfway mark, starting with the +# regular extent. +# - Check that the files are now different where we say they're different. +# +#----------------------------------------------------------------------- +# Copyright (c) 2016, Oracle and/or its affiliates. All Rights Reserved. +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License as +# published by the Free Software Foundation. +# +# This program is distributed in the hope that it would be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write the Free Software Foundation, +# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA +#----------------------------------------------------------------------- + +seq=`basename $0` +seqres=$RESULT_DIR/$seq +echo "QA output created by $seq" + +here=`pwd` +tmp=/tmp/$$ +status=1 # failure is the default! +trap "_cleanup; exit \$status" 0 1 2 3 15 + +_cleanup() +{ + cd / + rm -rf $tmp.* +} + +# get standard environment, filters and checks +. ./common/rc +. ./common/filter +. ./common/reflink + +# real QA test starts here +_supported_os Linux +_require_scratch_reflink +_require_xfs_io_command "falloc" +_require_odirect + +rm -f $seqres.full + +echo "Format and mount" +_scratch_mkfs > $seqres.full 2>&1 +_scratch_mount >> $seqres.full 2>&1 + +testdir=$SCRATCH_MNT/test-$seq +mkdir $testdir + +echo "Create the original files" +blksz=65536 +nr=64 +filesize=$((blksz * nr)) +$XFS_IO_PROG -c "cowextsize $((blksz * 16))" $testdir >> $seqres.full +_sweave_reflink_regular $blksz $nr $testdir/file1 $testdir/file3 >> $seqres.full +_scratch_remount + +echo "Compare files" +md5sum $testdir/file1 | _filter_scratch +md5sum $testdir/file3 | _filter_scratch +md5sum $testdir/file1.chk | _filter_scratch + +echo "CoW across the transition" +cowoff=$((filesize / 4)) +cowsz=$((filesize / 2)) +$XFS_IO_PROG -d -f -c "pwrite -S 0x63 -b $cowsz $cowoff $cowsz" $testdir/file1 >> $seqres.full +_pwrite_byte 0x63 $cowoff $cowsz $testdir/file1.chk >> $seqres.full +_scratch_remount + +echo "Compare files" +md5sum $testdir/file1 | _filter_scratch +md5sum $testdir/file3 | _filter_scratch +md5sum $testdir/file1.chk | _filter_scratch + +# success, all done +status=0 +exit diff --git a/tests/xfs/249.out b/tests/xfs/249.out new file mode 100644 index 0000000..4a9728a --- /dev/null +++ b/tests/xfs/249.out @@ -0,0 +1,12 @@ +QA output created by 249 +Format and mount +Create the original files +Compare files +bdbcf02ee0aa977795a79d25fcfdccb1 SCRATCH_MNT/test-249/file1 +ce2023f765eba19677517c511886d5c9 SCRATCH_MNT/test-249/file3 +bdbcf02ee0aa977795a79d25fcfdccb1 SCRATCH_MNT/test-249/file1.chk +CoW across the transition +Compare files +2dc2b131303b2f70ddb480778caac8b7 SCRATCH_MNT/test-249/file1 +ce2023f765eba19677517c511886d5c9 SCRATCH_MNT/test-249/file3 +2dc2b131303b2f70ddb480778caac8b7 SCRATCH_MNT/test-249/file1.chk diff --git a/tests/xfs/251 b/tests/xfs/251 new file mode 100755 index 0000000..a2617bb --- /dev/null +++ b/tests/xfs/251 @@ -0,0 +1,93 @@ +#! /bin/bash +# FS QA Test No. 251 +# +# Ensuring that copy on write in buffered mode to the source file when the +# CoW range covers unwritten and regular shared blocks. +# - Set cowextsz. +# - Create two files. +# - fallocate the first file. +# - Write the odd blocks of the first file. +# - Reflink the odd blocks of the first file into the second file. +# - CoW the first file across the halfway mark, starting with the +# regular extent. +# - Check that the files are now different where we say they're different. +# +#----------------------------------------------------------------------- +# Copyright (c) 2016, Oracle and/or its affiliates. All Rights Reserved. +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License as +# published by the Free Software Foundation. +# +# This program is distributed in the hope that it would be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write the Free Software Foundation, +# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA +#----------------------------------------------------------------------- + +seq=`basename $0` +seqres=$RESULT_DIR/$seq +echo "QA output created by $seq" + +here=`pwd` +tmp=/tmp/$$ +status=1 # failure is the default! +trap "_cleanup; exit \$status" 0 1 2 3 15 + +_cleanup() +{ + cd / + rm -rf $tmp.* +} + +# get standard environment, filters and checks +. ./common/rc +. ./common/filter +. ./common/reflink + +# real QA test starts here +_supported_os Linux +_require_scratch_reflink +_require_xfs_io_command "falloc" + +rm -f $seqres.full + +echo "Format and mount" +_scratch_mkfs > $seqres.full 2>&1 +_scratch_mount >> $seqres.full 2>&1 + +testdir=$SCRATCH_MNT/test-$seq +mkdir $testdir + +echo "Create the original files" +blksz=65536 +nr=64 +filesize=$((blksz * nr)) +$XFS_IO_PROG -c "cowextsize $((blksz * 16))" $testdir >> $seqres.full +_sweave_reflink_unwritten $blksz $nr $testdir/file1 $testdir/file3 >> $seqres.full +_scratch_remount + +echo "Compare files" +md5sum $testdir/file1 | _filter_scratch +md5sum $testdir/file3 | _filter_scratch +md5sum $testdir/file1.chk | _filter_scratch + +echo "CoW across the transition" +cowoff=$((filesize / 4)) +cowsz=$((filesize / 2)) +$XFS_IO_PROG -f -c "pwrite -S 0x63 -b $cowsz $cowoff $cowsz" $testdir/file1 >> $seqres.full +_pwrite_byte 0x63 $cowoff $cowsz $testdir/file1.chk >> $seqres.full +_scratch_remount + +echo "Compare files" +md5sum $testdir/file1 | _filter_scratch +md5sum $testdir/file3 | _filter_scratch +md5sum $testdir/file1.chk | _filter_scratch + +# success, all done +status=0 +exit diff --git a/tests/xfs/251.out b/tests/xfs/251.out new file mode 100644 index 0000000..bd6b222 --- /dev/null +++ b/tests/xfs/251.out @@ -0,0 +1,12 @@ +QA output created by 251 +Format and mount +Create the original files +Compare files +b8a8a88d4c143f79900c4b4e79aa3e37 SCRATCH_MNT/test-251/file1 +ce2023f765eba19677517c511886d5c9 SCRATCH_MNT/test-251/file3 +b8a8a88d4c143f79900c4b4e79aa3e37 SCRATCH_MNT/test-251/file1.chk +CoW across the transition +Compare files +e8cf59797f0b3758c8878c368bb4cf7e SCRATCH_MNT/test-251/file1 +ce2023f765eba19677517c511886d5c9 SCRATCH_MNT/test-251/file3 +e8cf59797f0b3758c8878c368bb4cf7e SCRATCH_MNT/test-251/file1.chk diff --git a/tests/xfs/254 b/tests/xfs/254 new file mode 100755 index 0000000..f5cbbfe --- /dev/null +++ b/tests/xfs/254 @@ -0,0 +1,94 @@ +#! /bin/bash +# FS QA Test No. 254 +# +# Ensuring that copy on write in directio mode to the source file when the +# CoW range covers unwritten and regular shared blocks. +# - Set cowextsz. +# - Create two files. +# - fallocate the first file. +# - Write the odd blocks of the first file. +# - Reflink the odd blocks of the first file into the second file. +# - DIO CoW the first file across the halfway mark, starting with the +# regular extent. +# - Check that the files are now different where we say they're different. +# +#----------------------------------------------------------------------- +# Copyright (c) 2016, Oracle and/or its affiliates. All Rights Reserved. +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License as +# published by the Free Software Foundation. +# +# This program is distributed in the hope that it would be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write the Free Software Foundation, +# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA +#----------------------------------------------------------------------- + +seq=`basename $0` +seqres=$RESULT_DIR/$seq +echo "QA output created by $seq" + +here=`pwd` +tmp=/tmp/$$ +status=1 # failure is the default! +trap "_cleanup; exit \$status" 0 1 2 3 15 + +_cleanup() +{ + cd / + rm -rf $tmp.* +} + +# get standard environment, filters and checks +. ./common/rc +. ./common/filter +. ./common/reflink + +# real QA test starts here +_supported_os Linux +_require_scratch_reflink +_require_xfs_io_command "falloc" +_require_odirect + +rm -f $seqres.full + +echo "Format and mount" +_scratch_mkfs > $seqres.full 2>&1 +_scratch_mount >> $seqres.full 2>&1 + +testdir=$SCRATCH_MNT/test-$seq +mkdir $testdir + +echo "Create the original files" +blksz=65536 +nr=64 +filesize=$((blksz * nr)) +$XFS_IO_PROG -c "cowextsize $((blksz * 16))" $testdir >> $seqres.full +_sweave_reflink_unwritten $blksz $nr $testdir/file1 $testdir/file3 >> $seqres.full +_scratch_remount + +echo "Compare files" +md5sum $testdir/file1 | _filter_scratch +md5sum $testdir/file3 | _filter_scratch +md5sum $testdir/file1.chk | _filter_scratch + +echo "CoW across the transition" +cowoff=$((filesize / 4)) +cowsz=$((filesize / 2)) +$XFS_IO_PROG -d -f -c "pwrite -S 0x63 -b $cowsz $cowoff $cowsz" $testdir/file1 >> $seqres.full +_pwrite_byte 0x63 $cowoff $cowsz $testdir/file1.chk >> $seqres.full +_scratch_remount + +echo "Compare files" +md5sum $testdir/file1 | _filter_scratch +md5sum $testdir/file3 | _filter_scratch +md5sum $testdir/file1.chk | _filter_scratch + +# success, all done +status=0 +exit diff --git a/tests/xfs/254.out b/tests/xfs/254.out new file mode 100644 index 0000000..14c7772 --- /dev/null +++ b/tests/xfs/254.out @@ -0,0 +1,12 @@ +QA output created by 254 +Format and mount +Create the original files +Compare files +b8a8a88d4c143f79900c4b4e79aa3e37 SCRATCH_MNT/test-254/file1 +ce2023f765eba19677517c511886d5c9 SCRATCH_MNT/test-254/file3 +b8a8a88d4c143f79900c4b4e79aa3e37 SCRATCH_MNT/test-254/file1.chk +CoW across the transition +Compare files +e8cf59797f0b3758c8878c368bb4cf7e SCRATCH_MNT/test-254/file1 +ce2023f765eba19677517c511886d5c9 SCRATCH_MNT/test-254/file3 +e8cf59797f0b3758c8878c368bb4cf7e SCRATCH_MNT/test-254/file1.chk diff --git a/tests/xfs/255 b/tests/xfs/255 new file mode 100755 index 0000000..7532d68 --- /dev/null +++ b/tests/xfs/255 @@ -0,0 +1,93 @@ +#! /bin/bash +# FS QA Test No. 255 +# +# Ensuring that copy on write in buffered mode to the source file when the +# CoW range covers holes and regular shared blocks. +# - Set cowextsz. +# - Create two files. +# - Truncate the first file. +# - Write the odd blocks of the first file. +# - Reflink the odd blocks of the first file into the second file. +# - CoW the first file across the halfway mark, starting with the +# regular extent. +# - Check that the files are now different where we say they're different. +# +#----------------------------------------------------------------------- +# Copyright (c) 2016, Oracle and/or its affiliates. All Rights Reserved. +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License as +# published by the Free Software Foundation. +# +# This program is distributed in the hope that it would be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write the Free Software Foundation, +# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA +#----------------------------------------------------------------------- + +seq=`basename $0` +seqres=$RESULT_DIR/$seq +echo "QA output created by $seq" + +here=`pwd` +tmp=/tmp/$$ +status=1 # failure is the default! +trap "_cleanup; exit \$status" 0 1 2 3 15 + +_cleanup() +{ + cd / + rm -rf $tmp.* +} + +# get standard environment, filters and checks +. ./common/rc +. ./common/filter +. ./common/reflink + +# real QA test starts here +_supported_os Linux +_require_scratch_reflink +_require_xfs_io_command "falloc" + +rm -f $seqres.full + +echo "Format and mount" +_scratch_mkfs > $seqres.full 2>&1 +_scratch_mount >> $seqres.full 2>&1 + +testdir=$SCRATCH_MNT/test-$seq +mkdir $testdir + +echo "Create the original files" +blksz=65536 +nr=64 +filesize=$((blksz * nr)) +$XFS_IO_PROG -c "cowextsize $((blksz * 16))" $testdir >> $seqres.full +_sweave_reflink_holes $blksz $nr $testdir/file1 $testdir/file3 >> $seqres.full +_scratch_remount + +echo "Compare files" +md5sum $testdir/file1 | _filter_scratch +md5sum $testdir/file3 | _filter_scratch +md5sum $testdir/file1.chk | _filter_scratch + +echo "CoW across the transition" +cowoff=$((filesize / 4)) +cowsz=$((filesize / 2)) +$XFS_IO_PROG -f -c "pwrite -S 0x63 -b $cowsz $cowoff $cowsz" $testdir/file1 >> $seqres.full +_pwrite_byte 0x63 $cowoff $cowsz $testdir/file1.chk >> $seqres.full +_scratch_remount + +echo "Compare files" +md5sum $testdir/file1 | _filter_scratch +md5sum $testdir/file3 | _filter_scratch +md5sum $testdir/file1.chk | _filter_scratch + +# success, all done +status=0 +exit diff --git a/tests/xfs/255.out b/tests/xfs/255.out new file mode 100644 index 0000000..7c665d1 --- /dev/null +++ b/tests/xfs/255.out @@ -0,0 +1,12 @@ +QA output created by 255 +Format and mount +Create the original files +Compare files +b8a8a88d4c143f79900c4b4e79aa3e37 SCRATCH_MNT/test-255/file1 +ce2023f765eba19677517c511886d5c9 SCRATCH_MNT/test-255/file3 +b8a8a88d4c143f79900c4b4e79aa3e37 SCRATCH_MNT/test-255/file1.chk +CoW across the transition +Compare files +e8cf59797f0b3758c8878c368bb4cf7e SCRATCH_MNT/test-255/file1 +ce2023f765eba19677517c511886d5c9 SCRATCH_MNT/test-255/file3 +e8cf59797f0b3758c8878c368bb4cf7e SCRATCH_MNT/test-255/file1.chk diff --git a/tests/xfs/256 b/tests/xfs/256 new file mode 100755 index 0000000..ea8bd69 --- /dev/null +++ b/tests/xfs/256 @@ -0,0 +1,94 @@ +#! /bin/bash +# FS QA Test No. 256 +# +# Ensuring that copy on write in directio mode to the source file when the +# CoW range covers holes and regular shared blocks. +# - Set cowextsz. +# - Create two files. +# - Truncate the first file. +# - Write the odd blocks of the first file. +# - Reflink the odd blocks of the first file into the second file. +# - DIO CoW the first file across the halfway mark, starting with the +# regular extent. +# - Check that the files are now different where we say they're different. +# +#----------------------------------------------------------------------- +# Copyright (c) 2016, Oracle and/or its affiliates. All Rights Reserved. +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License as +# published by the Free Software Foundation. +# +# This program is distributed in the hope that it would be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write the Free Software Foundation, +# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA +#----------------------------------------------------------------------- + +seq=`basename $0` +seqres=$RESULT_DIR/$seq +echo "QA output created by $seq" + +here=`pwd` +tmp=/tmp/$$ +status=1 # failure is the default! +trap "_cleanup; exit \$status" 0 1 2 3 15 + +_cleanup() +{ + cd / + rm -rf $tmp.* +} + +# get standard environment, filters and checks +. ./common/rc +. ./common/filter +. ./common/reflink + +# real QA test starts here +_supported_os Linux +_require_scratch_reflink +_require_xfs_io_command "falloc" +_require_odirect + +rm -f $seqres.full + +echo "Format and mount" +_scratch_mkfs > $seqres.full 2>&1 +_scratch_mount >> $seqres.full 2>&1 + +testdir=$SCRATCH_MNT/test-$seq +mkdir $testdir + +echo "Create the original files" +blksz=65536 +nr=64 +filesize=$((blksz * nr)) +$XFS_IO_PROG -c "cowextsize $((blksz * 16))" $testdir >> $seqres.full +_sweave_reflink_holes $blksz $nr $testdir/file1 $testdir/file3 >> $seqres.full +_scratch_remount + +echo "Compare files" +md5sum $testdir/file1 | _filter_scratch +md5sum $testdir/file3 | _filter_scratch +md5sum $testdir/file1.chk | _filter_scratch + +echo "CoW across the transition" +cowoff=$((filesize / 4)) +cowsz=$((filesize / 2)) +$XFS_IO_PROG -d -f -c "pwrite -S 0x63 -b $cowsz $cowoff $cowsz" $testdir/file1 >> $seqres.full +_pwrite_byte 0x63 $cowoff $cowsz $testdir/file1.chk >> $seqres.full +_scratch_remount + +echo "Compare files" +md5sum $testdir/file1 | _filter_scratch +md5sum $testdir/file3 | _filter_scratch +md5sum $testdir/file1.chk | _filter_scratch + +# success, all done +status=0 +exit diff --git a/tests/xfs/256.out b/tests/xfs/256.out new file mode 100644 index 0000000..5c3d36c --- /dev/null +++ b/tests/xfs/256.out @@ -0,0 +1,12 @@ +QA output created by 256 +Format and mount +Create the original files +Compare files +b8a8a88d4c143f79900c4b4e79aa3e37 SCRATCH_MNT/test-256/file1 +ce2023f765eba19677517c511886d5c9 SCRATCH_MNT/test-256/file3 +b8a8a88d4c143f79900c4b4e79aa3e37 SCRATCH_MNT/test-256/file1.chk +CoW across the transition +Compare files +e8cf59797f0b3758c8878c368bb4cf7e SCRATCH_MNT/test-256/file1 +ce2023f765eba19677517c511886d5c9 SCRATCH_MNT/test-256/file3 +e8cf59797f0b3758c8878c368bb4cf7e SCRATCH_MNT/test-256/file1.chk diff --git a/tests/xfs/257 b/tests/xfs/257 new file mode 100755 index 0000000..05a3d25 --- /dev/null +++ b/tests/xfs/257 @@ -0,0 +1,95 @@ +#! /bin/bash +# FS QA Test No. 257 +# +# Ensuring that copy on write in buffered mode to the source file when the +# CoW range covers delalloc blocks and regular shared blocks. +# - Set cowextsz. +# - Create two files. +# - Truncate the first file. +# - Write the odd blocks of the first file. +# - Reflink the odd blocks of the first file into the second file. +# - Write the even blocks of the first file. +# - CoW the first file across the halfway mark, starting with the +# regular extent. +# - Check that the files are now different where we say they're different. +# +#----------------------------------------------------------------------- +# Copyright (c) 2016, Oracle and/or its affiliates. All Rights Reserved. +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License as +# published by the Free Software Foundation. +# +# This program is distributed in the hope that it would be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write the Free Software Foundation, +# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA +#----------------------------------------------------------------------- + +seq=`basename $0` +seqres=$RESULT_DIR/$seq +echo "QA output created by $seq" + +here=`pwd` +tmp=/tmp/$$ +status=1 # failure is the default! +trap "_cleanup; exit \$status" 0 1 2 3 15 + +_cleanup() +{ + cd / + rm -rf $tmp.* +} + +# get standard environment, filters and checks +. ./common/rc +. ./common/filter +. ./common/reflink + +# real QA test starts here +_supported_os Linux +_require_scratch_reflink +_require_xfs_io_command "falloc" + +rm -f $seqres.full + +echo "Format and mount" +_scratch_mkfs > $seqres.full 2>&1 +_scratch_mount >> $seqres.full 2>&1 + +testdir=$SCRATCH_MNT/test-$seq +mkdir $testdir + +echo "Create the original files" +blksz=65536 +nr=64 +filesize=$((blksz * nr)) +$XFS_IO_PROG -c "cowextsize $((blksz * 16))" $testdir >> $seqres.full +_sweave_reflink_holes $blksz $nr $testdir/file1 $testdir/file3 >> $seqres.full +_scratch_remount + +echo "Compare files" +md5sum $testdir/file1 | _filter_scratch +md5sum $testdir/file3 | _filter_scratch +md5sum $testdir/file1.chk | _filter_scratch + +echo "CoW across the transition" +cowoff=$((filesize / 4)) +cowsz=$((filesize / 2)) +_sweave_reflink_holes_delalloc $blksz $nr $testdir/file1 >> $seqres.full +$XFS_IO_PROG -f -c "pwrite -S 0x63 -b $cowsz $cowoff $cowsz" $testdir/file1 >> $seqres.full +_pwrite_byte 0x63 $cowoff $cowsz $testdir/file1.chk >> $seqres.full +_scratch_remount + +echo "Compare files" +md5sum $testdir/file1 | _filter_scratch +md5sum $testdir/file3 | _filter_scratch +md5sum $testdir/file1.chk | _filter_scratch + +# success, all done +status=0 +exit diff --git a/tests/xfs/257.out b/tests/xfs/257.out new file mode 100644 index 0000000..0f27f03 --- /dev/null +++ b/tests/xfs/257.out @@ -0,0 +1,12 @@ +QA output created by 257 +Format and mount +Create the original files +Compare files +b8a8a88d4c143f79900c4b4e79aa3e37 SCRATCH_MNT/test-257/file1 +ce2023f765eba19677517c511886d5c9 SCRATCH_MNT/test-257/file3 +b8a8a88d4c143f79900c4b4e79aa3e37 SCRATCH_MNT/test-257/file1.chk +CoW across the transition +Compare files +35e2170e14665b780c6dec328d6a263b SCRATCH_MNT/test-257/file1 +ce2023f765eba19677517c511886d5c9 SCRATCH_MNT/test-257/file3 +35e2170e14665b780c6dec328d6a263b SCRATCH_MNT/test-257/file1.chk diff --git a/tests/xfs/258 b/tests/xfs/258 new file mode 100755 index 0000000..ad7cb83 --- /dev/null +++ b/tests/xfs/258 @@ -0,0 +1,96 @@ +#! /bin/bash +# FS QA Test No. 258 +# +# Ensuring that copy on write in directio mode to the source file when the +# CoW range covers delalloc blocks and regular shared blocks. +# - Set cowextsz. +# - Create two files. +# - Truncate the first file. +# - Write the odd blocks of the first file. +# - Reflink the odd blocks of the first file into the second file. +# - Write the even blocks of the first file. +# - DIO CoW the first file across the halfway mark, starting with the +# regular extent. +# - Check that the files are now different where we say they're different. +# +#----------------------------------------------------------------------- +# Copyright (c) 2016, Oracle and/or its affiliates. All Rights Reserved. +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License as +# published by the Free Software Foundation. +# +# This program is distributed in the hope that it would be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write the Free Software Foundation, +# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA +#----------------------------------------------------------------------- + +seq=`basename $0` +seqres=$RESULT_DIR/$seq +echo "QA output created by $seq" + +here=`pwd` +tmp=/tmp/$$ +status=1 # failure is the default! +trap "_cleanup; exit \$status" 0 1 2 3 15 + +_cleanup() +{ + cd / + rm -rf $tmp.* +} + +# get standard environment, filters and checks +. ./common/rc +. ./common/filter +. ./common/reflink + +# real QA test starts here +_supported_os Linux +_require_scratch_reflink +_require_xfs_io_command "falloc" +_require_odirect + +rm -f $seqres.full + +echo "Format and mount" +_scratch_mkfs > $seqres.full 2>&1 +_scratch_mount >> $seqres.full 2>&1 + +testdir=$SCRATCH_MNT/test-$seq +mkdir $testdir + +echo "Create the original files" +blksz=65536 +nr=64 +filesize=$((blksz * nr)) +$XFS_IO_PROG -c "cowextsize $((blksz * 16))" $testdir >> $seqres.full +_sweave_reflink_holes $blksz $nr $testdir/file1 $testdir/file3 >> $seqres.full +_scratch_remount + +echo "Compare files" +md5sum $testdir/file1 | _filter_scratch +md5sum $testdir/file3 | _filter_scratch +md5sum $testdir/file1.chk | _filter_scratch + +echo "CoW across the transition" +cowoff=$((filesize / 4)) +cowsz=$((filesize / 2)) +_sweave_reflink_holes_delalloc $blksz $nr $testdir/file1 >> $seqres.full +$XFS_IO_PROG -d -f -c "pwrite -S 0x63 -b $cowsz $cowoff $cowsz" $testdir/file1 >> $seqres.full +_pwrite_byte 0x63 $cowoff $cowsz $testdir/file1.chk >> $seqres.full +_scratch_remount + +echo "Compare files" +md5sum $testdir/file1 | _filter_scratch +md5sum $testdir/file3 | _filter_scratch +md5sum $testdir/file1.chk | _filter_scratch + +# success, all done +status=0 +exit diff --git a/tests/xfs/258.out b/tests/xfs/258.out new file mode 100644 index 0000000..ccaca02 --- /dev/null +++ b/tests/xfs/258.out @@ -0,0 +1,12 @@ +QA output created by 258 +Format and mount +Create the original files +Compare files +b8a8a88d4c143f79900c4b4e79aa3e37 SCRATCH_MNT/test-258/file1 +ce2023f765eba19677517c511886d5c9 SCRATCH_MNT/test-258/file3 +b8a8a88d4c143f79900c4b4e79aa3e37 SCRATCH_MNT/test-258/file1.chk +CoW across the transition +Compare files +35e2170e14665b780c6dec328d6a263b SCRATCH_MNT/test-258/file1 +ce2023f765eba19677517c511886d5c9 SCRATCH_MNT/test-258/file3 +35e2170e14665b780c6dec328d6a263b SCRATCH_MNT/test-258/file1.chk diff --git a/tests/xfs/group b/tests/xfs/group index 6f43c79..4fb7618 100644 --- a/tests/xfs/group +++ b/tests/xfs/group @@ -245,9 +245,17 @@ 245 auto quick clone 246 auto quick clone 247 auto quick clone +248 auto quick clone +249 auto quick clone 250 auto quick rw prealloc metadata +251 auto quick clone 252 auto quick prealloc 253 auto quick +254 auto quick clone +255 auto quick clone +256 auto quick clone +257 auto quick clone +258 auto quick clone 259 auto quick 261 auto quick quota 262 auto quick quota From darrick.wong@oracle.com Thu Feb 11 17:42:59 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay1.corp.sgi.com [137.38.102.111]) by oss.sgi.com (Postfix) with ESMTP id A2ED97FE9 for ; Thu, 11 Feb 2016 17:42:59 -0600 (CST) Received: from cuda.sgi.com (cuda3.sgi.com [192.48.176.15]) by relay1.corp.sgi.com (Postfix) with ESMTP id 9561E8F8033 for ; Thu, 11 Feb 2016 15:42:59 -0800 (PST) X-ASG-Debug-ID: 1455234177-04cb6c1e5772fa0001-NocioJ Received: from userp1040.oracle.com (userp1040.oracle.com [156.151.31.81]) by cuda.sgi.com with ESMTP id Qx5z906WKYgmiKyy (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO) for ; Thu, 11 Feb 2016 15:42:57 -0800 (PST) X-Barracuda-Envelope-From: darrick.wong@oracle.com X-Barracuda-Apparent-Source-IP: 156.151.31.81 Received: from userv0022.oracle.com (userv0022.oracle.com [156.151.31.74]) by userp1040.oracle.com (Sentrion-MTA-4.3.2/Sentrion-MTA-4.3.2) with ESMTP id u1BNgu2A002467 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 11 Feb 2016 23:42:56 GMT Received: from userv0122.oracle.com (userv0122.oracle.com [156.151.31.75]) by userv0022.oracle.com (8.14.4/8.13.8) with ESMTP id u1BNgu2v031329 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL); Thu, 11 Feb 2016 23:42:56 GMT Received: from abhmp0019.oracle.com (abhmp0019.oracle.com [141.146.116.25]) by userv0122.oracle.com (8.14.4/8.14.4) with ESMTP id u1BNguN2031174; Thu, 11 Feb 2016 23:42:56 GMT Received: from localhost (/10.145.178.207) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Thu, 11 Feb 2016 15:42:55 -0800 Subject: [PATCH 32/32] reflink: kick the slow tests out of the 'quick' group From: "Darrick J. Wong" X-ASG-Orig-Subj: [PATCH 32/32] reflink: kick the slow tests out of the 'quick' group To: david@fromorbit.com, darrick.wong@oracle.com Cc: linux-btrfs@vger.kernel.org, fstests@vger.kernel.org, xfs@oss.sgi.com Date: Thu, 11 Feb 2016 15:42:54 -0800 Message-ID: <20160211234254.2202.90445.stgit@birch.djwong.org> In-Reply-To: <20160211233916.2202.40961.stgit@birch.djwong.org> References: <20160211233916.2202.40961.stgit@birch.djwong.org> User-Agent: StGit/0.17.1-dirty MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit X-Source-IP: userv0022.oracle.com [156.151.31.74] X-Barracuda-Connect: userp1040.oracle.com[156.151.31.81] X-Barracuda-Start-Time: 1455234177 X-Barracuda-Encrypted: ECDHE-RSA-AES256-GCM-SHA384 X-Barracuda-URL: https://192.48.176.15:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-BRTS-Status: 1 X-Barracuda-Spam-Score: 0.00 X-Barracuda-Spam-Status: No, SCORE=0.00 using per-user scores of TAG_LEVEL=1000.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.7 tests=BSF_SC0_MISMATCH_TO, UNPARSEABLE_RELAY X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.3.26959 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 0.00 BSF_SC0_MISMATCH_TO Envelope rcpt doesn't match header 0.00 UNPARSEABLE_RELAY Informational: message has unparseable relay lines Since 'quick' tests are supposed to run in < 15s, kick out the ones that can't finish that soon even on fast storage. Signed-off-by: Darrick J. Wong --- tests/generic/group | 34 +++++++++++++++++----------------- tests/xfs/group | 6 +++--- 2 files changed, 20 insertions(+), 20 deletions(-) diff --git a/tests/generic/group b/tests/generic/group index e3c4e8a..5f699ce 100644 --- a/tests/generic/group +++ b/tests/generic/group @@ -139,7 +139,7 @@ 134 auto quick clone 135 metadata auto quick 136 auto quick clone dedupe -137 auto quick clone dedupe +137 auto clone dedupe 138 auto quick clone 139 auto quick clone 140 auto quick clone @@ -166,19 +166,19 @@ 161 auto quick clone 162 auto quick clone dedupe 163 auto quick clone dedupe -164 auto quick clone -165 auto quick clone -166 auto quick clone -167 auto quick clone -168 auto quick clone +164 auto clone +165 auto clone +166 auto clone +167 auto clone +168 auto clone 169 rw metadata auto quick -170 auto quick clone +170 auto clone 171 auto quick clone 172 auto quick clone 173 auto quick clone 174 auto quick clone -175 auto quick clone -176 auto quick clone +175 auto clone +176 auto clone 177 auto quick prealloc metadata 178 auto quick clone 179 auto quick clone @@ -188,8 +188,8 @@ 183 auto quick clone 184 metadata auto quick 185 auto quick clone -186 auto quick clone -187 auto quick clone +186 auto clone +187 auto clone 188 auto quick clone 189 auto quick clone 190 auto quick clone @@ -244,8 +244,8 @@ 239 auto aio rw 240 auto aio quick rw 241 auto -242 auto quick clone -243 auto quick clone +242 auto clone +243 auto clone 244 auto quick quota 245 auto quick dir 246 auto quick rw @@ -299,8 +299,8 @@ 294 auto quick 295 auto quick clone 296 auto quick clone -297 auto quick clone -298 auto quick clone +297 auto clone +298 auto clone 299 auto aio enospc rw stress 300 auto aio enospc preallocrw stress 301 auto quick clone @@ -335,5 +335,5 @@ 330 auto quick clone 331 auto quick clone 332 auto quick clone -333 auto quick clone -334 auto quick clone +333 auto clone +334 auto clone diff --git a/tests/xfs/group b/tests/xfs/group index 4fb7618..eadc212 100644 --- a/tests/xfs/group +++ b/tests/xfs/group @@ -137,7 +137,7 @@ 137 auto metadata v2log 138 auto quick quota 139 auto quick clone -140 auto quick clone +140 auto clone 141 auto log metadata 142 dmapi 143 dmapi @@ -166,7 +166,7 @@ 166 rw metadata auto quick 167 rw metadata auto stress 168 dmapi -169 auto quick clone +169 auto clone 170 rw filestreams auto quick 171 rw filestreams 172 rw filestreams @@ -233,7 +233,7 @@ 233 auto quick rmap 234 auto quick rmap 235 fuzzers rmap -236 auto quick rmap +236 auto rmap 237 auto quick clone 238 auto quick metadata ioctl 239 auto quick clone From david@fromorbit.com Thu Feb 11 17:44:20 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=ham version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay2.corp.sgi.com [137.38.102.29]) by oss.sgi.com (Postfix) with ESMTP id 83E4A8000 for ; Thu, 11 Feb 2016 17:44:20 -0600 (CST) Received: from cuda.sgi.com (cuda2.sgi.com [192.48.176.25]) by relay2.corp.sgi.com (Postfix) with ESMTP id 76087304051 for ; Thu, 11 Feb 2016 15:44:20 -0800 (PST) X-ASG-Debug-ID: 1455234257-04cbb043338a170001-NocioJ Received: from ipmail06.adl2.internode.on.net (ipmail06.adl2.internode.on.net [150.101.137.129]) by cuda.sgi.com with ESMTP id yeSuxkQDrynnHgBi for ; Thu, 11 Feb 2016 15:44:18 -0800 (PST) X-Barracuda-Envelope-From: david@fromorbit.com X-Barracuda-Apparent-Source-IP: 150.101.137.129 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: A2D6CgDnG71WPBATLHleKAECgw+BP4ZigXmdYwEBBotrhUWECIYHAgIBAQKBNU0BAQEBAQEHAQEBAUE/hEIBAQQ6HCMQCAMYCSUPBSUDBxoTG4d+wUcBKRiFMoR+iGwFlneNSoFmh2mFL44+hFsoLohTAQEB Received: from ppp121-44-19-16.lns20.syd4.internode.on.net (HELO dastard) ([121.44.19.16]) by ipmail06.adl2.internode.on.net with ESMTP; 12 Feb 2016 10:14:16 +1030 Received: from dave by dastard with local (Exim 4.80) (envelope-from ) id 1aU0uF-0001V5-VU; Fri, 12 Feb 2016 10:44:16 +1100 Date: Fri, 12 Feb 2016 10:44:15 +1100 From: Dave Chinner To: Dan Williams Cc: Jan Kara , Ross Zwisler , "linux-kernel@vger.kernel.org" , Theodore Ts'o , Alexander Viro , Andreas Dilger , Andrew Morton , Jan Kara , Matthew Wilcox , linux-ext4 , linux-fsdevel , Linux MM , "linux-nvdimm@lists.01.org" , XFS Developers Subject: Re: [PATCH v2 2/2] dax: move writeback calls into the filesystems Message-ID: <20160211234415.GM19486@dastard> X-ASG-Orig-Subj: Re: [PATCH v2 2/2] dax: move writeback calls into the filesystems References: <1455137336-28720-1-git-send-email-ross.zwisler@linux.intel.com> <1455137336-28720-3-git-send-email-ross.zwisler@linux.intel.com> <20160210220312.GP14668@dastard> <20160210224340.GA30938@linux.intel.com> <20160211125044.GJ21760@quack.suse.cz> <20160211204635.GI19486@dastard> <20160211224616.GL19486@dastard> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.21 (2010-09-15) X-Barracuda-Connect: ipmail06.adl2.internode.on.net[150.101.137.129] X-Barracuda-Start-Time: 1455234257 X-Barracuda-URL: https://192.48.176.25:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-BRTS-Status: 1 X-Barracuda-Spam-Score: 0.00 X-Barracuda-Spam-Status: No, SCORE=0.00 using per-user scores of TAG_LEVEL=1000.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.7 tests=BSF_SC0_MISMATCH_TO X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.3.26959 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 0.00 BSF_SC0_MISMATCH_TO Envelope rcpt doesn't match header On Thu, Feb 11, 2016 at 02:59:14PM -0800, Dan Williams wrote: > On Thu, Feb 11, 2016 at 2:46 PM, Dave Chinner wrote: > > On Thu, Feb 11, 2016 at 12:58:38PM -0800, Dan Williams wrote: > >> On Thu, Feb 11, 2016 at 12:46 PM, Dave Chinner wrote: > >> Maybe I don't need to worry because it's already the case that a > >> mmap of the raw device may not see the most up to date data for a > >> file that has dirty fs-page-cache data. > > > > It goes both ways. What happens if mkfs or fsck modifies the > > block device via mmap+DAX and then the filesystem mounts the block > > device and tries to read that metadata via the block device page > > cache? > > > > Quite frankly, DAX on the block device is a can of worms we really > > don't need to deal with right now. IMO it's a solution looking for a > > problem to solve, > > Virtualization use cases want to give large ranges to guest-VMs, and > it is currently the only way to reliably get 1GiB mappings. Precisely my point - block devices are not the best way to solve this problem. A file, on XFS, with a 1GB extent size hint and preallocated to be aligned to 1GB addresses (i.e. mkfs.xfs -d su=1G,sw=1 on the host filesystem) will give reliable 1GB aligned blocks for DAX mappings, just like a block device will. Peformance wise it's little different to using the block device directly. Management wise it's way more flexible, especially as such image files can be recycled for new VMs almost instantly via FALLOC_FL_FLAG_ZERO_RANGE. Cheers, Dave. -- Dave Chinner david@fromorbit.com From darrick.wong@oracle.com Thu Feb 11 17:48:16 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay1.corp.sgi.com [137.38.102.111]) by oss.sgi.com (Postfix) with ESMTP id E94B67CB4 for ; Thu, 11 Feb 2016 17:48:16 -0600 (CST) Received: from cuda.sgi.com (cuda2.sgi.com [192.48.176.25]) by relay1.corp.sgi.com (Postfix) with ESMTP id D7EAC8F8033 for ; Thu, 11 Feb 2016 15:48:16 -0800 (PST) X-ASG-Debug-ID: 1455234494-04cbb043338a260001-NocioJ Received: from aserp1040.oracle.com (aserp1040.oracle.com [141.146.126.69]) by cuda.sgi.com with ESMTP id diHLMMhjetcZwcZ0 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO) for ; Thu, 11 Feb 2016 15:48:14 -0800 (PST) X-Barracuda-Envelope-From: darrick.wong@oracle.com X-Barracuda-Apparent-Source-IP: 141.146.126.69 Received: from userv0022.oracle.com (userv0022.oracle.com [156.151.31.74]) by aserp1040.oracle.com (Sentrion-MTA-4.3.2/Sentrion-MTA-4.3.2) with ESMTP id u1BNm9pT030683 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 11 Feb 2016 23:48:10 GMT Received: from userv0122.oracle.com (userv0122.oracle.com [156.151.31.75]) by userv0022.oracle.com (8.14.4/8.13.8) with ESMTP id u1BNm9ss013796 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL); Thu, 11 Feb 2016 23:48:09 GMT Received: from abhmp0006.oracle.com (abhmp0006.oracle.com [141.146.116.12]) by userv0122.oracle.com (8.14.4/8.14.4) with ESMTP id u1BNm99Z001051; Thu, 11 Feb 2016 23:48:09 GMT Received: from localhost (/10.145.178.207) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Thu, 11 Feb 2016 15:48:09 -0800 Date: Thu, 11 Feb 2016 15:48:07 -0800 From: "Darrick J. Wong" To: david@fromorbit.com Cc: xfs@oss.sgi.com Subject: Re: [PATCH 2/5] libxfs: refactor the btree size calculator code Message-ID: <20160211234807.GI6350@birch.djwong.org> X-ASG-Orig-Subj: Re: [PATCH 2/5] libxfs: refactor the btree size calculator code References: <20160123003502.2475.99558.stgit@birch.djwong.org> <20160123003508.2475.53723.stgit@birch.djwong.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20160123003508.2475.53723.stgit@birch.djwong.org> User-Agent: Mutt/1.5.21 (2010-09-15) X-Source-IP: userv0022.oracle.com [156.151.31.74] X-Barracuda-Connect: aserp1040.oracle.com[141.146.126.69] X-Barracuda-Start-Time: 1455234494 X-Barracuda-Encrypted: ECDHE-RSA-AES256-GCM-SHA384 X-Barracuda-URL: https://192.48.176.25:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-BRTS-Status: 1 X-Barracuda-Spam-Score: 0.00 X-Barracuda-Spam-Status: No, SCORE=0.00 using per-user scores of TAG_LEVEL=1000.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.7 tests=BSF_SC0_MISMATCH_TO, UNPARSEABLE_RELAY X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.3.26959 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 0.00 BSF_SC0_MISMATCH_TO Envelope rcpt doesn't match header 0.00 UNPARSEABLE_RELAY Informational: message has unparseable relay lines On Fri, Jan 22, 2016 at 04:35:08PM -0800, Darrick J. Wong wrote: > Create a macro to generate btree height calculator functions. > This will be used (much) later when we get to the refcount > btree. > > Signed-off-by: Darrick J. Wong > --- > libxfs/xfs_bmap.c | 18 +----------------- > libxfs/xfs_bmap_btree.c | 9 +++++++++ > libxfs/xfs_bmap_btree.h | 3 +++ > libxfs/xfs_btree.c | 28 ++++++++++++++++++++++++++++ > libxfs/xfs_btree.h | 3 +++ > 5 files changed, 44 insertions(+), 17 deletions(-) > > > diff --git a/libxfs/xfs_bmap.c b/libxfs/xfs_bmap.c > index aef7cf3..c134765 100644 > --- a/libxfs/xfs_bmap.c > +++ b/libxfs/xfs_bmap.c > @@ -172,25 +172,9 @@ xfs_bmap_worst_indlen( > xfs_inode_t *ip, /* incore inode pointer */ > xfs_filblks_t len) /* delayed extent length */ > { > - int level; /* btree level number */ > - int maxrecs; /* maximum record count at this level */ > - xfs_mount_t *mp; /* mount structure */ > xfs_filblks_t rval; /* return value */ > > - mp = ip->i_mount; > - maxrecs = mp->m_bmap_dmxr[0]; > - for (level = 0, rval = 0; > - level < XFS_BM_MAXLEVELS(mp, XFS_DATA_FORK); > - level++) { > - len += maxrecs - 1; > - do_div(len, maxrecs); > - rval += len; > - if (len == 1) > - return rval + XFS_BM_MAXLEVELS(mp, XFS_DATA_FORK) - > - level - 1; > - if (level == 0) > - maxrecs = mp->m_bmap_dmxr[1]; > - } > + rval = xfs_bmbt_calc_size(ip->i_mount, len); NAK. This function figures out how many blocks could be required to handle adding (worst-case one-extent-per-block) extents to the bmbt and btree splits all the way up the tree, whereas xfs_btree_calc_size() merely calculates the number of blocks needed to create a tree with some number of records. When I start using the AG reservation code and counting the number of blocks in use at mount time, using the below xfs_btree_calc_size() to calculate the resevation size leads to undersized reservations, which (I think?) explains why I still occasionally run out of blocks when expanding the refcount tree, which is supposed to reserve /all/ the blocks it'll ever need. This function should go back to the way it was, and the xfs_btree_calc_size() function will get fixed to calculate tree size correctly. Also NAK on the kernelside version of this patch. --D > return rval; > } > > diff --git a/libxfs/xfs_bmap_btree.c b/libxfs/xfs_bmap_btree.c > index 2ef1836..3c595e2 100644 > --- a/libxfs/xfs_bmap_btree.c > +++ b/libxfs/xfs_bmap_btree.c > @@ -880,3 +880,12 @@ xfs_bmbt_change_owner( > xfs_btree_del_cursor(cur, error ? XFS_BTREE_ERROR : XFS_BTREE_NOERROR); > return error; > } > + > +xfs_filblks_t > +xfs_bmbt_calc_size( > + struct xfs_mount *mp, > + unsigned long len) > +{ > + return xfs_btree_calc_size(mp, mp->m_bmap_dmxr, > + XFS_BM_MAXLEVELS(mp, XFS_DATA_FORK), len); > +} > diff --git a/libxfs/xfs_bmap_btree.h b/libxfs/xfs_bmap_btree.h > index 819a8a4..04bc6e2 100644 > --- a/libxfs/xfs_bmap_btree.h > +++ b/libxfs/xfs_bmap_btree.h > @@ -140,4 +140,7 @@ extern int xfs_bmbt_change_owner(struct xfs_trans *tp, struct xfs_inode *ip, > extern struct xfs_btree_cur *xfs_bmbt_init_cursor(struct xfs_mount *, > struct xfs_trans *, struct xfs_inode *, int); > > +extern xfs_filblks_t xfs_bmbt_calc_size(struct xfs_mount *mp, > + unsigned long len); > + > #endif /* __XFS_BMAP_BTREE_H__ */ > diff --git a/libxfs/xfs_btree.c b/libxfs/xfs_btree.c > index 658f27e..d5f16c5 100644 > --- a/libxfs/xfs_btree.c > +++ b/libxfs/xfs_btree.c > @@ -4081,6 +4081,34 @@ xfs_btree_change_owner( > return 0; > } > > +/* > + * xfs_btree_calc_size() -- Calculate the number of blocks needed to store > + * a given number of records. > + */ > +xfs_filblks_t > +xfs_btree_calc_size( > + struct xfs_mount *mp, > + uint *limits, > + int maxlevels, > + unsigned long len) > +{ > + int level; > + int maxrecs; > + xfs_filblks_t rval; > + > + maxrecs = limits[0]; > + for (level = 0, rval = 0; level < maxlevels; level++) { > + len += maxrecs - 1; > + do_div(len, maxrecs); > + rval += len; > + if (len == 1) > + return rval + maxlevels - level - 1; > + if (level == 0) > + maxrecs = limits[1]; > + } > + return rval; > +} > + > /** > * xfs_btree_sblock_v5hdr_verify() -- verify the v5 fields of a short-format > * btree block > diff --git a/libxfs/xfs_btree.h b/libxfs/xfs_btree.h > index 48cb251..b25ffd3 100644 > --- a/libxfs/xfs_btree.h > +++ b/libxfs/xfs_btree.h > @@ -465,6 +465,9 @@ static inline int xfs_btree_get_level(struct xfs_btree_block *block) > #define XFS_BTREE_TRACE_ARGR(c, r) > #define XFS_BTREE_TRACE_CURSOR(c, t) > > +xfs_filblks_t xfs_btree_calc_size(struct xfs_mount *mp, uint *limits, > + int maxlevels, unsigned long len); > + > bool xfs_btree_sblock_v5hdr_verify(struct xfs_buf *bp); > bool xfs_btree_sblock_verify(struct xfs_buf *bp, unsigned int max_recs); > > > _______________________________________________ > xfs mailing list > xfs@oss.sgi.com > http://oss.sgi.com/mailman/listinfo/xfs From sandeen@sandeen.net Thu Feb 11 18:19:24 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=ham version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay3.corp.sgi.com [198.149.34.15]) by oss.sgi.com (Postfix) with ESMTP id 7FC4E7CA4 for ; Thu, 11 Feb 2016 18:19:24 -0600 (CST) Received: from cuda.sgi.com (cuda1.sgi.com [192.48.157.11]) by relay3.corp.sgi.com (Postfix) with ESMTP id F019AAC007 for ; Thu, 11 Feb 2016 16:19:17 -0800 (PST) X-ASG-Debug-ID: 1455236354-04bdf066ea744a0001-NocioJ Received: from sandeen.net (sandeen.net [63.231.237.45]) by cuda.sgi.com with ESMTP id ovLOgUfOT8XwdDDt for ; Thu, 11 Feb 2016 16:19:14 -0800 (PST) X-Barracuda-Envelope-From: sandeen@sandeen.net X-Barracuda-Apparent-Source-IP: 63.231.237.45 Received: from Liberator.local (70-90-76-85-BusName-mn.hfc.comcastbusiness.net [70.90.76.85]) (using TLSv1.2 with cipher DHE-RSA-AES128-SHA (128/128 bits)) (No client certificate requested) by sandeen.net (Postfix) with ESMTPSA id C13B863C5FF0 for ; Thu, 11 Feb 2016 18:19:13 -0600 (CST) Subject: Re: [PATCH 2/2 v3] xfs_repair: new secondary superblock search method To: xfs@oss.sgi.com X-ASG-Orig-Subj: Re: [PATCH 2/2 v3] xfs_repair: new secondary superblock search method References: <1455130218-8683-1-git-send-email-billodo@redhat.com> From: Eric Sandeen Message-ID: <56BD2500.4080708@sandeen.net> Date: Thu, 11 Feb 2016 18:19:12 -0600 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.11; rv:38.0) Gecko/20100101 Thunderbird/38.5.1 MIME-Version: 1.0 In-Reply-To: <1455130218-8683-1-git-send-email-billodo@redhat.com> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit X-Barracuda-Connect: sandeen.net[63.231.237.45] X-Barracuda-Start-Time: 1455236354 X-Barracuda-URL: https://192.48.157.11:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-BRTS-Status: 1 X-Barracuda-Spam-Score: 0.00 X-Barracuda-Spam-Status: No, SCORE=0.00 using per-user scores of TAG_LEVEL=1000.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.7 tests= X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.3.26961 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- Hi Bill, looks like this is a diff on top of your prior patch, not a standalone patch. It's modifying (not creating) libxcmd/topology.c, which doesn't exist upstream yet. A couple small formatting things below, might save one more round trip ;) -Eric On 2/10/16 12:50 PM, Bill O'Donnell wrote: > Optimize secondary sb search, using similar method to find > fs geometry as that of xfs_mkfs. If this faster method fails > in finding a secondary sb, fall back to original brute force > slower search. > > Signed-off-by: Bill O'Donnell > --- > Makefile | 2 +- > include/libxcmd.h | 4 +++- > libxcmd/topology.c | 36 ++++++++++++++++++++++++++++++++---- > repair/Makefile | 4 ++-- > repair/sb.c | 50 +++++++++++++++++++++++++++++++++++++++++--------- > 5 files changed, 79 insertions(+), 17 deletions(-) > > diff --git a/Makefile b/Makefile > index fca0a42..1d60d9c 100644 > --- a/Makefile > +++ b/Makefile > @@ -80,7 +80,7 @@ fsr: libhandle > growfs: libxcmd > io: libxcmd libhandle > quota: libxcmd > -repair: libxlog > +repair: libxlog libxcmd > copy: libxlog > > ifeq ($(HAVE_BUILDDEFS), yes) > diff --git a/include/libxcmd.h b/include/libxcmd.h > index df7046e..b140adb 100644 > --- a/include/libxcmd.h > +++ b/include/libxcmd.h > @@ -50,6 +50,8 @@ extern int > check_overwrite( > char *device); > > - > +extern int guess_default_geometry(__uint64_t *agsize, > + __uint64_t *agcount, > + libxfs_init_t x); > > #endif /* __LIBXCMD_H__ */ > diff --git a/libxcmd/topology.c b/libxcmd/topology.c > index 0eeea28..5f06be5 100644 > --- a/libxcmd/topology.c > +++ b/libxcmd/topology.c > @@ -192,7 +192,8 @@ out: > return ret; > } > > -static void blkid_get_topology( > +static void > +blkid_get_topology( > const char *device, > int *sunit, > int *swidth, > @@ -284,7 +285,8 @@ check_overwrite( > return 1; > } > > -static void blkid_get_topology( > +static void > +blkid_get_topology( > const char *device, > int *sunit, > int *swidth, > @@ -302,8 +304,8 @@ static void blkid_get_topology( > > #endif /* ENABLE_BLKID */ > > - > -void get_topology( > +void > +get_topology( > libxfs_init_t *xi, > struct fs_topology *ft, > int force_overwrite) > @@ -346,3 +348,29 @@ void get_topology( > &lsectorsize, &psectorsize, force_overwrite); > } > } > + > +int > +guess_default_geometry( > + __uint64_t *agsize, __uint64_t *agcount, > + libxfs_init_t x) move all the args onto their own lines, with consistent tab-spacing. > +{ > + struct fs_topology ft; > + int blocklog; > + __uint64_t dblocks; > + int multidisk; consistent tabs out here, too please. > + > + memset(&ft, 0, sizeof(ft)); > + get_topology(&x, &ft, 1); > + > + /* > + * get geometry from get_topology result. > + * Use default block size (2^12) > + */ > + blocklog = 12; > + multidisk = ft.dswidth | ft.dsunit; > + dblocks = x.dsize >> (blocklog - BBSHIFT); > + calc_default_ag_geometry(blocklog, dblocks, multidisk, > + agsize, agcount); > + > + return blocklog; > +} > diff --git a/repair/Makefile b/repair/Makefile > index 251722b..d24ab1f 100644 > --- a/repair/Makefile > +++ b/repair/Makefile > @@ -20,8 +20,8 @@ CFILES = agheader.c attr_repair.c avl.c avl64.c bmap.c btree.c \ > progress.c prefetch.c rt.c sb.c scan.c threads.c \ > versions.c xfs_repair.c > > -LLDLIBS = $(LIBXFS) $(LIBXLOG) $(LIBUUID) $(LIBRT) $(LIBPTHREAD) > -LTDEPENDENCIES = $(LIBXFS) $(LIBXLOG) > +LLDLIBS = $(LIBBLKID) $(LIBXFS) $(LIBXLOG) $(LIBUUID) $(LIBRT) $(LIBPTHREAD) $(LIBXCMD) > +LTDEPENDENCIES = $(LIBXFS) $(LIBXLOG) $(LIBXCMD) > LLDFLAGS = -static-libtool-libs > > default: depend $(LTCOMMAND) > diff --git a/repair/sb.c b/repair/sb.c > index 4eef14a..d91990a 100644 > --- a/repair/sb.c > +++ b/repair/sb.c > @@ -17,6 +17,7 @@ > */ > > #include "libxfs.h" > +#include "libxcmd.h" > #include "libxlog.h" > #include "agheader.h" > #include "globals.h" > @@ -85,10 +86,15 @@ copy_sb(xfs_sb_t *source, xfs_sb_t *dest) > } > > /* > - * find a secondary superblock, copy it into the sb buffer > + * find a secondary superblock, copy it into the sb buffer. > + * start is the point to begin reading BSIZE bytes. > + * skip contains a byte-count of how far to advance for next read. > */ > -int > -find_secondary_sb(xfs_sb_t *rsb) > +static int > +__find_secondary_sb( > + xfs_sb_t *rsb, > + __uint64_t start, > + __uint64_t skip) > { > xfs_off_t off; > xfs_sb_t *sb; > @@ -101,7 +107,6 @@ find_secondary_sb(xfs_sb_t *rsb) > int bsize; > > do_warn(_("\nattempting to find secondary superblock...\n")); > - > sb = (xfs_sb_t *)memalign(libxfs_device_alignment(), BSIZE); > if (!sb) { > do_error( > @@ -117,7 +122,7 @@ find_secondary_sb(xfs_sb_t *rsb) > /* > * skip first sector since we know that's bad > */ > - for (done = 0, off = XFS_AG_MIN_BYTES; !done ; off += bsize) { > + for (done = 0, off = start; !done ; off += skip) { > /* > * read disk 1 MByte at a time. > */ > @@ -128,9 +133,7 @@ find_secondary_sb(xfs_sb_t *rsb) > if (!done && (bsize = read(x.dfd, sb, BSIZE)) <= 0) { > done = 1; > } > - > do_warn("."); > - > /* > * check the buffer 512 bytes at a time since > * we don't know how big the sectors really are. > @@ -164,9 +167,38 @@ find_secondary_sb(xfs_sb_t *rsb) > } > } > } > - > free(sb); > - return(retval); > + return retval; > +} > + > +int > +find_secondary_sb(xfs_sb_t *rsb) > +{ > + int retval; > + __uint64_t agcount; > + __uint64_t agsize; > + __uint64_t skip; > + int blocklog; > + > + /* > + * Attempt to find secondary sb with a coarse approach, > + * using a large skip (agsize in bytes). Failing that, > + * fallback to the fine-grained approach using min agsize. > + */ > + blocklog = guess_default_geometry(&agsize, &agcount, x); > + > + /* > + * use found ag geometry to quickly find secondary sb > + */ > + skip = agsize << blocklog; > + retval = __find_secondary_sb(rsb, skip, skip); > + if (!retval) { > + /* > + * fallback: use minimum agsize for skipsize > + */ > + retval = __find_secondary_sb(rsb, XFS_AG_MIN_BYTES, BSIZE); > + } > + return retval; > } > > /* > From david@fromorbit.com Thu Feb 11 19:07:56 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=ham version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay2.corp.sgi.com [137.38.102.29]) by oss.sgi.com (Postfix) with ESMTP id F2F5C7CA2 for ; Thu, 11 Feb 2016 19:07:55 -0600 (CST) Received: from cuda.sgi.com (cuda2.sgi.com [192.48.176.25]) by relay2.corp.sgi.com (Postfix) with ESMTP id D5EE1304059 for ; Thu, 11 Feb 2016 17:07:52 -0800 (PST) X-ASG-Debug-ID: 1455239269-04cbb043348b830001-NocioJ Received: from ipmail06.adl2.internode.on.net (ipmail06.adl2.internode.on.net [150.101.137.129]) by cuda.sgi.com with ESMTP id rLMB43IB22wkbZGZ for ; Thu, 11 Feb 2016 17:07:49 -0800 (PST) X-Barracuda-Envelope-From: david@fromorbit.com X-Barracuda-Apparent-Source-IP: 150.101.137.129 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: A2BqCQDsL71WPBATLHleKAECgw+BP4Jog3qBeZ1hBotqhUWECIYHAgIBAQKBOE0BAQEBAQEHAQEBAUE/hEIBAQQnExwjEAgDGAklDwUlAwcaE4gZwUgBAQEHAgEdGIUxhH6IbAWHU48kjUqOfY4+hFooLogfAQEB Received: from ppp121-44-19-16.lns20.syd4.internode.on.net (HELO dastard) ([121.44.19.16]) by ipmail06.adl2.internode.on.net with ESMTP; 12 Feb 2016 11:37:22 +1030 Received: from dave by dastard with local (Exim 4.80) (envelope-from ) id 1aU2Cg-0001gz-8q; Fri, 12 Feb 2016 12:07:22 +1100 Date: Fri, 12 Feb 2016 12:07:22 +1100 From: Dave Chinner To: "Darrick J. Wong" Cc: xfs@oss.sgi.com Subject: Re: [PATCH 2/5] libxfs: refactor the btree size calculator code Message-ID: <20160212010722.GV14668@dastard> X-ASG-Orig-Subj: Re: [PATCH 2/5] libxfs: refactor the btree size calculator code References: <20160123003502.2475.99558.stgit@birch.djwong.org> <20160123003508.2475.53723.stgit@birch.djwong.org> <20160211234807.GI6350@birch.djwong.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20160211234807.GI6350@birch.djwong.org> User-Agent: Mutt/1.5.21 (2010-09-15) X-Barracuda-Connect: ipmail06.adl2.internode.on.net[150.101.137.129] X-Barracuda-Start-Time: 1455239269 X-Barracuda-URL: https://192.48.176.25:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-BRTS-Status: 1 X-Barracuda-Spam-Score: 0.00 X-Barracuda-Spam-Status: No, SCORE=0.00 using per-user scores of TAG_LEVEL=1000.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.7 tests=BSF_SC0_MISMATCH_TO X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.3.26963 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 0.00 BSF_SC0_MISMATCH_TO Envelope rcpt doesn't match header On Thu, Feb 11, 2016 at 03:48:07PM -0800, Darrick J. Wong wrote: > On Fri, Jan 22, 2016 at 04:35:08PM -0800, Darrick J. Wong wrote: > > Create a macro to generate btree height calculator functions. > > This will be used (much) later when we get to the refcount > > btree. > > > > Signed-off-by: Darrick J. Wong > > --- > > libxfs/xfs_bmap.c | 18 +----------------- > > libxfs/xfs_bmap_btree.c | 9 +++++++++ > > libxfs/xfs_bmap_btree.h | 3 +++ > > libxfs/xfs_btree.c | 28 ++++++++++++++++++++++++++++ > > libxfs/xfs_btree.h | 3 +++ > > 5 files changed, 44 insertions(+), 17 deletions(-) > > > > > > diff --git a/libxfs/xfs_bmap.c b/libxfs/xfs_bmap.c > > index aef7cf3..c134765 100644 > > --- a/libxfs/xfs_bmap.c > > +++ b/libxfs/xfs_bmap.c > > @@ -172,25 +172,9 @@ xfs_bmap_worst_indlen( > > xfs_inode_t *ip, /* incore inode pointer */ > > xfs_filblks_t len) /* delayed extent length */ > > { > > - int level; /* btree level number */ > > - int maxrecs; /* maximum record count at this level */ > > - xfs_mount_t *mp; /* mount structure */ > > xfs_filblks_t rval; /* return value */ > > > > - mp = ip->i_mount; > > - maxrecs = mp->m_bmap_dmxr[0]; > > - for (level = 0, rval = 0; > > - level < XFS_BM_MAXLEVELS(mp, XFS_DATA_FORK); > > - level++) { > > - len += maxrecs - 1; > > - do_div(len, maxrecs); > > - rval += len; > > - if (len == 1) > > - return rval + XFS_BM_MAXLEVELS(mp, XFS_DATA_FORK) - > > - level - 1; > > - if (level == 0) > > - maxrecs = mp->m_bmap_dmxr[1]; > > - } > > + rval = xfs_bmbt_calc_size(ip->i_mount, len); > > NAK. This function figures out how many blocks could be required to handle > adding (worst-case one-extent-per-block) extents to the bmbt and btree splits > all the way up the tree, whereas xfs_btree_calc_size() merely calculates the > number of blocks needed to create a tree with some number of records. When I > start using the AG reservation code and counting the number of blocks in use at > mount time, using the below xfs_btree_calc_size() to calculate the resevation > size leads to undersized reservations, which (I think?) explains why I still > occasionally run out of blocks when expanding the refcount tree, which is > supposed to reserve /all/ the blocks it'll ever need. > > This function should go back to the way it was, and the xfs_btree_calc_size() > function will get fixed to calculate tree size correctly. > > Also NAK on the kernelside version of this patch. Thanks for the heads-up, Darrick. I hadn't pulled this in to either tree yet, because it hadn't got a reviewed-by. I guess that's a sign that the process is working as it should. :P Cheers, Dave. -- Dave Chinner david@fromorbit.com From darrick.wong@oracle.com Thu Feb 11 19:24:41 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay3.corp.sgi.com [198.149.34.15]) by oss.sgi.com (Postfix) with ESMTP id 309017CA2 for ; Thu, 11 Feb 2016 19:24:41 -0600 (CST) Received: from cuda.sgi.com (cuda3.sgi.com [192.48.176.15]) by relay3.corp.sgi.com (Postfix) with ESMTP id ABEC5AC006 for ; Thu, 11 Feb 2016 17:24:40 -0800 (PST) X-ASG-Debug-ID: 1455240274-04cb6c1e56748d0001-NocioJ Received: from aserp1040.oracle.com (aserp1040.oracle.com [141.146.126.69]) by cuda.sgi.com with ESMTP id QCwFf116PybedM9w (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO) for ; Thu, 11 Feb 2016 17:24:35 -0800 (PST) X-Barracuda-Envelope-From: darrick.wong@oracle.com X-Barracuda-Apparent-Source-IP: 141.146.126.69 Received: from aserv0022.oracle.com (aserv0022.oracle.com [141.146.126.234]) by aserp1040.oracle.com (Sentrion-MTA-4.3.2/Sentrion-MTA-4.3.2) with ESMTP id u1C1OYnR019305 (version=TLSv1 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Fri, 12 Feb 2016 01:24:34 GMT Received: from aserv0122.oracle.com (aserv0122.oracle.com [141.146.126.236]) by aserv0022.oracle.com (8.13.8/8.13.8) with ESMTP id u1C1OXWk021007 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=FAIL); Fri, 12 Feb 2016 01:24:34 GMT Received: from abhmp0016.oracle.com (abhmp0016.oracle.com [141.146.116.22]) by aserv0122.oracle.com (8.13.8/8.13.8) with ESMTP id u1C1OXPb031944; Fri, 12 Feb 2016 01:24:33 GMT Received: from localhost (/98.246.5.19) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Thu, 11 Feb 2016 17:24:33 -0800 Date: Thu, 11 Feb 2016 17:24:32 -0800 From: "Darrick J. Wong" To: Dave Chinner Cc: xfs@oss.sgi.com Subject: Re: [PATCH 2/5] libxfs: refactor the btree size calculator code Message-ID: <20160212012432.GA26204@birch.djwong.org> X-ASG-Orig-Subj: Re: [PATCH 2/5] libxfs: refactor the btree size calculator code References: <20160123003502.2475.99558.stgit@birch.djwong.org> <20160123003508.2475.53723.stgit@birch.djwong.org> <20160211234807.GI6350@birch.djwong.org> <20160212010722.GV14668@dastard> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20160212010722.GV14668@dastard> User-Agent: Mutt/1.5.21 (2010-09-15) X-Source-IP: aserv0022.oracle.com [141.146.126.234] X-Barracuda-Connect: aserp1040.oracle.com[141.146.126.69] X-Barracuda-Start-Time: 1455240275 X-Barracuda-Encrypted: ECDHE-RSA-AES256-GCM-SHA384 X-Barracuda-URL: https://192.48.176.15:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-BRTS-Status: 1 X-Barracuda-Spam-Score: 0.00 X-Barracuda-Spam-Status: No, SCORE=0.00 using per-user scores of TAG_LEVEL=1000.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.7 tests=BSF_SC0_MISMATCH_TO, UNPARSEABLE_RELAY X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.3.26963 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 0.00 BSF_SC0_MISMATCH_TO Envelope rcpt doesn't match header 0.00 UNPARSEABLE_RELAY Informational: message has unparseable relay lines On Fri, Feb 12, 2016 at 12:07:22PM +1100, Dave Chinner wrote: > On Thu, Feb 11, 2016 at 03:48:07PM -0800, Darrick J. Wong wrote: > > On Fri, Jan 22, 2016 at 04:35:08PM -0800, Darrick J. Wong wrote: > > > Create a macro to generate btree height calculator functions. > > > This will be used (much) later when we get to the refcount > > > btree. > > > > > > Signed-off-by: Darrick J. Wong > > > --- > > > libxfs/xfs_bmap.c | 18 +----------------- > > > libxfs/xfs_bmap_btree.c | 9 +++++++++ > > > libxfs/xfs_bmap_btree.h | 3 +++ > > > libxfs/xfs_btree.c | 28 ++++++++++++++++++++++++++++ > > > libxfs/xfs_btree.h | 3 +++ > > > 5 files changed, 44 insertions(+), 17 deletions(-) > > > > > > > > > diff --git a/libxfs/xfs_bmap.c b/libxfs/xfs_bmap.c > > > index aef7cf3..c134765 100644 > > > --- a/libxfs/xfs_bmap.c > > > +++ b/libxfs/xfs_bmap.c > > > @@ -172,25 +172,9 @@ xfs_bmap_worst_indlen( > > > xfs_inode_t *ip, /* incore inode pointer */ > > > xfs_filblks_t len) /* delayed extent length */ > > > { > > > - int level; /* btree level number */ > > > - int maxrecs; /* maximum record count at this level */ > > > - xfs_mount_t *mp; /* mount structure */ > > > xfs_filblks_t rval; /* return value */ > > > > > > - mp = ip->i_mount; > > > - maxrecs = mp->m_bmap_dmxr[0]; > > > - for (level = 0, rval = 0; > > > - level < XFS_BM_MAXLEVELS(mp, XFS_DATA_FORK); > > > - level++) { > > > - len += maxrecs - 1; > > > - do_div(len, maxrecs); > > > - rval += len; > > > - if (len == 1) > > > - return rval + XFS_BM_MAXLEVELS(mp, XFS_DATA_FORK) - > > > - level - 1; > > > - if (level == 0) > > > - maxrecs = mp->m_bmap_dmxr[1]; > > > - } > > > + rval = xfs_bmbt_calc_size(ip->i_mount, len); > > > > NAK. This function figures out how many blocks could be required to handle > > adding (worst-case one-extent-per-block) extents to the bmbt and btree splits > > all the way up the tree, whereas xfs_btree_calc_size() merely calculates the > > number of blocks needed to create a tree with some number of records. When I > > start using the AG reservation code and counting the number of blocks in use at > > mount time, using the below xfs_btree_calc_size() to calculate the resevation > > size leads to undersized reservations, which (I think?) explains why I still > > occasionally run out of blocks when expanding the refcount tree, which is > > supposed to reserve /all/ the blocks it'll ever need. > > > > This function should go back to the way it was, and the xfs_btree_calc_size() > > function will get fixed to calculate tree size correctly. > > > > Also NAK on the kernelside version of this patch. > > Thanks for the heads-up, Darrick. I hadn't pulled this in to either > tree yet, because it hadn't got a reviewed-by. I guess that's a sign > that the process is working as it should. :P lol. :) I'll post a branch off of your for-next 4.6 branch soon; it'll have all the fixes that have been accumulating since the last RFC posting. --D > > Cheers, > > Dave. > -- > Dave Chinner > david@fromorbit.com From david@fromorbit.com Thu Feb 11 21:34:01 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=ham version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay3.corp.sgi.com [198.149.34.15]) by oss.sgi.com (Postfix) with ESMTP id 67E337CA2 for ; Thu, 11 Feb 2016 21:34:01 -0600 (CST) Received: from cuda.sgi.com (cuda2.sgi.com [192.48.176.25]) by relay3.corp.sgi.com (Postfix) with ESMTP id DE26BAC003 for ; Thu, 11 Feb 2016 19:33:57 -0800 (PST) X-ASG-Debug-ID: 1455248032-04cbb043338e0c0001-NocioJ Received: from ipmail06.adl2.internode.on.net (ipmail06.adl2.internode.on.net [150.101.137.129]) by cuda.sgi.com with ESMTP id 7rSGHO35uWyy6iMP for ; Thu, 11 Feb 2016 19:33:53 -0800 (PST) X-Barracuda-Envelope-From: david@fromorbit.com X-Barracuda-Apparent-Source-IP: 150.101.137.129 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: A2CCCgAoUr1WPBATLHleKAECgw8iMG2CaIN6gXmdQwIcBoEPilsmhR+ECBcChW4CAgGBO00BAQEBAQEHAQEBAUE/hR47JAwoBSUDBy2IGaJUnwQIGIUxiQsKWoIJC0CBJwWHU48khU6HfIFlSocfhS0Cjj6CGAsBAQE7HIFdKC6GZ4E4AQEB Received: from ppp121-44-19-16.lns20.syd4.internode.on.net (HELO dastard) ([121.44.19.16]) by ipmail06.adl2.internode.on.net with ESMTP; 12 Feb 2016 14:03:08 +1030 Received: from dave by dastard with local (Exim 4.80) (envelope-from ) id 1aU4Ta-0001tU-QU for xfs@oss.sgi.com; Fri, 12 Feb 2016 14:32:58 +1100 Date: Fri, 12 Feb 2016 14:32:58 +1100 From: Dave Chinner To: xfs@oss.sgi.com Subject: [ANNOUNCE] xfsprogs: master branch updated to 1b9fecf Message-ID: <20160212033258.GN19486@dastard> X-ASG-Orig-Subj: [ANNOUNCE] xfsprogs: master branch updated to 1b9fecf MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="i0/AhcQY5QxfSsSZ" Content-Disposition: inline User-Agent: Mutt/1.5.21 (2010-09-15) X-Barracuda-Connect: ipmail06.adl2.internode.on.net[150.101.137.129] X-Barracuda-Start-Time: 1455248032 X-Barracuda-URL: https://192.48.176.25:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-BRTS-Status: 1 X-Barracuda-Spam-Score: 0.00 X-Barracuda-Spam-Status: No, SCORE=0.00 using per-user scores of TAG_LEVEL=1000.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.7 tests= X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.3.26965 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- --i0/AhcQY5QxfSsSZ Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Hi Folks, The xfsprogs repository at: git://git.kernel.org/pub/scm/fs/xfs/xfsprogs-dev.git has just been updated. This contains all the current development, and will be the basis of the upcoming 4.5 release. Still pending is a user/kernel libxfs sync, so there will still be a few changes to come from that before a 4.5-rc1 is tagged. -Dave. The new head of the master branch is commit: 1b9fecf libxfs: reset dirty buffer priority on lookup New Commits: Carlos Maiolino (1): [feb3d9c] include: Minor whitespace cleanup Darrick J. Wong (4): [9a5fc88] libxfs: move struct xfs_attr_shortform to xfs_da_format.h [bcb416e] xfs_io: print dedupe errors to stderr, not stdout [00d5042] xfs_io: detect the '-R' option in getopt [e50c637] mkfs: factor finobt changes into min log size when formatti= ng Dave Chinner (10): [a7302f8] metadump: clean up btree block region zeroing [6058426] metadump: bounds check btree block regions being zeroed [c1c3d92] xfs_mdrestore: correctly account bytes read [e161d4a] repair: parallelise phase 7 [8100dd7] repair: parallelise uncertin inode processing in phase 3 [4280e59] libxfs: directory node splitting does not have an extra blo= ck [0a7942b] libxfs: don't discard dirty buffers [e8f1e8a] libxfs: don't repeatedly shake unwritable buffers [aef29e1] libxfs: keep unflushable buffers off the cache MRUs [1b9fecf] libxfs: reset dirty buffer priority on lookup Eric Sandeen (8): [11202ec] libxfs: don't pass negative errnos to strerror() [513fc42] xfs_quota: define Q_XGETNEXTQUOTA [cc15c8c] xfs_quota: make report_mount() & dump_file() take an "outpu= t id" [6a9a085] xfs_quota: use Q_XGETNEXTQUOTA for report and dump [75005bf] mkfs.xfs.8: Clarify mkfs vs. mount block size limits. [add8ff6] xfs_repair: Fix untranslatable strings [d1fe6ff] xfs_quota: remove extra 30 seconds from time limit reporting [75f7058] xfs_quota: fix up timer command help Felix Janda (3): [0e2fb84] xfs_fsr: Include for _PATH_MOUNTED [cb898f1] linux.h: Use off64_t instead of loff_t [7c66b2f] include/linux.h: Include for fprintf and stderr Joshua Kinard (2): [0caa2ba] configure: remove aio.h check [ad0a1e9] xfs_copy: use POSIX signal API Code Diffstat: configure.ac | 6 +-- copy/xfs_copy.c | 16 ++++-- db/metadump.c | 93 +++++++++++++++++++++-------------- fsr/xfs_fsr.c | 1 + include/cache.h | 17 +++++-- include/linux.h | 3 +- include/xqm.h | 11 +++-- io/pwrite.c | 2 +- io/reflink.c | 6 ++- libxfs/cache.c | 97 ++++++++++++++++++++++++++++-------- libxfs/rdwr.c | 75 ++++++++++++++++------------ libxfs/xfs_attr_sf.h | 16 ------ libxfs/xfs_da_btree.c | 59 +++++++++++----------- libxfs/xfs_da_format.h | 16 ++++++ libxfs/xfs_inode_fork.c | 1 + m4/Makefile | 1 - m4/package_aiodev.m4 | 36 -------------- man/man8/mkfs.xfs.8 | 5 +- mdrestore/xfs_mdrestore.c | 4 +- mkfs/maxtrres.c | 5 +- mkfs/xfs_mkfs.c | 2 +- mkfs/xfs_mkfs.h | 2 +- quota/edit.c | 4 +- quota/linux.c | 2 + quota/quota.h | 3 ++ quota/report.c | 122 ++++++++++++++++++++++++++++++++++++------= ---- quota/util.c | 2 - repair/phase3.c | 59 ++++++++++++++++++---- repair/phase7.c | 75 ++++++++++++++++++---------- repair/progress.c | 4 +- repair/protos.h | 4 +- repair/versions.c | 13 +++-- repair/xfs_repair.c | 4 +- 33 files changed, 495 insertions(+), 271 deletions(-) --=20 Dave Chinner david@fromorbit.com --i0/AhcQY5QxfSsSZ Content-Type: application/pgp-signature; name="signature.asc" Content-Description: Digital signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.12 (GNU/Linux) iQIcBAEBAgAGBQJWvVJqAAoJEK3oKUf0dfodnW8P/AuE9Zjv5obHnMPVG0BNPhlZ vVRLe82hyMQ7d1CYyw7YKopXnoT5rTuRTS5sfuc8lBVzxKcjWKpAIHnuA8borwd7 sPFoob5mVbAYzvRE8cixJslj42FNm6vU9x3eswz/VPrzjmy6AXxyY1TXreludXak c20LGx4mMH1QK2BXSh/b+FtbAzbmPnucD08unnP6xVMgPMwkTXQX1AVUadrvbNSj GORDuuyGsvmU4JhWvuse11BZCgagvX+c2D5dcXNOHsJ6dxHiAT0g4SeppEAaVwLs 8hQsefUuqnxvGWbEnxqn4DiRhnG1blNPsamTukFm6MHudcaG2tm+nkWFyYzmkVhl QIxWnovlBlRZGoZy6k8IMljlbARXTnmKEplp8pOEurNOJYdm7Y13OG4tlpcdZD/J JeUKn9nfEuv/8QOR5nhPNolTOt1h3zpjgdyRQCxy73aeyT3HDtHg16qxM567T8bV a0RvUC5j5BB219gSv0QtP2p7XWc1lUSWyzlmSlvZHgBGILQNx+3MYStx1NbCFk78 yU1tUEZVhtKwLz2BiI4/zlMANXYqnfADMOAvhKIABYU/7M2zgkf/4rNuJN4ZWyLc Opn15HNQalftb1YGTkeY0zBE96EkDk0TySqjN/2cqtXzh1YzoYg3OYlT7A2eUOaQ Glqqy5mRSFYIrlyt3VM8 =GNJR -----END PGP SIGNATURE----- --i0/AhcQY5QxfSsSZ-- From david@fromorbit.com Thu Feb 11 21:44:00 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=ham version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay3.corp.sgi.com [198.149.34.15]) by oss.sgi.com (Postfix) with ESMTP id 444347CA3 for ; Thu, 11 Feb 2016 21:44:00 -0600 (CST) Received: from cuda.sgi.com (cuda3.sgi.com [192.48.176.15]) by relay3.corp.sgi.com (Postfix) with ESMTP id C8E09AC006 for ; Thu, 11 Feb 2016 19:43:59 -0800 (PST) X-ASG-Debug-ID: 1455248636-04cb6c1e5877110001-NocioJ Received: from ipmail06.adl2.internode.on.net (ipmail06.adl2.internode.on.net [150.101.137.129]) by cuda.sgi.com with ESMTP id udpq71rQopcUbDlk for ; Thu, 11 Feb 2016 19:43:57 -0800 (PST) X-Barracuda-Envelope-From: david@fromorbit.com X-Barracuda-Apparent-Source-IP: 150.101.137.129 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: A2ASCQCGVL1WPBATLHleKAECgw9SbYJog3qBeZ1DAhwGgQ+KW4VFhAgZhW4EAoE5TQEBAQEBAQcBAQEBQT+FAhwjGCQ0BSUDBy2IGcFgGIUxiXyDbgWHU48khU6HfIFlhEOIUwKOPoRaKC6GaCWBEgEBAQ Received: from ppp121-44-19-16.lns20.syd4.internode.on.net (HELO dastard) ([121.44.19.16]) by ipmail06.adl2.internode.on.net with ESMTP; 12 Feb 2016 14:13:20 +1030 Received: from dave by dastard with local (Exim 4.80) (envelope-from ) id 1aU4db-0001ve-Ge; Fri, 12 Feb 2016 14:43:19 +1100 Date: Fri, 12 Feb 2016 14:43:19 +1100 From: Dave Chinner To: torvalds@linux-foundation.org Cc: akpm@linux-foundation.org, linux-kernel@vger.kernel.org, xfs@oss.sgi.com Subject: [GIT PULL] xfs: fixes for 4.5-rc4 Message-ID: <20160212034319.GW14668@dastard> X-ASG-Orig-Subj: [GIT PULL] xfs: fixes for 4.5-rc4 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.5.21 (2010-09-15) X-Barracuda-Connect: ipmail06.adl2.internode.on.net[150.101.137.129] X-Barracuda-Start-Time: 1455248636 X-Barracuda-URL: https://192.48.176.15:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-BRTS-Status: 1 X-Barracuda-Spam-Score: 0.00 X-Barracuda-Spam-Status: No, SCORE=0.00 using per-user scores of TAG_LEVEL=1000.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.7 tests=BSF_SC0_MISMATCH_TO X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.3.26965 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 0.00 BSF_SC0_MISMATCH_TO Envelope rcpt doesn't match header Hi Linus, Can you please pull the XFS commit from the tag below? It contains a fix for a regression introduced in 4.5-rc1 by the new log recovery CRC validation code. Thanks! -Dave. The following changes since commit 36f90b0a2ddd60823fe193a85e60ff1906c2a9b3: Linux 4.5-rc2 (2016-01-31 18:12:16 -0800) are available in the git repository at: git://git.kernel.org/pub/scm/linux/kernel/git/dgc/linux-xfs.git tags/xfs-fixes-for-linus-4.5 for you to fetch changes up to 8e0bd4925bf693520295de403483efad4dc5cc16: xfs: fix endianness error when checking log block crc on big endian platforms (2016-02-08 11:03:58 +1100) ---------------------------------------------------------------- xfs: updates for 4.5-rc4 Contains: o fix for endian conversion issue in new CRC validation in log recovery that was discovered on a ppc64 platform. ---------------------------------------------------------------- Darrick J. Wong (1): xfs: fix endianness error when checking log block crc on big endian platforms fs/xfs/xfs_log_recover.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) -- Dave Chinner david@fromorbit.com From david@fromorbit.com Thu Feb 11 21:53:33 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=ham version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay2.corp.sgi.com [137.38.102.29]) by oss.sgi.com (Postfix) with ESMTP id 6D1827CA5 for ; Thu, 11 Feb 2016 21:53:33 -0600 (CST) Received: from cuda.sgi.com (cuda3.sgi.com [192.48.176.15]) by relay2.corp.sgi.com (Postfix) with ESMTP id 50A89304059 for ; Thu, 11 Feb 2016 19:53:30 -0800 (PST) X-ASG-Debug-ID: 1455249207-04cb6c1e57774d0001-NocioJ Received: from ipmail06.adl2.internode.on.net (ipmail06.adl2.internode.on.net [150.101.137.129]) by cuda.sgi.com with ESMTP id ZCT3jNvKjSnFBGIW for ; Thu, 11 Feb 2016 19:53:28 -0800 (PST) X-Barracuda-Envelope-From: david@fromorbit.com X-Barracuda-Apparent-Source-IP: 150.101.137.129 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: A2B7DQDGVr1WPBATLHleKAECgw+BP4Jog3qBeZ1hBotqOIUNhAiGBwICAQECgTVNAQEBAQEBBwEBAQFBP4RCAQEEOhwjEAgDGAklDwUlAwcaE4gZwTYBAQgCHhiFMYR+iGwBBJZ3jUqOfY4+hFooLogfAQEB Received: from ppp121-44-19-16.lns20.syd4.internode.on.net (HELO dastard) ([121.44.19.16]) by ipmail06.adl2.internode.on.net with ESMTP; 12 Feb 2016 14:22:54 +1030 Received: from dave by dastard with local (Exim 4.80) (envelope-from ) id 1aU4mr-0001wW-Jj; Fri, 12 Feb 2016 14:52:53 +1100 Date: Fri, 12 Feb 2016 14:52:53 +1100 From: Dave Chinner To: "Darrick J. Wong" Cc: linux-btrfs@vger.kernel.org, fstests@vger.kernel.org, xfs@oss.sgi.com Subject: Re: [PATCH 12/32] dio: unwritten conversion bug tests Message-ID: <20160212035253.GX14668@dastard> X-ASG-Orig-Subj: Re: [PATCH 12/32] dio: unwritten conversion bug tests References: <20160211233916.2202.40961.stgit@birch.djwong.org> <20160211234037.2202.93885.stgit@birch.djwong.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20160211234037.2202.93885.stgit@birch.djwong.org> User-Agent: Mutt/1.5.21 (2010-09-15) X-Barracuda-Connect: ipmail06.adl2.internode.on.net[150.101.137.129] X-Barracuda-Start-Time: 1455249207 X-Barracuda-URL: https://192.48.176.15:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-BRTS-Status: 1 X-Barracuda-Spam-Score: 0.00 X-Barracuda-Spam-Status: No, SCORE=0.00 using per-user scores of TAG_LEVEL=1000.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.7 tests=BSF_SC0_MISMATCH_TO X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.3.26966 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 0.00 BSF_SC0_MISMATCH_TO Envelope rcpt doesn't match header On Thu, Feb 11, 2016 at 03:40:37PM -0800, Darrick J. Wong wrote: > Check that we don't expose old disk contents when a directio write to > an unwritten extent fails due to IO errors. This primarily affects > XFS and ext4. > > Signed-off-by: Darrick J. Wong aiocp.c: In function 'main': aiocp.c:407:1: warning: format '%d' expects argument of type 'int', but argument 3 has type 'off_t' [-Wformat=] printf("tocopy=%d len=%d blk=%d\n", tocopy, length, aio_blksize); ^ Followup patch is fine, I'll commit as is. Cheers, Dave. -- Dave Chinner david@fromorbit.com From BATV+dc0e37d0786dce58806e+4555+infradead.org+hch@bombadil.srs.infradead.org Fri Feb 12 03:27:44 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=ham version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay1.corp.sgi.com [137.38.102.111]) by oss.sgi.com (Postfix) with ESMTP id 2482B7CA7 for ; Fri, 12 Feb 2016 03:27:44 -0600 (CST) Received: from cuda.sgi.com (cuda1.sgi.com [192.48.157.11]) by relay1.corp.sgi.com (Postfix) with ESMTP id E8ACE8F8035 for ; Fri, 12 Feb 2016 01:27:40 -0800 (PST) X-ASG-Debug-ID: 1455269255-04bdf066ea7e820001-NocioJ Received: from bombadil.infradead.org ([198.137.202.9]) by cuda.sgi.com with ESMTP id cyh2eQaCuAVB3ilB (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128 verify=NO) for ; Fri, 12 Feb 2016 01:27:35 -0800 (PST) X-Barracuda-Envelope-From: BATV+dc0e37d0786dce58806e+4555+infradead.org+hch@bombadil.srs.infradead.org X-Barracuda-Apparent-Source-IP: 198.137.202.9 Received: from hch by bombadil.infradead.org with local (Exim 4.80.1 #2 (Red Hat Linux)) id 1aUA0l-0007q0-Kx; Fri, 12 Feb 2016 09:27:35 +0000 Date: Fri, 12 Feb 2016 01:27:35 -0800 From: Christoph Hellwig To: Mateusz Guzik Cc: xfs@oss.sgi.com, stable@vger.kernel.org Subject: Re: [PATCH] xfs: fix two memory leaks in xfs_attr_list.c error paths Message-ID: <20160212092735.GA27496@infradead.org> X-ASG-Orig-Subj: Re: [PATCH] xfs: fix two memory leaks in xfs_attr_list.c error paths References: <1455129337-19255-1-git-send-email-mguzik@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1455129337-19255-1-git-send-email-mguzik@redhat.com> User-Agent: Mutt/1.5.24 (2015-08-30) X-SRS-Rewrite: SMTP reverse-path rewritten from by bombadil.infradead.org See http://www.infradead.org/rpr.html X-Barracuda-Connect: UNKNOWN[198.137.202.9] X-Barracuda-Start-Time: 1455269255 X-Barracuda-Encrypted: ECDHE-RSA-AES128-GCM-SHA256 X-Barracuda-URL: https://192.48.157.11:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-BRTS-Status: 1 X-Barracuda-Spam-Score: 0.10 X-Barracuda-Spam-Status: No, SCORE=0.10 using per-user scores of TAG_LEVEL=1000.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.7 tests=BSF_SC0_MISMATCH_TO, RDNS_NONE X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.3.26971 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 0.00 BSF_SC0_MISMATCH_TO Envelope rcpt doesn't match header 0.10 RDNS_NONE Delivered to trusted network by a host with no rDNS On Wed, Feb 10, 2016 at 07:35:37PM +0100, Mateusz Guzik wrote: > This plugs 2 trivial leaks in xfs_attr_shortform_list and > xfs_attr3_leaf_list_int. Can you please add a out: label before the kmem_free at the end of the function, return the actual error value there and make all others returns after the kmem_alloc jump to that label? From BATV+dc0e37d0786dce58806e+4555+infradead.org+hch@bombadil.srs.infradead.org Fri Feb 12 03:30:49 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=ham version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay1.corp.sgi.com [137.38.102.111]) by oss.sgi.com (Postfix) with ESMTP id 19EFB7CA9 for ; Fri, 12 Feb 2016 03:30:49 -0600 (CST) Received: from cuda.sgi.com (cuda1.sgi.com [192.48.157.11]) by relay1.corp.sgi.com (Postfix) with ESMTP id DAA368F804B for ; Fri, 12 Feb 2016 01:30:48 -0800 (PST) X-ASG-Debug-ID: 1455269445-04bdf066ea7e9e0001-NocioJ Received: from bombadil.infradead.org ([198.137.202.9]) by cuda.sgi.com with ESMTP id ZfCVpEC1qG2Giy5d (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128 verify=NO) for ; Fri, 12 Feb 2016 01:30:45 -0800 (PST) X-Barracuda-Envelope-From: BATV+dc0e37d0786dce58806e+4555+infradead.org+hch@bombadil.srs.infradead.org X-Barracuda-Apparent-Source-IP: 198.137.202.9 Received: from hch by bombadil.infradead.org with local (Exim 4.80.1 #2 (Red Hat Linux)) id 1aUA3p-0001IQ-Dm; Fri, 12 Feb 2016 09:30:45 +0000 Date: Fri, 12 Feb 2016 01:30:45 -0800 From: Christoph Hellwig To: Dave Chinner Cc: xfs@oss.sgi.com Subject: Re: [PATCH 2/6] xfs: remove xfs_cancel_ioend Message-ID: <20160212093045.GA4633@infradead.org> X-ASG-Orig-Subj: Re: [PATCH 2/6] xfs: remove xfs_cancel_ioend References: <1455173146-19535-1-git-send-email-david@fromorbit.com> <1455173146-19535-3-git-send-email-david@fromorbit.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1455173146-19535-3-git-send-email-david@fromorbit.com> User-Agent: Mutt/1.5.24 (2015-08-30) X-SRS-Rewrite: SMTP reverse-path rewritten from by bombadil.infradead.org See http://www.infradead.org/rpr.html X-Barracuda-Connect: UNKNOWN[198.137.202.9] X-Barracuda-Start-Time: 1455269445 X-Barracuda-Encrypted: ECDHE-RSA-AES128-GCM-SHA256 X-Barracuda-URL: https://192.48.157.11:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-Spam-Score: 0.10 X-Barracuda-Spam-Status: No, SCORE=0.10 using per-user scores of TAG_LEVEL=1000.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.7 tests=BSF_SC0_MISMATCH_TO, RDNS_NONE X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.3.26971 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 0.00 BSF_SC0_MISMATCH_TO Envelope rcpt doesn't match header 0.10 RDNS_NONE Delivered to trusted network by a host with no rDNS Looks fine, Reviewed-by: Christoph Hellwig From BATV+dc0e37d0786dce58806e+4555+infradead.org+hch@bombadil.srs.infradead.org Fri Feb 12 03:36:12 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=ham version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay1.corp.sgi.com [137.38.102.111]) by oss.sgi.com (Postfix) with ESMTP id 228CB7CAE for ; Fri, 12 Feb 2016 03:36:12 -0600 (CST) Received: from cuda.sgi.com (cuda3.sgi.com [192.48.176.15]) by relay1.corp.sgi.com (Postfix) with ESMTP id 02DBB8F8033 for ; Fri, 12 Feb 2016 01:36:11 -0800 (PST) X-ASG-Debug-ID: 1455269768-04cb6c1e5880a60001-NocioJ Received: from bombadil.infradead.org ([198.137.202.9]) by cuda.sgi.com with ESMTP id 4Ny7C45LI6KbVsLR (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128 verify=NO) for ; Fri, 12 Feb 2016 01:36:08 -0800 (PST) X-Barracuda-Envelope-From: BATV+dc0e37d0786dce58806e+4555+infradead.org+hch@bombadil.srs.infradead.org X-Barracuda-Apparent-Source-IP: 198.137.202.9 Received: from hch by bombadil.infradead.org with local (Exim 4.80.1 #2 (Red Hat Linux)) id 1aUA91-0004U3-Pc; Fri, 12 Feb 2016 09:36:07 +0000 Date: Fri, 12 Feb 2016 01:36:07 -0800 From: Christoph Hellwig To: Dave Chinner Cc: xfs@oss.sgi.com Subject: Re: [PATCH 6/6] xfs: don't chain ioends during writepage submission Message-ID: <20160212093607.GB4633@infradead.org> X-ASG-Orig-Subj: Re: [PATCH 6/6] xfs: don't chain ioends during writepage submission References: <1455173146-19535-1-git-send-email-david@fromorbit.com> <1455173146-19535-7-git-send-email-david@fromorbit.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1455173146-19535-7-git-send-email-david@fromorbit.com> User-Agent: Mutt/1.5.24 (2015-08-30) X-SRS-Rewrite: SMTP reverse-path rewritten from by bombadil.infradead.org See http://www.infradead.org/rpr.html X-Barracuda-Connect: UNKNOWN[198.137.202.9] X-Barracuda-Start-Time: 1455269768 X-Barracuda-Encrypted: ECDHE-RSA-AES128-GCM-SHA256 X-Barracuda-URL: https://192.48.176.15:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-BRTS-Status: 1 X-Barracuda-Spam-Score: 0.10 X-Barracuda-Spam-Status: No, SCORE=0.10 using per-user scores of TAG_LEVEL=1000.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.7 tests=BSF_SC0_MISMATCH_TO, RDNS_NONE X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.3.26971 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 0.00 BSF_SC0_MISMATCH_TO Envelope rcpt doesn't match header 0.10 RDNS_NONE Delivered to trusted network by a host with no rDNS Looks good, Reviewed-by: Christoph Hellwig Tiny nitpick below: > out_error: > /* Now that the code below this label is more than just error handling it might make sense to rename it to just 'out'. From sandeen@sandeen.net Fri Feb 12 08:18:43 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=ham version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay1.corp.sgi.com [137.38.102.111]) by oss.sgi.com (Postfix) with ESMTP id 3E4327CAC for ; Fri, 12 Feb 2016 08:18:43 -0600 (CST) Received: from cuda.sgi.com (cuda2.sgi.com [192.48.176.25]) by relay1.corp.sgi.com (Postfix) with ESMTP id 1D7558F8035 for ; Fri, 12 Feb 2016 06:18:42 -0800 (PST) X-ASG-Debug-ID: 1455286719-04cbb043319aee0001-NocioJ Received: from sandeen.net (sandeen.net [63.231.237.45]) by cuda.sgi.com with ESMTP id sCJNC1c8WBbDIaoc for ; Fri, 12 Feb 2016 06:18:39 -0800 (PST) X-Barracuda-Envelope-From: sandeen@sandeen.net X-Barracuda-Apparent-Source-IP: 63.231.237.45 Received: from liberator.sandeen.net (liberator.sandeen.net [10.0.0.4]) (using TLSv1.2 with cipher DHE-RSA-AES128-SHA (128/128 bits)) (No client certificate requested) by sandeen.net (Postfix) with ESMTPSA id 4115B63C5FF0 for ; Fri, 12 Feb 2016 08:18:39 -0600 (CST) Subject: Re: [PATCH 2/2 v3] xfs_repair: new secondary superblock search method To: xfs@oss.sgi.com X-ASG-Orig-Subj: Re: [PATCH 2/2 v3] xfs_repair: new secondary superblock search method References: <1455130218-8683-1-git-send-email-billodo@redhat.com> <56BD2500.4080708@sandeen.net> From: Eric Sandeen Message-ID: <56BDE9BE.9030300@sandeen.net> Date: Fri, 12 Feb 2016 08:18:38 -0600 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.11; rv:38.0) Gecko/20100101 Thunderbird/38.5.1 MIME-Version: 1.0 In-Reply-To: <56BD2500.4080708@sandeen.net> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit X-Barracuda-Connect: sandeen.net[63.231.237.45] X-Barracuda-Start-Time: 1455286719 X-Barracuda-URL: https://192.48.176.25:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-BRTS-Status: 1 X-Barracuda-Spam-Score: 0.00 X-Barracuda-Spam-Status: No, SCORE=0.00 using per-user scores of TAG_LEVEL=1000.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.7 tests= X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.3.26976 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- On 2/11/16 6:19 PM, Eric Sandeen wrote: > Hi Bill, looks like this is a diff on top of your prior patch, > not a standalone patch. It's modifying (not creating) libxcmd/topology.c, > which doesn't exist upstream yet. Sorry, I apologize - this was patch 2 of 2, and I didn't have patch 1 applied. It's easier to spot dependencies when a series stays properly threaded, though. :) And best to not fix issues with patch 1 in patch 2; just fix things in the original patch which introduced it. i.e. this: --- a/libxcmd/topology.c +++ b/libxcmd/topology.c @@ -192,7 +192,8 @@ out: return ret; } -static void blkid_get_topology( +static void +blkid_get_topology( const char *device, int *sunit, int *swidth, @@ -284,7 +285,8 @@ check_overwrite( return 1; } should all just be formatted as you want it in patch 1. Thanks, -Eric From tytso@thunk.org Fri Feb 12 09:22:43 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=T_DKIM_INVALID autolearn=ham version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay2.corp.sgi.com [137.38.102.29]) by oss.sgi.com (Postfix) with ESMTP id 39C4E7CA5 for ; Fri, 12 Feb 2016 09:22:43 -0600 (CST) Received: from cuda.sgi.com (cuda2.sgi.com [192.48.176.25]) by relay2.corp.sgi.com (Postfix) with ESMTP id 28B07304059 for ; Fri, 12 Feb 2016 07:22:39 -0800 (PST) X-ASG-Debug-ID: 1455290556-04cbb043329c550001-NocioJ Received: from imap.thunk.org (imap.thunk.org [74.207.234.97]) by cuda.sgi.com with ESMTP id J81KswwP75XzckGl (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128 verify=NO) for ; Fri, 12 Feb 2016 07:22:36 -0800 (PST) X-Barracuda-Envelope-From: tytso@thunk.org X-Barracuda-Apparent-Source-IP: 74.207.234.97 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=thunk.org; s=ef5046eb; h=In-Reply-To:Content-Type:MIME-Version:References:Message-ID:Subject:Cc:To:From:Date; bh=vHtVAfsBnE0VYB0tf37z7ify1E7bWUYfkoDMu2RdJoM=; b=DPWX+TiI7AzQ4z5Cg57fIFtyDawdb0QR39QDexokFHLDE7K8fDgKzhZRcIm5NVP0gIACETrkAuKQzsndFDpcnNgk+v/r6JmH/XImY5I8mbQ/YV7kmgzGw9wo9m1v6Iax74zDm3rENlWULNxTVQTaGfgPjGBepswk73XLeel7IN0=; Received: from root (helo=closure.thunk.org) by imap.thunk.org with local-esmtp (Exim 4.84) (envelope-from ) id 1aUFYH-0007Yi-G6; Fri, 12 Feb 2016 15:22:33 +0000 Received: by closure.thunk.org (Postfix, from userid 15806) id D17438202B3; Fri, 12 Feb 2016 10:22:31 -0500 (EST) Date: Fri, 12 Feb 2016 10:22:31 -0500 From: Theodore Ts'o To: Dave Chinner Cc: "Darrick J. Wong" , linux-btrfs@vger.kernel.org, fstests@vger.kernel.org, xfs@oss.sgi.com Subject: Re: [PATCH 12/32] dio: unwritten conversion bug tests Message-ID: <20160212152231.GA7928@thunk.org> X-ASG-Orig-Subj: Re: [PATCH 12/32] dio: unwritten conversion bug tests References: <20160211233916.2202.40961.stgit@birch.djwong.org> <20160211234037.2202.93885.stgit@birch.djwong.org> <20160212035253.GX14668@dastard> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20160212035253.GX14668@dastard> User-Agent: Mutt/1.5.24 (2015-08-30) X-SA-Exim-Connect-IP: X-SA-Exim-Mail-From: tytso@thunk.org X-SA-Exim-Scanned: No (on imap.thunk.org); SAEximRunCond expanded to false X-Barracuda-Connect: imap.thunk.org[74.207.234.97] X-Barracuda-Start-Time: 1455290556 X-Barracuda-Encrypted: ECDHE-RSA-AES128-GCM-SHA256 X-Barracuda-URL: https://192.48.176.25:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-BRTS-Status: 1 X-Barracuda-Spam-Score: 0.00 X-Barracuda-Spam-Status: No, SCORE=0.00 using per-user scores of TAG_LEVEL=1000.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.7 tests=BSF_SC0_MISMATCH_TO, DKIM_SIGNED, DKIM_VERIFIED X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.3.26977 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 0.00 BSF_SC0_MISMATCH_TO Envelope rcpt doesn't match header -0.00 DKIM_VERIFIED Domain Keys Identified Mail: signature passes verification 0.00 DKIM_SIGNED Domain Keys Identified Mail: message has a signature On Fri, Feb 12, 2016 at 02:52:53PM +1100, Dave Chinner wrote: > On Thu, Feb 11, 2016 at 03:40:37PM -0800, Darrick J. Wong wrote: > > Check that we don't expose old disk contents when a directio write to > > an unwritten extent fails due to IO errors. This primarily affects > > XFS and ext4. > > > > Signed-off-by: Darrick J. Wong > > aiocp.c: In function 'main': > aiocp.c:407:1: warning: format '%d' expects argument of type 'int', but argument 3 has type 'off_t' [-Wformat=] > printf("tocopy=%d len=%d blk=%d\n", tocopy, length, aio_blksize); > ^ > > Followup patch is fine, I'll commit as is. Dave, given that Darrick's patches is going to cause more _scratch_mount occurences, how quickly do you plan to commit his patchset? Should I wait until he makes his change before I do the s/_scratch_mount/_scratch_cycle_mount/ change? Should I make that change, and let you fix it up the commit? Thanks, - Ted From zlang@redhat.com Fri Feb 12 10:29:13 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=ham version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay3.corp.sgi.com [198.149.34.15]) by oss.sgi.com (Postfix) with ESMTP id A5F447CB2 for ; Fri, 12 Feb 2016 10:29:13 -0600 (CST) Received: from cuda.sgi.com (cuda3.sgi.com [192.48.176.15]) by relay3.corp.sgi.com (Postfix) with ESMTP id 1A2DCAC007 for ; Fri, 12 Feb 2016 08:29:09 -0800 (PST) X-ASG-Debug-ID: 1455294546-04cb6c1e5693ee0001-NocioJ Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by cuda.sgi.com with ESMTP id jsyEGsth7TMnDooQ (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO) for ; Fri, 12 Feb 2016 08:29:07 -0800 (PST) X-Barracuda-Envelope-From: zlang@redhat.com X-Barracuda-Apparent-Source-IP: 209.132.183.28 X-ASG-Whitelist: Client Received: from int-mx11.intmail.prod.int.phx2.redhat.com (int-mx11.intmail.prod.int.phx2.redhat.com [10.5.11.24]) by mx1.redhat.com (Postfix) with ESMTPS id D19CB372569 for ; Fri, 12 Feb 2016 16:29:06 +0000 (UTC) Received: from localhost (vpn1-7-70.pek2.redhat.com [10.72.7.70]) by int-mx11.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id u1CGT1vH021386; Fri, 12 Feb 2016 11:29:05 -0500 From: Zorro Lang To: xfs@oss.sgi.com Cc: sandeen@redhat.com, Zorro Lang Subject: [PATCH] xfs_quota: modify commands which can't handle multiple types Date: Sat, 13 Feb 2016 00:28:58 +0800 X-ASG-Orig-Subj: [PATCH] xfs_quota: modify commands which can't handle multiple types Message-Id: <1455294538-31583-1-git-send-email-zlang@redhat.com> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.24 X-Barracuda-Connect: mx1.redhat.com[209.132.183.28] X-Barracuda-Start-Time: 1455294547 X-Barracuda-Encrypted: ECDHE-RSA-AES256-GCM-SHA384 X-Barracuda-URL: https://192.48.176.15:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-BRTS-Status: 1 Some xfs_quota commands can't deal with multiple types together. For example, if we run "limit -ug ...", one type will overwrite the other. I find below commands can't handle multiple types: [quota, limit, timer, warn, dump, restore and quot] (Although timer and warn command can't support -ugp types until now, it will in one day.) For every single $command, I change their ${command}_f function, ${command}_help() function, ${command}_cmd structure and man page. Signed-off-by: Zorro Lang --- man/man8/xfs_quota.8 | 96 +++++++++++++++++++++++++++++++++++++++++++++------- quota/edit.c | 78 ++++++++++++++++++++++++++---------------- quota/quot.c | 21 +++++++----- quota/quota.c | 21 +++++++----- quota/report.c | 26 +++++++++----- 5 files changed, 175 insertions(+), 67 deletions(-) diff --git a/man/man8/xfs_quota.8 b/man/man8/xfs_quota.8 index 3bee145..4652dfe 100644 --- a/man/man8/xfs_quota.8 +++ b/man/man8/xfs_quota.8 @@ -169,7 +169,11 @@ command. .HP .B quota [ -.B \-gpu +.B \-g +| +.B \-p +| +.B \-u ] [ .B \-bir ] [ @@ -188,6 +192,12 @@ Show individual usage and limits, for a single user or numeric user .IR ID . The +.B \-u +, +.B \-g +and +.B \-p +types can't used together. The .B \-h option reports in a "human-readable" format similar to the .BR df (1) @@ -398,7 +408,11 @@ option reports state on all filesystems and not just the current path. .B limit [ -.B \-gpu +.B \-g +| +.B \-p +| +.B \-u ] .BI bsoft= N | @@ -426,11 +440,21 @@ that will be used, otherwise a specific .I name or numeric .IR id entifier -must be specified. +must be specified. The +.B \-u +, +.B \-g +and +.B \-p +types can't be used together for this command. .HP .B timer [ -.B \-gpu +.B \-g +| +.B \-p +| +.B \-u ] [ .B \-bir ] @@ -442,11 +466,21 @@ be modified. The current timeout setting can be displayed using the .B state command. The value argument is a number of seconds, but units of \&'minutes', 'hours', 'days', and 'weeks' are also understood -(as are their abbreviations 'm', 'h', 'd', and 'w'). +(as are their abbreviations 'm', 'h', 'd', and 'w'). The +.B \-u +, +.B \-g +and +.B \-p +types can't be used together for this command. .HP .B warn [ -.B \-gpu +.B \-g +| +.B \-p +| +.B \-u ] [ .B \-bir ] @@ -466,7 +500,13 @@ that will be used, otherwise a specific .I name or numeric .IR id entifier -must be specified. +must be specified. The +.B \-u +, +.B \-g +and +.B \-p +types can't be used together for this command. .B NOTE: this feature is not currently implemented. .TP .BR enable " [ " \-gpu " ] [ " \-v " ]" @@ -497,7 +537,11 @@ report an error. .B dump [ -.B \-gpu +.B \-g +| +.B \-p +| +.B \-u ] [ .B \-f .I file @@ -506,11 +550,21 @@ dump Dump out quota limit information for backup utilities, either to standard output (default) or to a .IR file . -This is only the limits, not the usage information, of course. +This is only the limits, not the usage information, of course. The +.B \-u +, +.B \-g +and +.B \-p +types can't be used together for this command. .HP .B restore [ -.B \-gpu +.B \-g +| +.B \-p +| +.B \-u ] [ .B \-f .I file @@ -520,12 +574,22 @@ Restore quota limits from a backup .IR file . The file must be in the format produced by the .B dump -command. +command. The +.B \-u +, +.B \-g +and +.B \-p +types can't be used together for this command. .HP .B quot [ -.B \-gpu +.B \-g +| +.B \-p +| +.B \-u ] [ .B \-bir ] [ @@ -551,7 +615,13 @@ option displays verbose information. The .B \-f option send the output to .I file -instead of stdout. +instead of stdout. The +.B \-u +, +.B \-g +and +.B \-p +types can't be used together for this command. .HP .B project [ diff --git a/quota/edit.c b/quota/edit.c index 6146f7e..9dab4c3 100644 --- a/quota/edit.c +++ b/quota/edit.c @@ -43,9 +43,9 @@ limit_help(void) " block limits that are currently being used for the specified user, group,\n" " or project. The filesystem identified by the current path is modified.\n" " -d -- set the default values, used the first time a file is created\n" -" -g -- modify group quota limits\n" -" -p -- modify project quota limits\n" -" -u -- modify user quota limits\n" +" -g -- modify group quota limits, can't coexist with -p, -u\n" +" -p -- modify project quota limits, can't coexist with -g, -u\n" +" -u -- modify user quota limits, can't coexist with -g, -p\n" " The block limit values can be specified with a units suffix - accepted\n" " units are: k (kilobytes), m (megabytes), g (gigabytes), and t (terabytes).\n" " The user/group/project can be specified either by name or by number.\n" @@ -71,9 +71,9 @@ timer_help(void) " still over the soft limit, the soft limit is enforced as the hard limit.\n" " The default timeout is 7 days.\n" " -d -- set the default values, used the first time a file is created\n" -" -g -- modify group quota timer\n" -" -p -- modify project quota timer\n" -" -u -- modify user quota timer\n" +" -g -- modify group quota timer, can't coexist with -p, -u\n" +" -p -- modify project quota timer, can't coexist with -g, -u\n" +" -u -- modify user quota timer, can't coexist with -g, -p\n" " -b -- modify the blocks-used timer\n" " -i -- modify the inodes-used timer\n" " -r -- modify the blocks-used timer for the (optional) realtime subvolume\n" @@ -103,9 +103,9 @@ warn_help(void) " number of warnings issued to people, and they are penalised if the warnings\n" " are ignored.\n" " -d -- set maximum warning count, which triggers soft limit enforcement\n" -" -g -- set group quota warning count\n" -" -p -- set project quota warning count\n" -" -u -- set user quota warning count\n" +" -g -- set group quota warning count, can't coexist with -p, -u\n" +" -p -- set project quota warning count, can't coexist with -g, -u\n" +" -u -- set user quota warning count, can't coexist with -g, -p\n" " -b -- set the blocks-used warning count\n" " -i -- set the inodes-used warning count\n" " -r -- set the blocks-used warn count for the (optional) realtime subvolume\n" @@ -282,13 +282,13 @@ limit_f( flags |= DEFAULTS_FLAG; break; case 'g': - type = XFS_GROUP_QUOTA; + type |= XFS_GROUP_QUOTA; break; case 'p': - type = XFS_PROJ_QUOTA; + type |= XFS_PROJ_QUOTA; break; case 'u': - type = XFS_USER_QUOTA; + type |= XFS_USER_QUOTA; break; default: return command_usage(&limit_cmd); @@ -343,8 +343,13 @@ limit_f( name = (flags & DEFAULTS_FLAG) ? "0" : argv[optind++]; - if (!type) + if (!type) { type = XFS_USER_QUOTA; + } else if (type != XFS_GROUP_QUOTA + && type != XFS_PROJ_QUOTA + && type != XFS_USER_QUOTA) { + return command_usage(&limit_cmd); + } switch (type) { case XFS_USER_QUOTA: @@ -422,13 +427,13 @@ restore_f( fname = optarg; break; case 'g': - type = XFS_GROUP_QUOTA; + type |= XFS_GROUP_QUOTA; break; case 'p': - type = XFS_PROJ_QUOTA; + type |= XFS_PROJ_QUOTA; break; case 'u': - type = XFS_USER_QUOTA; + type |= XFS_USER_QUOTA; break; default: return command_usage(&restore_cmd); @@ -438,8 +443,13 @@ restore_f( if (argc < optind) return command_usage(&restore_cmd); - if (!type) + if (!type) { type = XFS_USER_QUOTA; + } else if (type != XFS_GROUP_QUOTA + && type != XFS_PROJ_QUOTA + && type != XFS_USER_QUOTA) { + return command_usage(&restore_cmd); + } if (fname) { if ((fp = fopen(fname, "r")) == NULL) { @@ -501,13 +511,13 @@ timer_f( mask |= FS_DQ_RTBTIMER; break; case 'g': - type = XFS_GROUP_QUOTA; + type |= XFS_GROUP_QUOTA; break; case 'p': - type = XFS_PROJ_QUOTA; + type |= XFS_PROJ_QUOTA; break; case 'u': - type = XFS_USER_QUOTA; + type |= XFS_USER_QUOTA; break; default: return command_usage(&timer_cmd); @@ -522,8 +532,13 @@ timer_f( if (!mask) mask = FS_DQ_TIMER_MASK; - if (!type) + if (!type) { type = XFS_USER_QUOTA; + } else if (type != XFS_GROUP_QUOTA + && type != XFS_PROJ_QUOTA + && type != XFS_USER_QUOTA) { + return command_usage(&timer_cmd); + } set_timer(type, mask, fs_path->fs_name, value); return 0; @@ -630,13 +645,13 @@ warn_f( mask |= FS_DQ_RTBWARNS; break; case 'g': - type = XFS_GROUP_QUOTA; + type |= XFS_GROUP_QUOTA; break; case 'p': - type = XFS_PROJ_QUOTA; + type |= XFS_PROJ_QUOTA; break; case 'u': - type = XFS_USER_QUOTA; + type |= XFS_USER_QUOTA; break; default: return command_usage(&warn_cmd); @@ -661,8 +676,13 @@ warn_f( if (!mask) mask = FS_DQ_WARNS_MASK; - if (!type) + if (!type) { type = XFS_USER_QUOTA; + } else if (type != XFS_GROUP_QUOTA + && type != XFS_PROJ_QUOTA + && type != XFS_USER_QUOTA) { + return command_usage(&warn_cmd); + } switch (type) { case XFS_USER_QUOTA: @@ -686,7 +706,7 @@ edit_init(void) limit_cmd.argmin = 2; limit_cmd.argmax = -1; limit_cmd.args = \ - _("[-gpu] bsoft|bhard|isoft|ihard|rtbsoft|rtbhard=N -d|id|name"); + _("[-g|-p|-u] bsoft|bhard|isoft|ihard|rtbsoft|rtbhard=N -d|id|name"); limit_cmd.oneline = _("modify quota limits"); limit_cmd.help = limit_help; @@ -694,14 +714,14 @@ edit_init(void) restore_cmd.cfunc = restore_f; restore_cmd.argmin = 0; restore_cmd.argmax = -1; - restore_cmd.args = _("[-gpu] [-f file]"); + restore_cmd.args = _("[-g|-p|-u] [-f file]"); restore_cmd.oneline = _("restore quota limits from a backup file"); timer_cmd.name = "timer"; timer_cmd.cfunc = timer_f; timer_cmd.argmin = 2; timer_cmd.argmax = -1; - timer_cmd.args = _("[-bir] [-gpu] value"); + timer_cmd.args = _("[-bir] [-g|-p|-u] value"); timer_cmd.oneline = _("set quota enforcement timeouts"); timer_cmd.help = timer_help; @@ -709,7 +729,7 @@ edit_init(void) warn_cmd.cfunc = warn_f; warn_cmd.argmin = 2; warn_cmd.argmax = -1; - warn_cmd.args = _("[-bir] [-gpu] value -d|id|name"); + warn_cmd.args = _("[-bir] [-g|-p|-u] value -d|id|name"); warn_cmd.oneline = _("get/set enforcement warning counter"); warn_cmd.help = warn_help; diff --git a/quota/quot.c b/quota/quot.c index 9116e48..5588a25 100644 --- a/quota/quot.c +++ b/quota/quot.c @@ -62,9 +62,9 @@ quot_help(void) " total of all files greater than 500 kilobytes.\n" " -v -- display three columns containing the number of kilobytes not\n" " accessed in the last 30, 60, and 90 days.\n" -" -g -- display group summary\n" -" -p -- display project summary\n" -" -u -- display user summary\n" +" -g -- display group summary, can't coexist with -p, -u\n" +" -p -- display project summary, can't coexist with -g, -u\n" +" -u -- display user summary, can't coexist with -g, -p\n" " -b -- display number of blocks used\n" " -i -- display number of inodes used\n" " -r -- display number of realtime blocks used\n" @@ -361,13 +361,13 @@ quot_f( form |= XFS_RTBLOCK_QUOTA; break; case 'g': - type = XFS_GROUP_QUOTA; + type |= XFS_GROUP_QUOTA; break; case 'p': - type = XFS_PROJ_QUOTA; + type |= XFS_PROJ_QUOTA; break; case 'u': - type = XFS_USER_QUOTA; + type |= XFS_USER_QUOTA; break; case 'a': flags |= ALL_MOUNTS_FLAG; @@ -389,8 +389,13 @@ quot_f( if (!form) form = XFS_BLOCK_QUOTA; - if (!type) + if (!type) { type = XFS_USER_QUOTA; + } else if (type != XFS_GROUP_QUOTA + && type != XFS_PROJ_QUOTA + && type != XFS_USER_QUOTA) { + return command_usage("_cmd); + } if ((fp = fopen_write_secure(fname)) == NULL) return 0; @@ -416,7 +421,7 @@ quot_init(void) quot_cmd.cfunc = quot_f; quot_cmd.argmin = 0; quot_cmd.argmax = -1; - quot_cmd.args = _("[-bir] [-gpu] [-acv] [-f file]"); + quot_cmd.args = _("[-bir] [-g|-p|-u] [-acv] [-f file]"); quot_cmd.oneline = _("summarize filesystem ownership"); quot_cmd.help = quot_help; diff --git a/quota/quota.c b/quota/quota.c index f6b24c3..9ba0bc9 100644 --- a/quota/quota.c +++ b/quota/quota.c @@ -32,9 +32,9 @@ quota_help(void) "\n" " display usage and quota information\n" "\n" -" -g -- display group quota information\n" -" -p -- display project quota information\n" -" -u -- display user quota information\n" +" -g -- display group quota information, can't coexist with -p, -u\n" +" -p -- display project quota information, can't coexist with -g, -u\n" +" -u -- display user quota information, can't coexist with -g, -p\n" " -b -- display number of blocks used\n" " -i -- display number of inodes used\n" " -r -- display number of realtime blocks used\n" @@ -409,13 +409,13 @@ quota_f( form |= XFS_RTBLOCK_QUOTA; break; case 'g': - type = XFS_GROUP_QUOTA; + type |= XFS_GROUP_QUOTA; break; case 'p': - type = XFS_PROJ_QUOTA; + type |= XFS_PROJ_QUOTA; break; case 'u': - type = XFS_USER_QUOTA; + type |= XFS_USER_QUOTA; break; case 'h': flags |= HUMAN_FLAG; @@ -437,8 +437,13 @@ quota_f( if (!form) form = XFS_BLOCK_QUOTA; - if (!type) + if (!type) { type = XFS_USER_QUOTA; + } else if (type != XFS_GROUP_QUOTA + && type != XFS_PROJ_QUOTA + && type != XFS_USER_QUOTA) { + return command_usage("a_cmd); + } if ((fp = fopen_write_secure(fname)) == NULL) return 0; @@ -461,7 +466,7 @@ quota_init(void) quota_cmd.cfunc = quota_f; quota_cmd.argmin = 0; quota_cmd.argmax = -1; - quota_cmd.args = _("[-bir] [-gpu] [-hnNv] [-f file] [id|name]..."); + quota_cmd.args = _("[-bir] [-g|-p|-u] [-hnNv] [-f file] [id|name]..."); quota_cmd.oneline = _("show usage and limits"); quota_cmd.help = quota_help; diff --git a/quota/report.c b/quota/report.c index 8653134..2e7ec15 100644 --- a/quota/report.c +++ b/quota/report.c @@ -30,14 +30,14 @@ static cmdinfo_t report_cmd; static void dump_help(void) { - dump_cmd.args = _("[-gpu] [-f file]"); + dump_cmd.args = _("[-g|-p|-u] [-f file]"); dump_cmd.oneline = _("dump quota information for backup utilities"); printf(_( "\n" " create a backup file which contains quota limits information\n" -" -g -- dump out group quota limits\n" -" -p -- dump out project quota limits\n" -" -u -- dump out user quota limits (default)\n" +" -g -- dump out group quota limits, can't coexist with -p, -u\n" +" -p -- dump out project quota limits, can't coexist with -g, -u\n" +" -u -- dump out user quota limits (default), cant coexist with -g, -p\n" " -f -- write the dump out to the specified file\n" "\n")); } @@ -199,7 +199,7 @@ dump_f( FILE *fp; char *fname = NULL; uint lower = 0, upper = 0; - int c, type = XFS_USER_QUOTA; + int c, type = 0; while ((c = getopt(argc, argv, "f:gpuL:U:")) != EOF) { switch(c) { @@ -207,13 +207,13 @@ dump_f( fname = optarg; break; case 'g': - type = XFS_GROUP_QUOTA; + type |= XFS_GROUP_QUOTA; break; case 'p': - type = XFS_PROJ_QUOTA; + type |= XFS_PROJ_QUOTA; break; case 'u': - type = XFS_USER_QUOTA; + type |= XFS_USER_QUOTA; break; case 'L': lower = (uint)atoi(optarg); @@ -229,6 +229,14 @@ dump_f( if (argc != optind) return command_usage(&dump_cmd); + if (!type) { + type = XFS_USER_QUOTA; + } else if (type != XFS_GROUP_QUOTA + && type != XFS_PROJ_QUOTA + && type != XFS_USER_QUOTA) { + return command_usage(&dump_cmd); + } + if ((fp = fopen_write_secure(fname)) == NULL) return 0; @@ -725,7 +733,7 @@ report_init(void) dump_cmd.cfunc = dump_f; dump_cmd.argmin = 0; dump_cmd.argmax = -1; - dump_cmd.args = _("[-gpu] [-f file]"); + dump_cmd.args = _("[-g|-p|-u] [-f file]"); dump_cmd.oneline = _("dump quota information for backup utilities"); dump_cmd.help = dump_help; -- 1.9.3 From sandeen@sandeen.net Fri Feb 12 11:06:03 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=ham version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay1.corp.sgi.com [137.38.102.111]) by oss.sgi.com (Postfix) with ESMTP id 014897CA2 for ; Fri, 12 Feb 2016 11:06:03 -0600 (CST) Received: from cuda.sgi.com (cuda1.sgi.com [192.48.157.11]) by relay1.corp.sgi.com (Postfix) with ESMTP id CE7D08F8033 for ; Fri, 12 Feb 2016 09:05:59 -0800 (PST) X-ASG-Debug-ID: 1455296755-04bdf066ed89220001-NocioJ Received: from sandeen.net (sandeen.net [63.231.237.45]) by cuda.sgi.com with ESMTP id 1SwFPuhcEHPn1fIT for ; Fri, 12 Feb 2016 09:05:55 -0800 (PST) X-Barracuda-Envelope-From: sandeen@sandeen.net X-Barracuda-Apparent-Source-IP: 63.231.237.45 Received: from liberator.sandeen.net (liberator.sandeen.net [10.0.0.4]) (using TLSv1.2 with cipher DHE-RSA-AES128-SHA (128/128 bits)) (No client certificate requested) by sandeen.net (Postfix) with ESMTPSA id 8D1CF63C5FF0 for ; Fri, 12 Feb 2016 11:05:55 -0600 (CST) Subject: Re: [PATCH] xfs_quota: allow create limit when user or group names beginning with digits To: xfs@oss.sgi.com X-ASG-Orig-Subj: Re: [PATCH] xfs_quota: allow create limit when user or group names beginning with digits References: <1449046955-8350-1-git-send-email-zlang@redhat.com> <565FBF9D.5010903@sandeen.net> From: Eric Sandeen Message-ID: <56BE10F3.8020307@sandeen.net> Date: Fri, 12 Feb 2016 11:05:55 -0600 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.11; rv:38.0) Gecko/20100101 Thunderbird/38.5.1 MIME-Version: 1.0 In-Reply-To: <565FBF9D.5010903@sandeen.net> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit X-Barracuda-Connect: sandeen.net[63.231.237.45] X-Barracuda-Start-Time: 1455296755 X-Barracuda-URL: https://192.48.157.11:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-BRTS-Status: 1 X-Barracuda-Spam-Score: 0.00 X-Barracuda-Spam-Status: No, SCORE=0.00 using per-user scores of TAG_LEVEL=1000.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.7 tests= X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.3.26979 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- Hi Dave, I think this one got missed. Can you pick it up for next time? Thanks, -Eric On 12/2/15 10:05 PM, Eric Sandeen wrote: > I had to re-read the strtoul manpage (3 times) but yes, this looks right to > me. > > (technically it should probably check for overflow etc but I suppose that is > outside the scope of this fix) > > An xfstest would be good for this, although (as we discussed on IRC) I'm not > sure if it is OK for xfstests to add users & groups - no other test does > that today... > > Reviewed-by: Eric Sandeen > > On 12/2/15 3:02 AM, Zorro Lang wrote: >> A normal user or group name allow beginning with digits, but xfs_quota can't >> create a limit for that user or group. The reason is 'strtoul' function only >> translate digits at the beginning. >> >> There's a commit fd537fc50eeade63bbd2a66105f39d04a011a7f5, it try to fix >> "xfsprogs: xfs_quota allow user or group names beginning with digits". But >> it doesn't effect 'limit .... 12345678-user' command. >> >> Signed-off-by: Zorro Lang >> --- >> >> Hi Eric, >> >> This problem from a bug of ours, I have left message to you, please >> help to check my simple patch. Thanks very much. >> >> Hi Rich, >> >> I don't understand why you fix commit fd537fc50eeade63bbd2a66105f39d04a011a7f5, >> but didn't fix this. Or is this a feature, not a bug? >> >> I'm not so familiar with xfsprogs code, so if I'm wrong, please tell me;) >> >> Thanks, >> Zorro >> >> libxcmd/input.c | 4 ++-- >> 1 file changed, 2 insertions(+), 2 deletions(-) >> >> diff --git a/libxcmd/input.c b/libxcmd/input.c >> index c505ab3..5a7dce3 100644 >> --- a/libxcmd/input.c >> +++ b/libxcmd/input.c >> @@ -366,7 +366,7 @@ uid_from_string( >> char *sp; >> >> uid_long = strtoul(user, &sp, 10); >> - if (sp != user) { >> + if (sp != user && *sp == '\0') { >> if ((uid_long == ULONG_MAX && errno == ERANGE) >> || (uid_long > (uid_t)-1)) >> return -1; >> @@ -387,7 +387,7 @@ gid_from_string( >> char *sp; >> >> gid_long = strtoul(group, &sp, 10); >> - if (sp != group) { >> + if (sp != group && *sp == '\0') { >> if ((gid_long == ULONG_MAX && errno == ERANGE) >> || (gid_long > (gid_t)-1)) >> return -1; >> > > _______________________________________________ > xfs mailing list > xfs@oss.sgi.com > http://oss.sgi.com/mailman/listinfo/xfs > From darrick.wong@oracle.com Fri Feb 12 11:41:05 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay1.corp.sgi.com [137.38.102.111]) by oss.sgi.com (Postfix) with ESMTP id 4BC6D7CAE for ; Fri, 12 Feb 2016 11:41:05 -0600 (CST) Received: from cuda.sgi.com (cuda2.sgi.com [192.48.176.25]) by relay1.corp.sgi.com (Postfix) with ESMTP id 4056F8F8035 for ; Fri, 12 Feb 2016 09:41:05 -0800 (PST) X-ASG-Debug-ID: 1455298858-04cbb04334a0280001-NocioJ Received: from aserp1040.oracle.com (aserp1040.oracle.com [141.146.126.69]) by cuda.sgi.com with ESMTP id pfIA0QZSd3ApxGMN (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO) for ; Fri, 12 Feb 2016 09:41:00 -0800 (PST) X-Barracuda-Envelope-From: darrick.wong@oracle.com X-Barracuda-Apparent-Source-IP: 141.146.126.69 Received: from aserv0022.oracle.com (aserv0022.oracle.com [141.146.126.234]) by aserp1040.oracle.com (Sentrion-MTA-4.3.2/Sentrion-MTA-4.3.2) with ESMTP id u1CHevJ8024624 (version=TLSv1 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Fri, 12 Feb 2016 17:40:57 GMT Received: from aserv0122.oracle.com (aserv0122.oracle.com [141.146.126.236]) by aserv0022.oracle.com (8.13.8/8.13.8) with ESMTP id u1CHeudm030518 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=FAIL); Fri, 12 Feb 2016 17:40:57 GMT Received: from abhmp0005.oracle.com (abhmp0005.oracle.com [141.146.116.11]) by aserv0122.oracle.com (8.13.8/8.13.8) with ESMTP id u1CHeuCW011494; Fri, 12 Feb 2016 17:40:56 GMT Received: from localhost (/24.21.154.84) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Fri, 12 Feb 2016 09:40:55 -0800 Date: Fri, 12 Feb 2016 09:40:54 -0800 From: "Darrick J. Wong" To: Dave Chinner Cc: linux-btrfs@vger.kernel.org, fstests@vger.kernel.org, xfs@oss.sgi.com Subject: Re: [PATCH 12/32] dio: unwritten conversion bug tests Message-ID: <20160212174054.GE6346@birch.djwong.org> X-ASG-Orig-Subj: Re: [PATCH 12/32] dio: unwritten conversion bug tests References: <20160211233916.2202.40961.stgit@birch.djwong.org> <20160211234037.2202.93885.stgit@birch.djwong.org> <20160212035253.GX14668@dastard> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20160212035253.GX14668@dastard> User-Agent: Mutt/1.5.21 (2010-09-15) X-Source-IP: aserv0022.oracle.com [141.146.126.234] X-Barracuda-Connect: aserp1040.oracle.com[141.146.126.69] X-Barracuda-Start-Time: 1455298860 X-Barracuda-Encrypted: ECDHE-RSA-AES256-GCM-SHA384 X-Barracuda-URL: https://192.48.176.25:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-BRTS-Status: 1 X-Barracuda-Spam-Score: 0.00 X-Barracuda-Spam-Status: No, SCORE=0.00 using per-user scores of TAG_LEVEL=1000.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.7 tests=BSF_SC0_MISMATCH_TO, UNPARSEABLE_RELAY X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.3.26979 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 0.00 BSF_SC0_MISMATCH_TO Envelope rcpt doesn't match header 0.00 UNPARSEABLE_RELAY Informational: message has unparseable relay lines On Fri, Feb 12, 2016 at 02:52:53PM +1100, Dave Chinner wrote: > On Thu, Feb 11, 2016 at 03:40:37PM -0800, Darrick J. Wong wrote: > > Check that we don't expose old disk contents when a directio write to > > an unwritten extent fails due to IO errors. This primarily affects > > XFS and ext4. > > > > Signed-off-by: Darrick J. Wong > > aiocp.c: In function 'main': > aiocp.c:407:1: warning: format '%d' expects argument of type 'int', but argument 3 has type 'off_t' [-Wformat=] > printf("tocopy=%d len=%d blk=%d\n", tocopy, length, aio_blksize); > ^ > > Followup patch is fine, I'll commit as is. Ok, I'll send a cleanup patch to the mailing list. Also see new pull req: (I only added the aiocp cleanup, so if you've already pulled it, you can avoid the scourge of github and pick up the one patch. ;)) --- The following changes since commit d98149c205559950c03d6b1d539e45fd35b5630e: Fix prerequisite packages to build fstests on Ubuntu (2016-02-08 09:27:15 +1100) are available in the git repository at: https://github.com/djwong/xfstests for-dave for you to fetch changes up to 74b326f9a616bcdc33c6439cf2a457b79de4b96f: aiocp: fix the gcc warnings (2016-02-12 09:39:14 -0800) ---------------------------------------------------------------- Darrick J. Wong (33): generic/182: this is a dedupe test, check for dedupe xfstests: filter whitespace in 128 and 132 xfstests: make _scratch_mkfs_blocksized usable reflink: remove redundant filesystem checks from the end of the tests reflink: remove unnecessary umounts from test code common/dmerror: add some more dmerror routines common: create _require_test_program to look for programs in src/ common: provide a method to repair the scratch fs reflink: refactor mixed block creation code reflink: fix style problems in existing tests reflink: add _require_odirect to the directio tests dio: unwritten conversion bug tests reflink: test intersecting CoW and falloc/fpunch/fzero/fcollapse/finsert/ftrunc reflink: test CoW behavior with IO errors reflink: test CoW operations against the source file reflink: ensure that we can handle reflinking a lot of extents xfs: more reflink tests xfs/122: support refcount/rmap data structures xfs: test fragmentation characteristics of copy-on-write reflink: high offset reflink and dedupe tests reflink: test xfs cow behavior when the filesystem crashes reflink: test quota accounting reflink: test CoW across a mixed range of block types with cowextsize set xfs: test the automatic cowextsize extent garbage collector xfs: test rmapbt functionality reflink: test aio copy on write xfs: aio cow tests xfs: test xfs_getbmapx behavior with shared extents reflink: test reflink+cow+enospc all at the same time xfs: ensure that we don't crash when freeing the ag reservations on a ro mount xfs: test source CoW across mixed block types with cowextsz set reflink: kick the slow tests out of the 'quick' group aiocp: fix the gcc warnings .gitignore | 2 + common/dmerror | 27 ++- common/rc | 117 +++++++++++ common/reflink | 202 +++++++++++++++--- src/Makefile | 2 +- src/aio-dio-regress/aiocp.c | 488 ++++++++++++++++++++++++++++++++++++++++++++ src/punch-alternating.c | 59 ++++++ tests/btrfs/100 | 2 +- tests/btrfs/101 | 2 +- tests/generic/010 | 2 +- tests/generic/094 | 2 +- tests/generic/110 | 2 +- tests/generic/111 | 2 +- tests/generic/115 | 2 +- tests/generic/116 | 44 ++-- tests/generic/118 | 42 ++-- tests/generic/119 | 102 ++++----- tests/generic/121 | 44 ++-- tests/generic/122 | 44 ++-- tests/generic/134 | 78 +++---- tests/generic/136 | 78 +++---- tests/generic/137 | 44 ++-- tests/generic/138 | 104 +++++----- tests/generic/139 | 99 ++++----- tests/generic/140 | 104 +++++----- tests/generic/142 | 37 ++-- tests/generic/143 | 38 ++-- tests/generic/144 | 124 +++++------ tests/generic/145 | 150 +++++++------- tests/generic/146 | 132 ++++++------ tests/generic/147 | 146 ++++++------- tests/generic/148 | 84 ++++---- tests/generic/149 | 132 ++++++------ tests/generic/150 | 23 ++- tests/generic/151 | 35 ++-- tests/generic/152 | 39 ++-- tests/generic/153 | 41 ++-- tests/generic/154 | 43 ++-- tests/generic/155 | 40 ++-- tests/generic/156 | 43 ++-- tests/generic/157 | 64 +++--- tests/generic/157.out | 1 - tests/generic/158 | 66 +++--- tests/generic/158.out | 1 - tests/generic/159 | 19 +- tests/generic/160 | 19 +- tests/generic/161 | 30 ++- tests/generic/161.out | 2 - tests/generic/162 | 36 ++-- tests/generic/162.out | 2 - tests/generic/163 | 36 ++-- tests/generic/163.out | 2 - tests/generic/164 | 40 ++-- tests/generic/164.out | 2 - tests/generic/165 | 39 ++-- tests/generic/165.out | 2 - tests/generic/166 | 36 ++-- tests/generic/166.out | 2 - tests/generic/167 | 35 ++-- tests/generic/167.out | 2 - tests/generic/168 | 37 ++-- tests/generic/168.out | 2 - tests/generic/170 | 38 ++-- tests/generic/170.out | 2 - tests/generic/171 | 62 +++--- tests/generic/171.out | 1 - tests/generic/172 | 62 +++--- tests/generic/172.out | 1 - tests/generic/173 | 54 +++-- tests/generic/173.out | 1 - tests/generic/174 | 63 +++--- tests/generic/174.out | 1 - tests/generic/175 | 47 ++--- tests/generic/175.out | 5 + tests/generic/176 | 54 +++-- tests/generic/176.out | 5 +- tests/generic/178 | 31 +-- tests/generic/179 | 50 ++--- tests/generic/180 | 50 ++--- tests/generic/181 | 38 ++-- tests/generic/182 | 89 ++++---- tests/generic/183 | 55 +++-- tests/generic/183.out | 1 - tests/generic/185 | 54 +++-- tests/generic/185.out | 1 - tests/generic/186 | 73 ++++--- tests/generic/186.out | 1 - tests/generic/187 | 74 +++---- tests/generic/187.out | 1 - tests/generic/188 | 47 ++--- tests/generic/188.out | 1 - tests/generic/189 | 46 ++--- tests/generic/189.out | 1 - tests/generic/190 | 47 ++--- tests/generic/190.out | 1 - tests/generic/191 | 46 ++--- tests/generic/191.out | 1 - tests/generic/194 | 52 ++--- tests/generic/194.out | 1 - tests/generic/195 | 51 ++--- tests/generic/195.out | 1 - tests/generic/196 | 49 ++--- tests/generic/196.out | 1 - tests/generic/197 | 48 ++--- tests/generic/197.out | 1 - tests/generic/199 | 70 ++----- tests/generic/199.out | 5 +- tests/generic/200 | 70 ++----- tests/generic/200.out | 5 +- tests/generic/201 | 42 ++-- tests/generic/201.out | 1 - tests/generic/202 | 41 ++-- tests/generic/202.out | 1 - tests/generic/203 | 42 ++-- tests/generic/203.out | 1 - tests/generic/205 | 51 +++-- tests/generic/205.out | 1 - tests/generic/206 | 52 +++-- tests/generic/206.out | 1 - tests/generic/216 | 51 +++-- tests/generic/216.out | 1 - tests/generic/217 | 52 +++-- tests/generic/217.out | 1 - tests/generic/218 | 43 ++-- tests/generic/218.out | 1 - tests/generic/220 | 44 ++-- tests/generic/220.out | 1 - tests/generic/222 | 51 +++-- tests/generic/222.out | 1 - tests/generic/225 | 2 +- tests/generic/227 | 52 +++-- tests/generic/227.out | 1 - tests/generic/229 | 77 ++++--- tests/generic/229.out | 1 - tests/generic/238 | 78 ++++--- tests/generic/238.out | 1 - tests/generic/242 | 51 +++-- tests/generic/242.out | 1 - tests/generic/243 | 52 +++-- tests/generic/243.out | 1 - tests/generic/250 | 100 +++++++++ tests/generic/250.out | 10 + tests/generic/252 | 103 ++++++++++ tests/generic/252.out | 10 + tests/generic/253 | 90 ++++++++ tests/generic/253.out | 12 ++ tests/generic/254 | 90 ++++++++ tests/generic/254.out | 12 ++ tests/generic/259 | 90 ++++++++ tests/generic/259.out | 12 ++ tests/generic/261 | 90 ++++++++ tests/generic/261.out | 12 ++ tests/generic/262 | 93 +++++++++ tests/generic/262.out | 12 ++ tests/generic/264 | 90 ++++++++ tests/generic/264.out | 12 ++ tests/generic/265 | 99 +++++++++ tests/generic/265.out | 11 + tests/generic/266 | 97 +++++++++ tests/generic/266.out | 11 + tests/generic/267 | 100 +++++++++ tests/generic/267.out | 10 + tests/generic/268 | 103 ++++++++++ tests/generic/268.out | 12 ++ tests/generic/271 | 100 +++++++++ tests/generic/271.out | 11 + tests/generic/272 | 98 +++++++++ tests/generic/272.out | 11 + tests/generic/276 | 101 +++++++++ tests/generic/276.out | 11 + tests/generic/278 | 104 ++++++++++ tests/generic/278.out | 12 ++ tests/generic/279 | 100 +++++++++ tests/generic/279.out | 11 + tests/generic/281 | 98 +++++++++ tests/generic/281.out | 11 + tests/generic/282 | 101 +++++++++ tests/generic/282.out | 10 + tests/generic/283 | 104 ++++++++++ tests/generic/283.out | 12 ++ tests/generic/284 | 89 ++++++++ tests/generic/284.out | 12 ++ tests/generic/285 | 2 +- tests/generic/286 | 2 +- tests/generic/287 | 90 ++++++++ tests/generic/287.out | 12 ++ tests/generic/289 | 91 +++++++++ tests/generic/289.out | 12 ++ tests/generic/290 | 92 +++++++++ tests/generic/290.out | 12 ++ tests/generic/291 | 91 +++++++++ tests/generic/291.out | 12 ++ tests/generic/292 | 92 +++++++++ tests/generic/292.out | 12 ++ tests/generic/293 | 93 +++++++++ tests/generic/293.out | 12 ++ tests/generic/295 | 94 +++++++++ tests/generic/295.out | 12 ++ tests/generic/296 | 90 ++++++++ tests/generic/296.out | 12 ++ tests/generic/297 | 99 +++++++++ tests/generic/297.out | 6 + tests/generic/298 | 99 +++++++++ tests/generic/298.out | 6 + tests/generic/301 | 100 +++++++++ tests/generic/301.out | 10 + tests/generic/302 | 101 +++++++++ tests/generic/302.out | 10 + tests/generic/303 | 98 +++++++++ tests/generic/303.out | 21 ++ tests/generic/304 | 99 +++++++++ tests/generic/304.out | 22 ++ tests/generic/305 | 100 +++++++++ tests/generic/305.out | 22 ++ tests/generic/311 | 2 +- tests/generic/326 | 101 +++++++++ tests/generic/326.out | 22 ++ tests/generic/327 | 87 ++++++++ tests/generic/327.out | 12 ++ tests/generic/328 | 105 ++++++++++ tests/generic/328.out | 25 +++ tests/generic/329 | 102 +++++++++ tests/generic/329.out | 12 ++ tests/generic/330 | 93 +++++++++ tests/generic/330.out | 11 + tests/generic/331 | 104 ++++++++++ tests/generic/331.out | 12 ++ tests/generic/332 | 94 +++++++++ tests/generic/332.out | 11 + tests/generic/333 | 99 +++++++++ tests/generic/333.out | 4 + tests/generic/334 | 98 +++++++++ tests/generic/334.out | 4 + tests/generic/group | 71 +++++-- tests/xfs/032 | 3 +- tests/xfs/044 | 2 +- tests/xfs/122 | 3 + tests/xfs/122.out | 4 + tests/xfs/127 | 33 ++- tests/xfs/127.out | 1 - tests/xfs/128 | 97 +++++---- tests/xfs/128.out | 9 +- tests/xfs/129 | 33 ++- tests/xfs/131 | 25 +-- tests/xfs/131.out | 1 - tests/xfs/132 | 53 ++--- tests/xfs/132.out | 40 ++-- tests/xfs/139 | 35 ++-- tests/xfs/139.out | 1 - tests/xfs/140 | 41 ++-- tests/xfs/140.out | 1 - tests/xfs/169 | 86 ++++++++ tests/xfs/169.out | 7 + tests/xfs/179 | 118 +++++++++++ tests/xfs/179.out | 10 + tests/xfs/180 | 106 ++++++++++ tests/xfs/180.out | 11 + tests/xfs/182 | 107 ++++++++++ tests/xfs/182.out | 12 ++ tests/xfs/184 | 105 ++++++++++ tests/xfs/184.out | 10 + tests/xfs/192 | 106 ++++++++++ tests/xfs/192.out | 10 + tests/xfs/193 | 102 +++++++++ tests/xfs/193.out | 10 + tests/xfs/198 | 103 ++++++++++ tests/xfs/198.out | 10 + tests/xfs/200 | 109 ++++++++++ tests/xfs/200.out | 10 + tests/xfs/204 | 110 ++++++++++ tests/xfs/204.out | 10 + tests/xfs/207 | 101 +++++++++ tests/xfs/207.out | 18 ++ tests/xfs/208 | 138 +++++++++++++ tests/xfs/208.out | 13 ++ tests/xfs/209 | 82 ++++++++ tests/xfs/209.out | 13 ++ tests/xfs/210 | 108 ++++++++++ tests/xfs/210.out | 23 +++ tests/xfs/211 | 107 ++++++++++ tests/xfs/211.out | 11 + tests/xfs/212 | 99 +++++++++ tests/xfs/212.out | 13 ++ tests/xfs/213 | 105 ++++++++++ tests/xfs/213.out | 22 ++ tests/xfs/214 | 106 ++++++++++ tests/xfs/214.out | 22 ++ tests/xfs/215 | 102 +++++++++ tests/xfs/215.out | 13 ++ tests/xfs/218 | 101 +++++++++ tests/xfs/218.out | 13 ++ tests/xfs/219 | 102 +++++++++ tests/xfs/219.out | 13 ++ tests/xfs/221 | 101 +++++++++ tests/xfs/221.out | 13 ++ tests/xfs/223 | 104 ++++++++++ tests/xfs/223.out | 13 ++ tests/xfs/224 | 103 ++++++++++ tests/xfs/224.out | 13 ++ tests/xfs/225 | 102 +++++++++ tests/xfs/225.out | 13 ++ tests/xfs/226 | 101 +++++++++ tests/xfs/226.out | 13 ++ tests/xfs/228 | 110 ++++++++++ tests/xfs/228.out | 13 ++ tests/xfs/230 | 110 ++++++++++ tests/xfs/230.out | 13 ++ tests/xfs/231 | 130 ++++++++++++ tests/xfs/231.out | 16 ++ tests/xfs/232 | 132 ++++++++++++ tests/xfs/232.out | 16 ++ tests/xfs/233 | 73 +++++++ tests/xfs/233.out | 5 + tests/xfs/234 | 88 ++++++++ tests/xfs/234.out | 6 + tests/xfs/235 | 108 ++++++++++ tests/xfs/235.out | 14 ++ tests/xfs/236 | 88 ++++++++ tests/xfs/236.out | 7 + tests/xfs/237 | 105 ++++++++++ tests/xfs/237.out | 12 ++ tests/xfs/239 | 98 +++++++++ tests/xfs/239.out | 11 + tests/xfs/240 | 110 ++++++++++ tests/xfs/240.out | 12 ++ tests/xfs/241 | 100 +++++++++ tests/xfs/241.out | 11 + tests/xfs/243 | 165 +++++++++++++++ tests/xfs/243.out | 26 +++ tests/xfs/245 | 95 +++++++++ tests/xfs/245.out | 12 ++ tests/xfs/246 | 65 ++++++ tests/xfs/246.out | 6 + tests/xfs/247 | 57 ++++++ tests/xfs/247.out | 2 + tests/xfs/248 | 91 +++++++++ tests/xfs/248.out | 12 ++ tests/xfs/249 | 92 +++++++++ tests/xfs/249.out | 12 ++ tests/xfs/251 | 93 +++++++++ tests/xfs/251.out | 12 ++ tests/xfs/254 | 94 +++++++++ tests/xfs/254.out | 12 ++ tests/xfs/255 | 93 +++++++++ tests/xfs/255.out | 12 ++ tests/xfs/256 | 94 +++++++++ tests/xfs/256.out | 12 ++ tests/xfs/257 | 95 +++++++++ tests/xfs/257.out | 12 ++ tests/xfs/258 | 96 +++++++++ tests/xfs/258.out | 12 ++ tests/xfs/group | 56 ++++- 352 files changed, 13924 insertions(+), 2729 deletions(-) create mode 100644 src/aio-dio-regress/aiocp.c create mode 100644 src/punch-alternating.c create mode 100755 tests/generic/250 create mode 100644 tests/generic/250.out create mode 100755 tests/generic/252 create mode 100644 tests/generic/252.out create mode 100755 tests/generic/253 create mode 100644 tests/generic/253.out create mode 100755 tests/generic/254 create mode 100644 tests/generic/254.out create mode 100755 tests/generic/259 create mode 100644 tests/generic/259.out create mode 100755 tests/generic/261 create mode 100644 tests/generic/261.out create mode 100755 tests/generic/262 create mode 100644 tests/generic/262.out create mode 100755 tests/generic/264 create mode 100644 tests/generic/264.out create mode 100755 tests/generic/265 create mode 100644 tests/generic/265.out create mode 100755 tests/generic/266 create mode 100644 tests/generic/266.out create mode 100755 tests/generic/267 create mode 100644 tests/generic/267.out create mode 100755 tests/generic/268 create mode 100644 tests/generic/268.out create mode 100755 tests/generic/271 create mode 100644 tests/generic/271.out create mode 100755 tests/generic/272 create mode 100644 tests/generic/272.out create mode 100755 tests/generic/276 create mode 100644 tests/generic/276.out create mode 100755 tests/generic/278 create mode 100644 tests/generic/278.out create mode 100755 tests/generic/279 create mode 100644 tests/generic/279.out create mode 100755 tests/generic/281 create mode 100644 tests/generic/281.out create mode 100755 tests/generic/282 create mode 100644 tests/generic/282.out create mode 100755 tests/generic/283 create mode 100644 tests/generic/283.out create mode 100755 tests/generic/284 create mode 100644 tests/generic/284.out create mode 100755 tests/generic/287 create mode 100644 tests/generic/287.out create mode 100755 tests/generic/289 create mode 100644 tests/generic/289.out create mode 100755 tests/generic/290 create mode 100644 tests/generic/290.out create mode 100755 tests/generic/291 create mode 100644 tests/generic/291.out create mode 100755 tests/generic/292 create mode 100644 tests/generic/292.out create mode 100755 tests/generic/293 create mode 100644 tests/generic/293.out create mode 100755 tests/generic/295 create mode 100644 tests/generic/295.out create mode 100755 tests/generic/296 create mode 100644 tests/generic/296.out create mode 100755 tests/generic/297 create mode 100644 tests/generic/297.out create mode 100755 tests/generic/298 create mode 100644 tests/generic/298.out create mode 100755 tests/generic/301 create mode 100644 tests/generic/301.out create mode 100755 tests/generic/302 create mode 100644 tests/generic/302.out create mode 100755 tests/generic/303 create mode 100644 tests/generic/303.out create mode 100755 tests/generic/304 create mode 100644 tests/generic/304.out create mode 100755 tests/generic/305 create mode 100644 tests/generic/305.out create mode 100755 tests/generic/326 create mode 100644 tests/generic/326.out create mode 100755 tests/generic/327 create mode 100644 tests/generic/327.out create mode 100755 tests/generic/328 create mode 100644 tests/generic/328.out create mode 100755 tests/generic/329 create mode 100644 tests/generic/329.out create mode 100755 tests/generic/330 create mode 100644 tests/generic/330.out create mode 100755 tests/generic/331 create mode 100644 tests/generic/331.out create mode 100755 tests/generic/332 create mode 100644 tests/generic/332.out create mode 100755 tests/generic/333 create mode 100644 tests/generic/333.out create mode 100755 tests/generic/334 create mode 100644 tests/generic/334.out create mode 100755 tests/xfs/169 create mode 100644 tests/xfs/169.out create mode 100755 tests/xfs/179 create mode 100644 tests/xfs/179.out create mode 100755 tests/xfs/180 create mode 100644 tests/xfs/180.out create mode 100755 tests/xfs/182 create mode 100644 tests/xfs/182.out create mode 100755 tests/xfs/184 create mode 100644 tests/xfs/184.out create mode 100755 tests/xfs/192 create mode 100644 tests/xfs/192.out create mode 100755 tests/xfs/193 create mode 100644 tests/xfs/193.out create mode 100755 tests/xfs/198 create mode 100644 tests/xfs/198.out create mode 100755 tests/xfs/200 create mode 100644 tests/xfs/200.out create mode 100755 tests/xfs/204 create mode 100644 tests/xfs/204.out create mode 100755 tests/xfs/207 create mode 100644 tests/xfs/207.out create mode 100755 tests/xfs/208 create mode 100644 tests/xfs/208.out create mode 100755 tests/xfs/209 create mode 100644 tests/xfs/209.out create mode 100755 tests/xfs/210 create mode 100644 tests/xfs/210.out create mode 100755 tests/xfs/211 create mode 100644 tests/xfs/211.out create mode 100755 tests/xfs/212 create mode 100644 tests/xfs/212.out create mode 100755 tests/xfs/213 create mode 100644 tests/xfs/213.out create mode 100755 tests/xfs/214 create mode 100644 tests/xfs/214.out create mode 100755 tests/xfs/215 create mode 100644 tests/xfs/215.out create mode 100755 tests/xfs/218 create mode 100644 tests/xfs/218.out create mode 100755 tests/xfs/219 create mode 100644 tests/xfs/219.out create mode 100755 tests/xfs/221 create mode 100644 tests/xfs/221.out create mode 100755 tests/xfs/223 create mode 100644 tests/xfs/223.out create mode 100755 tests/xfs/224 create mode 100644 tests/xfs/224.out create mode 100755 tests/xfs/225 create mode 100644 tests/xfs/225.out create mode 100755 tests/xfs/226 create mode 100644 tests/xfs/226.out create mode 100755 tests/xfs/228 create mode 100644 tests/xfs/228.out create mode 100755 tests/xfs/230 create mode 100644 tests/xfs/230.out create mode 100755 tests/xfs/231 create mode 100644 tests/xfs/231.out create mode 100755 tests/xfs/232 create mode 100644 tests/xfs/232.out create mode 100755 tests/xfs/233 create mode 100644 tests/xfs/233.out create mode 100755 tests/xfs/234 create mode 100644 tests/xfs/234.out create mode 100755 tests/xfs/235 create mode 100644 tests/xfs/235.out create mode 100755 tests/xfs/236 create mode 100644 tests/xfs/236.out create mode 100755 tests/xfs/237 create mode 100644 tests/xfs/237.out create mode 100755 tests/xfs/239 create mode 100644 tests/xfs/239.out create mode 100755 tests/xfs/240 create mode 100644 tests/xfs/240.out create mode 100755 tests/xfs/241 create mode 100644 tests/xfs/241.out create mode 100755 tests/xfs/243 create mode 100644 tests/xfs/243.out create mode 100755 tests/xfs/245 create mode 100644 tests/xfs/245.out create mode 100755 tests/xfs/246 create mode 100644 tests/xfs/246.out create mode 100755 tests/xfs/247 create mode 100644 tests/xfs/247.out create mode 100755 tests/xfs/248 create mode 100644 tests/xfs/248.out create mode 100755 tests/xfs/249 create mode 100644 tests/xfs/249.out create mode 100755 tests/xfs/251 create mode 100644 tests/xfs/251.out create mode 100755 tests/xfs/254 create mode 100644 tests/xfs/254.out create mode 100755 tests/xfs/255 create mode 100644 tests/xfs/255.out create mode 100755 tests/xfs/256 create mode 100644 tests/xfs/256.out create mode 100755 tests/xfs/257 create mode 100644 tests/xfs/257.out create mode 100755 tests/xfs/258 create mode 100644 tests/xfs/258.out From darrick.wong@oracle.com Fri Feb 12 11:41:59 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay1.corp.sgi.com [137.38.102.111]) by oss.sgi.com (Postfix) with ESMTP id C5B057CB6 for ; Fri, 12 Feb 2016 11:41:59 -0600 (CST) Received: from cuda.sgi.com (cuda3.sgi.com [192.48.176.15]) by relay1.corp.sgi.com (Postfix) with ESMTP id BB11E8F8050 for ; Fri, 12 Feb 2016 09:41:59 -0800 (PST) X-ASG-Debug-ID: 1455298917-04cb6c1e59960f0001-NocioJ Received: from userp1040.oracle.com (userp1040.oracle.com [156.151.31.81]) by cuda.sgi.com with ESMTP id dbUCCBNfp8uRFSFF (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO) for ; Fri, 12 Feb 2016 09:41:58 -0800 (PST) X-Barracuda-Envelope-From: darrick.wong@oracle.com X-Barracuda-Apparent-Source-IP: 156.151.31.81 Received: from userv0021.oracle.com (userv0021.oracle.com [156.151.31.71]) by userp1040.oracle.com (Sentrion-MTA-4.3.2/Sentrion-MTA-4.3.2) with ESMTP id u1CHfuuQ005521 (version=TLSv1 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Fri, 12 Feb 2016 17:41:56 GMT Received: from aserv0122.oracle.com (aserv0122.oracle.com [141.146.126.236]) by userv0021.oracle.com (8.13.8/8.13.8) with ESMTP id u1CHftaf016912 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=FAIL); Fri, 12 Feb 2016 17:41:56 GMT Received: from abhmp0011.oracle.com (abhmp0011.oracle.com [141.146.116.17]) by aserv0122.oracle.com (8.13.8/8.13.8) with ESMTP id u1CHftIQ011932; Fri, 12 Feb 2016 17:41:55 GMT Received: from localhost (/24.21.154.84) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Fri, 12 Feb 2016 09:41:55 -0800 Date: Fri, 12 Feb 2016 09:41:54 -0800 From: "Darrick J. Wong" To: david@fromorbit.com Cc: linux-btrfs@vger.kernel.org, fstests@vger.kernel.org, xfs@oss.sgi.com Subject: [PATCH 33/32] aiocp: fix the gcc warnings Message-ID: <20160212174154.GF6346@birch.djwong.org> X-ASG-Orig-Subj: [PATCH 33/32] aiocp: fix the gcc warnings References: <20160211233916.2202.40961.stgit@birch.djwong.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20160211233916.2202.40961.stgit@birch.djwong.org> User-Agent: Mutt/1.5.21 (2010-09-15) X-Source-IP: userv0021.oracle.com [156.151.31.71] X-Barracuda-Connect: userp1040.oracle.com[156.151.31.81] X-Barracuda-Start-Time: 1455298917 X-Barracuda-Encrypted: ECDHE-RSA-AES256-GCM-SHA384 X-Barracuda-URL: https://192.48.176.15:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-BRTS-Status: 1 X-Barracuda-Spam-Score: 0.00 X-Barracuda-Spam-Status: No, SCORE=0.00 using per-user scores of TAG_LEVEL=1000.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.7 tests=BSF_SC0_MISMATCH_TO, UNPARSEABLE_RELAY X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.3.26979 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 0.00 BSF_SC0_MISMATCH_TO Envelope rcpt doesn't match header 0.00 UNPARSEABLE_RELAY Informational: message has unparseable relay lines Eliminate a debug printf that was causing warnings and fix the other two debug printfs to avoid tripping on return value warnings. Signed-off-by: Darrick J. Wong --- src/aio-dio-regress/aiocp.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/aio-dio-regress/aiocp.c b/src/aio-dio-regress/aiocp.c index 1abff9c..ccab2ac 100644 --- a/src/aio-dio-regress/aiocp.c +++ b/src/aio-dio-regress/aiocp.c @@ -190,7 +190,7 @@ static void wr_done(io_context_t ctx, struct iocb *iocb, long res, long res2) --busy; free_iocb(iocb); if (debug) - write(2, "w", 1); + fprintf(stderr, "w"); } /* @@ -225,7 +225,7 @@ static void rd_done(io_context_t ctx, struct iocb *iocb, long res, long res2) io_error("io_submit write", res); } if (debug) - write(2, "r", 1); + fprintf(stderr, "r"); if (debug > 1) printf("%d", iosize); } @@ -404,7 +404,6 @@ int main(int argc, char *const *argv) memset(&myctx, 0, sizeof(myctx)); io_queue_init(aio_maxio, &myctx); tocopy = howmany(length, aio_blksize); -printf("tocopy=%d len=%d blk=%d\n", tocopy, length, aio_blksize); if (init_iocb(aio_maxio, aio_blksize) < 0) { fprintf(stderr, "Error allocating the i/o buffers\n"); exit(1); From ross.zwisler@linux.intel.com Fri Feb 12 13:03:37 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=ham version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay2.corp.sgi.com [137.38.102.29]) by oss.sgi.com (Postfix) with ESMTP id C40587CBA for ; Fri, 12 Feb 2016 13:03:37 -0600 (CST) Received: from cuda.sgi.com (cuda2.sgi.com [192.48.176.25]) by relay2.corp.sgi.com (Postfix) with ESMTP id B93D7304048 for ; Fri, 12 Feb 2016 11:03:34 -0800 (PST) X-ASG-Debug-ID: 1455303813-04cbb04334a2aa0001-NocioJ Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) by cuda.sgi.com with ESMTP id lqBsCr7HmfG1mFaD for ; Fri, 12 Feb 2016 11:03:33 -0800 (PST) X-Barracuda-Envelope-From: ross.zwisler@linux.intel.com X-Barracuda-Apparent-Source-IP: 134.134.136.20 X-ASG-Whitelist: Client Received: from orsmga003.jf.intel.com ([10.7.209.27]) by orsmga101.jf.intel.com with ESMTP; 12 Feb 2016 11:03:34 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.22,436,1449561600"; d="scan'208";a="745068115" Received: from rzwisler-desk.amr.corp.intel.com (HELO linux.intel.com) ([10.252.193.228]) by orsmga003.jf.intel.com with ESMTP; 12 Feb 2016 11:03:32 -0800 Date: Fri, 12 Feb 2016 12:03:20 -0700 From: Ross Zwisler To: Jan Kara Cc: Ross Zwisler , linux-kernel@vger.kernel.org, Theodore Ts'o , Alexander Viro , Andreas Dilger , Andrew Morton , Dan Williams , Dave Chinner , Jan Kara , Matthew Wilcox , linux-ext4@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux-mm@kvack.org, linux-nvdimm@lists.01.org, xfs@oss.sgi.com Subject: Re: [PATCH v2 0/2] DAX bdev fixes - move flushing calls to FS Message-ID: <20160212190320.GA24857@linux.intel.com> X-ASG-Orig-Subj: Re: [PATCH v2 0/2] DAX bdev fixes - move flushing calls to FS Mail-Followup-To: Ross Zwisler , Jan Kara , linux-kernel@vger.kernel.org, Theodore Ts'o , Alexander Viro , Andreas Dilger , Andrew Morton , Dan Williams , Dave Chinner , Jan Kara , Matthew Wilcox , linux-ext4@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux-mm@kvack.org, linux-nvdimm@lists.01.org, xfs@oss.sgi.com References: <1455137336-28720-1-git-send-email-ross.zwisler@linux.intel.com> <20160211124304.GI21760@quack.suse.cz> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20160211124304.GI21760@quack.suse.cz> User-Agent: Mutt/1.5.24 (2015-08-30) X-Barracuda-Connect: mga02.intel.com[134.134.136.20] X-Barracuda-Start-Time: 1455303813 X-Barracuda-URL: https://192.48.176.25:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-BRTS-Status: 1 On Thu, Feb 11, 2016 at 01:43:04PM +0100, Jan Kara wrote: > On Wed 10-02-16 13:48:54, Ross Zwisler wrote: > > 3) In filemap_write_and_wait() and filemap_write_and_wait_range(), continue > > the writeback in the case that DAX is enabled but we only have a nonzero > > mapping->nrpages. As with 1) and 2), I believe this is necessary to > > properly writeback metadata changes. If this sounds wrong, please let me > > know and I'll get more info. > > And I'm surprised here as well. If there are dax_mapping() inodes that have > pagecache pages, then we have issues with radix tree handling as well. So > how come dax_mapping() inodes have pages attached? If it is about block > device inodes, then I find it buggy, that S_DAX gets set for such inodes > when filesystem is mounted on them because in such cases we are IMO asking > for data corruption sooner rather than later... I think I've figured this one out, at least partially. For ext2 the issues I was seeing were due to the fact that directory inodes have S_DAX set, but have dirty page cache pages. In testing with generic/002, I see two ext2 inodes with S_DAX trying to do a writeback while they have dirty page cache pages. The first has i_ino=2, which is the EXT2_ROOT_INO. The second inode changes from run to run, but for my last run was 155649. The test failed because that directory inode was found to be corrupt by fsck.ext2: *** fsck.ext2 output *** fsck from util-linux 2.26.2 e2fsck 1.42.12 (29-Aug-2014) Pass 1: Checking inodes, blocks, and sizes Pass 2: Checking directory structure Directory inode 155649, block #0, offset 0: directory corrupted If I change the code in ext2_writepages() so that it does the mpage_writepages() even for DAX inodes, all my xfstests pass. I'm not sure this is the right fix, though - should it instead be that ext2 directory inodes don't have S_DAX set? A similar problem occurs with ext4, though I haven't yet tracked it down to an inode type. It could be that ext4 directory inodes have the same issue, and Eric Sandeen suggested we might also have an issue with XATTRS attached to inodes. As with ext2, if I allow the normal writeback to occur in ext4_writepages() even for DAX inodes, the issues go away, but I'm not sure whether or not this is the correct fix. As far as I can see, XFS does not have these issues - returning immediately having done just the DAX writeback in xfs_vm_writepages() lets all my xfstests pass. For v4.5 should I send out an updated version of this series that does the regular page writeback for ext2 & ext4, or should we work to clear S_DAX for regular filesystem inodes that have dirty page cache data? From billodo@redhat.com Fri Feb 12 13:04:02 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=ham version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay1.corp.sgi.com [137.38.102.111]) by oss.sgi.com (Postfix) with ESMTP id 3F9CC7CBF for ; Fri, 12 Feb 2016 13:04:02 -0600 (CST) Received: from cuda.sgi.com (cuda3.sgi.com [192.48.176.15]) by relay1.corp.sgi.com (Postfix) with ESMTP id 327088F8035 for ; Fri, 12 Feb 2016 11:04:02 -0800 (PST) X-ASG-Debug-ID: 1455303837-04cb6c1e5697ec0001-NocioJ Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by cuda.sgi.com with ESMTP id oAbUOMaOKfAEqu2q (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO) for ; Fri, 12 Feb 2016 11:03:58 -0800 (PST) X-Barracuda-Envelope-From: billodo@redhat.com X-Barracuda-Apparent-Source-IP: 209.132.183.28 X-ASG-Whitelist: Client Received: from int-mx11.intmail.prod.int.phx2.redhat.com (int-mx11.intmail.prod.int.phx2.redhat.com [10.5.11.24]) by mx1.redhat.com (Postfix) with ESMTPS id C2D43C0C2351 for ; Fri, 12 Feb 2016 19:03:57 +0000 (UTC) Received: from localhost.localdomain.com (vpn-59-18.rdu2.redhat.com [10.10.59.18]) by int-mx11.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id u1CJ3vCV023782 for ; Fri, 12 Feb 2016 14:03:57 -0500 From: "Bill O'Donnell" To: xfs@oss.sgi.com Subject: [PATCH 0/2 v4] xfs_repair: improved secondary sb search Date: Fri, 12 Feb 2016 13:03:29 -0600 X-ASG-Orig-Subj: [PATCH 0/2 v4] xfs_repair: improved secondary sb search Message-Id: <1455303811-9874-1-git-send-email-billodo@redhat.com> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.24 X-Barracuda-Connect: mx1.redhat.com[209.132.183.28] X-Barracuda-Start-Time: 1455303838 X-Barracuda-Encrypted: ECDHE-RSA-AES256-GCM-SHA384 X-Barracuda-URL: https://192.48.176.15:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-BRTS-Status: 1 Hello - New iteration (v4) of this series... Current xfs_repair uses a brute force approach to find a valid secondary sb. This series optimizes the secondary sb search, using similar method to determine geometry as that of xfs_mkfs. If the faster method fails in its search, fall back to original brute force slower search. version history ---- v1: http://oss.sgi.com/archives/xfs/2016-02/msg00304.html v2: patch 2 whitespace fixups v3: patch 2 correct functionality; style fixups v4: patch 1,2 properly see to style and whitespace fixups ---- patch 1 has some general infrastructure adjustments, moving general topology functions from mkfs to libxcmd. patch 2 adds the new secondary superblock search method. Questions, comments are welcome. Thanks- Bill From billodo@redhat.com Fri Feb 12 13:04:02 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=ham version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay3.corp.sgi.com [198.149.34.15]) by oss.sgi.com (Postfix) with ESMTP id DBB517CBA for ; Fri, 12 Feb 2016 13:04:01 -0600 (CST) Received: from cuda.sgi.com (cuda1.sgi.com [192.48.157.11]) by relay3.corp.sgi.com (Postfix) with ESMTP id 86AB0AC007 for ; Fri, 12 Feb 2016 11:04:01 -0800 (PST) X-ASG-Debug-ID: 1455303838-04bdf066ec8bb70001-NocioJ Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by cuda.sgi.com with ESMTP id UQDntEYlGnMxw8kA (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO) for ; Fri, 12 Feb 2016 11:03:58 -0800 (PST) X-Barracuda-Envelope-From: billodo@redhat.com X-Barracuda-Apparent-Source-IP: 209.132.183.28 X-ASG-Whitelist: Client Received: from int-mx11.intmail.prod.int.phx2.redhat.com (int-mx11.intmail.prod.int.phx2.redhat.com [10.5.11.24]) by mx1.redhat.com (Postfix) with ESMTPS id 510E48051B for ; Fri, 12 Feb 2016 19:03:58 +0000 (UTC) Received: from localhost.localdomain.com (vpn-59-18.rdu2.redhat.com [10.10.59.18]) by int-mx11.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id u1CJ3vCW023782 for ; Fri, 12 Feb 2016 14:03:57 -0500 From: "Bill O'Donnell" To: xfs@oss.sgi.com Subject: [PATCH v4 1/2] libxcmd: generalize topology functions Date: Fri, 12 Feb 2016 13:03:30 -0600 X-ASG-Orig-Subj: [PATCH v4 1/2] libxcmd: generalize topology functions Message-Id: <1455303811-9874-2-git-send-email-billodo@redhat.com> In-Reply-To: <1455303811-9874-1-git-send-email-billodo@redhat.com> References: <1455303811-9874-1-git-send-email-billodo@redhat.com> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.24 X-Barracuda-Connect: mx1.redhat.com[209.132.183.28] X-Barracuda-Start-Time: 1455303838 X-Barracuda-Encrypted: ECDHE-RSA-AES256-GCM-SHA384 X-Barracuda-URL: https://192.48.157.11:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-BRTS-Status: 1 Move general topology functions from xfs_mkfs to new topology collection in libxcmd. Signed-off-by: Bill O'Donnell --- include/Makefile | 1 + include/libxcmd.h | 56 +++++++++ libxcmd/Makefile | 2 +- libxcmd/topology.c | 341 +++++++++++++++++++++++++++++++++++++++++++++++++++++ mkfs/Makefile | 2 +- mkfs/xfs_mkfs.c | 321 +------------------------------------------------ 6 files changed, 401 insertions(+), 322 deletions(-) create mode 100644 include/libxcmd.h create mode 100644 libxcmd/topology.c diff --git a/include/Makefile b/include/Makefile index 6148756..2671f07 100644 --- a/include/Makefile +++ b/include/Makefile @@ -20,6 +20,7 @@ include $(TOPDIR)/include/builddefs LIBHFILES = libxfs.h \ libxlog.h \ + libxcmd.h \ atomic.h \ bitops.h \ cache.h \ diff --git a/include/libxcmd.h b/include/libxcmd.h new file mode 100644 index 0000000..a912534 --- /dev/null +++ b/include/libxcmd.h @@ -0,0 +1,56 @@ +/* + * Copyright (c) 2000-2005 Silicon Graphics, Inc. + * All Rights Reserved. + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License as + * published by the Free Software Foundation. + * + * This program is distributed in the hope that it would be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + */ + +#ifndef __LIBXCMD_H__ +#define __LIBXCMD_H__ + +#include "libxfs.h" +#include + +/* + * Device topology information. + */ +typedef struct fs_topology { + int dsunit; /* stripe unit - data subvolume */ + int dswidth; /* stripe width - data subvolume */ + int rtswidth; /* stripe width - rt subvolume */ + int lsectorsize; /* logical sector size &*/ + int psectorsize; /* physical sector size */ +} fs_topology_t; + +extern void +get_topology( + libxfs_init_t *xi, + struct fs_topology *ft, + int force_overwrite); + +extern void +calc_default_ag_geometry( + int blocklog, + __uint64_t dblocks, + int multidisk, + __uint64_t *agsize, + __uint64_t *agcount); + +extern int +check_overwrite( + char *device); + + + +#endif /* __LIBXCMD_H__ */ diff --git a/libxcmd/Makefile b/libxcmd/Makefile index 7701ed9..aab8d6d 100644 --- a/libxcmd/Makefile +++ b/libxcmd/Makefile @@ -10,7 +10,7 @@ LT_CURRENT = 0 LT_REVISION = 0 LT_AGE = 0 -CFILES = command.c input.c paths.c projects.c help.c quit.c +CFILES = command.c input.c paths.c projects.c help.c quit.c topology.c ifeq ($(HAVE_GETMNTENT),yes) LCFLAGS += -DHAVE_GETMNTENT diff --git a/libxcmd/topology.c b/libxcmd/topology.c new file mode 100644 index 0000000..4cbe4b1 --- /dev/null +++ b/libxcmd/topology.c @@ -0,0 +1,341 @@ +/* + * Copyright (c) 2000-2001,2005 Silicon Graphics, Inc. + * All Rights Reserved. + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License as + * published by the Free Software Foundation. + * + * This program is distributed in the hope that it would be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + */ + +#include "libxfs.h" +#include "libxcmd.h" +#ifdef ENABLE_BLKID +# include +#endif /* ENABLE_BLKID */ +#include "../mkfs/xfs_mkfs.h" + +#define TERABYTES(count, blog) ((__uint64_t)(count) << (40 - (blog))) +#define GIGABYTES(count, blog) ((__uint64_t)(count) << (30 - (blog))) +#define MEGABYTES(count, blog) ((__uint64_t)(count) << (20 - (blog))) + +void +calc_default_ag_geometry( + int blocklog, + __uint64_t dblocks, + int multidisk, + __uint64_t *agsize, + __uint64_t *agcount) +{ + __uint64_t blocks = 0; + int shift = 0; + + /* + * First handle the high extreme - the point at which we will + * always use the maximum AG size. + * + * This applies regardless of storage configuration. + */ + if (dblocks >= TERABYTES(32, blocklog)) { + blocks = XFS_AG_MAX_BLOCKS(blocklog); + goto done; + } + + /* + * For the remainder we choose an AG size based on the + * number of data blocks available, trying to keep the + * number of AGs relatively small (especially compared + * to the original algorithm). AG count is calculated + * based on the preferred AG size, not vice-versa - the + * count can be increased by growfs, so prefer to use + * smaller counts at mkfs time. + * + * For a single underlying storage device between 128MB + * and 4TB in size, just use 4 AGs, otherwise scale up + * smoothly between min/max AG sizes. + */ + + if (!multidisk && dblocks >= MEGABYTES(128, blocklog)) { + if (dblocks >= TERABYTES(4, blocklog)) { + blocks = XFS_AG_MAX_BLOCKS(blocklog); + goto done; + } + shift = 2; + } else if (dblocks > GIGABYTES(512, blocklog)) + shift = 5; + else if (dblocks > GIGABYTES(8, blocklog)) + shift = 4; + else if (dblocks >= MEGABYTES(128, blocklog)) + shift = 3; + else if (dblocks >= MEGABYTES(64, blocklog)) + shift = 2; + else if (dblocks >= MEGABYTES(32, blocklog)) + shift = 1; + else + shift = 0; + /* + * If dblocks is not evenly divisible by the number of + * desired AGs, round "blocks" up so we don't lose the + * last bit of the filesystem. The same principle applies + * to the AG count, so we don't lose the last AG! + */ + blocks = dblocks >> shift; + if (dblocks & xfs_mask32lo(shift)) { + if (blocks < XFS_AG_MAX_BLOCKS(blocklog)) + blocks++; + } +done: + *agsize = blocks; + *agcount = dblocks / blocks + (dblocks % blocks != 0); +} + +/* + * Check for existing filesystem or partition table on device. + * Returns: + * 1 for existing fs or partition + * 0 for nothing found + * -1 for internal error + */ +#ifdef ENABLE_BLKID +int +check_overwrite( + char *device) +{ + const char *type; + blkid_probe pr = NULL; + int ret; + int fd; + long long size; + int bsz; + + if (!device || !*device) + return 0; + + ret = -1; /* will reset on success of all setup calls */ + + fd = open(device, O_RDONLY); + if (fd < 0) + goto out; + platform_findsizes(device, fd, &size, &bsz); + close(fd); + + /* nothing to overwrite on a 0-length device */ + if (size == 0) { + ret = 0; + goto out; + } + + pr = blkid_new_probe_from_filename(device); + if (!pr) + goto out; + + ret = blkid_probe_enable_partitions(pr, 1); + if (ret < 0) + goto out; + + ret = blkid_do_fullprobe(pr); + if (ret < 0) + goto out; + + /* + * Blkid returns 1 for nothing found and 0 when it finds a signature, + * but we want the exact opposite, so reverse the return value here. + * + * In addition print some useful diagnostics about what actually is + * on the device. + */ + if (ret) { + ret = 0; + goto out; + } + + if (!blkid_probe_lookup_value(pr, "TYPE", &type, NULL)) { + fprintf(stderr, + _("%s: %s appears to contain an existing " + "filesystem (%s).\n"), progname, device, type); + } else if (!blkid_probe_lookup_value(pr, "PTTYPE", &type, NULL)) { + fprintf(stderr, + _("%s: %s appears to contain a partition " + "table (%s).\n"), progname, device, type); + } else { + fprintf(stderr, + _("%s: %s appears to contain something weird " + "according to blkid\n"), progname, device); + } + ret = 1; + +out: + if (pr) + blkid_free_probe(pr); + if (ret == -1) + fprintf(stderr, + _("%s: probe of %s failed, cannot detect " + "existing filesystem.\n"), progname, device); + return ret; +} + +static void +blkid_get_topology( + const char *device, + int *sunit, + int *swidth, + int *lsectorsize, + int *psectorsize, + int force_overwrite) +{ + + blkid_topology tp; + blkid_probe pr; + unsigned long val; + struct stat statbuf; + + /* can't get topology info from a file */ + if (!stat(device, &statbuf) && S_ISREG(statbuf.st_mode)) + return; + + pr = blkid_new_probe_from_filename(device); + if (!pr) + return; + + tp = blkid_probe_get_topology(pr); + if (!tp) + goto out_free_probe; + + val = blkid_topology_get_logical_sector_size(tp); + *lsectorsize = val; + val = blkid_topology_get_physical_sector_size(tp); + *psectorsize = val; + val = blkid_topology_get_minimum_io_size(tp); + *sunit = val; + val = blkid_topology_get_optimal_io_size(tp); + *swidth = val; + + /* + * If the reported values are the same as the physical sector size + * do not bother to report anything. It will only cause warnings + * if people specify larger stripe units or widths manually. + */ + if (*sunit == *psectorsize || *swidth == *psectorsize) { + *sunit = 0; + *swidth = 0; + } + + /* + * Blkid reports the information in terms of bytes, but we want it in + * terms of 512 bytes blocks (only to convert it to bytes later..) + */ + *sunit = *sunit >> 9; + *swidth = *swidth >> 9; + + if (blkid_topology_get_alignment_offset(tp) != 0) { + fprintf(stderr, + _("warning: device is not properly aligned %s\n"), + device); + + if (!force_overwrite) { + fprintf(stderr, + _("Use -f to force usage of a misaligned device\n")); + + exit(EXIT_FAILURE); + } + /* Do not use physical sector size if the device is misaligned */ + *psectorsize = *lsectorsize; + } + + blkid_free_probe(pr); + return; + +out_free_probe: + blkid_free_probe(pr); + fprintf(stderr, + _("warning: unable to probe device topology for device %s\n"), + device); +} +#else /* ifdef ENABLE_BLKID */ +/* + * Without blkid, we can't do a good check for signatures. + * So instead of some messy attempts, just disable any checks + * and always return 'nothing found'. + */ +# warning BLKID is disabled, so signature detection and block device\ + access are not working! + +int +check_overwrite( + char *device) +{ + return 1; +} + +static void +blkid_get_topology( + const char *device, + int *sunit, + int *swidth, + int *lsectorsize, + int *psectorsize, + int force_overwrite) +{ + /* + * Shouldn't make any difference (no blkid = no block device access), + * but make sure this dummy replacement returns with at least some + * sanity. + */ + *lsectorsize = *psectorsize = 512; +} + +#endif /* ENABLE_BLKID */ + + +void +get_topology( + libxfs_init_t *xi, + struct fs_topology *ft, + int force_overwrite) +{ + struct stat statbuf; + char *dfile = xi->volname ? xi->volname : xi->dname; + + /* + * If our target is a regular file, use platform_findsizes + * to try to obtain the underlying filesystem's requirements + * for direct IO; we'll set our sector size to that if possible. + */ + if (xi->disfile || + (!stat(dfile, &statbuf) && S_ISREG(statbuf.st_mode))) { + int fd; + int flags = O_RDONLY; + long long dummy; + + /* with xi->disfile we may not have the file yet! */ + if (xi->disfile) + flags |= O_CREAT; + + fd = open(dfile, flags, 0666); + if (fd >= 0) { + platform_findsizes(dfile, fd, &dummy, &ft->lsectorsize); + close(fd); + ft->psectorsize = ft->lsectorsize; + } else + ft->psectorsize = ft->lsectorsize = BBSIZE; + } else { + blkid_get_topology(dfile, &ft->dsunit, &ft->dswidth, + &ft->lsectorsize, &ft->psectorsize, + force_overwrite); + } + + if (xi->rtname && !xi->risfile) { + int sunit, lsectorsize, psectorsize; + + blkid_get_topology(xi->rtname, &sunit, &ft->rtswidth, + &lsectorsize, &psectorsize, force_overwrite); + } +} diff --git a/mkfs/Makefile b/mkfs/Makefile index 570ab07..2997398 100644 --- a/mkfs/Makefile +++ b/mkfs/Makefile @@ -10,7 +10,7 @@ LTCOMMAND = mkfs.xfs HFILES = xfs_mkfs.h CFILES = maxtrres.c proto.c xfs_mkfs.c -LLDLIBS += $(LIBBLKID) $(LIBXFS) $(LIBUUID) $(LIBRT) $(LIBPTHREAD) +LLDLIBS += $(LIBBLKID) $(LIBXFS) $(LIBUUID) $(LIBRT) $(LIBPTHREAD) $(LIBXCMD) LTDEPENDENCIES += $(LIBXFS) LLDFLAGS = -static-libtool-libs diff --git a/mkfs/xfs_mkfs.c b/mkfs/xfs_mkfs.c index 4c3a802..0a02719 100644 --- a/mkfs/xfs_mkfs.c +++ b/mkfs/xfs_mkfs.c @@ -22,17 +22,7 @@ # include #endif /* ENABLE_BLKID */ #include "xfs_mkfs.h" - -/* - * Device topology information. - */ -struct fs_topology { - int dsunit; /* stripe unit - data subvolume */ - int dswidth; /* stripe width - data subvolume */ - int rtswidth; /* stripe width - rt subvolume */ - int lsectorsize; /* logical sector size &*/ - int psectorsize; /* physical sector size */ -}; +#include "libxcmd.h" /* * Prototypes for internal functions. @@ -295,244 +285,6 @@ calc_stripe_factors( } } -/* - * Check for existing filesystem or partition table on device. - * Returns: - * 1 for existing fs or partition - * 0 for nothing found - * -1 for internal error - */ -#ifdef ENABLE_BLKID -static int -check_overwrite( - char *device) -{ - const char *type; - blkid_probe pr = NULL; - int ret; - int fd; - long long size; - int bsz; - - if (!device || !*device) - return 0; - - ret = -1; /* will reset on success of all setup calls */ - - fd = open(device, O_RDONLY); - if (fd < 0) - goto out; - platform_findsizes(device, fd, &size, &bsz); - close(fd); - - /* nothing to overwrite on a 0-length device */ - if (size == 0) { - ret = 0; - goto out; - } - - pr = blkid_new_probe_from_filename(device); - if (!pr) - goto out; - - ret = blkid_probe_enable_partitions(pr, 1); - if (ret < 0) - goto out; - - ret = blkid_do_fullprobe(pr); - if (ret < 0) - goto out; - - /* - * Blkid returns 1 for nothing found and 0 when it finds a signature, - * but we want the exact opposite, so reverse the return value here. - * - * In addition print some useful diagnostics about what actually is - * on the device. - */ - if (ret) { - ret = 0; - goto out; - } - - if (!blkid_probe_lookup_value(pr, "TYPE", &type, NULL)) { - fprintf(stderr, - _("%s: %s appears to contain an existing " - "filesystem (%s).\n"), progname, device, type); - } else if (!blkid_probe_lookup_value(pr, "PTTYPE", &type, NULL)) { - fprintf(stderr, - _("%s: %s appears to contain a partition " - "table (%s).\n"), progname, device, type); - } else { - fprintf(stderr, - _("%s: %s appears to contain something weird " - "according to blkid\n"), progname, device); - } - ret = 1; - -out: - if (pr) - blkid_free_probe(pr); - if (ret == -1) - fprintf(stderr, - _("%s: probe of %s failed, cannot detect " - "existing filesystem.\n"), progname, device); - return ret; -} - -static void blkid_get_topology( - const char *device, - int *sunit, - int *swidth, - int *lsectorsize, - int *psectorsize, - int force_overwrite) -{ - - blkid_topology tp; - blkid_probe pr; - unsigned long val; - struct stat statbuf; - - /* can't get topology info from a file */ - if (!stat(device, &statbuf) && S_ISREG(statbuf.st_mode)) - return; - - pr = blkid_new_probe_from_filename(device); - if (!pr) - return; - - tp = blkid_probe_get_topology(pr); - if (!tp) - goto out_free_probe; - - val = blkid_topology_get_logical_sector_size(tp); - *lsectorsize = val; - val = blkid_topology_get_physical_sector_size(tp); - *psectorsize = val; - val = blkid_topology_get_minimum_io_size(tp); - *sunit = val; - val = blkid_topology_get_optimal_io_size(tp); - *swidth = val; - - /* - * If the reported values are the same as the physical sector size - * do not bother to report anything. It will only cause warnings - * if people specify larger stripe units or widths manually. - */ - if (*sunit == *psectorsize || *swidth == *psectorsize) { - *sunit = 0; - *swidth = 0; - } - - /* - * Blkid reports the information in terms of bytes, but we want it in - * terms of 512 bytes blocks (only to convert it to bytes later..) - */ - *sunit = *sunit >> 9; - *swidth = *swidth >> 9; - - if (blkid_topology_get_alignment_offset(tp) != 0) { - fprintf(stderr, - _("warning: device is not properly aligned %s\n"), - device); - - if (!force_overwrite) { - fprintf(stderr, - _("Use -f to force usage of a misaligned device\n")); - - exit(EXIT_FAILURE); - } - /* Do not use physical sector size if the device is misaligned */ - *psectorsize = *lsectorsize; - } - - blkid_free_probe(pr); - return; - -out_free_probe: - blkid_free_probe(pr); - fprintf(stderr, - _("warning: unable to probe device topology for device %s\n"), - device); -} -#else /* ifdef ENABLE_BLKID */ -/* - * Without blkid, we can't do a good check for signatures. - * So instead of some messy attempts, just disable any checks - * and always return 'nothing found'. - */ -# warning BLKID is disabled, so signature detection and block device\ - access are not working! -static int -check_overwrite( - char *device) -{ - return 1; -} - -static void blkid_get_topology( - const char *device, - int *sunit, - int *swidth, - int *lsectorsize, - int *psectorsize, - int force_overwrite) -{ - /* - * Shouldn't make any difference (no blkid = no block device access), - * but make sure this dummy replacement returns with at least some - * sanity. - */ - *lsectorsize = *psectorsize = 512; -} - -#endif /* ENABLE_BLKID */ - -static void get_topology( - libxfs_init_t *xi, - struct fs_topology *ft, - int force_overwrite) -{ - struct stat statbuf; - char *dfile = xi->volname ? xi->volname : xi->dname; - - /* - * If our target is a regular file, use platform_findsizes - * to try to obtain the underlying filesystem's requirements - * for direct IO; we'll set our sector size to that if possible. - */ - if (xi->disfile || - (!stat(dfile, &statbuf) && S_ISREG(statbuf.st_mode))) { - int fd; - int flags = O_RDONLY; - long long dummy; - - /* with xi->disfile we may not have the file yet! */ - if (xi->disfile) - flags |= O_CREAT; - - fd = open(dfile, flags, 0666); - if (fd >= 0) { - platform_findsizes(dfile, fd, &dummy, &ft->lsectorsize); - close(fd); - ft->psectorsize = ft->lsectorsize; - } else - ft->psectorsize = ft->lsectorsize = BBSIZE; - } else { - blkid_get_topology(dfile, &ft->dsunit, &ft->dswidth, - &ft->lsectorsize, &ft->psectorsize, - force_overwrite); - } - - if (xi->rtname && !xi->risfile) { - int sunit, lsectorsize, psectorsize; - - blkid_get_topology(xi->rtname, &sunit, &ft->rtswidth, - &lsectorsize, &psectorsize, force_overwrite); - } -} - static void fixup_log_stripe_unit( int lsflag, @@ -640,77 +392,6 @@ calc_default_imaxpct( return 1; } - -void -calc_default_ag_geometry( - int blocklog, - __uint64_t dblocks, - int multidisk, - __uint64_t *agsize, - __uint64_t *agcount) -{ - __uint64_t blocks = 0; - int shift = 0; - - /* - * First handle the high extreme - the point at which we will - * always use the maximum AG size. - * - * This applies regardless of storage configuration. - */ - if (dblocks >= TERABYTES(32, blocklog)) { - blocks = XFS_AG_MAX_BLOCKS(blocklog); - goto done; - } - - /* - * For the remainder we choose an AG size based on the - * number of data blocks available, trying to keep the - * number of AGs relatively small (especially compared - * to the original algorithm). AG count is calculated - * based on the preferred AG size, not vice-versa - the - * count can be increased by growfs, so prefer to use - * smaller counts at mkfs time. - * - * For a single underlying storage device between 128MB - * and 4TB in size, just use 4 AGs, otherwise scale up - * smoothly between min/max AG sizes. - */ - - if (!multidisk && dblocks >= MEGABYTES(128, blocklog)) { - if (dblocks >= TERABYTES(4, blocklog)) { - blocks = XFS_AG_MAX_BLOCKS(blocklog); - goto done; - } - shift = 2; - } else if (dblocks > GIGABYTES(512, blocklog)) - shift = 5; - else if (dblocks > GIGABYTES(8, blocklog)) - shift = 4; - else if (dblocks >= MEGABYTES(128, blocklog)) - shift = 3; - else if (dblocks >= MEGABYTES(64, blocklog)) - shift = 2; - else if (dblocks >= MEGABYTES(32, blocklog)) - shift = 1; - else - shift = 0; - /* - * If dblocks is not evenly divisible by the number of - * desired AGs, round "blocks" up so we don't lose the - * last bit of the filesystem. The same principle applies - * to the AG count, so we don't lose the last AG! - */ - blocks = dblocks >> shift; - if (dblocks & xfs_mask32lo(shift)) { - if (blocks < XFS_AG_MAX_BLOCKS(blocklog)) - blocks++; - } -done: - *agsize = blocks; - *agcount = dblocks / blocks + (dblocks % blocks != 0); -} - static void validate_ag_geometry( int blocklog, -- 2.5.0 From billodo@redhat.com Fri Feb 12 13:04:03 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=ham version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay1.corp.sgi.com [137.38.102.111]) by oss.sgi.com (Postfix) with ESMTP id CFD507CBA for ; Fri, 12 Feb 2016 13:04:03 -0600 (CST) Received: from cuda.sgi.com (cuda3.sgi.com [192.48.176.15]) by relay1.corp.sgi.com (Postfix) with ESMTP id C30A98F8035 for ; Fri, 12 Feb 2016 11:04:00 -0800 (PST) X-ASG-Debug-ID: 1455303838-04cb6c1e5897ed0001-NocioJ Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by cuda.sgi.com with ESMTP id 9GKh1HWOLpWW9mIo (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO) for ; Fri, 12 Feb 2016 11:03:59 -0800 (PST) X-Barracuda-Envelope-From: billodo@redhat.com X-Barracuda-Apparent-Source-IP: 209.132.183.28 X-ASG-Whitelist: Client Received: from int-mx11.intmail.prod.int.phx2.redhat.com (int-mx11.intmail.prod.int.phx2.redhat.com [10.5.11.24]) by mx1.redhat.com (Postfix) with ESMTPS id BDA1F106E for ; Fri, 12 Feb 2016 19:03:58 +0000 (UTC) Received: from localhost.localdomain.com (vpn-59-18.rdu2.redhat.com [10.10.59.18]) by int-mx11.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id u1CJ3vCX023782 for ; Fri, 12 Feb 2016 14:03:58 -0500 From: "Bill O'Donnell" To: xfs@oss.sgi.com Subject: [PATCH v4 2/2] xfs_repair: new secondary superblock search method Date: Fri, 12 Feb 2016 13:03:31 -0600 X-ASG-Orig-Subj: [PATCH v4 2/2] xfs_repair: new secondary superblock search method Message-Id: <1455303811-9874-3-git-send-email-billodo@redhat.com> In-Reply-To: <1455303811-9874-1-git-send-email-billodo@redhat.com> References: <1455303811-9874-1-git-send-email-billodo@redhat.com> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.24 X-Barracuda-Connect: mx1.redhat.com[209.132.183.28] X-Barracuda-Start-Time: 1455303839 X-Barracuda-Encrypted: ECDHE-RSA-AES256-GCM-SHA384 X-Barracuda-URL: https://192.48.176.15:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-BRTS-Status: 1 Optimize secondary sb search, using similar method to find fs geometry as that of xfs_mkfs. If this faster method fails in finding a secondary sb, fall back to original brute force slower search. Signed-off-by: Bill O'Donnell --- Makefile | 2 +- include/libxcmd.h | 6 +++++- libxcmd/topology.c | 27 +++++++++++++++++++++++++++ repair/Makefile | 4 ++-- repair/sb.c | 49 +++++++++++++++++++++++++++++++++++++++++-------- 5 files changed, 76 insertions(+), 12 deletions(-) diff --git a/Makefile b/Makefile index fca0a42..1d60d9c 100644 --- a/Makefile +++ b/Makefile @@ -80,7 +80,7 @@ fsr: libhandle growfs: libxcmd io: libxcmd libhandle quota: libxcmd -repair: libxlog +repair: libxlog libxcmd copy: libxlog ifeq ($(HAVE_BUILDDEFS), yes) diff --git a/include/libxcmd.h b/include/libxcmd.h index a912534..eb16cd5 100644 --- a/include/libxcmd.h +++ b/include/libxcmd.h @@ -51,6 +51,10 @@ extern int check_overwrite( char *device); - +extern int +guess_default_geometry( + __uint64_t *agsize, + __uint64_t *agcount, + libxfs_init_t x); #endif /* __LIBXCMD_H__ */ diff --git a/libxcmd/topology.c b/libxcmd/topology.c index 4cbe4b1..ec9695c 100644 --- a/libxcmd/topology.c +++ b/libxcmd/topology.c @@ -339,3 +339,30 @@ get_topology( &lsectorsize, &psectorsize, force_overwrite); } } + +int +guess_default_geometry( + __uint64_t *agsize, + __uint64_t *agcount, + libxfs_init_t x) +{ + struct fs_topology ft; + int blocklog; + __uint64_t dblocks; + int multidisk; + + memset(&ft, 0, sizeof(ft)); + get_topology(&x, &ft, 1); + + /* + * get geometry from get_topology result. + * Use default block size (2^12) + */ + blocklog = 12; + multidisk = ft.dswidth | ft.dsunit; + dblocks = x.dsize >> (blocklog - BBSHIFT); + calc_default_ag_geometry(blocklog, dblocks, multidisk, + agsize, agcount); + + return blocklog; +} diff --git a/repair/Makefile b/repair/Makefile index 251722b..d24ab1f 100644 --- a/repair/Makefile +++ b/repair/Makefile @@ -20,8 +20,8 @@ CFILES = agheader.c attr_repair.c avl.c avl64.c bmap.c btree.c \ progress.c prefetch.c rt.c sb.c scan.c threads.c \ versions.c xfs_repair.c -LLDLIBS = $(LIBXFS) $(LIBXLOG) $(LIBUUID) $(LIBRT) $(LIBPTHREAD) -LTDEPENDENCIES = $(LIBXFS) $(LIBXLOG) +LLDLIBS = $(LIBBLKID) $(LIBXFS) $(LIBXLOG) $(LIBUUID) $(LIBRT) $(LIBPTHREAD) $(LIBXCMD) +LTDEPENDENCIES = $(LIBXFS) $(LIBXLOG) $(LIBXCMD) LLDFLAGS = -static-libtool-libs default: depend $(LTCOMMAND) diff --git a/repair/sb.c b/repair/sb.c index 4eef14a..8dcad5f 100644 --- a/repair/sb.c +++ b/repair/sb.c @@ -17,6 +17,7 @@ */ #include "libxfs.h" +#include "libxcmd.h" #include "libxlog.h" #include "agheader.h" #include "globals.h" @@ -85,10 +86,15 @@ copy_sb(xfs_sb_t *source, xfs_sb_t *dest) } /* - * find a secondary superblock, copy it into the sb buffer + * find a secondary superblock, copy it into the sb buffer. + * start is the point to begin reading BSIZE bytes. + * skip contains a byte-count of how far to advance for next read. */ -int -find_secondary_sb(xfs_sb_t *rsb) +static int +__find_secondary_sb( + xfs_sb_t *rsb, + __uint64_t start, + __uint64_t skip) { xfs_off_t off; xfs_sb_t *sb; @@ -101,7 +107,6 @@ find_secondary_sb(xfs_sb_t *rsb) int bsize; do_warn(_("\nattempting to find secondary superblock...\n")); - sb = (xfs_sb_t *)memalign(libxfs_device_alignment(), BSIZE); if (!sb) { do_error( @@ -117,7 +122,7 @@ find_secondary_sb(xfs_sb_t *rsb) /* * skip first sector since we know that's bad */ - for (done = 0, off = XFS_AG_MIN_BYTES; !done ; off += bsize) { + for (done = 0, off = start; !done ; off += skip) { /* * read disk 1 MByte at a time. */ @@ -128,9 +133,7 @@ find_secondary_sb(xfs_sb_t *rsb) if (!done && (bsize = read(x.dfd, sb, BSIZE)) <= 0) { done = 1; } - do_warn("."); - /* * check the buffer 512 bytes at a time since * we don't know how big the sectors really are. @@ -166,7 +169,37 @@ find_secondary_sb(xfs_sb_t *rsb) } free(sb); - return(retval); + return retval; +} + +int +find_secondary_sb(xfs_sb_t *rsb) +{ + int retval; + __uint64_t agcount; + __uint64_t agsize; + __uint64_t skip; + int blocklog; + + /* + * Attempt to find secondary sb with a coarse approach, + * using a large skip (agsize in bytes). Failing that, + * fallback to the fine-grained approach using min agsize. + */ + blocklog = guess_default_geometry(&agsize, &agcount, x); + + /* + * use found ag geometry to quickly find secondary sb + */ + skip = agsize << blocklog; + retval = __find_secondary_sb(rsb, skip, skip); + if (!retval) { + /* + * fallback: use minimum agsize for skipsize + */ + retval = __find_secondary_sb(rsb, XFS_AG_MIN_BYTES, BSIZE); + } + return retval; } /* -- 2.5.0 From BATV+dc0e37d0786dce58806e+4555+infradead.org+hch@bombadil.srs.infradead.org Fri Feb 12 13:10:49 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=ham version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay2.corp.sgi.com [137.38.102.29]) by oss.sgi.com (Postfix) with ESMTP id B7FFA7CBA for ; Fri, 12 Feb 2016 13:10:49 -0600 (CST) Received: from cuda.sgi.com (cuda2.sgi.com [192.48.176.25]) by relay2.corp.sgi.com (Postfix) with ESMTP id A8F70304051 for ; Fri, 12 Feb 2016 11:10:49 -0800 (PST) X-ASG-Debug-ID: 1455304246-04cbb04332a2d50001-NocioJ Received: from bombadil.infradead.org ([198.137.202.9]) by cuda.sgi.com with ESMTP id vUbQcxC1CY7PhGXU (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128 verify=NO) for ; Fri, 12 Feb 2016 11:10:47 -0800 (PST) X-Barracuda-Envelope-From: BATV+dc0e37d0786dce58806e+4555+infradead.org+hch@bombadil.srs.infradead.org X-Barracuda-Apparent-Source-IP: 198.137.202.9 Received: from hch by bombadil.infradead.org with local (Exim 4.80.1 #2 (Red Hat Linux)) id 1aUJ78-0002fJ-87; Fri, 12 Feb 2016 19:10:46 +0000 Date: Fri, 12 Feb 2016 11:10:46 -0800 From: Christoph Hellwig To: Dave Chinner Cc: Christoph Hellwig , xfs@oss.sgi.com, "Darrick J. Wong" Subject: Re: block allocations for the refcount btree Message-ID: <20160212191046.GA28421@infradead.org> X-ASG-Orig-Subj: Re: block allocations for the refcount btree References: <20160210093011.GA19147@infradead.org> <20160210095010.GC23904@birch.djwong.org> <20160210190738.GA13051@infradead.org> <20160210214058.GN14668@dastard> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20160210214058.GN14668@dastard> User-Agent: Mutt/1.5.24 (2015-08-30) X-SRS-Rewrite: SMTP reverse-path rewritten from by bombadil.infradead.org See http://www.infradead.org/rpr.html X-Barracuda-Connect: UNKNOWN[198.137.202.9] X-Barracuda-Start-Time: 1455304246 X-Barracuda-Encrypted: ECDHE-RSA-AES128-GCM-SHA256 X-Barracuda-URL: https://192.48.176.25:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-BRTS-Status: 1 X-Barracuda-Spam-Score: 2.60 X-Barracuda-Spam-Status: No, SCORE=2.60 using per-user scores of TAG_LEVEL=1000.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.7 tests=BSF_SC0_MISMATCH_TO, BSF_SC7_SA_HREF_FROM_MISMATCH_TEXT_URIx1_HL, RDNS_NONE X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.3.26982 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 0.00 BSF_SC0_MISMATCH_TO Envelope rcpt doesn't match header 0.10 RDNS_NONE Delivered to trusted network by a host with no rDNS 2.50 BSF_SC7_SA_HREF_FROM_MISMATCH_TEXT_URIx1_HL Custom Rule HREF_FROM_MISMATCH_TEXT_URIx1_HL On Thu, Feb 11, 2016 at 08:40:58AM +1100, Dave Chinner wrote: > I run into that from time to time (maybe once a month) on a vanilla > kernel. > > IIRC, the problem is the delayed allocation extent split runs out of > it's reserved block count if you split it enough times. The case > I've seen is that the indlen calculated in xfs_bmap_worst_indlen() > ends up too small for a subsequent allocation after we've called > xfs_bmap_del_extent() to delete the middle of a delalloc extent too > many times. > > Brian had some patches that attempted to solve it - we may have > simply dropped the ball on this (again). > > http://oss.sgi.com/archives/xfs/2014-09/msg00337.html I'm pretty sure that is a separate issue. With the refcount btree we may allocate an extent (or rather just a single block) in xfs_alloc_ag_vextent as called from xfs_refcountbt_alloc_block. The reservation helps us to ensure this block is always available, but we still need to account for that in xfs_trans_reserve(), which we currently don't do for itruncate transactions. From BATV+dc0e37d0786dce58806e+4555+infradead.org+hch@bombadil.srs.infradead.org Fri Feb 12 13:39:44 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=ham version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay2.corp.sgi.com [137.38.102.29]) by oss.sgi.com (Postfix) with ESMTP id 3F3AB7F47 for ; Fri, 12 Feb 2016 13:39:44 -0600 (CST) Received: from cuda.sgi.com (cuda1.sgi.com [192.48.157.11]) by relay2.corp.sgi.com (Postfix) with ESMTP id 0C305304048 for ; Fri, 12 Feb 2016 11:39:43 -0800 (PST) X-ASG-Debug-ID: 1455305982-04bdf066ed8c770001-NocioJ Received: from bombadil.infradead.org ([198.137.202.9]) by cuda.sgi.com with ESMTP id S1tzTLkuFjb7oO0R (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128 verify=NO) for ; Fri, 12 Feb 2016 11:39:42 -0800 (PST) X-Barracuda-Envelope-From: BATV+dc0e37d0786dce58806e+4555+infradead.org+hch@bombadil.srs.infradead.org X-Barracuda-Apparent-Source-IP: 198.137.202.9 Received: from hch by bombadil.infradead.org with local (Exim 4.80.1 #2 (Red Hat Linux)) id 1aUJZ8-0001ix-5D; Fri, 12 Feb 2016 19:39:42 +0000 Date: Fri, 12 Feb 2016 11:39:42 -0800 From: Christoph Hellwig To: Bill O'Donnell Cc: xfs@oss.sgi.com Subject: Re: [PATCH v4 1/2] libxcmd: generalize topology functions Message-ID: <20160212193942.GA4770@infradead.org> X-ASG-Orig-Subj: Re: [PATCH v4 1/2] libxcmd: generalize topology functions References: <1455303811-9874-1-git-send-email-billodo@redhat.com> <1455303811-9874-2-git-send-email-billodo@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1455303811-9874-2-git-send-email-billodo@redhat.com> User-Agent: Mutt/1.5.24 (2015-08-30) X-SRS-Rewrite: SMTP reverse-path rewritten from by bombadil.infradead.org See http://www.infradead.org/rpr.html X-Barracuda-Connect: UNKNOWN[198.137.202.9] X-Barracuda-Start-Time: 1455305982 X-Barracuda-Encrypted: ECDHE-RSA-AES128-GCM-SHA256 X-Barracuda-URL: https://192.48.157.11:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-BRTS-Status: 1 X-Barracuda-Spam-Score: 0.10 X-Barracuda-Spam-Status: No, SCORE=0.10 using per-user scores of TAG_LEVEL=1000.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.7 tests=BSF_SC0_MISMATCH_TO, RDNS_NONE X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.3.26982 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 0.00 BSF_SC0_MISMATCH_TO Envelope rcpt doesn't match header 0.10 RDNS_NONE Delivered to trusted network by a host with no rDNS On Fri, Feb 12, 2016 at 01:03:30PM -0600, Bill O'Donnell wrote: > Move general topology functions from xfs_mkfs to new topology > collection in libxcmd. Why libxcmd and not libxfs? From billodo@redhat.com Fri Feb 12 13:47:54 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=ham version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay3.corp.sgi.com [198.149.34.15]) by oss.sgi.com (Postfix) with ESMTP id 8004E7CA5 for ; Fri, 12 Feb 2016 13:47:54 -0600 (CST) Received: from cuda.sgi.com (cuda2.sgi.com [192.48.176.25]) by relay3.corp.sgi.com (Postfix) with ESMTP id B7AD6AC007 for ; Fri, 12 Feb 2016 11:47:53 -0800 (PST) X-ASG-Debug-ID: 1455306471-04cbb04333a40b0001-NocioJ Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by cuda.sgi.com with ESMTP id Z04C53E2oJMYp2dz (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO) for ; Fri, 12 Feb 2016 11:47:52 -0800 (PST) X-Barracuda-Envelope-From: billodo@redhat.com X-Barracuda-Apparent-Source-IP: 209.132.183.28 X-ASG-Whitelist: Client Received: from int-mx11.intmail.prod.int.phx2.redhat.com (int-mx11.intmail.prod.int.phx2.redhat.com [10.5.11.24]) by mx1.redhat.com (Postfix) with ESMTPS id BB2F8C0A846A; Fri, 12 Feb 2016 19:47:51 +0000 (UTC) Received: from redhat.com (vpn-59-18.rdu2.redhat.com [10.10.59.18]) by int-mx11.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id u1CJlnm1015764 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Fri, 12 Feb 2016 14:47:51 -0500 Date: Fri, 12 Feb 2016 13:47:49 -0600 From: "Bill O'Donnell" To: Christoph Hellwig Cc: xfs@oss.sgi.com Subject: Re: [PATCH v4 1/2] libxcmd: generalize topology functions Message-ID: <20160212194749.GA10069@redhat.com> X-ASG-Orig-Subj: Re: [PATCH v4 1/2] libxcmd: generalize topology functions References: <1455303811-9874-1-git-send-email-billodo@redhat.com> <1455303811-9874-2-git-send-email-billodo@redhat.com> <20160212193942.GA4770@infradead.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20160212193942.GA4770@infradead.org> User-Agent: Mutt/1.5.24 (2015-08-30) X-Scanned-By: MIMEDefang 2.68 on 10.5.11.24 X-Barracuda-Connect: mx1.redhat.com[209.132.183.28] X-Barracuda-Start-Time: 1455306472 X-Barracuda-Encrypted: ECDHE-RSA-AES256-GCM-SHA384 X-Barracuda-URL: https://192.48.176.25:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-BRTS-Status: 1 On Fri, Feb 12, 2016 at 11:39:42AM -0800, Christoph Hellwig wrote: > On Fri, Feb 12, 2016 at 01:03:30PM -0600, Bill O'Donnell wrote: > > Move general topology functions from xfs_mkfs to new topology > > collection in libxcmd. > > Why libxcmd and not libxfs? We discussed that a bit. Since libxfs has the kernel support code, and not generally the xfsprogs library, I put it in libxcmd. From lins@icems.kyoto-u.ac.jp Fri Feb 12 14:30:35 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.5 required=5.0 tests=HTML_MESSAGE,SUBJ_ALL_CAPS autolearn=no version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay3.corp.sgi.com [198.149.34.15]) by oss.sgi.com (Postfix) with ESMTP id 5F9E97F53 for ; Fri, 12 Feb 2016 14:30:35 -0600 (CST) Received: from cuda.sgi.com (cuda3.sgi.com [192.48.176.15]) by relay3.corp.sgi.com (Postfix) with ESMTP id BB85FAC004 for ; Fri, 12 Feb 2016 12:30:31 -0800 (PST) X-ASG-Debug-ID: 1455309025-04cb6c1e599ab10001-NocioJ Received: from omls-1.kuins.kyoto-u.ac.jp (omls-1.kuins.kyoto-u.ac.jp [130.54.130.84]) by cuda.sgi.com with ESMTP id 2gaPunGhbfP6rbLB (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO) for ; Fri, 12 Feb 2016 12:30:26 -0800 (PST) X-Barracuda-Envelope-From: lins@icems.kyoto-u.ac.jp X-Barracuda-Apparent-Source-IP: 130.54.130.84 Received: from scmls-s02.kuins.kyoto-u.ac.jp (scmls-s02.kuins.kyoto-u.ac.jp [133.3.201.215]) by omls-1.kuins.kyoto-u.ac.jp (8.14.4/8.12.7) with ESMTP id u1CKTHcm014202; Sat, 13 Feb 2016 05:30:21 +0900 Received: from imls-2b.kuins.net (imls-2b.kuins.net [10.224.254.4]) by scmls-s02.kuins.kyoto-u.ac.jp (Symantec Messaging Gateway) with SMTP id 32.C6.07664.CD04EB65; Sat, 13 Feb 2016 05:30:20 +0900 (JST) Received: from vcmls-s04.kuins.net (vcmls-s04.kuins.net [10.224.254.152]) by imls-2b.kuins.net (8.14.4/8.12.10) with ESMTP id u1CKRLwV033168; Sat, 13 Feb 2016 05:30:20 +0900 X-AuditID: 0ae0fe9d-f797d6d000001df0-ad-56be40dc62f0 Received: from mfmls-s04.kuins.net (mfmls-s04.kuins.net [10.224.254.149]) by vcmls-s04.kuins.net (Symantec Messaging Gateway) with SMTP id B5.BF.01306.CD04EB65; Sat, 13 Feb 2016 05:30:20 +0900 (JST) Received: from mail.icems.kyoto-u.ac.jp (hosts12b.iimc.kyoto-u.ac.jp [133.3.251.21]) by mfmls-s04.kuins.net (8.14.4/8.14.4) with ESMTP id u1CKQIuN006239; Sat, 13 Feb 2016 05:30:18 +0900 Received: from [130.54.103.25] (arcgis-2015.asafas.kyoto-u.ac.jp [130.54.103.25]) by mail.icems.kyoto-u.ac.jp (Postfix) with ESMTP id C12D711C01AD; Sat, 13 Feb 2016 05:19:49 +0900 (JST) Content-Type: multipart/alternative; boundary="===============1102121030==" MIME-Version: 1.0 Subject: SANTANDER ALERTS SERVICE UPDATE To: Recipients X-ASG-Orig-Subj: SANTANDER ALERTS SERVICE UPDATE From: "Santander UK" Date: Sat, 13 Feb 2016 05:18:59 +0900 Message-Id: <20160212201949.C12D711C01AD@mail.icems.kyoto-u.ac.jp> X-Brightmail-Tracker: H4sIAAAAAAAAA42Tb0wbZRzH89xdr0fDmVvZxiNqTJroUDMYZiE/l4FAfHGGFy5RFp1TKXLS ZqWQXotgMtdN6SZWQhcls4xsQFpQuwFVtLYZxkJwozgqfwW6ynAwLFMGY8E5/HNHHZvvfPPk +/y+n9/3m0vuYUh1rzKF0RvNgsmoNWhoFaWa/ovaHsnp3rvD0ZsB4eZGEr5q9ihg6WwPAptr kIBr4RUKPMNDCJprJxGMfhglYLzFR8CJmWfBHciEhvqoAlznLxDQe9yPYNHlVYBtqo6CuqU5 GppvDpEQXfmAANvYHogd7iRh/uhpJUxFZpXQ5viIgCPXK2Ct/6ICusYXKJhdq0bwizsLFn94 Hi42BWhY+nkfdIQWFOAdCVBw9uoSDVfnaxVw5BM3CZGWPhomHa00DDuayJxUftTxJcF/Fu5C vH1kkOYHrmXy9iufK/jqHhfivd/MkLztRkjJj3S20/xP7qiS/27gMMU7nT0Ebw3fIPew+1S7 iwWDvkIwpWcXqnS3JlxkeU1i5a/vL1NWNJdQgxgGczvxpfeSa1CCJLficLSdlrWaG0C4b5mq QSpJdyJs/8OL4tBO/Hubj4gb5xF2Ogb/pc4h7HPOoo3LaEeIkFdILh+v3FpVyJrlNuELH1+h 5OokLhUfdanl8WbuMXz5t+vrCM2l4+NfHFvXFPcIDvXX0jLOcnl44lu1HI+5AQZfbllU1iHO eU+D854Gp7RCSrHt/vT/jmX8CexuWiDjyKP4Zo05Pk7F1Scblf8DP41Un6Ik8fVSg7hd3PFk 2gGL3iimGQWzF8V/xEYfGgo8E0QcgzSJ7Imt3XvVCm2FWFUaRPczhGYL25glje4rKiuu0mlF 3Wsmi0EQgwgzpGYz2/qQ5LHF2qq3BFPZHesBhtIks6jB8oKaK9GahQOCUC6Y7ripDMO9e3Jy BqVQxjKjoMHsq09LIZtMQolQ+YbeYL6LEkyCXJQoFQVkhhXLtaWiviTu96OnmB/7ps4QzJx/ WjpX/pw7R6jXQ1OS2QJ5gZMXdBbjRqb8+KrJ21tiKFn63CTWJ1OJ0tPcSI1JhYRU6Fv1y4Vm 7V0rxYpOqTITC4Il5Z3PNRT97a1oiHXNLxvenjCMW4oPFfnz3mxM060+zHYfbC/Nol9ebX0l I2e6/uCMtX7MlpJrbdu2P7ItLyOvMq3k6/xjukPZzqD9zLDX01v3/W37mEdj2Z1L7fJQhbvy 50Lpa5dsHftjDzpzywoLhl60vPPSVHZkXNRQok6b8ThpErX/AJUdP+dXBAAA X-Brightmail-Tracker: H4sIAAAAAAAAA42Sa0hTcRjG+5/bjsPBaUoduiAMilmpMyTe6IKExkmJRokfgshlhzaay7Yp 1ScNnLZMnXRdGbqx6bqZ89JQMtuitFUunYmX1k3tYqVrShpReaGob317nuf9Pc+nl8bFbeQS WqXR81qNQi2hhITw5Y8zMYOJrekyh0cAPksFDrcs10gI3vAgMNg6MfjomyDgWncXAktJP4Ke 0wEMeq0uDM6/3gb2lnVw8WyABFt7Bwb3ypsRjNmcJBgGyggoC45QYJnswiEwcQoDwzM5fMiv w+FdYaUABgaHBVBjOoPB8fFc+P7wCQmNvaMEDH8vQPDevgnGnu6CJ1UtFATf7Iab3lESnP4W Am68DVLw9l0JCccddhwGrfcp6DdVU9BtqsITpVyPqQnjrvoaEVfs76S4Rx/XccVD9SRX4LEh znnnNc4ZQl4B56+rpbgX9oCAe/Aon+DMZg/G5flCuFy0W7hxP69W5fLauM0ZQuV0nw3PNoYf +XTyC5GHRsKMKIxmmQR2qsaFzetFrC9QSxmRkBYz7Yg1mzqJeXMbsS7zMPpjem565yo4k8pO TH8lZ7WIWch2XBiaadB0BCNlC23i2TiSiWZffR6fQygmji1vKJrTBLOC9T4soWZxEbOF7bsr LkPh5r9GzX+NmmcofGaptjnu33gWX83aq0bxeWQlO2nUz8dStuBSheA/8EokvIIicjOz1LoY nSwh9mCOSqOL1fB6J5r7K02mC003JLkRQyNJuOj8otZ0ManI1R3NciOWxiWRourlM5Fov+Lo MV57aK82R83r3GgpTUgWi1Q6fZqYOaDQ8wd5PpvX/r5idNiSPCRrn37+U+G2L8NtyQu2lp96 QDT1hxyab2K/NHMkantj/r741BPKI5e7QjHbxYd9U0pr/Jqk4LnbJuuHlFL/QmVO4af17y3X VRWGmvE9Cb1t3pbSpLqd8scWlywt2Kie6kiUPcdSjTuGijZER2Vb69eKHpd6k7tTXPKMFEdK 1oSE0CkV8atwrU7xC351sKBTAwAA X-Barracuda-Connect: omls-1.kuins.kyoto-u.ac.jp[130.54.130.84] X-Barracuda-Start-Time: 1455309026 X-Barracuda-Encrypted: ECDHE-RSA-AES256-GCM-SHA384 X-Barracuda-URL: https://192.48.176.15:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-BRTS-Status: 1 X-Barracuda-Spam-Score: 1.64 X-Barracuda-Spam-Status: No, SCORE=1.64 using per-user scores of TAG_LEVEL=1000.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.7 tests=BSF_SC0_MISMATCH_TO, HTML_MESSAGE, SUBJ_ALL_CAPS, SUBJ_ALL_CAPS_2 X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.3.26983 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 0.00 BSF_SC0_MISMATCH_TO Envelope rcpt doesn't match header 0.00 HTML_MESSAGE BODY: HTML included in message 0.01 SUBJ_ALL_CAPS Subject is all capitals 1.62 SUBJ_ALL_CAPS_2 SUBJ_ALL_CAPS_2 You will not see this in a MIME-aware mail reader. --===============1102121030== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Description: Mail message body Dear Customer, Validating your email address is one more way that helps verify your ident= ity. To validate your email address, please follow these steps: 1.Click on this link to validate your email. Validate your email address = 2. Fill in the appropriate fields to validate your email address, and clic= k Sign In. You will then be able to Access your account. Best wishes, Santander UK --===============1102121030== Content-Type: text/html; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Description: Mail message body Dear Customer,

Validating your email address is one more way that helps verify your identi= ty.

To validate your email address, please follow these steps:

1.Click on this link to validate your email.

Validate your email address

2. Fill in the appropriate fields to validate your email address, and click= Sign In.

You will then be able to Access your account.

Best wishes,
Santander UK

--===============1102121030==-- From sandeen@sandeen.net Fri Feb 12 14:56:10 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=ham version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay1.corp.sgi.com [137.38.102.111]) by oss.sgi.com (Postfix) with ESMTP id E861E7CB2 for ; Fri, 12 Feb 2016 14:56:10 -0600 (CST) Received: from cuda.sgi.com (cuda2.sgi.com [192.48.176.25]) by relay1.corp.sgi.com (Postfix) with ESMTP id D9FF58F8035 for ; Fri, 12 Feb 2016 12:56:07 -0800 (PST) X-ASG-Debug-ID: 1455310561-04cbb04334a5a00001-NocioJ Received: from sandeen.net (sandeen.net [63.231.237.45]) by cuda.sgi.com with ESMTP id xnDUmbn4cMtWHEQT for ; Fri, 12 Feb 2016 12:56:02 -0800 (PST) X-Barracuda-Envelope-From: sandeen@sandeen.net X-Barracuda-Apparent-Source-IP: 63.231.237.45 Received: from liberator.sandeen.net (liberator.sandeen.net [10.0.0.4]) (using TLSv1.2 with cipher DHE-RSA-AES128-SHA (128/128 bits)) (No client certificate requested) by sandeen.net (Postfix) with ESMTPSA id A376663C5FF0 for ; Fri, 12 Feb 2016 14:56:01 -0600 (CST) Subject: Re: [PATCH] xfs_quota: modify commands which can't handle multiple types To: xfs@oss.sgi.com X-ASG-Orig-Subj: Re: [PATCH] xfs_quota: modify commands which can't handle multiple types References: <1455294538-31583-1-git-send-email-zlang@redhat.com> From: Eric Sandeen X-Enigmail-Draft-Status: N1110 Message-ID: <56BE46E1.5060902@sandeen.net> Date: Fri, 12 Feb 2016 14:56:01 -0600 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.11; rv:38.0) Gecko/20100101 Thunderbird/38.5.1 MIME-Version: 1.0 In-Reply-To: <1455294538-31583-1-git-send-email-zlang@redhat.com> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 8bit X-Barracuda-Connect: sandeen.net[63.231.237.45] X-Barracuda-Start-Time: 1455310561 X-Barracuda-URL: https://192.48.176.25:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-BRTS-Status: 1 X-Barracuda-Spam-Score: 1.25 X-Barracuda-Spam-Status: No, SCORE=1.25 using per-user scores of TAG_LEVEL=1000.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.7 tests=BSF_RULE_7580G, BSF_SC0_MV0713 X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.3.26984 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 0.75 BSF_RULE_7580G Custom Rule 7580G 0.50 BSF_SC0_MV0713 Custom rule MV0713 Hi Zorro - On 2/12/16 10:28 AM, Zorro Lang wrote: > Some xfs_quota commands can't deal with multiple types together. > For example, if we run "limit -ug ...", one type will overwrite > the other. I find below commands can't handle multiple types: > > [quota, limit, timer, warn, dump, restore and quot] > > (Although timer and warn command can't support -ugp types until > now, it will in one day.) > > For every single $command, I change their ${command}_f function, > ${command}_help() function, ${command}_cmd structure and man page. > > Signed-off-by: Zorro Lang > --- > man/man8/xfs_quota.8 | 96 +++++++++++++++++++++++++++++++++++++++++++++------- > quota/edit.c | 78 ++++++++++++++++++++++++++---------------- > quota/quot.c | 21 +++++++----- > quota/quota.c | 21 +++++++----- > quota/report.c | 26 +++++++++----- > 5 files changed, 175 insertions(+), 67 deletions(-) > > diff --git a/man/man8/xfs_quota.8 b/man/man8/xfs_quota.8 > index 3bee145..4652dfe 100644 > --- a/man/man8/xfs_quota.8 > +++ b/man/man8/xfs_quota.8 > @@ -169,7 +169,11 @@ command. > .HP > .B quota > [ > -.B \-gpu > +.B \-g > +| > +.B \-p > +| > +.B \-u > ] [ > .B \-bir > ] [ I had mentioned on IRC that this might be more compact: .BR \-g | \-u | \-p but actually yours may look better, with spaces. So that looks good. ... snip ... > @@ -442,11 +466,21 @@ be modified. The current timeout setting can be displayed using the > .B state > command. The value argument is a number of seconds, but units of > \&'minutes', 'hours', 'days', and 'weeks' are also understood > -(as are their abbreviations 'm', 'h', 'd', and 'w'). > +(as are their abbreviations 'm', 'h', 'd', and 'w'). The > +.B \-u > +, > +.B \-g > +and > +.B \-p > +types can't be used together for this command. If you present it as [-u|-g|-p] or "-u|-g|-p" I don't think you need to re-state that they are exclusive. (this is true for every command you've modified) It's a standard that everyone should be aware of: http://pubs.opengroup.org/onlinepubs/9699919799/basedefs/V1_chap12.html ... > diff --git a/quota/edit.c b/quota/edit.c > index 6146f7e..9dab4c3 100644 > --- a/quota/edit.c > +++ b/quota/edit.c > @@ -43,9 +43,9 @@ limit_help(void) > " block limits that are currently being used for the specified user, group,\n" > " or project. The filesystem identified by the current path is modified.\n" > " -d -- set the default values, used the first time a file is created\n" > -" -g -- modify group quota limits\n" > -" -p -- modify project quota limits\n" > -" -u -- modify user quota limits\n" > +" -g -- modify group quota limits, can't coexist with -p, -u\n" > +" -p -- modify project quota limits, can't coexist with -g, -u\n" > +" -u -- modify user quota limits, can't coexist with -g, -p\n" > " The block limit values can be specified with a units suffix - accepted\n" > " units are: k (kilobytes), m (megabytes), g (gigabytes), and t (terabytes).\n" > " The user/group/project can be specified either by name or by number.\n" Again, I think that if the help output specifies it as: limit [-g|-p|-u] bsoft|bhard|isoft|ihard|rtbsoft|rtbhard=N -d|id|name -- modify quota limits then you don't need to add "can't coexist ..." to later lines. (this is also true for every command you've modified) ... > @@ -282,13 +282,13 @@ limit_f( > flags |= DEFAULTS_FLAG; > break; > case 'g': > - type = XFS_GROUP_QUOTA; > + type |= XFS_GROUP_QUOTA; > break; > case 'p': > - type = XFS_PROJ_QUOTA; > + type |= XFS_PROJ_QUOTA; > break; > case 'u': > - type = XFS_USER_QUOTA; > + type |= XFS_USER_QUOTA; > break; > default: > return command_usage(&limit_cmd); > @@ -343,8 +343,13 @@ limit_f( > > name = (flags & DEFAULTS_FLAG) ? "0" : argv[optind++]; > > - if (!type) > + if (!type) { > type = XFS_USER_QUOTA; > + } else if (type != XFS_GROUP_QUOTA > + && type != XFS_PROJ_QUOTA > + && type != XFS_USER_QUOTA) { > + return command_usage(&limit_cmd); > + } Nitpick, this would be a little cleaner as: > - if (!type) > + if (!type) { > type = XFS_USER_QUOTA; > + } else if (type != XFS_GROUP_QUOTA && > + type != XFS_PROJ_QUOTA && > + type != XFS_USER_QUOTA) { > + return command_usage(&limit_cmd); > + } ... we often put the && or the || at the end like this. It just makes things line up nicely. ... > @@ -686,7 +706,7 @@ edit_init(void) > limit_cmd.argmin = 2; > limit_cmd.argmax = -1; > limit_cmd.args = \ > - _("[-gpu] bsoft|bhard|isoft|ihard|rtbsoft|rtbhard=N -d|id|name"); > + _("[-g|-p|-u] bsoft|bhard|isoft|ihard|rtbsoft|rtbhard=N -d|id|name"); yes, [-g|-p|-u] looks good. > limit_cmd.oneline = _("modify quota limits"); > limit_cmd.help = limit_help; > > @@ -694,14 +714,14 @@ edit_init(void) > restore_cmd.cfunc = restore_f; > restore_cmd.argmin = 0; > restore_cmd.argmax = -1; > - restore_cmd.args = _("[-gpu] [-f file]"); > + restore_cmd.args = _("[-g|-p|-u] [-f file]"); > restore_cmd.oneline = _("restore quota limits from a backup file"); > > timer_cmd.name = "timer"; > timer_cmd.cfunc = timer_f; > timer_cmd.argmin = 2; > timer_cmd.argmax = -1; > - timer_cmd.args = _("[-bir] [-gpu] value"); > + timer_cmd.args = _("[-bir] [-g|-p|-u] value"); > timer_cmd.oneline = _("set quota enforcement timeouts"); > timer_cmd.help = timer_help; > > @@ -709,7 +729,7 @@ edit_init(void) > warn_cmd.cfunc = warn_f; > warn_cmd.argmin = 2; > warn_cmd.argmax = -1; > - warn_cmd.args = _("[-bir] [-gpu] value -d|id|name"); > + warn_cmd.args = _("[-bir] [-g|-p|-u] value -d|id|name"); > warn_cmd.oneline = _("get/set enforcement warning counter"); > warn_cmd.help = warn_help; > > diff --git a/quota/quot.c b/quota/quot.c > index 9116e48..5588a25 100644 > --- a/quota/quot.c > +++ b/quota/quot.c > @@ -62,9 +62,9 @@ quot_help(void) > " total of all files greater than 500 kilobytes.\n" > " -v -- display three columns containing the number of kilobytes not\n" > " accessed in the last 30, 60, and 90 days.\n" > -" -g -- display group summary\n" > -" -p -- display project summary\n" > -" -u -- display user summary\n" > +" -g -- display group summary, can't coexist with -p, -u\n" > +" -p -- display project summary, can't coexist with -g, -u\n" > +" -u -- display user summary, can't coexist with -g, -p\n" again no need to re-state if you change the synopsis to make it clear; but please do change quot_cmd.args to show that they are exclusive: - quot_cmd.args = _("[-bir] [-gpu] [-acv] [-f file]"); + quot_cmd.args = _("[-bir] [-g|-p|-u] [-acv] [-f file]"); I think every command you changed might need to have the args fixed up like this, and then you do not have change the longer *_help text. Thanks, -Eric From agruenba@redhat.com Fri Feb 12 16:25:41 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=ham version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay3.corp.sgi.com [198.149.34.15]) by oss.sgi.com (Postfix) with ESMTP id 977227F55 for ; Fri, 12 Feb 2016 16:25:41 -0600 (CST) Received: from cuda.sgi.com (cuda1.sgi.com [192.48.157.11]) by relay3.corp.sgi.com (Postfix) with ESMTP id 3B341AC002 for ; Fri, 12 Feb 2016 14:25:38 -0800 (PST) X-ASG-Debug-ID: 1455315930-04bdf066eb90060001-NocioJ Received: from mail-vk0-f41.google.com (mail-vk0-f41.google.com [209.85.213.41]) by cuda.sgi.com with ESMTP id 4nrjHyxRTxrR1Xop (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128 verify=NO) for ; Fri, 12 Feb 2016 14:25:31 -0800 (PST) X-Barracuda-Envelope-From: agruenba@redhat.com X-Barracuda-Apparent-Source-IP: 209.85.213.41 Received: by mail-vk0-f41.google.com with SMTP id e6so71237661vkh.2 for ; Fri, 12 Feb 2016 14:25:31 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:date :message-id:subject:from:to:cc:content-type :content-transfer-encoding; bh=VQbBtEVCxGXu2LnrxaqKDp3MJXOhwYr8idsYZvOEI80=; b=BmHzpzCeM4YI6nXZB8K1KxpnwFbHOvoPicQRZ3gDBnXM+z2BQS3xtrHBNzZZPNYHIG SATVIyQpBWdXtfgvinkur2gdiNl9UB/RXBwjPDnXXNGSGk252ll7F7QRSXhifCM1Z0AJ itmNSkUeQwyBu6r2tyZcxy8D4hBgTWWoqOxZOKX5uNJFl7rvX0yZ/dU1uGqNHNHR+30c 4Ts4iht2qAqbQ7gdXeyUW5bWZD/Kr4HV9pBjI88dNOwomsbZtOW5UmFNGX+73CjmrUsu d4NgNrKaOlsFhceeAF5gbleL/w0XDZYA1Zgo3iSj/mzCbyfpufgQy92LKqIb8jwlCj10 FC4w== X-Gm-Message-State: AG10YORk0YyiRjuaKhsaimYXmDfkIiUvFPVwFQ+w6plJ6KVJUtgEYCgeWie+BTrEO9FjA5HNVxJFf53aVsV8v2SR MIME-Version: 1.0 X-Received: by 10.31.183.209 with SMTP id h200mr3472505vkf.141.1455315930503; Fri, 12 Feb 2016 14:25:30 -0800 (PST) Received: by 10.176.64.130 with HTTP; Fri, 12 Feb 2016 14:25:30 -0800 (PST) In-Reply-To: <56B77262.7090107@gmail.com> References: <56B770B6.7040803@gmail.com> <56B77262.7090107@gmail.com> Date: Fri, 12 Feb 2016 23:25:30 +0100 Message-ID: Subject: Re: richacl(7) man page review comments From: Andreas Gruenbacher X-ASG-Orig-Subj: Re: richacl(7) man page review comments To: "Michael Kerrisk (man-pages)" Cc: "J. Bruce Fields" , linux-ext4 , XFS Developers , lkml , linux-fsdevel , Linux NFS Mailing List , linux-cifs@vger.kernel.org, Linux API , Dave Chinner , Christoph Hellwig , Anna Schumaker , Trond Myklebust , Jeff Layton , Andreas Dilger Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-Barracuda-Connect: mail-vk0-f41.google.com[209.85.213.41] X-Barracuda-Start-Time: 1455315931 X-Barracuda-Encrypted: ECDHE-RSA-AES128-GCM-SHA256 X-Barracuda-URL: https://192.48.157.11:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-BRTS-Status: 1 X-Barracuda-Spam-Score: 0.00 X-Barracuda-Spam-Status: No, SCORE=0.00 using per-user scores of TAG_LEVEL=1000.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.7 tests=BSF_SC0_MISMATCH_TO X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.3.26985 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 0.00 BSF_SC0_MISMATCH_TO Envelope rcpt doesn't match header Hi Michael, On Sun, Feb 7, 2016 at 5:35 PM, Michael Kerrisk (man-pages) wrote: > Hi Andreas, > > I'll probably have quite a few more comments on this page as I get to > understand RichACLs better. Here's some comments from an initial > reading. thanks a lot for all the feedback to the man-pages. I've more or less made all the suggested changes but didn't get to adding examples yet (that's not so easy). The changes are here: https://github.com/andreas-gruenbacher/richacl > So, an initial comment. It seems to me to that this page (but > not setrichacl(1) and getrichacl(1)) should ultimately land in > man-pages (just like acl(7)), since we're talking about a kernel > feature. Make sense? We could sure move acl(5) and richacl(7) there. >> .\" >> .\" Richacl Manual Pages >> .\" >> .\" Copyright (C) 2015 Red Hat, Inc. >> .\" Written by Andreas Gruenbacher >> .\" This is free documentation; you can redistribute it and/or >> .\" modify it under the terms of the GNU General Public License as >> .\" published by the Free Software Foundation; either version 2 of >> .\" the License, or (at your option) any later version. >> .\" >> .\" The GNU General Public License's references to "object code" >> .\" and "executables" are to be interpreted as the output of any >> .\" document formatting or typesetting system, including >> .\" intermediate and printed output. >> .\" >> .\" This manual is distributed in the hope that it will be useful, >> .\" but WITHOUT ANY WARRANTY; without even the implied warranty of >> .\" MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the >> .\" GNU General Public License for more details. >> .\" >> .\" You should have received a copy of the GNU General Public >> .\" License along with this manual. If not, see >> .\" . >> .\" >> .de URL >> \\$2 \(laURL: \\$1 \(ra\\$3 >> .. >> .if \n[.g] .mso www.tmac >> .TH RICHACL 7 2015-09-01 "Linux" "Rich Access Control Lists" >> .SH NAME >> richacl \- Rich Access Control Lists >> .SH DESCRIPTION >> Rich Access Control Lists (richacls) are an extension of the POSIX file > > For what it's worth, I think it would be worthwhile to start with > a consistent abbreviation comment here (and use it throughout all of the > man pages): "RichACL" (or "richACL"), rather than "richacl"; that seems > more consistent with the traditional abbreviation "ACL". > >> permission model to support > > Make this: > > permission mode (see > .BR acl (7)) > to support > >> .URL https://tools.ietf.org/rfc/rfc5661.txt "NFSv4 Access Control Lists" >> on local and remote-mounted filesystems. >> >> Richacls support file masks which allow to apply a file mode to an exist= ing > > s/which allow to apply/which can be used to apply/ > >> NFSv4 ACL without destructive side effects: the file mode determines the= values >> of the file masks; the file masks restrict the permissions granted by th= e NFSv4 >> ACL. When a less restrictive file mode is applied later, the file masks= become >> less restrictive, and more of the original permissions can become effect= ive. >> >> A richacl can always be translated into an equivalent NFSv4 ACL which gr= ants >> the same permissions. >> >> Richacls can be enabled on supported filesystems. This disables POSIX Ac= cess >> Control Lists; the two ACL models will not coexist on the same filesyste= m. > > s/will not/can not/ ? > >> >> When used on a filesystem that does not support richacls, the getrichacl= and > > Use > .BR getrichacl (1) > for cross-references. > >> setrichacl utilities will operate on the file permission bits instead: >> getrichacl will display the file permission bits as a richacl; when a ri= chacl > > Use > .BR getrichacl (1) > for cross-references. > >> is set with setrichacl which can be represented exactly by the file perm= ission > > Use > .BR setrichacl (1) > for cross-references. > >> bits, setrichacl will set the file permission bits instead. > > Use > .BR setrichacl (1) > for cross-references. > > Here, I think it would be helpful to add a sentence: > > "An attempt to set a richacl that cannot be represented exactly by the > file permission bits results in an error." > > (If that sentence is correct, of course.) > >> >> .SH STRUCTURE OF RICHACLS > > For all of the "nonstandard" (see man-pages(7)) ".SH" sections here, I'd > be inclined to switch to using ".SS" subsections. There are downsides to > multiple nonstandard section headings (e.g., automated TOCs for > Section headings become clumsy and long), and I don't think your use of > .SH vs .SS really helps much to structure the information in this page. > >> >> Richacls consist of a number of ACL entries, three file masks, and some = flags. > > s/some flags./some flags specifying attributes of the ACL as whole (by > contrast with the per-ACL-entry flags described below)./ > >> Each of the ACL entries allows or denies some permissions to a particula= r user, >> group, or special entity. Each acl entry consists of: > > s/acl// > >> .IP \(bu 4 >> The user (with prefix > > s/The user/A tag which specifies the user/ > > (Is "tag" the right word? In any case, what would helpful to have here > is the generic term for this component of the ACL.) Tag should do; I'm not aware of a better term. >> .B user: >> or >> .BR u: ), >> group (with prefix >> .B group: >> or >> .BR g: ), >> or special identifier the entry applies to. Special >> identifiers can be the file owner >> .RB ( owner@ ), >> the owning group >> .RB ( group@ ), >> or everyone >> .RB ( everyone@ ). >> .IP \(bu >> A set of permissions the entry allows or denies. >> .IP \(bu >> A set of flags that indicate whether the user or group identifier is map= ped or >> unmapped, and whether the entry has been and can be inherited. >> .IP \(bu 4 >> A field indicating whether the entry allows or denies access. >> .PP >> The owner, group, and other file masks further control which permissions= the >> ACL grants, subject to the >> .B masked >> .RB ( m ) >> and >> .B write_through >> .RB ( w ) >> ACL flags. >> >> Note that entries with the identifier >> .B everyone@ >> apply to all processes, whereas the \(lqother\(rq file permissions and >> \(lqother\(rq entries in POSIX ACLs apply to all processes which are not= the >> owner, are not in the owning group, and do not match a user or group men= tioned >> in the acl. > > s/acl/ACL/ > >> Richacls do not have separate \(lqaccess\(rq ACLs that define the access >> permissions and \(lqdefault\(rq ACLs that define the inheritable permiss= ions as >> POSIX ACLs. > > I'd restructure the preceding sentence as: > > "Unlike POSIX ACLs, richacls do not.... that define the inheritable > permissions." > >> Instead, whether an ACL entry is effective during access checks >> and/or inheritable is determined by the ACL entry flags. >> >> .SS ACL Flags > > I'd use lower case in the above for all words except the first. > (That's the convention in man-pages.) > >> The following flags on ACLs are defined: >> >> .RS 4 >> .HP 4 > > s/4/8/ in the preceding two lines. I think more indentation would make > this (and the similar lists below) more readable. > >> .B masked >> .RB ( m ): > > I'd write each of these list entries starting here, and below, in the > form: > > .BR masked "\ (" m ): > > This form is a little easier to read in the source, and > it forces just a single space before the "(", which looks > a little better, I find. > >> When set, the file masks define upper limits on the permissions the ACL = may >> grant. >> .HP >> .B write_through >> .RB ( w ): >> When this flag and the masked flag are both set, the owner and other fil= e masks > > .B masked > >> define the actual permissions granted to the file owner and to others in= stead >> of an upper limit. >> .HP >> .B auto_inherit >> .RB ( a ): >> Automatic Inheritance is enabled for the file the ACL is >> attached to. See >> .IR "Automatic Inheritance" . >> .HP >> .B protected >> .RB ( p ): >> The ACL is protected from modification by Automatic >> Inheritance. >> .HP >> .B defaulted >> .RB ( d ): >> The ACL has been assigned by default. Automatic Inheritance should compl= etely >> replace the ACL. >> .RE >> >> .SS ACL Entry Flags >> >> The following flags on ACL entries are defined: >> >> .RS 4 >> .HP 4 > > s/4/8/ in the preceding two lines. > >> .B file_inherit >> .RB ( f ): >> The entry is inheritable for files. >> .HP >> .B dir_inherit >> .RB ( d ): >> The entry is inheritable for directories. >> .HP >> .B no_propagate >> .RB ( n ): >> Inheritance stops at the next subdirectory level. >> .HP >> .B inherit_only >> .RB ( i ): >> The entry defines inheritable permissions only and is ignored for access >> checking. >> .HP >> .B inherited >> .RB ( a ): >> The entry has been automatically inherited from the parent directory; th= e >> ACL's auto_inherit > > Use > .B auto_inherit > >> .RB ( a ) >> flag should be on. >> .HP >> .B unmapped >> .RB ( u ): >> The user or group identifier is a textual string and has no mapping to a >> numeric user or group identifier. > > So here, I think there should be a sentence that explains how a meaning > is attached to the strings? Is this for NFS, for Windows, for something > else? On NFS clients only. I've tried to clarify that. >> .RE >> >> .SS Permissions >> >> The following permissions are defined for richacl entries and for the th= ree >> file masks: >> >> .RS 4 >> .HP 4 > > s/4/8/ in the preceding two lines. > >> .B read_data >> / >> .B list_directory >> .RB ( r ): > > Replace the preceding four lines by > > .BR read_data / list_directory "\ (" r ) > > and do similar for the next two list entried below. > Note that "\ (" will force just a singlke space before the "(". > >> Read the data of a file. >> List the contents of a directory. > > In the above list entry, and the next two, I find the layout ("xxx/yyy (z= )") > confusing. A closer reading indicates that in each case, the "xxx" > applies for files and he "yyy" is for directories. But I think the text > could make this point a little easier to grasp. In each of these three > list entries this could be done something lke the following: > > "For a file: read the data of the file. For a directory: list the > contents of the directory." > > By the way, can the terms "read_data" and "list_directory" be used > interchangeably? That is, can you employ (say) "read_data" when setting > an ACL entry for a directory? (I'm assuming the answer is "yes".) > If the terms are just interchangeable synonyms, perhas it's worth > making that point explicitly in the text. richacl_from_text() doesn't distinguish between file and directory flags, but richacl_to_text() will use the appropriate version in long-format strings depending on the context (file type). ACLs that have this wrong would be very confusing to read. >> .HP >> .B write_data >> / >> .B add_file >> .RB ( w ): >> Modify the data of a file. Add a new file in a directory. > > See above comment re file/directory. > >> .HP >> .B append_data >> / >> .B add_subdirectory >> .RB ( p ): >> Open a file in append mode. Create a subdirectory in a directory. > > So, in other words, if append mode is denied, then the file can be > opened for writing (contingent on write permission being granted), but > can't be opened with O_APPEND? Is that correct? This point needs to be > made clearer. Yes, that's correct. >> .HP >> .B execute >> .RB ( x ): >> Execute a file. Traverse / search a directory. > > See above comment re file/directory. > >> .HP >> .B delete_child >> .RB ( d ): >> Delete a file or directory within a directory. >> .HP >> .B delete >> .RB ( D ): >> Delete the file or directory. >> .HP >> .B read_attributes >> .RB ( a ): >> Read basic attributes of a file or directory. > > What are "attributes" in this context? Does this mean stat(2)? Make this > explicit. Yes. >> This permission is always implicitly granted. >> .HP >> .B write_attributes >> .RB ( A ): >> Change the times associated with a file or directory to an arbitrary val= ue. >> This permission is always implicitly granted to the file owner. >> .HP >> .B read_acl >> .RB ( c ): >> Read the ACL of a file or directory. This permission is always >> implicitly granted. >> .HP >> .B write_acl >> .RB ( C ): >> Change the ACL or file mode of a file or directory. >> .HP >> .B write_owner >> .RB ( o ): >> Take ownership of a file or directory. Change the owning group of a fil= e or >> directory to a group of which the calling process is a member. >> .HP >> .B read_named_attrs >> .RB ( R ), >> .B write_named_attrs >> .RB ( W ), >> .B synchronize >> .RB ( S ), >> .B write_retention >> .RB ( e ), >> .B write_retention_hold >> .RB ( E ): >> These permissions can be stored, but do not have a local meaning. > > So, I thenk that a sentence here should explain why these permissions > exist. Is if for future extension, because they are meaningful in NFS, > or something else? Yes, they are defined by NFS. >> .RE >> >> .SH TEXT FORM >> >> The common textual representation of richacl consists of the colon separ= ated > > s/richacl/richacls/ (or, "RichACLs"/"richACLs") > > s/colon separated/colon-separated/ > >> fields of the the acl flags, file masks, and acl entries in the followin= g > > s/acl/ACL/ (*2) > >> format: >> .TP >> \fBflags:\fR\fIacl_flags\fR >> The ACL flags. >> .TP >> \fBowner:\fR\fIperm\fR\fB::mask\fR, \fBgroup:\fR\fIperm\fR\fB::mask\fR, = \fBother:\fR\fIperm\fR\fB::mask\fR >> The file masks and their permissions. >> .TP >> \fIwho\fR\fB:\fR\fIperm\fR\fB:\fR\fIflags\fR\fB:allow\fR, \fIwho\fR\fB:\= fR\fIperm\fR\fB:\fR\fIflags\fR\fB:deny\fR >> For each ACL entry, who the entry applies to, the permissions of the ent= ry, the >> entry flags, and whether the entry allows or denies permissions. The wh= o field has > > s/who/\\fIwho\\fP/ > >> no prefix for special identifiers, a >> .B user: >> or >> .B u: >> prefix for regular users, and a >> .B group: >> or >> .B g: >> prefix for regular groups. >> .PP >> The entries are comma, whitespace or newline separated. > > s/whitespace/whitespace,/ > >> >> Flags and permissions have single-letter as well as long forms as listed= under > > s/forms/forms,/ > >> .IR "ACL Flags" , >> .IR "ACL Entry Flags" , >> and >> .IR Permissions . > > If you follow my suggestion about capitalization in the ".SS" entries, > you'll need to change the capitalization in the above phrases. > >> When the single-letter forms are used, the flags or permissions are >> concatenated. When the long forms are used, the flags or permissions are >> separated by slashes. To align permissions or flags vertically, dashes = can be >> use for padding. > > s/use/used/ > >> >> .SH SETTING AND MODIFYING FILE PERMISSIONS >> The access permissions for a file can either be set by assigning an acce= ss >> control list (setrichacl) or by changing the file mode permission bits (= chmod). > > Use > .RB ( setrichacl (1)) > for cross-reference. > > Use > .RB ( chmod (1)). > >> In addition, a file can inherit an ACL from its parent >> directory at create time; the inherited ACL is then further > > s/create/creation/ > >> restricted by the creating system call's mode parameter (see the creat(2= ) >> manual page). > > creat(2) is pretty much history. I suggest writing > > (as given to > .BR open (2), > .BR mkdir (2), > and similar). > > And here, I think we need a statement about whether the process umask > has an effect or not... > >> >> .SS Assigning An Access Control List >> When assigning an ACL to a file, unless explicitly specified, the owner,= group, >> and other file masks will be computed from the ACL entries as described = in >> section >> .IR "COMPUTING THE MAXIMUM FILE MASKS" . >> The owner, group, and other file mode permission bits are then each set = from >> the owner, group, and other file mask as follows: >> .IP \(bu 4 >> If the file mask includes the >> .B r >> permission, the read >> file mode permission bit will be set. >> .IP \(bu >> If the file mask includes the >> .B w >> or >> .B p >> permission, the write file mode permission bit will be set. >> .IP \(bu >> If the file mask includes the >> .B x >> permission, the execute file mode permission bit will be set. >> .PP >> If the ACL can be represented exactly by the file mode >> permission bits, the file permission bits are set to match the access co= ntrol >> list and the ACL is not stored. (When the reverse happens and > > s/and/and the/ > >> ACL of a file is requested which doesn't have an explicit >> ACL, the file mode permission bits are converted into an >> equivalent richacl.) >> >> .SS Changing The File Mode Permission Bits > > I'd use lower case in the above for all words except the first > >> When changing the file mode permission bits with chmod(2), the owner, gr= oup, > > .BR chmod (2) > >> and other file permission bits are set to the permission bits in the new= mode, >> and the file masks each are set based on the new mode bits as follows: >> .IP \(bu 4 >> If the read bit in a set of permissions is set, the >> .B r >> permission in the corresponding file mask will be set. >> .IP \(bu >> If the write bit in a set of permissions is set, the >> .B w >> and >> .B p >> permissions in the corresponding file mask will be set. >> .IP \(bu >> If the execute bit in a set of permissions is set, the >> .B x >> permission in the corresponding file mask will be set. >> .PP >> In addition, the >> .B masked >> and >> .B write_through >> ACL flags are set. This has the >> effect of limiting the permissions granted by the ACL to the file mode >> permission bits; in addition, the owner is granted the owner mode bits a= nd >> others are granted the other mode bits. If the >> .B auto_inherit >> flag is set, the >> .B protected >> flag is also set to prevent the Automatic Inheritance algorithm from mod= ifying >> the ACL. >> >> .SS Permissions At File Create Time > > s/File Create/file-creation/ > > I'd use lower case in the above for all words except the first > >> When a directory has inheritable ACL entries, the following >> happens when a file or directory is created inside that directory: >> .RS 4 >> .IP 1. 4 >> A file created inside that directory will inherit all entries with the > > s/all entries with/all of the directories entries that/ It's ACL entries, not directory entries, here. >> .B file_inherit >> flag set, and all inheritance-related flags in the inherited entries wil= l be >> cleared. >> >> A subdirectory will inherit all entries with the >> .B file_inherit >> or >> .B dir_inherit >> flag set. Entries whose >> .B no_propagate >> flag is set will have all inheritance-related flags cleared. Entries wh= ose >> .B no_propagate >> and >> .B dir_inherit >> flags are not set and whose >> .B file_inherit >> is set will have their >> .B inherit_only >> flag set. >> .IP 2. >> If the parent directory's ACL has the >> .B auto_inherit >> flag set, the inherited ACL will have its >> .B auto_inherit >> flag set, and all entries will have their >> .B inherited >> flag set. >> .IP 3. >> The three file masks are computed from the inherited ACL as described in >> section >> .IR "COMPUTING THE MAXIMUM FILE MASKS" . >> .IP 4. >> The three sets of permissions for the owner, the group, and for others i= n >> the mode parameter of the creating system call are converted into sets o= f >> richacl permissions as described in section > > s/in/in the/ > >> .IR "Changing The File Mode Permission Bits" . >> Any richacl permissions not included in those sets are >> removed from the owner, group, and other file masks. The file mode permi= ssion >> bits are then computed from the file masks as described in section > > s/in/in the/ > >> .IR "Assigning An Access Control List" . >> .IP 5. >> The >> .B masked >> ACL flag is set. The >> .B write_through >> ACL flag remains cleared. In addition, if the >> .B auto_inherit >> flag of the inherited ACL is set, the >> .B protected >> flag is also set to prevent the Automatic Inheritance algorithm from mod= ifying >> the ACL. >> .RE >> .PP >> When a directory does not have inheritable ACL entries, files >> and directories created inside that directory will not be assigned acces= s >> control lists and the file mode permission bits will be set to (mode\ &\ >> ~umask). > > will be set to > > (mode & ~umask) > > where > .I mode > is the permission mode argument of the relevant system call and > .I umask > is the process umask (see > .BR umask (2)). > >> >> .SS Automatic Inheritance > > I'd use lower case in the above for all words except the first "Automatic Inheritance" is a technical term though. >> Automatic Inheritance allows permission changes to propagate from a dire= ctory >> to files and subdirectories inside that directory, recursively. Carryin= g out >> this propagation of permissions is the responsibility of the process cha= nging >> the directory permissions (usually, setrichacl(1)). > > I'm confused by the previous sentence. the feature is labeled "Automatic > Inheritance", implying that the user/process need do nothing. The next > sentence says "propagation ... is the responsibility of the process". > These two points seem contradictory. I think something more needs to be > said here. Let's try this maybe: Automatic Inheritance is a mechanism that allows permission changes to propagate from a directory to files and subdirectories inside that director= y, recursively. Propagation is carried out by the process changing the direct= ory permissions (usually, .BR setrichacl (1)); it happens without user intervention albeit not entirely automatically. >> A significant limitation is that this mechanism works only as long as fi= les >> are created without explicitly specifying the file permissions to use. T= he >> standard system calls for creating files an directories (creat(2), open(= 2), >> mkdir(2), mkfifo(2), mknod(2)) all have mandatory mode parameters which = define > > Format that system call list as > .RB ( creat (2), > .BR open (2), > .BR mkdir (2), > .BR mknod (2)) > > Note that I removed mkfifo(): it's a library functionlayered on > mkonod(2). > >> the maximum allowed permissions of the new files. To take account of thi= s >> restriction, the >> .B protected >> ACL flag must be set if the >> .B inherited >> flag is set. This effectively disables Automatic Inheritance for that >> particular file. >> >> Automatic Inheritance still remains useful for network protocols like NF= Sv4 and >> SMB, which both support creating files and directories without defining = which >> permissions: they can implement those operations by using the standard s= ystem >> calls and by then undoing the effect of applying the mode parameters. >> >> When the ACL of a directory is changed, the following should > > Why "should"? > >> happen for each entry inside that directory (for each \(lqchild\(rq): > > Make the preceding line: > > happen for each entry (\(lqchild\(rq) inside that directory: > >> .IP 1. 4 >> If the entry is a symblic link, skip the child. >> .IP 2. >> If the >> .B auto_inherit >> flag of the entry's ACL is not set or the >> .B protected >> flag is set, skip the child. >> .IP 3. >> With the child's ACL: >> .RS 4 >> .IP 1. 4 > > s/1./a)/ > > (i.e., use a different labeling scheme for the sublist) > >> If the >> .B defaulted >> flag is set, replace the ACL with an empty ACL >> with the >> .B auto_inherit >> flag set. >> .IP 2. > > s/2./b)/ > >> Delete all entries which have the >> .B inherited >> flag set. >> .IP 3. > > s/3./c)/ > >> Append all entries inherited from the parent directory according to step= 1 of >> the algorithm described under >> .IR "Permissions At File Create Time". >> Set the >> .B inherited >> flag of each of these entries. >> .IP 4. > > s/4./d)/ > >> Recompute the file masks. >> .RE >> .IP 4. >> If the child is a directory, recursively apply this algorithm. >> >> .SH ACCESS CHECK ALGORITHM >> >> When a process requests a particular kind of access to a file defined by= a set > > s/defined/protected/ (?) > >> of richacl permissions, the following algorithm determines if the access= is > > s/if/whether/ > >> granted or denied: >> >> .IP 1. 4 >> If the >> .B masked >> ACL flag is set, then: >> .RS 4 >> .IP 1. 4 > > s/1./a)/ > > Use a different numbering scheme for sublists. > >> if the > > s/if/If/ > >> .B write_through >> ACL flag is set, then: >> .RS 4 >> .IP \(bu 4 >> if the requesting process is the file owner, then access is granted if t= he > > s/if/If/ > >> owner mask includes the requested permissions, and is otherwise denied. >> .IP \(bu >> if the requesting process is not the file owner, is not in the owning gr= oup, > > s/if/If/ > >> and no ACL entries other than >> .B everyone@ >> match the process, then access is granted if the other mask includes the >> requested permissions, and is otherwise denied. >> .RE >> .IP 2. > > s/2./b)/ > >> if any of the following is true: > > s/if/If/ > >> .RS 4 >> .IP \(bu 4 >> the requesting process is the file owner and the owner mask does no incl= ude all > > s/no /not / > >> requested permissions, >> .IP \(bu 4 >> the requesting process is not the file owner and it is in the owning gro= up or >> matches any ACL entries other than >> .BR everyone@ , >> and the group mask does no include all requested permissions, >> .IP \(bu 4 >> the requesting process is not the file owner, not in the owning group, i= t >> matches no ACL entries other than >> .BR everyone@ , >> and the other mask does no include all requested permissions, >> .PP >> then access is denied. >> .RE >> .RE >> .IP 2. >> Set the remaining permissions to the requested permissions. Go through = all ACL >> entries. For each entry: >> .RS 4 >> .IP 1. 4 > > s/1./a)/ > > Use a different numbering scheme for sublists. > >> if the >> .B inherit_only >> or >> .B unmapped >> flags are set, continue with the next ACL entry. >> .IP 2. > > s/2./b)/ > >> if any of the following is true: >> .RS 4 >> .IP \(bu 4 >> the entry's identifier is >> .B owner@ >> and the requesting process is the file owner, >> .IP \(bu >> the entry's identifier is >> .B group@ >> and the requesting process is in the owning group, >> .IP \(bu >> the entry's identifier is a user and the requesting process is owned by = that >> user, >> .IP \(bu >> the entry's identifier is a group and the requesting process is a member= in >> that group, >> .IP \(bu >> the entry's identifier is >> .BR everyone@ , >> .PP >> the entry matches the process; proceed. Otherwise, continue with the nex= t ACL > > s/proceed/proceed to the next step/ (?) > >> entry. >> .RE >> .IP 3. > > s/3./c)/ > >> If the entry denies any of the remaining permissions, access is denied. >> .IP 4. > > s/4./d)/ > >> If the entry allows any of the remaining permissions, then: >> .RS 4 >> .IP \(bu 4 >> if the >> .B masked >> ACL flag is set and the entry's identifier is not >> .B owner@ >> or >> .BR everyone@ >> or is a user entry matching the file owner, remove all permissions from = the >> remaining permissions which are both allowed by the entry and included i= n the >> group mask, >> .IP \(bu >> otherwise, remove all permissions from the remaining permissions wich ar= e >> allowed by the entry. >> .RE >> .RE >> .IP 3. >> If there are no more remaining permissions, access is allowed. Otherwise= , >> access is denied. >> >> .SH COMPUTING THE MAXIMUM FILE MASKS >> When setting an ACL and no file masks have been explicitly specified and= when >> inheriting an ACL from the parent directory, the following algorithm is = used >> for computing the file masks: >> >> .IP 1. 4 >> Clear the owner, group, and other file masks. Remember which permissions= have >> already been processed (initially, the empty set). >> .IP 2. >> For each ACL entry: >> .RS 4 >> .IP \(bu 4 >> If the >> .B inherit_only >> flag is set, skip the entry. >> .IP \(bu 4 >> Otherwise, compute which permissions the entry allows or denies that hav= e not >> been processed yet (the remaining permissions). >> .IP \(bu >> If the entry is an >> .B owner@ >> entry, add the remaining permissions to the owner mask for >> .B allow >> entries, and remove the remaining permissions from the owner mask for >> .B deny >> entries. >> .IP \(bu >> Otherwise, if the entry is an >> .B everyone@ >> entry, proceed as with >> .B owner@ >> entries but add or remove the remaining permissions from the owner, grou= p, and >> other file masks. >> .IP \(bu >> Otherwise, proceed as with >> .B owner@ >> entries but add or remove the remaining permissions from the owner and g= roup >> file masks. >> .IP \(bu >> Add the entry's permissions to the processed permissions. >> .RE >> .PP >> The resulting file masks represent the ACL as closely as possible. With = these >> file masks, if the >> .B masked >> ACL flag is set, the effective permissions still stay the same. > > This page is in *desperate* need of *multiple* examples, starting simple, > and building up in complexity, with walkthogh text explaining how the > permisssions are interpreted and how the masks are generated. > Having read the page multiple times (and having little knowledge > of NFS ACLs), I'm still struggling to put all the pieces together. You are probably right. I'm not sure if they should go on the same man-page= . > Probably some examples that relate to an NFS context would also be > helpful. Hmm, I'm not sure about the difference between NFS examples and non-NFS examples I suppose. >> .\" .SH BUGS >> .SH AUTHOR >> Written by Andreas Gr=C3=BCnbacher . >> >> Please send your bug reports, suggested features and comments to the abo= ve address. >> >> .SH CONFORMING TO >> Rich Access Control Lists are Linux-specific. >> .SH SEE ALSO >> .BR chmod (1), >> .BR getrichacl (1), >> .BR ls (1), >> .BR setrichacl (1) >> .BR stat (2), >> .BR umask (2), >> .BR acl (7) >> .\" librichacl Thanks a lot, Andreas From david@fromorbit.com Fri Feb 12 16:49:39 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=ham version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay3.corp.sgi.com [198.149.34.15]) by oss.sgi.com (Postfix) with ESMTP id 83CCD7F3F for ; Fri, 12 Feb 2016 16:49:39 -0600 (CST) Received: from cuda.sgi.com (cuda3.sgi.com [192.48.176.15]) by relay3.corp.sgi.com (Postfix) with ESMTP id 184ADAC002 for ; Fri, 12 Feb 2016 14:49:39 -0800 (PST) X-ASG-Debug-ID: 1455317375-04cb6c1e579d1e0001-NocioJ Received: from ipmail06.adl2.internode.on.net (ipmail06.adl2.internode.on.net [150.101.137.129]) by cuda.sgi.com with ESMTP id RL3xFZbz5eyc0bpB for ; Fri, 12 Feb 2016 14:49:36 -0800 (PST) X-Barracuda-Envelope-From: david@fromorbit.com X-Barracuda-Apparent-Source-IP: 150.101.137.129 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: A2CmBwD5YL5WPBATLHleDhoBAoMPgT+GYoF5nW8Gi2yFRoQIhgcCAgEBAoE4TQEBAQEBAQcBAQEBQT+EQgEBBDocIxAIAxgJJQ8FJQMHGhOIGcFmAQEIAgEdGIUxhH6EAhEBhFgFlneNTI5/jj6EC08oLoZ6gTABAQE Received: from ppp121-44-19-16.lns20.syd4.internode.on.net (HELO dastard) ([121.44.19.16]) by ipmail06.adl2.internode.on.net with ESMTP; 13 Feb 2016 09:19:33 +1030 Received: from dave by dastard with local (Exim 4.80) (envelope-from ) id 1aUMWq-00043C-W3; Sat, 13 Feb 2016 09:49:33 +1100 Date: Sat, 13 Feb 2016 09:49:32 +1100 From: Dave Chinner To: Theodore Ts'o Cc: "Darrick J. Wong" , linux-btrfs@vger.kernel.org, fstests@vger.kernel.org, xfs@oss.sgi.com Subject: Re: [PATCH 12/32] dio: unwritten conversion bug tests Message-ID: <20160212224932.GZ14668@dastard> X-ASG-Orig-Subj: Re: [PATCH 12/32] dio: unwritten conversion bug tests References: <20160211233916.2202.40961.stgit@birch.djwong.org> <20160211234037.2202.93885.stgit@birch.djwong.org> <20160212035253.GX14668@dastard> <20160212152231.GA7928@thunk.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20160212152231.GA7928@thunk.org> User-Agent: Mutt/1.5.21 (2010-09-15) X-Barracuda-Connect: ipmail06.adl2.internode.on.net[150.101.137.129] X-Barracuda-Start-Time: 1455317376 X-Barracuda-URL: https://192.48.176.15:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-BRTS-Status: 1 X-Barracuda-Spam-Score: 0.00 X-Barracuda-Spam-Status: No, SCORE=0.00 using per-user scores of TAG_LEVEL=1000.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.7 tests=BSF_SC0_MISMATCH_TO X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.3.26986 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 0.00 BSF_SC0_MISMATCH_TO Envelope rcpt doesn't match header On Fri, Feb 12, 2016 at 10:22:31AM -0500, Theodore Ts'o wrote: > On Fri, Feb 12, 2016 at 02:52:53PM +1100, Dave Chinner wrote: > > On Thu, Feb 11, 2016 at 03:40:37PM -0800, Darrick J. Wong wrote: > > > Check that we don't expose old disk contents when a directio write to > > > an unwritten extent fails due to IO errors. This primarily affects > > > XFS and ext4. > > > > > > Signed-off-by: Darrick J. Wong > > > > aiocp.c: In function 'main': > > aiocp.c:407:1: warning: format '%d' expects argument of type 'int', but argument 3 has type 'off_t' [-Wformat=] > > printf("tocopy=%d len=%d blk=%d\n", tocopy, length, aio_blksize); > > ^ > > > > Followup patch is fine, I'll commit as is. > > Dave, given that Darrick's patches is going to cause more > _scratch_mount occurences, how quickly do you plan to commit his > patchset? Should I wait until he makes his change before I do the > s/_scratch_mount/_scratch_cycle_mount/ change? Should I make that > change, and let you fix it up the commit? I had to head out suddenly yestrday afternoon, just after I sent above email. Only just got back in front of the computer, so I'll be pushing it out once the new pull has run through a sanity check. If you can respin the patch once I've done that, it would be greatly appreciated. Cheers, Dave. -- Dave Chinner david@fromorbit.com From tdm@sgi.com Fri Feb 12 17:04:14 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=RP_MATCHES_RCVD autolearn=ham version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay3.corp.sgi.com [198.149.34.15]) by oss.sgi.com (Postfix) with ESMTP id 6DB387F5F for ; Fri, 12 Feb 2016 17:04:14 -0600 (CST) Received: from estes.americas.sgi.com (estes.americas.sgi.com [128.162.236.10]) by relay3.corp.sgi.com (Postfix) with ESMTP id AB8ECAC002; Fri, 12 Feb 2016 15:04:10 -0800 (PST) Received: from [128.162.232.11] (porter.americas.sgi.com [128.162.232.11]) by estes.americas.sgi.com (Postfix) with ESMTP id 41F6670006F2; Fri, 12 Feb 2016 17:04:10 -0600 (CST) Message-ID: <56BE64EA.80906@sgi.com> Date: Fri, 12 Feb 2016 17:04:10 -0600 From: Troy McCorkell User-Agent: Mozilla/5.0 (X11; U; Linux i686 (x86_64); en-US; rv:1.9.1.5) Gecko/20091204 Thunderbird/3.0 MIME-Version: 1.0 To: "xfs@oss.sgi.com" , Dave Chinner , Eric Sandeen , Russell Cattelan Subject: oss.sgi.com - maintenance Wed Feb 17 09:00 CT USA Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit oss.sgi.com will be down for approximately 30 minutes starting at Wed Feb 17 09:00 CT USA for maintenance. From david@fromorbit.com Fri Feb 12 19:27:07 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=ham version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay1.corp.sgi.com [137.38.102.111]) by oss.sgi.com (Postfix) with ESMTP id 18BE57CA2 for ; Fri, 12 Feb 2016 19:27:07 -0600 (CST) Received: from cuda.sgi.com (cuda1.sgi.com [192.48.157.11]) by relay1.corp.sgi.com (Postfix) with ESMTP id D96608F8039 for ; Fri, 12 Feb 2016 17:27:03 -0800 (PST) X-ASG-Debug-ID: 1455326820-04bdf066eb93c70001-NocioJ Received: from ipmail06.adl2.internode.on.net (ipmail06.adl2.internode.on.net [150.101.137.129]) by cuda.sgi.com with ESMTP id BdsNvFUUzlK74LgS for ; Fri, 12 Feb 2016 17:27:01 -0800 (PST) X-Barracuda-Envelope-From: david@fromorbit.com X-Barracuda-Apparent-Source-IP: 150.101.137.129 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: A2BDCQBohb5WPBATLHleKAECgw+BP4Jog3qBeZ1pAQEBAQEBBotqhUWECIYHBAICgTZNAQEBAQEBBwEBAQFBP4RCAQEEOhwjEAgDGAklDwUlAwcaE4gZwSkBAQEBAQUBAQEBHBiFMYR+hBeDRoEPBZZ3jUqOfY4+gxKBSCguhnKBOAEBAQ Received: from ppp121-44-19-16.lns20.syd4.internode.on.net (HELO dastard) ([121.44.19.16]) by ipmail06.adl2.internode.on.net with ESMTP; 13 Feb 2016 11:56:59 +1030 Received: from dave by dastard with local (Exim 4.80) (envelope-from ) id 1aUOzD-0004Hp-5C; Sat, 13 Feb 2016 12:26:59 +1100 Date: Sat, 13 Feb 2016 12:26:59 +1100 From: Dave Chinner To: "Darrick J. Wong" Cc: linux-btrfs@vger.kernel.org, fstests@vger.kernel.org, xfs@oss.sgi.com Subject: Re: [PATCH v4.2 00/32] xfstests: test the nfs/cifs/btrfs/xfs reflink/dedupe ioctls Message-ID: <20160213012659.GA14668@dastard> X-ASG-Orig-Subj: Re: [PATCH v4.2 00/32] xfstests: test the nfs/cifs/btrfs/xfs reflink/dedupe ioctls References: <20160211233916.2202.40961.stgit@birch.djwong.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20160211233916.2202.40961.stgit@birch.djwong.org> User-Agent: Mutt/1.5.21 (2010-09-15) X-Barracuda-Connect: ipmail06.adl2.internode.on.net[150.101.137.129] X-Barracuda-Start-Time: 1455326820 X-Barracuda-URL: https://192.48.157.11:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-BRTS-Status: 1 X-Barracuda-Spam-Score: 0.00 X-Barracuda-Spam-Status: No, SCORE=0.00 using per-user scores of TAG_LEVEL=1000.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.7 tests=BSF_SC0_MISMATCH_TO X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.3.26989 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 0.00 BSF_SC0_MISMATCH_TO Envelope rcpt doesn't match header On Thu, Feb 11, 2016 at 03:39:16PM -0800, Darrick J. Wong wrote: > Dave Chinner: I've renumbered the new tests and pushed to github[3] if > you'd like to pull. See the pull request at the end of this message. > > This is a patch set against the reflink/dedupe test cases in xfstests. > The first three patches fix errors in the existing reflink tests, some > of which are from Christoph Hellwig. > > The next eight patches fix style errors, refactor commonly used code, > remove unnecessary clutter, and add missing _require* checks to the > existing reflink tests. > > Patch 12 adds a test checking that unwritten extent conversion does > NOT happen after a directio write to an unwritten extent hits a disk > error. Due to a bug in the VFS directio code, ext4 can disclose > stale disk contents if an aio dio write fails; XFS suffers this > problem for any failing dio write to an unwritten extent. Christoph's > kernel patchset titled "vfs/xfs: directio updates to ease COW handling > V2" (and a separate ext4 warning cleanup) is needed to fix this. > > Patches 13-31 add more reflink tests focusing on correct CoW behavior > particularly with the CoW extent size hint enabled. It also provides > a few regression tests for bugs that have been hit while running XFS > reflink, a few tests of the quota accounting when various reflink > operations happen, and a few tests for get_bmapx to ensure that what > it reports is at least somewhat accurate. > > Patch 25 adds a few basic reverse-mapping tests for XFS. > > If you're going to start using this mess, you probably ought to just > pull from my github trees for kernel[1], xfsprogs[2], xfstests[3], > xfs-docs[4], and man-pages[5]. All tests should pass on XFS, YMWV on > btrfs and ocfs2. > > Comments and questions are, as always, welcome. I haven't worked out which patch causes this, but: xfs/246 - output mismatch (see /home/dave/src/xfstests-dev/results//xfs_1k/xfs/246.out.bad) --- tests/xfs/246.out 2016-02-13 09:46:01.419169115 +1100 +++ /home/dave/src/xfstests-dev/results//xfs_1k/xfs/246.out.bad 2016-02-13 11:36:05.205851863 +1100 @@ -3,4 +3,5 @@ Create the original files Dump extents after sync Hole CoW extents: -SCRATCH_MNT/test-246/file1: no extents +bmap: invalid option -- 'c' +bmap [-adlpv] [-n nx] -- print block mapping for an XFS file ... (Run 'diff -u tests/xfs/246.out /home/dave/src/xfstests-dev/results//xfs_1k/xfs/246.out.bad' to see the entire diff) This test neds a check that the "-c" option in the bmap command exists. Not sure if you can use '_requires_xfs_io_command "bmap -c"' here or whether this requires more help... Followup patch, anyway, because I'm about to push out everything that was in your second pull req (i.e. with the aiocp fix). Cheers, Dave. -- Dave Chinner david@fromorbit.com From sandeen@sandeen.net Fri Feb 12 20:22:26 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=ham version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay1.corp.sgi.com [137.38.102.111]) by oss.sgi.com (Postfix) with ESMTP id D733F7CA2 for ; Fri, 12 Feb 2016 20:22:26 -0600 (CST) Received: from cuda.sgi.com (cuda3.sgi.com [192.48.176.15]) by relay1.corp.sgi.com (Postfix) with ESMTP id C9F268F8039 for ; Fri, 12 Feb 2016 18:22:23 -0800 (PST) X-ASG-Debug-ID: 1455330141-04cb6c1e56a0810001-NocioJ Received: from sandeen.net (sandeen.net [63.231.237.45]) by cuda.sgi.com with ESMTP id z5pgC89cjBfSvAa1 for ; Fri, 12 Feb 2016 18:22:21 -0800 (PST) X-Barracuda-Envelope-From: sandeen@sandeen.net X-Barracuda-Apparent-Source-IP: 63.231.237.45 Received: from Liberator.local (24-158-28-51.static.dlth.mn.charter.com [24.158.28.51]) (using TLSv1.2 with cipher DHE-RSA-AES128-SHA (128/128 bits)) (No client certificate requested) by sandeen.net (Postfix) with ESMTPSA id F21D463C5FF0 for ; Fri, 12 Feb 2016 20:22:20 -0600 (CST) Subject: Re: [PATCH v4 1/2] libxcmd: generalize topology functions To: xfs@oss.sgi.com X-ASG-Orig-Subj: Re: [PATCH v4 1/2] libxcmd: generalize topology functions References: <1455303811-9874-1-git-send-email-billodo@redhat.com> <1455303811-9874-2-git-send-email-billodo@redhat.com> <20160212193942.GA4770@infradead.org> <20160212194749.GA10069@redhat.com> From: Eric Sandeen Message-ID: <56BE935B.8030501@sandeen.net> Date: Fri, 12 Feb 2016 20:22:19 -0600 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.11; rv:38.0) Gecko/20100101 Thunderbird/38.5.1 MIME-Version: 1.0 In-Reply-To: <20160212194749.GA10069@redhat.com> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit X-Barracuda-Connect: sandeen.net[63.231.237.45] X-Barracuda-Start-Time: 1455330141 X-Barracuda-URL: https://192.48.176.15:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-BRTS-Status: 1 X-Barracuda-Spam-Score: 0.00 X-Barracuda-Spam-Status: No, SCORE=0.00 using per-user scores of TAG_LEVEL=1000.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.7 tests= X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.3.26990 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- On 2/12/16 1:47 PM, Bill O'Donnell wrote: > On Fri, Feb 12, 2016 at 11:39:42AM -0800, Christoph Hellwig wrote: >> On Fri, Feb 12, 2016 at 01:03:30PM -0600, Bill O'Donnell wrote: >>> Move general topology functions from xfs_mkfs to new topology >>> collection in libxcmd. >> >> Why libxcmd and not libxfs? > > We discussed that a bit. Since libxfs has the kernel support code, and > not generally the xfsprogs library, I put it in libxcmd. Yep, Dave asked for libxcmd, to keep stuff that's not shared with the kernel away from libxfs. -Eric From david@fromorbit.com Fri Feb 12 20:33:19 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=ham version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay3.corp.sgi.com [198.149.34.15]) by oss.sgi.com (Postfix) with ESMTP id DE5C17CA2 for ; Fri, 12 Feb 2016 20:33:18 -0600 (CST) Received: from cuda.sgi.com (cuda3.sgi.com [192.48.176.15]) by relay3.corp.sgi.com (Postfix) with ESMTP id 6E194AC002 for ; Fri, 12 Feb 2016 18:33:18 -0800 (PST) X-ASG-Debug-ID: 1455330791-04cb6c1e58a0a90001-NocioJ Received: from ipmail06.adl2.internode.on.net (ipmail06.adl2.internode.on.net [150.101.137.129]) by cuda.sgi.com with ESMTP id bDCuJJkyXw1kIOC4 for ; Fri, 12 Feb 2016 18:33:12 -0800 (PST) X-Barracuda-Envelope-From: david@fromorbit.com X-Barracuda-Apparent-Source-IP: 150.101.137.129 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: A2AoCQColL5WPBATLHleKAECgw9SbYJohXOdaQEBAQEBAQaLaolNIYVmBAICgTZNAQEBAQEBBwEBAQFBP4RCAQEEOhwjEAgDDgoJDBkPBSUDBxoTiBkPwQEBAQEHAgEdGIUxhH6CVIIdgmyBDwWWd4VOh3yOfY4+hFooLgGIKQEBAQ Received: from ppp121-44-19-16.lns20.syd4.internode.on.net (HELO dastard) ([121.44.19.16]) by ipmail06.adl2.internode.on.net with ESMTP; 13 Feb 2016 13:03:11 +1030 Received: from dave by dastard with local (Exim 4.80) (envelope-from ) id 1aUQ1G-0004PG-9h; Sat, 13 Feb 2016 13:33:10 +1100 Date: Sat, 13 Feb 2016 13:33:10 +1100 From: Dave Chinner To: Christoph Hellwig Cc: xfs@oss.sgi.com, "Darrick J. Wong" Subject: Re: block allocations for the refcount btree Message-ID: <20160213023310.GC14668@dastard> X-ASG-Orig-Subj: Re: block allocations for the refcount btree References: <20160210093011.GA19147@infradead.org> <20160210095010.GC23904@birch.djwong.org> <20160210190738.GA13051@infradead.org> <20160210214058.GN14668@dastard> <20160212191046.GA28421@infradead.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20160212191046.GA28421@infradead.org> User-Agent: Mutt/1.5.21 (2010-09-15) X-Barracuda-Connect: ipmail06.adl2.internode.on.net[150.101.137.129] X-Barracuda-Start-Time: 1455330791 X-Barracuda-URL: https://192.48.176.15:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-BRTS-Status: 1 X-Barracuda-Spam-Score: 0.00 X-Barracuda-Spam-Status: No, SCORE=0.00 using per-user scores of TAG_LEVEL=1000.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.7 tests=BSF_SC0_MISMATCH_TO X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.3.26990 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 0.00 BSF_SC0_MISMATCH_TO Envelope rcpt doesn't match header On Fri, Feb 12, 2016 at 11:10:46AM -0800, Christoph Hellwig wrote: > On Thu, Feb 11, 2016 at 08:40:58AM +1100, Dave Chinner wrote: > > I run into that from time to time (maybe once a month) on a vanilla > > kernel. > > > > IIRC, the problem is the delayed allocation extent split runs out of > > it's reserved block count if you split it enough times. The case > > I've seen is that the indlen calculated in xfs_bmap_worst_indlen() > > ends up too small for a subsequent allocation after we've called > > xfs_bmap_del_extent() to delete the middle of a delalloc extent too > > many times. > > > > Brian had some patches that attempted to solve it - we may have > > simply dropped the ball on this (again). > > > > http://oss.sgi.com/archives/xfs/2014-09/msg00337.html > > I'm pretty sure that is a separate issue. With the refcount btree we may > allocate an extent (or rather just a single block) in xfs_alloc_ag_vextent > as called from xfs_refcountbt_alloc_block. The reservation helps us to > ensure this block is always available, but we still need to account for > that in xfs_trans_reserve(), which we currently don't do for itruncate > transactions. Ok, so we may have two different issues with a similar failure symptom. As it is, I don't think this is a show stopper - we're expecting to find these sorts of issues as we go along (hence the experimental tag on the feature) and I think, at this point, getting review and an initial merge done is more important... Cheers, Dave. -- Dave Chinner david@fromorbit.com From david@fromorbit.com Fri Feb 12 20:39:21 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=ham version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay2.corp.sgi.com [137.38.102.29]) by oss.sgi.com (Postfix) with ESMTP id 3ACEE7CA2 for ; Fri, 12 Feb 2016 20:39:21 -0600 (CST) Received: from cuda.sgi.com (cuda2.sgi.com [192.48.176.25]) by relay2.corp.sgi.com (Postfix) with ESMTP id 248C4304051 for ; Fri, 12 Feb 2016 18:39:21 -0800 (PST) X-ASG-Debug-ID: 1455331158-04cbb04331ab600001-NocioJ Received: from ipmail06.adl2.internode.on.net (ipmail06.adl2.internode.on.net [150.101.137.129]) by cuda.sgi.com with ESMTP id M4FE8YnpLIfJBLad for ; Fri, 12 Feb 2016 18:39:18 -0800 (PST) X-Barracuda-Envelope-From: david@fromorbit.com X-Barracuda-Apparent-Source-IP: 150.101.137.129 Received: from ppp121-44-19-16.lns20.syd4.internode.on.net (HELO dastard) ([121.44.19.16]) by ipmail06.adl2.internode.on.net with ESMTP; 13 Feb 2016 13:08:50 +1030 Received: from dave by dastard with local (Exim 4.80) (envelope-from ) id 1aUQ6j-0004Pp-Em; Sat, 13 Feb 2016 13:38:49 +1100 Date: Sat, 13 Feb 2016 13:38:49 +1100 From: Dave Chinner To: Ross Zwisler , Jan Kara , linux-kernel@vger.kernel.org, Theodore Ts'o , Alexander Viro , Andreas Dilger , Andrew Morton , Dan Williams , Jan Kara , Matthew Wilcox , linux-ext4@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux-mm@kvack.org, linux-nvdimm@lists.01.org, xfs@oss.sgi.com Subject: Re: [PATCH v2 0/2] DAX bdev fixes - move flushing calls to FS Message-ID: <20160213023849.GD14668@dastard> X-ASG-Orig-Subj: Re: [PATCH v2 0/2] DAX bdev fixes - move flushing calls to FS References: <1455137336-28720-1-git-send-email-ross.zwisler@linux.intel.com> <20160211124304.GI21760@quack.suse.cz> <20160212190320.GA24857@linux.intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20160212190320.GA24857@linux.intel.com> User-Agent: Mutt/1.5.21 (2010-09-15) X-Barracuda-Connect: ipmail06.adl2.internode.on.net[150.101.137.129] X-Barracuda-Start-Time: 1455331158 X-Barracuda-URL: https://192.48.176.25:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-BRTS-Status: 1 X-Barracuda-Spam-Score: 1.00 X-Barracuda-Spam-Status: No, SCORE=1.00 using per-user scores of TAG_LEVEL=1000.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.7 tests=BSF_SC0_MISMATCH_TO, BSF_SC2_SA016_OB X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.3.26990 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 0.00 BSF_SC0_MISMATCH_TO Envelope rcpt doesn't match header 1.00 BSF_SC2_SA016_OB Custom Rule SA016_OB On Fri, Feb 12, 2016 at 12:03:20PM -0700, Ross Zwisler wrote: > On Thu, Feb 11, 2016 at 01:43:04PM +0100, Jan Kara wrote: > > On Wed 10-02-16 13:48:54, Ross Zwisler wrote: > > > 3) In filemap_write_and_wait() and filemap_write_and_wait_range(), continue > > > the writeback in the case that DAX is enabled but we only have a nonzero > > > mapping->nrpages. As with 1) and 2), I believe this is necessary to > > > properly writeback metadata changes. If this sounds wrong, please let me > > > know and I'll get more info. > > > > And I'm surprised here as well. If there are dax_mapping() inodes that have > > pagecache pages, then we have issues with radix tree handling as well. So > > how come dax_mapping() inodes have pages attached? If it is about block > > device inodes, then I find it buggy, that S_DAX gets set for such inodes > > when filesystem is mounted on them because in such cases we are IMO asking > > for data corruption sooner rather than later... > > I think I've figured this one out, at least partially. > > For ext2 the issues I was seeing were due to the fact that directory inodes > have S_DAX set, but have dirty page cache pages. In testing with > generic/002, I see two ext2 inodes with S_DAX trying to do a writeback while > they have dirty page cache pages. The first has i_ino=2, which is the > EXT2_ROOT_INO. .... > As far as I can see, XFS does not have these issues - returning immediately > having done just the DAX writeback in xfs_vm_writepages() lets all my xfstests > pass. XFS will not have issues because it does not dirty directory inodes at the VFS level, nor does it use the page cache for directory data. However, looking at the code I think it does still set S_DAX on directory inodes, which it shouldn't be doing. I've got a couple of fixes I need to do in this area - hopefully I'll get it done on Monday. Cheers, Dave. -- Dave Chinner david@fromorbit.com From sandeen@sandeen.net Fri Feb 12 20:43:51 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=ham version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay2.corp.sgi.com [137.38.102.29]) by oss.sgi.com (Postfix) with ESMTP id 007F67CA2 for ; Fri, 12 Feb 2016 20:43:50 -0600 (CST) Received: from cuda.sgi.com (cuda3.sgi.com [192.48.176.15]) by relay2.corp.sgi.com (Postfix) with ESMTP id C75CE304048 for ; Fri, 12 Feb 2016 18:43:50 -0800 (PST) X-ASG-Debug-ID: 1455331426-04cb6c1e58a0c20001-NocioJ Received: from sandeen.net (sandeen.net [63.231.237.45]) by cuda.sgi.com with ESMTP id SqdJSVTEXKuyls6r for ; Fri, 12 Feb 2016 18:43:46 -0800 (PST) X-Barracuda-Envelope-From: sandeen@sandeen.net X-Barracuda-Apparent-Source-IP: 63.231.237.45 Received: from Liberator.local (24-158-28-51.static.dlth.mn.charter.com [24.158.28.51]) (using TLSv1.2 with cipher DHE-RSA-AES128-SHA (128/128 bits)) (No client certificate requested) by sandeen.net (Postfix) with ESMTPSA id 4D96863C5FF0 for ; Fri, 12 Feb 2016 20:43:45 -0600 (CST) Subject: Re: [PATCH v4 1/2] libxcmd: generalize topology functions To: xfs@oss.sgi.com X-ASG-Orig-Subj: Re: [PATCH v4 1/2] libxcmd: generalize topology functions References: <1455303811-9874-1-git-send-email-billodo@redhat.com> <1455303811-9874-2-git-send-email-billodo@redhat.com> From: Eric Sandeen Message-ID: <56BE9860.6020605@sandeen.net> Date: Fri, 12 Feb 2016 20:43:44 -0600 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.11; rv:38.0) Gecko/20100101 Thunderbird/38.5.1 MIME-Version: 1.0 In-Reply-To: <1455303811-9874-2-git-send-email-billodo@redhat.com> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit X-Barracuda-Connect: sandeen.net[63.231.237.45] X-Barracuda-Start-Time: 1455331426 X-Barracuda-URL: https://192.48.176.15:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-BRTS-Status: 1 X-Barracuda-Spam-Score: 0.00 X-Barracuda-Spam-Status: No, SCORE=0.00 using per-user scores of TAG_LEVEL=1000.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.7 tests= X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.3.26990 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- On 2/12/16 1:03 PM, Bill O'Donnell wrote: > Move general topology functions from xfs_mkfs to new topology > collection in libxcmd. > > Signed-off-by: Bill O'Donnell Reviewed-by: Eric Sandeen > --- > include/Makefile | 1 + > include/libxcmd.h | 56 +++++++++ > libxcmd/Makefile | 2 +- > libxcmd/topology.c | 341 +++++++++++++++++++++++++++++++++++++++++++++++++++++ > mkfs/Makefile | 2 +- > mkfs/xfs_mkfs.c | 321 +------------------------------------------------ > 6 files changed, 401 insertions(+), 322 deletions(-) > create mode 100644 include/libxcmd.h > create mode 100644 libxcmd/topology.c > > diff --git a/include/Makefile b/include/Makefile > index 6148756..2671f07 100644 > --- a/include/Makefile > +++ b/include/Makefile > @@ -20,6 +20,7 @@ include $(TOPDIR)/include/builddefs > > LIBHFILES = libxfs.h \ > libxlog.h \ > + libxcmd.h \ > atomic.h \ > bitops.h \ > cache.h \ > diff --git a/include/libxcmd.h b/include/libxcmd.h > new file mode 100644 > index 0000000..a912534 > --- /dev/null > +++ b/include/libxcmd.h > @@ -0,0 +1,56 @@ > +/* > + * Copyright (c) 2000-2005 Silicon Graphics, Inc. > + * All Rights Reserved. > + * > + * This program is free software; you can redistribute it and/or > + * modify it under the terms of the GNU General Public License as > + * published by the Free Software Foundation. > + * > + * This program is distributed in the hope that it would be useful, > + * but WITHOUT ANY WARRANTY; without even the implied warranty of > + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the > + * GNU General Public License for more details. > + * > + * You should have received a copy of the GNU General Public License > + * along with this program; if not, write the Free Software Foundation, > + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA > + */ > + > +#ifndef __LIBXCMD_H__ > +#define __LIBXCMD_H__ > + > +#include "libxfs.h" > +#include > + > +/* > + * Device topology information. > + */ > +typedef struct fs_topology { > + int dsunit; /* stripe unit - data subvolume */ > + int dswidth; /* stripe width - data subvolume */ > + int rtswidth; /* stripe width - rt subvolume */ > + int lsectorsize; /* logical sector size &*/ > + int psectorsize; /* physical sector size */ > +} fs_topology_t; > + > +extern void > +get_topology( > + libxfs_init_t *xi, > + struct fs_topology *ft, > + int force_overwrite); > + > +extern void > +calc_default_ag_geometry( > + int blocklog, > + __uint64_t dblocks, > + int multidisk, > + __uint64_t *agsize, > + __uint64_t *agcount); > + > +extern int > +check_overwrite( > + char *device); > + > + > + > +#endif /* __LIBXCMD_H__ */ > diff --git a/libxcmd/Makefile b/libxcmd/Makefile > index 7701ed9..aab8d6d 100644 > --- a/libxcmd/Makefile > +++ b/libxcmd/Makefile > @@ -10,7 +10,7 @@ LT_CURRENT = 0 > LT_REVISION = 0 > LT_AGE = 0 > > -CFILES = command.c input.c paths.c projects.c help.c quit.c > +CFILES = command.c input.c paths.c projects.c help.c quit.c topology.c > > ifeq ($(HAVE_GETMNTENT),yes) > LCFLAGS += -DHAVE_GETMNTENT > diff --git a/libxcmd/topology.c b/libxcmd/topology.c > new file mode 100644 > index 0000000..4cbe4b1 > --- /dev/null > +++ b/libxcmd/topology.c > @@ -0,0 +1,341 @@ > +/* > + * Copyright (c) 2000-2001,2005 Silicon Graphics, Inc. > + * All Rights Reserved. > + * > + * This program is free software; you can redistribute it and/or > + * modify it under the terms of the GNU General Public License as > + * published by the Free Software Foundation. > + * > + * This program is distributed in the hope that it would be useful, > + * but WITHOUT ANY WARRANTY; without even the implied warranty of > + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the > + * GNU General Public License for more details. > + * > + * You should have received a copy of the GNU General Public License > + * along with this program; if not, write the Free Software Foundation, > + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA > + */ > + > +#include "libxfs.h" > +#include "libxcmd.h" > +#ifdef ENABLE_BLKID > +# include > +#endif /* ENABLE_BLKID */ > +#include "../mkfs/xfs_mkfs.h" > + > +#define TERABYTES(count, blog) ((__uint64_t)(count) << (40 - (blog))) > +#define GIGABYTES(count, blog) ((__uint64_t)(count) << (30 - (blog))) > +#define MEGABYTES(count, blog) ((__uint64_t)(count) << (20 - (blog))) > + > +void > +calc_default_ag_geometry( > + int blocklog, > + __uint64_t dblocks, > + int multidisk, > + __uint64_t *agsize, > + __uint64_t *agcount) > +{ > + __uint64_t blocks = 0; > + int shift = 0; > + > + /* > + * First handle the high extreme - the point at which we will > + * always use the maximum AG size. > + * > + * This applies regardless of storage configuration. > + */ > + if (dblocks >= TERABYTES(32, blocklog)) { > + blocks = XFS_AG_MAX_BLOCKS(blocklog); > + goto done; > + } > + > + /* > + * For the remainder we choose an AG size based on the > + * number of data blocks available, trying to keep the > + * number of AGs relatively small (especially compared > + * to the original algorithm). AG count is calculated > + * based on the preferred AG size, not vice-versa - the > + * count can be increased by growfs, so prefer to use > + * smaller counts at mkfs time. > + * > + * For a single underlying storage device between 128MB > + * and 4TB in size, just use 4 AGs, otherwise scale up > + * smoothly between min/max AG sizes. > + */ > + > + if (!multidisk && dblocks >= MEGABYTES(128, blocklog)) { > + if (dblocks >= TERABYTES(4, blocklog)) { > + blocks = XFS_AG_MAX_BLOCKS(blocklog); > + goto done; > + } > + shift = 2; > + } else if (dblocks > GIGABYTES(512, blocklog)) > + shift = 5; > + else if (dblocks > GIGABYTES(8, blocklog)) > + shift = 4; > + else if (dblocks >= MEGABYTES(128, blocklog)) > + shift = 3; > + else if (dblocks >= MEGABYTES(64, blocklog)) > + shift = 2; > + else if (dblocks >= MEGABYTES(32, blocklog)) > + shift = 1; > + else > + shift = 0; > + /* > + * If dblocks is not evenly divisible by the number of > + * desired AGs, round "blocks" up so we don't lose the > + * last bit of the filesystem. The same principle applies > + * to the AG count, so we don't lose the last AG! > + */ > + blocks = dblocks >> shift; > + if (dblocks & xfs_mask32lo(shift)) { > + if (blocks < XFS_AG_MAX_BLOCKS(blocklog)) > + blocks++; > + } > +done: > + *agsize = blocks; > + *agcount = dblocks / blocks + (dblocks % blocks != 0); > +} > + > +/* > + * Check for existing filesystem or partition table on device. > + * Returns: > + * 1 for existing fs or partition > + * 0 for nothing found > + * -1 for internal error > + */ > +#ifdef ENABLE_BLKID > +int > +check_overwrite( > + char *device) > +{ > + const char *type; > + blkid_probe pr = NULL; > + int ret; > + int fd; > + long long size; > + int bsz; > + > + if (!device || !*device) > + return 0; > + > + ret = -1; /* will reset on success of all setup calls */ > + > + fd = open(device, O_RDONLY); > + if (fd < 0) > + goto out; > + platform_findsizes(device, fd, &size, &bsz); > + close(fd); > + > + /* nothing to overwrite on a 0-length device */ > + if (size == 0) { > + ret = 0; > + goto out; > + } > + > + pr = blkid_new_probe_from_filename(device); > + if (!pr) > + goto out; > + > + ret = blkid_probe_enable_partitions(pr, 1); > + if (ret < 0) > + goto out; > + > + ret = blkid_do_fullprobe(pr); > + if (ret < 0) > + goto out; > + > + /* > + * Blkid returns 1 for nothing found and 0 when it finds a signature, > + * but we want the exact opposite, so reverse the return value here. > + * > + * In addition print some useful diagnostics about what actually is > + * on the device. > + */ > + if (ret) { > + ret = 0; > + goto out; > + } > + > + if (!blkid_probe_lookup_value(pr, "TYPE", &type, NULL)) { > + fprintf(stderr, > + _("%s: %s appears to contain an existing " > + "filesystem (%s).\n"), progname, device, type); > + } else if (!blkid_probe_lookup_value(pr, "PTTYPE", &type, NULL)) { > + fprintf(stderr, > + _("%s: %s appears to contain a partition " > + "table (%s).\n"), progname, device, type); > + } else { > + fprintf(stderr, > + _("%s: %s appears to contain something weird " > + "according to blkid\n"), progname, device); > + } > + ret = 1; > + > +out: > + if (pr) > + blkid_free_probe(pr); > + if (ret == -1) > + fprintf(stderr, > + _("%s: probe of %s failed, cannot detect " > + "existing filesystem.\n"), progname, device); > + return ret; > +} > + > +static void > +blkid_get_topology( > + const char *device, > + int *sunit, > + int *swidth, > + int *lsectorsize, > + int *psectorsize, > + int force_overwrite) > +{ > + > + blkid_topology tp; > + blkid_probe pr; > + unsigned long val; > + struct stat statbuf; > + > + /* can't get topology info from a file */ > + if (!stat(device, &statbuf) && S_ISREG(statbuf.st_mode)) > + return; > + > + pr = blkid_new_probe_from_filename(device); > + if (!pr) > + return; > + > + tp = blkid_probe_get_topology(pr); > + if (!tp) > + goto out_free_probe; > + > + val = blkid_topology_get_logical_sector_size(tp); > + *lsectorsize = val; > + val = blkid_topology_get_physical_sector_size(tp); > + *psectorsize = val; > + val = blkid_topology_get_minimum_io_size(tp); > + *sunit = val; > + val = blkid_topology_get_optimal_io_size(tp); > + *swidth = val; > + > + /* > + * If the reported values are the same as the physical sector size > + * do not bother to report anything. It will only cause warnings > + * if people specify larger stripe units or widths manually. > + */ > + if (*sunit == *psectorsize || *swidth == *psectorsize) { > + *sunit = 0; > + *swidth = 0; > + } > + > + /* > + * Blkid reports the information in terms of bytes, but we want it in > + * terms of 512 bytes blocks (only to convert it to bytes later..) > + */ > + *sunit = *sunit >> 9; > + *swidth = *swidth >> 9; > + > + if (blkid_topology_get_alignment_offset(tp) != 0) { > + fprintf(stderr, > + _("warning: device is not properly aligned %s\n"), > + device); > + > + if (!force_overwrite) { > + fprintf(stderr, > + _("Use -f to force usage of a misaligned device\n")); > + > + exit(EXIT_FAILURE); > + } > + /* Do not use physical sector size if the device is misaligned */ > + *psectorsize = *lsectorsize; > + } > + > + blkid_free_probe(pr); > + return; > + > +out_free_probe: > + blkid_free_probe(pr); > + fprintf(stderr, > + _("warning: unable to probe device topology for device %s\n"), > + device); > +} > +#else /* ifdef ENABLE_BLKID */ > +/* > + * Without blkid, we can't do a good check for signatures. > + * So instead of some messy attempts, just disable any checks > + * and always return 'nothing found'. > + */ > +# warning BLKID is disabled, so signature detection and block device\ > + access are not working! > + > +int > +check_overwrite( > + char *device) > +{ > + return 1; > +} > + > +static void > +blkid_get_topology( > + const char *device, > + int *sunit, > + int *swidth, > + int *lsectorsize, > + int *psectorsize, > + int force_overwrite) > +{ > + /* > + * Shouldn't make any difference (no blkid = no block device access), > + * but make sure this dummy replacement returns with at least some > + * sanity. > + */ > + *lsectorsize = *psectorsize = 512; > +} > + > +#endif /* ENABLE_BLKID */ > + > + > +void > +get_topology( > + libxfs_init_t *xi, > + struct fs_topology *ft, > + int force_overwrite) > +{ > + struct stat statbuf; > + char *dfile = xi->volname ? xi->volname : xi->dname; > + > + /* > + * If our target is a regular file, use platform_findsizes > + * to try to obtain the underlying filesystem's requirements > + * for direct IO; we'll set our sector size to that if possible. > + */ > + if (xi->disfile || > + (!stat(dfile, &statbuf) && S_ISREG(statbuf.st_mode))) { > + int fd; > + int flags = O_RDONLY; > + long long dummy; > + > + /* with xi->disfile we may not have the file yet! */ > + if (xi->disfile) > + flags |= O_CREAT; > + > + fd = open(dfile, flags, 0666); > + if (fd >= 0) { > + platform_findsizes(dfile, fd, &dummy, &ft->lsectorsize); > + close(fd); > + ft->psectorsize = ft->lsectorsize; > + } else > + ft->psectorsize = ft->lsectorsize = BBSIZE; > + } else { > + blkid_get_topology(dfile, &ft->dsunit, &ft->dswidth, > + &ft->lsectorsize, &ft->psectorsize, > + force_overwrite); > + } > + > + if (xi->rtname && !xi->risfile) { > + int sunit, lsectorsize, psectorsize; > + > + blkid_get_topology(xi->rtname, &sunit, &ft->rtswidth, > + &lsectorsize, &psectorsize, force_overwrite); > + } > +} > diff --git a/mkfs/Makefile b/mkfs/Makefile > index 570ab07..2997398 100644 > --- a/mkfs/Makefile > +++ b/mkfs/Makefile > @@ -10,7 +10,7 @@ LTCOMMAND = mkfs.xfs > HFILES = xfs_mkfs.h > CFILES = maxtrres.c proto.c xfs_mkfs.c > > -LLDLIBS += $(LIBBLKID) $(LIBXFS) $(LIBUUID) $(LIBRT) $(LIBPTHREAD) > +LLDLIBS += $(LIBBLKID) $(LIBXFS) $(LIBUUID) $(LIBRT) $(LIBPTHREAD) $(LIBXCMD) > LTDEPENDENCIES += $(LIBXFS) > LLDFLAGS = -static-libtool-libs > > diff --git a/mkfs/xfs_mkfs.c b/mkfs/xfs_mkfs.c > index 4c3a802..0a02719 100644 > --- a/mkfs/xfs_mkfs.c > +++ b/mkfs/xfs_mkfs.c > @@ -22,17 +22,7 @@ > # include > #endif /* ENABLE_BLKID */ > #include "xfs_mkfs.h" > - > -/* > - * Device topology information. > - */ > -struct fs_topology { > - int dsunit; /* stripe unit - data subvolume */ > - int dswidth; /* stripe width - data subvolume */ > - int rtswidth; /* stripe width - rt subvolume */ > - int lsectorsize; /* logical sector size &*/ > - int psectorsize; /* physical sector size */ > -}; > +#include "libxcmd.h" > > /* > * Prototypes for internal functions. > @@ -295,244 +285,6 @@ calc_stripe_factors( > } > } > > -/* > - * Check for existing filesystem or partition table on device. > - * Returns: > - * 1 for existing fs or partition > - * 0 for nothing found > - * -1 for internal error > - */ > -#ifdef ENABLE_BLKID > -static int > -check_overwrite( > - char *device) > -{ > - const char *type; > - blkid_probe pr = NULL; > - int ret; > - int fd; > - long long size; > - int bsz; > - > - if (!device || !*device) > - return 0; > - > - ret = -1; /* will reset on success of all setup calls */ > - > - fd = open(device, O_RDONLY); > - if (fd < 0) > - goto out; > - platform_findsizes(device, fd, &size, &bsz); > - close(fd); > - > - /* nothing to overwrite on a 0-length device */ > - if (size == 0) { > - ret = 0; > - goto out; > - } > - > - pr = blkid_new_probe_from_filename(device); > - if (!pr) > - goto out; > - > - ret = blkid_probe_enable_partitions(pr, 1); > - if (ret < 0) > - goto out; > - > - ret = blkid_do_fullprobe(pr); > - if (ret < 0) > - goto out; > - > - /* > - * Blkid returns 1 for nothing found and 0 when it finds a signature, > - * but we want the exact opposite, so reverse the return value here. > - * > - * In addition print some useful diagnostics about what actually is > - * on the device. > - */ > - if (ret) { > - ret = 0; > - goto out; > - } > - > - if (!blkid_probe_lookup_value(pr, "TYPE", &type, NULL)) { > - fprintf(stderr, > - _("%s: %s appears to contain an existing " > - "filesystem (%s).\n"), progname, device, type); > - } else if (!blkid_probe_lookup_value(pr, "PTTYPE", &type, NULL)) { > - fprintf(stderr, > - _("%s: %s appears to contain a partition " > - "table (%s).\n"), progname, device, type); > - } else { > - fprintf(stderr, > - _("%s: %s appears to contain something weird " > - "according to blkid\n"), progname, device); > - } > - ret = 1; > - > -out: > - if (pr) > - blkid_free_probe(pr); > - if (ret == -1) > - fprintf(stderr, > - _("%s: probe of %s failed, cannot detect " > - "existing filesystem.\n"), progname, device); > - return ret; > -} > - > -static void blkid_get_topology( > - const char *device, > - int *sunit, > - int *swidth, > - int *lsectorsize, > - int *psectorsize, > - int force_overwrite) > -{ > - > - blkid_topology tp; > - blkid_probe pr; > - unsigned long val; > - struct stat statbuf; > - > - /* can't get topology info from a file */ > - if (!stat(device, &statbuf) && S_ISREG(statbuf.st_mode)) > - return; > - > - pr = blkid_new_probe_from_filename(device); > - if (!pr) > - return; > - > - tp = blkid_probe_get_topology(pr); > - if (!tp) > - goto out_free_probe; > - > - val = blkid_topology_get_logical_sector_size(tp); > - *lsectorsize = val; > - val = blkid_topology_get_physical_sector_size(tp); > - *psectorsize = val; > - val = blkid_topology_get_minimum_io_size(tp); > - *sunit = val; > - val = blkid_topology_get_optimal_io_size(tp); > - *swidth = val; > - > - /* > - * If the reported values are the same as the physical sector size > - * do not bother to report anything. It will only cause warnings > - * if people specify larger stripe units or widths manually. > - */ > - if (*sunit == *psectorsize || *swidth == *psectorsize) { > - *sunit = 0; > - *swidth = 0; > - } > - > - /* > - * Blkid reports the information in terms of bytes, but we want it in > - * terms of 512 bytes blocks (only to convert it to bytes later..) > - */ > - *sunit = *sunit >> 9; > - *swidth = *swidth >> 9; > - > - if (blkid_topology_get_alignment_offset(tp) != 0) { > - fprintf(stderr, > - _("warning: device is not properly aligned %s\n"), > - device); > - > - if (!force_overwrite) { > - fprintf(stderr, > - _("Use -f to force usage of a misaligned device\n")); > - > - exit(EXIT_FAILURE); > - } > - /* Do not use physical sector size if the device is misaligned */ > - *psectorsize = *lsectorsize; > - } > - > - blkid_free_probe(pr); > - return; > - > -out_free_probe: > - blkid_free_probe(pr); > - fprintf(stderr, > - _("warning: unable to probe device topology for device %s\n"), > - device); > -} > -#else /* ifdef ENABLE_BLKID */ > -/* > - * Without blkid, we can't do a good check for signatures. > - * So instead of some messy attempts, just disable any checks > - * and always return 'nothing found'. > - */ > -# warning BLKID is disabled, so signature detection and block device\ > - access are not working! > -static int > -check_overwrite( > - char *device) > -{ > - return 1; > -} > - > -static void blkid_get_topology( > - const char *device, > - int *sunit, > - int *swidth, > - int *lsectorsize, > - int *psectorsize, > - int force_overwrite) > -{ > - /* > - * Shouldn't make any difference (no blkid = no block device access), > - * but make sure this dummy replacement returns with at least some > - * sanity. > - */ > - *lsectorsize = *psectorsize = 512; > -} > - > -#endif /* ENABLE_BLKID */ > - > -static void get_topology( > - libxfs_init_t *xi, > - struct fs_topology *ft, > - int force_overwrite) > -{ > - struct stat statbuf; > - char *dfile = xi->volname ? xi->volname : xi->dname; > - > - /* > - * If our target is a regular file, use platform_findsizes > - * to try to obtain the underlying filesystem's requirements > - * for direct IO; we'll set our sector size to that if possible. > - */ > - if (xi->disfile || > - (!stat(dfile, &statbuf) && S_ISREG(statbuf.st_mode))) { > - int fd; > - int flags = O_RDONLY; > - long long dummy; > - > - /* with xi->disfile we may not have the file yet! */ > - if (xi->disfile) > - flags |= O_CREAT; > - > - fd = open(dfile, flags, 0666); > - if (fd >= 0) { > - platform_findsizes(dfile, fd, &dummy, &ft->lsectorsize); > - close(fd); > - ft->psectorsize = ft->lsectorsize; > - } else > - ft->psectorsize = ft->lsectorsize = BBSIZE; > - } else { > - blkid_get_topology(dfile, &ft->dsunit, &ft->dswidth, > - &ft->lsectorsize, &ft->psectorsize, > - force_overwrite); > - } > - > - if (xi->rtname && !xi->risfile) { > - int sunit, lsectorsize, psectorsize; > - > - blkid_get_topology(xi->rtname, &sunit, &ft->rtswidth, > - &lsectorsize, &psectorsize, force_overwrite); > - } > -} > - > static void > fixup_log_stripe_unit( > int lsflag, > @@ -640,77 +392,6 @@ calc_default_imaxpct( > return 1; > } > > - > -void > -calc_default_ag_geometry( > - int blocklog, > - __uint64_t dblocks, > - int multidisk, > - __uint64_t *agsize, > - __uint64_t *agcount) > -{ > - __uint64_t blocks = 0; > - int shift = 0; > - > - /* > - * First handle the high extreme - the point at which we will > - * always use the maximum AG size. > - * > - * This applies regardless of storage configuration. > - */ > - if (dblocks >= TERABYTES(32, blocklog)) { > - blocks = XFS_AG_MAX_BLOCKS(blocklog); > - goto done; > - } > - > - /* > - * For the remainder we choose an AG size based on the > - * number of data blocks available, trying to keep the > - * number of AGs relatively small (especially compared > - * to the original algorithm). AG count is calculated > - * based on the preferred AG size, not vice-versa - the > - * count can be increased by growfs, so prefer to use > - * smaller counts at mkfs time. > - * > - * For a single underlying storage device between 128MB > - * and 4TB in size, just use 4 AGs, otherwise scale up > - * smoothly between min/max AG sizes. > - */ > - > - if (!multidisk && dblocks >= MEGABYTES(128, blocklog)) { > - if (dblocks >= TERABYTES(4, blocklog)) { > - blocks = XFS_AG_MAX_BLOCKS(blocklog); > - goto done; > - } > - shift = 2; > - } else if (dblocks > GIGABYTES(512, blocklog)) > - shift = 5; > - else if (dblocks > GIGABYTES(8, blocklog)) > - shift = 4; > - else if (dblocks >= MEGABYTES(128, blocklog)) > - shift = 3; > - else if (dblocks >= MEGABYTES(64, blocklog)) > - shift = 2; > - else if (dblocks >= MEGABYTES(32, blocklog)) > - shift = 1; > - else > - shift = 0; > - /* > - * If dblocks is not evenly divisible by the number of > - * desired AGs, round "blocks" up so we don't lose the > - * last bit of the filesystem. The same principle applies > - * to the AG count, so we don't lose the last AG! > - */ > - blocks = dblocks >> shift; > - if (dblocks & xfs_mask32lo(shift)) { > - if (blocks < XFS_AG_MAX_BLOCKS(blocklog)) > - blocks++; > - } > -done: > - *agsize = blocks; > - *agcount = dblocks / blocks + (dblocks % blocks != 0); > -} > - > static void > validate_ag_geometry( > int blocklog, > From david@fromorbit.com Fri Feb 12 20:52:53 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=ham version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay1.corp.sgi.com [137.38.102.111]) by oss.sgi.com (Postfix) with ESMTP id 1CDAC7CA2 for ; Fri, 12 Feb 2016 20:52:53 -0600 (CST) Received: from cuda.sgi.com (cuda2.sgi.com [192.48.176.25]) by relay1.corp.sgi.com (Postfix) with ESMTP id F10D38F8039 for ; Fri, 12 Feb 2016 18:52:52 -0800 (PST) X-ASG-Debug-ID: 1455331968-04cbb04333abcc0001-NocioJ Received: from ipmail06.adl2.internode.on.net (ipmail06.adl2.internode.on.net [150.101.137.129]) by cuda.sgi.com with ESMTP id z0mNEYYrgsCoJB3i for ; Fri, 12 Feb 2016 18:52:49 -0800 (PST) X-Barracuda-Envelope-From: david@fromorbit.com X-Barracuda-Apparent-Source-IP: 150.101.137.129 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: A2AqCQBcmb5WPBATLHleKAECgw9SbYJohXOdaQEBAQEBAQaLaolNFwqFZgQCAoE2TQEBAQEBAQcBAQEBQT+EQgEBBAEBATccGBsIAxgJJQ8FExIDBy2IGQ/BKhiFMYR+glSCKoJfgQ8FlneFTod8jn2OPoRaKC6IKgEBAQ Received: from ppp121-44-19-16.lns20.syd4.internode.on.net (HELO dastard) ([121.44.19.16]) by ipmail06.adl2.internode.on.net with ESMTP; 13 Feb 2016 13:22:44 +1030 Received: from dave by dastard with local (Exim 4.80) (envelope-from ) id 1aUQKB-0004Ql-MK for xfs@oss.sgi.com; Sat, 13 Feb 2016 13:52:43 +1100 Date: Sat, 13 Feb 2016 13:52:43 +1100 From: Dave Chinner To: xfs@oss.sgi.com Subject: Re: [PATCH 0/9] xfs: configurable error behaviour Message-ID: <20160213025243.GE14668@dastard> X-ASG-Orig-Subj: Re: [PATCH 0/9] xfs: configurable error behaviour References: <1454635407-22276-1-git-send-email-david@fromorbit.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1454635407-22276-1-git-send-email-david@fromorbit.com> User-Agent: Mutt/1.5.21 (2010-09-15) X-Barracuda-Connect: ipmail06.adl2.internode.on.net[150.101.137.129] X-Barracuda-Start-Time: 1455331968 X-Barracuda-URL: https://192.48.176.25:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-BRTS-Status: 1 X-Barracuda-Spam-Score: 0.00 X-Barracuda-Spam-Status: No, SCORE=0.00 using per-user scores of TAG_LEVEL=1000.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.7 tests= X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.3.26991 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- ping? On Fri, Feb 05, 2016 at 12:23:18PM +1100, Dave Chinner wrote: > Hi folks, > > I need to restart the discussion and review of this patch series. > There was some discussion of it last time, but nothing really came > from that. I'm posting what I have in my tree right now - treat it > as though it's an initial posting of the code because I can't recall > what I've changed since the first posting. > > What I'd like to have to for the next merge window is all the IO > error bits sorted out. The final patch (kmem failure behaviour) > needs more infrastructure (passing mp to every allocation) so that's > a secondary concern right now and I've only included it to > demonstrate how to apply this code ot a different subsystem. > > Things that need to be nailed down before I can commit the series: > > - sysfs layout > - naming conventions for errors and subsystems in sysfs > - how best to display/change default behaviour > > Things that we can change/implement later: > > - default behaviour > - additional error classes > - additional error types > - additional subsystems > - subsystem error handling implementation > - communication with other subsystems to dynamically change > error behaviour > > IOWs, what is important right now is how we present this to > userspace, because we can't change that easily once we've decided on > a presentation structure. > > Modifying the code to classify and handle all the different error > types is much less important, as we can change that to fix whatever > problems we have without impacting the presentation to userspace. > > There is definite need for this (e.g. handling of ENOSPC on thin > provisioned devices), so I want to get quickly to a consensus on the > userspace facing aspects so that we can get this ball rolling. > > The biggest unsolved issue is how to change the default behaviour > persistently. There is no infrastructure in this patch series to do > that, but it is someting that we have to consider so that we don't > require default behaviour to be changed after every mount of every > filesystem on a system. My thoughts on this is we store changes to > the defaults in xattrs on the root inode, but I'm open to ideas here > as there's no code written for it yet. Solving this problem, > however, is not necessary before commiting the initial code; it's > something we can add later once we've worked out all the details. > > Discuss! > > -Dave. > > _______________________________________________ > xfs mailing list > xfs@oss.sgi.com > http://oss.sgi.com/mailman/listinfo/xfs > -- Dave Chinner david@fromorbit.com From sandeen@sandeen.net Fri Feb 12 21:12:27 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=ham version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay2.corp.sgi.com [137.38.102.29]) by oss.sgi.com (Postfix) with ESMTP id 0BA147CA2 for ; Fri, 12 Feb 2016 21:12:27 -0600 (CST) Received: from cuda.sgi.com (cuda3.sgi.com [192.48.176.15]) by relay2.corp.sgi.com (Postfix) with ESMTP id F397A304048 for ; Fri, 12 Feb 2016 19:12:23 -0800 (PST) X-ASG-Debug-ID: 1455333141-04cb6c1e59a1180001-NocioJ Received: from sandeen.net (sandeen.net [63.231.237.45]) by cuda.sgi.com with ESMTP id mXuRU9bIq7kxsvp3 for ; Fri, 12 Feb 2016 19:12:21 -0800 (PST) X-Barracuda-Envelope-From: sandeen@sandeen.net X-Barracuda-Apparent-Source-IP: 63.231.237.45 Received: from Liberator.local (24-158-28-51.static.dlth.mn.charter.com [24.158.28.51]) (using TLSv1.2 with cipher DHE-RSA-AES128-SHA (128/128 bits)) (No client certificate requested) by sandeen.net (Postfix) with ESMTPSA id 02A6363C5FF0 for ; Fri, 12 Feb 2016 21:12:20 -0600 (CST) Subject: Re: [PATCH v4 2/2] xfs_repair: new secondary superblock search method To: xfs@oss.sgi.com X-ASG-Orig-Subj: Re: [PATCH v4 2/2] xfs_repair: new secondary superblock search method References: <1455303811-9874-1-git-send-email-billodo@redhat.com> <1455303811-9874-3-git-send-email-billodo@redhat.com> From: Eric Sandeen X-Enigmail-Draft-Status: N1110 Message-ID: <56BE9F13.7080107@sandeen.net> Date: Fri, 12 Feb 2016 21:12:19 -0600 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.11; rv:38.0) Gecko/20100101 Thunderbird/38.5.1 MIME-Version: 1.0 In-Reply-To: <1455303811-9874-3-git-send-email-billodo@redhat.com> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 8bit X-Barracuda-Connect: sandeen.net[63.231.237.45] X-Barracuda-Start-Time: 1455333141 X-Barracuda-URL: https://192.48.176.15:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-BRTS-Status: 1 X-Barracuda-Spam-Score: 0.00 X-Barracuda-Spam-Status: No, SCORE=0.00 using per-user scores of TAG_LEVEL=1000.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.7 tests= X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.3.26991 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- On 2/12/16 1:03 PM, Bill O'Donnell wrote: > Optimize secondary sb search, using similar method to find > fs geometry as that of xfs_mkfs. If this faster method fails > in finding a secondary sb, fall back to original brute force > slower search. Hey Bill, looks like this is pretty much there. I do have a few comments, things which I really should have seen earlier, so I'm very sorry about that. Inline below. I think you can just send a V5 in reply to this one to keep it in the thread. Dave's up to V6 on his latest patchset so don't feel too bad. :D -Eric > Signed-off-by: Bill O'Donnell > --- > Makefile | 2 +- > include/libxcmd.h | 6 +++++- > libxcmd/topology.c | 27 +++++++++++++++++++++++++++ > repair/Makefile | 4 ++-- > repair/sb.c | 49 +++++++++++++++++++++++++++++++++++++++++-------- > 5 files changed, 76 insertions(+), 12 deletions(-) > > diff --git a/Makefile b/Makefile > index fca0a42..1d60d9c 100644 > --- a/Makefile > +++ b/Makefile > @@ -80,7 +80,7 @@ fsr: libhandle > growfs: libxcmd > io: libxcmd libhandle > quota: libxcmd > -repair: libxlog > +repair: libxlog libxcmd > copy: libxlog > > ifeq ($(HAVE_BUILDDEFS), yes) > diff --git a/include/libxcmd.h b/include/libxcmd.h > index a912534..eb16cd5 100644 > --- a/include/libxcmd.h > +++ b/include/libxcmd.h > @@ -51,6 +51,10 @@ extern int > check_overwrite( > char *device); > > - > +extern int > +guess_default_geometry( > + __uint64_t *agsize, > + __uint64_t *agcount, > + libxfs_init_t x); This function is only used in repair/sb.c, so it can just be a static in that function, no need to have it in the library. But more importantly, passing the libxfs_init_t structure by value is pretty unusual; it works in this case because it's not modified, but it would be safer and make more sense to pass in a pointer. > #endif /* __LIBXCMD_H__ */ > diff --git a/libxcmd/topology.c b/libxcmd/topology.c > index 4cbe4b1..ec9695c 100644 > --- a/libxcmd/topology.c > +++ b/libxcmd/topology.c > @@ -339,3 +339,30 @@ get_topology( > &lsectorsize, &psectorsize, force_overwrite); > } > } > + > +int > +guess_default_geometry( > + __uint64_t *agsize, > + __uint64_t *agcount, > + libxfs_init_t x) + __uint64_t *agsize, + __uint64_t *agcount, + libxfs_init_t *x) tab out to match below, and take pointer for x > +{ > + struct fs_topology ft; > + int blocklog; > + __uint64_t dblocks; > + int multidisk; > + > + memset(&ft, 0, sizeof(ft)); > + get_topology(&x, &ft, 1); + get_topology(x, &ft,1); > + > + /* > + * get geometry from get_topology result. > + * Use default block size (2^12) > + */ > + blocklog = 12; > + multidisk = ft.dswidth | ft.dsunit; > + dblocks = x.dsize >> (blocklog - BBSHIFT); + dblocks = x->dsize >> (blocklog - BBSHIFT); > + calc_default_ag_geometry(blocklog, dblocks, multidisk, > + agsize, agcount); > + > + return blocklog; > +} > diff --git a/repair/Makefile b/repair/Makefile > index 251722b..d24ab1f 100644 > --- a/repair/Makefile > +++ b/repair/Makefile > @@ -20,8 +20,8 @@ CFILES = agheader.c attr_repair.c avl.c avl64.c bmap.c btree.c \ > progress.c prefetch.c rt.c sb.c scan.c threads.c \ > versions.c xfs_repair.c > > -LLDLIBS = $(LIBXFS) $(LIBXLOG) $(LIBUUID) $(LIBRT) $(LIBPTHREAD) > -LTDEPENDENCIES = $(LIBXFS) $(LIBXLOG) > +LLDLIBS = $(LIBBLKID) $(LIBXFS) $(LIBXLOG) $(LIBUUID) $(LIBRT) $(LIBPTHREAD) $(LIBXCMD) > +LTDEPENDENCIES = $(LIBXFS) $(LIBXLOG) $(LIBXCMD) > LLDFLAGS = -static-libtool-libs > > default: depend $(LTCOMMAND) > diff --git a/repair/sb.c b/repair/sb.c > index 4eef14a..8dcad5f 100644 > --- a/repair/sb.c > +++ b/repair/sb.c > @@ -17,6 +17,7 @@ > */ > > #include "libxfs.h" > +#include "libxcmd.h" > #include "libxlog.h" > #include "agheader.h" > #include "globals.h" > @@ -85,10 +86,15 @@ copy_sb(xfs_sb_t *source, xfs_sb_t *dest) > } > > /* > - * find a secondary superblock, copy it into the sb buffer > + * find a secondary superblock, copy it into the sb buffer. > + * start is the point to begin reading BSIZE bytes. > + * skip contains a byte-count of how far to advance for next read. > */ > -int > -find_secondary_sb(xfs_sb_t *rsb) > +static int > +__find_secondary_sb( > + xfs_sb_t *rsb, > + __uint64_t start, > + __uint64_t skip) again, tab those out to match: + xfs_sb_t *rsb, + __uint64_t start, + __uint64_t skip) > { > xfs_off_t off; > xfs_sb_t *sb; > @@ -101,7 +107,6 @@ find_secondary_sb(xfs_sb_t *rsb) > int bsize; > > do_warn(_("\nattempting to find secondary superblock...\n")); > - No good reason to remove this line, really; sometimes we clean up whitespace if it makes sense and we're in the area, but this hunk is nothing but a line removal; generally don't want unrelated whitespace changes to sneak in. > sb = (xfs_sb_t *)memalign(libxfs_device_alignment(), BSIZE); > if (!sb) { > do_error( > @@ -117,7 +122,7 @@ find_secondary_sb(xfs_sb_t *rsb) > /* > * skip first sector since we know that's bad > */ > - for (done = 0, off = XFS_AG_MIN_BYTES; !done ; off += bsize) { > + for (done = 0, off = start; !done ; off += skip) { > /* > * read disk 1 MByte at a time. > */ > @@ -128,9 +133,7 @@ find_secondary_sb(xfs_sb_t *rsb) > if (!done && (bsize = read(x.dfd, sb, BSIZE)) <= 0) { > done = 1; > } > - > do_warn("."); > - While we're at it - no reason to remove these lines, it makes the dot-generator stand out a little more. ;) > /* > * check the buffer 512 bytes at a time since > * we don't know how big the sectors really are. > @@ -166,7 +169,37 @@ find_secondary_sb(xfs_sb_t *rsb) > } > > free(sb); > - return(retval); > + return retval; > +} You can put guess_default_geometry() here, as a static function. > + > +int > +find_secondary_sb(xfs_sb_t *rsb) > +{ > + int retval; > + __uint64_t agcount; > + __uint64_t agsize; > + __uint64_t skip; > + int blocklog; > + > + /* > + * Attempt to find secondary sb with a coarse approach, > + * using a large skip (agsize in bytes). Failing that, "using a large start and skip," I guess. > + * fallback to the fine-grained approach using min agsize. "fallback to the fine-grained approach, starting at min agsize." (it's not using min agsize for skip, so just to keep that clear) > + */ > + blocklog = guess_default_geometry(&agsize, &agcount, x); > + > + /* > + * use found ag geometry to quickly find secondary sb > + */ > + skip = agsize << blocklog; > + retval = __find_secondary_sb(rsb, skip, skip); > + if (!retval) { > + /* > + * fallback: use minimum agsize for skipsize actually that's the start, not skip; so "fallback: Start at min agsize and scan all blocks" > + */ > + retval = __find_secondary_sb(rsb, XFS_AG_MIN_BYTES, BSIZE); > + } > + return retval; > } > > /* > From darrick.wong@oracle.com Fri Feb 12 22:38:57 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay1.corp.sgi.com [137.38.102.111]) by oss.sgi.com (Postfix) with ESMTP id 4E7B97CA2 for ; Fri, 12 Feb 2016 22:38:57 -0600 (CST) Received: from cuda.sgi.com (cuda2.sgi.com [192.48.176.25]) by relay1.corp.sgi.com (Postfix) with ESMTP id 32A3B8F8035 for ; Fri, 12 Feb 2016 20:38:54 -0800 (PST) X-ASG-Debug-ID: 1455338329-04cbb04333ad6e0001-NocioJ Received: from aserp1040.oracle.com (aserp1040.oracle.com [141.146.126.69]) by cuda.sgi.com with ESMTP id BZv4goYmmMqtWJ4O (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO) for ; Fri, 12 Feb 2016 20:38:49 -0800 (PST) X-Barracuda-Envelope-From: darrick.wong@oracle.com X-Barracuda-Apparent-Source-IP: 141.146.126.69 Received: from userv0022.oracle.com (userv0022.oracle.com [156.151.31.74]) by aserp1040.oracle.com (Sentrion-MTA-4.3.2/Sentrion-MTA-4.3.2) with ESMTP id u1D4cjFT010891 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Sat, 13 Feb 2016 04:38:46 GMT Received: from aserv0122.oracle.com (aserv0122.oracle.com [141.146.126.236]) by userv0022.oracle.com (8.14.4/8.13.8) with ESMTP id u1D4ci6H025187 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=FAIL); Sat, 13 Feb 2016 04:38:45 GMT Received: from abhmp0002.oracle.com (abhmp0002.oracle.com [141.146.116.8]) by aserv0122.oracle.com (8.13.8/8.13.8) with ESMTP id u1D4cfFi032194; Sat, 13 Feb 2016 04:38:43 GMT Received: from localhost (/24.21.154.84) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Fri, 12 Feb 2016 20:38:41 -0800 Date: Fri, 12 Feb 2016 20:38:34 -0800 From: "Darrick J. Wong" To: Dave Chinner Cc: linux-btrfs@vger.kernel.org, fstests@vger.kernel.org, xfs@oss.sgi.com Subject: Re: [PATCH v4.2 00/32] xfstests: test the nfs/cifs/btrfs/xfs reflink/dedupe ioctls Message-ID: <20160213043834.GC26204@birch.djwong.org> X-ASG-Orig-Subj: Re: [PATCH v4.2 00/32] xfstests: test the nfs/cifs/btrfs/xfs reflink/dedupe ioctls References: <20160211233916.2202.40961.stgit@birch.djwong.org> <20160213012659.GA14668@dastard> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20160213012659.GA14668@dastard> User-Agent: Mutt/1.5.21 (2010-09-15) X-Source-IP: userv0022.oracle.com [156.151.31.74] X-Barracuda-Connect: aserp1040.oracle.com[141.146.126.69] X-Barracuda-Start-Time: 1455338329 X-Barracuda-Encrypted: ECDHE-RSA-AES256-GCM-SHA384 X-Barracuda-URL: https://192.48.176.25:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-BRTS-Status: 1 X-Barracuda-Spam-Score: 0.00 X-Barracuda-Spam-Status: No, SCORE=0.00 using per-user scores of TAG_LEVEL=1000.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.7 tests=BSF_SC0_MISMATCH_TO, UNPARSEABLE_RELAY X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.3.26992 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 0.00 BSF_SC0_MISMATCH_TO Envelope rcpt doesn't match header 0.00 UNPARSEABLE_RELAY Informational: message has unparseable relay lines On Sat, Feb 13, 2016 at 12:26:59PM +1100, Dave Chinner wrote: > On Thu, Feb 11, 2016 at 03:39:16PM -0800, Darrick J. Wong wrote: > > Dave Chinner: I've renumbered the new tests and pushed to github[3] if > > you'd like to pull. See the pull request at the end of this message. > > > > This is a patch set against the reflink/dedupe test cases in xfstests. > > The first three patches fix errors in the existing reflink tests, some > > of which are from Christoph Hellwig. > > > > The next eight patches fix style errors, refactor commonly used code, > > remove unnecessary clutter, and add missing _require* checks to the > > existing reflink tests. > > > > Patch 12 adds a test checking that unwritten extent conversion does > > NOT happen after a directio write to an unwritten extent hits a disk > > error. Due to a bug in the VFS directio code, ext4 can disclose > > stale disk contents if an aio dio write fails; XFS suffers this > > problem for any failing dio write to an unwritten extent. Christoph's > > kernel patchset titled "vfs/xfs: directio updates to ease COW handling > > V2" (and a separate ext4 warning cleanup) is needed to fix this. > > > > Patches 13-31 add more reflink tests focusing on correct CoW behavior > > particularly with the CoW extent size hint enabled. It also provides > > a few regression tests for bugs that have been hit while running XFS > > reflink, a few tests of the quota accounting when various reflink > > operations happen, and a few tests for get_bmapx to ensure that what > > it reports is at least somewhat accurate. > > > > Patch 25 adds a few basic reverse-mapping tests for XFS. > > > > If you're going to start using this mess, you probably ought to just > > pull from my github trees for kernel[1], xfsprogs[2], xfstests[3], > > xfs-docs[4], and man-pages[5]. All tests should pass on XFS, YMWV on > > btrfs and ocfs2. > > > > Comments and questions are, as always, welcome. > > I haven't worked out which patch causes this, but: > > xfs/246 - output mismatch (see /home/dave/src/xfstests-dev/results//xfs_1k/xfs/246.out.bad) > --- tests/xfs/246.out 2016-02-13 09:46:01.419169115 +1100 > +++ /home/dave/src/xfstests-dev/results//xfs_1k/xfs/246.out.bad 2016-02-13 11:36:05.205851863 +1100 > @@ -3,4 +3,5 @@ > Create the original files > Dump extents after sync > Hole CoW extents: > -SCRATCH_MNT/test-246/file1: no extents > +bmap: invalid option -- 'c' > +bmap [-adlpv] [-n nx] -- print block mapping for an XFS file > ... > (Run 'diff -u tests/xfs/246.out /home/dave/src/xfstests-dev/results//xfs_1k/xfs/246.out.bad' to see the entire diff) > > This test neds a check that the "-c" option in the bmap command > exists. Not sure if you can use '_requires_xfs_io_command "bmap -c"' > here or whether this requires more help... > > Followup patch, anyway, because I'm about to push out everything > that was in your second pull req (i.e. with the aiocp fix). xfs_io "bmap -c" is a new switch that dumps the CoW fork of a file. AFAICT there isn't any way to check that an xfs_io command supports a particular switch, though it wouldn't be difficult to add a check. --D > > Cheers, > > Dave. > -- > Dave Chinner > david@fromorbit.com From darrick.wong@oracle.com Fri Feb 12 22:44:37 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay1.corp.sgi.com [137.38.102.111]) by oss.sgi.com (Postfix) with ESMTP id C0E6A7CA2 for ; Fri, 12 Feb 2016 22:44:37 -0600 (CST) Received: from cuda.sgi.com (cuda1.sgi.com [192.48.157.11]) by relay1.corp.sgi.com (Postfix) with ESMTP id 8AAAA8F8035 for ; Fri, 12 Feb 2016 20:44:37 -0800 (PST) X-ASG-Debug-ID: 1455338675-04bdf066ed97300001-NocioJ Received: from aserp1040.oracle.com (aserp1040.oracle.com [141.146.126.69]) by cuda.sgi.com with ESMTP id KSNmA4zHqWBMYtyc (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO) for ; Fri, 12 Feb 2016 20:44:35 -0800 (PST) X-Barracuda-Envelope-From: darrick.wong@oracle.com X-Barracuda-Apparent-Source-IP: 141.146.126.69 Received: from aserv0022.oracle.com (aserv0022.oracle.com [141.146.126.234]) by aserp1040.oracle.com (Sentrion-MTA-4.3.2/Sentrion-MTA-4.3.2) with ESMTP id u1D4i7R4014472 (version=TLSv1 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Sat, 13 Feb 2016 04:44:07 GMT Received: from userv0121.oracle.com (userv0121.oracle.com [156.151.31.72]) by aserv0022.oracle.com (8.13.8/8.13.8) with ESMTP id u1D4i6r1010370 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=FAIL); Sat, 13 Feb 2016 04:44:06 GMT Received: from abhmp0003.oracle.com (abhmp0003.oracle.com [141.146.116.9]) by userv0121.oracle.com (8.13.8/8.13.8) with ESMTP id u1D4i2BT003337; Sat, 13 Feb 2016 04:44:02 GMT Received: from localhost (/24.21.154.84) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Fri, 12 Feb 2016 20:44:01 -0800 Date: Fri, 12 Feb 2016 20:44:00 -0800 From: "Darrick J. Wong" To: Dave Chinner Cc: Christoph Hellwig , xfs@oss.sgi.com Subject: Re: block allocations for the refcount btree Message-ID: <20160213044400.GJ6350@birch.djwong.org> X-ASG-Orig-Subj: Re: block allocations for the refcount btree References: <20160210093011.GA19147@infradead.org> <20160210095010.GC23904@birch.djwong.org> <20160210190738.GA13051@infradead.org> <20160210214058.GN14668@dastard> <20160212191046.GA28421@infradead.org> <20160213023310.GC14668@dastard> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20160213023310.GC14668@dastard> User-Agent: Mutt/1.5.21 (2010-09-15) X-Source-IP: aserv0022.oracle.com [141.146.126.234] X-Barracuda-Connect: aserp1040.oracle.com[141.146.126.69] X-Barracuda-Start-Time: 1455338675 X-Barracuda-Encrypted: ECDHE-RSA-AES256-GCM-SHA384 X-Barracuda-URL: https://192.48.157.11:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-BRTS-Status: 1 X-Barracuda-Spam-Score: 0.00 X-Barracuda-Spam-Status: No, SCORE=0.00 using per-user scores of TAG_LEVEL=1000.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.7 tests=BSF_SC0_MISMATCH_TO, UNPARSEABLE_RELAY X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.3.26992 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 0.00 BSF_SC0_MISMATCH_TO Envelope rcpt doesn't match header 0.00 UNPARSEABLE_RELAY Informational: message has unparseable relay lines On Sat, Feb 13, 2016 at 01:33:10PM +1100, Dave Chinner wrote: > On Fri, Feb 12, 2016 at 11:10:46AM -0800, Christoph Hellwig wrote: > > On Thu, Feb 11, 2016 at 08:40:58AM +1100, Dave Chinner wrote: > > > I run into that from time to time (maybe once a month) on a vanilla > > > kernel. > > > > > > IIRC, the problem is the delayed allocation extent split runs out of > > > it's reserved block count if you split it enough times. The case > > > I've seen is that the indlen calculated in xfs_bmap_worst_indlen() > > > ends up too small for a subsequent allocation after we've called > > > xfs_bmap_del_extent() to delete the middle of a delalloc extent too > > > many times. > > > > > > Brian had some patches that attempted to solve it - we may have > > > simply dropped the ball on this (again). > > > > > > http://oss.sgi.com/archives/xfs/2014-09/msg00337.html > > > > I'm pretty sure that is a separate issue. With the refcount btree we may > > allocate an extent (or rather just a single block) in xfs_alloc_ag_vextent > > as called from xfs_refcountbt_alloc_block. The reservation helps us to > > ensure this block is always available, but we still need to account for > > that in xfs_trans_reserve(), which we currently don't do for itruncate > > transactions. Hmm. The per-AG reservation clients also had some problems counting the number of tree blocks in use as part of setting up the reservation; that might have had something to do with it. Dunno, I'll go look at that part of the code again when I finish interval query support for rmap. > Ok, so we may have two different issues with a similar failure > symptom. As it is, I don't think this is a show stopper - we're > expecting to find these sorts of issues as we go along (hence the > experimental tag on the feature) and I think, at this point, getting > review and an initial merge done is more important... I've noticed that I can trigger that assert (the log reservation one) fairly regularly when running xfs/140 on a 800MB disk. Brain dead, going to bed. Next on my list is to rebase the more stable parts of the patchset against Dave's for-4.6 branch and do another mass mailing. --D > > Cheers, > > Dave. > -- > Dave Chinner > david@fromorbit.com > > _______________________________________________ > xfs mailing list > xfs@oss.sgi.com > http://oss.sgi.com/mailman/listinfo/xfs From ross.zwisler@linux.intel.com Fri Feb 12 22:59:29 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=ham version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay2.corp.sgi.com [137.38.102.29]) by oss.sgi.com (Postfix) with ESMTP id 7DCDA7CA2 for ; Fri, 12 Feb 2016 22:59:29 -0600 (CST) Received: from cuda.sgi.com (cuda1.sgi.com [192.48.157.11]) by relay2.corp.sgi.com (Postfix) with ESMTP id 45FF6304048 for ; Fri, 12 Feb 2016 20:59:25 -0800 (PST) X-ASG-Debug-ID: 1455339564-04bdf066eb97580001-NocioJ Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) by cuda.sgi.com with ESMTP id YkE0VHARLKTVGKIi for ; Fri, 12 Feb 2016 20:59:24 -0800 (PST) X-Barracuda-Envelope-From: ross.zwisler@linux.intel.com X-Barracuda-Apparent-Source-IP: 134.134.136.20 X-ASG-Whitelist: Client Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by orsmga101.jf.intel.com with ESMTP; 12 Feb 2016 20:59:24 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.22,438,1449561600"; d="scan'208";a="914314314" Received: from rzwisler-desk.amr.corp.intel.com (HELO linux.intel.com) ([10.252.193.228]) by fmsmga002.fm.intel.com with ESMTP; 12 Feb 2016 20:59:23 -0800 Date: Fri, 12 Feb 2016 21:59:12 -0700 From: Ross Zwisler To: Dave Chinner Cc: Ross Zwisler , Jan Kara , linux-kernel@vger.kernel.org, Theodore Ts'o , Alexander Viro , Andreas Dilger , Andrew Morton , Dan Williams , Jan Kara , Matthew Wilcox , linux-ext4@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux-mm@kvack.org, linux-nvdimm@lists.01.org, xfs@oss.sgi.com Subject: Re: [PATCH v2 0/2] DAX bdev fixes - move flushing calls to FS Message-ID: <20160213045912.GA22595@linux.intel.com> X-ASG-Orig-Subj: Re: [PATCH v2 0/2] DAX bdev fixes - move flushing calls to FS Mail-Followup-To: Ross Zwisler , Dave Chinner , Jan Kara , linux-kernel@vger.kernel.org, Theodore Ts'o , Alexander Viro , Andreas Dilger , Andrew Morton , Dan Williams , Jan Kara , Matthew Wilcox , linux-ext4@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux-mm@kvack.org, linux-nvdimm@lists.01.org, xfs@oss.sgi.com References: <1455137336-28720-1-git-send-email-ross.zwisler@linux.intel.com> <20160211124304.GI21760@quack.suse.cz> <20160212190320.GA24857@linux.intel.com> <20160213023849.GD14668@dastard> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20160213023849.GD14668@dastard> User-Agent: Mutt/1.5.24 (2015-08-30) X-Barracuda-Connect: mga02.intel.com[134.134.136.20] X-Barracuda-Start-Time: 1455339564 X-Barracuda-URL: https://192.48.157.11:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-BRTS-Status: 1 On Sat, Feb 13, 2016 at 01:38:49PM +1100, Dave Chinner wrote: > On Fri, Feb 12, 2016 at 12:03:20PM -0700, Ross Zwisler wrote: > > On Thu, Feb 11, 2016 at 01:43:04PM +0100, Jan Kara wrote: > > > On Wed 10-02-16 13:48:54, Ross Zwisler wrote: > > > > 3) In filemap_write_and_wait() and filemap_write_and_wait_range(), continue > > > > the writeback in the case that DAX is enabled but we only have a nonzero > > > > mapping->nrpages. As with 1) and 2), I believe this is necessary to > > > > properly writeback metadata changes. If this sounds wrong, please let me > > > > know and I'll get more info. > > > > > > And I'm surprised here as well. If there are dax_mapping() inodes that have > > > pagecache pages, then we have issues with radix tree handling as well. So > > > how come dax_mapping() inodes have pages attached? If it is about block > > > device inodes, then I find it buggy, that S_DAX gets set for such inodes > > > when filesystem is mounted on them because in such cases we are IMO asking > > > for data corruption sooner rather than later... > > > > I think I've figured this one out, at least partially. > > > > For ext2 the issues I was seeing were due to the fact that directory inodes > > have S_DAX set, but have dirty page cache pages. In testing with > > generic/002, I see two ext2 inodes with S_DAX trying to do a writeback while > > they have dirty page cache pages. The first has i_ino=2, which is the > > EXT2_ROOT_INO. > .... > > As far as I can see, XFS does not have these issues - returning immediately > > having done just the DAX writeback in xfs_vm_writepages() lets all my xfstests > > pass. > > XFS will not have issues because it does not dirty directory inodes > at the VFS level, nor does it use the page cache for directory data. > However, looking at the code I think it does still set S_DAX on > directory inodes, which it shouldn't be doing. > > I've got a couple of fixes I need to do in this area - hopefully > I'll get it done on Monday. Cool. I've got a quick patch that stops S_DAX from being set on everything but regular inodes for ext2 and ext4. This solved a lot of my xfstests failures. Even after that I'm seeing two last failures with ext4 - I'll keep working on those. - Ross From BATV+26f74415b559ea5ce33e+4556+infradead.org+hch@bombadil.srs.infradead.org Sat Feb 13 01:48:35 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=ham version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay1.corp.sgi.com [137.38.102.111]) by oss.sgi.com (Postfix) with ESMTP id 2CF657CA2 for ; Sat, 13 Feb 2016 01:48:35 -0600 (CST) Received: from cuda.sgi.com (cuda1.sgi.com [192.48.157.11]) by relay1.corp.sgi.com (Postfix) with ESMTP id 0D3F88F8039 for ; Fri, 12 Feb 2016 23:48:31 -0800 (PST) X-ASG-Debug-ID: 1455349709-04bdf066ea99d10001-NocioJ Received: from bombadil.infradead.org ([198.137.202.9]) by cuda.sgi.com with ESMTP id GcwZFvPtZhyxA4F2 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128 verify=NO) for ; Fri, 12 Feb 2016 23:48:29 -0800 (PST) X-Barracuda-Envelope-From: BATV+26f74415b559ea5ce33e+4556+infradead.org+hch@bombadil.srs.infradead.org X-Barracuda-Apparent-Source-IP: 198.137.202.9 Received: from hch by bombadil.infradead.org with local (Exim 4.80.1 #2 (Red Hat Linux)) id 1aUUwN-00033E-Si; Sat, 13 Feb 2016 07:48:27 +0000 Date: Fri, 12 Feb 2016 23:48:27 -0800 From: Christoph Hellwig To: Dave Chinner Cc: Christoph Hellwig , "Darrick J. Wong" , xfs@oss.sgi.com Subject: Re: block allocations for the refcount btree Message-ID: <20160213074827.GA11543@infradead.org> X-ASG-Orig-Subj: Re: block allocations for the refcount btree References: <20160210093011.GA19147@infradead.org> <20160210095010.GC23904@birch.djwong.org> <20160210190738.GA13051@infradead.org> <20160210214058.GN14668@dastard> <20160212191046.GA28421@infradead.org> <20160213023310.GC14668@dastard> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20160213023310.GC14668@dastard> User-Agent: Mutt/1.5.24 (2015-08-30) X-SRS-Rewrite: SMTP reverse-path rewritten from by bombadil.infradead.org See http://www.infradead.org/rpr.html X-Barracuda-Connect: UNKNOWN[198.137.202.9] X-Barracuda-Start-Time: 1455349709 X-Barracuda-Encrypted: ECDHE-RSA-AES128-GCM-SHA256 X-Barracuda-URL: https://192.48.157.11:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-BRTS-Status: 1 X-Barracuda-Spam-Score: 0.10 X-Barracuda-Spam-Status: No, SCORE=0.10 using per-user scores of TAG_LEVEL=1000.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.7 tests=BSF_SC0_MISMATCH_TO, RDNS_NONE X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.3.26995 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 0.00 BSF_SC0_MISMATCH_TO Envelope rcpt doesn't match header 0.10 RDNS_NONE Delivered to trusted network by a host with no rDNS On Sat, Feb 13, 2016 at 01:33:10PM +1100, Dave Chinner wrote: > > allocate an extent (or rather just a single block) in xfs_alloc_ag_vextent > > as called from xfs_refcountbt_alloc_block. The reservation helps us to > > ensure this block is always available, but we still need to account for > > that in xfs_trans_reserve(), which we currently don't do for itruncate > > transactions. > > Ok, so we may have two different issues with a similar failure > symptom. As it is, I don't think this is a show stopper - we're > expecting to find these sorts of issues as we go along (hence the > experimental tag on the feature) and I think, at this point, getting > review and an initial merge done is more important... This triggers 100% reproducible over NFS, and as outlined I'm also pretty sure about the root cause. I don't think this is something to be ignored. From BATV+26f74415b559ea5ce33e+4556+infradead.org+hch@bombadil.srs.infradead.org Sat Feb 13 02:02:24 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=ham version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay3.corp.sgi.com [198.149.34.15]) by oss.sgi.com (Postfix) with ESMTP id 43C9D7CA2 for ; Sat, 13 Feb 2016 02:02:24 -0600 (CST) Received: from cuda.sgi.com (cuda3.sgi.com [192.48.176.15]) by relay3.corp.sgi.com (Postfix) with ESMTP id C49B6AC002 for ; Sat, 13 Feb 2016 00:02:20 -0800 (PST) X-ASG-Debug-ID: 1455350536-04cb6c1e56a53a0001-NocioJ Received: from bombadil.infradead.org ([198.137.202.9]) by cuda.sgi.com with ESMTP id EqGQI4PrcEiqAYry (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128 verify=NO) for ; Sat, 13 Feb 2016 00:02:16 -0800 (PST) X-Barracuda-Envelope-From: BATV+26f74415b559ea5ce33e+4556+infradead.org+hch@bombadil.srs.infradead.org X-Barracuda-Apparent-Source-IP: 198.137.202.9 Received: from hch by bombadil.infradead.org with local (Exim 4.80.1 #2 (Red Hat Linux)) id 1aUV9j-0000hu-2X; Sat, 13 Feb 2016 08:02:15 +0000 Date: Sat, 13 Feb 2016 00:02:15 -0800 From: Christoph Hellwig To: "Darrick J. Wong" Cc: Dave Chinner , xfs@oss.sgi.com Subject: Re: block allocations for the refcount btree Message-ID: <20160213080215.GA2151@infradead.org> X-ASG-Orig-Subj: Re: block allocations for the refcount btree References: <20160210093011.GA19147@infradead.org> <20160210095010.GC23904@birch.djwong.org> <20160210190738.GA13051@infradead.org> <20160210214058.GN14668@dastard> <20160212191046.GA28421@infradead.org> <20160213023310.GC14668@dastard> <20160213044400.GJ6350@birch.djwong.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20160213044400.GJ6350@birch.djwong.org> User-Agent: Mutt/1.5.24 (2015-08-30) X-SRS-Rewrite: SMTP reverse-path rewritten from by bombadil.infradead.org See http://www.infradead.org/rpr.html X-Barracuda-Connect: UNKNOWN[198.137.202.9] X-Barracuda-Start-Time: 1455350536 X-Barracuda-Encrypted: ECDHE-RSA-AES128-GCM-SHA256 X-Barracuda-URL: https://192.48.176.15:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-BRTS-Status: 1 X-Barracuda-Spam-Score: 0.10 X-Barracuda-Spam-Status: No, SCORE=0.10 using per-user scores of TAG_LEVEL=1000.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.7 tests=BSF_SC0_MISMATCH_TO, RDNS_NONE X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.3.26996 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 0.00 BSF_SC0_MISMATCH_TO Envelope rcpt doesn't match header 0.10 RDNS_NONE Delivered to trusted network by a host with no rDNS On Fri, Feb 12, 2016 at 08:44:00PM -0800, Darrick J. Wong wrote: > Brain dead, going to bed. Next on my list is to rebase the more stable > parts of the patchset against Dave's for-4.6 branch and do another mass > mailing. Yes, it would be great the prep work into for-next ASAP. Another important thing would be to rebase on the writepage changes now that they are basically ready to be merged. From BATV+26f74415b559ea5ce33e+4556+infradead.org+hch@bombadil.srs.infradead.org Sat Feb 13 02:03:29 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=ham version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay2.corp.sgi.com [137.38.102.29]) by oss.sgi.com (Postfix) with ESMTP id 6F69E7CA2 for ; Sat, 13 Feb 2016 02:03:29 -0600 (CST) Received: from cuda.sgi.com (cuda3.sgi.com [192.48.176.15]) by relay2.corp.sgi.com (Postfix) with ESMTP id 5D526304051 for ; Sat, 13 Feb 2016 00:03:26 -0800 (PST) X-ASG-Debug-ID: 1455350603-04cb6c1e58a53d0001-NocioJ Received: from bombadil.infradead.org ([198.137.202.9]) by cuda.sgi.com with ESMTP id egHKaO6SL5K8tXbR (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128 verify=NO) for ; Sat, 13 Feb 2016 00:03:23 -0800 (PST) X-Barracuda-Envelope-From: BATV+26f74415b559ea5ce33e+4556+infradead.org+hch@bombadil.srs.infradead.org X-Barracuda-Apparent-Source-IP: 198.137.202.9 Received: from hch by bombadil.infradead.org with local (Exim 4.80.1 #2 (Red Hat Linux)) id 1aUVAn-0000n0-GJ; Sat, 13 Feb 2016 08:03:21 +0000 Date: Sat, 13 Feb 2016 00:03:21 -0800 From: Christoph Hellwig To: "Darrick J. Wong" Cc: Dave Chinner , fstests@vger.kernel.org, linux-btrfs@vger.kernel.org, xfs@oss.sgi.com Subject: Re: [PATCH v4.2 00/32] xfstests: test the nfs/cifs/btrfs/xfs reflink/dedupe ioctls Message-ID: <20160213080321.GB2151@infradead.org> X-ASG-Orig-Subj: Re: [PATCH v4.2 00/32] xfstests: test the nfs/cifs/btrfs/xfs reflink/dedupe ioctls References: <20160211233916.2202.40961.stgit@birch.djwong.org> <20160213012659.GA14668@dastard> <20160213043834.GC26204@birch.djwong.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20160213043834.GC26204@birch.djwong.org> User-Agent: Mutt/1.5.24 (2015-08-30) X-SRS-Rewrite: SMTP reverse-path rewritten from by bombadil.infradead.org See http://www.infradead.org/rpr.html X-Barracuda-Connect: UNKNOWN[198.137.202.9] X-Barracuda-Start-Time: 1455350603 X-Barracuda-Encrypted: ECDHE-RSA-AES128-GCM-SHA256 X-Barracuda-URL: https://192.48.176.15:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-BRTS-Status: 1 X-Barracuda-Spam-Score: 0.10 X-Barracuda-Spam-Status: No, SCORE=0.10 using per-user scores of TAG_LEVEL=1000.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.7 tests=BSF_SC0_MISMATCH_TO, RDNS_NONE X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.3.26996 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 0.00 BSF_SC0_MISMATCH_TO Envelope rcpt doesn't match header 0.10 RDNS_NONE Delivered to trusted network by a host with no rDNS On Fri, Feb 12, 2016 at 08:38:34PM -0800, Darrick J. Wong wrote: > > Followup patch, anyway, because I'm about to push out everything > > that was in your second pull req (i.e. with the aiocp fix). > > xfs_io "bmap -c" is a new switch that dumps the CoW fork of a file. > AFAICT there isn't any way to check that an xfs_io command supports > a particular switch, though it wouldn't be difficult to add a check. Just test for it the same way we test for the existance of xfs_io subcommmand. From BATV+21c215a006f14cf814be+4556+infradead.org+hch@casper.srs.infradead.org Sat Feb 13 06:09:55 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=ham version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay3.corp.sgi.com [198.149.34.15]) by oss.sgi.com (Postfix) with ESMTP id EEB8B7CA2 for ; Sat, 13 Feb 2016 06:09:54 -0600 (CST) Received: from cuda.sgi.com (cuda3.sgi.com [192.48.176.15]) by relay3.corp.sgi.com (Postfix) with ESMTP id 725D6AC004 for ; Sat, 13 Feb 2016 04:09:51 -0800 (PST) X-ASG-Debug-ID: 1455365383-04cb6c1e56a86f0001-NocioJ Received: from casper.infradead.org (casper.infradead.org [85.118.1.10]) by cuda.sgi.com with ESMTP id KCrVjQveWWNr6GhE (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128 verify=NO) for ; Sat, 13 Feb 2016 04:09:44 -0800 (PST) X-Barracuda-Envelope-From: BATV+21c215a006f14cf814be+4556+infradead.org+hch@casper.srs.infradead.org X-Barracuda-Apparent-Source-IP: 85.118.1.10 Received: from 178.115.128.223.wireless.dyn.drei.com ([178.115.128.223] helo=localhost) by casper.infradead.org with esmtpsa (Exim 4.85 #2 (Red Hat Linux)) id 1aUZ1C-0008EZ-VX for xfs@oss.sgi.com; Sat, 13 Feb 2016 12:09:43 +0000 From: Christoph Hellwig To: xfs@oss.sgi.com Subject: [PATCH] xfs: remove xfs_trans_get_block_res Date: Sat, 13 Feb 2016 13:09:41 +0100 X-ASG-Orig-Subj: [PATCH] xfs: remove xfs_trans_get_block_res Message-Id: <1455365381-12592-1-git-send-email-hch@lst.de> X-Mailer: git-send-email 2.1.4 X-SRS-Rewrite: SMTP reverse-path rewritten from by casper.infradead.org. See http://www.infradead.org/rpr.html X-Barracuda-Connect: casper.infradead.org[85.118.1.10] X-Barracuda-Start-Time: 1455365384 X-Barracuda-Encrypted: ECDHE-RSA-AES128-GCM-SHA256 X-Barracuda-URL: https://192.48.176.15:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-BRTS-Status: 1 X-Barracuda-Spam-Score: 0.00 X-Barracuda-Spam-Status: No, SCORE=0.00 using per-user scores of TAG_LEVEL=1000.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.7 tests= X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.3.27000 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- Just use the t_blk_res field directly instead of obsfucating the reference by a macro. Signed-off-by: Christoph Hellwig --- fs/xfs/libxfs/xfs_bmap.c | 6 +++--- fs/xfs/libxfs/xfs_bmap_btree.c | 4 ++-- fs/xfs/xfs_trans.h | 1 - 3 files changed, 5 insertions(+), 6 deletions(-) diff --git a/fs/xfs/libxfs/xfs_bmap.c b/fs/xfs/libxfs/xfs_bmap.c index 3e89e0e..a0fa2f5 100644 --- a/fs/xfs/libxfs/xfs_bmap.c +++ b/fs/xfs/libxfs/xfs_bmap.c @@ -5707,7 +5707,7 @@ xfs_bunmapi( * This is better than zeroing it. */ ASSERT(del.br_state == XFS_EXT_NORM); - ASSERT(xfs_trans_get_block_res(tp) > 0); + ASSERT(tp->t_blk_res > 0); /* * If this spans a realtime extent boundary, * chop it back to the start of the one we end at. @@ -5738,7 +5738,7 @@ xfs_bunmapi( del.br_startblock += mod; } else if ((del.br_startoff == start && (del.br_state == XFS_EXT_UNWRITTEN || - xfs_trans_get_block_res(tp) == 0)) || + tp->t_blk_res == 0)) || !xfs_sb_version_hasextflgbit(&mp->m_sb)) { /* * Can't make it unwritten. There isn't @@ -5829,7 +5829,7 @@ xfs_bunmapi( * conversion to btree format, since the transaction * will be dirty. */ - if (!wasdel && xfs_trans_get_block_res(tp) == 0 && + if (!wasdel && tp->t_blk_res == 0 && XFS_IFORK_FORMAT(ip, whichfork) == XFS_DINODE_FMT_EXTENTS && XFS_IFORK_NEXTENTS(ip, whichfork) >= /* Note the >= */ XFS_IFORK_MAXEXT(ip, whichfork) && diff --git a/fs/xfs/libxfs/xfs_bmap_btree.c b/fs/xfs/libxfs/xfs_bmap_btree.c index 77a8c63..5dcbfae 100644 --- a/fs/xfs/libxfs/xfs_bmap_btree.c +++ b/fs/xfs/libxfs/xfs_bmap_btree.c @@ -464,7 +464,7 @@ try_another_ag: * reservation amount is insufficient then we may fail a * block allocation here and corrupt the filesystem. */ - args.minleft = xfs_trans_get_block_res(args.tp); + args.minleft = args.tp->t_blk_res; } else if (cur->bc_private.b.flist->xbf_low) { args.type = XFS_ALLOCTYPE_START_BNO; } else { @@ -473,7 +473,7 @@ try_another_ag: args.minlen = args.maxlen = args.prod = 1; args.wasdel = cur->bc_private.b.flags & XFS_BTCUR_BPRV_WASDEL; - if (!args.wasdel && xfs_trans_get_block_res(args.tp) == 0) { + if (!args.wasdel && args.tp->t_blk_res == 0) { error = -ENOSPC; goto error0; } diff --git a/fs/xfs/xfs_trans.h b/fs/xfs/xfs_trans.h index 50fe77e..d49dfef 100644 --- a/fs/xfs/xfs_trans.h +++ b/fs/xfs/xfs_trans.h @@ -133,7 +133,6 @@ typedef struct xfs_trans { * XFS transaction mechanism exported interfaces that are * actually macros. */ -#define xfs_trans_get_block_res(tp) ((tp)->t_blk_res) #define xfs_trans_set_sync(tp) ((tp)->t_flags |= XFS_TRANS_SYNC) #if defined(DEBUG) || defined(XFS_WARN) -- 2.1.4 From zlang@redhat.com Sat Feb 13 09:13:21 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=ham version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay2.corp.sgi.com [137.38.102.29]) by oss.sgi.com (Postfix) with ESMTP id 306647CA2 for ; Sat, 13 Feb 2016 09:13:21 -0600 (CST) Received: from cuda.sgi.com (cuda3.sgi.com [192.48.176.15]) by relay2.corp.sgi.com (Postfix) with ESMTP id 2083B304048 for ; Sat, 13 Feb 2016 07:13:17 -0800 (PST) X-ASG-Debug-ID: 1455376392-04cb6c1e58aac30001-NocioJ Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by cuda.sgi.com with ESMTP id 1fbSsIYu5GQEBkrC (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO) for ; Sat, 13 Feb 2016 07:13:13 -0800 (PST) X-Barracuda-Envelope-From: zlang@redhat.com X-Barracuda-Apparent-Source-IP: 209.132.183.28 X-ASG-Whitelist: Client Received: from int-mx14.intmail.prod.int.phx2.redhat.com (int-mx14.intmail.prod.int.phx2.redhat.com [10.5.11.27]) by mx1.redhat.com (Postfix) with ESMTPS id 3CDCB300AAA for ; Sat, 13 Feb 2016 15:13:12 +0000 (UTC) Received: from localhost (vpn1-7-89.pek2.redhat.com [10.72.7.89]) by int-mx14.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id u1DFDA9v000963; Sat, 13 Feb 2016 10:13:11 -0500 From: Zorro Lang To: xfs@oss.sgi.com Cc: sandeen@redhat.com, Zorro Lang Subject: [PATCH v2] xfs_quota: modify commands which can't handle multiple types Date: Sat, 13 Feb 2016 23:13:08 +0800 X-ASG-Orig-Subj: [PATCH v2] xfs_quota: modify commands which can't handle multiple types Message-Id: <1455376388-4712-1-git-send-email-zlang@redhat.com> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.27 X-Barracuda-Connect: mx1.redhat.com[209.132.183.28] X-Barracuda-Start-Time: 1455376393 X-Barracuda-Encrypted: ECDHE-RSA-AES256-GCM-SHA384 X-Barracuda-URL: https://192.48.176.15:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-BRTS-Status: 1 Some xfs_quota commands can't deal with multiple types together. For example, if we run "limit -ug ...", one type will overwrite the other. I find below commands can't handle multiple types: [quota, limit, timer, warn, dump, restore and quot] (Although timer and warn command can't support -ugp types until now, it will in one day.) For every single $command, I change their ${command}_f function, ${command}_cmd structure and man page. Signed-off-by: Zorro Lang --- man/man8/xfs_quota.8 | 14 ++++++------ quota/edit.c | 60 ++++++++++++++++++++++++++++++++++------------------ quota/quot.c | 15 ++++++++----- quota/quota.c | 15 ++++++++----- quota/report.c | 20 ++++++++++++------ 5 files changed, 81 insertions(+), 43 deletions(-) diff --git a/man/man8/xfs_quota.8 b/man/man8/xfs_quota.8 index 3bee145..70a2eb5 100644 --- a/man/man8/xfs_quota.8 +++ b/man/man8/xfs_quota.8 @@ -169,7 +169,7 @@ command. .HP .B quota [ -.B \-gpu +.BR "\-g | \-p | \-u" ] [ .B \-bir ] [ @@ -398,7 +398,7 @@ option reports state on all filesystems and not just the current path. .B limit [ -.B \-gpu +.BR "\-g | \-p | \-u" ] .BI bsoft= N | @@ -430,7 +430,7 @@ must be specified. .HP .B timer [ -.B \-gpu +.BR "\-g | \-p | \-u" ] [ .B \-bir ] @@ -446,7 +446,7 @@ command. The value argument is a number of seconds, but units of .HP .B warn [ -.B \-gpu +.BR "\-g | \-p | \-u" ] [ .B \-bir ] @@ -497,7 +497,7 @@ report an error. .B dump [ -.B \-gpu +.BR "\-g | \-p | \-u" ] [ .B \-f .I file @@ -510,7 +510,7 @@ This is only the limits, not the usage information, of course. .HP .B restore [ -.B \-gpu +.BR "\-g | \-p | \-u" ] [ .B \-f .I file @@ -525,7 +525,7 @@ command. .B quot [ -.B \-gpu +.BR "\-g | \-p | \-u" ] [ .B \-bir ] [ diff --git a/quota/edit.c b/quota/edit.c index 6146f7e..e5ddc8c 100644 --- a/quota/edit.c +++ b/quota/edit.c @@ -282,13 +282,13 @@ limit_f( flags |= DEFAULTS_FLAG; break; case 'g': - type = XFS_GROUP_QUOTA; + type |= XFS_GROUP_QUOTA; break; case 'p': - type = XFS_PROJ_QUOTA; + type |= XFS_PROJ_QUOTA; break; case 'u': - type = XFS_USER_QUOTA; + type |= XFS_USER_QUOTA; break; default: return command_usage(&limit_cmd); @@ -343,8 +343,13 @@ limit_f( name = (flags & DEFAULTS_FLAG) ? "0" : argv[optind++]; - if (!type) + if (!type) { type = XFS_USER_QUOTA; + } else if (type != XFS_GROUP_QUOTA && + type != XFS_PROJ_QUOTA && + type != XFS_USER_QUOTA) { + return command_usage(&limit_cmd); + } switch (type) { case XFS_USER_QUOTA: @@ -422,13 +427,13 @@ restore_f( fname = optarg; break; case 'g': - type = XFS_GROUP_QUOTA; + type |= XFS_GROUP_QUOTA; break; case 'p': - type = XFS_PROJ_QUOTA; + type |= XFS_PROJ_QUOTA; break; case 'u': - type = XFS_USER_QUOTA; + type |= XFS_USER_QUOTA; break; default: return command_usage(&restore_cmd); @@ -438,8 +443,13 @@ restore_f( if (argc < optind) return command_usage(&restore_cmd); - if (!type) + if (!type) { type = XFS_USER_QUOTA; + } else if (type != XFS_GROUP_QUOTA && + type != XFS_PROJ_QUOTA && + type != XFS_USER_QUOTA) { + return command_usage(&restore_cmd); + } if (fname) { if ((fp = fopen(fname, "r")) == NULL) { @@ -501,13 +511,13 @@ timer_f( mask |= FS_DQ_RTBTIMER; break; case 'g': - type = XFS_GROUP_QUOTA; + type |= XFS_GROUP_QUOTA; break; case 'p': - type = XFS_PROJ_QUOTA; + type |= XFS_PROJ_QUOTA; break; case 'u': - type = XFS_USER_QUOTA; + type |= XFS_USER_QUOTA; break; default: return command_usage(&timer_cmd); @@ -522,8 +532,13 @@ timer_f( if (!mask) mask = FS_DQ_TIMER_MASK; - if (!type) + if (!type) { type = XFS_USER_QUOTA; + } else if (type != XFS_GROUP_QUOTA && + type != XFS_PROJ_QUOTA && + type != XFS_USER_QUOTA) { + return command_usage(&timer_cmd); + } set_timer(type, mask, fs_path->fs_name, value); return 0; @@ -630,13 +645,13 @@ warn_f( mask |= FS_DQ_RTBWARNS; break; case 'g': - type = XFS_GROUP_QUOTA; + type |= XFS_GROUP_QUOTA; break; case 'p': - type = XFS_PROJ_QUOTA; + type |= XFS_PROJ_QUOTA; break; case 'u': - type = XFS_USER_QUOTA; + type |= XFS_USER_QUOTA; break; default: return command_usage(&warn_cmd); @@ -661,8 +676,13 @@ warn_f( if (!mask) mask = FS_DQ_WARNS_MASK; - if (!type) + if (!type) { type = XFS_USER_QUOTA; + } else if (type != XFS_GROUP_QUOTA && + type != XFS_PROJ_QUOTA && + type != XFS_USER_QUOTA) { + return command_usage(&warn_cmd); + } switch (type) { case XFS_USER_QUOTA: @@ -686,7 +706,7 @@ edit_init(void) limit_cmd.argmin = 2; limit_cmd.argmax = -1; limit_cmd.args = \ - _("[-gpu] bsoft|bhard|isoft|ihard|rtbsoft|rtbhard=N -d|id|name"); + _("[-g|-p|-u] bsoft|bhard|isoft|ihard|rtbsoft|rtbhard=N -d|id|name"); limit_cmd.oneline = _("modify quota limits"); limit_cmd.help = limit_help; @@ -694,14 +714,14 @@ edit_init(void) restore_cmd.cfunc = restore_f; restore_cmd.argmin = 0; restore_cmd.argmax = -1; - restore_cmd.args = _("[-gpu] [-f file]"); + restore_cmd.args = _("[-g|-p|-u] [-f file]"); restore_cmd.oneline = _("restore quota limits from a backup file"); timer_cmd.name = "timer"; timer_cmd.cfunc = timer_f; timer_cmd.argmin = 2; timer_cmd.argmax = -1; - timer_cmd.args = _("[-bir] [-gpu] value"); + timer_cmd.args = _("[-bir] [-g|-p|-u] value"); timer_cmd.oneline = _("set quota enforcement timeouts"); timer_cmd.help = timer_help; @@ -709,7 +729,7 @@ edit_init(void) warn_cmd.cfunc = warn_f; warn_cmd.argmin = 2; warn_cmd.argmax = -1; - warn_cmd.args = _("[-bir] [-gpu] value -d|id|name"); + warn_cmd.args = _("[-bir] [-g|-p|-u] value -d|id|name"); warn_cmd.oneline = _("get/set enforcement warning counter"); warn_cmd.help = warn_help; diff --git a/quota/quot.c b/quota/quot.c index 9116e48..2e583e5 100644 --- a/quota/quot.c +++ b/quota/quot.c @@ -361,13 +361,13 @@ quot_f( form |= XFS_RTBLOCK_QUOTA; break; case 'g': - type = XFS_GROUP_QUOTA; + type |= XFS_GROUP_QUOTA; break; case 'p': - type = XFS_PROJ_QUOTA; + type |= XFS_PROJ_QUOTA; break; case 'u': - type = XFS_USER_QUOTA; + type |= XFS_USER_QUOTA; break; case 'a': flags |= ALL_MOUNTS_FLAG; @@ -389,8 +389,13 @@ quot_f( if (!form) form = XFS_BLOCK_QUOTA; - if (!type) + if (!type) { type = XFS_USER_QUOTA; + } else if (type != XFS_GROUP_QUOTA && + type != XFS_PROJ_QUOTA && + type != XFS_USER_QUOTA) { + return command_usage("_cmd); + } if ((fp = fopen_write_secure(fname)) == NULL) return 0; @@ -416,7 +421,7 @@ quot_init(void) quot_cmd.cfunc = quot_f; quot_cmd.argmin = 0; quot_cmd.argmax = -1; - quot_cmd.args = _("[-bir] [-gpu] [-acv] [-f file]"); + quot_cmd.args = _("[-bir] [-g|-p|-u] [-acv] [-f file]"); quot_cmd.oneline = _("summarize filesystem ownership"); quot_cmd.help = quot_help; diff --git a/quota/quota.c b/quota/quota.c index f6b24c3..e0da7c0 100644 --- a/quota/quota.c +++ b/quota/quota.c @@ -409,13 +409,13 @@ quota_f( form |= XFS_RTBLOCK_QUOTA; break; case 'g': - type = XFS_GROUP_QUOTA; + type |= XFS_GROUP_QUOTA; break; case 'p': - type = XFS_PROJ_QUOTA; + type |= XFS_PROJ_QUOTA; break; case 'u': - type = XFS_USER_QUOTA; + type |= XFS_USER_QUOTA; break; case 'h': flags |= HUMAN_FLAG; @@ -437,8 +437,13 @@ quota_f( if (!form) form = XFS_BLOCK_QUOTA; - if (!type) + if (!type) { type = XFS_USER_QUOTA; + } else if (type != XFS_GROUP_QUOTA && + type != XFS_PROJ_QUOTA && + type != XFS_USER_QUOTA) { + return command_usage("a_cmd); + } if ((fp = fopen_write_secure(fname)) == NULL) return 0; @@ -461,7 +466,7 @@ quota_init(void) quota_cmd.cfunc = quota_f; quota_cmd.argmin = 0; quota_cmd.argmax = -1; - quota_cmd.args = _("[-bir] [-gpu] [-hnNv] [-f file] [id|name]..."); + quota_cmd.args = _("[-bir] [-g|-p|-u] [-hnNv] [-f file] [id|name]..."); quota_cmd.oneline = _("show usage and limits"); quota_cmd.help = quota_help; diff --git a/quota/report.c b/quota/report.c index 8653134..48a3f29 100644 --- a/quota/report.c +++ b/quota/report.c @@ -30,7 +30,7 @@ static cmdinfo_t report_cmd; static void dump_help(void) { - dump_cmd.args = _("[-gpu] [-f file]"); + dump_cmd.args = _("[-g|-p|-u] [-f file]"); dump_cmd.oneline = _("dump quota information for backup utilities"); printf(_( "\n" @@ -199,7 +199,7 @@ dump_f( FILE *fp; char *fname = NULL; uint lower = 0, upper = 0; - int c, type = XFS_USER_QUOTA; + int c, type = 0; while ((c = getopt(argc, argv, "f:gpuL:U:")) != EOF) { switch(c) { @@ -207,13 +207,13 @@ dump_f( fname = optarg; break; case 'g': - type = XFS_GROUP_QUOTA; + type |= XFS_GROUP_QUOTA; break; case 'p': - type = XFS_PROJ_QUOTA; + type |= XFS_PROJ_QUOTA; break; case 'u': - type = XFS_USER_QUOTA; + type |= XFS_USER_QUOTA; break; case 'L': lower = (uint)atoi(optarg); @@ -229,6 +229,14 @@ dump_f( if (argc != optind) return command_usage(&dump_cmd); + if (!type) { + type = XFS_USER_QUOTA; + } else if (type != XFS_GROUP_QUOTA && + type != XFS_PROJ_QUOTA && + type != XFS_USER_QUOTA) { + return command_usage(&dump_cmd); + } + if ((fp = fopen_write_secure(fname)) == NULL) return 0; @@ -725,7 +733,7 @@ report_init(void) dump_cmd.cfunc = dump_f; dump_cmd.argmin = 0; dump_cmd.argmax = -1; - dump_cmd.args = _("[-gpu] [-f file]"); + dump_cmd.args = _("[-g|-p|-u] [-f file]"); dump_cmd.oneline = _("dump quota information for backup utilities"); dump_cmd.help = dump_help; -- 1.9.3 From j.rosenboom@x-ion.de Sat Feb 13 11:09:27 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=T_DKIM_INVALID autolearn=ham version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay3.corp.sgi.com [198.149.34.15]) by oss.sgi.com (Postfix) with ESMTP id 6A8847CA2 for ; Sat, 13 Feb 2016 11:09:27 -0600 (CST) Received: from cuda.sgi.com (cuda1.sgi.com [192.48.157.11]) by relay3.corp.sgi.com (Postfix) with ESMTP id 17528AC003 for ; Sat, 13 Feb 2016 09:09:23 -0800 (PST) X-ASG-Debug-ID: 1455383358-04bdf066eaa1c80001-NocioJ Received: from mail-lf0-f48.google.com (mail-lf0-f48.google.com [209.85.215.48]) by cuda.sgi.com with ESMTP id bP75vMWQsdExCk0P (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128 verify=NO) for ; Sat, 13 Feb 2016 09:09:19 -0800 (PST) X-Barracuda-Envelope-From: j.rosenboom@x-ion.de X-Barracuda-Apparent-Source-IP: 209.85.215.48 Received: by mail-lf0-f48.google.com with SMTP id m1so68534316lfg.0 for ; Sat, 13 Feb 2016 09:09:19 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=x-ion-de.20150623.gappssmtp.com; s=20150623; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=r6o8szmXGURQaFeZvBbFBx574HVjQtvnRycoDz5B6vI=; b=ssSYLU1khtzJYN8+A+jhehSZu+GAgfdLFhJbg/7U3vZJ/Of/G82w+WrUqYg9J0g20t /TI0onuzittrZB9nE/df8Ob8n6Gi//sHrp5l+kSAvGsBOBu3uB05N+BfG8Dr6IrfF/vP hfzGv9F/WkabPRbi5XE3cXuQzHipj9Y1bQfIgstRkdi2Opt87DC7ygQ9QxcvC06mbKkc cibZeMS1u13lV6AzuSkIFfzEDERWA7mdaxI/OTnh6LBqx6bRG1z/WZ1y+1bcTum74hGq XkWdclV0diaxoA+TzUjPRDlt8QmlgM5EZINlG2k41dQXvPZ+i+mXV7PfIAC8JL04fjEz KW6A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:date :message-id:subject:from:to:cc:content-type; bh=r6o8szmXGURQaFeZvBbFBx574HVjQtvnRycoDz5B6vI=; b=dflWl44kGNI0PvlHdcmje7Zr4ObbU51Jqd++8j65eY/yp+gbfgFt/NEoFjnrRmBzmD LjMEQnChff1apvKa2kc5xWbBdpvnbE8E+dtQwekMtkTU+bhbNYsHEoYUak5yHqTbPw6Z a9vOxL2yZ8R8TwsDE2kccNu/Nc/tP0fpA6TolVKte9bTaxFb3UeVOhO5Qhy5tR9iHsR4 kgj3MEnTN5CgMDAg6qs3hRBXoKF0Rhs4FF2YIr2nJDDdVCSXDBBqroWvtIoBSGeZMTuQ UY2+PI5fCbk8d0cItIAqOC9RsFKPowxrAwyLgBa58ZsOOW4bceYfbnIvGyUO78EOiFwJ JlYw== X-Gm-Message-State: AG10YOS5vXk4jO2rtUCer7tuOtbzSfnVZyFkzfhWQgaTYUWarUCOZqLO8Za7rZisM/jE0mSIlrBF53uA/nPEww== MIME-Version: 1.0 X-Received: by 10.25.157.79 with SMTP id g76mr3541915lfe.93.1455383357582; Sat, 13 Feb 2016 09:09:17 -0800 (PST) Received: by 10.25.8.7 with HTTP; Sat, 13 Feb 2016 09:09:17 -0800 (PST) In-Reply-To: <20160126141733.GA48264@bfoster.bfoster> References: <1453177919-17849-1-git-send-email-david@fromorbit.com> <20160120015853.GU6033@dastard> <20160126141733.GA48264@bfoster.bfoster> Date: Sat, 13 Feb 2016 18:09:17 +0100 Message-ID: Subject: Re: [PATCH v2] [RFC] xfs: allocate log vector buffers outside CIL context lock From: Jens Rosenboom X-ASG-Orig-Subj: Re: [PATCH v2] [RFC] xfs: allocate log vector buffers outside CIL context lock To: Brian Foster Cc: Dave Chinner , xfs@oss.sgi.com Content-Type: text/plain; charset=UTF-8 X-Barracuda-Connect: mail-lf0-f48.google.com[209.85.215.48] X-Barracuda-Start-Time: 1455383359 X-Barracuda-Encrypted: ECDHE-RSA-AES128-GCM-SHA256 X-Barracuda-URL: https://192.48.157.11:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-BRTS-Status: 1 X-Barracuda-Spam-Score: 0.00 X-Barracuda-Spam-Status: No, SCORE=0.00 using per-user scores of TAG_LEVEL=1000.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.7 tests=BSF_SC0_MISMATCH_TO, DKIM_SIGNED, DKIM_VERIFIED X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.3.27005 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 0.00 BSF_SC0_MISMATCH_TO Envelope rcpt doesn't match header -0.00 DKIM_VERIFIED Domain Keys Identified Mail: signature passes verification 0.00 DKIM_SIGNED Domain Keys Identified Mail: message has a signature 2016-01-26 15:17 GMT+01:00 Brian Foster : > On Wed, Jan 20, 2016 at 12:58:53PM +1100, Dave Chinner wrote: >> From: Dave Chinner >> >> One of the problems we currently have with delayed logging is that >> under serious memory pressure we can deadlock memory reclaim. THis >> occurs when memory reclaim (such as run by kswapd) is reclaiming XFS >> inodes and issues a log force to unpin inodes that are dirty in the >> CIL. >> >> The CIL is pushed, but this will only occur once it gets the CIL >> context lock to ensure that all committing transactions are complete >> and no new transactions start being committed to the CIL while the >> push switches to a new context. >> >> The deadlock occurs when the CIL context lock is held by a >> committing process that is doing memory allocation for log vector >> buffers, and that allocation is then blocked on memory reclaim >> making progress. Memory reclaim, however, is blocked waiting for >> a log force to make progress, and so we effectively deadlock at this >> point. >> >> To solve this problem, we have to move the CIL log vector buffer >> allocation outside of the context lock so that memory reclaim can >> always make progress when it needs to force the log. The problem >> with doing this is that a CIL push can take place while we are >> determining if we need to allocate a new log vector buffer for >> an item and hence the current log vector may go away without >> warning. That means we canot rely on the existing log vector being >> present when we finally grab the context lock and so we must have a >> replacement buffer ready to go at all times. >> >> To ensure this, introduce a "shadow log vector" buffer that is >> always guaranteed to be present when we gain the CIL context lock >> and format the item. This shadow buffer may or may not be used >> during the formatting, but if the log item does not have an existing >> log vector buffer or that buffer is too small for the new >> modifications, we swap it for the new shadow buffer and format >> the modifications into that new log vector buffer. >> >> The result of this is that for any object we modify more than once >> in a given CIL checkpoint, we double the memory required >> to track dirty regions in the log. For single modifications then >> we consume the shadow log vectorwe allocate on commit, and that gets >> consumed by the checkpoint. However, if we make multiple >> modifications, then the second transaction commit will allocate a >> shadow log vector and hence we will end up with double the memory >> usage as only one of the log vectors is consumed by the CIL >> checkpoint. The remaining shadow vector will be freed when th elog >> item is freed. >> >> This can probably be optimised - access to the shadow log vector is >> serialised by the object lock (as opposited to the active log >> vector, which is controlled by the CIL context lock) and so we can >> probably free shadow log vector from some objects when the log item >> is marked clean on removal from the AIL. >> >> The patch survives smoke testing and some load testing. I haven't >> done any real performance testing, but I have done some load and low >> memory testing and it hasn't exploded (perf did - it failed several >> order 2 memory allocations, which XFS continued along just fine). >> >> That said, I don't have a reliable deadlock reproducer in the first >> place, so I'm interested i hearing what people think about this >> approach to solve the problem and ways to test and improve it. >> >> Signed-off-by: Dave Chinner >> --- > > This seems reasonable to me in principle. It would be nice to have some > kind of feedback in terms of effectiveness resolving the original > deadlock report. I can't think of a good way of testing short of > actually instrumenting the deadlock one way or another, unfortunately. > Was there a user that might be willing to test or had a detailed enough > description of the workload/environment? We have seen this issue on our production Ceph cluster sporadically and have tried a long time to reproduce it in a lab environment. Now I finally seem to have found a way to reproduce it at least twice in a row. My test cluster is composed of 8 small nodes with 2 SSDs each, so 16 OSDs. One of the nodes runs as rgw and I use cosbench to write objects into the cluster. Running with 32 workers writing 16k-size objects into 100 buckets, I start seeing messages like this after a couple of hours (at this point there are about 10M objects in the cluster): Feb 13 10:51:53 storage-node35 kernel: [10558.479309] XFS: ceph-osd(10078) possible memory allocation deadlock size 32856 in kmem_alloc (mode:0x2408240) Feb 13 10:51:55 storage-node35 kernel: [10560.289810] XFS: ceph-osd(10078) possible memory allocation deadlock size 32856 in kmem_alloc (mode:0x2408240) Feb 13 10:51:55 storage-node35 kernel: [10560.613984] XFS: ceph-osd(10078) possible memory allocation deadlock size 32856 in kmem_alloc (mode:0x2408240) Feb 13 10:51:57 storage-node35 kernel: [10562.614089] XFS: ceph-osd(10078) possible memory allocation deadlock size 32856 in kmem_alloc (mode:0x2408240) Soon after this, operations get so slow that the OSDs die because of their suicide timeouts. Then I installed onto 3 servers this patch (applied onto kernel v4.4.1). The bad news is that I am still getting the kernel messages on these machines. The good news, though, is that they appear at a much lower frequency and also the impact on performance seems to be lower, so the OSD processes on these three nodes did not get killed. I'm going to rerun the test with the patched kernel on all nodes next week, I could also run debug stuff if you have some idea for that. From colin.king@canonical.com Sat Feb 13 14:26:32 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=ham version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay2.corp.sgi.com [137.38.102.29]) by oss.sgi.com (Postfix) with ESMTP id 192F07CA2 for ; Sat, 13 Feb 2016 14:26:32 -0600 (CST) Received: from cuda.sgi.com (cuda1.sgi.com [192.48.157.11]) by relay2.corp.sgi.com (Postfix) with ESMTP id E1B88304059 for ; Sat, 13 Feb 2016 12:26:28 -0800 (PST) X-ASG-Debug-ID: 1455395184-04bdf066eda40e0001-NocioJ Received: from youngberry.canonical.com (youngberry.canonical.com [91.189.89.112]) by cuda.sgi.com with ESMTP id 2Uug9ymIj0HF8iD4 for ; Sat, 13 Feb 2016 12:26:25 -0800 (PST) X-Barracuda-Envelope-From: colin.king@canonical.com X-Barracuda-Apparent-Source-IP: 91.189.89.112 Received: from 1.general.cking.uk.vpn ([10.172.193.212] helo=localhost) by youngberry.canonical.com with esmtpsa (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.76) (envelope-from ) id 1aUglr-0008Jj-57; Sat, 13 Feb 2016 20:26:23 +0000 From: Colin King To: Dave Chinner , xfs@oss.sgi.com Cc: linux-kernel@vger.kernel.org Subject: [PATCH] xfs: fix format specifier , should be %llx and not %llu Date: Sat, 13 Feb 2016 20:26:22 +0000 X-ASG-Orig-Subj: [PATCH] xfs: fix format specifier , should be %llx and not %llu Message-Id: <1455395182-4771-1-git-send-email-colin.king@canonical.com> X-Mailer: git-send-email 2.7.0 X-Barracuda-Connect: youngberry.canonical.com[91.189.89.112] X-Barracuda-Start-Time: 1455395184 X-Barracuda-URL: https://192.48.157.11:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-BRTS-Status: 1 X-Barracuda-Spam-Score: 0.00 X-Barracuda-Spam-Status: No, SCORE=0.00 using per-user scores of TAG_LEVEL=1000.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.7 tests=BSF_SC0_MISMATCH_TO X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.3.27008 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 0.00 BSF_SC0_MISMATCH_TO Envelope rcpt doesn't match header From: Colin Ian King busyp->bno is printed with a %llu format specifier when the intention is to print a hexadecimal value. Trivial fix to use %llx instead. Found with smatch static analysis: fs/xfs/xfs_discard.c:229 xfs_discard_extents() warn: '0x' prefix is confusing together with '%llu' specifier Signed-off-by: Colin Ian King --- fs/xfs/xfs_discard.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fs/xfs/xfs_discard.c b/fs/xfs/xfs_discard.c index e85a951..272c3f8 100644 --- a/fs/xfs/xfs_discard.c +++ b/fs/xfs/xfs_discard.c @@ -227,7 +227,7 @@ xfs_discard_extents( GFP_NOFS, 0); if (error && error != -EOPNOTSUPP) { xfs_info(mp, - "discard failed for extent [0x%llu,%u], error %d", + "discard failed for extent [0x%llx,%u], error %d", (unsigned long long)busyp->bno, busyp->length, error); -- 2.7.0 From david@fromorbit.com Sat Feb 13 18:16:50 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=ham version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay2.corp.sgi.com [137.38.102.29]) by oss.sgi.com (Postfix) with ESMTP id 97D3E7CA4 for ; Sat, 13 Feb 2016 18:16:50 -0600 (CST) Received: from cuda.sgi.com (cuda3.sgi.com [192.48.176.15]) by relay2.corp.sgi.com (Postfix) with ESMTP id 86D62304039 for ; Sat, 13 Feb 2016 16:16:50 -0800 (PST) X-ASG-Debug-ID: 1455409006-04cb6c1e59b0530001-NocioJ Received: from ipmail06.adl2.internode.on.net (ipmail06.adl2.internode.on.net [150.101.137.129]) by cuda.sgi.com with ESMTP id kJDNyF8nbsIDpHbR for ; Sat, 13 Feb 2016 16:16:47 -0800 (PST) X-Barracuda-Envelope-From: david@fromorbit.com X-Barracuda-Apparent-Source-IP: 150.101.137.129 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: A2CmDADXxr9WPBATLHleKAECgw+BP4Jog3qfYwEBAQEBAQaLbIVFhAiGBwICAQECgSRNAQEBAQEBBwEBAQFBP4RBAQEBAwE6HCMFCwgDDgcDCSUPBSUDBxoTGgGHdwe7AgEBAQEBBQEBAQEcGIUxhH2EHINBgQ8FlnmIPIUQjn2DQ4p7gmQZgVwoLohPgTgBAQE Received: from ppp121-44-19-16.lns20.syd4.internode.on.net (HELO dastard) ([121.44.19.16]) by ipmail06.adl2.internode.on.net with ESMTP; 14 Feb 2016 10:46:46 +1030 Received: from dave by dastard with local (Exim 4.80) (envelope-from ) id 1aUkMn-0005wf-JP; Sun, 14 Feb 2016 11:16:45 +1100 Date: Sun, 14 Feb 2016 11:16:45 +1100 From: Dave Chinner To: Jens Rosenboom Cc: Brian Foster , xfs@oss.sgi.com Subject: Re: [PATCH v2] [RFC] xfs: allocate log vector buffers outside CIL context lock Message-ID: <20160214001645.GF14668@dastard> X-ASG-Orig-Subj: Re: [PATCH v2] [RFC] xfs: allocate log vector buffers outside CIL context lock References: <1453177919-17849-1-git-send-email-david@fromorbit.com> <20160120015853.GU6033@dastard> <20160126141733.GA48264@bfoster.bfoster> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.21 (2010-09-15) X-Barracuda-Connect: ipmail06.adl2.internode.on.net[150.101.137.129] X-Barracuda-Start-Time: 1455409007 X-Barracuda-URL: https://192.48.176.15:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-BRTS-Status: 1 X-Barracuda-Spam-Score: 0.00 X-Barracuda-Spam-Status: No, SCORE=0.00 using per-user scores of TAG_LEVEL=1000.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.7 tests=BSF_SC0_MISMATCH_TO X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.3.27012 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 0.00 BSF_SC0_MISMATCH_TO Envelope rcpt doesn't match header On Sat, Feb 13, 2016 at 06:09:17PM +0100, Jens Rosenboom wrote: > 2016-01-26 15:17 GMT+01:00 Brian Foster : > > On Wed, Jan 20, 2016 at 12:58:53PM +1100, Dave Chinner wrote: > >> From: Dave Chinner > >> > >> One of the problems we currently have with delayed logging is that > >> under serious memory pressure we can deadlock memory reclaim. THis > >> occurs when memory reclaim (such as run by kswapd) is reclaiming XFS > >> inodes and issues a log force to unpin inodes that are dirty in the > >> CIL. .... > >> That said, I don't have a reliable deadlock reproducer in the first > >> place, so I'm interested i hearing what people think about this > >> approach to solve the problem and ways to test and improve it. > >> > >> Signed-off-by: Dave Chinner > >> --- > > > > This seems reasonable to me in principle. It would be nice to have some > > kind of feedback in terms of effectiveness resolving the original > > deadlock report. I can't think of a good way of testing short of > > actually instrumenting the deadlock one way or another, unfortunately. > > Was there a user that might be willing to test or had a detailed enough > > description of the workload/environment? > > We have seen this issue on our production Ceph cluster sporadically > and have tried a long time to reproduce it in a lab environment. .... > kmem_alloc (mode:0x2408240) > Feb 13 10:51:57 storage-node35 kernel: [10562.614089] XFS: > ceph-osd(10078) possible memory allocation deadlock size 32856 in > kmem_alloc (mode:0x2408240) High order allocation of 32k. That implies a buffer size of at least 32k is in use. Can you tell me what the output of xfs_info is for one of your filesystems? I suspect you are using a 64k directory block size, in which case I'll ask "are you storing millions of files in a single directory"? If your answer is no, then "don't do that" is an appropriate solution because large directory block sizes are slower than the default (4k) for almost all operations until you get up into the millions of files per directory range. > Soon after this, operations get so slow that the OSDs die because of > their suicide timeouts. > > Then I installed onto 3 servers this patch (applied onto kernel > v4.4.1). The bad news is that I am still getting the kernel messages > on these machines. The good news, though, is that they appear at a > much lower frequency and also the impact on performance seems to be > lower, so the OSD processes on these three nodes did not get killed. Right, the patch doesn't fix the underlying issue that memory fragmentation can prevent high order allocation from succeeding for long periods. However, it does ensure that the filesystem does not immediately deadlock memory reclaim when it happens so the system has a chance to recover. It still can deadlock the filesystem, because if we can't commit the transaction we can't unlock the objects in the transaction and everything can get stuck behind that if there's something sufficiently important in the blocked transaction. Cheers, Dave. -- Dave Chinner david@fromorbit.com From david@fromorbit.com Sat Feb 13 18:21:42 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=ham version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay2.corp.sgi.com [137.38.102.29]) by oss.sgi.com (Postfix) with ESMTP id 6A17F7CA6 for ; Sat, 13 Feb 2016 18:21:42 -0600 (CST) Received: from cuda.sgi.com (cuda3.sgi.com [192.48.176.15]) by relay2.corp.sgi.com (Postfix) with ESMTP id 47B8C304039 for ; Sat, 13 Feb 2016 16:21:42 -0800 (PST) X-ASG-Debug-ID: 1455409296-04cb6c1e56b05e0001-NocioJ Received: from ipmail06.adl2.internode.on.net (ipmail06.adl2.internode.on.net [150.101.137.129]) by cuda.sgi.com with ESMTP id p61PSXmxyhP0imyU for ; Sat, 13 Feb 2016 16:21:37 -0800 (PST) X-Barracuda-Envelope-From: david@fromorbit.com X-Barracuda-Apparent-Source-IP: 150.101.137.129 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: A2AmDAD8x79WPBATLHleKAECgw+BP4Jog3qfYwEBAQEBAQaLbIlNhgcEAgKBJE0BAQEBAQEHAQEBAUE/hEIBAQQ6HCMQCAMOCgkMGQ8FJQMHGhOIGbsDAQEIAh4YhTGEfYRxg3sFlnmNTI59jj6EWSguigcBAQE Received: from ppp121-44-19-16.lns20.syd4.internode.on.net (HELO dastard) ([121.44.19.16]) by ipmail06.adl2.internode.on.net with ESMTP; 14 Feb 2016 10:51:36 +1030 Received: from dave by dastard with local (Exim 4.80) (envelope-from ) id 1aUkRT-0005x7-NZ; Sun, 14 Feb 2016 11:21:35 +1100 Date: Sun, 14 Feb 2016 11:21:35 +1100 From: Dave Chinner To: Christoph Hellwig Cc: "Darrick J. Wong" , xfs@oss.sgi.com Subject: Re: block allocations for the refcount btree Message-ID: <20160214002135.GG14668@dastard> X-ASG-Orig-Subj: Re: block allocations for the refcount btree References: <20160210093011.GA19147@infradead.org> <20160210095010.GC23904@birch.djwong.org> <20160210190738.GA13051@infradead.org> <20160210214058.GN14668@dastard> <20160212191046.GA28421@infradead.org> <20160213023310.GC14668@dastard> <20160213074827.GA11543@infradead.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20160213074827.GA11543@infradead.org> User-Agent: Mutt/1.5.21 (2010-09-15) X-Barracuda-Connect: ipmail06.adl2.internode.on.net[150.101.137.129] X-Barracuda-Start-Time: 1455409296 X-Barracuda-URL: https://192.48.176.15:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-BRTS-Status: 1 X-Barracuda-Spam-Score: 0.00 X-Barracuda-Spam-Status: No, SCORE=0.00 using per-user scores of TAG_LEVEL=1000.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.7 tests=BSF_SC0_MISMATCH_TO X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.3.27012 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 0.00 BSF_SC0_MISMATCH_TO Envelope rcpt doesn't match header On Fri, Feb 12, 2016 at 11:48:27PM -0800, Christoph Hellwig wrote: > On Sat, Feb 13, 2016 at 01:33:10PM +1100, Dave Chinner wrote: > > > allocate an extent (or rather just a single block) in xfs_alloc_ag_vextent > > > as called from xfs_refcountbt_alloc_block. The reservation helps us to > > > ensure this block is always available, but we still need to account for > > > that in xfs_trans_reserve(), which we currently don't do for itruncate > > > transactions. > > > > Ok, so we may have two different issues with a similar failure > > symptom. As it is, I don't think this is a show stopper - we're > > expecting to find these sorts of issues as we go along (hence the > > experimental tag on the feature) and I think, at this point, getting > > review and an initial merge done is more important... > > This triggers 100% reproducible over NFS, and as outlined I'm > also pretty sure about the root cause. I don't think this is something > to be ignored. I didn't say we should to ignore it - I simply stated my priority was getting the code reviewed and merged. That doesn't stop you or Darrick from working on a fix - if that happens after the initial merge, we've still got the whole -rc cycle to find and fix issues like this. Cheers, Dave. -- Dave Chinner david@fromorbit.com From mtk.manpages@gmail.com Sun Feb 14 15:27:56 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=FREEMAIL_FROM,T_DKIM_INVALID autolearn=ham version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay1.corp.sgi.com [137.38.102.111]) by oss.sgi.com (Postfix) with ESMTP id EF8DC7CA2 for ; Sun, 14 Feb 2016 15:27:56 -0600 (CST) Received: from cuda.sgi.com (cuda1.sgi.com [192.48.157.11]) by relay1.corp.sgi.com (Postfix) with ESMTP id C4CDC8F8039 for ; Sun, 14 Feb 2016 13:27:53 -0800 (PST) X-ASG-Debug-ID: 1455485270-04bdf066ebc62f0001-NocioJ Received: from mail-wm0-f52.google.com (mail-wm0-f52.google.com [74.125.82.52]) by cuda.sgi.com with ESMTP id WDq2tLsfIy303Nwk (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128 verify=NO) for ; Sun, 14 Feb 2016 13:27:51 -0800 (PST) X-Barracuda-Envelope-From: mtk.manpages@gmail.com X-Barracuda-Apparent-Source-IP: 74.125.82.52 Received: by mail-wm0-f52.google.com with SMTP id g62so33608226wme.1 for ; Sun, 14 Feb 2016 13:27:51 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=subject:to:references:cc:from:message-id:date:user-agent :mime-version:in-reply-to:content-type:content-transfer-encoding; bh=bWXqcDFtT2vzZbBE1pbUexw6z1090ZYpabhVFB8G/tU=; b=lNX9DeuYPbl72BNE9WYBSRFwrcjU1RuR/iUtPzddoqM5AfAqVLxRHAzJ1jkE25Y0R9 6Rn2VB7bydqFhVdq/mPTmT3xeX+RW+mTjh5LcqQiknQbV7XhnpHP0RSeWw5yvVNwjFyo dZq/C+EHv/y9WYl8SiwVQtvO4ddvDw2txJXnV6ets/voTFR6/mXUUK9WgcKOR1U8GNkW AHtPGBf9dSlv5hI64Fh4AEepybdiNQMyylaJqWA9BCFWVTaZdUKFfrP6kdHs1n3WqtoB 893//+wBj2sEFXZ6OJPPe8PP4Ctv6lIlGT87uaGIJ7OyiMOaMlBMOG87Ji/UfqJFhXRd W1xg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:subject:to:references:cc:from:message-id:date :user-agent:mime-version:in-reply-to:content-type :content-transfer-encoding; bh=bWXqcDFtT2vzZbBE1pbUexw6z1090ZYpabhVFB8G/tU=; b=Cc5no17I5XI7gofBtxXVC8k/z6fsSBIPNxliuyiwXut8KPY1+U4jF10TjL73CIBpdm 1/OkEkRreWlA+SnNo2jENPv3kPamAYTqyp643EqcxQ+OzXQYX9jipE13BxQv4O299fHx PSNBspszq51pJN6XFL2iEZ2iBtSS78rkzIWhTUgsh9/vpHw0iQfJRUBWhMWxGEIxoBKP tbDbPLG7pZ1Zw8lAL+B2pcZ4jYrotyNk229g03qHtQcmRIt3lb21T1oKV3RXfwUKfXTg EaPKhld13Rrq2JOmOcU96PiuZZCrrmRFARywENBseQo04K1WdgHZfu1NMSMGiuamrgqM 7C1Q== X-Gm-Message-State: AG10YOR8mKm7KozA0Pdj59EF91/bbhfUIdqgIh6/1y15IQiQhdoOsmfNYAcWAsM8R3uA6A== X-Received: by 10.28.48.137 with SMTP id w131mr9525548wmw.73.1455485270153; Sun, 14 Feb 2016 13:27:50 -0800 (PST) Received: from [192.168.235.37] (mail.jambit.com. [95.157.63.22]) by smtp.gmail.com with ESMTPSA id n131sm12571297wmf.9.2016.02.14.13.27.46 (version=TLSv1/SSLv3 cipher=OTHER); Sun, 14 Feb 2016 13:27:49 -0800 (PST) Subject: Re: richacl(7) man page review comments To: Andreas Gruenbacher X-ASG-Orig-Subj: Re: richacl(7) man page review comments References: <56B770B6.7040803@gmail.com> <56B77262.7090107@gmail.com> Cc: mtk.manpages@gmail.com, "J. Bruce Fields" , linux-ext4 , XFS Developers , lkml , linux-fsdevel , Linux NFS Mailing List , linux-cifs@vger.kernel.org, Linux API , Dave Chinner , Christoph Hellwig , Anna Schumaker , Trond Myklebust , Jeff Layton , Andreas Dilger From: "Michael Kerrisk (man-pages)" Message-ID: <56C0F150.60008@gmail.com> Date: Sun, 14 Feb 2016 22:27:44 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.5.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-Barracuda-Connect: mail-wm0-f52.google.com[74.125.82.52] X-Barracuda-Start-Time: 1455485271 X-Barracuda-Encrypted: ECDHE-RSA-AES128-GCM-SHA256 X-Barracuda-URL: https://192.48.157.11:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-BRTS-Status: 1 X-Barracuda-Spam-Score: 0.00 X-Barracuda-Spam-Status: No, SCORE=0.00 using per-user scores of TAG_LEVEL=1000.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.7 tests=BSF_SC0_MISMATCH_TO, DKIM_SIGNED, DKIM_VERIFIED X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.3.27033 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 0.00 BSF_SC0_MISMATCH_TO Envelope rcpt doesn't match header -0.00 DKIM_VERIFIED Domain Keys Identified Mail: signature passes verification 0.00 DKIM_SIGNED Domain Keys Identified Mail: message has a signature On 02/12/2016 11:25 PM, Andreas Gruenbacher wrote: > Hi Michael, > > On Sun, Feb 7, 2016 at 5:35 PM, Michael Kerrisk (man-pages) > wrote: >> Hi Andreas, >> >> I'll probably have quite a few more comments on this page as I get to >> understand RichACLs better. Here's some comments from an initial >> reading. > > thanks a lot for all the feedback to the man-pages. I've more or less > made all the suggested changes but didn't get to adding examples yet > (that's not so easy). > > The changes are here: > > https://github.com/andreas-gruenbacher/richacl Thanks. I'll send a few further comments. But I hope to send more in the future. >> So, an initial comment. It seems to me to that this page (but >> not setrichacl(1) and getrichacl(1)) should ultimately land in >> man-pages (just like acl(7)), since we're talking about a kernel >> feature. Make sense? > > We could sure move acl(5) and richacl(7) there. We already have acl(5) (now "acl(7)" in man pages) ;-). Cheers, Michael -- Michael Kerrisk Linux man-pages maintainer; http://www.kernel.org/doc/man-pages/ Linux/UNIX System Programming Training: http://man7.org/training/ From mtk.manpages@gmail.com Sun Feb 14 15:29:16 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=FREEMAIL_FROM,T_DKIM_INVALID autolearn=ham version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay2.corp.sgi.com [137.38.102.29]) by oss.sgi.com (Postfix) with ESMTP id 781147CA2 for ; Sun, 14 Feb 2016 15:29:16 -0600 (CST) Received: from cuda.sgi.com (cuda2.sgi.com [192.48.176.25]) by relay2.corp.sgi.com (Postfix) with ESMTP id 54235304032 for ; Sun, 14 Feb 2016 13:29:16 -0800 (PST) X-ASG-Debug-ID: 1455485353-04cbb04331d97e0001-NocioJ Received: from mail-wm0-f53.google.com (mail-wm0-f53.google.com [74.125.82.53]) by cuda.sgi.com with ESMTP id 7gfgP3ZBCMcTbvRj (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128 verify=NO) for ; Sun, 14 Feb 2016 13:29:13 -0800 (PST) X-Barracuda-Envelope-From: mtk.manpages@gmail.com X-Barracuda-Apparent-Source-IP: 74.125.82.53 Received: by mail-wm0-f53.google.com with SMTP id b205so45091850wmb.1 for ; Sun, 14 Feb 2016 13:29:13 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=subject:to:references:cc:from:message-id:date:user-agent :mime-version:in-reply-to:content-type:content-transfer-encoding; bh=/5tcch0hVixxiNZK81uMZCEQFJr5g2+26TH3kPNwbJ0=; b=AoHyZaLIi+WPRlTHnl1kqxtdvY/1/H90zOaTi6V9Mm4+fRP3fr+5nN9Rl+0UhNp4U2 4MOLrGH0pSW6jV5cN7S5a0nqL5Shnr0U+Lzw5aCJ8mswkPTWE2t0jeN6XvRwm0IZvE9f E3XQC7suoThJY9aLfYQoB0KFmYTzj6FHpn6sgAsO4oEw0c3YT3R6flMhVDBavj9uR//b 8Onyv+r1aRA1NdKMaraydpaz62vJjikzatwSUBuI3zZbata5OJXb8ayE815ojk7v+j/C yw7Zoz6j+nYdTW8oQikP8JvotjVwVsBYywV7vmCYh146rVJgQnnEi8ZEIlX8HzrE4qEe H+kQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:subject:to:references:cc:from:message-id:date :user-agent:mime-version:in-reply-to:content-type :content-transfer-encoding; bh=/5tcch0hVixxiNZK81uMZCEQFJr5g2+26TH3kPNwbJ0=; b=UI+OsIwQVV+i7rhzPUr2QPXMYGmFXXd79N9nJ0QpCK3VE4EqRF2vokJn2Wd3ZyiX63 H1eh3JW1Ok/fHRolRYX/uYFHwnaGtwTXXBopbI8HZRW/PNSjtwn7VFgEXBY6of8gwDi6 l8vB2uVgWdl5HdxQEt8NspGuvsZgS1OGQNcJxY4Bds4d36Ggjvysz6hhcNfcJAZXZ599 oe0iaLmmdBvuAQPFICgaEprerS8BhkZXOt9UJD0Vg+mKjq9hKD563f1bO7CiGMDeKJ4Y Dd7L+f1ULVEiXkHAQm9JWtfImTFfsRR1MxMEbzkXRqy9MGg1k98zNzOXo6EfQm06dlFR v8SA== X-Gm-Message-State: AG10YOQYFDZXHsWsLUJjzabGaH4iPSXdSVcqbxo1BimAFm2DQLvy3Q5tgFREI8LoA3qSjA== X-Received: by 10.28.98.85 with SMTP id w82mr9639772wmb.63.1455485353120; Sun, 14 Feb 2016 13:29:13 -0800 (PST) Received: from [192.168.235.37] (mail.jambit.com. [95.157.63.22]) by smtp.gmail.com with ESMTPSA id e198sm12683384wmd.0.2016.02.14.13.29.09 (version=TLSv1/SSLv3 cipher=OTHER); Sun, 14 Feb 2016 13:29:11 -0800 (PST) Subject: Re: setrichacl(1) man page review comments To: Andreas Gruenbacher X-ASG-Orig-Subj: Re: setrichacl(1) man page review comments References: <56B770B6.7040803@gmail.com> <56B7716F.6060404@gmail.com> Cc: mtk.manpages@gmail.com, "J. Bruce Fields" , linux-ext4@vger.kernel.org, xfs@oss.sgi.com, lkml , linux-fsdevel@vger.kernel.org, linux-nfs@vger.kernel.org, linux-cifs@vger.kernel.org, Linux API , Dave Chinner , Christoph Hellwig , Anna Schumaker , Trond Myklebust , Jeff Layton , Andreas Dilger From: "Michael Kerrisk (man-pages)" Message-ID: <56C0F1A5.9010109@gmail.com> Date: Sun, 14 Feb 2016 22:29:09 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.5.0 MIME-Version: 1.0 In-Reply-To: <56B7716F.6060404@gmail.com> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Barracuda-Connect: mail-wm0-f53.google.com[74.125.82.53] X-Barracuda-Start-Time: 1455485353 X-Barracuda-Encrypted: ECDHE-RSA-AES128-GCM-SHA256 X-Barracuda-URL: https://192.48.176.25:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-BRTS-Status: 1 X-Barracuda-Spam-Score: 0.00 X-Barracuda-Spam-Status: No, SCORE=0.00 using per-user scores of TAG_LEVEL=1000.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.7 tests=BSF_SC0_MISMATCH_TO, DKIM_SIGNED, DKIM_VERIFIED X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.3.27033 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 0.00 BSF_SC0_MISMATCH_TO Envelope rcpt doesn't match header -0.00 DKIM_VERIFIED Domain Keys Identified Mail: signature passes verification 0.00 DKIM_SIGNED Domain Keys Identified Mail: message has a signature Hi Andreas, Here's a few more comments on the latest setrichacl(1) page that I pulled out of the git repo. > .\" > .\" RichACL Manual Pages > .\" > .\" Copyright (C) 2015,2016 Red Hat, Inc. > .\" Written by Andreas Gruenbacher > .\" This is free documentation; you can redistribute it and/or > .\" modify it under the terms of the GNU General Public License as > .\" published by the Free Software Foundation; either version 2 of > .\" the License, or (at your option) any later version. > .\" > .\" The GNU General Public License's references to "object code" > .\" and "executables" are to be interpreted as the output of any > .\" document formatting or typesetting system, including > .\" intermediate and printed output. > .\" > .\" This manual is distributed in the hope that it will be useful, > .\" but WITHOUT ANY WARRANTY; without even the implied warranty of > .\" MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the > .\" GNU General Public License for more details. > .\" > .\" You should have received a copy of the GNU General Public > .\" License along with this manual. If not, see > .\" . > .\" > .TH SETRICHACL 7 2015-09-01 "Linux" "Rich Access Control Lists" > > .SH NAME > setrichacl \- Set Rich Access Control Lists > > .SH SYNOPSIS > .B setrichacl > .RI [ option "]... [" file ]... > > .SH DESCRIPTION > The > .B setrichacl > utility sets or modifies Rich Access Control Lists (RichACLs) of files and > directories. > > The > .B \-m > and > .B \-s > options expect an ACL or parts of an ACL on the command line. The > .B \-M > and > .B \-S > options read an ACL or parts of an ACL from a file. In either case, the entry > format is described in section > .I TEXT FORM .I Text form > of the > .BR richacl (7) > manual page. The single-letter or long forms of flags and permissions can be > mixed arbitrarily. Multiple entries are separated by whitespace, newlines or s/newlines/newlines,/ (You already use the "Oxford comma" convention elsewhere, so be consistent.) > commas. > > Note that the order of entries in a RichACL matters, and that reordering s/matters/is significant/ > entries may change the permissions granted. > > The use of > .B deny > entries is discouraged. If > .B deny > entries are used, they should be placed ahead of > .B allow > entries for improved interoperability with Windows where possible. > > When the file masks are not specified, they are computed automatically. > > When the ACL to be set is simple enough that the traditional file permission > bits can express the same permissions, > .B setrichacl > sets the file permission bits and removes the ACL. When > .BR setrichacl 's > counterpart utility, > .BR getrichacl (1), > is used on a file or directory that does not have a RichACL, it displays the > access permissions defined by the file permission bits as an ACL. This means > that for simple ACLs, > .B getrichacl > may display a slightly different ACL which is equivalent to the one that was > set with > .BR setrichacl . > > .SS Permissions > > Setting ACLs or changing the file permission bits is allowed to the file owner, > to processes which have the > .B write_acl > permission, and to processes which have the > .B CAP_FOWNER > capability. > > .SH OPTIONS > .TP > \fB\-\-modify\fR \fIacl\fR, \fB\-m\fR \fIacl\fR > Modify the ACL of \fIfile\fR by replacing existing entries with the entries in > \fIacl\fR, and adding all new entries. When the permissions of an entry are > empty, remove the entry. > .TP > \fB\-\-modify\-file\fR \fIacl_file\fR, \fB\-M\fR \fIacl_file\fR > Identical to \fB\-\-modify\fR, but read the ACL from \fIacl_file\fR instead. If > the file is \(lq\-\(rq, read from standard input. > .TP > \fB\-\-set\fR \fIacl\fR, \fB\-s\fR \fIacl\fR > Set the ACL of \fIfile\fR to \fIacl\fR. Any previous ACL is replaced. > ACL entries are separated by whitespace, newlines, or commas. > .TP > \fB\-\-set\-file\fR \fIacl_file\fR, \fB\-S\fR \fIacl_file\fR > Identical to \fB\-\-set\fR, but read the ACL from \fIacl_file\fR instead. If > the file is \(lq\-\(rq, read from standard input. > .TP > \fB\-\-remove\fR, \fB\-b\fR > Remove all extended permissions and revert to the file permission bits only. > .TP > \fB\-\-version\fR, \fB\-v\fR > Display the version of > .B setrichacl > and exit. > .TP > \fB\-\-help\fR, \fB\-h\fR > Display command-line usage help text. > > .\" .SH EXAMPLES > > .SH AUTHOR > Written by Andreas Grünbacher . > > Please send your bug reports, suggested features and comments to the above address. > > .SH CONFORMING TO > Rich Access Control Lists are Linux-specific. > > .SH SEE ALSO > .BR getrichacl (1), > .BR richacl (7) Cheers, Michael From mtk.manpages@gmail.com Sun Feb 14 15:30:48 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=FREEMAIL_FROM,T_DKIM_INVALID autolearn=ham version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay1.corp.sgi.com [137.38.102.111]) by oss.sgi.com (Postfix) with ESMTP id 75B3A7CA2 for ; Sun, 14 Feb 2016 15:30:48 -0600 (CST) Received: from cuda.sgi.com (cuda3.sgi.com [192.48.176.15]) by relay1.corp.sgi.com (Postfix) with ESMTP id 6401D8F8049 for ; Sun, 14 Feb 2016 13:30:48 -0800 (PST) X-ASG-Debug-ID: 1455485445-04cb6c1e59ccc80001-NocioJ Received: from mail-wm0-f45.google.com (mail-wm0-f45.google.com [74.125.82.45]) by cuda.sgi.com with ESMTP id kNcVW9Y9Ae2bQftY (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128 verify=NO) for ; Sun, 14 Feb 2016 13:30:45 -0800 (PST) X-Barracuda-Envelope-From: mtk.manpages@gmail.com X-Barracuda-Apparent-Source-IP: 74.125.82.45 Received: by mail-wm0-f45.google.com with SMTP id g62so126422304wme.0 for ; Sun, 14 Feb 2016 13:30:45 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=subject:to:references:cc:from:message-id:date:user-agent :mime-version:in-reply-to:content-type:content-transfer-encoding; bh=LeTBXTx1iAU8alyjsfpzDVtVDRFf3/E/qufQx4d1Nck=; b=PN/orWviS3whrSNcGrfNopTwWR0YM3t9xqmVIikZKUPGgTwWBgKgDVhnXC7IZiKoyK mgKd4DlNANY/MUOzWymaLj0SqjSGYWcpJBCVhonu+4ren5LVFvwNI5+hEUN4frudJbI8 Xqg+Fe3DGKvcwb+X9pH1MrWsqInZkNuHrOkFEAaAbu6HONEQKGe7f43K/ctBVQRz64Qw BNDAqbx9C52648wkyvOGJl3cAoz83GvXf7vctqSDvDMgWAcFBwz0KUfSBHn8YPUeg2EC Y82U3wAe0VIk0N1BvCcK7inbnPkMSw1WNbAu7SXlmpafd4OnwIi+HIWrupfQ2Fwn9UeW OiCA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:subject:to:references:cc:from:message-id:date :user-agent:mime-version:in-reply-to:content-type :content-transfer-encoding; bh=LeTBXTx1iAU8alyjsfpzDVtVDRFf3/E/qufQx4d1Nck=; b=CKGqjuVuvd7LBLBE8aWr2WMMy3pFSCmLHz9a62XMK6gDUjsjWfDDR+iumBfweVrqcX RnJqupbDTofRTWD1RD+rSLNyKwlxw++/e3TmzsvawkdGELcnRuqS65S0KwO65R4cY/ew frPhEXuXJDQMLOkmhXgvTkzk3T+DGbOItdf/ib+O1a/u8PCI9JH+GU2H5hcwqCSD9DmM HLSZDn0ONkcYKzM7iGhZP78nXFOVQ73LqtTohLkhED75j6Wcy/LE+YKHWDcEFitRCiFZ s5d5g+gZpuX7YBBRZCE/fQMDaR7tcaDPHYbO49k/DybP2iMmwyfPbzinihar2NlNTRtQ GCGA== X-Gm-Message-State: AG10YOR8yAEXtiw1n/KmvmBYo4lyt3BTrmVfcrhCPz3UEJPfc0QoDoPO72KT+aChroNABw== X-Received: by 10.28.0.69 with SMTP id 66mr8493182wma.51.1455485445037; Sun, 14 Feb 2016 13:30:45 -0800 (PST) Received: from [192.168.235.37] (mail.jambit.com. [95.157.63.22]) by smtp.gmail.com with ESMTPSA id ei9sm22261723wjd.40.2016.02.14.13.30.42 (version=TLSv1/SSLv3 cipher=OTHER); Sun, 14 Feb 2016 13:30:44 -0800 (PST) Subject: Re: getrichacl(1) man page review comments To: Andreas Gruenbacher X-ASG-Orig-Subj: Re: getrichacl(1) man page review comments References: <56B770B6.7040803@gmail.com> <56B77139.4080209@gmail.com> Cc: mtk.manpages@gmail.com, "J. Bruce Fields" , linux-ext4@vger.kernel.org, xfs@oss.sgi.com, lkml , linux-fsdevel@vger.kernel.org, linux-nfs@vger.kernel.org, linux-cifs@vger.kernel.org, Linux API , Dave Chinner , Christoph Hellwig , Anna Schumaker , Trond Myklebust , Jeff Layton , Andreas Dilger From: "Michael Kerrisk (man-pages)" Message-ID: <56C0F1FF.3050003@gmail.com> Date: Sun, 14 Feb 2016 22:30:39 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.5.0 MIME-Version: 1.0 In-Reply-To: <56B77139.4080209@gmail.com> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Barracuda-Connect: mail-wm0-f45.google.com[74.125.82.45] X-Barracuda-Start-Time: 1455485445 X-Barracuda-Encrypted: ECDHE-RSA-AES128-GCM-SHA256 X-Barracuda-URL: https://192.48.176.15:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-BRTS-Status: 1 X-Barracuda-Spam-Score: 0.00 X-Barracuda-Spam-Status: No, SCORE=0.00 using per-user scores of TAG_LEVEL=1000.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.7 tests=BSF_SC0_MISMATCH_TO, DKIM_SIGNED, DKIM_VERIFIED X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.3.27033 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 0.00 BSF_SC0_MISMATCH_TO Envelope rcpt doesn't match header -0.00 DKIM_VERIFIED Domain Keys Identified Mail: signature passes verification 0.00 DKIM_SIGNED Domain Keys Identified Mail: message has a signature Hi Andreas, Here's a few more comments on the current getrichacl(1) page that I fetched from the git repo. > .\" > .\" RichACL Manual Pages > .\" > .\" Copyright (C) 2015,2016 Red Hat, Inc. > .\" Written by Andreas Gruenbacher > .\" This is free documentation; you can redistribute it and/or > .\" modify it under the terms of the GNU General Public License as > .\" published by the Free Software Foundation; either version 2 of > .\" the License, or (at your option) any later version. > .\" > .\" The GNU General Public License's references to "object code" > .\" and "executables" are to be interpreted as the output of any > .\" document formatting or typesetting system, including > .\" intermediate and printed output. > .\" > .\" This manual is distributed in the hope that it will be useful, > .\" but WITHOUT ANY WARRANTY; without even the implied warranty of > .\" MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the > .\" GNU General Public License for more details. > .\" > .\" You should have received a copy of the GNU General Public > .\" License along with this manual. If not, see > .\" . > .\" > .TH GETRICHACL 7 2015-09-01 "Linux" "Rich Access Control Lists" > > .SH NAME > getrichacl \- Get Rich Access Control Lists > > .SH SYNOPSIS > .B getrichacl > .RI [ option "]... [" file ]... > > .SH DESCRIPTION > For each file, > .B getrichacl > displays the file name and the file's Rich Access Control List (RichACL). > > The output format of > .B getrichacl > is as follows: Add a blank line here. > .fam C > .RS > .nf > 1: file: > 2: flags:a > 3: owner:rwp-------------::mask > 4: group:r-p-------------::mask > 5: other:r---------------::mask > 6: owner@:rwp-------------::allow > 7: user:foo:r-p-------------::allow > 8: group@:r-p-------------::allow > 9: group:bar:r-p-------------::allow > 10: everyone@:r---------------::allow > 11: > .fi > .RE > .fam T > > Line 1 contains the file name, followed by a colon. > > Line 2 contains the ACL flags. This line is omitted if no flags are set. > > Lines 3--5 indicate the owner, group, and other file masks, which are only > shown if the \fB\-\-raw\fR option is specified. > > Lines 6--10 indicate different ACL entries for the file owner > .RB ( owner@ ), > user \fIfoo\fR, the owning group > .RB ( group@ ), > group \fIbar\fR, and for everyone > .RB ( everyone@ ). > > A blank line follows at the end. > > The default output format uses the single-letter forms of flags and > permissions, identifiers of ACL entries are right justified, permissions are > vertically aligned, and permissions which are always granted > .RB ( read_attributes ", " read_acl ", " synchronize ) > are omitted. See the > .BR richacl (7) > manual page for the defined flags and permissions. > > By default, > .B getrichacl > displays the effective permissions remaining after applying the file masks to > the ACL. The file masks and underlying NFSv4 ACL can be displayed with the > \fB\-\-raw\fR option. > > When > .B getrichacl > is used on a file that does not have a RichACL or on a filesystem that does not > support RichACLs, > .B getrichacl Replace the previous line with "it". > displays the access permissions defined by the traditional file permission bits > as a RichACL. When > .B getrichacl > is used on a file that has a POSIX ACL (see > .BR acl (5)), > it prints an error message. > > .SH OPTIONS > .TP > \fB\-\-long\fR, \fB\-l\fR > Display access masks and flags in their long form. > .TP > \fB\-\-full\fR > Also show permissions which are always implicitly allowed. > .TP > \fB\-\-raw\fR > Show ACLs as stored on the file system, including the file masks. Implies > \fB\-\-full\fR. > .TP > \fB\-\-unaligned\fR > Do not align ACL entries or pad missing permissions with '-'. > .TP > \fB\-\-numeric-ids\fR > Display numeric user and group IDs instead of names. > .TP > \fB\-\-access\fR [=\fIuser\fR[:\fIgroup\fR:...]}, \fB\-a\fR[\fIuser\fR[:\fIgroup\fR:...]} > Instead of showing the ACL, show which permissions the user running the command > has for the specified file(s). When \fIuser\fR is specified, show which > permissions the specified user has instead. If \fIuser\fR is followed by a > colon and a (possibly empty) list of groups, assume that \fIuser\fR is a member > in the specified groups; otherwise, > .BR getgrouplist (3) > is used to determine the groups \fIuser\fR is a member in. s/in/of/ > .TP > \fB\-\-version\fR, \fB\-v\fR > Display the version of > .B getrichacl > and exit. > .TP > \fB\-\-help\fR, \fB\-h\fR > Display command-line usage help text. > > .SH AUTHOR > Written by Andreas Grünbacher . > > Please send your bug reports, suggested features and comments to the above address. > > .SH CONFORMING TO > Rich Access Control Lists are Linux-specific. > > .SH SEE ALSO > .BR richacl (7), > .BR setrichacl (1) Cheers, Michael From mtk.manpages@gmail.com Sun Feb 14 15:31:52 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=FREEMAIL_FROM,T_DKIM_INVALID autolearn=ham version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay2.corp.sgi.com [137.38.102.29]) by oss.sgi.com (Postfix) with ESMTP id 7175A7CA2 for ; Sun, 14 Feb 2016 15:31:52 -0600 (CST) Received: from cuda.sgi.com (cuda1.sgi.com [192.48.157.11]) by relay2.corp.sgi.com (Postfix) with ESMTP id 297E8304051 for ; Sun, 14 Feb 2016 13:31:52 -0800 (PST) X-ASG-Debug-ID: 1455485505-04bdf066ebc6390001-NocioJ Received: from mail-wm0-f52.google.com (mail-wm0-f52.google.com [74.125.82.52]) by cuda.sgi.com with ESMTP id v2nWhXmwadnDAF50 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128 verify=NO) for ; Sun, 14 Feb 2016 13:31:46 -0800 (PST) X-Barracuda-Envelope-From: mtk.manpages@gmail.com X-Barracuda-Apparent-Source-IP: 74.125.82.52 Received: by mail-wm0-f52.google.com with SMTP id c200so88223459wme.0 for ; Sun, 14 Feb 2016 13:31:45 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=subject:to:references:cc:from:message-id:date:user-agent :mime-version:in-reply-to:content-type:content-transfer-encoding; bh=puj1a1WcBn9Zow2o7BbRxPPGZyKjIE1b4yfgaeZ9JWw=; b=Gf90R3gmhrUiap6CRW9Dc1XxrOizOB10+sCKURSvMoMbyWyWl/3ta2ICq1J/Cjar5T kBzCxyy+n9I8jqew0DKBTre41+3mrSDFfTry0o/0P/ahD6h5aOUew1cbdYVowXYR2sFt h9/Rzmn4/smiKNY6Vu+t4Lmn1jDfNpfXT2faKIS002eN3llZEfxiEOfGcG9mCz7Qir59 OYaSD3RYYw9gOOV1mIE/GxnAFxkXKIguGawCMj1uOyfPqE25L2a0TfvOIskfXCxJJrcA 0E3QeLZsqRD4OKAAUz45ZJz32PY/7cS17MkzFK4f/sfpcUkAy2yDRWZhSyoehIDqj6JM v/eQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:subject:to:references:cc:from:message-id:date :user-agent:mime-version:in-reply-to:content-type :content-transfer-encoding; bh=puj1a1WcBn9Zow2o7BbRxPPGZyKjIE1b4yfgaeZ9JWw=; b=JiZuQ4+zmxzIqmGij5BFgT9kXoJ+vJ6uMsEHL+aY2xCAUcUGi9eBNOSIMs7DIbPTQi YjW/T1IFlDpuWyyH4kEQpg2F7L1qcvoU6Bl9IJ9JZSs5vHfGR/AFGBWaEZsEUevC+cEE KfqIrHSXT73DpejHNZ2NiR9ly+y1CDd3SJrHxi8aIoZ1fYHmFkBHItuXdGaDpX5tBwhn p31MsQ196FZz2VD+63xdjoZe1N7sMey4dllOWSF7ceS2XWv8Zwj2JZxTAZz2Bu6PBw8s eOUtiYLy65d2GP7u6cm3Zx5TcWfdSD86JS6FvNattS9zvv/QibV6n+xH1m1526e6pHxp iX6g== X-Gm-Message-State: AG10YOQs2u4Nq41o/SWa3cljoXDyCpbd/h/pVlz8IGv2Y0xpPFMRcNBGMUJp5TK4nh605A== X-Received: by 10.194.185.108 with SMTP id fb12mr13444496wjc.89.1455485504822; Sun, 14 Feb 2016 13:31:44 -0800 (PST) Received: from [192.168.235.37] (mail.jambit.com. [95.157.63.22]) by smtp.gmail.com with ESMTPSA id c26sm12539546wmi.24.2016.02.14.13.31.41 (version=TLSv1/SSLv3 cipher=OTHER); Sun, 14 Feb 2016 13:31:43 -0800 (PST) Subject: Re: richacl(7) man page review comments To: Andreas Gruenbacher X-ASG-Orig-Subj: Re: richacl(7) man page review comments References: <56B770B6.7040803@gmail.com> <56B77262.7090107@gmail.com> Cc: mtk.manpages@gmail.com, "J. Bruce Fields" , linux-ext4 , XFS Developers , lkml , linux-fsdevel , Linux NFS Mailing List , linux-cifs@vger.kernel.org, Linux API , Dave Chinner , Christoph Hellwig , Anna Schumaker , Trond Myklebust , Jeff Layton , Andreas Dilger From: "Michael Kerrisk (man-pages)" Message-ID: <56C0F23C.7030902@gmail.com> Date: Sun, 14 Feb 2016 22:31:40 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.5.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Barracuda-Connect: mail-wm0-f52.google.com[74.125.82.52] X-Barracuda-Start-Time: 1455485505 X-Barracuda-Encrypted: ECDHE-RSA-AES128-GCM-SHA256 X-Barracuda-URL: https://192.48.157.11:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-BRTS-Status: 1 X-Barracuda-Spam-Score: 0.00 X-Barracuda-Spam-Status: No, SCORE=0.00 using per-user scores of TAG_LEVEL=1000.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.7 tests=BSF_SC0_MISMATCH_TO, DKIM_SIGNED, DKIM_VERIFIED X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.3.27033 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 0.00 BSF_SC0_MISMATCH_TO Envelope rcpt doesn't match header -0.00 DKIM_VERIFIED Domain Keys Identified Mail: signature passes verification 0.00 DKIM_SIGNED Domain Keys Identified Mail: message has a signature Hi Andreas, Here's a few more comments on the current richacl(7) page that I fetched from the git repo. > .\" > .\" RichACL Manual Pages > .\" > .\" Copyright (C) 2015,2016 Red Hat, Inc. > .\" Written by Andreas Gruenbacher > .\" This is free documentation; you can redistribute it and/or > .\" modify it under the terms of the GNU General Public License as > .\" published by the Free Software Foundation; either version 2 of > .\" the License, or (at your option) any later version. > .\" > .\" The GNU General Public License's references to "object code" > .\" and "executables" are to be interpreted as the output of any > .\" document formatting or typesetting system, including > .\" intermediate and printed output. > .\" > .\" This manual is distributed in the hope that it will be useful, > .\" but WITHOUT ANY WARRANTY; without even the implied warranty of > .\" MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the > .\" GNU General Public License for more details. > .\" > .\" You should have received a copy of the GNU General Public > .\" License along with this manual. If not, see > .\" . > .\" > .de URL > \\$2 \(laURL: \\$1 \(ra\\$3 > .. > .if \n[.g] .mso www.tmac > .TH RICHACL 7 2015-09-01 "Linux" "Rich Access Control Lists" > .SH NAME > richacl \- Rich Access Control Lists > .SH DESCRIPTION > Rich Access Control Lists (RichACLs) are an extension of the POSIX file > permission model (see > .BR acl (5)) > to support > .URL https://tools.ietf.org/rfc/rfc5661.txt "NFSv4 Access Control Lists" > on local and remote-mounted filesystems. Having read the following paragraph a number of times (and being ignorant of NFS ACLs), I find that I'm none the wiser about what you are trying to say. What does it mean to "apply a file mode to an... ACL"? Likewise, how does "the file mode determine the values of the file masks"? This isn't clear in the following paragraph, and doesn't seem to be alborated in the rest of the page. Could you add some text somehwere to explain these points? > RichACLs support file masks which can be used to apply a file mode to an existing > NFSv4 ACL without destructive side effects: the file mode determines the values > of the file masks; the file masks restrict the permissions granted by the NFSv4 > ACL. When a less restrictive file mode is applied later, the file masks become > less restrictive, and more of the original permissions can become effective. > > A RichACL can always be translated into an equivalent NFSv4 ACL which grants > the same permissions. > > RichACLs can be enabled on supported filesystems. This disables POSIX Access I think it might be helpful here to list which filesystems so far support RichACLs. > Control Lists; the two ACL models cannot coexist on the same filesystem. > > When used on a filesystem that does not support RichACLs, the > .BR getrichacl (1) > and > .BR setrichacl (1) > utilities will operate on the file permission bits instead: > .BR getrichacl (1) > will display the file permission bits as a RichACL; when a RichACL > is set with > .BR setrichacl (1) > which can be represented exactly by the file permission bits, > .BR setrichacl (1) > will set the file permission bits instead. An attempt to set a RichACL that > cannot be represented exactly by the file permission bits results in an error. > > .SS Structure of RichACLs > > RichACLs consist of a number of ACL entries, three file masks, and some flags > specifying attributes of the ACL as whole (by contrast with the per-ACL-entry > flags described below). Insert a blank line here, to start a new paragraph. > Each of the ACL entries allows or denies some permissions to a particular user, > group, or special entity. Each entry consists of: In the previous line you write "entity". In the lines below you use "identifier". The terminology switch is confusing. Use just one term. > .IP \(bu 4 > A tag which specifies the user (with prefix > .B user: > or > .BR u: ), > group (with prefix > .B group: > or > .BR g: ), > or special identifier the entry applies to. Special > identifiers can be the file owner > .RB ( owner@ ), > the owning group > .RB ( group@ ), > or everyone > .RB ( everyone@ ). > .IP \(bu > A set of permissions the entry allows or denies. > .IP \(bu > A set of flags that indicate whether the user or group identifier is mapped or > unmapped, and whether the entry has been and can be inherited. > .IP \(bu 4 > A field indicating whether the entry allows or denies access. Does this field have a name? It would make dicussing it easier to give it a name. That is, an ACL entry consists of four fields: * a tag * permissions * flags * ??? ("type"?) > .PP > The owner, group, and other file masks further control which permissions the > ACL grants, subject to the > .BR masked "\ (" m ) > and > .BR write_through "\ (" w ) > ACL flags. > > Note that entries with the identifier > .B everyone@ > apply to all processes, whereas the \(lqother\(rq file permissions and > \(lqother\(rq entries in POSIX ACLs apply to all processes which are not the > owner, are not in the owning group, and do not match a user or group mentioned > in the ACL. > > Unlike POSIX ACLs, RichACLs do not have separate \(lqaccess\(rq ACLs that > define the access permissions and \(lqdefault\(rq ACLs that define the > inheritable permissions. Instead, flags on each ACL entry determine whether > the entry is effective during access checks and/or inheritable. > > > .SS ACL flags > > The following flags on ACLs are defined: > > .RS > .HP I don't think the heavy indentation here is helpful, and it narrors the text considerably. I suggest replacing the preceding .RS+.HP with .TP, and changing ewach .HP below to .TP, and remove the colon at the end of each line that follows the .TP lines. > .BR masked "\ (" m ): > When set, the file masks define upper limits on the permissions the ACL may > grant. > .HP > .BR write_through "\ (" w ): > When this flag and the > .B masked > flag are both set, the owner and other file masks define the actual permissions > granted to the file owner and to others instead of an upper limit. There needs to be a statement here about what 'write_through' does if 'masked' is not set. > .HP > .BR auto_inherit "\ (" a ): > Automatic Inheritance is enabled for the file the ACL is > attached to. See > .IR "Automatic Inheritance" . > .HP > .BR protected "\ (" p ): > The ACL is protected from modification by Automatic > Inheritance. > .HP > .BR defaulted "\ (" d ): > The ACL has been assigned by default. Automatic Inheritance should completely What does "assigned by default" mean? That it was inherited because of 'dir_inherit' or 'file_inherit' in the pareent directory? This needs to be clearer. > replace the ACL. > .RE If you follow my suggestion above, delete the preceding .RE > .SS ACL entry flags > > The following flags on ACL entries are defined: > > .RS > .HP See above. Possibly change .RS+.HP to .TP > .BR file_inherit "\ (" f ): > The entry is inheritable for files. Maybe this would be better as: "When this flag appears in the ACL entry of a directory, then that entry is inherited by new files created in the directory." Is that text that I propose correct? > .HP > .BR dir_inherit "\ (" d ): > The entry is inheritable for directories. "When this flag appears in the ACL entry of a directory, then that entry is inherited by new subdirectories created in the directory." Is that text that I propose correct? > .HP > .BR no_propagate "\ (" n ): > Inheritance stops at the next subdirectory level. > .HP > .BR inherit_only "\ (" i ): > The entry defines inheritable permissions only and is ignored for access > checking. > .HP > .BR inherited "\ (" a ): > The entry has been automatically inherited from the parent directory; the > ACL's > .B auto_inherit > flag should be on. > .HP > .BR unmapped "\ (" u ): > The user or group identifier is a textual string and is not mapped to a numeric > user or group identifier. ACLs with unmapped identifiers can occur on NFSv4 > mounted filesystems when the client cannot determine numeric user or group > identifiers for some of the NFSv4 user@domain or group@domain who values. They > cannot be assigned to local files or directories. > .RE If you follow my suggestion above, delete the preceding .RE > > .SS Permissions > > The following permissions are defined for RichACL entries and for the three > file masks: > > .RS > .HP See above. Possibly change .RS+.HP yo .TP > .BR read_data " / " list_directory "\ (" r ): > For a file: read the data of the file. > For a directory: list the contents of the directory. > .HP > .BR write_data " / " add_file "\ (" w ): > For a file: modify the data of the file; does not include opening the file in > append mode. > For a directory: add a new file in the directory. > .HP > .BR append_data " / " add_subdirectory "\ (" p ): > For a file: open the file in append mode. > For a directory: create a subdirectory in the directory. > .HP > .BR execute "\ (" x ): > For a file: execute the file. > For a directory: traverse / search the directory. > .HP > .BR delete_child "\ (" d ): > Delete a file or directory within a directory. > .HP > .BR delete "\ (" D ): > Delete the file or directory. > .HP > .BR read_attributes "\ (" a ): > Read basic attributes of a file or directory (see > .BR stat (2)). > This permission is always implicitly granted. So, can this permission ever be taken away? If yes, say so. If not, why does this permission exist? (And maybe say something about that.) > .HP > .BR write_attributes "\ (" A ): > Change the times associated with a file or directory to an arbitrary value. > This permission is always implicitly granted to the file owner. > .HP > .BR read_acl "\ (" c ): > Read the ACL of a file or directory. This permission is always > implicitly granted. > .HP > .BR write_acl "\ (" C ): > Change the ACL or file mode of a file or directory. > .HP > .BR write_owner "\ (" o ): > Take ownership of a file or directory. Change the owning group of a file or > directory to a group of which the calling process is a member. > .HP > .BR read_named_attrs "\ (" R ), > .BR write_named_attrs "\ (" W ), > .BR synchronize "\ (" S ), > .BR write_retention "\ (" e ), > .BR write_retention_hold "\ (" E ): If you follow my .TP suggestion above, then the above lines would need to be rewritten sometinh like: .BR read_named_attrs "\ (" R "), " write_named_attrs "\ (" W "), " \ synchronize "\ (" S "), " write_retention "\ (" e "), " \ write_retention_hold "\ (" E ) > These permissions are defined by NFSv4 / NFSv4.1. They can be stored, but are > not used. > .RE If you follow my suggestion above, delete the preceding .RE and add .PP > > For the > .BR r ", " w ", and " p > permissions which have different long forms for files and directories, the > .BR getrichacl (1) > utility will output the appropriate form(s) depending on the context. > The > .BR setrichacl (1) > utility will accept either form for any file type. > > .SS Text form > The common textual representation of a RichACL consists of the colon-separated > fields of the the ACL flags, file masks, and ACL entries in the following s/the the/the/ > format: > .TP > \fBflags:\fR\fIacl_flags\fR > The ACL flags. > .TP > \fBowner:\fR\fIperm\fR\fB::mask\fR, \fBgroup:\fR\fIperm\fR\fB::mask\fR, \fBother:\fR\fIperm\fR\fB::mask\fR > The file masks and their permissions. > .TP > \fIwho\fR\fB:\fR\fIperm\fR\fB:\fR\fIflags\fR\fB:allow\fR, \fIwho\fR\fB:\fR\fIperm\fR\fB:\fR\fIflags\fR\fB:deny\fR > For each ACL entry, who the entry applies to, the permissions of the entry, the > entry flags, and whether the entry allows or denies permissions. The \fIwho\fR > field has no prefix for special identifiers, a > .B user: > or > .B u: > prefix for regular users, and a > .B group: > or > .B g: > prefix for regular groups. I think the preceding sentence could be clearer. How about something like the following (if correct): [[ The who field is one of the following: * One of the special identifiers: owner@, group@, or everyone@ * A user: or u: prefix followed by a [user name, user ID?] that designates s specific user * A group: or g: prefix followed by a [group name, group ID?] that designates s specific group ]] > .PP > The entries are comma, whitespace, or newline separated. > > Flags and permissions have single-letter as well as long forms, as listed under > .IR "ACL flags" , > .IR "ACL entry flags" , > and > .IR Permissions . > When the single-letter forms are used, the flags or permissions are > concatenated. When the long forms are used, the flags or permissions are > separated by slashes. To align permissions or flags vertically, dashes can be > used for padding. > > .SS Setting and modifying file permissions > The access permissions for a file can either be set by assigning an access > control list > .RB ( setrichacl (1)) > or by changing the file mode permission bits > .RB ( chmod (1)). > In addition, a file can inherit an ACL from its parent directory at creation > time as described under > .IR "Permissions at file-creation time" . > > .SS Assigning an Access Control List > When assigning an ACL to a file, unless explicitly specified, the owner, group, > and other file masks will be computed from the ACL entries as described in > the section > .IR "Computing the maximum file masks" . > The owner, group, and other file mode permission bits are then each set from > the owner, group, and other file mask as follows: > .IP \(bu 4 > If the file mask includes the > .B r > permission, the read > file mode permission bit will be set. > .IP \(bu > If the file mask includes the > .B w > or > .B p > permission, the write file mode permission bit will be set. > .IP \(bu > If the file mask includes the > .B x > permission, the execute file mode permission bit will be set. > .PP > If the ACL can be represented exactly by the file mode > permission bits, the file permission bits are set to match the ACL and the ACL > is not stored. (When the ACL of a file is requested which doesn't have an ACL, > the file mode permission bits are converted into an equivalent ACL.) > > .SS Changing the file mode permission bits > When changing the file mode permission bits with > .BR chmod (1), > the owner, group, > and other file permission bits are set to the permission bits in the new mode, > and the file masks each are set based on the new mode bits as follows: > .IP \(bu 4 > If the read bit in a set of permissions is set, the > .B r > permission in the corresponding file mask will be set. > .IP \(bu > If the write bit in a set of permissions is set, the > .B w > and > .B p > permissions in the corresponding file mask will be set. > .IP \(bu > If the execute bit in a set of permissions is set, the > .B x > permission in the corresponding file mask will be set. > .PP > In addition, the > .B masked > and > .B write_through > ACL flags are set. This has the > effect of limiting the permissions granted by the ACL to the file mode > permission bits; in addition, the owner is granted the owner mode bits and > others are granted the other mode bits. If the > .B auto_inherit > flag is set, the > .B protected > flag is also set to prevent the Automatic Inheritance algorithm from modifying > the ACL. > > .SS Permissions at file-creation time > When a directory has inheritable ACL entries, the following > happens when a file or directory is created inside that directory: > .RS 4 > .IP 1. 4 > A file created inside that directory will inherit all of the ACL entries that > have the > .B file_inherit > flag set, and all inheritance-related flags in the inherited entries will be > cleared. > > A subdirectory created inside that directory will inherit all of the ACL > entries that have the > .B file_inherit > or > .B dir_inherit > flag set. Entries whose > .B no_propagate > flag is set will have all inheritance-related flags cleared. Entries whose > .B no_propagate > and > .B dir_inherit > flags are not set and whose > .B file_inherit > is set will have their > .B inherit_only > flag set. > .IP 2. > If the parent directory's ACL has the > .B auto_inherit > flag set, the inherited ACL will have its > .B auto_inherit > flag set, and all entries will have their > .B inherited > flag set. > .IP 3. > The three file masks are computed from the inherited ACL as described in > the section > .IR "Computing the maximum file masks" . > .IP 4. > The three sets of permissions for the owner, the group, and for others in > the \fImode\fR parameter as given to > .BR open (2), > .BR mkdir (2), > and similar are converted into sets of RichACL permissions as described in > the section > .IR "Changing the file mode permission bits" . > Any RichACL permissions not included in those sets are > removed from the owner, group, and other file masks. The file mode permission > bits are then computed from the file masks as described in the section > .IR "Assigning an Access Control List" . > The process umask (see > .BR umask (2)) > is ignored. > .IP 5. > The > .B masked > ACL flag is set. The > .B write_through > ACL flag remains cleared. In addition, if the > .B auto_inherit > flag of the inherited ACL is set, the > .B protected > flag is also set to prevent the Automatic Inheritance algorithm from modifying > the ACL. > .RE > .PP > When a directory does not have inheritable ACL entries, files and directories > created inside that directory will not be assigned access control lists and the > file mode permission bits will be set to (\fImode\fR\ &\ ~\fIumask\fR) where > \fImode\fR is the mode argument of the relevant system call and \fIumask\fR is > the process umask (see > .BR umask (2)). > > .SS Automatic Inheritance > Automatic Inheritance is a mechanism that allows permission changes to > propagate from a directory to files and subdirectories inside that directory, > recursively. Propagation is carried out by the process changing the directory > permissions (usually, > .BR setrichacl (1)); > it happens without user intervention albeit not entirely automatically. > > A significant limitation is that this mechanism works only as long as files > are created without explicitly specifying the file permissions to use. The > standard system calls for creating files an directories ( s/an /and / s/ ($// > .BR creat (2), Make that last line: .RM ( creat (2), > .BR open (2), > .BR mkdir (2), > .BR mknod (2)) > all have mandatory mode parameters which define the maximum allowed permissions > of the new files. To take account of this restriction, the > .B protected > ACL flag must be set if the > .B inherited > flag is set. This effectively disables Automatic Inheritance for that > particular file. > > Automatic Inheritance still remains useful for network protocols like NFSv4 and > SMB, which both support creating files and directories without defining which s/which$/their/ > permissions: they can implement those operations by using the standard system > calls and by then undoing the effect of applying the mode parameters. > > When the ACL of a directory is changed, the following happens for each entry > (\(lqchild\(rq) inside that directory: > .IP 1. 4 > If the entry is a symblic link, skip the child. > .IP 2. > If the > .B auto_inherit > flag of the entry's ACL is not set or the > .B protected > flag is set, skip the child. > .IP 3. > With the child's ACL: > .RS 4 > .IP a) 4 > If the > .B defaulted > flag is set, replace the ACL with an empty ACL > with the > .B auto_inherit > flag set. > .IP b) > Delete all entries which have the > .B inherited > flag set. > .IP c) > Append all entries inherited from the parent directory according to step 1 of > the algorithm described under > .IR "Permissions at file-creation time". > Set the > .B inherited > flag of each of these entries. > .IP d) > Recompute the file masks. > .RE > .IP 4. > If the child is a directory, recursively apply this algorithm. > > .SS Access check algorithm > > When a process requests a particular kind of access (expressed as a set of > RichACL permissions) to a file, the following algorithm determines whether the > access is granted or denied: > > .IP 1. 4 > If the > .B masked > ACL flag is set, then: > .RS 4 > .IP a) 4 > If the > .B write_through > ACL flag is set, then: > .RS 4 > .IP \(bu 4 > If the requesting process is the file owner, then access is granted if the > owner mask includes the requested permissions, and is otherwise denied. > .IP \(bu > If the requesting process is not the file owner, is not in the owning group, > and no ACL entries other than > .B everyone@ > match the process, then access is granted if the other mask includes the > requested permissions, and is otherwise denied. > .RE > .IP b) > If any of the following is true: > .RS 4 > .IP \(bu 4 > the requesting process is the file owner and the owner mask does not include all > requested permissions, > .IP \(bu 4 > the requesting process is not the file owner and it is in the owning group or > matches any ACL entries other than > .BR everyone@ , > and the group mask does not include all requested permissions, > .IP \(bu 4 > the requesting process is not the file owner, not in the owning group, it > matches no ACL entries other than > .BR everyone@ , > and the other mask does not include all requested permissions, > .PP > then access is denied. > .RE > .RE > .IP 2. > Set the remaining permissions to the requested permissions. Go through all ACL > entries. For each entry: > .RS 4 > .IP a) 4 > If the > .B inherit_only > or > .B unmapped > flags are set, continue with the next ACL entry. > .IP b) > If any of the following is true: > .RS 4 > .IP \(bu 4 > the entry's identifier is > .B owner@ > and the requesting process is the file owner, > .IP \(bu > the entry's identifier is > .B group@ > and the requesting process is in the owning group, > .IP \(bu > the entry's identifier is a user and the requesting process is owned by that > user, > .IP \(bu > the entry's identifier is a group and the requesting process is a member in > that group, > .IP \(bu > the entry's identifier is > .BR everyone@ , > .PP > then the entry matches the process; proceed to the next step. Otherwise, > continue with the next ACL entry. > .RE > .IP c) > If the entry denies any of the remaining permissions, access is denied. > .IP d) > If the entry allows any of the remaining permissions, then: > .RS 4 > .IP \(bu 4 > If the > .B masked > ACL flag is set and the entry's identifier is not > .B owner@ > or > .BR everyone@ > or is a user entry matching the file owner, remove all permissions from the > remaining permissions which are both allowed by the entry and included in the > group mask, > .IP \(bu > Otherwise, remove all permissions from the remaining permissions wich are > allowed by the entry. > .RE > .RE > .IP 3. > If there are no more remaining permissions, access is allowed. Otherwise, > access is denied. > > .SS Computing the maximum file masks > When setting an ACL and no file masks have been explicitly specified and when > inheriting an ACL from the parent directory, the following algorithm is used > for computing the file masks: > > .IP 1. 4 > Clear the owner, group, and other file masks. Remember which permissions have > already been processed (initially, the empty set). > .IP 2. > For each ACL entry: > .RS 4 > .IP \(bu 4 > If the > .B inherit_only > flag is set, skip the entry. > .IP \(bu 4 > Otherwise, compute which permissions the entry allows or denies that have not > been processed yet (the remaining permissions). > .IP \(bu > If the entry is an > .B owner@ > entry, add the remaining permissions to the owner mask for > .B allow > entries, and remove the remaining permissions from the owner mask for > .B deny > entries. > .IP \(bu > Otherwise, if the entry is an > .B everyone@ > entry, proceed as with > .B owner@ > entries but add or remove the remaining permissions from the owner, group, and > other file masks. > .IP \(bu > Otherwise, proceed as with > .B owner@ > entries but add or remove the remaining permissions from the owner and group > file masks. > .IP \(bu > Add the entry's permissions to the processed permissions. > .RE > .PP > The resulting file masks represent the ACL as closely as possible. With these > file masks, if the > .B masked > ACL flag is set, the effective permissions still stay the same. > > .\" .SH BUGS > .SH AUTHOR > Written by Andreas Grünbacher . > > Please send your bug reports, suggested features and comments to the above address. Could we start with just a few simple examples already, and build up over future iterations of this page? > .SH CONFORMING TO > Rich Access Control Lists are Linux-specific. > .SH SEE ALSO > .BR acl (5), > .BR chmod (1), > .BR getrichacl (1), > .BR ls (1), > .BR setrichacl (1) > .BR stat (2), > .BR umask (2) > .\" librichacl Thanks, Michael -- Michael Kerrisk Linux man-pages maintainer; http://www.kernel.org/doc/man-pages/ Linux/UNIX System Programming Training: http://man7.org/training/ From agruenba@redhat.com Sun Feb 14 17:12:28 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=ham version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay1.corp.sgi.com [137.38.102.111]) by oss.sgi.com (Postfix) with ESMTP id 10F4B7CA2 for ; Sun, 14 Feb 2016 17:12:28 -0600 (CST) Received: from cuda.sgi.com (cuda1.sgi.com [192.48.157.11]) by relay1.corp.sgi.com (Postfix) with ESMTP id E77BC8F8035 for ; Sun, 14 Feb 2016 15:12:24 -0800 (PST) X-ASG-Debug-ID: 1455491541-04bdf066eac7920001-NocioJ Received: from mail-vk0-f54.google.com (mail-vk0-f54.google.com [209.85.213.54]) by cuda.sgi.com with ESMTP id B2Z1MZXF8YfM5JNF (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128 verify=NO) for ; Sun, 14 Feb 2016 15:12:22 -0800 (PST) X-Barracuda-Envelope-From: agruenba@redhat.com X-Barracuda-Apparent-Source-IP: 209.85.213.54 Received: by mail-vk0-f54.google.com with SMTP id k196so95628064vka.0 for ; Sun, 14 Feb 2016 15:12:22 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:date :message-id:subject:from:to:cc:content-type; bh=Y6sTX9vFdKwFm/gD7P45GOU62wfycjYCrhJu7c0849M=; b=fRmN7pzD8XVatx5rGDvU1XE4SJqhO1vRYlkcEoltXQTWLokudDLOqhFSGn/18FMyPT c7OIursTbxZF7bM52Je3SgczZHzEYiW2vIaRZUyRL/b6+Fg71Nv/kRSpGDAMkQ/QL6Sf xnju45DQGtXFaxNPnl5FvqH0na7GkMwMEBL7KI+LfccKn2XvTmJwaxjXk8BqPwppX4uw /23lhHgmj/Q4qVKqMh5ITwKhuv5YYQwVVO82TkEKDtPb79HcZ/xW5kfdX+uRtB50EU1V FV8eQtB9x1EYWOQKbhUiU2tBXw9x0/3iDfIX3Qi52yk9Wy1ysxDIF1kBAeExSdAwEEt2 qh8Q== X-Gm-Message-State: AG10YOSIl0cumilj/MngavD1QHGS7KEa3pjmXIrMVk7sDkYIoclvZyO7sYtLetj/9bIDgDHOSC7Qv+C/obES81y8 MIME-Version: 1.0 X-Received: by 10.31.192.147 with SMTP id q141mr11019103vkf.96.1455491541429; Sun, 14 Feb 2016 15:12:21 -0800 (PST) Received: by 10.176.64.130 with HTTP; Sun, 14 Feb 2016 15:12:21 -0800 (PST) In-Reply-To: <56C0F150.60008@gmail.com> References: <56B770B6.7040803@gmail.com> <56B77262.7090107@gmail.com> <56C0F150.60008@gmail.com> Date: Mon, 15 Feb 2016 00:12:21 +0100 Message-ID: Subject: Re: richacl(7) man page review comments From: Andreas Gruenbacher X-ASG-Orig-Subj: Re: richacl(7) man page review comments To: "Michael Kerrisk (man-pages)" Cc: "J. Bruce Fields" , linux-ext4 , XFS Developers , lkml , linux-fsdevel , Linux NFS Mailing List , linux-cifs@vger.kernel.org, Linux API , Dave Chinner , Christoph Hellwig , Anna Schumaker , Trond Myklebust , Jeff Layton , Andreas Dilger Content-Type: text/plain; charset=UTF-8 X-Barracuda-Connect: mail-vk0-f54.google.com[209.85.213.54] X-Barracuda-Start-Time: 1455491542 X-Barracuda-Encrypted: ECDHE-RSA-AES128-GCM-SHA256 X-Barracuda-URL: https://192.48.157.11:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-BRTS-Status: 1 X-Barracuda-Spam-Score: 0.00 X-Barracuda-Spam-Status: No, SCORE=0.00 using per-user scores of TAG_LEVEL=1000.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.7 tests=BSF_SC0_MISMATCH_TO X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.3.27035 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 0.00 BSF_SC0_MISMATCH_TO Envelope rcpt doesn't match header On Sun, Feb 14, 2016 at 10:27 PM, Michael Kerrisk (man-pages) wrote: > On 02/12/2016 11:25 PM, Andreas Gruenbacher wrote: >> We could sure move acl(5) and richacl(7) there. > > We already have acl(5) (now "acl(7)" in man pages) ;-). Hmm, I can't find that page either in git://git.kernel.org/pub/scm/docs/man-pages/man-pages or on http://man7.org/. Are you sure you don't mean xattr.7 == attr.5 which documents the xattr syscall interface? Andreas From dave@fromorbit.com Sun Feb 14 23:22:28 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=ham version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay2.corp.sgi.com [137.38.102.29]) by oss.sgi.com (Postfix) with ESMTP id D3C367CA2 for ; Sun, 14 Feb 2016 23:22:28 -0600 (CST) Received: from cuda.sgi.com (cuda3.sgi.com [192.48.176.15]) by relay2.corp.sgi.com (Postfix) with ESMTP id C4EC8304051 for ; Sun, 14 Feb 2016 21:22:25 -0800 (PST) X-ASG-Debug-ID: 1455513741-04cb6c1e58d36c0001-NocioJ Received: from ipmail06.adl2.internode.on.net (ipmail06.adl2.internode.on.net [150.101.137.129]) by cuda.sgi.com with ESMTP id 7GGykP2fNMLlIDek for ; Sun, 14 Feb 2016 21:22:22 -0800 (PST) X-Barracuda-Envelope-From: dave@fromorbit.com X-Barracuda-Apparent-Source-IP: 150.101.137.129 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: A2CwCQA/X8FWPBATLHleKAECgw+IIZ9mAQEBAQEBBo5gglGLO00BAQEBAQEHAQEBAUE/QQ6ETyMYgQIDB4hGvESFSYkJcoNuBZZ5hniVUUSNeoIYAQsBgjQogymERIE5AQEB Received: from ppp121-44-19-16.lns20.syd4.internode.on.net (HELO dastard) ([121.44.19.16]) by ipmail06.adl2.internode.on.net with ESMTP; 15 Feb 2016 15:52:21 +1030 Received: from disappointment.disaster.area ([192.168.1.110] helo=disappointment) by dastard with esmtp (Exim 4.80) (envelope-from ) id 1aVBc3-0000DZ-I9; Mon, 15 Feb 2016 16:22:19 +1100 Received: from dave by disappointment with local (Exim 4.86) (envelope-from ) id 1aVBc3-0003zs-Gv; Mon, 15 Feb 2016 16:22:19 +1100 From: Dave Chinner To: xfs@oss.sgi.com Cc: ross.zwisler@linux.intel.com, jack@suse.cz Subject: [PATCH 0/4] xfs: fixes for XFS_DIFLAG2_DAX support Date: Mon, 15 Feb 2016 16:22:10 +1100 X-ASG-Orig-Subj: [PATCH 0/4] xfs: fixes for XFS_DIFLAG2_DAX support Message-Id: <1455513734-15192-1-git-send-email-david@fromorbit.com> X-Mailer: git-send-email 2.5.0 X-Barracuda-Connect: ipmail06.adl2.internode.on.net[150.101.137.129] X-Barracuda-Start-Time: 1455513742 X-Barracuda-URL: https://192.48.176.15:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-BRTS-Status: 1 X-Barracuda-Spam-Score: 0.00 X-Barracuda-Spam-Status: No, SCORE=0.00 using per-user scores of TAG_LEVEL=1000.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.7 tests= X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.3.27041 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- Hi folks, This is a series to add the correct constraints to using the on-disk inode flag to enable DAX on per-file basis. The same constraints are placed on setting the flag on directories for inheritance purposes. These constraints are: - the inode flag is limited to regular files or directory inodes. - the S_DAX flag is only ever set on regular files - the flag can only ever be set on filesystems which have blocksize == PAGE_SIZE (for now) - When the flag is set or cleared, the current mapping contents are flushed and then invalidated so that the new access mode starts with an empty mapping. - Setting or clearing the flag is atomic w.r.t. IO and page faults. I've tested these manually with xfs_io (patchset for supporting chattr +x/-x to be sent soon), and it all appears to work as expected. I'd like to push these for 4.5-rc6 so the initial kernel with support for this flag doesn't do silly things, so comments, testing and review woul dbe appreciated. Cheers, Dave. From dave@fromorbit.com Sun Feb 14 23:22:30 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=ham version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay2.corp.sgi.com [137.38.102.29]) by oss.sgi.com (Postfix) with ESMTP id 025B97CA2 for ; Sun, 14 Feb 2016 23:22:30 -0600 (CST) Received: from cuda.sgi.com (cuda3.sgi.com [192.48.176.15]) by relay2.corp.sgi.com (Postfix) with ESMTP id E7FCE304051 for ; Sun, 14 Feb 2016 21:22:29 -0800 (PST) X-ASG-Debug-ID: 1455513741-04cb6c1e58d36c0003-NocioJ Received: from ipmail06.adl2.internode.on.net (ipmail06.adl2.internode.on.net [150.101.137.129]) by cuda.sgi.com with ESMTP id x4I1uZbWMfiohKo0 for ; Sun, 14 Feb 2016 21:22:27 -0800 (PST) X-Barracuda-Envelope-From: dave@fromorbit.com X-Barracuda-Apparent-Source-IP: 150.101.137.129 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: A2CjCQA/X8FWPBATLHlWCCgBAoMPgT+GYp9mAQEBAQEBBpExihWBJk0BAQEBAQEHAQEBAUE/QQ6DcwEFJy8jEAgYMTkDBxQZiBm8RIVJiQtKhBQFlnmPMYdphS9EjXqCGAGCQCgugnuFfQEBAQ Received: from ppp121-44-19-16.lns20.syd4.internode.on.net (HELO dastard) ([121.44.19.16]) by ipmail06.adl2.internode.on.net with ESMTP; 15 Feb 2016 15:52:21 +1030 Received: from disappointment.disaster.area ([192.168.1.110] helo=disappointment) by dastard with esmtp (Exim 4.80) (envelope-from ) id 1aVBc3-0000Dc-JT; Mon, 15 Feb 2016 16:22:19 +1100 Received: from dave by disappointment with local (Exim 4.86) (envelope-from ) id 1aVBc3-000408-Ic; Mon, 15 Feb 2016 16:22:19 +1100 From: Dave Chinner To: xfs@oss.sgi.com Cc: ross.zwisler@linux.intel.com, jack@suse.cz Subject: [PATCH 3/4] xfs: dynamically switch modes when XFS_DIFLAG2_DAX is set/cleared Date: Mon, 15 Feb 2016 16:22:13 +1100 X-ASG-Orig-Subj: [PATCH 3/4] xfs: dynamically switch modes when XFS_DIFLAG2_DAX is set/cleared Message-Id: <1455513734-15192-4-git-send-email-david@fromorbit.com> X-Mailer: git-send-email 2.5.0 In-Reply-To: <1455513734-15192-1-git-send-email-david@fromorbit.com> References: <1455513734-15192-1-git-send-email-david@fromorbit.com> X-Barracuda-Connect: ipmail06.adl2.internode.on.net[150.101.137.129] X-Barracuda-Start-Time: 1455513746 X-Barracuda-URL: https://192.48.176.15:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-BRTS-Status: 1 X-Barracuda-Spam-Score: 0.00 X-Barracuda-Spam-Status: No, SCORE=0.00 using per-user scores of TAG_LEVEL=1000.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.7 tests= X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.3.27041 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- From: Dave Chinner When we set or clear the XFS_DIFLAG2_DAX flag, we should also set/clear the S_DAX flag in the VFS inode. To do this, we need to ensure that we first flush and remove any cached entries in the radix tree to ensure the correct data access method is used when we next try to read or write data. We ahve to be especially careful here to lock out page faults so they don't race with the flush and invalidation before we change the access mode. Signed-off-by: Dave Chinner --- fs/xfs/xfs_ioctl.c | 105 ++++++++++++++++++++++++++++++++++++++++++++++------- 1 file changed, 92 insertions(+), 13 deletions(-) diff --git a/fs/xfs/xfs_ioctl.c b/fs/xfs/xfs_ioctl.c index 0895967..a870d16 100644 --- a/fs/xfs/xfs_ioctl.c +++ b/fs/xfs/xfs_ioctl.c @@ -1051,20 +1051,63 @@ xfs_ioctl_setattr_xflags( !capable(CAP_LINUX_IMMUTABLE)) return -EPERM; + xfs_set_diflags(ip, fa->fsx_xflags); + xfs_diflags_to_linux(ip); + xfs_trans_ichgtime(tp, ip, XFS_ICHGTIME_CHG); + xfs_trans_log_inode(tp, ip, XFS_ILOG_CORE); + XFS_STATS_INC(mp, xs_ig_attrchg); + return 0; +} + +/* + * If we are changing DAX flags, we have to ensure the file is clean and any + * cached objects in the address space are invalidated and removed. This + * requires us to lock out other IO and page faults similar to a truncate + * operation. The locks need to be held until the transaction has been committed + * so that the cache invalidation is atomic with respect to the DAX flag + * manipulation. + */ +static int +xfs_ioctl_setattr_dax_invalidate( + struct xfs_inode *ip, + struct fsxattr *fa, + int *join_flags) +{ + struct inode *inode = VFS_I(ip); + int error; + + *join_flags = 0; + /* * It is only valid to set the DAX flag on regular files and * directories. On directories it serves as an inherit hint. */ if ((fa->fsx_xflags & FS_XFLAG_DAX) && - !(S_ISREG(VFS_I(ip)->i_mode) || S_ISDIR(VFS_I(ip)->i_mode))) + !(S_ISREG(inode->i_mode) || S_ISDIR(inode->i_mode))) return -EINVAL; - xfs_set_diflags(ip, fa->fsx_xflags); - xfs_diflags_to_linux(ip); - xfs_trans_ichgtime(tp, ip, XFS_ICHGTIME_CHG); - xfs_trans_log_inode(tp, ip, XFS_ILOG_CORE); - XFS_STATS_INC(mp, xs_ig_attrchg); + /* If the DAX state is not changing, we have nothing to do here. */ + if ((fa->fsx_xflags & FS_XFLAG_DAX) && IS_DAX(inode)) + return 0; + if (!(fa->fsx_xflags & FS_XFLAG_DAX) && !IS_DAX(inode)) + return 0; + + /* lock, flush and invalidate mapping in preparation for flag change */ + xfs_ilock(ip, XFS_MMAPLOCK_EXCL | XFS_IOLOCK_EXCL); + error = filemap_write_and_wait(inode->i_mapping); + if (error) + goto out_unlock; + error = invalidate_inode_pages2(inode->i_mapping); + if (error) + goto out_unlock; + + *join_flags = XFS_MMAPLOCK_EXCL | XFS_IOLOCK_EXCL; return 0; + +out_unlock: + xfs_iunlock(ip, XFS_MMAPLOCK_EXCL | XFS_IOLOCK_EXCL); + return error; + } /* @@ -1072,19 +1115,27 @@ xfs_ioctl_setattr_xflags( * have permission to do so. On success, return a clean transaction and the * inode locked exclusively ready for further operation specific checks. On * failure, return an error without modifying or locking the inode. + * + * The inode might already be IO locked on call. If this is the case, it is + * indicated in @join_flags and we take full responsibility for ensuring they + * are unlocked from now on. Hence if we have an error here, we still have to + * unlock them. Otherwise, once they are joined to the transaction, they will + * be unlocked on commit/cancel. */ static struct xfs_trans * xfs_ioctl_setattr_get_trans( - struct xfs_inode *ip) + struct xfs_inode *ip, + int join_flags) { struct xfs_mount *mp = ip->i_mount; struct xfs_trans *tp; - int error; + int error = -EROFS; if (mp->m_flags & XFS_MOUNT_RDONLY) - return ERR_PTR(-EROFS); + goto out_unlock; + error = -EIO; if (XFS_FORCED_SHUTDOWN(mp)) - return ERR_PTR(-EIO); + goto out_unlock; tp = xfs_trans_alloc(mp, XFS_TRANS_SETATTR_NOT_SIZE); error = xfs_trans_reserve(tp, &M_RES(mp)->tr_ichange, 0, 0); @@ -1092,7 +1143,8 @@ xfs_ioctl_setattr_get_trans( goto out_cancel; xfs_ilock(ip, XFS_ILOCK_EXCL); - xfs_trans_ijoin(tp, ip, XFS_ILOCK_EXCL); + xfs_trans_ijoin(tp, ip, XFS_ILOCK_EXCL | join_flags); + join_flags = 0; /* * CAP_FOWNER overrides the following restrictions: @@ -1112,6 +1164,9 @@ xfs_ioctl_setattr_get_trans( out_cancel: xfs_trans_cancel(tp); +out_unlock: + if (join_flags) + xfs_iunlock(ip, join_flags); return ERR_PTR(error); } @@ -1210,6 +1265,7 @@ xfs_ioctl_setattr( struct xfs_dquot *pdqp = NULL; struct xfs_dquot *olddquot = NULL; int code; + int join_flags = 0; trace_xfs_ioctl_setattr(ip); @@ -1218,6 +1274,17 @@ xfs_ioctl_setattr( return code; /* + * Changing DAX config may require inode locking for mapping + * invalidation. These need to be held all the way to transaction commit + * or cancel time, so need to be passed through to + * xfs_ioctl_setattr_get_trans() so it can apply them to the join call + * appropriately. + */ + code = xfs_ioctl_setattr_dax_invalidate(ip, fa, &join_flags); + if (code) + return code; + + /* * If disk quotas is on, we make sure that the dquots do exist on disk, * before we start any other transactions. Trying to do this later * is messy. We don't care to take a readlock to look at the ids @@ -1233,7 +1300,7 @@ xfs_ioctl_setattr( return code; } - tp = xfs_ioctl_setattr_get_trans(ip); + tp = xfs_ioctl_setattr_get_trans(ip, join_flags); if (IS_ERR(tp)) { code = PTR_ERR(tp); goto error_free_dquots; @@ -1349,6 +1416,7 @@ xfs_ioc_setxflags( struct xfs_trans *tp; struct fsxattr fa; unsigned int flags; + int join_flags = 0; int error; if (copy_from_user(&flags, arg, sizeof(flags))) @@ -1365,7 +1433,18 @@ xfs_ioc_setxflags( if (error) return error; - tp = xfs_ioctl_setattr_get_trans(ip); + /* + * Changing DAX config may require inode locking for mapping + * invalidation. These need to be held all the way to transaction commit + * or cancel time, so need to be passed through to + * xfs_ioctl_setattr_get_trans() so it can apply them to the join call + * appropriately. + */ + error = xfs_ioctl_setattr_dax_invalidate(ip, &fa, &join_flags); + if (error) + goto out_drop_write; + + tp = xfs_ioctl_setattr_get_trans(ip, join_flags); if (IS_ERR(tp)) { error = PTR_ERR(tp); goto out_drop_write; -- 2.5.0 From dave@fromorbit.com Sun Feb 14 23:22:30 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=ham version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay2.corp.sgi.com [137.38.102.29]) by oss.sgi.com (Postfix) with ESMTP id AE7A57CA3 for ; Sun, 14 Feb 2016 23:22:30 -0600 (CST) Received: from cuda.sgi.com (cuda2.sgi.com [192.48.176.25]) by relay2.corp.sgi.com (Postfix) with ESMTP id 9F86E304059 for ; Sun, 14 Feb 2016 21:22:30 -0800 (PST) X-ASG-Debug-ID: 1455513745-04cbb04333e0f90002-NocioJ Received: from ipmail06.adl2.internode.on.net (ipmail06.adl2.internode.on.net [150.101.137.129]) by cuda.sgi.com with ESMTP id PRCzqOfsGhUqecgB for ; Sun, 14 Feb 2016 21:22:28 -0800 (PST) X-Barracuda-Envelope-From: dave@fromorbit.com X-Barracuda-Apparent-Source-IP: 150.101.137.129 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: A2CjCQA/X8FWPBATLHleKAECgw+BP4Zin2YBAQEBAQEGkTGKFYEmTQEBAQEBAQcBAQEBQT9BDoNzAQUnLyMQCBgxOQMHFBmIGbxEhUmJCUwmg24FlnmcSUSNeoIYAYJAKC6Ce4REJIEVAQEB Received: from ppp121-44-19-16.lns20.syd4.internode.on.net (HELO dastard) ([121.44.19.16]) by ipmail06.adl2.internode.on.net with ESMTP; 15 Feb 2016 15:52:21 +1030 Received: from disappointment.disaster.area ([192.168.1.110] helo=disappointment) by dastard with esmtp (Exim 4.80) (envelope-from ) id 1aVBc3-0000Dd-Jx; Mon, 15 Feb 2016 16:22:19 +1100 Received: from dave by disappointment with local (Exim 4.86) (envelope-from ) id 1aVBc3-00040D-J4; Mon, 15 Feb 2016 16:22:19 +1100 From: Dave Chinner To: xfs@oss.sgi.com Cc: ross.zwisler@linux.intel.com, jack@suse.cz Subject: [PATCH 4/4] xfs: XFS_DIFLAG2_DAX limited by PAGE_SIZE Date: Mon, 15 Feb 2016 16:22:14 +1100 X-ASG-Orig-Subj: [PATCH 4/4] xfs: XFS_DIFLAG2_DAX limited by PAGE_SIZE Message-Id: <1455513734-15192-5-git-send-email-david@fromorbit.com> X-Mailer: git-send-email 2.5.0 In-Reply-To: <1455513734-15192-1-git-send-email-david@fromorbit.com> References: <1455513734-15192-1-git-send-email-david@fromorbit.com> X-Barracuda-Connect: ipmail06.adl2.internode.on.net[150.101.137.129] X-Barracuda-Start-Time: 1455513747 X-Barracuda-URL: https://192.48.176.25:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-BRTS-Status: 1 X-Barracuda-Spam-Score: 0.00 X-Barracuda-Spam-Status: No, SCORE=0.00 using per-user scores of TAG_LEVEL=1000.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.7 tests= X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.3.27041 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- From: Dave Chinner If the block size of a filesystem is not at least PAGE_SIZEd, then at this point in time DAX cannot be used due to the fact we can't guarantee extents are page sized or aligned without further work. Hence disallow setting the DAX flag on an inode if the block size is too small. Also, be defensive and check the block size when reading an inode in off disk. In future, we want to allow DAX to work on any filesystem, so this is temporary while we sort of the correct conbination of extent size hints and allocation alignment configurations needed to guarantee page sized and aligned extent allocation for DAX enabled files. Signed-off-by: Dave Chinner --- fs/xfs/xfs_ioctl.c | 12 ++++++++---- fs/xfs/xfs_iops.c | 1 + 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/fs/xfs/xfs_ioctl.c b/fs/xfs/xfs_ioctl.c index a870d16..8e9cd3c 100644 --- a/fs/xfs/xfs_ioctl.c +++ b/fs/xfs/xfs_ioctl.c @@ -1080,11 +1080,15 @@ xfs_ioctl_setattr_dax_invalidate( /* * It is only valid to set the DAX flag on regular files and - * directories. On directories it serves as an inherit hint. + * directories on filesystems where the block size is at least the page + * size. On directories it serves as an inherit hint. */ - if ((fa->fsx_xflags & FS_XFLAG_DAX) && - !(S_ISREG(inode->i_mode) || S_ISDIR(inode->i_mode))) - return -EINVAL; + if (fa->fsx_xflags & FS_XFLAG_DAX) { + if (!(S_ISREG(inode->i_mode) || S_ISDIR(inode->i_mode))) + return -EINVAL; + if (ip->i_mount->m_sb.sb_blocksize != PAGE_SIZE) + return -EINVAL; + } /* If the DAX state is not changing, we have nothing to do here. */ if ((fa->fsx_xflags & FS_XFLAG_DAX) && IS_DAX(inode)) diff --git a/fs/xfs/xfs_iops.c b/fs/xfs/xfs_iops.c index 9c984a0..fb7dc61 100644 --- a/fs/xfs/xfs_iops.c +++ b/fs/xfs/xfs_iops.c @@ -1186,6 +1186,7 @@ xfs_diflags_to_iflags( if (flags & XFS_DIFLAG_NOATIME) inode->i_flags |= S_NOATIME; if (S_ISREG(inode->i_mode) && + ip->i_mount->m_sb.sb_blocksize == PAGE_SIZE && (ip->i_mount->m_flags & XFS_MOUNT_DAX || ip->i_d.di_flags2 & XFS_DIFLAG2_DAX)) inode->i_flags |= S_DAX; -- 2.5.0 From dave@fromorbit.com Sun Feb 14 23:22:31 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=ham version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay3.corp.sgi.com [198.149.34.15]) by oss.sgi.com (Postfix) with ESMTP id 026C67CA2 for ; Sun, 14 Feb 2016 23:22:31 -0600 (CST) Received: from cuda.sgi.com (cuda3.sgi.com [192.48.176.15]) by relay3.corp.sgi.com (Postfix) with ESMTP id 98371AC004 for ; Sun, 14 Feb 2016 21:22:27 -0800 (PST) X-ASG-Debug-ID: 1455513741-04cb6c1e58d36c0002-NocioJ Received: from ipmail06.adl2.internode.on.net (ipmail06.adl2.internode.on.net [150.101.137.129]) by cuda.sgi.com with ESMTP id bqzCEAMzcG1Ock3Z for ; Sun, 14 Feb 2016 21:22:24 -0800 (PST) X-Barracuda-Envelope-From: dave@fromorbit.com X-Barracuda-Apparent-Source-IP: 150.101.137.129 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: A2CjCQA/X8FWPBATLHleKAECgw+BP4Zin2YBAQEBAQEGkTGKFYEmTQEBAQEBAQcBAQEBQT9BDoNzAQUnLyMQCBgxOQMHFBmIGbxEhUmJVSaDbgWWeZxJRI16ghgBgkAoLoJ7hX0BAQE Received: from ppp121-44-19-16.lns20.syd4.internode.on.net (HELO dastard) ([121.44.19.16]) by ipmail06.adl2.internode.on.net with ESMTP; 15 Feb 2016 15:52:21 +1030 Received: from disappointment.disaster.area ([192.168.1.110] helo=disappointment) by dastard with esmtp (Exim 4.80) (envelope-from ) id 1aVBc3-0000Db-J1; Mon, 15 Feb 2016 16:22:19 +1100 Received: from dave by disappointment with local (Exim 4.86) (envelope-from ) id 1aVBc3-000403-IA; Mon, 15 Feb 2016 16:22:19 +1100 From: Dave Chinner To: xfs@oss.sgi.com Cc: ross.zwisler@linux.intel.com, jack@suse.cz Subject: [PATCH 2/4] xfs: S_DAX is only for regular files Date: Mon, 15 Feb 2016 16:22:12 +1100 X-ASG-Orig-Subj: [PATCH 2/4] xfs: S_DAX is only for regular files Message-Id: <1455513734-15192-3-git-send-email-david@fromorbit.com> X-Mailer: git-send-email 2.5.0 In-Reply-To: <1455513734-15192-1-git-send-email-david@fromorbit.com> References: <1455513734-15192-1-git-send-email-david@fromorbit.com> X-Barracuda-Connect: ipmail06.adl2.internode.on.net[150.101.137.129] X-Barracuda-Start-Time: 1455513744 X-Barracuda-URL: https://192.48.176.15:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-BRTS-Status: 1 X-Barracuda-Spam-Score: 2.50 X-Barracuda-Spam-Status: No, SCORE=2.50 using per-user scores of TAG_LEVEL=1000.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.7 tests=BSF_SC2_SA016_OB, BSF_SC2_SA016_OB_ENV X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.3.27041 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 1.00 BSF_SC2_SA016_OB Custom Rule SA016_OB 1.50 BSF_SC2_SA016_OB_ENV Custom Rule SA016_OB_ENV From: Dave Chinner Only regular files can use DAX for data operations, so we should restrict setting it on the VFS inode to regular files. Setting it on metadata inodes may cause the VFS to do the wrong thing for such inodes, so avoid potential problems by restricting the scope of the flag to what we know is supported. Signed-off-by: Dave Chinner --- fs/xfs/xfs_iops.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/fs/xfs/xfs_iops.c b/fs/xfs/xfs_iops.c index 0d38b1d..9c984a0 100644 --- a/fs/xfs/xfs_iops.c +++ b/fs/xfs/xfs_iops.c @@ -1185,8 +1185,9 @@ xfs_diflags_to_iflags( inode->i_flags |= S_SYNC; if (flags & XFS_DIFLAG_NOATIME) inode->i_flags |= S_NOATIME; - if (ip->i_mount->m_flags & XFS_MOUNT_DAX || - ip->i_d.di_flags2 & XFS_DIFLAG2_DAX) + if (S_ISREG(inode->i_mode) && + (ip->i_mount->m_flags & XFS_MOUNT_DAX || + ip->i_d.di_flags2 & XFS_DIFLAG2_DAX)) inode->i_flags |= S_DAX; } -- 2.5.0 From dave@fromorbit.com Sun Feb 14 23:22:31 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=ham version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay1.corp.sgi.com [137.38.102.111]) by oss.sgi.com (Postfix) with ESMTP id 748987CA4 for ; Sun, 14 Feb 2016 23:22:31 -0600 (CST) Received: from cuda.sgi.com (cuda2.sgi.com [192.48.176.25]) by relay1.corp.sgi.com (Postfix) with ESMTP id 619FC8F8049 for ; Sun, 14 Feb 2016 21:22:28 -0800 (PST) X-ASG-Debug-ID: 1455513745-04cbb04333e0f90001-NocioJ Received: from ipmail06.adl2.internode.on.net (ipmail06.adl2.internode.on.net [150.101.137.129]) by cuda.sgi.com with ESMTP id ddk28fLQ4EEMfllF for ; Sun, 14 Feb 2016 21:22:25 -0800 (PST) X-Barracuda-Envelope-From: dave@fromorbit.com X-Barracuda-Apparent-Source-IP: 150.101.137.129 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: A2CjCQA/X8FWPBATLHleKAECgw+BP4Zin2YBAQEBAQEGkTGKFYEmTQEBAQEBAQcBAQEBQT9BDoNzAQUnLyMQCBgxOQMHFBmIGbxEhUmJCksmg24FlnmcSUSNeoIYAYJAKC6Ce4RFgTgBAQE Received: from ppp121-44-19-16.lns20.syd4.internode.on.net (HELO dastard) ([121.44.19.16]) by ipmail06.adl2.internode.on.net with ESMTP; 15 Feb 2016 15:52:21 +1030 Received: from disappointment.disaster.area ([192.168.1.110] helo=disappointment) by dastard with esmtp (Exim 4.80) (envelope-from ) id 1aVBc3-0000Da-Ia; Mon, 15 Feb 2016 16:22:19 +1100 Received: from dave by disappointment with local (Exim 4.86) (envelope-from ) id 1aVBc3-0003zv-Hh; Mon, 15 Feb 2016 16:22:19 +1100 From: Dave Chinner To: xfs@oss.sgi.com Cc: ross.zwisler@linux.intel.com, jack@suse.cz Subject: [PATCH 1/4] xfs: XFS_DIFLAG_DAX is only for regular files or directories Date: Mon, 15 Feb 2016 16:22:11 +1100 X-ASG-Orig-Subj: [PATCH 1/4] xfs: XFS_DIFLAG_DAX is only for regular files or directories Message-Id: <1455513734-15192-2-git-send-email-david@fromorbit.com> X-Mailer: git-send-email 2.5.0 In-Reply-To: <1455513734-15192-1-git-send-email-david@fromorbit.com> References: <1455513734-15192-1-git-send-email-david@fromorbit.com> X-Barracuda-Connect: ipmail06.adl2.internode.on.net[150.101.137.129] X-Barracuda-Start-Time: 1455513745 X-Barracuda-URL: https://192.48.176.25:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-BRTS-Status: 1 X-Barracuda-Spam-Score: 0.00 X-Barracuda-Spam-Status: No, SCORE=0.00 using per-user scores of TAG_LEVEL=1000.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.7 tests= X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.3.27041 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- From: Dave Chinner Only file data can use DAX, so we should onyl be able to set this flag on regular files. However, the flag also serves as an "inherit" flag at file create time when set on directories, so limit the FS_IOC_FSSETXATTR ioctl to only set this flag on regular files and directories. Signed-off-by: Dave Chinner --- fs/xfs/xfs_ioctl.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/fs/xfs/xfs_ioctl.c b/fs/xfs/xfs_ioctl.c index 81d6d62..0895967 100644 --- a/fs/xfs/xfs_ioctl.c +++ b/fs/xfs/xfs_ioctl.c @@ -1051,6 +1051,14 @@ xfs_ioctl_setattr_xflags( !capable(CAP_LINUX_IMMUTABLE)) return -EPERM; + /* + * It is only valid to set the DAX flag on regular files and + * directories. On directories it serves as an inherit hint. + */ + if ((fa->fsx_xflags & FS_XFLAG_DAX) && + !(S_ISREG(VFS_I(ip)->i_mode) || S_ISDIR(VFS_I(ip)->i_mode))) + return -EINVAL; + xfs_set_diflags(ip, fa->fsx_xflags); xfs_diflags_to_linux(ip); xfs_trans_ichgtime(tp, ip, XFS_ICHGTIME_CHG); -- 2.5.0 From dave@fromorbit.com Sun Feb 14 23:32:33 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=ham version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay3.corp.sgi.com [198.149.34.15]) by oss.sgi.com (Postfix) with ESMTP id 3AD417CA2 for ; Sun, 14 Feb 2016 23:32:33 -0600 (CST) Received: from cuda.sgi.com (cuda1.sgi.com [192.48.157.11]) by relay3.corp.sgi.com (Postfix) with ESMTP id D09CFAC003 for ; Sun, 14 Feb 2016 21:32:32 -0800 (PST) X-ASG-Debug-ID: 1455514350-04bdf066ecce9c0001-NocioJ Received: from ipmail06.adl2.internode.on.net (ipmail06.adl2.internode.on.net [150.101.137.129]) by cuda.sgi.com with ESMTP id uFPMfQddHMOas5Yh for ; Sun, 14 Feb 2016 21:32:30 -0800 (PST) X-Barracuda-Envelope-From: dave@fromorbit.com X-Barracuda-Apparent-Source-IP: 150.101.137.129 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: A2BwDQCmYcFWPBATLHleKAECgw+IIZ9mAQEBAQEBBpExiztNAQEBAQEBBwEBAQFBP0EOAYROIxiBAgMHiEa8RoVJiXuDbgWSboQLnElEjXqCGAELAYI0KIMphX0BAQE Received: from ppp121-44-19-16.lns20.syd4.internode.on.net (HELO dastard) ([121.44.19.16]) by ipmail06.adl2.internode.on.net with ESMTP; 15 Feb 2016 16:02:29 +1030 Received: from disappointment.disaster.area ([192.168.1.110] helo=disappointment) by dastard with esmtp (Exim 4.80) (envelope-from ) id 1aVBlt-0000GV-3W; Mon, 15 Feb 2016 16:32:29 +1100 Received: from dave by disappointment with local (Exim 4.86) (envelope-from ) id 1aVBlt-0004Jm-2J; Mon, 15 Feb 2016 16:32:29 +1100 From: Dave Chinner To: xfs@oss.sgi.com Cc: ross.zwisler@linux.intel.com, jack@suse.cz Subject: [PATCH 0/3] xfsprogs: FS_IOC_FS[SG]ETXATTR and DAX support Date: Mon, 15 Feb 2016 16:32:23 +1100 X-ASG-Orig-Subj: [PATCH 0/3] xfsprogs: FS_IOC_FS[SG]ETXATTR and DAX support Message-Id: <1455514346-15481-1-git-send-email-david@fromorbit.com> X-Mailer: git-send-email 2.5.0 X-Barracuda-Connect: ipmail06.adl2.internode.on.net[150.101.137.129] X-Barracuda-Start-Time: 1455514350 X-Barracuda-URL: https://192.48.157.11:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-BRTS-Status: 1 X-Barracuda-Spam-Score: 0.00 X-Barracuda-Spam-Status: No, SCORE=0.00 using per-user scores of TAG_LEVEL=1000.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.7 tests= X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.3.27041 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- Hi folks, There are two parts to this patchset. The first is ensuring that xfsprogs builds correctly with the new kernel header provided definitions of XFS_IOC_FS[SG]SETXATTR and it's flags. I modified my original approach to this to hide the definitions of the FS* ioctl and flags in the platofrm headers if the system didn't provide them. While this does result in some duplication, it solves the problem of needing different definitions for FS_IOC_FS[SG]ETXATTR on different platforms - they are different ioctl names on IRIX, so we can't just define it once in xfs_fs.h. The detection can also then be different - we only include the definitions on linux if we don't have the system version, and on the other platforms it retains the HAVE_FSXATTR guards. The second and third patches are adding support for the FS_XFLAG_DAX and enabling xfs_io to set, get and clear the flag. Actual support of the on disk flag in libxfs will come in a later patchset that adds support into db and repair, too. This is the patchset I used to test the kernel side flag support. Comments and testing welcome. Cheers, Dave. From dave@fromorbit.com Sun Feb 14 23:32:34 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=ham version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay3.corp.sgi.com [198.149.34.15]) by oss.sgi.com (Postfix) with ESMTP id 310C529DF6 for ; Sun, 14 Feb 2016 23:32:34 -0600 (CST) Received: from cuda.sgi.com (cuda1.sgi.com [192.48.157.11]) by relay3.corp.sgi.com (Postfix) with ESMTP id CBBEBAC004 for ; Sun, 14 Feb 2016 21:32:33 -0800 (PST) X-ASG-Debug-ID: 1455514350-04bdf066ecce9c0002-NocioJ Received: from ipmail06.adl2.internode.on.net (ipmail06.adl2.internode.on.net [150.101.137.129]) by cuda.sgi.com with ESMTP id LQUJsOXc4WC9FHbY for ; Sun, 14 Feb 2016 21:32:32 -0800 (PST) X-Barracuda-Envelope-From: dave@fromorbit.com X-Barracuda-Apparent-Source-IP: 150.101.137.129 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: A2B3DQCmYcFWPBATLHleKAECgw+BP4Zin2YBAQEBAQEGkTGKFYEmTQEBAQEBAQcBAQEBQT9BDgGDcgEFViMQCBgxOQMHFBmIGbxGhUmJVSaDbgWWeZxJjj6CGAFGBRmBXCgugnuFfQEBAQ Received: from ppp121-44-19-16.lns20.syd4.internode.on.net (HELO dastard) ([121.44.19.16]) by ipmail06.adl2.internode.on.net with ESMTP; 15 Feb 2016 16:02:30 +1030 Received: from disappointment.disaster.area ([192.168.1.110] helo=disappointment) by dastard with esmtp (Exim 4.80) (envelope-from ) id 1aVBlt-0000GY-4j; Mon, 15 Feb 2016 16:32:29 +1100 Received: from dave by disappointment with local (Exim 4.86) (envelope-from ) id 1aVBlt-0004Ju-3j; Mon, 15 Feb 2016 16:32:29 +1100 From: Dave Chinner To: xfs@oss.sgi.com Cc: ross.zwisler@linux.intel.com, jack@suse.cz Subject: [PATCH 2/3] xfs: introduce per-inode DAX enablement Date: Mon, 15 Feb 2016 16:32:25 +1100 X-ASG-Orig-Subj: [PATCH 2/3] xfs: introduce per-inode DAX enablement Message-Id: <1455514346-15481-3-git-send-email-david@fromorbit.com> X-Mailer: git-send-email 2.5.0 In-Reply-To: <1455514346-15481-1-git-send-email-david@fromorbit.com> References: <1455514346-15481-1-git-send-email-david@fromorbit.com> X-Barracuda-Connect: ipmail06.adl2.internode.on.net[150.101.137.129] X-Barracuda-Start-Time: 1455514352 X-Barracuda-URL: https://192.48.157.11:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-BRTS-Status: 1 X-Barracuda-Spam-Score: 0.00 X-Barracuda-Spam-Status: No, SCORE=0.00 using per-user scores of TAG_LEVEL=1000.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.7 tests= X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.3.27041 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- From: Dave Chinner Source kernel commit 58f88ca2df7270881de2034c8286233a89efe71c Rather than just being able to turn DAX on and off via a mount option, some applications may only want to enable DAX for certain performance critical files in a filesystem. This patch introduces a new inode flag to enable DAX in the v3 inode di_flags2 field. It adds support for setting and clearing flags in the di_flags2 field via the XFS_IOC_FSSETXATTR ioctl, and sets the S_DAX inode flag appropriately when it is seen. When this flag is set on a directory, it acts as an "inherit flag". That is, inodes created in the directory will automatically inherit the on-disk inode DAX flag, enabling administrators to set up directory heirarchies that automatically use DAX. Setting this flag on an empty root directory will make the entire filesystem use DAX by default. Signed-off-by: Dave Chinner Signed-off-by: Dave Chinner --- libxfs/xfs_format.h | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/libxfs/xfs_format.h b/libxfs/xfs_format.h index 967b1ef..7eae0a5 100644 --- a/libxfs/xfs_format.h +++ b/libxfs/xfs_format.h @@ -1024,6 +1024,15 @@ static inline void xfs_dinode_put_rdev(struct xfs_dinode *dip, xfs_dev_t rdev) XFS_DIFLAG_EXTSZINHERIT | XFS_DIFLAG_NODEFRAG | XFS_DIFLAG_FILESTREAM) /* + * Values for di_flags2 These start by being exposed to userspace in the upper + * 16 bits of the XFS_XFLAG_s range. + */ +#define XFS_DIFLAG2_DAX_BIT 0 /* use DAX for this inode */ +#define XFS_DIFLAG2_DAX (1 << XFS_DIFLAG2_DAX_BIT) + +#define XFS_DIFLAG2_ANY (XFS_DIFLAG2_DAX) + +/* * Inode number format: * low inopblog bits - offset in block * next agblklog bits - block number in ag -- 2.5.0 From dave@fromorbit.com Sun Feb 14 23:32:35 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=ham version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay3.corp.sgi.com [198.149.34.15]) by oss.sgi.com (Postfix) with ESMTP id 2E27C29DF6 for ; Sun, 14 Feb 2016 23:32:35 -0600 (CST) Received: from cuda.sgi.com (cuda1.sgi.com [192.48.157.11]) by relay3.corp.sgi.com (Postfix) with ESMTP id D1BBFAC003 for ; Sun, 14 Feb 2016 21:32:34 -0800 (PST) X-ASG-Debug-ID: 1455514352-04bdf066ebce9c0001-NocioJ Received: from ipmail06.adl2.internode.on.net (ipmail06.adl2.internode.on.net [150.101.137.129]) by cuda.sgi.com with ESMTP id 2IXDWacpAnxHFDqC for ; Sun, 14 Feb 2016 21:32:32 -0800 (PST) X-Barracuda-Envelope-From: dave@fromorbit.com X-Barracuda-Apparent-Source-IP: 150.101.137.129 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: A2B3DQCmYcFWPBATLHleKAECgw+BP4Zin2YBAQEBAQEGjmCCUYs7TQEBAQEBAQcBAQEBQT9BDgGDcgEFViMQCBgxOQMHFBmIGbxGhUmIfYRsBZZ5hniVUUSNeoIYAUsZgVwoLoJ7hESBOQEBAQ Received: from ppp121-44-19-16.lns20.syd4.internode.on.net (HELO dastard) ([121.44.19.16]) by ipmail06.adl2.internode.on.net with ESMTP; 15 Feb 2016 16:02:30 +1030 Received: from disappointment.disaster.area ([192.168.1.110] helo=disappointment) by dastard with esmtp (Exim 4.80) (envelope-from ) id 1aVBlt-0000GZ-58; Mon, 15 Feb 2016 16:32:29 +1100 Received: from dave by disappointment with local (Exim 4.86) (envelope-from ) id 1aVBlt-0004Jz-4B; Mon, 15 Feb 2016 16:32:29 +1100 From: Dave Chinner To: xfs@oss.sgi.com Cc: ross.zwisler@linux.intel.com, jack@suse.cz Subject: [PATCH 3/3] xfs_io: add support for changing the new inode DAX attribute Date: Mon, 15 Feb 2016 16:32:26 +1100 X-ASG-Orig-Subj: [PATCH 3/3] xfs_io: add support for changing the new inode DAX attribute Message-Id: <1455514346-15481-4-git-send-email-david@fromorbit.com> X-Mailer: git-send-email 2.5.0 In-Reply-To: <1455514346-15481-1-git-send-email-david@fromorbit.com> References: <1455514346-15481-1-git-send-email-david@fromorbit.com> X-Barracuda-Connect: ipmail06.adl2.internode.on.net[150.101.137.129] X-Barracuda-Start-Time: 1455514352 X-Barracuda-URL: https://192.48.157.11:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-BRTS-Status: 1 X-Barracuda-Spam-Score: 0.00 X-Barracuda-Spam-Status: No, SCORE=0.00 using per-user scores of TAG_LEVEL=1000.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.7 tests= X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.3.27041 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- From: Dave Chinner It is changed via the FS_IOC_FSSETXATTR ioctl, so add the new flag to the platform definitions for userspace that don't this API. Then add support to the relevant xfs_io chattr and stat commands. Signed-off-by: Dave Chinner --- include/darwin.h | 1 + include/freebsd.h | 1 + include/irix.h | 1 + include/linux.h | 1 + io/attr.c | 5 ++++- 5 files changed, 8 insertions(+), 1 deletion(-) diff --git a/include/darwin.h b/include/darwin.h index 2baa536..a52030d 100644 --- a/include/darwin.h +++ b/include/darwin.h @@ -312,6 +312,7 @@ struct fsxattr { #define FS_XFLAG_EXTSZINHERIT 0x00001000 /* inherit inode extent size */ #define FS_XFLAG_NODEFRAG 0x00002000 /* do not defragment */ #define FS_XFLAG_FILESTREAM 0x00004000 /* use filestream allocator */ +#define FS_XFLAG_DAX 0x00008000 /* use DAX for IO */ #define FS_XFLAG_HASATTR 0x80000000 /* no DIFLAG for this */ #define FS_IOC_FSGETXATTR _IOR ('X', 31, struct fsxattr) diff --git a/include/freebsd.h b/include/freebsd.h index fe567d4..f7e0c75 100644 --- a/include/freebsd.h +++ b/include/freebsd.h @@ -202,6 +202,7 @@ struct fsxattr { #define FS_XFLAG_EXTSZINHERIT 0x00001000 /* inherit inode extent size */ #define FS_XFLAG_NODEFRAG 0x00002000 /* do not defragment */ #define FS_XFLAG_FILESTREAM 0x00004000 /* use filestream allocator */ +#define FS_XFLAG_DAX 0x00008000 /* use DAX for IO */ #define FS_XFLAG_HASATTR 0x80000000 /* no DIFLAG for this */ #define FS_IOC_FSGETXATTR _IOR ('X', 31, struct fsxattr) diff --git a/include/irix.h b/include/irix.h index bdb4b6a..c2191ee 100644 --- a/include/irix.h +++ b/include/irix.h @@ -447,6 +447,7 @@ struct fsxattr { #define FS_XFLAG_EXTSZINHERIT 0x00001000 /* inherit inode extent size */ #define FS_XFLAG_NODEFRAG 0x00002000 /* do not defragment */ #define FS_XFLAG_FILESTREAM 0x00004000 /* use filestream allocator */ +#define FS_XFLAG_DAX 0x00008000 /* use DAX for IO */ #define FS_XFLAG_HASATTR 0x80000000 /* no DIFLAG for this */ #define FS_IOC_FSGETXATTR F_FSGETXATTR diff --git a/include/linux.h b/include/linux.h index 17391c3..cc0f70c 100644 --- a/include/linux.h +++ b/include/linux.h @@ -205,6 +205,7 @@ struct fsxattr { #define FS_XFLAG_EXTSZINHERIT 0x00001000 /* inherit inode extent size */ #define FS_XFLAG_NODEFRAG 0x00002000 /* do not defragment */ #define FS_XFLAG_FILESTREAM 0x00004000 /* use filestream allocator */ +#define FS_XFLAG_DAX 0x00008000 /* use DAX for IO */ #define FS_XFLAG_HASATTR 0x80000000 /* no DIFLAG for this */ #define FS_IOC_FSGETXATTR _IOR ('X', 31, struct fsxattr) diff --git a/io/attr.c b/io/attr.c index 6fa08bf..0186b1d 100644 --- a/io/attr.c +++ b/io/attr.c @@ -47,9 +47,10 @@ static struct xflags { { FS_XFLAG_EXTSZINHERIT, "E", "extsz-inherit" }, { FS_XFLAG_NODEFRAG, "f", "no-defrag" }, { FS_XFLAG_FILESTREAM, "S", "filestream" }, + { FS_XFLAG_DAX, "x", "dax" }, { 0, NULL, NULL } }; -#define CHATTR_XFLAG_LIST "r"/*p*/"iasAdtPneEfS" +#define CHATTR_XFLAG_LIST "r"/*p*/"iasAdtPneEfSx" static void lsattr_help(void) @@ -73,6 +74,7 @@ lsattr_help(void) " E -- children created in this directory inherit the extent size value\n" " f -- do not include this file when defragmenting the filesystem\n" " S -- enable filestreams allocator for this directory\n" +" x -- Use direct access (DAX) for data in this file\n" "\n" " Options:\n" " -R -- recursively descend (useful when current file is a directory)\n" @@ -108,6 +110,7 @@ chattr_help(void) " +/-E -- set/clear the extent-size inheritance flag\n" " +/-f -- set/clear the no-defrag flag\n" " +/-S -- set/clear the filestreams allocator flag\n" +" +/-x -- set/clear the direct access (DAX) flag\n" " Note1: user must have certain capabilities to modify immutable/append-only.\n" " Note2: immutable/append-only files cannot be deleted; removing these files\n" " requires the immutable/append-only flag to be cleared first.\n" -- 2.5.0 From dave@fromorbit.com Sun Feb 14 23:32:38 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=ham version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay2.corp.sgi.com [137.38.102.29]) by oss.sgi.com (Postfix) with ESMTP id 877387CA2 for ; Sun, 14 Feb 2016 23:32:38 -0600 (CST) Received: from cuda.sgi.com (cuda1.sgi.com [192.48.157.11]) by relay2.corp.sgi.com (Postfix) with ESMTP id 5032E304059 for ; Sun, 14 Feb 2016 21:32:38 -0800 (PST) X-ASG-Debug-ID: 1455514350-04bdf066ecce9c0003-NocioJ Received: from ipmail06.adl2.internode.on.net (ipmail06.adl2.internode.on.net [150.101.137.129]) by cuda.sgi.com with ESMTP id bs8nhOqerszAH83V for ; Sun, 14 Feb 2016 21:32:33 -0800 (PST) X-Barracuda-Envelope-From: dave@fromorbit.com X-Barracuda-Apparent-Source-IP: 150.101.137.129 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: A2B7DQCmYcFWPBATLHleKAECgw+BP4Zin2YBAQEBAQEGjmCCUYhvgkxNAQEBAQEBBwEBAQFBP0EOAYNyAQUaDS8jEAgYMTkDBxQZiBm8RoVJiRSEVQWHUAOFVIEviCOGeIg5h2mFL0SFK4hPghgBSxmBXCgugnuERYE4AQEB Received: from ppp121-44-19-16.lns20.syd4.internode.on.net (HELO dastard) ([121.44.19.16]) by ipmail06.adl2.internode.on.net with ESMTP; 15 Feb 2016 16:02:29 +1030 Received: from disappointment.disaster.area ([192.168.1.110] helo=disappointment) by dastard with esmtp (Exim 4.80) (envelope-from ) id 1aVBlt-0000GX-45; Mon, 15 Feb 2016 16:32:29 +1100 Received: from dave by disappointment with local (Exim 4.86) (envelope-from ) id 1aVBlt-0004Jp-37; Mon, 15 Feb 2016 16:32:29 +1100 From: Dave Chinner To: xfs@oss.sgi.com Cc: ross.zwisler@linux.intel.com, jack@suse.cz Subject: [PATCH 1/3] xfs_fs.h: XFS_IOC_FS[SG]SETXATTR to FS_IOC_FS[SG]ETXATTR promotion Date: Mon, 15 Feb 2016 16:32:24 +1100 X-ASG-Orig-Subj: [PATCH 1/3] xfs_fs.h: XFS_IOC_FS[SG]SETXATTR to FS_IOC_FS[SG]ETXATTR promotion Message-Id: <1455514346-15481-2-git-send-email-david@fromorbit.com> X-Mailer: git-send-email 2.5.0 In-Reply-To: <1455514346-15481-1-git-send-email-david@fromorbit.com> References: <1455514346-15481-1-git-send-email-david@fromorbit.com> X-Barracuda-Connect: ipmail06.adl2.internode.on.net[150.101.137.129] X-Barracuda-Start-Time: 1455514353 X-Barracuda-URL: https://192.48.157.11:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-BRTS-Status: 1 X-Barracuda-Spam-Score: 0.00 X-Barracuda-Spam-Status: No, SCORE=0.00 using per-user scores of TAG_LEVEL=1000.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.7 tests= X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.3.27041 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- From: Dave Chinner The kernel commit to make this ioctl promotion (bb99e06ddf) moved the definitions for the XFS ioctl to uapi/linux/fs.h for the following reason: Hoist the ioctl definitions for the XFS_IOC_FS[SG]SETXATTR API from fs/xfs/libxfs/xfs_fs.h to include/uapi/linux/fs.h so that the ioctls can be used by all filesystems, not just XFS. This enables (initially) ext4 to use the ioctl to set project IDs on inodes. This means we now need to handle this change in userspace as the uapi/linux/fs.h file may not contain the definitions (i.e. new xfsprogs/ old linux uapi files) xfsprogs needs to build. Hence we need to massage the definition in xfs_fs.h to take the values from the system header if it exists, otherwise keep the old definitions for compatibility and platforms other than linux. To this extent, we add the FS* definitions to the platform headers so the FS* versions are available on all platforms, and add trivial defines to xfs_fs.h to present the XFS* versions for backwards compatibility with existing code. New code should always use the FS* versions, and as such we also convert all the users of XFS* in xfsprogs to use the FS* definitions. Signed-off-by: Dave Chinner --- fsr/xfs_fsr.c | 16 ++++++---------- include/darwin.h | 34 +++++++++++++++++++++++++++++++++ include/freebsd.h | 34 +++++++++++++++++++++++++++++++++ include/irix.h | 37 +++++++++++++++++++++++++++++++++--- include/linux.h | 38 +++++++++++++++++++++++++++++++++++++ io/attr.c | 40 +++++++++++++++++++-------------------- io/bmap.c | 16 ++++++++-------- io/open.c | 32 +++++++++++++++---------------- libxcmd/projects.c | 8 ++++---- libxfs/xfs_format.h | 2 -- libxfs/xfs_fs.h | 54 +++++++++++++++++++++-------------------------------- quota/free.c | 6 +++--- quota/project.c | 16 ++++++++-------- repair/dinode.c | 4 ++-- rtcp/xfs_rtcp.c | 12 ++++++------ 15 files changed, 234 insertions(+), 115 deletions(-) diff --git a/fsr/xfs_fsr.c b/fsr/xfs_fsr.c index 19838ed..d75990a 100644 --- a/fsr/xfs_fsr.c +++ b/fsr/xfs_fsr.c @@ -33,10 +33,6 @@ #include #include -#ifndef XFS_XFLAG_NODEFRAG -#define XFS_XFLAG_NODEFRAG 0x00002000 /* src dependancy, remove later */ -#endif - #define _PATH_FSRLAST "/var/tmp/.fsrlast_xfs" #define _PATH_PROC_MOUNTS "/proc/mounts" @@ -962,22 +958,22 @@ fsrfile_common( return 1; } - if ((ioctl(fd, XFS_IOC_FSGETXATTR, &fsx)) < 0) { + if ((ioctl(fd, FS_IOC_FSGETXATTR, &fsx)) < 0) { fsrprintf(_("failed to get inode attrs: %s\n"), fname); return(-1); } - if (fsx.fsx_xflags & (XFS_XFLAG_IMMUTABLE|XFS_XFLAG_APPEND)) { + if (fsx.fsx_xflags & (FS_XFLAG_IMMUTABLE|FS_XFLAG_APPEND)) { if (vflag) fsrprintf(_("%s: immutable/append, ignoring\n"), fname); return(0); } - if (fsx.fsx_xflags & XFS_XFLAG_NODEFRAG) { + if (fsx.fsx_xflags & FS_XFLAG_NODEFRAG) { if (vflag) fsrprintf(_("%s: marked as don't defrag, ignoring\n"), fname); return(0); } - if (fsx.fsx_xflags & XFS_XFLAG_REALTIME) { + if (fsx.fsx_xflags & FS_XFLAG_REALTIME) { if (xfs_getrt(fd, &vfss) < 0) { fsrprintf(_("cannot get realtime geometry for: %s\n"), fname); @@ -1038,7 +1034,7 @@ fsr_setup_attr_fork( int no_change_cnt = 0; int ret; - if (!(bstatp->bs_xflags & XFS_XFLAG_HASATTR)) + if (!(bstatp->bs_xflags & FS_XFLAG_HASATTR)) return 0; /* @@ -1264,7 +1260,7 @@ packfile(char *fname, char *tname, int fd, /* Setup extended inode flags, project identifier, etc */ if (fsxp->fsx_xflags || fsxp->fsx_projid) { - if (ioctl(tfd, XFS_IOC_FSSETXATTR, fsxp) < 0) { + if (ioctl(tfd, FS_IOC_FSSETXATTR, fsxp) < 0) { fsrprintf(_("could not set inode attrs on tmp: %s\n"), tname); goto out; diff --git a/include/darwin.h b/include/darwin.h index dd6132f..2baa536 100644 --- a/include/darwin.h +++ b/include/darwin.h @@ -285,4 +285,38 @@ static inline void platform_mntent_close(struct mntent_cursor * cursor) cursor->i = 0; } +/* check whether we have to define FS_IOC_FS[GS]ETXATTR ourselves */ +#ifndef HAVE_FSXATTR +struct fsxattr { + __u32 fsx_xflags; /* xflags field value (get/set) */ + __u32 fsx_extsize; /* extsize field value (get/set)*/ + __u32 fsx_nextents; /* nextents field value (get) */ + __u32 fsx_projid; /* project identifier (get/set) */ + unsigned char fsx_pad[12]; +}; + +/* + * Flags for the fsx_xflags field + */ +#define FS_XFLAG_REALTIME 0x00000001 /* data in realtime volume */ +#define FS_XFLAG_PREALLOC 0x00000002 /* preallocated file extents */ +#define FS_XFLAG_IMMUTABLE 0x00000008 /* file cannot be modified */ +#define FS_XFLAG_APPEND 0x00000010 /* all writes append */ +#define FS_XFLAG_SYNC 0x00000020 /* all writes synchronous */ +#define FS_XFLAG_NOATIME 0x00000040 /* do not update access time */ +#define FS_XFLAG_NODUMP 0x00000080 /* do not include in backups */ +#define FS_XFLAG_RTINHERIT 0x00000100 /* create with rt bit set */ +#define FS_XFLAG_PROJINHERIT 0x00000200 /* create with parents projid */ +#define FS_XFLAG_NOSYMLINKS 0x00000400 /* disallow symlink creation */ +#define FS_XFLAG_EXTSIZE 0x00000800 /* extent size allocator hint */ +#define FS_XFLAG_EXTSZINHERIT 0x00001000 /* inherit inode extent size */ +#define FS_XFLAG_NODEFRAG 0x00002000 /* do not defragment */ +#define FS_XFLAG_FILESTREAM 0x00004000 /* use filestream allocator */ +#define FS_XFLAG_HASATTR 0x80000000 /* no DIFLAG for this */ + +#define FS_IOC_FSGETXATTR _IOR ('X', 31, struct fsxattr) +#define FS_IOC_FSSETXATTR _IOW ('X', 32, struct fsxattr) + +#endif + #endif /* __XFS_DARWIN_H__ */ diff --git a/include/freebsd.h b/include/freebsd.h index 65bd60a..fe567d4 100644 --- a/include/freebsd.h +++ b/include/freebsd.h @@ -175,5 +175,39 @@ static inline void platform_mntent_close(struct mntent_cursor * cursor) endmntent(cursor->mtabp); } +/* check whether we have to define FS_IOC_FS[GS]ETXATTR ourselves */ +#ifndef HAVE_FSXATTR +struct fsxattr { + __u32 fsx_xflags; /* xflags field value (get/set) */ + __u32 fsx_extsize; /* extsize field value (get/set)*/ + __u32 fsx_nextents; /* nextents field value (get) */ + __u32 fsx_projid; /* project identifier (get/set) */ + unsigned char fsx_pad[12]; +}; + +/* + * Flags for the fsx_xflags field + */ +#define FS_XFLAG_REALTIME 0x00000001 /* data in realtime volume */ +#define FS_XFLAG_PREALLOC 0x00000002 /* preallocated file extents */ +#define FS_XFLAG_IMMUTABLE 0x00000008 /* file cannot be modified */ +#define FS_XFLAG_APPEND 0x00000010 /* all writes append */ +#define FS_XFLAG_SYNC 0x00000020 /* all writes synchronous */ +#define FS_XFLAG_NOATIME 0x00000040 /* do not update access time */ +#define FS_XFLAG_NODUMP 0x00000080 /* do not include in backups */ +#define FS_XFLAG_RTINHERIT 0x00000100 /* create with rt bit set */ +#define FS_XFLAG_PROJINHERIT 0x00000200 /* create with parents projid */ +#define FS_XFLAG_NOSYMLINKS 0x00000400 /* disallow symlink creation */ +#define FS_XFLAG_EXTSIZE 0x00000800 /* extent size allocator hint */ +#define FS_XFLAG_EXTSZINHERIT 0x00001000 /* inherit inode extent size */ +#define FS_XFLAG_NODEFRAG 0x00002000 /* do not defragment */ +#define FS_XFLAG_FILESTREAM 0x00004000 /* use filestream allocator */ +#define FS_XFLAG_HASATTR 0x80000000 /* no DIFLAG for this */ + +#define FS_IOC_FSGETXATTR _IOR ('X', 31, struct fsxattr) +#define FS_IOC_FSSETXATTR _IOW ('X', 32, struct fsxattr) + +#endif + #endif /* __XFS_FREEBSD_H__ */ diff --git a/include/irix.h b/include/irix.h index 293f869..bdb4b6a 100644 --- a/include/irix.h +++ b/include/irix.h @@ -378,8 +378,6 @@ static __inline__ char * strsep(char **s, const char *ct) #define __XFS_FS_H__ 1 #define XFS_IOC_DIOINFO F_DIOINFO -#define XFS_IOC_FSGETXATTR F_FSGETXATTR -#define XFS_IOC_FSSETXATTR F_FSSETXATTR #define XFS_IOC_ALLOCSP64 F_ALLOCSP64 #define XFS_IOC_FREESP64 F_FREESP64 #define XFS_IOC_GETBMAP F_GETBMAP @@ -422,7 +420,40 @@ static __inline__ char * strsep(char **s, const char *ct) #define _AIOCB64_T_DEFINED 1 -#define XFS_XFLAG_NODEFRAG 0x00002000 +/* check whether we have to define FS_IOC_FS[GS]ETXATTR ourselves */ +#ifndef HAVE_FSXATTR +struct fsxattr { + __u32 fsx_xflags; /* xflags field value (get/set) */ + __u32 fsx_extsize; /* extsize field value (get/set)*/ + __u32 fsx_nextents; /* nextents field value (get) */ + __u32 fsx_projid; /* project identifier (get/set) */ + unsigned char fsx_pad[12]; +}; + +/* + * Flags for the fsx_xflags field + */ +#define FS_XFLAG_REALTIME 0x00000001 /* data in realtime volume */ +#define FS_XFLAG_PREALLOC 0x00000002 /* preallocated file extents */ +#define FS_XFLAG_IMMUTABLE 0x00000008 /* file cannot be modified */ +#define FS_XFLAG_APPEND 0x00000010 /* all writes append */ +#define FS_XFLAG_SYNC 0x00000020 /* all writes synchronous */ +#define FS_XFLAG_NOATIME 0x00000040 /* do not update access time */ +#define FS_XFLAG_NODUMP 0x00000080 /* do not include in backups */ +#define FS_XFLAG_RTINHERIT 0x00000100 /* create with rt bit set */ +#define FS_XFLAG_PROJINHERIT 0x00000200 /* create with parents projid */ +#define FS_XFLAG_NOSYMLINKS 0x00000400 /* disallow symlink creation */ +#define FS_XFLAG_EXTSIZE 0x00000800 /* extent size allocator hint */ +#define FS_XFLAG_EXTSZINHERIT 0x00001000 /* inherit inode extent size */ +#define FS_XFLAG_NODEFRAG 0x00002000 /* do not defragment */ +#define FS_XFLAG_FILESTREAM 0x00004000 /* use filestream allocator */ +#define FS_XFLAG_HASATTR 0x80000000 /* no DIFLAG for this */ + +#define FS_IOC_FSGETXATTR F_FSGETXATTR +#define FS_IOC_FSSETXATTR F_FSSETXATTR + +#endif + /** * Abstraction of mountpoints. diff --git a/include/linux.h b/include/linux.h index 16fb707..17391c3 100644 --- a/include/linux.h +++ b/include/linux.h @@ -174,4 +174,42 @@ static inline void platform_mntent_close(struct mntent_cursor * cursor) endmntent(cursor->mtabp); } +/* + * Check whether we have to define FS_IOC_FS[GS]ETXATTR ourselves. These + * are a copy of the definitions moved to linux/uapi/fs.h in the 4.5 kernel, + * so this is purely for supporting builds against old kernel headers. + */ +#ifndef FS_IOC_FSGETXATTR +struct fsxattr { + __u32 fsx_xflags; /* xflags field value (get/set) */ + __u32 fsx_extsize; /* extsize field value (get/set)*/ + __u32 fsx_nextents; /* nextents field value (get) */ + __u32 fsx_projid; /* project identifier (get/set) */ + unsigned char fsx_pad[12]; +}; + +/* + * Flags for the fsx_xflags field + */ +#define FS_XFLAG_REALTIME 0x00000001 /* data in realtime volume */ +#define FS_XFLAG_PREALLOC 0x00000002 /* preallocated file extents */ +#define FS_XFLAG_IMMUTABLE 0x00000008 /* file cannot be modified */ +#define FS_XFLAG_APPEND 0x00000010 /* all writes append */ +#define FS_XFLAG_SYNC 0x00000020 /* all writes synchronous */ +#define FS_XFLAG_NOATIME 0x00000040 /* do not update access time */ +#define FS_XFLAG_NODUMP 0x00000080 /* do not include in backups */ +#define FS_XFLAG_RTINHERIT 0x00000100 /* create with rt bit set */ +#define FS_XFLAG_PROJINHERIT 0x00000200 /* create with parents projid */ +#define FS_XFLAG_NOSYMLINKS 0x00000400 /* disallow symlink creation */ +#define FS_XFLAG_EXTSIZE 0x00000800 /* extent size allocator hint */ +#define FS_XFLAG_EXTSZINHERIT 0x00001000 /* inherit inode extent size */ +#define FS_XFLAG_NODEFRAG 0x00002000 /* do not defragment */ +#define FS_XFLAG_FILESTREAM 0x00004000 /* use filestream allocator */ +#define FS_XFLAG_HASATTR 0x80000000 /* no DIFLAG for this */ + +#define FS_IOC_FSGETXATTR _IOR ('X', 31, struct fsxattr) +#define FS_IOC_FSSETXATTR _IOW ('X', 32, struct fsxattr) + +#endif + #endif /* __XFS_LINUX_H__ */ diff --git a/io/attr.c b/io/attr.c index 7cbcc3c..6fa08bf 100644 --- a/io/attr.c +++ b/io/attr.c @@ -33,20 +33,20 @@ static struct xflags { char *shortname; char *longname; } xflags[] = { - { XFS_XFLAG_REALTIME, "r", "realtime" }, - { XFS_XFLAG_PREALLOC, "p", "prealloc" }, - { XFS_XFLAG_IMMUTABLE, "i", "immutable" }, - { XFS_XFLAG_APPEND, "a", "append-only" }, - { XFS_XFLAG_SYNC, "s", "sync" }, - { XFS_XFLAG_NOATIME, "A", "no-atime" }, - { XFS_XFLAG_NODUMP, "d", "no-dump" }, - { XFS_XFLAG_RTINHERIT, "t", "rt-inherit" }, - { XFS_XFLAG_PROJINHERIT, "P", "proj-inherit" }, - { XFS_XFLAG_NOSYMLINKS, "n", "nosymlinks" }, - { XFS_XFLAG_EXTSIZE, "e", "extsize" }, - { XFS_XFLAG_EXTSZINHERIT, "E", "extsz-inherit" }, - { XFS_XFLAG_NODEFRAG, "f", "no-defrag" }, - { XFS_XFLAG_FILESTREAM, "S", "filestream" }, + { FS_XFLAG_REALTIME, "r", "realtime" }, + { FS_XFLAG_PREALLOC, "p", "prealloc" }, + { FS_XFLAG_IMMUTABLE, "i", "immutable" }, + { FS_XFLAG_APPEND, "a", "append-only" }, + { FS_XFLAG_SYNC, "s", "sync" }, + { FS_XFLAG_NOATIME, "A", "no-atime" }, + { FS_XFLAG_NODUMP, "d", "no-dump" }, + { FS_XFLAG_RTINHERIT, "t", "rt-inherit" }, + { FS_XFLAG_PROJINHERIT, "P", "proj-inherit" }, + { FS_XFLAG_NOSYMLINKS, "n", "nosymlinks" }, + { FS_XFLAG_EXTSIZE, "e", "extsize" }, + { FS_XFLAG_EXTSZINHERIT, "E", "extsz-inherit" }, + { FS_XFLAG_NODEFRAG, "f", "no-defrag" }, + { FS_XFLAG_FILESTREAM, "S", "filestream" }, { 0, NULL, NULL } }; #define CHATTR_XFLAG_LIST "r"/*p*/"iasAdtPneEfS" @@ -169,7 +169,7 @@ lsattr_callback( if ((fd = open(path, O_RDONLY)) == -1) fprintf(stderr, _("%s: cannot open %s: %s\n"), progname, path, strerror(errno)); - else if ((xfsctl(path, fd, XFS_IOC_FSGETXATTR, &fsx)) < 0) + else if ((xfsctl(path, fd, FS_IOC_FSGETXATTR, &fsx)) < 0) fprintf(stderr, _("%s: cannot get flags on %s: %s\n"), progname, path, strerror(errno)); else @@ -216,7 +216,7 @@ lsattr_f( if (recurse_all || recurse_dir) { nftw(name, lsattr_callback, 100, FTW_PHYS | FTW_MOUNT | FTW_DEPTH); - } else if ((xfsctl(name, file->fd, XFS_IOC_FSGETXATTR, &fsx)) < 0) { + } else if ((xfsctl(name, file->fd, FS_IOC_FSGETXATTR, &fsx)) < 0) { fprintf(stderr, _("%s: cannot get flags on %s: %s\n"), progname, name, strerror(errno)); } else { @@ -245,13 +245,13 @@ chattr_callback( if ((fd = open(path, O_RDONLY)) == -1) { fprintf(stderr, _("%s: cannot open %s: %s\n"), progname, path, strerror(errno)); - } else if (xfsctl(path, fd, XFS_IOC_FSGETXATTR, &attr) < 0) { + } else if (xfsctl(path, fd, FS_IOC_FSGETXATTR, &attr) < 0) { fprintf(stderr, _("%s: cannot get flags on %s: %s\n"), progname, path, strerror(errno)); } else { attr.fsx_xflags |= orflags; attr.fsx_xflags &= ~andflags; - if (xfsctl(path, fd, XFS_IOC_FSSETXATTR, &attr) < 0) + if (xfsctl(path, fd, FS_IOC_FSSETXATTR, &attr) < 0) fprintf(stderr, _("%s: cannot set flags on %s: %s\n"), progname, path, strerror(errno)); } @@ -316,13 +316,13 @@ chattr_f( if (recurse_all || recurse_dir) { nftw(name, chattr_callback, 100, FTW_PHYS | FTW_MOUNT | FTW_DEPTH); - } else if (xfsctl(name, file->fd, XFS_IOC_FSGETXATTR, &attr) < 0) { + } else if (xfsctl(name, file->fd, FS_IOC_FSGETXATTR, &attr) < 0) { fprintf(stderr, _("%s: cannot get flags on %s: %s\n"), progname, name, strerror(errno)); } else { attr.fsx_xflags |= orflags; attr.fsx_xflags &= ~andflags; - if (xfsctl(name, file->fd, XFS_IOC_FSSETXATTR, &attr) < 0) + if (xfsctl(name, file->fd, FS_IOC_FSSETXATTR, &attr) < 0) fprintf(stderr, _("%s: cannot set flags on %s: %s\n"), progname, name, strerror(errno)); } diff --git a/io/bmap.c b/io/bmap.c index cbeed3b..04d04c7 100644 --- a/io/bmap.c +++ b/io/bmap.c @@ -125,7 +125,7 @@ bmap_f( exitcode = 1; return 0; } - c = xfsctl(file->name, file->fd, XFS_IOC_FSGETXATTR, &fsx); + c = xfsctl(file->name, file->fd, FS_IOC_FSGETXATTR, &fsx); if (c < 0) { fprintf(stderr, _("%s: cannot read attrs on \"%s\": %s\n"), @@ -134,7 +134,7 @@ bmap_f( return 0; } - if (fsx.fsx_xflags == XFS_XFLAG_REALTIME) { + if (fsx.fsx_xflags == FS_XFLAG_REALTIME) { /* * ag info not applicable to rt, continue * without ag output. @@ -157,7 +157,7 @@ bmap_f( * by nflag, or the initial guess number of extents (32). * * If there are more extents than we guessed, use xfsctl - * (XFS_IOC_FSGETXATTR[A]) to get the extent count, realloc some more + * (FS_IOC_FSGETXATTR[A]) to get the extent count, realloc some more * space based on this count, and try again. * * If the initial FGETBMAPX attempt returns EINVAL, this may mean @@ -165,13 +165,13 @@ bmap_f( * EINVAL, check the length with fstat() and return "no extents" * if the length == 0. * - * Why not do the xfsctl(XFS_IOC_FSGETXATTR[A]) first? Two reasons: + * Why not do the xfsctl(FS_IOC_FSGETXATTR[A]) first? Two reasons: * (1) The extent count may be wrong for a file with delayed * allocation blocks. The XFS_IOC_GETBMAPX forces the real * allocation and fixes up the extent count. * (2) For XFS_IOC_GETBMAP[X] on a DMAPI file that has been moved * offline by a DMAPI application (e.g., DMF) the - * XFS_IOC_FSGETXATTR only reflects the extents actually online. + * FS_IOC_FSGETXATTR only reflects the extents actually online. * Doing XFS_IOC_GETBMAPX call first forces that data blocks online * and then everything proceeds normally (see PV #545725). * @@ -207,13 +207,13 @@ bmap_f( break; if (map->bmv_entries < map->bmv_count-1) break; - /* Get number of extents from xfsctl XFS_IOC_FSGETXATTR[A] + /* Get number of extents from xfsctl FS_IOC_FSGETXATTR[A] * syscall. */ i = xfsctl(file->name, file->fd, aflag ? - XFS_IOC_FSGETXATTRA : XFS_IOC_FSGETXATTR, &fsx); + XFS_IOC_FSGETXATTRA : FS_IOC_FSGETXATTR, &fsx); if (i < 0) { - fprintf(stderr, "%s: xfsctl(XFS_IOC_FSGETXATTR%s) " + fprintf(stderr, "%s: xfsctl(FS_IOC_FSGETXATTR%s) " "[\"%s\"]: %s\n", progname, aflag ? "A" : "", file->name, strerror(errno)); free(map); diff --git a/io/open.c b/io/open.c index ac5a5e0..037843d 100644 --- a/io/open.c +++ b/io/open.c @@ -115,9 +115,9 @@ stat_f( } if (file->flags & IO_FOREIGN) return 0; - if ((xfsctl(file->name, file->fd, XFS_IOC_FSGETXATTR, &fsx)) < 0 || + if ((xfsctl(file->name, file->fd, FS_IOC_FSGETXATTR, &fsx)) < 0 || (xfsctl(file->name, file->fd, XFS_IOC_FSGETXATTRA, &fsxa)) < 0) { - perror("XFS_IOC_FSGETXATTR"); + perror("FS_IOC_FSGETXATTR"); } else { printf(_("fsxattr.xflags = 0x%x "), fsx.fsx_xflags); printxattr(fsx.fsx_xflags, verbose, 0, file->name, 1, 1); @@ -193,15 +193,15 @@ openfile( if (!(flags & IO_READONLY) && (flags & IO_REALTIME)) { struct fsxattr attr; - if (xfsctl(path, fd, XFS_IOC_FSGETXATTR, &attr) < 0) { - perror("XFS_IOC_FSGETXATTR"); + if (xfsctl(path, fd, FS_IOC_FSGETXATTR, &attr) < 0) { + perror("FS_IOC_FSGETXATTR"); close(fd); return -1; } - if (!(attr.fsx_xflags & XFS_XFLAG_REALTIME)) { - attr.fsx_xflags |= XFS_XFLAG_REALTIME; - if (xfsctl(path, fd, XFS_IOC_FSSETXATTR, &attr) < 0) { - perror("XFS_IOC_FSSETXATTR"); + if (!(attr.fsx_xflags & FS_XFLAG_REALTIME)) { + attr.fsx_xflags |= FS_XFLAG_REALTIME; + if (xfsctl(path, fd, FS_IOC_FSSETXATTR, &attr) < 0) { + perror("FS_IOC_FSSETXATTR"); close(fd); return -1; } @@ -559,8 +559,8 @@ get_extsize(const char *path, int fd) { struct fsxattr fsx; - if ((xfsctl(path, fd, XFS_IOC_FSGETXATTR, &fsx)) < 0) { - printf("%s: XFS_IOC_FSGETXATTR %s: %s\n", + if ((xfsctl(path, fd, FS_IOC_FSGETXATTR, &fsx)) < 0) { + printf("%s: FS_IOC_FSGETXATTR %s: %s\n", progname, path, strerror(errno)); return 0; } @@ -578,24 +578,24 @@ set_extsize(const char *path, int fd, long extsz) perror("fstat64"); return 0; } - if ((xfsctl(path, fd, XFS_IOC_FSGETXATTR, &fsx)) < 0) { - printf("%s: XFS_IOC_FSGETXATTR %s: %s\n", + if ((xfsctl(path, fd, FS_IOC_FSGETXATTR, &fsx)) < 0) { + printf("%s: FS_IOC_FSGETXATTR %s: %s\n", progname, path, strerror(errno)); return 0; } if (S_ISREG(stat.st_mode)) { - fsx.fsx_xflags |= XFS_XFLAG_EXTSIZE; + fsx.fsx_xflags |= FS_XFLAG_EXTSIZE; } else if (S_ISDIR(stat.st_mode)) { - fsx.fsx_xflags |= XFS_XFLAG_EXTSZINHERIT; + fsx.fsx_xflags |= FS_XFLAG_EXTSZINHERIT; } else { printf(_("invalid target file type - file %s\n"), path); return 0; } fsx.fsx_extsize = extsz; - if ((xfsctl(path, fd, XFS_IOC_FSSETXATTR, &fsx)) < 0) { - printf("%s: XFS_IOC_FSSETXATTR %s: %s\n", + if ((xfsctl(path, fd, FS_IOC_FSSETXATTR, &fsx)) < 0) { + printf("%s: FS_IOC_FSSETXATTR %s: %s\n", progname, path, strerror(errno)); return 0; } diff --git a/libxcmd/projects.c b/libxcmd/projects.c index 24ef70a..c9e863d 100644 --- a/libxcmd/projects.c +++ b/libxcmd/projects.c @@ -176,8 +176,8 @@ getprojid( { struct fsxattr fsx; - if (xfsctl(name, fd, XFS_IOC_FSGETXATTR, &fsx)) { - perror("XFS_IOC_FSGETXATTR"); + if (xfsctl(name, fd, FS_IOC_FSGETXATTR, &fsx)) { + perror("FS_IOC_FSGETXATTR"); return -1; } *projid = fsx.fsx_projid; @@ -193,9 +193,9 @@ setprojid( struct fsxattr fsx; int error; - if ((error = xfsctl(name, fd, XFS_IOC_FSGETXATTR, &fsx)) == 0) { + if ((error = xfsctl(name, fd, FS_IOC_FSGETXATTR, &fsx)) == 0) { fsx.fsx_projid = projid; - error = xfsctl(name, fd, XFS_IOC_FSSETXATTR, &fsx); + error = xfsctl(name, fd, FS_IOC_FSSETXATTR, &fsx); } return error; } diff --git a/libxfs/xfs_format.h b/libxfs/xfs_format.h index a35009a..967b1ef 100644 --- a/libxfs/xfs_format.h +++ b/libxfs/xfs_format.h @@ -984,8 +984,6 @@ static inline void xfs_dinode_put_rdev(struct xfs_dinode *dip, xfs_dev_t rdev) /* * Values for di_flags - * There should be a one-to-one correspondence between these flags and the - * XFS_XFLAG_s. */ #define XFS_DIFLAG_REALTIME_BIT 0 /* file's blocks come from rt area */ #define XFS_DIFLAG_PREALLOC_BIT 1 /* file space has been preallocated */ diff --git a/libxfs/xfs_fs.h b/libxfs/xfs_fs.h index d8b733a..b9622ba 100644 --- a/libxfs/xfs_fs.h +++ b/libxfs/xfs_fs.h @@ -36,38 +36,28 @@ struct dioattr { #endif /* - * Structure for XFS_IOC_FSGETXATTR[A] and XFS_IOC_FSSETXATTR. + * Flags for the bs_xflags/fsx_xflags field in XFS_IOC_FS[GS]ETXATTR[A] + * These are for backwards compatibility only. New code should + * use the kernel [4.5 onwards] defined FS_XFLAG_* definitions directly. */ -#ifndef HAVE_FSXATTR -struct fsxattr { - __u32 fsx_xflags; /* xflags field value (get/set) */ - __u32 fsx_extsize; /* extsize field value (get/set)*/ - __u32 fsx_nextents; /* nextents field value (get) */ - __u32 fsx_projid; /* project identifier (get/set) */ - unsigned char fsx_pad[12]; -}; -#endif - -/* - * Flags for the bs_xflags/fsx_xflags field - * There should be a one-to-one correspondence between these flags and the - * XFS_DIFLAG_s. - */ -#define XFS_XFLAG_REALTIME 0x00000001 /* data in realtime volume */ -#define XFS_XFLAG_PREALLOC 0x00000002 /* preallocated file extents */ -#define XFS_XFLAG_IMMUTABLE 0x00000008 /* file cannot be modified */ -#define XFS_XFLAG_APPEND 0x00000010 /* all writes append */ -#define XFS_XFLAG_SYNC 0x00000020 /* all writes synchronous */ -#define XFS_XFLAG_NOATIME 0x00000040 /* do not update access time */ -#define XFS_XFLAG_NODUMP 0x00000080 /* do not include in backups */ -#define XFS_XFLAG_RTINHERIT 0x00000100 /* create with rt bit set */ -#define XFS_XFLAG_PROJINHERIT 0x00000200 /* create with parents projid */ -#define XFS_XFLAG_NOSYMLINKS 0x00000400 /* disallow symlink creation */ -#define XFS_XFLAG_EXTSIZE 0x00000800 /* extent size allocator hint */ -#define XFS_XFLAG_EXTSZINHERIT 0x00001000 /* inherit inode extent size */ -#define XFS_XFLAG_NODEFRAG 0x00002000 /* do not defragment */ -#define XFS_XFLAG_FILESTREAM 0x00004000 /* use filestream allocator */ -#define XFS_XFLAG_HASATTR 0x80000000 /* no DIFLAG for this */ +#define XFS_XFLAG_REALTIME FS_XFLAG_REALTIME +#define XFS_XFLAG_PREALLOC FS_XFLAG_PREALLOC +#define XFS_XFLAG_IMMUTABLE FS_XFLAG_IMMUTABLE +#define XFS_XFLAG_APPEND FS_XFLAG_APPEND +#define XFS_XFLAG_SYNC FS_XFLAG_SYNC +#define XFS_XFLAG_NOATIME FS_XFLAG_NOATIME +#define XFS_XFLAG_NODUMP FS_XFLAG_NODUMP +#define XFS_XFLAG_RTINHERIT FS_XFLAG_RTINHERIT +#define XFS_XFLAG_PROJINHERIT FS_XFLAG_PROJINHERIT +#define XFS_XFLAG_NOSYMLINKS FS_XFLAG_NOSYMLINKS +#define XFS_XFLAG_EXTSIZE FS_XFLAG_EXTSIZE +#define XFS_XFLAG_EXTSZINHERIT FS_XFLAG_EXTSZINHERIT +#define XFS_XFLAG_NODEFRAG FS_XFLAG_NODEFRAG +#define XFS_XFLAG_FILESTREAM FS_XFLAG_FILESTREAM +#define XFS_XFLAG_HASATTR FS_XFLAG_HASATTR + +#define XFS_IOC_FSGETXATTR FS_IOC_FSGETXATTR +#define XFS_IOC_FSSETXATTR FS_IOC_FSSETXATTR /* * Structure for XFS_IOC_GETBMAP. @@ -513,8 +503,6 @@ typedef struct xfs_swapext #define XFS_IOC_ALLOCSP _IOW ('X', 10, struct xfs_flock64) #define XFS_IOC_FREESP _IOW ('X', 11, struct xfs_flock64) #define XFS_IOC_DIOINFO _IOR ('X', 30, struct dioattr) -#define XFS_IOC_FSGETXATTR _IOR ('X', 31, struct fsxattr) -#define XFS_IOC_FSSETXATTR _IOW ('X', 32, struct fsxattr) #define XFS_IOC_ALLOCSP64 _IOW ('X', 36, struct xfs_flock64) #define XFS_IOC_FREESP64 _IOW ('X', 37, struct xfs_flock64) #define XFS_IOC_GETBMAP _IOWR('X', 38, struct getbmap) diff --git a/quota/free.c b/quota/free.c index dcbe8ce..e9e0319 100644 --- a/quota/free.c +++ b/quota/free.c @@ -143,13 +143,13 @@ projects_free_space_data( return 0; } - if ((xfsctl(path->fs_dir, fd, XFS_IOC_FSGETXATTR, &fsx)) < 0) { + if ((xfsctl(path->fs_dir, fd, FS_IOC_FSGETXATTR, &fsx)) < 0) { exitcode = 1; - perror("XFS_IOC_FSGETXATTR"); + perror("FS_IOC_FSGETXATTR"); close(fd); return 0; } - if (!(fsx.fsx_xflags & XFS_XFLAG_PROJINHERIT)) { + if (!(fsx.fsx_xflags & FS_XFLAG_PROJINHERIT)) { exitcode = 1; fprintf(stderr, _("%s: project quota flag not set on %s\n"), progname, path->fs_dir); diff --git a/quota/project.c b/quota/project.c index 17a83b0..fb8b9e1 100644 --- a/quota/project.c +++ b/quota/project.c @@ -117,7 +117,7 @@ check_project( exitcode = 1; fprintf(stderr, _("%s: cannot open %s: %s\n"), progname, path, strerror(errno)); - } else if ((xfsctl(path, fd, XFS_IOC_FSGETXATTR, &fsx)) < 0) { + } else if ((xfsctl(path, fd, FS_IOC_FSGETXATTR, &fsx)) < 0) { exitcode = 1; fprintf(stderr, _("%s: cannot get flags on %s: %s\n"), progname, path, strerror(errno)); @@ -126,7 +126,7 @@ check_project( printf(_("%s - project identifier is not set" " (inode=%u, tree=%u)\n"), path, fsx.fsx_projid, (unsigned int)prid); - if (!(fsx.fsx_xflags & XFS_XFLAG_PROJINHERIT)) + if (!(fsx.fsx_xflags & FS_XFLAG_PROJINHERIT)) printf(_("%s - project inheritance flag is not set\n"), path); } @@ -163,7 +163,7 @@ clear_project( fprintf(stderr, _("%s: cannot open %s: %s\n"), progname, path, strerror(errno)); return 0; - } else if (xfsctl(path, fd, XFS_IOC_FSGETXATTR, &fsx) < 0) { + } else if (xfsctl(path, fd, FS_IOC_FSGETXATTR, &fsx) < 0) { exitcode = 1; fprintf(stderr, _("%s: cannot get flags on %s: %s\n"), progname, path, strerror(errno)); @@ -172,8 +172,8 @@ clear_project( } fsx.fsx_projid = 0; - fsx.fsx_xflags &= ~XFS_XFLAG_PROJINHERIT; - if (xfsctl(path, fd, XFS_IOC_FSSETXATTR, &fsx) < 0) { + fsx.fsx_xflags &= ~FS_XFLAG_PROJINHERIT; + if (xfsctl(path, fd, FS_IOC_FSSETXATTR, &fsx) < 0) { exitcode = 1; fprintf(stderr, _("%s: cannot clear project on %s: %s\n"), progname, path, strerror(errno)); @@ -210,7 +210,7 @@ setup_project( fprintf(stderr, _("%s: cannot open %s: %s\n"), progname, path, strerror(errno)); return 0; - } else if (xfsctl(path, fd, XFS_IOC_FSGETXATTR, &fsx) < 0) { + } else if (xfsctl(path, fd, FS_IOC_FSGETXATTR, &fsx) < 0) { exitcode = 1; fprintf(stderr, _("%s: cannot get flags on %s: %s\n"), progname, path, strerror(errno)); @@ -219,8 +219,8 @@ setup_project( } fsx.fsx_projid = prid; - fsx.fsx_xflags |= XFS_XFLAG_PROJINHERIT; - if (xfsctl(path, fd, XFS_IOC_FSSETXATTR, &fsx) < 0) { + fsx.fsx_xflags |= FS_XFLAG_PROJINHERIT; + if (xfsctl(path, fd, FS_IOC_FSSETXATTR, &fsx) < 0) { exitcode = 1; fprintf(stderr, _("%s: cannot set project on %s: %s\n"), progname, path, strerror(errno)); diff --git a/repair/dinode.c b/repair/dinode.c index df28e9e..cbd4305 100644 --- a/repair/dinode.c +++ b/repair/dinode.c @@ -2423,7 +2423,7 @@ _("bad (negative) size %" PRId64 " on inode %" PRIu64 "\n"), XFS_DIFLAG_NOSYMLINKS); } } - if (flags & (XFS_DIFLAG_REALTIME | XFS_XFLAG_EXTSIZE)) { + if (flags & (XFS_DIFLAG_REALTIME | FS_XFLAG_EXTSIZE)) { /* must be a file */ if (di_mode && !S_ISREG(di_mode)) { if (!uncertain) { @@ -2432,7 +2432,7 @@ _("bad (negative) size %" PRId64 " on inode %" PRIu64 "\n"), lino); } flags &= ~(XFS_DIFLAG_REALTIME | - XFS_XFLAG_EXTSIZE); + FS_XFLAG_EXTSIZE); } } if (!verify_mode && flags != be16_to_cpu(dino->di_flags)) { diff --git a/rtcp/xfs_rtcp.c b/rtcp/xfs_rtcp.c index f604b46..3044350 100644 --- a/rtcp/xfs_rtcp.c +++ b/rtcp/xfs_rtcp.c @@ -186,13 +186,13 @@ rtcp( char *source, char *target, int fextsize) /* * mark the file as a realtime file */ - fsxattr.fsx_xflags = XFS_XFLAG_REALTIME; + fsxattr.fsx_xflags = FS_XFLAG_REALTIME; if (fextsize != -1 ) fsxattr.fsx_extsize = fextsize; else fsxattr.fsx_extsize = 0; - if ( xfsctl(tbuf, tofd, XFS_IOC_FSSETXATTR, &fsxattr) ) { + if ( xfsctl(tbuf, tofd, FS_IOC_FSSETXATTR, &fsxattr) ) { fprintf(stderr, _("%s: set attributes on %s failed: %s\n"), progname, tbuf, strerror(errno)); @@ -210,7 +210,7 @@ rtcp( char *source, char *target, int fextsize) return( -1 ); } - if ( xfsctl(tbuf, tofd, XFS_IOC_FSGETXATTR, &fsxattr) ) { + if ( xfsctl(tbuf, tofd, FS_IOC_FSGETXATTR, &fsxattr) ) { fprintf(stderr, _("%s: get attributes of %s failed: %s\n"), progname, tbuf, strerror(errno)); @@ -221,7 +221,7 @@ rtcp( char *source, char *target, int fextsize) /* * check if the existing file is already a realtime file */ - if ( !(fsxattr.fsx_xflags & XFS_XFLAG_REALTIME) ) { + if ( !(fsxattr.fsx_xflags & FS_XFLAG_REALTIME) ) { fprintf(stderr, _("%s: %s is not a realtime file.\n"), progname, tbuf); close( tofd ); @@ -255,10 +255,10 @@ rtcp( char *source, char *target, int fextsize) fsxattr.fsx_xflags = 0; fsxattr.fsx_extsize = 0; - if ( xfsctl(source, fromfd, XFS_IOC_FSGETXATTR, &fsxattr) ) { + if ( xfsctl(source, fromfd, FS_IOC_FSGETXATTR, &fsxattr) ) { reopen = 1; } else { - if (! (fsxattr.fsx_xflags & XFS_XFLAG_REALTIME) ){ + if (! (fsxattr.fsx_xflags & FS_XFLAG_REALTIME) ){ fprintf(stderr, _("%s: %s is not a realtime file.\n"), progname, source); reopen = 1; -- 2.5.0 From dave@fromorbit.com Mon Feb 15 00:18:58 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=ham version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay1.corp.sgi.com [137.38.102.111]) by oss.sgi.com (Postfix) with ESMTP id EACB47CA2 for ; Mon, 15 Feb 2016 00:18:58 -0600 (CST) Received: from cuda.sgi.com (cuda1.sgi.com [192.48.157.11]) by relay1.corp.sgi.com (Postfix) with ESMTP id BF9388F8033 for ; Sun, 14 Feb 2016 22:18:58 -0800 (PST) X-ASG-Debug-ID: 1455517133-04bdf066eacfa60003-NocioJ Received: from ipmail06.adl2.internode.on.net (ipmail06.adl2.internode.on.net [150.101.137.129]) by cuda.sgi.com with ESMTP id UO3Fs7UNaO6fcqkb for ; Sun, 14 Feb 2016 22:18:56 -0800 (PST) X-Barracuda-Envelope-From: dave@fromorbit.com X-Barracuda-Apparent-Source-IP: 150.101.137.129 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: A2B1DQBZbcFWPBATLHleKAECgw+BP4Zin2YBAQEBAQEGkTGLPU0BAQEBAQEHAQEBAUE/QQ4Bg3IBBVYzCBgxOQMHFBmIGbw+hUmJe4NuBYdJhw2II5xJjj6CGAELgjUoLoJ7hEQEgTUBAQE Received: from ppp121-44-19-16.lns20.syd4.internode.on.net (HELO dastard) ([121.44.19.16]) by ipmail06.adl2.internode.on.net with ESMTP; 15 Feb 2016 16:48:28 +1030 Received: from disappointment.disaster.area ([192.168.1.110] helo=disappointment) by dastard with esmtp (Exim 4.80) (envelope-from ) id 1aVCUN-0000MA-Gd for xfs@oss.sgi.com; Mon, 15 Feb 2016 17:18:27 +1100 Received: from dave by disappointment with local (Exim 4.86) (envelope-from ) id 1aVCUN-0005GD-Fp for xfs@oss.sgi.com; Mon, 15 Feb 2016 17:18:27 +1100 From: Dave Chinner To: xfs@oss.sgi.com Subject: [PATCH 02/14] xfs: add missing bmap cancel calls in error paths Date: Mon, 15 Feb 2016 17:18:13 +1100 X-ASG-Orig-Subj: [PATCH 02/14] xfs: add missing bmap cancel calls in error paths Message-Id: <1455517105-20033-3-git-send-email-david@fromorbit.com> X-Mailer: git-send-email 2.5.0 In-Reply-To: <1455517105-20033-1-git-send-email-david@fromorbit.com> References: <1455517105-20033-1-git-send-email-david@fromorbit.com> X-Barracuda-Connect: ipmail06.adl2.internode.on.net[150.101.137.129] X-Barracuda-Start-Time: 1455517136 X-Barracuda-URL: https://192.48.157.11:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-BRTS-Status: 1 X-Barracuda-Spam-Score: 0.00 X-Barracuda-Spam-Status: No, SCORE=0.00 using per-user scores of TAG_LEVEL=1000.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.7 tests= X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.3.27042 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- From: Brian Foster Source kernel commit d4a97a04227d5ba91b91888a016e2300861cfbc7 If a failure occurs after the bmap free list is populated and before xfs_bmap_finish() completes successfully (which returns a partial list on failure), the bmap free list must be cancelled. Otherwise, the extent items on the list are never freed and a memory leak occurs. Several random error paths throughout the code suffer this problem. Fix these up such that xfs_bmap_cancel() is always called on error. Signed-off-by: Brian Foster Reviewed-by: Dave Chinner Signed-off-by: Dave Chinner --- libxfs/xfs_bmap.c | 1 + 1 file changed, 1 insertion(+) diff --git a/libxfs/xfs_bmap.c b/libxfs/xfs_bmap.c index aef7cf3..b9e58e2 100644 --- a/libxfs/xfs_bmap.c +++ b/libxfs/xfs_bmap.c @@ -5938,6 +5938,7 @@ xfs_bmap_split_extent( return xfs_trans_commit(tp); out: + xfs_bmap_cancel(&free_list); xfs_trans_cancel(tp); return error; } -- 2.5.0 From dave@fromorbit.com Mon Feb 15 00:18:59 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=ham version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay3.corp.sgi.com [198.149.34.15]) by oss.sgi.com (Postfix) with ESMTP id 2413E7CA4 for ; Mon, 15 Feb 2016 00:18:59 -0600 (CST) Received: from cuda.sgi.com (cuda1.sgi.com [192.48.157.11]) by relay3.corp.sgi.com (Postfix) with ESMTP id B78C9AC004 for ; Sun, 14 Feb 2016 22:18:58 -0800 (PST) X-ASG-Debug-ID: 1455517135-04bdf066edcfa70002-NocioJ Received: from ipmail06.adl2.internode.on.net (ipmail06.adl2.internode.on.net [150.101.137.129]) by cuda.sgi.com with ESMTP id ZR4ZQCQ9vEIJbz1N for ; Sun, 14 Feb 2016 22:18:57 -0800 (PST) X-Barracuda-Envelope-From: dave@fromorbit.com X-Barracuda-Apparent-Source-IP: 150.101.137.129 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: A2B1DQBZbcFWPBATLHleKAECgw+BP4Zin2YBAQEBAQEGkTGLPU0BAQEBAQEHAQEBAUE/QQ4Bg3IBBScvMwgYMTkDBxQZiBm8PoVJiQlyg24FlnmIPJQNjj6CGAELQBmBXCgugnuERIE5AQEB Received: from ppp121-44-19-16.lns20.syd4.internode.on.net (HELO dastard) ([121.44.19.16]) by ipmail06.adl2.internode.on.net with ESMTP; 15 Feb 2016 16:48:28 +1030 Received: from disappointment.disaster.area ([192.168.1.110] helo=disappointment) by dastard with esmtp (Exim 4.80) (envelope-from ) id 1aVCUN-0000MF-J2 for xfs@oss.sgi.com; Mon, 15 Feb 2016 17:18:27 +1100 Received: from dave by disappointment with local (Exim 4.86) (envelope-from ) id 1aVCUN-0005Gd-IG for xfs@oss.sgi.com; Mon, 15 Feb 2016 17:18:27 +1100 From: Dave Chinner To: xfs@oss.sgi.com Subject: [PATCH 07/14] xfs: bmapbt checking on debug kernels too expensive Date: Mon, 15 Feb 2016 17:18:18 +1100 X-ASG-Orig-Subj: [PATCH 07/14] xfs: bmapbt checking on debug kernels too expensive Message-Id: <1455517105-20033-8-git-send-email-david@fromorbit.com> X-Mailer: git-send-email 2.5.0 In-Reply-To: <1455517105-20033-1-git-send-email-david@fromorbit.com> References: <1455517105-20033-1-git-send-email-david@fromorbit.com> X-Barracuda-Connect: ipmail06.adl2.internode.on.net[150.101.137.129] X-Barracuda-Start-Time: 1455517136 X-Barracuda-URL: https://192.48.157.11:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-BRTS-Status: 1 X-Barracuda-Spam-Score: 0.00 X-Barracuda-Spam-Status: No, SCORE=0.00 using per-user scores of TAG_LEVEL=1000.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.7 tests= X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.3.27042 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- From: Dave Chinner Source kernel commit e35438196c6a1d8b206471d51e80c380e80e047b For large sparse or fragmented files, checking every single entry in the bmapbt on every operation is prohibitively expensive. Especially as such checks rarely discover problems during normal operations on high extent coutn files. Our regression tests don't tend to exercise files with hundreds of thousands to millions of extents, so mostly this isn't noticed. However, trying to run things like xfs_mdrestore of large filesystem dumps on a debug kernel quickly becomes impossible as the CPU is completely burnt up repeatedly walking the sparse file bmapbt that is generated for every allocation that is made. Hence, if the file has more than 10,000 extents, just don't bother with walking the tree to check it exhaustively. The btree code has checks that ensure that the newly inserted/removed/modified record is correctly ordered, so the entrie tree walk in thses cases has limited additional value. Signed-off-by: Dave Chinner Reviewed-by: Brian Foster Signed-off-by: Dave Chinner --- libxfs/xfs_bmap.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/libxfs/xfs_bmap.c b/libxfs/xfs_bmap.c index 70417fc..eb19133 100644 --- a/libxfs/xfs_bmap.c +++ b/libxfs/xfs_bmap.c @@ -317,9 +317,11 @@ xfs_check_block( /* * Check that the extents for the inode ip are in the right order in all - * btree leaves. + * btree leaves. THis becomes prohibitively expensive for large extent count + * files, so don't bother with inodes that have more than 10,000 extents in + * them. The btree record ordering checks will still be done, so for such large + * bmapbt constructs that is going to catch most corruptions. */ - STATIC void xfs_bmap_check_leaf_extents( xfs_btree_cur_t *cur, /* btree cursor or null */ @@ -344,6 +346,10 @@ xfs_bmap_check_leaf_extents( return; } + /* skip large extent count inodes */ + if (ip->i_d.di_nextents > 10000) + return; + bno = NULLFSBLOCK; mp = ip->i_mount; ifp = XFS_IFORK_PTR(ip, whichfork); -- 2.5.0 From dave@fromorbit.com Mon Feb 15 00:18:59 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=ham version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay2.corp.sgi.com [137.38.102.29]) by oss.sgi.com (Postfix) with ESMTP id 0C7EF7CA3 for ; Mon, 15 Feb 2016 00:18:59 -0600 (CST) Received: from cuda.sgi.com (cuda1.sgi.com [192.48.157.11]) by relay2.corp.sgi.com (Postfix) with ESMTP id E2A36304043 for ; Sun, 14 Feb 2016 22:18:55 -0800 (PST) X-ASG-Debug-ID: 1455517133-04bdf066eacfa60001-NocioJ Received: from ipmail06.adl2.internode.on.net (ipmail06.adl2.internode.on.net [150.101.137.129]) by cuda.sgi.com with ESMTP id UoGKKys2rTwkoF6k for ; Sun, 14 Feb 2016 22:18:53 -0800 (PST) X-Barracuda-Envelope-From: dave@fromorbit.com X-Barracuda-Apparent-Source-IP: 150.101.137.129 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: A2B1DQBZbcFWPBATLHleKAECgw+BP4Zin2YBAQEBAQEGkTGLPU0BAQEBAQEHAQEBAUE/QQ4Bg3IBBVYzCBgxIRgDBxQZiAUDEbc5DYR4hUmHNIJHg24FlnmLYpBnRIY6h0CCGAELgjUoLoJ7hX0BAQE Received: from ppp121-44-19-16.lns20.syd4.internode.on.net (HELO dastard) ([121.44.19.16]) by ipmail06.adl2.internode.on.net with ESMTP; 15 Feb 2016 16:48:28 +1030 Received: from disappointment.disaster.area ([192.168.1.110] helo=disappointment) by dastard with esmtp (Exim 4.80) (envelope-from ) id 1aVCUN-0000M9-GF for xfs@oss.sgi.com; Mon, 15 Feb 2016 17:18:27 +1100 Received: from dave by disappointment with local (Exim 4.86) (envelope-from ) id 1aVCUN-0005G8-FR for xfs@oss.sgi.com; Mon, 15 Feb 2016 17:18:27 +1100 From: Dave Chinner To: xfs@oss.sgi.com Subject: [PATCH 01/14] libxfs: Optimize the loop for xfs_bitmap_empty Date: Mon, 15 Feb 2016 17:18:12 +1100 X-ASG-Orig-Subj: [PATCH 01/14] libxfs: Optimize the loop for xfs_bitmap_empty Message-Id: <1455517105-20033-2-git-send-email-david@fromorbit.com> X-Mailer: git-send-email 2.5.0 In-Reply-To: <1455517105-20033-1-git-send-email-david@fromorbit.com> References: <1455517105-20033-1-git-send-email-david@fromorbit.com> X-Barracuda-Connect: ipmail06.adl2.internode.on.net[150.101.137.129] X-Barracuda-Start-Time: 1455517133 X-Barracuda-URL: https://192.48.157.11:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-BRTS-Status: 1 X-Barracuda-Spam-Score: 0.00 X-Barracuda-Spam-Status: No, SCORE=0.00 using per-user scores of TAG_LEVEL=1000.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.7 tests= X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.3.27042 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- From: Jia He Source kernel commit 1d4292bfdc77f4f7c520064be15d0c46bd025fd2 If there is any non zero bit in a long bitmap, it can jump out of the loop and finish the function as soon as possible. Signed-off-by: Jia He Reviewed-by: Brian Foster Signed-off-by: Dave Chinner --- libxfs/xfs_bit.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/libxfs/xfs_bit.c b/libxfs/xfs_bit.c index 8b5b81c..041557a 100644 --- a/libxfs/xfs_bit.c +++ b/libxfs/xfs_bit.c @@ -32,13 +32,13 @@ int xfs_bitmap_empty(uint *map, uint size) { uint i; - uint ret = 0; for (i = 0; i < size; i++) { - ret |= map[i]; + if (map[i] != 0) + return 0; } - return (ret == 0); + return 1; } /* -- 2.5.0 From dave@fromorbit.com Mon Feb 15 00:19:00 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=ham version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay2.corp.sgi.com [137.38.102.29]) by oss.sgi.com (Postfix) with ESMTP id 1B9997CA2 for ; Mon, 15 Feb 2016 00:19:00 -0600 (CST) Received: from cuda.sgi.com (cuda1.sgi.com [192.48.157.11]) by relay2.corp.sgi.com (Postfix) with ESMTP id E360C304043 for ; Sun, 14 Feb 2016 22:18:59 -0800 (PST) X-ASG-Debug-ID: 1455517133-04bdf066eacfa60004-NocioJ Received: from ipmail06.adl2.internode.on.net (ipmail06.adl2.internode.on.net [150.101.137.129]) by cuda.sgi.com with ESMTP id mOlAZjUtSAzDt8N9 for ; Sun, 14 Feb 2016 22:18:58 -0800 (PST) X-Barracuda-Envelope-From: dave@fromorbit.com X-Barracuda-Apparent-Source-IP: 150.101.137.129 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: A2ByDQBZbcFWPBATLHleKAECgw+IIZ9mAQEBAQEBBgWRLIs9TQEBAQEBAQcBAQEBQT9BDgGETjuBAgMHiEaeDJ4yhUmJe4NuBZZ5nEmOPoIYAQsBgjQogymFfQEBAQ Received: from ppp121-44-19-16.lns20.syd4.internode.on.net (HELO dastard) ([121.44.19.16]) by ipmail06.adl2.internode.on.net with ESMTP; 15 Feb 2016 16:48:28 +1030 Received: from disappointment.disaster.area ([192.168.1.110] helo=disappointment) by dastard with esmtp (Exim 4.80) (envelope-from ) id 1aVCUN-0000M8-Fs for xfs@oss.sgi.com; Mon, 15 Feb 2016 17:18:27 +1100 Received: from dave by disappointment with local (Exim 4.86) (envelope-from ) id 1aVCUN-0005G5-Bz for xfs@oss.sgi.com; Mon, 15 Feb 2016 17:18:27 +1100 From: Dave Chinner To: xfs@oss.sgi.com Subject: [PATCH 0/14] xfsprogs: kernel libxfs sync up to 4.5-rc2 Date: Mon, 15 Feb 2016 17:18:11 +1100 X-ASG-Orig-Subj: [PATCH 0/14] xfsprogs: kernel libxfs sync up to 4.5-rc2 Message-Id: <1455517105-20033-1-git-send-email-david@fromorbit.com> X-Mailer: git-send-email 2.5.0 X-Barracuda-Connect: ipmail06.adl2.internode.on.net[150.101.137.129] X-Barracuda-Start-Time: 1455517138 X-Barracuda-URL: https://192.48.157.11:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-BRTS-Status: 1 X-Barracuda-Spam-Score: 0.00 X-Barracuda-Spam-Status: No, SCORE=0.00 using per-user scores of TAG_LEVEL=1000.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.7 tests= X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.3.27042 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- Hi folks, This patchset pulls xfsprogs lixfs up to the same base code as the v4.5-rc2 kernel. I've simply pulled the commits across and in each patch made the external xfsprogs changes necessary to make them compile and work correctly. This applies on top of the xfs_io dax patchset I posted a short while ago. I've left all the kernel sign-offs on the commits - it's really only the patches that change stuff outside libxfs that need any sort of review... This is pretty much all of the remaining changes needed before I can cut a 4.5.0-rc1 release of xfsprogs - it's really only bug fixes and minor changes from here, as I really need this base tree mostly stable from here on. The reason for that I'm now going to be build a for-next branch off this that has all the changes in the current kernel for-next branch. This will enable Darrick to have a sane code base that he can rebase all his xfsprogs changes for rmap/reflink on top of. That will make review, testing and eventual merge much easier for everyone. -Dave. From dave@fromorbit.com Mon Feb 15 00:19:01 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=ham version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay3.corp.sgi.com [198.149.34.15]) by oss.sgi.com (Postfix) with ESMTP id E4F227CAA for ; Mon, 15 Feb 2016 00:19:00 -0600 (CST) Received: from cuda.sgi.com (cuda1.sgi.com [192.48.157.11]) by relay3.corp.sgi.com (Postfix) with ESMTP id 88229AC004 for ; Sun, 14 Feb 2016 22:18:57 -0800 (PST) X-ASG-Debug-ID: 1455517135-04bdf066edcfa70001-NocioJ Received: from ipmail06.adl2.internode.on.net (ipmail06.adl2.internode.on.net [150.101.137.129]) by cuda.sgi.com with ESMTP id 2512rhIiNzSCmsGK for ; Sun, 14 Feb 2016 22:18:55 -0800 (PST) X-Barracuda-Envelope-From: dave@fromorbit.com X-Barracuda-Apparent-Source-IP: 150.101.137.129 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: A2B1DQBZbcFWPBATLHleKAECgw+BP4Zin2YBAQEBAQEGkTGLPU0BAQEBAQEHAQEBAUE/QQ4Bg3IBBScvMwgYMTkDBxQZiBm8PoVJjWkFlnmPMYdphS+Fb4hPghgBCz8aFIFIKC6Ce4V9AQEB Received: from ppp121-44-19-16.lns20.syd4.internode.on.net (HELO dastard) ([121.44.19.16]) by ipmail06.adl2.internode.on.net with ESMTP; 15 Feb 2016 16:48:28 +1030 Received: from disappointment.disaster.area ([192.168.1.110] helo=disappointment) by dastard with esmtp (Exim 4.80) (envelope-from ) id 1aVCUN-0000MJ-L9 for xfs@oss.sgi.com; Mon, 15 Feb 2016 17:18:27 +1100 Received: from dave by disappointment with local (Exim 4.86) (envelope-from ) id 1aVCUN-0005Gy-K1 for xfs@oss.sgi.com; Mon, 15 Feb 2016 17:18:27 +1100 From: Dave Chinner To: xfs@oss.sgi.com Subject: [PATCH 11/14] xfs: swap leaf buffer into path struct atomically during path shift Date: Mon, 15 Feb 2016 17:18:22 +1100 X-ASG-Orig-Subj: [PATCH 11/14] xfs: swap leaf buffer into path struct atomically during path shift Message-Id: <1455517105-20033-12-git-send-email-david@fromorbit.com> X-Mailer: git-send-email 2.5.0 In-Reply-To: <1455517105-20033-1-git-send-email-david@fromorbit.com> References: <1455517105-20033-1-git-send-email-david@fromorbit.com> X-Barracuda-Connect: ipmail06.adl2.internode.on.net[150.101.137.129] X-Barracuda-Start-Time: 1455517135 X-Barracuda-URL: https://192.48.157.11:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-BRTS-Status: 1 X-Barracuda-Spam-Score: 0.00 X-Barracuda-Spam-Status: No, SCORE=0.00 using per-user scores of TAG_LEVEL=1000.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.7 tests= X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.3.27042 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- From: Brian Foster Source kernel commit 7df1c170b9a45ab3a7401c79bbefa9939bf8eafb The node directory lookup code uses a state structure that tracks the path of buffers used to search for the hash of a filename through the leaf blocks. When the lookup encounters a block that ends with the requested hash, but the entry has not yet been found, it must shift over to the next block and continue looking for the entry (i.e., duplicate hashes could continue over into the next block). This shift mechanism involves walking back up and down the state structure, replacing buffers at the appropriate btree levels as necessary. When a buffer is replaced, the old buffer is released and the new buffer read into the active slot in the path structure. Because the buffer is read directly into the path slot, a buffer read failure can result in setting a NULL buffer pointer in an active slot. This throws off the state cleanup code in xfs_dir2_node_lookup(), which expects to release a buffer from each active slot. Instead, a BUG occurs due to a NULL pointer dereference: BUG: unable to handle kernel NULL pointer dereference at 00000000000001e8 IP: [] xfs_trans_brelse+0x2a3/0x3c0 [xfs] ... RIP: 0010:[] [] xfs_trans_brelse+0x2a3/0x3c0 [xfs] ... Call Trace: [] xfs_dir2_node_lookup+0xa6/0x2c0 [xfs] [] xfs_dir_lookup+0x1ac/0x1c0 [xfs] [] xfs_lookup+0x91/0x290 [xfs] [] xfs_vn_lookup+0x73/0xb0 [xfs] [] lookup_real+0x1d/0x50 [] path_openat+0x91e/0x1490 [] do_filp_open+0x89/0x100 ... This has been reproduced via a parallel fsstress and filesystem shutdown workload in a loop. The shutdown triggers the read error in the aforementioned codepath and causes the BUG in xfs_dir2_node_lookup(). Update xfs_da3_path_shift() to update the active path slot atomically with respect to the caller when a buffer is replaced. This ensures that the caller always sees the old or new buffer in the slot and prevents the NULL pointer dereference. Signed-off-by: Brian Foster Reviewed-by: Dave Chinner Signed-off-by: Dave Chinner --- libxfs/xfs_da_btree.c | 23 ++++++++++++++--------- 1 file changed, 14 insertions(+), 9 deletions(-) diff --git a/libxfs/xfs_da_btree.c b/libxfs/xfs_da_btree.c index 25072c7..f3c04ab 100644 --- a/libxfs/xfs_da_btree.c +++ b/libxfs/xfs_da_btree.c @@ -1822,6 +1822,7 @@ xfs_da3_path_shift( struct xfs_da_args *args; struct xfs_da_node_entry *btree; struct xfs_da3_icnode_hdr nodehdr; + struct xfs_buf *bp; xfs_dablk_t blkno = 0; int level; int error; @@ -1866,20 +1867,24 @@ xfs_da3_path_shift( */ for (blk++, level++; level < path->active; blk++, level++) { /* - * Release the old block. - * (if it's dirty, trans won't actually let go) + * Read the next child block into a local buffer. */ - if (release) - xfs_trans_brelse(args->trans, blk->bp); + error = xfs_da3_node_read(args->trans, dp, blkno, -1, &bp, + args->whichfork); + if (error) + return error; /* - * Read the next child block. + * Release the old block (if it's dirty, the trans doesn't + * actually let go) and swap the local buffer into the path + * structure. This ensures failure of the above read doesn't set + * a NULL buffer in an active slot in the path. */ + if (release) + xfs_trans_brelse(args->trans, blk->bp); blk->blkno = blkno; - error = xfs_da3_node_read(args->trans, dp, blkno, -1, - &blk->bp, args->whichfork); - if (error) - return error; + blk->bp = bp; + info = blk->bp->b_addr; ASSERT(info->magic == cpu_to_be16(XFS_DA_NODE_MAGIC) || info->magic == cpu_to_be16(XFS_DA3_NODE_MAGIC) || -- 2.5.0 From dave@fromorbit.com Mon Feb 15 00:19:00 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=ham version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay2.corp.sgi.com [137.38.102.29]) by oss.sgi.com (Postfix) with ESMTP id E5E9A7CAB for ; Mon, 15 Feb 2016 00:19:00 -0600 (CST) Received: from cuda.sgi.com (cuda1.sgi.com [192.48.157.11]) by relay2.corp.sgi.com (Postfix) with ESMTP id BA9AD304043 for ; Sun, 14 Feb 2016 22:19:00 -0800 (PST) X-ASG-Debug-ID: 1455517135-04bdf066edcfa70003-NocioJ Received: from ipmail06.adl2.internode.on.net (ipmail06.adl2.internode.on.net [150.101.137.129]) by cuda.sgi.com with ESMTP id Z7tJCRk6Ma4i60Qp for ; Sun, 14 Feb 2016 22:18:58 -0800 (PST) X-Barracuda-Envelope-From: dave@fromorbit.com X-Barracuda-Apparent-Source-IP: 150.101.137.129 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: A2B1DQBZbcFWPBATLHleKAECgw+BP4Zin2YBAQEBAQEGkTGLPU0BAQEBAQEHAQEBAUE/QQ4Bg3IBBScvMwgYMTkDBxQZiBm8PoVJhQ2IXAWHU48mnEmOPoIYAQsBgjQoLoJ7hX0BAQE Received: from ppp121-44-19-16.lns20.syd4.internode.on.net (HELO dastard) ([121.44.19.16]) by ipmail06.adl2.internode.on.net with ESMTP; 15 Feb 2016 16:48:28 +1030 Received: from disappointment.disaster.area ([192.168.1.110] helo=disappointment) by dastard with esmtp (Exim 4.80) (envelope-from ) id 1aVCUN-0000MC-Hl for xfs@oss.sgi.com; Mon, 15 Feb 2016 17:18:27 +1100 Received: from dave by disappointment with local (Exim 4.86) (envelope-from ) id 1aVCUN-0005GO-Gc for xfs@oss.sgi.com; Mon, 15 Feb 2016 17:18:27 +1100 From: Dave Chinner To: xfs@oss.sgi.com Subject: [PATCH 04/14] xfs: per-filesystem stats counter implementation Date: Mon, 15 Feb 2016 17:18:15 +1100 X-ASG-Orig-Subj: [PATCH 04/14] xfs: per-filesystem stats counter implementation Message-Id: <1455517105-20033-5-git-send-email-david@fromorbit.com> X-Mailer: git-send-email 2.5.0 In-Reply-To: <1455517105-20033-1-git-send-email-david@fromorbit.com> References: <1455517105-20033-1-git-send-email-david@fromorbit.com> X-Barracuda-Connect: ipmail06.adl2.internode.on.net[150.101.137.129] X-Barracuda-Start-Time: 1455517138 X-Barracuda-URL: https://192.48.157.11:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-BRTS-Status: 1 X-Barracuda-Spam-Score: 0.00 X-Barracuda-Spam-Status: No, SCORE=0.00 using per-user scores of TAG_LEVEL=1000.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.7 tests= X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.3.27042 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- From: Bill O'Donnell Source kernel commit ff6d6af2351caea7db681f4539d0d893e400557a This patch modifies the stats counting macros and the callers to those macros to properly increment, decrement, and add-to the xfs stats counts. The counts for global and per-fs stats are correctly advanced, and cleared by writing a "1" to the corresponding clear file. global counts: /sys/fs/xfs/stats/stats per-fs counts: /sys/fs/xfs/sda*/stats/stats global clear: /sys/fs/xfs/stats/stats_clear per-fs clear: /sys/fs/xfs/sda*/stats/stats_clear [dchinner: cleaned up macro variables, removed CONFIG_FS_PROC around stats structures and macros. ] Signed-off-by: Bill O'Donnell Reviewed-by: Eric Sandeen Signed-off-by: Dave Chinner --- libxfs/libxfs_priv.h | 6 +++--- libxfs/xfs_alloc.c | 8 ++++---- libxfs/xfs_attr.c | 6 +++--- libxfs/xfs_bmap.c | 20 ++++++++++---------- libxfs/xfs_btree.h | 41 ++++++++++++++++++++++++----------------- libxfs/xfs_dir2.c | 6 +++--- 6 files changed, 47 insertions(+), 40 deletions(-) diff --git a/libxfs/libxfs_priv.h b/libxfs/libxfs_priv.h index 0f4d3e5..e2884a2 100644 --- a/libxfs/libxfs_priv.h +++ b/libxfs/libxfs_priv.h @@ -140,9 +140,9 @@ enum ce { CE_DEBUG, CE_CONT, CE_NOTE, CE_WARN, CE_ALERT, CE_PANIC }; #define XFS_ERRLEVEL_LOW 1 #define XFS_FORCED_SHUTDOWN(mp) 0 #define XFS_ILOCK_EXCL 0 -#define XFS_STATS_INC(count) do { } while (0) -#define XFS_STATS_DEC(count, x) do { } while (0) -#define XFS_STATS_ADD(count, x) do { } while (0) +#define XFS_STATS_INC(mp, count) do { } while (0) +#define XFS_STATS_DEC(mp, count, x) do { } while (0) +#define XFS_STATS_ADD(mp, count, x) do { } while (0) #define XFS_TRANS_MOD_DQUOT_BYINO(mp,tp,ip,field,delta) do { } while (0) #define XFS_TRANS_RESERVE_QUOTA_NBLKS(mp,tp,ip,nblks,ninos,fl) 0 #define XFS_TRANS_UNRESERVE_QUOTA_NBLKS(mp,tp,ip,nblks,ninos,fl) 0 diff --git a/libxfs/xfs_alloc.c b/libxfs/xfs_alloc.c index b43655c..12d59df 100644 --- a/libxfs/xfs_alloc.c +++ b/libxfs/xfs_alloc.c @@ -650,8 +650,8 @@ xfs_alloc_ag_vextent( -((long)(args->len))); } - XFS_STATS_INC(xs_allocx); - XFS_STATS_ADD(xs_allocb, args->len); + XFS_STATS_INC(args->mp, xs_allocx); + XFS_STATS_ADD(args->mp, xs_allocb, args->len); return error; } @@ -1807,8 +1807,8 @@ xfs_free_ag_extent( if (!isfl) xfs_trans_mod_sb(tp, XFS_TRANS_SB_FDBLOCKS, (long)len); - XFS_STATS_INC(xs_freex); - XFS_STATS_ADD(xs_freeb, len); + XFS_STATS_INC(mp, xs_freex); + XFS_STATS_ADD(mp, xs_freeb, len); trace_xfs_free_extent(mp, agno, bno, len, isfl, haveleft, haveright); diff --git a/libxfs/xfs_attr.c b/libxfs/xfs_attr.c index bdde0f6..5e79f3d 100644 --- a/libxfs/xfs_attr.c +++ b/libxfs/xfs_attr.c @@ -120,7 +120,7 @@ xfs_attr_get( uint lock_mode; int error; - XFS_STATS_INC(xs_attr_get); + XFS_STATS_INC(ip->i_mount, xs_attr_get); if (XFS_FORCED_SHUTDOWN(ip->i_mount)) return -EIO; @@ -202,7 +202,7 @@ xfs_attr_set( int rsvd = (flags & ATTR_ROOT) != 0; int error, err2, committed, local; - XFS_STATS_INC(xs_attr_set); + XFS_STATS_INC(mp, xs_attr_set); if (XFS_FORCED_SHUTDOWN(dp->i_mount)) return -EIO; @@ -405,7 +405,7 @@ xfs_attr_remove( xfs_fsblock_t firstblock; int error; - XFS_STATS_INC(xs_attr_remove); + XFS_STATS_INC(mp, xs_attr_remove); if (XFS_FORCED_SHUTDOWN(dp->i_mount)) return -EIO; diff --git a/libxfs/xfs_bmap.c b/libxfs/xfs_bmap.c index 8464810..8e19b50 100644 --- a/libxfs/xfs_bmap.c +++ b/libxfs/xfs_bmap.c @@ -1429,7 +1429,7 @@ xfs_bmap_search_extents( xfs_ifork_t *ifp; /* inode fork pointer */ xfs_bmbt_rec_host_t *ep; /* extent record pointer */ - XFS_STATS_INC(xs_look_exlist); + XFS_STATS_INC(ip->i_mount, xs_look_exlist); ifp = XFS_IFORK_PTR(ip, fork); ep = xfs_bmap_search_multi_extents(ifp, bno, eofp, lastxp, gotp, prevp); @@ -1727,7 +1727,7 @@ xfs_bmap_add_extent_delay_real( ASSERT(!bma->cur || (bma->cur->bc_private.b.flags & XFS_BTCUR_BPRV_WASDEL)); - XFS_STATS_INC(xs_add_exlist); + XFS_STATS_INC(mp, xs_add_exlist); #define LEFT r[0] #define RIGHT r[1] @@ -2281,7 +2281,7 @@ xfs_bmap_add_extent_unwritten_real( ASSERT(*idx <= ifp->if_bytes / sizeof(struct xfs_bmbt_rec)); ASSERT(!isnullstartblock(new->br_startblock)); - XFS_STATS_INC(xs_add_exlist); + XFS_STATS_INC(mp, xs_add_exlist); #define LEFT r[0] #define RIGHT r[1] @@ -2941,7 +2941,7 @@ xfs_bmap_add_extent_hole_real( ASSERT(!bma->cur || !(bma->cur->bc_private.b.flags & XFS_BTCUR_BPRV_WASDEL)); - XFS_STATS_INC(xs_add_exlist); + XFS_STATS_INC(mp, xs_add_exlist); state = 0; if (whichfork == XFS_ATTR_FORK) @@ -4031,7 +4031,7 @@ xfs_bmapi_read( if (XFS_FORCED_SHUTDOWN(mp)) return -EIO; - XFS_STATS_INC(xs_blk_mapr); + XFS_STATS_INC(mp, xs_blk_mapr); ifp = XFS_IFORK_PTR(ip, whichfork); @@ -4216,7 +4216,7 @@ xfs_bmapi_delay( if (XFS_FORCED_SHUTDOWN(mp)) return -EIO; - XFS_STATS_INC(xs_blk_mapw); + XFS_STATS_INC(mp, xs_blk_mapw); if (!(ifp->if_flags & XFS_IFEXTENTS)) { error = xfs_iread_extents(NULL, ip, XFS_DATA_FORK); @@ -4520,7 +4520,7 @@ xfs_bmapi_write( ifp = XFS_IFORK_PTR(ip, whichfork); - XFS_STATS_INC(xs_blk_mapw); + XFS_STATS_INC(mp, xs_blk_mapw); if (*firstblock == NULLFSBLOCK) { if (XFS_IFORK_FORMAT(ip, whichfork) == XFS_DINODE_FMT_BTREE) @@ -4713,12 +4713,12 @@ xfs_bmap_del_extent( xfs_filblks_t temp2; /* for indirect length calculations */ int state = 0; - XFS_STATS_INC(xs_del_exlist); + mp = ip->i_mount; + XFS_STATS_INC(mp, xs_del_exlist); if (whichfork == XFS_ATTR_FORK) state |= BMAP_ATTRFORK; - mp = ip->i_mount; ifp = XFS_IFORK_PTR(ip, whichfork); ASSERT((*idx >= 0) && (*idx < ifp->if_bytes / (uint)sizeof(xfs_bmbt_rec_t))); @@ -5065,7 +5065,7 @@ xfs_bunmapi( *done = 1; return 0; } - XFS_STATS_INC(xs_blk_unmap); + XFS_STATS_INC(mp, xs_blk_unmap); isrt = (whichfork == XFS_DATA_FORK) && XFS_IS_REALTIME_INODE(ip); start = bno; bno = start + len - 1; diff --git a/libxfs/xfs_btree.h b/libxfs/xfs_btree.h index 48cb251..9a88839 100644 --- a/libxfs/xfs_btree.h +++ b/libxfs/xfs_btree.h @@ -84,31 +84,38 @@ union xfs_btree_rec { /* * Generic stats interface */ -#define __XFS_BTREE_STATS_INC(type, stat) \ - XFS_STATS_INC(xs_ ## type ## _2_ ## stat) -#define XFS_BTREE_STATS_INC(cur, stat) \ +#define __XFS_BTREE_STATS_INC(mp, type, stat) \ + XFS_STATS_INC(mp, xs_ ## type ## _2_ ## stat) +#define XFS_BTREE_STATS_INC(cur, stat) \ do { \ + struct xfs_mount *__mp = cur->bc_mp; \ switch (cur->bc_btnum) { \ - case XFS_BTNUM_BNO: __XFS_BTREE_STATS_INC(abtb, stat); break; \ - case XFS_BTNUM_CNT: __XFS_BTREE_STATS_INC(abtc, stat); break; \ - case XFS_BTNUM_BMAP: __XFS_BTREE_STATS_INC(bmbt, stat); break; \ - case XFS_BTNUM_INO: __XFS_BTREE_STATS_INC(ibt, stat); break; \ - case XFS_BTNUM_FINO: __XFS_BTREE_STATS_INC(fibt, stat); break; \ - case XFS_BTNUM_MAX: ASSERT(0); /* fucking gcc */ ; break; \ + case XFS_BTNUM_BNO: __XFS_BTREE_STATS_INC(__mp, abtb, stat); break; \ + case XFS_BTNUM_CNT: __XFS_BTREE_STATS_INC(__mp, abtc, stat); break; \ + case XFS_BTNUM_BMAP: __XFS_BTREE_STATS_INC(__mp, bmbt, stat); break; \ + case XFS_BTNUM_INO: __XFS_BTREE_STATS_INC(__mp, ibt, stat); break; \ + case XFS_BTNUM_FINO: __XFS_BTREE_STATS_INC(__mp, fibt, stat); break; \ + case XFS_BTNUM_MAX: ASSERT(0); __mp = __mp /* fucking gcc */ ; break; \ } \ } while (0) -#define __XFS_BTREE_STATS_ADD(type, stat, val) \ - XFS_STATS_ADD(xs_ ## type ## _2_ ## stat, val) +#define __XFS_BTREE_STATS_ADD(mp, type, stat, val) \ + XFS_STATS_ADD(mp, xs_ ## type ## _2_ ## stat, val) #define XFS_BTREE_STATS_ADD(cur, stat, val) \ do { \ + struct xfs_mount *__mp = cur->bc_mp; \ switch (cur->bc_btnum) { \ - case XFS_BTNUM_BNO: __XFS_BTREE_STATS_ADD(abtb, stat, val); break; \ - case XFS_BTNUM_CNT: __XFS_BTREE_STATS_ADD(abtc, stat, val); break; \ - case XFS_BTNUM_BMAP: __XFS_BTREE_STATS_ADD(bmbt, stat, val); break; \ - case XFS_BTNUM_INO: __XFS_BTREE_STATS_ADD(ibt, stat, val); break; \ - case XFS_BTNUM_FINO: __XFS_BTREE_STATS_ADD(fibt, stat, val); break; \ - case XFS_BTNUM_MAX: ASSERT(0); /* fucking gcc */ ; break; \ + case XFS_BTNUM_BNO: \ + __XFS_BTREE_STATS_ADD(__mp, abtb, stat, val); break; \ + case XFS_BTNUM_CNT: \ + __XFS_BTREE_STATS_ADD(__mp, abtc, stat, val); break; \ + case XFS_BTNUM_BMAP: \ + __XFS_BTREE_STATS_ADD(__mp, bmbt, stat, val); break; \ + case XFS_BTNUM_INO: \ + __XFS_BTREE_STATS_ADD(__mp, ibt, stat, val); break; \ + case XFS_BTNUM_FINO: \ + __XFS_BTREE_STATS_ADD(__mp, fibt, stat, val); break; \ + case XFS_BTNUM_MAX: ASSERT(0); __mp = __mp /* fucking gcc */ ; break; \ } \ } while (0) diff --git a/libxfs/xfs_dir2.c b/libxfs/xfs_dir2.c index 4a19b76..383401b 100644 --- a/libxfs/xfs_dir2.c +++ b/libxfs/xfs_dir2.c @@ -269,7 +269,7 @@ xfs_dir_createname( rval = xfs_dir_ino_validate(tp->t_mountp, inum); if (rval) return rval; - XFS_STATS_INC(xs_dir_create); + XFS_STATS_INC(dp->i_mount, xs_dir_create); } args = kmem_zalloc(sizeof(*args), KM_SLEEP | KM_NOFS); @@ -362,7 +362,7 @@ xfs_dir_lookup( int v; /* type-checking value */ ASSERT(S_ISDIR(dp->i_d.di_mode)); - XFS_STATS_INC(xs_dir_lookup); + XFS_STATS_INC(dp->i_mount, xs_dir_lookup); /* * We need to use KM_NOFS here so that lockdep will not throw false @@ -439,7 +439,7 @@ xfs_dir_removename( int v; /* type-checking value */ ASSERT(S_ISDIR(dp->i_d.di_mode)); - XFS_STATS_INC(xs_dir_remove); + XFS_STATS_INC(dp->i_mount, xs_dir_remove); args = kmem_zalloc(sizeof(*args), KM_SLEEP | KM_NOFS); if (!args) -- 2.5.0 From dave@fromorbit.com Mon Feb 15 00:19:02 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=ham version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay3.corp.sgi.com [198.149.34.15]) by oss.sgi.com (Postfix) with ESMTP id 193557CAC for ; Mon, 15 Feb 2016 00:19:01 -0600 (CST) Received: from cuda.sgi.com (cuda1.sgi.com [192.48.157.11]) by relay3.corp.sgi.com (Postfix) with ESMTP id A435BAC005 for ; Sun, 14 Feb 2016 22:18:57 -0800 (PST) X-ASG-Debug-ID: 1455517133-04bdf066eacfa60002-NocioJ Received: from ipmail06.adl2.internode.on.net (ipmail06.adl2.internode.on.net [150.101.137.129]) by cuda.sgi.com with ESMTP id W5EzOey1YcEWNS8a for ; Sun, 14 Feb 2016 22:18:55 -0800 (PST) X-Barracuda-Envelope-From: dave@fromorbit.com X-Barracuda-Apparent-Source-IP: 150.101.137.129 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: A2B1DQBZbcFWPBATLHleKAECgw+BP4Zin2YBAQEBAQEGkTGLPU0BAQEBAQEHAQEBAUE/QQ4Bg3IBBScvMwgYGBk5AwcUGYgZvD6FSYlug3sFjSeJUo8xjRiFb4hPghgBC22BSCgugnuFfQEBAQ Received: from ppp121-44-19-16.lns20.syd4.internode.on.net (HELO dastard) ([121.44.19.16]) by ipmail06.adl2.internode.on.net with ESMTP; 15 Feb 2016 16:48:28 +1030 Received: from disappointment.disaster.area ([192.168.1.110] helo=disappointment) by dastard with esmtp (Exim 4.80) (envelope-from ) id 1aVCUN-0000MB-Gw for xfs@oss.sgi.com; Mon, 15 Feb 2016 17:18:27 +1100 Received: from dave by disappointment with local (Exim 4.86) (envelope-from ) id 1aVCUN-0005GJ-GE for xfs@oss.sgi.com; Mon, 15 Feb 2016 17:18:27 +1100 From: Dave Chinner To: xfs@oss.sgi.com Subject: [PATCH 03/14] xfs: log local to remote symlink conversions correctly on v5 supers Date: Mon, 15 Feb 2016 17:18:14 +1100 X-ASG-Orig-Subj: [PATCH 03/14] xfs: log local to remote symlink conversions correctly on v5 supers Message-Id: <1455517105-20033-4-git-send-email-david@fromorbit.com> X-Mailer: git-send-email 2.5.0 In-Reply-To: <1455517105-20033-1-git-send-email-david@fromorbit.com> References: <1455517105-20033-1-git-send-email-david@fromorbit.com> X-Barracuda-Connect: ipmail06.adl2.internode.on.net[150.101.137.129] X-Barracuda-Start-Time: 1455517134 X-Barracuda-URL: https://192.48.157.11:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-BRTS-Status: 1 X-Barracuda-Spam-Score: 0.00 X-Barracuda-Spam-Status: No, SCORE=0.00 using per-user scores of TAG_LEVEL=1000.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.7 tests= X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.3.27042 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- From: Brian Foster Source kernel commit b7cdc66be54b64daef593894d12ecc405f117829 A local format symlink inode is converted to extent format when an extended attribute is set on an inode as part of the attribute fork creation. This means a block is allocated, the local symlink target name is copied to the block and the block is logged. Currently, xfs_bmap_local_to_extents() handles logging the remote block data based on the size of the data fork prior to the conversion. This is not correct on v5 superblock filesystems, which add an additional header to remote symlink blocks that is nonexistent in local format inodes. As a result, the full length of the remote symlink block content is not logged. This can lead to corruption should a crash occur and log recovery replay this transaction. Since a callout is already used to initialize the new remote symlink block, update the local-to-extents conversion mechanism to make the callout also responsible for logging the block. It is already required to set the log buffer type and format the block appropriately based on the superblock version. This ensures the remote symlink is always logged correctly. Note that xfs_bmap_local_to_extents() is only called for symlinks so there are no other callouts that require modification. Signed-off-by: Brian Foster Reviewed-by: Dave Chinner Signed-off-by: Dave Chinner --- libxfs/xfs_bmap.c | 10 ++++++---- libxfs/xfs_symlink_remote.c | 3 +++ 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/libxfs/xfs_bmap.c b/libxfs/xfs_bmap.c index b9e58e2..8464810 100644 --- a/libxfs/xfs_bmap.c +++ b/libxfs/xfs_bmap.c @@ -940,14 +940,16 @@ xfs_bmap_local_to_extents( bp = xfs_btree_get_bufl(args.mp, tp, args.fsbno, 0); /* - * Initialise the block and copy the data + * Initialize the block, copy the data and log the remote buffer. * - * Note: init_fn must set the buffer log item type correctly! + * The callout is responsible for logging because the remote format + * might differ from the local format and thus we don't know how much to + * log here. Note that init_fn must also set the buffer log item type + * correctly. */ init_fn(tp, bp, ip, ifp); - /* account for the change in fork size and log everything */ - xfs_trans_log_buf(tp, bp, 0, ifp->if_bytes - 1); + /* account for the change in fork size */ xfs_idata_realloc(ip, -ifp->if_bytes, whichfork); xfs_bmap_local_to_extents_empty(ip, whichfork); flags |= XFS_ILOG_CORE; diff --git a/libxfs/xfs_symlink_remote.c b/libxfs/xfs_symlink_remote.c index fb9ece8..04c7446 100644 --- a/libxfs/xfs_symlink_remote.c +++ b/libxfs/xfs_symlink_remote.c @@ -184,6 +184,7 @@ xfs_symlink_local_to_remote( if (!xfs_sb_version_hascrc(&mp->m_sb)) { bp->b_ops = NULL; memcpy(bp->b_addr, ifp->if_u1.if_data, ifp->if_bytes); + xfs_trans_log_buf(tp, bp, 0, ifp->if_bytes - 1); return; } @@ -199,4 +200,6 @@ xfs_symlink_local_to_remote( buf = bp->b_addr; buf += xfs_symlink_hdr_set(mp, ip->i_ino, 0, ifp->if_bytes, bp); memcpy(buf, ifp->if_u1.if_data, ifp->if_bytes); + xfs_trans_log_buf(tp, bp, 0, sizeof(struct xfs_dsymlink_hdr) + + ifp->if_bytes - 1); } -- 2.5.0 From dave@fromorbit.com Mon Feb 15 00:19:02 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=ham version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay2.corp.sgi.com [137.38.102.29]) by oss.sgi.com (Postfix) with ESMTP id 869217CAD for ; Mon, 15 Feb 2016 00:19:01 -0600 (CST) Received: from cuda.sgi.com (cuda1.sgi.com [192.48.157.11]) by relay2.corp.sgi.com (Postfix) with ESMTP id 693C3304043 for ; Sun, 14 Feb 2016 22:19:01 -0800 (PST) X-ASG-Debug-ID: 1455517133-04bdf066eacfa60005-NocioJ Received: from ipmail06.adl2.internode.on.net (ipmail06.adl2.internode.on.net [150.101.137.129]) by cuda.sgi.com with ESMTP id 3CjzVUF4JifRDABo for ; Sun, 14 Feb 2016 22:18:59 -0800 (PST) X-Barracuda-Envelope-From: dave@fromorbit.com X-Barracuda-Apparent-Source-IP: 150.101.137.129 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: A2B1DQBZbcFWPBATLHleKAECgw+BP4Zin2YBAQEBAQEGkTGLPU0BAQEBAQEHAQEBAUE/QQ4Bg3IBBVYzCBgxOQMHFBmIGbw+hUmJe4NuBZZ5nEmOPoIYAQuCNSgugnuERiWBEgEBAQ Received: from ppp121-44-19-16.lns20.syd4.internode.on.net (HELO dastard) ([121.44.19.16]) by ipmail06.adl2.internode.on.net with ESMTP; 15 Feb 2016 16:48:44 +1030 Received: from disappointment.disaster.area ([192.168.1.110] helo=disappointment) by dastard with esmtp (Exim 4.80) (envelope-from ) id 1aVCUN-0000MM-MM for xfs@oss.sgi.com; Mon, 15 Feb 2016 17:18:27 +1100 Received: from dave by disappointment with local (Exim 4.86) (envelope-from ) id 1aVCUN-0005HD-Ld for xfs@oss.sgi.com; Mon, 15 Feb 2016 17:18:27 +1100 From: Dave Chinner To: xfs@oss.sgi.com Subject: [PATCH 14/14] xfs: Validate the length of on-disk ACLs Date: Mon, 15 Feb 2016 17:18:25 +1100 X-ASG-Orig-Subj: [PATCH 14/14] xfs: Validate the length of on-disk ACLs Message-Id: <1455517105-20033-15-git-send-email-david@fromorbit.com> X-Mailer: git-send-email 2.5.0 In-Reply-To: <1455517105-20033-1-git-send-email-david@fromorbit.com> References: <1455517105-20033-1-git-send-email-david@fromorbit.com> X-Barracuda-Connect: ipmail06.adl2.internode.on.net[150.101.137.129] X-Barracuda-Start-Time: 1455517139 X-Barracuda-URL: https://192.48.157.11:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-BRTS-Status: 1 X-Barracuda-Spam-Score: 0.00 X-Barracuda-Spam-Status: No, SCORE=0.00 using per-user scores of TAG_LEVEL=1000.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.7 tests= X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.3.27042 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- From: Andreas Gruenbacher Source kernel commit 86a21c79745ca97676cbd47f8608839382cc0448 In xfs_acl_from_disk, instead of trusting that xfs_acl.acl_cnt is correct, make sure that the length of the attributes is correct as well. Also, turn the aclp parameter into a const pointer. Signed-off-by: Andreas Gruenbacher Reviewed-by: Dave Chinner Signed-off-by: Dave Chinner --- libxfs/xfs_format.h | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/libxfs/xfs_format.h b/libxfs/xfs_format.h index 7eae0a5..f89b6e0 100644 --- a/libxfs/xfs_format.h +++ b/libxfs/xfs_format.h @@ -1502,9 +1502,13 @@ struct xfs_acl { sizeof(struct xfs_acl_entry) \ : 25) -#define XFS_ACL_MAX_SIZE(mp) \ +#define XFS_ACL_SIZE(cnt) \ (sizeof(struct xfs_acl) + \ - sizeof(struct xfs_acl_entry) * XFS_ACL_MAX_ENTRIES((mp))) + sizeof(struct xfs_acl_entry) * cnt) + +#define XFS_ACL_MAX_SIZE(mp) \ + XFS_ACL_SIZE(XFS_ACL_MAX_ENTRIES((mp))) + /* On-disk XFS extended attribute names */ #define SGI_ACL_FILE "SGI_ACL_FILE" -- 2.5.0 From dave@fromorbit.com Mon Feb 15 00:19:03 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=ham version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay2.corp.sgi.com [137.38.102.29]) by oss.sgi.com (Postfix) with ESMTP id CF6657CAE for ; Mon, 15 Feb 2016 00:19:01 -0600 (CST) Received: from cuda.sgi.com (cuda1.sgi.com [192.48.157.11]) by relay2.corp.sgi.com (Postfix) with ESMTP id B19EB304043 for ; Sun, 14 Feb 2016 22:19:01 -0800 (PST) X-ASG-Debug-ID: 1455517135-04bdf066edcfa70004-NocioJ Received: from ipmail06.adl2.internode.on.net (ipmail06.adl2.internode.on.net [150.101.137.129]) by cuda.sgi.com with ESMTP id JTwFVvpDYyAYuE1T for ; Sun, 14 Feb 2016 22:19:00 -0800 (PST) X-Barracuda-Envelope-From: dave@fromorbit.com X-Barracuda-Apparent-Source-IP: 150.101.137.129 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: A2B1DQBZbcFWPBATLHleKAECgw+BP4Zin2YBAQEBAQEGkTGLPU0BAQEBAQEHAQEBAUE/QQ4Bg3IBBVYzCBgxOQMHFBmIGbw+hUmJe4NuBZZ5nEmOPoIYAQtAGYFcKC6Ce4V9AQEB Received: from ppp121-44-19-16.lns20.syd4.internode.on.net (HELO dastard) ([121.44.19.16]) by ipmail06.adl2.internode.on.net with ESMTP; 15 Feb 2016 16:48:44 +1030 Received: from disappointment.disaster.area ([192.168.1.110] helo=disappointment) by dastard with esmtp (Exim 4.80) (envelope-from ) id 1aVCUN-0000MK-LW for xfs@oss.sgi.com; Mon, 15 Feb 2016 17:18:27 +1100 Received: from dave by disappointment with local (Exim 4.86) (envelope-from ) id 1aVCUN-0005H3-Kk for xfs@oss.sgi.com; Mon, 15 Feb 2016 17:18:27 +1100 From: Dave Chinner To: xfs@oss.sgi.com Subject: [PATCH 12/14] libxfs: fix two comment typos Date: Mon, 15 Feb 2016 17:18:23 +1100 X-ASG-Orig-Subj: [PATCH 12/14] libxfs: fix two comment typos Message-Id: <1455517105-20033-13-git-send-email-david@fromorbit.com> X-Mailer: git-send-email 2.5.0 In-Reply-To: <1455517105-20033-1-git-send-email-david@fromorbit.com> References: <1455517105-20033-1-git-send-email-david@fromorbit.com> X-Barracuda-Connect: ipmail06.adl2.internode.on.net[150.101.137.129] X-Barracuda-Start-Time: 1455517139 X-Barracuda-URL: https://192.48.157.11:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-BRTS-Status: 1 X-Barracuda-Spam-Score: 0.20 X-Barracuda-Spam-Status: No, SCORE=0.20 using per-user scores of TAG_LEVEL=1000.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.7 tests=BSF_SC7_SA298e X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.3.27042 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 0.20 BSF_SC7_SA298e Custom Rule SA298e From: Geliang Tang Source kernel commit fef4ded8cb2e53a47093b334e7730d55a3badc59 Just fix two typos in code comments. Signed-off-by: Geliang Tang Reviewed-by: Dave Chinner Signed-off-by: Dave Chinner --- libxfs/xfs_btree.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libxfs/xfs_btree.c b/libxfs/xfs_btree.c index 658f27e..efcad26 100644 --- a/libxfs/xfs_btree.c +++ b/libxfs/xfs_btree.c @@ -219,7 +219,7 @@ xfs_btree_check_ptr( * long-form btree header. * * Prior to calculting the CRC, pull the LSN out of the buffer log item and put - * it into the buffer so recovery knows what the last modifcation was that made + * it into the buffer so recovery knows what the last modification was that made * it to disk. */ void @@ -257,7 +257,7 @@ xfs_btree_lblock_verify_crc( * short-form btree header. * * Prior to calculting the CRC, pull the LSN out of the buffer log item and put - * it into the buffer so recovery knows what the last modifcation was that made + * it into the buffer so recovery knows what the last modification was that made * it to disk. */ void -- 2.5.0 From dave@fromorbit.com Mon Feb 15 00:19:03 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=ham version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay1.corp.sgi.com [137.38.102.111]) by oss.sgi.com (Postfix) with ESMTP id AB8007CAA for ; Mon, 15 Feb 2016 00:19:02 -0600 (CST) Received: from cuda.sgi.com (cuda1.sgi.com [192.48.157.11]) by relay1.corp.sgi.com (Postfix) with ESMTP id 8E0588F8033 for ; Sun, 14 Feb 2016 22:19:02 -0800 (PST) X-ASG-Debug-ID: 1455517133-04bdf066eacfa60006-NocioJ Received: from ipmail06.adl2.internode.on.net (ipmail06.adl2.internode.on.net [150.101.137.129]) by cuda.sgi.com with ESMTP id 6SsfcF5JRoYHbNBd for ; Sun, 14 Feb 2016 22:19:00 -0800 (PST) X-Barracuda-Envelope-From: dave@fromorbit.com X-Barracuda-Apparent-Source-IP: 150.101.137.129 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: A2B1DQBZbcFWPBATLHleKAECgw+BP4Zin2YBAQEBAQEGkTGLPU0BAQEBAQEHAQEBAUE/QQ4Bg3IBBScvMwgYMTkDBxQZiBm8PoVJiXuDbgWWeZxJRI16ghgBC4I1KC6Ce4V9AQEB Received: from ppp121-44-19-16.lns20.syd4.internode.on.net (HELO dastard) ([121.44.19.16]) by ipmail06.adl2.internode.on.net with ESMTP; 15 Feb 2016 16:48:44 +1030 Received: from disappointment.disaster.area ([192.168.1.110] helo=disappointment) by dastard with esmtp (Exim 4.80) (envelope-from ) id 1aVCUN-0000ME-Ia for xfs@oss.sgi.com; Mon, 15 Feb 2016 17:18:27 +1100 Received: from dave by disappointment with local (Exim 4.86) (envelope-from ) id 1aVCUN-0005GY-Hq for xfs@oss.sgi.com; Mon, 15 Feb 2016 17:18:27 +1100 From: Dave Chinner To: xfs@oss.sgi.com Subject: [PATCH 06/14] xfs: get mp from bma->ip in xfs_bmap code Date: Mon, 15 Feb 2016 17:18:17 +1100 X-ASG-Orig-Subj: [PATCH 06/14] xfs: get mp from bma->ip in xfs_bmap code Message-Id: <1455517105-20033-7-git-send-email-david@fromorbit.com> X-Mailer: git-send-email 2.5.0 In-Reply-To: <1455517105-20033-1-git-send-email-david@fromorbit.com> References: <1455517105-20033-1-git-send-email-david@fromorbit.com> X-Barracuda-Connect: ipmail06.adl2.internode.on.net[150.101.137.129] X-Barracuda-Start-Time: 1455517140 X-Barracuda-URL: https://192.48.157.11:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-BRTS-Status: 1 X-Barracuda-Spam-Score: 0.00 X-Barracuda-Spam-Status: No, SCORE=0.00 using per-user scores of TAG_LEVEL=1000.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.7 tests= X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.3.27042 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- From: Eric Sandeen Source kernel commit f1f96c4946590616812711ac19eb7a84be160877 In my earlier commit c29aad4 xfs: pass mp to XFS_WANT_CORRUPTED_GOTO I added some local mp variables with code which indicates that mp might be NULL. Coverity doesn't like this now, because the updated per-fs XFS_STATS macros dereference mp. I don't think this is actually a problem; from what I can tell, we cannot get to these functions with a null bma->tp, so my NULL check was probably pointless. Still, it's not super obvious. So switch this code to get mp from the inode on the xfs_bmalloca structure, with no conditional, because the functions are already using bmap->ip directly. Addresses-Coverity-Id: 1339552 Addresses-Coverity-Id: 1339553 Signed-off-by: Eric Sandeen Reviewed-by: Dave Chinner Signed-off-by: Dave Chinner --- libxfs/xfs_bmap.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libxfs/xfs_bmap.c b/libxfs/xfs_bmap.c index a38549c..70417fc 100644 --- a/libxfs/xfs_bmap.c +++ b/libxfs/xfs_bmap.c @@ -1718,7 +1718,7 @@ xfs_bmap_add_extent_delay_real( struct xfs_mount *mp; int whichfork = XFS_DATA_FORK; - mp = bma->tp ? bma->tp->t_mountp : NULL; + mp = bma->ip->i_mount; ifp = XFS_IFORK_PTR(bma->ip, whichfork); ASSERT(bma->idx >= 0); @@ -2932,7 +2932,7 @@ xfs_bmap_add_extent_hole_real( int state; /* state bits, accessed thru macros */ struct xfs_mount *mp; - mp = bma->tp ? bma->tp->t_mountp : NULL; + mp = bma->ip->i_mount; ifp = XFS_IFORK_PTR(bma->ip, whichfork); ASSERT(bma->idx >= 0); -- 2.5.0 From dave@fromorbit.com Mon Feb 15 00:19:03 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=ham version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay2.corp.sgi.com [137.38.102.29]) by oss.sgi.com (Postfix) with ESMTP id D28E67CAB for ; Mon, 15 Feb 2016 00:19:02 -0600 (CST) Received: from cuda.sgi.com (cuda2.sgi.com [192.48.176.25]) by relay2.corp.sgi.com (Postfix) with ESMTP id C374D304043 for ; Sun, 14 Feb 2016 22:19:02 -0800 (PST) X-ASG-Debug-ID: 1455517136-04cbb04331e2740001-NocioJ Received: from ipmail06.adl2.internode.on.net (ipmail06.adl2.internode.on.net [150.101.137.129]) by cuda.sgi.com with ESMTP id 7iN0f2tKR3RXvpt3 for ; Sun, 14 Feb 2016 22:18:57 -0800 (PST) X-Barracuda-Envelope-From: dave@fromorbit.com X-Barracuda-Apparent-Source-IP: 150.101.137.129 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: A2B1DQBZbcFWPBATLHleKAECgw+BP4Zin2YBAQEBAQEGkTGLPU0BAQEBAQEHAQEBAUE/QQ4Bg3IBBScvMwgYMTkDBxQZiBm8PoVJjWkFlnmIPIZ1h2mFL44+ghgBC4I1KC6Ce4V9AQEB Received: from ppp121-44-19-16.lns20.syd4.internode.on.net (HELO dastard) ([121.44.19.16]) by ipmail06.adl2.internode.on.net with ESMTP; 15 Feb 2016 16:48:28 +1030 Received: from disappointment.disaster.area ([192.168.1.110] helo=disappointment) by dastard with esmtp (Exim 4.80) (envelope-from ) id 1aVCUN-0000ML-Lu for xfs@oss.sgi.com; Mon, 15 Feb 2016 17:18:27 +1100 Received: from dave by disappointment with local (Exim 4.86) (envelope-from ) id 1aVCUN-0005H8-LD for xfs@oss.sgi.com; Mon, 15 Feb 2016 17:18:27 +1100 From: Dave Chinner To: xfs@oss.sgi.com Subject: [PATCH 13/14] xfs: stop holding ILOCK over filldir callbacks Date: Mon, 15 Feb 2016 17:18:24 +1100 X-ASG-Orig-Subj: [PATCH 13/14] xfs: stop holding ILOCK over filldir callbacks Message-Id: <1455517105-20033-14-git-send-email-david@fromorbit.com> X-Mailer: git-send-email 2.5.0 In-Reply-To: <1455517105-20033-1-git-send-email-david@fromorbit.com> References: <1455517105-20033-1-git-send-email-david@fromorbit.com> X-Barracuda-Connect: ipmail06.adl2.internode.on.net[150.101.137.129] X-Barracuda-Start-Time: 1455517137 X-Barracuda-URL: https://192.48.176.25:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-BRTS-Status: 1 X-Barracuda-Spam-Score: 0.00 X-Barracuda-Spam-Status: No, SCORE=0.00 using per-user scores of TAG_LEVEL=1000.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.7 tests= X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.3.27042 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- From: Dave Chinner Source kernel commit dbad7c993053d8f482a5f76270a93307537efd8e The recent change to the readdir locking made in 40194ec ("xfs: reinstate the ilock in xfs_readdir") for CXFS directory sanity was probably the wrong thing to do. Deep in the readdir code we can take page faults in the filldir callback, and so taking a page fault while holding an inode ilock creates a new set of locking issues that lockdep warns all over the place about. The locking order for regular inodes w.r.t. page faults is io_lock -> pagefault -> mmap_sem -> ilock. The directory readdir code now triggers ilock -> page fault -> mmap_sem. While we cannot deadlock at this point, it inverts all the locking patterns that lockdep normally sees on XFS inodes, and so triggers lockdep. We worked around this with commit 93a8614 ("xfs: fix directory inode iolock lockdep false positive"), but that then just moved the lockdep warning to deeper in the page fault path and triggered on security inode locks. Fixing the shmem issue there just moved the lockdep reports somewhere else, and now we are getting false positives from filesystem freezing annotations getting confused. Further, if we enter memory reclaim in a readdir path, we now get lockdep warning about potential deadlocks because the ilock is held when we enter reclaim. This, again, is different to a regular file in that we never allow memory reclaim to run while holding the ilock for regular files. Hence lockdep now throws ilock->kmalloc->reclaim->ilock warnings. Basically, the problem is that the ilock is being used to protect the directory data and the inode metadata, whereas for a regular file the iolock protects the data and the ilock protects the metadata. From the VFS perspective, the i_mutex serialises all accesses to the directory data, and so not holding the ilock for readdir doesn't matter. The issue is that CXFS doesn't access directory data via the VFS, so it has no "data serialisaton" mechanism. Hence we need to hold the IOLOCK in the correct places to provide this low level directory data access serialisation. The ilock can then be used just when the extent list needs to be read, just like we do for regular files. The directory modification code can take the iolock exclusive when the ilock is also taken, and this then ensures that readdir is correct excluded while modifications are in progress. Signed-off-by: Dave Chinner Reviewed-by: Brian Foster Signed-off-by: Dave Chinner --- libxfs/xfs_dir2.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/libxfs/xfs_dir2.c b/libxfs/xfs_dir2.c index 383401b..89b4781 100644 --- a/libxfs/xfs_dir2.c +++ b/libxfs/xfs_dir2.c @@ -360,6 +360,7 @@ xfs_dir_lookup( struct xfs_da_args *args; int rval; int v; /* type-checking value */ + int lock_mode; ASSERT(S_ISDIR(dp->i_d.di_mode)); XFS_STATS_INC(dp->i_mount, xs_dir_lookup); @@ -385,6 +386,7 @@ xfs_dir_lookup( if (ci_name) args->op_flags |= XFS_DA_OP_CILOOKUP; + lock_mode = xfs_ilock_data_map_shared(dp); if (dp->i_d.di_format == XFS_DINODE_FMT_LOCAL) { rval = xfs_dir2_sf_lookup(args); goto out_check_rval; @@ -417,6 +419,7 @@ out_check_rval: } } out_free: + xfs_iunlock(dp, lock_mode); kmem_free(args); return rval; } -- 2.5.0 From dave@fromorbit.com Mon Feb 15 00:19:05 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=ham version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay3.corp.sgi.com [198.149.34.15]) by oss.sgi.com (Postfix) with ESMTP id 4F8607CB3 for ; Mon, 15 Feb 2016 00:19:04 -0600 (CST) Received: from cuda.sgi.com (cuda1.sgi.com [192.48.157.11]) by relay3.corp.sgi.com (Postfix) with ESMTP id E1A66AC005 for ; Sun, 14 Feb 2016 22:19:03 -0800 (PST) X-ASG-Debug-ID: 1455517133-04bdf066eacfa60007-NocioJ Received: from ipmail06.adl2.internode.on.net (ipmail06.adl2.internode.on.net [150.101.137.129]) by cuda.sgi.com with ESMTP id sua2vYUkeKDmHwnu for ; Sun, 14 Feb 2016 22:19:02 -0800 (PST) X-Barracuda-Envelope-From: dave@fromorbit.com X-Barracuda-Apparent-Source-IP: 150.101.137.129 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: A2B1DQBZbcFWPBATLHleKAECgw+BP4Zin2YBAQEBAQEGkTGLPU0BAQEBAQEHAQEBAUE/QQ4Bg3IBBScgDxYdCBgxOQMHFBmIGbJbiWOFSY1pBYdQhwaII48xh2mFL44+ghgBC0AZgVwoLoJ7hX0BAQE Received: from ppp121-44-19-16.lns20.syd4.internode.on.net (HELO dastard) ([121.44.19.16]) by ipmail06.adl2.internode.on.net with ESMTP; 15 Feb 2016 16:48:44 +1030 Received: from disappointment.disaster.area ([192.168.1.110] helo=disappointment) by dastard with esmtp (Exim 4.80) (envelope-from ) id 1aVCUN-0000MH-Jr for xfs@oss.sgi.com; Mon, 15 Feb 2016 17:18:27 +1100 Received: from dave by disappointment with local (Exim 4.86) (envelope-from ) id 1aVCUN-0005Gn-J6 for xfs@oss.sgi.com; Mon, 15 Feb 2016 17:18:27 +1100 From: Dave Chinner To: xfs@oss.sgi.com Subject: [PATCH 09/14] xfs: inode recovery readahead can race with inode buffer creation Date: Mon, 15 Feb 2016 17:18:20 +1100 X-ASG-Orig-Subj: [PATCH 09/14] xfs: inode recovery readahead can race with inode buffer creation Message-Id: <1455517105-20033-10-git-send-email-david@fromorbit.com> X-Mailer: git-send-email 2.5.0 In-Reply-To: <1455517105-20033-1-git-send-email-david@fromorbit.com> References: <1455517105-20033-1-git-send-email-david@fromorbit.com> X-Barracuda-Connect: ipmail06.adl2.internode.on.net[150.101.137.129] X-Barracuda-Start-Time: 1455517141 X-Barracuda-URL: https://192.48.157.11:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-BRTS-Status: 1 X-Barracuda-Spam-Score: 0.00 X-Barracuda-Spam-Status: No, SCORE=0.00 using per-user scores of TAG_LEVEL=1000.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.7 tests= X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.3.27042 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- From: Dave Chinner Source kernel commit b79f4a1c68bb99152d0785ee4ea3ab4396cdacc6 When we do inode readahead in log recovery, we do can do the readahead before we've replayed the icreate transaction that stamps the buffer with inode cores. The inode readahead verifier catches this and marks the buffer as !done to indicate that it doesn't yet contain valid inodes. In adding buffer error notification (i.e. setting b_error = -EIO at the same time as as we clear the done flag) to such a readahead verifier failure, we can then get subsequent inode recovery failing with this error: XFS (dm-0): metadata I/O error: block 0xa00060 ("xlog_recover_do..(read#2)") error 5 numblks 32 This occurs when readahead completion races with icreate item replay such as: inode readahead find buffer lock buffer submit RA io .... icreate recovery xfs_trans_get_buffer find buffer lock buffer ..... fails verifier clear XBF_DONE set bp->b_error = -EIO release and unlock buffer icreate initialises buffer marks buffer as done adds buffer to delayed write queue releases buffer At this point, we have an initialised inode buffer that is up to date but has an -EIO state registered against it. When we finally get to recovering an inode in that buffer: inode item recovery xfs_trans_read_buffer find buffer lock buffer sees XBF_DONE is set, returns buffer sees bp->b_error is set fail log recovery! Essentially, we need xfs_trans_get_buf_map() to clear the error status of the buffer when doing a lookup. This function returns uninitialised buffers, so the buffer returned can not be in an error state and none of the code that uses this function expects b_error to be set on return. Indeed, there is an ASSERT(!bp->b_error); in the transaction case in xfs_trans_get_buf_map() that would have caught this if log recovery used transactions.... This patch firstly changes the inode readahead failure to set -EIO on the buffer, and secondly changes xfs_buf_get_map() to never return a buffer with an error state set so this first change doesn't cause unexpected log recovery failures. cc: # 3.12 - current Signed-off-by: Dave Chinner Reviewed-by: Brian Foster Signed-off-by: Dave Chinner --- libxfs/xfs_inode_buf.c | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/libxfs/xfs_inode_buf.c b/libxfs/xfs_inode_buf.c index 324715e..546af74 100644 --- a/libxfs/xfs_inode_buf.c +++ b/libxfs/xfs_inode_buf.c @@ -71,11 +71,12 @@ xfs_dinode_good_version( * has not had the inode cores stamped into it. Hence for readahead, the buffer * may be potentially invalid. * - * If the readahead buffer is invalid, we don't want to mark it with an error, - * but we do want to clear the DONE status of the buffer so that a followup read - * will re-read it from disk. This will ensure that we don't get an unnecessary - * warnings during log recovery and we don't get unnecssary panics on debug - * kernels. + * If the readahead buffer is invalid, we need to mark it with an error and + * clear the DONE status of the buffer so that a followup read will re-read it + * from disk. We don't report the error otherwise to avoid warnings during log + * recovery and we don't get unnecssary panics on debug kernels. We use EIO here + * because all we want to do is say readahead failed; there is no-one to report + * the error to, so this will distinguish it from a non-ra verifier failure. */ static void xfs_inode_buf_verify( @@ -102,6 +103,7 @@ xfs_inode_buf_verify( XFS_RANDOM_ITOBP_INOTOBP))) { if (readahead) { bp->b_flags &= ~XBF_DONE; + xfs_buf_ioerror(bp, -EIO); return; } -- 2.5.0 From dave@fromorbit.com Mon Feb 15 00:19:03 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=ham version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay1.corp.sgi.com [137.38.102.111]) by oss.sgi.com (Postfix) with ESMTP id 8B0D27CAC for ; Mon, 15 Feb 2016 00:19:03 -0600 (CST) Received: from cuda.sgi.com (cuda1.sgi.com [192.48.157.11]) by relay1.corp.sgi.com (Postfix) with ESMTP id 5FB9C8F8033 for ; Sun, 14 Feb 2016 22:19:03 -0800 (PST) X-ASG-Debug-ID: 1455517135-04bdf066edcfa70005-NocioJ Received: from ipmail06.adl2.internode.on.net (ipmail06.adl2.internode.on.net [150.101.137.129]) by cuda.sgi.com with ESMTP id F5ukwxzq1OGgwLrG for ; Sun, 14 Feb 2016 22:19:01 -0800 (PST) X-Barracuda-Envelope-From: dave@fromorbit.com X-Barracuda-Apparent-Source-IP: 150.101.137.129 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: A2B1DQBZbcFWPBATLHleKAECgw+BP4Zin2YBAQEBAQEGkTGLPU0BAQEBAQEHAQEBAUE/QQ4Bg3IBBScvMwgYMTkDBxQZiBm8PoVJjWkFh0kHhVeBL4gjjzGHaYUvhW+IT4IYAQtAGYFcKC6Ce4REBIE1AQEB Received: from ppp121-44-19-16.lns20.syd4.internode.on.net (HELO dastard) ([121.44.19.16]) by ipmail06.adl2.internode.on.net with ESMTP; 15 Feb 2016 16:48:44 +1030 Received: from disappointment.disaster.area ([192.168.1.110] helo=disappointment) by dastard with esmtp (Exim 4.80) (envelope-from ) id 1aVCUN-0000MI-KK for xfs@oss.sgi.com; Mon, 15 Feb 2016 17:18:27 +1100 Received: from dave by disappointment with local (Exim 4.86) (envelope-from ) id 1aVCUN-0005Gs-JZ for xfs@oss.sgi.com; Mon, 15 Feb 2016 17:18:27 +1100 From: Dave Chinner To: xfs@oss.sgi.com Subject: [PATCH 10/14] xfs: handle dquot buffer readahead in log recovery correctly Date: Mon, 15 Feb 2016 17:18:21 +1100 X-ASG-Orig-Subj: [PATCH 10/14] xfs: handle dquot buffer readahead in log recovery correctly Message-Id: <1455517105-20033-11-git-send-email-david@fromorbit.com> X-Mailer: git-send-email 2.5.0 In-Reply-To: <1455517105-20033-1-git-send-email-david@fromorbit.com> References: <1455517105-20033-1-git-send-email-david@fromorbit.com> X-Barracuda-Connect: ipmail06.adl2.internode.on.net[150.101.137.129] X-Barracuda-Start-Time: 1455517140 X-Barracuda-URL: https://192.48.157.11:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-BRTS-Status: 1 X-Barracuda-Spam-Score: 0.00 X-Barracuda-Spam-Status: No, SCORE=0.00 using per-user scores of TAG_LEVEL=1000.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.7 tests= X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.3.27042 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- From: Dave Chinner Source kernel commit 7d6a13f023567d573ac362502bb702eda716e654 When we do dquot readahead in log recovery, we do not use a verifier as the underlying buffer may not have dquots in it. e.g. the allocation operation hasn't yet been replayed. Hence we do not want to fail recovery because we detect an operation to be replayed has not been run yet. This problem was addressed for inodes in commit d891400 ("xfs: inode buffers may not be valid during recovery readahead") but the problem was not recognised to exist for dquots and their buffers as the dquot readahead did not have a verifier. The result of not using a verifier is that when the buffer is then next read to replay a dquot modification, the dquot buffer verifier will only be attached to the buffer if *readahead is not complete*. Hence we can read the buffer, replay the dquot changes and then add it to the delwri submission list without it having a verifier attached to it. This then generates warnings in xfs_buf_ioapply(), which catches and warns about this case. Fix this and make it handle the same readahead verifier error cases as for inode buffers by adding a new readahead verifier that has a write operation as well as a read operation that marks the buffer as not done if any corruption is detected. Also make sure we don't run readahead if the dquot buffer has been marked as cancelled by recovery. This will result in readahead either succeeding and the buffer having a valid write verifier, or readahead failing and the buffer state requiring the subsequent read to resubmit the IO with the new verifier. In either case, this will result in the buffer always ending up with a valid write verifier on it. Note: we also need to fix the inode buffer readahead error handling to mark the buffer with EIO. Brian noticed the code I copied from there wrong during review, so fix it at the same time. Add comments linking the two functions that handle readahead verifier errors together so we don't forget this behavioural link in future. cc: # 3.12 - current Signed-off-by: Dave Chinner Reviewed-by: Brian Foster Signed-off-by: Dave Chinner --- libxfs/xfs_dquot_buf.c | 36 ++++++++++++++++++++++++++++++------ libxfs/xfs_inode_buf.c | 2 ++ libxfs/xfs_quota_defs.h | 2 +- libxfs/xfs_shared.h | 1 + 4 files changed, 34 insertions(+), 7 deletions(-) diff --git a/libxfs/xfs_dquot_buf.c b/libxfs/xfs_dquot_buf.c index fd4aa4b..025d49b 100644 --- a/libxfs/xfs_dquot_buf.c +++ b/libxfs/xfs_dquot_buf.c @@ -62,7 +62,7 @@ xfs_dqcheck( xfs_dqid_t id, uint type, /* used only when IO_dorepair is true */ uint flags, - char *str) + const char *str) { xfs_dqblk_t *d = (xfs_dqblk_t *)ddq; int errs = 0; @@ -215,7 +215,8 @@ xfs_dquot_buf_verify_crc( STATIC bool xfs_dquot_buf_verify( struct xfs_mount *mp, - struct xfs_buf *bp) + struct xfs_buf *bp, + int warn) { struct xfs_dqblk *d = (struct xfs_dqblk *)bp->b_addr; xfs_dqid_t id = 0; @@ -248,8 +249,7 @@ xfs_dquot_buf_verify( if (i == 0) id = be32_to_cpu(ddq->d_id); - error = xfs_dqcheck(mp, ddq, id + i, 0, XFS_QMOPT_DOWARN, - "xfs_dquot_buf_verify"); + error = xfs_dqcheck(mp, ddq, id + i, 0, warn, __func__); if (error) return false; } @@ -264,7 +264,7 @@ xfs_dquot_buf_read_verify( if (!xfs_dquot_buf_verify_crc(mp, bp)) xfs_buf_ioerror(bp, -EFSBADCRC); - else if (!xfs_dquot_buf_verify(mp, bp)) + else if (!xfs_dquot_buf_verify(mp, bp, XFS_QMOPT_DOWARN)) xfs_buf_ioerror(bp, -EFSCORRUPTED); if (bp->b_error) @@ -272,6 +272,25 @@ xfs_dquot_buf_read_verify( } /* + * readahead errors are silent and simply leave the buffer as !done so a real + * read will then be run with the xfs_dquot_buf_ops verifier. See + * xfs_inode_buf_verify() for why we use EIO and ~XBF_DONE here rather than + * reporting the failure. + */ +static void +xfs_dquot_buf_readahead_verify( + struct xfs_buf *bp) +{ + struct xfs_mount *mp = bp->b_target->bt_mount; + + if (!xfs_dquot_buf_verify_crc(mp, bp) || + !xfs_dquot_buf_verify(mp, bp, 0)) { + xfs_buf_ioerror(bp, -EIO); + bp->b_flags &= ~XBF_DONE; + } +} + +/* * we don't calculate the CRC here as that is done when the dquot is flushed to * the buffer after the update is done. This ensures that the dquot in the * buffer always has an up-to-date CRC value. @@ -282,13 +301,18 @@ xfs_dquot_buf_write_verify( { struct xfs_mount *mp = bp->b_target->bt_mount; - if (!xfs_dquot_buf_verify(mp, bp)) { + if (!xfs_dquot_buf_verify(mp, bp, XFS_QMOPT_DOWARN)) { xfs_buf_ioerror(bp, -EFSCORRUPTED); xfs_verifier_error(bp); return; } } +const struct xfs_buf_ops xfs_dquot_buf_ra_ops = { + .name = "xfs_dquot_ra", + .verify_read = xfs_dquot_buf_readahead_verify, + .verify_write = xfs_dquot_buf_write_verify, +}; const struct xfs_buf_ops xfs_dquot_buf_ops = { .name = "xfs_dquot", .verify_read = xfs_dquot_buf_read_verify, diff --git a/libxfs/xfs_inode_buf.c b/libxfs/xfs_inode_buf.c index 546af74..89c05ad 100644 --- a/libxfs/xfs_inode_buf.c +++ b/libxfs/xfs_inode_buf.c @@ -77,6 +77,8 @@ xfs_dinode_good_version( * recovery and we don't get unnecssary panics on debug kernels. We use EIO here * because all we want to do is say readahead failed; there is no-one to report * the error to, so this will distinguish it from a non-ra verifier failure. + * Changes to this readahead error behavour also need to be reflected in + * xfs_dquot_buf_readahead_verify(). */ static void xfs_inode_buf_verify( diff --git a/libxfs/xfs_quota_defs.h b/libxfs/xfs_quota_defs.h index 1b0a083..f51078f 100644 --- a/libxfs/xfs_quota_defs.h +++ b/libxfs/xfs_quota_defs.h @@ -153,7 +153,7 @@ typedef __uint16_t xfs_qwarncnt_t; #define XFS_QMOPT_RESBLK_MASK (XFS_QMOPT_RES_REGBLKS | XFS_QMOPT_RES_RTBLKS) extern int xfs_dqcheck(struct xfs_mount *mp, xfs_disk_dquot_t *ddq, - xfs_dqid_t id, uint type, uint flags, char *str); + xfs_dqid_t id, uint type, uint flags, const char *str); extern int xfs_calc_dquots_per_chunk(unsigned int nbblks); #endif /* __XFS_QUOTA_H__ */ diff --git a/libxfs/xfs_shared.h b/libxfs/xfs_shared.h index 5be5297..15c3ceb 100644 --- a/libxfs/xfs_shared.h +++ b/libxfs/xfs_shared.h @@ -49,6 +49,7 @@ extern const struct xfs_buf_ops xfs_inobt_buf_ops; extern const struct xfs_buf_ops xfs_inode_buf_ops; extern const struct xfs_buf_ops xfs_inode_buf_ra_ops; extern const struct xfs_buf_ops xfs_dquot_buf_ops; +extern const struct xfs_buf_ops xfs_dquot_buf_ra_ops; extern const struct xfs_buf_ops xfs_sb_buf_ops; extern const struct xfs_buf_ops xfs_sb_quiet_buf_ops; extern const struct xfs_buf_ops xfs_symlink_buf_ops; -- 2.5.0 From dave@fromorbit.com Mon Feb 15 00:19:06 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=ham version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay2.corp.sgi.com [137.38.102.29]) by oss.sgi.com (Postfix) with ESMTP id 4474D7CAB for ; Mon, 15 Feb 2016 00:19:05 -0600 (CST) Received: from cuda.sgi.com (cuda2.sgi.com [192.48.176.25]) by relay2.corp.sgi.com (Postfix) with ESMTP id 281ED304051 for ; Sun, 14 Feb 2016 22:19:05 -0800 (PST) X-ASG-Debug-ID: 1455517136-04cbb04331e2740002-NocioJ Received: from ipmail06.adl2.internode.on.net (ipmail06.adl2.internode.on.net [150.101.137.129]) by cuda.sgi.com with ESMTP id lYEMwHqX8N422B40 for ; Sun, 14 Feb 2016 22:19:02 -0800 (PST) X-Barracuda-Envelope-From: dave@fromorbit.com X-Barracuda-Apparent-Source-IP: 150.101.137.129 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: A2B1DQBZbcFWPBATLHleKAECgw+BP4Zin2YBAQEBAQEGkTGLPU0BAQEBAQEHAQEBAUE/QQ4Bg3IBBScvMwgYMTkDBxQZiBm8PoVJjWkFh1CHBogjnElEjXqCGAELATwDGYFcKC6Ce4V9AQEB Received: from ppp121-44-19-16.lns20.syd4.internode.on.net (HELO dastard) ([121.44.19.16]) by ipmail06.adl2.internode.on.net with ESMTP; 15 Feb 2016 16:48:44 +1030 Received: from disappointment.disaster.area ([192.168.1.110] helo=disappointment) by dastard with esmtp (Exim 4.80) (envelope-from ) id 1aVCUN-0000MD-IF for xfs@oss.sgi.com; Mon, 15 Feb 2016 17:18:27 +1100 Received: from dave by disappointment with local (Exim 4.86) (envelope-from ) id 1aVCUN-0005GT-HR for xfs@oss.sgi.com; Mon, 15 Feb 2016 17:18:27 +1100 From: Dave Chinner To: xfs@oss.sgi.com Subject: [PATCH 05/14] xfs: introduce BMAPI_ZERO for allocating zeroed extents Date: Mon, 15 Feb 2016 17:18:16 +1100 X-ASG-Orig-Subj: [PATCH 05/14] xfs: introduce BMAPI_ZERO for allocating zeroed extents Message-Id: <1455517105-20033-6-git-send-email-david@fromorbit.com> X-Mailer: git-send-email 2.5.0 In-Reply-To: <1455517105-20033-1-git-send-email-david@fromorbit.com> References: <1455517105-20033-1-git-send-email-david@fromorbit.com> X-Barracuda-Connect: ipmail06.adl2.internode.on.net[150.101.137.129] X-Barracuda-Start-Time: 1455517141 X-Barracuda-URL: https://192.48.176.25:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-BRTS-Status: 1 X-Barracuda-Spam-Score: 0.00 X-Barracuda-Spam-Status: No, SCORE=0.00 using per-user scores of TAG_LEVEL=1000.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.7 tests= X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.3.27042 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- From: Dave Chinner Source kernel commit 3fbbbea34bac049c0b5938dc065f7d8ee1ef7e67 To enable DAX to do atomic allocation of zeroed extents, we need to drive the block zeroing deep into the allocator. Because xfs_bmapi_write() can return merged extents on allocation that were only partially allocated (i.e. requested range spans allocated and hole regions, allocation into the hole was contiguous), we cannot zero the extent returned from xfs_bmapi_write() as that can overwrite existing data with zeros. Hence we have to drive the extent zeroing into the allocation code, prior to where we merge the extents into the BMBT and return the resultant map. This means we need to propagate this need down to the xfs_alloc_vextent() and issue the block zeroing at this point. While this functionality is being introduced for DAX, there is no reason why it is specific to DAX - we can per-zero blocks during the allocation transaction on any type of device. It's just slow (and usually slower than unwritten allocation and conversion) on traditional block devices so doesn't tend to get used. We can, however, hook hardware zeroing optimisations via sb_issue_zeroout() to this operation, so it may be useful in future and hence the "allocate zeroed blocks" API needs to be implementation neutral. Signed-off-by: Dave Chinner Reviewed-by: Brian Foster Signed-off-by: Dave Chinner --- include/libxfs.h | 1 - libxfs/libxfs_api_defs.h | 1 + libxfs/libxfs_io.h | 2 ++ libxfs/libxfs_priv.h | 3 +++ libxfs/rdwr.c | 4 +++- libxfs/util.c | 35 +++++++++++++++++++++++++++++++++++ libxfs/xfs_alloc.c | 10 +++++++++- libxfs/xfs_alloc.h | 8 +++++--- libxfs/xfs_bmap.c | 35 +++++++++++++++++++++++++++++++++-- libxfs/xfs_bmap.h | 13 +++++++++++-- 10 files changed, 102 insertions(+), 10 deletions(-) diff --git a/include/libxfs.h b/include/libxfs.h index bd51df0..5e8f3d4 100644 --- a/include/libxfs.h +++ b/include/libxfs.h @@ -139,7 +139,6 @@ extern int libxfs_init (libxfs_init_t *); extern void libxfs_destroy (void); extern int libxfs_device_to_fd (dev_t); extern dev_t libxfs_device_open (char *, int, int, int); -extern void libxfs_device_zero(struct xfs_buftarg *, xfs_daddr_t, uint); extern void libxfs_device_close (dev_t); extern int libxfs_device_alignment (void); extern void libxfs_report(FILE *); diff --git a/libxfs/libxfs_api_defs.h b/libxfs/libxfs_api_defs.h index e9fd9c8..3a649e3 100644 --- a/libxfs/libxfs_api_defs.h +++ b/libxfs/libxfs_api_defs.h @@ -73,6 +73,7 @@ #define xfs_bunmapi libxfs_bunmapi #define xfs_bmbt_get_all libxfs_bmbt_get_all #define xfs_rtfree_extent libxfs_rtfree_extent +#define xfs_zero_extent libxfs_zero_extent #define xfs_da_brelse libxfs_da_brelse #define xfs_da_hashname libxfs_da_hashname diff --git a/libxfs/libxfs_io.h b/libxfs/libxfs_io.h index 86b18a0..29ab583 100644 --- a/libxfs/libxfs_io.h +++ b/libxfs/libxfs_io.h @@ -212,6 +212,8 @@ extern int libxfs_writebufr(struct xfs_buf *); extern int libxfs_readbufr(struct xfs_buftarg *, xfs_daddr_t, xfs_buf_t *, int, int); extern int libxfs_readbufr_map(struct xfs_buftarg *, struct xfs_buf *, int); +extern int libxfs_device_zero(struct xfs_buftarg *, xfs_daddr_t, uint); + extern int libxfs_bhash_size; #define LIBXFS_BREAD 0x1 diff --git a/libxfs/libxfs_priv.h b/libxfs/libxfs_priv.h index e2884a2..2c5aba0 100644 --- a/libxfs/libxfs_priv.h +++ b/libxfs/libxfs_priv.h @@ -520,6 +520,9 @@ void xfs_verifier_error(struct xfs_buf *bp); /* xfs_rtalloc.c */ int libxfs_rtfree_extent(struct xfs_trans *, xfs_rtblock_t, xfs_extlen_t); +int libxfs_zero_extent(struct xfs_inode *ip, xfs_fsblock_t start_fsb, + xfs_off_t count_fsb); + bool xfs_log_check_lsn(struct xfs_mount *, xfs_lsn_t); #endif /* __LIBXFS_INTERNAL_XFS_H__ */ diff --git a/libxfs/rdwr.c b/libxfs/rdwr.c index 2e298c2..3522c26 100644 --- a/libxfs/rdwr.c +++ b/libxfs/rdwr.c @@ -67,7 +67,8 @@ #define IO_BCOMPARE_CHECK -void +/* XXX: (dgc) Propagate errors, only exit if fail-on-error flag set */ +int libxfs_device_zero(struct xfs_buftarg *btp, xfs_daddr_t start, uint len) { xfs_off_t start_offset, end_offset, offset; @@ -109,6 +110,7 @@ libxfs_device_zero(struct xfs_buftarg *btp, xfs_daddr_t start, uint len) offset += bytes; } free(z); + return 0; } static void unmount_record(void *p) diff --git a/libxfs/util.c b/libxfs/util.c index 90031fd..ee4bf3c 100644 --- a/libxfs/util.c +++ b/libxfs/util.c @@ -17,6 +17,7 @@ */ #include "libxfs_priv.h" +#include "libxfs_io.h" #include "init.h" #include "xfs_fs.h" #include "xfs_shared.h" @@ -33,6 +34,7 @@ #include "xfs_trans_space.h" #include "xfs_ialloc.h" #include "xfs_alloc.h" +#include "xfs_bit.h" /* * Calculate the worst case log unit reservation for a given superblock @@ -770,3 +772,36 @@ xfs_log_check_lsn( return true; } + +static struct xfs_buftarg * +xfs_find_bdev_for_inode( + struct xfs_inode *ip) +{ + struct xfs_mount *mp = ip->i_mount; + + if (XFS_IS_REALTIME_INODE(ip)) + return mp->m_rtdev_targp; + return mp->m_ddev_targp; +} + +static xfs_daddr_t +xfs_fsb_to_db(struct xfs_inode *ip, xfs_fsblock_t fsb) +{ + if (XFS_IS_REALTIME_INODE(ip)) + return XFS_FSB_TO_BB(ip->i_mount, fsb); + return XFS_FSB_TO_DADDR(ip->i_mount, (fsb)); +} + + +int +libxfs_zero_extent( + struct xfs_inode *ip, + xfs_fsblock_t start_fsb, + xfs_off_t count_fsb) +{ + xfs_daddr_t sector = xfs_fsb_to_db(ip, start_fsb); + ssize_t size = XFS_FSB_TO_BB(ip->i_mount, count_fsb); + + return libxfs_device_zero(xfs_find_bdev_for_inode(ip), sector, size); +} + diff --git a/libxfs/xfs_alloc.c b/libxfs/xfs_alloc.c index 12d59df..af40270 100644 --- a/libxfs/xfs_alloc.c +++ b/libxfs/xfs_alloc.c @@ -2508,7 +2508,7 @@ xfs_alloc_vextent( * Try near allocation first, then anywhere-in-ag after * the first a.g. fails. */ - if ((args->userdata == XFS_ALLOC_INITIAL_USER_DATA) && + if ((args->userdata & XFS_ALLOC_INITIAL_USER_DATA) && (mp->m_flags & XFS_MOUNT_32BITINODES)) { args->fsbno = XFS_AGB_TO_FSB(mp, ((mp->m_agfrotor / rotorstep) % @@ -2639,6 +2639,14 @@ xfs_alloc_vextent( XFS_AG_CHECK_DADDR(mp, XFS_FSB_TO_DADDR(mp, args->fsbno), args->len); #endif + + /* Zero the extent if we were asked to do so */ + if (args->userdata & XFS_ALLOC_USERDATA_ZERO) { + error = xfs_zero_extent(args->ip, args->fsbno, args->len); + if (error) + goto error0; + } + } xfs_perag_put(args->pag); return 0; diff --git a/libxfs/xfs_alloc.h b/libxfs/xfs_alloc.h index 071b28b..135eb3d 100644 --- a/libxfs/xfs_alloc.h +++ b/libxfs/xfs_alloc.h @@ -101,6 +101,7 @@ typedef struct xfs_alloc_arg { struct xfs_mount *mp; /* file system mount point */ struct xfs_buf *agbp; /* buffer for a.g. freelist header */ struct xfs_perag *pag; /* per-ag struct for this agno */ + struct xfs_inode *ip; /* for userdata zeroing method */ xfs_fsblock_t fsbno; /* file system block number */ xfs_agnumber_t agno; /* allocation group number */ xfs_agblock_t agbno; /* allocation group-relative block # */ @@ -120,15 +121,16 @@ typedef struct xfs_alloc_arg { char wasdel; /* set if allocation was prev delayed */ char wasfromfl; /* set if allocation is from freelist */ char isfl; /* set if is freelist blocks - !acctg */ - char userdata; /* set if this is user data */ + char userdata; /* mask defining userdata treatment */ xfs_fsblock_t firstblock; /* io first block allocated */ } xfs_alloc_arg_t; /* * Defines for userdata */ -#define XFS_ALLOC_USERDATA 1 /* allocation is for user data*/ -#define XFS_ALLOC_INITIAL_USER_DATA 2 /* special case start of file */ +#define XFS_ALLOC_USERDATA (1 << 0)/* allocation is for user data*/ +#define XFS_ALLOC_INITIAL_USER_DATA (1 << 1)/* special case start of file */ +#define XFS_ALLOC_USERDATA_ZERO (1 << 2)/* zero extent on allocation */ xfs_extlen_t xfs_alloc_longest_free_extent(struct xfs_mount *mp, struct xfs_perag *pag, xfs_extlen_t need); diff --git a/libxfs/xfs_bmap.c b/libxfs/xfs_bmap.c index 8e19b50..a38549c 100644 --- a/libxfs/xfs_bmap.c +++ b/libxfs/xfs_bmap.c @@ -3795,8 +3795,13 @@ xfs_bmap_btalloc( args.wasdel = ap->wasdel; args.isfl = 0; args.userdata = ap->userdata; - if ((error = xfs_alloc_vextent(&args))) + if (ap->userdata & XFS_ALLOC_USERDATA_ZERO) + args.ip = ap->ip; + + error = xfs_alloc_vextent(&args); + if (error) return error; + if (tryagain && args.fsbno == NULLFSBLOCK) { /* * Exact allocation failed. Now try with alignment @@ -4295,11 +4300,14 @@ xfs_bmapi_allocate( /* * Indicate if this is the first user data in the file, or just any - * user data. + * user data. And if it is userdata, indicate whether it needs to + * be initialised to zero during allocation. */ if (!(bma->flags & XFS_BMAPI_METADATA)) { bma->userdata = (bma->offset == 0) ? XFS_ALLOC_INITIAL_USER_DATA : XFS_ALLOC_USERDATA; + if (bma->flags & XFS_BMAPI_ZERO) + bma->userdata |= XFS_ALLOC_USERDATA_ZERO; } bma->minlen = (bma->flags & XFS_BMAPI_CONTIG) ? bma->length : 1; @@ -4414,6 +4422,17 @@ xfs_bmapi_convert_unwritten( mval->br_state = (mval->br_state == XFS_EXT_UNWRITTEN) ? XFS_EXT_NORM : XFS_EXT_UNWRITTEN; + /* + * Before insertion into the bmbt, zero the range being converted + * if required. + */ + if (flags & XFS_BMAPI_ZERO) { + error = xfs_zero_extent(bma->ip, mval->br_startblock, + mval->br_blockcount); + if (error) + return error; + } + error = xfs_bmap_add_extent_unwritten_real(bma->tp, bma->ip, &bma->idx, &bma->cur, mval, bma->firstblock, bma->flist, &tmp_logflags); @@ -4507,6 +4526,18 @@ xfs_bmapi_write( ASSERT(XFS_IFORK_FORMAT(ip, whichfork) != XFS_DINODE_FMT_LOCAL); ASSERT(xfs_isilocked(ip, XFS_ILOCK_EXCL)); + /* zeroing is for currently only for data extents, not metadata */ + ASSERT((flags & (XFS_BMAPI_METADATA | XFS_BMAPI_ZERO)) != + (XFS_BMAPI_METADATA | XFS_BMAPI_ZERO)); + /* + * we can allocate unwritten extents or pre-zero allocated blocks, + * but it makes no sense to do both at once. This would result in + * zeroing the unwritten extent twice, but it still being an + * unwritten extent.... + */ + ASSERT((flags & (XFS_BMAPI_PREALLOC | XFS_BMAPI_ZERO)) != + (XFS_BMAPI_PREALLOC | XFS_BMAPI_ZERO)); + if (unlikely(XFS_TEST_ERROR( (XFS_IFORK_FORMAT(ip, whichfork) != XFS_DINODE_FMT_EXTENTS && XFS_IFORK_FORMAT(ip, whichfork) != XFS_DINODE_FMT_BTREE), diff --git a/libxfs/xfs_bmap.h b/libxfs/xfs_bmap.h index d3daf6d..baec27d 100644 --- a/libxfs/xfs_bmap.h +++ b/libxfs/xfs_bmap.h @@ -52,9 +52,9 @@ struct xfs_bmalloca { xfs_extlen_t minleft; /* amount must be left after alloc */ bool eof; /* set if allocating past last extent */ bool wasdel; /* replacing a delayed allocation */ - bool userdata;/* set if is user data */ bool aeof; /* allocated space at eof */ bool conv; /* overwriting unwritten extents */ + char userdata;/* userdata mask */ int flags; }; @@ -109,6 +109,14 @@ typedef struct xfs_bmap_free */ #define XFS_BMAPI_CONVERT 0x040 +/* + * allocate zeroed extents - this requires all newly allocated user data extents + * to be initialised to zero. It will be ignored if XFS_BMAPI_METADATA is set. + * Use in conjunction with XFS_BMAPI_CONVERT to convert unwritten extents found + * during the allocation range to zeroed written extents. + */ +#define XFS_BMAPI_ZERO 0x080 + #define XFS_BMAPI_FLAGS \ { XFS_BMAPI_ENTIRE, "ENTIRE" }, \ { XFS_BMAPI_METADATA, "METADATA" }, \ @@ -116,7 +124,8 @@ typedef struct xfs_bmap_free { XFS_BMAPI_PREALLOC, "PREALLOC" }, \ { XFS_BMAPI_IGSTATE, "IGSTATE" }, \ { XFS_BMAPI_CONTIG, "CONTIG" }, \ - { XFS_BMAPI_CONVERT, "CONVERT" } + { XFS_BMAPI_CONVERT, "CONVERT" }, \ + { XFS_BMAPI_ZERO, "ZERO" } static inline int xfs_bmapi_aflag(int w) -- 2.5.0 From dave@fromorbit.com Mon Feb 15 00:19:07 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=ham version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay2.corp.sgi.com [137.38.102.29]) by oss.sgi.com (Postfix) with ESMTP id 903EB7CA2 for ; Mon, 15 Feb 2016 00:19:07 -0600 (CST) Received: from cuda.sgi.com (cuda1.sgi.com [192.48.157.11]) by relay2.corp.sgi.com (Postfix) with ESMTP id 5787C304051 for ; Sun, 14 Feb 2016 22:19:07 -0800 (PST) X-ASG-Debug-ID: 1455517135-04bdf066edcfa70006-NocioJ Received: from ipmail06.adl2.internode.on.net (ipmail06.adl2.internode.on.net [150.101.137.129]) by cuda.sgi.com with ESMTP id 0saJzx61KwOEUJG5 for ; Sun, 14 Feb 2016 22:19:02 -0800 (PST) X-Barracuda-Envelope-From: dave@fromorbit.com X-Barracuda-Apparent-Source-IP: 150.101.137.129 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: A2AyDwBZbcFWPBATLHleKAECgw9SbYZin1oMAQEBAQEBBowShR+EIYccTQEBAQEBAQcBAQEBQT9BDgGDcgEFGg0vMwgYMTkDBxQZiBm8PoVJjWkFh1ADhVSBL4gjhU+JYkqMTkSFK4hPghgBCwE/GYFcKC6Ce4V9AQEB Received: from ppp121-44-19-16.lns20.syd4.internode.on.net (HELO dastard) ([121.44.19.16]) by ipmail06.adl2.internode.on.net with ESMTP; 15 Feb 2016 16:48:44 +1030 Received: from disappointment.disaster.area ([192.168.1.110] helo=disappointment) by dastard with esmtp (Exim 4.80) (envelope-from ) id 1aVCUN-0000MG-JP for xfs@oss.sgi.com; Mon, 15 Feb 2016 17:18:27 +1100 Received: from dave by disappointment with local (Exim 4.86) (envelope-from ) id 1aVCUN-0005Gi-Ii for xfs@oss.sgi.com; Mon, 15 Feb 2016 17:18:27 +1100 From: Dave Chinner To: xfs@oss.sgi.com Subject: [PATCH 08/14] xfs: eliminate committed arg from xfs_bmap_finish Date: Mon, 15 Feb 2016 17:18:19 +1100 X-ASG-Orig-Subj: [PATCH 08/14] xfs: eliminate committed arg from xfs_bmap_finish Message-Id: <1455517105-20033-9-git-send-email-david@fromorbit.com> X-Mailer: git-send-email 2.5.0 In-Reply-To: <1455517105-20033-1-git-send-email-david@fromorbit.com> References: <1455517105-20033-1-git-send-email-david@fromorbit.com> X-Barracuda-Connect: ipmail06.adl2.internode.on.net[150.101.137.129] X-Barracuda-Start-Time: 1455517142 X-Barracuda-URL: https://192.48.157.11:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-BRTS-Status: 1 X-Barracuda-Spam-Score: 0.00 X-Barracuda-Spam-Status: No, SCORE=0.00 using per-user scores of TAG_LEVEL=1000.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.7 tests= X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.3.27042 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- From: Eric Sandeen Source kernel commit f6106efae5f4144b32f6c10de0dc3e7efc9181e3 Calls to xfs_bmap_finish() and xfs_trans_ijoin(), and the associated comments were replicated several times across the attribute code, all dealing with what to do if the transaction was or wasn't committed. And in that replicated code, an ASSERT() test of an uninitialized variable occurs in several locations: error = xfs_attr_thing(&args); if (!error) { error = xfs_bmap_finish(&args.trans, args.flist, &committed); } if (error) { ASSERT(committed); If the first xfs_attr_thing() failed, we'd skip the xfs_bmap_finish, never set "committed", and then test it in the ASSERT. Fix this up by moving the committed state internal to xfs_bmap_finish, and add a new inode argument. If an inode is passed in, it is passed through to __xfs_trans_roll() and joined to the transaction there if the transaction was committed. xfs_qm_dqalloc() was a little unique in that it called bjoin rather than ijoin, but as Dave points out we can detect the committed state but checking whether (*tpp != tp). Addresses-Coverity-Id: 102360 Addresses-Coverity-Id: 102361 Addresses-Coverity-Id: 102363 Addresses-Coverity-Id: 102364 Signed-off-by: Eric Sandeen Reviewed-by: Christoph Hellwig Signed-off-by: Dave Chinner --- include/libxfs.h | 1 - libxfs/util.c | 19 +++---- libxfs/xfs_attr.c | 141 ++++++++--------------------------------------- libxfs/xfs_attr_remote.c | 31 ++--------- libxfs/xfs_bmap.c | 6 +- libxfs/xfs_bmap.h | 2 +- mkfs/proto.c | 14 ++--- repair/phase6.c | 33 +++++------ 8 files changed, 57 insertions(+), 190 deletions(-) diff --git a/include/libxfs.h b/include/libxfs.h index 5e8f3d4..cf2e20e 100644 --- a/include/libxfs.h +++ b/include/libxfs.h @@ -163,7 +163,6 @@ extern unsigned int libxfs_log2_roundup(unsigned int i); extern int libxfs_alloc_file_space (struct xfs_inode *, xfs_off_t, xfs_off_t, int, int); -extern int libxfs_bmap_finish(xfs_trans_t **, xfs_bmap_free_t *, int *); extern void libxfs_fs_repair_cmn_err(int, struct xfs_mount *, char *, ...); extern void libxfs_fs_cmn_err(int, struct xfs_mount *, char *, ...); diff --git a/libxfs/util.c b/libxfs/util.c index ee4bf3c..484a924 100644 --- a/libxfs/util.c +++ b/libxfs/util.c @@ -493,27 +493,25 @@ libxfs_mod_incore_sb( int libxfs_bmap_finish( - xfs_trans_t **tp, - xfs_bmap_free_t *flist, - int *committed) + struct xfs_trans **tp, + struct xfs_bmap_free *flist, + struct xfs_inode *ip) { xfs_bmap_free_item_t *free; /* free extent list item */ xfs_bmap_free_item_t *next; /* next item on free list */ int error; - if (flist->xbf_count == 0) { - *committed = 0; + if (flist->xbf_count == 0) return 0; - } for (free = flist->xbf_first; free != NULL; free = next) { next = free->xbfi_next; - if ((error = xfs_free_extent(*tp, free->xbfi_startblock, - free->xbfi_blockcount))) + error = xfs_free_extent(*tp, free->xbfi_startblock, + free->xbfi_blockcount); + if (error) return error; xfs_bmap_del_free(flist, NULL, free); } - *committed = 0; return 0; } @@ -543,7 +541,6 @@ libxfs_alloc_file_space( xfs_fileoff_t startoffset_fsb; xfs_trans_t *tp; int xfs_bmapi_flags; - int committed; int error; if (len <= 0) @@ -588,7 +585,7 @@ libxfs_alloc_file_space( goto error0; /* complete the transaction */ - error = xfs_bmap_finish(&tp, &free_list, &committed); + error = xfs_bmap_finish(&tp, &free_list, ip); if (error) goto error0; diff --git a/libxfs/xfs_attr.c b/libxfs/xfs_attr.c index 5e79f3d..afe3dcb 100644 --- a/libxfs/xfs_attr.c +++ b/libxfs/xfs_attr.c @@ -200,7 +200,7 @@ xfs_attr_set( struct xfs_trans_res tres; xfs_fsblock_t firstblock; int rsvd = (flags & ATTR_ROOT) != 0; - int error, err2, committed, local; + int error, err2, local; XFS_STATS_INC(mp, xs_attr_set); @@ -327,25 +327,15 @@ xfs_attr_set( */ xfs_bmap_init(args.flist, args.firstblock); error = xfs_attr_shortform_to_leaf(&args); - if (!error) { - error = xfs_bmap_finish(&args.trans, args.flist, - &committed); - } + if (!error) + error = xfs_bmap_finish(&args.trans, args.flist, dp); if (error) { - ASSERT(committed); args.trans = NULL; xfs_bmap_cancel(&flist); goto out; } /* - * bmap_finish() may have committed the last trans and started - * a new one. We need the inode to be in all transactions. - */ - if (committed) - xfs_trans_ijoin(args.trans, dp, 0); - - /* * Commit the leaf transformation. We'll need another (linked) * transaction to add the new attribute to the leaf. */ @@ -561,7 +551,7 @@ xfs_attr_leaf_addname(xfs_da_args_t *args) { xfs_inode_t *dp; struct xfs_buf *bp; - int retval, error, committed, forkoff; + int retval, error, forkoff; trace_xfs_attr_leaf_addname(args); @@ -621,25 +611,15 @@ xfs_attr_leaf_addname(xfs_da_args_t *args) */ xfs_bmap_init(args->flist, args->firstblock); error = xfs_attr3_leaf_to_node(args); - if (!error) { - error = xfs_bmap_finish(&args->trans, args->flist, - &committed); - } + if (!error) + error = xfs_bmap_finish(&args->trans, args->flist, dp); if (error) { - ASSERT(committed); args->trans = NULL; xfs_bmap_cancel(args->flist); return error; } /* - * bmap_finish() may have committed the last trans and started - * a new one. We need the inode to be in all transactions. - */ - if (committed) - xfs_trans_ijoin(args->trans, dp, 0); - - /* * Commit the current trans (including the inode) and start * a new one. */ @@ -722,25 +702,14 @@ xfs_attr_leaf_addname(xfs_da_args_t *args) xfs_bmap_init(args->flist, args->firstblock); error = xfs_attr3_leaf_to_shortform(bp, args, forkoff); /* bp is gone due to xfs_da_shrink_inode */ - if (!error) { + if (!error) error = xfs_bmap_finish(&args->trans, - args->flist, - &committed); - } + args->flist, dp); if (error) { - ASSERT(committed); args->trans = NULL; xfs_bmap_cancel(args->flist); return error; } - - /* - * bmap_finish() may have committed the last trans - * and started a new one. We need the inode to be - * in all transactions. - */ - if (committed) - xfs_trans_ijoin(args->trans, dp, 0); } /* @@ -768,7 +737,7 @@ xfs_attr_leaf_removename(xfs_da_args_t *args) { xfs_inode_t *dp; struct xfs_buf *bp; - int error, committed, forkoff; + int error, forkoff; trace_xfs_attr_leaf_removename(args); @@ -796,23 +765,13 @@ xfs_attr_leaf_removename(xfs_da_args_t *args) xfs_bmap_init(args->flist, args->firstblock); error = xfs_attr3_leaf_to_shortform(bp, args, forkoff); /* bp is gone due to xfs_da_shrink_inode */ - if (!error) { - error = xfs_bmap_finish(&args->trans, args->flist, - &committed); - } + if (!error) + error = xfs_bmap_finish(&args->trans, args->flist, dp); if (error) { - ASSERT(committed); args->trans = NULL; xfs_bmap_cancel(args->flist); return error; } - - /* - * bmap_finish() may have committed the last trans and started - * a new one. We need the inode to be in all transactions. - */ - if (committed) - xfs_trans_ijoin(args->trans, dp, 0); } return 0; } @@ -870,7 +829,7 @@ xfs_attr_node_addname(xfs_da_args_t *args) xfs_da_state_blk_t *blk; xfs_inode_t *dp; xfs_mount_t *mp; - int committed, retval, error; + int retval, error; trace_xfs_attr_node_addname(args); @@ -931,27 +890,16 @@ restart: state = NULL; xfs_bmap_init(args->flist, args->firstblock); error = xfs_attr3_leaf_to_node(args); - if (!error) { + if (!error) error = xfs_bmap_finish(&args->trans, - args->flist, - &committed); - } + args->flist, dp); if (error) { - ASSERT(committed); args->trans = NULL; xfs_bmap_cancel(args->flist); goto out; } /* - * bmap_finish() may have committed the last trans - * and started a new one. We need the inode to be - * in all transactions. - */ - if (committed) - xfs_trans_ijoin(args->trans, dp, 0); - - /* * Commit the node conversion and start the next * trans in the chain. */ @@ -970,23 +918,13 @@ restart: */ xfs_bmap_init(args->flist, args->firstblock); error = xfs_da3_split(state); - if (!error) { - error = xfs_bmap_finish(&args->trans, args->flist, - &committed); - } + if (!error) + error = xfs_bmap_finish(&args->trans, args->flist, dp); if (error) { - ASSERT(committed); args->trans = NULL; xfs_bmap_cancel(args->flist); goto out; } - - /* - * bmap_finish() may have committed the last trans and started - * a new one. We need the inode to be in all transactions. - */ - if (committed) - xfs_trans_ijoin(args->trans, dp, 0); } else { /* * Addition succeeded, update Btree hashvals. @@ -1079,25 +1017,14 @@ restart: if (retval && (state->path.active > 1)) { xfs_bmap_init(args->flist, args->firstblock); error = xfs_da3_join(state); - if (!error) { + if (!error) error = xfs_bmap_finish(&args->trans, - args->flist, - &committed); - } + args->flist, dp); if (error) { - ASSERT(committed); args->trans = NULL; xfs_bmap_cancel(args->flist); goto out; } - - /* - * bmap_finish() may have committed the last trans - * and started a new one. We need the inode to be - * in all transactions. - */ - if (committed) - xfs_trans_ijoin(args->trans, dp, 0); } /* @@ -1139,7 +1066,7 @@ xfs_attr_node_removename(xfs_da_args_t *args) xfs_da_state_blk_t *blk; xfs_inode_t *dp; struct xfs_buf *bp; - int retval, error, committed, forkoff; + int retval, error, forkoff; trace_xfs_attr_node_removename(args); @@ -1213,24 +1140,13 @@ xfs_attr_node_removename(xfs_da_args_t *args) if (retval && (state->path.active > 1)) { xfs_bmap_init(args->flist, args->firstblock); error = xfs_da3_join(state); - if (!error) { - error = xfs_bmap_finish(&args->trans, args->flist, - &committed); - } + if (!error) + error = xfs_bmap_finish(&args->trans, args->flist, dp); if (error) { - ASSERT(committed); args->trans = NULL; xfs_bmap_cancel(args->flist); goto out; } - - /* - * bmap_finish() may have committed the last trans and started - * a new one. We need the inode to be in all transactions. - */ - if (committed) - xfs_trans_ijoin(args->trans, dp, 0); - /* * Commit the Btree join operation and start a new trans. */ @@ -1258,25 +1174,14 @@ xfs_attr_node_removename(xfs_da_args_t *args) xfs_bmap_init(args->flist, args->firstblock); error = xfs_attr3_leaf_to_shortform(bp, args, forkoff); /* bp is gone due to xfs_da_shrink_inode */ - if (!error) { + if (!error) error = xfs_bmap_finish(&args->trans, - args->flist, - &committed); - } + args->flist, dp); if (error) { - ASSERT(committed); args->trans = NULL; xfs_bmap_cancel(args->flist); goto out; } - - /* - * bmap_finish() may have committed the last trans - * and started a new one. We need the inode to be - * in all transactions. - */ - if (committed) - xfs_trans_ijoin(args->trans, dp, 0); } else xfs_trans_brelse(args->trans, bp); } diff --git a/libxfs/xfs_attr_remote.c b/libxfs/xfs_attr_remote.c index 95383e3..79d663e 100644 --- a/libxfs/xfs_attr_remote.c +++ b/libxfs/xfs_attr_remote.c @@ -443,8 +443,6 @@ xfs_attr_rmtval_set( * Roll through the "value", allocating blocks on disk as required. */ while (blkcnt > 0) { - int committed; - /* * Allocate a single extent, up to the size of the value. * @@ -462,24 +460,14 @@ xfs_attr_rmtval_set( error = xfs_bmapi_write(args->trans, dp, (xfs_fileoff_t)lblkno, blkcnt, XFS_BMAPI_ATTRFORK, args->firstblock, args->total, &map, &nmap, args->flist); - if (!error) { - error = xfs_bmap_finish(&args->trans, args->flist, - &committed); - } + if (!error) + error = xfs_bmap_finish(&args->trans, args->flist, dp); if (error) { - ASSERT(committed); args->trans = NULL; xfs_bmap_cancel(args->flist); return error; } - /* - * bmap_finish() may have committed the last trans and started - * a new one. We need the inode to be in all transactions. - */ - if (committed) - xfs_trans_ijoin(args->trans, dp, 0); - ASSERT(nmap == 1); ASSERT((map.br_startblock != DELAYSTARTBLOCK) && (map.br_startblock != HOLESTARTBLOCK)); @@ -610,31 +598,20 @@ xfs_attr_rmtval_remove( blkcnt = args->rmtblkcnt; done = 0; while (!done) { - int committed; - xfs_bmap_init(args->flist, args->firstblock); error = xfs_bunmapi(args->trans, args->dp, lblkno, blkcnt, XFS_BMAPI_ATTRFORK, 1, args->firstblock, args->flist, &done); - if (!error) { + if (!error) error = xfs_bmap_finish(&args->trans, args->flist, - &committed); - } + args->dp); if (error) { - ASSERT(committed); args->trans = NULL; xfs_bmap_cancel(args->flist); return error; } /* - * bmap_finish() may have committed the last trans and started - * a new one. We need the inode to be in all transactions. - */ - if (committed) - xfs_trans_ijoin(args->trans, args->dp, 0); - - /* * Close out trans and start the next one in the chain. */ error = xfs_trans_roll(&args->trans, args->dp); diff --git a/libxfs/xfs_bmap.c b/libxfs/xfs_bmap.c index eb19133..8cb89bc 100644 --- a/libxfs/xfs_bmap.c +++ b/libxfs/xfs_bmap.c @@ -1109,7 +1109,6 @@ xfs_bmap_add_attrfork( xfs_trans_t *tp; /* transaction pointer */ int blks; /* space reservation */ int version = 1; /* superblock attr version */ - int committed; /* xaction was committed */ int logflags; /* logging flags */ int error; /* error return value */ @@ -1212,7 +1211,7 @@ xfs_bmap_add_attrfork( xfs_log_sb(tp); } - error = xfs_bmap_finish(&tp, &flist, &committed); + error = xfs_bmap_finish(&tp, &flist, NULL); if (error) goto bmap_cancel; error = xfs_trans_commit(tp); @@ -5949,7 +5948,6 @@ xfs_bmap_split_extent( struct xfs_trans *tp; struct xfs_bmap_free free_list; xfs_fsblock_t firstfsb; - int committed; int error; tp = xfs_trans_alloc(mp, XFS_TRANS_DIOSTRAT); @@ -5970,7 +5968,7 @@ xfs_bmap_split_extent( if (error) goto out; - error = xfs_bmap_finish(&tp, &free_list, &committed); + error = xfs_bmap_finish(&tp, &free_list, NULL); if (error) goto out; diff --git a/libxfs/xfs_bmap.h b/libxfs/xfs_bmap.h index baec27d..6485403 100644 --- a/libxfs/xfs_bmap.h +++ b/libxfs/xfs_bmap.h @@ -195,7 +195,7 @@ void xfs_bmap_add_free(struct xfs_mount *mp, struct xfs_bmap_free *flist, xfs_fsblock_t bno, xfs_filblks_t len); void xfs_bmap_cancel(struct xfs_bmap_free *flist); int xfs_bmap_finish(struct xfs_trans **tp, struct xfs_bmap_free *flist, - int *committed); + struct xfs_inode *ip); void xfs_bmap_compute_maxlevels(struct xfs_mount *mp, int whichfork); int xfs_bmap_first_unused(struct xfs_trans *tp, struct xfs_inode *ip, xfs_extlen_t len, xfs_fileoff_t *unused, int whichfork); diff --git a/mkfs/proto.c b/mkfs/proto.c index cb34b28..21960d5 100644 --- a/mkfs/proto.c +++ b/mkfs/proto.c @@ -358,7 +358,6 @@ parseproto( #define IF_FIFO 6 char *buf; - int committed; int error; xfs_fsblock_t first; int flags; @@ -481,7 +480,7 @@ parseproto( newdirent(mp, tp, pip, &xname, ip->i_ino, &first, &flist); libxfs_trans_log_inode(tp, ip, flags); - error = -libxfs_bmap_finish(&tp, &flist, &committed); + error = -libxfs_bmap_finish(&tp, &flist, ip); if (error) fail(_("Pre-allocated file creation failed"), error); libxfs_trans_commit(tp); @@ -563,7 +562,7 @@ parseproto( } newdirectory(mp, tp, ip, pip); libxfs_trans_log_inode(tp, ip, flags); - error = -libxfs_bmap_finish(&tp, &flist, &committed); + error = -libxfs_bmap_finish(&tp, &flist, ip); if (error) fail(_("Directory creation failed"), error); libxfs_trans_commit(tp); @@ -589,7 +588,7 @@ parseproto( fail(_("Unknown format"), EINVAL); } libxfs_trans_log_inode(tp, ip, flags); - error = -libxfs_bmap_finish(&tp, &flist, &committed); + error = -libxfs_bmap_finish(&tp, &flist, ip); if (error) { fail(_("Error encountered creating file from prototype file"), error); @@ -615,7 +614,6 @@ rtinit( xfs_mount_t *mp) { xfs_fileoff_t bno; - int committed; xfs_fileoff_t ebno; xfs_bmbt_irec_t *ep; int error; @@ -700,7 +698,7 @@ rtinit( } } - error = -libxfs_bmap_finish(&tp, &flist, &committed); + error = -libxfs_bmap_finish(&tp, &flist, rbmip); if (error) { fail(_("Completion of the realtime bitmap failed"), error); } @@ -735,7 +733,7 @@ rtinit( bno += ep->br_blockcount; } } - error = -libxfs_bmap_finish(&tp, &flist, &committed); + error = -libxfs_bmap_finish(&tp, &flist, rsumip); if (error) { fail(_("Completion of the realtime summary failed"), error); } @@ -759,7 +757,7 @@ rtinit( fail(_("Error initializing the realtime space"), error); } - error = -libxfs_bmap_finish(&tp, &flist, &committed); + error = -libxfs_bmap_finish(&tp, &flist, rbmip); if (error) { fail(_("Error completing the realtime space"), error); } diff --git a/repair/phase6.c b/repair/phase6.c index 7680deb..eb36520 100644 --- a/repair/phase6.c +++ b/repair/phase6.c @@ -483,7 +483,6 @@ mk_rbmino(xfs_mount_t *mp) xfs_fsblock_t first; int i; int nmap; - int committed; int error; xfs_bmap_free_t flist; xfs_fileoff_t bno; @@ -578,7 +577,7 @@ mk_rbmino(xfs_mount_t *mp) bno += ep->br_blockcount; } } - error = -libxfs_bmap_finish(&tp, &flist, &committed); + error = -libxfs_bmap_finish(&tp, &flist, ip); if (error) { do_error( _("allocation of the realtime bitmap failed, error = %d\n"), @@ -742,7 +741,6 @@ mk_rsumino(xfs_mount_t *mp) xfs_fsblock_t first; int i; int nmap; - int committed; int error; int nsumblocks; xfs_bmap_free_t flist; @@ -843,7 +841,7 @@ mk_rsumino(xfs_mount_t *mp) bno += ep->br_blockcount; } } - error = -libxfs_bmap_finish(&tp, &flist, &committed); + error = -libxfs_bmap_finish(&tp, &flist, ip); if (error) { do_error( _("allocation of the realtime summary ino failed, error = %d\n"), @@ -947,7 +945,6 @@ mk_orphanage(xfs_mount_t *mp) ino_tree_node_t *irec; int ino_offset = 0; int i; - int committed; int error; xfs_bmap_free_t flist; const int mode = 0755; @@ -1059,7 +1056,7 @@ mk_orphanage(xfs_mount_t *mp) libxfs_dir_init(tp, ip, pip); libxfs_trans_log_inode(tp, ip, XFS_ILOG_CORE); - error = -libxfs_bmap_finish(&tp, &flist, &committed); + error = -libxfs_bmap_finish(&tp, &flist, ip); if (error) { do_error(_("%s directory creation failed -- bmapf error %d\n"), ORPHANAGE, error); @@ -1090,7 +1087,6 @@ mv_orphanage( xfs_fsblock_t first; xfs_bmap_free_t flist; int err; - int committed; unsigned char fname[MAXPATHLEN + 1]; int nres; int incr; @@ -1168,7 +1164,7 @@ mv_orphanage( ino_p->i_d.di_nlink++; libxfs_trans_log_inode(tp, ino_p, XFS_ILOG_CORE); - err = -libxfs_bmap_finish(&tp, &flist, &committed); + err = -libxfs_bmap_finish(&tp, &flist, ino_p); if (err) do_error( _("bmap finish failed (err - %d), filesystem may be out of space\n"), @@ -1215,7 +1211,7 @@ mv_orphanage( err); } - err = -libxfs_bmap_finish(&tp, &flist, &committed); + err = -libxfs_bmap_finish(&tp, &flist, ino_p); if (err) do_error( _("bmap finish failed (%d), filesystem may be out of space\n"), @@ -1254,7 +1250,7 @@ mv_orphanage( ino_p->i_d.di_nlink = 1; libxfs_trans_log_inode(tp, ino_p, XFS_ILOG_CORE); - err = -libxfs_bmap_finish(&tp, &flist, &committed); + err = -libxfs_bmap_finish(&tp, &flist, ino_p); if (err) do_error( _("bmap finish failed (%d), filesystem may be out of space\n"), @@ -1306,7 +1302,6 @@ longform_dir2_rebuild( xfs_bmap_free_t flist; xfs_inode_t pip; dir_hash_ent_t *p; - int committed; int done; /* @@ -1356,7 +1351,7 @@ longform_dir2_rebuild( goto out_bmap_cancel; } - error = -libxfs_bmap_finish(&tp, &flist, &committed); + error = -libxfs_bmap_finish(&tp, &flist, ip); libxfs_trans_commit(tp); @@ -1391,7 +1386,7 @@ _("name create failed in ino %" PRIu64 " (%d), filesystem may be out of space\n" goto out_bmap_cancel; } - error = -libxfs_bmap_finish(&tp, &flist, &committed); + error = -libxfs_bmap_finish(&tp, &flist, ip); if (error) { do_warn( _("bmap finish failed (%d), filesystem may be out of space\n"), @@ -1423,7 +1418,6 @@ dir2_kill_block( struct xfs_buf *bp) { xfs_da_args_t args; - int committed; int error; xfs_fsblock_t firstblock; xfs_bmap_free_t flist; @@ -1453,7 +1447,7 @@ dir2_kill_block( if (error) do_error(_("shrink_inode failed inode %" PRIu64 " block %u\n"), ip->i_ino, da_bno); - libxfs_bmap_finish(&tp, &flist, &committed); + libxfs_bmap_finish(&tp, &flist, ip); libxfs_trans_commit(tp); } @@ -1479,7 +1473,6 @@ longform_dir2_entry_check_data( xfs_dir2_leaf_entry_t *blp; struct xfs_buf *bp; xfs_dir2_block_tail_t *btp; - int committed; struct xfs_dir2_data_hdr *d; xfs_dir2_db_t db; xfs_dir2_data_entry_t *dep; @@ -1930,7 +1923,7 @@ _("entry \"%s\" in dir inode %" PRIu64 " inconsistent with .. value (%" PRIu64 " libxfs_dir2_data_freescan(mp->m_dir_geo, M_DIROPS(mp), d, &i); if (needlog) libxfs_dir2_data_log_header(&da, bp); - libxfs_bmap_finish(&tp, &flist, &committed); + libxfs_bmap_finish(&tp, &flist, ip); libxfs_trans_commit(tp); /* record the largest free space in the freetab for later checking */ @@ -2851,7 +2844,7 @@ process_dir_inode( xfs_inode_t *ip; xfs_trans_t *tp; dir_hash_tab_t *hashtab; - int need_dot, committed; + int need_dot; int dirty, num_illegal, error, nres; ino = XFS_AGINO_TO_INO(mp, agno, irec->ino_startnum + ino_offset); @@ -2996,7 +2989,7 @@ process_dir_inode( libxfs_trans_log_inode(tp, ip, XFS_ILOG_CORE); - error = -libxfs_bmap_finish(&tp, &flist, &committed); + error = -libxfs_bmap_finish(&tp, &flist, ip); ASSERT(error == 0); libxfs_trans_commit(tp); @@ -3057,7 +3050,7 @@ process_dir_inode( libxfs_trans_log_inode(tp, ip, XFS_ILOG_CORE); - error = -libxfs_bmap_finish(&tp, &flist, &committed); + error = -libxfs_bmap_finish(&tp, &flist, ip); ASSERT(error == 0); libxfs_trans_commit(tp); } -- 2.5.0 From mtk.manpages@gmail.com Mon Feb 15 04:25:22 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=FREEMAIL_FROM,T_DKIM_INVALID autolearn=ham version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay1.corp.sgi.com [137.38.102.111]) by oss.sgi.com (Postfix) with ESMTP id EA13D7CA2 for ; Mon, 15 Feb 2016 04:25:22 -0600 (CST) Received: from cuda.sgi.com (cuda1.sgi.com [192.48.157.11]) by relay1.corp.sgi.com (Postfix) with ESMTP id BDF588F8049 for ; Mon, 15 Feb 2016 02:25:22 -0800 (PST) X-ASG-Debug-ID: 1455531917-04bdf066edd4680001-NocioJ Received: from mail-wm0-f45.google.com (mail-wm0-f45.google.com [74.125.82.45]) by cuda.sgi.com with ESMTP id N8lJudfiZcyfC1VX (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128 verify=NO) for ; Mon, 15 Feb 2016 02:25:18 -0800 (PST) X-Barracuda-Envelope-From: mtk.manpages@gmail.com X-Barracuda-Apparent-Source-IP: 74.125.82.45 Received: by mail-wm0-f45.google.com with SMTP id g62so142531207wme.0 for ; Mon, 15 Feb 2016 02:25:18 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=subject:to:references:cc:from:message-id:date:user-agent :mime-version:in-reply-to:content-type:content-transfer-encoding; bh=f6/bIpxTLca1235By2YkmiwxOZ2kQqQrtnVGeQV2CKs=; b=Hl2wPyKd2NnVWH3XCKznBPoMaO5FnFU8b4u7nG1jo5Ta/TQMrGZcXi2n+OuXedAkfT XZuoCvLzj3kr5/0eEMkyg8a0GA7U4GRGPSsCXUqX/LH+6hMHlUb36r3ZWuxankoZCyER XSRPWoyFBW687a5czTODslrz8t6gAEaERfwgVjQVFJ8C9pZ6PcT+4YhHB6o0FAy2TRa9 15LpmSO05s7/bkKLUlaDa9aPBrKTe5XSy4YInrOOqh3dMxYY5vYRBOZ5fdHdyAH8vOOi EpZIveIvb+C34HBLBku6XwQrISbNsvxKrRBtD/psuDxF5gAE5UxYL4ZSAM8xupDsF2q1 YIew== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:subject:to:references:cc:from:message-id:date :user-agent:mime-version:in-reply-to:content-type :content-transfer-encoding; bh=f6/bIpxTLca1235By2YkmiwxOZ2kQqQrtnVGeQV2CKs=; b=hcK8GG7van4bFK3fVR0YYof51Ie/7faQhHQbCVVvkFFor8Gnt1ppPf0IG9mxckWVLs idSyi/LlXNbiKIcnhOu+AgFk1NSphmJhyIdDppyDx5vLNzvq8q2vwk52PVZ8fnEq58Mn VHafVwXKc9f5hDBPVzsiCTApxsDwV88hHTaDFTqw27bEMP8+nbvxJoP4HN/hLWmVarCF eDGJB8PelTSrFJr22/txJYJeUMJ6ALpvHeh2y1GU2LTxXWiO/IqFAAGSDaVHD9bw3T9g SXT0nwShABCgqWTZLANkeLDFlGAZ1mQfpu7UlHKhBgXnoNY/SMFtnX8QZWXErnspiAo9 LiVQ== X-Gm-Message-State: AG10YORezhedJ7WSmqdbZQ+gi1N2N3bZEEb19VFM6+ZhFmz7lOWZ+ZSqZcy9kjoJiUeXag== X-Received: by 10.28.150.69 with SMTP id y66mr11272211wmd.35.1455531917366; Mon, 15 Feb 2016 02:25:17 -0800 (PST) Received: from [192.168.235.37] (mail.jambit.com. [95.157.63.22]) by smtp.gmail.com with ESMTPSA id i5sm24524520wja.23.2016.02.15.02.25.13 (version=TLSv1/SSLv3 cipher=OTHER); Mon, 15 Feb 2016 02:25:16 -0800 (PST) Subject: Re: richacl(7) man page review comments To: Andreas Gruenbacher X-ASG-Orig-Subj: Re: richacl(7) man page review comments References: <56B770B6.7040803@gmail.com> <56B77262.7090107@gmail.com> <56C0F150.60008@gmail.com> Cc: mtk.manpages@gmail.com, "J. Bruce Fields" , linux-ext4 , XFS Developers , lkml , linux-fsdevel , Linux NFS Mailing List , linux-cifs@vger.kernel.org, Linux API , Dave Chinner , Christoph Hellwig , Anna Schumaker , Trond Myklebust , Jeff Layton , Andreas Dilger From: "Michael Kerrisk (man-pages)" X-Enigmail-Draft-Status: N1110 Message-ID: <56C1A788.9020008@gmail.com> Date: Mon, 15 Feb 2016 11:25:12 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.5.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-Barracuda-Connect: mail-wm0-f45.google.com[74.125.82.45] X-Barracuda-Start-Time: 1455531918 X-Barracuda-Encrypted: ECDHE-RSA-AES128-GCM-SHA256 X-Barracuda-URL: https://192.48.157.11:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-BRTS-Status: 1 X-Barracuda-Spam-Score: 0.00 X-Barracuda-Spam-Status: No, SCORE=0.00 using per-user scores of TAG_LEVEL=1000.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.7 tests=BSF_SC0_MISMATCH_TO, DKIM_SIGNED, DKIM_VERIFIED X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.3.27046 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 0.00 BSF_SC0_MISMATCH_TO Envelope rcpt doesn't match header -0.00 DKIM_VERIFIED Domain Keys Identified Mail: signature passes verification 0.00 DKIM_SIGNED Domain Keys Identified Mail: message has a signature Hi Andreas, On 02/15/2016 12:12 AM, Andreas Gruenbacher wrote: > On Sun, Feb 14, 2016 at 10:27 PM, Michael Kerrisk (man-pages) > wrote: >> On 02/12/2016 11:25 PM, Andreas Gruenbacher wrote: >>> We could sure move acl(5) and richacl(7) there. >> >> We already have acl(5) (now "acl(7)" in man pages) ;-). > > Hmm, I can't find that page either in > git://git.kernel.org/pub/scm/docs/man-pages/man-pages or on > http://man7.org/. Are you sure you don't mean xattr.7 == attr.5 which > documents the xattr syscall interface? You're right. I was confusing with xattr(7). So, I think it might make some sense to eventually move both of these into man-pages (for richacl(7), at least, it's probably worth delaying this for a bit), since they're describing kernel-user-space interfaces. I can see counter-arguments too, such as these pages are closely related to the corresponding user-space libraries you maintain. What do you think? Thanks, Michael -- Michael Kerrisk Linux man-pages maintainer; http://www.kernel.org/doc/man-pages/ Linux/UNIX System Programming Training: http://man7.org/training/ From agruenba@redhat.com Mon Feb 15 05:35:23 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=ham version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay3.corp.sgi.com [198.149.34.15]) by oss.sgi.com (Postfix) with ESMTP id CE78F7CA2 for ; Mon, 15 Feb 2016 05:35:22 -0600 (CST) Received: from cuda.sgi.com (cuda3.sgi.com [192.48.176.15]) by relay3.corp.sgi.com (Postfix) with ESMTP id 4F58AAC004 for ; Mon, 15 Feb 2016 03:35:19 -0800 (PST) X-ASG-Debug-ID: 1455536115-04cb6c1e59da6f0001-NocioJ Received: from mail-vk0-f47.google.com (mail-vk0-f47.google.com [209.85.213.47]) by cuda.sgi.com with ESMTP id 6pCnGH5CkTJ92BW9 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128 verify=NO) for ; Mon, 15 Feb 2016 03:35:15 -0800 (PST) X-Barracuda-Envelope-From: agruenba@redhat.com X-Barracuda-Apparent-Source-IP: 209.85.213.47 Received: by mail-vk0-f47.google.com with SMTP id e185so104996753vkb.1 for ; Mon, 15 Feb 2016 03:35:15 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:date :message-id:subject:from:to:cc:content-type; bh=HzmZmGaL80/CwzXMp2x5Zj0OgQgMXiTEaogIsY21sgk=; b=bjC+HBOMoWZ47zIcgwpSd5kuE+QnPRiOtQ8fSCptiG/Vz869OZZ6Ptw7oSVvuYnLvU j9UMNbab3AxtHkUaH7RU46C8LAiFlQLOUfZXUwBVFzBMlFpbTA/7UBX7glUTAhk4JTR8 f6KguDvbC/uaRFONwMzSqIbPYqPoSH8buXpNCksDz1MXUkEG8WwS1ZGaGXjZ8XqkpqCG QXPlUfEmKIzamTy2Pjdap27uS5lGgVxwCcel/nZgFcdEhP2mmORj2/Ht8/tm7UzmlNa6 6PDI7Ii22OnYWQo07HJSjTXYOsqjt4g3eo6QW2MHlvFU0vSOtmOm3LdjTmmlIA4TB3kU hOnA== X-Gm-Message-State: AG10YOTrnAC6dx7l1DbY/t9fYkIa+OzLHbQdRLNWTFSftCiNR6AP+VJoBDCCE7D4Mhf9quvdFeakmlFhI6K22xW4 MIME-Version: 1.0 X-Received: by 10.31.151.75 with SMTP id z72mr11853622vkd.104.1455536115041; Mon, 15 Feb 2016 03:35:15 -0800 (PST) Received: by 10.176.64.130 with HTTP; Mon, 15 Feb 2016 03:35:14 -0800 (PST) In-Reply-To: <56C1A788.9020008@gmail.com> References: <56B770B6.7040803@gmail.com> <56B77262.7090107@gmail.com> <56C0F150.60008@gmail.com> <56C1A788.9020008@gmail.com> Date: Mon, 15 Feb 2016 12:35:14 +0100 Message-ID: Subject: Re: richacl(7) man page review comments From: Andreas Gruenbacher X-ASG-Orig-Subj: Re: richacl(7) man page review comments To: "Michael Kerrisk (man-pages)" Cc: "J. Bruce Fields" , linux-ext4 , XFS Developers , lkml , linux-fsdevel , Linux NFS Mailing List , linux-cifs@vger.kernel.org, Linux API , Dave Chinner , Christoph Hellwig , Anna Schumaker , Trond Myklebust , Jeff Layton , Andreas Dilger Content-Type: text/plain; charset=UTF-8 X-Barracuda-Connect: mail-vk0-f47.google.com[209.85.213.47] X-Barracuda-Start-Time: 1455536115 X-Barracuda-Encrypted: ECDHE-RSA-AES128-GCM-SHA256 X-Barracuda-URL: https://192.48.176.15:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-BRTS-Status: 1 X-Barracuda-Spam-Score: 0.00 X-Barracuda-Spam-Status: No, SCORE=0.00 using per-user scores of TAG_LEVEL=1000.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.7 tests=BSF_SC0_MISMATCH_TO X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.3.27047 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 0.00 BSF_SC0_MISMATCH_TO Envelope rcpt doesn't match header On Mon, Feb 15, 2016 at 11:25 AM, Michael Kerrisk (man-pages) wrote: > You're right. I was confusing with xattr(7). So, I think it might > make some sense to eventually move both of these into man-pages (for > richacl(7), at least, it's probably worth delaying this for a bit), > since they're describing kernel-user-space interfaces. Well, the actual user-space interface is xattrs in both cases. > I can see counter-arguments too, such as these pages are closely > related to the corresponding user-space libraries you maintain. > What do you think? I would keep the man-pages where they are right now, but I don't have a strong preference. Andreas From j.rosenboom@x-ion.de Mon Feb 15 05:58:00 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=T_DKIM_INVALID autolearn=ham version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay2.corp.sgi.com [137.38.102.29]) by oss.sgi.com (Postfix) with ESMTP id 246BC7CA2 for ; Mon, 15 Feb 2016 05:58:00 -0600 (CST) Received: from cuda.sgi.com (cuda1.sgi.com [192.48.157.11]) by relay2.corp.sgi.com (Postfix) with ESMTP id DE913304039 for ; Mon, 15 Feb 2016 03:57:56 -0800 (PST) X-ASG-Debug-ID: 1455537471-04bdf066edd6e10001-NocioJ Received: from mail-lf0-f47.google.com (mail-lf0-f47.google.com [209.85.215.47]) by cuda.sgi.com with ESMTP id TcsluIMcKmkl6fcg (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128 verify=NO) for ; Mon, 15 Feb 2016 03:57:53 -0800 (PST) X-Barracuda-Envelope-From: j.rosenboom@x-ion.de X-Barracuda-Apparent-Source-IP: 209.85.215.47 Received: by mail-lf0-f47.google.com with SMTP id 78so87482799lfy.3 for ; Mon, 15 Feb 2016 03:57:53 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=x-ion-de.20150623.gappssmtp.com; s=20150623; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=Umu3cnZenZLXH0L2N5FZu75ecPHsUU/eUi7GZNHEToE=; b=LK1Xlor7xkPOl8kAVe88cwYv3apOanZnsRWcC/nylPUoQeAGk/m6RfLLtKxfDJN63w Qv9D9jSUKrDqem8spmFYL1f/2tWLVNFx8DNnhZ5lb/HjcITbMeBBElS94L5nMegmnwjU cz1mJTkIQkowUUTTk+qFKxuOW/3sUfTrVHR8DXMH44Mgk8Qnnih15y3tTIuDSxsikb0L NRjIzR89npOxbOiZrHvseP7Il/OnEm5+CEyB3JtABLylsPXYTGu80ZlkGcjs/NuMCniL lReGJN0rV5QFZ9xiqV+V3wZb2pYwSB409nhgxaXsZ6ybiOsl+sZbFNeBX/Gr/Bp2Nf6Q X2xw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:date :message-id:subject:from:to:cc:content-type; bh=Umu3cnZenZLXH0L2N5FZu75ecPHsUU/eUi7GZNHEToE=; b=IPBIgIIaABR2tvSd14HvERishF45ZLrceLcOOFwLzBWuAcaXu7k/GgJfXJisi0EfhB 64aQUEk+m4hQVToC1upj8VRqM+lB2sCxlFpV9X35DbX+SmNH3stQZpjJ4G0u1BHmuOdN airHDPeiIrkQwNKTlnjnRwnfqUtOQqhOTxyxRFMB1gzin33reg/Pkg8p3Swn9XwOG3yW i2FA4jHxAOw8al03OaaigIPZLmouDTTO14tVL4JkPrPPrK+M03oXdDMrXqUhf2pvEPnn 6lHav9mS64OH3OCkt02A8+EZZmwNHZwcsgRYOJNCXXoqiE6UuTiJwXvL60hNQp3nBFKq +Atg== X-Gm-Message-State: AG10YOSaMhX3OcAKWOjJMBGQYeWlOsq1cbSpmj5NulTtUrzWp4Vg1V26whCTOYtR80QyKMgEtA8B8cYTH8L7mw== MIME-Version: 1.0 X-Received: by 10.25.83.137 with SMTP id h131mr6779938lfb.0.1455537471350; Mon, 15 Feb 2016 03:57:51 -0800 (PST) Received: by 10.25.8.7 with HTTP; Mon, 15 Feb 2016 03:57:51 -0800 (PST) In-Reply-To: <20160214001645.GF14668@dastard> References: <1453177919-17849-1-git-send-email-david@fromorbit.com> <20160120015853.GU6033@dastard> <20160126141733.GA48264@bfoster.bfoster> <20160214001645.GF14668@dastard> Date: Mon, 15 Feb 2016 12:57:51 +0100 Message-ID: Subject: Re: [PATCH v2] [RFC] xfs: allocate log vector buffers outside CIL context lock From: Jens Rosenboom X-ASG-Orig-Subj: Re: [PATCH v2] [RFC] xfs: allocate log vector buffers outside CIL context lock To: Dave Chinner Cc: Brian Foster , xfs@oss.sgi.com Content-Type: text/plain; charset=UTF-8 X-Barracuda-Connect: mail-lf0-f47.google.com[209.85.215.47] X-Barracuda-Start-Time: 1455537472 X-Barracuda-Encrypted: ECDHE-RSA-AES128-GCM-SHA256 X-Barracuda-URL: https://192.48.157.11:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-BRTS-Status: 1 X-Barracuda-Spam-Score: 0.00 X-Barracuda-Spam-Status: No, SCORE=0.00 using per-user scores of TAG_LEVEL=1000.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.7 tests=BSF_SC0_MISMATCH_TO, DKIM_SIGNED, DKIM_VERIFIED X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.3.27048 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 0.00 BSF_SC0_MISMATCH_TO Envelope rcpt doesn't match header -0.00 DKIM_VERIFIED Domain Keys Identified Mail: signature passes verification 0.00 DKIM_SIGNED Domain Keys Identified Mail: message has a signature 2016-02-14 1:16 GMT+01:00 Dave Chinner : > On Sat, Feb 13, 2016 at 06:09:17PM +0100, Jens Rosenboom wrote: >> 2016-01-26 15:17 GMT+01:00 Brian Foster : >> > On Wed, Jan 20, 2016 at 12:58:53PM +1100, Dave Chinner wrote: >> >> From: Dave Chinner >> >> >> >> One of the problems we currently have with delayed logging is that >> >> under serious memory pressure we can deadlock memory reclaim. THis >> >> occurs when memory reclaim (such as run by kswapd) is reclaiming XFS >> >> inodes and issues a log force to unpin inodes that are dirty in the >> >> CIL. > .... >> >> That said, I don't have a reliable deadlock reproducer in the first >> >> place, so I'm interested i hearing what people think about this >> >> approach to solve the problem and ways to test and improve it. >> >> >> >> Signed-off-by: Dave Chinner >> >> --- >> > >> > This seems reasonable to me in principle. It would be nice to have some >> > kind of feedback in terms of effectiveness resolving the original >> > deadlock report. I can't think of a good way of testing short of >> > actually instrumenting the deadlock one way or another, unfortunately. >> > Was there a user that might be willing to test or had a detailed enough >> > description of the workload/environment? >> >> We have seen this issue on our production Ceph cluster sporadically >> and have tried a long time to reproduce it in a lab environment. > .... >> kmem_alloc (mode:0x2408240) >> Feb 13 10:51:57 storage-node35 kernel: [10562.614089] XFS: >> ceph-osd(10078) possible memory allocation deadlock size 32856 in >> kmem_alloc (mode:0x2408240) > > High order allocation of 32k. That implies a buffer size of at least > 32k is in use. Can you tell me what the output of xfs_info > is for one of your filesystems? $ xfs_info /tmp/cbt/mnt/osd-device-0-data/ meta-data=/dev/sda2 isize=2048 agcount=4, agsize=97370688 blks = sectsz=512 attr=2, projid32bit=1 = crc=0 finobt=0 data = bsize=4096 blocks=389482752, imaxpct=5 = sunit=0 swidth=0 blks naming =version 2 bsize=65536 ascii-ci=0 ftype=0 log =internal bsize=4096 blocks=190177, version=2 = sectsz=512 sunit=0 blks, lazy-count=1 realtime =none extsz=4096 blocks=0, rtextents=0 > I suspect you are using a 64k directory block size, in which case > I'll ask "are you storing millions of files in a single directory"? > If your answer is no, then "don't do that" is an appropriate > solution because large directory block sizes are slower than the > default (4k) for almost all operations until you get up into the > millions of files per directory range. These options are kind of standard folklore for setting up Ceph clusters, I must admit that I delayed testing their performance implications up to now, so many knobs to turn, so little time. mkfs_opts: '-f -i size=2048 -n size=64k' mount_opts: '-o inode64,noatime,logbsize=256k' It turns out that when running with '-n size=4k', indeed I do not get any warnings during a 10h test run. I'll try to come up with some more detailed benchmarking of the possible performance impacts, too. Am I right in assuming that this parameter can not be tuned after the initial mkfs? In that case getting a production-ready version of your patch would probably still be valuable for cluster admins wanting to avoid having to move all of their data to new filesystems. >> Soon after this, operations get so slow that the OSDs die because of >> their suicide timeouts. >> >> Then I installed onto 3 servers this patch (applied onto kernel >> v4.4.1). The bad news is that I am still getting the kernel messages >> on these machines. The good news, though, is that they appear at a >> much lower frequency and also the impact on performance seems to be >> lower, so the OSD processes on these three nodes did not get killed. > > Right, the patch doesn't fix the underlying issue that memory > fragmentation can prevent high order allocation from succeeding for > long periods. However, it does ensure that the filesystem does not > immediately deadlock memory reclaim when it happens so the system > has a chance to recover. It still can deadlock the filesystem, > because if we can't commit the transaction we can't unlock the > objects in the transaction and everything can get stuck behind that > if there's something sufficiently important in the blocked > transaction. So how would your success criteria for getting this patch into upstream look like? Would a benchmark of the 64k directory block size case on machines all running with patched kernels be interesting? Or would that scenario disqualify itself as being mistuned in the first place? From david@fromorbit.com Mon Feb 15 07:28:59 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=ham version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay1.corp.sgi.com [137.38.102.111]) by oss.sgi.com (Postfix) with ESMTP id 2E3F77CA2 for ; Mon, 15 Feb 2016 07:28:59 -0600 (CST) Received: from cuda.sgi.com (cuda3.sgi.com [192.48.176.15]) by relay1.corp.sgi.com (Postfix) with ESMTP id 1D58E8F8035 for ; Mon, 15 Feb 2016 05:28:55 -0800 (PST) X-ASG-Debug-ID: 1455542932-04cb6c1e57dd3c0001-NocioJ Received: from ipmail07.adl2.internode.on.net (ipmail07.adl2.internode.on.net [150.101.137.131]) by cuda.sgi.com with ESMTP id JBhMWWZDCPeWZ20z for ; Mon, 15 Feb 2016 05:28:52 -0800 (PST) X-Barracuda-Envelope-From: david@fromorbit.com X-Barracuda-Apparent-Source-IP: 150.101.137.131 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: A2CdCAAo0sFW/5bY03ZegzqBP4Joo2UBAQEBAQEGi2yFRYQIhgcCAgEBAoEtTQEBAQEBAYELhEEBAQEDATocIwULCAMOCgklDwUlAyETGgGHdwe8RQEBAQcCAR0YhTGEfYQchFAFlnmIPIUQgWWEQ4MmhS+DQ4p7YoICGYFcKC6HQIE4AQEB Received: from ppp118-211-216-150.lns20.syd4.internode.on.net (HELO dastard) ([118.211.216.150]) by ipmail07.adl2.internode.on.net with ESMTP; 15 Feb 2016 23:58:38 +1030 Received: from dave by dastard with local (Exim 4.80) (envelope-from ) id 1aVJCS-0001EB-VF; Tue, 16 Feb 2016 00:28:25 +1100 Date: Tue, 16 Feb 2016 00:28:24 +1100 From: Dave Chinner To: Jens Rosenboom Cc: Brian Foster , xfs@oss.sgi.com Subject: Re: [PATCH v2] [RFC] xfs: allocate log vector buffers outside CIL context lock Message-ID: <20160215132824.GH14668@dastard> X-ASG-Orig-Subj: Re: [PATCH v2] [RFC] xfs: allocate log vector buffers outside CIL context lock References: <1453177919-17849-1-git-send-email-david@fromorbit.com> <20160120015853.GU6033@dastard> <20160126141733.GA48264@bfoster.bfoster> <20160214001645.GF14668@dastard> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.21 (2010-09-15) X-Barracuda-Connect: ipmail07.adl2.internode.on.net[150.101.137.131] X-Barracuda-Start-Time: 1455542932 X-Barracuda-URL: https://192.48.176.15:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-BRTS-Status: 1 X-Barracuda-Spam-Score: 0.00 X-Barracuda-Spam-Status: No, SCORE=0.00 using per-user scores of TAG_LEVEL=1000.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.7 tests=BSF_SC0_MISMATCH_TO X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.3.27049 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 0.00 BSF_SC0_MISMATCH_TO Envelope rcpt doesn't match header On Mon, Feb 15, 2016 at 12:57:51PM +0100, Jens Rosenboom wrote: > 2016-02-14 1:16 GMT+01:00 Dave Chinner : > > On Sat, Feb 13, 2016 at 06:09:17PM +0100, Jens Rosenboom wrote: > >> 2016-01-26 15:17 GMT+01:00 Brian Foster : > >> > On Wed, Jan 20, 2016 at 12:58:53PM +1100, Dave Chinner wrote: > >> We have seen this issue on our production Ceph cluster sporadically > >> and have tried a long time to reproduce it in a lab environment. > > .... > >> kmem_alloc (mode:0x2408240) > >> Feb 13 10:51:57 storage-node35 kernel: [10562.614089] XFS: > >> ceph-osd(10078) possible memory allocation deadlock size 32856 in > >> kmem_alloc (mode:0x2408240) > > > > High order allocation of 32k. That implies a buffer size of at least > > 32k is in use. Can you tell me what the output of xfs_info > > is for one of your filesystems? > > $ xfs_info /tmp/cbt/mnt/osd-device-0-data/ > meta-data=/dev/sda2 isize=2048 agcount=4, agsize=97370688 blks > = sectsz=512 attr=2, projid32bit=1 > = crc=0 finobt=0 > data = bsize=4096 blocks=389482752, imaxpct=5 > = sunit=0 swidth=0 blks > naming =version 2 bsize=65536 ascii-ci=0 ftype=0 > log =internal bsize=4096 blocks=190177, version=2 > = sectsz=512 sunit=0 blks, lazy-count=1 > realtime =none extsz=4096 blocks=0, rtextents=0 OK, so 64k directory block size. > > I suspect you are using a 64k directory block size, in which case > > I'll ask "are you storing millions of files in a single directory"? > > If your answer is no, then "don't do that" is an appropriate > > solution because large directory block sizes are slower than the > > default (4k) for almost all operations until you get up into the > > millions of files per directory range. > > These options are kind of standard folklore for setting up Ceph > clusters, I must admit that I delayed testing their performance > implications up to now, so many knobs to turn, so little time. > > mkfs_opts: '-f -i size=2048 -n size=64k' > mount_opts: '-o inode64,noatime,logbsize=256k' /me shakes his head sadly. Can you please go nuke where ever you read that from orbit? Please? It's the only way to be sure that the contagious cargo-cult stupidity doesn't spread further. > It turns out that when running with '-n size=4k' i.e. the default. > , indeed I do not get > any warnings during a 10h test run. I'll try to come up with some more > detailed benchmarking of the possible performance impacts, too. No surprise there. :/ FWIW, for small file Ceph workloads (e.g swift stores) we've found that 8k directory block sizes give marginal improvements over the default 4k, but it's all down hill from there. > Am I right in assuming that this parameter can not be tuned after the > initial mkfs? That's right. > In that case getting a production-ready version of your > patch would probably still be valuable for cluster admins wanting to > avoid having to move all of their data to new filesystems. Well, yes, that's why I'm working on it. But it's critical core code, it's also damn tricky and complex, and if I get it wrong it will corrupt filesystems. So I'm not going to rush a prototype fix out into production systems no matter how much pressure people put on me to ship a fix. > >> Soon after this, operations get so slow that the OSDs die because of > >> their suicide timeouts. > >> > >> Then I installed onto 3 servers this patch (applied onto kernel > >> v4.4.1). The bad news is that I am still getting the kernel messages > >> on these machines. The good news, though, is that they appear at a > >> much lower frequency and also the impact on performance seems to be > >> lower, so the OSD processes on these three nodes did not get killed. > > > > Right, the patch doesn't fix the underlying issue that memory > > fragmentation can prevent high order allocation from succeeding for > > long periods. However, it does ensure that the filesystem does not > > immediately deadlock memory reclaim when it happens so the system > > has a chance to recover. It still can deadlock the filesystem, > > because if we can't commit the transaction we can't unlock the > > objects in the transaction and everything can get stuck behind that > > if there's something sufficiently important in the blocked > > transaction. > > So how would your success criteria for getting this patch into > upstream look like? It's already "successful". I've proved locally that it avoids a memory reclaim deadlock that many people have reported over the past year. So there's no question that we need a fix to the problem; it's now just a matter of determining if the issues with this fix (e.g. doubling memory usage of the CIL) are an acceptible tradeoff for production workloads, or whether I've got to go back and prototype a fourth attempt at fixing the problem... And, of course, there's only some many hours int eh day. I'm into my 19th right now, and I havent' got through everything on my list for today yet. Tomorrow's list is even longer, and when I get through that, I hit the big one: "read, understand and review 10000 lines of complex new code".... > Would a benchmark of the 64k directory block size > case on machines all running with patched kernels be interesting? Or > would that scenario disqualify itself as being mistuned in the first > place? Not really - I've confirmed it doesn't cause performance issues on my usual tranche of benhmarks, so I'mnot conerned about that (it;s the same amount of work being done, anyway). Correctness is much more important right now, and that takes time, effort and focus to verify. And speaking of focus, it's now time for me to sleep. Cheers, Dave. -- Dave Chinner david@fromorbit.com From mtk.manpages@gmail.com Mon Feb 15 08:15:54 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=FREEMAIL_FROM,T_DKIM_INVALID autolearn=ham version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay3.corp.sgi.com [198.149.34.15]) by oss.sgi.com (Postfix) with ESMTP id 4FD237CA2 for ; Mon, 15 Feb 2016 08:15:54 -0600 (CST) Received: from cuda.sgi.com (cuda1.sgi.com [192.48.157.11]) by relay3.corp.sgi.com (Postfix) with ESMTP id E32B4AC005 for ; Mon, 15 Feb 2016 06:15:50 -0800 (PST) X-ASG-Debug-ID: 1455545747-04bdf066edda630001-NocioJ Received: from mail-wm0-f42.google.com (mail-wm0-f42.google.com [74.125.82.42]) by cuda.sgi.com with ESMTP id aigYlC9AVR10aEs4 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128 verify=NO) for ; Mon, 15 Feb 2016 06:15:48 -0800 (PST) X-Barracuda-Envelope-From: mtk.manpages@gmail.com X-Barracuda-Apparent-Source-IP: 74.125.82.42 Received: by mail-wm0-f42.google.com with SMTP id g62so150899163wme.0 for ; Mon, 15 Feb 2016 06:15:48 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:reply-to:in-reply-to:references:from:date:message-id :subject:to:cc:content-type; bh=4RX7KkInS8K5sdS6epfFfo88lV607RCQ/sSGUn5LXPU=; b=kxyguFcZLuRmmtTQaAEwEmtl69yOmoe0R+nPDhmM31kQrrlbhdkt7efZi+AYH5h8IV 0l8ljiBBchQ2Wh2HZuEL3ya0tX57qROzVL13WPrGSsV680VrL/BWbUC/kNxR7sbZq522 QAI+K1EUpDWPAyHaxLzu66akH4qUeBIMskOOzIuTcvR9AlsWiYE2HczPz54I0nIFT37u N1Y9j4kRlD3/pKWdDZ+yZEczSQ7OLGtn/WUGYawq6cNE6B4pDXEsUuHb7oDA2+RLBxiO 2E/FUpzK2q8SZNUuACXg++WtHPbt3rFXMFsLwUb5Ty9m1gvVnMN8TfEkHWbF3BAMlTf8 FSqA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:reply-to:in-reply-to:references :from:date:message-id:subject:to:cc:content-type; bh=4RX7KkInS8K5sdS6epfFfo88lV607RCQ/sSGUn5LXPU=; b=ak426Uzd8Avq2xFXEPEd+QlkV9U9FXEdMkxkn7+X2k9eBJtJYJxAOPsKEHeQlqrl/M MHh4ZKqp8nK7RzCPDRB0TlG+toKxnNgCEtRR5Udjp6RHtrNs5BfpGZb1gRq5vKQ9LN6d HPIH5+tndckWWmQNjdJFgH/k4eM1kWLiPWlvWFEnP4akma0g1wVJjH9Q/OzSC2k5PzCj a4wZKo5bpqKh/uqG2vGKQmiFeGh796/gQUAjeCUe6mSz0eTmlISzc2v1UkJJyLLLDJ8q vSv3hI4rED2OPIJcxDHzXXmBsS7Ti94097c5yBaERLOXm1O2aTxxmHU+Gc3TA8A9vvv7 1CGQ== X-Gm-Message-State: AG10YOR67sXt2QVQvrJ11bdSfgUyUcTp5QlOrK38767K9P8XCrVlrV3kx2aarv06cQj6eyWC4PjxwOtgzF3VRQ== X-Received: by 10.194.92.174 with SMTP id cn14mr19266629wjb.66.1455545747020; Mon, 15 Feb 2016 06:15:47 -0800 (PST) MIME-Version: 1.0 Received: by 10.28.195.10 with HTTP; Mon, 15 Feb 2016 06:15:27 -0800 (PST) Reply-To: mtk.manpages@gmail.com In-Reply-To: References: <56B770B6.7040803@gmail.com> <56B77262.7090107@gmail.com> <56C0F150.60008@gmail.com> <56C1A788.9020008@gmail.com> From: "Michael Kerrisk (man-pages)" Date: Mon, 15 Feb 2016 15:15:27 +0100 Message-ID: Subject: Re: richacl(7) man page review comments To: Andreas Gruenbacher X-ASG-Orig-Subj: Re: richacl(7) man page review comments Cc: "J. Bruce Fields" , linux-ext4 , XFS Developers , lkml , linux-fsdevel , Linux NFS Mailing List , linux-cifs@vger.kernel.org, Linux API , Dave Chinner , Christoph Hellwig , Anna Schumaker , Trond Myklebust , Jeff Layton , Andreas Dilger Content-Type: text/plain; charset=UTF-8 X-Barracuda-Connect: mail-wm0-f42.google.com[74.125.82.42] X-Barracuda-Start-Time: 1455545748 X-Barracuda-Encrypted: ECDHE-RSA-AES128-GCM-SHA256 X-Barracuda-URL: https://192.48.157.11:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-BRTS-Status: 1 X-Barracuda-Spam-Score: 0.00 X-Barracuda-Spam-Status: No, SCORE=0.00 using per-user scores of TAG_LEVEL=1000.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.7 tests=BSF_SC0_MISMATCH_TO, DKIM_SIGNED, DKIM_VERIFIED X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.3.27050 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 0.00 BSF_SC0_MISMATCH_TO Envelope rcpt doesn't match header -0.00 DKIM_VERIFIED Domain Keys Identified Mail: signature passes verification 0.00 DKIM_SIGNED Domain Keys Identified Mail: message has a signature On 15 February 2016 at 12:35, Andreas Gruenbacher wrote: > On Mon, Feb 15, 2016 at 11:25 AM, Michael Kerrisk (man-pages) > wrote: >> You're right. I was confusing with xattr(7). So, I think it might >> make some sense to eventually move both of these into man-pages (for >> richacl(7), at least, it's probably worth delaying this for a bit), >> since they're describing kernel-user-space interfaces. > > Well, the actual user-space interface is xattrs in both cases. Yes, xattrs are the base of the framework, but I was using "interface" in a very broad way: ACLs and RichACLs are exposing kernel-defined policies and rules about file permissions to user space (much as say chmod(2) and the file mode bits). That's why it seems to make some sense to place those pages with the other pages that describe kernel-user-spaces interfaces. Plus, they'd now and then get some man-pages love :-). >> I can see counter-arguments too, such as these pages are closely >> related to the corresponding user-space libraries you maintain. >> What do you think? > > I would keep the man-pages where they are right now, but I don't have > a strong preference. I'd be happy to see acl(5) and eventually richacl(7) in man pages, but it's your call in the end, of course. Cheers, Michael -- Michael Kerrisk Linux man-pages maintainer; http://www.kernel.org/doc/man-pages/ Linux/UNIX System Programming Training: http://man7.org/training/ From sandeen@sandeen.net Mon Feb 15 09:33:00 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=ham version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay1.corp.sgi.com [137.38.102.111]) by oss.sgi.com (Postfix) with ESMTP id 67BE97CA2 for ; Mon, 15 Feb 2016 09:33:00 -0600 (CST) Received: from cuda.sgi.com (cuda3.sgi.com [192.48.176.15]) by relay1.corp.sgi.com (Postfix) with ESMTP id 4CE8C8F8039 for ; Mon, 15 Feb 2016 07:33:00 -0800 (PST) X-ASG-Debug-ID: 1455550376-04cb6c1e58dfaf0001-NocioJ Received: from sandeen.net (sandeen.net [63.231.237.45]) by cuda.sgi.com with ESMTP id nxSchPuuK45kL0f5 for ; Mon, 15 Feb 2016 07:32:56 -0800 (PST) X-Barracuda-Envelope-From: sandeen@sandeen.net X-Barracuda-Apparent-Source-IP: 63.231.237.45 Received: from liberator.sandeen.net (liberator.sandeen.net [10.0.0.4]) (using TLSv1.2 with cipher DHE-RSA-AES128-SHA (128/128 bits)) (No client certificate requested) by sandeen.net (Postfix) with ESMTPSA id D722263C5FF0; Mon, 15 Feb 2016 09:32:55 -0600 (CST) Subject: Re: [PATCH v2] xfs_quota: modify commands which can't handle multiple types To: xfs@oss.sgi.com X-ASG-Orig-Subj: Re: [PATCH v2] xfs_quota: modify commands which can't handle multiple types References: <1455376388-4712-1-git-send-email-zlang@redhat.com> From: Eric Sandeen X-Enigmail-Draft-Status: N1110 Cc: Zorro Lang Message-ID: <56C1EFA7.4090308@sandeen.net> Date: Mon, 15 Feb 2016 09:32:55 -0600 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.11; rv:38.0) Gecko/20100101 Thunderbird/38.5.1 MIME-Version: 1.0 In-Reply-To: <1455376388-4712-1-git-send-email-zlang@redhat.com> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 8bit X-Barracuda-Connect: sandeen.net[63.231.237.45] X-Barracuda-Start-Time: 1455550376 X-Barracuda-URL: https://192.48.176.15:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-BRTS-Status: 1 X-Barracuda-Spam-Score: 1.25 X-Barracuda-Spam-Status: No, SCORE=1.25 using per-user scores of TAG_LEVEL=1000.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.7 tests=BSF_RULE_7580G, BSF_SC0_MV0713 X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.3.27051 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 0.75 BSF_RULE_7580G Custom Rule 7580G 0.50 BSF_SC0_MV0713 Custom rule MV0713 On 2/13/16 9:13 AM, Zorro Lang wrote: > Some xfs_quota commands can't deal with multiple types together. > For example, if we run "limit -ug ...", one type will overwrite > the other. I find below commands can't handle multiple types: > > [quota, limit, timer, warn, dump, restore and quot] > > (Although timer and warn command can't support -ugp types until > now, it will in one day.) > > For every single $command, I change their ${command}_f function, > ${command}_cmd structure and man page. For what it's worth, +.BR "\-g | \-p | \-u" doesn't make a lot of sense, it tells it to alternate bold and regular, but you only have one term, the one in quotes, and so it is all bold. Bold pipes "|" are a little weird, and not consistent with the rest of the manpage. Sorry to nitpick, but: .BR \-g " | " \-p " | " \-u might be better; " | " preserves the spaces around the options like the rest of the manpage, and they are not bold, and this is consistent with the rest of the file as well. The rest of the patch looks good to me Thanks, -Eric > Signed-off-by: Zorro Lang > --- > man/man8/xfs_quota.8 | 14 ++++++------ > quota/edit.c | 60 ++++++++++++++++++++++++++++++++++------------------ > quota/quot.c | 15 ++++++++----- > quota/quota.c | 15 ++++++++----- > quota/report.c | 20 ++++++++++++------ > 5 files changed, 81 insertions(+), 43 deletions(-) > > diff --git a/man/man8/xfs_quota.8 b/man/man8/xfs_quota.8 > index 3bee145..70a2eb5 100644 > --- a/man/man8/xfs_quota.8 > +++ b/man/man8/xfs_quota.8 > @@ -169,7 +169,7 @@ command. > .HP > .B quota > [ > -.B \-gpu > +.BR "\-g | \-p | \-u" > ] [ > .B \-bir > ] [ > @@ -398,7 +398,7 @@ option reports state on all filesystems and not just the current path. > .B > limit > [ > -.B \-gpu > +.BR "\-g | \-p | \-u" > ] > .BI bsoft= N > | > @@ -430,7 +430,7 @@ must be specified. > .HP > .B timer > [ > -.B \-gpu > +.BR "\-g | \-p | \-u" > ] [ > .B \-bir > ] > @@ -446,7 +446,7 @@ command. The value argument is a number of seconds, but units of > .HP > .B warn > [ > -.B \-gpu > +.BR "\-g | \-p | \-u" > ] [ > .B \-bir > ] > @@ -497,7 +497,7 @@ report an error. > .B > dump > [ > -.B \-gpu > +.BR "\-g | \-p | \-u" > ] [ > .B \-f > .I file > @@ -510,7 +510,7 @@ This is only the limits, not the usage information, of course. > .HP > .B restore > [ > -.B \-gpu > +.BR "\-g | \-p | \-u" > ] [ > .B \-f > .I file > @@ -525,7 +525,7 @@ command. > .B > quot > [ > -.B \-gpu > +.BR "\-g | \-p | \-u" > ] [ > .B \-bir > ] [ > diff --git a/quota/edit.c b/quota/edit.c > index 6146f7e..e5ddc8c 100644 > --- a/quota/edit.c > +++ b/quota/edit.c > @@ -282,13 +282,13 @@ limit_f( > flags |= DEFAULTS_FLAG; > break; > case 'g': > - type = XFS_GROUP_QUOTA; > + type |= XFS_GROUP_QUOTA; > break; > case 'p': > - type = XFS_PROJ_QUOTA; > + type |= XFS_PROJ_QUOTA; > break; > case 'u': > - type = XFS_USER_QUOTA; > + type |= XFS_USER_QUOTA; > break; > default: > return command_usage(&limit_cmd); > @@ -343,8 +343,13 @@ limit_f( > > name = (flags & DEFAULTS_FLAG) ? "0" : argv[optind++]; > > - if (!type) > + if (!type) { > type = XFS_USER_QUOTA; > + } else if (type != XFS_GROUP_QUOTA && > + type != XFS_PROJ_QUOTA && > + type != XFS_USER_QUOTA) { > + return command_usage(&limit_cmd); > + } > > switch (type) { > case XFS_USER_QUOTA: > @@ -422,13 +427,13 @@ restore_f( > fname = optarg; > break; > case 'g': > - type = XFS_GROUP_QUOTA; > + type |= XFS_GROUP_QUOTA; > break; > case 'p': > - type = XFS_PROJ_QUOTA; > + type |= XFS_PROJ_QUOTA; > break; > case 'u': > - type = XFS_USER_QUOTA; > + type |= XFS_USER_QUOTA; > break; > default: > return command_usage(&restore_cmd); > @@ -438,8 +443,13 @@ restore_f( > if (argc < optind) > return command_usage(&restore_cmd); > > - if (!type) > + if (!type) { > type = XFS_USER_QUOTA; > + } else if (type != XFS_GROUP_QUOTA && > + type != XFS_PROJ_QUOTA && > + type != XFS_USER_QUOTA) { > + return command_usage(&restore_cmd); > + } > > if (fname) { > if ((fp = fopen(fname, "r")) == NULL) { > @@ -501,13 +511,13 @@ timer_f( > mask |= FS_DQ_RTBTIMER; > break; > case 'g': > - type = XFS_GROUP_QUOTA; > + type |= XFS_GROUP_QUOTA; > break; > case 'p': > - type = XFS_PROJ_QUOTA; > + type |= XFS_PROJ_QUOTA; > break; > case 'u': > - type = XFS_USER_QUOTA; > + type |= XFS_USER_QUOTA; > break; > default: > return command_usage(&timer_cmd); > @@ -522,8 +532,13 @@ timer_f( > if (!mask) > mask = FS_DQ_TIMER_MASK; > > - if (!type) > + if (!type) { > type = XFS_USER_QUOTA; > + } else if (type != XFS_GROUP_QUOTA && > + type != XFS_PROJ_QUOTA && > + type != XFS_USER_QUOTA) { > + return command_usage(&timer_cmd); > + } > > set_timer(type, mask, fs_path->fs_name, value); > return 0; > @@ -630,13 +645,13 @@ warn_f( > mask |= FS_DQ_RTBWARNS; > break; > case 'g': > - type = XFS_GROUP_QUOTA; > + type |= XFS_GROUP_QUOTA; > break; > case 'p': > - type = XFS_PROJ_QUOTA; > + type |= XFS_PROJ_QUOTA; > break; > case 'u': > - type = XFS_USER_QUOTA; > + type |= XFS_USER_QUOTA; > break; > default: > return command_usage(&warn_cmd); > @@ -661,8 +676,13 @@ warn_f( > if (!mask) > mask = FS_DQ_WARNS_MASK; > > - if (!type) > + if (!type) { > type = XFS_USER_QUOTA; > + } else if (type != XFS_GROUP_QUOTA && > + type != XFS_PROJ_QUOTA && > + type != XFS_USER_QUOTA) { > + return command_usage(&warn_cmd); > + } > > switch (type) { > case XFS_USER_QUOTA: > @@ -686,7 +706,7 @@ edit_init(void) > limit_cmd.argmin = 2; > limit_cmd.argmax = -1; > limit_cmd.args = \ > - _("[-gpu] bsoft|bhard|isoft|ihard|rtbsoft|rtbhard=N -d|id|name"); > + _("[-g|-p|-u] bsoft|bhard|isoft|ihard|rtbsoft|rtbhard=N -d|id|name"); > limit_cmd.oneline = _("modify quota limits"); > limit_cmd.help = limit_help; > > @@ -694,14 +714,14 @@ edit_init(void) > restore_cmd.cfunc = restore_f; > restore_cmd.argmin = 0; > restore_cmd.argmax = -1; > - restore_cmd.args = _("[-gpu] [-f file]"); > + restore_cmd.args = _("[-g|-p|-u] [-f file]"); > restore_cmd.oneline = _("restore quota limits from a backup file"); > > timer_cmd.name = "timer"; > timer_cmd.cfunc = timer_f; > timer_cmd.argmin = 2; > timer_cmd.argmax = -1; > - timer_cmd.args = _("[-bir] [-gpu] value"); > + timer_cmd.args = _("[-bir] [-g|-p|-u] value"); > timer_cmd.oneline = _("set quota enforcement timeouts"); > timer_cmd.help = timer_help; > > @@ -709,7 +729,7 @@ edit_init(void) > warn_cmd.cfunc = warn_f; > warn_cmd.argmin = 2; > warn_cmd.argmax = -1; > - warn_cmd.args = _("[-bir] [-gpu] value -d|id|name"); > + warn_cmd.args = _("[-bir] [-g|-p|-u] value -d|id|name"); > warn_cmd.oneline = _("get/set enforcement warning counter"); > warn_cmd.help = warn_help; > > diff --git a/quota/quot.c b/quota/quot.c > index 9116e48..2e583e5 100644 > --- a/quota/quot.c > +++ b/quota/quot.c > @@ -361,13 +361,13 @@ quot_f( > form |= XFS_RTBLOCK_QUOTA; > break; > case 'g': > - type = XFS_GROUP_QUOTA; > + type |= XFS_GROUP_QUOTA; > break; > case 'p': > - type = XFS_PROJ_QUOTA; > + type |= XFS_PROJ_QUOTA; > break; > case 'u': > - type = XFS_USER_QUOTA; > + type |= XFS_USER_QUOTA; > break; > case 'a': > flags |= ALL_MOUNTS_FLAG; > @@ -389,8 +389,13 @@ quot_f( > if (!form) > form = XFS_BLOCK_QUOTA; > > - if (!type) > + if (!type) { > type = XFS_USER_QUOTA; > + } else if (type != XFS_GROUP_QUOTA && > + type != XFS_PROJ_QUOTA && > + type != XFS_USER_QUOTA) { > + return command_usage("_cmd); > + } > > if ((fp = fopen_write_secure(fname)) == NULL) > return 0; > @@ -416,7 +421,7 @@ quot_init(void) > quot_cmd.cfunc = quot_f; > quot_cmd.argmin = 0; > quot_cmd.argmax = -1; > - quot_cmd.args = _("[-bir] [-gpu] [-acv] [-f file]"); > + quot_cmd.args = _("[-bir] [-g|-p|-u] [-acv] [-f file]"); > quot_cmd.oneline = _("summarize filesystem ownership"); > quot_cmd.help = quot_help; > > diff --git a/quota/quota.c b/quota/quota.c > index f6b24c3..e0da7c0 100644 > --- a/quota/quota.c > +++ b/quota/quota.c > @@ -409,13 +409,13 @@ quota_f( > form |= XFS_RTBLOCK_QUOTA; > break; > case 'g': > - type = XFS_GROUP_QUOTA; > + type |= XFS_GROUP_QUOTA; > break; > case 'p': > - type = XFS_PROJ_QUOTA; > + type |= XFS_PROJ_QUOTA; > break; > case 'u': > - type = XFS_USER_QUOTA; > + type |= XFS_USER_QUOTA; > break; > case 'h': > flags |= HUMAN_FLAG; > @@ -437,8 +437,13 @@ quota_f( > if (!form) > form = XFS_BLOCK_QUOTA; > > - if (!type) > + if (!type) { > type = XFS_USER_QUOTA; > + } else if (type != XFS_GROUP_QUOTA && > + type != XFS_PROJ_QUOTA && > + type != XFS_USER_QUOTA) { > + return command_usage("a_cmd); > + } > > if ((fp = fopen_write_secure(fname)) == NULL) > return 0; > @@ -461,7 +466,7 @@ quota_init(void) > quota_cmd.cfunc = quota_f; > quota_cmd.argmin = 0; > quota_cmd.argmax = -1; > - quota_cmd.args = _("[-bir] [-gpu] [-hnNv] [-f file] [id|name]..."); > + quota_cmd.args = _("[-bir] [-g|-p|-u] [-hnNv] [-f file] [id|name]..."); > quota_cmd.oneline = _("show usage and limits"); > quota_cmd.help = quota_help; > > diff --git a/quota/report.c b/quota/report.c > index 8653134..48a3f29 100644 > --- a/quota/report.c > +++ b/quota/report.c > @@ -30,7 +30,7 @@ static cmdinfo_t report_cmd; > static void > dump_help(void) > { > - dump_cmd.args = _("[-gpu] [-f file]"); > + dump_cmd.args = _("[-g|-p|-u] [-f file]"); > dump_cmd.oneline = _("dump quota information for backup utilities"); > printf(_( > "\n" > @@ -199,7 +199,7 @@ dump_f( > FILE *fp; > char *fname = NULL; > uint lower = 0, upper = 0; > - int c, type = XFS_USER_QUOTA; > + int c, type = 0; > > while ((c = getopt(argc, argv, "f:gpuL:U:")) != EOF) { > switch(c) { > @@ -207,13 +207,13 @@ dump_f( > fname = optarg; > break; > case 'g': > - type = XFS_GROUP_QUOTA; > + type |= XFS_GROUP_QUOTA; > break; > case 'p': > - type = XFS_PROJ_QUOTA; > + type |= XFS_PROJ_QUOTA; > break; > case 'u': > - type = XFS_USER_QUOTA; > + type |= XFS_USER_QUOTA; > break; > case 'L': > lower = (uint)atoi(optarg); > @@ -229,6 +229,14 @@ dump_f( > if (argc != optind) > return command_usage(&dump_cmd); > > + if (!type) { > + type = XFS_USER_QUOTA; > + } else if (type != XFS_GROUP_QUOTA && > + type != XFS_PROJ_QUOTA && > + type != XFS_USER_QUOTA) { > + return command_usage(&dump_cmd); > + } > + > if ((fp = fopen_write_secure(fname)) == NULL) > return 0; > > @@ -725,7 +733,7 @@ report_init(void) > dump_cmd.cfunc = dump_f; > dump_cmd.argmin = 0; > dump_cmd.argmax = -1; > - dump_cmd.args = _("[-gpu] [-f file]"); > + dump_cmd.args = _("[-g|-p|-u] [-f file]"); > dump_cmd.oneline = _("dump quota information for backup utilities"); > dump_cmd.help = dump_help; > > From noreply@release.debian.org Mon Feb 15 10:39:15 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=ham version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay3.corp.sgi.com [198.149.34.15]) by oss.sgi.com (Postfix) with ESMTP id B06727CA2 for ; Mon, 15 Feb 2016 10:39:15 -0600 (CST) Received: from cuda.sgi.com (cuda1.sgi.com [192.48.157.11]) by relay3.corp.sgi.com (Postfix) with ESMTP id 4C570AC002 for ; Mon, 15 Feb 2016 08:39:15 -0800 (PST) X-ASG-Debug-ID: 1455554351-04bdf066ecde170001-NocioJ Received: from picconi.debian.org (picconi.debian.org [5.153.231.3]) by cuda.sgi.com with ESMTP id emnu42x4UJaORrUO (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128 verify=NO) for ; Mon, 15 Feb 2016 08:39:12 -0800 (PST) X-Barracuda-Envelope-From: noreply@release.debian.org X-Barracuda-Apparent-Source-IP: 5.153.231.3 Received: from muffat.debian.org ([2607:f8f0:610:4000:6564:a62:ce0c:1392]) from C=NA,ST=NA,L=Ankh Morpork,O=Debian SMTP,OU=Debian SMTP CA,CN=muffat.debian.org,EMAIL=hostmaster@muffat.debian.org (verified) by picconi.debian.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.84) (envelope-from ) id 1aVMB4-0003UC-T2 for xfsprogs@packages.debian.org; Mon, 15 Feb 2016 16:39:11 +0000 Received: from franck.debian.org ([138.16.160.12]) from C=NA,ST=NA,L=Ankh Morpork,O=Debian SMTP,OU=Debian SMTP CA,CN=franck.debian.org,EMAIL=hostmaster@franck.debian.org (verified) by muffat.debian.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.84) (envelope-from ) id 1aVMB3-0001nR-52; Mon, 15 Feb 2016 16:39:09 +0000 Received: from release by franck.debian.org with local (Exim 4.84) (envelope-from ) id 1aVMB2-00021M-5I; Mon, 15 Feb 2016 16:39:08 +0000 From: Debian testing watch Precedence: bulk X-Trille: 0.120315.1711 Subject: xfsprogs 4.3.0+nmu1 MIGRATED to testing X-Testing-Watch-Package: xfsprogs X-ASG-Orig-Subj: xfsprogs 4.3.0+nmu1 MIGRATED to testing X-Testing-Watch-Version: 4.3.0+nmu1 To: xfsprogs@packages.debian.org Message-Id: Date: Mon, 15 Feb 2016 16:39:08 +0000 Delivered-To: xfsprogs@packages.debian.org X-Barracuda-Connect: picconi.debian.org[5.153.231.3] X-Barracuda-Start-Time: 1455554352 X-Barracuda-Encrypted: ECDHE-RSA-AES128-GCM-SHA256 X-Barracuda-URL: https://192.48.157.11:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-BRTS-Status: 1 X-Barracuda-Spam-Score: 0.00 X-Barracuda-Spam-Status: No, SCORE=0.00 using per-user scores of TAG_LEVEL=1000.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.7 tests=BSF_SC0_MISMATCH_TO X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.3.27052 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 0.00 BSF_SC0_MISMATCH_TO Envelope rcpt doesn't match header FYI: The status of the xfsprogs source package in Debian's testing distribution has changed. Previous version: 4.3.0 Current version: 4.3.0+nmu1 -- This email is automatically generated once a day. As the installation of new packages into testing happens multiple times a day you will receive later changes on the next day. See https://release.debian.org/testing-watch/ for more information. From zlang@redhat.com Mon Feb 15 10:46:12 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=ham version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay1.corp.sgi.com [137.38.102.111]) by oss.sgi.com (Postfix) with ESMTP id 1A4297CA2 for ; Mon, 15 Feb 2016 10:46:12 -0600 (CST) Received: from cuda.sgi.com (cuda1.sgi.com [192.48.157.11]) by relay1.corp.sgi.com (Postfix) with ESMTP id E05578F8033 for ; Mon, 15 Feb 2016 08:46:08 -0800 (PST) X-ASG-Debug-ID: 1455554766-04bdf066ebde350001-NocioJ Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by cuda.sgi.com with ESMTP id miOFTLrR5EBVsRvG (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO) for ; Mon, 15 Feb 2016 08:46:06 -0800 (PST) X-Barracuda-Envelope-From: zlang@redhat.com X-Barracuda-Apparent-Source-IP: 209.132.183.28 X-ASG-Whitelist: Client Received: from int-mx11.intmail.prod.int.phx2.redhat.com (int-mx11.intmail.prod.int.phx2.redhat.com [10.5.11.24]) by mx1.redhat.com (Postfix) with ESMTPS id 0A3228E017 for ; Mon, 15 Feb 2016 16:46:06 +0000 (UTC) Received: from localhost (vpn1-7-158.pek2.redhat.com [10.72.7.158]) by int-mx11.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id u1FGk3L6011081; Mon, 15 Feb 2016 11:46:04 -0500 From: Zorro Lang To: xfs@oss.sgi.com Cc: sandeen@redhat.com, Zorro Lang Subject: [PATCH v3] xfs_quota: modify commands which can't handle multiple types Date: Tue, 16 Feb 2016 00:45:59 +0800 X-ASG-Orig-Subj: [PATCH v3] xfs_quota: modify commands which can't handle multiple types Message-Id: <1455554759-29213-1-git-send-email-zlang@redhat.com> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.24 X-Barracuda-Connect: mx1.redhat.com[209.132.183.28] X-Barracuda-Start-Time: 1455554766 X-Barracuda-Encrypted: ECDHE-RSA-AES256-GCM-SHA384 X-Barracuda-URL: https://192.48.157.11:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-BRTS-Status: 1 Some xfs_quota commands can't deal with multiple types together. For example, if we run "limit -ug ...", one type will overwrite the other. I find below commands can't handle multiple types: [quota, limit, timer, warn, dump, restore and quot] (Although timer and warn command can't support -ugp types until now, it will in one day.) For every single $command, I change their ${command}_f function, ${command}_cmd structure and man page. Signed-off-by: Zorro Lang --- man/man8/xfs_quota.8 | 14 ++++++------ quota/edit.c | 60 ++++++++++++++++++++++++++++++++++------------------ quota/quot.c | 15 ++++++++----- quota/quota.c | 15 ++++++++----- quota/report.c | 20 ++++++++++++------ 5 files changed, 81 insertions(+), 43 deletions(-) diff --git a/man/man8/xfs_quota.8 b/man/man8/xfs_quota.8 index 3bee145..951252b 100644 --- a/man/man8/xfs_quota.8 +++ b/man/man8/xfs_quota.8 @@ -169,7 +169,7 @@ command. .HP .B quota [ -.B \-gpu +.BR \-g " | " \-p " | " \-u ] [ .B \-bir ] [ @@ -398,7 +398,7 @@ option reports state on all filesystems and not just the current path. .B limit [ -.B \-gpu +.BR \-g " | " \-p " | " \-u ] .BI bsoft= N | @@ -430,7 +430,7 @@ must be specified. .HP .B timer [ -.B \-gpu +.BR \-g " | " \-p " | " \-u ] [ .B \-bir ] @@ -446,7 +446,7 @@ command. The value argument is a number of seconds, but units of .HP .B warn [ -.B \-gpu +.BR \-g " | " \-p " | " \-u ] [ .B \-bir ] @@ -497,7 +497,7 @@ report an error. .B dump [ -.B \-gpu +.BR \-g " | " \-p " | " \-u ] [ .B \-f .I file @@ -510,7 +510,7 @@ This is only the limits, not the usage information, of course. .HP .B restore [ -.B \-gpu +.BR \-g " | " \-p " | " \-u ] [ .B \-f .I file @@ -525,7 +525,7 @@ command. .B quot [ -.B \-gpu +.BR \-g " | " \-p " | " \-u ] [ .B \-bir ] [ diff --git a/quota/edit.c b/quota/edit.c index 6146f7e..e5ddc8c 100644 --- a/quota/edit.c +++ b/quota/edit.c @@ -282,13 +282,13 @@ limit_f( flags |= DEFAULTS_FLAG; break; case 'g': - type = XFS_GROUP_QUOTA; + type |= XFS_GROUP_QUOTA; break; case 'p': - type = XFS_PROJ_QUOTA; + type |= XFS_PROJ_QUOTA; break; case 'u': - type = XFS_USER_QUOTA; + type |= XFS_USER_QUOTA; break; default: return command_usage(&limit_cmd); @@ -343,8 +343,13 @@ limit_f( name = (flags & DEFAULTS_FLAG) ? "0" : argv[optind++]; - if (!type) + if (!type) { type = XFS_USER_QUOTA; + } else if (type != XFS_GROUP_QUOTA && + type != XFS_PROJ_QUOTA && + type != XFS_USER_QUOTA) { + return command_usage(&limit_cmd); + } switch (type) { case XFS_USER_QUOTA: @@ -422,13 +427,13 @@ restore_f( fname = optarg; break; case 'g': - type = XFS_GROUP_QUOTA; + type |= XFS_GROUP_QUOTA; break; case 'p': - type = XFS_PROJ_QUOTA; + type |= XFS_PROJ_QUOTA; break; case 'u': - type = XFS_USER_QUOTA; + type |= XFS_USER_QUOTA; break; default: return command_usage(&restore_cmd); @@ -438,8 +443,13 @@ restore_f( if (argc < optind) return command_usage(&restore_cmd); - if (!type) + if (!type) { type = XFS_USER_QUOTA; + } else if (type != XFS_GROUP_QUOTA && + type != XFS_PROJ_QUOTA && + type != XFS_USER_QUOTA) { + return command_usage(&restore_cmd); + } if (fname) { if ((fp = fopen(fname, "r")) == NULL) { @@ -501,13 +511,13 @@ timer_f( mask |= FS_DQ_RTBTIMER; break; case 'g': - type = XFS_GROUP_QUOTA; + type |= XFS_GROUP_QUOTA; break; case 'p': - type = XFS_PROJ_QUOTA; + type |= XFS_PROJ_QUOTA; break; case 'u': - type = XFS_USER_QUOTA; + type |= XFS_USER_QUOTA; break; default: return command_usage(&timer_cmd); @@ -522,8 +532,13 @@ timer_f( if (!mask) mask = FS_DQ_TIMER_MASK; - if (!type) + if (!type) { type = XFS_USER_QUOTA; + } else if (type != XFS_GROUP_QUOTA && + type != XFS_PROJ_QUOTA && + type != XFS_USER_QUOTA) { + return command_usage(&timer_cmd); + } set_timer(type, mask, fs_path->fs_name, value); return 0; @@ -630,13 +645,13 @@ warn_f( mask |= FS_DQ_RTBWARNS; break; case 'g': - type = XFS_GROUP_QUOTA; + type |= XFS_GROUP_QUOTA; break; case 'p': - type = XFS_PROJ_QUOTA; + type |= XFS_PROJ_QUOTA; break; case 'u': - type = XFS_USER_QUOTA; + type |= XFS_USER_QUOTA; break; default: return command_usage(&warn_cmd); @@ -661,8 +676,13 @@ warn_f( if (!mask) mask = FS_DQ_WARNS_MASK; - if (!type) + if (!type) { type = XFS_USER_QUOTA; + } else if (type != XFS_GROUP_QUOTA && + type != XFS_PROJ_QUOTA && + type != XFS_USER_QUOTA) { + return command_usage(&warn_cmd); + } switch (type) { case XFS_USER_QUOTA: @@ -686,7 +706,7 @@ edit_init(void) limit_cmd.argmin = 2; limit_cmd.argmax = -1; limit_cmd.args = \ - _("[-gpu] bsoft|bhard|isoft|ihard|rtbsoft|rtbhard=N -d|id|name"); + _("[-g|-p|-u] bsoft|bhard|isoft|ihard|rtbsoft|rtbhard=N -d|id|name"); limit_cmd.oneline = _("modify quota limits"); limit_cmd.help = limit_help; @@ -694,14 +714,14 @@ edit_init(void) restore_cmd.cfunc = restore_f; restore_cmd.argmin = 0; restore_cmd.argmax = -1; - restore_cmd.args = _("[-gpu] [-f file]"); + restore_cmd.args = _("[-g|-p|-u] [-f file]"); restore_cmd.oneline = _("restore quota limits from a backup file"); timer_cmd.name = "timer"; timer_cmd.cfunc = timer_f; timer_cmd.argmin = 2; timer_cmd.argmax = -1; - timer_cmd.args = _("[-bir] [-gpu] value"); + timer_cmd.args = _("[-bir] [-g|-p|-u] value"); timer_cmd.oneline = _("set quota enforcement timeouts"); timer_cmd.help = timer_help; @@ -709,7 +729,7 @@ edit_init(void) warn_cmd.cfunc = warn_f; warn_cmd.argmin = 2; warn_cmd.argmax = -1; - warn_cmd.args = _("[-bir] [-gpu] value -d|id|name"); + warn_cmd.args = _("[-bir] [-g|-p|-u] value -d|id|name"); warn_cmd.oneline = _("get/set enforcement warning counter"); warn_cmd.help = warn_help; diff --git a/quota/quot.c b/quota/quot.c index 9116e48..2e583e5 100644 --- a/quota/quot.c +++ b/quota/quot.c @@ -361,13 +361,13 @@ quot_f( form |= XFS_RTBLOCK_QUOTA; break; case 'g': - type = XFS_GROUP_QUOTA; + type |= XFS_GROUP_QUOTA; break; case 'p': - type = XFS_PROJ_QUOTA; + type |= XFS_PROJ_QUOTA; break; case 'u': - type = XFS_USER_QUOTA; + type |= XFS_USER_QUOTA; break; case 'a': flags |= ALL_MOUNTS_FLAG; @@ -389,8 +389,13 @@ quot_f( if (!form) form = XFS_BLOCK_QUOTA; - if (!type) + if (!type) { type = XFS_USER_QUOTA; + } else if (type != XFS_GROUP_QUOTA && + type != XFS_PROJ_QUOTA && + type != XFS_USER_QUOTA) { + return command_usage("_cmd); + } if ((fp = fopen_write_secure(fname)) == NULL) return 0; @@ -416,7 +421,7 @@ quot_init(void) quot_cmd.cfunc = quot_f; quot_cmd.argmin = 0; quot_cmd.argmax = -1; - quot_cmd.args = _("[-bir] [-gpu] [-acv] [-f file]"); + quot_cmd.args = _("[-bir] [-g|-p|-u] [-acv] [-f file]"); quot_cmd.oneline = _("summarize filesystem ownership"); quot_cmd.help = quot_help; diff --git a/quota/quota.c b/quota/quota.c index f6b24c3..e0da7c0 100644 --- a/quota/quota.c +++ b/quota/quota.c @@ -409,13 +409,13 @@ quota_f( form |= XFS_RTBLOCK_QUOTA; break; case 'g': - type = XFS_GROUP_QUOTA; + type |= XFS_GROUP_QUOTA; break; case 'p': - type = XFS_PROJ_QUOTA; + type |= XFS_PROJ_QUOTA; break; case 'u': - type = XFS_USER_QUOTA; + type |= XFS_USER_QUOTA; break; case 'h': flags |= HUMAN_FLAG; @@ -437,8 +437,13 @@ quota_f( if (!form) form = XFS_BLOCK_QUOTA; - if (!type) + if (!type) { type = XFS_USER_QUOTA; + } else if (type != XFS_GROUP_QUOTA && + type != XFS_PROJ_QUOTA && + type != XFS_USER_QUOTA) { + return command_usage("a_cmd); + } if ((fp = fopen_write_secure(fname)) == NULL) return 0; @@ -461,7 +466,7 @@ quota_init(void) quota_cmd.cfunc = quota_f; quota_cmd.argmin = 0; quota_cmd.argmax = -1; - quota_cmd.args = _("[-bir] [-gpu] [-hnNv] [-f file] [id|name]..."); + quota_cmd.args = _("[-bir] [-g|-p|-u] [-hnNv] [-f file] [id|name]..."); quota_cmd.oneline = _("show usage and limits"); quota_cmd.help = quota_help; diff --git a/quota/report.c b/quota/report.c index 8653134..48a3f29 100644 --- a/quota/report.c +++ b/quota/report.c @@ -30,7 +30,7 @@ static cmdinfo_t report_cmd; static void dump_help(void) { - dump_cmd.args = _("[-gpu] [-f file]"); + dump_cmd.args = _("[-g|-p|-u] [-f file]"); dump_cmd.oneline = _("dump quota information for backup utilities"); printf(_( "\n" @@ -199,7 +199,7 @@ dump_f( FILE *fp; char *fname = NULL; uint lower = 0, upper = 0; - int c, type = XFS_USER_QUOTA; + int c, type = 0; while ((c = getopt(argc, argv, "f:gpuL:U:")) != EOF) { switch(c) { @@ -207,13 +207,13 @@ dump_f( fname = optarg; break; case 'g': - type = XFS_GROUP_QUOTA; + type |= XFS_GROUP_QUOTA; break; case 'p': - type = XFS_PROJ_QUOTA; + type |= XFS_PROJ_QUOTA; break; case 'u': - type = XFS_USER_QUOTA; + type |= XFS_USER_QUOTA; break; case 'L': lower = (uint)atoi(optarg); @@ -229,6 +229,14 @@ dump_f( if (argc != optind) return command_usage(&dump_cmd); + if (!type) { + type = XFS_USER_QUOTA; + } else if (type != XFS_GROUP_QUOTA && + type != XFS_PROJ_QUOTA && + type != XFS_USER_QUOTA) { + return command_usage(&dump_cmd); + } + if ((fp = fopen_write_secure(fname)) == NULL) return 0; @@ -725,7 +733,7 @@ report_init(void) dump_cmd.cfunc = dump_f; dump_cmd.argmin = 0; dump_cmd.argmax = -1; - dump_cmd.args = _("[-gpu] [-f file]"); + dump_cmd.args = _("[-g|-p|-u] [-f file]"); dump_cmd.oneline = _("dump quota information for backup utilities"); dump_cmd.help = dump_help; -- 1.9.3 From billodo@redhat.com Mon Feb 15 11:00:54 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=ham version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay2.corp.sgi.com [137.38.102.29]) by oss.sgi.com (Postfix) with ESMTP id B450A7CA2 for ; Mon, 15 Feb 2016 11:00:54 -0600 (CST) Received: from cuda.sgi.com (cuda3.sgi.com [192.48.176.15]) by relay2.corp.sgi.com (Postfix) with ESMTP id A43C2304043 for ; Mon, 15 Feb 2016 09:00:51 -0800 (PST) X-ASG-Debug-ID: 1455555649-04cb6c1e58e1690001-NocioJ Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by cuda.sgi.com with ESMTP id LRHJGYgUgoHiCSKF (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO) for ; Mon, 15 Feb 2016 09:00:50 -0800 (PST) X-Barracuda-Envelope-From: billodo@redhat.com X-Barracuda-Apparent-Source-IP: 209.132.183.28 X-ASG-Whitelist: Client Received: from int-mx13.intmail.prod.int.phx2.redhat.com (int-mx13.intmail.prod.int.phx2.redhat.com [10.5.11.26]) by mx1.redhat.com (Postfix) with ESMTPS id 5B75BC0A846A; Mon, 15 Feb 2016 17:00:49 +0000 (UTC) Received: from redhat.com (vpn-55-172.rdu2.redhat.com [10.10.55.172]) by int-mx13.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id u1FH0laD013396 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Mon, 15 Feb 2016 12:00:49 -0500 Date: Mon, 15 Feb 2016 11:00:47 -0600 From: "Bill O'Donnell" To: Eric Sandeen Cc: xfs@oss.sgi.com Subject: Re: [PATCH v5 2/2] xfs_repair: new secondary superblock search method Message-ID: <20160215170047.GA25349@redhat.com> X-ASG-Orig-Subj: Re: [PATCH v5 2/2] xfs_repair: new secondary superblock search method References: <1455303811-9874-1-git-send-email-billodo@redhat.com> <1455303811-9874-3-git-send-email-billodo@redhat.com> <56BE9F13.7080107@sandeen.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <56BE9F13.7080107@sandeen.net> User-Agent: Mutt/1.5.24 (2015-08-30) X-Scanned-By: MIMEDefang 2.68 on 10.5.11.26 X-Barracuda-Connect: mx1.redhat.com[209.132.183.28] X-Barracuda-Start-Time: 1455555650 X-Barracuda-Encrypted: ECDHE-RSA-AES256-GCM-SHA384 X-Barracuda-URL: https://192.48.176.15:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-BRTS-Status: 1 xfs_repair: new secondary superblock search method Optimize secondary sb search, using similar method to find fs geometry as that of xfs_mkfs. If this faster method fails in finding a secondary sb, fall back to original brute force slower search. version history: ---- v1: http://oss.sgi.com/archives/xfs/2016-02/msg00304.html v2: patch 2 whitespace fixups v3: patch 2 correct functionality; style fixups v4: patch 1,2 properly see to style and whitespace fixups v5: patch 2 move guess_default_geometry() to sb.c plus very minor style/whitespace fixups. ---- Signed-off-by: Bill O'Donnell --- Makefile | 2 +- repair/Makefile | 4 ++-- repair/sb.c | 72 +++++++++++++++++++++++++++++++++++++++++++++++++++++---- 3 files changed, 70 insertions(+), 8 deletions(-) diff --git a/Makefile b/Makefile index fca0a42..1d60d9c 100644 --- a/Makefile +++ b/Makefile @@ -80,7 +80,7 @@ fsr: libhandle growfs: libxcmd io: libxcmd libhandle quota: libxcmd -repair: libxlog +repair: libxlog libxcmd copy: libxlog ifeq ($(HAVE_BUILDDEFS), yes) diff --git a/repair/Makefile b/repair/Makefile index 251722b..d24ab1f 100644 --- a/repair/Makefile +++ b/repair/Makefile @@ -20,8 +20,8 @@ CFILES = agheader.c attr_repair.c avl.c avl64.c bmap.c btree.c \ progress.c prefetch.c rt.c sb.c scan.c threads.c \ versions.c xfs_repair.c -LLDLIBS = $(LIBXFS) $(LIBXLOG) $(LIBUUID) $(LIBRT) $(LIBPTHREAD) -LTDEPENDENCIES = $(LIBXFS) $(LIBXLOG) +LLDLIBS = $(LIBBLKID) $(LIBXFS) $(LIBXLOG) $(LIBUUID) $(LIBRT) $(LIBPTHREAD) $(LIBXCMD) +LTDEPENDENCIES = $(LIBXFS) $(LIBXLOG) $(LIBXCMD) LLDFLAGS = -static-libtool-libs default: depend $(LTCOMMAND) diff --git a/repair/sb.c b/repair/sb.c index 4eef14a..7e4708c 100644 --- a/repair/sb.c +++ b/repair/sb.c @@ -17,6 +17,7 @@ */ #include "libxfs.h" +#include "libxcmd.h" #include "libxlog.h" #include "agheader.h" #include "globals.h" @@ -85,10 +86,15 @@ copy_sb(xfs_sb_t *source, xfs_sb_t *dest) } /* - * find a secondary superblock, copy it into the sb buffer + * find a secondary superblock, copy it into the sb buffer. + * start is the point to begin reading BSIZE bytes. + * skip contains a byte-count of how far to advance for next read. */ -int -find_secondary_sb(xfs_sb_t *rsb) +static int +__find_secondary_sb( + xfs_sb_t *rsb, + __uint64_t start, + __uint64_t skip) { xfs_off_t off; xfs_sb_t *sb; @@ -117,7 +123,7 @@ find_secondary_sb(xfs_sb_t *rsb) /* * skip first sector since we know that's bad */ - for (done = 0, off = XFS_AG_MIN_BYTES; !done ; off += bsize) { + for (done = 0, off = start; !done ; off += skip) { /* * read disk 1 MByte at a time. */ @@ -166,7 +172,63 @@ find_secondary_sb(xfs_sb_t *rsb) } free(sb); - return(retval); + return retval; +} + +static int +guess_default_geometry( + __uint64_t *agsize, + __uint64_t *agcount, + libxfs_init_t *x) +{ + struct fs_topology ft; + int blocklog; + __uint64_t dblocks; + int multidisk; + + memset(&ft, 0, sizeof(ft)); + get_topology(x, &ft, 1); + + /* + * get geometry from get_topology result. + * Use default block size (2^12) + */ + blocklog = 12; + multidisk = ft.dswidth | ft.dsunit; + dblocks = x->dsize >> (blocklog - BBSHIFT); + calc_default_ag_geometry(blocklog, dblocks, multidisk, + agsize, agcount); + + return blocklog; +} + +int +find_secondary_sb(xfs_sb_t *rsb) +{ + int retval; + __uint64_t agcount; + __uint64_t agsize; + __uint64_t skip; + int blocklog; + + /* + * Attempt to find secondary sb with a coarse approach. + * Failing that, fallback to a fine-grained approach. + */ + blocklog = guess_default_geometry(&agsize, &agcount, &x); + + /* + * use found ag geometry to quickly find secondary sb + */ + skip = agsize << blocklog; + retval = __find_secondary_sb(rsb, skip, skip); + if (!retval) { + /* + * fallback: Start at min agsize and scan all blocks + */ + retval = __find_secondary_sb(rsb, XFS_AG_MIN_BYTES, BSIZE); + } + return retval; } /* -- 2.5.0 From prirun@gmail.com Mon Feb 15 11:26:45 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=FREEMAIL_FROM,T_DKIM_INVALID autolearn=ham version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay2.corp.sgi.com [137.38.102.29]) by oss.sgi.com (Postfix) with ESMTP id A447B7CA2 for ; Mon, 15 Feb 2016 11:26:45 -0600 (CST) Received: from cuda.sgi.com (cuda2.sgi.com [192.48.176.25]) by relay2.corp.sgi.com (Postfix) with ESMTP id 945E5304039 for ; Mon, 15 Feb 2016 09:26:42 -0800 (PST) X-ASG-Debug-ID: 1455557196-04cbb04333fa7c0001-NocioJ Received: from mail-wm0-f53.google.com (mail-wm0-f53.google.com [74.125.82.53]) by cuda.sgi.com with ESMTP id H4L9Y6rsRbKCcxTB (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128 verify=NO) for ; Mon, 15 Feb 2016 09:26:36 -0800 (PST) X-Barracuda-Envelope-From: prirun@gmail.com X-Barracuda-Apparent-Source-IP: 74.125.82.53 Received: by mail-wm0-f53.google.com with SMTP id c200so123746895wme.0 for ; Mon, 15 Feb 2016 09:26:36 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:date:message-id:subject:from:to:content-type; bh=1Pml0kVBMltIvU4/o3lc4Mj9ZWQsH1HHuEmB5F4AN/g=; b=MN9rHG2HdWRZatrTgSrJB6a+pr5f9J7KfPFElxwklkADdJ+X0b/0Nb5ge22BkQZtw8 twcH/w27EKL0jL5AA+mES/mUxP/IqYYmx72bArFLuSDYe6PqP+Vb9iaSblYm9KZLZxpj c2tj4jGb7WJ0WDbRZq7635xMkOG1ffqoXLQ+JkAypSEO5Lfim9E4B9nTufC4jfXs5eE+ hFKl1BIGOTjLCnM9GjlzaCn7TCoVdFt+xX89ucQwHrTTaQ54/SU++BdSS7T6gPDbiJpJ YNNq/riC62r9PJl2NX1CvKUQXxYqEF7BTKbvhSsRILSo51ZNDEqT+A8a2foISoj96Z1u ixOw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:date:message-id:subject:from:to :content-type; bh=1Pml0kVBMltIvU4/o3lc4Mj9ZWQsH1HHuEmB5F4AN/g=; b=c94G8IfCS3LEDD0POJjDLh84yPTp6FBGC8bBELWe+E7NnKje7RbAYtcm+l0QJNlZ8P Y23/bLZQ2uPL0v7Oq88jy0gnIhFnchfGKtsPyzBO6Rc+rEOtCxidAvEeUtkS/s8tklzy Aigx623k39cCBk8Aid5nDEegP0QP1y8pDCOj5H1jy2xtCa2/JcV8U3Axa8DuzoEztR2p +5FPZ/rY4eplFuP9ysbDRBBx6NSy2L9WVcYkzgntKTNCRpHeteDpSiOTVnYClMU00zdP u8d3TnAZZOGFfEEkdg+EVKTsm6lxV4plgp0n/oyVmp71wWmW7ZHdvmSQH9Ih+0ua1fpI v4yQ== X-Gm-Message-State: AG10YOSzJuH/JByGKmfDnPWURtNnt5UkEjgsS+Pv07mJbx50SZOkScpz2XIdd6C93938OmwcQTCU+rGOxnUMUQ== MIME-Version: 1.0 X-Received: by 10.194.85.193 with SMTP id j1mr17477416wjz.122.1455557195752; Mon, 15 Feb 2016 09:26:35 -0800 (PST) Received: by 10.27.212.144 with HTTP; Mon, 15 Feb 2016 09:26:35 -0800 (PST) Date: Mon, 15 Feb 2016 12:26:35 -0500 Message-ID: Subject: XFS fiemap issue with Linux 3.10.0-327.el7.x86_64 (CentOS 7) From: Jim Wilcoxson X-ASG-Orig-Subj: XFS fiemap issue with Linux 3.10.0-327.el7.x86_64 (CentOS 7) To: xfs@oss.sgi.com Content-Type: text/plain; charset=UTF-8 X-Barracuda-Connect: mail-wm0-f53.google.com[74.125.82.53] X-Barracuda-Start-Time: 1455557196 X-Barracuda-Encrypted: ECDHE-RSA-AES128-GCM-SHA256 X-Barracuda-URL: https://192.48.176.25:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-BRTS-Status: 1 X-Barracuda-BRTS-Evidence: hashbackup.com X-Barracuda-Spam-Score: 0.00 X-Barracuda-Spam-Status: No, SCORE=0.00 using per-user scores of TAG_LEVEL=1000.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.7 tests=DKIM_SIGNED, DKIM_VERIFIED X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.3.27053 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- -0.00 DKIM_VERIFIED Domain Keys Identified Mail: signature passes verification 0.00 DKIM_SIGNED Domain Keys Identified Mail: message has a signature I'm developing a backup program, HashBackup, and recently added sparse "hole skipping" using fiemap. Today I ran into a weird issue with xfs on Linux 3.10. A test program creates a sparse file with 10000*(4K data, 4M hole). HB calls fiemap with start=0, length=0xFFFF...FFFF, mapped_extents=0 to get the number of extents. Fiemap is coming back with mapped_extents=1364 instead of 10000. The fiemap.txt file says: "If fm_extent_count is zero, then the fm_extents[] array is ignored (no extents will be returned), and the fm_mapped_extents count will hold the number of extents needed in fm_extents[] to hold the file's current mapping." It doesn't say the filesystem can choose to return fewer extents if it wants, but maybe xfs interprets it this way and fiemap has to be called in a loop until the extent_last flag is set. If that's the case, fiemap.txt should be updated. Thanks, Jim (not on the xfs mailing list) -- HashBackup: easy onsite and offsite Unix backup http://www.hashbackup.com From sandeen@sandeen.net Mon Feb 15 12:33:27 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=ham version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay1.corp.sgi.com [137.38.102.111]) by oss.sgi.com (Postfix) with ESMTP id EEE5C7CA2 for ; Mon, 15 Feb 2016 12:33:27 -0600 (CST) Received: from cuda.sgi.com (cuda3.sgi.com [192.48.176.15]) by relay1.corp.sgi.com (Postfix) with ESMTP id DFB9F8F8039 for ; Mon, 15 Feb 2016 10:33:24 -0800 (PST) X-ASG-Debug-ID: 1455561201-04cb6c1e59e35b0001-NocioJ Received: from sandeen.net (sandeen.net [63.231.237.45]) by cuda.sgi.com with ESMTP id sZmxuMXSsny78Qvy for ; Mon, 15 Feb 2016 10:33:21 -0800 (PST) X-Barracuda-Envelope-From: sandeen@sandeen.net X-Barracuda-Apparent-Source-IP: 63.231.237.45 Received: from liberator.sandeen.net (liberator.sandeen.net [10.0.0.4]) (using TLSv1.2 with cipher DHE-RSA-AES128-SHA (128/128 bits)) (No client certificate requested) by sandeen.net (Postfix) with ESMTPSA id 17DFA63C5FF0; Mon, 15 Feb 2016 12:33:21 -0600 (CST) Subject: Re: XFS fiemap issue with Linux 3.10.0-327.el7.x86_64 (CentOS 7) To: xfs@oss.sgi.com, Jim Wilcoxson X-ASG-Orig-Subj: Re: XFS fiemap issue with Linux 3.10.0-327.el7.x86_64 (CentOS 7) References: From: Eric Sandeen X-Enigmail-Draft-Status: N1110 Message-ID: <56C219F0.3050002@sandeen.net> Date: Mon, 15 Feb 2016 12:33:20 -0600 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.11; rv:38.0) Gecko/20100101 Thunderbird/38.5.1 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 8bit X-Barracuda-Connect: sandeen.net[63.231.237.45] X-Barracuda-Start-Time: 1455561201 X-Barracuda-URL: https://192.48.176.15:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-BRTS-Status: 1 X-Barracuda-Spam-Score: 0.00 X-Barracuda-Spam-Status: No, SCORE=0.00 using per-user scores of TAG_LEVEL=1000.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.7 tests=BSF_SC0_MISMATCH_TO X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.3.27054 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 0.00 BSF_SC0_MISMATCH_TO Envelope rcpt doesn't match header On 2/15/16 11:26 AM, Jim Wilcoxson wrote: > I'm developing a backup program, HashBackup, and recently added sparse > "hole skipping" using fiemap. That is probably not safe. Mapping can change immediately after fiemap returns, and you could miss data. cp went down that path a few years ago, and it caused pain. SEEK_HOLE/SEEK_DATA would be a better choice. > Today I ran into a weird issue with xfs > on Linux 3.10. > > A test program creates a sparse file with 10000*(4K data, 4M hole). > HB calls fiemap with start=0, length=0xFFFF...FFFF, mapped_extents=0 > to get the number of extents. Fiemap is coming back with > mapped_extents=1364 instead of 10000. Take a look at xfs_bmap -v output to get a clear picture of what is actually on disk. It's possible that some combination of speculative preallocation or other things has merged extents. In general, the kernel has plenty of leeway in terms of how it chooses to lay out a file. "seek/write" doesn't necessarily guarantee a hole. > The fiemap.txt file says: > > "If fm_extent_count is zero, then the fm_extents[] array is ignored > (no extents will be returned), and the fm_mapped_extents count will > hold the number of extents needed in fm_extents[] to hold the file's > current mapping." > > It doesn't say the filesystem can choose to return fewer extents if it > wants, but maybe xfs interprets it this way and fiemap has to be > called in a loop until the extent_last flag is set. If that's the > case, fiemap.txt should be updated. It's not clear that it is returning fewer extents. See what xfs_bmap says, and compare. But also, don't use fiemap results for anything that requires data integrity... -Eric > Thanks, > Jim > (not on the xfs mailing list) > From bfoster@redhat.com Mon Feb 15 12:54:17 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=ham version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay2.corp.sgi.com [137.38.102.29]) by oss.sgi.com (Postfix) with ESMTP id CA9B37CA2 for ; Mon, 15 Feb 2016 12:54:17 -0600 (CST) Received: from cuda.sgi.com (cuda1.sgi.com [192.48.157.11]) by relay2.corp.sgi.com (Postfix) with ESMTP id 89AD9304051 for ; Mon, 15 Feb 2016 10:54:17 -0800 (PST) X-ASG-Debug-ID: 1455562454-04bdf02d5d01a20001-NocioJ Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by cuda.sgi.com with ESMTP id FYsrExSA11OfkOe2 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO) for ; Mon, 15 Feb 2016 10:54:15 -0800 (PST) X-Barracuda-Envelope-From: bfoster@redhat.com X-Barracuda-Apparent-Source-IP: 209.132.183.28 X-ASG-Whitelist: Client Received: from int-mx14.intmail.prod.int.phx2.redhat.com (int-mx14.intmail.prod.int.phx2.redhat.com [10.5.11.27]) by mx1.redhat.com (Postfix) with ESMTPS id 917C0341AF6; Mon, 15 Feb 2016 18:54:14 +0000 (UTC) Received: from bfoster.bfoster (dhcp-41-164.bos.redhat.com [10.18.41.164]) by int-mx14.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id u1FIsE67018498; Mon, 15 Feb 2016 13:54:14 -0500 Received: by bfoster.bfoster (Postfix, from userid 1000) id D4686123DF8; Mon, 15 Feb 2016 13:54:12 -0500 (EST) Date: Mon, 15 Feb 2016 13:54:12 -0500 From: Brian Foster To: Eric Sandeen Cc: xfs@oss.sgi.com Subject: Re: [PATCH 1/3] xfs: convert mount option parsing to tokens Message-ID: <20160215185410.GA33291@bfoster.bfoster> X-ASG-Orig-Subj: Re: [PATCH 1/3] xfs: convert mount option parsing to tokens References: <56BBC982.50804@redhat.com> <56BBC9E6.5030100@sandeen.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <56BBC9E6.5030100@sandeen.net> User-Agent: Mutt/1.5.24 (2015-08-30) X-Scanned-By: MIMEDefang 2.68 on 10.5.11.27 X-Barracuda-Connect: mx1.redhat.com[209.132.183.28] X-Barracuda-Start-Time: 1455562455 X-Barracuda-Encrypted: ECDHE-RSA-AES256-GCM-SHA384 X-Barracuda-URL: https://192.48.157.11:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-BRTS-Status: 1 On Wed, Feb 10, 2016 at 05:38:14PM -0600, Eric Sandeen wrote: > This should be a no-op change, just switch to token parsing > like every other respectable filesystem does. > > Signed-off-by: Eric Sandeen > --- > > diff --git a/fs/xfs/xfs_super.c b/fs/xfs/xfs_super.c > index 59c9b7b..934233a 100644 > --- a/fs/xfs/xfs_super.c > +++ b/fs/xfs/xfs_super.c > @@ -65,83 +65,82 @@ static struct kset *xfs_kset; /* top-level xfs sysfs dir */ ... > STATIC int > -suffix_kstrtoint(char *s, unsigned int base, int *res) > +suffix_kstrtoint(const substring_t *s, unsigned int base, int *res) > { > int last, shift_left_factor = 0, _res; > - char *value = s; > + char *value = match_strdup(s); > + int ret = 0; > + Trailing whitespace here ^^ > > last = strlen(value) - 1; > if (value[last] == 'K' || value[last] == 'k') { ... > @@ -217,152 +218,153 @@ xfs_parseargs( > if (!options) > goto done; > > - while ((this_char = strsep(&options, ",")) != NULL) { > - if (!*this_char) > + while ((p = strsep(&options, ",")) != NULL) { > + int token; > + > + if (!*p) > continue; > - if ((value = strchr(this_char, '=')) != NULL) > - *value++ = 0; > > - if (!strcmp(this_char, MNTOPT_LOGBUFS)) { > - if (!value || !*value) { > - xfs_warn(mp, "%s option requires an argument", > - this_char); > - return -EINVAL; > - } > - if (kstrtoint(value, 10, &mp->m_logbufs)) > - return -EINVAL; > - } else if (!strcmp(this_char, MNTOPT_LOGBSIZE)) { > - if (!value || !*value) { > - xfs_warn(mp, "%s option requires an argument", > - this_char); > - return -EINVAL; > - } > - if (suffix_kstrtoint(value, 10, &mp->m_logbsize)) > + token = match_token(p, tokens, args); ^^^ spaces instead of tabs. > + switch (token) { > + case Opt_logbufs: > + if (match_int(args, &mp->m_logbufs)) > return -EINVAL; > - } else if (!strcmp(this_char, MNTOPT_LOGDEV)) { > - if (!value || !*value) { > - xfs_warn(mp, "%s option requires an argument", > - this_char); > + break; > + case Opt_logbsize: > + if (suffix_kstrtoint(args, 10, &mp->m_logbsize)) > return -EINVAL; > - } > - mp->m_logname = kstrndup(value, MAXNAMELEN, GFP_KERNEL); > + break; > + case Opt_logdev: > + mp->m_logname = match_strdup(args); > if (!mp->m_logname) > return -ENOMEM; > - } else if (!strcmp(this_char, MNTOPT_MTPT)) { > - xfs_warn(mp, "%s option not allowed on this system", > - this_char); > + break; > + case Opt_mtpt: > + xfs_warn(mp, "%s option not allowed on this system", p); > return -EINVAL; > - } else if (!strcmp(this_char, MNTOPT_RTDEV)) { > - if (!value || !*value) { > - xfs_warn(mp, "%s option requires an argument", > - this_char); > - return -EINVAL; > - } > - mp->m_rtname = kstrndup(value, MAXNAMELEN, GFP_KERNEL); > + break; Any reason for the break after the return here? Otherwise seems fine: Reviewed-by: Brian Foster Brian > + case Opt_rtdev: > + mp->m_rtname = match_strdup(args); > if (!mp->m_rtname) > return -ENOMEM; > - } else if (!strcmp(this_char, MNTOPT_ALLOCSIZE) || > - !strcmp(this_char, MNTOPT_BIOSIZE)) { > - if (!value || !*value) { > - xfs_warn(mp, "%s option requires an argument", > - this_char); > - return -EINVAL; > - } > - if (suffix_kstrtoint(value, 10, &iosize)) > + break; > + case Opt_allocsize: > + case Opt_biosize: > + if (suffix_kstrtoint(args, 10, &iosize)) > return -EINVAL; > iosizelog = ffs(iosize) - 1; > - } else if (!strcmp(this_char, MNTOPT_GRPID) || > - !strcmp(this_char, MNTOPT_BSDGROUPS)) { > + break; > + case Opt_grpid: > + case Opt_bsdgroups: > mp->m_flags |= XFS_MOUNT_GRPID; > - } else if (!strcmp(this_char, MNTOPT_NOGRPID) || > - !strcmp(this_char, MNTOPT_SYSVGROUPS)) { > + break; > + case Opt_nogrpid: > + case Opt_sysvgroups: > mp->m_flags &= ~XFS_MOUNT_GRPID; > - } else if (!strcmp(this_char, MNTOPT_WSYNC)) { > + break; > + case Opt_wsync: > mp->m_flags |= XFS_MOUNT_WSYNC; > - } else if (!strcmp(this_char, MNTOPT_NORECOVERY)) { > + break; > + case Opt_norecovery: > mp->m_flags |= XFS_MOUNT_NORECOVERY; > - } else if (!strcmp(this_char, MNTOPT_NOALIGN)) { > + break; > + case Opt_noalign: > mp->m_flags |= XFS_MOUNT_NOALIGN; > - } else if (!strcmp(this_char, MNTOPT_SWALLOC)) { > + break; > + case Opt_swalloc: > mp->m_flags |= XFS_MOUNT_SWALLOC; > - } else if (!strcmp(this_char, MNTOPT_SUNIT)) { > - if (!value || !*value) { > - xfs_warn(mp, "%s option requires an argument", > - this_char); > - return -EINVAL; > - } > - if (kstrtoint(value, 10, &dsunit)) > - return -EINVAL; > - } else if (!strcmp(this_char, MNTOPT_SWIDTH)) { > - if (!value || !*value) { > - xfs_warn(mp, "%s option requires an argument", > - this_char); > + break; > + case Opt_sunit: > + if (match_int(args, &dsunit)) > return -EINVAL; > - } > - if (kstrtoint(value, 10, &dswidth)) > + break; > + case Opt_swidth: > + if (match_int(args, &dswidth)) > return -EINVAL; > - } else if (!strcmp(this_char, MNTOPT_32BITINODE)) { > + break; > + case Opt_inode32: > mp->m_flags |= XFS_MOUNT_SMALL_INUMS; > - } else if (!strcmp(this_char, MNTOPT_64BITINODE)) { > + break; > + case Opt_inode64: > mp->m_flags &= ~XFS_MOUNT_SMALL_INUMS; > - } else if (!strcmp(this_char, MNTOPT_NOUUID)) { > + break; > + case Opt_nouuid: > mp->m_flags |= XFS_MOUNT_NOUUID; > - } else if (!strcmp(this_char, MNTOPT_BARRIER)) { > + break; > + case Opt_barrier: > mp->m_flags |= XFS_MOUNT_BARRIER; > - } else if (!strcmp(this_char, MNTOPT_NOBARRIER)) { > + break; > + case Opt_nobarrier: > mp->m_flags &= ~XFS_MOUNT_BARRIER; > - } else if (!strcmp(this_char, MNTOPT_IKEEP)) { > + break; > + case Opt_ikeep: > mp->m_flags |= XFS_MOUNT_IKEEP; > - } else if (!strcmp(this_char, MNTOPT_NOIKEEP)) { > + break; > + case Opt_noikeep: > mp->m_flags &= ~XFS_MOUNT_IKEEP; > - } else if (!strcmp(this_char, MNTOPT_LARGEIO)) { > + break; > + case Opt_largeio: > mp->m_flags &= ~XFS_MOUNT_COMPAT_IOSIZE; > - } else if (!strcmp(this_char, MNTOPT_NOLARGEIO)) { > + break; > + case Opt_nolargeio: > mp->m_flags |= XFS_MOUNT_COMPAT_IOSIZE; > - } else if (!strcmp(this_char, MNTOPT_ATTR2)) { > + break; > + case Opt_attr2: > mp->m_flags |= XFS_MOUNT_ATTR2; > - } else if (!strcmp(this_char, MNTOPT_NOATTR2)) { > + break; > + case Opt_noattr2: > mp->m_flags &= ~XFS_MOUNT_ATTR2; > mp->m_flags |= XFS_MOUNT_NOATTR2; > - } else if (!strcmp(this_char, MNTOPT_FILESTREAM)) { > + break; > + case Opt_filestreams: > mp->m_flags |= XFS_MOUNT_FILESTREAMS; > - } else if (!strcmp(this_char, MNTOPT_NOQUOTA)) { > + break; > + case Opt_noquota: > mp->m_qflags &= ~XFS_ALL_QUOTA_ACCT; > mp->m_qflags &= ~XFS_ALL_QUOTA_ENFD; > mp->m_qflags &= ~XFS_ALL_QUOTA_ACTIVE; > - } else if (!strcmp(this_char, MNTOPT_QUOTA) || > - !strcmp(this_char, MNTOPT_UQUOTA) || > - !strcmp(this_char, MNTOPT_USRQUOTA)) { > + break; > + case Opt_quota: > + case Opt_uquota: > + case Opt_usrquota: > mp->m_qflags |= (XFS_UQUOTA_ACCT | XFS_UQUOTA_ACTIVE | > XFS_UQUOTA_ENFD); > - } else if (!strcmp(this_char, MNTOPT_QUOTANOENF) || > - !strcmp(this_char, MNTOPT_UQUOTANOENF)) { > + break; > + case Opt_qnoenforce: > + case Opt_uqnoenforce: > mp->m_qflags |= (XFS_UQUOTA_ACCT | XFS_UQUOTA_ACTIVE); > mp->m_qflags &= ~XFS_UQUOTA_ENFD; > - } else if (!strcmp(this_char, MNTOPT_PQUOTA) || > - !strcmp(this_char, MNTOPT_PRJQUOTA)) { > + break; > + case Opt_pquota: > + case Opt_prjquota: > mp->m_qflags |= (XFS_PQUOTA_ACCT | XFS_PQUOTA_ACTIVE | > XFS_PQUOTA_ENFD); > - } else if (!strcmp(this_char, MNTOPT_PQUOTANOENF)) { > + break; > + case Opt_pqnoenforce: > mp->m_qflags |= (XFS_PQUOTA_ACCT | XFS_PQUOTA_ACTIVE); > mp->m_qflags &= ~XFS_PQUOTA_ENFD; > - } else if (!strcmp(this_char, MNTOPT_GQUOTA) || > - !strcmp(this_char, MNTOPT_GRPQUOTA)) { > + case Opt_gquota: > + case Opt_grpquota: > mp->m_qflags |= (XFS_GQUOTA_ACCT | XFS_GQUOTA_ACTIVE | > XFS_GQUOTA_ENFD); > - } else if (!strcmp(this_char, MNTOPT_GQUOTANOENF)) { > + break; > + case Opt_gqnoenforce: > mp->m_qflags |= (XFS_GQUOTA_ACCT | XFS_GQUOTA_ACTIVE); > mp->m_qflags &= ~XFS_GQUOTA_ENFD; > - } else if (!strcmp(this_char, MNTOPT_DISCARD)) { > + break; > + case Opt_discard: > mp->m_flags |= XFS_MOUNT_DISCARD; > - } else if (!strcmp(this_char, MNTOPT_NODISCARD)) { > + break; > + case Opt_nodiscard: > mp->m_flags &= ~XFS_MOUNT_DISCARD; > + break; > #ifdef CONFIG_FS_DAX > - } else if (!strcmp(this_char, MNTOPT_DAX)) { > + case Opt_dax: > mp->m_flags |= XFS_MOUNT_DAX; > + break; > #endif > - } else { > - xfs_warn(mp, "unknown mount option [%s].", this_char); > + default: > + xfs_warn(mp, "unknown mount option [%s].", p); > return -EINVAL; > } > } > @@ -461,25 +463,25 @@ xfs_showargs( > { > static struct proc_xfs_info xfs_info_set[] = { > /* the few simple ones we can get from the mount struct */ > - { XFS_MOUNT_IKEEP, "," MNTOPT_IKEEP }, > - { XFS_MOUNT_WSYNC, "," MNTOPT_WSYNC }, > - { XFS_MOUNT_NOALIGN, "," MNTOPT_NOALIGN }, > - { XFS_MOUNT_SWALLOC, "," MNTOPT_SWALLOC }, > - { XFS_MOUNT_NOUUID, "," MNTOPT_NOUUID }, > - { XFS_MOUNT_NORECOVERY, "," MNTOPT_NORECOVERY }, > - { XFS_MOUNT_ATTR2, "," MNTOPT_ATTR2 }, > - { XFS_MOUNT_FILESTREAMS, "," MNTOPT_FILESTREAM }, > - { XFS_MOUNT_GRPID, "," MNTOPT_GRPID }, > - { XFS_MOUNT_DISCARD, "," MNTOPT_DISCARD }, > - { XFS_MOUNT_SMALL_INUMS, "," MNTOPT_32BITINODE }, > - { XFS_MOUNT_DAX, "," MNTOPT_DAX }, > + { XFS_MOUNT_IKEEP, ",ikeep" }, > + { XFS_MOUNT_WSYNC, ",wsync" }, > + { XFS_MOUNT_NOALIGN, ",noalign" }, > + { XFS_MOUNT_SWALLOC, ",swalloc" }, > + { XFS_MOUNT_NOUUID, ",nouuid" }, > + { XFS_MOUNT_NORECOVERY, ",norecovery" }, > + { XFS_MOUNT_ATTR2, ",attr2" }, > + { XFS_MOUNT_FILESTREAMS, ",filestreams" }, > + { XFS_MOUNT_GRPID, ",grpid" }, > + { XFS_MOUNT_DISCARD, ",discard" }, > + { XFS_MOUNT_SMALL_INUMS, ",inode32" }, > + { XFS_MOUNT_DAX, ",dax" }, > { 0, NULL } > }; > static struct proc_xfs_info xfs_info_unset[] = { > /* the few simple ones we can get from the mount struct */ > - { XFS_MOUNT_COMPAT_IOSIZE, "," MNTOPT_LARGEIO }, > - { XFS_MOUNT_BARRIER, "," MNTOPT_NOBARRIER }, > - { XFS_MOUNT_SMALL_INUMS, "," MNTOPT_64BITINODE }, > + { XFS_MOUNT_COMPAT_IOSIZE, ",largeio" }, > + { XFS_MOUNT_BARRIER, ",nobarrier" }, > + { XFS_MOUNT_SMALL_INUMS, ",inode64" }, > { 0, NULL } > }; > struct proc_xfs_info *xfs_infop; > @@ -494,46 +496,46 @@ xfs_showargs( > } > > if (mp->m_flags & XFS_MOUNT_DFLT_IOSIZE) > - seq_printf(m, "," MNTOPT_ALLOCSIZE "=%dk", > + seq_printf(m, ",allocsize=%dk", > (int)(1 << mp->m_writeio_log) >> 10); > > if (mp->m_logbufs > 0) > - seq_printf(m, "," MNTOPT_LOGBUFS "=%d", mp->m_logbufs); > + seq_printf(m, ",logbufs=%d", mp->m_logbufs); > if (mp->m_logbsize > 0) > - seq_printf(m, "," MNTOPT_LOGBSIZE "=%dk", mp->m_logbsize >> 10); > + seq_printf(m, ",logbsize=%dk", mp->m_logbsize >> 10); > > if (mp->m_logname) > - seq_show_option(m, MNTOPT_LOGDEV, mp->m_logname); > + seq_show_option(m, "logdev", mp->m_logname); > if (mp->m_rtname) > - seq_show_option(m, MNTOPT_RTDEV, mp->m_rtname); > + seq_show_option(m, "rtdev", mp->m_rtname); > > if (mp->m_dalign > 0) > - seq_printf(m, "," MNTOPT_SUNIT "=%d", > + seq_printf(m, ",sunit=%d", > (int)XFS_FSB_TO_BB(mp, mp->m_dalign)); > if (mp->m_swidth > 0) > - seq_printf(m, "," MNTOPT_SWIDTH "=%d", > + seq_printf(m, ",swidth=%d", > (int)XFS_FSB_TO_BB(mp, mp->m_swidth)); > > if (mp->m_qflags & (XFS_UQUOTA_ACCT|XFS_UQUOTA_ENFD)) > - seq_puts(m, "," MNTOPT_USRQUOTA); > + seq_puts(m, ",usrquota"); > else if (mp->m_qflags & XFS_UQUOTA_ACCT) > - seq_puts(m, "," MNTOPT_UQUOTANOENF); > + seq_puts(m, ",uqnoenforce"); > > if (mp->m_qflags & XFS_PQUOTA_ACCT) { > if (mp->m_qflags & XFS_PQUOTA_ENFD) > - seq_puts(m, "," MNTOPT_PRJQUOTA); > + seq_puts(m, ",prjquota"); > else > - seq_puts(m, "," MNTOPT_PQUOTANOENF); > + seq_puts(m, ",pqnoenforce"); > } > if (mp->m_qflags & XFS_GQUOTA_ACCT) { > if (mp->m_qflags & XFS_GQUOTA_ENFD) > - seq_puts(m, "," MNTOPT_GRPQUOTA); > + seq_puts(m, ",grpquota"); > else > - seq_puts(m, "," MNTOPT_GQUOTANOENF); > + seq_puts(m, ",gqnoenforce"); > } > > if (!(mp->m_qflags & XFS_ALL_QUOTA_ACCT)) > - seq_puts(m, "," MNTOPT_NOQUOTA); > + seq_puts(m, ",noquota"); > > return 0; > } > @@ -1344,9 +1346,8 @@ xfs_finish_flags( > */ > if (xfs_sb_version_hascrc(&mp->m_sb) && > (mp->m_flags & XFS_MOUNT_NOATTR2)) { > - xfs_warn(mp, > -"Cannot mount a V5 filesystem as %s. %s is always enabled for V5 filesystems.", > - MNTOPT_NOATTR2, MNTOPT_ATTR2); > + xfs_warn(mp, "Cannot mount a V5 filesystem as noattr2. " > + "attr2 is always enabled for V5 filesystems."); > return -EINVAL; > } > > > _______________________________________________ > xfs mailing list > xfs@oss.sgi.com > http://oss.sgi.com/mailman/listinfo/xfs From bfoster@redhat.com Mon Feb 15 12:54:28 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=ham version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay1.corp.sgi.com [137.38.102.111]) by oss.sgi.com (Postfix) with ESMTP id 334287CA2 for ; Mon, 15 Feb 2016 12:54:28 -0600 (CST) Received: from cuda.sgi.com (cuda1.sgi.com [192.48.157.11]) by relay1.corp.sgi.com (Postfix) with ESMTP id 05A558F8040 for ; Mon, 15 Feb 2016 10:54:27 -0800 (PST) X-ASG-Debug-ID: 1455562466-04bdf02d5c01a20001-NocioJ Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by cuda.sgi.com with ESMTP id 9quhLL7DiZjHJZ6C (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO) for ; Mon, 15 Feb 2016 10:54:27 -0800 (PST) X-Barracuda-Envelope-From: bfoster@redhat.com X-Barracuda-Apparent-Source-IP: 209.132.183.28 X-ASG-Whitelist: Client Received: from int-mx13.intmail.prod.int.phx2.redhat.com (int-mx13.intmail.prod.int.phx2.redhat.com [10.5.11.26]) by mx1.redhat.com (Postfix) with ESMTPS id CC046218F; Mon, 15 Feb 2016 18:54:26 +0000 (UTC) Received: from bfoster.bfoster (dhcp-41-164.bos.redhat.com [10.18.41.164]) by int-mx13.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id u1FIsQ0H016302; Mon, 15 Feb 2016 13:54:26 -0500 Received: by bfoster.bfoster (Postfix, from userid 1000) id 46788123DF8; Mon, 15 Feb 2016 13:54:25 -0500 (EST) Date: Mon, 15 Feb 2016 13:54:25 -0500 From: Brian Foster To: Eric Sandeen Cc: xfs@oss.sgi.com Subject: Re: [PATCH 2/3] xfs: sanitize remount options Message-ID: <20160215185424.GB33291@bfoster.bfoster> X-ASG-Orig-Subj: Re: [PATCH 2/3] xfs: sanitize remount options References: <56BBC982.50804@redhat.com> <56BBCA55.3000506@sandeen.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <56BBCA55.3000506@sandeen.net> User-Agent: Mutt/1.5.24 (2015-08-30) X-Scanned-By: MIMEDefang 2.68 on 10.5.11.26 X-Barracuda-Connect: mx1.redhat.com[209.132.183.28] X-Barracuda-Start-Time: 1455562467 X-Barracuda-Encrypted: ECDHE-RSA-AES256-GCM-SHA384 X-Barracuda-URL: https://192.48.157.11:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-BRTS-Status: 1 On Wed, Feb 10, 2016 at 05:40:05PM -0600, Eric Sandeen wrote: > Perform basic sanitization of remount options by > passing the option string and a dummy mount structure > through xfs_parseargs and returning the result. > > Signed-off-by: Eric Sandeen > --- > > diff --git a/fs/xfs/xfs_super.c b/fs/xfs/xfs_super.c > index 934233a..d1cd4fa 100644 > --- a/fs/xfs/xfs_super.c > +++ b/fs/xfs/xfs_super.c > @@ -1168,6 +1168,27 @@ xfs_quiesce_attr( > } > > STATIC int > +xfs_test_remount_options( > + struct super_block *sb, > + struct xfs_mount *mp, > + char *options) > +{ > + int error = 0; > + struct xfs_mount *tmp; > + > + tmp = kmem_zalloc(sizeof(*tmp), KM_MAYFAIL); > + if (!tmp) > + return -ENOMEM; > + > + tmp->m_super = sb; > + error = xfs_parseargs(tmp, options); > + xfs_free_fsname(tmp); > + kfree(tmp); > + > + return error; > +} This seems fine: Reviewed-by: Brian Foster ... though I get a little bit nervous about xfs_parseargs() changing some other data structure down the road. I wonder if we should constify the sb pointer in xfs_parseargs() with a quick comment as to why..? Brian > + > +STATIC int > xfs_fs_remount( > struct super_block *sb, > int *flags, > @@ -1179,6 +1200,11 @@ xfs_fs_remount( > char *p; > int error; > > + /* First, check for complete junk; i.e. invalid options */ > + error = xfs_test_remount_options(sb, mp, options); > + if (error) > + return error; > + > sync_filesystem(sb); > while ((p = strsep(&options, ",")) != NULL) { > int token; > > > _______________________________________________ > xfs mailing list > xfs@oss.sgi.com > http://oss.sgi.com/mailman/listinfo/xfs From bfoster@redhat.com Mon Feb 15 12:54:45 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=ham version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay3.corp.sgi.com [198.149.34.15]) by oss.sgi.com (Postfix) with ESMTP id 6FD397CA2 for ; Mon, 15 Feb 2016 12:54:45 -0600 (CST) Received: from cuda.sgi.com (cuda2.sgi.com [192.48.176.25]) by relay3.corp.sgi.com (Postfix) with ESMTP id E2B43AC004 for ; Mon, 15 Feb 2016 10:54:41 -0800 (PST) X-ASG-Debug-ID: 1455562479-04cbb04333fc490001-NocioJ Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by cuda.sgi.com with ESMTP id W1EibelYFPo3lrlX (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO) for ; Mon, 15 Feb 2016 10:54:40 -0800 (PST) X-Barracuda-Envelope-From: bfoster@redhat.com X-Barracuda-Apparent-Source-IP: 209.132.183.28 X-ASG-Whitelist: Client Received: from int-mx14.intmail.prod.int.phx2.redhat.com (int-mx14.intmail.prod.int.phx2.redhat.com [10.5.11.27]) by mx1.redhat.com (Postfix) with ESMTPS id BE2F7C0BBE49; Mon, 15 Feb 2016 18:54:39 +0000 (UTC) Received: from bfoster.bfoster (dhcp-41-164.bos.redhat.com [10.18.41.164]) by int-mx14.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id u1FIsduQ018719; Mon, 15 Feb 2016 13:54:39 -0500 Received: by bfoster.bfoster (Postfix, from userid 1000) id 2E52E123DF8; Mon, 15 Feb 2016 13:54:38 -0500 (EST) Date: Mon, 15 Feb 2016 13:54:38 -0500 From: Brian Foster To: Eric Sandeen Cc: xfs@oss.sgi.com Subject: Re: [PATCH 3/3] xfs: test for valid remount options, error if not Message-ID: <20160215185437.GC33291@bfoster.bfoster> X-ASG-Orig-Subj: Re: [PATCH 3/3] xfs: test for valid remount options, error if not References: <56BBC982.50804@redhat.com> <56BBCB9D.6080404@sandeen.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <56BBCB9D.6080404@sandeen.net> User-Agent: Mutt/1.5.24 (2015-08-30) X-Scanned-By: MIMEDefang 2.68 on 10.5.11.27 X-Barracuda-Connect: mx1.redhat.com[209.132.183.28] X-Barracuda-Start-Time: 1455562480 X-Barracuda-Encrypted: ECDHE-RSA-AES256-GCM-SHA384 X-Barracuda-URL: https://192.48.176.25:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-BRTS-Status: 1 On Wed, Feb 10, 2016 at 05:45:33PM -0600, Eric Sandeen wrote: > This patch attempts to check for a valid set of remount > options. As far as I can tell, it's tricky; as the old > comment says, on remount we may get a long string of > options from /proc/mounts and/or /etc/mtab, as well > as options specified on the commandline. Later options > may negate previous options, etc. > > At the most basic level, we may be handed a mount option > which we do not handle on remount, but which may not actually > be a change from the current mount option set. > > Unfortunately our mount option state is somewhat far flung; > a combinations of m_flags, and values in various other > mount structure members; see the showargs function for > a taste of that. > > So this extends xfs_test_remount_options() to do a full set > of mount processing of the options remount sees, to arrive > at a final state, then compares that state to the current > state, and determines if we can proceed. > > Signed-off-by: Eric Sandeen > --- > > This is lightly tested; mostly just a sanity check to see > if this approach is a "wtf?" or a "yeah, seems ok." > ... > diff --git a/fs/xfs/xfs_mount.h b/fs/xfs/xfs_mount.h > index a4e03ab..bee9284 100644 > --- a/fs/xfs/xfs_mount.h > +++ b/fs/xfs/xfs_mount.h > @@ -335,6 +335,7 @@ extern int xfs_sb_validate_fsb_count(struct xfs_sb *, __uint64_t); > > extern int xfs_dev_is_read_only(struct xfs_mount *, char *); > > +extern void xfs_set_rw_sizes(xfs_mount_t *); > extern void xfs_set_low_space_thresholds(struct xfs_mount *); > > int xfs_zero_extent(struct xfs_inode *ip, xfs_fsblock_t start_fsb, > diff --git a/fs/xfs/xfs_super.c b/fs/xfs/xfs_super.c > index d1cd4fa..50e15d8 100644 > --- a/fs/xfs/xfs_super.c > +++ b/fs/xfs/xfs_super.c ... > @@ -1167,24 +1169,87 @@ xfs_quiesce_attr( ... > STATIC int > xfs_test_remount_options( > struct super_block *sb, > struct xfs_mount *mp, > char *options) > { ... > + /* The only flags we can change on remount */ > + ok_flags = XFS_MOUNT_BARRIER | XFS_MOUNT_RDONLY | > + XFS_MOUNT_SMALL_INUMS | XFS_MOUNT_32BITINODES; Trailing whitespace at the end of the above line. > + /* This is only used internally, so OK as well */ > + ok_flags |= XFS_MOUNT_WAS_CLEAN; > + > + /* The flags that *did* change */ > + changed_flags = (tmp_mp->m_flags ^ mp->m_flags); > + > + error = -EINVAL; > + > + if (tmp_mp->m_qflags != mp->m_qflags) > + XFS_BAD_REMOUNT_GOTO(mp, "quota", out); > + > + if (tmp_mp->m_logbufs != mp->m_logbufs || > + tmp_mp->m_logbsize != mp->m_logbsize) > + XFS_BAD_REMOUNT_GOTO(mp, "logbufs/logbsize", out); > + > + if (tmp_mp->m_readio_log != mp->m_readio_log || > + tmp_mp->m_writeio_log != mp->m_writeio_log) > + XFS_BAD_REMOUNT_GOTO(mp, "allocsize/biosize", out); > + > + if ((tmp_mp->m_logname && mp->m_logname && > + strcmp(tmp_mp->m_logname, mp->m_logname)) || > + (tmp_mp->m_rtname && mp->m_rtname && > + strcmp(tmp_mp->m_rtname, mp->m_rtname))) > + XFS_BAD_REMOUNT_GOTO(mp, "logdev/rtdev", out); > + This warning won't trigger if rtname or logname is specified by the remount and the current mount doesn't have either set (because the current mp->m_logname == NULL, for example). I was also wondering why we can't just check these values against the defaults and complain if they are specified at all at remount time, but looking back at the commit log it sounds like we have to handle the case where a mount option string might essentially be copy/pasted from /proc/mounts and slightly tweaked with a valid change. Does something actually break if we don't handle that? Though I suppose if it works now we probably shouldn't break it. > + /* Catch-all for anything else */ > + if (changed_flags & ~ok_flags) > + XFS_BAD_REMOUNT_GOTO(mp, "specified", out); > + > + error = 0; > +out: > + xfs_free_fsname(tmp_mp); > + kfree(tmp_mp); > return error; > } > > @@ -1200,7 +1265,12 @@ xfs_fs_remount( > char *p; > int error; > > - /* First, check for complete junk; i.e. invalid options */ > + /* > + * Remounting is tricky; we get various combinations > + * of options, both pre-existing and changed, here. > + * This function tries to ensure that what we got > + * is a sane set for remounting, and errors if not. > + */ > error = xfs_test_remount_options(sb, mp, options); > if (error) > return error; > @@ -1228,28 +1298,13 @@ xfs_fs_remount( > break; > default: > /* > - * Logically we would return an error here to prevent > - * users from believing they might have changed > - * mount options using remount which can't be changed. > - * > - * But unfortunately mount(8) adds all options from > - * mtab and fstab to the mount arguments in some cases > - * so we can't blindly reject options, but have to > - * check for each specified option if it actually > - * differs from the currently set option and only > - * reject it if that's the case. > - * > - * Until that is implemented we return success for > - * every remount request, and silently ignore all > - * options that we can't actually change. > + * xfs_test_remount_options really should have errored > + * out on any non-remountable options; anything that got Trailing whitespace. Brian > + * here should be a no-op; a re-statement of existing > + * options. If something slipped through: too bad! > + * We'll just ignore it. > */ > -#if 0 > - xfs_info(mp, > - "mount option \"%s\" not supported for remount", p); > - return -EINVAL; > -#else > break; > -#endif > } > } > > > > _______________________________________________ > xfs mailing list > xfs@oss.sgi.com > http://oss.sgi.com/mailman/listinfo/xfs From bfoster@redhat.com Mon Feb 15 12:56:38 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=ham version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay3.corp.sgi.com [198.149.34.15]) by oss.sgi.com (Postfix) with ESMTP id 991807CA2 for ; Mon, 15 Feb 2016 12:56:38 -0600 (CST) Received: from cuda.sgi.com (cuda1.sgi.com [192.48.157.11]) by relay3.corp.sgi.com (Postfix) with ESMTP id 3AB75AC003 for ; Mon, 15 Feb 2016 10:56:38 -0800 (PST) X-ASG-Debug-ID: 1455562597-04bdf02d5e01ac0001-NocioJ Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by cuda.sgi.com with ESMTP id 48R6uDIfbS9g2SVo (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO) for ; Mon, 15 Feb 2016 10:56:37 -0800 (PST) X-Barracuda-Envelope-From: bfoster@redhat.com X-Barracuda-Apparent-Source-IP: 209.132.183.28 X-ASG-Whitelist: Client Received: from int-mx14.intmail.prod.int.phx2.redhat.com (int-mx14.intmail.prod.int.phx2.redhat.com [10.5.11.27]) by mx1.redhat.com (Postfix) with ESMTPS id 1669A19CBE9; Mon, 15 Feb 2016 18:56:37 +0000 (UTC) Received: from bfoster.bfoster (dhcp-41-164.bos.redhat.com [10.18.41.164]) by int-mx14.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id u1FIuaiB019580; Mon, 15 Feb 2016 13:56:36 -0500 Received: by bfoster.bfoster (Postfix, from userid 1000) id 5E69F123DF8; Mon, 15 Feb 2016 13:56:35 -0500 (EST) Date: Mon, 15 Feb 2016 13:56:35 -0500 From: Brian Foster To: Christoph Hellwig Cc: xfs@oss.sgi.com Subject: Re: [PATCH] xfs: remove xfs_trans_get_block_res Message-ID: <20160215185635.GD33291@bfoster.bfoster> X-ASG-Orig-Subj: Re: [PATCH] xfs: remove xfs_trans_get_block_res References: <1455365381-12592-1-git-send-email-hch@lst.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1455365381-12592-1-git-send-email-hch@lst.de> User-Agent: Mutt/1.5.24 (2015-08-30) X-Scanned-By: MIMEDefang 2.68 on 10.5.11.27 X-Barracuda-Connect: mx1.redhat.com[209.132.183.28] X-Barracuda-Start-Time: 1455562597 X-Barracuda-Encrypted: ECDHE-RSA-AES256-GCM-SHA384 X-Barracuda-URL: https://192.48.157.11:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-BRTS-Status: 1 On Sat, Feb 13, 2016 at 01:09:41PM +0100, Christoph Hellwig wrote: > Just use the t_blk_res field directly instead of obsfucating the reference > by a macro. > > Signed-off-by: Christoph Hellwig > --- Reviewed-by: Brian Foster > fs/xfs/libxfs/xfs_bmap.c | 6 +++--- > fs/xfs/libxfs/xfs_bmap_btree.c | 4 ++-- > fs/xfs/xfs_trans.h | 1 - > 3 files changed, 5 insertions(+), 6 deletions(-) > > diff --git a/fs/xfs/libxfs/xfs_bmap.c b/fs/xfs/libxfs/xfs_bmap.c > index 3e89e0e..a0fa2f5 100644 > --- a/fs/xfs/libxfs/xfs_bmap.c > +++ b/fs/xfs/libxfs/xfs_bmap.c > @@ -5707,7 +5707,7 @@ xfs_bunmapi( > * This is better than zeroing it. > */ > ASSERT(del.br_state == XFS_EXT_NORM); > - ASSERT(xfs_trans_get_block_res(tp) > 0); > + ASSERT(tp->t_blk_res > 0); > /* > * If this spans a realtime extent boundary, > * chop it back to the start of the one we end at. > @@ -5738,7 +5738,7 @@ xfs_bunmapi( > del.br_startblock += mod; > } else if ((del.br_startoff == start && > (del.br_state == XFS_EXT_UNWRITTEN || > - xfs_trans_get_block_res(tp) == 0)) || > + tp->t_blk_res == 0)) || > !xfs_sb_version_hasextflgbit(&mp->m_sb)) { > /* > * Can't make it unwritten. There isn't > @@ -5829,7 +5829,7 @@ xfs_bunmapi( > * conversion to btree format, since the transaction > * will be dirty. > */ > - if (!wasdel && xfs_trans_get_block_res(tp) == 0 && > + if (!wasdel && tp->t_blk_res == 0 && > XFS_IFORK_FORMAT(ip, whichfork) == XFS_DINODE_FMT_EXTENTS && > XFS_IFORK_NEXTENTS(ip, whichfork) >= /* Note the >= */ > XFS_IFORK_MAXEXT(ip, whichfork) && > diff --git a/fs/xfs/libxfs/xfs_bmap_btree.c b/fs/xfs/libxfs/xfs_bmap_btree.c > index 77a8c63..5dcbfae 100644 > --- a/fs/xfs/libxfs/xfs_bmap_btree.c > +++ b/fs/xfs/libxfs/xfs_bmap_btree.c > @@ -464,7 +464,7 @@ try_another_ag: > * reservation amount is insufficient then we may fail a > * block allocation here and corrupt the filesystem. > */ > - args.minleft = xfs_trans_get_block_res(args.tp); > + args.minleft = args.tp->t_blk_res; > } else if (cur->bc_private.b.flist->xbf_low) { > args.type = XFS_ALLOCTYPE_START_BNO; > } else { > @@ -473,7 +473,7 @@ try_another_ag: > > args.minlen = args.maxlen = args.prod = 1; > args.wasdel = cur->bc_private.b.flags & XFS_BTCUR_BPRV_WASDEL; > - if (!args.wasdel && xfs_trans_get_block_res(args.tp) == 0) { > + if (!args.wasdel && args.tp->t_blk_res == 0) { > error = -ENOSPC; > goto error0; > } > diff --git a/fs/xfs/xfs_trans.h b/fs/xfs/xfs_trans.h > index 50fe77e..d49dfef 100644 > --- a/fs/xfs/xfs_trans.h > +++ b/fs/xfs/xfs_trans.h > @@ -133,7 +133,6 @@ typedef struct xfs_trans { > * XFS transaction mechanism exported interfaces that are > * actually macros. > */ > -#define xfs_trans_get_block_res(tp) ((tp)->t_blk_res) > #define xfs_trans_set_sync(tp) ((tp)->t_flags |= XFS_TRANS_SYNC) > > #if defined(DEBUG) || defined(XFS_WARN) > -- > 2.1.4 > > _______________________________________________ > xfs mailing list > xfs@oss.sgi.com > http://oss.sgi.com/mailman/listinfo/xfs From bfoster@redhat.com Mon Feb 15 12:57:26 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=ham version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay1.corp.sgi.com [137.38.102.111]) by oss.sgi.com (Postfix) with ESMTP id 2B7877CA2 for ; Mon, 15 Feb 2016 12:57:26 -0600 (CST) Received: from cuda.sgi.com (cuda1.sgi.com [192.48.157.11]) by relay1.corp.sgi.com (Postfix) with ESMTP id F29F88F8049 for ; Mon, 15 Feb 2016 10:57:25 -0800 (PST) X-ASG-Debug-ID: 1455562644-04bdf02d5b01ae0001-NocioJ Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by cuda.sgi.com with ESMTP id rtAC1PlaAwBhxGLY (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO) for ; Mon, 15 Feb 2016 10:57:25 -0800 (PST) X-Barracuda-Envelope-From: bfoster@redhat.com X-Barracuda-Apparent-Source-IP: 209.132.183.28 X-ASG-Whitelist: Client Received: from int-mx13.intmail.prod.int.phx2.redhat.com (int-mx13.intmail.prod.int.phx2.redhat.com [10.5.11.26]) by mx1.redhat.com (Postfix) with ESMTPS id D92D18E222; Mon, 15 Feb 2016 18:57:24 +0000 (UTC) Received: from bfoster.bfoster (dhcp-41-164.bos.redhat.com [10.18.41.164]) by int-mx13.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id u1FIvODL017538; Mon, 15 Feb 2016 13:57:24 -0500 Received: by bfoster.bfoster (Postfix, from userid 1000) id 5E7CA123DF8; Mon, 15 Feb 2016 13:57:23 -0500 (EST) Date: Mon, 15 Feb 2016 13:57:23 -0500 From: Brian Foster To: Colin King Cc: Dave Chinner , xfs@oss.sgi.com, linux-kernel@vger.kernel.org Subject: Re: [PATCH] xfs: fix format specifier , should be %llx and not %llu Message-ID: <20160215185723.GE33291@bfoster.bfoster> X-ASG-Orig-Subj: Re: [PATCH] xfs: fix format specifier , should be %llx and not %llu References: <1455395182-4771-1-git-send-email-colin.king@canonical.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1455395182-4771-1-git-send-email-colin.king@canonical.com> User-Agent: Mutt/1.5.24 (2015-08-30) X-Scanned-By: MIMEDefang 2.68 on 10.5.11.26 X-Barracuda-Connect: mx1.redhat.com[209.132.183.28] X-Barracuda-Start-Time: 1455562645 X-Barracuda-Encrypted: ECDHE-RSA-AES256-GCM-SHA384 X-Barracuda-URL: https://192.48.157.11:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-BRTS-Status: 1 On Sat, Feb 13, 2016 at 08:26:22PM +0000, Colin King wrote: > From: Colin Ian King > > busyp->bno is printed with a %llu format specifier when the > intention is to print a hexadecimal value. Trivial fix to > use %llx instead. Found with smatch static analysis: > > fs/xfs/xfs_discard.c:229 xfs_discard_extents() warn: '0x' > prefix is confusing together with '%llu' specifier > > Signed-off-by: Colin Ian King > --- Reviewed-by: Brian Foster > fs/xfs/xfs_discard.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/fs/xfs/xfs_discard.c b/fs/xfs/xfs_discard.c > index e85a951..272c3f8 100644 > --- a/fs/xfs/xfs_discard.c > +++ b/fs/xfs/xfs_discard.c > @@ -227,7 +227,7 @@ xfs_discard_extents( > GFP_NOFS, 0); > if (error && error != -EOPNOTSUPP) { > xfs_info(mp, > - "discard failed for extent [0x%llu,%u], error %d", > + "discard failed for extent [0x%llx,%u], error %d", > (unsigned long long)busyp->bno, > busyp->length, > error); > -- > 2.7.0 > > _______________________________________________ > xfs mailing list > xfs@oss.sgi.com > http://oss.sgi.com/mailman/listinfo/xfs From prirun@gmail.com Mon Feb 15 13:28:43 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=FREEMAIL_FROM,T_DKIM_INVALID autolearn=ham version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay3.corp.sgi.com [198.149.34.15]) by oss.sgi.com (Postfix) with ESMTP id EEE627CA2 for ; Mon, 15 Feb 2016 13:28:42 -0600 (CST) Received: from cuda.sgi.com (cuda1.sgi.com [192.48.157.11]) by relay3.corp.sgi.com (Postfix) with ESMTP id 9F416AC003 for ; Mon, 15 Feb 2016 11:28:39 -0800 (PST) X-ASG-Debug-ID: 1455564516-04bdf02d5d02c40001-NocioJ Received: from mail-wm0-f46.google.com (mail-wm0-f46.google.com [74.125.82.46]) by cuda.sgi.com with ESMTP id aZVVD0BVe7EbLNDv (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128 verify=NO) for ; Mon, 15 Feb 2016 11:28:37 -0800 (PST) X-Barracuda-Envelope-From: prirun@gmail.com X-Barracuda-Apparent-Source-IP: 74.125.82.46 Received: by mail-wm0-f46.google.com with SMTP id g62so162093121wme.0 for ; Mon, 15 Feb 2016 11:28:37 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=zDMyIsE8Chma8Z5AS/lBoieMIzcAiYzg69TeOkHFt54=; b=P15Ifd+VK2PSi/I+1lMOxrtwQOjUudTz2yQ2TYhKUe2lSpP935cmmiONen4qpcbBlP LfEppcpdqvI4Fh8XcdOTSCRZG9K2VArE7cAx4ofMItYqlMCA2zBzze4e9mhcpPcu0lh6 NGb3P+naNev093mQ3G4xb+xivkSo1Ow3xzleBzWb2YPrC568oNq+PBMgVvbtnWOvFwzd h4JoxtPBhFQVN/mHnCZeYE/WqjZGJJqgg0bCvn7YPjnBaEV7i779lV3Bflmi4NaeeJLR vtAQr2j5xbSkQ0aIMjxph9u3bObbxILJF6sDv/C5NwM1Bhs0I8JWaEltKDy/yCGK5fEl qrRw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:date :message-id:subject:from:to:cc:content-type; bh=zDMyIsE8Chma8Z5AS/lBoieMIzcAiYzg69TeOkHFt54=; b=N5zd1YEiaG8i3ApGlnDrGHDoUn95h83eNOF+Xaw6ASkQJiEPQ0Ti8H9EMfuFjaEhso j6nBXvTwNzMz2EeMIe/v8jaTYk6Nb47Nls2tc7NnltLhcgYsWvUDk3QSuw17jcv3sxe7 XdjBw40Fn1bsq3RTRICki3urwTr/G+csjRBOdkwW2yWkLogbgmeVddz3oqvrpJr7HyVb tSA5gn34i0riZfl97lyooD6dGhFiED+tH4/3rq6TdL271uvEhqDkfIHvvW9rVBgPGrDj ydWtscgNtNySLvrWAH4zqSwdORytVndc7tDJQjt55+FDyUxZAXBN8zvI4+U5KRQ2XJpZ 7pqw== X-Gm-Message-State: AG10YOTG8NUsmCtOPEbShyYYoeAG08WSvbQdUWhute2X00T6nkN9sGFB5n5K6SgR5QTNojUgdNHT23hNcPnwPQ== MIME-Version: 1.0 X-Received: by 10.194.187.240 with SMTP id fv16mr21162259wjc.53.1455564516652; Mon, 15 Feb 2016 11:28:36 -0800 (PST) Received: by 10.27.212.144 with HTTP; Mon, 15 Feb 2016 11:28:36 -0800 (PST) In-Reply-To: <56C219F0.3050002@sandeen.net> References: <56C219F0.3050002@sandeen.net> Date: Mon, 15 Feb 2016 14:28:36 -0500 Message-ID: Subject: Re: XFS fiemap issue with Linux 3.10.0-327.el7.x86_64 (CentOS 7) From: Jim Wilcoxson X-ASG-Orig-Subj: Re: XFS fiemap issue with Linux 3.10.0-327.el7.x86_64 (CentOS 7) To: Eric Sandeen Cc: xfs@oss.sgi.com Content-Type: text/plain; charset=UTF-8 X-Barracuda-Connect: mail-wm0-f46.google.com[74.125.82.46] X-Barracuda-Start-Time: 1455564517 X-Barracuda-Encrypted: ECDHE-RSA-AES128-GCM-SHA256 X-Barracuda-URL: https://192.48.157.11:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-BRTS-Status: 1 X-Barracuda-Spam-Score: 0.00 X-Barracuda-Spam-Status: No, SCORE=0.00 using per-user scores of TAG_LEVEL=1000.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.7 tests=BSF_SC0_MISMATCH_TO, DKIM_SIGNED, DKIM_VERIFIED X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.3.27055 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 0.00 BSF_SC0_MISMATCH_TO Envelope rcpt doesn't match header -0.00 DKIM_VERIFIED Domain Keys Identified Mail: signature passes verification 0.00 DKIM_SIGNED Domain Keys Identified Mail: message has a signature Thanks Eric. I ran xfs_bmap -v and it returned extents 0-19999, alternating data with holes. The holes and data were various sizes, I suppose for xfs alignment reasons, but everything was there. Running fiemap again after xfs_bmap still returned 1364 extents. Fiemap only returns data extents, with holes implied, and comparing this to a seek_data/seek_hole map, they are identical as far as they go. The fiemap just poops out early, around the 5GB mark as I recall, but the file is 41GB. It appears broken to me. I appreciate the advice about things changing after the fiemap call. That's true of any backup that isn't of a snapshot, so it's usually a crap shoot in that regard. Jim On 2/15/16, Eric Sandeen wrote: > On 2/15/16 11:26 AM, Jim Wilcoxson wrote: >> I'm developing a backup program, HashBackup, and recently added sparse >> "hole skipping" using fiemap. > > That is probably not safe. Mapping can change immediately after fiemap > returns, and you could miss data. cp went down that path a few years ago, > and it caused pain. > > SEEK_HOLE/SEEK_DATA would be a better choice. > >> Today I ran into a weird issue with xfs >> on Linux 3.10. >> >> A test program creates a sparse file with 10000*(4K data, 4M hole). >> HB calls fiemap with start=0, length=0xFFFF...FFFF, mapped_extents=0 >> to get the number of extents. Fiemap is coming back with >> mapped_extents=1364 instead of 10000. > > Take a look at xfs_bmap -v output to get a clear picture of what > is actually on disk. It's possible that some combination of > speculative preallocation or other things has merged extents. > > In general, the kernel has plenty of leeway in terms of how it > chooses to lay out a file. "seek/write" doesn't necessarily > guarantee a hole. > >> The fiemap.txt file says: >> >> "If fm_extent_count is zero, then the fm_extents[] array is ignored >> (no extents will be returned), and the fm_mapped_extents count will >> hold the number of extents needed in fm_extents[] to hold the file's >> current mapping." >> >> It doesn't say the filesystem can choose to return fewer extents if it >> wants, but maybe xfs interprets it this way and fiemap has to be >> called in a loop until the extent_last flag is set. If that's the >> case, fiemap.txt should be updated. > > It's not clear that it is returning fewer extents. See what xfs_bmap > says, and compare. > > But also, don't use fiemap results for anything that requires > data integrity... > > -Eric > >> Thanks, >> Jim >> (not on the xfs mailing list) From david@fromorbit.com Mon Feb 15 14:26:25 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=ham version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay2.corp.sgi.com [137.38.102.29]) by oss.sgi.com (Postfix) with ESMTP id 5F25F7CA2 for ; Mon, 15 Feb 2016 14:26:25 -0600 (CST) Received: from cuda.sgi.com (cuda3.sgi.com [192.48.176.15]) by relay2.corp.sgi.com (Postfix) with ESMTP id 5054B304039 for ; Mon, 15 Feb 2016 12:26:22 -0800 (PST) X-ASG-Debug-ID: 1455567973-04cb6c1e59e5ac0001-NocioJ Received: from ipmail07.adl2.internode.on.net (ipmail07.adl2.internode.on.net [150.101.137.131]) by cuda.sgi.com with ESMTP id ak99udxQTn1eorG6 for ; Mon, 15 Feb 2016 12:26:14 -0800 (PST) X-Barracuda-Envelope-From: david@fromorbit.com X-Barracuda-Apparent-Source-IP: 150.101.137.131 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: A2D0BwDwM8JW/5bY03ZdgzqBP4Joo2YBAQEBAQEGi2yFRYQIhgcCAgEBAoE3TQEBAQEBAYELhEIBAQQnExwjEAgDGAklDwUlAyETiBm3HwEBAQcCAR0YhTGEfYhsBZZ5jUyBZYdphS+OPmKCAhmBXCguiE8BAQE Received: from ppp118-211-216-150.lns20.syd4.internode.on.net (HELO dastard) ([118.211.216.150]) by ipmail07.adl2.internode.on.net with ESMTP; 16 Feb 2016 06:55:34 +1030 Received: from dave by dastard with local (Exim 4.80) (envelope-from ) id 1aVPhx-00027W-MC; Tue, 16 Feb 2016 07:25:21 +1100 Date: Tue, 16 Feb 2016 07:25:21 +1100 From: Dave Chinner To: Eric Sandeen Cc: xfs@oss.sgi.com Subject: Re: [PATCH 3/3] xfs: test for valid remount options, error if not Message-ID: <20160215202521.GI14668@dastard> X-ASG-Orig-Subj: Re: [PATCH 3/3] xfs: test for valid remount options, error if not References: <56BBC982.50804@redhat.com> <56BBCB9D.6080404@sandeen.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <56BBCB9D.6080404@sandeen.net> User-Agent: Mutt/1.5.21 (2010-09-15) X-Barracuda-Connect: ipmail07.adl2.internode.on.net[150.101.137.131] X-Barracuda-Start-Time: 1455567973 X-Barracuda-URL: https://192.48.176.15:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-BRTS-Status: 1 X-Barracuda-Spam-Score: 0.00 X-Barracuda-Spam-Status: No, SCORE=0.00 using per-user scores of TAG_LEVEL=1000.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.7 tests=BSF_SC0_MISMATCH_TO X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.3.27056 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 0.00 BSF_SC0_MISMATCH_TO Envelope rcpt doesn't match header On Wed, Feb 10, 2016 at 05:45:33PM -0600, Eric Sandeen wrote: > This patch attempts to check for a valid set of remount > options. As far as I can tell, it's tricky; as the old > comment says, on remount we may get a long string of > options from /proc/mounts and/or /etc/mtab, as well > as options specified on the commandline. Later options > may negate previous options, etc. > > At the most basic level, we may be handed a mount option > which we do not handle on remount, but which may not actually > be a change from the current mount option set. > > Unfortunately our mount option state is somewhat far flung; > a combinations of m_flags, and values in various other > mount structure members; see the showargs function for > a taste of that. > > So this extends xfs_test_remount_options() to do a full set > of mount processing of the options remount sees, to arrive > at a final state, then compares that state to the current > state, and determines if we can proceed. > > Signed-off-by: Eric Sandeen > --- > > This is lightly tested; mostly just a sanity check to see > if this approach is a "wtf?" or a "yeah, seems ok." > > diff --git a/fs/xfs/xfs_mount.c b/fs/xfs/xfs_mount.c > index 986290c..3d4187c 100644 > --- a/fs/xfs/xfs_mount.c > +++ b/fs/xfs/xfs_mount.c > @@ -455,7 +455,7 @@ xfs_set_maxicount(xfs_mount_t *mp) > * We use smaller I/O sizes when the file system > * is being used for NFS service (wsync mount option). > */ > -STATIC void > +void > xfs_set_rw_sizes(xfs_mount_t *mp) > { > xfs_sb_t *sbp = &(mp->m_sb); > diff --git a/fs/xfs/xfs_mount.h b/fs/xfs/xfs_mount.h > index a4e03ab..bee9284 100644 > --- a/fs/xfs/xfs_mount.h > +++ b/fs/xfs/xfs_mount.h > @@ -335,6 +335,7 @@ extern int xfs_sb_validate_fsb_count(struct xfs_sb *, __uint64_t); > > extern int xfs_dev_is_read_only(struct xfs_mount *, char *); > > +extern void xfs_set_rw_sizes(xfs_mount_t *); > extern void xfs_set_low_space_thresholds(struct xfs_mount *); > > int xfs_zero_extent(struct xfs_inode *ip, xfs_fsblock_t start_fsb, > diff --git a/fs/xfs/xfs_super.c b/fs/xfs/xfs_super.c > index d1cd4fa..50e15d8 100644 > --- a/fs/xfs/xfs_super.c > +++ b/fs/xfs/xfs_super.c > @@ -65,6 +65,8 @@ static struct kset *xfs_kset; /* top-level xfs sysfs dir */ > static struct xfs_kobj xfs_dbg_kobj; /* global debug sysfs attrs */ > #endif > > +STATIC int xfs_finish_flags(struct xfs_mount *mp); > + > /* > * Table driven mount option parser. > */ > @@ -1167,24 +1169,87 @@ xfs_quiesce_attr( > xfs_log_quiesce(mp); > } > > +#define XFS_BAD_REMOUNT_GOTO(mp, option, l) \ > + { \ > + xfs_warn(mp, \ > + option " options may not be changed via remount"); \ > + goto l; \ > + } I think hiding a goto like this is wrong - it forces you to go read the macro, making the code harder to read and follow. Really, what's wrong with the simple and obvious: if (bad option) { bad_option = "bad option string"; goto out_warn; } ..... out_warn: xfs_warn(mp, "%s options may not be changed via remount", bad_option); // free stuff return -EINVAL; } Yes, I know that this sort of logic flow hiding was done with the XFS_WANT_CORRUPTED macros, but they were written back in 90s on Irix when using macros to implement everything were all the rage. Cheers, Dave. -- Dave Chinner david@fromorbit.com From david@fromorbit.com Mon Feb 15 14:40:49 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=ham version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay2.corp.sgi.com [137.38.102.29]) by oss.sgi.com (Postfix) with ESMTP id EA8007CA2 for ; Mon, 15 Feb 2016 14:40:49 -0600 (CST) Received: from cuda.sgi.com (cuda3.sgi.com [192.48.176.15]) by relay2.corp.sgi.com (Postfix) with ESMTP id ADD10304039 for ; Mon, 15 Feb 2016 12:40:49 -0800 (PST) X-ASG-Debug-ID: 1455568847-04cb6c1e58e5ee0001-NocioJ Received: from ipmail07.adl2.internode.on.net (ipmail07.adl2.internode.on.net [150.101.137.131]) by cuda.sgi.com with ESMTP id hB1HjRTdjmhbh4Zh for ; Mon, 15 Feb 2016 12:40:47 -0800 (PST) X-Barracuda-Envelope-From: david@fromorbit.com X-Barracuda-Apparent-Source-IP: 150.101.137.131 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: A2CYBgB3N8JW/5bY03ZdgzqBP6ZSBotsiU2GBwQCAoE3TQEBAQEBAYELhEIBAQQ6HCMQCAMOCgklDwUlAyETiBm3JAEBCAIBHRiFMYR9iGwFlnmNTI59RI16YoICGYFcKC6ITwEBAQ Received: from ppp118-211-216-150.lns20.syd4.internode.on.net (HELO dastard) ([118.211.216.150]) by ipmail07.adl2.internode.on.net with ESMTP; 16 Feb 2016 07:10:22 +1030 Received: from dave by dastard with local (Exim 4.80) (envelope-from ) id 1aVPwH-0002CG-PD; Tue, 16 Feb 2016 07:40:09 +1100 Date: Tue, 16 Feb 2016 07:40:09 +1100 From: Dave Chinner To: Jim Wilcoxson Cc: Eric Sandeen , xfs@oss.sgi.com Subject: Re: XFS fiemap issue with Linux 3.10.0-327.el7.x86_64 (CentOS 7) Message-ID: <20160215204009.GJ14668@dastard> X-ASG-Orig-Subj: Re: XFS fiemap issue with Linux 3.10.0-327.el7.x86_64 (CentOS 7) References: <56C219F0.3050002@sandeen.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.21 (2010-09-15) X-Barracuda-Connect: ipmail07.adl2.internode.on.net[150.101.137.131] X-Barracuda-Start-Time: 1455568847 X-Barracuda-URL: https://192.48.176.15:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-BRTS-Status: 1 X-Barracuda-Spam-Score: 0.00 X-Barracuda-Spam-Status: No, SCORE=0.00 using per-user scores of TAG_LEVEL=1000.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.7 tests=BSF_SC0_MISMATCH_TO X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.3.27056 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 0.00 BSF_SC0_MISMATCH_TO Envelope rcpt doesn't match header On Mon, Feb 15, 2016 at 02:28:36PM -0500, Jim Wilcoxson wrote: > Thanks Eric. > > I ran xfs_bmap -v and it returned extents 0-19999, alternating data > with holes. The holes and data were various sizes, I suppose for xfs > alignment reasons, but everything was there. > > Running fiemap again after xfs_bmap still returned 1364 extents. Yes, fiemap in XFS uses a buffer size of: bm.bmv_count = min_t(__s32, bm.bmv_count, (PAGE_SIZE * 16 / sizeof(struct getbmapx))); i.e. limits a single fiemap fetch to a maximum of 64k of extent data. I think you have an incorrect assumption about fiemap behaviour. fiemap is not designed to return or even count all the extents in a file in a single call; on XFS it returns how many extents it can return in a single call. When you then map the file, if the FIEMAP_EXTENT_LAST is not set on the last extent returned, then the application needs to make another FIEMAP call from the end offset of last extent mapping returned in the last call, and it will then return the next N extents in the file. IOWs, you have to keep calling FIEMAP to map the entire file, not assume a single call will return an arbitrary amount of data to you in a single call. But, as Eric said - fiemap is a diagnosis tool, not an interface you can rely on for anything involving data movement. Cheers, Dave. -- Dave Chinner david@fromorbit.com From darrick.wong@oracle.com Mon Feb 15 14:46:19 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay3.corp.sgi.com [198.149.34.15]) by oss.sgi.com (Postfix) with ESMTP id A70067CA2 for ; Mon, 15 Feb 2016 14:46:19 -0600 (CST) Received: from cuda.sgi.com (cuda2.sgi.com [192.48.176.25]) by relay3.corp.sgi.com (Postfix) with ESMTP id 39331AC002 for ; Mon, 15 Feb 2016 12:46:16 -0800 (PST) X-ASG-Debug-ID: 1455569173-04cbb04331fea00001-NocioJ Received: from aserp1040.oracle.com (aserp1040.oracle.com [141.146.126.69]) by cuda.sgi.com with ESMTP id 8ZmKervsCjxJvezd (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO) for ; Mon, 15 Feb 2016 12:46:14 -0800 (PST) X-Barracuda-Envelope-From: darrick.wong@oracle.com X-Barracuda-Apparent-Source-IP: 141.146.126.69 Received: from aserv0021.oracle.com (aserv0021.oracle.com [141.146.126.233]) by aserp1040.oracle.com (Sentrion-MTA-4.3.2/Sentrion-MTA-4.3.2) with ESMTP id u1FKkA7s006994 (version=TLSv1 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Mon, 15 Feb 2016 20:46:11 GMT Received: from aserv0121.oracle.com (aserv0121.oracle.com [141.146.126.235]) by aserv0021.oracle.com (8.13.8/8.13.8) with ESMTP id u1FKk9xH021413 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=FAIL); Mon, 15 Feb 2016 20:46:10 GMT Received: from abhmp0003.oracle.com (abhmp0003.oracle.com [141.146.116.9]) by aserv0121.oracle.com (8.13.8/8.13.8) with ESMTP id u1FKk9Hx013811; Mon, 15 Feb 2016 20:46:09 GMT Received: from localhost (/24.21.154.84) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Mon, 15 Feb 2016 12:46:09 -0800 Subject: [PATCH v4.3 0/3] xfstests: minor fixes for the reflink/dedupe tests From: "Darrick J. Wong" X-ASG-Orig-Subj: [PATCH v4.3 0/3] xfstests: minor fixes for the reflink/dedupe tests To: david@fromorbit.com, darrick.wong@oracle.com Cc: linux-btrfs@vger.kernel.org, fstests@vger.kernel.org, xfs@oss.sgi.com Date: Mon, 15 Feb 2016 12:46:08 -0800 Message-ID: <20160215204608.7977.2802.stgit@birch.djwong.org> User-Agent: StGit/0.17.1-dirty MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit X-Source-IP: aserv0021.oracle.com [141.146.126.233] X-Barracuda-Connect: aserp1040.oracle.com[141.146.126.69] X-Barracuda-Start-Time: 1455569174 X-Barracuda-Encrypted: ECDHE-RSA-AES256-GCM-SHA384 X-Barracuda-URL: https://192.48.176.25:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-BRTS-Status: 1 X-Barracuda-Spam-Score: 0.00 X-Barracuda-Spam-Status: No, SCORE=0.00 using per-user scores of TAG_LEVEL=1000.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.7 tests=BSF_SC0_MISMATCH_TO, UNPARSEABLE_RELAY X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.3.27056 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 0.00 BSF_SC0_MISMATCH_TO Envelope rcpt doesn't match header 0.00 UNPARSEABLE_RELAY Informational: message has unparseable relay lines This is a patch set against the reflink/dedupe test cases in xfstests. All three patches fix some minor problems in the giant testcase merge last weekend. The zeroth patch ought to be Filipe Manana's patch ("fstests: generic/158, test dedupe with destination offset past EOF") but as he just resent that this morning, I won't repost it here. The first patch, then, corrects the error output in the high offset dedupe test (generic/304). The second patch changes punch-alternating.c to use the filesystem accounting block size to determine where to punch holes in the file because that value is the internal filesystem block size. This makes the program behave as expected when testing with non-page-size block sizes on XFS. The third patch adds to _require_xfs_io_command the ability to check that a subcommand supports a particular command line argument and adds to xfs/24[356] the ability to check for the -c switch to the xfs_io bmap command. Comments and questions are, as always, welcome. The fixes are available on github[1]. --D [1] https://github.com/djwong/xfstests/tree/for-dave From darrick.wong@oracle.com Mon Feb 15 14:46:26 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay3.corp.sgi.com [198.149.34.15]) by oss.sgi.com (Postfix) with ESMTP id AAFC87CA2 for ; Mon, 15 Feb 2016 14:46:26 -0600 (CST) Received: from cuda.sgi.com (cuda1.sgi.com [192.48.157.11]) by relay3.corp.sgi.com (Postfix) with ESMTP id 43D59AC004 for ; Mon, 15 Feb 2016 12:46:26 -0800 (PST) X-ASG-Debug-ID: 1455569184-04bdf02d5c04880001-NocioJ Received: from aserp1040.oracle.com (aserp1040.oracle.com [141.146.126.69]) by cuda.sgi.com with ESMTP id oATAZtjgpU0G7XtK (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO) for ; Mon, 15 Feb 2016 12:46:24 -0800 (PST) X-Barracuda-Envelope-From: darrick.wong@oracle.com X-Barracuda-Apparent-Source-IP: 141.146.126.69 Received: from aserv0022.oracle.com (aserv0022.oracle.com [141.146.126.234]) by aserp1040.oracle.com (Sentrion-MTA-4.3.2/Sentrion-MTA-4.3.2) with ESMTP id u1FKkNBs007164 (version=TLSv1 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Mon, 15 Feb 2016 20:46:23 GMT Received: from userv0122.oracle.com (userv0122.oracle.com [156.151.31.75]) by aserv0022.oracle.com (8.13.8/8.13.8) with ESMTP id u1FKkNOD016927 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=FAIL); Mon, 15 Feb 2016 20:46:23 GMT Received: from abhmp0017.oracle.com (abhmp0017.oracle.com [141.146.116.23]) by userv0122.oracle.com (8.14.4/8.14.4) with ESMTP id u1FKkMCu021049; Mon, 15 Feb 2016 20:46:22 GMT Received: from localhost (/24.21.154.84) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Mon, 15 Feb 2016 12:46:22 -0800 Subject: [PATCH 2/3] punch-alternating: use the block size reported by the fs for punching From: "Darrick J. Wong" X-ASG-Orig-Subj: [PATCH 2/3] punch-alternating: use the block size reported by the fs for punching To: david@fromorbit.com, darrick.wong@oracle.com Cc: linux-btrfs@vger.kernel.org, fstests@vger.kernel.org, xfs@oss.sgi.com Date: Mon, 15 Feb 2016 12:46:21 -0800 Message-ID: <20160215204621.7977.91236.stgit@birch.djwong.org> In-Reply-To: <20160215204608.7977.2802.stgit@birch.djwong.org> References: <20160215204608.7977.2802.stgit@birch.djwong.org> User-Agent: StGit/0.17.1-dirty MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit X-Source-IP: aserv0022.oracle.com [141.146.126.234] X-Barracuda-Connect: aserp1040.oracle.com[141.146.126.69] X-Barracuda-Start-Time: 1455569184 X-Barracuda-Encrypted: ECDHE-RSA-AES256-GCM-SHA384 X-Barracuda-URL: https://192.48.157.11:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-BRTS-Status: 1 X-Barracuda-Spam-Score: 0.00 X-Barracuda-Spam-Status: No, SCORE=0.00 using per-user scores of TAG_LEVEL=1000.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.7 tests=BSF_SC0_MISMATCH_TO, UNPARSEABLE_RELAY X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.3.27056 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 0.00 BSF_SC0_MISMATCH_TO Envelope rcpt doesn't match header 0.00 UNPARSEABLE_RELAY Informational: message has unparseable relay lines When we're trying to punch alternating blocks out of a file, use the bsize reported by fstatfs so that we can punch out single blocks. Signed-off-by: Darrick J. Wong --- src/punch-alternating.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/punch-alternating.c b/src/punch-alternating.c index 9566310..4148622 100644 --- a/src/punch-alternating.c +++ b/src/punch-alternating.c @@ -14,6 +14,7 @@ int main(int argc, char *argv[]) { struct stat s; + struct statfs sf; off_t offset; int fd; blksize_t blksz; @@ -35,8 +36,12 @@ int main(int argc, char *argv[]) if (error) goto err; + error = fstatfs(fd, &sf); + if (error) + goto err; + sz = s.st_size; - blksz = s.st_blksize; + blksz = sf.f_bsize; mode = FALLOC_FL_PUNCH_HOLE | FALLOC_FL_KEEP_SIZE; for (offset = 0; offset < sz; offset += blksz * 2) { From darrick.wong@oracle.com Mon Feb 15 14:46:30 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay2.corp.sgi.com [137.38.102.29]) by oss.sgi.com (Postfix) with ESMTP id 5E01F7CA8 for ; Mon, 15 Feb 2016 14:46:30 -0600 (CST) Received: from cuda.sgi.com (cuda3.sgi.com [192.48.176.15]) by relay2.corp.sgi.com (Postfix) with ESMTP id 407D2304032 for ; Mon, 15 Feb 2016 12:46:30 -0800 (PST) X-ASG-Debug-ID: 1455569188-04cb6c1e56e6060001-NocioJ Received: from aserp1040.oracle.com (aserp1040.oracle.com [141.146.126.69]) by cuda.sgi.com with ESMTP id LUjTf2gddPaEEB5u (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO) for ; Mon, 15 Feb 2016 12:46:28 -0800 (PST) X-Barracuda-Envelope-From: darrick.wong@oracle.com X-Barracuda-Apparent-Source-IP: 141.146.126.69 Received: from aserv0021.oracle.com (aserv0021.oracle.com [141.146.126.233]) by aserp1040.oracle.com (Sentrion-MTA-4.3.2/Sentrion-MTA-4.3.2) with ESMTP id u1FKkRnr007218 (version=TLSv1 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Mon, 15 Feb 2016 20:46:28 GMT Received: from aserv0122.oracle.com (aserv0122.oracle.com [141.146.126.236]) by aserv0021.oracle.com (8.13.8/8.13.8) with ESMTP id u1FKkR4p021969 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=FAIL); Mon, 15 Feb 2016 20:46:27 GMT Received: from abhmp0009.oracle.com (abhmp0009.oracle.com [141.146.116.15]) by aserv0122.oracle.com (8.13.8/8.13.8) with ESMTP id u1FKkGXM029843; Mon, 15 Feb 2016 20:46:27 GMT Received: from localhost (/24.21.154.84) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Mon, 15 Feb 2016 12:46:15 -0800 Subject: [PATCH 1/3] generic/304: fix high offset From: "Darrick J. Wong" X-ASG-Orig-Subj: [PATCH 1/3] generic/304: fix high offset To: david@fromorbit.com, darrick.wong@oracle.com Cc: linux-btrfs@vger.kernel.org, fstests@vger.kernel.org, xfs@oss.sgi.com Date: Mon, 15 Feb 2016 12:46:14 -0800 Message-ID: <20160215204614.7977.2848.stgit@birch.djwong.org> In-Reply-To: <20160215204608.7977.2802.stgit@birch.djwong.org> References: <20160215204608.7977.2802.stgit@birch.djwong.org> User-Agent: StGit/0.17.1-dirty MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit X-Source-IP: aserv0021.oracle.com [141.146.126.233] X-Barracuda-Connect: aserp1040.oracle.com[141.146.126.69] X-Barracuda-Start-Time: 1455569188 X-Barracuda-Encrypted: ECDHE-RSA-AES256-GCM-SHA384 X-Barracuda-URL: https://192.48.176.15:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-BRTS-Status: 1 X-Barracuda-Spam-Score: 0.60 X-Barracuda-Spam-Status: No, SCORE=0.60 using per-user scores of TAG_LEVEL=1000.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.7 tests=BSF_SC0_MISMATCH_TO, MARKETING_SUBJECT, UNPARSEABLE_RELAY X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.3.27056 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 0.60 MARKETING_SUBJECT Subject contains popular marketing words 0.00 BSF_SC0_MISMATCH_TO Envelope rcpt doesn't match header 0.00 UNPARSEABLE_RELAY Informational: message has unparseable relay lines "Invalid argument" is a better response to an impossibly high offset dedupe request than "extents don't match", so change the test. Signed-off-by: Darrick J. Wong --- tests/generic/304.out | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/generic/304.out b/tests/generic/304.out index 4af2a39..7b5ff0e 100644 --- a/tests/generic/304.out +++ b/tests/generic/304.out @@ -8,7 +8,7 @@ dedupe: Invalid argument Dedupe past maximum file size in dest file (should fail) dedupe: Invalid argument Dedupe high offset to low offset -dedupe: Extents did not match. +dedupe: Invalid argument Dedupe past source file EOF (should fail) dedupe: Invalid argument Dedupe max size at nonzero offset (should fail) From darrick.wong@oracle.com Mon Feb 15 14:46:32 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay2.corp.sgi.com [137.38.102.29]) by oss.sgi.com (Postfix) with ESMTP id E626E7CA2 for ; Mon, 15 Feb 2016 14:46:32 -0600 (CST) Received: from cuda.sgi.com (cuda2.sgi.com [192.48.176.25]) by relay2.corp.sgi.com (Postfix) with ESMTP id C0588304032 for ; Mon, 15 Feb 2016 12:46:32 -0800 (PST) X-ASG-Debug-ID: 1455569190-04cbb04334fea30001-NocioJ Received: from userp1040.oracle.com (userp1040.oracle.com [156.151.31.81]) by cuda.sgi.com with ESMTP id p0Xqy9qw66SiiaSI (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO) for ; Mon, 15 Feb 2016 12:46:31 -0800 (PST) X-Barracuda-Envelope-From: darrick.wong@oracle.com X-Barracuda-Apparent-Source-IP: 156.151.31.81 Received: from userv0022.oracle.com (userv0022.oracle.com [156.151.31.74]) by userp1040.oracle.com (Sentrion-MTA-4.3.2/Sentrion-MTA-4.3.2) with ESMTP id u1FKkT67031160 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 15 Feb 2016 20:46:30 GMT Received: from aserv0121.oracle.com (aserv0121.oracle.com [141.146.126.235]) by userv0022.oracle.com (8.14.4/8.13.8) with ESMTP id u1FKkTeK003644 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=FAIL); Mon, 15 Feb 2016 20:46:29 GMT Received: from abhmp0005.oracle.com (abhmp0005.oracle.com [141.146.116.11]) by aserv0121.oracle.com (8.13.8/8.13.8) with ESMTP id u1FKkT9O013963; Mon, 15 Feb 2016 20:46:29 GMT Received: from localhost (/24.21.154.84) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Mon, 15 Feb 2016 12:46:28 -0800 Subject: [PATCH 3/3] xfs/24[356]: check for -c switch to xfs_io bmap command From: "Darrick J. Wong" X-ASG-Orig-Subj: [PATCH 3/3] xfs/24[356]: check for -c switch to xfs_io bmap command To: david@fromorbit.com, darrick.wong@oracle.com Cc: linux-btrfs@vger.kernel.org, fstests@vger.kernel.org, xfs@oss.sgi.com Date: Mon, 15 Feb 2016 12:46:27 -0800 Message-ID: <20160215204627.7977.93549.stgit@birch.djwong.org> In-Reply-To: <20160215204608.7977.2802.stgit@birch.djwong.org> References: <20160215204608.7977.2802.stgit@birch.djwong.org> User-Agent: StGit/0.17.1-dirty MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit X-Source-IP: userv0022.oracle.com [156.151.31.74] X-Barracuda-Connect: userp1040.oracle.com[156.151.31.81] X-Barracuda-Start-Time: 1455569191 X-Barracuda-Encrypted: ECDHE-RSA-AES256-GCM-SHA384 X-Barracuda-URL: https://192.48.176.25:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-BRTS-Status: 1 X-Barracuda-Spam-Score: 0.00 X-Barracuda-Spam-Status: No, SCORE=0.00 using per-user scores of TAG_LEVEL=1000.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.7 tests=BSF_SC0_MISMATCH_TO, UNPARSEABLE_RELAY X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.3.27056 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 0.00 BSF_SC0_MISMATCH_TO Envelope rcpt doesn't match header 0.00 UNPARSEABLE_RELAY Informational: message has unparseable relay lines Extend _require_xfs_io_command so that we can pass it a command line argument to look for, and then use new capabililty in the relevant tests to ensure that bmap knows how to dump CoW fork contents (bmap -c) Signed-off-by: Darrick J. Wong --- common/rc | 9 +++++++-- tests/xfs/243 | 1 + tests/xfs/245 | 1 + tests/xfs/246 | 1 + 4 files changed, 10 insertions(+), 2 deletions(-) diff --git a/common/rc b/common/rc index b11f170..e810062 100644 --- a/common/rc +++ b/common/rc @@ -1831,12 +1831,13 @@ _user_do() _require_xfs_io_command() { - if [ $# -ne 1 ] + if [ -z "$1" ] then - echo "Usage: _require_xfs_io_command command" 1>&2 + echo "Usage: _require_xfs_io_command command [switch]" 1>&2 exit 1 fi command=$1 + param=$2 testfile=$TEST_DIR/$$.xfs_io case $command in @@ -1866,6 +1867,10 @@ _require_xfs_io_command() _notrun "xfs_io $command support is missing" echo $testio | grep -q "Operation not supported" && \ _notrun "xfs_io $command failed (old kernel/wrong fs?)" + + test -z "$param" && return + $XFS_IO_PROG -c "help $command" | grep -q "^ $param --" || \ + _notrun "xfs_io $command doesn't support $param" } # check that xfs_db supports a specific command diff --git a/tests/xfs/243 b/tests/xfs/243 index 629173e..d75cfd8 100755 --- a/tests/xfs/243 +++ b/tests/xfs/243 @@ -56,6 +56,7 @@ _supported_fs xfs _require_scratch_reflink _require_xfs_io_command "falloc" _require_xfs_io_command "fpunch" +_require_xfs_io_command "bmap" "-c" _require_cp_reflink rm -f $seqres.full diff --git a/tests/xfs/245 b/tests/xfs/245 index 6da701d..7f80260 100755 --- a/tests/xfs/245 +++ b/tests/xfs/245 @@ -49,6 +49,7 @@ _supported_os Linux _supported_fs xfs _require_scratch_reflink _require_xfs_io_command "falloc" +_require_xfs_io_command "bmap" "-c" _require_cp_reflink rm -f $seqres.full diff --git a/tests/xfs/246 b/tests/xfs/246 index 13b0c98..bf471cc 100755 --- a/tests/xfs/246 +++ b/tests/xfs/246 @@ -42,6 +42,7 @@ _cleanup() # real QA test starts here _supported_os Linux _supported_fs xfs +_require_xfs_io_command "bmap" "-c" rm -f $seqres.full From sandeen@sandeen.net Mon Feb 15 15:20:53 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=ham version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay3.corp.sgi.com [198.149.34.15]) by oss.sgi.com (Postfix) with ESMTP id 9311E7CA2 for ; Mon, 15 Feb 2016 15:20:53 -0600 (CST) Received: from cuda.sgi.com (cuda2.sgi.com [192.48.176.25]) by relay3.corp.sgi.com (Postfix) with ESMTP id 08620AC004 for ; Mon, 15 Feb 2016 13:20:49 -0800 (PST) X-ASG-Debug-ID: 1455571244-04cbb04332ff5a0001-NocioJ Received: from sandeen.net (sandeen.net [63.231.237.45]) by cuda.sgi.com with ESMTP id Xpx6WAnI0NkibDbV for ; Mon, 15 Feb 2016 13:20:44 -0800 (PST) X-Barracuda-Envelope-From: sandeen@sandeen.net X-Barracuda-Apparent-Source-IP: 63.231.237.45 Received: from liberator.sandeen.net (liberator.sandeen.net [10.0.0.4]) (using TLSv1.2 with cipher DHE-RSA-AES128-SHA (128/128 bits)) (No client certificate requested) by sandeen.net (Postfix) with ESMTPSA id 36B7463C5FF0 for ; Mon, 15 Feb 2016 15:20:44 -0600 (CST) Subject: [PATCH 1/3 V2] xfs: convert mount option parsing to tokens To: xfs@oss.sgi.com X-ASG-Orig-Subj: [PATCH 1/3 V2] xfs: convert mount option parsing to tokens References: <56BBC982.50804@redhat.com> <56BBC9E6.5030100@sandeen.net> From: Eric Sandeen Message-ID: <56C2412B.9040603@sandeen.net> Date: Mon, 15 Feb 2016 15:20:43 -0600 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.11; rv:38.0) Gecko/20100101 Thunderbird/38.5.1 MIME-Version: 1.0 In-Reply-To: <56BBC9E6.5030100@sandeen.net> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit X-Barracuda-Connect: sandeen.net[63.231.237.45] X-Barracuda-Start-Time: 1455571244 X-Barracuda-URL: https://192.48.176.25:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-BRTS-Status: 1 X-Barracuda-Spam-Score: 0.00 X-Barracuda-Spam-Status: No, SCORE=0.00 using per-user scores of TAG_LEVEL=1000.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.7 tests= X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.3.27057 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- This should be a no-op change, just switch to token parsing like every other respectable filesystem does. Signed-off-by: Eric Sandeen Reviewed-by: Brian Foster --- V2: Whitespace fixes, remove extraneous break-after-return. diff --git a/fs/xfs/xfs_super.c b/fs/xfs/xfs_super.c index 59c9b7b..9b2e268 100644 --- a/fs/xfs/xfs_super.c +++ b/fs/xfs/xfs_super.c @@ -65,83 +65,82 @@ static struct kset *xfs_kset; /* top-level xfs sysfs dir */ static struct xfs_kobj xfs_dbg_kobj; /* global debug sysfs attrs */ #endif -#define MNTOPT_LOGBUFS "logbufs" /* number of XFS log buffers */ -#define MNTOPT_LOGBSIZE "logbsize" /* size of XFS log buffers */ -#define MNTOPT_LOGDEV "logdev" /* log device */ -#define MNTOPT_RTDEV "rtdev" /* realtime I/O device */ -#define MNTOPT_BIOSIZE "biosize" /* log2 of preferred buffered io size */ -#define MNTOPT_WSYNC "wsync" /* safe-mode nfs compatible mount */ -#define MNTOPT_NOALIGN "noalign" /* turn off stripe alignment */ -#define MNTOPT_SWALLOC "swalloc" /* turn on stripe width allocation */ -#define MNTOPT_SUNIT "sunit" /* data volume stripe unit */ -#define MNTOPT_SWIDTH "swidth" /* data volume stripe width */ -#define MNTOPT_NOUUID "nouuid" /* ignore filesystem UUID */ -#define MNTOPT_MTPT "mtpt" /* filesystem mount point */ -#define MNTOPT_GRPID "grpid" /* group-ID from parent directory */ -#define MNTOPT_NOGRPID "nogrpid" /* group-ID from current process */ -#define MNTOPT_BSDGROUPS "bsdgroups" /* group-ID from parent directory */ -#define MNTOPT_SYSVGROUPS "sysvgroups" /* group-ID from current process */ -#define MNTOPT_ALLOCSIZE "allocsize" /* preferred allocation size */ -#define MNTOPT_NORECOVERY "norecovery" /* don't run XFS recovery */ -#define MNTOPT_BARRIER "barrier" /* use writer barriers for log write and - * unwritten extent conversion */ -#define MNTOPT_NOBARRIER "nobarrier" /* .. disable */ -#define MNTOPT_64BITINODE "inode64" /* inodes can be allocated anywhere */ -#define MNTOPT_32BITINODE "inode32" /* inode allocation limited to - * XFS_MAXINUMBER_32 */ -#define MNTOPT_IKEEP "ikeep" /* do not free empty inode clusters */ -#define MNTOPT_NOIKEEP "noikeep" /* free empty inode clusters */ -#define MNTOPT_LARGEIO "largeio" /* report large I/O sizes in stat() */ -#define MNTOPT_NOLARGEIO "nolargeio" /* do not report large I/O sizes - * in stat(). */ -#define MNTOPT_ATTR2 "attr2" /* do use attr2 attribute format */ -#define MNTOPT_NOATTR2 "noattr2" /* do not use attr2 attribute format */ -#define MNTOPT_FILESTREAM "filestreams" /* use filestreams allocator */ -#define MNTOPT_QUOTA "quota" /* disk quotas (user) */ -#define MNTOPT_NOQUOTA "noquota" /* no quotas */ -#define MNTOPT_USRQUOTA "usrquota" /* user quota enabled */ -#define MNTOPT_GRPQUOTA "grpquota" /* group quota enabled */ -#define MNTOPT_PRJQUOTA "prjquota" /* project quota enabled */ -#define MNTOPT_UQUOTA "uquota" /* user quota (IRIX variant) */ -#define MNTOPT_GQUOTA "gquota" /* group quota (IRIX variant) */ -#define MNTOPT_PQUOTA "pquota" /* project quota (IRIX variant) */ -#define MNTOPT_UQUOTANOENF "uqnoenforce"/* user quota limit enforcement */ -#define MNTOPT_GQUOTANOENF "gqnoenforce"/* group quota limit enforcement */ -#define MNTOPT_PQUOTANOENF "pqnoenforce"/* project quota limit enforcement */ -#define MNTOPT_QUOTANOENF "qnoenforce" /* same as uqnoenforce */ -#define MNTOPT_DISCARD "discard" /* Discard unused blocks */ -#define MNTOPT_NODISCARD "nodiscard" /* Do not discard unused blocks */ - -#define MNTOPT_DAX "dax" /* Enable direct access to bdev pages */ - /* * Table driven mount option parser. - * - * Currently only used for remount, but it will be used for mount - * in the future, too. */ enum { - Opt_barrier, - Opt_nobarrier, - Opt_inode64, - Opt_inode32, - Opt_err + Opt_logbufs, Opt_logbsize, Opt_logdev, Opt_rtdev, Opt_biosize, + Opt_wsync, Opt_noalign, Opt_swalloc, Opt_sunit, Opt_swidth, Opt_nouuid, + Opt_mtpt, Opt_grpid, Opt_nogrpid, Opt_bsdgroups, Opt_sysvgroups, + Opt_allocsize, Opt_norecovery, Opt_barrier, Opt_nobarrier, + Opt_inode64, Opt_inode32, Opt_ikeep, Opt_noikeep, + Opt_largeio, Opt_nolargeio, Opt_attr2, Opt_noattr2, Opt_filestreams, + Opt_quota, Opt_noquota, Opt_usrquota, Opt_grpquota, Opt_prjquota, + Opt_uquota, Opt_gquota, Opt_pquota, + Opt_uqnoenforce, Opt_gqnoenforce, Opt_pqnoenforce, Opt_qnoenforce, + Opt_discard, Opt_nodiscard, Opt_dax, Opt_err, }; static const match_table_t tokens = { - {Opt_barrier, "barrier"}, - {Opt_nobarrier, "nobarrier"}, - {Opt_inode64, "inode64"}, - {Opt_inode32, "inode32"}, - {Opt_err, NULL} + {Opt_logbufs, "logbufs=%u"}, /* number of XFS log buffers */ + {Opt_logbsize, "logbsize=%s"}, /* size of XFS log buffers */ + {Opt_logdev, "logdev=%s"}, /* log device */ + {Opt_rtdev, "rtdev=%s"}, /* realtime I/O device */ + {Opt_biosize, "biosize=%u"}, /* log2 of preferred buffered io size */ + {Opt_wsync, "wsync"}, /* safe-mode nfs compatible mount */ + {Opt_noalign, "noalign"}, /* turn off stripe alignment */ + {Opt_swalloc, "swalloc"}, /* turn on stripe width allocation */ + {Opt_sunit, "sunit=%u"}, /* data volume stripe unit */ + {Opt_swidth, "swidth=%u"}, /* data volume stripe width */ + {Opt_nouuid, "nouuid"}, /* ignore filesystem UUID */ + {Opt_mtpt, "mtpt"}, /* filesystem mount point */ + {Opt_grpid, "grpid"}, /* group-ID from parent directory */ + {Opt_nogrpid, "nogrpid"}, /* group-ID from current process */ + {Opt_bsdgroups, "bsdgroups"}, /* group-ID from parent directory */ + {Opt_sysvgroups,"sysvgroups"}, /* group-ID from current process */ + {Opt_allocsize, "allocsize=%s"},/* preferred allocation size */ + {Opt_norecovery,"norecovery"}, /* don't run XFS recovery */ + {Opt_barrier, "barrier"}, /* use writer barriers for log write and + * unwritten extent conversion */ + {Opt_nobarrier, "nobarrier"}, /* .. disable */ + {Opt_inode64, "inode64"}, /* inodes can be allocated anywhere */ + {Opt_inode32, "inode32"}, /* inode allocation limited to + * XFS_MAXINUMBER_32 */ + {Opt_ikeep, "ikeep"}, /* do not free empty inode clusters */ + {Opt_noikeep, "noikeep"}, /* free empty inode clusters */ + {Opt_largeio, "largeio"}, /* report large I/O sizes in stat() */ + {Opt_nolargeio, "nolargeio"}, /* do not report large I/O sizes + * in stat(). */ + {Opt_attr2, "attr2"}, /* do use attr2 attribute format */ + {Opt_noattr2, "noattr2"}, /* do not use attr2 attribute format */ + {Opt_filestreams,"filestreams"},/* use filestreams allocator */ + {Opt_quota, "quota"}, /* disk quotas (user) */ + {Opt_noquota, "noquota"}, /* no quotas */ + {Opt_usrquota, "usrquota"}, /* user quota enabled */ + {Opt_grpquota, "grpquota"}, /* group quota enabled */ + {Opt_prjquota, "prjquota"}, /* project quota enabled */ + {Opt_uquota, "uquota"}, /* user quota (IRIX variant) */ + {Opt_gquota, "gquota"}, /* group quota (IRIX variant) */ + {Opt_pquota, "pquota"}, /* project quota (IRIX variant) */ + {Opt_uqnoenforce,"uqnoenforce"},/* user quota limit enforcement */ + {Opt_gqnoenforce,"gqnoenforce"},/* group quota limit enforcement */ + {Opt_pqnoenforce,"pqnoenforce"},/* project quota limit enforcement */ + {Opt_qnoenforce, "qnoenforce"}, /* same as uqnoenforce */ + {Opt_discard, "discard"}, /* Discard unused blocks */ + {Opt_nodiscard, "nodiscard"}, /* Do not discard unused blocks */ + + {Opt_dax, "dax"}, /* Enable direct access to bdev pages */ + {Opt_err, NULL}, }; STATIC int -suffix_kstrtoint(char *s, unsigned int base, int *res) +suffix_kstrtoint(const substring_t *s, unsigned int base, int *res) { int last, shift_left_factor = 0, _res; - char *value = s; + char *value = match_strdup(s); + int ret = 0; + last = strlen(value) - 1; if (value[last] == 'K' || value[last] == 'k') { @@ -157,10 +156,11 @@ suffix_kstrtoint(char *s, unsigned int base, int *res) value[last] = '\0'; } - if (kstrtoint(s, base, &_res)) - return -EINVAL; + if (kstrtoint(value, base, &_res)) + ret = -EINVAL; + kfree(value); *res = _res << shift_left_factor; - return 0; + return ret; } /* @@ -176,7 +176,8 @@ xfs_parseargs( char *options) { struct super_block *sb = mp->m_super; - char *this_char, *value; + char *p; + substring_t args[MAX_OPT_ARGS]; int dsunit = 0; int dswidth = 0; int iosize = 0; @@ -217,152 +218,152 @@ xfs_parseargs( if (!options) goto done; - while ((this_char = strsep(&options, ",")) != NULL) { - if (!*this_char) + while ((p = strsep(&options, ",")) != NULL) { + int token; + + if (!*p) continue; - if ((value = strchr(this_char, '=')) != NULL) - *value++ = 0; - if (!strcmp(this_char, MNTOPT_LOGBUFS)) { - if (!value || !*value) { - xfs_warn(mp, "%s option requires an argument", - this_char); - return -EINVAL; - } - if (kstrtoint(value, 10, &mp->m_logbufs)) - return -EINVAL; - } else if (!strcmp(this_char, MNTOPT_LOGBSIZE)) { - if (!value || !*value) { - xfs_warn(mp, "%s option requires an argument", - this_char); - return -EINVAL; - } - if (suffix_kstrtoint(value, 10, &mp->m_logbsize)) + token = match_token(p, tokens, args); + switch (token) { + case Opt_logbufs: + if (match_int(args, &mp->m_logbufs)) return -EINVAL; - } else if (!strcmp(this_char, MNTOPT_LOGDEV)) { - if (!value || !*value) { - xfs_warn(mp, "%s option requires an argument", - this_char); + break; + case Opt_logbsize: + if (suffix_kstrtoint(args, 10, &mp->m_logbsize)) return -EINVAL; - } - mp->m_logname = kstrndup(value, MAXNAMELEN, GFP_KERNEL); + break; + case Opt_logdev: + mp->m_logname = match_strdup(args); if (!mp->m_logname) return -ENOMEM; - } else if (!strcmp(this_char, MNTOPT_MTPT)) { - xfs_warn(mp, "%s option not allowed on this system", - this_char); + break; + case Opt_mtpt: + xfs_warn(mp, "%s option not allowed on this system", p); return -EINVAL; - } else if (!strcmp(this_char, MNTOPT_RTDEV)) { - if (!value || !*value) { - xfs_warn(mp, "%s option requires an argument", - this_char); - return -EINVAL; - } - mp->m_rtname = kstrndup(value, MAXNAMELEN, GFP_KERNEL); + case Opt_rtdev: + mp->m_rtname = match_strdup(args); if (!mp->m_rtname) return -ENOMEM; - } else if (!strcmp(this_char, MNTOPT_ALLOCSIZE) || - !strcmp(this_char, MNTOPT_BIOSIZE)) { - if (!value || !*value) { - xfs_warn(mp, "%s option requires an argument", - this_char); - return -EINVAL; - } - if (suffix_kstrtoint(value, 10, &iosize)) + break; + case Opt_allocsize: + case Opt_biosize: + if (suffix_kstrtoint(args, 10, &iosize)) return -EINVAL; iosizelog = ffs(iosize) - 1; - } else if (!strcmp(this_char, MNTOPT_GRPID) || - !strcmp(this_char, MNTOPT_BSDGROUPS)) { + break; + case Opt_grpid: + case Opt_bsdgroups: mp->m_flags |= XFS_MOUNT_GRPID; - } else if (!strcmp(this_char, MNTOPT_NOGRPID) || - !strcmp(this_char, MNTOPT_SYSVGROUPS)) { + break; + case Opt_nogrpid: + case Opt_sysvgroups: mp->m_flags &= ~XFS_MOUNT_GRPID; - } else if (!strcmp(this_char, MNTOPT_WSYNC)) { + break; + case Opt_wsync: mp->m_flags |= XFS_MOUNT_WSYNC; - } else if (!strcmp(this_char, MNTOPT_NORECOVERY)) { + break; + case Opt_norecovery: mp->m_flags |= XFS_MOUNT_NORECOVERY; - } else if (!strcmp(this_char, MNTOPT_NOALIGN)) { + break; + case Opt_noalign: mp->m_flags |= XFS_MOUNT_NOALIGN; - } else if (!strcmp(this_char, MNTOPT_SWALLOC)) { + break; + case Opt_swalloc: mp->m_flags |= XFS_MOUNT_SWALLOC; - } else if (!strcmp(this_char, MNTOPT_SUNIT)) { - if (!value || !*value) { - xfs_warn(mp, "%s option requires an argument", - this_char); - return -EINVAL; - } - if (kstrtoint(value, 10, &dsunit)) - return -EINVAL; - } else if (!strcmp(this_char, MNTOPT_SWIDTH)) { - if (!value || !*value) { - xfs_warn(mp, "%s option requires an argument", - this_char); + break; + case Opt_sunit: + if (match_int(args, &dsunit)) return -EINVAL; - } - if (kstrtoint(value, 10, &dswidth)) + break; + case Opt_swidth: + if (match_int(args, &dswidth)) return -EINVAL; - } else if (!strcmp(this_char, MNTOPT_32BITINODE)) { + break; + case Opt_inode32: mp->m_flags |= XFS_MOUNT_SMALL_INUMS; - } else if (!strcmp(this_char, MNTOPT_64BITINODE)) { + break; + case Opt_inode64: mp->m_flags &= ~XFS_MOUNT_SMALL_INUMS; - } else if (!strcmp(this_char, MNTOPT_NOUUID)) { + break; + case Opt_nouuid: mp->m_flags |= XFS_MOUNT_NOUUID; - } else if (!strcmp(this_char, MNTOPT_BARRIER)) { + break; + case Opt_barrier: mp->m_flags |= XFS_MOUNT_BARRIER; - } else if (!strcmp(this_char, MNTOPT_NOBARRIER)) { + break; + case Opt_nobarrier: mp->m_flags &= ~XFS_MOUNT_BARRIER; - } else if (!strcmp(this_char, MNTOPT_IKEEP)) { + break; + case Opt_ikeep: mp->m_flags |= XFS_MOUNT_IKEEP; - } else if (!strcmp(this_char, MNTOPT_NOIKEEP)) { + break; + case Opt_noikeep: mp->m_flags &= ~XFS_MOUNT_IKEEP; - } else if (!strcmp(this_char, MNTOPT_LARGEIO)) { + break; + case Opt_largeio: mp->m_flags &= ~XFS_MOUNT_COMPAT_IOSIZE; - } else if (!strcmp(this_char, MNTOPT_NOLARGEIO)) { + break; + case Opt_nolargeio: mp->m_flags |= XFS_MOUNT_COMPAT_IOSIZE; - } else if (!strcmp(this_char, MNTOPT_ATTR2)) { + break; + case Opt_attr2: mp->m_flags |= XFS_MOUNT_ATTR2; - } else if (!strcmp(this_char, MNTOPT_NOATTR2)) { + break; + case Opt_noattr2: mp->m_flags &= ~XFS_MOUNT_ATTR2; mp->m_flags |= XFS_MOUNT_NOATTR2; - } else if (!strcmp(this_char, MNTOPT_FILESTREAM)) { + break; + case Opt_filestreams: mp->m_flags |= XFS_MOUNT_FILESTREAMS; - } else if (!strcmp(this_char, MNTOPT_NOQUOTA)) { + break; + case Opt_noquota: mp->m_qflags &= ~XFS_ALL_QUOTA_ACCT; mp->m_qflags &= ~XFS_ALL_QUOTA_ENFD; mp->m_qflags &= ~XFS_ALL_QUOTA_ACTIVE; - } else if (!strcmp(this_char, MNTOPT_QUOTA) || - !strcmp(this_char, MNTOPT_UQUOTA) || - !strcmp(this_char, MNTOPT_USRQUOTA)) { + break; + case Opt_quota: + case Opt_uquota: + case Opt_usrquota: mp->m_qflags |= (XFS_UQUOTA_ACCT | XFS_UQUOTA_ACTIVE | XFS_UQUOTA_ENFD); - } else if (!strcmp(this_char, MNTOPT_QUOTANOENF) || - !strcmp(this_char, MNTOPT_UQUOTANOENF)) { + break; + case Opt_qnoenforce: + case Opt_uqnoenforce: mp->m_qflags |= (XFS_UQUOTA_ACCT | XFS_UQUOTA_ACTIVE); mp->m_qflags &= ~XFS_UQUOTA_ENFD; - } else if (!strcmp(this_char, MNTOPT_PQUOTA) || - !strcmp(this_char, MNTOPT_PRJQUOTA)) { + break; + case Opt_pquota: + case Opt_prjquota: mp->m_qflags |= (XFS_PQUOTA_ACCT | XFS_PQUOTA_ACTIVE | XFS_PQUOTA_ENFD); - } else if (!strcmp(this_char, MNTOPT_PQUOTANOENF)) { + break; + case Opt_pqnoenforce: mp->m_qflags |= (XFS_PQUOTA_ACCT | XFS_PQUOTA_ACTIVE); mp->m_qflags &= ~XFS_PQUOTA_ENFD; - } else if (!strcmp(this_char, MNTOPT_GQUOTA) || - !strcmp(this_char, MNTOPT_GRPQUOTA)) { + case Opt_gquota: + case Opt_grpquota: mp->m_qflags |= (XFS_GQUOTA_ACCT | XFS_GQUOTA_ACTIVE | XFS_GQUOTA_ENFD); - } else if (!strcmp(this_char, MNTOPT_GQUOTANOENF)) { + break; + case Opt_gqnoenforce: mp->m_qflags |= (XFS_GQUOTA_ACCT | XFS_GQUOTA_ACTIVE); mp->m_qflags &= ~XFS_GQUOTA_ENFD; - } else if (!strcmp(this_char, MNTOPT_DISCARD)) { + break; + case Opt_discard: mp->m_flags |= XFS_MOUNT_DISCARD; - } else if (!strcmp(this_char, MNTOPT_NODISCARD)) { + break; + case Opt_nodiscard: mp->m_flags &= ~XFS_MOUNT_DISCARD; + break; #ifdef CONFIG_FS_DAX - } else if (!strcmp(this_char, MNTOPT_DAX)) { + case Opt_dax: mp->m_flags |= XFS_MOUNT_DAX; + break; #endif - } else { - xfs_warn(mp, "unknown mount option [%s].", this_char); + default: + xfs_warn(mp, "unknown mount option [%s].", p); return -EINVAL; } } @@ -461,25 +462,25 @@ xfs_showargs( { static struct proc_xfs_info xfs_info_set[] = { /* the few simple ones we can get from the mount struct */ - { XFS_MOUNT_IKEEP, "," MNTOPT_IKEEP }, - { XFS_MOUNT_WSYNC, "," MNTOPT_WSYNC }, - { XFS_MOUNT_NOALIGN, "," MNTOPT_NOALIGN }, - { XFS_MOUNT_SWALLOC, "," MNTOPT_SWALLOC }, - { XFS_MOUNT_NOUUID, "," MNTOPT_NOUUID }, - { XFS_MOUNT_NORECOVERY, "," MNTOPT_NORECOVERY }, - { XFS_MOUNT_ATTR2, "," MNTOPT_ATTR2 }, - { XFS_MOUNT_FILESTREAMS, "," MNTOPT_FILESTREAM }, - { XFS_MOUNT_GRPID, "," MNTOPT_GRPID }, - { XFS_MOUNT_DISCARD, "," MNTOPT_DISCARD }, - { XFS_MOUNT_SMALL_INUMS, "," MNTOPT_32BITINODE }, - { XFS_MOUNT_DAX, "," MNTOPT_DAX }, + { XFS_MOUNT_IKEEP, ",ikeep" }, + { XFS_MOUNT_WSYNC, ",wsync" }, + { XFS_MOUNT_NOALIGN, ",noalign" }, + { XFS_MOUNT_SWALLOC, ",swalloc" }, + { XFS_MOUNT_NOUUID, ",nouuid" }, + { XFS_MOUNT_NORECOVERY, ",norecovery" }, + { XFS_MOUNT_ATTR2, ",attr2" }, + { XFS_MOUNT_FILESTREAMS, ",filestreams" }, + { XFS_MOUNT_GRPID, ",grpid" }, + { XFS_MOUNT_DISCARD, ",discard" }, + { XFS_MOUNT_SMALL_INUMS, ",inode32" }, + { XFS_MOUNT_DAX, ",dax" }, { 0, NULL } }; static struct proc_xfs_info xfs_info_unset[] = { /* the few simple ones we can get from the mount struct */ - { XFS_MOUNT_COMPAT_IOSIZE, "," MNTOPT_LARGEIO }, - { XFS_MOUNT_BARRIER, "," MNTOPT_NOBARRIER }, - { XFS_MOUNT_SMALL_INUMS, "," MNTOPT_64BITINODE }, + { XFS_MOUNT_COMPAT_IOSIZE, ",largeio" }, + { XFS_MOUNT_BARRIER, ",nobarrier" }, + { XFS_MOUNT_SMALL_INUMS, ",inode64" }, { 0, NULL } }; struct proc_xfs_info *xfs_infop; @@ -494,46 +495,46 @@ xfs_showargs( } if (mp->m_flags & XFS_MOUNT_DFLT_IOSIZE) - seq_printf(m, "," MNTOPT_ALLOCSIZE "=%dk", + seq_printf(m, ",allocsize=%dk", (int)(1 << mp->m_writeio_log) >> 10); if (mp->m_logbufs > 0) - seq_printf(m, "," MNTOPT_LOGBUFS "=%d", mp->m_logbufs); + seq_printf(m, ",logbufs=%d", mp->m_logbufs); if (mp->m_logbsize > 0) - seq_printf(m, "," MNTOPT_LOGBSIZE "=%dk", mp->m_logbsize >> 10); + seq_printf(m, ",logbsize=%dk", mp->m_logbsize >> 10); if (mp->m_logname) - seq_show_option(m, MNTOPT_LOGDEV, mp->m_logname); + seq_show_option(m, "logdev", mp->m_logname); if (mp->m_rtname) - seq_show_option(m, MNTOPT_RTDEV, mp->m_rtname); + seq_show_option(m, "rtdev", mp->m_rtname); if (mp->m_dalign > 0) - seq_printf(m, "," MNTOPT_SUNIT "=%d", + seq_printf(m, ",sunit=%d", (int)XFS_FSB_TO_BB(mp, mp->m_dalign)); if (mp->m_swidth > 0) - seq_printf(m, "," MNTOPT_SWIDTH "=%d", + seq_printf(m, ",swidth=%d", (int)XFS_FSB_TO_BB(mp, mp->m_swidth)); if (mp->m_qflags & (XFS_UQUOTA_ACCT|XFS_UQUOTA_ENFD)) - seq_puts(m, "," MNTOPT_USRQUOTA); + seq_puts(m, ",usrquota"); else if (mp->m_qflags & XFS_UQUOTA_ACCT) - seq_puts(m, "," MNTOPT_UQUOTANOENF); + seq_puts(m, ",uqnoenforce"); if (mp->m_qflags & XFS_PQUOTA_ACCT) { if (mp->m_qflags & XFS_PQUOTA_ENFD) - seq_puts(m, "," MNTOPT_PRJQUOTA); + seq_puts(m, ",prjquota"); else - seq_puts(m, "," MNTOPT_PQUOTANOENF); + seq_puts(m, ",pqnoenforce"); } if (mp->m_qflags & XFS_GQUOTA_ACCT) { if (mp->m_qflags & XFS_GQUOTA_ENFD) - seq_puts(m, "," MNTOPT_GRPQUOTA); + seq_puts(m, ",grpquota"); else - seq_puts(m, "," MNTOPT_GQUOTANOENF); + seq_puts(m, ",gqnoenforce"); } if (!(mp->m_qflags & XFS_ALL_QUOTA_ACCT)) - seq_puts(m, "," MNTOPT_NOQUOTA); + seq_puts(m, ",noquota"); return 0; } @@ -1344,9 +1345,8 @@ xfs_finish_flags( */ if (xfs_sb_version_hascrc(&mp->m_sb) && (mp->m_flags & XFS_MOUNT_NOATTR2)) { - xfs_warn(mp, -"Cannot mount a V5 filesystem as %s. %s is always enabled for V5 filesystems.", - MNTOPT_NOATTR2, MNTOPT_ATTR2); + xfs_warn(mp, "Cannot mount a V5 filesystem as noattr2. " + "attr2 is always enabled for V5 filesystems."); return -EINVAL; } From sandeen@sandeen.net Mon Feb 15 16:11:33 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=ham version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay2.corp.sgi.com [137.38.102.29]) by oss.sgi.com (Postfix) with ESMTP id D530A29DF5 for ; Mon, 15 Feb 2016 16:11:33 -0600 (CST) Received: from cuda.sgi.com (cuda3.sgi.com [192.48.176.15]) by relay2.corp.sgi.com (Postfix) with ESMTP id C6BAB304043 for ; Mon, 15 Feb 2016 14:11:30 -0800 (PST) X-ASG-Debug-ID: 1455574287-04cb6c1e58e8400001-NocioJ Received: from sandeen.net (sandeen.net [63.231.237.45]) by cuda.sgi.com with ESMTP id xkMvE6QJJPbnLCah for ; Mon, 15 Feb 2016 14:11:27 -0800 (PST) X-Barracuda-Envelope-From: sandeen@sandeen.net X-Barracuda-Apparent-Source-IP: 63.231.237.45 Received: from liberator.sandeen.net (liberator.sandeen.net [10.0.0.4]) (using TLSv1.2 with cipher DHE-RSA-AES128-SHA (128/128 bits)) (No client certificate requested) by sandeen.net (Postfix) with ESMTPSA id ADB3463C5FF0 for ; Mon, 15 Feb 2016 16:11:27 -0600 (CST) Subject: Re: [PATCH v5 2/2] xfs_repair: new secondary superblock search method To: xfs@oss.sgi.com X-ASG-Orig-Subj: Re: [PATCH v5 2/2] xfs_repair: new secondary superblock search method References: <1455303811-9874-1-git-send-email-billodo@redhat.com> <1455303811-9874-3-git-send-email-billodo@redhat.com> <56BE9F13.7080107@sandeen.net> <20160215170047.GA25349@redhat.com> From: Eric Sandeen Message-ID: <56C24D0E.20109@sandeen.net> Date: Mon, 15 Feb 2016 16:11:26 -0600 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.11; rv:38.0) Gecko/20100101 Thunderbird/38.5.1 MIME-Version: 1.0 In-Reply-To: <20160215170047.GA25349@redhat.com> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit X-Barracuda-Connect: sandeen.net[63.231.237.45] X-Barracuda-Start-Time: 1455574287 X-Barracuda-URL: https://192.48.176.15:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-BRTS-Status: 1 X-Barracuda-Spam-Score: 0.00 X-Barracuda-Spam-Status: No, SCORE=0.00 using per-user scores of TAG_LEVEL=1000.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.7 tests= X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.3.27058 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- On 2/15/16 11:00 AM, Bill O'Donnell wrote: > xfs_repair: new secondary superblock search method > > Optimize secondary sb search, using similar method to find > fs geometry as that of xfs_mkfs. If this faster method fails > in finding a secondary sb, fall back to original brute force > slower search. > > version history: > ---- > v1: http://oss.sgi.com/archives/xfs/2016-02/msg00304.html > v2: patch 2 whitespace fixups > v3: patch 2 correct functionality; style fixups > v4: patch 1,2 properly see to style and whitespace fixups > v5: patch 2 move guess_default_geometry() to sb.c plus > very minor style/whitespace fixups. > ---- > > Signed-off-by: Bill O'Donnell Looks good to me, thanks Bill! Reviewed-by: Eric Sandeen > --- > Makefile | 2 +- > repair/Makefile | 4 ++-- > repair/sb.c | 72 +++++++++++++++++++++++++++++++++++++++++++++++++++++---- > 3 files changed, 70 insertions(+), 8 deletions(-) > > diff --git a/Makefile b/Makefile > index fca0a42..1d60d9c 100644 > --- a/Makefile > +++ b/Makefile > @@ -80,7 +80,7 @@ fsr: libhandle > growfs: libxcmd > io: libxcmd libhandle > quota: libxcmd > -repair: libxlog > +repair: libxlog libxcmd > copy: libxlog > > ifeq ($(HAVE_BUILDDEFS), yes) > diff --git a/repair/Makefile b/repair/Makefile > index 251722b..d24ab1f 100644 > --- a/repair/Makefile > +++ b/repair/Makefile > @@ -20,8 +20,8 @@ CFILES = agheader.c attr_repair.c avl.c avl64.c bmap.c btree.c \ > progress.c prefetch.c rt.c sb.c scan.c threads.c \ > versions.c xfs_repair.c > > -LLDLIBS = $(LIBXFS) $(LIBXLOG) $(LIBUUID) $(LIBRT) $(LIBPTHREAD) > -LTDEPENDENCIES = $(LIBXFS) $(LIBXLOG) > +LLDLIBS = $(LIBBLKID) $(LIBXFS) $(LIBXLOG) $(LIBUUID) $(LIBRT) $(LIBPTHREAD) $(LIBXCMD) > +LTDEPENDENCIES = $(LIBXFS) $(LIBXLOG) $(LIBXCMD) > LLDFLAGS = -static-libtool-libs > > default: depend $(LTCOMMAND) > diff --git a/repair/sb.c b/repair/sb.c > index 4eef14a..7e4708c 100644 > --- a/repair/sb.c > +++ b/repair/sb.c > @@ -17,6 +17,7 @@ > */ > > #include "libxfs.h" > +#include "libxcmd.h" > #include "libxlog.h" > #include "agheader.h" > #include "globals.h" > @@ -85,10 +86,15 @@ copy_sb(xfs_sb_t *source, xfs_sb_t *dest) > } > > /* > - * find a secondary superblock, copy it into the sb buffer > + * find a secondary superblock, copy it into the sb buffer. > + * start is the point to begin reading BSIZE bytes. > + * skip contains a byte-count of how far to advance for next read. > */ > -int > -find_secondary_sb(xfs_sb_t *rsb) > +static int > +__find_secondary_sb( > + xfs_sb_t *rsb, > + __uint64_t start, > + __uint64_t skip) > { > xfs_off_t off; > xfs_sb_t *sb; > @@ -117,7 +123,7 @@ find_secondary_sb(xfs_sb_t *rsb) > /* > * skip first sector since we know that's bad > */ > - for (done = 0, off = XFS_AG_MIN_BYTES; !done ; off += bsize) { > + for (done = 0, off = start; !done ; off += skip) { > /* > * read disk 1 MByte at a time. > */ > @@ -166,7 +172,63 @@ find_secondary_sb(xfs_sb_t *rsb) > } > > free(sb); > - return(retval); > + return retval; > +} > + > +static int > +guess_default_geometry( > + __uint64_t *agsize, > + __uint64_t *agcount, > + libxfs_init_t *x) > +{ > + struct fs_topology ft; > + int blocklog; > + __uint64_t dblocks; > + int multidisk; > + > + memset(&ft, 0, sizeof(ft)); > + get_topology(x, &ft, 1); > + > + /* > + * get geometry from get_topology result. > + * Use default block size (2^12) > + */ > + blocklog = 12; > + multidisk = ft.dswidth | ft.dsunit; > + dblocks = x->dsize >> (blocklog - BBSHIFT); > + calc_default_ag_geometry(blocklog, dblocks, multidisk, > + agsize, agcount); > + > + return blocklog; > +} > + > +int > +find_secondary_sb(xfs_sb_t *rsb) > +{ > + int retval; > + __uint64_t agcount; > + __uint64_t agsize; > + __uint64_t skip; > + int blocklog; > + > + /* > + * Attempt to find secondary sb with a coarse approach. > + * Failing that, fallback to a fine-grained approach. > + */ > + blocklog = guess_default_geometry(&agsize, &agcount, &x); > + > + /* > + * use found ag geometry to quickly find secondary sb > + */ > + skip = agsize << blocklog; > + retval = __find_secondary_sb(rsb, skip, skip); > + if (!retval) { > + /* > + * fallback: Start at min agsize and scan all blocks > + */ > + retval = __find_secondary_sb(rsb, XFS_AG_MIN_BYTES, BSIZE); > + } > + return retval; > } > > /* > From sandeen@sandeen.net Mon Feb 15 16:47:24 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=ham version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay2.corp.sgi.com [137.38.102.29]) by oss.sgi.com (Postfix) with ESMTP id EEB7329DF5 for ; Mon, 15 Feb 2016 16:47:23 -0600 (CST) Received: from cuda.sgi.com (cuda1.sgi.com [192.48.157.11]) by relay2.corp.sgi.com (Postfix) with ESMTP id C01C4304032 for ; Mon, 15 Feb 2016 14:47:23 -0800 (PST) X-ASG-Debug-ID: 1455576437-04bdf02d5c06c90001-NocioJ Received: from sandeen.net (sandeen.net [63.231.237.45]) by cuda.sgi.com with ESMTP id blnuqO5fF3c1vDFO for ; Mon, 15 Feb 2016 14:47:17 -0800 (PST) X-Barracuda-Envelope-From: sandeen@sandeen.net X-Barracuda-Apparent-Source-IP: 63.231.237.45 Received: from liberator.sandeen.net (liberator.sandeen.net [10.0.0.4]) (using TLSv1.2 with cipher DHE-RSA-AES128-SHA (128/128 bits)) (No client certificate requested) by sandeen.net (Postfix) with ESMTPSA id A9F6163C5FF0 for ; Mon, 15 Feb 2016 16:47:17 -0600 (CST) Subject: Re: XFS fiemap issue with Linux 3.10.0-327.el7.x86_64 (CentOS 7) To: xfs@oss.sgi.com X-ASG-Orig-Subj: Re: XFS fiemap issue with Linux 3.10.0-327.el7.x86_64 (CentOS 7) References: <56C219F0.3050002@sandeen.net> <20160215204009.GJ14668@dastard> From: Eric Sandeen Message-ID: <56C25574.2060307@sandeen.net> Date: Mon, 15 Feb 2016 16:47:16 -0600 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.11; rv:38.0) Gecko/20100101 Thunderbird/38.5.1 MIME-Version: 1.0 In-Reply-To: <20160215204009.GJ14668@dastard> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit X-Barracuda-Connect: sandeen.net[63.231.237.45] X-Barracuda-Start-Time: 1455576437 X-Barracuda-URL: https://192.48.157.11:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-BRTS-Status: 1 X-Barracuda-Spam-Score: 0.00 X-Barracuda-Spam-Status: No, SCORE=0.00 using per-user scores of TAG_LEVEL=1000.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.7 tests= X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.3.27058 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- On 2/15/16 2:40 PM, Dave Chinner wrote: > On Mon, Feb 15, 2016 at 02:28:36PM -0500, Jim Wilcoxson wrote: >> Thanks Eric. >> >> I ran xfs_bmap -v and it returned extents 0-19999, alternating data >> with holes. The holes and data were various sizes, I suppose for xfs >> alignment reasons, but everything was there. >> >> Running fiemap again after xfs_bmap still returned 1364 extents. > > Yes, fiemap in XFS uses a buffer size of: > > bm.bmv_count = min_t(__s32, bm.bmv_count, > (PAGE_SIZE * 16 / sizeof(struct getbmapx))); > > i.e. limits a single fiemap fetch to a maximum of 64k of extent > data. > > I think you have an incorrect assumption about fiemap behaviour. > fiemap is not designed to return or even count all the extents in a > file in a single call; I think it is; as was quoted earlier, "If fm_extent_count is zero, then the fm_extents[] array is ignored (no extents will be returned), and the fm_mapped_extents count will hold the number of extents needed in fm_extents[] to hold the file's current mapping." and that's in there: /* only count the extents */ if (fieinfo->fi_extents_max == 0) { fieinfo->fi_extents_mapped++; return (flags & FIEMAP_EXTENT_LAST) ? 1 : 0; } > on XFS it returns how many extents it can > return in a single call. When you then map the file, if the > FIEMAP_EXTENT_LAST is not set on the last extent returned, then the > application needs to make another FIEMAP call from the end offset of > last extent mapping returned in the last call, and it will then > return the next N extents in the file. > > IOWs, you have to keep calling FIEMAP to map the entire file, not > assume a single call will return an arbitrary amount of data to you > in a single call. He's not trying to get all data in one call, just a count. -Eric > But, as Eric said - fiemap is a diagnosis tool, not an interface you > can rely on for anything involving data movement. > > Cheers, > > Dave. > From sandeen@sandeen.net Mon Feb 15 17:07:25 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=ham version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay3.corp.sgi.com [198.149.34.15]) by oss.sgi.com (Postfix) with ESMTP id 511EC29DF5 for ; Mon, 15 Feb 2016 17:07:25 -0600 (CST) Received: from cuda.sgi.com (cuda1.sgi.com [192.48.157.11]) by relay3.corp.sgi.com (Postfix) with ESMTP id E7D25AC004 for ; Mon, 15 Feb 2016 15:07:21 -0800 (PST) X-ASG-Debug-ID: 1455577640-04bdf02d5b071b0001-NocioJ Received: from sandeen.net (sandeen.net [63.231.237.45]) by cuda.sgi.com with ESMTP id fr3Bfhom7noVB7t9 for ; Mon, 15 Feb 2016 15:07:20 -0800 (PST) X-Barracuda-Envelope-From: sandeen@sandeen.net X-Barracuda-Apparent-Source-IP: 63.231.237.45 Received: from liberator.sandeen.net (liberator.sandeen.net [10.0.0.4]) (using TLSv1.2 with cipher DHE-RSA-AES128-SHA (128/128 bits)) (No client certificate requested) by sandeen.net (Postfix) with ESMTPSA id CF89463C5FF0 for ; Mon, 15 Feb 2016 17:07:19 -0600 (CST) Subject: Re: [PATCH 3/3] xfs: test for valid remount options, error if not To: xfs@oss.sgi.com X-ASG-Orig-Subj: Re: [PATCH 3/3] xfs: test for valid remount options, error if not References: <56BBC982.50804@redhat.com> <56BBCB9D.6080404@sandeen.net> <20160215202521.GI14668@dastard> From: Eric Sandeen Message-ID: <56C25A26.3030909@sandeen.net> Date: Mon, 15 Feb 2016 17:07:18 -0600 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.11; rv:38.0) Gecko/20100101 Thunderbird/38.5.1 MIME-Version: 1.0 In-Reply-To: <20160215202521.GI14668@dastard> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit X-Barracuda-Connect: sandeen.net[63.231.237.45] X-Barracuda-Start-Time: 1455577640 X-Barracuda-URL: https://192.48.157.11:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-BRTS-Status: 1 X-Barracuda-Spam-Score: 0.00 X-Barracuda-Spam-Status: No, SCORE=0.00 using per-user scores of TAG_LEVEL=1000.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.7 tests= X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.3.27059 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- On 2/15/16 2:25 PM, Dave Chinner wrote: > I think hiding a goto like this is wrong - it forces you to go read > the macro, making the code harder to read and follow. Really, what's > wrong with the simple and obvious: > > > if (bad option) { > bad_option = "bad option string"; > goto out_warn; > } > ..... > > out_warn: > xfs_warn(mp, "%s options may not be changed via remount", > bad_option); > // free stuff > return -EINVAL; > } > > Yes, I know that this sort of logic flow hiding was done with the > XFS_WANT_CORRUPTED macros, but they were written back in 90s on Irix > when using macros to implement everything were all the rage. Yeah, fair point, not sure why I did that ;) Old habits? -Eric From sandeen@sandeen.net Mon Feb 15 17:43:15 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=ham version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay2.corp.sgi.com [137.38.102.29]) by oss.sgi.com (Postfix) with ESMTP id 8297E29DF5 for ; Mon, 15 Feb 2016 17:43:15 -0600 (CST) Received: from cuda.sgi.com (cuda3.sgi.com [192.48.176.15]) by relay2.corp.sgi.com (Postfix) with ESMTP id 702ED304032 for ; Mon, 15 Feb 2016 15:43:14 -0800 (PST) X-ASG-Debug-ID: 1455579789-04cb6c1e57ea110001-NocioJ Received: from sandeen.net (sandeen.net [63.231.237.45]) by cuda.sgi.com with ESMTP id m3bTYM9akMiediOF for ; Mon, 15 Feb 2016 15:43:09 -0800 (PST) X-Barracuda-Envelope-From: sandeen@sandeen.net X-Barracuda-Apparent-Source-IP: 63.231.237.45 Received: from liberator.sandeen.net (liberator.sandeen.net [10.0.0.4]) (using TLSv1.2 with cipher DHE-RSA-AES128-SHA (128/128 bits)) (No client certificate requested) by sandeen.net (Postfix) with ESMTPSA id B968963C5FF0 for ; Mon, 15 Feb 2016 17:43:08 -0600 (CST) Subject: Re: [PATCH 1/3] xfs_fs.h: XFS_IOC_FS[SG]SETXATTR to FS_IOC_FS[SG]ETXATTR promotion To: xfs@oss.sgi.com X-ASG-Orig-Subj: Re: [PATCH 1/3] xfs_fs.h: XFS_IOC_FS[SG]SETXATTR to FS_IOC_FS[SG]ETXATTR promotion References: <1455514346-15481-1-git-send-email-david@fromorbit.com> <1455514346-15481-2-git-send-email-david@fromorbit.com> From: Eric Sandeen X-Enigmail-Draft-Status: N1110 Message-ID: <56C2628B.4000804@sandeen.net> Date: Mon, 15 Feb 2016 17:43:07 -0600 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.11; rv:38.0) Gecko/20100101 Thunderbird/38.5.1 MIME-Version: 1.0 In-Reply-To: <1455514346-15481-2-git-send-email-david@fromorbit.com> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 8bit X-Barracuda-Connect: sandeen.net[63.231.237.45] X-Barracuda-Start-Time: 1455579789 X-Barracuda-URL: https://192.48.176.15:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-BRTS-Status: 1 X-Barracuda-Spam-Score: 0.00 X-Barracuda-Spam-Status: No, SCORE=0.00 using per-user scores of TAG_LEVEL=1000.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.7 tests= X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.3.27059 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- On 2/14/16 11:32 PM, Dave Chinner wrote: > From: Dave Chinner > > The kernel commit to make this ioctl promotion (bb99e06ddf) moved > the definitions for the XFS ioctl to uapi/linux/fs.h for the > following reason: > > Hoist the ioctl definitions for the XFS_IOC_FS[SG]SETXATTR API > from fs/xfs/libxfs/xfs_fs.h to include/uapi/linux/fs.h so that > the ioctls can be used by all filesystems, not just XFS. This > enables (initially) ext4 to use the ioctl to set project IDs on > inodes. > > This means we now need to handle this change in userspace as the > uapi/linux/fs.h file may not contain the definitions (i.e. new > xfsprogs/ old linux uapi files) xfsprogs needs to build. Hence we > need to massage the definition in xfs_fs.h to take the values from > the system header if it exists, otherwise keep the old definitions > for compatibility and platforms other than linux. > > To this extent, we add the FS* definitions to the platform headers > so the FS* versions are available on all platforms, and add trivial > defines to xfs_fs.h to present the XFS* versions for backwards > compatibility with existing code. New code should always use the FS* > versions, and as such we also convert all the users of XFS* in > xfsprogs to use the FS* definitions. > > Signed-off-by: Dave Chinner Reviewed-by: Eric Sandeen > --- > fsr/xfs_fsr.c | 16 ++++++---------- > include/darwin.h | 34 +++++++++++++++++++++++++++++++++ > include/freebsd.h | 34 +++++++++++++++++++++++++++++++++ > include/irix.h | 37 +++++++++++++++++++++++++++++++++--- > include/linux.h | 38 +++++++++++++++++++++++++++++++++++++ > io/attr.c | 40 +++++++++++++++++++-------------------- > io/bmap.c | 16 ++++++++-------- > io/open.c | 32 +++++++++++++++---------------- > libxcmd/projects.c | 8 ++++---- > libxfs/xfs_format.h | 2 -- > libxfs/xfs_fs.h | 54 +++++++++++++++++++++-------------------------------- > quota/free.c | 6 +++--- > quota/project.c | 16 ++++++++-------- > repair/dinode.c | 4 ++-- > rtcp/xfs_rtcp.c | 12 ++++++------ > 15 files changed, 234 insertions(+), 115 deletions(-) > > diff --git a/fsr/xfs_fsr.c b/fsr/xfs_fsr.c > index 19838ed..d75990a 100644 > --- a/fsr/xfs_fsr.c > +++ b/fsr/xfs_fsr.c > @@ -33,10 +33,6 @@ > #include > #include > > -#ifndef XFS_XFLAG_NODEFRAG > -#define XFS_XFLAG_NODEFRAG 0x00002000 /* src dependancy, remove later */ > -#endif > - > #define _PATH_FSRLAST "/var/tmp/.fsrlast_xfs" > #define _PATH_PROC_MOUNTS "/proc/mounts" > > @@ -962,22 +958,22 @@ fsrfile_common( > return 1; > } > > - if ((ioctl(fd, XFS_IOC_FSGETXATTR, &fsx)) < 0) { > + if ((ioctl(fd, FS_IOC_FSGETXATTR, &fsx)) < 0) { > fsrprintf(_("failed to get inode attrs: %s\n"), fname); > return(-1); > } > - if (fsx.fsx_xflags & (XFS_XFLAG_IMMUTABLE|XFS_XFLAG_APPEND)) { > + if (fsx.fsx_xflags & (FS_XFLAG_IMMUTABLE|FS_XFLAG_APPEND)) { > if (vflag) > fsrprintf(_("%s: immutable/append, ignoring\n"), fname); > return(0); > } > - if (fsx.fsx_xflags & XFS_XFLAG_NODEFRAG) { > + if (fsx.fsx_xflags & FS_XFLAG_NODEFRAG) { > if (vflag) > fsrprintf(_("%s: marked as don't defrag, ignoring\n"), > fname); > return(0); > } > - if (fsx.fsx_xflags & XFS_XFLAG_REALTIME) { > + if (fsx.fsx_xflags & FS_XFLAG_REALTIME) { > if (xfs_getrt(fd, &vfss) < 0) { > fsrprintf(_("cannot get realtime geometry for: %s\n"), > fname); > @@ -1038,7 +1034,7 @@ fsr_setup_attr_fork( > int no_change_cnt = 0; > int ret; > > - if (!(bstatp->bs_xflags & XFS_XFLAG_HASATTR)) > + if (!(bstatp->bs_xflags & FS_XFLAG_HASATTR)) > return 0; > > /* > @@ -1264,7 +1260,7 @@ packfile(char *fname, char *tname, int fd, > > /* Setup extended inode flags, project identifier, etc */ > if (fsxp->fsx_xflags || fsxp->fsx_projid) { > - if (ioctl(tfd, XFS_IOC_FSSETXATTR, fsxp) < 0) { > + if (ioctl(tfd, FS_IOC_FSSETXATTR, fsxp) < 0) { > fsrprintf(_("could not set inode attrs on tmp: %s\n"), > tname); > goto out; > diff --git a/include/darwin.h b/include/darwin.h > index dd6132f..2baa536 100644 > --- a/include/darwin.h > +++ b/include/darwin.h > @@ -285,4 +285,38 @@ static inline void platform_mntent_close(struct mntent_cursor * cursor) > cursor->i = 0; > } > > +/* check whether we have to define FS_IOC_FS[GS]ETXATTR ourselves */ > +#ifndef HAVE_FSXATTR > +struct fsxattr { > + __u32 fsx_xflags; /* xflags field value (get/set) */ > + __u32 fsx_extsize; /* extsize field value (get/set)*/ > + __u32 fsx_nextents; /* nextents field value (get) */ > + __u32 fsx_projid; /* project identifier (get/set) */ > + unsigned char fsx_pad[12]; > +}; > + > +/* > + * Flags for the fsx_xflags field > + */ > +#define FS_XFLAG_REALTIME 0x00000001 /* data in realtime volume */ > +#define FS_XFLAG_PREALLOC 0x00000002 /* preallocated file extents */ > +#define FS_XFLAG_IMMUTABLE 0x00000008 /* file cannot be modified */ > +#define FS_XFLAG_APPEND 0x00000010 /* all writes append */ > +#define FS_XFLAG_SYNC 0x00000020 /* all writes synchronous */ > +#define FS_XFLAG_NOATIME 0x00000040 /* do not update access time */ > +#define FS_XFLAG_NODUMP 0x00000080 /* do not include in backups */ > +#define FS_XFLAG_RTINHERIT 0x00000100 /* create with rt bit set */ > +#define FS_XFLAG_PROJINHERIT 0x00000200 /* create with parents projid */ > +#define FS_XFLAG_NOSYMLINKS 0x00000400 /* disallow symlink creation */ > +#define FS_XFLAG_EXTSIZE 0x00000800 /* extent size allocator hint */ > +#define FS_XFLAG_EXTSZINHERIT 0x00001000 /* inherit inode extent size */ > +#define FS_XFLAG_NODEFRAG 0x00002000 /* do not defragment */ > +#define FS_XFLAG_FILESTREAM 0x00004000 /* use filestream allocator */ > +#define FS_XFLAG_HASATTR 0x80000000 /* no DIFLAG for this */ > + > +#define FS_IOC_FSGETXATTR _IOR ('X', 31, struct fsxattr) > +#define FS_IOC_FSSETXATTR _IOW ('X', 32, struct fsxattr) > + > +#endif > + > #endif /* __XFS_DARWIN_H__ */ > diff --git a/include/freebsd.h b/include/freebsd.h > index 65bd60a..fe567d4 100644 > --- a/include/freebsd.h > +++ b/include/freebsd.h > @@ -175,5 +175,39 @@ static inline void platform_mntent_close(struct mntent_cursor * cursor) > endmntent(cursor->mtabp); > } > > +/* check whether we have to define FS_IOC_FS[GS]ETXATTR ourselves */ > +#ifndef HAVE_FSXATTR > +struct fsxattr { > + __u32 fsx_xflags; /* xflags field value (get/set) */ > + __u32 fsx_extsize; /* extsize field value (get/set)*/ > + __u32 fsx_nextents; /* nextents field value (get) */ > + __u32 fsx_projid; /* project identifier (get/set) */ > + unsigned char fsx_pad[12]; > +}; > + > +/* > + * Flags for the fsx_xflags field > + */ > +#define FS_XFLAG_REALTIME 0x00000001 /* data in realtime volume */ > +#define FS_XFLAG_PREALLOC 0x00000002 /* preallocated file extents */ > +#define FS_XFLAG_IMMUTABLE 0x00000008 /* file cannot be modified */ > +#define FS_XFLAG_APPEND 0x00000010 /* all writes append */ > +#define FS_XFLAG_SYNC 0x00000020 /* all writes synchronous */ > +#define FS_XFLAG_NOATIME 0x00000040 /* do not update access time */ > +#define FS_XFLAG_NODUMP 0x00000080 /* do not include in backups */ > +#define FS_XFLAG_RTINHERIT 0x00000100 /* create with rt bit set */ > +#define FS_XFLAG_PROJINHERIT 0x00000200 /* create with parents projid */ > +#define FS_XFLAG_NOSYMLINKS 0x00000400 /* disallow symlink creation */ > +#define FS_XFLAG_EXTSIZE 0x00000800 /* extent size allocator hint */ > +#define FS_XFLAG_EXTSZINHERIT 0x00001000 /* inherit inode extent size */ > +#define FS_XFLAG_NODEFRAG 0x00002000 /* do not defragment */ > +#define FS_XFLAG_FILESTREAM 0x00004000 /* use filestream allocator */ > +#define FS_XFLAG_HASATTR 0x80000000 /* no DIFLAG for this */ > + > +#define FS_IOC_FSGETXATTR _IOR ('X', 31, struct fsxattr) > +#define FS_IOC_FSSETXATTR _IOW ('X', 32, struct fsxattr) > + > +#endif > + > > #endif /* __XFS_FREEBSD_H__ */ > diff --git a/include/irix.h b/include/irix.h > index 293f869..bdb4b6a 100644 > --- a/include/irix.h > +++ b/include/irix.h > @@ -378,8 +378,6 @@ static __inline__ char * strsep(char **s, const char *ct) > #define __XFS_FS_H__ 1 > > #define XFS_IOC_DIOINFO F_DIOINFO > -#define XFS_IOC_FSGETXATTR F_FSGETXATTR > -#define XFS_IOC_FSSETXATTR F_FSSETXATTR > #define XFS_IOC_ALLOCSP64 F_ALLOCSP64 > #define XFS_IOC_FREESP64 F_FREESP64 > #define XFS_IOC_GETBMAP F_GETBMAP > @@ -422,7 +420,40 @@ static __inline__ char * strsep(char **s, const char *ct) > > #define _AIOCB64_T_DEFINED 1 > > -#define XFS_XFLAG_NODEFRAG 0x00002000 > +/* check whether we have to define FS_IOC_FS[GS]ETXATTR ourselves */ > +#ifndef HAVE_FSXATTR > +struct fsxattr { > + __u32 fsx_xflags; /* xflags field value (get/set) */ > + __u32 fsx_extsize; /* extsize field value (get/set)*/ > + __u32 fsx_nextents; /* nextents field value (get) */ > + __u32 fsx_projid; /* project identifier (get/set) */ > + unsigned char fsx_pad[12]; > +}; > + > +/* > + * Flags for the fsx_xflags field > + */ > +#define FS_XFLAG_REALTIME 0x00000001 /* data in realtime volume */ > +#define FS_XFLAG_PREALLOC 0x00000002 /* preallocated file extents */ > +#define FS_XFLAG_IMMUTABLE 0x00000008 /* file cannot be modified */ > +#define FS_XFLAG_APPEND 0x00000010 /* all writes append */ > +#define FS_XFLAG_SYNC 0x00000020 /* all writes synchronous */ > +#define FS_XFLAG_NOATIME 0x00000040 /* do not update access time */ > +#define FS_XFLAG_NODUMP 0x00000080 /* do not include in backups */ > +#define FS_XFLAG_RTINHERIT 0x00000100 /* create with rt bit set */ > +#define FS_XFLAG_PROJINHERIT 0x00000200 /* create with parents projid */ > +#define FS_XFLAG_NOSYMLINKS 0x00000400 /* disallow symlink creation */ > +#define FS_XFLAG_EXTSIZE 0x00000800 /* extent size allocator hint */ > +#define FS_XFLAG_EXTSZINHERIT 0x00001000 /* inherit inode extent size */ > +#define FS_XFLAG_NODEFRAG 0x00002000 /* do not defragment */ > +#define FS_XFLAG_FILESTREAM 0x00004000 /* use filestream allocator */ > +#define FS_XFLAG_HASATTR 0x80000000 /* no DIFLAG for this */ > + > +#define FS_IOC_FSGETXATTR F_FSGETXATTR > +#define FS_IOC_FSSETXATTR F_FSSETXATTR > + > +#endif > + > > /** > * Abstraction of mountpoints. > diff --git a/include/linux.h b/include/linux.h > index 16fb707..17391c3 100644 > --- a/include/linux.h > +++ b/include/linux.h > @@ -174,4 +174,42 @@ static inline void platform_mntent_close(struct mntent_cursor * cursor) > endmntent(cursor->mtabp); > } > > +/* > + * Check whether we have to define FS_IOC_FS[GS]ETXATTR ourselves. These > + * are a copy of the definitions moved to linux/uapi/fs.h in the 4.5 kernel, > + * so this is purely for supporting builds against old kernel headers. > + */ > +#ifndef FS_IOC_FSGETXATTR > +struct fsxattr { > + __u32 fsx_xflags; /* xflags field value (get/set) */ > + __u32 fsx_extsize; /* extsize field value (get/set)*/ > + __u32 fsx_nextents; /* nextents field value (get) */ > + __u32 fsx_projid; /* project identifier (get/set) */ > + unsigned char fsx_pad[12]; > +}; > + > +/* > + * Flags for the fsx_xflags field > + */ > +#define FS_XFLAG_REALTIME 0x00000001 /* data in realtime volume */ > +#define FS_XFLAG_PREALLOC 0x00000002 /* preallocated file extents */ > +#define FS_XFLAG_IMMUTABLE 0x00000008 /* file cannot be modified */ > +#define FS_XFLAG_APPEND 0x00000010 /* all writes append */ > +#define FS_XFLAG_SYNC 0x00000020 /* all writes synchronous */ > +#define FS_XFLAG_NOATIME 0x00000040 /* do not update access time */ > +#define FS_XFLAG_NODUMP 0x00000080 /* do not include in backups */ > +#define FS_XFLAG_RTINHERIT 0x00000100 /* create with rt bit set */ > +#define FS_XFLAG_PROJINHERIT 0x00000200 /* create with parents projid */ > +#define FS_XFLAG_NOSYMLINKS 0x00000400 /* disallow symlink creation */ > +#define FS_XFLAG_EXTSIZE 0x00000800 /* extent size allocator hint */ > +#define FS_XFLAG_EXTSZINHERIT 0x00001000 /* inherit inode extent size */ > +#define FS_XFLAG_NODEFRAG 0x00002000 /* do not defragment */ > +#define FS_XFLAG_FILESTREAM 0x00004000 /* use filestream allocator */ > +#define FS_XFLAG_HASATTR 0x80000000 /* no DIFLAG for this */ > + > +#define FS_IOC_FSGETXATTR _IOR ('X', 31, struct fsxattr) > +#define FS_IOC_FSSETXATTR _IOW ('X', 32, struct fsxattr) > + > +#endif > + > #endif /* __XFS_LINUX_H__ */ > diff --git a/io/attr.c b/io/attr.c > index 7cbcc3c..6fa08bf 100644 > --- a/io/attr.c > +++ b/io/attr.c > @@ -33,20 +33,20 @@ static struct xflags { > char *shortname; > char *longname; > } xflags[] = { > - { XFS_XFLAG_REALTIME, "r", "realtime" }, > - { XFS_XFLAG_PREALLOC, "p", "prealloc" }, > - { XFS_XFLAG_IMMUTABLE, "i", "immutable" }, > - { XFS_XFLAG_APPEND, "a", "append-only" }, > - { XFS_XFLAG_SYNC, "s", "sync" }, > - { XFS_XFLAG_NOATIME, "A", "no-atime" }, > - { XFS_XFLAG_NODUMP, "d", "no-dump" }, > - { XFS_XFLAG_RTINHERIT, "t", "rt-inherit" }, > - { XFS_XFLAG_PROJINHERIT, "P", "proj-inherit" }, > - { XFS_XFLAG_NOSYMLINKS, "n", "nosymlinks" }, > - { XFS_XFLAG_EXTSIZE, "e", "extsize" }, > - { XFS_XFLAG_EXTSZINHERIT, "E", "extsz-inherit" }, > - { XFS_XFLAG_NODEFRAG, "f", "no-defrag" }, > - { XFS_XFLAG_FILESTREAM, "S", "filestream" }, > + { FS_XFLAG_REALTIME, "r", "realtime" }, > + { FS_XFLAG_PREALLOC, "p", "prealloc" }, > + { FS_XFLAG_IMMUTABLE, "i", "immutable" }, > + { FS_XFLAG_APPEND, "a", "append-only" }, > + { FS_XFLAG_SYNC, "s", "sync" }, > + { FS_XFLAG_NOATIME, "A", "no-atime" }, > + { FS_XFLAG_NODUMP, "d", "no-dump" }, > + { FS_XFLAG_RTINHERIT, "t", "rt-inherit" }, > + { FS_XFLAG_PROJINHERIT, "P", "proj-inherit" }, > + { FS_XFLAG_NOSYMLINKS, "n", "nosymlinks" }, > + { FS_XFLAG_EXTSIZE, "e", "extsize" }, > + { FS_XFLAG_EXTSZINHERIT, "E", "extsz-inherit" }, > + { FS_XFLAG_NODEFRAG, "f", "no-defrag" }, > + { FS_XFLAG_FILESTREAM, "S", "filestream" }, > { 0, NULL, NULL } > }; > #define CHATTR_XFLAG_LIST "r"/*p*/"iasAdtPneEfS" > @@ -169,7 +169,7 @@ lsattr_callback( > if ((fd = open(path, O_RDONLY)) == -1) > fprintf(stderr, _("%s: cannot open %s: %s\n"), > progname, path, strerror(errno)); > - else if ((xfsctl(path, fd, XFS_IOC_FSGETXATTR, &fsx)) < 0) > + else if ((xfsctl(path, fd, FS_IOC_FSGETXATTR, &fsx)) < 0) > fprintf(stderr, _("%s: cannot get flags on %s: %s\n"), > progname, path, strerror(errno)); > else > @@ -216,7 +216,7 @@ lsattr_f( > if (recurse_all || recurse_dir) { > nftw(name, lsattr_callback, > 100, FTW_PHYS | FTW_MOUNT | FTW_DEPTH); > - } else if ((xfsctl(name, file->fd, XFS_IOC_FSGETXATTR, &fsx)) < 0) { > + } else if ((xfsctl(name, file->fd, FS_IOC_FSGETXATTR, &fsx)) < 0) { > fprintf(stderr, _("%s: cannot get flags on %s: %s\n"), > progname, name, strerror(errno)); > } else { > @@ -245,13 +245,13 @@ chattr_callback( > if ((fd = open(path, O_RDONLY)) == -1) { > fprintf(stderr, _("%s: cannot open %s: %s\n"), > progname, path, strerror(errno)); > - } else if (xfsctl(path, fd, XFS_IOC_FSGETXATTR, &attr) < 0) { > + } else if (xfsctl(path, fd, FS_IOC_FSGETXATTR, &attr) < 0) { > fprintf(stderr, _("%s: cannot get flags on %s: %s\n"), > progname, path, strerror(errno)); > } else { > attr.fsx_xflags |= orflags; > attr.fsx_xflags &= ~andflags; > - if (xfsctl(path, fd, XFS_IOC_FSSETXATTR, &attr) < 0) > + if (xfsctl(path, fd, FS_IOC_FSSETXATTR, &attr) < 0) > fprintf(stderr, _("%s: cannot set flags on %s: %s\n"), > progname, path, strerror(errno)); > } > @@ -316,13 +316,13 @@ chattr_f( > if (recurse_all || recurse_dir) { > nftw(name, chattr_callback, > 100, FTW_PHYS | FTW_MOUNT | FTW_DEPTH); > - } else if (xfsctl(name, file->fd, XFS_IOC_FSGETXATTR, &attr) < 0) { > + } else if (xfsctl(name, file->fd, FS_IOC_FSGETXATTR, &attr) < 0) { > fprintf(stderr, _("%s: cannot get flags on %s: %s\n"), > progname, name, strerror(errno)); > } else { > attr.fsx_xflags |= orflags; > attr.fsx_xflags &= ~andflags; > - if (xfsctl(name, file->fd, XFS_IOC_FSSETXATTR, &attr) < 0) > + if (xfsctl(name, file->fd, FS_IOC_FSSETXATTR, &attr) < 0) > fprintf(stderr, _("%s: cannot set flags on %s: %s\n"), > progname, name, strerror(errno)); > } > diff --git a/io/bmap.c b/io/bmap.c > index cbeed3b..04d04c7 100644 > --- a/io/bmap.c > +++ b/io/bmap.c > @@ -125,7 +125,7 @@ bmap_f( > exitcode = 1; > return 0; > } > - c = xfsctl(file->name, file->fd, XFS_IOC_FSGETXATTR, &fsx); > + c = xfsctl(file->name, file->fd, FS_IOC_FSGETXATTR, &fsx); > if (c < 0) { > fprintf(stderr, > _("%s: cannot read attrs on \"%s\": %s\n"), > @@ -134,7 +134,7 @@ bmap_f( > return 0; > } > > - if (fsx.fsx_xflags == XFS_XFLAG_REALTIME) { > + if (fsx.fsx_xflags == FS_XFLAG_REALTIME) { > /* > * ag info not applicable to rt, continue > * without ag output. > @@ -157,7 +157,7 @@ bmap_f( > * by nflag, or the initial guess number of extents (32). > * > * If there are more extents than we guessed, use xfsctl > - * (XFS_IOC_FSGETXATTR[A]) to get the extent count, realloc some more > + * (FS_IOC_FSGETXATTR[A]) to get the extent count, realloc some more > * space based on this count, and try again. > * > * If the initial FGETBMAPX attempt returns EINVAL, this may mean > @@ -165,13 +165,13 @@ bmap_f( > * EINVAL, check the length with fstat() and return "no extents" > * if the length == 0. > * > - * Why not do the xfsctl(XFS_IOC_FSGETXATTR[A]) first? Two reasons: > + * Why not do the xfsctl(FS_IOC_FSGETXATTR[A]) first? Two reasons: > * (1) The extent count may be wrong for a file with delayed > * allocation blocks. The XFS_IOC_GETBMAPX forces the real > * allocation and fixes up the extent count. > * (2) For XFS_IOC_GETBMAP[X] on a DMAPI file that has been moved > * offline by a DMAPI application (e.g., DMF) the > - * XFS_IOC_FSGETXATTR only reflects the extents actually online. > + * FS_IOC_FSGETXATTR only reflects the extents actually online. > * Doing XFS_IOC_GETBMAPX call first forces that data blocks online > * and then everything proceeds normally (see PV #545725). > * > @@ -207,13 +207,13 @@ bmap_f( > break; > if (map->bmv_entries < map->bmv_count-1) > break; > - /* Get number of extents from xfsctl XFS_IOC_FSGETXATTR[A] > + /* Get number of extents from xfsctl FS_IOC_FSGETXATTR[A] > * syscall. > */ > i = xfsctl(file->name, file->fd, aflag ? > - XFS_IOC_FSGETXATTRA : XFS_IOC_FSGETXATTR, &fsx); > + XFS_IOC_FSGETXATTRA : FS_IOC_FSGETXATTR, &fsx); > if (i < 0) { > - fprintf(stderr, "%s: xfsctl(XFS_IOC_FSGETXATTR%s) " > + fprintf(stderr, "%s: xfsctl(FS_IOC_FSGETXATTR%s) " > "[\"%s\"]: %s\n", progname, aflag ? "A" : "", > file->name, strerror(errno)); > free(map); > diff --git a/io/open.c b/io/open.c > index ac5a5e0..037843d 100644 > --- a/io/open.c > +++ b/io/open.c > @@ -115,9 +115,9 @@ stat_f( > } > if (file->flags & IO_FOREIGN) > return 0; > - if ((xfsctl(file->name, file->fd, XFS_IOC_FSGETXATTR, &fsx)) < 0 || > + if ((xfsctl(file->name, file->fd, FS_IOC_FSGETXATTR, &fsx)) < 0 || > (xfsctl(file->name, file->fd, XFS_IOC_FSGETXATTRA, &fsxa)) < 0) { > - perror("XFS_IOC_FSGETXATTR"); > + perror("FS_IOC_FSGETXATTR"); > } else { > printf(_("fsxattr.xflags = 0x%x "), fsx.fsx_xflags); > printxattr(fsx.fsx_xflags, verbose, 0, file->name, 1, 1); > @@ -193,15 +193,15 @@ openfile( > if (!(flags & IO_READONLY) && (flags & IO_REALTIME)) { > struct fsxattr attr; > > - if (xfsctl(path, fd, XFS_IOC_FSGETXATTR, &attr) < 0) { > - perror("XFS_IOC_FSGETXATTR"); > + if (xfsctl(path, fd, FS_IOC_FSGETXATTR, &attr) < 0) { > + perror("FS_IOC_FSGETXATTR"); > close(fd); > return -1; > } > - if (!(attr.fsx_xflags & XFS_XFLAG_REALTIME)) { > - attr.fsx_xflags |= XFS_XFLAG_REALTIME; > - if (xfsctl(path, fd, XFS_IOC_FSSETXATTR, &attr) < 0) { > - perror("XFS_IOC_FSSETXATTR"); > + if (!(attr.fsx_xflags & FS_XFLAG_REALTIME)) { > + attr.fsx_xflags |= FS_XFLAG_REALTIME; > + if (xfsctl(path, fd, FS_IOC_FSSETXATTR, &attr) < 0) { > + perror("FS_IOC_FSSETXATTR"); > close(fd); > return -1; > } > @@ -559,8 +559,8 @@ get_extsize(const char *path, int fd) > { > struct fsxattr fsx; > > - if ((xfsctl(path, fd, XFS_IOC_FSGETXATTR, &fsx)) < 0) { > - printf("%s: XFS_IOC_FSGETXATTR %s: %s\n", > + if ((xfsctl(path, fd, FS_IOC_FSGETXATTR, &fsx)) < 0) { > + printf("%s: FS_IOC_FSGETXATTR %s: %s\n", > progname, path, strerror(errno)); > return 0; > } > @@ -578,24 +578,24 @@ set_extsize(const char *path, int fd, long extsz) > perror("fstat64"); > return 0; > } > - if ((xfsctl(path, fd, XFS_IOC_FSGETXATTR, &fsx)) < 0) { > - printf("%s: XFS_IOC_FSGETXATTR %s: %s\n", > + if ((xfsctl(path, fd, FS_IOC_FSGETXATTR, &fsx)) < 0) { > + printf("%s: FS_IOC_FSGETXATTR %s: %s\n", > progname, path, strerror(errno)); > return 0; > } > > if (S_ISREG(stat.st_mode)) { > - fsx.fsx_xflags |= XFS_XFLAG_EXTSIZE; > + fsx.fsx_xflags |= FS_XFLAG_EXTSIZE; > } else if (S_ISDIR(stat.st_mode)) { > - fsx.fsx_xflags |= XFS_XFLAG_EXTSZINHERIT; > + fsx.fsx_xflags |= FS_XFLAG_EXTSZINHERIT; > } else { > printf(_("invalid target file type - file %s\n"), path); > return 0; > } > fsx.fsx_extsize = extsz; > > - if ((xfsctl(path, fd, XFS_IOC_FSSETXATTR, &fsx)) < 0) { > - printf("%s: XFS_IOC_FSSETXATTR %s: %s\n", > + if ((xfsctl(path, fd, FS_IOC_FSSETXATTR, &fsx)) < 0) { > + printf("%s: FS_IOC_FSSETXATTR %s: %s\n", > progname, path, strerror(errno)); > return 0; > } > diff --git a/libxcmd/projects.c b/libxcmd/projects.c > index 24ef70a..c9e863d 100644 > --- a/libxcmd/projects.c > +++ b/libxcmd/projects.c > @@ -176,8 +176,8 @@ getprojid( > { > struct fsxattr fsx; > > - if (xfsctl(name, fd, XFS_IOC_FSGETXATTR, &fsx)) { > - perror("XFS_IOC_FSGETXATTR"); > + if (xfsctl(name, fd, FS_IOC_FSGETXATTR, &fsx)) { > + perror("FS_IOC_FSGETXATTR"); > return -1; > } > *projid = fsx.fsx_projid; > @@ -193,9 +193,9 @@ setprojid( > struct fsxattr fsx; > int error; > > - if ((error = xfsctl(name, fd, XFS_IOC_FSGETXATTR, &fsx)) == 0) { > + if ((error = xfsctl(name, fd, FS_IOC_FSGETXATTR, &fsx)) == 0) { > fsx.fsx_projid = projid; > - error = xfsctl(name, fd, XFS_IOC_FSSETXATTR, &fsx); > + error = xfsctl(name, fd, FS_IOC_FSSETXATTR, &fsx); > } > return error; > } > diff --git a/libxfs/xfs_format.h b/libxfs/xfs_format.h > index a35009a..967b1ef 100644 > --- a/libxfs/xfs_format.h > +++ b/libxfs/xfs_format.h > @@ -984,8 +984,6 @@ static inline void xfs_dinode_put_rdev(struct xfs_dinode *dip, xfs_dev_t rdev) > > /* > * Values for di_flags > - * There should be a one-to-one correspondence between these flags and the > - * XFS_XFLAG_s. > */ > #define XFS_DIFLAG_REALTIME_BIT 0 /* file's blocks come from rt area */ > #define XFS_DIFLAG_PREALLOC_BIT 1 /* file space has been preallocated */ > diff --git a/libxfs/xfs_fs.h b/libxfs/xfs_fs.h > index d8b733a..b9622ba 100644 > --- a/libxfs/xfs_fs.h > +++ b/libxfs/xfs_fs.h > @@ -36,38 +36,28 @@ struct dioattr { > #endif > > /* > - * Structure for XFS_IOC_FSGETXATTR[A] and XFS_IOC_FSSETXATTR. > + * Flags for the bs_xflags/fsx_xflags field in XFS_IOC_FS[GS]ETXATTR[A] > + * These are for backwards compatibility only. New code should > + * use the kernel [4.5 onwards] defined FS_XFLAG_* definitions directly. > */ > -#ifndef HAVE_FSXATTR > -struct fsxattr { > - __u32 fsx_xflags; /* xflags field value (get/set) */ > - __u32 fsx_extsize; /* extsize field value (get/set)*/ > - __u32 fsx_nextents; /* nextents field value (get) */ > - __u32 fsx_projid; /* project identifier (get/set) */ > - unsigned char fsx_pad[12]; > -}; > -#endif > - > -/* > - * Flags for the bs_xflags/fsx_xflags field > - * There should be a one-to-one correspondence between these flags and the > - * XFS_DIFLAG_s. > - */ > -#define XFS_XFLAG_REALTIME 0x00000001 /* data in realtime volume */ > -#define XFS_XFLAG_PREALLOC 0x00000002 /* preallocated file extents */ > -#define XFS_XFLAG_IMMUTABLE 0x00000008 /* file cannot be modified */ > -#define XFS_XFLAG_APPEND 0x00000010 /* all writes append */ > -#define XFS_XFLAG_SYNC 0x00000020 /* all writes synchronous */ > -#define XFS_XFLAG_NOATIME 0x00000040 /* do not update access time */ > -#define XFS_XFLAG_NODUMP 0x00000080 /* do not include in backups */ > -#define XFS_XFLAG_RTINHERIT 0x00000100 /* create with rt bit set */ > -#define XFS_XFLAG_PROJINHERIT 0x00000200 /* create with parents projid */ > -#define XFS_XFLAG_NOSYMLINKS 0x00000400 /* disallow symlink creation */ > -#define XFS_XFLAG_EXTSIZE 0x00000800 /* extent size allocator hint */ > -#define XFS_XFLAG_EXTSZINHERIT 0x00001000 /* inherit inode extent size */ > -#define XFS_XFLAG_NODEFRAG 0x00002000 /* do not defragment */ > -#define XFS_XFLAG_FILESTREAM 0x00004000 /* use filestream allocator */ > -#define XFS_XFLAG_HASATTR 0x80000000 /* no DIFLAG for this */ > +#define XFS_XFLAG_REALTIME FS_XFLAG_REALTIME > +#define XFS_XFLAG_PREALLOC FS_XFLAG_PREALLOC > +#define XFS_XFLAG_IMMUTABLE FS_XFLAG_IMMUTABLE > +#define XFS_XFLAG_APPEND FS_XFLAG_APPEND > +#define XFS_XFLAG_SYNC FS_XFLAG_SYNC > +#define XFS_XFLAG_NOATIME FS_XFLAG_NOATIME > +#define XFS_XFLAG_NODUMP FS_XFLAG_NODUMP > +#define XFS_XFLAG_RTINHERIT FS_XFLAG_RTINHERIT > +#define XFS_XFLAG_PROJINHERIT FS_XFLAG_PROJINHERIT > +#define XFS_XFLAG_NOSYMLINKS FS_XFLAG_NOSYMLINKS > +#define XFS_XFLAG_EXTSIZE FS_XFLAG_EXTSIZE > +#define XFS_XFLAG_EXTSZINHERIT FS_XFLAG_EXTSZINHERIT > +#define XFS_XFLAG_NODEFRAG FS_XFLAG_NODEFRAG > +#define XFS_XFLAG_FILESTREAM FS_XFLAG_FILESTREAM > +#define XFS_XFLAG_HASATTR FS_XFLAG_HASATTR > + > +#define XFS_IOC_FSGETXATTR FS_IOC_FSGETXATTR > +#define XFS_IOC_FSSETXATTR FS_IOC_FSSETXATTR > > /* > * Structure for XFS_IOC_GETBMAP. > @@ -513,8 +503,6 @@ typedef struct xfs_swapext > #define XFS_IOC_ALLOCSP _IOW ('X', 10, struct xfs_flock64) > #define XFS_IOC_FREESP _IOW ('X', 11, struct xfs_flock64) > #define XFS_IOC_DIOINFO _IOR ('X', 30, struct dioattr) > -#define XFS_IOC_FSGETXATTR _IOR ('X', 31, struct fsxattr) > -#define XFS_IOC_FSSETXATTR _IOW ('X', 32, struct fsxattr) > #define XFS_IOC_ALLOCSP64 _IOW ('X', 36, struct xfs_flock64) > #define XFS_IOC_FREESP64 _IOW ('X', 37, struct xfs_flock64) > #define XFS_IOC_GETBMAP _IOWR('X', 38, struct getbmap) > diff --git a/quota/free.c b/quota/free.c > index dcbe8ce..e9e0319 100644 > --- a/quota/free.c > +++ b/quota/free.c > @@ -143,13 +143,13 @@ projects_free_space_data( > return 0; > } > > - if ((xfsctl(path->fs_dir, fd, XFS_IOC_FSGETXATTR, &fsx)) < 0) { > + if ((xfsctl(path->fs_dir, fd, FS_IOC_FSGETXATTR, &fsx)) < 0) { > exitcode = 1; > - perror("XFS_IOC_FSGETXATTR"); > + perror("FS_IOC_FSGETXATTR"); > close(fd); > return 0; > } > - if (!(fsx.fsx_xflags & XFS_XFLAG_PROJINHERIT)) { > + if (!(fsx.fsx_xflags & FS_XFLAG_PROJINHERIT)) { > exitcode = 1; > fprintf(stderr, _("%s: project quota flag not set on %s\n"), > progname, path->fs_dir); > diff --git a/quota/project.c b/quota/project.c > index 17a83b0..fb8b9e1 100644 > --- a/quota/project.c > +++ b/quota/project.c > @@ -117,7 +117,7 @@ check_project( > exitcode = 1; > fprintf(stderr, _("%s: cannot open %s: %s\n"), > progname, path, strerror(errno)); > - } else if ((xfsctl(path, fd, XFS_IOC_FSGETXATTR, &fsx)) < 0) { > + } else if ((xfsctl(path, fd, FS_IOC_FSGETXATTR, &fsx)) < 0) { > exitcode = 1; > fprintf(stderr, _("%s: cannot get flags on %s: %s\n"), > progname, path, strerror(errno)); > @@ -126,7 +126,7 @@ check_project( > printf(_("%s - project identifier is not set" > " (inode=%u, tree=%u)\n"), > path, fsx.fsx_projid, (unsigned int)prid); > - if (!(fsx.fsx_xflags & XFS_XFLAG_PROJINHERIT)) > + if (!(fsx.fsx_xflags & FS_XFLAG_PROJINHERIT)) > printf(_("%s - project inheritance flag is not set\n"), > path); > } > @@ -163,7 +163,7 @@ clear_project( > fprintf(stderr, _("%s: cannot open %s: %s\n"), > progname, path, strerror(errno)); > return 0; > - } else if (xfsctl(path, fd, XFS_IOC_FSGETXATTR, &fsx) < 0) { > + } else if (xfsctl(path, fd, FS_IOC_FSGETXATTR, &fsx) < 0) { > exitcode = 1; > fprintf(stderr, _("%s: cannot get flags on %s: %s\n"), > progname, path, strerror(errno)); > @@ -172,8 +172,8 @@ clear_project( > } > > fsx.fsx_projid = 0; > - fsx.fsx_xflags &= ~XFS_XFLAG_PROJINHERIT; > - if (xfsctl(path, fd, XFS_IOC_FSSETXATTR, &fsx) < 0) { > + fsx.fsx_xflags &= ~FS_XFLAG_PROJINHERIT; > + if (xfsctl(path, fd, FS_IOC_FSSETXATTR, &fsx) < 0) { > exitcode = 1; > fprintf(stderr, _("%s: cannot clear project on %s: %s\n"), > progname, path, strerror(errno)); > @@ -210,7 +210,7 @@ setup_project( > fprintf(stderr, _("%s: cannot open %s: %s\n"), > progname, path, strerror(errno)); > return 0; > - } else if (xfsctl(path, fd, XFS_IOC_FSGETXATTR, &fsx) < 0) { > + } else if (xfsctl(path, fd, FS_IOC_FSGETXATTR, &fsx) < 0) { > exitcode = 1; > fprintf(stderr, _("%s: cannot get flags on %s: %s\n"), > progname, path, strerror(errno)); > @@ -219,8 +219,8 @@ setup_project( > } > > fsx.fsx_projid = prid; > - fsx.fsx_xflags |= XFS_XFLAG_PROJINHERIT; > - if (xfsctl(path, fd, XFS_IOC_FSSETXATTR, &fsx) < 0) { > + fsx.fsx_xflags |= FS_XFLAG_PROJINHERIT; > + if (xfsctl(path, fd, FS_IOC_FSSETXATTR, &fsx) < 0) { > exitcode = 1; > fprintf(stderr, _("%s: cannot set project on %s: %s\n"), > progname, path, strerror(errno)); > diff --git a/repair/dinode.c b/repair/dinode.c > index df28e9e..cbd4305 100644 > --- a/repair/dinode.c > +++ b/repair/dinode.c > @@ -2423,7 +2423,7 @@ _("bad (negative) size %" PRId64 " on inode %" PRIu64 "\n"), > XFS_DIFLAG_NOSYMLINKS); > } > } > - if (flags & (XFS_DIFLAG_REALTIME | XFS_XFLAG_EXTSIZE)) { > + if (flags & (XFS_DIFLAG_REALTIME | FS_XFLAG_EXTSIZE)) { > /* must be a file */ > if (di_mode && !S_ISREG(di_mode)) { > if (!uncertain) { > @@ -2432,7 +2432,7 @@ _("bad (negative) size %" PRId64 " on inode %" PRIu64 "\n"), > lino); > } > flags &= ~(XFS_DIFLAG_REALTIME | > - XFS_XFLAG_EXTSIZE); > + FS_XFLAG_EXTSIZE); > } > } > if (!verify_mode && flags != be16_to_cpu(dino->di_flags)) { > diff --git a/rtcp/xfs_rtcp.c b/rtcp/xfs_rtcp.c > index f604b46..3044350 100644 > --- a/rtcp/xfs_rtcp.c > +++ b/rtcp/xfs_rtcp.c > @@ -186,13 +186,13 @@ rtcp( char *source, char *target, int fextsize) > /* > * mark the file as a realtime file > */ > - fsxattr.fsx_xflags = XFS_XFLAG_REALTIME; > + fsxattr.fsx_xflags = FS_XFLAG_REALTIME; > if (fextsize != -1 ) > fsxattr.fsx_extsize = fextsize; > else > fsxattr.fsx_extsize = 0; > > - if ( xfsctl(tbuf, tofd, XFS_IOC_FSSETXATTR, &fsxattr) ) { > + if ( xfsctl(tbuf, tofd, FS_IOC_FSSETXATTR, &fsxattr) ) { > fprintf(stderr, > _("%s: set attributes on %s failed: %s\n"), > progname, tbuf, strerror(errno)); > @@ -210,7 +210,7 @@ rtcp( char *source, char *target, int fextsize) > return( -1 ); > } > > - if ( xfsctl(tbuf, tofd, XFS_IOC_FSGETXATTR, &fsxattr) ) { > + if ( xfsctl(tbuf, tofd, FS_IOC_FSGETXATTR, &fsxattr) ) { > fprintf(stderr, > _("%s: get attributes of %s failed: %s\n"), > progname, tbuf, strerror(errno)); > @@ -221,7 +221,7 @@ rtcp( char *source, char *target, int fextsize) > /* > * check if the existing file is already a realtime file > */ > - if ( !(fsxattr.fsx_xflags & XFS_XFLAG_REALTIME) ) { > + if ( !(fsxattr.fsx_xflags & FS_XFLAG_REALTIME) ) { > fprintf(stderr, _("%s: %s is not a realtime file.\n"), > progname, tbuf); > close( tofd ); > @@ -255,10 +255,10 @@ rtcp( char *source, char *target, int fextsize) > > fsxattr.fsx_xflags = 0; > fsxattr.fsx_extsize = 0; > - if ( xfsctl(source, fromfd, XFS_IOC_FSGETXATTR, &fsxattr) ) { > + if ( xfsctl(source, fromfd, FS_IOC_FSGETXATTR, &fsxattr) ) { > reopen = 1; > } else { > - if (! (fsxattr.fsx_xflags & XFS_XFLAG_REALTIME) ){ > + if (! (fsxattr.fsx_xflags & FS_XFLAG_REALTIME) ){ > fprintf(stderr, _("%s: %s is not a realtime file.\n"), > progname, source); > reopen = 1; > From sandeen@sandeen.net Mon Feb 15 17:44:16 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=ham version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay2.corp.sgi.com [137.38.102.29]) by oss.sgi.com (Postfix) with ESMTP id 4F86029DF5 for ; Mon, 15 Feb 2016 17:44:16 -0600 (CST) Received: from cuda.sgi.com (cuda2.sgi.com [192.48.176.25]) by relay2.corp.sgi.com (Postfix) with ESMTP id 3DE38304039 for ; Mon, 15 Feb 2016 15:44:16 -0800 (PST) X-ASG-Debug-ID: 1455579854-04cbb04333102a80001-NocioJ Received: from sandeen.net (sandeen.net [63.231.237.45]) by cuda.sgi.com with ESMTP id J30zKMmcGveY55oi for ; Mon, 15 Feb 2016 15:44:14 -0800 (PST) X-Barracuda-Envelope-From: sandeen@sandeen.net X-Barracuda-Apparent-Source-IP: 63.231.237.45 Received: from liberator.sandeen.net (liberator.sandeen.net [10.0.0.4]) (using TLSv1.2 with cipher DHE-RSA-AES128-SHA (128/128 bits)) (No client certificate requested) by sandeen.net (Postfix) with ESMTPSA id 4795563C5FF0 for ; Mon, 15 Feb 2016 17:44:14 -0600 (CST) Subject: Re: [PATCH 2/3] xfs: introduce per-inode DAX enablement To: xfs@oss.sgi.com X-ASG-Orig-Subj: Re: [PATCH 2/3] xfs: introduce per-inode DAX enablement References: <1455514346-15481-1-git-send-email-david@fromorbit.com> <1455514346-15481-3-git-send-email-david@fromorbit.com> From: Eric Sandeen Message-ID: <56C262CD.9030701@sandeen.net> Date: Mon, 15 Feb 2016 17:44:13 -0600 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.11; rv:38.0) Gecko/20100101 Thunderbird/38.5.1 MIME-Version: 1.0 In-Reply-To: <1455514346-15481-3-git-send-email-david@fromorbit.com> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit X-Barracuda-Connect: sandeen.net[63.231.237.45] X-Barracuda-Start-Time: 1455579854 X-Barracuda-URL: https://192.48.176.25:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-BRTS-Status: 1 X-Barracuda-Spam-Score: 1.00 X-Barracuda-Spam-Status: No, SCORE=1.00 using per-user scores of TAG_LEVEL=1000.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.7 tests=BSF_SC2_SA016_OB X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.3.27059 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 1.00 BSF_SC2_SA016_OB Custom Rule SA016_OB On 2/14/16 11:32 PM, Dave Chinner wrote: > From: Dave Chinner > > Source kernel commit 58f88ca2df7270881de2034c8286233a89efe71c > > Rather than just being able to turn DAX on and off via a mount > option, some applications may only want to enable DAX for certain > performance critical files in a filesystem. > > This patch introduces a new inode flag to enable DAX in the v3 inode > di_flags2 field. It adds support for setting and clearing flags in > the di_flags2 field via the XFS_IOC_FSSETXATTR ioctl, and sets the > S_DAX inode flag appropriately when it is seen. > > When this flag is set on a directory, it acts as an "inherit flag". > That is, inodes created in the directory will automatically inherit > the on-disk inode DAX flag, enabling administrators to set up > directory heirarchies that automatically use DAX. Setting this flag > on an empty root directory will make the entire filesystem use DAX > by default. > > Signed-off-by: Dave Chinner > Signed-off-by: Dave Chinner Reviewed-by: Eric Sandeen > --- > libxfs/xfs_format.h | 9 +++++++++ > 1 file changed, 9 insertions(+) > > diff --git a/libxfs/xfs_format.h b/libxfs/xfs_format.h > index 967b1ef..7eae0a5 100644 > --- a/libxfs/xfs_format.h > +++ b/libxfs/xfs_format.h > @@ -1024,6 +1024,15 @@ static inline void xfs_dinode_put_rdev(struct xfs_dinode *dip, xfs_dev_t rdev) > XFS_DIFLAG_EXTSZINHERIT | XFS_DIFLAG_NODEFRAG | XFS_DIFLAG_FILESTREAM) > > /* > + * Values for di_flags2 These start by being exposed to userspace in the upper > + * 16 bits of the XFS_XFLAG_s range. > + */ > +#define XFS_DIFLAG2_DAX_BIT 0 /* use DAX for this inode */ > +#define XFS_DIFLAG2_DAX (1 << XFS_DIFLAG2_DAX_BIT) > + > +#define XFS_DIFLAG2_ANY (XFS_DIFLAG2_DAX) > + > +/* > * Inode number format: > * low inopblog bits - offset in block > * next agblklog bits - block number in ag > From sandeen@sandeen.net Mon Feb 15 17:46:17 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=ham version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay3.corp.sgi.com [198.149.34.15]) by oss.sgi.com (Postfix) with ESMTP id B7A9629DF5 for ; Mon, 15 Feb 2016 17:46:17 -0600 (CST) Received: from cuda.sgi.com (cuda2.sgi.com [192.48.176.25]) by relay3.corp.sgi.com (Postfix) with ESMTP id 3E911AC003 for ; Mon, 15 Feb 2016 15:46:17 -0800 (PST) X-ASG-Debug-ID: 1455579975-04cbb04331102af0001-NocioJ Received: from sandeen.net (sandeen.net [63.231.237.45]) by cuda.sgi.com with ESMTP id qdC7rGBR6RLlwPsZ for ; Mon, 15 Feb 2016 15:46:15 -0800 (PST) X-Barracuda-Envelope-From: sandeen@sandeen.net X-Barracuda-Apparent-Source-IP: 63.231.237.45 Received: from liberator.sandeen.net (liberator.sandeen.net [10.0.0.4]) (using TLSv1.2 with cipher DHE-RSA-AES128-SHA (128/128 bits)) (No client certificate requested) by sandeen.net (Postfix) with ESMTPSA id 62A1963C5FF0 for ; Mon, 15 Feb 2016 17:46:15 -0600 (CST) Subject: Re: [PATCH 3/3] xfs_io: add support for changing the new inode DAX attribute To: xfs@oss.sgi.com X-ASG-Orig-Subj: Re: [PATCH 3/3] xfs_io: add support for changing the new inode DAX attribute References: <1455514346-15481-1-git-send-email-david@fromorbit.com> <1455514346-15481-4-git-send-email-david@fromorbit.com> From: Eric Sandeen Message-ID: <56C26346.6070609@sandeen.net> Date: Mon, 15 Feb 2016 17:46:14 -0600 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.11; rv:38.0) Gecko/20100101 Thunderbird/38.5.1 MIME-Version: 1.0 In-Reply-To: <1455514346-15481-4-git-send-email-david@fromorbit.com> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit X-Barracuda-Connect: sandeen.net[63.231.237.45] X-Barracuda-Start-Time: 1455579975 X-Barracuda-URL: https://192.48.176.25:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-BRTS-Status: 1 X-Barracuda-Spam-Score: 0.00 X-Barracuda-Spam-Status: No, SCORE=0.00 using per-user scores of TAG_LEVEL=1000.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.7 tests= X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.3.27059 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- On 2/14/16 11:32 PM, Dave Chinner wrote: > From: Dave Chinner > > It is changed via the FS_IOC_FSSETXATTR ioctl, so add the new flag > to the platform definitions for userspace that don't this API. Then > add support to the relevant xfs_io chattr and stat commands. > > Signed-off-by: Dave Chinner Reviewed-by: Eric Sandeen > --- > include/darwin.h | 1 + > include/freebsd.h | 1 + > include/irix.h | 1 + > include/linux.h | 1 + > io/attr.c | 5 ++++- > 5 files changed, 8 insertions(+), 1 deletion(-) > > diff --git a/include/darwin.h b/include/darwin.h > index 2baa536..a52030d 100644 > --- a/include/darwin.h > +++ b/include/darwin.h > @@ -312,6 +312,7 @@ struct fsxattr { > #define FS_XFLAG_EXTSZINHERIT 0x00001000 /* inherit inode extent size */ > #define FS_XFLAG_NODEFRAG 0x00002000 /* do not defragment */ > #define FS_XFLAG_FILESTREAM 0x00004000 /* use filestream allocator */ > +#define FS_XFLAG_DAX 0x00008000 /* use DAX for IO */ > #define FS_XFLAG_HASATTR 0x80000000 /* no DIFLAG for this */ > > #define FS_IOC_FSGETXATTR _IOR ('X', 31, struct fsxattr) > diff --git a/include/freebsd.h b/include/freebsd.h > index fe567d4..f7e0c75 100644 > --- a/include/freebsd.h > +++ b/include/freebsd.h > @@ -202,6 +202,7 @@ struct fsxattr { > #define FS_XFLAG_EXTSZINHERIT 0x00001000 /* inherit inode extent size */ > #define FS_XFLAG_NODEFRAG 0x00002000 /* do not defragment */ > #define FS_XFLAG_FILESTREAM 0x00004000 /* use filestream allocator */ > +#define FS_XFLAG_DAX 0x00008000 /* use DAX for IO */ > #define FS_XFLAG_HASATTR 0x80000000 /* no DIFLAG for this */ > > #define FS_IOC_FSGETXATTR _IOR ('X', 31, struct fsxattr) > diff --git a/include/irix.h b/include/irix.h > index bdb4b6a..c2191ee 100644 > --- a/include/irix.h > +++ b/include/irix.h > @@ -447,6 +447,7 @@ struct fsxattr { > #define FS_XFLAG_EXTSZINHERIT 0x00001000 /* inherit inode extent size */ > #define FS_XFLAG_NODEFRAG 0x00002000 /* do not defragment */ > #define FS_XFLAG_FILESTREAM 0x00004000 /* use filestream allocator */ > +#define FS_XFLAG_DAX 0x00008000 /* use DAX for IO */ > #define FS_XFLAG_HASATTR 0x80000000 /* no DIFLAG for this */ > > #define FS_IOC_FSGETXATTR F_FSGETXATTR > diff --git a/include/linux.h b/include/linux.h > index 17391c3..cc0f70c 100644 > --- a/include/linux.h > +++ b/include/linux.h > @@ -205,6 +205,7 @@ struct fsxattr { > #define FS_XFLAG_EXTSZINHERIT 0x00001000 /* inherit inode extent size */ > #define FS_XFLAG_NODEFRAG 0x00002000 /* do not defragment */ > #define FS_XFLAG_FILESTREAM 0x00004000 /* use filestream allocator */ > +#define FS_XFLAG_DAX 0x00008000 /* use DAX for IO */ > #define FS_XFLAG_HASATTR 0x80000000 /* no DIFLAG for this */ > > #define FS_IOC_FSGETXATTR _IOR ('X', 31, struct fsxattr) > diff --git a/io/attr.c b/io/attr.c > index 6fa08bf..0186b1d 100644 > --- a/io/attr.c > +++ b/io/attr.c > @@ -47,9 +47,10 @@ static struct xflags { > { FS_XFLAG_EXTSZINHERIT, "E", "extsz-inherit" }, > { FS_XFLAG_NODEFRAG, "f", "no-defrag" }, > { FS_XFLAG_FILESTREAM, "S", "filestream" }, > + { FS_XFLAG_DAX, "x", "dax" }, > { 0, NULL, NULL } > }; > -#define CHATTR_XFLAG_LIST "r"/*p*/"iasAdtPneEfS" > +#define CHATTR_XFLAG_LIST "r"/*p*/"iasAdtPneEfSx" > > static void > lsattr_help(void) > @@ -73,6 +74,7 @@ lsattr_help(void) > " E -- children created in this directory inherit the extent size value\n" > " f -- do not include this file when defragmenting the filesystem\n" > " S -- enable filestreams allocator for this directory\n" > +" x -- Use direct access (DAX) for data in this file\n" > "\n" > " Options:\n" > " -R -- recursively descend (useful when current file is a directory)\n" > @@ -108,6 +110,7 @@ chattr_help(void) > " +/-E -- set/clear the extent-size inheritance flag\n" > " +/-f -- set/clear the no-defrag flag\n" > " +/-S -- set/clear the filestreams allocator flag\n" > +" +/-x -- set/clear the direct access (DAX) flag\n" > " Note1: user must have certain capabilities to modify immutable/append-only.\n" > " Note2: immutable/append-only files cannot be deleted; removing these files\n" > " requires the immutable/append-only flag to be cleared first.\n" > From sandeen@sandeen.net Mon Feb 15 18:12:10 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=ham version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay2.corp.sgi.com [137.38.102.29]) by oss.sgi.com (Postfix) with ESMTP id 8CD4F7CA2 for ; Mon, 15 Feb 2016 18:12:10 -0600 (CST) Received: from cuda.sgi.com (cuda2.sgi.com [192.48.176.25]) by relay2.corp.sgi.com (Postfix) with ESMTP id 6D922304032 for ; Mon, 15 Feb 2016 16:12:07 -0800 (PST) X-ASG-Debug-ID: 1455581525-04cbb043311031c0001-NocioJ Received: from sandeen.net (sandeen.net [63.231.237.45]) by cuda.sgi.com with ESMTP id h6WzgKsAQJZVuMDR for ; Mon, 15 Feb 2016 16:12:06 -0800 (PST) X-Barracuda-Envelope-From: sandeen@sandeen.net X-Barracuda-Apparent-Source-IP: 63.231.237.45 Received: from liberator.sandeen.net (liberator.sandeen.net [10.0.0.4]) (using TLSv1.2 with cipher DHE-RSA-AES128-SHA (128/128 bits)) (No client certificate requested) by sandeen.net (Postfix) with ESMTPSA id AD16063C5FF0 for ; Mon, 15 Feb 2016 18:12:05 -0600 (CST) Subject: Re: [PATCH 4/4] xfs: XFS_DIFLAG2_DAX limited by PAGE_SIZE To: xfs@oss.sgi.com X-ASG-Orig-Subj: Re: [PATCH 4/4] xfs: XFS_DIFLAG2_DAX limited by PAGE_SIZE References: <1455513734-15192-1-git-send-email-david@fromorbit.com> <1455513734-15192-5-git-send-email-david@fromorbit.com> From: Eric Sandeen Message-ID: <56C26954.2010001@sandeen.net> Date: Mon, 15 Feb 2016 18:12:04 -0600 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.11; rv:38.0) Gecko/20100101 Thunderbird/38.5.1 MIME-Version: 1.0 In-Reply-To: <1455513734-15192-5-git-send-email-david@fromorbit.com> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit X-Barracuda-Connect: sandeen.net[63.231.237.45] X-Barracuda-Start-Time: 1455581525 X-Barracuda-URL: https://192.48.176.25:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-BRTS-Status: 1 X-Barracuda-Spam-Score: 0.00 X-Barracuda-Spam-Status: No, SCORE=0.00 using per-user scores of TAG_LEVEL=1000.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.7 tests= X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.3.27060 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- On 2/14/16 11:22 PM, Dave Chinner wrote: > From: Dave Chinner > > If the block size of a filesystem is not at least PAGE_SIZEd, then > at this point in time DAX cannot be used due to the fact we can't > guarantee extents are page sized or aligned without further work. > Hence disallow setting the DAX flag on an inode if the block size is > too small. Also, be defensive and check the block size when reading > an inode in off disk. > > In future, we want to allow DAX to work on any filesystem, so this > is temporary while we sort of the correct conbination of extent size > hints and allocation alignment configurations needed to guarantee > page sized and aligned extent allocation for DAX enabled files. > > Signed-off-by: Dave Chinner > --- > fs/xfs/xfs_ioctl.c | 12 ++++++++---- > fs/xfs/xfs_iops.c | 1 + > 2 files changed, 9 insertions(+), 4 deletions(-) > > diff --git a/fs/xfs/xfs_ioctl.c b/fs/xfs/xfs_ioctl.c > index a870d16..8e9cd3c 100644 > --- a/fs/xfs/xfs_ioctl.c > +++ b/fs/xfs/xfs_ioctl.c > @@ -1080,11 +1080,15 @@ xfs_ioctl_setattr_dax_invalidate( > > /* > * It is only valid to set the DAX flag on regular files and > - * directories. On directories it serves as an inherit hint. > + * directories on filesystems where the block size is at least the page ^^^^^^^^ > + * size. On directories it serves as an inherit hint. > */ > - if ((fa->fsx_xflags & FS_XFLAG_DAX) && > - !(S_ISREG(inode->i_mode) || S_ISDIR(inode->i_mode))) > - return -EINVAL; > + if (fa->fsx_xflags & FS_XFLAG_DAX) { > + if (!(S_ISREG(inode->i_mode) || S_ISDIR(inode->i_mode))) > + return -EINVAL; > + if (ip->i_mount->m_sb.sb_blocksize != PAGE_SIZE) ^^ So which is it, at least PAGE_SIZE or == PAGE_SIZE? > + return -EINVAL; > + } > > /* If the DAX state is not changing, we have nothing to do here. */ > if ((fa->fsx_xflags & FS_XFLAG_DAX) && IS_DAX(inode)) > diff --git a/fs/xfs/xfs_iops.c b/fs/xfs/xfs_iops.c > index 9c984a0..fb7dc61 100644 > --- a/fs/xfs/xfs_iops.c > +++ b/fs/xfs/xfs_iops.c > @@ -1186,6 +1186,7 @@ xfs_diflags_to_iflags( > if (flags & XFS_DIFLAG_NOATIME) > inode->i_flags |= S_NOATIME; > if (S_ISREG(inode->i_mode) && > + ip->i_mount->m_sb.sb_blocksize == PAGE_SIZE && > (ip->i_mount->m_flags & XFS_MOUNT_DAX || > ip->i_d.di_flags2 & XFS_DIFLAG2_DAX)) > inode->i_flags |= S_DAX; Is it possible to get mounted with XFS_MOUNT_DAX if blocksize != PAGE_SIZE? If so, should it be? This seems like a strange place to catch this mismatch. -Eric From sandeen@sandeen.net Mon Feb 15 18:12:58 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=ham version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay1.corp.sgi.com [137.38.102.111]) by oss.sgi.com (Postfix) with ESMTP id 930127CA2 for ; Mon, 15 Feb 2016 18:12:58 -0600 (CST) Received: from cuda.sgi.com (cuda3.sgi.com [192.48.176.15]) by relay1.corp.sgi.com (Postfix) with ESMTP id 82E028F8033 for ; Mon, 15 Feb 2016 16:12:54 -0800 (PST) X-ASG-Debug-ID: 1455581571-04cb6c1e56ea7d0001-NocioJ Received: from sandeen.net (sandeen.net [63.231.237.45]) by cuda.sgi.com with ESMTP id r5sK8xZfNyxgZfkK for ; Mon, 15 Feb 2016 16:12:51 -0800 (PST) X-Barracuda-Envelope-From: sandeen@sandeen.net X-Barracuda-Apparent-Source-IP: 63.231.237.45 Received: from liberator.sandeen.net (liberator.sandeen.net [10.0.0.4]) (using TLSv1.2 with cipher DHE-RSA-AES128-SHA (128/128 bits)) (No client certificate requested) by sandeen.net (Postfix) with ESMTPSA id 4F8BC63C5FF0 for ; Mon, 15 Feb 2016 18:12:51 -0600 (CST) Subject: Re: [PATCH v3] xfs_quota: modify commands which can't handle multiple types To: xfs@oss.sgi.com X-ASG-Orig-Subj: Re: [PATCH v3] xfs_quota: modify commands which can't handle multiple types References: <1455554759-29213-1-git-send-email-zlang@redhat.com> From: Eric Sandeen Message-ID: <56C26982.3020900@sandeen.net> Date: Mon, 15 Feb 2016 18:12:50 -0600 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.11; rv:38.0) Gecko/20100101 Thunderbird/38.5.1 MIME-Version: 1.0 In-Reply-To: <1455554759-29213-1-git-send-email-zlang@redhat.com> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit X-Barracuda-Connect: sandeen.net[63.231.237.45] X-Barracuda-Start-Time: 1455581571 X-Barracuda-URL: https://192.48.176.15:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-BRTS-Status: 1 X-Barracuda-Spam-Score: 1.25 X-Barracuda-Spam-Status: No, SCORE=1.25 using per-user scores of TAG_LEVEL=1000.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.7 tests=BSF_RULE_7580G, BSF_SC0_MV0713 X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.3.27060 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 0.75 BSF_RULE_7580G Custom Rule 7580G 0.50 BSF_SC0_MV0713 Custom rule MV0713 On 2/15/16 10:45 AM, Zorro Lang wrote: > Some xfs_quota commands can't deal with multiple types together. > For example, if we run "limit -ug ...", one type will overwrite > the other. I find below commands can't handle multiple types: > > [quota, limit, timer, warn, dump, restore and quot] > > (Although timer and warn command can't support -ugp types until > now, it will in one day.) > > For every single $command, I change their ${command}_f function, > ${command}_cmd structure and man page. > > Signed-off-by: Zorro Lang Reviewed-by: Eric Sandeen > --- > man/man8/xfs_quota.8 | 14 ++++++------ > quota/edit.c | 60 ++++++++++++++++++++++++++++++++++------------------ > quota/quot.c | 15 ++++++++----- > quota/quota.c | 15 ++++++++----- > quota/report.c | 20 ++++++++++++------ > 5 files changed, 81 insertions(+), 43 deletions(-) > > diff --git a/man/man8/xfs_quota.8 b/man/man8/xfs_quota.8 > index 3bee145..951252b 100644 > --- a/man/man8/xfs_quota.8 > +++ b/man/man8/xfs_quota.8 > @@ -169,7 +169,7 @@ command. > .HP > .B quota > [ > -.B \-gpu > +.BR \-g " | " \-p " | " \-u > ] [ > .B \-bir > ] [ > @@ -398,7 +398,7 @@ option reports state on all filesystems and not just the current path. > .B > limit > [ > -.B \-gpu > +.BR \-g " | " \-p " | " \-u > ] > .BI bsoft= N > | > @@ -430,7 +430,7 @@ must be specified. > .HP > .B timer > [ > -.B \-gpu > +.BR \-g " | " \-p " | " \-u > ] [ > .B \-bir > ] > @@ -446,7 +446,7 @@ command. The value argument is a number of seconds, but units of > .HP > .B warn > [ > -.B \-gpu > +.BR \-g " | " \-p " | " \-u > ] [ > .B \-bir > ] > @@ -497,7 +497,7 @@ report an error. > .B > dump > [ > -.B \-gpu > +.BR \-g " | " \-p " | " \-u > ] [ > .B \-f > .I file > @@ -510,7 +510,7 @@ This is only the limits, not the usage information, of course. > .HP > .B restore > [ > -.B \-gpu > +.BR \-g " | " \-p " | " \-u > ] [ > .B \-f > .I file > @@ -525,7 +525,7 @@ command. > .B > quot > [ > -.B \-gpu > +.BR \-g " | " \-p " | " \-u > ] [ > .B \-bir > ] [ > diff --git a/quota/edit.c b/quota/edit.c > index 6146f7e..e5ddc8c 100644 > --- a/quota/edit.c > +++ b/quota/edit.c > @@ -282,13 +282,13 @@ limit_f( > flags |= DEFAULTS_FLAG; > break; > case 'g': > - type = XFS_GROUP_QUOTA; > + type |= XFS_GROUP_QUOTA; > break; > case 'p': > - type = XFS_PROJ_QUOTA; > + type |= XFS_PROJ_QUOTA; > break; > case 'u': > - type = XFS_USER_QUOTA; > + type |= XFS_USER_QUOTA; > break; > default: > return command_usage(&limit_cmd); > @@ -343,8 +343,13 @@ limit_f( > > name = (flags & DEFAULTS_FLAG) ? "0" : argv[optind++]; > > - if (!type) > + if (!type) { > type = XFS_USER_QUOTA; > + } else if (type != XFS_GROUP_QUOTA && > + type != XFS_PROJ_QUOTA && > + type != XFS_USER_QUOTA) { > + return command_usage(&limit_cmd); > + } > > switch (type) { > case XFS_USER_QUOTA: > @@ -422,13 +427,13 @@ restore_f( > fname = optarg; > break; > case 'g': > - type = XFS_GROUP_QUOTA; > + type |= XFS_GROUP_QUOTA; > break; > case 'p': > - type = XFS_PROJ_QUOTA; > + type |= XFS_PROJ_QUOTA; > break; > case 'u': > - type = XFS_USER_QUOTA; > + type |= XFS_USER_QUOTA; > break; > default: > return command_usage(&restore_cmd); > @@ -438,8 +443,13 @@ restore_f( > if (argc < optind) > return command_usage(&restore_cmd); > > - if (!type) > + if (!type) { > type = XFS_USER_QUOTA; > + } else if (type != XFS_GROUP_QUOTA && > + type != XFS_PROJ_QUOTA && > + type != XFS_USER_QUOTA) { > + return command_usage(&restore_cmd); > + } > > if (fname) { > if ((fp = fopen(fname, "r")) == NULL) { > @@ -501,13 +511,13 @@ timer_f( > mask |= FS_DQ_RTBTIMER; > break; > case 'g': > - type = XFS_GROUP_QUOTA; > + type |= XFS_GROUP_QUOTA; > break; > case 'p': > - type = XFS_PROJ_QUOTA; > + type |= XFS_PROJ_QUOTA; > break; > case 'u': > - type = XFS_USER_QUOTA; > + type |= XFS_USER_QUOTA; > break; > default: > return command_usage(&timer_cmd); > @@ -522,8 +532,13 @@ timer_f( > if (!mask) > mask = FS_DQ_TIMER_MASK; > > - if (!type) > + if (!type) { > type = XFS_USER_QUOTA; > + } else if (type != XFS_GROUP_QUOTA && > + type != XFS_PROJ_QUOTA && > + type != XFS_USER_QUOTA) { > + return command_usage(&timer_cmd); > + } > > set_timer(type, mask, fs_path->fs_name, value); > return 0; > @@ -630,13 +645,13 @@ warn_f( > mask |= FS_DQ_RTBWARNS; > break; > case 'g': > - type = XFS_GROUP_QUOTA; > + type |= XFS_GROUP_QUOTA; > break; > case 'p': > - type = XFS_PROJ_QUOTA; > + type |= XFS_PROJ_QUOTA; > break; > case 'u': > - type = XFS_USER_QUOTA; > + type |= XFS_USER_QUOTA; > break; > default: > return command_usage(&warn_cmd); > @@ -661,8 +676,13 @@ warn_f( > if (!mask) > mask = FS_DQ_WARNS_MASK; > > - if (!type) > + if (!type) { > type = XFS_USER_QUOTA; > + } else if (type != XFS_GROUP_QUOTA && > + type != XFS_PROJ_QUOTA && > + type != XFS_USER_QUOTA) { > + return command_usage(&warn_cmd); > + } > > switch (type) { > case XFS_USER_QUOTA: > @@ -686,7 +706,7 @@ edit_init(void) > limit_cmd.argmin = 2; > limit_cmd.argmax = -1; > limit_cmd.args = \ > - _("[-gpu] bsoft|bhard|isoft|ihard|rtbsoft|rtbhard=N -d|id|name"); > + _("[-g|-p|-u] bsoft|bhard|isoft|ihard|rtbsoft|rtbhard=N -d|id|name"); > limit_cmd.oneline = _("modify quota limits"); > limit_cmd.help = limit_help; > > @@ -694,14 +714,14 @@ edit_init(void) > restore_cmd.cfunc = restore_f; > restore_cmd.argmin = 0; > restore_cmd.argmax = -1; > - restore_cmd.args = _("[-gpu] [-f file]"); > + restore_cmd.args = _("[-g|-p|-u] [-f file]"); > restore_cmd.oneline = _("restore quota limits from a backup file"); > > timer_cmd.name = "timer"; > timer_cmd.cfunc = timer_f; > timer_cmd.argmin = 2; > timer_cmd.argmax = -1; > - timer_cmd.args = _("[-bir] [-gpu] value"); > + timer_cmd.args = _("[-bir] [-g|-p|-u] value"); > timer_cmd.oneline = _("set quota enforcement timeouts"); > timer_cmd.help = timer_help; > > @@ -709,7 +729,7 @@ edit_init(void) > warn_cmd.cfunc = warn_f; > warn_cmd.argmin = 2; > warn_cmd.argmax = -1; > - warn_cmd.args = _("[-bir] [-gpu] value -d|id|name"); > + warn_cmd.args = _("[-bir] [-g|-p|-u] value -d|id|name"); > warn_cmd.oneline = _("get/set enforcement warning counter"); > warn_cmd.help = warn_help; > > diff --git a/quota/quot.c b/quota/quot.c > index 9116e48..2e583e5 100644 > --- a/quota/quot.c > +++ b/quota/quot.c > @@ -361,13 +361,13 @@ quot_f( > form |= XFS_RTBLOCK_QUOTA; > break; > case 'g': > - type = XFS_GROUP_QUOTA; > + type |= XFS_GROUP_QUOTA; > break; > case 'p': > - type = XFS_PROJ_QUOTA; > + type |= XFS_PROJ_QUOTA; > break; > case 'u': > - type = XFS_USER_QUOTA; > + type |= XFS_USER_QUOTA; > break; > case 'a': > flags |= ALL_MOUNTS_FLAG; > @@ -389,8 +389,13 @@ quot_f( > if (!form) > form = XFS_BLOCK_QUOTA; > > - if (!type) > + if (!type) { > type = XFS_USER_QUOTA; > + } else if (type != XFS_GROUP_QUOTA && > + type != XFS_PROJ_QUOTA && > + type != XFS_USER_QUOTA) { > + return command_usage("_cmd); > + } > > if ((fp = fopen_write_secure(fname)) == NULL) > return 0; > @@ -416,7 +421,7 @@ quot_init(void) > quot_cmd.cfunc = quot_f; > quot_cmd.argmin = 0; > quot_cmd.argmax = -1; > - quot_cmd.args = _("[-bir] [-gpu] [-acv] [-f file]"); > + quot_cmd.args = _("[-bir] [-g|-p|-u] [-acv] [-f file]"); > quot_cmd.oneline = _("summarize filesystem ownership"); > quot_cmd.help = quot_help; > > diff --git a/quota/quota.c b/quota/quota.c > index f6b24c3..e0da7c0 100644 > --- a/quota/quota.c > +++ b/quota/quota.c > @@ -409,13 +409,13 @@ quota_f( > form |= XFS_RTBLOCK_QUOTA; > break; > case 'g': > - type = XFS_GROUP_QUOTA; > + type |= XFS_GROUP_QUOTA; > break; > case 'p': > - type = XFS_PROJ_QUOTA; > + type |= XFS_PROJ_QUOTA; > break; > case 'u': > - type = XFS_USER_QUOTA; > + type |= XFS_USER_QUOTA; > break; > case 'h': > flags |= HUMAN_FLAG; > @@ -437,8 +437,13 @@ quota_f( > if (!form) > form = XFS_BLOCK_QUOTA; > > - if (!type) > + if (!type) { > type = XFS_USER_QUOTA; > + } else if (type != XFS_GROUP_QUOTA && > + type != XFS_PROJ_QUOTA && > + type != XFS_USER_QUOTA) { > + return command_usage("a_cmd); > + } > > if ((fp = fopen_write_secure(fname)) == NULL) > return 0; > @@ -461,7 +466,7 @@ quota_init(void) > quota_cmd.cfunc = quota_f; > quota_cmd.argmin = 0; > quota_cmd.argmax = -1; > - quota_cmd.args = _("[-bir] [-gpu] [-hnNv] [-f file] [id|name]..."); > + quota_cmd.args = _("[-bir] [-g|-p|-u] [-hnNv] [-f file] [id|name]..."); > quota_cmd.oneline = _("show usage and limits"); > quota_cmd.help = quota_help; > > diff --git a/quota/report.c b/quota/report.c > index 8653134..48a3f29 100644 > --- a/quota/report.c > +++ b/quota/report.c > @@ -30,7 +30,7 @@ static cmdinfo_t report_cmd; > static void > dump_help(void) > { > - dump_cmd.args = _("[-gpu] [-f file]"); > + dump_cmd.args = _("[-g|-p|-u] [-f file]"); > dump_cmd.oneline = _("dump quota information for backup utilities"); > printf(_( > "\n" > @@ -199,7 +199,7 @@ dump_f( > FILE *fp; > char *fname = NULL; > uint lower = 0, upper = 0; > - int c, type = XFS_USER_QUOTA; > + int c, type = 0; > > while ((c = getopt(argc, argv, "f:gpuL:U:")) != EOF) { > switch(c) { > @@ -207,13 +207,13 @@ dump_f( > fname = optarg; > break; > case 'g': > - type = XFS_GROUP_QUOTA; > + type |= XFS_GROUP_QUOTA; > break; > case 'p': > - type = XFS_PROJ_QUOTA; > + type |= XFS_PROJ_QUOTA; > break; > case 'u': > - type = XFS_USER_QUOTA; > + type |= XFS_USER_QUOTA; > break; > case 'L': > lower = (uint)atoi(optarg); > @@ -229,6 +229,14 @@ dump_f( > if (argc != optind) > return command_usage(&dump_cmd); > > + if (!type) { > + type = XFS_USER_QUOTA; > + } else if (type != XFS_GROUP_QUOTA && > + type != XFS_PROJ_QUOTA && > + type != XFS_USER_QUOTA) { > + return command_usage(&dump_cmd); > + } > + > if ((fp = fopen_write_secure(fname)) == NULL) > return 0; > > @@ -725,7 +733,7 @@ report_init(void) > dump_cmd.cfunc = dump_f; > dump_cmd.argmin = 0; > dump_cmd.argmax = -1; > - dump_cmd.args = _("[-gpu] [-f file]"); > + dump_cmd.args = _("[-g|-p|-u] [-f file]"); > dump_cmd.oneline = _("dump quota information for backup utilities"); > dump_cmd.help = dump_help; > > From david@fromorbit.com Mon Feb 15 18:20:33 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=ham version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay3.corp.sgi.com [198.149.34.15]) by oss.sgi.com (Postfix) with ESMTP id 4FD9C7CA2 for ; Mon, 15 Feb 2016 18:20:33 -0600 (CST) Received: from cuda.sgi.com (cuda2.sgi.com [192.48.176.25]) by relay3.corp.sgi.com (Postfix) with ESMTP id D8B2BAC002 for ; Mon, 15 Feb 2016 16:20:29 -0800 (PST) X-ASG-Debug-ID: 1455582025-04cbb043311033a0001-NocioJ Received: from ipmail07.adl2.internode.on.net (ipmail07.adl2.internode.on.net [150.101.137.131]) by cuda.sgi.com with ESMTP id e192OClf7NWg9gdX for ; Mon, 15 Feb 2016 16:20:26 -0800 (PST) X-Barracuda-Envelope-From: david@fromorbit.com X-Barracuda-Apparent-Source-IP: 150.101.137.131 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: A2CfBgA6asJW/5bY03ZegzqBP4Joo2QCAQEBAQaLbolOhgcEAgKBN00BAQEBAQGBC4RBAQEBAwEnExwjEAgDGAklDwUlAyETiBIHt1ABAQgCAR0YhTGEfYQNhF8FlnmNTYFlhEOIVESNe2KDdyguhxeBOAEBAQ Received: from ppp118-211-216-150.lns20.syd4.internode.on.net (HELO dastard) ([118.211.216.150]) by ipmail07.adl2.internode.on.net with ESMTP; 16 Feb 2016 10:50:25 +1030 Received: from dave by dastard with local (Exim 4.80) (envelope-from ) id 1aVTNE-0002YR-Gg; Tue, 16 Feb 2016 11:20:12 +1100 Date: Tue, 16 Feb 2016 11:20:12 +1100 From: Dave Chinner To: Eric Sandeen Cc: xfs@oss.sgi.com Subject: Re: XFS fiemap issue with Linux 3.10.0-327.el7.x86_64 (CentOS 7) Message-ID: <20160216002012.GK14668@dastard> X-ASG-Orig-Subj: Re: XFS fiemap issue with Linux 3.10.0-327.el7.x86_64 (CentOS 7) References: <56C219F0.3050002@sandeen.net> <20160215204009.GJ14668@dastard> <56C25574.2060307@sandeen.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <56C25574.2060307@sandeen.net> User-Agent: Mutt/1.5.21 (2010-09-15) X-Barracuda-Connect: ipmail07.adl2.internode.on.net[150.101.137.131] X-Barracuda-Start-Time: 1455582025 X-Barracuda-URL: https://192.48.176.25:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-BRTS-Status: 1 X-Barracuda-Spam-Score: 0.00 X-Barracuda-Spam-Status: No, SCORE=0.00 using per-user scores of TAG_LEVEL=1000.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.7 tests=BSF_SC0_MISMATCH_TO X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.3.27060 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 0.00 BSF_SC0_MISMATCH_TO Envelope rcpt doesn't match header On Mon, Feb 15, 2016 at 04:47:16PM -0600, Eric Sandeen wrote: > > > On 2/15/16 2:40 PM, Dave Chinner wrote: > > On Mon, Feb 15, 2016 at 02:28:36PM -0500, Jim Wilcoxson wrote: > >> Thanks Eric. > >> > >> I ran xfs_bmap -v and it returned extents 0-19999, alternating data > >> with holes. The holes and data were various sizes, I suppose for xfs > >> alignment reasons, but everything was there. > >> > >> Running fiemap again after xfs_bmap still returned 1364 extents. > > > > Yes, fiemap in XFS uses a buffer size of: > > > > bm.bmv_count = min_t(__s32, bm.bmv_count, > > (PAGE_SIZE * 16 / sizeof(struct getbmapx))); > > > > i.e. limits a single fiemap fetch to a maximum of 64k of extent > > data. > > > > I think you have an incorrect assumption about fiemap behaviour. > > fiemap is not designed to return or even count all the extents in a > > file in a single call; > > I think it is; as was quoted earlier, > > "If fm_extent_count is zero, then the > fm_extents[] array is ignored (no extents will be returned), and the > fm_mapped_extents count will hold the number of extents needed in > fm_extents[] to hold the file's current mapping." > > and that's in there: > > /* only count the extents */ > if (fieinfo->fi_extents_max == 0) { > fieinfo->fi_extents_mapped++; > return (flags & FIEMAP_EXTENT_LAST) ? 1 : 0; > } Right, but I think we only pass one /internal/ buffer's extents to the fill function. When we run out of extents to process (i.e we hit the limit in the above extent count passed to xfs_getbmapx), it returns to userspace. This isn't a problem when iterating extent lists, because of the FIEMAP_EXTENT_LAST is exported to userspace. The problem appears to be that counting has different semantics, and I bet nobody wrote a regression test that covered this case.... > > on XFS it returns how many extents it can > > return in a single call. When you then map the file, if the > > FIEMAP_EXTENT_LAST is not set on the last extent returned, then the > > application needs to make another FIEMAP call from the end offset of > > last extent mapping returned in the last call, and it will then > > return the next N extents in the file. > > > > IOWs, you have to keep calling FIEMAP to map the entire file, not > > assume a single call will return an arbitrary amount of data to you > > in a single call. > > He's not trying to get all data in one call, just a count. I was under the impression that counting was a ranged operation, too. i.e. you can ask for the number of extents within a certain file offset. Maybe we have got counting wrong as FIEMAP_EXTENT_LAST is never exposed to userspace, nor does the fiemap code record the offset we counted up to, so it would be hard to iterate. Patches to fix the kernel, to support extent counting in xfs_io and a regression test, please! Cheers, Dave. -- Dave Chinner david@fromorbit.com From sandeen@sandeen.net Mon Feb 15 18:23:13 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=ham version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay1.corp.sgi.com [137.38.102.111]) by oss.sgi.com (Postfix) with ESMTP id ED62C7CA2 for ; Mon, 15 Feb 2016 18:23:13 -0600 (CST) Received: from cuda.sgi.com (cuda1.sgi.com [192.48.157.11]) by relay1.corp.sgi.com (Postfix) with ESMTP id BE6C78F8035 for ; Mon, 15 Feb 2016 16:23:13 -0800 (PST) X-ASG-Debug-ID: 1455582190-04bdf02d5b084e0001-NocioJ Received: from sandeen.net (sandeen.net [63.231.237.45]) by cuda.sgi.com with ESMTP id cbGyHUrPFB1X0wSJ for ; Mon, 15 Feb 2016 16:23:10 -0800 (PST) X-Barracuda-Envelope-From: sandeen@sandeen.net X-Barracuda-Apparent-Source-IP: 63.231.237.45 Received: from liberator.sandeen.net (liberator.sandeen.net [10.0.0.4]) (using TLSv1.2 with cipher DHE-RSA-AES128-SHA (128/128 bits)) (No client certificate requested) by sandeen.net (Postfix) with ESMTPSA id 816CC63C5FF0; Mon, 15 Feb 2016 18:23:10 -0600 (CST) Subject: Re: XFS fiemap issue with Linux 3.10.0-327.el7.x86_64 (CentOS 7) To: Dave Chinner X-ASG-Orig-Subj: Re: XFS fiemap issue with Linux 3.10.0-327.el7.x86_64 (CentOS 7) References: <56C219F0.3050002@sandeen.net> <20160215204009.GJ14668@dastard> <56C25574.2060307@sandeen.net> <20160216002012.GK14668@dastard> Cc: xfs@oss.sgi.com From: Eric Sandeen Message-ID: <56C26BED.6060401@sandeen.net> Date: Mon, 15 Feb 2016 18:23:09 -0600 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.11; rv:38.0) Gecko/20100101 Thunderbird/38.5.1 MIME-Version: 1.0 In-Reply-To: <20160216002012.GK14668@dastard> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit X-Barracuda-Connect: sandeen.net[63.231.237.45] X-Barracuda-Start-Time: 1455582190 X-Barracuda-URL: https://192.48.157.11:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-BRTS-Status: 1 X-Barracuda-Spam-Score: 0.00 X-Barracuda-Spam-Status: No, SCORE=0.00 using per-user scores of TAG_LEVEL=1000.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.7 tests=BSF_SC0_MISMATCH_TO X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.3.27060 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 0.00 BSF_SC0_MISMATCH_TO Envelope rcpt doesn't match header On 2/15/16 6:20 PM, Dave Chinner wrote: > On Mon, Feb 15, 2016 at 04:47:16PM -0600, Eric Sandeen wrote: >> >> >> On 2/15/16 2:40 PM, Dave Chinner wrote: >>> On Mon, Feb 15, 2016 at 02:28:36PM -0500, Jim Wilcoxson wrote: >>>> Thanks Eric. >>>> >>>> I ran xfs_bmap -v and it returned extents 0-19999, alternating data >>>> with holes. The holes and data were various sizes, I suppose for xfs >>>> alignment reasons, but everything was there. >>>> >>>> Running fiemap again after xfs_bmap still returned 1364 extents. >>> >>> Yes, fiemap in XFS uses a buffer size of: >>> >>> bm.bmv_count = min_t(__s32, bm.bmv_count, >>> (PAGE_SIZE * 16 / sizeof(struct getbmapx))); >>> >>> i.e. limits a single fiemap fetch to a maximum of 64k of extent >>> data. >>> >>> I think you have an incorrect assumption about fiemap behaviour. >>> fiemap is not designed to return or even count all the extents in a >>> file in a single call; >> >> I think it is; as was quoted earlier, >> >> "If fm_extent_count is zero, then the >> fm_extents[] array is ignored (no extents will be returned), and the >> fm_mapped_extents count will hold the number of extents needed in >> fm_extents[] to hold the file's current mapping." >> >> and that's in there: >> >> /* only count the extents */ >> if (fieinfo->fi_extents_max == 0) { >> fieinfo->fi_extents_mapped++; >> return (flags & FIEMAP_EXTENT_LAST) ? 1 : 0; >> } > > Right, but I think we only pass one /internal/ buffer's extents to > the fill function. When we run out of extents to process (i.e we hit > the limit in the above extent count passed to xfs_getbmapx), it > returns to userspace. > > This isn't a problem when iterating extent lists, because of the > FIEMAP_EXTENT_LAST is exported to userspace. The problem appears to > be that counting has different semantics, and I bet nobody wrote a > regression test that covered this case.... Yeah, I looked at xfs_io's fiemap, and there's no way to pass it a count-only set of options. >>> on XFS it returns how many extents it can >>> return in a single call. When you then map the file, if the >>> FIEMAP_EXTENT_LAST is not set on the last extent returned, then the >>> application needs to make another FIEMAP call from the end offset of >>> last extent mapping returned in the last call, and it will then >>> return the next N extents in the file. >>> >>> IOWs, you have to keep calling FIEMAP to map the entire file, not >>> assume a single call will return an arbitrary amount of data to you >>> in a single call. >> >> He's not trying to get all data in one call, just a count. > > I was under the impression that counting was a ranged operation, > too. i.e. you can ask for the number of extents within a certain > file offset. Maybe we have got counting wrong as FIEMAP_EXTENT_LAST > is never exposed to userspace, nor does the fiemap code record the > offset we counted up to, so it would be hard to iterate. > > Patches to fix the kernel, to support extent counting in xfs_io > and a regression test, please! Yep.... -Eric > Cheers, > > Dave. > From david@fromorbit.com Mon Feb 15 18:39:45 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=ham version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay3.corp.sgi.com [198.149.34.15]) by oss.sgi.com (Postfix) with ESMTP id 676327CA2 for ; Mon, 15 Feb 2016 18:39:45 -0600 (CST) Received: from cuda.sgi.com (cuda1.sgi.com [192.48.157.11]) by relay3.corp.sgi.com (Postfix) with ESMTP id E012BAC002 for ; Mon, 15 Feb 2016 16:39:44 -0800 (PST) X-ASG-Debug-ID: 1455583181-04bdf02d5e08870001-NocioJ Received: from ipmail07.adl2.internode.on.net (ipmail07.adl2.internode.on.net [150.101.137.131]) by cuda.sgi.com with ESMTP id bg1p9Mj0w1Svd2bO for ; Mon, 15 Feb 2016 16:39:42 -0800 (PST) X-Barracuda-Envelope-From: david@fromorbit.com X-Barracuda-Apparent-Source-IP: 150.101.137.131 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: A2DmBgDsbsJW/5bY03ZegzqBP4Joo2QCAQEBAQaLboVGhAiGBwICAQECgTdNAQEBAQEBgQuEQQEBAQMBJxMcIwULCAMSAwMJJQ8FJQMNFBOIEge3VwEBAQcCAR0YhTGEfYQMTIQUBZZ5jU2OfESNe2KDdyguhxYkgRUBAQE Received: from ppp118-211-216-150.lns20.syd4.internode.on.net (HELO dastard) ([118.211.216.150]) by ipmail07.adl2.internode.on.net with ESMTP; 16 Feb 2016 11:09:41 +1030 Received: from dave by dastard with local (Exim 4.80) (envelope-from ) id 1aVTfn-0002a1-Fw; Tue, 16 Feb 2016 11:39:23 +1100 Date: Tue, 16 Feb 2016 11:39:23 +1100 From: Dave Chinner To: Eric Sandeen Cc: xfs@oss.sgi.com Subject: Re: [PATCH 4/4] xfs: XFS_DIFLAG2_DAX limited by PAGE_SIZE Message-ID: <20160216003923.GL14668@dastard> X-ASG-Orig-Subj: Re: [PATCH 4/4] xfs: XFS_DIFLAG2_DAX limited by PAGE_SIZE References: <1455513734-15192-1-git-send-email-david@fromorbit.com> <1455513734-15192-5-git-send-email-david@fromorbit.com> <56C26954.2010001@sandeen.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <56C26954.2010001@sandeen.net> User-Agent: Mutt/1.5.21 (2010-09-15) X-Barracuda-Connect: ipmail07.adl2.internode.on.net[150.101.137.131] X-Barracuda-Start-Time: 1455583181 X-Barracuda-URL: https://192.48.157.11:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-BRTS-Status: 1 X-Barracuda-Spam-Score: 0.00 X-Barracuda-Spam-Status: No, SCORE=0.00 using per-user scores of TAG_LEVEL=1000.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.7 tests=BSF_SC0_MISMATCH_TO X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.3.27060 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 0.00 BSF_SC0_MISMATCH_TO Envelope rcpt doesn't match header On Mon, Feb 15, 2016 at 06:12:04PM -0600, Eric Sandeen wrote: > > > On 2/14/16 11:22 PM, Dave Chinner wrote: > > From: Dave Chinner > > > > If the block size of a filesystem is not at least PAGE_SIZEd, then > > at this point in time DAX cannot be used due to the fact we can't > > guarantee extents are page sized or aligned without further work. > > Hence disallow setting the DAX flag on an inode if the block size is > > too small. Also, be defensive and check the block size when reading > > an inode in off disk. > > > > In future, we want to allow DAX to work on any filesystem, so this > > is temporary while we sort of the correct conbination of extent size > > hints and allocation alignment configurations needed to guarantee > > page sized and aligned extent allocation for DAX enabled files. > > > > Signed-off-by: Dave Chinner > > --- > > fs/xfs/xfs_ioctl.c | 12 ++++++++---- > > fs/xfs/xfs_iops.c | 1 + > > 2 files changed, 9 insertions(+), 4 deletions(-) > > > > diff --git a/fs/xfs/xfs_ioctl.c b/fs/xfs/xfs_ioctl.c > > index a870d16..8e9cd3c 100644 > > --- a/fs/xfs/xfs_ioctl.c > > +++ b/fs/xfs/xfs_ioctl.c > > @@ -1080,11 +1080,15 @@ xfs_ioctl_setattr_dax_invalidate( > > > > /* > > * It is only valid to set the DAX flag on regular files and > > - * directories. On directories it serves as an inherit hint. > > + * directories on filesystems where the block size is at least the page > ^^^^^^^^ > > + * size. On directories it serves as an inherit hint. > > */ > > - if ((fa->fsx_xflags & FS_XFLAG_DAX) && > > - !(S_ISREG(inode->i_mode) || S_ISDIR(inode->i_mode))) > > - return -EINVAL; > > + if (fa->fsx_xflags & FS_XFLAG_DAX) { > > + if (!(S_ISREG(inode->i_mode) || S_ISDIR(inode->i_mode))) > > + return -EINVAL; > > + if (ip->i_mount->m_sb.sb_blocksize != PAGE_SIZE) > ^^ > > So which is it, at least PAGE_SIZE or == PAGE_SIZE? Linux does not support filesystems where the block size is larger than the page size, so the supported set of "block size at least as large as PAGE_SIZE" is only block size == PAGE_SIZE. > > /* If the DAX state is not changing, we have nothing to do here. */ > > if ((fa->fsx_xflags & FS_XFLAG_DAX) && IS_DAX(inode)) > > diff --git a/fs/xfs/xfs_iops.c b/fs/xfs/xfs_iops.c > > index 9c984a0..fb7dc61 100644 > > --- a/fs/xfs/xfs_iops.c > > +++ b/fs/xfs/xfs_iops.c > > @@ -1186,6 +1186,7 @@ xfs_diflags_to_iflags( > > if (flags & XFS_DIFLAG_NOATIME) > > inode->i_flags |= S_NOATIME; > > if (S_ISREG(inode->i_mode) && > > + ip->i_mount->m_sb.sb_blocksize == PAGE_SIZE && > > (ip->i_mount->m_flags & XFS_MOUNT_DAX || > > ip->i_d.di_flags2 & XFS_DIFLAG2_DAX)) > > inode->i_flags |= S_DAX; > > Is it possible to get mounted with XFS_MOUNT_DAX if blocksize != PAGE_SIZE? No, It's checked at mount time. > If so, should it be? This seems like a strange place to catch this mismatch. It's not for catching a bad mount option (which will go away, anyway). it's for catching an "in-pmem" inode flag that can't be applied because, e.g, the kernel was rebuilt with a different base page size and now the extents won't align correctly for DAX to work. Or, perhaps, the pmem is a global pool similar interconnected to individual processing domains that have different architectures and the filesystem is moved to a different domain. IIUC, HP's Machine architecture is based around such a shared-pmem, isolated host layout. Or, maybe there's some magic RMDA pixie dust allowing a different physical machine to access the pmem the filesystem was created on, in which case DAX won't work (e.g. VM gets shifted from one machine to another due to load balancing). Cheers, Dave. -- Dave Chinner david@fromorbit.com From sandeen@sandeen.net Mon Feb 15 18:55:01 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=ham version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay1.corp.sgi.com [137.38.102.111]) by oss.sgi.com (Postfix) with ESMTP id 6CAA47CA2 for ; Mon, 15 Feb 2016 18:55:01 -0600 (CST) Received: from cuda.sgi.com (cuda1.sgi.com [192.48.157.11]) by relay1.corp.sgi.com (Postfix) with ESMTP id 222C18F8035 for ; Mon, 15 Feb 2016 16:55:01 -0800 (PST) X-ASG-Debug-ID: 1455584098-04bdf02d5e08c70001-NocioJ Received: from sandeen.net (sandeen.net [63.231.237.45]) by cuda.sgi.com with ESMTP id qBEGam2Bx6W6h1Fo for ; Mon, 15 Feb 2016 16:54:58 -0800 (PST) X-Barracuda-Envelope-From: sandeen@sandeen.net X-Barracuda-Apparent-Source-IP: 63.231.237.45 Received: from liberator.sandeen.net (liberator.sandeen.net [10.0.0.4]) (using TLSv1.2 with cipher DHE-RSA-AES128-SHA (128/128 bits)) (No client certificate requested) by sandeen.net (Postfix) with ESMTPSA id C0FC063C5FF0; Mon, 15 Feb 2016 18:54:57 -0600 (CST) Subject: Re: [PATCH 4/4] xfs: XFS_DIFLAG2_DAX limited by PAGE_SIZE To: Dave Chinner X-ASG-Orig-Subj: Re: [PATCH 4/4] xfs: XFS_DIFLAG2_DAX limited by PAGE_SIZE References: <1455513734-15192-1-git-send-email-david@fromorbit.com> <1455513734-15192-5-git-send-email-david@fromorbit.com> <56C26954.2010001@sandeen.net> <20160216003923.GL14668@dastard> Cc: xfs@oss.sgi.com From: Eric Sandeen Message-ID: <56C27360.4020004@sandeen.net> Date: Mon, 15 Feb 2016 18:54:56 -0600 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.11; rv:38.0) Gecko/20100101 Thunderbird/38.5.1 MIME-Version: 1.0 In-Reply-To: <20160216003923.GL14668@dastard> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit X-Barracuda-Connect: sandeen.net[63.231.237.45] X-Barracuda-Start-Time: 1455584098 X-Barracuda-URL: https://192.48.157.11:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-BRTS-Status: 1 X-Barracuda-Spam-Score: 0.00 X-Barracuda-Spam-Status: No, SCORE=0.00 using per-user scores of TAG_LEVEL=1000.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.7 tests=BSF_SC0_MISMATCH_TO X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.3.27061 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 0.00 BSF_SC0_MISMATCH_TO Envelope rcpt doesn't match header On 2/15/16 6:39 PM, Dave Chinner wrote: > On Mon, Feb 15, 2016 at 06:12:04PM -0600, Eric Sandeen wrote: ... >> So which is it, at least PAGE_SIZE or == PAGE_SIZE? > > Linux does not support filesystems where the block size is larger > than the page size, so the supported set of "block size at least as > large as PAGE_SIZE" is only block size == PAGE_SIZE. Um, ok. Comment is still confusing. ;) >>> /* If the DAX state is not changing, we have nothing to do here. */ >>> if ((fa->fsx_xflags & FS_XFLAG_DAX) && IS_DAX(inode)) >>> diff --git a/fs/xfs/xfs_iops.c b/fs/xfs/xfs_iops.c >>> index 9c984a0..fb7dc61 100644 >>> --- a/fs/xfs/xfs_iops.c >>> +++ b/fs/xfs/xfs_iops.c >>> @@ -1186,6 +1186,7 @@ xfs_diflags_to_iflags( >>> if (flags & XFS_DIFLAG_NOATIME) >>> inode->i_flags |= S_NOATIME; >>> if (S_ISREG(inode->i_mode) && >>> + ip->i_mount->m_sb.sb_blocksize == PAGE_SIZE && >>> (ip->i_mount->m_flags & XFS_MOUNT_DAX || >>> ip->i_d.di_flags2 & XFS_DIFLAG2_DAX)) >>> inode->i_flags |= S_DAX; >> >> Is it possible to get mounted with XFS_MOUNT_DAX if blocksize != PAGE_SIZE? > > No, It's checked at mount time. > >> If so, should it be? This seems like a strange place to catch this mismatch. > > It's not for catching a bad mount option (which will go away, > anyway). it's for catching an "in-pmem" inode flag that can't be > applied because, e.g, the kernel was rebuilt with a different base > page size and now the extents won't align correctly for DAX to work. Oh, with the di_flags2 already set on disk, and now encountering a new page size. Right, ok. -Eric From david@fromorbit.com Mon Feb 15 23:46:01 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=ham version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay1.corp.sgi.com [137.38.102.111]) by oss.sgi.com (Postfix) with ESMTP id 9AA2A7CA2 for ; Mon, 15 Feb 2016 23:46:01 -0600 (CST) Received: from cuda.sgi.com (cuda2.sgi.com [192.48.176.25]) by relay1.corp.sgi.com (Postfix) with ESMTP id 89BAF8F8040 for ; Mon, 15 Feb 2016 21:45:58 -0800 (PST) X-ASG-Debug-ID: 1455601555-04cbb0433310bdd0001-NocioJ Received: from ipmail04.adl6.internode.on.net (ipmail04.adl6.internode.on.net [150.101.137.141]) by cuda.sgi.com with ESMTP id EbLWWRhO5MwrivPI for ; Mon, 15 Feb 2016 21:45:55 -0800 (PST) X-Barracuda-Envelope-From: david@fromorbit.com X-Barracuda-Apparent-Source-IP: 150.101.137.141 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: A2CFBwAqt8JWXJbY03ZegzoiMG2mNwIWAQEBAQEBBoEPimCFRoQIFwKFbgSBOE0BAQEBAQEHRECFHjskNAUlAwctiBmZPp5/CBiFMYl7gXwLQIEnBYdUixuEDoVRh32OegKOQIIYAQoBAQGCMyguiE8BAQE Received: from ppp118-211-216-150.lns20.syd4.internode.on.net (HELO dastard) ([118.211.216.150]) by ipmail04.adl6.internode.on.net with ESMTP; 16 Feb 2016 16:15:47 +1030 Received: from dave by dastard with local (Exim 4.80) (envelope-from ) id 1aVYSI-00033Z-S5 for xfs@oss.sgi.com; Tue, 16 Feb 2016 16:45:46 +1100 Date: Tue, 16 Feb 2016 16:45:46 +1100 From: Dave Chinner To: xfs@oss.sgi.com Subject: [ANNOUNCE] xfs: for-next branch updated to e15c65b Message-ID: <20160216054546.GM14668@dastard> X-ASG-Orig-Subj: [ANNOUNCE] xfs: for-next branch updated to e15c65b MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="GPJrCs/72TxItFYR" Content-Disposition: inline User-Agent: Mutt/1.5.21 (2010-09-15) X-Barracuda-Connect: ipmail04.adl6.internode.on.net[150.101.137.141] X-Barracuda-Start-Time: 1455601555 X-Barracuda-URL: https://192.48.176.25:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-BRTS-Status: 1 X-Barracuda-Spam-Score: 0.00 X-Barracuda-Spam-Status: No, SCORE=0.00 using per-user scores of TAG_LEVEL=1000.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.7 tests= X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.3.27065 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- --GPJrCs/72TxItFYR Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Hi folks, The for-next branch of the xfs kernel repository at git://git.kernel.org/pub/scm/linux/kernel/git/dgc/linux-xfs.git has just been updated. The new head of the for-next branch is commit: e15c65b Merge branch 'xfs-writepage-rework-4.6' into for-next New Commits: Dave Chinner (7): [988ef92] xfs: remove nonblocking mode from xfs_vm_writepage [150d5be] xfs: remove xfs_cancel_ioend [fbcc025] xfs: Introduce writeback context for writepages [ad68972] xfs: xfs_cluster_write is redundant [bfce7d2] xfs: factor mapping out of xfs_do_writepage [e10de37] xfs: don't chain ioends during writepage submission [e15c65b] Merge branch 'xfs-writepage-rework-4.6' into for-next Code Diffstat: fs/xfs/xfs_aops.c | 732 ++++++++++++++++++++------------------------------= ---- fs/xfs/xfs_aops.h | 4 +- 2 files changed, 269 insertions(+), 467 deletions(-) --=20 Dave Chinner david@fromorbit.com --GPJrCs/72TxItFYR Content-Type: application/pgp-signature; name="signature.asc" Content-Description: Digital signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.12 (GNU/Linux) iQIcBAEBAgAGBQJWwreKAAoJEK3oKUf0dfodsAgQAIsnVCYe/c0tA1uY5hJofeLW NJRUg4zSVh+zgE8ySIOpxmec/BIGIG5yiBQvt4/5R8omjGPc2le6rzgRm1y7Av0H 177bMvaX0yKMkCN1AJBnA3ezsjIFpnidjZOy4Oh4oC5HwRncurbvtdjr+2DwaHww OSmQ0gGoevOxNpG+fXy3UmNmkqaZR4OP1A3eXLhBYmM61EPmVklpD4PmPwET0wee Qr+KF0X81dOezbwazyNhV1kbRs7dB/nkkKdFl/cYETl+MysdWs+HXUt475N/25zt U/qnh3MLuHuNi1TspvXXoc7mIhiL0O38eP/nFrI7lN/AvTTcx9PyF0DHlD3AvwMu K0hYqzgMnbGYPgvz5vtzVXxVIdijcpVl6L4RQOxSj4ZUDRhonW5d3wtmazuU5B0e w1rNoUf2+uFpDlL1Iu3Em/7a0ujl+GvoTBkJgGNFqUdT2W5aaoXBVff6NYjz8whB h8+pjaDsHJFHdYx6s6BJwwBmq8veIKNL3l8ajjZ6hQE9TfIlVvS4wcZjJG7kcMLD B1+YyG4LtR3SDybckJkyNG8t9BaDaWXbczR5xAEF8lIkAVX3joTZEm1EOa1Vjig6 s3nqK4FkJIQyKL1mbQjA9zJI/G+fU4ZUEi9A9RZO4lV39yq66heHA7WMma861Yjz IZRMrubbfvtWCMy3Y44M =KJqY -----END PGP SIGNATURE----- --GPJrCs/72TxItFYR-- From bfoster@redhat.com Tue Feb 16 10:44:37 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=ham version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay1.corp.sgi.com [137.38.102.111]) by oss.sgi.com (Postfix) with ESMTP id B1B557CA3 for ; Tue, 16 Feb 2016 10:44:37 -0600 (CST) Received: from cuda.sgi.com (cuda3.sgi.com [192.48.176.15]) by relay1.corp.sgi.com (Postfix) with ESMTP id A2C3F8F8039 for ; Tue, 16 Feb 2016 08:44:37 -0800 (PST) X-ASG-Debug-ID: 1455641075-04cb6c1e5810ab20001-NocioJ Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by cuda.sgi.com with ESMTP id 7GidurZhCcMj0AGL (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO) for ; Tue, 16 Feb 2016 08:44:36 -0800 (PST) X-Barracuda-Envelope-From: bfoster@redhat.com X-Barracuda-Apparent-Source-IP: 209.132.183.28 X-ASG-Whitelist: Client Received: from int-mx09.intmail.prod.int.phx2.redhat.com (int-mx09.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by mx1.redhat.com (Postfix) with ESMTPS id 8B1748051E; Tue, 16 Feb 2016 16:44:35 +0000 (UTC) Received: from bfoster.bfoster (dhcp-41-164.bos.redhat.com [10.18.41.164]) by int-mx09.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id u1GGiZ4i031607; Tue, 16 Feb 2016 11:44:35 -0500 Received: by bfoster.bfoster (Postfix, from userid 1000) id 048CC123DF8; Tue, 16 Feb 2016 11:44:33 -0500 (EST) Date: Tue, 16 Feb 2016 11:44:33 -0500 From: Brian Foster To: Dave Chinner Cc: xfs@oss.sgi.com Subject: Re: [PATCH 5/9] xfs: add configuration of error failure speed Message-ID: <20160216164432.GB39655@bfoster.bfoster> X-ASG-Orig-Subj: Re: [PATCH 5/9] xfs: add configuration of error failure speed References: <1454635407-22276-1-git-send-email-david@fromorbit.com> <1454635407-22276-6-git-send-email-david@fromorbit.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1454635407-22276-6-git-send-email-david@fromorbit.com> User-Agent: Mutt/1.5.24 (2015-08-30) X-Scanned-By: MIMEDefang 2.68 on 10.5.11.22 X-Barracuda-Connect: mx1.redhat.com[209.132.183.28] X-Barracuda-Start-Time: 1455641076 X-Barracuda-Encrypted: ECDHE-RSA-AES256-GCM-SHA384 X-Barracuda-URL: https://192.48.176.15:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-BRTS-Status: 1 On Fri, Feb 05, 2016 at 12:23:23PM +1100, Dave Chinner wrote: > From: Dave Chinner > > On reception of an error, we can fail immediately, perform some > bound amount of retries or retry indefinitely. The current behaviour > we have is to retry forever. > > However, we'd like the ability to choose what behaviour we have, and > that requires the ability to configure the behaviour through the new > sysfs interfaces. Add configuration options for fail fast, slow or > never to reflect the three choices above. Fail fast or fail never > don't require any other options, but "fail slow" needs configuration > to bound the retry behaviour. Add both a maximum retry count and a > retry timeout so that we can bound by time and/or physical IO > attempts. > > Finally, plumb these into xfs_buf_iodone error processing so that > the error behaviour follows the selected configuration. > > Signed-off-by: Dave Chinner > --- > fs/xfs/xfs_buf.h | 23 ++++++++- > fs/xfs/xfs_buf_item.c | 22 ++++++++- > fs/xfs/xfs_mount.h | 2 + > fs/xfs/xfs_sysfs.c | 128 ++++++++++++++++++++++++++++++++++++++++++++++++-- > 4 files changed, 169 insertions(+), 6 deletions(-) > ... > diff --git a/fs/xfs/xfs_buf_item.c b/fs/xfs/xfs_buf_item.c > index 68e34d1..7afd4d5 100644 > --- a/fs/xfs/xfs_buf_item.c > +++ b/fs/xfs/xfs_buf_item.c ... > @@ -979,9 +982,25 @@ xfs_buf_iodone_callback_error( > * Repeated failure on an async write. Take action according to the > * error configuration we have been set up to use. > */ > - if (cfg->fail_speed == XFS_ERR_FAIL_FAST) > + switch (cfg->fail_speed) { > + case XFS_ERR_FAIL_FAST: > goto permanent_error; > > + case XFS_ERR_FAIL_SLOW: > + if (++bp->b_retries > cfg->max_retries) > + goto permanent_error; > + if (!cfg->retry_timeout) > + break; > + if (time_after(jiffies, > + cfg->retry_timeout + bp->b_first_retry_time)) > + goto permanent_error; > + break; > + > + case XFS_ERR_FAIL_NEVER: > + default: > + break; > + } > + I wonder a bit how granular this system needs to be in terms of user interface, at least right now. For example, fail fast and fail never just seem like variants of fail slow with particular tunables. Fail fast is roughly equivalent to a retry count of one, whereas fail never implies an infinite (e.g., -1) retry count. Do we really need the higher level classification? > /* still a transient error, higher layers will retry */ > xfs_buf_ioerror(bp, 0); > xfs_buf_relse(bp); > @@ -1023,6 +1042,7 @@ xfs_buf_iodone_callbacks( > * retry state here in preparation for the next error that may occur. > */ > bp->b_last_error = 0; > + bp->b_retries = 0; > > xfs_buf_do_callbacks(bp); > bp->b_fspriv = NULL; > diff --git a/fs/xfs/xfs_mount.h b/fs/xfs/xfs_mount.h > index 9a61f39..2a3d178 100644 > --- a/fs/xfs/xfs_mount.h > +++ b/fs/xfs/xfs_mount.h > @@ -62,6 +62,8 @@ enum { > struct xfs_error_cfg { > struct xfs_kobj kobj; > int fail_speed; > + int max_retries; /* INT_MAX = retry forever */ > + unsigned long retry_timeout; /* in jiffies, 0 = no timeout */ > }; > > typedef struct xfs_mount { > diff --git a/fs/xfs/xfs_sysfs.c b/fs/xfs/xfs_sysfs.c > index 27487ce..51d9fa7 100644 > --- a/fs/xfs/xfs_sysfs.c > +++ b/fs/xfs/xfs_sysfs.c ... > @@ -330,6 +326,123 @@ to_error_cfg(struct kobject *kobject) ... > +static ssize_t > +retry_timeout_seconds_show( > + struct kobject *kobject, > + char *buf) > +{ > + struct xfs_error_cfg *cfg = to_error_cfg(kobject); > + > + return snprintf(buf, PAGE_SIZE, "%ld\n", Trailing whitespace here ^ Brian > + jiffies_to_msecs(cfg->retry_timeout) * MSEC_PER_SEC); > +} > + > +static ssize_t > +retry_timeout_seconds_store( > + struct kobject *kobject, > + const char *buf, > + size_t count) > +{ > + struct xfs_error_cfg *cfg = to_error_cfg(kobject); > + int ret; > + int val; > + > + ret = kstrtoint(buf, 0, &val); > + if (ret) > + return ret; > + > + /* 1 day timeout maximum */ > + if (val < 0 || val > 86400) > + return -EINVAL; > + > + cfg->retry_timeout = msecs_to_jiffies(val * MSEC_PER_SEC); > + return count; > +} > +XFS_SYSFS_ATTR_RW(retry_timeout_seconds); > + > +static struct attribute *xfs_error_attrs[] = { > + ATTR_LIST(failure_speed), > + ATTR_LIST(max_retries), > + ATTR_LIST(retry_timeout_seconds), > + NULL, > +}; > + > + > struct kobj_type xfs_error_cfg_ktype = { > .release = xfs_sysfs_release, > .sysfs_ops = &xfs_sysfs_ops, > @@ -349,11 +462,15 @@ struct kobj_type xfs_error_ktype = { > struct xfs_error_init { > char *name; > int fail_speed; > + int max_retries; > + int retry_timeout; /* in seconds */ > }; > > static const struct xfs_error_init xfs_error_meta_init[XFS_ERR_ERRNO_MAX] = { > { .name = "Default", > .fail_speed = XFS_ERR_FAIL_NEVER, > + .max_retries = INT_MAX, > + .retry_timeout = 0, > }, > }; > > @@ -384,6 +501,9 @@ xfs_error_sysfs_init_class( > goto out_error; > > cfg->fail_speed = init[i].fail_speed; > + cfg->max_retries = init[i].max_retries; > + cfg->retry_timeout = msecs_to_jiffies( > + init[i].retry_timeout * MSEC_PER_SEC); > } > return 0; > > -- > 2.5.0 > > _______________________________________________ > xfs mailing list > xfs@oss.sgi.com > http://oss.sgi.com/mailman/listinfo/xfs From bfoster@redhat.com Tue Feb 16 10:44:58 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=ham version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay3.corp.sgi.com [198.149.34.15]) by oss.sgi.com (Postfix) with ESMTP id AD5ED7CA3 for ; Tue, 16 Feb 2016 10:44:58 -0600 (CST) Received: from cuda.sgi.com (cuda3.sgi.com [192.48.176.15]) by relay3.corp.sgi.com (Postfix) with ESMTP id 3B924AC005 for ; Tue, 16 Feb 2016 08:44:55 -0800 (PST) X-ASG-Debug-ID: 1455641093-04cb6c1e5610ab30001-NocioJ Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by cuda.sgi.com with ESMTP id 9FeXDYddF0b7hqkB (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO) for ; Tue, 16 Feb 2016 08:44:53 -0800 (PST) X-Barracuda-Envelope-From: bfoster@redhat.com X-Barracuda-Apparent-Source-IP: 209.132.183.28 X-ASG-Whitelist: Client Received: from int-mx11.intmail.prod.int.phx2.redhat.com (int-mx11.intmail.prod.int.phx2.redhat.com [10.5.11.24]) by mx1.redhat.com (Postfix) with ESMTPS id 3AE5619CB9C; Tue, 16 Feb 2016 16:44:53 +0000 (UTC) Received: from bfoster.bfoster (dhcp-41-164.bos.redhat.com [10.18.41.164]) by int-mx11.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id u1GGiqQt004703; Tue, 16 Feb 2016 11:44:53 -0500 Received: by bfoster.bfoster (Postfix, from userid 1000) id C203C123DF8; Tue, 16 Feb 2016 11:44:51 -0500 (EST) Date: Tue, 16 Feb 2016 11:44:51 -0500 From: Brian Foster To: Dave Chinner Cc: xfs@oss.sgi.com Subject: Re: [PATCH 6/9] xfs: add "fail at unmount" error handling configuration Message-ID: <20160216164451.GC39655@bfoster.bfoster> X-ASG-Orig-Subj: Re: [PATCH 6/9] xfs: add "fail at unmount" error handling configuration References: <1454635407-22276-1-git-send-email-david@fromorbit.com> <1454635407-22276-7-git-send-email-david@fromorbit.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1454635407-22276-7-git-send-email-david@fromorbit.com> User-Agent: Mutt/1.5.24 (2015-08-30) X-Scanned-By: MIMEDefang 2.68 on 10.5.11.24 X-Barracuda-Connect: mx1.redhat.com[209.132.183.28] X-Barracuda-Start-Time: 1455641093 X-Barracuda-Encrypted: ECDHE-RSA-AES256-GCM-SHA384 X-Barracuda-URL: https://192.48.176.15:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-BRTS-Status: 1 On Fri, Feb 05, 2016 at 12:23:24PM +1100, Dave Chinner wrote: > From: Dave Chinner > > If we take "retry forever" literally on metadata IO errors, we can > hang an unmount retries those writes forever. This is the default > behaviour, unfortunately. Add a error configuration option for this > behaviour and default it to "fail" so that an unmount will trigger > actual errors, a shutdown and allow the unmount to succeed. It will > be noisy, though, as it will log the errors and shutdown that > occurs. > > To do this, we need to mark the filesystem as being in the process > of unmounting. Do this with a mount flag that is added at the > appropriate time (i.e. before the blocking AIL sync). We also need > to add this flag if mount fails after the initial phase of log > recovery has been run. > > The config is done by a separate boolean sysfs option rather than a > new fail_speed enum, as fail_at_unmount is relevant to both > XFS_ERR_FAIL_NEVER and XFS_ERR_FAIL_SLOW options. > > Signed-off-by: Dave Chinner > --- Similar question of scope/granularity here... why would one want to set this option for a particular error and not any others? In other words, it seems more useful as a global (or per-mount) option. Brian > fs/xfs/xfs_buf_item.c | 4 ++++ > fs/xfs/xfs_mount.c | 9 +++++++++ > fs/xfs/xfs_mount.h | 2 ++ > fs/xfs/xfs_sysfs.c | 36 ++++++++++++++++++++++++++++++++++++ > 4 files changed, 51 insertions(+) > > diff --git a/fs/xfs/xfs_buf_item.c b/fs/xfs/xfs_buf_item.c > index 7afd4d5..9220283 100644 > --- a/fs/xfs/xfs_buf_item.c > +++ b/fs/xfs/xfs_buf_item.c > @@ -1001,6 +1001,10 @@ xfs_buf_iodone_callback_error( > break; > } > > + /* At unmount we may treat errors differently */ > + if ((mp->m_flags & XFS_MOUNT_UNMOUNTING) && cfg->fail_at_unmount) > + goto permanent_error; > + > /* still a transient error, higher layers will retry */ > xfs_buf_ioerror(bp, 0); > xfs_buf_relse(bp); > diff --git a/fs/xfs/xfs_mount.c b/fs/xfs/xfs_mount.c > index f6fb5e1..f8c4a50 100644 > --- a/fs/xfs/xfs_mount.c > +++ b/fs/xfs/xfs_mount.c > @@ -980,6 +980,7 @@ xfs_mountfs( > cancel_delayed_work_sync(&mp->m_reclaim_work); > xfs_reclaim_inodes(mp, SYNC_WAIT); > out_log_dealloc: > + mp->m_flags |= XFS_MOUNT_UNMOUNTING; > xfs_log_mount_cancel(mp); > out_fail_wait: > if (mp->m_logdev_targp && mp->m_logdev_targp != mp->m_ddev_targp) > @@ -1031,6 +1032,14 @@ xfs_unmountfs( > xfs_log_force(mp, XFS_LOG_SYNC); > > /* > + * We now need to tell the world we are unmounting. This will allow > + * us to detect that the filesystem is going away and we should error > + * out anything that we have been retrying in the background. This will > + * prevent neverending retries iin AIL pushing from hanging the unmount. > + */ > + mp->m_flags |= XFS_MOUNT_UNMOUNTING; > + > + /* > * Flush all pending changes from the AIL. > */ > xfs_ail_push_all_sync(mp->m_ail); > diff --git a/fs/xfs/xfs_mount.h b/fs/xfs/xfs_mount.h > index 2a3d178..edeb0b6 100644 > --- a/fs/xfs/xfs_mount.h > +++ b/fs/xfs/xfs_mount.h > @@ -64,6 +64,7 @@ struct xfs_error_cfg { > int fail_speed; > int max_retries; /* INT_MAX = retry forever */ > unsigned long retry_timeout; /* in jiffies, 0 = no timeout */ > + bool fail_at_unmount; > }; > > typedef struct xfs_mount { > @@ -187,6 +188,7 @@ typedef struct xfs_mount { > #define XFS_MOUNT_WSYNC (1ULL << 0) /* for nfs - all metadata ops > must be synchronous except > for space allocations */ > +#define XFS_MOUNT_UNMOUNTING (1ULL << 1) /* filesystem is unmounting */ > #define XFS_MOUNT_WAS_CLEAN (1ULL << 3) > #define XFS_MOUNT_FS_SHUTDOWN (1ULL << 4) /* atomic stop of all filesystem > operations, typically for > diff --git a/fs/xfs/xfs_sysfs.c b/fs/xfs/xfs_sysfs.c > index 51d9fa7..a5b040a 100644 > --- a/fs/xfs/xfs_sysfs.c > +++ b/fs/xfs/xfs_sysfs.c > @@ -435,10 +435,43 @@ retry_timeout_seconds_store( > } > XFS_SYSFS_ATTR_RW(retry_timeout_seconds); > > +static ssize_t > +fail_at_unmount_show( > + struct kobject *kobject, > + char *buf) > +{ > + struct xfs_error_cfg *cfg = to_error_cfg(kobject); > + > + return snprintf(buf, PAGE_SIZE, "%d\n", cfg->fail_at_unmount); > +} > + > +static ssize_t > +fail_at_unmount_store( > + struct kobject *kobject, > + const char *buf, > + size_t count) > +{ > + struct xfs_error_cfg *cfg = to_error_cfg(kobject); > + int ret; > + int val; > + > + ret = kstrtoint(buf, 0, &val); > + if (ret) > + return ret; > + > + if (val < 0 || val > 1) > + return -EINVAL; > + > + cfg->fail_at_unmount = val; > + return count; > +} > +XFS_SYSFS_ATTR_RW(fail_at_unmount); > + > static struct attribute *xfs_error_attrs[] = { > ATTR_LIST(failure_speed), > ATTR_LIST(max_retries), > ATTR_LIST(retry_timeout_seconds), > + ATTR_LIST(fail_at_unmount), > NULL, > }; > > @@ -464,6 +497,7 @@ struct xfs_error_init { > int fail_speed; > int max_retries; > int retry_timeout; /* in seconds */ > + bool fail_at_unmount; > }; > > static const struct xfs_error_init xfs_error_meta_init[XFS_ERR_ERRNO_MAX] = { > @@ -471,6 +505,7 @@ static const struct xfs_error_init xfs_error_meta_init[XFS_ERR_ERRNO_MAX] = { > .fail_speed = XFS_ERR_FAIL_NEVER, > .max_retries = INT_MAX, > .retry_timeout = 0, > + .fail_at_unmount = true, > }, > }; > > @@ -504,6 +539,7 @@ xfs_error_sysfs_init_class( > cfg->max_retries = init[i].max_retries; > cfg->retry_timeout = msecs_to_jiffies( > init[i].retry_timeout * MSEC_PER_SEC); > + cfg->fail_at_unmount = init[i].fail_at_unmount; > } > return 0; > > -- > 2.5.0 > > _______________________________________________ > xfs mailing list > xfs@oss.sgi.com > http://oss.sgi.com/mailman/listinfo/xfs From bfoster@redhat.com Tue Feb 16 10:45:44 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=ham version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay3.corp.sgi.com [198.149.34.15]) by oss.sgi.com (Postfix) with ESMTP id 8A5F27CA3 for ; Tue, 16 Feb 2016 10:45:44 -0600 (CST) Received: from cuda.sgi.com (cuda1.sgi.com [192.48.157.11]) by relay3.corp.sgi.com (Postfix) with ESMTP id 3581DAC005 for ; Tue, 16 Feb 2016 08:45:44 -0800 (PST) X-ASG-Debug-ID: 1455641142-04bdf02d5e2f250001-NocioJ Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by cuda.sgi.com with ESMTP id 86IwBCtAxW6388ex (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO) for ; Tue, 16 Feb 2016 08:45:43 -0800 (PST) X-Barracuda-Envelope-From: bfoster@redhat.com X-Barracuda-Apparent-Source-IP: 209.132.183.28 X-ASG-Whitelist: Client Received: from int-mx14.intmail.prod.int.phx2.redhat.com (int-mx14.intmail.prod.int.phx2.redhat.com [10.5.11.27]) by mx1.redhat.com (Postfix) with ESMTPS id DA314C0ABF23; Tue, 16 Feb 2016 16:45:42 +0000 (UTC) Received: from bfoster.bfoster (dhcp-41-164.bos.redhat.com [10.18.41.164]) by int-mx14.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id u1GGjgVJ032533; Tue, 16 Feb 2016 11:45:42 -0500 Received: by bfoster.bfoster (Postfix, from userid 1000) id 1D358123DF8; Tue, 16 Feb 2016 11:45:41 -0500 (EST) Date: Tue, 16 Feb 2016 11:45:41 -0500 From: Brian Foster To: Dave Chinner Cc: xfs@oss.sgi.com Subject: Re: [PATCH 8/9] xfs: disable specific error configurations Message-ID: <20160216164540.GD39655@bfoster.bfoster> X-ASG-Orig-Subj: Re: [PATCH 8/9] xfs: disable specific error configurations References: <1454635407-22276-1-git-send-email-david@fromorbit.com> <1454635407-22276-9-git-send-email-david@fromorbit.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1454635407-22276-9-git-send-email-david@fromorbit.com> User-Agent: Mutt/1.5.24 (2015-08-30) X-Scanned-By: MIMEDefang 2.68 on 10.5.11.27 X-Barracuda-Connect: mx1.redhat.com[209.132.183.28] X-Barracuda-Start-Time: 1455641143 X-Barracuda-Encrypted: ECDHE-RSA-AES256-GCM-SHA384 X-Barracuda-URL: https://192.48.157.11:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-BRTS-Status: 1 On Fri, Feb 05, 2016 at 12:23:26PM +1100, Dave Chinner wrote: > From: Dave Chinner > > Different error classes are going to need different error to be > configured, so we don't want them all to be visible in sysfs. Add a > configuration check into the config initialisation an lookup > code to determine if the default should be used for a specific > error. If so, the sysfs entry is not created, and on lookup the > default config is returned. > > Add ENOMEM at this point to exercise this code, as it will be used > later when adding a kmem error failure class. > > Signed-off-by: Dave Chinner > --- > fs/xfs/xfs_mount.h | 1 + > fs/xfs/xfs_sysfs.c | 22 ++++++++++++++++++---- > 2 files changed, 19 insertions(+), 4 deletions(-) > > diff --git a/fs/xfs/xfs_mount.h b/fs/xfs/xfs_mount.h > index c05b500..0ff14a90 100644 > --- a/fs/xfs/xfs_mount.h > +++ b/fs/xfs/xfs_mount.h > @@ -53,6 +53,7 @@ enum { > XFS_ERR_EIO, > XFS_ERR_ENOSPC, > XFS_ERR_ENODEV, > + XFS_ERR_ENOMEM, > XFS_ERR_ERRNO_MAX, > }; > enum { > diff --git a/fs/xfs/xfs_sysfs.c b/fs/xfs/xfs_sysfs.c > index d48dc46..c984c3e 100644 > --- a/fs/xfs/xfs_sysfs.c > +++ b/fs/xfs/xfs_sysfs.c > @@ -522,6 +522,9 @@ static const struct xfs_error_init xfs_error_meta_init[XFS_ERR_ERRNO_MAX] = { > { .name = "ENODEV", > .fail_speed = XFS_ERR_FAIL_FAST, > }, > + { .name = "ENOMEM", > + .fail_speed = XFS_ERR_FAIL_DEFAULT, > + }, > }; > > static int > @@ -545,12 +548,17 @@ xfs_error_sysfs_init_class( > > for (i = 0; i < XFS_ERR_ERRNO_MAX; i++) { > cfg = &mp->m_error_cfg[class][i]; > + > + /* skip errors that are not configurable for this class */ > + cfg->fail_speed = init[i].fail_speed; > + if (cfg->fail_speed == XFS_ERR_FAIL_DEFAULT) > + continue; > + It seems like this confuses a default configuration for an error with a "tunable" or "configurable" flag (or otherwise has confused me ;). E.g., what happens if we want to alter ENOMEM behavior from the "default" behavior, retain the current definition in the "Default" entry, but still not expose the ENOMEM configuration to the user? Brian > error = xfs_sysfs_init(&cfg->kobj, &xfs_error_cfg_ktype, > parent_kobj, init[i].name); > if (error) > goto out_error; > > - cfg->fail_speed = init[i].fail_speed; > cfg->max_retries = init[i].max_retries; > cfg->retry_timeout = msecs_to_jiffies( > init[i].retry_timeout * MSEC_PER_SEC); > @@ -605,7 +613,8 @@ xfs_error_sysfs_del( > for (j = 0; j < XFS_ERR_ERRNO_MAX; j++) { > cfg = &mp->m_error_cfg[i][j]; > > - xfs_sysfs_del(&cfg->kobj); > + if (cfg->fail_speed != XFS_ERR_FAIL_DEFAULT) > + xfs_sysfs_del(&cfg->kobj); > } > } > xfs_sysfs_del(&mp->m_error_meta_kobj); > @@ -630,10 +639,15 @@ xfs_error_get_cfg( > case ENODEV: > cfg = &mp->m_error_cfg[error_class][XFS_ERR_ENODEV]; > break; > - default: > - cfg = &mp->m_error_cfg[error_class][XFS_ERR_DEFAULT]; > + case ENOMEM: > + cfg = &mp->m_error_cfg[error_class][XFS_ERR_ENOMEM]; > break; > + default: > + return &mp->m_error_cfg[error_class][XFS_ERR_DEFAULT]; > } > > + /* The error may not be not configurable, so uses default behaviour */ > + if (cfg->fail_speed == XFS_ERR_FAIL_DEFAULT) > + return &mp->m_error_cfg[error_class][XFS_ERR_DEFAULT]; > return cfg; > } > -- > 2.5.0 > > _______________________________________________ > xfs mailing list > xfs@oss.sgi.com > http://oss.sgi.com/mailman/listinfo/xfs From sandeen@sandeen.net Tue Feb 16 11:09:29 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=ham version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay2.corp.sgi.com [137.38.102.29]) by oss.sgi.com (Postfix) with ESMTP id 243107CA3 for ; Tue, 16 Feb 2016 11:09:29 -0600 (CST) Received: from cuda.sgi.com (cuda2.sgi.com [192.48.176.25]) by relay2.corp.sgi.com (Postfix) with ESMTP id 16E4C304043 for ; Tue, 16 Feb 2016 09:09:25 -0800 (PST) X-ASG-Debug-ID: 1455642563-04cbb04332128740001-NocioJ Received: from sandeen.net (sandeen.net [63.231.237.45]) by cuda.sgi.com with ESMTP id puEIagBe0MiZ3Onu for ; Tue, 16 Feb 2016 09:09:23 -0800 (PST) X-Barracuda-Envelope-From: sandeen@sandeen.net X-Barracuda-Apparent-Source-IP: 63.231.237.45 Received: from liberator.sandeen.net (liberator.sandeen.net [10.0.0.4]) (using TLSv1.2 with cipher DHE-RSA-AES128-SHA (128/128 bits)) (No client certificate requested) by sandeen.net (Postfix) with ESMTPSA id 29CA263C3D46 for ; Tue, 16 Feb 2016 11:09:23 -0600 (CST) Subject: Re: [PATCH 6/9] xfs: add "fail at unmount" error handling configuration To: xfs@oss.sgi.com X-ASG-Orig-Subj: Re: [PATCH 6/9] xfs: add "fail at unmount" error handling configuration References: <1454635407-22276-1-git-send-email-david@fromorbit.com> <1454635407-22276-7-git-send-email-david@fromorbit.com> <20160216164451.GC39655@bfoster.bfoster> From: Eric Sandeen Message-ID: <56C357C2.9020506@sandeen.net> Date: Tue, 16 Feb 2016 11:09:22 -0600 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.11; rv:38.0) Gecko/20100101 Thunderbird/38.5.1 MIME-Version: 1.0 In-Reply-To: <20160216164451.GC39655@bfoster.bfoster> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit X-Barracuda-Connect: sandeen.net[63.231.237.45] X-Barracuda-Start-Time: 1455642563 X-Barracuda-URL: https://192.48.176.25:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-BRTS-Status: 1 X-Barracuda-Spam-Score: 0.00 X-Barracuda-Spam-Status: No, SCORE=0.00 using per-user scores of TAG_LEVEL=1000.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.7 tests= X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.3.27077 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- On 2/16/16 10:44 AM, Brian Foster wrote: > On Fri, Feb 05, 2016 at 12:23:24PM +1100, Dave Chinner wrote: >> > From: Dave Chinner >> > >> > If we take "retry forever" literally on metadata IO errors, we can >> > hang an unmount retries those writes forever. This is the default >> > behaviour, unfortunately. Add a error configuration option for this >> > behaviour and default it to "fail" so that an unmount will trigger >> > actual errors, a shutdown and allow the unmount to succeed. It will >> > be noisy, though, as it will log the errors and shutdown that >> > occurs. >> > >> > To do this, we need to mark the filesystem as being in the process >> > of unmounting. Do this with a mount flag that is added at the >> > appropriate time (i.e. before the blocking AIL sync). We also need >> > to add this flag if mount fails after the initial phase of log >> > recovery has been run. >> > >> > The config is done by a separate boolean sysfs option rather than a >> > new fail_speed enum, as fail_at_unmount is relevant to both >> > XFS_ERR_FAIL_NEVER and XFS_ERR_FAIL_SLOW options. >> > >> > Signed-off-by: Dave Chinner >> > --- > Similar question of scope/granularity here... why would one want to set > this option for a particular error and not any others? In other words, > it seems more useful as a global (or per-mount) option. I guess my question here is higher-level than that. Why make this (fail_at_unmount) configurable at all. When would one *want* unmount blocked by pending failure retries? I guess I could imagine it as sort of a safety net, "I told it to retry for a day, and the day's not up yet, so we shouldn't stop trying just because I said unmount!" - but that seems a bit contrived to me. -Eric From bfoster@redhat.com Tue Feb 16 13:20:02 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=ham version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay1.corp.sgi.com [137.38.102.111]) by oss.sgi.com (Postfix) with ESMTP id 7CDAB7CA3 for ; Tue, 16 Feb 2016 13:20:02 -0600 (CST) Received: from cuda.sgi.com (cuda2.sgi.com [192.48.176.25]) by relay1.corp.sgi.com (Postfix) with ESMTP id 6FCC78F8049 for ; Tue, 16 Feb 2016 11:20:02 -0800 (PST) X-ASG-Debug-ID: 1455650397-04cbb0433212e360001-NocioJ Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by cuda.sgi.com with ESMTP id zUlOQd2c2a1VyiFu (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO) for ; Tue, 16 Feb 2016 11:19:58 -0800 (PST) X-Barracuda-Envelope-From: bfoster@redhat.com X-Barracuda-Apparent-Source-IP: 209.132.183.28 X-ASG-Whitelist: Client Received: from int-mx13.intmail.prod.int.phx2.redhat.com (int-mx13.intmail.prod.int.phx2.redhat.com [10.5.11.26]) by mx1.redhat.com (Postfix) with ESMTPS id A7ABAC09FABC; Tue, 16 Feb 2016 19:19:57 +0000 (UTC) Received: from bfoster.bfoster (dhcp-41-164.bos.redhat.com [10.18.41.164]) by int-mx13.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id u1GJJvMv016060; Tue, 16 Feb 2016 14:19:57 -0500 Received: by bfoster.bfoster (Postfix, from userid 1000) id 1142F123DF8; Tue, 16 Feb 2016 14:19:56 -0500 (EST) Date: Tue, 16 Feb 2016 14:19:56 -0500 From: Brian Foster To: Dave Chinner Cc: xfs@oss.sgi.com Subject: Re: [PATCH 0/14] xfsprogs: kernel libxfs sync up to 4.5-rc2 Message-ID: <20160216191955.GE39655@bfoster.bfoster> X-ASG-Orig-Subj: Re: [PATCH 0/14] xfsprogs: kernel libxfs sync up to 4.5-rc2 References: <1455517105-20033-1-git-send-email-david@fromorbit.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1455517105-20033-1-git-send-email-david@fromorbit.com> User-Agent: Mutt/1.5.24 (2015-08-30) X-Scanned-By: MIMEDefang 2.68 on 10.5.11.26 X-Barracuda-Connect: mx1.redhat.com[209.132.183.28] X-Barracuda-Start-Time: 1455650398 X-Barracuda-Encrypted: ECDHE-RSA-AES256-GCM-SHA384 X-Barracuda-URL: https://192.48.176.25:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-BRTS-Status: 1 On Mon, Feb 15, 2016 at 05:18:11PM +1100, Dave Chinner wrote: > Hi folks, > > This patchset pulls xfsprogs lixfs up to the same base code as the > v4.5-rc2 kernel. I've simply pulled the commits across and in each > patch made the external xfsprogs changes necessary to make them > compile and work correctly. This applies on top of the xfs_io dax > patchset I posted a short while ago. I've left all the kernel > sign-offs on the commits - it's really only the patches that change > stuff outside libxfs that need any sort of review... > > This is pretty much all of the remaining changes needed before I can > cut a 4.5.0-rc1 release of xfsprogs - it's really only bug fixes and > minor changes from here, as I really need this base tree mostly > stable from here on. > > The reason for that I'm now going to be build a for-next branch off > this that has all the changes in the current kernel for-next branch. > This will enable Darrick to have a sane code base that he can rebase > all his xfsprogs changes for rmap/reflink on top of. That will make > review, testing and eventual merge much easier for everyone. > A couple nits to follow that don't warrant a resend. So, for the series: Reviewed-by: Brian Foster > -Dave. > > _______________________________________________ > xfs mailing list > xfs@oss.sgi.com > http://oss.sgi.com/mailman/listinfo/xfs From bfoster@redhat.com Tue Feb 16 13:20:16 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=ham version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay3.corp.sgi.com [198.149.34.15]) by oss.sgi.com (Postfix) with ESMTP id 66E507CA3 for ; Tue, 16 Feb 2016 13:20:16 -0600 (CST) Received: from cuda.sgi.com (cuda2.sgi.com [192.48.176.25]) by relay3.corp.sgi.com (Postfix) with ESMTP id E1776AC008 for ; Tue, 16 Feb 2016 11:20:12 -0800 (PST) X-ASG-Debug-ID: 1455650410-04cbb0433412e3c0001-NocioJ Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by cuda.sgi.com with ESMTP id rfUJcQqrTFWH9Fw7 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO) for ; Tue, 16 Feb 2016 11:20:11 -0800 (PST) X-Barracuda-Envelope-From: bfoster@redhat.com X-Barracuda-Apparent-Source-IP: 209.132.183.28 X-ASG-Whitelist: Client Received: from int-mx09.intmail.prod.int.phx2.redhat.com (int-mx09.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by mx1.redhat.com (Postfix) with ESMTPS id 9806AC075659; Tue, 16 Feb 2016 19:20:10 +0000 (UTC) Received: from bfoster.bfoster (dhcp-41-164.bos.redhat.com [10.18.41.164]) by int-mx09.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id u1GJKAoF017211; Tue, 16 Feb 2016 14:20:10 -0500 Received: by bfoster.bfoster (Postfix, from userid 1000) id DB8D2123DF8; Tue, 16 Feb 2016 14:20:08 -0500 (EST) Date: Tue, 16 Feb 2016 14:20:08 -0500 From: Brian Foster To: Dave Chinner Cc: xfs@oss.sgi.com Subject: Re: [PATCH 05/14] xfs: introduce BMAPI_ZERO for allocating zeroed extents Message-ID: <20160216192008.GF39655@bfoster.bfoster> X-ASG-Orig-Subj: Re: [PATCH 05/14] xfs: introduce BMAPI_ZERO for allocating zeroed extents References: <1455517105-20033-1-git-send-email-david@fromorbit.com> <1455517105-20033-6-git-send-email-david@fromorbit.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1455517105-20033-6-git-send-email-david@fromorbit.com> User-Agent: Mutt/1.5.24 (2015-08-30) X-Scanned-By: MIMEDefang 2.68 on 10.5.11.22 X-Barracuda-Connect: mx1.redhat.com[209.132.183.28] X-Barracuda-Start-Time: 1455650411 X-Barracuda-Encrypted: ECDHE-RSA-AES256-GCM-SHA384 X-Barracuda-URL: https://192.48.176.25:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-BRTS-Status: 1 On Mon, Feb 15, 2016 at 05:18:16PM +1100, Dave Chinner wrote: > From: Dave Chinner > > Source kernel commit 3fbbbea34bac049c0b5938dc065f7d8ee1ef7e67 > > To enable DAX to do atomic allocation of zeroed extents, we need to > drive the block zeroing deep into the allocator. Because > xfs_bmapi_write() can return merged extents on allocation that were > only partially allocated (i.e. requested range spans allocated and > hole regions, allocation into the hole was contiguous), we cannot > zero the extent returned from xfs_bmapi_write() as that can > overwrite existing data with zeros. > > Hence we have to drive the extent zeroing into the allocation code, > prior to where we merge the extents into the BMBT and return the > resultant map. This means we need to propagate this need down to > the xfs_alloc_vextent() and issue the block zeroing at this point. > > While this functionality is being introduced for DAX, there is no > reason why it is specific to DAX - we can per-zero blocks during the > allocation transaction on any type of device. It's just slow (and > usually slower than unwritten allocation and conversion) on > traditional block devices so doesn't tend to get used. We can, > however, hook hardware zeroing optimisations via sb_issue_zeroout() > to this operation, so it may be useful in future and hence the > "allocate zeroed blocks" API needs to be implementation neutral. > > Signed-off-by: Dave Chinner > Reviewed-by: Brian Foster > Signed-off-by: Dave Chinner > --- > include/libxfs.h | 1 - > libxfs/libxfs_api_defs.h | 1 + > libxfs/libxfs_io.h | 2 ++ > libxfs/libxfs_priv.h | 3 +++ > libxfs/rdwr.c | 4 +++- > libxfs/util.c | 35 +++++++++++++++++++++++++++++++++++ > libxfs/xfs_alloc.c | 10 +++++++++- > libxfs/xfs_alloc.h | 8 +++++--- > libxfs/xfs_bmap.c | 35 +++++++++++++++++++++++++++++++++-- > libxfs/xfs_bmap.h | 13 +++++++++++-- > 10 files changed, 102 insertions(+), 10 deletions(-) > ... > diff --git a/libxfs/util.c b/libxfs/util.c > index 90031fd..ee4bf3c 100644 > --- a/libxfs/util.c > +++ b/libxfs/util.c ... > @@ -770,3 +772,36 @@ xfs_log_check_lsn( ... > +int > +libxfs_zero_extent( > + struct xfs_inode *ip, > + xfs_fsblock_t start_fsb, > + xfs_off_t count_fsb) > +{ > + xfs_daddr_t sector = xfs_fsb_to_db(ip, start_fsb); > + ssize_t size = XFS_FSB_TO_BB(ip->i_mount, count_fsb); > + > + return libxfs_device_zero(xfs_find_bdev_for_inode(ip), sector, size); > +} > + Extra whitespace ^, otherwise looks good: Reviewed-by: Brian Foster > diff --git a/libxfs/xfs_alloc.c b/libxfs/xfs_alloc.c > index 12d59df..af40270 100644 > --- a/libxfs/xfs_alloc.c > +++ b/libxfs/xfs_alloc.c > @@ -2508,7 +2508,7 @@ xfs_alloc_vextent( > * Try near allocation first, then anywhere-in-ag after > * the first a.g. fails. > */ > - if ((args->userdata == XFS_ALLOC_INITIAL_USER_DATA) && > + if ((args->userdata & XFS_ALLOC_INITIAL_USER_DATA) && > (mp->m_flags & XFS_MOUNT_32BITINODES)) { > args->fsbno = XFS_AGB_TO_FSB(mp, > ((mp->m_agfrotor / rotorstep) % > @@ -2639,6 +2639,14 @@ xfs_alloc_vextent( > XFS_AG_CHECK_DADDR(mp, XFS_FSB_TO_DADDR(mp, args->fsbno), > args->len); > #endif > + > + /* Zero the extent if we were asked to do so */ > + if (args->userdata & XFS_ALLOC_USERDATA_ZERO) { > + error = xfs_zero_extent(args->ip, args->fsbno, args->len); > + if (error) > + goto error0; > + } > + > } > xfs_perag_put(args->pag); > return 0; > diff --git a/libxfs/xfs_alloc.h b/libxfs/xfs_alloc.h > index 071b28b..135eb3d 100644 > --- a/libxfs/xfs_alloc.h > +++ b/libxfs/xfs_alloc.h > @@ -101,6 +101,7 @@ typedef struct xfs_alloc_arg { > struct xfs_mount *mp; /* file system mount point */ > struct xfs_buf *agbp; /* buffer for a.g. freelist header */ > struct xfs_perag *pag; /* per-ag struct for this agno */ > + struct xfs_inode *ip; /* for userdata zeroing method */ > xfs_fsblock_t fsbno; /* file system block number */ > xfs_agnumber_t agno; /* allocation group number */ > xfs_agblock_t agbno; /* allocation group-relative block # */ > @@ -120,15 +121,16 @@ typedef struct xfs_alloc_arg { > char wasdel; /* set if allocation was prev delayed */ > char wasfromfl; /* set if allocation is from freelist */ > char isfl; /* set if is freelist blocks - !acctg */ > - char userdata; /* set if this is user data */ > + char userdata; /* mask defining userdata treatment */ > xfs_fsblock_t firstblock; /* io first block allocated */ > } xfs_alloc_arg_t; > > /* > * Defines for userdata > */ > -#define XFS_ALLOC_USERDATA 1 /* allocation is for user data*/ > -#define XFS_ALLOC_INITIAL_USER_DATA 2 /* special case start of file */ > +#define XFS_ALLOC_USERDATA (1 << 0)/* allocation is for user data*/ > +#define XFS_ALLOC_INITIAL_USER_DATA (1 << 1)/* special case start of file */ > +#define XFS_ALLOC_USERDATA_ZERO (1 << 2)/* zero extent on allocation */ > > xfs_extlen_t xfs_alloc_longest_free_extent(struct xfs_mount *mp, > struct xfs_perag *pag, xfs_extlen_t need); > diff --git a/libxfs/xfs_bmap.c b/libxfs/xfs_bmap.c > index 8e19b50..a38549c 100644 > --- a/libxfs/xfs_bmap.c > +++ b/libxfs/xfs_bmap.c > @@ -3795,8 +3795,13 @@ xfs_bmap_btalloc( > args.wasdel = ap->wasdel; > args.isfl = 0; > args.userdata = ap->userdata; > - if ((error = xfs_alloc_vextent(&args))) > + if (ap->userdata & XFS_ALLOC_USERDATA_ZERO) > + args.ip = ap->ip; > + > + error = xfs_alloc_vextent(&args); > + if (error) > return error; > + > if (tryagain && args.fsbno == NULLFSBLOCK) { > /* > * Exact allocation failed. Now try with alignment > @@ -4295,11 +4300,14 @@ xfs_bmapi_allocate( > > /* > * Indicate if this is the first user data in the file, or just any > - * user data. > + * user data. And if it is userdata, indicate whether it needs to > + * be initialised to zero during allocation. > */ > if (!(bma->flags & XFS_BMAPI_METADATA)) { > bma->userdata = (bma->offset == 0) ? > XFS_ALLOC_INITIAL_USER_DATA : XFS_ALLOC_USERDATA; > + if (bma->flags & XFS_BMAPI_ZERO) > + bma->userdata |= XFS_ALLOC_USERDATA_ZERO; > } > > bma->minlen = (bma->flags & XFS_BMAPI_CONTIG) ? bma->length : 1; > @@ -4414,6 +4422,17 @@ xfs_bmapi_convert_unwritten( > mval->br_state = (mval->br_state == XFS_EXT_UNWRITTEN) > ? XFS_EXT_NORM : XFS_EXT_UNWRITTEN; > > + /* > + * Before insertion into the bmbt, zero the range being converted > + * if required. > + */ > + if (flags & XFS_BMAPI_ZERO) { > + error = xfs_zero_extent(bma->ip, mval->br_startblock, > + mval->br_blockcount); > + if (error) > + return error; > + } > + > error = xfs_bmap_add_extent_unwritten_real(bma->tp, bma->ip, &bma->idx, > &bma->cur, mval, bma->firstblock, bma->flist, > &tmp_logflags); > @@ -4507,6 +4526,18 @@ xfs_bmapi_write( > ASSERT(XFS_IFORK_FORMAT(ip, whichfork) != XFS_DINODE_FMT_LOCAL); > ASSERT(xfs_isilocked(ip, XFS_ILOCK_EXCL)); > > + /* zeroing is for currently only for data extents, not metadata */ > + ASSERT((flags & (XFS_BMAPI_METADATA | XFS_BMAPI_ZERO)) != > + (XFS_BMAPI_METADATA | XFS_BMAPI_ZERO)); > + /* > + * we can allocate unwritten extents or pre-zero allocated blocks, > + * but it makes no sense to do both at once. This would result in > + * zeroing the unwritten extent twice, but it still being an > + * unwritten extent.... > + */ > + ASSERT((flags & (XFS_BMAPI_PREALLOC | XFS_BMAPI_ZERO)) != > + (XFS_BMAPI_PREALLOC | XFS_BMAPI_ZERO)); > + > if (unlikely(XFS_TEST_ERROR( > (XFS_IFORK_FORMAT(ip, whichfork) != XFS_DINODE_FMT_EXTENTS && > XFS_IFORK_FORMAT(ip, whichfork) != XFS_DINODE_FMT_BTREE), > diff --git a/libxfs/xfs_bmap.h b/libxfs/xfs_bmap.h > index d3daf6d..baec27d 100644 > --- a/libxfs/xfs_bmap.h > +++ b/libxfs/xfs_bmap.h > @@ -52,9 +52,9 @@ struct xfs_bmalloca { > xfs_extlen_t minleft; /* amount must be left after alloc */ > bool eof; /* set if allocating past last extent */ > bool wasdel; /* replacing a delayed allocation */ > - bool userdata;/* set if is user data */ > bool aeof; /* allocated space at eof */ > bool conv; /* overwriting unwritten extents */ > + char userdata;/* userdata mask */ > int flags; > }; > > @@ -109,6 +109,14 @@ typedef struct xfs_bmap_free > */ > #define XFS_BMAPI_CONVERT 0x040 > > +/* > + * allocate zeroed extents - this requires all newly allocated user data extents > + * to be initialised to zero. It will be ignored if XFS_BMAPI_METADATA is set. > + * Use in conjunction with XFS_BMAPI_CONVERT to convert unwritten extents found > + * during the allocation range to zeroed written extents. > + */ > +#define XFS_BMAPI_ZERO 0x080 > + > #define XFS_BMAPI_FLAGS \ > { XFS_BMAPI_ENTIRE, "ENTIRE" }, \ > { XFS_BMAPI_METADATA, "METADATA" }, \ > @@ -116,7 +124,8 @@ typedef struct xfs_bmap_free > { XFS_BMAPI_PREALLOC, "PREALLOC" }, \ > { XFS_BMAPI_IGSTATE, "IGSTATE" }, \ > { XFS_BMAPI_CONTIG, "CONTIG" }, \ > - { XFS_BMAPI_CONVERT, "CONVERT" } > + { XFS_BMAPI_CONVERT, "CONVERT" }, \ > + { XFS_BMAPI_ZERO, "ZERO" } > > > static inline int xfs_bmapi_aflag(int w) > -- > 2.5.0 > > _______________________________________________ > xfs mailing list > xfs@oss.sgi.com > http://oss.sgi.com/mailman/listinfo/xfs From bfoster@redhat.com Tue Feb 16 13:20:40 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=ham version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay3.corp.sgi.com [198.149.34.15]) by oss.sgi.com (Postfix) with ESMTP id 5E84D7CA3 for ; Tue, 16 Feb 2016 13:20:40 -0600 (CST) Received: from cuda.sgi.com (cuda2.sgi.com [192.48.176.25]) by relay3.corp.sgi.com (Postfix) with ESMTP id D94D0AC009 for ; Tue, 16 Feb 2016 11:20:39 -0800 (PST) X-ASG-Debug-ID: 1455650438-04cbb0433112e410001-NocioJ Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by cuda.sgi.com with ESMTP id VOMdbMZmNiEidDrW (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO) for ; Tue, 16 Feb 2016 11:20:38 -0800 (PST) X-Barracuda-Envelope-From: bfoster@redhat.com X-Barracuda-Apparent-Source-IP: 209.132.183.28 X-ASG-Whitelist: Client Received: from int-mx10.intmail.prod.int.phx2.redhat.com (int-mx10.intmail.prod.int.phx2.redhat.com [10.5.11.23]) by mx1.redhat.com (Postfix) with ESMTPS id 2253E7AE8A; Tue, 16 Feb 2016 19:20:38 +0000 (UTC) Received: from bfoster.bfoster (dhcp-41-164.bos.redhat.com [10.18.41.164]) by int-mx10.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id u1GJKbO7009735; Tue, 16 Feb 2016 14:20:37 -0500 Received: by bfoster.bfoster (Postfix, from userid 1000) id 71DDD123DF8; Tue, 16 Feb 2016 14:20:36 -0500 (EST) Date: Tue, 16 Feb 2016 14:20:36 -0500 From: Brian Foster To: Dave Chinner Cc: xfs@oss.sgi.com Subject: Re: [PATCH 10/14] xfs: handle dquot buffer readahead in log recovery correctly Message-ID: <20160216192036.GG39655@bfoster.bfoster> X-ASG-Orig-Subj: Re: [PATCH 10/14] xfs: handle dquot buffer readahead in log recovery correctly References: <1455517105-20033-1-git-send-email-david@fromorbit.com> <1455517105-20033-11-git-send-email-david@fromorbit.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1455517105-20033-11-git-send-email-david@fromorbit.com> User-Agent: Mutt/1.5.24 (2015-08-30) X-Scanned-By: MIMEDefang 2.68 on 10.5.11.23 X-Barracuda-Connect: mx1.redhat.com[209.132.183.28] X-Barracuda-Start-Time: 1455650438 X-Barracuda-Encrypted: ECDHE-RSA-AES256-GCM-SHA384 X-Barracuda-URL: https://192.48.176.25:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-BRTS-Status: 1 On Mon, Feb 15, 2016 at 05:18:21PM +1100, Dave Chinner wrote: > From: Dave Chinner > > Source kernel commit 7d6a13f023567d573ac362502bb702eda716e654 > > When we do dquot readahead in log recovery, we do not use a verifier > as the underlying buffer may not have dquots in it. e.g. the > allocation operation hasn't yet been replayed. Hence we do not want > to fail recovery because we detect an operation to be replayed has > not been run yet. This problem was addressed for inodes in commit > d891400 ("xfs: inode buffers may not be valid during recovery > readahead") but the problem was not recognised to exist for dquots > and their buffers as the dquot readahead did not have a verifier. > > The result of not using a verifier is that when the buffer is then > next read to replay a dquot modification, the dquot buffer verifier > will only be attached to the buffer if *readahead is not complete*. > Hence we can read the buffer, replay the dquot changes and then add > it to the delwri submission list without it having a verifier > attached to it. This then generates warnings in xfs_buf_ioapply(), > which catches and warns about this case. > > Fix this and make it handle the same readahead verifier error cases > as for inode buffers by adding a new readahead verifier that has a > write operation as well as a read operation that marks the buffer as > not done if any corruption is detected. Also make sure we don't run > readahead if the dquot buffer has been marked as cancelled by > recovery. > > This will result in readahead either succeeding and the buffer > having a valid write verifier, or readahead failing and the buffer > state requiring the subsequent read to resubmit the IO with the new > verifier. In either case, this will result in the buffer always > ending up with a valid write verifier on it. > > Note: we also need to fix the inode buffer readahead error handling > to mark the buffer with EIO. Brian noticed the code I copied from > there wrong during review, so fix it at the same time. Add comments > linking the two functions that handle readahead verifier errors > together so we don't forget this behavioural link in future. > > cc: # 3.12 - current > Signed-off-by: Dave Chinner > Reviewed-by: Brian Foster > Signed-off-by: Dave Chinner > --- > libxfs/xfs_dquot_buf.c | 36 ++++++++++++++++++++++++++++++------ > libxfs/xfs_inode_buf.c | 2 ++ > libxfs/xfs_quota_defs.h | 2 +- > libxfs/xfs_shared.h | 1 + > 4 files changed, 34 insertions(+), 7 deletions(-) > > diff --git a/libxfs/xfs_dquot_buf.c b/libxfs/xfs_dquot_buf.c > index fd4aa4b..025d49b 100644 > --- a/libxfs/xfs_dquot_buf.c > +++ b/libxfs/xfs_dquot_buf.c ... > @@ -282,13 +301,18 @@ xfs_dquot_buf_write_verify( > { > struct xfs_mount *mp = bp->b_target->bt_mount; > > - if (!xfs_dquot_buf_verify(mp, bp)) { > + if (!xfs_dquot_buf_verify(mp, bp, XFS_QMOPT_DOWARN)) { > xfs_buf_ioerror(bp, -EFSCORRUPTED); > xfs_verifier_error(bp); > return; > } > } > > +const struct xfs_buf_ops xfs_dquot_buf_ra_ops = { > + .name = "xfs_dquot_ra", > + .verify_read = xfs_dquot_buf_readahead_verify, > + .verify_write = xfs_dquot_buf_write_verify, > +}; > const struct xfs_buf_ops xfs_dquot_buf_ops = { > .name = "xfs_dquot", > .verify_read = xfs_dquot_buf_read_verify, Nit: the readahead ops structure comes after the buf_ops structure in the kernel code. Reviewed-by: Brian Foster > diff --git a/libxfs/xfs_inode_buf.c b/libxfs/xfs_inode_buf.c > index 546af74..89c05ad 100644 > --- a/libxfs/xfs_inode_buf.c > +++ b/libxfs/xfs_inode_buf.c > @@ -77,6 +77,8 @@ xfs_dinode_good_version( > * recovery and we don't get unnecssary panics on debug kernels. We use EIO here > * because all we want to do is say readahead failed; there is no-one to report > * the error to, so this will distinguish it from a non-ra verifier failure. > + * Changes to this readahead error behavour also need to be reflected in > + * xfs_dquot_buf_readahead_verify(). > */ > static void > xfs_inode_buf_verify( > diff --git a/libxfs/xfs_quota_defs.h b/libxfs/xfs_quota_defs.h > index 1b0a083..f51078f 100644 > --- a/libxfs/xfs_quota_defs.h > +++ b/libxfs/xfs_quota_defs.h > @@ -153,7 +153,7 @@ typedef __uint16_t xfs_qwarncnt_t; > #define XFS_QMOPT_RESBLK_MASK (XFS_QMOPT_RES_REGBLKS | XFS_QMOPT_RES_RTBLKS) > > extern int xfs_dqcheck(struct xfs_mount *mp, xfs_disk_dquot_t *ddq, > - xfs_dqid_t id, uint type, uint flags, char *str); > + xfs_dqid_t id, uint type, uint flags, const char *str); > extern int xfs_calc_dquots_per_chunk(unsigned int nbblks); > > #endif /* __XFS_QUOTA_H__ */ > diff --git a/libxfs/xfs_shared.h b/libxfs/xfs_shared.h > index 5be5297..15c3ceb 100644 > --- a/libxfs/xfs_shared.h > +++ b/libxfs/xfs_shared.h > @@ -49,6 +49,7 @@ extern const struct xfs_buf_ops xfs_inobt_buf_ops; > extern const struct xfs_buf_ops xfs_inode_buf_ops; > extern const struct xfs_buf_ops xfs_inode_buf_ra_ops; > extern const struct xfs_buf_ops xfs_dquot_buf_ops; > +extern const struct xfs_buf_ops xfs_dquot_buf_ra_ops; > extern const struct xfs_buf_ops xfs_sb_buf_ops; > extern const struct xfs_buf_ops xfs_sb_quiet_buf_ops; > extern const struct xfs_buf_ops xfs_symlink_buf_ops; > -- > 2.5.0 > > _______________________________________________ > xfs mailing list > xfs@oss.sgi.com > http://oss.sgi.com/mailman/listinfo/xfs From tdm@sgi.com Tue Feb 16 17:04:07 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=RP_MATCHES_RCVD autolearn=ham version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay1.corp.sgi.com [137.38.102.111]) by oss.sgi.com (Postfix) with ESMTP id 7A81D7CA2 for ; Tue, 16 Feb 2016 17:04:07 -0600 (CST) Received: from estes.americas.sgi.com (estes.americas.sgi.com [128.162.236.10]) by relay1.corp.sgi.com (Postfix) with ESMTP id 4C32D8F8035; Tue, 16 Feb 2016 15:04:04 -0800 (PST) Received: from [128.162.232.11] (porter.americas.sgi.com [128.162.232.11]) by estes.americas.sgi.com (Postfix) with ESMTP id F39B17000103; Tue, 16 Feb 2016 17:04:03 -0600 (CST) Message-ID: <56C3AAE3.7030108@sgi.com> Date: Tue, 16 Feb 2016 17:04:03 -0600 From: Troy McCorkell User-Agent: Mozilla/5.0 (X11; U; Linux i686 (x86_64); en-US; rv:1.9.1.5) Gecko/20091204 Thunderbird/3.0 MIME-Version: 1.0 To: "xfs@oss.sgi.com" , Dave Chinner , Eric Sandeen , Russell Cattelan Subject: Re: oss.sgi.com - maintenance Wed Feb 17 09:00 CT USA References: <56BE64EA.80906@sgi.com> In-Reply-To: <56BE64EA.80906@sgi.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit On 02/12/2016 05:04 PM, Troy McCorkell wrote: > oss.sgi.com will be down for approximately 30 minutes starting at > Wed Feb 17 09:00 CT USA for maintenance. Sending an additional reminder. From ross.zwisler@linux.intel.com Tue Feb 16 17:54:19 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=ham version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay3.corp.sgi.com [198.149.34.15]) by oss.sgi.com (Postfix) with ESMTP id DB6407CA2 for ; Tue, 16 Feb 2016 17:54:18 -0600 (CST) Received: from cuda.sgi.com (cuda2.sgi.com [192.48.176.25]) by relay3.corp.sgi.com (Postfix) with ESMTP id 5000DAC006 for ; Tue, 16 Feb 2016 15:54:18 -0800 (PST) X-ASG-Debug-ID: 1455666856-04cbb04334138f40001-NocioJ Received: from mga04.intel.com ([192.55.52.120]) by cuda.sgi.com with ESMTP id G3d3N2TTL844gTRj for ; Tue, 16 Feb 2016 15:54:16 -0800 (PST) X-Barracuda-Envelope-From: ross.zwisler@linux.intel.com X-Barracuda-Apparent-Source-IP: 192.55.52.120 X-ASG-Whitelist: Client Received: from orsmga002.jf.intel.com ([10.7.209.21]) by fmsmga104.fm.intel.com with ESMTP; 16 Feb 2016 15:54:15 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.22,457,1449561600"; d="scan'208";a="913745131" Received: from rzwisler-desk.amr.corp.intel.com (HELO linux.intel.com) ([10.254.20.43]) by orsmga002.jf.intel.com with ESMTP; 16 Feb 2016 15:54:05 -0800 Date: Tue, 16 Feb 2016 16:53:53 -0700 From: Ross Zwisler To: Dave Chinner Cc: xfs@oss.sgi.com, ross.zwisler@linux.intel.com, jack@suse.cz Subject: Re: [PATCH 0/4] xfs: fixes for XFS_DIFLAG2_DAX support Message-ID: <20160216235353.GA25419@linux.intel.com> X-ASG-Orig-Subj: Re: [PATCH 0/4] xfs: fixes for XFS_DIFLAG2_DAX support References: <1455513734-15192-1-git-send-email-david@fromorbit.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1455513734-15192-1-git-send-email-david@fromorbit.com> User-Agent: Mutt/1.5.24 (2015-08-30) X-Barracuda-Connect: UNKNOWN[192.55.52.120] X-Barracuda-Start-Time: 1455666856 X-Barracuda-URL: https://192.48.176.25:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-BRTS-Status: 1 On Mon, Feb 15, 2016 at 04:22:10PM +1100, Dave Chinner wrote: > Hi folks, > > This is a series to add the correct constraints to using the on-disk > inode flag to enable DAX on per-file basis. The same constraints are > placed on setting the flag on directories for inheritance purposes. > > These constraints are: > - the inode flag is limited to regular files or directory > inodes. > - the S_DAX flag is only ever set on regular files > - the flag can only ever be set on filesystems which have > blocksize == PAGE_SIZE (for now) > - When the flag is set or cleared, the current mapping > contents are flushed and then invalidated so that the new > access mode starts with an empty mapping. > - Setting or clearing the flag is atomic w.r.t. IO and > page faults. > > I've tested these manually with xfs_io (patchset for supporting > chattr +x/-x to be sent soon), and it all appears to work as > expected. I'd like to push these for 4.5-rc6 so the initial kernel > with support for this flag doesn't do silly things, so comments, > testing and review woul dbe appreciated. I'm seeing the following errors with xfs/305 when running these four patches + v4.5-rc4: ================================================ [ BUG: lock held when returning to user space! ] 4.5.0-rc4+ #4 Not tainted ------------------------------------------------ fsstress/2311 is leaving the kernel with locks still held! 2 locks held by fsstress/2311: #0: (&(&ip->i_iolock)->mr_lock){++++++}, at: [< inline >] mrupdate_nested fs/xfs/mrlock.h:48 #0: (&(&ip->i_iolock)->mr_lock){++++++}, at: [] xfs_ilock+0x152/0x1f0 fs/xfs/xfs_inode.c:170 #1: (&(&ip->i_mmaplock)->mr_lock){+.+.+.}, at: [< inline >] mrupdate_nested fs/xfs/mrlock.h:48 #1: (&(&ip->i_mmaplock)->mr_lock){+.+.+.}, at: [] xfs_ilock+0x17d/0x1f0 fs/xfs/xfs_inode.c:175 XFS: Assertion failed: !rwsem_is_locked(&ip->i_iolock.mr_lock), file: fs/xfs/xfs_super.c, line: 981 ------------[ cut here ]------------ kernel BUG at fs/xfs/xfs_message.c:113! invalid opcode: 0000 [#1] SMP Modules linked in: nd_pmem nd_btt nd_e820 libnvdimm CPU: 1 PID: 2332 Comm: fsstress Not tainted 4.5.0-rc4+ #4 Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS 1.8.2-20150714_191134- 04/01/2014 task: ffff88009a093180 ti: ffff88009993c000 task.ti: ffff88009993c000 RIP: 0010:[] [] assfail+0x20/0x30 RSP: 0018:ffff88009993fe30 EFLAGS: 00010246 RAX: 0000000000000000 RBX: ffff88009843f018 RCX: 0000000000000000 RDX: 00000000ffffffc0 RSI: 000000000000000a RDI: ffffffff81ee7c48 RBP: ffff88009993fe30 R08: 0000000000000000 R09: 0000000000000000 R10: 000000000000000a R11: f000000000000000 R12: ffff88009843ec80 R13: ffff88009843f018 R14: ffff88009843f0a0 R15: ffff88009843f018 FS: 00007f5dfda64700(0000) GS:ffff88051a200000(0000) knlGS:0000000000000000 CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 CR2: 00007f5dfd8c1008 CR3: 000000009a20a000 CR4: 00000000000006e0 Stack: ffff88009993fe58 ffffffff814a659a ffff88009843f018 ffff88009843f1f0 ffffffff81c52e40 ffff88009993fe80 ffffffff8127e608 ffff880097112000 ffff88009843f018 ffffffff81c52e40 ffff88009993feb0 ffffffff8127e8db Call Trace: [] xfs_fs_evict_inode+0x3a/0x110 fs/xfs/xfs_super.c:981 [] evict+0xb8/0x180 fs/inode.c:542 [< inline >] iput_final fs/inode.c:1477 [] iput+0x1ab/0x230 fs/inode.c:1504 [] do_unlinkat+0x1d1/0x2a0 fs/namei.c:3939 [< inline >] SYSC_unlink fs/namei.c:3980 [] SyS_unlink+0x16/0x20 fs/namei.c:3978 [] entry_SYSCALL_64_fastpath+0x12/0x76 arch/x86/entry/entry_64.S:185 Code: 66 66 2e 0f 1f 84 00 00 00 00 00 66 66 66 66 90 55 48 89 f1 41 89 d0 48 c7 c6 b8 cc f2 81 48 89 fa 31 ff 48 89 e5 e8 b0 f8 ff ff <0f> 0b 66 66 66 66 66 2e 0f 1f 84 00 00 00 00 00 66 66 66 66 90 RIP [] assfail+0x20/0x30 fs/xfs/xfs_message.c:111 RSP ---[ end trace 1f81c918d4ac8110 ]--- From david@fromorbit.com Tue Feb 16 18:24:03 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=ham version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay2.corp.sgi.com [137.38.102.29]) by oss.sgi.com (Postfix) with ESMTP id 4D21F7CA2 for ; Tue, 16 Feb 2016 18:24:03 -0600 (CST) Received: from cuda.sgi.com (cuda1.sgi.com [192.48.157.11]) by relay2.corp.sgi.com (Postfix) with ESMTP id 0E0B0304032 for ; Tue, 16 Feb 2016 16:23:59 -0800 (PST) X-ASG-Debug-ID: 1455668635-04bdf02d5c45ec0001-NocioJ Received: from ipmail04.adl6.internode.on.net (ipmail04.adl6.internode.on.net [150.101.137.141]) by cuda.sgi.com with ESMTP id 2A2VGdS23651Dpg2 for ; Tue, 16 Feb 2016 16:23:56 -0800 (PST) X-Barracuda-Envelope-From: david@fromorbit.com X-Barracuda-Apparent-Source-IP: 150.101.137.141 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: A2CbCACKvMNWXJbY03ZegzqBP4Joo3cBAQEBAQEGi3GCdYJShAiGBwICAQECgTpNAQEBAQEBB0RAhEIBAQQnExwjEAgDGAklDwUlAwcaE4gZu00BAQEHAgEdGIUxhH2EDAuDRoEPBYdVjyuGfIZUjnxEjX2EWSguhygBH4EZAQEB Received: from ppp118-211-216-150.lns20.syd4.internode.on.net (HELO dastard) ([118.211.216.150]) by ipmail04.adl6.internode.on.net with ESMTP; 17 Feb 2016 10:53:55 +1030 Received: from dave by dastard with local (Exim 4.80) (envelope-from ) id 1aVpuL-00049U-P3; Wed, 17 Feb 2016 11:23:53 +1100 Date: Wed, 17 Feb 2016 11:23:53 +1100 From: Dave Chinner To: Ross Zwisler Cc: xfs@oss.sgi.com, jack@suse.cz Subject: Re: [PATCH 0/4] xfs: fixes for XFS_DIFLAG2_DAX support Message-ID: <20160217002353.GA19486@dastard> X-ASG-Orig-Subj: Re: [PATCH 0/4] xfs: fixes for XFS_DIFLAG2_DAX support References: <1455513734-15192-1-git-send-email-david@fromorbit.com> <20160216235353.GA25419@linux.intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20160216235353.GA25419@linux.intel.com> User-Agent: Mutt/1.5.21 (2010-09-15) X-Barracuda-Connect: ipmail04.adl6.internode.on.net[150.101.137.141] X-Barracuda-Start-Time: 1455668636 X-Barracuda-URL: https://192.48.157.11:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-BRTS-Status: 1 X-Barracuda-Spam-Score: 0.00 X-Barracuda-Spam-Status: No, SCORE=0.00 using per-user scores of TAG_LEVEL=1000.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.7 tests=BSF_SC0_MISMATCH_TO X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.3.27088 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 0.00 BSF_SC0_MISMATCH_TO Envelope rcpt doesn't match header On Tue, Feb 16, 2016 at 04:53:53PM -0700, Ross Zwisler wrote: > On Mon, Feb 15, 2016 at 04:22:10PM +1100, Dave Chinner wrote: > > Hi folks, > > > > This is a series to add the correct constraints to using the on-disk > > inode flag to enable DAX on per-file basis. The same constraints are > > placed on setting the flag on directories for inheritance purposes. > > > > These constraints are: > > - the inode flag is limited to regular files or directory > > inodes. > > - the S_DAX flag is only ever set on regular files > > - the flag can only ever be set on filesystems which have > > blocksize == PAGE_SIZE (for now) > > - When the flag is set or cleared, the current mapping > > contents are flushed and then invalidated so that the new > > access mode starts with an empty mapping. > > - Setting or clearing the flag is atomic w.r.t. IO and > > page faults. > > > > I've tested these manually with xfs_io (patchset for supporting > > chattr +x/-x to be sent soon), and it all appears to work as > > expected. I'd like to push these for 4.5-rc6 so the initial kernel > > with support for this flag doesn't do silly things, so comments, > > testing and review woul dbe appreciated. > > I'm seeing the following errors with xfs/305 when running these four patches + > v4.5-rc4: > > ================================================ > [ BUG: lock held when returning to user space! ] > 4.5.0-rc4+ #4 Not tainted > ------------------------------------------------ > fsstress/2311 is leaving the kernel with locks still held! > 2 locks held by fsstress/2311: > #0: (&(&ip->i_iolock)->mr_lock){++++++}, at: [< inline >] mrupdate_nested fs/xfs/mrlock.h:48 > #0: (&(&ip->i_iolock)->mr_lock){++++++}, at: [] xfs_ilock+0x152/0x1f0 fs/xfs/xfs_inode.c:170 > #1: (&(&ip->i_mmaplock)->mr_lock){+.+.+.}, at: [< inline >] mrupdate_nested fs/xfs/mrlock.h:48 > #1: (&(&ip->i_mmaplock)->mr_lock){+.+.+.}, at: [] xfs_ilock+0x17d/0x1f0 fs/xfs/xfs_inode.c:175 I can see an error path where this might occur on a project quota related test (fsstress can change projid, that can fail the quota reservation, leaks locks). I'll fix and resend later today. Cheers, Dave. -- Dave Chinner david@fromorbit.com From ross.zwisler@linux.intel.com Tue Feb 16 21:34:37 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=ham version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay3.corp.sgi.com [198.149.34.15]) by oss.sgi.com (Postfix) with ESMTP id 0CEE27CA2 for ; Tue, 16 Feb 2016 21:34:37 -0600 (CST) Received: from cuda.sgi.com (cuda3.sgi.com [192.48.176.15]) by relay3.corp.sgi.com (Postfix) with ESMTP id 6E27DAC006 for ; Tue, 16 Feb 2016 19:34:36 -0800 (PST) X-ASG-Debug-ID: 1455680074-04cb6c1e581246b0001-NocioJ Received: from mga04.intel.com ([192.55.52.120]) by cuda.sgi.com with ESMTP id yT51USGpM34UioaV for ; Tue, 16 Feb 2016 19:34:35 -0800 (PST) X-Barracuda-Envelope-From: ross.zwisler@linux.intel.com X-Barracuda-Apparent-Source-IP: 192.55.52.120 X-ASG-Whitelist: Client Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by fmsmga104.fm.intel.com with ESMTP; 16 Feb 2016 19:34:34 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.22,458,1449561600"; d="scan'208";a="916486825" Received: from rzwisler-desk.amr.corp.intel.com (HELO phyrexia.intel.com) ([10.254.20.43]) by fmsmga002.fm.intel.com with ESMTP; 16 Feb 2016 19:34:33 -0800 From: Ross Zwisler To: linux-kernel@vger.kernel.org Cc: Ross Zwisler , "J. Bruce Fields" , "Theodore Ts'o" , Alexander Viro , Andreas Dilger , Andrew Morton , Dan Williams , Dave Chinner , Jan Kara , Jeff Layton , Jens Axboe , Matthew Wilcox , linux-block@vger.kernel.org, linux-ext4@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux-mm@kvack.org, linux-nvdimm@lists.01.org, xfs@oss.sgi.com Subject: [PATCH v3 0/6] DAX fixes, move flushing calls to FS Date: Tue, 16 Feb 2016 20:34:13 -0700 X-ASG-Orig-Subj: [PATCH v3 0/6] DAX fixes, move flushing calls to FS Message-Id: <1455680059-20126-1-git-send-email-ross.zwisler@linux.intel.com> X-Mailer: git-send-email 2.5.0 X-Barracuda-Connect: UNKNOWN[192.55.52.120] X-Barracuda-Start-Time: 1455680074 X-Barracuda-URL: https://192.48.176.15:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-BRTS-Status: 1 This patch series fixes several issues with the current DAX code: 1) DAX is used by default on raw block devices that are capable of supporting it. This creates an issue because there are still uses of the block device that use the page cache, and having one block device user doing DAX I/O and another doing page cache I/O can lead to data corruption. 2) When S_DAX is set on an inode we assume that if there are pages attached to the mapping (mapping->nrpages != 0), those pages are clean zero pages that were used to service reads from holes. This wasn't true in all cases. 3) ext4 online defrag combined with DAX I/O could lead to data corruption. 4) The DAX block/sector zeroing code needs a valid struct block_device, which it wasn't always getting. 5) The DAX writeback code needs a valid struct block_device, which it wasn't always getting. 6) The DAX writeback code needs to be called for sync(2) and syncfs(2). The last patch in this series reenables the DAX I/O path for raw block devices when they would otherwise be doing direct I/O. It can be dropped if it is too controversial. Thank you to Dan Williams and Jan Kara for their code contributions to this set. A working tree can be found here: https://git.kernel.org/cgit/linux/kernel/git/zwisler/linux.git/log/?h=fsync_bdev_v3 Dan Williams (2): block: disable block device DAX by default block: use dax_do_io() if blkdev_dax_capable() Ross Zwisler (4): ext2, ext4: only set S_DAX for regular inodes ext4: Online defrag not supported with DAX dax: give DAX clearing code correct bdev dax: move writeback calls into the filesystems block/Kconfig | 13 +++++++++++++ block/ioctl.c | 1 + fs/block_dev.c | 22 +++++++++++++++++++--- fs/dax.c | 21 +++++++++++---------- fs/ext2/inode.c | 16 +++++++++++++--- fs/ext4/inode.c | 6 +++++- fs/ext4/ioctl.c | 5 +++++ fs/xfs/xfs_aops.c | 6 +++++- fs/xfs/xfs_aops.h | 1 + fs/xfs/xfs_bmap_util.c | 3 ++- include/linux/dax.h | 8 +++++--- include/linux/fs.h | 31 +++++++++++++++++++++---------- mm/filemap.c | 12 ++++-------- 13 files changed, 105 insertions(+), 40 deletions(-) -- 2.5.0 From ross.zwisler@linux.intel.com Tue Feb 16 21:34:38 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=ham version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay1.corp.sgi.com [137.38.102.111]) by oss.sgi.com (Postfix) with ESMTP id 4EBFF7CA3 for ; Tue, 16 Feb 2016 21:34:38 -0600 (CST) Received: from cuda.sgi.com (cuda3.sgi.com [192.48.176.15]) by relay1.corp.sgi.com (Postfix) with ESMTP id 3DE888F8039 for ; Tue, 16 Feb 2016 19:34:38 -0800 (PST) X-ASG-Debug-ID: 1455680074-04cb6c1e581246b0003-NocioJ Received: from mga04.intel.com ([192.55.52.120]) by cuda.sgi.com with ESMTP id lyoIl7dandCvqFcx for ; Tue, 16 Feb 2016 19:34:37 -0800 (PST) X-Barracuda-Envelope-From: ross.zwisler@linux.intel.com X-Barracuda-Apparent-Source-IP: 192.55.52.120 X-ASG-Whitelist: Client Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by fmsmga104.fm.intel.com with ESMTP; 16 Feb 2016 19:34:37 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.22,458,1449561600"; d="scan'208";a="916486835" Received: from rzwisler-desk.amr.corp.intel.com (HELO phyrexia.intel.com) ([10.254.20.43]) by fmsmga002.fm.intel.com with ESMTP; 16 Feb 2016 19:34:36 -0800 From: Ross Zwisler To: linux-kernel@vger.kernel.org Cc: Ross Zwisler , "J. Bruce Fields" , "Theodore Ts'o" , Alexander Viro , Andreas Dilger , Andrew Morton , Dan Williams , Dave Chinner , Jan Kara , Jeff Layton , Jens Axboe , Matthew Wilcox , linux-block@vger.kernel.org, linux-ext4@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux-mm@kvack.org, linux-nvdimm@lists.01.org, xfs@oss.sgi.com Subject: [PATCH v3 2/6] ext2, ext4: only set S_DAX for regular inodes Date: Tue, 16 Feb 2016 20:34:15 -0700 X-ASG-Orig-Subj: [PATCH v3 2/6] ext2, ext4: only set S_DAX for regular inodes Message-Id: <1455680059-20126-3-git-send-email-ross.zwisler@linux.intel.com> X-Mailer: git-send-email 2.5.0 In-Reply-To: <1455680059-20126-1-git-send-email-ross.zwisler@linux.intel.com> References: <1455680059-20126-1-git-send-email-ross.zwisler@linux.intel.com> X-Barracuda-Connect: UNKNOWN[192.55.52.120] X-Barracuda-Start-Time: 1455680076 X-Barracuda-URL: https://192.48.176.15:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-BRTS-Status: 1 When S_DAX is set on an inode we assume that if there are pages attached to the mapping (mapping->nrpages != 0), those pages are clean zero pages that were used to service reads from holes. Any dirty data associated with the inode should be in the form of DAX exceptional entries (mapping->nrexceptional) that is written back via dax_writeback_mapping_range(). With the current code, though, this isn't always true. For example, ext2 and ext4 directory inodes can have S_DAX set, but have their dirty data stored as dirty page cache entries. For these types of inodes, having S_DAX set doesn't really make sense since their I/O doesn't actually happen through the DAX code path. Instead, only allow S_DAX to be set for regular inodes for ext2 and ext4. This allows us to have strict DAX vs non-DAX paths in the writeback code. Signed-off-by: Ross Zwisler --- fs/ext2/inode.c | 2 +- fs/ext4/inode.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/fs/ext2/inode.c b/fs/ext2/inode.c index 338eefd..27e2cdd 100644 --- a/fs/ext2/inode.c +++ b/fs/ext2/inode.c @@ -1296,7 +1296,7 @@ void ext2_set_inode_flags(struct inode *inode) inode->i_flags |= S_NOATIME; if (flags & EXT2_DIRSYNC_FL) inode->i_flags |= S_DIRSYNC; - if (test_opt(inode->i_sb, DAX)) + if (test_opt(inode->i_sb, DAX) && S_ISREG(inode->i_mode)) inode->i_flags |= S_DAX; } diff --git a/fs/ext4/inode.c b/fs/ext4/inode.c index 83bc8bf..7088aa5 100644 --- a/fs/ext4/inode.c +++ b/fs/ext4/inode.c @@ -4127,7 +4127,7 @@ void ext4_set_inode_flags(struct inode *inode) new_fl |= S_NOATIME; if (flags & EXT4_DIRSYNC_FL) new_fl |= S_DIRSYNC; - if (test_opt(inode->i_sb, DAX)) + if (test_opt(inode->i_sb, DAX) && S_ISREG(inode->i_mode)) new_fl |= S_DAX; inode_set_flags(inode, new_fl, S_SYNC|S_APPEND|S_IMMUTABLE|S_NOATIME|S_DIRSYNC|S_DAX); -- 2.5.0 From ross.zwisler@linux.intel.com Tue Feb 16 21:34:40 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=ham version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay1.corp.sgi.com [137.38.102.111]) by oss.sgi.com (Postfix) with ESMTP id 48AE87CA3 for ; Tue, 16 Feb 2016 21:34:40 -0600 (CST) Received: from cuda.sgi.com (cuda3.sgi.com [192.48.176.15]) by relay1.corp.sgi.com (Postfix) with ESMTP id 269A98F8039 for ; Tue, 16 Feb 2016 19:34:37 -0800 (PST) X-ASG-Debug-ID: 1455680074-04cb6c1e581246b0002-NocioJ Received: from mga04.intel.com ([192.55.52.120]) by cuda.sgi.com with ESMTP id NwAm4EyVDRVLF5xz for ; Tue, 16 Feb 2016 19:34:36 -0800 (PST) X-Barracuda-Envelope-From: ross.zwisler@linux.intel.com X-Barracuda-Apparent-Source-IP: 192.55.52.120 X-ASG-Whitelist: Client Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by fmsmga104.fm.intel.com with ESMTP; 16 Feb 2016 19:34:36 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.22,458,1449561600"; d="scan'208";a="916486830" Received: from rzwisler-desk.amr.corp.intel.com (HELO phyrexia.intel.com) ([10.254.20.43]) by fmsmga002.fm.intel.com with ESMTP; 16 Feb 2016 19:34:35 -0800 From: Ross Zwisler To: linux-kernel@vger.kernel.org Cc: Dan Williams , "J. Bruce Fields" , "Theodore Ts'o" , Alexander Viro , Andreas Dilger , Andrew Morton , Dave Chinner , Jan Kara , Jeff Layton , Jens Axboe , Matthew Wilcox , linux-block@vger.kernel.org, linux-ext4@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux-mm@kvack.org, linux-nvdimm@lists.01.org, xfs@oss.sgi.com, Jan Kara , Jens Axboe , Matthew Wilcox , Al Viro , Ross Zwisler Subject: [PATCH v3 1/6] block: disable block device DAX by default Date: Tue, 16 Feb 2016 20:34:14 -0700 X-ASG-Orig-Subj: [PATCH v3 1/6] block: disable block device DAX by default Message-Id: <1455680059-20126-2-git-send-email-ross.zwisler@linux.intel.com> X-Mailer: git-send-email 2.5.0 In-Reply-To: <1455680059-20126-1-git-send-email-ross.zwisler@linux.intel.com> References: <1455680059-20126-1-git-send-email-ross.zwisler@linux.intel.com> X-Barracuda-Connect: UNKNOWN[192.55.52.120] X-Barracuda-Start-Time: 1455680075 X-Barracuda-URL: https://192.48.176.15:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-BRTS-Status: 1 From: Dan Williams The recent *sync enabling discovered that we are inserting into the block_device pagecache counter to the expectations of the dirty data tracking for dax mappings. This can lead to data corruption. We want to support DAX for block devices eventually, but it requires wider changes to properly manage the pagecache. [] dump_stack+0x85/0xc2 [] dax_writeback_mapping_range+0x60/0xe0 [] blkdev_writepages+0x3f/0x50 [] do_writepages+0x21/0x30 [] __filemap_fdatawrite_range+0xc6/0x100 [] filemap_write_and_wait+0x4a/0xa0 [] set_blocksize+0x70/0xd0 [] sb_set_blocksize+0x1d/0x50 [] ext4_fill_super+0x75b/0x3360 [] ? vsnprintf+0x201/0x4c0 [] ? snprintf+0x49/0x60 [] mount_bdev+0x180/0x1b0 [] ? ext4_calculate_overhead+0x370/0x370 [] ext4_mount+0x15/0x20 [] mount_fs+0x38/0x170 Mark the support broken so its disabled by default, but otherwise still available for testing. Cc: Jan Kara Cc: Jens Axboe Cc: Matthew Wilcox Cc: Al Viro Reported-by: Ross Zwisler Suggested-by: Dave Chinner Signed-off-by: Dan Williams Signed-off-by: Ross Zwisler --- block/Kconfig | 13 +++++++++++++ fs/block_dev.c | 6 +++++- 2 files changed, 18 insertions(+), 1 deletion(-) diff --git a/block/Kconfig b/block/Kconfig index 161491d..0363cd7 100644 --- a/block/Kconfig +++ b/block/Kconfig @@ -88,6 +88,19 @@ config BLK_DEV_INTEGRITY T10/SCSI Data Integrity Field or the T13/ATA External Path Protection. If in doubt, say N. +config BLK_DEV_DAX + bool "Block device DAX support" + depends on FS_DAX + depends on BROKEN + help + When DAX support is available (CONFIG_FS_DAX) raw block + devices can also support direct userspace access to the + storage capacity via MMAP(2) similar to a file on a + DAX-enabled filesystem. However, the DAX I/O-path disables + some standard I/O-statistics, and the MMAP(2) path has some + operational differences due to bypassing the page + cache. If in doubt, say N. + config BLK_DEV_THROTTLING bool "Block layer bio throttling support" depends on BLK_CGROUP=y diff --git a/fs/block_dev.c b/fs/block_dev.c index 39b3a17..31c6d10 100644 --- a/fs/block_dev.c +++ b/fs/block_dev.c @@ -1201,7 +1201,11 @@ static int __blkdev_get(struct block_device *bdev, fmode_t mode, int for_part) bdev->bd_disk = disk; bdev->bd_queue = disk->queue; bdev->bd_contains = bdev; - bdev->bd_inode->i_flags = disk->fops->direct_access ? S_DAX : 0; + if (IS_ENABLED(CONFIG_BLK_DEV_DAX) && disk->fops->direct_access) + bdev->bd_inode->i_flags = S_DAX; + else + bdev->bd_inode->i_flags = 0; + if (!partno) { ret = -ENXIO; bdev->bd_part = disk_get_part(disk, partno); -- 2.5.0 From ross.zwisler@linux.intel.com Tue Feb 16 21:34:41 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=ham version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay2.corp.sgi.com [137.38.102.29]) by oss.sgi.com (Postfix) with ESMTP id 250817CAB for ; Tue, 16 Feb 2016 21:34:41 -0600 (CST) Received: from cuda.sgi.com (cuda3.sgi.com [192.48.176.15]) by relay2.corp.sgi.com (Postfix) with ESMTP id 04189304043 for ; Tue, 16 Feb 2016 19:34:40 -0800 (PST) X-ASG-Debug-ID: 1455680074-04cb6c1e581246b0005-NocioJ Received: from mga04.intel.com ([192.55.52.120]) by cuda.sgi.com with ESMTP id bUVIExOFur80kDF7 for ; Tue, 16 Feb 2016 19:34:39 -0800 (PST) X-Barracuda-Envelope-From: ross.zwisler@linux.intel.com X-Barracuda-Apparent-Source-IP: 192.55.52.120 X-ASG-Whitelist: Client Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by fmsmga104.fm.intel.com with ESMTP; 16 Feb 2016 19:34:39 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.22,458,1449561600"; d="scan'208";a="916486852" Received: from rzwisler-desk.amr.corp.intel.com (HELO phyrexia.intel.com) ([10.254.20.43]) by fmsmga002.fm.intel.com with ESMTP; 16 Feb 2016 19:34:39 -0800 From: Ross Zwisler To: linux-kernel@vger.kernel.org Cc: Ross Zwisler , "J. Bruce Fields" , "Theodore Ts'o" , Alexander Viro , Andreas Dilger , Andrew Morton , Dan Williams , Dave Chinner , Jan Kara , Jeff Layton , Jens Axboe , Matthew Wilcox , linux-block@vger.kernel.org, linux-ext4@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux-mm@kvack.org, linux-nvdimm@lists.01.org, xfs@oss.sgi.com Subject: [PATCH v3 4/6] dax: give DAX clearing code correct bdev Date: Tue, 16 Feb 2016 20:34:17 -0700 X-ASG-Orig-Subj: [PATCH v3 4/6] dax: give DAX clearing code correct bdev Message-Id: <1455680059-20126-5-git-send-email-ross.zwisler@linux.intel.com> X-Mailer: git-send-email 2.5.0 In-Reply-To: <1455680059-20126-1-git-send-email-ross.zwisler@linux.intel.com> References: <1455680059-20126-1-git-send-email-ross.zwisler@linux.intel.com> X-Barracuda-Connect: UNKNOWN[192.55.52.120] X-Barracuda-Start-Time: 1455680079 X-Barracuda-URL: https://192.48.176.15:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-BRTS-Status: 1 dax_clear_blocks() needs a valid struct block_device and previously it was using inode->i_sb->s_bdev in all cases. This is correct for normal inodes on mounted ext2, ext4 and XFS filesystems, but is incorrect for DAX raw block devices and for XFS real-time devices. Instead, rename dax_clear_blocks() to dax_clear_sectors(), and change its arguments to take a bdev and a sector instead of an inode and a block. This better reflects what the function does, and it allows the filesystem and raw block device code to pass in an appropriate struct block_device. Signed-off-by: Ross Zwisler Suggested-by: Dan Williams --- fs/dax.c | 9 ++++----- fs/ext2/inode.c | 6 ++++-- fs/xfs/xfs_aops.c | 2 +- fs/xfs/xfs_aops.h | 1 + fs/xfs/xfs_bmap_util.c | 3 ++- include/linux/dax.h | 2 +- 6 files changed, 13 insertions(+), 10 deletions(-) diff --git a/fs/dax.c b/fs/dax.c index fc2e314..9a173dd 100644 --- a/fs/dax.c +++ b/fs/dax.c @@ -79,15 +79,14 @@ struct page *read_dax_sector(struct block_device *bdev, sector_t n) } /* - * dax_clear_blocks() is called from within transaction context from XFS, + * dax_clear_sectors() is called from within transaction context from XFS, * and hence this means the stack from this point must follow GFP_NOFS * semantics for all operations. */ -int dax_clear_blocks(struct inode *inode, sector_t block, long _size) +int dax_clear_sectors(struct block_device *bdev, sector_t _sector, long _size) { - struct block_device *bdev = inode->i_sb->s_bdev; struct blk_dax_ctl dax = { - .sector = block << (inode->i_blkbits - 9), + .sector = _sector, .size = _size, }; @@ -109,7 +108,7 @@ int dax_clear_blocks(struct inode *inode, sector_t block, long _size) wmb_pmem(); return 0; } -EXPORT_SYMBOL_GPL(dax_clear_blocks); +EXPORT_SYMBOL_GPL(dax_clear_sectors); /* the clear_pmem() calls are ordered by a wmb_pmem() in the caller */ static void dax_new_buf(void __pmem *addr, unsigned size, unsigned first, diff --git a/fs/ext2/inode.c b/fs/ext2/inode.c index 27e2cdd..4467cbd 100644 --- a/fs/ext2/inode.c +++ b/fs/ext2/inode.c @@ -737,8 +737,10 @@ static int ext2_get_blocks(struct inode *inode, * so that it's not found by another thread before it's * initialised */ - err = dax_clear_blocks(inode, le32_to_cpu(chain[depth-1].key), - 1 << inode->i_blkbits); + err = dax_clear_sectors(inode->i_sb->s_bdev, + le32_to_cpu(chain[depth-1].key) << + (inode->i_blkbits - 9), + 1 << inode->i_blkbits); if (err) { mutex_unlock(&ei->truncate_mutex); goto cleanup; diff --git a/fs/xfs/xfs_aops.c b/fs/xfs/xfs_aops.c index 379c089..fc20518 100644 --- a/fs/xfs/xfs_aops.c +++ b/fs/xfs/xfs_aops.c @@ -55,7 +55,7 @@ xfs_count_page_state( } while ((bh = bh->b_this_page) != head); } -STATIC struct block_device * +struct block_device * xfs_find_bdev_for_inode( struct inode *inode) { diff --git a/fs/xfs/xfs_aops.h b/fs/xfs/xfs_aops.h index f6ffc9a..a4343c6 100644 --- a/fs/xfs/xfs_aops.h +++ b/fs/xfs/xfs_aops.h @@ -62,5 +62,6 @@ int xfs_get_blocks_dax_fault(struct inode *inode, sector_t offset, struct buffer_head *map_bh, int create); extern void xfs_count_page_state(struct page *, int *, int *); +extern struct block_device *xfs_find_bdev_for_inode(struct inode *); #endif /* __XFS_AOPS_H__ */ diff --git a/fs/xfs/xfs_bmap_util.c b/fs/xfs/xfs_bmap_util.c index 45ec9e4..6c87601 100644 --- a/fs/xfs/xfs_bmap_util.c +++ b/fs/xfs/xfs_bmap_util.c @@ -75,7 +75,8 @@ xfs_zero_extent( ssize_t size = XFS_FSB_TO_B(mp, count_fsb); if (IS_DAX(VFS_I(ip))) - return dax_clear_blocks(VFS_I(ip), block, size); + return dax_clear_sectors(xfs_find_bdev_for_inode(VFS_I(ip)), + sector, size); /* * let the block layer decide on the fastest method of diff --git a/include/linux/dax.h b/include/linux/dax.h index 818e450..7b6bced 100644 --- a/include/linux/dax.h +++ b/include/linux/dax.h @@ -7,7 +7,7 @@ ssize_t dax_do_io(struct kiocb *, struct inode *, struct iov_iter *, loff_t, get_block_t, dio_iodone_t, int flags); -int dax_clear_blocks(struct inode *, sector_t block, long size); +int dax_clear_sectors(struct block_device *bdev, sector_t _sector, long _size); int dax_zero_page_range(struct inode *, loff_t from, unsigned len, get_block_t); int dax_truncate_page(struct inode *, loff_t from, get_block_t); int dax_fault(struct vm_area_struct *, struct vm_fault *, get_block_t, -- 2.5.0 From ross.zwisler@linux.intel.com Tue Feb 16 21:34:42 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=ham version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay2.corp.sgi.com [137.38.102.29]) by oss.sgi.com (Postfix) with ESMTP id 60AFE7CA3 for ; Tue, 16 Feb 2016 21:34:42 -0600 (CST) Received: from cuda.sgi.com (cuda3.sgi.com [192.48.176.15]) by relay2.corp.sgi.com (Postfix) with ESMTP id 4F4D3304048 for ; Tue, 16 Feb 2016 19:34:39 -0800 (PST) X-ASG-Debug-ID: 1455680074-04cb6c1e581246b0004-NocioJ Received: from mga04.intel.com ([192.55.52.120]) by cuda.sgi.com with ESMTP id bUHVKC2HkJJqK1aU for ; Tue, 16 Feb 2016 19:34:38 -0800 (PST) X-Barracuda-Envelope-From: ross.zwisler@linux.intel.com X-Barracuda-Apparent-Source-IP: 192.55.52.120 X-ASG-Whitelist: Client Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by fmsmga104.fm.intel.com with ESMTP; 16 Feb 2016 19:34:38 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.22,458,1449561600"; d="scan'208";a="916486842" Received: from rzwisler-desk.amr.corp.intel.com (HELO phyrexia.intel.com) ([10.254.20.43]) by fmsmga002.fm.intel.com with ESMTP; 16 Feb 2016 19:34:37 -0800 From: Ross Zwisler To: linux-kernel@vger.kernel.org Cc: Ross Zwisler , "J. Bruce Fields" , "Theodore Ts'o" , Alexander Viro , Andreas Dilger , Andrew Morton , Dan Williams , Dave Chinner , Jan Kara , Jeff Layton , Jens Axboe , Matthew Wilcox , linux-block@vger.kernel.org, linux-ext4@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux-mm@kvack.org, linux-nvdimm@lists.01.org, xfs@oss.sgi.com Subject: [PATCH v3 3/6] ext4: Online defrag not supported with DAX Date: Tue, 16 Feb 2016 20:34:16 -0700 X-ASG-Orig-Subj: [PATCH v3 3/6] ext4: Online defrag not supported with DAX Message-Id: <1455680059-20126-4-git-send-email-ross.zwisler@linux.intel.com> X-Mailer: git-send-email 2.5.0 In-Reply-To: <1455680059-20126-1-git-send-email-ross.zwisler@linux.intel.com> References: <1455680059-20126-1-git-send-email-ross.zwisler@linux.intel.com> X-Barracuda-Connect: UNKNOWN[192.55.52.120] X-Barracuda-Start-Time: 1455680077 X-Barracuda-URL: https://192.48.176.15:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-BRTS-Status: 1 Online defrag operations for ext4 are hard coded to use the page cache. See ext4_ioctl() -> ext4_move_extents() -> move_extent_per_page() When combined with DAX I/O, which circumvents the page cache, this can result in data corruption. This was observed with xfstests ext4/307 and ext4/308. Fix this by only allowing online defrag for non-DAX files. Signed-off-by: Ross Zwisler --- fs/ext4/ioctl.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/fs/ext4/ioctl.c b/fs/ext4/ioctl.c index 0f6c369..e32c86f 100644 --- a/fs/ext4/ioctl.c +++ b/fs/ext4/ioctl.c @@ -583,6 +583,11 @@ group_extend_out: "Online defrag not supported with bigalloc"); err = -EOPNOTSUPP; goto mext_out; + } else if (IS_DAX(inode)) { + ext4_msg(sb, KERN_ERR, + "Online defrag not supported with DAX"); + err = -EOPNOTSUPP; + goto mext_out; } err = mnt_want_write_file(filp); -- 2.5.0 From ross.zwisler@linux.intel.com Tue Feb 16 21:34:43 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=ham version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay3.corp.sgi.com [198.149.34.15]) by oss.sgi.com (Postfix) with ESMTP id 3336F7CB2 for ; Tue, 16 Feb 2016 21:34:43 -0600 (CST) Received: from cuda.sgi.com (cuda3.sgi.com [192.48.176.15]) by relay3.corp.sgi.com (Postfix) with ESMTP id AA887AC007 for ; Tue, 16 Feb 2016 19:34:42 -0800 (PST) X-ASG-Debug-ID: 1455680074-04cb6c1e581246b0006-NocioJ Received: from mga04.intel.com ([192.55.52.120]) by cuda.sgi.com with ESMTP id gVinSYB2EPvz4W6z for ; Tue, 16 Feb 2016 19:34:41 -0800 (PST) X-Barracuda-Envelope-From: ross.zwisler@linux.intel.com X-Barracuda-Apparent-Source-IP: 192.55.52.120 X-ASG-Whitelist: Client Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by fmsmga104.fm.intel.com with ESMTP; 16 Feb 2016 19:34:40 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.22,458,1449561600"; d="scan'208";a="916486863" Received: from rzwisler-desk.amr.corp.intel.com (HELO phyrexia.intel.com) ([10.254.20.43]) by fmsmga002.fm.intel.com with ESMTP; 16 Feb 2016 19:34:40 -0800 From: Ross Zwisler To: linux-kernel@vger.kernel.org Cc: Ross Zwisler , "J. Bruce Fields" , "Theodore Ts'o" , Alexander Viro , Andreas Dilger , Andrew Morton , Dan Williams , Dave Chinner , Jan Kara , Jeff Layton , Jens Axboe , Matthew Wilcox , linux-block@vger.kernel.org, linux-ext4@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux-mm@kvack.org, linux-nvdimm@lists.01.org, xfs@oss.sgi.com, Jan Kara Subject: [PATCH v3 5/6] dax: move writeback calls into the filesystems Date: Tue, 16 Feb 2016 20:34:18 -0700 X-ASG-Orig-Subj: [PATCH v3 5/6] dax: move writeback calls into the filesystems Message-Id: <1455680059-20126-6-git-send-email-ross.zwisler@linux.intel.com> X-Mailer: git-send-email 2.5.0 In-Reply-To: <1455680059-20126-1-git-send-email-ross.zwisler@linux.intel.com> References: <1455680059-20126-1-git-send-email-ross.zwisler@linux.intel.com> X-Barracuda-Connect: UNKNOWN[192.55.52.120] X-Barracuda-Start-Time: 1455680080 X-Barracuda-URL: https://192.48.176.15:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-BRTS-Status: 1 Previously calls to dax_writeback_mapping_range() for all DAX filesystems (ext2, ext4 & xfs) were centralized in filemap_write_and_wait_range(). dax_writeback_mapping_range() needs a struct block_device, and it used to get that from inode->i_sb->s_bdev. This is correct for normal inodes mounted on ext2, ext4 and XFS filesystems, but is incorrect for DAX raw block devices and for XFS real-time files. Instead, call dax_writeback_mapping_range() directly from the filesystem ->writepages function so that it can supply us with a valid block device. This also fixes DAX code to properly flush caches in response to sync(2). Signed-off-by: Ross Zwisler Signed-off-by: Jan Kara --- fs/block_dev.c | 13 ++++++++++++- fs/dax.c | 12 +++++++----- fs/ext2/inode.c | 8 ++++++++ fs/ext4/inode.c | 4 ++++ fs/xfs/xfs_aops.c | 4 ++++ include/linux/dax.h | 6 ++++-- mm/filemap.c | 12 ++++-------- 7 files changed, 43 insertions(+), 16 deletions(-) diff --git a/fs/block_dev.c b/fs/block_dev.c index 31c6d10..826b164 100644 --- a/fs/block_dev.c +++ b/fs/block_dev.c @@ -1697,13 +1697,24 @@ static int blkdev_releasepage(struct page *page, gfp_t wait) return try_to_free_buffers(page); } +static int blkdev_writepages(struct address_space *mapping, + struct writeback_control *wbc) +{ + if (dax_mapping(mapping)) { + struct block_device *bdev = I_BDEV(mapping->host); + + return dax_writeback_mapping_range(mapping, bdev, wbc); + } + return generic_writepages(mapping, wbc); +} + static const struct address_space_operations def_blk_aops = { .readpage = blkdev_readpage, .readpages = blkdev_readpages, .writepage = blkdev_writepage, .write_begin = blkdev_write_begin, .write_end = blkdev_write_end, - .writepages = generic_writepages, + .writepages = blkdev_writepages, .releasepage = blkdev_releasepage, .direct_IO = blkdev_direct_IO, .is_dirty_writeback = buffer_check_dirty_writeback, diff --git a/fs/dax.c b/fs/dax.c index 9a173dd..7111724 100644 --- a/fs/dax.c +++ b/fs/dax.c @@ -484,11 +484,10 @@ static int dax_writeback_one(struct block_device *bdev, * end]. This is required by data integrity operations to ensure file data is * on persistent storage prior to completion of the operation. */ -int dax_writeback_mapping_range(struct address_space *mapping, loff_t start, - loff_t end) +int dax_writeback_mapping_range(struct address_space *mapping, + struct block_device *bdev, struct writeback_control *wbc) { struct inode *inode = mapping->host; - struct block_device *bdev = inode->i_sb->s_bdev; pgoff_t start_index, end_index, pmd_index; pgoff_t indices[PAGEVEC_SIZE]; struct pagevec pvec; @@ -499,8 +498,11 @@ int dax_writeback_mapping_range(struct address_space *mapping, loff_t start, if (WARN_ON_ONCE(inode->i_blkbits != PAGE_SHIFT)) return -EIO; - start_index = start >> PAGE_CACHE_SHIFT; - end_index = end >> PAGE_CACHE_SHIFT; + if (!mapping->nrexceptional || wbc->sync_mode != WB_SYNC_ALL) + return 0; + + start_index = wbc->range_start >> PAGE_CACHE_SHIFT; + end_index = wbc->range_end >> PAGE_CACHE_SHIFT; pmd_index = DAX_PMD_INDEX(start_index); rcu_read_lock(); diff --git a/fs/ext2/inode.c b/fs/ext2/inode.c index 4467cbd..6bd58e6 100644 --- a/fs/ext2/inode.c +++ b/fs/ext2/inode.c @@ -876,6 +876,14 @@ ext2_direct_IO(struct kiocb *iocb, struct iov_iter *iter, loff_t offset) static int ext2_writepages(struct address_space *mapping, struct writeback_control *wbc) { +#ifdef CONFIG_FS_DAX + if (dax_mapping(mapping)) { + return dax_writeback_mapping_range(mapping, + mapping->host->i_sb->s_bdev, + wbc); + } +#endif + return mpage_writepages(mapping, wbc, ext2_get_block); } diff --git a/fs/ext4/inode.c b/fs/ext4/inode.c index 7088aa5..c2d1b51 100644 --- a/fs/ext4/inode.c +++ b/fs/ext4/inode.c @@ -2450,6 +2450,10 @@ static int ext4_writepages(struct address_space *mapping, trace_ext4_writepages(inode, wbc); + if (dax_mapping(mapping)) + return dax_writeback_mapping_range(mapping, inode->i_sb->s_bdev, + wbc); + /* * No pages to write? This is mainly a kludge to avoid starting * a transaction for special inodes like journal inode on last iput() diff --git a/fs/xfs/xfs_aops.c b/fs/xfs/xfs_aops.c index fc20518..a9ebabfe 100644 --- a/fs/xfs/xfs_aops.c +++ b/fs/xfs/xfs_aops.c @@ -1208,6 +1208,10 @@ xfs_vm_writepages( struct writeback_control *wbc) { xfs_iflags_clear(XFS_I(mapping->host), XFS_ITRUNCATED); + if (dax_mapping(mapping)) + return dax_writeback_mapping_range(mapping, + xfs_find_bdev_for_inode(mapping->host), wbc); + return generic_writepages(mapping, wbc); } diff --git a/include/linux/dax.h b/include/linux/dax.h index 7b6bced..636dd59 100644 --- a/include/linux/dax.h +++ b/include/linux/dax.h @@ -52,6 +52,8 @@ static inline bool dax_mapping(struct address_space *mapping) { return mapping->host && IS_DAX(mapping->host); } -int dax_writeback_mapping_range(struct address_space *mapping, loff_t start, - loff_t end); + +struct writeback_control; +int dax_writeback_mapping_range(struct address_space *mapping, + struct block_device *bdev, struct writeback_control *wbc); #endif diff --git a/mm/filemap.c b/mm/filemap.c index 23edcce..3461d97 100644 --- a/mm/filemap.c +++ b/mm/filemap.c @@ -446,7 +446,8 @@ int filemap_write_and_wait(struct address_space *mapping) { int err = 0; - if (mapping->nrpages) { + if ((!dax_mapping(mapping) && mapping->nrpages) || + (dax_mapping(mapping) && mapping->nrexceptional)) { err = filemap_fdatawrite(mapping); /* * Even if the above returned error, the pages may be @@ -482,13 +483,8 @@ int filemap_write_and_wait_range(struct address_space *mapping, { int err = 0; - if (dax_mapping(mapping) && mapping->nrexceptional) { - err = dax_writeback_mapping_range(mapping, lstart, lend); - if (err) - return err; - } - - if (mapping->nrpages) { + if ((!dax_mapping(mapping) && mapping->nrpages) || + (dax_mapping(mapping) && mapping->nrexceptional)) { err = __filemap_fdatawrite_range(mapping, lstart, lend, WB_SYNC_ALL); /* See comment of filemap_write_and_wait() */ -- 2.5.0 From ross.zwisler@linux.intel.com Tue Feb 16 21:34:43 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=ham version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay1.corp.sgi.com [137.38.102.111]) by oss.sgi.com (Postfix) with ESMTP id C63057CB3 for ; Tue, 16 Feb 2016 21:34:43 -0600 (CST) Received: from cuda.sgi.com (cuda3.sgi.com [192.48.176.15]) by relay1.corp.sgi.com (Postfix) with ESMTP id B42128F8040 for ; Tue, 16 Feb 2016 19:34:43 -0800 (PST) X-ASG-Debug-ID: 1455680074-04cb6c1e581246b0007-NocioJ Received: from mga04.intel.com ([192.55.52.120]) by cuda.sgi.com with ESMTP id shDPwuFYybnfkOup for ; Tue, 16 Feb 2016 19:34:42 -0800 (PST) X-Barracuda-Envelope-From: ross.zwisler@linux.intel.com X-Barracuda-Apparent-Source-IP: 192.55.52.120 X-ASG-Whitelist: Client Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by fmsmga104.fm.intel.com with ESMTP; 16 Feb 2016 19:34:42 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.22,458,1449561600"; d="scan'208";a="916486867" Received: from rzwisler-desk.amr.corp.intel.com (HELO phyrexia.intel.com) ([10.254.20.43]) by fmsmga002.fm.intel.com with ESMTP; 16 Feb 2016 19:34:41 -0800 From: Ross Zwisler To: linux-kernel@vger.kernel.org Cc: Dan Williams , "J. Bruce Fields" , "Theodore Ts'o" , Alexander Viro , Andreas Dilger , Andrew Morton , Dave Chinner , Jan Kara , Jeff Layton , Jens Axboe , Matthew Wilcox , linux-block@vger.kernel.org, linux-ext4@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux-mm@kvack.org, linux-nvdimm@lists.01.org, xfs@oss.sgi.com, Jan Kara , Jens Axboe , Al Viro , Ross Zwisler , Matthew Wilcox Subject: [PATCH v3 6/6] block: use dax_do_io() if blkdev_dax_capable() Date: Tue, 16 Feb 2016 20:34:19 -0700 X-ASG-Orig-Subj: [PATCH v3 6/6] block: use dax_do_io() if blkdev_dax_capable() Message-Id: <1455680059-20126-7-git-send-email-ross.zwisler@linux.intel.com> X-Mailer: git-send-email 2.5.0 In-Reply-To: <1455680059-20126-1-git-send-email-ross.zwisler@linux.intel.com> References: <1455680059-20126-1-git-send-email-ross.zwisler@linux.intel.com> X-Barracuda-Connect: UNKNOWN[192.55.52.120] X-Barracuda-Start-Time: 1455680082 X-Barracuda-URL: https://192.48.176.15:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-BRTS-Status: 1 From: Dan Williams Setting S_DAX on an inode requires that the inode participate in the DAX-fsync mechanism which expects to use the pagecache for tracking potentially dirty cpu cachelines. However, dax_do_io() participates in the standard pagecache sync semantics and arranges for dirty pages to be flushed through the driver when a direct-IO operation accesses the same ranges. It should always be valid to use the dax_do_io() path regardless of whether the block_device inode has S_DAX set. In either case dirty pages or dirty cachelines are made durable before the direct-IO operation proceeds. Cc: Jan Kara Cc: Jens Axboe Cc: Al Viro Cc: Dave Chinner Cc: Ross Zwisler Cc: Matthew Wilcox Signed-off-by: Dan Williams Signed-off-by: Ross Zwisler --- block/ioctl.c | 1 + fs/block_dev.c | 3 ++- include/linux/fs.h | 31 +++++++++++++++++++++---------- 3 files changed, 24 insertions(+), 11 deletions(-) diff --git a/block/ioctl.c b/block/ioctl.c index d8996bb..7c64286 100644 --- a/block/ioctl.c +++ b/block/ioctl.c @@ -434,6 +434,7 @@ bool blkdev_dax_capable(struct block_device *bdev) return true; } +EXPORT_SYMBOL(blkdev_dax_capable); #endif static int blkdev_flushbuf(struct block_device *bdev, fmode_t mode, diff --git a/fs/block_dev.c b/fs/block_dev.c index 826b164..0e937dd 100644 --- a/fs/block_dev.c +++ b/fs/block_dev.c @@ -166,8 +166,9 @@ blkdev_direct_IO(struct kiocb *iocb, struct iov_iter *iter, loff_t offset) { struct file *file = iocb->ki_filp; struct inode *inode = bdev_file_inode(file); + struct block_device *bdev = I_BDEV(inode); - if (IS_DAX(inode)) + if (blkdev_dax_capable(bdev)) return dax_do_io(iocb, inode, iter, offset, blkdev_get_block, NULL, DIO_SKIP_DIO_COUNT); return __blockdev_direct_IO(iocb, inode, I_BDEV(inode), iter, offset, diff --git a/include/linux/fs.h b/include/linux/fs.h index ae68100..a3f5ee8 100644 --- a/include/linux/fs.h +++ b/include/linux/fs.h @@ -830,7 +830,14 @@ static inline unsigned imajor(const struct inode *inode) return MAJOR(inode->i_rdev); } +#ifdef CONFIG_BLOCK extern struct block_device *I_BDEV(struct inode *inode); +#else +static inline struct block_device *I_BDEV(struct inode *inode) +{ + return NULL; +} +#endif struct fown_struct { rwlock_t lock; /* protects pid, uid, euid fields */ @@ -2306,15 +2313,6 @@ extern struct super_block *freeze_bdev(struct block_device *); extern void emergency_thaw_all(void); extern int thaw_bdev(struct block_device *bdev, struct super_block *sb); extern int fsync_bdev(struct block_device *); -#ifdef CONFIG_FS_DAX -extern bool blkdev_dax_capable(struct block_device *bdev); -#else -static inline bool blkdev_dax_capable(struct block_device *bdev) -{ - return false; -} -#endif - extern struct super_block *blockdev_superblock; static inline bool sb_is_blkdev_sb(struct super_block *sb) @@ -2902,9 +2900,22 @@ extern int generic_show_options(struct seq_file *m, struct dentry *root); extern void save_mount_options(struct super_block *sb, char *options); extern void replace_mount_options(struct super_block *sb, char *options); +#ifdef CONFIG_FS_DAX +extern bool blkdev_dax_capable(struct block_device *bdev); +#else +static inline bool blkdev_dax_capable(struct block_device *bdev) +{ + return false; +} +#endif + static inline bool io_is_direct(struct file *filp) { - return (filp->f_flags & O_DIRECT) || IS_DAX(filp->f_mapping->host); + struct inode *inode = filp->f_mapping->host; + + return (filp->f_flags & O_DIRECT) || IS_DAX(inode) + || (S_ISBLK(file_inode(filp)->i_mode) + && blkdev_dax_capable(I_BDEV(inode))); } static inline int iocb_flags(struct file *file) -- 2.5.0 From sandeen@sandeen.net Tue Feb 16 22:29:30 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=ham version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay2.corp.sgi.com [137.38.102.29]) by oss.sgi.com (Postfix) with ESMTP id 530527CA2 for ; Tue, 16 Feb 2016 22:29:30 -0600 (CST) Received: from cuda.sgi.com (cuda1.sgi.com [192.48.157.11]) by relay2.corp.sgi.com (Postfix) with ESMTP id 207BC304043 for ; Tue, 16 Feb 2016 20:29:29 -0800 (PST) X-ASG-Debug-ID: 1455683363-04bdf02d5c5de80001-NocioJ Received: from sandeen.net (sandeen.net [63.231.237.45]) by cuda.sgi.com with ESMTP id X9RUy0sm5UKdCkrx for ; Tue, 16 Feb 2016 20:29:23 -0800 (PST) X-Barracuda-Envelope-From: sandeen@sandeen.net X-Barracuda-Apparent-Source-IP: 63.231.237.45 Received: from liberator.sandeen.net (liberator.sandeen.net [10.0.0.4]) (using TLSv1.2 with cipher DHE-RSA-AES128-SHA (128/128 bits)) (No client certificate requested) by sandeen.net (Postfix) with ESMTPSA id D84C463C3D46 for ; Tue, 16 Feb 2016 22:29:22 -0600 (CST) Subject: [PATCH 2/3 V2] xfs: sanitize remount options To: xfs@oss.sgi.com X-ASG-Orig-Subj: [PATCH 2/3 V2] xfs: sanitize remount options References: <56BBC982.50804@redhat.com> <56BBCA55.3000506@sandeen.net> From: Eric Sandeen Message-ID: <56C3F721.8080705@sandeen.net> Date: Tue, 16 Feb 2016 22:29:21 -0600 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.11; rv:38.0) Gecko/20100101 Thunderbird/38.5.1 MIME-Version: 1.0 In-Reply-To: <56BBCA55.3000506@sandeen.net> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit X-Barracuda-Connect: sandeen.net[63.231.237.45] X-Barracuda-Start-Time: 1455683363 X-Barracuda-URL: https://192.48.157.11:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-BRTS-Status: 1 X-Barracuda-Spam-Score: 0.00 X-Barracuda-Spam-Status: No, SCORE=0.00 using per-user scores of TAG_LEVEL=1000.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.7 tests= X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.3.27093 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- Perform basic sanitization of remount options by passing the option string and a dummy mount structure through xfs_parseargs and returning the result. Signed-off-by: Eric Sandeen Reviewed-by: Brian Foster --- V2: make *sb const in xfs_parseargs, with comment about why rename tmp->tmp_mp diff --git a/fs/xfs/xfs_super.c b/fs/xfs/xfs_super.c index 9b2e268..fe4c14e 100644 --- a/fs/xfs/xfs_super.c +++ b/fs/xfs/xfs_super.c @@ -169,13 +169,17 @@ suffix_kstrtoint(const substring_t *s, unsigned int base, int *res) * * Note that this function leaks the various device name allocations on * failure. The caller takes care of them. + * + * *sb is const because this is also used to test options on the remount + * path, and we don't want this to have any side effects at remount time. + * Today this function does not change *sb, but just to future-proof... */ STATIC int xfs_parseargs( struct xfs_mount *mp, char *options) { - struct super_block *sb = mp->m_super; + const struct super_block *sb = mp->m_super; char *p; substring_t args[MAX_OPT_ARGS]; int dsunit = 0; @@ -1167,6 +1171,27 @@ xfs_quiesce_attr( } STATIC int +xfs_test_remount_options( + struct super_block *sb, + struct xfs_mount *mp, + char *options) +{ + int error = 0; + struct xfs_mount *tmp_mp; + + tmp_mp = kmem_zalloc(sizeof(*tmp_mp), KM_MAYFAIL); + if (!tmp_mp) + return -ENOMEM; + + tmp_mp->m_super = sb; + error = xfs_parseargs(tmp_mp, options); + xfs_free_fsname(tmp_mp); + kfree(tmp_mp); + + return error; +} + +STATIC int xfs_fs_remount( struct super_block *sb, int *flags, @@ -1178,6 +1203,11 @@ xfs_fs_remount( char *p; int error; + /* First, check for complete junk; i.e. invalid options */ + error = xfs_test_remount_options(sb, mp, options); + if (error) + return error; + sync_filesystem(sb); while ((p = strsep(&options, ",")) != NULL) { int token; From sandeen@sandeen.net Tue Feb 16 22:40:36 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=ham version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay1.corp.sgi.com [137.38.102.111]) by oss.sgi.com (Postfix) with ESMTP id 134AA7CA2 for ; Tue, 16 Feb 2016 22:40:36 -0600 (CST) Received: from cuda.sgi.com (cuda1.sgi.com [192.48.157.11]) by relay1.corp.sgi.com (Postfix) with ESMTP id C98F48F8033 for ; Tue, 16 Feb 2016 20:40:29 -0800 (PST) X-ASG-Debug-ID: 1455684025-04bdf02d5e5e570001-NocioJ Received: from sandeen.net (sandeen.net [63.231.237.45]) by cuda.sgi.com with ESMTP id sbwzmoESpDYvdsCU for ; Tue, 16 Feb 2016 20:40:25 -0800 (PST) X-Barracuda-Envelope-From: sandeen@sandeen.net X-Barracuda-Apparent-Source-IP: 63.231.237.45 Received: from liberator.sandeen.net (liberator.sandeen.net [10.0.0.4]) (using TLSv1.2 with cipher DHE-RSA-AES128-SHA (128/128 bits)) (No client certificate requested) by sandeen.net (Postfix) with ESMTPSA id 7131863C3D46 for ; Tue, 16 Feb 2016 22:40:25 -0600 (CST) Resent-From: Eric Sandeen Resent-To: xfs@oss.sgi.com Resent-Date: Tue, 16 Feb 2016 22:40:24 -0600 Resent-Message-ID: <56C3F9B8.8070105@sandeen.net> Resent-User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.11; rv:38.0) Gecko/20100101 Thunderbird/38.5.1 X-Original-To: sandeen@sandeen.net Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by sandeen.net (Postfix) with ESMTP id 8A95863C5B54 for ; Thu, 11 Feb 2016 17:43:11 -0600 (CST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752058AbcBKXm6 (ORCPT ); Thu, 11 Feb 2016 18:42:58 -0500 Received: from sandeen.net ([63.231.237.45]:55074 "EHLO sandeen.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751928AbcBKXm5 (ORCPT ); Thu, 11 Feb 2016 18:42:57 -0500 Received: from Liberator.local (70-90-76-85-BusName-mn.hfc.comcastbusiness.net [70.90.76.85]) (using TLSv1.2 with cipher DHE-RSA-AES128-SHA (128/128 bits)) (No client certificate requested) by sandeen.net (Postfix) with ESMTPSA id 9519263C5B53 for ; Thu, 11 Feb 2016 17:42:56 -0600 (CST) To: fstests From: Eric Sandeen Subject: [PATCH] xfs: test inode32/inode64 options w/ remount & growfs X-Enigmail-Draft-Status: N1110 X-ASG-Orig-Subj: [PATCH] xfs: test inode32/inode64 options w/ remount & growfs Message-ID: <56BD1C80.8090302@sandeen.net> Date: Thu, 11 Feb 2016 17:42:56 -0600 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.11; rv:38.0) Gecko/20100101 Thunderbird/38.5.1 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Sender: fstests-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: fstests@vger.kernel.org X-Barracuda-Connect: sandeen.net[63.231.237.45] X-Barracuda-Start-Time: 1455684025 X-Barracuda-URL: https://192.48.157.11:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-BRTS-Status: 1 X-Barracuda-Spam-Score: 0.00 X-Barracuda-Spam-Status: No, SCORE=0.00 using per-user scores of TAG_LEVEL=1000.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.7 tests=BSF_SC0_MISMATCH_TO X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.3.27093 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 0.00 BSF_SC0_MISMATCH_TO Envelope rcpt doesn't match header inode32/inode64 allocator behavior with respect to mount, remount and growfs is a little tricky. The inode32 mount option should only enable the inode32 allocator heuristics if the filesystem is large enough for 64-bit inodes to exist. Today, it has this behavior on the initial mount, but a remount with inode32 unconditionally changes the allocation heuristics, even for a small fs. Also, an inode32 mounted small filesystem should transition to the inode32 allocator if the filesystem is subsequently grown to a sufficient size. Today that does not happen. This test tests both of these behaviors and demonstrates the problem. Signed-off-by: Eric Sandeen --- right now the golden output is the actual AGs for file data allocation; I'm not sure if that's too "tight" an output or not - the rotor *does* have well-defined behavior, so I think it's ok. diff --git a/tests/xfs/260 b/tests/xfs/260 new file mode 100755 index 0000000..a5e2324 --- /dev/null +++ b/tests/xfs/260 @@ -0,0 +1,135 @@ +#! /bin/bash +# FS QA Test 260 +# +# Test inode32/inode64 mount/remount options, with growfs +# +#----------------------------------------------------------------------- +# Copyright (c) 2016 Red Hat, Inc. All Rights Reserved. +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License as +# published by the Free Software Foundation. +# +# This program is distributed in the hope that it would be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write the Free Software Foundation, +# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA +#----------------------------------------------------------------------- +# + +seq=`basename $0` +seqres=$RESULT_DIR/$seq +echo "QA output created by $seq" + +here=`pwd` +tmp=/tmp/$$ +status=1 # failure is the default! +trap "_cleanup; exit \$status" 0 1 2 3 15 + +_cleanup() +{ + cd / + rm -f $tmp.* +} + +# get standard environment, filters and checks +. ./common/rc +. ./common/filter + +# remove previous $seqres.full before test +rm -f $seqres.full + +# real QA test starts here + +# Modify as appropriate. +_supported_fs xfs +_supported_os Linux +_require_test +_require_loop + +loopfile=$TEST_DIR/testfile +loopmnt=$TEST_DIR/mnt + +mkdir -p $loopmnt + +# Takes file path as argument +create_and_map() +{ + echo foo > $1 + xfs_bmap -v $1 | grep -v "EXT\|file" | awk '{print $4}' +} + +# Test proper inode32/inode64 behavior for initial mount and remount. +# mount, remount, remount +# +# Args: size, initial opt, first remount, 2nd remount +# i.e.: 512g inode32 inode64 inode32 +# or: 4t inode64 inode32 inode64 +workout_remount() +{ + echo "Remount: $1, $2, $3, $4" + + rm -f $loopfile + xfs_io -f -c "truncate $1" $loopfile + $MKFS_XFS_PROG $loopfile >> $seqres.full 2>&1 + + echo "mount $2" + mount -t xfs -o loop,$2 $loopfile $loopmnt + for I in `seq 1 4`; do create_and_map $loopmnt/file$I; done + + echo "remount $3" + mount -o remount,$3 $loopmnt + for I in `seq 5 8`; do create_and_map $loopmnt/file$I; done + + echo "remount $4" + mount -o remount,$4 $loopmnt + for I in `seq 9 12`; do create_and_map $loopmnt/file$I; done + + umount $loopmnt +} + +# Test proper inode32/inode64 across a growfs +# Mount, grow, remount +# +# Args: size1, size2, mount opt, remount opt +# i.e.: 512g 1t inode32 inode64 + +workout_growfs() +{ + echo "Growfs: $1, $2, $3, $4" + + rm -f $loopfile + xfs_io -f -c "truncate $2" $loopfile + $MKFS_XFS_PROG -d size=$1 $loopfile >> $seqres.full 2>&1 + + echo "$1, mount $3" + mount -t xfs -o loop,$3 $loopfile $loopmnt + for I in `seq 1 4`; do create_and_map $loopmnt/file$I; done + + echo "growfs $1 to $2" + $XFS_GROWFS_PROG $loopmnt >> $seqres.full 2>&1 + for I in `seq 5 12`; do create_and_map $loopmnt/file$I; done + + # Do more than 4 files here to try to hit new AGs + echo "$2, remount $4" + mount -o remount,$4 $loopmnt + for I in `seq 13 20`; do create_and_map $loopmnt/file$I; done + + umount $loopmnt +} + +workout_remount 128g inode64 inode32 inode64 +workout_remount 128g inode32 inode64 inode32 +workout_remount 4t inode64 inode32 inode64 +workout_remount 4t inode32 inode64 inode32 + +workout_growfs 1t 4t inode32 inode64 +workout_growfs 1t 4t inode64 inode32 + +# success, all done +status=0 +exit diff --git a/tests/xfs/260.out b/tests/xfs/260.out new file mode 100644 index 0000000..4bdf2f0 --- /dev/null +++ b/tests/xfs/260.out @@ -0,0 +1,113 @@ +QA output created by 260 +Remount: 128g, inode64, inode32, inode64 +mount inode64 +0 +0 +0 +0 +remount inode32 +0 +0 +0 +0 +remount inode64 +0 +0 +0 +0 +Remount: 128g, inode32, inode64, inode32 +mount inode32 +0 +0 +0 +0 +remount inode64 +0 +0 +0 +0 +remount inode32 +0 +0 +0 +0 +Remount: 4t, inode64, inode32, inode64 +mount inode64 +0 +0 +0 +0 +remount inode32 +1 +2 +3 +1 +remount inode64 +0 +0 +0 +0 +Remount: 4t, inode32, inode64, inode32 +mount inode32 +1 +2 +3 +1 +remount inode64 +0 +0 +0 +0 +remount inode32 +2 +3 +1 +2 +Growfs: 1t, 4t, inode32, inode64 +1t, mount inode32 +0 +0 +0 +0 +growfs 1t to 4t +1 +2 +3 +4 +5 +6 +7 +8 +4t, remount inode64 +0 +0 +0 +0 +0 +0 +0 +0 +Growfs: 1t, 4t, inode64, inode32 +1t, mount inode64 +0 +0 +0 +0 +growfs 1t to 4t +0 +0 +0 +0 +0 +0 +0 +0 +4t, remount inode32 +1 +2 +3 +4 +5 +6 +7 +8 diff --git a/tests/xfs/group b/tests/xfs/group index 2db3520..ce0c69d 100644 --- a/tests/xfs/group +++ b/tests/xfs/group @@ -207,6 +207,7 @@ 252 auto quick prealloc 253 auto quick 259 auto quick +260 auto growfs 261 auto quick quota 262 auto quick quota 266 dump ioctl auto quick -- To unsubscribe from this list: send the line "unsubscribe fstests" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html From sandeen@redhat.com Tue Feb 16 22:47:53 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=ham version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay1.corp.sgi.com [137.38.102.111]) by oss.sgi.com (Postfix) with ESMTP id 9ECDD7CA2 for ; Tue, 16 Feb 2016 22:47:53 -0600 (CST) Received: from cuda.sgi.com (cuda2.sgi.com [192.48.176.25]) by relay1.corp.sgi.com (Postfix) with ESMTP id 8C2BD8F8033 for ; Tue, 16 Feb 2016 20:47:53 -0800 (PST) X-ASG-Debug-ID: 1455684471-04cbb043321458d0001-NocioJ Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by cuda.sgi.com with ESMTP id P2dkw7FyaqCRNxo4 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO) for ; Tue, 16 Feb 2016 20:47:52 -0800 (PST) X-Barracuda-Envelope-From: sandeen@redhat.com X-Barracuda-Apparent-Source-IP: 209.132.183.28 X-ASG-Whitelist: Client Received: from int-mx14.intmail.prod.int.phx2.redhat.com (int-mx14.intmail.prod.int.phx2.redhat.com [10.5.11.27]) by mx1.redhat.com (Postfix) with ESMTPS id 355C9C075655 for ; Wed, 17 Feb 2016 04:47:51 +0000 (UTC) Received: from liberator.sandeen.net (ovpn01.gateway.prod.ext.phx2.redhat.com [10.5.9.1]) by int-mx14.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id u1H4looG032539 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Tue, 16 Feb 2016 23:47:50 -0500 To: xfs@oss.sgi.com From: Eric Sandeen Subject: [PATCH] xfs: fix up inode32/64 (re)mount handling X-Enigmail-Draft-Status: N1110 X-ASG-Orig-Subj: [PATCH] xfs: fix up inode32/64 (re)mount handling Message-ID: <56C3FB75.6030104@redhat.com> Date: Tue, 16 Feb 2016 22:47:49 -0600 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.11; rv:38.0) Gecko/20100101 Thunderbird/38.5.1 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-Scanned-By: MIMEDefang 2.68 on 10.5.11.27 X-Barracuda-Connect: mx1.redhat.com[209.132.183.28] X-Barracuda-Start-Time: 1455684471 X-Barracuda-Encrypted: ECDHE-RSA-AES256-GCM-SHA384 X-Barracuda-URL: https://192.48.176.25:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-BRTS-Status: 1 inode32/inode64 allocator behavior with respect to mount, remount and growfs is a little tricky. The inode32 mount option should only enable the inode32 allocator heuristics if the filesystem is large enough for 64-bit inodes to exist. Today, it has this behavior on the initial mount, but a remount with inode32 unconditionally changes the allocation heuristics, even for a small fs. Also, an inode32 mounted small filesystem should transition to the inode32 allocator if the filesystem is subsequently grown to a sufficient size. Today that does not happen. This patch consolidates xfs_set_inode32 and xfs_set_inode64 into a single new function, and moves the "is the maximum inode number big enough to matter" test into that function, so it doesn't rely on the caller to get it right - which remount did not do, previously. Signed-off-by: Eric Sandeen --- Note, this goes after my token-parsing patch for mount. diff --git a/fs/xfs/xfs_mount.c b/fs/xfs/xfs_mount.c index f8c4a50..83c2f92 100644 --- a/fs/xfs/xfs_mount.c +++ b/fs/xfs/xfs_mount.c @@ -185,9 +185,6 @@ xfs_initialize_perag( xfs_agnumber_t index; xfs_agnumber_t first_initialised = 0; xfs_perag_t *pag; - xfs_agino_t agino; - xfs_ino_t ino; - xfs_sb_t *sbp = &mp->m_sb; int error = -ENOMEM; /* @@ -230,22 +227,7 @@ xfs_initialize_perag( radix_tree_preload_end(); } - /* - * If we mount with the inode64 option, or no inode overflows - * the legacy 32-bit address space clear the inode32 option. - */ - agino = XFS_OFFBNO_TO_AGINO(mp, sbp->sb_agblocks - 1, 0); - ino = XFS_AGINO_TO_INO(mp, agcount - 1, agino); - - if ((mp->m_flags & XFS_MOUNT_SMALL_INUMS) && ino > XFS_MAXINUMBER_32) - mp->m_flags |= XFS_MOUNT_32BITINODES; - else - mp->m_flags &= ~XFS_MOUNT_32BITINODES; - - if (mp->m_flags & XFS_MOUNT_32BITINODES) - index = xfs_set_inode32(mp, agcount); - else - index = xfs_set_inode64(mp, agcount); + index = xfs_set_inode_alloc(mp, agcount); if (maxagi) *maxagi = index; diff --git a/fs/xfs/xfs_mount.h b/fs/xfs/xfs_mount.h index 2c38bef..40acf8f 100644 --- a/fs/xfs/xfs_mount.h +++ b/fs/xfs/xfs_mount.h @@ -205,9 +205,8 @@ typedef struct xfs_mount { #define XFS_MOUNT_GRPID (1ULL << 9) /* group-ID assigned from directory */ #define XFS_MOUNT_NORECOVERY (1ULL << 10) /* no recovery - dirty fs */ #define XFS_MOUNT_DFLT_IOSIZE (1ULL << 12) /* set default i/o size */ -#define XFS_MOUNT_32BITINODES (1ULL << 14) /* do not create inodes above - * 32 bits in size */ -#define XFS_MOUNT_SMALL_INUMS (1ULL << 15) /* users wants 32bit inodes */ +#define XFS_MOUNT_SMALL_INUMS (1ULL << 14) /* user wants 32bit inodes */ +#define XFS_MOUNT_32BITINODES (1ULL << 15) /* inode32 allocator active */ #define XFS_MOUNT_NOUUID (1ULL << 16) /* ignore uuid during mount */ #define XFS_MOUNT_BARRIER (1ULL << 17) #define XFS_MOUNT_IKEEP (1ULL << 18) /* keep empty inode clusters*/ diff --git a/fs/xfs/xfs_super.c b/fs/xfs/xfs_super.c index fe4c14e..044b416 100644 --- a/fs/xfs/xfs_super.c +++ b/fs/xfs/xfs_super.c @@ -577,23 +577,35 @@ xfs_max_file_offset( } /* - * xfs_set_inode32() and xfs_set_inode64() are passed an agcount - * because in the growfs case, mp->m_sb.sb_agcount is not updated - * yet to the potentially higher ag count. + * Set parameters for inode allocation heuristics, taking into account + * filesystem size and inode32/inode64 mount options; i.e. specifically + * whether or not XFS_MOUNT_SMALL_INUMS is set. + * + * Inode allocation patterns are altered only if inode32 is requested + * (XFS_MOUNT_SMALL_INUMS), and the filesystem is sufficiently large. + * If altered, XFS_MOUNT_32BITINODES is set as well. + * + * An agcount independent of that in the mount structure is provided + * because in the growfs case, mp->m_sb.sb_agcount is not yet updated + * to the potentially higher ag count. + * + * Returns the maximum AG index which may contain inodes. */ xfs_agnumber_t -xfs_set_inode32(struct xfs_mount *mp, xfs_agnumber_t agcount) +xfs_set_inode_alloc( + struct xfs_mount *mp, + xfs_agnumber_t agcount) { - xfs_agnumber_t index = 0; + xfs_agnumber_t index; xfs_agnumber_t maxagi = 0; xfs_sb_t *sbp = &mp->m_sb; xfs_agnumber_t max_metadata; xfs_agino_t agino; xfs_ino_t ino; - xfs_perag_t *pag; - /* Calculate how much should be reserved for inodes to meet - * the max inode percentage. + /* + * Calculate how much should be reserved for inodes to meet + * the max inode percentage. Used only for inode32. */ if (mp->m_maxicount) { __uint64_t icount; @@ -607,54 +619,48 @@ xfs_set_inode32(struct xfs_mount *mp, xfs_agnumber_t agcount) max_metadata = agcount; } + /* Get the last possible inode in the filesystem */ agino = XFS_OFFBNO_TO_AGINO(mp, sbp->sb_agblocks - 1, 0); + ino = XFS_AGINO_TO_INO(mp, agcount - 1, agino); + + /* + * If user asked for no more than 32-bit inodes, and the fs is + * sufficiently large, set XFS_MOUNT_32BITINODES if we must alter + * the allocator to accommodate the request. + */ + if ((mp->m_flags & XFS_MOUNT_SMALL_INUMS) && ino > XFS_MAXINUMBER_32) + mp->m_flags |= XFS_MOUNT_32BITINODES; + else + mp->m_flags &= ~XFS_MOUNT_32BITINODES; for (index = 0; index < agcount; index++) { - ino = XFS_AGINO_TO_INO(mp, index, agino); + struct xfs_perag *pag; - if (ino > XFS_MAXINUMBER_32) { - pag = xfs_perag_get(mp, index); - pag->pagi_inodeok = 0; - pag->pagf_metadata = 0; - xfs_perag_put(pag); - continue; - } + ino = XFS_AGINO_TO_INO(mp, index, agino); pag = xfs_perag_get(mp, index); - pag->pagi_inodeok = 1; - maxagi++; - if (index < max_metadata) - pag->pagf_metadata = 1; - xfs_perag_put(pag); - } - mp->m_flags |= (XFS_MOUNT_32BITINODES | - XFS_MOUNT_SMALL_INUMS); - return maxagi; -} - -xfs_agnumber_t -xfs_set_inode64(struct xfs_mount *mp, xfs_agnumber_t agcount) -{ - xfs_agnumber_t index = 0; - - for (index = 0; index < agcount; index++) { - struct xfs_perag *pag; + if (mp->m_flags & XFS_MOUNT_32BITINODES) { + if (ino > XFS_MAXINUMBER_32) { + pag->pagi_inodeok = 0; + pag->pagf_metadata = 0; + } else { + pag->pagi_inodeok = 1; + maxagi++; + if (index < max_metadata) + pag->pagf_metadata = 1; + else + pag->pagf_metadata = 0; + } + } else { + pag->pagi_inodeok = 1; + pag->pagf_metadata = 0; + } - pag = xfs_perag_get(mp, index); - pag->pagi_inodeok = 1; - pag->pagf_metadata = 0; xfs_perag_put(pag); } - /* There is no need for lock protection on m_flags, - * the rw_semaphore of the VFS superblock is locked - * during mount/umount/remount operations, so this is - * enough to avoid concurency on the m_flags field - */ - mp->m_flags &= ~(XFS_MOUNT_32BITINODES | - XFS_MOUNT_SMALL_INUMS); - return index; + return (mp->m_flags & XFS_MOUNT_32BITINODES) ? maxagi : agcount; } STATIC int @@ -1224,10 +1230,12 @@ xfs_fs_remount( mp->m_flags &= ~XFS_MOUNT_BARRIER; break; case Opt_inode64: - mp->m_maxagi = xfs_set_inode64(mp, sbp->sb_agcount); + mp->m_flags &= ~XFS_MOUNT_SMALL_INUMS; + mp->m_maxagi = xfs_set_inode_alloc(mp, sbp->sb_agcount); break; case Opt_inode32: - mp->m_maxagi = xfs_set_inode32(mp, sbp->sb_agcount); + mp->m_flags |= XFS_MOUNT_SMALL_INUMS; + mp->m_maxagi = xfs_set_inode_alloc(mp, sbp->sb_agcount); break; default: /* diff --git a/fs/xfs/xfs_super.h b/fs/xfs/xfs_super.h index 499058f..2dfb1ce 100644 --- a/fs/xfs/xfs_super.h +++ b/fs/xfs/xfs_super.h @@ -65,8 +65,8 @@ extern __uint64_t xfs_max_file_offset(unsigned int); extern void xfs_flush_inodes(struct xfs_mount *mp); extern void xfs_blkdev_issue_flush(struct xfs_buftarg *); -extern xfs_agnumber_t xfs_set_inode32(struct xfs_mount *, xfs_agnumber_t agcount); -extern xfs_agnumber_t xfs_set_inode64(struct xfs_mount *, xfs_agnumber_t agcount); +extern xfs_agnumber_t xfs_set_inode_alloc(struct xfs_mount *, + xfs_agnumber_t agcount); extern const struct export_operations xfs_export_operations; extern const struct xattr_handler *xfs_xattr_handlers[]; From david@fromorbit.com Wed Feb 17 00:24:36 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=ham version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay1.corp.sgi.com [137.38.102.111]) by oss.sgi.com (Postfix) with ESMTP id 45F677CA2 for ; Wed, 17 Feb 2016 00:24:36 -0600 (CST) Received: from cuda.sgi.com (cuda3.sgi.com [192.48.176.15]) by relay1.corp.sgi.com (Postfix) with ESMTP id 365538F8035 for ; Tue, 16 Feb 2016 22:24:33 -0800 (PST) X-ASG-Debug-ID: 1455690268-04cb6c1e5812a720001-NocioJ Received: from ipmail05.adl6.internode.on.net (ipmail05.adl6.internode.on.net [150.101.137.143]) by cuda.sgi.com with ESMTP id vBhBqKea52QQBwYl for ; Tue, 16 Feb 2016 22:24:28 -0800 (PST) X-Barracuda-Envelope-From: david@fromorbit.com X-Barracuda-Apparent-Source-IP: 150.101.137.143 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: A2DfBwBhEcRWXJbY03ZegzoiMG2CaKNgAhYBAQEBAQEGgQ+KYyaFIoQIFwKFbgSBPk0BAQEBAQEHRECEbxMcOyQ0BSUDBy2IGZxVnx4YhTKJHYJjC0AYgQ8Fh1WPLoVTh32BZUqMSwKFcYhWghgMgjUoLocpAR4HgRIBAQE Received: from ppp118-211-216-150.lns20.syd4.internode.on.net (HELO dastard) ([118.211.216.150]) by ipmail05.adl6.internode.on.net with ESMTP; 17 Feb 2016 16:53:46 +1030 Received: from dave by dastard with local (Exim 4.80) (envelope-from ) id 1aVvWc-0004fY-8G for xfs@oss.sgi.com; Wed, 17 Feb 2016 17:23:46 +1100 Date: Wed, 17 Feb 2016 17:23:46 +1100 From: Dave Chinner To: xfs@oss.sgi.com Subject: [ANNOUNCE] xfsprogs: v4.5.0-rc1 released Message-ID: <20160217062346.GB19486@dastard> X-ASG-Orig-Subj: [ANNOUNCE] xfsprogs: v4.5.0-rc1 released MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.5.21 (2010-09-15) X-Barracuda-Connect: ipmail05.adl6.internode.on.net[150.101.137.143] X-Barracuda-Start-Time: 1455690268 X-Barracuda-URL: https://192.48.176.15:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-BRTS-Status: 1 X-Barracuda-Spam-Score: 0.00 X-Barracuda-Spam-Status: No, SCORE=0.00 using per-user scores of TAG_LEVEL=1000.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.7 tests= X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.3.27095 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- Hi Folks, The xfsprogs repository at: git://git.kernel.org/pub/scm/fs/xfs/xfsprogs-dev.git has just been updated and tagged as the first 4.5.0 release candidate. This update brings the libxfs/ code in sync with the kernel 4.5-rc2 kernel code. The master branch is now for bug fixes only until release. Development for the 4.6.0 release will shift to the for-next branch at this point. -Dave. The new head of the master branch is commit: 1abecda xfsprogs: Release v4.5.0-rc1 New Commits: Andreas Gruenbacher (1): [22b8a86] xfs: Validate the length of on-disk ACLs Bill O'Donnell (1): [7989643] xfs: per-filesystem stats counter implementation Brian Foster (3): [5769a37] xfs: add missing bmap cancel calls in error paths [f44fbde] xfs: log local to remote symlink conversions correctly on v5 supers [c063b96] xfs: swap leaf buffer into path struct atomically during path shift Dave Chinner (9): [83f4b5a] xfs_fs.h: XFS_IOC_FS[SG]SETXATTR to FS_IOC_FS[SG]ETXATTR promotion [a0363e2] xfs: introduce per-inode DAX enablement [7093f63] xfs_io: add support for changing the new inode DAX attribute [9542ae1] xfs: introduce BMAPI_ZERO for allocating zeroed extents [f07ae2a] xfs: bmapbt checking on debug kernels too expensive [736e1cf] xfs: inode recovery readahead can race with inode buffer creation [6daba42] xfs: handle dquot buffer readahead in log recovery correctly [7ebb764] xfs: stop holding ILOCK over filldir callbacks [1abecda] xfsprogs: Release v4.5.0-rc1 Eric Sandeen (2): [65ca380] xfs: get mp from bma->ip in xfs_bmap code [0b66d45] xfs: eliminate committed arg from xfs_bmap_finish Geliang Tang (1): [eab16f4] libxfs: fix two comment typos Jia He (1): [c5c9f53] libxfs: Optimize the loop for xfs_bitmap_empty Code Diffstat: VERSION | 4 +- configure.ac | 2 +- doc/CHANGES | 19 ++++++ fsr/xfs_fsr.c | 16 ++--- include/darwin.h | 35 +++++++++++ include/freebsd.h | 35 +++++++++++ include/irix.h | 38 +++++++++++- include/libxfs.h | 2 - include/linux.h | 39 ++++++++++++ io/attr.c | 45 +++++++------- io/bmap.c | 16 ++--- io/open.c | 32 +++++----- libxcmd/projects.c | 8 +-- libxfs/libxfs_api_defs.h | 1 + libxfs/libxfs_io.h | 2 + libxfs/libxfs_priv.h | 9 ++- libxfs/rdwr.c | 4 +- libxfs/util.c | 52 ++++++++++++---- libxfs/xfs_alloc.c | 18 ++++-- libxfs/xfs_alloc.h | 8 ++- libxfs/xfs_attr.c | 147 ++++++++------------------------------------ libxfs/xfs_attr_remote.c | 31 ++-------- libxfs/xfs_bit.c | 6 +- libxfs/xfs_bmap.c | 86 ++++++++++++++++++-------- libxfs/xfs_bmap.h | 15 ++++- libxfs/xfs_btree.c | 4 +- libxfs/xfs_btree.h | 41 +++++++----- libxfs/xfs_da_btree.c | 23 ++++--- libxfs/xfs_dir2.c | 9 ++- libxfs/xfs_dquot_buf.c | 37 +++++++++-- libxfs/xfs_format.h | 19 ++++-- libxfs/xfs_fs.h | 54 +++++++--------- libxfs/xfs_inode_buf.c | 14 +++-- libxfs/xfs_quota_defs.h | 2 +- libxfs/xfs_shared.h | 1 + libxfs/xfs_symlink_remote.c | 3 + mkfs/proto.c | 14 ++--- quota/free.c | 6 +- quota/project.c | 16 ++--- repair/dinode.c | 4 +- repair/phase6.c | 33 ++++------ rtcp/xfs_rtcp.c | 12 ++-- 42 files changed, 567 insertions(+), 395 deletions(-) -- Dave Chinner david@fromorbit.com From dave@fromorbit.com Wed Feb 17 01:21:15 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=ham version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay3.corp.sgi.com [198.149.34.15]) by oss.sgi.com (Postfix) with ESMTP id 77A127CA2 for ; Wed, 17 Feb 2016 01:21:15 -0600 (CST) Received: from cuda.sgi.com (cuda2.sgi.com [192.48.176.25]) by relay3.corp.sgi.com (Postfix) with ESMTP id F2DA7AC001 for ; Tue, 16 Feb 2016 23:21:14 -0800 (PST) X-ASG-Debug-ID: 1455693671-04cbb0433114c080001-NocioJ Received: from ipmail05.adl6.internode.on.net (ipmail05.adl6.internode.on.net [150.101.137.143]) by cuda.sgi.com with ESMTP id 7Gxh5KxFeuUbRog7 for ; Tue, 16 Feb 2016 23:21:12 -0800 (PST) X-Barracuda-Envelope-From: dave@fromorbit.com X-Barracuda-Apparent-Source-IP: 150.101.137.143 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: A2BOCQBoHsRWXJbY03ZegzqBP6ZgAQEBAQEBBpE6i1NNAQEBAQEBB0RAQRIBg24BBScvMwgYMTkDBxQZiBm7Z4VKigSDbgWXA5xMRI4DghgBC4I1KC6CYYYAAQEB Received: from ppp118-211-216-150.lns20.syd4.internode.on.net (HELO dastard) ([118.211.216.150]) by ipmail05.adl6.internode.on.net with ESMTP; 17 Feb 2016 17:50:55 +1030 Received: from disappointment.disaster.area ([192.168.1.110] helo=disappointment) by dastard with esmtp (Exim 4.80) (envelope-from ) id 1aVwPu-0004lt-NG for xfs@oss.sgi.com; Wed, 17 Feb 2016 18:20:54 +1100 Received: from dave by disappointment with local (Exim 4.86) (envelope-from ) id 1aVwPu-00013t-Lx for xfs@oss.sgi.com; Wed, 17 Feb 2016 18:20:54 +1100 From: Dave Chinner To: xfs@oss.sgi.com Subject: [PATCH 02/15] xfs: handle errors from ->free_blocks in xfs_btree_kill_iroot Date: Wed, 17 Feb 2016 18:20:39 +1100 X-ASG-Orig-Subj: [PATCH 02/15] xfs: handle errors from ->free_blocks in xfs_btree_kill_iroot Message-Id: <1455693652-3899-3-git-send-email-david@fromorbit.com> X-Mailer: git-send-email 2.7.0 In-Reply-To: <1455693652-3899-1-git-send-email-david@fromorbit.com> References: <1455693652-3899-1-git-send-email-david@fromorbit.com> X-Barracuda-Connect: ipmail05.adl6.internode.on.net[150.101.137.143] X-Barracuda-Start-Time: 1455693671 X-Barracuda-URL: https://192.48.176.25:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-BRTS-Status: 1 X-Barracuda-Spam-Score: 0.00 X-Barracuda-Spam-Status: No, SCORE=0.00 using per-user scores of TAG_LEVEL=1000.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.7 tests= X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.3.27096 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- From: Christoph Hellwig Source kernel commit 196328ec973a74ee52cc282824e72c3824dc1cf5 Signed-off-by: Christoph Hellwig Reviewed-by: Brian Foster Signed-off-by: Dave Chinner --- libxfs/xfs_btree.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/libxfs/xfs_btree.c b/libxfs/xfs_btree.c index efcad26..14d8bf3 100644 --- a/libxfs/xfs_btree.c +++ b/libxfs/xfs_btree.c @@ -3209,6 +3209,7 @@ xfs_btree_kill_iroot( int level; int index; int numrecs; + int error; #ifdef DEBUG union xfs_btree_ptr ptr; int i; @@ -3272,8 +3273,6 @@ xfs_btree_kill_iroot( cpp = xfs_btree_ptr_addr(cur, 1, cblock); #ifdef DEBUG for (i = 0; i < numrecs; i++) { - int error; - error = xfs_btree_check_ptr(cur, cpp, i, level - 1); if (error) { XFS_BTREE_TRACE_CURSOR(cur, XBT_ERROR); @@ -3283,7 +3282,11 @@ xfs_btree_kill_iroot( #endif xfs_btree_copy_ptrs(cur, pp, cpp, numrecs); - cur->bc_ops->free_block(cur, cbp); + error = cur->bc_ops->free_block(cur, cbp); + if (error) { + XFS_BTREE_TRACE_CURSOR(cur, XBT_ERROR); + return error; + } XFS_BTREE_STATS_INC(cur, free); cur->bc_bufs[level - 1] = NULL; -- 2.7.0 From dave@fromorbit.com Wed Feb 17 01:21:16 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=ham version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay2.corp.sgi.com [137.38.102.29]) by oss.sgi.com (Postfix) with ESMTP id DAB367CA2 for ; Wed, 17 Feb 2016 01:21:16 -0600 (CST) Received: from cuda.sgi.com (cuda2.sgi.com [192.48.176.25]) by relay2.corp.sgi.com (Postfix) with ESMTP id CC472304032 for ; Tue, 16 Feb 2016 23:21:16 -0800 (PST) X-ASG-Debug-ID: 1455693674-04cbb0433414c090001-NocioJ Received: from ipmail05.adl6.internode.on.net (ipmail05.adl6.internode.on.net [150.101.137.143]) by cuda.sgi.com with ESMTP id r5qhwOkssL3Dye9Z for ; Tue, 16 Feb 2016 23:21:15 -0800 (PST) X-Barracuda-Envelope-From: dave@fromorbit.com X-Barracuda-Apparent-Source-IP: 150.101.137.143 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: A2BOCQBoHsRWXJbY03ZegzqBP6ZgAQEBAQEBBpE6i1NNAQEBAQEBB0RAQRIBg24BBScvMwgYMTkDBxQZiBm7Z4VKigSDbgWHVY8unExEjgOCGAELgjUoLoJhhgABAQE Received: from ppp118-211-216-150.lns20.syd4.internode.on.net (HELO dastard) ([118.211.216.150]) by ipmail05.adl6.internode.on.net with ESMTP; 17 Feb 2016 17:50:55 +1030 Received: from disappointment.disaster.area ([192.168.1.110] helo=disappointment) by dastard with esmtp (Exim 4.80) (envelope-from ) id 1aVwPu-0004lv-O6 for xfs@oss.sgi.com; Wed, 17 Feb 2016 18:20:54 +1100 Received: from dave by disappointment with local (Exim 4.86) (envelope-from ) id 1aVwPu-000143-NG for xfs@oss.sgi.com; Wed, 17 Feb 2016 18:20:54 +1100 From: Dave Chinner To: xfs@oss.sgi.com Subject: [PATCH 04/15] xfs: move buffer invalidation to xfs_btree_free_block Date: Wed, 17 Feb 2016 18:20:41 +1100 X-ASG-Orig-Subj: [PATCH 04/15] xfs: move buffer invalidation to xfs_btree_free_block Message-Id: <1455693652-3899-5-git-send-email-david@fromorbit.com> X-Mailer: git-send-email 2.7.0 In-Reply-To: <1455693652-3899-1-git-send-email-david@fromorbit.com> References: <1455693652-3899-1-git-send-email-david@fromorbit.com> X-Barracuda-Connect: ipmail05.adl6.internode.on.net[150.101.137.143] X-Barracuda-Start-Time: 1455693674 X-Barracuda-URL: https://192.48.176.25:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-BRTS-Status: 1 X-Barracuda-Spam-Score: 0.00 X-Barracuda-Spam-Status: No, SCORE=0.00 using per-user scores of TAG_LEVEL=1000.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.7 tests= X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.3.27096 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- From: Christoph Hellwig Source kernel commit edfd9dd549212a0923c9b5b142275dc88912abfa ... instead of leaving it in the methods. Signed-off-by: Christoph Hellwig Reviewed-by: Brian Foster Signed-off-by: Dave Chinner --- libxfs/xfs_alloc_btree.c | 2 -- libxfs/xfs_bmap_btree.c | 1 - libxfs/xfs_btree.c | 4 +++- libxfs/xfs_ialloc_btree.c | 12 ++---------- 4 files changed, 5 insertions(+), 14 deletions(-) diff --git a/libxfs/xfs_alloc_btree.c b/libxfs/xfs_alloc_btree.c index 6f13572..79d0fb9 100644 --- a/libxfs/xfs_alloc_btree.c +++ b/libxfs/xfs_alloc_btree.c @@ -116,8 +116,6 @@ xfs_allocbt_free_block( xfs_extent_busy_insert(cur->bc_tp, be32_to_cpu(agf->agf_seqno), bno, 1, XFS_EXTENT_BUSY_SKIP_DISCARD); xfs_trans_agbtree_delta(cur->bc_tp, -1); - - xfs_trans_binval(cur->bc_tp, bp); return 0; } diff --git a/libxfs/xfs_bmap_btree.c b/libxfs/xfs_bmap_btree.c index 2ef1836..a63379b 100644 --- a/libxfs/xfs_bmap_btree.c +++ b/libxfs/xfs_bmap_btree.c @@ -528,7 +528,6 @@ xfs_bmbt_free_block( xfs_trans_log_inode(tp, ip, XFS_ILOG_CORE); xfs_trans_mod_dquot_byino(tp, ip, XFS_TRANS_DQ_BCOUNT, -1L); - xfs_trans_binval(tp, bp); return 0; } diff --git a/libxfs/xfs_btree.c b/libxfs/xfs_btree.c index f4a1c67..a736cb5 100644 --- a/libxfs/xfs_btree.c +++ b/libxfs/xfs_btree.c @@ -298,8 +298,10 @@ xfs_btree_free_block( int error; error = cur->bc_ops->free_block(cur, bp); - if (!error) + if (!error) { + xfs_trans_binval(cur->bc_tp, bp); XFS_BTREE_STATS_INC(cur, free); + } return error; } diff --git a/libxfs/xfs_ialloc_btree.c b/libxfs/xfs_ialloc_btree.c index 52939c3..a077635 100644 --- a/libxfs/xfs_ialloc_btree.c +++ b/libxfs/xfs_ialloc_btree.c @@ -124,16 +124,8 @@ xfs_inobt_free_block( struct xfs_btree_cur *cur, struct xfs_buf *bp) { - xfs_fsblock_t fsbno; - int error; - - fsbno = XFS_DADDR_TO_FSB(cur->bc_mp, XFS_BUF_ADDR(bp)); - error = xfs_free_extent(cur->bc_tp, fsbno, 1); - if (error) - return error; - - xfs_trans_binval(cur->bc_tp, bp); - return error; + return xfs_free_extent(cur->bc_tp, + XFS_DADDR_TO_FSB(cur->bc_mp, XFS_BUF_ADDR(bp)), 1); } STATIC int -- 2.7.0 From dave@fromorbit.com Wed Feb 17 01:21:18 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=ham version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay1.corp.sgi.com [137.38.102.111]) by oss.sgi.com (Postfix) with ESMTP id 41D437CA2 for ; Wed, 17 Feb 2016 01:21:18 -0600 (CST) Received: from cuda.sgi.com (cuda2.sgi.com [192.48.176.25]) by relay1.corp.sgi.com (Postfix) with ESMTP id 3243B8F8033 for ; Tue, 16 Feb 2016 23:21:18 -0800 (PST) X-ASG-Debug-ID: 1455693671-04cbb0433114c080003-NocioJ Received: from ipmail05.adl6.internode.on.net (ipmail05.adl6.internode.on.net [150.101.137.143]) by cuda.sgi.com with ESMTP id pOX24DCBEyx8MbH4 for ; Tue, 16 Feb 2016 23:21:16 -0800 (PST) X-Barracuda-Envelope-From: dave@fromorbit.com X-Barracuda-Apparent-Source-IP: 150.101.137.143 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: A2BOCQBoHsRWXJbY03ZUCoM6gT+mYAEBAQEBAQaROotTTQEBAQEBAQdEQEESAYNuAQUnLzMIGDE5AwcUGYgZu2eFSokOdoNuBYdShwiIKZxMjkeCGAELgjUoLgGCYIYAAQEB Received: from ppp118-211-216-150.lns20.syd4.internode.on.net (HELO dastard) ([118.211.216.150]) by ipmail05.adl6.internode.on.net with ESMTP; 17 Feb 2016 17:50:55 +1030 Received: from disappointment.disaster.area ([192.168.1.110] helo=disappointment) by dastard with esmtp (Exim 4.80) (envelope-from ) id 1aVwPu-0004lx-Oq for xfs@oss.sgi.com; Wed, 17 Feb 2016 18:20:54 +1100 Received: from dave by disappointment with local (Exim 4.86) (envelope-from ) id 1aVwPu-00014D-O4 for xfs@oss.sgi.com; Wed, 17 Feb 2016 18:20:54 +1100 From: Dave Chinner To: xfs@oss.sgi.com Subject: [PATCH 06/15] xfs: RT bitmap and summary buffers are not typed Date: Wed, 17 Feb 2016 18:20:43 +1100 X-ASG-Orig-Subj: [PATCH 06/15] xfs: RT bitmap and summary buffers are not typed Message-Id: <1455693652-3899-7-git-send-email-david@fromorbit.com> X-Mailer: git-send-email 2.7.0 In-Reply-To: <1455693652-3899-1-git-send-email-david@fromorbit.com> References: <1455693652-3899-1-git-send-email-david@fromorbit.com> X-Barracuda-Connect: ipmail05.adl6.internode.on.net[150.101.137.143] X-Barracuda-Start-Time: 1455693675 X-Barracuda-URL: https://192.48.176.25:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-BRTS-Status: 1 X-Barracuda-Spam-Score: 0.00 X-Barracuda-Spam-Status: No, SCORE=0.00 using per-user scores of TAG_LEVEL=1000.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.7 tests= X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.3.27096 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- From: Dave Chinner Source kernel commit f67ca6eca89cddd355c83639a90109e245f9d5a7 When logging buffers, we attach a type to them that follows the buffer all the way into the log and is used to identify the buffer contents in log recovery. Both the realtime summary buffers and the bitmap buffers do not have types defined or set, so when we try to log them we see assert failure: XFS: Assertion failed: (bip->bli_flags & XFS_BLI_STALE) || (xfs_blft_from_flags(&bip->__bli_format) > XFS_BLFT_UNKNOWN_BUF && xfs_blft_from_flags(&bip->__bli_format) < XFS_BLFT_MAX_BUF), file: fs/xfs/xfs_buf_item.c, line: 294 Fix this by adding buffer log format types for these buffers, and add identification support into log recovery for them. Only build the log recovery support if CONFIG_XFS_RT=y - we can't get into log recovery for real time filesystems if support is not built into the kernel, and this avoids potential build problems. Signed-off-by: Dave Chinner Tested-by: Ross Zwisler Reviewed-by: Eric Sandeen Signed-off-by: Dave Chinner --- libxfs/xfs_log_format.h | 2 ++ libxfs/xfs_rtbitmap.c | 3 +++ 2 files changed, 5 insertions(+) diff --git a/libxfs/xfs_log_format.h b/libxfs/xfs_log_format.h index db8ceeb..c860345 100644 --- a/libxfs/xfs_log_format.h +++ b/libxfs/xfs_log_format.h @@ -495,6 +495,8 @@ enum xfs_blft { XFS_BLFT_ATTR_LEAF_BUF, XFS_BLFT_ATTR_RMT_BUF, XFS_BLFT_SB_BUF, + XFS_BLFT_RTBITMAP_BUF, + XFS_BLFT_RTSUMMARY_BUF, XFS_BLFT_MAX_BUF = (1 << XFS_BLFT_BITS), }; diff --git a/libxfs/xfs_rtbitmap.c b/libxfs/xfs_rtbitmap.c index 5648ea5..3e61eb2 100644 --- a/libxfs/xfs_rtbitmap.c +++ b/libxfs/xfs_rtbitmap.c @@ -66,6 +66,9 @@ xfs_rtbuf_get( mp->m_bsize, 0, &bp, NULL); if (error) return error; + + xfs_trans_buf_set_type(tp, bp, issum ? XFS_BLFT_RTSUMMARY_BUF + : XFS_BLFT_RTBITMAP_BUF); *bpp = bp; return 0; } -- 2.7.0 From dave@fromorbit.com Wed Feb 17 01:21:18 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=ham version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay1.corp.sgi.com [137.38.102.111]) by oss.sgi.com (Postfix) with ESMTP id B44A17CA2 for ; Wed, 17 Feb 2016 01:21:18 -0600 (CST) Received: from cuda.sgi.com (cuda1.sgi.com [192.48.157.11]) by relay1.corp.sgi.com (Postfix) with ESMTP id 83CA98F8035 for ; Tue, 16 Feb 2016 23:21:18 -0800 (PST) X-ASG-Debug-ID: 1455693670-04bdf02d5c64b50001-NocioJ Received: from ipmail05.adl6.internode.on.net (ipmail05.adl6.internode.on.net [150.101.137.143]) by cuda.sgi.com with ESMTP id CZvLGTsnwjQuAJ7I for ; Tue, 16 Feb 2016 23:21:10 -0800 (PST) X-Barracuda-Envelope-From: dave@fromorbit.com X-Barracuda-Apparent-Source-IP: 150.101.137.143 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: A2BOCQBoHsRWXJbY03ZegzqBP6ZgAQEBAQEBBpE6i1NNAQEBAQEBB0RAQRIBg24BBVYzCBgxOQMHFBmIGbtnhUqJBhdng24Fh1ePLJxMRI4DghgBC4I1KC6CYYRHAR+BGQEBAQ Received: from ppp118-211-216-150.lns20.syd4.internode.on.net (HELO dastard) ([118.211.216.150]) by ipmail05.adl6.internode.on.net with ESMTP; 17 Feb 2016 17:50:55 +1030 Received: from disappointment.disaster.area ([192.168.1.110] helo=disappointment) by dastard with esmtp (Exim 4.80) (envelope-from ) id 1aVwPu-0004ls-MK for xfs@oss.sgi.com; Wed, 17 Feb 2016 18:20:54 +1100 Received: from dave by disappointment with local (Exim 4.86) (envelope-from ) id 1aVwPu-00013o-LU for xfs@oss.sgi.com; Wed, 17 Feb 2016 18:20:54 +1100 From: Dave Chinner To: xfs@oss.sgi.com Subject: [PATCH 01/15] xfs: wire up Q_XGETNEXTQUOTA / get_nextdqblk Date: Wed, 17 Feb 2016 18:20:38 +1100 X-ASG-Orig-Subj: [PATCH 01/15] xfs: wire up Q_XGETNEXTQUOTA / get_nextdqblk Message-Id: <1455693652-3899-2-git-send-email-david@fromorbit.com> X-Mailer: git-send-email 2.7.0 In-Reply-To: <1455693652-3899-1-git-send-email-david@fromorbit.com> References: <1455693652-3899-1-git-send-email-david@fromorbit.com> X-Barracuda-Connect: ipmail05.adl6.internode.on.net[150.101.137.143] X-Barracuda-Start-Time: 1455693670 X-Barracuda-URL: https://192.48.157.11:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-BRTS-Status: 1 X-Barracuda-Spam-Score: 0.00 X-Barracuda-Spam-Status: No, SCORE=0.00 using per-user scores of TAG_LEVEL=1000.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.7 tests= X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.3.27096 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- From: Eric Sandeen Source kernel commit 296c24e26ee3af2dbfecb482e6bc9560bd34c455 Add code to allow the Q_XGETNEXTQUOTA quotactl to quickly find all active quotas by examining the quota inode, and skipping over unallocated or uninitialized regions. Userspace can then use this interface rather than i.e. a getpwent() loop when asked to report all active quotas. Signed-off-by: Eric Sandeen Reviewed-by: Dave Chinner Signed-off-by: Dave Chinner --- libxfs/xfs_quota_defs.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/libxfs/xfs_quota_defs.h b/libxfs/xfs_quota_defs.h index f51078f..8eed512 100644 --- a/libxfs/xfs_quota_defs.h +++ b/libxfs/xfs_quota_defs.h @@ -37,7 +37,7 @@ typedef __uint16_t xfs_qwarncnt_t; #define XFS_DQ_PROJ 0x0002 /* project quota */ #define XFS_DQ_GROUP 0x0004 /* a group quota */ #define XFS_DQ_DIRTY 0x0008 /* dquot is dirty */ -#define XFS_DQ_FREEING 0x0010 /* dquot is beeing torn down */ +#define XFS_DQ_FREEING 0x0010 /* dquot is being torn down */ #define XFS_DQ_ALLTYPES (XFS_DQ_USER|XFS_DQ_PROJ|XFS_DQ_GROUP) @@ -116,6 +116,7 @@ typedef __uint16_t xfs_qwarncnt_t; #define XFS_QMOPT_DQREPAIR 0x0001000 /* repair dquot if damaged */ #define XFS_QMOPT_GQUOTA 0x0002000 /* group dquot requested */ #define XFS_QMOPT_ENOSPC 0x0004000 /* enospc instead of edquot (prj) */ +#define XFS_QMOPT_DQNEXT 0x0008000 /* return next dquot >= this ID */ /* * flags to xfs_trans_mod_dquot to indicate which field needs to be -- 2.7.0 From dave@fromorbit.com Wed Feb 17 01:21:19 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=ham version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay2.corp.sgi.com [137.38.102.29]) by oss.sgi.com (Postfix) with ESMTP id 690AF7CA2 for ; Wed, 17 Feb 2016 01:21:19 -0600 (CST) Received: from cuda.sgi.com (cuda2.sgi.com [192.48.176.25]) by relay2.corp.sgi.com (Postfix) with ESMTP id 5ABED304032 for ; Tue, 16 Feb 2016 23:21:16 -0800 (PST) X-ASG-Debug-ID: 1455693671-04cbb0433114c080002-NocioJ Received: from ipmail05.adl6.internode.on.net (ipmail05.adl6.internode.on.net [150.101.137.143]) by cuda.sgi.com with ESMTP id D3FHGklRBLqYr7lP for ; Tue, 16 Feb 2016 23:21:14 -0800 (PST) X-Barracuda-Envelope-From: dave@fromorbit.com X-Barracuda-Apparent-Source-IP: 150.101.137.143 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: A2B4CQBoHsRWXJbY03ZegzqoHwEBAQEBAQYFkTWLU00BAQEBAQEHREBBEgGESjuBAgMHiEacR58ghUqKBINuBZJyhBGcTI5HghgBAQgBAQEBgjMogw+GAAEBAQ Received: from ppp118-211-216-150.lns20.syd4.internode.on.net (HELO dastard) ([118.211.216.150]) by ipmail05.adl6.internode.on.net with ESMTP; 17 Feb 2016 17:50:55 +1030 Received: from disappointment.disaster.area ([192.168.1.110] helo=disappointment) by dastard with esmtp (Exim 4.80) (envelope-from ) id 1aVwPu-0004lr-Ls for xfs@oss.sgi.com; Wed, 17 Feb 2016 18:20:54 +1100 Received: from dave by disappointment with local (Exim 4.86) (envelope-from ) id 1aVwPu-00013l-Kl for xfs@oss.sgi.com; Wed, 17 Feb 2016 18:20:54 +1100 From: Dave Chinner To: xfs@oss.sgi.com Subject: [PATCH 00/15] xfsprogs: libxfs kernel sync to 4.6-for-next Date: Wed, 17 Feb 2016 18:20:37 +1100 X-ASG-Orig-Subj: [PATCH 00/15] xfsprogs: libxfs kernel sync to 4.6-for-next Message-Id: <1455693652-3899-1-git-send-email-david@fromorbit.com> X-Mailer: git-send-email 2.7.0 X-Barracuda-Connect: ipmail05.adl6.internode.on.net[150.101.137.143] X-Barracuda-Start-Time: 1455693673 X-Barracuda-URL: https://192.48.176.25:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-BRTS-Status: 1 X-Barracuda-Spam-Score: 0.00 X-Barracuda-Spam-Status: No, SCORE=0.00 using per-user scores of TAG_LEVEL=1000.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.7 tests= X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.3.27096 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- Hi folks, This series brings the xfsprogs libxfs code in sync with what is currently in the kernel for-next branch. This is aimed at the xfsprogs for-next branch so that Darrick can use this as the base for his rmap/reflink xfsprogs tree. The only "interesting" thing in this series is the xfs_icdinode modifications. I've made the structures similar to the kernel so the same macros can be used, and jumped one step ahead of the kernel by adding XFS_ISREG/XFS_ISDIR wrappers to keep the userspace conversions simple. Overall, it turned out ot be a lot simpler than I though it would be, and points to the general direction that needs to be taken here: use the xfs_dinode for anythign futzing directly with on disk inodes, use the xfs_inode for everything else. I also noticed a coupl eof good opportunites for factoring, such as the repeated copy/paste of inode allocation and initialisation code. Comments welcome! -Dave. From dave@fromorbit.com Wed Feb 17 01:21:20 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=ham version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay1.corp.sgi.com [137.38.102.111]) by oss.sgi.com (Postfix) with ESMTP id 574BB7CB7 for ; Wed, 17 Feb 2016 01:21:20 -0600 (CST) Received: from cuda.sgi.com (cuda1.sgi.com [192.48.157.11]) by relay1.corp.sgi.com (Postfix) with ESMTP id 18B7A8F8033 for ; Tue, 16 Feb 2016 23:21:20 -0800 (PST) X-ASG-Debug-ID: 1455693670-04bdf02d5c64b50002-NocioJ Received: from ipmail05.adl6.internode.on.net (ipmail05.adl6.internode.on.net [150.101.137.143]) by cuda.sgi.com with ESMTP id vPP8FrT6ulVT5Giu for ; Tue, 16 Feb 2016 23:21:17 -0800 (PST) X-Barracuda-Envelope-From: dave@fromorbit.com X-Barracuda-Apparent-Source-IP: 150.101.137.143 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: A2BOCQBoHsRWXJbY03ZegzqBP6ZgAQEBAQEBBpE6i1NNAQEBAQEBB0RAQRIBg24BBScvMwgYMTkDBxQZiBm7Z4VKigSDbgWXA5xMjkeCGAELgjUoLoJhhgABAQE Received: from ppp118-211-216-150.lns20.syd4.internode.on.net (HELO dastard) ([118.211.216.150]) by ipmail05.adl6.internode.on.net with ESMTP; 17 Feb 2016 17:50:55 +1030 Received: from disappointment.disaster.area ([192.168.1.110] helo=disappointment) by dastard with esmtp (Exim 4.80) (envelope-from ) id 1aVwPu-0004lu-Nh for xfs@oss.sgi.com; Wed, 17 Feb 2016 18:20:54 +1100 Received: from dave by disappointment with local (Exim 4.86) (envelope-from ) id 1aVwPu-00013y-Ms for xfs@oss.sgi.com; Wed, 17 Feb 2016 18:20:54 +1100 From: Dave Chinner To: xfs@oss.sgi.com Subject: [PATCH 03/15] xfs: factor btree block freeing into a helper Date: Wed, 17 Feb 2016 18:20:40 +1100 X-ASG-Orig-Subj: [PATCH 03/15] xfs: factor btree block freeing into a helper Message-Id: <1455693652-3899-4-git-send-email-david@fromorbit.com> X-Mailer: git-send-email 2.7.0 In-Reply-To: <1455693652-3899-1-git-send-email-david@fromorbit.com> References: <1455693652-3899-1-git-send-email-david@fromorbit.com> X-Barracuda-Connect: ipmail05.adl6.internode.on.net[150.101.137.143] X-Barracuda-Start-Time: 1455693674 X-Barracuda-URL: https://192.48.157.11:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-BRTS-Status: 1 X-Barracuda-Spam-Score: 0.00 X-Barracuda-Spam-Status: No, SCORE=0.00 using per-user scores of TAG_LEVEL=1000.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.7 tests= X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.3.27096 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- From: Christoph Hellwig Source kernel commit c46ee8ad7856b58eeb383c30ce847897f85c4103 Signed-off-by: Christoph Hellwig Reviewed-by: Brian Foster Signed-off-by: Dave Chinner --- libxfs/xfs_btree.c | 23 ++++++++++++++++------- 1 file changed, 16 insertions(+), 7 deletions(-) diff --git a/libxfs/xfs_btree.c b/libxfs/xfs_btree.c index 14d8bf3..f4a1c67 100644 --- a/libxfs/xfs_btree.c +++ b/libxfs/xfs_btree.c @@ -290,6 +290,19 @@ xfs_btree_sblock_verify_crc( return true; } +static int +xfs_btree_free_block( + struct xfs_btree_cur *cur, + struct xfs_buf *bp) +{ + int error; + + error = cur->bc_ops->free_block(cur, bp); + if (!error) + XFS_BTREE_STATS_INC(cur, free); + return error; +} + /* * Delete the btree cursor. */ @@ -3282,12 +3295,11 @@ xfs_btree_kill_iroot( #endif xfs_btree_copy_ptrs(cur, pp, cpp, numrecs); - error = cur->bc_ops->free_block(cur, cbp); + error = xfs_btree_free_block(cur, cbp); if (error) { XFS_BTREE_TRACE_CURSOR(cur, XBT_ERROR); return error; } - XFS_BTREE_STATS_INC(cur, free); cur->bc_bufs[level - 1] = NULL; be16_add_cpu(&block->bb_level, -1); @@ -3320,14 +3332,12 @@ xfs_btree_kill_root( */ cur->bc_ops->set_root(cur, newroot, -1); - error = cur->bc_ops->free_block(cur, bp); + error = xfs_btree_free_block(cur, bp); if (error) { XFS_BTREE_TRACE_CURSOR(cur, XBT_ERROR); return error; } - XFS_BTREE_STATS_INC(cur, free); - cur->bc_bufs[level] = NULL; cur->bc_ra[level] = 0; cur->bc_nlevels--; @@ -3833,10 +3843,9 @@ xfs_btree_delrec( } /* Free the deleted block. */ - error = cur->bc_ops->free_block(cur, rbp); + error = xfs_btree_free_block(cur, rbp); if (error) goto error0; - XFS_BTREE_STATS_INC(cur, free); /* * If we joined with the left neighbor, set the buffer in the -- 2.7.0 From dave@fromorbit.com Wed Feb 17 01:21:20 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=ham version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay2.corp.sgi.com [137.38.102.29]) by oss.sgi.com (Postfix) with ESMTP id 961F67CB8 for ; Wed, 17 Feb 2016 01:21:20 -0600 (CST) Received: from cuda.sgi.com (cuda2.sgi.com [192.48.176.25]) by relay2.corp.sgi.com (Postfix) with ESMTP id 78C98304039 for ; Tue, 16 Feb 2016 23:21:20 -0800 (PST) X-ASG-Debug-ID: 1455693671-04cbb0433114c080004-NocioJ Received: from ipmail05.adl6.internode.on.net (ipmail05.adl6.internode.on.net [150.101.137.143]) by cuda.sgi.com with ESMTP id NZCxiLNiQhq9kZXB for ; Tue, 16 Feb 2016 23:21:17 -0800 (PST) X-Barracuda-Envelope-From: dave@fromorbit.com X-Barracuda-Apparent-Source-IP: 150.101.137.143 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: A2BOCQBoHsRWXJbY03ZegzqBP6ZgAQEBAQEBBpE6i1NNAQEBAQEBB0RAQRIBg24BBScvMwgYGRg5AwcUGYgZu2eFSooADINmBZcDnEyOR4IYAQsBPAMEFYFcKC6CYYRQgTABAQE Received: from ppp118-211-216-150.lns20.syd4.internode.on.net (HELO dastard) ([118.211.216.150]) by ipmail05.adl6.internode.on.net with ESMTP; 17 Feb 2016 17:50:55 +1030 Received: from disappointment.disaster.area ([192.168.1.110] helo=disappointment) by dastard with esmtp (Exim 4.80) (envelope-from ) id 1aVwPu-0004lz-Pm for xfs@oss.sgi.com; Wed, 17 Feb 2016 18:20:54 +1100 Received: from dave by disappointment with local (Exim 4.86) (envelope-from ) id 1aVwPu-00014N-Ot for xfs@oss.sgi.com; Wed, 17 Feb 2016 18:20:54 +1100 From: Dave Chinner To: xfs@oss.sgi.com Subject: [PATCH 08/15] xfs: introduce inode log format object Date: Wed, 17 Feb 2016 18:20:45 +1100 X-ASG-Orig-Subj: [PATCH 08/15] xfs: introduce inode log format object Message-Id: <1455693652-3899-9-git-send-email-david@fromorbit.com> X-Mailer: git-send-email 2.7.0 In-Reply-To: <1455693652-3899-1-git-send-email-david@fromorbit.com> References: <1455693652-3899-1-git-send-email-david@fromorbit.com> X-Barracuda-Connect: ipmail05.adl6.internode.on.net[150.101.137.143] X-Barracuda-Start-Time: 1455693677 X-Barracuda-URL: https://192.48.176.25:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-BRTS-Status: 1 X-Barracuda-Spam-Score: 0.00 X-Barracuda-Spam-Status: No, SCORE=0.00 using per-user scores of TAG_LEVEL=1000.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.7 tests= X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.3.27096 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- From: Dave Chinner Source kernel commit f8d55aa0523ad0f78979c222ed18b78ea7be793a We currently carry around and log an entire inode core in the struct xfs_inode. A lot of the information in the inode core is duplicated in the VFS inode, but we cannot remove this duplication of infomration because the inode core is logged directly in xfs_inode_item_format(). Add a new function xfs_inode_item_format_core() that copies the inode core data into a struct xfs_icdinode that is pulled directly from the log vector buffer. This means we no longer directly copy the inode core, but copy the structures one member at a time. This will be slightly less efficient than copying, but will allow us to remove duplicate and unnecessary items from the struct xfs_inode. To enable us to do this, call the new structure a xfs_log_dinode, so that we know it's different to the physical xfs_dinode and the in-core xfs_icdinode. Signed-off-by: Dave Chinner Reviewed-by: Brian Foster Reviewed-by: Christoph Hellwig Signed-off-by: Dave Chinner --- db/check.c | 2 +- libxfs/util.c | 2 +- libxfs/xfs_inode_buf.c | 8 ++++---- libxfs/xfs_inode_buf.h | 53 +++++++++++++++++++++++++++++++++++++++++++++++- libxfs/xfs_log_format.h | 15 +++++++------- logprint/log_misc.c | 7 ++++--- logprint/log_print_all.c | 13 ++++++------ repair/phase6.c | 8 ++++---- repair/phase7.c | 2 +- 9 files changed, 82 insertions(+), 28 deletions(-) diff --git a/db/check.c b/db/check.c index 838db53..d6d1d57 100644 --- a/db/check.c +++ b/db/check.c @@ -2619,7 +2619,7 @@ process_inode( { blkmap_t *blkmap; xfs_fsblock_t bno = 0; - xfs_icdinode_t idic; + struct xfs_icdinode idic; inodata_t *id = NULL; xfs_ino_t ino; xfs_extnum_t nextents = 0; diff --git a/libxfs/util.c b/libxfs/util.c index 4a72e89..787fd5d 100644 --- a/libxfs/util.c +++ b/libxfs/util.c @@ -345,7 +345,7 @@ void libxfs_iprint( xfs_inode_t *ip) { - xfs_icdinode_t *dip; + struct xfs_icdinode *dip; xfs_bmbt_rec_host_t *ep; xfs_extnum_t i; xfs_extnum_t nextents; diff --git a/libxfs/xfs_inode_buf.c b/libxfs/xfs_inode_buf.c index 89c05ad..dbea592 100644 --- a/libxfs/xfs_inode_buf.c +++ b/libxfs/xfs_inode_buf.c @@ -205,8 +205,8 @@ xfs_imap_to_bp( void xfs_dinode_from_disk( - xfs_icdinode_t *to, - xfs_dinode_t *from) + struct xfs_icdinode *to, + struct xfs_dinode *from) { to->di_magic = be16_to_cpu(from->di_magic); to->di_mode = be16_to_cpu(from->di_mode); @@ -252,8 +252,8 @@ xfs_dinode_from_disk( void xfs_dinode_to_disk( - xfs_dinode_t *to, - xfs_icdinode_t *from) + struct xfs_dinode *to, + struct xfs_icdinode *from) { to->di_magic = cpu_to_be16(from->di_magic); to->di_mode = cpu_to_be16(from->di_mode); diff --git a/libxfs/xfs_inode_buf.h b/libxfs/xfs_inode_buf.h index 03f2a90..da66458 100644 --- a/libxfs/xfs_inode_buf.h +++ b/libxfs/xfs_inode_buf.h @@ -20,7 +20,58 @@ struct xfs_inode; struct xfs_dinode; -struct xfs_icdinode; + +/* + * In memory representation of the XFS inode. This is held in the in-core + * struct xfs_inode to represent the on disk values, but no longer needs to be + * identical to the on-disk structure as it is always translated to on-disk + * format specific structures at the appropriate time. + */ +struct xfs_icdinode { + __uint16_t di_magic; /* inode magic # = XFS_DINODE_MAGIC */ + __uint16_t di_mode; /* mode and type of file */ + __int8_t di_version; /* inode version */ + __int8_t di_format; /* format of di_c data */ + __uint16_t di_onlink; /* old number of links to file */ + __uint32_t di_uid; /* owner's user id */ + __uint32_t di_gid; /* owner's group id */ + __uint32_t di_nlink; /* number of links to file */ + __uint16_t di_projid_lo; /* lower part of owner's project id */ + __uint16_t di_projid_hi; /* higher part of owner's project id */ + __uint8_t di_pad[6]; /* unused, zeroed space */ + __uint16_t di_flushiter; /* incremented on flush */ + xfs_ictimestamp_t di_atime; /* time last accessed */ + xfs_ictimestamp_t di_mtime; /* time last modified */ + xfs_ictimestamp_t di_ctime; /* time created/inode modified */ + xfs_fsize_t di_size; /* number of bytes in file */ + xfs_rfsblock_t di_nblocks; /* # of direct & btree blocks used */ + xfs_extlen_t di_extsize; /* basic/minimum extent size for file */ + xfs_extnum_t di_nextents; /* number of extents in data fork */ + xfs_aextnum_t di_anextents; /* number of extents in attribute fork*/ + __uint8_t di_forkoff; /* attr fork offs, <<3 for 64b align */ + __int8_t di_aformat; /* format of attr fork's data */ + __uint32_t di_dmevmask; /* DMIG event mask */ + __uint16_t di_dmstate; /* DMIG state info */ + __uint16_t di_flags; /* random flags, XFS_DIFLAG_... */ + __uint32_t di_gen; /* generation number */ + + /* di_next_unlinked is the only non-core field in the old dinode */ + xfs_agino_t di_next_unlinked;/* agi unlinked list ptr */ + + /* start of the extended dinode, writable fields */ + __uint32_t di_crc; /* CRC of the inode */ + __uint64_t di_changecount; /* number of attribute changes */ + xfs_lsn_t di_lsn; /* flush sequence */ + __uint64_t di_flags2; /* more random flags */ + __uint8_t di_pad2[16]; /* more padding for future expansion */ + + /* fields only written to during inode creation */ + xfs_ictimestamp_t di_crtime; /* time created */ + xfs_ino_t di_ino; /* inode number */ + uuid_t di_uuid; /* UUID of the filesystem */ + + /* structure must be padded to 64 bit alignment */ +}; /* * Inode location information. Stored in the inode and passed to diff --git a/libxfs/xfs_log_format.h b/libxfs/xfs_log_format.h index c860345..85d4732 100644 --- a/libxfs/xfs_log_format.h +++ b/libxfs/xfs_log_format.h @@ -290,6 +290,7 @@ typedef struct xfs_inode_log_format_64 { __int32_t ilf_boffset; /* off of inode in buffer */ } xfs_inode_log_format_64_t; + /* * Flags for xfs_trans_log_inode flags field. */ @@ -360,10 +361,10 @@ typedef struct xfs_ictimestamp { } xfs_ictimestamp_t; /* - * NOTE: This structure must be kept identical to struct xfs_dinode - * except for the endianness annotations. + * Define the format of the inode core that is logged. This structure must be + * kept identical to struct xfs_dinode except for the endianness annotations. */ -typedef struct xfs_icdinode { +struct xfs_log_dinode { __uint16_t di_magic; /* inode magic # = XFS_DINODE_MAGIC */ __uint16_t di_mode; /* mode and type of file */ __int8_t di_version; /* inode version */ @@ -407,13 +408,13 @@ typedef struct xfs_icdinode { uuid_t di_uuid; /* UUID of the filesystem */ /* structure must be padded to 64 bit alignment */ -} xfs_icdinode_t; +}; -static inline uint xfs_icdinode_size(int version) +static inline uint xfs_log_dinode_size(int version) { if (version == 3) - return sizeof(struct xfs_icdinode); - return offsetof(struct xfs_icdinode, di_next_unlinked); + return sizeof(struct xfs_log_dinode); + return offsetof(struct xfs_log_dinode, di_next_unlinked); } /* diff --git a/logprint/log_misc.c b/logprint/log_misc.c index 7378fe1..e6ee832 100644 --- a/logprint/log_misc.c +++ b/logprint/log_misc.c @@ -588,7 +588,8 @@ xlog_print_trans_qoff(char **ptr, uint len) void -xlog_print_trans_inode_core(xfs_icdinode_t *ip) +xlog_print_trans_inode_core( + struct xfs_log_dinode *ip) { printf(_("INODE CORE\n")); printf(_("magic 0x%hx mode 0%ho version %d format %d\n"), @@ -652,7 +653,7 @@ xlog_print_trans_inode( int num_ops, int continued) { - xfs_icdinode_t dino; + struct xfs_log_dinode dino; xlog_op_header_t *op_head; xfs_inode_log_format_t dst_lbuf; xfs_inode_log_format_64_t src_lbuf; /* buffer of biggest one */ @@ -705,7 +706,7 @@ xlog_print_trans_inode( mode = dino.di_mode & S_IFMT; size = (int)dino.di_size; xlog_print_trans_inode_core(&dino); - *ptr += xfs_icdinode_size(dino.di_version); + *ptr += xfs_log_dinode_size(dino.di_version); if (*i == num_ops-1 && f->ilf_size == 3) { return 1; diff --git a/logprint/log_print_all.c b/logprint/log_print_all.c index ba26408..1bc18af 100644 --- a/logprint/log_print_all.c +++ b/logprint/log_print_all.c @@ -250,7 +250,7 @@ xlog_recover_print_dquot( STATIC void xlog_recover_print_inode_core( - xfs_icdinode_t *di) + struct xfs_log_dinode *di) { printf(_(" CORE inode:\n")); if (!print_inode) @@ -259,8 +259,9 @@ xlog_recover_print_inode_core( "onlink:%d\n"), (di->di_magic>>8) & 0xff, di->di_magic & 0xff, di->di_mode, di->di_version, di->di_format, di->di_onlink); - printf(_(" uid:%d gid:%d nlink:%d projid:%u\n"), - di->di_uid, di->di_gid, di->di_nlink, xfs_get_projid(di)); + printf(_(" uid:%d gid:%d nlink:%d projid:0x%04x%04x\n"), + di->di_uid, di->di_gid, di->di_nlink, + di->di_projid_hi, di->di_projid_lo); printf(_(" atime:%d mtime:%d ctime:%d\n"), di->di_atime.t_sec, di->di_mtime.t_sec, di->di_ctime.t_sec); printf(_(" flushiter:%d\n"), di->di_flushiter); @@ -293,9 +294,9 @@ xlog_recover_print_inode( f->ilf_dsize); /* core inode comes 2nd */ - ASSERT(item->ri_buf[1].i_len == xfs_icdinode_size(1) || - item->ri_buf[1].i_len == xfs_icdinode_size(3)); - xlog_recover_print_inode_core((xfs_icdinode_t *) + ASSERT(item->ri_buf[1].i_len == xfs_log_dinode_size(2) || + item->ri_buf[1].i_len == xfs_log_dinode_size(3)); + xlog_recover_print_inode_core((struct xfs_log_dinode *) item->ri_buf[1].i_addr); hasdata = (f->ilf_fields & XFS_ILOG_DFORK) != 0; diff --git a/repair/phase6.c b/repair/phase6.c index eb36520..3aa109d 100644 --- a/repair/phase6.c +++ b/repair/phase6.c @@ -507,8 +507,8 @@ mk_rbmino(xfs_mount_t *mp) error); } - vers = xfs_sb_version_hascrc(&mp->m_sb) ? 3 : 1; - memset(&ip->i_d, 0, xfs_icdinode_size(vers)); + vers = xfs_sb_version_hascrc(&mp->m_sb) ? 3 : 2; + memset(&ip->i_d, 0, sizeof(ip->i_d)); ip->i_d.di_magic = XFS_DINODE_MAGIC; ip->i_d.di_mode = S_IFREG; @@ -767,7 +767,7 @@ mk_rsumino(xfs_mount_t *mp) } vers = xfs_sb_version_hascrc(&mp->m_sb) ? 3 : 1; - memset(&ip->i_d, 0, xfs_icdinode_size(vers)); + memset(&ip->i_d, 0, sizeof(ip->i_d)); ip->i_d.di_magic = XFS_DINODE_MAGIC; ip->i_d.di_mode = S_IFREG; @@ -882,7 +882,7 @@ mk_root_dir(xfs_mount_t *mp) * take care of the core -- initialization from xfs_ialloc() */ vers = xfs_sb_version_hascrc(&mp->m_sb) ? 3 : 2; - memset(&ip->i_d, 0, xfs_icdinode_size(vers)); + memset(&ip->i_d, 0, sizeof(ip->i_d)); ip->i_d.di_magic = XFS_DINODE_MAGIC; ip->i_d.di_mode = (__uint16_t) mode|S_IFDIR; diff --git a/repair/phase7.c b/repair/phase7.c index 640eaec..72a8ade 100644 --- a/repair/phase7.c +++ b/repair/phase7.c @@ -31,7 +31,7 @@ /* dinoc is a pointer to the IN-CORE dinode core */ static void set_nlinks( - xfs_icdinode_t *dinoc, + struct xfs_icdinode *dinoc, xfs_ino_t ino, __uint32_t nrefs, int *dirty) -- 2.7.0 From dave@fromorbit.com Wed Feb 17 01:21:21 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=ham version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay1.corp.sgi.com [137.38.102.111]) by oss.sgi.com (Postfix) with ESMTP id 2DC777CB7 for ; Wed, 17 Feb 2016 01:21:21 -0600 (CST) Received: from cuda.sgi.com (cuda2.sgi.com [192.48.176.25]) by relay1.corp.sgi.com (Postfix) with ESMTP id 1B4A18F8035 for ; Tue, 16 Feb 2016 23:21:18 -0800 (PST) X-ASG-Debug-ID: 1455693674-04cbb0433414c090002-NocioJ Received: from ipmail05.adl6.internode.on.net (ipmail05.adl6.internode.on.net [150.101.137.143]) by cuda.sgi.com with ESMTP id ZL1XWI7FupAcwknw for ; Tue, 16 Feb 2016 23:21:16 -0800 (PST) X-Barracuda-Envelope-From: dave@fromorbit.com X-Barracuda-Apparent-Source-IP: 150.101.137.143 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: A2BOCQBoHsRWXJbY03ZegzqBP6ZgAQEBAQEBBpE6i1NNAQEBAQEBB0RAQRIBg24BBVYzCBgxOQMHFBmIGbtnhUqJBn6DbgWScoQRnEyOR4IYAQtAGYFcKC6CYYRHgTkBAQE Received: from ppp118-211-216-150.lns20.syd4.internode.on.net (HELO dastard) ([118.211.216.150]) by ipmail05.adl6.internode.on.net with ESMTP; 17 Feb 2016 17:50:55 +1030 Received: from disappointment.disaster.area ([192.168.1.110] helo=disappointment) by dastard with esmtp (Exim 4.80) (envelope-from ) id 1aVwPu-0004lw-OW for xfs@oss.sgi.com; Wed, 17 Feb 2016 18:20:54 +1100 Received: from dave by disappointment with local (Exim 4.86) (envelope-from ) id 1aVwPu-000148-Nh for xfs@oss.sgi.com; Wed, 17 Feb 2016 18:20:54 +1100 From: Dave Chinner To: xfs@oss.sgi.com Subject: [PATCH 05/15] xfs: remove unused function definitions Date: Wed, 17 Feb 2016 18:20:42 +1100 X-ASG-Orig-Subj: [PATCH 05/15] xfs: remove unused function definitions Message-Id: <1455693652-3899-6-git-send-email-david@fromorbit.com> X-Mailer: git-send-email 2.7.0 In-Reply-To: <1455693652-3899-1-git-send-email-david@fromorbit.com> References: <1455693652-3899-1-git-send-email-david@fromorbit.com> X-Barracuda-Connect: ipmail05.adl6.internode.on.net[150.101.137.143] X-Barracuda-Start-Time: 1455693676 X-Barracuda-URL: https://192.48.176.25:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-BRTS-Status: 1 X-Barracuda-Spam-Score: 0.00 X-Barracuda-Spam-Status: No, SCORE=0.00 using per-user scores of TAG_LEVEL=1000.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.7 tests= X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.3.27096 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- From: Eric Sandeen Source kernel commit de0b85a8cf24f8c535b7f719c454e3951298d17a Old leftovers. Signed-off-by: Eric Sandeen Reviewed-by: Dave Chinner Signed-off-by: Dave Chinner --- libxfs/xfs_sb.h | 1 - 1 file changed, 1 deletion(-) diff --git a/libxfs/xfs_sb.h b/libxfs/xfs_sb.h index b25bb9a..961e647 100644 --- a/libxfs/xfs_sb.h +++ b/libxfs/xfs_sb.h @@ -27,7 +27,6 @@ extern struct xfs_perag *xfs_perag_get_tag(struct xfs_mount *, xfs_agnumber_t, extern void xfs_perag_put(struct xfs_perag *pag); extern int xfs_initialize_perag_data(struct xfs_mount *, xfs_agnumber_t); -extern void xfs_sb_calc_crc(struct xfs_buf *bp); extern void xfs_log_sb(struct xfs_trans *tp); extern int xfs_sync_sb(struct xfs_mount *mp, bool wait); extern void xfs_sb_mount_common(struct xfs_mount *mp, struct xfs_sb *sbp); -- 2.7.0 From dave@fromorbit.com Wed Feb 17 01:21:21 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=ham version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay2.corp.sgi.com [137.38.102.29]) by oss.sgi.com (Postfix) with ESMTP id 3ECF27CB9 for ; Wed, 17 Feb 2016 01:21:21 -0600 (CST) Received: from cuda.sgi.com (cuda2.sgi.com [192.48.176.25]) by relay2.corp.sgi.com (Postfix) with ESMTP id 2FDF0304039 for ; Tue, 16 Feb 2016 23:21:21 -0800 (PST) X-ASG-Debug-ID: 1455693674-04cbb0433414c090003-NocioJ Received: from ipmail05.adl6.internode.on.net (ipmail05.adl6.internode.on.net [150.101.137.143]) by cuda.sgi.com with ESMTP id 7bis3tKqGQGF1prF for ; Tue, 16 Feb 2016 23:21:17 -0800 (PST) X-Barracuda-Envelope-From: dave@fromorbit.com X-Barracuda-Apparent-Source-IP: 150.101.137.143 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: A2BQCQBoHsRWXJbY03ZegzqBP6ZgAQEBAQEBBpE6ihWBPk0BAQEBAQEHREBBEgGDbgEFJy8zCBgZGDkDBxQZiBm7Z4VKiV4iDINmBYdVjy6PNY0XhXGIVoIYAQsBPAMZgVwoLoJhhFCBMAEBAQ Received: from ppp118-211-216-150.lns20.syd4.internode.on.net (HELO dastard) ([118.211.216.150]) by ipmail05.adl6.internode.on.net with ESMTP; 17 Feb 2016 17:50:55 +1030 Received: from disappointment.disaster.area ([192.168.1.110] helo=disappointment) by dastard with esmtp (Exim 4.80) (envelope-from ) id 1aVwPu-0004m1-Qb for xfs@oss.sgi.com; Wed, 17 Feb 2016 18:20:54 +1100 Received: from dave by disappointment with local (Exim 4.86) (envelope-from ) id 1aVwPu-00014X-Pn for xfs@oss.sgi.com; Wed, 17 Feb 2016 18:20:54 +1100 From: Dave Chinner To: xfs@oss.sgi.com Subject: [PATCH 10/15] xfs: cull unnecessary icdinode fields Date: Wed, 17 Feb 2016 18:20:47 +1100 X-ASG-Orig-Subj: [PATCH 10/15] xfs: cull unnecessary icdinode fields Message-Id: <1455693652-3899-11-git-send-email-david@fromorbit.com> X-Mailer: git-send-email 2.7.0 In-Reply-To: <1455693652-3899-1-git-send-email-david@fromorbit.com> References: <1455693652-3899-1-git-send-email-david@fromorbit.com> X-Barracuda-Connect: ipmail05.adl6.internode.on.net[150.101.137.143] X-Barracuda-Start-Time: 1455693677 X-Barracuda-URL: https://192.48.176.25:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-BRTS-Status: 1 X-Barracuda-Spam-Score: 0.00 X-Barracuda-Spam-Status: No, SCORE=0.00 using per-user scores of TAG_LEVEL=1000.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.7 tests= X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.3.27096 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- From: Dave Chinner Source kernel commit 93f958f9c41f0bfd10627a2279457df64004d957 Now that the struct xfs_icdinode is not directly related to the on-disk format, we can cull things in it we really don't need to store: - magic number never changes - padding is not necessary - next_unlinked is never used - inode number is redundant - uuid is redundant - lsn is accessed directly from dinode - inode CRC is only accessed directly from dinode Hence we can remove these from the struct xfs_icdinode and redirect the code that uses them to the xfs_dinode appripriately. This reduces the size of the struct icdinode from 152 bytes to 88 bytes, and removes a fair chunk of unnecessary code, too. Signed-off-by: Dave Chinner Reviewed-by: Brian Foster Reviewed-by: Christoph Hellwig Signed-off-by: Dave Chinner --- db/check.c | 4 ++-- libxfs/util.c | 11 +---------- libxfs/xfs_inode_buf.c | 39 +++++++++++++-------------------------- libxfs/xfs_inode_buf.h | 25 ++++++------------------- repair/phase6.c | 18 ------------------ 5 files changed, 22 insertions(+), 75 deletions(-) diff --git a/db/check.c b/db/check.c index 2203f41..95a68d4 100644 --- a/db/check.c +++ b/db/check.c @@ -2672,10 +2672,10 @@ process_inode( blkmap = NULL; } v = (!sflag || (id && id->ilist) || CHECK_BLIST(bno)); - if (xino.i_d.di_magic != XFS_DINODE_MAGIC) { + if (dip->di_magic != cpu_to_be16(XFS_DINODE_MAGIC)) { if (isfree || v) dbprintf(_("bad magic number %#x for inode %lld\n"), - xino.i_d.di_magic, ino); + be16_to_cpu(dip->di_magic), ino); error++; return; } diff --git a/libxfs/util.c b/libxfs/util.c index 86fadc3..a893c3a 100644 --- a/libxfs/util.c +++ b/libxfs/util.c @@ -224,7 +224,6 @@ libxfs_ialloc( ip->i_d.di_uid = cr->cr_uid; ip->i_d.di_gid = cr->cr_gid; xfs_set_projid(&ip->i_d, pip ? 0 : fsx->fsx_projid); - memset(&(ip->i_d.di_pad[0]), 0, sizeof(ip->i_d.di_pad)); xfs_trans_ichgtime(tp, ip, XFS_ICHGTIME_CHG | XFS_ICHGTIME_MOD); /* @@ -261,11 +260,8 @@ libxfs_ialloc( if (ip->i_d.di_version == 3) { ASSERT(ip->i_d.di_ino == ino); ASSERT(uuid_equal(&ip->i_d.di_uuid, &mp->m_sb.sb_meta_uuid)); - ip->i_d.di_crc = 0; ip->i_d.di_changecount = 1; - ip->i_d.di_lsn = 0; ip->i_d.di_flags2 = 0; - memset(&(ip->i_d.di_pad2[0]), 0, sizeof(ip->i_d.di_pad2)); ip->i_d.di_crtime.t_sec = (__int32_t)VFS_I(ip)->i_mtime.tv_sec; ip->i_d.di_crtime.t_nsec = (__int32_t)VFS_I(ip)->i_mtime.tv_nsec; } @@ -376,7 +372,6 @@ libxfs_iprint( dip = &ip->i_d; printf("\nOn disk portion\n"); - printf(" di_magic %x\n", dip->di_magic); printf(" di_mode %o\n", dip->di_mode); printf(" di_version %x\n", (uint)dip->di_version); switch (ip->i_d.di_format) { @@ -449,16 +444,12 @@ libxfs_iflush_int(xfs_inode_t *ip, xfs_buf_t *bp) * because if the inode is dirty at all the core must * be. */ - xfs_inode_to_disk(ip, dip); + xfs_inode_to_disk(ip, dip, iip->ili_item.li_lsn); xfs_iflush_fork(ip, dip, iip, XFS_DATA_FORK); if (XFS_IFORK_Q(ip)) xfs_iflush_fork(ip, dip, iip, XFS_ATTR_FORK); - /* update the lsn in the on disk inode if required */ - if (ip->i_d.di_version == 3) - dip->di_lsn = cpu_to_be64(iip->ili_item.li_lsn); - /* generate the checksum. */ xfs_dinode_calc_crc(mp, dip); diff --git a/libxfs/xfs_inode_buf.c b/libxfs/xfs_inode_buf.c index f546b41..5a7a118 100644 --- a/libxfs/xfs_inode_buf.c +++ b/libxfs/xfs_inode_buf.c @@ -211,7 +211,6 @@ xfs_inode_from_disk( struct xfs_icdinode *to = &ip->i_d; struct inode *inode = VFS_I(ip); - to->di_magic = be16_to_cpu(from->di_magic); to->di_mode = be16_to_cpu(from->di_mode); to->di_version = from ->di_version; to->di_format = from->di_format; @@ -221,7 +220,6 @@ xfs_inode_from_disk( to->di_nlink = be32_to_cpu(from->di_nlink); to->di_projid_lo = be16_to_cpu(from->di_projid_lo); to->di_projid_hi = be16_to_cpu(from->di_projid_hi); - memcpy(to->di_pad, from->di_pad, sizeof(to->di_pad)); to->di_flushiter = be16_to_cpu(from->di_flushiter); /* @@ -254,24 +252,22 @@ xfs_inode_from_disk( to->di_crtime.t_sec = be32_to_cpu(from->di_crtime.t_sec); to->di_crtime.t_nsec = be32_to_cpu(from->di_crtime.t_nsec); to->di_flags2 = be64_to_cpu(from->di_flags2); - to->di_ino = be64_to_cpu(from->di_ino); - to->di_lsn = be64_to_cpu(from->di_lsn); - memcpy(to->di_pad2, from->di_pad2, sizeof(to->di_pad2)); - uuid_copy(&to->di_uuid, &from->di_uuid); } } void xfs_inode_to_disk( struct xfs_inode *ip, - struct xfs_dinode *to) + struct xfs_dinode *to, + xfs_lsn_t lsn) { struct xfs_icdinode *from = &ip->i_d; struct inode *inode = VFS_I(ip); - to->di_magic = cpu_to_be16(from->di_magic); + to->di_magic = cpu_to_be16(XFS_DINODE_MAGIC); + to->di_mode = cpu_to_be16(from->di_mode); - to->di_version = from ->di_version; + to->di_version = from->di_version; to->di_format = from->di_format; to->di_onlink = cpu_to_be16(from->di_onlink); to->di_uid = cpu_to_be32(from->di_uid); @@ -279,8 +275,8 @@ xfs_inode_to_disk( to->di_nlink = cpu_to_be32(from->di_nlink); to->di_projid_lo = cpu_to_be16(from->di_projid_lo); to->di_projid_hi = cpu_to_be16(from->di_projid_hi); - memcpy(to->di_pad, from->di_pad, sizeof(to->di_pad)); + memset(to->di_pad, 0, sizeof(to->di_pad)); to->di_atime.t_sec = cpu_to_be32(inode->i_atime.tv_sec); to->di_atime.t_nsec = cpu_to_be32(inode->i_atime.tv_nsec); to->di_mtime.t_sec = cpu_to_be32(inode->i_mtime.tv_sec); @@ -305,10 +301,11 @@ xfs_inode_to_disk( to->di_crtime.t_sec = cpu_to_be32(from->di_crtime.t_sec); to->di_crtime.t_nsec = cpu_to_be32(from->di_crtime.t_nsec); to->di_flags2 = cpu_to_be64(from->di_flags2); - to->di_ino = cpu_to_be64(from->di_ino); - to->di_lsn = cpu_to_be64(from->di_lsn); - memcpy(to->di_pad2, from->di_pad2, sizeof(to->di_pad2)); - uuid_copy(&to->di_uuid, &from->di_uuid); + + to->di_ino = cpu_to_be64(ip->i_ino); + to->di_lsn = cpu_to_be64(lsn); + memset(to->di_pad2, 0, sizeof(to->di_pad2)); + uuid_copy(&to->di_uuid, &ip->i_mount->m_sb.sb_meta_uuid); to->di_flushiter = 0; } else { to->di_flushiter = cpu_to_be16(from->di_flushiter); @@ -443,13 +440,10 @@ xfs_iread( !(mp->m_flags & XFS_MOUNT_IKEEP)) { /* initialise the on-disk inode core */ memset(&ip->i_d, 0, sizeof(ip->i_d)); - ip->i_d.di_magic = XFS_DINODE_MAGIC; ip->i_d.di_gen = prandom_u32(); - if (xfs_sb_version_hascrc(&mp->m_sb)) { + if (xfs_sb_version_hascrc(&mp->m_sb)) ip->i_d.di_version = 3; - ip->i_d.di_ino = ip->i_ino; - uuid_copy(&ip->i_d.di_uuid, &mp->m_sb.sb_meta_uuid); - } else + else ip->i_d.di_version = 2; return 0; } @@ -493,16 +487,10 @@ xfs_iread( * Partial initialisation of the in-core inode. Just the bits * that xfs_ialloc won't overwrite or relies on being correct. */ - ip->i_d.di_magic = be16_to_cpu(dip->di_magic); ip->i_d.di_version = dip->di_version; ip->i_d.di_gen = be32_to_cpu(dip->di_gen); ip->i_d.di_flushiter = be16_to_cpu(dip->di_flushiter); - if (dip->di_version == 3) { - ip->i_d.di_ino = be64_to_cpu(dip->di_ino); - uuid_copy(&ip->i_d.di_uuid, &dip->di_uuid); - } - /* * Make sure to pull in the mode here as well in * case the inode is released without being used. @@ -523,7 +511,6 @@ xfs_iread( */ if (ip->i_d.di_version == 1) { ip->i_d.di_version = 2; - memset(&(ip->i_d.di_pad[0]), 0, sizeof(ip->i_d.di_pad)); ip->i_d.di_nlink = ip->i_d.di_onlink; ip->i_d.di_onlink = 0; xfs_set_projid(&ip->i_d, 0); diff --git a/libxfs/xfs_inode_buf.h b/libxfs/xfs_inode_buf.h index 6242974..974d060 100644 --- a/libxfs/xfs_inode_buf.h +++ b/libxfs/xfs_inode_buf.h @@ -22,24 +22,22 @@ struct xfs_inode; struct xfs_dinode; /* - * In memory representation of the XFS inode. This is held in the in-core - * struct xfs_inode to represent the on disk values, but no longer needs to be - * identical to the on-disk structure as it is always translated to on-disk + * In memory representation of the XFS inode. This is held in the in-core struct + * xfs_inode and represents the current on disk values but the structure is not + * in on-disk format. That is, this structure is always translated to on-disk * format specific structures at the appropriate time. */ struct xfs_icdinode { - __uint16_t di_magic; /* inode magic # = XFS_DINODE_MAGIC */ __uint16_t di_mode; /* mode and type of file */ __int8_t di_version; /* inode version */ __int8_t di_format; /* format of di_c data */ __uint16_t di_onlink; /* old number of links to file */ + __uint16_t di_flushiter; /* incremented on flush */ __uint32_t di_uid; /* owner's user id */ __uint32_t di_gid; /* owner's group id */ __uint32_t di_nlink; /* number of links to file */ __uint16_t di_projid_lo; /* lower part of owner's project id */ __uint16_t di_projid_hi; /* higher part of owner's project id */ - __uint8_t di_pad[6]; /* unused, zeroed space */ - __uint16_t di_flushiter; /* incremented on flush */ xfs_fsize_t di_size; /* number of bytes in file */ xfs_rfsblock_t di_nblocks; /* # of direct & btree blocks used */ xfs_extlen_t di_extsize; /* basic/minimum extent size for file */ @@ -52,22 +50,10 @@ struct xfs_icdinode { __uint16_t di_flags; /* random flags, XFS_DIFLAG_... */ __uint32_t di_gen; /* generation number */ - /* di_next_unlinked is the only non-core field in the old dinode */ - xfs_agino_t di_next_unlinked;/* agi unlinked list ptr */ - - /* start of the extended dinode, writable fields */ - __uint32_t di_crc; /* CRC of the inode */ __uint64_t di_changecount; /* number of attribute changes */ - xfs_lsn_t di_lsn; /* flush sequence */ __uint64_t di_flags2; /* more random flags */ - __uint8_t di_pad2[16]; /* more padding for future expansion */ - /* fields only written to during inode creation */ xfs_ictimestamp_t di_crtime; /* time created */ - xfs_ino_t di_ino; /* inode number */ - uuid_t di_uuid; /* UUID of the filesystem */ - - /* structure must be padded to 64 bit alignment */ }; /* @@ -86,7 +72,8 @@ int xfs_imap_to_bp(struct xfs_mount *, struct xfs_trans *, int xfs_iread(struct xfs_mount *, struct xfs_trans *, struct xfs_inode *, uint); void xfs_dinode_calc_crc(struct xfs_mount *, struct xfs_dinode *); -void xfs_inode_to_disk(struct xfs_inode *ip, struct xfs_dinode *to); +void xfs_inode_to_disk(struct xfs_inode *ip, struct xfs_dinode *to, + xfs_lsn_t lsn); void xfs_inode_from_disk(struct xfs_inode *ip, struct xfs_dinode *from); void xfs_log_dinode_to_disk(struct xfs_log_dinode *from, struct xfs_dinode *to); diff --git a/repair/phase6.c b/repair/phase6.c index 3aa109d..00142e2 100644 --- a/repair/phase6.c +++ b/repair/phase6.c @@ -510,7 +510,6 @@ mk_rbmino(xfs_mount_t *mp) vers = xfs_sb_version_hascrc(&mp->m_sb) ? 3 : 2; memset(&ip->i_d, 0, sizeof(ip->i_d)); - ip->i_d.di_magic = XFS_DINODE_MAGIC; ip->i_d.di_mode = S_IFREG; ip->i_d.di_version = vers; ip->i_d.di_format = XFS_DINODE_FMT_EXTENTS; @@ -520,13 +519,8 @@ mk_rbmino(xfs_mount_t *mp) times = XFS_ICHGTIME_CHG | XFS_ICHGTIME_MOD; if (ip->i_d.di_version == 3) { - ip->i_d.di_crc = 0; ip->i_d.di_changecount = 1; - ip->i_d.di_lsn = 0; ip->i_d.di_flags2 = 0; - ip->i_d.di_ino = mp->m_sb.sb_rbmino; - memset(&(ip->i_d.di_pad2[0]), 0, sizeof(ip->i_d.di_pad2)); - platform_uuid_copy(&ip->i_d.di_uuid, &mp->m_sb.sb_meta_uuid); times |= XFS_ICHGTIME_CREATE; } libxfs_trans_ichgtime(tp, ip, times); @@ -769,7 +763,6 @@ mk_rsumino(xfs_mount_t *mp) vers = xfs_sb_version_hascrc(&mp->m_sb) ? 3 : 1; memset(&ip->i_d, 0, sizeof(ip->i_d)); - ip->i_d.di_magic = XFS_DINODE_MAGIC; ip->i_d.di_mode = S_IFREG; ip->i_d.di_version = vers; ip->i_d.di_format = XFS_DINODE_FMT_EXTENTS; @@ -779,13 +772,8 @@ mk_rsumino(xfs_mount_t *mp) times = XFS_ICHGTIME_CHG | XFS_ICHGTIME_MOD; if (ip->i_d.di_version == 3) { - ip->i_d.di_crc = 0; ip->i_d.di_changecount = 1; - ip->i_d.di_lsn = 0; ip->i_d.di_flags2 = 0; - ip->i_d.di_ino = mp->m_sb.sb_rsumino; - memset(&(ip->i_d.di_pad2[0]), 0, sizeof(ip->i_d.di_pad2)); - platform_uuid_copy(&ip->i_d.di_uuid, &mp->m_sb.sb_meta_uuid); times |= XFS_ICHGTIME_CREATE; } libxfs_trans_ichgtime(tp, ip, times); @@ -884,7 +872,6 @@ mk_root_dir(xfs_mount_t *mp) vers = xfs_sb_version_hascrc(&mp->m_sb) ? 3 : 2; memset(&ip->i_d, 0, sizeof(ip->i_d)); - ip->i_d.di_magic = XFS_DINODE_MAGIC; ip->i_d.di_mode = (__uint16_t) mode|S_IFDIR; ip->i_d.di_version = vers; ip->i_d.di_format = XFS_DINODE_FMT_EXTENTS; @@ -894,13 +881,8 @@ mk_root_dir(xfs_mount_t *mp) times = XFS_ICHGTIME_CHG | XFS_ICHGTIME_MOD; if (ip->i_d.di_version == 3) { - ip->i_d.di_crc = 0; ip->i_d.di_changecount = 1; - ip->i_d.di_lsn = 0; ip->i_d.di_flags2 = 0; - ip->i_d.di_ino = mp->m_sb.sb_rootino; - memset(&(ip->i_d.di_pad2[0]), 0, sizeof(ip->i_d.di_pad2)); - platform_uuid_copy(&ip->i_d.di_uuid, &mp->m_sb.sb_meta_uuid); times |= XFS_ICHGTIME_CREATE; } libxfs_trans_ichgtime(tp, ip, times); -- 2.7.0 From dave@fromorbit.com Wed Feb 17 01:21:23 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=ham version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay2.corp.sgi.com [137.38.102.29]) by oss.sgi.com (Postfix) with ESMTP id 4DD477CBE for ; Wed, 17 Feb 2016 01:21:23 -0600 (CST) Received: from cuda.sgi.com (cuda2.sgi.com [192.48.176.25]) by relay2.corp.sgi.com (Postfix) with ESMTP id 3FB83304043 for ; Tue, 16 Feb 2016 23:21:23 -0800 (PST) X-ASG-Debug-ID: 1455693674-04cbb0433414c090004-NocioJ Received: from ipmail05.adl6.internode.on.net (ipmail05.adl6.internode.on.net [150.101.137.143]) by cuda.sgi.com with ESMTP id 5GaBFvKV4C5qdx1y for ; Tue, 16 Feb 2016 23:21:20 -0800 (PST) X-Barracuda-Envelope-From: dave@fromorbit.com X-Barracuda-Apparent-Source-IP: 150.101.137.143 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: A2BRCQBoHsRWXJbY03ZegzqBP6ZgAQEBAQEBBpE6ihWBPk0BAQEBAQEHREBBEgGDbgEFJy8zCBgYARg5AwcUGYgZu2eFSoleGQkMg2YFh1IDhwWIKZxMjkeCGAELATwDGYFcKC6CYYRQgTABAQE Received: from ppp118-211-216-150.lns20.syd4.internode.on.net (HELO dastard) ([118.211.216.150]) by ipmail05.adl6.internode.on.net with ESMTP; 17 Feb 2016 17:50:55 +1030 Received: from disappointment.disaster.area ([192.168.1.110] helo=disappointment) by dastard with esmtp (Exim 4.80) (envelope-from ) id 1aVwPu-0004m3-RY for xfs@oss.sgi.com; Wed, 17 Feb 2016 18:20:54 +1100 Received: from dave by disappointment with local (Exim 4.86) (envelope-from ) id 1aVwPu-00014h-Qf for xfs@oss.sgi.com; Wed, 17 Feb 2016 18:20:54 +1100 From: Dave Chinner To: xfs@oss.sgi.com Subject: [PATCH 12/15] xfs: use vfs inode nlink field everywhere Date: Wed, 17 Feb 2016 18:20:49 +1100 X-ASG-Orig-Subj: [PATCH 12/15] xfs: use vfs inode nlink field everywhere Message-Id: <1455693652-3899-13-git-send-email-david@fromorbit.com> X-Mailer: git-send-email 2.7.0 In-Reply-To: <1455693652-3899-1-git-send-email-david@fromorbit.com> References: <1455693652-3899-1-git-send-email-david@fromorbit.com> X-Barracuda-Connect: ipmail05.adl6.internode.on.net[150.101.137.143] X-Barracuda-Start-Time: 1455693679 X-Barracuda-URL: https://192.48.176.25:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-BRTS-Status: 1 X-Barracuda-Spam-Score: 0.00 X-Barracuda-Spam-Status: No, SCORE=0.00 using per-user scores of TAG_LEVEL=1000.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.7 tests= X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.3.27096 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- From: Dave Chinner Source kernel commit 54d7b5c1d03e9711cce2d72237d5b3f5c87431f4 The VFS tracks the inode nlink just like the xfs_icdinode. We can remove the variable from the icdinode and use the VFS inode variable everywhere, reducing the size of the xfs_icdinode by a further 4 bytes. Signed-off-by: Dave Chinner Reviewed-by: Brian Foster Reviewed-by: Christoph Hellwig Signed-off-by: Dave Chinner --- include/xfs_inode.h | 1 + libxfs/libxfs_api_defs.h | 4 ++++ libxfs/util.c | 5 ++--- libxfs/xfs_inode_buf.c | 6 +++--- libxfs/xfs_inode_buf.h | 1 - mkfs/proto.c | 4 ++-- repair/phase6.c | 18 +++++++++--------- repair/phase7.c | 43 ++++++++++++++----------------------------- 8 files changed, 35 insertions(+), 47 deletions(-) diff --git a/include/xfs_inode.h b/include/xfs_inode.h index 1efff0f..e7aa9e9 100644 --- a/include/xfs_inode.h +++ b/include/xfs_inode.h @@ -34,6 +34,7 @@ struct xfs_dir_ops; * metadata. */ struct inode { + uint32_t i_nlink; struct timespec i_atime; struct timespec i_mtime; struct timespec i_ctime; diff --git a/libxfs/libxfs_api_defs.h b/libxfs/libxfs_api_defs.h index 685c7a7..1408be3 100644 --- a/libxfs/libxfs_api_defs.h +++ b/libxfs/libxfs_api_defs.h @@ -108,4 +108,8 @@ #define xfs_verify_cksum libxfs_verify_cksum +/* inode link counts */ +#define set_nlink(inode, nlink) ({ (inode)->i_nlink = (nlink); }) +#define inc_nlink(inode) (inode)->i_nlink++ + #endif /* __LIBXFS_API_DEFS_H__ */ diff --git a/libxfs/util.c b/libxfs/util.c index bbaf790..9327a62 100644 --- a/libxfs/util.c +++ b/libxfs/util.c @@ -218,8 +218,7 @@ libxfs_ialloc( ASSERT(ip != NULL); ip->i_d.di_mode = (__uint16_t)mode; - ip->i_d.di_nlink = nlink; - ASSERT(ip->i_d.di_nlink == nlink); + set_nlink(VFS_I(ip), nlink); ip->i_d.di_uid = cr->cr_uid; ip->i_d.di_gid = cr->cr_gid; xfs_set_projid(&ip->i_d, pip ? 0 : fsx->fsx_projid); @@ -387,7 +386,7 @@ libxfs_iprint( printf(" Other inode\n"); break; } - printf(" di_nlink %x\n", dip->di_nlink); + printf(" di_nlink %x\n", VFS_I(ip)->i_nlink); printf(" di_uid %d\n", dip->di_uid); printf(" di_gid %d\n", dip->di_gid); printf(" di_nextents %d\n", dip->di_nextents); diff --git a/libxfs/xfs_inode_buf.c b/libxfs/xfs_inode_buf.c index 66a827a..dba8a4b 100644 --- a/libxfs/xfs_inode_buf.c +++ b/libxfs/xfs_inode_buf.c @@ -219,12 +219,12 @@ xfs_inode_from_disk( * minimum inode version format we support in the rest of the code. */ if (to->di_version == 1) { - to->di_nlink = be16_to_cpu(from->di_onlink); + set_nlink(inode, be16_to_cpu(from->di_onlink)); to->di_projid_lo = 0; to->di_projid_hi = 0; to->di_version = 2; } else { - to->di_nlink = be32_to_cpu(from->di_nlink); + set_nlink(inode, be32_to_cpu(from->di_nlink)); to->di_projid_lo = be16_to_cpu(from->di_projid_lo); to->di_projid_hi = be16_to_cpu(from->di_projid_hi); } @@ -284,7 +284,6 @@ xfs_inode_to_disk( to->di_format = from->di_format; to->di_uid = cpu_to_be32(from->di_uid); to->di_gid = cpu_to_be32(from->di_gid); - to->di_nlink = cpu_to_be32(from->di_nlink); to->di_projid_lo = cpu_to_be16(from->di_projid_lo); to->di_projid_hi = cpu_to_be16(from->di_projid_hi); @@ -295,6 +294,7 @@ xfs_inode_to_disk( to->di_mtime.t_nsec = cpu_to_be32(inode->i_mtime.tv_nsec); to->di_ctime.t_sec = cpu_to_be32(inode->i_ctime.tv_sec); to->di_ctime.t_nsec = cpu_to_be32(inode->i_ctime.tv_nsec); + to->di_nlink = cpu_to_be32(inode->i_nlink); to->di_size = cpu_to_be64(from->di_size); to->di_nblocks = cpu_to_be64(from->di_nblocks); diff --git a/libxfs/xfs_inode_buf.h b/libxfs/xfs_inode_buf.h index 489b96e..ccc4052 100644 --- a/libxfs/xfs_inode_buf.h +++ b/libxfs/xfs_inode_buf.h @@ -34,7 +34,6 @@ struct xfs_icdinode { __uint16_t di_flushiter; /* incremented on flush */ __uint32_t di_uid; /* owner's user id */ __uint32_t di_gid; /* owner's group id */ - __uint32_t di_nlink; /* number of links to file */ __uint16_t di_projid_lo; /* lower part of owner's project id */ __uint16_t di_projid_hi; /* higher part of owner's project id */ xfs_fsize_t di_size; /* number of bytes in file */ diff --git a/mkfs/proto.c b/mkfs/proto.c index 72a1576..9550859 100644 --- a/mkfs/proto.c +++ b/mkfs/proto.c @@ -546,7 +546,7 @@ parseproto( &creds, fsxp, &ip); if (error) fail(_("Inode allocation failed"), error); - ip->i_d.di_nlink++; /* account for . */ + ip->i_vnode.i_nlink++; /* account for . */ if (!pip) { pip = ip; mp->m_sb.sb_rootino = ip->i_ino; @@ -557,7 +557,7 @@ parseproto( xname.type = XFS_DIR3_FT_DIR; newdirent(mp, tp, pip, &xname, ip->i_ino, &first, &flist); - pip->i_d.di_nlink++; + pip->i_vnode.i_nlink++; libxfs_trans_log_inode(tp, pip, XFS_ILOG_CORE); } newdirectory(mp, tp, ip, pip); diff --git a/repair/phase6.c b/repair/phase6.c index 00142e2..7e14346 100644 --- a/repair/phase6.c +++ b/repair/phase6.c @@ -515,7 +515,7 @@ mk_rbmino(xfs_mount_t *mp) ip->i_d.di_format = XFS_DINODE_FMT_EXTENTS; ip->i_d.di_aformat = XFS_DINODE_FMT_EXTENTS; - ip->i_d.di_nlink = 1; /* account for sb ptr */ + set_nlink(VFS_I(ip), 1); /* account for sb ptr */ times = XFS_ICHGTIME_CHG | XFS_ICHGTIME_MOD; if (ip->i_d.di_version == 3) { @@ -768,7 +768,7 @@ mk_rsumino(xfs_mount_t *mp) ip->i_d.di_format = XFS_DINODE_FMT_EXTENTS; ip->i_d.di_aformat = XFS_DINODE_FMT_EXTENTS; - ip->i_d.di_nlink = 1; /* account for sb ptr */ + set_nlink(VFS_I(ip), 1); /* account for sb ptr */ times = XFS_ICHGTIME_CHG | XFS_ICHGTIME_MOD; if (ip->i_d.di_version == 3) { @@ -877,7 +877,7 @@ mk_root_dir(xfs_mount_t *mp) ip->i_d.di_format = XFS_DINODE_FMT_EXTENTS; ip->i_d.di_aformat = XFS_DINODE_FMT_EXTENTS; - ip->i_d.di_nlink = 1; /* account for . */ + set_nlink(VFS_I(ip), 1); /* account for . */ times = XFS_ICHGTIME_CHG | XFS_ICHGTIME_MOD; if (ip->i_d.di_version == 3) { @@ -976,7 +976,7 @@ mk_orphanage(xfs_mount_t *mp) do_error(_("%s inode allocation failed %d\n"), ORPHANAGE, error); } - ip->i_d.di_nlink++; /* account for . */ + inc_nlink(VFS_I(ip)); /* account for . */ ino = ip->i_ino; irec = find_inode_rec(mp, @@ -1027,7 +1027,7 @@ mk_orphanage(xfs_mount_t *mp) * bump up the link count in the root directory to account * for .. in the new directory */ - pip->i_d.di_nlink++; + inc_nlink(VFS_I(pip)); add_inode_ref(find_inode_rec(mp, XFS_INO_TO_AGNO(mp, mp->m_sb.sb_rootino), XFS_INO_TO_AGINO(mp, mp->m_sb.sb_rootino)), 0); @@ -1133,7 +1133,7 @@ mv_orphanage( if (irec) add_inode_ref(irec, ino_offset); else - orphanage_ip->i_d.di_nlink++; + inc_nlink(VFS_I(orphanage_ip)); libxfs_trans_log_inode(tp, orphanage_ip, XFS_ILOG_CORE); err = -libxfs_dir_createname(tp, ino_p, &xfs_name_dotdot, @@ -1143,7 +1143,7 @@ mv_orphanage( _("creation of .. entry failed (%d), filesystem may be out of space\n"), err); - ino_p->i_d.di_nlink++; + inc_nlink(VFS_I(ino_p)); libxfs_trans_log_inode(tp, ino_p, XFS_ILOG_CORE); err = -libxfs_bmap_finish(&tp, &flist, ino_p); @@ -1176,7 +1176,7 @@ mv_orphanage( if (irec) add_inode_ref(irec, ino_offset); else - orphanage_ip->i_d.di_nlink++; + inc_nlink(VFS_I(orphanage_ip)); libxfs_trans_log_inode(tp, orphanage_ip, XFS_ILOG_CORE); /* @@ -1229,7 +1229,7 @@ mv_orphanage( ORPHANAGE, err); ASSERT(err == 0); - ino_p->i_d.di_nlink = 1; + set_nlink(VFS_I(ino_p), 1); libxfs_trans_log_inode(tp, ino_p, XFS_ILOG_CORE); err = -libxfs_bmap_finish(&tp, &flist, ino_p); diff --git a/repair/phase7.c b/repair/phase7.c index 72a8ade..3e234b9 100644 --- a/repair/phase7.c +++ b/repair/phase7.c @@ -28,31 +28,6 @@ #include "progress.h" #include "threads.h" -/* dinoc is a pointer to the IN-CORE dinode core */ -static void -set_nlinks( - struct xfs_icdinode *dinoc, - xfs_ino_t ino, - __uint32_t nrefs, - int *dirty) -{ - if (dinoc->di_nlink == nrefs) - return; - - if (!no_modify) { - *dirty = 1; - do_warn(_("resetting inode %" PRIu64 " nlinks from %u to %u\n"), - ino, dinoc->di_nlink, nrefs); - - ASSERT(dinoc->di_version > 1); - dinoc->di_nlink = nrefs; - } else { - do_warn( -_("would have reset inode %" PRIu64 " nlinks from %u to %u\n"), - ino, dinoc->di_nlink, nrefs); - } -} - static void update_inode_nlinks( xfs_mount_t *mp, @@ -88,10 +63,20 @@ update_inode_nlinks( dirty = 0; - /* - * compare and set links for all inodes - */ - set_nlinks(&ip->i_d, ino, nlinks, &dirty); + /* compare and set links if they differ. */ + if (VFS_I(ip)->i_nlink != nlinks) { + if (!no_modify) { + do_warn( + _("resetting inode %" PRIu64 " nlinks from %u to %u\n"), + ino, VFS_I(ip)->i_nlink, nlinks); + set_nlink(VFS_I(ip), nlinks); + dirty = 1; + } else { + do_warn( + _("would have reset inode %" PRIu64 " nlinks from %u to %u\n"), + ino, VFS_I(ip)->i_nlink, nlinks); + } + } if (!dirty) { libxfs_trans_cancel(tp); -- 2.7.0 From dave@fromorbit.com Wed Feb 17 01:21:23 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=ham version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay1.corp.sgi.com [137.38.102.111]) by oss.sgi.com (Postfix) with ESMTP id 7535A7F4E for ; Wed, 17 Feb 2016 01:21:23 -0600 (CST) Received: from cuda.sgi.com (cuda2.sgi.com [192.48.176.25]) by relay1.corp.sgi.com (Postfix) with ESMTP id 64CBE8F8033 for ; Tue, 16 Feb 2016 23:21:23 -0800 (PST) X-ASG-Debug-ID: 1455693671-04cbb0433114c080005-NocioJ Received: from ipmail05.adl6.internode.on.net (ipmail05.adl6.internode.on.net [150.101.137.143]) by cuda.sgi.com with ESMTP id mIwZJExc2BTKBiYh for ; Tue, 16 Feb 2016 23:21:20 -0800 (PST) X-Barracuda-Envelope-From: dave@fromorbit.com X-Barracuda-Apparent-Source-IP: 150.101.137.143 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: A2BQCQBoHsRWXJbY03ZegzqBP6ZgAQEBAQEBBpE6ihWBPk0BAQEBAQEHREBBEgGDbgEFJy8zCBgxOQMHFBmIGbtnhUqJXoQUBZcDjzWNF0SFLYhWghgBCwE8AxmBXCgugmGGAAEBAQ Received: from ppp118-211-216-150.lns20.syd4.internode.on.net (HELO dastard) ([118.211.216.150]) by ipmail05.adl6.internode.on.net with ESMTP; 17 Feb 2016 17:50:55 +1030 Received: from disappointment.disaster.area ([192.168.1.110] helo=disappointment) by dastard with esmtp (Exim 4.80) (envelope-from ) id 1aVwPu-0004m8-TF for xfs@oss.sgi.com; Wed, 17 Feb 2016 18:20:54 +1100 Received: from dave by disappointment with local (Exim 4.86) (envelope-from ) id 1aVwPu-00014w-SJ for xfs@oss.sgi.com; Wed, 17 Feb 2016 18:20:54 +1100 From: Dave Chinner To: xfs@oss.sgi.com Subject: [PATCH 15/15] xfs: mode di_mode to vfs inode Date: Wed, 17 Feb 2016 18:20:52 +1100 X-ASG-Orig-Subj: [PATCH 15/15] xfs: mode di_mode to vfs inode Message-Id: <1455693652-3899-16-git-send-email-david@fromorbit.com> X-Mailer: git-send-email 2.7.0 In-Reply-To: <1455693652-3899-1-git-send-email-david@fromorbit.com> References: <1455693652-3899-1-git-send-email-david@fromorbit.com> X-Barracuda-Connect: ipmail05.adl6.internode.on.net[150.101.137.143] X-Barracuda-Start-Time: 1455693679 X-Barracuda-URL: https://192.48.176.25:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-BRTS-Status: 1 X-Barracuda-Spam-Score: 0.00 X-Barracuda-Spam-Status: No, SCORE=0.00 using per-user scores of TAG_LEVEL=1000.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.7 tests= X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.3.27096 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- From: Dave Chinner Source kernel commit c19b3b05ae440de50fffe2ac2a9b27392a7448e9 Move the di_mode value from the xfs_icdinode to the VFS inode, reducing the xfs_icdinode byte another 2 bytes and collapsing another 2 byte hole in the structure. Signed-off-by: Dave Chinner Reviewed-by: Brian Foster Reviewed-by: Christoph Hellwig Signed-off-by: Dave Chinner --- db/check.c | 18 ++++++++++-------- include/xfs_inode.h | 16 +++++++++++++++- libxfs/rdwr.c | 4 ++-- libxfs/util.c | 17 ++++++++--------- libxfs/xfs_bmap.c | 6 +++--- libxfs/xfs_dir2.c | 12 ++++++------ libxfs/xfs_inode_buf.c | 8 ++++---- libxfs/xfs_inode_buf.h | 1 - libxfs/xfs_inode_fork.c | 2 +- mkfs/proto.c | 6 +++--- repair/phase6.c | 8 ++++---- 11 files changed, 56 insertions(+), 42 deletions(-) diff --git a/db/check.c b/db/check.c index 412ab3d..36a0f64 100644 --- a/db/check.c +++ b/db/check.c @@ -2636,6 +2636,7 @@ process_inode( xfs_qcnt_t rc = 0; xfs_dqid_t dqprid; int v = 0; + mode_t mode; static char okfmts[] = { 0, /* type 0 unused */ 1 << XFS_DINODE_FMT_DEV, /* FIFO */ @@ -2699,10 +2700,10 @@ process_inode( be32_to_cpu(dip->di_nlink), ino); error++; } - if (xino.i_d.di_mode != 0) { + if (dip->di_mode != 0) { if (v) dbprintf(_("bad mode %#o for free inode %lld\n"), - xino.i_d.di_mode, ino); + be16_to_cpu(dip->di_mode), ino); error++; } return; @@ -2717,11 +2718,12 @@ process_inode( /* * di_mode is a 16-bit uint so no need to check the < 0 case */ - if ((((xino.i_d.di_mode & S_IFMT) >> 12) > 15) || - (!(okfmts[(xino.i_d.di_mode & S_IFMT) >> 12] & (1 << xino.i_d.di_format)))) { + mode = be16_to_cpu(dip->di_mode); + if ((((mode & S_IFMT) >> 12) > 15) || + (!(okfmts[(mode & S_IFMT) >> 12] & (1 << xino.i_d.di_format)))) { if (v) dbprintf(_("bad format %d for inode %lld type %#o\n"), - xino.i_d.di_format, id->ino, xino.i_d.di_mode & S_IFMT); + xino.i_d.di_format, id->ino, mode & S_IFMT); error++; return; } @@ -2744,7 +2746,7 @@ process_inode( dbprintf(_("inode %lld mode %#o fmt %s " "afmt %s " "nex %d anex %d nblk %lld sz %lld%s%s%s%s%s%s%s\n"), - id->ino, xino.i_d.di_mode, fmtnames[(int)xino.i_d.di_format], + id->ino, mode, fmtnames[(int)xino.i_d.di_format], fmtnames[(int)xino.i_d.di_aformat], xino.i_d.di_nextents, xino.i_d.di_anextents, @@ -2757,7 +2759,7 @@ process_inode( xino.i_d.di_flags & XFS_DIFLAG_NOATIME ? " noa" : "", xino.i_d.di_flags & XFS_DIFLAG_NODUMP ? " nod" : ""); security = 0; - switch (xino.i_d.di_mode & S_IFMT) { + switch (mode & S_IFMT) { case S_IFDIR: type = DBM_DIR; if (xino.i_d.di_format == XFS_DINODE_FMT_LOCAL) @@ -2785,7 +2787,7 @@ process_inode( } else type = DBM_DATA; - if (xino.i_d.di_mode & (S_ISUID | S_ISGID)) + if (mode & (S_ISUID | S_ISGID)) security = 1; break; case S_IFLNK: diff --git a/include/xfs_inode.h b/include/xfs_inode.h index 0290f97..d6990e5 100644 --- a/include/xfs_inode.h +++ b/include/xfs_inode.h @@ -34,6 +34,7 @@ struct xfs_dir_ops; * metadata. */ struct inode { + mode_t i_mode; uint32_t i_nlink; uint32_t i_generation; uint64_t i_version; @@ -65,13 +66,26 @@ static inline struct inode *VFS_I(struct xfs_inode *ip) } /* + * wrappers around the mode checks to simplify code + */ +static inline bool XFS_ISREG(struct xfs_inode *ip) +{ + return S_ISREG(VFS_I(ip)->i_mode); +} + +static inline bool XFS_ISDIR(struct xfs_inode *ip) +{ + return S_ISDIR(VFS_I(ip)->i_mode); +} + +/* * For regular files we only update the on-disk filesize when actually * writing data back to disk. Until then only the copy in the VFS inode * is uptodate. */ static inline xfs_fsize_t XFS_ISIZE(struct xfs_inode *ip) { - if (S_ISREG(ip->i_d.di_mode)) + if (XFS_ISREG(ip)) return ip->i_size; return ip->i_d.di_size; } diff --git a/libxfs/rdwr.c b/libxfs/rdwr.c index 3522c26..0ec38c5 100644 --- a/libxfs/rdwr.c +++ b/libxfs/rdwr.c @@ -1351,7 +1351,7 @@ libxfs_iget(xfs_mount_t *mp, xfs_trans_t *tp, xfs_ino_t ino, uint lock_flags, /* * set up the inode ops structure that the libxfs code relies on */ - if (S_ISDIR(ip->i_d.di_mode)) + if (XFS_ISDIR(ip)) ip->d_ops = mp->m_dir_inode_ops; else ip->d_ops = mp->m_nondir_inode_ops; @@ -1363,7 +1363,7 @@ libxfs_iget(xfs_mount_t *mp, xfs_trans_t *tp, xfs_ino_t ino, uint lock_flags, static void libxfs_idestroy(xfs_inode_t *ip) { - switch (ip->i_d.di_mode & S_IFMT) { + switch (VFS_I(ip)->i_mode & S_IFMT) { case S_IFREG: case S_IFDIR: case S_IFLNK: diff --git a/libxfs/util.c b/libxfs/util.c index 9c2f1d2..576f954 100644 --- a/libxfs/util.c +++ b/libxfs/util.c @@ -217,7 +217,7 @@ libxfs_ialloc( return error; ASSERT(ip != NULL); - ip->i_d.di_mode = (__uint16_t)mode; + VFS_I(ip)->i_mode = mode; set_nlink(VFS_I(ip), nlink); ip->i_d.di_uid = cr->cr_uid; ip->i_d.di_gid = cr->cr_gid; @@ -238,10 +238,10 @@ libxfs_ialloc( */ } - if (pip && (pip->i_d.di_mode & S_ISGID)) { + if (pip && (VFS_I(pip)->i_mode & S_ISGID)) { ip->i_d.di_gid = pip->i_d.di_gid; - if ((pip->i_d.di_mode & S_ISGID) && (mode & S_IFMT) == S_IFDIR) - ip->i_d.di_mode |= S_ISGID; + if ((VFS_I(pip)->i_mode & S_ISGID) && (mode & S_IFMT) == S_IFDIR) + VFS_I(ip)->i_mode |= S_ISGID; } ip->i_d.di_size = 0; @@ -316,7 +316,7 @@ libxfs_ialloc( /* * set up the inode ops structure that the libxfs code relies on */ - if (S_ISDIR(ip->i_d.di_mode)) + if (XFS_ISDIR(ip)) ip->d_ops = ip->i_mount->m_dir_inode_ops; else ip->d_ops = ip->i_mount->m_nondir_inode_ops; @@ -367,7 +367,7 @@ libxfs_iprint( dip = &ip->i_d; printf("\nOn disk portion\n"); - printf(" di_mode %o\n", dip->di_mode); + printf(" di_mode %o\n", VFS_I(ip)->i_mode); printf(" di_version %x\n", (uint)dip->di_version); switch (ip->i_d.di_format) { case XFS_DINODE_FMT_LOCAL: @@ -417,11 +417,10 @@ libxfs_iflush_int(xfs_inode_t *ip, xfs_buf_t *bp) dip = xfs_buf_offset(bp, ip->i_imap.im_boffset); ASSERT(ip->i_d.di_magic == XFS_DINODE_MAGIC); - if ((ip->i_d.di_mode & S_IFMT) == S_IFREG) { + if (XFS_ISREG(ip)) { ASSERT( (ip->i_d.di_format == XFS_DINODE_FMT_EXTENTS) || (ip->i_d.di_format == XFS_DINODE_FMT_BTREE) ); - } - else if ((ip->i_d.di_mode & S_IFMT) == S_IFDIR) { + } else if (XFS_ISDIR(ip) == S_IFDIR) { ASSERT( (ip->i_d.di_format == XFS_DINODE_FMT_EXTENTS) || (ip->i_d.di_format == XFS_DINODE_FMT_BTREE) || (ip->i_d.di_format == XFS_DINODE_FMT_LOCAL) ); diff --git a/libxfs/xfs_bmap.c b/libxfs/xfs_bmap.c index 8cb89bc..40286e4 100644 --- a/libxfs/xfs_bmap.c +++ b/libxfs/xfs_bmap.c @@ -904,7 +904,7 @@ xfs_bmap_local_to_extents( * We don't want to deal with the case of keeping inode data inline yet. * So sending the data fork of a regular inode is invalid. */ - ASSERT(!(S_ISREG(ip->i_d.di_mode) && whichfork == XFS_DATA_FORK)); + ASSERT(!(S_ISREG(VFS_I(ip)->i_mode) && whichfork == XFS_DATA_FORK)); ifp = XFS_IFORK_PTR(ip, whichfork); ASSERT(XFS_IFORK_FORMAT(ip, whichfork) == XFS_DINODE_FMT_LOCAL); @@ -1071,7 +1071,7 @@ xfs_bmap_add_attrfork_local( if (ip->i_df.if_bytes <= XFS_IFORK_DSIZE(ip)) return 0; - if (S_ISDIR(ip->i_d.di_mode)) { + if (S_ISDIR(VFS_I(ip)->i_mode)) { memset(&dargs, 0, sizeof(dargs)); dargs.geo = ip->i_mount->m_dir_geo; dargs.dp = ip; @@ -1083,7 +1083,7 @@ xfs_bmap_add_attrfork_local( return xfs_dir2_sf_to_block(&dargs); } - if (S_ISLNK(ip->i_d.di_mode)) + if (S_ISLNK(VFS_I(ip)->i_mode)) return xfs_bmap_local_to_extents(tp, ip, firstblock, 1, flags, XFS_DATA_FORK, xfs_symlink_local_to_remote); diff --git a/libxfs/xfs_dir2.c b/libxfs/xfs_dir2.c index 89b4781..723b267 100644 --- a/libxfs/xfs_dir2.c +++ b/libxfs/xfs_dir2.c @@ -174,7 +174,7 @@ xfs_dir_isempty( { xfs_dir2_sf_hdr_t *sfp; - ASSERT(S_ISDIR(dp->i_d.di_mode)); + ASSERT(S_ISDIR(VFS_I(dp)->i_mode)); if (dp->i_d.di_size == 0) /* might happen during shutdown. */ return 1; if (dp->i_d.di_size > XFS_IFORK_DSIZE(dp)) @@ -229,7 +229,7 @@ xfs_dir_init( struct xfs_da_args *args; int error; - ASSERT(S_ISDIR(dp->i_d.di_mode)); + ASSERT(S_ISDIR(VFS_I(dp)->i_mode)); error = xfs_dir_ino_validate(tp->t_mountp, pdp->i_ino); if (error) return error; @@ -264,7 +264,7 @@ xfs_dir_createname( int rval; int v; /* type-checking value */ - ASSERT(S_ISDIR(dp->i_d.di_mode)); + ASSERT(S_ISDIR(VFS_I(dp)->i_mode)); if (inum) { rval = xfs_dir_ino_validate(tp->t_mountp, inum); if (rval) @@ -362,7 +362,7 @@ xfs_dir_lookup( int v; /* type-checking value */ int lock_mode; - ASSERT(S_ISDIR(dp->i_d.di_mode)); + ASSERT(S_ISDIR(VFS_I(dp)->i_mode)); XFS_STATS_INC(dp->i_mount, xs_dir_lookup); /* @@ -441,7 +441,7 @@ xfs_dir_removename( int rval; int v; /* type-checking value */ - ASSERT(S_ISDIR(dp->i_d.di_mode)); + ASSERT(S_ISDIR(VFS_I(dp)->i_mode)); XFS_STATS_INC(dp->i_mount, xs_dir_remove); args = kmem_zalloc(sizeof(*args), KM_SLEEP | KM_NOFS); @@ -503,7 +503,7 @@ xfs_dir_replace( int rval; int v; /* type-checking value */ - ASSERT(S_ISDIR(dp->i_d.di_mode)); + ASSERT(S_ISDIR(VFS_I(dp)->i_mode)); rval = xfs_dir_ino_validate(tp->t_mountp, inum); if (rval) diff --git a/libxfs/xfs_inode_buf.c b/libxfs/xfs_inode_buf.c index da9edcd..e3d674d 100644 --- a/libxfs/xfs_inode_buf.c +++ b/libxfs/xfs_inode_buf.c @@ -211,13 +211,12 @@ xfs_inode_from_disk( struct xfs_icdinode *to = &ip->i_d; struct inode *inode = VFS_I(ip); - to->di_mode = be16_to_cpu(from->di_mode); - to->di_version = from ->di_version; /* * Convert v1 inodes immediately to v2 inode format as this is the * minimum inode version format we support in the rest of the code. */ + to->di_version = from->di_version; if (to->di_version == 1) { set_nlink(inode, be16_to_cpu(from->di_onlink)); to->di_projid_lo = 0; @@ -247,6 +246,7 @@ xfs_inode_from_disk( inode->i_ctime.tv_sec = (int)be32_to_cpu(from->di_ctime.t_sec); inode->i_ctime.tv_nsec = (int)be32_to_cpu(from->di_ctime.t_nsec); inode->i_generation = be32_to_cpu(from->di_gen); + inode->i_mode = be16_to_cpu(from->di_mode); to->di_size = be64_to_cpu(from->di_size); to->di_nblocks = be64_to_cpu(from->di_nblocks); @@ -279,7 +279,6 @@ xfs_inode_to_disk( to->di_magic = cpu_to_be16(XFS_DINODE_MAGIC); to->di_onlink = 0; - to->di_mode = cpu_to_be16(from->di_mode); to->di_version = from->di_version; to->di_format = from->di_format; to->di_uid = cpu_to_be32(from->di_uid); @@ -296,6 +295,7 @@ xfs_inode_to_disk( to->di_ctime.t_nsec = cpu_to_be32(inode->i_ctime.tv_nsec); to->di_nlink = cpu_to_be32(inode->i_nlink); to->di_gen = cpu_to_be32(inode->i_generation); + to->di_mode = cpu_to_be16(inode->i_mode); to->di_size = cpu_to_be64(from->di_size); to->di_nblocks = cpu_to_be64(from->di_nblocks); @@ -510,7 +510,7 @@ xfs_iread( * the inode is already free and not try to mess * with the uninitialized part of it. */ - ip->i_d.di_mode = 0; + VFS_I(ip)->i_mode = 0; } ASSERT(ip->i_d.di_version >= 2); diff --git a/libxfs/xfs_inode_buf.h b/libxfs/xfs_inode_buf.h index ad98fdd..4ece9bf 100644 --- a/libxfs/xfs_inode_buf.h +++ b/libxfs/xfs_inode_buf.h @@ -28,7 +28,6 @@ struct xfs_dinode; * format specific structures at the appropriate time. */ struct xfs_icdinode { - __uint16_t di_mode; /* mode and type of file */ __int8_t di_version; /* inode version */ __int8_t di_format; /* format of di_c data */ __uint16_t di_flushiter; /* incremented on flush */ diff --git a/libxfs/xfs_inode_fork.c b/libxfs/xfs_inode_fork.c index f40649e..2af1dba 100644 --- a/libxfs/xfs_inode_fork.c +++ b/libxfs/xfs_inode_fork.c @@ -117,7 +117,7 @@ xfs_iformat_fork( return -EFSCORRUPTED; } - switch (ip->i_d.di_mode & S_IFMT) { + switch (VFS_I(ip)->i_mode & S_IFMT) { case S_IFIFO: case S_IFCHR: case S_IFBLK: diff --git a/mkfs/proto.c b/mkfs/proto.c index 9550859..4fc1f3c 100644 --- a/mkfs/proto.c +++ b/mkfs/proto.c @@ -198,7 +198,7 @@ rsvfile( libxfs_trans_ijoin(tp, ip, 0); - ip->i_d.di_mode &= ~S_ISUID; + VFS_I(ip)->i_mode &= ~S_ISUID; /* * Note that we don't have to worry about mandatory @@ -207,8 +207,8 @@ rsvfile( * on, but if it was on then mandatory locking wouldn't * have been enabled. */ - if (ip->i_d.di_mode & S_IXGRP) - ip->i_d.di_mode &= ~S_ISGID; + if (VFS_I(ip)->i_mode & S_IXGRP) + VFS_I(ip)->i_mode &= ~S_ISGID; libxfs_trans_ichgtime(tp, ip, XFS_ICHGTIME_MOD | XFS_ICHGTIME_CHG); diff --git a/repair/phase6.c b/repair/phase6.c index 7415199..0a71164 100644 --- a/repair/phase6.c +++ b/repair/phase6.c @@ -510,7 +510,7 @@ mk_rbmino(xfs_mount_t *mp) vers = xfs_sb_version_hascrc(&mp->m_sb) ? 3 : 2; memset(&ip->i_d, 0, sizeof(ip->i_d)); - ip->i_d.di_mode = S_IFREG; + VFS_I(ip)->i_mode = S_IFREG; ip->i_d.di_version = vers; ip->i_d.di_format = XFS_DINODE_FMT_EXTENTS; ip->i_d.di_aformat = XFS_DINODE_FMT_EXTENTS; @@ -763,7 +763,7 @@ mk_rsumino(xfs_mount_t *mp) vers = xfs_sb_version_hascrc(&mp->m_sb) ? 3 : 1; memset(&ip->i_d, 0, sizeof(ip->i_d)); - ip->i_d.di_mode = S_IFREG; + VFS_I(ip)->i_mode = S_IFREG; ip->i_d.di_version = vers; ip->i_d.di_format = XFS_DINODE_FMT_EXTENTS; ip->i_d.di_aformat = XFS_DINODE_FMT_EXTENTS; @@ -872,7 +872,7 @@ mk_root_dir(xfs_mount_t *mp) vers = xfs_sb_version_hascrc(&mp->m_sb) ? 3 : 2; memset(&ip->i_d, 0, sizeof(ip->i_d)); - ip->i_d.di_mode = (__uint16_t) mode|S_IFDIR; + VFS_I(ip)->i_mode = mode|S_IFDIR; ip->i_d.di_version = vers; ip->i_d.di_format = XFS_DINODE_FMT_EXTENTS; ip->i_d.di_aformat = XFS_DINODE_FMT_EXTENTS; @@ -1097,7 +1097,7 @@ mv_orphanage( if ((err = -libxfs_iget(mp, NULL, ino, 0, &ino_p, 0))) do_error(_("%d - couldn't iget disconnected inode\n"), err); - xname.type = xfs_mode_to_ftype[(ino_p->i_d.di_mode & S_IFMT)>>S_SHIFT]; + xname.type = xfs_mode_to_ftype[(VFS_I(ino_p)->i_mode & S_IFMT)>>S_SHIFT]; if (isa_dir) { irec = find_inode_rec(mp, XFS_INO_TO_AGNO(mp, orphanage_ino), -- 2.7.0 From dave@fromorbit.com Wed Feb 17 01:21:24 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=ham version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay1.corp.sgi.com [137.38.102.111]) by oss.sgi.com (Postfix) with ESMTP id AD73F7F52 for ; Wed, 17 Feb 2016 01:21:23 -0600 (CST) Received: from cuda.sgi.com (cuda1.sgi.com [192.48.157.11]) by relay1.corp.sgi.com (Postfix) with ESMTP id 3D23C8F8035 for ; Tue, 16 Feb 2016 23:21:23 -0800 (PST) X-ASG-Debug-ID: 1455693670-04bdf02d5c64b50003-NocioJ Received: from ipmail05.adl6.internode.on.net (ipmail05.adl6.internode.on.net [150.101.137.143]) by cuda.sgi.com with ESMTP id 9L7fMs6hoFBjYRcm for ; Tue, 16 Feb 2016 23:21:19 -0800 (PST) X-Barracuda-Envelope-From: dave@fromorbit.com X-Barracuda-Apparent-Source-IP: 150.101.137.143 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: A2BQCQBoHsRWXJbY03ZegzqBP6ZgAQEBAQEBBpE6ihWBPk0BAQEBAQEHREBBEgGDbgEFJy8zCBgxOQMHFBmIGbtnhUqJXoQUBYdVjy6PNY0XhXGIVoIYAQsBPAMZgVwoLoJhhgABAQE Received: from ppp118-211-216-150.lns20.syd4.internode.on.net (HELO dastard) ([118.211.216.150]) by ipmail05.adl6.internode.on.net with ESMTP; 17 Feb 2016 17:50:55 +1030 Received: from disappointment.disaster.area ([192.168.1.110] helo=disappointment) by dastard with esmtp (Exim 4.80) (envelope-from ) id 1aVwPu-0004m0-QF for xfs@oss.sgi.com; Wed, 17 Feb 2016 18:20:54 +1100 Received: from dave by disappointment with local (Exim 4.86) (envelope-from ) id 1aVwPu-00014S-PO for xfs@oss.sgi.com; Wed, 17 Feb 2016 18:20:54 +1100 From: Dave Chinner To: xfs@oss.sgi.com Subject: [PATCH 09/15] xfs: remove timestamps from incore inode Date: Wed, 17 Feb 2016 18:20:46 +1100 X-ASG-Orig-Subj: [PATCH 09/15] xfs: remove timestamps from incore inode Message-Id: <1455693652-3899-10-git-send-email-david@fromorbit.com> X-Mailer: git-send-email 2.7.0 In-Reply-To: <1455693652-3899-1-git-send-email-david@fromorbit.com> References: <1455693652-3899-1-git-send-email-david@fromorbit.com> X-Barracuda-Connect: ipmail05.adl6.internode.on.net[150.101.137.143] X-Barracuda-Start-Time: 1455693679 X-Barracuda-URL: https://192.48.157.11:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-BRTS-Status: 1 X-Barracuda-Spam-Score: 0.00 X-Barracuda-Spam-Status: No, SCORE=0.00 using per-user scores of TAG_LEVEL=1000.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.7 tests= X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.3.27096 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- From: Dave Chinner Source kernel commit 3987848c7c2be112e03c82d03821b044f1c0edec The struct xfs_inode has two copies of the current timestamps in it, one in the vfs inode and one in the struct xfs_icdinode. Now that we no longer log the struct xfs_icdinode directly, we don't need to keep the timestamps in this structure. instead we can copy them straight out of the VFS inode when formatting the inode log item or the on-disk inode. This reduces the struct xfs_inode in size by 24 bytes. Signed-off-by: Dave Chinner Reviewed-by: Brian Foster Reviewed-by: Christoph Hellwig Signed-off-by: Dave Chinner --- db/check.c | 106 +++++++++++++++++++++++------------------------ include/xfs_inode.h | 16 ++++++- libxfs/libxfs_api_defs.h | 4 +- libxfs/util.c | 17 ++++---- libxfs/xfs_inode_buf.c | 91 ++++++++++++++++++++++++++++++++++------ libxfs/xfs_inode_buf.h | 9 ++-- libxfs/xfs_rtbitmap.c | 2 +- mkfs/proto.c | 2 +- 8 files changed, 162 insertions(+), 85 deletions(-) diff --git a/db/check.c b/db/check.c index d6d1d57..2203f41 100644 --- a/db/check.c +++ b/db/check.c @@ -2619,7 +2619,7 @@ process_inode( { blkmap_t *blkmap; xfs_fsblock_t bno = 0; - struct xfs_icdinode idic; + struct xfs_inode xino; inodata_t *id = NULL; xfs_ino_t ino; xfs_extnum_t nextents = 0; @@ -2663,7 +2663,7 @@ process_inode( "dev", "local", "extents", "btree", "uuid" }; - libxfs_dinode_from_disk(&idic, dip); + libxfs_inode_from_disk(&xino, dip); ino = XFS_AGINO_TO_INO(mp, be32_to_cpu(agf->agf_seqno), agino); if (!isfree) { @@ -2672,42 +2672,42 @@ process_inode( blkmap = NULL; } v = (!sflag || (id && id->ilist) || CHECK_BLIST(bno)); - if (idic.di_magic != XFS_DINODE_MAGIC) { + if (xino.i_d.di_magic != XFS_DINODE_MAGIC) { if (isfree || v) dbprintf(_("bad magic number %#x for inode %lld\n"), - idic.di_magic, ino); + xino.i_d.di_magic, ino); error++; return; } - if (!xfs_dinode_good_version(mp, idic.di_version)) { + if (!xfs_dinode_good_version(mp, xino.i_d.di_version)) { if (isfree || v) dbprintf(_("bad version number %#x for inode %lld\n"), - idic.di_version, ino); + xino.i_d.di_version, ino); error++; return; } if (isfree) { - if (idic.di_nblocks != 0) { + if (xino.i_d.di_nblocks != 0) { if (v) dbprintf(_("bad nblocks %lld for free inode " "%lld\n"), - idic.di_nblocks, ino); + xino.i_d.di_nblocks, ino); error++; } - if (idic.di_version == 1) - nlink = idic.di_onlink; + if (xino.i_d.di_version == 1) + nlink = xino.i_d.di_onlink; else - nlink = idic.di_nlink; + nlink = xino.i_d.di_nlink; if (nlink != 0) { if (v) dbprintf(_("bad nlink %d for free inode %lld\n"), nlink, ino); error++; } - if (idic.di_mode != 0) { + if (xino.i_d.di_mode != 0) { if (v) dbprintf(_("bad mode %#o for free inode %lld\n"), - idic.di_mode, ino); + xino.i_d.di_mode, ino); error++; } return; @@ -2722,26 +2722,26 @@ process_inode( /* * di_mode is a 16-bit uint so no need to check the < 0 case */ - if ((((idic.di_mode & S_IFMT) >> 12) > 15) || - (!(okfmts[(idic.di_mode & S_IFMT) >> 12] & (1 << idic.di_format)))) { + if ((((xino.i_d.di_mode & S_IFMT) >> 12) > 15) || + (!(okfmts[(xino.i_d.di_mode & S_IFMT) >> 12] & (1 << xino.i_d.di_format)))) { if (v) dbprintf(_("bad format %d for inode %lld type %#o\n"), - idic.di_format, id->ino, idic.di_mode & S_IFMT); + xino.i_d.di_format, id->ino, xino.i_d.di_mode & S_IFMT); error++; return; } if ((unsigned int)XFS_DFORK_ASIZE(dip, mp) >= - XFS_LITINO(mp, idic.di_version)) { + XFS_LITINO(mp, xino.i_d.di_version)) { if (v) dbprintf(_("bad fork offset %d for inode %lld\n"), - idic.di_forkoff, id->ino); + xino.i_d.di_forkoff, id->ino); error++; return; } - if ((unsigned int)idic.di_aformat > XFS_DINODE_FMT_BTREE) { + if ((unsigned int)xino.i_d.di_aformat > XFS_DINODE_FMT_BTREE) { if (v) dbprintf(_("bad attribute format %d for inode %lld\n"), - idic.di_aformat, id->ino); + xino.i_d.di_aformat, id->ino); error++; return; } @@ -2749,48 +2749,48 @@ process_inode( dbprintf(_("inode %lld mode %#o fmt %s " "afmt %s " "nex %d anex %d nblk %lld sz %lld%s%s%s%s%s%s%s\n"), - id->ino, idic.di_mode, fmtnames[(int)idic.di_format], - fmtnames[(int)idic.di_aformat], - idic.di_nextents, - idic.di_anextents, - idic.di_nblocks, idic.di_size, - idic.di_flags & XFS_DIFLAG_REALTIME ? " rt" : "", - idic.di_flags & XFS_DIFLAG_PREALLOC ? " pre" : "", - idic.di_flags & XFS_DIFLAG_IMMUTABLE? " imm" : "", - idic.di_flags & XFS_DIFLAG_APPEND ? " app" : "", - idic.di_flags & XFS_DIFLAG_SYNC ? " syn" : "", - idic.di_flags & XFS_DIFLAG_NOATIME ? " noa" : "", - idic.di_flags & XFS_DIFLAG_NODUMP ? " nod" : ""); + id->ino, xino.i_d.di_mode, fmtnames[(int)xino.i_d.di_format], + fmtnames[(int)xino.i_d.di_aformat], + xino.i_d.di_nextents, + xino.i_d.di_anextents, + xino.i_d.di_nblocks, xino.i_d.di_size, + xino.i_d.di_flags & XFS_DIFLAG_REALTIME ? " rt" : "", + xino.i_d.di_flags & XFS_DIFLAG_PREALLOC ? " pre" : "", + xino.i_d.di_flags & XFS_DIFLAG_IMMUTABLE? " imm" : "", + xino.i_d.di_flags & XFS_DIFLAG_APPEND ? " app" : "", + xino.i_d.di_flags & XFS_DIFLAG_SYNC ? " syn" : "", + xino.i_d.di_flags & XFS_DIFLAG_NOATIME ? " noa" : "", + xino.i_d.di_flags & XFS_DIFLAG_NODUMP ? " nod" : ""); security = 0; - switch (idic.di_mode & S_IFMT) { + switch (xino.i_d.di_mode & S_IFMT) { case S_IFDIR: type = DBM_DIR; - if (idic.di_format == XFS_DINODE_FMT_LOCAL) + if (xino.i_d.di_format == XFS_DINODE_FMT_LOCAL) break; - blkmap = blkmap_alloc(idic.di_nextents); + blkmap = blkmap_alloc(xino.i_d.di_nextents); break; case S_IFREG: - if (idic.di_flags & XFS_DIFLAG_REALTIME) + if (xino.i_d.di_flags & XFS_DIFLAG_REALTIME) type = DBM_RTDATA; else if (id->ino == mp->m_sb.sb_rbmino) { type = DBM_RTBITMAP; - blkmap = blkmap_alloc(idic.di_nextents); + blkmap = blkmap_alloc(xino.i_d.di_nextents); addlink_inode(id); } else if (id->ino == mp->m_sb.sb_rsumino) { type = DBM_RTSUM; - blkmap = blkmap_alloc(idic.di_nextents); + blkmap = blkmap_alloc(xino.i_d.di_nextents); addlink_inode(id); } else if (id->ino == mp->m_sb.sb_uquotino || id->ino == mp->m_sb.sb_gquotino || id->ino == mp->m_sb.sb_pquotino) { type = DBM_QUOTA; - blkmap = blkmap_alloc(idic.di_nextents); + blkmap = blkmap_alloc(xino.i_d.di_nextents); addlink_inode(id); } else type = DBM_DATA; - if (idic.di_mode & (S_ISUID | S_ISGID)) + if (xino.i_d.di_mode & (S_ISUID | S_ISGID)) security = 1; break; case S_IFLNK: @@ -2801,13 +2801,13 @@ process_inode( type = DBM_UNKNOWN; break; } - if (idic.di_version == 1) - setlink_inode(id, idic.di_onlink, type == DBM_DIR, security); + if (xino.i_d.di_version == 1) + setlink_inode(id, xino.i_d.di_onlink, type == DBM_DIR, security); else { sbversion |= XFS_SB_VERSION_NLINKBIT; - setlink_inode(id, idic.di_nlink, type == DBM_DIR, security); + setlink_inode(id, xino.i_d.di_nlink, type == DBM_DIR, security); } - switch (idic.di_format) { + switch (xino.i_d.di_format) { case XFS_DINODE_FMT_LOCAL: process_lclinode(id, dip, type, &totdblocks, &totiblocks, &nextents, &blkmap, XFS_DATA_FORK); @@ -2823,7 +2823,7 @@ process_inode( } if (XFS_DFORK_Q(dip)) { sbversion |= XFS_SB_VERSION_ATTRBIT; - switch (idic.di_aformat) { + switch (xino.i_d.di_aformat) { case XFS_DINODE_FMT_LOCAL: process_lclinode(id, dip, DBM_ATTR, &atotdblocks, &atotiblocks, &anextents, NULL, XFS_ATTR_FORK); @@ -2859,30 +2859,30 @@ process_inode( break; } if (ic) { - dqprid = xfs_get_projid(&idic); /* dquot ID is u32 */ - quota_add(&dqprid, &idic.di_gid, &idic.di_uid, + dqprid = xfs_get_projid(&xino.i_d); /* dquot ID is u32 */ + quota_add(&dqprid, &xino.i_d.di_gid, &xino.i_d.di_uid, 0, bc, ic, rc); } } totblocks = totdblocks + totiblocks + atotdblocks + atotiblocks; - if (totblocks != idic.di_nblocks) { + if (totblocks != xino.i_d.di_nblocks) { if (v) dbprintf(_("bad nblocks %lld for inode %lld, counted " "%lld\n"), - idic.di_nblocks, id->ino, totblocks); + xino.i_d.di_nblocks, id->ino, totblocks); error++; } - if (nextents != idic.di_nextents) { + if (nextents != xino.i_d.di_nextents) { if (v) dbprintf(_("bad nextents %d for inode %lld, counted %d\n"), - idic.di_nextents, id->ino, nextents); + xino.i_d.di_nextents, id->ino, nextents); error++; } - if (anextents != idic.di_anextents) { + if (anextents != xino.i_d.di_anextents) { if (v) dbprintf(_("bad anextents %d for inode %lld, counted " "%d\n"), - idic.di_anextents, id->ino, anextents); + xino.i_d.di_anextents, id->ino, anextents); error++; } if (type == DBM_DIR) diff --git a/include/xfs_inode.h b/include/xfs_inode.h index 71c0fb4..1efff0f 100644 --- a/include/xfs_inode.h +++ b/include/xfs_inode.h @@ -29,8 +29,16 @@ struct xfs_inode_log_item; struct xfs_dir_ops; /* - * Inode interface + * Inode interface. This fakes up a "VFS inode" to make the xfs_inode appear + * similar to the kernel which now is used tohold certain parts of the on-disk + * metadata. */ +struct inode { + struct timespec i_atime; + struct timespec i_mtime; + struct timespec i_ctime; +}; + typedef struct xfs_inode { struct cache_node i_node; struct xfs_mount *i_mount; /* fs mount struct ptr */ @@ -45,8 +53,14 @@ typedef struct xfs_inode { struct xfs_icdinode i_d; /* most of ondisk inode */ xfs_fsize_t i_size; /* in-memory size */ const struct xfs_dir_ops *d_ops; /* directory ops vector */ + struct inode i_vnode; } xfs_inode_t; +static inline struct inode *VFS_I(struct xfs_inode *ip) +{ + return &ip->i_vnode; +} + /* * For regular files we only update the on-disk filesize when actually * writing data back to disk. Until then only the copy in the VFS inode diff --git a/libxfs/libxfs_api_defs.h b/libxfs/libxfs_api_defs.h index 3a649e3..685c7a7 100644 --- a/libxfs/libxfs_api_defs.h +++ b/libxfs/libxfs_api_defs.h @@ -92,8 +92,8 @@ #define xfs_dir2_data_use_free libxfs_dir2_data_use_free #define xfs_dir2_shrink_inode libxfs_dir2_shrink_inode -#define xfs_dinode_from_disk libxfs_dinode_from_disk -#define xfs_dinode_to_disk libxfs_dinode_to_disk +#define xfs_inode_from_disk libxfs_inode_from_disk +#define xfs_inode_to_disk libxfs_inode_to_disk #define xfs_dinode_calc_crc libxfs_dinode_calc_crc #define xfs_idata_realloc libxfs_idata_realloc #define xfs_idestroy_fork libxfs_idestroy_fork diff --git a/libxfs/util.c b/libxfs/util.c index 787fd5d..86fadc3 100644 --- a/libxfs/util.c +++ b/libxfs/util.c @@ -161,14 +161,10 @@ libxfs_trans_ichgtime( gettimeofday(&stv, (struct timezone *)0); tv.tv_sec = stv.tv_sec; tv.tv_nsec = stv.tv_usec * 1000; - if (flags & XFS_ICHGTIME_MOD) { - ip->i_d.di_mtime.t_sec = (__int32_t)tv.tv_sec; - ip->i_d.di_mtime.t_nsec = (__int32_t)tv.tv_nsec; - } - if (flags & XFS_ICHGTIME_CHG) { - ip->i_d.di_ctime.t_sec = (__int32_t)tv.tv_sec; - ip->i_d.di_ctime.t_nsec = (__int32_t)tv.tv_nsec; - } + if (flags & XFS_ICHGTIME_MOD) + VFS_I(ip)->i_mtime = tv; + if (flags & XFS_ICHGTIME_CHG) + VFS_I(ip)->i_ctime = tv; if (flags & XFS_ICHGTIME_CREATE) { ip->i_d.di_crtime.t_sec = (__int32_t)tv.tv_sec; ip->i_d.di_crtime.t_nsec = (__int32_t)tv.tv_nsec; @@ -270,7 +266,8 @@ libxfs_ialloc( ip->i_d.di_lsn = 0; ip->i_d.di_flags2 = 0; memset(&(ip->i_d.di_pad2[0]), 0, sizeof(ip->i_d.di_pad2)); - ip->i_d.di_crtime = ip->i_d.di_mtime; + ip->i_d.di_crtime.t_sec = (__int32_t)VFS_I(ip)->i_mtime.tv_sec; + ip->i_d.di_crtime.t_nsec = (__int32_t)VFS_I(ip)->i_mtime.tv_nsec; } flags = XFS_ILOG_CORE; @@ -452,7 +449,7 @@ libxfs_iflush_int(xfs_inode_t *ip, xfs_buf_t *bp) * because if the inode is dirty at all the core must * be. */ - xfs_dinode_to_disk(dip, &ip->i_d); + xfs_inode_to_disk(ip, dip); xfs_iflush_fork(ip, dip, iip, XFS_DATA_FORK); if (XFS_IFORK_Q(ip)) diff --git a/libxfs/xfs_inode_buf.c b/libxfs/xfs_inode_buf.c index dbea592..f546b41 100644 --- a/libxfs/xfs_inode_buf.c +++ b/libxfs/xfs_inode_buf.c @@ -204,10 +204,13 @@ xfs_imap_to_bp( } void -xfs_dinode_from_disk( - struct xfs_icdinode *to, +xfs_inode_from_disk( + struct xfs_inode *ip, struct xfs_dinode *from) { + struct xfs_icdinode *to = &ip->i_d; + struct inode *inode = VFS_I(ip); + to->di_magic = be16_to_cpu(from->di_magic); to->di_mode = be16_to_cpu(from->di_mode); to->di_version = from ->di_version; @@ -220,12 +223,20 @@ xfs_dinode_from_disk( to->di_projid_hi = be16_to_cpu(from->di_projid_hi); memcpy(to->di_pad, from->di_pad, sizeof(to->di_pad)); to->di_flushiter = be16_to_cpu(from->di_flushiter); - to->di_atime.t_sec = be32_to_cpu(from->di_atime.t_sec); - to->di_atime.t_nsec = be32_to_cpu(from->di_atime.t_nsec); - to->di_mtime.t_sec = be32_to_cpu(from->di_mtime.t_sec); - to->di_mtime.t_nsec = be32_to_cpu(from->di_mtime.t_nsec); - to->di_ctime.t_sec = be32_to_cpu(from->di_ctime.t_sec); - to->di_ctime.t_nsec = be32_to_cpu(from->di_ctime.t_nsec); + + /* + * Time is signed, so need to convert to signed 32 bit before + * storing in inode timestamp which may be 64 bit. Otherwise + * a time before epoch is converted to a time long after epoch + * on 64 bit systems. + */ + inode->i_atime.tv_sec = (int)be32_to_cpu(from->di_atime.t_sec); + inode->i_atime.tv_nsec = (int)be32_to_cpu(from->di_atime.t_nsec); + inode->i_mtime.tv_sec = (int)be32_to_cpu(from->di_mtime.t_sec); + inode->i_mtime.tv_nsec = (int)be32_to_cpu(from->di_mtime.t_nsec); + inode->i_ctime.tv_sec = (int)be32_to_cpu(from->di_ctime.t_sec); + inode->i_ctime.tv_nsec = (int)be32_to_cpu(from->di_ctime.t_nsec); + to->di_size = be64_to_cpu(from->di_size); to->di_nblocks = be64_to_cpu(from->di_nblocks); to->di_extsize = be32_to_cpu(from->di_extsize); @@ -251,9 +262,63 @@ xfs_dinode_from_disk( } void -xfs_dinode_to_disk( - struct xfs_dinode *to, - struct xfs_icdinode *from) +xfs_inode_to_disk( + struct xfs_inode *ip, + struct xfs_dinode *to) +{ + struct xfs_icdinode *from = &ip->i_d; + struct inode *inode = VFS_I(ip); + + to->di_magic = cpu_to_be16(from->di_magic); + to->di_mode = cpu_to_be16(from->di_mode); + to->di_version = from ->di_version; + to->di_format = from->di_format; + to->di_onlink = cpu_to_be16(from->di_onlink); + to->di_uid = cpu_to_be32(from->di_uid); + to->di_gid = cpu_to_be32(from->di_gid); + to->di_nlink = cpu_to_be32(from->di_nlink); + to->di_projid_lo = cpu_to_be16(from->di_projid_lo); + to->di_projid_hi = cpu_to_be16(from->di_projid_hi); + memcpy(to->di_pad, from->di_pad, sizeof(to->di_pad)); + + to->di_atime.t_sec = cpu_to_be32(inode->i_atime.tv_sec); + to->di_atime.t_nsec = cpu_to_be32(inode->i_atime.tv_nsec); + to->di_mtime.t_sec = cpu_to_be32(inode->i_mtime.tv_sec); + to->di_mtime.t_nsec = cpu_to_be32(inode->i_mtime.tv_nsec); + to->di_ctime.t_sec = cpu_to_be32(inode->i_ctime.tv_sec); + to->di_ctime.t_nsec = cpu_to_be32(inode->i_ctime.tv_nsec); + + to->di_size = cpu_to_be64(from->di_size); + to->di_nblocks = cpu_to_be64(from->di_nblocks); + to->di_extsize = cpu_to_be32(from->di_extsize); + to->di_nextents = cpu_to_be32(from->di_nextents); + to->di_anextents = cpu_to_be16(from->di_anextents); + to->di_forkoff = from->di_forkoff; + to->di_aformat = from->di_aformat; + to->di_dmevmask = cpu_to_be32(from->di_dmevmask); + to->di_dmstate = cpu_to_be16(from->di_dmstate); + to->di_flags = cpu_to_be16(from->di_flags); + to->di_gen = cpu_to_be32(from->di_gen); + + if (from->di_version == 3) { + to->di_changecount = cpu_to_be64(from->di_changecount); + to->di_crtime.t_sec = cpu_to_be32(from->di_crtime.t_sec); + to->di_crtime.t_nsec = cpu_to_be32(from->di_crtime.t_nsec); + to->di_flags2 = cpu_to_be64(from->di_flags2); + to->di_ino = cpu_to_be64(from->di_ino); + to->di_lsn = cpu_to_be64(from->di_lsn); + memcpy(to->di_pad2, from->di_pad2, sizeof(to->di_pad2)); + uuid_copy(&to->di_uuid, &from->di_uuid); + to->di_flushiter = 0; + } else { + to->di_flushiter = cpu_to_be16(from->di_flushiter); + } +} + +void +xfs_log_dinode_to_disk( + struct xfs_log_dinode *from, + struct xfs_dinode *to) { to->di_magic = cpu_to_be16(from->di_magic); to->di_mode = cpu_to_be16(from->di_mode); @@ -266,12 +331,14 @@ xfs_dinode_to_disk( to->di_projid_lo = cpu_to_be16(from->di_projid_lo); to->di_projid_hi = cpu_to_be16(from->di_projid_hi); memcpy(to->di_pad, from->di_pad, sizeof(to->di_pad)); + to->di_atime.t_sec = cpu_to_be32(from->di_atime.t_sec); to->di_atime.t_nsec = cpu_to_be32(from->di_atime.t_nsec); to->di_mtime.t_sec = cpu_to_be32(from->di_mtime.t_sec); to->di_mtime.t_nsec = cpu_to_be32(from->di_mtime.t_nsec); to->di_ctime.t_sec = cpu_to_be32(from->di_ctime.t_sec); to->di_ctime.t_nsec = cpu_to_be32(from->di_ctime.t_nsec); + to->di_size = cpu_to_be64(from->di_size); to->di_nblocks = cpu_to_be64(from->di_nblocks); to->di_extsize = cpu_to_be32(from->di_extsize); @@ -412,7 +479,7 @@ xfs_iread( * Otherwise, just get the truly permanent information. */ if (dip->di_mode) { - xfs_dinode_from_disk(&ip->i_d, dip); + xfs_inode_from_disk(ip, dip); error = xfs_iformat_fork(ip, dip); if (error) { #ifdef DEBUG diff --git a/libxfs/xfs_inode_buf.h b/libxfs/xfs_inode_buf.h index da66458..6242974 100644 --- a/libxfs/xfs_inode_buf.h +++ b/libxfs/xfs_inode_buf.h @@ -40,9 +40,6 @@ struct xfs_icdinode { __uint16_t di_projid_hi; /* higher part of owner's project id */ __uint8_t di_pad[6]; /* unused, zeroed space */ __uint16_t di_flushiter; /* incremented on flush */ - xfs_ictimestamp_t di_atime; /* time last accessed */ - xfs_ictimestamp_t di_mtime; /* time last modified */ - xfs_ictimestamp_t di_ctime; /* time created/inode modified */ xfs_fsize_t di_size; /* number of bytes in file */ xfs_rfsblock_t di_nblocks; /* # of direct & btree blocks used */ xfs_extlen_t di_extsize; /* basic/minimum extent size for file */ @@ -89,8 +86,10 @@ int xfs_imap_to_bp(struct xfs_mount *, struct xfs_trans *, int xfs_iread(struct xfs_mount *, struct xfs_trans *, struct xfs_inode *, uint); void xfs_dinode_calc_crc(struct xfs_mount *, struct xfs_dinode *); -void xfs_dinode_to_disk(struct xfs_dinode *to, struct xfs_icdinode *from); -void xfs_dinode_from_disk(struct xfs_icdinode *to, struct xfs_dinode *from); +void xfs_inode_to_disk(struct xfs_inode *ip, struct xfs_dinode *to); +void xfs_inode_from_disk(struct xfs_inode *ip, struct xfs_dinode *from); +void xfs_log_dinode_to_disk(struct xfs_log_dinode *from, + struct xfs_dinode *to); bool xfs_dinode_verify(struct xfs_mount *mp, xfs_ino_t ino, struct xfs_dinode *dip); diff --git a/libxfs/xfs_rtbitmap.c b/libxfs/xfs_rtbitmap.c index 684a18b..70ea975 100644 --- a/libxfs/xfs_rtbitmap.c +++ b/libxfs/xfs_rtbitmap.c @@ -1006,7 +1006,7 @@ xfs_rtfree_extent( mp->m_sb.sb_rextents) { if (!(mp->m_rbmip->i_d.di_flags & XFS_DIFLAG_NEWRTBM)) mp->m_rbmip->i_d.di_flags |= XFS_DIFLAG_NEWRTBM; - *(__uint64_t *)&mp->m_rbmip->i_d.di_atime = 0; + *(__uint64_t *)&VFS_I(mp->m_rbmip)->i_atime = 0; xfs_trans_log_inode(tp, mp->m_rbmip, XFS_ILOG_CORE); } return 0; diff --git a/mkfs/proto.c b/mkfs/proto.c index 21960d5..72a1576 100644 --- a/mkfs/proto.c +++ b/mkfs/proto.c @@ -653,7 +653,7 @@ rtinit( mp->m_sb.sb_rbmino = rbmip->i_ino; rbmip->i_d.di_size = mp->m_sb.sb_rbmblocks * mp->m_sb.sb_blocksize; rbmip->i_d.di_flags = XFS_DIFLAG_NEWRTBM; - *(__uint64_t *)&rbmip->i_d.di_atime = 0; + *(__uint64_t *)&VFS_I(mp->m_rbmip)->i_atime = 0; libxfs_trans_log_inode(tp, rbmip, XFS_ILOG_CORE); libxfs_log_sb(tp); mp->m_rbmip = rbmip; -- 2.7.0 From dave@fromorbit.com Wed Feb 17 01:21:25 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=ham version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay3.corp.sgi.com [198.149.34.15]) by oss.sgi.com (Postfix) with ESMTP id CCD5B7F53 for ; Wed, 17 Feb 2016 01:21:24 -0600 (CST) Received: from cuda.sgi.com (cuda1.sgi.com [192.48.157.11]) by relay3.corp.sgi.com (Postfix) with ESMTP id 5E30DAC001 for ; Tue, 16 Feb 2016 23:21:24 -0800 (PST) X-ASG-Debug-ID: 1455693670-04bdf02d5c64b50004-NocioJ Received: from ipmail05.adl6.internode.on.net (ipmail05.adl6.internode.on.net [150.101.137.143]) by cuda.sgi.com with ESMTP id HNGQEA8lQIJsFOUm for ; Tue, 16 Feb 2016 23:21:22 -0800 (PST) X-Barracuda-Envelope-From: dave@fromorbit.com X-Barracuda-Apparent-Source-IP: 150.101.137.143 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: A2BOCQBoHsRWXJbY03ZWCIM6gT+mYAEBAQEBAQaROotTTQEBAQEBAQdEQEESAYNuAQUnLzMIGDE5AwcUGYgZu2eFSokGDnCDbgWNKYlajzWHaIUvjkeCGAELQBmBXCguAYJghEeBOQEBAQ Received: from ppp118-211-216-150.lns20.syd4.internode.on.net (HELO dastard) ([118.211.216.150]) by ipmail05.adl6.internode.on.net with ESMTP; 17 Feb 2016 17:50:55 +1030 Received: from disappointment.disaster.area ([192.168.1.110] helo=disappointment) by dastard with esmtp (Exim 4.80) (envelope-from ) id 1aVwPu-0004ly-PI for xfs@oss.sgi.com; Wed, 17 Feb 2016 18:20:54 +1100 Received: from dave by disappointment with local (Exim 4.86) (envelope-from ) id 1aVwPu-00014I-OS for xfs@oss.sgi.com; Wed, 17 Feb 2016 18:20:54 +1100 From: Dave Chinner To: xfs@oss.sgi.com Subject: [PATCH 07/15] xfs: RT bitmap and summary buffers need verifiers Date: Wed, 17 Feb 2016 18:20:44 +1100 X-ASG-Orig-Subj: [PATCH 07/15] xfs: RT bitmap and summary buffers need verifiers Message-Id: <1455693652-3899-8-git-send-email-david@fromorbit.com> X-Mailer: git-send-email 2.7.0 In-Reply-To: <1455693652-3899-1-git-send-email-david@fromorbit.com> References: <1455693652-3899-1-git-send-email-david@fromorbit.com> X-Barracuda-Connect: ipmail05.adl6.internode.on.net[150.101.137.143] X-Barracuda-Start-Time: 1455693681 X-Barracuda-URL: https://192.48.157.11:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-BRTS-Status: 1 X-Barracuda-Spam-Score: 0.00 X-Barracuda-Spam-Status: No, SCORE=0.00 using per-user scores of TAG_LEVEL=1000.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.7 tests= X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.3.27096 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- From: Dave Chinner Source kernel commit bf85e0998ae8bafc1e0863d914df3be2b1bc372a Buffers without verifiers issue runtime warnings on XFS. We don't have anything we can actually verify in the RT buffers (no CRCs, not magic numbers, etc), but we still need verifiers to avoid the warnings. Add a set of dummy verifier operations for the realtime buffers and apply them in the appropriate places. Signed-off-by: Dave Chinner Tested-by: Ross Zwisler Reviewed-by: Eric Sandeen Signed-off-by: Dave Chinner --- libxfs/xfs_rtbitmap.c | 27 ++++++++++++++++++++++++++- libxfs/xfs_shared.h | 1 + 2 files changed, 27 insertions(+), 1 deletion(-) diff --git a/libxfs/xfs_rtbitmap.c b/libxfs/xfs_rtbitmap.c index 3e61eb2..684a18b 100644 --- a/libxfs/xfs_rtbitmap.c +++ b/libxfs/xfs_rtbitmap.c @@ -37,6 +37,31 @@ */ /* + * Real time buffers need verifiers to avoid runtime warnings during IO. + * We don't have anything to verify, however, so these are just dummy + * operations. + */ +static void +xfs_rtbuf_verify_read( + struct xfs_buf *bp) +{ + return; +} + +static void +xfs_rtbuf_verify_write( + struct xfs_buf *bp) +{ + return; +} + +const struct xfs_buf_ops xfs_rtbuf_ops = { + .name = "rtbuf", + .verify_read = xfs_rtbuf_verify_read, + .verify_write = xfs_rtbuf_verify_write, +}; + +/* * Get a buffer for the bitmap or summary file block specified. * The buffer is returned read and locked. */ @@ -63,7 +88,7 @@ xfs_rtbuf_get( ASSERT(map.br_startblock != NULLFSBLOCK); error = xfs_trans_read_buf(mp, tp, mp->m_ddev_targp, XFS_FSB_TO_DADDR(mp, map.br_startblock), - mp->m_bsize, 0, &bp, NULL); + mp->m_bsize, 0, &bp, &xfs_rtbuf_ops); if (error) return error; diff --git a/libxfs/xfs_shared.h b/libxfs/xfs_shared.h index 15c3ceb..81ac870 100644 --- a/libxfs/xfs_shared.h +++ b/libxfs/xfs_shared.h @@ -53,6 +53,7 @@ extern const struct xfs_buf_ops xfs_dquot_buf_ra_ops; extern const struct xfs_buf_ops xfs_sb_buf_ops; extern const struct xfs_buf_ops xfs_sb_quiet_buf_ops; extern const struct xfs_buf_ops xfs_symlink_buf_ops; +extern const struct xfs_buf_ops xfs_rtbuf_ops; /* * Transaction types. Used to distinguish types of buffers. These never reach -- 2.7.0 From dave@fromorbit.com Wed Feb 17 01:21:25 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=ham version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay2.corp.sgi.com [137.38.102.29]) by oss.sgi.com (Postfix) with ESMTP id 12AC77F54 for ; Wed, 17 Feb 2016 01:21:25 -0600 (CST) Received: from cuda.sgi.com (cuda2.sgi.com [192.48.176.25]) by relay2.corp.sgi.com (Postfix) with ESMTP id 03F81304032 for ; Tue, 16 Feb 2016 23:21:24 -0800 (PST) X-ASG-Debug-ID: 1455693671-04cbb0433114c080006-NocioJ Received: from ipmail05.adl6.internode.on.net (ipmail05.adl6.internode.on.net [150.101.137.143]) by cuda.sgi.com with ESMTP id r5OyTccQohMNBHsV for ; Tue, 16 Feb 2016 23:21:22 -0800 (PST) X-Barracuda-Envelope-From: dave@fromorbit.com X-Barracuda-Apparent-Source-IP: 150.101.137.143 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: A2BQCQBoHsRWXJbY03ZegzqBP6ZgAQEBAQEBBpE6ihWBPk0BAQEBAQEHREBBEgGDbgEFJy8zCBgxOQMHFBmIGbtnhUqJXoQUBZcDnExEjgOCGAELPRyBXCgugmGGAAEBAQ Received: from ppp118-211-216-150.lns20.syd4.internode.on.net (HELO dastard) ([118.211.216.150]) by ipmail05.adl6.internode.on.net with ESMTP; 17 Feb 2016 17:50:56 +1030 Received: from disappointment.disaster.area ([192.168.1.110] helo=disappointment) by dastard with esmtp (Exim 4.80) (envelope-from ) id 1aVwPu-0004m6-So for xfs@oss.sgi.com; Wed, 17 Feb 2016 18:20:54 +1100 Received: from dave by disappointment with local (Exim 4.86) (envelope-from ) id 1aVwPu-00014r-Rs for xfs@oss.sgi.com; Wed, 17 Feb 2016 18:20:54 +1100 From: Dave Chinner To: xfs@oss.sgi.com Subject: [PATCH 14/15] xfs: move di_changecount to VFS inode Date: Wed, 17 Feb 2016 18:20:51 +1100 X-ASG-Orig-Subj: [PATCH 14/15] xfs: move di_changecount to VFS inode Message-Id: <1455693652-3899-15-git-send-email-david@fromorbit.com> X-Mailer: git-send-email 2.7.0 In-Reply-To: <1455693652-3899-1-git-send-email-david@fromorbit.com> References: <1455693652-3899-1-git-send-email-david@fromorbit.com> X-Barracuda-Connect: ipmail05.adl6.internode.on.net[150.101.137.143] X-Barracuda-Start-Time: 1455693682 X-Barracuda-URL: https://192.48.176.25:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-BRTS-Status: 1 X-Barracuda-Spam-Score: 0.00 X-Barracuda-Spam-Status: No, SCORE=0.00 using per-user scores of TAG_LEVEL=1000.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.7 tests= X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.3.27096 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- From: Dave Chinner Source kernel commit 83e06f21b439b7b308eda06332a4feef35739e94 We can store the di_changecount in the i_version field of the VFS inode and remove another 8 bytes from the xfs_icdinode. Signed-off-by: Dave Chinner Reviewed-by: Brian Foster Reviewed-by: Christoph Hellwig Signed-off-by: Dave Chinner --- include/xfs_inode.h | 1 + libxfs/util.c | 4 ++-- libxfs/xfs_inode_buf.c | 4 ++-- libxfs/xfs_inode_buf.h | 1 - repair/phase6.c | 6 +++--- 5 files changed, 8 insertions(+), 8 deletions(-) diff --git a/include/xfs_inode.h b/include/xfs_inode.h index f7ad924..0290f97 100644 --- a/include/xfs_inode.h +++ b/include/xfs_inode.h @@ -36,6 +36,7 @@ struct xfs_dir_ops; struct inode { uint32_t i_nlink; uint32_t i_generation; + uint64_t i_version; struct timespec i_atime; struct timespec i_mtime; struct timespec i_ctime; diff --git a/libxfs/util.c b/libxfs/util.c index 3263ae7..9c2f1d2 100644 --- a/libxfs/util.c +++ b/libxfs/util.c @@ -255,7 +255,7 @@ libxfs_ialloc( if (ip->i_d.di_version == 3) { ASSERT(ip->i_d.di_ino == ino); ASSERT(uuid_equal(&ip->i_d.di_uuid, &mp->m_sb.sb_meta_uuid)); - ip->i_d.di_changecount = 1; + VFS_I(ip)->i_version = 1; ip->i_d.di_flags2 = 0; ip->i_d.di_crtime.t_sec = (__int32_t)VFS_I(ip)->i_mtime.tv_sec; ip->i_d.di_crtime.t_nsec = (__int32_t)VFS_I(ip)->i_mtime.tv_nsec; @@ -431,7 +431,7 @@ libxfs_iflush_int(xfs_inode_t *ip, xfs_buf_t *bp) /* bump the change count on v3 inodes */ if (ip->i_d.di_version == 3) - ip->i_d.di_changecount++; + VFS_I(ip)->i_version++; /* * Copy the dirty parts of the inode into the on-disk diff --git a/libxfs/xfs_inode_buf.c b/libxfs/xfs_inode_buf.c index 224edd3..da9edcd 100644 --- a/libxfs/xfs_inode_buf.c +++ b/libxfs/xfs_inode_buf.c @@ -260,7 +260,7 @@ xfs_inode_from_disk( to->di_flags = be16_to_cpu(from->di_flags); if (to->di_version == 3) { - to->di_changecount = be64_to_cpu(from->di_changecount); + inode->i_version = be64_to_cpu(from->di_changecount); to->di_crtime.t_sec = be32_to_cpu(from->di_crtime.t_sec); to->di_crtime.t_nsec = be32_to_cpu(from->di_crtime.t_nsec); to->di_flags2 = be64_to_cpu(from->di_flags2); @@ -309,7 +309,7 @@ xfs_inode_to_disk( to->di_flags = cpu_to_be16(from->di_flags); if (from->di_version == 3) { - to->di_changecount = cpu_to_be64(from->di_changecount); + to->di_changecount = cpu_to_be64(inode->i_version); to->di_crtime.t_sec = cpu_to_be32(from->di_crtime.t_sec); to->di_crtime.t_nsec = cpu_to_be32(from->di_crtime.t_nsec); to->di_flags2 = cpu_to_be64(from->di_flags2); diff --git a/libxfs/xfs_inode_buf.h b/libxfs/xfs_inode_buf.h index 83ae8ed..ad98fdd 100644 --- a/libxfs/xfs_inode_buf.h +++ b/libxfs/xfs_inode_buf.h @@ -47,7 +47,6 @@ struct xfs_icdinode { __uint16_t di_dmstate; /* DMIG state info */ __uint16_t di_flags; /* random flags, XFS_DIFLAG_... */ - __uint64_t di_changecount; /* number of attribute changes */ __uint64_t di_flags2; /* more random flags */ xfs_ictimestamp_t di_crtime; /* time created */ diff --git a/repair/phase6.c b/repair/phase6.c index 7e14346..7415199 100644 --- a/repair/phase6.c +++ b/repair/phase6.c @@ -519,7 +519,7 @@ mk_rbmino(xfs_mount_t *mp) times = XFS_ICHGTIME_CHG | XFS_ICHGTIME_MOD; if (ip->i_d.di_version == 3) { - ip->i_d.di_changecount = 1; + VFS_I(ip)->i_version = 1; ip->i_d.di_flags2 = 0; times |= XFS_ICHGTIME_CREATE; } @@ -772,7 +772,7 @@ mk_rsumino(xfs_mount_t *mp) times = XFS_ICHGTIME_CHG | XFS_ICHGTIME_MOD; if (ip->i_d.di_version == 3) { - ip->i_d.di_changecount = 1; + VFS_I(ip)->i_version = 1; ip->i_d.di_flags2 = 0; times |= XFS_ICHGTIME_CREATE; } @@ -881,7 +881,7 @@ mk_root_dir(xfs_mount_t *mp) times = XFS_ICHGTIME_CHG | XFS_ICHGTIME_MOD; if (ip->i_d.di_version == 3) { - ip->i_d.di_changecount = 1; + VFS_I(ip)->i_version = 1; ip->i_d.di_flags2 = 0; times |= XFS_ICHGTIME_CREATE; } -- 2.7.0 From dave@fromorbit.com Wed Feb 17 01:21:26 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=ham version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay3.corp.sgi.com [198.149.34.15]) by oss.sgi.com (Postfix) with ESMTP id DC2E27F54 for ; Wed, 17 Feb 2016 01:21:25 -0600 (CST) Received: from cuda.sgi.com (cuda2.sgi.com [192.48.176.25]) by relay3.corp.sgi.com (Postfix) with ESMTP id 609DCAC005 for ; Tue, 16 Feb 2016 23:21:25 -0800 (PST) X-ASG-Debug-ID: 1455693674-04cbb0433414c090005-NocioJ Received: from ipmail05.adl6.internode.on.net (ipmail05.adl6.internode.on.net [150.101.137.143]) by cuda.sgi.com with ESMTP id 1DWzUrPLEuNHhOOJ for ; Tue, 16 Feb 2016 23:21:22 -0800 (PST) X-Barracuda-Envelope-From: dave@fromorbit.com X-Barracuda-Apparent-Source-IP: 150.101.137.143 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: A2BQCQBoHsRWXJbY03ZegzqBP6ZgAQEBAQEBBpE6ihWBPk0BAQEBAQEHREBBEgGDbgEFJy8zCBgZGDkDBxQZiBm7Z4VKiV4iDINmBYdVjy6cTESOA4IYAQtABBWBXCgugmGEUIEwAQEB Received: from ppp118-211-216-150.lns20.syd4.internode.on.net (HELO dastard) ([118.211.216.150]) by ipmail05.adl6.internode.on.net with ESMTP; 17 Feb 2016 17:50:55 +1030 Received: from disappointment.disaster.area ([192.168.1.110] helo=disappointment) by dastard with esmtp (Exim 4.80) (envelope-from ) id 1aVwPu-0004m2-R4 for xfs@oss.sgi.com; Wed, 17 Feb 2016 18:20:54 +1100 Received: from dave by disappointment with local (Exim 4.86) (envelope-from ) id 1aVwPu-00014c-QB for xfs@oss.sgi.com; Wed, 17 Feb 2016 18:20:54 +1100 From: Dave Chinner To: xfs@oss.sgi.com Subject: [PATCH 11/15] xfs: move v1 inode conversion to xfs_inode_from_disk Date: Wed, 17 Feb 2016 18:20:48 +1100 X-ASG-Orig-Subj: [PATCH 11/15] xfs: move v1 inode conversion to xfs_inode_from_disk Message-Id: <1455693652-3899-12-git-send-email-david@fromorbit.com> X-Mailer: git-send-email 2.7.0 In-Reply-To: <1455693652-3899-1-git-send-email-david@fromorbit.com> References: <1455693652-3899-1-git-send-email-david@fromorbit.com> X-Barracuda-Connect: ipmail05.adl6.internode.on.net[150.101.137.143] X-Barracuda-Start-Time: 1455693682 X-Barracuda-URL: https://192.48.176.25:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-BRTS-Status: 1 X-Barracuda-Spam-Score: 0.00 X-Barracuda-Spam-Status: No, SCORE=0.00 using per-user scores of TAG_LEVEL=1000.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.7 tests= X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.3.27096 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- From: Dave Chinner Source kernel commit faeb4e4715be017e88e630bda84477afc1dff38b So we don't have to carry an di_onlink variable around anymore, move the inode conversion from v1 inode format to v2 inode format into xfs_inode_from_disk(). This means we can remove the di_onlink fields from the struct xfs_icdinode. Signed-off-by: Dave Chinner Reviewed-by: Brian Foster Reviewed-by: Christoph Hellwig Signed-off-by: Dave Chinner --- db/check.c | 19 ++++++------------- libxfs/util.c | 1 - libxfs/xfs_inode_buf.c | 41 ++++++++++++++++++++--------------------- libxfs/xfs_inode_buf.h | 1 - libxfs/xfs_log_format.h | 2 +- logprint/log_print_all.c | 5 ++--- 6 files changed, 29 insertions(+), 40 deletions(-) diff --git a/db/check.c b/db/check.c index 95a68d4..412ab3d 100644 --- a/db/check.c +++ b/db/check.c @@ -2623,7 +2623,6 @@ process_inode( inodata_t *id = NULL; xfs_ino_t ino; xfs_extnum_t nextents = 0; - int nlink; int security; xfs_rfsblock_t totblocks; xfs_rfsblock_t totdblocks = 0; @@ -2694,14 +2693,10 @@ process_inode( xino.i_d.di_nblocks, ino); error++; } - if (xino.i_d.di_version == 1) - nlink = xino.i_d.di_onlink; - else - nlink = xino.i_d.di_nlink; - if (nlink != 0) { + if (dip->di_nlink != 0) { if (v) dbprintf(_("bad nlink %d for free inode %lld\n"), - nlink, ino); + be32_to_cpu(dip->di_nlink), ino); error++; } if (xino.i_d.di_mode != 0) { @@ -2801,12 +2796,10 @@ process_inode( type = DBM_UNKNOWN; break; } - if (xino.i_d.di_version == 1) - setlink_inode(id, xino.i_d.di_onlink, type == DBM_DIR, security); - else { - sbversion |= XFS_SB_VERSION_NLINKBIT; - setlink_inode(id, xino.i_d.di_nlink, type == DBM_DIR, security); - } + + sbversion |= XFS_SB_VERSION_NLINKBIT; + setlink_inode(id, be32_to_cpu(dip->di_nlink), type == DBM_DIR, security); + switch (xino.i_d.di_format) { case XFS_DINODE_FMT_LOCAL: process_lclinode(id, dip, type, &totdblocks, &totiblocks, diff --git a/libxfs/util.c b/libxfs/util.c index a893c3a..bbaf790 100644 --- a/libxfs/util.c +++ b/libxfs/util.c @@ -218,7 +218,6 @@ libxfs_ialloc( ASSERT(ip != NULL); ip->i_d.di_mode = (__uint16_t)mode; - ip->i_d.di_onlink = 0; ip->i_d.di_nlink = nlink; ASSERT(ip->i_d.di_nlink == nlink); ip->i_d.di_uid = cr->cr_uid; diff --git a/libxfs/xfs_inode_buf.c b/libxfs/xfs_inode_buf.c index 5a7a118..66a827a 100644 --- a/libxfs/xfs_inode_buf.c +++ b/libxfs/xfs_inode_buf.c @@ -213,13 +213,25 @@ xfs_inode_from_disk( to->di_mode = be16_to_cpu(from->di_mode); to->di_version = from ->di_version; + + /* + * Convert v1 inodes immediately to v2 inode format as this is the + * minimum inode version format we support in the rest of the code. + */ + if (to->di_version == 1) { + to->di_nlink = be16_to_cpu(from->di_onlink); + to->di_projid_lo = 0; + to->di_projid_hi = 0; + to->di_version = 2; + } else { + to->di_nlink = be32_to_cpu(from->di_nlink); + to->di_projid_lo = be16_to_cpu(from->di_projid_lo); + to->di_projid_hi = be16_to_cpu(from->di_projid_hi); + } + to->di_format = from->di_format; - to->di_onlink = be16_to_cpu(from->di_onlink); to->di_uid = be32_to_cpu(from->di_uid); to->di_gid = be32_to_cpu(from->di_gid); - to->di_nlink = be32_to_cpu(from->di_nlink); - to->di_projid_lo = be16_to_cpu(from->di_projid_lo); - to->di_projid_hi = be16_to_cpu(from->di_projid_hi); to->di_flushiter = be16_to_cpu(from->di_flushiter); /* @@ -265,11 +277,11 @@ xfs_inode_to_disk( struct inode *inode = VFS_I(ip); to->di_magic = cpu_to_be16(XFS_DINODE_MAGIC); + to->di_onlink = 0; to->di_mode = cpu_to_be16(from->di_mode); to->di_version = from->di_version; to->di_format = from->di_format; - to->di_onlink = cpu_to_be16(from->di_onlink); to->di_uid = cpu_to_be32(from->di_uid); to->di_gid = cpu_to_be32(from->di_gid); to->di_nlink = cpu_to_be32(from->di_nlink); @@ -319,9 +331,9 @@ xfs_log_dinode_to_disk( { to->di_magic = cpu_to_be16(from->di_magic); to->di_mode = cpu_to_be16(from->di_mode); - to->di_version = from ->di_version; + to->di_version = from->di_version; to->di_format = from->di_format; - to->di_onlink = cpu_to_be16(from->di_onlink); + to->di_onlink = 0; to->di_uid = cpu_to_be32(from->di_uid); to->di_gid = cpu_to_be32(from->di_gid); to->di_nlink = cpu_to_be32(from->di_nlink); @@ -501,20 +513,7 @@ xfs_iread( ip->i_d.di_mode = 0; } - /* - * Automatically convert version 1 inode formats in memory to version 2 - * inode format. If the inode is modified, it will get logged and - * rewritten as a version 2 inode. We can do this because we set the - * superblock feature bit for v2 inodes unconditionally during mount - * and it means the reast of the code can assume the inode version is 2 - * or higher. - */ - if (ip->i_d.di_version == 1) { - ip->i_d.di_version = 2; - ip->i_d.di_nlink = ip->i_d.di_onlink; - ip->i_d.di_onlink = 0; - xfs_set_projid(&ip->i_d, 0); - } + ASSERT(ip->i_d.di_version >= 2); ip->i_delayed_blks = 0; diff --git a/libxfs/xfs_inode_buf.h b/libxfs/xfs_inode_buf.h index 974d060..489b96e 100644 --- a/libxfs/xfs_inode_buf.h +++ b/libxfs/xfs_inode_buf.h @@ -31,7 +31,6 @@ struct xfs_icdinode { __uint16_t di_mode; /* mode and type of file */ __int8_t di_version; /* inode version */ __int8_t di_format; /* format of di_c data */ - __uint16_t di_onlink; /* old number of links to file */ __uint16_t di_flushiter; /* incremented on flush */ __uint32_t di_uid; /* owner's user id */ __uint32_t di_gid; /* owner's group id */ diff --git a/libxfs/xfs_log_format.h b/libxfs/xfs_log_format.h index 85d4732..40005bf 100644 --- a/libxfs/xfs_log_format.h +++ b/libxfs/xfs_log_format.h @@ -369,7 +369,7 @@ struct xfs_log_dinode { __uint16_t di_mode; /* mode and type of file */ __int8_t di_version; /* inode version */ __int8_t di_format; /* format of di_c data */ - __uint16_t di_onlink; /* old number of links to file */ + __uint8_t di_pad3[2]; /* unused in v2/3 inodes */ __uint32_t di_uid; /* owner's user id */ __uint32_t di_gid; /* owner's group id */ __uint32_t di_nlink; /* number of links to file */ diff --git a/logprint/log_print_all.c b/logprint/log_print_all.c index 1bc18af..f95f4aa 100644 --- a/logprint/log_print_all.c +++ b/logprint/log_print_all.c @@ -255,10 +255,9 @@ xlog_recover_print_inode_core( printf(_(" CORE inode:\n")); if (!print_inode) return; - printf(_(" magic:%c%c mode:0x%x ver:%d format:%d " - "onlink:%d\n"), + printf(_(" magic:%c%c mode:0x%x ver:%d format:%d\n"), (di->di_magic>>8) & 0xff, di->di_magic & 0xff, - di->di_mode, di->di_version, di->di_format, di->di_onlink); + di->di_mode, di->di_version, di->di_format); printf(_(" uid:%d gid:%d nlink:%d projid:0x%04x%04x\n"), di->di_uid, di->di_gid, di->di_nlink, di->di_projid_hi, di->di_projid_lo); -- 2.7.0 From dave@fromorbit.com Wed Feb 17 01:21:26 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=ham version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay2.corp.sgi.com [137.38.102.29]) by oss.sgi.com (Postfix) with ESMTP id 4AB727F59 for ; Wed, 17 Feb 2016 01:21:26 -0600 (CST) Received: from cuda.sgi.com (cuda1.sgi.com [192.48.157.11]) by relay2.corp.sgi.com (Postfix) with ESMTP id 0502B304032 for ; Tue, 16 Feb 2016 23:21:26 -0800 (PST) X-ASG-Debug-ID: 1455693670-04bdf02d5c64b50005-NocioJ Received: from ipmail05.adl6.internode.on.net (ipmail05.adl6.internode.on.net [150.101.137.143]) by cuda.sgi.com with ESMTP id tkTXrCmfidf6pq0D for ; Tue, 16 Feb 2016 23:21:24 -0800 (PST) X-Barracuda-Envelope-From: dave@fromorbit.com X-Barracuda-Apparent-Source-IP: 150.101.137.143 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: A2BQCQBoHsRWXJbY03ZegzqBP6ZgAQEBAQEBBpE6ihWBPk0BAQEBAQEHREBBEgGDbgEFJy8zCBgxOQMHFBmIGbtnhUqJXoQUBZcDnEyOR4IYAQs9HIFcKC6CYYYAAQEB Received: from ppp118-211-216-150.lns20.syd4.internode.on.net (HELO dastard) ([118.211.216.150]) by ipmail05.adl6.internode.on.net with ESMTP; 17 Feb 2016 17:50:55 +1030 Received: from disappointment.disaster.area ([192.168.1.110] helo=disappointment) by dastard with esmtp (Exim 4.80) (envelope-from ) id 1aVwPu-0004m4-SN for xfs@oss.sgi.com; Wed, 17 Feb 2016 18:20:54 +1100 Received: from dave by disappointment with local (Exim 4.86) (envelope-from ) id 1aVwPu-00014m-R8 for xfs@oss.sgi.com; Wed, 17 Feb 2016 18:20:54 +1100 From: Dave Chinner To: xfs@oss.sgi.com Subject: [PATCH 13/15] xfs: move inode generation count to VFS inode Date: Wed, 17 Feb 2016 18:20:50 +1100 X-ASG-Orig-Subj: [PATCH 13/15] xfs: move inode generation count to VFS inode Message-Id: <1455693652-3899-14-git-send-email-david@fromorbit.com> X-Mailer: git-send-email 2.7.0 In-Reply-To: <1455693652-3899-1-git-send-email-david@fromorbit.com> References: <1455693652-3899-1-git-send-email-david@fromorbit.com> X-Barracuda-Connect: ipmail05.adl6.internode.on.net[150.101.137.143] X-Barracuda-Start-Time: 1455693683 X-Barracuda-URL: https://192.48.157.11:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-BRTS-Status: 1 X-Barracuda-Spam-Score: 0.00 X-Barracuda-Spam-Status: No, SCORE=0.00 using per-user scores of TAG_LEVEL=1000.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.7 tests= X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.3.27096 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- From: Dave Chinner Source kernel commit 9e9a2674e43353f650ecd19a54eba028eafff82e Pull another 4 bytes out of the xfs_icdinode. Signed-off-by: Dave Chinner Reviewed-by: Brian Foster Reviewed-by: Christoph Hellwig Signed-off-by: Dave Chinner --- include/xfs_inode.h | 1 + libxfs/util.c | 5 +---- libxfs/xfs_inode_buf.c | 8 ++++---- libxfs/xfs_inode_buf.h | 1 - 4 files changed, 6 insertions(+), 9 deletions(-) diff --git a/include/xfs_inode.h b/include/xfs_inode.h index e7aa9e9..f7ad924 100644 --- a/include/xfs_inode.h +++ b/include/xfs_inode.h @@ -35,6 +35,7 @@ struct xfs_dir_ops; */ struct inode { uint32_t i_nlink; + uint32_t i_generation; struct timespec i_atime; struct timespec i_mtime; struct timespec i_ctime; diff --git a/libxfs/util.c b/libxfs/util.c index 9327a62..3263ae7 100644 --- a/libxfs/util.c +++ b/libxfs/util.c @@ -247,9 +247,6 @@ libxfs_ialloc( ip->i_d.di_size = 0; ip->i_d.di_nextents = 0; ASSERT(ip->i_d.di_nblocks == 0); - /* - * di_gen will have been taken care of in xfs_iread. - */ ip->i_d.di_extsize = pip ? 0 : fsx->fsx_extsize; ip->i_d.di_dmevmask = 0; ip->i_d.di_dmstate = 0; @@ -391,7 +388,7 @@ libxfs_iprint( printf(" di_gid %d\n", dip->di_gid); printf(" di_nextents %d\n", dip->di_nextents); printf(" di_size %llu\n", (unsigned long long)dip->di_size); - printf(" di_gen %x\n", dip->di_gen); + printf(" di_gen %x\n", VFS_I(ip)->i_generation); printf(" di_extsize %d\n", dip->di_extsize); printf(" di_flags %x\n", dip->di_flags); printf(" di_nblocks %llu\n", (unsigned long long)dip->di_nblocks); diff --git a/libxfs/xfs_inode_buf.c b/libxfs/xfs_inode_buf.c index dba8a4b..224edd3 100644 --- a/libxfs/xfs_inode_buf.c +++ b/libxfs/xfs_inode_buf.c @@ -246,6 +246,7 @@ xfs_inode_from_disk( inode->i_mtime.tv_nsec = (int)be32_to_cpu(from->di_mtime.t_nsec); inode->i_ctime.tv_sec = (int)be32_to_cpu(from->di_ctime.t_sec); inode->i_ctime.tv_nsec = (int)be32_to_cpu(from->di_ctime.t_nsec); + inode->i_generation = be32_to_cpu(from->di_gen); to->di_size = be64_to_cpu(from->di_size); to->di_nblocks = be64_to_cpu(from->di_nblocks); @@ -257,7 +258,6 @@ xfs_inode_from_disk( to->di_dmevmask = be32_to_cpu(from->di_dmevmask); to->di_dmstate = be16_to_cpu(from->di_dmstate); to->di_flags = be16_to_cpu(from->di_flags); - to->di_gen = be32_to_cpu(from->di_gen); if (to->di_version == 3) { to->di_changecount = be64_to_cpu(from->di_changecount); @@ -295,6 +295,7 @@ xfs_inode_to_disk( to->di_ctime.t_sec = cpu_to_be32(inode->i_ctime.tv_sec); to->di_ctime.t_nsec = cpu_to_be32(inode->i_ctime.tv_nsec); to->di_nlink = cpu_to_be32(inode->i_nlink); + to->di_gen = cpu_to_be32(inode->i_generation); to->di_size = cpu_to_be64(from->di_size); to->di_nblocks = cpu_to_be64(from->di_nblocks); @@ -306,7 +307,6 @@ xfs_inode_to_disk( to->di_dmevmask = cpu_to_be32(from->di_dmevmask); to->di_dmstate = cpu_to_be16(from->di_dmstate); to->di_flags = cpu_to_be16(from->di_flags); - to->di_gen = cpu_to_be32(from->di_gen); if (from->di_version == 3) { to->di_changecount = cpu_to_be64(from->di_changecount); @@ -452,7 +452,7 @@ xfs_iread( !(mp->m_flags & XFS_MOUNT_IKEEP)) { /* initialise the on-disk inode core */ memset(&ip->i_d, 0, sizeof(ip->i_d)); - ip->i_d.di_gen = prandom_u32(); + VFS_I(ip)->i_generation = prandom_u32(); if (xfs_sb_version_hascrc(&mp->m_sb)) ip->i_d.di_version = 3; else @@ -500,7 +500,7 @@ xfs_iread( * that xfs_ialloc won't overwrite or relies on being correct. */ ip->i_d.di_version = dip->di_version; - ip->i_d.di_gen = be32_to_cpu(dip->di_gen); + VFS_I(ip)->i_generation = be32_to_cpu(dip->di_gen); ip->i_d.di_flushiter = be16_to_cpu(dip->di_flushiter); /* diff --git a/libxfs/xfs_inode_buf.h b/libxfs/xfs_inode_buf.h index ccc4052..83ae8ed 100644 --- a/libxfs/xfs_inode_buf.h +++ b/libxfs/xfs_inode_buf.h @@ -46,7 +46,6 @@ struct xfs_icdinode { __uint32_t di_dmevmask; /* DMIG event mask */ __uint16_t di_dmstate; /* DMIG state info */ __uint16_t di_flags; /* random flags, XFS_DIFLAG_... */ - __uint32_t di_gen; /* generation number */ __uint64_t di_changecount; /* number of attribute changes */ __uint64_t di_flags2; /* more random flags */ -- 2.7.0 From BATV+bffad35de576da5f5ff6+4560+infradead.org+hch@bombadil.srs.infradead.org Wed Feb 17 01:25:03 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=ham version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay2.corp.sgi.com [137.38.102.29]) by oss.sgi.com (Postfix) with ESMTP id E52EF7CBF for ; Wed, 17 Feb 2016 01:25:03 -0600 (CST) Received: from cuda.sgi.com (cuda3.sgi.com [192.48.176.15]) by relay2.corp.sgi.com (Postfix) with ESMTP id D4C67304032 for ; Tue, 16 Feb 2016 23:25:03 -0800 (PST) X-ASG-Debug-ID: 1455693900-04cb6c1e5812d620001-NocioJ Received: from bombadil.infradead.org ([198.137.202.9]) by cuda.sgi.com with ESMTP id DyWXM0xHHnK3oM8S (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128 verify=NO) for ; Tue, 16 Feb 2016 23:25:01 -0800 (PST) X-Barracuda-Envelope-From: BATV+bffad35de576da5f5ff6+4560+infradead.org+hch@bombadil.srs.infradead.org X-Barracuda-Apparent-Source-IP: 198.137.202.9 Received: from hch by bombadil.infradead.org with local (Exim 4.80.1 #2 (Red Hat Linux)) id 1aVwTs-0004Tt-Eq; Wed, 17 Feb 2016 07:25:00 +0000 Date: Tue, 16 Feb 2016 23:25:00 -0800 From: Christoph Hellwig To: Dave Chinner Cc: xfs@oss.sgi.com Subject: Re: [PATCH 01/15] xfs: wire up Q_XGETNEXTQUOTA / get_nextdqblk Message-ID: <20160217072500.GA16363@infradead.org> X-ASG-Orig-Subj: Re: [PATCH 01/15] xfs: wire up Q_XGETNEXTQUOTA / get_nextdqblk References: <1455693652-3899-1-git-send-email-david@fromorbit.com> <1455693652-3899-2-git-send-email-david@fromorbit.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1455693652-3899-2-git-send-email-david@fromorbit.com> User-Agent: Mutt/1.5.24 (2015-08-30) X-SRS-Rewrite: SMTP reverse-path rewritten from by bombadil.infradead.org. See http://www.infradead.org/rpr.html X-Barracuda-Connect: UNKNOWN[198.137.202.9] X-Barracuda-Start-Time: 1455693900 X-Barracuda-Encrypted: ECDHE-RSA-AES128-GCM-SHA256 X-Barracuda-URL: https://192.48.176.15:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-Spam-Score: 0.10 X-Barracuda-Spam-Status: No, SCORE=0.10 using per-user scores of TAG_LEVEL=1000.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.7 tests=BSF_SC0_MISMATCH_TO, RDNS_NONE X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.3.27096 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 0.00 BSF_SC0_MISMATCH_TO Envelope rcpt doesn't match header 0.10 RDNS_NONE Delivered to trusted network by a host with no rDNS Looks fine, Reviewed-by: Christoph Hellwig From david@fromorbit.com Wed Feb 17 01:31:26 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=ham version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay2.corp.sgi.com [137.38.102.29]) by oss.sgi.com (Postfix) with ESMTP id AC0867CAE for ; Wed, 17 Feb 2016 01:31:26 -0600 (CST) Received: from cuda.sgi.com (cuda3.sgi.com [192.48.176.15]) by relay2.corp.sgi.com (Postfix) with ESMTP id 9BF6D304039 for ; Tue, 16 Feb 2016 23:31:26 -0800 (PST) X-ASG-Debug-ID: 1455694283-04cb6c1e5812dc10001-NocioJ Received: from ipmail05.adl6.internode.on.net (ipmail05.adl6.internode.on.net [150.101.137.143]) by cuda.sgi.com with ESMTP id DozUXRS545A7qqz3 for ; Tue, 16 Feb 2016 23:31:23 -0800 (PST) X-Barracuda-Envelope-From: david@fromorbit.com X-Barracuda-Apparent-Source-IP: 150.101.137.143 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: A2BlBwDYIMRWXJbY03ZWCIM6gT+CaKN4AQEBAQEBBotyhUiECIYHAgIBAQKBPE0BAQEBAQEHRECEQgEBBCcTHCMQCBgMJQ8FJQMHLYgZuzgBAQEBAQUBAQEBHBiFMokUSoMFgQ8FlwONUIFlh2iFL0SOA4MRgUgoLohhAQEB Received: from ppp118-211-216-150.lns20.syd4.internode.on.net (HELO dastard) ([118.211.216.150]) by ipmail05.adl6.internode.on.net with ESMTP; 17 Feb 2016 18:01:21 +1030 Received: from dave by dastard with local (Exim 4.80) (envelope-from ) id 1aVwa1-0004pg-Jp; Wed, 17 Feb 2016 18:31:21 +1100 Date: Wed, 17 Feb 2016 18:31:21 +1100 From: Dave Chinner To: xfs@oss.sgi.com Cc: ross.zwisler@linux.intel.com, jack@suse.cz Subject: [PATCH 3/4 v2] xfs: dynamically switch modes when XFS_DIFLAG2_DAX is set/cleared Message-ID: <20160217073121.GC19486@dastard> X-ASG-Orig-Subj: [PATCH 3/4 v2] xfs: dynamically switch modes when XFS_DIFLAG2_DAX is set/cleared References: <1455513734-15192-1-git-send-email-david@fromorbit.com> <1455513734-15192-4-git-send-email-david@fromorbit.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1455513734-15192-4-git-send-email-david@fromorbit.com> User-Agent: Mutt/1.5.21 (2010-09-15) X-Barracuda-Connect: ipmail05.adl6.internode.on.net[150.101.137.143] X-Barracuda-Start-Time: 1455694283 X-Barracuda-URL: https://192.48.176.15:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-BRTS-Status: 1 X-Barracuda-Spam-Score: 0.00 X-Barracuda-Spam-Status: No, SCORE=0.00 using per-user scores of TAG_LEVEL=1000.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.7 tests= X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.3.27096 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- xfs: dynamically switch modes when XFS_DIFLAG2_DAX is set/cleared From: Dave Chinner When we set or clear the XFS_DIFLAG2_DAX flag, we should also set/clear the S_DAX flag in the VFS inode. To do this, we need to ensure that we first flush and remove any cached entries in the radix tree to ensure the correct data access method is used when we next try to read or write data. We ahve to be especially careful here to lock out page faults so they don't race with the flush and invalidation before we change the access mode. Signed-off-by: Dave Chinner --- Version 2: - fix lock leak in xfs_ioctl_setattr where dquot allocation could fail after we'd locked the inode iolock and mmaplock but we didn't unlock them on error. fs/xfs/xfs_ioctl.c | 105 ++++++++++++++++++++++++++++++++++++++++++++++------- 1 file changed, 92 insertions(+), 13 deletions(-) diff --git a/fs/xfs/xfs_ioctl.c b/fs/xfs/xfs_ioctl.c index 0895967..c1000e9 100644 --- a/fs/xfs/xfs_ioctl.c +++ b/fs/xfs/xfs_ioctl.c @@ -1051,20 +1051,63 @@ xfs_ioctl_setattr_xflags( !capable(CAP_LINUX_IMMUTABLE)) return -EPERM; + xfs_set_diflags(ip, fa->fsx_xflags); + xfs_diflags_to_linux(ip); + xfs_trans_ichgtime(tp, ip, XFS_ICHGTIME_CHG); + xfs_trans_log_inode(tp, ip, XFS_ILOG_CORE); + XFS_STATS_INC(mp, xs_ig_attrchg); + return 0; +} + +/* + * If we are changing DAX flags, we have to ensure the file is clean and any + * cached objects in the address space are invalidated and removed. This + * requires us to lock out other IO and page faults similar to a truncate + * operation. The locks need to be held until the transaction has been committed + * so that the cache invalidation is atomic with respect to the DAX flag + * manipulation. + */ +static int +xfs_ioctl_setattr_dax_invalidate( + struct xfs_inode *ip, + struct fsxattr *fa, + int *join_flags) +{ + struct inode *inode = VFS_I(ip); + int error; + + *join_flags = 0; + /* * It is only valid to set the DAX flag on regular files and * directories. On directories it serves as an inherit hint. */ if ((fa->fsx_xflags & FS_XFLAG_DAX) && - !(S_ISREG(VFS_I(ip)->i_mode) || S_ISDIR(VFS_I(ip)->i_mode))) + !(S_ISREG(inode->i_mode) || S_ISDIR(inode->i_mode))) return -EINVAL; - xfs_set_diflags(ip, fa->fsx_xflags); - xfs_diflags_to_linux(ip); - xfs_trans_ichgtime(tp, ip, XFS_ICHGTIME_CHG); - xfs_trans_log_inode(tp, ip, XFS_ILOG_CORE); - XFS_STATS_INC(mp, xs_ig_attrchg); + /* If the DAX state is not changing, we have nothing to do here. */ + if ((fa->fsx_xflags & FS_XFLAG_DAX) && IS_DAX(inode)) + return 0; + if (!(fa->fsx_xflags & FS_XFLAG_DAX) && !IS_DAX(inode)) + return 0; + + /* lock, flush and invalidate mapping in preparation for flag change */ + xfs_ilock(ip, XFS_MMAPLOCK_EXCL | XFS_IOLOCK_EXCL); + error = filemap_write_and_wait(inode->i_mapping); + if (error) + goto out_unlock; + error = invalidate_inode_pages2(inode->i_mapping); + if (error) + goto out_unlock; + + *join_flags = XFS_MMAPLOCK_EXCL | XFS_IOLOCK_EXCL; return 0; + +out_unlock: + xfs_iunlock(ip, XFS_MMAPLOCK_EXCL | XFS_IOLOCK_EXCL); + return error; + } /* @@ -1072,19 +1115,27 @@ xfs_ioctl_setattr_xflags( * have permission to do so. On success, return a clean transaction and the * inode locked exclusively ready for further operation specific checks. On * failure, return an error without modifying or locking the inode. + * + * The inode might already be IO locked on call. If this is the case, it is + * indicated in @join_flags and we take full responsibility for ensuring they + * are unlocked from now on. Hence if we have an error here, we still have to + * unlock them. Otherwise, once they are joined to the transaction, they will + * be unlocked on commit/cancel. */ static struct xfs_trans * xfs_ioctl_setattr_get_trans( - struct xs_inode *ip) + struct xfs_inode *ip, + int join_flags) { struct xfs_mount *mp = ip->i_mount; struct xfs_trans *tp; - int error; + int error = -EROFS; if (mp->m_flags & XFS_MOUNT_RDONLY) - return ERR_PTR(-EROFS); + goto out_unlock; + error = -EIO; if (XFS_FORCED_SHUTDOWN(mp)) - return ERR_PTR(-EIO); + goto out_unlock; tp = xfs_trans_alloc(mp, XFS_TRANS_SETATTR_NOT_SIZE); error = xfs_trans_reserve(tp, &M_RES(mp)->tr_ichange, 0, 0); @@ -1092,7 +1143,8 @@ xfs_ioctl_setattr_get_trans( goto out_cancel; xfs_ilock(ip, XFS_ILOCK_EXCL); - xfs_trans_ijoin(tp, ip, XFS_ILOCK_EXCL); + xfs_trans_ijoin(tp, ip, XFS_ILOCK_EXCL | join_flags); + join_flags = 0; /* * CAP_FOWNER overrides the following restrictions: @@ -1112,6 +1164,9 @@ xfs_ioctl_setattr_get_trans( out_cancel: xfs_trans_cancel(tp); +out_unlock: + if (join_flags) + xfs_iunlock(ip, join_flags); return ERR_PTR(error); } @@ -1210,6 +1265,7 @@ xfs_ioctl_setattr( struct xfs_dquot *pdqp = NULL; struct xfs_dquot *olddquot = NULL; int code; + int join_flags = 0; trace_xfs_ioctl_setattr(ip); @@ -1233,7 +1289,18 @@ xfs_ioctl_setattr( return code; } - tp = xfs_ioctl_setattr_get_trans(ip); + /* + * Changing DAX config may require inode locking for mapping + * invalidation. These need to be held all the way to transaction commit + * or cancel time, so need to be passed through to + * xfs_ioctl_setattr_get_trans() so it can apply them to the join call + * appropriately. + */ + code = xfs_ioctl_setattr_dax_invalidate(ip, fa, &join_flags); + if (code) + goto error_free_dquots; + + tp = xfs_ioctl_setattr_get_trans(ip, join_flags); if (IS_ERR(tp)) { code = PTR_ERR(tp); goto error_free_dquots; @@ -1349,6 +1416,7 @@ xfs_ioc_setxflags( struct xfs_trans *tp; struct fsxattr fa; unsigned int flags; + int join_flags = 0; int error; if (copy_from_user(&flags, arg, sizeof(flags))) @@ -1365,7 +1433,18 @@ xfs_ioc_setxflags( if (error) return error; - tp = xfs_ioctl_setattr_get_trans(ip); + /* + * Changing DAX config may require inode locking for mapping + * invalidation. These need to be held all the way to transaction commit + * or cancel time, so need to be passed through to + * xfs_ioctl_setattr_get_trans() so it can apply them to the join call + * appropriately. + */ + error = xfs_ioctl_setattr_dax_invalidate(ip, &fa, &join_flags); + if (error) + goto out_drop_write; + + tp = xfs_ioctl_setattr_get_trans(ip, join_flags); if (IS_ERR(tp)) { error = PTR_ERR(tp); goto out_drop_write; -- Dave Chinner david@fromorbit.com From BATV+bffad35de576da5f5ff6+4560+infradead.org+hch@bombadil.srs.infradead.org Wed Feb 17 01:32:06 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=ham version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay2.corp.sgi.com [137.38.102.29]) by oss.sgi.com (Postfix) with ESMTP id DED167CAD for ; Wed, 17 Feb 2016 01:32:06 -0600 (CST) Received: from cuda.sgi.com (cuda1.sgi.com [192.48.157.11]) by relay2.corp.sgi.com (Postfix) with ESMTP id BE368304032 for ; Tue, 16 Feb 2016 23:32:06 -0800 (PST) X-ASG-Debug-ID: 1455694324-04bdf02d5b65bd0001-NocioJ Received: from bombadil.infradead.org ([198.137.202.9]) by cuda.sgi.com with ESMTP id rsnagzDhtr3SKmB5 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128 verify=NO) for ; Tue, 16 Feb 2016 23:32:04 -0800 (PST) X-Barracuda-Envelope-From: BATV+bffad35de576da5f5ff6+4560+infradead.org+hch@bombadil.srs.infradead.org X-Barracuda-Apparent-Source-IP: 198.137.202.9 Received: from hch by bombadil.infradead.org with local (Exim 4.80.1 #2 (Red Hat Linux)) id 1aVwai-0007tW-Gz; Wed, 17 Feb 2016 07:32:04 +0000 Date: Tue, 16 Feb 2016 23:32:04 -0800 From: Christoph Hellwig To: Dave Chinner Cc: xfs@oss.sgi.com Subject: Re: [PATCH 11/15] xfs: move v1 inode conversion to xfs_inode_from_disk Message-ID: <20160217073204.GB16363@infradead.org> X-ASG-Orig-Subj: Re: [PATCH 11/15] xfs: move v1 inode conversion to xfs_inode_from_disk References: <1455693652-3899-1-git-send-email-david@fromorbit.com> <1455693652-3899-12-git-send-email-david@fromorbit.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1455693652-3899-12-git-send-email-david@fromorbit.com> User-Agent: Mutt/1.5.24 (2015-08-30) X-SRS-Rewrite: SMTP reverse-path rewritten from by bombadil.infradead.org. See http://www.infradead.org/rpr.html X-Barracuda-Connect: UNKNOWN[198.137.202.9] X-Barracuda-Start-Time: 1455694324 X-Barracuda-Encrypted: ECDHE-RSA-AES128-GCM-SHA256 X-Barracuda-URL: https://192.48.157.11:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-BRTS-Status: 1 X-Barracuda-Spam-Score: 0.10 X-Barracuda-Spam-Status: No, SCORE=0.10 using per-user scores of TAG_LEVEL=1000.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.7 tests=BSF_SC0_MISMATCH_TO, RDNS_NONE X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.3.27096 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 0.00 BSF_SC0_MISMATCH_TO Envelope rcpt doesn't match header 0.10 RDNS_NONE Delivered to trusted network by a host with no rDNS On Wed, Feb 17, 2016 at 06:20:48PM +1100, Dave Chinner wrote: > + > + sbversion |= XFS_SB_VERSION_NLINKBIT; > + setlink_inode(id, be32_to_cpu(dip->di_nlink), type == DBM_DIR, security); > + So we always convert to v2 inodes here. Given that's it's xfs_check it's only in-core so harmless, but a comment here might be useful. From BATV+bffad35de576da5f5ff6+4560+infradead.org+hch@bombadil.srs.infradead.org Wed Feb 17 01:35:13 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=ham version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay2.corp.sgi.com [137.38.102.29]) by oss.sgi.com (Postfix) with ESMTP id D7A057CAD for ; Wed, 17 Feb 2016 01:35:13 -0600 (CST) Received: from cuda.sgi.com (cuda3.sgi.com [192.48.176.15]) by relay2.corp.sgi.com (Postfix) with ESMTP id A81D0304032 for ; Tue, 16 Feb 2016 23:35:13 -0800 (PST) X-ASG-Debug-ID: 1455694506-04cb6c1e5812dec0001-NocioJ Received: from bombadil.infradead.org ([198.137.202.9]) by cuda.sgi.com with ESMTP id yFif4sc88nwC5D5c (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128 verify=NO) for ; Tue, 16 Feb 2016 23:35:07 -0800 (PST) X-Barracuda-Envelope-From: BATV+bffad35de576da5f5ff6+4560+infradead.org+hch@bombadil.srs.infradead.org X-Barracuda-Apparent-Source-IP: 198.137.202.9 Received: from hch by bombadil.infradead.org with local (Exim 4.80.1 #2 (Red Hat Linux)) id 1aVwde-00013d-LD; Wed, 17 Feb 2016 07:35:06 +0000 Date: Tue, 16 Feb 2016 23:35:06 -0800 From: Christoph Hellwig To: Dave Chinner Cc: xfs@oss.sgi.com Subject: Re: [PATCH 12/15] xfs: use vfs inode nlink field everywhere Message-ID: <20160217073506.GC16363@infradead.org> X-ASG-Orig-Subj: Re: [PATCH 12/15] xfs: use vfs inode nlink field everywhere References: <1455693652-3899-1-git-send-email-david@fromorbit.com> <1455693652-3899-13-git-send-email-david@fromorbit.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1455693652-3899-13-git-send-email-david@fromorbit.com> User-Agent: Mutt/1.5.24 (2015-08-30) X-SRS-Rewrite: SMTP reverse-path rewritten from by bombadil.infradead.org. See http://www.infradead.org/rpr.html X-Barracuda-Connect: UNKNOWN[198.137.202.9] X-Barracuda-Start-Time: 1455694507 X-Barracuda-Encrypted: ECDHE-RSA-AES128-GCM-SHA256 X-Barracuda-URL: https://192.48.176.15:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-BRTS-Status: 1 X-Barracuda-Spam-Score: 0.10 X-Barracuda-Spam-Status: No, SCORE=0.10 using per-user scores of TAG_LEVEL=1000.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.7 tests=BSF_SC0_MISMATCH_TO, RDNS_NONE X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.3.27096 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 0.00 BSF_SC0_MISMATCH_TO Envelope rcpt doesn't match header 0.10 RDNS_NONE Delivered to trusted network by a host with no rDNS > index 685c7a7..1408be3 100644 > --- a/libxfs/libxfs_api_defs.h > +++ b/libxfs/libxfs_api_defs.h > @@ -108,4 +108,8 @@ > > #define xfs_verify_cksum libxfs_verify_cksum > > +/* inode link counts */ > +#define set_nlink(inode, nlink) ({ (inode)->i_nlink = (nlink); }) > +#define inc_nlink(inode) (inode)->i_nlink++ Can we defines these as inlines? > + ip->i_vnode.i_nlink++; /* account for . */ Shouldn't we use VFS_I() like everywhere else? From david@fromorbit.com Wed Feb 17 01:49:05 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=ham version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay3.corp.sgi.com [198.149.34.15]) by oss.sgi.com (Postfix) with ESMTP id 6FCF57CA8 for ; Wed, 17 Feb 2016 01:49:05 -0600 (CST) Received: from cuda.sgi.com (cuda1.sgi.com [192.48.157.11]) by relay3.corp.sgi.com (Postfix) with ESMTP id 0B678AC001 for ; Tue, 16 Feb 2016 23:49:04 -0800 (PST) X-ASG-Debug-ID: 1455695342-04bdf02d5e66e30001-NocioJ Received: from ipmail05.adl6.internode.on.net (ipmail05.adl6.internode.on.net [150.101.137.143]) by cuda.sgi.com with ESMTP id 5tYfUFzqS6tfKVfP for ; Tue, 16 Feb 2016 23:49:03 -0800 (PST) X-Barracuda-Envelope-From: david@fromorbit.com X-Barracuda-Apparent-Source-IP: 150.101.137.143 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: A2AbBwB/JcRWXJbY03ZegzqBP4Joo3gBAQEBAQEGi3KFSIQIhgcEAgKBPE0BAQEBAQEHRECEQgEBBCcTHCMQCAMOCgklDwUlAwcaE4gZuyoBAQEHAgEdGIUyhQOHYIEPAQSXA41QjnxEjgOEWSguiGEBAQE Received: from ppp118-211-216-150.lns20.syd4.internode.on.net (HELO dastard) ([118.211.216.150]) by ipmail05.adl6.internode.on.net with ESMTP; 17 Feb 2016 18:18:29 +1030 Received: from dave by dastard with local (Exim 4.80) (envelope-from ) id 1aVwqT-0004rV-Kl; Wed, 17 Feb 2016 18:48:21 +1100 Date: Wed, 17 Feb 2016 18:48:21 +1100 From: Dave Chinner To: Christoph Hellwig Cc: xfs@oss.sgi.com Subject: Re: [PATCH 11/15] xfs: move v1 inode conversion to xfs_inode_from_disk Message-ID: <20160217074821.GD19486@dastard> X-ASG-Orig-Subj: Re: [PATCH 11/15] xfs: move v1 inode conversion to xfs_inode_from_disk References: <1455693652-3899-1-git-send-email-david@fromorbit.com> <1455693652-3899-12-git-send-email-david@fromorbit.com> <20160217073204.GB16363@infradead.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20160217073204.GB16363@infradead.org> User-Agent: Mutt/1.5.21 (2010-09-15) X-Barracuda-Connect: ipmail05.adl6.internode.on.net[150.101.137.143] X-Barracuda-Start-Time: 1455695342 X-Barracuda-URL: https://192.48.157.11:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-BRTS-Status: 1 X-Barracuda-Spam-Score: 0.00 X-Barracuda-Spam-Status: No, SCORE=0.00 using per-user scores of TAG_LEVEL=1000.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.7 tests=BSF_SC0_MISMATCH_TO X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.3.27096 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 0.00 BSF_SC0_MISMATCH_TO Envelope rcpt doesn't match header On Tue, Feb 16, 2016 at 11:32:04PM -0800, Christoph Hellwig wrote: > On Wed, Feb 17, 2016 at 06:20:48PM +1100, Dave Chinner wrote: > > + > > + sbversion |= XFS_SB_VERSION_NLINKBIT; > > + setlink_inode(id, be32_to_cpu(dip->di_nlink), type == DBM_DIR, security); > > + > > So we always convert to v2 inodes here. Given that's it's xfs_check > it's only in-core so harmless, but a comment here might be useful. Yeah, probably. I'll have to look at this a bit closer - I think I assumed that we're always going to have v2 inode format here (like we do in the kernel), but that may not be true. I'll have a closer look. Cheers, Dave. -- Dave Chinner david@fromorbit.com From david@fromorbit.com Wed Feb 17 01:50:17 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=ham version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay3.corp.sgi.com [198.149.34.15]) by oss.sgi.com (Postfix) with ESMTP id 4E8537CA9 for ; Wed, 17 Feb 2016 01:50:17 -0600 (CST) Received: from cuda.sgi.com (cuda1.sgi.com [192.48.157.11]) by relay3.corp.sgi.com (Postfix) with ESMTP id EE147AC006 for ; Tue, 16 Feb 2016 23:50:16 -0800 (PST) X-ASG-Debug-ID: 1455695394-04bdf02d5e66f50001-NocioJ Received: from ipmail05.adl6.internode.on.net (ipmail05.adl6.internode.on.net [150.101.137.143]) by cuda.sgi.com with ESMTP id Tkfwc7yzNCrWOhSa for ; Tue, 16 Feb 2016 23:49:54 -0800 (PST) X-Barracuda-Envelope-From: david@fromorbit.com X-Barracuda-Apparent-Source-IP: 150.101.137.143 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: A2AbBwB/JcRWXJbY03ZegzqBP4Joo3gBAQEBAQEGi3KFSIQIhgcEAgKBPE0BAQEBAQEHRECEQgEBBCcTHCMQCAMOCgkMGQ8FJQMHGhOIGbsqAQEBBwIBHRiFMoUDhHSCbIEPAQSXA41QjnyOR4RZKC6IYQEBAQ Received: from ppp118-211-216-150.lns20.syd4.internode.on.net (HELO dastard) ([118.211.216.150]) by ipmail05.adl6.internode.on.net with ESMTP; 17 Feb 2016 18:19:53 +1030 Received: from dave by dastard with local (Exim 4.80) (envelope-from ) id 1aVwrx-0004ri-1l; Wed, 17 Feb 2016 18:49:53 +1100 Date: Wed, 17 Feb 2016 18:49:53 +1100 From: Dave Chinner To: Christoph Hellwig Cc: xfs@oss.sgi.com Subject: Re: [PATCH 12/15] xfs: use vfs inode nlink field everywhere Message-ID: <20160217074952.GE19486@dastard> X-ASG-Orig-Subj: Re: [PATCH 12/15] xfs: use vfs inode nlink field everywhere References: <1455693652-3899-1-git-send-email-david@fromorbit.com> <1455693652-3899-13-git-send-email-david@fromorbit.com> <20160217073506.GC16363@infradead.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20160217073506.GC16363@infradead.org> User-Agent: Mutt/1.5.21 (2010-09-15) X-Barracuda-Connect: ipmail05.adl6.internode.on.net[150.101.137.143] X-Barracuda-Start-Time: 1455695394 X-Barracuda-URL: https://192.48.157.11:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-BRTS-Status: 1 X-Barracuda-Spam-Score: 0.00 X-Barracuda-Spam-Status: No, SCORE=0.00 using per-user scores of TAG_LEVEL=1000.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.7 tests=BSF_SC0_MISMATCH_TO X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.3.27097 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 0.00 BSF_SC0_MISMATCH_TO Envelope rcpt doesn't match header On Tue, Feb 16, 2016 at 11:35:06PM -0800, Christoph Hellwig wrote: > > index 685c7a7..1408be3 100644 > > --- a/libxfs/libxfs_api_defs.h > > +++ b/libxfs/libxfs_api_defs.h > > @@ -108,4 +108,8 @@ > > > > #define xfs_verify_cksum libxfs_verify_cksum > > > > +/* inode link counts */ > > +#define set_nlink(inode, nlink) ({ (inode)->i_nlink = (nlink); }) > > +#define inc_nlink(inode) (inode)->i_nlink++ > > Can we defines these as inlines? I'll probably have to move them somewhere else for that. include/xfs_inode.h will probably work. > > > + ip->i_vnode.i_nlink++; /* account for . */ > > Shouldn't we use VFS_I() like everywhere else? inc_nlink(), too. I forgot to go back and change it when I decided on adding the wrapper. Cheers, Dave. -- Dave Chinner david@fromorbit.com From BATV+bffad35de576da5f5ff6+4560+infradead.org+hch@bombadil.srs.infradead.org Wed Feb 17 01:56:17 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=ham version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay1.corp.sgi.com [137.38.102.111]) by oss.sgi.com (Postfix) with ESMTP id 384307CA9 for ; Wed, 17 Feb 2016 01:56:17 -0600 (CST) Received: from cuda.sgi.com (cuda2.sgi.com [192.48.176.25]) by relay1.corp.sgi.com (Postfix) with ESMTP id 25C478F8035 for ; Tue, 16 Feb 2016 23:56:17 -0800 (PST) X-ASG-Debug-ID: 1455695774-04cbb0433314e060001-NocioJ Received: from bombadil.infradead.org ([198.137.202.9]) by cuda.sgi.com with ESMTP id 3BXi5AIX9BUVUEBG (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128 verify=NO) for ; Tue, 16 Feb 2016 23:56:15 -0800 (PST) X-Barracuda-Envelope-From: BATV+bffad35de576da5f5ff6+4560+infradead.org+hch@bombadil.srs.infradead.org X-Barracuda-Apparent-Source-IP: 198.137.202.9 Received: from hch by bombadil.infradead.org with local (Exim 4.80.1 #2 (Red Hat Linux)) id 1aVwy6-0003Vp-JS; Wed, 17 Feb 2016 07:56:14 +0000 Date: Tue, 16 Feb 2016 23:56:14 -0800 From: Christoph Hellwig To: Dave Chinner Cc: xfs@oss.sgi.com Subject: Re: [PATCH 00/15] xfsprogs: libxfs kernel sync to 4.6-for-next Message-ID: <20160217075614.GA11432@infradead.org> X-ASG-Orig-Subj: Re: [PATCH 00/15] xfsprogs: libxfs kernel sync to 4.6-for-next References: <1455693652-3899-1-git-send-email-david@fromorbit.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1455693652-3899-1-git-send-email-david@fromorbit.com> User-Agent: Mutt/1.5.24 (2015-08-30) X-SRS-Rewrite: SMTP reverse-path rewritten from by bombadil.infradead.org. See http://www.infradead.org/rpr.html X-Barracuda-Connect: UNKNOWN[198.137.202.9] X-Barracuda-Start-Time: 1455695775 X-Barracuda-Encrypted: ECDHE-RSA-AES128-GCM-SHA256 X-Barracuda-URL: https://192.48.176.25:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-BRTS-Status: 1 X-Barracuda-Spam-Score: 0.10 X-Barracuda-Spam-Status: No, SCORE=0.10 using per-user scores of TAG_LEVEL=1000.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.7 tests=BSF_SC0_MISMATCH_TO, RDNS_NONE X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.3.27097 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 0.00 BSF_SC0_MISMATCH_TO Envelope rcpt doesn't match header 0.10 RDNS_NONE Delivered to trusted network by a host with no rDNS The series looks fine modulo the nitpicks I posted. But shouldn't the rtinode fixes go into 4.5 as clear bugfixes? From david@fromorbit.com Wed Feb 17 02:16:33 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=ham version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay1.corp.sgi.com [137.38.102.111]) by oss.sgi.com (Postfix) with ESMTP id 3F31A7CA5 for ; Wed, 17 Feb 2016 02:16:33 -0600 (CST) Received: from cuda.sgi.com (cuda3.sgi.com [192.48.176.15]) by relay1.corp.sgi.com (Postfix) with ESMTP id 1E0B78F8033 for ; Wed, 17 Feb 2016 00:16:29 -0800 (PST) X-ASG-Debug-ID: 1455696986-04cb6c1e58130980001-NocioJ Received: from ipmail05.adl6.internode.on.net (ipmail05.adl6.internode.on.net [150.101.137.143]) by cuda.sgi.com with ESMTP id 0B3siVogslLipAAq for ; Wed, 17 Feb 2016 00:16:27 -0800 (PST) X-Barracuda-Envelope-From: david@fromorbit.com X-Barracuda-Apparent-Source-IP: 150.101.137.143 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: A2BBCQCMK8RWXJbY03ZegzqBP4Joo3gBAQEBAQEGi3I5hQ+ECIYHBAICgTxNAQEBAQEBB0RAhEIBAQQ6HCMQCAMOCgklDwUlAwcaE4gZuzIBAQEHAgEdGIUyhQOHYIEPBZcDjVCOfI5HhFkoLohhAQEB Received: from ppp118-211-216-150.lns20.syd4.internode.on.net (HELO dastard) ([118.211.216.150]) by ipmail05.adl6.internode.on.net with ESMTP; 17 Feb 2016 18:46:18 +1030 Received: from dave by dastard with local (Exim 4.80) (envelope-from ) id 1aVxHV-0004ug-Ia; Wed, 17 Feb 2016 19:16:17 +1100 Date: Wed, 17 Feb 2016 19:16:17 +1100 From: Dave Chinner To: Christoph Hellwig Cc: xfs@oss.sgi.com Subject: Re: [PATCH 00/15] xfsprogs: libxfs kernel sync to 4.6-for-next Message-ID: <20160217081617.GF19486@dastard> X-ASG-Orig-Subj: Re: [PATCH 00/15] xfsprogs: libxfs kernel sync to 4.6-for-next References: <1455693652-3899-1-git-send-email-david@fromorbit.com> <20160217075614.GA11432@infradead.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20160217075614.GA11432@infradead.org> User-Agent: Mutt/1.5.21 (2010-09-15) X-Barracuda-Connect: ipmail05.adl6.internode.on.net[150.101.137.143] X-Barracuda-Start-Time: 1455696986 X-Barracuda-URL: https://192.48.176.15:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-BRTS-Status: 1 X-Barracuda-Spam-Score: 0.00 X-Barracuda-Spam-Status: No, SCORE=0.00 using per-user scores of TAG_LEVEL=1000.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.7 tests=BSF_SC0_MISMATCH_TO X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.3.27097 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 0.00 BSF_SC0_MISMATCH_TO Envelope rcpt doesn't match header On Tue, Feb 16, 2016 at 11:56:14PM -0800, Christoph Hellwig wrote: > The series looks fine modulo the nitpicks I posted. > > But shouldn't the rtinode fixes go into 4.5 as clear bugfixes? None of the changes in those two patches actually affect userspace. These first is a log recovery fix, and the second was to silence a warning in kernel IO submission which doesn't exist in userspace. So apart from syncing up the code, AFAICT there isn't a compelling reason to pull them back into 4.5. Cheers, Dave. -- Dave Chinner david@fromorbit.com From david@fromorbit.com Wed Feb 17 02:30:05 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=ham version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay1.corp.sgi.com [137.38.102.111]) by oss.sgi.com (Postfix) with ESMTP id 148147CA3 for ; Wed, 17 Feb 2016 02:30:05 -0600 (CST) Received: from cuda.sgi.com (cuda2.sgi.com [192.48.176.25]) by relay1.corp.sgi.com (Postfix) with ESMTP id E860D8F8039 for ; Wed, 17 Feb 2016 00:30:04 -0800 (PST) X-ASG-Debug-ID: 1455697802-04cbb043321501c0001-NocioJ Received: from ipmail05.adl6.internode.on.net (ipmail05.adl6.internode.on.net [150.101.137.143]) by cuda.sgi.com with ESMTP id BZZMMttJHM5xBpUF for ; Wed, 17 Feb 2016 00:30:02 -0800 (PST) X-Barracuda-Envelope-From: david@fromorbit.com X-Barracuda-Apparent-Source-IP: 150.101.137.143 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: A2AbBwANL8RWXJbY03ZegzqBP4Joo3gBAQEBAQEGi3KFSIQIhgcEAgKBPU0BAQEBAQEHRECEQgEBBCcTHCMQCAMOCgklDwUlAwcaE4gZuy0BAQgCHhiFMoUDiG8FlwONUI58RI4DhFkoLohhAQEB Received: from ppp118-211-216-150.lns20.syd4.internode.on.net (HELO dastard) ([118.211.216.150]) by ipmail05.adl6.internode.on.net with ESMTP; 17 Feb 2016 19:00:01 +1030 Received: from dave by dastard with local (Exim 4.80) (envelope-from ) id 1aVxUm-0004w1-RP; Wed, 17 Feb 2016 19:30:00 +1100 Date: Wed, 17 Feb 2016 19:30:00 +1100 From: Dave Chinner To: Christoph Hellwig Cc: xfs@oss.sgi.com Subject: Re: [PATCH 11/15] xfs: move v1 inode conversion to xfs_inode_from_disk Message-ID: <20160217083000.GG19486@dastard> X-ASG-Orig-Subj: Re: [PATCH 11/15] xfs: move v1 inode conversion to xfs_inode_from_disk References: <1455693652-3899-1-git-send-email-david@fromorbit.com> <1455693652-3899-12-git-send-email-david@fromorbit.com> <20160217073204.GB16363@infradead.org> <20160217074821.GD19486@dastard> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20160217074821.GD19486@dastard> User-Agent: Mutt/1.5.21 (2010-09-15) X-Barracuda-Connect: ipmail05.adl6.internode.on.net[150.101.137.143] X-Barracuda-Start-Time: 1455697802 X-Barracuda-URL: https://192.48.176.25:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-BRTS-Status: 1 X-Barracuda-Spam-Score: 0.00 X-Barracuda-Spam-Status: No, SCORE=0.00 using per-user scores of TAG_LEVEL=1000.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.7 tests=BSF_SC0_MISMATCH_TO X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.3.27097 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 0.00 BSF_SC0_MISMATCH_TO Envelope rcpt doesn't match header On Wed, Feb 17, 2016 at 06:48:21PM +1100, Dave Chinner wrote: > On Tue, Feb 16, 2016 at 11:32:04PM -0800, Christoph Hellwig wrote: > > On Wed, Feb 17, 2016 at 06:20:48PM +1100, Dave Chinner wrote: > > > + > > > + sbversion |= XFS_SB_VERSION_NLINKBIT; > > > + setlink_inode(id, be32_to_cpu(dip->di_nlink), type == DBM_DIR, security); > > > + > > > > So we always convert to v2 inodes here. Given that's it's xfs_check > > it's only in-core so harmless, but a comment here might be useful. > > Yeah, probably. I'll have to look at this a bit closer - I think I > assumed that we're always going to have v2 inode format here (like > we do in the kernel), but that may not be true. I'll have a closer > look. having a closer look, the XFS_SB_VERSION_NLINKBIT that is set here in sbversion is never used, so I just removed it. I also changed it back to using the converted in-memory link count so it's always going to be correct now. Now it is just: + setlink_inode(id, xino.i_d.di_nlink, type == DBM_DIR, security); Cheers, Dave. -- Dave Chinner david@fromorbit.com From BATV+bffad35de576da5f5ff6+4560+infradead.org+hch@bombadil.srs.infradead.org Wed Feb 17 02:33:14 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=ham version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay3.corp.sgi.com [198.149.34.15]) by oss.sgi.com (Postfix) with ESMTP id 1C4C07CA3 for ; Wed, 17 Feb 2016 02:33:14 -0600 (CST) Received: from cuda.sgi.com (cuda3.sgi.com [192.48.176.15]) by relay3.corp.sgi.com (Postfix) with ESMTP id AC95DAC001 for ; Wed, 17 Feb 2016 00:33:13 -0800 (PST) X-ASG-Debug-ID: 1455697989-04cb6c1e58131890001-NocioJ Received: from bombadil.infradead.org ([198.137.202.9]) by cuda.sgi.com with ESMTP id HEcctY1Bk2gUyDL8 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128 verify=NO) for ; Wed, 17 Feb 2016 00:33:10 -0800 (PST) X-Barracuda-Envelope-From: BATV+bffad35de576da5f5ff6+4560+infradead.org+hch@bombadil.srs.infradead.org X-Barracuda-Apparent-Source-IP: 198.137.202.9 Received: from hch by bombadil.infradead.org with local (Exim 4.80.1 #2 (Red Hat Linux)) id 1aVxXp-0003UQ-1x; Wed, 17 Feb 2016 08:33:09 +0000 Date: Wed, 17 Feb 2016 00:33:08 -0800 From: Christoph Hellwig To: Dave Chinner Cc: Christoph Hellwig , xfs@oss.sgi.com Subject: Re: [PATCH 11/15] xfs: move v1 inode conversion to xfs_inode_from_disk Message-ID: <20160217083308.GA11766@infradead.org> X-ASG-Orig-Subj: Re: [PATCH 11/15] xfs: move v1 inode conversion to xfs_inode_from_disk References: <1455693652-3899-1-git-send-email-david@fromorbit.com> <1455693652-3899-12-git-send-email-david@fromorbit.com> <20160217073204.GB16363@infradead.org> <20160217074821.GD19486@dastard> <20160217083000.GG19486@dastard> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20160217083000.GG19486@dastard> User-Agent: Mutt/1.5.24 (2015-08-30) X-SRS-Rewrite: SMTP reverse-path rewritten from by bombadil.infradead.org. See http://www.infradead.org/rpr.html X-Barracuda-Connect: UNKNOWN[198.137.202.9] X-Barracuda-Start-Time: 1455697989 X-Barracuda-Encrypted: ECDHE-RSA-AES128-GCM-SHA256 X-Barracuda-URL: https://192.48.176.15:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-BRTS-Status: 1 X-Barracuda-Spam-Score: 0.10 X-Barracuda-Spam-Status: No, SCORE=0.10 using per-user scores of TAG_LEVEL=1000.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.7 tests=BSF_SC0_MISMATCH_TO, RDNS_NONE X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.3.27097 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 0.00 BSF_SC0_MISMATCH_TO Envelope rcpt doesn't match header 0.10 RDNS_NONE Delivered to trusted network by a host with no rDNS On Wed, Feb 17, 2016 at 07:30:00PM +1100, Dave Chinner wrote: > > Yeah, probably. I'll have to look at this a bit closer - I think I > > assumed that we're always going to have v2 inode format here (like > > we do in the kernel), but that may not be true. I'll have a closer > > look. > > having a closer look, the XFS_SB_VERSION_NLINKBIT that is set here > in sbversion is never used, so I just removed it. I also changed it > back to using the converted in-memory link count so it's always > going to be correct now. Now it is just: > > + setlink_inode(id, xino.i_d.di_nlink, type == DBM_DIR, security); Great. With that and the other nitpicks address: Reviewed-by: Christoph Hellwig for the whole series. From BATV+903d6f56de17421891ac+4560+infradead.org+hch@casper.srs.infradead.org Wed Feb 17 02:52:46 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=ham version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay1.corp.sgi.com [137.38.102.111]) by oss.sgi.com (Postfix) with ESMTP id 93B4D7CA3 for ; Wed, 17 Feb 2016 02:52:46 -0600 (CST) Received: from cuda.sgi.com (cuda1.sgi.com [192.48.157.11]) by relay1.corp.sgi.com (Postfix) with ESMTP id 4BF1E8F8033 for ; Wed, 17 Feb 2016 00:52:46 -0800 (PST) X-ASG-Debug-ID: 1455699161-04bdf02d5b6afc0001-NocioJ Received: from casper.infradead.org (casper.infradead.org [85.118.1.10]) by cuda.sgi.com with ESMTP id A8C2gLSB7NyoHMgI (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128 verify=NO) for ; Wed, 17 Feb 2016 00:52:43 -0800 (PST) X-Barracuda-Envelope-From: BATV+903d6f56de17421891ac+4560+infradead.org+hch@casper.srs.infradead.org X-Barracuda-Apparent-Source-IP: 85.118.1.10 Received: from 212095007014.public.telering.at ([212.95.7.14] helo=localhost) by casper.infradead.org with esmtpsa (Exim 4.85 #2 (Red Hat Linux)) id 1aVxqj-0003HG-AZ for xfs@oss.sgi.com; Wed, 17 Feb 2016 08:52:41 +0000 From: Christoph Hellwig To: xfs@oss.sgi.com Subject: [PATCH 1/3] xfs: remove xfs_trans_get_block_res Date: Wed, 17 Feb 2016 09:52:37 +0100 X-ASG-Orig-Subj: [PATCH 1/3] xfs: remove xfs_trans_get_block_res Message-Id: <1455699159-20906-1-git-send-email-hch@lst.de> X-Mailer: git-send-email 2.1.4 X-SRS-Rewrite: SMTP reverse-path rewritten from by casper.infradead.org. See http://www.infradead.org/rpr.html X-Barracuda-Connect: casper.infradead.org[85.118.1.10] X-Barracuda-Start-Time: 1455699162 X-Barracuda-Encrypted: ECDHE-RSA-AES128-GCM-SHA256 X-Barracuda-URL: https://192.48.157.11:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-BRTS-Status: 1 X-Barracuda-Spam-Score: 0.00 X-Barracuda-Spam-Status: No, SCORE=0.00 using per-user scores of TAG_LEVEL=1000.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.7 tests= X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.3.27098 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- Just use the t_blk_res field directly instead of obsfucating the reference by a macro. Signed-off-by: Christoph Hellwig Reviewed-by: Brian Foster --- fs/xfs/libxfs/xfs_bmap.c | 6 +++--- fs/xfs/libxfs/xfs_bmap_btree.c | 4 ++-- fs/xfs/xfs_trans.h | 1 - 3 files changed, 5 insertions(+), 6 deletions(-) diff --git a/fs/xfs/libxfs/xfs_bmap.c b/fs/xfs/libxfs/xfs_bmap.c index 6a05166..cb58d72 100644 --- a/fs/xfs/libxfs/xfs_bmap.c +++ b/fs/xfs/libxfs/xfs_bmap.c @@ -5210,7 +5210,7 @@ xfs_bunmapi( * This is better than zeroing it. */ ASSERT(del.br_state == XFS_EXT_NORM); - ASSERT(xfs_trans_get_block_res(tp) > 0); + ASSERT(tp->t_blk_res > 0); /* * If this spans a realtime extent boundary, * chop it back to the start of the one we end at. @@ -5241,7 +5241,7 @@ xfs_bunmapi( del.br_startblock += mod; } else if ((del.br_startoff == start && (del.br_state == XFS_EXT_UNWRITTEN || - xfs_trans_get_block_res(tp) == 0)) || + tp->t_blk_res == 0)) || !xfs_sb_version_hasextflgbit(&mp->m_sb)) { /* * Can't make it unwritten. There isn't @@ -5332,7 +5332,7 @@ xfs_bunmapi( * conversion to btree format, since the transaction * will be dirty. */ - if (!wasdel && xfs_trans_get_block_res(tp) == 0 && + if (!wasdel && tp->t_blk_res == 0 && XFS_IFORK_FORMAT(ip, whichfork) == XFS_DINODE_FMT_EXTENTS && XFS_IFORK_NEXTENTS(ip, whichfork) >= /* Note the >= */ XFS_IFORK_MAXEXT(ip, whichfork) && diff --git a/fs/xfs/libxfs/xfs_bmap_btree.c b/fs/xfs/libxfs/xfs_bmap_btree.c index e37508a..6282f6e 100644 --- a/fs/xfs/libxfs/xfs_bmap_btree.c +++ b/fs/xfs/libxfs/xfs_bmap_btree.c @@ -461,7 +461,7 @@ xfs_bmbt_alloc_block( * reservation amount is insufficient then we may fail a * block allocation here and corrupt the filesystem. */ - args.minleft = xfs_trans_get_block_res(args.tp); + args.minleft = args.tp->t_blk_res; } else if (cur->bc_private.b.flist->xbf_low) { args.type = XFS_ALLOCTYPE_START_BNO; } else { @@ -470,7 +470,7 @@ xfs_bmbt_alloc_block( args.minlen = args.maxlen = args.prod = 1; args.wasdel = cur->bc_private.b.flags & XFS_BTCUR_BPRV_WASDEL; - if (!args.wasdel && xfs_trans_get_block_res(args.tp) == 0) { + if (!args.wasdel && args.tp->t_blk_res == 0) { error = -ENOSPC; goto error0; } diff --git a/fs/xfs/xfs_trans.h b/fs/xfs/xfs_trans.h index 4643070..e7c49cf 100644 --- a/fs/xfs/xfs_trans.h +++ b/fs/xfs/xfs_trans.h @@ -133,7 +133,6 @@ typedef struct xfs_trans { * XFS transaction mechanism exported interfaces that are * actually macros. */ -#define xfs_trans_get_block_res(tp) ((tp)->t_blk_res) #define xfs_trans_set_sync(tp) ((tp)->t_flags |= XFS_TRANS_SYNC) #if defined(DEBUG) || defined(XFS_WARN) -- 2.1.4 From BATV+903d6f56de17421891ac+4560+infradead.org+hch@casper.srs.infradead.org Wed Feb 17 02:52:48 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=ham version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay3.corp.sgi.com [198.149.34.15]) by oss.sgi.com (Postfix) with ESMTP id 160EE7CA7 for ; Wed, 17 Feb 2016 02:52:48 -0600 (CST) Received: from cuda.sgi.com (cuda1.sgi.com [192.48.157.11]) by relay3.corp.sgi.com (Postfix) with ESMTP id 9C916AC010 for ; Wed, 17 Feb 2016 00:52:47 -0800 (PST) X-ASG-Debug-ID: 1455699163-04bdf02d5e6afd0001-NocioJ Received: from casper.infradead.org (casper.infradead.org [85.118.1.10]) by cuda.sgi.com with ESMTP id CaAKgQWV4r7vtUBh (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128 verify=NO) for ; Wed, 17 Feb 2016 00:52:44 -0800 (PST) X-Barracuda-Envelope-From: BATV+903d6f56de17421891ac+4560+infradead.org+hch@casper.srs.infradead.org X-Barracuda-Apparent-Source-IP: 85.118.1.10 Received: from 212095007014.public.telering.at ([212.95.7.14] helo=localhost) by casper.infradead.org with esmtpsa (Exim 4.85 #2 (Red Hat Linux)) id 1aVxql-0003HO-DL for xfs@oss.sgi.com; Wed, 17 Feb 2016 08:52:43 +0000 From: Christoph Hellwig To: xfs@oss.sgi.com Subject: [PATCH 3/3] xfs: remove transaction types Date: Wed, 17 Feb 2016 09:52:39 +0100 X-ASG-Orig-Subj: [PATCH 3/3] xfs: remove transaction types Message-Id: <1455699159-20906-3-git-send-email-hch@lst.de> X-Mailer: git-send-email 2.1.4 In-Reply-To: <1455699159-20906-1-git-send-email-hch@lst.de> References: <1455699159-20906-1-git-send-email-hch@lst.de> X-SRS-Rewrite: SMTP reverse-path rewritten from by casper.infradead.org. See http://www.infradead.org/rpr.html X-Barracuda-Connect: casper.infradead.org[85.118.1.10] X-Barracuda-Start-Time: 1455699164 X-Barracuda-Encrypted: ECDHE-RSA-AES128-GCM-SHA256 X-Barracuda-URL: https://192.48.157.11:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-BRTS-Status: 1 X-Barracuda-Spam-Score: 0.00 X-Barracuda-Spam-Status: No, SCORE=0.00 using per-user scores of TAG_LEVEL=1000.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.7 tests= X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.3.27098 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- These aren't used for CIL-style logging and can be dropped. Signed-off-by: Christoph Hellwig --- fs/xfs/libxfs/xfs_log_format.h | 5 +++ fs/xfs/libxfs/xfs_shared.h | 97 ------------------------------------------ fs/xfs/xfs_log.c | 57 +------------------------ fs/xfs/xfs_log.h | 3 +- fs/xfs/xfs_log_cil.c | 1 - fs/xfs/xfs_log_priv.h | 1 - fs/xfs/xfs_trace.h | 5 +-- fs/xfs/xfs_trans.c | 2 +- 8 files changed, 10 insertions(+), 161 deletions(-) diff --git a/fs/xfs/libxfs/xfs_log_format.h b/fs/xfs/libxfs/xfs_log_format.h index d54a801..e8f49c0 100644 --- a/fs/xfs/libxfs/xfs_log_format.h +++ b/fs/xfs/libxfs/xfs_log_format.h @@ -212,6 +212,11 @@ typedef struct xfs_trans_header { #define XFS_TRANS_HEADER_MAGIC 0x5452414e /* TRAN */ /* + * The only type valid for th_type in CIL-enabled file system logs: + */ +#define XFS_TRANS_CHECKPOINT 40 + +/* * Log item types. */ #define XFS_LI_EFI 0x1236 diff --git a/fs/xfs/libxfs/xfs_shared.h b/fs/xfs/libxfs/xfs_shared.h index 7d4ab64..16002b5 100644 --- a/fs/xfs/libxfs/xfs_shared.h +++ b/fs/xfs/libxfs/xfs_shared.h @@ -56,103 +56,6 @@ extern const struct xfs_buf_ops xfs_symlink_buf_ops; extern const struct xfs_buf_ops xfs_rtbuf_ops; /* - * Transaction types. Used to distinguish types of buffers. These never reach - * the log. - */ -#define XFS_TRANS_SETATTR_NOT_SIZE 1 -#define XFS_TRANS_SETATTR_SIZE 2 -#define XFS_TRANS_INACTIVE 3 -#define XFS_TRANS_CREATE 4 -#define XFS_TRANS_CREATE_TRUNC 5 -#define XFS_TRANS_TRUNCATE_FILE 6 -#define XFS_TRANS_REMOVE 7 -#define XFS_TRANS_LINK 8 -#define XFS_TRANS_RENAME 9 -#define XFS_TRANS_MKDIR 10 -#define XFS_TRANS_RMDIR 11 -#define XFS_TRANS_SYMLINK 12 -#define XFS_TRANS_SET_DMATTRS 13 -#define XFS_TRANS_GROWFS 14 -#define XFS_TRANS_STRAT_WRITE 15 -#define XFS_TRANS_DIOSTRAT 16 -/* 17 was XFS_TRANS_WRITE_SYNC */ -#define XFS_TRANS_WRITEID 18 -#define XFS_TRANS_ADDAFORK 19 -#define XFS_TRANS_ATTRINVAL 20 -#define XFS_TRANS_ATRUNCATE 21 -#define XFS_TRANS_ATTR_SET 22 -#define XFS_TRANS_ATTR_RM 23 -#define XFS_TRANS_ATTR_FLAG 24 -#define XFS_TRANS_CLEAR_AGI_BUCKET 25 -#define XFS_TRANS_SB_CHANGE 26 -/* - * Dummy entries since we use the transaction type to index into the - * trans_type[] in xlog_recover_print_trans_head() - */ -#define XFS_TRANS_DUMMY1 27 -#define XFS_TRANS_DUMMY2 28 -#define XFS_TRANS_QM_QUOTAOFF 29 -#define XFS_TRANS_QM_DQALLOC 30 -#define XFS_TRANS_QM_SETQLIM 31 -#define XFS_TRANS_QM_DQCLUSTER 32 -#define XFS_TRANS_QM_QINOCREATE 33 -#define XFS_TRANS_QM_QUOTAOFF_END 34 -#define XFS_TRANS_FSYNC_TS 35 -#define XFS_TRANS_GROWFSRT_ALLOC 36 -#define XFS_TRANS_GROWFSRT_ZERO 37 -#define XFS_TRANS_GROWFSRT_FREE 38 -#define XFS_TRANS_SWAPEXT 39 -#define XFS_TRANS_CHECKPOINT 40 -#define XFS_TRANS_ICREATE 41 -#define XFS_TRANS_CREATE_TMPFILE 42 -#define XFS_TRANS_TYPE_MAX 43 -/* new transaction types need to be reflected in xfs_logprint(8) */ - -#define XFS_TRANS_TYPES \ - { XFS_TRANS_SETATTR_NOT_SIZE, "SETATTR_NOT_SIZE" }, \ - { XFS_TRANS_SETATTR_SIZE, "SETATTR_SIZE" }, \ - { XFS_TRANS_INACTIVE, "INACTIVE" }, \ - { XFS_TRANS_CREATE, "CREATE" }, \ - { XFS_TRANS_CREATE_TRUNC, "CREATE_TRUNC" }, \ - { XFS_TRANS_TRUNCATE_FILE, "TRUNCATE_FILE" }, \ - { XFS_TRANS_REMOVE, "REMOVE" }, \ - { XFS_TRANS_LINK, "LINK" }, \ - { XFS_TRANS_RENAME, "RENAME" }, \ - { XFS_TRANS_MKDIR, "MKDIR" }, \ - { XFS_TRANS_RMDIR, "RMDIR" }, \ - { XFS_TRANS_SYMLINK, "SYMLINK" }, \ - { XFS_TRANS_SET_DMATTRS, "SET_DMATTRS" }, \ - { XFS_TRANS_GROWFS, "GROWFS" }, \ - { XFS_TRANS_STRAT_WRITE, "STRAT_WRITE" }, \ - { XFS_TRANS_DIOSTRAT, "DIOSTRAT" }, \ - { XFS_TRANS_WRITEID, "WRITEID" }, \ - { XFS_TRANS_ADDAFORK, "ADDAFORK" }, \ - { XFS_TRANS_ATTRINVAL, "ATTRINVAL" }, \ - { XFS_TRANS_ATRUNCATE, "ATRUNCATE" }, \ - { XFS_TRANS_ATTR_SET, "ATTR_SET" }, \ - { XFS_TRANS_ATTR_RM, "ATTR_RM" }, \ - { XFS_TRANS_ATTR_FLAG, "ATTR_FLAG" }, \ - { XFS_TRANS_CLEAR_AGI_BUCKET, "CLEAR_AGI_BUCKET" }, \ - { XFS_TRANS_SB_CHANGE, "SBCHANGE" }, \ - { XFS_TRANS_DUMMY1, "DUMMY1" }, \ - { XFS_TRANS_DUMMY2, "DUMMY2" }, \ - { XFS_TRANS_QM_QUOTAOFF, "QM_QUOTAOFF" }, \ - { XFS_TRANS_QM_DQALLOC, "QM_DQALLOC" }, \ - { XFS_TRANS_QM_SETQLIM, "QM_SETQLIM" }, \ - { XFS_TRANS_QM_DQCLUSTER, "QM_DQCLUSTER" }, \ - { XFS_TRANS_QM_QINOCREATE, "QM_QINOCREATE" }, \ - { XFS_TRANS_QM_QUOTAOFF_END, "QM_QOFF_END" }, \ - { XFS_TRANS_FSYNC_TS, "FSYNC_TS" }, \ - { XFS_TRANS_GROWFSRT_ALLOC, "GROWFSRT_ALLOC" }, \ - { XFS_TRANS_GROWFSRT_ZERO, "GROWFSRT_ZERO" }, \ - { XFS_TRANS_GROWFSRT_FREE, "GROWFSRT_FREE" }, \ - { XFS_TRANS_SWAPEXT, "SWAPEXT" }, \ - { XFS_TRANS_CHECKPOINT, "CHECKPOINT" }, \ - { XFS_TRANS_ICREATE, "ICREATE" }, \ - { XFS_TRANS_CREATE_TMPFILE, "CREATE_TMPFILE" }, \ - { XLOG_UNMOUNT_REC_TYPE, "UNMOUNT" } - -/* * This structure is used to track log items associated with * a transaction. It points to the log item and keeps some * flags to track the state of the log item. It also tracks diff --git a/fs/xfs/xfs_log.c b/fs/xfs/xfs_log.c index 40b700d..9c76951 100644 --- a/fs/xfs/xfs_log.c +++ b/fs/xfs/xfs_log.c @@ -435,8 +435,7 @@ xfs_log_reserve( int cnt, struct xlog_ticket **ticp, __uint8_t client, - bool permanent, - uint t_type) + bool permanent) { struct xlog *log = mp->m_log; struct xlog_ticket *tic; @@ -456,7 +455,6 @@ xfs_log_reserve( if (!tic) return -ENOMEM; - tic->t_trans_type = t_type; *ticp = tic; xlog_grant_push_ail(log, tic->t_cnt ? tic->t_unit_res * tic->t_cnt @@ -823,8 +821,7 @@ xfs_log_unmount_write(xfs_mount_t *mp) } while (iclog != first_iclog); #endif if (! (XLOG_FORCED_SHUTDOWN(log))) { - error = xfs_log_reserve(mp, 600, 1, &tic, - XFS_LOG, 0, XLOG_UNMOUNT_REC_TYPE); + error = xfs_log_reserve(mp, 600, 1, &tic, XFS_LOG, 0); if (!error) { /* the data section must be 32 bit size aligned */ struct { @@ -2029,57 +2026,8 @@ xlog_print_tic_res( "commit", "trans header" }; - static char *trans_type_str[XFS_TRANS_TYPE_MAX] = { - "SETATTR_NOT_SIZE", - "SETATTR_SIZE", - "INACTIVE", - "CREATE", - "CREATE_TRUNC", - "TRUNCATE_FILE", - "REMOVE", - "LINK", - "RENAME", - "MKDIR", - "RMDIR", - "SYMLINK", - "SET_DMATTRS", - "GROWFS", - "STRAT_WRITE", - "DIOSTRAT", - "WRITE_SYNC", - "WRITEID", - "ADDAFORK", - "ATTRINVAL", - "ATRUNCATE", - "ATTR_SET", - "ATTR_RM", - "ATTR_FLAG", - "CLEAR_AGI_BUCKET", - "QM_SBCHANGE", - "DUMMY1", - "DUMMY2", - "QM_QUOTAOFF", - "QM_DQALLOC", - "QM_SETQLIM", - "QM_DQCLUSTER", - "QM_QINOCREATE", - "QM_QUOTAOFF_END", - "FSYNC_TS", - "GROWFSRT_ALLOC", - "GROWFSRT_ZERO", - "GROWFSRT_FREE", - "SWAPEXT", - "CHECKPOINT", - "ICREATE", - "CREATE_TMPFILE" - }; xfs_warn(mp, "xlog_write: reservation summary:"); - xfs_warn(mp, " trans type = %s (%u)", - ((ticket->t_trans_type <= 0 || - ticket->t_trans_type > XFS_TRANS_TYPE_MAX) ? - "bad-trans-type" : trans_type_str[ticket->t_trans_type-1]), - ticket->t_trans_type); xfs_warn(mp, " unit res = %d bytes", ticket->t_unit_res); xfs_warn(mp, " current res = %d bytes", @@ -3705,7 +3653,6 @@ xlog_ticket_alloc( tic->t_tid = prandom_u32(); tic->t_clientid = client; tic->t_flags = XLOG_TIC_INITED; - tic->t_trans_type = 0; if (permanent) tic->t_flags |= XLOG_TIC_PERM_RESERV; diff --git a/fs/xfs/xfs_log.h b/fs/xfs/xfs_log.h index aa533a7..80ba0c0 100644 --- a/fs/xfs/xfs_log.h +++ b/fs/xfs/xfs_log.h @@ -161,8 +161,7 @@ int xfs_log_reserve(struct xfs_mount *mp, int count, struct xlog_ticket **ticket, __uint8_t clientid, - bool permanent, - uint t_type); + bool permanent); int xfs_log_regrant(struct xfs_mount *mp, struct xlog_ticket *tic); int xfs_log_unmount_write(struct xfs_mount *mp); void xfs_log_unmount(struct xfs_mount *mp); diff --git a/fs/xfs/xfs_log_cil.c b/fs/xfs/xfs_log_cil.c index 4e76493..5e54e79 100644 --- a/fs/xfs/xfs_log_cil.c +++ b/fs/xfs/xfs_log_cil.c @@ -51,7 +51,6 @@ xlog_cil_ticket_alloc( tic = xlog_ticket_alloc(log, 0, 1, XFS_TRANSACTION, 0, KM_SLEEP|KM_NOFS); - tic->t_trans_type = XFS_TRANS_CHECKPOINT; /* * set the current reservation to zero so we know to steal the basic diff --git a/fs/xfs/xfs_log_priv.h b/fs/xfs/xfs_log_priv.h index ed88963..765f084 100644 --- a/fs/xfs/xfs_log_priv.h +++ b/fs/xfs/xfs_log_priv.h @@ -175,7 +175,6 @@ typedef struct xlog_ticket { char t_cnt; /* current count : 1 */ char t_clientid; /* who does this belong to; : 1 */ char t_flags; /* properties of reservation : 1 */ - uint t_trans_type; /* transaction type : 4 */ /* reservation array fields */ uint t_res_num; /* num in array : 4 */ diff --git a/fs/xfs/xfs_trace.h b/fs/xfs/xfs_trace.h index c8d5842..f081294 100644 --- a/fs/xfs/xfs_trace.h +++ b/fs/xfs/xfs_trace.h @@ -944,7 +944,6 @@ DECLARE_EVENT_CLASS(xfs_loggrant_class, TP_ARGS(log, tic), TP_STRUCT__entry( __field(dev_t, dev) - __field(unsigned, trans_type) __field(char, ocnt) __field(char, cnt) __field(int, curr_res) @@ -962,7 +961,6 @@ DECLARE_EVENT_CLASS(xfs_loggrant_class, ), TP_fast_assign( __entry->dev = log->l_mp->m_super->s_dev; - __entry->trans_type = tic->t_trans_type; __entry->ocnt = tic->t_ocnt; __entry->cnt = tic->t_cnt; __entry->curr_res = tic->t_curr_res; @@ -980,14 +978,13 @@ DECLARE_EVENT_CLASS(xfs_loggrant_class, __entry->curr_block = log->l_curr_block; __entry->tail_lsn = atomic64_read(&log->l_tail_lsn); ), - TP_printk("dev %d:%d type %s t_ocnt %u t_cnt %u t_curr_res %u " + TP_printk("dev %d:%d t_ocnt %u t_cnt %u t_curr_res %u " "t_unit_res %u t_flags %s reserveq %s " "writeq %s grant_reserve_cycle %d " "grant_reserve_bytes %d grant_write_cycle %d " "grant_write_bytes %d curr_cycle %d curr_block %d " "tail_cycle %d tail_block %d", MAJOR(__entry->dev), MINOR(__entry->dev), - __print_symbolic(__entry->trans_type, XFS_TRANS_TYPES), __entry->ocnt, __entry->cnt, __entry->curr_res, diff --git a/fs/xfs/xfs_trans.c b/fs/xfs/xfs_trans.c index cbbef3a..5052714 100644 --- a/fs/xfs/xfs_trans.c +++ b/fs/xfs/xfs_trans.c @@ -177,7 +177,7 @@ xfs_trans_reserve( resp->tr_logres, resp->tr_logcount, &tp->t_ticket, XFS_TRANSACTION, - permanent, 0); + permanent); } if (error) -- 2.1.4 From BATV+903d6f56de17421891ac+4560+infradead.org+hch@casper.srs.infradead.org Wed Feb 17 02:52:50 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=ham version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay3.corp.sgi.com [198.149.34.15]) by oss.sgi.com (Postfix) with ESMTP id 71D5F7CAB for ; Wed, 17 Feb 2016 02:52:50 -0600 (CST) Received: from cuda.sgi.com (cuda3.sgi.com [192.48.176.15]) by relay3.corp.sgi.com (Postfix) with ESMTP id D1E97AC010 for ; Wed, 17 Feb 2016 00:52:49 -0800 (PST) X-ASG-Debug-ID: 1455699162-04cb6c1e561330f0001-NocioJ Received: from casper.infradead.org (casper.infradead.org [85.118.1.10]) by cuda.sgi.com with ESMTP id dTkhMqWIprF1o602 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128 verify=NO) for ; Wed, 17 Feb 2016 00:52:43 -0800 (PST) X-Barracuda-Envelope-From: BATV+903d6f56de17421891ac+4560+infradead.org+hch@casper.srs.infradead.org X-Barracuda-Apparent-Source-IP: 85.118.1.10 Received: from 212095007014.public.telering.at ([212.95.7.14] helo=localhost) by casper.infradead.org with esmtpsa (Exim 4.85 #2 (Red Hat Linux)) id 1aVxqk-0003HK-Al for xfs@oss.sgi.com; Wed, 17 Feb 2016 08:52:42 +0000 From: Christoph Hellwig To: xfs@oss.sgi.com Subject: [PATCH 2/3] xfs: better xfs_trans_alloc interface Date: Wed, 17 Feb 2016 09:52:38 +0100 X-ASG-Orig-Subj: [PATCH 2/3] xfs: better xfs_trans_alloc interface Message-Id: <1455699159-20906-2-git-send-email-hch@lst.de> X-Mailer: git-send-email 2.1.4 In-Reply-To: <1455699159-20906-1-git-send-email-hch@lst.de> References: <1455699159-20906-1-git-send-email-hch@lst.de> X-SRS-Rewrite: SMTP reverse-path rewritten from by casper.infradead.org. See http://www.infradead.org/rpr.html X-Barracuda-Connect: casper.infradead.org[85.118.1.10] X-Barracuda-Start-Time: 1455699163 X-Barracuda-Encrypted: ECDHE-RSA-AES128-GCM-SHA256 X-Barracuda-URL: https://192.48.176.15:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-BRTS-Status: 1 X-Barracuda-Spam-Score: 0.00 X-Barracuda-Spam-Status: No, SCORE=0.00 using per-user scores of TAG_LEVEL=1000.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.7 tests= X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.3.27098 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- Merge xfs_trans_reserve and xfs_trans_alloc into a single function call that returns a transaction with all the required log and block reservations, and which allows passing transaction flags directly to avoid the cumbersome _xfs_trans_alloc interface. While we're at it we also get rid of the transaction type argument that has been superflous since we stopped supporting the non-CIL logging mode. The guts of it will be removed in another patch. Signed-off-by: Christoph Hellwig --- fs/xfs/libxfs/xfs_attr.c | 58 +++++++----------------------- fs/xfs/libxfs/xfs_bmap.c | 22 +++++------- fs/xfs/libxfs/xfs_sb.c | 8 ++--- fs/xfs/libxfs/xfs_shared.h | 5 +-- fs/xfs/xfs_aops.c | 19 ++++------ fs/xfs/xfs_attr_inactive.c | 16 ++------- fs/xfs/xfs_bmap_util.c | 45 +++++++----------------- fs/xfs/xfs_dquot.c | 7 ++-- fs/xfs/xfs_file.c | 8 ++--- fs/xfs/xfs_fsops.c | 10 ++---- fs/xfs/xfs_inode.c | 60 ++++++++++++------------------- fs/xfs/xfs_ioctl.c | 13 +++---- fs/xfs/xfs_iomap.c | 53 +++++++++------------------- fs/xfs/xfs_iops.c | 22 +++++------- fs/xfs/xfs_log_recover.c | 10 +++--- fs/xfs/xfs_pnfs.c | 7 ++-- fs/xfs/xfs_qm.c | 9 ++--- fs/xfs/xfs_qm_syscalls.c | 26 ++++---------- fs/xfs/xfs_rtalloc.c | 21 +++++------ fs/xfs/xfs_symlink.c | 16 ++++----- fs/xfs/xfs_trans.c | 88 +++++++++++++++++++++------------------------- fs/xfs/xfs_trans.h | 8 ++--- 22 files changed, 188 insertions(+), 343 deletions(-) diff --git a/fs/xfs/libxfs/xfs_attr.c b/fs/xfs/libxfs/xfs_attr.c index fa3b948..4e126f4 100644 --- a/fs/xfs/libxfs/xfs_attr.c +++ b/fs/xfs/libxfs/xfs_attr.c @@ -242,37 +242,21 @@ xfs_attr_set( return error; } - /* - * Start our first transaction of the day. - * - * All future transactions during this code must be "chained" off - * this one via the trans_dup() call. All transactions will contain - * the inode, and the inode will always be marked with trans_ihold(). - * Since the inode will be locked in all transactions, we must log - * the inode in every transaction to let it float upward through - * the log. - */ - args.trans = xfs_trans_alloc(mp, XFS_TRANS_ATTR_SET); + tres.tr_logres = M_RES(mp)->tr_attrsetm.tr_logres + + M_RES(mp)->tr_attrsetrt.tr_logres * args.total; + tres.tr_logcount = XFS_ATTRSET_LOG_COUNT; + tres.tr_logflags = XFS_TRANS_PERM_LOG_RES; /* * Root fork attributes can use reserved data blocks for this * operation if necessary */ - - if (rsvd) - args.trans->t_flags |= XFS_TRANS_RESERVE; - - tres.tr_logres = M_RES(mp)->tr_attrsetm.tr_logres + - M_RES(mp)->tr_attrsetrt.tr_logres * args.total; - tres.tr_logcount = XFS_ATTRSET_LOG_COUNT; - tres.tr_logflags = XFS_TRANS_PERM_LOG_RES; - error = xfs_trans_reserve(args.trans, &tres, args.total, 0); - if (error) { - xfs_trans_cancel(args.trans); + error = xfs_trans_alloc(mp, &tres, args.total, 0, + rsvd ? XFS_TRANS_RESERVE : 0, &args.trans); + if (error) return error; - } - xfs_ilock(dp, XFS_ILOCK_EXCL); + xfs_ilock(dp, XFS_ILOCK_EXCL); error = xfs_trans_reserve_quota_nblks(args.trans, dp, args.total, 0, rsvd ? XFS_QMOPT_RES_REGBLKS | XFS_QMOPT_FORCE_RES : XFS_QMOPT_RES_REGBLKS); @@ -429,31 +413,15 @@ xfs_attr_remove( return error; /* - * Start our first transaction of the day. - * - * All future transactions during this code must be "chained" off - * this one via the trans_dup() call. All transactions will contain - * the inode, and the inode will always be marked with trans_ihold(). - * Since the inode will be locked in all transactions, we must log - * the inode in every transaction to let it float upward through - * the log. - */ - args.trans = xfs_trans_alloc(mp, XFS_TRANS_ATTR_RM); - - /* * Root fork attributes can use reserved data blocks for this * operation if necessary */ - - if (flags & ATTR_ROOT) - args.trans->t_flags |= XFS_TRANS_RESERVE; - - error = xfs_trans_reserve(args.trans, &M_RES(mp)->tr_attrrm, - XFS_ATTRRM_SPACE_RES(mp), 0); - if (error) { - xfs_trans_cancel(args.trans); + error = xfs_trans_alloc(mp, &M_RES(mp)->tr_attrrm, + XFS_ATTRRM_SPACE_RES(mp), 0, + (flags & ATTR_ROOT) ? XFS_TRANS_RESERVE : 0, + &args.trans); + if (error) return error; - } xfs_ilock(dp, XFS_ILOCK_EXCL); /* diff --git a/fs/xfs/libxfs/xfs_bmap.c b/fs/xfs/libxfs/xfs_bmap.c index cb58d72..2bc7e49 100644 --- a/fs/xfs/libxfs/xfs_bmap.c +++ b/fs/xfs/libxfs/xfs_bmap.c @@ -1124,15 +1124,14 @@ xfs_bmap_add_attrfork( mp = ip->i_mount; ASSERT(!XFS_NOT_DQATTACHED(mp, ip)); - tp = xfs_trans_alloc(mp, XFS_TRANS_ADDAFORK); + blks = XFS_ADDAFORK_SPACE_RES(mp); - if (rsvd) - tp->t_flags |= XFS_TRANS_RESERVE; - error = xfs_trans_reserve(tp, &M_RES(mp)->tr_addafork, blks, 0); - if (error) { - xfs_trans_cancel(tp); + + error = xfs_trans_alloc(mp, &M_RES(mp)->tr_addafork, blks, 0, + rsvd ? XFS_TRANS_RESERVE : 0, &tp); + if (error) return error; - } + xfs_ilock(ip, XFS_ILOCK_EXCL); error = xfs_trans_reserve_quota_nblks(tp, ip, blks, 0, rsvd ? XFS_QMOPT_RES_REGBLKS | XFS_QMOPT_FORCE_RES : @@ -5958,13 +5957,10 @@ xfs_bmap_split_extent( xfs_fsblock_t firstfsb; int error; - tp = xfs_trans_alloc(mp, XFS_TRANS_DIOSTRAT); - error = xfs_trans_reserve(tp, &M_RES(mp)->tr_write, - XFS_DIOSTRAT_SPACE_RES(mp, 0), 0); - if (error) { - xfs_trans_cancel(tp); + error = xfs_trans_alloc(mp, &M_RES(mp)->tr_write, + XFS_DIOSTRAT_SPACE_RES(mp, 0), 0, 0, &tp); + if (error) return error; - } xfs_ilock(ip, XFS_ILOCK_EXCL); xfs_trans_ijoin(tp, ip, XFS_ILOCK_EXCL); diff --git a/fs/xfs/libxfs/xfs_sb.c b/fs/xfs/libxfs/xfs_sb.c index 8a53eaa..12ca867 100644 --- a/fs/xfs/libxfs/xfs_sb.c +++ b/fs/xfs/libxfs/xfs_sb.c @@ -838,12 +838,10 @@ xfs_sync_sb( struct xfs_trans *tp; int error; - tp = _xfs_trans_alloc(mp, XFS_TRANS_SB_CHANGE, KM_SLEEP); - error = xfs_trans_reserve(tp, &M_RES(mp)->tr_sb, 0, 0); - if (error) { - xfs_trans_cancel(tp); + error = xfs_trans_alloc(mp, &M_RES(mp)->tr_sb, 0, 0, + XFS_TRANS_NO_WRITECOUNT, &tp); + if (error) return error; - } xfs_log_sb(tp); if (wait) diff --git a/fs/xfs/libxfs/xfs_shared.h b/fs/xfs/libxfs/xfs_shared.h index 81ac870..7d4ab64 100644 --- a/fs/xfs/libxfs/xfs_shared.h +++ b/fs/xfs/libxfs/xfs_shared.h @@ -181,8 +181,9 @@ int xfs_log_calc_minimum_size(struct xfs_mount *); #define XFS_TRANS_SYNC 0x08 /* make commit synchronous */ #define XFS_TRANS_DQ_DIRTY 0x10 /* at least one dquot in trx dirty */ #define XFS_TRANS_RESERVE 0x20 /* OK to use reserved data blocks */ -#define XFS_TRANS_FREEZE_PROT 0x40 /* Transaction has elevated writer - count in superblock */ +#define XFS_TRANS_NO_WRITECOUNT 0x40 /* do not elevate SB writecount */ +#define XFS_TRANS_NOFS 0x80 /* pass KM_NOFS to kmem_alloc */ + /* * Field values for xfs_trans_mod_sb. */ diff --git a/fs/xfs/xfs_aops.c b/fs/xfs/xfs_aops.c index 7a467b3..5d48aca 100644 --- a/fs/xfs/xfs_aops.c +++ b/fs/xfs/xfs_aops.c @@ -120,13 +120,9 @@ xfs_setfilesize_trans_alloc( struct xfs_trans *tp; int error; - tp = xfs_trans_alloc(mp, XFS_TRANS_FSYNC_TS); - - error = xfs_trans_reserve(tp, &M_RES(mp)->tr_fsyncts, 0, 0); - if (error) { - xfs_trans_cancel(tp); + error = xfs_trans_alloc(mp, &M_RES(mp)->tr_fsyncts, 0, 0, 0, &tp); + if (error) return error; - } ioend->io_append_trans = tp; @@ -1386,13 +1382,10 @@ xfs_end_io_direct_write( trace_xfs_end_io_direct_write_append(ip, offset, size); - tp = xfs_trans_alloc(mp, XFS_TRANS_FSYNC_TS); - error = xfs_trans_reserve(tp, &M_RES(mp)->tr_fsyncts, 0, 0); - if (error) { - xfs_trans_cancel(tp); - return error; - } - error = xfs_setfilesize(ip, tp, offset, size); + error = xfs_trans_alloc(mp, &M_RES(mp)->tr_fsyncts, 0, 0, 0, + &tp); + if (!error) + error = xfs_setfilesize(ip, tp, offset, size); } return error; diff --git a/fs/xfs/xfs_attr_inactive.c b/fs/xfs/xfs_attr_inactive.c index 2bb959a..55d2149 100644 --- a/fs/xfs/xfs_attr_inactive.c +++ b/fs/xfs/xfs_attr_inactive.c @@ -405,21 +405,11 @@ xfs_attr_inactive( goto out_destroy_fork; xfs_iunlock(dp, lock_mode); - /* - * Start our first transaction of the day. - * - * All future transactions during this code must be "chained" off - * this one via the trans_dup() call. All transactions will contain - * the inode, and the inode will always be marked with trans_ihold(). - * Since the inode will be locked in all transactions, we must log - * the inode in every transaction to let it float upward through - * the log. - */ lock_mode = 0; - trans = xfs_trans_alloc(mp, XFS_TRANS_ATTRINVAL); - error = xfs_trans_reserve(trans, &M_RES(mp)->tr_attrinval, 0, 0); + + error = xfs_trans_alloc(mp, &M_RES(mp)->tr_attrinval, 0, 0, 0, &trans); if (error) - goto out_cancel; + goto out_destroy_fork; lock_mode = XFS_ILOCK_EXCL; xfs_ilock(dp, lock_mode); diff --git a/fs/xfs/xfs_bmap_util.c b/fs/xfs/xfs_bmap_util.c index fd7f51c..d641569 100644 --- a/fs/xfs/xfs_bmap_util.c +++ b/fs/xfs/xfs_bmap_util.c @@ -899,19 +899,15 @@ xfs_free_eofblocks( * Free them up now by truncating the file to * its current size. */ - tp = xfs_trans_alloc(mp, XFS_TRANS_INACTIVE); - if (need_iolock) { - if (!xfs_ilock_nowait(ip, XFS_IOLOCK_EXCL)) { - xfs_trans_cancel(tp); + if (!xfs_ilock_nowait(ip, XFS_IOLOCK_EXCL)) return -EAGAIN; - } } - error = xfs_trans_reserve(tp, &M_RES(mp)->tr_itruncate, 0, 0); + error = xfs_trans_alloc(mp, &M_RES(mp)->tr_itruncate, 0, 0, 0, + &tp); if (error) { ASSERT(XFS_FORCED_SHUTDOWN(mp)); - xfs_trans_cancel(tp); if (need_iolock) xfs_iunlock(ip, XFS_IOLOCK_EXCL); return error; @@ -1036,9 +1032,9 @@ xfs_alloc_file_space( /* * Allocate and setup the transaction. */ - tp = xfs_trans_alloc(mp, XFS_TRANS_DIOSTRAT); - error = xfs_trans_reserve(tp, &M_RES(mp)->tr_write, - resblks, resrtextents); + error = xfs_trans_alloc(mp, &M_RES(mp)->tr_write, resblks, + resrtextents, 0, &tp); + /* * Check for running out of space */ @@ -1047,7 +1043,6 @@ xfs_alloc_file_space( * Free the transaction structure. */ ASSERT(error == -ENOSPC || XFS_FORCED_SHUTDOWN(mp)); - xfs_trans_cancel(tp); break; } xfs_ilock(ip, XFS_ILOCK_EXCL); @@ -1310,18 +1305,10 @@ xfs_free_file_space( * transaction to dip into the reserve blocks to ensure * the freeing of the space succeeds at ENOSPC. */ - tp = xfs_trans_alloc(mp, XFS_TRANS_DIOSTRAT); - error = xfs_trans_reserve(tp, &M_RES(mp)->tr_write, resblks, 0); - - /* - * check for running out of space - */ + error = xfs_trans_alloc(mp, &M_RES(mp)->tr_write, resblks, 0, 0, + &tp); if (error) { - /* - * Free the transaction structure. - */ ASSERT(error == -ENOSPC || XFS_FORCED_SHUTDOWN(mp)); - xfs_trans_cancel(tp); break; } xfs_ilock(ip, XFS_ILOCK_EXCL); @@ -1481,19 +1468,16 @@ xfs_shift_file_space( } while (!error && !done) { - tp = xfs_trans_alloc(mp, XFS_TRANS_DIOSTRAT); /* * We would need to reserve permanent block for transaction. * This will come into picture when after shifting extent into * hole we found that adjacent extents can be merged which * may lead to freeing of a block during record update. */ - error = xfs_trans_reserve(tp, &M_RES(mp)->tr_write, - XFS_DIOSTRAT_SPACE_RES(mp, 0), 0); - if (error) { - xfs_trans_cancel(tp); + error = xfs_trans_alloc(mp, &M_RES(mp)->tr_write, + XFS_DIOSTRAT_SPACE_RES(mp, 0), 0, 0, &tp); + if (error) break; - } xfs_ilock(ip, XFS_ILOCK_EXCL); error = xfs_trans_reserve_quota(tp, mp, ip->i_udquot, @@ -1746,12 +1730,9 @@ xfs_swap_extents( if (error) goto out_unlock; - tp = xfs_trans_alloc(mp, XFS_TRANS_SWAPEXT); - error = xfs_trans_reserve(tp, &M_RES(mp)->tr_ichange, 0, 0); - if (error) { - xfs_trans_cancel(tp); + error = xfs_trans_alloc(mp, &M_RES(mp)->tr_ichange, 0, 0, 0, &tp); + if (error) goto out_unlock; - } /* * Lock and join the inodes to the tansaction so that transaction commit diff --git a/fs/xfs/xfs_dquot.c b/fs/xfs/xfs_dquot.c index 316b2a1..23e2432 100644 --- a/fs/xfs/xfs_dquot.c +++ b/fs/xfs/xfs_dquot.c @@ -614,11 +614,10 @@ xfs_qm_dqread( trace_xfs_dqread(dqp); if (flags & XFS_QMOPT_DQALLOC) { - tp = xfs_trans_alloc(mp, XFS_TRANS_QM_DQALLOC); - error = xfs_trans_reserve(tp, &M_RES(mp)->tr_qm_dqalloc, - XFS_QM_DQALLOC_SPACE_RES(mp), 0); + error = xfs_trans_alloc(mp, &M_RES(mp)->tr_qm_dqalloc, + XFS_QM_DQALLOC_SPACE_RES(mp), 0, 0, &tp); if (error) - goto error1; + goto error0; } /* diff --git a/fs/xfs/xfs_file.c b/fs/xfs/xfs_file.c index ac0fd32..98bbd8f 100644 --- a/fs/xfs/xfs_file.c +++ b/fs/xfs/xfs_file.c @@ -145,12 +145,10 @@ xfs_update_prealloc_flags( struct xfs_trans *tp; int error; - tp = xfs_trans_alloc(ip->i_mount, XFS_TRANS_WRITEID); - error = xfs_trans_reserve(tp, &M_RES(ip->i_mount)->tr_writeid, 0, 0); - if (error) { - xfs_trans_cancel(tp); + error = xfs_trans_alloc(ip->i_mount, &M_RES(ip->i_mount)->tr_writeid, + 0, 0, 0, &tp); + if (error) return error; - } xfs_ilock(ip, XFS_ILOCK_EXCL); xfs_trans_ijoin(tp, ip, XFS_ILOCK_EXCL); diff --git a/fs/xfs/xfs_fsops.c b/fs/xfs/xfs_fsops.c index ee3aaa0a..9c563d4 100644 --- a/fs/xfs/xfs_fsops.c +++ b/fs/xfs/xfs_fsops.c @@ -198,14 +198,10 @@ xfs_growfs_data_private( return error; } - tp = xfs_trans_alloc(mp, XFS_TRANS_GROWFS); - tp->t_flags |= XFS_TRANS_RESERVE; - error = xfs_trans_reserve(tp, &M_RES(mp)->tr_growdata, - XFS_GROWFS_SPACE_RES(mp), 0); - if (error) { - xfs_trans_cancel(tp); + error = xfs_trans_alloc(mp, &M_RES(mp)->tr_growdata, + XFS_GROWFS_SPACE_RES(mp), 0, XFS_TRANS_RESERVE, &tp); + if (error) return error; - } /* * Write new AG headers to disk. Non-transactional, but written diff --git a/fs/xfs/xfs_inode.c b/fs/xfs/xfs_inode.c index 96f606d..b82c729 100644 --- a/fs/xfs/xfs_inode.c +++ b/fs/xfs/xfs_inode.c @@ -1161,11 +1161,9 @@ xfs_create( rdev = 0; resblks = XFS_MKDIR_SPACE_RES(mp, name->len); tres = &M_RES(mp)->tr_mkdir; - tp = xfs_trans_alloc(mp, XFS_TRANS_MKDIR); } else { resblks = XFS_CREATE_SPACE_RES(mp, name->len); tres = &M_RES(mp)->tr_create; - tp = xfs_trans_alloc(mp, XFS_TRANS_CREATE); } /* @@ -1174,20 +1172,19 @@ xfs_create( * the case we'll drop the one we have and get a more * appropriate transaction later. */ - error = xfs_trans_reserve(tp, tres, resblks, 0); + error = xfs_trans_alloc(mp, tres, resblks, 0, 0, &tp); if (error == -ENOSPC) { /* flush outstanding delalloc blocks and retry */ xfs_flush_inodes(mp); - error = xfs_trans_reserve(tp, tres, resblks, 0); + error = xfs_trans_alloc(mp, tres, resblks, 0, 0, &tp); } if (error == -ENOSPC) { /* No space at all so try a "no-allocation" reservation */ resblks = 0; - error = xfs_trans_reserve(tp, tres, 0, 0); + error = xfs_trans_alloc(mp, tres, 0, 0, 0, &tp); } if (error) - goto out_trans_cancel; - + goto out_release_inode; xfs_ilock(dp, XFS_IOLOCK_EXCL | XFS_ILOCK_EXCL | XFS_IOLOCK_PARENT | XFS_ILOCK_PARENT); @@ -1337,17 +1334,16 @@ xfs_create_tmpfile( return error; resblks = XFS_IALLOC_SPACE_RES(mp); - tp = xfs_trans_alloc(mp, XFS_TRANS_CREATE_TMPFILE); - tres = &M_RES(mp)->tr_create_tmpfile; - error = xfs_trans_reserve(tp, tres, resblks, 0); + + error = xfs_trans_alloc(mp, tres, resblks, 0, 0, &tp); if (error == -ENOSPC) { /* No space at all so try a "no-allocation" reservation */ resblks = 0; - error = xfs_trans_reserve(tp, tres, 0, 0); + error = xfs_trans_alloc(mp, tres, 0, 0, 0, &tp); } if (error) - goto out_trans_cancel; + goto out_release_inode; error = xfs_trans_reserve_quota(tp, mp, udqp, gdqp, pdqp, resblks, 1, 0); @@ -1432,15 +1428,14 @@ xfs_link( if (error) goto std_return; - tp = xfs_trans_alloc(mp, XFS_TRANS_LINK); resblks = XFS_LINK_SPACE_RES(mp, target_name->len); - error = xfs_trans_reserve(tp, &M_RES(mp)->tr_link, resblks, 0); + error = xfs_trans_alloc(mp, &M_RES(mp)->tr_link, resblks, 0, 0, &tp); if (error == -ENOSPC) { resblks = 0; - error = xfs_trans_reserve(tp, &M_RES(mp)->tr_link, 0, 0); + error = xfs_trans_alloc(mp, &M_RES(mp)->tr_link, 0, 0, 0, &tp); } if (error) - goto error_return; + goto std_return; xfs_ilock(tdp, XFS_IOLOCK_EXCL | XFS_IOLOCK_PARENT); xfs_lock_two_inodes(sip, tdp, XFS_ILOCK_EXCL); @@ -1710,11 +1705,9 @@ xfs_inactive_truncate( struct xfs_trans *tp; int error; - tp = xfs_trans_alloc(mp, XFS_TRANS_INACTIVE); - error = xfs_trans_reserve(tp, &M_RES(mp)->tr_itruncate, 0, 0); + error = xfs_trans_alloc(mp, &M_RES(mp)->tr_itruncate, 0, 0, 0, &tp); if (error) { ASSERT(XFS_FORCED_SHUTDOWN(mp)); - xfs_trans_cancel(tp); return error; } @@ -1764,8 +1757,6 @@ xfs_inactive_ifree( struct xfs_trans *tp; int error; - tp = xfs_trans_alloc(mp, XFS_TRANS_INACTIVE); - /* * The ifree transaction might need to allocate blocks for record * insertion to the finobt. We don't want to fail here at ENOSPC, so @@ -1781,9 +1772,8 @@ xfs_inactive_ifree( * now remains allocated and sits on the unlinked list until the fs is * repaired. */ - tp->t_flags |= XFS_TRANS_RESERVE; - error = xfs_trans_reserve(tp, &M_RES(mp)->tr_ifree, - XFS_IFREE_SPACE_RES(mp), 0); + error = xfs_trans_alloc(mp, &M_RES(mp)->tr_ifree, + XFS_IFREE_SPACE_RES(mp), 0, XFS_TRANS_RESERVE, &tp); if (error) { if (error == -ENOSPC) { xfs_warn_ratelimited(mp, @@ -1792,7 +1782,6 @@ xfs_inactive_ifree( } else { ASSERT(XFS_FORCED_SHUTDOWN(mp)); } - xfs_trans_cancel(tp); return error; } @@ -2525,11 +2514,6 @@ xfs_remove( if (error) goto std_return; - if (is_dir) - tp = xfs_trans_alloc(mp, XFS_TRANS_RMDIR); - else - tp = xfs_trans_alloc(mp, XFS_TRANS_REMOVE); - /* * We try to get the real space reservation first, * allowing for directory btree deletion(s) implying @@ -2540,14 +2524,15 @@ xfs_remove( * block from the directory. */ resblks = XFS_REMOVE_SPACE_RES(mp); - error = xfs_trans_reserve(tp, &M_RES(mp)->tr_remove, resblks, 0); + error = xfs_trans_alloc(mp, &M_RES(mp)->tr_remove, resblks, 0, 0, &tp); if (error == -ENOSPC) { resblks = 0; - error = xfs_trans_reserve(tp, &M_RES(mp)->tr_remove, 0, 0); + error = xfs_trans_alloc(mp, &M_RES(mp)->tr_remove, 0, 0, 0, + &tp); } if (error) { ASSERT(error != -ENOSPC); - goto out_trans_cancel; + goto std_return; } xfs_ilock(dp, XFS_IOLOCK_EXCL | XFS_IOLOCK_PARENT); @@ -2910,15 +2895,15 @@ xfs_rename( xfs_sort_for_rename(src_dp, target_dp, src_ip, target_ip, wip, inodes, &num_inodes); - tp = xfs_trans_alloc(mp, XFS_TRANS_RENAME); spaceres = XFS_RENAME_SPACE_RES(mp, target_name->len); - error = xfs_trans_reserve(tp, &M_RES(mp)->tr_rename, spaceres, 0); + error = xfs_trans_alloc(mp, &M_RES(mp)->tr_rename, spaceres, 0, 0, &tp); if (error == -ENOSPC) { spaceres = 0; - error = xfs_trans_reserve(tp, &M_RES(mp)->tr_rename, 0, 0); + error = xfs_trans_alloc(mp, &M_RES(mp)->tr_rename, 0, 0, 0, + &tp); } if (error) - goto out_trans_cancel; + goto out_release_wip; /* * Attach the dquots to the inodes @@ -3155,6 +3140,7 @@ out_bmap_cancel: xfs_bmap_cancel(&free_list); out_trans_cancel: xfs_trans_cancel(tp); +out_release_wip: if (wip) IRELE(wip); return error; diff --git a/fs/xfs/xfs_ioctl.c b/fs/xfs/xfs_ioctl.c index 81d6d62..405648b 100644 --- a/fs/xfs/xfs_ioctl.c +++ b/fs/xfs/xfs_ioctl.c @@ -334,12 +334,10 @@ xfs_set_dmattrs( if (XFS_FORCED_SHUTDOWN(mp)) return -EIO; - tp = xfs_trans_alloc(mp, XFS_TRANS_SET_DMATTRS); - error = xfs_trans_reserve(tp, &M_RES(mp)->tr_ichange, 0, 0); - if (error) { - xfs_trans_cancel(tp); + error = xfs_trans_alloc(mp, &M_RES(mp)->tr_ichange, 0, 0, 0, &tp); + if (error) return error; - } + xfs_ilock(ip, XFS_ILOCK_EXCL); xfs_trans_ijoin(tp, ip, XFS_ILOCK_EXCL); @@ -1078,10 +1076,9 @@ xfs_ioctl_setattr_get_trans( if (XFS_FORCED_SHUTDOWN(mp)) return ERR_PTR(-EIO); - tp = xfs_trans_alloc(mp, XFS_TRANS_SETATTR_NOT_SIZE); - error = xfs_trans_reserve(tp, &M_RES(mp)->tr_ichange, 0, 0); + error = xfs_trans_alloc(mp, &M_RES(mp)->tr_ichange, 0, 0, 0, &tp); if (error) - goto out_cancel; + return ERR_PTR(error); xfs_ilock(ip, XFS_ILOCK_EXCL); xfs_trans_ijoin(tp, ip, XFS_ILOCK_EXCL); diff --git a/fs/xfs/xfs_iomap.c b/fs/xfs/xfs_iomap.c index d81bdc0..5839135 100644 --- a/fs/xfs/xfs_iomap.c +++ b/fs/xfs/xfs_iomap.c @@ -132,6 +132,7 @@ xfs_iomap_write_direct( int error; int lockmode; int bmapi_flags = XFS_BMAPI_PREALLOC; + uint tflags = 0; rt = XFS_IS_REALTIME_INODE(ip); extsz = xfs_get_extsz_hint(ip); @@ -192,11 +193,6 @@ xfs_iomap_write_direct( return error; /* - * Allocate and setup the transaction - */ - tp = xfs_trans_alloc(mp, XFS_TRANS_DIOSTRAT); - - /* * For DAX, we do not allocate unwritten extents, but instead we zero * the block before we commit the transaction. Ideally we'd like to do * this outside the transaction context, but if we commit and then crash @@ -209,23 +205,17 @@ xfs_iomap_write_direct( * the reserve block pool for bmbt block allocation if there is no space * left but we need to do unwritten extent conversion. */ - if (IS_DAX(VFS_I(ip))) { bmapi_flags = XFS_BMAPI_CONVERT | XFS_BMAPI_ZERO; if (ISUNWRITTEN(imap)) { - tp->t_flags |= XFS_TRANS_RESERVE; + tflags |= XFS_TRANS_RESERVE; resblks = XFS_DIOSTRAT_SPACE_RES(mp, 0) << 1; } } - error = xfs_trans_reserve(tp, &M_RES(mp)->tr_write, - resblks, resrtextents); - /* - * Check for running out of space, note: need lock to return - */ - if (error) { - xfs_trans_cancel(tp); + error = xfs_trans_alloc(mp, &M_RES(mp)->tr_write, resblks, resrtextents, + tflags, &tp); + if (error) return error; - } lockmode = XFS_ILOCK_EXCL; xfs_ilock(ip, lockmode); @@ -726,15 +716,13 @@ xfs_iomap_write_allocate( nimaps = 0; while (nimaps == 0) { - tp = xfs_trans_alloc(mp, XFS_TRANS_STRAT_WRITE); - tp->t_flags |= XFS_TRANS_RESERVE; nres = XFS_EXTENTADD_SPACE_RES(mp, XFS_DATA_FORK); - error = xfs_trans_reserve(tp, &M_RES(mp)->tr_write, - nres, 0); - if (error) { - xfs_trans_cancel(tp); + + error = xfs_trans_alloc(mp, &M_RES(mp)->tr_write, nres, + 0, XFS_TRANS_RESERVE, &tp); + if (error) return error; - } + xfs_ilock(ip, XFS_ILOCK_EXCL); xfs_trans_ijoin(tp, ip, 0); @@ -878,25 +866,18 @@ xfs_iomap_write_unwritten( do { /* - * set up a transaction to convert the range of extents + * Set up a transaction to convert the range of extents * from unwritten to real. Do allocations in a loop until * we have covered the range passed in. * - * Note that we open code the transaction allocation here - * to pass KM_NOFS--we can't risk to recursing back into - * the filesystem here as we might be asked to write out - * the same inode that we complete here and might deadlock - * on the iolock. + * Note that we can't risk to recursing back into the filesystem + * here as we might be asked to write out the same inode that we + * complete here and might deadlock on the iolock. */ - sb_start_intwrite(mp->m_super); - tp = _xfs_trans_alloc(mp, XFS_TRANS_STRAT_WRITE, KM_NOFS); - tp->t_flags |= XFS_TRANS_RESERVE | XFS_TRANS_FREEZE_PROT; - error = xfs_trans_reserve(tp, &M_RES(mp)->tr_write, - resblks, 0); - if (error) { - xfs_trans_cancel(tp); + error = xfs_trans_alloc(mp, &M_RES(mp)->tr_write, resblks, 0, + XFS_TRANS_RESERVE | XFS_TRANS_NOFS, &tp); + if (error) return error; - } xfs_ilock(ip, XFS_ILOCK_EXCL); xfs_trans_ijoin(tp, ip, 0); diff --git a/fs/xfs/xfs_iops.c b/fs/xfs/xfs_iops.c index 0d38b1d..3d9b1c48 100644 --- a/fs/xfs/xfs_iops.c +++ b/fs/xfs/xfs_iops.c @@ -599,10 +599,9 @@ xfs_setattr_nonsize( return error; } - tp = xfs_trans_alloc(mp, XFS_TRANS_SETATTR_NOT_SIZE); - error = xfs_trans_reserve(tp, &M_RES(mp)->tr_ichange, 0, 0); + error = xfs_trans_alloc(mp, &M_RES(mp)->tr_ichange, 0, 0, 0, &tp); if (error) - goto out_trans_cancel; + goto out_dqrele; xfs_ilock(ip, XFS_ILOCK_EXCL); @@ -724,8 +723,7 @@ xfs_setattr_nonsize( out_unlock: xfs_iunlock(ip, XFS_ILOCK_EXCL); -out_trans_cancel: - xfs_trans_cancel(tp); +out_dqrele: xfs_qm_dqrele(udqp); xfs_qm_dqrele(gdqp); return error; @@ -834,7 +832,7 @@ xfs_setattr_size( * We have to do all the page cache truncate work outside the * transaction context as the "lock" order is page lock->log space * reservation as defined by extent allocation in the writeback path. - * Hence a truncate can fail with ENOMEM from xfs_trans_reserve(), but + * Hence a truncate can fail with ENOMEM from xfs_trans_alloc(), but * having already truncated the in-memory version of the file (i.e. made * user visible changes). There's not much we can do about this, except * to hope that the caller sees ENOMEM and retries the truncate @@ -849,10 +847,9 @@ xfs_setattr_size( return error; truncate_setsize(inode, newsize); - tp = xfs_trans_alloc(mp, XFS_TRANS_SETATTR_SIZE); - error = xfs_trans_reserve(tp, &M_RES(mp)->tr_itruncate, 0, 0); + error = xfs_trans_alloc(mp, &M_RES(mp)->tr_itruncate, 0, 0, 0, &tp); if (error) - goto out_trans_cancel; + return error; lock_flags |= XFS_ILOCK_EXCL; xfs_ilock(ip, XFS_ILOCK_EXCL); @@ -971,12 +968,9 @@ xfs_vn_update_time( trace_xfs_update_time(ip); - tp = xfs_trans_alloc(mp, XFS_TRANS_FSYNC_TS); - error = xfs_trans_reserve(tp, &M_RES(mp)->tr_fsyncts, 0, 0); - if (error) { - xfs_trans_cancel(tp); + error = xfs_trans_alloc(mp, &M_RES(mp)->tr_fsyncts, 0, 0, 0, &tp); + if (error) return error; - } xfs_ilock(ip, XFS_ILOCK_EXCL); if (flags & S_CTIME) diff --git a/fs/xfs/xfs_log_recover.c b/fs/xfs/xfs_log_recover.c index 1dc0e14..27e4962 100644 --- a/fs/xfs/xfs_log_recover.c +++ b/fs/xfs/xfs_log_recover.c @@ -4140,10 +4140,9 @@ xlog_recover_process_efi( } } - tp = xfs_trans_alloc(mp, 0); - error = xfs_trans_reserve(tp, &M_RES(mp)->tr_itruncate, 0, 0); + error = xfs_trans_alloc(mp, &M_RES(mp)->tr_itruncate, 0, 0, 0, &tp); if (error) - goto abort_error; + return error; efdp = xfs_trans_get_efd(tp, efip, efip->efi_format.efi_nextents); for (i = 0; i < efip->efi_format.efi_nextents; i++) { @@ -4290,10 +4289,9 @@ xlog_recover_clear_agi_bucket( int offset; int error; - tp = xfs_trans_alloc(mp, XFS_TRANS_CLEAR_AGI_BUCKET); - error = xfs_trans_reserve(tp, &M_RES(mp)->tr_clearagi, 0, 0); + error = xfs_trans_alloc(mp, &M_RES(mp)->tr_clearagi, 0, 0, 0, &tp); if (error) - goto out_abort; + goto out_error; error = xfs_read_agi(mp, tp, agno, &agibp); if (error) diff --git a/fs/xfs/xfs_pnfs.c b/fs/xfs/xfs_pnfs.c index ade236e..3332bae 100644 --- a/fs/xfs/xfs_pnfs.c +++ b/fs/xfs/xfs_pnfs.c @@ -308,12 +308,9 @@ xfs_fs_commit_blocks( goto out_drop_iolock; } - tp = xfs_trans_alloc(mp, XFS_TRANS_SETATTR_NOT_SIZE); - error = xfs_trans_reserve(tp, &M_RES(mp)->tr_ichange, 0, 0); - if (error) { - xfs_trans_cancel(tp); + error = xfs_trans_alloc(mp, &M_RES(mp)->tr_ichange, 0, 0, 0, &tp); + if (error) goto out_drop_iolock; - } xfs_ilock(ip, XFS_ILOCK_EXCL); xfs_trans_ijoin(tp, ip, XFS_ILOCK_EXCL); diff --git a/fs/xfs/xfs_qm.c b/fs/xfs/xfs_qm.c index be125e1..a60d9e2 100644 --- a/fs/xfs/xfs_qm.c +++ b/fs/xfs/xfs_qm.c @@ -783,13 +783,10 @@ xfs_qm_qino_alloc( } } - tp = xfs_trans_alloc(mp, XFS_TRANS_QM_QINOCREATE); - error = xfs_trans_reserve(tp, &M_RES(mp)->tr_create, - XFS_QM_QINOCREATE_SPACE_RES(mp), 0); - if (error) { - xfs_trans_cancel(tp); + error = xfs_trans_alloc(mp, &M_RES(mp)->tr_create, + XFS_QM_QINOCREATE_SPACE_RES(mp), 0, 0, &tp); + if (error) return error; - } if (need_alloc) { error = xfs_dir_ialloc(&tp, NULL, S_IFREG, 1, 0, 0, 1, ip, diff --git a/fs/xfs/xfs_qm_syscalls.c b/fs/xfs/xfs_qm_syscalls.c index f4d0e0a..475a388 100644 --- a/fs/xfs/xfs_qm_syscalls.c +++ b/fs/xfs/xfs_qm_syscalls.c @@ -236,10 +236,8 @@ xfs_qm_scall_trunc_qfile( xfs_ilock(ip, XFS_IOLOCK_EXCL); - tp = xfs_trans_alloc(mp, XFS_TRANS_TRUNCATE_FILE); - error = xfs_trans_reserve(tp, &M_RES(mp)->tr_itruncate, 0, 0); + error = xfs_trans_alloc(mp, &M_RES(mp)->tr_itruncate, 0, 0, 0, &tp); if (error) { - xfs_trans_cancel(tp); xfs_iunlock(ip, XFS_IOLOCK_EXCL); goto out_put; } @@ -436,12 +434,9 @@ xfs_qm_scall_setqlim( defq = xfs_get_defquota(dqp, q); xfs_dqunlock(dqp); - tp = xfs_trans_alloc(mp, XFS_TRANS_QM_SETQLIM); - error = xfs_trans_reserve(tp, &M_RES(mp)->tr_qm_setqlim, 0, 0); - if (error) { - xfs_trans_cancel(tp); + error = xfs_trans_alloc(mp, &M_RES(mp)->tr_qm_setqlim, 0, 0, 0, &tp); + if (error) goto out_rele; - } xfs_dqlock(dqp); xfs_trans_dqjoin(tp, dqp); @@ -569,13 +564,9 @@ xfs_qm_log_quotaoff_end( int error; xfs_qoff_logitem_t *qoffi; - tp = xfs_trans_alloc(mp, XFS_TRANS_QM_QUOTAOFF_END); - - error = xfs_trans_reserve(tp, &M_RES(mp)->tr_qm_equotaoff, 0, 0); - if (error) { - xfs_trans_cancel(tp); + error = xfs_trans_alloc(mp, &M_RES(mp)->tr_qm_equotaoff, 0, 0, 0, &tp); + if (error) return error; - } qoffi = xfs_trans_get_qoff_item(tp, startqoff, flags & XFS_ALL_QUOTA_ACCT); @@ -603,12 +594,9 @@ xfs_qm_log_quotaoff( *qoffstartp = NULL; - tp = xfs_trans_alloc(mp, XFS_TRANS_QM_QUOTAOFF); - error = xfs_trans_reserve(tp, &M_RES(mp)->tr_qm_quotaoff, 0, 0); - if (error) { - xfs_trans_cancel(tp); + error = xfs_trans_alloc(mp, &M_RES(mp)->tr_qm_quotaoff, 0, 0, 0, &tp); + if (error) goto out; - } qoffi = xfs_trans_get_qoff_item(tp, NULL, flags & XFS_ALL_QUOTA_ACCT); xfs_trans_log_quotaoff_item(tp, qoffi); diff --git a/fs/xfs/xfs_rtalloc.c b/fs/xfs/xfs_rtalloc.c index abf4443..3938b37 100644 --- a/fs/xfs/xfs_rtalloc.c +++ b/fs/xfs/xfs_rtalloc.c @@ -780,15 +780,14 @@ xfs_growfs_rt_alloc( * Allocate space to the file, as necessary. */ while (oblocks < nblocks) { - tp = xfs_trans_alloc(mp, XFS_TRANS_GROWFSRT_ALLOC); resblks = XFS_GROWFSRT_SPACE_RES(mp, nblocks - oblocks); /* * Reserve space & log for one extent added to the file. */ - error = xfs_trans_reserve(tp, &M_RES(mp)->tr_growrtalloc, - resblks, 0); + error = xfs_trans_alloc(mp, &M_RES(mp)->tr_growrtalloc, resblks, + 0, 0, &tp); if (error) - goto out_trans_cancel; + return error; /* * Lock the inode. */ @@ -823,14 +822,13 @@ xfs_growfs_rt_alloc( for (bno = map.br_startoff, fsbno = map.br_startblock; bno < map.br_startoff + map.br_blockcount; bno++, fsbno++) { - tp = xfs_trans_alloc(mp, XFS_TRANS_GROWFSRT_ZERO); /* * Reserve log for one block zeroing. */ - error = xfs_trans_reserve(tp, &M_RES(mp)->tr_growrtzero, - 0, 0); + error = xfs_trans_alloc(mp, &M_RES(mp)->tr_growrtzero, + 0, 0, 0, &tp); if (error) - goto out_trans_cancel; + return error; /* * Lock the bitmap inode. */ @@ -994,11 +992,10 @@ xfs_growfs_rt( /* * Start a transaction, get the log reservation. */ - tp = xfs_trans_alloc(mp, XFS_TRANS_GROWFSRT_FREE); - error = xfs_trans_reserve(tp, &M_RES(mp)->tr_growrtfree, - 0, 0); + error = xfs_trans_alloc(mp, &M_RES(mp)->tr_growrtfree, 0, 0, 0, + &tp); if (error) - goto error_cancel; + break; /* * Lock out other callers by grabbing the bitmap inode lock. */ diff --git a/fs/xfs/xfs_symlink.c b/fs/xfs/xfs_symlink.c index b44284c..c3aeaa8 100644 --- a/fs/xfs/xfs_symlink.c +++ b/fs/xfs/xfs_symlink.c @@ -221,7 +221,6 @@ xfs_symlink( if (error) return error; - tp = xfs_trans_alloc(mp, XFS_TRANS_SYMLINK); /* * The symlink will fit into the inode data fork? * There can't be any attributes so we get the whole variable part. @@ -231,13 +230,15 @@ xfs_symlink( else fs_blocks = xfs_symlink_blocks(mp, pathlen); resblks = XFS_SYMLINK_SPACE_RES(mp, link_name->len, fs_blocks); - error = xfs_trans_reserve(tp, &M_RES(mp)->tr_symlink, resblks, 0); + + error = xfs_trans_alloc(mp, &M_RES(mp)->tr_symlink, resblks, 0, 0, &tp); if (error == -ENOSPC && fs_blocks == 0) { resblks = 0; - error = xfs_trans_reserve(tp, &M_RES(mp)->tr_symlink, 0, 0); + error = xfs_trans_alloc(mp, &M_RES(mp)->tr_symlink, 0, 0, 0, + &tp); } if (error) - goto out_trans_cancel; + goto out_release_inode; xfs_ilock(dp, XFS_IOLOCK_EXCL | XFS_ILOCK_EXCL | XFS_IOLOCK_PARENT | XFS_ILOCK_PARENT); @@ -455,12 +456,9 @@ xfs_inactive_symlink_rmt( */ ASSERT(ip->i_d.di_nextents > 0 && ip->i_d.di_nextents <= 2); - tp = xfs_trans_alloc(mp, XFS_TRANS_INACTIVE); - error = xfs_trans_reserve(tp, &M_RES(mp)->tr_itruncate, 0, 0); - if (error) { - xfs_trans_cancel(tp); + error = xfs_trans_alloc(mp, &M_RES(mp)->tr_itruncate, 0, 0, 0, &tp); + if (error) return error; - } xfs_ilock(ip, XFS_ILOCK_EXCL); xfs_trans_ijoin(tp, ip, 0); diff --git a/fs/xfs/xfs_trans.c b/fs/xfs/xfs_trans.c index 748b16a..cbbef3a 100644 --- a/fs/xfs/xfs_trans.c +++ b/fs/xfs/xfs_trans.c @@ -47,47 +47,6 @@ xfs_trans_init( } /* - * This routine is called to allocate a transaction structure. - * The type parameter indicates the type of the transaction. These - * are enumerated in xfs_trans.h. - * - * Dynamically allocate the transaction structure from the transaction - * zone, initialize it, and return it to the caller. - */ -xfs_trans_t * -xfs_trans_alloc( - xfs_mount_t *mp, - uint type) -{ - xfs_trans_t *tp; - - sb_start_intwrite(mp->m_super); - tp = _xfs_trans_alloc(mp, type, KM_SLEEP); - tp->t_flags |= XFS_TRANS_FREEZE_PROT; - return tp; -} - -xfs_trans_t * -_xfs_trans_alloc( - xfs_mount_t *mp, - uint type, - xfs_km_flags_t memflags) -{ - xfs_trans_t *tp; - - WARN_ON(mp->m_super->s_writers.frozen == SB_FREEZE_COMPLETE); - atomic_inc(&mp->m_active_trans); - - tp = kmem_zone_zalloc(xfs_trans_zone, memflags); - tp->t_magic = XFS_TRANS_HEADER_MAGIC; - tp->t_type = type; - tp->t_mountp = mp; - INIT_LIST_HEAD(&tp->t_items); - INIT_LIST_HEAD(&tp->t_busy); - return tp; -} - -/* * Free the transaction structure. If there is more clean up * to do when the structure is freed, add it here. */ @@ -99,7 +58,7 @@ xfs_trans_free( xfs_extent_busy_clear(tp->t_mountp, &tp->t_busy, false); atomic_dec(&tp->t_mountp->m_active_trans); - if (tp->t_flags & XFS_TRANS_FREEZE_PROT) + if (!(tp->t_flags & XFS_TRANS_NO_WRITECOUNT)) sb_end_intwrite(tp->t_mountp->m_super); xfs_trans_free_dqinfo(tp); kmem_zone_free(xfs_trans_zone, tp); @@ -125,7 +84,6 @@ xfs_trans_dup( * Initialize the new transaction structure. */ ntp->t_magic = XFS_TRANS_HEADER_MAGIC; - ntp->t_type = tp->t_type; ntp->t_mountp = tp->t_mountp; INIT_LIST_HEAD(&ntp->t_items); INIT_LIST_HEAD(&ntp->t_busy); @@ -135,9 +93,9 @@ xfs_trans_dup( ntp->t_flags = XFS_TRANS_PERM_LOG_RES | (tp->t_flags & XFS_TRANS_RESERVE) | - (tp->t_flags & XFS_TRANS_FREEZE_PROT); + (tp->t_flags & XFS_TRANS_NO_WRITECOUNT); /* We gave our writer reference to the new transaction */ - tp->t_flags &= ~XFS_TRANS_FREEZE_PROT; + tp->t_flags |= XFS_TRANS_NO_WRITECOUNT; ntp->t_ticket = xfs_log_ticket_get(tp->t_ticket); ntp->t_blk_res = tp->t_blk_res - tp->t_blk_res_used; tp->t_blk_res = tp->t_blk_res_used; @@ -165,7 +123,7 @@ xfs_trans_dup( * This does not do quota reservations. That typically is done by the * caller afterwards. */ -int +static int xfs_trans_reserve( struct xfs_trans *tp, struct xfs_trans_res *resp, @@ -219,7 +177,7 @@ xfs_trans_reserve( resp->tr_logres, resp->tr_logcount, &tp->t_ticket, XFS_TRANSACTION, - permanent, tp->t_type); + permanent, 0); } if (error) @@ -268,6 +226,42 @@ undo_blocks: return error; } +int +xfs_trans_alloc( + struct xfs_mount *mp, + struct xfs_trans_res *resp, + uint blocks, + uint rtextents, + uint flags, + struct xfs_trans **tpp) +{ + struct xfs_trans *tp; + int error; + + if (!(flags & XFS_TRANS_NO_WRITECOUNT)) + sb_start_intwrite(mp->m_super); + + WARN_ON(mp->m_super->s_writers.frozen == SB_FREEZE_COMPLETE); + atomic_inc(&mp->m_active_trans); + + tp = kmem_zone_zalloc(xfs_trans_zone, + (flags & XFS_TRANS_NOFS) ? KM_NOFS : KM_SLEEP); + tp->t_magic = XFS_TRANS_HEADER_MAGIC; + tp->t_flags = flags; + tp->t_mountp = mp; + INIT_LIST_HEAD(&tp->t_items); + INIT_LIST_HEAD(&tp->t_busy); + + error = xfs_trans_reserve(tp, resp, blocks, rtextents); + if (error) { + xfs_trans_cancel(tp); + return error; + } + + *tpp = tp; + return 0; +} + /* * Record the indicated change to the given field for application * to the file system's superblock when the transaction commits. diff --git a/fs/xfs/xfs_trans.h b/fs/xfs/xfs_trans.h index e7c49cf..9a462e8 100644 --- a/fs/xfs/xfs_trans.h +++ b/fs/xfs/xfs_trans.h @@ -90,7 +90,6 @@ void xfs_log_item_init(struct xfs_mount *mp, struct xfs_log_item *item, */ typedef struct xfs_trans { unsigned int t_magic; /* magic number */ - unsigned int t_type; /* transaction type */ unsigned int t_log_res; /* amt of log space resvd */ unsigned int t_log_count; /* count for perm log res */ unsigned int t_blk_res; /* # of blocks resvd */ @@ -148,10 +147,9 @@ typedef struct xfs_trans { /* * XFS transaction mechanism exported interfaces. */ -xfs_trans_t *xfs_trans_alloc(struct xfs_mount *, uint); -xfs_trans_t *_xfs_trans_alloc(struct xfs_mount *, uint, xfs_km_flags_t); -int xfs_trans_reserve(struct xfs_trans *, struct xfs_trans_res *, - uint, uint); +int xfs_trans_alloc(struct xfs_mount *mp, struct xfs_trans_res *resp, + uint blocks, uint rtextents, uint flags, + struct xfs_trans **tpp); void xfs_trans_mod_sb(xfs_trans_t *, uint, int64_t); struct xfs_buf *xfs_trans_get_buf_map(struct xfs_trans *tp, -- 2.1.4 From BATV+bffad35de576da5f5ff6+4560+infradead.org+hch@bombadil.srs.infradead.org Wed Feb 17 02:57:12 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=ham version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay3.corp.sgi.com [198.149.34.15]) by oss.sgi.com (Postfix) with ESMTP id C33577CA4 for ; Wed, 17 Feb 2016 02:57:12 -0600 (CST) Received: from cuda.sgi.com (cuda1.sgi.com [192.48.157.11]) by relay3.corp.sgi.com (Postfix) with ESMTP id 557F1AC005 for ; Wed, 17 Feb 2016 00:57:12 -0800 (PST) X-ASG-Debug-ID: 1455699430-04bdf02d5e6b310001-NocioJ Received: from bombadil.infradead.org ([198.137.202.9]) by cuda.sgi.com with ESMTP id eTxDyiySjZ3Didow (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128 verify=NO) for ; Wed, 17 Feb 2016 00:57:10 -0800 (PST) X-Barracuda-Envelope-From: BATV+bffad35de576da5f5ff6+4560+infradead.org+hch@bombadil.srs.infradead.org X-Barracuda-Apparent-Source-IP: 198.137.202.9 Received: from hch by bombadil.infradead.org with local (Exim 4.80.1 #2 (Red Hat Linux)) id 1aVxv3-0003Yq-Qu; Wed, 17 Feb 2016 08:57:09 +0000 Date: Wed, 17 Feb 2016 00:57:09 -0800 From: Christoph Hellwig To: Christoph Hellwig Cc: xfs@oss.sgi.com Subject: Re: [PATCH 1/3] xfs: remove xfs_trans_get_block_res Message-ID: <20160217085709.GA9492@infradead.org> X-ASG-Orig-Subj: Re: [PATCH 1/3] xfs: remove xfs_trans_get_block_res References: <1455699159-20906-1-git-send-email-hch@lst.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1455699159-20906-1-git-send-email-hch@lst.de> User-Agent: Mutt/1.5.24 (2015-08-30) X-SRS-Rewrite: SMTP reverse-path rewritten from by bombadil.infradead.org. See http://www.infradead.org/rpr.html X-Barracuda-Connect: UNKNOWN[198.137.202.9] X-Barracuda-Start-Time: 1455699430 X-Barracuda-Encrypted: ECDHE-RSA-AES128-GCM-SHA256 X-Barracuda-URL: https://192.48.157.11:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-BRTS-Status: 1 X-Barracuda-Spam-Score: 0.10 X-Barracuda-Spam-Status: No, SCORE=0.10 using per-user scores of TAG_LEVEL=1000.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.7 tests=BSF_SC0_MISMATCH_TO, RDNS_NONE X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.3.27098 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 0.00 BSF_SC0_MISMATCH_TO Envelope rcpt doesn't match header 0.10 RDNS_NONE Delivered to trusted network by a host with no rDNS Sorry - seems like I sent without the cover letter. Rational: the xfs_trans_alloc + xfs_trans_reserve combination is super confusing, and when recently debugging the block reservation issues in the reflink code I got reminded of my old series to sort this out, so I dusted it off, tested it and here were are. From david@fromorbit.com Wed Feb 17 03:30:49 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=ham version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay2.corp.sgi.com [137.38.102.29]) by oss.sgi.com (Postfix) with ESMTP id 20F9B7CA2 for ; Wed, 17 Feb 2016 03:30:49 -0600 (CST) Received: from cuda.sgi.com (cuda2.sgi.com [192.48.176.25]) by relay2.corp.sgi.com (Postfix) with ESMTP id 0115F304032 for ; Wed, 17 Feb 2016 01:30:45 -0800 (PST) X-ASG-Debug-ID: 1455701443-04cbb043331548b0001-NocioJ Received: from ipmail05.adl6.internode.on.net (ipmail05.adl6.internode.on.net [150.101.137.143]) by cuda.sgi.com with ESMTP id I5wQilMc71n3YGp9 for ; Wed, 17 Feb 2016 01:30:43 -0800 (PST) X-Barracuda-Envelope-From: david@fromorbit.com X-Barracuda-Apparent-Source-IP: 150.101.137.143 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: A2BlBwAwPcRWXJbY03ZegzqBP4Joo3gBAQEBAQEGi3KFSIQIhgcCAgEBAoE+TQEBAQEBAQdEQIRCAQEEOhwjEAgDDgoJJQ8FJQMHGhOIGbsSAQEIAgEdGIUyhQOIbwWXA41QjnxEjgOEWSguiGEBAQE Received: from ppp118-211-216-150.lns20.syd4.internode.on.net (HELO dastard) ([118.211.216.150]) by ipmail05.adl6.internode.on.net with ESMTP; 17 Feb 2016 20:00:42 +1030 Received: from dave by dastard with local (Exim 4.80) (envelope-from ) id 1aVyRW-00052W-0W; Wed, 17 Feb 2016 20:30:42 +1100 Date: Wed, 17 Feb 2016 20:30:41 +1100 From: Dave Chinner To: Christoph Hellwig Cc: xfs@oss.sgi.com Subject: Re: [PATCH 11/15] xfs: move v1 inode conversion to xfs_inode_from_disk Message-ID: <20160217093041.GH19486@dastard> X-ASG-Orig-Subj: Re: [PATCH 11/15] xfs: move v1 inode conversion to xfs_inode_from_disk References: <1455693652-3899-1-git-send-email-david@fromorbit.com> <1455693652-3899-12-git-send-email-david@fromorbit.com> <20160217073204.GB16363@infradead.org> <20160217074821.GD19486@dastard> <20160217083000.GG19486@dastard> <20160217083308.GA11766@infradead.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20160217083308.GA11766@infradead.org> User-Agent: Mutt/1.5.21 (2010-09-15) X-Barracuda-Connect: ipmail05.adl6.internode.on.net[150.101.137.143] X-Barracuda-Start-Time: 1455701443 X-Barracuda-URL: https://192.48.176.25:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-BRTS-Status: 1 X-Barracuda-Spam-Score: 0.00 X-Barracuda-Spam-Status: No, SCORE=0.00 using per-user scores of TAG_LEVEL=1000.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.7 tests=BSF_SC0_MISMATCH_TO X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.3.27098 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 0.00 BSF_SC0_MISMATCH_TO Envelope rcpt doesn't match header On Wed, Feb 17, 2016 at 12:33:08AM -0800, Christoph Hellwig wrote: > On Wed, Feb 17, 2016 at 07:30:00PM +1100, Dave Chinner wrote: > > > Yeah, probably. I'll have to look at this a bit closer - I think I > > > assumed that we're always going to have v2 inode format here (like > > > we do in the kernel), but that may not be true. I'll have a closer > > > look. > > > > having a closer look, the XFS_SB_VERSION_NLINKBIT that is set here > > in sbversion is never used, so I just removed it. I also changed it > > back to using the converted in-memory link count so it's always > > going to be correct now. Now it is just: > > > > + setlink_inode(id, xino.i_d.di_nlink, type == DBM_DIR, security); > > Great. With that and the other nitpicks address: > > Reviewed-by: Christoph Hellwig > > for the whole series. Thanks for the fast turnaround, Christoph! I'll get this pushed out in the morning.... Cheers, Dave. -- Dave Chinner david@fromorbit.com From BATV+bffad35de576da5f5ff6+4560+infradead.org+hch@bombadil.srs.infradead.org Wed Feb 17 03:56:55 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=ham version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay3.corp.sgi.com [198.149.34.15]) by oss.sgi.com (Postfix) with ESMTP id 5D39D7CA2 for ; Wed, 17 Feb 2016 03:56:55 -0600 (CST) Received: from cuda.sgi.com (cuda3.sgi.com [192.48.176.15]) by relay3.corp.sgi.com (Postfix) with ESMTP id E3C25AC001 for ; Wed, 17 Feb 2016 01:56:51 -0800 (PST) X-ASG-Debug-ID: 1455703009-04cb6c1e57137570001-NocioJ Received: from bombadil.infradead.org ([198.137.202.9]) by cuda.sgi.com with ESMTP id UjXf3CdVkkheAAcH (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128 verify=NO) for ; Wed, 17 Feb 2016 01:56:49 -0800 (PST) X-Barracuda-Envelope-From: BATV+bffad35de576da5f5ff6+4560+infradead.org+hch@bombadil.srs.infradead.org X-Barracuda-Apparent-Source-IP: 198.137.202.9 Received: from hch by bombadil.infradead.org with local (Exim 4.80.1 #2 (Red Hat Linux)) id 1aVyql-0005g6-0J; Wed, 17 Feb 2016 09:56:47 +0000 Date: Wed, 17 Feb 2016 01:56:46 -0800 From: Christoph Hellwig To: "Darrick J. Wong" Cc: david@fromorbit.com, linux-btrfs@vger.kernel.org, fstests@vger.kernel.org, xfs@oss.sgi.com Subject: Re: [PATCH 1/3] generic/304: fix high offset Message-ID: <20160217095646.GA21482@infradead.org> X-ASG-Orig-Subj: Re: [PATCH 1/3] generic/304: fix high offset References: <20160215204608.7977.2802.stgit@birch.djwong.org> <20160215204614.7977.2848.stgit@birch.djwong.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20160215204614.7977.2848.stgit@birch.djwong.org> User-Agent: Mutt/1.5.24 (2015-08-30) X-SRS-Rewrite: SMTP reverse-path rewritten from by bombadil.infradead.org. See http://www.infradead.org/rpr.html X-Barracuda-Connect: UNKNOWN[198.137.202.9] X-Barracuda-Start-Time: 1455703009 X-Barracuda-Encrypted: ECDHE-RSA-AES128-GCM-SHA256 X-Barracuda-URL: https://192.48.176.15:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-BRTS-Status: 1 X-Barracuda-Spam-Score: 0.70 X-Barracuda-Spam-Status: No, SCORE=0.70 using per-user scores of TAG_LEVEL=1000.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.7 tests=BSF_SC0_MISMATCH_TO, MARKETING_SUBJECT, RDNS_NONE X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.3.27099 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 0.60 MARKETING_SUBJECT Subject contains popular marketing words 0.00 BSF_SC0_MISMATCH_TO Envelope rcpt doesn't match header 0.10 RDNS_NONE Delivered to trusted network by a host with no rDNS On Mon, Feb 15, 2016 at 12:46:14PM -0800, Darrick J. Wong wrote: > "Invalid argument" is a better response to an impossibly high offset > dedupe request than "extents don't match", so change the test. What does btrfs return here? From BATV+bffad35de576da5f5ff6+4560+infradead.org+hch@bombadil.srs.infradead.org Wed Feb 17 03:57:24 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=ham version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay1.corp.sgi.com [137.38.102.111]) by oss.sgi.com (Postfix) with ESMTP id 0F5F27CA2 for ; Wed, 17 Feb 2016 03:57:24 -0600 (CST) Received: from cuda.sgi.com (cuda1.sgi.com [192.48.157.11]) by relay1.corp.sgi.com (Postfix) with ESMTP id D61DF8F8035 for ; Wed, 17 Feb 2016 01:57:20 -0800 (PST) X-ASG-Debug-ID: 1455703038-04bdf02d5c6f840001-NocioJ Received: from bombadil.infradead.org ([198.137.202.9]) by cuda.sgi.com with ESMTP id GCLUm0rPPG6Opjsl (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128 verify=NO) for ; Wed, 17 Feb 2016 01:57:18 -0800 (PST) X-Barracuda-Envelope-From: BATV+bffad35de576da5f5ff6+4560+infradead.org+hch@bombadil.srs.infradead.org X-Barracuda-Apparent-Source-IP: 198.137.202.9 Received: from hch by bombadil.infradead.org with local (Exim 4.80.1 #2 (Red Hat Linux)) id 1aVyrE-0005nP-O1; Wed, 17 Feb 2016 09:57:16 +0000 Date: Wed, 17 Feb 2016 01:57:16 -0800 From: Christoph Hellwig To: "Darrick J. Wong" Cc: david@fromorbit.com, linux-btrfs@vger.kernel.org, fstests@vger.kernel.org, xfs@oss.sgi.com Subject: Re: [PATCH 2/3] punch-alternating: use the block size reported by the fs for punching Message-ID: <20160217095716.GB21482@infradead.org> X-ASG-Orig-Subj: Re: [PATCH 2/3] punch-alternating: use the block size reported by the fs for punching References: <20160215204608.7977.2802.stgit@birch.djwong.org> <20160215204621.7977.91236.stgit@birch.djwong.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20160215204621.7977.91236.stgit@birch.djwong.org> User-Agent: Mutt/1.5.24 (2015-08-30) X-SRS-Rewrite: SMTP reverse-path rewritten from by bombadil.infradead.org. See http://www.infradead.org/rpr.html X-Barracuda-Connect: UNKNOWN[198.137.202.9] X-Barracuda-Start-Time: 1455703038 X-Barracuda-Encrypted: ECDHE-RSA-AES128-GCM-SHA256 X-Barracuda-URL: https://192.48.157.11:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-Spam-Score: 0.10 X-Barracuda-Spam-Status: No, SCORE=0.10 using per-user scores of TAG_LEVEL=1000.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.7 tests=BSF_SC0_MISMATCH_TO, RDNS_NONE X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.3.27099 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 0.00 BSF_SC0_MISMATCH_TO Envelope rcpt doesn't match header 0.10 RDNS_NONE Delivered to trusted network by a host with no rDNS Looks fine, Reviewed-by: Christoph Hellwig From BATV+bffad35de576da5f5ff6+4560+infradead.org+hch@bombadil.srs.infradead.org Wed Feb 17 03:58:15 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=ham version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay2.corp.sgi.com [137.38.102.29]) by oss.sgi.com (Postfix) with ESMTP id 0A0967CA2 for ; Wed, 17 Feb 2016 03:58:15 -0600 (CST) Received: from cuda.sgi.com (cuda1.sgi.com [192.48.157.11]) by relay2.corp.sgi.com (Postfix) with ESMTP id E112A304043 for ; Wed, 17 Feb 2016 01:58:14 -0800 (PST) X-ASG-Debug-ID: 1455703093-04bdf02d5e6f910001-NocioJ Received: from bombadil.infradead.org ([198.137.202.9]) by cuda.sgi.com with ESMTP id 6krY7qB9ctTZVZkp (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128 verify=NO) for ; Wed, 17 Feb 2016 01:58:13 -0800 (PST) X-Barracuda-Envelope-From: BATV+bffad35de576da5f5ff6+4560+infradead.org+hch@bombadil.srs.infradead.org X-Barracuda-Apparent-Source-IP: 198.137.202.9 Received: from hch by bombadil.infradead.org with local (Exim 4.80.1 #2 (Red Hat Linux)) id 1aVys8-00068j-Cx; Wed, 17 Feb 2016 09:58:12 +0000 Date: Wed, 17 Feb 2016 01:58:12 -0800 From: Christoph Hellwig To: "Darrick J. Wong" Cc: david@fromorbit.com, linux-btrfs@vger.kernel.org, fstests@vger.kernel.org, xfs@oss.sgi.com Subject: Re: [PATCH 3/3] xfs/24[356]: check for -c switch to xfs_io bmap command Message-ID: <20160217095812.GC21482@infradead.org> X-ASG-Orig-Subj: Re: [PATCH 3/3] xfs/24[356]: check for -c switch to xfs_io bmap command References: <20160215204608.7977.2802.stgit@birch.djwong.org> <20160215204627.7977.93549.stgit@birch.djwong.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20160215204627.7977.93549.stgit@birch.djwong.org> User-Agent: Mutt/1.5.24 (2015-08-30) X-SRS-Rewrite: SMTP reverse-path rewritten from by bombadil.infradead.org. See http://www.infradead.org/rpr.html X-Barracuda-Connect: UNKNOWN[198.137.202.9] X-Barracuda-Start-Time: 1455703093 X-Barracuda-Encrypted: ECDHE-RSA-AES128-GCM-SHA256 X-Barracuda-URL: https://192.48.157.11:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-Spam-Score: 0.10 X-Barracuda-Spam-Status: No, SCORE=0.10 using per-user scores of TAG_LEVEL=1000.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.7 tests=BSF_SC0_MISMATCH_TO, RDNS_NONE X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.3.27099 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 0.00 BSF_SC0_MISMATCH_TO Envelope rcpt doesn't match header 0.10 RDNS_NONE Delivered to trusted network by a host with no rDNS Looks fine, Reviewed-by: Christoph Hellwig From fdmanana@gmail.com Wed Feb 17 04:04:29 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=FREEMAIL_FROM,T_DKIM_INVALID autolearn=ham version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay1.corp.sgi.com [137.38.102.111]) by oss.sgi.com (Postfix) with ESMTP id 88C987CA2 for ; Wed, 17 Feb 2016 04:04:29 -0600 (CST) Received: from cuda.sgi.com (cuda1.sgi.com [192.48.157.11]) by relay1.corp.sgi.com (Postfix) with ESMTP id 4D4198F8039 for ; Wed, 17 Feb 2016 02:04:26 -0800 (PST) X-ASG-Debug-ID: 1455703463-04bdf02d5c6ff00001-NocioJ Received: from mail-io0-f170.google.com (mail-io0-f170.google.com [209.85.223.170]) by cuda.sgi.com with ESMTP id R4tKa7Zh4ZoFHKQy (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128 verify=NO) for ; Wed, 17 Feb 2016 02:04:23 -0800 (PST) X-Barracuda-Envelope-From: fdmanana@gmail.com X-Barracuda-RBL-Trusted-Forwarder: 209.85.223.170 Received: by mail-io0-f170.google.com with SMTP id z135so31740330iof.0 for ; Wed, 17 Feb 2016 02:04:23 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:reply-to:in-reply-to:references:date:message-id :subject:from:to:cc:content-type; bh=UnoNjBKRM6NJQebQrjpJKjEc8YB47QaxfoPJcPRFx3s=; b=PYpwUN7VhTRS+8833Sl/P8/hXuLHXwH1mGUmc5bTbS/aJ4NRE88Tri+qXNkA9WYOUU UxIvMwU44O4FVp4cTHQMHnJ7Xn0NzXEGKnZOdU25TMNHjFpIi7vUhiPVm2XZrSa+eru6 iDjCLfn5ANl6xD03xHushgDHCu5exyJrrwMNxD+4qsSKKCM9GeauHequ1ffCgEVs69Uc OIhC3VMAAndFvOdN6qV7ft8mg+HamwUH5TTQmFx0YPeRxJB8d8Pcp8Dtl2fEN3IdsGYd Kfucv+BK43IgrOrcZrx8AY0/rsXJK0RYSQ+1cH7I1XIcBfyd7/fysbnS+WvPwU8cFrzo UadQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:reply-to:in-reply-to:references :date:message-id:subject:from:to:cc:content-type; bh=UnoNjBKRM6NJQebQrjpJKjEc8YB47QaxfoPJcPRFx3s=; b=ZEDSc94+byNPejaYS2p5Wq62XS2SHuneXM1GsVRxdOCBqgYWTCyBg61wAunT7yEqYV 1w17a2kNKY29l5UKU3g688VyvrLlJ2r55nX38JLivfopB/odU8ejpydJ9OvqF+p3ibFd N7ZMfsoqikaDZKBg5MFikcMbqYoiTvULKu7q8omYcdUaAawnTCyJMWeNOCkg8om8sSV2 R4cnhqOxlw6OgLoAiUGM8luuuERi7mppLfyQvHtpLoIVZq/90PYivxrX0hhZc/Kcp7jM ZO6rQgB+vgUe/J47pALdmP390h4KGjpNI/2rtFtjLpKM6w3CqjS5IS9dqPhsFiImO4iZ nqrw== X-Gm-Message-State: AG10YOQbXMDY2Y0pQ0CW287q5e/XIsrs1QW2raiwTn2WrVag4/t7P8GMYjKvvtiL3YdNOp4uh7azcpBtKZPftA== MIME-Version: 1.0 X-Received: by 10.107.186.195 with SMTP id k186mr2528347iof.90.1455703463195; Wed, 17 Feb 2016 02:04:23 -0800 (PST) Received: by 10.36.192.134 with HTTP; Wed, 17 Feb 2016 02:04:23 -0800 (PST) Reply-To: fdmanana@gmail.com In-Reply-To: <20160217095646.GA21482@infradead.org> References: <20160215204608.7977.2802.stgit@birch.djwong.org> <20160215204614.7977.2848.stgit@birch.djwong.org> <20160217095646.GA21482@infradead.org> Date: Wed, 17 Feb 2016 10:04:23 +0000 Message-ID: Subject: Re: [PATCH 1/3] generic/304: fix high offset From: Filipe Manana X-ASG-Orig-Subj: Re: [PATCH 1/3] generic/304: fix high offset To: Christoph Hellwig Cc: "Darrick J. Wong" , Dave Chinner , "linux-btrfs@vger.kernel.org" , fstests@vger.kernel.org, "xfs@oss.sgi.com" Content-Type: text/plain; charset=UTF-8 X-Barracuda-Connect: mail-io0-f170.google.com[209.85.223.170] X-Barracuda-Start-Time: 1455703463 X-Barracuda-Encrypted: ECDHE-RSA-AES128-GCM-SHA256 X-Barracuda-URL: https://192.48.157.11:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-BRTS-Status: 1 X-Barracuda-Spam-Score: 0.60 X-Barracuda-Spam-Status: No, SCORE=0.60 using per-user scores of TAG_LEVEL=1000.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.7 tests=BSF_SC0_MISMATCH_TO, DKIM_SIGNED, DKIM_VERIFIED, MARKETING_SUBJECT X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.3.27099 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 0.60 MARKETING_SUBJECT Subject contains popular marketing words 0.00 BSF_SC0_MISMATCH_TO Envelope rcpt doesn't match header -0.00 DKIM_VERIFIED Domain Keys Identified Mail: signature passes verification 0.00 DKIM_SIGNED Domain Keys Identified Mail: message has a signature On Wed, Feb 17, 2016 at 9:56 AM, Christoph Hellwig wrote: > On Mon, Feb 15, 2016 at 12:46:14PM -0800, Darrick J. Wong wrote: >> "Invalid argument" is a better response to an impossibly high offset >> dedupe request than "extents don't match", so change the test. > > What does btrfs return here? -EINVAL, so this makes the test pass on btrfs. > -- > To unsubscribe from this list: send the line "unsubscribe fstests" in > the body of a message to majordomo@vger.kernel.org > More majordomo info at http://vger.kernel.org/majordomo-info.html -- Filipe David Manana, "Reasonable men adapt themselves to the world. Unreasonable men adapt the world to themselves. That's why all progress depends on unreasonable men." From BATV+bffad35de576da5f5ff6+4560+infradead.org+hch@bombadil.srs.infradead.org Wed Feb 17 04:10:20 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=ham version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay2.corp.sgi.com [137.38.102.29]) by oss.sgi.com (Postfix) with ESMTP id AC0A97CA2 for ; Wed, 17 Feb 2016 04:10:20 -0600 (CST) Received: from cuda.sgi.com (cuda3.sgi.com [192.48.176.15]) by relay2.corp.sgi.com (Postfix) with ESMTP id 9C110304053 for ; Wed, 17 Feb 2016 02:10:17 -0800 (PST) X-ASG-Debug-ID: 1455703813-04cb6c1e561380d0001-NocioJ Received: from bombadil.infradead.org ([198.137.202.9]) by cuda.sgi.com with ESMTP id YIKTv2Aak5EFBZ7C (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128 verify=NO) for ; Wed, 17 Feb 2016 02:10:14 -0800 (PST) X-Barracuda-Envelope-From: BATV+bffad35de576da5f5ff6+4560+infradead.org+hch@bombadil.srs.infradead.org X-Barracuda-Apparent-Source-IP: 198.137.202.9 Received: from hch by bombadil.infradead.org with local (Exim 4.80.1 #2 (Red Hat Linux)) id 1aVz3k-0004ue-8C; Wed, 17 Feb 2016 10:10:12 +0000 Date: Wed, 17 Feb 2016 02:10:12 -0800 From: Christoph Hellwig To: Filipe Manana Cc: Christoph Hellwig , "Darrick J. Wong" , Dave Chinner , "linux-btrfs@vger.kernel.org" , fstests@vger.kernel.org, "xfs@oss.sgi.com" Subject: Re: [PATCH 1/3] generic/304: fix high offset Message-ID: <20160217101012.GA15314@infradead.org> X-ASG-Orig-Subj: Re: [PATCH 1/3] generic/304: fix high offset References: <20160215204608.7977.2802.stgit@birch.djwong.org> <20160215204614.7977.2848.stgit@birch.djwong.org> <20160217095646.GA21482@infradead.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.24 (2015-08-30) X-SRS-Rewrite: SMTP reverse-path rewritten from by bombadil.infradead.org. See http://www.infradead.org/rpr.html X-Barracuda-Connect: UNKNOWN[198.137.202.9] X-Barracuda-Start-Time: 1455703814 X-Barracuda-Encrypted: ECDHE-RSA-AES128-GCM-SHA256 X-Barracuda-URL: https://192.48.176.15:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-BRTS-Status: 1 X-Barracuda-Spam-Score: 0.70 X-Barracuda-Spam-Status: No, SCORE=0.70 using per-user scores of TAG_LEVEL=1000.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.7 tests=BSF_SC0_MISMATCH_TO, MARKETING_SUBJECT, RDNS_NONE X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.3.27099 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 0.60 MARKETING_SUBJECT Subject contains popular marketing words 0.00 BSF_SC0_MISMATCH_TO Envelope rcpt doesn't match header 0.10 RDNS_NONE Delivered to trusted network by a host with no rDNS On Wed, Feb 17, 2016 at 10:04:23AM +0000, Filipe Manana wrote: > > What does btrfs return here? > > -EINVAL, so this makes the test pass on btrfs. Ok, looks fine to me then: Reviewed-by: Christoph Hellwig From bfoster@redhat.com Wed Feb 17 07:40:12 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=ham version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay3.corp.sgi.com [198.149.34.15]) by oss.sgi.com (Postfix) with ESMTP id 228117CA2 for ; Wed, 17 Feb 2016 07:40:12 -0600 (CST) Received: from cuda.sgi.com (cuda1.sgi.com [192.48.157.11]) by relay3.corp.sgi.com (Postfix) with ESMTP id A4F5CAC006 for ; Wed, 17 Feb 2016 05:40:11 -0800 (PST) X-ASG-Debug-ID: 1455716409-04bdf02d5b7ee70001-NocioJ Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by cuda.sgi.com with ESMTP id VONYC9NxwaHCAHVx (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO) for ; Wed, 17 Feb 2016 05:40:10 -0800 (PST) X-Barracuda-Envelope-From: bfoster@redhat.com X-Barracuda-Apparent-Source-IP: 209.132.183.28 X-ASG-Whitelist: Client Received: from int-mx09.intmail.prod.int.phx2.redhat.com (int-mx09.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by mx1.redhat.com (Postfix) with ESMTPS id EBB7CBACD3; Wed, 17 Feb 2016 13:40:09 +0000 (UTC) Received: from bfoster.bfoster (dhcp-41-22.bos.redhat.com [10.18.41.22]) by int-mx09.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id u1HDe9pl001668; Wed, 17 Feb 2016 08:40:09 -0500 Received: by bfoster.bfoster (Postfix, from userid 1000) id ED436120073; Wed, 17 Feb 2016 08:40:08 -0500 (EST) Date: Wed, 17 Feb 2016 08:40:08 -0500 From: Brian Foster To: Christoph Hellwig Cc: xfs@oss.sgi.com Subject: Re: [PATCH 2/3] xfs: better xfs_trans_alloc interface Message-ID: <20160217134006.GA4065@bfoster.bfoster> X-ASG-Orig-Subj: Re: [PATCH 2/3] xfs: better xfs_trans_alloc interface References: <1455699159-20906-1-git-send-email-hch@lst.de> <1455699159-20906-2-git-send-email-hch@lst.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1455699159-20906-2-git-send-email-hch@lst.de> User-Agent: Mutt/1.5.24 (2015-08-30) X-Scanned-By: MIMEDefang 2.68 on 10.5.11.22 X-Barracuda-Connect: mx1.redhat.com[209.132.183.28] X-Barracuda-Start-Time: 1455716410 X-Barracuda-Encrypted: ECDHE-RSA-AES256-GCM-SHA384 X-Barracuda-URL: https://192.48.157.11:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-BRTS-Status: 1 On Wed, Feb 17, 2016 at 09:52:38AM +0100, Christoph Hellwig wrote: > Merge xfs_trans_reserve and xfs_trans_alloc into a single function call > that returns a transaction with all the required log and block reservations, > and which allows passing transaction flags directly to avoid the cumbersome > _xfs_trans_alloc interface. > > While we're at it we also get rid of the transaction type argument that has > been superflous since we stopped supporting the non-CIL logging mode. The > guts of it will be removed in another patch. > > Signed-off-by: Christoph Hellwig > --- Looks like a nice cleanup to me. A couple comments... > fs/xfs/libxfs/xfs_attr.c | 58 +++++++----------------------- > fs/xfs/libxfs/xfs_bmap.c | 22 +++++------- > fs/xfs/libxfs/xfs_sb.c | 8 ++--- > fs/xfs/libxfs/xfs_shared.h | 5 +-- > fs/xfs/xfs_aops.c | 19 ++++------ > fs/xfs/xfs_attr_inactive.c | 16 ++------- > fs/xfs/xfs_bmap_util.c | 45 +++++++----------------- > fs/xfs/xfs_dquot.c | 7 ++-- > fs/xfs/xfs_file.c | 8 ++--- > fs/xfs/xfs_fsops.c | 10 ++---- > fs/xfs/xfs_inode.c | 60 ++++++++++++------------------- > fs/xfs/xfs_ioctl.c | 13 +++---- > fs/xfs/xfs_iomap.c | 53 +++++++++------------------- > fs/xfs/xfs_iops.c | 22 +++++------- > fs/xfs/xfs_log_recover.c | 10 +++--- > fs/xfs/xfs_pnfs.c | 7 ++-- > fs/xfs/xfs_qm.c | 9 ++--- > fs/xfs/xfs_qm_syscalls.c | 26 ++++---------- > fs/xfs/xfs_rtalloc.c | 21 +++++------ > fs/xfs/xfs_symlink.c | 16 ++++----- > fs/xfs/xfs_trans.c | 88 +++++++++++++++++++++------------------------- > fs/xfs/xfs_trans.h | 8 ++--- > 22 files changed, 188 insertions(+), 343 deletions(-) > ... > diff --git a/fs/xfs/xfs_iops.c b/fs/xfs/xfs_iops.c > index 0d38b1d..3d9b1c48 100644 > --- a/fs/xfs/xfs_iops.c > +++ b/fs/xfs/xfs_iops.c > @@ -599,10 +599,9 @@ xfs_setattr_nonsize( > return error; > } > > - tp = xfs_trans_alloc(mp, XFS_TRANS_SETATTR_NOT_SIZE); > - error = xfs_trans_reserve(tp, &M_RES(mp)->tr_ichange, 0, 0); > + error = xfs_trans_alloc(mp, &M_RES(mp)->tr_ichange, 0, 0, 0, &tp); > if (error) > - goto out_trans_cancel; > + goto out_dqrele; > > xfs_ilock(ip, XFS_ILOCK_EXCL); > > @@ -724,8 +723,7 @@ xfs_setattr_nonsize( > > out_unlock: > xfs_iunlock(ip, XFS_ILOCK_EXCL); > -out_trans_cancel: > - xfs_trans_cancel(tp); This causes a transaction leak in the event of xfs_qm_vop_chown_reserve() failure (called earlier in the function, after transaction allocation). > +out_dqrele: > xfs_qm_dqrele(udqp); > xfs_qm_dqrele(gdqp); > return error; ... > diff --git a/fs/xfs/xfs_trans.c b/fs/xfs/xfs_trans.c > index 748b16a..cbbef3a 100644 > --- a/fs/xfs/xfs_trans.c > +++ b/fs/xfs/xfs_trans.c ... > @@ -165,7 +123,7 @@ xfs_trans_dup( > * This does not do quota reservations. That typically is done by the > * caller afterwards. > */ > -int > +static int > xfs_trans_reserve( > struct xfs_trans *tp, > struct xfs_trans_res *resp, > @@ -219,7 +177,7 @@ xfs_trans_reserve( > resp->tr_logres, > resp->tr_logcount, > &tp->t_ticket, XFS_TRANSACTION, > - permanent, tp->t_type); > + permanent, 0); So this looks like it effectively breaks xlog_print_tic_res()..? I see that is all removed in the subsequent patch, but the type still seems like useful information in the event that an associated problem occurs with the transaction. In fact, we just had a transaction overrun report over the weekend (on irc) where at least I thought this was useful (unfortunately it looks like I lost the reference to the syslog output). Brian > } > > if (error) > @@ -268,6 +226,42 @@ undo_blocks: > return error; > } > > +int > +xfs_trans_alloc( > + struct xfs_mount *mp, > + struct xfs_trans_res *resp, > + uint blocks, > + uint rtextents, > + uint flags, > + struct xfs_trans **tpp) > +{ > + struct xfs_trans *tp; > + int error; > + > + if (!(flags & XFS_TRANS_NO_WRITECOUNT)) > + sb_start_intwrite(mp->m_super); > + > + WARN_ON(mp->m_super->s_writers.frozen == SB_FREEZE_COMPLETE); > + atomic_inc(&mp->m_active_trans); > + > + tp = kmem_zone_zalloc(xfs_trans_zone, > + (flags & XFS_TRANS_NOFS) ? KM_NOFS : KM_SLEEP); > + tp->t_magic = XFS_TRANS_HEADER_MAGIC; > + tp->t_flags = flags; > + tp->t_mountp = mp; > + INIT_LIST_HEAD(&tp->t_items); > + INIT_LIST_HEAD(&tp->t_busy); > + > + error = xfs_trans_reserve(tp, resp, blocks, rtextents); > + if (error) { > + xfs_trans_cancel(tp); > + return error; > + } > + > + *tpp = tp; > + return 0; > +} > + > /* > * Record the indicated change to the given field for application > * to the file system's superblock when the transaction commits. > diff --git a/fs/xfs/xfs_trans.h b/fs/xfs/xfs_trans.h > index e7c49cf..9a462e8 100644 > --- a/fs/xfs/xfs_trans.h > +++ b/fs/xfs/xfs_trans.h > @@ -90,7 +90,6 @@ void xfs_log_item_init(struct xfs_mount *mp, struct xfs_log_item *item, > */ > typedef struct xfs_trans { > unsigned int t_magic; /* magic number */ > - unsigned int t_type; /* transaction type */ > unsigned int t_log_res; /* amt of log space resvd */ > unsigned int t_log_count; /* count for perm log res */ > unsigned int t_blk_res; /* # of blocks resvd */ > @@ -148,10 +147,9 @@ typedef struct xfs_trans { > /* > * XFS transaction mechanism exported interfaces. > */ > -xfs_trans_t *xfs_trans_alloc(struct xfs_mount *, uint); > -xfs_trans_t *_xfs_trans_alloc(struct xfs_mount *, uint, xfs_km_flags_t); > -int xfs_trans_reserve(struct xfs_trans *, struct xfs_trans_res *, > - uint, uint); > +int xfs_trans_alloc(struct xfs_mount *mp, struct xfs_trans_res *resp, > + uint blocks, uint rtextents, uint flags, > + struct xfs_trans **tpp); > void xfs_trans_mod_sb(xfs_trans_t *, uint, int64_t); > > struct xfs_buf *xfs_trans_get_buf_map(struct xfs_trans *tp, > -- > 2.1.4 > > _______________________________________________ > xfs mailing list > xfs@oss.sgi.com > http://oss.sgi.com/mailman/listinfo/xfs From export@vascofilters.eu Wed Feb 17 09:05:38 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: ** X-Spam-Status: No, score=2.1 required=5.0 tests=HTML_IMAGE_RATIO_04, HTML_MESSAGE autolearn=no version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay3.corp.sgi.com [198.149.34.15]) by oss.sgi.com (Postfix) with ESMTP id 66D1D7CA2 for ; Wed, 17 Feb 2016 09:05:38 -0600 (CST) Received: from cuda.sgi.com (cuda2.sgi.com [192.48.176.25]) by relay3.corp.sgi.com (Postfix) with ESMTP id 9DE4AAC005 for ; Wed, 17 Feb 2016 07:05:34 -0800 (PST) X-ASG-Debug-ID: 1455721524-04cbb0433316e1d0001-NocioJ Received: from karieraserlg.nazwa.pl (aju23.rev.netart.pl [77.55.254.23]) by cuda.sgi.com with ESMTP id b9Hmpd06DLc34F1q for ; Wed, 17 Feb 2016 07:05:25 -0800 (PST) X-Barracuda-Envelope-From: export@vascofilters.eu X-Barracuda-Apparent-Source-IP: 77.55.254.23 Received: from pc (unknown [194.33.77.155]) by karieraserlg.nazwa.pl (Postfix) with ESMTPA id 21FB63CE197C for ; Wed, 17 Feb 2016 16:05:23 +0100 (CET) From: "=?iso-8859-2?Q?Marcin_Tomzi=F1ski?=" To: "xfs" Subject: cooperation Message-ID: <33C9320BC71EC2279783DB8696513E7B@pc> X-ASG-Orig-Subj: cooperation Date: Wed, 17 Feb 2016 16:05:23 +0100 Organization: AnoMail - oprogramowanie do emailingow X-Priority: 3 Content-Type: multipart/related; boundary="------------090708070905080807010806_.REL" MIME-Version: 1.0 X-Barracuda-Connect: aju23.rev.netart.pl[77.55.254.23] X-Barracuda-Start-Time: 1455721525 X-Barracuda-URL: https://192.48.176.25:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-BRTS-Status: 1 X-Barracuda-Spam-Score: 0.57 X-Barracuda-Spam-Status: No, SCORE=0.57 using per-user scores of TAG_LEVEL=1000.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.7 tests=BSF_SC0_SA090e, HTML_IMAGE_RATIO_04, HTML_MESSAGE X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.3.27104 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 0.17 HTML_IMAGE_RATIO_04 BODY: HTML has a low ratio of text to image area 0.00 HTML_MESSAGE BODY: HTML included in message 0.40 BSF_SC0_SA090e Custom Rule SA090e --------------090708070905080807010806_.REL Content-Type: multipart/alternative; boundary="------------060809030903020503040008" --------------060809030903020503040008 Content-Type: text/plain; charset=iso-8859-2; format=flowed Content-Transfer-Encoding: quoted-printable =20 Are you looking for a new automotive parts brand to be different from your = competitors?=20 Do you want to be a direct importer?=20 Are you looking for high quality products at fair and individual quotation?= =20 Fed up with late deliveries and low availability from the stock?=20 Do you want to join young and effective organisation?=20 Do you need fast orders handling and flexibility in market approach? We have a great proposal for your business! =20 Our products range consists of more than 1500 references under 4 brands - VASCO FILTERS (oil, fuel air and cabin filters) - FLUXAR FILTERS (red line) - PEXA WIPERS (universal and dedicated sets of wipers) - BREYKO (brake pads)=20 We are expanding our business in your country and looking for direct import= ers.=20 Join our Team! More info on web page: www.vascofilters.com or facebook = =20 If you have any questions do not hesitate to contact us, we speak English, = French and Spanish. Marketing and Operations Manager Olaf Tomzi=F1ski If you do not wish to receive further information. --------------060809030903020503040008 Content-Type: text/html; charset=iso-8859-2 Content-Transfer-Encoding: quoted-printable   =20
    =20
  • <= FONT =20 face=3D"Times New Roman">Are you looking for a new automotive parts = brand to =20 be different from your competitors? = =20
  • <= FONT =20 face=3D"Times New Roman">Do you want to be a direct =20 importer? =20
  • <= FONT =20 face=3D"Times New Roman">Are you looking for high quality products at fai= r and individual =20 quotation? =20
  • <= FONT =20 face=3D"Times New Roman">Fed up with late deliveries and low availability= from =20 the stock? =20
  • <= FONT =20 face=3D"Times New Roman">Do you want to join young and effective = =20 organisation? =20
  • <= FONT =20 face=3D"Times New Roman">Do you need fast orders handling and flexibility= in =20 market approach?
=20

 We have =20 a great proposal for your business!

=20

 

=20

 = ;  3D"Odblokuj       =3D"Odblokuj  =20     3D"Odblokuj  = 3D"Odblokuj

=20

 

=20

 Our =20 =20 products range consists of more than 1500 references under 4 =20 brands

=20

 

=20

-         = =20 = VASCO FILTERS (oil, fuel air and cabin = =20 filters)

=20

-         = =20 = FLUXAR =20 FILTERS (red line)

=20

-         = =20 = PEXA WIPERS (universal and dedicated sets of = =20 wipers)

=20

-         = =20 BREYKO (brake pads) =20

=20

= =20  

=20

We are = =20 expanding our business in your country and looking for direct importers. = =20

=20

 

=20

Join =20 our Team!  More info on web p= age: =20 www.vascofilters.com or =20 facebook  3D"S=

=20

=20

If you = =20 have any questions do not hesitate to contact us, we speak English, Fr= ench =20 and Spanish.

=20

=20

 =

=20

Marketing and Oper= ations Manager

=20

 

= =20

Marcin Tomzi=F1ski<= /P> =20

export@vascofilters.eu

=20

 =

=20

If you do not w= ish to =20 receive further information.

=20

<= /SPAN> 

=20

--------------060809030903020503040008-- --------------090708070905080807010806_.REL Content-Type: image/jpeg;name="674f7b3e84.jpg" Content-Transfer-Encoding: base64 Content-ID: /9j/4AAQSkZJRgABAQEAYABgAAD/2wBDAAYEBQYFBAYGBQYHBwYIChAKCgkJChQODwwQFxQYGBcU FhYaHSUfGhsjHBYWICwgIyYnKSopGR8tMC0oMCUoKSj/2wBDAQcHBwoIChMKChMoGhYaKCgoKCgo KCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCj/wAARCADWAUADASIA AhEBAxEB/8QAHwAAAQUBAQEBAQEAAAAAAAAAAAECAwQFBgcICQoL/8QAtRAAAgEDAwIEAwUFBAQA AAF9AQIDAAQRBRIhMUEGE1FhByJxFDKBkaEII0KxwRVS0fAkM2JyggkKFhcYGRolJicoKSo0NTY3 ODk6Q0RFRkdISUpTVFVWV1hZWmNkZWZnaGlqc3R1dnd4eXqDhIWGh4iJipKTlJWWl5iZmqKjpKWm p6ipqrKztLW2t7i5usLDxMXGx8jJytLT1NXW19jZ2uHi4+Tl5ufo6erx8vP09fb3+Pn6/8QAHwEA AwEBAQEBAQEBAQAAAAAAAAECAwQFBgcICQoL/8QAtREAAgECBAQDBAcFBAQAAQJ3AAECAxEEBSEx BhJBUQdhcRMiMoEIFEKRobHBCSMzUvAVYnLRChYkNOEl8RcYGRomJygpKjU2Nzg5OkNERUZHSElK U1RVVldYWVpjZGVmZ2hpanN0dXZ3eHl6goOEhYaHiImKkpOUlZaXmJmaoqOkpaanqKmqsrO0tba3 uLm6wsPExcbHyMnK0tPU1dbX2Nna4uPk5ebn6Onq8vP09fb3+Pn6/9oADAMBAAIRAxEAPwD540qd LaSSNhwSRzWZq6AXDMnQmtvU9OC2okQfN3xWNeDdB833hWsr2sZR3uZlTWj7LhG9DUVKODWSNTt9 TQXWkhhzgVxDDDEeldfotyLiw8tjzjFc1qcPk3LjHGa1nrqZwdtCnW3YXH+g7CenFYlTwSlAQOlZ GhfsWMcrYOMHiuiSF5bF3kOe9ctZSZmyfWuv+0p/ZrIMZIojuJ7HISfx/U1SrQkXKt9TVF1202CG UlFFIZLEN24VGcg1NajLE1p+HNAvvE3iC00jSYvNvbp9iDsB1LMeygAkn0FDaSuwW9jsfgd4Ku/G vitEcyRaPZYkvZxwQvOI1P8AebBHsAx7YP2Pthihjgt4kitoVCRoowqqBgADsABWN4K8L2Pgrwva 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 --------------090708070905080807010806_.REL Content-Type: image/jpeg;name="b17f6db271.jpg" Content-Transfer-Encoding: base64 Content-ID: /9j/4AAQSkZJRgABAQEAYABgAAD/2wBDAAYEBQYFBAYGBQYHBwYIChAKCgkJChQODwwQFxQYGBcU FhYaHSUfGhsjHBYWICwgIyYnKSopGR8tMC0oMCUoKSj/2wBDAQcHBwoIChMKChMoGhYaKCgoKCgo KCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCj/wAARCADWAUADASIA AhEBAxEB/8QAHwAAAQUBAQEBAQEAAAAAAAAAAAECAwQFBgcICQoL/8QAtRAAAgEDAwIEAwUFBAQA AAF9AQIDAAQRBRIhMUEGE1FhByJxFDKBkaEII0KxwRVS0fAkM2JyggkKFhcYGRolJicoKSo0NTY3 ODk6Q0RFRkdISUpTVFVWV1hZWmNkZWZnaGlqc3R1dnd4eXqDhIWGh4iJipKTlJWWl5iZmqKjpKWm p6ipqrKztLW2t7i5usLDxMXGx8jJytLT1NXW19jZ2uHi4+Tl5ufo6erx8vP09fb3+Pn6/8QAHwEA AwEBAQEBAQEBAQAAAAAAAAECAwQFBgcICQoL/8QAtREAAgECBAQDBAcFBAQAAQJ3AAECAxEEBSEx BhJBUQdhcRMiMoEIFEKRobHBCSMzUvAVYnLRChYkNOEl8RcYGRomJygpKjU2Nzg5OkNERUZHSElK U1RVVldYWVpjZGVmZ2hpanN0dXZ3eHl6goOEhYaHiImKkpOUlZaXmJmaoqOkpaanqKmqsrO0tba3 uLm6wsPExcbHyMnK0tPU1dbX2Nna4uPk5ebn6Onq8vP09fb3+Pn6/9oADAMBAAIRAxEAPwD5Uoop yI0jqiKWdjgADkmgBK91+CfwsN0sfiLxLAVtE+e1tpBjzD2Zh6elanwi+ENrbRW2t+LRuuM74bBh 8q+hf1PtXsmq3yfZ2ClVVRtCjoBXPUrLZHZQwzk7yOJ8dayqL5SHao+VVHAFXNMiMem26sOdgJ/G s3/hCtU8TX6XDzQ2lkGDBpSSzjPYenua7TUNDn02NMhZI8AK69K8mspfE9jXHR5uWMehjBOM/dHq aVWAPyDHvnk051bcd+c0zFc6n/KeRJWHcen61IoXHSowKkXgVSZA8Y9KcMdcUzAxxT1rWLExRgdv 1pwx6Ug4pe/FWpgPQD0qvevcPGE01oPPEgD+Y3Crgk5xznpUrv5cTueQqlsDrxWTA1u8y3O2WGaJ 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 --------------090708070905080807010806_.REL Content-Type: image/jpeg;name="187972b678.jpg" Content-Transfer-Encoding: base64 Content-ID: /9j/4AAQSkZJRgABAQEAYABgAAD/2wBDAAYEBQYFBAYGBQYHBwYIChAKCgkJChQODwwQFxQYGBcU FhYaHSUfGhsjHBYWICwgIyYnKSopGR8tMC0oMCUoKSj/2wBDAQcHBwoIChMKChMoGhYaKCgoKCgo KCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCj/wAARCAERAZoDASIA AhEBAxEB/8QAHwAAAQUBAQEBAQEAAAAAAAAAAAECAwQFBgcICQoL/8QAtRAAAgEDAwIEAwUFBAQA AAF9AQIDAAQRBRIhMUEGE1FhByJxFDKBkaEII0KxwRVS0fAkM2JyggkKFhcYGRolJicoKSo0NTY3 ODk6Q0RFRkdISUpTVFVWV1hZWmNkZWZnaGlqc3R1dnd4eXqDhIWGh4iJipKTlJWWl5iZmqKjpKWm p6ipqrKztLW2t7i5usLDxMXGx8jJytLT1NXW19jZ2uHi4+Tl5ufo6erx8vP09fb3+Pn6/8QAHwEA AwEBAQEBAQEBAQAAAAAAAAECAwQFBgcICQoL/8QAtREAAgECBAQDBAcFBAQAAQJ3AAECAxEEBSEx BhJBUQdhcRMiMoEIFEKRobHBCSMzUvAVYnLRChYkNOEl8RcYGRomJygpKjU2Nzg5OkNERUZHSElK U1RVVldYWVpjZGVmZ2hpanN0dXZ3eHl6goOEhYaHiImKkpOUlZaXmJmaoqOkpaanqKmqsrO0tba3 uLm6wsPExcbHyMnK0tPU1dbX2Nna4uPk5ebn6Onq8vP09fb3+Pn6/9oADAMBAAIRAxEAPwD5VpKK KACiiigAooooAv6eQSK1RCr9qxrFgrc1uQuDjmto7GM9yF7IHoKqS6fnkCtteacEB6ircUSps5eS ydegqBonXqK65rdTWdexRop4qHT6lqo9jnqKkmILnFR1kzUKKKKQBRRRQAUUUUAFKGIpKKLgP3Dv RwaZRTuApHNTRR55NQg881dhA20AKVwtVpmPrVtkJ6VDLASOlFhFWkpzIV6im0hhS0lW9PjV5vn6 CgCv5bYztOKEbaa6dLJGj+UD86yLy2Ck8U2rCTuRRnIpXj3A1Xiba22risCKAM+RNpplWrkccVVp DCiiigBQCTxU8cJPJqKJgrc1OZwB8tAD9gWopGApjSk1GTk5NACls02iigApVGTSUUAWkQUSZUcG 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 RRRQAUUUUAFFFFABRRRQAU5aKKAEPWkoooA//9k= --------------090708070905080807010806_.REL Content-Type: image/jpeg;name="d9f3e6ab1f.jpg" Content-Transfer-Encoding: base64 Content-ID: /9j/4AAQSkZJRgABAQEAYABgAAD/2wBDAAYEBQYFBAYGBQYHBwYIChAKCgkJChQODwwQFxQYGBcU FhYaHSUfGhsjHBYWICwgIyYnKSopGR8tMC0oMCUoKSj/2wBDAQcHBwoIChMKChMoGhYaKCgoKCgo KCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCj/wAARCAE3AbgDASIA AhEBAxEB/8QAHwAAAQUBAQEBAQEAAAAAAAAAAAECAwQFBgcICQoL/8QAtRAAAgEDAwIEAwUFBAQA AAF9AQIDAAQRBRIhMUEGE1FhByJxFDKBkaEII0KxwRVS0fAkM2JyggkKFhcYGRolJicoKSo0NTY3 ODk6Q0RFRkdISUpTVFVWV1hZWmNkZWZnaGlqc3R1dnd4eXqDhIWGh4iJipKTlJWWl5iZmqKjpKWm p6ipqrKztLW2t7i5usLDxMXGx8jJytLT1NXW19jZ2uHi4+Tl5ufo6erx8vP09fb3+Pn6/8QAHwEA AwEBAQEBAQEBAQAAAAAAAAECAwQFBgcICQoL/8QAtREAAgECBAQDBAcFBAQAAQJ3AAECAxEEBSEx BhJBUQdhcRMiMoEIFEKRobHBCSMzUvAVYnLRChYkNOEl8RcYGRomJygpKjU2Nzg5OkNERUZHSElK U1RVVldYWVpjZGVmZ2hpanN0dXZ3eHl6goOEhYaHiImKkpOUlZaXmJmaoqOkpaanqKmqsrO0tba3 uLm6wsPExcbHyMnK0tPU1dbX2Nna4uPk5ebn6Onq8vP09fb3+Pn6/9oADAMBAAIRAxEAPwD6pooo oAKKKKACiiigAooooAKKKKACiiigAooooAKKKKACiiigAooooAKKKKACiiigAooooAKKKKACiiig AooooAKKKKACiiigAooooAKKKKACiiigAooooAKKKKACiiigAooooAKKKKACiiigAooooAKKKKAC iiigAooooAKKKKACiiigAooooAKKKKACiiigAooooAKKKKACiiigAooooAKKKKACiiigAooooAKK KKACiiigAooooAKKKKACiiigAooooAKKKKACiiigAooooAKKKKACiiigAooooAKKKKACiiigAooo oAKKKKACiiigAooooAKKKKACiiigAooooAKKKKACiiigAooooAKKKKACiiigAooooAKKKKACiiig AooooAKKKKACiiigAooooAKKKKACiiigAooooAKKKKACiiigAooooAKKKKACiiigAooooAKKKKAC iiigAooooAKKKKACiiigAooooAKKKKACiiigAooooAKKKKACiiigAooooAKKKKACiiigAooooAKK KKACiiigAooooAKKKKACiiigAooooAKKKKACiiigAooooAKKKKACiiigAooooAKKKKACiiigAooo oAKKKKACiiigAooooAKKKKACiiuP8ZfErwl4M1COx8S6utjdSRLMqGCWTKMWAOUUgZKNx14NAHYU V5f/AML8+Gf/AEM8f/gJcf8Axuj/AIX58M/+hnj/APAS4/8AjdAHqFFeX/8AC/Phn/0M8f8A4CXH /wAbo/4X58M/+hnj/wDAS4/+N0AeoUV5f/wvz4Z/9DPH/wCAlx/8bo/4X58M/wDoZ4//AAEuP/jd AHqFFeX/APC/Phn/ANDPH/4CXH/xuj/hfnwzz/yM8f8A4CXH/wAboA9QorzAfHv4aE8eJ4//AAEu P/jdeiQ6laTwW09tL9ot7mMSwywKZEkQgEMGXIIIYEHPI6UAW6K4XxL8WvBPhnUTY65rYtbjaHAN tM6spGQVdUKsPoTzkdQa0fC/xA8K+KrOS50DWbe8jjkETKoZZAxxgbGAbnI5xjr6GgDqaKpjUrQy iIS5lxkoFJZRx94YyvUdcULqdkwJW4jMY6yZ+TPHG7pnkcZoAuUVVGoWvyjzQGb7qkEM3uB1I9xV iN1kQMucH1GD+VADqKKKACiiigAooooAKKKKACiiigAooooAKKKKACiiigAooooAKKKKACiiigAo oooAKKKKACiiqmr3D2mlXtzFt8yGF5F3DIyFJGfyoeg4rmaSLdFfOz/GHxSIRPHFprwkhWP2d/3b HPyN83XgkHuAe4YLF/wujxR/zy0z/vw3/wAVXH9dp+Z9CuF8c9rfefR1FfOP/C6PFH/PLTP+/Df/ ABVH/C6PFH/PLTP+/Df/ABVH16n5j/1Wx3l959HUV84/8Lo8Uf8APLTP+/Df/FUf8Lo8Uf8APLTP +/Df/FUfXqfmH+q2O8vvPo6ivnH/AIXR4o/55aZ/34b/AOKo/wCF0eKP+eWmf9+G/wDiqPr1PzD/ AFWx3l959HUV4j4K+J2seINXXTtQ1HTNMllwLd2smkSR8/cJ81dpPGPU8cHAPVeNNV8Z+FrGLVIW 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 YolGPalcZ5RovwrTCveEu2Od3I/LGK7jSPBWn2G3ZCny9OBXXAAdBRSAit4EgjCRgAegqWiigAoo ooAKKKKACiiigAooooAKKKKACiiigAooooAKKKKACiiigAooooAKKKKACiiigAooooAKKKKACiii gAooooAKKKKACiiigDzjx/Z3N3rETrKfKSIKsW/nOSWIHTpj34qheyyX810siNHGjBo2wckY7jtX deItJN9GHibZMnKsO1cVfeHtZ1Bvs8svkwEbS0JIY/0qWgJNP1u9t9DeJGkdzN5cUh+bC4zuJ9Mg j8vaqlpI0k+mEuftrTuVY8g/N/Efp6/0rp7zwwDoLWkLPE+3h4zhlPqD2I7Vyri+hjSG/tJZbtRz NAAuT68YoaA6jwtqd5HqLadeP5qgNtk6ngj9OetdnXB+F7KTTo5r/UGbdgsSxJOB25/lWGdT1CfV 7i4DyW6T5QOThwhzjBHp1GPwp3sB6fe2kd5C0cgBB9RXkvjv4Qafq6S3FmPst2cnzYhgtwPvD+Lo OvPHBGTnVlOteFrJbmC6mubKLiRJH37RnGVzxt57YI498dDbeJRdPaAKs0kyZCjKoO5JHJ6Y60cw HydrHhDV/D188d7vubdTnO0sD/wE/wD165q1nOn+JXv0ttloOPKVdjE7cDC/7xGcZr7b1C2ttZst 2pxwSBsGNkT7o75JPNc1f/CzSrolhAgz/sj/AAppgfH0E2bjnIbdyO+a6/zXkGIo3kI5IVSx/Svo iP4P6IzIbi0gl2fd3xhsfTIroNN+Huk2YUR20QC9AFHFO4j5u03wvreqkfZ7Ypk/8tMjj14Br174 ffDBrBFl1KQzSFt+CuAp9hz+efyr1iy0a0tAPKhQY9FFaKqFGAMUXGV7KzitIlSJQAB2FWaKKQBR RRQAUUUUAFFFFABRRRQAUUUUAFFFFABRRRQAUUUUAFFFFABRRRQAUUUUAFFFFABRRRQAUUUUAFFF FABRRRQAUUUUAFFFFABRRRQAUUUUAFJtHoKWigAIyKha2hY5ZFJ+lTUUAcz4wYW9hnb+6BG7A7ZF cyiQ4DuA4/h78ZNegapZpe2rxOAQRivNrvw3rOnsY9NljaDPypMhYKPQYxSauBtHVTHZXUk8hKxp uQv1yen45xjv09qxYXhgtUa3VYLm3DYiACBlY5O33/r9ataR4Z1S7u0l1e4zGpyIIxtjB9cdSfqT jtiuo1LwtaX8SrKgyO+KLAY8eu2c0MNvanzJ5FCmIA5TjqfTt16/nXbWufIXd1xWDovhWy0t90Ma hjznFdGBgYFMAooooAKKKKACiiigAooooAKKKKACiiigAooooAKKKKACiiigAooooAKKKKACiiig AooooAKKKKACiiigAooooAKKKKACiiigAooooAKKKKACiiigAooooAKKKKACiiigAooooAKQqD1A paKAEAA6AUtFFABRRRQAUUUUAFFFFABRRRQAUUUUAFFFFABRRRQAUUUUAFFFFABRRRQAUUUUAFFF FABRRRQAUUUUAFFFFABRRRQAUUUUAFFFFABRRRQAUUUUAFFFFABRRRQAUUUUAFFFFABRRRQAUUUU AFFFFABRRRQAUUUUAFFFFABRRRQAUUUUAFFFFABRRRQAUUUUAFFFFABRRRQAUUUUAFFFFABRRRQA UUUUAFFFFABRRRQAUUUUAFFFFABRRRQAUUUUAFFFFABRRRQAUUUUAFFFFABRRRQAUUUUAFFFFABR RRQAUUUUAFFFFABRRRQAUUUUAFFFFABRRRQAUUUUAFFFFABRRRQB/9k= --------------090708070905080807010806_.REL Content-Type: image/png;name="90863fe593.png" Content-Transfer-Encoding: base64 Content-ID: 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 --------------090708070905080807010806_.REL-- From tdm@sgi.com Wed Feb 17 09:09:23 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=RP_MATCHES_RCVD autolearn=ham version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay1.corp.sgi.com [137.38.102.111]) by oss.sgi.com (Postfix) with ESMTP id 1657D7CA2 for ; Wed, 17 Feb 2016 09:09:23 -0600 (CST) Received: from estes.americas.sgi.com (estes.americas.sgi.com [128.162.236.10]) by relay1.corp.sgi.com (Postfix) with ESMTP id E14B68F8033; Wed, 17 Feb 2016 07:09:22 -0800 (PST) Received: from [128.162.232.11] (porter.americas.sgi.com [128.162.232.11]) by estes.americas.sgi.com (Postfix) with ESMTP id B13C27000709; Wed, 17 Feb 2016 09:09:22 -0600 (CST) Message-ID: <56C48D22.4060509@sgi.com> Date: Wed, 17 Feb 2016 09:09:22 -0600 From: Troy McCorkell User-Agent: Mozilla/5.0 (X11; U; Linux i686 (x86_64); en-US; rv:1.9.1.5) Gecko/20091204 Thunderbird/3.0 MIME-Version: 1.0 To: "xfs@oss.sgi.com" , Dave Chinner , Eric Sandeen , Russell Cattelan Subject: Re: oss.sgi.com - maintenance - rescheduled Fri Feb 19 09:00 CT USA References: <56BE64EA.80906@sgi.com> <56C3AAE3.7030108@sgi.com> In-Reply-To: <56C3AAE3.7030108@sgi.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit On 02/16/2016 05:04 PM, Troy McCorkell wrote: > On 02/12/2016 05:04 PM, Troy McCorkell wrote: >> oss.sgi.com will be down for approximately 30 minutes starting at >> Wed Feb 17 09:00 CT USA for maintenance. > Sending an additional reminder. The maintenance window has been rescheduled to Fri Feb 19 09:00 CT USA to include additional security updates. From BATV+bffad35de576da5f5ff6+4560+infradead.org+hch@bombadil.srs.infradead.org Wed Feb 17 10:54:17 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=ham version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay3.corp.sgi.com [198.149.34.15]) by oss.sgi.com (Postfix) with ESMTP id 321467CA2 for ; Wed, 17 Feb 2016 10:54:17 -0600 (CST) Received: from cuda.sgi.com (cuda3.sgi.com [192.48.176.15]) by relay3.corp.sgi.com (Postfix) with ESMTP id B4CC8AC006 for ; Wed, 17 Feb 2016 08:54:13 -0800 (PST) X-ASG-Debug-ID: 1455728050-04cb6c1e58169140001-NocioJ Received: from bombadil.infradead.org ([198.137.202.9]) by cuda.sgi.com with ESMTP id dVYddf28iYsl2Yba (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128 verify=NO) for ; Wed, 17 Feb 2016 08:54:10 -0800 (PST) X-Barracuda-Envelope-From: BATV+bffad35de576da5f5ff6+4560+infradead.org+hch@bombadil.srs.infradead.org X-Barracuda-Apparent-Source-IP: 198.137.202.9 Received: from hch by bombadil.infradead.org with local (Exim 4.80.1 #2 (Red Hat Linux)) id 1aW5Mf-0004RY-JA; Wed, 17 Feb 2016 16:54:09 +0000 Date: Wed, 17 Feb 2016 08:54:09 -0800 From: Christoph Hellwig To: Eric Sandeen Cc: xfs@oss.sgi.com Subject: Re: [PATCH 1/3 V2] xfs: convert mount option parsing to tokens Message-ID: <20160217165409.GA16723@infradead.org> X-ASG-Orig-Subj: Re: [PATCH 1/3 V2] xfs: convert mount option parsing to tokens References: <56BBC982.50804@redhat.com> <56BBC9E6.5030100@sandeen.net> <56C2412B.9040603@sandeen.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <56C2412B.9040603@sandeen.net> User-Agent: Mutt/1.5.24 (2015-08-30) X-SRS-Rewrite: SMTP reverse-path rewritten from by bombadil.infradead.org. See http://www.infradead.org/rpr.html X-Barracuda-Connect: UNKNOWN[198.137.202.9] X-Barracuda-Start-Time: 1455728050 X-Barracuda-Encrypted: ECDHE-RSA-AES128-GCM-SHA256 X-Barracuda-URL: https://192.48.176.15:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-BRTS-Status: 1 X-Barracuda-Spam-Score: 0.10 X-Barracuda-Spam-Status: No, SCORE=0.10 using per-user scores of TAG_LEVEL=1000.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.7 tests=BSF_SC0_MISMATCH_TO, RDNS_NONE X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.3.27106 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 0.00 BSF_SC0_MISMATCH_TO Envelope rcpt doesn't match header 0.10 RDNS_NONE Delivered to trusted network by a host with no rDNS > -suffix_kstrtoint(char *s, unsigned int base, int *res) > +suffix_kstrtoint(const substring_t *s, unsigned int base, int *res) > { > int last, shift_left_factor = 0, _res; > - char *value = s; > + char *value = match_strdup(s); > + int ret = 0; > + Needs to check for a NULL return value. Otherwise looks fine: Reviewed-by: Christoph Hellwig From BATV+bffad35de576da5f5ff6+4560+infradead.org+hch@bombadil.srs.infradead.org Wed Feb 17 10:55:07 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=ham version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay3.corp.sgi.com [198.149.34.15]) by oss.sgi.com (Postfix) with ESMTP id F27B77CA5 for ; Wed, 17 Feb 2016 10:55:06 -0600 (CST) Received: from cuda.sgi.com (cuda2.sgi.com [192.48.176.25]) by relay3.corp.sgi.com (Postfix) with ESMTP id 8E6B2AC005 for ; Wed, 17 Feb 2016 08:55:06 -0800 (PST) X-ASG-Debug-ID: 1455728104-04cbb04332173fe0001-NocioJ Received: from bombadil.infradead.org ([198.137.202.9]) by cuda.sgi.com with ESMTP id HqUbN9LXSs5JDWE0 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128 verify=NO) for ; Wed, 17 Feb 2016 08:55:04 -0800 (PST) X-Barracuda-Envelope-From: BATV+bffad35de576da5f5ff6+4560+infradead.org+hch@bombadil.srs.infradead.org X-Barracuda-Apparent-Source-IP: 198.137.202.9 Received: from hch by bombadil.infradead.org with local (Exim 4.80.1 #2 (Red Hat Linux)) id 1aW5NY-0005If-8W; Wed, 17 Feb 2016 16:55:04 +0000 Date: Wed, 17 Feb 2016 08:55:04 -0800 From: Christoph Hellwig To: Eric Sandeen Cc: xfs@oss.sgi.com Subject: Re: [PATCH 2/3 V2] xfs: sanitize remount options Message-ID: <20160217165504.GB16723@infradead.org> X-ASG-Orig-Subj: Re: [PATCH 2/3 V2] xfs: sanitize remount options References: <56BBC982.50804@redhat.com> <56BBCA55.3000506@sandeen.net> <56C3F721.8080705@sandeen.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <56C3F721.8080705@sandeen.net> User-Agent: Mutt/1.5.24 (2015-08-30) X-SRS-Rewrite: SMTP reverse-path rewritten from by bombadil.infradead.org. See http://www.infradead.org/rpr.html X-Barracuda-Connect: UNKNOWN[198.137.202.9] X-Barracuda-Start-Time: 1455728104 X-Barracuda-Encrypted: ECDHE-RSA-AES128-GCM-SHA256 X-Barracuda-URL: https://192.48.176.25:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-BRTS-Status: 1 X-Barracuda-Spam-Score: 0.10 X-Barracuda-Spam-Status: No, SCORE=0.10 using per-user scores of TAG_LEVEL=1000.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.7 tests=BSF_SC0_MISMATCH_TO, RDNS_NONE X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.3.27106 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 0.00 BSF_SC0_MISMATCH_TO Envelope rcpt doesn't match header 0.10 RDNS_NONE Delivered to trusted network by a host with no rDNS On Tue, Feb 16, 2016 at 10:29:21PM -0600, Eric Sandeen wrote: > Perform basic sanitization of remount options by > passing the option string and a dummy mount structure > through xfs_parseargs and returning the result. > > Signed-off-by: Eric Sandeen > Reviewed-by: Brian Foster Looks fine, Reviewed-by: Christoph Hellwig From sandeen@sandeen.net Wed Feb 17 11:19:41 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=ham version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay3.corp.sgi.com [198.149.34.15]) by oss.sgi.com (Postfix) with ESMTP id 7AB937CA2 for ; Wed, 17 Feb 2016 11:19:41 -0600 (CST) Received: from cuda.sgi.com (cuda1.sgi.com [192.48.157.11]) by relay3.corp.sgi.com (Postfix) with ESMTP id 2168AAC005 for ; Wed, 17 Feb 2016 09:19:40 -0800 (PST) X-ASG-Debug-ID: 1455729572-04bdf02d5c8c9c0001-NocioJ Received: from sandeen.net (sandeen.net [63.231.237.45]) by cuda.sgi.com with ESMTP id 0L506w4rCuimCYbr for ; Wed, 17 Feb 2016 09:19:32 -0800 (PST) X-Barracuda-Envelope-From: sandeen@sandeen.net X-Barracuda-Apparent-Source-IP: 63.231.237.45 Received: from liberator.sandeen.net (liberator.sandeen.net [10.0.0.4]) (using TLSv1.2 with cipher DHE-RSA-AES128-SHA (128/128 bits)) (No client certificate requested) by sandeen.net (Postfix) with ESMTPSA id 1676C65E4189 for ; Wed, 17 Feb 2016 11:19:32 -0600 (CST) Subject: [PATCH 1/3 V3] xfs: convert mount option parsing to tokens To: xfs@oss.sgi.com X-ASG-Orig-Subj: [PATCH 1/3 V3] xfs: convert mount option parsing to tokens References: <56BBC982.50804@redhat.com> <56BBC9E6.5030100@sandeen.net> From: Eric Sandeen Message-ID: <56C4ABA3.3030905@sandeen.net> Date: Wed, 17 Feb 2016 11:19:31 -0600 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.11; rv:38.0) Gecko/20100101 Thunderbird/38.6.0 MIME-Version: 1.0 In-Reply-To: <56BBC9E6.5030100@sandeen.net> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit X-Barracuda-Connect: sandeen.net[63.231.237.45] X-Barracuda-Start-Time: 1455729572 X-Barracuda-URL: https://192.48.157.11:443/cgi-mod/mark.cgi X-Barracuda-BRTS-Status: 1 X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-Spam-Score: 0.00 X-Barracuda-Spam-Status: No, SCORE=0.00 using per-user scores of TAG_LEVEL=1000.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.7 tests= X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.3.27106 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- This should be a no-op change, just switch to token parsing like every other respectable filesystem does. Signed-off-by: Eric Sandeen Reviewed-by: Brian Foster Reviewed-by: Christoph Hellwig --- V2: Whitespace fixes, remove extraneous break-after-return (Thanks Brian!) V3: Check for -ENOMEM from match_strdup (Thanks Christoph!) diff --git a/fs/xfs/xfs_super.c b/fs/xfs/xfs_super.c index 59c9b7b..9e1538d 100644 --- a/fs/xfs/xfs_super.c +++ b/fs/xfs/xfs_super.c @@ -65,83 +65,85 @@ static struct kset *xfs_kset; /* top-level xfs sysfs dir */ static struct xfs_kobj xfs_dbg_kobj; /* global debug sysfs attrs */ #endif -#define MNTOPT_LOGBUFS "logbufs" /* number of XFS log buffers */ -#define MNTOPT_LOGBSIZE "logbsize" /* size of XFS log buffers */ -#define MNTOPT_LOGDEV "logdev" /* log device */ -#define MNTOPT_RTDEV "rtdev" /* realtime I/O device */ -#define MNTOPT_BIOSIZE "biosize" /* log2 of preferred buffered io size */ -#define MNTOPT_WSYNC "wsync" /* safe-mode nfs compatible mount */ -#define MNTOPT_NOALIGN "noalign" /* turn off stripe alignment */ -#define MNTOPT_SWALLOC "swalloc" /* turn on stripe width allocation */ -#define MNTOPT_SUNIT "sunit" /* data volume stripe unit */ -#define MNTOPT_SWIDTH "swidth" /* data volume stripe width */ -#define MNTOPT_NOUUID "nouuid" /* ignore filesystem UUID */ -#define MNTOPT_MTPT "mtpt" /* filesystem mount point */ -#define MNTOPT_GRPID "grpid" /* group-ID from parent directory */ -#define MNTOPT_NOGRPID "nogrpid" /* group-ID from current process */ -#define MNTOPT_BSDGROUPS "bsdgroups" /* group-ID from parent directory */ -#define MNTOPT_SYSVGROUPS "sysvgroups" /* group-ID from current process */ -#define MNTOPT_ALLOCSIZE "allocsize" /* preferred allocation size */ -#define MNTOPT_NORECOVERY "norecovery" /* don't run XFS recovery */ -#define MNTOPT_BARRIER "barrier" /* use writer barriers for log write and - * unwritten extent conversion */ -#define MNTOPT_NOBARRIER "nobarrier" /* .. disable */ -#define MNTOPT_64BITINODE "inode64" /* inodes can be allocated anywhere */ -#define MNTOPT_32BITINODE "inode32" /* inode allocation limited to - * XFS_MAXINUMBER_32 */ -#define MNTOPT_IKEEP "ikeep" /* do not free empty inode clusters */ -#define MNTOPT_NOIKEEP "noikeep" /* free empty inode clusters */ -#define MNTOPT_LARGEIO "largeio" /* report large I/O sizes in stat() */ -#define MNTOPT_NOLARGEIO "nolargeio" /* do not report large I/O sizes - * in stat(). */ -#define MNTOPT_ATTR2 "attr2" /* do use attr2 attribute format */ -#define MNTOPT_NOATTR2 "noattr2" /* do not use attr2 attribute format */ -#define MNTOPT_FILESTREAM "filestreams" /* use filestreams allocator */ -#define MNTOPT_QUOTA "quota" /* disk quotas (user) */ -#define MNTOPT_NOQUOTA "noquota" /* no quotas */ -#define MNTOPT_USRQUOTA "usrquota" /* user quota enabled */ -#define MNTOPT_GRPQUOTA "grpquota" /* group quota enabled */ -#define MNTOPT_PRJQUOTA "prjquota" /* project quota enabled */ -#define MNTOPT_UQUOTA "uquota" /* user quota (IRIX variant) */ -#define MNTOPT_GQUOTA "gquota" /* group quota (IRIX variant) */ -#define MNTOPT_PQUOTA "pquota" /* project quota (IRIX variant) */ -#define MNTOPT_UQUOTANOENF "uqnoenforce"/* user quota limit enforcement */ -#define MNTOPT_GQUOTANOENF "gqnoenforce"/* group quota limit enforcement */ -#define MNTOPT_PQUOTANOENF "pqnoenforce"/* project quota limit enforcement */ -#define MNTOPT_QUOTANOENF "qnoenforce" /* same as uqnoenforce */ -#define MNTOPT_DISCARD "discard" /* Discard unused blocks */ -#define MNTOPT_NODISCARD "nodiscard" /* Do not discard unused blocks */ - -#define MNTOPT_DAX "dax" /* Enable direct access to bdev pages */ - /* * Table driven mount option parser. - * - * Currently only used for remount, but it will be used for mount - * in the future, too. */ enum { - Opt_barrier, - Opt_nobarrier, - Opt_inode64, - Opt_inode32, - Opt_err + Opt_logbufs, Opt_logbsize, Opt_logdev, Opt_rtdev, Opt_biosize, + Opt_wsync, Opt_noalign, Opt_swalloc, Opt_sunit, Opt_swidth, Opt_nouuid, + Opt_mtpt, Opt_grpid, Opt_nogrpid, Opt_bsdgroups, Opt_sysvgroups, + Opt_allocsize, Opt_norecovery, Opt_barrier, Opt_nobarrier, + Opt_inode64, Opt_inode32, Opt_ikeep, Opt_noikeep, + Opt_largeio, Opt_nolargeio, Opt_attr2, Opt_noattr2, Opt_filestreams, + Opt_quota, Opt_noquota, Opt_usrquota, Opt_grpquota, Opt_prjquota, + Opt_uquota, Opt_gquota, Opt_pquota, + Opt_uqnoenforce, Opt_gqnoenforce, Opt_pqnoenforce, Opt_qnoenforce, + Opt_discard, Opt_nodiscard, Opt_dax, Opt_err, }; static const match_table_t tokens = { - {Opt_barrier, "barrier"}, - {Opt_nobarrier, "nobarrier"}, - {Opt_inode64, "inode64"}, - {Opt_inode32, "inode32"}, - {Opt_err, NULL} + {Opt_logbufs, "logbufs=%u"}, /* number of XFS log buffers */ + {Opt_logbsize, "logbsize=%s"}, /* size of XFS log buffers */ + {Opt_logdev, "logdev=%s"}, /* log device */ + {Opt_rtdev, "rtdev=%s"}, /* realtime I/O device */ + {Opt_biosize, "biosize=%u"}, /* log2 of preferred buffered io size */ + {Opt_wsync, "wsync"}, /* safe-mode nfs compatible mount */ + {Opt_noalign, "noalign"}, /* turn off stripe alignment */ + {Opt_swalloc, "swalloc"}, /* turn on stripe width allocation */ + {Opt_sunit, "sunit=%u"}, /* data volume stripe unit */ + {Opt_swidth, "swidth=%u"}, /* data volume stripe width */ + {Opt_nouuid, "nouuid"}, /* ignore filesystem UUID */ + {Opt_mtpt, "mtpt"}, /* filesystem mount point */ + {Opt_grpid, "grpid"}, /* group-ID from parent directory */ + {Opt_nogrpid, "nogrpid"}, /* group-ID from current process */ + {Opt_bsdgroups, "bsdgroups"}, /* group-ID from parent directory */ + {Opt_sysvgroups,"sysvgroups"}, /* group-ID from current process */ + {Opt_allocsize, "allocsize=%s"},/* preferred allocation size */ + {Opt_norecovery,"norecovery"}, /* don't run XFS recovery */ + {Opt_barrier, "barrier"}, /* use writer barriers for log write and + * unwritten extent conversion */ + {Opt_nobarrier, "nobarrier"}, /* .. disable */ + {Opt_inode64, "inode64"}, /* inodes can be allocated anywhere */ + {Opt_inode32, "inode32"}, /* inode allocation limited to + * XFS_MAXINUMBER_32 */ + {Opt_ikeep, "ikeep"}, /* do not free empty inode clusters */ + {Opt_noikeep, "noikeep"}, /* free empty inode clusters */ + {Opt_largeio, "largeio"}, /* report large I/O sizes in stat() */ + {Opt_nolargeio, "nolargeio"}, /* do not report large I/O sizes + * in stat(). */ + {Opt_attr2, "attr2"}, /* do use attr2 attribute format */ + {Opt_noattr2, "noattr2"}, /* do not use attr2 attribute format */ + {Opt_filestreams,"filestreams"},/* use filestreams allocator */ + {Opt_quota, "quota"}, /* disk quotas (user) */ + {Opt_noquota, "noquota"}, /* no quotas */ + {Opt_usrquota, "usrquota"}, /* user quota enabled */ + {Opt_grpquota, "grpquota"}, /* group quota enabled */ + {Opt_prjquota, "prjquota"}, /* project quota enabled */ + {Opt_uquota, "uquota"}, /* user quota (IRIX variant) */ + {Opt_gquota, "gquota"}, /* group quota (IRIX variant) */ + {Opt_pquota, "pquota"}, /* project quota (IRIX variant) */ + {Opt_uqnoenforce,"uqnoenforce"},/* user quota limit enforcement */ + {Opt_gqnoenforce,"gqnoenforce"},/* group quota limit enforcement */ + {Opt_pqnoenforce,"pqnoenforce"},/* project quota limit enforcement */ + {Opt_qnoenforce, "qnoenforce"}, /* same as uqnoenforce */ + {Opt_discard, "discard"}, /* Discard unused blocks */ + {Opt_nodiscard, "nodiscard"}, /* Do not discard unused blocks */ + + {Opt_dax, "dax"}, /* Enable direct access to bdev pages */ + {Opt_err, NULL}, }; STATIC int -suffix_kstrtoint(char *s, unsigned int base, int *res) +suffix_kstrtoint(const substring_t *s, unsigned int base, int *res) { int last, shift_left_factor = 0, _res; - char *value = s; + char *value; + int ret = 0; + + value = match_strdup(s); + if (!value) + return -ENOMEM; last = strlen(value) - 1; if (value[last] == 'K' || value[last] == 'k') { @@ -157,10 +159,11 @@ suffix_kstrtoint(char *s, unsigned int base, int *res) value[last] = '\0'; } - if (kstrtoint(s, base, &_res)) - return -EINVAL; + if (kstrtoint(value, base, &_res)) + ret = -EINVAL; + kfree(value); *res = _res << shift_left_factor; - return 0; + return ret; } /* @@ -176,7 +179,8 @@ xfs_parseargs( char *options) { struct super_block *sb = mp->m_super; - char *this_char, *value; + char *p; + substring_t args[MAX_OPT_ARGS]; int dsunit = 0; int dswidth = 0; int iosize = 0; @@ -217,152 +221,152 @@ xfs_parseargs( if (!options) goto done; - while ((this_char = strsep(&options, ",")) != NULL) { - if (!*this_char) + while ((p = strsep(&options, ",")) != NULL) { + int token; + + if (!*p) continue; - if ((value = strchr(this_char, '=')) != NULL) - *value++ = 0; - if (!strcmp(this_char, MNTOPT_LOGBUFS)) { - if (!value || !*value) { - xfs_warn(mp, "%s option requires an argument", - this_char); - return -EINVAL; - } - if (kstrtoint(value, 10, &mp->m_logbufs)) - return -EINVAL; - } else if (!strcmp(this_char, MNTOPT_LOGBSIZE)) { - if (!value || !*value) { - xfs_warn(mp, "%s option requires an argument", - this_char); - return -EINVAL; - } - if (suffix_kstrtoint(value, 10, &mp->m_logbsize)) + token = match_token(p, tokens, args); + switch (token) { + case Opt_logbufs: + if (match_int(args, &mp->m_logbufs)) return -EINVAL; - } else if (!strcmp(this_char, MNTOPT_LOGDEV)) { - if (!value || !*value) { - xfs_warn(mp, "%s option requires an argument", - this_char); + break; + case Opt_logbsize: + if (suffix_kstrtoint(args, 10, &mp->m_logbsize)) return -EINVAL; - } - mp->m_logname = kstrndup(value, MAXNAMELEN, GFP_KERNEL); + break; + case Opt_logdev: + mp->m_logname = match_strdup(args); if (!mp->m_logname) return -ENOMEM; - } else if (!strcmp(this_char, MNTOPT_MTPT)) { - xfs_warn(mp, "%s option not allowed on this system", - this_char); + break; + case Opt_mtpt: + xfs_warn(mp, "%s option not allowed on this system", p); return -EINVAL; - } else if (!strcmp(this_char, MNTOPT_RTDEV)) { - if (!value || !*value) { - xfs_warn(mp, "%s option requires an argument", - this_char); - return -EINVAL; - } - mp->m_rtname = kstrndup(value, MAXNAMELEN, GFP_KERNEL); + case Opt_rtdev: + mp->m_rtname = match_strdup(args); if (!mp->m_rtname) return -ENOMEM; - } else if (!strcmp(this_char, MNTOPT_ALLOCSIZE) || - !strcmp(this_char, MNTOPT_BIOSIZE)) { - if (!value || !*value) { - xfs_warn(mp, "%s option requires an argument", - this_char); - return -EINVAL; - } - if (suffix_kstrtoint(value, 10, &iosize)) + break; + case Opt_allocsize: + case Opt_biosize: + if (suffix_kstrtoint(args, 10, &iosize)) return -EINVAL; iosizelog = ffs(iosize) - 1; - } else if (!strcmp(this_char, MNTOPT_GRPID) || - !strcmp(this_char, MNTOPT_BSDGROUPS)) { + break; + case Opt_grpid: + case Opt_bsdgroups: mp->m_flags |= XFS_MOUNT_GRPID; - } else if (!strcmp(this_char, MNTOPT_NOGRPID) || - !strcmp(this_char, MNTOPT_SYSVGROUPS)) { + break; + case Opt_nogrpid: + case Opt_sysvgroups: mp->m_flags &= ~XFS_MOUNT_GRPID; - } else if (!strcmp(this_char, MNTOPT_WSYNC)) { + break; + case Opt_wsync: mp->m_flags |= XFS_MOUNT_WSYNC; - } else if (!strcmp(this_char, MNTOPT_NORECOVERY)) { + break; + case Opt_norecovery: mp->m_flags |= XFS_MOUNT_NORECOVERY; - } else if (!strcmp(this_char, MNTOPT_NOALIGN)) { + break; + case Opt_noalign: mp->m_flags |= XFS_MOUNT_NOALIGN; - } else if (!strcmp(this_char, MNTOPT_SWALLOC)) { + break; + case Opt_swalloc: mp->m_flags |= XFS_MOUNT_SWALLOC; - } else if (!strcmp(this_char, MNTOPT_SUNIT)) { - if (!value || !*value) { - xfs_warn(mp, "%s option requires an argument", - this_char); - return -EINVAL; - } - if (kstrtoint(value, 10, &dsunit)) - return -EINVAL; - } else if (!strcmp(this_char, MNTOPT_SWIDTH)) { - if (!value || !*value) { - xfs_warn(mp, "%s option requires an argument", - this_char); + break; + case Opt_sunit: + if (match_int(args, &dsunit)) return -EINVAL; - } - if (kstrtoint(value, 10, &dswidth)) + break; + case Opt_swidth: + if (match_int(args, &dswidth)) return -EINVAL; - } else if (!strcmp(this_char, MNTOPT_32BITINODE)) { + break; + case Opt_inode32: mp->m_flags |= XFS_MOUNT_SMALL_INUMS; - } else if (!strcmp(this_char, MNTOPT_64BITINODE)) { + break; + case Opt_inode64: mp->m_flags &= ~XFS_MOUNT_SMALL_INUMS; - } else if (!strcmp(this_char, MNTOPT_NOUUID)) { + break; + case Opt_nouuid: mp->m_flags |= XFS_MOUNT_NOUUID; - } else if (!strcmp(this_char, MNTOPT_BARRIER)) { + break; + case Opt_barrier: mp->m_flags |= XFS_MOUNT_BARRIER; - } else if (!strcmp(this_char, MNTOPT_NOBARRIER)) { + break; + case Opt_nobarrier: mp->m_flags &= ~XFS_MOUNT_BARRIER; - } else if (!strcmp(this_char, MNTOPT_IKEEP)) { + break; + case Opt_ikeep: mp->m_flags |= XFS_MOUNT_IKEEP; - } else if (!strcmp(this_char, MNTOPT_NOIKEEP)) { + break; + case Opt_noikeep: mp->m_flags &= ~XFS_MOUNT_IKEEP; - } else if (!strcmp(this_char, MNTOPT_LARGEIO)) { + break; + case Opt_largeio: mp->m_flags &= ~XFS_MOUNT_COMPAT_IOSIZE; - } else if (!strcmp(this_char, MNTOPT_NOLARGEIO)) { + break; + case Opt_nolargeio: mp->m_flags |= XFS_MOUNT_COMPAT_IOSIZE; - } else if (!strcmp(this_char, MNTOPT_ATTR2)) { + break; + case Opt_attr2: mp->m_flags |= XFS_MOUNT_ATTR2; - } else if (!strcmp(this_char, MNTOPT_NOATTR2)) { + break; + case Opt_noattr2: mp->m_flags &= ~XFS_MOUNT_ATTR2; mp->m_flags |= XFS_MOUNT_NOATTR2; - } else if (!strcmp(this_char, MNTOPT_FILESTREAM)) { + break; + case Opt_filestreams: mp->m_flags |= XFS_MOUNT_FILESTREAMS; - } else if (!strcmp(this_char, MNTOPT_NOQUOTA)) { + break; + case Opt_noquota: mp->m_qflags &= ~XFS_ALL_QUOTA_ACCT; mp->m_qflags &= ~XFS_ALL_QUOTA_ENFD; mp->m_qflags &= ~XFS_ALL_QUOTA_ACTIVE; - } else if (!strcmp(this_char, MNTOPT_QUOTA) || - !strcmp(this_char, MNTOPT_UQUOTA) || - !strcmp(this_char, MNTOPT_USRQUOTA)) { + break; + case Opt_quota: + case Opt_uquota: + case Opt_usrquota: mp->m_qflags |= (XFS_UQUOTA_ACCT | XFS_UQUOTA_ACTIVE | XFS_UQUOTA_ENFD); - } else if (!strcmp(this_char, MNTOPT_QUOTANOENF) || - !strcmp(this_char, MNTOPT_UQUOTANOENF)) { + break; + case Opt_qnoenforce: + case Opt_uqnoenforce: mp->m_qflags |= (XFS_UQUOTA_ACCT | XFS_UQUOTA_ACTIVE); mp->m_qflags &= ~XFS_UQUOTA_ENFD; - } else if (!strcmp(this_char, MNTOPT_PQUOTA) || - !strcmp(this_char, MNTOPT_PRJQUOTA)) { + break; + case Opt_pquota: + case Opt_prjquota: mp->m_qflags |= (XFS_PQUOTA_ACCT | XFS_PQUOTA_ACTIVE | XFS_PQUOTA_ENFD); - } else if (!strcmp(this_char, MNTOPT_PQUOTANOENF)) { + break; + case Opt_pqnoenforce: mp->m_qflags |= (XFS_PQUOTA_ACCT | XFS_PQUOTA_ACTIVE); mp->m_qflags &= ~XFS_PQUOTA_ENFD; - } else if (!strcmp(this_char, MNTOPT_GQUOTA) || - !strcmp(this_char, MNTOPT_GRPQUOTA)) { + case Opt_gquota: + case Opt_grpquota: mp->m_qflags |= (XFS_GQUOTA_ACCT | XFS_GQUOTA_ACTIVE | XFS_GQUOTA_ENFD); - } else if (!strcmp(this_char, MNTOPT_GQUOTANOENF)) { + break; + case Opt_gqnoenforce: mp->m_qflags |= (XFS_GQUOTA_ACCT | XFS_GQUOTA_ACTIVE); mp->m_qflags &= ~XFS_GQUOTA_ENFD; - } else if (!strcmp(this_char, MNTOPT_DISCARD)) { + break; + case Opt_discard: mp->m_flags |= XFS_MOUNT_DISCARD; - } else if (!strcmp(this_char, MNTOPT_NODISCARD)) { + break; + case Opt_nodiscard: mp->m_flags &= ~XFS_MOUNT_DISCARD; + break; #ifdef CONFIG_FS_DAX - } else if (!strcmp(this_char, MNTOPT_DAX)) { + case Opt_dax: mp->m_flags |= XFS_MOUNT_DAX; + break; #endif - } else { - xfs_warn(mp, "unknown mount option [%s].", this_char); + default: + xfs_warn(mp, "unknown mount option [%s].", p); return -EINVAL; } } @@ -461,25 +465,25 @@ xfs_showargs( { static struct proc_xfs_info xfs_info_set[] = { /* the few simple ones we can get from the mount struct */ - { XFS_MOUNT_IKEEP, "," MNTOPT_IKEEP }, - { XFS_MOUNT_WSYNC, "," MNTOPT_WSYNC }, - { XFS_MOUNT_NOALIGN, "," MNTOPT_NOALIGN }, - { XFS_MOUNT_SWALLOC, "," MNTOPT_SWALLOC }, - { XFS_MOUNT_NOUUID, "," MNTOPT_NOUUID }, - { XFS_MOUNT_NORECOVERY, "," MNTOPT_NORECOVERY }, - { XFS_MOUNT_ATTR2, "," MNTOPT_ATTR2 }, - { XFS_MOUNT_FILESTREAMS, "," MNTOPT_FILESTREAM }, - { XFS_MOUNT_GRPID, "," MNTOPT_GRPID }, - { XFS_MOUNT_DISCARD, "," MNTOPT_DISCARD }, - { XFS_MOUNT_SMALL_INUMS, "," MNTOPT_32BITINODE }, - { XFS_MOUNT_DAX, "," MNTOPT_DAX }, + { XFS_MOUNT_IKEEP, ",ikeep" }, + { XFS_MOUNT_WSYNC, ",wsync" }, + { XFS_MOUNT_NOALIGN, ",noalign" }, + { XFS_MOUNT_SWALLOC, ",swalloc" }, + { XFS_MOUNT_NOUUID, ",nouuid" }, + { XFS_MOUNT_NORECOVERY, ",norecovery" }, + { XFS_MOUNT_ATTR2, ",attr2" }, + { XFS_MOUNT_FILESTREAMS, ",filestreams" }, + { XFS_MOUNT_GRPID, ",grpid" }, + { XFS_MOUNT_DISCARD, ",discard" }, + { XFS_MOUNT_SMALL_INUMS, ",inode32" }, + { XFS_MOUNT_DAX, ",dax" }, { 0, NULL } }; static struct proc_xfs_info xfs_info_unset[] = { /* the few simple ones we can get from the mount struct */ - { XFS_MOUNT_COMPAT_IOSIZE, "," MNTOPT_LARGEIO }, - { XFS_MOUNT_BARRIER, "," MNTOPT_NOBARRIER }, - { XFS_MOUNT_SMALL_INUMS, "," MNTOPT_64BITINODE }, + { XFS_MOUNT_COMPAT_IOSIZE, ",largeio" }, + { XFS_MOUNT_BARRIER, ",nobarrier" }, + { XFS_MOUNT_SMALL_INUMS, ",inode64" }, { 0, NULL } }; struct proc_xfs_info *xfs_infop; @@ -494,46 +498,46 @@ xfs_showargs( } if (mp->m_flags & XFS_MOUNT_DFLT_IOSIZE) - seq_printf(m, "," MNTOPT_ALLOCSIZE "=%dk", + seq_printf(m, ",allocsize=%dk", (int)(1 << mp->m_writeio_log) >> 10); if (mp->m_logbufs > 0) - seq_printf(m, "," MNTOPT_LOGBUFS "=%d", mp->m_logbufs); + seq_printf(m, ",logbufs=%d", mp->m_logbufs); if (mp->m_logbsize > 0) - seq_printf(m, "," MNTOPT_LOGBSIZE "=%dk", mp->m_logbsize >> 10); + seq_printf(m, ",logbsize=%dk", mp->m_logbsize >> 10); if (mp->m_logname) - seq_show_option(m, MNTOPT_LOGDEV, mp->m_logname); + seq_show_option(m, "logdev", mp->m_logname); if (mp->m_rtname) - seq_show_option(m, MNTOPT_RTDEV, mp->m_rtname); + seq_show_option(m, "rtdev", mp->m_rtname); if (mp->m_dalign > 0) - seq_printf(m, "," MNTOPT_SUNIT "=%d", + seq_printf(m, ",sunit=%d", (int)XFS_FSB_TO_BB(mp, mp->m_dalign)); if (mp->m_swidth > 0) - seq_printf(m, "," MNTOPT_SWIDTH "=%d", + seq_printf(m, ",swidth=%d", (int)XFS_FSB_TO_BB(mp, mp->m_swidth)); if (mp->m_qflags & (XFS_UQUOTA_ACCT|XFS_UQUOTA_ENFD)) - seq_puts(m, "," MNTOPT_USRQUOTA); + seq_puts(m, ",usrquota"); else if (mp->m_qflags & XFS_UQUOTA_ACCT) - seq_puts(m, "," MNTOPT_UQUOTANOENF); + seq_puts(m, ",uqnoenforce"); if (mp->m_qflags & XFS_PQUOTA_ACCT) { if (mp->m_qflags & XFS_PQUOTA_ENFD) - seq_puts(m, "," MNTOPT_PRJQUOTA); + seq_puts(m, ",prjquota"); else - seq_puts(m, "," MNTOPT_PQUOTANOENF); + seq_puts(m, ",pqnoenforce"); } if (mp->m_qflags & XFS_GQUOTA_ACCT) { if (mp->m_qflags & XFS_GQUOTA_ENFD) - seq_puts(m, "," MNTOPT_GRPQUOTA); + seq_puts(m, ",grpquota"); else - seq_puts(m, "," MNTOPT_GQUOTANOENF); + seq_puts(m, ",gqnoenforce"); } if (!(mp->m_qflags & XFS_ALL_QUOTA_ACCT)) - seq_puts(m, "," MNTOPT_NOQUOTA); + seq_puts(m, ",noquota"); return 0; } @@ -1344,9 +1348,8 @@ xfs_finish_flags( */ if (xfs_sb_version_hascrc(&mp->m_sb) && (mp->m_flags & XFS_MOUNT_NOATTR2)) { - xfs_warn(mp, -"Cannot mount a V5 filesystem as %s. %s is always enabled for V5 filesystems.", - MNTOPT_NOATTR2, MNTOPT_ATTR2); + xfs_warn(mp, "Cannot mount a V5 filesystem as noattr2. " + "attr2 is always enabled for V5 filesystems."); return -EINVAL; } From bfoster@redhat.com Wed Feb 17 12:30:35 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=ham version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay1.corp.sgi.com [137.38.102.111]) by oss.sgi.com (Postfix) with ESMTP id 0AB257CA3 for ; Wed, 17 Feb 2016 12:30:35 -0600 (CST) Received: from cuda.sgi.com (cuda2.sgi.com [192.48.176.25]) by relay1.corp.sgi.com (Postfix) with ESMTP id EF4188F8039 for ; Wed, 17 Feb 2016 10:30:31 -0800 (PST) X-ASG-Debug-ID: 1455733826-04cbb043341793c0001-NocioJ Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by cuda.sgi.com with ESMTP id W6OySUmkfDKS7g5t (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO) for ; Wed, 17 Feb 2016 10:30:27 -0800 (PST) X-Barracuda-Envelope-From: bfoster@redhat.com X-Barracuda-Apparent-Source-IP: 209.132.183.28 X-ASG-Whitelist: Client Received: from int-mx11.intmail.prod.int.phx2.redhat.com (int-mx11.intmail.prod.int.phx2.redhat.com [10.5.11.24]) by mx1.redhat.com (Postfix) with ESMTPS id C03A8C000717 for ; Wed, 17 Feb 2016 18:30:26 +0000 (UTC) Received: from bfoster.bfoster (dhcp-41-22.bos.redhat.com [10.18.41.22]) by int-mx11.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id u1HIUQV4028356; Wed, 17 Feb 2016 13:30:26 -0500 Received: by bfoster.bfoster (Postfix, from userid 1000) id 9D7D0120073; Wed, 17 Feb 2016 13:30:25 -0500 (EST) Date: Wed, 17 Feb 2016 13:30:25 -0500 From: Brian Foster To: Eric Sandeen Cc: xfs@oss.sgi.com Subject: Re: [PATCH] xfs: fix up inode32/64 (re)mount handling Message-ID: <20160217183025.GB4065@bfoster.bfoster> X-ASG-Orig-Subj: Re: [PATCH] xfs: fix up inode32/64 (re)mount handling References: <56C3FB75.6030104@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <56C3FB75.6030104@redhat.com> User-Agent: Mutt/1.5.24 (2015-08-30) X-Scanned-By: MIMEDefang 2.68 on 10.5.11.24 X-Barracuda-Connect: mx1.redhat.com[209.132.183.28] X-Barracuda-Start-Time: 1455733827 X-Barracuda-Encrypted: ECDHE-RSA-AES256-GCM-SHA384 X-Barracuda-URL: https://192.48.176.25:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-BRTS-Status: 1 On Tue, Feb 16, 2016 at 10:47:49PM -0600, Eric Sandeen wrote: > inode32/inode64 allocator behavior with respect to mount, > remount and growfs is a little tricky. > > The inode32 mount option should only enable the inode32 > allocator heuristics if the filesystem is large enough > for 64-bit inodes to exist. Today, it has this behavior > on the initial mount, but a remount with inode32 > unconditionally changes the allocation heuristics, even > for a small fs. > > Also, an inode32 mounted small filesystem should transition > to the inode32 allocator if the filesystem is subsequently > grown to a sufficient size. Today that does not happen. > > This patch consolidates xfs_set_inode32 and xfs_set_inode64 > into a single new function, and moves the "is the maximum inode > number big enough to matter" test into that function, so > it doesn't rely on the caller to get it right - which > remount did not do, previously. > > Signed-off-by: Eric Sandeen > --- > > Note, this goes after my token-parsing patch for mount. > ... > diff --git a/fs/xfs/xfs_super.c b/fs/xfs/xfs_super.c > index fe4c14e..044b416 100644 > --- a/fs/xfs/xfs_super.c > +++ b/fs/xfs/xfs_super.c > @@ -577,23 +577,35 @@ xfs_max_file_offset( > } > > /* > - * xfs_set_inode32() and xfs_set_inode64() are passed an agcount > - * because in the growfs case, mp->m_sb.sb_agcount is not updated > - * yet to the potentially higher ag count. > + * Set parameters for inode allocation heuristics, taking into account > + * filesystem size and inode32/inode64 mount options; i.e. specifically > + * whether or not XFS_MOUNT_SMALL_INUMS is set. > + * > + * Inode allocation patterns are altered only if inode32 is requested > + * (XFS_MOUNT_SMALL_INUMS), and the filesystem is sufficiently large. > + * If altered, XFS_MOUNT_32BITINODES is set as well. > + * > + * An agcount independent of that in the mount structure is provided > + * because in the growfs case, mp->m_sb.sb_agcount is not yet updated > + * to the potentially higher ag count. > + * > + * Returns the maximum AG index which may contain inodes. > */ > xfs_agnumber_t > -xfs_set_inode32(struct xfs_mount *mp, xfs_agnumber_t agcount) > +xfs_set_inode_alloc( > + struct xfs_mount *mp, > + xfs_agnumber_t agcount) > { > - xfs_agnumber_t index = 0; > + xfs_agnumber_t index; > xfs_agnumber_t maxagi = 0; > xfs_sb_t *sbp = &mp->m_sb; > xfs_agnumber_t max_metadata; > xfs_agino_t agino; > xfs_ino_t ino; > - xfs_perag_t *pag; > > - /* Calculate how much should be reserved for inodes to meet > - * the max inode percentage. > + /* > + * Calculate how much should be reserved for inodes to meet > + * the max inode percentage. Used only for inode32. > */ > if (mp->m_maxicount) { > __uint64_t icount; > @@ -607,54 +619,48 @@ xfs_set_inode32(struct xfs_mount *mp, xfs_agnumber_t agcount) > max_metadata = agcount; > } > > + /* Get the last possible inode in the filesystem */ > agino = XFS_OFFBNO_TO_AGINO(mp, sbp->sb_agblocks - 1, 0); > + ino = XFS_AGINO_TO_INO(mp, agcount - 1, agino); > + > + /* > + * If user asked for no more than 32-bit inodes, and the fs is > + * sufficiently large, set XFS_MOUNT_32BITINODES if we must alter > + * the allocator to accommodate the request. > + */ > + if ((mp->m_flags & XFS_MOUNT_SMALL_INUMS) && ino > XFS_MAXINUMBER_32) > + mp->m_flags |= XFS_MOUNT_32BITINODES; > + else > + mp->m_flags &= ~XFS_MOUNT_32BITINODES; In the current code, we call into xfs_set_inode64() if XFS_MOUNT_SMALL_INUMS is not set or it is, but the largest inode is within XFS_MAXINUMBER_32. In that latter case, xfs_set_inode64() does: mp->m_flags &= ~(XFS_MOUNT_32BITINODES | XFS_MOUNT_SMALL_INUMS); ... which I think means we want to clear XFS_MOUNT_SMALL_INUMS along with XFS_MOUNT_32BITINODES here, yes? The rest looks fine to me: Reviewed-by: Brian Foster > > for (index = 0; index < agcount; index++) { > - ino = XFS_AGINO_TO_INO(mp, index, agino); > + struct xfs_perag *pag; > > - if (ino > XFS_MAXINUMBER_32) { > - pag = xfs_perag_get(mp, index); > - pag->pagi_inodeok = 0; > - pag->pagf_metadata = 0; > - xfs_perag_put(pag); > - continue; > - } > + ino = XFS_AGINO_TO_INO(mp, index, agino); > > pag = xfs_perag_get(mp, index); > - pag->pagi_inodeok = 1; > - maxagi++; > - if (index < max_metadata) > - pag->pagf_metadata = 1; > - xfs_perag_put(pag); > - } > - mp->m_flags |= (XFS_MOUNT_32BITINODES | > - XFS_MOUNT_SMALL_INUMS); > > - return maxagi; > -} > - > -xfs_agnumber_t > -xfs_set_inode64(struct xfs_mount *mp, xfs_agnumber_t agcount) > -{ > - xfs_agnumber_t index = 0; > - > - for (index = 0; index < agcount; index++) { > - struct xfs_perag *pag; > + if (mp->m_flags & XFS_MOUNT_32BITINODES) { > + if (ino > XFS_MAXINUMBER_32) { > + pag->pagi_inodeok = 0; > + pag->pagf_metadata = 0; > + } else { > + pag->pagi_inodeok = 1; > + maxagi++; > + if (index < max_metadata) > + pag->pagf_metadata = 1; > + else > + pag->pagf_metadata = 0; > + } > + } else { > + pag->pagi_inodeok = 1; > + pag->pagf_metadata = 0; > + } > > - pag = xfs_perag_get(mp, index); > - pag->pagi_inodeok = 1; > - pag->pagf_metadata = 0; > xfs_perag_put(pag); > } > > - /* There is no need for lock protection on m_flags, > - * the rw_semaphore of the VFS superblock is locked > - * during mount/umount/remount operations, so this is > - * enough to avoid concurency on the m_flags field > - */ > - mp->m_flags &= ~(XFS_MOUNT_32BITINODES | > - XFS_MOUNT_SMALL_INUMS); > - return index; > + return (mp->m_flags & XFS_MOUNT_32BITINODES) ? maxagi : agcount; > } > > STATIC int > @@ -1224,10 +1230,12 @@ xfs_fs_remount( > mp->m_flags &= ~XFS_MOUNT_BARRIER; > break; > case Opt_inode64: > - mp->m_maxagi = xfs_set_inode64(mp, sbp->sb_agcount); > + mp->m_flags &= ~XFS_MOUNT_SMALL_INUMS; > + mp->m_maxagi = xfs_set_inode_alloc(mp, sbp->sb_agcount); > break; > case Opt_inode32: > - mp->m_maxagi = xfs_set_inode32(mp, sbp->sb_agcount); > + mp->m_flags |= XFS_MOUNT_SMALL_INUMS; > + mp->m_maxagi = xfs_set_inode_alloc(mp, sbp->sb_agcount); > break; > default: > /* > diff --git a/fs/xfs/xfs_super.h b/fs/xfs/xfs_super.h > index 499058f..2dfb1ce 100644 > --- a/fs/xfs/xfs_super.h > +++ b/fs/xfs/xfs_super.h > @@ -65,8 +65,8 @@ extern __uint64_t xfs_max_file_offset(unsigned int); > > extern void xfs_flush_inodes(struct xfs_mount *mp); > extern void xfs_blkdev_issue_flush(struct xfs_buftarg *); > -extern xfs_agnumber_t xfs_set_inode32(struct xfs_mount *, xfs_agnumber_t agcount); > -extern xfs_agnumber_t xfs_set_inode64(struct xfs_mount *, xfs_agnumber_t agcount); > +extern xfs_agnumber_t xfs_set_inode_alloc(struct xfs_mount *, > + xfs_agnumber_t agcount); > > extern const struct export_operations xfs_export_operations; > extern const struct xattr_handler *xfs_xattr_handlers[]; > > _______________________________________________ > xfs mailing list > xfs@oss.sgi.com > http://oss.sgi.com/mailman/listinfo/xfs From bfoster@redhat.com Wed Feb 17 14:05:00 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=ham version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay1.corp.sgi.com [137.38.102.111]) by oss.sgi.com (Postfix) with ESMTP id 76F897CA4 for ; Wed, 17 Feb 2016 14:05:00 -0600 (CST) Received: from cuda.sgi.com (cuda1.sgi.com [192.48.157.11]) by relay1.corp.sgi.com (Postfix) with ESMTP id 579DC8F8033 for ; Wed, 17 Feb 2016 12:04:57 -0800 (PST) X-ASG-Debug-ID: 1455739495-04bdf02d5b96bc0001-NocioJ Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by cuda.sgi.com with ESMTP id oh1WgLh2NKTOoqVT (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO) for ; Wed, 17 Feb 2016 12:04:56 -0800 (PST) X-Barracuda-Envelope-From: bfoster@redhat.com X-Barracuda-Apparent-Source-IP: 209.132.183.28 X-ASG-Whitelist: Client Received: from int-mx14.intmail.prod.int.phx2.redhat.com (int-mx14.intmail.prod.int.phx2.redhat.com [10.5.11.27]) by mx1.redhat.com (Postfix) with ESMTPS id DCCC0A455A; Wed, 17 Feb 2016 20:04:55 +0000 (UTC) Received: from bfoster.bfoster (dhcp-41-22.bos.redhat.com [10.18.41.22]) by int-mx14.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id u1HK4tgU020605; Wed, 17 Feb 2016 15:04:55 -0500 Received: by bfoster.bfoster (Postfix, from userid 1000) id A823E120073; Wed, 17 Feb 2016 15:04:54 -0500 (EST) Date: Wed, 17 Feb 2016 15:04:54 -0500 From: Brian Foster To: Dave Chinner Cc: xfs@oss.sgi.com, ross.zwisler@linux.intel.com, jack@suse.cz Subject: Re: [PATCH 0/4] xfs: fixes for XFS_DIFLAG2_DAX support Message-ID: <20160217200454.GC4065@bfoster.bfoster> X-ASG-Orig-Subj: Re: [PATCH 0/4] xfs: fixes for XFS_DIFLAG2_DAX support References: <1455513734-15192-1-git-send-email-david@fromorbit.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1455513734-15192-1-git-send-email-david@fromorbit.com> User-Agent: Mutt/1.5.24 (2015-08-30) X-Scanned-By: MIMEDefang 2.68 on 10.5.11.27 X-Barracuda-Connect: mx1.redhat.com[209.132.183.28] X-Barracuda-Start-Time: 1455739496 X-Barracuda-Encrypted: ECDHE-RSA-AES256-GCM-SHA384 X-Barracuda-URL: https://192.48.157.11:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-BRTS-Status: 1 On Mon, Feb 15, 2016 at 04:22:10PM +1100, Dave Chinner wrote: > Hi folks, > > This is a series to add the correct constraints to using the on-disk > inode flag to enable DAX on per-file basis. The same constraints are > placed on setting the flag on directories for inheritance purposes. > > These constraints are: > - the inode flag is limited to regular files or directory > inodes. > - the S_DAX flag is only ever set on regular files > - the flag can only ever be set on filesystems which have > blocksize == PAGE_SIZE (for now) > - When the flag is set or cleared, the current mapping > contents are flushed and then invalidated so that the new > access mode starts with an empty mapping. > - Setting or clearing the flag is atomic w.r.t. IO and > page faults. > > I've tested these manually with xfs_io (patchset for supporting > chattr +x/-x to be sent soon), and it all appears to work as > expected. I'd like to push these for 4.5-rc6 so the initial kernel > with support for this flag doesn't do silly things, so comments, > testing and review woul dbe appreciated. > The commit log description for patch 3 (v2) looks like it needs to be fixed up (multiple title lines and extraneous From: header), but otherwise the series looks good to me: Reviewed-by: Brian Foster > Cheers, > > Dave. > > _______________________________________________ > xfs mailing list > xfs@oss.sgi.com > http://oss.sgi.com/mailman/listinfo/xfs From ross.zwisler@linux.intel.com Wed Feb 17 14:57:47 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=ham version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay1.corp.sgi.com [137.38.102.111]) by oss.sgi.com (Postfix) with ESMTP id EB6C87CA6 for ; Wed, 17 Feb 2016 14:57:47 -0600 (CST) Received: from cuda.sgi.com (cuda3.sgi.com [192.48.176.15]) by relay1.corp.sgi.com (Postfix) with ESMTP id D73738F8040 for ; Wed, 17 Feb 2016 12:57:47 -0800 (PST) X-ASG-Debug-ID: 1455742659-04cb6c1e591787e0001-NocioJ Received: from mga03.intel.com (mga03.intel.com [134.134.136.65]) by cuda.sgi.com with ESMTP id TA4gfMPgNDmdtOmW for ; Wed, 17 Feb 2016 12:57:39 -0800 (PST) X-Barracuda-Envelope-From: ross.zwisler@linux.intel.com X-Barracuda-Apparent-Source-IP: 134.134.136.65 X-ASG-Whitelist: Client Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by orsmga103.jf.intel.com with ESMTP; 17 Feb 2016 12:57:39 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.22,462,1449561600"; d="scan'208";a="49709604" Received: from rzwisler-desk.amr.corp.intel.com (HELO linux.intel.com) ([10.254.20.43]) by fmsmga004.fm.intel.com with ESMTP; 17 Feb 2016 12:57:38 -0800 Date: Wed, 17 Feb 2016 13:57:27 -0700 From: Ross Zwisler To: Dave Chinner Cc: xfs@oss.sgi.com, ross.zwisler@linux.intel.com, jack@suse.cz Subject: Re: [PATCH 3/4 v2] xfs: dynamically switch modes when XFS_DIFLAG2_DAX is set/cleared Message-ID: <20160217205727.GA30126@linux.intel.com> X-ASG-Orig-Subj: Re: [PATCH 3/4 v2] xfs: dynamically switch modes when XFS_DIFLAG2_DAX is set/cleared References: <1455513734-15192-1-git-send-email-david@fromorbit.com> <1455513734-15192-4-git-send-email-david@fromorbit.com> <20160217073121.GC19486@dastard> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20160217073121.GC19486@dastard> User-Agent: Mutt/1.5.24 (2015-08-30) X-Barracuda-Connect: mga03.intel.com[134.134.136.65] X-Barracuda-Start-Time: 1455742659 X-Barracuda-URL: https://192.48.176.15:443/cgi-mod/mark.cgi X-Barracuda-BRTS-Status: 1 X-Virus-Scanned: by bsmtpd at sgi.com On Wed, Feb 17, 2016 at 06:31:21PM +1100, Dave Chinner wrote: > xfs: dynamically switch modes when XFS_DIFLAG2_DAX is set/cleared > > From: Dave Chinner > > When we set or clear the XFS_DIFLAG2_DAX flag, we should also > set/clear the S_DAX flag in the VFS inode. To do this, we need to > ensure that we first flush and remove any cached entries in the > radix tree to ensure the correct data access method is used when we > next try to read or write data. We ahve to be especially careful > here to lock out page faults so they don't race with the flush and > invalidation before we change the access mode. > > Signed-off-by: Dave Chinner > --- > Version 2: > - fix lock leak in xfs_ioctl_setattr where dquot allocation could > fail after we'd locked the inode iolock and mmaplock but we didn't > unlock them on error. > > fs/xfs/xfs_ioctl.c | 105 ++++++++++++++++++++++++++++++++++++++++++++++------- > 1 file changed, 92 insertions(+), 13 deletions(-) <> > @@ -1072,19 +1115,27 @@ xfs_ioctl_setattr_xflags( > * have permission to do so. On success, return a clean transaction and the > * inode locked exclusively ready for further operation specific checks. On > * failure, return an error without modifying or locking the inode. > + * > + * The inode might already be IO locked on call. If this is the case, it is > + * indicated in @join_flags and we take full responsibility for ensuring they > + * are unlocked from now on. Hence if we have an error here, we still have to > + * unlock them. Otherwise, once they are joined to the transaction, they will > + * be unlocked on commit/cancel. > */ > static struct xfs_trans * > xfs_ioctl_setattr_get_trans( > - struct xs_inode *ip) > + struct xfs_inode *ip, Interesting - it looks like 'xfs_inode' got corrupted to 'xs_inode'? After fixing this the series passed all my testing. Tested-by: Ross Zwisler From jack@suse.cz Wed Feb 17 15:33:12 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=ham version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay1.corp.sgi.com [137.38.102.111]) by oss.sgi.com (Postfix) with ESMTP id 6BC607CA8 for ; Wed, 17 Feb 2016 15:33:12 -0600 (CST) Received: from cuda.sgi.com (cuda2.sgi.com [192.48.176.25]) by relay1.corp.sgi.com (Postfix) with ESMTP id 4C1DE8F8033 for ; Wed, 17 Feb 2016 13:33:09 -0800 (PST) X-ASG-Debug-ID: 1455744785-04cbb04333185e90001-NocioJ Received: from mx2.suse.de (mx2.suse.de [195.135.220.15]) by cuda.sgi.com with ESMTP id cUARPXHKGAEpn5K8 (version=TLSv1 cipher=ECDHE-RSA-AES256-SHA bits=256 verify=NO) for ; Wed, 17 Feb 2016 13:33:06 -0800 (PST) X-Barracuda-Envelope-From: jack@suse.cz X-Barracuda-Apparent-Source-IP: 195.135.220.15 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 CF561ABB1; Wed, 17 Feb 2016 21:33:02 +0000 (UTC) Received: by quack.suse.cz (Postfix, from userid 1000) id 532A08169A; Wed, 17 Feb 2016 22:33:25 +0100 (CET) Date: Wed, 17 Feb 2016 22:33:25 +0100 From: Jan Kara To: Ross Zwisler Cc: linux-kernel@vger.kernel.org, "J. Bruce Fields" , Theodore Ts'o , Alexander Viro , Andreas Dilger , Andrew Morton , Dan Williams , Dave Chinner , Jan Kara , Jeff Layton , Jens Axboe , Matthew Wilcox , linux-block@vger.kernel.org, linux-ext4@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux-mm@kvack.org, linux-nvdimm@lists.01.org, xfs@oss.sgi.com Subject: Re: [PATCH v3 2/6] ext2, ext4: only set S_DAX for regular inodes Message-ID: <20160217213325.GH14140@quack.suse.cz> X-ASG-Orig-Subj: Re: [PATCH v3 2/6] ext2, ext4: only set S_DAX for regular inodes References: <1455680059-20126-1-git-send-email-ross.zwisler@linux.intel.com> <1455680059-20126-3-git-send-email-ross.zwisler@linux.intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1455680059-20126-3-git-send-email-ross.zwisler@linux.intel.com> User-Agent: Mutt/1.5.24 (2015-08-30) X-Barracuda-Connect: mx2.suse.de[195.135.220.15] X-Barracuda-Start-Time: 1455744785 X-Barracuda-Encrypted: ECDHE-RSA-AES256-SHA X-Barracuda-URL: https://192.48.176.25:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-BRTS-Status: 1 X-Barracuda-Spam-Score: 0.00 X-Barracuda-Spam-Status: No, SCORE=0.00 using per-user scores of TAG_LEVEL=1000.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.7 tests=BSF_SC0_MISMATCH_TO X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.3.27113 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 0.00 BSF_SC0_MISMATCH_TO Envelope rcpt doesn't match header On Tue 16-02-16 20:34:15, Ross Zwisler wrote: > When S_DAX is set on an inode we assume that if there are pages attached > to the mapping (mapping->nrpages != 0), those pages are clean zero pages > that were used to service reads from holes. Any dirty data associated with > the inode should be in the form of DAX exceptional entries > (mapping->nrexceptional) that is written back via > dax_writeback_mapping_range(). > > With the current code, though, this isn't always true. For example, ext2 > and ext4 directory inodes can have S_DAX set, but have their dirty data > stored as dirty page cache entries. For these types of inodes, having > S_DAX set doesn't really make sense since their I/O doesn't actually happen > through the DAX code path. > > Instead, only allow S_DAX to be set for regular inodes for ext2 and ext4. > This allows us to have strict DAX vs non-DAX paths in the writeback code. > > Signed-off-by: Ross Zwisler Looks good. You can add: Reviewed-by: Jan Kara Honza > --- > fs/ext2/inode.c | 2 +- > fs/ext4/inode.c | 2 +- > 2 files changed, 2 insertions(+), 2 deletions(-) > > diff --git a/fs/ext2/inode.c b/fs/ext2/inode.c > index 338eefd..27e2cdd 100644 > --- a/fs/ext2/inode.c > +++ b/fs/ext2/inode.c > @@ -1296,7 +1296,7 @@ void ext2_set_inode_flags(struct inode *inode) > inode->i_flags |= S_NOATIME; > if (flags & EXT2_DIRSYNC_FL) > inode->i_flags |= S_DIRSYNC; > - if (test_opt(inode->i_sb, DAX)) > + if (test_opt(inode->i_sb, DAX) && S_ISREG(inode->i_mode)) > inode->i_flags |= S_DAX; > } > > diff --git a/fs/ext4/inode.c b/fs/ext4/inode.c > index 83bc8bf..7088aa5 100644 > --- a/fs/ext4/inode.c > +++ b/fs/ext4/inode.c > @@ -4127,7 +4127,7 @@ void ext4_set_inode_flags(struct inode *inode) > new_fl |= S_NOATIME; > if (flags & EXT4_DIRSYNC_FL) > new_fl |= S_DIRSYNC; > - if (test_opt(inode->i_sb, DAX)) > + if (test_opt(inode->i_sb, DAX) && S_ISREG(inode->i_mode)) > new_fl |= S_DAX; > inode_set_flags(inode, new_fl, > S_SYNC|S_APPEND|S_IMMUTABLE|S_NOATIME|S_DIRSYNC|S_DAX); > -- > 2.5.0 > > -- Jan Kara SUSE Labs, CR From jack@suse.cz Wed Feb 17 15:34:38 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=ham version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay2.corp.sgi.com [137.38.102.29]) by oss.sgi.com (Postfix) with ESMTP id 927A57CAA for ; Wed, 17 Feb 2016 15:34:38 -0600 (CST) Received: from cuda.sgi.com (cuda1.sgi.com [192.48.157.11]) by relay2.corp.sgi.com (Postfix) with ESMTP id 73DB6304039 for ; Wed, 17 Feb 2016 13:34:35 -0800 (PST) X-ASG-Debug-ID: 1455744868-04bdf02d5b9c5e0001-NocioJ Received: from mx2.suse.de (mx2.suse.de [195.135.220.15]) by cuda.sgi.com with ESMTP id 7fafiaboFkKlhaL2 (version=TLSv1 cipher=ECDHE-RSA-AES256-SHA bits=256 verify=NO) for ; Wed, 17 Feb 2016 13:34:29 -0800 (PST) X-Barracuda-Envelope-From: jack@suse.cz X-Barracuda-Apparent-Source-IP: 195.135.220.15 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 E0C80AD84; Wed, 17 Feb 2016 21:34:27 +0000 (UTC) Received: by quack.suse.cz (Postfix, from userid 1000) id A33E78169A; Wed, 17 Feb 2016 22:34:50 +0100 (CET) Date: Wed, 17 Feb 2016 22:34:50 +0100 From: Jan Kara To: Ross Zwisler Cc: linux-kernel@vger.kernel.org, "J. Bruce Fields" , Theodore Ts'o , Alexander Viro , Andreas Dilger , Andrew Morton , Dan Williams , Dave Chinner , Jan Kara , Jeff Layton , Jens Axboe , Matthew Wilcox , linux-block@vger.kernel.org, linux-ext4@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux-mm@kvack.org, linux-nvdimm@lists.01.org, xfs@oss.sgi.com Subject: Re: [PATCH v3 3/6] ext4: Online defrag not supported with DAX Message-ID: <20160217213450.GI14140@quack.suse.cz> X-ASG-Orig-Subj: Re: [PATCH v3 3/6] ext4: Online defrag not supported with DAX References: <1455680059-20126-1-git-send-email-ross.zwisler@linux.intel.com> <1455680059-20126-4-git-send-email-ross.zwisler@linux.intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1455680059-20126-4-git-send-email-ross.zwisler@linux.intel.com> User-Agent: Mutt/1.5.24 (2015-08-30) X-Barracuda-Connect: mx2.suse.de[195.135.220.15] X-Barracuda-Start-Time: 1455744869 X-Barracuda-Encrypted: ECDHE-RSA-AES256-SHA X-Barracuda-URL: https://192.48.157.11:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-BRTS-Status: 1 X-Barracuda-Spam-Score: 0.00 X-Barracuda-Spam-Status: No, SCORE=0.00 using per-user scores of TAG_LEVEL=1000.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.7 tests=BSF_SC0_MISMATCH_TO X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.3.27113 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 0.00 BSF_SC0_MISMATCH_TO Envelope rcpt doesn't match header On Tue 16-02-16 20:34:16, Ross Zwisler wrote: > Online defrag operations for ext4 are hard coded to use the page cache. > See ext4_ioctl() -> ext4_move_extents() -> move_extent_per_page() > > When combined with DAX I/O, which circumvents the page cache, this can > result in data corruption. This was observed with xfstests ext4/307 and > ext4/308. > > Fix this by only allowing online defrag for non-DAX files. > > Signed-off-by: Ross Zwisler We need to handle this eventually but for now we are fine. You can add: Reviewed-by: Jan Kara Honza > --- > fs/ext4/ioctl.c | 5 +++++ > 1 file changed, 5 insertions(+) > > diff --git a/fs/ext4/ioctl.c b/fs/ext4/ioctl.c > index 0f6c369..e32c86f 100644 > --- a/fs/ext4/ioctl.c > +++ b/fs/ext4/ioctl.c > @@ -583,6 +583,11 @@ group_extend_out: > "Online defrag not supported with bigalloc"); > err = -EOPNOTSUPP; > goto mext_out; > + } else if (IS_DAX(inode)) { > + ext4_msg(sb, KERN_ERR, > + "Online defrag not supported with DAX"); > + err = -EOPNOTSUPP; > + goto mext_out; > } > > err = mnt_want_write_file(filp); > -- > 2.5.0 > > -- Jan Kara SUSE Labs, CR From jack@suse.cz Wed Feb 17 15:38:02 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=ham version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay3.corp.sgi.com [198.149.34.15]) by oss.sgi.com (Postfix) with ESMTP id B1EC37CAE for ; Wed, 17 Feb 2016 15:38:02 -0600 (CST) Received: from cuda.sgi.com (cuda2.sgi.com [192.48.176.25]) by relay3.corp.sgi.com (Postfix) with ESMTP id 3F1B5AC00A for ; Wed, 17 Feb 2016 13:38:02 -0800 (PST) X-ASG-Debug-ID: 1455745079-04cbb043321861f0001-NocioJ Received: from mx2.suse.de (mx2.suse.de [195.135.220.15]) by cuda.sgi.com with ESMTP id JiMHE9P3hS5G14PA (version=TLSv1 cipher=ECDHE-RSA-AES256-SHA bits=256 verify=NO) for ; Wed, 17 Feb 2016 13:38:00 -0800 (PST) X-Barracuda-Envelope-From: jack@suse.cz X-Barracuda-Apparent-Source-IP: 195.135.220.15 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 D8EAEADB8; Wed, 17 Feb 2016 21:37:16 +0000 (UTC) Received: by quack.suse.cz (Postfix, from userid 1000) id D3DD48169A; Wed, 17 Feb 2016 22:37:38 +0100 (CET) Date: Wed, 17 Feb 2016 22:37:38 +0100 From: Jan Kara To: Ross Zwisler Cc: linux-kernel@vger.kernel.org, "J. Bruce Fields" , Theodore Ts'o , Alexander Viro , Andreas Dilger , Andrew Morton , Dan Williams , Dave Chinner , Jan Kara , Jeff Layton , Jens Axboe , Matthew Wilcox , linux-block@vger.kernel.org, linux-ext4@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux-mm@kvack.org, linux-nvdimm@lists.01.org, xfs@oss.sgi.com Subject: Re: [PATCH v3 4/6] dax: give DAX clearing code correct bdev Message-ID: <20160217213738.GJ14140@quack.suse.cz> X-ASG-Orig-Subj: Re: [PATCH v3 4/6] dax: give DAX clearing code correct bdev References: <1455680059-20126-1-git-send-email-ross.zwisler@linux.intel.com> <1455680059-20126-5-git-send-email-ross.zwisler@linux.intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1455680059-20126-5-git-send-email-ross.zwisler@linux.intel.com> User-Agent: Mutt/1.5.24 (2015-08-30) X-Barracuda-Connect: mx2.suse.de[195.135.220.15] X-Barracuda-Start-Time: 1455745079 X-Barracuda-Encrypted: ECDHE-RSA-AES256-SHA X-Barracuda-URL: https://192.48.176.25:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-BRTS-Status: 1 X-Barracuda-Spam-Score: 0.00 X-Barracuda-Spam-Status: No, SCORE=0.00 using per-user scores of TAG_LEVEL=1000.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.7 tests=BSF_SC0_MISMATCH_TO X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.3.27113 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 0.00 BSF_SC0_MISMATCH_TO Envelope rcpt doesn't match header On Tue 16-02-16 20:34:17, Ross Zwisler wrote: > dax_clear_blocks() needs a valid struct block_device and previously it was > using inode->i_sb->s_bdev in all cases. This is correct for normal inodes > on mounted ext2, ext4 and XFS filesystems, but is incorrect for DAX raw > block devices and for XFS real-time devices. > > Instead, rename dax_clear_blocks() to dax_clear_sectors(), and change its > arguments to take a bdev and a sector instead of an inode and a block. > This better reflects what the function does, and it allows the filesystem > and raw block device code to pass in an appropriate struct block_device. > > Signed-off-by: Ross Zwisler > Suggested-by: Dan Williams The patch looks good to me. You can add: Reviewed-by: Jan Kara Honza > --- > fs/dax.c | 9 ++++----- > fs/ext2/inode.c | 6 ++++-- > fs/xfs/xfs_aops.c | 2 +- > fs/xfs/xfs_aops.h | 1 + > fs/xfs/xfs_bmap_util.c | 3 ++- > include/linux/dax.h | 2 +- > 6 files changed, 13 insertions(+), 10 deletions(-) > > diff --git a/fs/dax.c b/fs/dax.c > index fc2e314..9a173dd 100644 > --- a/fs/dax.c > +++ b/fs/dax.c > @@ -79,15 +79,14 @@ struct page *read_dax_sector(struct block_device *bdev, sector_t n) > } > > /* > - * dax_clear_blocks() is called from within transaction context from XFS, > + * dax_clear_sectors() is called from within transaction context from XFS, > * and hence this means the stack from this point must follow GFP_NOFS > * semantics for all operations. > */ > -int dax_clear_blocks(struct inode *inode, sector_t block, long _size) > +int dax_clear_sectors(struct block_device *bdev, sector_t _sector, long _size) > { > - struct block_device *bdev = inode->i_sb->s_bdev; > struct blk_dax_ctl dax = { > - .sector = block << (inode->i_blkbits - 9), > + .sector = _sector, > .size = _size, > }; > > @@ -109,7 +108,7 @@ int dax_clear_blocks(struct inode *inode, sector_t block, long _size) > wmb_pmem(); > return 0; > } > -EXPORT_SYMBOL_GPL(dax_clear_blocks); > +EXPORT_SYMBOL_GPL(dax_clear_sectors); > > /* the clear_pmem() calls are ordered by a wmb_pmem() in the caller */ > static void dax_new_buf(void __pmem *addr, unsigned size, unsigned first, > diff --git a/fs/ext2/inode.c b/fs/ext2/inode.c > index 27e2cdd..4467cbd 100644 > --- a/fs/ext2/inode.c > +++ b/fs/ext2/inode.c > @@ -737,8 +737,10 @@ static int ext2_get_blocks(struct inode *inode, > * so that it's not found by another thread before it's > * initialised > */ > - err = dax_clear_blocks(inode, le32_to_cpu(chain[depth-1].key), > - 1 << inode->i_blkbits); > + err = dax_clear_sectors(inode->i_sb->s_bdev, > + le32_to_cpu(chain[depth-1].key) << > + (inode->i_blkbits - 9), > + 1 << inode->i_blkbits); > if (err) { > mutex_unlock(&ei->truncate_mutex); > goto cleanup; > diff --git a/fs/xfs/xfs_aops.c b/fs/xfs/xfs_aops.c > index 379c089..fc20518 100644 > --- a/fs/xfs/xfs_aops.c > +++ b/fs/xfs/xfs_aops.c > @@ -55,7 +55,7 @@ xfs_count_page_state( > } while ((bh = bh->b_this_page) != head); > } > > -STATIC struct block_device * > +struct block_device * > xfs_find_bdev_for_inode( > struct inode *inode) > { > diff --git a/fs/xfs/xfs_aops.h b/fs/xfs/xfs_aops.h > index f6ffc9a..a4343c6 100644 > --- a/fs/xfs/xfs_aops.h > +++ b/fs/xfs/xfs_aops.h > @@ -62,5 +62,6 @@ int xfs_get_blocks_dax_fault(struct inode *inode, sector_t offset, > struct buffer_head *map_bh, int create); > > extern void xfs_count_page_state(struct page *, int *, int *); > +extern struct block_device *xfs_find_bdev_for_inode(struct inode *); > > #endif /* __XFS_AOPS_H__ */ > diff --git a/fs/xfs/xfs_bmap_util.c b/fs/xfs/xfs_bmap_util.c > index 45ec9e4..6c87601 100644 > --- a/fs/xfs/xfs_bmap_util.c > +++ b/fs/xfs/xfs_bmap_util.c > @@ -75,7 +75,8 @@ xfs_zero_extent( > ssize_t size = XFS_FSB_TO_B(mp, count_fsb); > > if (IS_DAX(VFS_I(ip))) > - return dax_clear_blocks(VFS_I(ip), block, size); > + return dax_clear_sectors(xfs_find_bdev_for_inode(VFS_I(ip)), > + sector, size); > > /* > * let the block layer decide on the fastest method of > diff --git a/include/linux/dax.h b/include/linux/dax.h > index 818e450..7b6bced 100644 > --- a/include/linux/dax.h > +++ b/include/linux/dax.h > @@ -7,7 +7,7 @@ > > ssize_t dax_do_io(struct kiocb *, struct inode *, struct iov_iter *, loff_t, > get_block_t, dio_iodone_t, int flags); > -int dax_clear_blocks(struct inode *, sector_t block, long size); > +int dax_clear_sectors(struct block_device *bdev, sector_t _sector, long _size); > int dax_zero_page_range(struct inode *, loff_t from, unsigned len, get_block_t); > int dax_truncate_page(struct inode *, loff_t from, get_block_t); > int dax_fault(struct vm_area_struct *, struct vm_fault *, get_block_t, > -- > 2.5.0 > > -- Jan Kara SUSE Labs, CR From ross.zwisler@linux.intel.com Wed Feb 17 15:50:55 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=ham version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay2.corp.sgi.com [137.38.102.29]) by oss.sgi.com (Postfix) with ESMTP id 036FB7CAE for ; Wed, 17 Feb 2016 15:50:55 -0600 (CST) Received: from cuda.sgi.com (cuda1.sgi.com [192.48.157.11]) by relay2.corp.sgi.com (Postfix) with ESMTP id BC79A304048 for ; Wed, 17 Feb 2016 13:50:54 -0800 (PST) X-ASG-Debug-ID: 1455745850-04bdf02d5c9d1d0001-NocioJ Received: from mga11.intel.com ([192.55.52.93]) by cuda.sgi.com with ESMTP id Tm60NMGI2T7rBszp for ; Wed, 17 Feb 2016 13:50:50 -0800 (PST) X-Barracuda-Envelope-From: ross.zwisler@linux.intel.com X-Barracuda-Apparent-Source-IP: 192.55.52.93 X-ASG-Whitelist: Client Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by fmsmga102.fm.intel.com with ESMTP; 17 Feb 2016 13:50:51 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.22,462,1449561600"; d="scan'208";a="654617276" Received: from rzwisler-desk.amr.corp.intel.com (HELO linux.intel.com) ([10.254.20.43]) by FMSMGA003.fm.intel.com with ESMTP; 17 Feb 2016 13:50:49 -0800 Date: Wed, 17 Feb 2016 14:50:37 -0700 From: Ross Zwisler To: Jan Kara Cc: linux-kernel@vger.kernel.org, "J. Bruce Fields" , Theodore Ts'o , Alexander Viro , Andreas Dilger , Andrew Morton , Dan Williams , Dave Chinner , Jan Kara , Jeff Layton , Jens Axboe , Matthew Wilcox , linux-block@vger.kernel.org, linux-ext4@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux-mm@kvack.org, linux-nvdimm@lists.01.org, xfs@oss.sgi.com Subject: Re: [PATCH v3 3/6] ext4: Online defrag not supported with DAX Message-ID: <20160217215037.GB30126@linux.intel.com> X-ASG-Orig-Subj: Re: [PATCH v3 3/6] ext4: Online defrag not supported with DAX Mail-Followup-To: Ross Zwisler , Jan Kara , linux-kernel@vger.kernel.org, "J. Bruce Fields" , Theodore Ts'o , Alexander Viro , Andreas Dilger , Andrew Morton , Dan Williams , Dave Chinner , Jan Kara , Jeff Layton , Jens Axboe , Matthew Wilcox , linux-block@vger.kernel.org, linux-ext4@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux-mm@kvack.org, linux-nvdimm@lists.01.org, xfs@oss.sgi.com References: <1455680059-20126-1-git-send-email-ross.zwisler@linux.intel.com> <1455680059-20126-4-git-send-email-ross.zwisler@linux.intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1455680059-20126-4-git-send-email-ross.zwisler@linux.intel.com> User-Agent: Mutt/1.5.24 (2015-08-30) X-Barracuda-Connect: UNKNOWN[192.55.52.93] X-Barracuda-Start-Time: 1455745850 X-Barracuda-URL: https://192.48.157.11:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-BRTS-Status: 1 On Tue, Feb 16, 2016 at 08:34:16PM -0700, Ross Zwisler wrote: > Online defrag operations for ext4 are hard coded to use the page cache. > See ext4_ioctl() -> ext4_move_extents() -> move_extent_per_page() > > When combined with DAX I/O, which circumvents the page cache, this can > result in data corruption. This was observed with xfstests ext4/307 and > ext4/308. > > Fix this by only allowing online defrag for non-DAX files. Jan, Thinking about this a bit more, it's probably the case that the data corruption I was observing was due to us skipping the writeback of the dirty page cache pages because S_DAX was set. I do think we have a problem with defrag because it is doing the extent swapping using the page cache, and we won't flush the dirty pages due to S_DAX being set. This patch is the quick and easy answer, and is perhaps appropriate for v4.5. Looking forward, though, what do you think the correct solution is? Making an extent swapper that doesn't use the page cache (as I believe XFS has? see xfs_swap_extents()), or maybe just unsetting S_DAX while we do the defrag and being careful to block out page faults and I/O? Or is it acceptable to just say that DAX and defrag are mutually exclusive for ext4? Thanks, - Ross > > Signed-off-by: Ross Zwisler > --- > fs/ext4/ioctl.c | 5 +++++ > 1 file changed, 5 insertions(+) > > diff --git a/fs/ext4/ioctl.c b/fs/ext4/ioctl.c > index 0f6c369..e32c86f 100644 > --- a/fs/ext4/ioctl.c > +++ b/fs/ext4/ioctl.c > @@ -583,6 +583,11 @@ group_extend_out: > "Online defrag not supported with bigalloc"); > err = -EOPNOTSUPP; > goto mext_out; > + } else if (IS_DAX(inode)) { > + ext4_msg(sb, KERN_ERR, > + "Online defrag not supported with DAX"); > + err = -EOPNOTSUPP; > + goto mext_out; > } > > err = mnt_want_write_file(filp); > -- > 2.5.0 > From jack@suse.cz Wed Feb 17 15:54:01 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=ham version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay2.corp.sgi.com [137.38.102.29]) by oss.sgi.com (Postfix) with ESMTP id B33597CAF for ; Wed, 17 Feb 2016 15:54:01 -0600 (CST) Received: from cuda.sgi.com (cuda1.sgi.com [192.48.157.11]) by relay2.corp.sgi.com (Postfix) with ESMTP id 85E59304039 for ; Wed, 17 Feb 2016 13:54:01 -0800 (PST) X-ASG-Debug-ID: 1455746038-04bdf02d5d9d380001-NocioJ Received: from mx2.suse.de (mx2.suse.de [195.135.220.15]) by cuda.sgi.com with ESMTP id VimGfIK8v3GXXIk1 (version=TLSv1 cipher=ECDHE-RSA-AES256-SHA bits=256 verify=NO) for ; Wed, 17 Feb 2016 13:53:59 -0800 (PST) X-Barracuda-Envelope-From: jack@suse.cz X-Barracuda-Apparent-Source-IP: 195.135.220.15 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 81EDEABB1; Wed, 17 Feb 2016 21:53:57 +0000 (UTC) Received: by quack.suse.cz (Postfix, from userid 1000) id 36CAB8169A; Wed, 17 Feb 2016 22:54:20 +0100 (CET) Date: Wed, 17 Feb 2016 22:54:20 +0100 From: Jan Kara To: Ross Zwisler Cc: linux-kernel@vger.kernel.org, Dan Williams , "J. Bruce Fields" , Theodore Ts'o , Alexander Viro , Andreas Dilger , Andrew Morton , Dave Chinner , Jan Kara , Jeff Layton , Jens Axboe , Matthew Wilcox , linux-block@vger.kernel.org, linux-ext4@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux-mm@kvack.org, linux-nvdimm@lists.01.org, xfs@oss.sgi.com, Jan Kara , Jens Axboe , Al Viro , Matthew Wilcox Subject: Re: [PATCH v3 6/6] block: use dax_do_io() if blkdev_dax_capable() Message-ID: <20160217215420.GK14140@quack.suse.cz> X-ASG-Orig-Subj: Re: [PATCH v3 6/6] block: use dax_do_io() if blkdev_dax_capable() References: <1455680059-20126-1-git-send-email-ross.zwisler@linux.intel.com> <1455680059-20126-7-git-send-email-ross.zwisler@linux.intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1455680059-20126-7-git-send-email-ross.zwisler@linux.intel.com> User-Agent: Mutt/1.5.24 (2015-08-30) X-Barracuda-Connect: mx2.suse.de[195.135.220.15] X-Barracuda-Start-Time: 1455746039 X-Barracuda-Encrypted: ECDHE-RSA-AES256-SHA X-Barracuda-URL: https://192.48.157.11:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-BRTS-Status: 1 X-Barracuda-Spam-Score: 0.00 X-Barracuda-Spam-Status: No, SCORE=0.00 using per-user scores of TAG_LEVEL=1000.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.7 tests=BSF_SC0_MISMATCH_TO X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.3.27114 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 0.00 BSF_SC0_MISMATCH_TO Envelope rcpt doesn't match header On Tue 16-02-16 20:34:19, Ross Zwisler wrote: > From: Dan Williams > > Setting S_DAX on an inode requires that the inode participate in the > DAX-fsync mechanism which expects to use the pagecache for tracking > potentially dirty cpu cachelines. However, dax_do_io() participates in > the standard pagecache sync semantics and arranges for dirty pages to be > flushed through the driver when a direct-IO operation accesses the same > ranges. > > It should always be valid to use the dax_do_io() path regardless of > whether the block_device inode has S_DAX set. In either case dirty > pages or dirty cachelines are made durable before the direct-IO > operation proceeds. Please no. I agree that going via DAX path for normal likely won't introduce new data corruption issues. But I dislike having a special case for block devices. Also you have no way of turning DAX off for block devices AFAIU and as Dave said, DAX should be opt-in, not opt-out. Note that you may actually want to go through the block layer for normal IO e.g. because you use IO cgroups to limit processes so using DAX regresses some functionality. Honza > Cc: Jan Kara > Cc: Jens Axboe > Cc: Al Viro > Cc: Dave Chinner > Cc: Ross Zwisler > Cc: Matthew Wilcox > Signed-off-by: Dan Williams > Signed-off-by: Ross Zwisler > --- > block/ioctl.c | 1 + > fs/block_dev.c | 3 ++- > include/linux/fs.h | 31 +++++++++++++++++++++---------- > 3 files changed, 24 insertions(+), 11 deletions(-) > > diff --git a/block/ioctl.c b/block/ioctl.c > index d8996bb..7c64286 100644 > --- a/block/ioctl.c > +++ b/block/ioctl.c > @@ -434,6 +434,7 @@ bool blkdev_dax_capable(struct block_device *bdev) > > return true; > } > +EXPORT_SYMBOL(blkdev_dax_capable); > #endif > > static int blkdev_flushbuf(struct block_device *bdev, fmode_t mode, > diff --git a/fs/block_dev.c b/fs/block_dev.c > index 826b164..0e937dd 100644 > --- a/fs/block_dev.c > +++ b/fs/block_dev.c > @@ -166,8 +166,9 @@ blkdev_direct_IO(struct kiocb *iocb, struct iov_iter *iter, loff_t offset) > { > struct file *file = iocb->ki_filp; > struct inode *inode = bdev_file_inode(file); > + struct block_device *bdev = I_BDEV(inode); > > - if (IS_DAX(inode)) > + if (blkdev_dax_capable(bdev)) > return dax_do_io(iocb, inode, iter, offset, blkdev_get_block, > NULL, DIO_SKIP_DIO_COUNT); > return __blockdev_direct_IO(iocb, inode, I_BDEV(inode), iter, offset, > diff --git a/include/linux/fs.h b/include/linux/fs.h > index ae68100..a3f5ee8 100644 > --- a/include/linux/fs.h > +++ b/include/linux/fs.h > @@ -830,7 +830,14 @@ static inline unsigned imajor(const struct inode *inode) > return MAJOR(inode->i_rdev); > } > > +#ifdef CONFIG_BLOCK > extern struct block_device *I_BDEV(struct inode *inode); > +#else > +static inline struct block_device *I_BDEV(struct inode *inode) > +{ > + return NULL; > +} > +#endif > > struct fown_struct { > rwlock_t lock; /* protects pid, uid, euid fields */ > @@ -2306,15 +2313,6 @@ extern struct super_block *freeze_bdev(struct block_device *); > extern void emergency_thaw_all(void); > extern int thaw_bdev(struct block_device *bdev, struct super_block *sb); > extern int fsync_bdev(struct block_device *); > -#ifdef CONFIG_FS_DAX > -extern bool blkdev_dax_capable(struct block_device *bdev); > -#else > -static inline bool blkdev_dax_capable(struct block_device *bdev) > -{ > - return false; > -} > -#endif > - > extern struct super_block *blockdev_superblock; > > static inline bool sb_is_blkdev_sb(struct super_block *sb) > @@ -2902,9 +2900,22 @@ extern int generic_show_options(struct seq_file *m, struct dentry *root); > extern void save_mount_options(struct super_block *sb, char *options); > extern void replace_mount_options(struct super_block *sb, char *options); > > +#ifdef CONFIG_FS_DAX > +extern bool blkdev_dax_capable(struct block_device *bdev); > +#else > +static inline bool blkdev_dax_capable(struct block_device *bdev) > +{ > + return false; > +} > +#endif > + > static inline bool io_is_direct(struct file *filp) > { > - return (filp->f_flags & O_DIRECT) || IS_DAX(filp->f_mapping->host); > + struct inode *inode = filp->f_mapping->host; > + > + return (filp->f_flags & O_DIRECT) || IS_DAX(inode) > + || (S_ISBLK(file_inode(filp)->i_mode) > + && blkdev_dax_capable(I_BDEV(inode))); > } > > static inline int iocb_flags(struct file *file) > -- > 2.5.0 > -- Jan Kara SUSE Labs, CR From jack@suse.cz Wed Feb 17 15:55:15 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=ham version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay1.corp.sgi.com [137.38.102.111]) by oss.sgi.com (Postfix) with ESMTP id 96A3D7CB4 for ; Wed, 17 Feb 2016 15:55:15 -0600 (CST) Received: from cuda.sgi.com (cuda2.sgi.com [192.48.176.25]) by relay1.corp.sgi.com (Postfix) with ESMTP id 757318F8033 for ; Wed, 17 Feb 2016 13:55:15 -0800 (PST) X-ASG-Debug-ID: 1455746112-04cbb04331186e80001-NocioJ Received: from mx2.suse.de (mx2.suse.de [195.135.220.15]) by cuda.sgi.com with ESMTP id Vaw8ueG6DUkavoQi (version=TLSv1 cipher=ECDHE-RSA-AES256-SHA bits=256 verify=NO) for ; Wed, 17 Feb 2016 13:55:13 -0800 (PST) X-Barracuda-Envelope-From: jack@suse.cz X-Barracuda-Apparent-Source-IP: 195.135.220.15 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay1.suse.de (charybdis-ext.suse.de [195.135.220.254]) by mx2.suse.de (Postfix) with ESMTP id AFA2CABB1; Wed, 17 Feb 2016 21:55:11 +0000 (UTC) Received: by quack.suse.cz (Postfix, from userid 1000) id 52A4A8169A; Wed, 17 Feb 2016 22:55:34 +0100 (CET) Date: Wed, 17 Feb 2016 22:55:34 +0100 From: Jan Kara To: Ross Zwisler Cc: linux-kernel@vger.kernel.org, Dan Williams , "J. Bruce Fields" , Theodore Ts'o , Alexander Viro , Andreas Dilger , Andrew Morton , Dave Chinner , Jan Kara , Jeff Layton , Jens Axboe , Matthew Wilcox , linux-block@vger.kernel.org, linux-ext4@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux-mm@kvack.org, linux-nvdimm@lists.01.org, xfs@oss.sgi.com, Jan Kara , Jens Axboe , Matthew Wilcox , Al Viro Subject: Re: [PATCH v3 1/6] block: disable block device DAX by default Message-ID: <20160217215534.GL14140@quack.suse.cz> X-ASG-Orig-Subj: Re: [PATCH v3 1/6] block: disable block device DAX by default References: <1455680059-20126-1-git-send-email-ross.zwisler@linux.intel.com> <1455680059-20126-2-git-send-email-ross.zwisler@linux.intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1455680059-20126-2-git-send-email-ross.zwisler@linux.intel.com> User-Agent: Mutt/1.5.24 (2015-08-30) X-Barracuda-Connect: mx2.suse.de[195.135.220.15] X-Barracuda-Start-Time: 1455746113 X-Barracuda-Encrypted: ECDHE-RSA-AES256-SHA X-Barracuda-URL: https://192.48.176.25:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-BRTS-Status: 1 X-Barracuda-Spam-Score: 0.00 X-Barracuda-Spam-Status: No, SCORE=0.00 using per-user scores of TAG_LEVEL=1000.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.7 tests=BSF_SC0_MISMATCH_TO X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.3.27114 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 0.00 BSF_SC0_MISMATCH_TO Envelope rcpt doesn't match header On Tue 16-02-16 20:34:14, Ross Zwisler wrote: > From: Dan Williams > > The recent *sync enabling discovered that we are inserting into the > block_device pagecache counter to the expectations of the dirty data > tracking for dax mappings. This can lead to data corruption. > > We want to support DAX for block devices eventually, but it requires > wider changes to properly manage the pagecache. > > [] dump_stack+0x85/0xc2 > [] dax_writeback_mapping_range+0x60/0xe0 > [] blkdev_writepages+0x3f/0x50 > [] do_writepages+0x21/0x30 > [] __filemap_fdatawrite_range+0xc6/0x100 > [] filemap_write_and_wait+0x4a/0xa0 > [] set_blocksize+0x70/0xd0 > [] sb_set_blocksize+0x1d/0x50 > [] ext4_fill_super+0x75b/0x3360 > [] ? vsnprintf+0x201/0x4c0 > [] ? snprintf+0x49/0x60 > [] mount_bdev+0x180/0x1b0 > [] ? ext4_calculate_overhead+0x370/0x370 > [] ext4_mount+0x15/0x20 > [] mount_fs+0x38/0x170 > > Mark the support broken so its disabled by default, but otherwise still > available for testing. > > Cc: Jan Kara > Cc: Jens Axboe > Cc: Matthew Wilcox > Cc: Al Viro > Reported-by: Ross Zwisler > Suggested-by: Dave Chinner > Signed-off-by: Dan Williams > Signed-off-by: Ross Zwisler Makes sense. You can add: Reviewed-by: Jan Kara Honza > --- > block/Kconfig | 13 +++++++++++++ > fs/block_dev.c | 6 +++++- > 2 files changed, 18 insertions(+), 1 deletion(-) > > diff --git a/block/Kconfig b/block/Kconfig > index 161491d..0363cd7 100644 > --- a/block/Kconfig > +++ b/block/Kconfig > @@ -88,6 +88,19 @@ config BLK_DEV_INTEGRITY > T10/SCSI Data Integrity Field or the T13/ATA External Path > Protection. If in doubt, say N. > > +config BLK_DEV_DAX > + bool "Block device DAX support" > + depends on FS_DAX > + depends on BROKEN > + help > + When DAX support is available (CONFIG_FS_DAX) raw block > + devices can also support direct userspace access to the > + storage capacity via MMAP(2) similar to a file on a > + DAX-enabled filesystem. However, the DAX I/O-path disables > + some standard I/O-statistics, and the MMAP(2) path has some > + operational differences due to bypassing the page > + cache. If in doubt, say N. > + > config BLK_DEV_THROTTLING > bool "Block layer bio throttling support" > depends on BLK_CGROUP=y > diff --git a/fs/block_dev.c b/fs/block_dev.c > index 39b3a17..31c6d10 100644 > --- a/fs/block_dev.c > +++ b/fs/block_dev.c > @@ -1201,7 +1201,11 @@ static int __blkdev_get(struct block_device *bdev, fmode_t mode, int for_part) > bdev->bd_disk = disk; > bdev->bd_queue = disk->queue; > bdev->bd_contains = bdev; > - bdev->bd_inode->i_flags = disk->fops->direct_access ? S_DAX : 0; > + if (IS_ENABLED(CONFIG_BLK_DEV_DAX) && disk->fops->direct_access) > + bdev->bd_inode->i_flags = S_DAX; > + else > + bdev->bd_inode->i_flags = 0; > + > if (!partno) { > ret = -ENXIO; > bdev->bd_part = disk_get_part(disk, partno); > -- > 2.5.0 > -- Jan Kara SUSE Labs, CR From david@fromorbit.com Wed Feb 17 16:04:51 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=ham version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay3.corp.sgi.com [198.149.34.15]) by oss.sgi.com (Postfix) with ESMTP id EB5C97CB6 for ; Wed, 17 Feb 2016 16:04:50 -0600 (CST) Received: from cuda.sgi.com (cuda3.sgi.com [192.48.176.15]) by relay3.corp.sgi.com (Postfix) with ESMTP id 7DAC5AC007 for ; Wed, 17 Feb 2016 14:04:44 -0800 (PST) X-ASG-Debug-ID: 1455746678-04cb6c1e5617e300001-NocioJ Received: from ipmail06.adl6.internode.on.net (ipmail06.adl6.internode.on.net [150.101.137.145]) by cuda.sgi.com with ESMTP id ubCLo5KOAyE7b1fH for ; Wed, 17 Feb 2016 14:04:38 -0800 (PST) X-Barracuda-Envelope-From: david@fromorbit.com X-Barracuda-Apparent-Source-IP: 150.101.137.145 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: A2DZBwCx7cRWXJbY03ZegzqBP6YrAQUGi3KFSIQIhgcCAgEBAoFMTQEBAQEBAQdEQYRCAQEEJxMcIxAIAw4KCSUPBSUDBxoTiBm7dwEBCAIBHRiFMoUDhBoJhEwFlwSNUI58RI4DgmQZgVwoLocIgTgBAQE Received: from ppp118-211-216-150.lns20.syd4.internode.on.net (HELO dastard) ([118.211.216.150]) by ipmail06.adl6.internode.on.net with ESMTP; 18 Feb 2016 08:34:37 +1030 Received: from dave by dastard with local (Exim 4.80) (envelope-from ) id 1aWAD6-0006oH-MD; Thu, 18 Feb 2016 09:04:36 +1100 Date: Thu, 18 Feb 2016 09:04:36 +1100 From: Dave Chinner To: Brian Foster Cc: Christoph Hellwig , xfs@oss.sgi.com Subject: Re: [PATCH 2/3] xfs: better xfs_trans_alloc interface Message-ID: <20160217220436.GI19486@dastard> X-ASG-Orig-Subj: Re: [PATCH 2/3] xfs: better xfs_trans_alloc interface References: <1455699159-20906-1-git-send-email-hch@lst.de> <1455699159-20906-2-git-send-email-hch@lst.de> <20160217134006.GA4065@bfoster.bfoster> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20160217134006.GA4065@bfoster.bfoster> User-Agent: Mutt/1.5.21 (2010-09-15) X-Barracuda-Connect: ipmail06.adl6.internode.on.net[150.101.137.145] X-Barracuda-Start-Time: 1455746678 X-Barracuda-URL: https://192.48.176.15:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-BRTS-Status: 1 X-Barracuda-Spam-Score: 0.00 X-Barracuda-Spam-Status: No, SCORE=0.00 using per-user scores of TAG_LEVEL=1000.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.7 tests=BSF_SC0_MISMATCH_TO X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.3.27114 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 0.00 BSF_SC0_MISMATCH_TO Envelope rcpt doesn't match header On Wed, Feb 17, 2016 at 08:40:08AM -0500, Brian Foster wrote: > On Wed, Feb 17, 2016 at 09:52:38AM +0100, Christoph Hellwig wrote: > > Merge xfs_trans_reserve and xfs_trans_alloc into a single function call > > that returns a transaction with all the required log and block reservations, > > and which allows passing transaction flags directly to avoid the cumbersome > > _xfs_trans_alloc interface. > > > > While we're at it we also get rid of the transaction type argument that has > > been superflous since we stopped supporting the non-CIL logging mode. The > > guts of it will be removed in another patch. > > > > Signed-off-by: Christoph Hellwig > > --- > > > @@ -165,7 +123,7 @@ xfs_trans_dup( > > * This does not do quota reservations. That typically is done by the > > * caller afterwards. > > */ > > -int > > +static int > > xfs_trans_reserve( > > struct xfs_trans *tp, > > struct xfs_trans_res *resp, > > @@ -219,7 +177,7 @@ xfs_trans_reserve( > > resp->tr_logres, > > resp->tr_logcount, > > &tp->t_ticket, XFS_TRANSACTION, > > - permanent, tp->t_type); > > + permanent, 0); > > So this looks like it effectively breaks xlog_print_tic_res()..? I see > that is all removed in the subsequent patch, but the type still seems > like useful information in the event that an associated problem occurs > with the transaction. In fact, we just had a transaction overrun report > over the weekend (on irc) where at least I thought this was useful > (unfortunately it looks like I lost the reference to the syslog output). I've considered doing this removal myself in the past - doing somethign like embedding the return address of the xfs-trans_reserve() call in the ticket that is allocated tells us exactly where the call was made. This can be printed with %pS, and that gives us the function (and location in the function) the reservation was made. Hence we solve the problem of not knowing which call path triggered the problem. Hence I don't think we actually need to the type in every function call. Cheers, Dave. -- Dave Chinner david@fromorbit.com From jack@suse.cz Wed Feb 17 16:10:13 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=ham version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay3.corp.sgi.com [198.149.34.15]) by oss.sgi.com (Postfix) with ESMTP id 8D61F7CB6 for ; Wed, 17 Feb 2016 16:10:13 -0600 (CST) Received: from cuda.sgi.com (cuda1.sgi.com [192.48.157.11]) by relay3.corp.sgi.com (Postfix) with ESMTP id 162A6AC009 for ; Wed, 17 Feb 2016 14:10:13 -0800 (PST) X-ASG-Debug-ID: 1455747008-04bdf02d5b9df60001-NocioJ Received: from mx2.suse.de (mx2.suse.de [195.135.220.15]) by cuda.sgi.com with ESMTP id SXdQWAXug7g6bSGo (version=TLSv1 cipher=ECDHE-RSA-AES256-SHA bits=256 verify=NO) for ; Wed, 17 Feb 2016 14:10:09 -0800 (PST) X-Barracuda-Envelope-From: jack@suse.cz X-Barracuda-Apparent-Source-IP: 195.135.220.15 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 E9668ACAD; Wed, 17 Feb 2016 22:10:07 +0000 (UTC) Received: by quack.suse.cz (Postfix, from userid 1000) id C030B8169A; Wed, 17 Feb 2016 23:10:29 +0100 (CET) Date: Wed, 17 Feb 2016 23:10:29 +0100 From: Jan Kara To: Ross Zwisler Cc: Jan Kara , linux-kernel@vger.kernel.org, "J. Bruce Fields" , Theodore Ts'o , Alexander Viro , Andreas Dilger , Andrew Morton , Dan Williams , Dave Chinner , Jan Kara , Jeff Layton , Jens Axboe , Matthew Wilcox , linux-block@vger.kernel.org, linux-ext4@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux-mm@kvack.org, linux-nvdimm@lists.01.org, xfs@oss.sgi.com Subject: Re: [PATCH v3 3/6] ext4: Online defrag not supported with DAX Message-ID: <20160217221029.GM14140@quack.suse.cz> X-ASG-Orig-Subj: Re: [PATCH v3 3/6] ext4: Online defrag not supported with DAX References: <1455680059-20126-1-git-send-email-ross.zwisler@linux.intel.com> <1455680059-20126-4-git-send-email-ross.zwisler@linux.intel.com> <20160217215037.GB30126@linux.intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20160217215037.GB30126@linux.intel.com> User-Agent: Mutt/1.5.24 (2015-08-30) X-Barracuda-Connect: mx2.suse.de[195.135.220.15] X-Barracuda-Start-Time: 1455747009 X-Barracuda-Encrypted: ECDHE-RSA-AES256-SHA X-Barracuda-URL: https://192.48.157.11:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-BRTS-Status: 1 X-Barracuda-Spam-Score: 0.00 X-Barracuda-Spam-Status: No, SCORE=0.00 using per-user scores of TAG_LEVEL=1000.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.7 tests=BSF_SC0_MISMATCH_TO X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.3.27114 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 0.00 BSF_SC0_MISMATCH_TO Envelope rcpt doesn't match header On Wed 17-02-16 14:50:37, Ross Zwisler wrote: > On Tue, Feb 16, 2016 at 08:34:16PM -0700, Ross Zwisler wrote: > > Online defrag operations for ext4 are hard coded to use the page cache. > > See ext4_ioctl() -> ext4_move_extents() -> move_extent_per_page() > > > > When combined with DAX I/O, which circumvents the page cache, this can > > result in data corruption. This was observed with xfstests ext4/307 and > > ext4/308. > > > > Fix this by only allowing online defrag for non-DAX files. > > Jan, > > Thinking about this a bit more, it's probably the case that the data > corruption I was observing was due to us skipping the writeback of the dirty > page cache pages because S_DAX was set. > > I do think we have a problem with defrag because it is doing the extent > swapping using the page cache, and we won't flush the dirty pages due to > S_DAX being set. > > This patch is the quick and easy answer, and is perhaps appropriate for v4.5. > > Looking forward, though, what do you think the correct solution is? Making an > extent swapper that doesn't use the page cache (as I believe XFS has? see > xfs_swap_extents()), or maybe just unsetting S_DAX while we do the defrag and > being careful to block out page faults and I/O? Or is it acceptable to just > say that DAX and defrag are mutually exclusive for ext4? For 4.5 I'd just say just make them exclusive. Long term, we could just avoid using page cache for copying data - grab all the necessary locks, wait for all DIO to complete, evict anything in pagecache, copy data, swap extents. It could even result in a simpler code. Honza > > Signed-off-by: Ross Zwisler > > --- > > fs/ext4/ioctl.c | 5 +++++ > > 1 file changed, 5 insertions(+) > > > > diff --git a/fs/ext4/ioctl.c b/fs/ext4/ioctl.c > > index 0f6c369..e32c86f 100644 > > --- a/fs/ext4/ioctl.c > > +++ b/fs/ext4/ioctl.c > > @@ -583,6 +583,11 @@ group_extend_out: > > "Online defrag not supported with bigalloc"); > > err = -EOPNOTSUPP; > > goto mext_out; > > + } else if (IS_DAX(inode)) { > > + ext4_msg(sb, KERN_ERR, > > + "Online defrag not supported with DAX"); > > + err = -EOPNOTSUPP; > > + goto mext_out; > > } > > > > err = mnt_want_write_file(filp); > > -- > > 2.5.0 > > -- Jan Kara SUSE Labs, CR From dan.j.williams@intel.com Wed Feb 17 16:18:19 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=T_DKIM_INVALID autolearn=ham version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay2.corp.sgi.com [137.38.102.29]) by oss.sgi.com (Postfix) with ESMTP id 887D57CB6 for ; Wed, 17 Feb 2016 16:18:19 -0600 (CST) Received: from cuda.sgi.com (cuda1.sgi.com [192.48.157.11]) by relay2.corp.sgi.com (Postfix) with ESMTP id 5CC70304032 for ; Wed, 17 Feb 2016 14:18:16 -0800 (PST) X-ASG-Debug-ID: 1455747493-04bdf02d5d9e590001-NocioJ Received: from mail-yk0-f173.google.com (mail-yk0-f173.google.com [209.85.160.173]) by cuda.sgi.com with ESMTP id TNu5gSeISkOhQ5uz (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128 verify=NO) for ; Wed, 17 Feb 2016 14:18:14 -0800 (PST) X-Barracuda-Envelope-From: dan.j.williams@intel.com X-Barracuda-Apparent-Source-IP: 209.85.160.173 Received: by mail-yk0-f173.google.com with SMTP id z7so13189864yka.3 for ; Wed, 17 Feb 2016 14:18:14 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=intel-com.20150623.gappssmtp.com; s=20150623; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=C+0uSI3cB9KmmmSg1+NAceAELfr1b7ISWHbGssuO+ZQ=; b=E859VOzcTOTsIB6IHVMMkyHoTcIwTVCDQ+3b5RWFVqINIVUqGVg1Vp/IucETOJhS1O kGgZas1Xn3JbcCaNVxD9WOZ46sNUT7WamIMLgsA1mR1of4FwImvqvPoUjKCD+Zz4Yz30 TzEdOVi1PJ/KlJu/o3iyUY+uea0WeLV5fgrZew6Oyuw5M5JZ2v9PSX0p3UcJEAkJ2Lo2 0MfBBgxY/nLlR6ZrccdNtEvW1uXe7fiuhAmjldY3tvpG40PbP3jdhYwPDvfZRY3nWLQW EFX0M8cRMa6/Cq4I2Q2Q67zLvYcZW9MMw+xhph1eQ6587r4qD3TH6dCsS04yTWJR1s6O wglg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:date :message-id:subject:from:to:cc:content-type; bh=C+0uSI3cB9KmmmSg1+NAceAELfr1b7ISWHbGssuO+ZQ=; b=Y7jY2pZyV7YdjoAfirskmiplt7G/KIvSYv4pX77V8ECuAVgVYciUvu9k6DtiwKwwlK OD9FyYEYIlIKbVMiGlph/HqYAcD0IEP0/yG5v+zRI3hF/v+obayR3W9TjCjQXJpND1i6 R+IUdI1N5Qkh8fl8yHg8K0do13c1JjgC/b2MKccmgiA63ABjlYJwUFgaPpdwHv/knEs8 0biegorC7IdX6GphZJcBP3WPuyC43zcjtPVdOztiAxCwwVa2Tw2de8R08bCdvYfpPYoB eerldKutatnJJfIh0CFjbz4VI+8jO/3dsYdUyRCrvTVWEZlFWvOZUStq0i0Fo9CT1HFQ vx+A== X-Gm-Message-State: AG10YOSj4ohreLBjvdy8ufVKEO+i2vxpwDg0uN7Kb5va5It4vypoxa74JGoGRWNvgqaAsXAh7FbvrIuBFq7qfqKF MIME-Version: 1.0 X-Received: by 10.37.25.212 with SMTP id 203mr2364463ybz.163.1455747493216; Wed, 17 Feb 2016 14:18:13 -0800 (PST) Received: by 10.37.223.199 with HTTP; Wed, 17 Feb 2016 14:18:13 -0800 (PST) In-Reply-To: <20160217215420.GK14140@quack.suse.cz> References: <1455680059-20126-1-git-send-email-ross.zwisler@linux.intel.com> <1455680059-20126-7-git-send-email-ross.zwisler@linux.intel.com> <20160217215420.GK14140@quack.suse.cz> Date: Wed, 17 Feb 2016 14:18:13 -0800 Message-ID: Subject: Re: [PATCH v3 6/6] block: use dax_do_io() if blkdev_dax_capable() From: Dan Williams X-ASG-Orig-Subj: Re: [PATCH v3 6/6] block: use dax_do_io() if blkdev_dax_capable() To: Jan Kara Cc: Ross Zwisler , "linux-kernel@vger.kernel.org" , "J. Bruce Fields" , "Theodore Ts'o" , Alexander Viro , Andreas Dilger , Andrew Morton , Dave Chinner , Jan Kara , Jeff Layton , Jens Axboe , Matthew Wilcox , linux-block@vger.kernel.org, linux-ext4 , linux-fsdevel , Linux MM , "linux-nvdimm@lists.01.org" , XFS Developers , Jens Axboe , Al Viro , Matthew Wilcox Content-Type: text/plain; charset=UTF-8 X-Barracuda-Connect: mail-yk0-f173.google.com[209.85.160.173] X-Barracuda-Start-Time: 1455747493 X-Barracuda-Encrypted: ECDHE-RSA-AES128-GCM-SHA256 X-Barracuda-URL: https://192.48.157.11:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-BRTS-Status: 1 X-Barracuda-Spam-Score: 0.00 X-Barracuda-Spam-Status: No, SCORE=0.00 using per-user scores of TAG_LEVEL=1000.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.7 tests=BSF_SC0_MISMATCH_TO, DKIM_SIGNED, DKIM_VERIFIED X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.3.27114 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 0.00 BSF_SC0_MISMATCH_TO Envelope rcpt doesn't match header -0.00 DKIM_VERIFIED Domain Keys Identified Mail: signature passes verification 0.00 DKIM_SIGNED Domain Keys Identified Mail: message has a signature On Wed, Feb 17, 2016 at 1:54 PM, Jan Kara wrote: > On Tue 16-02-16 20:34:19, Ross Zwisler wrote: >> From: Dan Williams >> >> Setting S_DAX on an inode requires that the inode participate in the >> DAX-fsync mechanism which expects to use the pagecache for tracking >> potentially dirty cpu cachelines. However, dax_do_io() participates in >> the standard pagecache sync semantics and arranges for dirty pages to be >> flushed through the driver when a direct-IO operation accesses the same >> ranges. >> >> It should always be valid to use the dax_do_io() path regardless of >> whether the block_device inode has S_DAX set. In either case dirty >> pages or dirty cachelines are made durable before the direct-IO >> operation proceeds. > > Please no. I agree that going via DAX path for normal likely won't > introduce new data corruption issues. But I dislike having a special > case for block devices. Also you have no way of turning DAX off for block > devices AFAIU and as Dave said, DAX should be opt-in, not opt-out. Note > that you may actually want to go through the block layer for normal IO e.g. > because you use IO cgroups to limit processes so using DAX regresses some > functionality. > Sounds good. As Ross mentioned in the cover letter, I'm fine with dropping this one for now as we think through how to restore raw device DAX support. In the meantime we can still force CONFIG_BLK_DEV_DAX=y for testing. From tonykoon777@gmail.com Wed Feb 17 16:36:29 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: * X-Spam-Status: No, score=1.5 required=5.0 tests=FREEMAIL_ENVFROM_END_DIGIT, FREEMAIL_FROM,FREEMAIL_REPLYTO,FREEMAIL_REPLYTO_END_DIGIT,T_DKIM_INVALID autolearn=no version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay3.corp.sgi.com [198.149.34.15]) by oss.sgi.com (Postfix) with ESMTP id 49AA67CB7 for ; Wed, 17 Feb 2016 16:36:29 -0600 (CST) Received: from cuda.sgi.com (cuda2.sgi.com [192.48.176.25]) by relay3.corp.sgi.com (Postfix) with ESMTP id DDAA4AC007 for ; Wed, 17 Feb 2016 14:36:28 -0800 (PST) X-ASG-Debug-ID: 1455748583-04cbb0418900380001-NocioJ Received: from mail-ob0-f193.google.com (mail-ob0-f193.google.com [209.85.214.193]) by cuda.sgi.com with ESMTP id A9XJ3lkazk2AyWbL (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128 verify=NO) for ; Wed, 17 Feb 2016 14:36:23 -0800 (PST) X-Barracuda-Envelope-From: tonykoon777@gmail.com X-Barracuda-RBL-Trusted-Forwarder: 209.85.214.193 Received: by mail-ob0-f193.google.com with SMTP id wz1so1950630obc.1 for ; Wed, 17 Feb 2016 14:36:23 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:reply-to:date:message-id:subject:from:to:content-type; bh=47DEQpj8HBSa+/TImW+5JCeuQeRkm5NMpJWZG3hSuFU=; b=hhoILnl3QNWkquZzUFgrFHJjSc5FqcplYU2axCoFf1XxygrKUrQPCh0W6TmHFn7LcC FwJ9sa3BSr3fCQIAMensnja/XyVsJqRjW3Ja4X3sQOqOMOWoAOqnVTmYIB0xRSDqLKkC fF0xu8EeCB2soryB5vznoNhiU8td2zBKTid0JPSjdNGynSH1ZuIzvCVBaePhtuPOZ6cG 8QXIIN0wlpIRZyAgxQVVAQ8SBUber8NdXLIwbKSkrVeOcZSuAQT7RmEo/Of83BEHvZgD dABx4IM3AazEJnDTHi2gY/fsxOXnCS3rTXn5yI0L7k+k0KnfdOPSulMMOV+e5glTLfoH sXXg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:reply-to:date:message-id:subject :from:to:content-type; bh=47DEQpj8HBSa+/TImW+5JCeuQeRkm5NMpJWZG3hSuFU=; b=doNlhemXzxlr4pVXSETzXV6KpAlClyIQUdHGpIf4FmNzFPjoyfFZKigVCa3l3ZvvrC Du2uQ4wtcwGrcBA2DkwwwHEKEdWuuCT2IH6KW8ftnUIgNoCGBrMw+aPBP7I36AEXRds0 9F2A0CXnjlFOVVqrjAk2iLg2BRW5LMGoP98BT+zWrbyGYd0baggndoEJ5X9msc0LOlHj kRmzlXwu7L/6LxrlWDNwk5p6fLt+eXayloQqtipP7NWRl+P6qT5iSVacHN70EWJObYo5 3lOfGP3qIkQ/hFVMCltPN1WuukVD20Jewd6nizIwFllkhYCjrTy68XJwgRsYCw+CwIjY Mqgg== X-Gm-Message-State: AG10YORbJhN0ubvBkNlHEW9zZ1loFEgRpecgf/NZQ+KsqXec4NMoDV00qXYHwggv/AsgRPQVDqXwbgss651EUw== MIME-Version: 1.0 X-Received: by 10.202.187.11 with SMTP id l11mr3248386oif.55.1455748583273; Wed, 17 Feb 2016 14:36:23 -0800 (PST) Received: by 10.76.3.102 with HTTP; Wed, 17 Feb 2016 14:36:23 -0800 (PST) Reply-To: tony.koon01@yahoo.fr Date: Thu, 18 Feb 2016 07:36:23 +0900 Message-ID: Subject: i have a benuiness with you response so that we will starts immediately. Thanks, From: Mr Tony koon X-ASG-Orig-Subj: i have a benuiness with you response so that we will starts immediately. Thanks, To: undisclosed-recipients:; Content-Type: text/plain; charset=UTF-8 X-Barracuda-Connect: mail-ob0-f193.google.com[209.85.214.193] X-Barracuda-Start-Time: 1455748583 X-Barracuda-Encrypted: ECDHE-RSA-AES128-GCM-SHA256 X-Barracuda-URL: https://192.48.176.25:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-Spam-Score: 2.00 X-Barracuda-Spam-Status: No, SCORE=2.00 using per-user scores of TAG_LEVEL=1000.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.7 tests=BSF_SC0_MISMATCH_TO, BSF_SC0_SA643_EMP_2, DKIM_SIGNED, DKIM_VERIFIED X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.3.27114 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 0.00 BSF_SC0_MISMATCH_TO Envelope rcpt doesn't match header -0.00 DKIM_VERIFIED Domain Keys Identified Mail: signature passes verification 0.00 DKIM_SIGNED Domain Keys Identified Mail: message has a signature 2.00 BSF_SC0_SA643_EMP_2 Custom Rule SA643_EMP_2 From ross.zwisler@linux.intel.com Wed Feb 17 16:53:41 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=ham version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay1.corp.sgi.com [137.38.102.111]) by oss.sgi.com (Postfix) with ESMTP id 61F267CB7 for ; Wed, 17 Feb 2016 16:53:41 -0600 (CST) Received: from cuda.sgi.com (cuda1.sgi.com [192.48.157.11]) by relay1.corp.sgi.com (Postfix) with ESMTP id 244D38F804B for ; Wed, 17 Feb 2016 14:53:41 -0800 (PST) X-ASG-Debug-ID: 1455749619-04bdf003c200e20001-NocioJ Received: from mga11.intel.com ([192.55.52.93]) by cuda.sgi.com with ESMTP id K8mmra4uKt4Cwlzo for ; Wed, 17 Feb 2016 14:53:39 -0800 (PST) X-Barracuda-Envelope-From: ross.zwisler@linux.intel.com X-Barracuda-Apparent-Source-IP: 192.55.52.93 X-ASG-Whitelist: Client Received: from orsmga001.jf.intel.com ([10.7.209.18]) by fmsmga102.fm.intel.com with ESMTP; 17 Feb 2016 14:53:40 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.22,463,1449561600"; d="scan'208";a="888162204" Received: from rzwisler-desk.amr.corp.intel.com (HELO linux.intel.com) ([10.254.20.43]) by orsmga001.jf.intel.com with ESMTP; 17 Feb 2016 14:53:34 -0800 Date: Wed, 17 Feb 2016 15:53:23 -0700 From: Ross Zwisler To: Dave Chinner Cc: xfs@oss.sgi.com, ross.zwisler@linux.intel.com, jack@suse.cz Subject: Re: [PATCH 3/3] xfs_io: add support for changing the new inode DAX attribute Message-ID: <20160217225323.GC30126@linux.intel.com> X-ASG-Orig-Subj: Re: [PATCH 3/3] xfs_io: add support for changing the new inode DAX attribute References: <1455514346-15481-1-git-send-email-david@fromorbit.com> <1455514346-15481-4-git-send-email-david@fromorbit.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1455514346-15481-4-git-send-email-david@fromorbit.com> User-Agent: Mutt/1.5.24 (2015-08-30) X-Barracuda-Connect: UNKNOWN[192.55.52.93] X-Barracuda-Start-Time: 1455749619 X-Barracuda-URL: https://192.48.157.11:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-BRTS-Status: 1 On Mon, Feb 15, 2016 at 04:32:26PM +1100, Dave Chinner wrote: > From: Dave Chinner > > It is changed via the FS_IOC_FSSETXATTR ioctl, so add the new flag > to the platform definitions for userspace that don't this API. Then > add support to the relevant xfs_io chattr and stat commands. > > Signed-off-by: Dave Chinner Works for me. Tested-by: Ross Zwisler > --- > include/darwin.h | 1 + > include/freebsd.h | 1 + > include/irix.h | 1 + > include/linux.h | 1 + > io/attr.c | 5 ++++- > 5 files changed, 8 insertions(+), 1 deletion(-) > > diff --git a/include/darwin.h b/include/darwin.h > index 2baa536..a52030d 100644 > --- a/include/darwin.h > +++ b/include/darwin.h > @@ -312,6 +312,7 @@ struct fsxattr { > #define FS_XFLAG_EXTSZINHERIT 0x00001000 /* inherit inode extent size */ > #define FS_XFLAG_NODEFRAG 0x00002000 /* do not defragment */ > #define FS_XFLAG_FILESTREAM 0x00004000 /* use filestream allocator */ > +#define FS_XFLAG_DAX 0x00008000 /* use DAX for IO */ > #define FS_XFLAG_HASATTR 0x80000000 /* no DIFLAG for this */ > > #define FS_IOC_FSGETXATTR _IOR ('X', 31, struct fsxattr) > diff --git a/include/freebsd.h b/include/freebsd.h > index fe567d4..f7e0c75 100644 > --- a/include/freebsd.h > +++ b/include/freebsd.h > @@ -202,6 +202,7 @@ struct fsxattr { > #define FS_XFLAG_EXTSZINHERIT 0x00001000 /* inherit inode extent size */ > #define FS_XFLAG_NODEFRAG 0x00002000 /* do not defragment */ > #define FS_XFLAG_FILESTREAM 0x00004000 /* use filestream allocator */ > +#define FS_XFLAG_DAX 0x00008000 /* use DAX for IO */ > #define FS_XFLAG_HASATTR 0x80000000 /* no DIFLAG for this */ > > #define FS_IOC_FSGETXATTR _IOR ('X', 31, struct fsxattr) > diff --git a/include/irix.h b/include/irix.h > index bdb4b6a..c2191ee 100644 > --- a/include/irix.h > +++ b/include/irix.h > @@ -447,6 +447,7 @@ struct fsxattr { > #define FS_XFLAG_EXTSZINHERIT 0x00001000 /* inherit inode extent size */ > #define FS_XFLAG_NODEFRAG 0x00002000 /* do not defragment */ > #define FS_XFLAG_FILESTREAM 0x00004000 /* use filestream allocator */ > +#define FS_XFLAG_DAX 0x00008000 /* use DAX for IO */ > #define FS_XFLAG_HASATTR 0x80000000 /* no DIFLAG for this */ > > #define FS_IOC_FSGETXATTR F_FSGETXATTR > diff --git a/include/linux.h b/include/linux.h > index 17391c3..cc0f70c 100644 > --- a/include/linux.h > +++ b/include/linux.h > @@ -205,6 +205,7 @@ struct fsxattr { > #define FS_XFLAG_EXTSZINHERIT 0x00001000 /* inherit inode extent size */ > #define FS_XFLAG_NODEFRAG 0x00002000 /* do not defragment */ > #define FS_XFLAG_FILESTREAM 0x00004000 /* use filestream allocator */ > +#define FS_XFLAG_DAX 0x00008000 /* use DAX for IO */ > #define FS_XFLAG_HASATTR 0x80000000 /* no DIFLAG for this */ > > #define FS_IOC_FSGETXATTR _IOR ('X', 31, struct fsxattr) > diff --git a/io/attr.c b/io/attr.c > index 6fa08bf..0186b1d 100644 > --- a/io/attr.c > +++ b/io/attr.c > @@ -47,9 +47,10 @@ static struct xflags { > { FS_XFLAG_EXTSZINHERIT, "E", "extsz-inherit" }, > { FS_XFLAG_NODEFRAG, "f", "no-defrag" }, > { FS_XFLAG_FILESTREAM, "S", "filestream" }, > + { FS_XFLAG_DAX, "x", "dax" }, > { 0, NULL, NULL } > }; > -#define CHATTR_XFLAG_LIST "r"/*p*/"iasAdtPneEfS" > +#define CHATTR_XFLAG_LIST "r"/*p*/"iasAdtPneEfSx" > > static void > lsattr_help(void) > @@ -73,6 +74,7 @@ lsattr_help(void) > " E -- children created in this directory inherit the extent size value\n" > " f -- do not include this file when defragmenting the filesystem\n" > " S -- enable filestreams allocator for this directory\n" > +" x -- Use direct access (DAX) for data in this file\n" > "\n" > " Options:\n" > " -R -- recursively descend (useful when current file is a directory)\n" > @@ -108,6 +110,7 @@ chattr_help(void) > " +/-E -- set/clear the extent-size inheritance flag\n" > " +/-f -- set/clear the no-defrag flag\n" > " +/-S -- set/clear the filestreams allocator flag\n" > +" +/-x -- set/clear the direct access (DAX) flag\n" > " Note1: user must have certain capabilities to modify immutable/append-only.\n" > " Note2: immutable/append-only files cannot be deleted; removing these files\n" > " requires the immutable/append-only flag to be cleared first.\n" > -- > 2.5.0 > From ross.zwisler@linux.intel.com Wed Feb 17 16:56:58 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=ham version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay1.corp.sgi.com [137.38.102.111]) by oss.sgi.com (Postfix) with ESMTP id 483FE7CA6 for ; Wed, 17 Feb 2016 16:56:58 -0600 (CST) Received: from cuda.sgi.com (cuda3.sgi.com [192.48.176.15]) by relay1.corp.sgi.com (Postfix) with ESMTP id 36C588F8049 for ; Wed, 17 Feb 2016 14:56:58 -0800 (PST) X-ASG-Debug-ID: 1455749817-04cb6c7705012d0001-NocioJ Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) by cuda.sgi.com with ESMTP id eGUG2w7wPiMGUy0H for ; Wed, 17 Feb 2016 14:56:57 -0800 (PST) X-Barracuda-Envelope-From: ross.zwisler@linux.intel.com X-Barracuda-Apparent-Source-IP: 134.134.136.24 X-ASG-Whitelist: Client Received: from orsmga002.jf.intel.com ([10.7.209.21]) by orsmga102.jf.intel.com with ESMTP; 17 Feb 2016 14:56:59 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.22,463,1449561600"; d="scan'208";a="915336200" Received: from rzwisler-desk.amr.corp.intel.com (HELO linux.intel.com) ([10.254.20.43]) by orsmga002.jf.intel.com with ESMTP; 17 Feb 2016 14:56:56 -0800 Date: Wed, 17 Feb 2016 15:56:45 -0700 From: Ross Zwisler To: Dave Chinner Cc: xfs@oss.sgi.com, ross.zwisler@linux.intel.com, jack@suse.cz Subject: Re: [PATCH 0/4] xfs: fixes for XFS_DIFLAG2_DAX support Message-ID: <20160217225645.GD30126@linux.intel.com> X-ASG-Orig-Subj: Re: [PATCH 0/4] xfs: fixes for XFS_DIFLAG2_DAX support References: <1455513734-15192-1-git-send-email-david@fromorbit.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1455513734-15192-1-git-send-email-david@fromorbit.com> User-Agent: Mutt/1.5.24 (2015-08-30) X-Barracuda-Connect: mga09.intel.com[134.134.136.24] X-Barracuda-Start-Time: 1455749817 X-Barracuda-URL: https://192.48.176.15:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-BRTS-Status: 1 On Mon, Feb 15, 2016 at 04:22:10PM +1100, Dave Chinner wrote: > Hi folks, > > This is a series to add the correct constraints to using the on-disk > inode flag to enable DAX on per-file basis. The same constraints are > placed on setting the flag on directories for inheritance purposes. > > These constraints are: > - the inode flag is limited to regular files or directory > inodes. > - the S_DAX flag is only ever set on regular files > - the flag can only ever be set on filesystems which have > blocksize == PAGE_SIZE (for now) > - When the flag is set or cleared, the current mapping > contents are flushed and then invalidated so that the new > access mode starts with an empty mapping. > - Setting or clearing the flag is atomic w.r.t. IO and > page faults. > > I've tested these manually with xfs_io (patchset for supporting > chattr +x/-x to be sent soon), and it all appears to work as > expected. I'd like to push these for 4.5-rc6 so the initial kernel > with support for this flag doesn't do silly things, so comments, > testing and review woul dbe appreciated. > > Cheers, > > Dave. This seems like what we want to be doing for raw block devices, when we add back in support. Default to DAX off so we have to opt-in, and when we get an IOCTL to enable them block I/O and page faults, clear out all mappings and radix tree entries, and then change the flag and turn back on I/O and page faults. We'll also need to add a check to prevent mounts on raw block devices with S_DAX set. From david@fromorbit.com Wed Feb 17 18:12:31 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=ham version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay2.corp.sgi.com [137.38.102.29]) by oss.sgi.com (Postfix) with ESMTP id 320AE7CBE for ; Wed, 17 Feb 2016 18:12:31 -0600 (CST) Received: from cuda.sgi.com (cuda1.sgi.com [192.48.157.11]) by relay2.corp.sgi.com (Postfix) with ESMTP id 07F20304032 for ; Wed, 17 Feb 2016 16:12:27 -0800 (PST) X-ASG-Debug-ID: 1455754345-04bdf003c504270001-NocioJ Received: from ipmail06.adl6.internode.on.net (ipmail06.adl6.internode.on.net [150.101.137.145]) by cuda.sgi.com with ESMTP id OdZfNRZD7WzAOkEx for ; Wed, 17 Feb 2016 16:12:25 -0800 (PST) X-Barracuda-Envelope-From: david@fromorbit.com X-Barracuda-Apparent-Source-IP: 150.101.137.145 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: A2A/BwAzC8VWXJbY03ZeDoMsgT+CaaNEAQEBAQEBBotxhUiECIYHBAICgUxNAQEBAQEBB0RBhEIBAQQnExwzCAMYCSUPBSUDBxoBEhuHfrt4DB4YhTKFA4hvAQSXBI1QjnyOR4QKTyguiEABAQE Received: from ppp118-211-216-150.lns20.syd4.internode.on.net (HELO dastard) ([118.211.216.150]) by ipmail06.adl6.internode.on.net with ESMTP; 18 Feb 2016 10:42:24 +1030 Received: from dave by dastard with local (Exim 4.80) (envelope-from ) id 1aWCCl-00073g-4v; Thu, 18 Feb 2016 11:12:23 +1100 Date: Thu, 18 Feb 2016 11:12:23 +1100 From: Dave Chinner To: Ross Zwisler , Jan Kara , linux-kernel@vger.kernel.org, "J. Bruce Fields" , Theodore Ts'o , Alexander Viro , Andreas Dilger , Andrew Morton , Dan Williams , Jan Kara , Jeff Layton , Jens Axboe , Matthew Wilcox , linux-block@vger.kernel.org, linux-ext4@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux-mm@kvack.org, linux-nvdimm@lists.01.org, xfs@oss.sgi.com Subject: Re: [PATCH v3 3/6] ext4: Online defrag not supported with DAX Message-ID: <20160218001223.GJ19486@dastard> X-ASG-Orig-Subj: Re: [PATCH v3 3/6] ext4: Online defrag not supported with DAX References: <1455680059-20126-1-git-send-email-ross.zwisler@linux.intel.com> <1455680059-20126-4-git-send-email-ross.zwisler@linux.intel.com> <20160217215037.GB30126@linux.intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20160217215037.GB30126@linux.intel.com> User-Agent: Mutt/1.5.21 (2010-09-15) X-Barracuda-Connect: ipmail06.adl6.internode.on.net[150.101.137.145] X-Barracuda-Start-Time: 1455754345 X-Barracuda-URL: https://192.48.157.11:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-BRTS-Status: 1 X-Barracuda-Spam-Score: 1.00 X-Barracuda-Spam-Status: No, SCORE=1.00 using per-user scores of TAG_LEVEL=1000.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.7 tests=BSF_SC0_MISMATCH_TO, BSF_SC2_SA016_OB X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.3.27117 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 0.00 BSF_SC0_MISMATCH_TO Envelope rcpt doesn't match header 1.00 BSF_SC2_SA016_OB Custom Rule SA016_OB On Wed, Feb 17, 2016 at 02:50:37PM -0700, Ross Zwisler wrote: > On Tue, Feb 16, 2016 at 08:34:16PM -0700, Ross Zwisler wrote: > > Online defrag operations for ext4 are hard coded to use the page cache. > > See ext4_ioctl() -> ext4_move_extents() -> move_extent_per_page() > > > > When combined with DAX I/O, which circumvents the page cache, this can > > result in data corruption. This was observed with xfstests ext4/307 and > > ext4/308. > > > > Fix this by only allowing online defrag for non-DAX files. > > Jan, > > Thinking about this a bit more, it's probably the case that the data > corruption I was observing was due to us skipping the writeback of the dirty > page cache pages because S_DAX was set. > > I do think we have a problem with defrag because it is doing the extent > swapping using the page cache, and we won't flush the dirty pages due to > S_DAX being set. > > This patch is the quick and easy answer, and is perhaps appropriate for v4.5. > > Looking forward, though, what do you think the correct solution is? Making an > extent swapper that doesn't use the page cache (as I believe XFS has? see > xfs_swap_extents()), XFS does the data copy in userspace using direct IO so we don't care about whether DAX is enabled or not on either the source or destination inode. i.e. xfs_swap_extents() is a pure metadata operation, swapping the entire extent tree between two inodes if the source data has not changed while the copy was in progress. Cheers, Dave. -- Dave Chinner david@fromorbit.com From david@fromorbit.com Wed Feb 17 19:13:55 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=ham version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay1.corp.sgi.com [137.38.102.111]) by oss.sgi.com (Postfix) with ESMTP id A2FEC7F37 for ; Wed, 17 Feb 2016 19:13:55 -0600 (CST) Received: from cuda.sgi.com (cuda2.sgi.com [192.48.176.25]) by relay1.corp.sgi.com (Postfix) with ESMTP id 61D198F8039 for ; Wed, 17 Feb 2016 17:13:55 -0800 (PST) X-ASG-Debug-ID: 1455758028-04cbb0479e066e0001-NocioJ Received: from ipmail06.adl6.internode.on.net (ipmail06.adl6.internode.on.net [150.101.137.145]) by cuda.sgi.com with ESMTP id 457ePtDwsoedVwAO for ; Wed, 17 Feb 2016 17:13:49 -0800 (PST) X-Barracuda-Envelope-From: david@fromorbit.com X-Barracuda-Apparent-Source-IP: 150.101.137.145 Received: from ppp118-211-216-150.lns20.syd4.internode.on.net (HELO dastard) ([118.211.216.150]) by ipmail06.adl6.internode.on.net with ESMTP; 18 Feb 2016 11:43:16 +1030 Received: from dave by dastard with local (Exim 4.80) (envelope-from ) id 1aWD9f-0007C2-Ct for xfs@oss.sgi.com; Thu, 18 Feb 2016 12:13:15 +1100 Date: Thu, 18 Feb 2016 12:13:15 +1100 From: Dave Chinner To: xfs@oss.sgi.com Subject: [ANNOUNCE] xfsprogs: for-next branch updated to e37bf53 Message-ID: <20160218011315.GK19486@dastard> X-ASG-Orig-Subj: [ANNOUNCE] xfsprogs: for-next branch updated to e37bf53 MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="aT9PWwzfKXlsBJM1" Content-Disposition: inline User-Agent: Mutt/1.5.21 (2010-09-15) X-Barracuda-Connect: ipmail06.adl6.internode.on.net[150.101.137.145] X-Barracuda-Start-Time: 1455758028 X-Barracuda-URL: https://192.48.176.25:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-BRTS-Status: 1 X-Barracuda-Spam-Score: 0.00 X-Barracuda-Spam-Status: No, SCORE=0.00 using per-user scores of TAG_LEVEL=1000.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.7 tests= X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.3.27119 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- --aT9PWwzfKXlsBJM1 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Hi Folks, The for-next branch of the xfsprogs repository at: git://git.kernel.org/pub/scm/fs/xfs/xfsprogs-dev.git has just been updated. This start the next development cycle with a libxfs kernel sync from the for-next branch of the kernel tree. -Dave. The new head of the master branch is commit: e37bf53 xfs: mode di_mode to vfs inode New Commits: Christoph Hellwig (3): [410c3de] xfs: handle errors from ->free_blocks in xfs_btree_kill_iro= ot [c261f8c] xfs: factor btree block freeing into a helper [08caf14] xfs: move buffer invalidation to xfs_btree_free_block Dave Chinner (10): [f36349d] xfs: RT bitmap and summary buffers are not typed [a3d2294] xfs: RT bitmap and summary buffers need verifiers [138659f] xfs: introduce inode log format object [1bc6cbe] xfs: remove timestamps from incore inode [db17aeb] xfs: cull unnecessary icdinode fields [f089fc4] xfs: move v1 inode conversion to xfs_inode_from_disk [bcbe04c] xfs: use vfs inode nlink field everywhere [6652c25] xfs: move inode generation count to VFS inode [9abcc5c] xfs: move di_changecount to VFS inode [e37bf53] xfs: mode di_mode to vfs inode Eric Sandeen (2): [43633a3] xfs: wire up Q_XGETNEXTQUOTA / get_nextdqblk [499b47f] xfs: remove unused function definitions Code Diffstat: db/check.c | 114 ++++++++++++++++---------------- include/xfs_inode.h | 45 ++++++++++++- libxfs/libxfs_api_defs.h | 4 +- libxfs/rdwr.c | 4 +- libxfs/util.c | 60 ++++++----------- libxfs/xfs_alloc_btree.c | 2 - libxfs/xfs_bmap.c | 6 +- libxfs/xfs_bmap_btree.c | 1 - libxfs/xfs_btree.c | 32 ++++++--- libxfs/xfs_dir2.c | 12 ++-- libxfs/xfs_ialloc_btree.c | 12 +--- libxfs/xfs_inode_buf.c | 169 +++++++++++++++++++++++++++++++-----------= ------ libxfs/xfs_inode_buf.h | 38 ++++++++++- libxfs/xfs_inode_fork.c | 2 +- libxfs/xfs_log_format.h | 19 +++--- libxfs/xfs_quota_defs.h | 3 +- libxfs/xfs_rtbitmap.c | 32 ++++++++- libxfs/xfs_sb.h | 1 - libxfs/xfs_shared.h | 1 + logprint/log_misc.c | 7 +- logprint/log_print_all.c | 18 +++--- mkfs/proto.c | 12 ++-- repair/phase6.c | 58 ++++++----------- repair/phase7.c | 43 ++++-------- 24 files changed, 400 insertions(+), 295 deletions(-) --=20 Dave Chinner david@fromorbit.com --aT9PWwzfKXlsBJM1 Content-Type: application/pgp-signature; name="signature.asc" Content-Description: Digital signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iQIcBAEBAgAGBQJWxRqqAAoJEK3oKUf0dfod6JIP/03qM0OiGDkIevQ/d9qZYzuP U3P3SwMvd65/myULRh1WfP3tyKsLulP/t5gJqewxNkF9VbwKM2p9+9xUsZy+6J3P 0gUsFRznFkdXRBBNQmULk+EMwGJg3u/vrEKQq9RpPF2EbZVlRSZIKM4ftIiUnxbV i7/XnuVBLV2F/UC9wp++SiyjrnZ/G3Hc+6mNAOkBrLipOaXQLE8OpteeWm94PVLU dP14CYsPMOcNwxTgCRnDdeEDdg6v+HYFwtK0dO6zSztQIw7x0RsayaocTVsvwIzM huFgu3mRlgU23mBpmwGFVy0Kti6gQM4xQ51S9vxpVRMhf1Gu7nosi4V+VAVRS0U9 LsowL5Fv0d2pqtuuBFGccXl3kQVX+RH5KBC2KwYqNRsNXYG0bzXYcYjpBXaif+7R GKTQEoBAaGhFRMULyoSxNghjQQ3B8fJ9ICieFbXJ4H4kvFJTcxE23ClAXTUkRgLV RZFVlgVhvZWDsXBI2j1VSrQArudlncGgYQJWaR5wm4+Xg5cYxHSmDYsm0zZGxgua /mBwx4ZdKBx7zdJkQKDVJFUxKhZ6XVdohKk3akpFNbiSKALZ6rpDqh8udCAqkdh9 g2tMWP5EJWU0ChLkhVHG7gOHTrpK/x/7fLQKxv+94d6F5siKJBo8OMxbRRVtN4+X 3Xd5/RVimL0td7b4KG8r =+U+P -----END PGP SIGNATURE----- --aT9PWwzfKXlsBJM1-- From sandeen@sandeen.net Wed Feb 17 23:46:44 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=ham version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay2.corp.sgi.com [137.38.102.29]) by oss.sgi.com (Postfix) with ESMTP id B5A387CB1 for ; Wed, 17 Feb 2016 23:46:44 -0600 (CST) Received: from cuda.sgi.com (cuda2.sgi.com [192.48.176.25]) by relay2.corp.sgi.com (Postfix) with ESMTP id A6630304032 for ; Wed, 17 Feb 2016 21:46:41 -0800 (PST) X-ASG-Debug-ID: 1455774398-04cbb0479f10ff0001-NocioJ Received: from sandeen.net (sandeen.net [63.231.237.45]) by cuda.sgi.com with ESMTP id EgpCFWcdIqxFxjO7 for ; Wed, 17 Feb 2016 21:46:38 -0800 (PST) X-Barracuda-Envelope-From: sandeen@sandeen.net X-Barracuda-Apparent-Source-IP: 63.231.237.45 Received: from liberator.sandeen.net (liberator.sandeen.net [10.0.0.4]) (using TLSv1.2 with cipher DHE-RSA-AES128-SHA (128/128 bits)) (No client certificate requested) by sandeen.net (Postfix) with ESMTPSA id D0AE161F88D2 for ; Wed, 17 Feb 2016 23:46:37 -0600 (CST) Subject: Re: [PATCH] xfs: fix up inode32/64 (re)mount handling To: xfs@oss.sgi.com X-ASG-Orig-Subj: Re: [PATCH] xfs: fix up inode32/64 (re)mount handling References: <56C3FB75.6030104@redhat.com> <20160217183025.GB4065@bfoster.bfoster> From: Eric Sandeen Message-ID: <56C55ABE.4050100@sandeen.net> Date: Wed, 17 Feb 2016 23:46:38 -0600 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.11; rv:38.0) Gecko/20100101 Thunderbird/38.6.0 MIME-Version: 1.0 In-Reply-To: <20160217183025.GB4065@bfoster.bfoster> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit X-Barracuda-Connect: sandeen.net[63.231.237.45] X-Barracuda-Start-Time: 1455774398 X-Barracuda-URL: https://192.48.176.25:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-BRTS-Status: 1 X-Barracuda-Spam-Score: 0.00 X-Barracuda-Spam-Status: No, SCORE=0.00 using per-user scores of TAG_LEVEL=1000.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.7 tests= X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.3.27124 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- On 2/17/16 12:30 PM, Brian Foster wrote: > On Tue, Feb 16, 2016 at 10:47:49PM -0600, Eric Sandeen wrote: >> inode32/inode64 allocator behavior with respect to mount, >> remount and growfs is a little tricky. >> >> The inode32 mount option should only enable the inode32 >> allocator heuristics if the filesystem is large enough >> for 64-bit inodes to exist. Today, it has this behavior >> on the initial mount, but a remount with inode32 >> unconditionally changes the allocation heuristics, even >> for a small fs. >> >> Also, an inode32 mounted small filesystem should transition >> to the inode32 allocator if the filesystem is subsequently >> grown to a sufficient size. Today that does not happen. >> >> This patch consolidates xfs_set_inode32 and xfs_set_inode64 >> into a single new function, and moves the "is the maximum inode >> number big enough to matter" test into that function, so >> it doesn't rely on the caller to get it right - which >> remount did not do, previously. >> >> Signed-off-by: Eric Sandeen >> --- >> >> Note, this goes after my token-parsing patch for mount. ... >> @@ -607,54 +619,48 @@ xfs_set_inode32(struct xfs_mount *mp, xfs_agnumber_t agcount) >> max_metadata = agcount; >> } >> >> + /* Get the last possible inode in the filesystem */ >> agino = XFS_OFFBNO_TO_AGINO(mp, sbp->sb_agblocks - 1, 0); >> + ino = XFS_AGINO_TO_INO(mp, agcount - 1, agino); >> + >> + /* >> + * If user asked for no more than 32-bit inodes, and the fs is >> + * sufficiently large, set XFS_MOUNT_32BITINODES if we must alter >> + * the allocator to accommodate the request. >> + */ >> + if ((mp->m_flags & XFS_MOUNT_SMALL_INUMS) && ino > XFS_MAXINUMBER_32) >> + mp->m_flags |= XFS_MOUNT_32BITINODES; >> + else >> + mp->m_flags &= ~XFS_MOUNT_32BITINODES; > > In the current code, we call into xfs_set_inode64() if > XFS_MOUNT_SMALL_INUMS is not set or it is, but the largest inode is > within XFS_MAXINUMBER_32. In that latter case, xfs_set_inode64() does: > > mp->m_flags &= ~(XFS_MOUNT_32BITINODES | > XFS_MOUNT_SMALL_INUMS); > > ... which I think means we want to clear XFS_MOUNT_SMALL_INUMS along > with XFS_MOUNT_32BITINODES here, yes? The rest looks fine to me: I don't think so; that was a bug, AFAICT. XFS_MOUNT_32BITINODES means that inode32 was specified at mount time, i.e. the user wants no more than 32-bit inodes for the duration of this mount. So this is actually a bugfix for the 2nd item mentioned above: >> Also, an inode32 mounted small filesystem should transition >> to the inode32 allocator if the filesystem is subsequently >> grown to a sufficient size. Today that does not happen. > Reviewed-by: Brian Foster Thanks, -Eric From sandeen@sandeen.net Wed Feb 17 23:51:49 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=ham version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay2.corp.sgi.com [137.38.102.29]) by oss.sgi.com (Postfix) with ESMTP id 02B6B7CA8 for ; Wed, 17 Feb 2016 23:51:49 -0600 (CST) Received: from cuda.sgi.com (cuda3.sgi.com [192.48.176.15]) by relay2.corp.sgi.com (Postfix) with ESMTP id D80F2304039 for ; Wed, 17 Feb 2016 21:51:48 -0800 (PST) X-ASG-Debug-ID: 1455774706-04cb6c7708139a0001-NocioJ Received: from sandeen.net (sandeen.net [63.231.237.45]) by cuda.sgi.com with ESMTP id iGeRMdB5URoACTGg for ; Wed, 17 Feb 2016 21:51:46 -0800 (PST) X-Barracuda-Envelope-From: sandeen@sandeen.net X-Barracuda-Apparent-Source-IP: 63.231.237.45 Received: from liberator.sandeen.net (liberator.sandeen.net [10.0.0.4]) (using TLSv1.2 with cipher DHE-RSA-AES128-SHA (128/128 bits)) (No client certificate requested) by sandeen.net (Postfix) with ESMTPSA id 878E061F88D2 for ; Wed, 17 Feb 2016 23:51:46 -0600 (CST) Subject: Re: [PATCH] xfs: fix up inode32/64 (re)mount handling To: xfs@oss.sgi.com X-ASG-Orig-Subj: Re: [PATCH] xfs: fix up inode32/64 (re)mount handling References: <56C3FB75.6030104@redhat.com> <20160217183025.GB4065@bfoster.bfoster> <56C55ABE.4050100@sandeen.net> From: Eric Sandeen Message-ID: <56C55BF3.3080709@sandeen.net> Date: Wed, 17 Feb 2016 23:51:47 -0600 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.11; rv:38.0) Gecko/20100101 Thunderbird/38.6.0 MIME-Version: 1.0 In-Reply-To: <56C55ABE.4050100@sandeen.net> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit X-Barracuda-Connect: sandeen.net[63.231.237.45] X-Barracuda-Start-Time: 1455774706 X-Barracuda-URL: https://192.48.176.15:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-BRTS-Status: 1 X-Barracuda-Spam-Score: 0.00 X-Barracuda-Spam-Status: No, SCORE=0.00 using per-user scores of TAG_LEVEL=1000.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.7 tests= X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.3.27125 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- On 2/17/16 11:46 PM, Eric Sandeen wrote: > On 2/17/16 12:30 PM, Brian Foster wrote: >> On Tue, Feb 16, 2016 at 10:47:49PM -0600, Eric Sandeen wrote: >>> inode32/inode64 allocator behavior with respect to mount, >>> remount and growfs is a little tricky. >>> >>> The inode32 mount option should only enable the inode32 >>> allocator heuristics if the filesystem is large enough >>> for 64-bit inodes to exist. Today, it has this behavior >>> on the initial mount, but a remount with inode32 >>> unconditionally changes the allocation heuristics, even >>> for a small fs. >>> >>> Also, an inode32 mounted small filesystem should transition >>> to the inode32 allocator if the filesystem is subsequently >>> grown to a sufficient size. Today that does not happen. >>> >>> This patch consolidates xfs_set_inode32 and xfs_set_inode64 >>> into a single new function, and moves the "is the maximum inode >>> number big enough to matter" test into that function, so >>> it doesn't rely on the caller to get it right - which >>> remount did not do, previously. >>> >>> Signed-off-by: Eric Sandeen >>> --- >>> >>> Note, this goes after my token-parsing patch for mount. > > ... > >>> @@ -607,54 +619,48 @@ xfs_set_inode32(struct xfs_mount *mp, xfs_agnumber_t agcount) >>> max_metadata = agcount; >>> } >>> >>> + /* Get the last possible inode in the filesystem */ >>> agino = XFS_OFFBNO_TO_AGINO(mp, sbp->sb_agblocks - 1, 0); >>> + ino = XFS_AGINO_TO_INO(mp, agcount - 1, agino); >>> + >>> + /* >>> + * If user asked for no more than 32-bit inodes, and the fs is >>> + * sufficiently large, set XFS_MOUNT_32BITINODES if we must alter >>> + * the allocator to accommodate the request. >>> + */ >>> + if ((mp->m_flags & XFS_MOUNT_SMALL_INUMS) && ino > XFS_MAXINUMBER_32) >>> + mp->m_flags |= XFS_MOUNT_32BITINODES; >>> + else >>> + mp->m_flags &= ~XFS_MOUNT_32BITINODES; >> >> In the current code, we call into xfs_set_inode64() if >> XFS_MOUNT_SMALL_INUMS is not set or it is, but the largest inode is >> within XFS_MAXINUMBER_32. In that latter case, xfs_set_inode64() does: >> >> mp->m_flags &= ~(XFS_MOUNT_32BITINODES | >> XFS_MOUNT_SMALL_INUMS); >> >> ... which I think means we want to clear XFS_MOUNT_SMALL_INUMS along >> with XFS_MOUNT_32BITINODES here, yes? The rest looks fine to me: > > I don't think so; that was a bug, AFAICT. > > XFS_MOUNT_32BITINODES means that inode32 was specified at mount Ugh; I had that backwards. *XFS_MOUNT_SMALL_INUMS* means that inode32 was specified at mount time. For the reasons I stated, *that* flag should never be cleared. It signifies a specified mount option, which does not go away just because the filesystem is currently small. Maybe we need clearer flag names :/ -Eric > time, i.e. the user wants no more than 32-bit inodes for the > duration of this mount. > > So this is actually a bugfix for the 2nd item mentioned above: > >>> Also, an inode32 mounted small filesystem should transition >>> to the inode32 allocator if the filesystem is subsequently >>> grown to a sufficient size. Today that does not happen. > >> Reviewed-by: Brian Foster > > Thanks, > -Eric > > _______________________________________________ > xfs mailing list > xfs@oss.sgi.com > http://oss.sgi.com/mailman/listinfo/xfs > From bfoster@redhat.com Thu Feb 18 06:08:19 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=ham version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay1.corp.sgi.com [137.38.102.111]) by oss.sgi.com (Postfix) with ESMTP id 36B117F54 for ; Thu, 18 Feb 2016 06:08:19 -0600 (CST) Received: from cuda.sgi.com (cuda3.sgi.com [192.48.176.15]) by relay1.corp.sgi.com (Postfix) with ESMTP id 276E98F8035 for ; Thu, 18 Feb 2016 04:08:16 -0800 (PST) X-ASG-Debug-ID: 1455797294-04cb6c7708290a0001-NocioJ Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by cuda.sgi.com with ESMTP id Mujkn9Zk0S4M3Bn4 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO) for ; Thu, 18 Feb 2016 04:08:15 -0800 (PST) X-Barracuda-Envelope-From: bfoster@redhat.com X-Barracuda-Apparent-Source-IP: 209.132.183.28 X-ASG-Whitelist: Client Received: from int-mx09.intmail.prod.int.phx2.redhat.com (int-mx09.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by mx1.redhat.com (Postfix) with ESMTPS id 35F537AE90; Thu, 18 Feb 2016 12:08:14 +0000 (UTC) Received: from bfoster.bfoster (dhcp-41-22.bos.redhat.com [10.18.41.22]) by int-mx09.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id u1IC8DOn000962; Thu, 18 Feb 2016 07:08:13 -0500 Received: by bfoster.bfoster (Postfix, from userid 1000) id 3774612596E; Thu, 18 Feb 2016 07:08:12 -0500 (EST) Date: Thu, 18 Feb 2016 07:08:12 -0500 From: Brian Foster To: Eric Sandeen Cc: xfs@oss.sgi.com Subject: Re: [PATCH] xfs: fix up inode32/64 (re)mount handling Message-ID: <20160218120811.GA16962@bfoster.bfoster> X-ASG-Orig-Subj: Re: [PATCH] xfs: fix up inode32/64 (re)mount handling References: <56C3FB75.6030104@redhat.com> <20160217183025.GB4065@bfoster.bfoster> <56C55ABE.4050100@sandeen.net> <56C55BF3.3080709@sandeen.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <56C55BF3.3080709@sandeen.net> User-Agent: Mutt/1.5.24 (2015-08-30) X-Scanned-By: MIMEDefang 2.68 on 10.5.11.22 X-Barracuda-Connect: mx1.redhat.com[209.132.183.28] X-Barracuda-Start-Time: 1455797295 X-Barracuda-Encrypted: ECDHE-RSA-AES256-GCM-SHA384 X-Barracuda-URL: https://192.48.176.15:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-BRTS-Status: 1 On Wed, Feb 17, 2016 at 11:51:47PM -0600, Eric Sandeen wrote: > > > On 2/17/16 11:46 PM, Eric Sandeen wrote: > > On 2/17/16 12:30 PM, Brian Foster wrote: > >> On Tue, Feb 16, 2016 at 10:47:49PM -0600, Eric Sandeen wrote: > >>> inode32/inode64 allocator behavior with respect to mount, > >>> remount and growfs is a little tricky. > >>> > >>> The inode32 mount option should only enable the inode32 > >>> allocator heuristics if the filesystem is large enough > >>> for 64-bit inodes to exist. Today, it has this behavior > >>> on the initial mount, but a remount with inode32 > >>> unconditionally changes the allocation heuristics, even > >>> for a small fs. > >>> > >>> Also, an inode32 mounted small filesystem should transition > >>> to the inode32 allocator if the filesystem is subsequently > >>> grown to a sufficient size. Today that does not happen. > >>> > >>> This patch consolidates xfs_set_inode32 and xfs_set_inode64 > >>> into a single new function, and moves the "is the maximum inode > >>> number big enough to matter" test into that function, so > >>> it doesn't rely on the caller to get it right - which > >>> remount did not do, previously. > >>> > >>> Signed-off-by: Eric Sandeen > >>> --- > >>> > >>> Note, this goes after my token-parsing patch for mount. > > > > ... > > > >>> @@ -607,54 +619,48 @@ xfs_set_inode32(struct xfs_mount *mp, xfs_agnumber_t agcount) > >>> max_metadata = agcount; > >>> } > >>> > >>> + /* Get the last possible inode in the filesystem */ > >>> agino = XFS_OFFBNO_TO_AGINO(mp, sbp->sb_agblocks - 1, 0); > >>> + ino = XFS_AGINO_TO_INO(mp, agcount - 1, agino); > >>> + > >>> + /* > >>> + * If user asked for no more than 32-bit inodes, and the fs is > >>> + * sufficiently large, set XFS_MOUNT_32BITINODES if we must alter > >>> + * the allocator to accommodate the request. > >>> + */ > >>> + if ((mp->m_flags & XFS_MOUNT_SMALL_INUMS) && ino > XFS_MAXINUMBER_32) > >>> + mp->m_flags |= XFS_MOUNT_32BITINODES; > >>> + else > >>> + mp->m_flags &= ~XFS_MOUNT_32BITINODES; > >> > >> In the current code, we call into xfs_set_inode64() if > >> XFS_MOUNT_SMALL_INUMS is not set or it is, but the largest inode is > >> within XFS_MAXINUMBER_32. In that latter case, xfs_set_inode64() does: > >> > >> mp->m_flags &= ~(XFS_MOUNT_32BITINODES | > >> XFS_MOUNT_SMALL_INUMS); > >> > >> ... which I think means we want to clear XFS_MOUNT_SMALL_INUMS along > >> with XFS_MOUNT_32BITINODES here, yes? The rest looks fine to me: > > > > I don't think so; that was a bug, AFAICT. > > > > XFS_MOUNT_32BITINODES means that inode32 was specified at mount > > Ugh; I had that backwards. > > *XFS_MOUNT_SMALL_INUMS* means that inode32 was specified at mount time. > For the reasons I stated, *that* flag should never be cleared. It > signifies a specified mount option, which does not go away just because > the filesystem is currently small. > > Maybe we need clearer flag names :/ > Ah, I missed that part. Sounds good, thanks for the explanation! (And yes, the flag names are not clear.. ;P) Brian > -Eric > > > time, i.e. the user wants no more than 32-bit inodes for the > > duration of this mount. > > > > So this is actually a bugfix for the 2nd item mentioned above: > > > >>> Also, an inode32 mounted small filesystem should transition > >>> to the inode32 allocator if the filesystem is subsequently > >>> grown to a sufficient size. Today that does not happen. > > > >> Reviewed-by: Brian Foster > > > > Thanks, > > -Eric > > > > _______________________________________________ > > xfs mailing list > > xfs@oss.sgi.com > > http://oss.sgi.com/mailman/listinfo/xfs > > > > _______________________________________________ > xfs mailing list > xfs@oss.sgi.com > http://oss.sgi.com/mailman/listinfo/xfs From bfoster@redhat.com Thu Feb 18 06:10:24 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=ham version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay1.corp.sgi.com [137.38.102.111]) by oss.sgi.com (Postfix) with ESMTP id 88F637F56 for ; Thu, 18 Feb 2016 06:10:24 -0600 (CST) Received: from cuda.sgi.com (cuda2.sgi.com [192.48.176.25]) by relay1.corp.sgi.com (Postfix) with ESMTP id 6758A8F8040 for ; Thu, 18 Feb 2016 04:10:24 -0800 (PST) X-ASG-Debug-ID: 1455797422-04cbb0479e5b160001-NocioJ Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by cuda.sgi.com with ESMTP id 0nbPPGaQgIGjCCIb (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO) for ; Thu, 18 Feb 2016 04:10:23 -0800 (PST) X-Barracuda-Envelope-From: bfoster@redhat.com X-Barracuda-Apparent-Source-IP: 209.132.183.28 X-ASG-Whitelist: Client Received: from int-mx09.intmail.prod.int.phx2.redhat.com (int-mx09.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by mx1.redhat.com (Postfix) with ESMTPS id A3E10C0CB0FD; Thu, 18 Feb 2016 12:10:22 +0000 (UTC) Received: from bfoster.bfoster (dhcp-41-22.bos.redhat.com [10.18.41.22]) by int-mx09.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id u1ICAMX9001932; Thu, 18 Feb 2016 07:10:22 -0500 Received: by bfoster.bfoster (Postfix, from userid 1000) id 5E46012596E; Thu, 18 Feb 2016 07:10:21 -0500 (EST) Date: Thu, 18 Feb 2016 07:10:21 -0500 From: Brian Foster To: Dave Chinner Cc: Christoph Hellwig , xfs@oss.sgi.com Subject: Re: [PATCH 2/3] xfs: better xfs_trans_alloc interface Message-ID: <20160218121021.GB16962@bfoster.bfoster> X-ASG-Orig-Subj: Re: [PATCH 2/3] xfs: better xfs_trans_alloc interface References: <1455699159-20906-1-git-send-email-hch@lst.de> <1455699159-20906-2-git-send-email-hch@lst.de> <20160217134006.GA4065@bfoster.bfoster> <20160217220436.GI19486@dastard> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20160217220436.GI19486@dastard> User-Agent: Mutt/1.5.24 (2015-08-30) X-Scanned-By: MIMEDefang 2.68 on 10.5.11.22 X-Barracuda-Connect: mx1.redhat.com[209.132.183.28] X-Barracuda-Start-Time: 1455797423 X-Barracuda-Encrypted: ECDHE-RSA-AES256-GCM-SHA384 X-Barracuda-URL: https://192.48.176.25:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-BRTS-Status: 1 On Thu, Feb 18, 2016 at 09:04:36AM +1100, Dave Chinner wrote: > On Wed, Feb 17, 2016 at 08:40:08AM -0500, Brian Foster wrote: > > On Wed, Feb 17, 2016 at 09:52:38AM +0100, Christoph Hellwig wrote: > > > Merge xfs_trans_reserve and xfs_trans_alloc into a single function call > > > that returns a transaction with all the required log and block reservations, > > > and which allows passing transaction flags directly to avoid the cumbersome > > > _xfs_trans_alloc interface. > > > > > > While we're at it we also get rid of the transaction type argument that has > > > been superflous since we stopped supporting the non-CIL logging mode. The > > > guts of it will be removed in another patch. > > > > > > Signed-off-by: Christoph Hellwig > > > --- > > > > > @@ -165,7 +123,7 @@ xfs_trans_dup( > > > * This does not do quota reservations. That typically is done by the > > > * caller afterwards. > > > */ > > > -int > > > +static int > > > xfs_trans_reserve( > > > struct xfs_trans *tp, > > > struct xfs_trans_res *resp, > > > @@ -219,7 +177,7 @@ xfs_trans_reserve( > > > resp->tr_logres, > > > resp->tr_logcount, > > > &tp->t_ticket, XFS_TRANSACTION, > > > - permanent, tp->t_type); > > > + permanent, 0); > > > > So this looks like it effectively breaks xlog_print_tic_res()..? I see > > that is all removed in the subsequent patch, but the type still seems > > like useful information in the event that an associated problem occurs > > with the transaction. In fact, we just had a transaction overrun report > > over the weekend (on irc) where at least I thought this was useful > > (unfortunately it looks like I lost the reference to the syslog output). > > I've considered doing this removal myself in the past - doing > somethign like embedding the return address of the > xfs-trans_reserve() call in the ticket that is allocated tells us > exactly where the call was made. This can be printed with %pS, and > that gives us the function (and location in the function) the > reservation was made. Hence we solve the problem of not > knowing which call path triggered the problem. > > Hence I don't think we actually need to the type in every function > call. > That sounds like a good idea to me. Brian > Cheers, > > Dave. > -- > Dave Chinner > david@fromorbit.com > > _______________________________________________ > xfs mailing list > xfs@oss.sgi.com > http://oss.sgi.com/mailman/listinfo/xfs From hch@lst.de Thu Feb 18 07:32:48 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: ** X-Spam-Status: No, score=3.0 required=5.0 tests=TVD_SUBJ_NUM_OBFU_MINFP autolearn=no version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay1.corp.sgi.com [137.38.102.111]) by oss.sgi.com (Postfix) with ESMTP id 46F6A7CA1 for ; Thu, 18 Feb 2016 07:32:48 -0600 (CST) Received: from cuda.sgi.com (cuda2.sgi.com [192.48.176.25]) by relay1.corp.sgi.com (Postfix) with ESMTP id 25E458F8033 for ; Thu, 18 Feb 2016 05:32:45 -0800 (PST) X-ASG-Debug-ID: 1455802361-04cbb0479e60070001-NocioJ Received: from newverein.lst.de (verein.lst.de [213.95.11.211]) by cuda.sgi.com with ESMTP id JNkINloP87a53K8i (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO) for ; Thu, 18 Feb 2016 05:32:42 -0800 (PST) X-Barracuda-Envelope-From: hch@lst.de X-Barracuda-Apparent-Source-IP: 213.95.11.211 Received: by newverein.lst.de (Postfix, from userid 2407) id 8218368BFF; Thu, 18 Feb 2016 14:32:40 +0100 (CET) Date: Thu, 18 Feb 2016 14:32:40 +0100 From: Christoph Hellwig To: xfs@oss.sgi.com Cc: "Darrick J. Wong" , linux-m68k@lists.linux-m68k.org Subject: [fengguang.wu@intel.com: [pnfs:xfs-nfsd-clone] 57b7d25bf4c57ebe0fbd2d8c5b37edf503175e1f BUILD DONE] Message-ID: <20160218133240.GA5228@lst.de> X-ASG-Orig-Subj: [fengguang.wu@intel.com: [pnfs:xfs-nfsd-clone] 57b7d25bf4c57ebe0fbd2d8c5b37edf503175e1f BUILD DONE] MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit User-Agent: Mutt/1.5.17 (2007-11-01) X-Barracuda-Connect: verein.lst.de[213.95.11.211] X-Barracuda-Start-Time: 1455802362 X-Barracuda-Encrypted: ECDHE-RSA-AES256-GCM-SHA384 X-Barracuda-URL: https://192.48.176.25:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-BRTS-Status: 1 X-Barracuda-Spam-Score: 0.20 X-Barracuda-Spam-Status: No, SCORE=0.20 using per-user scores of TAG_LEVEL=1000.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.7 tests=PR0N_SUBJECT X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.3.27132 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 0.20 PR0N_SUBJECT Subject has letters around special characters (pr0n) Looks like the structure size checker found it's first victim on m68k, which doesn't seem to pad to 4 byte boundaries. I don't think it actually matters in practice as we'll always the hacky appromiation of a variable sized array behind it. I guess we should move this to a modern C99 VLA and mark it as __packed? ----- Forwarded message from kbuild test robot ----- Date: Thu, 18 Feb 2016 21:26:23 +0800 From: kbuild test robot Subject: [pnfs:xfs-nfsd-clone] 57b7d25bf4c57ebe0fbd2d8c5b37edf503175e1f BUILD DONE To: Christoph Hellwig git://git.infradead.org/users/hch/pnfs.git xfs-nfsd-clone 57b7d25bf4c57ebe0fbd2d8c5b37edf503175e1f nfs4: fix stateid handling for the NFS v4.2 operations fs/xfs/xfs_ondisk.h:22:2: note: in expansion of macro 'BUILD_BUG_ON_MSG' fs/xfs/xfs_ondisk.h:74:2: note: in expansion of macro 'XFS_CHECK_STRUCT_SIZE' include/linux/compiler.h:502:38: error: call to '__compiletime_assert_74' declared with attribute error: XFS: sizeof(xfs_attr_leaf_name_remote_t) is wrong, expected 12 Error ids grouped by kconfigs: recent_errors ├── m68k-multi_defconfig │   ├── fs-xfs-xfs_ondisk.h:note:in-expansion-of-macro-BUILD_BUG_ON_MSG │   ├── fs-xfs-xfs_ondisk.h:note:in-expansion-of-macro-XFS_CHECK_STRUCT_SIZE │   └── include-linux-compiler.h:error:call-to-__compiletime_assert_NNN-declared-with-attribute-error:XFS:sizeof(xfs_attr_leaf_name_remote_t)-is-wrong-expected └── m68k-sun3_defconfig ├── fs-xfs-xfs_ondisk.h:note:in-expansion-of-macro-BUILD_BUG_ON_MSG ├── fs-xfs-xfs_ondisk.h:note:in-expansion-of-macro-XFS_CHECK_STRUCT_SIZE └── include-linux-compiler.h:error:call-to-__compiletime_assert_NNN-declared-with-attribute-error:XFS:sizeof(xfs_attr_leaf_name_remote_t)-is-wrong-expected elapsed time: 66m configs tested: 111 alpha defconfig parisc allnoconfig parisc c3000_defconfig parisc defconfig arm badge4_defconfig arm cerfcube_defconfig powerpc mpc834x_itxgp_defconfig i386 randconfig-a0-201607 x86_64 acpi-redef x86_64 allyesdebian x86_64 nfsroot blackfin BF526-EZBRD_defconfig blackfin BF533-EZKIT_defconfig blackfin BF561-EZKIT-SMP_defconfig blackfin TCM-BF537_defconfig cris etrax-100lx_v2_defconfig sh allnoconfig sh rsk7269_defconfig sh sh7785lcr_32bit_defconfig sh titan_defconfig x86_64 allmodconfig arm allnoconfig arm at91_dt_defconfig arm efm32_defconfig arm exynos_defconfig arm multi_v5_defconfig arm multi_v7_defconfig arm shmobile_defconfig arm sunxi_defconfig powerpc allnoconfig powerpc defconfig powerpc ppc64_defconfig m32r m32104ut_defconfig m32r mappi3.smp_defconfig m32r opsput_defconfig m32r usrv_defconfig xtensa common_defconfig xtensa iss_defconfig parisc b180_defconfig arm ebsa110_defconfig arm h3600_defconfig mips malta_qemu_32r6_defconfig powerpc walnut_defconfig x86_64 randconfig-x012-201607 x86_64 randconfig-x014-201607 x86_64 randconfig-x017-201607 x86_64 randconfig-x011-201607 x86_64 randconfig-x013-201607 x86_64 randconfig-x019-201607 x86_64 randconfig-x015-201607 x86_64 randconfig-x010-201607 x86_64 randconfig-x016-201607 x86_64 randconfig-x018-201607 i386 alldefconfig i386 allnoconfig i386 defconfig i386 randconfig-s0-201607 i386 randconfig-s1-201607 avr32 atngw100_defconfig avr32 atstk1006_defconfig frv defconfig mn10300 asb2364_defconfig openrisc or1ksim_defconfig tile tilegx_defconfig um i386_defconfig um x86_64_defconfig i386 tinyconfig x86_64 randconfig-i0-201607 microblaze mmu_defconfig microblaze nommu_defconfig i386 randconfig-i0-201607 i386 randconfig-i1-201607 sparc defconfig sparc64 allnoconfig sparc64 defconfig x86_64 lkp x86_64 rhel x86_64 rhel+CONFIG_DEBUG_INFO_REDUCED i386 randconfig-n0-201607 ia64 alldefconfig ia64 allnoconfig ia64 defconfig m68k m5475evb_defconfig m68k multi_defconfig m68k sun3_defconfig x86_64 randconfig-x004-201607 x86_64 randconfig-x002-201607 x86_64 randconfig-x000-201607 x86_64 randconfig-x009-201607 x86_64 randconfig-x006-201607 x86_64 randconfig-x003-201607 x86_64 randconfig-x005-201607 x86_64 randconfig-x001-201607 x86_64 randconfig-x007-201607 x86_64 randconfig-x008-201607 i386 randconfig-r0-201607 i386 allmodconfig i386 randconfig-x001-201607 i386 randconfig-x007-201607 i386 randconfig-x004-201607 i386 randconfig-x002-201607 i386 randconfig-x008-201607 i386 randconfig-x003-201607 i386 randconfig-x006-201607 i386 randconfig-x005-201607 i386 randconfig-x009-201607 i386 randconfig-x000-201607 mips allnoconfig mips fuloong2e_defconfig mips jz4740 mips txx9 Thanks, Fengguang ----- End forwarded message ----- From geert.uytterhoeven@gmail.com Thu Feb 18 08:06:28 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: *** X-Spam-Status: No, score=3.0 required=5.0 tests=FREEMAIL_FROM, TVD_SUBJ_NUM_OBFU_MINFP,T_DKIM_INVALID autolearn=no version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay1.corp.sgi.com [137.38.102.111]) by oss.sgi.com (Postfix) with ESMTP id 206777CA1 for ; Thu, 18 Feb 2016 08:06:28 -0600 (CST) Received: from cuda.sgi.com (cuda2.sgi.com [192.48.176.25]) by relay1.corp.sgi.com (Postfix) with ESMTP id 024C48F8033 for ; Thu, 18 Feb 2016 06:06:25 -0800 (PST) X-ASG-Debug-ID: 1455804374-04cbb0479d61f30001-NocioJ Received: from mail-ig0-f179.google.com (mail-ig0-f179.google.com [209.85.213.179]) by cuda.sgi.com with ESMTP id Bgrwr6JEHgyCKauN (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128 verify=NO) for ; Thu, 18 Feb 2016 06:06:14 -0800 (PST) X-Barracuda-Envelope-From: geert.uytterhoeven@gmail.com X-Barracuda-RBL-Trusted-Forwarder: 209.85.213.179 Received: by mail-ig0-f179.google.com with SMTP id y8so14318228igp.0 for ; Thu, 18 Feb 2016 06:06:14 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:date:message-id:subject :from:to:cc; bh=exzyPnEaggQTDK99GpQ0BQJ9uTePBsaFM7k3PnqsyqA=; b=V+92gKEGvuuoEyvui+6btbApc2Voy9oZ1A1cTNrVFoZ++mGa8l5LwE5VYK38LNdfj/ AI+21uJHde5h1DrBv9GFOHHekHwV7UMlxDPvwHUmCQYvBw74wTJnjg8VLeXeGbHH78s0 bbur/glG+ZOfUC7y7kOuXQV6mfcQzDe/4HYI7MFgxK5djDFvSfQTVFtnEMh48Vs0xFWX IVtLOjpLF4O4KcwE35l9TdEt9yR9b/TmuCoNfyzmSHQnmYceMINzTWINaFAALqW57XWC tjc9kF9u7j+yokAIGm3Yd99gZIINH4W5VZYumz0FIj/F7VL/tQYk54wps/1sD8MtpJny 5/Ww== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:sender:in-reply-to:references:date :message-id:subject:from:to:cc; bh=exzyPnEaggQTDK99GpQ0BQJ9uTePBsaFM7k3PnqsyqA=; b=X8YnMxjnO37FbNkQl0Dly8KPbkiH5jNk/mB1jGmpZPY+idj0EZrO0a5OZi8VDXmbP1 ykJoid+8OK++7K7bb/5qi5U36ov+UNr8nMhwqhmQixP7oSNJ7xlcDxq84635XFvlJbyx edHqcJ01rIBC+/vIIragrNaTA3b6fcuh2MP5SQ6EK46l0g2V1qaLQ9G0DQuFFoLKFWza jDIIylorkBhZK9ZqPmnBgec+NIgsemAyQ3TcDda0IIO1BzE7QBrEqs3N7mW+yll6gRjb yqRroYRFgqA4DdhkOVlJcYg0SaS/UcyyLYJB/sSRH9hxrnHO+USR9sn0LpWwyTbWdCpx sSfA== X-Gm-Message-State: AG10YOT6/6UbUwd6zlBCySB48nGLrYJJmI0YCkuG8EUv+tGUowEByH/q1EVth0zW4xHJns1jo8Sar7IQdiTtyg== MIME-Version: 1.0 X-Received: by 10.50.111.70 with SMTP id ig6mr3666955igb.10.1455804374664; Thu, 18 Feb 2016 06:06:14 -0800 (PST) Sender: geert.uytterhoeven@gmail.com Received: by 10.107.132.222 with HTTP; Thu, 18 Feb 2016 06:06:14 -0800 (PST) In-Reply-To: <20160218133240.GA5228@lst.de> References: <20160218133240.GA5228@lst.de> Date: Thu, 18 Feb 2016 15:06:14 +0100 X-Google-Sender-Auth: CwjcSl3pV8t01nqnY83omuCTS5A Message-ID: Subject: Re: [fengguang.wu@intel.com: [pnfs:xfs-nfsd-clone] 57b7d25bf4c57ebe0fbd2d8c5b37edf503175e1f BUILD DONE] From: Geert Uytterhoeven X-ASG-Orig-Subj: Re: [fengguang.wu@intel.com: [pnfs:xfs-nfsd-clone] 57b7d25bf4c57ebe0fbd2d8c5b37edf503175e1f BUILD DONE] To: Christoph Hellwig Cc: xfs@oss.sgi.com, "Darrick J. Wong" , linux-m68k Content-Type: text/plain; charset=UTF-8 X-Barracuda-Connect: mail-ig0-f179.google.com[209.85.213.179] X-Barracuda-Start-Time: 1455804374 X-Barracuda-Encrypted: ECDHE-RSA-AES128-GCM-SHA256 X-Barracuda-URL: https://192.48.176.25:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-BRTS-Status: 1 X-Barracuda-Spam-Score: 0.20 X-Barracuda-Spam-Status: No, SCORE=0.20 using per-user scores of TAG_LEVEL=1000.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.7 tests=BSF_SC0_MISMATCH_TO, DKIM_SIGNED, DKIM_VERIFIED, PR0N_SUBJECT X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.3.27133 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 0.00 BSF_SC0_MISMATCH_TO Envelope rcpt doesn't match header -0.00 DKIM_VERIFIED Domain Keys Identified Mail: signature passes verification 0.00 DKIM_SIGNED Domain Keys Identified Mail: message has a signature 0.20 PR0N_SUBJECT Subject has letters around special characters (pr0n) Hi Christoph, On Thu, Feb 18, 2016 at 2:32 PM, Christoph Hellwig wrote: > Looks like the structure size checker found it's first victim on m68k, > which doesn't seem to pad to 4 byte boundaries. I don't think it actually > matters in practice as we'll always the hacky appromiation of a variable > sized array behind it. I guess we should move this to a modern C99 VLA > and mark it as __packed? Marking it __packed causes the compiler to assume that the other 32-bit values may not be aligned. You can add 2 padding bytes to struct xfs_attr_leaf_name_remote. Or change name[1] to name[3]. > ----- Forwarded message from kbuild test robot ----- > > Date: Thu, 18 Feb 2016 21:26:23 +0800 > From: kbuild test robot > Subject: [pnfs:xfs-nfsd-clone] 57b7d25bf4c57ebe0fbd2d8c5b37edf503175e1f > BUILD DONE > To: Christoph Hellwig > > git://git.infradead.org/users/hch/pnfs.git xfs-nfsd-clone > 57b7d25bf4c57ebe0fbd2d8c5b37edf503175e1f nfs4: fix stateid handling for the NFS v4.2 operations > > fs/xfs/xfs_ondisk.h:22:2: note: in expansion of macro 'BUILD_BUG_ON_MSG' > fs/xfs/xfs_ondisk.h:74:2: note: in expansion of macro 'XFS_CHECK_STRUCT_SIZE' > include/linux/compiler.h:502:38: error: call to '__compiletime_assert_74' declared with attribute error: XFS: sizeof(xfs_attr_leaf_name_remote_t) is wrong, expected 12 Gr{oetje,eeting}s, Geert -- Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org In personal conversations with technical people, I call myself a hacker. But when I'm talking to journalists I just say "programmer" or something like that. -- Linus Torvalds From cmaiolino@redhat.com Thu Feb 18 10:49:30 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=ham version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay2.corp.sgi.com [137.38.102.29]) by oss.sgi.com (Postfix) with ESMTP id 752497CA3 for ; Thu, 18 Feb 2016 10:49:30 -0600 (CST) Received: from cuda.sgi.com (cuda3.sgi.com [192.48.176.15]) by relay2.corp.sgi.com (Postfix) with ESMTP id 55EF0304059 for ; Thu, 18 Feb 2016 08:49:27 -0800 (PST) X-ASG-Debug-ID: 1455814165-04cb6c77063a1d0001-NocioJ Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by cuda.sgi.com with ESMTP id Zh7XBbNlPWlRVTPM (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO) for ; Thu, 18 Feb 2016 08:49:25 -0800 (PST) X-Barracuda-Envelope-From: cmaiolino@redhat.com X-Barracuda-Apparent-Source-IP: 209.132.183.28 X-ASG-Whitelist: Client Received: from int-mx09.intmail.prod.int.phx2.redhat.com (int-mx09.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by mx1.redhat.com (Postfix) with ESMTPS id 27A7D461D3 for ; Thu, 18 Feb 2016 16:49:25 +0000 (UTC) Received: from zion.usersys.redhat.com ([10.34.251.80]) by int-mx09.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id u1IGnNb3024887 for ; Thu, 18 Feb 2016 11:49:24 -0500 From: Carlos Maiolino To: xfs@oss.sgi.com Subject: [PATCH] xfs_io: implement 'inode' command V6 Date: Thu, 18 Feb 2016 17:49:19 +0100 X-ASG-Orig-Subj: [PATCH] xfs_io: implement 'inode' command V6 Message-Id: <1455814159-14191-1-git-send-email-cmaiolino@redhat.com> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.22 X-Barracuda-Connect: mx1.redhat.com[209.132.183.28] X-Barracuda-Start-Time: 1455814165 X-Barracuda-Encrypted: ECDHE-RSA-AES256-GCM-SHA384 X-Barracuda-URL: https://192.48.176.15:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-BRTS-Status: 1 Implements a new xfs_io command, named 'inode', which is supposed to be used to query information about inode's existence and its physical size in the filesystem. Supported options: Default: -- Return true(1) or false(0) if any inode greater than 32bits has been found in the filesystem [num] -- Return inode number or 0 if the inode [num] is in use -n [num] -- Return the next valid inode after [num] -v -- verbose mode Display the inode number and its physical size according to the argument used No manpage sent because there were changes in the supported options and its descriptions. I'll send the manpage after the options and descriptions are reviewed. - Changelog V3: - Merge all 3 patches from the V2 together in a single patch - Rework of '-n [num]' and 'num' only arguments algorithm - Argument -n now relies on bulkreq.count to check for next inodes, not on bstat.bs_ino anymore. - for loop in ret_lsize or ret_largest case, now relies on count being 0 to break the loop V4: - Refactor inode_f function to reduce its size and easier logic - Implement error handlers for invalid command combination (hopefully all invalid combinations). - use a single xfs_inogrp array for keep track of inodes - Fix missing newline in inode_help() - Rewrite help message in inode_help() - Fix indentation V5: - Reduce the amount of options - remove igrp_rec variable, and use igroup[lastgrp] directly to get information from the last inode groups returned by ioctl V6: - Re-use userino variable to reduce code duplication for command output - Use verbose option as an extension to another commands - report usage message when -n option is passed stand-alone - Refactor command outputs - Add a few comments to the code Signed-off-by: Carlos Maiolino --- io/open.c | 150 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 150 insertions(+) diff --git a/io/open.c b/io/open.c index 037843d..5e607f1 100644 --- a/io/open.c +++ b/io/open.c @@ -20,6 +20,7 @@ #include "input.h" #include "init.h" #include "io.h" +#include "libxfs.h" #ifndef __O_TMPFILE #if defined __alpha__ @@ -44,6 +45,7 @@ static cmdinfo_t statfs_cmd; static cmdinfo_t chproj_cmd; static cmdinfo_t lsproj_cmd; static cmdinfo_t extsize_cmd; +static cmdinfo_t inode_cmd; static prid_t prid; static long extsize; @@ -750,6 +752,143 @@ statfs_f( return 0; } +static void +inode_help(void) +{ + printf(_( +"\n" +"Query physical information about the inode" +"\n" +" Default: -- Return true(1) or false(0) if any inode greater than\n" +" 32bits has been found in the filesystem\n" +"[num] -- Return inode number [num] or 0 if the inode [num] is in use\n" +" or not\n" +" -n [num] -- Return the next valid inode after [num]\n" +" -v -- verbose mode\n" +" Display the inode number and its physical size (in bits)\n" +" according to the argument used\n" +"\n")); +} + +static int +inode_f( + int argc, + char **argv) +{ + __s32 count = 0; + __s32 lastgrp = 0; + __u64 last = 0; + __u64 lastino = 0; + __u64 userino = 0; + char *p; + int c; + int verbose = 0; + int ret_next = 0; + int cmd = 0; + struct xfs_inogrp igroup[1024]; + struct xfs_fsop_bulkreq bulkreq; + struct xfs_bstat bstat; + + while ((c = getopt(argc, argv, "nv")) != EOF) { + switch (c) { + case 'v': + verbose = 1; + break; + case 'n': + ret_next = 1; + break; + default: + return command_usage(&inode_cmd); + } + } + + /* + * Inode number can be passed with or without extra arguments, so we + * should handle inode numbers passed by user out of getopt() + */ + if (optind < argc) { + + if (ret_next) { + cmd = XFS_IOC_FSBULKSTAT; + } else { + if (argc > 2) + return command_usage(&inode_cmd); + else + cmd = XFS_IOC_FSBULKSTAT_SINGLE; + } + + userino = strtoull(argv[optind], &p, 10); + if ((*p != '\0')) { + printf(_("[num] must be a numeric value\n")); + exitcode = 1; + return 0; + } + + bulkreq.lastip = &userino; + bulkreq.icount = 1; + bulkreq.ubuffer = &bstat; + bulkreq.ocount = &count; + + if (xfsctl(file->name, file->fd, cmd, &bulkreq)) { + if (errno == EINVAL) { + if (!ret_next) + printf("0\n"); + } else { + perror("xfsctl"); + } + exitcode = 1; + return 0; + } + + if (ret_next) + userino = bstat.bs_ino; + + if (verbose) + printf("%llu:%d\n", + userino, + userino > XFS_MAXINUMBER_32 ? 64 : 32); + else + /* Inode in use */ + printf("%llu\n", userino); + return 0; + + /* -n option must not be used stand alone */ + } else if (ret_next) { + return command_usage(&inode_cmd); + } + + bulkreq.lastip = &last; + bulkreq.icount = 1024; /* User-defined maybe!? */ + bulkreq.ubuffer = &igroup; + bulkreq.ocount = &count; + + for (;;) { + if (xfsctl(file->name, file->fd, XFS_IOC_FSINUMBERS, + &bulkreq)) { + perror("XFS_IOC_FSINUMBERS"); + exitcode = 1; + return 0; + } + + if (count == 0) + break; + + lastgrp = count; + } + + lastgrp--; + lastino = igroup[lastgrp].xi_startino + + xfs_highbit64(igroup[lastgrp].xi_allocmask); + + if (verbose) + printf("%llu:%d\n", lastino, + lastino > XFS_MAXINUMBER_32 ? 64 : 32); + else + printf("%d\n", lastino > XFS_MAXINUMBER_32 ? 1 : 0); + + return 0; +} + void open_init(void) { @@ -815,6 +954,16 @@ open_init(void) _("get/set preferred extent size (in bytes) for the open file"); extsize_cmd.help = extsize_help; + inode_cmd.name = "inode"; + inode_cmd.cfunc = inode_f; + inode_cmd.args = _("[-n | -v] [num]"); + inode_cmd.argmin = 0; + inode_cmd.argmax = 2; + inode_cmd.flags = CMD_NOMAP_OK; + inode_cmd.oneline = + _("Query inode number usage in the filesystem"); + inode_cmd.help = inode_help; + add_command(&open_cmd); add_command(&stat_cmd); add_command(&close_cmd); @@ -822,4 +971,5 @@ open_init(void) add_command(&chproj_cmd); add_command(&lsproj_cmd); add_command(&extsize_cmd); + add_command(&inode_cmd); } -- 2.4.3 From billodo@redhat.com Thu Feb 18 11:02:17 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=ham version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay2.corp.sgi.com [137.38.102.29]) by oss.sgi.com (Postfix) with ESMTP id C6B4A7CA3 for ; Thu, 18 Feb 2016 11:02:17 -0600 (CST) Received: from cuda.sgi.com (cuda3.sgi.com [192.48.176.15]) by relay2.corp.sgi.com (Postfix) with ESMTP id A79D3304059 for ; Thu, 18 Feb 2016 09:02:11 -0800 (PST) X-ASG-Debug-ID: 1455814929-04cb6c77083aec0001-NocioJ Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by cuda.sgi.com with ESMTP id ykjWuTdc0EHs9bUK (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO) for ; Thu, 18 Feb 2016 09:02:10 -0800 (PST) X-Barracuda-Envelope-From: billodo@redhat.com X-Barracuda-Apparent-Source-IP: 209.132.183.28 X-ASG-Whitelist: Client Received: from int-mx10.intmail.prod.int.phx2.redhat.com (int-mx10.intmail.prod.int.phx2.redhat.com [10.5.11.23]) by mx1.redhat.com (Postfix) with ESMTPS id 5CFEA8F507 for ; Thu, 18 Feb 2016 17:02:09 +0000 (UTC) Received: from redhat.com (vpn-53-8.rdu2.redhat.com [10.10.53.8]) by int-mx10.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id u1IH27fS029542 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Thu, 18 Feb 2016 12:02:08 -0500 Date: Thu, 18 Feb 2016 11:02:07 -0600 From: "Bill O'Donnell" To: Carlos Maiolino Cc: xfs@oss.sgi.com Subject: Re: [PATCH] xfs_io: implement 'inode' command V6 Message-ID: <20160218170207.GA2917@redhat.com> X-ASG-Orig-Subj: Re: [PATCH] xfs_io: implement 'inode' command V6 References: <1455814159-14191-1-git-send-email-cmaiolino@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1455814159-14191-1-git-send-email-cmaiolino@redhat.com> User-Agent: Mutt/1.5.24 (2015-08-30) X-Scanned-By: MIMEDefang 2.68 on 10.5.11.23 X-Barracuda-Connect: mx1.redhat.com[209.132.183.28] X-Barracuda-Start-Time: 1455814930 X-Barracuda-Encrypted: ECDHE-RSA-AES256-GCM-SHA384 X-Barracuda-URL: https://192.48.176.15:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-BRTS-Status: 1 On Thu, Feb 18, 2016 at 05:49:19PM +0100, Carlos Maiolino wrote: > Implements a new xfs_io command, named 'inode', which is supposed to be > used to query information about inode's existence and its physical size > in the filesystem. > > Supported options: > > Default: -- Return true(1) or false(0) if any inode greater than > 32bits has been found in the filesystem > [num] -- Return inode number or 0 if the inode [num] is in use > -n [num] -- Return the next valid inode after [num] > -v -- verbose mode > Display the inode number and its physical size according to the > argument used > > No manpage sent because there were changes in the supported options and its > descriptions. > I'll send the manpage after the options and descriptions are reviewed. > > - Changelog > > V3: > - Merge all 3 patches from the V2 together in a single patch > - Rework of '-n [num]' and 'num' only arguments algorithm > - Argument -n now relies on bulkreq.count to check for next inodes, not > on bstat.bs_ino anymore. > - for loop in ret_lsize or ret_largest case, now relies on count being 0 > to break the loop > > V4: > - Refactor inode_f function to reduce its size and easier logic > - Implement error handlers for invalid command combination (hopefully > all invalid combinations). > - use a single xfs_inogrp array for keep track of inodes > - Fix missing newline in inode_help() > - Rewrite help message in inode_help() > - Fix indentation > > V5: > - Reduce the amount of options > - remove igrp_rec variable, and use igroup[lastgrp] directly to get > information from the last inode groups returned by ioctl > > V6: > - Re-use userino variable to reduce code duplication for command output > - Use verbose option as an extension to another commands > - report usage message when -n option is passed stand-alone > - Refactor command outputs > - Add a few comments to the code > > Signed-off-by: Carlos Maiolino This looks good to me. Reviewed-by: Bill O'Donnell > --- > io/open.c | 150 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ > 1 file changed, 150 insertions(+) > > diff --git a/io/open.c b/io/open.c > index 037843d..5e607f1 100644 > --- a/io/open.c > +++ b/io/open.c > @@ -20,6 +20,7 @@ > #include "input.h" > #include "init.h" > #include "io.h" > +#include "libxfs.h" > > #ifndef __O_TMPFILE > #if defined __alpha__ > @@ -44,6 +45,7 @@ static cmdinfo_t statfs_cmd; > static cmdinfo_t chproj_cmd; > static cmdinfo_t lsproj_cmd; > static cmdinfo_t extsize_cmd; > +static cmdinfo_t inode_cmd; > static prid_t prid; > static long extsize; > > @@ -750,6 +752,143 @@ statfs_f( > return 0; > } > > +static void > +inode_help(void) > +{ > + printf(_( > +"\n" > +"Query physical information about the inode" > +"\n" > +" Default: -- Return true(1) or false(0) if any inode greater than\n" > +" 32bits has been found in the filesystem\n" > +"[num] -- Return inode number [num] or 0 if the inode [num] is in use\n" > +" or not\n" > +" -n [num] -- Return the next valid inode after [num]\n" > +" -v -- verbose mode\n" > +" Display the inode number and its physical size (in bits)\n" > +" according to the argument used\n" > +"\n")); > +} > + > +static int > +inode_f( > + int argc, > + char **argv) > +{ > + __s32 count = 0; > + __s32 lastgrp = 0; > + __u64 last = 0; > + __u64 lastino = 0; > + __u64 userino = 0; > + char *p; > + int c; > + int verbose = 0; > + int ret_next = 0; > + int cmd = 0; > + struct xfs_inogrp igroup[1024]; > + struct xfs_fsop_bulkreq bulkreq; > + struct xfs_bstat bstat; > + > + while ((c = getopt(argc, argv, "nv")) != EOF) { > + switch (c) { > + case 'v': > + verbose = 1; > + break; > + case 'n': > + ret_next = 1; > + break; > + default: > + return command_usage(&inode_cmd); > + } > + } > + > + /* > + * Inode number can be passed with or without extra arguments, so we > + * should handle inode numbers passed by user out of getopt() > + */ > + if (optind < argc) { > + > + if (ret_next) { > + cmd = XFS_IOC_FSBULKSTAT; > + } else { > + if (argc > 2) > + return command_usage(&inode_cmd); > + else > + cmd = XFS_IOC_FSBULKSTAT_SINGLE; > + } > + > + userino = strtoull(argv[optind], &p, 10); > + if ((*p != '\0')) { > + printf(_("[num] must be a numeric value\n")); > + exitcode = 1; > + return 0; > + } > + > + bulkreq.lastip = &userino; > + bulkreq.icount = 1; > + bulkreq.ubuffer = &bstat; > + bulkreq.ocount = &count; > + > + if (xfsctl(file->name, file->fd, cmd, &bulkreq)) { > + if (errno == EINVAL) { > + if (!ret_next) > + printf("0\n"); > + } else { > + perror("xfsctl"); > + } > + exitcode = 1; > + return 0; > + } > + > + if (ret_next) > + userino = bstat.bs_ino; > + > + if (verbose) > + printf("%llu:%d\n", > + userino, > + userino > XFS_MAXINUMBER_32 ? 64 : 32); > + else > + /* Inode in use */ > + printf("%llu\n", userino); > + return 0; > + > + /* -n option must not be used stand alone */ > + } else if (ret_next) { > + return command_usage(&inode_cmd); > + } > + > + bulkreq.lastip = &last; > + bulkreq.icount = 1024; /* User-defined maybe!? */ > + bulkreq.ubuffer = &igroup; > + bulkreq.ocount = &count; > + > + for (;;) { > + if (xfsctl(file->name, file->fd, XFS_IOC_FSINUMBERS, > + &bulkreq)) { > + perror("XFS_IOC_FSINUMBERS"); > + exitcode = 1; > + return 0; > + } > + > + if (count == 0) > + break; > + > + lastgrp = count; > + } > + > + lastgrp--; > + lastino = igroup[lastgrp].xi_startino + > + xfs_highbit64(igroup[lastgrp].xi_allocmask); > + > + if (verbose) > + printf("%llu:%d\n", lastino, > + lastino > XFS_MAXINUMBER_32 ? 64 : 32); > + else > + printf("%d\n", lastino > XFS_MAXINUMBER_32 ? 1 : 0); > + > + return 0; > +} > + > void > open_init(void) > { > @@ -815,6 +954,16 @@ open_init(void) > _("get/set preferred extent size (in bytes) for the open file"); > extsize_cmd.help = extsize_help; > > + inode_cmd.name = "inode"; > + inode_cmd.cfunc = inode_f; > + inode_cmd.args = _("[-n | -v] [num]"); > + inode_cmd.argmin = 0; > + inode_cmd.argmax = 2; > + inode_cmd.flags = CMD_NOMAP_OK; > + inode_cmd.oneline = > + _("Query inode number usage in the filesystem"); > + inode_cmd.help = inode_help; > + > add_command(&open_cmd); > add_command(&stat_cmd); > add_command(&close_cmd); > @@ -822,4 +971,5 @@ open_init(void) > add_command(&chproj_cmd); > add_command(&lsproj_cmd); > add_command(&extsize_cmd); > + add_command(&inode_cmd); > } > -- > 2.4.3 > > _______________________________________________ > xfs mailing list > xfs@oss.sgi.com > http://oss.sgi.com/mailman/listinfo/xfs From sandeen@redhat.com Thu Feb 18 14:55:35 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=ham version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay1.corp.sgi.com [137.38.102.111]) by oss.sgi.com (Postfix) with ESMTP id 421D87CA5 for ; Thu, 18 Feb 2016 14:55:35 -0600 (CST) Received: from cuda.sgi.com (cuda3.sgi.com [192.48.176.15]) by relay1.corp.sgi.com (Postfix) with ESMTP id 276F48F8035 for ; Thu, 18 Feb 2016 12:55:31 -0800 (PST) X-ASG-Debug-ID: 1455828930-04cb6c7708414c0001-NocioJ Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by cuda.sgi.com with ESMTP id HNZojcjBtOHv8WM4 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO) for ; Thu, 18 Feb 2016 12:55:31 -0800 (PST) X-Barracuda-Envelope-From: sandeen@redhat.com X-Barracuda-Apparent-Source-IP: 209.132.183.28 X-ASG-Whitelist: Client Received: from int-mx13.intmail.prod.int.phx2.redhat.com (int-mx13.intmail.prod.int.phx2.redhat.com [10.5.11.26]) by mx1.redhat.com (Postfix) with ESMTPS id A012EC00FBB0 for ; Thu, 18 Feb 2016 20:55:30 +0000 (UTC) Received: from liberator.sandeen.net (ovpn01.gateway.prod.ext.phx2.redhat.com [10.5.9.1]) by int-mx13.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id u1IKtT2r004011 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Thu, 18 Feb 2016 15:55:30 -0500 To: xfs@oss.sgi.com From: Eric Sandeen Subject: [PATCH] libxfs: fix up mismerge in libxfs_iflush_int Message-ID: <56C62FC1.60205@redhat.com> X-ASG-Orig-Subj: [PATCH] libxfs: fix up mismerge in libxfs_iflush_int Date: Thu, 18 Feb 2016 14:55:29 -0600 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.11; rv:38.0) Gecko/20100101 Thunderbird/38.6.0 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-Scanned-By: MIMEDefang 2.68 on 10.5.11.26 X-Barracuda-Connect: mx1.redhat.com[209.132.183.28] X-Barracuda-Start-Time: 1455828931 X-Barracuda-Encrypted: ECDHE-RSA-AES256-GCM-SHA384 X-Barracuda-URL: https://192.48.176.15:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-BRTS-Status: 1 XFS_ISDIR is a bool, don't compare it to S_IFDIR e37bf5 xfs: mode di_mode to vfs inode had a small mis-merge from kernelspace, when moving from if ((ip->i_d.di_mode & S_IFMT) == S_IFDIR) to if (XFS_ISDIR(ip) == S_IFDIR that "==" should have been dropped. Signed-off-by: ERic Sandeen --- diff --git a/libxfs/util.c b/libxfs/util.c index 576f954..f3b9895 100644 --- a/libxfs/util.c +++ b/libxfs/util.c @@ -420,7 +420,7 @@ libxfs_iflush_int(xfs_inode_t *ip, xfs_buf_t *bp) if (XFS_ISREG(ip)) { ASSERT( (ip->i_d.di_format == XFS_DINODE_FMT_EXTENTS) || (ip->i_d.di_format == XFS_DINODE_FMT_BTREE) ); - } else if (XFS_ISDIR(ip) == S_IFDIR) { + } else if (XFS_ISDIR(ip)) { ASSERT( (ip->i_d.di_format == XFS_DINODE_FMT_EXTENTS) || (ip->i_d.di_format == XFS_DINODE_FMT_BTREE) || (ip->i_d.di_format == XFS_DINODE_FMT_LOCAL) ); From sandeen@sandeen.net Thu Feb 18 16:59:09 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=ham version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay2.corp.sgi.com [137.38.102.29]) by oss.sgi.com (Postfix) with ESMTP id 8C7517CA5 for ; Thu, 18 Feb 2016 16:59:09 -0600 (CST) Received: from cuda.sgi.com (cuda2.sgi.com [192.48.176.25]) by relay2.corp.sgi.com (Postfix) with ESMTP id 7D1D7304032 for ; Thu, 18 Feb 2016 14:59:06 -0800 (PST) X-ASG-Debug-ID: 1455836332-04cbb0479e77d70001-NocioJ Received: from sandeen.net (sandeen.net [63.231.237.45]) by cuda.sgi.com with ESMTP id DjXSORrvy6HLDWHm for ; Thu, 18 Feb 2016 14:58:53 -0800 (PST) X-Barracuda-Envelope-From: sandeen@sandeen.net X-Barracuda-Apparent-Source-IP: 63.231.237.45 Received: from liberator.sandeen.net (liberator.sandeen.net [10.0.0.4]) (using TLSv1.2 with cipher DHE-RSA-AES128-SHA (128/128 bits)) (No client certificate requested) by sandeen.net (Postfix) with ESMTPSA id A292165E4189 for ; Thu, 18 Feb 2016 16:58:52 -0600 (CST) Subject: Re: [PATCH] libxfs: fix up mismerge in libxfs_iflush_int To: xfs@oss.sgi.com X-ASG-Orig-Subj: Re: [PATCH] libxfs: fix up mismerge in libxfs_iflush_int References: <56C62FC1.60205@redhat.com> From: Eric Sandeen Message-ID: <56C64CAB.8020607@sandeen.net> Date: Thu, 18 Feb 2016 16:58:51 -0600 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.11; rv:38.0) Gecko/20100101 Thunderbird/38.6.0 MIME-Version: 1.0 In-Reply-To: <56C62FC1.60205@redhat.com> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit X-Barracuda-Connect: sandeen.net[63.231.237.45] X-Barracuda-Start-Time: 1455836332 X-Barracuda-URL: https://192.48.176.25:443/cgi-mod/mark.cgi X-Barracuda-BRTS-Status: 1 X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-Spam-Score: 0.00 X-Barracuda-Spam-Status: No, SCORE=0.00 using per-user scores of TAG_LEVEL=1000.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.7 tests= X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.3.27145 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- Oh, if you think of it, you can note that this is coverity ID 1353345 in the changelog as well; not sure we care too much about that, but *shrug* -Eric On 2/18/16 2:55 PM, Eric Sandeen wrote: > XFS_ISDIR is a bool, don't compare it to S_IFDIR > > e37bf5 xfs: mode di_mode to vfs inode had a small mis-merge > from kernelspace, when moving from > > if ((ip->i_d.di_mode & S_IFMT) == S_IFDIR) > to > if (XFS_ISDIR(ip) == S_IFDIR > > that "==" should have been dropped. > > Signed-off-by: ERic Sandeen > --- > > diff --git a/libxfs/util.c b/libxfs/util.c > index 576f954..f3b9895 100644 > --- a/libxfs/util.c > +++ b/libxfs/util.c > @@ -420,7 +420,7 @@ libxfs_iflush_int(xfs_inode_t *ip, xfs_buf_t *bp) > if (XFS_ISREG(ip)) { > ASSERT( (ip->i_d.di_format == XFS_DINODE_FMT_EXTENTS) || > (ip->i_d.di_format == XFS_DINODE_FMT_BTREE) ); > - } else if (XFS_ISDIR(ip) == S_IFDIR) { > + } else if (XFS_ISDIR(ip)) { > ASSERT( (ip->i_d.di_format == XFS_DINODE_FMT_EXTENTS) || > (ip->i_d.di_format == XFS_DINODE_FMT_BTREE) || > (ip->i_d.di_format == XFS_DINODE_FMT_LOCAL) ); > > _______________________________________________ > xfs mailing list > xfs@oss.sgi.com > http://oss.sgi.com/mailman/listinfo/xfs > From david@fromorbit.com Fri Feb 19 00:49:43 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=ham version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay1.corp.sgi.com [137.38.102.111]) by oss.sgi.com (Postfix) with ESMTP id 9F16C7CAF for ; Fri, 19 Feb 2016 00:49:43 -0600 (CST) Received: from cuda.sgi.com (cuda1.sgi.com [192.48.157.11]) by relay1.corp.sgi.com (Postfix) with ESMTP id 7314A8F8040 for ; Thu, 18 Feb 2016 22:49:40 -0800 (PST) X-ASG-Debug-ID: 1455864575-04bdf003c597290001-NocioJ Received: from ipmail05.adl6.internode.on.net (ipmail05.adl6.internode.on.net [150.101.137.143]) by cuda.sgi.com with ESMTP id 3XS9Zzxzczt84dYJ for ; Thu, 18 Feb 2016 22:49:35 -0800 (PST) X-Barracuda-Envelope-From: david@fromorbit.com X-Barracuda-Apparent-Source-IP: 150.101.137.143 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: A2DJBgAAusZW/5bY03ZegzpSbaZSAQEBAQEBBotxiVAhhWYEAgKBVk0BAQEBAQFlJ4RCAQEEJwsBIyMQCAMYCSUPBSUDIROIGQ+7eQEBAQEGAQEBAQEXBBiFMoUDgleBXIQ8BYdWjy+FV4d9jnxEjgNiggIZgVwoLgGIOwEBAQ Received: from ppp118-211-216-150.lns20.syd4.internode.on.net (HELO dastard) ([118.211.216.150]) by ipmail05.adl6.internode.on.net with ESMTP; 19 Feb 2016 17:19:34 +1030 Received: from dave by dastard with local (Exim 4.80) (envelope-from ) id 1aWesf-0001s6-0K; Fri, 19 Feb 2016 17:49:33 +1100 Date: Fri, 19 Feb 2016 17:49:32 +1100 From: Dave Chinner To: kernel test robot Cc: Dave Chinner , lkp@01.org, LKML , Christoph Hellwig , xfs@oss.sgi.com Subject: Re: [lkp] [xfs] fbcc025613: -5.6% fsmark.files_per_sec Message-ID: <20160219064932.GX14668@dastard> X-ASG-Orig-Subj: Re: [lkp] [xfs] fbcc025613: -5.6% fsmark.files_per_sec References: <87vb5lqunb.fsf@yhuang-dev.intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <87vb5lqunb.fsf@yhuang-dev.intel.com> User-Agent: Mutt/1.5.21 (2010-09-15) X-Barracuda-Connect: ipmail05.adl6.internode.on.net[150.101.137.143] X-Barracuda-Start-Time: 1455864575 X-Barracuda-URL: https://192.48.157.11:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-BRTS-Status: 1 X-Barracuda-Spam-Score: 0.00 X-Barracuda-Spam-Status: No, SCORE=0.00 using per-user scores of TAG_LEVEL=1000.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.7 tests=BSF_SC0_MISMATCH_TO X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.3.27152 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 0.00 BSF_SC0_MISMATCH_TO Envelope rcpt doesn't match header On Fri, Feb 19, 2016 at 10:52:08AM +0800, kernel test robot wrote: > FYI, we noticed the below changes on > > https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git master > commit fbcc025613590d7b1d15521555dcc6393a148a6b ("xfs: Introduce writeback context for writepages") > > > ========================================================================================= > compiler/cpufreq_governor/disk/filesize/fs/iterations/kconfig/md/nr_threads/rootfs/sync_method/tbox_group/test_size/testcase: > gcc-4.9/performance/8BRD_12G/4M/xfs/1x/x86_64-rhel/RAID0/1t/debian-x86_64-2015-02-07.cgz/fsyncBeforeClose/lkp-hsx02/60G/fsmark > > commit: > 150d5be09ce49a9bed6feb7b7dc4e5ae188778ec > fbcc025613590d7b1d15521555dcc6393a148a6b > > 150d5be09ce49a9b fbcc025613590d7b1d15521555 > ---------------- -------------------------- > %stddev %change %stddev > \ | \ > 36122 0% -57.4% 15404 0% fsmark.time.involuntary_context_switches > 95.30 0% +1.8% 97.00 0% fsmark.time.percent_of_cpu_this_job_got > 25339 32% +5756.0% 1483901 1% fsmark.time.voluntary_context_switches > 881.80 45% +14258.5% 126613 10% latency_stats.hits.wait_on_page_bit.__filemap_fdatawait_range.filemap_fdatawait_range.filemap_write_and_wait_range.xfs_file_fsync.vfs_fsync_range.do_fsync.SyS_fsync.entry_SYSCALL_64_fastpath > 3548 48% +11967.4% 428200 7% latency_stats.sum.wait_on_page_bit.__filemap_fdatawait_range.filemap_fdatawait_range.filemap_write_and_wait_range.xfs_file_fsync.vfs_fsync_range.do_fsync.SyS_fsync.entry_SYSCALL_64_fastpath ..... > 2016-02-17 22:08:15 mount -t xfs -o nobarrier,inode64 /dev/ram0 /fs/ram0 > 2016-02-17 22:08:16 ./fs_mark -d /fs/ram0/1 -n 10240 -L 1 -S 1 -s 4194304 Ok, so 10k x 4MB files, fsync after each. Let me go look. So the problem above appears to be that fsync is waiting on 125,000 more pages to complete IO, causing a major increase in context switches during fsync. With only 10000 files being created, that mores than 10 pages per file that is being waited on. That doesn't really seem right. The writeback should be done as a single ioend, with a single completion, with a single setsize transaction, adn then all the pages are marked clean sequentially. The above behaviour implies we are ending up doing something like: fsync proc io completion wait on page 0 end page 0 writeback wake up page 0 wait on page 1 end page 1 writeback wake up page 1 wait on page 2 end page 2 writeback wake up page 2 Though in slightly larger batches than a single page (10 wakeups a file, so batches of around 100 pages per wakeup?). i.e. the fsync IO wait appears to be racing with IO completion marking pages as done. I simply cannot see how the above change would cause that, as it was simply a change in the IO submission code that doesn't affect overall size or shape of the IOs being submitted. This is a patch in the middle of a larger patch set - if any of the patches in that series should affect behaviour, it's the commit a couple further that removed the XFS page clustering code - that changes the size and shape of the ioends and bios we build and submit and so if anything is perturbing Io completion behaviour I'd expect those to be the culprit.... Does this same problem context switch problem still exist when the entire set of patches in the XFs series has been applied? I can't reproduce it here locally with the entire series applied, but I have only tested on 16p with 48GB RAM. The context switch rate does not go above 3,000/s, regardless of whether I use a ramdisk or high throughput SSDs. Tracing also clearly indicates a single 4MB ioend is being build and submitted by the new code and so that implies that the io completions that are occuring before and after this patchset are identical, and so therefore the way pages are moving from dirty -> writeback -> clean is identical before and after the patch series. So, like I said - this makes no sense to me from the perspective of the change that you've bisected it down to. This smells to me of a scheduler change in the linux-next tree, espcially as I can't reproduce the behaviour with just the XFS commits in isolation on a 4.5-rc3 tree. Cheers, Dave. -- Dave Chinner david@fromorbit.com From jtulak@redhat.com Fri Feb 19 07:35:16 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=HTML_MESSAGE autolearn=ham version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay2.corp.sgi.com [137.38.102.29]) by oss.sgi.com (Postfix) with ESMTP id 82BFA7F47 for ; Fri, 19 Feb 2016 07:35:16 -0600 (CST) Received: from cuda.sgi.com (cuda2.sgi.com [192.48.176.25]) by relay2.corp.sgi.com (Postfix) with ESMTP id 6269D304051 for ; Fri, 19 Feb 2016 05:35:13 -0800 (PST) X-ASG-Debug-ID: 1455888912-04cbb047a09ded0001-NocioJ Received: from mail-io0-f171.google.com (mail-io0-f171.google.com [209.85.223.171]) by cuda.sgi.com with ESMTP id Z1CwjmQcg20iUPQV (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128 verify=NO) for ; Fri, 19 Feb 2016 05:35:12 -0800 (PST) X-Barracuda-Envelope-From: jtulak@redhat.com X-Barracuda-RBL-Trusted-Forwarder: 209.85.223.171 Received: by mail-io0-f171.google.com with SMTP id 9so109156419iom.1 for ; Fri, 19 Feb 2016 05:35:12 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:from:date:message-id:subject:to :content-type; bh=0V5xfpZaptdawy7XADNpMqiMael7jiktfPd7e9v8Olo=; b=SCBtkllL8IGRADEwl6+gIsEv0aBOiYVaMGVnejyJHAy14/bFfnPBFRo6NHeUGnLOq3 vEAhm6Fs+gTyqGKgcWS0yx98STjFYEUewLUvBT0SSBJJ6tC5uieDpuEYsqGWRPM1/y4l zWcuWnRajQtIznDuMO2n3FFj+IEP0HzjqNyAgXYaIrQYybn8Fh30ouxiHMujKLZ5EYTN XfaHasOtSWqIRBhiFkxZalWkC5bde1OoC/+fjaoONC1AyuFPar9YKJFz0pr1SBded3Gs HycFanXGzGF7x3YvFyn9QBO0voS323tt7RISpjMhArq/2Ew6VxZLXrQ6AP60If4Wzz/f Wmpg== X-Gm-Message-State: AG10YOTvxbfDCdxAC4RF0V+mzM90THHq/Ei7aNPxCMoerXks9RGWj1mRvypTr+1QCH3AlnKApGVPeA4KGG0+eesz X-Received: by 10.107.170.79 with SMTP id t76mr17917260ioe.71.1455888911830; Fri, 19 Feb 2016 05:35:11 -0800 (PST) MIME-Version: 1.0 Received: by 10.36.58.142 with HTTP; Fri, 19 Feb 2016 05:34:52 -0800 (PST) From: Jan Tulak Date: Fri, 19 Feb 2016 14:34:52 +0100 Message-ID: Subject: What is the meaning of XLOG_MIN_RECORD_BSIZE? (Missing a check?) To: xfs-oss X-ASG-Orig-Subj: What is the meaning of XLOG_MIN_RECORD_BSIZE? (Missing a check?) Content-Type: multipart/alternative; boundary=001a114157c66c3daf052c1f8d19 X-Barracuda-Connect: mail-io0-f171.google.com[209.85.223.171] X-Barracuda-Start-Time: 1455888912 X-Barracuda-Encrypted: ECDHE-RSA-AES128-GCM-SHA256 X-Barracuda-URL: https://192.48.176.25:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-BRTS-Status: 1 X-Barracuda-Spam-Score: 0.00 X-Barracuda-Spam-Status: No, SCORE=0.00 using per-user scores of TAG_LEVEL=1000.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.7 tests=HTML_MESSAGE X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.3.27159 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 0.00 HTML_MESSAGE BODY: HTML included in message --001a114157c66c3daf052c1f8d19 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Hi guys, what is the meaning of XLOG_MIN_RECORD_BSIZE in libxfs/xfs_log_format.h? It is not used anywhere. I thought it might be related to -l su/sunit option, but seeing tests with -l su=3D4096 (the macro is set to 16k), it looks more like a forgotten value. There is no check for a minimal value, so I can do -l su=3D1 (or su=3D0). A= re there some caveat=E2=80=8Bs (other than performance) with such a small valu= e? Can it be that we are missing a check? Because XLOG_BIG_RECORD_BSIZE =E2=80=8B and XLOG_MAX_RECORD_BSIZE are used and the upper bound is limited= .=E2=80=8B.. =E2=80=8BThanks=E2=80=8B. Cheers, Jan --=20 Jan Tulak jtulak@redhat.com / jan@tulak.me --001a114157c66c3daf052c1f8d19 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
Hi guys,

what is the meaning of=C2= =A0XLOG_MIN_RECORD_BSIZE in=C2=A0libxfs/xfs_log_format.h?
It is n= ot used anywhere. I thought it might be related to -l su/sunit option, but = seeing tests with -l su=3D4096 (the macro is set to 16k), it looks more lik= e a forgotten value.=C2=A0

There is no check fo= r a minimal value, so I can do -l su=3D1 (or su=3D0). Are there some caveat= =E2=80=8Bs (other than performance) with such a small value? Can it be that= we are missing a check? Because=C2=A0
XLOG_BIG_RECORD_BSIZE
=E2=80=8B and XLOG_MAX_RECORD_BSIZE are used and the upper bound is= limited.=E2=80=8B..


=E2=80=8BThanks= =E2=80=8B.

Cheers,
Jan

--
--001a114157c66c3daf052c1f8d19-- From tdm@sgi.com Fri Feb 19 09:23:02 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=RP_MATCHES_RCVD autolearn=ham version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay3.corp.sgi.com [198.149.34.15]) by oss.sgi.com (Postfix) with ESMTP id C05037CA1 for ; Fri, 19 Feb 2016 09:23:02 -0600 (CST) Received: from estes.americas.sgi.com (estes.americas.sgi.com [128.162.236.10]) by relay3.corp.sgi.com (Postfix) with ESMTP id 337F8AC001 for ; Fri, 19 Feb 2016 07:22:56 -0800 (PST) Received: from [128.162.232.11] (porter.americas.sgi.com [128.162.232.11]) by estes.americas.sgi.com (Postfix) with ESMTP id 8B38E70006EB for ; Fri, 19 Feb 2016 09:22:55 -0600 (CST) Message-ID: <56C7334F.1070203@sgi.com> Date: Fri, 19 Feb 2016 09:22:55 -0600 From: Troy McCorkell User-Agent: Mozilla/5.0 (X11; U; Linux i686 (x86_64); en-US; rv:1.9.1.5) Gecko/20091204 Thunderbird/3.0 MIME-Version: 1.0 To: "xfs@oss.sgi.com" Subject: test - please ignore Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit From bfoster@redhat.com Fri Feb 19 09:44:08 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=ham version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay3.corp.sgi.com [198.149.34.15]) by oss.sgi.com (Postfix) with ESMTP id 0E3E07CA0 for ; Fri, 19 Feb 2016 09:44:08 -0600 (CST) Received: from cuda.sgi.com (cuda3.sgi.com [192.48.176.15]) by relay3.corp.sgi.com (Postfix) with ESMTP id 843FDAC002 for ; Fri, 19 Feb 2016 07:44:01 -0800 (PST) X-ASG-Debug-ID: 1455896630-04cb6c770571470001-NocioJ Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by cuda.sgi.com with ESMTP id otxQuTUPV7shi2YH (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO) for ; Fri, 19 Feb 2016 07:43:51 -0800 (PST) X-Barracuda-Envelope-From: bfoster@redhat.com X-Barracuda-Apparent-Source-IP: 209.132.183.28 X-ASG-Whitelist: Client Received: from int-mx09.intmail.prod.int.phx2.redhat.com (int-mx09.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by mx1.redhat.com (Postfix) with ESMTPS id AB3E78EFE6 for ; Fri, 19 Feb 2016 15:43:50 +0000 (UTC) Received: from bfoster.bfoster (dhcp-41-22.bos.redhat.com [10.18.41.22]) by int-mx09.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id u1JFho2u023470; Fri, 19 Feb 2016 10:43:50 -0500 Received: by bfoster.bfoster (Postfix, from userid 1000) id 461F612596E; Fri, 19 Feb 2016 10:43:49 -0500 (EST) Date: Fri, 19 Feb 2016 10:43:49 -0500 From: Brian Foster To: Jan Tulak Cc: xfs-oss Subject: Re: What is the meaning of XLOG_MIN_RECORD_BSIZE? (Missing a check?) Message-ID: <20160219154347.GA27263@bfoster.bfoster> X-ASG-Orig-Subj: Re: What is the meaning of XLOG_MIN_RECORD_BSIZE? (Missing a check?) References: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: User-Agent: Mutt/1.5.24 (2015-08-30) X-Scanned-By: MIMEDefang 2.68 on 10.5.11.22 X-Barracuda-Connect: mx1.redhat.com[209.132.183.28] X-Barracuda-Start-Time: 1455896631 X-Barracuda-Encrypted: ECDHE-RSA-AES256-GCM-SHA384 X-Barracuda-URL: https://192.48.176.15:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-BRTS-Status: 1 On Fri, Feb 19, 2016 at 02:34:52PM +0100, Jan Tulak wrote: > Hi guys, > > what is the meaning of XLOG_MIN_RECORD_BSIZE in libxfs/xfs_log_format.h? > It is not used anywhere. I thought it might be related to -l su/sunit > option, but seeing tests with -l su=4096 (the macro is set to 16k), it > looks more like a forgotten value. > It's the minimum log buffer size allowed in the kernel. It's used in xfs_super.c at mount time to validate the logbsize option: if (mp->m_logbsize != -1 && mp->m_logbsize != 0 && (mp->m_logbsize < XLOG_MIN_RECORD_BSIZE || mp->m_logbsize > XLOG_MAX_RECORD_BSIZE || !is_power_of_2(mp->m_logbsize))) { xfs_warn(mp, "invalid logbufsize: %d [not 16k,32k,64k,128k or 256k]", mp->m_logbsize); return -EINVAL; } I suspect it's not relevant in userspace. > There is no check for a minimal value, so I can do -l su=1 (or su=0). Are > there some caveat​s (other than performance) with such a small value? Can > it be that we are missing a check? Because > XLOG_BIG_RECORD_BSIZE > ​ and XLOG_MAX_RECORD_BSIZE are used and the upper bound is limited.​.. > On a quick test, it looks like mkfs just ignores certain log stripe unit values that aren't block aligned. I'd probably expect this to behave similar to the '-d su' option and complain about invalid input..? Brian > > ​Thanks​. > > Cheers, > Jan > > -- > Jan Tulak > jtulak@redhat.com / jan@tulak.me > _______________________________________________ > xfs mailing list > xfs@oss.sgi.com > http://oss.sgi.com/mailman/listinfo/xfs From jtulak@redhat.com Fri Feb 19 10:16:55 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=HTML_MESSAGE autolearn=ham version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay2.corp.sgi.com [137.38.102.29]) by oss.sgi.com (Postfix) with ESMTP id 4221C7CA3 for ; Fri, 19 Feb 2016 10:16:55 -0600 (CST) Received: from cuda.sgi.com (cuda3.sgi.com [192.48.176.15]) by relay2.corp.sgi.com (Postfix) with ESMTP id 275DA304039 for ; Fri, 19 Feb 2016 08:16:49 -0800 (PST) X-ASG-Debug-ID: 1455898607-04cb6c770575ea0001-NocioJ Received: from mail-io0-f176.google.com (mail-io0-f176.google.com [209.85.223.176]) by cuda.sgi.com with ESMTP id 3uyIMNDRn7ddkvSz (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128 verify=NO) for ; Fri, 19 Feb 2016 08:16:47 -0800 (PST) X-Barracuda-Envelope-From: jtulak@redhat.com X-Barracuda-RBL-Trusted-Forwarder: 209.85.223.176 Received: by mail-io0-f176.google.com with SMTP id g203so114277800iof.2 for ; Fri, 19 Feb 2016 08:16:47 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc:content-type; bh=KK9cNhf28lTVg/U0sdL8O2UO2MkvplkZRO9FGXiNgmI=; b=OORz5H+J0grz7ue3tPkNWoANJTmWoHWhbaurSo2umhQSLF77QUX6lUKKUNEQRJaniL 3Px0Oq7+0IsiW1JChzaZeeM8OY8f1ED4BNCbrwMaXmeXQ/Y7tBJT0qM6XDEOMMwxKZLW 8M/sfx0rt3JbI/XG5vd0eN3ROJ0c5xcIbmkjVOKEqxxXRACuhUnjE0P/amemxFaF79B9 YJYHxPBLtKbwgcgO10FQa6/pQeQWKG6xfGihl5MM+TZoGdbXySBzhrZfWulUej73YMHE u2P9u+Uh3G//jz+g2EcyxcDUBaAN1hNeLXVjwikXI2L0SYnJfrGCX25+9pyXwZwh+S8W HuMg== X-Gm-Message-State: AG10YORj/bf4+nKgt6ya7fr6pbc28z6IyAtH2CG7dcyCgt9CdXkqNIylMFov9rYWn4cJaLWgRDzdwQZgDAF5ERXI X-Received: by 10.107.170.79 with SMTP id t76mr18832772ioe.71.1455898607449; Fri, 19 Feb 2016 08:16:47 -0800 (PST) MIME-Version: 1.0 Received: by 10.36.58.142 with HTTP; Fri, 19 Feb 2016 08:16:28 -0800 (PST) In-Reply-To: <20160219154347.GA27263@bfoster.bfoster> References: <20160219154347.GA27263@bfoster.bfoster> From: Jan Tulak Date: Fri, 19 Feb 2016 17:16:28 +0100 Message-ID: Subject: Re: What is the meaning of XLOG_MIN_RECORD_BSIZE? (Missing a check?) To: Brian Foster X-ASG-Orig-Subj: Re: What is the meaning of XLOG_MIN_RECORD_BSIZE? (Missing a check?) Cc: xfs-oss Content-Type: multipart/alternative; boundary=001a114157c6539612052c21cf27 X-Barracuda-Connect: mail-io0-f176.google.com[209.85.223.176] X-Barracuda-Start-Time: 1455898607 X-Barracuda-Encrypted: ECDHE-RSA-AES128-GCM-SHA256 X-Barracuda-URL: https://192.48.176.15:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-BRTS-Status: 1 X-Barracuda-Spam-Score: 0.01 X-Barracuda-Spam-Status: No, SCORE=0.01 using per-user scores of TAG_LEVEL=1000.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.7 tests=BSF_SC0_MISMATCH_TO, BSF_SC0_SA_TO_FROM_DOMAIN_MATCH, HTML_MESSAGE X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.3.27162 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 0.00 BSF_SC0_MISMATCH_TO Envelope rcpt doesn't match header 0.00 HTML_MESSAGE BODY: HTML included in message 0.01 BSF_SC0_SA_TO_FROM_DOMAIN_MATCH Sender Domain Matches Recipient Domain --001a114157c6539612052c21cf27 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable On Fri, Feb 19, 2016 at 4:43 PM, Brian Foster wrote: > On Fri, Feb 19, 2016 at 02:34:52PM +0100, Jan Tulak wrote: > > Hi guys, > > > > what is the meaning of XLOG_MIN_RECORD_BSIZE in libxfs/xfs_log_format.h= ? > > It is not used anywhere. I thought it might be related to -l su/sunit > > option, but seeing tests with -l su=3D4096 (the macro is set to 16k), i= t > > looks more like a forgotten value. > > > > It's the minimum log buffer size allowed in the kernel. It's used in > xfs_super.c at mount time to validate the logbsize option: > > if (mp->m_logbsize !=3D -1 && > mp->m_logbsize !=3D 0 && > (mp->m_logbsize < XLOG_MIN_RECORD_BSIZE || > mp->m_logbsize > XLOG_MAX_RECORD_BSIZE || > !is_power_of_2(mp->m_logbsize))) { > xfs_warn(mp, > "invalid logbufsize: %d [not 16k,32k,64k,128k or > 256k]", > mp->m_logbsize); > return -EINVAL; > } > > I suspect it's not relevant in userspace. > This is ok, then. Thank you for pointing me to kernel space, I didn't realised I should check it there too. :-) =E2=80=8B > > > There is no check for a minimal value, so I can do -l su=3D1 (or su=3D0= ). Are > > there some caveat=E2=80=8Bs (other than performance) with such a small = value? Can > > it be that we are missing a check? Because > > XLOG_BIG_RECORD_BSIZE > > =E2=80=8B and XLOG_MAX_RECORD_BSIZE are used and the upper bound is lim= ited.=E2=80=8B.. > > > > On a quick test, it looks like mkfs just ignores certain log stripe unit > values that aren't block aligned. I'd probably expect this to behave > similar to the '-d su' option and complain about invalid input..? > =E2=80=8BSounds logical and like what I expected and didn't found. I will s= end a patch adding this check... the only question is, what should be the minimal value? Should I check it against block size and forbid smaller sizes? Aligning a stripe unit with length 1024 on 4096 blocks doesn't looks like a nice thing. :-) (And on a quick check, it seems that -d su is doing just that.) Thanks, Jan --=20 Jan Tulak jtulak@redhat.com / jan@tulak.me --001a114157c6539612052c21cf27 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
On Fri, Fe= b 19, 2016 at 4:43 PM, Brian Foster <bfoster@redhat.com> wrote:
On Fri, Feb 19, 2016= at 02:34:52PM +0100, Jan Tulak wrote:
> Hi guys,
>
> what is the meaning of XLOG_MIN_RECORD_BSIZE in libxfs/xfs_log_format.= h?
> It is not used anywhere. I thought it might be related to -l su/sunit<= br> > option, but seeing tests with -l su=3D4096 (the macro is set to 16k), = it
> looks more like a forgotten value.
>

It's the minimum log buffer size allowed in the kernel. It's= used in
xfs_super.c at mount time to validate the logbsize option:

=C2=A0 =C2=A0 =C2=A0 =C2=A0 if (mp->m_logbsize !=3D -1 &&
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 mp->m_logbsize !=3D=C2=A0 0 &a= mp;&
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 (mp->m_logbsize < XLOG_MIN_= RECORD_BSIZE ||
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0mp->m_logbsize > XLOG= _MAX_RECORD_BSIZE ||
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0!is_power_of_2(mp->m_log= bsize))) {
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 xfs_warn(mp,
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 "invalid logbufsize: %d [not 16k,32k,64k,128k or 256k]"= ;,
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 mp->m_logbsize);
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 return -EINVAL;
=C2=A0 =C2=A0 =C2=A0 =C2=A0 }

I suspect it's not relevant in userspace.

This is ok, then. Thank you for pointing me to ker= nel space, I didn't realised I should check it there too. :-)
=E2=80=8B
=C2=A0

> There is no check for a minimal value, so I can do -l su=3D1 (or su=3D= 0). Are
> there some caveat=E2=80=8Bs (other than performance) with such a small= value? Can
> it be that we are missing a check? Because
> XLOG_BIG_RECORD_BSIZE
> =E2=80=8B and XLOG_MAX_RECORD_BSIZE are used and the upper bound is li= mited.=E2=80=8B..
>

On a quick test, it looks like mkfs just ignores certain log stripe = unit
values that aren't block aligned. I'd probably expect this to behav= e
similar to the '-d su' option and complain about invalid input..?

=E2=80=8BSounds logica= l and like what I expected and didn't found. I will send a patch adding= this check... the only question is, what should be the minimal value? Shou= ld I check it against block size and forbid smaller sizes? Aligning a strip= e unit with length 1024 on 4096 blocks doesn't looks like a nice thing.= :-)
(And on a quick check, it seems that= -d su is doing just that.)

Thanks,
Jan

--
--001a114157c6539612052c21cf27-- From bfoster@redhat.com Fri Feb 19 10:29:29 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=ham version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay1.corp.sgi.com [137.38.102.111]) by oss.sgi.com (Postfix) with ESMTP id 72B047CA5 for ; Fri, 19 Feb 2016 10:29:29 -0600 (CST) Received: from cuda.sgi.com (cuda3.sgi.com [192.48.176.15]) by relay1.corp.sgi.com (Postfix) with ESMTP id 641518F8052 for ; Fri, 19 Feb 2016 08:29:23 -0800 (PST) X-ASG-Debug-ID: 1455899355-04cb6c7705770b0001-NocioJ Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by cuda.sgi.com with ESMTP id D3uA7vYMo9Wx1WkF (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO) for ; Fri, 19 Feb 2016 08:29:15 -0800 (PST) X-Barracuda-Envelope-From: bfoster@redhat.com X-Barracuda-Apparent-Source-IP: 209.132.183.28 X-ASG-Whitelist: Client Received: from int-mx09.intmail.prod.int.phx2.redhat.com (int-mx09.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by mx1.redhat.com (Postfix) with ESMTPS id 111FB2DC36C for ; Fri, 19 Feb 2016 16:29:15 +0000 (UTC) Received: from bfoster.bfoster (dhcp-41-22.bos.redhat.com [10.18.41.22]) by int-mx09.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id u1JGTEbN028800; Fri, 19 Feb 2016 11:29:14 -0500 Received: by bfoster.bfoster (Postfix, from userid 1000) id 81FEA12596E; Fri, 19 Feb 2016 11:29:13 -0500 (EST) Date: Fri, 19 Feb 2016 11:29:13 -0500 From: Brian Foster To: Jan Tulak Cc: xfs-oss Subject: Re: What is the meaning of XLOG_MIN_RECORD_BSIZE? (Missing a check?) Message-ID: <20160219162913.GC27263@bfoster.bfoster> X-ASG-Orig-Subj: Re: What is the meaning of XLOG_MIN_RECORD_BSIZE? (Missing a check?) References: <20160219154347.GA27263@bfoster.bfoster> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: User-Agent: Mutt/1.5.24 (2015-08-30) X-Scanned-By: MIMEDefang 2.68 on 10.5.11.22 X-Barracuda-Connect: mx1.redhat.com[209.132.183.28] X-Barracuda-Start-Time: 1455899355 X-Barracuda-Encrypted: ECDHE-RSA-AES256-GCM-SHA384 X-Barracuda-URL: https://192.48.176.15:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-BRTS-Status: 1 On Fri, Feb 19, 2016 at 05:16:28PM +0100, Jan Tulak wrote: > On Fri, Feb 19, 2016 at 4:43 PM, Brian Foster wrote: > > > On Fri, Feb 19, 2016 at 02:34:52PM +0100, Jan Tulak wrote: > > > Hi guys, > > > > > > what is the meaning of XLOG_MIN_RECORD_BSIZE in libxfs/xfs_log_format.h? > > > It is not used anywhere. I thought it might be related to -l su/sunit > > > option, but seeing tests with -l su=4096 (the macro is set to 16k), it > > > looks more like a forgotten value. > > > > > > > It's the minimum log buffer size allowed in the kernel. It's used in > > xfs_super.c at mount time to validate the logbsize option: > > > > if (mp->m_logbsize != -1 && > > mp->m_logbsize != 0 && > > (mp->m_logbsize < XLOG_MIN_RECORD_BSIZE || > > mp->m_logbsize > XLOG_MAX_RECORD_BSIZE || > > !is_power_of_2(mp->m_logbsize))) { > > xfs_warn(mp, > > "invalid logbufsize: %d [not 16k,32k,64k,128k or > > 256k]", > > mp->m_logbsize); > > return -EINVAL; > > } > > > > I suspect it's not relevant in userspace. > > > > This is ok, then. Thank you for pointing me to kernel space, I didn't > realised I should check it there too. :-) > ​ > > > > > > > There is no check for a minimal value, so I can do -l su=1 (or su=0). Are > > > there some caveat​s (other than performance) with such a small value? Can > > > it be that we are missing a check? Because > > > XLOG_BIG_RECORD_BSIZE > > > ​ and XLOG_MAX_RECORD_BSIZE are used and the upper bound is limited.​.. > > > > > > > On a quick test, it looks like mkfs just ignores certain log stripe unit > > values that aren't block aligned. I'd probably expect this to behave > > similar to the '-d su' option and complain about invalid input..? > > > > ​Sounds logical and like what I expected and didn't found. I will send a > patch adding this check... the only question is, what should be the minimal > value? Should I check it against block size and forbid smaller sizes? > Aligning a stripe unit with length 1024 on 4096 blocks doesn't looks like a > nice thing. :-) > (And on a quick check, it seems that -d su is doing just that.) > The man page says it must be a multiple of the fsb size. Indeed, '-d su' complains about anything that is less than 1 FSB, so I would just go with that. :) Brian > Thanks, > Jan > > -- > Jan Tulak > jtulak@redhat.com / jan@tulak.me > _______________________________________________ > xfs mailing list > xfs@oss.sgi.com > http://oss.sgi.com/mailman/listinfo/xfs From sandeen@sandeen.net Fri Feb 19 11:50:05 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=ham version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay3.corp.sgi.com [198.149.34.15]) by oss.sgi.com (Postfix) with ESMTP id 3348A7C8C for ; Fri, 19 Feb 2016 11:50:05 -0600 (CST) Received: from cuda.sgi.com (cuda1.sgi.com [192.48.157.11]) by relay3.corp.sgi.com (Postfix) with ESMTP id B590AAC003 for ; Fri, 19 Feb 2016 09:49:58 -0800 (PST) X-ASG-Debug-ID: 1455903119-04bdf003c2fc300001-NocioJ Received: from sandeen.net (sandeen.net [63.231.237.45]) by cuda.sgi.com with ESMTP id HGcESNmVoLWUXFnB for ; Fri, 19 Feb 2016 09:31:59 -0800 (PST) X-Barracuda-Envelope-From: sandeen@sandeen.net X-Barracuda-Apparent-Source-IP: 63.231.237.45 Received: from liberator.sandeen.net (liberator.sandeen.net [10.0.0.4]) (using TLSv1.2 with cipher DHE-RSA-AES128-SHA (128/128 bits)) (No client certificate requested) by sandeen.net (Postfix) with ESMTPSA id D5D12620C4C4; Fri, 19 Feb 2016 11:31:58 -0600 (CST) Subject: Re: [PATCH 1/3] quota: Add support for ->get_nextdqblk() for VFS quota To: Jan Kara , linux-fsdevel@vger.kernel.org X-ASG-Orig-Subj: Re: [PATCH 1/3] quota: Add support for ->get_nextdqblk() for VFS quota References: <1454596087-6814-1-git-send-email-jack@suse.cz> <1454596087-6814-2-git-send-email-jack@suse.cz> Cc: ocfs2-devel@oss.oracle.com, Mark Fasheh , Joel Becker , xfs@oss.sgi.com From: Eric Sandeen Message-ID: <56C7518E.4020204@sandeen.net> Date: Fri, 19 Feb 2016 11:31:58 -0600 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.11; rv:38.0) Gecko/20100101 Thunderbird/38.6.0 MIME-Version: 1.0 In-Reply-To: <1454596087-6814-2-git-send-email-jack@suse.cz> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit X-Barracuda-Connect: sandeen.net[63.231.237.45] X-Barracuda-Start-Time: 1455903119 X-Barracuda-URL: https://192.48.157.11:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-BRTS-Status: 1 X-Barracuda-Spam-Score: 0.00 X-Barracuda-Spam-Status: No, SCORE=0.00 using per-user scores of TAG_LEVEL=1000.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.7 tests=BSF_SC0_MISMATCH_TO X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.3.27164 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 0.00 BSF_SC0_MISMATCH_TO Envelope rcpt doesn't match header On 2/4/16 8:28 AM, Jan Kara wrote: > Add infrastructure for supporting get_nextdqblk() callback for VFS > quotas. Translate the operation into a callback to appropriate > filesystem and consequently to quota format callback. > > Signed-off-by: Jan Kara > --- > fs/ext4/super.c | 1 + > fs/quota/dquot.c | 39 +++++++++++++++++++++++++++++++++++++++ > fs/reiserfs/super.c | 1 + > include/linux/quota.h | 3 +++ > include/linux/quotaops.h | 3 +++ > 5 files changed, 47 insertions(+) > > diff --git a/fs/ext4/super.c b/fs/ext4/super.c > index f1b56ff01208..51649f442bf6 100644 > --- a/fs/ext4/super.c > +++ b/fs/ext4/super.c > @@ -1100,6 +1100,7 @@ static const struct dquot_operations ext4_quota_operations = { > .write_info = ext4_write_info, > .alloc_dquot = dquot_alloc, > .destroy_dquot = dquot_destroy, > + .get_next_id = dquot_get_next_id, > }; Hi Jan, doesn't this also need to set: + .get_nextdqblk = dquot_get_next_dqblk, in ext4_qctl_sysfile_operations? Thanks, -Eric From bfoster@redhat.com Fri Feb 19 11:55:18 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=ham version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay1.corp.sgi.com [137.38.102.111]) by oss.sgi.com (Postfix) with ESMTP id DED637C8C for ; Fri, 19 Feb 2016 11:55:18 -0600 (CST) Received: from cuda.sgi.com (cuda3.sgi.com [192.48.176.15]) by relay1.corp.sgi.com (Postfix) with ESMTP id BB7CF8F804C for ; Fri, 19 Feb 2016 09:55:12 -0800 (PST) X-ASG-Debug-ID: 1455904510-04cb6c77087d2f0001-NocioJ Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by cuda.sgi.com with ESMTP id s5yTR2DWK5F3cpWq (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO) for ; Fri, 19 Feb 2016 09:55:11 -0800 (PST) X-Barracuda-Envelope-From: bfoster@redhat.com X-Barracuda-Apparent-Source-IP: 209.132.183.28 X-ASG-Whitelist: Client Received: from int-mx13.intmail.prod.int.phx2.redhat.com (int-mx13.intmail.prod.int.phx2.redhat.com [10.5.11.26]) by mx1.redhat.com (Postfix) with ESMTPS id 6D34A64454 for ; Fri, 19 Feb 2016 17:55:10 +0000 (UTC) Received: from bfoster.bfoster (dhcp-41-22.bos.redhat.com [10.18.41.22]) by int-mx13.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id u1JHtAVR012915; Fri, 19 Feb 2016 12:55:10 -0500 Received: by bfoster.bfoster (Postfix, from userid 1000) id D245F12596E; Fri, 19 Feb 2016 12:55:08 -0500 (EST) Date: Fri, 19 Feb 2016 12:55:08 -0500 From: Brian Foster To: Carlos Maiolino Cc: xfs@oss.sgi.com Subject: Re: [PATCH] xfs_io: implement 'inode' command V6 Message-ID: <20160219175508.GD27263@bfoster.bfoster> X-ASG-Orig-Subj: Re: [PATCH] xfs_io: implement 'inode' command V6 References: <1455814159-14191-1-git-send-email-cmaiolino@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1455814159-14191-1-git-send-email-cmaiolino@redhat.com> User-Agent: Mutt/1.5.24 (2015-08-30) X-Scanned-By: MIMEDefang 2.68 on 10.5.11.26 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.39]); Fri, 19 Feb 2016 17:55:10 +0000 (UTC) X-Barracuda-Connect: mx1.redhat.com[209.132.183.28] X-Barracuda-Start-Time: 1455904511 X-Barracuda-Encrypted: ECDHE-RSA-AES256-GCM-SHA384 X-Barracuda-URL: https://192.48.176.15:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-BRTS-Status: 1 On Thu, Feb 18, 2016 at 05:49:19PM +0100, Carlos Maiolino wrote: > Implements a new xfs_io command, named 'inode', which is supposed to be > used to query information about inode's existence and its physical size > in the filesystem. > > Supported options: > > Default: -- Return true(1) or false(0) if any inode greater than > 32bits has been found in the filesystem > [num] -- Return inode number or 0 if the inode [num] is in use > -n [num] -- Return the next valid inode after [num] > -v -- verbose mode > Display the inode number and its physical size according to the > argument used > > No manpage sent because there were changes in the supported options and its > descriptions. > I'll send the manpage after the options and descriptions are reviewed. > > - Changelog > > V3: > - Merge all 3 patches from the V2 together in a single patch > - Rework of '-n [num]' and 'num' only arguments algorithm > - Argument -n now relies on bulkreq.count to check for next inodes, not > on bstat.bs_ino anymore. > - for loop in ret_lsize or ret_largest case, now relies on count being 0 > to break the loop > > V4: > - Refactor inode_f function to reduce its size and easier logic > - Implement error handlers for invalid command combination (hopefully > all invalid combinations). > - use a single xfs_inogrp array for keep track of inodes > - Fix missing newline in inode_help() > - Rewrite help message in inode_help() > - Fix indentation > > V5: > - Reduce the amount of options > - remove igrp_rec variable, and use igroup[lastgrp] directly to get > information from the last inode groups returned by ioctl > > V6: > - Re-use userino variable to reduce code duplication for command output > - Use verbose option as an extension to another commands > - report usage message when -n option is passed stand-alone > - Refactor command outputs > - Add a few comments to the code > > Signed-off-by: Carlos Maiolino > --- > io/open.c | 150 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ > 1 file changed, 150 insertions(+) > > diff --git a/io/open.c b/io/open.c > index 037843d..5e607f1 100644 ... > + > +static int > +inode_f( > + int argc, > + char **argv) > +{ ... > + > + /* > + * Inode number can be passed with or without extra arguments, so we > + * should handle inode numbers passed by user out of getopt() > + */ > + if (optind < argc) { > + > + if (ret_next) { > + cmd = XFS_IOC_FSBULKSTAT; > + } else { > + if (argc > 2) > + return command_usage(&inode_cmd); FYI, this means one can't do the following: xfs_io -c "inode -v 123" Otherwise it looks good to me: Reviewed-by: Brian Foster > + else > + cmd = XFS_IOC_FSBULKSTAT_SINGLE; > + } > + > + userino = strtoull(argv[optind], &p, 10); > + if ((*p != '\0')) { > + printf(_("[num] must be a numeric value\n")); > + exitcode = 1; > + return 0; > + } > + > + bulkreq.lastip = &userino; > + bulkreq.icount = 1; > + bulkreq.ubuffer = &bstat; > + bulkreq.ocount = &count; > + > + if (xfsctl(file->name, file->fd, cmd, &bulkreq)) { > + if (errno == EINVAL) { > + if (!ret_next) > + printf("0\n"); > + } else { > + perror("xfsctl"); > + } > + exitcode = 1; > + return 0; > + } > + > + if (ret_next) > + userino = bstat.bs_ino; > + > + if (verbose) > + printf("%llu:%d\n", > + userino, > + userino > XFS_MAXINUMBER_32 ? 64 : 32); > + else > + /* Inode in use */ > + printf("%llu\n", userino); > + return 0; > + > + /* -n option must not be used stand alone */ > + } else if (ret_next) { > + return command_usage(&inode_cmd); > + } > + > + bulkreq.lastip = &last; > + bulkreq.icount = 1024; /* User-defined maybe!? */ > + bulkreq.ubuffer = &igroup; > + bulkreq.ocount = &count; > + > + for (;;) { > + if (xfsctl(file->name, file->fd, XFS_IOC_FSINUMBERS, > + &bulkreq)) { > + perror("XFS_IOC_FSINUMBERS"); > + exitcode = 1; > + return 0; > + } > + > + if (count == 0) > + break; > + > + lastgrp = count; > + } > + > + lastgrp--; > + lastino = igroup[lastgrp].xi_startino + > + xfs_highbit64(igroup[lastgrp].xi_allocmask); > + > + if (verbose) > + printf("%llu:%d\n", lastino, > + lastino > XFS_MAXINUMBER_32 ? 64 : 32); > + else > + printf("%d\n", lastino > XFS_MAXINUMBER_32 ? 1 : 0); > + > + return 0; > +} > + > void > open_init(void) > { > @@ -815,6 +954,16 @@ open_init(void) > _("get/set preferred extent size (in bytes) for the open file"); > extsize_cmd.help = extsize_help; > > + inode_cmd.name = "inode"; > + inode_cmd.cfunc = inode_f; > + inode_cmd.args = _("[-n | -v] [num]"); > + inode_cmd.argmin = 0; > + inode_cmd.argmax = 2; > + inode_cmd.flags = CMD_NOMAP_OK; > + inode_cmd.oneline = > + _("Query inode number usage in the filesystem"); > + inode_cmd.help = inode_help; > + > add_command(&open_cmd); > add_command(&stat_cmd); > add_command(&close_cmd); > @@ -822,4 +971,5 @@ open_init(void) > add_command(&chproj_cmd); > add_command(&lsproj_cmd); > add_command(&extsize_cmd); > + add_command(&inode_cmd); > } > -- > 2.4.3 > > _______________________________________________ > xfs mailing list > xfs@oss.sgi.com > http://oss.sgi.com/mailman/listinfo/xfs From jack@suse.cz Fri Feb 19 12:33:29 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=ham version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay1.corp.sgi.com [137.38.102.111]) by oss.sgi.com (Postfix) with ESMTP id 461727C8C for ; Fri, 19 Feb 2016 12:33:29 -0600 (CST) Received: from cuda.sgi.com (cuda2.sgi.com [192.48.176.25]) by relay1.corp.sgi.com (Postfix) with ESMTP id 415EA8F804C for ; Fri, 19 Feb 2016 10:33:23 -0800 (PST) X-ASG-Debug-ID: 1455906800-04cbb0479db5d10001-NocioJ Received: from mx2.suse.de (mx2.suse.de [195.135.220.15]) by cuda.sgi.com with ESMTP id OVTax2GzSZygOlml (version=TLSv1 cipher=ECDHE-RSA-AES256-SHA bits=256 verify=NO) for ; Fri, 19 Feb 2016 10:33:21 -0800 (PST) X-Barracuda-Envelope-From: jack@suse.cz X-Barracuda-Apparent-Source-IP: 195.135.220.15 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay1.suse.de (charybdis-ext.suse.de [195.135.220.254]) by mx2.suse.de (Postfix) with ESMTP id 3F51FAE18; Fri, 19 Feb 2016 18:33:19 +0000 (UTC) Received: by quack.suse.cz (Postfix, from userid 1000) id C6202823D6; Fri, 19 Feb 2016 19:33:42 +0100 (CET) Date: Fri, 19 Feb 2016 19:33:42 +0100 From: Jan Kara To: Eric Sandeen Cc: Jan Kara , linux-fsdevel@vger.kernel.org, ocfs2-devel@oss.oracle.com, Mark Fasheh , Joel Becker , xfs@oss.sgi.com Subject: Re: [PATCH 1/3] quota: Add support for ->get_nextdqblk() for VFS quota Message-ID: <20160219183342.GH30068@quack.suse.cz> X-ASG-Orig-Subj: Re: [PATCH 1/3] quota: Add support for ->get_nextdqblk() for VFS quota References: <1454596087-6814-1-git-send-email-jack@suse.cz> <1454596087-6814-2-git-send-email-jack@suse.cz> <56C7518E.4020204@sandeen.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <56C7518E.4020204@sandeen.net> User-Agent: Mutt/1.5.24 (2015-08-30) X-Barracuda-Connect: mx2.suse.de[195.135.220.15] X-Barracuda-Start-Time: 1455906800 X-Barracuda-Encrypted: ECDHE-RSA-AES256-SHA X-Barracuda-URL: https://192.48.176.25:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-BRTS-Status: 1 X-Barracuda-Spam-Score: 0.00 X-Barracuda-Spam-Status: No, SCORE=0.00 using per-user scores of TAG_LEVEL=1000.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.7 tests=BSF_SC0_MISMATCH_TO X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.3.27166 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 0.00 BSF_SC0_MISMATCH_TO Envelope rcpt doesn't match header On Fri 19-02-16 11:31:58, Eric Sandeen wrote: > > > On 2/4/16 8:28 AM, Jan Kara wrote: > > Add infrastructure for supporting get_nextdqblk() callback for VFS > > quotas. Translate the operation into a callback to appropriate > > filesystem and consequently to quota format callback. > > > > Signed-off-by: Jan Kara > > --- > > fs/ext4/super.c | 1 + > > fs/quota/dquot.c | 39 +++++++++++++++++++++++++++++++++++++++ > > fs/reiserfs/super.c | 1 + > > include/linux/quota.h | 3 +++ > > include/linux/quotaops.h | 3 +++ > > 5 files changed, 47 insertions(+) > > > > diff --git a/fs/ext4/super.c b/fs/ext4/super.c > > index f1b56ff01208..51649f442bf6 100644 > > --- a/fs/ext4/super.c > > +++ b/fs/ext4/super.c > > @@ -1100,6 +1100,7 @@ static const struct dquot_operations ext4_quota_operations = { > > .write_info = ext4_write_info, > > .alloc_dquot = dquot_alloc, > > .destroy_dquot = dquot_destroy, > > + .get_next_id = dquot_get_next_id, > > }; > > Hi Jan, doesn't this also need to set: > > > + .get_nextdqblk = dquot_get_next_dqblk, > > in ext4_qctl_sysfile_operations? Indeed, thanks for catching this. Patch added (with your authorship and sign-off) into my tree and this time I've properly tested Q_GETNEXTQUOTA for ext4 with quota in hidden inodes indeed works (previously I've tested only visible quota files). Honza -- Jan Kara SUSE Labs, CR From sandeen@sandeen.net Fri Feb 19 12:43:29 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=ham version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay1.corp.sgi.com [137.38.102.111]) by oss.sgi.com (Postfix) with ESMTP id F1D697C8C for ; Fri, 19 Feb 2016 12:43:29 -0600 (CST) Received: from cuda.sgi.com (cuda2.sgi.com [192.48.176.25]) by relay1.corp.sgi.com (Postfix) with ESMTP id 01E2F8F8040 for ; Fri, 19 Feb 2016 10:43:23 -0800 (PST) X-ASG-Debug-ID: 1455907394-04cbb0479fb6450001-NocioJ Received: from sandeen.net (sandeen.net [63.231.237.45]) by cuda.sgi.com with ESMTP id klrrHlOpa1DzVIJ3 for ; Fri, 19 Feb 2016 10:43:14 -0800 (PST) X-Barracuda-Envelope-From: sandeen@sandeen.net X-Barracuda-Apparent-Source-IP: 63.231.237.45 Received: from liberator.sandeen.net (liberator.sandeen.net [10.0.0.4]) (using TLSv1.2 with cipher DHE-RSA-AES128-SHA (128/128 bits)) (No client certificate requested) by sandeen.net (Postfix) with ESMTPSA id 21D15620C4C4; Fri, 19 Feb 2016 12:43:14 -0600 (CST) Subject: Re: [PATCH 1/3] quota: Add support for ->get_nextdqblk() for VFS quota To: Jan Kara X-ASG-Orig-Subj: Re: [PATCH 1/3] quota: Add support for ->get_nextdqblk() for VFS quota References: <1454596087-6814-1-git-send-email-jack@suse.cz> <1454596087-6814-2-git-send-email-jack@suse.cz> <56C7518E.4020204@sandeen.net> <20160219183342.GH30068@quack.suse.cz> Cc: linux-fsdevel@vger.kernel.org, ocfs2-devel@oss.oracle.com, Mark Fasheh , Joel Becker , xfs@oss.sgi.com From: Eric Sandeen Message-ID: <56C76241.9020203@sandeen.net> Date: Fri, 19 Feb 2016 12:43:13 -0600 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.11; rv:38.0) Gecko/20100101 Thunderbird/38.6.0 MIME-Version: 1.0 In-Reply-To: <20160219183342.GH30068@quack.suse.cz> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit X-Barracuda-Connect: sandeen.net[63.231.237.45] X-Barracuda-Start-Time: 1455907394 X-Barracuda-URL: https://192.48.176.25:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-BRTS-Status: 1 X-Barracuda-Spam-Score: 0.00 X-Barracuda-Spam-Status: No, SCORE=0.00 using per-user scores of TAG_LEVEL=1000.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.7 tests=BSF_SC0_MISMATCH_TO X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.3.27166 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 0.00 BSF_SC0_MISMATCH_TO Envelope rcpt doesn't match header On 2/19/16 12:33 PM, Jan Kara wrote: > On Fri 19-02-16 11:31:58, Eric Sandeen wrote: >> >> >> On 2/4/16 8:28 AM, Jan Kara wrote: >>> Add infrastructure for supporting get_nextdqblk() callback for VFS >>> quotas. Translate the operation into a callback to appropriate >>> filesystem and consequently to quota format callback. >>> >>> Signed-off-by: Jan Kara >>> --- >>> fs/ext4/super.c | 1 + >>> fs/quota/dquot.c | 39 +++++++++++++++++++++++++++++++++++++++ >>> fs/reiserfs/super.c | 1 + >>> include/linux/quota.h | 3 +++ >>> include/linux/quotaops.h | 3 +++ >>> 5 files changed, 47 insertions(+) >>> >>> diff --git a/fs/ext4/super.c b/fs/ext4/super.c >>> index f1b56ff01208..51649f442bf6 100644 >>> --- a/fs/ext4/super.c >>> +++ b/fs/ext4/super.c >>> @@ -1100,6 +1100,7 @@ static const struct dquot_operations ext4_quota_operations = { >>> .write_info = ext4_write_info, >>> .alloc_dquot = dquot_alloc, >>> .destroy_dquot = dquot_destroy, >>> + .get_next_id = dquot_get_next_id, >>> }; >> >> Hi Jan, doesn't this also need to set: >> >> >> + .get_nextdqblk = dquot_get_next_dqblk, >> >> in ext4_qctl_sysfile_operations? > > Indeed, thanks for catching this. Patch added (with your authorship and > sign-off) into my tree and this time I've properly tested Q_GETNEXTQUOTA > for ext4 with quota in hidden inodes indeed works (previously I've tested > only visible quota files). Thanks Jan, I wasn't quite sure what it should be doing, but this seemed right. ;) Sorry for not sending a proper patch. So, when you tested visible quota files, I assume it was just falling back to the non-next variants of the quotactl, right? We should not be hooking up the call for the visible quota files, right? FWIW, there is a test in [x]fstests now for the [X]GETNEXT calls, it's generic/244 Thanks! -Eric > Honza > From sandeen@redhat.com Fri Feb 19 14:25:37 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=ham version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay2.corp.sgi.com [137.38.102.29]) by oss.sgi.com (Postfix) with ESMTP id 6B4697CAA for ; Fri, 19 Feb 2016 14:25:37 -0600 (CST) Received: from cuda.sgi.com (cuda3.sgi.com [192.48.176.15]) by relay2.corp.sgi.com (Postfix) with ESMTP id 31470304039 for ; Fri, 19 Feb 2016 12:25:31 -0800 (PST) X-ASG-Debug-ID: 1455913514-04cb6c455c03650001-NocioJ Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by cuda.sgi.com with ESMTP id maNisJO2wGkECRC6 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO) for ; Fri, 19 Feb 2016 12:25:15 -0800 (PST) X-Barracuda-Envelope-From: sandeen@redhat.com X-Barracuda-Apparent-Source-IP: 209.132.183.28 X-ASG-Whitelist: Client Received: from int-mx14.intmail.prod.int.phx2.redhat.com (int-mx14.intmail.prod.int.phx2.redhat.com [10.5.11.27]) by mx1.redhat.com (Postfix) with ESMTPS id 9FA2328A4D for ; Fri, 19 Feb 2016 20:25:14 +0000 (UTC) Received: from liberator.sandeen.net (ovpn01.gateway.prod.ext.phx2.redhat.com [10.5.9.1]) by int-mx14.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id u1JKPDEH016164 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Fri, 19 Feb 2016 15:25:14 -0500 To: xfs@oss.sgi.com From: Eric Sandeen Subject: [PATCH] xfs_db: Fix dquot command docs Message-ID: <56C77A29.7070806@redhat.com> X-ASG-Orig-Subj: [PATCH] xfs_db: Fix dquot command docs Date: Fri, 19 Feb 2016 14:25:13 -0600 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.11; rv:38.0) Gecko/20100101 Thunderbird/38.6.0 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-Scanned-By: MIMEDefang 2.68 on 10.5.11.27 X-Barracuda-Connect: mx1.redhat.com[209.132.183.28] X-Barracuda-Start-Time: 1455913515 X-Barracuda-Encrypted: ECDHE-RSA-AES256-GCM-SHA384 X-Barracuda-URL: https://192.48.176.15:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-BRTS-Status: 1 The dquot command in xfs_db takes quota type as well as an ID. Fix the usage & man page to reflect this. Signed-off-by: Eric Sandeen --- diff --git a/db/dquot.c b/db/dquot.c index 3adde3b..c4d0bff 100644 --- a/db/dquot.c +++ b/db/dquot.c @@ -33,9 +33,11 @@ static int dquot_f(int argc, char **argv); static void dquot_help(void); -static const cmdinfo_t dquot_cmd = - { "dquot", NULL, dquot_f, 1, 2, 1, N_("[projid|gid|uid]"), - N_("set current address to project, group or user quota block"), dquot_help }; +static const cmdinfo_t dquot_cmd = { + "dquot", NULL, dquot_f, 1, 2, 1, N_("[-g|-p|-u] id"), +N_("set current address to a group, project or user quota block for given ID"), + dquot_help, +}; const field_t dqblk_hfld[] = { { "", FLDT_DQBLK, OI(0), C1, 0, TYP_NONE }, diff --git a/man/man8/xfs_db.8 b/man/man8/xfs_db.8 index 5745b22..6f0c424 100644 --- a/man/man8/xfs_db.8 +++ b/man/man8/xfs_db.8 @@ -444,8 +444,8 @@ If no value is given for .IR flagbits , print the current debug option bits. These are for the use of the implementor. .TP -.BI "dquot [" projectid_or_userid ] -Set current address to a project or user quota block. +.BI "dquot [" \-g | \-p | \-u ] " id" +Set current address to a group, project or user quota block for the given ID. Defaults to user quota. .TP .BI "echo [" arg "] ..." Echo the arguments to the output. From s.priebe@profihost.ag Sat Feb 20 02:20:09 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=unavailable version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay1.corp.sgi.com [137.38.102.111]) by oss.sgi.com (Postfix) with ESMTP id 49D177CBA for ; Sat, 20 Feb 2016 02:20:09 -0600 (CST) Received: from cuda.sgi.com (cuda1.sgi.com [192.48.157.11]) by relay1.corp.sgi.com (Postfix) with ESMTP id E4A5E8F804B for ; Sat, 20 Feb 2016 00:20:02 -0800 (PST) X-ASG-Debug-ID: 1455955280-04bdf07ab360b10001-NocioJ Received: from mail-ph.de-nserver.de (mail-ph.de-nserver.de [85.158.179.214]) by cuda.sgi.com with ESMTP id hq8D3JJeTY8c1gXy (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO) for ; Sat, 20 Feb 2016 00:01:21 -0800 (PST) X-Barracuda-Envelope-From: s.priebe@profihost.ag X-Barracuda-Apparent-Source-IP: 85.158.179.214 Received: (qmail 29161 invoked from network); 20 Feb 2016 09:01:20 +0100 X-Fcrdns: Yes Received: from p54BE516F.dip0.t-ipconnect.de (HELO [192.168.178.24]) (84.190.81.111) (smtp-auth username s.priebe@profihost.ag, mechanism plain) by mail-ph.de-nserver.de (qpsmtpd/0.92) with (ECDHE-RSA-AES256-SHA encrypted) ESMTPSA; Sat, 20 Feb 2016 09:01:20 +0100 To: "xfs@oss.sgi.com" Cc: linux-fsdevel@vger.kernel.org, "xfs-masters@oss.sgi.com" , "david@fromorbit.com >> Dave Chinner" From: Stefan Priebe Subject: xfs trace in 4.4.2 Message-ID: <56C81D94.7090603@profihost.ag> X-ASG-Orig-Subj: xfs trace in 4.4.2 Date: Sat, 20 Feb 2016 09:02:28 +0100 User-Agent: Mozilla/5.0 (Windows NT 10.0; rv:38.0) Gecko/20100101 Thunderbird/38.2.0 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-User-Auth: Auth by s.priebe@profihost.ag through 84.190.81.111 X-Barracuda-Connect: mail-ph.de-nserver.de[85.158.179.214] X-Barracuda-Start-Time: 1455955281 X-Barracuda-Encrypted: ECDHE-RSA-AES256-GCM-SHA384 X-Barracuda-URL: https://192.48.157.11:443/cgi-mod/mark.cgi X-Barracuda-BRTS-Status: 1 X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-Spam-Score: 0.00 X-Barracuda-Spam-Status: No, SCORE=0.00 using per-user scores of TAG_LEVEL=1000.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.7 tests= X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.3.27181 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- Hi, got this one today. Not sure if this is a bug. [67674.907736] ------------[ cut here ]------------ [67674.955858] WARNING: CPU: 5 PID: 197 at fs/xfs/xfs_aops.c:1232 xfs_vm_releasepage+0xa9/0xe0() [67675.005345] Modules linked in: dm_mod netconsole ipt_REJECT nf_reject_ipv4 mpt3sas raid_class xt_multiport iptable_filter ip_tabl es x_tables 8021q garp bonding coretemp loop usbhid ehci_pci ehci_hcd sb_edac ipmi_si usbcore i2c_i801 edac_core usb_common ipmi_msg handler button btrfs xor raid6_pq raid1 md_mod sg igb sd_mod i2c_algo_bit ixgbe ahci i2c_core mdio isci libahci libsas ptp megaraid_ sas scsi_transport_sas pps_core [67675.221939] CPU: 5 PID: 197 Comm: kswapd0 Not tainted 4.4.2+1-ph #1 [67675.277120] Hardware name: Supermicro X9DRi-LN4+/X9DR3-LN4+/X9DRi-LN4+/X9DR3-LN4+, BIOS 3.2 03/04/2015 [67675.335176] ffffffffa3a5065d ffff88007950fa98 ffffffffa33bd4e1 0000000000000001 [67675.392983] 0000000000000000 ffff88007950fad8 ffffffffa3083587 ffff88007950fae8 [67675.449743] 0000000000000001 ffffea0020883480 ffff880cf4b9cdd0 ffffea00208834a0 [67675.506112] Call Trace: [67675.561285] [] dump_stack+0x45/0x64 [67675.619364] [] warn_slowpath_common+0x97/0xe0 [67675.675719] [] warn_slowpath_null+0x1a/0x20 [67675.731113] [] xfs_vm_releasepage+0xa9/0xe0 [67675.786116] [] ? page_mkclean_one+0xd0/0xd0 [67675.844216] [] ? anon_vma_prepare+0x150/0x150 [67675.903862] [] try_to_release_page+0x32/0x50 [67675.957625] [] shrink_active_list+0x3ce/0x3e0 [67676.011497] [] shrink_lruvec+0x687/0x7d0 [67676.064980] [] shrink_zone+0xdc/0x2c0 [67676.118828] [] kswapd+0x4f9/0x930 [67676.172075] [] ? mem_cgroup_shrink_node_zone+0x150/0x150 [67676.225139] [] kthread+0xc9/0xe0 [67676.277539] [] ? kthread_stop+0xe0/0xe0 [67676.330124] [] ret_from_fork+0x3f/0x70 [67676.381816] [] ? kthread_stop+0xe0/0xe0 [67676.433499] ---[ end trace cb1827fe308f7f6b ]--- Greets Stefan From HKsimentor@xmkjsz.com Sat Feb 20 07:18:51 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=HTML_FONT_FACE_BAD, HTML_MESSAGE autolearn=ham version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay1.corp.sgi.com [137.38.102.111]) by oss.sgi.com (Postfix) with ESMTP id 8BEAC7CB9 for ; Sat, 20 Feb 2016 07:18:51 -0600 (CST) Received: from cuda.sgi.com (cuda2.sgi.com [192.48.176.25]) by relay1.corp.sgi.com (Postfix) with ESMTP id 4AAB88F804C for ; Sat, 20 Feb 2016 05:18:44 -0800 (PST) X-ASG-Debug-ID: 1455973620-04cbb06ade24fa0001-NocioJ Received: from xmkjsz.com ([121.15.164.196]) by cuda.sgi.com with SMTP id pqcGLqC0ebxD08Oq for ; Sat, 20 Feb 2016 05:07:04 -0800 (PST) X-Barracuda-Envelope-From: HKsimentor@xmkjsz.com X-Barracuda-Apparent-Source-IP: 121.15.164.196 Received: from WRGHO-506030926 (Unknown [113.89.212.221]) by 121.15.164.196 with DBMail 0500; Sat, 20 Feb 2016 21:06:37 +0800 X-Sender: 113.89.212.221 (HKsimentor@xmkjsz.com) Date: Sat, 20 Feb 2016 21:05:26 +0800 From: HKsimentor Reply-To: HKsimentor Subject: RFQ X-Priority: 3 X-ASG-Orig-Subj: RFQ X-Has-Attach: no X-Mailer: Foxmail 7.0.1.91[cn] Mime-Version: 1.0 Message-ID: <201602202105242926036@xmkjsz.com> Content-Type: multipart/related; boundary="----=_001_NextPart326252104307_=----" X-Barracuda-Connect: UNKNOWN[121.15.164.196] X-Barracuda-Start-Time: 1455973621 X-Barracuda-URL: https://192.48.176.25:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-BRTS-Status: 1 X-Barracuda-Spam-Score: 1.92 X-Barracuda-Spam-Status: No, SCORE=1.92 using per-user scores of TAG_LEVEL=1000.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.7 tests=BSF_SC0_MISMATCH_TO, HTML_FONT_FACE_BAD, HTML_MESSAGE, MISSING_HEADERS, RDNS_NONE, TO_CC_NONE X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.3.27186 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 0.00 BSF_SC0_MISMATCH_TO Envelope rcpt doesn't match header 1.21 MISSING_HEADERS Missing To: header 0.00 HTML_MESSAGE BODY: HTML included in message 0.61 HTML_FONT_FACE_BAD BODY: HTML font face is not a word 0.00 TO_CC_NONE No To: or Cc: header 0.10 RDNS_NONE Delivered to trusted network by a host with no rDNS To: undisclosed-recipients:; This is a multi-part message in MIME format. ------=_001_NextPart326252104307_=---- Content-Type: multipart/alternative; boundary="----=_002_NextPart167184256873_=----" ------=_002_NextPart167184256873_=---- Content-Type: text/plain; charset="gb2312" Content-Transfer-Encoding: base64 IA0KR3JlZXRpbmdzLA0KDQoNClNpbWVudG9yIEVsZWN0cm9uaWMgTGltaXRlZCBpcyBhIHdvcmxk d2lkZSBlbGVjdHJvbmljIGNvbXBvbmVudHMgZGlzdHJpYnV0b3IuDQoNCldlIGFyZSBnb29kIGF0 IGZpbmRpbmcgaGFyZCAtdG8gLSBmaW5kIHBhcnRzIGluIHNob3J0IGxlYWR0aW1lIHdpdGggZ29v ZCBwcmljZSBpbiBoaWdodCBxdWFsaXR5Lg0KR29vZCBidXNpbmVzcyByZWxhdGlvbnNoaXAgd2l0 aCBtYW55IFNlbWljb25kdWN0b3IgQXV0aG9yaXR5IGRpc3RyaWJ1dG9yIGFuZCBtYW51ZmFjdHVy ZXIgDQpTZW5kIG91dCBzaGlwbWVudCBpbiAzLTUgZGF5cyBhZnRlciBjb25maXJtIHBheW1lbnQh IA0KV2FycmFudHkgMSB5ZWFycyBmb3IgYWxsIHBhcnRzIQ0KDQoNCkZvbGxvd3MgaXMgb3VyIHN0 cm9uZyBicmFuZKOoMTAwJSBuZXcgYW5kIG9yaWdpbmFso6k6DQoNClBsZWFzZSBraW5kbHkgc2Vu ZCB1cyBQYXJ0IG51bWJlciBhbmQgcXVhbnRpdHksIHdlIHdpbGwgc2VuZCB5b3VyIGJlc3QgcXVv dGF0aW9uLg0KDQoNCg0KDQpCZXN0IFJlZ2FyZHOjoQ0KDQpXZW5ueSBZYW5nDQoNClNhbGVzIEFj Y291bnQgTWFuYWdlciwgDQpPdmVyc2VhcyBzYWxlcyZNYXJrZXRpbmcgRGVwYXJ0bWVudCwNClNp bWVudG9yIEVsZWN0cm9uaWMgTGltaXRlZC4NCkFkZDogIFJtMjgwMiwyOC9GLEJsb2NrIEEsIE9y aWVudGFsIFRpbWVzLCBGdXRpYW4gRGlzdHJpY3QsIFNoZW56aGVuLENOLg0KVGVso7orODYtNzU1 LTgzNzQyODg2DQpNb2JpbGU6ICs4Ni0xMzQ4MDg5NDAyMC4NClNreXBlOiB5YW5nbGwzNjAwDQoN Cg0KDQoNCg0KICA= ------=_002_NextPart167184256873_=---- Content-Type: text/html; charset="gb2312" Content-Transfer-Encoding: quoted-printable
 =20 Greetings,


Simentor Electronic Limited is a worldwide el= ectronic=20 components distributor.

 

We are good at finding hard -to - find = parts in=20 short leadtime with good price in hight quality.

  • Good business relationship with many=20 Semiconductor Authority distributor and manufacturer
  • Send out shipment in 3-5 days after co= nfirm=20 payment!
  • Warranty 1 years for all=20 parts!

  • Follows is our strong brand=A3=A8100% new and= =20 original=A3=A9:

     

    Please kindly send us Part number a= nd=20 quantity, we will send your best quotation.

     
    3D""=20
     

     

    Best Regards=A3=A1  
    Wenny Yang
    3D""=20
    Sales Account Manager,
    Overseas sales&Marketing=20 Department,
    Simentor Electronic Limited.
    Add:  Rm2802,28/F,Block=20 A, Oriental Times, Futian District,=20 Shenzhen,CN.
    Tel=A3=BA+86-755-83742886
    Mobile: +86-13480894020.
    Skype: yangll3600

     

     

     

     


     = ;=20 ------=_002_NextPart167184256873_=------ ------=_001_NextPart326252104307_=---- Content-Type: image/png; name="IC-BRAND.png" Content-Transfer-Encoding: base64 Content-ID: <_Foxmail.0@DD66CFDD-107B-4646-B97D-302658AEB46A> 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 JiamoKDgmWeeiYyMXLhwYV5e3siRI5944onc3Nxt27bNmTOnd+/e27ZtCwkJmT9/fkBAQG5u7uLF i/fv319eXv7xxx/fc889CxYsYFl2+PDhfn4NXefAgQMDAgLy8/OHDx9uNBojIiJ2794NAEuXLh09 erRKOCilX3311dmzZwGgV69evXv3BoDw8PDdu3enpaXNnTtXEASHw3Hq1KmjR4+WlZXde++97733 nsVieeONN0JCQqZOnQoAgwYNkmU5LCwsOjp6165djzzySLdu3b7++uudO3d27979pZdeKisr+/HH H7Ozs3///fcFCxY8+eSTd999t8Ph2Lt3748//njw4MEHH3yw7a9Ak/8QAtFNf/8dKspVRwaVJH7k KM2jj3n8GmynzprHpzgWzKdOF9u5s2bm8zgwUN2Fw8K0T02zXbhAz5wma1bj52YirdbLzIYURa6r M6s6CUrpzp07H330kfj4hMrKih07drgaXXXV1VVut6uoqHDu3LkIoc8//9xkMr3yyitZWVmkqdFu yJAh77///vfff7dly1aP2QYAEEKBgYGvv/73Rx999Icffly4cGF1dbX3iQaDYdq0p/72t9eysrJe eumlixcvNhvy77333ldeefnzz5ecO5f7+edL2rVLJoQoirx+/fply5Y9++yz48aNfffdd2traz/9 9NOSkpJ3331XURTvCuj1+nvvvffLL7+QZbmNfMLmkuaszd58otAhyXqBNWg4o8AZNKxR4PQCZ9Sw Bg2nFziDhjMKrEHDGQTOoOEMGs7Is/56PsigudlEf5eq6k8WmzxKzEEp4c0OcIjykUtVHh+HrNDl hy41E9YSSkONmrvSYv80q62aq6/yN+BCmZS3kLYVckwBCECY3pYSWH3SFS7SJpfGCBFC86vsNlGu tLgRos2GOgqIY5S4EFOw0e5pDcI8y4SxzI00pDwbxTHhDufJOuuuZq2l0CoFuS5khfToGr9k/nSt IMiKrDZKrxFOnrsye+6yGlO9lhdeffaeQX06O5wuAKAUWJbhedbllgghbbnXCCFB4BWiiG75psZ6 SkGSldyLRd+t2n3oeB7GgBCSFaVvj5RP33pK4Dm54VcMOq1w4szlmW8stdocLQ2EN0BbyYRDIp8e Kl1+olKd3LcP0787Kr5HpKGhmk1qDQhBqJ6LCNDUuWSXTACAZVCgQfCkj6SEBusbgiwrbdLC/cUH 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 ------=_001_NextPart326252104307_=---- Content-Type: image/png; name="=?gb2312?B?x6nD+828xqwucG5n?=" Content-Transfer-Encoding: base64 Content-ID: <_Foxmail.1@EA79721B-F5A0-4706-BCB1-FD68D4C82AC1> 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 rkJggg== ------=_001_NextPart326252104307_=------ From bfoster@redhat.com Sat Feb 20 08:45:54 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=ham version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay2.corp.sgi.com [137.38.102.29]) by oss.sgi.com (Postfix) with ESMTP id 42F627CB9 for ; Sat, 20 Feb 2016 08:45:54 -0600 (CST) Received: from cuda.sgi.com (cuda2.sgi.com [192.48.176.25]) by relay2.corp.sgi.com (Postfix) with ESMTP id 0214E304039 for ; Sat, 20 Feb 2016 06:45:47 -0800 (PST) X-ASG-Debug-ID: 1455979536-04cbb06ade26b60001-NocioJ Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by cuda.sgi.com with ESMTP id Vm02Q6efcEHX7zHE (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Sat, 20 Feb 2016 06:45:37 -0800 (PST) X-Barracuda-Envelope-From: bfoster@redhat.com X-Barracuda-Apparent-Source-IP: 209.132.183.28 X-ASG-Whitelist: Client Received: from int-mx09.intmail.prod.int.phx2.redhat.com (int-mx09.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by mx1.redhat.com (Postfix) with ESMTPS id 32B35A9E; Sat, 20 Feb 2016 14:45:36 +0000 (UTC) Received: from bfoster.bfoster (dhcp-41-22.bos.redhat.com [10.18.41.22]) by int-mx09.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id u1KEjZuk019767; Sat, 20 Feb 2016 09:45:35 -0500 Received: by bfoster.bfoster (Postfix, from userid 1000) id 478C312596E; Sat, 20 Feb 2016 09:45:34 -0500 (EST) Date: Sat, 20 Feb 2016 09:45:34 -0500 From: Brian Foster To: Stefan Priebe Cc: "xfs@oss.sgi.com" , linux-fsdevel@vger.kernel.org, "xfs-masters@oss.sgi.com" Subject: Re: xfs trace in 4.4.2 Message-ID: <20160220144533.GA36182@bfoster.bfoster> X-ASG-Orig-Subj: Re: xfs trace in 4.4.2 References: <56C81D94.7090603@profihost.ag> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <56C81D94.7090603@profihost.ag> User-Agent: Mutt/1.5.24 (2015-08-30) X-Scanned-By: MIMEDefang 2.68 on 10.5.11.22 X-Barracuda-Connect: mx1.redhat.com[209.132.183.28] X-Barracuda-Start-Time: 1455979537 X-Barracuda-Encrypted: ECDHE-RSA-AES256-GCM-SHA384 X-Barracuda-URL: https://192.48.176.25:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-BRTS-Status: 1 On Sat, Feb 20, 2016 at 09:02:28AM +0100, Stefan Priebe wrote: > Hi, > > got this one today. Not sure if this is a bug. > That looks like the releasepage() delayed allocation block warning. I'm not sure we've had any fixes for (or reports of) that issue since the v4.2 timeframe. What is the xfs_info of the associated filesystem? Also, do you have any insight as to the possible reproducer application or workload? Is this reproducible at all? Note that this is a WARN_ON_ONCE(), so the warning won't fire again regardless until after a reboot. Brian > [67674.907736] ------------[ cut here ]------------ > [67674.955858] WARNING: CPU: 5 PID: 197 at fs/xfs/xfs_aops.c:1232 > xfs_vm_releasepage+0xa9/0xe0() > [67675.005345] Modules linked in: dm_mod netconsole ipt_REJECT > nf_reject_ipv4 mpt3sas raid_class xt_multiport iptable_filter ip_tabl > es x_tables 8021q garp bonding coretemp loop usbhid ehci_pci ehci_hcd > sb_edac ipmi_si usbcore i2c_i801 edac_core usb_common ipmi_msg > handler button btrfs xor raid6_pq raid1 md_mod sg igb sd_mod i2c_algo_bit > ixgbe ahci i2c_core mdio isci libahci libsas ptp megaraid_ > sas scsi_transport_sas pps_core > [67675.221939] CPU: 5 PID: 197 Comm: kswapd0 Not tainted 4.4.2+1-ph #1 > [67675.277120] Hardware name: Supermicro > X9DRi-LN4+/X9DR3-LN4+/X9DRi-LN4+/X9DR3-LN4+, BIOS 3.2 03/04/2015 > [67675.335176] ffffffffa3a5065d ffff88007950fa98 ffffffffa33bd4e1 > 0000000000000001 > [67675.392983] 0000000000000000 ffff88007950fad8 ffffffffa3083587 > ffff88007950fae8 > [67675.449743] 0000000000000001 ffffea0020883480 ffff880cf4b9cdd0 > ffffea00208834a0 > [67675.506112] Call Trace: > [67675.561285] [] dump_stack+0x45/0x64 > [67675.619364] [] warn_slowpath_common+0x97/0xe0 > [67675.675719] [] warn_slowpath_null+0x1a/0x20 > [67675.731113] [] xfs_vm_releasepage+0xa9/0xe0 > [67675.786116] [] ? page_mkclean_one+0xd0/0xd0 > [67675.844216] [] ? anon_vma_prepare+0x150/0x150 > [67675.903862] [] try_to_release_page+0x32/0x50 > [67675.957625] [] shrink_active_list+0x3ce/0x3e0 > [67676.011497] [] shrink_lruvec+0x687/0x7d0 > [67676.064980] [] shrink_zone+0xdc/0x2c0 > [67676.118828] [] kswapd+0x4f9/0x930 > [67676.172075] [] ? > mem_cgroup_shrink_node_zone+0x150/0x150 > [67676.225139] [] kthread+0xc9/0xe0 > [67676.277539] [] ? kthread_stop+0xe0/0xe0 > [67676.330124] [] ret_from_fork+0x3f/0x70 > [67676.381816] [] ? kthread_stop+0xe0/0xe0 > [67676.433499] ---[ end trace cb1827fe308f7f6b ]--- > > Greets Stefan > > _______________________________________________ > xfs mailing list > xfs@oss.sgi.com > http://oss.sgi.com/mailman/listinfo/xfs From agruenba@redhat.com Sat Feb 20 10:37:46 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=ham version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay1.corp.sgi.com [137.38.102.111]) by oss.sgi.com (Postfix) with ESMTP id 883C57CB9 for ; Sat, 20 Feb 2016 10:37:46 -0600 (CST) Received: from cuda.sgi.com (cuda2.sgi.com [192.48.176.25]) by relay1.corp.sgi.com (Postfix) with ESMTP id 4A7ED8F8037 for ; Sat, 20 Feb 2016 08:37:40 -0800 (PST) X-ASG-Debug-ID: 1455986241-04cbb06add290b0001-NocioJ Received: from mail-vk0-f48.google.com (mail-vk0-f48.google.com [209.85.213.48]) by cuda.sgi.com with ESMTP id Rf3b5HhHJij6pB88 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128 verify=NO) for ; Sat, 20 Feb 2016 08:37:22 -0800 (PST) X-Barracuda-Envelope-From: agruenba@redhat.com X-Barracuda-Apparent-Source-IP: 209.85.213.48 Received: by mail-vk0-f48.google.com with SMTP id c3so99116316vkb.3 for ; Sat, 20 Feb 2016 08:37:22 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:date :message-id:subject:from:to:cc:content-type :content-transfer-encoding; bh=umZ/IRef0WXoDcXsCdW/++sJDKeKRS4gwACtLNSL6cE=; b=VbZ0YE0dbPWW0ooOk4la3WUsnd26M1bvflJTDTp5wMY1C9zxW5OWIDtIby9BxEx6rG 6Im8RYGkX1jfxJOe9cdwrn60+OZaB9vQgyy9NEB5lSkypIs5GHwAEYJydNyasfXvoK/q jzwcTroHALwIaDgWGahtDXh0mR+kNhQCCnhBowPiQ/Zyf2Xqxyih/a593LbHuKb5Nw6r SOGObCLWB21uQW4zI9eIJC4+kz+CotOQ3cuV8bWzJAAj8HL4dbCXoKITNtghh4DEaGe0 gnsJk+Xiu5tfavsVLtJB4r10hCjL9+4QvlYssFS0FIdvoZxga7xYfj57F6+OMUK/RTP3 PdFA== X-Gm-Message-State: AG10YOTjJlGJc5I5q0UQTvdCDo5QUaB9OaekY+5QgJpPRggJMvxqrgrExpRJasuy66M5GBqdvWTVZoqCNf6LNKZu MIME-Version: 1.0 X-Received: by 10.31.151.75 with SMTP id z72mr14950859vkd.104.1455986241232; Sat, 20 Feb 2016 08:37:21 -0800 (PST) Received: by 10.176.64.130 with HTTP; Sat, 20 Feb 2016 08:37:21 -0800 (PST) In-Reply-To: <56C0F23C.7030902@gmail.com> References: <56B770B6.7040803@gmail.com> <56B77262.7090107@gmail.com> <56C0F23C.7030902@gmail.com> Date: Sat, 20 Feb 2016 17:37:21 +0100 Message-ID: Subject: Re: richacl(7) man page review comments From: Andreas Gruenbacher X-ASG-Orig-Subj: Re: richacl(7) man page review comments To: "Michael Kerrisk (man-pages)" Cc: "J. Bruce Fields" , linux-ext4 , XFS Developers , lkml , linux-fsdevel , Linux NFS Mailing List , linux-cifs@vger.kernel.org, Linux API , Dave Chinner , Christoph Hellwig , Anna Schumaker , Trond Myklebust , Jeff Layton , Andreas Dilger Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-Barracuda-Connect: mail-vk0-f48.google.com[209.85.213.48] X-Barracuda-Start-Time: 1455986241 X-Barracuda-Encrypted: ECDHE-RSA-AES128-GCM-SHA256 X-Barracuda-URL: https://192.48.176.25:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-BRTS-Status: 1 X-Barracuda-Spam-Score: 0.00 X-Barracuda-Spam-Status: No, SCORE=0.00 using per-user scores of TAG_LEVEL=1000.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.7 tests=BSF_SC0_MISMATCH_TO X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.3.27189 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 0.00 BSF_SC0_MISMATCH_TO Envelope rcpt doesn't match header Hi Michael, thanks again for all the feedback. I've followed all your suggestions; again, please see the github repo for the latest version: https://github.com/andreas-gruenbacher/richacl On Sun, Feb 14, 2016 at 10:31 PM, Michael Kerrisk (man-pages) wrote: > Hi Andreas, > > Here's a few more comments on the current richacl(7) page > that I fetched from the git repo. > >> .\" >> .\" RichACL Manual Pages >> .\" >> .\" Copyright (C) 2015,2016 Red Hat, Inc. >> .\" Written by Andreas Gruenbacher >> .\" This is free documentation; you can redistribute it and/or >> .\" modify it under the terms of the GNU General Public License as >> .\" published by the Free Software Foundation; either version 2 of >> .\" the License, or (at your option) any later version. >> .\" >> .\" The GNU General Public License's references to "object code" >> .\" and "executables" are to be interpreted as the output of any >> .\" document formatting or typesetting system, including >> .\" intermediate and printed output. >> .\" >> .\" This manual is distributed in the hope that it will be useful, >> .\" but WITHOUT ANY WARRANTY; without even the implied warranty of >> .\" MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the >> .\" GNU General Public License for more details. >> .\" >> .\" You should have received a copy of the GNU General Public >> .\" License along with this manual. If not, see >> .\" . >> .\" >> .de URL >> \\$2 \(laURL: \\$1 \(ra\\$3 >> .. >> .if \n[.g] .mso www.tmac >> .TH RICHACL 7 2015-09-01 "Linux" "Rich Access Control Lists" >> .SH NAME >> richacl \- Rich Access Control Lists >> .SH DESCRIPTION >> Rich Access Control Lists (RichACLs) are an extension of the POSIX file >> permission model (see >> .BR acl (5)) >> to support >> .URL https://tools.ietf.org/rfc/rfc5661.txt "NFSv4 Access Control Lists" >> on local and remote-mounted filesystems. > > Having read the following paragraph a number of times (and being > ignorant of NFS ACLs), I find that I'm none the wiser about what you are > trying to say. What does it mean to "apply a file mode to an... ACL"? > Likewise, how does "the file mode determine the values of the file > masks"? This isn't clear in the following paragraph, and doesn't seem to > be elborated in the rest of the page. Could you add some text somehwere > to explain these points? I've removed this paragraph and I've tried to explain what the masks do in the Structure of RichACLs section. >> RichACLs support file masks which can be used to apply a file mode to an= existing >> NFSv4 ACL without destructive side effects: the file mode determines the= values >> of the file masks; the file masks restrict the permissions granted by th= e NFSv4 >> ACL. When a less restrictive file mode is applied later, the file masks= become >> less restrictive, and more of the original permissions can become effect= ive. >> >> A RichACL can always be translated into an equivalent NFSv4 ACL which gr= ants >> the same permissions. >> >> RichACLs can be enabled on supported filesystems. This disables POSIX Ac= cess > > I think it might be helpful here to list which filesystems so far > support RichACLs. > >> Control Lists; the two ACL models cannot coexist on the same filesystem. >> >> When used on a filesystem that does not support RichACLs, the >> .BR getrichacl (1) >> and >> .BR setrichacl (1) >> utilities will operate on the file permission bits instead: >> .BR getrichacl (1) >> will display the file permission bits as a RichACL; when a RichACL >> is set with >> .BR setrichacl (1) >> which can be represented exactly by the file permission bits, >> .BR setrichacl (1) >> will set the file permission bits instead. An attempt to set a RichACL = that >> cannot be represented exactly by the file permission bits results in an = error. >> >> .SS Structure of RichACLs >> >> RichACLs consist of a number of ACL entries, three file masks, and some = flags >> specifying attributes of the ACL as whole (by contrast with the per-ACL-= entry >> flags described below). > > Insert a blank line here, to start a new paragraph. > >> Each of the ACL entries allows or denies some permissions to a particula= r user, >> group, or special entity. Each entry consists of: > > In the previous line you write "entity". In the lines below you use > "identifier". The terminology switch is confusing. Use just one > term. > >> .IP \(bu 4 >> A tag which specifies the user (with prefix >> .B user: >> or >> .BR u: ), >> group (with prefix >> .B group: >> or >> .BR g: ), >> or special identifier the entry applies to. Special >> identifiers can be the file owner >> .RB ( owner@ ), >> the owning group >> .RB ( group@ ), >> or everyone >> .RB ( everyone@ ). >> .IP \(bu >> A set of permissions the entry allows or denies. >> .IP \(bu >> A set of flags that indicate whether the user or group identifier is map= ped or >> unmapped, and whether the entry has been and can be inherited. >> .IP \(bu 4 >> A field indicating whether the entry allows or denies access. > > Does this field have a name? It would make dicussing it easier > to give it a name. That is, an ACL entry consists of four fields: > > * a tag > * permissions > * flags > * ??? ("type"?) > >> .PP >> The owner, group, and other file masks further control which permissions= the >> ACL grants, subject to the >> .BR masked "\ (" m ) >> and >> .BR write_through "\ (" w ) >> ACL flags. >> >> Note that entries with the identifier >> .B everyone@ >> apply to all processes, whereas the \(lqother\(rq file permissions and >> \(lqother\(rq entries in POSIX ACLs apply to all processes which are not= the >> owner, are not in the owning group, and do not match a user or group men= tioned >> in the ACL. >> >> Unlike POSIX ACLs, RichACLs do not have separate \(lqaccess\(rq ACLs tha= t >> define the access permissions and \(lqdefault\(rq ACLs that define the >> inheritable permissions. Instead, flags on each ACL entry determine whe= ther >> the entry is effective during access checks and/or inheritable. >> >> >> .SS ACL flags >> >> The following flags on ACLs are defined: >> >> .RS >> .HP > > I don't think the heavy indentation here is helpful, and it narrors the > text considerably. I suggest replacing the preceding .RS+.HP with .TP, > and changing ewach .HP below to .TP, and remove the colon at the end of > each line that follows the .TP lines. That's what I thought too, and that's why I had ".RS 4" and ".HP 4" here originally. >> .BR masked "\ (" m ): >> When set, the file masks define upper limits on the permissions the ACL = may >> grant. >> .HP >> .BR write_through "\ (" w ): >> When this flag and the >> .B masked >> flag are both set, the owner and other file masks define the actual perm= issions >> granted to the file owner and to others instead of an upper limit. > > There needs to be a statement here about what 'write_through' does if > 'masked' is not set. > >> .HP >> .BR auto_inherit "\ (" a ): >> Automatic Inheritance is enabled for the file the ACL is >> attached to. See >> .IR "Automatic Inheritance" . >> .HP >> .BR protected "\ (" p ): >> The ACL is protected from modification by Automatic >> Inheritance. >> .HP >> .BR defaulted "\ (" d ): >> The ACL has been assigned by default. Automatic Inheritance should compl= etely > > What does "assigned by default" mean? That it was inherited because of > 'dir_inherit' or 'file_inherit' in the pareent directory? This needs to > be clearer. > > >> replace the ACL. >> .RE > > If you follow my suggestion above, delete the preceding .RE > >> .SS ACL entry flags >> >> The following flags on ACL entries are defined: >> >> .RS >> .HP > > See above. Possibly change .RS+.HP to .TP > >> .BR file_inherit "\ (" f ): >> The entry is inheritable for files. > > Maybe this would be better as: > > "When this flag appears in the ACL entry of a directory, then that entry = is > inherited by new files created in the directory." > > Is that text that I propose correct? > >> .HP >> .BR dir_inherit "\ (" d ): >> The entry is inheritable for directories. > > "When this flag appears in the ACL entry of a directory, then that entry = is > inherited by new subdirectories created in the directory." > > Is that text that I propose correct? It's not entirely wrong, but only a small part of the truth. Entries are inherited such that the permissions in file_inherit entries become effective for access checking for new files, and the permissions in dir_inherit entries become effective for access checking for new directories, recursively. Your feedback prompted me to look into the inheritance flag computation more closely once again, and I found bugs. The steps of the algorithm are explained in the section "Permissions at file-creation time", by the way. >> .HP >> .BR no_propagate "\ (" n ): >> Inheritance stops at the next subdirectory level. >> .HP >> .BR inherit_only "\ (" i ): >> The entry defines inheritable permissions only and is ignored for access >> checking. >> .HP >> .BR inherited "\ (" a ): >> The entry has been automatically inherited from the parent directory; th= e >> ACL's >> .B auto_inherit >> flag should be on. >> .HP >> .BR unmapped "\ (" u ): >> The user or group identifier is a textual string and is not mapped to a = numeric >> user or group identifier. ACLs with unmapped identifiers can occur on N= FSv4 >> mounted filesystems when the client cannot determine numeric user or gro= up >> identifiers for some of the NFSv4 user@domain or group@domain who values= . They >> cannot be assigned to local files or directories. >> .RE > > If you follow my suggestion above, delete the preceding .RE > >> >> .SS Permissions >> >> The following permissions are defined for RichACL entries and for the th= ree >> file masks: >> >> .RS >> .HP > > See above. Possibly change .RS+.HP yo .TP > >> .BR read_data " / " list_directory "\ (" r ): >> For a file: read the data of the file. >> For a directory: list the contents of the directory. >> .HP >> .BR write_data " / " add_file "\ (" w ): >> For a file: modify the data of the file; does not include opening the fi= le in >> append mode. >> For a directory: add a new file in the directory. >> .HP >> .BR append_data " / " add_subdirectory "\ (" p ): >> For a file: open the file in append mode. >> For a directory: create a subdirectory in the directory. >> .HP >> .BR execute "\ (" x ): >> For a file: execute the file. >> For a directory: traverse / search the directory. >> .HP >> .BR delete_child "\ (" d ): >> Delete a file or directory within a directory. >> .HP >> .BR delete "\ (" D ): >> Delete the file or directory. >> .HP >> .BR read_attributes "\ (" a ): >> Read basic attributes of a file or directory (see >> .BR stat (2)). >> This permission is always implicitly granted. > > So, can this permission ever be taken away? If yes, say so. If not, why > does this permission exist? (And maybe say something about that.) > >> .HP >> .BR write_attributes "\ (" A ): >> Change the times associated with a file or directory to an arbitrary val= ue. >> This permission is always implicitly granted to the file owner. >> .HP >> .BR read_acl "\ (" c ): >> Read the ACL of a file or directory. This permission is always >> implicitly granted. >> .HP >> .BR write_acl "\ (" C ): >> Change the ACL or file mode of a file or directory. >> .HP >> .BR write_owner "\ (" o ): >> Take ownership of a file or directory. Change the owning group of a fil= e or >> directory to a group of which the calling process is a member. >> .HP >> .BR read_named_attrs "\ (" R ), >> .BR write_named_attrs "\ (" W ), >> .BR synchronize "\ (" S ), >> .BR write_retention "\ (" e ), >> .BR write_retention_hold "\ (" E ): > > If you follow my .TP suggestion above, then the above lines would need > to be rewritten sometinh like: > > .BR read_named_attrs "\ (" R "), " write_named_attrs "\ (" W "), " \ > synchronize "\ (" S "), " write_retention "\ (" e "), " \ > write_retention_hold "\ (" E ) > >> These permissions are defined by NFSv4 / NFSv4.1. They can be stored, b= ut are >> not used. >> .RE > > If you follow my suggestion above, delete the preceding .RE and > add .PP > >> >> For the >> .BR r ", " w ", and " p >> permissions which have different long forms for files and directories, t= he >> .BR getrichacl (1) >> utility will output the appropriate form(s) depending on the context. >> The >> .BR setrichacl (1) >> utility will accept either form for any file type. >> >> .SS Text form >> The common textual representation of a RichACL consists of the colon-sep= arated >> fields of the the ACL flags, file masks, and ACL entries in the followin= g > > s/the the/the/ > >> format: >> .TP >> \fBflags:\fR\fIacl_flags\fR >> The ACL flags. >> .TP >> \fBowner:\fR\fIperm\fR\fB::mask\fR, \fBgroup:\fR\fIperm\fR\fB::mask\fR, = \fBother:\fR\fIperm\fR\fB::mask\fR >> The file masks and their permissions. >> .TP >> \fIwho\fR\fB:\fR\fIperm\fR\fB:\fR\fIflags\fR\fB:allow\fR, \fIwho\fR\fB:\= fR\fIperm\fR\fB:\fR\fIflags\fR\fB:deny\fR >> For each ACL entry, who the entry applies to, the permissions of the ent= ry, the >> entry flags, and whether the entry allows or denies permissions. The \f= Iwho\fR >> field has no prefix for special identifiers, a >> .B user: >> or >> .B u: >> prefix for regular users, and a >> .B group: >> or >> .B g: >> prefix for regular groups. > > I think the preceding sentence could be clearer. How about something > like the following (if correct): > > [[ > The who field is one of the following: > > * One of the special identifiers: owner@, group@, or everyone@ > * A user: or u: prefix followed by a [user name, user ID?] that designate= s > s specific user > * A group: or g: prefix followed by a [group name, group ID?] that design= ates > s specific group > ]] > >> .PP >> The entries are comma, whitespace, or newline separated. >> >> Flags and permissions have single-letter as well as long forms, as liste= d under >> .IR "ACL flags" , >> .IR "ACL entry flags" , >> and >> .IR Permissions . >> When the single-letter forms are used, the flags or permissions are >> concatenated. When the long forms are used, the flags or permissions are >> separated by slashes. To align permissions or flags vertically, dashes = can be >> used for padding. >> >> .SS Setting and modifying file permissions >> The access permissions for a file can either be set by assigning an acce= ss >> control list >> .RB ( setrichacl (1)) >> or by changing the file mode permission bits >> .RB ( chmod (1)). >> In addition, a file can inherit an ACL from its parent directory at crea= tion >> time as described under >> .IR "Permissions at file-creation time" . >> >> .SS Assigning an Access Control List >> When assigning an ACL to a file, unless explicitly specified, the owner,= group, >> and other file masks will be computed from the ACL entries as described = in >> the section >> .IR "Computing the maximum file masks" . >> The owner, group, and other file mode permission bits are then each set = from >> the owner, group, and other file mask as follows: >> .IP \(bu 4 >> If the file mask includes the >> .B r >> permission, the read >> file mode permission bit will be set. >> .IP \(bu >> If the file mask includes the >> .B w >> or >> .B p >> permission, the write file mode permission bit will be set. >> .IP \(bu >> If the file mask includes the >> .B x >> permission, the execute file mode permission bit will be set. >> .PP >> If the ACL can be represented exactly by the file mode >> permission bits, the file permission bits are set to match the ACL and t= he ACL >> is not stored. (When the ACL of a file is requested which doesn't have = an ACL, >> the file mode permission bits are converted into an equivalent ACL.) >> >> .SS Changing the file mode permission bits >> When changing the file mode permission bits with >> .BR chmod (1), >> the owner, group, >> and other file permission bits are set to the permission bits in the new= mode, >> and the file masks each are set based on the new mode bits as follows: >> .IP \(bu 4 >> If the read bit in a set of permissions is set, the >> .B r >> permission in the corresponding file mask will be set. >> .IP \(bu >> If the write bit in a set of permissions is set, the >> .B w >> and >> .B p >> permissions in the corresponding file mask will be set. >> .IP \(bu >> If the execute bit in a set of permissions is set, the >> .B x >> permission in the corresponding file mask will be set. >> .PP >> In addition, the >> .B masked >> and >> .B write_through >> ACL flags are set. This has the >> effect of limiting the permissions granted by the ACL to the file mode >> permission bits; in addition, the owner is granted the owner mode bits a= nd >> others are granted the other mode bits. If the >> .B auto_inherit >> flag is set, the >> .B protected >> flag is also set to prevent the Automatic Inheritance algorithm from mod= ifying >> the ACL. >> >> .SS Permissions at file-creation time >> When a directory has inheritable ACL entries, the following >> happens when a file or directory is created inside that directory: >> .RS 4 >> .IP 1. 4 >> A file created inside that directory will inherit all of the ACL entries= that >> have the >> .B file_inherit >> flag set, and all inheritance-related flags in the inherited entries wil= l be >> cleared. >> >> A subdirectory created inside that directory will inherit all of the ACL >> entries that have the >> .B file_inherit >> or >> .B dir_inherit >> flag set. Entries whose >> .B no_propagate >> flag is set will have all inheritance-related flags cleared. Entries wh= ose >> .B no_propagate >> and >> .B dir_inherit >> flags are not set and whose >> .B file_inherit >> is set will have their >> .B inherit_only >> flag set. >> .IP 2. >> If the parent directory's ACL has the >> .B auto_inherit >> flag set, the inherited ACL will have its >> .B auto_inherit >> flag set, and all entries will have their >> .B inherited >> flag set. >> .IP 3. >> The three file masks are computed from the inherited ACL as described in >> the section >> .IR "Computing the maximum file masks" . >> .IP 4. >> The three sets of permissions for the owner, the group, and for others i= n >> the \fImode\fR parameter as given to >> .BR open (2), >> .BR mkdir (2), >> and similar are converted into sets of RichACL permissions as described = in >> the section >> .IR "Changing the file mode permission bits" . >> Any RichACL permissions not included in those sets are >> removed from the owner, group, and other file masks. The file mode permi= ssion >> bits are then computed from the file masks as described in the section >> .IR "Assigning an Access Control List" . >> The process umask (see >> .BR umask (2)) >> is ignored. >> .IP 5. >> The >> .B masked >> ACL flag is set. The >> .B write_through >> ACL flag remains cleared. In addition, if the >> .B auto_inherit >> flag of the inherited ACL is set, the >> .B protected >> flag is also set to prevent the Automatic Inheritance algorithm from mod= ifying >> the ACL. >> .RE >> .PP >> When a directory does not have inheritable ACL entries, files and direct= ories >> created inside that directory will not be assigned access control lists = and the >> file mode permission bits will be set to (\fImode\fR\ &\ ~\fIumask\fR) w= here >> \fImode\fR is the mode argument of the relevant system call and \fIumask= \fR is >> the process umask (see >> .BR umask (2)). >> >> .SS Automatic Inheritance >> Automatic Inheritance is a mechanism that allows permission changes to >> propagate from a directory to files and subdirectories inside that direc= tory, >> recursively. Propagation is carried out by the process changing the dir= ectory >> permissions (usually, >> .BR setrichacl (1)); >> it happens without user intervention albeit not entirely automatically. >> >> A significant limitation is that this mechanism works only as long as fi= les >> are created without explicitly specifying the file permissions to use. T= he >> standard system calls for creating files an directories ( > > s/an /and / > s/ ($// > >> .BR creat (2), > > Make that last line: > > .RM ( creat (2), > >> .BR open (2), >> .BR mkdir (2), >> .BR mknod (2)) >> all have mandatory mode parameters which define the maximum allowed perm= issions >> of the new files. To take account of this restriction, the >> .B protected >> ACL flag must be set if the >> .B inherited >> flag is set. This effectively disables Automatic Inheritance for that >> particular file. >> >> Automatic Inheritance still remains useful for network protocols like NF= Sv4 and >> SMB, which both support creating files and directories without defining = which > > s/which$/their/ > >> permissions: they can implement those operations by using the standard s= ystem >> calls and by then undoing the effect of applying the mode parameters. >> >> When the ACL of a directory is changed, the following happens for each e= ntry >> (\(lqchild\(rq) inside that directory: >> .IP 1. 4 >> If the entry is a symblic link, skip the child. >> .IP 2. >> If the >> .B auto_inherit >> flag of the entry's ACL is not set or the >> .B protected >> flag is set, skip the child. >> .IP 3. >> With the child's ACL: >> .RS 4 >> .IP a) 4 >> If the >> .B defaulted >> flag is set, replace the ACL with an empty ACL >> with the >> .B auto_inherit >> flag set. >> .IP b) >> Delete all entries which have the >> .B inherited >> flag set. >> .IP c) >> Append all entries inherited from the parent directory according to step= 1 of >> the algorithm described under >> .IR "Permissions at file-creation time". >> Set the >> .B inherited >> flag of each of these entries. >> .IP d) >> Recompute the file masks. >> .RE >> .IP 4. >> If the child is a directory, recursively apply this algorithm. >> >> .SS Access check algorithm >> >> When a process requests a particular kind of access (expressed as a set = of >> RichACL permissions) to a file, the following algorithm determines wheth= er the >> access is granted or denied: >> >> .IP 1. 4 >> If the >> .B masked >> ACL flag is set, then: >> .RS 4 >> .IP a) 4 >> If the >> .B write_through >> ACL flag is set, then: >> .RS 4 >> .IP \(bu 4 >> If the requesting process is the file owner, then access is granted if t= he >> owner mask includes the requested permissions, and is otherwise denied. >> .IP \(bu >> If the requesting process is not the file owner, is not in the owning gr= oup, >> and no ACL entries other than >> .B everyone@ >> match the process, then access is granted if the other mask includes the >> requested permissions, and is otherwise denied. >> .RE >> .IP b) >> If any of the following is true: >> .RS 4 >> .IP \(bu 4 >> the requesting process is the file owner and the owner mask does not inc= lude all >> requested permissions, >> .IP \(bu 4 >> the requesting process is not the file owner and it is in the owning gro= up or >> matches any ACL entries other than >> .BR everyone@ , >> and the group mask does not include all requested permissions, >> .IP \(bu 4 >> the requesting process is not the file owner, not in the owning group, i= t >> matches no ACL entries other than >> .BR everyone@ , >> and the other mask does not include all requested permissions, >> .PP >> then access is denied. >> .RE >> .RE >> .IP 2. >> Set the remaining permissions to the requested permissions. Go through = all ACL >> entries. For each entry: >> .RS 4 >> .IP a) 4 >> If the >> .B inherit_only >> or >> .B unmapped >> flags are set, continue with the next ACL entry. >> .IP b) >> If any of the following is true: >> .RS 4 >> .IP \(bu 4 >> the entry's identifier is >> .B owner@ >> and the requesting process is the file owner, >> .IP \(bu >> the entry's identifier is >> .B group@ >> and the requesting process is in the owning group, >> .IP \(bu >> the entry's identifier is a user and the requesting process is owned by = that >> user, >> .IP \(bu >> the entry's identifier is a group and the requesting process is a member= in >> that group, >> .IP \(bu >> the entry's identifier is >> .BR everyone@ , >> .PP >> then the entry matches the process; proceed to the next step. Otherwise, >> continue with the next ACL entry. >> .RE >> .IP c) >> If the entry denies any of the remaining permissions, access is denied. >> .IP d) >> If the entry allows any of the remaining permissions, then: >> .RS 4 >> .IP \(bu 4 >> If the >> .B masked >> ACL flag is set and the entry's identifier is not >> .B owner@ >> or >> .BR everyone@ >> or is a user entry matching the file owner, remove all permissions from = the >> remaining permissions which are both allowed by the entry and included i= n the >> group mask, >> .IP \(bu >> Otherwise, remove all permissions from the remaining permissions wich ar= e >> allowed by the entry. >> .RE >> .RE >> .IP 3. >> If there are no more remaining permissions, access is allowed. Otherwise= , >> access is denied. >> >> .SS Computing the maximum file masks >> When setting an ACL and no file masks have been explicitly specified and= when >> inheriting an ACL from the parent directory, the following algorithm is = used >> for computing the file masks: >> >> .IP 1. 4 >> Clear the owner, group, and other file masks. Remember which permissions= have >> already been processed (initially, the empty set). >> .IP 2. >> For each ACL entry: >> .RS 4 >> .IP \(bu 4 >> If the >> .B inherit_only >> flag is set, skip the entry. >> .IP \(bu 4 >> Otherwise, compute which permissions the entry allows or denies that hav= e not >> been processed yet (the remaining permissions). >> .IP \(bu >> If the entry is an >> .B owner@ >> entry, add the remaining permissions to the owner mask for >> .B allow >> entries, and remove the remaining permissions from the owner mask for >> .B deny >> entries. >> .IP \(bu >> Otherwise, if the entry is an >> .B everyone@ >> entry, proceed as with >> .B owner@ >> entries but add or remove the remaining permissions from the owner, grou= p, and >> other file masks. >> .IP \(bu >> Otherwise, proceed as with >> .B owner@ >> entries but add or remove the remaining permissions from the owner and g= roup >> file masks. >> .IP \(bu >> Add the entry's permissions to the processed permissions. >> .RE >> .PP >> The resulting file masks represent the ACL as closely as possible. With = these >> file masks, if the >> .B masked >> ACL flag is set, the effective permissions still stay the same. >> >> .\" .SH BUGS >> .SH AUTHOR >> Written by Andreas Gr=C3=BCnbacher . >> >> Please send your bug reports, suggested features and comments to the abo= ve address. > > Could we start with just a few simple examples already, and build up > over future iterations of this page? > >> .SH CONFORMING TO >> Rich Access Control Lists are Linux-specific. >> .SH SEE ALSO >> .BR acl (5), >> .BR chmod (1), >> .BR getrichacl (1), >> .BR ls (1), >> .BR setrichacl (1) >> .BR stat (2), >> .BR umask (2) >> .\" librichacl Thanks, Andreas From s.priebe@profihost.ag Sat Feb 20 12:03:22 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=ham version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay2.corp.sgi.com [137.38.102.29]) by oss.sgi.com (Postfix) with ESMTP id 83DB67CB9 for ; Sat, 20 Feb 2016 12:03:22 -0600 (CST) Received: from cuda.sgi.com (cuda3.sgi.com [192.48.176.15]) by relay2.corp.sgi.com (Postfix) with ESMTP id 4218630404E for ; Sat, 20 Feb 2016 10:03:16 -0800 (PST) X-ASG-Debug-ID: 1455991375-04cb6c455b27db0001-NocioJ Received: from mail-ph.de-nserver.de (mail-ph.de-nserver.de [85.158.179.214]) by cuda.sgi.com with ESMTP id b4LP2dctD97tO36n (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO) for ; Sat, 20 Feb 2016 10:02:56 -0800 (PST) X-Barracuda-Envelope-From: s.priebe@profihost.ag X-Barracuda-Apparent-Source-IP: 85.158.179.214 Received: (qmail 32642 invoked from network); 20 Feb 2016 19:02:54 +0100 X-Fcrdns: Yes Received: from p54BE516F.dip0.t-ipconnect.de (HELO [192.168.178.33]) (84.190.81.111) (smtp-auth username s.priebe@profihost.ag, mechanism plain) by mail-ph.de-nserver.de (qpsmtpd/0.92) with (ECDHE-RSA-AES256-SHA encrypted) ESMTPSA; Sat, 20 Feb 2016 19:02:54 +0100 Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (1.0) Subject: Re: xfs trace in 4.4.2 From: Stefan Priebe - Profihost AG X-ASG-Orig-Subj: Re: xfs trace in 4.4.2 X-Mailer: iPhone Mail (13D15) In-Reply-To: <20160220144533.GA36182@bfoster.bfoster> Date: Sat, 20 Feb 2016 19:02:53 +0100 Cc: "xfs@oss.sgi.com" , linux-fsdevel@vger.kernel.org, "xfs-masters@oss.sgi.com" Content-Transfer-Encoding: 7bit Message-Id: References: <56C81D94.7090603@profihost.ag> <20160220144533.GA36182@bfoster.bfoster> To: Brian Foster X-User-Auth: Auth by s.priebe@profihost.ag through 84.190.81.111 X-Barracuda-Connect: mail-ph.de-nserver.de[85.158.179.214] X-Barracuda-Start-Time: 1455991376 X-Barracuda-Encrypted: ECDHE-RSA-AES256-GCM-SHA384 X-Barracuda-URL: https://192.48.176.15:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-BRTS-Status: 1 X-Barracuda-Spam-Score: 0.00 X-Barracuda-Spam-Status: No, SCORE=0.00 using per-user scores of TAG_LEVEL=1000.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.7 tests=BSF_SC0_MISMATCH_TO X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.3.27191 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 0.00 BSF_SC0_MISMATCH_TO Envelope rcpt doesn't match header > Am 20.02.2016 um 15:45 schrieb Brian Foster : > >> On Sat, Feb 20, 2016 at 09:02:28AM +0100, Stefan Priebe wrote: >> Hi, >> >> got this one today. Not sure if this is a bug. > > That looks like the releasepage() delayed allocation block warning. I'm > not sure we've had any fixes for (or reports of) that issue since the > v4.2 timeframe. > > What is the xfs_info of the associated filesystem? Also, do you have any > insight as to the possible reproducer application or workload? Is this > reproducible at all? Note that this is a WARN_ON_ONCE(), so the warning > won't fire again regardless until after a reboot. Sorry no reproducer and also no xfs Info. As i didn't know which fs this was. But the job running is doing: mount /dev/loop0p3 /mpt xfs_repair -n /mpt unount /mpt Stefan > > Brian > >> [67674.907736] ------------[ cut here ]------------ >> [67674.955858] WARNING: CPU: 5 PID: 197 at fs/xfs/xfs_aops.c:1232 >> xfs_vm_releasepage+0xa9/0xe0() >> [67675.005345] Modules linked in: dm_mod netconsole ipt_REJECT >> nf_reject_ipv4 mpt3sas raid_class xt_multiport iptable_filter ip_tabl >> es x_tables 8021q garp bonding coretemp loop usbhid ehci_pci ehci_hcd >> sb_edac ipmi_si usbcore i2c_i801 edac_core usb_common ipmi_msg >> handler button btrfs xor raid6_pq raid1 md_mod sg igb sd_mod i2c_algo_bit >> ixgbe ahci i2c_core mdio isci libahci libsas ptp megaraid_ >> sas scsi_transport_sas pps_core >> [67675.221939] CPU: 5 PID: 197 Comm: kswapd0 Not tainted 4.4.2+1-ph #1 >> [67675.277120] Hardware name: Supermicro >> X9DRi-LN4+/X9DR3-LN4+/X9DRi-LN4+/X9DR3-LN4+, BIOS 3.2 03/04/2015 >> [67675.335176] ffffffffa3a5065d ffff88007950fa98 ffffffffa33bd4e1 >> 0000000000000001 >> [67675.392983] 0000000000000000 ffff88007950fad8 ffffffffa3083587 >> ffff88007950fae8 >> [67675.449743] 0000000000000001 ffffea0020883480 ffff880cf4b9cdd0 >> ffffea00208834a0 >> [67675.506112] Call Trace: >> [67675.561285] [] dump_stack+0x45/0x64 >> [67675.619364] [] warn_slowpath_common+0x97/0xe0 >> [67675.675719] [] warn_slowpath_null+0x1a/0x20 >> [67675.731113] [] xfs_vm_releasepage+0xa9/0xe0 >> [67675.786116] [] ? page_mkclean_one+0xd0/0xd0 >> [67675.844216] [] ? anon_vma_prepare+0x150/0x150 >> [67675.903862] [] try_to_release_page+0x32/0x50 >> [67675.957625] [] shrink_active_list+0x3ce/0x3e0 >> [67676.011497] [] shrink_lruvec+0x687/0x7d0 >> [67676.064980] [] shrink_zone+0xdc/0x2c0 >> [67676.118828] [] kswapd+0x4f9/0x930 >> [67676.172075] [] ? >> mem_cgroup_shrink_node_zone+0x150/0x150 >> [67676.225139] [] kthread+0xc9/0xe0 >> [67676.277539] [] ? kthread_stop+0xe0/0xe0 >> [67676.330124] [] ret_from_fork+0x3f/0x70 >> [67676.381816] [] ? kthread_stop+0xe0/0xe0 >> [67676.433499] ---[ end trace cb1827fe308f7f6b ]--- >> >> Greets Stefan >> >> _______________________________________________ >> xfs mailing list >> xfs@oss.sgi.com >> http://oss.sgi.com/mailman/listinfo/xfs From mtk.manpages@gmail.com Sun Feb 21 15:18:49 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=FREEMAIL_FROM,T_DKIM_INVALID autolearn=ham version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay3.corp.sgi.com [198.149.34.15]) by oss.sgi.com (Postfix) with ESMTP id 4D9827CB9 for ; Sun, 21 Feb 2016 15:18:49 -0600 (CST) Received: from cuda.sgi.com (cuda2.sgi.com [192.48.176.25]) by relay3.corp.sgi.com (Postfix) with ESMTP id B300FAC00D for ; Sun, 21 Feb 2016 13:18:42 -0800 (PST) X-ASG-Debug-ID: 1456088490-04cbb06adf4a6e0001-NocioJ Received: from mail-wm0-f53.google.com (mail-wm0-f53.google.com [74.125.82.53]) by cuda.sgi.com with ESMTP id IcDQh94Y2lk706VV (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128 verify=NO) for ; Sun, 21 Feb 2016 13:01:31 -0800 (PST) X-Barracuda-Envelope-From: mtk.manpages@gmail.com X-Barracuda-Apparent-Source-IP: 74.125.82.53 Received: by mail-wm0-f53.google.com with SMTP id g62so133011673wme.0 for ; Sun, 21 Feb 2016 13:01:31 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=subject:to:references:cc:from:message-id:date:user-agent :mime-version:in-reply-to:content-type:content-transfer-encoding; bh=R2kC1blT7vVYZD39HmEkXFLwM0cqWWz1qBz3ytJXvyM=; b=auguerSt2wIadL5xCh3TIv8rMNq7obUd1RPfbzc/jXDwUwXvm7d19/nZlIruNqZs/z t80Ves0BQtymLFeVH7d5r41A/wT9xKXOLbm8REVRhaSuG3RoVkLE+/7vIkHpiZwYfQ/i WQpMeqBDI1pZykRFkYKAQ+PGcOkcUpr7BHdMazN5X2GcpHLzctW6V6jQikbxziF+zOP3 clmlZVgQHM5SBNkrWUDyEXOlWVfGoKKh3i97JEI33drsM9CXGvSFTqKHR//0fnlnlI2B qLyK8AHQ8WNbH0suWatvVp9o398gwHguNR5KlOqA+kxkmJlbHOL3jlqkqEyFG71FMefN V9cA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:subject:to:references:cc:from:message-id:date :user-agent:mime-version:in-reply-to:content-type :content-transfer-encoding; bh=R2kC1blT7vVYZD39HmEkXFLwM0cqWWz1qBz3ytJXvyM=; b=ey/3MUKBZCRhAZKHzRyp6lYrhicMiwYIYLZW50DBxl1cnFwl+yjLxz7fdsskzCMqTq 66kXpk/kceKDaIXHTDe/sxsOOTG4Hk3Z3pWEe1dxT6wRtl4seovZDcb40zlSnKDzCNX3 FlOvPcMH+lT6m7fygggLJBlFgSW5ZLr2eUH1QOAHSeT++dIgTpkLxXhrOpk4eizCbBoW gzQiBQqqHjjlRjG7Q3MCPS4K+XdXC4LIwNj/o1CXYOG+xW1FAbp5VJvFmsVUjcmUNM3L YrQmZq2+WooiJOywa8j0Als4YaxpjL7C1T5VpUus334dBD4n5YD19PxbC4DPuIWPKfA8 VScw== X-Gm-Message-State: AG10YORXTx9sMsSRJpGwjjoyQ6go/bIEogoSQcOL1K22ODZ0ihMgNwQYZ2jrxCH0QXDAIw== X-Received: by 10.194.115.35 with SMTP id jl3mr23991740wjb.76.1456088490375; Sun, 21 Feb 2016 13:01:30 -0800 (PST) Received: from ?IPv6:2a02:8071:18c:8c00:7ee9:d3ff:fef5:1a91? ([2a02:8071:18c:8c00:7ee9:d3ff:fef5:1a91]) by smtp.gmail.com with ESMTPSA id m63sm18038996wmc.3.2016.02.21.13.01.27 (version=TLSv1/SSLv3 cipher=OTHER); Sun, 21 Feb 2016 13:01:28 -0800 (PST) Subject: Re: richacl(7) man page review comments To: Andreas Gruenbacher X-ASG-Orig-Subj: Re: richacl(7) man page review comments References: <56B770B6.7040803@gmail.com> <56B77262.7090107@gmail.com> <56C0F23C.7030902@gmail.com> Cc: mtk.manpages@gmail.com, "J. Bruce Fields" , linux-ext4 , XFS Developers , lkml , linux-fsdevel , Linux NFS Mailing List , linux-cifs@vger.kernel.org, Linux API , Dave Chinner , Christoph Hellwig , Anna Schumaker , Trond Myklebust , Jeff Layton , Andreas Dilger From: "Michael Kerrisk (man-pages)" X-Enigmail-Draft-Status: N1110 Message-ID: <56CA25A5.2030100@gmail.com> Date: Sun, 21 Feb 2016 22:01:25 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.5.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-Barracuda-Connect: mail-wm0-f53.google.com[74.125.82.53] X-Barracuda-Start-Time: 1456088491 X-Barracuda-Encrypted: ECDHE-RSA-AES128-GCM-SHA256 X-Barracuda-URL: https://192.48.176.25:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-BRTS-Status: 1 X-Barracuda-Spam-Score: 0.00 X-Barracuda-Spam-Status: No, SCORE=0.00 using per-user scores of TAG_LEVEL=1000.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.7 tests=BSF_SC0_MISMATCH_TO, DKIM_SIGNED, DKIM_VERIFIED X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.3.27219 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 0.00 BSF_SC0_MISMATCH_TO Envelope rcpt doesn't match header -0.00 DKIM_VERIFIED Domain Keys Identified Mail: signature passes verification 0.00 DKIM_SIGNED Domain Keys Identified Mail: message has a signature On 02/20/2016 05:37 PM, Andreas Gruenbacher wrote: > Hi Michael, > > thanks again for all the feedback. I've followed all your suggestions; > again, please see the github repo for the latest version: > > https://github.com/andreas-gruenbacher/richacl > > On Sun, Feb 14, 2016 at 10:31 PM, Michael Kerrisk (man-pages) > wrote: >> Hi Andreas, >> >> Here's a few more comments on the current richacl(7) page >> that I fetched from the git repo. >> [...] >>> .HP >>> .BR dir_inherit "\ (" d ): >>> The entry is inheritable for directories. >> >> "When this flag appears in the ACL entry of a directory, then that entry is >> inherited by new subdirectories created in the directory." >> >> Is that text that I propose correct? > > It's not entirely wrong, but only a small part of the truth. Entries > are inherited such that the permissions in file_inherit entries become > effective for access checking for new files, and the permissions in > dir_inherit entries become effective for access checking for new > directories, recursively. > > Your feedback prompted me to look into the inheritance flag > computation more closely once again, and I found bugs. The steps of > the algorithm are explained in the section "Permissions at > file-creation time", by the way. Hmmm... writing and refining documentation helps find code bugs. Who knew? :-) Cheers, Michael -- Michael Kerrisk Linux man-pages maintainer; http://www.kernel.org/doc/man-pages/ Linux/UNIX System Programming Training: http://man7.org/training/ From mtk.manpages@gmail.com Sun Feb 21 15:41:20 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=FREEMAIL_FROM,T_DKIM_INVALID autolearn=ham version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay2.corp.sgi.com [137.38.102.29]) by oss.sgi.com (Postfix) with ESMTP id 015B27CBD for ; Sun, 21 Feb 2016 15:41:20 -0600 (CST) Received: from cuda.sgi.com (cuda3.sgi.com [192.48.176.15]) by relay2.corp.sgi.com (Postfix) with ESMTP id B1CF2304097 for ; Sun, 21 Feb 2016 13:41:13 -0800 (PST) X-ASG-Debug-ID: 1456090864-04cb6c455c536f0001-NocioJ Received: from mail-wm0-f44.google.com (mail-wm0-f44.google.com [74.125.82.44]) by cuda.sgi.com with ESMTP id ME2xTqr8YGzhSrVJ (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128 verify=NO) for ; Sun, 21 Feb 2016 13:41:05 -0800 (PST) X-Barracuda-Envelope-From: mtk.manpages@gmail.com X-Barracuda-Apparent-Source-IP: 74.125.82.44 Received: by mail-wm0-f44.google.com with SMTP id g62so133711544wme.0 for ; Sun, 21 Feb 2016 13:41:05 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=subject:to:references:cc:from:message-id:date:user-agent :mime-version:in-reply-to:content-type:content-transfer-encoding; bh=Wr9XiRDm6rfziVJy0KmquVc57sNiQkgIZ8b6cZyqjEY=; b=hakhaci75CnzV85OK6/7xhudc77NWGujqbdtzVhzT5VkLn30jvPiyU2QOguRsf2lTK T6j636s1vm95R6JdQzMUFIoPOoaNzkcVBpxtDxpKgpGgJhoq8WErNynvtMojP9cHlkgL 71wa3WsBLQMQLJaP5gnNQA+2ggnzcI0IFKtgdvXzDNKCMLh7PrUT48qaleJ/6TQ1j9UB WJneXFX/vwQ+uYZ0nI8hVh+AgLeapSx3GdvxPMrhbddJuhpx6SWA2cfPjse8QaNtGYgA uwjiBHShVZJkgnq1zqd+6M7JzxKDrNOWh8+Um+z4AC5dH6JB0OkKbSKOFQtxCTvYccxE sarQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:subject:to:references:cc:from:message-id:date :user-agent:mime-version:in-reply-to:content-type :content-transfer-encoding; bh=Wr9XiRDm6rfziVJy0KmquVc57sNiQkgIZ8b6cZyqjEY=; b=liJXIrDeYYFtXk3Yo/9pwBNIh0Z5AHSn5IF+O2ggkC7m4UOfMkJdp6itbHPOqaqryY ia5kFYLU+VgGK6jvMj74+7An6Yby/zEK0UfVgR1+Kj21ZWMlmG1tb8FgDlazFhLq3FF/ yLBx4J4wSJo6qK2kF3oGMMQsrT0J1gR4rxlmowZdG3G3ut9qg7GfA9rqlwNDHHKLs8N/ 4gIzzLd3rcX/FPT1IdW9shk8A4BtPSjy/Tw/YQlWcFlgMtmIyT9RoqAcZHOrdwKgeLit ddQhb9/bIbcVK389yOGXge/mFdq5JDcewbx/OzYXP7EFteZIfMODms49uWyQxmUBC+dB tIVA== X-Gm-Message-State: AG10YOT8JsxH4gmUTubJR4O5wytXAmIxgzpxu/TWaq4x21XhNsb32h+k3vjW/Pyqb39tMA== X-Received: by 10.28.174.8 with SMTP id x8mr9008841wme.49.1456090864553; Sun, 21 Feb 2016 13:41:04 -0800 (PST) Received: from ?IPv6:2a02:8071:18c:8c00:7ee9:d3ff:fef5:1a91? ([2a02:8071:18c:8c00:7ee9:d3ff:fef5:1a91]) by smtp.gmail.com with ESMTPSA id k4sm18177505wmc.12.2016.02.21.13.41.01 (version=TLSv1/SSLv3 cipher=OTHER); Sun, 21 Feb 2016 13:41:02 -0800 (PST) Subject: Re: richacl(7) man page review comments To: Andreas Gruenbacher X-ASG-Orig-Subj: Re: richacl(7) man page review comments References: <56B770B6.7040803@gmail.com> <56B77262.7090107@gmail.com> <56C0F23C.7030902@gmail.com> Cc: mtk.manpages@gmail.com, "J. Bruce Fields" , linux-ext4 , XFS Developers , lkml , linux-fsdevel , Linux NFS Mailing List , linux-cifs@vger.kernel.org, Linux API , Dave Chinner , Christoph Hellwig , Anna Schumaker , Trond Myklebust , Jeff Layton , Andreas Dilger From: "Michael Kerrisk (man-pages)" Message-ID: <56CA2EEB.9080504@gmail.com> Date: Sun, 21 Feb 2016 22:40:59 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.5.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Barracuda-Connect: mail-wm0-f44.google.com[74.125.82.44] X-Barracuda-Start-Time: 1456090865 X-Barracuda-Encrypted: ECDHE-RSA-AES128-GCM-SHA256 X-Barracuda-URL: https://192.48.176.15:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-BRTS-Status: 1 X-Barracuda-Spam-Score: 0.00 X-Barracuda-Spam-Status: No, SCORE=0.00 using per-user scores of TAG_LEVEL=1000.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.7 tests=BSF_SC0_MISMATCH_TO, DKIM_SIGNED, DKIM_VERIFIED X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.3.27219 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 0.00 BSF_SC0_MISMATCH_TO Envelope rcpt doesn't match header -0.00 DKIM_VERIFIED Domain Keys Identified Mail: signature passes verification 0.00 DKIM_SIGNED Domain Keys Identified Mail: message has a signature Hello Andreas, On 02/20/2016 05:37 PM, Andreas Gruenbacher wrote: > Hi Michael, > > thanks again for all the feedback. I've followed all your suggestions; > again, please see the github repo for the latest version: > > https://github.com/andreas-gruenbacher/richacl I've once more pulled from the latest git; here's some more comments. > .\" > .\" RichACL Manual Pages > .\" > .\" Copyright (C) 2015,2016 Red Hat, Inc. > .\" Written by Andreas Gruenbacher > .\" This is free documentation; you can redistribute it and/or > .\" modify it under the terms of the GNU General Public License as > .\" published by the Free Software Foundation; either version 2 of > .\" the License, or (at your option) any later version. > .\" > .\" The GNU General Public License's references to "object code" > .\" and "executables" are to be interpreted as the output of any > .\" document formatting or typesetting system, including > .\" intermediate and printed output. > .\" > .\" This manual is distributed in the hope that it will be useful, > .\" but WITHOUT ANY WARRANTY; without even the implied warranty of > .\" MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the > .\" GNU General Public License for more details. > .\" > .\" You should have received a copy of the GNU General Public > .\" License along with this manual. If not, see > .\" . > .\" > .de URL > \\$2 \(laURL: \\$1 \(ra\\$3 > .. > .if \n[.g] .mso www.tmac > .TH RICHACL 7 2015-09-01 "Linux" "Rich Access Control Lists" > .SH NAME > richacl \- Rich Access Control Lists > .SH DESCRIPTION > Rich Access Control Lists (RichACLs) are an extension of the POSIX file > permission model (see > .BR acl (5)) > to support > .URL https://tools.ietf.org/rfc/rfc5661.txt "NFSv4 Access Control Lists" > on local and remote-mounted filesystems. > > A RichACL can always be translated into an equivalent NFSv4 ACL which grants > the same permissions. > > RichACLs can be enabled on supported local filesystems (currently, ext4 and > XFS). This disables POSIX Access Control Lists; the two ACL models cannot > coexist on the same filesystem. > > The in-kernel NFSv4 server and client also include RichACL support. Rewrite the preceding two paras in a better logical split and order: [[ RichACLs can be enabled on supported local filesystems (currently, ext4 and XFS). The in-kernel NFSv4 server and client also include RichACL support. Enabling RichACLs disables POSIX Access Control Lists; the two ACL models cannot coexist on the same filesystem. ]] > > When used on a filesystem that does not support RichACLs, the > .BR getrichacl (1) > and > .BR setrichacl (1) > utilities will operate on the file permission bits instead: > .BR getrichacl (1) > will display the file permission bits as a RichACL; when a RichACL > is set with > .BR setrichacl (1) > which can be represented exactly by the file permission bits, > .BR setrichacl (1) > will set the file permission bits instead. An attempt to set a RichACL that > cannot be represented exactly by the file permission bits results in an error. > > .SS Structure of RichACLs > > RichACLs consist of a number of ACL entries, three file masks, and some flags s/some flags/a set of flags/ > specifying attributes of the ACL as whole (by contrast with the per-ACL-entry s/whole/a whole/ > flags described below). > > Each of the ACL entries allows or denies some permissions to a particular user, > group, or special identifier. An ACL entry consists of four fields: > > .IP \(bu 4 s/4/2/ > A tag which specifies the user, group, or special identifier the entry applies > to. Special identifiers can be the file owner, the owning group, or everyone. ==> Special identifiers correspond to one of three file masks for the file owner .RB ( owner@ ), the owning group .RB ( group@ ), or everyone .RB ( everyone@ ). > .IP \(bu > A set of permissions the entry allows or denies. > .IP \(bu > A set of flags that indicate whether the user or group identifier is mapped or > unmapped, and whether the entry has been and can be inherited. > .IP \(bu 4 s/ 4// > A type field indicating whether the entry allows or denies access. s/access/the permissions specified in the second field/ > .PP > The owner, group, and other file masks further control which permissions the > ACL grants, subject to the > .BR masked "\ (" m ) > and > .BR write_through "\ (" w ) > ACL flags: when the permissions of a file or directory are changed with > .BR chmod (2), > the file masks are set based on the new file mode, and the > .B masked > and > .B write_through > ACL flags are set. Likewise, when a new file or directory inherits an ACL from > its parent directory, the file masks are set to the intersection between the > permissions granted by the inherited ACL and the > .I mode > parameter as given to > .BR open "(2), " mkdir (2), > and similar, and the > .B masked > ACL flag is set. In both cases, the file masks limit the permissions that the > ACL will grant. > > The advantage of this approach over directly modifying the ACL entries is that > permissions defined in ACL entries are not lot when the file masks are later s/lot/lost/ > set to be less restrictive. (I think) I know what you are trying to say in the previous paragraph, but "this approach" and "directly modifying the ACL entries" is a little vague. Masks are about solving the hysteresis problem, right? So, how about some text along the following lines (I'm sure you can improve): [[ The purpose of the file masks is to allow applications that are unaware of RichACLs to place limits on the permissions granted by various classes of RichACL in a manner that corresponds to the traditional user/group/other semantics, without modifying the ACL entries in those classes. Without the file masks, the only alternative would be for the kernel to directly modify the ACL entries in those classes. However, this latter approach could have a "hysteresis effect", whereby a RichACL-unaware application that performs a transition from one file mode to another file mode and then back to the original file mode could cause destruction of the permission information in ACL entries. ]] > > Note that entries with the identifier > .B everyone@ > apply to all processes, whereas the \(lqother\(rq file permissions and > \(lqother\(rq entries in POSIX ACLs apply to all processes which are not the I'd be inclined to use (or add) \fBACL_OTHER\fP instead of "other" in the preceding line. Things makes things IMO a little clearer when you try to distinguish from "other" file permissions. > owner, are not in the owning group, and do not match a user or group mentioned > in the ACL. > > Unlike POSIX ACLs, RichACLs do not have separate \(lqaccess\(rq ACLs that > define the access permissions and \(lqdefault\(rq ACLs that define the > inheritable permissions. Instead, flags on each ACL entry determine whether > the entry is effective during access checks and/or inheritable. > > > .SS ACL flags > > The following flags on ACLs are defined: s/flags on ACLs/ACL flags/ > > .TP > .BR masked "\ (" m ) > When set, the file masks define upper limits on the permissions the ACL may > grant. When not set, the file masks are ignored. > .TP > .BR write_through "\ (" w ) > When this flag and the > .B masked > flag are both set, the owner and other file masks define the actual permissions > granted to the file owner and to others instead of defining an upper limit. > When the > .B masked > flag is not set, the write_through flag has no effect. Use .BR write_through for preceding line > .TP > .BR auto_inherit "\ (" a ) > Automatic Inheritance is enabled. See > .IR "Automatic Inheritance" . > .TP > .BR protected "\ (" p ) > The ACL is protected from modification by Automatic > Inheritance. > .TP > .BR defaulted "\ (" d ) > Indicates that the ACL has been assigned in an application-dependent way when > the file or directory was created; it has neither been inherited nor set > explicitly. ACLs of files created on Linux will never have the > .B defaulted > flag set. The preceding sentence immediately triggers an obvious question for the reader. So, do we need a sentence here to say when/where the "defaulted" flag is set? > When this flag is set for an ACL, Automatic Inheritance will > completely replace the ACL. > > .SS ACL entry flags > > The following flags on ACL entries are defined: > > .TP > .BR file_inherit "\ (" f ) > When this flag appears in the ACL entry of a directory, then: > .RS > .IP \(bu 4 > That entry is inherited by new files created in the directory such that the s/4/2/ > permissions of the entry apply to the file (the inheritance flags of the > inherited entry are cleared). > .IP \(bu 4 > The entry is is inherited by new subdirectories created in the directory such s/ 4// > that the permissions of the entry will apply to new files created in the > subdirectory. > .RE > .TP > .BR dir_inherit "\ (" d ) > When this flag appears in the ACL entry of a directory, then that entry is > inherited by new subdirectories created in the directory such that the > permissions of the entry apply to the subdirectory (the > .B inherit_only > flag is cleared). > .TP > .BR no_propagate "\ (" n ) > Inheritance stops at the next subdirectory level. When a file or directory > inherits an entry that has this flag set, the > .BR file_inherit ", " dir_inherit ", " no_propagate ", and " inherit_only > flags are cleared. > .TP > .BR inherit_only "\ (" i ) > The entry defines inheritable permissions only and is ignored for access > checking. When a file or directory inherits an entry that has this flag set, > the flag is cleared. > .TP > .BR inherited "\ (" a ) > The entry has been automatically inherited from the parent directory; the > ACL's > .B auto_inherit > flag should be on. Why "should be" in the previous sentence? I think a little explanation is needed here... > .TP > .BR unmapped "\ (" u ) > The user or group identifier is a textual string and is not mapped to a numeric > user or group identifier. ACLs with unmapped identifiers can occur on NFSv4 > mounted filesystems when the client cannot determine numeric user or group > identifiers for some of the NFSv4 user@domain or group@domain who values. They > cannot be assigned to local files or directories. > > .SS Permissions > > The following permissions are defined for RichACL entries and for the three > file masks: > > .TP > .BR read_data " / " list_directory "\ (" r ) > For a file: read the data of the file. > For a directory: list the contents of the directory. > .TP > .BR write_data " / " add_file "\ (" w ) > For a file: modify the data of the file; does not include opening the file in > append mode. > For a directory: add a new file in the directory. > .TP > .BR append_data " / " add_subdirectory "\ (" p ) > For a file: open the file in append mode. > For a directory: create a subdirectory in the directory. > .TP > .BR execute "\ (" x ) > For a file: execute the file. > For a directory: traverse / search the directory. s%traverse / search%traverse (search)% > .TP > .BR delete_child "\ (" d ) > Delete a file or directory within a directory. This permission is meaningless > for non-directories. ==> "This permission is meanungful only for directories." > .TP > .BR delete "\ (" D ) > Delete the file or directory. > .TP > .BR read_attributes "\ (" a ) > Read basic attributes of a file or directory (see > .BR stat (2)). > This permission is defined by NFSv4. It is stored, but ignored. Reading basic > attributes of files and directories is always allowed on Linux. > .TP > .BR write_attributes "\ (" A ) > Change the times associated with a file or directory to an arbitrary value. > This permission is always implicitly granted to the file owner. > .TP > .BR read_acl "\ (" c ) > Read the ACL of a file or directory. This permission is always > implicitly granted. So, I think a sentence explaining why "read_acl" exists would be helpful, since the reader is left a little puzzled about its purpose if it is always implicitly granted. > .TP > .BR write_acl "\ (" C ) > Change the ACL or file mode of a file or directory. > .TP > .BR write_owner "\ (" o ) > Take ownership of a file or directory. Change the owning group of a file or > directory to a group of which the calling process is a member. > .TP Formatting tweak: add ".ad l" before the following line amd ".ad" after the line. > .BR read_named_attrs "\ (" R "), " write_named_attrs "\ (" W "), " synchronize "\ (" S "), " write_retention "\ (" e "), " write_retention_hold "\ (" E ) > These permissions are defined by NFSv4 / NFSv4.1. They are stored, but ignored. s%/%and% > .PP > For the > .BR r ", " w ", and " p > permissions which have different long forms for files and directories, the s/permissions/permissions,/ > .BR getrichacl (1) > utility will output the appropriate form(s) depending on the context. > The > .BR setrichacl (1) > utility will accept either form for any file type. > > .SS Text form > The common textual representation of a RichACL consists of the colon-separated > fields of the ACL flags, file masks, and ACL entries in the following > format: > .TP > \fBflags:\fR\fIacl_flags\fR > The ACL flags. > .TP > \fBowner:\fR\fIperm\fR\fB::mask\fR, \fBgroup:\fR\fIperm\fR\fB::mask\fR, \fBother:\fR\fIperm\fR\fB::mask\fR > The file masks and their permissions. > .TP > \fIwho\fR\fB:\fR\fIperm\fR\fB:\fR\fIflags\fR\fB:allow\fR, \fIwho\fR\fB:\fR\fIperm\fR\fB:\fR\fIflags\fR\fB:deny\fR > For each ACL entry, who the entry applies to, the permissions of the entry, the > entry flags, and the entry type. The who field is one of the following: s/who/\\fIwho\\fP/ > .RS > .IP \(bu 4 s/4/2/ > One of the special identifiers: > .BR owner@ ", " group@ ", or " everyone@ , > .IP \(bu > A > .BR user: " or " u: > prefix followed by a user name or user ID that designates a specific user, > .IP \(bu > A > .BR group: " or " g: > prefix followed by a group name or group ID that designates a specific group. > .RE > .PP > The entries are comma, whitespace, or newline separated. > > Flags and permissions have single-letter as well as long forms, as listed under > .IR "ACL flags" , > .IR "ACL entry flags" , > and > .IR Permissions . > When the single-letter forms are used, the flags or permissions are > concatenated. When the long forms are used, the flags or permissions are > separated by slashes. To align permissions or flags vertically, dashes can be > used for padding. > > .SS Setting and modifying file permissions > The access permissions for a file can either be set by assigning an Access > Control List > .RB ( setrichacl (1)) > or by changing the file mode permission bits > .RB ( chmod (1)). > In addition, a file can inherit an ACL from its parent directory at creation > time as described under > .IR "Permissions at file-creation time" . > > .SS Assigning an Access Control List > When assigning an ACL to a file, unless explicitly specified, the owner, group, > and other file masks will be computed from the ACL entries as described in > the section > .IR "Computing the maximum file masks" . > The owner, group, and other file mode permission bits are then each set from > the owner, group, and other file mask as follows: > .IP \(bu 4 s/4/2/ > If the file mask includes the > .B r > permission, the read > file mode permission bit will be set. > .IP \(bu > If the file mask includes the > .B w > or > .B p > permission, the write file mode permission bit will be set. > .IP \(bu > If the file mask includes the > .B x > permission, the execute file mode permission bit will be set. > .PP > If the ACL can be represented exactly by the file mode > permission bits, the file permission bits are set to match the ACL and the ACL > is not stored. Maybe better: "...and no ACL is stored" > (When the ACL of a file is requested which doesn't have an ACL, > the file mode permission bits are converted into an equivalent ACL.) > > .SS Changing the file mode permission bits > When changing the file mode permission bits with > .BR chmod (1), > the owner, group, and other file permission bits are set to the permission bits > in the new mode, and the owner, group, and other file masks are set based on > the new mode bits as follows: > .IP \(bu 4 s/4/2/ > If the read bit in a set of permissions is set, the > .B r > permission in the corresponding file mask will be set. > .IP \(bu > If the write bit in a set of permissions is set, the > .B w > and > .B p > permissions in the corresponding file mask will be set. > .IP \(bu > If the execute bit in a set of permissions is set, the > .B x > permission in the corresponding file mask will be set. > .PP > In addition, the > .B masked > and > .B write_through > ACL flags are set. This has the > effect of limiting the permissions granted by the ACL to the file mode > permission bits; in addition, the owner is granted the owner mode bits and > others are granted the other mode bits. If the > .B auto_inherit > flag is set, the > .B protected > flag is also set to prevent the Automatic Inheritance algorithm from modifying > the ACL. > > .SS Permissions at file-creation time > When a directory has inheritable ACL entries, the following s/has/has an/ > happens when a file or directory is created inside that directory: > .RS 4 > .IP 1. 4 > A file created inside that directory will inherit all of the ACL entries that > have the > .B file_inherit > flag set, and all inheritance-related flags in the inherited entries flag will > be cleared. > > A subdirectory created inside that directory will inherit all of the ACL > entries that either have the > .B dir_inherit > flag set, or the > .B file_inherit > flag set and the > .B no_propagate > flag not set. Entries whose > .B dir_inherit > flag is set will have their > .B inherit_only > flag cleared, and entries whose > .B dir_inherit > flag is not set will have their > .B inherit_only > flag set. Finally, entries whose > .B no_propagate > flag is set will have all inheritance-related flags cleared. > .IP 2. > If the parent directory's ACL has the > .B auto_inherit > flag set, the inherited ACL will have its > .B auto_inherit > flag set, and all entries will have their > .B inherited > flag set. Otherwise, the > .B auto_inherit > and > .B inherited > flags are cleared. > .IP 3. > The three file masks are computed from the inherited ACL as described in > the section > .IR "Computing the maximum file masks" . > .IP 4. > The three sets of permissions for the owner, the group, and for others in > the \fImode\fR parameter as given to > .BR open (2), > .BR mkdir (2), > and similar are converted into sets of RichACL permissions. The correspondence > between mask flags and RichACL permission bits is described in the section > .IR "Changing the file mode permission bits" . > Any RichACL permissions not included in those sets are > removed from the owner, group, and other file masks. The file mode permission > bits are then computed from the file masks as described in the section > .IR "Assigning an Access Control List" . > The process umask (see > .BR umask (2)) > is ignored. > .IP 5. > The > .B masked > ACL flag is set. The > .B write_through > ACL flag remains cleared. In addition, if the > .B auto_inherit > flag of the inherited ACL is set, the > .B protected > flag is also set to prevent the Automatic Inheritance algorithm from modifying > the ACL. > .RE > .PP > When a directory does not have inheritable ACL entries, files and directories > created inside that directory will not be assigned Access Control Lists and the > file mode permission bits will be set to (\fImode\fR\ &\ ~\fIumask\fR) where > \fImode\fR is the mode argument of the relevant system call and \fIumask\fR is > the process umask (see > .BR umask (2)). > > .SS Automatic Inheritance > Automatic Inheritance is a mechanism that allows permission changes to > propagate from a directory to files and subdirectories inside that directory, > recursively. Propagation is carried out by the process changing the directory > permissions (usually, > .BR setrichacl (1)); > it happens without user intervention albeit not entirely automatically. > > A significant limitation is that this mechanism works only as long as files > are created without explicitly specifying the file permissions to use. The > standard system calls for creating files and directories > .RB ( creat (2), > .BR open (2), > .BR mkdir (2), > .BR mknod (2)) > all have mandatory mode parameters which define the maximum allowed permissions > of the new files. To take account of this restriction, the > .B protected > ACL flag must be set if the > .B inherited > flag is set. This effectively disables Automatic Inheritance for that > particular file. > Add the following at the start of the next paragraph: "Motwithstanding the aforementioned limitation," > Automatic Inheritance still remains useful for network protocols like NFSv4 and > SMB, which both support creating files and directories without defining their > permissions: they can implement those operations by using the standard system s/: they/. These protocols/ (To avoid an excessively long sentence.) > calls and by then undoing the effect of applying the mode parameters. > > When the ACL of a directory is changed, the following happens for each entry > (\(lqchild\(rq) inside that directory: > .IP 1. 4 > If the entry is a symblic link, skip the child. s/symblic/symbolic/ > .IP 2. > If the > .B auto_inherit > flag of the entry's ACL is not set or the > .B protected > flag is set, skip the child. > .IP 3. > With the child's ACL: > .RS 4 > .IP a) 4 > If the > .B defaulted > flag is set, replace the ACL with an empty ACL > with the > .B auto_inherit > flag set. > .IP b) > Delete all entries which have the > .B inherited > flag set. > .IP c) > Append all entries inherited from the parent directory according to step 1 of > the algorithm described under > .IR "Permissions at file-creation time". > Set the > .B inherited > flag of each of these entries. > .IP d) > Recompute the file masks. > .RE > .IP 4. > If the child is a directory, recursively apply this algorithm. > > .SS Access check algorithm > > When a process requests a particular kind of access (expressed as a set of > RichACL permissions) to a file, the following algorithm determines whether the > access is granted or denied: > > .IP 1. 4 > If the > .B masked > ACL flag is set, then: > .RS 4 > .IP a) 4 > If the > .B write_through > ACL flag is set, then: > .RS 4 s/4/2/ > .IP \(bu 4 s/4/2/ > If the requesting process is the file owner, then access is granted if the > owner mask includes the requested permissions, and is otherwise denied. > .IP \(bu > If the requesting process is not the file owner, is not in the owning group, > and no ACL entries other than > .B everyone@ > match the process, then access is granted if the other mask includes the > requested permissions, and is otherwise denied. So, in the above subcases, the following does not seem to be covered: (1) "masked" ACL flag is set AND (2) requesting process *is* in owning group *or* an ACL other than "everyone@"matches the process. What happens in this case? I suspect that somehow we are supposed to fall through to part "b)" below (and possibly into clause "2."?), but the logical structure of the clauses does not reflect this. > .RE > .IP b) > If any of the following is true: > .RS 4 s/4/2/ > .IP \(bu 4 s/4/2/ > the requesting process is the file owner and the owner mask does not include all > requested permissions, > .IP \(bu 4 s/ 4// > the requesting process is not the file owner and it is in the owning group or > matches any ACL entries other than > .BR everyone@ , > and the group mask does not include all requested permissions, > .IP \(bu 4 s/ 4// > the requesting process is not the file owner, not in the owning group, it > matches no ACL entries other than > .BR everyone@ , > and the other mask does not include all requested permissions, > .PP > then access is denied. > .RE > .RE At some point, perhaps in the next paragraph, I think that it needs to be clarified that unlike POSIX ACLs, a process can gain the permissions it requires by accumulating them from multiple RichACL enties. (That's correct, is it not?) > .IP 2. > Set the remaining permissions to the requested permissions. Go through all ACL > entries. For each entry: So, perhaps replace the preceding two lines with something like: [[ Upon reaching this point, the determination of whether or not access is granted is made by scanning all ACL entries to see if one or more applicable entries together grant a cumulative set of permissions that matches the requested permissions or there is an applicable entry that explicitly denies one or more of the requested permissions. The scan of all ACL entries begins by first initializing the set of remaining permissions (i.e., those that have not yet been satisfied during the scan) to be the set of requested permissions. Then the ACL entries are scanned .IR "in order" , and for each entry: ]] > .RS 4 > .IP a) 4 > If the > .B inherit_only > or > .B unmapped > flags are set, continue with the next ACL entry. > .IP b) > If any of the following is true: > .RS 4 s/4/2/ > .IP \(bu 4 s/4/2/ > the entry's identifier is > .B owner@ > and the requesting process is the file owner, > .IP \(bu > the entry's identifier is > .B group@ > and the requesting process is in the owning group, > .IP \(bu > the entry's identifier is a user and the requesting process is owned by that > user, > .IP \(bu > the entry's identifier is a group and the requesting process is a member in > that group, > .IP \(bu > the entry's identifier is > .BR everyone@ , > .PP > then the entry matches the process; proceed to the next step. Otherwise, > continue with the next ACL entry. > .RE > .IP c) > If the entry denies any of the remaining permissions, access is denied. > .IP d) > If the entry allows any of the remaining permissions, then: > .RS 4 s/4/2/ > .IP \(bu 4 s/4/2/ > If the > .B masked > ACL flag is set and the entry's identifier is not > .B owner@ > or > .BR everyone@ > or is a user entry matching the file owner, remove all permissions from the > remaining permissions which are both allowed by the entry and included in the > group mask, > .IP \(bu > Otherwise, remove all permissions from the remaining permissions wich are s/wich/which > allowed by the entry. > .RE > .RE > .IP 3. > If there are no more remaining permissions, access is allowed. Otherwise, > access is denied. > > .SS Computing the maximum file masks > When setting an ACL and no file masks have been explicitly specified and when > inheriting an ACL from the parent directory, the following algorithm is used > for computing the file masks: > > .IP 1. 4 > Clear the owner, group, and other file masks. Remember which permissions have > already been processed (initially, the empty set). > .IP 2. > For each ACL entry: > .RS 4 s/4/2/ > .IP \(bu 4 s/4/2/ > If the > .B inherit_only > flag is set, skip the entry. > .IP \(bu 4 s/ 4// > Otherwise, compute which permissions the entry allows or denies that have not > been processed yet (the remaining permissions). > .IP \(bu > If the entry is an > .B owner@ > entry, add the remaining permissions to the owner mask for > .B allow > entries, and remove the remaining permissions from the owner mask for > .B deny > entries. > .IP \(bu > Otherwise, if the entry is an > .B everyone@ > entry, proceed as with > .B owner@ > entries but add or remove the remaining permissions from the owner, group, and > other file masks. > .IP \(bu > Otherwise, proceed as with > .B owner@ > entries but add or remove the remaining permissions from the owner and group > file masks. > .IP \(bu > Add the entry's permissions to the processed permissions. > .RE > .PP > The resulting file masks represent the ACL as closely as possible. With these > file masks, if the > .B masked > ACL flag is set, the effective permissions still stay the same. The meaing of "will stay the same" is not quite clear "will stay the same *as what*"?). I suspect I know what you mean, but it needs to be made more obvious. > > .\" .SH BUGS > .SH AUTHOR > Written by Andreas Grünbacher . > > Please send your bug reports, suggested features and comments to the above address. > I'm going to play the broken record :-) Could we start with just a few simple examples already, and build up over future iterations of this page? > .SH CONFORMING TO > Rich Access Control Lists are Linux-specific. > .SH SEE ALSO > .BR acl (5), Move this entry to the point XXX below. > .BR chmod (1), > .BR getrichacl (1), > .BR ls (1), > .BR setrichacl (1) > .BR stat (2), > .BR umask (2) > .\" librichacl XXX By the way, are there already man pages for the librichacl functions? Cheers, Michael -- Michael Kerrisk Linux man-pages maintainer; http://www.kernel.org/doc/man-pages/ Linux/UNIX System Programming Training: http://man7.org/training/ From david@fromorbit.com Sun Feb 21 17:38:48 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=ham version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay1.corp.sgi.com [137.38.102.111]) by oss.sgi.com (Postfix) with ESMTP id 7176E7CB4 for ; Sun, 21 Feb 2016 17:38:48 -0600 (CST) Received: from cuda.sgi.com (cuda2.sgi.com [192.48.176.25]) by relay1.corp.sgi.com (Postfix) with ESMTP id 412288F80B6 for ; Sun, 21 Feb 2016 15:38:42 -0800 (PST) X-ASG-Debug-ID: 1456096709-04cbb06ade4d0e0001-NocioJ Received: from ipmail07.adl2.internode.on.net (ipmail07.adl2.internode.on.net [150.101.137.131]) by cuda.sgi.com with ESMTP id nH7OPCuBzbgN7tHb for ; Sun, 21 Feb 2016 15:18:29 -0800 (PST) X-Barracuda-Envelope-From: david@fromorbit.com X-Barracuda-Apparent-Source-IP: 150.101.137.131 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: A2DxBgC+RMpW/5bY03ZegzqBP4JppA0BAQQGi3OJUYYHAgIBAQKBIk0BAQEBAQFlJ4RCAQEEIw8BIyMQCAMOCgICBSECAg8FJQMhE4gZpmSOMgEBAQcCAR0YY4RPhQOED4MmK4EPBZcHjVWOfESOBWKDeCguhxwHgTMBAQE Received: from ppp118-211-216-150.lns20.syd4.internode.on.net (HELO dastard) ([118.211.216.150]) by ipmail07.adl2.internode.on.net with ESMTP; 22 Feb 2016 09:48:27 +1030 Received: from dave by dastard with local (Exim 4.80) (envelope-from ) id 1aXdGZ-0006tU-78; Mon, 22 Feb 2016 10:18:15 +1100 Date: Mon, 22 Feb 2016 10:18:15 +1100 From: Dave Chinner To: Brian Foster Cc: Jan Tulak , xfs-oss Subject: Re: What is the meaning of XLOG_MIN_RECORD_BSIZE? (Missing a check?) Message-ID: <20160221231815.GD25832@dastard> X-ASG-Orig-Subj: Re: What is the meaning of XLOG_MIN_RECORD_BSIZE? (Missing a check?) References: <20160219154347.GA27263@bfoster.bfoster> <20160219162913.GC27263@bfoster.bfoster> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20160219162913.GC27263@bfoster.bfoster> User-Agent: Mutt/1.5.21 (2010-09-15) X-Barracuda-Connect: ipmail07.adl2.internode.on.net[150.101.137.131] X-Barracuda-Start-Time: 1456096709 X-Barracuda-URL: https://192.48.176.25:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-BRTS-Status: 1 X-Barracuda-Spam-Score: 0.00 X-Barracuda-Spam-Status: No, SCORE=0.00 using per-user scores of TAG_LEVEL=1000.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.7 tests=BSF_SC0_MISMATCH_TO X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.3.27222 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 0.00 BSF_SC0_MISMATCH_TO Envelope rcpt doesn't match header On Fri, Feb 19, 2016 at 11:29:13AM -0500, Brian Foster wrote: > On Fri, Feb 19, 2016 at 05:16:28PM +0100, Jan Tulak wrote: > > On Fri, Feb 19, 2016 at 4:43 PM, Brian Foster wrote: > > > On Fri, Feb 19, 2016 at 02:34:52PM +0100, Jan Tulak wrote: > > > > There is no check for a minimal value, so I can do -l su=1 (or su=0). Are > > > > there some caveat​s (other than performance) with such a small value? Can > > > > it be that we are missing a check? Because > > > > XLOG_BIG_RECORD_BSIZE > > > > ​ and XLOG_MAX_RECORD_BSIZE are used and the upper bound is limited.​.. > > > > > > > > > > On a quick test, it looks like mkfs just ignores certain log stripe unit > > > values that aren't block aligned. I'd probably expect this to behave > > > similar to the '-d su' option and complain about invalid input..? > > > > ​Sounds logical and like what I expected and didn't found. I will send a > > patch adding this check... the only question is, what should be the minimal > > value? Should I check it against block size and forbid smaller sizes? > > Aligning a stripe unit with length 1024 on 4096 blocks doesn't looks like a > > nice thing. :-) > > (And on a quick check, it seems that -d su is doing just that.) > > The man page says it must be a multiple of the fsb size. Indeed, '-d su' > complains about anything that is less than 1 FSB, so I would just go > with that. :) Keep in mind that a value of 0 in the superblock is completely acceptible, in which case the kernel treats the log stripe unit as being a single sector (i.e. same as a v1 log). See, for example, xlog_sync() where it works out the padding to use for the log buffer write. Cheers, Dave. -- Dave Chinner david@fromorbit.com From david@lechnology.com Sun Feb 21 19:30:21 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=T_DKIM_INVALID autolearn=ham version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay1.corp.sgi.com [137.38.102.111]) by oss.sgi.com (Postfix) with ESMTP id 809DB7CA1 for ; Sun, 21 Feb 2016 19:30:21 -0600 (CST) Received: from cuda.sgi.com (cuda2.sgi.com [192.48.176.25]) by relay1.corp.sgi.com (Postfix) with ESMTP id 410168F80B7 for ; Sun, 21 Feb 2016 17:30:15 -0800 (PST) X-ASG-Debug-ID: 1456104592-04cbb06ae04fc50001-NocioJ Received: from vern.gendns.com (vern.gendns.com [206.190.152.46]) by cuda.sgi.com with ESMTP id kB2AG8lqoIuk6KWg (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO) for ; Sun, 21 Feb 2016 17:29:53 -0800 (PST) X-Barracuda-Envelope-From: david@lechnology.com X-Barracuda-Apparent-Source-IP: 206.190.152.46 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lechnology.com; s=default; h=Content-Transfer-Encoding:Content-Type: MIME-Version:Date:Message-ID:Subject:From:To; bh=aWdWiFaezssAZCa7+GCll2aSx7BRidaJeE8yY9W8a4M=; b=ikZ90rIGt2oqwb+UsH9jUf+6He XbZvaugy0DSBSV4hGh81zFCuAg6v5LMU1sq25SbS7olEGO/uVwX7qOCF6YzS0p9HMNam6PeNPmYuG Z9Cz+g+TPSTPViJT3nM9+HPu/GLvHZQ7tmU/wj9DIu/F2vBp9kPiU6EmNaNtB6K58/CBOOSraalzB +4Vn2ivU/YS5FGxl7cNzY9Cq4nOF/6HpDHEkeIpsJ4S7muJFR5igpSLE080exnxkBtAubhUUXfH7b yPnon+DAE9UbGU6OeeoDbG3O3kuEpmWHORYJeaKaf6rKcs9y7AYjpwPIPvdh5/SM0lgLUYDtWf/Yp 9UuG363w==; Received: from 108-198-5-147.lightspeed.okcbok.sbcglobal.net ([108.198.5.147]:51926 helo=[192.168.0.113]) by vern.gendns.com with esmtpsa (TLSv1.2:DHE-RSA-AES128-SHA:128) (Exim 4.86) (envelope-from ) id 1aXfJu-002sNR-TG for xfs@oss.sgi.com; Sun, 21 Feb 2016 20:29:50 -0500 To: xfs@oss.sgi.com From: David Lechner Subject: recovering corrupt filesystem after raid failure X-Enigmail-Draft-Status: N1110 X-ASG-Orig-Subj: recovering corrupt filesystem after raid failure Message-ID: <56CA6492.7000407@lechnology.com> Date: Sun, 21 Feb 2016 19:29:54 -0600 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.5.1 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - vern.gendns.com X-AntiAbuse: Original Domain - oss.sgi.com X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - lechnology.com X-Get-Message-Sender-Via: vern.gendns.com: authenticated_id: davidmain+lechnology.com/only user confirmed/virtual account not confirmed X-Authenticated-Sender: vern.gendns.com: davidmain@lechnology.com X-Source: X-Source-Args: X-Source-Dir: X-Barracuda-Connect: vern.gendns.com[206.190.152.46] X-Barracuda-Start-Time: 1456104593 X-Barracuda-Encrypted: ECDHE-RSA-AES256-GCM-SHA384 X-Barracuda-URL: https://192.48.176.25:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-BRTS-Status: 1 X-Barracuda-Spam-Score: 0.00 X-Barracuda-Spam-Status: No, SCORE=0.00 using per-user scores of TAG_LEVEL=1000.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.7 tests=DKIM_SIGNED, DKIM_VERIFIED X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.3.27224 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- -0.00 DKIM_VERIFIED Domain Keys Identified Mail: signature passes verification 0.00 DKIM_SIGNED Domain Keys Identified Mail: message has a signature Long story short, I had a dual disk failure in a raid 5. I've managed to get the raid back up and salvaged what I could. However, the xfs is seriously damaged. I've tried running xfs_repair, but it is failing and it recommended to send a message to this mailing list. This is an Ubuntu 12.04 machine, so xfs_repair version 3.1.7. The file system won't mount. Fails with "mount: Structure needs cleaning". So I tried xfs_repair. I had to resort to xfs_repair -L because the first 500MB or so of the filesystem was wiped out. Now, xfs_repair /dev/md127 gets stuck, so I am running xfs_repair -P /dev/md127. This gets much farther, but it is failing too. It gives an error message like this: ... disconnected inode 2101958, moving to lost+found corrupt dinode 2101958, extent total = 1, nblocks = 0. This is a bug. Please capture the filesystem metadata with xfs_metadump and report it to xfs@oss.sgi.com. cache_node_purge: refcount was 1, not zero (node=0x7f2c57e1b120) fatal error -- 117 - couldn't iget disconnected inode However, nblocks = 0 does not seem to be true... xfs_db -x /dev/md127 cache_node_purge: refcount was 1, not zero (node=0x219c9e0) xfs_db: cannot read root inode (117) cache_node_purge: refcount was 1, not zero (node=0x21a0620) xfs_db: cannot read realtime bitmap inode (117) xfs_db> inode 2101958 xfs_db> print core.magic = 0x494e core.mode = 0100664 core.version = 2 core.format = 2 (extents) core.nlinkv2 = 1 core.onlink = 0 core.projid_lo = 0 core.projid_hi = 0 core.uid = 119 core.gid = 133 core.flushiter = 5 core.atime.sec = Sun Apr 26 02:30:54 2015 core.atime.nsec = 000000000 core.mtime.sec = Fri Nov 7 14:54:27 2014 core.mtime.nsec = 000000000 core.ctime.sec = Sun Apr 26 02:30:54 2015 core.ctime.nsec = 941028318 core.size = 279864 core.nblocks = 69 core.extsize = 0 core.nextents = 1 core.naextents = 0 core.forkoff = 0 core.aformat = 2 (extents) core.dmevmask = 0 core.dmstate = 0 core.newrtbm = 0 core.prealloc = 0 core.realtime = 0 core.immutable = 0 core.append = 0 core.sync = 0 core.noatime = 0 core.nodump = 0 core.rtinherit = 0 core.projinherit = 0 core.nosymlinks = 0 core.extsz = 0 core.extszinherit = 0 core.nodefrag = 0 core.filestream = 0 core.gen = 3320313054 next_unlinked = null u.bmx[0] = [startoff,startblock,blockcount,extentflag] 0:[0,147322885,69,0] If I re-run xfs_repair -P /dev/md127, it will fail on different seemingly random inode with the same error message. I've uploaded the output of xfs_metadump to dropbox if anyone would like to have a look. It is 22MB compressed, 2.2GB uncompressed. https://www.dropbox.com/s/o18cxapu7o75sor/xfs_metadump.xz?dl=0 From david@fromorbit.com Sun Feb 21 20:37:36 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=ham version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay1.corp.sgi.com [137.38.102.111]) by oss.sgi.com (Postfix) with ESMTP id 2C5FF7CA6 for ; Sun, 21 Feb 2016 20:37:36 -0600 (CST) Received: from cuda.sgi.com (cuda3.sgi.com [192.48.176.15]) by relay1.corp.sgi.com (Postfix) with ESMTP id F0F588F8035 for ; Sun, 21 Feb 2016 18:37:29 -0800 (PST) X-ASG-Debug-ID: 1456107893-04cb6c455959010001-NocioJ Received: from ipmail07.adl2.internode.on.net (ipmail07.adl2.internode.on.net [150.101.137.131]) by cuda.sgi.com with ESMTP id M0Qk0Hl2AfDxad3V for ; Sun, 21 Feb 2016 18:24:53 -0800 (PST) X-Barracuda-Envelope-From: david@fromorbit.com X-Barracuda-Apparent-Source-IP: 150.101.137.131 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: A2C/BgAlcMpW/5bY03ZegzqBMQ6CabAPiVGGBwQCAoEnTQEBAQEBAWUnhEEBAQEDATocGAsFCwgDGAklDwUlAyETiBIHtSwBAQEBBgIBHRiKNYdggQ8FlweNVYFlhEOIVI5JYoIDGYFcKC6IVgEBAQ Received: from ppp118-211-216-150.lns20.syd4.internode.on.net (HELO dastard) ([118.211.216.150]) by ipmail07.adl2.internode.on.net with ESMTP; 22 Feb 2016 12:54:52 +1030 Received: from dave by dastard with local (Exim 4.80) (envelope-from ) id 1aXgAx-00079S-Tl; Mon, 22 Feb 2016 13:24:39 +1100 Date: Mon, 22 Feb 2016 13:24:39 +1100 From: Dave Chinner To: David Lechner Cc: xfs@oss.sgi.com Subject: Re: recovering corrupt filesystem after raid failure Message-ID: <20160222022439.GE14668@dastard> X-ASG-Orig-Subj: Re: recovering corrupt filesystem after raid failure References: <56CA6492.7000407@lechnology.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <56CA6492.7000407@lechnology.com> User-Agent: Mutt/1.5.21 (2010-09-15) X-Barracuda-Connect: ipmail07.adl2.internode.on.net[150.101.137.131] X-Barracuda-Start-Time: 1456107893 X-Barracuda-URL: https://192.48.176.15:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-BRTS-Status: 1 X-Barracuda-Spam-Score: 0.00 X-Barracuda-Spam-Status: No, SCORE=0.00 using per-user scores of TAG_LEVEL=1000.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.7 tests=BSF_SC0_MISMATCH_TO X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.3.27225 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 0.00 BSF_SC0_MISMATCH_TO Envelope rcpt doesn't match header On Sun, Feb 21, 2016 at 07:29:54PM -0600, David Lechner wrote: > Long story short, I had a dual disk failure in a raid 5. I've managed to > get the raid back up and salvaged what I could. However, the xfs is > seriously damaged. I've tried running xfs_repair, but it is failing and > it recommended to send a message to this mailing list. This is an Ubuntu > 12.04 machine, so xfs_repair version 3.1.7. So the first thing to do is get a more recent xfsprogs package and try that. There's not a lot of point in us looking at problems with a 4 and half year old package that we've probably already fixed. > The file system won't mount. Fails with "mount: Structure needs > cleaning". So I tried xfs_repair. I had to resort to xfs_repair -L > because the first 500MB or so of the filesystem was wiped out. Oh, so even if you can repair the filesystem, your data is likely to be irretreivably corrupted. > Now, > xfs_repair /dev/md127 gets stuck, so I am running xfs_repair -P > /dev/md127. This gets much farther, but it is failing too. It gives an > error message like this: > > > ... > disconnected inode 2101958, moving to lost+found > corrupt dinode 2101958, extent total = 1, nblocks = 0. This is a bug. > Please capture the filesystem metadata with xfs_metadump and > report it to xfs@oss.sgi.com. > cache_node_purge: refcount was 1, not zero (node=0x7f2c57e1b120) > > fatal error -- 117 - couldn't iget disconnected inode > > > > However, nblocks = 0 does not seem to be true... Probably because it got cleared in memory before this problem was tripped over. > If I re-run xfs_repair -P /dev/md127, it will fail on different > seemingly random inode with the same error message. Yup, you definitely need to run a current xfs_repair on this filesystem before going any further. Cheers, Dave. -- Dave Chinner david@fromorbit.com From eguan@redhat.com Sun Feb 21 21:17:42 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=ham version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay3.corp.sgi.com [198.149.34.15]) by oss.sgi.com (Postfix) with ESMTP id C564E7CA0 for ; Sun, 21 Feb 2016 21:17:42 -0600 (CST) Received: from cuda.sgi.com (cuda3.sgi.com [192.48.176.15]) by relay3.corp.sgi.com (Postfix) with ESMTP id 3746BAC00F for ; Sun, 21 Feb 2016 19:17:35 -0800 (PST) X-ASG-Debug-ID: 1456110190-04cb6c455c599b0001-NocioJ Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by cuda.sgi.com with ESMTP id NwIsHyDmPQXhxNH9 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO) for ; Sun, 21 Feb 2016 19:03:11 -0800 (PST) X-Barracuda-Envelope-From: eguan@redhat.com X-Barracuda-Apparent-Source-IP: 209.132.183.28 X-ASG-Whitelist: Client Received: from int-mx09.intmail.prod.int.phx2.redhat.com (int-mx09.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by mx1.redhat.com (Postfix) with ESMTPS id 1EDFE19D23B; Mon, 22 Feb 2016 03:03:10 +0000 (UTC) Received: from localhost (ovpn-12-19.pek2.redhat.com [10.72.12.19]) by int-mx09.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id u1M33625003443; Sun, 21 Feb 2016 22:03:08 -0500 Date: Mon, 22 Feb 2016 11:03:04 +0800 From: Eryu Guan To: xfs@oss.sgi.com Cc: fstests@vger.kernel.org Subject: xfstests configure error with xfsprogs v4.5-rc1 Message-ID: <20160222030304.GV11419@eguan.usersys.redhat.com> X-ASG-Orig-Subj: xfstests configure error with xfsprogs v4.5-rc1 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.5.24 (2015-08-30) X-Scanned-By: MIMEDefang 2.68 on 10.5.11.22 X-Barracuda-Connect: mx1.redhat.com[209.132.183.28] X-Barracuda-Start-Time: 1456110190 X-Barracuda-Encrypted: ECDHE-RSA-AES256-GCM-SHA384 X-Barracuda-URL: https://192.48.176.15:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-BRTS-Status: 1 Hi, After upgrading to xfsprogs v4.5-rc1 version, xfstests failed to built because of configure error: checking xfs/xfs.h usability... no checking xfs/xfs.h presence... yes configure: WARNING: xfs/xfs.h: present but cannot be compiled configure: WARNING: xfs/xfs.h: check for missing prerequisite headers? configure: WARNING: xfs/xfs.h: see the Autoconf documentation configure: WARNING: xfs/xfs.h: section "Present But Cannot Be Compiled" configure: WARNING: xfs/xfs.h: proceeding with the compiler's result checking for xfs/xfs.h... no FATAL ERROR: cannot find a valid header file. Run "make install-qa" from the xfsprogs source. and config.log showed: configure:4543: checking xfs/xfs.h usability configure:4543: ccache gcc -c -g -O2 conftest.c >&5 In file included from /usr/include/xfs/xfs.h:37:0, from conftest.c:73: /usr/include/xfs/linux.h:145:1: error: unknown type name 'off64_t' typedef off64_t xfs_off_t; ^ configure:4543: $? = 1 It's the change made by commit cb898f157f84 ("linux.h: Use off64_t instead of loff_t") introduced this error. If I do the following modifications xfstests compiles without errors: diff --git a/include/linux.h b/include/linux.h index cc0f70c..d66436c 100644 --- a/include/linux.h +++ b/include/linux.h @@ -142,7 +142,7 @@ platform_discard_blocks(int fd, uint64_t start, uint64_t len) #define EFSCORRUPTED EUCLEAN /* Filesystem is corrupted */ #define EFSBADCRC EBADMSG /* Bad CRC detected */ -typedef off64_t xfs_off_t; +typedef __off64_t xfs_off_t; typedef __uint64_t xfs_ino_t; typedef __uint32_t xfs_dev_t; typedef __int64_t xfs_daddr_t; But I'm not sure if it's a proper fix. Thanks, Eryu From david@fromorbit.com Sun Feb 21 21:25:13 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=ham version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay1.corp.sgi.com [137.38.102.111]) by oss.sgi.com (Postfix) with ESMTP id 32A807CB1 for ; Sun, 21 Feb 2016 21:25:13 -0600 (CST) Received: from cuda.sgi.com (cuda2.sgi.com [192.48.176.25]) by relay1.corp.sgi.com (Postfix) with ESMTP id EBD7D8F80B2 for ; Sun, 21 Feb 2016 19:25:06 -0800 (PST) X-ASG-Debug-ID: 1456111503-04cbb06ae052170001-NocioJ Received: from ipmail07.adl2.internode.on.net (ipmail07.adl2.internode.on.net [150.101.137.131]) by cuda.sgi.com with ESMTP id VUThNE0CB8Ry7pPq for ; Sun, 21 Feb 2016 19:25:04 -0800 (PST) X-Barracuda-Envelope-From: david@fromorbit.com X-Barracuda-Apparent-Source-IP: 150.101.137.131 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: A2DNBgBYfspW/5bY03ZegzqBP6Z5AQEBAQEBBotziVGGBwICAQECgShNAQEBAQEBZSeEQgEBBDocIxAIAw4KCSUPBSUDIROIGbUyAQEBBwIBHRiFMoUDhCaDOoEPBYdThVeBMYgsjVWBZY0XhXKIV2KDeCguhniBOAEBAQ Received: from ppp118-211-216-150.lns20.syd4.internode.on.net (HELO dastard) ([118.211.216.150]) by ipmail07.adl2.internode.on.net with ESMTP; 22 Feb 2016 13:55:03 +1030 Received: from dave by dastard with local (Exim 4.80) (envelope-from ) id 1aXh7C-0007GT-Do; Mon, 22 Feb 2016 14:24:50 +1100 Date: Mon, 22 Feb 2016 14:24:50 +1100 From: Dave Chinner To: Eryu Guan Cc: xfs@oss.sgi.com, fstests@vger.kernel.org Subject: Re: xfstests configure error with xfsprogs v4.5-rc1 Message-ID: <20160222032450.GF14668@dastard> X-ASG-Orig-Subj: Re: xfstests configure error with xfsprogs v4.5-rc1 References: <20160222030304.GV11419@eguan.usersys.redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20160222030304.GV11419@eguan.usersys.redhat.com> User-Agent: Mutt/1.5.21 (2010-09-15) X-Barracuda-Connect: ipmail07.adl2.internode.on.net[150.101.137.131] X-Barracuda-Start-Time: 1456111503 X-Barracuda-URL: https://192.48.176.25:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-BRTS-Status: 1 X-Barracuda-Spam-Score: 0.00 X-Barracuda-Spam-Status: No, SCORE=0.00 using per-user scores of TAG_LEVEL=1000.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.7 tests=BSF_SC0_MISMATCH_TO X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.3.27227 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 0.00 BSF_SC0_MISMATCH_TO Envelope rcpt doesn't match header On Mon, Feb 22, 2016 at 11:03:04AM +0800, Eryu Guan wrote: > Hi, > > After upgrading to xfsprogs v4.5-rc1 version, xfstests failed to built > because of configure error: > > checking xfs/xfs.h usability... no > checking xfs/xfs.h presence... yes > configure: WARNING: xfs/xfs.h: present but cannot be compiled > configure: WARNING: xfs/xfs.h: check for missing prerequisite headers? > configure: WARNING: xfs/xfs.h: see the Autoconf documentation > configure: WARNING: xfs/xfs.h: section "Present But Cannot Be Compiled" > configure: WARNING: xfs/xfs.h: proceeding with the compiler's result > checking for xfs/xfs.h... no > > FATAL ERROR: cannot find a valid header file. > Run "make install-qa" from the xfsprogs source. > > and config.log showed: > > configure:4543: checking xfs/xfs.h usability > configure:4543: ccache gcc -c -g -O2 conftest.c >&5 > In file included from /usr/include/xfs/xfs.h:37:0, > from conftest.c:73: > /usr/include/xfs/linux.h:145:1: error: unknown type name 'off64_t' > typedef off64_t xfs_off_t; > ^ > configure:4543: $? = 1 That would seem like a system library problem in that it doesn't define off64_t through stdio.h. What distro are you compiling on? Also, if you set _GNU_SOURCE, does it then compile? e.g. see m4/package_libcdev.m4 for how to test whether code compiles under certain defines. If it does compile with _GNU_SOURCE being set, then all that needs to be is to update the autoconf rule. Cheers, Dave. -- Dave Chinner david@fromorbit.com From eguan@redhat.com Mon Feb 22 02:00:28 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=ham version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay3.corp.sgi.com [198.149.34.15]) by oss.sgi.com (Postfix) with ESMTP id 01B4D7CB2 for ; Mon, 22 Feb 2016 02:00:28 -0600 (CST) Received: from cuda.sgi.com (cuda3.sgi.com [192.48.176.15]) by relay3.corp.sgi.com (Postfix) with ESMTP id 6610FAC011 for ; Mon, 22 Feb 2016 00:00:21 -0800 (PST) X-ASG-Debug-ID: 1456128013-04cb6c455a60030001-NocioJ Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by cuda.sgi.com with ESMTP id mmCH0lJOCpvR4iGd (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO) for ; Mon, 22 Feb 2016 00:00:13 -0800 (PST) X-Barracuda-Envelope-From: eguan@redhat.com X-Barracuda-Apparent-Source-IP: 209.132.183.28 X-ASG-Whitelist: Client Received: from int-mx10.intmail.prod.int.phx2.redhat.com (int-mx10.intmail.prod.int.phx2.redhat.com [10.5.11.23]) by mx1.redhat.com (Postfix) with ESMTPS id 4255F65412; Mon, 22 Feb 2016 08:00:13 +0000 (UTC) Received: from localhost (dhcp-13-211.nay.redhat.com [10.66.13.211]) by int-mx10.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id u1M8094g025301; Mon, 22 Feb 2016 03:00:11 -0500 Date: Mon, 22 Feb 2016 16:00:06 +0800 From: Eryu Guan To: Dave Chinner Cc: xfs@oss.sgi.com, fstests@vger.kernel.org Subject: Re: xfstests configure error with xfsprogs v4.5-rc1 Message-ID: <20160222080006.GW11419@eguan.usersys.redhat.com> X-ASG-Orig-Subj: Re: xfstests configure error with xfsprogs v4.5-rc1 References: <20160222030304.GV11419@eguan.usersys.redhat.com> <20160222032450.GF14668@dastard> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20160222032450.GF14668@dastard> User-Agent: Mutt/1.5.24 (2015-08-30) X-Scanned-By: MIMEDefang 2.68 on 10.5.11.23 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.39]); Mon, 22 Feb 2016 08:00:13 +0000 (UTC) X-Barracuda-Connect: mx1.redhat.com[209.132.183.28] X-Barracuda-Start-Time: 1456128013 X-Barracuda-Encrypted: ECDHE-RSA-AES256-GCM-SHA384 X-Barracuda-URL: https://192.48.176.15:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-BRTS-Status: 1 On Mon, Feb 22, 2016 at 02:24:50PM +1100, Dave Chinner wrote: > On Mon, Feb 22, 2016 at 11:03:04AM +0800, Eryu Guan wrote: > > Hi, > > > > After upgrading to xfsprogs v4.5-rc1 version, xfstests failed to built > > because of configure error: > > > > checking xfs/xfs.h usability... no > > checking xfs/xfs.h presence... yes > > configure: WARNING: xfs/xfs.h: present but cannot be compiled > > configure: WARNING: xfs/xfs.h: check for missing prerequisite headers? > > configure: WARNING: xfs/xfs.h: see the Autoconf documentation > > configure: WARNING: xfs/xfs.h: section "Present But Cannot Be Compiled" > > configure: WARNING: xfs/xfs.h: proceeding with the compiler's result > > checking for xfs/xfs.h... no > > > > FATAL ERROR: cannot find a valid header file. > > Run "make install-qa" from the xfsprogs source. > > > > and config.log showed: > > > > configure:4543: checking xfs/xfs.h usability > > configure:4543: ccache gcc -c -g -O2 conftest.c >&5 > > In file included from /usr/include/xfs/xfs.h:37:0, > > from conftest.c:73: > > /usr/include/xfs/linux.h:145:1: error: unknown type name 'off64_t' > > typedef off64_t xfs_off_t; > > ^ > > configure:4543: $? = 1 > > That would seem like a system library problem in that it doesn't > define off64_t through stdio.h. What distro are you compiling on? It's a RHEL7.2 box. > Also, if you set _GNU_SOURCE, does it then compile? e.g. see > m4/package_libcdev.m4 for how to test whether code compiles under > certain defines. Okay, I'll go through the m4 files and test around. Thanks, Eryu > > If it does compile with _GNU_SOURCE being set, then all that needs > to be is to update the autoconf rule. > > Cheers, > > Dave. > -- > Dave Chinner > david@fromorbit.com From jack@suse.cz Mon Feb 22 02:20:18 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=ham version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay3.corp.sgi.com [198.149.34.15]) by oss.sgi.com (Postfix) with ESMTP id 3D19B7CB4 for ; Mon, 22 Feb 2016 02:20:18 -0600 (CST) Received: from cuda.sgi.com (cuda1.sgi.com [192.48.157.11]) by relay3.corp.sgi.com (Postfix) with ESMTP id BDE6CAC00F for ; Mon, 22 Feb 2016 00:20:11 -0800 (PST) X-ASG-Debug-ID: 1456128063-04bdf07ab4b3420001-NocioJ Received: from mx2.suse.de (mx2.suse.de [195.135.220.15]) by cuda.sgi.com with ESMTP id ZlGkvJg9dn9GFhYC (version=TLSv1 cipher=ECDHE-RSA-AES256-SHA bits=256 verify=NO) for ; Mon, 22 Feb 2016 00:01:04 -0800 (PST) X-Barracuda-Envelope-From: jack@suse.cz X-Barracuda-Apparent-Source-IP: 195.135.220.15 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay1.suse.de (charybdis-ext.suse.de [195.135.220.254]) by mx2.suse.de (Postfix) with ESMTP id 5E3DEAD84; Mon, 22 Feb 2016 08:01:02 +0000 (UTC) Received: by quack.suse.cz (Postfix, from userid 1000) id C017D823DA; Mon, 22 Feb 2016 09:01:24 +0100 (CET) Date: Mon, 22 Feb 2016 09:01:24 +0100 From: Jan Kara To: Eric Sandeen Cc: Jan Kara , linux-fsdevel@vger.kernel.org, ocfs2-devel@oss.oracle.com, Mark Fasheh , Joel Becker , xfs@oss.sgi.com Subject: Re: [PATCH 1/3] quota: Add support for ->get_nextdqblk() for VFS quota Message-ID: <20160222080124.GC7791@quack.suse.cz> X-ASG-Orig-Subj: Re: [PATCH 1/3] quota: Add support for ->get_nextdqblk() for VFS quota References: <1454596087-6814-1-git-send-email-jack@suse.cz> <1454596087-6814-2-git-send-email-jack@suse.cz> <56C7518E.4020204@sandeen.net> <20160219183342.GH30068@quack.suse.cz> <56C76241.9020203@sandeen.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <56C76241.9020203@sandeen.net> User-Agent: Mutt/1.5.24 (2015-08-30) X-Barracuda-Connect: mx2.suse.de[195.135.220.15] X-Barracuda-Start-Time: 1456128064 X-Barracuda-Encrypted: ECDHE-RSA-AES256-SHA X-Barracuda-URL: https://192.48.157.11:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-BRTS-Status: 1 X-Barracuda-Spam-Score: 0.00 X-Barracuda-Spam-Status: No, SCORE=0.00 using per-user scores of TAG_LEVEL=1000.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.7 tests=BSF_SC0_MISMATCH_TO X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.3.27232 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 0.00 BSF_SC0_MISMATCH_TO Envelope rcpt doesn't match header On Fri 19-02-16 12:43:13, Eric Sandeen wrote: > > > On 2/19/16 12:33 PM, Jan Kara wrote: > > On Fri 19-02-16 11:31:58, Eric Sandeen wrote: > >> > >> > >> On 2/4/16 8:28 AM, Jan Kara wrote: > >>> Add infrastructure for supporting get_nextdqblk() callback for VFS > >>> quotas. Translate the operation into a callback to appropriate > >>> filesystem and consequently to quota format callback. > >>> > >>> Signed-off-by: Jan Kara > >>> --- > >>> fs/ext4/super.c | 1 + > >>> fs/quota/dquot.c | 39 +++++++++++++++++++++++++++++++++++++++ > >>> fs/reiserfs/super.c | 1 + > >>> include/linux/quota.h | 3 +++ > >>> include/linux/quotaops.h | 3 +++ > >>> 5 files changed, 47 insertions(+) > >>> > >>> diff --git a/fs/ext4/super.c b/fs/ext4/super.c > >>> index f1b56ff01208..51649f442bf6 100644 > >>> --- a/fs/ext4/super.c > >>> +++ b/fs/ext4/super.c > >>> @@ -1100,6 +1100,7 @@ static const struct dquot_operations ext4_quota_operations = { > >>> .write_info = ext4_write_info, > >>> .alloc_dquot = dquot_alloc, > >>> .destroy_dquot = dquot_destroy, > >>> + .get_next_id = dquot_get_next_id, > >>> }; > >> > >> Hi Jan, doesn't this also need to set: > >> > >> > >> + .get_nextdqblk = dquot_get_next_dqblk, > >> > >> in ext4_qctl_sysfile_operations? > > > > Indeed, thanks for catching this. Patch added (with your authorship and > > sign-off) into my tree and this time I've properly tested Q_GETNEXTQUOTA > > for ext4 with quota in hidden inodes indeed works (previously I've tested > > only visible quota files). > > Thanks Jan, I wasn't quite sure what it should be doing, but this seemed > right. ;) Sorry for not sending a proper patch. > > So, when you tested visible quota files, I assume it was just falling > back to the non-next variants of the quotactl, right? We should not > be hooking up the call for the visible quota files, right? We are hooking up the call for visible quota files since it works without issues. It is upto userspace to decide whether it wants to read the quota file directly or use Q_GETNEXTQUOTA call to iterate over all dquots. > FWIW, there is a test in [x]fstests now for the [X]GETNEXT calls, it's > generic/244 Great, thanks! Honza -- Jan Kara SUSE Labs, CR From jtulak@redhat.com Mon Feb 22 02:38:44 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=HTML_MESSAGE autolearn=ham version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay1.corp.sgi.com [137.38.102.111]) by oss.sgi.com (Postfix) with ESMTP id 1F5EB7CB7 for ; Mon, 22 Feb 2016 02:38:44 -0600 (CST) Received: from cuda.sgi.com (cuda2.sgi.com [192.48.176.25]) by relay1.corp.sgi.com (Postfix) with ESMTP id E35678F80B6 for ; Mon, 22 Feb 2016 00:38:37 -0800 (PST) X-ASG-Debug-ID: 1456130316-04cbb06adf5bf60001-NocioJ Received: from mail-io0-f172.google.com (mail-io0-f172.google.com [209.85.223.172]) by cuda.sgi.com with ESMTP id cREfVG1SLCHHIWRX (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128 verify=NO) for ; Mon, 22 Feb 2016 00:38:36 -0800 (PST) X-Barracuda-Envelope-From: jtulak@redhat.com X-Barracuda-RBL-Trusted-Forwarder: 209.85.223.172 Received: by mail-io0-f172.google.com with SMTP id z135so170146994iof.0 for ; Mon, 22 Feb 2016 00:38:36 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc:content-type; bh=kLmwZ1EVmQLBlkh0B5uBiex+sR/3cCQCqRT5eKHWzJo=; b=Zr/4rEgjB3u4ouOSBW7n7XUmI9yxdVp23rIuOCJafKDyNw6chbqa2xSObZVKk6Jid/ jjs+rG+SvdfORcpH8NcDjk4gYihHQtf6qoHrlrxe8O2H401PMnq0zM0kRJ+N722Tf4aW +7Z2jHbxO28SeKkryWgWuxjNmsuMKtjgYk40if4C5LMrLvj0Lo/8oBYgcNU73D47x9g7 jfu3dQmH/inkJ2BtJEsxK+MmIwpa1jCSVKlpWTYDS5vH8weUUetf40dUWbQ8OoVmxADQ oTLQtDWNwSo8s6sEGvQJDK22E1HjWhylKkkgTDbdfunoQPbjWp120+KnbM+Uq5Qofer1 zjKA== X-Gm-Message-State: AG10YOQwGcuKKYfSMtjJ21MCliKX8r8ltSX2sheYdnsX8zuvs2nd20F3mzHmJQCr23kFfkhNcllLABG/PZ1CNy4l X-Received: by 10.107.170.79 with SMTP id t76mr33080719ioe.71.1456130316590; Mon, 22 Feb 2016 00:38:36 -0800 (PST) MIME-Version: 1.0 Received: by 10.36.58.142 with HTTP; Mon, 22 Feb 2016 00:38:17 -0800 (PST) In-Reply-To: <20160221231815.GD25832@dastard> References: <20160219154347.GA27263@bfoster.bfoster> <20160219162913.GC27263@bfoster.bfoster> <20160221231815.GD25832@dastard> From: Jan Tulak Date: Mon, 22 Feb 2016 09:38:17 +0100 Message-ID: Subject: Re: What is the meaning of XLOG_MIN_RECORD_BSIZE? (Missing a check?) To: Dave Chinner X-ASG-Orig-Subj: Re: What is the meaning of XLOG_MIN_RECORD_BSIZE? (Missing a check?) Cc: Brian Foster , xfs-oss Content-Type: multipart/alternative; boundary=001a114157c6447cfd052c57c2de X-Barracuda-Connect: mail-io0-f172.google.com[209.85.223.172] X-Barracuda-Start-Time: 1456130316 X-Barracuda-Encrypted: ECDHE-RSA-AES128-GCM-SHA256 X-Barracuda-URL: https://192.48.176.25:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-BRTS-Status: 1 X-Barracuda-Spam-Score: 0.00 X-Barracuda-Spam-Status: No, SCORE=0.00 using per-user scores of TAG_LEVEL=1000.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.7 tests=BSF_SC0_MISMATCH_TO, HTML_MESSAGE X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.3.27232 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 0.00 BSF_SC0_MISMATCH_TO Envelope rcpt doesn't match header 0.00 HTML_MESSAGE BODY: HTML included in message --001a114157c6447cfd052c57c2de Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable On Mon, Feb 22, 2016 at 12:18 AM, Dave Chinner wrote: > > Keep in mind that a value of 0 in the superblock is completely > acceptible, in which case the kernel treats the log stripe unit as > being a single sector (i.e. same as a v1 log). See, for example, > xlog_sync() where it works out the padding to use for the log buffer > write. > =E2=80=8BGood to know. :-) Cheers, Jan=E2=80=8B --=20 Jan Tulak jtulak@redhat.com / jan@tulak.me --001a114157c6447cfd052c57c2de Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
    On Mon, Fe= b 22, 2016 at 12:18 AM, Dave Chinner <david@fromorbit.com> wrote:

    Keep in mind that a value of 0 in the superblock is completely
    acceptible, in which case the kernel treats the log stripe unit as
    being a single sector (i.e. same as a v1 log). See, for example,
    xlog_sync() where it works out the padding to use for the log buffer
    write.

    =E2=80=8BGood = to know. :-)

    Cheers,
    Jan=E2=80=8B
    =C2= =A0

    --
    <= /div>
    --001a114157c6447cfd052c57c2de-- From hch@lst.de Mon Feb 22 02:54:20 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=ham version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay2.corp.sgi.com [137.38.102.29]) by oss.sgi.com (Postfix) with ESMTP id 5312E7CB9 for ; Mon, 22 Feb 2016 02:54:20 -0600 (CST) Received: from cuda.sgi.com (cuda3.sgi.com [192.48.176.15]) by relay2.corp.sgi.com (Postfix) with ESMTP id 23D8D30408D for ; Mon, 22 Feb 2016 00:54:14 -0800 (PST) X-ASG-Debug-ID: 1456131250-04cb6c455c688c0001-NocioJ Received: from newverein.lst.de (verein.lst.de [213.95.11.211]) by cuda.sgi.com with ESMTP id SDxXsqire38ps5vo (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO) for ; Mon, 22 Feb 2016 00:54:11 -0800 (PST) X-Barracuda-Envelope-From: hch@lst.de X-Barracuda-Apparent-Source-IP: 213.95.11.211 Received: by newverein.lst.de (Postfix, from userid 2407) id 245E768C09; Mon, 22 Feb 2016 09:54:09 +0100 (CET) Date: Mon, 22 Feb 2016 09:54:09 +0100 From: Christoph Hellwig To: Dave Chinner Cc: kernel test robot , Dave Chinner , lkp@01.org, LKML , Christoph Hellwig , xfs@oss.sgi.com Subject: Re: [lkp] [xfs] fbcc025613: -5.6% fsmark.files_per_sec Message-ID: <20160222085409.GA19493@lst.de> X-ASG-Orig-Subj: Re: [lkp] [xfs] fbcc025613: -5.6% fsmark.files_per_sec References: <87vb5lqunb.fsf@yhuang-dev.intel.com> <20160219064932.GX14668@dastard> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20160219064932.GX14668@dastard> User-Agent: Mutt/1.5.17 (2007-11-01) X-Barracuda-Connect: verein.lst.de[213.95.11.211] X-Barracuda-Start-Time: 1456131250 X-Barracuda-Encrypted: ECDHE-RSA-AES256-GCM-SHA384 X-Barracuda-URL: https://192.48.176.15:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-BRTS-Status: 1 X-Barracuda-Spam-Score: 0.00 X-Barracuda-Spam-Status: No, SCORE=0.00 using per-user scores of TAG_LEVEL=1000.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.7 tests=BSF_SC0_MISMATCH_TO X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.3.27233 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 0.00 BSF_SC0_MISMATCH_TO Envelope rcpt doesn't match header On Fri, Feb 19, 2016 at 05:49:32PM +1100, Dave Chinner wrote: > That doesn't really seem right. The writeback should be done as a > single ioend, with a single completion, with a single setsize > transaction, adn then all the pages are marked clean sequentially. > The above behaviour implies we are ending up doing something like: > > fsync proc io completion > wait on page 0 > end page 0 writeback > wake up page 0 > wait on page 1 > end page 1 writeback > wake up page 1 > wait on page 2 > end page 2 writeback > wake up page 2 > > Though in slightly larger batches than a single page (10 wakeups a > file, so batches of around 100 pages per wakeup?). i.e. the fsync > IO wait appears to be racing with IO completion marking pages as > done. I simply cannot see how the above change would cause that, as > it was simply a change in the IO submission code that doesn't affect > overall size or shape of the IOs being submitted. Could this be the lack of blk plugs, which will cause us to complete too early? From BATV+221abde5f4dd30fc0fe0+4565+infradead.org+hch@bombadil.srs.infradead.org Mon Feb 22 03:03:50 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=ham version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay1.corp.sgi.com [137.38.102.111]) by oss.sgi.com (Postfix) with ESMTP id 2FEAD7CB1 for ; Mon, 22 Feb 2016 03:03:50 -0600 (CST) Received: from cuda.sgi.com (cuda1.sgi.com [192.48.157.11]) by relay1.corp.sgi.com (Postfix) with ESMTP id D7F8D8F80B6 for ; Mon, 22 Feb 2016 01:03:43 -0800 (PST) X-ASG-Debug-ID: 1456131822-04bdf07ab6b4990001-NocioJ Received: from bombadil.infradead.org ([198.137.202.9]) by cuda.sgi.com with ESMTP id ObszANhM2XT1XnPi (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128 verify=NO) for ; Mon, 22 Feb 2016 01:03:42 -0800 (PST) X-Barracuda-Envelope-From: BATV+221abde5f4dd30fc0fe0+4565+infradead.org+hch@bombadil.srs.infradead.org X-Barracuda-Apparent-Source-IP: 198.137.202.9 Received: from hch by bombadil.infradead.org with local (Exim 4.80.1 #2 (Red Hat Linux)) id 1aXmP8-0003r9-0F; Mon, 22 Feb 2016 09:03:42 +0000 Date: Mon, 22 Feb 2016 01:03:41 -0800 From: Christoph Hellwig To: Eric Sandeen Cc: xfs@oss.sgi.com Subject: Re: [PATCH] libxfs: fix up mismerge in libxfs_iflush_int Message-ID: <20160222090341.GB14345@infradead.org> X-ASG-Orig-Subj: Re: [PATCH] libxfs: fix up mismerge in libxfs_iflush_int References: <56C62FC1.60205@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <56C62FC1.60205@redhat.com> User-Agent: Mutt/1.5.24 (2015-08-30) X-SRS-Rewrite: SMTP reverse-path rewritten from by bombadil.infradead.org. See http://www.infradead.org/rpr.html X-Barracuda-Connect: UNKNOWN[198.137.202.9] X-Barracuda-Start-Time: 1456131822 X-Barracuda-Encrypted: ECDHE-RSA-AES128-GCM-SHA256 X-Barracuda-URL: https://192.48.157.11:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-BRTS-Status: 1 X-Barracuda-Spam-Score: 0.10 X-Barracuda-Spam-Status: No, SCORE=0.10 using per-user scores of TAG_LEVEL=1000.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.7 tests=BSF_SC0_MISMATCH_TO, RDNS_NONE X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.3.27233 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 0.00 BSF_SC0_MISMATCH_TO Envelope rcpt doesn't match header 0.10 RDNS_NONE Delivered to trusted network by a host with no rDNS Ooops. Looks fine: Reviewed-by: Christoph Hellwig From BATV+221abde5f4dd30fc0fe0+4565+infradead.org+hch@bombadil.srs.infradead.org Mon Feb 22 03:20:04 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=ham version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay2.corp.sgi.com [137.38.102.29]) by oss.sgi.com (Postfix) with ESMTP id 2A2387F47 for ; Mon, 22 Feb 2016 03:20:04 -0600 (CST) Received: from cuda.sgi.com (cuda1.sgi.com [192.48.157.11]) by relay2.corp.sgi.com (Postfix) with ESMTP id CF907304090 for ; Mon, 22 Feb 2016 01:19:57 -0800 (PST) X-ASG-Debug-ID: 1456131781-04bdf07ab6b4960001-NocioJ Received: from bombadil.infradead.org ([198.137.202.9]) by cuda.sgi.com with ESMTP id N2dDUNdbDipK9Hi4 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128 verify=NO) for ; Mon, 22 Feb 2016 01:03:01 -0800 (PST) X-Barracuda-Envelope-From: BATV+221abde5f4dd30fc0fe0+4565+infradead.org+hch@bombadil.srs.infradead.org X-Barracuda-Apparent-Source-IP: 198.137.202.9 Received: from hch by bombadil.infradead.org with local (Exim 4.80.1 #2 (Red Hat Linux)) id 1aXmOT-0003m0-6e; Mon, 22 Feb 2016 09:03:01 +0000 Date: Mon, 22 Feb 2016 01:03:01 -0800 From: Christoph Hellwig To: Eric Sandeen Cc: xfs@oss.sgi.com Subject: Re: [PATCH] xfs_db: Fix dquot command docs Message-ID: <20160222090301.GA14345@infradead.org> X-ASG-Orig-Subj: Re: [PATCH] xfs_db: Fix dquot command docs References: <56C77A29.7070806@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <56C77A29.7070806@redhat.com> User-Agent: Mutt/1.5.24 (2015-08-30) X-SRS-Rewrite: SMTP reverse-path rewritten from by bombadil.infradead.org. See http://www.infradead.org/rpr.html X-Barracuda-Connect: UNKNOWN[198.137.202.9] X-Barracuda-Start-Time: 1456131781 X-Barracuda-Encrypted: ECDHE-RSA-AES128-GCM-SHA256 X-Barracuda-URL: https://192.48.157.11:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-BRTS-Status: 1 X-Barracuda-Spam-Score: 0.10 X-Barracuda-Spam-Status: No, SCORE=0.10 using per-user scores of TAG_LEVEL=1000.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.7 tests=BSF_SC0_MISMATCH_TO, RDNS_NONE X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.3.27233 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 0.00 BSF_SC0_MISMATCH_TO Envelope rcpt doesn't match header 0.10 RDNS_NONE Delivered to trusted network by a host with no rDNS On Fri, Feb 19, 2016 at 02:25:13PM -0600, Eric Sandeen wrote: > The dquot command in xfs_db takes quota type as well as an ID. > Fix the usage & man page to reflect this. > > Signed-off-by: Eric Sandeen Looks fine, Reviewed-by: Christoph Hellwig From cmaiolino@redhat.com Mon Feb 22 04:25:48 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=ham version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay2.corp.sgi.com [137.38.102.29]) by oss.sgi.com (Postfix) with ESMTP id 198787F50 for ; Mon, 22 Feb 2016 04:25:48 -0600 (CST) Received: from cuda.sgi.com (cuda3.sgi.com [192.48.176.15]) by relay2.corp.sgi.com (Postfix) with ESMTP id D097730407F for ; Mon, 22 Feb 2016 02:25:41 -0800 (PST) X-ASG-Debug-ID: 1456136733-04cb6c455b6b0e0001-NocioJ Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by cuda.sgi.com with ESMTP id s5TAf4OPIkQwBECC (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO) for ; Mon, 22 Feb 2016 02:25:34 -0800 (PST) X-Barracuda-Envelope-From: cmaiolino@redhat.com X-Barracuda-Apparent-Source-IP: 209.132.183.28 X-ASG-Whitelist: Client Received: from int-mx11.intmail.prod.int.phx2.redhat.com (int-mx11.intmail.prod.int.phx2.redhat.com [10.5.11.24]) by mx1.redhat.com (Postfix) with ESMTPS id 6E7F91831 for ; Mon, 22 Feb 2016 10:25:33 +0000 (UTC) Received: from redhat.com (dhcp-26-103.brq.redhat.com [10.34.26.103]) by int-mx11.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id u1MAPUls007153 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Mon, 22 Feb 2016 05:25:32 -0500 Date: Mon, 22 Feb 2016 11:25:30 +0100 From: Carlos Maiolino To: Brian Foster Cc: xfs@oss.sgi.com Subject: Re: [PATCH] xfs_io: implement 'inode' command V6 Message-ID: <20160222102530.GA3060@redhat.com> X-ASG-Orig-Subj: Re: [PATCH] xfs_io: implement 'inode' command V6 Mail-Followup-To: Brian Foster , xfs@oss.sgi.com References: <1455814159-14191-1-git-send-email-cmaiolino@redhat.com> <20160219175508.GD27263@bfoster.bfoster> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20160219175508.GD27263@bfoster.bfoster> User-Agent: Mutt/1.5.24 (2015-08-30) X-Scanned-By: MIMEDefang 2.68 on 10.5.11.24 X-Barracuda-Connect: mx1.redhat.com[209.132.183.28] X-Barracuda-Start-Time: 1456136733 X-Barracuda-Encrypted: ECDHE-RSA-AES256-GCM-SHA384 X-Barracuda-URL: https://192.48.176.15:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-BRTS-Status: 1 Hey, > > + if (optind < argc) { > > + > > + if (ret_next) { > > + cmd = XFS_IOC_FSBULKSTAT; > > + } else { > > + if (argc > 2) > > + return command_usage(&inode_cmd); > > FYI, this means one can't do the following: > > xfs_io -c "inode -v 123" > > Otherwise it looks good to me: > > Reviewed-by: Brian Foster > Thanks, I'm not sure how I didn't notice this, I thought I had tested all options with verbose mode. I believe I can fix this with this: - if (argc > 2) + if (argc > 2 && !verbose) I must check the amount of arguments, so nobody can pass 2 inode numbers. Bu I believe with this change I can fix it. I'm testing it right now, and will send a patch with this change after I test all the remaining options. Cheers > > + else > > + cmd = XFS_IOC_FSBULKSTAT_SINGLE; > > + } > > + > > + userino = strtoull(argv[optind], &p, 10); > > + if ((*p != '\0')) { > > + printf(_("[num] must be a numeric value\n")); > > + exitcode = 1; > > + return 0; > > + } > > + > > + bulkreq.lastip = &userino; > > + bulkreq.icount = 1; > > + bulkreq.ubuffer = &bstat; > > + bulkreq.ocount = &count; > > + > > + if (xfsctl(file->name, file->fd, cmd, &bulkreq)) { > > + if (errno == EINVAL) { > > + if (!ret_next) > > + printf("0\n"); > > + } else { > > + perror("xfsctl"); > > + } > > + exitcode = 1; > > + return 0; > > + } > > + > > + if (ret_next) > > + userino = bstat.bs_ino; > > + > > + if (verbose) > > + printf("%llu:%d\n", > > + userino, > > + userino > XFS_MAXINUMBER_32 ? 64 : 32); > > + else > > + /* Inode in use */ > > + printf("%llu\n", userino); > > + return 0; > > + > > + /* -n option must not be used stand alone */ > > + } else if (ret_next) { > > + return command_usage(&inode_cmd); > > + } > > + > > + bulkreq.lastip = &last; > > + bulkreq.icount = 1024; /* User-defined maybe!? */ > > + bulkreq.ubuffer = &igroup; > > + bulkreq.ocount = &count; > > + > > + for (;;) { > > + if (xfsctl(file->name, file->fd, XFS_IOC_FSINUMBERS, > > + &bulkreq)) { > > + perror("XFS_IOC_FSINUMBERS"); > > + exitcode = 1; > > + return 0; > > + } > > + > > + if (count == 0) > > + break; > > + > > + lastgrp = count; > > + } > > + > > + lastgrp--; > > + lastino = igroup[lastgrp].xi_startino + > > + xfs_highbit64(igroup[lastgrp].xi_allocmask); > > + > > + if (verbose) > > + printf("%llu:%d\n", lastino, > > + lastino > XFS_MAXINUMBER_32 ? 64 : 32); > > + else > > + printf("%d\n", lastino > XFS_MAXINUMBER_32 ? 1 : 0); > > + > > + return 0; > > +} > > + > > void > > open_init(void) > > { > > @@ -815,6 +954,16 @@ open_init(void) > > _("get/set preferred extent size (in bytes) for the open file"); > > extsize_cmd.help = extsize_help; > > > > + inode_cmd.name = "inode"; > > + inode_cmd.cfunc = inode_f; > > + inode_cmd.args = _("[-n | -v] [num]"); > > + inode_cmd.argmin = 0; > > + inode_cmd.argmax = 2; > > + inode_cmd.flags = CMD_NOMAP_OK; > > + inode_cmd.oneline = > > + _("Query inode number usage in the filesystem"); > > + inode_cmd.help = inode_help; > > + > > add_command(&open_cmd); > > add_command(&stat_cmd); > > add_command(&close_cmd); > > @@ -822,4 +971,5 @@ open_init(void) > > add_command(&chproj_cmd); > > add_command(&lsproj_cmd); > > add_command(&extsize_cmd); > > + add_command(&inode_cmd); > > } > > -- > > 2.4.3 > > > > _______________________________________________ > > xfs mailing list > > xfs@oss.sgi.com > > http://oss.sgi.com/mailman/listinfo/xfs -- Carlos From eguan@redhat.com Mon Feb 22 04:28:49 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=ham version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay3.corp.sgi.com [198.149.34.15]) by oss.sgi.com (Postfix) with ESMTP id 0DC387F55 for ; Mon, 22 Feb 2016 04:28:49 -0600 (CST) Received: from cuda.sgi.com (cuda2.sgi.com [192.48.176.25]) by relay3.corp.sgi.com (Postfix) with ESMTP id 69B52AC00D for ; Mon, 22 Feb 2016 02:28:42 -0800 (PST) X-ASG-Debug-ID: 1456136212-04cbb06adf61390001-NocioJ Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by cuda.sgi.com with ESMTP id Uiau2w2o7TjFuCKu (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO) for ; Mon, 22 Feb 2016 02:16:53 -0800 (PST) X-Barracuda-Envelope-From: eguan@redhat.com X-Barracuda-Apparent-Source-IP: 209.132.183.28 X-ASG-Whitelist: Client Received: from int-mx10.intmail.prod.int.phx2.redhat.com (int-mx10.intmail.prod.int.phx2.redhat.com [10.5.11.23]) by mx1.redhat.com (Postfix) with ESMTPS id B7D4E9B0C0; Mon, 22 Feb 2016 10:16:52 +0000 (UTC) Received: from localhost (dhcp-13-211.nay.redhat.com [10.66.13.211]) by int-mx10.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id u1MAGndJ013123; Mon, 22 Feb 2016 05:16:51 -0500 Date: Mon, 22 Feb 2016 18:16:48 +0800 From: Eryu Guan To: Dave Chinner Cc: fstests@vger.kernel.org, xfs@oss.sgi.com Subject: Re: xfstests configure error with xfsprogs v4.5-rc1 Message-ID: <20160222101648.GX11419@eguan.usersys.redhat.com> X-ASG-Orig-Subj: Re: xfstests configure error with xfsprogs v4.5-rc1 References: <20160222030304.GV11419@eguan.usersys.redhat.com> <20160222032450.GF14668@dastard> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="iAL9S67WQOXgEPD9" Content-Disposition: inline In-Reply-To: <20160222032450.GF14668@dastard> User-Agent: Mutt/1.5.24 (2015-08-30) X-Scanned-By: MIMEDefang 2.68 on 10.5.11.23 X-Barracuda-Connect: mx1.redhat.com[209.132.183.28] X-Barracuda-Start-Time: 1456136213 X-Barracuda-Encrypted: ECDHE-RSA-AES256-GCM-SHA384 X-Barracuda-URL: https://192.48.176.25:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-BRTS-Status: 1 --iAL9S67WQOXgEPD9 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline On Mon, Feb 22, 2016 at 02:24:50PM +1100, Dave Chinner wrote: > On Mon, Feb 22, 2016 at 11:03:04AM +0800, Eryu Guan wrote: > > Hi, > > > > After upgrading to xfsprogs v4.5-rc1 version, xfstests failed to built > > because of configure error: > > > > checking xfs/xfs.h usability... no > > checking xfs/xfs.h presence... yes > > configure: WARNING: xfs/xfs.h: present but cannot be compiled > > configure: WARNING: xfs/xfs.h: check for missing prerequisite headers? > > configure: WARNING: xfs/xfs.h: see the Autoconf documentation > > configure: WARNING: xfs/xfs.h: section "Present But Cannot Be Compiled" > > configure: WARNING: xfs/xfs.h: proceeding with the compiler's result > > checking for xfs/xfs.h... no > > > > FATAL ERROR: cannot find a valid header file. > > Run "make install-qa" from the xfsprogs source. > > > > and config.log showed: > > > > configure:4543: checking xfs/xfs.h usability > > configure:4543: ccache gcc -c -g -O2 conftest.c >&5 > > In file included from /usr/include/xfs/xfs.h:37:0, > > from conftest.c:73: > > /usr/include/xfs/linux.h:145:1: error: unknown type name 'off64_t' > > typedef off64_t xfs_off_t; > > ^ > > configure:4543: $? = 1 > > That would seem like a system library problem in that it doesn't > define off64_t through stdio.h. What distro are you compiling on? > Also, if you set _GNU_SOURCE, does it then compile? e.g. see > m4/package_libcdev.m4 for how to test whether code compiles under > certain defines. > > If it does compile with _GNU_SOURCE being set, then all that needs > to be is to update the autoconf rule. Yes, it compiles with _GNU_SOURCE being set. And it turns out that not only the check for xfs.h needs _GNU_SOURCE, many other checks need it too, like libxfs.h, xfs_log_format.h, xlog_assign_lsn, xqm.h and xfsctl. Attached file is updates I made to autoconf rules, as I'm not familiar with autotools, I'm not sure if it's a proper fix, but it does work for me, with both old and new version of xfsprogs. Thanks, Eryu --iAL9S67WQOXgEPD9 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename="off64_t.patch" diff --git a/configure.ac b/configure.ac index d038f95..fa48d2f 100644 --- a/configure.ac +++ b/configure.ac @@ -34,7 +34,9 @@ AC_HEADER_STDC cifs/ioctl.h \ ]) -AC_CHECK_HEADERS([xfs/xfs_log_format.h],,,[#include ]) +AC_CHECK_HEADERS([xfs/xfs_log_format.h],,,[ +#define _GNU_SOURCE +#include ]) AC_PACKAGE_NEED_UUIDCOMPARE diff --git a/m4/package_xfslibs.m4 b/m4/package_xfslibs.m4 index 78a3dc4..aeb3d7c 100644 --- a/m4/package_xfslibs.m4 +++ b/m4/package_xfslibs.m4 @@ -1,5 +1,5 @@ AC_DEFUN([AC_PACKAGE_NEED_XFS_XFS_H], - [ AC_CHECK_HEADERS([xfs/xfs.h]) + [ AC_CHECK_HEADERS([xfs/xfs.h],,,[#define _GNU_SOURCE]) if test "$ac_cv_header_xfs_xfs_h" != "yes"; then echo echo 'FATAL ERROR: cannot find a valid header file.' @@ -9,19 +9,21 @@ AC_DEFUN([AC_PACKAGE_NEED_XFS_XFS_H], ]) AC_DEFUN([AC_PACKAGE_WANT_LIBXFS_H], - [ AC_CHECK_HEADERS([xfs/libxfs.h], [ have_libxfs=true ], [ have_libxfs=false ]) + [ AC_CHECK_HEADERS([xfs/libxfs.h], [ have_libxfs=true ], + [ have_libxfs=false ], [#define _GNU_SOURCE]) AC_SUBST(have_libxfs) ]) AC_DEFUN([AC_PACKAGE_WANT_XLOG_ASSIGN_LSN], [ AC_CHECK_DECL(xlog_assign_lsn, - [ have_xlog_assign_lsn=true ], [ have_xlog_assign_lsn=false ], - [[#include ]]) + [ have_xlog_assign_lsn=true ], [ have_xlog_assign_lsn=false ], [[ +#define _GNU_SOURCE +#include ]]) AC_SUBST(have_xlog_assign_lsn) ]) AC_DEFUN([AC_PACKAGE_NEED_XFS_XQM_H], - [ AC_CHECK_HEADERS([xfs/xqm.h]) + [ AC_CHECK_HEADERS([xfs/xqm.h],,,[#define _GNU_SOURCE]) if test "$ac_cv_header_xfs_xqm_h" != "yes"; then echo echo 'FATAL ERROR: cannot find a valid header file.' @@ -99,7 +101,10 @@ AC_DEFUN([AC_PACKAGE_NEED_IRIX_LIBHANDLE], AC_DEFUN([AC_PACKAGE_NEED_XFSCTL_MACRO], [ AC_MSG_CHECKING([xfsctl from xfs/xfs.h]) - AC_TRY_LINK([#include ], [ int x = xfsctl(0, 0, 0, 0); ], + AC_TRY_LINK([ +#define _GNU_SOURCE +#include ], + [ int x = xfsctl(0, 0, 0, 0); ], [ echo ok ], [ echo echo 'FATAL ERROR: cannot find required macros in the XFS headers.' --iAL9S67WQOXgEPD9-- From cmaiolino@redhat.com Mon Feb 22 04:32:43 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=ham version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay1.corp.sgi.com [137.38.102.111]) by oss.sgi.com (Postfix) with ESMTP id 3B3D77F55 for ; Mon, 22 Feb 2016 04:32:43 -0600 (CST) Received: from cuda.sgi.com (cuda2.sgi.com [192.48.176.25]) by relay1.corp.sgi.com (Postfix) with ESMTP id 0EBC48F80B7 for ; Mon, 22 Feb 2016 02:32:37 -0800 (PST) X-ASG-Debug-ID: 1456137154-04cbb06add61a20001-NocioJ Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by cuda.sgi.com with ESMTP id LmFGC1u2qItxMFqF (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO) for ; Mon, 22 Feb 2016 02:32:35 -0800 (PST) X-Barracuda-Envelope-From: cmaiolino@redhat.com X-Barracuda-Apparent-Source-IP: 209.132.183.28 X-ASG-Whitelist: Client Received: from int-mx13.intmail.prod.int.phx2.redhat.com (int-mx13.intmail.prod.int.phx2.redhat.com [10.5.11.26]) by mx1.redhat.com (Postfix) with ESMTPS id BB899486AF for ; Mon, 22 Feb 2016 10:32:34 +0000 (UTC) Received: from zion.usersys.redhat.com (dhcp-26-103.brq.redhat.com [10.34.26.103]) by int-mx13.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id u1MAWXBo028435 for ; Mon, 22 Feb 2016 05:32:34 -0500 From: Carlos Maiolino To: xfs@oss.sgi.com Subject: [PATCH] xfs_io: implement 'inode' command V7 Date: Mon, 22 Feb 2016 11:32:29 +0100 X-ASG-Orig-Subj: [PATCH] xfs_io: implement 'inode' command V7 Message-Id: <1456137149-6168-1-git-send-email-cmaiolino@redhat.com> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.26 X-Barracuda-Connect: mx1.redhat.com[209.132.183.28] X-Barracuda-Start-Time: 1456137155 X-Barracuda-Encrypted: ECDHE-RSA-AES256-GCM-SHA384 X-Barracuda-URL: https://192.48.176.25:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-BRTS-Status: 1 Implements a new xfs_io command, named 'inode', which is supposed to be used to query information about inode's existence and its physical size in the filesystem. Supported options: Default: -- Return true(1) or false(0) if any inode greater than 32bits has been found in the filesystem [num] -- Return inode number or 0 if the inode [num] is in use -n [num] -- Return the next valid inode after [num] -v -- verbose mode Display the inode number and its physical size according to the argument used No manpage sent because there were changes in the supported options and its descriptions. I'll send the manpage after the options and descriptions are reviewed. - Changelog V3: - Merge all 3 patches from the V2 together in a single patch - Rework of '-n [num]' and 'num' only arguments algorithm - Argument -n now relies on bulkreq.count to check for next inodes, not on bstat.bs_ino anymore. - for loop in ret_lsize or ret_largest case, now relies on count being 0 to break the loop V4: - Refactor inode_f function to reduce its size and easier logic - Implement error handlers for invalid command combination (hopefully all invalid combinations). - use a single xfs_inogrp array for keep track of inodes - Fix missing newline in inode_help() - Rewrite help message in inode_help() - Fix indentation V5: - Reduce the amount of options - remove igrp_rec variable, and use igroup[lastgrp] directly to get information from the last inode groups returned by ioctl V6: - Re-use userino variable to reduce code duplication for command output - Use verbose option as an extension to another commands - report usage message when -n option is passed stand-alone - Refactor command outputs - Add a few comments to the code V7: - Fix verbose mode usage with an inode number Signed-off-by: Carlos Maiolino --- io/open.c | 150 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 150 insertions(+) diff --git a/io/open.c b/io/open.c index 037843d..2303527 100644 --- a/io/open.c +++ b/io/open.c @@ -20,6 +20,7 @@ #include "input.h" #include "init.h" #include "io.h" +#include "libxfs.h" #ifndef __O_TMPFILE #if defined __alpha__ @@ -44,6 +45,7 @@ static cmdinfo_t statfs_cmd; static cmdinfo_t chproj_cmd; static cmdinfo_t lsproj_cmd; static cmdinfo_t extsize_cmd; +static cmdinfo_t inode_cmd; static prid_t prid; static long extsize; @@ -750,6 +752,143 @@ statfs_f( return 0; } +static void +inode_help(void) +{ + printf(_( +"\n" +"Query physical information about the inode" +"\n" +" Default: -- Return true(1) or false(0) if any inode greater than\n" +" 32bits has been found in the filesystem\n" +"[num] -- Return inode number [num] or 0 if the inode [num] is in use\n" +" or not\n" +" -n [num] -- Return the next valid inode after [num]\n" +" -v -- verbose mode\n" +" Display the inode number and its physical size (in bits)\n" +" according to the argument used\n" +"\n")); +} + +static int +inode_f( + int argc, + char **argv) +{ + __s32 count = 0; + __s32 lastgrp = 0; + __u64 last = 0; + __u64 lastino = 0; + __u64 userino = 0; + char *p; + int c; + int verbose = 0; + int ret_next = 0; + int cmd = 0; + struct xfs_inogrp igroup[1024]; + struct xfs_fsop_bulkreq bulkreq; + struct xfs_bstat bstat; + + while ((c = getopt(argc, argv, "nv")) != EOF) { + switch (c) { + case 'v': + verbose = 1; + break; + case 'n': + ret_next = 1; + break; + default: + return command_usage(&inode_cmd); + } + } + + /* + * Inode number can be passed with or without extra arguments, so we + * should handle inode numbers passed by user out of getopt() + */ + if (optind < argc) { + + if (ret_next) { + cmd = XFS_IOC_FSBULKSTAT; + } else { + if ((argc > 2) && !verbose) + return command_usage(&inode_cmd); + else + cmd = XFS_IOC_FSBULKSTAT_SINGLE; + } + + userino = strtoull(argv[optind], &p, 10); + if ((*p != '\0')) { + printf(_("[num] must be a numeric value\n")); + exitcode = 1; + return 0; + } + + bulkreq.lastip = &userino; + bulkreq.icount = 1; + bulkreq.ubuffer = &bstat; + bulkreq.ocount = &count; + + if (xfsctl(file->name, file->fd, cmd, &bulkreq)) { + if (errno == EINVAL) { + if (!ret_next) + printf("0\n"); + } else { + perror("xfsctl"); + } + exitcode = 1; + return 0; + } + + if (ret_next) + userino = bstat.bs_ino; + + if (verbose) + printf("%llu:%d\n", + userino, + userino > XFS_MAXINUMBER_32 ? 64 : 32); + else + /* Inode in use */ + printf("%llu\n", userino); + return 0; + + /* -n option must not be used stand alone */ + } else if (ret_next) { + return command_usage(&inode_cmd); + } + + bulkreq.lastip = &last; + bulkreq.icount = 1024; /* User-defined maybe!? */ + bulkreq.ubuffer = &igroup; + bulkreq.ocount = &count; + + for (;;) { + if (xfsctl(file->name, file->fd, XFS_IOC_FSINUMBERS, + &bulkreq)) { + perror("XFS_IOC_FSINUMBERS"); + exitcode = 1; + return 0; + } + + if (count == 0) + break; + + lastgrp = count; + } + + lastgrp--; + lastino = igroup[lastgrp].xi_startino + + xfs_highbit64(igroup[lastgrp].xi_allocmask); + + if (verbose) + printf("%llu:%d\n", lastino, + lastino > XFS_MAXINUMBER_32 ? 64 : 32); + else + printf("%d\n", lastino > XFS_MAXINUMBER_32 ? 1 : 0); + + return 0; +} + void open_init(void) { @@ -815,6 +954,16 @@ open_init(void) _("get/set preferred extent size (in bytes) for the open file"); extsize_cmd.help = extsize_help; + inode_cmd.name = "inode"; + inode_cmd.cfunc = inode_f; + inode_cmd.args = _("[-n | -v] [num]"); + inode_cmd.argmin = 0; + inode_cmd.argmax = 2; + inode_cmd.flags = CMD_NOMAP_OK; + inode_cmd.oneline = + _("Query inode number usage in the filesystem"); + inode_cmd.help = inode_help; + add_command(&open_cmd); add_command(&stat_cmd); add_command(&close_cmd); @@ -822,4 +971,5 @@ open_init(void) add_command(&chproj_cmd); add_command(&lsproj_cmd); add_command(&extsize_cmd); + add_command(&inode_cmd); } -- 2.4.3 From david@fromorbit.com Mon Feb 22 05:38:49 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=ham version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay2.corp.sgi.com [137.38.102.29]) by oss.sgi.com (Postfix) with ESMTP id 575F07F56 for ; Mon, 22 Feb 2016 05:38:49 -0600 (CST) Received: from cuda.sgi.com (cuda2.sgi.com [192.48.176.25]) by relay2.corp.sgi.com (Postfix) with ESMTP id 234E8304051 for ; Mon, 22 Feb 2016 03:38:43 -0800 (PST) X-ASG-Debug-ID: 1456140160-04cbb06ae0647e0001-NocioJ Received: from ipmail06.adl6.internode.on.net (ipmail06.adl6.internode.on.net [150.101.137.145]) by cuda.sgi.com with ESMTP id mRbCS55Dl2Hr5PYM for ; Mon, 22 Feb 2016 03:22:41 -0800 (PST) X-Barracuda-Envelope-From: david@fromorbit.com X-Barracuda-Apparent-Source-IP: 150.101.137.145 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: A2DeBgAX78pW/5bY03ZegzqBP6Z9BotziU+GBwQCAoE3TQEBAQEBAWUnhEIBAQQnExwjEAgDDgoJJQ8FJQMhE4gZt0IBAQEHAQEBARwYhTKFAoQfg0GBDwWSc4QUjVWOfESOBWKDeCguhneBOQEBAQ Received: from ppp118-211-216-150.lns20.syd4.internode.on.net (HELO dastard) ([118.211.216.150]) by ipmail06.adl6.internode.on.net with ESMTP; 22 Feb 2016 21:52:15 +1030 Received: from dave by dastard with local (Exim 4.80) (envelope-from ) id 1aXoZC-00087C-LA; Mon, 22 Feb 2016 22:22:14 +1100 Date: Mon, 22 Feb 2016 22:22:14 +1100 From: Dave Chinner To: Christoph Hellwig Cc: kernel test robot , Dave Chinner , lkp@01.org, LKML , xfs@oss.sgi.com Subject: Re: [lkp] [xfs] fbcc025613: -5.6% fsmark.files_per_sec Message-ID: <20160222112214.GF25832@dastard> X-ASG-Orig-Subj: Re: [lkp] [xfs] fbcc025613: -5.6% fsmark.files_per_sec References: <87vb5lqunb.fsf@yhuang-dev.intel.com> <20160219064932.GX14668@dastard> <20160222085409.GA19493@lst.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20160222085409.GA19493@lst.de> User-Agent: Mutt/1.5.21 (2010-09-15) X-Barracuda-Connect: ipmail06.adl6.internode.on.net[150.101.137.145] X-Barracuda-Start-Time: 1456140161 X-Barracuda-URL: https://192.48.176.25:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-BRTS-Status: 1 X-Barracuda-Spam-Score: 0.00 X-Barracuda-Spam-Status: No, SCORE=0.00 using per-user scores of TAG_LEVEL=1000.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.7 tests=BSF_SC0_MISMATCH_TO X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.3.27235 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 0.00 BSF_SC0_MISMATCH_TO Envelope rcpt doesn't match header On Mon, Feb 22, 2016 at 09:54:09AM +0100, Christoph Hellwig wrote: > On Fri, Feb 19, 2016 at 05:49:32PM +1100, Dave Chinner wrote: > > That doesn't really seem right. The writeback should be done as a > > single ioend, with a single completion, with a single setsize > > transaction, adn then all the pages are marked clean sequentially. > > The above behaviour implies we are ending up doing something like: > > > > fsync proc io completion > > wait on page 0 > > end page 0 writeback > > wake up page 0 > > wait on page 1 > > end page 1 writeback > > wake up page 1 > > wait on page 2 > > end page 2 writeback > > wake up page 2 > > > > Though in slightly larger batches than a single page (10 wakeups a > > file, so batches of around 100 pages per wakeup?). i.e. the fsync > > IO wait appears to be racing with IO completion marking pages as > > done. I simply cannot see how the above change would cause that, as > > it was simply a change in the IO submission code that doesn't affect > > overall size or shape of the IOs being submitted. > > Could this be the lack of blk plugs, which will cause us to complete > too early? No, because block plugging is still in place on the patch that the regression is reported on. The difference it makes is that we don't do any IO submission while building the ioend chaing, and submit it all in one hit at the end of the ->writepages call. However, this is an intermediate patch in the series, and later patches correct this and we end up 4 commits later with bios being built directly and being submitted the moment they are full. With the entire series in place, I can't reproduce any sort of bad behaviour, nor do I see any repeatable performance differential. So I really want to know if this regression is seen with the entire patchset applied, and if I can't reproduce on a local ramdisk or real storage then we need to decide how much we care about fsync performance on a volatile ramdisk... Cheers, Dave. -- Dave Chinner david@fromorbit.com From bfoster@redhat.com Mon Feb 22 07:36:15 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=ham version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay1.corp.sgi.com [137.38.102.111]) by oss.sgi.com (Postfix) with ESMTP id 4FC217F5A for ; Mon, 22 Feb 2016 07:36:15 -0600 (CST) Received: from cuda.sgi.com (cuda1.sgi.com [192.48.157.11]) by relay1.corp.sgi.com (Postfix) with ESMTP id F04388F8089 for ; Mon, 22 Feb 2016 05:36:08 -0800 (PST) X-ASG-Debug-ID: 1456148160-04bdf07ab6bba10001-NocioJ Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by cuda.sgi.com with ESMTP id G50wRp7AWb3Fc10J (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO) for ; Mon, 22 Feb 2016 05:36:01 -0800 (PST) X-Barracuda-Envelope-From: bfoster@redhat.com X-Barracuda-Apparent-Source-IP: 209.132.183.28 X-ASG-Whitelist: Client Received: from int-mx10.intmail.prod.int.phx2.redhat.com (int-mx10.intmail.prod.int.phx2.redhat.com [10.5.11.23]) by mx1.redhat.com (Postfix) with ESMTPS id BA76C8553D for ; Mon, 22 Feb 2016 13:36:00 +0000 (UTC) Received: from bfoster.bfoster (dhcp-41-22.bos.redhat.com [10.18.41.22]) by int-mx10.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id u1MDa0Zi006810; Mon, 22 Feb 2016 08:36:00 -0500 Received: by bfoster.bfoster (Postfix, from userid 1000) id 4E51F12596E; Mon, 22 Feb 2016 08:35:59 -0500 (EST) Date: Mon, 22 Feb 2016 08:35:59 -0500 From: Brian Foster To: Carlos Maiolino Cc: xfs@oss.sgi.com Subject: Re: [PATCH] xfs_io: implement 'inode' command V7 Message-ID: <20160222133558.GE44625@bfoster.bfoster> X-ASG-Orig-Subj: Re: [PATCH] xfs_io: implement 'inode' command V7 References: <1456137149-6168-1-git-send-email-cmaiolino@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1456137149-6168-1-git-send-email-cmaiolino@redhat.com> User-Agent: Mutt/1.5.24 (2015-08-30) X-Scanned-By: MIMEDefang 2.68 on 10.5.11.23 X-Barracuda-Connect: mx1.redhat.com[209.132.183.28] X-Barracuda-Start-Time: 1456148161 X-Barracuda-Encrypted: ECDHE-RSA-AES256-GCM-SHA384 X-Barracuda-URL: https://192.48.157.11:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-BRTS-Status: 1 On Mon, Feb 22, 2016 at 11:32:29AM +0100, Carlos Maiolino wrote: > Implements a new xfs_io command, named 'inode', which is supposed to be > used to query information about inode's existence and its physical size > in the filesystem. > > Supported options: > > Default: -- Return true(1) or false(0) if any inode greater than > 32bits has been found in the filesystem > [num] -- Return inode number or 0 if the inode [num] is in use > -n [num] -- Return the next valid inode after [num] > -v -- verbose mode > Display the inode number and its physical size according to the > argument used > > No manpage sent because there were changes in the supported options and its > descriptions. > I'll send the manpage after the options and descriptions are reviewed. > > - Changelog > > V3: > - Merge all 3 patches from the V2 together in a single patch > - Rework of '-n [num]' and 'num' only arguments algorithm > - Argument -n now relies on bulkreq.count to check for next inodes, not > on bstat.bs_ino anymore. > - for loop in ret_lsize or ret_largest case, now relies on count being 0 > to break the loop > > V4: > - Refactor inode_f function to reduce its size and easier logic > - Implement error handlers for invalid command combination (hopefully > all invalid combinations). > - use a single xfs_inogrp array for keep track of inodes > - Fix missing newline in inode_help() > - Rewrite help message in inode_help() > - Fix indentation > > V5: > - Reduce the amount of options > - remove igrp_rec variable, and use igroup[lastgrp] directly to get > information from the last inode groups returned by ioctl > > V6: > - Re-use userino variable to reduce code duplication for command output > - Use verbose option as an extension to another commands > - report usage message when -n option is passed stand-alone > - Refactor command outputs > - Add a few comments to the code > > V7: > - Fix verbose mode usage with an inode number > > Signed-off-by: Carlos Maiolino > --- Looks good and "inode -v ..." works... Reviewed-by: Brian Foster > io/open.c | 150 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ > 1 file changed, 150 insertions(+) > > diff --git a/io/open.c b/io/open.c > index 037843d..2303527 100644 > --- a/io/open.c > +++ b/io/open.c > @@ -20,6 +20,7 @@ > #include "input.h" > #include "init.h" > #include "io.h" > +#include "libxfs.h" > > #ifndef __O_TMPFILE > #if defined __alpha__ > @@ -44,6 +45,7 @@ static cmdinfo_t statfs_cmd; > static cmdinfo_t chproj_cmd; > static cmdinfo_t lsproj_cmd; > static cmdinfo_t extsize_cmd; > +static cmdinfo_t inode_cmd; > static prid_t prid; > static long extsize; > > @@ -750,6 +752,143 @@ statfs_f( > return 0; > } > > +static void > +inode_help(void) > +{ > + printf(_( > +"\n" > +"Query physical information about the inode" > +"\n" > +" Default: -- Return true(1) or false(0) if any inode greater than\n" > +" 32bits has been found in the filesystem\n" > +"[num] -- Return inode number [num] or 0 if the inode [num] is in use\n" > +" or not\n" > +" -n [num] -- Return the next valid inode after [num]\n" > +" -v -- verbose mode\n" > +" Display the inode number and its physical size (in bits)\n" > +" according to the argument used\n" > +"\n")); > +} > + > +static int > +inode_f( > + int argc, > + char **argv) > +{ > + __s32 count = 0; > + __s32 lastgrp = 0; > + __u64 last = 0; > + __u64 lastino = 0; > + __u64 userino = 0; > + char *p; > + int c; > + int verbose = 0; > + int ret_next = 0; > + int cmd = 0; > + struct xfs_inogrp igroup[1024]; > + struct xfs_fsop_bulkreq bulkreq; > + struct xfs_bstat bstat; > + > + while ((c = getopt(argc, argv, "nv")) != EOF) { > + switch (c) { > + case 'v': > + verbose = 1; > + break; > + case 'n': > + ret_next = 1; > + break; > + default: > + return command_usage(&inode_cmd); > + } > + } > + > + /* > + * Inode number can be passed with or without extra arguments, so we > + * should handle inode numbers passed by user out of getopt() > + */ > + if (optind < argc) { > + > + if (ret_next) { > + cmd = XFS_IOC_FSBULKSTAT; > + } else { > + if ((argc > 2) && !verbose) > + return command_usage(&inode_cmd); > + else > + cmd = XFS_IOC_FSBULKSTAT_SINGLE; > + } > + > + userino = strtoull(argv[optind], &p, 10); > + if ((*p != '\0')) { > + printf(_("[num] must be a numeric value\n")); > + exitcode = 1; > + return 0; > + } > + > + bulkreq.lastip = &userino; > + bulkreq.icount = 1; > + bulkreq.ubuffer = &bstat; > + bulkreq.ocount = &count; > + > + if (xfsctl(file->name, file->fd, cmd, &bulkreq)) { > + if (errno == EINVAL) { > + if (!ret_next) > + printf("0\n"); > + } else { > + perror("xfsctl"); > + } > + exitcode = 1; > + return 0; > + } > + > + if (ret_next) > + userino = bstat.bs_ino; > + > + if (verbose) > + printf("%llu:%d\n", > + userino, > + userino > XFS_MAXINUMBER_32 ? 64 : 32); > + else > + /* Inode in use */ > + printf("%llu\n", userino); > + return 0; > + > + /* -n option must not be used stand alone */ > + } else if (ret_next) { > + return command_usage(&inode_cmd); > + } > + > + bulkreq.lastip = &last; > + bulkreq.icount = 1024; /* User-defined maybe!? */ > + bulkreq.ubuffer = &igroup; > + bulkreq.ocount = &count; > + > + for (;;) { > + if (xfsctl(file->name, file->fd, XFS_IOC_FSINUMBERS, > + &bulkreq)) { > + perror("XFS_IOC_FSINUMBERS"); > + exitcode = 1; > + return 0; > + } > + > + if (count == 0) > + break; > + > + lastgrp = count; > + } > + > + lastgrp--; > + lastino = igroup[lastgrp].xi_startino + > + xfs_highbit64(igroup[lastgrp].xi_allocmask); > + > + if (verbose) > + printf("%llu:%d\n", lastino, > + lastino > XFS_MAXINUMBER_32 ? 64 : 32); > + else > + printf("%d\n", lastino > XFS_MAXINUMBER_32 ? 1 : 0); > + > + return 0; > +} > + > void > open_init(void) > { > @@ -815,6 +954,16 @@ open_init(void) > _("get/set preferred extent size (in bytes) for the open file"); > extsize_cmd.help = extsize_help; > > + inode_cmd.name = "inode"; > + inode_cmd.cfunc = inode_f; > + inode_cmd.args = _("[-n | -v] [num]"); > + inode_cmd.argmin = 0; > + inode_cmd.argmax = 2; > + inode_cmd.flags = CMD_NOMAP_OK; > + inode_cmd.oneline = > + _("Query inode number usage in the filesystem"); > + inode_cmd.help = inode_help; > + > add_command(&open_cmd); > add_command(&stat_cmd); > add_command(&close_cmd); > @@ -822,4 +971,5 @@ open_init(void) > add_command(&chproj_cmd); > add_command(&lsproj_cmd); > add_command(&extsize_cmd); > + add_command(&inode_cmd); > } > -- > 2.4.3 > > _______________________________________________ > xfs mailing list > xfs@oss.sgi.com > http://oss.sgi.com/mailman/listinfo/xfs From hch@lst.de Mon Feb 22 07:39:57 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=ham version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay2.corp.sgi.com [137.38.102.29]) by oss.sgi.com (Postfix) with ESMTP id 804C37CB2 for ; Mon, 22 Feb 2016 07:39:57 -0600 (CST) Received: from cuda.sgi.com (cuda1.sgi.com [192.48.157.11]) by relay2.corp.sgi.com (Postfix) with ESMTP id 402F3304089 for ; Mon, 22 Feb 2016 05:39:51 -0800 (PST) X-ASG-Debug-ID: 1456148384-04bdf07ab3bbaf0001-NocioJ Received: from newverein.lst.de (verein.lst.de [213.95.11.211]) by cuda.sgi.com with ESMTP id xgf0zuq8EDD59u60 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO) for ; Mon, 22 Feb 2016 05:39:45 -0800 (PST) X-Barracuda-Envelope-From: hch@lst.de X-Barracuda-Apparent-Source-IP: 213.95.11.211 Received: by newverein.lst.de (Postfix, from userid 2407) id E883E68C09; Mon, 22 Feb 2016 14:39:43 +0100 (CET) Date: Mon, 22 Feb 2016 14:39:43 +0100 From: Christoph Hellwig To: Dave Chinner Cc: Brian Foster , Christoph Hellwig , xfs@oss.sgi.com Subject: Re: [PATCH 2/3] xfs: better xfs_trans_alloc interface Message-ID: <20160222133943.GA26966@lst.de> X-ASG-Orig-Subj: Re: [PATCH 2/3] xfs: better xfs_trans_alloc interface References: <1455699159-20906-1-git-send-email-hch@lst.de> <1455699159-20906-2-git-send-email-hch@lst.de> <20160217134006.GA4065@bfoster.bfoster> <20160217220436.GI19486@dastard> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20160217220436.GI19486@dastard> User-Agent: Mutt/1.5.17 (2007-11-01) X-Barracuda-Connect: verein.lst.de[213.95.11.211] X-Barracuda-Start-Time: 1456148385 X-Barracuda-Encrypted: ECDHE-RSA-AES256-GCM-SHA384 X-Barracuda-URL: https://192.48.157.11:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-BRTS-Status: 1 X-Barracuda-Spam-Score: 0.00 X-Barracuda-Spam-Status: No, SCORE=0.00 using per-user scores of TAG_LEVEL=1000.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.7 tests=BSF_SC0_MISMATCH_TO X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.3.27237 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 0.00 BSF_SC0_MISMATCH_TO Envelope rcpt doesn't match header On Thu, Feb 18, 2016 at 09:04:36AM +1100, Dave Chinner wrote: > I've considered doing this removal myself in the past - doing > somethign like embedding the return address of the > xfs-trans_reserve() call in the ticket that is allocated tells us > exactly where the call was made. This can be printed with %pS, and > that gives us the function (and location in the function) the > reservation was made. Hence we solve the problem of not > knowing which call path triggered the problem. > > Hence I don't think we actually need to the type in every function > call. This brings up a question: do we care about the type of the transaction, or the caller? The existing types were rather confused about that. If it's the transaction type we could simply add a name field to struct xfs_trans_res, if we care about caller the trick from Dave should do the job. > > Cheers, > > Dave. > -- > Dave Chinner > david@fromorbit.com ---end quoted text--- From billodo@redhat.com Mon Feb 22 07:47:35 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=ham version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay3.corp.sgi.com [198.149.34.15]) by oss.sgi.com (Postfix) with ESMTP id A36477F61 for ; Mon, 22 Feb 2016 07:47:35 -0600 (CST) Received: from cuda.sgi.com (cuda1.sgi.com [192.48.157.11]) by relay3.corp.sgi.com (Postfix) with ESMTP id 33243AC00D for ; Mon, 22 Feb 2016 05:47:29 -0800 (PST) X-ASG-Debug-ID: 1456148847-04bdf07ab5bbde0001-NocioJ Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by cuda.sgi.com with ESMTP id ltiIGBOfpDcde2U1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO) for ; Mon, 22 Feb 2016 05:47:27 -0800 (PST) X-Barracuda-Envelope-From: billodo@redhat.com X-Barracuda-Apparent-Source-IP: 209.132.183.28 X-ASG-Whitelist: Client Received: from int-mx10.intmail.prod.int.phx2.redhat.com (int-mx10.intmail.prod.int.phx2.redhat.com [10.5.11.23]) by mx1.redhat.com (Postfix) with ESMTPS id 43B9A8553B for ; Mon, 22 Feb 2016 13:47:27 +0000 (UTC) Received: from redhat.com (vpn-55-60.rdu2.redhat.com [10.10.55.60]) by int-mx10.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id u1MDlPQP014169 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Mon, 22 Feb 2016 08:47:26 -0500 Date: Mon, 22 Feb 2016 07:47:24 -0600 From: "Bill O'Donnell" To: Carlos Maiolino Cc: xfs@oss.sgi.com Subject: Re: [PATCH] xfs_io: implement 'inode' command V7 Message-ID: <20160222134724.GA2740@redhat.com> X-ASG-Orig-Subj: Re: [PATCH] xfs_io: implement 'inode' command V7 References: <1456137149-6168-1-git-send-email-cmaiolino@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1456137149-6168-1-git-send-email-cmaiolino@redhat.com> User-Agent: Mutt/1.5.24 (2015-08-30) X-Scanned-By: MIMEDefang 2.68 on 10.5.11.23 X-Barracuda-Connect: mx1.redhat.com[209.132.183.28] X-Barracuda-Start-Time: 1456148847 X-Barracuda-Encrypted: ECDHE-RSA-AES256-GCM-SHA384 X-Barracuda-URL: https://192.48.157.11:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-BRTS-Status: 1 On Mon, Feb 22, 2016 at 11:32:29AM +0100, Carlos Maiolino wrote: > Implements a new xfs_io command, named 'inode', which is supposed to be > used to query information about inode's existence and its physical size > in the filesystem. > > Supported options: > > Default: -- Return true(1) or false(0) if any inode greater than > 32bits has been found in the filesystem > [num] -- Return inode number or 0 if the inode [num] is in use > -n [num] -- Return the next valid inode after [num] > -v -- verbose mode > Display the inode number and its physical size according to the > argument used > > No manpage sent because there were changes in the supported options and its > descriptions. > I'll send the manpage after the options and descriptions are reviewed. > > - Changelog > > V3: > - Merge all 3 patches from the V2 together in a single patch > - Rework of '-n [num]' and 'num' only arguments algorithm > - Argument -n now relies on bulkreq.count to check for next inodes, not > on bstat.bs_ino anymore. > - for loop in ret_lsize or ret_largest case, now relies on count being 0 > to break the loop > > V4: > - Refactor inode_f function to reduce its size and easier logic > - Implement error handlers for invalid command combination (hopefully > all invalid combinations). > - use a single xfs_inogrp array for keep track of inodes > - Fix missing newline in inode_help() > - Rewrite help message in inode_help() > - Fix indentation > > V5: > - Reduce the amount of options > - remove igrp_rec variable, and use igroup[lastgrp] directly to get > information from the last inode groups returned by ioctl > > V6: > - Re-use userino variable to reduce code duplication for command output > - Use verbose option as an extension to another commands > - report usage message when -n option is passed stand-alone > - Refactor command outputs > - Add a few comments to the code > > V7: > - Fix verbose mode usage with an inode number > > Signed-off-by: Carlos Maiolino > --- looks good to me. Thanks! Reviewed-by: Bill O'Donnell > io/open.c | 150 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ > 1 file changed, 150 insertions(+) > > diff --git a/io/open.c b/io/open.c > index 037843d..2303527 100644 > --- a/io/open.c > +++ b/io/open.c > @@ -20,6 +20,7 @@ > #include "input.h" > #include "init.h" > #include "io.h" > +#include "libxfs.h" > > #ifndef __O_TMPFILE > #if defined __alpha__ > @@ -44,6 +45,7 @@ static cmdinfo_t statfs_cmd; > static cmdinfo_t chproj_cmd; > static cmdinfo_t lsproj_cmd; > static cmdinfo_t extsize_cmd; > +static cmdinfo_t inode_cmd; > static prid_t prid; > static long extsize; > > @@ -750,6 +752,143 @@ statfs_f( > return 0; > } > > +static void > +inode_help(void) > +{ > + printf(_( > +"\n" > +"Query physical information about the inode" > +"\n" > +" Default: -- Return true(1) or false(0) if any inode greater than\n" > +" 32bits has been found in the filesystem\n" > +"[num] -- Return inode number [num] or 0 if the inode [num] is in use\n" > +" or not\n" > +" -n [num] -- Return the next valid inode after [num]\n" > +" -v -- verbose mode\n" > +" Display the inode number and its physical size (in bits)\n" > +" according to the argument used\n" > +"\n")); > +} > + > +static int > +inode_f( > + int argc, > + char **argv) > +{ > + __s32 count = 0; > + __s32 lastgrp = 0; > + __u64 last = 0; > + __u64 lastino = 0; > + __u64 userino = 0; > + char *p; > + int c; > + int verbose = 0; > + int ret_next = 0; > + int cmd = 0; > + struct xfs_inogrp igroup[1024]; > + struct xfs_fsop_bulkreq bulkreq; > + struct xfs_bstat bstat; > + > + while ((c = getopt(argc, argv, "nv")) != EOF) { > + switch (c) { > + case 'v': > + verbose = 1; > + break; > + case 'n': > + ret_next = 1; > + break; > + default: > + return command_usage(&inode_cmd); > + } > + } > + > + /* > + * Inode number can be passed with or without extra arguments, so we > + * should handle inode numbers passed by user out of getopt() > + */ > + if (optind < argc) { > + > + if (ret_next) { > + cmd = XFS_IOC_FSBULKSTAT; > + } else { > + if ((argc > 2) && !verbose) > + return command_usage(&inode_cmd); > + else > + cmd = XFS_IOC_FSBULKSTAT_SINGLE; > + } > + > + userino = strtoull(argv[optind], &p, 10); > + if ((*p != '\0')) { > + printf(_("[num] must be a numeric value\n")); > + exitcode = 1; > + return 0; > + } > + > + bulkreq.lastip = &userino; > + bulkreq.icount = 1; > + bulkreq.ubuffer = &bstat; > + bulkreq.ocount = &count; > + > + if (xfsctl(file->name, file->fd, cmd, &bulkreq)) { > + if (errno == EINVAL) { > + if (!ret_next) > + printf("0\n"); > + } else { > + perror("xfsctl"); > + } > + exitcode = 1; > + return 0; > + } > + > + if (ret_next) > + userino = bstat.bs_ino; > + > + if (verbose) > + printf("%llu:%d\n", > + userino, > + userino > XFS_MAXINUMBER_32 ? 64 : 32); > + else > + /* Inode in use */ > + printf("%llu\n", userino); > + return 0; > + > + /* -n option must not be used stand alone */ > + } else if (ret_next) { > + return command_usage(&inode_cmd); > + } > + > + bulkreq.lastip = &last; > + bulkreq.icount = 1024; /* User-defined maybe!? */ > + bulkreq.ubuffer = &igroup; > + bulkreq.ocount = &count; > + > + for (;;) { > + if (xfsctl(file->name, file->fd, XFS_IOC_FSINUMBERS, > + &bulkreq)) { > + perror("XFS_IOC_FSINUMBERS"); > + exitcode = 1; > + return 0; > + } > + > + if (count == 0) > + break; > + > + lastgrp = count; > + } > + > + lastgrp--; > + lastino = igroup[lastgrp].xi_startino + > + xfs_highbit64(igroup[lastgrp].xi_allocmask); > + > + if (verbose) > + printf("%llu:%d\n", lastino, > + lastino > XFS_MAXINUMBER_32 ? 64 : 32); > + else > + printf("%d\n", lastino > XFS_MAXINUMBER_32 ? 1 : 0); > + > + return 0; > +} > + > void > open_init(void) > { > @@ -815,6 +954,16 @@ open_init(void) > _("get/set preferred extent size (in bytes) for the open file"); > extsize_cmd.help = extsize_help; > > + inode_cmd.name = "inode"; > + inode_cmd.cfunc = inode_f; > + inode_cmd.args = _("[-n | -v] [num]"); > + inode_cmd.argmin = 0; > + inode_cmd.argmax = 2; > + inode_cmd.flags = CMD_NOMAP_OK; > + inode_cmd.oneline = > + _("Query inode number usage in the filesystem"); > + inode_cmd.help = inode_help; > + > add_command(&open_cmd); > add_command(&stat_cmd); > add_command(&close_cmd); > @@ -822,4 +971,5 @@ open_init(void) > add_command(&chproj_cmd); > add_command(&lsproj_cmd); > add_command(&extsize_cmd); > + add_command(&inode_cmd); > } > -- > 2.4.3 > > _______________________________________________ > xfs mailing list > xfs@oss.sgi.com > http://oss.sgi.com/mailman/listinfo/xfs From info@knight.dp.ua Mon Feb 22 08:28:50 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=CTYPE_001C_B,HTML_MESSAGE, T_OBFU_DOC_ATTACH autolearn=ham version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay1.corp.sgi.com [137.38.102.111]) by oss.sgi.com (Postfix) with ESMTP id 01FC27F62 for ; Mon, 22 Feb 2016 08:28:50 -0600 (CST) Received: from cuda.sgi.com (cuda2.sgi.com [192.48.176.25]) by relay1.corp.sgi.com (Postfix) with ESMTP id C4D0D8F80B7 for ; Mon, 22 Feb 2016 06:28:43 -0800 (PST) X-ASG-Debug-ID: 1456150167-04cbb06ae067b50001-NocioJ Received: from mail7.freehost.com.ua (mail7.freehost.com.ua [194.0.200.209]) by cuda.sgi.com with ESMTP id 4DeOPYzl5zNOIVaW (version=TLSv1.2 cipher=DHE-RSA-AES128-SHA bits=128 verify=NO) for ; Mon, 22 Feb 2016 06:09:29 -0800 (PST) X-Barracuda-Envelope-From: info@knight.dp.ua X-Barracuda-Apparent-Source-IP: 194.0.200.209 Received: from drweb by mail7.freehost.com.ua with drweb-scanned (Exim 4.80) (envelope-from ) id 1aXrB1-0007qu-F8 for xfs@oss.sgi.com; Mon, 22 Feb 2016 16:09:27 +0200 Received: from [10.3.58.251] (port=54584 helo=freemail.freehost.com.ua) by mail7.freehost.com.ua with esmtps (TLS1.2:DHE_RSA_AES_128_CBC_SHA1:128) (Exim 4.80) (envelope-from ) id 1aXrB1-0007ql-DZ for xfs@oss.sgi.com; Mon, 22 Feb 2016 16:09:27 +0200 Received: from [93.127.108.116] (port=28962 helo=192.168.1.100) by freemail.freehost.com.ua with esmtpa (Exim 4.80) (envelope-from ) id 1aXrB0-0005qB-HB for xfs@oss.sgi.com; Mon, 22 Feb 2016 16:09:27 +0200 X-Confirm-Reading-To: info@knight.dp.ua From: "=?Windows-1251?b?zejq7uvg6Q==?=" To: "xfs" Subject: =?Windows-1251?b?ze7i7uUgz/Dl5Ovu5uXt6OUgzw==?=o =?Windows-1251?b?zw==?=o=?Windows-1251?b?6+jj?=pa=?Windows-1251?b?9OjoIOgg?=Pek=?Windows-1251?b?6+Ds5Q==?= Date: Mon, 22 Feb 2016 16:10:35 +0000 X-ASG-Orig-Subj: =?Windows-1251?b?ze7i7uUgz/Dl5Ovu5uXt6OUgzw==?=o =?Windows-1251?b?zw==?=o=?Windows-1251?b?6+jj?=pa=?Windows-1251?b?9OjoIOgg?=Pek=?Windows-1251?b?6+Ds5Q==?= Organization: =?Windows-1251?b?wujy/+f8?= MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="----=_NextPart_000_0000_01C6527E.AE8904D0" X-Authenticated-Sender: info@knight.dp.ua X-Drweb-SpamState:no X-Drweb-SpamScore:60 X-DrWeb-SpamReason:Vade Retro 01.387.53 AS+AV+AP Profile: ; Bailout: N/A; $Invisible words (50);^NoID (10) X-Drweb-SpamState-Num:0 Message-Id: X-Barracuda-Connect: mail7.freehost.com.ua[194.0.200.209] X-Barracuda-Start-Time: 1456150168 X-Barracuda-Encrypted: DHE-RSA-AES128-SHA X-Barracuda-URL: https://192.48.176.25:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-BRTS-Status: 1 X-Barracuda-Spam-Score: 0.00 X-Barracuda-Spam-Status: No, SCORE=0.00 using per-user scores of TAG_LEVEL=1000.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.7 tests=BSF_SC0_INVIS_TEXT_1K, HTML_MESSAGE X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.3.27238 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 0.00 HTML_MESSAGE BODY: HTML included in message 0.00 BSF_SC0_INVIS_TEXT_1K Custom Rule BSF_SC0_INVIS_TEXT_1K This is a multi-part message in MIME format. ------=_NextPart_000_0000_01C6527E.AE8904D0 Content-Type: multipart/alternative; boundary="----=_NextPart_001_0001_01C6527E.AE8904D0" ------=_NextPart_001_0001_01C6527E.AE8904D0 Content-Type: text/plain; charset="Windows-1251" Content-Transfer-Encoding: 8bit ! . , . . : (1, 2, 3), (1, 2, 3), , , , , , , , , , (), . . . 1 - 1000 - 28 - 9- : 1 000 0,72 . 1 . . "Knight.doc" , "B y op pe" 49000, . , . , 31 .: (095) 872-62-92 . xfs@oss.sgi.com , "DEL". xfs@oss.sgi.com , xfs@oss.sgi.com . ³ 720 09.08.2005 . 33 " ", . 363-1 . crbrgujlbfdymzunngdmpmwbfnivjtidunxyveyfpzesgllkbvsbycltiohzfoklzvptfbalocrgvndbeseaomvdmgytgtdy kbvsbycltiohzfoklzvptfbalocrgvndbeseaomvd ? " "! , , , , , - ... . 22.02.2016 16:10:35 xfs@oss.sgi.com 44371736854437173685443717368544371736854437173685; 16:10:35 , 16:10:35 , , 16:10:35 , 16:10:35 , 16:10:35 , 16:10:35 , , 16:10:35 , 16:10:35 , 16:10:35 , 16:10:35 . 16:10:35 , 16:10:35 , 16:10:35 , , 16:10:35 , , 16:10:35 , 16:10:35 , 16:10:35 - , 16:10:35 . 16:10:35 , 16:10:35 , 16:10:35 , 16:10:35 , 16:10:35 , 16:10:35 , 16:10:35 , 16:10:35 , 16:10:35 , 16:10:35 , 16:10:35 , 16:10:35 , 16:10:35 , 16:10:35 , 16:10:35 , , 16:10:35 , 16:10:35 . 16:10:35 ------=_NextPart_001_0001_01C6527E.AE8904D0 Content-Type: text/html; charset="Windows-1251" Content-Transfer-Encoding: 8bit

    !

    .

    , .

    . : (1, 2, 3), (1, 2, 3), , , , , , , , , , (), .
    . .
    1 - 1000 - 28 - 9-
    :
    1 000 0,72 . 1 .

    .

    "Knight.doc"

    ,

    "B y op pe"
    49000, . , . , 31 .: (095) 872-62-92

    .

     

    xfs@oss.sgi.com , "DEL".  

     

     

    xfs@oss.sgi.com
    , xfs@oss.sgi.com . ³ 720 09.08.2005 . 33 " ", . 363-1 .

    crbrgujlbfdymzunngdmpmwbfnivjtidunxyveyfpzesgllkbvsbycltiohzfoklzvptfbalocrgvndbeseaomvdmgytgtdy kbvsbycltiohzfoklzvptfbalocrgvndbeseaomvd ? " "! , , , , , - ... . 22.02.2016 16:10:35 xfs@oss.sgi.com 44371736854437173685443717368544371736854437173685; 16:10:35 , 16:10:35 , , 16:10:35 , 16:10:35 , 16:10:35 , 16:10:35 , , 16:10:35 ,  16:10:35 , 16:10:35 , 16:10:35 . 16:10:35 , 16:10:35 , 16:10:35 , , 16:10:35 , , 16:10:35 , 16:10:35 , 16:10:35 - , 16:10:35 . 16:10:35 , 16:10:35 , 16:10:35 , 16:10:35 , 16:10:35 , 16:10:35 , 16:10:35 , 16:10:35 , 16:10:35 , 16:10:35 , 16:10:35 , 16:10:35 , 16:10:35 , 16:10:35 , 16:10:35 , , 16:10:35 , 16:10:35 . 16:10:35

    ------=_NextPart_001_0001_01C6527E.AE8904D0-- ------=_NextPart_000_0000_01C6527E.AE8904D0 Content-Type: application/octet-stream; name="Knight.doc" Content-Transfer-Encoding: base64 Content-Disposition: attachment; filename="Knight.doc" 0M8R4KGxGuEAAAAAAAAAAAAAAAAAAAAAPgADAP7/CQAGAAAAAAAAAAAAAAAB AAAAVgAAAAAAAAAAEAAAWAAAAAEAAAD+////AAAAAFUAAAD///////////// //////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////// ///////////////////////spcEAJ2AZBAAA+BK/AAAAAAAAEAAAAAAABgAA JiAAAA4AYmpiahDTENMAAAAAAAAAAAAAAAAAAAAAAAAZBBYANCYAAHK5AQBy uQEA7AUAAAAAAAAlAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD//w8AAAAAAAAA AAD//w8AAAAAAAAAAAD//w8AAAAAAAAAAAAAAAAAAAAAAKQAAAAAAG4EAAAA AAAAbgQAAG4EAAAAAAAAbgQAAAAAAABuBAAAAAAAAG4EAAAAAAAAbgQAABQA AAAAAAAAAAAAAIIEAAAAAAAAag0AAAAAAABqDQAAAAAAAGoNAAA4AAAAog0A ACQAAADGDQAAHAAAAIIEAAAAAAAA1BMAALYAAADuDQAAAAAAAO4NAAAiAAAA EA4AAAAAAAAQDgAAAAAAABAOAAAAAAAAIw8AAAAAAAAjDwAAAAAAACMPAAAA AAAALxMAAAIAAAAxEwAAAAAAADETAAAAAAAAMRMAAAAAAAAxEwAAAAAAADET AAAAAAAAMRMAACQAAACKFAAAaAIAAPIWAABGAAAAVRMAADkAAAAAAAAAAAAA AAAAAAAAAAAAbgQAAAAAAADTDwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAfDwAA BAAAACMPAAAAAAAA0w8AAAAAAADTDwAAAAAAAFUTAAAAAAAAAAAAAAAAAABu BAAAAAAAAG4EAAAAAAAAEA4AAAAAAAAAAAAAAAAAABAOAAAPAQAAjhMAABYA AADbEQAAAAAAANsRAAAAAAAA2xEAAAAAAADTDwAAWAAAAG4EAAAAAAAAEA4A AAAAAABuBAAAAAAAABAOAAAAAAAALxMAAAAAAAAAAAAAAAAAANsRAAAAAAAA AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA AAAA0w8AAAAAAAAvEwAAAAAAAAAAAAAAAAAA2xEAAAAAAAAAAAAAAAAAANsR AAAAAAAAbgQAAAAAAABuBAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA2xEAAAAAAAAQDgAA AAAAAOINAAAMAAAAoMvMHXho0QEAAAAAAAAAAGoNAAAAAAAAKxAAAHwAAADb EQAAAAAAAAAAAAAAAAAALxMAAAAAAACkEwAAMAAAANQTAAAAAAAA2xEAAAAA AAA4FwAAAAAAAKcQAADcAAAAOBcAAAAAAADbEQAAAAAAAAAAAAAAAAAAAAAA AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA AAAAAAAAAAAAAAAAAAAAADgXAAAAAAAAAAAAAAAAAABuBAAAAAAAANsRAABU AQAAIw8AABQAAAA3DwAADgAAANsRAAAAAAAARQ8AAAwAAABRDwAAggAAAAAA AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAIw8AAAAAAAAjDwAAAAAA ACMPAAAAAAAAVRMAAAAAAABVEwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA AAAAAAAAAAAAAAAAgxEAAFgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA AAAAAAAAACMPAAAAAAAAIw8AAAAAAAAjDwAAAAAAANQTAAAAAAAA0w8AAAAA AADTDwAAAAAAANMPAAAAAAAA0w8AAAAAAAAAAAAAAAAAAIIEAAAAAAAAggQA AAAAAACCBAAABAcAAIYLAADkAQAAggQAAAAAAACCBAAAAAAAAIIEAAAAAAAA hgsAAAAAAACCBAAAAAAAAIIEAAAAAAAAggQAAAAAAABuBAAAAAAAAG4EAAAA AAAAbgQAAAAAAABuBAAAAAAAAG4EAAAAAAAAbgQAAAAAAAD/////AAAAAAIA DAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEADQA0 ADkAMAAwADAALAAgADMELgAgABQEPQQ1BD8EQAQ+BD8ENQRCBEAEPgQyBEEE OgQsACAAQwQ7BC4AIAARBDsEMAQzBD4ENQQyBDAELAAgADMAMQAgACIENQQ7 BC4AOgAgACgAMAA5ADUAKQAgADgANwAyAC0ANgAyAC0AOQAyAA0ADQANABoE PgQ8BD8EMAQ9BDgETwQgACIAEgQ4BEIETwQ3BEwEIgAgAD8EQAQ1BDQEOwQw BDMEMAQ1BEIEIABDBEEEOwRDBDMEOAQgAD8EPgQ7BDgEMwRABDAERAQ4BDgE IAA4BCAAcABlADoEOwQwBDwESwQNAB8EPgQ7BDgEMwRABDAERAQ4BE8EOgAg ADgENwQzBD4EQgQ+BDIEOwQ1BD0EOAQ1BCAAMgQ4BDcEOARCBD0ESwRFBCAA OgQwBEAEQgQ+BEcENQQ6BCwAIAAxBEMEOgQ7BDUEQgQ+BDIELAAgAD8EQAQ+ BEEEPwQ1BDoEQgQ+BDIELAAgADAERAQ4BEgELAAgADoEMARCBDAEOwQ+BDME PgQyBC4ADQAdBDAEQARDBDYEPQQwBE8EOgAgADgENwQzBD4EQgQ+BDIEOwQ1 BD0EOAQ1BCAAOgQ+BD0EQQRCBEAEQwQ6BEYEOAQ5BCAAKABIBEIENQQ9BDQE NQRABEsELAAgADIESwQyBDUEQQQ6BDgELAAgAEEEOARCBDgEOwQwBDkEQgRL BCwAIAAxBDgEMwQxBD4EQAQ0BEsEKQANABQEOARABDUEOgRCBC0APAQwBEAE OgQ1BEIEOAQ9BDMEOgAgADAENARABDUEQQQ9BDAETwQgAEAEMARBBEEESwQ7 BDoEMAQgAD8ENQRHBDAEQgQ9BEsERQQgADwEMARCBDUEQAQ4BDAEOwQ+BDIE LAAgAEAEMARBBEEESwQ7BDoEMAQgAEEEPARBBA0AHwRABD4EPAQ+BEMEQgQ1 BEAEOgAgAEAEMAQ3BDQEMARHBDAEIAA7BDgEQQRCBD4EMgQ+BDoELAAgADQE NQQzBEMEQQRCBDAERgQ4BDgELAAgAD8EQAQ1BDcENQQ9BEIEMARGBDgEOAQu AA0ADQAfBCAEEAQZBCEEDQANAA0AHwQ1BEcEMARCBEwEIAAyBDgENwQ4BEIE PQRLBEUEIAA6BDAEQARCBD4ERwQ1BDoEDQAeBEQEQQQ1BEIEPQQwBE8EIAA/ BDUERwQwBEIETAQgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAA IAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAg ACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACYEOAREBEAE PgQyBDAETwQgAD8ENQRHBDAEQgRMBA0AGgQ+BDsEOARHBDUEQQRCBDIEPgQ6 ACAAMQAwADAAMAAgAEgEQgQuACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAA IAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAg ACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAGgQ+BDsEOARHBDUE QQRCBDIEPgQ6ACAAOQA2ACAASARCBC4ADQAgBDAENwQ8BDUEQAQ6ACAANQBF BDkAIABBBDwEIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAA IAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAg ACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAA IAAgBDAENwQ8BDUEQAQ6ACAANQBFBDkAIABBBDwEDQAmBDIENQRCBDoAIAA/ BD4EOwQ9BD4ERgQyBDUEQgQgAEEEIAAyAC0ARQQgAEEEQgQ+BEAEPgQ9BCAA KAA0ACsANAApACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAg ACAAIAAgACAAIAAgACAAIAAgACAAIAAmBDIENQRCBDoAIAA/BD4EOwQ9BD4E RgQyBDUEQgQgAEEEIAAxAC0ARQQgAEEEQgQ+BEAEPgQ9BEsEDQARBEMEPAQw BDMEMAQ6ACAAPwQ7BD4EQgQ9BD4EQQRCBEwEIAAyADYAMAAgADMEIAAvACAA PAQyACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAg ACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAEQRDBDwE MAQzBDAEOgAgAD8EOwQ+BEIEPQQ+BEEEQgRMBCAAMgA1ADAAIAAzBCAALwAg ADwEMgAgACgAPAQ1BDsEPgQyBDAEPQQ9BDAETwQpAA0AIQRCBD4EOAQ8BD4E QQRCBEwEIAA/BDUERwQwBEIEOAQ6ACAANAAwADAAIAAzBEAEPQQuACAAIAAg ACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAA IAAgACAAIAAgACAAIAAhBEIEPgQ4BDwEPgRBBEIETAQgAD8ENQRHBDAEQgQ4 BDoAIAAyADAAMAAgADMEQAQ9BC4ADQANAB8EQAQ+BEEEQgQ+BDkEIAA0BDgE NwQwBDkEPQQNAC0AIAA/BAAAAAYAAAIIAAAECAAAaggAAG4IAAByCAAAhAgA AIYIAACICAAAiggAAK4IAADCCAAA7AgAAPAIAAD6CAAA/AgAABQJAACiCQAA tAkAALYJAAA6CgAAXAoAAMYKAADaCgAAMgsAADQLAAA+CwAAQAsAAO/q3tXe 1d7QyLywpJSkvIyFfXVuZoV9bmFZUAAAAAAAAAAAAAAAAAAAAAAAAAAAABEW aAlnUgA1CIFtSAkEc0gJBA8VaChktAAWaChktAA1CIEJFmgoZLQANQiBDxVo ezW/ABZo8DXnADUIgQwVaPA15wAWaIsGTAAADxVo8DXnABZofk48ADUIgQ8V aPA15wAWaIsGTAA1CIEMFWjwNecAFmjwNecAAA8VaPA15wAWaPA15wA1CIEf FWiFXgsAFmjsUiMANQiBQ0ocAGFKHABtSAkEc0gJBBcVaIVeCwAWaFwmRAA1 CIFDShwAYUocABcVaIVeCwAWaIsGTAA1CIFDShwAYUocABcVaIVeCwAWaI4P yQA1CIFDShwAYUocAA8VaE96lgAWaDgUxAA1CIEJFminBPoANQiBERZohSSS ADUIgUNKFABhShQAFxVo6S70ABZoVXsOADUIgUNKFABhShQACRZoVXsOADUI gSADagAAAAAVaMhNRAAWaE96lgA1CIFVCAFtSAkEc0gJBBsABgAABAgAAIYI AACICAAAiggAAPwIAACiCQAAOgoAAMYKAAAyCwAANAsAAEALAABCCwAARAsA AHYLAAAoDAAA3gwAAJgNAABSDgAALg8AANgPAADaDwAA9wAAAAAAAAAAAAAA APcAAAAAAAAAAAAAAADsAAAAAAAAAAAAAAAA7AAAAAAAAAAAAAAAAOEAAAAA AAAAAAAAAADZAAAAAAAAAAAAAAAA0QAAAAAAAAAAAAAAANEAAAAAAAAAAAAA AADRAAAAAAAAAAAAAAAAxgAAAAAAAAAAAAAAAL4AAAAAAAAAAAAAAAC+AAAA AAAAAAAAAAAAuQAAAAAAAAAAAAAAALkAAAAAAAAAAAAAAAC5AAAAAAAAAAAA AAAAuQAAAAAAAAAAAAAAALkAAAAAAAAAAAAAAAC5AAAAAAAAAAAAAAAAuQAA AAAAAAAAAAAAALkAAAAAAAAAAAAAAAC5AAAAAAAAAAAAAAAAAAAAAAAAAAAA AAQAAGdkGx8DAAAHAAADJAFhJAFnZMdZOAAACgAAAyQBEmRoAQEAYSQBZ2Qo ZLQAAAcAABJk4AEBAGdkU1KcAAAHAAASZOABAQBnZDgUxAAACgAAAyQBEmTg AQEAYSQBZ2Q4FMQAAAoAAAMkARJkaAEBAGEkAWdkiwZMAAAHAAADJAFhJAFn ZOku9AAAFQAGAADaHwAAJCAAAP39AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA AAAAAAAAAAAAAAAAAAAAAAAABAQAAQECQAsAAEILAABECwAAdAsAAHYLAACW CwAACAwAACYMAAAoDAAAUAwAALgMAADODAAA3AwAAPoMAAB6DQAA3A0AABYO AAA6DgAAPA4AAE4OAABQDgAAXg4AAGAOAAB4DgAAeg4AAHwOAACKDgAA2g4A AAAPAAAEDwAAEg8AACwPAAAuDwAAUg8AAFYPAABiDwAAng8AAKAPAACiDwAA xg8AAMoPAADMDwAA1g8AANgPAADz7+HTxbnFua6mrqaupq6mrqaupq6mrpum rqaupq6mrpGKkYJ9gpGKdpGCAAAAAAAAAAAAAAAAAAAAAAAMFmgbHwMANQiB PioBAAkWaBsfAwA1CIEPFWiGJLkAFmgbHwMANQiBDBZoyE1EADUIgT4qAQAS FWiGJLkAFmgbHwMANQiBPioBABQVaJVT4gAWaJVT4gBDShYAYUoWAAAOFmgb HwMAQ0oWAGFKFgAAFBVox1k4ABZoGx8DAENKFgBhShYAABcVaIYkuQAWaBsf AwA1CIFDShYAYUoWABoVaIYkuQAWaBsfAwA1CIE+KgFDShYAYUoWAAAaFWiG JLkAFmgbHwMANQiBPioBQ0ocAGFKHAAAGhVojx7mABZoGx8DADUIgT4qAUNK HABhShwAAAYWaBsfAwAAFxVouW/jABZouW/jADUIgW1ICQRzSAkEACvYDwAA 2g8AAOwPAAD4DwAA/g8AAAAcAAAsHAAAQhwAAEYcAABIHAAAUhwAAFQcAABW HAAAcBwAAHIcAAB+HAAAohwAAKYcAAC8HAAAvhwAANQcAADaHAAA6hwAAOwc AADuHAAAFh0AADAdAAA0HQAAQh0AAEQdAABGHQAAaB0AAKweAADmHgAA6h4A AAAfAAACHwAABB8AAAYfAAA8HwAAQB8AAEQfAABGHwAAYB8AAPfy6t/d3/fY 0/fT9+ry6t/L37z30/fT9+r32PfTrqCVjdiN2I2IgHSAdIAAAAAAAAAAAAAA AAAAFxVoGx8DABZo+09MADYIgW1ICQRzSAkEDxVoGx8DABZo+09MADYIgQkW aPtPTAA+KgEPFWjpf5cAFmg3cV4APioBFBVox1k4ABZoN3FeAENKFgBhShYA ABoVaI8e5gAWaDdxXgA1CIE+KgFDShwAYUocAAAaFWgbHwMAFmgbHwMANQiB PioBQ0ocAGFKHAAAHBVoqVG+ABZoGx8DAENKFgBhShYAbUgJBHNICQQADhZo Gx8DAENKFgBhShYAAAkWaBsfAwA+KgEJFmjITUQAPioBA1UIARQVaMdZOAAW aBsfAwBDShYAYUoWAAAPFWjpf5cAFmgbHwMANQiBCRZoGx8DADUIgQ8VaOl/ lwAWaBsfAwA+KgEAK9oPAAD4DwAALBwAAFQcAABWHAAAfhwAAL4cAADsHAAA 7hwAABYdAABEHQAARh0AAGgdAABIHgAArB4AAAQfAAAGHwAAYh8AAGQfAABm HwAA2h8AAN4fAADgHwAA5B8AAOYfAADqHwAA7B8AAPAfAAD6AAAAAAAAAAAA AAAA+gAAAAAAAAAAAAAAAPoAAAAAAAAAAAAAAAD6AAAAAAAAAAAAAAAA+gAA AAAAAAAAAAAAAPoAAAAAAAAAAAAAAAD6AAAAAAAAAAAAAAAA+gAAAAAAAAAA AAAAAPoAAAAAAAAAAAAAAAD6AAAAAAAAAAAAAAAA9QAAAAAAAAAAAAAAAPUA AAAAAAAAAAAAAADwAAAAAAAAAAAAAAAA8AAAAAAAAAAAAAAAAPAAAAAAAAAA AAAAAADwAAAAAAAAAAAAAAAA8AAAAAAAAAAAAAAAAPAAAAAAAAAAAAAAAADw AAAAAAAAAAAAAAAA8AAAAAAAAAAAAAAAAO4AAAAAAAAAAAAAAADuAAAAAAAA AAAAAAAA7gAAAAAAAAAAAAAAAO4AAAAAAAAAAAAAAADuAAAAAAAAAAAAAAAA 7gAAAAAAAAAAAAAAAO4AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAAE AABnZDdxXgAABAAAZ2THWTgAAAQAAGdkGx8DAAAbQAQ+BEEEQgQ+BDkEIAA0 BDgENwQwBDkEPQQgACgAQgQ1BDoEQQRCBCkADQAhBEIEPgQ4BDwEPgRBBEIE TAQ6ACAAMQAwADAAIAAzBEAEPQQuAA0ADQAaBDAERwQ1BEEEQgQyBDUEPQQ9 BEsEOQQgADQEOAQ3BDAEOQQ9BA0ALQAgADoEPgRABEAENQQ6BEIEOARABD4E MgQ6BDAEIAAyBCAAMwAtAEUEIAAyBDAEQAQ4BDAEPQRCBDAERQQNACEEQgQ+ BDgEPAQ+BEEEQgRMBDoAIAA+BEIEIAAyADUAMAAgADMEQAQ9BC4ADQANACAE MAQ3BEAEMAQxBD4EQgQ6BDAEIAA7BD4EMwQ+BEIEOAQ/BDAEDQAhBEIEPgQ4 BDwEPgRBBEIETAQgAD4EQgQgADEAMAAwADAAIAAzBEAEPQQuAA0ADQAgBDAE NwQ0BDAERwQwBCAAOwQ4BEEEQgQ+BDIEPgQ6BA0AHAQ1BEEEQgQ+BDoAIAAy BCAAPwQ+BDwENQRJBDUEPQQ4BDgELAAgAEAETwQ0BD4EPAQgAEEEIABCBD4E QAQzBD4EMgQ+BDkEIABCBD4ERwQ6BD4EOQQsACAAPwRABDgEIAAyBEUEPgQ0 BDUEIAAyBCAAQgQ+BEAEMwQ+BDIESwQ5BCAARgQ1BD0EQgRABCwAIAA/BEAE PgRFBD4ENgQ4BDwEIAA9BDAEIAA/BDUEQAQ1BDoEQAQ1BEEEQgQ6BDAERQQs ACAAMgQgADAEMgRCBD4EPAQ+BDEEOAQ7BDgEDQAhBCAAQwRHBDUEQgQ+BDwE IAA6BD4EPQRCBEAEPgQ7BE8ELAAgADoEPgRABEAENQQ6BEIEOARABD4EMgQ6 BDgEIAA6BDAERwQ1BEEEQgQyBDAEIABABDAEMQQ+BEIESwQgAA0AIQRCBD4E OAQ8BD4EQQRCBEwEIABABDAEMQQ+BEIESwQgAD8EQAQ+BDwEPgRDBEIENQRA BDAEOgAgADkAMAAgADMEQAQ9BC4AIAAvACAARwQwBEEEIAANAA0AIgQwBDoE NgQ1BCAAMgQ+BDcEPAQ+BDYEPQRLBCAANARABEMEMwQ4BDUEIABCBDgEPwRL BCAAcABlADoEOwRhADwESwQgAD8EPgQgADcEMAQ/BEAEPgRBBEMEDQANAA0A IAQwBDEEPgRCBDAENQQ8BCAAPwQ+BCAAMgRBBDUEPAQgADMEPgRABD4ENAQw BDwEIAAjBDoEQAQwBDgEPQRLBC4AIAARBEMENAQ1BDwEIABABDAENARLBCAA QQQ+BEIEQARDBDQEPQQ4BEcEMARCBEwEDQADAA0ADQAEAA0ADQADAA0ADQAE AA0ADQATAFAAQQBHAEUAIAAgABUADQANAA0AEwBQAEEARwBFACAAIAAUADEA FQANAA0ADQANAA0AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAYB8AAGIfAABm HwAAtB8AAL4fAADSHwAA2B8AANofAADcHwAA4B8AAOIfAADmHwAA6B8AAOwf AADuHwAA8h8AAPQfAAAAIAAAAiAAAAQgAAAIIAAACiAAABYgAAAYIAAAGiAA ABwgAAAeIAAAIiAAACQgAAAmIAAA+vXr5Ovk69zY3Njc2NzYzsjOyMTOyM65 zsjE2OsAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA ABUWaDgUxAAwShAAbUgABG5IAAR1CAEGFmg4FMQAAAoWaDgUxAAwShAAABMD agAAAAAWaDgUxAAwShAAVQgBBhZokQ2lAAAPA2oAAAAAFmiRDaUAVQgBDBZo yCqUADUIgTYIgQASFWjIKpQAFmiFXgsANQiBNgiBAAkWaMgqlAA2CIEJFmj7 T0wANgiBAB3wHwAA8h8AAAQgAAAGIAAACCAAAB4gAAAgIAAAIiAAACQgAAAm IAAA/QAAAAAAAAAAAAAAAPEAAAAAAAAAAAAAAADvAAAAAAAAAAAAAAAA/QAA AAAAAAAAAAAAAPEAAAAAAAAAAAAAAADvAAAAAAAAAAAAAAAA/QAAAAAAAAAA AAAAAP0AAAAAAAAAAAAAAADqAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAAAZ2Q3cV4AAAEPAAALDwAY hPz/GYQBABsmYCMkAmdkDVPaAAABAAAACTIAMZBoATpw1yejAB+wgi4gsMZB IbA4BCKwUgMjkM8CJJCDAyWwAAAXsMQCGLDEAgyQxAIAAAAAAAAAAAAAAAAA AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUkkA AEQAZAAAAAAAAAAIAAAAAAAAAAAAAAAAAFgR2wZiBGEEAAAAAAAAAAAAAAAA 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 E1FhByJxFDKBkaEII0KxwRVS0fAkM2JyggkKFhcYGRolJicoKSo0NTY3ODk6 Q0RFRkdISUpTVFVWV1hZWmNkZWZnaGlqc3R1dnd4eXqDhIWGh4iJipKTlJWW l5iZmqKjpKWmp6ipqrKztLW2t7i5usLDxMXGx8jJytLT1NXW19jZ2uHi4+Tl 5ufo6erx8vP09fb3+Pn6/8QAHwEAAwEBAQEBAQEBAQAAAAAAAAECAwQFBgcI CQoL/8QAtREAAgECBAQDBAcFBAQAAQJ3AAECAxEEBSExBhJBUQdhcRMiMoEI FEKRobHBCSMzUvAVYnLRChYkNOEl8RcYGRomJygpKjU2Nzg5OkNERUZHSElK U1RVVldYWVpjZGVmZ2hpanN0dXZ3eHl6goOEhYaHiImKkpOUlZaXmJmaoqOk paanqKmqsrO0tba3uLm6wsPExcbHyMnK0tPU1dbX2Nna4uPk5ebn6Onq8vP0 9fb3+Pn6/9oADAMBAAIRAxEAPwD2z4yfFXVPBHii10aw0eyvI5rBbkvNM6MH Luu35Qf7n8643/hoTxH/ANC3pH/gTL/8TVL9qj/kpdj/ANgeL/0olrykVx1K koy5Tpp04yiex/8ADQniT/oW9J/8CZf/AImj/hoTxJ/0Lek/+BMv/wATXjRZ VGTtQHuxxSCWM9GTAGSNwzisvbVP5i/Y0z2b/hoTxH/0Lekf+BMv/wATR/w0 J4j/AOhb0j/wJl/+JrxdJ4ZHVElUs33QrgkU8SRszKrqWXqA3Io9tU/mH7FH sv8Aw0J4k/6FvSP/AAJl/wDiaP8AhoTxJ/0Lek/+BMv/AMTXjDTQqCWkAQHB YuMCmpPbyNsSZJG9FcE0e2n/ADB7Gme0/wDDQniT/oW9J/8AAmX/AOJo/wCG hPEn/Qt6T/4Ey/8AxNeKm4gGczoA33RxkVIJYyCVlQkDOAwzij20/wCYPYwP Zv8AhoTxJ/0Lek/+BMv/AMTR/wANCeJP+hb0n/wJl/8Aia8YE0RxiQHccD5h zTjJGCwMigqMt83Sj21T+YPY0z2X/hoTxH/0Lekf+BMv/wATR/w0J4j/AOhb 0j/wJl/+JrxhJ4pCQkoJHUK4OKfR7Wp/MHsonsn/AA0J4j/6FvSP/AmX/wCJ o/4aE8R/9C3pH/gTL/8AE145SUe2qfzB7KJ7J/w0J4k/6FvSf/AmX/4mj/ho TxJ/0Lek/wDgTL/8TXjfFHFHtqn8wvZUz2T/AIaE8R/9C3pH/gTL/wDE0f8A DQniP/oW9I/8CZf/AImvG6KPbVP5h+xieyf8NCeI/wDoW9I/8CZf/iaP+GhP Ef8A0Lekf+BMv/xNeN0U/a1P5g9jE9k/4aE8R/8AQt6R/wCBMv8A8TR/w0J4 j/6FvSP/AAJl/wDia8bope2n/MHsonsn/DQniP8A6FvSP/AmX/4mj/hoTxH/ ANC3pH/gTL/8TXjdFHtan8wexieyf8NCeI/+hb0j/wACZf8A4mj/AIaE8R/9 C3pH/gTL/wDE143RR7ap/MHsYnsn/DQniP8A6FvSP/AmX/4mj/hoTxH/ANC3 pH/gTL/8TXjdFHtqn8wexieyf8NCeI/+hb0j/wACZf8A4mj/AIaE8R/9C3pH /gTL/wDE143RR7ap/MHsYnsn/DQniP8A6FvSP/AmX/4mj/hoTxH/ANC3pH/g TL/8TXjdFHtqn8wexieyf8NCeI/+hb0j/wACZf8A4mj/AIaE8R/9C3pH/gTL /wDE143RR7af8weyifRnwn+Lur+L/G0Ph++0TT7SGS2lnEsM7u3yHH8QFFec /s2/8ldtP+vGf+QorqpTm43ZzVIWlY0f2p/+SmWP/YHi/wDSiWvJ+1esftT/ APJTLH/sDxf+lEteVVzVv4kjopfCeg/s7Ef8LUiVido0258wBd21MLXSfZLM +P8AwF4baKE/DZgkujlWZodRl8rer3Dfxzedj5HHPXrmvPvhj4e17xL4ml0/ w5qw0m+hsXmM5mnhO0PGjpvj/wB+u2b4F+P20uPSB4l0mTTlIkjtnvbnyEf+ 8sezZ+lVT5uX4SanLzfEW9TvPGuq+E/Hi/EzSY7TSdOsHm02SWxSMW92D+6W 3fnzEyF+Y89BnmrOo+E9F13RvDvgCeYadqnhnTbTUNQlc7M28zZvEHHDrhHy f76+9c34w+FnxTjs1+33U/iS1hTfGkGqSSvF2+WGQcf8Arzy4v8AUZ7+5u7q /v3u5EeC6kuJnMzp/q5EfzP3n/bOnKfL8URRhzfCe56DdWmt/F/wD4y0e0Ft pmr6Xe2kUW3BX7L5qqT6fKwH4VzEvirVPGvwRa+8a36yxJ4utLOeWOFYtluY 4fM4T/rpJXm+nahrEMllDZaxqNqIZfLtVhvXRInl+R9nl/c316h/wovxxDZS aePEmljT95mktxdXPkllTAfy9uwPTjOUvhiHJy/Ed1pV14+j+N66F/Y6ReCr UsbbbpyrbxRiD5DHKF4fzONuehrzWAeG5fgHoreLbjX4bb+3r0wtpccLuz4m 5bzBjZjd+lef2eva4tlaxW2v6xDBCoa3ihv50SH/AHP3nyUunQ6rrE+n+G7S 4upvtNyRaWsk7+Ssrj7+z+D/AH6mVbQfsj3LVrAav8QfjHYS6nDpdu+macst 5KvyQKIN0jn/AIB/KsJ20CTWvg2/h7wzcXGkSXOprHaSIjST7JIU+0y56uNn n5/2KoeKPhL4503Rdc13VfE1ldRJbG6vla9uHe4WGPKK+9D5mwp8hfNc/wDD Lw14r8ZXsttoHiabTn0eANGZLydPJSaQl0i2fc3+V89XeXN8JHLHlvzHZfHm 6mn8C6R5/iE69JF4ivYTdLbC3xsEo8n5emzHl7x6ZrxmvXj8CfHZsIrJvEej vaQs8kNu13cNCjv99tm2ov8Ahn/xl/0G/D//AH8m/wDiKznTqS+yXGpGMfiP JqdXU/EbwFrHgRtMXV73T7o3/neT9m3/AC7PL+/vQ/8APSsLQtG1fX9SXTdD 0+e+vGH3I1AKJ/fd/wDlnWfLLm5TTmuUKWvUbP4EeOpogZLjw/Zuf+WT3kjO n4pHirI/Z/8AGX/QZ8P/APfyb/4iq9nU/lJ9pE8kpa3/AB/4U1HwZ4gTRNUv LS5nezS7Mlrv2BHkk/v/APXOo/B3hTX/ABhqBstCshLsH7+4l+W3tz6Mw5J9 hU8sublK5o/EYlJXu1n+zvIYt134yKy/xrb6dhD/AN9ua5jxv8FvEvh+0a+0 q7HiG0hXMixwBLhV/v7B9/8A4Bg1fsan8pMakZHmNFNjZXRXVgysMgjuK6v4 d+B9W8c3F9BpF3p9q9jHHLK13v8Am8zumxB/zzrP3pe7E0lI5aiux+Inw61r wLZWN1rF/pl0LyVolS23fLsj/wBtD6Vx1Eo8vuyDm5vhCiiikAUUUUAFFFFA BRRRQAUGig0Aejfs2/8AJXbT/rxn/kKKP2bf+Su2n/XjP/IUV2Yf+GjlqfEa P7U//JS7H/sDxf8ApRLXlNeq/tT/APJTLD/sDxf+lEteVVhW/iSNqXwnqn7L H/JUrr/sBz/+j7evcfiT4ytvA/h9NYu7G5v1e6W38qBkV8vu5/8AHa8O/ZY/ 5Kldf9gOf/0fb1638dPCuseLvBkGm6FHbPdxX8U+LiXYmxUfv/wKuijf2Ohj U/ie8Wvhp8R9C8cR3UenRXlne2io01pdIocIejpsJ3p715f+1R4dtLPUdL8U WkSxS6gz2t4VTmVkQvG3++EEtdV8DPhlqPg7UL3WNburSS/uLdbWOK1d2SGP fufex6udqc+3vXE/tLeMLHXdSsPDemXSXEWlyvNevC+9Bc8x7Pqg35/3xSqS 5qP7wdP+J7p5Pa/8hC1/6+o//QzX3PN/q5v91v5Cvhi0/wCP+1/6+o//AEM1 9zzf6ub/AHW/kKWF+0LEfZPgvT/+PCD/AK5L/wCgivoD9mDwdiKXxrewZM5a DTAyDCxfxzfV+F/BvWvHvhZ4XuPGPiDStCgZ44GjWS7nQ4MVui4f/wCN/wDb Svr+/vtI8Oafptq5gtbWS4t9OsIl6B3OxEX0+Spw9PXmkXWl9kpfFc/8Wv8A FR/6g13/AOiTXzl8F/HeneBNQ1e51GyvrsXtvBEi2oQ7Njyj+Mj1r6M+K/8A yS/xV/2B7v8A9FGvjcdBTry5ZRkTSjzRPrj4bfETS/H0upxaZp2o2R00QmX7 WEG/zd+Nmxz/AHOtO+JXxD0zwCNO/tTT9RvRfmVY/soQ7Nmz7+9x/f8A/rV5 p+yL/wAhHxd/1zsP/QrmrH7W3/Mq/wC9dfzhrTnfsuYnkXtOU4n43/EDSvHU uiz6dYalZf2ct0JvtQjG4N5B+Ty5f9ivdvgt4at/C/w+02NYCl9fwpd3zkYd pHXeVP8AuZCD2FfIlyhktpYx1dCPzFfbXgzUIdX8J6Rq1sIzFc2McihR0BQb l/76qKD5nzSLrR5Y8px/jP4yeFPDGtT6LNBqOpX1sNsos0jKxv8A3CzuPnro Phz4ws/Gvh9tYsbS7s4hO9uY7oIHDLt/uE/3q8P+Jfwm8aP411jVNF0v+1rH ULt7pWiukjZC/wA5RkkcZ5r1L9nvQ9X8O+AJdP1qwlsLttRll8mQxlgjlOf3 fFXTnPn5ZGUox5Tyj9qL/kqcH/YFtv8A0bc1mfB74h3PgrVGs753n0C7f/SY 1+9bP/z2X29a0/2of+Spwf8AYGtv/RtzXltc1SXLU5onTGPNTPaNa/aD1c6k W0Tw1ZLpiH5VvZH82df+ADZH+cle1eBPEVp4s8KWPiOzieCO6EgMcjcxOjmN 0/77Qivmfwf8KPF/izSLXWNNbSoLG6D7Zri5+dCknluNiR4/5Z19D6FZ6D8N vh5aWOoapDFp9gjGe7uMR+ZLI5dyV9XeQnZ74rooup9owqKP2T5s+M2l22i/ FTxBZ2kSw27yLcrGv8PmpGzn8ZHkNd7+yR/yH/E3/Xra/wDocteX+PNf/wCE o8a6p4gWNoYr2XdCrDDrGkexTj3RCa9Q/ZJ/5GDxR/162v8A6HLXPT/je6ay /hmt+1r/AMgHw3/2EJf/AEWa+f6+p/jp4H1fxvpWlW+j3FlBNaXLSubmR41f chT+FH9a8d1L4JfEOzg82G00zUf+mdne/OP+AzxoP1rSvTlzc3KTSqRUTzkU VLcw3VreT2l3BcW93A+yaCddjo9RVzHQFFFFABRRRQAUUUUAFB6UUHpQB6L+ zf8A8lctP+vO6/ktFH7N/wDyVy0/687r+S0V2Yb+GjmqfEaP7U//ACU2y/7A sf8A6US15VXqn7U//JTbH/sCRf8ApRLXldYVf4kjWjseqfssf8lRuv8AsBz/ APo+3r3L4j+MrHwRoMesX9pd3UT3SW4S1CF97bv75H931rw39lj/AJKldf8A YDn/APR9vXon7Uas/wANrXy43lP9q27bUXd/A9bUZctHmRjU96oX/Bnxj8I+ JtWh0mNL7TL+ZtltHfxxqJ3/ALiNG7j9ayPjv8NtM1bQ77xLpVultrdnE88g iTYt7GvLh17t/t9a8M8KeEvE/iDVrS20vStRjBuYj9sa3dYYF3H53fvX2Tq1 7b6fpt5fXZC20EEk82f7iLk/pmqpSdaPvCly05e6fDtkQ19aMDkG5iIP/AzX 3NdOsdvcOxwqo5J9BgV8J6KrI2nI/wB5ZYQfrur7yP3jUYX7RWI+yeV/s2+D P+EX8BQXt/B5WraqkU1xv5aKMKBFFn25b6ua4LxN4xHiz4++GobGZ5NG0rVk gt9mMSS7vnlB/NP9xD/z0rvv2gPGn/CL+Fv7I024ZdZ1hXSNkIL28H8cv1/h XpyR/cNeA/C9FT4l+FkRQqrqcQAHb56U5cko04hCPNzSZ9VfFf8A5Jh4q/7A 91/6KNfGy9K+yfiv/wAkw8Vf9ge6/wDRRr42XpRitysP8J7f+yL/AMhHxd/1 z0//ANCuan/a3/5lX/eu/wCcNQfsif8AIR8Xf9c9P/8AQrmp/wBrf/mVf967 /nDVf8uCf+Xx4P2rvPhj8TtY8ERnTDZDWNIkclLQPsmid+R5T995/wCWdcLX p/7OPhH+3vF76/eRbtO0RkKZT5Zbr+D/AL4+/wDjHXPT5ub3Tepy8vvH07EX dFMkTRsy5KFwcH+7WX4Z8QaN4k0s6hoeoR6haec0LSojBQ6/fHzVxf7Q/ir/ AIRvwK1nbTbdR1dmt4Np+ZYxzM/Pony+xcVR/ZYUJ8MJUUYC6nOAP+AJXdz+ /wApycvu8x51+1F/yVOD/sDW3/o25ry2vUv2ov8AkqUBP/QGtv8A0bc1zfw/ +HHifxrBLe6ZDb2thGGVbq5+VLh1ONi4+/8A9dK4akZSqS5Tppy5Ync/DH4x eH/CfgbTvD99outXM9qXVpbZYGjcu7v1eRP7/pXsHhvxD4V+Inhy5exNvqdg T5N1a3MOWif+46Gvjq/insL2Ww1OGWyvoSBNb3ACSJmvcP2TNPvfP17Wtrrp s8MNvHIVBSeWOSX7v+5/7UralUk5ezkZ1KUVHmOF+NPgiHwT4pih09j/AGTq MTzWat85hZMh4sei70x/vn0rs/2Sf+Rg8T/9etr/AOhy1pftbvbf2b4ajfb9 pkuJyuf+eYRd/wD7JWb+yTxr/if/AK9bX/0OWhR5a+gc3NTPSvi78QJPAFhp 1ymjrqZvZmi2/ajBs2IX/uP6Vn/D74w+H/F2qx6NLaXejalKuYI7hkZZf9lH B5f2rnP2tFd9B8ObInlIv5cqihs/uz615l8KPCPiDVvHWh3MWlaha2FlfxXk 97NayRRKkL79gZ+u/NXOpKNTlQo04+z5j2H9pHwhb6x4Tn8UQQgaposXmmRV H723Gd6P7L/rP+A+9fNP0r7E+L91BafCzxVJNIsZfSbiJTj7zPGUX82dR+Nf Hg4FRio6joS90SinU2uY6AooooAKKKdQA2g9KKKAPRf2b/8Akrlp/wBed1/J aKX9m3/krtp/14z/AMhRXZhv4aOap8Ro/tUf8lKsP+wJH/6Nmryo16p+1P8A 8lNsv+wLH/6US15XWFX+JI1o/Cemfs1XlrZfEi6uL69trSM6LOpklkWJd/n2 /QNX0d/wkfh7/oPaX/4GR/8AxVfH/gXw1F4v8Qf2D/aCWV5NbSSWe+3EiTyq ocxHP+rDAyE+wpun+DpLvwXaa66iG71LVE0vS9Na3XdczH7zF+qIvzR/8BOe 1VRqyjG0YmdSnGUj65vfGXhGzjL3nizQ4FXvJqES/wA3rw341fFi28Raa/hj wwZXsJWH2y9ZNonT+4iHkofWuS1bwJ4b0f7ZYT/ETRo9eso2M9mdPl8oMn/L NZs43fRCfaqPhfwVqHiHwbr/AIltXWKPSFAjhZBuuJFj3zIMnjavzD1NVUqV H7qCMIx94560wb+zy20LPEGZh/t19o33irw3aQT3Nxr+lokMbyyH7XHkInU4 3V8jy+GpZPAmmeJtNuP7Qa61P+zJbMQjdb3I/wBSB/z038f99CuhT4YaTHrn iawvPF9vbQ+GrO2uNQvf7KaVVlm80uvySD7gA9+falTnKH2SqqjI5rxt4kvP F3im91+7V4/OIW2g3DNvbpyqHHfOam+GzJD8SfDckssUUceoxMXkfYqrv6Cr Vx4OaTw+ur6Fqkmt+d4i/sazhjs3T7QfL8zzf3knydDVPx/4Wm8I+If7Bvbu G8nFrFNMyRfIrshGz9KxtJS5pGl4v3T6a+J2uaHc/DfxPBBrWlyTSaPdKI0u 4izN5R9Wr5IH3fwpghhU5WKMH1Cin1dSp7QmnT5T2f8AZYv7HT7rxZJf39ra I62QjNxMse7m6wPmqX9qa/sL5PC7WF/a3So13uNvMsm3/Uf3a8PeON/vorY6 ZGackcaE7EVfoMUe0/d+zD2fvcw9UkkdY4ELTOUWMDqcV9bfDiHwv4O8IWGg 2+v6Q0ka77mVLuMedO333+93Of8AvmvkggEYOCD1FR+RBnPkx5/3RRTqezCp T5jsPjD4pPi3x5fX0Em6wtCbOwJ+7tX+PP8Atvhx7AV6/wDs2appth8N5kvt SsbNzqlwwSa4WNtu1P71fOQAApHiidstGjH1Kg0RqcsuYJU+aPKemftLXNpf fEqCayura7hbRIU8yKRZF3+Zc/3ea7b4L/F3T5NMtvDXiu5is7mBUgtL1zsi nXGEV/7kmB0r5/REQYRQo9hilIBGDgj3ojUlGXNEJU+aPKfb19pel6wsU97p 9hqSx8xNPbxzY/3CelU/EviHQfCuni41vUbbTrdVPlRyOAzf7CRLy/0Ga+Lb ZpLZPLtpZrcf3YndKYI49/nFQzv/AB5DPWn1r+6Z/Vzqvij4xufHPig6k0Uk FlEnkWFtJ1SI873/ANt67r9lu/sLHWvEsl7fWlqklralXuJljLfPL2bmvH6a 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 E+54InjijeJBsTuMh+yetS3Pj6KXU7+8TQWiW48J/wDCOBPtY+Qc/vf9Xx6b PauHxTcVXtZB7KJ6N8PNT0LTfhL4rj1rS7XWIJtTtUfT2vPs0kqZT5l/j+Tr /wABNZ954/e21Tw0/hfRINE0zw3K8tlZy3DyvI82TKJX7bkMpGc8muKKAtkg Z9cUuKPayD2UTvZPHPha00/xDbaF8PY9MudesLizuJ21Z3MXmx8KqFD8uPn2 jH0qfw9410O8uvCkfiXwnDqWraRLbWdnqg1J4YkgR/kllT+PZ/rDkH8K87xQ VyMEZH0o9rIPZRPWfGXjzQdG+IOv6pofhOEeJxI8EGsrqhlg+ZAomEOdm/YB ke3J6iuStvHN/a+DvC3hO2tzDpWiXMVxcqJhuvvKuRLGjf3E4+5/hXJgbRgD A9qKJVZB7KJ3afE3VLNvF8uj2jabd+I7tJjOLrc1mPLfeqgR/fGD8/Tn2rn/ ABVr41yx8N2qWDWf9i6NHphLTb/PEYA3f6v5OlYtJUOcg5InVy+OdST4daT4 KtITbWVpPJcXricbr1fPM/lD/nmmDisr4h66vinxZrPiNLN7Rb7a3kNKJduy OOP7w4H+rrJpetEphyRPXvHPirwnY+IfDVzqHhW18Q6hpui2U1nfQ6ztVXyf 3ciJ+7faw35568VyWmePZJP7btvFGmSavp+tXn2+WK01CS1lguMY3xOnJ+TC bM5/dfWuNVdv3Vx9KOfer9rIn2UTsNK8Y6dpPxC0rxNpPh+a2tNORo0spdVm ujI7xvHueV9+xvn6IhPyHmpF8d2moXXhzVvE3h19U1jRJQft0d+kX2yNPniE qBH37H8v5+Oee5ri6Kn2sivZxOkk8XX1xoviCy1G2M1zq2rRaxbXUc+w2N2j /O6L5fz4Ty0rqLP4naDH4tt/GVz8PI5/EgUJcXUWqSLGW2bCyxFCFbHHTPvX mf4UfhR7WQeyidhp3j2501fDC6dpqwromo319cq0+9b37Q53q52fIdssiA/P jikvPHtxf/8ACRHUrF5xq2r2WqW2y4CLZfZ5B8qHy/nPkxRp71yFFHtZB7OJ 3vi34iw61peu2lp4aksZtdvLe5vZ7jVpJ1/ctGyLEpRUTiP1HfOe3OePteXx T4z1XxGtk9kt/JCTC0gk27II0+8OB/q6xqKJTlII04xCm8Yp1FSUFN4p1FAD adRRQA3ig9KdRQB6H+zf/wAlctP+vO6/ktFL+zb/AMldtP8Arxn/AJCiuzDf w0c1T4j6J8S+DPCniK8jvte0G01G5jh8pJJgSVTJbb16ZY1nf8Km+HX/AEKO l/8Afs/40UVsY3E/4VP8Ov8AoUdL/wC/Z/xo/wCFT/Dr/oUdL/79n/GiipDm Yf8ACp/h3/0KOl/9+z/jR/wqf4d/9Cjpf/fs/wCNFFAczD/hU/w7/wChR0v/ AL9n/Gj/AIVP8O/+hR0v/v2f8aKKA5mH/Cp/h3/0KOl/9+z/AI0f8Kn+Hf8A 0KOl/wDfs/40UUBzMP8AhU/w7/6FHS/+/Z/xo/4VP8O/+hR0v/v2f8aKKA5m H/Cp/h1/0KOl/wDfs/40f8Kn+Hf/AEKOl/8Afs/40UUBzMP+FT/Dv/oUdL/7 9n/Gj/hU/wAO/wDoUdL/AO/Z/wAaKKA5mH/Cp/h3/wBCjpf/AH7P+NH/AAqf 4df9Cjpf/fs/40UUBzMP+FT/AA7/AOhR0v8A79n/ABo/4VP8O/8AoUdL/wC/ Z/xoooDmYf8ACp/h3/0KOl/9+z/jR/wqf4d/9Cjpf/fs/wCNFFAczD/hU/w7 /wChR0v/AL9n/Gj/AIVP8O/+hR0v/v2f8aKKA5mH/Cp/h3/0KOl/9+z/AI0f 8Kn+Hf8A0KOl/wDfs/40UUBzMP8AhU/w6/6FHS/+/Z/xo/4VP8Ov+hR0v/v2 f8aKKA5mH/Cp/h3/ANCjpf8A37P+NH/Cp/h3/wBCjpf/AH7P+NFFAczD/hU/ w7/6FHS/+/Z/xo/4VP8ADv8A6FHS/wDv2f8AGiigOZh/wqf4d/8AQo6X/wB+ z/jR/wAKn+Hf/Qo6X/37P+NFFAczD/hU/wAO/wDoUdL/AO/Z/wAaP+FT/Dr/ AKFHS/8Av2f8aKKA5maHh/wH4O0HVV1PRvDtjY3qK8azxIQwVuo696KKK1Ef /9kAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACGAhIA EgABAJwADwAEAAAAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA AAAAAAAAAAAAAAAAAABCAABA8f8CAEIADAQAAAAAAAAAAAcAHgQxBEsERwQ9 BEsEOQQAAAIAAAAYAENKGABfSAEEYUoYAG1IGQRzSBkEdEgZBAAAAAAAAAAA AAAAAAAAAAAAAEIAQUDy/6EAQgAMBQAAAAAAAAAAFQAeBEEEPQQ+BDIEPQQ+ BDkEIABIBEAEOAREBEIEIAAwBDEENwQwBEYEMAQAAAAAWABpAPP/swBYAAwF AAAAAAAAAAAPAB4EMQRLBEcEPQQwBE8EIABCBDAEMQQ7BDgERgQwBAAAHAAX 9gMAADTWBgABCgNsADTWBgABBQMAAGH2AwAAAgALAAAALgBrAPT/wQAuAAAF AAAAAAAAAAAKAB0ENQRCBCAAQQQ/BDgEQQQ6BDAEAAACAAAAAAAAAEoAIEAB APIASgAMBAAAzimLAAAAEQAdBDgENgQ9BDgEOQQgADoEPgQ7BD4EPQRCBDgE QgRDBDsEAAANAA8ADcYIAAJFEoskAQIAAAA0AClAogABATQADAQAAM4piwAA AA4AHQQ+BDwENQRABCAAQQRCBEAEMAQ9BDgERgRLBAAAAAA6AFVAogARAToA DAQAADdxXgAAAAsAEwQ4BD8ENQRABEEEQQRLBDsEOgQwBAAADAA+KgFCKgdw aAAA/wAAAAAAEgYAAAYAACYAAAUA/////wAAAAACAAAAQwAAAEQAAABFAAAA fgAAANEAAAAdAQAAYwEAAJkBAACaAQAAoAEAAKEBAACiAQAAuwEAABQCAABv AgAAzAIAACkDAACXAwAA7AMAAO0DAAD8AwAAFQQAACkEAAAqBAAAPgQAAF4E AAB1BAAAdgQAAIoEAAChBAAAogQAALMEAAAjBQAAVQUAAIEFAACCBQAAsAUA ALEFAACyBQAA7AUAAO4FAADvBQAA8QUAAPIFAAD0BQAA9QUAAPcFAAD4BQAA AQYAAAIGAAADBgAADgYAAA8GAAAQBgAAEwYAAJgAAAAAMAAAAAAAAACAAAAA gAAAAAAAAAAAAACYAAAAADAAAAAAAAAAgAAAAIAAAAAAAAAAAAAAmAAAAAAw AAAAAAAAAIAAAACAAAAAAAAAAAAAAJgAAAAAMAAAAAAAAACAAAAAgAAAAAAA AAAAAACYAAAAADAAAAAAAAAAgAAAAIAAAAAAAAAAAAAAmAAAAAAwAAAAAAAA AIAAAACAAAAAAAAAAAAAAJgAAAAAMAAAAAAAAACAAAAAgAAAAAAAAAAAAACY AAAAADAAAAAAAAAAgAAAAIAAAAAAAAAAAAAAmAAAAAAwAAAAAAAAAIAAAACA AAAAAAAAAAAAAJgAAAAAMAAAAAAAAACAAAAAgAAAAAAAAAAAAACYAAAAADAA AAAAAAAAgAAAAIAAAAAAAAAAAAAAmAAAAAAwAAAAAAAAAIAAAACAAAAAAAAA AAAAAJgAAAAAMAAAAAAAAACAAAAAgAAAAAAAAAAAAACYAAAAADAAAAAAAAAA gAAAAIAAAAAAAAAAAAAAmEAAAAAwAAAAAAAAAIAAAACAAAAAAAAAAAAAAJhA AAAAMAAAAAAAAACAAAAAgAAAAAAAAAAAAACYQAAAADAAAAAAAAAAgAAAAIAA AAAAAAAAAAAAmEAAAAAwAAAAAAAAAIAAAACAAAAAAAAAAAAAAJgAAAAAMAAA AAAAAACAAAAAgAAAAAAAAAAAAACYAAAAADAAAAAAAAAAgAAAAIAAAAAAAAAA AAAAmAAAAAAwAAAAAAAAAIAAAACAAAAAAAAAAAAAAJhAAAAAMAAAAAAAAACA AAAAgAAAAAAAAAAAAACYQAAAADAAAAAAAAAAgAAAAIAAAAAAAAAAAAAAmAAA AAAwAAAAAAAAAIAAAACAAAAAAAAAAAAAAJhAAAAAMAAAAAAAAACAAAAAgAAA AAAAAAAAAACYQAAAADAAAAAAAAAAgAAAAIAAAAAAAAAAAAAAmAAAAAAwAAAA AAAAAIAAAACAAAAAAAAAAAAAAJhAAAAAMAAAAAAAAACAAAAAgAAAAAAAAAAA AACYQAAAADAAAAAAAAAAgAAAAIAAAAAAAAAAAAAAmEAAAAAwAAAAAAAAAIAA AACAAAAAAAAAAAAAAJgAAAAAMAAAAAAAAACAAAAAgAAAAAAAAAAAAACYAAAA ADAAAAAAAAAAgAAAAIAAAAAAAAAAAAAAmAAAAAAwAAAAAAAAAIAAAACAAAAA AAAAAAAAAJgAAAAAMAAAAAAAAACAAAAAgAAAAAAAAAAAAACYAAAAADAAAAAA AAAAgAAAAIAAAAAAAAAAAAAAmAAAAAAwAAAAAAAAAIAAAACAAAAAAAAAAAAA AJgAAAAAMAAAAAAAAACAAAAAgAAAAAAAAAAAAACYAAAAADAAAAAAAAAAgAAA AIAAAAAAAAAAAAAAmAAAAAAwAAAAAAAAAIAAAACAAAAAAAAAAAAAAJgAAAAA MAAAAAAAAACAAAAAgAAAAAAAAAAAAACYAAAAADAAAAAAAAAAgAAAAIAAAAAA AAAAAAAAmEAAAA8wAAAAAAAAAIAAAACAAAAAAAAAAAAAB8iRADAAMAAAAAAA AAEAAAAAAAAAAAAAAAAApAeYQAAADzAAAAAAAAAAgAAAAIAAAAAAAAAAAAAH yJEAMAAwAAAAAAAAAQAAAAAAAAAAAAAAAACkB5hAAAAPMAAAAAAAAACAAAAA gAAAAAAAAAAAAAfIkQAwADAAAAAAAAABAAAAAAAAAAAAAAAAAKQHmEAAAA8w AAAAAAAAAIAAAACAAAAAAAAAAAAAB8iRADAAMAAAAAAAAAEAAAAAAAAAAAAA AAAApAeYQAAADzAAAAAAAAAAgAAAAIAAAAABAAAAAAAH6NAAMAEwAAAAAAAA AQAAAAQAAAAAAAAAAACAAejQADABMAAAAAAAAAEAAAACAAAAAAAAAAAAgAGY QAAADzAAAAAAAAAAgAAAAIAAAAABAAAAAAAAmEAAAA8wAAAAAAAAAIAAAACA AAAAAAAAAAAAAOjQADAAMAAAAAAAAAEAAAAAAAAAAAAAAAAAJwfIkQAwADAA AAAAAAABAAAAAAAAAAAAAACEBaQHAAAAAEMAAADRAAAAHQEAAKEBAAAUAgAA bwIAAMwCAAApAwAAlwMAAOwDAAB1BAAAdgQAAIoEAAChBAAAEwYAAFqRADAF MAAAAAAAAAEAAAAGAAAAAAAAAAAAgAdakQAwBTAAAAAAAAABAAAABQAAAAAA AAAAAIAHmgAAAAAwAAAAAAAAAIAAAACAAAAAAAAAAACAB+qQADADMAAAAAAA AAEAAAAHAAAABAAAALAdzAda0QAwCjAAAAAAAAABAAAABQAAAAsAAAAAAPwH WtEAMAowAAAAAAAAAQAAAAQAAAAAAAAAAACAB1jRADAKMAAAAAAAAAIAAAAC AAAAAAAAAAAAgAGaQAAAADAAAAAAAAAAgAAAAIAAAAAAAAAAAAAHmkAAAAAw AAAAAAAAAIAAAACAAAAAAAAAAAAAB5pAAAAAMAAAAAAAAACAAAAAgAAAAAAA AAAAAAdakQAwEDAAAAAAAAABAAAABQAAABEAAAA80/wHWJEAMBAwAAAAAAAA AQAAAAQAAAAAAAAAAACAAViRADAQMAAAAAAAAAIAAAACAAAAAAAAAAAAgAGa AAAAADAAAAAAAAAAgAAAAIAAAAAAAAAAAAAHmgAAAAAQAAAAAAAAAIAAAACA AAAAAAAAAAAABwAAAAADAAAABgAAAAYAAAAJAAAADAAAAAwAAAAMAAAADAAA ABcAAAAkAAAAJAAAACQAAAAnAAAAAAYAAEALAADYDwAAYB8AACYgAAAIAAAA CwAAAAwAAAARAAAAAAYAANoPAADwHwAAJiAAAAkAAAANAAAAEgAAAAAGAAAk IAAACgAAAAwAAAATAAAAFwAAAB4AAAAgAAAAJwAAABMhlQATIRT/lYAPAADw bAAAAAAABvAYAAAAAggAAAIAAAADAAAAAQAAAAEAAAAEAAAAHwAB8CwAAABS AAfwJAAAAAUF+/y4MEYAqY/EcgMpQlBjgf8AkkgAAAAAAAD/////AAAAAEAA HvEQAAAA//8AAAAA/wCAgIAA9wAAEAAPAALwkgAAABAACPAIAAAAAQAAAAME AAAPAAPwMAAAAA8ABPAoAAAAAQAJ8BAAAAAAAAAAAAAAAAAAAAAAAAAAAgAK 8AgAAAAABAAABQAAAA8ABPBCAAAAEgAK8AgAAAABBAAAAA4AAFMAC/AeAAAA vwEAABAAywEAAAAA/wEAAAgABAMJAAAAPwMBAAEAAAAR8AQAAAABAAAAEgYA AP//AQAAAAYAiIY9AwgAAgDUbh0AAgAAABMGAAAAAAAAAQAKAAAAEwYAAAAA AAABAAAAQwAAAAEAAAAqgHVybjpzY2hlbWFzLW1pY3Jvc29mdC1jb206b2Zm aWNlOnNtYXJ0dGFncw+AbWV0cmljY29udmVydGVyAIAMAAABUIQVBQIAAAAI ADQAOQAwADAAMAAsACAAMwQJgFByb2R1Y3RJRAEAAQAAAAEAAAAAAAAAAAAA AOwFAADsBQAA7gUAAO4FAADvBQAA7wUAAPEFAADyBQAA9AUAAPUFAAD3BQAA +AUAABAGAAATBgAABwAEAAcABAACAAQABwAEAAcABAAHAAQABwACAAAAAAB2 AAAAeAAAAEQDAABFAwAAnQUAAJ8FAADsBQAA7AUAAO4FAADuBQAA7wUAAO8F AADxBQAA8gUAAPQFAAD1BQAA9wUAAPgFAAAQBgAAEwYAAAcAGgAHABoABwAa AAcABAAHAAQAAgAEAAcABAAHAAQABwAEAAcAAgAAAAAAIAAAAEMAAACaAQAA nwEAAKIBAAC7AQAAFAIAAG8CAACXAwAA0QMAAO0DAAD8AwAAFQQAACoEAAA+ BAAAdgQAAIoEAACzBAAAVQUAAIEFAADUBQAA6wUAAOwFAADsBQAA7gUAAO4F AADvBQAA7wUAAPEFAADyBQAA9AUAAPUFAAD3BQAA+AUAABAGAAATBgAABwAF AAcABQAHAAUABwAFAAcABQAHAAUABwAFAAcABQAHAAUABwAFAAcABQAHAAQA BwAEAAIABAAHAAQABwAEAAcABAAHAAIAAAAAAOwFAADsBQAA7gUAAO4FAADv BQAA7wUAAPEFAADyBQAA9AUAAPUFAAD3BQAA+AUAABAGAAATBgAABwAEAAcA BAACAAQABwAEAAcABAAHAAQABwACAE8AAAAEAAAACAAAAOUAAAAAAAAATgAA ABsfAwAZGQgAcHIKAIVeCwAJdg4AVXsOAC80EwCsNxUA+ncWABYDFwAdSBcA BzwhAOxSIwARQzgAx1k4AGE0OwB+TjwAw2NCAFwmRADITUQAiwZMALsLTAD7 T0wAySBQAAlnUgALLVUAN3FeAHVRYgDZDWcAPjZrAOZWcgDXP3MA8G12AM8l fgDOKYsA+zuLAMVEjQACGo4AhSSSAFljkwDIKpQAT3qWANtWlwBBApsASk6c AFNSnADXJ6MAkQ2lAPN+qACSLa0AmRiuALlZsQC5L7IAKGS0ANNotACGJLkA qVG+AHs1vwBMM8EAQ1TCAOFnwgA4FMQA5lLGAAxdxgCOD8kAmmLKAHNlzAD5 X9IATXDVAE4k2gAHRNoADVPaAJ8O3gCVU+IAuW/jAPA15wDpLvQASjj0AKcE +gD/QAGAAQAUAQAAFAEAAIRHPAEBAAEAFAEAAAAAAAAUAQAAAAAAAAI0AAAA AAAAAAACAAAAAwAA/wMAABIGAABgAAAIAAAAAGAAAAwAAAAAYAAADgAAAABg AAAcAAAAAP//AQAAAAcAVQBuAGsAbgBvAHcAbgD//wEACAAAAAAAAAAAAAAA //8BAAAAAAD//wAAAgD//wAAAAD//wAAAgD//wAAAAADAAAARxaQAcwAAgIG AwUEBQIDBId6ACAAAACACAAAAAAAAAD/AQAAAAAAAFQAaQBtAGUAcwAgAE4A ZQB3ACAAUgBvAG0AYQBuAAAANRaQAQIABQUBAgEHBgIFBwAAAAAAAAAQAAAA AAAAAAAAAACAAAAAAFMAeQBtAGIAbwBsAAAAMyaQAcwAAgsGBAICAgICBId6 ACAAAACACAAAAAAAAAD/AQAAAAAAAEEAcgBpAGEAbAAAACIABAAxCIgYAPDE AgAAaAEAAAAAK2w1Z0iCQkcAAAAAKABBAAAA4gAAAAoFAAABAAMAAAAEAAMQ CgAAAOIAAAAKBQAAAQADAAAACgAAAAAAAAAhAwDwEAAAAAEAAAAAAAAAAAAA AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA4BM8CtAC0AIGBEjQAAAAA AAAAAAAAAAAAAOkFAADpBQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAgAAAAAAAAAAAAgy g1EA8BAACAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAASFAAAAAACfD/ DwEAAT8AAOMEAAD///9/////f////3////9/////f////3////9/+ncWAAAA AAAyAAAAAAAAAAAAAAAAAAAAAAD//xIAAAAAAAAAAQAzBAAAAAAAAAkARABK AF8ARABpAGUAcwBlAGwABABVAHMAZQByAAAAAAAAAAAAAAAAAAAAAAAAAAAA AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA AAAAAAAAAAAAAAAAAAAAAAAAAAD+/wAABQECAAAAAAAAAAAAAAAAAAAAAAAB AAAA4IWf8vlPaBCrkQgAKyez2TAAAABsAQAAEQAAAAEAAACQAAAAAgAAAJgA AAADAAAApAAAAAQAAACwAAAABQAAAMQAAAAGAAAA0AAAAAcAAADcAAAACAAA AOwAAAAJAAAA/AAAABIAAAAIAQAACgAAACgBAAAMAAAANAEAAA0AAABAAQAA DgAAAEwBAAAPAAAAVAEAABAAAABcAQAAEwAAAGQBAAACAAAA4wQAAB4AAAAE AAAA4wAAAB4AAAAEAAAAAAAAAB4AAAAMAAAAREpfRGllc2VsAAAAHgAAAAQA AAAAAAAAHgAAAAQAAAAAAAAAHgAAAAgAAABOb3JtYWwAAB4AAAAIAAAAVXNl cgAAAAAeAAAABAAAADQwAAAeAAAAGAAAAE1pY3Jvc29mdCBPZmZpY2UgV29y ZAAAAEAAAAAAxpQUCQAAAEAAAAAAIkJYeo3QAUAAAAAA+HABeGjRAQMAAAAB AAAAAwAAAOIAAAADAAAACgUAAAMAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA AAAAAAAAAAAAAAAAAAAAAAAAAAAA/v8AAAUBAgAAAAAAAAAAAAAAAAAAAAAA AQAAAALVzdWcLhsQk5cIACss+a4wAAAA8AAAAAwAAAABAAAAaAAAAA8AAABw AAAABQAAAIAAAAAGAAAAiAAAABEAAACQAAAAFwAAAJgAAAALAAAAoAAAABAA AACoAAAAEwAAALAAAAAWAAAAuAAAAA0AAADAAAAADAAAAM4AAAACAAAA4wQA AB4AAAAIAAAAaG9tZQAAAAADAAAACgAAAAMAAAADAAAAAwAAAOkFAAADAAAA DycLAAsAAAAAAAAACwAAAAAAAAALAAAAAAAAAAsAAAAAAAAAHhAAAAEAAAAC AAAA4wAMEAAAAgAAAB4AAAAJAAAAzeDn4uDt6OUAAwAAAAEAAAAAAAAAAAAA AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAACAAAAAwAAAAQAAAAFAAAABgAA AAcAAAAIAAAACQAAAAoAAAALAAAADAAAAA0AAAAOAAAADwAAABAAAAARAAAA EgAAABMAAAD+////FQAAABYAAAAXAAAAGAAAABkAAAAaAAAAGwAAABwAAAAd AAAAHgAAAB8AAAAgAAAAIQAAACIAAAAjAAAAJAAAACUAAAAmAAAAJwAAACgA AAApAAAAKgAAACsAAAAsAAAALQAAAC4AAAAvAAAAMAAAADEAAAAyAAAAMwAA ADQAAAA1AAAANgAAADcAAAA4AAAA/v///zoAAAA7AAAAPAAAAD0AAAA+AAAA PwAAAEAAAABBAAAAQgAAAEMAAABEAAAA/v///0YAAABHAAAASAAAAEkAAABK AAAASwAAAEwAAAD+////TgAAAE8AAABQAAAAUQAAAFIAAABTAAAAVAAAAP7/ ///9////VwAAAP7////+/////v////////////////////////////////// //////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////// ////////////////////////////////////////////////////UgBvAG8A dAAgAEUAbgB0AHIAeQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA AAAAAAAAAAAAAAAAABYABQH//////////wMAAAAGCQIAAAAAAMAAAAAAAABG AAAAAAAAAAAAAAAAkBXPHXho0QFZAAAAgAAAAAAAAABEAGEAdABhAAAAAAAA AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA AAAAAAAACgACAf///////////////wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA AAAAAAAAAAAAAAAAABQAAABSSQAAAAAAADEAVABhAGIAbABlAAAAAAAAAAAA AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAO AAIBAQAAAAYAAAD/////AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA AAAAAAAAOQAAADgXAAAAAAAAVwBvAHIAZABEAG8AYwB1AG0AZQBuAHQAAAAA AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABoAAgECAAAA BQAAAP////8AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA AAAANCYAAAAAAAAFAFMAdQBtAG0AYQByAHkASQBuAGYAbwByAG0AYQB0AGkA bwBuAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAKAACAf////////////// /wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEUAAAAAEAAA AAAAAAUARABvAGMAdQBtAGUAbgB0AFMAdQBtAG0AYQByAHkASQBuAGYAbwBy AG0AYQB0AGkAbwBuAAAAAAAAAAAAAAA4AAIBBAAAAP//////////AAAAAAAA AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAATQAAAAAQAAAAAAAAAQBD AG8AbQBwAE8AYgBqAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA AAAAAAAAAAAAAAAAAAAAABIAAgD///////////////8AAAAAAAAAAAAAAAAA AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAcQAAAAAAAAAAAAAAAAAAAAAA AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA AAAAAAAAAAAAAAAAAP///////////////wAAAAAAAAAAAAAAAAAAAAAAAAAA AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAD+//////////////// //////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////// AQD+/wMKAAD/////BgkCAAAAAADAAAAAAAAARh8AAADE7urz7OXt8iBNaWNy b3NvZnQgT2ZmaWNlIFdvcmQACgAAAE1TV29yZERvYwAQAAAAV29yZC5Eb2N1 bWVudC44APQ5snEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA AAAAAAAAAAAAAAAAAAAAAAA= ------=_NextPart_000_0000_01C6527E.AE8904D0-- From agruenba@redhat.com Mon Feb 22 08:46:59 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=ham version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay1.corp.sgi.com [137.38.102.111]) by oss.sgi.com (Postfix) with ESMTP id F13EC7F66 for ; Mon, 22 Feb 2016 08:46:58 -0600 (CST) Received: from cuda.sgi.com (cuda2.sgi.com [192.48.176.25]) by relay1.corp.sgi.com (Postfix) with ESMTP id BB90C8F80AD for ; Mon, 22 Feb 2016 06:46:52 -0800 (PST) X-ASG-Debug-ID: 1456152402-04cbb06add68a00001-NocioJ Received: from mail-vk0-f49.google.com (mail-vk0-f49.google.com [209.85.213.49]) by cuda.sgi.com with ESMTP id YJp5rOUuPcSQc0lw (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128 verify=NO) for ; Mon, 22 Feb 2016 06:46:42 -0800 (PST) X-Barracuda-Envelope-From: agruenba@redhat.com X-Barracuda-Apparent-Source-IP: 209.85.213.49 Received: by mail-vk0-f49.google.com with SMTP id k196so132343845vka.0 for ; Mon, 22 Feb 2016 06:46:42 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:date :message-id:subject:from:to:cc:content-type :content-transfer-encoding; bh=gdMj239U2XeDQCI9P6+9CZpZ341NYdhn69O0190chN0=; b=kfiNqS3+R/Vfd73w9VwG24mgctoVrpaqnRvXpSlbR2t/ATpCMhJ98Ri0YzhUE/VIA3 nUgj6NKIIFzyv77Vm2L8YdGt9imqVG+6+ocsNf5Wtj98MWiFw+oZ7PnB9Rk4ZM2c0liz 6QhOVx24xLegXAc26lsdkIrGIRWUaOTIv1wQPpDXK5/7UZ+dZ34FEsiS1wKpvAnBdUiv cjmYtq9ljn2EGJYZkwP1RfyH9f1RKj8QHwNFz6CoWRH5CosqW055EIqeKU7EwOJ25J9p BuEG+EsFHkzjZLCYON67XJhKKsuT8dKpjwXmngx5zFN6kfUIvQKCe+Okf40c60pUZxhR ef9A== X-Gm-Message-State: AG10YOR+pdPkSOcB9dy/GftEeNGRCVl8pCr6UWt7KFnzXEUgxGhbHpHGNPikE1pGX0lFqPqDSXU2Hpq8i+OeoMuF MIME-Version: 1.0 X-Received: by 10.31.149.135 with SMTP id x129mr23489385vkd.62.1456152401783; Mon, 22 Feb 2016 06:46:41 -0800 (PST) Received: by 10.176.64.130 with HTTP; Mon, 22 Feb 2016 06:46:41 -0800 (PST) In-Reply-To: <56CA2EEB.9080504@gmail.com> References: <56B770B6.7040803@gmail.com> <56B77262.7090107@gmail.com> <56C0F23C.7030902@gmail.com> <56CA2EEB.9080504@gmail.com> Date: Mon, 22 Feb 2016 15:46:41 +0100 Message-ID: Subject: Re: richacl(7) man page review comments From: Andreas Gruenbacher X-ASG-Orig-Subj: Re: richacl(7) man page review comments To: "Michael Kerrisk (man-pages)" Cc: "J. Bruce Fields" , linux-ext4 , XFS Developers , lkml , linux-fsdevel , Linux NFS Mailing List , linux-cifs@vger.kernel.org, Linux API , Dave Chinner , Christoph Hellwig , Anna Schumaker , Trond Myklebust , Jeff Layton , Andreas Dilger Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-Barracuda-Connect: mail-vk0-f49.google.com[209.85.213.49] X-Barracuda-Start-Time: 1456152402 X-Barracuda-Encrypted: ECDHE-RSA-AES128-GCM-SHA256 X-Barracuda-URL: https://192.48.176.25:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-BRTS-Status: 1 X-Barracuda-Spam-Score: 0.00 X-Barracuda-Spam-Status: No, SCORE=0.00 using per-user scores of TAG_LEVEL=1000.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.7 tests=BSF_SC0_MISMATCH_TO X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.3.27238 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 0.00 BSF_SC0_MISMATCH_TO Envelope rcpt doesn't match header Hi Michael, On Sun, Feb 21, 2016 at 10:40 PM, Michael Kerrisk (man-pages) wrote: > I've once more pulled from the latest git; here's some more comments. thanks again. I've updated the repo with your changes. >> .\" >> .\" RichACL Manual Pages >> .\" >> .\" Copyright (C) 2015,2016 Red Hat, Inc. >> .\" Written by Andreas Gruenbacher >> .\" This is free documentation; you can redistribute it and/or >> .\" modify it under the terms of the GNU General Public License as >> .\" published by the Free Software Foundation; either version 2 of >> .\" the License, or (at your option) any later version. >> .\" >> .\" The GNU General Public License's references to "object code" >> .\" and "executables" are to be interpreted as the output of any >> .\" document formatting or typesetting system, including >> .\" intermediate and printed output. >> .\" >> .\" This manual is distributed in the hope that it will be useful, >> .\" but WITHOUT ANY WARRANTY; without even the implied warranty of >> .\" MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the >> .\" GNU General Public License for more details. >> .\" >> .\" You should have received a copy of the GNU General Public >> .\" License along with this manual. If not, see >> .\" . >> .\" >> .de URL >> \\$2 \(laURL: \\$1 \(ra\\$3 >> .. >> .if \n[.g] .mso www.tmac >> .TH RICHACL 7 2015-09-01 "Linux" "Rich Access Control Lists" >> .SH NAME >> richacl \- Rich Access Control Lists >> .SH DESCRIPTION >> Rich Access Control Lists (RichACLs) are an extension of the POSIX file >> permission model (see >> .BR acl (5)) >> to support >> .URL https://tools.ietf.org/rfc/rfc5661.txt "NFSv4 Access Control Lists" >> on local and remote-mounted filesystems. >> >> A RichACL can always be translated into an equivalent NFSv4 ACL which gr= ants >> the same permissions. >> >> RichACLs can be enabled on supported local filesystems (currently, ext4 = and >> XFS). This disables POSIX Access Control Lists; the two ACL models cann= ot >> coexist on the same filesystem. >> >> The in-kernel NFSv4 server and client also include RichACL support. > > Rewrite the preceding two paras in a better logical split and order: > > [[ > RichACLs can be enabled on supported local filesystems (currently, ext4 a= nd > XFS). The in-kernel NFSv4 server and client also include RichACL support= . > > Enabling RichACLs disables POSIX Access Control Lists; > the two ACL models cannot coexist on the same filesystem. > ]] > >> >> When used on a filesystem that does not support RichACLs, the >> .BR getrichacl (1) >> and >> .BR setrichacl (1) >> utilities will operate on the file permission bits instead: >> .BR getrichacl (1) >> will display the file permission bits as a RichACL; when a RichACL >> is set with >> .BR setrichacl (1) >> which can be represented exactly by the file permission bits, >> .BR setrichacl (1) >> will set the file permission bits instead. An attempt to set a RichACL = that >> cannot be represented exactly by the file permission bits results in an = error. >> >> .SS Structure of RichACLs >> >> RichACLs consist of a number of ACL entries, three file masks, and some = flags > > s/some flags/a set of flags/ > >> specifying attributes of the ACL as whole (by contrast with the per-ACL-= entry > > s/whole/a whole/ > >> flags described below). >> >> Each of the ACL entries allows or denies some permissions to a particula= r user, >> group, or special identifier. An ACL entry consists of four fields: >> >> .IP \(bu 4 > > s/4/2/ > >> A tag which specifies the user, group, or special identifier the entry a= pplies >> to. Special identifiers can be the file owner, the owning group, or eve= ryone. > > =3D=3D> > Special identifiers correspond to one of three file masks for the file ow= ner > .RB ( owner@ ), > the owning group > .RB ( group@ ), > or everyone > .RB ( everyone@ ). No, owner@, group@, and everyone@ entries do not correspond to the file masks in that way. >> .IP \(bu >> A set of permissions the entry allows or denies. >> .IP \(bu >> A set of flags that indicate whether the user or group identifier is map= ped or >> unmapped, and whether the entry has been and can be inherited. >> .IP \(bu 4 > > s/ 4// > >> A type field indicating whether the entry allows or denies access. > > s/access/the permissions specified in the second field/ > >> .PP >> The owner, group, and other file masks further control which permissions= the >> ACL grants, subject to the >> .BR masked "\ (" m ) >> and >> .BR write_through "\ (" w ) >> ACL flags: when the permissions of a file or directory are changed with >> .BR chmod (2), >> the file masks are set based on the new file mode, and the >> .B masked >> and >> .B write_through >> ACL flags are set. Likewise, when a new file or directory inherits an AC= L from >> its parent directory, the file masks are set to the intersection between= the >> permissions granted by the inherited ACL and the >> .I mode >> parameter as given to >> .BR open "(2), " mkdir (2), >> and similar, and the >> .B masked >> ACL flag is set. In both cases, the file masks limit the permissions tha= t the >> ACL will grant. >> >> The advantage of this approach over directly modifying the ACL entries i= s that >> permissions defined in ACL entries are not lot when the file masks are l= ater > > s/lot/lost/ > >> set to be less restrictive. > > (I think) I know what you are trying to say in the previous paragraph, > but "this approach" and "directly modifying the ACL entries" is a little > vague. Masks are about solving the hysteresis problem, right? So, how > about some text along the following lines (I'm sure you can improve): > > [[ > The purpose of the file masks is to allow applications that are unaware > of RichACLs to place limits on the permissions granted by various > classes of RichACL in a manner that corresponds to the traditional > user/group/other semantics, without modifying the ACL entries in those > classes. Without the file masks, the only alternative would be for the > kernel to directly modify the ACL entries in those classes. However, > this latter approach could have a "hysteresis effect", whereby > a RichACL-unaware application that performs a transition from one file > mode to another file mode and then back to the original file mode > could cause destruction of the permission information in ACL entries. > ]] Let's try it this way: "The purpose of the file masks is to allow traditional POSIX applications = which are unaware of RichACLs to place limits on the permissions granted by = the RichACL without causing the ACL entries to be modified. Without the file m= ask, the only alternative would be for the kernel to directly modify the = ACL entries. However, this latter approach could have a "hysteresis effe= ct", whereby a RichACL-unaware application that performs a transition from one = file mode to another file mode and then back to the original file mode could c= ause destruction of the permission information in ACL entries. When creating f= iles or directories, the mode parameter to open(2), mkdir(2), and similar w= ould cause the same effect." >> >> Note that entries with the identifier >> .B everyone@ >> apply to all processes, whereas the \(lqother\(rq file permissions and >> \(lqother\(rq entries in POSIX ACLs apply to all processes which are not= the > > I'd be inclined to use (or add) \fBACL_OTHER\fP instead of "other" > in the preceding line. Things makes things IMO a little clearer when > you try to distinguish from "other" file permissions. This man page is explaining things in terms of the RichACL text form, that's why I've chose to use the POSIX ACL text form here as well. >> owner, are not in the owning group, and do not match a user or group men= tioned >> in the ACL. >> >> Unlike POSIX ACLs, RichACLs do not have separate \(lqaccess\(rq ACLs tha= t >> define the access permissions and \(lqdefault\(rq ACLs that define the >> inheritable permissions. Instead, flags on each ACL entry determine whe= ther >> the entry is effective during access checks and/or inheritable. >> >> >> .SS ACL flags >> >> The following flags on ACLs are defined: > > s/flags on ACLs/ACL flags/ > >> >> .TP >> .BR masked "\ (" m ) >> When set, the file masks define upper limits on the permissions the ACL = may >> grant. When not set, the file masks are ignored. >> .TP >> .BR write_through "\ (" w ) >> When this flag and the >> .B masked >> flag are both set, the owner and other file masks define the actual perm= issions >> granted to the file owner and to others instead of defining an upper lim= it. >> When the >> .B masked >> flag is not set, the write_through flag has no effect. > > Use .BR write_through for preceding line > >> .TP >> .BR auto_inherit "\ (" a ) >> Automatic Inheritance is enabled. See >> .IR "Automatic Inheritance" . >> .TP >> .BR protected "\ (" p ) >> The ACL is protected from modification by Automatic >> Inheritance. >> .TP >> .BR defaulted "\ (" d ) >> Indicates that the ACL has been assigned in an application-dependent way= when >> the file or directory was created; it has neither been inherited nor set >> explicitly. ACLs of files created on Linux will never have the >> .B defaulted >> flag set. "ACLs of files created on Linux will never have the defaulted flag set, but= the flag may be set on files created on or copied over from other operating systems." > The preceding sentence immediately triggers an obvious question for the > reader. So, do we need a sentence here to say when/where the "defaulted" > flag is set? >> When this flag is set for an ACL, Automatic Inheritance will >> completely replace the ACL. >> >> .SS ACL entry flags >> >> The following flags on ACL entries are defined: >> >> .TP >> .BR file_inherit "\ (" f ) >> When this flag appears in the ACL entry of a directory, then: >> .RS >> .IP \(bu 4 >> That entry is inherited by new files created in the directory such that = the > > s/4/2/ > >> permissions of the entry apply to the file (the inheritance flags of the >> inherited entry are cleared). >> .IP \(bu 4 >> The entry is is inherited by new subdirectories created in the directory= such > > s/ 4// > >> that the permissions of the entry will apply to new files created in the >> subdirectory. >> .RE >> .TP >> .BR dir_inherit "\ (" d ) >> When this flag appears in the ACL entry of a directory, then that entry = is >> inherited by new subdirectories created in the directory such that the >> permissions of the entry apply to the subdirectory (the >> .B inherit_only >> flag is cleared). >> .TP >> .BR no_propagate "\ (" n ) >> Inheritance stops at the next subdirectory level. When a file or direct= ory >> inherits an entry that has this flag set, the >> .BR file_inherit ", " dir_inherit ", " no_propagate ", and " inherit_onl= y >> flags are cleared. >> .TP >> .BR inherit_only "\ (" i ) >> The entry defines inheritable permissions only and is ignored for access >> checking. When a file or directory inherits an entry that has this flag= set, >> the flag is cleared. >> .TP >> .BR inherited "\ (" a ) >> The entry has been automatically inherited from the parent directory; th= e >> ACL's >> .B auto_inherit >> flag should be on. > > Why "should be" in the previous sentence? I think a little explanation > is needed here... I've removed the second part of the sentence instead. >> .TP >> .BR unmapped "\ (" u ) >> The user or group identifier is a textual string and is not mapped to a = numeric >> user or group identifier. ACLs with unmapped identifiers can occur on N= FSv4 >> mounted filesystems when the client cannot determine numeric user or gro= up >> identifiers for some of the NFSv4 user@domain or group@domain who values= . They >> cannot be assigned to local files or directories. >> >> .SS Permissions >> >> The following permissions are defined for RichACL entries and for the th= ree >> file masks: >> >> .TP >> .BR read_data " / " list_directory "\ (" r ) >> For a file: read the data of the file. >> For a directory: list the contents of the directory. >> .TP >> .BR write_data " / " add_file "\ (" w ) >> For a file: modify the data of the file; does not include opening the fi= le in >> append mode. >> For a directory: add a new file in the directory. >> .TP >> .BR append_data " / " add_subdirectory "\ (" p ) >> For a file: open the file in append mode. >> For a directory: create a subdirectory in the directory. >> .TP >> .BR execute "\ (" x ) >> For a file: execute the file. >> For a directory: traverse / search the directory. > > s%traverse / search%traverse (search)% >> .TP >> .BR delete_child "\ (" d ) >> Delete a file or directory within a directory. This permission is meani= ngless >> for non-directories. > > =3D=3D> "This permission is meanungful only for directories." > >> .TP >> .BR delete "\ (" D ) >> Delete the file or directory. >> .TP >> .BR read_attributes "\ (" a ) >> Read basic attributes of a file or directory (see >> .BR stat (2)). >> This permission is defined by NFSv4. It is stored, but ignored. Readin= g basic >> attributes of files and directories is always allowed on Linux. >> .TP >> .BR write_attributes "\ (" A ) >> Change the times associated with a file or directory to an arbitrary val= ue. >> This permission is always implicitly granted to the file owner. >> .TP >> .BR read_acl "\ (" c ) >> Read the ACL of a file or directory. This permission is always >> implicitly granted. > > So, I think a sentence explaining why "read_acl" exists would be > helpful, since the reader is left a little puzzled about its purpose if > it is always implicitly granted. "Like reading the basic file attributes (the read_attributes permission), reading ACLs is always allowed in Linux." >> .TP >> .BR write_acl "\ (" C ) >> Change the ACL or file mode of a file or directory. >> .TP >> .BR write_owner "\ (" o ) >> Take ownership of a file or directory. Change the owning group of a fil= e or >> directory to a group of which the calling process is a member. >> .TP > > Formatting tweak: add ".ad l" before the following line amd ".ad" after > the line. > >> .BR read_named_attrs "\ (" R "), " write_named_attrs "\ (" W "), " synch= ronize "\ (" S "), " write_retention "\ (" e "), " write_retention_hold "\ = (" E ) >> These permissions are defined by NFSv4 / NFSv4.1. They are stored, but = ignored. > > s%/%and% > >> .PP >> For the >> .BR r ", " w ", and " p >> permissions which have different long forms for files and directories, t= he > > s/permissions/permissions,/ > >> .BR getrichacl (1) >> utility will output the appropriate form(s) depending on the context. >> The >> .BR setrichacl (1) >> utility will accept either form for any file type. >> >> .SS Text form >> The common textual representation of a RichACL consists of the colon-sep= arated >> fields of the ACL flags, file masks, and ACL entries in the following >> format: >> .TP >> \fBflags:\fR\fIacl_flags\fR >> The ACL flags. >> .TP >> \fBowner:\fR\fIperm\fR\fB::mask\fR, \fBgroup:\fR\fIperm\fR\fB::mask\fR, = \fBother:\fR\fIperm\fR\fB::mask\fR >> The file masks and their permissions. >> .TP >> \fIwho\fR\fB:\fR\fIperm\fR\fB:\fR\fIflags\fR\fB:allow\fR, \fIwho\fR\fB:\= fR\fIperm\fR\fB:\fR\fIflags\fR\fB:deny\fR >> For each ACL entry, who the entry applies to, the permissions of the ent= ry, the >> entry flags, and the entry type. The who field is one of the following: > > s/who/\\fIwho\\fP/ > >> .RS >> .IP \(bu 4 > > s/4/2/ > >> One of the special identifiers: >> .BR owner@ ", " group@ ", or " everyone@ , >> .IP \(bu >> A >> .BR user: " or " u: >> prefix followed by a user name or user ID that designates a specific use= r, >> .IP \(bu >> A >> .BR group: " or " g: >> prefix followed by a group name or group ID that designates a specific g= roup. >> .RE >> .PP >> The entries are comma, whitespace, or newline separated. >> >> Flags and permissions have single-letter as well as long forms, as liste= d under >> .IR "ACL flags" , >> .IR "ACL entry flags" , >> and >> .IR Permissions . >> When the single-letter forms are used, the flags or permissions are >> concatenated. When the long forms are used, the flags or permissions are >> separated by slashes. To align permissions or flags vertically, dashes = can be >> used for padding. >> >> .SS Setting and modifying file permissions >> The access permissions for a file can either be set by assigning an Acce= ss >> Control List >> .RB ( setrichacl (1)) >> or by changing the file mode permission bits >> .RB ( chmod (1)). >> In addition, a file can inherit an ACL from its parent directory at crea= tion >> time as described under >> .IR "Permissions at file-creation time" . >> >> .SS Assigning an Access Control List >> When assigning an ACL to a file, unless explicitly specified, the owner,= group, >> and other file masks will be computed from the ACL entries as described = in >> the section >> .IR "Computing the maximum file masks" . >> The owner, group, and other file mode permission bits are then each set = from >> the owner, group, and other file mask as follows: >> .IP \(bu 4 > > s/4/2/ > >> If the file mask includes the >> .B r >> permission, the read >> file mode permission bit will be set. >> .IP \(bu >> If the file mask includes the >> .B w >> or >> .B p >> permission, the write file mode permission bit will be set. >> .IP \(bu >> If the file mask includes the >> .B x >> permission, the execute file mode permission bit will be set. >> .PP >> If the ACL can be represented exactly by the file mode >> permission bits, the file permission bits are set to match the ACL and t= he ACL >> is not stored. > > Maybe better: "...and no ACL is stored" > >> (When the ACL of a file is requested which doesn't have a= n ACL, >> the file mode permission bits are converted into an equivalent ACL.) >> >> .SS Changing the file mode permission bits >> When changing the file mode permission bits with >> .BR chmod (1), >> the owner, group, and other file permission bits are set to the permissi= on bits >> in the new mode, and the owner, group, and other file masks are set base= d on >> the new mode bits as follows: >> .IP \(bu 4 > > s/4/2/ > >> If the read bit in a set of permissions is set, the >> .B r >> permission in the corresponding file mask will be set. >> .IP \(bu >> If the write bit in a set of permissions is set, the >> .B w >> and >> .B p >> permissions in the corresponding file mask will be set. >> .IP \(bu >> If the execute bit in a set of permissions is set, the >> .B x >> permission in the corresponding file mask will be set. >> .PP >> In addition, the >> .B masked >> and >> .B write_through >> ACL flags are set. This has the >> effect of limiting the permissions granted by the ACL to the file mode >> permission bits; in addition, the owner is granted the owner mode bits a= nd >> others are granted the other mode bits. If the >> .B auto_inherit >> flag is set, the >> .B protected >> flag is also set to prevent the Automatic Inheritance algorithm from mod= ifying >> the ACL. >> >> .SS Permissions at file-creation time >> When a directory has inheritable ACL entries, the following > > s/has/has an/ > >> happens when a file or directory is created inside that directory: >> .RS 4 >> .IP 1. 4 >> A file created inside that directory will inherit all of the ACL entries= that >> have the >> .B file_inherit >> flag set, and all inheritance-related flags in the inherited entries fla= g will >> be cleared. >> >> A subdirectory created inside that directory will inherit all of the ACL >> entries that either have the >> .B dir_inherit >> flag set, or the >> .B file_inherit >> flag set and the >> .B no_propagate >> flag not set. Entries whose >> .B dir_inherit >> flag is set will have their >> .B inherit_only >> flag cleared, and entries whose >> .B dir_inherit >> flag is not set will have their >> .B inherit_only >> flag set. Finally, entries whose >> .B no_propagate >> flag is set will have all inheritance-related flags cleared. >> .IP 2. >> If the parent directory's ACL has the >> .B auto_inherit >> flag set, the inherited ACL will have its >> .B auto_inherit >> flag set, and all entries will have their >> .B inherited >> flag set. Otherwise, the >> .B auto_inherit >> and >> .B inherited >> flags are cleared. >> .IP 3. >> The three file masks are computed from the inherited ACL as described in >> the section >> .IR "Computing the maximum file masks" . >> .IP 4. >> The three sets of permissions for the owner, the group, and for others i= n >> the \fImode\fR parameter as given to >> .BR open (2), >> .BR mkdir (2), >> and similar are converted into sets of RichACL permissions. The correspo= ndence >> between mask flags and RichACL permission bits is described in the secti= on >> .IR "Changing the file mode permission bits" . >> Any RichACL permissions not included in those sets are >> removed from the owner, group, and other file masks. The file mode permi= ssion >> bits are then computed from the file masks as described in the section >> .IR "Assigning an Access Control List" . >> The process umask (see >> .BR umask (2)) >> is ignored. >> .IP 5. >> The >> .B masked >> ACL flag is set. The >> .B write_through >> ACL flag remains cleared. In addition, if the >> .B auto_inherit >> flag of the inherited ACL is set, the >> .B protected >> flag is also set to prevent the Automatic Inheritance algorithm from mod= ifying >> the ACL. >> .RE >> .PP >> When a directory does not have inheritable ACL entries, files and direct= ories >> created inside that directory will not be assigned Access Control Lists = and the >> file mode permission bits will be set to (\fImode\fR\ &\ ~\fIumask\fR) w= here >> \fImode\fR is the mode argument of the relevant system call and \fIumask= \fR is >> the process umask (see >> .BR umask (2)). >> >> .SS Automatic Inheritance >> Automatic Inheritance is a mechanism that allows permission changes to >> propagate from a directory to files and subdirectories inside that direc= tory, >> recursively. Propagation is carried out by the process changing the dir= ectory >> permissions (usually, >> .BR setrichacl (1)); >> it happens without user intervention albeit not entirely automatically. >> >> A significant limitation is that this mechanism works only as long as fi= les >> are created without explicitly specifying the file permissions to use. T= he >> standard system calls for creating files and directories >> .RB ( creat (2), >> .BR open (2), >> .BR mkdir (2), >> .BR mknod (2)) >> all have mandatory mode parameters which define the maximum allowed perm= issions >> of the new files. To take account of this restriction, the >> .B protected >> ACL flag must be set if the >> .B inherited >> flag is set. This effectively disables Automatic Inheritance for that >> particular file. >> > > Add the following at the start of the next paragraph: > > "Motwithstanding the aforementioned limitation," >> Automatic Inheritance still remains useful for network protocols like NF= Sv4 and >> SMB, which both support creating files and directories without defining = their >> permissions: they can implement those operations by using the standard s= ystem > > s/: they/. These protocols/ > (To avoid an excessively long sentence.) > >> calls and by then undoing the effect of applying the mode parameters. >> >> When the ACL of a directory is changed, the following happens for each e= ntry >> (\(lqchild\(rq) inside that directory: >> .IP 1. 4 >> If the entry is a symblic link, skip the child. > > s/symblic/symbolic/ > >> .IP 2. >> If the >> .B auto_inherit >> flag of the entry's ACL is not set or the >> .B protected >> flag is set, skip the child. >> .IP 3. >> With the child's ACL: >> .RS 4 >> .IP a) 4 >> If the >> .B defaulted >> flag is set, replace the ACL with an empty ACL >> with the >> .B auto_inherit >> flag set. >> .IP b) >> Delete all entries which have the >> .B inherited >> flag set. >> .IP c) >> Append all entries inherited from the parent directory according to step= 1 of >> the algorithm described under >> .IR "Permissions at file-creation time". >> Set the >> .B inherited >> flag of each of these entries. >> .IP d) >> Recompute the file masks. >> .RE >> .IP 4. >> If the child is a directory, recursively apply this algorithm. >> >> .SS Access check algorithm >> >> When a process requests a particular kind of access (expressed as a set = of >> RichACL permissions) to a file, the following algorithm determines wheth= er the >> access is granted or denied: >> >> .IP 1. 4 >> If the >> .B masked >> ACL flag is set, then: >> .RS 4 >> .IP a) 4 >> If the >> .B write_through >> ACL flag is set, then: >> .RS 4 > > s/4/2/ > >> .IP \(bu 4 > > s/4/2/ > >> If the requesting process is the file owner, then access is granted if t= he >> owner mask includes the requested permissions, and is otherwise denied. >> .IP \(bu >> If the requesting process is not the file owner, is not in the owning gr= oup, >> and no ACL entries other than >> .B everyone@ >> match the process, then access is granted if the other mask includes the >> requested permissions, and is otherwise denied. > > So, in the above subcases, the following does not seem to be covered: > (1) "masked" ACL flag is set AND > (2) requesting process *is* in owning group *or* an ACL other > than "everyone@"matches the process. > > What happens in this case? I suspect that somehow we are supposed to > fall through to part "b)" below (and possibly into clause "2."?), but > the logical structure of the clauses does not reflect this. Yes. I've added this bullet point between the existing two now: "If the requesting process is not the file owner and it is in the owning gr= oup or matches any ACL entries other than everyone@, proceed to step b)." >> .RE >> .IP b) >> If any of the following is true: >> .RS 4 > > s/4/2/ > >> .IP \(bu 4 > > s/4/2/ > >> the requesting process is the file owner and the owner mask does not inc= lude all >> requested permissions, >> .IP \(bu 4 > > s/ 4// > >> the requesting process is not the file owner and it is in the owning gro= up or >> matches any ACL entries other than >> .BR everyone@ , >> and the group mask does not include all requested permissions, >> .IP \(bu 4 > > s/ 4// > >> the requesting process is not the file owner, not in the owning group, i= t >> matches no ACL entries other than >> .BR everyone@ , >> and the other mask does not include all requested permissions, >> .PP >> then access is denied. >> .RE >> .RE > > At some point, perhaps in the next paragraph, I think that it needs to > be clarified that unlike POSIX ACLs, a process can gain the permissions > it requires by accumulating them from multiple RichACL enties. (That's > correct, is it not?) Yes. I've added the following at the end of the section: "In this algorithm, a process can gain the permissions it requires by accumulating them from multiple RichACL entries. This is in contrast with POSIX ACLs, where access is only granted if an ACL entry exists that matche= s the requesting process and includes all the requested permissions." >> .IP 2. >> Set the remaining permissions to the requested permissions. Go through = all ACL >> entries. For each entry: > > So, perhaps replace the preceding two lines with something like: > > [[ > Upon reaching this point, the determination of whether or not access is > granted is made by scanning all ACL entries to see if one or more > applicable entries together grant a cumulative set of permissions that > matches the requested permissions or there is an applicable entry that > explicitly denies one or more of the requested permissions. > The scan of all ACL entries begins by > first initializing the set of remaining permissions (i.e., those that hav= e > not yet been satisfied during the scan) to be the set of requested > permissions. Then the ACL entries are scanned > .IR "in order" , > and for each entry: > ]] ok >> .RS 4 >> .IP a) 4 >> If the >> .B inherit_only >> or >> .B unmapped >> flags are set, continue with the next ACL entry. >> .IP b) >> If any of the following is true: >> .RS 4 > > s/4/2/ > >> .IP \(bu 4 > > s/4/2/ > >> the entry's identifier is >> .B owner@ >> and the requesting process is the file owner, >> .IP \(bu >> the entry's identifier is >> .B group@ >> and the requesting process is in the owning group, >> .IP \(bu >> the entry's identifier is a user and the requesting process is owned by = that >> user, >> .IP \(bu >> the entry's identifier is a group and the requesting process is a member= in >> that group, >> .IP \(bu >> the entry's identifier is >> .BR everyone@ , >> .PP >> then the entry matches the process; proceed to the next step. Otherwise, >> continue with the next ACL entry. >> .RE >> .IP c) >> If the entry denies any of the remaining permissions, access is denied. >> .IP d) >> If the entry allows any of the remaining permissions, then: >> .RS 4 > > s/4/2/ > >> .IP \(bu 4 > > s/4/2/ > >> If the >> .B masked >> ACL flag is set and the entry's identifier is not >> .B owner@ >> or >> .BR everyone@ >> or is a user entry matching the file owner, remove all permissions from = the >> remaining permissions which are both allowed by the entry and included i= n the >> group mask, >> .IP \(bu >> Otherwise, remove all permissions from the remaining permissions wich ar= e > > s/wich/which > >> allowed by the entry. >> .RE >> .RE >> .IP 3. >> If there are no more remaining permissions, access is allowed. Otherwise= , >> access is denied. >> >> .SS Computing the maximum file masks >> When setting an ACL and no file masks have been explicitly specified and= when >> inheriting an ACL from the parent directory, the following algorithm is = used >> for computing the file masks: >> >> .IP 1. 4 >> Clear the owner, group, and other file masks. Remember which permissions= have >> already been processed (initially, the empty set). >> .IP 2. >> For each ACL entry: >> .RS 4 > > s/4/2/ > >> .IP \(bu 4 > > s/4/2/ > >> If the >> .B inherit_only >> flag is set, skip the entry. >> .IP \(bu 4 > > s/ 4// > >> Otherwise, compute which permissions the entry allows or denies that hav= e not >> been processed yet (the remaining permissions). >> .IP \(bu >> If the entry is an >> .B owner@ >> entry, add the remaining permissions to the owner mask for >> .B allow >> entries, and remove the remaining permissions from the owner mask for >> .B deny >> entries. >> .IP \(bu >> Otherwise, if the entry is an >> .B everyone@ >> entry, proceed as with >> .B owner@ >> entries but add or remove the remaining permissions from the owner, grou= p, and >> other file masks. >> .IP \(bu >> Otherwise, proceed as with >> .B owner@ >> entries but add or remove the remaining permissions from the owner and g= roup >> file masks. >> .IP \(bu >> Add the entry's permissions to the processed permissions. >> .RE >> .PP >> The resulting file masks represent the ACL as closely as possible. With = these >> file masks, if the >> .B masked >> ACL flag is set, the effective permissions still stay the same. > > The meaing of "will stay the same" is not quite clear "will stay the > same *as what*"?). I suspect I know what you mean, but it needs to be > made more obvious. "With these file masks, the effective permissions that the ACL grants will be the same when the masked flag is set as when it is not set." >> >> .\" .SH BUGS >> .SH AUTHOR >> Written by Andreas Gr=C3=BCnbacher . >> >> Please send your bug reports, suggested features and comments to the abo= ve address. >> > > I'm going to play the broken record :-) > > Could we start with just a few simple examples already, and build up > over future iterations of this page? Yes, as soon as I'll get to it :) >> .SH CONFORMING TO >> Rich Access Control Lists are Linux-specific. >> .SH SEE ALSO >> .BR acl (5), > > Move this entry to the point XXX below. > >> .BR chmod (1), >> .BR getrichacl (1), >> .BR ls (1), >> .BR setrichacl (1) >> .BR stat (2), >> .BR umask (2) >> .\" librichacl > > XXX > > By the way, are there already man pages for the librichacl functions? Not yet, no. Cheers, Andreas From david@lechnology.com Mon Feb 22 11:53:32 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=T_DKIM_INVALID autolearn=ham version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay1.corp.sgi.com [137.38.102.111]) by oss.sgi.com (Postfix) with ESMTP id BDF917F67 for ; Mon, 22 Feb 2016 11:53:32 -0600 (CST) Received: from cuda.sgi.com (cuda2.sgi.com [192.48.176.25]) by relay1.corp.sgi.com (Postfix) with ESMTP id 7CA948F80B9 for ; Mon, 22 Feb 2016 09:53:26 -0800 (PST) X-ASG-Debug-ID: 1456163603-04cbb06add9aa60001-NocioJ Received: from vern.gendns.com (vern.gendns.com [206.190.152.46]) by cuda.sgi.com with ESMTP id wuTlkIp2Z07aC5Dj (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO) for ; Mon, 22 Feb 2016 09:53:24 -0800 (PST) X-Barracuda-Envelope-From: david@lechnology.com X-Barracuda-Apparent-Source-IP: 206.190.152.46 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lechnology.com; s=default; h=Content-Transfer-Encoding:Content-Type: In-Reply-To:MIME-Version:Date:Message-ID:From:Cc:References:To:Subject; bh=mLAM1/btw3r8VRW2SRJ+E/wqPnPqBIDWUo4TiOL3Rfk=; b=MM0V+YAPvcaHQgPwZJrr/FbTHt pYfa2Xf7LGwDDHnyZc6A76o03yCOqWTfycKf+OR205smusfAVkHKkwvDXQ6zfHufWfD5i4NFKvWVZ E9imE3VCKl2hAw/dmgmfRazYEAwNFzf1JadlkDUyJNdk5aK0IdDK/EG6fAD5LlKyveg64N0eOB91t jS9mjuRamEnxQ7isuRZmRWgtS9+g2+KHCCoLd60AssKLX+qlz6YgxnPicobbfRj42QwYL6gsw9lV/ 6QuKTVDdln5SLUviOnGLuft+yah/O8yWFZkjRAHTQPgxD4M/X+D4jSfsTDdod5ZNiKEevhwQ/qLF8 k3tnNRKA==; Received: from 108-198-5-147.lightspeed.okcbok.sbcglobal.net ([108.198.5.147]:58074 helo=[192.168.0.113]) by vern.gendns.com with esmtpsa (TLSv1.2:DHE-RSA-AES128-SHA:128) (Exim 4.86) (envelope-from ) id 1aXufh-001gm9-D7; Mon, 22 Feb 2016 12:53:21 -0500 Subject: Re: recovering corrupt filesystem after raid failure To: Dave Chinner X-ASG-Orig-Subj: Re: recovering corrupt filesystem after raid failure References: <56CA6492.7000407@lechnology.com> <20160222022439.GE14668@dastard> Cc: xfs@oss.sgi.com From: David Lechner Message-ID: <56CB4B16.8010101@lechnology.com> Date: Mon, 22 Feb 2016 11:53:26 -0600 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.5.1 MIME-Version: 1.0 In-Reply-To: <20160222022439.GE14668@dastard> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - vern.gendns.com X-AntiAbuse: Original Domain - oss.sgi.com X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - lechnology.com X-Get-Message-Sender-Via: vern.gendns.com: authenticated_id: davidmain+lechnology.com/only user confirmed/virtual account not confirmed X-Authenticated-Sender: vern.gendns.com: davidmain@lechnology.com X-Source: X-Source-Args: X-Source-Dir: X-Barracuda-Connect: vern.gendns.com[206.190.152.46] X-Barracuda-Start-Time: 1456163603 X-Barracuda-Encrypted: ECDHE-RSA-AES256-GCM-SHA384 X-Barracuda-URL: https://192.48.176.25:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-BRTS-Status: 1 X-Barracuda-Spam-Score: 0.00 X-Barracuda-Spam-Status: No, SCORE=0.00 using per-user scores of TAG_LEVEL=1000.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.7 tests=BSF_SC0_MISMATCH_TO, DKIM_SIGNED, DKIM_VERIFIED X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.3.27242 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 0.00 BSF_SC0_MISMATCH_TO Envelope rcpt doesn't match header -0.00 DKIM_VERIFIED Domain Keys Identified Mail: signature passes verification 0.00 DKIM_SIGNED Domain Keys Identified Mail: message has a signature On 02/21/2016 08:24 PM, Dave Chinner wrote: > On Sun, Feb 21, 2016 at 07:29:54PM -0600, David Lechner wrote: >> Long story short, I had a dual disk failure in a raid 5. I've managed to >> get the raid back up and salvaged what I could. However, the xfs is >> seriously damaged. I've tried running xfs_repair, but it is failing and >> it recommended to send a message to this mailing list. This is an Ubuntu >> 12.04 machine, so xfs_repair version 3.1.7. > > So the first thing to do is get a more recent xfsprogs package and > try that. There's not a lot of point in us looking at problems with > a 4 and half year old package that we've probably already fixed. > >> The file system won't mount. Fails with "mount: Structure needs >> cleaning". So I tried xfs_repair. I had to resort to xfs_repair -L >> because the first 500MB or so of the filesystem was wiped out. > > Oh, so even if you can repair the filesystem, your data is likely to > be irretreivably corrupted. > >> Now, >> xfs_repair /dev/md127 gets stuck, so I am running xfs_repair -P >> /dev/md127. This gets much farther, but it is failing too. It gives an >> error message like this: >> >> >> ... >> disconnected inode 2101958, moving to lost+found >> corrupt dinode 2101958, extent total = 1, nblocks = 0. This is a bug. >> Please capture the filesystem metadata with xfs_metadump and >> report it to xfs@oss.sgi.com. >> cache_node_purge: refcount was 1, not zero (node=0x7f2c57e1b120) >> >> fatal error -- 117 - couldn't iget disconnected inode >> >> >> >> However, nblocks = 0 does not seem to be true... > > Probably because it got cleared in memory before this problem was > tripped over. > >> If I re-run xfs_repair -P /dev/md127, it will fail on different >> seemingly random inode with the same error message. > > Yup, you definitely need to run a current xfs_repair on this > filesystem before going any further. > > Cheers, > > Dave. > Thanks for the advice. The newer version was able to complete successfully. I can now mount the file system and I ended up with 1.5TB in lost+found, so at least there is still something there. From ross.zwisler@linux.intel.com Mon Feb 22 12:59:46 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=ham version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay2.corp.sgi.com [137.38.102.29]) by oss.sgi.com (Postfix) with ESMTP id 703647C8C for ; Mon, 22 Feb 2016 12:59:46 -0600 (CST) Received: from cuda.sgi.com (cuda2.sgi.com [192.48.176.25]) by relay2.corp.sgi.com (Postfix) with ESMTP id 31206304093 for ; Mon, 22 Feb 2016 10:59:40 -0800 (PST) X-ASG-Debug-ID: 1456167579-04cbb06ade9c590001-NocioJ Received: from mga11.intel.com ([192.55.52.93]) by cuda.sgi.com with ESMTP id puA4f3aw8K8BY2Ge for ; Mon, 22 Feb 2016 10:59:39 -0800 (PST) X-Barracuda-Envelope-From: ross.zwisler@linux.intel.com X-Barracuda-Apparent-Source-IP: 192.55.52.93 X-ASG-Whitelist: Client Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by fmsmga102.fm.intel.com with ESMTP; 22 Feb 2016 10:59:39 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.22,485,1449561600"; d="scan'208";a="657296559" Received: from rzwisler-desk.amr.corp.intel.com (HELO phyrexia.intel.com) ([10.254.181.157]) by FMSMGA003.fm.intel.com with ESMTP; 22 Feb 2016 10:59:38 -0800 From: Ross Zwisler To: linux-kernel@vger.kernel.org Cc: Ross Zwisler , "Theodore Ts'o" , Alexander Viro , Andreas Dilger , Andrew Morton , Dan Williams , Dave Chinner , Jan Kara , Jens Axboe , Matthew Wilcox , linux-block@vger.kernel.org, linux-ext4@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux-mm@kvack.org, linux-nvdimm@lists.01.org, xfs@oss.sgi.com Subject: [PATCH v4 0/5] DAX fixes, move flushing calls to FS Date: Mon, 22 Feb 2016 11:59:17 -0700 X-ASG-Orig-Subj: [PATCH v4 0/5] DAX fixes, move flushing calls to FS Message-Id: <1456167562-28576-1-git-send-email-ross.zwisler@linux.intel.com> X-Mailer: git-send-email 2.5.0 X-Barracuda-Connect: UNKNOWN[192.55.52.93] X-Barracuda-Start-Time: 1456167579 X-Barracuda-URL: https://192.48.176.25:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-BRTS-Status: 1 Changes since v3: - Added Reviewed-by tags from Jan Kara. - Dropped patch 6, "block: use dax_do_io() if blkdev_dax_capable()" I believe that this series is ready for inclusion in v4.5. I think it should be merged for v4.5 because it fixes serious issues with the DAX code including possible data corruption and kernel OOPSes. akpm, for the v4.5 merge do you want these patches to go through the -mm tree, or would it be better if I just sent them to Linus directly? A working tree can be found here: https://git.kernel.org/cgit/linux/kernel/git/zwisler/linux.git/log/?h=fsync_bdev_v4 --- Previous summary with issue impacts added: This patch series fixes several issues with the current DAX code: 1) DAX is used by default on raw block devices that are capable of supporting it. This creates an issue because there are still uses of the block device that use the page cache, and having one block device user doing DAX I/O and another doing page cache I/O can lead to data corruption. 2) When S_DAX is set on an inode we assume that if there are pages attached to the mapping (mapping->nrpages != 0), those pages are clean zero pages that were used to service reads from holes. This wasn't true in all cases. 3) ext4 online defrag combined with DAX I/O could lead to data corruption. 4) The DAX block/sector zeroing code needs a valid struct block_device, which it wasn't always getting. This could lead to a kernel OOPS. 5) The DAX writeback code needs a valid struct block_device, which it wasn't always getting. This could lead to a kernel OOPS. 6) The DAX writeback code needs to be called for sync(2) and syncfs(2). This could lead to data loss. Dan Williams (1): block: disable block device DAX by default Ross Zwisler (4): ext2, ext4: only set S_DAX for regular inodes ext4: Online defrag not supported with DAX dax: give DAX clearing code correct bdev dax: move writeback calls into the filesystems block/Kconfig | 13 +++++++++++++ fs/block_dev.c | 19 +++++++++++++++++-- fs/dax.c | 21 +++++++++++---------- fs/ext2/inode.c | 16 +++++++++++++--- fs/ext4/inode.c | 6 +++++- fs/ext4/ioctl.c | 5 +++++ fs/xfs/xfs_aops.c | 6 +++++- fs/xfs/xfs_aops.h | 1 + fs/xfs/xfs_bmap_util.c | 3 ++- include/linux/dax.h | 8 +++++--- mm/filemap.c | 12 ++++-------- 11 files changed, 81 insertions(+), 29 deletions(-) -- 2.5.0 From ross.zwisler@linux.intel.com Mon Feb 22 12:59:47 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=ham version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay2.corp.sgi.com [137.38.102.29]) by oss.sgi.com (Postfix) with ESMTP id A19F37C8C for ; Mon, 22 Feb 2016 12:59:47 -0600 (CST) Received: from cuda.sgi.com (cuda2.sgi.com [192.48.176.25]) by relay2.corp.sgi.com (Postfix) with ESMTP id 697FB304098 for ; Mon, 22 Feb 2016 10:59:41 -0800 (PST) X-ASG-Debug-ID: 1456167579-04cbb06ade9c590002-NocioJ Received: from mga11.intel.com ([192.55.52.93]) by cuda.sgi.com with ESMTP id Vo6pvDYbqY4icoW6 for ; Mon, 22 Feb 2016 10:59:40 -0800 (PST) X-Barracuda-Envelope-From: ross.zwisler@linux.intel.com X-Barracuda-Apparent-Source-IP: 192.55.52.93 X-ASG-Whitelist: Client Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by fmsmga102.fm.intel.com with ESMTP; 22 Feb 2016 10:59:41 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.22,485,1449561600"; d="scan'208";a="657296574" Received: from rzwisler-desk.amr.corp.intel.com (HELO phyrexia.intel.com) ([10.254.181.157]) by FMSMGA003.fm.intel.com with ESMTP; 22 Feb 2016 10:59:39 -0800 From: Ross Zwisler To: linux-kernel@vger.kernel.org Cc: Dan Williams , "Theodore Ts'o" , Alexander Viro , Andreas Dilger , Andrew Morton , Dave Chinner , Jan Kara , Jens Axboe , Matthew Wilcox , linux-block@vger.kernel.org, linux-ext4@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux-mm@kvack.org, linux-nvdimm@lists.01.org, xfs@oss.sgi.com, Jan Kara , Jens Axboe , Matthew Wilcox , Al Viro , Ross Zwisler Subject: [PATCH v4 1/5] block: disable block device DAX by default Date: Mon, 22 Feb 2016 11:59:18 -0700 X-ASG-Orig-Subj: [PATCH v4 1/5] block: disable block device DAX by default Message-Id: <1456167562-28576-2-git-send-email-ross.zwisler@linux.intel.com> X-Mailer: git-send-email 2.5.0 In-Reply-To: <1456167562-28576-1-git-send-email-ross.zwisler@linux.intel.com> References: <1456167562-28576-1-git-send-email-ross.zwisler@linux.intel.com> X-Barracuda-Connect: UNKNOWN[192.55.52.93] X-Barracuda-Start-Time: 1456167579 X-Barracuda-URL: https://192.48.176.25:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-BRTS-Status: 1 From: Dan Williams The recent *sync enabling discovered that we are inserting into the block_device pagecache counter to the expectations of the dirty data tracking for dax mappings. This can lead to data corruption. We want to support DAX for block devices eventually, but it requires wider changes to properly manage the pagecache. [] dump_stack+0x85/0xc2 [] dax_writeback_mapping_range+0x60/0xe0 [] blkdev_writepages+0x3f/0x50 [] do_writepages+0x21/0x30 [] __filemap_fdatawrite_range+0xc6/0x100 [] filemap_write_and_wait+0x4a/0xa0 [] set_blocksize+0x70/0xd0 [] sb_set_blocksize+0x1d/0x50 [] ext4_fill_super+0x75b/0x3360 [] ? vsnprintf+0x201/0x4c0 [] ? snprintf+0x49/0x60 [] mount_bdev+0x180/0x1b0 [] ? ext4_calculate_overhead+0x370/0x370 [] ext4_mount+0x15/0x20 [] mount_fs+0x38/0x170 Mark the support broken so its disabled by default, but otherwise still available for testing. Cc: Jan Kara Cc: Jens Axboe Cc: Matthew Wilcox Cc: Al Viro Reported-by: Ross Zwisler Suggested-by: Dave Chinner Signed-off-by: Dan Williams Signed-off-by: Ross Zwisler Reviewed-by: Jan Kara --- block/Kconfig | 13 +++++++++++++ fs/block_dev.c | 6 +++++- 2 files changed, 18 insertions(+), 1 deletion(-) diff --git a/block/Kconfig b/block/Kconfig index 161491d..0363cd7 100644 --- a/block/Kconfig +++ b/block/Kconfig @@ -88,6 +88,19 @@ config BLK_DEV_INTEGRITY T10/SCSI Data Integrity Field or the T13/ATA External Path Protection. If in doubt, say N. +config BLK_DEV_DAX + bool "Block device DAX support" + depends on FS_DAX + depends on BROKEN + help + When DAX support is available (CONFIG_FS_DAX) raw block + devices can also support direct userspace access to the + storage capacity via MMAP(2) similar to a file on a + DAX-enabled filesystem. However, the DAX I/O-path disables + some standard I/O-statistics, and the MMAP(2) path has some + operational differences due to bypassing the page + cache. If in doubt, say N. + config BLK_DEV_THROTTLING bool "Block layer bio throttling support" depends on BLK_CGROUP=y diff --git a/fs/block_dev.c b/fs/block_dev.c index 39b3a17..31c6d10 100644 --- a/fs/block_dev.c +++ b/fs/block_dev.c @@ -1201,7 +1201,11 @@ static int __blkdev_get(struct block_device *bdev, fmode_t mode, int for_part) bdev->bd_disk = disk; bdev->bd_queue = disk->queue; bdev->bd_contains = bdev; - bdev->bd_inode->i_flags = disk->fops->direct_access ? S_DAX : 0; + if (IS_ENABLED(CONFIG_BLK_DEV_DAX) && disk->fops->direct_access) + bdev->bd_inode->i_flags = S_DAX; + else + bdev->bd_inode->i_flags = 0; + if (!partno) { ret = -ENXIO; bdev->bd_part = disk_get_part(disk, partno); -- 2.5.0 From ross.zwisler@linux.intel.com Mon Feb 22 12:59:51 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=ham version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay2.corp.sgi.com [137.38.102.29]) by oss.sgi.com (Postfix) with ESMTP id A2DAF7C8C for ; Mon, 22 Feb 2016 12:59:51 -0600 (CST) Received: from cuda.sgi.com (cuda2.sgi.com [192.48.176.25]) by relay2.corp.sgi.com (Postfix) with ESMTP id 634DD30409B for ; Mon, 22 Feb 2016 10:59:45 -0800 (PST) X-ASG-Debug-ID: 1456167579-04cbb06ade9c590005-NocioJ Received: from mga11.intel.com ([192.55.52.93]) by cuda.sgi.com with ESMTP id 7pMJlb4WWfgvXnKD for ; Mon, 22 Feb 2016 10:59:44 -0800 (PST) X-Barracuda-Envelope-From: ross.zwisler@linux.intel.com X-Barracuda-Apparent-Source-IP: 192.55.52.93 X-ASG-Whitelist: Client Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by fmsmga102.fm.intel.com with ESMTP; 22 Feb 2016 10:59:44 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.22,485,1449561600"; d="scan'208";a="657296615" Received: from rzwisler-desk.amr.corp.intel.com (HELO phyrexia.intel.com) ([10.254.181.157]) by FMSMGA003.fm.intel.com with ESMTP; 22 Feb 2016 10:59:43 -0800 From: Ross Zwisler To: linux-kernel@vger.kernel.org Cc: Ross Zwisler , "Theodore Ts'o" , Alexander Viro , Andreas Dilger , Andrew Morton , Dan Williams , Dave Chinner , Jan Kara , Jens Axboe , Matthew Wilcox , linux-block@vger.kernel.org, linux-ext4@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux-mm@kvack.org, linux-nvdimm@lists.01.org, xfs@oss.sgi.com Subject: [PATCH v4 4/5] dax: give DAX clearing code correct bdev Date: Mon, 22 Feb 2016 11:59:21 -0700 X-ASG-Orig-Subj: [PATCH v4 4/5] dax: give DAX clearing code correct bdev Message-Id: <1456167562-28576-5-git-send-email-ross.zwisler@linux.intel.com> X-Mailer: git-send-email 2.5.0 In-Reply-To: <1456167562-28576-1-git-send-email-ross.zwisler@linux.intel.com> References: <1456167562-28576-1-git-send-email-ross.zwisler@linux.intel.com> X-Barracuda-Connect: UNKNOWN[192.55.52.93] X-Barracuda-Start-Time: 1456167583 X-Barracuda-URL: https://192.48.176.25:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-BRTS-Status: 1 dax_clear_blocks() needs a valid struct block_device and previously it was using inode->i_sb->s_bdev in all cases. This is correct for normal inodes on mounted ext2, ext4 and XFS filesystems, but is incorrect for DAX raw block devices and for XFS real-time devices. Instead, rename dax_clear_blocks() to dax_clear_sectors(), and change its arguments to take a bdev and a sector instead of an inode and a block. This better reflects what the function does, and it allows the filesystem and raw block device code to pass in an appropriate struct block_device. Signed-off-by: Ross Zwisler Suggested-by: Dan Williams Reviewed-by: Jan Kara --- fs/dax.c | 9 ++++----- fs/ext2/inode.c | 6 ++++-- fs/xfs/xfs_aops.c | 2 +- fs/xfs/xfs_aops.h | 1 + fs/xfs/xfs_bmap_util.c | 3 ++- include/linux/dax.h | 2 +- 6 files changed, 13 insertions(+), 10 deletions(-) diff --git a/fs/dax.c b/fs/dax.c index fc2e314..9a173dd 100644 --- a/fs/dax.c +++ b/fs/dax.c @@ -79,15 +79,14 @@ struct page *read_dax_sector(struct block_device *bdev, sector_t n) } /* - * dax_clear_blocks() is called from within transaction context from XFS, + * dax_clear_sectors() is called from within transaction context from XFS, * and hence this means the stack from this point must follow GFP_NOFS * semantics for all operations. */ -int dax_clear_blocks(struct inode *inode, sector_t block, long _size) +int dax_clear_sectors(struct block_device *bdev, sector_t _sector, long _size) { - struct block_device *bdev = inode->i_sb->s_bdev; struct blk_dax_ctl dax = { - .sector = block << (inode->i_blkbits - 9), + .sector = _sector, .size = _size, }; @@ -109,7 +108,7 @@ int dax_clear_blocks(struct inode *inode, sector_t block, long _size) wmb_pmem(); return 0; } -EXPORT_SYMBOL_GPL(dax_clear_blocks); +EXPORT_SYMBOL_GPL(dax_clear_sectors); /* the clear_pmem() calls are ordered by a wmb_pmem() in the caller */ static void dax_new_buf(void __pmem *addr, unsigned size, unsigned first, diff --git a/fs/ext2/inode.c b/fs/ext2/inode.c index 27e2cdd..4467cbd 100644 --- a/fs/ext2/inode.c +++ b/fs/ext2/inode.c @@ -737,8 +737,10 @@ static int ext2_get_blocks(struct inode *inode, * so that it's not found by another thread before it's * initialised */ - err = dax_clear_blocks(inode, le32_to_cpu(chain[depth-1].key), - 1 << inode->i_blkbits); + err = dax_clear_sectors(inode->i_sb->s_bdev, + le32_to_cpu(chain[depth-1].key) << + (inode->i_blkbits - 9), + 1 << inode->i_blkbits); if (err) { mutex_unlock(&ei->truncate_mutex); goto cleanup; diff --git a/fs/xfs/xfs_aops.c b/fs/xfs/xfs_aops.c index 379c089..fc20518 100644 --- a/fs/xfs/xfs_aops.c +++ b/fs/xfs/xfs_aops.c @@ -55,7 +55,7 @@ xfs_count_page_state( } while ((bh = bh->b_this_page) != head); } -STATIC struct block_device * +struct block_device * xfs_find_bdev_for_inode( struct inode *inode) { diff --git a/fs/xfs/xfs_aops.h b/fs/xfs/xfs_aops.h index f6ffc9a..a4343c6 100644 --- a/fs/xfs/xfs_aops.h +++ b/fs/xfs/xfs_aops.h @@ -62,5 +62,6 @@ int xfs_get_blocks_dax_fault(struct inode *inode, sector_t offset, struct buffer_head *map_bh, int create); extern void xfs_count_page_state(struct page *, int *, int *); +extern struct block_device *xfs_find_bdev_for_inode(struct inode *); #endif /* __XFS_AOPS_H__ */ diff --git a/fs/xfs/xfs_bmap_util.c b/fs/xfs/xfs_bmap_util.c index 45ec9e4..6c87601 100644 --- a/fs/xfs/xfs_bmap_util.c +++ b/fs/xfs/xfs_bmap_util.c @@ -75,7 +75,8 @@ xfs_zero_extent( ssize_t size = XFS_FSB_TO_B(mp, count_fsb); if (IS_DAX(VFS_I(ip))) - return dax_clear_blocks(VFS_I(ip), block, size); + return dax_clear_sectors(xfs_find_bdev_for_inode(VFS_I(ip)), + sector, size); /* * let the block layer decide on the fastest method of diff --git a/include/linux/dax.h b/include/linux/dax.h index 818e450..7b6bced 100644 --- a/include/linux/dax.h +++ b/include/linux/dax.h @@ -7,7 +7,7 @@ ssize_t dax_do_io(struct kiocb *, struct inode *, struct iov_iter *, loff_t, get_block_t, dio_iodone_t, int flags); -int dax_clear_blocks(struct inode *, sector_t block, long size); +int dax_clear_sectors(struct block_device *bdev, sector_t _sector, long _size); int dax_zero_page_range(struct inode *, loff_t from, unsigned len, get_block_t); int dax_truncate_page(struct inode *, loff_t from, get_block_t); int dax_fault(struct vm_area_struct *, struct vm_fault *, get_block_t, -- 2.5.0 From ross.zwisler@linux.intel.com Mon Feb 22 12:59:54 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=ham version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay2.corp.sgi.com [137.38.102.29]) by oss.sgi.com (Postfix) with ESMTP id D966A7C8C for ; Mon, 22 Feb 2016 12:59:54 -0600 (CST) Received: from cuda.sgi.com (cuda2.sgi.com [192.48.176.25]) by relay2.corp.sgi.com (Postfix) with ESMTP id A9042304093 for ; Mon, 22 Feb 2016 10:59:48 -0800 (PST) X-ASG-Debug-ID: 1456167579-04cbb06ade9c590003-NocioJ Received: from mga11.intel.com ([192.55.52.93]) by cuda.sgi.com with ESMTP id W4hB9HhACOUFPjw7 for ; Mon, 22 Feb 2016 10:59:41 -0800 (PST) X-Barracuda-Envelope-From: ross.zwisler@linux.intel.com X-Barracuda-Apparent-Source-IP: 192.55.52.93 X-ASG-Whitelist: Client Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by fmsmga102.fm.intel.com with ESMTP; 22 Feb 2016 10:59:42 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.22,485,1449561600"; d="scan'208";a="657296584" Received: from rzwisler-desk.amr.corp.intel.com (HELO phyrexia.intel.com) ([10.254.181.157]) by FMSMGA003.fm.intel.com with ESMTP; 22 Feb 2016 10:59:41 -0800 From: Ross Zwisler To: linux-kernel@vger.kernel.org Cc: Ross Zwisler , "Theodore Ts'o" , Alexander Viro , Andreas Dilger , Andrew Morton , Dan Williams , Dave Chinner , Jan Kara , Jens Axboe , Matthew Wilcox , linux-block@vger.kernel.org, linux-ext4@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux-mm@kvack.org, linux-nvdimm@lists.01.org, xfs@oss.sgi.com Subject: [PATCH v4 2/5] ext2, ext4: only set S_DAX for regular inodes Date: Mon, 22 Feb 2016 11:59:19 -0700 X-ASG-Orig-Subj: [PATCH v4 2/5] ext2, ext4: only set S_DAX for regular inodes Message-Id: <1456167562-28576-3-git-send-email-ross.zwisler@linux.intel.com> X-Mailer: git-send-email 2.5.0 In-Reply-To: <1456167562-28576-1-git-send-email-ross.zwisler@linux.intel.com> References: <1456167562-28576-1-git-send-email-ross.zwisler@linux.intel.com> X-Barracuda-Connect: UNKNOWN[192.55.52.93] X-Barracuda-Start-Time: 1456167581 X-Barracuda-URL: https://192.48.176.25:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-BRTS-Status: 1 When S_DAX is set on an inode we assume that if there are pages attached to the mapping (mapping->nrpages != 0), those pages are clean zero pages that were used to service reads from holes. Any dirty data associated with the inode should be in the form of DAX exceptional entries (mapping->nrexceptional) that is written back via dax_writeback_mapping_range(). With the current code, though, this isn't always true. For example, ext2 and ext4 directory inodes can have S_DAX set, but have their dirty data stored as dirty page cache entries. For these types of inodes, having S_DAX set doesn't really make sense since their I/O doesn't actually happen through the DAX code path. Instead, only allow S_DAX to be set for regular inodes for ext2 and ext4. This allows us to have strict DAX vs non-DAX paths in the writeback code. Signed-off-by: Ross Zwisler Reviewed-by: Jan Kara --- fs/ext2/inode.c | 2 +- fs/ext4/inode.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/fs/ext2/inode.c b/fs/ext2/inode.c index 338eefd..27e2cdd 100644 --- a/fs/ext2/inode.c +++ b/fs/ext2/inode.c @@ -1296,7 +1296,7 @@ void ext2_set_inode_flags(struct inode *inode) inode->i_flags |= S_NOATIME; if (flags & EXT2_DIRSYNC_FL) inode->i_flags |= S_DIRSYNC; - if (test_opt(inode->i_sb, DAX)) + if (test_opt(inode->i_sb, DAX) && S_ISREG(inode->i_mode)) inode->i_flags |= S_DAX; } diff --git a/fs/ext4/inode.c b/fs/ext4/inode.c index 9cc57c3..5708e68 100644 --- a/fs/ext4/inode.c +++ b/fs/ext4/inode.c @@ -4155,7 +4155,7 @@ void ext4_set_inode_flags(struct inode *inode) new_fl |= S_NOATIME; if (flags & EXT4_DIRSYNC_FL) new_fl |= S_DIRSYNC; - if (test_opt(inode->i_sb, DAX)) + if (test_opt(inode->i_sb, DAX) && S_ISREG(inode->i_mode)) new_fl |= S_DAX; inode_set_flags(inode, new_fl, S_SYNC|S_APPEND|S_IMMUTABLE|S_NOATIME|S_DIRSYNC|S_DAX); -- 2.5.0 From ross.zwisler@linux.intel.com Mon Feb 22 12:59:55 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=ham version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay1.corp.sgi.com [137.38.102.111]) by oss.sgi.com (Postfix) with ESMTP id AC7197C8C for ; Mon, 22 Feb 2016 12:59:55 -0600 (CST) Received: from cuda.sgi.com (cuda2.sgi.com [192.48.176.25]) by relay1.corp.sgi.com (Postfix) with ESMTP id 7D6598F80B6 for ; Mon, 22 Feb 2016 10:59:43 -0800 (PST) X-ASG-Debug-ID: 1456167579-04cbb06ade9c590004-NocioJ Received: from mga11.intel.com ([192.55.52.93]) by cuda.sgi.com with ESMTP id bLVt5KfwmK1TKOIG for ; Mon, 22 Feb 2016 10:59:42 -0800 (PST) X-Barracuda-Envelope-From: ross.zwisler@linux.intel.com X-Barracuda-Apparent-Source-IP: 192.55.52.93 X-ASG-Whitelist: Client Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by fmsmga102.fm.intel.com with ESMTP; 22 Feb 2016 10:59:43 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.22,485,1449561600"; d="scan'208";a="657296596" Received: from rzwisler-desk.amr.corp.intel.com (HELO phyrexia.intel.com) ([10.254.181.157]) by FMSMGA003.fm.intel.com with ESMTP; 22 Feb 2016 10:59:42 -0800 From: Ross Zwisler To: linux-kernel@vger.kernel.org Cc: Ross Zwisler , "Theodore Ts'o" , Alexander Viro , Andreas Dilger , Andrew Morton , Dan Williams , Dave Chinner , Jan Kara , Jens Axboe , Matthew Wilcox , linux-block@vger.kernel.org, linux-ext4@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux-mm@kvack.org, linux-nvdimm@lists.01.org, xfs@oss.sgi.com Subject: [PATCH v4 3/5] ext4: Online defrag not supported with DAX Date: Mon, 22 Feb 2016 11:59:20 -0700 X-ASG-Orig-Subj: [PATCH v4 3/5] ext4: Online defrag not supported with DAX Message-Id: <1456167562-28576-4-git-send-email-ross.zwisler@linux.intel.com> X-Mailer: git-send-email 2.5.0 In-Reply-To: <1456167562-28576-1-git-send-email-ross.zwisler@linux.intel.com> References: <1456167562-28576-1-git-send-email-ross.zwisler@linux.intel.com> X-Barracuda-Connect: UNKNOWN[192.55.52.93] X-Barracuda-Start-Time: 1456167582 X-Barracuda-URL: https://192.48.176.25:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-BRTS-Status: 1 Online defrag operations for ext4 are hard coded to use the page cache. See ext4_ioctl() -> ext4_move_extents() -> move_extent_per_page() When combined with DAX I/O, which circumvents the page cache, this can result in data corruption. This was observed with xfstests ext4/307 and ext4/308. Fix this by only allowing online defrag for non-DAX files. Signed-off-by: Ross Zwisler Reviewed-by: Jan Kara --- fs/ext4/ioctl.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/fs/ext4/ioctl.c b/fs/ext4/ioctl.c index a99b010..eae5917 100644 --- a/fs/ext4/ioctl.c +++ b/fs/ext4/ioctl.c @@ -583,6 +583,11 @@ group_extend_out: "Online defrag not supported with bigalloc"); err = -EOPNOTSUPP; goto mext_out; + } else if (IS_DAX(inode)) { + ext4_msg(sb, KERN_ERR, + "Online defrag not supported with DAX"); + err = -EOPNOTSUPP; + goto mext_out; } err = mnt_want_write_file(filp); -- 2.5.0 From ross.zwisler@linux.intel.com Mon Feb 22 12:59:55 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=ham version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay1.corp.sgi.com [137.38.102.111]) by oss.sgi.com (Postfix) with ESMTP id E1C987CB1 for ; Mon, 22 Feb 2016 12:59:55 -0600 (CST) Received: from cuda.sgi.com (cuda2.sgi.com [192.48.176.25]) by relay1.corp.sgi.com (Postfix) with ESMTP id A47458F80B7 for ; Mon, 22 Feb 2016 10:59:46 -0800 (PST) X-ASG-Debug-ID: 1456167579-04cbb06ade9c590006-NocioJ Received: from mga11.intel.com ([192.55.52.93]) by cuda.sgi.com with ESMTP id tvn1piJTiLAhBE7P for ; Mon, 22 Feb 2016 10:59:45 -0800 (PST) X-Barracuda-Envelope-From: ross.zwisler@linux.intel.com X-Barracuda-Apparent-Source-IP: 192.55.52.93 X-ASG-Whitelist: Client Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by fmsmga102.fm.intel.com with ESMTP; 22 Feb 2016 10:59:46 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.22,485,1449561600"; d="scan'208";a="657296624" Received: from rzwisler-desk.amr.corp.intel.com (HELO phyrexia.intel.com) ([10.254.181.157]) by FMSMGA003.fm.intel.com with ESMTP; 22 Feb 2016 10:59:44 -0800 From: Ross Zwisler To: linux-kernel@vger.kernel.org Cc: Ross Zwisler , "Theodore Ts'o" , Alexander Viro , Andreas Dilger , Andrew Morton , Dan Williams , Dave Chinner , Jan Kara , Jens Axboe , Matthew Wilcox , linux-block@vger.kernel.org, linux-ext4@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux-mm@kvack.org, linux-nvdimm@lists.01.org, xfs@oss.sgi.com, Jan Kara Subject: [PATCH v4 5/5] dax: move writeback calls into the filesystems Date: Mon, 22 Feb 2016 11:59:22 -0700 X-ASG-Orig-Subj: [PATCH v4 5/5] dax: move writeback calls into the filesystems Message-Id: <1456167562-28576-6-git-send-email-ross.zwisler@linux.intel.com> X-Mailer: git-send-email 2.5.0 In-Reply-To: <1456167562-28576-1-git-send-email-ross.zwisler@linux.intel.com> References: <1456167562-28576-1-git-send-email-ross.zwisler@linux.intel.com> X-Barracuda-Connect: UNKNOWN[192.55.52.93] X-Barracuda-Start-Time: 1456167584 X-Barracuda-URL: https://192.48.176.25:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-BRTS-Status: 1 Previously calls to dax_writeback_mapping_range() for all DAX filesystems (ext2, ext4 & xfs) were centralized in filemap_write_and_wait_range(). dax_writeback_mapping_range() needs a struct block_device, and it used to get that from inode->i_sb->s_bdev. This is correct for normal inodes mounted on ext2, ext4 and XFS filesystems, but is incorrect for DAX raw block devices and for XFS real-time files. Instead, call dax_writeback_mapping_range() directly from the filesystem ->writepages function so that it can supply us with a valid block device. This also fixes DAX code to properly flush caches in response to sync(2). Signed-off-by: Ross Zwisler Signed-off-by: Jan Kara --- fs/block_dev.c | 13 ++++++++++++- fs/dax.c | 12 +++++++----- fs/ext2/inode.c | 8 ++++++++ fs/ext4/inode.c | 4 ++++ fs/xfs/xfs_aops.c | 4 ++++ include/linux/dax.h | 6 ++++-- mm/filemap.c | 12 ++++-------- 7 files changed, 43 insertions(+), 16 deletions(-) diff --git a/fs/block_dev.c b/fs/block_dev.c index 31c6d10..826b164 100644 --- a/fs/block_dev.c +++ b/fs/block_dev.c @@ -1697,13 +1697,24 @@ static int blkdev_releasepage(struct page *page, gfp_t wait) return try_to_free_buffers(page); } +static int blkdev_writepages(struct address_space *mapping, + struct writeback_control *wbc) +{ + if (dax_mapping(mapping)) { + struct block_device *bdev = I_BDEV(mapping->host); + + return dax_writeback_mapping_range(mapping, bdev, wbc); + } + return generic_writepages(mapping, wbc); +} + static const struct address_space_operations def_blk_aops = { .readpage = blkdev_readpage, .readpages = blkdev_readpages, .writepage = blkdev_writepage, .write_begin = blkdev_write_begin, .write_end = blkdev_write_end, - .writepages = generic_writepages, + .writepages = blkdev_writepages, .releasepage = blkdev_releasepage, .direct_IO = blkdev_direct_IO, .is_dirty_writeback = buffer_check_dirty_writeback, diff --git a/fs/dax.c b/fs/dax.c index 9a173dd..7111724 100644 --- a/fs/dax.c +++ b/fs/dax.c @@ -484,11 +484,10 @@ static int dax_writeback_one(struct block_device *bdev, * end]. This is required by data integrity operations to ensure file data is * on persistent storage prior to completion of the operation. */ -int dax_writeback_mapping_range(struct address_space *mapping, loff_t start, - loff_t end) +int dax_writeback_mapping_range(struct address_space *mapping, + struct block_device *bdev, struct writeback_control *wbc) { struct inode *inode = mapping->host; - struct block_device *bdev = inode->i_sb->s_bdev; pgoff_t start_index, end_index, pmd_index; pgoff_t indices[PAGEVEC_SIZE]; struct pagevec pvec; @@ -499,8 +498,11 @@ int dax_writeback_mapping_range(struct address_space *mapping, loff_t start, if (WARN_ON_ONCE(inode->i_blkbits != PAGE_SHIFT)) return -EIO; - start_index = start >> PAGE_CACHE_SHIFT; - end_index = end >> PAGE_CACHE_SHIFT; + if (!mapping->nrexceptional || wbc->sync_mode != WB_SYNC_ALL) + return 0; + + start_index = wbc->range_start >> PAGE_CACHE_SHIFT; + end_index = wbc->range_end >> PAGE_CACHE_SHIFT; pmd_index = DAX_PMD_INDEX(start_index); rcu_read_lock(); diff --git a/fs/ext2/inode.c b/fs/ext2/inode.c index 4467cbd..6bd58e6 100644 --- a/fs/ext2/inode.c +++ b/fs/ext2/inode.c @@ -876,6 +876,14 @@ ext2_direct_IO(struct kiocb *iocb, struct iov_iter *iter, loff_t offset) static int ext2_writepages(struct address_space *mapping, struct writeback_control *wbc) { +#ifdef CONFIG_FS_DAX + if (dax_mapping(mapping)) { + return dax_writeback_mapping_range(mapping, + mapping->host->i_sb->s_bdev, + wbc); + } +#endif + return mpage_writepages(mapping, wbc, ext2_get_block); } diff --git a/fs/ext4/inode.c b/fs/ext4/inode.c index 5708e68..aee960b 100644 --- a/fs/ext4/inode.c +++ b/fs/ext4/inode.c @@ -2478,6 +2478,10 @@ static int ext4_writepages(struct address_space *mapping, trace_ext4_writepages(inode, wbc); + if (dax_mapping(mapping)) + return dax_writeback_mapping_range(mapping, inode->i_sb->s_bdev, + wbc); + /* * No pages to write? This is mainly a kludge to avoid starting * a transaction for special inodes like journal inode on last iput() diff --git a/fs/xfs/xfs_aops.c b/fs/xfs/xfs_aops.c index fc20518..a9ebabfe 100644 --- a/fs/xfs/xfs_aops.c +++ b/fs/xfs/xfs_aops.c @@ -1208,6 +1208,10 @@ xfs_vm_writepages( struct writeback_control *wbc) { xfs_iflags_clear(XFS_I(mapping->host), XFS_ITRUNCATED); + if (dax_mapping(mapping)) + return dax_writeback_mapping_range(mapping, + xfs_find_bdev_for_inode(mapping->host), wbc); + return generic_writepages(mapping, wbc); } diff --git a/include/linux/dax.h b/include/linux/dax.h index 7b6bced..636dd59 100644 --- a/include/linux/dax.h +++ b/include/linux/dax.h @@ -52,6 +52,8 @@ static inline bool dax_mapping(struct address_space *mapping) { return mapping->host && IS_DAX(mapping->host); } -int dax_writeback_mapping_range(struct address_space *mapping, loff_t start, - loff_t end); + +struct writeback_control; +int dax_writeback_mapping_range(struct address_space *mapping, + struct block_device *bdev, struct writeback_control *wbc); #endif diff --git a/mm/filemap.c b/mm/filemap.c index 23edcce..3461d97 100644 --- a/mm/filemap.c +++ b/mm/filemap.c @@ -446,7 +446,8 @@ int filemap_write_and_wait(struct address_space *mapping) { int err = 0; - if (mapping->nrpages) { + if ((!dax_mapping(mapping) && mapping->nrpages) || + (dax_mapping(mapping) && mapping->nrexceptional)) { err = filemap_fdatawrite(mapping); /* * Even if the above returned error, the pages may be @@ -482,13 +483,8 @@ int filemap_write_and_wait_range(struct address_space *mapping, { int err = 0; - if (dax_mapping(mapping) && mapping->nrexceptional) { - err = dax_writeback_mapping_range(mapping, lstart, lend); - if (err) - return err; - } - - if (mapping->nrpages) { + if ((!dax_mapping(mapping) && mapping->nrpages) || + (dax_mapping(mapping) && mapping->nrexceptional)) { err = __filemap_fdatawrite_range(mapping, lstart, lend, WB_SYNC_ALL); /* See comment of filemap_write_and_wait() */ -- 2.5.0 From david@fromorbit.com Mon Feb 22 15:15:57 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=ham version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay1.corp.sgi.com [137.38.102.111]) by oss.sgi.com (Postfix) with ESMTP id 8B02D7F6C for ; Mon, 22 Feb 2016 15:15:57 -0600 (CST) Received: from cuda.sgi.com (cuda2.sgi.com [192.48.176.25]) by relay1.corp.sgi.com (Postfix) with ESMTP id 4FCC88F8040 for ; Mon, 22 Feb 2016 13:15:51 -0800 (PST) X-ASG-Debug-ID: 1456175741-04cbb06ae0a1320001-NocioJ Received: from ipmail04.adl6.internode.on.net (ipmail04.adl6.internode.on.net [150.101.137.141]) by cuda.sgi.com with ESMTP id YG7Sc4gacrMif6lc for ; Mon, 22 Feb 2016 13:15:42 -0800 (PST) X-Barracuda-Envelope-From: david@fromorbit.com X-Barracuda-Apparent-Source-IP: 150.101.137.141 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: A2DCBwCwectW/5bY03ZegzqBP4JppBQBAQEGi3OFSIQHhgcEAgKBQ00BAQEBAQFlJ4RCAQEEOhwjEAgDDgoJJQ8FJQMhE4gauXgBAQgCHhiFMoUChCOETAWNKoldjVWOfESOBWKDeCguiDkBAQE Received: from ppp118-211-216-150.lns20.syd4.internode.on.net (HELO dastard) ([118.211.216.150]) by ipmail04.adl6.internode.on.net with ESMTP; 23 Feb 2016 07:44:11 +1030 Received: from dave by dastard with local (Exim 4.80) (envelope-from ) id 1aXxo2-0000zu-SN; Tue, 23 Feb 2016 08:14:10 +1100 Date: Tue, 23 Feb 2016 08:14:10 +1100 From: Dave Chinner To: Christoph Hellwig Cc: Brian Foster , xfs@oss.sgi.com Subject: Re: [PATCH 2/3] xfs: better xfs_trans_alloc interface Message-ID: <20160222211410.GH25832@dastard> X-ASG-Orig-Subj: Re: [PATCH 2/3] xfs: better xfs_trans_alloc interface References: <1455699159-20906-1-git-send-email-hch@lst.de> <1455699159-20906-2-git-send-email-hch@lst.de> <20160217134006.GA4065@bfoster.bfoster> <20160217220436.GI19486@dastard> <20160222133943.GA26966@lst.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20160222133943.GA26966@lst.de> User-Agent: Mutt/1.5.21 (2010-09-15) X-Barracuda-Connect: ipmail04.adl6.internode.on.net[150.101.137.141] X-Barracuda-Start-Time: 1456175742 X-Barracuda-URL: https://192.48.176.25:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-BRTS-Status: 1 X-Barracuda-Spam-Score: 0.00 X-Barracuda-Spam-Status: No, SCORE=0.00 using per-user scores of TAG_LEVEL=1000.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.7 tests=BSF_SC0_MISMATCH_TO X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.3.27247 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 0.00 BSF_SC0_MISMATCH_TO Envelope rcpt doesn't match header On Mon, Feb 22, 2016 at 02:39:43PM +0100, Christoph Hellwig wrote: > On Thu, Feb 18, 2016 at 09:04:36AM +1100, Dave Chinner wrote: > > I've considered doing this removal myself in the past - doing > > somethign like embedding the return address of the > > xfs-trans_reserve() call in the ticket that is allocated tells us > > exactly where the call was made. This can be printed with %pS, and > > that gives us the function (and location in the function) the > > reservation was made. Hence we solve the problem of not > > knowing which call path triggered the problem. > > > > Hence I don't think we actually need to the type in every function > > call. > > This brings up a question: do we care about the type of the transaction, > or the caller? The existing types were rather confused about that. > If it's the transaction type we could simply add a name field to > struct xfs_trans_res, if we care about caller the trick from Dave > should do the job. I think the caller is more important, because that gives us the entire context of the transaction. We reuse the same transaction type in several different places, so it can be ambiguous if we only have a transaction type in an error message at commit and nothing else... Cheers, Dave. -- Dave Chinner david@fromorbit.com From david@fromorbit.com Mon Feb 22 15:20:46 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=ham version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay1.corp.sgi.com [137.38.102.111]) by oss.sgi.com (Postfix) with ESMTP id 7BE487F74 for ; Mon, 22 Feb 2016 15:20:46 -0600 (CST) Received: from cuda.sgi.com (cuda1.sgi.com [192.48.157.11]) by relay1.corp.sgi.com (Postfix) with ESMTP id 349E18F8050 for ; Mon, 22 Feb 2016 13:20:40 -0800 (PST) X-ASG-Debug-ID: 1456176030-04bdf07ab4d15b0001-NocioJ Received: from ipmail04.adl6.internode.on.net (ipmail04.adl6.internode.on.net [150.101.137.141]) by cuda.sgi.com with ESMTP id OqjLxIImxjzvJuhc for ; Mon, 22 Feb 2016 13:20:31 -0800 (PST) X-Barracuda-Envelope-From: david@fromorbit.com X-Barracuda-Apparent-Source-IP: 150.101.137.141 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: A2AVCADiestW/5bY03ZegzpSbYJppBQBAQEGi3OJTyGFZgICAQECgUNNAQEBAQEBZSeEQQEBAQMBIw8BIyMFCwgDGAICBSECAg8FJQMhE4gTBw+rCo5mAQEIAgEdGGOET4UCgleEXoE6BZcHhVeHfo58jklig3goLgGIOAEBAQ Received: from ppp118-211-216-150.lns20.syd4.internode.on.net (HELO dastard) ([118.211.216.150]) by ipmail04.adl6.internode.on.net with ESMTP; 23 Feb 2016 07:50:30 +1030 Received: from dave by dastard with local (Exim 4.80) (envelope-from ) id 1aXxtz-000115-Vu; Tue, 23 Feb 2016 08:20:20 +1100 Date: Tue, 23 Feb 2016 08:20:19 +1100 From: Dave Chinner To: Alex Lyakas Cc: xfs@oss.sgi.com, hch@infradead.org, Danny Shavit Subject: Re: xfs resize: primary superblock is not updated immediately Message-ID: <20160222212019.GI25832@dastard> X-ASG-Orig-Subj: Re: xfs resize: primary superblock is not updated immediately References: <3685DFAD20214109878873CF81232704@alyakaslap> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <3685DFAD20214109878873CF81232704@alyakaslap> User-Agent: Mutt/1.5.21 (2010-09-15) X-Barracuda-Connect: ipmail04.adl6.internode.on.net[150.101.137.141] X-Barracuda-Start-Time: 1456176030 X-Barracuda-URL: https://192.48.157.11:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-BRTS-Status: 1 X-Barracuda-Spam-Score: 0.00 X-Barracuda-Spam-Status: No, SCORE=0.00 using per-user scores of TAG_LEVEL=1000.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.7 tests=BSF_SC0_MISMATCH_TO X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.3.27247 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 0.00 BSF_SC0_MISMATCH_TO Envelope rcpt doesn't match header On Mon, Feb 22, 2016 at 09:08:06PM +0200, Alex Lyakas wrote: > Greetings XFS developers, > > I am seeing the following issue with XFS on kernel 3.18.19. > > When resizing, XFS adds new AGs and eventually updates the primary > superblock with the new “sb_agcount” value. However, it happens few > seconds after the resize operation completes back to user-space. As > a result, if a block-level snapshot is taken off the underlying > block device, while “sb_agcount” still has the old value, then > subsequent XFS mount crashes with stack like[1]. The primary superblock change is logged, so it doesn't need to be written back immediately. That means it is in the journal... > Some debugging shows that _xfs_buf_find is called with agno that has > been added during the resize, but appropriate "pag" has not been > created for this agno during mount. The new per-ag structures are created during growfs, after the growfs transaction has committed. if you are mounting a snapshot that has the wrong agcount in it, then lots of things will go wrong if there is metadata that already uses the expanded space. > I have found the patch by Christoph Hellwig: > http://oss.sgi.com/archives/xfs/2015-01/msg00391.html > which sets the resize transaction to be synchronous, and applied it, > but it still doesn’t help. > > Right after the resize completes, I am issuing: > xfs_db -r -c "sb 0" -c "p" > and for a few seconds still get the old value of “sb_agcount”. > > Can anybody advise what am I missing? What needs to be done so that > the primary superblock will get the new value of “sb_agount” > promptly? Are you freezing the filesystem before taking a block level snapshot? Cheers, Dave. -- Dave Chinner david@fromorbit.com From david@fromorbit.com Mon Feb 22 15:58:12 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=ham version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay1.corp.sgi.com [137.38.102.111]) by oss.sgi.com (Postfix) with ESMTP id B00A17F7B for ; Mon, 22 Feb 2016 15:58:12 -0600 (CST) Received: from cuda.sgi.com (cuda2.sgi.com [192.48.176.25]) by relay1.corp.sgi.com (Postfix) with ESMTP id 6D5628F8035 for ; Mon, 22 Feb 2016 13:58:06 -0800 (PST) X-ASG-Debug-ID: 1456178283-04cbb06ae0a2870001-NocioJ Received: from ipmail04.adl6.internode.on.net (ipmail04.adl6.internode.on.net [150.101.137.141]) by cuda.sgi.com with ESMTP id vucBqf5BJ8luD2Eg for ; Mon, 22 Feb 2016 13:58:03 -0800 (PST) X-Barracuda-Envelope-From: david@fromorbit.com X-Barracuda-Apparent-Source-IP: 150.101.137.141 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: A2ARCAA5g8tW/5bY03ZegzqBP4JppBQBAQEGi3OJT4YHAgIBAQKBQ00BAQEBAQFlJ4RCAQEEOhwjEAgDDgoJJQ8FJQMhE4gaug0BAQgCAR0YhTKFAoQmhEkFh1OFV4ExhBiEFI1VgWWNF4VyiFdiggMZgVwoLocBgTgBAQE Received: from ppp118-211-216-150.lns20.syd4.internode.on.net (HELO dastard) ([118.211.216.150]) by ipmail04.adl6.internode.on.net with ESMTP; 23 Feb 2016 08:28:02 +1030 Received: from dave by dastard with local (Exim 4.80) (envelope-from ) id 1aXyUT-000170-Ax; Tue, 23 Feb 2016 08:58:01 +1100 Date: Tue, 23 Feb 2016 08:58:01 +1100 From: Dave Chinner To: Eryu Guan Cc: fstests@vger.kernel.org, xfs@oss.sgi.com Subject: Re: xfstests configure error with xfsprogs v4.5-rc1 Message-ID: <20160222215801.GG14668@dastard> X-ASG-Orig-Subj: Re: xfstests configure error with xfsprogs v4.5-rc1 References: <20160222030304.GV11419@eguan.usersys.redhat.com> <20160222032450.GF14668@dastard> <20160222101648.GX11419@eguan.usersys.redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20160222101648.GX11419@eguan.usersys.redhat.com> User-Agent: Mutt/1.5.21 (2010-09-15) X-Barracuda-Connect: ipmail04.adl6.internode.on.net[150.101.137.141] X-Barracuda-Start-Time: 1456178283 X-Barracuda-URL: https://192.48.176.25:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-BRTS-Status: 1 X-Barracuda-Spam-Score: 0.00 X-Barracuda-Spam-Status: No, SCORE=0.00 using per-user scores of TAG_LEVEL=1000.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.7 tests=BSF_SC0_MISMATCH_TO X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.3.27248 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 0.00 BSF_SC0_MISMATCH_TO Envelope rcpt doesn't match header On Mon, Feb 22, 2016 at 06:16:48PM +0800, Eryu Guan wrote: > On Mon, Feb 22, 2016 at 02:24:50PM +1100, Dave Chinner wrote: > > On Mon, Feb 22, 2016 at 11:03:04AM +0800, Eryu Guan wrote: > > > Hi, > > > > > > After upgrading to xfsprogs v4.5-rc1 version, xfstests failed to built > > > because of configure error: > > > > > > checking xfs/xfs.h usability... no > > > checking xfs/xfs.h presence... yes > > > configure: WARNING: xfs/xfs.h: present but cannot be compiled > > > configure: WARNING: xfs/xfs.h: check for missing prerequisite headers? > > > configure: WARNING: xfs/xfs.h: see the Autoconf documentation > > > configure: WARNING: xfs/xfs.h: section "Present But Cannot Be Compiled" > > > configure: WARNING: xfs/xfs.h: proceeding with the compiler's result > > > checking for xfs/xfs.h... no > > > > > > FATAL ERROR: cannot find a valid header file. > > > Run "make install-qa" from the xfsprogs source. > > > > > > and config.log showed: > > > > > > configure:4543: checking xfs/xfs.h usability > > > configure:4543: ccache gcc -c -g -O2 conftest.c >&5 > > > In file included from /usr/include/xfs/xfs.h:37:0, > > > from conftest.c:73: > > > /usr/include/xfs/linux.h:145:1: error: unknown type name 'off64_t' > > > typedef off64_t xfs_off_t; > > > ^ > > > configure:4543: $? = 1 > > > > That would seem like a system library problem in that it doesn't > > define off64_t through stdio.h. What distro are you compiling on? > > Also, if you set _GNU_SOURCE, does it then compile? e.g. see > > m4/package_libcdev.m4 for how to test whether code compiles under > > certain defines. > > > > If it does compile with _GNU_SOURCE being set, then all that needs > > to be is to update the autoconf rule. > > Yes, it compiles with _GNU_SOURCE being set. And it turns out that not > only the check for xfs.h needs _GNU_SOURCE, many other checks need it > too, like libxfs.h, xfs_log_format.h, xlog_assign_lsn, xqm.h and xfsctl. > > Attached file is updates I made to autoconf rules, as I'm not familiar > with autotools, I'm not sure if it's a proper fix, but it does work for > me, with both old and new version of xfsprogs. Yup, works here too, and is cleaner than the hack I did late yesterday afternoon. Thanks, Eryu! Cheers, Dave. -- Dave Chinner david@fromorbit.com From alex@zadarastorage.com Mon Feb 22 16:49:29 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=T_DKIM_INVALID autolearn=ham version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay1.corp.sgi.com [137.38.102.111]) by oss.sgi.com (Postfix) with ESMTP id 80B727F7B for ; Mon, 22 Feb 2016 16:49:29 -0600 (CST) Received: from cuda.sgi.com (cuda2.sgi.com [192.48.176.25]) by relay1.corp.sgi.com (Postfix) with ESMTP id 4F6608F8039 for ; Mon, 22 Feb 2016 14:49:23 -0800 (PST) X-ASG-Debug-ID: 1456180729-04cbb06adea3bc0001-NocioJ Received: from mail-yw0-f175.google.com (mail-yw0-f175.google.com [209.85.161.175]) by cuda.sgi.com with ESMTP id kd8m45N29bhHR8fX (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128 verify=NO) for ; Mon, 22 Feb 2016 14:38:49 -0800 (PST) X-Barracuda-Envelope-From: alex@zadarastorage.com X-Barracuda-Apparent-Source-IP: 209.85.161.175 Received: by mail-yw0-f175.google.com with SMTP id h129so131913224ywb.1 for ; Mon, 22 Feb 2016 14:38:49 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=zadarastorage-com.20150623.gappssmtp.com; s=20150623; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type:content-transfer-encoding; bh=6jDAselfJkHYQOIEJb/uvFnMXz/aChkOemysMMGqAjc=; b=QbHEF1entScKqfsUY+9HGCigKPRRJDjVNH6T2AsCEnanxdtPftkx9PpEkKJcrNOhtk tWVO1b88UYRJzecZ7L1/MVumQCJJDQuknJJGPo26mwk9WRrRw2TwhVH/ukn4uFQ0tKTc tC+qpH9fAqdGcsZbiD5TTfzsBDdBz9jntTApXgTFB+4j03YbQkusuypjY/xbgNW8+SAO Ro2/PkcoXSDivDkpRtU0DmKtEF0qG8tLRD1wHpzbWz2MKhAs0AiIN7vsmyoyXGJsktg6 Je+N4/j9W/o9AaHuLiMXCTw9hJK0wVJOhDni5aSCY9PDM1IKvpkNiU33BdA0AZEXDMHh cVdQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:date :message-id:subject:from:to:cc:content-type :content-transfer-encoding; bh=6jDAselfJkHYQOIEJb/uvFnMXz/aChkOemysMMGqAjc=; b=bfnTknajGXeC4+JugfLGEidRLZa/TwwrP/gMn7c6etEy4nfeD8DdfTsP0o44oTyL3T t8G7VkUydExJiVbeFJOGrhZZ4FSt0044FZq+E45rFD+XvNm+pTldBH1zCiaV2zISrbdr 1gZO8NdW9X1TccrARSlGUda56mM57Q3NqWg8bEWme923BdhtLuK54TZ7p3gL8wwLmCMe 5WHJ8QCcbmSvJcL16ABgYnL9AsE5d1YEEBJMqdPKUE0n3DML6Anw2509syyIS7HiQJk7 MiUMoBY5G/ChpiCgWqlq/9XwpokRbB5O0N9boGMiOG3myWOAbA9hW/BI4jvgeHAhZ0U9 8mxw== X-Gm-Message-State: AG10YOS66bQ/ig8jgZqxTKidq8Y3BodfY8c2dpllpOefS2ClqWiRCsZZ4t50kuDh11k+E7zYdImTaYRgF4YHKg== MIME-Version: 1.0 X-Received: by 10.13.253.198 with SMTP id n189mr16842519ywf.46.1456180728943; Mon, 22 Feb 2016 14:38:48 -0800 (PST) Received: by 10.37.19.6 with HTTP; Mon, 22 Feb 2016 14:38:48 -0800 (PST) In-Reply-To: <20160222212019.GI25832@dastard> References: <3685DFAD20214109878873CF81232704@alyakaslap> <20160222212019.GI25832@dastard> Date: Tue, 23 Feb 2016 00:38:48 +0200 Message-ID: Subject: Re: xfs resize: primary superblock is not updated immediately From: Alex Lyakas X-ASG-Orig-Subj: Re: xfs resize: primary superblock is not updated immediately To: Dave Chinner Cc: xfs@oss.sgi.com, Christoph Hellwig , Danny Shavit Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-Barracuda-Connect: mail-yw0-f175.google.com[209.85.161.175] X-Barracuda-Start-Time: 1456180729 X-Barracuda-Encrypted: ECDHE-RSA-AES128-GCM-SHA256 X-Barracuda-URL: https://192.48.176.25:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-BRTS-Status: 1 X-Barracuda-Spam-Score: 0.00 X-Barracuda-Spam-Status: No, SCORE=0.00 using per-user scores of TAG_LEVEL=1000.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.7 tests=BSF_SC0_MISMATCH_TO, DKIM_SIGNED, DKIM_VERIFIED X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.3.27249 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 0.00 BSF_SC0_MISMATCH_TO Envelope rcpt doesn't match header -0.00 DKIM_VERIFIED Domain Keys Identified Mail: signature passes verification 0.00 DKIM_SIGNED Domain Keys Identified Mail: message has a signature Hi Dave, Thanks for your response. I am not freezing the filesystem before the snapshot. However, let's assume that somebody resized the XFS, and it completed and got back to user-space. At this moment the primary superblock on-disk is not updated yet with the new agcount. And at this same moment there is a power-out. After the power comes back and the machine boots, if we mount the XFS, the same problem would happen, I believe. Because the primary superblock on-disk still has old agcount. So the in-memory pag structures will not be created for the new AGs during mount, but replaying the log might try to use them. Taking a block-level snapshot is exactly like a power-out from XFS perspective. And XFS should, in principle, be able to recover from that. The snapshot will come up as a new block device, which exhibits identical content as the original block device had at the moment when the snapshot was taken (like a boot after power-out). I will try to reproduce the problem by crashing the machine at the problematic moment, when the primary on-disk superblock still has the old value. Without the snapshot thing. Thanks, Alex. On Mon, Feb 22, 2016 at 11:20 PM, Dave Chinner wrote: > On Mon, Feb 22, 2016 at 09:08:06PM +0200, Alex Lyakas wrote: >> Greetings XFS developers, >> >> I am seeing the following issue with XFS on kernel 3.18.19. >> >> When resizing, XFS adds new AGs and eventually updates the primary >> superblock with the new =E2=80=9Csb_agcount=E2=80=9D value. However, it = happens few >> seconds after the resize operation completes back to user-space. As >> a result, if a block-level snapshot is taken off the underlying >> block device, while =E2=80=9Csb_agcount=E2=80=9D still has the old value= , then >> subsequent XFS mount crashes with stack like[1]. > > The primary superblock change is logged, so it doesn't need to be > written back immediately. That means it is in the journal... > >> Some debugging shows that _xfs_buf_find is called with agno that has >> been added during the resize, but appropriate "pag" has not been >> created for this agno during mount. > > The new per-ag structures are created during growfs, after the > growfs transaction has committed. if you are mounting a snapshot > that has the wrong agcount in it, then lots of things will go wrong > if there is metadata that already uses the expanded space. > >> I have found the patch by Christoph Hellwig: >> http://oss.sgi.com/archives/xfs/2015-01/msg00391.html >> which sets the resize transaction to be synchronous, and applied it, >> but it still doesn=E2=80=99t help. >> >> Right after the resize completes, I am issuing: >> xfs_db -r -c "sb 0" -c "p" >> and for a few seconds still get the old value of =E2=80=9Csb_agcount=E2= =80=9D. >> >> Can anybody advise what am I missing? What needs to be done so that >> the primary superblock will get the new value of =E2=80=9Csb_agount=E2= =80=9D >> promptly? > > Are you freezing the filesystem before taking a block level > snapshot? > > Cheers, > > Dave. > -- > Dave Chinner > david@fromorbit.com

    This email has been sent from a virus-free computer protected by Avast.
    www.avast.com
    From david@fromorbit.com Mon Feb 22 17:56:47 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=ham version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay2.corp.sgi.com [137.38.102.29]) by oss.sgi.com (Postfix) with ESMTP id 755DB7F6F for ; Mon, 22 Feb 2016 17:56:47 -0600 (CST) Received: from cuda.sgi.com (cuda1.sgi.com [192.48.157.11]) by relay2.corp.sgi.com (Postfix) with ESMTP id 17EC0304039 for ; Mon, 22 Feb 2016 15:56:41 -0800 (PST) X-ASG-Debug-ID: 1456185390-04bdf07ab5d9580001-NocioJ Received: from ipmail04.adl6.internode.on.net (ipmail04.adl6.internode.on.net [150.101.137.141]) by cuda.sgi.com with ESMTP id Shgu3E1NaK0CsC3q for ; Mon, 22 Feb 2016 15:56:31 -0800 (PST) X-Barracuda-Envelope-From: david@fromorbit.com X-Barracuda-Apparent-Source-IP: 150.101.137.141 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: A2CxBgBtn8tW/5bY03ZegzqBP4JppBEBAQEBAQEGi3OJT4YHBAICgUJNAQEBAQEBZSeEQQEBAQMBOhweBQULCAMYCSUPBSUDIROIEwe6OAEBCAIeGIUyhQKEGQaEUAWXB41VgWWHaIUthXKIV2KDeCguhwCBOQEBAQ Received: from ppp118-211-216-150.lns20.syd4.internode.on.net (HELO dastard) ([118.211.216.150]) by ipmail04.adl6.internode.on.net with ESMTP; 23 Feb 2016 10:26:30 +1030 Received: from dave by dastard with local (Exim 4.80) (envelope-from ) id 1aY0L6-0001Ox-S3; Tue, 23 Feb 2016 10:56:28 +1100 Date: Tue, 23 Feb 2016 10:56:28 +1100 From: Dave Chinner To: Alex Lyakas Cc: xfs@oss.sgi.com, Christoph Hellwig , Danny Shavit Subject: Re: xfs resize: primary superblock is not updated immediately Message-ID: <20160222235628.GK25832@dastard> X-ASG-Orig-Subj: Re: xfs resize: primary superblock is not updated immediately References: <3685DFAD20214109878873CF81232704@alyakaslap> <20160222212019.GI25832@dastard> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.21 (2010-09-15) X-Barracuda-Connect: ipmail04.adl6.internode.on.net[150.101.137.141] X-Barracuda-Start-Time: 1456185390 X-Barracuda-URL: https://192.48.157.11:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-BRTS-Status: 1 X-Barracuda-Spam-Score: 0.00 X-Barracuda-Spam-Status: No, SCORE=0.00 using per-user scores of TAG_LEVEL=1000.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.7 tests=BSF_SC0_MISMATCH_TO X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.3.27251 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 0.00 BSF_SC0_MISMATCH_TO Envelope rcpt doesn't match header On Tue, Feb 23, 2016 at 12:38:48AM +0200, Alex Lyakas wrote: > Hi Dave, > Thanks for your response. > > I am not freezing the filesystem before the snapshot. There's your problem. A mounted filesystem is not consistent on disk without flushing the entire journal and all the dirty metadata to disk. > However, let's assume that somebody resized the XFS, and it completed > and got back to user-space. At this moment the primary superblock > on-disk is not updated yet with the new agcount. And at this same > moment there is a power-out. After the power comes back and the > machine boots, if we mount the XFS, the same problem would happen, I > believe. Log recovery will run and update the superblock buffer with the correct values. But the in-memory superblock that log recoery is working with does not change, and so if there were accesses beyond the current superblock ag/block count you'd see messages like this: XFS (sda1): _xfs_buf_find: Block out of range: block 0xnnnnn EOFS 0xmmmmm and log recovery should fail at that point because it can't pull in a buffer it needs for recovery to make further progress. At which point, you have an unmountable filesystem. If log recovery succeeds, then yes, I can see that there is a problem here because the per-ag tree is not reinitialised after the superblock is re-read. That's a pretty easy fix, though (3-4 lines of code in xlog_do_recover() to detect a change in filesystem block count and call xfs_initialize_perag() again. > Taking a block-level snapshot is exactly like a power-out from XFS > perspective. It's similar, but it's not the same. e.g. there are no issues like volatile storage cache loss that have to be handled. > And XFS should, in principle, be able to recover from > that. For some definition of recover. There is no guarantee that any of the async transactions in memory will make it to disk, so the point to which XFS can recover is undefined. > The snapshot will come up as a new block device, which exhibits > identical content as the original block device had at the moment when > the snapshot was taken (like a boot after power-out). The block device might be identical, but it's not identical to what the filesystem is presenting the user. Any user dirty data cached in memory, or metadata changes staged in the CIL will not be in the snapshot. Hence the snapshot block device is not identical to the original user visible state and data. You only get that if you freeze the filesystem before taking the snapshot. Cheers, Dave. -- Dave Chinner david@fromorbit.com From sale11@waimaosou.com Mon Feb 22 20:17:37 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=ham version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay3.corp.sgi.com [198.149.34.15]) by oss.sgi.com (Postfix) with ESMTP id 44C007F7D for ; Mon, 22 Feb 2016 20:17:37 -0600 (CST) Received: from cuda.sgi.com (cuda3.sgi.com [192.48.176.15]) by relay3.corp.sgi.com (Postfix) with ESMTP id B60DFAC001 for ; Mon, 22 Feb 2016 18:17:30 -0800 (PST) X-ASG-Debug-ID: 1456192965-04cb6c7007016f0001-NocioJ Received: from mx404.newsletter.trustmta.com (mx404.newsletter.trustmta.com [122.115.60.101]) by cuda.sgi.com with ESMTP id HHoZkYlHEIY8FrB5 for ; Mon, 22 Feb 2016 18:02:47 -0800 (PST) X-Barracuda-Envelope-From: sale11@waimaosou.com X-Barracuda-Apparent-Source-IP: 122.115.60.101 X-MessageId: 1483507-660705 X-Prifocus: 0 MIME-Version: 1.0 From: =?utf-8?B?5aSW6LS45pCc?= To: xfs@oss.sgi.com Reply-To: sale11@waimaosou.com Date: 23 Feb 2016 10:02:23 +0800 Subject: =?utf-8?B?6Ie0Onhmcyzop6PlhrPkuJrliqHlkZjjgJDmkJzntKLjgJHpgYfliLDnmoTlkITnp43pl67popg=?= Content-Type: text/plain; charset=utf-8 X-ASG-Orig-Subj: =?utf-8?B?6Ie0Onhmcyzop6PlhrPkuJrliqHlkZjjgJDmkJzntKLjgJHpgYfliLDnmoTlkITnp43pl67popg=?= Content-Transfer-Encoding: base64 X-Barracuda-Connect: mx404.newsletter.trustmta.com[122.115.60.101] X-Barracuda-Start-Time: 1456192966 X-Barracuda-URL: https://192.48.176.15:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-BRTS-Status: 1 X-Barracuda-Spam-Score: 0.14 X-Barracuda-Spam-Status: No, SCORE=0.14 using per-user scores of TAG_LEVEL=1000.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.7 tests=BSF_SC0_MV0113c, MISSING_MID X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.3.27254 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 0.14 MISSING_MID Missing Message-Id: header 0.00 BSF_SC0_MV0113c BSF_SC0_MV0113c Message-Id: <20160223020302.CD4AA1296086@cuda.sgi.com> 5bCK5pWs55qEeGZz77yM5oKo5aW977yBDQoNCuaWsOeahOS4gOW5tOW3sue7j+W8gOWni++8 jOOAkOWklui0uOaQnOOAkeeUqOaegeWFtuS4k+S4mueahOezu+e7n++8jOS4uuaCqOino+WG s+S8geS4muWRmOW3peWcqOOAkOaQnOe0ouOAkemBh+WIsOeahOWQhOenjemXrumimO+8gQ0K DQrlpJbotLjkvIHkuJov5Lia5Yqh5ZGY5b2T5YmN55qE6Zeu6aKY77yaDQotLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tDQoxLuWklui0uOWRmOadguS5seaXoOeroOe9keS4iuaQnOe0ouWuouaIt++8jOaXoOaz leeuoeeQhu+8mw0KMi7kurrlkZjnmoTmtYHlpLHvvIzpgKDmiJDlrqLmiLfkv6Hmga/kuKLl pLHvvJsNCjMu6Zmk5LqG5Lia57up77yM57uP55CG5b6I6Zq+55uR5o6n5Lia5Yqh5ZGY5aaC 5L2V5pCc5a6i5oi377ybIA0KLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLQ0KDQrlpJbotLjkvIHkuJrlv4XnlKjl t6XlhbflubPlj7ANCi0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0NCuKYheS7juOAkOS6kuiBlOe9keWFrOWFsei1 hOa6kOOAkemrmOaViOeyvuWHhuiOt+WPluWuouaIt++8jOWMheaLrO+8mg0KICAgIOKYhuaQ nOe0ouW8leaTjg0KICAgIOKYhiDlm77niYcNCiAgICDimIbpu4TpobUNCiAgICDimIbluqbm m7TmlrDph4fpm4YNCiAgICDimIboh6rlrprkuYnph4fpm4YNCiAgICDnrYnmlrnlvI/ojrfl j5bnsr7noa7lrqLmiLcNCg0K4piF5LiD5bm055qE6L+Q6KGM57uP6aqM77yM6ICB5Lya5ZGY 5Y+j56KR5ZKM5o6o6I2Q5Li65Li7DQotLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tDQoNCuWFt+S9k+WPr+S7peWP guiAg++8mg0KLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLQ0KaHR0cDovL3d3dy50cmFkZXNvdS5jb20vcHJvZHVj dHMvP3NuPTIwMTYNCg0K5bu66K6u6K6p6LS15YWs5Y+45q+P5Liq5ZGY5bel5YWN6LS55rOo 5YaM5L2T6aqM5YWI772eDQotLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tDQoNCuelneaCqDIwMTbnlJ/mhI/lhbTp mobvvIzotKLmupDlub/ov5vvvIENCg0K5aSW6LS45pCc5pWs5LiK From mtk.manpages@gmail.com Tue Feb 23 04:27:37 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=FREEMAIL_FROM,T_DKIM_INVALID autolearn=ham version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay2.corp.sgi.com [137.38.102.29]) by oss.sgi.com (Postfix) with ESMTP id 00E117F53 for ; Tue, 23 Feb 2016 04:27:37 -0600 (CST) Received: from cuda.sgi.com (cuda3.sgi.com [192.48.176.15]) by relay2.corp.sgi.com (Postfix) with ESMTP id B3164304043 for ; Tue, 23 Feb 2016 02:27:30 -0800 (PST) X-ASG-Debug-ID: 1456222589-04cb6c455c94d30001-NocioJ Received: from mail-wm0-f51.google.com (mail-wm0-f51.google.com [74.125.82.51]) by cuda.sgi.com with ESMTP id 8hOqUWaTP7ENFsFY (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128 verify=NO) for ; Tue, 23 Feb 2016 02:16:30 -0800 (PST) X-Barracuda-Envelope-From: mtk.manpages@gmail.com X-Barracuda-Apparent-Source-IP: 74.125.82.51 Received: by mail-wm0-f51.google.com with SMTP id g62so214093153wme.1 for ; Tue, 23 Feb 2016 02:16:30 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=subject:to:references:cc:from:message-id:date:user-agent :mime-version:in-reply-to:content-transfer-encoding; bh=fuc9T/Y/TpgVoPDbePZE59Dd62iCuwvEwT0+Yw/5/kM=; b=hMCi6KFmOTOYyzM7elVFnjJEWKWHTWnOCZDWGNB4PjQWpKnDtbFdrY8R13B4psNGSE BE9YiWZYY3jryvIApB1vlguuaAtpq1OoqHjZEkO3MaQ+qqnQYGq3NaFExZaY7/3NVQki NLduvtf0kKepLHVQ6HakM9EhtUfg1/QJuXDfRmZrKV/2KM18Jvvh1KaOtRd1c0PYUZ8m ASt7Vn6uFJVpn0JwNGWYHXZhi4RY2lp2ZfMzj+ZbUhqrKQn1qRykH+IAXS9aOxAcPMPh HTZi9rbjWTpGFvZ/I33epmNAowWej9U8djijoJOYk0LrIyMGC7HOOD+OefQpuTjtlJKD k+Bw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:subject:to:references:cc:from:message-id:date :user-agent:mime-version:in-reply-to:content-transfer-encoding; bh=fuc9T/Y/TpgVoPDbePZE59Dd62iCuwvEwT0+Yw/5/kM=; b=eCBjmNRXv/HMh5TEC65jXqNT6Q1m+inbZhX98k2PxPSfCq9Qh7mLMgOMHYTzds1Lmo vgftWV6qXSH/HpUEqvFN1OlfjD454widMWjlae22/D/gF/2NgLobzNtA6zqk9VB7rkxU ZXvZhM1r6ESCJdKi7Lk8jidU+mCQwPP73C2jdh+A96TekzDFJWODCxLqgnZDFT7lBCOb oXAbOxCSgIe1FIdWvUkRyXd5KVpIshqXTJKBPKSqwizI1/Vuq03ToQCEEHlr4J9wVIC2 XsxJkktYYjL6lonGQc4ObV0tmH2GsSRhZ0rVffNAPAleISg6vjf/Nq6dczSFIgagOIEn P5/Q== X-Gm-Message-State: AG10YORFh7wA4p2ekay4pY37o+ZRkfreg38vPOvt3iUO1UASb+XBA6Ay6W5o2kCFYgFvnQ== X-Received: by 10.28.20.145 with SMTP id 139mr5772648wmu.76.1456222589452; Tue, 23 Feb 2016 02:16:29 -0800 (PST) Received: from [192.168.43.144] ([89.204.139.16]) by smtp.gmail.com with ESMTPSA id l132sm25362127wmf.7.2016.02.23.02.16.23 (version=TLSv1/SSLv3 cipher=OTHER); Tue, 23 Feb 2016 02:16:27 -0800 (PST) Subject: Re: richacl(7) man page review comments To: Andreas Gruenbacher X-ASG-Orig-Subj: Re: richacl(7) man page review comments References: <56B770B6.7040803@gmail.com> <56B77262.7090107@gmail.com> <56C0F23C.7030902@gmail.com> <56CA2EEB.9080504@gmail.com> Cc: mtk.manpages@gmail.com, "J. Bruce Fields" , linux-ext4 , XFS Developers , lkml , linux-fsdevel , Linux NFS Mailing List , linux-cifs@vger.kernel.org, Linux API , Dave Chinner , Christoph Hellwig , Anna Schumaker , Trond Myklebust , Jeff Layton , Andreas Dilger From: "Michael Kerrisk (man-pages)" Message-ID: <56CC3174.2060207@gmail.com> Date: Tue, 23 Feb 2016 11:16:20 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.5.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-Barracuda-Connect: mail-wm0-f51.google.com[74.125.82.51] X-Barracuda-Start-Time: 1456222590 X-Barracuda-Encrypted: ECDHE-RSA-AES128-GCM-SHA256 X-Barracuda-URL: https://192.48.176.15:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-BRTS-Status: 1 X-Barracuda-Spam-Score: 0.00 X-Barracuda-Spam-Status: No, SCORE=0.00 using per-user scores of TAG_LEVEL=1000.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.7 tests=BSF_SC0_MISMATCH_TO, DKIM_SIGNED, DKIM_VERIFIED X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.3.27262 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 0.00 BSF_SC0_MISMATCH_TO Envelope rcpt doesn't match header -0.00 DKIM_VERIFIED Domain Keys Identified Mail: signature passes verification 0.00 DKIM_SIGNED Domain Keys Identified Mail: message has a signature Hi Andreas, On 02/22/2016 03:46 PM, Andreas Gruenbacher wrote: > Hi Michael, > > On Sun, Feb 21, 2016 at 10:40 PM, Michael Kerrisk (man-pages) > wrote: >> I've once more pulled from the latest git; here's some more comments. > > thanks again. I've updated the repo with your changes. Thanks! [...] >> I'm going to play the broken record :-) >> >> Could we start with just a few simple examples already, and build up >> over future iterations of this page? > > Yes, as soon as I'll get to it :) Sure. But, to press the point home, I'm interested to do further review, but I feel like the lack of examples is limiting my ability to understand what's going on and deepen the feedback that I provide in future iterations. So, start please, even if only starting small :-). Cheers, Michael -- Michael Kerrisk Linux man-pages maintainer; http://www.kernel.org/doc/man-pages/ Linux/UNIX System Programming Training: http://man7.org/training/ From agruenba@redhat.com Tue Feb 23 04:28:57 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=ham version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay2.corp.sgi.com [137.38.102.29]) by oss.sgi.com (Postfix) with ESMTP id E108C7F53 for ; Tue, 23 Feb 2016 04:28:57 -0600 (CST) Received: from cuda.sgi.com (cuda1.sgi.com [192.48.157.11]) by relay2.corp.sgi.com (Postfix) with ESMTP id 872A0304043 for ; Tue, 23 Feb 2016 02:28:51 -0800 (PST) X-ASG-Debug-ID: 1456223320-04bdf07ab5e9270001-NocioJ Received: from mail-vk0-f54.google.com (mail-vk0-f54.google.com [209.85.213.54]) by cuda.sgi.com with ESMTP id X63o1pnXDHiErEGa (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128 verify=NO) for ; Tue, 23 Feb 2016 02:28:40 -0800 (PST) X-Barracuda-Envelope-From: agruenba@redhat.com X-Barracuda-Apparent-Source-IP: 209.85.213.54 Received: by mail-vk0-f54.google.com with SMTP id c3so156783613vkb.3 for ; Tue, 23 Feb 2016 02:28:40 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:date :message-id:subject:from:to:cc:content-type; bh=jikTITI5gFcgNBLkekaiq/M+L6DLyVvZ3o+CcR1T7+I=; b=D4nnsKKhKhMwzrCaWALC9yNkRXj/n+KU6TWoQ36IjNeKoWDRDpJB93dDTlwINqQ7Yk Zi7YU3sf61JAaF4fFcdl2wPyWhIA9f9yb7NMMSNZYC4ZSKK3TtEX+xnJ16LUHHBGamks F8KP6m3aw2Q6wQu8plPmCeQBJM23byzcvB/B9G57xk2dMdbCQJijjqBZgzCOujoH5gNl 27kDNskTEkvUTA/MqS0GJIusBK1BPouanGiRcCUxFK8wNzi840QXeVA28s8HYBTq/DJg ijXyf+xHNGlgmqKUz5WitpZkfUucwJu5Rx0SmshRtmQ6qfrmzXum9BEl8gRS2jMpTxWb Cqfw== X-Gm-Message-State: AG10YORYipE6ucjpUPCPMpB6IMj/7lDc0qaBdceakHgEIF1F1DmCDaw2RT9e1lPdvPQv9c2nkeH5b9lGJIdn3h2H MIME-Version: 1.0 X-Received: by 10.31.149.135 with SMTP id x129mr27582466vkd.62.1456223319986; Tue, 23 Feb 2016 02:28:39 -0800 (PST) Received: by 10.176.64.130 with HTTP; Tue, 23 Feb 2016 02:28:39 -0800 (PST) In-Reply-To: <56CC3174.2060207@gmail.com> References: <56B770B6.7040803@gmail.com> <56B77262.7090107@gmail.com> <56C0F23C.7030902@gmail.com> <56CA2EEB.9080504@gmail.com> <56CC3174.2060207@gmail.com> Date: Tue, 23 Feb 2016 11:28:39 +0100 Message-ID: Subject: Re: richacl(7) man page review comments From: Andreas Gruenbacher X-ASG-Orig-Subj: Re: richacl(7) man page review comments To: "Michael Kerrisk (man-pages)" Cc: "J. Bruce Fields" , linux-ext4 , XFS Developers , lkml , linux-fsdevel , Linux NFS Mailing List , linux-cifs@vger.kernel.org, Linux API , Dave Chinner , Christoph Hellwig , Anna Schumaker , Trond Myklebust , Jeff Layton , Andreas Dilger Content-Type: text/plain; charset=UTF-8 X-Barracuda-Connect: mail-vk0-f54.google.com[209.85.213.54] X-Barracuda-Start-Time: 1456223320 X-Barracuda-Encrypted: ECDHE-RSA-AES128-GCM-SHA256 X-Barracuda-URL: https://192.48.157.11:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-BRTS-Status: 1 X-Barracuda-Spam-Score: 0.00 X-Barracuda-Spam-Status: No, SCORE=0.00 using per-user scores of TAG_LEVEL=1000.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.7 tests=BSF_SC0_MISMATCH_TO X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.3.27262 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 0.00 BSF_SC0_MISMATCH_TO Envelope rcpt doesn't match header On Tue, Feb 23, 2016 at 11:16 AM, Michael Kerrisk (man-pages) wrote: > On 02/22/2016 03:46 PM, Andreas Gruenbacher wrote: >> On Sun, Feb 21, 2016 at 10:40 PM, Michael Kerrisk (man-pages) wrote: >>> Could we start with just a few simple examples already, and build up >>> over future iterations of this page? >> >> Yes, as soon as I'll get to it :) > > Sure. But, to press the point home, I'm interested to do further > review, but I feel like the lack of examples is limiting my ability to > understand what's going on and deepen the feedback that I provide in > future iterations. So, start please, even if only starting small :-). Sure, I understand that. In case you didn't stumble upon this page before, a few very simple examples showing how things interact can be found here: http://www.bestbits.at/richacl/examples.html Thanks, Andreas From mtk.manpages@gmail.com Tue Feb 23 04:58:42 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=FREEMAIL_FROM,T_DKIM_INVALID autolearn=ham version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay3.corp.sgi.com [198.149.34.15]) by oss.sgi.com (Postfix) with ESMTP id C836D7F8A for ; Tue, 23 Feb 2016 04:58:41 -0600 (CST) Received: from cuda.sgi.com (cuda3.sgi.com [192.48.176.15]) by relay3.corp.sgi.com (Postfix) with ESMTP id F2734AC002 for ; Tue, 23 Feb 2016 02:58:34 -0800 (PST) X-ASG-Debug-ID: 1456225107-04cb6c455c95c40001-NocioJ Received: from mail-wm0-f43.google.com (mail-wm0-f43.google.com [74.125.82.43]) by cuda.sgi.com with ESMTP id oDGgu0kQAlxrtPvA (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128 verify=NO) for ; Tue, 23 Feb 2016 02:58:28 -0800 (PST) X-Barracuda-Envelope-From: mtk.manpages@gmail.com X-Barracuda-Apparent-Source-IP: 74.125.82.43 Received: by mail-wm0-f43.google.com with SMTP id c200so214095398wme.0 for ; Tue, 23 Feb 2016 02:58:28 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=subject:to:references:cc:from:message-id:date:user-agent :mime-version:in-reply-to:content-transfer-encoding; bh=6if90TMTq2g7bIM9rNF9DqqVjX0XcCxEdjGwaVetffo=; b=ZHMGxlO7OQ0s8Qi172EGoAb8czKLim6Ldc4s0+PcQWtK/4l5U57iwQ4ON+eyzhI0BB xq0JkqBaK2wBhFzA3LX9TWGlYOBTZBVVMUF5+yJB34huoj5T4u6TO4ovAfCECODK5SYH nu8VDY2uOZVuWKY66WUL27U4DATGBno9g2an12aASoJPiy1RrXbRVjCBhKRMrWK0a6FU tMaYiGvWdIWnZiLQ1fOcV0pojqzkoCadZpNbTWM94c9nLEW7QehEbwXIPpklPh4BOPCS LNWXH00K/9OI5hO14iXJQuRG4cSsOIBT4nM2XLC8VFcDk1ZtzdGSRbh4TnXfnkdGe+ov A9sQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:subject:to:references:cc:from:message-id:date :user-agent:mime-version:in-reply-to:content-transfer-encoding; bh=6if90TMTq2g7bIM9rNF9DqqVjX0XcCxEdjGwaVetffo=; b=bIotnZq7LfQlX0qohtlPSYJNs4rstN+/JhZr8iSkqBomGxppt9jKix4x/RP5ONqmdM lOz4To6fxg/5i4I8qvllXe/+ANe0J9xFf5RxNEbvOEV6MqVxub09GwdtwkLTIZkLG5GO 3C+bpfl+IkMnpO1RSmwizwoVoI2McGR+egpDl5e4990qNAWgAw7BHYrGnT7gUQ5gRbo3 aXnonu//2DrfxfMd9eb1TviWn7cKDcQsrIBkJ1P2M5ylRt1bRRPXw/JWEPkeCZva3WCO xoHaGlLfUqSbbZbyN7lHeMhSh7WDjFRvkqefV8FiQ3zN9A8vG8WSqVUQ9mGOH1L2HZTB amYw== X-Gm-Message-State: AG10YORmfviLT7yb4nrWsuZVwhpEqrXjVmSfPGcylrbHYnByiAl8hgXkHWS/qPPY7mluLg== X-Received: by 10.28.88.15 with SMTP id m15mr17063193wmb.60.1456225106993; Tue, 23 Feb 2016 02:58:26 -0800 (PST) Received: from [192.168.43.144] ([89.204.139.16]) by smtp.gmail.com with ESMTPSA id x66sm25538036wmb.20.2016.02.23.02.58.22 (version=TLSv1/SSLv3 cipher=OTHER); Tue, 23 Feb 2016 02:58:25 -0800 (PST) Subject: Re: richacl(7) man page review comments To: Andreas Gruenbacher X-ASG-Orig-Subj: Re: richacl(7) man page review comments References: <56B770B6.7040803@gmail.com> <56B77262.7090107@gmail.com> <56C0F23C.7030902@gmail.com> <56CA2EEB.9080504@gmail.com> Cc: mtk.manpages@gmail.com, "J. Bruce Fields" , linux-ext4 , XFS Developers , lkml , linux-fsdevel , Linux NFS Mailing List , linux-cifs@vger.kernel.org, Linux API , Dave Chinner , Christoph Hellwig , Anna Schumaker , Trond Myklebust , Jeff Layton , Andreas Dilger From: "Michael Kerrisk (man-pages)" Message-ID: <56CC3B4A.7070204@gmail.com> Date: Tue, 23 Feb 2016 11:58:18 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.5.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Barracuda-Connect: mail-wm0-f43.google.com[74.125.82.43] X-Barracuda-Start-Time: 1456225107 X-Barracuda-Encrypted: ECDHE-RSA-AES128-GCM-SHA256 X-Barracuda-URL: https://192.48.176.15:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-BRTS-Status: 1 X-Barracuda-Spam-Score: 0.00 X-Barracuda-Spam-Status: No, SCORE=0.00 using per-user scores of TAG_LEVEL=1000.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.7 tests=BSF_SC0_MISMATCH_TO, DKIM_SIGNED, DKIM_VERIFIED X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.3.27263 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 0.00 BSF_SC0_MISMATCH_TO Envelope rcpt doesn't match header -0.00 DKIM_VERIFIED Domain Keys Identified Mail: signature passes verification 0.00 DKIM_SIGNED Domain Keys Identified Mail: message has a signature Hi Andreas, On 02/22/2016 03:46 PM, Andreas Gruenbacher wrote: > Hi Michael, > > On Sun, Feb 21, 2016 at 10:40 PM, Michael Kerrisk (man-pages) > wrote: >> I've once more pulled from the latest git; here's some more comments. > > thanks again. I've updated the repo with your changes. Next round :-). Just a few quick comments while I'm on a train ride. > .\" > .\" RichACL Manual Pages > .\" > .\" Copyright (C) 2015,2016 Red Hat, Inc. > .\" Written by Andreas Gruenbacher > .\" This is free documentation; you can redistribute it and/or > .\" modify it under the terms of the GNU General Public License as > .\" published by the Free Software Foundation; either version 2 of > .\" the License, or (at your option) any later version. > .\" > .\" The GNU General Public License's references to "object code" > .\" and "executables" are to be interpreted as the output of any > .\" document formatting or typesetting system, including > .\" intermediate and printed output. > .\" > .\" This manual is distributed in the hope that it will be useful, > .\" but WITHOUT ANY WARRANTY; without even the implied warranty of > .\" MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the > .\" GNU General Public License for more details. > .\" > .\" You should have received a copy of the GNU General Public > .\" License along with this manual. If not, see > .\" . > .\" > .de URL > \\$2 \(laURL: \\$1 \(ra\\$3 > .. > .if \n[.g] .mso www.tmac > .TH RICHACL 7 2015-09-01 "Linux" "Rich Access Control Lists" > .SH NAME > richacl \- Rich Access Control Lists > .SH DESCRIPTION > Rich Access Control Lists (RichACLs) are an extension of the POSIX file > permission model (see > .BR acl (5)) > to support > .URL https://tools.ietf.org/rfc/rfc5661.txt "NFSv4 Access Control Lists" > on local and remote-mounted filesystems. > > A RichACL can always be translated into an equivalent NFSv4 ACL which grants > the same permissions. > > RichACLs can be enabled on supported local filesystems (currently, ext4 and > XFS). The in-kernel NFSv4 server and client also include RichACL support. > > Enabling RichACLs disables POSIX Access Control Lists; the two ACL models > cannot coexist on the same filesystem. > > When used on a filesystem that does not support RichACLs, the > .BR getrichacl (1) > and > .BR setrichacl (1) > utilities will operate on the file permission bits instead: > .BR getrichacl (1) > will display the file permission bits as a RichACL; when a RichACL > is set with > .BR setrichacl (1) > which can be represented exactly by the file permission bits, > .BR setrichacl (1) > will set the file permission bits instead. An attempt to set a RichACL that > cannot be represented exactly by the file permission bits results in an error. > > .SS Structure of RichACLs > > RichACLs consist of a number of ACL entries, three file masks, and a set of > flags specifying attributes of the ACL as a whole (by contrast with the > per-ACL-entry flags described below). > > Each of the ACL entries allows or denies some permissions to a particular user, > group, or special identifier. An ACL entry consists of four fields: > > .IP \(bu 2 > A tag which specifies the user, group, or special identifier the entry applies > to. Special identifiers can be the file owner > .RB ( owner@ ), > the owning group > .RB ( group@ ), > or everyone > .RB ( everyone@ ). > .IP \(bu > A set of permissions the entry allows or denies. > .IP \(bu > A set of flags that indicate whether the user or group identifier is mapped or > unmapped, and whether the entry has been and can be inherited. > .IP \(bu > A type field indicating whether the entry allows or denies the permissions > specified in the second field. > .PP > The owner, group, and other file masks further control which permissions the > ACL grants, subject to the > .BR masked "\ (" m ) > and > .BR write_through "\ (" w ) > ACL flags: when the permissions of a file or directory are changed with > .BR chmod (2), > the file masks are set based on the new file mode, and the > .B masked > and > .B write_through > ACL flags are set. Likewise, when a new file or directory inherits an ACL from > its parent directory, the file masks are set to the intersection between the > permissions granted by the inherited ACL and the > .I mode > parameter as given to > .BR open "(2), " mkdir (2), > and similar, and the > .B masked > ACL flag is set. In both cases, the file masks limit the permissions that the > ACL will grant. > > The purpose of the file masks is to allow traditional POSIX applications which > are unaware of RichACLs to place limits on the permissions granted by the > RichACL without causing the ACL entries to be modified. Without the file mask, > the only alternative would be for the kernel to directly modify the ACL > entries. However, this latter approach could have a "hysteresis effect", > whereby a RichACL-unaware application that performs a transition from one file > mode to another file mode and then back to the original file mode could cause > destruction of the permission information in ACL entries. When creating files > or directories, the > .I mode > parameter to > .BR open "(2), " mkdir (2), > and similar would cause the same effect. s/cause/have/ > > Note that entries with the identifier > .B everyone@ > apply to all processes, whereas the \(lqother\(rq file permissions and > \(lqother\(rq entries in POSIX ACLs apply to all processes which are not the So, I still think it's helpful to mention ACL_OTHER here. How about: s/\\(lqother\\(rq/\\(lqother\\(rq (\\fBACL_OTHER\\fP)/ > owner, are not in the owning group, and do not match a user or group mentioned > in the ACL. > > Unlike POSIX ACLs, RichACLs do not have separate \(lqaccess\(rq ACLs that > define the access permissions and \(lqdefault\(rq ACLs that define the > inheritable permissions. Instead, flags on each ACL entry determine whether > the entry is effective during access checks and/or inheritable. > > > .SS ACL flags > > The following ACL flags are defined: > > .TP > .BR masked "\ (" m ) > When set, the file masks define upper limits on the permissions the ACL may > grant. When not set, the file masks are ignored. > .TP > .BR write_through "\ (" w ) > When this flag and the > .B masked > flag are both set, the owner and other file masks define the actual permissions > granted to the file owner and to others instead of defining an upper limit. > When the > .B masked > flag is not set, the > .B write_through > flag has no effect. > .TP > .BR auto_inherit "\ (" a ) > Automatic Inheritance is enabled. See > .IR "Automatic Inheritance" . > .TP > .BR protected "\ (" p ) > The ACL is protected from modification by Automatic > Inheritance. > .TP > .BR defaulted "\ (" d ) > Indicates that the ACL has been assigned in an application-dependent way when > the file or directory was created; it has neither been inherited nor set > explicitly. ACLs of files created on Linux will never have the > .B defaulted > flag set, but the flag may be set on files created on or copied over from > other operating systems. When this flag is set for an ACL, Automatic > Inheritance will completely replace the ACL. > > .SS ACL entry flags > > The following flags on ACL entries are defined: > > .TP > .BR file_inherit "\ (" f ) > When this flag appears in the ACL entry of a directory, then: > .RS > .IP \(bu 2 > That entry is inherited by new files created in the directory such that the > permissions of the entry apply to the file (the inheritance flags of the > inherited entry are cleared). > .IP \(bu > The entry is is inherited by new subdirectories created in the directory such > that the permissions of the entry will apply to new files created in the > subdirectory. > .RE > .TP > .BR dir_inherit "\ (" d ) > When this flag appears in the ACL entry of a directory, then that entry is > inherited by new subdirectories created in the directory such that the > permissions of the entry apply to the subdirectory (the > .B inherit_only > flag is cleared). > .TP > .BR no_propagate "\ (" n ) > Inheritance stops at the next subdirectory level. When a file or directory > inherits an entry that has this flag set, the > .BR file_inherit ", " dir_inherit ", " no_propagate ", and " inherit_only > flags are cleared. > .TP > .BR inherit_only "\ (" i ) > The entry defines inheritable permissions only and is ignored for access > checking. When a file or directory inherits an entry that has this flag set, > the flag is cleared. > .TP > .BR inherited "\ (" a ) > The entry has been automatically inherited from the parent directory. > .TP > .BR unmapped "\ (" u ) > The user or group identifier is a textual string and is not mapped to a numeric > user or group identifier. ACLs with unmapped identifiers can occur on NFSv4 > mounted filesystems when the client cannot determine numeric user or group > identifiers for some of the NFSv4 user@domain or group@domain who values. They > cannot be assigned to local files or directories. > > .SS Permissions > > The following permissions are defined for RichACL entries and for the three > file masks: > > .TP > .BR read_data " / " list_directory "\ (" r ) > For a file: read the data of the file. > For a directory: list the contents of the directory. > .TP > .BR write_data " / " add_file "\ (" w ) > For a file: modify the data of the file; does not include opening the file in > append mode. > For a directory: add a new file in the directory. > .TP > .BR append_data " / " add_subdirectory "\ (" p ) > For a file: open the file in append mode. > For a directory: create a subdirectory in the directory. > .TP > .BR execute "\ (" x ) > For a file: execute the file. > For a directory: traverse (search) the directory. > .TP > .BR delete_child "\ (" d ) > Delete a file or directory within a directory. This permission is meaningful > only for directories. > .TP > .BR delete "\ (" D ) > Delete the file or directory. > .TP > .BR read_attributes "\ (" a ) > Read basic attributes of a file or directory (see > .BR stat (2)). > This permission is defined by NFSv4. It is stored, but ignored. Reading basic > attributes of files and directories is always allowed on Linux. > .TP > .BR write_attributes "\ (" A ) > Change the times associated with a file or directory to an arbitrary value. > This permission is always implicitly granted to the file owner. > .TP > .BR read_acl "\ (" c ) > Read the ACL of a file or directory. Like reading the basic file attributes (the > .B read_attributes > permission), reading ACLs is always allowed in Linux. > .TP > .BR write_acl "\ (" C ) > Change the ACL or file mode of a file or directory. > .TP > .BR write_owner "\ (" o ) > Take ownership of a file or directory. Change the owning group of a file or > directory to a group of which the calling process is a member. > .TP > .ad l > .BR read_named_attrs "\ (" R "), " write_named_attrs "\ (" W "), " synchronize "\ (" S "), " write_retention "\ (" e "), " write_retention_hold "\ (" E ) > .ad > These permissions are defined by NFSv4 and NFSv4.1. They are stored, but ignored. > .PP > For the > .BR r ", " w ", and " p > permissions, which have different long forms for files and directories, the > .BR getrichacl (1) > utility will output the appropriate form(s) depending on the context. > The > .BR setrichacl (1) > utility will accept either form for any file type. > > .SS Text form > The common textual representation of a RichACL consists of the colon-separated > fields of the ACL flags, file masks, and ACL entries in the following > format: > .TP > \fBflags:\fR\fIacl_flags\fR > The ACL flags. > .TP > \fBowner:\fR\fIperm\fR\fB::mask\fR, \fBgroup:\fR\fIperm\fR\fB::mask\fR, \fBother:\fR\fIperm\fR\fB::mask\fR > The file masks and their permissions. > .TP > \fIwho\fR\fB:\fR\fIperm\fR\fB:\fR\fIflags\fR\fB:allow\fR, \fIwho\fR\fB:\fR\fIperm\fR\fB:\fR\fIflags\fR\fB:deny\fR > For each ACL entry, who the entry applies to, the permissions of the entry, the > entry flags, and the entry type. The \fIwho\fR field is one of the following: > .RS > .IP \(bu 2 > One of the special identifiers: > .BR owner@ ", " group@ ", or " everyone@ , > .IP \(bu > A > .BR user: " or " u: > prefix followed by a user name or user ID that designates a specific user, > .IP \(bu > A > .BR group: " or " g: > prefix followed by a group name or group ID that designates a specific group. > .RE > .PP > The entries are comma, whitespace, or newline separated. s/entries/fields of an ACL entry/ (?) > > Flags and permissions have single-letter as well as long forms, as listed under > .IR "ACL flags" , > .IR "ACL entry flags" , > and > .IR Permissions . > When the single-letter forms are used, the flags or permissions are > concatenated. When the long forms are used, the flags or permissions are > separated by slashes. To align permissions or flags vertically, dashes can be > used for padding. > > .SS Setting and modifying file permissions > The access permissions for a file can either be set by assigning an Access > Control List > .RB ( setrichacl (1)) > or by changing the file mode permission bits > .RB ( chmod (1)). > In addition, a file can inherit an ACL from its parent directory at creation > time as described under > .IR "Permissions at file-creation time" . > > .SS Assigning an Access Control List > When assigning an ACL to a file, unless explicitly specified, the owner, group, > and other file masks will be computed from the ACL entries as described in > the section > .IR "Computing the maximum file masks" . > The owner, group, and other file mode permission bits are then each set from > the owner, group, and other file mask as follows: > .IP \(bu 2 > If the file mask includes the > .B r > permission, the read > file mode permission bit will be set. > .IP \(bu > If the file mask includes the > .B w > or > .B p > permission, the write file mode permission bit will be set. > .IP \(bu > If the file mask includes the > .B x > permission, the execute file mode permission bit will be set. > .PP > If the ACL can be represented exactly by the file mode permission bits, the > file permission bits are set to match the ACL and no ACL is stored. (When the > ACL of a file is requested which doesn't have an ACL, the file mode permission > bits are converted into an equivalent ACL.) > > .SS Changing the file mode permission bits > When changing the file mode permission bits with > .BR chmod (1), > the owner, group, and other file permission bits are set to the permission bits > in the new mode, and the owner, group, and other file masks are set based on > the new mode bits as follows: > .IP \(bu 2 > If the read bit in a set of permissions is set, the > .B r > permission in the corresponding file mask will be set. > .IP \(bu > If the write bit in a set of permissions is set, the > .B w > and > .B p > permissions in the corresponding file mask will be set. > .IP \(bu > If the execute bit in a set of permissions is set, the > .B x > permission in the corresponding file mask will be set. > .PP > In addition, the > .B masked > and > .B write_through > ACL flags are set. This has the > effect of limiting the permissions granted by the ACL to the file mode > permission bits; in addition, the owner is granted the owner mode bits and > others are granted the other mode bits. If the > .B auto_inherit > flag is set, the > .B protected > flag is also set to prevent the Automatic Inheritance algorithm from modifying > the ACL. > > .SS Permissions at file-creation time > When a directory has any inheritable ACL entries, the following > happens when a file or directory is created inside that directory: > .RS 4 Remove preceding line. > .IP 1. 4 > A file created inside that directory will inherit all of the ACL entries that > have the > .B file_inherit > flag set, and all inheritance-related flags in the inherited entries flag will > be cleared. > > A subdirectory created inside that directory will inherit all of the ACL > entries that either have the > .B dir_inherit > flag set, or the > .B file_inherit > flag set and the > .B no_propagate > flag not set. Entries whose > .B dir_inherit > flag is set will have their > .B inherit_only > flag cleared, and entries whose > .B dir_inherit > flag is not set will have their > .B inherit_only > flag set. Finally, entries whose > .B no_propagate > flag is set will have all inheritance-related flags cleared. > .IP 2. > If the parent directory's ACL has the > .B auto_inherit > flag set, the inherited ACL will have its s/the/then the/ (For ease of parsing) > .B auto_inherit > flag set, and all entries will have their > .B inherited > flag set. Otherwise, the > .B auto_inherit > and > .B inherited > flags are cleared. > .IP 3. > The three file masks are computed from the inherited ACL as described in > the section > .IR "Computing the maximum file masks" . > .IP 4. > The three sets of permissions for the owner, the group, and for others in > the \fImode\fR parameter as given to > .BR open (2), > .BR mkdir (2), > and similar are converted into sets of RichACL permissions. The correspondence > between mask flags and RichACL permission bits is described in the section > .IR "Changing the file mode permission bits" . > Any RichACL permissions not included in those sets are > removed from the owner, group, and other file masks. The file mode permission > bits are then computed from the file masks as described in the section > .IR "Assigning an Access Control List" . > The process umask (see > .BR umask (2)) > is ignored. > .IP 5. > The > .B masked > ACL flag is set. The > .B write_through > ACL flag remains cleared. In addition, if the > .B auto_inherit > flag of the inherited ACL is set, the > .B protected > flag is also set to prevent the Automatic Inheritance algorithm from modifying > the ACL. > .RE Remove preceding line. > .PP > When a directory does not have inheritable ACL entries, files and directories > created inside that directory will not be assigned Access Control Lists and the > file mode permission bits will be set to (\fImode\fR\ &\ ~\fIumask\fR) where > \fImode\fR is the mode argument of the relevant system call and \fIumask\fR is > the process umask (see > .BR umask (2)). > > .SS Automatic Inheritance > Automatic Inheritance is a mechanism that allows permission changes to > propagate from a directory to files and subdirectories inside that directory, > recursively. Propagation is carried out by the process changing the directory > permissions (usually, > .BR setrichacl (1)); > it happens without user intervention albeit not entirely automatically. > > A significant limitation is that this mechanism works only as long as files s/limitation/limitation of the Automatic Inheritance feature/ > are created without explicitly specifying the file permissions to use. The > standard system calls for creating files and directories > .RB ( creat (2), > .BR open (2), > .BR mkdir (2), > .BR mknod (2)) s/)$/,\nand so on)/ (And, I'd drop creat(2) from that list of examples. It's ancient and obsolete; no need to encourageits use.) > all have mandatory mode parameters which define the maximum allowed permissions > of the new files. To take account of this restriction, the > .B protected > ACL flag must be set if the > .B inherited > flag is set. This effectively disables Automatic Inheritance for that > particular file. > > Notwithstanding the aforementioned limitation, Automatic Inheritance still > remains useful for network protocols like NFSv4 and SMB, which both support > creating files and directories without defining their permissions. These > protocols can implement those operations by using the standard system calls and > by then undoing the effect of applying the mode parameters. > > When the ACL of a directory is changed, the following happens for each entry > (\(lqchild\(rq) inside that directory: > .IP 1. 4 > If the entry is a symbolic link, skip the child. > .IP 2. > If the > .B auto_inherit > flag of the entry's ACL is not set or the > .B protected > flag is set, skip the child. > .IP 3. > With the child's ACL: > .RS 4 > .IP a) 4 > If the > .B defaulted > flag is set, replace the ACL with an empty ACL > with the > .B auto_inherit > flag set. > .IP b) > Delete all entries which have the > .B inherited > flag set. > .IP c) > Append all entries inherited from the parent directory according to step 1 of > the algorithm described under > .IR "Permissions at file-creation time". > Set the > .B inherited > flag of each of these entries. > .IP d) > Recompute the file masks. At th end of the last section, add: as descibed in the section "...." > .RE > .IP 4. > If the child is a directory, recursively apply this algorithm. > > .SS Access check algorithm > > When a process requests a particular kind of access (expressed as a set of > RichACL permissions) to a file, the following algorithm determines whether the > access is granted or denied: > > .IP 1. 4 > If the > .B masked > ACL flag is set, then: > .RS 4 > .IP a) 4 > If the > .B write_through > ACL flag is set, then: > .RS 4 > .IP \(bu 2 > If the requesting process is the file owner, then access is granted if the > owner mask includes the requested permissions, and is otherwise denied. > .IP \(bu > If the requesting process is not the file owner and it is in the owning group or matches any ACL entries other than > .BR everyone@ , > proceed to step b). > .IP \(bu > If the requesting process is not the file owner, is not in the owning group, > and no ACL entries other than > .B everyone@ > match the process, then access is granted if the other mask includes the > requested permissions, and is otherwise denied. > .RE > .IP b) > If any of the following is true: > .RS 4 > .IP \(bu 2 > the requesting process is the file owner and the owner mask does not include all > requested permissions, > .IP \(bu > the requesting process is not the file owner and it is in the owning group or > matches any ACL entries other than > .BR everyone@ , > and the group mask does not include all requested permissions, > .IP \(bu > the requesting process is not the file owner, not in the owning group, it > matches no ACL entries other than > .BR everyone@ , > and the other mask does not include all requested permissions, > .PP > then access is denied. > .RE > .RE > .IP 2. > Upon reaching this point, the determination of whether or not access is granted > is made by scanning all ACL entries to see if one or more applicable entries > together grant a cumulative set of permissions that matches the requested > permissions or there is an applicable entry that explicitly denies one or more > of the requested permissions. The scan of all ACL entries begins by first > initializing the set of remaining permissions (i.e., those that have not yet > been satisfied during the scan) to be the set of requested permissions. Then > the ACL entries are scanned > .IR "in order" , > and for each entry: > .RS 4 > .IP a) 4 > If the > .B inherit_only > or > .B unmapped > flags are set, continue with the next ACL entry. > .IP b) > If any of the following is true: > .RS 4 > .IP \(bu 2 > the entry's identifier is > .B owner@ > and the requesting process is the file owner, > .IP \(bu > the entry's identifier is > .B group@ > and the requesting process is in the owning group, > .IP \(bu > the entry's identifier is a user and the requesting process is owned by that > user, > .IP \(bu > the entry's identifier is a group and the requesting process is a member in > that group, > .IP \(bu > the entry's identifier is > .BR everyone@ , > .PP > then the entry matches the process; proceed to the next step. Otherwise, > continue with the next ACL entry. > .RE > .IP c) > If the entry denies any of the remaining permissions, access is denied. > .IP d) > If the entry allows any of the remaining permissions, then: > .RS 4 > .IP \(bu 2 > If the > .B masked > ACL flag is set and the entry's identifier is not > .B owner@ > or > .BR everyone@ > or is a user entry matching the file owner, remove all permissions from the > remaining permissions which are both allowed by the entry and included in the > group mask, > .IP \(bu > Otherwise, remove all permissions from the remaining permissions which are > allowed by the entry. > .RE > .RE > .IP 3. > If there are no more remaining permissions, access is allowed. Otherwise, > access is denied. > .PP > In this algorithm, a process can gain the permissions it requires by > accumulating them from multiple RichACL entries. This is in contrast with > POSIX ACLs, where access is only granted if an ACL entry exists that matches > the requesting process and includes all the requested permissions. > > .SS Computing the maximum file masks > When setting an ACL and no file masks have been explicitly specified and when > inheriting an ACL from the parent directory, the following algorithm is used s/directory/directory (as described in section "....")/ > for computing the file masks: > > .IP 1. 4 > Clear the owner, group, and other file masks. Remember which permissions have > already been processed (initially, the empty set). > .IP 2. > For each ACL entry: > .RS 4 > .IP \(bu 2 > If the > .B inherit_only > flag is set, skip the entry. > .IP \(bu > Otherwise, compute which permissions the entry allows or denies that have not > been processed yet (the remaining permissions). > .IP \(bu > If the entry is an > .B owner@ > entry, add the remaining permissions to the owner mask for > .B allow > entries, and remove the remaining permissions from the owner mask for > .B deny > entries. > .IP \(bu > Otherwise, if the entry is an > .B everyone@ > entry, proceed as with > .B owner@ > entries but add or remove the remaining permissions from the owner, group, and > other file masks. > .IP \(bu > Otherwise, proceed as with > .B owner@ > entries but add or remove the remaining permissions from the owner and group > file masks. > .IP \(bu > Add the entry's permissions to the processed permissions. > .RE > .PP > The resulting file masks represent the ACL as closely as possible. With these > file masks, the effective permissions that the ACL grants will be the same when > the > .B masked > flag is set as when it is not set. > > .\" .SH BUGS > .SH AUTHOR > Written by Andreas Grünbacher . > > Please send your bug reports, suggested features and comments to the above address. > > .SH CONFORMING TO > Rich Access Control Lists are Linux-specific. > .SH SEE ALSO > .BR chmod (1), > .BR getrichacl (1), > .BR ls (1), > .BR setrichacl (1) > .BR stat (2), > .BR umask (2), > .BR acl (5) > .\" librichacl So, in terms of actually testing this stuff, is it just a matter of applying your patch series to the kernel, building the kernel, pulling the RichACL user-space tools from Git, and mount(8)ing a filesystem with the right option? Cheers, Michael -- Michael Kerrisk Linux man-pages maintainer; http://www.kernel.org/doc/man-pages/ Linux/UNIX System Programming Training: http://man7.org/training/ From agruenba@redhat.com Tue Feb 23 05:28:51 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=ham version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay3.corp.sgi.com [198.149.34.15]) by oss.sgi.com (Postfix) with ESMTP id 02CEA7F8C for ; Tue, 23 Feb 2016 05:28:51 -0600 (CST) Received: from cuda.sgi.com (cuda2.sgi.com [192.48.176.25]) by relay3.corp.sgi.com (Postfix) with ESMTP id 57F94AC002 for ; Tue, 23 Feb 2016 03:28:44 -0800 (PST) X-ASG-Debug-ID: 1456226076-04cbb06adebafa0001-NocioJ Received: from mail-vk0-f47.google.com (mail-vk0-f47.google.com [209.85.213.47]) by cuda.sgi.com with ESMTP id DPaunhWrhDMk8YqJ (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128 verify=NO) for ; Tue, 23 Feb 2016 03:14:36 -0800 (PST) X-Barracuda-Envelope-From: agruenba@redhat.com X-Barracuda-Apparent-Source-IP: 209.85.213.47 Received: by mail-vk0-f47.google.com with SMTP id e6so157591731vkh.2 for ; Tue, 23 Feb 2016 03:14:36 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:date :message-id:subject:from:to:cc:content-type; bh=VsZgvWArTeTL2n+pcaJy3aGslnffis9xCVRV0zv7G3I=; b=eZYk6vxtC0ePo730RF72lfa3/EF7+rCRzATngl8Tje2p9XO0OcfSWcvktYgQwWY9tc WtJRRn3ZZknXpXJnE3aVeoXm4tvpQFQIG4WdHvC49BIG9CDyG4ys29HFVDF/gJnlpHjC AmHJ+2CkUscz3VFpUMkuVOFAOsENpieqJcLe/0oGNe/jG06KOiJ3aFsJ3P0VxJr4Vfpg Y90XA9wjW2dnATwPuJH9Boox+fF27GMKhWIgCrsWFXkX5CF2/lOW3e/ut/486sW8VhDd 6dS+P74/lWOOGlT+CoU7zibrUMjnf/EtSI0DjQ6dK9fNqhgYJnOVOjPsztSS3aNJOt9c muGw== X-Gm-Message-State: AG10YORNb4q52pFrMexlFCqni/UDbZdqAnRZAb/5JJT6+dfyGqOw7jiCE40JP0cuabKr2ZpOLacNT82nCB8RMjfx MIME-Version: 1.0 X-Received: by 10.31.151.75 with SMTP id z72mr25289027vkd.104.1456226076134; Tue, 23 Feb 2016 03:14:36 -0800 (PST) Received: by 10.176.64.130 with HTTP; Tue, 23 Feb 2016 03:14:35 -0800 (PST) In-Reply-To: <56CC3B4A.7070204@gmail.com> References: <56B770B6.7040803@gmail.com> <56B77262.7090107@gmail.com> <56C0F23C.7030902@gmail.com> <56CA2EEB.9080504@gmail.com> <56CC3B4A.7070204@gmail.com> Date: Tue, 23 Feb 2016 12:14:35 +0100 Message-ID: Subject: Re: richacl(7) man page review comments From: Andreas Gruenbacher X-ASG-Orig-Subj: Re: richacl(7) man page review comments To: "Michael Kerrisk (man-pages)" Cc: "J. Bruce Fields" , linux-ext4 , XFS Developers , lkml , linux-fsdevel , Linux NFS Mailing List , linux-cifs@vger.kernel.org, Linux API , Dave Chinner , Christoph Hellwig , Anna Schumaker , Trond Myklebust , Jeff Layton , Andreas Dilger Content-Type: text/plain; charset=UTF-8 X-Barracuda-Connect: mail-vk0-f47.google.com[209.85.213.47] X-Barracuda-Start-Time: 1456226076 X-Barracuda-Encrypted: ECDHE-RSA-AES128-GCM-SHA256 X-Barracuda-URL: https://192.48.176.25:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-BRTS-Status: 1 X-Barracuda-Spam-Score: 0.00 X-Barracuda-Spam-Status: No, SCORE=0.00 using per-user scores of TAG_LEVEL=1000.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.7 tests=BSF_SC0_MISMATCH_TO X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.3.27263 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 0.00 BSF_SC0_MISMATCH_TO Envelope rcpt doesn't match header On Tue, Feb 23, 2016 at 11:58 AM, Michael Kerrisk (man-pages) wrote: > So, in terms of actually testing this stuff, is it just a matter of > applying your patch series to the kernel, building the kernel, pulling > the RichACL user-space tools from Git, and mount(8)ing a filesystem with > the right option? You'd create a test filesystem with the appropriate feature flag set (mkfs.ext4 -O richacl2 / mkfs.xfs -m richacl=1), RichACLs are not enabled by mount options anymore. This will obviously require versions of e2fsprogs / xfsprogs that understand the feature. If you want coreutils support which isn't strictly necessary, you'll need the patched version too. Other than that, it's really simple. Andreas From alex@zadarastorage.com Tue Feb 23 06:25:55 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: * X-Spam-Status: No, score=1.9 required=5.0 tests=STOX_REPLY_TYPE,T_DKIM_INVALID autolearn=no version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay3.corp.sgi.com [198.149.34.15]) by oss.sgi.com (Postfix) with ESMTP id EA2447CA3 for ; Tue, 23 Feb 2016 06:25:54 -0600 (CST) Received: from cuda.sgi.com (cuda3.sgi.com [192.48.176.15]) by relay3.corp.sgi.com (Postfix) with ESMTP id 3D4A0AC003 for ; Tue, 23 Feb 2016 04:25:47 -0800 (PST) X-ASG-Debug-ID: 1456230338-04cb6c455b97bc0001-NocioJ Received: from mail-wm0-f52.google.com (mail-wm0-f52.google.com [74.125.82.52]) by cuda.sgi.com with ESMTP id rZhbWwlBkOvit9Tg (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128 verify=NO) for ; Tue, 23 Feb 2016 04:25:39 -0800 (PST) X-Barracuda-Envelope-From: alex@zadarastorage.com X-Barracuda-Apparent-Source-IP: 74.125.82.52 Received: by mail-wm0-f52.google.com with SMTP id c200so217678647wme.0 for ; Tue, 23 Feb 2016 04:25:39 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=zadarastorage-com.20150623.gappssmtp.com; s=20150623; h=message-id:from:to:cc:references:in-reply-to:subject:date :mime-version:content-type:content-transfer-encoding:importance; bh=SJiwXqy1J/+otgcDFkIhwjhnGmyPwj1nVl/AVB1fqXo=; b=1S5SGsicDDSZuFvywkC+lOn/GrlBCXsS/ahfk6XNL1jdF1Hv5FsMqCWu3Vxy8LB7XA Vru3Y+D1IPw9h/5faNnCye9Px7hGJ6R74b/DZfhKcb34qgUvwThSzBks5E+ff9DE13Ti F0XFQZ1aT8uE6DFkjQE1iZhdIKXx+PYVxGoKx0JIHsyAviYdvPntqd88GZKeD3zx3QtG cidMzc6bDSz6oPa5hrF2gG4nU5KVtX6WhDk13jFDl+Hy9iNJt7NjVGju2XXML3BWb9+W 1qBcWZHU92BtDoOo4p7OpBMpW6l0aB6Ui9bkiVCWHwjK3HYjUtFkL11tjHBXOsTE0DKS JLCw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:message-id:from:to:cc:references:in-reply-to :subject:date:mime-version:content-type:content-transfer-encoding :importance; bh=SJiwXqy1J/+otgcDFkIhwjhnGmyPwj1nVl/AVB1fqXo=; b=P2f7BjYM5Ma3f+BTjt/MdOTkhA4QDpCkH6omHqdUHdZ7sWy9y/DpMMfwjQ8iTEPl1p bvdu1ljdqU1ufmYhiwVqO+zY8D1mGk1XpqBNm5beVzhVcy7ihX8IyWfoOBl6fm3Pcwc2 CSHcUktr979L+SbiNJj+vZWng2VNqszL45IAunVn56zZVXf5ou7605fGKR9FepGglJQ5 kXZU5l/TcTtAD4p7UsxsVFRYZ9npiwBTdJ8T5yKEvqKgHk9aaOGU5cSeBP68DOe8XKLI nMfk/4tzVhHiZ8TB881MzkhNUfJgvSudr4LwDIweM0t/JdeHe+1/RqK74uKw5kHdpWJj /VFg== X-Gm-Message-State: AG10YOQjepFRVzOQsQF7wzhKkZ2NB/iWcIi8VSBvKIXe0AjCdUAlKfmppL9rS0TlSjksgg== X-Received: by 10.194.77.193 with SMTP id u1mr33033747wjw.73.1456230338220; Tue, 23 Feb 2016 04:25:38 -0800 (PST) Received: from alyakaslap (bzq-169-168-31-234.red.bezeqint.net. [31.168.169.234]) by smtp.gmail.com with ESMTPSA id xx3sm29519366wjc.32.2016.02.23.04.25.36 (version=TLSv1/SSLv3 cipher=OTHER); Tue, 23 Feb 2016 04:25:37 -0800 (PST) Message-ID: From: "Alex Lyakas" To: "Dave Chinner" Cc: , "Christoph Hellwig" , "Danny Shavit" , "Yair Hershko" , "Shyam Kaushik" References: <3685DFAD20214109878873CF81232704@alyakaslap> <20160222212019.GI25832@dastard> <20160222235628.GK25832@dastard> In-Reply-To: <20160222235628.GK25832@dastard> Subject: Re: xfs resize: primary superblock is not updated immediately Date: Tue, 23 Feb 2016 14:25:38 +0200 X-ASG-Orig-Subj: Re: xfs resize: primary superblock is not updated immediately MIME-Version: 1.0 Content-Type: text/plain; format=flowed; charset="iso-8859-1"; reply-type=original Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal Importance: Normal X-Mailer: Microsoft Windows Live Mail 15.4.3555.308 X-MimeOLE: Produced By Microsoft MimeOLE V15.4.3555.308 X-Barracuda-Connect: mail-wm0-f52.google.com[74.125.82.52] X-Barracuda-Start-Time: 1456230339 X-Barracuda-Encrypted: ECDHE-RSA-AES128-GCM-SHA256 X-Barracuda-URL: https://192.48.176.15:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-BRTS-Status: 1 X-Barracuda-Spam-Score: 0.00 X-Barracuda-Spam-Status: No, SCORE=0.00 using per-user scores of TAG_LEVEL=1000.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.7 tests=BSF_SC0_MISMATCH_TO, DKIM_SIGNED, DKIM_VERIFIED, STOX_REPLY_TYPE X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.3.27264 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 0.00 STOX_REPLY_TYPE STOX_REPLY_TYPE 0.00 BSF_SC0_MISMATCH_TO Envelope rcpt doesn't match header -0.00 DKIM_VERIFIED Domain Keys Identified Mail: signature passes verification 0.00 DKIM_SIGNED Domain Keys Identified Mail: message has a signature Hi Dave, Below is a detailed reproduction scenario of the problem. No snapshots involved, only XFS. The scenario is performed on a VM, running kernel 3.18.19. 1) Use 100 MB block device for XFS. In my case, this is achieved by: # dmsetup create xfs_base --table "0 204800 linear /dev/vdd 0" 2) Create XFS on the block device: # mkfs.xfs -f -K /dev/mapper/xfs_base -d agsize=25690112 -l size=10485760 -p /etc/zadara/xfs.protofile The protofile is [1]. Output: meta-data=/dev/mapper/xfs_base isize=256 agcount=4, agsize=6272 blks = sectsz=512 attr=2, projid32bit=0 data = bsize=4096 blocks=25088, imaxpct=25 = sunit=0 swidth=0 blks naming =version 2 bsize=4096 ascii-ci=0 log =internal log bsize=4096 blocks=2560, version=2 = sectsz=512 sunit=0 blks, lazy-count=1 realtime =none extsz=4096 blocks=0, rtextents=0 So we have 4 AGs right now. We are not using the full 100 Mb. 3) Mount the XFS: # mount -o sync /dev/mapper/xfs_base /mnt/xfs/ 4) Verify the primary superblock on disk: # xfs_db -r -c "sb 0" -c "p" /dev/mapper/xfs_base | grep agc agcount = 4 5) Resize to full 100MB: # xfs_growfs -d /mnt/xfs Output: meta-data=/dev/mapper/xfs_base isize=256 agcount=4, agsize=6272 blks = sectsz=512 attr=2 data = bsize=4096 blocks=25088, imaxpct=25 = sunit=0 swidth=0 blks naming =version 2 bsize=4096 ascii-ci=0 log =internal bsize=4096 blocks=2560, version=2 = sectsz=512 sunit=0 blks, lazy-count=1 realtime =none extsz=4096 blocks=0, rtextents=0 data blocks changed from 25088 to 25600 6) Verify that primary superblock still have 4 AGs: # xfs_db -r -c "sb 0" -c "p" /dev/mapper/xfs_base | grep agc agcount = 4 7) Immediately crash the VM 8) After VM reboots, re-create the device mapper # dmsetup create xfs_base --table "0 204800 linear /dev/vdd 0" 9) mount # mount -o sync /dev/mapper/xfs_base /mnt/xfs/ Kernel panics with [2]. Note that I added some prints to xfs_perag_get() in case the pag is not found, and also to xfs_initialize_perag() when adding a new pag. The prints indicate, that after mount XFS did not create pag for agno 4. But during log mount/replay it needs this pag and crashes. Does this repro align with what you expect currently? Thanks, Alex. [1] # cat /etc/zadara/xfs.protofile dummy : bootfilename, not used, backward compatibility 0 0 : numbers of blocks and inodes, not used, backward compatibility d--777 0 0 : set 777 perms for the root dir $ $ [2] [ 53.506307] [2392]xfs*[xfs_perag_get:130] XFS(dm-0): pag[0]: not found! [ 53.506323] [2392]xfs [xfs_initialize_perag:239] XFS(dm-0): Add pag[0] [ 53.506326] [2392]xfs*[xfs_perag_get:130] XFS(dm-0): pag[1]: not found! [ 53.506332] [2392]xfs [xfs_initialize_perag:239] XFS(dm-0): Add pag[1] [ 53.506336] [2392]xfs*[xfs_perag_get:130] XFS(dm-0): pag[2]: not found! [ 53.506348] [2392]xfs [xfs_initialize_perag:239] XFS(dm-0): Add pag[2] [ 53.506358] [2392]xfs*[xfs_perag_get:130] XFS(dm-0): pag[3]: not found! [ 53.506392] [2392]xfs [xfs_initialize_perag:239] XFS(dm-0): Add pag[3] [ 53.506397] XFS (dm-0): Mounting V4 Filesystem [ 53.562231] XFS (dm-0): Starting recovery (logdev: internal) [ 53.567501] [2392]xfs*[xfs_perag_get:130] XFS(dm-0): pag[4]: not found! [ 53.567574] BUG: unable to handle kernel NULL pointer dereference at 00000000000000a0 [ 53.568464] IP: [] _raw_spin_lock+0x16/0x60 [ 53.568464] PGD 7b446067 PUD 35299067 PMD 0 [ 53.568464] Oops: 0002 [#1] PREEMPT SMP [ 53.568464] CPU: 3 PID: 2392 Comm: mount Tainted: G OE 3.18.19-zadara05 #1 [ 53.568464] Hardware name: Bochs Bochs, BIOS Bochs 01/01/2007 [ 53.568464] task: ffff88007b698a20 ti: ffff880076fdc000 task.ti: ffff880076fdc000 [ 53.568464] RIP: 0010:[] [] _raw_spin_lock+0x16/0x60 [ 53.568464] RSP: 0018:ffff880076fdfa48 EFLAGS: 00010282 [ 53.568464] RAX: 0000000000020000 RBX: ffff880035331900 RCX: 0000000000000000 [ 53.568464] RDX: ffff88007fd8f238 RSI: ffff88007fd8d318 RDI: 00000000000000a0 [ 53.568464] RBP: ffff880076fdfa48 R08: 0000000000000096 R09: 0000000000000000 [ 53.568464] R10: 00000000000002de R11: ffff880076fdf64e R12: 0000000000000001 [ 53.568464] R13: 0000000000000001 R14: 0000000000000000 R15: 0000000000000000 [ 53.568464] FS: 00007ff569ee7880(0000) GS:ffff88007fd80000(0000) knlGS:0000000000000000 [ 53.568464] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 [ 53.568464] CR2: 00000000000000a0 CR3: 0000000076f07000 CR4: 00000000000406e0 [ 53.568464] Stack: [ 53.568464] ffff880076fdfa98 ffffffffc0989247 00000000000000a0 0000000000031001 [ 53.568464] ffff880076fdfac8 ffff880035331900 0000000000000001 0000000000000001 [ 53.568464] ffff880076fdfbb8 0000000000000001 ffff880076fdfae8 ffffffffc09894ba [ 53.568464] Call Trace: [ 53.568464] [] _xfs_buf_find+0x97/0x2e0 [xfs] [ 53.568464] [] xfs_buf_get_map+0x2a/0x210 [xfs] [ 53.568464] [] ? _xfs_buf_read+0x23/0x40 [xfs] [ 53.568464] [] xfs_buf_read_map+0x2c/0x190 [xfs] [ 53.568464] [] xfs_trans_read_buf_map+0x1e9/0x490 [xfs] [ 53.568464] [] xfs_read_agf+0x84/0x110 [xfs] [ 53.568464] [] xfs_alloc_read_agf+0x4b/0x150 [xfs] [ 53.568464] [] xfs_alloc_pagf_init+0x1a/0x40 [xfs] [ 53.568464] [] xfs_initialize_perag_data+0xa0/0x120 [xfs] [ 53.568464] [] xfs_mountfs+0x5d2/0x7b0 [xfs] [ 53.568464] [] xfs_fs_fill_super+0x2ca/0x360 [xfs] [ 53.568464] [] mount_bdev+0x1b0/0x1f0 [ 53.568464] [] ? xfs_parseargs+0xbe0/0xbe0 [xfs] [ 53.568464] [] xfs_fs_mount+0x15/0x20 [xfs] [ 53.568464] [] mount_fs+0x39/0x1b0 [ 53.568464] [] ? __alloc_percpu+0x15/0x20 [ 53.568464] [] vfs_kern_mount+0x6b/0x120 [ 53.568464] [] do_mount+0x222/0xca0 [ 53.568464] [] SyS_mount+0x8b/0xe0 [ 53.568464] [] system_call_fastpath+0x16/0x1b -----Original Message----- From: Dave Chinner Sent: 23 February, 2016 1:56 AM To: Alex Lyakas Cc: xfs@oss.sgi.com ; Christoph Hellwig ; Danny Shavit Subject: Re: xfs resize: primary superblock is not updated immediately On Tue, Feb 23, 2016 at 12:38:48AM +0200, Alex Lyakas wrote: > Hi Dave, > Thanks for your response. > > I am not freezing the filesystem before the snapshot. There's your problem. A mounted filesystem is not consistent on disk without flushing the entire journal and all the dirty metadata to disk. > However, let's assume that somebody resized the XFS, and it completed > and got back to user-space. At this moment the primary superblock > on-disk is not updated yet with the new agcount. And at this same > moment there is a power-out. After the power comes back and the > machine boots, if we mount the XFS, the same problem would happen, I > believe. Log recovery will run and update the superblock buffer with the correct values. But the in-memory superblock that log recoery is working with does not change, and so if there were accesses beyond the current superblock ag/block count you'd see messages like this: XFS (sda1): _xfs_buf_find: Block out of range: block 0xnnnnn EOFS 0xmmmmm and log recovery should fail at that point because it can't pull in a buffer it needs for recovery to make further progress. At which point, you have an unmountable filesystem. If log recovery succeeds, then yes, I can see that there is a problem here because the per-ag tree is not reinitialised after the superblock is re-read. That's a pretty easy fix, though (3-4 lines of code in xlog_do_recover() to detect a change in filesystem block count and call xfs_initialize_perag() again. > Taking a block-level snapshot is exactly like a power-out from XFS > perspective. It's similar, but it's not the same. e.g. there are no issues like volatile storage cache loss that have to be handled. > And XFS should, in principle, be able to recover from > that. For some definition of recover. There is no guarantee that any of the async transactions in memory will make it to disk, so the point to which XFS can recover is undefined. > The snapshot will come up as a new block device, which exhibits > identical content as the original block device had at the moment when > the snapshot was taken (like a boot after power-out). The block device might be identical, but it's not identical to what the filesystem is presenting the user. Any user dirty data cached in memory, or metadata changes staged in the CIL will not be in the snapshot. Hence the snapshot block device is not identical to the original user visible state and data. You only get that if you freeze the filesystem before taking the snapshot. Cheers, Dave. -- Dave Chinner david@fromorbit.com From agruenba@redhat.com Tue Feb 23 09:27:36 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=ham version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay1.corp.sgi.com [137.38.102.111]) by oss.sgi.com (Postfix) with ESMTP id 8C62B7F92 for ; Tue, 23 Feb 2016 09:27:36 -0600 (CST) Received: from cuda.sgi.com (cuda3.sgi.com [192.48.176.15]) by relay1.corp.sgi.com (Postfix) with ESMTP id 4D83E8F8040 for ; Tue, 23 Feb 2016 07:27:30 -0800 (PST) X-ASG-Debug-ID: 1456240142-04cb6c700713c90001-NocioJ Received: from mail-vk0-f45.google.com (mail-vk0-f45.google.com [209.85.213.45]) by cuda.sgi.com with ESMTP id YYicSdtB79cJlUwA (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128 verify=NO) for ; Tue, 23 Feb 2016 07:09:03 -0800 (PST) X-Barracuda-Envelope-From: agruenba@redhat.com X-Barracuda-Apparent-Source-IP: 209.85.213.45 Received: by mail-vk0-f45.google.com with SMTP id e185so163480113vkb.1 for ; Tue, 23 Feb 2016 07:09:03 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:date :message-id:subject:from:to:cc:content-type :content-transfer-encoding; bh=6+bgS0j3MLDtUEW81WDQyMtivTRkNi2SwbX5iU0UOhA=; b=a8XxJjHKzEBgK5U08YvdXDvhfnE4EZN3jZw7qydVlqjqzetvRboJsgqDQ1qeBOKxds 7iKUftRK/xk7kzNaotJO4JGcCRW4hB7ynRjwc2GVGSEZpRxStWB75TG+fqQHxbkFzfIw PnU8Owpgccu8cbNtGjZaIsh6kpdB+ojJH4+wv+TQFZzzQXhFqpuXI+eImzp6VWEdZ1D5 8NyKVcSTIEWLmkVYtV6MaW3xy39Ai6L6LAgL9fcfv2EzBT1VAnZcIb3JhkfhGff5+fqL q8QnTNt9Z37ZFEow1mOABlDs1P0U5wQkSsV5XE0bByBrAmZXYqYPcQrQ0EZj1LCTJBFT ging== X-Gm-Message-State: AG10YOSnSRF2szqZEG/bygv8ZEW/nHQHwpizxL7pWzsI0L+lydGHicIFJ8ISHdIMWATGxv3P979pNzlOqO6BsK5s MIME-Version: 1.0 X-Received: by 10.31.52.65 with SMTP id b62mr28534039vka.61.1456240142330; Tue, 23 Feb 2016 07:09:02 -0800 (PST) Received: by 10.176.64.130 with HTTP; Tue, 23 Feb 2016 07:09:02 -0800 (PST) In-Reply-To: <56CC3B4A.7070204@gmail.com> References: <56B770B6.7040803@gmail.com> <56B77262.7090107@gmail.com> <56C0F23C.7030902@gmail.com> <56CA2EEB.9080504@gmail.com> <56CC3B4A.7070204@gmail.com> Date: Tue, 23 Feb 2016 16:09:02 +0100 Message-ID: Subject: Re: richacl(7) man page review comments From: Andreas Gruenbacher X-ASG-Orig-Subj: Re: richacl(7) man page review comments To: "Michael Kerrisk (man-pages)" Cc: "J. Bruce Fields" , linux-ext4 , XFS Developers , lkml , linux-fsdevel , Linux NFS Mailing List , linux-cifs@vger.kernel.org, Linux API , Dave Chinner , Christoph Hellwig , Anna Schumaker , Trond Myklebust , Jeff Layton , Andreas Dilger Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-Barracuda-Connect: mail-vk0-f45.google.com[209.85.213.45] X-Barracuda-Start-Time: 1456240143 X-Barracuda-Encrypted: ECDHE-RSA-AES128-GCM-SHA256 X-Barracuda-URL: https://192.48.176.15:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-BRTS-Status: 1 X-Barracuda-Spam-Score: 0.00 X-Barracuda-Spam-Status: No, SCORE=0.00 using per-user scores of TAG_LEVEL=1000.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.7 tests=BSF_SC0_MISMATCH_TO X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.3.27267 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 0.00 BSF_SC0_MISMATCH_TO Envelope rcpt doesn't match header Hi Michael, On Tue, Feb 23, 2016 at 11:58 AM, Michael Kerrisk (man-pages) wrote: > On 02/22/2016 03:46 PM, Andreas Gruenbacher wrote: >> On Sun, Feb 21, 2016 at 10:40 PM, Michael Kerrisk (man-pages) wrote: >>> I've once more pulled from the latest git; here's some more comments. >> >> thanks again. I've updated the repo with your changes. > > Next round :-). Just a few quick comments while I'm on a train ride. applied, thanks. >> .\" >> .\" RichACL Manual Pages >> .\" >> .\" Copyright (C) 2015,2016 Red Hat, Inc. >> .\" Written by Andreas Gruenbacher >> .\" This is free documentation; you can redistribute it and/or >> .\" modify it under the terms of the GNU General Public License as >> .\" published by the Free Software Foundation; either version 2 of >> .\" the License, or (at your option) any later version. >> .\" >> .\" The GNU General Public License's references to "object code" >> .\" and "executables" are to be interpreted as the output of any >> .\" document formatting or typesetting system, including >> .\" intermediate and printed output. >> .\" >> .\" This manual is distributed in the hope that it will be useful, >> .\" but WITHOUT ANY WARRANTY; without even the implied warranty of >> .\" MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the >> .\" GNU General Public License for more details. >> .\" >> .\" You should have received a copy of the GNU General Public >> .\" License along with this manual. If not, see >> .\" . >> .\" >> .de URL >> \\$2 \(laURL: \\$1 \(ra\\$3 >> .. >> .if \n[.g] .mso www.tmac >> .TH RICHACL 7 2015-09-01 "Linux" "Rich Access Control Lists" >> .SH NAME >> richacl \- Rich Access Control Lists >> .SH DESCRIPTION >> Rich Access Control Lists (RichACLs) are an extension of the POSIX file >> permission model (see >> .BR acl (5)) >> to support >> .URL https://tools.ietf.org/rfc/rfc5661.txt "NFSv4 Access Control Lists" >> on local and remote-mounted filesystems. >> >> A RichACL can always be translated into an equivalent NFSv4 ACL which gr= ants >> the same permissions. >> >> RichACLs can be enabled on supported local filesystems (currently, ext4 = and >> XFS). The in-kernel NFSv4 server and client also include RichACL suppor= t. >> >> Enabling RichACLs disables POSIX Access Control Lists; the two ACL model= s >> cannot coexist on the same filesystem. >> >> When used on a filesystem that does not support RichACLs, the >> .BR getrichacl (1) >> and >> .BR setrichacl (1) >> utilities will operate on the file permission bits instead: >> .BR getrichacl (1) >> will display the file permission bits as a RichACL; when a RichACL >> is set with >> .BR setrichacl (1) >> which can be represented exactly by the file permission bits, >> .BR setrichacl (1) >> will set the file permission bits instead. An attempt to set a RichACL = that >> cannot be represented exactly by the file permission bits results in an = error. >> >> .SS Structure of RichACLs >> >> RichACLs consist of a number of ACL entries, three file masks, and a set= of >> flags specifying attributes of the ACL as a whole (by contrast with the >> per-ACL-entry flags described below). >> >> Each of the ACL entries allows or denies some permissions to a particula= r user, >> group, or special identifier. An ACL entry consists of four fields: >> >> .IP \(bu 2 >> A tag which specifies the user, group, or special identifier the entry a= pplies >> to. Special identifiers can be the file owner >> .RB ( owner@ ), >> the owning group >> .RB ( group@ ), >> or everyone >> .RB ( everyone@ ). >> .IP \(bu >> A set of permissions the entry allows or denies. >> .IP \(bu >> A set of flags that indicate whether the user or group identifier is map= ped or >> unmapped, and whether the entry has been and can be inherited. >> .IP \(bu >> A type field indicating whether the entry allows or denies the permissio= ns >> specified in the second field. >> .PP >> The owner, group, and other file masks further control which permissions= the >> ACL grants, subject to the >> .BR masked "\ (" m ) >> and >> .BR write_through "\ (" w ) >> ACL flags: when the permissions of a file or directory are changed with >> .BR chmod (2), >> the file masks are set based on the new file mode, and the >> .B masked >> and >> .B write_through >> ACL flags are set. Likewise, when a new file or directory inherits an AC= L from >> its parent directory, the file masks are set to the intersection between= the >> permissions granted by the inherited ACL and the >> .I mode >> parameter as given to >> .BR open "(2), " mkdir (2), >> and similar, and the >> .B masked >> ACL flag is set. In both cases, the file masks limit the permissions tha= t the >> ACL will grant. >> >> The purpose of the file masks is to allow traditional POSIX applications= which >> are unaware of RichACLs to place limits on the permissions granted by th= e >> RichACL without causing the ACL entries to be modified. Without the fil= e mask, >> the only alternative would be for the kernel to directly modify the ACL >> entries. However, this latter approach could have a "hysteresis effect"= , >> whereby a RichACL-unaware application that performs a transition from on= e file >> mode to another file mode and then back to the original file mode could = cause >> destruction of the permission information in ACL entries. When creating= files >> or directories, the >> .I mode >> parameter to >> .BR open "(2), " mkdir (2), >> and similar would cause the same effect. > > s/cause/have/ > >> >> Note that entries with the identifier >> .B everyone@ >> apply to all processes, whereas the \(lqother\(rq file permissions and >> \(lqother\(rq entries in POSIX ACLs apply to all processes which are not= the > > So, I still think it's helpful to mention ACL_OTHER here. How about: > > s/\\(lqother\\(rq/\\(lqother\\(rq (\\fBACL_OTHER\\fP)/ > >> owner, are not in the owning group, and do not match a user or group men= tioned >> in the ACL. >> >> Unlike POSIX ACLs, RichACLs do not have separate \(lqaccess\(rq ACLs tha= t >> define the access permissions and \(lqdefault\(rq ACLs that define the >> inheritable permissions. Instead, flags on each ACL entry determine whe= ther >> the entry is effective during access checks and/or inheritable. >> >> >> .SS ACL flags >> >> The following ACL flags are defined: >> >> .TP >> .BR masked "\ (" m ) >> When set, the file masks define upper limits on the permissions the ACL = may >> grant. When not set, the file masks are ignored. >> .TP >> .BR write_through "\ (" w ) >> When this flag and the >> .B masked >> flag are both set, the owner and other file masks define the actual perm= issions >> granted to the file owner and to others instead of defining an upper lim= it. >> When the >> .B masked >> flag is not set, the >> .B write_through >> flag has no effect. >> .TP >> .BR auto_inherit "\ (" a ) >> Automatic Inheritance is enabled. See >> .IR "Automatic Inheritance" . >> .TP >> .BR protected "\ (" p ) >> The ACL is protected from modification by Automatic >> Inheritance. >> .TP >> .BR defaulted "\ (" d ) >> Indicates that the ACL has been assigned in an application-dependent way= when >> the file or directory was created; it has neither been inherited nor set >> explicitly. ACLs of files created on Linux will never have the >> .B defaulted >> flag set, but the flag may be set on files created on or copied over fro= m >> other operating systems. When this flag is set for an ACL, Automatic >> Inheritance will completely replace the ACL. >> >> .SS ACL entry flags >> >> The following flags on ACL entries are defined: >> >> .TP >> .BR file_inherit "\ (" f ) >> When this flag appears in the ACL entry of a directory, then: >> .RS >> .IP \(bu 2 >> That entry is inherited by new files created in the directory such that = the >> permissions of the entry apply to the file (the inheritance flags of the >> inherited entry are cleared). >> .IP \(bu >> The entry is is inherited by new subdirectories created in the directory= such >> that the permissions of the entry will apply to new files created in the >> subdirectory. >> .RE >> .TP >> .BR dir_inherit "\ (" d ) >> When this flag appears in the ACL entry of a directory, then that entry = is >> inherited by new subdirectories created in the directory such that the >> permissions of the entry apply to the subdirectory (the >> .B inherit_only >> flag is cleared). >> .TP >> .BR no_propagate "\ (" n ) >> Inheritance stops at the next subdirectory level. When a file or direct= ory >> inherits an entry that has this flag set, the >> .BR file_inherit ", " dir_inherit ", " no_propagate ", and " inherit_onl= y >> flags are cleared. >> .TP >> .BR inherit_only "\ (" i ) >> The entry defines inheritable permissions only and is ignored for access >> checking. When a file or directory inherits an entry that has this flag= set, >> the flag is cleared. >> .TP >> .BR inherited "\ (" a ) >> The entry has been automatically inherited from the parent directory. >> .TP >> .BR unmapped "\ (" u ) >> The user or group identifier is a textual string and is not mapped to a = numeric >> user or group identifier. ACLs with unmapped identifiers can occur on N= FSv4 >> mounted filesystems when the client cannot determine numeric user or gro= up >> identifiers for some of the NFSv4 user@domain or group@domain who values= . They >> cannot be assigned to local files or directories. >> >> .SS Permissions >> >> The following permissions are defined for RichACL entries and for the th= ree >> file masks: >> >> .TP >> .BR read_data " / " list_directory "\ (" r ) >> For a file: read the data of the file. >> For a directory: list the contents of the directory. >> .TP >> .BR write_data " / " add_file "\ (" w ) >> For a file: modify the data of the file; does not include opening the fi= le in >> append mode. >> For a directory: add a new file in the directory. >> .TP >> .BR append_data " / " add_subdirectory "\ (" p ) >> For a file: open the file in append mode. >> For a directory: create a subdirectory in the directory. >> .TP >> .BR execute "\ (" x ) >> For a file: execute the file. >> For a directory: traverse (search) the directory. >> .TP >> .BR delete_child "\ (" d ) >> Delete a file or directory within a directory. This permission is meani= ngful >> only for directories. >> .TP >> .BR delete "\ (" D ) >> Delete the file or directory. >> .TP >> .BR read_attributes "\ (" a ) >> Read basic attributes of a file or directory (see >> .BR stat (2)). >> This permission is defined by NFSv4. It is stored, but ignored. Readin= g basic >> attributes of files and directories is always allowed on Linux. >> .TP >> .BR write_attributes "\ (" A ) >> Change the times associated with a file or directory to an arbitrary val= ue. >> This permission is always implicitly granted to the file owner. >> .TP >> .BR read_acl "\ (" c ) >> Read the ACL of a file or directory. Like reading the basic file attribu= tes (the >> .B read_attributes >> permission), reading ACLs is always allowed in Linux. >> .TP >> .BR write_acl "\ (" C ) >> Change the ACL or file mode of a file or directory. >> .TP >> .BR write_owner "\ (" o ) >> Take ownership of a file or directory. Change the owning group of a fil= e or >> directory to a group of which the calling process is a member. >> .TP >> .ad l >> .BR read_named_attrs "\ (" R "), " write_named_attrs "\ (" W "), " synch= ronize "\ (" S "), " write_retention "\ (" e "), " write_retention_hold "\ = (" E ) >> .ad >> These permissions are defined by NFSv4 and NFSv4.1. They are stored, bu= t ignored. >> .PP >> For the >> .BR r ", " w ", and " p >> permissions, which have different long forms for files and directories, = the >> .BR getrichacl (1) >> utility will output the appropriate form(s) depending on the context. >> The >> .BR setrichacl (1) >> utility will accept either form for any file type. >> >> .SS Text form >> The common textual representation of a RichACL consists of the colon-sep= arated >> fields of the ACL flags, file masks, and ACL entries in the following >> format: >> .TP >> \fBflags:\fR\fIacl_flags\fR >> The ACL flags. >> .TP >> \fBowner:\fR\fIperm\fR\fB::mask\fR, \fBgroup:\fR\fIperm\fR\fB::mask\fR, = \fBother:\fR\fIperm\fR\fB::mask\fR >> The file masks and their permissions. >> .TP >> \fIwho\fR\fB:\fR\fIperm\fR\fB:\fR\fIflags\fR\fB:allow\fR, \fIwho\fR\fB:\= fR\fIperm\fR\fB:\fR\fIflags\fR\fB:deny\fR >> For each ACL entry, who the entry applies to, the permissions of the ent= ry, the >> entry flags, and the entry type. The \fIwho\fR field is one of the follo= wing: >> .RS >> .IP \(bu 2 >> One of the special identifiers: >> .BR owner@ ", " group@ ", or " everyone@ , >> .IP \(bu >> A >> .BR user: " or " u: >> prefix followed by a user name or user ID that designates a specific use= r, >> .IP \(bu >> A >> .BR group: " or " g: >> prefix followed by a group name or group ID that designates a specific g= roup. >> .RE >> .PP >> The entries are comma, whitespace, or newline separated. > > s/entries/fields of an ACL entry/ (?) No, the fields in each of the different kinds of entries are colon separate= d. "The ACL flags, file masks, and ACL entries are comma, whitespace, or newli= ne separated." >> Flags and permissions have single-letter as well as long forms, as liste= d under >> .IR "ACL flags" , >> .IR "ACL entry flags" , >> and >> .IR Permissions . >> When the single-letter forms are used, the flags or permissions are >> concatenated. When the long forms are used, the flags or permissions are >> separated by slashes. To align permissions or flags vertically, dashes = can be >> used for padding. >> >> .SS Setting and modifying file permissions >> The access permissions for a file can either be set by assigning an Acce= ss >> Control List >> .RB ( setrichacl (1)) >> or by changing the file mode permission bits >> .RB ( chmod (1)). >> In addition, a file can inherit an ACL from its parent directory at crea= tion >> time as described under >> .IR "Permissions at file-creation time" . >> >> .SS Assigning an Access Control List >> When assigning an ACL to a file, unless explicitly specified, the owner,= group, >> and other file masks will be computed from the ACL entries as described = in >> the section >> .IR "Computing the maximum file masks" . >> The owner, group, and other file mode permission bits are then each set = from >> the owner, group, and other file mask as follows: >> .IP \(bu 2 >> If the file mask includes the >> .B r >> permission, the read >> file mode permission bit will be set. >> .IP \(bu >> If the file mask includes the >> .B w >> or >> .B p >> permission, the write file mode permission bit will be set. >> .IP \(bu >> If the file mask includes the >> .B x >> permission, the execute file mode permission bit will be set. >> .PP >> If the ACL can be represented exactly by the file mode permission bits, = the >> file permission bits are set to match the ACL and no ACL is stored. (Wh= en the >> ACL of a file is requested which doesn't have an ACL, the file mode perm= ission >> bits are converted into an equivalent ACL.) >> >> .SS Changing the file mode permission bits >> When changing the file mode permission bits with >> .BR chmod (1), >> the owner, group, and other file permission bits are set to the permissi= on bits >> in the new mode, and the owner, group, and other file masks are set base= d on >> the new mode bits as follows: >> .IP \(bu 2 >> If the read bit in a set of permissions is set, the >> .B r >> permission in the corresponding file mask will be set. >> .IP \(bu >> If the write bit in a set of permissions is set, the >> .B w >> and >> .B p >> permissions in the corresponding file mask will be set. >> .IP \(bu >> If the execute bit in a set of permissions is set, the >> .B x >> permission in the corresponding file mask will be set. >> .PP >> In addition, the >> .B masked >> and >> .B write_through >> ACL flags are set. This has the >> effect of limiting the permissions granted by the ACL to the file mode >> permission bits; in addition, the owner is granted the owner mode bits a= nd >> others are granted the other mode bits. If the >> .B auto_inherit >> flag is set, the >> .B protected >> flag is also set to prevent the Automatic Inheritance algorithm from mod= ifying >> the ACL. >> >> .SS Permissions at file-creation time >> When a directory has any inheritable ACL entries, the following >> happens when a file or directory is created inside that directory: >> .RS 4 > > Remove preceding line. > >> .IP 1. 4 >> A file created inside that directory will inherit all of the ACL entries= that >> have the >> .B file_inherit >> flag set, and all inheritance-related flags in the inherited entries fla= g will >> be cleared. >> >> A subdirectory created inside that directory will inherit all of the ACL >> entries that either have the >> .B dir_inherit >> flag set, or the >> .B file_inherit >> flag set and the >> .B no_propagate >> flag not set. Entries whose >> .B dir_inherit >> flag is set will have their >> .B inherit_only >> flag cleared, and entries whose >> .B dir_inherit >> flag is not set will have their >> .B inherit_only >> flag set. Finally, entries whose >> .B no_propagate >> flag is set will have all inheritance-related flags cleared. >> .IP 2. >> If the parent directory's ACL has the >> .B auto_inherit >> flag set, the inherited ACL will have its > > s/the/then the/ > (For ease of parsing) > >> .B auto_inherit >> flag set, and all entries will have their >> .B inherited >> flag set. Otherwise, the >> .B auto_inherit >> and >> .B inherited >> flags are cleared. >> .IP 3. >> The three file masks are computed from the inherited ACL as described in >> the section >> .IR "Computing the maximum file masks" . >> .IP 4. >> The three sets of permissions for the owner, the group, and for others i= n >> the \fImode\fR parameter as given to >> .BR open (2), >> .BR mkdir (2), >> and similar are converted into sets of RichACL permissions. The correspo= ndence >> between mask flags and RichACL permission bits is described in the secti= on >> .IR "Changing the file mode permission bits" . >> Any RichACL permissions not included in those sets are >> removed from the owner, group, and other file masks. The file mode permi= ssion >> bits are then computed from the file masks as described in the section >> .IR "Assigning an Access Control List" . >> The process umask (see >> .BR umask (2)) >> is ignored. >> .IP 5. >> The >> .B masked >> ACL flag is set. The >> .B write_through >> ACL flag remains cleared. In addition, if the >> .B auto_inherit >> flag of the inherited ACL is set, the >> .B protected >> flag is also set to prevent the Automatic Inheritance algorithm from mod= ifying >> the ACL. >> .RE > > Remove preceding line. > >> .PP >> When a directory does not have inheritable ACL entries, files and direct= ories >> created inside that directory will not be assigned Access Control Lists = and the >> file mode permission bits will be set to (\fImode\fR\ &\ ~\fIumask\fR) w= here >> \fImode\fR is the mode argument of the relevant system call and \fIumask= \fR is >> the process umask (see >> .BR umask (2)). >> >> .SS Automatic Inheritance >> Automatic Inheritance is a mechanism that allows permission changes to >> propagate from a directory to files and subdirectories inside that direc= tory, >> recursively. Propagation is carried out by the process changing the dir= ectory >> permissions (usually, >> .BR setrichacl (1)); >> it happens without user intervention albeit not entirely automatically. >> >> A significant limitation is that this mechanism works only as long as fi= les > > s/limitation/limitation of the Automatic Inheritance feature/ > >> are created without explicitly specifying the file permissions to use. T= he >> standard system calls for creating files and directories >> .RB ( creat (2), >> .BR open (2), >> .BR mkdir (2), >> .BR mknod (2)) > > s/)$/,\nand so on)/ > > (And, I'd drop creat(2) from that list of examples. It's ancient and > obsolete; no need to encourageits use.) > >> all have mandatory mode parameters which define the maximum allowed perm= issions >> of the new files. To take account of this restriction, the >> .B protected >> ACL flag must be set if the >> .B inherited >> flag is set. This effectively disables Automatic Inheritance for that >> particular file. >> >> Notwithstanding the aforementioned limitation, Automatic Inheritance sti= ll >> remains useful for network protocols like NFSv4 and SMB, which both supp= ort >> creating files and directories without defining their permissions. These >> protocols can implement those operations by using the standard system ca= lls and >> by then undoing the effect of applying the mode parameters. >> >> When the ACL of a directory is changed, the following happens for each e= ntry >> (\(lqchild\(rq) inside that directory: >> .IP 1. 4 >> If the entry is a symbolic link, skip the child. >> .IP 2. >> If the >> .B auto_inherit >> flag of the entry's ACL is not set or the >> .B protected >> flag is set, skip the child. >> .IP 3. >> With the child's ACL: >> .RS 4 >> .IP a) 4 >> If the >> .B defaulted >> flag is set, replace the ACL with an empty ACL >> with the >> .B auto_inherit >> flag set. >> .IP b) >> Delete all entries which have the >> .B inherited >> flag set. >> .IP c) >> Append all entries inherited from the parent directory according to step= 1 of >> the algorithm described under >> .IR "Permissions at file-creation time". >> Set the >> .B inherited >> flag of each of these entries. >> .IP d) >> Recompute the file masks. > > At th end of the last section, add: > > as descibed in the section "...." > >> .RE >> .IP 4. >> If the child is a directory, recursively apply this algorithm. >> >> .SS Access check algorithm >> >> When a process requests a particular kind of access (expressed as a set = of >> RichACL permissions) to a file, the following algorithm determines wheth= er the >> access is granted or denied: >> >> .IP 1. 4 >> If the >> .B masked >> ACL flag is set, then: >> .RS 4 >> .IP a) 4 >> If the >> .B write_through >> ACL flag is set, then: >> .RS 4 >> .IP \(bu 2 >> If the requesting process is the file owner, then access is granted if t= he >> owner mask includes the requested permissions, and is otherwise denied. >> .IP \(bu >> If the requesting process is not the file owner and it is in the owning = group or matches any ACL entries other than >> .BR everyone@ , >> proceed to step b). >> .IP \(bu >> If the requesting process is not the file owner, is not in the owning gr= oup, >> and no ACL entries other than >> .B everyone@ >> match the process, then access is granted if the other mask includes the >> requested permissions, and is otherwise denied. >> .RE >> .IP b) >> If any of the following is true: >> .RS 4 >> .IP \(bu 2 >> the requesting process is the file owner and the owner mask does not inc= lude all >> requested permissions, >> .IP \(bu >> the requesting process is not the file owner and it is in the owning gro= up or >> matches any ACL entries other than >> .BR everyone@ , >> and the group mask does not include all requested permissions, >> .IP \(bu >> the requesting process is not the file owner, not in the owning group, i= t >> matches no ACL entries other than >> .BR everyone@ , >> and the other mask does not include all requested permissions, >> .PP >> then access is denied. >> .RE >> .RE >> .IP 2. >> Upon reaching this point, the determination of whether or not access is = granted >> is made by scanning all ACL entries to see if one or more applicable ent= ries >> together grant a cumulative set of permissions that matches the requeste= d >> permissions or there is an applicable entry that explicitly denies one o= r more >> of the requested permissions. The scan of all ACL entries begins by fir= st >> initializing the set of remaining permissions (i.e., those that have not= yet >> been satisfied during the scan) to be the set of requested permissions. = Then >> the ACL entries are scanned >> .IR "in order" , >> and for each entry: >> .RS 4 >> .IP a) 4 >> If the >> .B inherit_only >> or >> .B unmapped >> flags are set, continue with the next ACL entry. >> .IP b) >> If any of the following is true: >> .RS 4 >> .IP \(bu 2 >> the entry's identifier is >> .B owner@ >> and the requesting process is the file owner, >> .IP \(bu >> the entry's identifier is >> .B group@ >> and the requesting process is in the owning group, >> .IP \(bu >> the entry's identifier is a user and the requesting process is owned by = that >> user, >> .IP \(bu >> the entry's identifier is a group and the requesting process is a member= in >> that group, >> .IP \(bu >> the entry's identifier is >> .BR everyone@ , >> .PP >> then the entry matches the process; proceed to the next step. Otherwise, >> continue with the next ACL entry. >> .RE >> .IP c) >> If the entry denies any of the remaining permissions, access is denied. >> .IP d) >> If the entry allows any of the remaining permissions, then: >> .RS 4 >> .IP \(bu 2 >> If the >> .B masked >> ACL flag is set and the entry's identifier is not >> .B owner@ >> or >> .BR everyone@ >> or is a user entry matching the file owner, remove all permissions from = the >> remaining permissions which are both allowed by the entry and included i= n the >> group mask, >> .IP \(bu >> Otherwise, remove all permissions from the remaining permissions which a= re >> allowed by the entry. >> .RE >> .RE >> .IP 3. >> If there are no more remaining permissions, access is allowed. Otherwise= , >> access is denied. >> .PP >> In this algorithm, a process can gain the permissions it requires by >> accumulating them from multiple RichACL entries. This is in contrast wi= th >> POSIX ACLs, where access is only granted if an ACL entry exists that mat= ches >> the requesting process and includes all the requested permissions. >> >> .SS Computing the maximum file masks >> When setting an ACL and no file masks have been explicitly specified and= when >> inheriting an ACL from the parent directory, the following algorithm is = used > > s/directory/directory (as described in section "....")/ Presumably "in the section" here as well. >> for computing the file masks: >> >> .IP 1. 4 >> Clear the owner, group, and other file masks. Remember which permissions= have >> already been processed (initially, the empty set). >> .IP 2. >> For each ACL entry: >> .RS 4 >> .IP \(bu 2 >> If the >> .B inherit_only >> flag is set, skip the entry. >> .IP \(bu >> Otherwise, compute which permissions the entry allows or denies that hav= e not >> been processed yet (the remaining permissions). >> .IP \(bu >> If the entry is an >> .B owner@ >> entry, add the remaining permissions to the owner mask for >> .B allow >> entries, and remove the remaining permissions from the owner mask for >> .B deny >> entries. >> .IP \(bu >> Otherwise, if the entry is an >> .B everyone@ >> entry, proceed as with >> .B owner@ >> entries but add or remove the remaining permissions from the owner, grou= p, and >> other file masks. >> .IP \(bu >> Otherwise, proceed as with >> .B owner@ >> entries but add or remove the remaining permissions from the owner and g= roup >> file masks. >> .IP \(bu >> Add the entry's permissions to the processed permissions. >> .RE >> .PP >> The resulting file masks represent the ACL as closely as possible. With = these >> file masks, the effective permissions that the ACL grants will be the sa= me when >> the >> .B masked >> flag is set as when it is not set. >> >> .\" .SH BUGS >> .SH AUTHOR >> Written by Andreas Gr=C3=BCnbacher . >> >> Please send your bug reports, suggested features and comments to the abo= ve address. >> >> .SH CONFORMING TO >> Rich Access Control Lists are Linux-specific. >> .SH SEE ALSO >> .BR chmod (1), >> .BR getrichacl (1), >> .BR ls (1), >> .BR setrichacl (1) >> .BR stat (2), >> .BR umask (2), >> .BR acl (5) >> .\" librichacl From bounce@hristanbulsummit.com Tue Feb 23 10:00:07 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=HTML_MESSAGE,MIME_QP_LONG_LINE, T_DKIM_INVALID autolearn=ham version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay3.corp.sgi.com [198.149.34.15]) by oss.sgi.com (Postfix) with ESMTP id 8BB987CA0 for ; Tue, 23 Feb 2016 10:00:07 -0600 (CST) Received: from cuda.sgi.com (cuda3.sgi.com [192.48.176.15]) by relay3.corp.sgi.com (Postfix) with ESMTP id B9646AC002 for ; Tue, 23 Feb 2016 08:00:00 -0800 (PST) X-ASG-Debug-ID: 1456243191-04cb6c455b9d3b0001-NocioJ Received: from user-166.hristanbulsummit.com (185.77.41.166.semele.com.tr [185.77.41.166]) by cuda.sgi.com with ESMTP id 4dlIeqSqridkyAom for ; Tue, 23 Feb 2016 07:59:51 -0800 (PST) X-Barracuda-Envelope-From: bounce@hristanbulsummit.com X-Barracuda-Apparent-Source-IP: 185.77.41.166 DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; s=dkim; d=hristanbulsummit.com; h=Sender:Message-ID:Date:Subject:From:Reply-To:To:MIME-Version:Content-Type:List-Id:List-Unsubscribe; i=user-49@hristanbulsummit.com; bh=pU9QqIR2GiqrZ9KOOqZqOyd67zg=; b=TkGZft8wB687EpHayWTomRj+b6TqDTtjfToT+GmwuQbKzZRFZ/GIg+mP1a7OrauY239fWiIsY2Et L+B4pTOa1NBcgv0I7pP1LU5cDokGGAidUwgz3/OFhv2/KK8Z5xLkd7zUHUUlMfnV6qe4FeaF4vqo NHZ1Moi/Bko7a9ywxSk= DomainKey-Signature: a=rsa-sha1; c=nofws; q=dns; s=dkim; d=hristanbulsummit.com; b=Oe11DbN5dutfP37GlnKV423x1/D+g11511eTbmydG1tuWJlFnlMpCoY65AI7T5DVWc0o7XAbTdbk 1nDI0Dq+y7x5nhvZ439yvQxewWiMGVF36gFRhgf85IFjJ2YiwhR7chTpOMLJR0j58EYJd5nTGjMt HS9q0AImkt4e3z5SwBM=; Sender: user-49@hristanbulsummit.com Message-ID: <7a6de9835baf07b3b24fd9cba98027b2@hristanbulsummit.com> Date: Tue, 23 Feb 2016 16:03:25 +0000 Subject: III Dijital IK Zirvesi =?utf-8?Q?kay=C4=B1tlar=C4=B1_ba?= =?utf-8?Q?=C5=9Flad=C4=B1?= From: Beyza Celik Schwimmer X-ASG-Orig-Subj: III Dijital IK Zirvesi =?utf-8?Q?kay=C4=B1tlar=C4=B1_ba?= =?utf-8?Q?=C5=9Flad=C4=B1?= Reply-To: Beyza Celik Schwimmer To: "xfs@oss.sgi.com" MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="_=_swift_v4_1456243405_968166b49942c1e3f61f48e14882ff0c_=_" X-Receiver: xfs@oss.sgi.com X-Report-Abuse: Please report abuse for this campaign here: http://hristanbulsummit.com/index.php/campaigns/gv3523ce0h2db/report-abuse/cm058bl894165/cb04229tvq84a X-Mw-Tracking-Did: 0 List-Id: cm058bl894165 List-Unsubscribe: , X-Mw-Campaign-Uid: gv3523ce0h2db X-Mw-Subscriber-Uid: cb04229tvq84a X-Mw-Customer-Uid: kw6630cm7e3df X-Sender: bounce@hristanbulsummit.com X-Mw-Customer-Gid: 0 X-Mw-Mailer: SwiftMailer X-Mw-Delivery-Sid: 1 X-Barracuda-Connect: 185.77.41.166.semele.com.tr[185.77.41.166] X-Barracuda-Start-Time: 1456243191 X-Barracuda-URL: https://192.48.176.15:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-BRTS-Status: 1 X-Barracuda-Spam-Score: 1.02 X-Barracuda-Spam-Status: No, SCORE=1.02 using per-user scores of TAG_LEVEL=1000.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.7 tests=BSF_SC0_SA085, DKIM_SIGNED, DKIM_VERIFIED, HTML_MESSAGE, MIME_QP_LONG_LINE, MIME_QP_LONG_LINE_2, RDNS_DYNAMIC X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.3.27268 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- -0.00 DKIM_VERIFIED Domain Keys Identified Mail: signature passes verification 0.00 DKIM_SIGNED Domain Keys Identified Mail: message has a signature 0.00 HTML_MESSAGE BODY: HTML included in message 0.00 MIME_QP_LONG_LINE RAW: Quoted-printable line longer than 76 chars 0.82 MIME_QP_LONG_LINE_2 RAW: Quoted-printable line longer than 76 chars 0.10 BSF_SC0_SA085 Custom Rule SA085 0.10 RDNS_DYNAMIC Delivered to trusted network by host with dynamic-looking rDNS --_=_swift_v4_1456243405_968166b49942c1e3f61f48e14882ff0c_=_ Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable =20 #HRTECH2016 VIEW AS A WEB PAGE http://hr= istanbulsummit.com/index.php/campaigns/gv3523ce0h2db/web-version/cb04229= tvq84a nsan Kaynakla= r Y?netiminde Dijital Uygulamalar Teknoloji ile Yeniden ekillenen IK Baarlar Zirvesi=20 III. DİJİTAL HR ZİRVESİ=20 23 MART 2016 / 09.00 &NDASH; 17.30 / İSTANBUL HILTON &NDASH; HARBIYE=20 Konumaclar: - AYLIN SATUN OLSUN / VP Level Senior Human Resource Executive - Board Member / Blogger - SEDA KAYRAK KıZıLTAN / nsan Kaynaklar Genel M=FCd=FCr Yardmcs / Markafoni - OSMAN ZDEMIR / nsan Kaynaklar Direkt=F6r=FC / T=FCrk Trakt=F6r - GLIZ GRELI / nsan Kaynaklar Direkt=F6r=FC / BC Group - KUBILAY ILGıN / nsan Kaynaklar Direkt=F6r=FC / Garanti Koza - AğDAş KAYA / nsan Kaynaklar Direkt=F6r=FC / Medikal Park Hastaneler Grubu - AYşEGL BALTACı TEZEL / nsan Kaynaklar ve Gelitirme M=FCd=FCr=FC / Saray Muhallebicisi - İNCI GVEN / nsan Kaynaklar & Organizasyonel Geliim Grup M=FCd=FCr=FC / H=FCrriyet - BURCU DOğRU TANYERI / nsan Kaynaklar M=FCd=FCr=FC / Intercontinental Hotels Group - ZLEM KOPUZ / nsan Kaynaklar M=FCd=FCr=FC / Proline Biliim - AYKUT STN / nsan Kaynaklar Koordinat=F6r=FC / T=FCpra - REYHAN BAşARAN / nsan Kaynaklar M=FCd=FCr=FC / Doan Egmont - BERKAY OKKAN / nsan Kaynaklar M=FCd=FCr=FC / Dou Otomotiv - SELIN YETIMOGLU / ICF =DCyesi / Ko=E7luk Platformu Dernei YK =DCyesi - AYLIN İLERI AYDOğAN / Professional Astrologer - TOLGA LLECI / SAP HR Proje Y=F6neticisi / Tofa - BILAL RAMAZANOğLU / Senior SAP HR Consultant / Tofa < VIEW MORE DETAILS > HTTP://BIGDATAOKYANUSU.COM/ =20 KAPSAM VIEW DETAILS HTTP://BIGDATAOKYANUSU.COM/ IERIK VIEW DETAILS HTTP://BIGDATAOKYANUSU.COM/ KAYıT VIEW DETAILS HTTP://BIGDATAOKYANUSU.COM/ UNSUBSCRIBE http://hristanbulsummit.com/index.php/lists/cm058bl894165/unsubscribe/cb04229tvq84a/gv3523ce0h2db | CONTACT HTTP://BIGDATAOKYANUSU.COM/=20 =09 http://www.facebook.com/sharer/sharer.php?u=3Dhttp://www.bogaziciegitim.com.tr/events/iii-dijital-ik-zirvesi/ https://twitter.com/BogaziciEgt =09 http://www.linkedin.com/shareArticle?mini=3Dtrue&ro=3Dtrue&trk=3DEasySocialShareButtons&title=3DDijital_Insan_Kaynaklari&url=3Dhttp://www.bogaziciegitim.com.tr/events/iii-dijital-ik-zirvesi/ 0 216 422 9595 - 0 555 422 9595 Dijital IK Zirvesi http://bigdataokyanusu.com=20 Istanbul Turkey=20 n= etiminde Dijital Uygulamalar Teknoloji ile Yeniden ekillenen IK Baa= rlar Zirvesi=20 III. DİJİTAL HR ZİRVES= 4;=20 23 MART 2016 / 09.00 &NDASH; 17.30 / İSTANBUL HILTON= &NDASH; HARBIYE=20 Konumaclar: - AYLIN SATUN OLSUN = / VP Level Senior Human Resource Executive - Board Member / Blog= ger - SEDA KAYRAK KıZıLTAN / nsan Kaynaklar Genel M?d?r Yar= dmcs / Markafoni - OSMAN ZDEMIR / nsan Kaynaklar Dir= ekt?r=FC / T=FCrk Trakt=F6r - GLIZ GRELI / nsan Kaynaklar Direkt=F6r=FC / BC Group - KUBILAY ILGıN / nsan Kaynaklar Direkt=F6r=FC / Garanti Koza - AğDAş KAYA / nsan Kaynaklar Direkt=F6r=FC / Medikal Park Hastaneler Grubu - AYşEGL BALTACı TEZEL / nsan Kaynaklar ve Gelitirme M=FCd=FCr=FC / Saray Muhallebicisi - İNCI GVEN / nsan Kaynaklar & Organizasyonel Geliim Grup M=FCd=FCr=FC / H=FCrriyet - BURCU DOğRU TANYERI / nsan Kaynaklar M=FCd=FCr=FC / Intercontinental Hotels Group - ZLEM KOPUZ / nsan Kaynaklar M=FCd=FCr=FC / Proline Biliim - AYKUT STN / nsan Kaynaklar Koordinat=F6r=FC / T=FCpra - REYHAN BAşARAN / nsan Kaynaklar M=FCd=FCr=FC / Doan Egmont - BERKAY OKKAN / nsan Kaynaklar M=FCd=FCr=FC / Dou Otomotiv - SELIN YETIMOGLU / ICF =DCyesi / Ko=E7luk Platformu Dernei YK =DCyesi - AYLIN İLERI AYDOğAN / Professional Astrologer - TOLGA LLECI / SAP HR Proje Y=F6neticisi / Tofa - BILAL RAMAZANOğLU / Senior SAP HR Consultant / Tofa < VIEW MORE DETAILS > HTTP://BIGDATAOKYANUSU.COM/ =20 KAPSAM VIEW DETAILS HTTP://BIGDATAOKYANUSU.COM/ IERIK VIEW DETAILS HTTP://BIGDATAOKYANUSU.COM/ KAYıT VIEW DETAILS HTTP://BIGDATAOKYANUSU.COM/ UNSUBSCRIBE http://hristanbulsummit.com/index.php/lists/cm058bl894165/unsubscribe/cb04229tvq84a/gv3523ce0h2db | CONTACT HTTP://BIGDATAOKYANUSU.COM/=20 =09 http://www.facebook.com/sharer/sharer.php?u=3Dhttp://www.bogaziciegitim.com.tr/events/iii-dijital-ik-zirvesi/ https://twitter.com/BogaziciEgt =09 http://www.linkedin.com/shareArticle?mini=3Dtrue&ro=3Dtrue&trk=3DEasySocialShareButtons&title=3DDijital_Insan_Kaynaklari&url=3Dhttp://www.bogaziciegitim.com.tr/events/iii-dijital-ik-zirvesi/ 0 216 422 9595 - 0 555 422 9595 Dijital IK Zirvesi http://bigdataokyanusu.com=20 Istanbul Turkey=20 r= ? / T?rk Trakt?r - GLIZ GRELI / nsan Kaynaklar Direk= t?r? / BC Group - KUBILAY ILGıN / nsan Kaynaklar Direkt=F6r=FC / Garanti Koza - AğDAş KAYA / nsan Kaynaklar Direkt=F6r=FC / Medikal Park Hastaneler Grubu - AYşEGL BALTACı TEZEL / nsan Kaynaklar ve Gelitirme M=FCd=FCr=FC / Saray Muhallebicisi - İNCI GVEN / nsan Kaynaklar & Organizasyonel Geliim Grup M=FCd=FCr=FC / H=FCrriyet - BURCU DOğRU TANYERI / nsan Kaynaklar M=FCd=FCr=FC / Intercontinental Hotels Group - ZLEM KOPUZ / nsan Kaynaklar M=FCd=FCr=FC / Proline Biliim - AYKUT STN / nsan Kaynaklar Koordinat=F6r=FC / T=FCpra - REYHAN BAşARAN / nsan Kaynaklar M=FCd=FCr=FC / Doan Egmont - BERKAY OKKAN / nsan Kaynaklar M=FCd=FCr=FC / Dou Otomotiv - SELIN YETIMOGLU / ICF =DCyesi / Ko=E7luk Platformu Dernei YK =DCyesi - AYLIN İLERI AYDOğAN / Professional Astrologer - TOLGA LLECI / SAP HR Proje Y=F6neticisi / Tofa - BILAL RAMAZANOğLU / Senior SAP HR Consultant / Tofa < VIEW MORE DETAILS > HTTP://BIGDATAOKYANUSU.COM/ =20 KAPSAM VIEW DETAILS HTTP://BIGDATAOKYANUSU.COM/ IERIK VIEW DETAILS HTTP://BIGDATAOKYANUSU.COM/ KAYıT VIEW DETAILS HTTP://BIGDATAOKYANUSU.COM/ UNSUBSCRIBE http://hristanbulsummit.com/index.php/lists/cm058bl894165/unsubscribe/cb04229tvq84a/gv3523ce0h2db | CONTACT HTTP://BIGDATAOKYANUSU.COM/=20 =09 http://www.facebook.com/sharer/sharer.php?u=3Dhttp://www.bogaziciegitim.com.tr/events/iii-dijital-ik-zirvesi/ https://twitter.com/BogaziciEgt =09 http://www.linkedin.com/shareArticle?mini=3Dtrue&ro=3Dtrue&trk=3DEasySocialShareButtons&title=3DDijital_Insan_Kaynaklari&url=3Dhttp://www.bogaziciegitim.com.tr/events/iii-dijital-ik-zirvesi/ 0 216 422 9595 - 0 555 422 9595 Dijital IK Zirvesi http://bigdataokyanusu.com=20 Istanbul Turkey=20 = / BC Group - KUBILAY ILGıN / nsan Kaynaklar Dir= ekt?r=FC / Garanti Koza - AğDAş KAYA / nsan Kaynaklar Direkt=F6r=FC / Medikal Park Hastaneler Grubu - AYşEGL BALTACı TEZEL / nsan Kaynaklar ve Gelitirme M=FCd=FCr=FC / Saray Muhallebicisi - İNCI GVEN / nsan Kaynaklar & Organizasyonel Geliim Grup M=FCd=FCr=FC / H=FCrriyet - BURCU DOğRU TANYERI / nsan Kaynaklar M=FCd=FCr=FC / Intercontinental Hotels Group - ZLEM KOPUZ / nsan Kaynaklar M=FCd=FCr=FC / Proline Biliim - AYKUT STN / nsan Kaynaklar Koordinat=F6r=FC / T=FCpra - REYHAN BAşARAN / nsan Kaynaklar M=FCd=FCr=FC / Doan Egmont - BERKAY OKKAN / nsan Kaynaklar M=FCd=FCr=FC / Dou Otomotiv - SELIN YETIMOGLU / ICF =DCyesi / Ko=E7luk Platformu Dernei YK =DCyesi - AYLIN İLERI AYDOğAN / Professional Astrologer - TOLGA LLECI / SAP HR Proje Y=F6neticisi / Tofa - BILAL RAMAZANOğLU / Senior SAP HR Consultant / Tofa < VIEW MORE DETAILS > HTTP://BIGDATAOKYANUSU.COM/ =20 KAPSAM VIEW DETAILS HTTP://BIGDATAOKYANUSU.COM/ IERIK VIEW DETAILS HTTP://BIGDATAOKYANUSU.COM/ KAYıT VIEW DETAILS HTTP://BIGDATAOKYANUSU.COM/ UNSUBSCRIBE http://hristanbulsummit.com/index.php/lists/cm058bl894165/unsubscribe/cb04229tvq84a/gv3523ce0h2db | CONTACT HTTP://BIGDATAOKYANUSU.COM/=20 =09 http://www.facebook.com/sharer/sharer.php?u=3Dhttp://www.bogaziciegitim.com.tr/events/iii-dijital-ik-zirvesi/ https://twitter.com/BogaziciEgt =09 http://www.linkedin.com/shareArticle?mini=3Dtrue&ro=3Dtrue&trk=3DEasySocialShareButtons&title=3DDijital_Insan_Kaynaklari&url=3Dhttp://www.bogaziciegitim.com.tr/events/iii-dijital-ik-zirvesi/ 0 216 422 9595 - 0 555 422 9595 Dijital IK Zirvesi http://bigdataokyanusu.com=20 Istanbul Turkey=20 r= ? / Garanti Koza - AğDAş KAYA / nsan Kaynaklar Dir= ekt?r=FC / Medikal Park Hastaneler Grubu - AYşEGL BALTACı TEZEL / nsan Kaynaklar ve Gelitirme M=FCd=FCr=FC / Saray Muhallebicisi - İNCI GVEN / nsan Kaynaklar & Organizasyonel Geliim Grup M=FCd=FCr=FC / H=FCrriyet - BURCU DOğRU TANYERI / nsan Kaynaklar M=FCd=FCr=FC / Intercontinental Hotels Group - ZLEM KOPUZ / nsan Kaynaklar M=FCd=FCr=FC / Proline Biliim - AYKUT STN / nsan Kaynaklar Koordinat=F6r=FC / T=FCpra - REYHAN BAşARAN / nsan Kaynaklar M=FCd=FCr=FC / Doan Egmont - BERKAY OKKAN / nsan Kaynaklar M=FCd=FCr=FC / Dou Otomotiv - SELIN YETIMOGLU / ICF =DCyesi / Ko=E7luk Platformu Dernei YK =DCyesi - AYLIN İLERI AYDOğAN / Professional Astrologer - TOLGA LLECI / SAP HR Proje Y=F6neticisi / Tofa - BILAL RAMAZANOğLU / Senior SAP HR Consultant / Tofa < VIEW MORE DETAILS > HTTP://BIGDATAOKYANUSU.COM/ =20 KAPSAM VIEW DETAILS HTTP://BIGDATAOKYANUSU.COM/ IERIK VIEW DETAILS HTTP://BIGDATAOKYANUSU.COM/ KAYıT VIEW DETAILS HTTP://BIGDATAOKYANUSU.COM/ UNSUBSCRIBE http://hristanbulsummit.com/index.php/lists/cm058bl894165/unsubscribe/cb04229tvq84a/gv3523ce0h2db | CONTACT HTTP://BIGDATAOKYANUSU.COM/=20 =09 http://www.facebook.com/sharer/sharer.php?u=3Dhttp://www.bogaziciegitim.com.tr/events/iii-dijital-ik-zirvesi/ https://twitter.com/BogaziciEgt =09 http://www.linkedin.com/shareArticle?mini=3Dtrue&ro=3Dtrue&trk=3DEasySocialShareButtons&title=3DDijital_Insan_Kaynaklari&url=3Dhttp://www.bogaziciegitim.com.tr/events/iii-dijital-ik-zirvesi/ 0 216 422 9595 - 0 555 422 9595 Dijital IK Zirvesi http://bigdataokyanusu.com=20 Istanbul Turkey=20 r= ? / Medikal Park Hastaneler Grubu - AYşEGL BALTACı TEZ= EL / nsan Kaynaklar ve Gelitirm= e M?d=FCr=FC / Saray Muhallebicisi - İNCI GVEN / nsan Kaynaklar & Organizasyonel Geliim Grup M=FCd=FCr=FC / H=FCrriyet - BURCU DOğRU TANYERI / nsan Kaynaklar M=FCd=FCr=FC / Intercontinental Hotels Group - ZLEM KOPUZ / nsan Kaynaklar M=FCd=FCr=FC / Proline Biliim - AYKUT STN / nsan Kaynaklar Koordinat=F6r=FC / T=FCpra - REYHAN BAşARAN / nsan Kaynaklar M=FCd=FCr=FC / Doan Egmont - BERKAY OKKAN / nsan Kaynaklar M=FCd=FCr=FC / Dou Otomotiv - SELIN YETIMOGLU / ICF =DCyesi / Ko=E7luk Platformu Dernei YK =DCyesi - AYLIN İLERI AYDOğAN / Professional Astrologer - TOLGA LLECI / SAP HR Proje Y=F6neticisi / Tofa - BILAL RAMAZANOğLU / Senior SAP HR Consultant / Tofa < VIEW MORE DETAILS > HTTP://BIGDATAOKYANUSU.COM/ =20 KAPSAM VIEW DETAILS HTTP://BIGDATAOKYANUSU.COM/ IERIK VIEW DETAILS HTTP://BIGDATAOKYANUSU.COM/ KAYıT VIEW DETAILS HTTP://BIGDATAOKYANUSU.COM/ UNSUBSCRIBE http://hristanbulsummit.com/index.php/lists/cm058bl894165/unsubscribe/cb04229tvq84a/gv3523ce0h2db | CONTACT HTTP://BIGDATAOKYANUSU.COM/=20 =09 http://www.facebook.com/sharer/sharer.php?u=3Dhttp://www.bogaziciegitim.com.tr/events/iii-dijital-ik-zirvesi/ https://twitter.com/BogaziciEgt =09 http://www.linkedin.com/shareArticle?mini=3Dtrue&ro=3Dtrue&trk=3DEasySocialShareButtons&title=3DDijital_Insan_Kaynaklari&url=3Dhttp://www.bogaziciegitim.com.tr/events/iii-dijital-ik-zirvesi/ 0 216 422 9595 - 0 555 422 9595 Dijital IK Zirvesi http://bigdataokyanusu.com=20 Istanbul Turkey=20 d= ?r? / Saray Muhallebicisi - İNCI GVEN / nsan Kaynaklar & Org= anizasyonel Geliim Grup = M?d?r=FC / H=FCrriyet - BURCU DOğRU TANYERI / nsan Kaynaklar M=FCd=FCr=FC / Intercontinental Hotels Group - ZLEM KOPUZ / nsan Kaynaklar M=FCd=FCr=FC / Proline Biliim - AYKUT STN / nsan Kaynaklar Koordinat=F6r=FC / T=FCpra - REYHAN BAşARAN / nsan Kaynaklar M=FCd=FCr=FC / Doan Egmont - BERKAY OKKAN / nsan Kaynaklar M=FCd=FCr=FC / Dou Otomotiv - SELIN YETIMOGLU / ICF =DCyesi / Ko=E7luk Platformu Dernei YK =DCyesi - AYLIN İLERI AYDOğAN / Professional Astrologer - TOLGA LLECI / SAP HR Proje Y=F6neticisi / Tofa - BILAL RAMAZANOğLU / Senior SAP HR Consultant / Tofa < VIEW MORE DETAILS > HTTP://BIGDATAOKYANUSU.COM/ =20 KAPSAM VIEW DETAILS HTTP://BIGDATAOKYANUSU.COM/ IERIK VIEW DETAILS HTTP://BIGDATAOKYANUSU.COM/ KAYıT VIEW DETAILS HTTP://BIGDATAOKYANUSU.COM/ UNSUBSCRIBE http://hristanbulsummit.com/index.php/lists/cm058bl894165/unsubscribe/cb04229tvq84a/gv3523ce0h2db | CONTACT HTTP://BIGDATAOKYANUSU.COM/=20 =09 http://www.facebook.com/sharer/sharer.php?u=3Dhttp://www.bogaziciegitim.com.tr/events/iii-dijital-ik-zirvesi/ https://twitter.com/BogaziciEgt =09 http://www.linkedin.com/shareArticle?mini=3Dtrue&ro=3Dtrue&trk=3DEasySocialShareButtons&title=3DDijital_Insan_Kaynaklari&url=3Dhttp://www.bogaziciegitim.com.tr/events/iii-dijital-ik-zirvesi/ 0 216 422 9595 - 0 555 422 9595 Dijital IK Zirvesi http://bigdataokyanusu.com=20 Istanbul Turkey=20 r= ? / H?rriyet - BURCU DOğRU TANYERI / nsan Kaynaklar M?d?r? = / Intercontinental Hotels Group - ZLEM KOPUZ / nsan Kaynaklar M?d= ?r? / Proline Biliim - AYKUT STN / nsan Kaynaklar Koordi= nat?r=FC / T=FCpra - REYHAN BAşARAN / nsan Kaynaklar M=FCd=FCr=FC / Doan Egmont - BERKAY OKKAN / nsan Kaynaklar M=FCd=FCr=FC / Dou Otomotiv - SELIN YETIMOGLU / ICF =DCyesi / Ko=E7luk Platformu Dernei YK =DCyesi - AYLIN İLERI AYDOğAN / Professional Astrologer - TOLGA LLECI / SAP HR Proje Y=F6neticisi / Tofa - BILAL RAMAZANOğLU / Senior SAP HR Consultant / Tofa < VIEW MORE DETAILS > HTTP://BIGDATAOKYANUSU.COM/ =20 KAPSAM VIEW DETAILS HTTP://BIGDATAOKYANUSU.COM/ IERIK VIEW DETAILS HTTP://BIGDATAOKYANUSU.COM/ KAYıT VIEW DETAILS HTTP://BIGDATAOKYANUSU.COM/ UNSUBSCRIBE http://hristanbulsummit.com/index.php/lists/cm058bl894165/unsubscribe/cb04229tvq84a/gv3523ce0h2db | CONTACT HTTP://BIGDATAOKYANUSU.COM/=20 =09 http://www.facebook.com/sharer/sharer.php?u=3Dhttp://www.bogaziciegitim.com.tr/events/iii-dijital-ik-zirvesi/ https://twitter.com/BogaziciEgt =09 http://www.linkedin.com/shareArticle?mini=3Dtrue&ro=3Dtrue&trk=3DEasySocialShareButtons&title=3DDijital_Insan_Kaynaklari&url=3Dhttp://www.bogaziciegitim.com.tr/events/iii-dijital-ik-zirvesi/ 0 216 422 9595 - 0 555 422 9595 Dijital IK Zirvesi http://bigdataokyanusu.com=20 Istanbul Turkey=20 r= ? / T?pra - REYHAN BAşARAN / nsan Kaynaklar M?d?r? / Doan Egmon= t - BERKAY OKKAN / nsan Kaynakla= r M?d=FCr=FC / Dou Otomotiv - SELIN YETIMOGLU / ICF =DCyesi / Ko=E7luk Platformu Dernei YK =DCyesi - AYLIN İLERI AYDOğAN / Professional Astrologer - TOLGA LLECI / SAP HR Proje Y=F6neticisi / Tofa - BILAL RAMAZANOğLU / Senior SAP HR Consultant / Tofa < VIEW MORE DETAILS > HTTP://BIGDATAOKYANUSU.COM/ =20 KAPSAM VIEW DETAILS HTTP://BIGDATAOKYANUSU.COM/ IERIK VIEW DETAILS HTTP://BIGDATAOKYANUSU.COM/ KAYıT VIEW DETAILS HTTP://BIGDATAOKYANUSU.COM/ UNSUBSCRIBE http://hristanbulsummit.com/index.php/lists/cm058bl894165/unsubscribe/cb04229tvq84a/gv3523ce0h2db | CONTACT HTTP://BIGDATAOKYANUSU.COM/=20 =09 http://www.facebook.com/sharer/sharer.php?u=3Dhttp://www.bogaziciegitim.com.tr/events/iii-dijital-ik-zirvesi/ https://twitter.com/BogaziciEgt =09 http://www.linkedin.com/shareArticle?mini=3Dtrue&ro=3Dtrue&trk=3DEasySocialShareButtons&title=3DDijital_Insan_Kaynaklari&url=3Dhttp://www.bogaziciegitim.com.tr/events/iii-dijital-ik-zirvesi/ 0 216 422 9595 - 0 555 422 9595 Dijital IK Zirvesi http://bigdataokyanusu.com=20 Istanbul Turkey=20 d= ?r? / Dou Otomotiv - SELIN YETIMOGLU / I= CF ?yesi / Ko=E7luk Platformu Dernei YK =DCyesi - AYLIN İLERI AYDOğAN / Professional Astrologer - TOLGA LLECI / SAP HR Proje Y=F6neticisi / Tofa - BILAL RAMAZANOğLU / Senior SAP HR Consultant / Tofa < VIEW MORE DETAILS > HTTP://BIGDATAOKYANUSU.COM/ =20 KAPSAM VIEW DETAILS HTTP://BIGDATAOKYANUSU.COM/ IERIK VIEW DETAILS HTTP://BIGDATAOKYANUSU.COM/ KAYıT VIEW DETAILS HTTP://BIGDATAOKYANUSU.COM/ UNSUBSCRIBE http://hristanbulsummit.com/index.php/lists/cm058bl894165/unsubscribe/cb04229tvq84a/gv3523ce0h2db | CONTACT HTTP://BIGDATAOKYANUSU.COM/=20 =09 http://www.facebook.com/sharer/sharer.php?u=3Dhttp://www.bogaziciegitim.com.tr/events/iii-dijital-ik-zirvesi/ https://twitter.com/BogaziciEgt =09 http://www.linkedin.com/shareArticle?mini=3Dtrue&ro=3Dtrue&trk=3DEasySocialShareButtons&title=3DDijital_Insan_Kaynaklari&url=3Dhttp://www.bogaziciegitim.com.tr/events/iii-dijital-ik-zirvesi/ 0 216 422 9595 - 0 555 422 9595 Dijital IK Zirvesi http://bigdataokyanusu.com=20 Istanbul Turkey=20 y= esi / Ko?luk Platformu Dernei YK ?yesi - AYLIN İLERI AYDOğ= AN / Professional Astrologer - TOLGA LLECI / SAP HR Proj= e Y?neticisi / Tofa - BILAL RAMAZANOğLU / Senior SAP HR Consultant / Tofa < VIEW MORE DETAILS > HTTP://BIGDATAOKYANUSU.COM/ =20 KAPSAM VIEW DETAILS HTTP://BIGDATAOKYANUSU.COM/ IERIK VIEW DETAILS HTTP://BIGDATAOKYANUSU.COM/ KAYıT VIEW DETAILS HTTP://BIGDATAOKYANUSU.COM/ UNSUBSCRIBE http://hristanbulsummit.com/index.php/lists/cm058bl894165/unsubscribe/cb04229tvq84a/gv3523ce0h2db | CONTACT HTTP://BIGDATAOKYANUSU.COM/=20 =09 http://www.facebook.com/sharer/sharer.php?u=3Dhttp://www.bogaziciegitim.com.tr/events/iii-dijital-ik-zirvesi/ https://twitter.com/BogaziciEgt =09 http://www.linkedin.com/shareArticle?mini=3Dtrue&ro=3Dtrue&trk=3DEasySocialShareButtons&title=3DDijital_Insan_Kaynaklari&url=3Dhttp://www.bogaziciegitim.com.tr/events/iii-dijital-ik-zirvesi/ 0 216 422 9595 - 0 555 422 9595 Dijital IK Zirvesi http://bigdataokyanusu.com=20 Istanbul Turkey=20 n= eticisi / Tofa - BILAL RAMAZANOğLU / Senior SAP HR Consultant /= Tofa < VIEW MORE DETAILS > HTTP://BIGDATAOKYANUSU.COM/ = =20 KAPSAM VIEW DETAILS HTTP://BIGDATAOKYANUSU= .COM/ IERIK VIEW DETAILS HTTP://BIGDATAOKYANUSU= .COM/ KAYıT VIEW DETAILS HTTP://BIGDATAOKYA= NUSU.COM/ UNSUBSCRIBE http://hristanbulsummit.com/index.p= hp/lists/cm058bl894165/unsubscribe/cb04229tvq84a/gv3523ce0h2db = | CONTACT HTTP://BIGDATAOKYANUSU.COM/=20 =09 http://ww= w.facebook.com/sharer/sharer.php?u=3Dhttp://www.bogaziciegitim.com.tr/even= ts/iii-dijital-ik-zirvesi/ https://twitter.com/BogaziciEgt = =09 http://www.linkedin.com/shareArticle?mini=3Dtrue&ro=3Dtrue&trk=3DEa= sySocialShareButtons&title=3DDijital_Insan_Kaynaklari&url=3Dhttp://www.b= ogaziciegitim.com.tr/events/iii-dijital-ik-zirvesi/ 0 216 422= 9595 - 0 555 422 9595 Dijital IK Zirvesi http://bigdat= aokyanusu.com=20 Istanbul Turkey=20 =20 --_=_swift_v4_1456243405_968166b49942c1e3f61f48e14882ff0c_=_ Content-Type: text/html; charset=utf-8 Content-Transfer-Encoding: 8bit dijital ik
    #HRtech2016
      VIEW AS A WEB PAGE  

    İnsan Kaynakları Yönetiminde Dijital Uygulamalar
    Teknoloji ile Yeniden Şekillenen IK Başarıları Zirvesi

     

    III. DİJİTAL HR ZİRVESİ

    23 Mart 2016 / 09.00 – 17.30 / İstanbul Hilton – Harbiye

     
      Konuşmacılar:
    - Aylin Satun Olsun / VP Level Senior Human Resource Executive – Board Member / Blogger
    - Seda Kayrak Kızıltan / İnsan Kaynakları Genel Müdür Yardımcısı / Markafoni
    - Osman Özdemir / İnsan Kaynakları Direktörü / Türk Traktör
    - Güliz Güreli / İnsan Kaynakları Direktörü / BC Group
    - Kubilay Ilgın / İnsan Kaynakları Direktörü / Garanti Koza
    - Çağdaş Kaya / İnsan Kaynakları Direktörü / Medikal Park Hastaneler Grubu
    - Ayşegül Baltacı Tezel / İnsan Kaynakları ve İş Geliştirme Müdürü / Saray Muhallebicisi
    - İnci Güvenç / İnsan Kaynakları & Organizasyonel Gelişim Grup Müdürü / Hürriyet
    - Burcu Doğru Tanyeri / İnsan Kaynakları Müdürü / Intercontinental Hotels Group
    - Özlem Kopuz / İnsan Kaynakları Müdürü / Proline Bilişim
    - Aykut Üstün / İnsan Kaynakları Koordinatörü / Tüpraş
    - Reyhan Başaran / İnsan Kaynakları Müdürü / Doğan Egmont
    - Berkay Okkan / İnsan Kaynakları Müdürü / Doğuş Otomotiv
    - Selin Yetimoglu / ICF Üyesi / Koçluk Platformu Derneği YK Üyesi
    - Aylin İleri Aydoğan / Professional Astrologer
    - Tolga Lüleci / SAP HR Proje Yöneticisi / Tofaş
    - Bilal Ramazanoğlu / Senior SAP HR Consultant / Tofaş

    < view more details >
     
     
     
     
    kapsam
     
    view details
     
     
     
    içerik
     
    view details
     
     
     
    kayıt
     
    view details
     
     
     
    UNSUBSCRIBE | CONTACT facebook twitter linkedin


    0 216 422 9595 - 0 555 422 9595
     


    Dijital IK Zirvesi
    http://bigdataokyanusu.com
    Istanbul Turkey
     
    --_=_swift_v4_1456243405_968166b49942c1e3f61f48e14882ff0c_=_-- From jean-tiare.le-bigot@corp.ovh.com Tue Feb 23 10:27:39 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=ham version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay2.corp.sgi.com [137.38.102.29]) by oss.sgi.com (Postfix) with ESMTP id 528DA7F94 for ; Tue, 23 Feb 2016 10:27:39 -0600 (CST) Received: from cuda.sgi.com (cuda3.sgi.com [192.48.176.15]) by relay2.corp.sgi.com (Postfix) with ESMTP id 22AB1304039 for ; Tue, 23 Feb 2016 08:27:32 -0800 (PST) X-ASG-Debug-ID: 1456243993-04cb6c7007156d0001-NocioJ Received: from 10.mo174.mail-out.ovh.net (10.mo174.mail-out.ovh.net [46.105.58.75]) by cuda.sgi.com with ESMTP id eHmhasQEoC4a0zck (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO) for ; Tue, 23 Feb 2016 08:13:14 -0800 (PST) X-Barracuda-Envelope-From: jean-tiare.le-bigot@corp.ovh.com X-Barracuda-Apparent-Source-IP: 46.105.58.75 Received: from ex2.OVH.local (corp.ovh.com [5.196.251.137]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits)) (No client certificate requested) by mo174.mail-out.ovh.net (Postfix) with ESMTPS id 59FBBFF828C for ; Tue, 23 Feb 2016 17:13:13 +0100 (CET) Received: from [10.42.109.126] (109.190.254.34) by ex2.OVH.local (172.16.7.2) with Microsoft SMTP Server (TLS) id 15.1.225.42; Tue, 23 Feb 2016 17:13:13 +0100 Message-ID: <56CC852F.7010507@corp.ovh.com> Date: Tue, 23 Feb 2016 17:13:35 +0100 From: Jean-Tiare Le Bigot User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20131118 Thunderbird/17.0.11 MIME-Version: 1.0 To: Subject: backport 7a29ac474a47eb8cf212b45917683ae89d6fa13b to stable ? X-Enigmail-Version: 1.6 X-ASG-Orig-Subj: backport 7a29ac474a47eb8cf212b45917683ae89d6fa13b to stable ? Content-Type: text/plain; charset="ISO-8859-1" Content-Transfer-Encoding: 7bit X-Originating-IP: [109.190.254.34] X-ClientProxiedBy: cas01.OVH.local (172.16.1.1) To ex2.OVH.local (172.16.7.2) X-Ovh-Tracer-Id: 9590696882795830628 X-VR-SPAMSTATE: OK X-VR-SPAMSCORE: 0 X-VR-SPAMCAUSE: gggruggvucftvghtrhhoucdtuddrfeekjedrheeigdekfecutefuodetggdotffvucfrrhhofhhilhgvmecuqfggjfenuceurghilhhouhhtmecufedttdenuc X-Barracuda-Connect: 10.mo174.mail-out.ovh.net[46.105.58.75] X-Barracuda-Start-Time: 1456243994 X-Barracuda-Encrypted: ECDHE-RSA-AES256-GCM-SHA384 X-Barracuda-URL: https://192.48.176.15:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-BRTS-Status: 1 X-Barracuda-Spam-Score: 0.00 X-Barracuda-Spam-Status: No, SCORE=0.00 using per-user scores of TAG_LEVEL=1000.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.7 tests= X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.3.27268 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- Hi, We've hit kernel hang related to XFS reclaim under heavy I/O load on a couple of storage servers using XFS over flashcache over a 3.13.y kernel. On the crash dumps, kthreadd is blocked, waiting for XFS to reclaim some memory but the related reclaim job is queued on a worker_pool stuck waiting for some I/O, itself depending on other jobs on other queues which would require additional threads to go forward. Unfortunately kthreadd is blocked. The host has plenty of memory (~128GB), about 80% of which being used for the page cache. It looks like this is fixed by commit 7a29ac474a47eb8cf212b45917683ae89d6fa13b. We manually applied a fix to our internal branch but I could not find a similar commit on the longterm branches. Maybe it could be a good candidate for backport for other users ? On linux-3.14.y, this would be diff --git a/fs/xfs/xfs_super.c b/fs/xfs/xfs_super.c index d971f49..36af881 100644 --- a/fs/xfs/xfs_super.c +++ b/fs/xfs/xfs_super.c @@ -858,17 +858,17 @@ xfs_init_mount_workqueues( goto out_destroy_unwritten; mp->m_reclaim_workqueue = alloc_workqueue("xfs-reclaim/%s", - 0, 0, mp->m_fsname); + WQ_MEM_RECLAIM, 0, mp->m_fsname); if (!mp->m_reclaim_workqueue) goto out_destroy_cil; mp->m_log_workqueue = alloc_workqueue("xfs-log/%s", - 0, 0, mp->m_fsname); + WQ_MEM_RECLAIM, 0, mp->m_fsname); if (!mp->m_log_workqueue) goto out_destroy_reclaim; mp->m_eofblocks_workqueue = alloc_workqueue("xfs-eofblocks/%s", - 0, 0, mp->m_fsname); + WQ_MEM_RECLAIM, 0, mp->m_fsname); if (!mp->m_eofblocks_workqueue) goto out_destroy_log; Regards, -- Jean-Tiare Le Bigot, OVH From agruenba@redhat.com Tue Feb 23 13:20:10 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=ham version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay3.corp.sgi.com [198.149.34.15]) by oss.sgi.com (Postfix) with ESMTP id 7A66B7F9A for ; Tue, 23 Feb 2016 13:20:10 -0600 (CST) Received: from cuda.sgi.com (cuda1.sgi.com [192.48.157.11]) by relay3.corp.sgi.com (Postfix) with ESMTP id EC09DAC002 for ; Tue, 23 Feb 2016 11:20:03 -0800 (PST) X-ASG-Debug-ID: 1456254080-04bdf07ab3faa20001-NocioJ Received: from mail-vk0-f50.google.com (mail-vk0-f50.google.com [209.85.213.50]) by cuda.sgi.com with ESMTP id w0gzeH5p2fm8ABqi (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128 verify=NO) for ; Tue, 23 Feb 2016 11:01:21 -0800 (PST) X-Barracuda-Envelope-From: agruenba@redhat.com X-Barracuda-Apparent-Source-IP: 209.85.213.50 Received: by mail-vk0-f50.google.com with SMTP id c3so170546023vkb.3 for ; Tue, 23 Feb 2016 11:01:21 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:date :message-id:subject:from:to:cc:content-type; bh=FIZ9MB2GZ0m13QHAf8pJa19vyMNrITketSw8fd2tR24=; b=MCimIfm64jrDXzmBttS0v/y4fhjvwDWeVJtg5LBvv72xR7yXkFJDYpV0H2hBJFBbVD Wb2EjOXdD04b18GgV31ZvTqPquNsTBBN80CBQ2Y7Lv/Ze0L5rnZuBxPQmg+IBKKTwevs g7shjKwJ7gq0o7lNjaEK3DOsfrQLfrUnGS6i0xUQPwQFSYm29OwuKyzC9WVfTudxEOVu ar2VsgDMsR4M7bIhg2g5D8+dLnEBYTC2/vwM+VpSsGf+LXIPt3+dJcx9Nma0YYvMnBT/ J90x46SK8HINPzGmeatfsNpEJtyx/nl6N4kf6G+ij61T1Ez1+jp6eXPBjIRgkWjPyFWK CLag== X-Gm-Message-State: AG10YOSy+jMycL+WUOXs3Uf5nZJxvG01zMYKoxvbDmX+4o0QA42M2BtpZVmxar1Ti4u6kjvK2dhAnN5RT8+g8Qwg MIME-Version: 1.0 X-Received: by 10.31.151.75 with SMTP id z72mr27205247vkd.104.1456254080220; Tue, 23 Feb 2016 11:01:20 -0800 (PST) Received: by 10.176.64.130 with HTTP; Tue, 23 Feb 2016 11:01:20 -0800 (PST) In-Reply-To: References: <56B770B6.7040803@gmail.com> <56B77262.7090107@gmail.com> <56C0F23C.7030902@gmail.com> <56CA2EEB.9080504@gmail.com> <56CC3B4A.7070204@gmail.com> Date: Tue, 23 Feb 2016 20:01:20 +0100 Message-ID: Subject: Re: richacl(7) man page review comments From: Andreas Gruenbacher X-ASG-Orig-Subj: Re: richacl(7) man page review comments To: "Michael Kerrisk (man-pages)" Cc: "J. Bruce Fields" , linux-ext4 , XFS Developers , lkml , linux-fsdevel , Linux NFS Mailing List , linux-cifs@vger.kernel.org, Linux API , Dave Chinner , Christoph Hellwig , Anna Schumaker , Trond Myklebust , Jeff Layton , Andreas Dilger Content-Type: text/plain; charset=UTF-8 X-Barracuda-Connect: mail-vk0-f50.google.com[209.85.213.50] X-Barracuda-Start-Time: 1456254081 X-Barracuda-Encrypted: ECDHE-RSA-AES128-GCM-SHA256 X-Barracuda-URL: https://192.48.157.11:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-BRTS-Status: 1 X-Barracuda-Spam-Score: 0.00 X-Barracuda-Spam-Status: No, SCORE=0.00 using per-user scores of TAG_LEVEL=1000.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.7 tests=BSF_SC0_MISMATCH_TO X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.3.27273 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 0.00 BSF_SC0_MISMATCH_TO Envelope rcpt doesn't match header On Tue, Feb 23, 2016 at 4:09 PM, Andreas Gruenbacher wrote: > Hi Michael, > > On Tue, Feb 23, 2016 at 11:58 AM, Michael Kerrisk (man-pages) > wrote: >> On 02/22/2016 03:46 PM, Andreas Gruenbacher wrote: >>> On Sun, Feb 21, 2016 at 10:40 PM, Michael Kerrisk (man-pages) wrote: >>>> I've once more pulled from the latest git; here's some more comments. >>> >>> thanks again. I've updated the repo with your changes. >> >> Next round :-). Just a few quick comments while I'm on a train ride. > > applied, thanks. I've fixed the following additional problems: > diff --git a/man/richacl.7 b/man/richacl.7 > index acdff31..1c82644 100644 > --- a/man/richacl.7 > +++ b/man/richacl.7 > @@ -30,10 +30,8 @@ > .SH NAME > richacl \- Rich Access Control Lists > .SH DESCRIPTION > -Rich Access Control Lists (RichACLs) are an extension of the POSIX file > -permission model (see > -.BR acl (5)) > -to support > +Rich Access Control Lists (RichACLs) are an extension of the traditional POSIX > +file permission model to support > .URL https://tools.ietf.org/rfc/rfc5661.txt "NFSv4 Access Control Lists" > on local and remote-mounted filesystems. RichACLs are an extension of the traditional POSIX file permission model, not of the POSIX ACL model. Unfortunately, there doesn't seem to be a man-page covering POSIX File Access Permissions as in Appendix A of http://www.bestbits.at/richacl/draft-gruenbacher-nfsv4-acls-in-posix-00.html. A lot of the gaps between paragraphs were wrong when rendered for printing. The modification dates were outdated. Andreas From david@fromorbit.com Tue Feb 23 16:58:51 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=ham version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay3.corp.sgi.com [198.149.34.15]) by oss.sgi.com (Postfix) with ESMTP id 0744D7F50 for ; Tue, 23 Feb 2016 16:58:51 -0600 (CST) Received: from cuda.sgi.com (cuda2.sgi.com [192.48.176.25]) by relay3.corp.sgi.com (Postfix) with ESMTP id 7B309AC005 for ; Tue, 23 Feb 2016 14:58:44 -0800 (PST) X-ASG-Debug-ID: 1456267557-04cbb06adecfa50001-NocioJ Received: from ipmail06.adl6.internode.on.net (ipmail06.adl6.internode.on.net [150.101.137.145]) by cuda.sgi.com with ESMTP id fjtOAWkcWJ2q854M for ; Tue, 23 Feb 2016 14:45:57 -0800 (PST) X-Barracuda-Envelope-From: david@fromorbit.com X-Barracuda-Apparent-Source-IP: 150.101.137.145 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: A2AwBwBL4MxW/5bY03ZegzqBP4JppCoBAQEBAQEGi3KJT4YHBAICgUhNAQEBAQEBZSeEQgEBBDocIxAIAxgJJQ8FJQMhE4gdvUIBAQgCAR0YhTKFAoQfhFAFlweNVY56jklig3goLoZ8gTkBAQE Received: from ppp118-211-216-150.lns20.syd4.internode.on.net (HELO dastard) ([118.211.216.150]) by ipmail06.adl6.internode.on.net with ESMTP; 24 Feb 2016 09:15:56 +1030 Received: from dave by dastard with local (Exim 4.80) (envelope-from ) id 1aYLiN-0004A8-32; Wed, 24 Feb 2016 09:45:55 +1100 Date: Wed, 24 Feb 2016 09:45:55 +1100 From: Dave Chinner To: Jean-Tiare Le Bigot Cc: xfs@oss.sgi.com Subject: Re: backport 7a29ac474a47eb8cf212b45917683ae89d6fa13b to stable ? Message-ID: <20160223224555.GM25832@dastard> X-ASG-Orig-Subj: Re: backport 7a29ac474a47eb8cf212b45917683ae89d6fa13b to stable ? References: <56CC852F.7010507@corp.ovh.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <56CC852F.7010507@corp.ovh.com> User-Agent: Mutt/1.5.21 (2010-09-15) X-Barracuda-Connect: ipmail06.adl6.internode.on.net[150.101.137.145] X-Barracuda-Start-Time: 1456267557 X-Barracuda-URL: https://192.48.176.25:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-BRTS-Status: 1 X-Barracuda-Spam-Score: 0.00 X-Barracuda-Spam-Status: No, SCORE=0.00 using per-user scores of TAG_LEVEL=1000.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.7 tests=BSF_SC0_MISMATCH_TO X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.3.27281 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 0.00 BSF_SC0_MISMATCH_TO Envelope rcpt doesn't match header On Tue, Feb 23, 2016 at 05:13:35PM +0100, Jean-Tiare Le Bigot wrote: > Hi, > > We've hit kernel hang related to XFS reclaim under heavy I/O load on a > couple of storage servers using XFS over flashcache over a 3.13.y kernel. > > On the crash dumps, kthreadd is blocked, waiting for XFS to reclaim some > memory but the related reclaim job is queued on a worker_pool stuck > waiting for some I/O, itself depending on other jobs on other queues > which would require additional threads to go forward. Unfortunately > kthreadd is blocked. > The host has plenty of memory (~128GB), about 80% of which being used > for the page cache. > > It looks like this is fixed by commit > 7a29ac474a47eb8cf212b45917683ae89d6fa13b. That commit fixed a regression introduced, IIRC, in 3.19. The problem it fixed didn't exist before then, so I doubt you are seeing the problem that the above commit fixed. Perhaps you'd like to describe your problem along with the stack traces, etc so we have some idea of what you are trying to to fix? Cheers, Dave. -- Dave Chinner david@fromorbit.com From david@fromorbit.com Tue Feb 23 16:59:49 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=ham version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay2.corp.sgi.com [137.38.102.29]) by oss.sgi.com (Postfix) with ESMTP id 30CA829E08 for ; Tue, 23 Feb 2016 16:59:49 -0600 (CST) Received: from cuda.sgi.com (cuda1.sgi.com [192.48.157.11]) by relay2.corp.sgi.com (Postfix) with ESMTP id EAB0F304043 for ; Tue, 23 Feb 2016 14:59:42 -0800 (PST) X-ASG-Debug-ID: 1456268378-04bdf07ab5101210001-NocioJ Received: from ipmail06.adl6.internode.on.net (ipmail06.adl6.internode.on.net [150.101.137.145]) by cuda.sgi.com with ESMTP id K5ryCkMnF2YX40TL for ; Tue, 23 Feb 2016 14:59:39 -0800 (PST) X-Barracuda-Envelope-From: david@fromorbit.com X-Barracuda-Apparent-Source-IP: 150.101.137.145 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: A2AwBwDA48xW/5bY03ZegzqBP4JppCoBAQEBAQEGi3KJT4YHBAICgUdNAQEBAQEBZSeEQQEBAQMBOhwjBQsIAxgJJQ8FJQMKFxOIFge9QAEBCAIeGIUyhQKEBREBhFgFh1OHCIgsjVWBZYRDgyWFLY5JYoIDGYFcKC6HBIExAQEB Received: from ppp118-211-216-150.lns20.syd4.internode.on.net (HELO dastard) ([118.211.216.150]) by ipmail06.adl6.internode.on.net with ESMTP; 24 Feb 2016 09:29:28 +1030 Received: from dave by dastard with local (Exim 4.80) (envelope-from ) id 1aYLvS-0004Bd-GZ; Wed, 24 Feb 2016 09:59:26 +1100 Date: Wed, 24 Feb 2016 09:59:26 +1100 From: Dave Chinner To: Alex Lyakas Cc: xfs@oss.sgi.com, Christoph Hellwig , Danny Shavit , Yair Hershko , Shyam Kaushik Subject: Re: xfs resize: primary superblock is not updated immediately Message-ID: <20160223225926.GN25832@dastard> X-ASG-Orig-Subj: Re: xfs resize: primary superblock is not updated immediately References: <3685DFAD20214109878873CF81232704@alyakaslap> <20160222212019.GI25832@dastard> <20160222235628.GK25832@dastard> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.21 (2010-09-15) X-Barracuda-Connect: ipmail06.adl6.internode.on.net[150.101.137.145] X-Barracuda-Start-Time: 1456268378 X-Barracuda-URL: https://192.48.157.11:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-BRTS-Status: 1 X-Barracuda-Spam-Score: 0.00 X-Barracuda-Spam-Status: No, SCORE=0.00 using per-user scores of TAG_LEVEL=1000.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.7 tests=BSF_SC0_MISMATCH_TO X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.3.27283 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 0.00 BSF_SC0_MISMATCH_TO Envelope rcpt doesn't match header On Tue, Feb 23, 2016 at 02:25:38PM +0200, Alex Lyakas wrote: > Hi Dave, > > Below is a detailed reproduction scenario of the problem. Can you package this for xfstests and send to fstests@vger.kernel.org, please? > No > snapshots involved, only XFS. The scenario is performed on a VM, > running kernel 3.18.19. And a current kernel (e.g. 4.5-rc5) behaves how? > 9) mount > # mount -o sync /dev/mapper/xfs_base /mnt/xfs/ > > Kernel panics with [2]. It tried to read a buffer beyond the current end of filesystem that log recoery knows about. Given the on-disk superblock had not been updated by the growfs operation, this should have been detected by _xfs_buf_find() and errored out, not tried to look up a per-ag structure that is beyond the current end of filesystem. i.e. the code I pointed out in my previous email failed to detect the situation is it supposed to be protecting against. Why did that "block beyond the end of the filesystem" detection fail? Cheers, Dave. -- Dave Chinner david@fromorbit.com From idappl@supporti.it Tue Feb 23 19:25:23 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=HTML_MESSAGE,T_FRT_POSSIBLE autolearn=ham version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay3.corp.sgi.com [198.149.34.15]) by oss.sgi.com (Postfix) with ESMTP id 10A0A7F88 for ; Tue, 23 Feb 2016 19:25:23 -0600 (CST) Received: from cuda.sgi.com (cuda1.sgi.com [192.48.157.11]) by relay3.corp.sgi.com (Postfix) with ESMTP id 834D3AC002 for ; Tue, 23 Feb 2016 17:25:16 -0800 (PST) X-ASG-Debug-ID: 1456277112-04bdf07ab5105c30001-NocioJ Received: from xvm51194 (xvm51194.vps.cloud.tagadab.com [185.77.173.218]) by cuda.sgi.com with ESMTP id YqytzJgCSYBNHdGl for ; Tue, 23 Feb 2016 17:25:12 -0800 (PST) X-Barracuda-Envelope-From: idappl@supporti.it X-Barracuda-Apparent-Source-IP: 185.77.173.218 Received: from [185.77.173.218] ([127.0.0.1]) by xvm51194 with Microsoft SMTPSVC(7.5.7601.17514); Wed, 24 Feb 2016 01:25:10 +0000 Content-Type: multipart/alternative; boundary="===============0590043207==" MIME-Version: 1.0 Subject: =?utf-8?q?Apple_Urgente_Aggiorna_il_tuo_ID_Apple_il_pi=C3=B9_presto_possi?= =?utf-8?q?bile!?= To: Recipients X-ASG-Orig-Subj: =?utf-8?q?Apple_Urgente_Aggiorna_il_tuo_ID_Apple_il_pi=C3=B9_presto_possi?= =?utf-8?q?bile!?= From: "Apple" Date: Wed, 24 Feb 2016 01:25:07 +0000 Message-ID: X-OriginalArrivalTime: 24 Feb 2016 01:25:11.0029 (UTC) FILETIME=[3437E250:01D16EA2] X-Barracuda-Connect: xvm51194.vps.cloud.tagadab.com[185.77.173.218] X-Barracuda-Start-Time: 1456277112 X-Barracuda-URL: https://192.48.157.11:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-BRTS-Status: 1 X-Barracuda-BRTS-Evidence: 0a049958a3497464c146ae0ce35786a5-403-txt X-Barracuda-Spam-Score: 0.50 X-Barracuda-Spam-Status: No, SCORE=0.50 using per-user scores of TAG_LEVEL=1000.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.7 tests=BSF_SC0_MISMATCH_TO, BSF_SC0_SA_TO_FROM_ADDR_MATCH, HTML_MESSAGE X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.3.27287 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 0.00 BSF_SC0_MISMATCH_TO Envelope rcpt doesn't match header 0.00 HTML_MESSAGE BODY: HTML included in message 0.50 BSF_SC0_SA_TO_FROM_ADDR_MATCH Sender Address Matches Recipient Address You will not see this in a MIME-aware mail reader. --===============0590043207== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Description: Mail message body = = boschi =2014 Numero cliente: 123122517 = = Gentile clienti Vi informiamo che il vostro account Apple scadr=E0 tra meno di 24 ore. =E8 assolutamente necessario effettuare una verifica delle vostre informazi= oni o il tuo account verr=E0 cancellato. Basta cliccare sul link accedi al tuo account Apple e segui le istruzio Confermare il mio conto Cordiali saluti, =A9 2016 Apple Inc. All rights reserve --===============0590043207== Content-Type: text/html; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Description: Mail message body

    3Dhttps://statici.icloud.com/emailim=

    Gentile clienti

    Vi informi= amo che il vostro account Apple scadr=C3=A0 tra meno di 24 ore.
    =C3=A8 a= ssolutamente necessario effettuare una verifica delle vostre informazioni o= il tuo account verr=C3=A0 cancellato.
    Basta cliccare sul link accedi al= tuo account Apple e segui le istruzio

    Confermare il mio conto

    Cordiali s= aluti,

    =C2=A9 201= 6 Apple Inc. All rights reserve

    --===============0590043207==-- From paul.cannon3128@gmail.com Tue Feb 23 21:37:52 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.3 required=5.0 tests=FREEMAIL_ENVFROM_END_DIGIT, FREEMAIL_FROM,HTML_MESSAGE,T_DKIM_INVALID autolearn=no version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay3.corp.sgi.com [198.149.34.15]) by oss.sgi.com (Postfix) with ESMTP id DC7A77CAE for ; Tue, 23 Feb 2016 21:37:51 -0600 (CST) Received: from cuda.sgi.com (cuda2.sgi.com [192.48.176.25]) by relay3.corp.sgi.com (Postfix) with ESMTP id 3DC7AAC002 for ; Tue, 23 Feb 2016 19:37:45 -0800 (PST) X-ASG-Debug-ID: 1456285056-04cbb06ae0d8670001-NocioJ Received: from mail-yw0-f177.google.com (mail-yw0-f177.google.com [209.85.161.177]) by cuda.sgi.com with ESMTP id WnPwWwCy9TFv0oLA (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128 verify=NO) for ; Tue, 23 Feb 2016 19:37:36 -0800 (PST) X-Barracuda-Envelope-From: paul.cannon3128@gmail.com X-Barracuda-Apparent-Source-IP: 209.85.161.177 Received: by mail-yw0-f177.google.com with SMTP id g127so5483878ywf.2 for ; Tue, 23 Feb 2016 19:37:36 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:date:message-id:subject:from:to:content-type; bh=HitfDPgvWKzIDPH9GD1Kb+h7TCB9AdYrfS5pr+okdtE=; b=apCsf1dxoLzl1HAza3dec8hNDHJCwFfGzhTugfBrCcBwtU8c52LJbHkFOjc2qtWcCb Q6ka9/z6LwefFAeLtZ/odDaAsKm2juW+SbuJG0+mBgfxUxKXVQscZDyAHt2kz39/65KS uiDz9O6NnRAn4La4wTvAy9h3qjuC4+WBlYG7LVwYO6SIVmvNNuzkesIFrimPVdr7+rtl Xt2JRe2xmSZJzwkXMB+Dr9ucNn5sSg/2sN3mbGkmPlCO2AxSdWitnZGVnmTFtBSdUY0h dKvBzRJko3solJp1I9jrWP48F36BRG0DXXd+nnSHNpPF2K272m8YfjrtuhU6hH5QczvK b9XQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:date:message-id:subject:from:to :content-type; bh=HitfDPgvWKzIDPH9GD1Kb+h7TCB9AdYrfS5pr+okdtE=; b=WAyS2mo++f75V80aPkd0xGnivY0J9iyUYSC3qNbhZ6FYU3uww9t7ehK774BMLxEmuI ZmLeFb6O/WC9Mtx6dNVvczZHFMjbCXeRwKOS6dj+tniEf+KFkuDRc2UxVtstl+Gdi/uZ WU3FFH3SZjRj4XHncpp0R3ObJXlyJK1kVMg3k095feFsC935gQgFE6XcVWM/E//c2Tgp LlGhcxmqqRKYpoohug1gwPjmeza3h+YjO6kiLBfhKcVlwWMJW55c8DMniOU9H0m9GjGE xwJIDGZlPgVlk++6azPREhJvSNg/BjQvhgNVMKqGtgXlKoaFD6aBzc/azK8r5xXvvt2W H8eg== X-Gm-Message-State: AG10YOTmFiBoS+VacLFpr4BspoVIITZlOfKM+VZYEMrB65xEBnd6TO+kpi2SZ7ORq8BcLsXfy4bzsLgNCFwKAA== MIME-Version: 1.0 X-Received: by 10.129.146.210 with SMTP id j201mr18904489ywg.217.1456285056333; Tue, 23 Feb 2016 19:37:36 -0800 (PST) Received: by 10.37.36.195 with HTTP; Tue, 23 Feb 2016 19:37:36 -0800 (PST) Date: Tue, 23 Feb 2016 22:37:36 -0500 Message-ID: Subject: Accidental FS corruption: Mapping files to blocks From: Paul Cannon X-ASG-Orig-Subj: Accidental FS corruption: Mapping files to blocks To: xfs@oss.sgi.com Content-Type: multipart/alternative; boundary=94eb2c092a407983a0052c7bc9b6 X-Barracuda-Connect: mail-yw0-f177.google.com[209.85.161.177] X-Barracuda-Start-Time: 1456285056 X-Barracuda-Encrypted: ECDHE-RSA-AES128-GCM-SHA256 X-Barracuda-URL: https://192.48.176.25:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-BRTS-Status: 1 X-Barracuda-Spam-Score: 0.00 X-Barracuda-Spam-Status: No, SCORE=0.00 using per-user scores of TAG_LEVEL=1000.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.7 tests=DKIM_SIGNED, DKIM_VERIFIED, HTML_MESSAGE X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.3.27290 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- -0.00 DKIM_VERIFIED Domain Keys Identified Mail: signature passes verification 0.00 DKIM_SIGNED Domain Keys Identified Mail: message has a signature 0.00 HTML_MESSAGE BODY: HTML included in message --94eb2c092a407983a0052c7bc9b6 Content-Type: text/plain; charset=UTF-8 I have accidentally damaged my XFS, and need help (and a little prayer). The way it happened will provide your daily amusement dose (and hopefully a lesson). * What happened? I have two file systems xfsA (18 TBs on /dev/sdc1) and xfsB (36 TBs on /dev/sdd1). They were mounted and working fine. I accidentally executed an old script that effectively ran the following command: >ddrescue /dev/sdc /dev/sdd sdc_sdd.log For those unfamiliar with the ddrescue command, it claims to rescue/image data from a drive A to B. It does multiple passes to rescue data with maximum efficiency. * Why did I do it? I am careless or dumb or may be a combination of both. But the fact that drives got remapped (sdc/sdd became sde/sdf and otherway around) might also be part of it. * What happened to XFS on sdd (xfsB)? Luckily, the imaging started with an offset of about 2.7 TBs. Why? Because this was a restart of ddrescue and it started from past point. IT WROTE a total of 6.1 GBs of data on sdd/xfsB So I quickly stopped as I realized my mistake. I ran xfs_repair on xfsB. Due to the offset of 2.7 TBs, metadata seemed fine. The xfs_repair shows everything is fine. But if I extract out data using (dd skip=2.7TB) into a file -- I can see things are different! I recognize the abrupt change in a text file, exactly where the data overwritten. * Luckily I have old copy of the original data! So I did a rsync -rvn /olddata/ /xfsB Nothing! No difference in any data files. I even tried mirrordir, same thing -- nothing, no difference! * Here is what I think is going on, and I need help. I suspect that the access time of the file/files stored at this location are perhaps in another location in inode (does this sound correct? I am a newbie to XFS). But the data itself has changed at the location. * QUESTION: How do I find what files were stored at the location? I have an EXACT location of the range affected. Once I find the affected files, I can perhaps do further surgery. Any help (and prayers) will be highly appreciated. --94eb2c092a407983a0052c7bc9b6 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
    I have accidentally damaged my XFS, and need help (and a l= ittle prayer). The way it happened will provide your daily amusement dose (= and hopefully a lesson).

    * What happened?
    I ha= ve two file systems xfsA (18 TBs on /dev/sdc1) and xfsB (36 TBs on /dev/sdd= 1). They were mounted and working fine. I accidentally executed an old scri= pt that effectively ran the following command:
    >ddrescue /dev/= sdc /dev/sdd sdc_sdd.log
    For those unfamiliar with the ddrescue c= ommand, it claims to rescue/image data from a drive A to B. It does multipl= e passes to rescue data with maximum efficiency.

    *= Why did I do it?
    I am careless or dumb or may be a combination o= f both. But the fact that drives got remapped (sdc/sdd became sde/sdf and o= therway around) might also be part of it.

    * What h= appened to XFS on sdd (xfsB)?
    Luckily, the imaging started with a= n offset of about 2.7 TBs. Why? Because this was a restart of ddrescue and = it started from past point. IT WROTE a total of 6.1 GBs of data on sdd/xfsB=

    So I quickly stopped as I realized my mistake. I = ran xfs_repair on xfsB. Due to the offset of 2.7 TBs, metadata seemed fine.= The xfs_repair shows everything is fine. But if I extract out data using (= dd skip=3D2.7TB) into a file -- I can see things are different! I recognize= the abrupt change in a text file, exactly where the data overwritten.

    * Luckily I have old copy of the original data!
    <= div>So I did a rsync -rvn /olddata/ /xfsB
    Nothing! No difference = in any data files. I even tried mirrordir, same thing -- nothing, no differ= ence!

    * Here is what I think is going on, and I ne= ed help.
    I suspect that the access time of the file/files stored = at this location are perhaps in another location in inode (does this sound = correct? I am a newbie to XFS). But the data itself has changed at the loca= tion.

    * QUESTION: How do I find what files were st= ored at the location? I have an EXACT location of the range affected. Once = I find the affected files, I can perhaps do further surgery.

    =
    Any help (and prayers) will be highly appreciated.
    =C2=A0=C2=A0

    =C2=A0=C2=A0=C2=A0
    --94eb2c092a407983a0052c7bc9b6-- From darrick.wong@oracle.com Wed Feb 24 00:13:17 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay3.corp.sgi.com [198.149.34.15]) by oss.sgi.com (Postfix) with ESMTP id 4CC4D7CA1 for ; Wed, 24 Feb 2016 00:13:17 -0600 (CST) Received: from cuda.sgi.com (cuda3.sgi.com [192.48.176.15]) by relay3.corp.sgi.com (Postfix) with ESMTP id B55AFAC005 for ; Tue, 23 Feb 2016 22:13:10 -0800 (PST) X-ASG-Debug-ID: 1456294388-04cb6c70072d690001-NocioJ Received: from userp1040.oracle.com (userp1040.oracle.com [156.151.31.81]) by cuda.sgi.com with ESMTP id aKdjwazIQWLpu737 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO) for ; Tue, 23 Feb 2016 22:13:08 -0800 (PST) X-Barracuda-Envelope-From: darrick.wong@oracle.com X-Barracuda-Apparent-Source-IP: 156.151.31.81 Received: from aserv0022.oracle.com (aserv0022.oracle.com [141.146.126.234]) by userp1040.oracle.com (Sentrion-MTA-4.3.2/Sentrion-MTA-4.3.2) with ESMTP id u1O6D3Fm026940 (version=TLSv1 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Wed, 24 Feb 2016 06:13:04 GMT Received: from userv0121.oracle.com (userv0121.oracle.com [156.151.31.72]) by aserv0022.oracle.com (8.13.8/8.13.8) with ESMTP id u1O6D3Bh012889 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=FAIL); Wed, 24 Feb 2016 06:13:03 GMT Received: from abhmp0012.oracle.com (abhmp0012.oracle.com [141.146.116.18]) by userv0121.oracle.com (8.13.8/8.13.8) with ESMTP id u1O6D2r4032655; Wed, 24 Feb 2016 06:13:02 GMT Received: from localhost (/24.21.154.84) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Tue, 23 Feb 2016 22:13:02 -0800 Date: Tue, 23 Feb 2016 22:12:58 -0800 From: "Darrick J. Wong" To: Paul Cannon Cc: xfs@oss.sgi.com Subject: Re: Accidental FS corruption: Mapping files to blocks Message-ID: <20160224061258.GA19107@birch.djwong.org> X-ASG-Orig-Subj: Re: Accidental FS corruption: Mapping files to blocks References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.21 (2010-09-15) X-Source-IP: aserv0022.oracle.com [141.146.126.234] X-Barracuda-Connect: userp1040.oracle.com[156.151.31.81] X-Barracuda-Start-Time: 1456294388 X-Barracuda-Encrypted: ECDHE-RSA-AES256-GCM-SHA384 X-Barracuda-URL: https://192.48.176.15:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-BRTS-Status: 1 X-Barracuda-Spam-Score: 0.00 X-Barracuda-Spam-Status: No, SCORE=0.00 using per-user scores of TAG_LEVEL=1000.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.7 tests=BSF_SC0_MISMATCH_TO, UNPARSEABLE_RELAY X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.3.27293 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 0.00 BSF_SC0_MISMATCH_TO Envelope rcpt doesn't match header 0.00 UNPARSEABLE_RELAY Informational: message has unparseable relay lines On Tue, Feb 23, 2016 at 10:37:36PM -0500, Paul Cannon wrote: > I have accidentally damaged my XFS, and need help (and a little prayer). > The way it happened will provide your daily amusement dose (and hopefully a > lesson). > > * What happened? > I have two file systems xfsA (18 TBs on /dev/sdc1) and xfsB (36 TBs on > /dev/sdd1). They were mounted and working fine. I accidentally executed an > old script that effectively ran the following command: > >ddrescue /dev/sdc /dev/sdd sdc_sdd.log > For those unfamiliar with the ddrescue command, it claims to rescue/image > data from a drive A to B. It does multiple passes to rescue data with > maximum efficiency. > > * Why did I do it? > I am careless or dumb or may be a combination of both. But the fact that > drives got remapped (sdc/sdd became sde/sdf and otherway around) might also > be part of it. > > * What happened to XFS on sdd (xfsB)? > Luckily, the imaging started with an offset of about 2.7 TBs. Why? Because > this was a restart of ddrescue and it started from past point. IT WROTE a > total of 6.1 GBs of data on sdd/xfsB > > So I quickly stopped as I realized my mistake. I ran xfs_repair on xfsB. > Due to the offset of 2.7 TBs, metadata seemed fine. The xfs_repair shows > everything is fine. But if I extract out data using (dd skip=2.7TB) into a > file -- I can see things are different! I recognize the abrupt change in a > text file, exactly where the data overwritten. > > * Luckily I have old copy of the original data! Good for you! Seriously. :D > So I did a rsync -rvn /olddata/ /xfsB > Nothing! No difference in any data files. I even tried mirrordir, same > thing -- nothing, no difference! rsync -c to force it to checksum the data blocks? By default I think it only compares file size and timestamps. > * Here is what I think is going on, and I need help. > I suspect that the access time of the file/files stored at this location > are perhaps in another location in inode (does this sound correct? I am a > newbie to XFS). But the data itself has changed at the location. Quite possible. > * QUESTION: How do I find what files were stored at the location? I have an > EXACT location of the range affected. Once I find the affected files, I can > perhaps do further surgery. Sounds like something that the reverse-mapping btree and associated GETFSMAP ioctl could help solve ... too bad it only exists as experimental patches to the on-disk format. :( In the meantime, I guess you could umount the filesystem and run xfs_db on it to find out what was in the areas that got overwritten, assuming rsync -c also shows no difference. Something along the lines of: # xfs_db /dev/sdXX xfs_db> blockget -n xfs_db> fsblock xfs_db> blockuse -n -c Have a look at the xfs_db manpage for more info on what those commands do. --D > > Any help (and prayers) will be highly appreciated. > _______________________________________________ > xfs mailing list > xfs@oss.sgi.com > http://oss.sgi.com/mailman/listinfo/xfs From sunspot0105@gmail.com Wed Feb 24 00:28:50 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.3 required=5.0 tests=FREEMAIL_ENVFROM_END_DIGIT, FREEMAIL_FROM,HTML_MESSAGE,T_DKIM_INVALID autolearn=no version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay2.corp.sgi.com [137.38.102.29]) by oss.sgi.com (Postfix) with ESMTP id 3087629E05 for ; Wed, 24 Feb 2016 00:28:50 -0600 (CST) Received: from cuda.sgi.com (cuda2.sgi.com [192.48.176.25]) by relay2.corp.sgi.com (Postfix) with ESMTP id EB26D304051 for ; Tue, 23 Feb 2016 22:28:43 -0800 (PST) X-ASG-Debug-ID: 1456294355-04cbb06ae0ddd30001-NocioJ Received: from mail-wm0-f46.google.com (mail-wm0-f46.google.com [74.125.82.46]) by cuda.sgi.com with ESMTP id J4JtiOzf6DtsPb6J (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128 verify=NO) for ; Tue, 23 Feb 2016 22:12:36 -0800 (PST) X-Barracuda-Envelope-From: sunspot0105@gmail.com X-Barracuda-Apparent-Source-IP: 74.125.82.46 Received: by mail-wm0-f46.google.com with SMTP id b205so20696932wmb.1 for ; Tue, 23 Feb 2016 22:12:36 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:date:message-id:subject:from:to; bh=oUQZnVR5uAW9oPMrQ/UrwRlgdrBLZDxEGl7NxlMFsgI=; b=a65Vych2wVb//M1QnzgDe5Dma/dgt3IowbnR+J2OhyCZAW/8I2vy9njZ7rwLuWTkKk QADcFuUf4TcMIngt7Cn+2g46aFKfsTn5dGsvhWWgR0dROoF5wseAs3k+f+XB/BV7BSyf G+Tv69jQjfxx/SH+9xCFOCDmgd7tMNmtSUstxeixioBih4/7bS4qHnOnfAgKOPgdB6h/ N6Cpmk+MsNQcoTVZh/gUQxN/Z3Yi9y3I8qSO+Qfz5k6YOh1c4ZkjeBW+/wWFI5aUfJOK KDnBFWJ971JF2vALHMWCqkz07jAUkp0i4zDFEb6v2xx6XHXs5gI6QERqBHP8pzh7EgBJ faYg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:date:message-id:subject:from:to; bh=oUQZnVR5uAW9oPMrQ/UrwRlgdrBLZDxEGl7NxlMFsgI=; b=QIdMXnit/5yVixrrmcTflDo2l0eSon14ehs8P9oLi9usdeMbfLzwmRpImHylcwmhPX Jf9VVIL7rwaiAyrOXHGoXLDdsTY897IJTJWOn0jifQKlyGSrXhcCtNenhsoECUDYVsYX XD2M69Ls318DKSYdD8QjilVfctlXiKa0a11WSMPUafGN3J/vVvqLd1MNRblDXqEQ2ko1 iQqifletDKmklO+5TY3DVc56PH4R6pYZmOEVFQNm5LS/GkW12qVF+EcIEyU8ohnQrR1Z +XEjOV8/km3QLjiVK7wimpZAgO9wDZDzF2211VmB1D9eSU8MG0WzC1+SvnMRH5sknOi5 7iCA== X-Gm-Message-State: AG10YOQrpg5Ti5rhRdghiR6tuVvaLNKM2Zm4Z8t2fOPcxwDMDBva5IxgO+obSozma/0orv+Dl6Dqk2wr9xKzBQ== MIME-Version: 1.0 X-Received: by 10.28.220.134 with SMTP id t128mr21378306wmg.61.1456294354950; Tue, 23 Feb 2016 22:12:34 -0800 (PST) Received: by 10.27.175.203 with HTTP; Tue, 23 Feb 2016 22:12:34 -0800 (PST) Date: Wed, 24 Feb 2016 14:12:34 +0800 Message-ID: Subject: XFS Corruption From: fangchen sun X-ASG-Orig-Subj: XFS Corruption To: xfs@oss.sgi.com Content-Type: multipart/alternative; boundary=001a114b3054b72322052c7df3c6 X-Barracuda-Connect: mail-wm0-f46.google.com[74.125.82.46] X-Barracuda-Start-Time: 1456294355 X-Barracuda-Encrypted: ECDHE-RSA-AES128-GCM-SHA256 X-Barracuda-URL: https://192.48.176.25:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-BRTS-Status: 1 X-Barracuda-Spam-Score: 0.00 X-Barracuda-Spam-Status: No, SCORE=0.00 using per-user scores of TAG_LEVEL=1000.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.7 tests=DKIM_SIGNED, DKIM_VERIFIED, HTML_MESSAGE X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.3.27293 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- -0.00 DKIM_VERIFIED Domain Keys Identified Mail: signature passes verification 0.00 DKIM_SIGNED Domain Keys Identified Mail: message has a signature 0.00 HTML_MESSAGE BODY: HTML included in message --001a114b3054b72322052c7df3c6 Content-Type: text/plain; charset=UTF-8 Dear all: I have a ceph object storage cluster, and choose XFS as the underlying file system. I recently ran into a problem that sometimes the function "setxattr()" failed, I can only umount the disk and repair it with "xfs_repair". os: centos 6.5 kernel version: 2.6.32 the log for dmesg command: [41796028.532225] Pid: 1438740, comm: ceph-osd Not tainted 2.6.32-925.431.23.3.letv.el6.x86_64 #1 [41796028.532227] Call Trace: [41796028.532255] [] ? xfs_error_report+0x3f/0x50 [xfs] [41796028.532276] [] ? xfs_da_read_buf+0x2a/0x30 [xfs] [41796028.532296] [] ? xfs_corruption_error+0x5e/0x90 [xfs] [41796028.532316] [] ? xfs_da_do_buf+0x6cc/0x770 [xfs] [41796028.532335] [] ? xfs_da_read_buf+0x2a/0x30 [xfs] [41796028.532359] [] ? kmem_zone_alloc+0x77/0xf0 [xfs] [41796028.532380] [] ? xfs_da_read_buf+0x2a/0x30 [xfs] [41796028.532399] [] ? xfs_attr_leaf_addname+0x61/0x3d0 [xfs] [41796028.532426] [] ? xfs_attr_leaf_addname+0x61/0x3d0 [xfs] [41796028.532455] [] ? xfs_trans_add_item+0x57/0x70 [xfs] [41796028.532476] [] ? xfs_bmbt_get_all+0x18/0x20 [xfs] [41796028.532495] [] ? xfs_attr_set_int+0x3c4/0x510 [xfs] [41796028.532517] [] ? xfs_da_do_buf+0x6db/0x770 [xfs] [41796028.532536] [] ? xfs_attr_set+0x81/0x90 [xfs] [41796028.532560] [] ? __xfs_xattr_set+0x43/0x60 [xfs] [41796028.532584] [] ? xfs_xattr_user_set+0x11/0x20 [xfs] [41796028.532592] [] ? generic_setxattr+0xa2/0xb0 [41796028.532596] [] ? __vfs_setxattr_noperm+0x4e/0x160 [41796028.532600] [] ? inode_permission+0xa7/0x100 [41796028.532604] [] ? vfs_setxattr+0xbc/0xc0 [41796028.532607] [] ? setxattr+0xd0/0x150 [41796028.532612] [] ? __dequeue_entity+0x30/0x50 [41796028.532617] [] ? __switch_to+0x26e/0x320 [41796028.532621] [] ? __sb_start_write+0x80/0x120 [41796028.532626] [] ? thread_return+0x4e/0x760 [41796028.532630] [] ? sys_fsetxattr+0xad/0xd0 [41796028.532633] [] ? system_call_fastpath+0x16/0x1b [41796028.532636] XFS (sdi1): Corruption detected. Unmount and run xfs_repair Any comments will be much appreciated! Best Regards! sunspot --001a114b3054b72322052c7df3c6 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
    Dear all:

    I have a ceph o= bject storage cluster, and choose XFS as the underlying file system.
    <= div style=3D"font-size:14px">I recently ran into a problem that sometimes t= he function "setxattr()" =C2=A0failed,=C2=A0
    I can only umount the disk and repair it with "xfs_repa= ir".

    os: centos 6.5
    kernel version:= 2.6.32

    the log for dmesg command:
    = [41796028.532225] Pid: 1438740, comm: ceph-osd Not tainted 2.6.32-925.431.2= 3.3.letv.el6.x86_64 #1
    [41796028.532227] Call Trace:
    [4= 1796028.532255] =C2=A0[<ffffffffa01e1e5f>] ? xfs_error_report+0x3f/0x= 50 [xfs]
    [41796028.532276] =C2=A0[<ffffffffa01d506a>] ? xfs= _da_read_buf+0x2a/0x30 [xfs]
    [41796028.532296] =C2=A0[<fffffff= fa01e1ece>] ? xfs_corruption_error+0x5e/0x90 [xfs]
    [41796028.5= 32316] =C2=A0[<ffffffffa01d4f4c>] ? xfs_da_do_buf+0x6cc/0x770 [xfs]
    [41796028.532335] =C2=A0[<ffffffffa01d506a>] ? xfs_da_read_b= uf+0x2a/0x30 [xfs]
    [41796028.532359] =C2=A0[<ffffffffa0206fc7&= gt;] ? kmem_zone_alloc+0x77/0xf0 [xfs]
    [41796028.532380] =C2=A0[&= lt;ffffffffa01d506a>] ? xfs_da_read_buf+0x2a/0x30 [xfs]
    [41796= 028.532399] =C2=A0[<ffffffffa01bc481>] ? xfs_attr_leaf_addname+0x61/0= x3d0 [xfs]
    [41796028.532426] =C2=A0[<ffffffffa01bc481>] ? x= fs_attr_leaf_addname+0x61/0x3d0 [xfs]
    [41796028.532455] =C2=A0[&l= t;ffffffffa01ff187>] ? xfs_trans_add_item+0x57/0x70 [xfs]
    [417= 96028.532476] =C2=A0[<ffffffffa01cc208>] ? xfs_bmbt_get_all+0x18/0x20= [xfs]
    [41796028.532495] =C2=A0[<ffffffffa01bcbb4>] ? xfs_a= ttr_set_int+0x3c4/0x510 [xfs]
    [41796028.532517] =C2=A0[<ffffff= ffa01d4f5b>] ? xfs_da_do_buf+0x6db/0x770 [xfs]
    [41796028.53253= 6] =C2=A0[<ffffffffa01bcd81>] ? xfs_attr_set+0x81/0x90 [xfs]
    [41796028.532560] =C2=A0[<ffffffffa0216cc3>] ? __xfs_xattr_set+0x43= /0x60 [xfs]
    [41796028.532584] =C2=A0[<ffffffffa0216d31>] ? = xfs_xattr_user_set+0x11/0x20 [xfs]
    [41796028.532592] =C2=A0[<f= fffffff811aee92>] ? generic_setxattr+0xa2/0xb0
    [41796028.53259= 6] =C2=A0[<ffffffff811b134e>] ? __vfs_setxattr_noperm+0x4e/0x160
    [41796028.532600] =C2=A0[<ffffffff81196b77>] ? inode_permission= +0xa7/0x100
    [41796028.532604] =C2=A0[<ffffffff811b151c>] ? = vfs_setxattr+0xbc/0xc0
    [41796028.532607] =C2=A0[<ffffffff811b1= 5f0>] ? setxattr+0xd0/0x150
    [41796028.532612] =C2=A0[<fffff= fff8105af80>] ? __dequeue_entity+0x30/0x50
    [41796028.532617] = =C2=A0[<ffffffff8100988e>] ? __switch_to+0x26e/0x320
    [41796= 028.532621] =C2=A0[<ffffffff8118aec0>] ? __sb_start_write+0x80/0x120<= /div>
    [41796028.532626] =C2=A0[<ffffffff8152912e>] ? thread_retur= n+0x4e/0x760
    [41796028.532630] =C2=A0[<ffffffff811b171d>] ?= sys_fsetxattr+0xad/0xd0
    [41796028.532633] =C2=A0[<ffffffff810= 0b072>] ? system_call_fastpath+0x16/0x1b
    [41796028.532636] XFS= (sdi1): Corruption detected. Unmount and run xfs_repair

    Any comments= will be much appreciated!

    Best Regards!
    sunspot
    --001a114b3054b72322052c7df3c6-- From BATV+8f6cf6af93f4300ac991+4567+infradead.org+hch@casper.srs.infradead.org Wed Feb 24 02:20:30 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=ham version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay1.corp.sgi.com [137.38.102.111]) by oss.sgi.com (Postfix) with ESMTP id 9E6007CA2 for ; Wed, 24 Feb 2016 02:20:30 -0600 (CST) Received: from cuda.sgi.com (cuda2.sgi.com [192.48.176.25]) by relay1.corp.sgi.com (Postfix) with ESMTP id 72A0C8F8033 for ; Wed, 24 Feb 2016 00:20:24 -0800 (PST) X-ASG-Debug-ID: 1456302020-04cbb06adee1d20001-NocioJ Received: from casper.infradead.org (casper.infradead.org [85.118.1.10]) by cuda.sgi.com with ESMTP id a513rW7Y76LEVEp2 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128 verify=NO) for ; Wed, 24 Feb 2016 00:20:21 -0800 (PST) X-Barracuda-Envelope-From: BATV+8f6cf6af93f4300ac991+4567+infradead.org+hch@casper.srs.infradead.org X-Barracuda-Apparent-Source-IP: 85.118.1.10 Received: from [88.128.80.14] (helo=localhost) by casper.infradead.org with esmtpsa (Exim 4.85 #2 (Red Hat Linux)) id 1aYUgF-0004S0-RQ; Wed, 24 Feb 2016 08:20:20 +0000 From: Christoph Hellwig To: xfs@oss.sgi.com Cc: Dave Chinner Subject: [PATCH 2/3] xfs: don't release bios on completion immediately Date: Wed, 24 Feb 2016 09:20:10 +0100 X-ASG-Orig-Subj: [PATCH 2/3] xfs: don't release bios on completion immediately Message-Id: <1456302011-18915-3-git-send-email-hch@lst.de> X-Mailer: git-send-email 2.1.4 In-Reply-To: <1456302011-18915-1-git-send-email-hch@lst.de> References: <1456302011-18915-1-git-send-email-hch@lst.de> X-SRS-Rewrite: SMTP reverse-path rewritten from by casper.infradead.org. See http://www.infradead.org/rpr.html X-Barracuda-Connect: casper.infradead.org[85.118.1.10] X-Barracuda-Start-Time: 1456302020 X-Barracuda-Encrypted: ECDHE-RSA-AES128-GCM-SHA256 X-Barracuda-URL: https://192.48.176.25:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-BRTS-Status: 1 X-Barracuda-Spam-Score: 0.00 X-Barracuda-Spam-Status: No, SCORE=0.00 using per-user scores of TAG_LEVEL=1000.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.7 tests= X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.3.27295 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- Completion of an ioend requires us to walk the bufferhead list to end writback on all the bufferheads. This, in turn, is needed so that we can end writeback on all the pages we just did IO on. To remove our dependency on bufferheads in writeback, we need to turn this around the other way - we need to walk the pages we've just completed IO on, and then walk the buffers attached to the pages and complete their IO. In doing this, we remove the requirement for the ioend to track bufferheads directly. To enable IO completion to walk all the pages we've submitted IO on, we need to keep the bios that we used for IO around until the ioend has been completed. We can do this simply by chaining the bios to the ioend at completion time, and then walking their pages directly just before destroying the ioend. Signed-off-by: Dave Chinner --- fs/xfs/xfs_aops.c | 90 +++++++++++++++++++++++++++++++++++++++++-------------- fs/xfs/xfs_aops.h | 5 ++-- 2 files changed, 71 insertions(+), 24 deletions(-) diff --git a/fs/xfs/xfs_aops.c b/fs/xfs/xfs_aops.c index 90e6e3a..fc4fed6 100644 --- a/fs/xfs/xfs_aops.c +++ b/fs/xfs/xfs_aops.c @@ -84,25 +84,71 @@ xfs_find_bdev_for_inode( } /* - * We're now finished for good with this ioend structure. - * Update the page state via the associated buffer_heads, - * release holds on the inode and bio, and finally free - * up memory. Do not use the ioend after this. + * We're now finished for good with this page. Update the page state via the + * associated buffer_heads, paying attention to the start and end offsets that + * we need to process on the page. + */ +static void +xfs_finish_page_writeback( + struct page *page, + unsigned int start, + unsigned int end, + int error) +{ + struct buffer_head *head, *bh; + unsigned int off = 0; + + bh = head = page_buffers(page); + + do { + if (start > off) + goto next_bh; + if (off > end) + break; + bh->b_end_io(bh, !error); +next_bh: + off += bh->b_size; + } while ((bh = bh->b_this_page) != head); +} + +/* + * We're now finished for good with this ioend structure. Update the page + * state, release holds on bios, and finally free up memory. Do not use the + * ioend after this. */ STATIC void xfs_destroy_ioend( - xfs_ioend_t *ioend) + struct xfs_ioend *ioend) { - struct buffer_head *bh, *next; + struct bio *bio, *next; + + for (bio = ioend->io_bio_done; bio; bio = next) { + struct bio_vec *bvec; + int i; - for (bh = ioend->io_buffer_head; bh; bh = next) { - next = bh->b_private; - bh->b_end_io(bh, !ioend->io_error); + next = bio->bi_private; + bio->bi_private = NULL; + + /* walk each page on bio, ending page IO on them */ + bio_for_each_segment_all(bvec, bio, i) { + struct page *page = bvec->bv_page; + unsigned int off = bvec->bv_offset; + unsigned int end_off = off + bvec->bv_len - 1; + + ASSERT(off < PAGE_SIZE); + ASSERT(end_off <= PAGE_SIZE); + + xfs_finish_page_writeback(page, off, end_off, + ioend->io_error); + + } + bio_put(bio); } mempool_free(ioend, xfs_ioend_pool); } + /* * Fast and loose check if this write could update the on-disk inode size. */ @@ -286,6 +332,7 @@ xfs_alloc_ioend( ioend->io_type = type; ioend->io_inode = inode; INIT_WORK(&ioend->io_work, xfs_end_io); + spin_lock_init(&ioend->io_lock); return ioend; } @@ -365,15 +412,21 @@ STATIC void xfs_end_bio( struct bio *bio) { - xfs_ioend_t *ioend = bio->bi_private; + struct xfs_ioend *ioend = bio->bi_private; + unsigned long flags; - if (!ioend->io_error) - ioend->io_error = bio->bi_error; - - /* Toss bio and pass work off to an xfsdatad thread */ bio->bi_private = NULL; bio->bi_end_io = NULL; - bio_put(bio); + + spin_lock_irqsave(&ioend->io_lock, flags); + if (!ioend->io_error) + ioend->io_error = bio->bi_error; + if (!ioend->io_bio_done) + ioend->io_bio_done = bio; + else + ioend->io_bio_done_tail->bi_private = bio; + ioend->io_bio_done_tail = bio; + spin_unlock_irqrestore(&ioend->io_lock, flags); xfs_finish_ioend(ioend); } @@ -517,16 +570,9 @@ xfs_add_to_ioend( bh->b_blocknr != wpc->last_block + 1) { if (ioend) list_add(&ioend->io_list, iolist); - ioend = wpc->ioend = xfs_alloc_ioend(inode, wpc->io_type); ioend->io_offset = offset; - ioend->io_buffer_head = bh; - ioend->io_buffer_tail = bh; - } else { - ioend->io_buffer_tail->b_private = bh; - ioend->io_buffer_tail = bh; } - bh->b_private = NULL; retry: if (!ioend->io_bio) diff --git a/fs/xfs/xfs_aops.h b/fs/xfs/xfs_aops.h index c89c3bd..1c7b041 100644 --- a/fs/xfs/xfs_aops.h +++ b/fs/xfs/xfs_aops.h @@ -46,13 +46,14 @@ typedef struct xfs_ioend { int io_error; /* I/O error code */ atomic_t io_remaining; /* hold count */ struct inode *io_inode; /* file being written to */ - struct buffer_head *io_buffer_head;/* buffer linked list head */ - struct buffer_head *io_buffer_tail;/* buffer linked list tail */ size_t io_size; /* size of the extent */ xfs_off_t io_offset; /* offset in the file */ struct work_struct io_work; /* xfsdatad work queue */ struct xfs_trans *io_append_trans;/* xact. for size update */ struct bio *io_bio; /* bio being built */ + struct bio *io_bio_done; /* bios completed */ + struct bio *io_bio_done_tail; /* bios completed */ + spinlock_t io_lock; /* for bio completion list */ } xfs_ioend_t; extern const struct address_space_operations xfs_address_space_operations; -- 2.1.4 From BATV+8f6cf6af93f4300ac991+4567+infradead.org+hch@casper.srs.infradead.org Wed Feb 24 02:20:33 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=ham version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay2.corp.sgi.com [137.38.102.29]) by oss.sgi.com (Postfix) with ESMTP id 859717CA2 for ; Wed, 24 Feb 2016 02:20:33 -0600 (CST) Received: from cuda.sgi.com (cuda1.sgi.com [192.48.157.11]) by relay2.corp.sgi.com (Postfix) with ESMTP id 3B209304051 for ; Wed, 24 Feb 2016 00:20:27 -0800 (PST) X-ASG-Debug-ID: 1456302021-04bdf07ab3112ea0001-NocioJ Received: from casper.infradead.org (casper.infradead.org [85.118.1.10]) by cuda.sgi.com with ESMTP id vhe5vmLtXoJKhGTw (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128 verify=NO) for ; Wed, 24 Feb 2016 00:20:22 -0800 (PST) X-Barracuda-Envelope-From: BATV+8f6cf6af93f4300ac991+4567+infradead.org+hch@casper.srs.infradead.org X-Barracuda-Apparent-Source-IP: 85.118.1.10 Received: from [88.128.80.14] (helo=localhost) by casper.infradead.org with esmtpsa (Exim 4.85 #2 (Red Hat Linux)) id 1aYUgH-0004S9-BI for xfs@oss.sgi.com; Wed, 24 Feb 2016 08:20:21 +0000 From: Christoph Hellwig To: xfs@oss.sgi.com Subject: [PATCH 3/3] xfs: optimize bio handling in the buffer writeback path Date: Wed, 24 Feb 2016 09:20:11 +0100 X-ASG-Orig-Subj: [PATCH 3/3] xfs: optimize bio handling in the buffer writeback path Message-Id: <1456302011-18915-4-git-send-email-hch@lst.de> X-Mailer: git-send-email 2.1.4 In-Reply-To: <1456302011-18915-1-git-send-email-hch@lst.de> References: <1456302011-18915-1-git-send-email-hch@lst.de> X-SRS-Rewrite: SMTP reverse-path rewritten from by casper.infradead.org. See http://www.infradead.org/rpr.html X-Barracuda-Connect: casper.infradead.org[85.118.1.10] X-Barracuda-Start-Time: 1456302022 X-Barracuda-Encrypted: ECDHE-RSA-AES128-GCM-SHA256 X-Barracuda-URL: https://192.48.157.11:443/cgi-mod/mark.cgi X-Barracuda-BRTS-Status: 1 X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-Spam-Score: 0.00 X-Barracuda-Spam-Status: No, SCORE=0.00 using per-user scores of TAG_LEVEL=1000.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.7 tests= X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.3.27295 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- This patch implements two closely related changes: First it embedds a bio the ioend structure so that we don't have to allocate one separately. Second it uses the block layer bio chaining mechanism to chain additional bios off this first one if needed instead of manually accouting for multiple bio completions in the ioend structure. Together this removes a memory allocation per ioend and greatly simplifies the ioend setup and I/O completion path. Signed-off-by: Christoph Hellwig --- fs/xfs/xfs_aops.c | 217 ++++++++++++++++++++--------------------------------- fs/xfs/xfs_aops.h | 15 ++-- fs/xfs/xfs_super.c | 26 ++----- 3 files changed, 93 insertions(+), 165 deletions(-) diff --git a/fs/xfs/xfs_aops.c b/fs/xfs/xfs_aops.c index fc4fed6..1ea4167 100644 --- a/fs/xfs/xfs_aops.c +++ b/fs/xfs/xfs_aops.c @@ -118,17 +118,15 @@ next_bh: */ STATIC void xfs_destroy_ioend( - struct xfs_ioend *ioend) + struct xfs_ioend *ioend, + int error) { - struct bio *bio, *next; + struct bio *bio, *next, *last = ioend->io_bio; - for (bio = ioend->io_bio_done; bio; bio = next) { + for (bio = &ioend->io_inline_bio; bio; bio = next) { struct bio_vec *bvec; int i; - next = bio->bi_private; - bio->bi_private = NULL; - /* walk each page on bio, ending page IO on them */ bio_for_each_segment_all(bvec, bio, i) { struct page *page = bvec->bv_page; @@ -138,17 +136,21 @@ xfs_destroy_ioend( ASSERT(off < PAGE_SIZE); ASSERT(end_off <= PAGE_SIZE); - xfs_finish_page_writeback(page, off, end_off, - ioend->io_error); - + xfs_finish_page_writeback(page, off, end_off, error); } + + /* + * For the last bio, bi_private points to the ioend, so we + * need to explicitly end the iteration here. + */ + if (bio == last) + next = NULL; + else + next = bio->bi_private; bio_put(bio); } - - mempool_free(ioend, xfs_ioend_pool); } - /* * Fast and loose check if this write could update the on-disk inode size. */ @@ -220,7 +222,8 @@ xfs_setfilesize( STATIC int xfs_setfilesize_ioend( - struct xfs_ioend *ioend) + struct xfs_ioend *ioend, + int error) { struct xfs_inode *ip = XFS_I(ioend->io_inode); struct xfs_trans *tp = ioend->io_append_trans; @@ -234,53 +237,32 @@ xfs_setfilesize_ioend( __sb_writers_acquired(VFS_I(ip)->i_sb, SB_FREEZE_FS); /* we abort the update if there was an IO error */ - if (ioend->io_error) { + if (error) { xfs_trans_cancel(tp); - return ioend->io_error; + return error; } return xfs_setfilesize(ip, tp, ioend->io_offset, ioend->io_size); } /* - * Schedule IO completion handling on the final put of an ioend. - * - * If there is no work to do we might as well call it a day and free the - * ioend right now. - */ -STATIC void -xfs_finish_ioend( - struct xfs_ioend *ioend) -{ - if (atomic_dec_and_test(&ioend->io_remaining)) { - struct xfs_mount *mp = XFS_I(ioend->io_inode)->i_mount; - - if (ioend->io_type == XFS_IO_UNWRITTEN) - queue_work(mp->m_unwritten_workqueue, &ioend->io_work); - else if (ioend->io_append_trans) - queue_work(mp->m_data_workqueue, &ioend->io_work); - else - xfs_destroy_ioend(ioend); - } -} - -/* * IO write completion. */ STATIC void xfs_end_io( struct work_struct *work) { - xfs_ioend_t *ioend = container_of(work, xfs_ioend_t, io_work); - struct xfs_inode *ip = XFS_I(ioend->io_inode); - int error = 0; + struct xfs_ioend *ioend = + container_of(work, struct xfs_ioend, io_work); + struct xfs_inode *ip = XFS_I(ioend->io_inode); + int error = ioend->io_bio->bi_error; /* * Set an error if the mount has shut down and proceed with end I/O * processing so it can perform whatever cleanups are necessary. */ if (XFS_FORCED_SHUTDOWN(ip->i_mount)) - ioend->io_error = -EIO; + error = -EIO; /* * For unwritten extents we need to issue transactions to convert a @@ -290,50 +272,33 @@ xfs_end_io( * on error. */ if (ioend->io_type == XFS_IO_UNWRITTEN) { - if (ioend->io_error) + if (error) goto done; error = xfs_iomap_write_unwritten(ip, ioend->io_offset, ioend->io_size); } else if (ioend->io_append_trans) { - error = xfs_setfilesize_ioend(ioend); + error = xfs_setfilesize_ioend(ioend, error); } else { ASSERT(!xfs_ioend_is_append(ioend)); } done: - if (error) - ioend->io_error = error; - xfs_destroy_ioend(ioend); + xfs_destroy_ioend(ioend, error); } -/* - * Allocate and initialise an IO completion structure. - * We need to track unwritten extent write completion here initially. - * We'll need to extend this for updating the ondisk inode size later - * (vs. incore size). - */ -STATIC xfs_ioend_t * -xfs_alloc_ioend( - struct inode *inode, - unsigned int type) +STATIC void +xfs_end_bio( + struct bio *bio) { - xfs_ioend_t *ioend; - - ioend = mempool_alloc(xfs_ioend_pool, GFP_NOFS); - memset(ioend, 0, sizeof(*ioend)); + struct xfs_ioend *ioend = bio->bi_private; + struct xfs_mount *mp = XFS_I(ioend->io_inode)->i_mount; - /* - * Set the count to 1 initially, which will prevent an I/O - * completion callback from happening before we have started - * all the I/O from calling the completion routine too early. - */ - atomic_set(&ioend->io_remaining, 1); - INIT_LIST_HEAD(&ioend->io_list); - ioend->io_type = type; - ioend->io_inode = inode; - INIT_WORK(&ioend->io_work, xfs_end_io); - spin_lock_init(&ioend->io_lock); - return ioend; + if (ioend->io_type == XFS_IO_UNWRITTEN) + queue_work(mp->m_unwritten_workqueue, &ioend->io_work); + else if (ioend->io_append_trans) + queue_work(mp->m_data_workqueue, &ioend->io_work); + else + xfs_destroy_ioend(ioend, bio->bi_error); } STATIC int @@ -405,56 +370,6 @@ xfs_imap_valid( offset < imap->br_startoff + imap->br_blockcount; } -/* - * BIO completion handler for buffered IO. - */ -STATIC void -xfs_end_bio( - struct bio *bio) -{ - struct xfs_ioend *ioend = bio->bi_private; - unsigned long flags; - - bio->bi_private = NULL; - bio->bi_end_io = NULL; - - spin_lock_irqsave(&ioend->io_lock, flags); - if (!ioend->io_error) - ioend->io_error = bio->bi_error; - if (!ioend->io_bio_done) - ioend->io_bio_done = bio; - else - ioend->io_bio_done_tail->bi_private = bio; - ioend->io_bio_done_tail = bio; - spin_unlock_irqrestore(&ioend->io_lock, flags); - - xfs_finish_ioend(ioend); -} - -STATIC void -xfs_submit_ioend_bio( - struct writeback_control *wbc, - xfs_ioend_t *ioend, - struct bio *bio) -{ - atomic_inc(&ioend->io_remaining); - bio->bi_private = ioend; - bio->bi_end_io = xfs_end_bio; - submit_bio(wbc->sync_mode == WB_SYNC_ALL ? WRITE_SYNC : WRITE, bio); -} - -STATIC struct bio * -xfs_alloc_ioend_bio( - struct buffer_head *bh) -{ - struct bio *bio = bio_alloc(GFP_NOIO, BIO_MAX_PAGES); - - ASSERT(bio->bi_private == NULL); - bio->bi_iter.bi_sector = bh->b_blocknr * (bh->b_size >> 9); - bio->bi_bdev = bh->b_bdev; - return bio; -} - STATIC void xfs_start_buffer_writeback( struct buffer_head *bh) @@ -515,10 +430,10 @@ static inline int xfs_bio_add_buffer(struct bio *bio, struct buffer_head *bh) STATIC int xfs_submit_ioend( struct writeback_control *wbc, - xfs_ioend_t *ioend, + struct xfs_ioend *ioend, int status) { - if (!ioend->io_bio || status) + if (status) goto error_finish; /* Reserve log space if we might write beyond the on-disk inode size. */ @@ -529,9 +444,10 @@ xfs_submit_ioend( goto error_finish; } - xfs_submit_ioend_bio(wbc, ioend, ioend->io_bio); - ioend->io_bio = NULL; - xfs_finish_ioend(ioend); + ioend->io_bio->bi_private = ioend; + ioend->io_bio->bi_end_io = xfs_end_bio; + submit_bio(wbc->sync_mode == WB_SYNC_ALL ? WRITE_SYNC : WRITE, + ioend->io_bio); return 0; /* @@ -541,10 +457,8 @@ xfs_submit_ioend( * at this point in time. */ error_finish: - if (ioend->io_bio) - bio_put(ioend->io_bio); - ioend->io_error = status; - xfs_finish_ioend(ioend); + ioend->io_bio->bi_error = status; + bio_endio(ioend->io_bio); return status; } @@ -565,22 +479,51 @@ xfs_add_to_ioend( struct list_head *iolist) { struct xfs_ioend *ioend = wpc->ioend; + struct bio *new; if (!ioend || wpc->io_type != ioend->io_type || bh->b_blocknr != wpc->last_block + 1) { + new = bio_alloc_bioset(GFP_NOFS, BIO_MAX_PAGES, + xfs_ioend_bioset); + new->bi_iter.bi_sector = bh->b_blocknr * (bh->b_size >> 9); + new->bi_bdev = bh->b_bdev; + if (ioend) list_add(&ioend->io_list, iolist); - ioend = wpc->ioend = xfs_alloc_ioend(inode, wpc->io_type); + + ioend = container_of(new, struct xfs_ioend, io_inline_bio); + INIT_LIST_HEAD(&ioend->io_list); + ioend->io_type = wpc->io_type; + ioend->io_inode = inode; + ioend->io_size = 0; ioend->io_offset = offset; + INIT_WORK(&ioend->io_work, xfs_end_io); + ioend->io_append_trans = NULL; + ioend->io_bio = new; + + wpc->ioend = ioend; } retry: - if (!ioend->io_bio) - ioend->io_bio = xfs_alloc_ioend_bio(bh); - if (xfs_bio_add_buffer(ioend->io_bio, bh) != bh->b_size) { - xfs_submit_ioend_bio(wbc, ioend, ioend->io_bio); - ioend->io_bio = NULL; + /* + * No space left in the bio. + * + * Allocate a new one, and chain the old bio to the new one. + * Note that we have to do perform the chaining in this + * unintuitive order so that the bi_private linkage is set up + * in the right direction for the traversal in + * xfs_destroy_ioend(). + */ + new = bio_alloc(GFP_NOFS, BIO_MAX_PAGES); + new->bi_iter.bi_sector = bh->b_blocknr * (bh->b_size >> 9); + new->bi_bdev = bh->b_bdev; + + bio_chain(ioend->io_bio, new); + bio_get(ioend->io_bio); /* for xfs_destroy_ioend */ + submit_bio(wbc->sync_mode == WB_SYNC_ALL ? WRITE_SYNC : WRITE, + ioend->io_bio); + ioend->io_bio = new; goto retry; } diff --git a/fs/xfs/xfs_aops.h b/fs/xfs/xfs_aops.h index 1c7b041..8b5b641 100644 --- a/fs/xfs/xfs_aops.h +++ b/fs/xfs/xfs_aops.h @@ -18,7 +18,7 @@ #ifndef __XFS_AOPS_H__ #define __XFS_AOPS_H__ -extern mempool_t *xfs_ioend_pool; +extern struct bio_set *xfs_ioend_bioset; /* * Types of I/O for bmap clustering and I/O completion tracking. @@ -37,24 +37,19 @@ enum { { XFS_IO_OVERWRITE, "overwrite" } /* - * xfs_ioend struct manages large extent writes for XFS. - * It can manage several multi-page bio's at once. + * Structure for buffered I/O completions. */ -typedef struct xfs_ioend { +struct xfs_ioend { struct list_head io_list; /* next ioend in chain */ unsigned int io_type; /* delalloc / unwritten */ - int io_error; /* I/O error code */ - atomic_t io_remaining; /* hold count */ struct inode *io_inode; /* file being written to */ size_t io_size; /* size of the extent */ xfs_off_t io_offset; /* offset in the file */ struct work_struct io_work; /* xfsdatad work queue */ struct xfs_trans *io_append_trans;/* xact. for size update */ struct bio *io_bio; /* bio being built */ - struct bio *io_bio_done; /* bios completed */ - struct bio *io_bio_done_tail; /* bios completed */ - spinlock_t io_lock; /* for bio completion list */ -} xfs_ioend_t; + struct bio io_inline_bio; /* MUST BE LAST! */ +}; extern const struct address_space_operations xfs_address_space_operations; diff --git a/fs/xfs/xfs_super.c b/fs/xfs/xfs_super.c index 59c9b7b..33aa638 100644 --- a/fs/xfs/xfs_super.c +++ b/fs/xfs/xfs_super.c @@ -57,8 +57,7 @@ #include static const struct super_operations xfs_super_operations; -static kmem_zone_t *xfs_ioend_zone; -mempool_t *xfs_ioend_pool; +struct bio_set *xfs_ioend_bioset; static struct kset *xfs_kset; /* top-level xfs sysfs dir */ #ifdef DEBUG @@ -1646,20 +1645,15 @@ MODULE_ALIAS_FS("xfs"); STATIC int __init xfs_init_zones(void) { - - xfs_ioend_zone = kmem_zone_init(sizeof(xfs_ioend_t), "xfs_ioend"); - if (!xfs_ioend_zone) + xfs_ioend_bioset = bioset_create(4 * MAX_BUF_PER_PAGE, + offsetof(struct xfs_ioend, io_inline_bio)); + if (!xfs_ioend_bioset) goto out; - xfs_ioend_pool = mempool_create_slab_pool(4 * MAX_BUF_PER_PAGE, - xfs_ioend_zone); - if (!xfs_ioend_pool) - goto out_destroy_ioend_zone; - xfs_log_ticket_zone = kmem_zone_init(sizeof(xlog_ticket_t), "xfs_log_ticket"); if (!xfs_log_ticket_zone) - goto out_destroy_ioend_pool; + goto out_free_ioend_bioset; xfs_bmap_free_item_zone = kmem_zone_init(sizeof(xfs_bmap_free_item_t), "xfs_bmap_free_item"); @@ -1755,10 +1749,8 @@ xfs_init_zones(void) kmem_zone_destroy(xfs_bmap_free_item_zone); out_destroy_log_ticket_zone: kmem_zone_destroy(xfs_log_ticket_zone); - out_destroy_ioend_pool: - mempool_destroy(xfs_ioend_pool); - out_destroy_ioend_zone: - kmem_zone_destroy(xfs_ioend_zone); + out_free_ioend_bioset: + bioset_free(xfs_ioend_bioset); out: return -ENOMEM; } @@ -1784,9 +1776,7 @@ xfs_destroy_zones(void) kmem_zone_destroy(xfs_btree_cur_zone); kmem_zone_destroy(xfs_bmap_free_item_zone); kmem_zone_destroy(xfs_log_ticket_zone); - mempool_destroy(xfs_ioend_pool); - kmem_zone_destroy(xfs_ioend_zone); - + bioset_free(xfs_ioend_bioset); } STATIC int __init -- 2.1.4 From BATV+8f6cf6af93f4300ac991+4567+infradead.org+hch@casper.srs.infradead.org Wed Feb 24 02:20:39 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=ham version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay1.corp.sgi.com [137.38.102.111]) by oss.sgi.com (Postfix) with ESMTP id 1DF337CA2 for ; Wed, 24 Feb 2016 02:20:39 -0600 (CST) Received: from cuda.sgi.com (cuda3.sgi.com [192.48.176.15]) by relay1.corp.sgi.com (Postfix) with ESMTP id D67F48F8033 for ; Wed, 24 Feb 2016 00:20:32 -0800 (PST) X-ASG-Debug-ID: 1456302017-04cb6c700731c30001-NocioJ Received: from casper.infradead.org (casper.infradead.org [85.118.1.10]) by cuda.sgi.com with ESMTP id UW0EnGzCScIwORxR (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128 verify=NO) for ; Wed, 24 Feb 2016 00:20:18 -0800 (PST) X-Barracuda-Envelope-From: BATV+8f6cf6af93f4300ac991+4567+infradead.org+hch@casper.srs.infradead.org X-Barracuda-Apparent-Source-IP: 85.118.1.10 Received: from [88.128.80.14] (helo=localhost) by casper.infradead.org with esmtpsa (Exim 4.85 #2 (Red Hat Linux)) id 1aYUgC-0004RZ-Qm for xfs@oss.sgi.com; Wed, 24 Feb 2016 08:20:17 +0000 From: Christoph Hellwig To: xfs@oss.sgi.com Subject: futher writeback updates Date: Wed, 24 Feb 2016 09:20:08 +0100 X-ASG-Orig-Subj: futher writeback updates Message-Id: <1456302011-18915-1-git-send-email-hch@lst.de> X-Mailer: git-send-email 2.1.4 X-SRS-Rewrite: SMTP reverse-path rewritten from by casper.infradead.org. See http://www.infradead.org/rpr.html X-Barracuda-Connect: casper.infradead.org[85.118.1.10] X-Barracuda-Start-Time: 1456302018 X-Barracuda-Encrypted: ECDHE-RSA-AES128-GCM-SHA256 X-Barracuda-URL: https://192.48.176.15:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-BRTS-Status: 1 X-Barracuda-Spam-Score: 0.00 X-Barracuda-Spam-Status: No, SCORE=0.00 using per-user scores of TAG_LEVEL=1000.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.7 tests= X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.3.27295 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- This series contains two patches from Dave (with a rebase and minor updates from me) which he posted as RFC earlier to reduce the buffer_head dependency in the writeback path, and one patch from me to make use of bios embedded into the ioend and bio chaining to further simplify and optimize the writeback path. They pass xfstests on 4k and 1k file systems. From BATV+8f6cf6af93f4300ac991+4567+infradead.org+hch@casper.srs.infradead.org Wed Feb 24 02:20:40 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=ham version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay3.corp.sgi.com [198.149.34.15]) by oss.sgi.com (Postfix) with ESMTP id 331EE7CA2 for ; Wed, 24 Feb 2016 02:20:40 -0600 (CST) Received: from cuda.sgi.com (cuda3.sgi.com [192.48.176.15]) by relay3.corp.sgi.com (Postfix) with ESMTP id 912C4AC001 for ; Wed, 24 Feb 2016 00:20:27 -0800 (PST) X-ASG-Debug-ID: 1456302018-04cb6c455cb9f10001-NocioJ Received: from casper.infradead.org (casper.infradead.org [85.118.1.10]) by cuda.sgi.com with ESMTP id WitSbpxV7U2BVPK0 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128 verify=NO) for ; Wed, 24 Feb 2016 00:20:19 -0800 (PST) X-Barracuda-Envelope-From: BATV+8f6cf6af93f4300ac991+4567+infradead.org+hch@casper.srs.infradead.org X-Barracuda-Apparent-Source-IP: 85.118.1.10 Received: from [88.128.80.14] (helo=localhost) by casper.infradead.org with esmtpsa (Exim 4.85 #2 (Red Hat Linux)) id 1aYUgE-0004Rc-Ds; Wed, 24 Feb 2016 08:20:18 +0000 From: Christoph Hellwig To: xfs@oss.sgi.com Cc: Dave Chinner Subject: [PATCH 1/3] xfs: build bios directly in xfs_add_to_ioend Date: Wed, 24 Feb 2016 09:20:09 +0100 X-ASG-Orig-Subj: [PATCH 1/3] xfs: build bios directly in xfs_add_to_ioend Message-Id: <1456302011-18915-2-git-send-email-hch@lst.de> X-Mailer: git-send-email 2.1.4 In-Reply-To: <1456302011-18915-1-git-send-email-hch@lst.de> References: <1456302011-18915-1-git-send-email-hch@lst.de> X-SRS-Rewrite: SMTP reverse-path rewritten from by casper.infradead.org. See http://www.infradead.org/rpr.html X-Barracuda-Connect: casper.infradead.org[85.118.1.10] X-Barracuda-Start-Time: 1456302019 X-Barracuda-Encrypted: ECDHE-RSA-AES128-GCM-SHA256 X-Barracuda-URL: https://192.48.176.15:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-BRTS-Status: 1 X-Barracuda-Spam-Score: 0.00 X-Barracuda-Spam-Status: No, SCORE=0.00 using per-user scores of TAG_LEVEL=1000.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.7 tests= X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.3.27295 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- From: Dave Chinner Currently adding a buffer to the ioend and then building a bio from the buffer list are two separate operations. We don't build the bios and submit them until the ioend is submitted, and this places a fixed dependency on bufferhead chaining in the ioend. The first step to removing the bufferhead chaining in the ioend is on the IO submission side. We can build the bio directly as we add the buffers to the ioend chain, thereby removing the need for a latter "buffer-to-bio" submission loop. This allows us to submit bios on large ioends as soon as we cannot add more data to the bio. These bios then get captured by the active plug, and hence will be dispatched as soon as either the plug overflows or we schedule away from the writeback context. This will reduce submission latency for large IOs, but will also allow more timely request queue based writeback blocking when the device becomes congested. Signed-off-by: Dave Chinner --- fs/xfs/xfs_aops.c | 117 ++++++++++++++++++++++++++---------------------------- fs/xfs/xfs_aops.h | 1 + 2 files changed, 57 insertions(+), 61 deletions(-) diff --git a/fs/xfs/xfs_aops.c b/fs/xfs/xfs_aops.c index 7a467b3..90e6e3a 100644 --- a/fs/xfs/xfs_aops.c +++ b/fs/xfs/xfs_aops.c @@ -274,6 +274,7 @@ xfs_alloc_ioend( xfs_ioend_t *ioend; ioend = mempool_alloc(xfs_ioend_pool, GFP_NOFS); + memset(ioend, 0, sizeof(*ioend)); /* * Set the count to 1 initially, which will prevent an I/O @@ -281,16 +282,9 @@ xfs_alloc_ioend( * all the I/O from calling the completion routine too early. */ atomic_set(&ioend->io_remaining, 1); - ioend->io_error = 0; INIT_LIST_HEAD(&ioend->io_list); ioend->io_type = type; ioend->io_inode = inode; - ioend->io_buffer_head = NULL; - ioend->io_buffer_tail = NULL; - ioend->io_offset = 0; - ioend->io_size = 0; - ioend->io_append_trans = NULL; - INIT_WORK(&ioend->io_work, xfs_end_io); return ioend; } @@ -452,13 +446,18 @@ static inline int xfs_bio_add_buffer(struct bio *bio, struct buffer_head *bh) } /* - * Submit all of the bios for an ioend. We are only passed a single ioend at a - * time; the caller is responsible for chaining prior to submission. + * Submit the bio for an ioend. We are passed an ioend with a bio attached to + * it, and we submit that bio. The ioend may be used for multiple bio + * submissions, so we only want to allocate an append transaction for the ioend + * once. In the case of multiple bio submission, each bio will take an IO + * reference to the ioend to ensure that the ioend completion is only done once + * all bios have been submitted and the ioend is really done. * * If @fail is non-zero, it means that we have a situation where some part of * the submission process has failed after we have marked paged for writeback - * and unlocked them. In this situation, we need to fail the ioend chain rather - * than submit it to IO. This typically only happens on a filesystem shutdown. + * and unlocked them. In this situation, we need to fail the bio and ioend + * rather than submit it to IO. This typically only happens on a filesystem + * shutdown. */ STATIC int xfs_submit_ioend( @@ -466,48 +465,34 @@ xfs_submit_ioend( xfs_ioend_t *ioend, int status) { - struct buffer_head *bh; - struct bio *bio; - sector_t lastblock = 0; + if (!ioend->io_bio || status) + goto error_finish; /* Reserve log space if we might write beyond the on-disk inode size. */ - if (!status && - ioend->io_type != XFS_IO_UNWRITTEN && xfs_ioend_is_append(ioend)) + if (ioend->io_type != XFS_IO_UNWRITTEN && xfs_ioend_is_append(ioend) && + !ioend->io_append_trans) { status = xfs_setfilesize_trans_alloc(ioend); - /* - * If we are failing the IO now, just mark the ioend with an - * error and finish it. This will run IO completion immediately - * as there is only one reference to the ioend at this point in - * time. - */ - if (status) { - ioend->io_error = status; - xfs_finish_ioend(ioend); - return status; + if (status) + goto error_finish; } - bio = NULL; - for (bh = ioend->io_buffer_head; bh; bh = bh->b_private) { - - if (!bio) { -retry: - bio = xfs_alloc_ioend_bio(bh); - } else if (bh->b_blocknr != lastblock + 1) { - xfs_submit_ioend_bio(wbc, ioend, bio); - goto retry; - } - - if (xfs_bio_add_buffer(bio, bh) != bh->b_size) { - xfs_submit_ioend_bio(wbc, ioend, bio); - goto retry; - } - - lastblock = bh->b_blocknr; - } - if (bio) - xfs_submit_ioend_bio(wbc, ioend, bio); + xfs_submit_ioend_bio(wbc, ioend, ioend->io_bio); + ioend->io_bio = NULL; xfs_finish_ioend(ioend); return 0; + + /* + * If we are failing the IO now, just mark the ioend with an error and + * finish it, releasing the active bio if there is one. This will run + * IO completion immediately as there is only one reference to the ioend + * at this point in time. + */ +error_finish: + if (ioend->io_bio) + bio_put(ioend->io_bio); + ioend->io_error = status; + xfs_finish_ioend(ioend); + return status; } /* @@ -523,27 +508,37 @@ xfs_add_to_ioend( struct buffer_head *bh, xfs_off_t offset, struct xfs_writepage_ctx *wpc, + struct writeback_control *wbc, struct list_head *iolist) { - if (!wpc->ioend || wpc->io_type != wpc->ioend->io_type || - bh->b_blocknr != wpc->last_block + 1) { - struct xfs_ioend *new; + struct xfs_ioend *ioend = wpc->ioend; - if (wpc->ioend) - list_add(&wpc->ioend->io_list, iolist); + if (!ioend || wpc->io_type != ioend->io_type || + bh->b_blocknr != wpc->last_block + 1) { + if (ioend) + list_add(&ioend->io_list, iolist); - new = xfs_alloc_ioend(inode, wpc->io_type); - new->io_offset = offset; - new->io_buffer_head = bh; - new->io_buffer_tail = bh; - wpc->ioend = new; + ioend = wpc->ioend = xfs_alloc_ioend(inode, wpc->io_type); + ioend->io_offset = offset; + ioend->io_buffer_head = bh; + ioend->io_buffer_tail = bh; } else { - wpc->ioend->io_buffer_tail->b_private = bh; - wpc->ioend->io_buffer_tail = bh; + ioend->io_buffer_tail->b_private = bh; + ioend->io_buffer_tail = bh; } - bh->b_private = NULL; - wpc->ioend->io_size += bh->b_size; + +retry: + if (!ioend->io_bio) + ioend->io_bio = xfs_alloc_ioend_bio(bh); + + if (xfs_bio_add_buffer(ioend->io_bio, bh) != bh->b_size) { + xfs_submit_ioend_bio(wbc, ioend, ioend->io_bio); + ioend->io_bio = NULL; + goto retry; + } + + ioend->io_size += bh->b_size; wpc->last_block = bh->b_blocknr; xfs_start_buffer_writeback(bh); } @@ -802,7 +797,7 @@ xfs_writepage_map( lock_buffer(bh); if (wpc->io_type != XFS_IO_OVERWRITE) xfs_map_at_offset(inode, bh, &wpc->imap, offset); - xfs_add_to_ioend(inode, bh, offset, wpc, &submit_list); + xfs_add_to_ioend(inode, bh, offset, wpc, wbc, &submit_list); count++; } diff --git a/fs/xfs/xfs_aops.h b/fs/xfs/xfs_aops.h index 4e01bd5..c89c3bd 100644 --- a/fs/xfs/xfs_aops.h +++ b/fs/xfs/xfs_aops.h @@ -52,6 +52,7 @@ typedef struct xfs_ioend { xfs_off_t io_offset; /* offset in the file */ struct work_struct io_work; /* xfsdatad work queue */ struct xfs_trans *io_append_trans;/* xact. for size update */ + struct bio *io_bio; /* bio being built */ } xfs_ioend_t; extern const struct address_space_operations xfs_address_space_operations; -- 2.1.4 From roger@filmlight.ltd.uk Wed Feb 24 07:27:37 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=ham version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay2.corp.sgi.com [137.38.102.29]) by oss.sgi.com (Postfix) with ESMTP id 167C07F58 for ; Wed, 24 Feb 2016 07:27:37 -0600 (CST) Received: from cuda.sgi.com (cuda3.sgi.com [192.48.176.15]) by relay2.corp.sgi.com (Postfix) with ESMTP id CBEE030404E for ; Wed, 24 Feb 2016 05:27:30 -0800 (PST) X-ASG-Debug-ID: 1456319433-04cb6c700739fa0001-NocioJ Received: from c.mx.filmlight.ltd.uk (c.mx.filmlight.ltd.uk [54.76.112.217]) by cuda.sgi.com with ESMTP id kBWWsyC7w5NBDHbD for ; Wed, 24 Feb 2016 05:10:33 -0800 (PST) X-Barracuda-Envelope-From: roger@filmlight.ltd.uk X-Barracuda-Apparent-Source-IP: 54.76.112.217 Received: from [192.168.0.247] (cpc2-stev6-2-0-cust318.9-2.cable.virginm.net [213.107.89.63]) (Authenticated sender: roger) by omni.filmlight.ltd.uk (Postfix) with ESMTPSA id 394BB869EA9; Wed, 24 Feb 2016 13:10:32 +0000 (GMT) Content-Type: text/plain; charset=windows-1252 Mime-Version: 1.0 (Mac OS X Mail 7.3 \(1878.6\)) Subject: Re: Accidental FS corruption: Mapping files to blocks From: Roger Willcocks X-ASG-Orig-Subj: Re: Accidental FS corruption: Mapping files to blocks In-Reply-To: Date: Wed, 24 Feb 2016 13:10:30 +0000 Cc: Roger Willcocks , xfs@oss.sgi.com Content-Transfer-Encoding: quoted-printable Message-Id: References: To: Paul Cannon X-Mailer: Apple Mail (2.1878.6) X-Barracuda-Connect: c.mx.filmlight.ltd.uk[54.76.112.217] X-Barracuda-Start-Time: 1456319433 X-Barracuda-URL: https://192.48.176.15:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-BRTS-Status: 1 X-Barracuda-Spam-Score: 0.00 X-Barracuda-Spam-Status: No, SCORE=0.00 using per-user scores of TAG_LEVEL=1000.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.7 tests=BSF_SC0_MISMATCH_TO X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.3.27300 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 0.00 BSF_SC0_MISMATCH_TO Envelope rcpt doesn't match header On 24 Feb 2016, at 03:37, Paul Cannon wrote: > I have accidentally damaged my XFS, and need help (and a little = prayer). The way it happened will provide your daily amusement dose (and = hopefully a lesson). > ... > * Luckily I have old copy of the original data! > So I did a rsync -rvn /olddata/ /xfsB > Nothing! No difference in any data files. I even tried mirrordir, same = thing -- nothing, no difference! >=20 > * Here is what I think is going on, and I need help. > I suspect that the access time of the file/files stored at this = location are perhaps in another location in inode (does this sound = correct? I am a newbie to XFS). But the data itself has changed at the = location. >=20 That seems likely. Try rsync =97ignore-times =97 Roger From jean-tiare.le-bigot@corp.ovh.com Wed Feb 24 11:27:23 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=ham version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay2.corp.sgi.com [137.38.102.29]) by oss.sgi.com (Postfix) with ESMTP id CD0857CA4 for ; Wed, 24 Feb 2016 11:27:23 -0600 (CST) Received: from cuda.sgi.com (cuda2.sgi.com [192.48.176.25]) by relay2.corp.sgi.com (Postfix) with ESMTP id 9B7CF304043 for ; Wed, 24 Feb 2016 09:27:17 -0800 (PST) X-ASG-Debug-ID: 1456334827-04cbb06ae0f5d70001-NocioJ Received: from 10.mo175.mail-out.ovh.net (10.mo175.mail-out.ovh.net [46.105.63.108]) by cuda.sgi.com with ESMTP id phmF8bDrDXyIWW7p (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO) for ; Wed, 24 Feb 2016 09:27:08 -0800 (PST) X-Barracuda-Envelope-From: jean-tiare.le-bigot@corp.ovh.com X-Barracuda-Apparent-Source-IP: 46.105.63.108 Received: from ex2.OVH.local (corp.ovh.com [5.196.251.137]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits)) (No client certificate requested) by mo175.mail-out.ovh.net (Postfix) with ESMTPS id CA770FF8098; Wed, 24 Feb 2016 18:27:06 +0100 (CET) Received: from [10.42.109.126] (109.190.254.34) by ex2.OVH.local (172.16.7.2) with Microsoft SMTP Server (TLS) id 15.1.225.42; Wed, 24 Feb 2016 18:27:06 +0100 Message-ID: <56CDE801.2030402@corp.ovh.com> Date: Wed, 24 Feb 2016 18:27:29 +0100 From: Jean-Tiare Le Bigot User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20131118 Thunderbird/17.0.11 MIME-Version: 1.0 To: Dave Chinner CC: Subject: Re: backport 7a29ac474a47eb8cf212b45917683ae89d6fa13b to stable ? References: <56CC852F.7010507@corp.ovh.com> <20160223224555.GM25832@dastard> X-ASG-Orig-Subj: Re: backport 7a29ac474a47eb8cf212b45917683ae89d6fa13b to stable ? In-Reply-To: <20160223224555.GM25832@dastard> X-Enigmail-Version: 1.6 Content-Type: text/plain; charset="ISO-8859-1" Content-Transfer-Encoding: 7bit X-Originating-IP: [109.190.254.34] X-ClientProxiedBy: cas01.OVH.local (172.16.1.1) To ex2.OVH.local (172.16.7.2) X-Ovh-Tracer-Id: 16711169368696348009 X-VR-SPAMSTATE: OK X-VR-SPAMSCORE: 0 X-VR-SPAMCAUSE: gggruggvucftvghtrhhoucdtuddrfeekjedrheekgdeljecutefuodetggdotffvucfrrhhofhhilhgvmecuqfggjfenuceurghilhhouhhtmecufedttdenuc X-Barracuda-Connect: 10.mo175.mail-out.ovh.net[46.105.63.108] X-Barracuda-Start-Time: 1456334828 X-Barracuda-Encrypted: ECDHE-RSA-AES256-GCM-SHA384 X-Barracuda-URL: https://192.48.176.25:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-BRTS-Status: 1 X-Barracuda-Spam-Score: 0.00 X-Barracuda-Spam-Status: No, SCORE=0.00 using per-user scores of TAG_LEVEL=1000.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.7 tests=BSF_SC0_MISMATCH_TO X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.3.27304 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 0.00 BSF_SC0_MISMATCH_TO Envelope rcpt doesn't match header Hi, Thanks for having a look. On 02/23/2016 11:45 PM, Dave Chinner wrote: > On Tue, Feb 23, 2016 at 05:13:35PM +0100, Jean-Tiare Le Bigot wrote: >> Hi, >> >> We've hit kernel hang related to XFS reclaim under heavy I/O load on a >> couple of storage servers using XFS over flashcache over a 3.13.y kernel. >> >> On the crash dumps, kthreadd is blocked, waiting for XFS to reclaim some >> memory but the related reclaim job is queued on a worker_pool stuck >> waiting for some I/O, itself depending on other jobs on other queues >> which would require additional threads to go forward. Unfortunately >> kthreadd is blocked. >> The host has plenty of memory (~128GB), about 80% of which being used >> for the page cache. >> >> It looks like this is fixed by commit >> 7a29ac474a47eb8cf212b45917683ae89d6fa13b. > > That commit fixed a regression introduced, IIRC, in 3.19. The > problem it fixed didn't exist before then, so I doubt you are seeing > the problem that the above commit fixed. Perhaps you'd like to > describe your problem along with the stack traces, etc so we have > some idea of what you are trying to to fix? On the dump we investigated, kthreadd is stuck, waiting for some memory crash> bt 2 PID: 2 TASK: ffff881fd2a39800 CPU: 0 COMMAND: "kthreadd" #0 [ffff881fd2ab37c8] __schedule at ffffffff81724e19 #1 [ffff881fd2ab3830] io_schedule at ffffffff817255fd #2 [ffff881fd2ab3848] __xfs_iunpin_wait at ffffffffa06cf269 [xfs] #3 [ffff881fd2ab38c0] xfs_iunpin_wait at ffffffffa06d2629 [xfs] #4 [ffff881fd2ab38d0] xfs_reclaim_inode at ffffffffa068ed4c [xfs] #5 [ffff881fd2ab3910] xfs_reclaim_inodes_ag at ffffffffa068f267 [xfs] #6 [ffff881fd2ab3aa0] xfs_reclaim_inodes_nr at ffffffffa068fd73 [xfs] #7 [ffff881fd2ab3ac0] xfs_fs_free_cached_objects at ffffffffa069a3a5 [xfs] #8 [ffff881fd2ab3ad0] super_cache_scan at ffffffff811c13e9 #9 [ffff881fd2ab3b18] shrink_slab at ffffffff81160f27 #10 [ffff881fd2ab3bc0] do_try_to_free_pages at ffffffff8116405d #11 [ffff881fd2ab3c38] try_to_free_pages at ffffffff8116429c #12 [ffff881fd2ab3cd8] __alloc_pages_nodemask at ffffffff81158f15 #13 [ffff881fd2ab3e10] copy_process at ffffffff810652b3 #14 [ffff881fd2ab3e90] do_fork at ffffffff810669f5 #15 [ffff881fd2ab3ef8] kernel_thread at ffffffff81066c86 #16 [ffff881fd2ab3f08] kthreadd at ffffffff8108beea #17 [ffff881fd2ab3f50] ret_from_fork at ffffffff817318bc This triggered the insertion of a xfs-reclaim job for device dm-46 on the workerpool bound to cpu #0 This xfs_reclaim job is the first *pending* job on the workerpool. The workerpool has 2 active workers stuck in "xfs_log_worker" both blocked in "xlog_state_get_iclog_space". My guess is they are waiting for some underlying flashcache I/O (which won't happen, see below) --> busy_hash aka busy workers: crash> struct worker_pool.busy_hash 0xffff88207fc12d40 | grep -o 0xf.* 0xffff8806dd3b5780 --> 132626 --> in xfs_log_worker --> in xlog_state_get_iclog_space --> dm-40 0xffff88142d06ae80 --> 129142 --> in xfs_log_worker --> in xlog_state_get_iclog_space --> dm-63 --> pending jobs: crash> list -o work_struct.entry -s work_struct.func -H ffff88207fc12d58 -x | awk 'BEGIN{w="";c=0} {if($1=="func") printf("%2d %s --> %s\n", c, w, $4); else {w=$1;c++}}' WORK FUNC DEVICE 1 ffff881fceda6ca8 --> dm-46 2 ffff881fcd51bc28 --> dm-46 3 ffff88207fc0f3a0 --> N/A ... To progress this queue needs either: - the I/O to complete - a new thread to handle the xfs_reclaim (which does not trigger I/O in this context, If I got the code right) The I/O is stuck so we need a new thread. The pool manager requested this thread BUT the request is pending in kthreadd queue. It is #5 in the line crash> list -o kthread_create_info.list -s kthread_create_info -H kthread_create_list | grep threadfn | sort | uniq -c Hence 'data' field represents a struct worker WORKER POOL ID 1 0xffff881851c50780 0xffff881fff011c00 4 unbound pool 24 2 0xffff881a08c5b680 0xffff881fd1cb4c00 0 unbound pool 25 3 0xffff881295297700 0xffff88207fd72d40 0 cpu 11 pool 22 4 0xffff88131ed9c580 0xffff88207fc72d40 1 cpu 3 pool 6 5 0xffff88062e8e9b80 0xffff88207fc12d40 0 cpu 0 pool 0 6 0xffff8819440d1500 0xffff88207fc92d40 2 cpu 4 pool 8 7 0xffff8802288aa280 0xffff88207fc52d40 0 cpu 2 pool 4 8 0xffff88120d711200 0xffff88207fcb2d40 0 cpu 5 pool 10 9 0xffff881cf648fb00 0xffff88207fc32d40 0 cpu 1 pool 2 10 0xffff8819c1471a00 0xffff88207fd32d40 2 cpu 9 pool 18 Hence, the "mayday" mode should trigger and move the xfs_reclaim job to the rescuer worker. On the other hand, we also hit a similar issue on the underlying flashcache. If it had not happened, I bet the system would not have locked. Anyway, as I understood the code, flashcache queues a single job on the default bound system queue. When this job is executed, it processes its own internal queues sequentially. So basically, if this single job is stuck, all I/Os of flashcache devices are stuck (!). This is on queue #6 --> busy_hash aka busy workers: 0xffff881330823080 --> 139598 --> in xfs_end_io --> in rwsem_down_write_failed 0xffff881330823c80 --> 139599 --> in xfs_end_io --> in ??? 0xffff880e1a890e80 --> 127402 --> in xfs_end_io --> rwsem_down_write_failed --> pending jobs: crash> list -o work_struct.entry -s work_struct.func -H ffff88207fcd2d58 -x | awk 'BEGIN{w="";c=0} {if($1=="func") printf(" %2d %s --> %s\n", c, w, $4); else {w=$1;c++}}' WORK FUNC NOTES 1 ffffffffa062e780 --> FLASHCACHE JOB 2 ffff881f582dd350 --> 3 ffff88207fccf3a0 --> 4 ffff881ed1d05350 --> 5 ffff881fff010d10 --> 6 ffff881d9998bca8 --> dm-4 7 ffffffff81ca8880 --> 8 ffff881fcc425ca8 --> dm-45 9 ffff88207fccf180 --> Flashcache job is #1 (yes, the explicit 'do_work' name). All workers are waiting for I/O. The pool is waiting for a thread. Which is waiting for memory. Which ... OK, we're stuck. Some assumptions may be wrong, I have seemingly truncated stack traces looking like, this does not help much :s crash> bt 139599 PID: 139599 TASK: ffff8816c7970000 CPU: 6 COMMAND: "kworker/6:1" #0 [ffff88011c407700] __schedule at ffffffff81724e19 #1 [ffff88011c407768] schedule at ffffffff817252d9 #2 [ffff88011c407778] schedule_timeout at ffffffff81724529 Long story short, My understanding is that the hang is the result of a design issue in flashcache, which could be helped in such not-so-low-mem situation (80% is page cache) if the reclaim job had a rescuer thread. Actually, the quick prod fix was a clever brute force hack in flashcache. Regards, > > Cheers, > > Dave. > -- Jean-Tiare Le Bigot, OVH From mchristi@redhat.com Wed Feb 24 13:48:41 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=ham version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay2.corp.sgi.com [137.38.102.29]) by oss.sgi.com (Postfix) with ESMTP id 9D0BC7CB9 for ; Wed, 24 Feb 2016 13:48:41 -0600 (CST) Received: from cuda.sgi.com (cuda3.sgi.com [192.48.176.15]) by relay2.corp.sgi.com (Postfix) with ESMTP id 5E54E304067 for ; Wed, 24 Feb 2016 11:48:32 -0800 (PST) X-ASG-Debug-ID: 1456343306-04cb6c455ad58d0001-NocioJ Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by cuda.sgi.com with ESMTP id qgJOemxQvjAsMGe7 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO) for ; Wed, 24 Feb 2016 11:48:27 -0800 (PST) X-Barracuda-Envelope-From: mchristi@redhat.com X-Barracuda-Apparent-Source-IP: 209.132.183.28 X-ASG-Whitelist: Client Received: from int-mx09.intmail.prod.int.phx2.redhat.com (int-mx09.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by mx1.redhat.com (Postfix) with ESMTPS id 606388E3D4; Wed, 24 Feb 2016 19:48:26 +0000 (UTC) Received: from rh2.redhat.com (vpn-54-14.rdu2.redhat.com [10.10.54.14]) by int-mx09.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id u1OJmJE6006684; Wed, 24 Feb 2016 14:48:23 -0500 From: mchristi@redhat.com To: linux-f2fs-devel@lists.sourceforge.net, linux-ext4@vger.kernel.org, konrad.wilk@oracle.com, drbd-dev@lists.linbit.com, philipp.reisner@linbit.com, lars.ellenberg@linbit.com, linux-raid@vger.kernel.org, dm-devel@redhat.com, linux-fsdevel@vger.kernel.org, linux-bcache@vger.kernel.org, linux-block@vger.kernel.org, linux-kernel@vger.kernel.org, linux-scsi@vger.kernel.org, linux-mtd@lists.infradead.org, target-devel@vger.kernel.org, linux-btrfs@vger.kernel.org, osd-dev@open-osd.org, xfs@oss.sgi.com, ocfs2-devel@oss.oracle.com Cc: Mike Christie Subject: [PATCH 01/35] block/fs/drivers: remove rw argument from submit_bio Date: Wed, 24 Feb 2016 13:47:38 -0600 X-ASG-Orig-Subj: [PATCH 01/35] block/fs/drivers: remove rw argument from submit_bio Message-Id: <1456343292-14535-2-git-send-email-mchristi@redhat.com> In-Reply-To: <1456343292-14535-1-git-send-email-mchristi@redhat.com> References: <1456343292-14535-1-git-send-email-mchristi@redhat.com> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.22 X-Barracuda-Connect: mx1.redhat.com[209.132.183.28] X-Barracuda-Start-Time: 1456343306 X-Barracuda-Encrypted: ECDHE-RSA-AES256-GCM-SHA384 X-Barracuda-URL: https://192.48.176.15:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-BRTS-Status: 1 From: Mike Christie This has callers of submit_bio/submit_bio_wait set the bio->bi_rw instead of passing it in. This makes that use the same as generic_make_request and how we set the other bio fields. v2. 1. Set bi_rw instead of ORing it. For cloned bios, I still OR it to keep the old behavior incase there bits we wanted to keep. Signed-off-by: Mike Christie Reviewed-by: Bart Van Assche Reviewed-by: Christoph Hellwig --- block/bio.c | 7 +++---- block/blk-core.c | 11 ++++------- block/blk-flush.c | 3 ++- block/blk-lib.c | 9 ++++++--- drivers/block/drbd/drbd_actlog.c | 2 +- drivers/block/drbd/drbd_bitmap.c | 4 ++-- drivers/block/floppy.c | 3 ++- drivers/block/xen-blkback/blkback.c | 4 +++- drivers/block/xen-blkfront.c | 4 ++-- drivers/md/bcache/debug.c | 6 ++++-- drivers/md/bcache/journal.c | 2 +- drivers/md/bcache/super.c | 4 ++-- drivers/md/dm-bufio.c | 3 ++- drivers/md/dm-io.c | 3 ++- drivers/md/dm-log-writes.c | 9 ++++++--- drivers/md/dm-thin.c | 3 ++- drivers/md/md.c | 10 +++++++--- drivers/md/raid1.c | 3 ++- drivers/md/raid10.c | 4 +++- drivers/md/raid5-cache.c | 7 ++++--- drivers/target/target_core_iblock.c | 24 +++++++++++++----------- fs/btrfs/check-integrity.c | 18 ++++++++++-------- fs/btrfs/check-integrity.h | 4 ++-- fs/btrfs/disk-io.c | 3 ++- fs/btrfs/extent_io.c | 7 ++++--- fs/btrfs/raid56.c | 17 ++++++++++++----- fs/btrfs/scrub.c | 16 +++++++++++----- fs/btrfs/volumes.c | 14 +++++++------- fs/buffer.c | 3 ++- fs/direct-io.c | 3 ++- fs/ext4/crypto.c | 3 ++- fs/ext4/page-io.c | 3 ++- fs/ext4/readpage.c | 9 +++++---- fs/f2fs/data.c | 13 ++++++++----- fs/f2fs/segment.c | 6 ++++-- fs/gfs2/lops.c | 3 ++- fs/gfs2/meta_io.c | 3 ++- fs/gfs2/ops_fstype.c | 3 ++- fs/hfsplus/wrapper.c | 3 ++- fs/jfs/jfs_logmgr.c | 6 ++++-- fs/jfs/jfs_metapage.c | 10 ++++++---- fs/logfs/dev_bdev.c | 15 ++++++++++----- fs/mpage.c | 3 ++- fs/nfs/blocklayout/blocklayout.c | 22 ++++++++++++---------- fs/nilfs2/segbuf.c | 3 ++- fs/ocfs2/cluster/heartbeat.c | 12 +++++++----- fs/xfs/xfs_aops.c | 3 ++- fs/xfs/xfs_buf.c | 4 ++-- include/linux/bio.h | 2 +- include/linux/fs.h | 2 +- kernel/power/swap.c | 5 +++-- mm/page_io.c | 10 ++++++---- 52 files changed, 212 insertions(+), 141 deletions(-) diff --git a/block/bio.c b/block/bio.c index cf75915..7e4d050 100644 --- a/block/bio.c +++ b/block/bio.c @@ -859,21 +859,20 @@ static void submit_bio_wait_endio(struct bio *bio) /** * submit_bio_wait - submit a bio, and wait until it completes - * @rw: whether to %READ or %WRITE, or maybe to %READA (read ahead) * @bio: The &struct bio which describes the I/O * * Simple wrapper around submit_bio(). Returns 0 on success, or the error from * bio_endio() on failure. */ -int submit_bio_wait(int rw, struct bio *bio) +int submit_bio_wait(struct bio *bio) { struct submit_bio_ret ret; - rw |= REQ_SYNC; init_completion(&ret.event); bio->bi_private = &ret; bio->bi_end_io = submit_bio_wait_endio; - submit_bio(rw, bio); + bio->bi_rw |= REQ_SYNC; + submit_bio(bio); wait_for_completion_io(&ret.event); return ret.error; diff --git a/block/blk-core.c b/block/blk-core.c index 827f8ba..f23d1b0 100644 --- a/block/blk-core.c +++ b/block/blk-core.c @@ -2092,7 +2092,6 @@ EXPORT_SYMBOL(generic_make_request); /** * submit_bio - submit a bio to the block device layer for I/O - * @rw: whether to %READ or %WRITE, or maybe to %READA (read ahead) * @bio: The &struct bio which describes the I/O * * submit_bio() is very similar in purpose to generic_make_request(), and @@ -2100,10 +2099,8 @@ EXPORT_SYMBOL(generic_make_request); * interfaces; @bio must be presetup and ready for I/O. * */ -blk_qc_t submit_bio(int rw, struct bio *bio) +blk_qc_t submit_bio(struct bio *bio) { - bio->bi_rw |= rw; - /* * If it's a regular read/write or a barrier with data attached, * go through the normal accounting stuff before submission. @@ -2111,12 +2108,12 @@ blk_qc_t submit_bio(int rw, struct bio *bio) if (bio_has_data(bio)) { unsigned int count; - if (unlikely(rw & REQ_WRITE_SAME)) + if (unlikely(bio->bi_rw & REQ_WRITE_SAME)) count = bdev_logical_block_size(bio->bi_bdev) >> 9; else count = bio_sectors(bio); - if (rw & WRITE) { + if (bio->bi_rw & WRITE) { count_vm_events(PGPGOUT, count); } else { task_io_account_read(bio->bi_iter.bi_size); @@ -2127,7 +2124,7 @@ blk_qc_t submit_bio(int rw, struct bio *bio) char b[BDEVNAME_SIZE]; printk(KERN_DEBUG "%s(%d): %s block %Lu on %s (%u sectors)\n", current->comm, task_pid_nr(current), - (rw & WRITE) ? "WRITE" : "READ", + (bio->bi_rw & WRITE) ? "WRITE" : "READ", (unsigned long long)bio->bi_iter.bi_sector, bdevname(bio->bi_bdev, b), count); diff --git a/block/blk-flush.c b/block/blk-flush.c index 9c423e5..f2fbf9a 100644 --- a/block/blk-flush.c +++ b/block/blk-flush.c @@ -484,8 +484,9 @@ int blkdev_issue_flush(struct block_device *bdev, gfp_t gfp_mask, bio = bio_alloc(gfp_mask, 0); bio->bi_bdev = bdev; + bio->bi_rw = WRITE_FLUSH; - ret = submit_bio_wait(WRITE_FLUSH, bio); + ret = submit_bio_wait(bio); /* * The driver must store the error location in ->bi_sector, if diff --git a/block/blk-lib.c b/block/blk-lib.c index 9ebf653..87e3de4 100644 --- a/block/blk-lib.c +++ b/block/blk-lib.c @@ -102,13 +102,14 @@ int blkdev_issue_discard(struct block_device *bdev, sector_t sector, bio->bi_end_io = bio_batch_end_io; bio->bi_bdev = bdev; bio->bi_private = &bb; + bio->bi_rw = type; bio->bi_iter.bi_size = req_sects << 9; nr_sects -= req_sects; sector = end_sect; atomic_inc(&bb.done); - submit_bio(type, bio); + submit_bio(bio); /* * We can loop for a long time in here, if someone does @@ -177,6 +178,7 @@ int blkdev_issue_write_same(struct block_device *bdev, sector_t sector, bio->bi_io_vec->bv_page = page; bio->bi_io_vec->bv_offset = 0; bio->bi_io_vec->bv_len = bdev_logical_block_size(bdev); + bio->bi_rw = REQ_WRITE | REQ_WRITE_SAME; if (nr_sects > max_write_same_sectors) { bio->bi_iter.bi_size = max_write_same_sectors << 9; @@ -188,7 +190,7 @@ int blkdev_issue_write_same(struct block_device *bdev, sector_t sector, } atomic_inc(&bb.done); - submit_bio(REQ_WRITE | REQ_WRITE_SAME, bio); + submit_bio(bio); } /* Wait for bios in-flight */ @@ -238,6 +240,7 @@ static int __blkdev_issue_zeroout(struct block_device *bdev, sector_t sector, bio->bi_bdev = bdev; bio->bi_end_io = bio_batch_end_io; bio->bi_private = &bb; + bio->bi_rw = WRITE; while (nr_sects != 0) { sz = min((sector_t) PAGE_SIZE >> 9 , nr_sects); @@ -249,7 +252,7 @@ static int __blkdev_issue_zeroout(struct block_device *bdev, sector_t sector, } ret = 0; atomic_inc(&bb.done); - submit_bio(WRITE, bio); + submit_bio(bio); } /* Wait for bios in-flight */ diff --git a/drivers/block/drbd/drbd_actlog.c b/drivers/block/drbd/drbd_actlog.c index 10459a1..6069e15 100644 --- a/drivers/block/drbd/drbd_actlog.c +++ b/drivers/block/drbd/drbd_actlog.c @@ -177,7 +177,7 @@ static int _drbd_md_sync_page_io(struct drbd_device *device, if (drbd_insert_fault(device, (rw & WRITE) ? DRBD_FAULT_MD_WR : DRBD_FAULT_MD_RD)) bio_io_error(bio); else - submit_bio(rw, bio); + submit_bio(bio); wait_until_done_or_force_detached(device, bdev, &device->md_io.done); if (!bio->bi_error) err = device->md_io.error; diff --git a/drivers/block/drbd/drbd_bitmap.c b/drivers/block/drbd/drbd_bitmap.c index 92d6fc0..e8959fe 100644 --- a/drivers/block/drbd/drbd_bitmap.c +++ b/drivers/block/drbd/drbd_bitmap.c @@ -1011,12 +1011,12 @@ static void bm_page_io_async(struct drbd_bm_aio_ctx *ctx, int page_nr) __must_ho bio_add_page(bio, page, len, 0); bio->bi_private = ctx; bio->bi_end_io = drbd_bm_endio; + bio->bi_rw = rw; if (drbd_insert_fault(device, (rw & WRITE) ? DRBD_FAULT_MD_WR : DRBD_FAULT_MD_RD)) { - bio->bi_rw |= rw; bio_io_error(bio); } else { - submit_bio(rw, bio); + submit_bio(bio); /* this should not count as user activity and cause the * resync to throttle -- see drbd_rs_should_slow_down(). */ atomic_add(len >> 9, &device->rs_sect_ev); diff --git a/drivers/block/floppy.c b/drivers/block/floppy.c index 84708a5..73ded25 100644 --- a/drivers/block/floppy.c +++ b/drivers/block/floppy.c @@ -3822,8 +3822,9 @@ static int __floppy_read_block_0(struct block_device *bdev, int drive) bio.bi_flags |= (1 << BIO_QUIET); bio.bi_private = &cbdata; bio.bi_end_io = floppy_rb0_cb; + bio.bi_rw = READ; - submit_bio(READ, &bio); + submit_bio(&bio); process_fd_request(); init_completion(&cbdata.complete); diff --git a/drivers/block/xen-blkback/blkback.c b/drivers/block/xen-blkback/blkback.c index 4809c15..79fe493 100644 --- a/drivers/block/xen-blkback/blkback.c +++ b/drivers/block/xen-blkback/blkback.c @@ -1369,6 +1369,7 @@ static int dispatch_rw_block_io(struct xen_blkif_ring *ring, bio->bi_private = pending_req; bio->bi_end_io = end_block_io_op; bio->bi_iter.bi_sector = preq.sector_number; + bio->bi_rw = operation; } preq.sector_number += seg[i].nsec; @@ -1386,13 +1387,14 @@ static int dispatch_rw_block_io(struct xen_blkif_ring *ring, bio->bi_bdev = preq.bdev; bio->bi_private = pending_req; bio->bi_end_io = end_block_io_op; + bio->bi_rw = operation; } atomic_set(&pending_req->pendcnt, nbio); blk_start_plug(&plug); for (i = 0; i < nbio; i++) - submit_bio(operation, biolist[i]); + submit_bio(biolist[i]); /* Let the I/Os go.. */ blk_finish_plug(&plug); diff --git a/drivers/block/xen-blkfront.c b/drivers/block/xen-blkfront.c index 83eb9e6..7ba2ed1 100644 --- a/drivers/block/xen-blkfront.c +++ b/drivers/block/xen-blkfront.c @@ -2111,7 +2111,7 @@ static int blkif_recover(struct blkfront_info *info) bio_trim(cloned_bio, offset, size); cloned_bio->bi_private = split_bio; cloned_bio->bi_end_io = split_bio_end; - submit_bio(cloned_bio->bi_rw, cloned_bio); + submit_bio(cloned_bio); } /* * Now we have to wait for all those smaller bios to @@ -2120,7 +2120,7 @@ static int blkif_recover(struct blkfront_info *info) continue; } /* We don't need to split this bio */ - submit_bio(bio->bi_rw, bio); + submit_bio(bio); } return 0; diff --git a/drivers/md/bcache/debug.c b/drivers/md/bcache/debug.c index 8b1f1d5..52b6bcf 100644 --- a/drivers/md/bcache/debug.c +++ b/drivers/md/bcache/debug.c @@ -52,9 +52,10 @@ void bch_btree_verify(struct btree *b) bio->bi_bdev = PTR_CACHE(b->c, &b->key, 0)->bdev; bio->bi_iter.bi_sector = PTR_OFFSET(&b->key, 0); bio->bi_iter.bi_size = KEY_SIZE(&v->key) << 9; + bio->bi_rw = REQ_META|READ_SYNC; bch_bio_map(bio, sorted); - submit_bio_wait(REQ_META|READ_SYNC, bio); + submit_bio_wait(bio); bch_bbio_free(bio, b->c); memcpy(ondisk, sorted, KEY_SIZE(&v->key) << 9); @@ -113,11 +114,12 @@ void bch_data_verify(struct cached_dev *dc, struct bio *bio) check = bio_clone(bio, GFP_NOIO); if (!check) return; + check->bi_rw |= READ_SYNC; if (bio_alloc_pages(check, GFP_NOIO)) goto out_put; - submit_bio_wait(READ_SYNC, check); + submit_bio_wait(check); bio_for_each_segment(bv, bio, iter) { void *p1 = kmap_atomic(bv.bv_page); diff --git a/drivers/md/bcache/journal.c b/drivers/md/bcache/journal.c index 29eba72..af3f9f7 100644 --- a/drivers/md/bcache/journal.c +++ b/drivers/md/bcache/journal.c @@ -418,7 +418,7 @@ static void journal_discard_work(struct work_struct *work) struct journal_device *ja = container_of(work, struct journal_device, discard_work); - submit_bio(0, &ja->discard_bio); + submit_bio(&ja->discard_bio); } static void do_journal_discard(struct cache *ca) diff --git a/drivers/md/bcache/super.c b/drivers/md/bcache/super.c index 8d0ead9..9e2eac8 100644 --- a/drivers/md/bcache/super.c +++ b/drivers/md/bcache/super.c @@ -212,7 +212,7 @@ static void __write_super(struct cache_sb *sb, struct bio *bio) unsigned i; bio->bi_iter.bi_sector = SB_SECTOR; - bio->bi_rw = REQ_SYNC|REQ_META; + bio->bi_rw = REQ_WRITE|REQ_SYNC|REQ_META; bio->bi_iter.bi_size = SB_SIZE; bch_bio_map(bio, NULL); @@ -238,7 +238,7 @@ static void __write_super(struct cache_sb *sb, struct bio *bio) pr_debug("ver %llu, flags %llu, seq %llu", sb->version, sb->flags, sb->seq); - submit_bio(REQ_WRITE, bio); + submit_bio(bio); } static void bch_write_bdev_super_unlock(struct closure *cl) diff --git a/drivers/md/dm-bufio.c b/drivers/md/dm-bufio.c index cd77216..9d3ee7f 100644 --- a/drivers/md/dm-bufio.c +++ b/drivers/md/dm-bufio.c @@ -634,6 +634,7 @@ static void use_inline_bio(struct dm_buffer *b, int rw, sector_t block, * the dm_buffer's inline bio is local to bufio. */ b->bio.bi_private = end_io; + b->bio.bi_rw = rw; /* * We assume that if len >= PAGE_SIZE ptr is page-aligned. @@ -660,7 +661,7 @@ static void use_inline_bio(struct dm_buffer *b, int rw, sector_t block, ptr += PAGE_SIZE; } while (len > 0); - submit_bio(rw, &b->bio); + submit_bio(&b->bio); } static void submit_io(struct dm_buffer *b, int rw, sector_t block, diff --git a/drivers/md/dm-io.c b/drivers/md/dm-io.c index 06d426e..50f17e3 100644 --- a/drivers/md/dm-io.c +++ b/drivers/md/dm-io.c @@ -322,6 +322,7 @@ static void do_region(int rw, unsigned region, struct dm_io_region *where, bio->bi_iter.bi_sector = where->sector + (where->count - remaining); bio->bi_bdev = where->bdev; bio->bi_end_io = endio; + bio->bi_rw = rw; store_io_and_region_in_bio(bio, io, region); if (rw & REQ_DISCARD) { @@ -355,7 +356,7 @@ static void do_region(int rw, unsigned region, struct dm_io_region *where, } atomic_inc(&io->count); - submit_bio(rw, bio); + submit_bio(bio); } while (remaining); } diff --git a/drivers/md/dm-log-writes.c b/drivers/md/dm-log-writes.c index 608302e..addcc4b 100644 --- a/drivers/md/dm-log-writes.c +++ b/drivers/md/dm-log-writes.c @@ -205,6 +205,7 @@ static int write_metadata(struct log_writes_c *lc, void *entry, bio->bi_bdev = lc->logdev->bdev; bio->bi_end_io = log_end_io; bio->bi_private = lc; + bio->bi_rw = WRITE; page = alloc_page(GFP_KERNEL); if (!page) { @@ -226,7 +227,7 @@ static int write_metadata(struct log_writes_c *lc, void *entry, DMERR("Couldn't add page to the log block"); goto error_bio; } - submit_bio(WRITE, bio); + submit_bio(bio); return 0; error_bio: bio_put(bio); @@ -269,6 +270,7 @@ static int log_one_block(struct log_writes_c *lc, bio->bi_bdev = lc->logdev->bdev; bio->bi_end_io = log_end_io; bio->bi_private = lc; + bio->bi_rw = WRITE; for (i = 0; i < block->vec_cnt; i++) { /* @@ -279,7 +281,7 @@ static int log_one_block(struct log_writes_c *lc, block->vecs[i].bv_len, 0); if (ret != block->vecs[i].bv_len) { atomic_inc(&lc->io_blocks); - submit_bio(WRITE, bio); + submit_bio(bio); bio = bio_alloc(GFP_KERNEL, block->vec_cnt - i); if (!bio) { DMERR("Couldn't alloc log bio"); @@ -290,6 +292,7 @@ static int log_one_block(struct log_writes_c *lc, bio->bi_bdev = lc->logdev->bdev; bio->bi_end_io = log_end_io; bio->bi_private = lc; + bio->bi_rw = WRITE; ret = bio_add_page(bio, block->vecs[i].bv_page, block->vecs[i].bv_len, 0); @@ -301,7 +304,7 @@ static int log_one_block(struct log_writes_c *lc, } sector += block->vecs[i].bv_len >> SECTOR_SHIFT; } - submit_bio(WRITE, bio); + submit_bio(bio); out: kfree(block->data); kfree(block); diff --git a/drivers/md/dm-thin.c b/drivers/md/dm-thin.c index 4fbbe1f..e39ad11 100644 --- a/drivers/md/dm-thin.c +++ b/drivers/md/dm-thin.c @@ -365,8 +365,9 @@ static int __blkdev_issue_discard_async(struct block_device *bdev, sector_t sect bio->bi_iter.bi_sector = sector; bio->bi_bdev = bdev; bio->bi_iter.bi_size = nr_sects << 9; + bio->bi_rw = type; - submit_bio(type, bio); + submit_bio(bio); return 0; } diff --git a/drivers/md/md.c b/drivers/md/md.c index 464627b..6f6102e 100644 --- a/drivers/md/md.c +++ b/drivers/md/md.c @@ -391,8 +391,9 @@ static void submit_flushes(struct work_struct *ws) bi->bi_end_io = md_end_flush; bi->bi_private = rdev; bi->bi_bdev = rdev->bdev; + bi->bi_rw = WRITE_FLUSH; atomic_inc(&mddev->flush_pending); - submit_bio(WRITE_FLUSH, bi); + submit_bio(bi); rcu_read_lock(); rdev_dec_pending(rdev, mddev); } @@ -736,9 +737,10 @@ void md_super_write(struct mddev *mddev, struct md_rdev *rdev, bio_add_page(bio, page, size, 0); bio->bi_private = rdev; bio->bi_end_io = super_written; + bio->bi_rw = WRITE_FLUSH_FUA; atomic_inc(&mddev->pending_writes); - submit_bio(WRITE_FLUSH_FUA, bio); + submit_bio(bio); } void md_super_wait(struct mddev *mddev) @@ -755,6 +757,7 @@ int sync_page_io(struct md_rdev *rdev, sector_t sector, int size, bio->bi_bdev = (metadata_op && rdev->meta_bdev) ? rdev->meta_bdev : rdev->bdev; + bio->bi_rw = rw; if (metadata_op) bio->bi_iter.bi_sector = sector + rdev->sb_start; else if (rdev->mddev->reshape_position != MaxSector && @@ -764,7 +767,8 @@ int sync_page_io(struct md_rdev *rdev, sector_t sector, int size, else bio->bi_iter.bi_sector = sector + rdev->data_offset; bio_add_page(bio, page, size, 0); - submit_bio_wait(rw, bio); + + submit_bio_wait(bio); ret = !bio->bi_error; bio_put(bio); diff --git a/drivers/md/raid1.c b/drivers/md/raid1.c index 4e3843f..f2d9c01 100644 --- a/drivers/md/raid1.c +++ b/drivers/md/raid1.c @@ -2208,7 +2208,8 @@ static int narrow_write_error(struct r1bio *r1_bio, int i) bio_trim(wbio, sector - r1_bio->sector, sectors); wbio->bi_iter.bi_sector += rdev->data_offset; wbio->bi_bdev = rdev->bdev; - if (submit_bio_wait(WRITE, wbio) < 0) + + if (submit_bio_wait(wbio) < 0) /* failure! */ ok = rdev_set_badblocks(rdev, sector, sectors, 0) diff --git a/drivers/md/raid10.c b/drivers/md/raid10.c index 1c1447d..d0d84f3 100644 --- a/drivers/md/raid10.c +++ b/drivers/md/raid10.c @@ -2474,7 +2474,9 @@ static int narrow_write_error(struct r10bio *r10_bio, int i) choose_data_offset(r10_bio, rdev) + (sector - r10_bio->sector)); wbio->bi_bdev = rdev->bdev; - if (submit_bio_wait(WRITE, wbio) < 0) + wbio->bi_rw = WRITE; + + if (submit_bio_wait(wbio) < 0) /* Failure! */ ok = rdev_set_badblocks(rdev, sector, sectors, 0) diff --git a/drivers/md/raid5-cache.c b/drivers/md/raid5-cache.c index 9531f5f..2d56fdc 100644 --- a/drivers/md/raid5-cache.c +++ b/drivers/md/raid5-cache.c @@ -254,7 +254,7 @@ static void r5l_submit_current_io(struct r5l_log *log) __r5l_set_io_unit_state(io, IO_UNIT_IO_START); spin_unlock_irqrestore(&log->io_list_lock, flags); - submit_bio(WRITE, io->current_bio); + submit_bio(io->current_bio); } static struct bio *r5l_bio_alloc(struct r5l_log *log) @@ -373,7 +373,7 @@ static void r5l_append_payload_page(struct r5l_log *log, struct page *page) io->current_bio = r5l_bio_alloc(log); bio_chain(io->current_bio, prev); - submit_bio(WRITE, prev); + submit_bio(prev); } if (!bio_add_page(io->current_bio, page, PAGE_SIZE, 0)) @@ -686,7 +686,8 @@ void r5l_flush_stripe_to_raid(struct r5l_log *log) bio_reset(&log->flush_bio); log->flush_bio.bi_bdev = log->rdev->bdev; log->flush_bio.bi_end_io = r5l_log_flush_endio; - submit_bio(WRITE_FLUSH, &log->flush_bio); + log->flush_bio.bi_rw = WRITE_FLUSH; + submit_bio(&log->flush_bio); } static void r5l_write_super(struct r5l_log *log, sector_t cp); diff --git a/drivers/target/target_core_iblock.c b/drivers/target/target_core_iblock.c index abe4eb9..c352a64 100644 --- a/drivers/target/target_core_iblock.c +++ b/drivers/target/target_core_iblock.c @@ -312,7 +312,7 @@ static void iblock_bio_done(struct bio *bio) } static struct bio * -iblock_get_bio(struct se_cmd *cmd, sector_t lba, u32 sg_num) +iblock_get_bio(struct se_cmd *cmd, sector_t lba, u32 sg_num, int rw) { struct iblock_dev *ib_dev = IBLOCK_DEV(cmd->se_dev); struct bio *bio; @@ -334,18 +334,19 @@ iblock_get_bio(struct se_cmd *cmd, sector_t lba, u32 sg_num) bio->bi_private = cmd; bio->bi_end_io = &iblock_bio_done; bio->bi_iter.bi_sector = lba; + bio->bi_rw = rw; return bio; } -static void iblock_submit_bios(struct bio_list *list, int rw) +static void iblock_submit_bios(struct bio_list *list) { struct blk_plug plug; struct bio *bio; blk_start_plug(&plug); while ((bio = bio_list_pop(list))) - submit_bio(rw, bio); + submit_bio(bio); blk_finish_plug(&plug); } @@ -387,9 +388,10 @@ iblock_execute_sync_cache(struct se_cmd *cmd) bio = bio_alloc(GFP_KERNEL, 0); bio->bi_end_io = iblock_end_io_flush; bio->bi_bdev = ib_dev->ibd_bd; + bio->bi_rw = WRITE_FLUSH; if (!immed) bio->bi_private = cmd; - submit_bio(WRITE_FLUSH, bio); + submit_bio(bio); return 0; } @@ -444,7 +446,7 @@ iblock_execute_write_same(struct se_cmd *cmd) goto fail; cmd->priv = ibr; - bio = iblock_get_bio(cmd, block_lba, 1); + bio = iblock_get_bio(cmd, block_lba, 1, WRITE); if (!bio) goto fail_free_ibr; @@ -457,7 +459,7 @@ iblock_execute_write_same(struct se_cmd *cmd) while (bio_add_page(bio, sg_page(sg), sg->length, sg->offset) != sg->length) { - bio = iblock_get_bio(cmd, block_lba, 1); + bio = iblock_get_bio(cmd, block_lba, 1, WRITE); if (!bio) goto fail_put_bios; @@ -470,7 +472,7 @@ iblock_execute_write_same(struct se_cmd *cmd) sectors -= 1; } - iblock_submit_bios(&list, WRITE); + iblock_submit_bios(&list); return 0; fail_put_bios: @@ -678,7 +680,7 @@ iblock_execute_rw(struct se_cmd *cmd, struct scatterlist *sgl, u32 sgl_nents, return 0; } - bio = iblock_get_bio(cmd, block_lba, sgl_nents); + bio = iblock_get_bio(cmd, block_lba, sgl_nents, rw); if (!bio) goto fail_free_ibr; @@ -698,11 +700,11 @@ iblock_execute_rw(struct se_cmd *cmd, struct scatterlist *sgl, u32 sgl_nents, while (bio_add_page(bio, sg_page(sg), sg->length, sg->offset) != sg->length) { if (bio_cnt >= IBLOCK_MAX_BIO_PER_TASK) { - iblock_submit_bios(&list, rw); + iblock_submit_bios(&list); bio_cnt = 0; } - bio = iblock_get_bio(cmd, block_lba, sg_num); + bio = iblock_get_bio(cmd, block_lba, sg_num, rw); if (!bio) goto fail_put_bios; @@ -722,7 +724,7 @@ iblock_execute_rw(struct se_cmd *cmd, struct scatterlist *sgl, u32 sgl_nents, goto fail_put_bios; } - iblock_submit_bios(&list, rw); + iblock_submit_bios(&list); iblock_complete_cmd(cmd); return 0; diff --git a/fs/btrfs/check-integrity.c b/fs/btrfs/check-integrity.c index 861d472..9c51373 100644 --- a/fs/btrfs/check-integrity.c +++ b/fs/btrfs/check-integrity.c @@ -1671,6 +1671,7 @@ static int btrfsic_read_block(struct btrfsic_state *state, } bio->bi_bdev = block_ctx->dev->bdev; bio->bi_iter.bi_sector = dev_bytenr >> 9; + bio->bi_rw = READ; for (j = i; j < num_pages; j++) { ret = bio_add_page(bio, block_ctx->pagev[j], @@ -1683,7 +1684,7 @@ static int btrfsic_read_block(struct btrfsic_state *state, "btrfsic: error, failed to add a single page!\n"); return -1; } - if (submit_bio_wait(READ, bio)) { + if (submit_bio_wait(bio)) { printk(KERN_INFO "btrfsic: read error at logical %llu dev %s!\n", block_ctx->start, block_ctx->dev->name); @@ -2916,9 +2917,10 @@ int btrfsic_submit_bh(int rw, struct buffer_head *bh) return submit_bh(rw, bh); } -static void __btrfsic_submit_bio(int rw, struct bio *bio) +static void __btrfsic_submit_bio(struct bio *bio) { struct btrfsic_dev_state *dev_state; + int rw = bio->bi_rw; if (!btrfsic_is_initialized) return; @@ -3014,16 +3016,16 @@ leave: mutex_unlock(&btrfsic_mutex); } -void btrfsic_submit_bio(int rw, struct bio *bio) +void btrfsic_submit_bio(struct bio *bio) { - __btrfsic_submit_bio(rw, bio); - submit_bio(rw, bio); + __btrfsic_submit_bio(bio); + submit_bio(bio); } -int btrfsic_submit_bio_wait(int rw, struct bio *bio) +int btrfsic_submit_bio_wait(struct bio *bio) { - __btrfsic_submit_bio(rw, bio); - return submit_bio_wait(rw, bio); + __btrfsic_submit_bio(bio); + return submit_bio_wait(bio); } int btrfsic_mount(struct btrfs_root *root, diff --git a/fs/btrfs/check-integrity.h b/fs/btrfs/check-integrity.h index 13b8566..c04e249 100644 --- a/fs/btrfs/check-integrity.h +++ b/fs/btrfs/check-integrity.h @@ -21,8 +21,8 @@ #ifdef CONFIG_BTRFS_FS_CHECK_INTEGRITY int btrfsic_submit_bh(int rw, struct buffer_head *bh); -void btrfsic_submit_bio(int rw, struct bio *bio); -int btrfsic_submit_bio_wait(int rw, struct bio *bio); +void btrfsic_submit_bio(struct bio *bio); +int btrfsic_submit_bio_wait(struct bio *bio); #else #define btrfsic_submit_bh submit_bh #define btrfsic_submit_bio submit_bio diff --git a/fs/btrfs/disk-io.c b/fs/btrfs/disk-io.c index 2f75069..3437390 100644 --- a/fs/btrfs/disk-io.c +++ b/fs/btrfs/disk-io.c @@ -3470,12 +3470,13 @@ static int write_dev_flush(struct btrfs_device *device, int wait) bio->bi_end_io = btrfs_end_empty_barrier; bio->bi_bdev = device->bdev; + bio->bi_rw = WRITE_FLUSH; init_completion(&device->flush_wait); bio->bi_private = &device->flush_wait; device->flush_bio = bio; bio_get(bio); - btrfsic_submit_bio(WRITE_FLUSH, bio); + btrfsic_submit_bio(bio); return 0; } diff --git a/fs/btrfs/extent_io.c b/fs/btrfs/extent_io.c index 76a0c85..454100e 100644 --- a/fs/btrfs/extent_io.c +++ b/fs/btrfs/extent_io.c @@ -2040,9 +2040,10 @@ int repair_io_failure(struct inode *inode, u64 start, u64 length, u64 logical, return -EIO; } bio->bi_bdev = dev->bdev; + bio->bi_rw = WRITE_SYNC; bio_add_page(bio, page, length, pg_offset); - if (btrfsic_submit_bio_wait(WRITE_SYNC, bio)) { + if (btrfsic_submit_bio_wait(bio)) { /* try to remap that extent elsewhere? */ bio_put(bio); btrfs_dev_stat_inc_and_print(dev, BTRFS_DEV_STAT_WRITE_ERRS); @@ -2725,14 +2726,14 @@ static int __must_check submit_one_bio(int rw, struct bio *bio, start = page_offset(page) + bvec->bv_offset; bio->bi_private = NULL; - + bio->bi_rw = rw; bio_get(bio); if (tree->ops && tree->ops->submit_bio_hook) ret = tree->ops->submit_bio_hook(page->mapping->host, rw, bio, mirror_num, bio_flags, start); else - btrfsic_submit_bio(rw, bio); + btrfsic_submit_bio(bio); bio_put(bio); return ret; diff --git a/fs/btrfs/raid56.c b/fs/btrfs/raid56.c index 5516136..a8e66e4 100644 --- a/fs/btrfs/raid56.c +++ b/fs/btrfs/raid56.c @@ -1320,7 +1320,9 @@ write_data: bio->bi_private = rbio; bio->bi_end_io = raid_write_end_io; - submit_bio(WRITE, bio); + bio->bi_rw = WRITE; + + submit_bio(bio); } return; @@ -1573,11 +1575,12 @@ static int raid56_rmw_stripe(struct btrfs_raid_bio *rbio) bio->bi_private = rbio; bio->bi_end_io = raid_rmw_end_io; + bio->bi_rw = READ; btrfs_bio_wq_end_io(rbio->fs_info, bio, BTRFS_WQ_ENDIO_RAID56); - submit_bio(READ, bio); + submit_bio(bio); } /* the actual write will happen once the reads are done */ return 0; @@ -2097,11 +2100,12 @@ static int __raid56_parity_recover(struct btrfs_raid_bio *rbio) bio->bi_private = rbio; bio->bi_end_io = raid_recover_end_io; + bio->bi_rw = READ; btrfs_bio_wq_end_io(rbio->fs_info, bio, BTRFS_WQ_ENDIO_RAID56); - submit_bio(READ, bio); + submit_bio(bio); } out: return 0; @@ -2433,7 +2437,9 @@ submit_write: bio->bi_private = rbio; bio->bi_end_io = raid_write_end_io; - submit_bio(WRITE, bio); + bio->bi_rw = WRITE; + + submit_bio(bio); } return; @@ -2610,11 +2616,12 @@ static void raid56_parity_scrub_stripe(struct btrfs_raid_bio *rbio) bio->bi_private = rbio; bio->bi_end_io = raid56_parity_scrub_end_io; + bio->bi_rw = READ; btrfs_bio_wq_end_io(rbio->fs_info, bio, BTRFS_WQ_ENDIO_RAID56); - submit_bio(READ, bio); + submit_bio(bio); } /* the actual write will happen once the reads are done */ return; diff --git a/fs/btrfs/scrub.c b/fs/btrfs/scrub.c index e42aa27..8315947 100644 --- a/fs/btrfs/scrub.c +++ b/fs/btrfs/scrub.c @@ -1504,8 +1504,9 @@ static void scrub_recheck_block(struct btrfs_fs_info *fs_info, sblock->no_io_error_seen = 0; } else { bio->bi_iter.bi_sector = page->physical >> 9; + bio->bi_rw = READ; - if (btrfsic_submit_bio_wait(READ, bio)) + if (btrfsic_submit_bio_wait(bio)) sblock->no_io_error_seen = 0; } @@ -1583,6 +1584,7 @@ static int scrub_repair_page_from_good_copy(struct scrub_block *sblock_bad, return -EIO; bio->bi_bdev = page_bad->dev->bdev; bio->bi_iter.bi_sector = page_bad->physical >> 9; + bio->bi_rw = WRITE; ret = bio_add_page(bio, page_good->page, PAGE_SIZE, 0); if (PAGE_SIZE != ret) { @@ -1590,7 +1592,7 @@ static int scrub_repair_page_from_good_copy(struct scrub_block *sblock_bad, return -EIO; } - if (btrfsic_submit_bio_wait(WRITE, bio)) { + if (btrfsic_submit_bio_wait(bio)) { btrfs_dev_stat_inc_and_print(page_bad->dev, BTRFS_DEV_STAT_WRITE_ERRS); btrfs_dev_replace_stats_inc( @@ -1684,6 +1686,7 @@ again: bio->bi_end_io = scrub_wr_bio_end_io; bio->bi_bdev = sbio->dev->bdev; bio->bi_iter.bi_sector = sbio->physical >> 9; + bio->bi_rw = WRITE; sbio->err = 0; } else if (sbio->physical + sbio->page_count * PAGE_SIZE != spage->physical_for_dev_replace || @@ -1731,7 +1734,7 @@ static void scrub_wr_submit(struct scrub_ctx *sctx) * orders the requests before sending them to the driver which * doubled the write performance on spinning disks when measured * with Linux 3.5 */ - btrfsic_submit_bio(WRITE, sbio->bio); + btrfsic_submit_bio(sbio->bio); } static void scrub_wr_bio_end_io(struct bio *bio) @@ -2041,7 +2044,7 @@ static void scrub_submit(struct scrub_ctx *sctx) sbio = sctx->bios[sctx->curr]; sctx->curr = -1; scrub_pending_bio_inc(sctx); - btrfsic_submit_bio(READ, sbio->bio); + btrfsic_submit_bio(sbio->bio); } static int scrub_add_page_to_rd_bio(struct scrub_ctx *sctx, @@ -2088,6 +2091,7 @@ again: bio->bi_end_io = scrub_bio_end_io; bio->bi_bdev = sbio->dev->bdev; bio->bi_iter.bi_sector = sbio->physical >> 9; + bio->bi_rw = READ; sbio->err = 0; } else if (sbio->physical + sbio->page_count * PAGE_SIZE != spage->physical || @@ -4390,6 +4394,8 @@ static int write_page_nocow(struct scrub_ctx *sctx, bio->bi_iter.bi_size = 0; bio->bi_iter.bi_sector = physical_for_dev_replace >> 9; bio->bi_bdev = dev->bdev; + bio->bi_rw = WRITE_SYNC; + ret = bio_add_page(bio, page, PAGE_CACHE_SIZE, 0); if (ret != PAGE_CACHE_SIZE) { leave_with_eio: @@ -4398,7 +4404,7 @@ leave_with_eio: return -EIO; } - if (btrfsic_submit_bio_wait(WRITE_SYNC, bio)) + if (btrfsic_submit_bio_wait(bio)) goto leave_with_eio; bio_put(bio); diff --git a/fs/btrfs/volumes.c b/fs/btrfs/volumes.c index d883278..f87678f 100644 --- a/fs/btrfs/volumes.c +++ b/fs/btrfs/volumes.c @@ -462,7 +462,7 @@ loop_lock: sync_pending = 0; } - btrfsic_submit_bio(cur->bi_rw, cur); + btrfsic_submit_bio(cur); num_run++; batch_run++; @@ -5933,7 +5933,7 @@ static void btrfs_end_bio(struct bio *bio) */ static noinline void btrfs_schedule_bio(struct btrfs_root *root, struct btrfs_device *device, - int rw, struct bio *bio) + struct bio *bio) { int should_queue = 1; struct btrfs_pending_bios *pending_bios; @@ -5944,9 +5944,9 @@ static noinline void btrfs_schedule_bio(struct btrfs_root *root, } /* don't bother with additional async steps for reads, right now */ - if (!(rw & REQ_WRITE)) { + if (!(bio->bi_rw & REQ_WRITE)) { bio_get(bio); - btrfsic_submit_bio(rw, bio); + btrfsic_submit_bio(bio); bio_put(bio); return; } @@ -5960,7 +5960,6 @@ static noinline void btrfs_schedule_bio(struct btrfs_root *root, atomic_inc(&root->fs_info->nr_async_bios); WARN_ON(bio->bi_next); bio->bi_next = NULL; - bio->bi_rw |= rw; spin_lock(&device->io_lock); if (bio->bi_rw & REQ_SYNC) @@ -5994,6 +5993,7 @@ static void submit_stripe_bio(struct btrfs_root *root, struct btrfs_bio *bbio, btrfs_io_bio(bio)->stripe_index = dev_nr; bio->bi_end_io = btrfs_end_bio; bio->bi_iter.bi_sector = physical >> 9; + bio->bi_rw |= rw; #ifdef DEBUG { struct rcu_string *name; @@ -6012,9 +6012,9 @@ static void submit_stripe_bio(struct btrfs_root *root, struct btrfs_bio *bbio, btrfs_bio_counter_inc_noblocked(root->fs_info); if (async) - btrfs_schedule_bio(root, dev, rw, bio); + btrfs_schedule_bio(root, dev, bio); else - btrfsic_submit_bio(rw, bio); + btrfsic_submit_bio(bio); } static void bbio_error(struct btrfs_bio *bbio, struct bio *bio, u64 logical) diff --git a/fs/buffer.c b/fs/buffer.c index 33be296..ef70d65 100644 --- a/fs/buffer.c +++ b/fs/buffer.c @@ -3030,8 +3030,9 @@ static int submit_bh_wbc(int rw, struct buffer_head *bh, rw |= REQ_META; if (buffer_prio(bh)) rw |= REQ_PRIO; + bio->bi_rw = rw; - submit_bio(rw, bio); + submit_bio(bio); return 0; } diff --git a/fs/direct-io.c b/fs/direct-io.c index 7487174..1bce5c3 100644 --- a/fs/direct-io.c +++ b/fs/direct-io.c @@ -374,6 +374,7 @@ dio_bio_alloc(struct dio *dio, struct dio_submit *sdio, bio->bi_bdev = bdev; bio->bi_iter.bi_sector = first_sector; + bio->bi_rw = dio->rw; if (dio->is_async) bio->bi_end_io = dio_bio_end_aio; else @@ -411,7 +412,7 @@ static inline void dio_bio_submit(struct dio *dio, struct dio_submit *sdio) sdio->logical_offset_in_bio); dio->bio_cookie = BLK_QC_T_NONE; } else - dio->bio_cookie = submit_bio(dio->rw, bio); + dio->bio_cookie = submit_bio(bio); sdio->bio = NULL; sdio->boundary = 0; diff --git a/fs/ext4/crypto.c b/fs/ext4/crypto.c index edc053a..18b8893 100644 --- a/fs/ext4/crypto.c +++ b/fs/ext4/crypto.c @@ -422,6 +422,7 @@ int ext4_encrypted_zeroout(struct inode *inode, ext4_lblk_t lblk, bio->bi_bdev = inode->i_sb->s_bdev; bio->bi_iter.bi_sector = pblk << (inode->i_sb->s_blocksize_bits - 9); + bio->bi_rw = WRITE; ret = bio_add_page(bio, ciphertext_page, inode->i_sb->s_blocksize, 0); if (ret != inode->i_sb->s_blocksize) { @@ -433,7 +434,7 @@ int ext4_encrypted_zeroout(struct inode *inode, ext4_lblk_t lblk, err = -EIO; goto errout; } - err = submit_bio_wait(WRITE, bio); + err = submit_bio_wait(bio); if ((err == 0) && bio->bi_error) err = -EIO; bio_put(bio); diff --git a/fs/ext4/page-io.c b/fs/ext4/page-io.c index 090b349..cf63ac3 100644 --- a/fs/ext4/page-io.c +++ b/fs/ext4/page-io.c @@ -356,7 +356,8 @@ void ext4_io_submit(struct ext4_io_submit *io) int io_op = io->io_wbc->sync_mode == WB_SYNC_ALL ? WRITE_SYNC : WRITE; bio_get(io->io_bio); - submit_bio(io_op, io->io_bio); + io->io_bio->bi_rw = io_op; + submit_bio(io->io_bio); bio_put(io->io_bio); } io->io_bio = NULL; diff --git a/fs/ext4/readpage.c b/fs/ext4/readpage.c index 5dc5e95..893dc15 100644 --- a/fs/ext4/readpage.c +++ b/fs/ext4/readpage.c @@ -271,7 +271,7 @@ int ext4_mpage_readpages(struct address_space *mapping, */ if (bio && (last_block_in_bio != blocks[0] - 1)) { submit_and_realloc: - submit_bio(READ, bio); + submit_bio(bio); bio = NULL; } if (bio == NULL) { @@ -294,6 +294,7 @@ int ext4_mpage_readpages(struct address_space *mapping, bio->bi_iter.bi_sector = blocks[0] << (blkbits - 9); bio->bi_end_io = mpage_end_io; bio->bi_private = ctx; + bio->bi_rw = READ; } length = first_hole << blkbits; @@ -303,14 +304,14 @@ int ext4_mpage_readpages(struct address_space *mapping, if (((map.m_flags & EXT4_MAP_BOUNDARY) && (relative_block == map.m_len)) || (first_hole != blocks_per_page)) { - submit_bio(READ, bio); + submit_bio(bio); bio = NULL; } else last_block_in_bio = blocks[blocks_per_page - 1]; goto next_page; confused: if (bio) { - submit_bio(READ, bio); + submit_bio(bio); bio = NULL; } if (!PageUptodate(page)) @@ -323,6 +324,6 @@ int ext4_mpage_readpages(struct address_space *mapping, } BUG_ON(pages && !list_empty(pages)); if (bio) - submit_bio(READ, bio); + submit_bio(bio); return 0; } diff --git a/fs/f2fs/data.c b/fs/f2fs/data.c index a6e7133..ff623b2 100644 --- a/fs/f2fs/data.c +++ b/fs/f2fs/data.c @@ -109,8 +109,9 @@ static void __submit_merged_bio(struct f2fs_bio_info *io) trace_f2fs_submit_read_bio(io->sbi->sb, fio, io->bio); else trace_f2fs_submit_write_bio(io->sbi->sb, fio, io->bio); + io->bio->bi_rw = fio->rw; - submit_bio(fio->rw, io->bio); + submit_bio(io->bio); io->bio = NULL; } @@ -220,8 +221,9 @@ int f2fs_submit_page_bio(struct f2fs_io_info *fio) bio_put(bio); return -EFAULT; } + bio->bi_rw = fio->rw; - submit_bio(fio->rw, bio); + submit_bio(bio); return 0; } @@ -969,7 +971,7 @@ got_it: */ if (bio && (last_block_in_bio != block_nr - 1)) { submit_and_realloc: - submit_bio(READ, bio); + submit_bio(bio); bio = NULL; } if (bio == NULL) { @@ -998,6 +1000,7 @@ submit_and_realloc: bio->bi_iter.bi_sector = SECTOR_FROM_BLOCK(block_nr); bio->bi_end_io = f2fs_read_end_io; bio->bi_private = ctx; + bio->bi_rw = READ; } if (bio_add_page(bio, page, blocksize, 0) < blocksize) @@ -1012,7 +1015,7 @@ set_error_page: goto next_page; confused: if (bio) { - submit_bio(READ, bio); + submit_bio(bio); bio = NULL; } unlock_page(page); @@ -1022,7 +1025,7 @@ next_page: } BUG_ON(pages && !list_empty(pages)); if (bio) - submit_bio(READ, bio); + submit_bio(bio); return 0; } diff --git a/fs/f2fs/segment.c b/fs/f2fs/segment.c index d8e13b0..34e99fe 100644 --- a/fs/f2fs/segment.c +++ b/fs/f2fs/segment.c @@ -402,7 +402,8 @@ repeat: fcc->dispatch_list = llist_reverse_order(fcc->dispatch_list); bio->bi_bdev = sbi->sb->s_bdev; - ret = submit_bio_wait(WRITE_FLUSH, bio); + bio->bi_rw = WRITE_FLUSH; + ret = submit_bio_wait(bio); llist_for_each_entry_safe(cmd, next, fcc->dispatch_list, llnode) { @@ -434,7 +435,8 @@ int f2fs_issue_flush(struct f2fs_sb_info *sbi) int ret; bio->bi_bdev = sbi->sb->s_bdev; - ret = submit_bio_wait(WRITE_FLUSH, bio); + bio->bi_rw = WRITE_FLUSH; + ret = submit_bio_wait(bio); bio_put(bio); return ret; } diff --git a/fs/gfs2/lops.c b/fs/gfs2/lops.c index d5369a1..ce28242 100644 --- a/fs/gfs2/lops.c +++ b/fs/gfs2/lops.c @@ -240,7 +240,8 @@ void gfs2_log_flush_bio(struct gfs2_sbd *sdp, int rw) { if (sdp->sd_log_bio) { atomic_inc(&sdp->sd_log_in_flight); - submit_bio(rw, sdp->sd_log_bio); + sdp->sd_log_bio->bi_rw = rw; + submit_bio(sdp->sd_log_bio); sdp->sd_log_bio = NULL; } } diff --git a/fs/gfs2/meta_io.c b/fs/gfs2/meta_io.c index e137d96..87a3abc 100644 --- a/fs/gfs2/meta_io.c +++ b/fs/gfs2/meta_io.c @@ -230,7 +230,8 @@ static void gfs2_submit_bhs(int rw, struct buffer_head *bhs[], int num) bio_add_page(bio, bh->b_page, bh->b_size, bh_offset(bh)); } bio->bi_end_io = gfs2_meta_read_endio; - submit_bio(rw, bio); + bio->bi_rw = rw; + submit_bio(bio); } /** diff --git a/fs/gfs2/ops_fstype.c b/fs/gfs2/ops_fstype.c index dbed9e2..4872a61 100644 --- a/fs/gfs2/ops_fstype.c +++ b/fs/gfs2/ops_fstype.c @@ -246,7 +246,8 @@ static int gfs2_read_super(struct gfs2_sbd *sdp, sector_t sector, int silent) bio->bi_end_io = end_bio_io_page; bio->bi_private = page; - submit_bio(READ_SYNC | REQ_META, bio); + bio->bi_rw = READ_SYNC | REQ_META; + submit_bio(bio); wait_on_page_locked(page); bio_put(bio); if (!PageUptodate(page)) { diff --git a/fs/hfsplus/wrapper.c b/fs/hfsplus/wrapper.c index cc62356..d026bb3 100644 --- a/fs/hfsplus/wrapper.c +++ b/fs/hfsplus/wrapper.c @@ -65,6 +65,7 @@ int hfsplus_submit_bio(struct super_block *sb, sector_t sector, bio = bio_alloc(GFP_NOIO, 1); bio->bi_iter.bi_sector = sector; bio->bi_bdev = sb->s_bdev; + bio->bi_rw = rw; if (!(rw & WRITE) && data) *data = (u8 *)buf + offset; @@ -83,7 +84,7 @@ int hfsplus_submit_bio(struct super_block *sb, sector_t sector, buf = (u8 *)buf + len; } - ret = submit_bio_wait(rw, bio); + ret = submit_bio_wait(bio); out: bio_put(bio); return ret < 0 ? ret : 0; diff --git a/fs/jfs/jfs_logmgr.c b/fs/jfs/jfs_logmgr.c index a270cb7..b0e068f 100644 --- a/fs/jfs/jfs_logmgr.c +++ b/fs/jfs/jfs_logmgr.c @@ -2004,12 +2004,13 @@ static int lbmRead(struct jfs_log * log, int pn, struct lbuf ** bpp) bio->bi_end_io = lbmIODone; bio->bi_private = bp; + bio->bi_rw = READ_SYNC; /*check if journaling to disk has been disabled*/ if (log->no_integrity) { bio->bi_iter.bi_size = 0; lbmIODone(bio); } else { - submit_bio(READ_SYNC, bio); + submit_bio(bio); } wait_event(bp->l_ioevent, (bp->l_flag != lbmREAD)); @@ -2147,13 +2148,14 @@ static void lbmStartIO(struct lbuf * bp) bio->bi_end_io = lbmIODone; bio->bi_private = bp; + bio->bi_rw = WRITE_SYNC; /* check if journaling to disk has been disabled */ if (log->no_integrity) { bio->bi_iter.bi_size = 0; lbmIODone(bio); } else { - submit_bio(WRITE_SYNC, bio); + submit_bio(bio); INCREMENT(lmStat.submitted); } } diff --git a/fs/jfs/jfs_metapage.c b/fs/jfs/jfs_metapage.c index a3eb316..bc29972 100644 --- a/fs/jfs/jfs_metapage.c +++ b/fs/jfs/jfs_metapage.c @@ -411,7 +411,7 @@ static int metapage_writepage(struct page *page, struct writeback_control *wbc) inc_io(page); if (!bio->bi_iter.bi_size) goto dump_bio; - submit_bio(WRITE, bio); + submit_bio(bio); nr_underway++; bio = NULL; } else @@ -434,6 +434,7 @@ static int metapage_writepage(struct page *page, struct writeback_control *wbc) bio->bi_iter.bi_sector = pblock << (inode->i_blkbits - 9); bio->bi_end_io = metapage_write_end_io; bio->bi_private = page; + bio->bi_rw = WRITE; /* Don't call bio_add_page yet, we may add to this vec */ bio_offset = offset; @@ -448,7 +449,7 @@ static int metapage_writepage(struct page *page, struct writeback_control *wbc) if (!bio->bi_iter.bi_size) goto dump_bio; - submit_bio(WRITE, bio); + submit_bio(bio); nr_underway++; } if (redirty) @@ -506,7 +507,7 @@ static int metapage_readpage(struct file *fp, struct page *page) insert_metapage(page, NULL); inc_io(page); if (bio) - submit_bio(READ, bio); + submit_bio(bio); bio = bio_alloc(GFP_NOFS, 1); bio->bi_bdev = inode->i_sb->s_bdev; @@ -514,6 +515,7 @@ static int metapage_readpage(struct file *fp, struct page *page) pblock << (inode->i_blkbits - 9); bio->bi_end_io = metapage_read_end_io; bio->bi_private = page; + bio->bi_rw = READ; len = xlen << inode->i_blkbits; offset = block_offset << inode->i_blkbits; if (bio_add_page(bio, page, len, offset) < len) @@ -523,7 +525,7 @@ static int metapage_readpage(struct file *fp, struct page *page) block_offset++; } if (bio) - submit_bio(READ, bio); + submit_bio(bio); else unlock_page(page); diff --git a/fs/logfs/dev_bdev.c b/fs/logfs/dev_bdev.c index a709d80..9e690ad 100644 --- a/fs/logfs/dev_bdev.c +++ b/fs/logfs/dev_bdev.c @@ -29,8 +29,9 @@ static int sync_request(struct page *page, struct block_device *bdev, int rw) bio.bi_bdev = bdev; bio.bi_iter.bi_sector = page->index * (PAGE_SIZE >> 9); bio.bi_iter.bi_size = PAGE_SIZE; + bio.bi_rw = rw; - return submit_bio_wait(rw, &bio); + return submit_bio_wait(&bio); } static int bdev_readpage(void *_sb, struct page *page) @@ -95,8 +96,9 @@ static int __bdev_writeseg(struct super_block *sb, u64 ofs, pgoff_t index, bio->bi_iter.bi_sector = ofs >> 9; bio->bi_private = sb; bio->bi_end_io = writeseg_end_io; + bio->bi_rw = WRITE; atomic_inc(&super->s_pending_writes); - submit_bio(WRITE, bio); + submit_bio(bio); ofs += i * PAGE_SIZE; index += i; @@ -122,8 +124,9 @@ static int __bdev_writeseg(struct super_block *sb, u64 ofs, pgoff_t index, bio->bi_iter.bi_sector = ofs >> 9; bio->bi_private = sb; bio->bi_end_io = writeseg_end_io; + bio->bi_rw = WRITE; atomic_inc(&super->s_pending_writes); - submit_bio(WRITE, bio); + submit_bio(bio); return 0; } @@ -185,8 +188,9 @@ static int do_erase(struct super_block *sb, u64 ofs, pgoff_t index, bio->bi_iter.bi_sector = ofs >> 9; bio->bi_private = sb; bio->bi_end_io = erase_end_io; + bio->bi_rw = WRITE; atomic_inc(&super->s_pending_writes); - submit_bio(WRITE, bio); + submit_bio(bio); ofs += i * PAGE_SIZE; index += i; @@ -206,8 +210,9 @@ static int do_erase(struct super_block *sb, u64 ofs, pgoff_t index, bio->bi_iter.bi_sector = ofs >> 9; bio->bi_private = sb; bio->bi_end_io = erase_end_io; + bio->bi_rw = WRITE; atomic_inc(&super->s_pending_writes); - submit_bio(WRITE, bio); + submit_bio(bio); return 0; } diff --git a/fs/mpage.c b/fs/mpage.c index 6bd9fd9..9479e73 100644 --- a/fs/mpage.c +++ b/fs/mpage.c @@ -59,8 +59,9 @@ static void mpage_end_io(struct bio *bio) static struct bio *mpage_bio_submit(int rw, struct bio *bio) { bio->bi_end_io = mpage_end_io; + bio->bi_rw = rw; guard_bio_eod(rw, bio); - submit_bio(rw, bio); + submit_bio(bio); return NULL; } diff --git a/fs/nfs/blocklayout/blocklayout.c b/fs/nfs/blocklayout/blocklayout.c index ddd0138..8c0443c 100644 --- a/fs/nfs/blocklayout/blocklayout.c +++ b/fs/nfs/blocklayout/blocklayout.c @@ -102,14 +102,15 @@ static inline void put_parallel(struct parallel_io *p) } static struct bio * -bl_submit_bio(int rw, struct bio *bio) +bl_submit_bio(struct bio *bio) { if (bio) { get_parallel(bio->bi_private); dprintk("%s submitting %s bio %u@%llu\n", __func__, - rw == READ ? "read" : "write", bio->bi_iter.bi_size, + bio->bi_rw == READ ? "read" : "write", + bio->bi_iter.bi_size, (unsigned long long)bio->bi_iter.bi_sector); - submit_bio(rw, bio); + submit_bio(bio); } return NULL; } @@ -158,7 +159,7 @@ do_add_page_to_bio(struct bio *bio, int npg, int rw, sector_t isect, if (disk_addr < map->start || disk_addr >= map->start + map->len) { if (!dev->map(dev, disk_addr, map)) return ERR_PTR(-EIO); - bio = bl_submit_bio(rw, bio); + bio = bl_submit_bio(bio); } disk_addr += map->disk_offset; disk_addr -= map->start; @@ -174,9 +175,10 @@ retry: disk_addr >> SECTOR_SHIFT, end_io, par); if (!bio) return ERR_PTR(-ENOMEM); + bio->bi_rw = rw; } if (bio_add_page(bio, page, *len, offset) < *len) { - bio = bl_submit_bio(rw, bio); + bio = bl_submit_bio(bio); goto retry; } return bio; @@ -252,7 +254,7 @@ bl_read_pagelist(struct nfs_pgio_header *header) for (i = pg_index; i < header->page_array.npages; i++) { if (extent_length <= 0) { /* We've used up the previous extent */ - bio = bl_submit_bio(READ, bio); + bio = bl_submit_bio(bio); /* Get the next one */ if (!ext_tree_lookup(bl, isect, &be, false)) { @@ -273,7 +275,7 @@ bl_read_pagelist(struct nfs_pgio_header *header) } if (is_hole(&be)) { - bio = bl_submit_bio(READ, bio); + bio = bl_submit_bio(bio); /* Fill hole w/ zeroes w/o accessing device */ dprintk("%s Zeroing page for hole\n", __func__); zero_user_segment(pages[i], pg_offset, pg_len); @@ -306,7 +308,7 @@ bl_read_pagelist(struct nfs_pgio_header *header) header->res.count = (isect << SECTOR_SHIFT) - header->args.offset; } out: - bl_submit_bio(READ, bio); + bl_submit_bio(bio); blk_finish_plug(&plug); put_parallel(par); return PNFS_ATTEMPTED; @@ -398,7 +400,7 @@ bl_write_pagelist(struct nfs_pgio_header *header, int sync) for (i = pg_index; i < header->page_array.npages; i++) { if (extent_length <= 0) { /* We've used up the previous extent */ - bio = bl_submit_bio(WRITE, bio); + bio = bl_submit_bio(bio); /* Get the next one */ if (!ext_tree_lookup(bl, isect, &be, true)) { header->pnfs_error = -EINVAL; @@ -427,7 +429,7 @@ bl_write_pagelist(struct nfs_pgio_header *header, int sync) header->res.count = header->args.count; out: - bl_submit_bio(WRITE, bio); + bl_submit_bio(bio); blk_finish_plug(&plug); put_parallel(par); return PNFS_ATTEMPTED; diff --git a/fs/nilfs2/segbuf.c b/fs/nilfs2/segbuf.c index f63620c..7666f1d 100644 --- a/fs/nilfs2/segbuf.c +++ b/fs/nilfs2/segbuf.c @@ -368,7 +368,8 @@ static int nilfs_segbuf_submit_bio(struct nilfs_segment_buffer *segbuf, bio->bi_end_io = nilfs_end_bio_write; bio->bi_private = segbuf; - submit_bio(mode, bio); + bio->bi_rw = mode; + submit_bio(bio); segbuf->sb_nbio++; wi->bio = NULL; diff --git a/fs/ocfs2/cluster/heartbeat.c b/fs/ocfs2/cluster/heartbeat.c index 1d3bf9e..bbc6203 100644 --- a/fs/ocfs2/cluster/heartbeat.c +++ b/fs/ocfs2/cluster/heartbeat.c @@ -531,7 +531,7 @@ static void o2hb_bio_end_io(struct bio *bio) static struct bio *o2hb_setup_one_bio(struct o2hb_region *reg, struct o2hb_bio_wait_ctxt *wc, unsigned int *current_slot, - unsigned int max_slots) + unsigned int max_slots, int rw) { int len, current_page; unsigned int vec_len, vec_start; @@ -557,6 +557,7 @@ static struct bio *o2hb_setup_one_bio(struct o2hb_region *reg, bio->bi_bdev = reg->hr_bdev; bio->bi_private = wc; bio->bi_end_io = o2hb_bio_end_io; + bio->bi_rw = rw; vec_start = (cs << bits) % PAGE_CACHE_SIZE; while(cs < max_slots) { @@ -592,7 +593,8 @@ static int o2hb_read_slots(struct o2hb_region *reg, o2hb_bio_wait_init(&wc); while(current_slot < max_slots) { - bio = o2hb_setup_one_bio(reg, &wc, ¤t_slot, max_slots); + bio = o2hb_setup_one_bio(reg, &wc, ¤t_slot, max_slots, + READ); if (IS_ERR(bio)) { status = PTR_ERR(bio); mlog_errno(status); @@ -600,7 +602,7 @@ static int o2hb_read_slots(struct o2hb_region *reg, } atomic_inc(&wc.wc_num_reqs); - submit_bio(READ, bio); + submit_bio(bio); } status = 0; @@ -624,7 +626,7 @@ static int o2hb_issue_node_write(struct o2hb_region *reg, slot = o2nm_this_node(); - bio = o2hb_setup_one_bio(reg, write_wc, &slot, slot+1); + bio = o2hb_setup_one_bio(reg, write_wc, &slot, slot+1, WRITE_SYNC); if (IS_ERR(bio)) { status = PTR_ERR(bio); mlog_errno(status); @@ -632,7 +634,7 @@ static int o2hb_issue_node_write(struct o2hb_region *reg, } atomic_inc(&write_wc->wc_num_reqs); - submit_bio(WRITE_SYNC, bio); + submit_bio(bio); status = 0; bail: diff --git a/fs/xfs/xfs_aops.c b/fs/xfs/xfs_aops.c index a378373..9cd38d1 100644 --- a/fs/xfs/xfs_aops.c +++ b/fs/xfs/xfs_aops.c @@ -393,7 +393,8 @@ xfs_submit_ioend_bio( atomic_inc(&ioend->io_remaining); bio->bi_private = ioend; bio->bi_end_io = xfs_end_bio; - submit_bio(wbc->sync_mode == WB_SYNC_ALL ? WRITE_SYNC : WRITE, bio); + bio->bi_rw = (wbc->sync_mode == WB_SYNC_ALL ? WRITE_SYNC : WRITE); + submit_bio(bio); } STATIC struct bio * diff --git a/fs/xfs/xfs_buf.c b/fs/xfs/xfs_buf.c index 9a2191b..079bb77 100644 --- a/fs/xfs/xfs_buf.c +++ b/fs/xfs/xfs_buf.c @@ -1170,7 +1170,7 @@ next_chunk: bio->bi_iter.bi_sector = sector; bio->bi_end_io = xfs_buf_bio_end_io; bio->bi_private = bp; - + bio->bi_rw = rw; for (; size && nr_pages; nr_pages--, page_index++) { int rbytes, nbytes = PAGE_SIZE - offset; @@ -1194,7 +1194,7 @@ next_chunk: flush_kernel_vmap_range(bp->b_addr, xfs_buf_vmap_len(bp)); } - submit_bio(rw, bio); + submit_bio(bio); if (size) goto next_chunk; } else { diff --git a/include/linux/bio.h b/include/linux/bio.h index 5349e68..9f0e2cf 100644 --- a/include/linux/bio.h +++ b/include/linux/bio.h @@ -441,7 +441,7 @@ static inline void bio_io_error(struct bio *bio) struct request_queue; extern int bio_phys_segments(struct request_queue *, struct bio *); -extern int submit_bio_wait(int rw, struct bio *bio); +extern int submit_bio_wait(struct bio *bio); extern void bio_advance(struct bio *, unsigned); extern void bio_init(struct bio *); diff --git a/include/linux/fs.h b/include/linux/fs.h index 2a15fe2..3d9fdf4 100644 --- a/include/linux/fs.h +++ b/include/linux/fs.h @@ -2686,7 +2686,7 @@ static inline void remove_inode_hash(struct inode *inode) extern void inode_sb_list_add(struct inode *inode); #ifdef CONFIG_BLOCK -extern blk_qc_t submit_bio(int, struct bio *); +extern blk_qc_t submit_bio(struct bio *); extern int bdev_read_only(struct block_device *); #endif extern int set_blocksize(struct block_device *, int); diff --git a/kernel/power/swap.c b/kernel/power/swap.c index 12cd989..4d050eb 100644 --- a/kernel/power/swap.c +++ b/kernel/power/swap.c @@ -260,6 +260,7 @@ static int hib_submit_io(int rw, pgoff_t page_off, void *addr, bio = bio_alloc(__GFP_RECLAIM | __GFP_HIGH, 1); bio->bi_iter.bi_sector = page_off * (PAGE_SIZE >> 9); bio->bi_bdev = hib_resume_bdev; + bio->bi_rw = rw; if (bio_add_page(bio, page, PAGE_SIZE, 0) < PAGE_SIZE) { printk(KERN_ERR "PM: Adding page to bio failed at %llu\n", @@ -272,9 +273,9 @@ static int hib_submit_io(int rw, pgoff_t page_off, void *addr, bio->bi_end_io = hib_end_io; bio->bi_private = hb; atomic_inc(&hb->count); - submit_bio(rw, bio); + submit_bio(bio); } else { - error = submit_bio_wait(rw, bio); + error = submit_bio_wait(bio); bio_put(bio); } diff --git a/mm/page_io.c b/mm/page_io.c index b995a5b..e8a18a7 100644 --- a/mm/page_io.c +++ b/mm/page_io.c @@ -253,7 +253,7 @@ int __swap_writepage(struct page *page, struct writeback_control *wbc, bio_end_io_t end_write_func) { struct bio *bio; - int ret, rw = WRITE; + int ret; struct swap_info_struct *sis = page_swap_info(page); if (sis->flags & SWP_FILE) { @@ -311,12 +311,13 @@ int __swap_writepage(struct page *page, struct writeback_control *wbc, ret = -ENOMEM; goto out; } + bio->bi_rw = WRITE; if (wbc->sync_mode == WB_SYNC_ALL) - rw |= REQ_SYNC; + bio->bi_rw |= REQ_SYNC; count_vm_event(PSWPOUT); set_page_writeback(page); unlock_page(page); - submit_bio(rw, bio); + submit_bio(bio); out: return ret; } @@ -358,8 +359,9 @@ int swap_readpage(struct page *page) ret = -ENOMEM; goto out; } + bio->bi_rw = READ; count_vm_event(PSWPIN); - submit_bio(READ, bio); + submit_bio(bio); out: return ret; } -- 1.8.3.1 From mchristi@redhat.com Wed Feb 24 13:48:45 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=ham version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay2.corp.sgi.com [137.38.102.29]) by oss.sgi.com (Postfix) with ESMTP id C47A67CB9 for ; Wed, 24 Feb 2016 13:48:45 -0600 (CST) Received: from cuda.sgi.com (cuda3.sgi.com [192.48.176.15]) by relay2.corp.sgi.com (Postfix) with ESMTP id 9860A30406A for ; Wed, 24 Feb 2016 11:48:39 -0800 (PST) X-ASG-Debug-ID: 1456343317-04cb6c70074d630001-NocioJ Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by cuda.sgi.com with ESMTP id c4MgH90lcmeUDIQi (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO) for ; Wed, 24 Feb 2016 11:48:37 -0800 (PST) X-Barracuda-Envelope-From: mchristi@redhat.com X-Barracuda-Apparent-Source-IP: 209.132.183.28 X-ASG-Whitelist: Client Received: from int-mx09.intmail.prod.int.phx2.redhat.com (int-mx09.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by mx1.redhat.com (Postfix) with ESMTPS id F366830249A; Wed, 24 Feb 2016 19:48:36 +0000 (UTC) Received: from rh2.redhat.com (vpn-54-14.rdu2.redhat.com [10.10.54.14]) by int-mx09.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id u1OJmJEA006684; Wed, 24 Feb 2016 14:48:34 -0500 From: mchristi@redhat.com To: linux-f2fs-devel@lists.sourceforge.net, linux-ext4@vger.kernel.org, konrad.wilk@oracle.com, drbd-dev@lists.linbit.com, philipp.reisner@linbit.com, lars.ellenberg@linbit.com, linux-raid@vger.kernel.org, dm-devel@redhat.com, linux-fsdevel@vger.kernel.org, linux-bcache@vger.kernel.org, linux-block@vger.kernel.org, linux-kernel@vger.kernel.org, linux-scsi@vger.kernel.org, linux-mtd@lists.infradead.org, target-devel@vger.kernel.org, linux-btrfs@vger.kernel.org, osd-dev@open-osd.org, xfs@oss.sgi.com, ocfs2-devel@oss.oracle.com Cc: Mike Christie Subject: [PATCH 05/35] fs: have ll_rw_block users pass in op and flags separately Date: Wed, 24 Feb 2016 13:47:42 -0600 X-ASG-Orig-Subj: [PATCH 05/35] fs: have ll_rw_block users pass in op and flags separately Message-Id: <1456343292-14535-6-git-send-email-mchristi@redhat.com> In-Reply-To: <1456343292-14535-1-git-send-email-mchristi@redhat.com> References: <1456343292-14535-1-git-send-email-mchristi@redhat.com> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.22 X-Barracuda-Connect: mx1.redhat.com[209.132.183.28] X-Barracuda-Start-Time: 1456343317 X-Barracuda-Encrypted: ECDHE-RSA-AES256-GCM-SHA384 X-Barracuda-URL: https://192.48.176.15:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-BRTS-Status: 1 From: Mike Christie This has ll_rw_block users pass in the operation and flags separately, so we can setup the bio->bi_op and bio-bi_rw flags. v2: 1. Fix for kbuild error in ll_rw_block comments. Signed-off-by: Mike Christie --- fs/buffer.c | 19 ++++++++++--------- fs/ext4/inode.c | 6 +++--- fs/ext4/namei.c | 3 ++- fs/ext4/super.c | 2 +- fs/gfs2/bmap.c | 2 +- fs/gfs2/meta_io.c | 4 ++-- fs/gfs2/quota.c | 2 +- fs/isofs/compress.c | 2 +- fs/jbd2/journal.c | 2 +- fs/jbd2/recovery.c | 4 ++-- fs/ocfs2/aops.c | 2 +- fs/ocfs2/super.c | 2 +- fs/reiserfs/journal.c | 8 ++++---- fs/reiserfs/stree.c | 4 ++-- fs/reiserfs/super.c | 2 +- fs/squashfs/block.c | 4 ++-- fs/udf/dir.c | 2 +- fs/udf/directory.c | 2 +- fs/udf/inode.c | 2 +- fs/ufs/balloc.c | 2 +- include/linux/buffer_head.h | 2 +- 21 files changed, 40 insertions(+), 38 deletions(-) diff --git a/fs/buffer.c b/fs/buffer.c index 3492de4..5408ca6 100644 --- a/fs/buffer.c +++ b/fs/buffer.c @@ -588,7 +588,7 @@ void write_boundary_block(struct block_device *bdev, struct buffer_head *bh = __find_get_block(bdev, bblock + 1, blocksize); if (bh) { if (buffer_dirty(bh)) - ll_rw_block(WRITE, 1, &bh); + ll_rw_block(REQ_OP_WRITE, 0, 1, &bh); put_bh(bh); } } @@ -1395,7 +1395,7 @@ void __breadahead(struct block_device *bdev, sector_t block, unsigned size) { struct buffer_head *bh = __getblk(bdev, block, size); if (likely(bh)) { - ll_rw_block(READA, 1, &bh); + ll_rw_block(REQ_OP_READ, READA, 1, &bh); brelse(bh); } } @@ -1955,7 +1955,7 @@ int __block_write_begin(struct page *page, loff_t pos, unsigned len, if (!buffer_uptodate(bh) && !buffer_delay(bh) && !buffer_unwritten(bh) && (block_start < from || block_end > to)) { - ll_rw_block(READ, 1, &bh); + ll_rw_block(REQ_OP_READ, 0, 1, &bh); *wait_bh++=bh; } } @@ -2852,7 +2852,7 @@ int block_truncate_page(struct address_space *mapping, if (!buffer_uptodate(bh) && !buffer_delay(bh) && !buffer_unwritten(bh)) { err = -EIO; - ll_rw_block(READ, 1, &bh); + ll_rw_block(REQ_OP_READ, 0, 1, &bh); wait_on_buffer(bh); /* Uhhuh. Read error. Complain and punt. */ if (!buffer_uptodate(bh)) @@ -3052,7 +3052,8 @@ EXPORT_SYMBOL(submit_bh); /** * ll_rw_block: low-level access to block devices (DEPRECATED) - * @rw: whether to %READ or %WRITE or maybe %READA (readahead) + * @op: whether to %READ or %WRITE + * @op_flags: rq_flag_bits or %READA (readahead) * @nr: number of &struct buffer_heads in the array * @bhs: array of pointers to &struct buffer_head * @@ -3075,7 +3076,7 @@ EXPORT_SYMBOL(submit_bh); * All of the buffers must be for the same device, and must also be a * multiple of the current approved size for the device. */ -void ll_rw_block(int rw, int nr, struct buffer_head *bhs[]) +void ll_rw_block(int op, int op_flags, int nr, struct buffer_head *bhs[]) { int i; @@ -3084,18 +3085,18 @@ void ll_rw_block(int rw, int nr, struct buffer_head *bhs[]) if (!trylock_buffer(bh)) continue; - if (rw == WRITE) { + if (op == WRITE) { if (test_clear_buffer_dirty(bh)) { bh->b_end_io = end_buffer_write_sync; get_bh(bh); - submit_bh(rw, 0, bh); + submit_bh(op, op_flags, bh); continue; } } else { if (!buffer_uptodate(bh)) { bh->b_end_io = end_buffer_read_sync; get_bh(bh); - submit_bh(rw, 0, bh); + submit_bh(op, op_flags, bh); continue; } } diff --git a/fs/ext4/inode.c b/fs/ext4/inode.c index 8a91e98..d916f2c 100644 --- a/fs/ext4/inode.c +++ b/fs/ext4/inode.c @@ -838,7 +838,7 @@ struct buffer_head *ext4_bread(handle_t *handle, struct inode *inode, return bh; if (!bh || buffer_uptodate(bh)) return bh; - ll_rw_block(READ | REQ_META | REQ_PRIO, 1, &bh); + ll_rw_block(REQ_OP_READ, REQ_META | REQ_PRIO, 1, &bh); wait_on_buffer(bh); if (buffer_uptodate(bh)) return bh; @@ -992,7 +992,7 @@ static int ext4_block_write_begin(struct page *page, loff_t pos, unsigned len, if (!buffer_uptodate(bh) && !buffer_delay(bh) && !buffer_unwritten(bh) && (block_start < from || block_end > to)) { - ll_rw_block(READ, 1, &bh); + ll_rw_block(REQ_OP_READ, 0, 1, &bh); *wait_bh++ = bh; decrypt = ext4_encrypted_inode(inode) && S_ISREG(inode->i_mode); @@ -3541,7 +3541,7 @@ static int __ext4_block_zero_page_range(handle_t *handle, if (!buffer_uptodate(bh)) { err = -EIO; - ll_rw_block(READ, 1, &bh); + ll_rw_block(REQ_OP_READ, 0, 1, &bh); wait_on_buffer(bh); /* Uhhuh. Read error. Complain and punt. */ if (!buffer_uptodate(bh)) diff --git a/fs/ext4/namei.c b/fs/ext4/namei.c index 48e4b89..a03d2e6 100644 --- a/fs/ext4/namei.c +++ b/fs/ext4/namei.c @@ -1438,7 +1438,8 @@ restart: } bh_use[ra_max] = bh; if (bh) - ll_rw_block(READ | REQ_META | REQ_PRIO, + ll_rw_block(REQ_OP_READ, + REQ_META | REQ_PRIO, 1, &bh); } } diff --git a/fs/ext4/super.c b/fs/ext4/super.c index 9951dfe..23b706c 100644 --- a/fs/ext4/super.c +++ b/fs/ext4/super.c @@ -4201,7 +4201,7 @@ static journal_t *ext4_get_dev_journal(struct super_block *sb, goto out_bdev; } journal->j_private = sb; - ll_rw_block(READ | REQ_META | REQ_PRIO, 1, &journal->j_sb_buffer); + ll_rw_block(REQ_OP_READ, REQ_META | REQ_PRIO, 1, &journal->j_sb_buffer); wait_on_buffer(journal->j_sb_buffer); if (!buffer_uptodate(journal->j_sb_buffer)) { ext4_msg(sb, KERN_ERR, "I/O error on journal device"); diff --git a/fs/gfs2/bmap.c b/fs/gfs2/bmap.c index 29faf72..628d4a4 100644 --- a/fs/gfs2/bmap.c +++ b/fs/gfs2/bmap.c @@ -974,7 +974,7 @@ static int gfs2_block_truncate_page(struct address_space *mapping, loff_t from) if (!buffer_uptodate(bh)) { err = -EIO; - ll_rw_block(READ, 1, &bh); + ll_rw_block(REQ_OP_READ, 0, 1, &bh); wait_on_buffer(bh); /* Uhhuh. Read error. Complain and punt. */ if (!buffer_uptodate(bh)) diff --git a/fs/gfs2/meta_io.c b/fs/gfs2/meta_io.c index dc1c9db..96c8140 100644 --- a/fs/gfs2/meta_io.c +++ b/fs/gfs2/meta_io.c @@ -448,7 +448,7 @@ struct buffer_head *gfs2_meta_ra(struct gfs2_glock *gl, u64 dblock, u32 extlen) if (buffer_uptodate(first_bh)) goto out; if (!buffer_locked(first_bh)) - ll_rw_block(READ_SYNC | REQ_META, 1, &first_bh); + ll_rw_block(REQ_OP_READ, READ_SYNC | REQ_META, 1, &first_bh); dblock++; extlen--; @@ -457,7 +457,7 @@ struct buffer_head *gfs2_meta_ra(struct gfs2_glock *gl, u64 dblock, u32 extlen) bh = gfs2_getbuf(gl, dblock, CREATE); if (!buffer_uptodate(bh) && !buffer_locked(bh)) - ll_rw_block(READA | REQ_META, 1, &bh); + ll_rw_block(REQ_OP_READ, READA | REQ_META, 1, &bh); brelse(bh); dblock++; extlen--; diff --git a/fs/gfs2/quota.c b/fs/gfs2/quota.c index a398913..6ab01a6 100644 --- a/fs/gfs2/quota.c +++ b/fs/gfs2/quota.c @@ -730,7 +730,7 @@ static int gfs2_write_buf_to_page(struct gfs2_inode *ip, unsigned long index, if (PageUptodate(page)) set_buffer_uptodate(bh); if (!buffer_uptodate(bh)) { - ll_rw_block(READ | REQ_META, 1, &bh); + ll_rw_block(REQ_OP_READ, REQ_META, 1, &bh); wait_on_buffer(bh); if (!buffer_uptodate(bh)) goto unlock_out; diff --git a/fs/isofs/compress.c b/fs/isofs/compress.c index f311bf0..f9b5fc8 100644 --- a/fs/isofs/compress.c +++ b/fs/isofs/compress.c @@ -81,7 +81,7 @@ static loff_t zisofs_uncompress_block(struct inode *inode, loff_t block_start, blocknum = block_start >> bufshift; memset(bhs, 0, (needblocks + 1) * sizeof(struct buffer_head *)); haveblocks = isofs_get_blocks(inode, blocknum, bhs, needblocks); - ll_rw_block(READ, haveblocks, bhs); + ll_rw_block(REQ_OP_READ, 0, haveblocks, bhs); curbh = 0; curpage = 0; diff --git a/fs/jbd2/journal.c b/fs/jbd2/journal.c index a3e1776..8855f6b 100644 --- a/fs/jbd2/journal.c +++ b/fs/jbd2/journal.c @@ -1496,7 +1496,7 @@ static int journal_get_superblock(journal_t *journal) J_ASSERT(bh != NULL); if (!buffer_uptodate(bh)) { - ll_rw_block(READ, 1, &bh); + ll_rw_block(REQ_OP_READ, 0, 1, &bh); wait_on_buffer(bh); if (!buffer_uptodate(bh)) { printk(KERN_ERR diff --git a/fs/jbd2/recovery.c b/fs/jbd2/recovery.c index 08a456b..6daf0c9 100644 --- a/fs/jbd2/recovery.c +++ b/fs/jbd2/recovery.c @@ -104,7 +104,7 @@ static int do_readahead(journal_t *journal, unsigned int start) if (!buffer_uptodate(bh) && !buffer_locked(bh)) { bufs[nbufs++] = bh; if (nbufs == MAXBUF) { - ll_rw_block(READ, nbufs, bufs); + ll_rw_block(REQ_OP_READ, 0, nbufs, bufs); journal_brelse_array(bufs, nbufs); nbufs = 0; } @@ -113,7 +113,7 @@ static int do_readahead(journal_t *journal, unsigned int start) } if (nbufs) - ll_rw_block(READ, nbufs, bufs); + ll_rw_block(REQ_OP_READ, 0, nbufs, bufs); err = 0; failed: diff --git a/fs/ocfs2/aops.c b/fs/ocfs2/aops.c index 56ce370..3497947 100644 --- a/fs/ocfs2/aops.c +++ b/fs/ocfs2/aops.c @@ -640,7 +640,7 @@ int ocfs2_map_page_blocks(struct page *page, u64 *p_blkno, !buffer_new(bh) && ocfs2_should_read_blk(inode, page, block_start) && (block_start < from || block_end > to)) { - ll_rw_block(READ, 1, &bh); + ll_rw_block(REQ_OP_READ, 0, 1, &bh); *wait_bh++=bh; } diff --git a/fs/ocfs2/super.c b/fs/ocfs2/super.c index 7db631e..2bbf6b2 100644 --- a/fs/ocfs2/super.c +++ b/fs/ocfs2/super.c @@ -1819,7 +1819,7 @@ static int ocfs2_get_sector(struct super_block *sb, if (!buffer_dirty(*bh)) clear_buffer_uptodate(*bh); unlock_buffer(*bh); - ll_rw_block(READ, 1, bh); + ll_rw_block(REQ_OP_READ, 0, 1, bh); wait_on_buffer(*bh); if (!buffer_uptodate(*bh)) { mlog_errno(-EIO); diff --git a/fs/reiserfs/journal.c b/fs/reiserfs/journal.c index 688dce9..09682cc 100644 --- a/fs/reiserfs/journal.c +++ b/fs/reiserfs/journal.c @@ -870,7 +870,7 @@ loop_next: */ if (buffer_dirty(bh) && unlikely(bh->b_page->mapping == NULL)) { spin_unlock(lock); - ll_rw_block(WRITE, 1, &bh); + ll_rw_block(REQ_OP_WRITE, 0, 1, &bh); spin_lock(lock); } put_bh(bh); @@ -1057,7 +1057,7 @@ static int flush_commit_list(struct super_block *s, if (tbh) { if (buffer_dirty(tbh)) { depth = reiserfs_write_unlock_nested(s); - ll_rw_block(WRITE, 1, &tbh); + ll_rw_block(REQ_OP_WRITE, 0, 1, &tbh); reiserfs_write_lock_nested(s, depth); } put_bh(tbh) ; @@ -2244,7 +2244,7 @@ abort_replay: } } /* read in the log blocks, memcpy to the corresponding real block */ - ll_rw_block(READ, get_desc_trans_len(desc), log_blocks); + ll_rw_block(REQ_OP_READ, 0, get_desc_trans_len(desc), log_blocks); for (i = 0; i < get_desc_trans_len(desc); i++) { wait_on_buffer(log_blocks[i]); @@ -2346,7 +2346,7 @@ static struct buffer_head *reiserfs_breada(struct block_device *dev, } else bhlist[j++] = bh; } - ll_rw_block(READ, j, bhlist); + ll_rw_block(REQ_OP_READ, 0, j, bhlist); for (i = 1; i < j; i++) brelse(bhlist[i]); bh = bhlist[0]; diff --git a/fs/reiserfs/stree.c b/fs/reiserfs/stree.c index 24cbe01..5f9b6df 100644 --- a/fs/reiserfs/stree.c +++ b/fs/reiserfs/stree.c @@ -551,7 +551,7 @@ static int search_by_key_reada(struct super_block *s, if (!buffer_uptodate(bh[j])) { if (depth == -1) depth = reiserfs_write_unlock_nested(s); - ll_rw_block(READA, 1, bh + j); + ll_rw_block(REQ_OP_READ, READA, 1, bh + j); } brelse(bh[j]); } @@ -660,7 +660,7 @@ int search_by_key(struct super_block *sb, const struct cpu_key *key, if (!buffer_uptodate(bh) && depth == -1) depth = reiserfs_write_unlock_nested(sb); - ll_rw_block(READ, 1, &bh); + ll_rw_block(REQ_OP_READ, 0, 1, &bh); wait_on_buffer(bh); if (depth != -1) diff --git a/fs/reiserfs/super.c b/fs/reiserfs/super.c index b8f2d1e..9938a51 100644 --- a/fs/reiserfs/super.c +++ b/fs/reiserfs/super.c @@ -1661,7 +1661,7 @@ static int read_super_block(struct super_block *s, int offset) /* after journal replay, reread all bitmap and super blocks */ static int reread_meta_blocks(struct super_block *s) { - ll_rw_block(READ, 1, &SB_BUFFER_WITH_SB(s)); + ll_rw_block(REQ_OP_READ, 0, 1, &SB_BUFFER_WITH_SB(s)); wait_on_buffer(SB_BUFFER_WITH_SB(s)); if (!buffer_uptodate(SB_BUFFER_WITH_SB(s))) { reiserfs_warning(s, "reiserfs-2504", "error reading the super"); diff --git a/fs/squashfs/block.c b/fs/squashfs/block.c index 0cea9b9..59375be 100644 --- a/fs/squashfs/block.c +++ b/fs/squashfs/block.c @@ -124,7 +124,7 @@ int squashfs_read_data(struct super_block *sb, u64 index, int length, goto block_release; bytes += msblk->devblksize; } - ll_rw_block(READ, b, bh); + ll_rw_block(REQ_OP_READ, 0, b, bh); } else { /* * Metadata block. @@ -156,7 +156,7 @@ int squashfs_read_data(struct super_block *sb, u64 index, int length, goto block_release; bytes += msblk->devblksize; } - ll_rw_block(READ, b - 1, bh + 1); + ll_rw_block(REQ_OP_READ, 0, b - 1, bh + 1); } for (i = 0; i < b; i++) { diff --git a/fs/udf/dir.c b/fs/udf/dir.c index b51b371..cfadce0 100644 --- a/fs/udf/dir.c +++ b/fs/udf/dir.c @@ -113,7 +113,7 @@ static int udf_readdir(struct file *file, struct dir_context *ctx) brelse(tmp); } if (num) { - ll_rw_block(READA, num, bha); + ll_rw_block(REQ_OP_READ, READA, num, bha); for (i = 0; i < num; i++) brelse(bha[i]); } diff --git a/fs/udf/directory.c b/fs/udf/directory.c index c763fda..71f3e0b 100644 --- a/fs/udf/directory.c +++ b/fs/udf/directory.c @@ -87,7 +87,7 @@ struct fileIdentDesc *udf_fileident_read(struct inode *dir, loff_t *nf_pos, brelse(tmp); } if (num) { - ll_rw_block(READA, num, bha); + ll_rw_block(REQ_OP_READ, READA, num, bha); for (i = 0; i < num; i++) brelse(bha[i]); } diff --git a/fs/udf/inode.c b/fs/udf/inode.c index 166d3ed..757e63b 100644 --- a/fs/udf/inode.c +++ b/fs/udf/inode.c @@ -1200,7 +1200,7 @@ struct buffer_head *udf_bread(struct inode *inode, int block, if (buffer_uptodate(bh)) return bh; - ll_rw_block(READ, 1, &bh); + ll_rw_block(REQ_OP_READ, 0, 1, &bh); wait_on_buffer(bh); if (buffer_uptodate(bh)) diff --git a/fs/ufs/balloc.c b/fs/ufs/balloc.c index dc5fae6..26a3bb1 100644 --- a/fs/ufs/balloc.c +++ b/fs/ufs/balloc.c @@ -292,7 +292,7 @@ static void ufs_change_blocknr(struct inode *inode, sector_t beg, if (!buffer_mapped(bh)) map_bh(bh, inode->i_sb, oldb + pos); if (!buffer_uptodate(bh)) { - ll_rw_block(READ, 1, &bh); + ll_rw_block(REQ_OP_READ, 0, 1, &bh); wait_on_buffer(bh); if (!buffer_uptodate(bh)) { ufs_error(inode->i_sb, __func__, diff --git a/include/linux/buffer_head.h b/include/linux/buffer_head.h index 72ad52d..9ab27bb 100644 --- a/include/linux/buffer_head.h +++ b/include/linux/buffer_head.h @@ -187,7 +187,7 @@ struct buffer_head *alloc_buffer_head(gfp_t gfp_flags); void free_buffer_head(struct buffer_head * bh); void unlock_buffer(struct buffer_head *bh); void __lock_buffer(struct buffer_head *bh); -void ll_rw_block(int, int, struct buffer_head * bh[]); +void ll_rw_block(int, int, int, struct buffer_head * bh[]); int sync_dirty_buffer(struct buffer_head *bh); int __sync_dirty_buffer(struct buffer_head *bh, int op_flags); void write_dirty_buffer(struct buffer_head *bh, int op_flags); -- 1.8.3.1 From mchristi@redhat.com Wed Feb 24 13:48:47 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=ham version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay3.corp.sgi.com [198.149.34.15]) by oss.sgi.com (Postfix) with ESMTP id 2FADA7CB9 for ; Wed, 24 Feb 2016 13:48:47 -0600 (CST) Received: from cuda.sgi.com (cuda3.sgi.com [192.48.176.15]) by relay3.corp.sgi.com (Postfix) with ESMTP id 783DFAC002 for ; Wed, 24 Feb 2016 11:48:34 -0800 (PST) X-ASG-Debug-ID: 1456343311-04cb6c455cd58f0001-NocioJ Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by cuda.sgi.com with ESMTP id Kx0gJkjTkP0pYLGN (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO) for ; Wed, 24 Feb 2016 11:48:32 -0800 (PST) X-Barracuda-Envelope-From: mchristi@redhat.com X-Barracuda-Apparent-Source-IP: 209.132.183.28 X-ASG-Whitelist: Client Received: from int-mx09.intmail.prod.int.phx2.redhat.com (int-mx09.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by mx1.redhat.com (Postfix) with ESMTPS id ABAD17F085; Wed, 24 Feb 2016 19:48:31 +0000 (UTC) Received: from rh2.redhat.com (vpn-54-14.rdu2.redhat.com [10.10.54.14]) by int-mx09.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id u1OJmJE8006684; Wed, 24 Feb 2016 14:48:29 -0500 From: mchristi@redhat.com To: linux-f2fs-devel@lists.sourceforge.net, linux-ext4@vger.kernel.org, konrad.wilk@oracle.com, drbd-dev@lists.linbit.com, philipp.reisner@linbit.com, lars.ellenberg@linbit.com, linux-raid@vger.kernel.org, dm-devel@redhat.com, linux-fsdevel@vger.kernel.org, linux-bcache@vger.kernel.org, linux-block@vger.kernel.org, linux-kernel@vger.kernel.org, linux-scsi@vger.kernel.org, linux-mtd@lists.infradead.org, target-devel@vger.kernel.org, linux-btrfs@vger.kernel.org, osd-dev@open-osd.org, xfs@oss.sgi.com, ocfs2-devel@oss.oracle.com Cc: Mike Christie Subject: [PATCH 03/35] block, fs, mm, drivers: set bi_op to REQ_OP Date: Wed, 24 Feb 2016 13:47:40 -0600 X-ASG-Orig-Subj: [PATCH 03/35] block, fs, mm, drivers: set bi_op to REQ_OP Message-Id: <1456343292-14535-4-git-send-email-mchristi@redhat.com> In-Reply-To: <1456343292-14535-1-git-send-email-mchristi@redhat.com> References: <1456343292-14535-1-git-send-email-mchristi@redhat.com> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.22 X-Barracuda-Connect: mx1.redhat.com[209.132.183.28] X-Barracuda-Start-Time: 1456343312 X-Barracuda-Encrypted: ECDHE-RSA-AES256-GCM-SHA384 X-Barracuda-URL: https://192.48.176.15:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-BRTS-Status: 1 From: Mike Christie This patch converts the simple bi_rw use cases in the block, drivers, mm and fs code to use bi_op for a REQ_OP and bi_rw for rq_flag_bits. These should be simple one liner cases, so I just did them in one patch. The next patches handle the more complicated cases in a module per patch. Signed-off-by: Mike Christie --- block/bio.c | 8 +++++--- block/blk-flush.c | 1 + block/blk-lib.c | 7 ++++--- block/blk-map.c | 2 +- drivers/block/floppy.c | 2 +- drivers/block/pktcdvd.c | 4 ++-- drivers/lightnvm/rrpc.c | 4 ++-- drivers/scsi/osd/osd_initiator.c | 8 ++++---- fs/exofs/ore.c | 2 +- fs/ext4/crypto.c | 2 +- fs/ext4/page-io.c | 8 +++++--- fs/ext4/readpage.c | 2 +- fs/jfs/jfs_logmgr.c | 2 ++ fs/jfs/jfs_metapage.c | 4 ++-- fs/logfs/dev_bdev.c | 12 ++++++------ fs/nfs/blocklayout/blocklayout.c | 2 +- mm/page_io.c | 4 ++-- 17 files changed, 41 insertions(+), 33 deletions(-) diff --git a/block/bio.c b/block/bio.c index 7e4d050..68df2df 100644 --- a/block/bio.c +++ b/block/bio.c @@ -581,6 +581,7 @@ void __bio_clone_fast(struct bio *bio, struct bio *bio_src) */ bio->bi_bdev = bio_src->bi_bdev; bio_set_flag(bio, BIO_CLONED); + bio->bi_op = bio_src->bi_op; bio->bi_rw = bio_src->bi_rw; bio->bi_iter = bio_src->bi_iter; bio->bi_io_vec = bio_src->bi_io_vec; @@ -663,6 +664,7 @@ struct bio *bio_clone_bioset(struct bio *bio_src, gfp_t gfp_mask, return NULL; bio->bi_bdev = bio_src->bi_bdev; + bio->bi_op = bio_src->bi_op; bio->bi_rw = bio_src->bi_rw; bio->bi_iter.bi_sector = bio_src->bi_iter.bi_sector; bio->bi_iter.bi_size = bio_src->bi_iter.bi_size; @@ -1171,7 +1173,7 @@ struct bio *bio_copy_user_iov(struct request_queue *q, goto out_bmd; if (iter->type & WRITE) - bio->bi_rw |= REQ_WRITE; + bio->bi_op = REQ_OP_WRITE; ret = 0; @@ -1341,7 +1343,7 @@ struct bio *bio_map_user_iov(struct request_queue *q, * set data direction, and check if mapped pages need bouncing */ if (iter->type & WRITE) - bio->bi_rw |= REQ_WRITE; + bio->bi_op = REQ_OP_WRITE; bio_set_flag(bio, BIO_USER_MAPPED); @@ -1534,7 +1536,7 @@ struct bio *bio_copy_kern(struct request_queue *q, void *data, unsigned int len, bio->bi_private = data; } else { bio->bi_end_io = bio_copy_kern_endio; - bio->bi_rw |= REQ_WRITE; + bio->bi_op = REQ_OP_WRITE; } return bio; diff --git a/block/blk-flush.c b/block/blk-flush.c index f2fbf9a..b05acca 100644 --- a/block/blk-flush.c +++ b/block/blk-flush.c @@ -484,6 +484,7 @@ int blkdev_issue_flush(struct block_device *bdev, gfp_t gfp_mask, bio = bio_alloc(gfp_mask, 0); bio->bi_bdev = bdev; + bio->bi_op = REQ_OP_WRITE; bio->bi_rw = WRITE_FLUSH; ret = submit_bio_wait(bio); diff --git a/block/blk-lib.c b/block/blk-lib.c index 87e3de4..d01b5f2 100644 --- a/block/blk-lib.c +++ b/block/blk-lib.c @@ -42,7 +42,7 @@ int blkdev_issue_discard(struct block_device *bdev, sector_t sector, { DECLARE_COMPLETION_ONSTACK(wait); struct request_queue *q = bdev_get_queue(bdev); - int type = REQ_WRITE | REQ_DISCARD; + int type = 0; unsigned int granularity; int alignment; struct bio_batch bb; @@ -102,6 +102,7 @@ int blkdev_issue_discard(struct block_device *bdev, sector_t sector, bio->bi_end_io = bio_batch_end_io; bio->bi_bdev = bdev; bio->bi_private = &bb; + bio->bi_op = REQ_OP_DISCARD; bio->bi_rw = type; bio->bi_iter.bi_size = req_sects << 9; @@ -178,7 +179,7 @@ int blkdev_issue_write_same(struct block_device *bdev, sector_t sector, bio->bi_io_vec->bv_page = page; bio->bi_io_vec->bv_offset = 0; bio->bi_io_vec->bv_len = bdev_logical_block_size(bdev); - bio->bi_rw = REQ_WRITE | REQ_WRITE_SAME; + bio->bi_op = REQ_OP_WRITE_SAME; if (nr_sects > max_write_same_sectors) { bio->bi_iter.bi_size = max_write_same_sectors << 9; @@ -240,7 +241,7 @@ static int __blkdev_issue_zeroout(struct block_device *bdev, sector_t sector, bio->bi_bdev = bdev; bio->bi_end_io = bio_batch_end_io; bio->bi_private = &bb; - bio->bi_rw = WRITE; + bio->bi_op = REQ_OP_WRITE; while (nr_sects != 0) { sz = min((sector_t) PAGE_SIZE >> 9 , nr_sects); diff --git a/block/blk-map.c b/block/blk-map.c index f565e11..9021a8f 100644 --- a/block/blk-map.c +++ b/block/blk-map.c @@ -224,7 +224,7 @@ int blk_rq_map_kern(struct request_queue *q, struct request *rq, void *kbuf, return PTR_ERR(bio); if (!reading) - bio->bi_rw |= REQ_WRITE; + bio->bi_op = REQ_OP_WRITE; if (do_copy) rq->cmd_flags |= REQ_COPY_USER; diff --git a/drivers/block/floppy.c b/drivers/block/floppy.c index 73ded25..84b1584 100644 --- a/drivers/block/floppy.c +++ b/drivers/block/floppy.c @@ -3822,7 +3822,7 @@ static int __floppy_read_block_0(struct block_device *bdev, int drive) bio.bi_flags |= (1 << BIO_QUIET); bio.bi_private = &cbdata; bio.bi_end_io = floppy_rb0_cb; - bio.bi_rw = READ; + bio.bi_op = REQ_OP_READ; submit_bio(&bio); process_fd_request(); diff --git a/drivers/block/pktcdvd.c b/drivers/block/pktcdvd.c index d06c62e..a4ecbd3 100644 --- a/drivers/block/pktcdvd.c +++ b/drivers/block/pktcdvd.c @@ -1074,7 +1074,7 @@ static void pkt_gather_data(struct pktcdvd_device *pd, struct packet_data *pkt) BUG(); atomic_inc(&pkt->io_wait); - bio->bi_rw = READ; + bio->bi_op = REQ_OP_READ; pkt_queue_bio(pd, bio); frames_read++; } @@ -1336,7 +1336,7 @@ static void pkt_start_write(struct pktcdvd_device *pd, struct packet_data *pkt) /* Start the write request */ atomic_set(&pkt->io_wait, 1); - pkt->w_bio->bi_rw = WRITE; + pkt->w_bio->bi_op = REQ_OP_WRITE; pkt_queue_bio(pd, pkt->w_bio); } diff --git a/drivers/lightnvm/rrpc.c b/drivers/lightnvm/rrpc.c index 307db1e..c509477 100644 --- a/drivers/lightnvm/rrpc.c +++ b/drivers/lightnvm/rrpc.c @@ -332,7 +332,7 @@ try: /* Perform read to do GC */ bio->bi_iter.bi_sector = rrpc_get_sector(rev->addr); - bio->bi_rw = READ; + bio->bi_op = REQ_OP_READ; bio->bi_private = &wait; bio->bi_end_io = rrpc_end_sync_bio; @@ -354,7 +354,7 @@ try: reinit_completion(&wait); bio->bi_iter.bi_sector = rrpc_get_sector(rev->addr); - bio->bi_rw = WRITE; + bio->bi_op = REQ_OP_WRITE; bio->bi_private = &wait; bio->bi_end_io = rrpc_end_sync_bio; diff --git a/drivers/scsi/osd/osd_initiator.c b/drivers/scsi/osd/osd_initiator.c index d8a2b51..4e7b440 100644 --- a/drivers/scsi/osd/osd_initiator.c +++ b/drivers/scsi/osd/osd_initiator.c @@ -726,7 +726,7 @@ static int _osd_req_list_objects(struct osd_request *or, return PTR_ERR(bio); } - bio->bi_rw &= ~REQ_WRITE; + bio->bi_op = REQ_OP_READ; or->in.bio = bio; or->in.total_bytes = bio->bi_iter.bi_size; return 0; @@ -839,7 +839,7 @@ int osd_req_write_kern(struct osd_request *or, if (IS_ERR(bio)) return PTR_ERR(bio); - bio->bi_rw |= REQ_WRITE; /* FIXME: bio_set_dir() */ + bio->bi_op = REQ_OP_WRITE; osd_req_write(or, obj, offset, bio, len); return 0; } @@ -956,7 +956,7 @@ static int _osd_req_finalize_cdb_cont(struct osd_request *or, const u8 *cap_key) if (IS_ERR(bio)) return PTR_ERR(bio); - bio->bi_rw |= REQ_WRITE; + bio->bi_op = REQ_OP_WRITE; /* integrity check the continuation before the bio is linked * with the other data segments since the continuation @@ -1077,7 +1077,7 @@ int osd_req_write_sg_kern(struct osd_request *or, if (IS_ERR(bio)) return PTR_ERR(bio); - bio->bi_rw |= REQ_WRITE; + bio->bi_op = REQ_OP_WRITE; osd_req_write_sg(or, obj, bio, sglist, numentries); return 0; diff --git a/fs/exofs/ore.c b/fs/exofs/ore.c index 7bd8ac8..c40ed74 100644 --- a/fs/exofs/ore.c +++ b/fs/exofs/ore.c @@ -878,7 +878,7 @@ static int _write_mirror(struct ore_io_state *ios, int cur_comp) } else { bio = master_dev->bio; /* FIXME: bio_set_dir() */ - bio->bi_rw |= REQ_WRITE; + bio->bi_op = REQ_OP_WRITE; } osd_req_write(or, _ios_obj(ios, cur_comp), diff --git a/fs/ext4/crypto.c b/fs/ext4/crypto.c index 18b8893..1d4ab0c 100644 --- a/fs/ext4/crypto.c +++ b/fs/ext4/crypto.c @@ -422,7 +422,7 @@ int ext4_encrypted_zeroout(struct inode *inode, ext4_lblk_t lblk, bio->bi_bdev = inode->i_sb->s_bdev; bio->bi_iter.bi_sector = pblk << (inode->i_sb->s_blocksize_bits - 9); - bio->bi_rw = WRITE; + bio->bi_op = REQ_OP_WRITE; ret = bio_add_page(bio, ciphertext_page, inode->i_sb->s_blocksize, 0); if (ret != inode->i_sb->s_blocksize) { diff --git a/fs/ext4/page-io.c b/fs/ext4/page-io.c index cf63ac3..046863c 100644 --- a/fs/ext4/page-io.c +++ b/fs/ext4/page-io.c @@ -353,10 +353,12 @@ void ext4_io_submit(struct ext4_io_submit *io) struct bio *bio = io->io_bio; if (bio) { - int io_op = io->io_wbc->sync_mode == WB_SYNC_ALL ? - WRITE_SYNC : WRITE; + int io_op_flags = io->io_wbc->sync_mode == WB_SYNC_ALL ? + WRITE_SYNC : 0; + bio_get(io->io_bio); - io->io_bio->bi_rw = io_op; + io->io_bio->bi_op = REQ_OP_WRITE; + io->io_bio->bi_rw = io_op_flags; submit_bio(io->io_bio); bio_put(io->io_bio); } diff --git a/fs/ext4/readpage.c b/fs/ext4/readpage.c index 893dc15..fb36434 100644 --- a/fs/ext4/readpage.c +++ b/fs/ext4/readpage.c @@ -294,7 +294,7 @@ int ext4_mpage_readpages(struct address_space *mapping, bio->bi_iter.bi_sector = blocks[0] << (blkbits - 9); bio->bi_end_io = mpage_end_io; bio->bi_private = ctx; - bio->bi_rw = READ; + bio->bi_op = REQ_OP_READ; } length = first_hole << blkbits; diff --git a/fs/jfs/jfs_logmgr.c b/fs/jfs/jfs_logmgr.c index b0e068f..00227f8 100644 --- a/fs/jfs/jfs_logmgr.c +++ b/fs/jfs/jfs_logmgr.c @@ -2004,6 +2004,7 @@ static int lbmRead(struct jfs_log * log, int pn, struct lbuf ** bpp) bio->bi_end_io = lbmIODone; bio->bi_private = bp; + bio->bi_op = REQ_OP_READ; bio->bi_rw = READ_SYNC; /*check if journaling to disk has been disabled*/ if (log->no_integrity) { @@ -2148,6 +2149,7 @@ static void lbmStartIO(struct lbuf * bp) bio->bi_end_io = lbmIODone; bio->bi_private = bp; + bio->bi_op = REQ_OP_WRITE; bio->bi_rw = WRITE_SYNC; /* check if journaling to disk has been disabled */ diff --git a/fs/jfs/jfs_metapage.c b/fs/jfs/jfs_metapage.c index bc29972..115d99e 100644 --- a/fs/jfs/jfs_metapage.c +++ b/fs/jfs/jfs_metapage.c @@ -434,7 +434,7 @@ static int metapage_writepage(struct page *page, struct writeback_control *wbc) bio->bi_iter.bi_sector = pblock << (inode->i_blkbits - 9); bio->bi_end_io = metapage_write_end_io; bio->bi_private = page; - bio->bi_rw = WRITE; + bio->bi_op = REQ_OP_WRITE; /* Don't call bio_add_page yet, we may add to this vec */ bio_offset = offset; @@ -515,7 +515,7 @@ static int metapage_readpage(struct file *fp, struct page *page) pblock << (inode->i_blkbits - 9); bio->bi_end_io = metapage_read_end_io; bio->bi_private = page; - bio->bi_rw = READ; + bio->bi_op = REQ_OP_READ; len = xlen << inode->i_blkbits; offset = block_offset << inode->i_blkbits; if (bio_add_page(bio, page, len, offset) < len) diff --git a/fs/logfs/dev_bdev.c b/fs/logfs/dev_bdev.c index 9e690ad..130b7e2 100644 --- a/fs/logfs/dev_bdev.c +++ b/fs/logfs/dev_bdev.c @@ -14,7 +14,7 @@ #define PAGE_OFS(ofs) ((ofs) & (PAGE_SIZE-1)) -static int sync_request(struct page *page, struct block_device *bdev, int rw) +static int sync_request(struct page *page, struct block_device *bdev, int op) { struct bio bio; struct bio_vec bio_vec; @@ -29,7 +29,7 @@ static int sync_request(struct page *page, struct block_device *bdev, int rw) bio.bi_bdev = bdev; bio.bi_iter.bi_sector = page->index * (PAGE_SIZE >> 9); bio.bi_iter.bi_size = PAGE_SIZE; - bio.bi_rw = rw; + bio.bi_op = op; return submit_bio_wait(&bio); } @@ -96,7 +96,7 @@ static int __bdev_writeseg(struct super_block *sb, u64 ofs, pgoff_t index, bio->bi_iter.bi_sector = ofs >> 9; bio->bi_private = sb; bio->bi_end_io = writeseg_end_io; - bio->bi_rw = WRITE; + bio->bi_op = REQ_OP_WRITE; atomic_inc(&super->s_pending_writes); submit_bio(bio); @@ -124,7 +124,7 @@ static int __bdev_writeseg(struct super_block *sb, u64 ofs, pgoff_t index, bio->bi_iter.bi_sector = ofs >> 9; bio->bi_private = sb; bio->bi_end_io = writeseg_end_io; - bio->bi_rw = WRITE; + bio->bi_op = REQ_OP_WRITE; atomic_inc(&super->s_pending_writes); submit_bio(bio); return 0; @@ -188,7 +188,7 @@ static int do_erase(struct super_block *sb, u64 ofs, pgoff_t index, bio->bi_iter.bi_sector = ofs >> 9; bio->bi_private = sb; bio->bi_end_io = erase_end_io; - bio->bi_rw = WRITE; + bio->bi_op = REQ_OP_WRITE; atomic_inc(&super->s_pending_writes); submit_bio(bio); @@ -210,7 +210,7 @@ static int do_erase(struct super_block *sb, u64 ofs, pgoff_t index, bio->bi_iter.bi_sector = ofs >> 9; bio->bi_private = sb; bio->bi_end_io = erase_end_io; - bio->bi_rw = WRITE; + bio->bi_op = REQ_OP_WRITE; atomic_inc(&super->s_pending_writes); submit_bio(bio); return 0; diff --git a/fs/nfs/blocklayout/blocklayout.c b/fs/nfs/blocklayout/blocklayout.c index 8c0443c..3832909 100644 --- a/fs/nfs/blocklayout/blocklayout.c +++ b/fs/nfs/blocklayout/blocklayout.c @@ -175,7 +175,7 @@ retry: disk_addr >> SECTOR_SHIFT, end_io, par); if (!bio) return ERR_PTR(-ENOMEM); - bio->bi_rw = rw; + bio->bi_op = rw; } if (bio_add_page(bio, page, *len, offset) < *len) { bio = bl_submit_bio(bio); diff --git a/mm/page_io.c b/mm/page_io.c index e8a18a7..e48b84c 100644 --- a/mm/page_io.c +++ b/mm/page_io.c @@ -311,7 +311,7 @@ int __swap_writepage(struct page *page, struct writeback_control *wbc, ret = -ENOMEM; goto out; } - bio->bi_rw = WRITE; + bio->bi_op = REQ_OP_WRITE; if (wbc->sync_mode == WB_SYNC_ALL) bio->bi_rw |= REQ_SYNC; count_vm_event(PSWPOUT); @@ -359,7 +359,7 @@ int swap_readpage(struct page *page) ret = -ENOMEM; goto out; } - bio->bi_rw = READ; + bio->bi_op = REQ_OP_READ; count_vm_event(PSWPIN); submit_bio(bio); out: -- 1.8.3.1 From mchristi@redhat.com Wed Feb 24 13:48:50 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=ham version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay3.corp.sgi.com [198.149.34.15]) by oss.sgi.com (Postfix) with ESMTP id 5265B7F37 for ; Wed, 24 Feb 2016 13:48:48 -0600 (CST) Received: from cuda.sgi.com (cuda3.sgi.com [192.48.176.15]) by relay3.corp.sgi.com (Postfix) with ESMTP id A8CACAC006 for ; Wed, 24 Feb 2016 11:48:41 -0800 (PST) X-ASG-Debug-ID: 1456343319-04cb6c455cd5920001-NocioJ Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by cuda.sgi.com with ESMTP id pjwPBVBiG4gmKWF0 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO) for ; Wed, 24 Feb 2016 11:48:40 -0800 (PST) X-Barracuda-Envelope-From: mchristi@redhat.com X-Barracuda-Apparent-Source-IP: 209.132.183.28 X-ASG-Whitelist: Client Received: from int-mx09.intmail.prod.int.phx2.redhat.com (int-mx09.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by mx1.redhat.com (Postfix) with ESMTPS id A050EC000719; Wed, 24 Feb 2016 19:48:39 +0000 (UTC) Received: from rh2.redhat.com (vpn-54-14.rdu2.redhat.com [10.10.54.14]) by int-mx09.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id u1OJmJEB006684; Wed, 24 Feb 2016 14:48:37 -0500 From: mchristi@redhat.com To: linux-f2fs-devel@lists.sourceforge.net, linux-ext4@vger.kernel.org, konrad.wilk@oracle.com, drbd-dev@lists.linbit.com, philipp.reisner@linbit.com, lars.ellenberg@linbit.com, linux-raid@vger.kernel.org, dm-devel@redhat.com, linux-fsdevel@vger.kernel.org, linux-bcache@vger.kernel.org, linux-block@vger.kernel.org, linux-kernel@vger.kernel.org, linux-scsi@vger.kernel.org, linux-mtd@lists.infradead.org, target-devel@vger.kernel.org, linux-btrfs@vger.kernel.org, osd-dev@open-osd.org, xfs@oss.sgi.com, ocfs2-devel@oss.oracle.com Cc: Mike Christie Subject: [PATCH 06/35] direct-io: set bi_op to REQ_OP Date: Wed, 24 Feb 2016 13:47:43 -0600 X-ASG-Orig-Subj: [PATCH 06/35] direct-io: set bi_op to REQ_OP Message-Id: <1456343292-14535-7-git-send-email-mchristi@redhat.com> In-Reply-To: <1456343292-14535-1-git-send-email-mchristi@redhat.com> References: <1456343292-14535-1-git-send-email-mchristi@redhat.com> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.22 X-Barracuda-Connect: mx1.redhat.com[209.132.183.28] X-Barracuda-Start-Time: 1456343320 X-Barracuda-Encrypted: ECDHE-RSA-AES256-GCM-SHA384 X-Barracuda-URL: https://192.48.176.15:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-BRTS-Status: 1 From: Mike Christie This patch has the dio code set the bio bi_op to a REQ_OP. It also begins to convert btrfs's dio_submit_t related code, because of the submit_io callout use. In the btrfs_submit_direct change, I OR'd the op and flag back together. It is only temporary. The next patch will completely convert all the btrfs code paths. Signed-off-by: Mike Christie --- fs/btrfs/inode.c | 9 +++++---- fs/direct-io.c | 35 +++++++++++++++++++++-------------- include/linux/fs.h | 2 +- 3 files changed, 27 insertions(+), 19 deletions(-) diff --git a/fs/btrfs/inode.c b/fs/btrfs/inode.c index 25dcff7..3a7fe66 100644 --- a/fs/btrfs/inode.c +++ b/fs/btrfs/inode.c @@ -8380,14 +8380,14 @@ out_err: return 0; } -static void btrfs_submit_direct(int rw, struct bio *dio_bio, - struct inode *inode, loff_t file_offset) +static void btrfs_submit_direct(struct bio *dio_bio, struct inode *inode, + loff_t file_offset) { struct btrfs_dio_private *dip = NULL; struct bio *io_bio = NULL; struct btrfs_io_bio *btrfs_bio; int skip_sum; - int write = rw & REQ_WRITE; + bool write = (dio_bio->bi_op == REQ_OP_WRITE); int ret = 0; skip_sum = BTRFS_I(inode)->flags & BTRFS_INODE_NODATASUM; @@ -8438,7 +8438,8 @@ static void btrfs_submit_direct(int rw, struct bio *dio_bio, dio_data->unsubmitted_oe_range_end; } - ret = btrfs_submit_direct_hook(rw, dip, skip_sum); + ret = btrfs_submit_direct_hook(dio_bio->bi_op | dio_bio->bi_rw, dip, + skip_sum); if (!ret) return; diff --git a/fs/direct-io.c b/fs/direct-io.c index 1bce5c3..7cabf74 100644 --- a/fs/direct-io.c +++ b/fs/direct-io.c @@ -108,7 +108,8 @@ struct dio_submit { /* dio_state communicated between submission path and end_io */ struct dio { int flags; /* doesn't change */ - int rw; + int op; + int op_flags; blk_qc_t bio_cookie; struct block_device *bio_bdev; struct inode *inode; @@ -163,7 +164,7 @@ static inline int dio_refill_pages(struct dio *dio, struct dio_submit *sdio) ret = iov_iter_get_pages(sdio->iter, dio->pages, LONG_MAX, DIO_PAGES, &sdio->from); - if (ret < 0 && sdio->blocks_available && (dio->rw & WRITE)) { + if (ret < 0 && sdio->blocks_available && (dio->op == REQ_OP_WRITE)) { struct page *page = ZERO_PAGE(0); /* * A memory fault, but the filesystem has some outstanding @@ -242,7 +243,8 @@ static ssize_t dio_complete(struct dio *dio, loff_t offset, ssize_t ret, transferred = dio->result; /* Check for short read case */ - if ((dio->rw == READ) && ((offset + transferred) > dio->i_size)) + if ((dio->op == REQ_OP_READ) && + ((offset + transferred) > dio->i_size)) transferred = dio->i_size - offset; } @@ -265,7 +267,7 @@ static ssize_t dio_complete(struct dio *dio, loff_t offset, ssize_t ret, inode_dio_end(dio->inode); if (is_async) { - if (dio->rw & WRITE) { + if (dio->op == REQ_OP_WRITE) { int err; err = generic_write_sync(dio->iocb->ki_filp, offset, @@ -374,7 +376,8 @@ dio_bio_alloc(struct dio *dio, struct dio_submit *sdio, bio->bi_bdev = bdev; bio->bi_iter.bi_sector = first_sector; - bio->bi_rw = dio->rw; + bio->bi_op = dio->op; + bio->bi_rw = dio->op_flags; if (dio->is_async) bio->bi_end_io = dio_bio_end_aio; else @@ -402,14 +405,13 @@ static inline void dio_bio_submit(struct dio *dio, struct dio_submit *sdio) dio->refcount++; spin_unlock_irqrestore(&dio->bio_lock, flags); - if (dio->is_async && dio->rw == READ && dio->should_dirty) + if (dio->is_async && dio->op == REQ_OP_READ && dio->should_dirty) bio_set_pages_dirty(bio); dio->bio_bdev = bio->bi_bdev; if (sdio->submit_io) { - sdio->submit_io(dio->rw, bio, dio->inode, - sdio->logical_offset_in_bio); + sdio->submit_io(bio, dio->inode, sdio->logical_offset_in_bio); dio->bio_cookie = BLK_QC_T_NONE; } else dio->bio_cookie = submit_bio(bio); @@ -477,14 +479,14 @@ static int dio_bio_complete(struct dio *dio, struct bio *bio) if (bio->bi_error) dio->io_error = -EIO; - if (dio->is_async && dio->rw == READ && dio->should_dirty) { + if (dio->is_async && dio->op == REQ_OP_READ && dio->should_dirty) { err = bio->bi_error; bio_check_pages_dirty(bio); /* transfers ownership */ } else { bio_for_each_segment_all(bvec, bio, i) { struct page *page = bvec->bv_page; - if (dio->rw == READ && !PageCompound(page) && + if (dio->op == REQ_OP_READ && !PageCompound(page) && dio->should_dirty) set_page_dirty_lock(page); page_cache_release(page); @@ -637,7 +639,7 @@ static int get_more_blocks(struct dio *dio, struct dio_submit *sdio, * which may decide to handle it or also return an unmapped * buffer head. */ - create = dio->rw & WRITE; + create = dio->op == REQ_OP_WRITE; if (dio->flags & DIO_SKIP_HOLES) { if (sdio->block_in_file < (i_size_read(dio->inode) >> sdio->blkbits)) @@ -787,7 +789,7 @@ submit_page_section(struct dio *dio, struct dio_submit *sdio, struct page *page, { int ret = 0; - if (dio->rw & WRITE) { + if (dio->op == REQ_OP_WRITE) { /* * Read accounting is performed in submit_bio() */ @@ -987,7 +989,7 @@ do_holes: loff_t i_size_aligned; /* AKPM: eargh, -ENOTBLK is a hack */ - if (dio->rw & WRITE) { + if (dio->op == REQ_OP_WRITE) { page_cache_release(page); return -ENOTBLK; } @@ -1200,7 +1202,12 @@ do_blockdev_direct_IO(struct kiocb *iocb, struct inode *inode, dio->is_async = true; dio->inode = inode; - dio->rw = iov_iter_rw(iter) == WRITE ? WRITE_ODIRECT : READ; + if (iov_iter_rw(iter) == WRITE) { + dio->op = REQ_OP_WRITE; + dio->op_flags = WRITE_ODIRECT; + } else { + dio->op = REQ_OP_READ; + } /* * For AIO O_(D)SYNC writes we need to defer completions to a workqueue diff --git a/include/linux/fs.h b/include/linux/fs.h index 399b22b..beabae8 100644 --- a/include/linux/fs.h +++ b/include/linux/fs.h @@ -2774,7 +2774,7 @@ extern int generic_file_open(struct inode * inode, struct file * filp); extern int nonseekable_open(struct inode * inode, struct file * filp); #ifdef CONFIG_BLOCK -typedef void (dio_submit_t)(int rw, struct bio *bio, struct inode *inode, +typedef void (dio_submit_t)(struct bio *bio, struct inode *inode, loff_t file_offset); enum { -- 1.8.3.1 From mchristi@redhat.com Wed Feb 24 13:48:47 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=ham version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay3.corp.sgi.com [198.149.34.15]) by oss.sgi.com (Postfix) with ESMTP id 3809C7CBA for ; Wed, 24 Feb 2016 13:48:47 -0600 (CST) Received: from cuda.sgi.com (cuda1.sgi.com [192.48.157.11]) by relay3.corp.sgi.com (Postfix) with ESMTP id A468CAC005 for ; Wed, 24 Feb 2016 11:48:37 -0800 (PST) X-ASG-Debug-ID: 1456343314-04bdf07ab613a770001-NocioJ Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by cuda.sgi.com with ESMTP id F4H5tPszy015dSpV (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO) for ; Wed, 24 Feb 2016 11:48:34 -0800 (PST) X-Barracuda-Envelope-From: mchristi@redhat.com X-Barracuda-Apparent-Source-IP: 209.132.183.28 X-ASG-Whitelist: Client Received: from int-mx09.intmail.prod.int.phx2.redhat.com (int-mx09.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by mx1.redhat.com (Postfix) with ESMTPS id 587CE8F4F0; Wed, 24 Feb 2016 19:48:34 +0000 (UTC) Received: from rh2.redhat.com (vpn-54-14.rdu2.redhat.com [10.10.54.14]) by int-mx09.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id u1OJmJE9006684; Wed, 24 Feb 2016 14:48:31 -0500 From: mchristi@redhat.com To: linux-f2fs-devel@lists.sourceforge.net, linux-ext4@vger.kernel.org, konrad.wilk@oracle.com, drbd-dev@lists.linbit.com, philipp.reisner@linbit.com, lars.ellenberg@linbit.com, linux-raid@vger.kernel.org, dm-devel@redhat.com, linux-fsdevel@vger.kernel.org, linux-bcache@vger.kernel.org, linux-block@vger.kernel.org, linux-kernel@vger.kernel.org, linux-scsi@vger.kernel.org, linux-mtd@lists.infradead.org, target-devel@vger.kernel.org, linux-btrfs@vger.kernel.org, osd-dev@open-osd.org, xfs@oss.sgi.com, ocfs2-devel@oss.oracle.com Cc: Mike Christie Subject: [PATCH 04/35] fs: have submit_bh users pass in op and flags separately Date: Wed, 24 Feb 2016 13:47:41 -0600 X-ASG-Orig-Subj: [PATCH 04/35] fs: have submit_bh users pass in op and flags separately Message-Id: <1456343292-14535-5-git-send-email-mchristi@redhat.com> In-Reply-To: <1456343292-14535-1-git-send-email-mchristi@redhat.com> References: <1456343292-14535-1-git-send-email-mchristi@redhat.com> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.22 X-Barracuda-Connect: mx1.redhat.com[209.132.183.28] X-Barracuda-Start-Time: 1456343314 X-Barracuda-Encrypted: ECDHE-RSA-AES256-GCM-SHA384 X-Barracuda-URL: https://192.48.157.11:443/cgi-mod/mark.cgi X-Barracuda-BRTS-Status: 1 X-Virus-Scanned: by bsmtpd at sgi.com From: Mike Christie This has submit_bh users pass in the operation and flags separately, so we can setup the bio->bi_op and bio-bi_rw flags. Signed-off-by: Mike Christie --- drivers/md/bitmap.c | 4 ++-- fs/btrfs/check-integrity.c | 24 ++++++++++---------- fs/btrfs/check-integrity.h | 2 +- fs/btrfs/disk-io.c | 4 ++-- fs/buffer.c | 54 +++++++++++++++++++++++---------------------- fs/ext4/balloc.c | 2 +- fs/ext4/ialloc.c | 2 +- fs/ext4/inode.c | 2 +- fs/ext4/mmp.c | 4 ++-- fs/fat/misc.c | 2 +- fs/gfs2/bmap.c | 2 +- fs/gfs2/dir.c | 2 +- fs/gfs2/meta_io.c | 6 ++--- fs/jbd2/commit.c | 6 ++--- fs/jbd2/journal.c | 8 +++---- fs/nilfs2/btnode.c | 6 ++--- fs/nilfs2/btnode.h | 2 +- fs/nilfs2/btree.c | 6 +++-- fs/nilfs2/gcinode.c | 5 +++-- fs/nilfs2/mdt.c | 11 ++++----- fs/ntfs/aops.c | 6 ++--- fs/ntfs/compress.c | 2 +- fs/ntfs/file.c | 2 +- fs/ntfs/logfile.c | 2 +- fs/ntfs/mft.c | 4 ++-- fs/ocfs2/buffer_head_io.c | 8 +++---- fs/reiserfs/inode.c | 4 ++-- fs/reiserfs/journal.c | 6 ++--- fs/ufs/util.c | 2 +- include/linux/buffer_head.h | 9 ++++---- 30 files changed, 103 insertions(+), 96 deletions(-) diff --git a/drivers/md/bitmap.c b/drivers/md/bitmap.c index d80cce4..c8e4124 100644 --- a/drivers/md/bitmap.c +++ b/drivers/md/bitmap.c @@ -295,7 +295,7 @@ static void write_page(struct bitmap *bitmap, struct page *page, int wait) atomic_inc(&bitmap->pending_writes); set_buffer_locked(bh); set_buffer_mapped(bh); - submit_bh(WRITE | REQ_SYNC, bh); + submit_bh(REQ_OP_WRITE, REQ_SYNC, bh); bh = bh->b_this_page; } @@ -390,7 +390,7 @@ static int read_page(struct file *file, unsigned long index, atomic_inc(&bitmap->pending_writes); set_buffer_locked(bh); set_buffer_mapped(bh); - submit_bh(READ, bh); + submit_bh(REQ_OP_READ, 0, bh); } block++; bh = bh->b_this_page; diff --git a/fs/btrfs/check-integrity.c b/fs/btrfs/check-integrity.c index 9c51373..1c3c40a 100644 --- a/fs/btrfs/check-integrity.c +++ b/fs/btrfs/check-integrity.c @@ -2854,12 +2854,12 @@ static struct btrfsic_dev_state *btrfsic_dev_state_lookup( return ds; } -int btrfsic_submit_bh(int rw, struct buffer_head *bh) +int btrfsic_submit_bh(int op, int op_flags, struct buffer_head *bh) { struct btrfsic_dev_state *dev_state; if (!btrfsic_is_initialized) - return submit_bh(rw, bh); + return submit_bh(op, op_flags, bh); mutex_lock(&btrfsic_mutex); /* since btrfsic_submit_bh() might also be called before @@ -2868,26 +2868,26 @@ int btrfsic_submit_bh(int rw, struct buffer_head *bh) /* Only called to write the superblock (incl. FLUSH/FUA) */ if (NULL != dev_state && - (rw & WRITE) && bh->b_size > 0) { + (op == REQ_OP_WRITE) && bh->b_size > 0) { u64 dev_bytenr; dev_bytenr = 4096 * bh->b_blocknr; if (dev_state->state->print_mask & BTRFSIC_PRINT_MASK_SUBMIT_BIO_BH) printk(KERN_INFO - "submit_bh(rw=0x%x, blocknr=%llu (bytenr %llu)," - " size=%zu, data=%p, bdev=%p)\n", - rw, (unsigned long long)bh->b_blocknr, + "submit_bh(op=0x%x,0x%x, blocknr=%llu " + "(bytenr %llu), size=%zu, data=%p, bdev=%p)\n", + op, op_flags, (unsigned long long)bh->b_blocknr, dev_bytenr, bh->b_size, bh->b_data, bh->b_bdev); btrfsic_process_written_block(dev_state, dev_bytenr, &bh->b_data, 1, NULL, - NULL, bh, rw); - } else if (NULL != dev_state && (rw & REQ_FLUSH)) { + NULL, bh, op_flags); + } else if (NULL != dev_state && (op_flags & REQ_FLUSH)) { if (dev_state->state->print_mask & BTRFSIC_PRINT_MASK_SUBMIT_BIO_BH) printk(KERN_INFO - "submit_bh(rw=0x%x FLUSH, bdev=%p)\n", - rw, bh->b_bdev); + "submit_bh(op=0x%x,0x%x FLUSH, bdev=%p)\n", + op, op_flags, bh->b_bdev); if (!dev_state->dummy_block_for_bio_bh_flush.is_iodone) { if ((dev_state->state->print_mask & (BTRFSIC_PRINT_MASK_SUBMIT_BIO_BH | @@ -2905,7 +2905,7 @@ int btrfsic_submit_bh(int rw, struct buffer_head *bh) block->never_written = 0; block->iodone_w_error = 0; block->flush_gen = dev_state->last_flush_gen + 1; - block->submit_bio_bh_rw = rw; + block->submit_bio_bh_rw = op_flags; block->orig_bio_bh_private = bh->b_private; block->orig_bio_bh_end_io.bh = bh->b_end_io; block->next_in_same_bio = NULL; @@ -2914,7 +2914,7 @@ int btrfsic_submit_bh(int rw, struct buffer_head *bh) } } mutex_unlock(&btrfsic_mutex); - return submit_bh(rw, bh); + return submit_bh(op, op_flags, bh); } static void __btrfsic_submit_bio(struct bio *bio) diff --git a/fs/btrfs/check-integrity.h b/fs/btrfs/check-integrity.h index c04e249..f78dff1 100644 --- a/fs/btrfs/check-integrity.h +++ b/fs/btrfs/check-integrity.h @@ -20,7 +20,7 @@ #define __BTRFS_CHECK_INTEGRITY__ #ifdef CONFIG_BTRFS_FS_CHECK_INTEGRITY -int btrfsic_submit_bh(int rw, struct buffer_head *bh); +int btrfsic_submit_bh(int op, int op_flags, struct buffer_head *bh); void btrfsic_submit_bio(struct bio *bio); int btrfsic_submit_bio_wait(struct bio *bio); #else diff --git a/fs/btrfs/disk-io.c b/fs/btrfs/disk-io.c index 3437390..bb23db7 100644 --- a/fs/btrfs/disk-io.c +++ b/fs/btrfs/disk-io.c @@ -3404,9 +3404,9 @@ static int write_dev_supers(struct btrfs_device *device, * to go down lazy. */ if (i == 0) - ret = btrfsic_submit_bh(WRITE_FUA, bh); + ret = btrfsic_submit_bh(REQ_OP_WRITE, WRITE_FUA, bh); else - ret = btrfsic_submit_bh(WRITE_SYNC, bh); + ret = btrfsic_submit_bh(REQ_OP_WRITE, WRITE_SYNC, bh); if (ret) errors++; } diff --git a/fs/buffer.c b/fs/buffer.c index ef70d65..3492de4 100644 --- a/fs/buffer.c +++ b/fs/buffer.c @@ -45,7 +45,7 @@ #include static int fsync_buffers_list(spinlock_t *lock, struct list_head *list); -static int submit_bh_wbc(int rw, struct buffer_head *bh, +static int submit_bh_wbc(int op, int op_flags, struct buffer_head *bh, unsigned long bio_flags, struct writeback_control *wbc); @@ -1225,7 +1225,7 @@ static struct buffer_head *__bread_slow(struct buffer_head *bh) } else { get_bh(bh); bh->b_end_io = end_buffer_read_sync; - submit_bh(READ, bh); + submit_bh(REQ_OP_READ, 0, bh); wait_on_buffer(bh); if (buffer_uptodate(bh)) return bh; @@ -1697,7 +1697,7 @@ static int __block_write_full_page(struct inode *inode, struct page *page, struct buffer_head *bh, *head; unsigned int blocksize, bbits; int nr_underway = 0; - int write_op = (wbc->sync_mode == WB_SYNC_ALL ? WRITE_SYNC : WRITE); + int write_flags = (wbc->sync_mode == WB_SYNC_ALL ? WRITE_SYNC : 0); head = create_page_buffers(page, inode, (1 << BH_Dirty)|(1 << BH_Uptodate)); @@ -1786,7 +1786,7 @@ static int __block_write_full_page(struct inode *inode, struct page *page, do { struct buffer_head *next = bh->b_this_page; if (buffer_async_write(bh)) { - submit_bh_wbc(write_op, bh, 0, wbc); + submit_bh_wbc(REQ_OP_WRITE, write_flags, bh, 0, wbc); nr_underway++; } bh = next; @@ -1840,7 +1840,7 @@ recover: struct buffer_head *next = bh->b_this_page; if (buffer_async_write(bh)) { clear_buffer_dirty(bh); - submit_bh_wbc(write_op, bh, 0, wbc); + submit_bh_wbc(REQ_OP_WRITE, write_flags, bh, 0, wbc); nr_underway++; } bh = next; @@ -2248,7 +2248,7 @@ int block_read_full_page(struct page *page, get_block_t *get_block) if (buffer_uptodate(bh)) end_buffer_async_read(bh, 1); else - submit_bh(READ, bh); + submit_bh(REQ_OP_READ, 0, bh); } return 0; } @@ -2582,7 +2582,7 @@ int nobh_write_begin(struct address_space *mapping, if (block_start < from || block_end > to) { lock_buffer(bh); bh->b_end_io = end_buffer_read_nobh; - submit_bh(READ, bh); + submit_bh(REQ_OP_READ, 0, bh); nr_reads++; } } @@ -2949,7 +2949,7 @@ static void end_bio_bh_io_sync(struct bio *bio) * errors, this only handles the "we need to be able to * do IO at the final sector" case. */ -void guard_bio_eod(int rw, struct bio *bio) +void guard_bio_eod(int op, struct bio *bio) { sector_t maxsector; struct bio_vec *bvec = &bio->bi_io_vec[bio->bi_vcnt - 1]; @@ -2979,13 +2979,13 @@ void guard_bio_eod(int rw, struct bio *bio) bvec->bv_len -= truncated_bytes; /* ..and clear the end of the buffer for reads */ - if ((rw & RW_MASK) == READ) { + if (op == REQ_OP_READ) { zero_user(bvec->bv_page, bvec->bv_offset + bvec->bv_len, truncated_bytes); } } -static int submit_bh_wbc(int rw, struct buffer_head *bh, +static int submit_bh_wbc(int op, int op_flags, struct buffer_head *bh, unsigned long bio_flags, struct writeback_control *wbc) { struct bio *bio; @@ -2999,7 +2999,7 @@ static int submit_bh_wbc(int rw, struct buffer_head *bh, /* * Only clear out a write error when rewriting */ - if (test_set_buffer_req(bh) && (rw & WRITE)) + if (test_set_buffer_req(bh) && (op == REQ_OP_WRITE)) clear_buffer_write_io_error(bh); /* @@ -3022,29 +3022,31 @@ static int submit_bh_wbc(int rw, struct buffer_head *bh, bio->bi_end_io = end_bio_bh_io_sync; bio->bi_private = bh; bio->bi_flags |= bio_flags; + bio->bi_op = op; /* Take care of bh's that straddle the end of the device */ - guard_bio_eod(rw, bio); + guard_bio_eod(op, bio); if (buffer_meta(bh)) - rw |= REQ_META; + op_flags |= REQ_META; if (buffer_prio(bh)) - rw |= REQ_PRIO; - bio->bi_rw = rw; + op_flags |= REQ_PRIO; + bio->bi_rw = op_flags; submit_bio(bio); return 0; } -int _submit_bh(int rw, struct buffer_head *bh, unsigned long bio_flags) +int _submit_bh(int op, int op_flags, struct buffer_head *bh, + unsigned long bio_flags) { - return submit_bh_wbc(rw, bh, bio_flags, NULL); + return submit_bh_wbc(op, op_flags, bh, bio_flags, NULL); } EXPORT_SYMBOL_GPL(_submit_bh); -int submit_bh(int rw, struct buffer_head *bh) +int submit_bh(int op, int op_flags, struct buffer_head *bh) { - return submit_bh_wbc(rw, bh, 0, NULL); + return submit_bh_wbc(op, op_flags, bh, 0, NULL); } EXPORT_SYMBOL(submit_bh); @@ -3086,14 +3088,14 @@ void ll_rw_block(int rw, int nr, struct buffer_head *bhs[]) if (test_clear_buffer_dirty(bh)) { bh->b_end_io = end_buffer_write_sync; get_bh(bh); - submit_bh(WRITE, bh); + submit_bh(rw, 0, bh); continue; } } else { if (!buffer_uptodate(bh)) { bh->b_end_io = end_buffer_read_sync; get_bh(bh); - submit_bh(rw, bh); + submit_bh(rw, 0, bh); continue; } } @@ -3102,7 +3104,7 @@ void ll_rw_block(int rw, int nr, struct buffer_head *bhs[]) } EXPORT_SYMBOL(ll_rw_block); -void write_dirty_buffer(struct buffer_head *bh, int rw) +void write_dirty_buffer(struct buffer_head *bh, int op_flags) { lock_buffer(bh); if (!test_clear_buffer_dirty(bh)) { @@ -3111,7 +3113,7 @@ void write_dirty_buffer(struct buffer_head *bh, int rw) } bh->b_end_io = end_buffer_write_sync; get_bh(bh); - submit_bh(rw, bh); + submit_bh(REQ_OP_WRITE, op_flags, bh); } EXPORT_SYMBOL(write_dirty_buffer); @@ -3120,7 +3122,7 @@ EXPORT_SYMBOL(write_dirty_buffer); * and then start new I/O and then wait upon it. The caller must have a ref on * the buffer_head. */ -int __sync_dirty_buffer(struct buffer_head *bh, int rw) +int __sync_dirty_buffer(struct buffer_head *bh, int op_flags) { int ret = 0; @@ -3129,7 +3131,7 @@ int __sync_dirty_buffer(struct buffer_head *bh, int rw) if (test_clear_buffer_dirty(bh)) { get_bh(bh); bh->b_end_io = end_buffer_write_sync; - ret = submit_bh(rw, bh); + ret = submit_bh(REQ_OP_WRITE, op_flags, bh); wait_on_buffer(bh); if (!ret && !buffer_uptodate(bh)) ret = -EIO; @@ -3392,7 +3394,7 @@ int bh_submit_read(struct buffer_head *bh) get_bh(bh); bh->b_end_io = end_buffer_read_sync; - submit_bh(READ, bh); + submit_bh(REQ_OP_READ, 0, bh); wait_on_buffer(bh); if (buffer_uptodate(bh)) return 0; diff --git a/fs/ext4/balloc.c b/fs/ext4/balloc.c index fe1f50f..d06823b 100644 --- a/fs/ext4/balloc.c +++ b/fs/ext4/balloc.c @@ -470,7 +470,7 @@ ext4_read_block_bitmap_nowait(struct super_block *sb, ext4_group_t block_group) trace_ext4_read_block_bitmap_load(sb, block_group); bh->b_end_io = ext4_end_bitmap_read; get_bh(bh); - submit_bh(READ | REQ_META | REQ_PRIO, bh); + submit_bh(REQ_OP_READ, REQ_META | REQ_PRIO, bh); return bh; verify: err = ext4_validate_block_bitmap(sb, desc, block_group, bh); diff --git a/fs/ext4/ialloc.c b/fs/ext4/ialloc.c index aa509fd..25c9672 100644 --- a/fs/ext4/ialloc.c +++ b/fs/ext4/ialloc.c @@ -214,7 +214,7 @@ ext4_read_inode_bitmap(struct super_block *sb, ext4_group_t block_group) trace_ext4_load_inode_bitmap(sb, block_group); bh->b_end_io = ext4_end_bitmap_read; get_bh(bh); - submit_bh(READ | REQ_META | REQ_PRIO, bh); + submit_bh(REQ_OP_READ, REQ_META | REQ_PRIO, bh); wait_on_buffer(bh); if (!buffer_uptodate(bh)) { put_bh(bh); diff --git a/fs/ext4/inode.c b/fs/ext4/inode.c index b878614..8a91e98 100644 --- a/fs/ext4/inode.c +++ b/fs/ext4/inode.c @@ -4124,7 +4124,7 @@ make_io: trace_ext4_load_inode(inode); get_bh(bh); bh->b_end_io = end_buffer_read_sync; - submit_bh(READ | REQ_META | REQ_PRIO, bh); + submit_bh(REQ_OP_READ, REQ_META | REQ_PRIO, bh); wait_on_buffer(bh); if (!buffer_uptodate(bh)) { EXT4_ERROR_INODE_BLOCK(inode, block, diff --git a/fs/ext4/mmp.c b/fs/ext4/mmp.c index 0a512aa..bd90abf 100644 --- a/fs/ext4/mmp.c +++ b/fs/ext4/mmp.c @@ -52,7 +52,7 @@ static int write_mmp_block(struct super_block *sb, struct buffer_head *bh) lock_buffer(bh); bh->b_end_io = end_buffer_write_sync; get_bh(bh); - submit_bh(WRITE_SYNC | REQ_META | REQ_PRIO, bh); + submit_bh(REQ_OP_WRITE, WRITE_SYNC | REQ_META | REQ_PRIO, bh); wait_on_buffer(bh); sb_end_write(sb); if (unlikely(!buffer_uptodate(bh))) @@ -88,7 +88,7 @@ static int read_mmp_block(struct super_block *sb, struct buffer_head **bh, get_bh(*bh); lock_buffer(*bh); (*bh)->b_end_io = end_buffer_read_sync; - submit_bh(READ_SYNC | REQ_META | REQ_PRIO, *bh); + submit_bh(REQ_OP_READ, READ_SYNC | REQ_META | REQ_PRIO, *bh); wait_on_buffer(*bh); if (!buffer_uptodate(*bh)) { brelse(*bh); diff --git a/fs/fat/misc.c b/fs/fat/misc.c index c4589e9..8a86981 100644 --- a/fs/fat/misc.c +++ b/fs/fat/misc.c @@ -267,7 +267,7 @@ int fat_sync_bhs(struct buffer_head **bhs, int nr_bhs) int i, err = 0; for (i = 0; i < nr_bhs; i++) - write_dirty_buffer(bhs[i], WRITE); + write_dirty_buffer(bhs[i], 0); for (i = 0; i < nr_bhs; i++) { wait_on_buffer(bhs[i]); diff --git a/fs/gfs2/bmap.c b/fs/gfs2/bmap.c index 0860f0b..29faf72 100644 --- a/fs/gfs2/bmap.c +++ b/fs/gfs2/bmap.c @@ -285,7 +285,7 @@ static void gfs2_metapath_ra(struct gfs2_glock *gl, if (trylock_buffer(rabh)) { if (!buffer_uptodate(rabh)) { rabh->b_end_io = end_buffer_read_sync; - submit_bh(READA | REQ_META, rabh); + submit_bh(REQ_OP_READ, READA | REQ_META, rabh); continue; } unlock_buffer(rabh); diff --git a/fs/gfs2/dir.c b/fs/gfs2/dir.c index d4014af..a87dae0 100644 --- a/fs/gfs2/dir.c +++ b/fs/gfs2/dir.c @@ -1510,7 +1510,7 @@ static void gfs2_dir_readahead(struct inode *inode, unsigned hsize, u32 index, continue; } bh->b_end_io = end_buffer_read_sync; - submit_bh(READA | REQ_META, bh); + submit_bh(REQ_OP_READ, READA | REQ_META, bh); continue; } brelse(bh); diff --git a/fs/gfs2/meta_io.c b/fs/gfs2/meta_io.c index 87a3abc..dc1c9db 100644 --- a/fs/gfs2/meta_io.c +++ b/fs/gfs2/meta_io.c @@ -37,8 +37,8 @@ static int gfs2_aspace_writepage(struct page *page, struct writeback_control *wb { struct buffer_head *bh, *head; int nr_underway = 0; - int write_op = REQ_META | REQ_PRIO | - (wbc->sync_mode == WB_SYNC_ALL ? WRITE_SYNC : WRITE); + int write_flags = REQ_META | REQ_PRIO | + (wbc->sync_mode == WB_SYNC_ALL ? WRITE_SYNC : 0); BUG_ON(!PageLocked(page)); BUG_ON(!page_has_buffers(page)); @@ -79,7 +79,7 @@ static int gfs2_aspace_writepage(struct page *page, struct writeback_control *wb do { struct buffer_head *next = bh->b_this_page; if (buffer_async_write(bh)) { - submit_bh(write_op, bh); + submit_bh(REQ_OP_WRITE, write_flags, bh); nr_underway++; } bh = next; diff --git a/fs/jbd2/commit.c b/fs/jbd2/commit.c index 517f2de..2690969 100644 --- a/fs/jbd2/commit.c +++ b/fs/jbd2/commit.c @@ -155,9 +155,9 @@ static int journal_submit_commit_record(journal_t *journal, if (journal->j_flags & JBD2_BARRIER && !jbd2_has_feature_async_commit(journal)) - ret = submit_bh(WRITE_SYNC | WRITE_FLUSH_FUA, bh); + ret = submit_bh(REQ_OP_WRITE, WRITE_SYNC | WRITE_FLUSH_FUA, bh); else - ret = submit_bh(WRITE_SYNC, bh); + ret = submit_bh(REQ_OP_WRITE, WRITE_SYNC, bh); *cbh = bh; return ret; @@ -714,7 +714,7 @@ start_journal_io: clear_buffer_dirty(bh); set_buffer_uptodate(bh); bh->b_end_io = journal_end_buffer_io_sync; - submit_bh(WRITE_SYNC, bh); + submit_bh(REQ_OP_WRITE, WRITE_SYNC, bh); } cond_resched(); stats.run.rs_blocks_logged += bufs; diff --git a/fs/jbd2/journal.c b/fs/jbd2/journal.c index 7bf1683..a3e1776 100644 --- a/fs/jbd2/journal.c +++ b/fs/jbd2/journal.c @@ -1345,15 +1345,15 @@ static int journal_reset(journal_t *journal) return jbd2_journal_start_thread(journal); } -static int jbd2_write_superblock(journal_t *journal, int write_op) +static int jbd2_write_superblock(journal_t *journal, int write_flags) { struct buffer_head *bh = journal->j_sb_buffer; journal_superblock_t *sb = journal->j_superblock; int ret; - trace_jbd2_write_superblock(journal, write_op); + trace_jbd2_write_superblock(journal, write_flags); if (!(journal->j_flags & JBD2_BARRIER)) - write_op &= ~(REQ_FUA | REQ_FLUSH); + write_flags &= ~(REQ_FUA | REQ_FLUSH); lock_buffer(bh); if (buffer_write_io_error(bh)) { /* @@ -1373,7 +1373,7 @@ static int jbd2_write_superblock(journal_t *journal, int write_op) jbd2_superblock_csum_set(journal, sb); get_bh(bh); bh->b_end_io = end_buffer_write_sync; - ret = submit_bh(write_op, bh); + ret = submit_bh(REQ_OP_WRITE, write_flags, bh); wait_on_buffer(bh); if (buffer_write_io_error(bh)) { clear_buffer_write_io_error(bh); diff --git a/fs/nilfs2/btnode.c b/fs/nilfs2/btnode.c index a35ae35..07fe874 100644 --- a/fs/nilfs2/btnode.c +++ b/fs/nilfs2/btnode.c @@ -67,7 +67,7 @@ nilfs_btnode_create_block(struct address_space *btnc, __u64 blocknr) } int nilfs_btnode_submit_block(struct address_space *btnc, __u64 blocknr, - sector_t pblocknr, int mode, + sector_t pblocknr, int mode, int mode_flags, struct buffer_head **pbh, sector_t *submit_ptr) { struct buffer_head *bh; @@ -100,7 +100,7 @@ int nilfs_btnode_submit_block(struct address_space *btnc, __u64 blocknr, } } - if (mode == READA) { + if (mode_flags & REQ_RAHEAD) { if (pblocknr != *submit_ptr + 1 || !trylock_buffer(bh)) { err = -EBUSY; /* internal code */ brelse(bh); @@ -119,7 +119,7 @@ int nilfs_btnode_submit_block(struct address_space *btnc, __u64 blocknr, bh->b_blocknr = pblocknr; /* set block address for read */ bh->b_end_io = end_buffer_read_sync; get_bh(bh); - submit_bh(mode, bh); + submit_bh(mode, mode_flags, bh); bh->b_blocknr = blocknr; /* set back to the given block address */ *submit_ptr = pblocknr; err = 0; diff --git a/fs/nilfs2/btnode.h b/fs/nilfs2/btnode.h index d876b56..3f93197 100644 --- a/fs/nilfs2/btnode.h +++ b/fs/nilfs2/btnode.h @@ -47,7 +47,7 @@ void nilfs_btnode_cache_clear(struct address_space *); struct buffer_head *nilfs_btnode_create_block(struct address_space *btnc, __u64 blocknr); int nilfs_btnode_submit_block(struct address_space *, __u64, sector_t, int, - struct buffer_head **, sector_t *); + int, struct buffer_head **, sector_t *); void nilfs_btnode_delete(struct buffer_head *); int nilfs_btnode_prepare_change_key(struct address_space *, struct nilfs_btnode_chkey_ctxt *); diff --git a/fs/nilfs2/btree.c b/fs/nilfs2/btree.c index 3a3821b..5d6a2c6 100644 --- a/fs/nilfs2/btree.c +++ b/fs/nilfs2/btree.c @@ -480,7 +480,8 @@ static int __nilfs_btree_get_block(const struct nilfs_bmap *btree, __u64 ptr, sector_t submit_ptr = 0; int ret; - ret = nilfs_btnode_submit_block(btnc, ptr, 0, READ, &bh, &submit_ptr); + ret = nilfs_btnode_submit_block(btnc, ptr, 0, REQ_OP_READ, 0, &bh, + &submit_ptr); if (ret) { if (ret != -EEXIST) return ret; @@ -496,7 +497,8 @@ static int __nilfs_btree_get_block(const struct nilfs_bmap *btree, __u64 ptr, n > 0 && i < ra->ncmax; n--, i++) { ptr2 = nilfs_btree_node_get_ptr(ra->node, i, ra->ncmax); - ret = nilfs_btnode_submit_block(btnc, ptr2, 0, READA, + ret = nilfs_btnode_submit_block(btnc, ptr2, 0, + REQ_OP_READ, REQ_RAHEAD, &ra_bh, &submit_ptr); if (likely(!ret || ret == -EEXIST)) brelse(ra_bh); diff --git a/fs/nilfs2/gcinode.c b/fs/nilfs2/gcinode.c index 748ca23..1f18ffc 100644 --- a/fs/nilfs2/gcinode.c +++ b/fs/nilfs2/gcinode.c @@ -106,7 +106,7 @@ int nilfs_gccache_submit_read_data(struct inode *inode, sector_t blkoff, bh->b_blocknr = pbn; bh->b_end_io = end_buffer_read_sync; get_bh(bh); - submit_bh(READ, bh); + submit_bh(REQ_OP_READ, 0, bh); if (vbn) bh->b_blocknr = vbn; out: @@ -143,7 +143,8 @@ int nilfs_gccache_submit_read_node(struct inode *inode, sector_t pbn, int ret; ret = nilfs_btnode_submit_block(&NILFS_I(inode)->i_btnode_cache, - vbn ? : pbn, pbn, READ, out_bh, &pbn); + vbn ? : pbn, pbn, REQ_OP_READ, 0, + out_bh, &pbn); if (ret == -EEXIST) /* internal code (cache hit) */ ret = 0; return ret; diff --git a/fs/nilfs2/mdt.c b/fs/nilfs2/mdt.c index 1125f40..92e627d 100644 --- a/fs/nilfs2/mdt.c +++ b/fs/nilfs2/mdt.c @@ -124,7 +124,7 @@ static int nilfs_mdt_create_block(struct inode *inode, unsigned long block, static int nilfs_mdt_submit_block(struct inode *inode, unsigned long blkoff, - int mode, struct buffer_head **out_bh) + int mode, int mode_flags, struct buffer_head **out_bh) { struct buffer_head *bh; __u64 blknum = 0; @@ -138,7 +138,7 @@ nilfs_mdt_submit_block(struct inode *inode, unsigned long blkoff, if (buffer_uptodate(bh)) goto out; - if (mode == READA) { + if (mode_flags & REQ_RAHEAD) { if (!trylock_buffer(bh)) { ret = -EBUSY; goto failed_bh; @@ -160,7 +160,7 @@ nilfs_mdt_submit_block(struct inode *inode, unsigned long blkoff, bh->b_end_io = end_buffer_read_sync; get_bh(bh); - submit_bh(mode, bh); + submit_bh(mode, mode_flags, bh); ret = 0; trace_nilfs2_mdt_submit_block(inode, inode->i_ino, blkoff, mode); @@ -184,7 +184,7 @@ static int nilfs_mdt_read_block(struct inode *inode, unsigned long block, int i, nr_ra_blocks = NILFS_MDT_MAX_RA_BLOCKS; int err; - err = nilfs_mdt_submit_block(inode, block, READ, &first_bh); + err = nilfs_mdt_submit_block(inode, block, REQ_OP_READ, 0, &first_bh); if (err == -EEXIST) /* internal code */ goto out; @@ -194,7 +194,8 @@ static int nilfs_mdt_read_block(struct inode *inode, unsigned long block, if (readahead) { blkoff = block + 1; for (i = 0; i < nr_ra_blocks; i++, blkoff++) { - err = nilfs_mdt_submit_block(inode, blkoff, READA, &bh); + err = nilfs_mdt_submit_block(inode, blkoff, REQ_OP_READ, + REQ_RAHEAD, &bh); if (likely(!err || err == -EEXIST)) brelse(bh); else if (err != -EBUSY) diff --git a/fs/ntfs/aops.c b/fs/ntfs/aops.c index 7521e11..57c64bd 100644 --- a/fs/ntfs/aops.c +++ b/fs/ntfs/aops.c @@ -362,7 +362,7 @@ handle_zblock: for (i = 0; i < nr; i++) { tbh = arr[i]; if (likely(!buffer_uptodate(tbh))) - submit_bh(READ, tbh); + submit_bh(REQ_OP_READ, 0, tbh); else ntfs_end_buffer_async_read(tbh, 1); } @@ -877,7 +877,7 @@ lock_retry_remap: do { struct buffer_head *next = bh->b_this_page; if (buffer_async_write(bh)) { - submit_bh(WRITE, bh); + submit_bh(REQ_OP_WRITE, 0, bh); need_end_writeback = false; } bh = next; @@ -1202,7 +1202,7 @@ lock_retry_remap: BUG_ON(!buffer_mapped(tbh)); get_bh(tbh); tbh->b_end_io = end_buffer_write_sync; - submit_bh(WRITE, tbh); + submit_bh(REQ_OP_WRITE, 0, tbh); } /* Synchronize the mft mirror now if not @sync. */ if (is_mft && !sync) diff --git a/fs/ntfs/compress.c b/fs/ntfs/compress.c index f82498c..1fd482c 100644 --- a/fs/ntfs/compress.c +++ b/fs/ntfs/compress.c @@ -674,7 +674,7 @@ lock_retry_remap: } get_bh(tbh); tbh->b_end_io = end_buffer_read_sync; - submit_bh(READ, tbh); + submit_bh(REQ_OP_READ, 0, tbh); } /* Wait for io completion on all buffer heads. */ diff --git a/fs/ntfs/file.c b/fs/ntfs/file.c index bed4d42..8846a6c 100644 --- a/fs/ntfs/file.c +++ b/fs/ntfs/file.c @@ -553,7 +553,7 @@ static inline int ntfs_submit_bh_for_read(struct buffer_head *bh) lock_buffer(bh); get_bh(bh); bh->b_end_io = end_buffer_read_sync; - return submit_bh(READ, bh); + return submit_bh(REQ_OP_READ, 0, bh); } /** diff --git a/fs/ntfs/logfile.c b/fs/ntfs/logfile.c index c71de29..1c95c41 100644 --- a/fs/ntfs/logfile.c +++ b/fs/ntfs/logfile.c @@ -821,7 +821,7 @@ map_vcn: * completed ignore errors afterwards as we can assume * that if one buffer worked all of them will work. */ - submit_bh(WRITE, bh); + submit_bh(REQ_OP_WRITE, 0, bh); if (should_wait) { should_wait = false; wait_on_buffer(bh); diff --git a/fs/ntfs/mft.c b/fs/ntfs/mft.c index 3014a36..38c6f7a 100644 --- a/fs/ntfs/mft.c +++ b/fs/ntfs/mft.c @@ -592,7 +592,7 @@ int ntfs_sync_mft_mirror(ntfs_volume *vol, const unsigned long mft_no, clear_buffer_dirty(tbh); get_bh(tbh); tbh->b_end_io = end_buffer_write_sync; - submit_bh(WRITE, tbh); + submit_bh(REQ_OP_WRITE, 0, tbh); } /* Wait on i/o completion of buffers. */ for (i_bhs = 0; i_bhs < nr_bhs; i_bhs++) { @@ -785,7 +785,7 @@ int write_mft_record_nolock(ntfs_inode *ni, MFT_RECORD *m, int sync) clear_buffer_dirty(tbh); get_bh(tbh); tbh->b_end_io = end_buffer_write_sync; - submit_bh(WRITE, tbh); + submit_bh(REQ_OP_WRITE, 0, tbh); } /* Synchronize the mft mirror now if not @sync. */ if (!sync && ni->mft_no < vol->mftmirr_size) diff --git a/fs/ocfs2/buffer_head_io.c b/fs/ocfs2/buffer_head_io.c index fe50ded..fb775c9 100644 --- a/fs/ocfs2/buffer_head_io.c +++ b/fs/ocfs2/buffer_head_io.c @@ -79,7 +79,7 @@ int ocfs2_write_block(struct ocfs2_super *osb, struct buffer_head *bh, get_bh(bh); /* for end_buffer_write_sync() */ bh->b_end_io = end_buffer_write_sync; - submit_bh(WRITE, bh); + submit_bh(REQ_OP_WRITE, 0, bh); wait_on_buffer(bh); @@ -149,7 +149,7 @@ int ocfs2_read_blocks_sync(struct ocfs2_super *osb, u64 block, clear_buffer_uptodate(bh); get_bh(bh); /* for end_buffer_read_sync() */ bh->b_end_io = end_buffer_read_sync; - submit_bh(READ, bh); + submit_bh(REQ_OP_READ, 0, bh); } for (i = nr; i > 0; i--) { @@ -305,7 +305,7 @@ int ocfs2_read_blocks(struct ocfs2_caching_info *ci, u64 block, int nr, if (validate) set_buffer_needs_validate(bh); bh->b_end_io = end_buffer_read_sync; - submit_bh(READ, bh); + submit_bh(REQ_OP_READ, 0, bh); continue; } } @@ -419,7 +419,7 @@ int ocfs2_write_super_or_backup(struct ocfs2_super *osb, get_bh(bh); /* for end_buffer_write_sync() */ bh->b_end_io = end_buffer_write_sync; ocfs2_compute_meta_ecc(osb->sb, bh->b_data, &di->i_check); - submit_bh(WRITE, bh); + submit_bh(REQ_OP_WRITE, 0, bh); wait_on_buffer(bh); diff --git a/fs/reiserfs/inode.c b/fs/reiserfs/inode.c index ae9e5b3..91155ed 100644 --- a/fs/reiserfs/inode.c +++ b/fs/reiserfs/inode.c @@ -2668,7 +2668,7 @@ static int reiserfs_write_full_page(struct page *page, do { struct buffer_head *next = bh->b_this_page; if (buffer_async_write(bh)) { - submit_bh(WRITE, bh); + submit_bh(REQ_OP_WRITE, 0, bh); nr++; } put_bh(bh); @@ -2728,7 +2728,7 @@ fail: struct buffer_head *next = bh->b_this_page; if (buffer_async_write(bh)) { clear_buffer_dirty(bh); - submit_bh(WRITE, bh); + submit_bh(REQ_OP_WRITE, 0, bh); nr++; } put_bh(bh); diff --git a/fs/reiserfs/journal.c b/fs/reiserfs/journal.c index 44c2bdc..688dce9 100644 --- a/fs/reiserfs/journal.c +++ b/fs/reiserfs/journal.c @@ -652,7 +652,7 @@ static void submit_logged_buffer(struct buffer_head *bh) BUG(); if (!buffer_uptodate(bh)) BUG(); - submit_bh(WRITE, bh); + submit_bh(REQ_OP_WRITE, 0, bh); } static void submit_ordered_buffer(struct buffer_head *bh) @@ -662,7 +662,7 @@ static void submit_ordered_buffer(struct buffer_head *bh) clear_buffer_dirty(bh); if (!buffer_uptodate(bh)) BUG(); - submit_bh(WRITE, bh); + submit_bh(REQ_OP_WRITE, 0, bh); } #define CHUNK_SIZE 32 @@ -2269,7 +2269,7 @@ abort_replay: /* flush out the real blocks */ for (i = 0; i < get_desc_trans_len(desc); i++) { set_buffer_dirty(real_blocks[i]); - write_dirty_buffer(real_blocks[i], WRITE); + write_dirty_buffer(real_blocks[i], 0); } for (i = 0; i < get_desc_trans_len(desc); i++) { wait_on_buffer(real_blocks[i]); diff --git a/fs/ufs/util.c b/fs/ufs/util.c index b6c2f94..5f68b1a 100644 --- a/fs/ufs/util.c +++ b/fs/ufs/util.c @@ -118,7 +118,7 @@ void ubh_sync_block(struct ufs_buffer_head *ubh) unsigned i; for (i = 0; i < ubh->count; i++) - write_dirty_buffer(ubh->bh[i], WRITE); + write_dirty_buffer(ubh->bh[i], 0); for (i = 0; i < ubh->count; i++) wait_on_buffer(ubh->bh[i]); diff --git a/include/linux/buffer_head.h b/include/linux/buffer_head.h index c67f052..72ad52d 100644 --- a/include/linux/buffer_head.h +++ b/include/linux/buffer_head.h @@ -189,10 +189,11 @@ void unlock_buffer(struct buffer_head *bh); void __lock_buffer(struct buffer_head *bh); void ll_rw_block(int, int, struct buffer_head * bh[]); int sync_dirty_buffer(struct buffer_head *bh); -int __sync_dirty_buffer(struct buffer_head *bh, int rw); -void write_dirty_buffer(struct buffer_head *bh, int rw); -int _submit_bh(int rw, struct buffer_head *bh, unsigned long bio_flags); -int submit_bh(int, struct buffer_head *); +int __sync_dirty_buffer(struct buffer_head *bh, int op_flags); +void write_dirty_buffer(struct buffer_head *bh, int op_flags); +int _submit_bh(int op, int op_flags, struct buffer_head *bh, + unsigned long bio_flags); +int submit_bh(int, int, struct buffer_head *); void write_boundary_block(struct block_device *bdev, sector_t bblock, unsigned blocksize); int bh_uptodate_or_lock(struct buffer_head *bh); -- 1.8.3.1 From mchristi@redhat.com Wed Feb 24 13:48:50 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=ham version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay2.corp.sgi.com [137.38.102.29]) by oss.sgi.com (Postfix) with ESMTP id AF2927CB9 for ; Wed, 24 Feb 2016 13:48:50 -0600 (CST) Received: from cuda.sgi.com (cuda3.sgi.com [192.48.176.15]) by relay2.corp.sgi.com (Postfix) with ESMTP id 7BF18304066 for ; Wed, 24 Feb 2016 11:48:44 -0800 (PST) X-ASG-Debug-ID: 1456343322-04cb6c455bd5930001-NocioJ Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by cuda.sgi.com with ESMTP id MwZJO5G8TvYpq3FH (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO) for ; Wed, 24 Feb 2016 11:48:42 -0800 (PST) X-Barracuda-Envelope-From: mchristi@redhat.com X-Barracuda-Apparent-Source-IP: 209.132.183.28 X-ASG-Whitelist: Client Received: from int-mx09.intmail.prod.int.phx2.redhat.com (int-mx09.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by mx1.redhat.com (Postfix) with ESMTPS id 4F7907AE83; Wed, 24 Feb 2016 19:48:42 +0000 (UTC) Received: from rh2.redhat.com (vpn-54-14.rdu2.redhat.com [10.10.54.14]) by int-mx09.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id u1OJmJEC006684; Wed, 24 Feb 2016 14:48:39 -0500 From: mchristi@redhat.com To: linux-f2fs-devel@lists.sourceforge.net, linux-ext4@vger.kernel.org, konrad.wilk@oracle.com, drbd-dev@lists.linbit.com, philipp.reisner@linbit.com, lars.ellenberg@linbit.com, linux-raid@vger.kernel.org, dm-devel@redhat.com, linux-fsdevel@vger.kernel.org, linux-bcache@vger.kernel.org, linux-block@vger.kernel.org, linux-kernel@vger.kernel.org, linux-scsi@vger.kernel.org, linux-mtd@lists.infradead.org, target-devel@vger.kernel.org, linux-btrfs@vger.kernel.org, osd-dev@open-osd.org, xfs@oss.sgi.com, ocfs2-devel@oss.oracle.com Cc: Mike Christie Subject: [PATCH 07/35] btrfs: have submit_one_bio users setup bio bi_op Date: Wed, 24 Feb 2016 13:47:44 -0600 X-ASG-Orig-Subj: [PATCH 07/35] btrfs: have submit_one_bio users setup bio bi_op Message-Id: <1456343292-14535-8-git-send-email-mchristi@redhat.com> In-Reply-To: <1456343292-14535-1-git-send-email-mchristi@redhat.com> References: <1456343292-14535-1-git-send-email-mchristi@redhat.com> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.22 X-Barracuda-Connect: mx1.redhat.com[209.132.183.28] X-Barracuda-Start-Time: 1456343322 X-Barracuda-Encrypted: ECDHE-RSA-AES256-GCM-SHA384 X-Barracuda-URL: https://192.48.176.15:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-BRTS-Status: 1 From: Mike Christie This patch has btrfs's submit_one_bio callers set the bio->bi_op to a REQ_OP and the bi_rw to rq_flag_bits. The next patches will continue to convert btrfs, so submit_bio_hook and merge_bio_hook related code will be modified to take only the bio. I did not do it in this patch to try and keep it smaller. Signed-off-by: Mike Christie --- fs/btrfs/extent_io.c | 88 +++++++++++++++++++++++++++------------------------- 1 file changed, 45 insertions(+), 43 deletions(-) diff --git a/fs/btrfs/extent_io.c b/fs/btrfs/extent_io.c index 454100e..4472d69 100644 --- a/fs/btrfs/extent_io.c +++ b/fs/btrfs/extent_io.c @@ -2377,7 +2377,7 @@ static int bio_readpage_error(struct bio *failed_bio, u64 phy_offset, int read_mode; int ret; - BUG_ON(failed_bio->bi_rw & REQ_WRITE); + BUG_ON(failed_bio->bi_op == REQ_OP_WRITE); ret = btrfs_get_io_failure_record(inode, start, end, &failrec); if (ret) @@ -2403,6 +2403,8 @@ static int bio_readpage_error(struct bio *failed_bio, u64 phy_offset, free_io_failure(inode, failrec); return -EIO; } + bio->bi_op = REQ_OP_READ; + bio->bi_rw = read_mode; pr_debug("Repair Read Error: submitting new read[%#x] to this_mirror=%d, in_validation=%d\n", read_mode, failrec->this_mirror, failrec->in_validation); @@ -2714,8 +2716,8 @@ struct bio *btrfs_io_bio_alloc(gfp_t gfp_mask, unsigned int nr_iovecs) } -static int __must_check submit_one_bio(int rw, struct bio *bio, - int mirror_num, unsigned long bio_flags) +static int __must_check submit_one_bio(struct bio *bio, int mirror_num, + unsigned long bio_flags) { int ret = 0; struct bio_vec *bvec = bio->bi_io_vec + bio->bi_vcnt - 1; @@ -2726,12 +2728,12 @@ static int __must_check submit_one_bio(int rw, struct bio *bio, start = page_offset(page) + bvec->bv_offset; bio->bi_private = NULL; - bio->bi_rw = rw; bio_get(bio); if (tree->ops && tree->ops->submit_bio_hook) - ret = tree->ops->submit_bio_hook(page->mapping->host, rw, bio, - mirror_num, bio_flags, start); + ret = tree->ops->submit_bio_hook(page->mapping->host, + bio->bi_rw, bio, mirror_num, + bio_flags, start); else btrfsic_submit_bio(bio); @@ -2739,20 +2741,20 @@ static int __must_check submit_one_bio(int rw, struct bio *bio, return ret; } -static int merge_bio(int rw, struct extent_io_tree *tree, struct page *page, +static int merge_bio(struct extent_io_tree *tree, struct page *page, unsigned long offset, size_t size, struct bio *bio, unsigned long bio_flags) { int ret = 0; if (tree->ops && tree->ops->merge_bio_hook) - ret = tree->ops->merge_bio_hook(rw, page, offset, size, bio, - bio_flags); + ret = tree->ops->merge_bio_hook(bio->bi_op, page, offset, size, + bio, bio_flags); BUG_ON(ret < 0); return ret; } -static int submit_extent_page(int rw, struct extent_io_tree *tree, +static int submit_extent_page(int op, int op_flags, struct extent_io_tree *tree, struct writeback_control *wbc, struct page *page, sector_t sector, size_t size, unsigned long offset, @@ -2780,10 +2782,9 @@ static int submit_extent_page(int rw, struct extent_io_tree *tree, if (prev_bio_flags != bio_flags || !contig || force_bio_submit || - merge_bio(rw, tree, page, offset, page_size, bio, bio_flags) || + merge_bio(tree, page, offset, page_size, bio, bio_flags) || bio_add_page(bio, page, page_size, offset) < page_size) { - ret = submit_one_bio(rw, bio, mirror_num, - prev_bio_flags); + ret = submit_one_bio(bio, mirror_num, prev_bio_flags); if (ret < 0) { *bio_ret = NULL; return ret; @@ -2804,6 +2805,8 @@ static int submit_extent_page(int rw, struct extent_io_tree *tree, bio_add_page(bio, page, page_size, offset); bio->bi_end_io = end_io_func; bio->bi_private = tree; + bio->bi_op = op; + bio->bi_rw = op_flags; if (wbc) { wbc_init_bio(wbc, bio); wbc_account_io(wbc, page, page_size); @@ -2812,7 +2815,7 @@ static int submit_extent_page(int rw, struct extent_io_tree *tree, if (bio_ret) *bio_ret = bio; else - ret = submit_one_bio(rw, bio, mirror_num, bio_flags); + ret = submit_one_bio(bio, mirror_num, bio_flags); return ret; } @@ -2876,7 +2879,7 @@ static int __do_readpage(struct extent_io_tree *tree, get_extent_t *get_extent, struct extent_map **em_cached, struct bio **bio, int mirror_num, - unsigned long *bio_flags, int rw, + unsigned long *bio_flags, int read_flags, u64 *prev_em_start) { struct inode *inode = page->mapping->host; @@ -3059,8 +3062,8 @@ static int __do_readpage(struct extent_io_tree *tree, } pnr -= page->index; - ret = submit_extent_page(rw, tree, NULL, page, - sector, disk_io_size, pg_offset, + ret = submit_extent_page(REQ_OP_READ, read_flags, tree, NULL, + page, sector, disk_io_size, pg_offset, bdev, bio, pnr, end_bio_extent_readpage, mirror_num, *bio_flags, @@ -3091,7 +3094,7 @@ static inline void __do_contiguous_readpages(struct extent_io_tree *tree, get_extent_t *get_extent, struct extent_map **em_cached, struct bio **bio, int mirror_num, - unsigned long *bio_flags, int rw, + unsigned long *bio_flags, u64 *prev_em_start) { struct inode *inode; @@ -3112,7 +3115,7 @@ static inline void __do_contiguous_readpages(struct extent_io_tree *tree, for (index = 0; index < nr_pages; index++) { __do_readpage(tree, pages[index], get_extent, em_cached, bio, - mirror_num, bio_flags, rw, prev_em_start); + mirror_num, bio_flags, 0, prev_em_start); page_cache_release(pages[index]); } } @@ -3122,7 +3125,7 @@ static void __extent_readpages(struct extent_io_tree *tree, int nr_pages, get_extent_t *get_extent, struct extent_map **em_cached, struct bio **bio, int mirror_num, - unsigned long *bio_flags, int rw, + unsigned long *bio_flags, u64 *prev_em_start) { u64 start = 0; @@ -3144,7 +3147,7 @@ static void __extent_readpages(struct extent_io_tree *tree, index - first_index, start, end, get_extent, em_cached, bio, mirror_num, bio_flags, - rw, prev_em_start); + prev_em_start); start = page_start; end = start + PAGE_CACHE_SIZE - 1; first_index = index; @@ -3155,7 +3158,7 @@ static void __extent_readpages(struct extent_io_tree *tree, __do_contiguous_readpages(tree, &pages[first_index], index - first_index, start, end, get_extent, em_cached, bio, - mirror_num, bio_flags, rw, + mirror_num, bio_flags, prev_em_start); } @@ -3163,7 +3166,7 @@ static int __extent_read_full_page(struct extent_io_tree *tree, struct page *page, get_extent_t *get_extent, struct bio **bio, int mirror_num, - unsigned long *bio_flags, int rw) + unsigned long *bio_flags, int read_flags) { struct inode *inode = page->mapping->host; struct btrfs_ordered_extent *ordered; @@ -3183,7 +3186,7 @@ static int __extent_read_full_page(struct extent_io_tree *tree, } ret = __do_readpage(tree, page, get_extent, NULL, bio, mirror_num, - bio_flags, rw, NULL); + bio_flags, read_flags, NULL); return ret; } @@ -3195,9 +3198,9 @@ int extent_read_full_page(struct extent_io_tree *tree, struct page *page, int ret; ret = __extent_read_full_page(tree, page, get_extent, &bio, mirror_num, - &bio_flags, READ); + &bio_flags, 0); if (bio) - ret = submit_one_bio(READ, bio, mirror_num, bio_flags); + ret = submit_one_bio(bio, mirror_num, bio_flags); return ret; } @@ -3444,7 +3447,8 @@ static noinline_for_stack int __extent_writepage_io(struct inode *inode, page->index, cur, end); } - ret = submit_extent_page(write_flags, tree, wbc, page, + ret = submit_extent_page(REQ_OP_WRITE, write_flags, + tree, wbc, page, sector, iosize, pg_offset, bdev, &epd->bio, max_nr, end_bio_extent_writepage, @@ -3484,13 +3488,11 @@ static int __extent_writepage(struct page *page, struct writeback_control *wbc, size_t pg_offset = 0; loff_t i_size = i_size_read(inode); unsigned long end_index = i_size >> PAGE_CACHE_SHIFT; - int write_flags; + int write_flags = 0; unsigned long nr_written = 0; if (wbc->sync_mode == WB_SYNC_ALL) write_flags = WRITE_SYNC; - else - write_flags = WRITE; trace___extent_writepage(page, inode, wbc); @@ -3734,7 +3736,7 @@ static noinline_for_stack int write_one_eb(struct extent_buffer *eb, u64 offset = eb->start; unsigned long i, num_pages; unsigned long bio_flags = 0; - int rw = (epd->sync_io ? WRITE_SYNC : WRITE) | REQ_META; + int write_flags = (epd->sync_io ? WRITE_SYNC : 0) | REQ_META; int ret = 0; clear_bit(EXTENT_BUFFER_WRITE_ERR, &eb->bflags); @@ -3748,9 +3750,10 @@ static noinline_for_stack int write_one_eb(struct extent_buffer *eb, clear_page_dirty_for_io(p); set_page_writeback(p); - ret = submit_extent_page(rw, tree, wbc, p, offset >> 9, - PAGE_CACHE_SIZE, 0, bdev, &epd->bio, - -1, end_bio_extent_buffer_writepage, + ret = submit_extent_page(REQ_OP_WRITE, write_flags, tree, wbc, + p, offset >> 9, PAGE_CACHE_SIZE, 0, + bdev, &epd->bio, -1, + end_bio_extent_buffer_writepage, 0, epd->bio_flags, bio_flags, false); epd->bio_flags = bio_flags; if (ret) { @@ -4039,13 +4042,13 @@ retry: static void flush_epd_write_bio(struct extent_page_data *epd) { if (epd->bio) { - int rw = WRITE; int ret; + epd->bio->bi_op = REQ_OP_WRITE; if (epd->sync_io) - rw = WRITE_SYNC; + epd->bio->bi_rw = WRITE_SYNC; - ret = submit_one_bio(rw, epd->bio, 0, epd->bio_flags); + ret = submit_one_bio(epd->bio, 0, epd->bio_flags); BUG_ON(ret < 0); /* -ENOMEM */ epd->bio = NULL; } @@ -4172,19 +4175,19 @@ int extent_readpages(struct extent_io_tree *tree, if (nr < ARRAY_SIZE(pagepool)) continue; __extent_readpages(tree, pagepool, nr, get_extent, &em_cached, - &bio, 0, &bio_flags, READ, &prev_em_start); + &bio, 0, &bio_flags, &prev_em_start); nr = 0; } if (nr) __extent_readpages(tree, pagepool, nr, get_extent, &em_cached, - &bio, 0, &bio_flags, READ, &prev_em_start); + &bio, 0, &bio_flags, &prev_em_start); if (em_cached) free_extent_map(em_cached); BUG_ON(!list_empty(pages)); if (bio) - return submit_one_bio(READ, bio, 0, bio_flags); + return submit_one_bio(bio, 0, bio_flags); return 0; } @@ -5206,7 +5209,7 @@ int read_extent_buffer_pages(struct extent_io_tree *tree, err = __extent_read_full_page(tree, page, get_extent, &bio, mirror_num, &bio_flags, - READ | REQ_META); + REQ_META); if (err) ret = err; } else { @@ -5215,8 +5218,7 @@ int read_extent_buffer_pages(struct extent_io_tree *tree, } if (bio) { - err = submit_one_bio(READ | REQ_META, bio, mirror_num, - bio_flags); + err = submit_one_bio(bio, mirror_num, bio_flags); if (err) return err; } -- 1.8.3.1 From mchristi@redhat.com Wed Feb 24 13:48:55 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=ham version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay1.corp.sgi.com [137.38.102.111]) by oss.sgi.com (Postfix) with ESMTP id C18437CB9 for ; Wed, 24 Feb 2016 13:48:55 -0600 (CST) Received: from cuda.sgi.com (cuda3.sgi.com [192.48.176.15]) by relay1.corp.sgi.com (Postfix) with ESMTP id 943C68F8033 for ; Wed, 24 Feb 2016 11:48:49 -0800 (PST) X-ASG-Debug-ID: 1456343327-04cb6c455ad5960001-NocioJ Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by cuda.sgi.com with ESMTP id PwZqvPyHpNYsXXAl (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO) for ; Wed, 24 Feb 2016 11:48:48 -0800 (PST) X-Barracuda-Envelope-From: mchristi@redhat.com X-Barracuda-Apparent-Source-IP: 209.132.183.28 X-ASG-Whitelist: Client Received: from int-mx09.intmail.prod.int.phx2.redhat.com (int-mx09.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by mx1.redhat.com (Postfix) with ESMTPS id 9166C78224; Wed, 24 Feb 2016 19:48:47 +0000 (UTC) Received: from rh2.redhat.com (vpn-54-14.rdu2.redhat.com [10.10.54.14]) by int-mx09.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id u1OJmJEE006684; Wed, 24 Feb 2016 14:48:45 -0500 From: mchristi@redhat.com To: linux-f2fs-devel@lists.sourceforge.net, linux-ext4@vger.kernel.org, konrad.wilk@oracle.com, drbd-dev@lists.linbit.com, philipp.reisner@linbit.com, lars.ellenberg@linbit.com, linux-raid@vger.kernel.org, dm-devel@redhat.com, linux-fsdevel@vger.kernel.org, linux-bcache@vger.kernel.org, linux-block@vger.kernel.org, linux-kernel@vger.kernel.org, linux-scsi@vger.kernel.org, linux-mtd@lists.infradead.org, target-devel@vger.kernel.org, linux-btrfs@vger.kernel.org, osd-dev@open-osd.org, xfs@oss.sgi.com, ocfs2-devel@oss.oracle.com Cc: Mike Christie Subject: [PATCH 09/35] btrfs: update __btrfs_map_block for bi_op transition Date: Wed, 24 Feb 2016 13:47:46 -0600 X-ASG-Orig-Subj: [PATCH 09/35] btrfs: update __btrfs_map_block for bi_op transition Message-Id: <1456343292-14535-10-git-send-email-mchristi@redhat.com> In-Reply-To: <1456343292-14535-1-git-send-email-mchristi@redhat.com> References: <1456343292-14535-1-git-send-email-mchristi@redhat.com> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.22 X-Barracuda-Connect: mx1.redhat.com[209.132.183.28] X-Barracuda-Start-Time: 1456343328 X-Barracuda-Encrypted: ECDHE-RSA-AES256-GCM-SHA384 X-Barracuda-URL: https://192.48.176.15:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-BRTS-Status: 1 From: Mike Christie We no longer pass in a bitmap of rq_flag_bits bits to __btrfs_map_block. It will always be a REQ_OP, or the btrfs specific REQ_GET_READ_MIRRORS, so this drops the bit tests. Signed-off-by: Mike Christie --- fs/btrfs/extent-tree.c | 2 +- fs/btrfs/inode.c | 2 +- fs/btrfs/volumes.c | 55 +++++++++++++++++++++++++++----------------------- fs/btrfs/volumes.h | 4 ++-- 4 files changed, 34 insertions(+), 29 deletions(-) diff --git a/fs/btrfs/extent-tree.c b/fs/btrfs/extent-tree.c index 083783b..1db6bd0 100644 --- a/fs/btrfs/extent-tree.c +++ b/fs/btrfs/extent-tree.c @@ -2043,7 +2043,7 @@ int btrfs_discard_extent(struct btrfs_root *root, u64 bytenr, /* Tell the block device(s) that the sectors can be discarded */ - ret = btrfs_map_block(root->fs_info, REQ_DISCARD, + ret = btrfs_map_block(root->fs_info, REQ_OP_DISCARD, bytenr, &num_bytes, &bbio, 0); /* Error condition is -ENOMEM */ if (!ret) { diff --git a/fs/btrfs/inode.c b/fs/btrfs/inode.c index 19f38f5..49842d2 100644 --- a/fs/btrfs/inode.c +++ b/fs/btrfs/inode.c @@ -8279,7 +8279,7 @@ static int btrfs_submit_direct_hook(int rw, struct btrfs_dio_private *dip, int i; map_length = orig_bio->bi_iter.bi_size; - ret = btrfs_map_block(root->fs_info, rw, start_sector << 9, + ret = btrfs_map_block(root->fs_info, orig_bio->bi_op, start_sector << 9, &map_length, NULL, 0); if (ret) return -EIO; diff --git a/fs/btrfs/volumes.c b/fs/btrfs/volumes.c index 2be39f6..62fcbd2 100644 --- a/fs/btrfs/volumes.c +++ b/fs/btrfs/volumes.c @@ -5207,7 +5207,7 @@ void btrfs_put_bbio(struct btrfs_bio *bbio) kfree(bbio); } -static int __btrfs_map_block(struct btrfs_fs_info *fs_info, int rw, +static int __btrfs_map_block(struct btrfs_fs_info *fs_info, int op, u64 logical, u64 *length, struct btrfs_bio **bbio_ret, int mirror_num, int need_raid_map) @@ -5285,7 +5285,7 @@ static int __btrfs_map_block(struct btrfs_fs_info *fs_info, int rw, raid56_full_stripe_start *= full_stripe_len; } - if (rw & REQ_DISCARD) { + if (op == REQ_OP_DISCARD) { /* we don't discard raid56 yet */ if (map->type & BTRFS_BLOCK_GROUP_RAID56_MASK) { ret = -EOPNOTSUPP; @@ -5298,7 +5298,7 @@ static int __btrfs_map_block(struct btrfs_fs_info *fs_info, int rw, For other RAID types and for RAID[56] reads, just allow a single stripe (on a single disk). */ if ((map->type & BTRFS_BLOCK_GROUP_RAID56_MASK) && - (rw & REQ_WRITE)) { + (op == REQ_OP_WRITE)) { max_len = stripe_len * nr_data_stripes(map) - (offset - raid56_full_stripe_start); } else { @@ -5323,8 +5323,8 @@ static int __btrfs_map_block(struct btrfs_fs_info *fs_info, int rw, btrfs_dev_replace_set_lock_blocking(dev_replace); if (dev_replace_is_ongoing && mirror_num == map->num_stripes + 1 && - !(rw & (REQ_WRITE | REQ_DISCARD | REQ_GET_READ_MIRRORS)) && - dev_replace->tgtdev != NULL) { + op != REQ_OP_WRITE && op != REQ_OP_DISCARD && + op != REQ_GET_READ_MIRRORS && dev_replace->tgtdev != NULL) { /* * in dev-replace case, for repair case (that's the only * case where the mirror is selected explicitly when @@ -5411,15 +5411,17 @@ static int __btrfs_map_block(struct btrfs_fs_info *fs_info, int rw, (offset + *length); if (map->type & BTRFS_BLOCK_GROUP_RAID0) { - if (rw & REQ_DISCARD) + if (op == REQ_OP_DISCARD) num_stripes = min_t(u64, map->num_stripes, stripe_nr_end - stripe_nr_orig); stripe_nr = div_u64_rem(stripe_nr, map->num_stripes, &stripe_index); - if (!(rw & (REQ_WRITE | REQ_DISCARD | REQ_GET_READ_MIRRORS))) + if (op != REQ_OP_WRITE && op != REQ_OP_DISCARD && + op != REQ_GET_READ_MIRRORS) mirror_num = 1; } else if (map->type & BTRFS_BLOCK_GROUP_RAID1) { - if (rw & (REQ_WRITE | REQ_DISCARD | REQ_GET_READ_MIRRORS)) + if (op == REQ_OP_WRITE || op == REQ_OP_DISCARD || + op == REQ_GET_READ_MIRRORS) num_stripes = map->num_stripes; else if (mirror_num) stripe_index = mirror_num - 1; @@ -5432,7 +5434,8 @@ static int __btrfs_map_block(struct btrfs_fs_info *fs_info, int rw, } } else if (map->type & BTRFS_BLOCK_GROUP_DUP) { - if (rw & (REQ_WRITE | REQ_DISCARD | REQ_GET_READ_MIRRORS)) { + if (op == REQ_OP_WRITE || REQ_OP_DISCARD || + op == REQ_GET_READ_MIRRORS) { num_stripes = map->num_stripes; } else if (mirror_num) { stripe_index = mirror_num - 1; @@ -5446,9 +5449,9 @@ static int __btrfs_map_block(struct btrfs_fs_info *fs_info, int rw, stripe_nr = div_u64_rem(stripe_nr, factor, &stripe_index); stripe_index *= map->sub_stripes; - if (rw & (REQ_WRITE | REQ_GET_READ_MIRRORS)) + if (op == REQ_OP_WRITE || op == REQ_GET_READ_MIRRORS) num_stripes = map->sub_stripes; - else if (rw & REQ_DISCARD) + else if (op == REQ_OP_DISCARD) num_stripes = min_t(u64, map->sub_stripes * (stripe_nr_end - stripe_nr_orig), map->num_stripes); @@ -5466,7 +5469,7 @@ static int __btrfs_map_block(struct btrfs_fs_info *fs_info, int rw, } else if (map->type & BTRFS_BLOCK_GROUP_RAID56_MASK) { if (need_raid_map && - ((rw & (REQ_WRITE | REQ_GET_READ_MIRRORS)) || + (op == REQ_OP_WRITE || op == REQ_GET_READ_MIRRORS || mirror_num > 1)) { /* push stripe_nr back to the start of the full stripe */ stripe_nr = div_u64(raid56_full_stripe_start, @@ -5494,8 +5497,8 @@ static int __btrfs_map_block(struct btrfs_fs_info *fs_info, int rw, /* We distribute the parity blocks across stripes */ div_u64_rem(stripe_nr + stripe_index, map->num_stripes, &stripe_index); - if (!(rw & (REQ_WRITE | REQ_DISCARD | - REQ_GET_READ_MIRRORS)) && mirror_num <= 1) + if ((op != REQ_OP_WRITE && op != REQ_OP_DISCARD && + op != REQ_GET_READ_MIRRORS) && mirror_num <= 1) mirror_num = 1; } } else { @@ -5512,9 +5515,9 @@ static int __btrfs_map_block(struct btrfs_fs_info *fs_info, int rw, num_alloc_stripes = num_stripes; if (dev_replace_is_ongoing) { - if (rw & (REQ_WRITE | REQ_DISCARD)) + if (op == REQ_OP_WRITE || op == REQ_OP_DISCARD) num_alloc_stripes <<= 1; - if (rw & REQ_GET_READ_MIRRORS) + if (op == REQ_GET_READ_MIRRORS) num_alloc_stripes++; tgtdev_indexes = num_stripes; } @@ -5529,7 +5532,8 @@ static int __btrfs_map_block(struct btrfs_fs_info *fs_info, int rw, /* build raid_map */ if (map->type & BTRFS_BLOCK_GROUP_RAID56_MASK && - need_raid_map && ((rw & (REQ_WRITE | REQ_GET_READ_MIRRORS)) || + need_raid_map && + ((op == REQ_OP_WRITE || op == REQ_GET_READ_MIRRORS) || mirror_num > 1)) { u64 tmp; unsigned rot; @@ -5554,7 +5558,7 @@ static int __btrfs_map_block(struct btrfs_fs_info *fs_info, int rw, RAID6_Q_STRIPE; } - if (rw & REQ_DISCARD) { + if (op == REQ_OP_DISCARD) { u32 factor = 0; u32 sub_stripes = 0; u64 stripes_per_dev = 0; @@ -5634,14 +5638,15 @@ static int __btrfs_map_block(struct btrfs_fs_info *fs_info, int rw, } } - if (rw & (REQ_WRITE | REQ_GET_READ_MIRRORS)) + if (op == REQ_OP_WRITE || op == REQ_GET_READ_MIRRORS) max_errors = btrfs_chunk_max_errors(map); if (bbio->raid_map) sort_parity_stripes(bbio, num_stripes); tgtdev_indexes = 0; - if (dev_replace_is_ongoing && (rw & (REQ_WRITE | REQ_DISCARD)) && + if (dev_replace_is_ongoing && + (op == REQ_OP_WRITE || op == REQ_OP_DISCARD) && dev_replace->tgtdev != NULL) { int index_where_to_add; u64 srcdev_devid = dev_replace->srcdev->devid; @@ -5676,7 +5681,7 @@ static int __btrfs_map_block(struct btrfs_fs_info *fs_info, int rw, } } num_stripes = index_where_to_add; - } else if (dev_replace_is_ongoing && (rw & REQ_GET_READ_MIRRORS) && + } else if (dev_replace_is_ongoing && (op == REQ_GET_READ_MIRRORS) && dev_replace->tgtdev != NULL) { u64 srcdev_devid = dev_replace->srcdev->devid; int index_srcdev = 0; @@ -5751,21 +5756,21 @@ out: return ret; } -int btrfs_map_block(struct btrfs_fs_info *fs_info, int rw, +int btrfs_map_block(struct btrfs_fs_info *fs_info, int op, u64 logical, u64 *length, struct btrfs_bio **bbio_ret, int mirror_num) { - return __btrfs_map_block(fs_info, rw, logical, length, bbio_ret, + return __btrfs_map_block(fs_info, op, logical, length, bbio_ret, mirror_num, 0); } /* For Scrub/replace */ -int btrfs_map_sblock(struct btrfs_fs_info *fs_info, int rw, +int btrfs_map_sblock(struct btrfs_fs_info *fs_info, int op, u64 logical, u64 *length, struct btrfs_bio **bbio_ret, int mirror_num, int need_raid_map) { - return __btrfs_map_block(fs_info, rw, logical, length, bbio_ret, + return __btrfs_map_block(fs_info, op, logical, length, bbio_ret, mirror_num, need_raid_map); } diff --git a/fs/btrfs/volumes.h b/fs/btrfs/volumes.h index febdb7b..c64229e 100644 --- a/fs/btrfs/volumes.h +++ b/fs/btrfs/volumes.h @@ -421,10 +421,10 @@ int btrfs_account_dev_extents_size(struct btrfs_device *device, u64 start, u64 end, u64 *length); void btrfs_get_bbio(struct btrfs_bio *bbio); void btrfs_put_bbio(struct btrfs_bio *bbio); -int btrfs_map_block(struct btrfs_fs_info *fs_info, int rw, +int btrfs_map_block(struct btrfs_fs_info *fs_info, int op, u64 logical, u64 *length, struct btrfs_bio **bbio_ret, int mirror_num); -int btrfs_map_sblock(struct btrfs_fs_info *fs_info, int rw, +int btrfs_map_sblock(struct btrfs_fs_info *fs_info, int op, u64 logical, u64 *length, struct btrfs_bio **bbio_ret, int mirror_num, int need_raid_map); -- 1.8.3.1 From mchristi@redhat.com Wed Feb 24 13:48:58 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=ham version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay1.corp.sgi.com [137.38.102.111]) by oss.sgi.com (Postfix) with ESMTP id 7B37E7CB9 for ; Wed, 24 Feb 2016 13:48:58 -0600 (CST) Received: from cuda.sgi.com (cuda2.sgi.com [192.48.176.25]) by relay1.corp.sgi.com (Postfix) with ESMTP id 4AC838F8037 for ; Wed, 24 Feb 2016 11:48:52 -0800 (PST) X-ASG-Debug-ID: 1456343325-04cbb06adffd350001-NocioJ Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by cuda.sgi.com with ESMTP id nNWz5tDxFDJSNE9D (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO) for ; Wed, 24 Feb 2016 11:48:45 -0800 (PST) X-Barracuda-Envelope-From: mchristi@redhat.com X-Barracuda-Apparent-Source-IP: 209.132.183.28 X-ASG-Whitelist: Client Received: from int-mx09.intmail.prod.int.phx2.redhat.com (int-mx09.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by mx1.redhat.com (Postfix) with ESMTPS id E9F757EBA0; Wed, 24 Feb 2016 19:48:44 +0000 (UTC) Received: from rh2.redhat.com (vpn-54-14.rdu2.redhat.com [10.10.54.14]) by int-mx09.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id u1OJmJED006684; Wed, 24 Feb 2016 14:48:42 -0500 From: mchristi@redhat.com To: linux-f2fs-devel@lists.sourceforge.net, linux-ext4@vger.kernel.org, konrad.wilk@oracle.com, drbd-dev@lists.linbit.com, philipp.reisner@linbit.com, lars.ellenberg@linbit.com, linux-raid@vger.kernel.org, dm-devel@redhat.com, linux-fsdevel@vger.kernel.org, linux-bcache@vger.kernel.org, linux-block@vger.kernel.org, linux-kernel@vger.kernel.org, linux-scsi@vger.kernel.org, linux-mtd@lists.infradead.org, target-devel@vger.kernel.org, linux-btrfs@vger.kernel.org, osd-dev@open-osd.org, xfs@oss.sgi.com, ocfs2-devel@oss.oracle.com Cc: Mike Christie Subject: [PATCH 08/35] btrfs: set bi_op tp REQ_OP Date: Wed, 24 Feb 2016 13:47:45 -0600 X-ASG-Orig-Subj: [PATCH 08/35] btrfs: set bi_op tp REQ_OP Message-Id: <1456343292-14535-9-git-send-email-mchristi@redhat.com> In-Reply-To: <1456343292-14535-1-git-send-email-mchristi@redhat.com> References: <1456343292-14535-1-git-send-email-mchristi@redhat.com> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.22 X-Barracuda-Connect: mx1.redhat.com[209.132.183.28] X-Barracuda-Start-Time: 1456343325 X-Barracuda-Encrypted: ECDHE-RSA-AES256-GCM-SHA384 X-Barracuda-URL: https://192.48.176.25:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-BRTS-Status: 1 From: Mike Christie This patch has btrfs set the bio bi_op to a REQ_OP, and rq_flag_bits to bi_rw. Signed-off-by: Mike Christie --- fs/btrfs/check-integrity.c | 19 +++++++++---------- fs/btrfs/compression.c | 4 ++++ fs/btrfs/disk-io.c | 7 ++++--- fs/btrfs/inode.c | 20 +++++++++++++------- fs/btrfs/raid56.c | 10 +++++----- fs/btrfs/scrub.c | 9 +++++---- fs/btrfs/volumes.c | 20 ++++++++++---------- 7 files changed, 50 insertions(+), 39 deletions(-) diff --git a/fs/btrfs/check-integrity.c b/fs/btrfs/check-integrity.c index 1c3c40a..d95c323 100644 --- a/fs/btrfs/check-integrity.c +++ b/fs/btrfs/check-integrity.c @@ -1671,7 +1671,7 @@ static int btrfsic_read_block(struct btrfsic_state *state, } bio->bi_bdev = block_ctx->dev->bdev; bio->bi_iter.bi_sector = dev_bytenr >> 9; - bio->bi_rw = READ; + bio->bi_op = REQ_OP_READ; for (j = i; j < num_pages; j++) { ret = bio_add_page(bio, block_ctx->pagev[j], @@ -2920,7 +2920,6 @@ int btrfsic_submit_bh(int op, int op_flags, struct buffer_head *bh) static void __btrfsic_submit_bio(struct bio *bio) { struct btrfsic_dev_state *dev_state; - int rw = bio->bi_rw; if (!btrfsic_is_initialized) return; @@ -2930,7 +2929,7 @@ static void __btrfsic_submit_bio(struct bio *bio) * btrfsic_mount(), this might return NULL */ dev_state = btrfsic_dev_state_lookup(bio->bi_bdev); if (NULL != dev_state && - (rw & WRITE) && NULL != bio->bi_io_vec) { + (bio->bi_op == REQ_OP_WRITE) && NULL != bio->bi_io_vec) { unsigned int i; u64 dev_bytenr; u64 cur_bytenr; @@ -2942,9 +2941,9 @@ static void __btrfsic_submit_bio(struct bio *bio) if (dev_state->state->print_mask & BTRFSIC_PRINT_MASK_SUBMIT_BIO_BH) printk(KERN_INFO - "submit_bio(rw=0x%x, bi_vcnt=%u," + "submit_bio(rw=%d,0x%lx, bi_vcnt=%u," " bi_sector=%llu (bytenr %llu), bi_bdev=%p)\n", - rw, bio->bi_vcnt, + bio->bi_op, bio->bi_rw, bio->bi_vcnt, (unsigned long long)bio->bi_iter.bi_sector, dev_bytenr, bio->bi_bdev); @@ -2975,18 +2974,18 @@ static void __btrfsic_submit_bio(struct bio *bio) btrfsic_process_written_block(dev_state, dev_bytenr, mapped_datav, bio->bi_vcnt, bio, &bio_is_patched, - NULL, rw); + NULL, bio->bi_rw); while (i > 0) { i--; kunmap(bio->bi_io_vec[i].bv_page); } kfree(mapped_datav); - } else if (NULL != dev_state && (rw & REQ_FLUSH)) { + } else if (NULL != dev_state && (bio->bi_rw & REQ_FLUSH)) { if (dev_state->state->print_mask & BTRFSIC_PRINT_MASK_SUBMIT_BIO_BH) printk(KERN_INFO - "submit_bio(rw=0x%x FLUSH, bdev=%p)\n", - rw, bio->bi_bdev); + "submit_bio(rw=%d,0x%lx FLUSH, bdev=%p)\n", + bio->bi_op, bio->bi_rw, bio->bi_bdev); if (!dev_state->dummy_block_for_bio_bh_flush.is_iodone) { if ((dev_state->state->print_mask & (BTRFSIC_PRINT_MASK_SUBMIT_BIO_BH | @@ -3004,7 +3003,7 @@ static void __btrfsic_submit_bio(struct bio *bio) block->never_written = 0; block->iodone_w_error = 0; block->flush_gen = dev_state->last_flush_gen + 1; - block->submit_bio_bh_rw = rw; + block->submit_bio_bh_rw = bio->bi_rw; block->orig_bio_bh_private = bio->bi_private; block->orig_bio_bh_end_io.bio = bio->bi_end_io; block->next_in_same_bio = NULL; diff --git a/fs/btrfs/compression.c b/fs/btrfs/compression.c index 3346cd8..7e64f3e 100644 --- a/fs/btrfs/compression.c +++ b/fs/btrfs/compression.c @@ -363,6 +363,7 @@ int btrfs_submit_compressed_write(struct inode *inode, u64 start, kfree(cb); return -ENOMEM; } + bio->bi_op = REQ_OP_WRITE; bio->bi_private = cb; bio->bi_end_io = end_compressed_bio_write; atomic_inc(&cb->pending_bios); @@ -408,6 +409,7 @@ int btrfs_submit_compressed_write(struct inode *inode, u64 start, bio = compressed_bio_alloc(bdev, first_byte, GFP_NOFS); BUG_ON(!bio); + bio->bi_op = REQ_OP_WRITE; bio->bi_private = cb; bio->bi_end_io = end_compressed_bio_write; bio_add_page(bio, page, PAGE_CACHE_SIZE, 0); @@ -646,6 +648,7 @@ int btrfs_submit_compressed_read(struct inode *inode, struct bio *bio, comp_bio = compressed_bio_alloc(bdev, cur_disk_byte, GFP_NOFS); if (!comp_bio) goto fail2; + comp_bio->bi_op = REQ_OP_READ; comp_bio->bi_private = cb; comp_bio->bi_end_io = end_compressed_bio_read; atomic_inc(&cb->pending_bios); @@ -699,6 +702,7 @@ int btrfs_submit_compressed_read(struct inode *inode, struct bio *bio, comp_bio = compressed_bio_alloc(bdev, cur_disk_byte, GFP_NOFS); BUG_ON(!comp_bio); + comp_bio->bi_op = REQ_OP_READ; comp_bio->bi_private = cb; comp_bio->bi_end_io = end_compressed_bio_read; diff --git a/fs/btrfs/disk-io.c b/fs/btrfs/disk-io.c index bb23db7..49d2f29 100644 --- a/fs/btrfs/disk-io.c +++ b/fs/btrfs/disk-io.c @@ -719,7 +719,7 @@ static void end_workqueue_bio(struct bio *bio) fs_info = end_io_wq->info; end_io_wq->error = bio->bi_error; - if (bio->bi_rw & REQ_WRITE) { + if (bio->bi_op == REQ_OP_WRITE) { if (end_io_wq->metadata == BTRFS_WQ_ENDIO_METADATA) { wq = fs_info->endio_meta_write_workers; func = btrfs_endio_meta_write_helper; @@ -865,7 +865,7 @@ int btrfs_wq_submit_bio(struct btrfs_fs_info *fs_info, struct inode *inode, atomic_inc(&fs_info->nr_async_submits); - if (rw & REQ_SYNC) + if (bio->bi_rw & REQ_SYNC) btrfs_set_work_high_priority(&async->work); btrfs_queue_work(fs_info->workers, &async->work); @@ -943,7 +943,7 @@ static int btree_submit_bio_hook(struct inode *inode, int rw, struct bio *bio, int async = check_async_write(inode, bio_flags); int ret; - if (!(rw & REQ_WRITE)) { + if (bio->bi_op != REQ_OP_WRITE) { /* * called for a read, do the setup so that checksum validation * can happen in the async kernel threads @@ -3470,6 +3470,7 @@ static int write_dev_flush(struct btrfs_device *device, int wait) bio->bi_end_io = btrfs_end_empty_barrier; bio->bi_bdev = device->bdev; + bio->bi_op = REQ_OP_WRITE; bio->bi_rw = WRITE_FLUSH; init_completion(&device->flush_wait); bio->bi_private = &device->flush_wait; diff --git a/fs/btrfs/inode.c b/fs/btrfs/inode.c index 3a7fe66..19f38f5 100644 --- a/fs/btrfs/inode.c +++ b/fs/btrfs/inode.c @@ -1894,7 +1894,7 @@ static int btrfs_submit_bio_hook(struct inode *inode, int rw, struct bio *bio, if (btrfs_is_free_space_inode(inode)) metadata = BTRFS_WQ_ENDIO_FREE_SPACE; - if (!(rw & REQ_WRITE)) { + if (bio->bi_op != REQ_OP_WRITE) { ret = btrfs_bio_wq_end_io(root->fs_info, bio, metadata); if (ret) goto out; @@ -7730,7 +7730,7 @@ static inline int submit_dio_repair_bio(struct inode *inode, struct bio *bio, struct btrfs_root *root = BTRFS_I(inode)->root; int ret; - BUG_ON(rw & REQ_WRITE); + BUG_ON(bio->bi_op == REQ_OP_WRITE); bio_get(bio); @@ -7790,7 +7790,7 @@ static int dio_read_error(struct inode *inode, struct bio *failed_bio, int read_mode; int ret; - BUG_ON(failed_bio->bi_rw & REQ_WRITE); + BUG_ON(failed_bio->bi_op == REQ_OP_WRITE); ret = btrfs_get_io_failure_record(inode, start, end, &failrec); if (ret) @@ -7818,6 +7818,8 @@ static int dio_read_error(struct inode *inode, struct bio *failed_bio, free_io_failure(inode, failrec); return -EIO; } + bio->bi_op = REQ_OP_READ; + bio->bi_rw = read_mode; btrfs_debug(BTRFS_I(inode)->root->fs_info, "Repair DIO Read Error: submitting new dio read[%#x] to this_mirror=%d, in_validation=%d\n", @@ -8132,8 +8134,8 @@ static void btrfs_end_dio_bio(struct bio *bio) if (err) btrfs_warn(BTRFS_I(dip->inode)->root->fs_info, - "direct IO failed ino %llu rw %lu sector %#Lx len %u err no %d", - btrfs_ino(dip->inode), bio->bi_rw, + "direct IO failed ino %llu rw %d,%lu sector %#Lx len %u err no %d", + btrfs_ino(dip->inode), bio->bi_op, bio->bi_rw, (unsigned long long)bio->bi_iter.bi_sector, bio->bi_iter.bi_size, err); @@ -8211,7 +8213,7 @@ static inline int __btrfs_submit_dio_bio(struct bio *bio, struct inode *inode, int async_submit) { struct btrfs_dio_private *dip = bio->bi_private; - int write = rw & REQ_WRITE; + bool write = bio->bi_op == REQ_OP_WRITE; struct btrfs_root *root = BTRFS_I(inode)->root; int ret; @@ -8298,6 +8300,8 @@ static int btrfs_submit_direct_hook(int rw, struct btrfs_dio_private *dip, if (!bio) return -ENOMEM; + bio->bi_op = orig_bio->bi_op; + bio->bi_rw = orig_bio->bi_rw; bio->bi_private = dip; bio->bi_end_io = btrfs_end_dio_bio; btrfs_io_bio(bio)->logical = file_offset; @@ -8335,12 +8339,14 @@ next_block: start_sector, GFP_NOFS); if (!bio) goto out_err; + bio->bi_op = orig_bio->bi_op; + bio->bi_rw = orig_bio->bi_rw; bio->bi_private = dip; bio->bi_end_io = btrfs_end_dio_bio; btrfs_io_bio(bio)->logical = file_offset; map_length = orig_bio->bi_iter.bi_size; - ret = btrfs_map_block(root->fs_info, rw, + ret = btrfs_map_block(root->fs_info, orig_bio->bi_op, start_sector << 9, &map_length, NULL, 0); if (ret) { diff --git a/fs/btrfs/raid56.c b/fs/btrfs/raid56.c index a8e66e4..8aa3ec9 100644 --- a/fs/btrfs/raid56.c +++ b/fs/btrfs/raid56.c @@ -1320,7 +1320,7 @@ write_data: bio->bi_private = rbio; bio->bi_end_io = raid_write_end_io; - bio->bi_rw = WRITE; + bio->bi_op = REQ_OP_WRITE; submit_bio(bio); } @@ -1575,7 +1575,7 @@ static int raid56_rmw_stripe(struct btrfs_raid_bio *rbio) bio->bi_private = rbio; bio->bi_end_io = raid_rmw_end_io; - bio->bi_rw = READ; + bio->bi_op = REQ_OP_READ; btrfs_bio_wq_end_io(rbio->fs_info, bio, BTRFS_WQ_ENDIO_RAID56); @@ -2100,7 +2100,7 @@ static int __raid56_parity_recover(struct btrfs_raid_bio *rbio) bio->bi_private = rbio; bio->bi_end_io = raid_recover_end_io; - bio->bi_rw = READ; + bio->bi_op = REQ_OP_READ; btrfs_bio_wq_end_io(rbio->fs_info, bio, BTRFS_WQ_ENDIO_RAID56); @@ -2437,7 +2437,7 @@ submit_write: bio->bi_private = rbio; bio->bi_end_io = raid_write_end_io; - bio->bi_rw = WRITE; + bio->bi_rw = REQ_OP_WRITE; submit_bio(bio); } @@ -2616,7 +2616,7 @@ static void raid56_parity_scrub_stripe(struct btrfs_raid_bio *rbio) bio->bi_private = rbio; bio->bi_end_io = raid56_parity_scrub_end_io; - bio->bi_rw = READ; + bio->bi_op = REQ_OP_READ; btrfs_bio_wq_end_io(rbio->fs_info, bio, BTRFS_WQ_ENDIO_RAID56); diff --git a/fs/btrfs/scrub.c b/fs/btrfs/scrub.c index 8315947..7273efe 100644 --- a/fs/btrfs/scrub.c +++ b/fs/btrfs/scrub.c @@ -1504,7 +1504,7 @@ static void scrub_recheck_block(struct btrfs_fs_info *fs_info, sblock->no_io_error_seen = 0; } else { bio->bi_iter.bi_sector = page->physical >> 9; - bio->bi_rw = READ; + bio->bi_op = REQ_OP_READ; if (btrfsic_submit_bio_wait(bio)) sblock->no_io_error_seen = 0; @@ -1584,7 +1584,7 @@ static int scrub_repair_page_from_good_copy(struct scrub_block *sblock_bad, return -EIO; bio->bi_bdev = page_bad->dev->bdev; bio->bi_iter.bi_sector = page_bad->physical >> 9; - bio->bi_rw = WRITE; + bio->bi_op = REQ_OP_WRITE; ret = bio_add_page(bio, page_good->page, PAGE_SIZE, 0); if (PAGE_SIZE != ret) { @@ -1686,7 +1686,7 @@ again: bio->bi_end_io = scrub_wr_bio_end_io; bio->bi_bdev = sbio->dev->bdev; bio->bi_iter.bi_sector = sbio->physical >> 9; - bio->bi_rw = WRITE; + bio->bi_op = REQ_OP_WRITE; sbio->err = 0; } else if (sbio->physical + sbio->page_count * PAGE_SIZE != spage->physical_for_dev_replace || @@ -2091,7 +2091,7 @@ again: bio->bi_end_io = scrub_bio_end_io; bio->bi_bdev = sbio->dev->bdev; bio->bi_iter.bi_sector = sbio->physical >> 9; - bio->bi_rw = READ; + bio->bi_op = REQ_OP_READ; sbio->err = 0; } else if (sbio->physical + sbio->page_count * PAGE_SIZE != spage->physical || @@ -4394,6 +4394,7 @@ static int write_page_nocow(struct scrub_ctx *sctx, bio->bi_iter.bi_size = 0; bio->bi_iter.bi_sector = physical_for_dev_replace >> 9; bio->bi_bdev = dev->bdev; + bio->bi_op = REQ_OP_WRITE; bio->bi_rw = WRITE_SYNC; ret = bio_add_page(bio, page, PAGE_CACHE_SIZE, 0); diff --git a/fs/btrfs/volumes.c b/fs/btrfs/volumes.c index f87678f..2be39f6 100644 --- a/fs/btrfs/volumes.c +++ b/fs/btrfs/volumes.c @@ -5879,7 +5879,7 @@ static void btrfs_end_bio(struct bio *bio) BUG_ON(stripe_index >= bbio->num_stripes); dev = bbio->stripes[stripe_index].dev; if (dev->bdev) { - if (bio->bi_rw & WRITE) + if (bio->bi_op == REQ_OP_WRITE) btrfs_dev_stat_inc(dev, BTRFS_DEV_STAT_WRITE_ERRS); else @@ -5944,7 +5944,7 @@ static noinline void btrfs_schedule_bio(struct btrfs_root *root, } /* don't bother with additional async steps for reads, right now */ - if (!(bio->bi_rw & REQ_WRITE)) { + if (bio->bi_op == REQ_OP_READ) { bio_get(bio); btrfsic_submit_bio(bio); bio_put(bio); @@ -5993,15 +5993,14 @@ static void submit_stripe_bio(struct btrfs_root *root, struct btrfs_bio *bbio, btrfs_io_bio(bio)->stripe_index = dev_nr; bio->bi_end_io = btrfs_end_bio; bio->bi_iter.bi_sector = physical >> 9; - bio->bi_rw |= rw; #ifdef DEBUG { struct rcu_string *name; rcu_read_lock(); name = rcu_dereference(dev->name); - pr_debug("btrfs_map_bio: rw %d, sector=%llu, dev=%lu " - "(%s id %llu), size=%u\n", rw, + pr_debug("btrfs_map_bio: rw %d 0x%x, sector=%llu, dev=%lu " + "(%s id %llu), size=%u\n", bio->bi_op, bio->bi_rw, (u64)bio->bi_iter.bi_sector, (u_long)dev->bdev->bd_dev, name->str, dev->devid, bio->bi_iter.bi_size); rcu_read_unlock(); @@ -6048,8 +6047,8 @@ int btrfs_map_bio(struct btrfs_root *root, int rw, struct bio *bio, map_length = length; btrfs_bio_counter_inc_blocked(root->fs_info); - ret = __btrfs_map_block(root->fs_info, rw, logical, &map_length, &bbio, - mirror_num, 1); + ret = __btrfs_map_block(root->fs_info, bio->bi_op, logical, + &map_length, &bbio, mirror_num, 1); if (ret) { btrfs_bio_counter_dec(root->fs_info); return ret; @@ -6063,10 +6062,10 @@ int btrfs_map_bio(struct btrfs_root *root, int rw, struct bio *bio, atomic_set(&bbio->stripes_pending, bbio->num_stripes); if ((bbio->map_type & BTRFS_BLOCK_GROUP_RAID56_MASK) && - ((rw & WRITE) || (mirror_num > 1))) { + ((bio->bi_op == REQ_OP_WRITE) || (mirror_num > 1))) { /* In this case, map_length has been set to the length of a single stripe; not the whole write */ - if (rw & WRITE) { + if (bio->bi_op == REQ_OP_WRITE) { ret = raid56_parity_write(root, bio, bbio, map_length); } else { ret = raid56_parity_recover(root, bio, bbio, map_length, @@ -6085,7 +6084,8 @@ int btrfs_map_bio(struct btrfs_root *root, int rw, struct bio *bio, for (dev_nr = 0; dev_nr < total_devs; dev_nr++) { dev = bbio->stripes[dev_nr].dev; - if (!dev || !dev->bdev || (rw & WRITE && !dev->writeable)) { + if (!dev || !dev->bdev || + (bio->bi_op == REQ_OP_WRITE && !dev->writeable)) { bbio_error(bbio, first_bio, logical); continue; } -- 1.8.3.1 From mchristi@redhat.com Wed Feb 24 13:48:59 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=ham version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay1.corp.sgi.com [137.38.102.111]) by oss.sgi.com (Postfix) with ESMTP id 4E2B17F5F for ; Wed, 24 Feb 2016 13:48:59 -0600 (CST) Received: from cuda.sgi.com (cuda2.sgi.com [192.48.176.25]) by relay1.corp.sgi.com (Postfix) with ESMTP id 1C4D88F8039 for ; Wed, 24 Feb 2016 11:48:53 -0800 (PST) X-ASG-Debug-ID: 1456343330-04cbb06adefd360001-NocioJ Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by cuda.sgi.com with ESMTP id dQPrBj3pXnuIh32k (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO) for ; Wed, 24 Feb 2016 11:48:51 -0800 (PST) X-Barracuda-Envelope-From: mchristi@redhat.com X-Barracuda-Apparent-Source-IP: 209.132.183.28 X-ASG-Whitelist: Client Received: from int-mx09.intmail.prod.int.phx2.redhat.com (int-mx09.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by mx1.redhat.com (Postfix) with ESMTPS id 426BB335E93; Wed, 24 Feb 2016 19:48:50 +0000 (UTC) Received: from rh2.redhat.com (vpn-54-14.rdu2.redhat.com [10.10.54.14]) by int-mx09.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id u1OJmJEF006684; Wed, 24 Feb 2016 14:48:47 -0500 From: mchristi@redhat.com To: linux-f2fs-devel@lists.sourceforge.net, linux-ext4@vger.kernel.org, konrad.wilk@oracle.com, drbd-dev@lists.linbit.com, philipp.reisner@linbit.com, lars.ellenberg@linbit.com, linux-raid@vger.kernel.org, dm-devel@redhat.com, linux-fsdevel@vger.kernel.org, linux-bcache@vger.kernel.org, linux-block@vger.kernel.org, linux-kernel@vger.kernel.org, linux-scsi@vger.kernel.org, linux-mtd@lists.infradead.org, target-devel@vger.kernel.org, linux-btrfs@vger.kernel.org, osd-dev@open-osd.org, xfs@oss.sgi.com, ocfs2-devel@oss.oracle.com Cc: Mike Christie Subject: [PATCH 10/35] btrfs: don't pass rq_flag_bits if there is a bio Date: Wed, 24 Feb 2016 13:47:47 -0600 X-ASG-Orig-Subj: [PATCH 10/35] btrfs: don't pass rq_flag_bits if there is a bio Message-Id: <1456343292-14535-11-git-send-email-mchristi@redhat.com> In-Reply-To: <1456343292-14535-1-git-send-email-mchristi@redhat.com> References: <1456343292-14535-1-git-send-email-mchristi@redhat.com> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.22 X-Barracuda-Connect: mx1.redhat.com[209.132.183.28] X-Barracuda-Start-Time: 1456343330 X-Barracuda-Encrypted: ECDHE-RSA-AES256-GCM-SHA384 X-Barracuda-URL: https://192.48.176.25:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-BRTS-Status: 1 From: Mike Christie The bio bi_op and bi_rw is now setup, so there is no need to pass around the rq_flag_bits bits too. v2: 1. Fix merge_bio issue where instead of removing rw/op argument I passed it in again to the merge_bio related functions. Signed-off-by: Mike Christie --- fs/btrfs/compression.c | 13 ++++++------- fs/btrfs/ctree.h | 2 +- fs/btrfs/disk-io.c | 30 ++++++++++++------------------ fs/btrfs/disk-io.h | 2 +- fs/btrfs/extent_io.c | 12 +++++------- fs/btrfs/extent_io.h | 8 ++++---- fs/btrfs/inode.c | 44 ++++++++++++++++++++------------------------ fs/btrfs/volumes.c | 6 +++--- fs/btrfs/volumes.h | 2 +- 9 files changed, 53 insertions(+), 66 deletions(-) diff --git a/fs/btrfs/compression.c b/fs/btrfs/compression.c index 7e64f3e..90028305 100644 --- a/fs/btrfs/compression.c +++ b/fs/btrfs/compression.c @@ -374,7 +374,7 @@ int btrfs_submit_compressed_write(struct inode *inode, u64 start, page = compressed_pages[pg_index]; page->mapping = inode->i_mapping; if (bio->bi_iter.bi_size) - ret = io_tree->ops->merge_bio_hook(WRITE, page, 0, + ret = io_tree->ops->merge_bio_hook(page, 0, PAGE_CACHE_SIZE, bio, 0); else @@ -402,7 +402,7 @@ int btrfs_submit_compressed_write(struct inode *inode, u64 start, BUG_ON(ret); /* -ENOMEM */ } - ret = btrfs_map_bio(root, WRITE, bio, 0, 1); + ret = btrfs_map_bio(root, bio, 0, 1); BUG_ON(ret); /* -ENOMEM */ bio_put(bio); @@ -433,7 +433,7 @@ int btrfs_submit_compressed_write(struct inode *inode, u64 start, BUG_ON(ret); /* -ENOMEM */ } - ret = btrfs_map_bio(root, WRITE, bio, 0, 1); + ret = btrfs_map_bio(root, bio, 0, 1); BUG_ON(ret); /* -ENOMEM */ bio_put(bio); @@ -659,7 +659,7 @@ int btrfs_submit_compressed_read(struct inode *inode, struct bio *bio, page->index = em_start >> PAGE_CACHE_SHIFT; if (comp_bio->bi_iter.bi_size) - ret = tree->ops->merge_bio_hook(READ, page, 0, + ret = tree->ops->merge_bio_hook(page, 0, PAGE_CACHE_SIZE, comp_bio, 0); else @@ -690,8 +690,7 @@ int btrfs_submit_compressed_read(struct inode *inode, struct bio *bio, sums += DIV_ROUND_UP(comp_bio->bi_iter.bi_size, root->sectorsize); - ret = btrfs_map_bio(root, READ, comp_bio, - mirror_num, 0); + ret = btrfs_map_bio(root, comp_bio, mirror_num, 0); if (ret) { bio->bi_error = ret; bio_endio(comp_bio); @@ -721,7 +720,7 @@ int btrfs_submit_compressed_read(struct inode *inode, struct bio *bio, BUG_ON(ret); /* -ENOMEM */ } - ret = btrfs_map_bio(root, READ, comp_bio, mirror_num, 0); + ret = btrfs_map_bio(root, comp_bio, mirror_num, 0); if (ret) { bio->bi_error = ret; bio_endio(comp_bio); diff --git a/fs/btrfs/ctree.h b/fs/btrfs/ctree.h index b69ad13..1c6bae3 100644 --- a/fs/btrfs/ctree.h +++ b/fs/btrfs/ctree.h @@ -4084,7 +4084,7 @@ int btrfs_create_subvol_root(struct btrfs_trans_handle *trans, struct btrfs_root *new_root, struct btrfs_root *parent_root, u64 new_dirid); -int btrfs_merge_bio_hook(int rw, struct page *page, unsigned long offset, +int btrfs_merge_bio_hook(struct page *page, unsigned long offset, size_t size, struct bio *bio, unsigned long bio_flags); int btrfs_page_mkwrite(struct vm_area_struct *vma, struct vm_fault *vmf); diff --git a/fs/btrfs/disk-io.c b/fs/btrfs/disk-io.c index 49d2f29..9aa2b53 100644 --- a/fs/btrfs/disk-io.c +++ b/fs/btrfs/disk-io.c @@ -124,7 +124,6 @@ struct async_submit_bio { struct list_head list; extent_submit_bio_hook_t *submit_bio_start; extent_submit_bio_hook_t *submit_bio_done; - int rw; int mirror_num; unsigned long bio_flags; /* @@ -789,7 +788,7 @@ static void run_one_async_start(struct btrfs_work *work) int ret; async = container_of(work, struct async_submit_bio, work); - ret = async->submit_bio_start(async->inode, async->rw, async->bio, + ret = async->submit_bio_start(async->inode, async->bio, async->mirror_num, async->bio_flags, async->bio_offset); if (ret) @@ -822,9 +821,8 @@ static void run_one_async_done(struct btrfs_work *work) return; } - async->submit_bio_done(async->inode, async->rw, async->bio, - async->mirror_num, async->bio_flags, - async->bio_offset); + async->submit_bio_done(async->inode, async->bio, async->mirror_num, + async->bio_flags, async->bio_offset); } static void run_one_async_free(struct btrfs_work *work) @@ -836,7 +834,7 @@ static void run_one_async_free(struct btrfs_work *work) } int btrfs_wq_submit_bio(struct btrfs_fs_info *fs_info, struct inode *inode, - int rw, struct bio *bio, int mirror_num, + struct bio *bio, int mirror_num, unsigned long bio_flags, u64 bio_offset, extent_submit_bio_hook_t *submit_bio_start, @@ -849,7 +847,6 @@ int btrfs_wq_submit_bio(struct btrfs_fs_info *fs_info, struct inode *inode, return -ENOMEM; async->inode = inode; - async->rw = rw; async->bio = bio; async->mirror_num = mirror_num; async->submit_bio_start = submit_bio_start; @@ -895,9 +892,8 @@ static int btree_csum_one_bio(struct bio *bio) return ret; } -static int __btree_submit_bio_start(struct inode *inode, int rw, - struct bio *bio, int mirror_num, - unsigned long bio_flags, +static int __btree_submit_bio_start(struct inode *inode, struct bio *bio, + int mirror_num, unsigned long bio_flags, u64 bio_offset) { /* @@ -907,7 +903,7 @@ static int __btree_submit_bio_start(struct inode *inode, int rw, return btree_csum_one_bio(bio); } -static int __btree_submit_bio_done(struct inode *inode, int rw, struct bio *bio, +static int __btree_submit_bio_done(struct inode *inode, struct bio *bio, int mirror_num, unsigned long bio_flags, u64 bio_offset) { @@ -917,7 +913,7 @@ static int __btree_submit_bio_done(struct inode *inode, int rw, struct bio *bio, * when we're called for a write, we're already in the async * submission context. Just jump into btrfs_map_bio */ - ret = btrfs_map_bio(BTRFS_I(inode)->root, rw, bio, mirror_num, 1); + ret = btrfs_map_bio(BTRFS_I(inode)->root, bio, mirror_num, 1); if (ret) { bio->bi_error = ret; bio_endio(bio); @@ -936,7 +932,7 @@ static int check_async_write(struct inode *inode, unsigned long bio_flags) return 1; } -static int btree_submit_bio_hook(struct inode *inode, int rw, struct bio *bio, +static int btree_submit_bio_hook(struct inode *inode, struct bio *bio, int mirror_num, unsigned long bio_flags, u64 bio_offset) { @@ -952,21 +948,19 @@ static int btree_submit_bio_hook(struct inode *inode, int rw, struct bio *bio, bio, BTRFS_WQ_ENDIO_METADATA); if (ret) goto out_w_error; - ret = btrfs_map_bio(BTRFS_I(inode)->root, rw, bio, - mirror_num, 0); + ret = btrfs_map_bio(BTRFS_I(inode)->root, bio, mirror_num, 0); } else if (!async) { ret = btree_csum_one_bio(bio); if (ret) goto out_w_error; - ret = btrfs_map_bio(BTRFS_I(inode)->root, rw, bio, - mirror_num, 0); + ret = btrfs_map_bio(BTRFS_I(inode)->root, bio, mirror_num, 0); } else { /* * kthread helpers are used to submit writes so that * checksumming can happen in parallel across all CPUs */ ret = btrfs_wq_submit_bio(BTRFS_I(inode)->root->fs_info, - inode, rw, bio, mirror_num, 0, + inode, bio, mirror_num, 0, bio_offset, __btree_submit_bio_start, __btree_submit_bio_done); diff --git a/fs/btrfs/disk-io.h b/fs/btrfs/disk-io.h index 8e79d00..73c21a2 100644 --- a/fs/btrfs/disk-io.h +++ b/fs/btrfs/disk-io.h @@ -122,7 +122,7 @@ void btrfs_csum_final(u32 crc, char *result); int btrfs_bio_wq_end_io(struct btrfs_fs_info *info, struct bio *bio, enum btrfs_wq_endio_type metadata); int btrfs_wq_submit_bio(struct btrfs_fs_info *fs_info, struct inode *inode, - int rw, struct bio *bio, int mirror_num, + struct bio *bio, int mirror_num, unsigned long bio_flags, u64 bio_offset, extent_submit_bio_hook_t *submit_bio_start, extent_submit_bio_hook_t *submit_bio_done); diff --git a/fs/btrfs/extent_io.c b/fs/btrfs/extent_io.c index 4472d69..db9e79d 100644 --- a/fs/btrfs/extent_io.c +++ b/fs/btrfs/extent_io.c @@ -2409,8 +2409,7 @@ static int bio_readpage_error(struct bio *failed_bio, u64 phy_offset, pr_debug("Repair Read Error: submitting new read[%#x] to this_mirror=%d, in_validation=%d\n", read_mode, failrec->this_mirror, failrec->in_validation); - ret = tree->ops->submit_bio_hook(inode, read_mode, bio, - failrec->this_mirror, + ret = tree->ops->submit_bio_hook(inode, bio, failrec->this_mirror, failrec->bio_flags, 0); if (ret) { free_io_failure(inode, failrec); @@ -2731,9 +2730,8 @@ static int __must_check submit_one_bio(struct bio *bio, int mirror_num, bio_get(bio); if (tree->ops && tree->ops->submit_bio_hook) - ret = tree->ops->submit_bio_hook(page->mapping->host, - bio->bi_rw, bio, mirror_num, - bio_flags, start); + ret = tree->ops->submit_bio_hook(page->mapping->host, bio, + mirror_num, bio_flags, start); else btrfsic_submit_bio(bio); @@ -2747,8 +2745,8 @@ static int merge_bio(struct extent_io_tree *tree, struct page *page, { int ret = 0; if (tree->ops && tree->ops->merge_bio_hook) - ret = tree->ops->merge_bio_hook(bio->bi_op, page, offset, size, - bio, bio_flags); + ret = tree->ops->merge_bio_hook(page, offset, size, bio, + bio_flags); BUG_ON(ret < 0); return ret; diff --git a/fs/btrfs/extent_io.h b/fs/btrfs/extent_io.h index 5dbf92e..f1040fe 100644 --- a/fs/btrfs/extent_io.h +++ b/fs/btrfs/extent_io.h @@ -63,9 +63,9 @@ struct btrfs_root; struct btrfs_io_bio; struct io_failure_record; -typedef int (extent_submit_bio_hook_t)(struct inode *inode, int rw, - struct bio *bio, int mirror_num, - unsigned long bio_flags, u64 bio_offset); +typedef int (extent_submit_bio_hook_t)(struct inode *inode, struct bio *bio, + int mirror_num, unsigned long bio_flags, + u64 bio_offset); struct extent_io_ops { int (*fill_delalloc)(struct inode *inode, struct page *locked_page, u64 start, u64 end, int *page_started, @@ -73,7 +73,7 @@ struct extent_io_ops { int (*writepage_start_hook)(struct page *page, u64 start, u64 end); int (*writepage_io_hook)(struct page *page, u64 start, u64 end); extent_submit_bio_hook_t *submit_bio_hook; - int (*merge_bio_hook)(int rw, struct page *page, unsigned long offset, + int (*merge_bio_hook)(struct page *page, unsigned long offset, size_t size, struct bio *bio, unsigned long bio_flags); int (*readpage_io_failed_hook)(struct page *page, int failed_mirror); diff --git a/fs/btrfs/inode.c b/fs/btrfs/inode.c index 49842d2..a3132d6 100644 --- a/fs/btrfs/inode.c +++ b/fs/btrfs/inode.c @@ -1807,7 +1807,7 @@ static void btrfs_clear_bit_hook(struct inode *inode, * extent_io.c merge_bio_hook, this must check the chunk tree to make sure * we don't create bios that span stripes or chunks */ -int btrfs_merge_bio_hook(int rw, struct page *page, unsigned long offset, +int btrfs_merge_bio_hook(struct page *page, unsigned long offset, size_t size, struct bio *bio, unsigned long bio_flags) { @@ -1822,7 +1822,7 @@ int btrfs_merge_bio_hook(int rw, struct page *page, unsigned long offset, length = bio->bi_iter.bi_size; map_length = length; - ret = btrfs_map_block(root->fs_info, rw, logical, + ret = btrfs_map_block(root->fs_info, bio->bi_op, logical, &map_length, NULL, 0); /* Will always return 0 with map_multi == NULL */ BUG_ON(ret < 0); @@ -1839,9 +1839,8 @@ int btrfs_merge_bio_hook(int rw, struct page *page, unsigned long offset, * At IO completion time the cums attached on the ordered extent record * are inserted into the btree */ -static int __btrfs_submit_bio_start(struct inode *inode, int rw, - struct bio *bio, int mirror_num, - unsigned long bio_flags, +static int __btrfs_submit_bio_start(struct inode *inode, struct bio *bio, + int mirror_num, unsigned long bio_flags, u64 bio_offset) { struct btrfs_root *root = BTRFS_I(inode)->root; @@ -1860,14 +1859,14 @@ static int __btrfs_submit_bio_start(struct inode *inode, int rw, * At IO completion time the cums attached on the ordered extent record * are inserted into the btree */ -static int __btrfs_submit_bio_done(struct inode *inode, int rw, struct bio *bio, +static int __btrfs_submit_bio_done(struct inode *inode, struct bio *bio, int mirror_num, unsigned long bio_flags, u64 bio_offset) { struct btrfs_root *root = BTRFS_I(inode)->root; int ret; - ret = btrfs_map_bio(root, rw, bio, mirror_num, 1); + ret = btrfs_map_bio(root, bio, mirror_num, 1); if (ret) { bio->bi_error = ret; bio_endio(bio); @@ -1879,7 +1878,7 @@ static int __btrfs_submit_bio_done(struct inode *inode, int rw, struct bio *bio, * extent_io.c submission hook. This does the right thing for csum calculation * on write, or reading the csums from the tree before a read */ -static int btrfs_submit_bio_hook(struct inode *inode, int rw, struct bio *bio, +static int btrfs_submit_bio_hook(struct inode *inode, struct bio *bio, int mirror_num, unsigned long bio_flags, u64 bio_offset) { @@ -1916,7 +1915,7 @@ static int btrfs_submit_bio_hook(struct inode *inode, int rw, struct bio *bio, goto mapit; /* we're doing a write, do the async checksumming */ ret = btrfs_wq_submit_bio(BTRFS_I(inode)->root->fs_info, - inode, rw, bio, mirror_num, + inode, bio, mirror_num, bio_flags, bio_offset, __btrfs_submit_bio_start, __btrfs_submit_bio_done); @@ -1928,7 +1927,7 @@ static int btrfs_submit_bio_hook(struct inode *inode, int rw, struct bio *bio, } mapit: - ret = btrfs_map_bio(root, rw, bio, mirror_num, 0); + ret = btrfs_map_bio(root, bio, mirror_num, 0); out: if (ret < 0) { @@ -7725,7 +7724,7 @@ err: } static inline int submit_dio_repair_bio(struct inode *inode, struct bio *bio, - int rw, int mirror_num) + int mirror_num) { struct btrfs_root *root = BTRFS_I(inode)->root; int ret; @@ -7739,7 +7738,7 @@ static inline int submit_dio_repair_bio(struct inode *inode, struct bio *bio, if (ret) goto err; - ret = btrfs_map_bio(root, rw, bio, mirror_num, 0); + ret = btrfs_map_bio(root, bio, mirror_num, 0); err: bio_put(bio); return ret; @@ -7825,8 +7824,7 @@ static int dio_read_error(struct inode *inode, struct bio *failed_bio, "Repair DIO Read Error: submitting new dio read[%#x] to this_mirror=%d, in_validation=%d\n", read_mode, failrec->this_mirror, failrec->in_validation); - ret = submit_dio_repair_bio(inode, bio, read_mode, - failrec->this_mirror); + ret = submit_dio_repair_bio(inode, bio, failrec->this_mirror); if (ret) { free_io_failure(inode, failrec); bio_put(bio); @@ -8116,7 +8114,7 @@ static void btrfs_endio_direct_write(struct bio *bio) bio_put(bio); } -static int __btrfs_submit_bio_start_direct_io(struct inode *inode, int rw, +static int __btrfs_submit_bio_start_direct_io(struct inode *inode, struct bio *bio, int mirror_num, unsigned long bio_flags, u64 offset) { @@ -8209,7 +8207,7 @@ static inline int btrfs_lookup_and_bind_dio_csum(struct btrfs_root *root, } static inline int __btrfs_submit_dio_bio(struct bio *bio, struct inode *inode, - int rw, u64 file_offset, int skip_sum, + u64 file_offset, int skip_sum, int async_submit) { struct btrfs_dio_private *dip = bio->bi_private; @@ -8234,8 +8232,7 @@ static inline int __btrfs_submit_dio_bio(struct bio *bio, struct inode *inode, if (write && async_submit) { ret = btrfs_wq_submit_bio(root->fs_info, - inode, rw, bio, 0, 0, - file_offset, + inode, bio, 0, 0, file_offset, __btrfs_submit_bio_start_direct_io, __btrfs_submit_bio_done); goto err; @@ -8254,13 +8251,13 @@ static inline int __btrfs_submit_dio_bio(struct bio *bio, struct inode *inode, goto err; } map: - ret = btrfs_map_bio(root, rw, bio, 0, async_submit); + ret = btrfs_map_bio(root, bio, 0, async_submit); err: bio_put(bio); return ret; } -static int btrfs_submit_direct_hook(int rw, struct btrfs_dio_private *dip, +static int btrfs_submit_direct_hook(struct btrfs_dio_private *dip, int skip_sum) { struct inode *inode = dip->inode; @@ -8321,7 +8318,7 @@ next_block: * before we're done setting it up */ atomic_inc(&dip->pending_bios); - ret = __btrfs_submit_dio_bio(bio, inode, rw, + ret = __btrfs_submit_dio_bio(bio, inode, file_offset, skip_sum, async_submit); if (ret) { @@ -8366,7 +8363,7 @@ next_block: } submit: - ret = __btrfs_submit_dio_bio(bio, inode, rw, file_offset, skip_sum, + ret = __btrfs_submit_dio_bio(bio, inode, file_offset, skip_sum, async_submit); if (!ret) return 0; @@ -8444,8 +8441,7 @@ static void btrfs_submit_direct(struct bio *dio_bio, struct inode *inode, dio_data->unsubmitted_oe_range_end; } - ret = btrfs_submit_direct_hook(dio_bio->bi_op | dio_bio->bi_rw, dip, - skip_sum); + ret = btrfs_submit_direct_hook(dip, skip_sum); if (!ret) return; diff --git a/fs/btrfs/volumes.c b/fs/btrfs/volumes.c index 62fcbd2..1fa90ab 100644 --- a/fs/btrfs/volumes.c +++ b/fs/btrfs/volumes.c @@ -5990,7 +5990,7 @@ static noinline void btrfs_schedule_bio(struct btrfs_root *root, static void submit_stripe_bio(struct btrfs_root *root, struct btrfs_bio *bbio, struct bio *bio, u64 physical, int dev_nr, - int rw, int async) + int async) { struct btrfs_device *dev = bbio->stripes[dev_nr].dev; @@ -6035,7 +6035,7 @@ static void bbio_error(struct btrfs_bio *bbio, struct bio *bio, u64 logical) } } -int btrfs_map_bio(struct btrfs_root *root, int rw, struct bio *bio, +int btrfs_map_bio(struct btrfs_root *root, struct bio *bio, int mirror_num, int async_submit) { struct btrfs_device *dev; @@ -6102,7 +6102,7 @@ int btrfs_map_bio(struct btrfs_root *root, int rw, struct bio *bio, bio = first_bio; submit_stripe_bio(root, bbio, bio, - bbio->stripes[dev_nr].physical, dev_nr, rw, + bbio->stripes[dev_nr].physical, dev_nr, async_submit); } btrfs_bio_counter_dec(root->fs_info); diff --git a/fs/btrfs/volumes.h b/fs/btrfs/volumes.h index c64229e..372974d0 100644 --- a/fs/btrfs/volumes.h +++ b/fs/btrfs/volumes.h @@ -437,7 +437,7 @@ int btrfs_alloc_chunk(struct btrfs_trans_handle *trans, struct btrfs_root *extent_root, u64 type); void btrfs_mapping_init(struct btrfs_mapping_tree *tree); void btrfs_mapping_tree_free(struct btrfs_mapping_tree *tree); -int btrfs_map_bio(struct btrfs_root *root, int rw, struct bio *bio, +int btrfs_map_bio(struct btrfs_root *root, struct bio *bio, int mirror_num, int async_submit); int btrfs_open_devices(struct btrfs_fs_devices *fs_devices, fmode_t flags, void *holder); -- 1.8.3.1 From mchristi@redhat.com Wed Feb 24 13:49:01 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=ham version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay2.corp.sgi.com [137.38.102.29]) by oss.sgi.com (Postfix) with ESMTP id DFC787CB9 for ; Wed, 24 Feb 2016 13:49:01 -0600 (CST) Received: from cuda.sgi.com (cuda2.sgi.com [192.48.176.25]) by relay2.corp.sgi.com (Postfix) with ESMTP id B0702304067 for ; Wed, 24 Feb 2016 11:48:55 -0800 (PST) X-ASG-Debug-ID: 1456343333-04cbb06ae0fd370001-NocioJ Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by cuda.sgi.com with ESMTP id kDAU1U4xnCeHN5rF (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO) for ; Wed, 24 Feb 2016 11:48:53 -0800 (PST) X-Barracuda-Envelope-From: mchristi@redhat.com X-Barracuda-Apparent-Source-IP: 209.132.183.28 X-ASG-Whitelist: Client Received: from int-mx09.intmail.prod.int.phx2.redhat.com (int-mx09.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by mx1.redhat.com (Postfix) with ESMTPS id E53D3335EA8; Wed, 24 Feb 2016 19:48:52 +0000 (UTC) Received: from rh2.redhat.com (vpn-54-14.rdu2.redhat.com [10.10.54.14]) by int-mx09.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id u1OJmJEG006684; Wed, 24 Feb 2016 14:48:50 -0500 From: mchristi@redhat.com To: linux-f2fs-devel@lists.sourceforge.net, linux-ext4@vger.kernel.org, konrad.wilk@oracle.com, drbd-dev@lists.linbit.com, philipp.reisner@linbit.com, lars.ellenberg@linbit.com, linux-raid@vger.kernel.org, dm-devel@redhat.com, linux-fsdevel@vger.kernel.org, linux-bcache@vger.kernel.org, linux-block@vger.kernel.org, linux-kernel@vger.kernel.org, linux-scsi@vger.kernel.org, linux-mtd@lists.infradead.org, target-devel@vger.kernel.org, linux-btrfs@vger.kernel.org, osd-dev@open-osd.org, xfs@oss.sgi.com, ocfs2-devel@oss.oracle.com Cc: Mike Christie Subject: [PATCH 11/35] f2fs: set bi_op to REQ_OP Date: Wed, 24 Feb 2016 13:47:48 -0600 X-ASG-Orig-Subj: [PATCH 11/35] f2fs: set bi_op to REQ_OP Message-Id: <1456343292-14535-12-git-send-email-mchristi@redhat.com> In-Reply-To: <1456343292-14535-1-git-send-email-mchristi@redhat.com> References: <1456343292-14535-1-git-send-email-mchristi@redhat.com> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.22 X-Barracuda-Connect: mx1.redhat.com[209.132.183.28] X-Barracuda-Start-Time: 1456343333 X-Barracuda-Encrypted: ECDHE-RSA-AES256-GCM-SHA384 X-Barracuda-URL: https://192.48.176.25:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-BRTS-Status: 1 From: Mike Christie This patch has f2fs set the bio bi_op to a REQ_OP, and rq_flag_bits to bi_rw. This patch is compile tested only. Signed-off-by: Mike Christie --- fs/f2fs/checkpoint.c | 10 ++++++---- fs/f2fs/data.c | 33 ++++++++++++++++++++------------- fs/f2fs/f2fs.h | 5 +++-- fs/f2fs/gc.c | 9 ++++++--- fs/f2fs/inline.c | 3 ++- fs/f2fs/node.c | 8 +++++--- fs/f2fs/segment.c | 10 +++++++--- fs/f2fs/trace.c | 7 ++++--- include/trace/events/f2fs.h | 34 +++++++++++++++++++++------------- 9 files changed, 74 insertions(+), 45 deletions(-) diff --git a/fs/f2fs/checkpoint.c b/fs/f2fs/checkpoint.c index f55355d..12ca43e 100644 --- a/fs/f2fs/checkpoint.c +++ b/fs/f2fs/checkpoint.c @@ -55,14 +55,15 @@ static struct page *__get_meta_page(struct f2fs_sb_info *sbi, pgoff_t index, struct f2fs_io_info fio = { .sbi = sbi, .type = META, - .rw = READ_SYNC | REQ_META | REQ_PRIO, + .op = REQ_OP_READ, + .op_flags = READ_SYNC | REQ_META | REQ_PRIO, .old_blkaddr = index, .new_blkaddr = index, .encrypted_page = NULL, }; if (unlikely(!is_meta)) - fio.rw &= ~REQ_META; + fio.op_flags &= ~REQ_META; repeat: page = grab_cache_page(mapping, index); if (!page) { @@ -149,13 +150,14 @@ int ra_meta_pages(struct f2fs_sb_info *sbi, block_t start, int nrpages, struct f2fs_io_info fio = { .sbi = sbi, .type = META, - .rw = sync ? (READ_SYNC | REQ_META | REQ_PRIO) : READA, + .op = REQ_OP_READ, + .op_flags = sync ? (READ_SYNC | REQ_META | REQ_PRIO) : READA, .encrypted_page = NULL, }; struct blk_plug plug; if (unlikely(type == META_POR)) - fio.rw &= ~REQ_META; + fio.op_flags &= ~REQ_META; blk_start_plug(&plug); for (; nrpages-- > 0; blkno++) { diff --git a/fs/f2fs/data.c b/fs/f2fs/data.c index ff623b2..586658c 100644 --- a/fs/f2fs/data.c +++ b/fs/f2fs/data.c @@ -105,11 +105,12 @@ static void __submit_merged_bio(struct f2fs_bio_info *io) if (!io->bio) return; - if (is_read_io(fio->rw)) + if (is_read_io(fio->op)) trace_f2fs_submit_read_bio(io->sbi->sb, fio, io->bio); else trace_f2fs_submit_write_bio(io->sbi->sb, fio, io->bio); - io->bio->bi_rw = fio->rw; + io->bio->bi_op = fio->op; + io->bio->bi_rw = fio->op_flags; submit_bio(io->bio); io->bio = NULL; @@ -177,10 +178,12 @@ static void __f2fs_submit_merged_bio(struct f2fs_sb_info *sbi, /* change META to META_FLUSH in the checkpoint procedure */ if (type >= META_FLUSH) { io->fio.type = META_FLUSH; + io->fio.op = REQ_OP_WRITE; if (test_opt(sbi, NOBARRIER)) - io->fio.rw = WRITE_FLUSH | REQ_META | REQ_PRIO; + io->fio.op_flags = WRITE_FLUSH | REQ_META | REQ_PRIO; else - io->fio.rw = WRITE_FLUSH_FUA | REQ_META | REQ_PRIO; + io->fio.op_flags = WRITE_FLUSH_FUA | REQ_META | + REQ_PRIO; } __submit_merged_bio(io); out: @@ -215,13 +218,14 @@ int f2fs_submit_page_bio(struct f2fs_io_info *fio) f2fs_trace_ios(fio, 0); /* Allocate a new bio */ - bio = __bio_alloc(fio->sbi, fio->new_blkaddr, 1, is_read_io(fio->rw)); + bio = __bio_alloc(fio->sbi, fio->new_blkaddr, 1, is_read_io(fio->op)); if (bio_add_page(bio, page, PAGE_CACHE_SIZE, 0) < PAGE_CACHE_SIZE) { bio_put(bio); return -EFAULT; } - bio->bi_rw = fio->rw; + bio->bi_op = fio->op; + bio->bi_rw = fio->op_flags; submit_bio(bio); return 0; @@ -232,7 +236,7 @@ void f2fs_submit_page_mbio(struct f2fs_io_info *fio) struct f2fs_sb_info *sbi = fio->sbi; enum page_type btype = PAGE_TYPE_OF_BIO(fio->type); struct f2fs_bio_info *io; - bool is_read = is_read_io(fio->rw); + bool is_read = is_read_io(fio->op); struct page *bio_page; io = is_read ? &sbi->read_io : &sbi->write_io[btype]; @@ -247,7 +251,7 @@ void f2fs_submit_page_mbio(struct f2fs_io_info *fio) inc_page_count(sbi, F2FS_WRITEBACK); if (io->bio && (io->last_block_in_bio != fio->new_blkaddr - 1 || - io->fio.rw != fio->rw)) + (io->fio.op != fio->op || io->fio.op_flags != fio->op_flags))) __submit_merged_bio(io); alloc_new: if (io->bio == NULL) { @@ -345,7 +349,7 @@ int f2fs_get_block(struct dnode_of_data *dn, pgoff_t index) } struct page *get_read_data_page(struct inode *inode, pgoff_t index, - int rw, bool for_write) + int op_flags, bool for_write) { struct address_space *mapping = inode->i_mapping; struct dnode_of_data dn; @@ -355,7 +359,8 @@ struct page *get_read_data_page(struct inode *inode, pgoff_t index, struct f2fs_io_info fio = { .sbi = F2FS_I_SB(inode), .type = DATA, - .rw = rw, + .op = REQ_OP_READ, + .op_flags = op_flags, .encrypted_page = NULL, }; @@ -1000,7 +1005,7 @@ submit_and_realloc: bio->bi_iter.bi_sector = SECTOR_FROM_BLOCK(block_nr); bio->bi_end_io = f2fs_read_end_io; bio->bi_private = ctx; - bio->bi_rw = READ; + bio->bi_op = REQ_OP_READ; } if (bio_add_page(bio, page, blocksize, 0) < blocksize) @@ -1134,7 +1139,8 @@ static int f2fs_write_data_page(struct page *page, struct f2fs_io_info fio = { .sbi = sbi, .type = DATA, - .rw = (wbc->sync_mode == WB_SYNC_ALL) ? WRITE_SYNC : WRITE, + .op = REQ_OP_WRITE, + .op_flags = (wbc->sync_mode == WB_SYNC_ALL) ? WRITE_SYNC : 0, .page = page, .encrypted_page = NULL, }; @@ -1572,7 +1578,8 @@ repeat: struct f2fs_io_info fio = { .sbi = sbi, .type = DATA, - .rw = READ_SYNC, + .op = REQ_OP_READ, + .op_flags = READ_SYNC, .old_blkaddr = blkaddr, .new_blkaddr = blkaddr, .page = page, diff --git a/fs/f2fs/f2fs.h b/fs/f2fs/f2fs.h index b57dee6..a7b4097 100644 --- a/fs/f2fs/f2fs.h +++ b/fs/f2fs/f2fs.h @@ -658,14 +658,15 @@ enum page_type { struct f2fs_io_info { struct f2fs_sb_info *sbi; /* f2fs_sb_info pointer */ enum page_type type; /* contains DATA/NODE/META/META_FLUSH */ - int rw; /* contains R/RS/W/WS with REQ_META/REQ_PRIO */ + int op; /* contains REQ_OP_ */ + int op_flags; /* rq_flag_bits */ block_t new_blkaddr; /* new block address to be written */ block_t old_blkaddr; /* old block address before Cow */ struct page *page; /* page to be written */ struct page *encrypted_page; /* encrypted page */ }; -#define is_read_io(rw) (((rw) & 1) == READ) +#define is_read_io(rw) (rw == READ) struct f2fs_bio_info { struct f2fs_sb_info *sbi; /* f2fs superblock */ struct bio *bio; /* bios to merge */ diff --git a/fs/f2fs/gc.c b/fs/f2fs/gc.c index 4bd0c91..9f726a9 100644 --- a/fs/f2fs/gc.c +++ b/fs/f2fs/gc.c @@ -546,7 +546,8 @@ static void move_encrypted_block(struct inode *inode, block_t bidx) struct f2fs_io_info fio = { .sbi = F2FS_I_SB(inode), .type = DATA, - .rw = READ_SYNC, + .op = REQ_OP_READ, + .op_flags = READ_SYNC, .encrypted_page = NULL, }; struct dnode_of_data dn; @@ -613,7 +614,8 @@ static void move_encrypted_block(struct inode *inode, block_t bidx) f2fs_wait_on_page_writeback(dn.node_page, NODE, true); allocate_data_block(fio.sbi, NULL, fio.old_blkaddr, &fio.new_blkaddr, &sum, CURSEG_COLD_DATA); - fio.rw = WRITE_SYNC; + fio.op = REQ_OP_WRITE; + fio.op_flags = WRITE_SYNC; f2fs_submit_page_mbio(&fio); dn.data_blkaddr = fio.new_blkaddr; @@ -647,7 +649,8 @@ static void move_data_page(struct inode *inode, block_t bidx, int gc_type) struct f2fs_io_info fio = { .sbi = F2FS_I_SB(inode), .type = DATA, - .rw = WRITE_SYNC, + .op = REQ_OP_WRITE, + .op_flags = WRITE_SYNC, .page = page, .encrypted_page = NULL, }; diff --git a/fs/f2fs/inline.c b/fs/f2fs/inline.c index a89ca37..eddbe75 100644 --- a/fs/f2fs/inline.c +++ b/fs/f2fs/inline.c @@ -108,7 +108,8 @@ int f2fs_convert_inline_page(struct dnode_of_data *dn, struct page *page) struct f2fs_io_info fio = { .sbi = F2FS_I_SB(dn->inode), .type = DATA, - .rw = WRITE_SYNC | REQ_PRIO, + .op = REQ_OP_WRITE, + .op_flags = WRITE_SYNC | REQ_PRIO, .page = page, .encrypted_page = NULL, }; diff --git a/fs/f2fs/node.c b/fs/f2fs/node.c index 68506f4..bda0b30 100644 --- a/fs/f2fs/node.c +++ b/fs/f2fs/node.c @@ -1046,14 +1046,15 @@ fail: * 0: f2fs_put_page(page, 0) * LOCKED_PAGE or error: f2fs_put_page(page, 1) */ -static int read_node_page(struct page *page, int rw) +static int read_node_page(struct page *page, int op_flags) { struct f2fs_sb_info *sbi = F2FS_P_SB(page); struct node_info ni; struct f2fs_io_info fio = { .sbi = sbi, .type = NODE, - .rw = rw, + .op = REQ_OP_READ, + .op_flags = op_flags, .page = page, .encrypted_page = NULL, }; @@ -1403,7 +1404,8 @@ static int f2fs_write_node_page(struct page *page, struct f2fs_io_info fio = { .sbi = sbi, .type = NODE, - .rw = (wbc->sync_mode == WB_SYNC_ALL) ? WRITE_SYNC : WRITE, + .op = REQ_OP_WRITE, + .op_flags = (wbc->sync_mode == WB_SYNC_ALL) ? WRITE_SYNC : 0, .page = page, .encrypted_page = NULL, }; diff --git a/fs/f2fs/segment.c b/fs/f2fs/segment.c index 34e99fe..e7c7947 100644 --- a/fs/f2fs/segment.c +++ b/fs/f2fs/segment.c @@ -253,7 +253,8 @@ static int __commit_inmem_pages(struct inode *inode, struct f2fs_io_info fio = { .sbi = sbi, .type = DATA, - .rw = WRITE_SYNC | REQ_PRIO, + .op = REQ_OP_WRITE, + .op_flags = WRITE_SYNC | REQ_PRIO, .encrypted_page = NULL, }; bool submit_bio = false; @@ -402,6 +403,7 @@ repeat: fcc->dispatch_list = llist_reverse_order(fcc->dispatch_list); bio->bi_bdev = sbi->sb->s_bdev; + bio->bi_op = REQ_OP_WRITE; bio->bi_rw = WRITE_FLUSH; ret = submit_bio_wait(bio); @@ -435,6 +437,7 @@ int f2fs_issue_flush(struct f2fs_sb_info *sbi) int ret; bio->bi_bdev = sbi->sb->s_bdev; + bio->bi_op = REQ_OP_WRITE; bio->bi_rw = WRITE_FLUSH; ret = submit_bio_wait(bio); bio_put(bio); @@ -1399,7 +1402,8 @@ void write_meta_page(struct f2fs_sb_info *sbi, struct page *page) struct f2fs_io_info fio = { .sbi = sbi, .type = META, - .rw = WRITE_SYNC | REQ_META | REQ_PRIO, + .op = REQ_OP_WRITE, + .op_flags = WRITE_SYNC | REQ_META | REQ_PRIO, .old_blkaddr = page->index, .new_blkaddr = page->index, .page = page, @@ -1407,7 +1411,7 @@ void write_meta_page(struct f2fs_sb_info *sbi, struct page *page) }; if (unlikely(page->index >= MAIN_BLKADDR(sbi))) - fio.rw &= ~REQ_META; + fio.op_flags &= ~REQ_META; set_page_writeback(page); f2fs_submit_page_mbio(&fio); diff --git a/fs/f2fs/trace.c b/fs/f2fs/trace.c index 562ce08..73b4e1d 100644 --- a/fs/f2fs/trace.c +++ b/fs/f2fs/trace.c @@ -25,11 +25,11 @@ static inline void __print_last_io(void) if (!last_io.len) return; - trace_printk("%3x:%3x %4x %-16s %2x %5x %12x %4x\n", + trace_printk("%3x:%3x %4x %-16s %2x %5x %5x %12x %4x\n", last_io.major, last_io.minor, last_io.pid, "----------------", last_io.type, - last_io.fio.rw, + last_io.fio.op, last_io.fio.op_flags, last_io.fio.new_blkaddr, last_io.len); memset(&last_io, 0, sizeof(last_io)); @@ -101,7 +101,8 @@ void f2fs_trace_ios(struct f2fs_io_info *fio, int flush) if (last_io.major == major && last_io.minor == minor && last_io.pid == pid && last_io.type == __file_type(inode, pid) && - last_io.fio.rw == fio->rw && + last_io.fio.op == fio->op && + last_io.fio.op_flags == fio->op_flags && last_io.fio.new_blkaddr + last_io.len == fio->new_blkaddr) { last_io.len++; diff --git a/include/trace/events/f2fs.h b/include/trace/events/f2fs.h index 0f56584..db75d69 100644 --- a/include/trace/events/f2fs.h +++ b/include/trace/events/f2fs.h @@ -56,17 +56,21 @@ TRACE_DEFINE_ENUM(CP_DISCARD); { IPU, "IN-PLACE" }, \ { OPU, "OUT-OF-PLACE" }) -#define F2FS_BIO_MASK(t) (t & (READA | WRITE_FLUSH_FUA)) +#define F2FS_BIO_FLAG_MASK(t) (t & (READA | WRITE_FLUSH_FUA)) #define F2FS_BIO_EXTRA_MASK(t) (t & (REQ_META | REQ_PRIO)) -#define show_bio_type(type) show_bio_base(type), show_bio_extra(type) +#define show_bio_type(op, op_flags) show_bio_op(op), \ + show_bio_op_flags(op_flags), show_bio_extra(op_flags) -#define show_bio_base(type) \ - __print_symbolic(F2FS_BIO_MASK(type), \ +#define show_bio_op(op) \ + __print_symbolic(op, \ { READ, "READ" }, \ + { WRITE, "WRITE" }) + +#define show_bio_op_flags(flags) \ + __print_symbolic(F2FS_BIO_FLAG_MASK(flags), \ { READA, "READAHEAD" }, \ { READ_SYNC, "READ_SYNC" }, \ - { WRITE, "WRITE" }, \ { WRITE_SYNC, "WRITE_SYNC" }, \ { WRITE_FLUSH, "WRITE_FLUSH" }, \ { WRITE_FUA, "WRITE_FUA" }, \ @@ -730,7 +734,8 @@ DECLARE_EVENT_CLASS(f2fs__submit_page_bio, __field(pgoff_t, index) __field(block_t, old_blkaddr) __field(block_t, new_blkaddr) - __field(int, rw) + __field(int, op) + __field(int, op_flags) __field(int, type) ), @@ -740,17 +745,18 @@ DECLARE_EVENT_CLASS(f2fs__submit_page_bio, __entry->index = page->index; __entry->old_blkaddr = fio->old_blkaddr; __entry->new_blkaddr = fio->new_blkaddr; - __entry->rw = fio->rw; + __entry->op = fio->op; + __entry->op_flags = fio->op_flags; __entry->type = fio->type; ), TP_printk("dev = (%d,%d), ino = %lu, page_index = 0x%lx, " - "oldaddr = 0x%llx, newaddr = 0x%llx rw = %s%s, type = %s", + "oldaddr = 0x%llx, newaddr = 0x%llx rw = %s%si%s, type = %s", show_dev_ino(__entry), (unsigned long)__entry->index, (unsigned long long)__entry->old_blkaddr, (unsigned long long)__entry->new_blkaddr, - show_bio_type(__entry->rw), + show_bio_type(__entry->op, __entry->op_flags), show_block_type(__entry->type)) ); @@ -781,7 +787,8 @@ DECLARE_EVENT_CLASS(f2fs__submit_bio, TP_STRUCT__entry( __field(dev_t, dev) - __field(int, rw) + __field(int, op) + __field(int, op_flags) __field(int, type) __field(sector_t, sector) __field(unsigned int, size) @@ -789,15 +796,16 @@ DECLARE_EVENT_CLASS(f2fs__submit_bio, TP_fast_assign( __entry->dev = sb->s_dev; - __entry->rw = fio->rw; + __entry->op = fio->op; + __entry->op_flags = fio->op_flags; __entry->type = fio->type; __entry->sector = bio->bi_iter.bi_sector; __entry->size = bio->bi_iter.bi_size; ), - TP_printk("dev = (%d,%d), %s%s, %s, sector = %lld, size = %u", + TP_printk("dev = (%d,%d), %s%s%s, %s, sector = %lld, size = %u", show_dev(__entry), - show_bio_type(__entry->rw), + show_bio_type(__entry->op, __entry->op_flags), show_block_type(__entry->type), (unsigned long long)__entry->sector, __entry->size) -- 1.8.3.1 From mchristi@redhat.com Wed Feb 24 13:49:04 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=ham version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay3.corp.sgi.com [198.149.34.15]) by oss.sgi.com (Postfix) with ESMTP id 6CC477CB9 for ; Wed, 24 Feb 2016 13:49:04 -0600 (CST) Received: from cuda.sgi.com (cuda3.sgi.com [192.48.176.15]) by relay3.corp.sgi.com (Postfix) with ESMTP id C045FAC002 for ; Wed, 24 Feb 2016 11:48:57 -0800 (PST) X-ASG-Debug-ID: 1456343335-04cb6c455bd59b0001-NocioJ Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by cuda.sgi.com with ESMTP id ePhEjsMFvOwTi2b8 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO) for ; Wed, 24 Feb 2016 11:48:56 -0800 (PST) X-Barracuda-Envelope-From: mchristi@redhat.com X-Barracuda-Apparent-Source-IP: 209.132.183.28 X-ASG-Whitelist: Client Received: from int-mx09.intmail.prod.int.phx2.redhat.com (int-mx09.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by mx1.redhat.com (Postfix) with ESMTPS id 927D9BBB55; Wed, 24 Feb 2016 19:48:55 +0000 (UTC) Received: from rh2.redhat.com (vpn-54-14.rdu2.redhat.com [10.10.54.14]) by int-mx09.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id u1OJmJEH006684; Wed, 24 Feb 2016 14:48:53 -0500 From: mchristi@redhat.com To: linux-f2fs-devel@lists.sourceforge.net, linux-ext4@vger.kernel.org, konrad.wilk@oracle.com, drbd-dev@lists.linbit.com, philipp.reisner@linbit.com, lars.ellenberg@linbit.com, linux-raid@vger.kernel.org, dm-devel@redhat.com, linux-fsdevel@vger.kernel.org, linux-bcache@vger.kernel.org, linux-block@vger.kernel.org, linux-kernel@vger.kernel.org, linux-scsi@vger.kernel.org, linux-mtd@lists.infradead.org, target-devel@vger.kernel.org, linux-btrfs@vger.kernel.org, osd-dev@open-osd.org, xfs@oss.sgi.com, ocfs2-devel@oss.oracle.com Cc: Mike Christie Subject: [PATCH 12/35] gfs2: set bi_op to REQ_OP Date: Wed, 24 Feb 2016 13:47:49 -0600 X-ASG-Orig-Subj: [PATCH 12/35] gfs2: set bi_op to REQ_OP Message-Id: <1456343292-14535-13-git-send-email-mchristi@redhat.com> In-Reply-To: <1456343292-14535-1-git-send-email-mchristi@redhat.com> References: <1456343292-14535-1-git-send-email-mchristi@redhat.com> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.22 X-Barracuda-Connect: mx1.redhat.com[209.132.183.28] X-Barracuda-Start-Time: 1456343336 X-Barracuda-Encrypted: ECDHE-RSA-AES256-GCM-SHA384 X-Barracuda-URL: https://192.48.176.15:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-BRTS-Status: 1 From: Mike Christie This patch has gfs2 set the bio bi_op to a REQ_OP, and rq_flag_bits to bi_rw. This patch is compile tested only. v2: Bob, I did not add your signed off, because there was the gfs2_submit_bhs changes since last time you reviewed it. Signed-off-by: Mike Christie --- fs/gfs2/log.c | 8 ++++---- fs/gfs2/lops.c | 12 +++++++----- fs/gfs2/lops.h | 2 +- fs/gfs2/meta_io.c | 8 +++++--- fs/gfs2/ops_fstype.c | 1 + 5 files changed, 18 insertions(+), 13 deletions(-) diff --git a/fs/gfs2/log.c b/fs/gfs2/log.c index 0ff028c..e58ccef0 100644 --- a/fs/gfs2/log.c +++ b/fs/gfs2/log.c @@ -657,7 +657,7 @@ static void log_write_header(struct gfs2_sbd *sdp, u32 flags) struct gfs2_log_header *lh; unsigned int tail; u32 hash; - int rw = WRITE_FLUSH_FUA | REQ_META; + int op_flags = WRITE_FLUSH_FUA | REQ_META; struct page *page = mempool_alloc(gfs2_page_pool, GFP_NOIO); enum gfs2_freeze_state state = atomic_read(&sdp->sd_freeze_state); lh = page_address(page); @@ -682,12 +682,12 @@ static void log_write_header(struct gfs2_sbd *sdp, u32 flags) if (test_bit(SDF_NOBARRIERS, &sdp->sd_flags)) { gfs2_ordered_wait(sdp); log_flush_wait(sdp); - rw = WRITE_SYNC | REQ_META | REQ_PRIO; + op_flags = WRITE_SYNC | REQ_META | REQ_PRIO; } sdp->sd_log_idle = (tail == sdp->sd_log_flush_head); gfs2_log_write_page(sdp, page); - gfs2_log_flush_bio(sdp, rw); + gfs2_log_flush_bio(sdp, REQ_OP_WRITE, op_flags); log_flush_wait(sdp); if (sdp->sd_log_tail != tail) @@ -738,7 +738,7 @@ void gfs2_log_flush(struct gfs2_sbd *sdp, struct gfs2_glock *gl, gfs2_ordered_write(sdp); lops_before_commit(sdp, tr); - gfs2_log_flush_bio(sdp, WRITE); + gfs2_log_flush_bio(sdp, REQ_OP_WRITE, 0); if (sdp->sd_log_head != sdp->sd_log_flush_head) { log_flush_wait(sdp); diff --git a/fs/gfs2/lops.c b/fs/gfs2/lops.c index ce28242..c1099b4 100644 --- a/fs/gfs2/lops.c +++ b/fs/gfs2/lops.c @@ -230,17 +230,19 @@ static void gfs2_end_log_write(struct bio *bio) /** * gfs2_log_flush_bio - Submit any pending log bio * @sdp: The superblock - * @rw: The rw flags + * @op: REQ_OP + * @op_flags: rq_flag_bits * * Submit any pending part-built or full bio to the block device. If * there is no pending bio, then this is a no-op. */ -void gfs2_log_flush_bio(struct gfs2_sbd *sdp, int rw) +void gfs2_log_flush_bio(struct gfs2_sbd *sdp, int op, int op_flags) { if (sdp->sd_log_bio) { atomic_inc(&sdp->sd_log_in_flight); - sdp->sd_log_bio->bi_rw = rw; + sdp->sd_log_bio->bi_op = op; + sdp->sd_log_bio->bi_rw = op_flags; submit_bio(sdp->sd_log_bio); sdp->sd_log_bio = NULL; } @@ -300,7 +302,7 @@ static struct bio *gfs2_log_get_bio(struct gfs2_sbd *sdp, u64 blkno) nblk >>= sdp->sd_fsb2bb_shift; if (blkno == nblk) return bio; - gfs2_log_flush_bio(sdp, WRITE); + gfs2_log_flush_bio(sdp, REQ_OP_WRITE, 0); } return gfs2_log_alloc_bio(sdp, blkno); @@ -329,7 +331,7 @@ static void gfs2_log_write(struct gfs2_sbd *sdp, struct page *page, bio = gfs2_log_get_bio(sdp, blkno); ret = bio_add_page(bio, page, size, offset); if (ret == 0) { - gfs2_log_flush_bio(sdp, WRITE); + gfs2_log_flush_bio(sdp, REQ_OP_WRITE, 0); bio = gfs2_log_alloc_bio(sdp, blkno); ret = bio_add_page(bio, page, size, offset); WARN_ON(ret == 0); diff --git a/fs/gfs2/lops.h b/fs/gfs2/lops.h index a65a7ba..e529f53 100644 --- a/fs/gfs2/lops.h +++ b/fs/gfs2/lops.h @@ -27,7 +27,7 @@ extern const struct gfs2_log_operations gfs2_databuf_lops; extern const struct gfs2_log_operations *gfs2_log_ops[]; extern void gfs2_log_write_page(struct gfs2_sbd *sdp, struct page *page); -extern void gfs2_log_flush_bio(struct gfs2_sbd *sdp, int rw); +extern void gfs2_log_flush_bio(struct gfs2_sbd *sdp, int op, int op_flags); extern void gfs2_pin(struct gfs2_sbd *sdp, struct buffer_head *bh); static inline unsigned int buf_limit(struct gfs2_sbd *sdp) diff --git a/fs/gfs2/meta_io.c b/fs/gfs2/meta_io.c index 96c8140..f790f38 100644 --- a/fs/gfs2/meta_io.c +++ b/fs/gfs2/meta_io.c @@ -213,7 +213,8 @@ static void gfs2_meta_read_endio(struct bio *bio) * Submit several consecutive buffer head I/O requests as a single bio I/O * request. (See submit_bh_wbc.) */ -static void gfs2_submit_bhs(int rw, struct buffer_head *bhs[], int num) +static void gfs2_submit_bhs(int op, int op_flags, struct buffer_head *bhs[], + int num) { struct buffer_head *bh = bhs[0]; struct bio *bio; @@ -230,7 +231,8 @@ static void gfs2_submit_bhs(int rw, struct buffer_head *bhs[], int num) bio_add_page(bio, bh->b_page, bh->b_size, bh_offset(bh)); } bio->bi_end_io = gfs2_meta_read_endio; - bio->bi_rw = rw; + bio->bi_op = op; + bio->bi_rw = op_flags; submit_bio(bio); } @@ -281,7 +283,7 @@ int gfs2_meta_read(struct gfs2_glock *gl, u64 blkno, int flags, } } - gfs2_submit_bhs(READ_SYNC | REQ_META | REQ_PRIO, bhs, num); + gfs2_submit_bhs(REQ_OP_READ, READ_SYNC | REQ_META | REQ_PRIO, bhs, num); if (!(flags & DIO_WAIT)) return 0; diff --git a/fs/gfs2/ops_fstype.c b/fs/gfs2/ops_fstype.c index 4872a61..f3e1e0e 100644 --- a/fs/gfs2/ops_fstype.c +++ b/fs/gfs2/ops_fstype.c @@ -246,6 +246,7 @@ static int gfs2_read_super(struct gfs2_sbd *sdp, sector_t sector, int silent) bio->bi_end_io = end_bio_io_page; bio->bi_private = page; + bio->bi_op = REQ_OP_READ; bio->bi_rw = READ_SYNC | REQ_META; submit_bio(bio); wait_on_page_locked(page); -- 1.8.3.1 From mchristi@redhat.com Wed Feb 24 13:49:06 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=ham version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay1.corp.sgi.com [137.38.102.111]) by oss.sgi.com (Postfix) with ESMTP id 704F57CB9 for ; Wed, 24 Feb 2016 13:49:06 -0600 (CST) Received: from cuda.sgi.com (cuda2.sgi.com [192.48.176.25]) by relay1.corp.sgi.com (Postfix) with ESMTP id 3F54E8F8039 for ; Wed, 24 Feb 2016 11:49:00 -0800 (PST) X-ASG-Debug-ID: 1456343338-04cbb06adffd380001-NocioJ Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by cuda.sgi.com with ESMTP id 0AvkiJjiLVaLtKwT (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO) for ; Wed, 24 Feb 2016 11:48:59 -0800 (PST) X-Barracuda-Envelope-From: mchristi@redhat.com X-Barracuda-Apparent-Source-IP: 209.132.183.28 X-ASG-Whitelist: Client Received: from int-mx09.intmail.prod.int.phx2.redhat.com (int-mx09.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by mx1.redhat.com (Postfix) with ESMTPS id 56F4DBBB3E; Wed, 24 Feb 2016 19:48:58 +0000 (UTC) Received: from rh2.redhat.com (vpn-54-14.rdu2.redhat.com [10.10.54.14]) by int-mx09.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id u1OJmJEI006684; Wed, 24 Feb 2016 14:48:55 -0500 From: mchristi@redhat.com To: linux-f2fs-devel@lists.sourceforge.net, linux-ext4@vger.kernel.org, konrad.wilk@oracle.com, drbd-dev@lists.linbit.com, philipp.reisner@linbit.com, lars.ellenberg@linbit.com, linux-raid@vger.kernel.org, dm-devel@redhat.com, linux-fsdevel@vger.kernel.org, linux-bcache@vger.kernel.org, linux-block@vger.kernel.org, linux-kernel@vger.kernel.org, linux-scsi@vger.kernel.org, linux-mtd@lists.infradead.org, target-devel@vger.kernel.org, linux-btrfs@vger.kernel.org, osd-dev@open-osd.org, xfs@oss.sgi.com, ocfs2-devel@oss.oracle.com Cc: Mike Christie Subject: [PATCH 13/35] xfs: set bi_op to REQ_OP Date: Wed, 24 Feb 2016 13:47:50 -0600 X-ASG-Orig-Subj: [PATCH 13/35] xfs: set bi_op to REQ_OP Message-Id: <1456343292-14535-14-git-send-email-mchristi@redhat.com> In-Reply-To: <1456343292-14535-1-git-send-email-mchristi@redhat.com> References: <1456343292-14535-1-git-send-email-mchristi@redhat.com> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.22 X-Barracuda-Connect: mx1.redhat.com[209.132.183.28] X-Barracuda-Start-Time: 1456343338 X-Barracuda-Encrypted: ECDHE-RSA-AES256-GCM-SHA384 X-Barracuda-URL: https://192.48.176.25:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-BRTS-Status: 1 From: Mike Christie This patch has xfs set the bio bi_op to a REQ_OP, and rq_flag_bits to bi_rw. Signed-off-by: Mike Christie Acked-by: Dave Chinner --- fs/xfs/xfs_aops.c | 3 ++- fs/xfs/xfs_buf.c | 27 +++++++++++++++------------ 2 files changed, 17 insertions(+), 13 deletions(-) diff --git a/fs/xfs/xfs_aops.c b/fs/xfs/xfs_aops.c index 9cd38d1..21867fc 100644 --- a/fs/xfs/xfs_aops.c +++ b/fs/xfs/xfs_aops.c @@ -393,7 +393,8 @@ xfs_submit_ioend_bio( atomic_inc(&ioend->io_remaining); bio->bi_private = ioend; bio->bi_end_io = xfs_end_bio; - bio->bi_rw = (wbc->sync_mode == WB_SYNC_ALL ? WRITE_SYNC : WRITE); + bio->bi_op = REQ_OP_WRITE; + bio->bi_rw = WB_SYNC_ALL ? WRITE_SYNC : 0; submit_bio(bio); } diff --git a/fs/xfs/xfs_buf.c b/fs/xfs/xfs_buf.c index 079bb77..917774e 100644 --- a/fs/xfs/xfs_buf.c +++ b/fs/xfs/xfs_buf.c @@ -1131,7 +1131,8 @@ xfs_buf_ioapply_map( int map, int *buf_offset, int *count, - int rw) + int op, + int op_flags) { int page_index; int total_nr_pages = bp->b_page_count; @@ -1170,7 +1171,8 @@ next_chunk: bio->bi_iter.bi_sector = sector; bio->bi_end_io = xfs_buf_bio_end_io; bio->bi_private = bp; - bio->bi_rw = rw; + bio->bi_op = op; + bio->bi_rw = op_flags; for (; size && nr_pages; nr_pages--, page_index++) { int rbytes, nbytes = PAGE_SIZE - offset; @@ -1214,7 +1216,8 @@ _xfs_buf_ioapply( struct xfs_buf *bp) { struct blk_plug plug; - int rw; + int op; + int op_flags = 0; int offset; int size; int i; @@ -1233,14 +1236,13 @@ _xfs_buf_ioapply( bp->b_ioend_wq = bp->b_target->bt_mount->m_buf_workqueue; if (bp->b_flags & XBF_WRITE) { + op = REQ_OP_WRITE; if (bp->b_flags & XBF_SYNCIO) - rw = WRITE_SYNC; - else - rw = WRITE; + op_flags = WRITE_SYNC; if (bp->b_flags & XBF_FUA) - rw |= REQ_FUA; + op_flags |= REQ_FUA; if (bp->b_flags & XBF_FLUSH) - rw |= REQ_FLUSH; + op_flags |= REQ_FLUSH; /* * Run the write verifier callback function if it exists. If @@ -1270,13 +1272,14 @@ _xfs_buf_ioapply( } } } else if (bp->b_flags & XBF_READ_AHEAD) { - rw = READA; + op = REQ_OP_READ; + op_flags = REQ_RAHEAD; } else { - rw = READ; + op = REQ_OP_READ; } /* we only use the buffer cache for meta-data */ - rw |= REQ_META; + op_flags |= REQ_META; /* * Walk all the vectors issuing IO on them. Set up the initial offset @@ -1288,7 +1291,7 @@ _xfs_buf_ioapply( size = BBTOB(bp->b_io_length); blk_start_plug(&plug); for (i = 0; i < bp->b_map_count; i++) { - xfs_buf_ioapply_map(bp, i, &offset, &size, rw); + xfs_buf_ioapply_map(bp, i, &offset, &size, op, op_flags); if (bp->b_error) break; if (size <= 0) -- 1.8.3.1 From mchristi@redhat.com Wed Feb 24 13:49:06 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=ham version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay3.corp.sgi.com [198.149.34.15]) by oss.sgi.com (Postfix) with ESMTP id C5C497CB9 for ; Wed, 24 Feb 2016 13:49:06 -0600 (CST) Received: from cuda.sgi.com (cuda2.sgi.com [192.48.176.25]) by relay3.corp.sgi.com (Postfix) with ESMTP id 38E70AC005 for ; Wed, 24 Feb 2016 11:49:00 -0800 (PST) X-ASG-Debug-ID: 1456343309-04cbb06addfd320001-NocioJ Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by cuda.sgi.com with ESMTP id wuyA3xEO39dIdNyg (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO) for ; Wed, 24 Feb 2016 11:48:30 -0800 (PST) X-Barracuda-Envelope-From: mchristi@redhat.com X-Barracuda-Apparent-Source-IP: 209.132.183.28 X-ASG-Whitelist: Client Received: from int-mx09.intmail.prod.int.phx2.redhat.com (int-mx09.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by mx1.redhat.com (Postfix) with ESMTPS id 073CD627F6; Wed, 24 Feb 2016 19:48:29 +0000 (UTC) Received: from rh2.redhat.com (vpn-54-14.rdu2.redhat.com [10.10.54.14]) by int-mx09.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id u1OJmJE7006684; Wed, 24 Feb 2016 14:48:26 -0500 From: mchristi@redhat.com To: linux-f2fs-devel@lists.sourceforge.net, linux-ext4@vger.kernel.org, konrad.wilk@oracle.com, drbd-dev@lists.linbit.com, philipp.reisner@linbit.com, lars.ellenberg@linbit.com, linux-raid@vger.kernel.org, dm-devel@redhat.com, linux-fsdevel@vger.kernel.org, linux-bcache@vger.kernel.org, linux-block@vger.kernel.org, linux-kernel@vger.kernel.org, linux-scsi@vger.kernel.org, linux-mtd@lists.infradead.org, target-devel@vger.kernel.org, linux-btrfs@vger.kernel.org, osd-dev@open-osd.org, xfs@oss.sgi.com, ocfs2-devel@oss.oracle.com Cc: Mike Christie Subject: [PATCH 02/35] block: add REQ_OP definitions and bi_op/op fields Date: Wed, 24 Feb 2016 13:47:39 -0600 X-ASG-Orig-Subj: [PATCH 02/35] block: add REQ_OP definitions and bi_op/op fields Message-Id: <1456343292-14535-3-git-send-email-mchristi@redhat.com> In-Reply-To: <1456343292-14535-1-git-send-email-mchristi@redhat.com> References: <1456343292-14535-1-git-send-email-mchristi@redhat.com> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.22 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.38]); Wed, 24 Feb 2016 19:48:29 +0000 (UTC) X-Barracuda-Connect: mx1.redhat.com[209.132.183.28] X-Barracuda-Start-Time: 1456343309 X-Barracuda-Encrypted: ECDHE-RSA-AES256-GCM-SHA384 X-Barracuda-URL: https://192.48.176.25:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-BRTS-Status: 1 From: Mike Christie The following patches separate the operation (write, read, discard, etc) from the flags in bi_rw/cmd_flags. This patch adds definitions for request/bio operations, adds fields to the request/bio to set them, and some temporary compat code so the kernel/modules can use either one. In the final patches this compat code will be removed when everything is converted. Also, in this patch the REQ_OPs match the REQ rq_flag_bits ones for compat reasons while all the code is converted in this set. In the last patches that will also be removed. Signed-off-by: Mike Christie --- block/blk-core.c | 19 ++++++++++++++++--- include/linux/blk_types.h | 15 ++++++++++++++- include/linux/blkdev.h | 1 + include/linux/fs.h | 37 +++++++++++++++++++++++++++++++++++-- 4 files changed, 66 insertions(+), 6 deletions(-) diff --git a/block/blk-core.c b/block/blk-core.c index f23d1b0..74aa201 100644 --- a/block/blk-core.c +++ b/block/blk-core.c @@ -1697,7 +1697,8 @@ void init_request_from_bio(struct request *req, struct bio *bio) { req->cmd_type = REQ_TYPE_FS; - req->cmd_flags |= bio->bi_rw & REQ_COMMON_MASK; + /* tmp compat. Allow users to set bi_op or bi_rw */ + req->cmd_flags |= (bio->bi_rw | bio->bi_op) & REQ_COMMON_MASK; if (bio->bi_rw & REQ_RAHEAD) req->cmd_flags |= REQ_FAILFAST_MASK; @@ -2032,6 +2033,12 @@ blk_qc_t generic_make_request(struct bio *bio) struct bio_list bio_list_on_stack; blk_qc_t ret = BLK_QC_T_NONE; + /* tmp compat. Allow users to set either one or both. + * This will be removed when we have converted + * everyone in the next patches. + */ + bio->bi_rw |= bio->bi_op; + if (!generic_make_request_checks(bio)) goto out; @@ -2101,6 +2108,12 @@ EXPORT_SYMBOL(generic_make_request); */ blk_qc_t submit_bio(struct bio *bio) { + /* tmp compat. Allow users to set either one or both. + * This will be removed when we have converted + * everyone in the next patches. + */ + bio->bi_rw |= bio->bi_op; + /* * If it's a regular read/write or a barrier with data attached, * go through the normal accounting stuff before submission. @@ -2974,8 +2987,8 @@ EXPORT_SYMBOL_GPL(__blk_end_request_err); void blk_rq_bio_prep(struct request_queue *q, struct request *rq, struct bio *bio) { - /* Bit 0 (R/W) is identical in rq->cmd_flags and bio->bi_rw */ - rq->cmd_flags |= bio->bi_rw & REQ_WRITE; + /* tmp compat. Allow users to set bi_op or bi_rw */ + rq->cmd_flags |= bio_data_dir(bio); if (bio_has_data(bio)) rq->nr_phys_segments = bio_phys_segments(q, bio); diff --git a/include/linux/blk_types.h b/include/linux/blk_types.h index 86a38ea..6e49c91 100644 --- a/include/linux/blk_types.h +++ b/include/linux/blk_types.h @@ -48,9 +48,15 @@ struct bio { struct block_device *bi_bdev; unsigned int bi_flags; /* status, command, etc */ int bi_error; - unsigned long bi_rw; /* bottom bits READ/WRITE, + unsigned long bi_rw; /* bottom bits rq_flags_bits * top bits priority */ + /* + * this will be a u8 in the next patches and bi_rw can be shrunk to + * a u32. For compat in these transistional patches op is a int here. + */ + int bi_op; /* REQ_OP */ + struct bvec_iter bi_iter; @@ -242,6 +248,13 @@ enum rq_flag_bits { #define REQ_HASHED (1ULL << __REQ_HASHED) #define REQ_MQ_INFLIGHT (1ULL << __REQ_MQ_INFLIGHT) +enum req_op { + REQ_OP_READ, + REQ_OP_WRITE = REQ_WRITE, + REQ_OP_DISCARD = REQ_DISCARD, + REQ_OP_WRITE_SAME = REQ_WRITE_SAME, +}; + typedef unsigned int blk_qc_t; #define BLK_QC_T_NONE -1U #define BLK_QC_T_SHIFT 16 diff --git a/include/linux/blkdev.h b/include/linux/blkdev.h index 40c0241..d4d3b06 100644 --- a/include/linux/blkdev.h +++ b/include/linux/blkdev.h @@ -96,6 +96,7 @@ struct request { struct request_queue *q; struct blk_mq_ctx *mq_ctx; + int op; u64 cmd_flags; unsigned cmd_type; unsigned long atomic_flags; diff --git a/include/linux/fs.h b/include/linux/fs.h index 3d9fdf4..399b22b 100644 --- a/include/linux/fs.h +++ b/include/linux/fs.h @@ -2434,15 +2434,48 @@ extern void make_bad_inode(struct inode *); extern bool is_bad_inode(struct inode *); #ifdef CONFIG_BLOCK + +static inline bool op_is_write(int op) +{ + switch (op) { + case REQ_OP_WRITE: + case REQ_OP_WRITE_SAME: + case REQ_OP_DISCARD: + return true; + default: + return false; + } +} + /* * return READ, READA, or WRITE */ -#define bio_rw(bio) ((bio)->bi_rw & (RW_MASK | RWA_MASK)) +static inline int bio_rw(struct bio *bio) +{ + /* + * tmp cpmpat. Allow users to set either op or rw, until + * all code is converted in the next patches. + */ + if (op_is_write(bio->bi_op)) + return WRITE; + + return bio->bi_rw & (RW_MASK | RWA_MASK); +} /* * return data direction, READ or WRITE */ -#define bio_data_dir(bio) ((bio)->bi_rw & 1) +static inline int bio_data_dir(struct bio *bio) +{ + /* + * tmp cpmpat. Allow users to set either op or rw, until + * all code is converted in the next patches. + */ + if (op_is_write(bio->bi_op)) + return WRITE; + + return bio->bi_rw & 1; +} extern void check_disk_size_change(struct gendisk *disk, struct block_device *bdev); -- 1.8.3.1 From mchristi@redhat.com Wed Feb 24 13:49:09 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=ham version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay1.corp.sgi.com [137.38.102.111]) by oss.sgi.com (Postfix) with ESMTP id 2A4D37CB9 for ; Wed, 24 Feb 2016 13:49:09 -0600 (CST) Received: from cuda.sgi.com (cuda1.sgi.com [192.48.157.11]) by relay1.corp.sgi.com (Postfix) with ESMTP id C235E8F8035 for ; Wed, 24 Feb 2016 11:49:02 -0800 (PST) X-ASG-Debug-ID: 1456343341-04bdf07ab513a7b0001-NocioJ Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by cuda.sgi.com with ESMTP id MbD9r2bR6qWpucjX (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO) for ; Wed, 24 Feb 2016 11:49:01 -0800 (PST) X-Barracuda-Envelope-From: mchristi@redhat.com X-Barracuda-Apparent-Source-IP: 209.132.183.28 X-ASG-Whitelist: Client Received: from int-mx09.intmail.prod.int.phx2.redhat.com (int-mx09.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by mx1.redhat.com (Postfix) with ESMTPS id 0543664392; Wed, 24 Feb 2016 19:49:01 +0000 (UTC) Received: from rh2.redhat.com (vpn-54-14.rdu2.redhat.com [10.10.54.14]) by int-mx09.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id u1OJmJEJ006684; Wed, 24 Feb 2016 14:48:58 -0500 From: mchristi@redhat.com To: linux-f2fs-devel@lists.sourceforge.net, linux-ext4@vger.kernel.org, konrad.wilk@oracle.com, drbd-dev@lists.linbit.com, philipp.reisner@linbit.com, lars.ellenberg@linbit.com, linux-raid@vger.kernel.org, dm-devel@redhat.com, linux-fsdevel@vger.kernel.org, linux-bcache@vger.kernel.org, linux-block@vger.kernel.org, linux-kernel@vger.kernel.org, linux-scsi@vger.kernel.org, linux-mtd@lists.infradead.org, target-devel@vger.kernel.org, linux-btrfs@vger.kernel.org, osd-dev@open-osd.org, xfs@oss.sgi.com, ocfs2-devel@oss.oracle.com Cc: Mike Christie Subject: [PATCH 14/35] hfsplus: set bi_op to REQ_OP Date: Wed, 24 Feb 2016 13:47:51 -0600 X-ASG-Orig-Subj: [PATCH 14/35] hfsplus: set bi_op to REQ_OP Message-Id: <1456343292-14535-15-git-send-email-mchristi@redhat.com> In-Reply-To: <1456343292-14535-1-git-send-email-mchristi@redhat.com> References: <1456343292-14535-1-git-send-email-mchristi@redhat.com> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.22 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.39]); Wed, 24 Feb 2016 19:49:01 +0000 (UTC) X-Barracuda-Connect: mx1.redhat.com[209.132.183.28] X-Barracuda-Start-Time: 1456343341 X-Barracuda-Encrypted: ECDHE-RSA-AES256-GCM-SHA384 X-Barracuda-URL: https://192.48.157.11:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-BRTS-Status: 1 From: Mike Christie This patch has hfsplus set the bio bi_op to a REQ_OP, and rq_flag_bits to bi_rw. This patch is compile tested only. Signed-off-by: Mike Christie --- fs/hfsplus/hfsplus_fs.h | 2 +- fs/hfsplus/part_tbl.c | 5 +++-- fs/hfsplus/super.c | 6 ++++-- fs/hfsplus/wrapper.c | 15 +++++++++------ 4 files changed, 17 insertions(+), 11 deletions(-) diff --git a/fs/hfsplus/hfsplus_fs.h b/fs/hfsplus/hfsplus_fs.h index f91a1fa..80154aa 100644 --- a/fs/hfsplus/hfsplus_fs.h +++ b/fs/hfsplus/hfsplus_fs.h @@ -525,7 +525,7 @@ int hfsplus_compare_dentry(const struct dentry *parent, /* wrapper.c */ int hfsplus_submit_bio(struct super_block *sb, sector_t sector, void *buf, - void **data, int rw); + void **data, int op, int op_flags); int hfsplus_read_wrapper(struct super_block *sb); /* time macros */ diff --git a/fs/hfsplus/part_tbl.c b/fs/hfsplus/part_tbl.c index eb355d8..63164eb 100644 --- a/fs/hfsplus/part_tbl.c +++ b/fs/hfsplus/part_tbl.c @@ -112,7 +112,8 @@ static int hfs_parse_new_pmap(struct super_block *sb, void *buf, if ((u8 *)pm - (u8 *)buf >= buf_size) { res = hfsplus_submit_bio(sb, *part_start + HFS_PMAP_BLK + i, - buf, (void **)&pm, READ); + buf, (void **)&pm, REQ_OP_READ, + 0); if (res) return res; } @@ -136,7 +137,7 @@ int hfs_part_find(struct super_block *sb, return -ENOMEM; res = hfsplus_submit_bio(sb, *part_start + HFS_PMAP_BLK, - buf, &data, READ); + buf, &data, REQ_OP_READ, 0); if (res) goto out; diff --git a/fs/hfsplus/super.c b/fs/hfsplus/super.c index 5d54490..01cf313 100644 --- a/fs/hfsplus/super.c +++ b/fs/hfsplus/super.c @@ -219,7 +219,8 @@ static int hfsplus_sync_fs(struct super_block *sb, int wait) error2 = hfsplus_submit_bio(sb, sbi->part_start + HFSPLUS_VOLHEAD_SECTOR, - sbi->s_vhdr_buf, NULL, WRITE_SYNC); + sbi->s_vhdr_buf, NULL, REQ_OP_WRITE, + WRITE_SYNC); if (!error) error = error2; if (!write_backup) @@ -227,7 +228,8 @@ static int hfsplus_sync_fs(struct super_block *sb, int wait) error2 = hfsplus_submit_bio(sb, sbi->part_start + sbi->sect_count - 2, - sbi->s_backup_vhdr_buf, NULL, WRITE_SYNC); + sbi->s_backup_vhdr_buf, NULL, REQ_OP_WRITE, + WRITE_SYNC); if (!error) error2 = error; out: diff --git a/fs/hfsplus/wrapper.c b/fs/hfsplus/wrapper.c index d026bb3..c5c916d 100644 --- a/fs/hfsplus/wrapper.c +++ b/fs/hfsplus/wrapper.c @@ -30,7 +30,8 @@ struct hfsplus_wd { * @sector: block to read or write, for blocks of HFSPLUS_SECTOR_SIZE bytes * @buf: buffer for I/O * @data: output pointer for location of requested data - * @rw: direction of I/O + * @op: direction of I/O + * @op_flags: request op flags * * The unit of I/O is hfsplus_min_io_size(sb), which may be bigger than * HFSPLUS_SECTOR_SIZE, and @buf must be sized accordingly. On reads @@ -44,7 +45,7 @@ struct hfsplus_wd { * will work correctly. */ int hfsplus_submit_bio(struct super_block *sb, sector_t sector, - void *buf, void **data, int rw) + void *buf, void **data, int op, int op_flags) { struct bio *bio; int ret = 0; @@ -65,9 +66,10 @@ int hfsplus_submit_bio(struct super_block *sb, sector_t sector, bio = bio_alloc(GFP_NOIO, 1); bio->bi_iter.bi_sector = sector; bio->bi_bdev = sb->s_bdev; - bio->bi_rw = rw; + bio->bi_op = op; + bio->bi_rw = op_flags; - if (!(rw & WRITE) && data) + if (op != WRITE && data) *data = (u8 *)buf + offset; while (io_size > 0) { @@ -182,7 +184,7 @@ int hfsplus_read_wrapper(struct super_block *sb) reread: error = hfsplus_submit_bio(sb, part_start + HFSPLUS_VOLHEAD_SECTOR, sbi->s_vhdr_buf, (void **)&sbi->s_vhdr, - READ); + REQ_OP_READ, 0); if (error) goto out_free_backup_vhdr; @@ -214,7 +216,8 @@ reread: error = hfsplus_submit_bio(sb, part_start + part_size - 2, sbi->s_backup_vhdr_buf, - (void **)&sbi->s_backup_vhdr, READ); + (void **)&sbi->s_backup_vhdr, REQ_OP_READ, + 0); if (error) goto out_free_backup_vhdr; -- 1.8.3.1 From mchristi@redhat.com Wed Feb 24 13:49:11 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=ham version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay3.corp.sgi.com [198.149.34.15]) by oss.sgi.com (Postfix) with ESMTP id 7AACD7F5F for ; Wed, 24 Feb 2016 13:49:11 -0600 (CST) Received: from cuda.sgi.com (cuda1.sgi.com [192.48.157.11]) by relay3.corp.sgi.com (Postfix) with ESMTP id E942DAC007 for ; Wed, 24 Feb 2016 11:49:04 -0800 (PST) X-ASG-Debug-ID: 1456343343-04bdf07ab313a7b0001-NocioJ Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by cuda.sgi.com with ESMTP id fLbvoSLKi7PEFvLh (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO) for ; Wed, 24 Feb 2016 11:49:03 -0800 (PST) X-Barracuda-Envelope-From: mchristi@redhat.com X-Barracuda-Apparent-Source-IP: 209.132.183.28 X-ASG-Whitelist: Client Received: from int-mx09.intmail.prod.int.phx2.redhat.com (int-mx09.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by mx1.redhat.com (Postfix) with ESMTPS id A2B98A70F; Wed, 24 Feb 2016 19:49:03 +0000 (UTC) Received: from rh2.redhat.com (vpn-54-14.rdu2.redhat.com [10.10.54.14]) by int-mx09.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id u1OJmJEK006684; Wed, 24 Feb 2016 14:49:01 -0500 From: mchristi@redhat.com To: linux-f2fs-devel@lists.sourceforge.net, linux-ext4@vger.kernel.org, konrad.wilk@oracle.com, drbd-dev@lists.linbit.com, philipp.reisner@linbit.com, lars.ellenberg@linbit.com, linux-raid@vger.kernel.org, dm-devel@redhat.com, linux-fsdevel@vger.kernel.org, linux-bcache@vger.kernel.org, linux-block@vger.kernel.org, linux-kernel@vger.kernel.org, linux-scsi@vger.kernel.org, linux-mtd@lists.infradead.org, target-devel@vger.kernel.org, linux-btrfs@vger.kernel.org, osd-dev@open-osd.org, xfs@oss.sgi.com, ocfs2-devel@oss.oracle.com Cc: Mike Christie Subject: [PATCH 15/35] mpage: set bi_op to REQ_OP Date: Wed, 24 Feb 2016 13:47:52 -0600 X-ASG-Orig-Subj: [PATCH 15/35] mpage: set bi_op to REQ_OP Message-Id: <1456343292-14535-16-git-send-email-mchristi@redhat.com> In-Reply-To: <1456343292-14535-1-git-send-email-mchristi@redhat.com> References: <1456343292-14535-1-git-send-email-mchristi@redhat.com> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.22 X-Barracuda-Connect: mx1.redhat.com[209.132.183.28] X-Barracuda-Start-Time: 1456343343 X-Barracuda-Encrypted: ECDHE-RSA-AES256-GCM-SHA384 X-Barracuda-URL: https://192.48.157.11:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-BRTS-Status: 1 From: Mike Christie This patch has the mpage.c code set the bio bi_op to a REQ_OP, and rq_flag_bits to bi_rw. I have run xfstest with xfs, but I am not sure if I have stressed these code paths well. Signed-off-by: Mike Christie --- fs/mpage.c | 41 +++++++++++++++++++++-------------------- 1 file changed, 21 insertions(+), 20 deletions(-) diff --git a/fs/mpage.c b/fs/mpage.c index 9479e73..f92df71 100644 --- a/fs/mpage.c +++ b/fs/mpage.c @@ -56,11 +56,12 @@ static void mpage_end_io(struct bio *bio) bio_put(bio); } -static struct bio *mpage_bio_submit(int rw, struct bio *bio) +static struct bio *mpage_bio_submit(int op, int op_flags, struct bio *bio) { bio->bi_end_io = mpage_end_io; - bio->bi_rw = rw; - guard_bio_eod(rw, bio); + bio->bi_op = op; + bio->bi_rw = op_flags; + guard_bio_eod(op, bio); submit_bio(bio); return NULL; } @@ -270,7 +271,7 @@ do_mpage_readpage(struct bio *bio, struct page *page, unsigned nr_pages, * This page will go to BIO. Do we need to send this BIO off first? */ if (bio && (*last_block_in_bio != blocks[0] - 1)) - bio = mpage_bio_submit(READ, bio); + bio = mpage_bio_submit(REQ_OP_READ, 0, bio); alloc_new: if (bio == NULL) { @@ -287,7 +288,7 @@ alloc_new: length = first_hole << blkbits; if (bio_add_page(bio, page, length, 0) < length) { - bio = mpage_bio_submit(READ, bio); + bio = mpage_bio_submit(REQ_OP_READ, 0, bio); goto alloc_new; } @@ -295,7 +296,7 @@ alloc_new: nblocks = map_bh->b_size >> blkbits; if ((buffer_boundary(map_bh) && relative_block == nblocks) || (first_hole != blocks_per_page)) - bio = mpage_bio_submit(READ, bio); + bio = mpage_bio_submit(REQ_OP_READ, 0, bio); else *last_block_in_bio = blocks[blocks_per_page - 1]; out: @@ -303,7 +304,7 @@ out: confused: if (bio) - bio = mpage_bio_submit(READ, bio); + bio = mpage_bio_submit(REQ_OP_READ, 0, bio); if (!PageUptodate(page)) block_read_full_page(page, get_block); else @@ -385,7 +386,7 @@ mpage_readpages(struct address_space *mapping, struct list_head *pages, } BUG_ON(!list_empty(pages)); if (bio) - mpage_bio_submit(READ, bio); + mpage_bio_submit(REQ_OP_READ, 0, bio); return 0; } EXPORT_SYMBOL(mpage_readpages); @@ -406,7 +407,7 @@ int mpage_readpage(struct page *page, get_block_t get_block) bio = do_mpage_readpage(bio, page, 1, &last_block_in_bio, &map_bh, &first_logical_block, get_block, gfp); if (bio) - mpage_bio_submit(READ, bio); + mpage_bio_submit(REQ_OP_READ, 0, bio); return 0; } EXPORT_SYMBOL(mpage_readpage); @@ -487,7 +488,7 @@ static int __mpage_writepage(struct page *page, struct writeback_control *wbc, struct buffer_head map_bh; loff_t i_size = i_size_read(inode); int ret = 0; - int wr = (wbc->sync_mode == WB_SYNC_ALL ? WRITE_SYNC : WRITE); + int op_flags = (wbc->sync_mode == WB_SYNC_ALL ? WRITE_SYNC : 0); if (page_has_buffers(page)) { struct buffer_head *head = page_buffers(page); @@ -596,7 +597,7 @@ page_is_mapped: * This page will go to BIO. Do we need to send this BIO off first? */ if (bio && mpd->last_block_in_bio != blocks[0] - 1) - bio = mpage_bio_submit(wr, bio); + bio = mpage_bio_submit(REQ_OP_WRITE, op_flags, bio); alloc_new: if (bio == NULL) { @@ -623,7 +624,7 @@ alloc_new: wbc_account_io(wbc, page, PAGE_SIZE); length = first_unmapped << blkbits; if (bio_add_page(bio, page, length, 0) < length) { - bio = mpage_bio_submit(wr, bio); + bio = mpage_bio_submit(REQ_OP_WRITE, op_flags, bio); goto alloc_new; } @@ -633,7 +634,7 @@ alloc_new: set_page_writeback(page); unlock_page(page); if (boundary || (first_unmapped != blocks_per_page)) { - bio = mpage_bio_submit(wr, bio); + bio = mpage_bio_submit(REQ_OP_WRITE, op_flags, bio); if (boundary_block) { write_boundary_block(boundary_bdev, boundary_block, 1 << blkbits); @@ -645,7 +646,7 @@ alloc_new: confused: if (bio) - bio = mpage_bio_submit(wr, bio); + bio = mpage_bio_submit(REQ_OP_WRITE, op_flags, bio); if (mpd->use_writepage) { ret = mapping->a_ops->writepage(page, wbc); @@ -702,9 +703,9 @@ mpage_writepages(struct address_space *mapping, ret = write_cache_pages(mapping, wbc, __mpage_writepage, &mpd); if (mpd.bio) { - int wr = (wbc->sync_mode == WB_SYNC_ALL ? - WRITE_SYNC : WRITE); - mpage_bio_submit(wr, mpd.bio); + int op_flags = (wbc->sync_mode == WB_SYNC_ALL ? + WRITE_SYNC : 0); + mpage_bio_submit(REQ_OP_WRITE, op_flags, mpd.bio); } } blk_finish_plug(&plug); @@ -723,9 +724,9 @@ int mpage_writepage(struct page *page, get_block_t get_block, }; int ret = __mpage_writepage(page, wbc, &mpd); if (mpd.bio) { - int wr = (wbc->sync_mode == WB_SYNC_ALL ? - WRITE_SYNC : WRITE); - mpage_bio_submit(wr, mpd.bio); + int op_flags = (wbc->sync_mode == WB_SYNC_ALL ? + WRITE_SYNC : 0); + mpage_bio_submit(REQ_OP_WRITE, op_flags, mpd.bio); } return ret; } -- 1.8.3.1 From mchristi@redhat.com Wed Feb 24 13:49:14 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=ham version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay3.corp.sgi.com [198.149.34.15]) by oss.sgi.com (Postfix) with ESMTP id B36117F5F for ; Wed, 24 Feb 2016 13:49:14 -0600 (CST) Received: from cuda.sgi.com (cuda2.sgi.com [192.48.176.25]) by relay3.corp.sgi.com (Postfix) with ESMTP id 12B1CAC002 for ; Wed, 24 Feb 2016 11:49:07 -0800 (PST) X-ASG-Debug-ID: 1456343346-04cbb06adffd3b0001-NocioJ Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by cuda.sgi.com with ESMTP id ziVHGfE3U3m0x1fZ (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO) for ; Wed, 24 Feb 2016 11:49:07 -0800 (PST) X-Barracuda-Envelope-From: mchristi@redhat.com X-Barracuda-Apparent-Source-IP: 209.132.183.28 X-ASG-Whitelist: Client Received: from int-mx09.intmail.prod.int.phx2.redhat.com (int-mx09.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by mx1.redhat.com (Postfix) with ESMTPS id 5281AC00F1E0; Wed, 24 Feb 2016 19:49:06 +0000 (UTC) Received: from rh2.redhat.com (vpn-54-14.rdu2.redhat.com [10.10.54.14]) by int-mx09.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id u1OJmJEL006684; Wed, 24 Feb 2016 14:49:03 -0500 From: mchristi@redhat.com To: linux-f2fs-devel@lists.sourceforge.net, linux-ext4@vger.kernel.org, konrad.wilk@oracle.com, drbd-dev@lists.linbit.com, philipp.reisner@linbit.com, lars.ellenberg@linbit.com, linux-raid@vger.kernel.org, dm-devel@redhat.com, linux-fsdevel@vger.kernel.org, linux-bcache@vger.kernel.org, linux-block@vger.kernel.org, linux-kernel@vger.kernel.org, linux-scsi@vger.kernel.org, linux-mtd@lists.infradead.org, target-devel@vger.kernel.org, linux-btrfs@vger.kernel.org, osd-dev@open-osd.org, xfs@oss.sgi.com, ocfs2-devel@oss.oracle.com Cc: Mike Christie Subject: [PATCH 16/35] nilfs: set bi_op to REQ_OP Date: Wed, 24 Feb 2016 13:47:53 -0600 X-ASG-Orig-Subj: [PATCH 16/35] nilfs: set bi_op to REQ_OP Message-Id: <1456343292-14535-17-git-send-email-mchristi@redhat.com> In-Reply-To: <1456343292-14535-1-git-send-email-mchristi@redhat.com> References: <1456343292-14535-1-git-send-email-mchristi@redhat.com> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.22 X-Barracuda-Connect: mx1.redhat.com[209.132.183.28] X-Barracuda-Start-Time: 1456343346 X-Barracuda-Encrypted: ECDHE-RSA-AES256-GCM-SHA384 X-Barracuda-URL: https://192.48.176.25:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-BRTS-Status: 1 From: Mike Christie This patch has nilfs set the bio bi_op to a REQ_OP, and rq_flag_bits to bi_rw. This patch is compile tested only. Signed-off-by: Mike Christie --- fs/nilfs2/segbuf.c | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/fs/nilfs2/segbuf.c b/fs/nilfs2/segbuf.c index 7666f1d..7b13e14 100644 --- a/fs/nilfs2/segbuf.c +++ b/fs/nilfs2/segbuf.c @@ -350,7 +350,8 @@ static void nilfs_end_bio_write(struct bio *bio) } static int nilfs_segbuf_submit_bio(struct nilfs_segment_buffer *segbuf, - struct nilfs_write_info *wi, int mode) + struct nilfs_write_info *wi, int mode, + int mode_flags) { struct bio *bio = wi->bio; int err; @@ -368,7 +369,8 @@ static int nilfs_segbuf_submit_bio(struct nilfs_segment_buffer *segbuf, bio->bi_end_io = nilfs_end_bio_write; bio->bi_private = segbuf; - bio->bi_rw = mode; + bio->bi_op = mode; + bio->bi_rw = mode_flags; submit_bio(bio); segbuf->sb_nbio++; @@ -442,7 +444,7 @@ static int nilfs_segbuf_submit_bh(struct nilfs_segment_buffer *segbuf, return 0; } /* bio is FULL */ - err = nilfs_segbuf_submit_bio(segbuf, wi, mode); + err = nilfs_segbuf_submit_bio(segbuf, wi, mode, 0); /* never submit current bh */ if (likely(!err)) goto repeat; @@ -466,19 +468,19 @@ static int nilfs_segbuf_write(struct nilfs_segment_buffer *segbuf, { struct nilfs_write_info wi; struct buffer_head *bh; - int res = 0, rw = WRITE; + int res = 0; wi.nilfs = nilfs; nilfs_segbuf_prepare_write(segbuf, &wi); list_for_each_entry(bh, &segbuf->sb_segsum_buffers, b_assoc_buffers) { - res = nilfs_segbuf_submit_bh(segbuf, &wi, bh, rw); + res = nilfs_segbuf_submit_bh(segbuf, &wi, bh, REQ_OP_WRITE); if (unlikely(res)) goto failed_bio; } list_for_each_entry(bh, &segbuf->sb_payload_buffers, b_assoc_buffers) { - res = nilfs_segbuf_submit_bh(segbuf, &wi, bh, rw); + res = nilfs_segbuf_submit_bh(segbuf, &wi, bh, REQ_OP_WRITE); if (unlikely(res)) goto failed_bio; } @@ -488,8 +490,8 @@ static int nilfs_segbuf_write(struct nilfs_segment_buffer *segbuf, * Last BIO is always sent through the following * submission. */ - rw |= REQ_SYNC; - res = nilfs_segbuf_submit_bio(segbuf, &wi, rw); + res = nilfs_segbuf_submit_bio(segbuf, &wi, REQ_OP_WRITE, + REQ_SYNC); } failed_bio: -- 1.8.3.1 From mchristi@redhat.com Wed Feb 24 13:49:16 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=ham version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay1.corp.sgi.com [137.38.102.111]) by oss.sgi.com (Postfix) with ESMTP id C63057F5F for ; Wed, 24 Feb 2016 13:49:16 -0600 (CST) Received: from cuda.sgi.com (cuda2.sgi.com [192.48.176.25]) by relay1.corp.sgi.com (Postfix) with ESMTP id 930CE8F8033 for ; Wed, 24 Feb 2016 11:49:10 -0800 (PST) X-ASG-Debug-ID: 1456343349-04cbb06addfd3b0001-NocioJ Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by cuda.sgi.com with ESMTP id FEvQkCliqvJX2AMQ (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO) for ; Wed, 24 Feb 2016 11:49:09 -0800 (PST) X-Barracuda-Envelope-From: mchristi@redhat.com X-Barracuda-Apparent-Source-IP: 209.132.183.28 X-ASG-Whitelist: Client Received: from int-mx09.intmail.prod.int.phx2.redhat.com (int-mx09.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by mx1.redhat.com (Postfix) with ESMTPS id 21557821C3; Wed, 24 Feb 2016 19:49:09 +0000 (UTC) Received: from rh2.redhat.com (vpn-54-14.rdu2.redhat.com [10.10.54.14]) by int-mx09.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id u1OJmJEM006684; Wed, 24 Feb 2016 14:49:06 -0500 From: mchristi@redhat.com To: linux-f2fs-devel@lists.sourceforge.net, linux-ext4@vger.kernel.org, konrad.wilk@oracle.com, drbd-dev@lists.linbit.com, philipp.reisner@linbit.com, lars.ellenberg@linbit.com, linux-raid@vger.kernel.org, dm-devel@redhat.com, linux-fsdevel@vger.kernel.org, linux-bcache@vger.kernel.org, linux-block@vger.kernel.org, linux-kernel@vger.kernel.org, linux-scsi@vger.kernel.org, linux-mtd@lists.infradead.org, target-devel@vger.kernel.org, linux-btrfs@vger.kernel.org, osd-dev@open-osd.org, xfs@oss.sgi.com, ocfs2-devel@oss.oracle.com Cc: Mike Christie Subject: [PATCH 17/35] ocfs2: set bi_op to REQ_OP Date: Wed, 24 Feb 2016 13:47:54 -0600 X-ASG-Orig-Subj: [PATCH 17/35] ocfs2: set bi_op to REQ_OP Message-Id: <1456343292-14535-18-git-send-email-mchristi@redhat.com> In-Reply-To: <1456343292-14535-1-git-send-email-mchristi@redhat.com> References: <1456343292-14535-1-git-send-email-mchristi@redhat.com> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.22 X-Barracuda-Connect: mx1.redhat.com[209.132.183.28] X-Barracuda-Start-Time: 1456343349 X-Barracuda-Encrypted: ECDHE-RSA-AES256-GCM-SHA384 X-Barracuda-URL: https://192.48.176.25:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-BRTS-Status: 1 From: Mike Christie This patch has ocfs2 set the bio bi_op to a REQ_OP, and rq_flag_bits to bi_rw. This patch is compile tested only. Signed-off-by: Mike Christie --- fs/ocfs2/cluster/heartbeat.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/fs/ocfs2/cluster/heartbeat.c b/fs/ocfs2/cluster/heartbeat.c index bbc6203..4635f89 100644 --- a/fs/ocfs2/cluster/heartbeat.c +++ b/fs/ocfs2/cluster/heartbeat.c @@ -531,7 +531,8 @@ static void o2hb_bio_end_io(struct bio *bio) static struct bio *o2hb_setup_one_bio(struct o2hb_region *reg, struct o2hb_bio_wait_ctxt *wc, unsigned int *current_slot, - unsigned int max_slots, int rw) + unsigned int max_slots, int op, + int op_flags) { int len, current_page; unsigned int vec_len, vec_start; @@ -557,7 +558,8 @@ static struct bio *o2hb_setup_one_bio(struct o2hb_region *reg, bio->bi_bdev = reg->hr_bdev; bio->bi_private = wc; bio->bi_end_io = o2hb_bio_end_io; - bio->bi_rw = rw; + bio->bi_op = op; + bio->bi_rw = op_flags; vec_start = (cs << bits) % PAGE_CACHE_SIZE; while(cs < max_slots) { @@ -594,7 +596,7 @@ static int o2hb_read_slots(struct o2hb_region *reg, while(current_slot < max_slots) { bio = o2hb_setup_one_bio(reg, &wc, ¤t_slot, max_slots, - READ); + REQ_OP_READ, 0); if (IS_ERR(bio)) { status = PTR_ERR(bio); mlog_errno(status); @@ -626,7 +628,8 @@ static int o2hb_issue_node_write(struct o2hb_region *reg, slot = o2nm_this_node(); - bio = o2hb_setup_one_bio(reg, write_wc, &slot, slot+1, WRITE_SYNC); + bio = o2hb_setup_one_bio(reg, write_wc, &slot, slot+1, REQ_OP_WRITE, + WRITE_SYNC); if (IS_ERR(bio)) { status = PTR_ERR(bio); mlog_errno(status); -- 1.8.3.1 From mchristi@redhat.com Wed Feb 24 13:49:19 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=ham version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay3.corp.sgi.com [198.149.34.15]) by oss.sgi.com (Postfix) with ESMTP id 630587F5F for ; Wed, 24 Feb 2016 13:49:19 -0600 (CST) Received: from cuda.sgi.com (cuda1.sgi.com [192.48.157.11]) by relay3.corp.sgi.com (Postfix) with ESMTP id E472DAC005 for ; Wed, 24 Feb 2016 11:49:12 -0800 (PST) X-ASG-Debug-ID: 1456343351-04bdf07ab413a7d0001-NocioJ Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by cuda.sgi.com with ESMTP id WZxFOgt7PDCAKft1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO) for ; Wed, 24 Feb 2016 11:49:11 -0800 (PST) X-Barracuda-Envelope-From: mchristi@redhat.com X-Barracuda-Apparent-Source-IP: 209.132.183.28 X-ASG-Whitelist: Client Received: from int-mx09.intmail.prod.int.phx2.redhat.com (int-mx09.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by mx1.redhat.com (Postfix) with ESMTPS id 93232326918; Wed, 24 Feb 2016 19:49:11 +0000 (UTC) Received: from rh2.redhat.com (vpn-54-14.rdu2.redhat.com [10.10.54.14]) by int-mx09.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id u1OJmJEN006684; Wed, 24 Feb 2016 14:49:09 -0500 From: mchristi@redhat.com To: linux-f2fs-devel@lists.sourceforge.net, linux-ext4@vger.kernel.org, konrad.wilk@oracle.com, drbd-dev@lists.linbit.com, philipp.reisner@linbit.com, lars.ellenberg@linbit.com, linux-raid@vger.kernel.org, dm-devel@redhat.com, linux-fsdevel@vger.kernel.org, linux-bcache@vger.kernel.org, linux-block@vger.kernel.org, linux-kernel@vger.kernel.org, linux-scsi@vger.kernel.org, linux-mtd@lists.infradead.org, target-devel@vger.kernel.org, linux-btrfs@vger.kernel.org, osd-dev@open-osd.org, xfs@oss.sgi.com, ocfs2-devel@oss.oracle.com Cc: Mike Christie Subject: [PATCH 18/35] pm: set bi_op to REQ_OP Date: Wed, 24 Feb 2016 13:47:55 -0600 X-ASG-Orig-Subj: [PATCH 18/35] pm: set bi_op to REQ_OP Message-Id: <1456343292-14535-19-git-send-email-mchristi@redhat.com> In-Reply-To: <1456343292-14535-1-git-send-email-mchristi@redhat.com> References: <1456343292-14535-1-git-send-email-mchristi@redhat.com> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.22 X-Barracuda-Connect: mx1.redhat.com[209.132.183.28] X-Barracuda-Start-Time: 1456343351 X-Barracuda-Encrypted: ECDHE-RSA-AES256-GCM-SHA384 X-Barracuda-URL: https://192.48.157.11:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-BRTS-Status: 1 From: Mike Christie This patch has the pm swap code set the bio bi_op to a REQ_OP, and rq_flag_bits to bi_rw. This patch is compile tested only. Signed-off-by: Mike Christie --- kernel/power/swap.c | 31 +++++++++++++++++++------------ 1 file changed, 19 insertions(+), 12 deletions(-) diff --git a/kernel/power/swap.c b/kernel/power/swap.c index 4d050eb..adbcb1b 100644 --- a/kernel/power/swap.c +++ b/kernel/power/swap.c @@ -250,7 +250,7 @@ static void hib_end_io(struct bio *bio) bio_put(bio); } -static int hib_submit_io(int rw, pgoff_t page_off, void *addr, +static int hib_submit_io(int op, int op_flags, pgoff_t page_off, void *addr, struct hib_bio_batch *hb) { struct page *page = virt_to_page(addr); @@ -260,7 +260,8 @@ static int hib_submit_io(int rw, pgoff_t page_off, void *addr, bio = bio_alloc(__GFP_RECLAIM | __GFP_HIGH, 1); bio->bi_iter.bi_sector = page_off * (PAGE_SIZE >> 9); bio->bi_bdev = hib_resume_bdev; - bio->bi_rw = rw; + bio->bi_op = op; + bio->bi_rw = op_flags; if (bio_add_page(bio, page, PAGE_SIZE, 0) < PAGE_SIZE) { printk(KERN_ERR "PM: Adding page to bio failed at %llu\n", @@ -296,7 +297,8 @@ static int mark_swapfiles(struct swap_map_handle *handle, unsigned int flags) { int error; - hib_submit_io(READ_SYNC, swsusp_resume_block, swsusp_header, NULL); + hib_submit_io(REQ_OP_READ, READ_SYNC, swsusp_resume_block, + swsusp_header, NULL); if (!memcmp("SWAP-SPACE",swsusp_header->sig, 10) || !memcmp("SWAPSPACE2",swsusp_header->sig, 10)) { memcpy(swsusp_header->orig_sig,swsusp_header->sig, 10); @@ -305,8 +307,8 @@ static int mark_swapfiles(struct swap_map_handle *handle, unsigned int flags) swsusp_header->flags = flags; if (flags & SF_CRC32_MODE) swsusp_header->crc32 = handle->crc32; - error = hib_submit_io(WRITE_SYNC, swsusp_resume_block, - swsusp_header, NULL); + error = hib_submit_io(REQ_OP_WRITE, WRITE_SYNC, + swsusp_resume_block, swsusp_header, NULL); } else { printk(KERN_ERR "PM: Swap header not found!\n"); error = -ENODEV; @@ -379,7 +381,7 @@ static int write_page(void *buf, sector_t offset, struct hib_bio_batch *hb) } else { src = buf; } - return hib_submit_io(WRITE_SYNC, offset, src, hb); + return hib_submit_io(REQ_OP_WRITE, WRITE_SYNC, offset, src, hb); } static void release_swap_writer(struct swap_map_handle *handle) @@ -982,7 +984,8 @@ static int get_swap_reader(struct swap_map_handle *handle, return -ENOMEM; } - error = hib_submit_io(READ_SYNC, offset, tmp->map, NULL); + error = hib_submit_io(REQ_OP_READ, READ_SYNC, offset, + tmp->map, NULL); if (error) { release_swap_reader(handle); return error; @@ -1006,7 +1009,7 @@ static int swap_read_page(struct swap_map_handle *handle, void *buf, offset = handle->cur->entries[handle->k]; if (!offset) return -EFAULT; - error = hib_submit_io(READ_SYNC, offset, buf, hb); + error = hib_submit_io(REQ_OP_READ, READ_SYNC, offset, buf, hb); if (error) return error; if (++handle->k >= MAP_PAGE_ENTRIES) { @@ -1508,7 +1511,8 @@ int swsusp_check(void) if (!IS_ERR(hib_resume_bdev)) { set_blocksize(hib_resume_bdev, PAGE_SIZE); clear_page(swsusp_header); - error = hib_submit_io(READ_SYNC, swsusp_resume_block, + error = hib_submit_io(REQ_OP_READ, READ_SYNC, + swsusp_resume_block, swsusp_header, NULL); if (error) goto put; @@ -1516,7 +1520,8 @@ int swsusp_check(void) if (!memcmp(HIBERNATE_SIG, swsusp_header->sig, 10)) { memcpy(swsusp_header->sig, swsusp_header->orig_sig, 10); /* Reset swap signature now */ - error = hib_submit_io(WRITE_SYNC, swsusp_resume_block, + error = hib_submit_io(REQ_OP_WRITE, WRITE_SYNC, + swsusp_resume_block, swsusp_header, NULL); } else { error = -EINVAL; @@ -1560,10 +1565,12 @@ int swsusp_unmark(void) { int error; - hib_submit_io(READ_SYNC, swsusp_resume_block, swsusp_header, NULL); + hib_submit_io(REQ_OP_READ, READ_SYNC, swsusp_resume_block, + swsusp_header, NULL); if (!memcmp(HIBERNATE_SIG,swsusp_header->sig, 10)) { memcpy(swsusp_header->sig,swsusp_header->orig_sig, 10); - error = hib_submit_io(WRITE_SYNC, swsusp_resume_block, + error = hib_submit_io(REQ_OP_WRITE, WRITE_SYNC, + swsusp_resume_block, swsusp_header, NULL); } else { printk(KERN_ERR "PM: Cannot find swsusp signature!\n"); -- 1.8.3.1 From mchristi@redhat.com Wed Feb 24 13:49:24 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=ham version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay3.corp.sgi.com [198.149.34.15]) by oss.sgi.com (Postfix) with ESMTP id 3BA077F63 for ; Wed, 24 Feb 2016 13:49:24 -0600 (CST) Received: from cuda.sgi.com (cuda3.sgi.com [192.48.176.15]) by relay3.corp.sgi.com (Postfix) with ESMTP id 85147AC006 for ; Wed, 24 Feb 2016 11:49:17 -0800 (PST) X-ASG-Debug-ID: 1456343354-04cb6c455bd5a10001-NocioJ Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by cuda.sgi.com with ESMTP id xDVeQpBTVBJKuxYA (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO) for ; Wed, 24 Feb 2016 11:49:14 -0800 (PST) X-Barracuda-Envelope-From: mchristi@redhat.com X-Barracuda-Apparent-Source-IP: 209.132.183.28 X-ASG-Whitelist: Client Received: from int-mx09.intmail.prod.int.phx2.redhat.com (int-mx09.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by mx1.redhat.com (Postfix) with ESMTPS id 30FEF6436E; Wed, 24 Feb 2016 19:49:14 +0000 (UTC) Received: from rh2.redhat.com (vpn-54-14.rdu2.redhat.com [10.10.54.14]) by int-mx09.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id u1OJmJEO006684; Wed, 24 Feb 2016 14:49:11 -0500 From: mchristi@redhat.com To: linux-f2fs-devel@lists.sourceforge.net, linux-ext4@vger.kernel.org, konrad.wilk@oracle.com, drbd-dev@lists.linbit.com, philipp.reisner@linbit.com, lars.ellenberg@linbit.com, linux-raid@vger.kernel.org, dm-devel@redhat.com, linux-fsdevel@vger.kernel.org, linux-bcache@vger.kernel.org, linux-block@vger.kernel.org, linux-kernel@vger.kernel.org, linux-scsi@vger.kernel.org, linux-mtd@lists.infradead.org, target-devel@vger.kernel.org, linux-btrfs@vger.kernel.org, osd-dev@open-osd.org, xfs@oss.sgi.com, ocfs2-devel@oss.oracle.com Cc: Mike Christie Subject: [PATCH 19/35] dm: set bi_op to REQ_OP Date: Wed, 24 Feb 2016 13:47:56 -0600 X-ASG-Orig-Subj: [PATCH 19/35] dm: set bi_op to REQ_OP Message-Id: <1456343292-14535-20-git-send-email-mchristi@redhat.com> In-Reply-To: <1456343292-14535-1-git-send-email-mchristi@redhat.com> References: <1456343292-14535-1-git-send-email-mchristi@redhat.com> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.22 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.39]); Wed, 24 Feb 2016 19:49:14 +0000 (UTC) X-Barracuda-Connect: mx1.redhat.com[209.132.183.28] X-Barracuda-Start-Time: 1456343354 X-Barracuda-Encrypted: ECDHE-RSA-AES256-GCM-SHA384 X-Barracuda-URL: https://192.48.176.15:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-BRTS-Status: 1 From: Mike Christie This patch has dm set the bio bi_op to a REQ_OP, and rq_flag_bits to bi_rw. I did some basic dm tests, but I think this patch should be considered compile tested only. I have not tested all the dm targets and I did not stress every code path I have touched. Signed-off-by: Mike Christie --- drivers/md/dm-bufio.c | 8 +++--- drivers/md/dm-crypt.c | 1 + drivers/md/dm-io.c | 57 ++++++++++++++++++++++------------------- drivers/md/dm-kcopyd.c | 25 +++++++++--------- drivers/md/dm-log-writes.c | 6 ++--- drivers/md/dm-log.c | 5 ++-- drivers/md/dm-raid1.c | 11 +++++--- drivers/md/dm-snap-persistent.c | 24 +++++++++-------- drivers/md/dm-thin.c | 7 ++--- drivers/md/dm.c | 1 + include/linux/dm-io.h | 3 ++- 11 files changed, 82 insertions(+), 66 deletions(-) diff --git a/drivers/md/dm-bufio.c b/drivers/md/dm-bufio.c index 9d3ee7f..b6055f2 100644 --- a/drivers/md/dm-bufio.c +++ b/drivers/md/dm-bufio.c @@ -574,7 +574,8 @@ static void use_dmio(struct dm_buffer *b, int rw, sector_t block, { int r; struct dm_io_request io_req = { - .bi_rw = rw, + .bi_op = rw, + .bi_op_flags = 0, .notify.fn = dmio_complete, .notify.context = b, .client = b->c->dm_io, @@ -634,7 +635,7 @@ static void use_inline_bio(struct dm_buffer *b, int rw, sector_t block, * the dm_buffer's inline bio is local to bufio. */ b->bio.bi_private = end_io; - b->bio.bi_rw = rw; + b->bio.bi_op = rw; /* * We assume that if len >= PAGE_SIZE ptr is page-aligned. @@ -1327,7 +1328,8 @@ EXPORT_SYMBOL_GPL(dm_bufio_write_dirty_buffers); int dm_bufio_issue_flush(struct dm_bufio_client *c) { struct dm_io_request io_req = { - .bi_rw = WRITE_FLUSH, + .bi_op = REQ_OP_WRITE, + .bi_op_flags = WRITE_FLUSH, .mem.type = DM_IO_KMEM, .mem.ptr.addr = NULL, .client = c->dm_io, diff --git a/drivers/md/dm-crypt.c b/drivers/md/dm-crypt.c index 4f3cb35..70fbf11 100644 --- a/drivers/md/dm-crypt.c +++ b/drivers/md/dm-crypt.c @@ -1136,6 +1136,7 @@ static void clone_init(struct dm_crypt_io *io, struct bio *clone) clone->bi_private = io; clone->bi_end_io = crypt_endio; clone->bi_bdev = cc->dev->bdev; + clone->bi_op = io->base_bio->bi_op; clone->bi_rw = io->base_bio->bi_rw; } diff --git a/drivers/md/dm-io.c b/drivers/md/dm-io.c index 50f17e3..0f723ca 100644 --- a/drivers/md/dm-io.c +++ b/drivers/md/dm-io.c @@ -278,8 +278,9 @@ static void km_dp_init(struct dpages *dp, void *data) /*----------------------------------------------------------------- * IO routines that accept a list of pages. *---------------------------------------------------------------*/ -static void do_region(int rw, unsigned region, struct dm_io_region *where, - struct dpages *dp, struct io *io) +static void do_region(int op, int op_flags, unsigned region, + struct dm_io_region *where, struct dpages *dp, + struct io *io) { struct bio *bio; struct page *page; @@ -295,24 +296,25 @@ static void do_region(int rw, unsigned region, struct dm_io_region *where, /* * Reject unsupported discard and write same requests. */ - if (rw & REQ_DISCARD) + if (op == REQ_OP_DISCARD) special_cmd_max_sectors = q->limits.max_discard_sectors; - else if (rw & REQ_WRITE_SAME) + else if (op == REQ_OP_WRITE_SAME) special_cmd_max_sectors = q->limits.max_write_same_sectors; - if ((rw & (REQ_DISCARD | REQ_WRITE_SAME)) && special_cmd_max_sectors == 0) { + if ((op == REQ_OP_DISCARD || op == REQ_OP_WRITE_SAME) && + special_cmd_max_sectors == 0) { dec_count(io, region, -EOPNOTSUPP); return; } /* - * where->count may be zero if rw holds a flush and we need to + * where->count may be zero if op holds a flush and we need to * send a zero-sized flush. */ do { /* * Allocate a suitably sized-bio. */ - if ((rw & REQ_DISCARD) || (rw & REQ_WRITE_SAME)) + if ((op == REQ_OP_DISCARD) || (op == REQ_OP_WRITE_SAME)) num_bvecs = 1; else num_bvecs = min_t(int, BIO_MAX_PAGES, @@ -322,14 +324,15 @@ static void do_region(int rw, unsigned region, struct dm_io_region *where, bio->bi_iter.bi_sector = where->sector + (where->count - remaining); bio->bi_bdev = where->bdev; bio->bi_end_io = endio; - bio->bi_rw = rw; + bio->bi_op = op; + bio->bi_rw = op_flags; store_io_and_region_in_bio(bio, io, region); - if (rw & REQ_DISCARD) { + if (op == REQ_OP_DISCARD) { num_sectors = min_t(sector_t, special_cmd_max_sectors, remaining); bio->bi_iter.bi_size = num_sectors << SECTOR_SHIFT; remaining -= num_sectors; - } else if (rw & REQ_WRITE_SAME) { + } else if (op == REQ_OP_WRITE_SAME) { /* * WRITE SAME only uses a single page. */ @@ -360,7 +363,7 @@ static void do_region(int rw, unsigned region, struct dm_io_region *where, } while (remaining); } -static void dispatch_io(int rw, unsigned int num_regions, +static void dispatch_io(int op, int op_flags, unsigned int num_regions, struct dm_io_region *where, struct dpages *dp, struct io *io, int sync) { @@ -370,7 +373,7 @@ static void dispatch_io(int rw, unsigned int num_regions, BUG_ON(num_regions > DM_IO_MAX_REGIONS); if (sync) - rw |= REQ_SYNC; + op_flags |= REQ_SYNC; /* * For multiple regions we need to be careful to rewind @@ -378,8 +381,8 @@ static void dispatch_io(int rw, unsigned int num_regions, */ for (i = 0; i < num_regions; i++) { *dp = old_pages; - if (where[i].count || (rw & REQ_FLUSH)) - do_region(rw, i, where + i, dp, io); + if (where[i].count || (op_flags & REQ_FLUSH)) + do_region(op, op_flags, i, where + i, dp, io); } /* @@ -403,13 +406,13 @@ static void sync_io_complete(unsigned long error, void *context) } static int sync_io(struct dm_io_client *client, unsigned int num_regions, - struct dm_io_region *where, int rw, struct dpages *dp, - unsigned long *error_bits) + struct dm_io_region *where, int op, int op_flags, + struct dpages *dp, unsigned long *error_bits) { struct io *io; struct sync_io sio; - if (num_regions > 1 && (rw & RW_MASK) != WRITE) { + if (num_regions > 1 && !op_is_write(op)) { WARN_ON(1); return -EIO; } @@ -426,7 +429,7 @@ static int sync_io(struct dm_io_client *client, unsigned int num_regions, io->vma_invalidate_address = dp->vma_invalidate_address; io->vma_invalidate_size = dp->vma_invalidate_size; - dispatch_io(rw, num_regions, where, dp, io, 1); + dispatch_io(op, op_flags, num_regions, where, dp, io, 1); wait_for_completion_io(&sio.wait); @@ -437,12 +440,12 @@ static int sync_io(struct dm_io_client *client, unsigned int num_regions, } static int async_io(struct dm_io_client *client, unsigned int num_regions, - struct dm_io_region *where, int rw, struct dpages *dp, - io_notify_fn fn, void *context) + struct dm_io_region *where, int op, int op_flags, + struct dpages *dp, io_notify_fn fn, void *context) { struct io *io; - if (num_regions > 1 && (rw & RW_MASK) != WRITE) { + if (num_regions > 1 && !op_is_write(op)) { WARN_ON(1); fn(1, context); return -EIO; @@ -458,7 +461,7 @@ static int async_io(struct dm_io_client *client, unsigned int num_regions, io->vma_invalidate_address = dp->vma_invalidate_address; io->vma_invalidate_size = dp->vma_invalidate_size; - dispatch_io(rw, num_regions, where, dp, io, 0); + dispatch_io(op, op_flags, num_regions, where, dp, io, 0); return 0; } @@ -481,7 +484,7 @@ static int dp_init(struct dm_io_request *io_req, struct dpages *dp, case DM_IO_VMA: flush_kernel_vmap_range(io_req->mem.ptr.vma, size); - if ((io_req->bi_rw & RW_MASK) == READ) { + if (io_req->bi_op == REQ_OP_READ) { dp->vma_invalidate_address = io_req->mem.ptr.vma; dp->vma_invalidate_size = size; } @@ -519,10 +522,12 @@ int dm_io(struct dm_io_request *io_req, unsigned num_regions, if (!io_req->notify.fn) return sync_io(io_req->client, num_regions, where, - io_req->bi_rw, &dp, sync_error_bits); + io_req->bi_op, io_req->bi_op_flags, &dp, + sync_error_bits); - return async_io(io_req->client, num_regions, where, io_req->bi_rw, - &dp, io_req->notify.fn, io_req->notify.context); + return async_io(io_req->client, num_regions, where, io_req->bi_op, + io_req->bi_op_flags, &dp, io_req->notify.fn, + io_req->notify.context); } EXPORT_SYMBOL(dm_io); diff --git a/drivers/md/dm-kcopyd.c b/drivers/md/dm-kcopyd.c index 1452ed9..4182bc7d 100644 --- a/drivers/md/dm-kcopyd.c +++ b/drivers/md/dm-kcopyd.c @@ -465,10 +465,10 @@ static void complete_io(unsigned long error, void *context) io_job_finish(kc->throttle); if (error) { - if (job->rw & WRITE) - job->write_err |= error; - else + if (job->rw == READ) job->read_err = 1; + else + job->write_err |= error; if (!test_bit(DM_KCOPYD_IGNORE_ERROR, &job->flags)) { push(&kc->complete_jobs, job); @@ -477,13 +477,11 @@ static void complete_io(unsigned long error, void *context) } } - if (job->rw & WRITE) - push(&kc->complete_jobs, job); - - else { + if (job->rw == READ) { job->rw = WRITE; push(&kc->io_jobs, job); - } + } else + push(&kc->complete_jobs, job); wake(kc); } @@ -496,7 +494,8 @@ static int run_io_job(struct kcopyd_job *job) { int r; struct dm_io_request io_req = { - .bi_rw = job->rw, + .bi_op = job->rw, + .bi_op_flags = 0, .mem.type = DM_IO_PAGE_LIST, .mem.ptr.pl = job->pages, .mem.offset = 0, @@ -550,10 +549,10 @@ static int process_jobs(struct list_head *jobs, struct dm_kcopyd_client *kc, if (r < 0) { /* error this rogue job */ - if (job->rw & WRITE) - job->write_err = (unsigned long) -1L; - else + if (job->rw == READ) job->read_err = 1; + else + job->write_err = (unsigned long) -1L; push(&kc->complete_jobs, job); break; } @@ -734,7 +733,7 @@ int dm_kcopyd_copy(struct dm_kcopyd_client *kc, struct dm_io_region *from, /* * Use WRITE SAME to optimize zeroing if all dests support it. */ - job->rw = WRITE | REQ_WRITE_SAME; + job->rw = REQ_OP_WRITE_SAME; for (i = 0; i < job->num_dests; i++) if (!bdev_write_same(job->dests[i].bdev)) { job->rw = WRITE; diff --git a/drivers/md/dm-log-writes.c b/drivers/md/dm-log-writes.c index addcc4b..27630c5 100644 --- a/drivers/md/dm-log-writes.c +++ b/drivers/md/dm-log-writes.c @@ -205,7 +205,7 @@ static int write_metadata(struct log_writes_c *lc, void *entry, bio->bi_bdev = lc->logdev->bdev; bio->bi_end_io = log_end_io; bio->bi_private = lc; - bio->bi_rw = WRITE; + bio->bi_op = REQ_OP_WRITE; page = alloc_page(GFP_KERNEL); if (!page) { @@ -270,7 +270,7 @@ static int log_one_block(struct log_writes_c *lc, bio->bi_bdev = lc->logdev->bdev; bio->bi_end_io = log_end_io; bio->bi_private = lc; - bio->bi_rw = WRITE; + bio->bi_op = REQ_OP_WRITE; for (i = 0; i < block->vec_cnt; i++) { /* @@ -292,7 +292,7 @@ static int log_one_block(struct log_writes_c *lc, bio->bi_bdev = lc->logdev->bdev; bio->bi_end_io = log_end_io; bio->bi_private = lc; - bio->bi_rw = WRITE; + bio->bi_op = REQ_OP_WRITE; ret = bio_add_page(bio, block->vecs[i].bv_page, block->vecs[i].bv_len, 0); diff --git a/drivers/md/dm-log.c b/drivers/md/dm-log.c index 627d191..4ca2d1d 100644 --- a/drivers/md/dm-log.c +++ b/drivers/md/dm-log.c @@ -293,7 +293,7 @@ static void header_from_disk(struct log_header_core *core, struct log_header_dis static int rw_header(struct log_c *lc, int rw) { - lc->io_req.bi_rw = rw; + lc->io_req.bi_op = rw; return dm_io(&lc->io_req, 1, &lc->header_location, NULL); } @@ -306,7 +306,8 @@ static int flush_header(struct log_c *lc) .count = 0, }; - lc->io_req.bi_rw = WRITE_FLUSH; + lc->io_req.bi_op = REQ_OP_WRITE; + lc->io_req.bi_op_flags = WRITE_FLUSH; return dm_io(&lc->io_req, 1, &null_location, NULL); } diff --git a/drivers/md/dm-raid1.c b/drivers/md/dm-raid1.c index b3ccf1e..8a86bc3 100644 --- a/drivers/md/dm-raid1.c +++ b/drivers/md/dm-raid1.c @@ -260,7 +260,8 @@ static int mirror_flush(struct dm_target *ti) struct dm_io_region io[ms->nr_mirrors]; struct mirror *m; struct dm_io_request io_req = { - .bi_rw = WRITE_FLUSH, + .bi_op = REQ_OP_WRITE, + .bi_op_flags = WRITE_FLUSH, .mem.type = DM_IO_KMEM, .mem.ptr.addr = NULL, .client = ms->io_client, @@ -541,7 +542,8 @@ static void read_async_bio(struct mirror *m, struct bio *bio) { struct dm_io_region io; struct dm_io_request io_req = { - .bi_rw = READ, + .bi_op = REQ_OP_READ, + .bi_op_flags = 0, .mem.type = DM_IO_BIO, .mem.ptr.bio = bio, .notify.fn = read_callback, @@ -654,7 +656,8 @@ static void do_write(struct mirror_set *ms, struct bio *bio) struct dm_io_region io[ms->nr_mirrors], *dest = io; struct mirror *m; struct dm_io_request io_req = { - .bi_rw = WRITE | (bio->bi_rw & WRITE_FLUSH_FUA), + .bi_op = REQ_OP_WRITE, + .bi_op_flags = bio->bi_rw & WRITE_FLUSH_FUA, .mem.type = DM_IO_BIO, .mem.ptr.bio = bio, .notify.fn = write_callback, @@ -663,7 +666,7 @@ static void do_write(struct mirror_set *ms, struct bio *bio) }; if (bio->bi_rw & REQ_DISCARD) { - io_req.bi_rw |= REQ_DISCARD; + io_req.bi_op = REQ_OP_DISCARD; io_req.mem.type = DM_IO_KMEM; io_req.mem.ptr.addr = NULL; } diff --git a/drivers/md/dm-snap-persistent.c b/drivers/md/dm-snap-persistent.c index 4d39093..b8cf956 100644 --- a/drivers/md/dm-snap-persistent.c +++ b/drivers/md/dm-snap-persistent.c @@ -226,8 +226,8 @@ static void do_metadata(struct work_struct *work) /* * Read or write a chunk aligned and sized block of data from a device. */ -static int chunk_io(struct pstore *ps, void *area, chunk_t chunk, int rw, - int metadata) +static int chunk_io(struct pstore *ps, void *area, chunk_t chunk, int op, + int op_flags, int metadata) { struct dm_io_region where = { .bdev = dm_snap_cow(ps->store->snap)->bdev, @@ -235,7 +235,8 @@ static int chunk_io(struct pstore *ps, void *area, chunk_t chunk, int rw, .count = ps->store->chunk_size, }; struct dm_io_request io_req = { - .bi_rw = rw, + .bi_op = op, + .bi_op_flags = op_flags, .mem.type = DM_IO_VMA, .mem.ptr.vma = area, .client = ps->io_client, @@ -281,14 +282,14 @@ static void skip_metadata(struct pstore *ps) * Read or write a metadata area. Remembering to skip the first * chunk which holds the header. */ -static int area_io(struct pstore *ps, int rw) +static int area_io(struct pstore *ps, int op, int op_flags) { int r; chunk_t chunk; chunk = area_location(ps, ps->current_area); - r = chunk_io(ps, ps->area, chunk, rw, 0); + r = chunk_io(ps, ps->area, chunk, op, op_flags, 0); if (r) return r; @@ -302,7 +303,8 @@ static void zero_memory_area(struct pstore *ps) static int zero_disk_area(struct pstore *ps, chunk_t area) { - return chunk_io(ps, ps->zero_area, area_location(ps, area), WRITE, 0); + return chunk_io(ps, ps->zero_area, area_location(ps, area), + REQ_OP_WRITE, 0, 0); } static int read_header(struct pstore *ps, int *new_snapshot) @@ -334,7 +336,7 @@ static int read_header(struct pstore *ps, int *new_snapshot) if (r) return r; - r = chunk_io(ps, ps->header_area, 0, READ, 1); + r = chunk_io(ps, ps->header_area, 0, REQ_OP_READ, 0, 1); if (r) goto bad; @@ -395,7 +397,7 @@ static int write_header(struct pstore *ps) dh->version = cpu_to_le32(ps->version); dh->chunk_size = cpu_to_le32(ps->store->chunk_size); - return chunk_io(ps, ps->header_area, 0, WRITE, 1); + return chunk_io(ps, ps->header_area, 0, REQ_OP_WRITE, 0, 1); } /* @@ -739,7 +741,7 @@ static void persistent_commit_exception(struct dm_exception_store *store, /* * Commit exceptions to disk. */ - if (ps->valid && area_io(ps, WRITE_FLUSH_FUA)) + if (ps->valid && area_io(ps, REQ_OP_WRITE, WRITE_FLUSH_FUA)) ps->valid = 0; /* @@ -779,7 +781,7 @@ static int persistent_prepare_merge(struct dm_exception_store *store, return 0; ps->current_area--; - r = area_io(ps, READ); + r = area_io(ps, REQ_OP_READ, 0); if (r < 0) return r; ps->current_committed = ps->exceptions_per_area; @@ -816,7 +818,7 @@ static int persistent_commit_merge(struct dm_exception_store *store, for (i = 0; i < nr_merged; i++) clear_exception(ps, ps->current_committed - 1 - i); - r = area_io(ps, WRITE_FLUSH_FUA); + r = area_io(ps, REQ_OP_WRITE, WRITE_FLUSH_FUA); if (r < 0) return r; diff --git a/drivers/md/dm-thin.c b/drivers/md/dm-thin.c index e39ad11..6e204e0 100644 --- a/drivers/md/dm-thin.c +++ b/drivers/md/dm-thin.c @@ -338,7 +338,7 @@ static int __blkdev_issue_discard_async(struct block_device *bdev, sector_t sect struct bio *parent_bio) { struct request_queue *q = bdev_get_queue(bdev); - int type = REQ_WRITE | REQ_DISCARD; + int op_flags = 0; struct bio *bio; if (!q || !nr_sects) @@ -350,7 +350,7 @@ static int __blkdev_issue_discard_async(struct block_device *bdev, sector_t sect if (flags & BLKDEV_DISCARD_SECURE) { if (!blk_queue_secdiscard(q)) return -EOPNOTSUPP; - type |= REQ_SECURE; + op_flags |= REQ_SECURE; } /* @@ -365,7 +365,8 @@ static int __blkdev_issue_discard_async(struct block_device *bdev, sector_t sect bio->bi_iter.bi_sector = sector; bio->bi_bdev = bdev; bio->bi_iter.bi_size = nr_sects << 9; - bio->bi_rw = type; + bio->bi_op = REQ_OP_DISCARD; + bio->bi_rw = op_flags; submit_bio(bio); diff --git a/drivers/md/dm.c b/drivers/md/dm.c index 503988f..fe03b26 100644 --- a/drivers/md/dm.c +++ b/drivers/md/dm.c @@ -2399,6 +2399,7 @@ static struct mapped_device *alloc_dev(int minor) bio_init(&md->flush_bio); md->flush_bio.bi_bdev = md->bdev; + md->flush_bio.bi_op = REQ_OP_WRITE; md->flush_bio.bi_rw = WRITE_FLUSH; dm_stats_init(&md->stats); diff --git a/include/linux/dm-io.h b/include/linux/dm-io.h index a68cbe5..b91b023 100644 --- a/include/linux/dm-io.h +++ b/include/linux/dm-io.h @@ -57,7 +57,8 @@ struct dm_io_notify { */ struct dm_io_client; struct dm_io_request { - int bi_rw; /* READ|WRITE - not READA */ + int bi_op; /* REQ_OP */ + int bi_op_flags; /* rq_flag_bits */ struct dm_io_memory mem; /* Memory to use for io */ struct dm_io_notify notify; /* Synchronous if notify.fn is NULL */ struct dm_io_client *client; /* Client memory handler */ -- 1.8.3.1 From mchristi@redhat.com Wed Feb 24 13:49:24 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=ham version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay1.corp.sgi.com [137.38.102.111]) by oss.sgi.com (Postfix) with ESMTP id EED157F67 for ; Wed, 24 Feb 2016 13:49:24 -0600 (CST) Received: from cuda.sgi.com (cuda3.sgi.com [192.48.176.15]) by relay1.corp.sgi.com (Postfix) with ESMTP id BFA098F8035 for ; Wed, 24 Feb 2016 11:49:18 -0800 (PST) X-ASG-Debug-ID: 1456343357-04cb6c455ad5a20001-NocioJ Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by cuda.sgi.com with ESMTP id KYyLhcLoCA54wKKW (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO) for ; Wed, 24 Feb 2016 11:49:17 -0800 (PST) X-Barracuda-Envelope-From: mchristi@redhat.com X-Barracuda-Apparent-Source-IP: 209.132.183.28 X-ASG-Whitelist: Client Received: from int-mx09.intmail.prod.int.phx2.redhat.com (int-mx09.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by mx1.redhat.com (Postfix) with ESMTPS id EE9D5BBB3F; Wed, 24 Feb 2016 19:49:16 +0000 (UTC) Received: from rh2.redhat.com (vpn-54-14.rdu2.redhat.com [10.10.54.14]) by int-mx09.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id u1OJmJEP006684; Wed, 24 Feb 2016 14:49:14 -0500 From: mchristi@redhat.com To: linux-f2fs-devel@lists.sourceforge.net, linux-ext4@vger.kernel.org, konrad.wilk@oracle.com, drbd-dev@lists.linbit.com, philipp.reisner@linbit.com, lars.ellenberg@linbit.com, linux-raid@vger.kernel.org, dm-devel@redhat.com, linux-fsdevel@vger.kernel.org, linux-bcache@vger.kernel.org, linux-block@vger.kernel.org, linux-kernel@vger.kernel.org, linux-scsi@vger.kernel.org, linux-mtd@lists.infradead.org, target-devel@vger.kernel.org, linux-btrfs@vger.kernel.org, osd-dev@open-osd.org, xfs@oss.sgi.com, ocfs2-devel@oss.oracle.com Cc: Mike Christie Subject: [PATCH 20/35] dm: pass dm stats data dir instead of bi_rw Date: Wed, 24 Feb 2016 13:47:57 -0600 X-ASG-Orig-Subj: [PATCH 20/35] dm: pass dm stats data dir instead of bi_rw Message-Id: <1456343292-14535-21-git-send-email-mchristi@redhat.com> In-Reply-To: <1456343292-14535-1-git-send-email-mchristi@redhat.com> References: <1456343292-14535-1-git-send-email-mchristi@redhat.com> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.22 X-Barracuda-Connect: mx1.redhat.com[209.132.183.28] X-Barracuda-Start-Time: 1456343357 X-Barracuda-Encrypted: ECDHE-RSA-AES256-GCM-SHA384 X-Barracuda-URL: https://192.48.176.15:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-BRTS-Status: 1 From: Mike Christie It looks like dm stats cares about the data direction (READ vs WRITE) and does not need the bio/request flags. Commands like REQ_FLUSH, REQ_DISCARD and REQ_WRITE_SAME are currently always set with REQ_WRITE, so the extra check for REQ_DISCARD in dm_stats_account_io is not needed. This patch has it use the bio and request data_dir helpers instead of accessing the bi_rw/cmd_flags directly. This makes the next patches that remove the operation from the cmd_flags and bi_rw easier, because we will no longer have the REQ_WRITE bit set for operations like discards. This patch is compile tested only. v2: 1. Merged Mike Snitzer's fixes to pass in int instead of unsigned long. 2. Fix 80 char col issues. Signed-off-by: Mike Christie --- drivers/md/dm-stats.c | 9 ++++----- drivers/md/dm.c | 21 ++++++++++++--------- 2 files changed, 16 insertions(+), 14 deletions(-) diff --git a/drivers/md/dm-stats.c b/drivers/md/dm-stats.c index 8289804..4fba26c 100644 --- a/drivers/md/dm-stats.c +++ b/drivers/md/dm-stats.c @@ -514,11 +514,10 @@ static void dm_stat_round(struct dm_stat *s, struct dm_stat_shared *shared, } static void dm_stat_for_entry(struct dm_stat *s, size_t entry, - unsigned long bi_rw, sector_t len, + int idx, sector_t len, struct dm_stats_aux *stats_aux, bool end, unsigned long duration_jiffies) { - unsigned long idx = bi_rw & REQ_WRITE; struct dm_stat_shared *shared = &s->stat_shared[entry]; struct dm_stat_percpu *p; @@ -584,7 +583,7 @@ static void dm_stat_for_entry(struct dm_stat *s, size_t entry, #endif } -static void __dm_stat_bio(struct dm_stat *s, unsigned long bi_rw, +static void __dm_stat_bio(struct dm_stat *s, int bi_rw, sector_t bi_sector, sector_t end_sector, bool end, unsigned long duration_jiffies, struct dm_stats_aux *stats_aux) @@ -645,8 +644,8 @@ void dm_stats_account_io(struct dm_stats *stats, unsigned long bi_rw, last = raw_cpu_ptr(stats->last); stats_aux->merged = (bi_sector == (ACCESS_ONCE(last->last_sector) && - ((bi_rw & (REQ_WRITE | REQ_DISCARD)) == - (ACCESS_ONCE(last->last_rw) & (REQ_WRITE | REQ_DISCARD))) + ((bi_rw == WRITE) == + (ACCESS_ONCE(last->last_rw) == WRITE)) )); ACCESS_ONCE(last->last_sector) = end_sector; ACCESS_ONCE(last->last_rw) = bi_rw; diff --git a/drivers/md/dm.c b/drivers/md/dm.c index fe03b26..38c7d93 100644 --- a/drivers/md/dm.c +++ b/drivers/md/dm.c @@ -723,8 +723,9 @@ static void start_io_acct(struct dm_io *io) atomic_inc_return(&md->pending[rw])); if (unlikely(dm_stats_used(&md->stats))) - dm_stats_account_io(&md->stats, bio->bi_rw, bio->bi_iter.bi_sector, - bio_sectors(bio), false, 0, &io->stats_aux); + dm_stats_account_io(&md->stats, bio_data_dir(bio), + bio->bi_iter.bi_sector, bio_sectors(bio), + false, 0, &io->stats_aux); } static void end_io_acct(struct dm_io *io) @@ -738,8 +739,9 @@ static void end_io_acct(struct dm_io *io) generic_end_io_acct(rw, &dm_disk(md)->part0, io->start_time); if (unlikely(dm_stats_used(&md->stats))) - dm_stats_account_io(&md->stats, bio->bi_rw, bio->bi_iter.bi_sector, - bio_sectors(bio), true, duration, &io->stats_aux); + dm_stats_account_io(&md->stats, bio_data_dir(bio), + bio->bi_iter.bi_sector, bio_sectors(bio), + true, duration, &io->stats_aux); /* * After this is decremented the bio must not be touched if it is @@ -1121,9 +1123,9 @@ static void rq_end_stats(struct mapped_device *md, struct request *orig) if (unlikely(dm_stats_used(&md->stats))) { struct dm_rq_target_io *tio = tio_from_request(orig); tio->duration_jiffies = jiffies - tio->duration_jiffies; - dm_stats_account_io(&md->stats, orig->cmd_flags, blk_rq_pos(orig), - tio->n_sectors, true, tio->duration_jiffies, - &tio->stats_aux); + dm_stats_account_io(&md->stats, rq_data_dir(orig), + blk_rq_pos(orig), tio->n_sectors, true, + tio->duration_jiffies, &tio->stats_aux); } } @@ -2069,8 +2071,9 @@ static void dm_start_request(struct mapped_device *md, struct request *orig) struct dm_rq_target_io *tio = tio_from_request(orig); tio->duration_jiffies = jiffies; tio->n_sectors = blk_rq_sectors(orig); - dm_stats_account_io(&md->stats, orig->cmd_flags, blk_rq_pos(orig), - tio->n_sectors, false, 0, &tio->stats_aux); + dm_stats_account_io(&md->stats, rq_data_dir(orig), + blk_rq_pos(orig), tio->n_sectors, false, 0, + &tio->stats_aux); } /* -- 1.8.3.1 From mchristi@redhat.com Wed Feb 24 13:49:28 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=ham version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay1.corp.sgi.com [137.38.102.111]) by oss.sgi.com (Postfix) with ESMTP id 27EC67F63 for ; Wed, 24 Feb 2016 13:49:28 -0600 (CST) Received: from cuda.sgi.com (cuda3.sgi.com [192.48.176.15]) by relay1.corp.sgi.com (Postfix) with ESMTP id EEBA18F8033 for ; Wed, 24 Feb 2016 11:49:21 -0800 (PST) X-ASG-Debug-ID: 1456343359-04cb6c455cd5a30001-NocioJ Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by cuda.sgi.com with ESMTP id yBrR74Ci09OvOC81 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO) for ; Wed, 24 Feb 2016 11:49:20 -0800 (PST) X-Barracuda-Envelope-From: mchristi@redhat.com X-Barracuda-Apparent-Source-IP: 209.132.183.28 X-ASG-Whitelist: Client Received: from int-mx09.intmail.prod.int.phx2.redhat.com (int-mx09.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by mx1.redhat.com (Postfix) with ESMTPS id 7B854C00B8C0; Wed, 24 Feb 2016 19:49:19 +0000 (UTC) Received: from rh2.redhat.com (vpn-54-14.rdu2.redhat.com [10.10.54.14]) by int-mx09.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id u1OJmJEQ006684; Wed, 24 Feb 2016 14:49:16 -0500 From: mchristi@redhat.com To: linux-f2fs-devel@lists.sourceforge.net, linux-ext4@vger.kernel.org, konrad.wilk@oracle.com, drbd-dev@lists.linbit.com, philipp.reisner@linbit.com, lars.ellenberg@linbit.com, linux-raid@vger.kernel.org, dm-devel@redhat.com, linux-fsdevel@vger.kernel.org, linux-bcache@vger.kernel.org, linux-block@vger.kernel.org, linux-kernel@vger.kernel.org, linux-scsi@vger.kernel.org, linux-mtd@lists.infradead.org, target-devel@vger.kernel.org, linux-btrfs@vger.kernel.org, osd-dev@open-osd.org, xfs@oss.sgi.com, ocfs2-devel@oss.oracle.com Cc: Mike Christie Subject: [PATCH 21/35] bcache: set bi_op to REQ_OP Date: Wed, 24 Feb 2016 13:47:58 -0600 X-ASG-Orig-Subj: [PATCH 21/35] bcache: set bi_op to REQ_OP Message-Id: <1456343292-14535-22-git-send-email-mchristi@redhat.com> In-Reply-To: <1456343292-14535-1-git-send-email-mchristi@redhat.com> References: <1456343292-14535-1-git-send-email-mchristi@redhat.com> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.22 X-Barracuda-Connect: mx1.redhat.com[209.132.183.28] X-Barracuda-Start-Time: 1456343360 X-Barracuda-Encrypted: ECDHE-RSA-AES256-GCM-SHA384 X-Barracuda-URL: https://192.48.176.15:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-BRTS-Status: 1 From: Mike Christie This patch has bcache set the bio bi_op to a REQ_OP, and rq_flag_bits to bi_rw. This patch is compile tested only Signed-off-by: Mike Christie --- drivers/md/bcache/btree.c | 2 ++ drivers/md/bcache/debug.c | 2 ++ drivers/md/bcache/io.c | 2 +- drivers/md/bcache/journal.c | 7 ++++--- drivers/md/bcache/movinggc.c | 2 +- drivers/md/bcache/request.c | 9 +++++---- drivers/md/bcache/super.c | 26 +++++++++++++++----------- drivers/md/bcache/writeback.c | 4 ++-- 8 files changed, 32 insertions(+), 22 deletions(-) diff --git a/drivers/md/bcache/btree.c b/drivers/md/bcache/btree.c index 22b9e34..752a44f 100644 --- a/drivers/md/bcache/btree.c +++ b/drivers/md/bcache/btree.c @@ -295,6 +295,7 @@ static void bch_btree_node_read(struct btree *b) closure_init_stack(&cl); bio = bch_bbio_alloc(b->c); + bio->bi_op = REQ_OP_READ; bio->bi_rw = REQ_META|READ_SYNC; bio->bi_iter.bi_size = KEY_SIZE(&b->key) << 9; bio->bi_end_io = btree_node_read_endio; @@ -397,6 +398,7 @@ static void do_btree_node_write(struct btree *b) b->bio->bi_end_io = btree_node_write_endio; b->bio->bi_private = cl; + b->bio->bi_op = REQ_OP_WRITE; b->bio->bi_rw = REQ_META|WRITE_SYNC|REQ_FUA; b->bio->bi_iter.bi_size = roundup(set_bytes(i), block_bytes(b->c)); bch_bio_map(b->bio, i); diff --git a/drivers/md/bcache/debug.c b/drivers/md/bcache/debug.c index 52b6bcf..8df9e66 100644 --- a/drivers/md/bcache/debug.c +++ b/drivers/md/bcache/debug.c @@ -52,6 +52,7 @@ void bch_btree_verify(struct btree *b) bio->bi_bdev = PTR_CACHE(b->c, &b->key, 0)->bdev; bio->bi_iter.bi_sector = PTR_OFFSET(&b->key, 0); bio->bi_iter.bi_size = KEY_SIZE(&v->key) << 9; + bio->bi_op = REQ_OP_READ; bio->bi_rw = REQ_META|READ_SYNC; bch_bio_map(bio, sorted); @@ -114,6 +115,7 @@ void bch_data_verify(struct cached_dev *dc, struct bio *bio) check = bio_clone(bio, GFP_NOIO); if (!check) return; + check->bi_op = REQ_OP_READ; check->bi_rw |= READ_SYNC; if (bio_alloc_pages(check, GFP_NOIO)) diff --git a/drivers/md/bcache/io.c b/drivers/md/bcache/io.c index 86a0bb8..f10a9a0 100644 --- a/drivers/md/bcache/io.c +++ b/drivers/md/bcache/io.c @@ -111,7 +111,7 @@ void bch_bbio_count_io_errors(struct cache_set *c, struct bio *bio, struct bbio *b = container_of(bio, struct bbio, bio); struct cache *ca = PTR_CACHE(c, &b->key, 0); - unsigned threshold = bio->bi_rw & REQ_WRITE + unsigned threshold = op_is_write(bio->bi_op) ? c->congested_write_threshold_us : c->congested_read_threshold_us; diff --git a/drivers/md/bcache/journal.c b/drivers/md/bcache/journal.c index af3f9f7..68fa0f0 100644 --- a/drivers/md/bcache/journal.c +++ b/drivers/md/bcache/journal.c @@ -54,7 +54,7 @@ reread: left = ca->sb.bucket_size - offset; bio_reset(bio); bio->bi_iter.bi_sector = bucket + offset; bio->bi_bdev = ca->bdev; - bio->bi_rw = READ; + bio->bi_op = REQ_OP_READ; bio->bi_iter.bi_size = len << 9; bio->bi_end_io = journal_read_endio; @@ -452,7 +452,7 @@ static void do_journal_discard(struct cache *ca) bio->bi_iter.bi_sector = bucket_to_sector(ca->set, ca->sb.d[ja->discard_idx]); bio->bi_bdev = ca->bdev; - bio->bi_rw = REQ_WRITE|REQ_DISCARD; + bio->bi_op = REQ_OP_DISCARD; bio->bi_max_vecs = 1; bio->bi_io_vec = bio->bi_inline_vecs; bio->bi_iter.bi_size = bucket_bytes(ca); @@ -626,7 +626,8 @@ static void journal_write_unlocked(struct closure *cl) bio_reset(bio); bio->bi_iter.bi_sector = PTR_OFFSET(k, i); bio->bi_bdev = ca->bdev; - bio->bi_rw = REQ_WRITE|REQ_SYNC|REQ_META|REQ_FLUSH|REQ_FUA; + bio->bi_op = REQ_OP_WRITE; + bio->bi_rw = REQ_SYNC|REQ_META|REQ_FLUSH|REQ_FUA; bio->bi_iter.bi_size = sectors << 9; bio->bi_end_io = journal_write_endio; diff --git a/drivers/md/bcache/movinggc.c b/drivers/md/bcache/movinggc.c index b929fc9..f33860a 100644 --- a/drivers/md/bcache/movinggc.c +++ b/drivers/md/bcache/movinggc.c @@ -163,7 +163,7 @@ static void read_moving(struct cache_set *c) moving_init(io); bio = &io->bio.bio; - bio->bi_rw = READ; + bio->bi_op = REQ_OP_READ; bio->bi_end_io = read_moving_endio; if (bio_alloc_pages(bio, GFP_KERNEL)) diff --git a/drivers/md/bcache/request.c b/drivers/md/bcache/request.c index 25fa844..cd6837c 100644 --- a/drivers/md/bcache/request.c +++ b/drivers/md/bcache/request.c @@ -253,7 +253,7 @@ static void bch_data_insert_start(struct closure *cl) trace_bcache_cache_insert(k); bch_keylist_push(&op->insert_keys); - n->bi_rw |= REQ_WRITE; + n->bi_op = REQ_OP_WRITE; bch_submit_bbio(n, op->c, k, 0); } while (n != bio); @@ -383,7 +383,7 @@ static bool check_should_bypass(struct cached_dev *dc, struct bio *bio) if (mode == CACHE_MODE_NONE || (mode == CACHE_MODE_WRITEAROUND && - (bio->bi_rw & REQ_WRITE))) + op_is_write(bio->bi_op))) goto skip; if (bio->bi_iter.bi_sector & (c->sb.block_size - 1) || @@ -404,7 +404,7 @@ static bool check_should_bypass(struct cached_dev *dc, struct bio *bio) if (!congested && mode == CACHE_MODE_WRITEBACK && - (bio->bi_rw & REQ_WRITE) && + op_is_write(bio->bi_op) && (bio->bi_rw & REQ_SYNC)) goto rescale; @@ -657,7 +657,7 @@ static inline struct search *search_alloc(struct bio *bio, s->cache_miss = NULL; s->d = d; s->recoverable = 1; - s->write = (bio->bi_rw & REQ_WRITE) != 0; + s->write = op_is_write(bio->bi_op); s->read_dirty_data = 0; s->start_time = jiffies; @@ -925,6 +925,7 @@ static void cached_dev_write(struct cached_dev *dc, struct search *s) struct bio *flush = bio_alloc_bioset(GFP_NOIO, 0, dc->disk.bio_split); + flush->bi_op = REQ_OP_WRITE; flush->bi_rw = WRITE_FLUSH; flush->bi_bdev = bio->bi_bdev; flush->bi_end_io = request_endio; diff --git a/drivers/md/bcache/super.c b/drivers/md/bcache/super.c index 9e2eac8..b11f7f4 100644 --- a/drivers/md/bcache/super.c +++ b/drivers/md/bcache/super.c @@ -212,7 +212,8 @@ static void __write_super(struct cache_sb *sb, struct bio *bio) unsigned i; bio->bi_iter.bi_sector = SB_SECTOR; - bio->bi_rw = REQ_WRITE|REQ_SYNC|REQ_META; + bio->bi_op = REQ_OP_WRITE; + bio->bi_rw = REQ_SYNC|REQ_META; bio->bi_iter.bi_size = SB_SIZE; bch_bio_map(bio, NULL); @@ -333,7 +334,7 @@ static void uuid_io_unlock(struct closure *cl) up(&c->uuid_write_mutex); } -static void uuid_io(struct cache_set *c, unsigned long rw, +static void uuid_io(struct cache_set *c, int op, unsigned long op_flags, struct bkey *k, struct closure *parent) { struct closure *cl = &c->uuid_write; @@ -348,7 +349,8 @@ static void uuid_io(struct cache_set *c, unsigned long rw, for (i = 0; i < KEY_PTRS(k); i++) { struct bio *bio = bch_bbio_alloc(c); - bio->bi_rw = REQ_SYNC|REQ_META|rw; + bio->bi_op = op; + bio->bi_rw = REQ_SYNC|REQ_META|op_flags; bio->bi_iter.bi_size = KEY_SIZE(k) << 9; bio->bi_end_io = uuid_endio; @@ -357,12 +359,12 @@ static void uuid_io(struct cache_set *c, unsigned long rw, bch_submit_bbio(bio, c, k, i); - if (!(rw & WRITE)) + if (op != REQ_OP_WRITE) break; } bch_extent_to_text(buf, sizeof(buf), k); - pr_debug("%s UUIDs at %s", rw & REQ_WRITE ? "wrote" : "read", buf); + pr_debug("%s UUIDs at %s", op == REQ_OP_WRITE ? "wrote" : "read", buf); for (u = c->uuids; u < c->uuids + c->nr_uuids; u++) if (!bch_is_zero(u->uuid, 16)) @@ -381,7 +383,7 @@ static char *uuid_read(struct cache_set *c, struct jset *j, struct closure *cl) return "bad uuid pointer"; bkey_copy(&c->uuid_bucket, k); - uuid_io(c, READ_SYNC, k, cl); + uuid_io(c, REQ_OP_READ, READ_SYNC, k, cl); if (j->version < BCACHE_JSET_VERSION_UUIDv1) { struct uuid_entry_v0 *u0 = (void *) c->uuids; @@ -426,7 +428,7 @@ static int __uuid_write(struct cache_set *c) return 1; SET_KEY_SIZE(&k.key, c->sb.bucket_size); - uuid_io(c, REQ_WRITE, &k.key, &cl); + uuid_io(c, REQ_OP_WRITE, 0, &k.key, &cl); closure_sync(&cl); bkey_copy(&c->uuid_bucket, &k.key); @@ -498,7 +500,8 @@ static void prio_endio(struct bio *bio) closure_put(&ca->prio); } -static void prio_io(struct cache *ca, uint64_t bucket, unsigned long rw) +static void prio_io(struct cache *ca, uint64_t bucket, int op, + unsigned long op_flags) { struct closure *cl = &ca->prio; struct bio *bio = bch_bbio_alloc(ca->set); @@ -507,7 +510,8 @@ static void prio_io(struct cache *ca, uint64_t bucket, unsigned long rw) bio->bi_iter.bi_sector = bucket * ca->sb.bucket_size; bio->bi_bdev = ca->bdev; - bio->bi_rw = REQ_SYNC|REQ_META|rw; + bio->bi_op = op; + bio->bi_rw = REQ_SYNC|REQ_META|op_flags; bio->bi_iter.bi_size = bucket_bytes(ca); bio->bi_end_io = prio_endio; @@ -557,7 +561,7 @@ void bch_prio_write(struct cache *ca) BUG_ON(bucket == -1); mutex_unlock(&ca->set->bucket_lock); - prio_io(ca, bucket, REQ_WRITE); + prio_io(ca, bucket, REQ_OP_WRITE, 0); mutex_lock(&ca->set->bucket_lock); ca->prio_buckets[i] = bucket; @@ -599,7 +603,7 @@ static void prio_read(struct cache *ca, uint64_t bucket) ca->prio_last_buckets[bucket_nr] = bucket; bucket_nr++; - prio_io(ca, bucket, READ_SYNC); + prio_io(ca, bucket, REQ_OP_READ, READ_SYNC); if (p->csum != bch_crc64(&p->magic, bucket_bytes(ca) - 8)) pr_warn("bad csum reading priorities"); diff --git a/drivers/md/bcache/writeback.c b/drivers/md/bcache/writeback.c index b9346cd..96ddf28 100644 --- a/drivers/md/bcache/writeback.c +++ b/drivers/md/bcache/writeback.c @@ -183,7 +183,7 @@ static void write_dirty(struct closure *cl) struct keybuf_key *w = io->bio.bi_private; dirty_init(w); - io->bio.bi_rw = WRITE; + io->bio.bi_op = REQ_OP_WRITE; io->bio.bi_iter.bi_sector = KEY_START(&w->key); io->bio.bi_bdev = io->dc->bdev; io->bio.bi_end_io = dirty_endio; @@ -256,7 +256,7 @@ static void read_dirty(struct cached_dev *dc) io->bio.bi_iter.bi_sector = PTR_OFFSET(&w->key, 0); io->bio.bi_bdev = PTR_CACHE(dc->disk.c, &w->key, 0)->bdev; - io->bio.bi_rw = READ; + io->bio.bi_op = REQ_OP_READ; io->bio.bi_end_io = read_dirty_endio; if (bio_alloc_pages(&io->bio, GFP_KERNEL)) -- 1.8.3.1 From mchristi@redhat.com Wed Feb 24 13:49:30 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=ham version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay2.corp.sgi.com [137.38.102.29]) by oss.sgi.com (Postfix) with ESMTP id F12807F63 for ; Wed, 24 Feb 2016 13:49:30 -0600 (CST) Received: from cuda.sgi.com (cuda2.sgi.com [192.48.176.25]) by relay2.corp.sgi.com (Postfix) with ESMTP id B5F9630406A for ; Wed, 24 Feb 2016 11:49:24 -0800 (PST) X-ASG-Debug-ID: 1456343362-04cbb06adffd3d0001-NocioJ Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by cuda.sgi.com with ESMTP id mGRwELk82zFnJUek (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO) for ; Wed, 24 Feb 2016 11:49:22 -0800 (PST) X-Barracuda-Envelope-From: mchristi@redhat.com X-Barracuda-Apparent-Source-IP: 209.132.183.28 X-ASG-Whitelist: Client Received: from int-mx09.intmail.prod.int.phx2.redhat.com (int-mx09.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by mx1.redhat.com (Postfix) with ESMTPS id 3E852C00B8C7; Wed, 24 Feb 2016 19:49:22 +0000 (UTC) Received: from rh2.redhat.com (vpn-54-14.rdu2.redhat.com [10.10.54.14]) by int-mx09.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id u1OJmJER006684; Wed, 24 Feb 2016 14:49:19 -0500 From: mchristi@redhat.com To: linux-f2fs-devel@lists.sourceforge.net, linux-ext4@vger.kernel.org, konrad.wilk@oracle.com, drbd-dev@lists.linbit.com, philipp.reisner@linbit.com, lars.ellenberg@linbit.com, linux-raid@vger.kernel.org, dm-devel@redhat.com, linux-fsdevel@vger.kernel.org, linux-bcache@vger.kernel.org, linux-block@vger.kernel.org, linux-kernel@vger.kernel.org, linux-scsi@vger.kernel.org, linux-mtd@lists.infradead.org, target-devel@vger.kernel.org, linux-btrfs@vger.kernel.org, osd-dev@open-osd.org, xfs@oss.sgi.com, ocfs2-devel@oss.oracle.com Cc: Mike Christie Subject: [PATCH 22/35] drbd: set bi_op to REQ_OP Date: Wed, 24 Feb 2016 13:47:59 -0600 X-ASG-Orig-Subj: [PATCH 22/35] drbd: set bi_op to REQ_OP Message-Id: <1456343292-14535-23-git-send-email-mchristi@redhat.com> In-Reply-To: <1456343292-14535-1-git-send-email-mchristi@redhat.com> References: <1456343292-14535-1-git-send-email-mchristi@redhat.com> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.22 X-Barracuda-Connect: mx1.redhat.com[209.132.183.28] X-Barracuda-Start-Time: 1456343362 X-Barracuda-Encrypted: ECDHE-RSA-AES256-GCM-SHA384 X-Barracuda-URL: https://192.48.176.25:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-BRTS-Status: 1 From: Mike Christie This patch has drbd set the bio bi_op to a REQ_OP, and rq_flag_bits to bi_rw. Lars and Philip, I might have split this patch up a little weird. Thisi patch handles setting up the bio, and then patch 30 (0030-block-fs-drivers-do-not-test-bi_rw-for-REQ_OPs.patch) handles where were check/read bio->bi_rw. This patch is compile tested only. Signed-off-by: Mike Christie --- drivers/block/drbd/drbd_actlog.c | 29 ++++++++++++++++------------- drivers/block/drbd/drbd_bitmap.c | 6 +++--- drivers/block/drbd/drbd_int.h | 4 ++-- drivers/block/drbd/drbd_main.c | 5 +++-- drivers/block/drbd/drbd_receiver.c | 37 +++++++++++++++++++++++++------------ drivers/block/drbd/drbd_worker.c | 3 ++- 6 files changed, 51 insertions(+), 33 deletions(-) diff --git a/drivers/block/drbd/drbd_actlog.c b/drivers/block/drbd/drbd_actlog.c index 6069e15..2fa8534 100644 --- a/drivers/block/drbd/drbd_actlog.c +++ b/drivers/block/drbd/drbd_actlog.c @@ -137,19 +137,19 @@ void wait_until_done_or_force_detached(struct drbd_device *device, struct drbd_b static int _drbd_md_sync_page_io(struct drbd_device *device, struct drbd_backing_dev *bdev, - sector_t sector, int rw) + sector_t sector, int op) { struct bio *bio; /* we do all our meta data IO in aligned 4k blocks. */ const int size = 4096; - int err; + int err, op_flags = 0; device->md_io.done = 0; device->md_io.error = -ENODEV; - if ((rw & WRITE) && !test_bit(MD_NO_FUA, &device->flags)) - rw |= REQ_FUA | REQ_FLUSH; - rw |= REQ_SYNC | REQ_NOIDLE; + if ((op == REQ_OP_WRITE) && !test_bit(MD_NO_FUA, &device->flags)) + op_flags |= REQ_FUA | REQ_FLUSH; + op_flags |= REQ_SYNC | REQ_NOIDLE; bio = bio_alloc_drbd(GFP_NOIO); bio->bi_bdev = bdev->md_bdev; @@ -159,9 +159,10 @@ static int _drbd_md_sync_page_io(struct drbd_device *device, goto out; bio->bi_private = device; bio->bi_end_io = drbd_md_endio; - bio->bi_rw = rw; + bio->bi_op = op; + bio->bi_rw = op_flags; - if (!(rw & WRITE) && device->state.disk == D_DISKLESS && device->ldev == NULL) + if (op != REQ_OP_WRITE && device->state.disk == D_DISKLESS && device->ldev == NULL) /* special case, drbd_md_read() during drbd_adm_attach(): no get_ldev */ ; else if (!get_ldev_if_state(device, D_ATTACHING)) { @@ -174,7 +175,7 @@ static int _drbd_md_sync_page_io(struct drbd_device *device, bio_get(bio); /* one bio_put() is in the completion handler */ atomic_inc(&device->md_io.in_use); /* drbd_md_put_buffer() is in the completion handler */ device->md_io.submit_jif = jiffies; - if (drbd_insert_fault(device, (rw & WRITE) ? DRBD_FAULT_MD_WR : DRBD_FAULT_MD_RD)) + if (drbd_insert_fault(device, (op == REQ_OP_WRITE) ? DRBD_FAULT_MD_WR : DRBD_FAULT_MD_RD)) bio_io_error(bio); else submit_bio(bio); @@ -188,7 +189,7 @@ static int _drbd_md_sync_page_io(struct drbd_device *device, } int drbd_md_sync_page_io(struct drbd_device *device, struct drbd_backing_dev *bdev, - sector_t sector, int rw) + sector_t sector, int op) { int err; D_ASSERT(device, atomic_read(&device->md_io.in_use) == 1); @@ -197,19 +198,21 @@ int drbd_md_sync_page_io(struct drbd_device *device, struct drbd_backing_dev *bd dynamic_drbd_dbg(device, "meta_data io: %s [%d]:%s(,%llus,%s) %pS\n", current->comm, current->pid, __func__, - (unsigned long long)sector, (rw & WRITE) ? "WRITE" : "READ", + (unsigned long long)sector, (op == REQ_OP_WRITE) ? "WRITE" : "READ", (void*)_RET_IP_ ); if (sector < drbd_md_first_sector(bdev) || sector + 7 > drbd_md_last_sector(bdev)) drbd_alert(device, "%s [%d]:%s(,%llus,%s) out of range md access!\n", current->comm, current->pid, __func__, - (unsigned long long)sector, (rw & WRITE) ? "WRITE" : "READ"); + (unsigned long long)sector, + (op == REQ_OP_WRITE) ? "WRITE" : "READ"); - err = _drbd_md_sync_page_io(device, bdev, sector, rw); + err = _drbd_md_sync_page_io(device, bdev, sector, op); if (err) { drbd_err(device, "drbd_md_sync_page_io(,%llus,%s) failed with error %d\n", - (unsigned long long)sector, (rw & WRITE) ? "WRITE" : "READ", err); + (unsigned long long)sector, + (op == REQ_OP_WRITE) ? "WRITE" : "READ", err); } return err; } diff --git a/drivers/block/drbd/drbd_bitmap.c b/drivers/block/drbd/drbd_bitmap.c index e8959fe..126bf4a 100644 --- a/drivers/block/drbd/drbd_bitmap.c +++ b/drivers/block/drbd/drbd_bitmap.c @@ -980,7 +980,7 @@ static void bm_page_io_async(struct drbd_bm_aio_ctx *ctx, int page_nr) __must_ho struct drbd_bitmap *b = device->bitmap; struct page *page; unsigned int len; - unsigned int rw = (ctx->flags & BM_AIO_READ) ? READ : WRITE; + unsigned int op = (ctx->flags & BM_AIO_READ) ? REQ_OP_READ : REQ_OP_WRITE; sector_t on_disk_sector = device->ldev->md.md_offset + device->ldev->md.bm_offset; @@ -1011,9 +1011,9 @@ static void bm_page_io_async(struct drbd_bm_aio_ctx *ctx, int page_nr) __must_ho bio_add_page(bio, page, len, 0); bio->bi_private = ctx; bio->bi_end_io = drbd_bm_endio; - bio->bi_rw = rw; + bio->bi_op = op; - if (drbd_insert_fault(device, (rw & WRITE) ? DRBD_FAULT_MD_WR : DRBD_FAULT_MD_RD)) { + if (drbd_insert_fault(device, (op == REQ_OP_WRITE) ? DRBD_FAULT_MD_WR : DRBD_FAULT_MD_RD)) { bio_io_error(bio); } else { submit_bio(bio); diff --git a/drivers/block/drbd/drbd_int.h b/drivers/block/drbd/drbd_int.h index c227fd4..a0ddd75 100644 --- a/drivers/block/drbd/drbd_int.h +++ b/drivers/block/drbd/drbd_int.h @@ -1507,7 +1507,7 @@ extern int drbd_resync_finished(struct drbd_device *device); extern void *drbd_md_get_buffer(struct drbd_device *device, const char *intent); extern void drbd_md_put_buffer(struct drbd_device *device); extern int drbd_md_sync_page_io(struct drbd_device *device, - struct drbd_backing_dev *bdev, sector_t sector, int rw); + struct drbd_backing_dev *bdev, sector_t sector, int op); extern void drbd_ov_out_of_sync_found(struct drbd_device *, sector_t, int); extern void wait_until_done_or_force_detached(struct drbd_device *device, struct drbd_backing_dev *bdev, unsigned int *done); @@ -1557,7 +1557,7 @@ extern bool drbd_rs_should_slow_down(struct drbd_device *device, sector_t sector bool throttle_if_app_is_waiting); extern int drbd_submit_peer_request(struct drbd_device *, struct drbd_peer_request *, const unsigned, - const int); + const unsigned, const int); extern int drbd_free_peer_reqs(struct drbd_device *, struct list_head *); extern struct drbd_peer_request *drbd_alloc_peer_req(struct drbd_peer_device *, u64, sector_t, unsigned int, diff --git a/drivers/block/drbd/drbd_main.c b/drivers/block/drbd/drbd_main.c index fa20977..4ccfd17 100644 --- a/drivers/block/drbd/drbd_main.c +++ b/drivers/block/drbd/drbd_main.c @@ -3061,7 +3061,7 @@ void drbd_md_write(struct drbd_device *device, void *b) D_ASSERT(device, drbd_md_ss(device->ldev) == device->ldev->md.md_offset); sector = device->ldev->md.md_offset; - if (drbd_md_sync_page_io(device, device->ldev, sector, WRITE)) { + if (drbd_md_sync_page_io(device, device->ldev, sector, REQ_OP_WRITE)) { /* this was a try anyways ... */ drbd_err(device, "meta data update failed!\n"); drbd_chk_io_error(device, 1, DRBD_META_IO_ERROR); @@ -3263,7 +3263,8 @@ int drbd_md_read(struct drbd_device *device, struct drbd_backing_dev *bdev) * Affects the paranoia out-of-range access check in drbd_md_sync_page_io(). */ bdev->md.md_size_sect = 8; - if (drbd_md_sync_page_io(device, bdev, bdev->md.md_offset, READ)) { + if (drbd_md_sync_page_io(device, bdev, bdev->md.md_offset, + REQ_OP_READ)) { /* NOTE: can't do normal error processing here as this is called BEFORE disk is attached */ drbd_err(device, "Error while reading metadata.\n"); diff --git a/drivers/block/drbd/drbd_receiver.c b/drivers/block/drbd/drbd_receiver.c index 050aaa1..a0b95da 100644 --- a/drivers/block/drbd/drbd_receiver.c +++ b/drivers/block/drbd/drbd_receiver.c @@ -1398,7 +1398,8 @@ void drbd_bump_write_ordering(struct drbd_resource *resource, struct drbd_backin /* TODO allocate from our own bio_set. */ int drbd_submit_peer_request(struct drbd_device *device, struct drbd_peer_request *peer_req, - const unsigned rw, const int fault_type) + const unsigned op, const unsigned op_flags, + const int fault_type) { struct bio *bios = NULL; struct bio *bio; @@ -1450,7 +1451,8 @@ next_bio: /* > peer_req->i.sector, unless this is the first bio */ bio->bi_iter.bi_sector = sector; bio->bi_bdev = device->ldev->backing_bdev; - bio->bi_rw = rw; + bio->bi_op = op; + bio->bi_rw = op_flags; bio->bi_private = peer_req; bio->bi_end_io = drbd_peer_request_endio; @@ -1458,7 +1460,7 @@ next_bio: bios = bio; ++n_bios; - if (rw & REQ_DISCARD) { + if (op == REQ_OP_DISCARD) { bio->bi_iter.bi_size = data_size; goto submit; } @@ -1830,7 +1832,8 @@ static int recv_resync_read(struct drbd_peer_device *peer_device, sector_t secto spin_unlock_irq(&device->resource->req_lock); atomic_add(pi->size >> 9, &device->rs_sect_ev); - if (drbd_submit_peer_request(device, peer_req, WRITE, DRBD_FAULT_RS_WR) == 0) + if (drbd_submit_peer_request(device, peer_req, REQ_OP_WRITE, 0, + DRBD_FAULT_RS_WR) == 0) return 0; /* don't care for the reason here */ @@ -2152,12 +2155,19 @@ static int wait_for_and_update_peer_seq(struct drbd_peer_device *peer_device, co /* see also bio_flags_to_wire() * DRBD_REQ_*, because we need to semantically map the flags to data packet * flags and back. We may replicate to other kernel versions. */ -static unsigned long wire_flags_to_bio(u32 dpf) +static unsigned long wire_flags_to_bio_flags(u32 dpf) { return (dpf & DP_RW_SYNC ? REQ_SYNC : 0) | (dpf & DP_FUA ? REQ_FUA : 0) | - (dpf & DP_FLUSH ? REQ_FLUSH : 0) | - (dpf & DP_DISCARD ? REQ_DISCARD : 0); + (dpf & DP_FLUSH ? REQ_FLUSH : 0); +} + +static unsigned long wire_flags_to_bio_op(u32 dpf) +{ + if (dpf & DP_DISCARD) + return REQ_OP_DISCARD; + else + return REQ_OP_WRITE; } static void fail_postponed_requests(struct drbd_device *device, sector_t sector, @@ -2303,7 +2313,7 @@ static int receive_Data(struct drbd_connection *connection, struct packet_info * struct drbd_peer_request *peer_req; struct p_data *p = pi->data; u32 peer_seq = be32_to_cpu(p->seq_num); - int rw = WRITE; + int op, op_flags; u32 dp_flags; int err, tp; @@ -2342,14 +2352,15 @@ static int receive_Data(struct drbd_connection *connection, struct packet_info * peer_req->flags |= EE_APPLICATION; dp_flags = be32_to_cpu(p->dp_flags); - rw |= wire_flags_to_bio(dp_flags); + op = wire_flags_to_bio_op(dp_flags); + op_flags = wire_flags_to_bio_flags(dp_flags); if (pi->cmd == P_TRIM) { struct request_queue *q = bdev_get_queue(device->ldev->backing_bdev); peer_req->flags |= EE_IS_TRIM; if (!blk_queue_discard(q)) peer_req->flags |= EE_IS_TRIM_USE_ZEROOUT; D_ASSERT(peer_device, peer_req->i.size > 0); - D_ASSERT(peer_device, rw & REQ_DISCARD); + D_ASSERT(peer_device, op == REQ_OP_DISCARD); D_ASSERT(peer_device, peer_req->pages == NULL); } else if (peer_req->pages == NULL) { D_ASSERT(device, peer_req->i.size == 0); @@ -2433,7 +2444,8 @@ static int receive_Data(struct drbd_connection *connection, struct packet_info * peer_req->flags |= EE_CALL_AL_COMPLETE_IO; } - err = drbd_submit_peer_request(device, peer_req, rw, DRBD_FAULT_DT_WR); + err = drbd_submit_peer_request(device, peer_req, op, op_flags, + DRBD_FAULT_DT_WR); if (!err) return 0; @@ -2723,7 +2735,8 @@ submit_for_resync: submit: update_receiver_timing_details(connection, drbd_submit_peer_request); inc_unacked(device); - if (drbd_submit_peer_request(device, peer_req, READ, fault_type) == 0) + if (drbd_submit_peer_request(device, peer_req, REQ_OP_READ, 0, + fault_type) == 0) return 0; /* don't care for the reason here */ diff --git a/drivers/block/drbd/drbd_worker.c b/drivers/block/drbd/drbd_worker.c index 4d87499..2a04b43 100644 --- a/drivers/block/drbd/drbd_worker.c +++ b/drivers/block/drbd/drbd_worker.c @@ -397,7 +397,8 @@ static int read_for_csum(struct drbd_peer_device *peer_device, sector_t sector, spin_unlock_irq(&device->resource->req_lock); atomic_add(size >> 9, &device->rs_sect_ev); - if (drbd_submit_peer_request(device, peer_req, READ, DRBD_FAULT_RS_RD) == 0) + if (drbd_submit_peer_request(device, peer_req, REQ_OP_READ, 0, + DRBD_FAULT_RS_RD) == 0) return 0; /* If it failed because of ENOMEM, retry should help. If it failed -- 1.8.3.1 From mchristi@redhat.com Wed Feb 24 13:49:34 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=ham version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay2.corp.sgi.com [137.38.102.29]) by oss.sgi.com (Postfix) with ESMTP id E82A37F63 for ; Wed, 24 Feb 2016 13:49:34 -0600 (CST) Received: from cuda.sgi.com (cuda1.sgi.com [192.48.157.11]) by relay2.corp.sgi.com (Postfix) with ESMTP id 74A88304066 for ; Wed, 24 Feb 2016 11:49:28 -0800 (PST) X-ASG-Debug-ID: 1456343364-04bdf07ab613a7f0001-NocioJ Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by cuda.sgi.com with ESMTP id nozFgSheXehKwQlI (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO) for ; Wed, 24 Feb 2016 11:49:25 -0800 (PST) X-Barracuda-Envelope-From: mchristi@redhat.com X-Barracuda-Apparent-Source-IP: 209.132.183.28 X-ASG-Whitelist: Client Received: from int-mx09.intmail.prod.int.phx2.redhat.com (int-mx09.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by mx1.redhat.com (Postfix) with ESMTPS id C806363144; Wed, 24 Feb 2016 19:49:24 +0000 (UTC) Received: from rh2.redhat.com (vpn-54-14.rdu2.redhat.com [10.10.54.14]) by int-mx09.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id u1OJmJES006684; Wed, 24 Feb 2016 14:49:22 -0500 From: mchristi@redhat.com To: linux-f2fs-devel@lists.sourceforge.net, linux-ext4@vger.kernel.org, konrad.wilk@oracle.com, drbd-dev@lists.linbit.com, philipp.reisner@linbit.com, lars.ellenberg@linbit.com, linux-raid@vger.kernel.org, dm-devel@redhat.com, linux-fsdevel@vger.kernel.org, linux-bcache@vger.kernel.org, linux-block@vger.kernel.org, linux-kernel@vger.kernel.org, linux-scsi@vger.kernel.org, linux-mtd@lists.infradead.org, target-devel@vger.kernel.org, linux-btrfs@vger.kernel.org, osd-dev@open-osd.org, xfs@oss.sgi.com, ocfs2-devel@oss.oracle.com Cc: Mike Christie Subject: [PATCH 23/35] md/raid: set bi_op to REQ_OP Date: Wed, 24 Feb 2016 13:48:00 -0600 X-ASG-Orig-Subj: [PATCH 23/35] md/raid: set bi_op to REQ_OP Message-Id: <1456343292-14535-24-git-send-email-mchristi@redhat.com> In-Reply-To: <1456343292-14535-1-git-send-email-mchristi@redhat.com> References: <1456343292-14535-1-git-send-email-mchristi@redhat.com> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.22 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.38]); Wed, 24 Feb 2016 19:49:24 +0000 (UTC) X-Barracuda-Connect: mx1.redhat.com[209.132.183.28] X-Barracuda-Start-Time: 1456343365 X-Barracuda-Encrypted: ECDHE-RSA-AES256-GCM-SHA384 X-Barracuda-URL: https://192.48.157.11:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-BRTS-Status: 1 From: Mike Christie This patch has md/raid set the bio bi_op to a REQ_OP, and rq_flag_bits to bi_rw. This patch is compile tested only. Signed-off-by: Mike Christie --- drivers/md/bitmap.c | 2 +- drivers/md/dm-raid.c | 5 +++-- drivers/md/md.c | 11 +++++++---- drivers/md/md.h | 3 ++- drivers/md/raid1.c | 34 ++++++++++++++++---------------- drivers/md/raid10.c | 50 ++++++++++++++++++++++++++---------------------- drivers/md/raid5-cache.c | 25 +++++++++++++++--------- drivers/md/raid5.c | 48 ++++++++++++++++++++++++++-------------------- 8 files changed, 101 insertions(+), 77 deletions(-) diff --git a/drivers/md/bitmap.c b/drivers/md/bitmap.c index c8e4124..6c241f8 100644 --- a/drivers/md/bitmap.c +++ b/drivers/md/bitmap.c @@ -160,7 +160,7 @@ static int read_sb_page(struct mddev *mddev, loff_t offset, if (sync_page_io(rdev, target, roundup(size, bdev_logical_block_size(rdev->bdev)), - page, READ, true)) { + page, REQ_OP_READ, 0, true)) { page->index = index; return 0; } diff --git a/drivers/md/dm-raid.c b/drivers/md/dm-raid.c index a090121..43a749c 100644 --- a/drivers/md/dm-raid.c +++ b/drivers/md/dm-raid.c @@ -792,7 +792,7 @@ static int read_disk_sb(struct md_rdev *rdev, int size) if (rdev->sb_loaded) return 0; - if (!sync_page_io(rdev, 0, size, rdev->sb_page, READ, 1)) { + if (!sync_page_io(rdev, 0, size, rdev->sb_page, REQ_OP_READ, 0, 1)) { DMERR("Failed to read superblock of device at position %d", rdev->raid_disk); md_error(rdev->mddev, rdev); @@ -1646,7 +1646,8 @@ static void attempt_restore_of_faulty_devices(struct raid_set *rs) for (i = 0; i < rs->md.raid_disks; i++) { r = &rs->dev[i].rdev; if (test_bit(Faulty, &r->flags) && r->sb_page && - sync_page_io(r, 0, r->sb_size, r->sb_page, READ, 1)) { + sync_page_io(r, 0, r->sb_size, r->sb_page, REQ_OP_READ, 0, + 1)) { DMINFO("Faulty %s device #%d has readable super block." " Attempting to revive it.", rs->raid_type->name, i); diff --git a/drivers/md/md.c b/drivers/md/md.c index 6f6102e..8cdd37f 100644 --- a/drivers/md/md.c +++ b/drivers/md/md.c @@ -391,6 +391,7 @@ static void submit_flushes(struct work_struct *ws) bi->bi_end_io = md_end_flush; bi->bi_private = rdev; bi->bi_bdev = rdev->bdev; + bi->bi_op = REQ_OP_WRITE; bi->bi_rw = WRITE_FLUSH; atomic_inc(&mddev->flush_pending); submit_bio(bi); @@ -737,6 +738,7 @@ void md_super_write(struct mddev *mddev, struct md_rdev *rdev, bio_add_page(bio, page, size, 0); bio->bi_private = rdev; bio->bi_end_io = super_written; + bio->bi_op = REQ_OP_WRITE; bio->bi_rw = WRITE_FLUSH_FUA; atomic_inc(&mddev->pending_writes); @@ -750,14 +752,15 @@ void md_super_wait(struct mddev *mddev) } int sync_page_io(struct md_rdev *rdev, sector_t sector, int size, - struct page *page, int rw, bool metadata_op) + struct page *page, int op, int op_flags, bool metadata_op) { struct bio *bio = bio_alloc_mddev(GFP_NOIO, 1, rdev->mddev); int ret; bio->bi_bdev = (metadata_op && rdev->meta_bdev) ? rdev->meta_bdev : rdev->bdev; - bio->bi_rw = rw; + bio->bi_op = op; + bio->bi_rw = op_flags; if (metadata_op) bio->bi_iter.bi_sector = sector + rdev->sb_start; else if (rdev->mddev->reshape_position != MaxSector && @@ -783,7 +786,7 @@ static int read_disk_sb(struct md_rdev *rdev, int size) if (rdev->sb_loaded) return 0; - if (!sync_page_io(rdev, 0, size, rdev->sb_page, READ, true)) + if (!sync_page_io(rdev, 0, size, rdev->sb_page, REQ_OP_READ, 0, true)) goto fail; rdev->sb_loaded = 1; return 0; @@ -1469,7 +1472,7 @@ static int super_1_load(struct md_rdev *rdev, struct md_rdev *refdev, int minor_ return -EINVAL; bb_sector = (long long)offset; if (!sync_page_io(rdev, bb_sector, sectors << 9, - rdev->bb_page, READ, true)) + rdev->bb_page, REQ_OP_READ, 0, true)) return -EIO; bbp = (u64 *)page_address(rdev->bb_page); rdev->badblocks.shift = sb->bblog_shift; diff --git a/drivers/md/md.h b/drivers/md/md.h index b5c4be7..2e0918f 100644 --- a/drivers/md/md.h +++ b/drivers/md/md.h @@ -618,7 +618,8 @@ extern void md_super_write(struct mddev *mddev, struct md_rdev *rdev, sector_t sector, int size, struct page *page); extern void md_super_wait(struct mddev *mddev); extern int sync_page_io(struct md_rdev *rdev, sector_t sector, int size, - struct page *page, int rw, bool metadata_op); + struct page *page, int op, int op_flags, + bool metadata_op); extern void md_do_sync(struct md_thread *thread); extern void md_new_event(struct mddev *mddev); extern int md_allow_write(struct mddev *mddev); diff --git a/drivers/md/raid1.c b/drivers/md/raid1.c index f2d9c01..150df76 100644 --- a/drivers/md/raid1.c +++ b/drivers/md/raid1.c @@ -759,7 +759,7 @@ static void flush_pending_writes(struct r1conf *conf) while (bio) { /* submit pending writes */ struct bio *next = bio->bi_next; bio->bi_next = NULL; - if (unlikely((bio->bi_rw & REQ_DISCARD) && + if (unlikely((bio->bi_op == REQ_OP_DISCARD) && !blk_queue_discard(bdev_get_queue(bio->bi_bdev)))) /* Just ignore it */ bio_endio(bio); @@ -1033,7 +1033,7 @@ static void raid1_unplug(struct blk_plug_cb *cb, bool from_schedule) while (bio) { /* submit pending writes */ struct bio *next = bio->bi_next; bio->bi_next = NULL; - if (unlikely((bio->bi_rw & REQ_DISCARD) && + if (unlikely((bio->bi_op == REQ_OP_DISCARD) && !blk_queue_discard(bdev_get_queue(bio->bi_bdev)))) /* Just ignore it */ bio_endio(bio); @@ -1053,12 +1053,11 @@ static void raid1_make_request(struct mddev *mddev, struct bio * bio) int i, disks; struct bitmap *bitmap; unsigned long flags; + const int op = bio->bi_op; const int rw = bio_data_dir(bio); const unsigned long do_sync = (bio->bi_rw & REQ_SYNC); const unsigned long do_flush_fua = (bio->bi_rw & (REQ_FLUSH | REQ_FUA)); - const unsigned long do_discard = (bio->bi_rw - & (REQ_DISCARD | REQ_SECURE)); - const unsigned long do_same = (bio->bi_rw & REQ_WRITE_SAME); + const unsigned long do_sec = (bio->bi_rw & REQ_SECURE); struct md_rdev *blocked_rdev; struct blk_plug_cb *cb; struct raid1_plug_cb *plug = NULL; @@ -1166,7 +1165,8 @@ read_again: mirror->rdev->data_offset; read_bio->bi_bdev = mirror->rdev->bdev; read_bio->bi_end_io = raid1_end_read_request; - read_bio->bi_rw = READ | do_sync; + read_bio->bi_op = op; + read_bio->bi_rw = do_sync; read_bio->bi_private = r1_bio; if (max_sectors < r1_bio->sectors) { @@ -1376,8 +1376,9 @@ read_again: conf->mirrors[i].rdev->data_offset); mbio->bi_bdev = conf->mirrors[i].rdev->bdev; mbio->bi_end_io = raid1_end_write_request; + mbio->bi_op = op; mbio->bi_rw = - WRITE | do_flush_fua | do_sync | do_discard | do_same; + do_flush_fua | do_sync | do_sec; mbio->bi_private = r1_bio; atomic_inc(&r1_bio->remaining); @@ -1771,7 +1772,7 @@ static void end_sync_write(struct bio *bio) static int r1_sync_page_io(struct md_rdev *rdev, sector_t sector, int sectors, struct page *page, int rw) { - if (sync_page_io(rdev, sector, sectors << 9, page, rw, false)) + if (sync_page_io(rdev, sector, sectors << 9, page, rw, 0, false)) /* success */ return 1; if (rw == WRITE) { @@ -1825,7 +1826,7 @@ static int fix_sync_read_error(struct r1bio *r1_bio) rdev = conf->mirrors[d].rdev; if (sync_page_io(rdev, sect, s<<9, bio->bi_io_vec[idx].bv_page, - READ, false)) { + REQ_OP_READ, 0, false)) { success = 1; break; } @@ -2030,7 +2031,7 @@ static void sync_request_write(struct mddev *mddev, struct r1bio *r1_bio) !test_bit(MD_RECOVERY_SYNC, &mddev->recovery)))) continue; - wbio->bi_rw = WRITE; + wbio->bi_op = REQ_OP_WRITE; wbio->bi_end_io = end_sync_write; atomic_inc(&r1_bio->remaining); md_sync_acct(conf->mirrors[i].rdev->bdev, bio_sectors(wbio)); @@ -2090,7 +2091,7 @@ static void fix_read_error(struct r1conf *conf, int read_disk, is_badblock(rdev, sect, s, &first_bad, &bad_sectors) == 0 && sync_page_io(rdev, sect, s<<9, - conf->tmppage, READ, false)) + conf->tmppage, REQ_OP_READ, 0, false)) success = 1; else { d++; @@ -2201,7 +2202,7 @@ static int narrow_write_error(struct r1bio *r1_bio, int i) wbio = bio_clone_mddev(r1_bio->master_bio, GFP_NOIO, mddev); } - wbio->bi_rw = WRITE; + wbio->bi_op = REQ_OP_WRITE; wbio->bi_iter.bi_sector = r1_bio->sector; wbio->bi_iter.bi_size = r1_bio->sectors << 9; @@ -2343,7 +2344,8 @@ read_more: bio->bi_iter.bi_sector = r1_bio->sector + rdev->data_offset; bio->bi_bdev = rdev->bdev; bio->bi_end_io = raid1_end_read_request; - bio->bi_rw = READ | do_sync; + bio->bi_op = REQ_OP_READ; + bio->bi_rw = do_sync; bio->bi_private = r1_bio; if (max_sectors < r1_bio->sectors) { /* Drat - have to split this up more */ @@ -2569,7 +2571,7 @@ static sector_t raid1_sync_request(struct mddev *mddev, sector_t sector_nr, if (i < conf->raid_disks) still_degraded = 1; } else if (!test_bit(In_sync, &rdev->flags)) { - bio->bi_rw = WRITE; + bio->bi_op = REQ_OP_WRITE; bio->bi_end_io = end_sync_write; write_targets ++; } else { @@ -2596,7 +2598,7 @@ static sector_t raid1_sync_request(struct mddev *mddev, sector_t sector_nr, if (disk < 0) disk = i; } - bio->bi_rw = READ; + bio->bi_op = REQ_OP_READ; bio->bi_end_io = end_sync_read; read_targets++; } else if (!test_bit(WriteErrorSeen, &rdev->flags) && @@ -2608,7 +2610,7 @@ static sector_t raid1_sync_request(struct mddev *mddev, sector_t sector_nr, * if we are doing resync or repair. Otherwise, leave * this device alone for this sync request. */ - bio->bi_rw = WRITE; + bio->bi_op = REQ_OP_WRITE; bio->bi_end_io = end_sync_write; write_targets++; } diff --git a/drivers/md/raid10.c b/drivers/md/raid10.c index d0d84f3..871edf6 100644 --- a/drivers/md/raid10.c +++ b/drivers/md/raid10.c @@ -865,7 +865,7 @@ static void flush_pending_writes(struct r10conf *conf) while (bio) { /* submit pending writes */ struct bio *next = bio->bi_next; bio->bi_next = NULL; - if (unlikely((bio->bi_rw & REQ_DISCARD) && + if (unlikely((bio->bi_op == REQ_OP_DISCARD) && !blk_queue_discard(bdev_get_queue(bio->bi_bdev)))) /* Just ignore it */ bio_endio(bio); @@ -1041,7 +1041,7 @@ static void raid10_unplug(struct blk_plug_cb *cb, bool from_schedule) while (bio) { /* submit pending writes */ struct bio *next = bio->bi_next; bio->bi_next = NULL; - if (unlikely((bio->bi_rw & REQ_DISCARD) && + if (unlikely((bio->bi_op == REQ_OP_DISCARD) && !blk_queue_discard(bdev_get_queue(bio->bi_bdev)))) /* Just ignore it */ bio_endio(bio); @@ -1058,12 +1058,11 @@ static void __make_request(struct mddev *mddev, struct bio *bio) struct r10bio *r10_bio; struct bio *read_bio; int i; + const int op = bio->bi_op; const int rw = bio_data_dir(bio); const unsigned long do_sync = (bio->bi_rw & REQ_SYNC); const unsigned long do_fua = (bio->bi_rw & REQ_FUA); - const unsigned long do_discard = (bio->bi_rw - & (REQ_DISCARD | REQ_SECURE)); - const unsigned long do_same = (bio->bi_rw & REQ_WRITE_SAME); + const unsigned long do_sec = (bio->bi_rw & REQ_SECURE); unsigned long flags; struct md_rdev *blocked_rdev; struct blk_plug_cb *cb; @@ -1156,7 +1155,8 @@ read_again: choose_data_offset(r10_bio, rdev); read_bio->bi_bdev = rdev->bdev; read_bio->bi_end_io = raid10_end_read_request; - read_bio->bi_rw = READ | do_sync; + read_bio->bi_op = op; + read_bio->bi_rw = do_sync; read_bio->bi_private = r10_bio; if (max_sectors < r10_bio->sectors) { @@ -1363,8 +1363,9 @@ retry_write: rdev)); mbio->bi_bdev = rdev->bdev; mbio->bi_end_io = raid10_end_write_request; + mbio->bi_op = op; mbio->bi_rw = - WRITE | do_sync | do_fua | do_discard | do_same; + do_sync | do_fua | do_sec; mbio->bi_private = r10_bio; atomic_inc(&r10_bio->remaining); @@ -1406,8 +1407,9 @@ retry_write: r10_bio, rdev)); mbio->bi_bdev = rdev->bdev; mbio->bi_end_io = raid10_end_write_request; + mbio->bi_op = op; mbio->bi_rw = - WRITE | do_sync | do_fua | do_discard | do_same; + do_sync | do_fua | do_sec; mbio->bi_private = r10_bio; atomic_inc(&r10_bio->remaining); @@ -1992,7 +1994,7 @@ static void sync_request_write(struct mddev *mddev, struct r10bio *r10_bio) tbio->bi_vcnt = vcnt; tbio->bi_iter.bi_size = fbio->bi_iter.bi_size; - tbio->bi_rw = WRITE; + tbio->bi_op = REQ_OP_WRITE; tbio->bi_private = r10_bio; tbio->bi_iter.bi_sector = r10_bio->devs[i].addr; tbio->bi_end_io = end_sync_write; @@ -2078,7 +2080,7 @@ static void fix_recovery_read_error(struct r10bio *r10_bio) addr, s << 9, bio->bi_io_vec[idx].bv_page, - READ, false); + REQ_OP_READ, 0, false); if (ok) { rdev = conf->mirrors[dw].rdev; addr = r10_bio->devs[1].addr + sect; @@ -2086,7 +2088,7 @@ static void fix_recovery_read_error(struct r10bio *r10_bio) addr, s << 9, bio->bi_io_vec[idx].bv_page, - WRITE, false); + REQ_OP_WRITE, 0, false); if (!ok) { set_bit(WriteErrorSeen, &rdev->flags); if (!test_and_set_bit(WantReplacement, @@ -2213,7 +2215,7 @@ static int r10_sync_page_io(struct md_rdev *rdev, sector_t sector, if (is_badblock(rdev, sector, sectors, &first_bad, &bad_sectors) && (rw == READ || test_bit(WriteErrorSeen, &rdev->flags))) return -1; - if (sync_page_io(rdev, sector, sectors << 9, page, rw, false)) + if (sync_page_io(rdev, sector, sectors << 9, page, rw, 0, false)) /* success */ return 1; if (rw == WRITE) { @@ -2299,7 +2301,8 @@ static void fix_read_error(struct r10conf *conf, struct mddev *mddev, struct r10 r10_bio->devs[sl].addr + sect, s<<9, - conf->tmppage, READ, false); + conf->tmppage, + REQ_OP_READ, 0, false); rdev_dec_pending(rdev, mddev); rcu_read_lock(); if (success) @@ -2474,7 +2477,7 @@ static int narrow_write_error(struct r10bio *r10_bio, int i) choose_data_offset(r10_bio, rdev) + (sector - r10_bio->sector)); wbio->bi_bdev = rdev->bdev; - wbio->bi_rw = WRITE; + wbio->bi_op = REQ_OP_WRITE; if (submit_bio_wait(wbio) < 0) /* Failure! */ @@ -2550,7 +2553,8 @@ read_more: bio->bi_iter.bi_sector = r10_bio->devs[slot].addr + choose_data_offset(r10_bio, rdev); bio->bi_bdev = rdev->bdev; - bio->bi_rw = READ | do_sync; + bio->bi_op = REQ_OP_READ; + bio->bi_rw = do_sync; bio->bi_private = r10_bio; bio->bi_end_io = raid10_end_read_request; if (max_sectors < r10_bio->sectors) { @@ -3037,7 +3041,7 @@ static sector_t raid10_sync_request(struct mddev *mddev, sector_t sector_nr, biolist = bio; bio->bi_private = r10_bio; bio->bi_end_io = end_sync_read; - bio->bi_rw = READ; + bio->bi_op = REQ_OP_READ; from_addr = r10_bio->devs[j].addr; bio->bi_iter.bi_sector = from_addr + rdev->data_offset; @@ -3063,7 +3067,7 @@ static sector_t raid10_sync_request(struct mddev *mddev, sector_t sector_nr, biolist = bio; bio->bi_private = r10_bio; bio->bi_end_io = end_sync_write; - bio->bi_rw = WRITE; + bio->bi_op = REQ_OP_WRITE; bio->bi_iter.bi_sector = to_addr + rdev->data_offset; bio->bi_bdev = rdev->bdev; @@ -3092,7 +3096,7 @@ static sector_t raid10_sync_request(struct mddev *mddev, sector_t sector_nr, biolist = bio; bio->bi_private = r10_bio; bio->bi_end_io = end_sync_write; - bio->bi_rw = WRITE; + bio->bi_op = REQ_OP_WRITE; bio->bi_iter.bi_sector = to_addr + rdev->data_offset; bio->bi_bdev = rdev->bdev; @@ -3212,7 +3216,7 @@ static sector_t raid10_sync_request(struct mddev *mddev, sector_t sector_nr, biolist = bio; bio->bi_private = r10_bio; bio->bi_end_io = end_sync_read; - bio->bi_rw = READ; + bio->bi_op = REQ_OP_READ; bio->bi_iter.bi_sector = sector + conf->mirrors[d].rdev->data_offset; bio->bi_bdev = conf->mirrors[d].rdev->bdev; @@ -3234,7 +3238,7 @@ static sector_t raid10_sync_request(struct mddev *mddev, sector_t sector_nr, biolist = bio; bio->bi_private = r10_bio; bio->bi_end_io = end_sync_write; - bio->bi_rw = WRITE; + bio->bi_op = REQ_OP_WRITE; bio->bi_iter.bi_sector = sector + conf->mirrors[d].replacement->data_offset; bio->bi_bdev = conf->mirrors[d].replacement->bdev; @@ -4317,7 +4321,7 @@ read_more: + rdev->data_offset); read_bio->bi_private = r10_bio; read_bio->bi_end_io = end_sync_read; - read_bio->bi_rw = READ; + read_bio->bi_op = REQ_OP_READ; read_bio->bi_flags &= (~0UL << BIO_RESET_BITS); read_bio->bi_error = 0; read_bio->bi_vcnt = 0; @@ -4351,7 +4355,7 @@ read_more: rdev2->new_data_offset; b->bi_private = r10_bio; b->bi_end_io = end_reshape_write; - b->bi_rw = WRITE; + b->bi_op = REQ_OP_WRITE; b->bi_next = blist; blist = b; } @@ -4519,7 +4523,7 @@ static int handle_reshape_read_error(struct mddev *mddev, addr, s << 9, bvec[idx].bv_page, - READ, false); + REQ_OP_READ, 0, false); if (success) break; failed: diff --git a/drivers/md/raid5-cache.c b/drivers/md/raid5-cache.c index 2d56fdc..da07670 100644 --- a/drivers/md/raid5-cache.c +++ b/drivers/md/raid5-cache.c @@ -261,7 +261,7 @@ static struct bio *r5l_bio_alloc(struct r5l_log *log) { struct bio *bio = bio_alloc_bioset(GFP_NOIO, BIO_MAX_PAGES, log->bs); - bio->bi_rw = WRITE; + bio->bi_op = REQ_OP_WRITE; bio->bi_bdev = log->rdev->bdev; bio->bi_iter.bi_sector = log->rdev->data_offset + log->log_start; @@ -686,6 +686,7 @@ void r5l_flush_stripe_to_raid(struct r5l_log *log) bio_reset(&log->flush_bio); log->flush_bio.bi_bdev = log->rdev->bdev; log->flush_bio.bi_end_io = r5l_log_flush_endio; + log->flush_bio.bi_op = REQ_OP_WRITE; log->flush_bio.bi_rw = WRITE_FLUSH; submit_bio(&log->flush_bio); } @@ -882,7 +883,8 @@ static int r5l_read_meta_block(struct r5l_log *log, struct r5l_meta_block *mb; u32 crc, stored_crc; - if (!sync_page_io(log->rdev, ctx->pos, PAGE_SIZE, page, READ, false)) + if (!sync_page_io(log->rdev, ctx->pos, PAGE_SIZE, page, REQ_OP_READ, 0, + false)) return -EIO; mb = page_address(page); @@ -927,7 +929,8 @@ static int r5l_recovery_flush_one_stripe(struct r5l_log *log, &disk_index, sh); sync_page_io(log->rdev, *log_offset, PAGE_SIZE, - sh->dev[disk_index].page, READ, false); + sh->dev[disk_index].page, REQ_OP_READ, 0, + false); sh->dev[disk_index].log_checksum = le32_to_cpu(payload->checksum[0]); set_bit(R5_Wantwrite, &sh->dev[disk_index].flags); @@ -935,7 +938,8 @@ static int r5l_recovery_flush_one_stripe(struct r5l_log *log, } else { disk_index = sh->pd_idx; sync_page_io(log->rdev, *log_offset, PAGE_SIZE, - sh->dev[disk_index].page, READ, false); + sh->dev[disk_index].page, REQ_OP_READ, 0, + false); sh->dev[disk_index].log_checksum = le32_to_cpu(payload->checksum[0]); set_bit(R5_Wantwrite, &sh->dev[disk_index].flags); @@ -945,7 +949,7 @@ static int r5l_recovery_flush_one_stripe(struct r5l_log *log, sync_page_io(log->rdev, r5l_ring_add(log, *log_offset, BLOCK_SECTORS), PAGE_SIZE, sh->dev[disk_index].page, - READ, false); + REQ_OP_READ, 0, false); sh->dev[disk_index].log_checksum = le32_to_cpu(payload->checksum[1]); set_bit(R5_Wantwrite, @@ -987,11 +991,13 @@ static int r5l_recovery_flush_one_stripe(struct r5l_log *log, rdev = rcu_dereference(conf->disks[disk_index].rdev); if (rdev) sync_page_io(rdev, stripe_sect, PAGE_SIZE, - sh->dev[disk_index].page, WRITE, false); + sh->dev[disk_index].page, REQ_OP_WRITE, 0, + false); rrdev = rcu_dereference(conf->disks[disk_index].replacement); if (rrdev) sync_page_io(rrdev, stripe_sect, PAGE_SIZE, - sh->dev[disk_index].page, WRITE, false); + sh->dev[disk_index].page, REQ_OP_WRITE, 0, + false); } raid5_release_stripe(sh); return 0; @@ -1063,7 +1069,8 @@ static int r5l_log_write_empty_meta_block(struct r5l_log *log, sector_t pos, crc = crc32c_le(log->uuid_checksum, mb, PAGE_SIZE); mb->checksum = cpu_to_le32(crc); - if (!sync_page_io(log->rdev, pos, PAGE_SIZE, page, WRITE_FUA, false)) { + if (!sync_page_io(log->rdev, pos, PAGE_SIZE, page, REQ_OP_WRITE, + WRITE_FUA, false)) { __free_page(page); return -EIO; } @@ -1138,7 +1145,7 @@ static int r5l_load_log(struct r5l_log *log) if (!page) return -ENOMEM; - if (!sync_page_io(rdev, cp, PAGE_SIZE, page, READ, false)) { + if (!sync_page_io(rdev, cp, PAGE_SIZE, page, REQ_OP_READ, 0, false)) { ret = -EIO; goto ioerr; } diff --git a/drivers/md/raid5.c b/drivers/md/raid5.c index 7f770b0..0c53ca2 100644 --- a/drivers/md/raid5.c +++ b/drivers/md/raid5.c @@ -815,7 +815,8 @@ static void stripe_add_to_batch_list(struct r5conf *conf, struct stripe_head *sh dd_idx = 0; while (dd_idx == sh->pd_idx || dd_idx == sh->qd_idx) dd_idx++; - if (head->dev[dd_idx].towrite->bi_rw != sh->dev[dd_idx].towrite->bi_rw) + if (head->dev[dd_idx].towrite->bi_rw != sh->dev[dd_idx].towrite->bi_rw || + head->dev[dd_idx].towrite->bi_op != sh->dev[dd_idx].towrite->bi_op) goto unlock_out; if (head->batch_head) { @@ -900,29 +901,32 @@ static void ops_run_io(struct stripe_head *sh, struct stripe_head_state *s) if (r5l_write_stripe(conf->log, sh) == 0) return; for (i = disks; i--; ) { - int rw; + int op; + int op_flags = 0; int replace_only = 0; struct bio *bi, *rbi; struct md_rdev *rdev, *rrdev = NULL; sh = head_sh; if (test_and_clear_bit(R5_Wantwrite, &sh->dev[i].flags)) { - if (test_and_clear_bit(R5_WantFUA, &sh->dev[i].flags)) - rw = WRITE_FUA; - else - rw = WRITE; + if (test_and_clear_bit(R5_WantFUA, &sh->dev[i].flags)) { + op = REQ_OP_WRITE; + op_flags = WRITE_FUA; + } else { + op = REQ_OP_WRITE; + } if (test_bit(R5_Discard, &sh->dev[i].flags)) - rw |= REQ_DISCARD; + op = REQ_OP_DISCARD; } else if (test_and_clear_bit(R5_Wantread, &sh->dev[i].flags)) - rw = READ; + op = REQ_OP_READ; else if (test_and_clear_bit(R5_WantReplace, &sh->dev[i].flags)) { - rw = WRITE; + op = REQ_OP_WRITE; replace_only = 1; } else continue; if (test_and_clear_bit(R5_SyncIO, &sh->dev[i].flags)) - rw |= REQ_SYNC; + op_flags |= REQ_SYNC; again: bi = &sh->dev[i].req; @@ -936,7 +940,7 @@ again: rdev = rrdev; rrdev = NULL; } - if (rw & WRITE) { + if (op_is_write(op)) { if (replace_only) rdev = NULL; if (rdev == rrdev) @@ -962,7 +966,7 @@ again: * need to check for writes. We never accept write errors * on the replacement, so we don't to check rrdev. */ - while ((rw & WRITE) && rdev && + while (op_is_write(op) && rdev && test_bit(WriteErrorSeen, &rdev->flags)) { sector_t first_bad; int bad_sectors; @@ -1004,8 +1008,9 @@ again: bio_reset(bi); bi->bi_bdev = rdev->bdev; - bi->bi_rw = rw; - bi->bi_end_io = (rw & WRITE) + bi->bi_op = op; + bi->bi_rw = op_flags; + bi->bi_end_io = op_is_write(op) ? raid5_end_write_request : raid5_end_read_request; bi->bi_private = sh; @@ -1036,7 +1041,7 @@ again: * If this is discard request, set bi_vcnt 0. We don't * want to confuse SCSI because SCSI will replace payload */ - if (rw & REQ_DISCARD) + if (op == REQ_OP_DISCARD) bi->bi_vcnt = 0; if (rrdev) set_bit(R5_DOUBLE_LOCKED, &sh->dev[i].flags); @@ -1056,8 +1061,9 @@ again: bio_reset(rbi); rbi->bi_bdev = rrdev->bdev; - rbi->bi_rw = rw; - BUG_ON(!(rw & WRITE)); + rbi->bi_op = op; + rbi->bi_rw = op_flags; + BUG_ON(!op_is_write(op)); rbi->bi_end_io = raid5_end_write_request; rbi->bi_private = sh; @@ -1085,7 +1091,7 @@ again: * If this is discard request, set bi_vcnt 0. We don't * want to confuse SCSI because SCSI will replace payload */ - if (rw & REQ_DISCARD) + if (op == REQ_OP_DISCARD) rbi->bi_vcnt = 0; if (conf->mddev->gendisk) trace_block_bio_remap(bdev_get_queue(rbi->bi_bdev), @@ -1094,7 +1100,7 @@ again: generic_make_request(rbi); } if (!rdev && !rrdev) { - if (rw & WRITE) + if (op_is_write(op)) set_bit(STRIPE_DEGRADED, &sh->state); pr_debug("skip op %ld on disc %d for sector %llu\n", bi->bi_rw, i, (unsigned long long)sh->sector); @@ -1632,7 +1638,7 @@ again: set_bit(R5_WantFUA, &dev->flags); if (wbi->bi_rw & REQ_SYNC) set_bit(R5_SyncIO, &dev->flags); - if (wbi->bi_rw & REQ_DISCARD) + if (wbi->bi_op == REQ_OP_DISCARD) set_bit(R5_Discard, &dev->flags); else { tx = async_copy_data(1, wbi, &dev->page, @@ -5173,7 +5179,7 @@ static void raid5_make_request(struct mddev *mddev, struct bio * bi) return; } - if (unlikely(bi->bi_rw & REQ_DISCARD)) { + if (unlikely(bi->bi_op == REQ_OP_DISCARD)) { make_discard_request(mddev, bi); return; } -- 1.8.3.1 From mchristi@redhat.com Wed Feb 24 13:49:36 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=ham version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay1.corp.sgi.com [137.38.102.111]) by oss.sgi.com (Postfix) with ESMTP id 4676B7F6C for ; Wed, 24 Feb 2016 13:49:36 -0600 (CST) Received: from cuda.sgi.com (cuda1.sgi.com [192.48.157.11]) by relay1.corp.sgi.com (Postfix) with ESMTP id F14B18F8033 for ; Wed, 24 Feb 2016 11:49:29 -0800 (PST) X-ASG-Debug-ID: 1456343367-04bdf07ab313a7f0001-NocioJ Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by cuda.sgi.com with ESMTP id aU6Opo2Zj3FJ2v3w (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO) for ; Wed, 24 Feb 2016 11:49:28 -0800 (PST) X-Barracuda-Envelope-From: mchristi@redhat.com X-Barracuda-Apparent-Source-IP: 209.132.183.28 X-ASG-Whitelist: Client Received: from int-mx09.intmail.prod.int.phx2.redhat.com (int-mx09.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by mx1.redhat.com (Postfix) with ESMTPS id ABD418C541; Wed, 24 Feb 2016 19:49:27 +0000 (UTC) Received: from rh2.redhat.com (vpn-54-14.rdu2.redhat.com [10.10.54.14]) by int-mx09.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id u1OJmJET006684; Wed, 24 Feb 2016 14:49:24 -0500 From: mchristi@redhat.com To: linux-f2fs-devel@lists.sourceforge.net, linux-ext4@vger.kernel.org, konrad.wilk@oracle.com, drbd-dev@lists.linbit.com, philipp.reisner@linbit.com, lars.ellenberg@linbit.com, linux-raid@vger.kernel.org, dm-devel@redhat.com, linux-fsdevel@vger.kernel.org, linux-bcache@vger.kernel.org, linux-block@vger.kernel.org, linux-kernel@vger.kernel.org, linux-scsi@vger.kernel.org, linux-mtd@lists.infradead.org, target-devel@vger.kernel.org, linux-btrfs@vger.kernel.org, osd-dev@open-osd.org, xfs@oss.sgi.com, ocfs2-devel@oss.oracle.com Cc: Mike Christie Subject: [PATCH 24/35] xen: set bi_op to REQ_OP Date: Wed, 24 Feb 2016 13:48:01 -0600 X-ASG-Orig-Subj: [PATCH 24/35] xen: set bi_op to REQ_OP Message-Id: <1456343292-14535-25-git-send-email-mchristi@redhat.com> In-Reply-To: <1456343292-14535-1-git-send-email-mchristi@redhat.com> References: <1456343292-14535-1-git-send-email-mchristi@redhat.com> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.22 X-Barracuda-Connect: mx1.redhat.com[209.132.183.28] X-Barracuda-Start-Time: 1456343368 X-Barracuda-Encrypted: ECDHE-RSA-AES256-GCM-SHA384 X-Barracuda-URL: https://192.48.157.11:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-BRTS-Status: 1 From: Mike Christie This patch has xen set the bio bi_op to a REQ_OP, and rq_flag_bits to bi_rw. This patch is compile tested only. Signed-off-by: Mike Christie --- drivers/block/xen-blkback/blkback.c | 29 +++++++++++++++++------------ 1 file changed, 17 insertions(+), 12 deletions(-) diff --git a/drivers/block/xen-blkback/blkback.c b/drivers/block/xen-blkback/blkback.c index 79fe493..854ecca 100644 --- a/drivers/block/xen-blkback/blkback.c +++ b/drivers/block/xen-blkback/blkback.c @@ -501,7 +501,7 @@ static int xen_vbd_translate(struct phys_req *req, struct xen_blkif *blkif, struct xen_vbd *vbd = &blkif->vbd; int rc = -EACCES; - if ((operation != READ) && vbd->readonly) + if ((operation != REQ_OP_READ) && vbd->readonly) goto out; if (likely(req->nr_sects)) { @@ -1014,7 +1014,7 @@ static int dispatch_discard_io(struct xen_blkif_ring *ring, preq.sector_number = req->u.discard.sector_number; preq.nr_sects = req->u.discard.nr_sectors; - err = xen_vbd_translate(&preq, blkif, WRITE); + err = xen_vbd_translate(&preq, blkif, REQ_OP_WRITE); if (err) { pr_warn("access denied: DISCARD [%llu->%llu] on dev=%04x\n", preq.sector_number, @@ -1229,6 +1229,7 @@ static int dispatch_rw_block_io(struct xen_blkif_ring *ring, struct bio **biolist = pending_req->biolist; int i, nbio = 0; int operation; + int operation_flags = 0; struct blk_plug plug; bool drain = false; struct grant_page **pages = pending_req->segments; @@ -1247,17 +1248,19 @@ static int dispatch_rw_block_io(struct xen_blkif_ring *ring, switch (req_operation) { case BLKIF_OP_READ: ring->st_rd_req++; - operation = READ; + operation = REQ_OP_READ; break; case BLKIF_OP_WRITE: ring->st_wr_req++; - operation = WRITE_ODIRECT; + operation = REQ_OP_WRITE; + operation_flags = WRITE_ODIRECT; break; case BLKIF_OP_WRITE_BARRIER: drain = true; case BLKIF_OP_FLUSH_DISKCACHE: ring->st_f_req++; - operation = WRITE_FLUSH; + operation = REQ_OP_WRITE; + operation_flags = WRITE_FLUSH; break; default: operation = 0; /* make gcc happy */ @@ -1269,7 +1272,7 @@ static int dispatch_rw_block_io(struct xen_blkif_ring *ring, nseg = req->operation == BLKIF_OP_INDIRECT ? req->u.indirect.nr_segments : req->u.rw.nr_segments; - if (unlikely(nseg == 0 && operation != WRITE_FLUSH) || + if (unlikely(nseg == 0 && operation_flags != WRITE_FLUSH) || unlikely((req->operation != BLKIF_OP_INDIRECT) && (nseg > BLKIF_MAX_SEGMENTS_PER_REQUEST)) || unlikely((req->operation == BLKIF_OP_INDIRECT) && @@ -1310,7 +1313,7 @@ static int dispatch_rw_block_io(struct xen_blkif_ring *ring, if (xen_vbd_translate(&preq, ring->blkif, operation) != 0) { pr_debug("access denied: %s of [%llu,%llu] on dev=%04x\n", - operation == READ ? "read" : "write", + operation == REQ_OP_READ ? "read" : "write", preq.sector_number, preq.sector_number + preq.nr_sects, ring->blkif->vbd.pdevice); @@ -1369,7 +1372,8 @@ static int dispatch_rw_block_io(struct xen_blkif_ring *ring, bio->bi_private = pending_req; bio->bi_end_io = end_block_io_op; bio->bi_iter.bi_sector = preq.sector_number; - bio->bi_rw = operation; + bio->bi_op = operation; + bio->bi_rw = operation_flags; } preq.sector_number += seg[i].nsec; @@ -1377,7 +1381,7 @@ static int dispatch_rw_block_io(struct xen_blkif_ring *ring, /* This will be hit if the operation was a flush or discard. */ if (!bio) { - BUG_ON(operation != WRITE_FLUSH); + BUG_ON(operation_flags != WRITE_FLUSH); bio = bio_alloc(GFP_KERNEL, 0); if (unlikely(bio == NULL)) @@ -1387,7 +1391,8 @@ static int dispatch_rw_block_io(struct xen_blkif_ring *ring, bio->bi_bdev = preq.bdev; bio->bi_private = pending_req; bio->bi_end_io = end_block_io_op; - bio->bi_rw = operation; + bio->bi_op = operation; + bio->bi_rw = operation_flags; } atomic_set(&pending_req->pendcnt, nbio); @@ -1399,9 +1404,9 @@ static int dispatch_rw_block_io(struct xen_blkif_ring *ring, /* Let the I/Os go.. */ blk_finish_plug(&plug); - if (operation == READ) + if (operation == REQ_OP_READ) ring->st_rd_sect += preq.nr_sects; - else if (operation & WRITE) + else if (operation == REQ_OP_WRITE) ring->st_wr_sect += preq.nr_sects; return 0; -- 1.8.3.1 From mchristi@redhat.com Wed Feb 24 13:49:42 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=ham version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay3.corp.sgi.com [198.149.34.15]) by oss.sgi.com (Postfix) with ESMTP id 00C677F5F for ; Wed, 24 Feb 2016 13:49:42 -0600 (CST) Received: from cuda.sgi.com (cuda3.sgi.com [192.48.176.15]) by relay3.corp.sgi.com (Postfix) with ESMTP id 796FFAC002 for ; Wed, 24 Feb 2016 11:49:33 -0800 (PST) X-ASG-Debug-ID: 1456343370-04cb6c455bd5a50001-NocioJ Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by cuda.sgi.com with ESMTP id SXwtD3oaF4zCJa1e (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO) for ; Wed, 24 Feb 2016 11:49:31 -0800 (PST) X-Barracuda-Envelope-From: mchristi@redhat.com X-Barracuda-Apparent-Source-IP: 209.132.183.28 X-ASG-Whitelist: Client Received: from int-mx09.intmail.prod.int.phx2.redhat.com (int-mx09.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by mx1.redhat.com (Postfix) with ESMTPS id A2B5664376; Wed, 24 Feb 2016 19:49:30 +0000 (UTC) Received: from rh2.redhat.com (vpn-54-14.rdu2.redhat.com [10.10.54.14]) by int-mx09.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id u1OJmJEU006684; Wed, 24 Feb 2016 14:49:27 -0500 From: mchristi@redhat.com To: linux-f2fs-devel@lists.sourceforge.net, linux-ext4@vger.kernel.org, konrad.wilk@oracle.com, drbd-dev@lists.linbit.com, philipp.reisner@linbit.com, lars.ellenberg@linbit.com, linux-raid@vger.kernel.org, dm-devel@redhat.com, linux-fsdevel@vger.kernel.org, linux-bcache@vger.kernel.org, linux-block@vger.kernel.org, linux-kernel@vger.kernel.org, linux-scsi@vger.kernel.org, linux-mtd@lists.infradead.org, target-devel@vger.kernel.org, linux-btrfs@vger.kernel.org, osd-dev@open-osd.org, xfs@oss.sgi.com, ocfs2-devel@oss.oracle.com Cc: Mike Christie Subject: [PATCH 25/35] target: set bi_op to REQ_OP Date: Wed, 24 Feb 2016 13:48:02 -0600 X-ASG-Orig-Subj: [PATCH 25/35] target: set bi_op to REQ_OP Message-Id: <1456343292-14535-26-git-send-email-mchristi@redhat.com> In-Reply-To: <1456343292-14535-1-git-send-email-mchristi@redhat.com> References: <1456343292-14535-1-git-send-email-mchristi@redhat.com> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.22 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.39]); Wed, 24 Feb 2016 19:49:30 +0000 (UTC) X-Barracuda-Connect: mx1.redhat.com[209.132.183.28] X-Barracuda-Start-Time: 1456343371 X-Barracuda-Encrypted: ECDHE-RSA-AES256-GCM-SHA384 X-Barracuda-URL: https://192.48.176.15:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-BRTS-Status: 1 From: Mike Christie This patch has the target modules set the bio bi_op to a REQ_OP, and rq_flag_bits to bi_rw. This patch is compile tested only. Signed-off-by: Mike Christie Acked-by: Nicholas Bellinger --- drivers/target/target_core_iblock.c | 38 ++++++++++++++++++++++--------------- drivers/target/target_core_pscsi.c | 2 +- 2 files changed, 24 insertions(+), 16 deletions(-) diff --git a/drivers/target/target_core_iblock.c b/drivers/target/target_core_iblock.c index c352a64..8d3d197 100644 --- a/drivers/target/target_core_iblock.c +++ b/drivers/target/target_core_iblock.c @@ -312,7 +312,8 @@ static void iblock_bio_done(struct bio *bio) } static struct bio * -iblock_get_bio(struct se_cmd *cmd, sector_t lba, u32 sg_num, int rw) +iblock_get_bio(struct se_cmd *cmd, sector_t lba, u32 sg_num, int op, + int op_flags) { struct iblock_dev *ib_dev = IBLOCK_DEV(cmd->se_dev); struct bio *bio; @@ -334,7 +335,8 @@ iblock_get_bio(struct se_cmd *cmd, sector_t lba, u32 sg_num, int rw) bio->bi_private = cmd; bio->bi_end_io = &iblock_bio_done; bio->bi_iter.bi_sector = lba; - bio->bi_rw = rw; + bio->bi_op = op; + bio->bi_rw = op_flags; return bio; } @@ -446,7 +448,7 @@ iblock_execute_write_same(struct se_cmd *cmd) goto fail; cmd->priv = ibr; - bio = iblock_get_bio(cmd, block_lba, 1, WRITE); + bio = iblock_get_bio(cmd, block_lba, 1, REQ_OP_WRITE, 0); if (!bio) goto fail_free_ibr; @@ -459,7 +461,8 @@ iblock_execute_write_same(struct se_cmd *cmd) while (bio_add_page(bio, sg_page(sg), sg->length, sg->offset) != sg->length) { - bio = iblock_get_bio(cmd, block_lba, 1, WRITE); + bio = iblock_get_bio(cmd, block_lba, 1, REQ_OP_WRITE, + 0); if (!bio) goto fail_put_bios; @@ -645,7 +648,8 @@ iblock_execute_rw(struct se_cmd *cmd, struct scatterlist *sgl, u32 sgl_nents, struct scatterlist *sg; u32 sg_num = sgl_nents; unsigned bio_cnt; - int rw = 0; + int op_flags = 0; + int op = 0; int i; if (data_direction == DMA_TO_DEVICE) { @@ -656,17 +660,20 @@ iblock_execute_rw(struct se_cmd *cmd, struct scatterlist *sgl, u32 sgl_nents, * is not enabled, or if initiator set the Force Unit Access bit. */ if (q->flush_flags & REQ_FUA) { - if (cmd->se_cmd_flags & SCF_FUA) - rw = WRITE_FUA; - else if (!(q->flush_flags & REQ_FLUSH)) - rw = WRITE_FUA; - else - rw = WRITE; + if (cmd->se_cmd_flags & SCF_FUA) { + op = REQ_OP_WRITE; + op_flags = WRITE_FUA; + } else if (!(q->flush_flags & REQ_FLUSH)) { + op = REQ_OP_WRITE; + op_flags = WRITE_FUA; + } else { + op = REQ_OP_WRITE; + } } else { - rw = WRITE; + op = REQ_OP_WRITE; } } else { - rw = READ; + op = REQ_OP_READ; } ibr = kzalloc(sizeof(struct iblock_req), GFP_KERNEL); @@ -680,7 +687,7 @@ iblock_execute_rw(struct se_cmd *cmd, struct scatterlist *sgl, u32 sgl_nents, return 0; } - bio = iblock_get_bio(cmd, block_lba, sgl_nents, rw); + bio = iblock_get_bio(cmd, block_lba, sgl_nents, op, op_flags); if (!bio) goto fail_free_ibr; @@ -704,7 +711,8 @@ iblock_execute_rw(struct se_cmd *cmd, struct scatterlist *sgl, u32 sgl_nents, bio_cnt = 0; } - bio = iblock_get_bio(cmd, block_lba, sg_num, rw); + bio = iblock_get_bio(cmd, block_lba, sg_num, op, + op_flags); if (!bio) goto fail_put_bios; diff --git a/drivers/target/target_core_pscsi.c b/drivers/target/target_core_pscsi.c index de18790..2cf915c 100644 --- a/drivers/target/target_core_pscsi.c +++ b/drivers/target/target_core_pscsi.c @@ -922,7 +922,7 @@ pscsi_map_sg(struct se_cmd *cmd, struct scatterlist *sgl, u32 sgl_nents, goto fail; if (rw) - bio->bi_rw |= REQ_WRITE; + bio->bi_op = REQ_OP_WRITE; pr_debug("PSCSI: Allocated bio: %p," " dir: %s nr_vecs: %d\n", bio, -- 1.8.3.1 From mchristi@redhat.com Wed Feb 24 13:49:44 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=ham version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay1.corp.sgi.com [137.38.102.111]) by oss.sgi.com (Postfix) with ESMTP id BBA6E7F63 for ; Wed, 24 Feb 2016 13:49:44 -0600 (CST) Received: from cuda.sgi.com (cuda3.sgi.com [192.48.176.15]) by relay1.corp.sgi.com (Postfix) with ESMTP id 8CDDE8F8035 for ; Wed, 24 Feb 2016 11:49:38 -0800 (PST) X-ASG-Debug-ID: 1456343376-04cb6c455ad5a60001-NocioJ Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by cuda.sgi.com with ESMTP id 5A8BRwzwRSiG4hw5 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO) for ; Wed, 24 Feb 2016 11:49:36 -0800 (PST) X-Barracuda-Envelope-From: mchristi@redhat.com X-Barracuda-Apparent-Source-IP: 209.132.183.28 X-ASG-Whitelist: Client Received: from int-mx09.intmail.prod.int.phx2.redhat.com (int-mx09.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by mx1.redhat.com (Postfix) with ESMTPS id E6EAD2DC345; Wed, 24 Feb 2016 19:49:35 +0000 (UTC) Received: from rh2.redhat.com (vpn-54-14.rdu2.redhat.com [10.10.54.14]) by int-mx09.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id u1OJmJEW006684; Wed, 24 Feb 2016 14:49:33 -0500 From: mchristi@redhat.com To: linux-f2fs-devel@lists.sourceforge.net, linux-ext4@vger.kernel.org, konrad.wilk@oracle.com, drbd-dev@lists.linbit.com, philipp.reisner@linbit.com, lars.ellenberg@linbit.com, linux-raid@vger.kernel.org, dm-devel@redhat.com, linux-fsdevel@vger.kernel.org, linux-bcache@vger.kernel.org, linux-block@vger.kernel.org, linux-kernel@vger.kernel.org, linux-scsi@vger.kernel.org, linux-mtd@lists.infradead.org, target-devel@vger.kernel.org, linux-btrfs@vger.kernel.org, osd-dev@open-osd.org, xfs@oss.sgi.com, ocfs2-devel@oss.oracle.com Cc: Mike Christie Subject: [PATCH 27/35] drivers: set request op to REQ_OP Date: Wed, 24 Feb 2016 13:48:04 -0600 X-ASG-Orig-Subj: [PATCH 27/35] drivers: set request op to REQ_OP Message-Id: <1456343292-14535-28-git-send-email-mchristi@redhat.com> In-Reply-To: <1456343292-14535-1-git-send-email-mchristi@redhat.com> References: <1456343292-14535-1-git-send-email-mchristi@redhat.com> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.22 X-Barracuda-Connect: mx1.redhat.com[209.132.183.28] X-Barracuda-Start-Time: 1456343376 X-Barracuda-Encrypted: ECDHE-RSA-AES256-GCM-SHA384 X-Barracuda-URL: https://192.48.176.15:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-BRTS-Status: 1 From: Mike Christie This patch has the block drivers use the request->op for REQ_OP operations and cmd_flags for rq_flag_bits. I have only tested scsi and rbd. Signed-off-by: Mike Christie --- drivers/block/loop.c | 6 +++--- drivers/block/mtip32xx/mtip32xx.c | 2 +- drivers/block/nbd.c | 2 +- drivers/block/rbd.c | 2 +- drivers/block/skd_main.c | 11 ++++------- drivers/block/xen-blkfront.c | 8 +++++--- drivers/md/dm.c | 2 +- drivers/mmc/card/block.c | 7 +++---- drivers/mmc/card/queue.c | 6 ++---- drivers/mmc/card/queue.h | 5 ++++- drivers/mtd/mtd_blkdevs.c | 2 +- drivers/nvme/host/pci.c | 4 ++-- drivers/scsi/sd.c | 25 ++++++++++++++++--------- 13 files changed, 44 insertions(+), 38 deletions(-) diff --git a/drivers/block/loop.c b/drivers/block/loop.c index 423f4ca..e771bab 100644 --- a/drivers/block/loop.c +++ b/drivers/block/loop.c @@ -538,7 +538,7 @@ static int do_req_filebacked(struct loop_device *lo, struct request *rq) if (rq->cmd_flags & REQ_WRITE) { if (rq->cmd_flags & REQ_FLUSH) ret = lo_req_flush(lo, rq); - else if (rq->cmd_flags & REQ_DISCARD) + else if (rq->op == REQ_OP_DISCARD) ret = lo_discard(lo, rq, pos); else if (lo->transfer) ret = lo_write_transfer(lo, rq, pos); @@ -1653,8 +1653,8 @@ static int loop_queue_rq(struct blk_mq_hw_ctx *hctx, if (lo->lo_state != Lo_bound) return -EIO; - if (lo->use_dio && !(cmd->rq->cmd_flags & (REQ_FLUSH | - REQ_DISCARD))) + if (lo->use_dio && (!(cmd->rq->cmd_flags & REQ_FLUSH) || + cmd->rq->op == REQ_OP_DISCARD)) cmd->use_aio = true; else cmd->use_aio = false; diff --git a/drivers/block/mtip32xx/mtip32xx.c b/drivers/block/mtip32xx/mtip32xx.c index 9b180db..3995a9e 100644 --- a/drivers/block/mtip32xx/mtip32xx.c +++ b/drivers/block/mtip32xx/mtip32xx.c @@ -3670,7 +3670,7 @@ static int mtip_submit_request(struct blk_mq_hw_ctx *hctx, struct request *rq) return -ENXIO; } - if (rq->cmd_flags & REQ_DISCARD) { + if (rq->op == REQ_OP_DISCARD) { int err; err = mtip_send_trim(dd, blk_rq_pos(rq), blk_rq_sectors(rq)); diff --git a/drivers/block/nbd.c b/drivers/block/nbd.c index e4c5cc1..dd8f3e9 100644 --- a/drivers/block/nbd.c +++ b/drivers/block/nbd.c @@ -242,7 +242,7 @@ static int nbd_send_req(struct nbd_device *nbd, struct request *req) if (req->cmd_type == REQ_TYPE_DRV_PRIV) type = NBD_CMD_DISC; - else if (req->cmd_flags & REQ_DISCARD) + else if (req->op == REQ_OP_DISCARD) type = NBD_CMD_TRIM; else if (req->cmd_flags & REQ_FLUSH) type = NBD_CMD_FLUSH; diff --git a/drivers/block/rbd.c b/drivers/block/rbd.c index 4a87678..1d0f464 100644 --- a/drivers/block/rbd.c +++ b/drivers/block/rbd.c @@ -3373,7 +3373,7 @@ static void rbd_queue_workfn(struct work_struct *work) goto err; } - if (rq->cmd_flags & REQ_DISCARD) + if (rq->op == REQ_OP_DISCARD) op_type = OBJ_OP_DISCARD; else if (rq->cmd_flags & REQ_WRITE) op_type = OBJ_OP_WRITE; diff --git a/drivers/block/skd_main.c b/drivers/block/skd_main.c index 586f916..f89a0c8 100644 --- a/drivers/block/skd_main.c +++ b/drivers/block/skd_main.c @@ -576,7 +576,6 @@ static void skd_request_fn(struct request_queue *q) struct request *req = NULL; struct skd_scsi_request *scsi_req; struct page *page; - unsigned long io_flags; int error; u32 lba; u32 count; @@ -624,12 +623,11 @@ static void skd_request_fn(struct request_queue *q) lba = (u32)blk_rq_pos(req); count = blk_rq_sectors(req); data_dir = rq_data_dir(req); - io_flags = req->cmd_flags; - if (io_flags & REQ_FLUSH) + if (req->cmd_flags & REQ_FLUSH) flush++; - if (io_flags & REQ_FUA) + if (req->cmd_flags & REQ_FUA) fua++; pr_debug("%s:%s:%d new req=%p lba=%u(0x%x) " @@ -735,7 +733,7 @@ static void skd_request_fn(struct request_queue *q) else skreq->sg_data_dir = SKD_DATA_DIR_HOST_TO_CARD; - if (io_flags & REQ_DISCARD) { + if (req->op == REQ_OP_DISCARD) { page = alloc_page(GFP_ATOMIC | __GFP_ZERO); if (!page) { pr_err("request_fn:Page allocation failed.\n"); @@ -852,9 +850,8 @@ static void skd_end_request(struct skd_device *skdev, struct skd_request_context *skreq, int error) { struct request *req = skreq->req; - unsigned int io_flags = req->cmd_flags; - if ((io_flags & REQ_DISCARD) && + if ((req->op == REQ_OP_DISCARD) && (skreq->discard_page == 1)) { pr_debug("%s:%s:%d, free the page!", skdev->name, __func__, __LINE__); diff --git a/drivers/block/xen-blkfront.c b/drivers/block/xen-blkfront.c index 7ba2ed1..34e8f1a 100644 --- a/drivers/block/xen-blkfront.c +++ b/drivers/block/xen-blkfront.c @@ -842,7 +842,8 @@ static int blkif_queue_request(struct request *req, struct blkfront_ring_info *r if (unlikely(rinfo->dev_info->connected != BLKIF_STATE_CONNECTED)) return 1; - if (unlikely(req->cmd_flags & (REQ_DISCARD | REQ_SECURE))) + if (unlikely(req->op == REQ_OP_DISCARD || + req->cmd_flags & REQ_SECURE)) return blkif_queue_discard_req(req, rinfo); else return blkif_queue_rw_req(req, rinfo); @@ -2051,8 +2052,9 @@ static int blkif_recover(struct blkfront_info *info) /* * Get the bios in the request so we can re-queue them. */ - if (copy[i].request->cmd_flags & - (REQ_FLUSH | REQ_FUA | REQ_DISCARD | REQ_SECURE)) { + if (copy[i].request->cmd_flags & REQ_FLUSH || + copy[i].request->op == REQ_OP_DISCARD || + copy[i].request->cmd_flags & (REQ_FUA | REQ_SECURE)) { /* * Flush operations don't contain bios, so * we need to requeue the whole request diff --git a/drivers/md/dm.c b/drivers/md/dm.c index 38c7d93..53f7b1e 100644 --- a/drivers/md/dm.c +++ b/drivers/md/dm.c @@ -1322,7 +1322,7 @@ static void dm_done(struct request *clone, int error, bool mapped) r = rq_end_io(tio->ti, clone, error, &tio->info); } - if (unlikely(r == -EREMOTEIO && (clone->cmd_flags & REQ_WRITE_SAME) && + if (unlikely(r == -EREMOTEIO && (clone->op == REQ_OP_WRITE_SAME) && !clone->q->limits.max_write_same_sectors)) disable_write_same(tio->md); diff --git a/drivers/mmc/card/block.c b/drivers/mmc/card/block.c index 47bc87d..1f84a44 100644 --- a/drivers/mmc/card/block.c +++ b/drivers/mmc/card/block.c @@ -1690,8 +1690,7 @@ static u8 mmc_blk_prep_packed_list(struct mmc_queue *mq, struct request *req) !IS_ALIGNED(blk_rq_sectors(next), 8)) break; - if (next->cmd_flags & REQ_DISCARD || - next->cmd_flags & REQ_FLUSH) + if (next->op == REQ_OP_DISCARD || next->cmd_flags & REQ_FLUSH) break; if (rq_data_dir(cur) != rq_data_dir(next)) @@ -2132,7 +2131,7 @@ static int mmc_blk_issue_rq(struct mmc_queue *mq, struct request *req) } mq->flags &= ~MMC_QUEUE_NEW_REQUEST; - if (cmd_flags & REQ_DISCARD) { + if (req && req->op == REQ_OP_DISCARD) { /* complete ongoing async transfer before issuing discard */ if (card->host->areq) mmc_blk_issue_rw_rq(mq, NULL); @@ -2156,7 +2155,7 @@ static int mmc_blk_issue_rq(struct mmc_queue *mq, struct request *req) out: if ((!req && !(mq->flags & MMC_QUEUE_NEW_REQUEST)) || - (cmd_flags & MMC_REQ_SPECIAL_MASK)) + mmc_req_is_special(req)) /* * Release host when there are no more requests * and after special request(discard, flush) is done. diff --git a/drivers/mmc/card/queue.c b/drivers/mmc/card/queue.c index 6f4323c..9fb8d21 100644 --- a/drivers/mmc/card/queue.c +++ b/drivers/mmc/card/queue.c @@ -33,7 +33,7 @@ static int mmc_prep_request(struct request_queue *q, struct request *req) /* * We only like normal block requests and discards. */ - if (req->cmd_type != REQ_TYPE_FS && !(req->cmd_flags & REQ_DISCARD)) { + if (req->cmd_type != REQ_TYPE_FS && req->op != REQ_OP_DISCARD) { blk_dump_rq_flags(req, "MMC bad request"); return BLKPREP_KILL; } @@ -56,7 +56,6 @@ static int mmc_queue_thread(void *d) down(&mq->thread_sem); do { struct request *req = NULL; - unsigned int cmd_flags = 0; spin_lock_irq(q->queue_lock); set_current_state(TASK_INTERRUPTIBLE); @@ -66,7 +65,6 @@ static int mmc_queue_thread(void *d) if (req || mq->mqrq_prev->req) { set_current_state(TASK_RUNNING); - cmd_flags = req ? req->cmd_flags : 0; mq->issue_fn(mq, req); cond_resched(); if (mq->flags & MMC_QUEUE_NEW_REQUEST) { @@ -81,7 +79,7 @@ static int mmc_queue_thread(void *d) * has been finished. Do not assign it to previous * request. */ - if (cmd_flags & MMC_REQ_SPECIAL_MASK) + if (mmc_req_is_special(req)) mq->mqrq_cur->req = NULL; mq->mqrq_prev->brq.mrq.data = NULL; diff --git a/drivers/mmc/card/queue.h b/drivers/mmc/card/queue.h index 36cddab..f166e5b 100644 --- a/drivers/mmc/card/queue.h +++ b/drivers/mmc/card/queue.h @@ -1,7 +1,10 @@ #ifndef MMC_QUEUE_H #define MMC_QUEUE_H -#define MMC_REQ_SPECIAL_MASK (REQ_DISCARD | REQ_FLUSH) +static inline bool mmc_req_is_special(struct request *req) +{ + return req && (req->cmd_flags & REQ_FLUSH || req->op == REQ_OP_DISCARD); +} struct request; struct task_struct; diff --git a/drivers/mtd/mtd_blkdevs.c b/drivers/mtd/mtd_blkdevs.c index f470118..b2e0bce 100644 --- a/drivers/mtd/mtd_blkdevs.c +++ b/drivers/mtd/mtd_blkdevs.c @@ -94,7 +94,7 @@ static int do_blktrans_request(struct mtd_blktrans_ops *tr, get_capacity(req->rq_disk)) return -EIO; - if (req->cmd_flags & REQ_DISCARD) + if (req->op == REQ_OP_DISCARD) return tr->discard(dev, block, nsect); if (rq_data_dir(req) == READ) { diff --git a/drivers/nvme/host/pci.c b/drivers/nvme/host/pci.c index 720a523..da32c93 100644 --- a/drivers/nvme/host/pci.c +++ b/drivers/nvme/host/pci.c @@ -330,7 +330,7 @@ static int nvme_init_iod(struct request *rq, struct nvme_dev *dev) int nseg = rq->nr_phys_segments; unsigned size; - if (rq->cmd_flags & REQ_DISCARD) + if (rq->op == REQ_OP_DISCARD) size = sizeof(struct nvme_dsm_range); else size = blk_rq_bytes(rq); @@ -646,7 +646,7 @@ static int nvme_queue_rq(struct blk_mq_hw_ctx *hctx, if (ret) return ret; - if (req->cmd_flags & REQ_DISCARD) { + if (req->op == REQ_OP_DISCARD) { ret = nvme_setup_discard(nvmeq, ns, req, &cmnd); } else { if (req->cmd_type == REQ_TYPE_DRV_PRIV) diff --git a/drivers/scsi/sd.c b/drivers/scsi/sd.c index d749da7..e8fbd0f 100644 --- a/drivers/scsi/sd.c +++ b/drivers/scsi/sd.c @@ -1012,7 +1012,8 @@ static int sd_setup_read_write_cmnd(struct scsi_cmnd *SCpnt) } else if (rq_data_dir(rq) == READ) { SCpnt->cmnd[0] = READ_6; } else { - scmd_printk(KERN_ERR, SCpnt, "Unknown command %llx\n", (unsigned long long) rq->cmd_flags); + scmd_printk(KERN_ERR, SCpnt, "Unknown command %d,%llx\n", + rq->op, (unsigned long long) rq->cmd_flags); goto out; } @@ -1137,21 +1138,27 @@ static int sd_init_command(struct scsi_cmnd *cmd) { struct request *rq = cmd->request; - if (rq->cmd_flags & REQ_DISCARD) + switch (rq->op) { + case REQ_OP_DISCARD: return sd_setup_discard_cmnd(cmd); - else if (rq->cmd_flags & REQ_WRITE_SAME) + case REQ_OP_WRITE_SAME: return sd_setup_write_same_cmnd(cmd); - else if (rq->cmd_flags & REQ_FLUSH) - return sd_setup_flush_cmnd(cmd); - else - return sd_setup_read_write_cmnd(cmd); + case REQ_OP_READ: + case REQ_OP_WRITE: + if (rq->cmd_flags & REQ_FLUSH) + return sd_setup_flush_cmnd(cmd); + else + return sd_setup_read_write_cmnd(cmd); + default: + BUG(); + } } static void sd_uninit_command(struct scsi_cmnd *SCpnt) { struct request *rq = SCpnt->request; - if (rq->cmd_flags & REQ_DISCARD) + if (rq->op == REQ_OP_DISCARD) __free_page(rq->completion_data); if (SCpnt->cmnd != rq->cmd) { @@ -1768,7 +1775,7 @@ static int sd_done(struct scsi_cmnd *SCpnt) unsigned char op = SCpnt->cmnd[0]; unsigned char unmap = SCpnt->cmnd[1] & 8; - if (req->cmd_flags & REQ_DISCARD || req->cmd_flags & REQ_WRITE_SAME) { + if (req->op == REQ_OP_DISCARD || req->op == REQ_OP_WRITE_SAME) { if (!result) { good_bytes = blk_rq_bytes(req); scsi_set_resid(SCpnt, 0); -- 1.8.3.1 From mchristi@redhat.com Wed Feb 24 13:49:42 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=ham version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay1.corp.sgi.com [137.38.102.111]) by oss.sgi.com (Postfix) with ESMTP id E8C1F7F5F for ; Wed, 24 Feb 2016 13:49:42 -0600 (CST) Received: from cuda.sgi.com (cuda3.sgi.com [192.48.176.15]) by relay1.corp.sgi.com (Postfix) with ESMTP id BA7BA8F8033 for ; Wed, 24 Feb 2016 11:49:36 -0800 (PST) X-ASG-Debug-ID: 1456343373-04cb6c70074d780001-NocioJ Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by cuda.sgi.com with ESMTP id aNvPBQZCoqTIjpCg (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO) for ; Wed, 24 Feb 2016 11:49:34 -0800 (PST) X-Barracuda-Envelope-From: mchristi@redhat.com X-Barracuda-Apparent-Source-IP: 209.132.183.28 X-ASG-Whitelist: Client Received: from int-mx09.intmail.prod.int.phx2.redhat.com (int-mx09.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by mx1.redhat.com (Postfix) with ESMTPS id 56746BBB3C; Wed, 24 Feb 2016 19:49:33 +0000 (UTC) Received: from rh2.redhat.com (vpn-54-14.rdu2.redhat.com [10.10.54.14]) by int-mx09.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id u1OJmJEV006684; Wed, 24 Feb 2016 14:49:30 -0500 From: mchristi@redhat.com To: linux-f2fs-devel@lists.sourceforge.net, linux-ext4@vger.kernel.org, konrad.wilk@oracle.com, drbd-dev@lists.linbit.com, philipp.reisner@linbit.com, lars.ellenberg@linbit.com, linux-raid@vger.kernel.org, dm-devel@redhat.com, linux-fsdevel@vger.kernel.org, linux-bcache@vger.kernel.org, linux-block@vger.kernel.org, linux-kernel@vger.kernel.org, linux-scsi@vger.kernel.org, linux-mtd@lists.infradead.org, target-devel@vger.kernel.org, linux-btrfs@vger.kernel.org, osd-dev@open-osd.org, xfs@oss.sgi.com, ocfs2-devel@oss.oracle.com Cc: Mike Christie Subject: [PATCH 26/35] block: set op to REQ_OP Date: Wed, 24 Feb 2016 13:48:03 -0600 X-ASG-Orig-Subj: [PATCH 26/35] block: set op to REQ_OP Message-Id: <1456343292-14535-27-git-send-email-mchristi@redhat.com> In-Reply-To: <1456343292-14535-1-git-send-email-mchristi@redhat.com> References: <1456343292-14535-1-git-send-email-mchristi@redhat.com> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.22 X-Barracuda-Connect: mx1.redhat.com[209.132.183.28] X-Barracuda-Start-Time: 1456343373 X-Barracuda-Encrypted: ECDHE-RSA-AES256-GCM-SHA384 X-Barracuda-URL: https://192.48.176.15:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-BRTS-Status: 1 From: Mike Christie This patch converts the request related block layer code to set request->op to a REQ_OP and cmd_flags to rq_flag_bits. There is some tmp compat code when setting up cmd_flags so it still carries both the op and flags. It will be removed in in later patches in this set when I have converted all drivers. I have not been able to test the mq paths with real mq hardware. Signed-off-by: Mike Christie --- block/blk-core.c | 60 ++++++++++++++++++++++++++-------------------- block/blk-flush.c | 1 + block/blk-merge.c | 10 ++++---- block/blk-mq.c | 38 ++++++++++++++++------------- block/cfq-iosched.c | 53 +++++++++++++++++++++++----------------- block/elevator.c | 8 +++---- include/linux/blk-cgroup.h | 13 +++++----- include/linux/blkdev.h | 28 +++++++++++----------- include/linux/elevator.h | 4 ++-- 9 files changed, 120 insertions(+), 95 deletions(-) diff --git a/block/blk-core.c b/block/blk-core.c index 74aa201..60a0edb 100644 --- a/block/blk-core.c +++ b/block/blk-core.c @@ -959,10 +959,10 @@ static void __freed_request(struct request_list *rl, int sync) * A request has just been released. Account for it, update the full and * congestion status, wake up any waiters. Called under q->queue_lock. */ -static void freed_request(struct request_list *rl, unsigned int flags) +static void freed_request(struct request_list *rl, int op, unsigned int flags) { struct request_queue *q = rl->q; - int sync = rw_is_sync(flags); + int sync = rw_is_sync(op, flags); q->nr_rqs[sync]--; rl->count[sync]--; @@ -1054,7 +1054,8 @@ static struct io_context *rq_ioc(struct bio *bio) /** * __get_request - get a free request * @rl: request list to allocate from - * @rw_flags: RW and SYNC flags + * @op: REQ_OP_READ/REQ_OP_WRITE + * @op_flags: rq_flag_bits * @bio: bio to allocate request for (can be %NULL) * @gfp_mask: allocation mask * @@ -1065,21 +1066,22 @@ static struct io_context *rq_ioc(struct bio *bio) * Returns ERR_PTR on failure, with @q->queue_lock held. * Returns request pointer on success, with @q->queue_lock *not held*. */ -static struct request *__get_request(struct request_list *rl, int rw_flags, - struct bio *bio, gfp_t gfp_mask) +static struct request *__get_request(struct request_list *rl, int op, + int op_flags, struct bio *bio, + gfp_t gfp_mask) { struct request_queue *q = rl->q; struct request *rq; struct elevator_type *et = q->elevator->type; struct io_context *ioc = rq_ioc(bio); struct io_cq *icq = NULL; - const bool is_sync = rw_is_sync(rw_flags) != 0; + const bool is_sync = rw_is_sync(op, op_flags) != 0; int may_queue; if (unlikely(blk_queue_dying(q))) return ERR_PTR(-ENODEV); - may_queue = elv_may_queue(q, rw_flags); + may_queue = elv_may_queue(q, op, op_flags); if (may_queue == ELV_MQUEUE_NO) goto rq_starved; @@ -1123,7 +1125,7 @@ static struct request *__get_request(struct request_list *rl, int rw_flags, /* * Decide whether the new request will be managed by elevator. If - * so, mark @rw_flags and increment elvpriv. Non-zero elvpriv will + * so, mark @op_flags and increment elvpriv. Non-zero elvpriv will * prevent the current elevator from being destroyed until the new * request is freed. This guarantees icq's won't be destroyed and * makes creating new ones safe. @@ -1132,14 +1134,14 @@ static struct request *__get_request(struct request_list *rl, int rw_flags, * it will be created after releasing queue_lock. */ if (blk_rq_should_init_elevator(bio) && !blk_queue_bypass(q)) { - rw_flags |= REQ_ELVPRIV; + op_flags |= REQ_ELVPRIV; q->nr_rqs_elvpriv++; if (et->icq_cache && ioc) icq = ioc_lookup_icq(ioc, q); } if (blk_queue_io_stat(q)) - rw_flags |= REQ_IO_STAT; + op_flags |= REQ_IO_STAT; spin_unlock_irq(q->queue_lock); /* allocate and init request */ @@ -1149,10 +1151,12 @@ static struct request *__get_request(struct request_list *rl, int rw_flags, blk_rq_init(q, rq); blk_rq_set_rl(rq, rl); - rq->cmd_flags = rw_flags | REQ_ALLOCED; + /* tmp compat - allow users to check either one for the op */ + rq->cmd_flags = op | op_flags | REQ_ALLOCED; + rq->op = op; /* init elvpriv */ - if (rw_flags & REQ_ELVPRIV) { + if (op_flags & REQ_ELVPRIV) { if (unlikely(et->icq_cache && !icq)) { if (ioc) icq = ioc_create_icq(ioc, q, gfp_mask); @@ -1178,7 +1182,7 @@ out: if (ioc_batching(q, ioc)) ioc->nr_batch_requests--; - trace_block_getrq(q, bio, rw_flags & 1); + trace_block_getrq(q, bio, op); return rq; fail_elvpriv: @@ -1208,7 +1212,7 @@ fail_alloc: * queue, but this is pretty rare. */ spin_lock_irq(q->queue_lock); - freed_request(rl, rw_flags); + freed_request(rl, op, op_flags); /* * in the very unlikely event that allocation failed and no @@ -1226,7 +1230,8 @@ rq_starved: /** * get_request - get a free request * @q: request_queue to allocate request from - * @rw_flags: RW and SYNC flags + * op: REQ_OP_READ/REQ_OP_WRITE + * @op_flags: rq_flag_bits * @bio: bio to allocate request for (can be %NULL) * @gfp_mask: allocation mask * @@ -1237,17 +1242,18 @@ rq_starved: * Returns ERR_PTR on failure, with @q->queue_lock held. * Returns request pointer on success, with @q->queue_lock *not held*. */ -static struct request *get_request(struct request_queue *q, int rw_flags, - struct bio *bio, gfp_t gfp_mask) +static struct request *get_request(struct request_queue *q, int op, + int op_flags, struct bio *bio, + gfp_t gfp_mask) { - const bool is_sync = rw_is_sync(rw_flags) != 0; + const bool is_sync = rw_is_sync(op, op_flags) != 0; DEFINE_WAIT(wait); struct request_list *rl; struct request *rq; rl = blk_get_rl(q, bio); /* transferred to @rq on success */ retry: - rq = __get_request(rl, rw_flags, bio, gfp_mask); + rq = __get_request(rl, op, op_flags, bio, gfp_mask); if (!IS_ERR(rq)) return rq; @@ -1260,7 +1266,7 @@ retry: prepare_to_wait_exclusive(&rl->wait[is_sync], &wait, TASK_UNINTERRUPTIBLE); - trace_block_sleeprq(q, bio, rw_flags & 1); + trace_block_sleeprq(q, bio, op); spin_unlock_irq(q->queue_lock); io_schedule(); @@ -1289,7 +1295,7 @@ static struct request *blk_old_get_request(struct request_queue *q, int rw, create_io_context(gfp_mask, q->node); spin_lock_irq(q->queue_lock); - rq = get_request(q, rw, NULL, gfp_mask); + rq = get_request(q, rw, 0, NULL, gfp_mask); if (IS_ERR(rq)) spin_unlock_irq(q->queue_lock); /* q->queue_lock is unlocked at this point */ @@ -1491,13 +1497,14 @@ void __blk_put_request(struct request_queue *q, struct request *req) */ if (req->cmd_flags & REQ_ALLOCED) { unsigned int flags = req->cmd_flags; + int op = req->op; struct request_list *rl = blk_rq_rl(req); BUG_ON(!list_empty(&req->queuelist)); BUG_ON(ELV_ON_HASH(req)); blk_free_request(rl, req); - freed_request(rl, flags); + freed_request(rl, op, flags); blk_put_rl(rl); } } @@ -1712,7 +1719,7 @@ static blk_qc_t blk_queue_bio(struct request_queue *q, struct bio *bio) { const bool sync = !!(bio->bi_rw & REQ_SYNC); struct blk_plug *plug; - int el_ret, rw_flags, where = ELEVATOR_INSERT_SORT; + int el_ret, rw_flags = 0, where = ELEVATOR_INSERT_SORT; struct request *req; unsigned int request_count = 0; @@ -1772,7 +1779,6 @@ get_rq: * but we need to set it earlier to expose the sync flag to the * rq allocator and io schedulers. */ - rw_flags = bio_data_dir(bio); if (sync) rw_flags |= REQ_SYNC; @@ -1780,7 +1786,7 @@ get_rq: * Grab a free request. This is might sleep but can not fail. * Returns with the queue unlocked. */ - req = get_request(q, rw_flags, bio, GFP_NOIO); + req = get_request(q, bio_data_dir(bio), rw_flags, bio, GFP_NOIO); if (IS_ERR(req)) { bio->bi_error = PTR_ERR(req); bio_endio(bio); @@ -2168,7 +2174,7 @@ EXPORT_SYMBOL(submit_bio); static int blk_cloned_rq_check_limits(struct request_queue *q, struct request *rq) { - if (blk_rq_sectors(rq) > blk_queue_get_max_sectors(q, rq->cmd_flags)) { + if (blk_rq_sectors(rq) > blk_queue_get_max_sectors(q, rq->op)) { printk(KERN_ERR "%s: over max size limit.\n", __func__); return -EIO; } @@ -2989,6 +2995,7 @@ void blk_rq_bio_prep(struct request_queue *q, struct request *rq, { /* tmp compat. Allow users to set bi_op or bi_rw */ rq->cmd_flags |= bio_data_dir(bio); + rq->op = bio->bi_op; if (bio_has_data(bio)) rq->nr_phys_segments = bio_phys_segments(q, bio); @@ -3073,6 +3080,7 @@ EXPORT_SYMBOL_GPL(blk_rq_unprep_clone); static void __blk_rq_prep_clone(struct request *dst, struct request *src) { dst->cpu = src->cpu; + dst->op = src->op; dst->cmd_flags |= (src->cmd_flags & REQ_CLONE_MASK) | REQ_NOMERGE; dst->cmd_type = src->cmd_type; dst->__sector = blk_rq_pos(src); diff --git a/block/blk-flush.c b/block/blk-flush.c index b05acca..e01d3ac 100644 --- a/block/blk-flush.c +++ b/block/blk-flush.c @@ -330,6 +330,7 @@ static bool blk_kick_flush(struct request_queue *q, struct blk_flush_queue *fq) flush_rq->cmd_type = REQ_TYPE_FS; flush_rq->cmd_flags = WRITE_FLUSH | REQ_FLUSH_SEQ; + flush_rq->op = REQ_OP_WRITE; flush_rq->rq_disk = first_rq->rq_disk; flush_rq->end_io = flush_end_io; diff --git a/block/blk-merge.c b/block/blk-merge.c index 888a7fe..f9e012e 100644 --- a/block/blk-merge.c +++ b/block/blk-merge.c @@ -653,7 +653,8 @@ static int attempt_merge(struct request_queue *q, struct request *req, if (!rq_mergeable(req) || !rq_mergeable(next)) return 0; - if (!blk_check_merge_flags(req->cmd_flags, next->cmd_flags)) + if (!blk_check_merge_flags(req->cmd_flags, req->op, next->cmd_flags, + next->op)) return 0; /* @@ -667,7 +668,7 @@ static int attempt_merge(struct request_queue *q, struct request *req, || req_no_special_merge(next)) return 0; - if (req->cmd_flags & REQ_WRITE_SAME && + if (req->op == REQ_OP_WRITE_SAME && !blk_write_same_mergeable(req->bio, next->bio)) return 0; @@ -755,7 +756,8 @@ bool blk_rq_merge_ok(struct request *rq, struct bio *bio) if (!rq_mergeable(rq) || !bio_mergeable(bio)) return false; - if (!blk_check_merge_flags(rq->cmd_flags, bio->bi_rw)) + if (!blk_check_merge_flags(rq->cmd_flags, rq->op, bio->bi_rw, + bio->bi_op)) return false; /* different data direction or already started, don't merge */ @@ -771,7 +773,7 @@ bool blk_rq_merge_ok(struct request *rq, struct bio *bio) return false; /* must be using the same buffer */ - if (rq->cmd_flags & REQ_WRITE_SAME && + if (rq->op == REQ_OP_WRITE_SAME && !blk_write_same_mergeable(rq->bio, bio)) return false; diff --git a/block/blk-mq.c b/block/blk-mq.c index 1d0c3de..5581bac 100644 --- a/block/blk-mq.c +++ b/block/blk-mq.c @@ -159,16 +159,19 @@ bool blk_mq_can_queue(struct blk_mq_hw_ctx *hctx) EXPORT_SYMBOL(blk_mq_can_queue); static void blk_mq_rq_ctx_init(struct request_queue *q, struct blk_mq_ctx *ctx, - struct request *rq, unsigned int rw_flags) + struct request *rq, int op, + unsigned int op_flags) { if (blk_queue_io_stat(q)) - rw_flags |= REQ_IO_STAT; + op_flags |= REQ_IO_STAT; INIT_LIST_HEAD(&rq->queuelist); /* csd/requeue_work/fifo_time is initialized before use */ rq->q = q; rq->mq_ctx = ctx; - rq->cmd_flags |= rw_flags; + rq->op = op; + /* tmp compat - allow users to check either one for the op */ + rq->cmd_flags |= op | op_flags; /* do not touch atomic flags, it needs atomic ops against the timer */ rq->cpu = -1; INIT_HLIST_NODE(&rq->hash); @@ -203,11 +206,11 @@ static void blk_mq_rq_ctx_init(struct request_queue *q, struct blk_mq_ctx *ctx, rq->end_io_data = NULL; rq->next_rq = NULL; - ctx->rq_dispatched[rw_is_sync(rw_flags)]++; + ctx->rq_dispatched[rw_is_sync(op, op_flags)]++; } static struct request * -__blk_mq_alloc_request(struct blk_mq_alloc_data *data, int rw) +__blk_mq_alloc_request(struct blk_mq_alloc_data *data, int op, int op_flags) { struct request *rq; unsigned int tag; @@ -222,7 +225,7 @@ __blk_mq_alloc_request(struct blk_mq_alloc_data *data, int rw) } rq->tag = tag; - blk_mq_rq_ctx_init(data->q, data->ctx, rq, rw); + blk_mq_rq_ctx_init(data->q, data->ctx, rq, op, op_flags); return rq; } @@ -246,7 +249,7 @@ struct request *blk_mq_alloc_request(struct request_queue *q, int rw, hctx = q->mq_ops->map_queue(q, ctx->cpu); blk_mq_set_alloc_data(&alloc_data, q, flags, ctx, hctx); - rq = __blk_mq_alloc_request(&alloc_data, rw); + rq = __blk_mq_alloc_request(&alloc_data, rw, 0); if (!rq && !(flags & BLK_MQ_REQ_NOWAIT)) { __blk_mq_run_hw_queue(hctx); blk_mq_put_ctx(ctx); @@ -254,7 +257,7 @@ struct request *blk_mq_alloc_request(struct request_queue *q, int rw, ctx = blk_mq_get_ctx(q); hctx = q->mq_ops->map_queue(q, ctx->cpu); blk_mq_set_alloc_data(&alloc_data, q, flags, ctx, hctx); - rq = __blk_mq_alloc_request(&alloc_data, rw); + rq = __blk_mq_alloc_request(&alloc_data, rw, 0); ctx = alloc_data.ctx; } blk_mq_put_ctx(ctx); @@ -1167,28 +1170,29 @@ static struct request *blk_mq_map_request(struct request_queue *q, struct blk_mq_hw_ctx *hctx; struct blk_mq_ctx *ctx; struct request *rq; - int rw = bio_data_dir(bio); + int op = bio_data_dir(bio); + int op_flags = 0; struct blk_mq_alloc_data alloc_data; blk_queue_enter_live(q); ctx = blk_mq_get_ctx(q); hctx = q->mq_ops->map_queue(q, ctx->cpu); - if (rw_is_sync(bio->bi_rw)) - rw |= REQ_SYNC; + if (rw_is_sync(bio->bi_op, bio->bi_rw)) + op_flags |= REQ_SYNC; - trace_block_getrq(q, bio, rw); + trace_block_getrq(q, bio, op); blk_mq_set_alloc_data(&alloc_data, q, BLK_MQ_REQ_NOWAIT, ctx, hctx); - rq = __blk_mq_alloc_request(&alloc_data, rw); + rq = __blk_mq_alloc_request(&alloc_data, op, op_flags); if (unlikely(!rq)) { __blk_mq_run_hw_queue(hctx); blk_mq_put_ctx(ctx); - trace_block_sleeprq(q, bio, rw); + trace_block_sleeprq(q, bio, op); ctx = blk_mq_get_ctx(q); hctx = q->mq_ops->map_queue(q, ctx->cpu); blk_mq_set_alloc_data(&alloc_data, q, 0, ctx, hctx); - rq = __blk_mq_alloc_request(&alloc_data, rw); + rq = __blk_mq_alloc_request(&alloc_data, op, op_flags); ctx = alloc_data.ctx; hctx = alloc_data.hctx; } @@ -1242,7 +1246,7 @@ static int blk_mq_direct_issue_request(struct request *rq, blk_qc_t *cookie) */ static blk_qc_t blk_mq_make_request(struct request_queue *q, struct bio *bio) { - const int is_sync = rw_is_sync(bio->bi_rw); + const int is_sync = rw_is_sync(bio->bi_op, bio->bi_rw); const int is_flush_fua = bio->bi_rw & (REQ_FLUSH | REQ_FUA); struct blk_map_ctx data; struct request *rq; @@ -1339,7 +1343,7 @@ done: */ static blk_qc_t blk_sq_make_request(struct request_queue *q, struct bio *bio) { - const int is_sync = rw_is_sync(bio->bi_rw); + const int is_sync = rw_is_sync(bio->bi_op, bio->bi_rw); const int is_flush_fua = bio->bi_rw & (REQ_FLUSH | REQ_FUA); struct blk_plug *plug; unsigned int request_count = 0; diff --git a/block/cfq-iosched.c b/block/cfq-iosched.c index e3c591d..d7c719c 100644 --- a/block/cfq-iosched.c +++ b/block/cfq-iosched.c @@ -667,9 +667,10 @@ static inline void cfqg_put(struct cfq_group *cfqg) } while (0) static inline void cfqg_stats_update_io_add(struct cfq_group *cfqg, - struct cfq_group *curr_cfqg, int rw) + struct cfq_group *curr_cfqg, int op, + int op_flags) { - blkg_rwstat_add(&cfqg->stats.queued, rw, 1); + blkg_rwstat_add(&cfqg->stats.queued, op, op_flags, 1); cfqg_stats_end_empty_time(&cfqg->stats); cfqg_stats_set_start_group_wait_time(cfqg, curr_cfqg); } @@ -683,26 +684,30 @@ static inline void cfqg_stats_update_timeslice_used(struct cfq_group *cfqg, #endif } -static inline void cfqg_stats_update_io_remove(struct cfq_group *cfqg, int rw) +static inline void cfqg_stats_update_io_remove(struct cfq_group *cfqg, int op, + int op_flags) { - blkg_rwstat_add(&cfqg->stats.queued, rw, -1); + blkg_rwstat_add(&cfqg->stats.queued, op, op_flags, -1); } -static inline void cfqg_stats_update_io_merged(struct cfq_group *cfqg, int rw) +static inline void cfqg_stats_update_io_merged(struct cfq_group *cfqg, int op, + int op_flags) { - blkg_rwstat_add(&cfqg->stats.merged, rw, 1); + blkg_rwstat_add(&cfqg->stats.merged, op, op_flags, 1); } static inline void cfqg_stats_update_completion(struct cfq_group *cfqg, - uint64_t start_time, uint64_t io_start_time, int rw) + uint64_t start_time, uint64_t io_start_time, int op, + int op_flags) { struct cfqg_stats *stats = &cfqg->stats; unsigned long long now = sched_clock(); if (time_after64(now, io_start_time)) - blkg_rwstat_add(&stats->service_time, rw, now - io_start_time); + blkg_rwstat_add(&stats->service_time, op, op_flags, + now - io_start_time); if (time_after64(io_start_time, start_time)) - blkg_rwstat_add(&stats->wait_time, rw, + blkg_rwstat_add(&stats->wait_time, op, op_flags, io_start_time - start_time); } @@ -781,13 +786,16 @@ static inline void cfqg_put(struct cfq_group *cfqg) { } #define cfq_log_cfqg(cfqd, cfqg, fmt, args...) do {} while (0) static inline void cfqg_stats_update_io_add(struct cfq_group *cfqg, - struct cfq_group *curr_cfqg, int rw) { } + struct cfq_group *curr_cfqg, int op, int op_flags) { } static inline void cfqg_stats_update_timeslice_used(struct cfq_group *cfqg, unsigned long time, unsigned long unaccounted_time) { } -static inline void cfqg_stats_update_io_remove(struct cfq_group *cfqg, int rw) { } -static inline void cfqg_stats_update_io_merged(struct cfq_group *cfqg, int rw) { } +static inline void cfqg_stats_update_io_remove(struct cfq_group *cfqg, int op, + int op_flags) { } +static inline void cfqg_stats_update_io_merged(struct cfq_group *cfqg, int op, + int op_flags) { } static inline void cfqg_stats_update_completion(struct cfq_group *cfqg, - uint64_t start_time, uint64_t io_start_time, int rw) { } + uint64_t start_time, uint64_t io_start_time, int op, + int op_flags) { } #endif /* CONFIG_CFQ_GROUP_IOSCHED */ @@ -2461,10 +2469,10 @@ static void cfq_reposition_rq_rb(struct cfq_queue *cfqq, struct request *rq) { elv_rb_del(&cfqq->sort_list, rq); cfqq->queued[rq_is_sync(rq)]--; - cfqg_stats_update_io_remove(RQ_CFQG(rq), rq->cmd_flags); + cfqg_stats_update_io_remove(RQ_CFQG(rq), rq->op, rq->cmd_flags); cfq_add_rq_rb(rq); cfqg_stats_update_io_add(RQ_CFQG(rq), cfqq->cfqd->serving_group, - rq->cmd_flags); + rq->op, rq->cmd_flags); } static struct request * @@ -2517,7 +2525,7 @@ static void cfq_remove_request(struct request *rq) cfq_del_rq_rb(rq); cfqq->cfqd->rq_queued--; - cfqg_stats_update_io_remove(RQ_CFQG(rq), rq->cmd_flags); + cfqg_stats_update_io_remove(RQ_CFQG(rq), rq->op, rq->cmd_flags); if (rq->cmd_flags & REQ_PRIO) { WARN_ON(!cfqq->prio_pending); cfqq->prio_pending--; @@ -2552,7 +2560,7 @@ static void cfq_merged_request(struct request_queue *q, struct request *req, static void cfq_bio_merged(struct request_queue *q, struct request *req, struct bio *bio) { - cfqg_stats_update_io_merged(RQ_CFQG(req), bio->bi_rw); + cfqg_stats_update_io_merged(RQ_CFQG(req), bio->bi_op, bio->bi_rw); } static void @@ -2575,7 +2583,7 @@ cfq_merged_requests(struct request_queue *q, struct request *rq, if (cfqq->next_rq == next) cfqq->next_rq = rq; cfq_remove_request(next); - cfqg_stats_update_io_merged(RQ_CFQG(rq), next->cmd_flags); + cfqg_stats_update_io_merged(RQ_CFQG(rq), next->op, next->cmd_flags); cfqq = RQ_CFQQ(next); /* @@ -4108,7 +4116,7 @@ static void cfq_insert_request(struct request_queue *q, struct request *rq) rq->fifo_time = jiffies + cfqd->cfq_fifo_expire[rq_is_sync(rq)]; list_add_tail(&rq->queuelist, &cfqq->fifo); cfq_add_rq_rb(rq); - cfqg_stats_update_io_add(RQ_CFQG(rq), cfqd->serving_group, + cfqg_stats_update_io_add(RQ_CFQG(rq), cfqd->serving_group, rq->op, rq->cmd_flags); cfq_rq_enqueued(cfqd, cfqq, rq); } @@ -4206,7 +4214,8 @@ static void cfq_completed_request(struct request_queue *q, struct request *rq) cfqq->dispatched--; (RQ_CFQG(rq))->dispatched--; cfqg_stats_update_completion(cfqq->cfqg, rq_start_time_ns(rq), - rq_io_start_time_ns(rq), rq->cmd_flags); + rq_io_start_time_ns(rq), rq->op, + rq->cmd_flags); cfqd->rq_in_flight[cfq_cfqq_sync(cfqq)]--; @@ -4285,7 +4294,7 @@ static inline int __cfq_may_queue(struct cfq_queue *cfqq) return ELV_MQUEUE_MAY; } -static int cfq_may_queue(struct request_queue *q, int rw) +static int cfq_may_queue(struct request_queue *q, int op, int op_flags) { struct cfq_data *cfqd = q->elevator->elevator_data; struct task_struct *tsk = current; @@ -4302,7 +4311,7 @@ static int cfq_may_queue(struct request_queue *q, int rw) if (!cic) return ELV_MQUEUE_MAY; - cfqq = cic_to_cfqq(cic, rw_is_sync(rw)); + cfqq = cic_to_cfqq(cic, rw_is_sync(op, op_flags)); if (cfqq) { cfq_init_prio_data(cfqq, cic); diff --git a/block/elevator.c b/block/elevator.c index c3555c9..f6279ca 100644 --- a/block/elevator.c +++ b/block/elevator.c @@ -366,8 +366,8 @@ void elv_dispatch_sort(struct request_queue *q, struct request *rq) list_for_each_prev(entry, &q->queue_head) { struct request *pos = list_entry_rq(entry); - if ((rq->cmd_flags & REQ_DISCARD) != - (pos->cmd_flags & REQ_DISCARD)) + if ((rq->op == REQ_OP_DISCARD) != + (pos->op == REQ_OP_DISCARD)) break; if (rq_data_dir(rq) != rq_data_dir(pos)) break; @@ -717,12 +717,12 @@ void elv_put_request(struct request_queue *q, struct request *rq) e->type->ops.elevator_put_req_fn(rq); } -int elv_may_queue(struct request_queue *q, int rw) +int elv_may_queue(struct request_queue *q, int op, int op_flags) { struct elevator_queue *e = q->elevator; if (e->type->ops.elevator_may_queue_fn) - return e->type->ops.elevator_may_queue_fn(q, rw); + return e->type->ops.elevator_may_queue_fn(q, op, op_flags); return ELV_MQUEUE_MAY; } diff --git a/include/linux/blk-cgroup.h b/include/linux/blk-cgroup.h index c02e669..9071feb 100644 --- a/include/linux/blk-cgroup.h +++ b/include/linux/blk-cgroup.h @@ -590,25 +590,26 @@ static inline void blkg_rwstat_exit(struct blkg_rwstat *rwstat) /** * blkg_rwstat_add - add a value to a blkg_rwstat * @rwstat: target blkg_rwstat - * @rw: mask of REQ_{WRITE|SYNC} + * @op: REQ_OP + * @op_flags: rq_flag_bits * @val: value to add * * Add @val to @rwstat. The counters are chosen according to @rw. The * caller is responsible for synchronizing calls to this function. */ static inline void blkg_rwstat_add(struct blkg_rwstat *rwstat, - int rw, uint64_t val) + int op, int op_flags, uint64_t val) { struct percpu_counter *cnt; - if (rw & REQ_WRITE) + if (op_is_write(op)) cnt = &rwstat->cpu_cnt[BLKG_RWSTAT_WRITE]; else cnt = &rwstat->cpu_cnt[BLKG_RWSTAT_READ]; __percpu_counter_add(cnt, val, BLKG_STAT_CPU_BATCH); - if (rw & REQ_SYNC) + if (op_flags & REQ_SYNC) cnt = &rwstat->cpu_cnt[BLKG_RWSTAT_SYNC]; else cnt = &rwstat->cpu_cnt[BLKG_RWSTAT_ASYNC]; @@ -713,9 +714,9 @@ static inline bool blkcg_bio_issue_check(struct request_queue *q, if (!throtl) { blkg = blkg ?: q->root_blkg; - blkg_rwstat_add(&blkg->stat_bytes, bio->bi_rw, + blkg_rwstat_add(&blkg->stat_bytes, bio->bi_op, bio->bi_rw, bio->bi_iter.bi_size); - blkg_rwstat_add(&blkg->stat_ios, bio->bi_rw, 1); + blkg_rwstat_add(&blkg->stat_ios, bio->bi_op, bio->bi_rw, 1); } rcu_read_unlock(); diff --git a/include/linux/blkdev.h b/include/linux/blkdev.h index d4d3b06..1c01a41 100644 --- a/include/linux/blkdev.h +++ b/include/linux/blkdev.h @@ -596,7 +596,7 @@ static inline void queue_flag_clear(unsigned int flag, struct request_queue *q) #define list_entry_rq(ptr) list_entry((ptr), struct request, queuelist) -#define rq_data_dir(rq) ((int)((rq)->cmd_flags & 1)) +#define rq_data_dir(rq) (op_is_write(rq->op) ? WRITE : READ) /* * Driver can handle struct request, if it either has an old style @@ -615,14 +615,14 @@ static inline unsigned int blk_queue_cluster(struct request_queue *q) /* * We regard a request as sync, if either a read or a sync write */ -static inline bool rw_is_sync(unsigned int rw_flags) +static inline bool rw_is_sync(int op, unsigned int rw_flags) { - return !(rw_flags & REQ_WRITE) || (rw_flags & REQ_SYNC); + return op == REQ_OP_READ || (rw_flags & REQ_SYNC); } static inline bool rq_is_sync(struct request *rq) { - return rw_is_sync(rq->cmd_flags); + return rw_is_sync(rq->op, rq->cmd_flags); } static inline bool blk_rl_full(struct request_list *rl, bool sync) @@ -657,16 +657,16 @@ static inline bool rq_mergeable(struct request *rq) return true; } -static inline bool blk_check_merge_flags(unsigned int flags1, - unsigned int flags2) +static inline bool blk_check_merge_flags(unsigned int flags1, unsigned int op1, + unsigned int flags2, unsigned int op2) { - if ((flags1 & REQ_DISCARD) != (flags2 & REQ_DISCARD)) + if ((op1 == REQ_OP_DISCARD) != (op2 == REQ_OP_DISCARD)) return false; if ((flags1 & REQ_SECURE) != (flags2 & REQ_SECURE)) return false; - if ((flags1 & REQ_WRITE_SAME) != (flags2 & REQ_WRITE_SAME)) + if ((op1 == REQ_OP_WRITE_SAME) != (op2 == REQ_OP_WRITE_SAME)) return false; return true; @@ -867,12 +867,12 @@ static inline unsigned int blk_rq_cur_sectors(const struct request *rq) } static inline unsigned int blk_queue_get_max_sectors(struct request_queue *q, - unsigned int cmd_flags) + int op) { - if (unlikely(cmd_flags & REQ_DISCARD)) + if (unlikely(op == REQ_OP_DISCARD)) return min(q->limits.max_discard_sectors, UINT_MAX >> 9); - if (unlikely(cmd_flags & REQ_WRITE_SAME)) + if (unlikely(op == REQ_OP_WRITE_SAME)) return q->limits.max_write_same_sectors; return q->limits.max_sectors; @@ -899,11 +899,11 @@ static inline unsigned int blk_rq_get_max_sectors(struct request *rq) if (unlikely(rq->cmd_type == REQ_TYPE_BLOCK_PC)) return q->limits.max_hw_sectors; - if (!q->limits.chunk_sectors || (rq->cmd_flags & REQ_DISCARD)) - return blk_queue_get_max_sectors(q, rq->cmd_flags); + if (!q->limits.chunk_sectors || (rq->op == REQ_OP_DISCARD)) + return blk_queue_get_max_sectors(q, rq->op); return min(blk_max_size_offset(q, blk_rq_pos(rq)), - blk_queue_get_max_sectors(q, rq->cmd_flags)); + blk_queue_get_max_sectors(q, rq->op)); } static inline unsigned int blk_rq_count_bios(struct request *rq) diff --git a/include/linux/elevator.h b/include/linux/elevator.h index 638b324..953d286 100644 --- a/include/linux/elevator.h +++ b/include/linux/elevator.h @@ -26,7 +26,7 @@ typedef int (elevator_dispatch_fn) (struct request_queue *, int); typedef void (elevator_add_req_fn) (struct request_queue *, struct request *); typedef struct request *(elevator_request_list_fn) (struct request_queue *, struct request *); typedef void (elevator_completed_req_fn) (struct request_queue *, struct request *); -typedef int (elevator_may_queue_fn) (struct request_queue *, int); +typedef int (elevator_may_queue_fn) (struct request_queue *, int, int); typedef void (elevator_init_icq_fn) (struct io_cq *); typedef void (elevator_exit_icq_fn) (struct io_cq *); @@ -134,7 +134,7 @@ extern struct request *elv_former_request(struct request_queue *, struct request extern struct request *elv_latter_request(struct request_queue *, struct request *); extern int elv_register_queue(struct request_queue *q); extern void elv_unregister_queue(struct request_queue *q); -extern int elv_may_queue(struct request_queue *, int); +extern int elv_may_queue(struct request_queue *, int, int); extern void elv_completed_request(struct request_queue *, struct request *); extern int elv_set_request(struct request_queue *q, struct request *rq, struct bio *bio, gfp_t gfp_mask); -- 1.8.3.1 From mchristi@redhat.com Wed Feb 24 13:49:48 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=ham version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay3.corp.sgi.com [198.149.34.15]) by oss.sgi.com (Postfix) with ESMTP id 0C2267CB9 for ; Wed, 24 Feb 2016 13:49:48 -0600 (CST) Received: from cuda.sgi.com (cuda1.sgi.com [192.48.157.11]) by relay3.corp.sgi.com (Postfix) with ESMTP id 9104AAC005 for ; Wed, 24 Feb 2016 11:49:41 -0800 (PST) X-ASG-Debug-ID: 1456343378-04bdf07ab613a820001-NocioJ Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by cuda.sgi.com with ESMTP id XaTg3HG7CYrcbFwt (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO) for ; Wed, 24 Feb 2016 11:49:38 -0800 (PST) X-Barracuda-Envelope-From: mchristi@redhat.com X-Barracuda-Apparent-Source-IP: 209.132.183.28 X-ASG-Whitelist: Client Received: from int-mx09.intmail.prod.int.phx2.redhat.com (int-mx09.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by mx1.redhat.com (Postfix) with ESMTPS id 8EC508C54D; Wed, 24 Feb 2016 19:49:38 +0000 (UTC) Received: from rh2.redhat.com (vpn-54-14.rdu2.redhat.com [10.10.54.14]) by int-mx09.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id u1OJmJEX006684; Wed, 24 Feb 2016 14:49:36 -0500 From: mchristi@redhat.com To: linux-f2fs-devel@lists.sourceforge.net, linux-ext4@vger.kernel.org, konrad.wilk@oracle.com, drbd-dev@lists.linbit.com, philipp.reisner@linbit.com, lars.ellenberg@linbit.com, linux-raid@vger.kernel.org, dm-devel@redhat.com, linux-fsdevel@vger.kernel.org, linux-bcache@vger.kernel.org, linux-block@vger.kernel.org, linux-kernel@vger.kernel.org, linux-scsi@vger.kernel.org, linux-mtd@lists.infradead.org, target-devel@vger.kernel.org, linux-btrfs@vger.kernel.org, osd-dev@open-osd.org, xfs@oss.sgi.com, ocfs2-devel@oss.oracle.com Cc: Mike Christie Subject: [PATCH 28/35] blktrace: get op from req->op/bio->bi_op Date: Wed, 24 Feb 2016 13:48:05 -0600 X-ASG-Orig-Subj: [PATCH 28/35] blktrace: get op from req->op/bio->bi_op Message-Id: <1456343292-14535-29-git-send-email-mchristi@redhat.com> In-Reply-To: <1456343292-14535-1-git-send-email-mchristi@redhat.com> References: <1456343292-14535-1-git-send-email-mchristi@redhat.com> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.22 X-Barracuda-Connect: mx1.redhat.com[209.132.183.28] X-Barracuda-Start-Time: 1456343378 X-Barracuda-Encrypted: ECDHE-RSA-AES256-GCM-SHA384 X-Barracuda-URL: https://192.48.157.11:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-BRTS-Status: 1 From: Mike Christie The bio and request struct now store the operation in bio->bi_op/request->op. This patch has blktrace not check bi_rw/cmd_flags. This patch is only compile tested. Signed-off-by: Mike Christie --- include/linux/blktrace_api.h | 2 +- include/trace/events/bcache.h | 12 ++++++---- include/trace/events/block.h | 31 +++++++++++++++++--------- kernel/trace/blktrace.c | 52 +++++++++++++++++++++++-------------------- 4 files changed, 57 insertions(+), 40 deletions(-) diff --git a/include/linux/blktrace_api.h b/include/linux/blktrace_api.h index afc1343..ee25ba4 100644 --- a/include/linux/blktrace_api.h +++ b/include/linux/blktrace_api.h @@ -109,7 +109,7 @@ static inline int blk_cmd_buf_len(struct request *rq) } extern void blk_dump_cmd(char *buf, struct request *rq); -extern void blk_fill_rwbs(char *rwbs, u32 rw, int bytes); +extern void blk_fill_rwbs(char *rwbs, int op, u32 rw, int bytes); #endif /* CONFIG_EVENT_TRACING && CONFIG_BLOCK */ diff --git a/include/trace/events/bcache.h b/include/trace/events/bcache.h index 981acf7..8abe564 100644 --- a/include/trace/events/bcache.h +++ b/include/trace/events/bcache.h @@ -27,7 +27,8 @@ DECLARE_EVENT_CLASS(bcache_request, __entry->sector = bio->bi_iter.bi_sector; __entry->orig_sector = bio->bi_iter.bi_sector - 16; __entry->nr_sector = bio->bi_iter.bi_size >> 9; - blk_fill_rwbs(__entry->rwbs, bio->bi_rw, bio->bi_iter.bi_size); + blk_fill_rwbs(__entry->rwbs, bio->bi_op, bio->bi_rw, + bio->bi_iter.bi_size); ), TP_printk("%d,%d %s %llu + %u (from %d,%d @ %llu)", @@ -101,7 +102,8 @@ DECLARE_EVENT_CLASS(bcache_bio, __entry->dev = bio->bi_bdev->bd_dev; __entry->sector = bio->bi_iter.bi_sector; __entry->nr_sector = bio->bi_iter.bi_size >> 9; - blk_fill_rwbs(__entry->rwbs, bio->bi_rw, bio->bi_iter.bi_size); + blk_fill_rwbs(__entry->rwbs, bio->bi_op, bio->bi_rw, + bio->bi_iter.bi_size); ), TP_printk("%d,%d %s %llu + %u", @@ -136,7 +138,8 @@ TRACE_EVENT(bcache_read, __entry->dev = bio->bi_bdev->bd_dev; __entry->sector = bio->bi_iter.bi_sector; __entry->nr_sector = bio->bi_iter.bi_size >> 9; - blk_fill_rwbs(__entry->rwbs, bio->bi_rw, bio->bi_iter.bi_size); + blk_fill_rwbs(__entry->rwbs, bio->bi_op, bio->bi_rw, + bio->bi_iter.bi_size); __entry->cache_hit = hit; __entry->bypass = bypass; ), @@ -167,7 +170,8 @@ TRACE_EVENT(bcache_write, __entry->inode = inode; __entry->sector = bio->bi_iter.bi_sector; __entry->nr_sector = bio->bi_iter.bi_size >> 9; - blk_fill_rwbs(__entry->rwbs, bio->bi_rw, bio->bi_iter.bi_size); + blk_fill_rwbs(__entry->rwbs, bio->bi_op, bio->bi_rw, + bio->bi_iter.bi_size); __entry->writeback = writeback; __entry->bypass = bypass; ), diff --git a/include/trace/events/block.h b/include/trace/events/block.h index e8a5eca..4416dcd 100644 --- a/include/trace/events/block.h +++ b/include/trace/events/block.h @@ -84,7 +84,8 @@ DECLARE_EVENT_CLASS(block_rq_with_error, 0 : blk_rq_sectors(rq); __entry->errors = rq->errors; - blk_fill_rwbs(__entry->rwbs, rq->cmd_flags, blk_rq_bytes(rq)); + blk_fill_rwbs(__entry->rwbs, rq->op, rq->cmd_flags, + blk_rq_bytes(rq)); blk_dump_cmd(__get_str(cmd), rq); ), @@ -162,7 +163,7 @@ TRACE_EVENT(block_rq_complete, __entry->nr_sector = nr_bytes >> 9; __entry->errors = rq->errors; - blk_fill_rwbs(__entry->rwbs, rq->cmd_flags, nr_bytes); + blk_fill_rwbs(__entry->rwbs, rq->op, rq->cmd_flags, nr_bytes); blk_dump_cmd(__get_str(cmd), rq); ), @@ -198,7 +199,8 @@ DECLARE_EVENT_CLASS(block_rq, __entry->bytes = (rq->cmd_type == REQ_TYPE_BLOCK_PC) ? blk_rq_bytes(rq) : 0; - blk_fill_rwbs(__entry->rwbs, rq->cmd_flags, blk_rq_bytes(rq)); + blk_fill_rwbs(__entry->rwbs, rq->op, rq->cmd_flags, + blk_rq_bytes(rq)); blk_dump_cmd(__get_str(cmd), rq); memcpy(__entry->comm, current->comm, TASK_COMM_LEN); ), @@ -272,7 +274,8 @@ TRACE_EVENT(block_bio_bounce, bio->bi_bdev->bd_dev : 0; __entry->sector = bio->bi_iter.bi_sector; __entry->nr_sector = bio_sectors(bio); - blk_fill_rwbs(__entry->rwbs, bio->bi_rw, bio->bi_iter.bi_size); + blk_fill_rwbs(__entry->rwbs, bio->bi_op, bio->bi_rw, + bio->bi_iter.bi_size); memcpy(__entry->comm, current->comm, TASK_COMM_LEN); ), @@ -310,7 +313,8 @@ TRACE_EVENT(block_bio_complete, __entry->sector = bio->bi_iter.bi_sector; __entry->nr_sector = bio_sectors(bio); __entry->error = error; - blk_fill_rwbs(__entry->rwbs, bio->bi_rw, bio->bi_iter.bi_size); + blk_fill_rwbs(__entry->rwbs, bio->bi_op, bio->bi_rw, + bio->bi_iter.bi_size); ), TP_printk("%d,%d %s %llu + %u [%d]", @@ -337,7 +341,8 @@ DECLARE_EVENT_CLASS(block_bio_merge, __entry->dev = bio->bi_bdev->bd_dev; __entry->sector = bio->bi_iter.bi_sector; __entry->nr_sector = bio_sectors(bio); - blk_fill_rwbs(__entry->rwbs, bio->bi_rw, bio->bi_iter.bi_size); + blk_fill_rwbs(__entry->rwbs, bio->bi_op, bio->bi_rw, + bio->bi_iter.bi_size); memcpy(__entry->comm, current->comm, TASK_COMM_LEN); ), @@ -404,7 +409,8 @@ TRACE_EVENT(block_bio_queue, __entry->dev = bio->bi_bdev->bd_dev; __entry->sector = bio->bi_iter.bi_sector; __entry->nr_sector = bio_sectors(bio); - blk_fill_rwbs(__entry->rwbs, bio->bi_rw, bio->bi_iter.bi_size); + blk_fill_rwbs(__entry->rwbs, bio->bi_op, bio->bi_rw, + bio->bi_iter.bi_size); memcpy(__entry->comm, current->comm, TASK_COMM_LEN); ), @@ -432,7 +438,7 @@ DECLARE_EVENT_CLASS(block_get_rq, __entry->dev = bio ? bio->bi_bdev->bd_dev : 0; __entry->sector = bio ? bio->bi_iter.bi_sector : 0; __entry->nr_sector = bio ? bio_sectors(bio) : 0; - blk_fill_rwbs(__entry->rwbs, + blk_fill_rwbs(__entry->rwbs, bio ? bio->bi_op : 0, bio ? bio->bi_rw : 0, __entry->nr_sector); memcpy(__entry->comm, current->comm, TASK_COMM_LEN); ), @@ -567,7 +573,8 @@ TRACE_EVENT(block_split, __entry->dev = bio->bi_bdev->bd_dev; __entry->sector = bio->bi_iter.bi_sector; __entry->new_sector = new_sector; - blk_fill_rwbs(__entry->rwbs, bio->bi_rw, bio->bi_iter.bi_size); + blk_fill_rwbs(__entry->rwbs, bio->bi_op, bio->bi_rw, + bio->bi_iter.bi_size); memcpy(__entry->comm, current->comm, TASK_COMM_LEN); ), @@ -610,7 +617,8 @@ TRACE_EVENT(block_bio_remap, __entry->nr_sector = bio_sectors(bio); __entry->old_dev = dev; __entry->old_sector = from; - blk_fill_rwbs(__entry->rwbs, bio->bi_rw, bio->bi_iter.bi_size); + blk_fill_rwbs(__entry->rwbs, bio->bi_op, bio->bi_rw, + bio->bi_iter.bi_size); ), TP_printk("%d,%d %s %llu + %u <- (%d,%d) %llu", @@ -656,7 +664,8 @@ TRACE_EVENT(block_rq_remap, __entry->old_dev = dev; __entry->old_sector = from; __entry->nr_bios = blk_rq_count_bios(rq); - blk_fill_rwbs(__entry->rwbs, rq->cmd_flags, blk_rq_bytes(rq)); + blk_fill_rwbs(__entry->rwbs, rq->op, rq->cmd_flags, + blk_rq_bytes(rq)); ), TP_printk("%d,%d %s %llu + %u <- (%d,%d) %llu %u", diff --git a/kernel/trace/blktrace.c b/kernel/trace/blktrace.c index 2aeb6ff..4a9ac83 100644 --- a/kernel/trace/blktrace.c +++ b/kernel/trace/blktrace.c @@ -199,7 +199,8 @@ static const u32 ddir_act[2] = { BLK_TC_ACT(BLK_TC_READ), * blk_io_trace structure and places it in a per-cpu subbuffer. */ static void __blk_add_trace(struct blk_trace *bt, sector_t sector, int bytes, - int rw, u32 what, int error, int pdu_len, void *pdu_data) + int op, int op_flags, u32 what, int error, int pdu_len, + void *pdu_data) { struct task_struct *tsk = current; struct ring_buffer_event *event = NULL; @@ -214,13 +215,14 @@ static void __blk_add_trace(struct blk_trace *bt, sector_t sector, int bytes, if (unlikely(bt->trace_state != Blktrace_running && !blk_tracer)) return; - what |= ddir_act[rw & WRITE]; - what |= MASK_TC_BIT(rw, SYNC); - what |= MASK_TC_BIT(rw, RAHEAD); - what |= MASK_TC_BIT(rw, META); - what |= MASK_TC_BIT(rw, DISCARD); - what |= MASK_TC_BIT(rw, FLUSH); - what |= MASK_TC_BIT(rw, FUA); + what |= ddir_act[op_is_write(op) ? WRITE : READ]; + what |= MASK_TC_BIT(op_flags, SYNC); + what |= MASK_TC_BIT(op_flags, RAHEAD); + what |= MASK_TC_BIT(op_flags, META); + what |= MASK_TC_BIT(op_flags, FLUSH); + what |= MASK_TC_BIT(op_flags, FUA); + if (op == REQ_OP_DISCARD) + what |= BLK_TC_ACT(BLK_TC_DISCARD); pid = tsk->pid; if (act_log_check(bt, what, sector, pid)) @@ -708,11 +710,11 @@ static void blk_add_trace_rq(struct request_queue *q, struct request *rq, if (rq->cmd_type == REQ_TYPE_BLOCK_PC) { what |= BLK_TC_ACT(BLK_TC_PC); - __blk_add_trace(bt, 0, nr_bytes, rq->cmd_flags, + __blk_add_trace(bt, 0, nr_bytes, rq->op, rq->cmd_flags, what, rq->errors, rq->cmd_len, rq->cmd); } else { what |= BLK_TC_ACT(BLK_TC_FS); - __blk_add_trace(bt, blk_rq_pos(rq), nr_bytes, + __blk_add_trace(bt, blk_rq_pos(rq), nr_bytes, rq->op, rq->cmd_flags, what, rq->errors, 0, NULL); } } @@ -770,7 +772,7 @@ static void blk_add_trace_bio(struct request_queue *q, struct bio *bio, return; __blk_add_trace(bt, bio->bi_iter.bi_sector, bio->bi_iter.bi_size, - bio->bi_rw, what, error, 0, NULL); + bio->bi_op, bio->bi_rw, what, error, 0, NULL); } static void blk_add_trace_bio_bounce(void *ignore, @@ -818,7 +820,8 @@ static void blk_add_trace_getrq(void *ignore, struct blk_trace *bt = q->blk_trace; if (bt) - __blk_add_trace(bt, 0, 0, rw, BLK_TA_GETRQ, 0, 0, NULL); + __blk_add_trace(bt, 0, 0, rw, 0, BLK_TA_GETRQ, 0, 0, + NULL); } } @@ -833,7 +836,7 @@ static void blk_add_trace_sleeprq(void *ignore, struct blk_trace *bt = q->blk_trace; if (bt) - __blk_add_trace(bt, 0, 0, rw, BLK_TA_SLEEPRQ, + __blk_add_trace(bt, 0, 0, rw, 0, BLK_TA_SLEEPRQ, 0, 0, NULL); } } @@ -843,7 +846,7 @@ static void blk_add_trace_plug(void *ignore, struct request_queue *q) struct blk_trace *bt = q->blk_trace; if (bt) - __blk_add_trace(bt, 0, 0, 0, BLK_TA_PLUG, 0, 0, NULL); + __blk_add_trace(bt, 0, 0, 0, 0, BLK_TA_PLUG, 0, 0, NULL); } static void blk_add_trace_unplug(void *ignore, struct request_queue *q, @@ -860,7 +863,7 @@ static void blk_add_trace_unplug(void *ignore, struct request_queue *q, else what = BLK_TA_UNPLUG_TIMER; - __blk_add_trace(bt, 0, 0, 0, what, 0, sizeof(rpdu), &rpdu); + __blk_add_trace(bt, 0, 0, 0, 0, what, 0, sizeof(rpdu), &rpdu); } } @@ -874,8 +877,9 @@ static void blk_add_trace_split(void *ignore, __be64 rpdu = cpu_to_be64(pdu); __blk_add_trace(bt, bio->bi_iter.bi_sector, - bio->bi_iter.bi_size, bio->bi_rw, BLK_TA_SPLIT, - bio->bi_error, sizeof(rpdu), &rpdu); + bio->bi_iter.bi_size, bio->bi_op, bio->bi_rw, + BLK_TA_SPLIT, bio->bi_error, sizeof(rpdu), + &rpdu); } } @@ -907,7 +911,7 @@ static void blk_add_trace_bio_remap(void *ignore, r.sector_from = cpu_to_be64(from); __blk_add_trace(bt, bio->bi_iter.bi_sector, bio->bi_iter.bi_size, - bio->bi_rw, BLK_TA_REMAP, bio->bi_error, + bio->bi_op, bio->bi_rw, BLK_TA_REMAP, bio->bi_error, sizeof(r), &r); } @@ -940,7 +944,7 @@ static void blk_add_trace_rq_remap(void *ignore, r.sector_from = cpu_to_be64(from); __blk_add_trace(bt, blk_rq_pos(rq), blk_rq_bytes(rq), - rq_data_dir(rq), BLK_TA_REMAP, !!rq->errors, + rq_data_dir(rq), 0, BLK_TA_REMAP, !!rq->errors, sizeof(r), &r); } @@ -965,10 +969,10 @@ void blk_add_driver_data(struct request_queue *q, return; if (rq->cmd_type == REQ_TYPE_BLOCK_PC) - __blk_add_trace(bt, 0, blk_rq_bytes(rq), 0, + __blk_add_trace(bt, 0, blk_rq_bytes(rq), 0, 0, BLK_TA_DRV_DATA, rq->errors, len, data); else - __blk_add_trace(bt, blk_rq_pos(rq), blk_rq_bytes(rq), 0, + __blk_add_trace(bt, blk_rq_pos(rq), blk_rq_bytes(rq), 0, 0, BLK_TA_DRV_DATA, rq->errors, len, data); } EXPORT_SYMBOL_GPL(blk_add_driver_data); @@ -1767,16 +1771,16 @@ void blk_dump_cmd(char *buf, struct request *rq) } } -void blk_fill_rwbs(char *rwbs, u32 rw, int bytes) +void blk_fill_rwbs(char *rwbs, int op, u32 rw, int bytes) { int i = 0; if (rw & REQ_FLUSH) rwbs[i++] = 'F'; - if (rw & WRITE) + if (op == REQ_OP_WRITE) rwbs[i++] = 'W'; - else if (rw & REQ_DISCARD) + else if (op == REQ_OP_DISCARD) rwbs[i++] = 'D'; else if (bytes) rwbs[i++] = 'R'; -- 1.8.3.1 From mchristi@redhat.com Wed Feb 24 13:49:48 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=ham version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay1.corp.sgi.com [137.38.102.111]) by oss.sgi.com (Postfix) with ESMTP id B81457F6F for ; Wed, 24 Feb 2016 13:49:48 -0600 (CST) Received: from cuda.sgi.com (cuda3.sgi.com [192.48.176.15]) by relay1.corp.sgi.com (Postfix) with ESMTP id 7C5C68F8037 for ; Wed, 24 Feb 2016 11:49:42 -0800 (PST) X-ASG-Debug-ID: 1456343381-04cb6c455ad5a70001-NocioJ Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by cuda.sgi.com with ESMTP id rut048unJl1BcdEg (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO) for ; Wed, 24 Feb 2016 11:49:41 -0800 (PST) X-Barracuda-Envelope-From: mchristi@redhat.com X-Barracuda-Apparent-Source-IP: 209.132.183.28 X-ASG-Whitelist: Client Received: from int-mx09.intmail.prod.int.phx2.redhat.com (int-mx09.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by mx1.redhat.com (Postfix) with ESMTPS id 3066819CBA9; Wed, 24 Feb 2016 19:49:41 +0000 (UTC) Received: from rh2.redhat.com (vpn-54-14.rdu2.redhat.com [10.10.54.14]) by int-mx09.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id u1OJmJEY006684; Wed, 24 Feb 2016 14:49:38 -0500 From: mchristi@redhat.com To: linux-f2fs-devel@lists.sourceforge.net, linux-ext4@vger.kernel.org, konrad.wilk@oracle.com, drbd-dev@lists.linbit.com, philipp.reisner@linbit.com, lars.ellenberg@linbit.com, linux-raid@vger.kernel.org, dm-devel@redhat.com, linux-fsdevel@vger.kernel.org, linux-bcache@vger.kernel.org, linux-block@vger.kernel.org, linux-kernel@vger.kernel.org, linux-scsi@vger.kernel.org, linux-mtd@lists.infradead.org, target-devel@vger.kernel.org, linux-btrfs@vger.kernel.org, osd-dev@open-osd.org, xfs@oss.sgi.com, ocfs2-devel@oss.oracle.com Cc: Mike Christie Subject: [PATCH 29/35] ide cd: do not set REQ_WRITE on requests. Date: Wed, 24 Feb 2016 13:48:06 -0600 X-ASG-Orig-Subj: [PATCH 29/35] ide cd: do not set REQ_WRITE on requests. Message-Id: <1456343292-14535-30-git-send-email-mchristi@redhat.com> In-Reply-To: <1456343292-14535-1-git-send-email-mchristi@redhat.com> References: <1456343292-14535-1-git-send-email-mchristi@redhat.com> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.22 X-Barracuda-Connect: mx1.redhat.com[209.132.183.28] X-Barracuda-Start-Time: 1456343381 X-Barracuda-Encrypted: ECDHE-RSA-AES256-GCM-SHA384 X-Barracuda-URL: https://192.48.176.15:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-BRTS-Status: 1 From: Mike Christie The block layer will set the correct READ/WRITE operation flags/fields when creating a request, so there is not need for drivers to set the REQ_WRITE flag. This patch is compile tested only. Signed-off-by: Mike Christie --- drivers/ide/ide-cd_ioctl.c | 3 --- 1 file changed, 3 deletions(-) diff --git a/drivers/ide/ide-cd_ioctl.c b/drivers/ide/ide-cd_ioctl.c index 474173e..5887a7a 100644 --- a/drivers/ide/ide-cd_ioctl.c +++ b/drivers/ide/ide-cd_ioctl.c @@ -459,9 +459,6 @@ int ide_cdrom_packet(struct cdrom_device_info *cdi, layer. the packet must be complete, as we do not touch it at all. */ - if (cgc->data_direction == CGC_DATA_WRITE) - flags |= REQ_WRITE; - if (cgc->sense) memset(cgc->sense, 0, sizeof(struct request_sense)); -- 1.8.3.1 From mchristi@redhat.com Wed Feb 24 13:49:54 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=ham version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay3.corp.sgi.com [198.149.34.15]) by oss.sgi.com (Postfix) with ESMTP id 8A9677CB9 for ; Wed, 24 Feb 2016 13:49:54 -0600 (CST) Received: from cuda.sgi.com (cuda2.sgi.com [192.48.176.25]) by relay3.corp.sgi.com (Postfix) with ESMTP id CF7E4AC002 for ; Wed, 24 Feb 2016 11:49:47 -0800 (PST) X-ASG-Debug-ID: 1456343384-04cbb06adffd420001-NocioJ Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by cuda.sgi.com with ESMTP id pnNHIfOdc6urilEE (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO) for ; Wed, 24 Feb 2016 11:49:44 -0800 (PST) X-Barracuda-Envelope-From: mchristi@redhat.com X-Barracuda-Apparent-Source-IP: 209.132.183.28 X-ASG-Whitelist: Client Received: from int-mx09.intmail.prod.int.phx2.redhat.com (int-mx09.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by mx1.redhat.com (Postfix) with ESMTPS id D5AC7804F0; Wed, 24 Feb 2016 19:49:43 +0000 (UTC) Received: from rh2.redhat.com (vpn-54-14.rdu2.redhat.com [10.10.54.14]) by int-mx09.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id u1OJmJEZ006684; Wed, 24 Feb 2016 14:49:41 -0500 From: mchristi@redhat.com To: linux-f2fs-devel@lists.sourceforge.net, linux-ext4@vger.kernel.org, konrad.wilk@oracle.com, drbd-dev@lists.linbit.com, philipp.reisner@linbit.com, lars.ellenberg@linbit.com, linux-raid@vger.kernel.org, dm-devel@redhat.com, linux-fsdevel@vger.kernel.org, linux-bcache@vger.kernel.org, linux-block@vger.kernel.org, linux-kernel@vger.kernel.org, linux-scsi@vger.kernel.org, linux-mtd@lists.infradead.org, target-devel@vger.kernel.org, linux-btrfs@vger.kernel.org, osd-dev@open-osd.org, xfs@oss.sgi.com, ocfs2-devel@oss.oracle.com Cc: Mike Christie Subject: [PATCH 30/35] block, fs, drivers: do not test bi_rw for REQ_OPs Date: Wed, 24 Feb 2016 13:48:07 -0600 X-ASG-Orig-Subj: [PATCH 30/35] block, fs, drivers: do not test bi_rw for REQ_OPs Message-Id: <1456343292-14535-31-git-send-email-mchristi@redhat.com> In-Reply-To: <1456343292-14535-1-git-send-email-mchristi@redhat.com> References: <1456343292-14535-1-git-send-email-mchristi@redhat.com> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.22 X-Barracuda-Connect: mx1.redhat.com[209.132.183.28] X-Barracuda-Start-Time: 1456343384 X-Barracuda-Encrypted: ECDHE-RSA-AES256-GCM-SHA384 X-Barracuda-URL: https://192.48.176.25:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-BRTS-Status: 1 From: Mike Christie We no longer use the bio->bi_rw field for REQ_OPs: REQ_WRITE, REQ_DISCARD, REQ_WRITE_SAME, so this patch stops checking for them in bi_rw and also removes the related compat code. v2: 1. Remove compat code in __get_request. Signed-off-by: Mike Christie --- block/bio.c | 6 ++--- block/blk-core.c | 34 ++++++++--------------------- block/blk-merge.c | 14 ++++++------ block/blk-mq.c | 3 +-- drivers/ata/libata-scsi.c | 2 +- drivers/block/brd.c | 2 +- drivers/block/drbd/drbd_main.c | 15 +++++++------ drivers/block/drbd/drbd_worker.c | 4 ++-- drivers/block/loop.c | 6 ++--- drivers/block/rbd.c | 2 +- drivers/block/rsxx/dma.c | 2 +- drivers/block/umem.c | 2 +- drivers/block/zram/zram_drv.c | 2 +- drivers/ide/ide-floppy.c | 2 +- drivers/lightnvm/rrpc.c | 2 +- drivers/md/bcache/request.c | 10 ++++----- drivers/md/dm-cache-target.c | 10 +++++---- drivers/md/dm-crypt.c | 2 +- drivers/md/dm-log-writes.c | 2 +- drivers/md/dm-raid1.c | 8 +++---- drivers/md/dm-region-hash.c | 4 ++-- drivers/md/dm-stripe.c | 4 ++-- drivers/md/dm-thin.c | 15 ++++++++----- drivers/md/dm.c | 6 ++--- drivers/md/linear.c | 2 +- drivers/md/raid0.c | 2 +- drivers/scsi/osd/osd_initiator.c | 4 ++-- drivers/staging/lustre/lustre/llite/lloop.c | 8 +++---- include/linux/bio.h | 15 ++++++++----- include/linux/fs.h | 25 +++++++-------------- 30 files changed, 100 insertions(+), 115 deletions(-) diff --git a/block/bio.c b/block/bio.c index 68df2df..fba4c08 100644 --- a/block/bio.c +++ b/block/bio.c @@ -669,10 +669,10 @@ struct bio *bio_clone_bioset(struct bio *bio_src, gfp_t gfp_mask, bio->bi_iter.bi_sector = bio_src->bi_iter.bi_sector; bio->bi_iter.bi_size = bio_src->bi_iter.bi_size; - if (bio->bi_rw & REQ_DISCARD) + if (bio->bi_op == REQ_OP_DISCARD) goto integrity_clone; - if (bio->bi_rw & REQ_WRITE_SAME) { + if (bio->bi_op == REQ_OP_WRITE_SAME) { bio->bi_io_vec[bio->bi_vcnt++] = bio_src->bi_io_vec[0]; goto integrity_clone; } @@ -1795,7 +1795,7 @@ struct bio *bio_split(struct bio *bio, int sectors, * Discards need a mutable bio_vec to accommodate the payload * required by the DSM TRIM and UNMAP commands. */ - if (bio->bi_rw & REQ_DISCARD) + if (bio->bi_op == REQ_OP_DISCARD) split = bio_clone_bioset(bio, gfp, bs); else split = bio_clone_fast(bio, gfp, bs); diff --git a/block/blk-core.c b/block/blk-core.c index 60a0edb..bba1a69 100644 --- a/block/blk-core.c +++ b/block/blk-core.c @@ -1151,8 +1151,7 @@ static struct request *__get_request(struct request_list *rl, int op, blk_rq_init(q, rq); blk_rq_set_rl(rq, rl); - /* tmp compat - allow users to check either one for the op */ - rq->cmd_flags = op | op_flags | REQ_ALLOCED; + rq->cmd_flags = op_flags | REQ_ALLOCED; rq->op = op; /* init elvpriv */ @@ -1704,8 +1703,7 @@ void init_request_from_bio(struct request *req, struct bio *bio) { req->cmd_type = REQ_TYPE_FS; - /* tmp compat. Allow users to set bi_op or bi_rw */ - req->cmd_flags |= (bio->bi_rw | bio->bi_op) & REQ_COMMON_MASK; + req->cmd_flags |= bio->bi_rw & REQ_COMMON_MASK; if (bio->bi_rw & REQ_RAHEAD) req->cmd_flags |= REQ_FAILFAST_MASK; @@ -1855,9 +1853,9 @@ static void handle_bad_sector(struct bio *bio) char b[BDEVNAME_SIZE]; printk(KERN_INFO "attempt to access beyond end of device\n"); - printk(KERN_INFO "%s: rw=%ld, want=%Lu, limit=%Lu\n", + printk(KERN_INFO "%s: rw=%d,%ld, want=%Lu, limit=%Lu\n", bdevname(bio->bi_bdev, b), - bio->bi_rw, + bio->bi_op, bio->bi_rw, (unsigned long long)bio_end_sector(bio), (long long)(i_size_read(bio->bi_bdev->bd_inode) >> 9)); } @@ -1978,14 +1976,14 @@ generic_make_request_checks(struct bio *bio) } } - if ((bio->bi_rw & REQ_DISCARD) && + if ((bio->bi_op == REQ_OP_DISCARD) && (!blk_queue_discard(q) || ((bio->bi_rw & REQ_SECURE) && !blk_queue_secdiscard(q)))) { err = -EOPNOTSUPP; goto end_io; } - if (bio->bi_rw & REQ_WRITE_SAME && !bdev_write_same(bio->bi_bdev)) { + if (bio->bi_op == REQ_OP_WRITE_SAME && !bdev_write_same(bio->bi_bdev)) { err = -EOPNOTSUPP; goto end_io; } @@ -2039,12 +2037,6 @@ blk_qc_t generic_make_request(struct bio *bio) struct bio_list bio_list_on_stack; blk_qc_t ret = BLK_QC_T_NONE; - /* tmp compat. Allow users to set either one or both. - * This will be removed when we have converted - * everyone in the next patches. - */ - bio->bi_rw |= bio->bi_op; - if (!generic_make_request_checks(bio)) goto out; @@ -2114,12 +2106,6 @@ EXPORT_SYMBOL(generic_make_request); */ blk_qc_t submit_bio(struct bio *bio) { - /* tmp compat. Allow users to set either one or both. - * This will be removed when we have converted - * everyone in the next patches. - */ - bio->bi_rw |= bio->bi_op; - /* * If it's a regular read/write or a barrier with data attached, * go through the normal accounting stuff before submission. @@ -2127,12 +2113,12 @@ blk_qc_t submit_bio(struct bio *bio) if (bio_has_data(bio)) { unsigned int count; - if (unlikely(bio->bi_rw & REQ_WRITE_SAME)) + if (unlikely(bio->bi_op == REQ_OP_WRITE_SAME)) count = bdev_logical_block_size(bio->bi_bdev) >> 9; else count = bio_sectors(bio); - if (bio->bi_rw & WRITE) { + if (op_is_write(bio->bi_op)) { count_vm_events(PGPGOUT, count); } else { task_io_account_read(bio->bi_iter.bi_size); @@ -2143,7 +2129,7 @@ blk_qc_t submit_bio(struct bio *bio) char b[BDEVNAME_SIZE]; printk(KERN_DEBUG "%s(%d): %s block %Lu on %s (%u sectors)\n", current->comm, task_pid_nr(current), - (bio->bi_rw & WRITE) ? "WRITE" : "READ", + op_is_write(bio->bi_op) ? "WRITE" : "READ", (unsigned long long)bio->bi_iter.bi_sector, bdevname(bio->bi_bdev, b), count); @@ -2993,8 +2979,6 @@ EXPORT_SYMBOL_GPL(__blk_end_request_err); void blk_rq_bio_prep(struct request_queue *q, struct request *rq, struct bio *bio) { - /* tmp compat. Allow users to set bi_op or bi_rw */ - rq->cmd_flags |= bio_data_dir(bio); rq->op = bio->bi_op; if (bio_has_data(bio)) diff --git a/block/blk-merge.c b/block/blk-merge.c index f9e012e..e559864 100644 --- a/block/blk-merge.c +++ b/block/blk-merge.c @@ -172,9 +172,9 @@ void blk_queue_split(struct request_queue *q, struct bio **bio, struct bio *split, *res; unsigned nsegs; - if ((*bio)->bi_rw & REQ_DISCARD) + if ((*bio)->bi_op == REQ_OP_DISCARD) split = blk_bio_discard_split(q, *bio, bs, &nsegs); - else if ((*bio)->bi_rw & REQ_WRITE_SAME) + else if ((*bio)->bi_op == REQ_OP_WRITE_SAME) split = blk_bio_write_same_split(q, *bio, bs, &nsegs); else split = blk_bio_segment_split(q, *bio, q->bio_split, &nsegs); @@ -213,10 +213,10 @@ static unsigned int __blk_recalc_rq_segments(struct request_queue *q, * This should probably be returning 0, but blk_add_request_payload() * (Christoph!!!!) */ - if (bio->bi_rw & REQ_DISCARD) + if (bio->bi_op == REQ_OP_DISCARD) return 1; - if (bio->bi_rw & REQ_WRITE_SAME) + if (bio->bi_op == REQ_OP_WRITE_SAME) return 1; fbio = bio; @@ -389,7 +389,7 @@ static int __blk_bios_map_sg(struct request_queue *q, struct bio *bio, nsegs = 0; cluster = blk_queue_cluster(q); - if (bio->bi_rw & REQ_DISCARD) { + if (bio->bi_op == REQ_OP_DISCARD) { /* * This is a hack - drivers should be neither modifying the * biovec, nor relying on bi_vcnt - but because of @@ -404,7 +404,7 @@ static int __blk_bios_map_sg(struct request_queue *q, struct bio *bio, return 0; } - if (bio->bi_rw & REQ_WRITE_SAME) { + if (bio->bi_op == REQ_OP_WRITE_SAME) { single_segment: *sg = sglist; bvec = bio_iovec(bio); @@ -443,7 +443,7 @@ int blk_rq_map_sg(struct request_queue *q, struct request *rq, } if (q->dma_drain_size && q->dma_drain_needed(rq)) { - if (rq->cmd_flags & REQ_WRITE) + if (op_is_write(rq->op)) memset(q->dma_drain_buffer, 0, q->dma_drain_size); sg_unmark_end(sg); diff --git a/block/blk-mq.c b/block/blk-mq.c index 5581bac..c3ac92e 100644 --- a/block/blk-mq.c +++ b/block/blk-mq.c @@ -170,8 +170,7 @@ static void blk_mq_rq_ctx_init(struct request_queue *q, struct blk_mq_ctx *ctx, rq->q = q; rq->mq_ctx = ctx; rq->op = op; - /* tmp compat - allow users to check either one for the op */ - rq->cmd_flags |= op | op_flags; + rq->cmd_flags |= op_flags; /* do not touch atomic flags, it needs atomic ops against the timer */ rq->cpu = -1; INIT_HLIST_NODE(&rq->hash); diff --git a/drivers/ata/libata-scsi.c b/drivers/ata/libata-scsi.c index 567859c..cfebc5d 100644 --- a/drivers/ata/libata-scsi.c +++ b/drivers/ata/libata-scsi.c @@ -1124,7 +1124,7 @@ static int atapi_drain_needed(struct request *rq) if (likely(rq->cmd_type != REQ_TYPE_BLOCK_PC)) return 0; - if (!blk_rq_bytes(rq) || (rq->cmd_flags & REQ_WRITE)) + if (!blk_rq_bytes(rq) || op_is_write(rq->op)) return 0; return atapi_cmd_type(rq->cmd[0]) == ATAPI_MISC; diff --git a/drivers/block/brd.c b/drivers/block/brd.c index cb27190..200284b 100644 --- a/drivers/block/brd.c +++ b/drivers/block/brd.c @@ -339,7 +339,7 @@ static blk_qc_t brd_make_request(struct request_queue *q, struct bio *bio) if (bio_end_sector(bio) > get_capacity(bdev->bd_disk)) goto io_error; - if (unlikely(bio->bi_rw & REQ_DISCARD)) { + if (unlikely(bio->bi_op == REQ_OP_DISCARD)) { if (sector & ((PAGE_SIZE >> SECTOR_SHIFT) - 1) || bio->bi_iter.bi_size & PAGE_MASK) goto io_error; diff --git a/drivers/block/drbd/drbd_main.c b/drivers/block/drbd/drbd_main.c index 4ccfd17..3a93fd2 100644 --- a/drivers/block/drbd/drbd_main.c +++ b/drivers/block/drbd/drbd_main.c @@ -1603,15 +1603,16 @@ static int _drbd_send_zc_ee(struct drbd_peer_device *peer_device, return 0; } -static u32 bio_flags_to_wire(struct drbd_connection *connection, unsigned long bi_rw) +static u32 bio_flags_to_wire(struct drbd_connection *connection, + struct bio *bio) { if (connection->agreed_pro_version >= 95) - return (bi_rw & REQ_SYNC ? DP_RW_SYNC : 0) | - (bi_rw & REQ_FUA ? DP_FUA : 0) | - (bi_rw & REQ_FLUSH ? DP_FLUSH : 0) | - (bi_rw & REQ_DISCARD ? DP_DISCARD : 0); + return (bio->bi_rw & REQ_SYNC ? DP_RW_SYNC : 0) | + (bio->bi_rw & REQ_FUA ? DP_FUA : 0) | + (bio->bi_rw & REQ_FLUSH ? DP_FLUSH : 0) | + (bio->bi_op == REQ_OP_DISCARD ? DP_DISCARD : 0); else - return bi_rw & REQ_SYNC ? DP_RW_SYNC : 0; + return bio->bi_rw & REQ_SYNC ? DP_RW_SYNC : 0; } /* Used to send write or TRIM aka REQ_DISCARD requests @@ -1636,7 +1637,7 @@ int drbd_send_dblock(struct drbd_peer_device *peer_device, struct drbd_request * p->sector = cpu_to_be64(req->i.sector); p->block_id = (unsigned long)req; p->seq_num = cpu_to_be32(atomic_inc_return(&device->packet_seq)); - dp_flags = bio_flags_to_wire(peer_device->connection, req->master_bio->bi_rw); + dp_flags = bio_flags_to_wire(peer_device->connection, req->master_bio); if (device->state.conn >= C_SYNC_SOURCE && device->state.conn <= C_PAUSED_SYNC_T) dp_flags |= DP_MAY_SET_IN_SYNC; diff --git a/drivers/block/drbd/drbd_worker.c b/drivers/block/drbd/drbd_worker.c index 2a04b43..0949961 100644 --- a/drivers/block/drbd/drbd_worker.c +++ b/drivers/block/drbd/drbd_worker.c @@ -174,7 +174,7 @@ void drbd_peer_request_endio(struct bio *bio) struct drbd_peer_request *peer_req = bio->bi_private; struct drbd_device *device = peer_req->peer_device->device; int is_write = bio_data_dir(bio) == WRITE; - int is_discard = !!(bio->bi_rw & REQ_DISCARD); + int is_discard = !!(bio->bi_op == REQ_OP_DISCARD); if (bio->bi_error && __ratelimit(&drbd_ratelimit_state)) drbd_warn(device, "%s: error=%d s=%llus\n", @@ -248,7 +248,7 @@ void drbd_request_endio(struct bio *bio) /* to avoid recursion in __req_mod */ if (unlikely(bio->bi_error)) { - if (bio->bi_rw & REQ_DISCARD) + if (bio->bi_op == REQ_OP_DISCARD) what = (bio->bi_error == -EOPNOTSUPP) ? DISCARD_COMPLETED_NOTSUPP : DISCARD_COMPLETED_WITH_ERROR; diff --git a/drivers/block/loop.c b/drivers/block/loop.c index e771bab..1afc03c 100644 --- a/drivers/block/loop.c +++ b/drivers/block/loop.c @@ -447,7 +447,7 @@ static int lo_req_flush(struct loop_device *lo, struct request *rq) static inline void handle_partial_read(struct loop_cmd *cmd, long bytes) { - if (bytes < 0 || (cmd->rq->cmd_flags & REQ_WRITE)) + if (bytes < 0 || op_is_write(cmd->rq->op)) return; if (unlikely(bytes < blk_rq_bytes(cmd->rq))) { @@ -535,7 +535,7 @@ static int do_req_filebacked(struct loop_device *lo, struct request *rq) pos = ((loff_t) blk_rq_pos(rq) << 9) + lo->lo_offset; - if (rq->cmd_flags & REQ_WRITE) { + if (op_is_write(rq->op)) { if (rq->cmd_flags & REQ_FLUSH) ret = lo_req_flush(lo, rq); else if (rq->op == REQ_OP_DISCARD) @@ -1666,7 +1666,7 @@ static int loop_queue_rq(struct blk_mq_hw_ctx *hctx, static void loop_handle_cmd(struct loop_cmd *cmd) { - const bool write = cmd->rq->cmd_flags & REQ_WRITE; + const bool write = op_is_write(cmd->rq->op); struct loop_device *lo = cmd->rq->q->queuedata; int ret = 0; diff --git a/drivers/block/rbd.c b/drivers/block/rbd.c index 1d0f464..721e82d 100644 --- a/drivers/block/rbd.c +++ b/drivers/block/rbd.c @@ -3375,7 +3375,7 @@ static void rbd_queue_workfn(struct work_struct *work) if (rq->op == REQ_OP_DISCARD) op_type = OBJ_OP_DISCARD; - else if (rq->cmd_flags & REQ_WRITE) + else if (rq->op == REQ_OP_WRITE) op_type = OBJ_OP_WRITE; else op_type = OBJ_OP_READ; diff --git a/drivers/block/rsxx/dma.c b/drivers/block/rsxx/dma.c index cf8cd29..dfc189e 100644 --- a/drivers/block/rsxx/dma.c +++ b/drivers/block/rsxx/dma.c @@ -705,7 +705,7 @@ int rsxx_dma_queue_bio(struct rsxx_cardinfo *card, dma_cnt[i] = 0; } - if (bio->bi_rw & REQ_DISCARD) { + if (bio->bi_op == REQ_OP_DISCARD) { bv_len = bio->bi_iter.bi_size; while (bv_len > 0) { diff --git a/drivers/block/umem.c b/drivers/block/umem.c index 7939b9f..a24ccbc 100644 --- a/drivers/block/umem.c +++ b/drivers/block/umem.c @@ -462,7 +462,7 @@ static void process_page(unsigned long data) le32_to_cpu(desc->local_addr)>>9, le32_to_cpu(desc->transfer_size)); dump_dmastat(card, control); - } else if ((bio->bi_rw & REQ_WRITE) && + } else if (op_is_write(bio->bi_op) && le32_to_cpu(desc->local_addr) >> 9 == card->init_size) { card->init_size += le32_to_cpu(desc->transfer_size) >> 9; diff --git a/drivers/block/zram/zram_drv.c b/drivers/block/zram/zram_drv.c index 46055db..22c6e00 100644 --- a/drivers/block/zram/zram_drv.c +++ b/drivers/block/zram/zram_drv.c @@ -852,7 +852,7 @@ static void __zram_make_request(struct zram *zram, struct bio *bio) offset = (bio->bi_iter.bi_sector & (SECTORS_PER_PAGE - 1)) << SECTOR_SHIFT; - if (unlikely(bio->bi_rw & REQ_DISCARD)) { + if (unlikely(bio->bi_op == REQ_OP_DISCARD)) { zram_bio_discard(zram, index, offset, bio); bio_endio(bio); return; diff --git a/drivers/ide/ide-floppy.c b/drivers/ide/ide-floppy.c index 2fb5350..f079d8d 100644 --- a/drivers/ide/ide-floppy.c +++ b/drivers/ide/ide-floppy.c @@ -206,7 +206,7 @@ static void idefloppy_create_rw_cmd(ide_drive_t *drive, memcpy(rq->cmd, pc->c, 12); pc->rq = rq; - if (rq->cmd_flags & REQ_WRITE) + if (cmd == WRITE) pc->flags |= PC_FLAG_WRITING; pc->flags |= PC_FLAG_DMA_OK; diff --git a/drivers/lightnvm/rrpc.c b/drivers/lightnvm/rrpc.c index c509477..5c5b69a 100644 --- a/drivers/lightnvm/rrpc.c +++ b/drivers/lightnvm/rrpc.c @@ -904,7 +904,7 @@ static blk_qc_t rrpc_make_rq(struct request_queue *q, struct bio *bio) struct nvm_rq *rqd; int err; - if (bio->bi_rw & REQ_DISCARD) { + if (bio->bi_op == REQ_OP_DISCARD) { rrpc_discard(rrpc, bio); return BLK_QC_T_NONE; } diff --git a/drivers/md/bcache/request.c b/drivers/md/bcache/request.c index cd6837c..be8cd63f 100644 --- a/drivers/md/bcache/request.c +++ b/drivers/md/bcache/request.c @@ -378,7 +378,7 @@ static bool check_should_bypass(struct cached_dev *dc, struct bio *bio) if (test_bit(BCACHE_DEV_DETACHING, &dc->disk.flags) || c->gc_stats.in_use > CUTOFF_CACHE_ADD || - (bio->bi_rw & REQ_DISCARD)) + (bio->bi_op == REQ_OP_DISCARD)) goto skip; if (mode == CACHE_MODE_NONE || @@ -899,7 +899,7 @@ static void cached_dev_write(struct cached_dev *dc, struct search *s) * But check_overlapping drops dirty keys for which io hasn't started, * so we still want to call it. */ - if (bio->bi_rw & REQ_DISCARD) + if (bio->bi_op == REQ_OP_DISCARD) s->iop.bypass = true; if (should_writeback(dc, s->orig_bio, @@ -913,7 +913,7 @@ static void cached_dev_write(struct cached_dev *dc, struct search *s) s->iop.bio = s->orig_bio; bio_get(s->iop.bio); - if (!(bio->bi_rw & REQ_DISCARD) || + if (!(bio->bi_op == REQ_OP_DISCARD) || blk_queue_discard(bdev_get_queue(dc->bdev))) closure_bio_submit(bio, cl); } else if (s->iop.writeback) { @@ -993,7 +993,7 @@ static blk_qc_t cached_dev_make_request(struct request_queue *q, cached_dev_read(dc, s); } } else { - if ((bio->bi_rw & REQ_DISCARD) && + if ((bio->bi_op == REQ_OP_DISCARD) && !blk_queue_discard(bdev_get_queue(dc->bdev))) bio_endio(bio); else @@ -1104,7 +1104,7 @@ static blk_qc_t flash_dev_make_request(struct request_queue *q, &KEY(d->id, bio->bi_iter.bi_sector, 0), &KEY(d->id, bio_end_sector(bio), 0)); - s->iop.bypass = (bio->bi_rw & REQ_DISCARD) != 0; + s->iop.bypass = (bio->bi_op == REQ_OP_DISCARD) != 0; s->iop.writeback = true; s->iop.bio = bio; diff --git a/drivers/md/dm-cache-target.c b/drivers/md/dm-cache-target.c index 2238d6f..95edbaa 100644 --- a/drivers/md/dm-cache-target.c +++ b/drivers/md/dm-cache-target.c @@ -788,7 +788,8 @@ static void check_if_tick_bio_needed(struct cache *cache, struct bio *bio) spin_lock_irqsave(&cache->lock, flags); if (cache->need_tick_bio && - !(bio->bi_rw & (REQ_FUA | REQ_FLUSH | REQ_DISCARD))) { + !(bio->bi_rw & (REQ_FUA | REQ_FLUSH)) && + bio->bi_op != REQ_OP_DISCARD) { pb->tick = true; cache->need_tick_bio = false; } @@ -851,7 +852,7 @@ static void inc_ds(struct cache *cache, struct bio *bio, static bool accountable_bio(struct cache *cache, struct bio *bio) { return ((bio->bi_bdev == cache->origin_dev->bdev) && - !(bio->bi_rw & REQ_DISCARD)); + bio->bi_op != REQ_OP_DISCARD); } static void accounted_begin(struct cache *cache, struct bio *bio) @@ -1062,7 +1063,8 @@ static void dec_io_migrations(struct cache *cache) static bool discard_or_flush(struct bio *bio) { - return bio->bi_rw & (REQ_FLUSH | REQ_FUA | REQ_DISCARD); + return bio->bi_op == REQ_OP_DISCARD || + bio->bi_rw & (REQ_FLUSH | REQ_FUA); } static void __cell_defer(struct cache *cache, struct dm_bio_prison_cell *cell) @@ -1975,7 +1977,7 @@ static void process_deferred_bios(struct cache *cache) if (bio->bi_rw & REQ_FLUSH) process_flush_bio(cache, bio); - else if (bio->bi_rw & REQ_DISCARD) + else if (bio->bi_op == REQ_OP_DISCARD) process_discard_bio(cache, &structs, bio); else process_bio(cache, &structs, bio); diff --git a/drivers/md/dm-crypt.c b/drivers/md/dm-crypt.c index 70fbf11..3a4ddad 100644 --- a/drivers/md/dm-crypt.c +++ b/drivers/md/dm-crypt.c @@ -1916,7 +1916,7 @@ static int crypt_map(struct dm_target *ti, struct bio *bio) * - for REQ_FLUSH device-mapper core ensures that no IO is in-flight * - for REQ_DISCARD caller must use flush if IO ordering matters */ - if (unlikely(bio->bi_rw & (REQ_FLUSH | REQ_DISCARD))) { + if (unlikely(bio->bi_rw & REQ_FLUSH || bio->bi_op == REQ_OP_DISCARD)) { bio->bi_bdev = cc->dev->bdev; if (bio_sectors(bio)) bio->bi_iter.bi_sector = cc->start + diff --git a/drivers/md/dm-log-writes.c b/drivers/md/dm-log-writes.c index 27630c5..e991405 100644 --- a/drivers/md/dm-log-writes.c +++ b/drivers/md/dm-log-writes.c @@ -557,7 +557,7 @@ static int log_writes_map(struct dm_target *ti, struct bio *bio) int i = 0; bool flush_bio = (bio->bi_rw & REQ_FLUSH); bool fua_bio = (bio->bi_rw & REQ_FUA); - bool discard_bio = (bio->bi_rw & REQ_DISCARD); + bool discard_bio = (bio->bi_op == REQ_OP_DISCARD); pb->block = NULL; diff --git a/drivers/md/dm-raid1.c b/drivers/md/dm-raid1.c index 8a86bc3..c4d23da 100644 --- a/drivers/md/dm-raid1.c +++ b/drivers/md/dm-raid1.c @@ -626,7 +626,7 @@ static void write_callback(unsigned long error, void *context) * If the bio is discard, return an error, but do not * degrade the array. */ - if (bio->bi_rw & REQ_DISCARD) { + if (bio->bi_op == REQ_OP_DISCARD) { bio->bi_error = -EOPNOTSUPP; bio_endio(bio); return; @@ -665,7 +665,7 @@ static void do_write(struct mirror_set *ms, struct bio *bio) .client = ms->io_client, }; - if (bio->bi_rw & REQ_DISCARD) { + if (bio->bi_op == REQ_OP_DISCARD) { io_req.bi_op = REQ_OP_DISCARD; io_req.mem.type = DM_IO_KMEM; io_req.mem.ptr.addr = NULL; @@ -705,7 +705,7 @@ static void do_writes(struct mirror_set *ms, struct bio_list *writes) while ((bio = bio_list_pop(writes))) { if ((bio->bi_rw & REQ_FLUSH) || - (bio->bi_rw & REQ_DISCARD)) { + (bio->bi_op == REQ_OP_DISCARD)) { bio_list_add(&sync, bio); continue; } @@ -1253,7 +1253,7 @@ static int mirror_end_io(struct dm_target *ti, struct bio *bio, int error) * We need to dec pending if this was a write. */ if (rw == WRITE) { - if (!(bio->bi_rw & (REQ_FLUSH | REQ_DISCARD))) + if (!(bio->bi_rw & REQ_FLUSH) && bio->bi_op != REQ_OP_DISCARD) dm_rh_dec(ms->rh, bio_record->write_region); return error; } diff --git a/drivers/md/dm-region-hash.c b/drivers/md/dm-region-hash.c index 74cb7b9..ce4af57 100644 --- a/drivers/md/dm-region-hash.c +++ b/drivers/md/dm-region-hash.c @@ -403,7 +403,7 @@ void dm_rh_mark_nosync(struct dm_region_hash *rh, struct bio *bio) return; } - if (bio->bi_rw & REQ_DISCARD) + if (bio->bi_op == REQ_OP_DISCARD) return; /* We must inform the log that the sync count has changed. */ @@ -526,7 +526,7 @@ void dm_rh_inc_pending(struct dm_region_hash *rh, struct bio_list *bios) struct bio *bio; for (bio = bios->head; bio; bio = bio->bi_next) { - if (bio->bi_rw & (REQ_FLUSH | REQ_DISCARD)) + if (bio->bi_rw & REQ_FLUSH || bio->bi_op == REQ_OP_DISCARD) continue; rh_inc(rh, dm_rh_bio_to_region(rh, bio)); } diff --git a/drivers/md/dm-stripe.c b/drivers/md/dm-stripe.c index 797ddb9..12b1630 100644 --- a/drivers/md/dm-stripe.c +++ b/drivers/md/dm-stripe.c @@ -292,8 +292,8 @@ static int stripe_map(struct dm_target *ti, struct bio *bio) bio->bi_bdev = sc->stripe[target_bio_nr].dev->bdev; return DM_MAPIO_REMAPPED; } - if (unlikely(bio->bi_rw & REQ_DISCARD) || - unlikely(bio->bi_rw & REQ_WRITE_SAME)) { + if (unlikely(bio->bi_op == REQ_OP_DISCARD) || + unlikely(bio->bi_op == REQ_OP_WRITE_SAME)) { target_bio_nr = dm_bio_get_target_bio_nr(bio); BUG_ON(target_bio_nr >= sc->stripes); return stripe_map_range(sc, bio, target_bio_nr); diff --git a/drivers/md/dm-thin.c b/drivers/md/dm-thin.c index 6e204e0..7f76e8c 100644 --- a/drivers/md/dm-thin.c +++ b/drivers/md/dm-thin.c @@ -705,7 +705,7 @@ static void inc_all_io_entry(struct pool *pool, struct bio *bio) { struct dm_thin_endio_hook *h; - if (bio->bi_rw & REQ_DISCARD) + if (bio->bi_op == REQ_OP_DISCARD) return; h = dm_per_bio_data(bio, sizeof(struct dm_thin_endio_hook)); @@ -868,7 +868,8 @@ static void __inc_remap_and_issue_cell(void *context, struct bio *bio; while ((bio = bio_list_pop(&cell->bios))) { - if (bio->bi_rw & (REQ_DISCARD | REQ_FLUSH | REQ_FUA)) + if (bio->bi_rw & (REQ_FLUSH | REQ_FUA) || + bio->bi_op == REQ_OP_DISCARD) bio_list_add(&info->defer_bios, bio); else { inc_all_io_entry(info->tc->pool, bio); @@ -1646,7 +1647,8 @@ static void __remap_and_issue_shared_cell(void *context, while ((bio = bio_list_pop(&cell->bios))) { if ((bio_data_dir(bio) == WRITE) || - (bio->bi_rw & (REQ_DISCARD | REQ_FLUSH | REQ_FUA))) + (bio->bi_rw & (REQ_FLUSH | REQ_FUA) || + bio->bi_op == REQ_OP_DISCARD)) bio_list_add(&info->defer_bios, bio); else { struct dm_thin_endio_hook *h = dm_per_bio_data(bio, sizeof(struct dm_thin_endio_hook));; @@ -2035,7 +2037,7 @@ static void process_thin_deferred_bios(struct thin_c *tc) break; } - if (bio->bi_rw & REQ_DISCARD) + if (bio->bi_op == REQ_OP_DISCARD) pool->process_discard(tc, bio); else pool->process_bio(tc, bio); @@ -2122,7 +2124,7 @@ static void process_thin_deferred_cells(struct thin_c *tc) return; } - if (cell->holder->bi_rw & REQ_DISCARD) + if (cell->holder->bi_op == REQ_OP_DISCARD) pool->process_discard_cell(tc, cell); else pool->process_cell(tc, cell); @@ -2558,7 +2560,8 @@ static int thin_bio_map(struct dm_target *ti, struct bio *bio) return DM_MAPIO_SUBMITTED; } - if (bio->bi_rw & (REQ_DISCARD | REQ_FLUSH | REQ_FUA)) { + if (bio->bi_rw & (REQ_FLUSH | REQ_FUA) || + bio->bi_op == REQ_OP_DISCARD) { thin_defer_bio_with_throttle(tc, bio); return DM_MAPIO_SUBMITTED; } diff --git a/drivers/md/dm.c b/drivers/md/dm.c index 53f7b1e..4bac3dc 100644 --- a/drivers/md/dm.c +++ b/drivers/md/dm.c @@ -1053,7 +1053,7 @@ static void clone_endio(struct bio *bio) } } - if (unlikely(r == -EREMOTEIO && (bio->bi_rw & REQ_WRITE_SAME) && + if (unlikely(r == -EREMOTEIO && (bio->bi_op == REQ_OP_WRITE_SAME) && !bdev_get_queue(bio->bi_bdev)->limits.max_write_same_sectors)) disable_write_same(md); @@ -1737,9 +1737,9 @@ static int __split_and_process_non_flush(struct clone_info *ci) struct dm_target *ti; unsigned len; - if (unlikely(bio->bi_rw & REQ_DISCARD)) + if (unlikely(bio->bi_op == REQ_OP_DISCARD)) return __send_discard(ci); - else if (unlikely(bio->bi_rw & REQ_WRITE_SAME)) + else if (unlikely(bio->bi_op == REQ_OP_WRITE_SAME)) return __send_write_same(ci); ti = dm_table_find_target(ci->map, ci->sector); diff --git a/drivers/md/linear.c b/drivers/md/linear.c index b7fe7e9..aad82c7 100644 --- a/drivers/md/linear.c +++ b/drivers/md/linear.c @@ -252,7 +252,7 @@ static void linear_make_request(struct mddev *mddev, struct bio *bio) split->bi_iter.bi_sector = split->bi_iter.bi_sector - start_sector + data_offset; - if (unlikely((split->bi_rw & REQ_DISCARD) && + if (unlikely((split->bi_op == REQ_OP_DISCARD) && !blk_queue_discard(bdev_get_queue(split->bi_bdev)))) { /* Just ignore it */ bio_endio(split); diff --git a/drivers/md/raid0.c b/drivers/md/raid0.c index 2ea12c6..e0d1b8c 100644 --- a/drivers/md/raid0.c +++ b/drivers/md/raid0.c @@ -488,7 +488,7 @@ static void raid0_make_request(struct mddev *mddev, struct bio *bio) split->bi_iter.bi_sector = sector + zone->dev_start + tmp_dev->data_offset; - if (unlikely((split->bi_rw & REQ_DISCARD) && + if (unlikely((split->bi_op == REQ_OP_DISCARD) && !blk_queue_discard(bdev_get_queue(split->bi_bdev)))) { /* Just ignore it */ bio_endio(split); diff --git a/drivers/scsi/osd/osd_initiator.c b/drivers/scsi/osd/osd_initiator.c index 4e7b440..680d9e4 100644 --- a/drivers/scsi/osd/osd_initiator.c +++ b/drivers/scsi/osd/osd_initiator.c @@ -824,7 +824,7 @@ void osd_req_write(struct osd_request *or, { _osd_req_encode_common(or, OSD_ACT_WRITE, obj, offset, len); WARN_ON(or->out.bio || or->out.total_bytes); - WARN_ON(0 == (bio->bi_rw & REQ_WRITE)); + WARN_ON(!op_is_write(bio->bi_op)); or->out.bio = bio; or->out.total_bytes = len; } @@ -875,7 +875,7 @@ void osd_req_read(struct osd_request *or, { _osd_req_encode_common(or, OSD_ACT_READ, obj, offset, len); WARN_ON(or->in.bio || or->in.total_bytes); - WARN_ON(bio->bi_rw & REQ_WRITE); + WARN_ON(op_is_write(bio->bi_op)); or->in.bio = bio; or->in.total_bytes = len; } diff --git a/drivers/staging/lustre/lustre/llite/lloop.c b/drivers/staging/lustre/lustre/llite/lloop.c index 20fecaf..3c5c55b 100644 --- a/drivers/staging/lustre/lustre/llite/lloop.c +++ b/drivers/staging/lustre/lustre/llite/lloop.c @@ -211,9 +211,9 @@ static int do_bio_lustrebacked(struct lloop_device *lo, struct bio *head) return io->ci_result; io->ci_lockreq = CILR_NEVER; - rw = head->bi_rw; + rw = bio_data_dir(head); for (bio = head; bio ; bio = bio->bi_next) { - LASSERT(rw == bio->bi_rw); + LASSERT(rw == bio_data_dir(bio)); offset = (pgoff_t)(bio->bi_iter.bi_sector << 9) + lo->lo_offset; bio_for_each_segment(bvec, bio, iter) { @@ -304,9 +304,9 @@ static unsigned int loop_get_bio(struct lloop_device *lo, struct bio **req) /* TODO: need to split the bio, too bad. */ LASSERT(first->bi_vcnt <= LLOOP_MAX_SEGMENTS); - rw = first->bi_rw; + rw = bio_data_dir(first); bio = &lo->lo_bio; - while (*bio && (*bio)->bi_rw == rw) { + while (*bio && bio_data_dir(*bio) == rw) { CDEBUG(D_INFO, "bio sector %llu size %u count %u vcnt%u \n", (unsigned long long)(*bio)->bi_iter.bi_sector, (*bio)->bi_iter.bi_size, diff --git a/include/linux/bio.h b/include/linux/bio.h index 9f0e2cf..1e4b3b5 100644 --- a/include/linux/bio.h +++ b/include/linux/bio.h @@ -106,18 +106,23 @@ static inline bool bio_has_data(struct bio *bio) { if (bio && bio->bi_iter.bi_size && - !(bio->bi_rw & REQ_DISCARD)) + !(bio->bi_op == REQ_OP_DISCARD)) return true; return false; } +static inline bool bio_no_advance_iter(struct bio *bio) +{ + return bio->bi_op == REQ_OP_DISCARD || bio->bi_op == REQ_OP_WRITE_SAME; +} + static inline bool bio_is_rw(struct bio *bio) { if (!bio_has_data(bio)) return false; - if (bio->bi_rw & BIO_NO_ADVANCE_ITER_MASK) + if (bio_no_advance_iter(bio)) return false; return true; @@ -225,7 +230,7 @@ static inline void bio_advance_iter(struct bio *bio, struct bvec_iter *iter, { iter->bi_sector += bytes >> 9; - if (bio->bi_rw & BIO_NO_ADVANCE_ITER_MASK) + if (bio_no_advance_iter(bio)) iter->bi_size -= bytes; else bvec_iter_advance(bio->bi_io_vec, iter, bytes); @@ -253,10 +258,10 @@ static inline unsigned bio_segments(struct bio *bio) * differently: */ - if (bio->bi_rw & REQ_DISCARD) + if (bio->bi_op == REQ_OP_DISCARD) return 1; - if (bio->bi_rw & REQ_WRITE_SAME) + if (bio->bi_op == REQ_OP_WRITE_SAME) return 1; bio_for_each_segment(bv, bio, iter) diff --git a/include/linux/fs.h b/include/linux/fs.h index beabae8..0a10de0 100644 --- a/include/linux/fs.h +++ b/include/linux/fs.h @@ -2448,33 +2448,24 @@ static inline bool op_is_write(int op) } /* - * return READ, READA, or WRITE + * return data direction, READ or WRITE */ -static inline int bio_rw(struct bio *bio) +static inline int bio_data_dir(struct bio *bio) { - /* - * tmp cpmpat. Allow users to set either op or rw, until - * all code is converted in the next patches. - */ if (op_is_write(bio->bi_op)) return WRITE; - - return bio->bi_rw & (RW_MASK | RWA_MASK); + return READ; } /* - * return data direction, READ or WRITE + * return READ, READA, or WRITE */ -static inline int bio_data_dir(struct bio *bio) +static inline int bio_rw(struct bio *bio) { - /* - * tmp cpmpat. Allow users to set either op or rw, until - * all code is converted in the next patches. - */ - if (op_is_write(bio->bi_op)) - return WRITE; + if (bio->bi_rw & RWA_MASK) + return READA; - return bio->bi_rw & 1; + return bio_data_dir(bio); } extern void check_disk_size_change(struct gendisk *disk, -- 1.8.3.1 From mchristi@redhat.com Wed Feb 24 13:49:56 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=ham version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay2.corp.sgi.com [137.38.102.29]) by oss.sgi.com (Postfix) with ESMTP id 8391C7CB9 for ; Wed, 24 Feb 2016 13:49:56 -0600 (CST) Received: from cuda.sgi.com (cuda3.sgi.com [192.48.176.15]) by relay2.corp.sgi.com (Postfix) with ESMTP id 48E27304066 for ; Wed, 24 Feb 2016 11:49:50 -0800 (PST) X-ASG-Debug-ID: 1456343386-04cb6c455bd5a90001-NocioJ Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by cuda.sgi.com with ESMTP id 2buuqSrintj5ZAuQ (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO) for ; Wed, 24 Feb 2016 11:49:47 -0800 (PST) X-Barracuda-Envelope-From: mchristi@redhat.com X-Barracuda-Apparent-Source-IP: 209.132.183.28 X-ASG-Whitelist: Client Received: from int-mx09.intmail.prod.int.phx2.redhat.com (int-mx09.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by mx1.redhat.com (Postfix) with ESMTPS id 9001C8C551; Wed, 24 Feb 2016 19:49:46 +0000 (UTC) Received: from rh2.redhat.com (vpn-54-14.rdu2.redhat.com [10.10.54.14]) by int-mx09.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id u1OJmJEa006684; Wed, 24 Feb 2016 14:49:43 -0500 From: mchristi@redhat.com To: linux-f2fs-devel@lists.sourceforge.net, linux-ext4@vger.kernel.org, konrad.wilk@oracle.com, drbd-dev@lists.linbit.com, philipp.reisner@linbit.com, lars.ellenberg@linbit.com, linux-raid@vger.kernel.org, dm-devel@redhat.com, linux-fsdevel@vger.kernel.org, linux-bcache@vger.kernel.org, linux-block@vger.kernel.org, linux-kernel@vger.kernel.org, linux-scsi@vger.kernel.org, linux-mtd@lists.infradead.org, target-devel@vger.kernel.org, linux-btrfs@vger.kernel.org, osd-dev@open-osd.org, xfs@oss.sgi.com, ocfs2-devel@oss.oracle.com Cc: Mike Christie Subject: [PATCH 31/35] block, fs: remove old REQ definitions. Date: Wed, 24 Feb 2016 13:48:08 -0600 X-ASG-Orig-Subj: [PATCH 31/35] block, fs: remove old REQ definitions. Message-Id: <1456343292-14535-32-git-send-email-mchristi@redhat.com> In-Reply-To: <1456343292-14535-1-git-send-email-mchristi@redhat.com> References: <1456343292-14535-1-git-send-email-mchristi@redhat.com> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.22 X-Barracuda-Connect: mx1.redhat.com[209.132.183.28] X-Barracuda-Start-Time: 1456343387 X-Barracuda-Encrypted: ECDHE-RSA-AES256-GCM-SHA384 X-Barracuda-URL: https://192.48.176.15:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-BRTS-Status: 1 From: Mike Christie We no longer use REQ_WRITE. REQ_WRITE_SAME and REQ_DISCARD, so this patch removes them. Signed-off-by: Mike Christie --- include/linux/blk_types.h | 21 ++++++--------------- include/linux/fs.h | 21 +++++++++++---------- include/trace/events/f2fs.h | 1 - 3 files changed, 17 insertions(+), 26 deletions(-) diff --git a/include/linux/blk_types.h b/include/linux/blk_types.h index 6e49c91..b4251ed 100644 --- a/include/linux/blk_types.h +++ b/include/linux/blk_types.h @@ -151,7 +151,6 @@ struct bio { */ enum rq_flag_bits { /* common flags */ - __REQ_WRITE, /* not set, read. set, write */ __REQ_FAILFAST_DEV, /* no driver retries of device errors */ __REQ_FAILFAST_TRANSPORT, /* no driver retries of transport errors */ __REQ_FAILFAST_DRIVER, /* no driver retries of driver errors */ @@ -159,9 +158,7 @@ enum rq_flag_bits { __REQ_SYNC, /* request is sync (sync write or read) */ __REQ_META, /* metadata io request */ __REQ_PRIO, /* boost priority in cfq */ - __REQ_DISCARD, /* request to discard sectors */ - __REQ_SECURE, /* secure discard (used with __REQ_DISCARD) */ - __REQ_WRITE_SAME, /* write same block many times */ + __REQ_SECURE, /* secure discard (used with REQ_OP_DISCARD) */ __REQ_NOIDLE, /* don't anticipate more IO after this one */ __REQ_INTEGRITY, /* I/O includes block integrity payload */ @@ -197,28 +194,22 @@ enum rq_flag_bits { __REQ_NR_BITS, /* stops here */ }; -#define REQ_WRITE (1ULL << __REQ_WRITE) #define REQ_FAILFAST_DEV (1ULL << __REQ_FAILFAST_DEV) #define REQ_FAILFAST_TRANSPORT (1ULL << __REQ_FAILFAST_TRANSPORT) #define REQ_FAILFAST_DRIVER (1ULL << __REQ_FAILFAST_DRIVER) #define REQ_SYNC (1ULL << __REQ_SYNC) #define REQ_META (1ULL << __REQ_META) #define REQ_PRIO (1ULL << __REQ_PRIO) -#define REQ_DISCARD (1ULL << __REQ_DISCARD) -#define REQ_WRITE_SAME (1ULL << __REQ_WRITE_SAME) #define REQ_NOIDLE (1ULL << __REQ_NOIDLE) #define REQ_INTEGRITY (1ULL << __REQ_INTEGRITY) #define REQ_FAILFAST_MASK \ (REQ_FAILFAST_DEV | REQ_FAILFAST_TRANSPORT | REQ_FAILFAST_DRIVER) #define REQ_COMMON_MASK \ - (REQ_WRITE | REQ_FAILFAST_MASK | REQ_SYNC | REQ_META | REQ_PRIO | \ - REQ_DISCARD | REQ_WRITE_SAME | REQ_NOIDLE | REQ_FLUSH | REQ_FUA | \ - REQ_SECURE | REQ_INTEGRITY) + (REQ_FAILFAST_MASK | REQ_SYNC | REQ_META | REQ_PRIO | REQ_NOIDLE | \ + REQ_FLUSH | REQ_FUA | REQ_SECURE | REQ_INTEGRITY) #define REQ_CLONE_MASK REQ_COMMON_MASK -#define BIO_NO_ADVANCE_ITER_MASK (REQ_DISCARD|REQ_WRITE_SAME) - /* This mask is used for both bio and request merge checking */ #define REQ_NOMERGE_FLAGS \ (REQ_NOMERGE | REQ_STARTED | REQ_SOFTBARRIER | REQ_FLUSH | REQ_FUA | REQ_FLUSH_SEQ) @@ -250,9 +241,9 @@ enum rq_flag_bits { enum req_op { REQ_OP_READ, - REQ_OP_WRITE = REQ_WRITE, - REQ_OP_DISCARD = REQ_DISCARD, - REQ_OP_WRITE_SAME = REQ_WRITE_SAME, + REQ_OP_WRITE, + REQ_OP_DISCARD, /* request to discard sectors */ + REQ_OP_WRITE_SAME, /* write same block many times */ }; typedef unsigned int blk_qc_t; diff --git a/include/linux/fs.h b/include/linux/fs.h index 0a10de0..7b57bb3 100644 --- a/include/linux/fs.h +++ b/include/linux/fs.h @@ -153,9 +153,10 @@ typedef void (dax_iodone_t)(struct buffer_head *bh_map, int uptodate); #define CHECK_IOVEC_ONLY -1 /* - * The below are the various read and write types that we support. Some of + * The below are the various read and write flags that we support. Some of * them include behavioral modifiers that send information down to the - * block layer and IO scheduler. Terminology: + * block layer and IO scheduler. They should be used along with a req_op. + * Terminology: * * The block layer uses device plugging to defer IO a little bit, in * the hope that we will see more IO very shortly. This increases @@ -194,19 +195,19 @@ typedef void (dax_iodone_t)(struct buffer_head *bh_map, int uptodate); * non-volatile media on completion. * */ -#define RW_MASK REQ_WRITE +#define RW_MASK REQ_OP_WRITE #define RWA_MASK REQ_RAHEAD -#define READ 0 +#define READ REQ_OP_READ #define WRITE RW_MASK #define READA RWA_MASK -#define READ_SYNC (READ | REQ_SYNC) -#define WRITE_SYNC (WRITE | REQ_SYNC | REQ_NOIDLE) -#define WRITE_ODIRECT (WRITE | REQ_SYNC) -#define WRITE_FLUSH (WRITE | REQ_SYNC | REQ_NOIDLE | REQ_FLUSH) -#define WRITE_FUA (WRITE | REQ_SYNC | REQ_NOIDLE | REQ_FUA) -#define WRITE_FLUSH_FUA (WRITE | REQ_SYNC | REQ_NOIDLE | REQ_FLUSH | REQ_FUA) +#define READ_SYNC REQ_SYNC +#define WRITE_SYNC (REQ_SYNC | REQ_NOIDLE) +#define WRITE_ODIRECT REQ_SYNC +#define WRITE_FLUSH (REQ_SYNC | REQ_NOIDLE | REQ_FLUSH) +#define WRITE_FUA (REQ_SYNC | REQ_NOIDLE | REQ_FUA) +#define WRITE_FLUSH_FUA (REQ_SYNC | REQ_NOIDLE | REQ_FLUSH | REQ_FUA) /* * Attribute flags. These should be or-ed together to figure out what diff --git a/include/trace/events/f2fs.h b/include/trace/events/f2fs.h index db75d69..20f708e 100644 --- a/include/trace/events/f2fs.h +++ b/include/trace/events/f2fs.h @@ -31,7 +31,6 @@ TRACE_DEFINE_ENUM(BG_GC); TRACE_DEFINE_ENUM(LFS); TRACE_DEFINE_ENUM(SSR); TRACE_DEFINE_ENUM(__REQ_RAHEAD); -TRACE_DEFINE_ENUM(__REQ_WRITE); TRACE_DEFINE_ENUM(__REQ_SYNC); TRACE_DEFINE_ENUM(__REQ_NOIDLE); TRACE_DEFINE_ENUM(__REQ_FLUSH); -- 1.8.3.1 From mchristi@redhat.com Wed Feb 24 13:49:57 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=ham version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay1.corp.sgi.com [137.38.102.111]) by oss.sgi.com (Postfix) with ESMTP id 754EE7CB9 for ; Wed, 24 Feb 2016 13:49:57 -0600 (CST) Received: from cuda.sgi.com (cuda3.sgi.com [192.48.176.15]) by relay1.corp.sgi.com (Postfix) with ESMTP id 47E688F8035 for ; Wed, 24 Feb 2016 11:49:51 -0800 (PST) X-ASG-Debug-ID: 1456343389-04cb6c70074d7c0001-NocioJ Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by cuda.sgi.com with ESMTP id sbL0GwxrtjlEisBU (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO) for ; Wed, 24 Feb 2016 11:49:50 -0800 (PST) X-Barracuda-Envelope-From: mchristi@redhat.com X-Barracuda-Apparent-Source-IP: 209.132.183.28 X-ASG-Whitelist: Client Received: from int-mx09.intmail.prod.int.phx2.redhat.com (int-mx09.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by mx1.redhat.com (Postfix) with ESMTPS id 21CCA7EBA1; Wed, 24 Feb 2016 19:49:49 +0000 (UTC) Received: from rh2.redhat.com (vpn-54-14.rdu2.redhat.com [10.10.54.14]) by int-mx09.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id u1OJmJEb006684; Wed, 24 Feb 2016 14:49:46 -0500 From: mchristi@redhat.com To: linux-f2fs-devel@lists.sourceforge.net, linux-ext4@vger.kernel.org, konrad.wilk@oracle.com, drbd-dev@lists.linbit.com, philipp.reisner@linbit.com, lars.ellenberg@linbit.com, linux-raid@vger.kernel.org, dm-devel@redhat.com, linux-fsdevel@vger.kernel.org, linux-bcache@vger.kernel.org, linux-block@vger.kernel.org, linux-kernel@vger.kernel.org, linux-scsi@vger.kernel.org, linux-mtd@lists.infradead.org, target-devel@vger.kernel.org, linux-btrfs@vger.kernel.org, osd-dev@open-osd.org, xfs@oss.sgi.com, ocfs2-devel@oss.oracle.com Cc: Mike Christie Subject: [PATCH 32/35] block: shrink bi_rw and bi_op Date: Wed, 24 Feb 2016 13:48:09 -0600 X-ASG-Orig-Subj: [PATCH 32/35] block: shrink bi_rw and bi_op Message-Id: <1456343292-14535-33-git-send-email-mchristi@redhat.com> In-Reply-To: <1456343292-14535-1-git-send-email-mchristi@redhat.com> References: <1456343292-14535-1-git-send-email-mchristi@redhat.com> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.22 X-Barracuda-Connect: mx1.redhat.com[209.132.183.28] X-Barracuda-Start-Time: 1456343390 X-Barracuda-Encrypted: ECDHE-RSA-AES256-GCM-SHA384 X-Barracuda-URL: https://192.48.176.15:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-BRTS-Status: 1 From: Mike Christie There is no need for bi_op/op and bi_rw to be so large now, so this patch shrinks them. Signed-off-by: Mike Christie --- block/blk-core.c | 2 +- drivers/md/dm-flakey.c | 2 +- drivers/md/raid5.c | 13 +++++++------ fs/btrfs/check-integrity.c | 4 ++-- fs/btrfs/inode.c | 2 +- include/linux/bio.h | 13 ++----------- include/linux/blk_types.h | 11 +++-------- include/linux/blkdev.h | 2 +- 8 files changed, 18 insertions(+), 31 deletions(-) diff --git a/block/blk-core.c b/block/blk-core.c index bba1a69..5436c19 100644 --- a/block/blk-core.c +++ b/block/blk-core.c @@ -1853,7 +1853,7 @@ static void handle_bad_sector(struct bio *bio) char b[BDEVNAME_SIZE]; printk(KERN_INFO "attempt to access beyond end of device\n"); - printk(KERN_INFO "%s: rw=%d,%ld, want=%Lu, limit=%Lu\n", + printk(KERN_INFO "%s: rw=%d,%u, want=%Lu, limit=%Lu\n", bdevname(bio->bi_bdev, b), bio->bi_op, bio->bi_rw, (unsigned long long)bio_end_sector(bio), diff --git a/drivers/md/dm-flakey.c b/drivers/md/dm-flakey.c index b7341de..29b99fb 100644 --- a/drivers/md/dm-flakey.c +++ b/drivers/md/dm-flakey.c @@ -266,7 +266,7 @@ static void corrupt_bio_data(struct bio *bio, struct flakey_c *fc) data[fc->corrupt_bio_byte - 1] = fc->corrupt_bio_value; DMDEBUG("Corrupting data bio=%p by writing %u to byte %u " - "(rw=%c bi_rw=%lu bi_sector=%llu cur_bytes=%u)\n", + "(rw=%c bi_rw=%u bi_sector=%llu cur_bytes=%u)\n", bio, fc->corrupt_bio_value, fc->corrupt_bio_byte, (bio_data_dir(bio) == WRITE) ? 'w' : 'r', bio->bi_rw, (unsigned long long)bio->bi_iter.bi_sector, bio_bytes); diff --git a/drivers/md/raid5.c b/drivers/md/raid5.c index 0c53ca2..e9bc323 100644 --- a/drivers/md/raid5.c +++ b/drivers/md/raid5.c @@ -1015,9 +1015,9 @@ again: : raid5_end_read_request; bi->bi_private = sh; - pr_debug("%s: for %llu schedule op %ld on disc %d\n", + pr_debug("%s: for %llu schedule op %d,%u on disc %d\n", __func__, (unsigned long long)sh->sector, - bi->bi_rw, i); + bi->bi_op, bi->bi_rw, i); atomic_inc(&sh->count); if (sh != head_sh) atomic_inc(&head_sh->count); @@ -1067,10 +1067,10 @@ again: rbi->bi_end_io = raid5_end_write_request; rbi->bi_private = sh; - pr_debug("%s: for %llu schedule op %ld on " + pr_debug("%s: for %llu schedule op %d,%u on " "replacement disc %d\n", __func__, (unsigned long long)sh->sector, - rbi->bi_rw, i); + rbi->bi_op, rbi->bi_rw, i); atomic_inc(&sh->count); if (sh != head_sh) atomic_inc(&head_sh->count); @@ -1102,8 +1102,9 @@ again: if (!rdev && !rrdev) { if (op_is_write(op)) set_bit(STRIPE_DEGRADED, &sh->state); - pr_debug("skip op %ld on disc %d for sector %llu\n", - bi->bi_rw, i, (unsigned long long)sh->sector); + pr_debug("skip op %d,%u on disc %d for sector %llu\n", + bi->bi_op, bi->bi_rw, i, + (unsigned long long)sh->sector); clear_bit(R5_LOCKED, &sh->dev[i].flags); set_bit(STRIPE_HANDLE, &sh->state); } diff --git a/fs/btrfs/check-integrity.c b/fs/btrfs/check-integrity.c index d95c323..9dc4394 100644 --- a/fs/btrfs/check-integrity.c +++ b/fs/btrfs/check-integrity.c @@ -2941,7 +2941,7 @@ static void __btrfsic_submit_bio(struct bio *bio) if (dev_state->state->print_mask & BTRFSIC_PRINT_MASK_SUBMIT_BIO_BH) printk(KERN_INFO - "submit_bio(rw=%d,0x%lx, bi_vcnt=%u," + "submit_bio(rw=%d,0x%x, bi_vcnt=%u," " bi_sector=%llu (bytenr %llu), bi_bdev=%p)\n", bio->bi_op, bio->bi_rw, bio->bi_vcnt, (unsigned long long)bio->bi_iter.bi_sector, @@ -2984,7 +2984,7 @@ static void __btrfsic_submit_bio(struct bio *bio) if (dev_state->state->print_mask & BTRFSIC_PRINT_MASK_SUBMIT_BIO_BH) printk(KERN_INFO - "submit_bio(rw=%d,0x%lx FLUSH, bdev=%p)\n", + "submit_bio(rw=%d,0x%x FLUSH, bdev=%p)\n", bio->bi_op, bio->bi_rw, bio->bi_bdev); if (!dev_state->dummy_block_for_bio_bh_flush.is_iodone) { if ((dev_state->state->print_mask & diff --git a/fs/btrfs/inode.c b/fs/btrfs/inode.c index a3132d6..dbec3cf 100644 --- a/fs/btrfs/inode.c +++ b/fs/btrfs/inode.c @@ -8132,7 +8132,7 @@ static void btrfs_end_dio_bio(struct bio *bio) if (err) btrfs_warn(BTRFS_I(dip->inode)->root->fs_info, - "direct IO failed ino %llu rw %d,%lu sector %#Lx len %u err no %d", + "direct IO failed ino %llu rw %d,0x%x sector %#Lx len %u err no %d", btrfs_ino(dip->inode), bio->bi_op, bio->bi_rw, (unsigned long long)bio->bi_iter.bi_sector, bio->bi_iter.bi_size, err); diff --git a/include/linux/bio.h b/include/linux/bio.h index 1e4b3b5..c91afc1 100644 --- a/include/linux/bio.h +++ b/include/linux/bio.h @@ -44,18 +44,9 @@ #define BIO_MAX_SIZE (BIO_MAX_PAGES << PAGE_CACHE_SHIFT) #define BIO_MAX_SECTORS (BIO_MAX_SIZE >> 9) -/* - * upper 16 bits of bi_rw define the io priority of this bio - */ -#define BIO_PRIO_SHIFT (8 * sizeof(unsigned long) - IOPRIO_BITS) -#define bio_prio(bio) ((bio)->bi_rw >> BIO_PRIO_SHIFT) +#define bio_prio(bio) (bio)->bi_ioprio #define bio_prio_valid(bio) ioprio_valid(bio_prio(bio)) - -#define bio_set_prio(bio, prio) do { \ - WARN_ON(prio >= (1 << IOPRIO_BITS)); \ - (bio)->bi_rw &= ((1UL << BIO_PRIO_SHIFT) - 1); \ - (bio)->bi_rw |= ((unsigned long) (prio) << BIO_PRIO_SHIFT); \ -} while (0) +#define bio_set_prio(bio, prio) ((bio)->bi_ioprio = prio) /* * various member access, note that bio_data should of course not be used diff --git a/include/linux/blk_types.h b/include/linux/blk_types.h index b4251ed..498f395 100644 --- a/include/linux/blk_types.h +++ b/include/linux/blk_types.h @@ -48,14 +48,9 @@ struct bio { struct block_device *bi_bdev; unsigned int bi_flags; /* status, command, etc */ int bi_error; - unsigned long bi_rw; /* bottom bits rq_flags_bits - * top bits priority - */ - /* - * this will be a u8 in the next patches and bi_rw can be shrunk to - * a u32. For compat in these transistional patches op is a int here. - */ - int bi_op; /* REQ_OP */ + unsigned int bi_rw; /* rq_flag_bits */ + unsigned short bi_ioprio; + u8 bi_op; /* REQ_OP */ struct bvec_iter bi_iter; diff --git a/include/linux/blkdev.h b/include/linux/blkdev.h index 1c01a41..97079eb 100644 --- a/include/linux/blkdev.h +++ b/include/linux/blkdev.h @@ -96,7 +96,7 @@ struct request { struct request_queue *q; struct blk_mq_ctx *mq_ctx; - int op; + u8 op; u64 cmd_flags; unsigned cmd_type; unsigned long atomic_flags; -- 1.8.3.1 From mchristi@redhat.com Wed Feb 24 13:50:00 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=ham version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay2.corp.sgi.com [137.38.102.29]) by oss.sgi.com (Postfix) with ESMTP id 64EB47CB9 for ; Wed, 24 Feb 2016 13:50:00 -0600 (CST) Received: from cuda.sgi.com (cuda3.sgi.com [192.48.176.15]) by relay2.corp.sgi.com (Postfix) with ESMTP id 3863C30406B for ; Wed, 24 Feb 2016 11:49:54 -0800 (PST) X-ASG-Debug-ID: 1456343392-04cb6c455cd5aa0001-NocioJ Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by cuda.sgi.com with ESMTP id BhaSVUkD93BXrHha (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO) for ; Wed, 24 Feb 2016 11:49:52 -0800 (PST) X-Barracuda-Envelope-From: mchristi@redhat.com X-Barracuda-Apparent-Source-IP: 209.132.183.28 X-ASG-Whitelist: Client Received: from int-mx09.intmail.prod.int.phx2.redhat.com (int-mx09.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by mx1.redhat.com (Postfix) with ESMTPS id C496BC00F6E1; Wed, 24 Feb 2016 19:49:51 +0000 (UTC) Received: from rh2.redhat.com (vpn-54-14.rdu2.redhat.com [10.10.54.14]) by int-mx09.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id u1OJmJEc006684; Wed, 24 Feb 2016 14:49:49 -0500 From: mchristi@redhat.com To: linux-f2fs-devel@lists.sourceforge.net, linux-ext4@vger.kernel.org, konrad.wilk@oracle.com, drbd-dev@lists.linbit.com, philipp.reisner@linbit.com, lars.ellenberg@linbit.com, linux-raid@vger.kernel.org, dm-devel@redhat.com, linux-fsdevel@vger.kernel.org, linux-bcache@vger.kernel.org, linux-block@vger.kernel.org, linux-kernel@vger.kernel.org, linux-scsi@vger.kernel.org, linux-mtd@lists.infradead.org, target-devel@vger.kernel.org, linux-btrfs@vger.kernel.org, osd-dev@open-osd.org, xfs@oss.sgi.com, ocfs2-devel@oss.oracle.com Cc: Mike Christie Subject: [PATCH 33/35] block, drivers: add REQ_OP_FLUSH operation Date: Wed, 24 Feb 2016 13:48:10 -0600 X-ASG-Orig-Subj: [PATCH 33/35] block, drivers: add REQ_OP_FLUSH operation Message-Id: <1456343292-14535-34-git-send-email-mchristi@redhat.com> In-Reply-To: <1456343292-14535-1-git-send-email-mchristi@redhat.com> References: <1456343292-14535-1-git-send-email-mchristi@redhat.com> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.22 X-Barracuda-Connect: mx1.redhat.com[209.132.183.28] X-Barracuda-Start-Time: 1456343392 X-Barracuda-Encrypted: ECDHE-RSA-AES256-GCM-SHA384 X-Barracuda-URL: https://192.48.176.15:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-BRTS-Status: 1 From: Mike Christie This adds a REQ_OP_FLUSH operation that is sent to request_fn based drivers by the block layer's flush code, instead of sending requests with the request->cmd_flags REQ_FLUSH bit set. For the following 3 flush related patches, I have not tested every driver. I have only tested scsi with xfs and btrfs. v2. 1. Fix kbuild failures. Forgot to update ubd driver. Signed-off-by: Mike Christie --- Documentation/block/writeback_cache_control.txt | 6 +++--- arch/um/drivers/ubd_kern.c | 2 +- block/blk-flush.c | 6 +++--- drivers/block/loop.c | 4 ++-- drivers/block/nbd.c | 2 +- drivers/block/osdblk.c | 2 +- drivers/block/ps3disk.c | 4 ++-- drivers/block/skd_main.c | 2 +- drivers/block/virtio_blk.c | 2 +- drivers/block/xen-blkfront.c | 8 ++++---- drivers/ide/ide-disk.c | 2 +- drivers/md/dm.c | 2 +- drivers/mmc/card/block.c | 5 ++--- drivers/mmc/card/queue.h | 2 +- drivers/mtd/mtd_blkdevs.c | 2 +- drivers/nvme/host/pci.c | 2 +- drivers/scsi/sd.c | 7 +++---- include/linux/blk_types.h | 1 + include/linux/blkdev.h | 3 +++ kernel/trace/blktrace.c | 5 ++++- 20 files changed, 37 insertions(+), 32 deletions(-) diff --git a/Documentation/block/writeback_cache_control.txt b/Documentation/block/writeback_cache_control.txt index 83407d3..ea5550f 100644 --- a/Documentation/block/writeback_cache_control.txt +++ b/Documentation/block/writeback_cache_control.txt @@ -73,9 +73,9 @@ doing: blk_queue_flush(sdkp->disk->queue, REQ_FLUSH); -and handle empty REQ_FLUSH requests in its prep_fn/request_fn. Note that +and handle empty REQ_OP_FLUSH requests in its prep_fn/request_fn. Note that REQ_FLUSH requests with a payload are automatically turned into a sequence -of an empty REQ_FLUSH request followed by the actual write by the block +of an empty REQ_OP_FLUSH request followed by the actual write by the block layer. For devices that also support the FUA bit the block layer needs to be told to pass through the REQ_FUA bit using: @@ -83,4 +83,4 @@ to be told to pass through the REQ_FUA bit using: and the driver must handle write requests that have the REQ_FUA bit set in prep_fn/request_fn. If the FUA bit is not natively supported the block -layer turns it into an empty REQ_FLUSH request after the actual write. +layer turns it into an empty REQ_OP_FLUSH request after the actual write. diff --git a/arch/um/drivers/ubd_kern.c b/arch/um/drivers/ubd_kern.c index 39ba207..a7dc382 100644 --- a/arch/um/drivers/ubd_kern.c +++ b/arch/um/drivers/ubd_kern.c @@ -1286,7 +1286,7 @@ static void do_ubd_request(struct request_queue *q) req = dev->request; - if (req->cmd_flags & REQ_FLUSH) { + if (req->op == REQ_OP_FLUSH) { io_req = kmalloc(sizeof(struct io_thread_req), GFP_ATOMIC); if (io_req == NULL) { diff --git a/block/blk-flush.c b/block/blk-flush.c index e01d3ac..070d7c7 100644 --- a/block/blk-flush.c +++ b/block/blk-flush.c @@ -29,7 +29,7 @@ * The actual execution of flush is double buffered. Whenever a request * needs to execute PRE or POSTFLUSH, it queues at * fq->flush_queue[fq->flush_pending_idx]. Once certain criteria are met, a - * flush is issued and the pending_idx is toggled. When the flush + * REQ_OP_FLUSH is issued and the pending_idx is toggled. When the flush * completes, all the requests which were pending are proceeded to the next * step. This allows arbitrary merging of different types of FLUSH/FUA * requests. @@ -329,8 +329,8 @@ static bool blk_kick_flush(struct request_queue *q, struct blk_flush_queue *fq) } flush_rq->cmd_type = REQ_TYPE_FS; - flush_rq->cmd_flags = WRITE_FLUSH | REQ_FLUSH_SEQ; - flush_rq->op = REQ_OP_WRITE; + flush_rq->cmd_flags = REQ_SYNC | REQ_NOIDLE | REQ_FLUSH_SEQ; + flush_rq->op = REQ_OP_FLUSH; flush_rq->rq_disk = first_rq->rq_disk; flush_rq->end_io = flush_end_io; diff --git a/drivers/block/loop.c b/drivers/block/loop.c index 1afc03c..a3d1293 100644 --- a/drivers/block/loop.c +++ b/drivers/block/loop.c @@ -536,7 +536,7 @@ static int do_req_filebacked(struct loop_device *lo, struct request *rq) pos = ((loff_t) blk_rq_pos(rq) << 9) + lo->lo_offset; if (op_is_write(rq->op)) { - if (rq->cmd_flags & REQ_FLUSH) + if (rq->op == REQ_OP_FLUSH) ret = lo_req_flush(lo, rq); else if (rq->op == REQ_OP_DISCARD) ret = lo_discard(lo, rq, pos); @@ -1653,7 +1653,7 @@ static int loop_queue_rq(struct blk_mq_hw_ctx *hctx, if (lo->lo_state != Lo_bound) return -EIO; - if (lo->use_dio && (!(cmd->rq->cmd_flags & REQ_FLUSH) || + if (lo->use_dio && (cmd->rq->op != REQ_OP_FLUSH || cmd->rq->op == REQ_OP_DISCARD)) cmd->use_aio = true; else diff --git a/drivers/block/nbd.c b/drivers/block/nbd.c index dd8f3e9..3b4be71 100644 --- a/drivers/block/nbd.c +++ b/drivers/block/nbd.c @@ -244,7 +244,7 @@ static int nbd_send_req(struct nbd_device *nbd, struct request *req) type = NBD_CMD_DISC; else if (req->op == REQ_OP_DISCARD) type = NBD_CMD_TRIM; - else if (req->cmd_flags & REQ_FLUSH) + else if (req->op == REQ_OP_FLUSH) type = NBD_CMD_FLUSH; else if (rq_data_dir(req) == WRITE) type = NBD_CMD_WRITE; diff --git a/drivers/block/osdblk.c b/drivers/block/osdblk.c index 1b709a4..3f8a0a0 100644 --- a/drivers/block/osdblk.c +++ b/drivers/block/osdblk.c @@ -321,7 +321,7 @@ static void osdblk_rq_fn(struct request_queue *q) * driver-specific, etc. */ - do_flush = rq->cmd_flags & REQ_FLUSH; + do_flush = (rq->op == REQ_OP_FLUSH); do_write = (rq_data_dir(rq) == WRITE); if (!do_flush) { /* osd_flush does not use a bio */ diff --git a/drivers/block/ps3disk.c b/drivers/block/ps3disk.c index c120d70..95c524b 100644 --- a/drivers/block/ps3disk.c +++ b/drivers/block/ps3disk.c @@ -196,7 +196,7 @@ static void ps3disk_do_request(struct ps3_storage_device *dev, dev_dbg(&dev->sbd.core, "%s:%u\n", __func__, __LINE__); while ((req = blk_fetch_request(q))) { - if (req->cmd_flags & REQ_FLUSH) { + if (req->op == REQ_OP_FLUSH) { if (ps3disk_submit_flush_request(dev, req)) break; } else if (req->cmd_type == REQ_TYPE_FS) { @@ -256,7 +256,7 @@ static irqreturn_t ps3disk_interrupt(int irq, void *data) return IRQ_HANDLED; } - if (req->cmd_flags & REQ_FLUSH) { + if (req->op == REQ_OP_FLUSH) { read = 0; op = "flush"; } else { diff --git a/drivers/block/skd_main.c b/drivers/block/skd_main.c index f89a0c8..a15cc2e 100644 --- a/drivers/block/skd_main.c +++ b/drivers/block/skd_main.c @@ -624,7 +624,7 @@ static void skd_request_fn(struct request_queue *q) count = blk_rq_sectors(req); data_dir = rq_data_dir(req); - if (req->cmd_flags & REQ_FLUSH) + if (req->op == REQ_OP_FLUSH) flush++; if (req->cmd_flags & REQ_FUA) diff --git a/drivers/block/virtio_blk.c b/drivers/block/virtio_blk.c index 6ca3549..c6d3bc2 100644 --- a/drivers/block/virtio_blk.c +++ b/drivers/block/virtio_blk.c @@ -172,7 +172,7 @@ static int virtio_queue_rq(struct blk_mq_hw_ctx *hctx, BUG_ON(req->nr_phys_segments + 2 > vblk->sg_elems); vbr->req = req; - if (req->cmd_flags & REQ_FLUSH) { + if (req->op == REQ_OP_FLUSH) { vbr->out_hdr.type = cpu_to_virtio32(vblk->vdev, VIRTIO_BLK_T_FLUSH); vbr->out_hdr.sector = 0; vbr->out_hdr.ioprio = cpu_to_virtio32(vblk->vdev, req_get_ioprio(vbr->req)); diff --git a/drivers/block/xen-blkfront.c b/drivers/block/xen-blkfront.c index 34e8f1a..55f795d 100644 --- a/drivers/block/xen-blkfront.c +++ b/drivers/block/xen-blkfront.c @@ -741,7 +741,7 @@ static int blkif_queue_rw_req(struct request *req, struct blkfront_ring_info *ri * The indirect operation can only be a BLKIF_OP_READ or * BLKIF_OP_WRITE */ - BUG_ON(req->cmd_flags & (REQ_FLUSH | REQ_FUA)); + BUG_ON(req->op == REQ_OP_FLUSH || req->cmd_flags & REQ_FUA); ring_req->operation = BLKIF_OP_INDIRECT; ring_req->u.indirect.indirect_op = rq_data_dir(req) ? BLKIF_OP_WRITE : BLKIF_OP_READ; @@ -753,7 +753,7 @@ static int blkif_queue_rw_req(struct request *req, struct blkfront_ring_info *ri ring_req->u.rw.handle = info->handle; ring_req->operation = rq_data_dir(req) ? BLKIF_OP_WRITE : BLKIF_OP_READ; - if (req->cmd_flags & (REQ_FLUSH | REQ_FUA)) { + if (req->op == REQ_OP_FLUSH || req->cmd_flags & REQ_FUA) { /* * Ideally we can do an unordered flush-to-disk. * In case the backend onlysupports barriers, use that. @@ -863,7 +863,7 @@ static inline bool blkif_request_flush_invalid(struct request *req, struct blkfront_info *info) { return ((req->cmd_type != REQ_TYPE_FS) || - ((req->cmd_flags & REQ_FLUSH) && + ((req->op == REQ_OP_FLUSH) && !(info->feature_flush & REQ_FLUSH)) || ((req->cmd_flags & REQ_FUA) && !(info->feature_flush & REQ_FUA))); @@ -2052,7 +2052,7 @@ static int blkif_recover(struct blkfront_info *info) /* * Get the bios in the request so we can re-queue them. */ - if (copy[i].request->cmd_flags & REQ_FLUSH || + if (copy[i].request->op == REQ_OP_FLUSH || copy[i].request->op == REQ_OP_DISCARD || copy[i].request->cmd_flags & (REQ_FUA | REQ_SECURE)) { /* diff --git a/drivers/ide/ide-disk.c b/drivers/ide/ide-disk.c index 37a8a90..6474ed3 100644 --- a/drivers/ide/ide-disk.c +++ b/drivers/ide/ide-disk.c @@ -431,7 +431,7 @@ static int idedisk_prep_fn(struct request_queue *q, struct request *rq) ide_drive_t *drive = q->queuedata; struct ide_cmd *cmd; - if (!(rq->cmd_flags & REQ_FLUSH)) + if (rq->op != REQ_OP_FLUSH) return BLKPREP_OK; if (rq->special) { diff --git a/drivers/md/dm.c b/drivers/md/dm.c index 4bac3dc..d54e056 100644 --- a/drivers/md/dm.c +++ b/drivers/md/dm.c @@ -2158,7 +2158,7 @@ static void dm_request_fn(struct request_queue *q) /* always use block 0 to find the target for flushes for now */ pos = 0; - if (!(rq->cmd_flags & REQ_FLUSH)) + if (rq->op != REQ_OP_FLUSH) pos = blk_rq_pos(rq); if ((dm_request_peeked_before_merge_deadline(md) && diff --git a/drivers/mmc/card/block.c b/drivers/mmc/card/block.c index 1f84a44..dabd152 100644 --- a/drivers/mmc/card/block.c +++ b/drivers/mmc/card/block.c @@ -1690,7 +1690,7 @@ static u8 mmc_blk_prep_packed_list(struct mmc_queue *mq, struct request *req) !IS_ALIGNED(blk_rq_sectors(next), 8)) break; - if (next->op == REQ_OP_DISCARD || next->cmd_flags & REQ_FLUSH) + if (next->op == REQ_OP_DISCARD || next->op == REQ_OP_FLUSH) break; if (rq_data_dir(cur) != rq_data_dir(next)) @@ -2115,7 +2115,6 @@ static int mmc_blk_issue_rq(struct mmc_queue *mq, struct request *req) struct mmc_card *card = md->queue.card; struct mmc_host *host = card->host; unsigned long flags; - unsigned int cmd_flags = req ? req->cmd_flags : 0; if (req && !mq->mqrq_prev->req) /* claim host only for the first request */ @@ -2139,7 +2138,7 @@ static int mmc_blk_issue_rq(struct mmc_queue *mq, struct request *req) ret = mmc_blk_issue_secdiscard_rq(mq, req); else ret = mmc_blk_issue_discard_rq(mq, req); - } else if (cmd_flags & REQ_FLUSH) { + } else if (req && req->op == REQ_OP_FLUSH) { /* complete ongoing async transfer before issuing flush */ if (card->host->areq) mmc_blk_issue_rw_rq(mq, NULL); diff --git a/drivers/mmc/card/queue.h b/drivers/mmc/card/queue.h index f166e5b..6c67e4e 100644 --- a/drivers/mmc/card/queue.h +++ b/drivers/mmc/card/queue.h @@ -3,7 +3,7 @@ static inline bool mmc_req_is_special(struct request *req) { - return req && (req->cmd_flags & REQ_FLUSH || req->op == REQ_OP_DISCARD); + return req && (req->op == REQ_OP_FLUSH || req->op == REQ_OP_DISCARD); } struct request; diff --git a/drivers/mtd/mtd_blkdevs.c b/drivers/mtd/mtd_blkdevs.c index b2e0bce..67da1cd 100644 --- a/drivers/mtd/mtd_blkdevs.c +++ b/drivers/mtd/mtd_blkdevs.c @@ -87,7 +87,7 @@ static int do_blktrans_request(struct mtd_blktrans_ops *tr, if (req->cmd_type != REQ_TYPE_FS) return -EIO; - if (req->cmd_flags & REQ_FLUSH) + if (req->op == REQ_OP_FLUSH) return tr->flush(dev); if (blk_rq_pos(req) + blk_rq_cur_sectors(req) > diff --git a/drivers/nvme/host/pci.c b/drivers/nvme/host/pci.c index da32c93..4800c1d 100644 --- a/drivers/nvme/host/pci.c +++ b/drivers/nvme/host/pci.c @@ -651,7 +651,7 @@ static int nvme_queue_rq(struct blk_mq_hw_ctx *hctx, } else { if (req->cmd_type == REQ_TYPE_DRV_PRIV) memcpy(&cmnd, req->cmd, sizeof(cmnd)); - else if (req->cmd_flags & REQ_FLUSH) + else if (req->op == REQ_OP_FLUSH) nvme_setup_flush(ns, &cmnd); else nvme_setup_rw(ns, req, &cmnd); diff --git a/drivers/scsi/sd.c b/drivers/scsi/sd.c index e8fbd0f..6882ab7 100644 --- a/drivers/scsi/sd.c +++ b/drivers/scsi/sd.c @@ -1143,12 +1143,11 @@ static int sd_init_command(struct scsi_cmnd *cmd) return sd_setup_discard_cmnd(cmd); case REQ_OP_WRITE_SAME: return sd_setup_write_same_cmnd(cmd); + case REQ_OP_FLUSH: + return sd_setup_flush_cmnd(cmd); case REQ_OP_READ: case REQ_OP_WRITE: - if (rq->cmd_flags & REQ_FLUSH) - return sd_setup_flush_cmnd(cmd); - else - return sd_setup_read_write_cmnd(cmd); + return sd_setup_read_write_cmnd(cmd); default: BUG(); } diff --git a/include/linux/blk_types.h b/include/linux/blk_types.h index 498f395..f9e53ca 100644 --- a/include/linux/blk_types.h +++ b/include/linux/blk_types.h @@ -239,6 +239,7 @@ enum req_op { REQ_OP_WRITE, REQ_OP_DISCARD, /* request to discard sectors */ REQ_OP_WRITE_SAME, /* write same block many times */ + REQ_OP_FLUSH, /* request for cache flush */ }; typedef unsigned int blk_qc_t; diff --git a/include/linux/blkdev.h b/include/linux/blkdev.h index 97079eb..9c36ffc 100644 --- a/include/linux/blkdev.h +++ b/include/linux/blkdev.h @@ -651,6 +651,9 @@ static inline bool rq_mergeable(struct request *rq) if (rq->cmd_type != REQ_TYPE_FS) return false; + if (rq->op == REQ_OP_FLUSH) + return false; + if (rq->cmd_flags & REQ_NOMERGE_FLAGS) return false; diff --git a/kernel/trace/blktrace.c b/kernel/trace/blktrace.c index 4a9ac83..3a54c83 100644 --- a/kernel/trace/blktrace.c +++ b/kernel/trace/blktrace.c @@ -223,6 +223,8 @@ static void __blk_add_trace(struct blk_trace *bt, sector_t sector, int bytes, what |= MASK_TC_BIT(op_flags, FUA); if (op == REQ_OP_DISCARD) what |= BLK_TC_ACT(BLK_TC_DISCARD); + if (op == REQ_OP_FLUSH) + what |= BLK_TC_ACT(BLK_TC_FLUSH); pid = tsk->pid; if (act_log_check(bt, what, sector, pid)) @@ -1775,7 +1777,8 @@ void blk_fill_rwbs(char *rwbs, int op, u32 rw, int bytes) { int i = 0; - if (rw & REQ_FLUSH) + if (rw & REQ_FLUSH || + op == REQ_OP_FLUSH) rwbs[i++] = 'F'; if (op == REQ_OP_WRITE) -- 1.8.3.1 From mchristi@redhat.com Wed Feb 24 13:50:05 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=ham version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay3.corp.sgi.com [198.149.34.15]) by oss.sgi.com (Postfix) with ESMTP id 6E99A7CB9 for ; Wed, 24 Feb 2016 13:50:05 -0600 (CST) Received: from cuda.sgi.com (cuda3.sgi.com [192.48.176.15]) by relay3.corp.sgi.com (Postfix) with ESMTP id B6CC8AC002 for ; Wed, 24 Feb 2016 11:49:58 -0800 (PST) X-ASG-Debug-ID: 1456343394-04cb6c455bd5aa0001-NocioJ Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by cuda.sgi.com with ESMTP id zT7HxKJVPHmttMtL (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO) for ; Wed, 24 Feb 2016 11:49:55 -0800 (PST) X-Barracuda-Envelope-From: mchristi@redhat.com X-Barracuda-Apparent-Source-IP: 209.132.183.28 X-ASG-Whitelist: Client Received: from int-mx09.intmail.prod.int.phx2.redhat.com (int-mx09.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by mx1.redhat.com (Postfix) with ESMTPS id 7646229AEA; Wed, 24 Feb 2016 19:49:54 +0000 (UTC) Received: from rh2.redhat.com (vpn-54-14.rdu2.redhat.com [10.10.54.14]) by int-mx09.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id u1OJmJEd006684; Wed, 24 Feb 2016 14:49:51 -0500 From: mchristi@redhat.com To: linux-f2fs-devel@lists.sourceforge.net, linux-ext4@vger.kernel.org, konrad.wilk@oracle.com, drbd-dev@lists.linbit.com, philipp.reisner@linbit.com, lars.ellenberg@linbit.com, linux-raid@vger.kernel.org, dm-devel@redhat.com, linux-fsdevel@vger.kernel.org, linux-bcache@vger.kernel.org, linux-block@vger.kernel.org, linux-kernel@vger.kernel.org, linux-scsi@vger.kernel.org, linux-mtd@lists.infradead.org, target-devel@vger.kernel.org, linux-btrfs@vger.kernel.org, osd-dev@open-osd.org, xfs@oss.sgi.com, ocfs2-devel@oss.oracle.com Cc: Mike Christie Subject: [PATCH 34/35] block: add QUEUE_FLAGs for flush and fua Date: Wed, 24 Feb 2016 13:48:11 -0600 X-ASG-Orig-Subj: [PATCH 34/35] block: add QUEUE_FLAGs for flush and fua Message-Id: <1456343292-14535-35-git-send-email-mchristi@redhat.com> In-Reply-To: <1456343292-14535-1-git-send-email-mchristi@redhat.com> References: <1456343292-14535-1-git-send-email-mchristi@redhat.com> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.22 X-Barracuda-Connect: mx1.redhat.com[209.132.183.28] X-Barracuda-Start-Time: 1456343394 X-Barracuda-Encrypted: ECDHE-RSA-AES256-GCM-SHA384 X-Barracuda-URL: https://192.48.176.15:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-BRTS-Status: 1 From: Mike Christie The last patch added a REQ_OP_FLUSH for request_fn drivers and the next patch renames REQ_FLUSH to REQ_PREFLUSH which will be used by file systems and make_request_fn drivers. This leaves REQ_FLUSH/REQ_FUA defined for drivers to tell the block layer if flush/fua is supported. The names are confusing and I bet will will accidentally be used by people to request flushes. To avoid that, this patch adds QUEUE_FLAGs for flush and fua which drivers will use to indicate what they support. v2: 1. Fix kbuild failures. Forgot to update ubd driver. v3: 1. Rename dm_table_supports_flush callout function argument to callout_fn. Signed-off-by: Mike Christie --- arch/um/drivers/ubd_kern.c | 2 +- block/blk-core.c | 3 +- block/blk-flush.c | 12 ++++---- block/blk-settings.c | 20 -------------- drivers/block/drbd/drbd_main.c | 3 +- drivers/block/loop.c | 2 +- drivers/block/mtip32xx/mtip32xx.c | 3 +- drivers/block/nbd.c | 6 ++-- drivers/block/osdblk.c | 2 +- drivers/block/ps3disk.c | 2 +- drivers/block/skd_main.c | 3 +- drivers/block/virtio_blk.c | 4 +-- drivers/block/xen-blkback/xenbus.c | 2 +- drivers/block/xen-blkfront.c | 55 ++++++++++++++++++++++--------------- drivers/ide/ide-disk.c | 6 ++-- drivers/md/bcache/super.c | 4 +-- drivers/md/dm-table.c | 32 +++++++++++++-------- drivers/md/md.c | 3 +- drivers/md/raid5-cache.c | 3 +- drivers/mmc/card/block.c | 3 +- drivers/mtd/mtd_blkdevs.c | 2 +- drivers/nvme/host/core.c | 6 ++-- drivers/scsi/sd.c | 13 +++++---- drivers/target/target_core_iblock.c | 6 ++-- include/linux/blkdev.h | 6 ++-- 25 files changed, 108 insertions(+), 95 deletions(-) diff --git a/arch/um/drivers/ubd_kern.c b/arch/um/drivers/ubd_kern.c index a7dc382..44380d6 100644 --- a/arch/um/drivers/ubd_kern.c +++ b/arch/um/drivers/ubd_kern.c @@ -862,7 +862,7 @@ static int ubd_add(int n, char **error_out) goto out; } ubd_dev->queue->queuedata = ubd_dev; - blk_queue_flush(ubd_dev->queue, REQ_FLUSH); + queue_flag_set_unlocked(QUEUE_FLAG_FLUSH, ubd_dev->queue); blk_queue_max_segments(ubd_dev->queue, MAX_SG); err = ubd_disk_register(UBD_MAJOR, ubd_dev->size, n, &ubd_gendisk[n]); diff --git a/block/blk-core.c b/block/blk-core.c index 5436c19..8640b35 100644 --- a/block/blk-core.c +++ b/block/blk-core.c @@ -1968,7 +1968,8 @@ generic_make_request_checks(struct bio *bio) * drivers without flush support don't have to worry * about them. */ - if ((bio->bi_rw & (REQ_FLUSH | REQ_FUA)) && !q->flush_flags) { + if ((bio->bi_rw & (REQ_FLUSH | REQ_FUA)) && + !(blk_queue_flush(q) || blk_queue_fua(q))) { bio->bi_rw &= ~(REQ_FLUSH | REQ_FUA); if (!nr_sectors) { err = 0; diff --git a/block/blk-flush.c b/block/blk-flush.c index 070d7c7..e07ca6c 100644 --- a/block/blk-flush.c +++ b/block/blk-flush.c @@ -95,17 +95,18 @@ enum { static bool blk_kick_flush(struct request_queue *q, struct blk_flush_queue *fq); -static unsigned int blk_flush_policy(unsigned int fflags, struct request *rq) +static unsigned int blk_flush_policy(struct request *rq) { + struct request_queue *q = rq->q; unsigned int policy = 0; if (blk_rq_sectors(rq)) policy |= REQ_FSEQ_DATA; - if (fflags & REQ_FLUSH) { + if (blk_queue_flush(q)) { if (rq->cmd_flags & REQ_FLUSH) policy |= REQ_FSEQ_PREFLUSH; - if (!(fflags & REQ_FUA) && (rq->cmd_flags & REQ_FUA)) + if (!blk_queue_fua(q) && (rq->cmd_flags & REQ_FUA)) policy |= REQ_FSEQ_POSTFLUSH; } return policy; @@ -385,8 +386,7 @@ static void mq_flush_data_end_io(struct request *rq, int error) void blk_insert_flush(struct request *rq) { struct request_queue *q = rq->q; - unsigned int fflags = q->flush_flags; /* may change, cache */ - unsigned int policy = blk_flush_policy(fflags, rq); + unsigned int policy = blk_flush_policy(rq); struct blk_flush_queue *fq = blk_get_flush_queue(q, rq->mq_ctx); /* @@ -394,7 +394,7 @@ void blk_insert_flush(struct request *rq) * REQ_FLUSH and FUA for the driver. */ rq->cmd_flags &= ~REQ_FLUSH; - if (!(fflags & REQ_FUA)) + if (!blk_queue_fua(q)) rq->cmd_flags &= ~REQ_FUA; /* diff --git a/block/blk-settings.c b/block/blk-settings.c index c7bb666..77dd6da 100644 --- a/block/blk-settings.c +++ b/block/blk-settings.c @@ -820,26 +820,6 @@ void blk_queue_update_dma_alignment(struct request_queue *q, int mask) } EXPORT_SYMBOL(blk_queue_update_dma_alignment); -/** - * blk_queue_flush - configure queue's cache flush capability - * @q: the request queue for the device - * @flush: 0, REQ_FLUSH or REQ_FLUSH | REQ_FUA - * - * Tell block layer cache flush capability of @q. If it supports - * flushing, REQ_FLUSH should be set. If it supports bypassing - * write cache for individual writes, REQ_FUA should be set. - */ -void blk_queue_flush(struct request_queue *q, unsigned int flush) -{ - WARN_ON_ONCE(flush & ~(REQ_FLUSH | REQ_FUA)); - - if (WARN_ON_ONCE(!(flush & REQ_FLUSH) && (flush & REQ_FUA))) - flush &= ~REQ_FUA; - - q->flush_flags = flush & (REQ_FLUSH | REQ_FUA); -} -EXPORT_SYMBOL_GPL(blk_queue_flush); - void blk_queue_flush_queueable(struct request_queue *q, bool queueable) { q->flush_not_queueable = !queueable; diff --git a/drivers/block/drbd/drbd_main.c b/drivers/block/drbd/drbd_main.c index 3a93fd2..5dd30a5 100644 --- a/drivers/block/drbd/drbd_main.c +++ b/drivers/block/drbd/drbd_main.c @@ -2762,7 +2762,8 @@ enum drbd_ret_code drbd_create_device(struct drbd_config_context *adm_ctx, unsig q->backing_dev_info.congested_data = device; blk_queue_make_request(q, drbd_make_request); - blk_queue_flush(q, REQ_FLUSH | REQ_FUA); + queue_flag_set_unlocked(QUEUE_FLAG_FLUSH, q); + queue_flag_set_unlocked(QUEUE_FLAG_FUA, q); /* Setting the max_hw_sectors to an odd value of 8kibyte here This triggers a max_bio_size message upon first attach or connect */ blk_queue_max_hw_sectors(q, DRBD_MAX_BIO_SIZE_SAFE >> 8); diff --git a/drivers/block/loop.c b/drivers/block/loop.c index a3d1293..297a91f 100644 --- a/drivers/block/loop.c +++ b/drivers/block/loop.c @@ -937,7 +937,7 @@ static int loop_set_fd(struct loop_device *lo, fmode_t mode, mapping_set_gfp_mask(mapping, lo->old_gfp_mask & ~(__GFP_IO|__GFP_FS)); if (!(lo_flags & LO_FLAGS_READ_ONLY) && file->f_op->fsync) - blk_queue_flush(lo->lo_queue, REQ_FLUSH); + queue_flag_set_unlocked(QUEUE_FLAG_FLUSH, lo->lo_queue); loop_update_dio(lo); set_capacity(lo->lo_disk, size); diff --git a/drivers/block/mtip32xx/mtip32xx.c b/drivers/block/mtip32xx/mtip32xx.c index 3995a9e..0c41ce4 100644 --- a/drivers/block/mtip32xx/mtip32xx.c +++ b/drivers/block/mtip32xx/mtip32xx.c @@ -3910,7 +3910,8 @@ skip_create_disk: * write back cache is not supported in the device. FUA depends on * write back cache support, hence setting flush support to zero. */ - blk_queue_flush(dd->queue, 0); + queue_flag_clear_unlocked(QUEUE_FLAG_FLUSH, dd->queue); + queue_flag_clear_unlocked(QUEUE_FLAG_FUA, dd->queue); /* Signal trim support */ if (dd->trim_supp == true) { diff --git a/drivers/block/nbd.c b/drivers/block/nbd.c index 3b4be71..f6bda16 100644 --- a/drivers/block/nbd.c +++ b/drivers/block/nbd.c @@ -750,9 +750,11 @@ static int __nbd_ioctl(struct block_device *bdev, struct nbd_device *nbd, queue_flag_set_unlocked(QUEUE_FLAG_DISCARD, nbd->disk->queue); if (nbd->flags & NBD_FLAG_SEND_FLUSH) - blk_queue_flush(nbd->disk->queue, REQ_FLUSH); + queue_flag_set_unlocked(QUEUE_FLAG_FLUSH, + nbd->disk->queue); else - blk_queue_flush(nbd->disk->queue, 0); + queue_flag_clear_unlocked(QUEUE_FLAG_FLUSH, + nbd->disk->queue); thread = kthread_run(nbd_thread_send, nbd, "%s", nbd_name(nbd)); diff --git a/drivers/block/osdblk.c b/drivers/block/osdblk.c index 3f8a0a0..d03f06a 100644 --- a/drivers/block/osdblk.c +++ b/drivers/block/osdblk.c @@ -437,7 +437,7 @@ static int osdblk_init_disk(struct osdblk_device *osdev) blk_queue_stack_limits(q, osd_request_queue(osdev->osd)); blk_queue_prep_rq(q, blk_queue_start_tag); - blk_queue_flush(q, REQ_FLUSH); + queue_flag_set_unlocked(QUEUE_FLAG_FLUSH, q); disk->queue = q; diff --git a/drivers/block/ps3disk.c b/drivers/block/ps3disk.c index 95c524b..5985fdc 100644 --- a/drivers/block/ps3disk.c +++ b/drivers/block/ps3disk.c @@ -468,7 +468,7 @@ static int ps3disk_probe(struct ps3_system_bus_device *_dev) blk_queue_dma_alignment(queue, dev->blk_size-1); blk_queue_logical_block_size(queue, dev->blk_size); - blk_queue_flush(queue, REQ_FLUSH); + queue_flag_set_unlocked(QUEUE_FLAG_FLUSH, queue); blk_queue_max_segments(queue, -1); blk_queue_max_segment_size(queue, dev->bounce_size); diff --git a/drivers/block/skd_main.c b/drivers/block/skd_main.c index a15cc2e..68d0e22 100644 --- a/drivers/block/skd_main.c +++ b/drivers/block/skd_main.c @@ -4409,7 +4409,8 @@ static int skd_cons_disk(struct skd_device *skdev) disk->queue = q; q->queuedata = skdev; - blk_queue_flush(q, REQ_FLUSH | REQ_FUA); + queue_flag_set_unlocked(QUEUE_FLAG_FLUSH, q); + queue_flag_set_unlocked(QUEUE_FLAG_FUA, q); blk_queue_max_segments(q, skdev->sgs_per_request); blk_queue_max_hw_sectors(q, SKD_N_MAX_SECTORS); diff --git a/drivers/block/virtio_blk.c b/drivers/block/virtio_blk.c index c6d3bc2..b8a508b 100644 --- a/drivers/block/virtio_blk.c +++ b/drivers/block/virtio_blk.c @@ -489,9 +489,9 @@ static void virtblk_update_cache_mode(struct virtio_device *vdev) struct virtio_blk *vblk = vdev->priv; if (writeback) - blk_queue_flush(vblk->disk->queue, REQ_FLUSH); + queue_flag_set_unlocked(QUEUE_FLAG_FLUSH, vblk->disk->queue); else - blk_queue_flush(vblk->disk->queue, 0); + queue_flag_clear_unlocked(QUEUE_FLAG_FLUSH, vblk->disk->queue); revalidate_disk(vblk->disk); } diff --git a/drivers/block/xen-blkback/xenbus.c b/drivers/block/xen-blkback/xenbus.c index 876763f..4a8663c 100644 --- a/drivers/block/xen-blkback/xenbus.c +++ b/drivers/block/xen-blkback/xenbus.c @@ -478,7 +478,7 @@ static int xen_vbd_create(struct xen_blkif *blkif, blkif_vdev_t handle, vbd->type |= VDISK_REMOVABLE; q = bdev_get_queue(bdev); - if (q && q->flush_flags) + if (q && (blk_queue_flush(q) || blk_queue_fua(q))) vbd->flush_support = true; if (q && blk_queue_secdiscard(q)) diff --git a/drivers/block/xen-blkfront.c b/drivers/block/xen-blkfront.c index 55f795d..356887b 100644 --- a/drivers/block/xen-blkfront.c +++ b/drivers/block/xen-blkfront.c @@ -194,6 +194,7 @@ struct blkfront_info unsigned int nr_ring_pages; struct request_queue *rq; unsigned int feature_flush; + unsigned int feature_fua; unsigned int feature_discard:1; unsigned int feature_secdiscard:1; unsigned int discard_granularity; @@ -761,19 +762,15 @@ static int blkif_queue_rw_req(struct request *req, struct blkfront_ring_info *ri * implement it the same way. (It's also a FLUSH+FUA, * since it is guaranteed ordered WRT previous writes.) */ - switch (info->feature_flush & - ((REQ_FLUSH|REQ_FUA))) { - case REQ_FLUSH|REQ_FUA: + if (blk_queue_flush(info->rq) && + blk_queue_fua(info->rq)) ring_req->operation = BLKIF_OP_WRITE_BARRIER; - break; - case REQ_FLUSH: + else if (blk_queue_flush(info->rq)) ring_req->operation = BLKIF_OP_FLUSH_DISKCACHE; - break; - default: + else ring_req->operation = 0; - } } ring_req->u.rw.nr_segments = num_grant; if (unlikely(require_extra_req)) { @@ -864,9 +861,9 @@ static inline bool blkif_request_flush_invalid(struct request *req, { return ((req->cmd_type != REQ_TYPE_FS) || ((req->op == REQ_OP_FLUSH) && - !(info->feature_flush & REQ_FLUSH)) || + !(blk_queue_flush(info->rq))) || ((req->cmd_flags & REQ_FUA) && - !(info->feature_flush & REQ_FUA))); + !(blk_queue_fua(info->rq)))); } static int blkif_queue_rq(struct blk_mq_hw_ctx *hctx, @@ -983,23 +980,30 @@ static int xlvbd_init_blk_queue(struct gendisk *gd, u16 sector_size, return 0; } -static const char *flush_info(unsigned int feature_flush) +static const char *flush_info(struct blkfront_info *info) { - switch (feature_flush & ((REQ_FLUSH | REQ_FUA))) { - case REQ_FLUSH|REQ_FUA: + if (blk_queue_flush(info->rq) && blk_queue_fua(info->rq)) return "barrier: enabled;"; - case REQ_FLUSH: + else if (blk_queue_flush(info->rq)) return "flush diskcache: enabled;"; - default: + else return "barrier or flush: disabled;"; - } } static void xlvbd_flush(struct blkfront_info *info) { - blk_queue_flush(info->rq, info->feature_flush); + if (info->feature_flush) + queue_flag_set_unlocked(QUEUE_FLAG_FLUSH, info->rq); + else + queue_flag_clear_unlocked(QUEUE_FLAG_FLUSH, info->rq); + + if (info->feature_fua) + queue_flag_set_unlocked(QUEUE_FLAG_FUA, info->rq); + else + queue_flag_clear_unlocked(QUEUE_FLAG_FUA, info->rq); + pr_info("blkfront: %s: %s %s %s %s %s\n", - info->gd->disk_name, flush_info(info->feature_flush), + info->gd->disk_name, flush_info(info), "persistent grants:", info->feature_persistent ? "enabled;" : "disabled;", "indirect descriptors:", info->max_indirect_segments ? "enabled;" : "disabled;"); @@ -1618,6 +1622,7 @@ static irqreturn_t blkif_interrupt(int irq, void *dev_id) if (unlikely(error)) { if (error == -EOPNOTSUPP) error = 0; + info->feature_fua = 0; info->feature_flush = 0; xlvbd_flush(info); } @@ -2312,6 +2317,7 @@ static void blkfront_gather_backend_features(struct blkfront_info *info) unsigned int indirect_segments; info->feature_flush = 0; + info->feature_fua = 0; err = xenbus_gather(XBT_NIL, info->xbdev->otherend, "feature-barrier", "%d", &barrier, @@ -2324,8 +2330,11 @@ static void blkfront_gather_backend_features(struct blkfront_info *info) * * If there are barriers, then we use flush. */ - if (!err && barrier) - info->feature_flush = REQ_FLUSH | REQ_FUA; + if (!err && barrier) { + info->feature_flush = 1; + info->feature_fua = 1; + } + /* * And if there is "feature-flush-cache" use that above * barriers. @@ -2334,8 +2343,10 @@ static void blkfront_gather_backend_features(struct blkfront_info *info) "feature-flush-cache", "%d", &flush, NULL); - if (!err && flush) - info->feature_flush = REQ_FLUSH; + if (!err && flush) { + info->feature_flush = 1; + info->feature_fua = 0; + } err = xenbus_gather(XBT_NIL, info->xbdev->otherend, "feature-discard", "%d", &discard, diff --git a/drivers/ide/ide-disk.c b/drivers/ide/ide-disk.c index 6474ed3..4501ca7 100644 --- a/drivers/ide/ide-disk.c +++ b/drivers/ide/ide-disk.c @@ -522,8 +522,8 @@ static int ide_do_setfeature(ide_drive_t *drive, u8 feature, u8 nsect) static void update_flush(ide_drive_t *drive) { u16 *id = drive->id; - unsigned flush = 0; + queue_flag_clear_unlocked(QUEUE_FLAG_FLUSH, drive->queue); if (drive->dev_flags & IDE_DFLAG_WCACHE) { unsigned long long capacity; int barrier; @@ -546,12 +546,10 @@ static void update_flush(ide_drive_t *drive) drive->name, barrier ? "" : "not "); if (barrier) { - flush = REQ_FLUSH; blk_queue_prep_rq(drive->queue, idedisk_prep_fn); + queue_flag_set_unlocked(QUEUE_FLAG_FLUSH, drive->queue); } } - - blk_queue_flush(drive->queue, flush); } ide_devset_get_flag(wcache, IDE_DFLAG_WCACHE); diff --git a/drivers/md/bcache/super.c b/drivers/md/bcache/super.c index b11f7f4..3d75a0f 100644 --- a/drivers/md/bcache/super.c +++ b/drivers/md/bcache/super.c @@ -820,8 +820,8 @@ static int bcache_device_init(struct bcache_device *d, unsigned block_size, clear_bit(QUEUE_FLAG_ADD_RANDOM, &d->disk->queue->queue_flags); set_bit(QUEUE_FLAG_DISCARD, &d->disk->queue->queue_flags); - blk_queue_flush(q, REQ_FLUSH|REQ_FUA); - + queue_flag_set_unlocked(QUEUE_FLAG_FLUSH, q); + queue_flag_set_unlocked(QUEUE_FLAG_FUA, q); return 0; } diff --git a/drivers/md/dm-table.c b/drivers/md/dm-table.c index 7210e53..1ce40cf 100644 --- a/drivers/md/dm-table.c +++ b/drivers/md/dm-table.c @@ -1336,13 +1336,21 @@ static void dm_table_verify_integrity(struct dm_table *t) static int device_flush_capable(struct dm_target *ti, struct dm_dev *dev, sector_t start, sector_t len, void *data) { - unsigned flush = (*(unsigned *)data); struct request_queue *q = bdev_get_queue(dev->bdev); - return q && (q->flush_flags & flush); + return q && blk_queue_flush(q); } -static bool dm_table_supports_flush(struct dm_table *t, unsigned flush) +static int device_fua_capable(struct dm_target *ti, struct dm_dev *dev, + sector_t start, sector_t len, void *data) +{ + struct request_queue *q = bdev_get_queue(dev->bdev); + + return q && blk_queue_fua(q); +} + +static bool dm_table_supports_flush(struct dm_table *t, + iterate_devices_callout_fn callout_fn) { struct dm_target *ti; unsigned i = 0; @@ -1363,7 +1371,7 @@ static bool dm_table_supports_flush(struct dm_table *t, unsigned flush) return true; if (ti->type->iterate_devices && - ti->type->iterate_devices(ti, device_flush_capable, &flush)) + ti->type->iterate_devices(ti, callout_fn, NULL)) return true; } @@ -1494,8 +1502,6 @@ static bool dm_table_supports_discards(struct dm_table *t) void dm_table_set_restrictions(struct dm_table *t, struct request_queue *q, struct queue_limits *limits) { - unsigned flush = 0; - /* * Copy table's limits to the DM device's request_queue */ @@ -1506,12 +1512,14 @@ void dm_table_set_restrictions(struct dm_table *t, struct request_queue *q, else queue_flag_set_unlocked(QUEUE_FLAG_DISCARD, q); - if (dm_table_supports_flush(t, REQ_FLUSH)) { - flush |= REQ_FLUSH; - if (dm_table_supports_flush(t, REQ_FUA)) - flush |= REQ_FUA; - } - blk_queue_flush(q, flush); + if (dm_table_supports_flush(t, device_flush_capable)) { + queue_flag_set_unlocked(QUEUE_FLAG_FLUSH, q); + if (dm_table_supports_flush(t, device_fua_capable)) + queue_flag_set_unlocked(QUEUE_FLAG_FUA, q); + else + queue_flag_clear_unlocked(QUEUE_FLAG_FUA, q); + } else + queue_flag_clear_unlocked(QUEUE_FLAG_FLUSH, q); if (!dm_table_discard_zeroes_data(t)) q->limits.discard_zeroes_data = 0; diff --git a/drivers/md/md.c b/drivers/md/md.c index 8cdd37f..f0604a0 100644 --- a/drivers/md/md.c +++ b/drivers/md/md.c @@ -5040,7 +5040,8 @@ static int md_alloc(dev_t dev, char *name) disk->fops = &md_fops; disk->private_data = mddev; disk->queue = mddev->queue; - blk_queue_flush(mddev->queue, REQ_FLUSH | REQ_FUA); + queue_flag_set_unlocked(QUEUE_FLAG_FLUSH, mddev->queue); + queue_flag_set_unlocked(QUEUE_FLAG_FUA, mddev->queue); /* Allow extended partitions. This makes the * 'mdp' device redundant, but we can't really * remove it now. diff --git a/drivers/md/raid5-cache.c b/drivers/md/raid5-cache.c index da07670..3d88b55 100644 --- a/drivers/md/raid5-cache.c +++ b/drivers/md/raid5-cache.c @@ -1196,6 +1196,7 @@ ioerr: int r5l_init_log(struct r5conf *conf, struct md_rdev *rdev) { + struct request_queue *q = rdev->bdev->bd_disk->queue; struct r5l_log *log; if (PAGE_SIZE != 4096) @@ -1205,7 +1206,7 @@ int r5l_init_log(struct r5conf *conf, struct md_rdev *rdev) return -ENOMEM; log->rdev = rdev; - log->need_cache_flush = (rdev->bdev->bd_disk->queue->flush_flags != 0); + log->need_cache_flush = (blk_queue_flush(q) || blk_queue_fua(q)); log->uuid_checksum = crc32c_le(~0, rdev->mddev->uuid, sizeof(rdev->mddev->uuid)); diff --git a/drivers/mmc/card/block.c b/drivers/mmc/card/block.c index dabd152..bd504b4 100644 --- a/drivers/mmc/card/block.c +++ b/drivers/mmc/card/block.c @@ -2276,7 +2276,8 @@ static struct mmc_blk_data *mmc_blk_alloc_req(struct mmc_card *card, ((card->ext_csd.rel_param & EXT_CSD_WR_REL_PARAM_EN) || card->ext_csd.rel_sectors)) { md->flags |= MMC_BLK_REL_WR; - blk_queue_flush(md->queue.queue, REQ_FLUSH | REQ_FUA); + queue_flag_set_unlocked(QUEUE_FLAG_FLUSH, md->queue.queue); + queue_flag_set_unlocked(QUEUE_FLAG_FUA, md->queue.queue); } if (mmc_card_mmc(card) && diff --git a/drivers/mtd/mtd_blkdevs.c b/drivers/mtd/mtd_blkdevs.c index 67da1cd..4462627 100644 --- a/drivers/mtd/mtd_blkdevs.c +++ b/drivers/mtd/mtd_blkdevs.c @@ -409,7 +409,7 @@ int add_mtd_blktrans_dev(struct mtd_blktrans_dev *new) goto error3; if (tr->flush) - blk_queue_flush(new->rq, REQ_FLUSH); + queue_flag_set_unlocked(QUEUE_FLAG_FLUSH, new->rq); new->rq->queuedata = new; blk_queue_logical_block_size(new->rq, tr->blksize); diff --git a/drivers/nvme/host/core.c b/drivers/nvme/host/core.c index 504a604..bba850d 100644 --- a/drivers/nvme/host/core.c +++ b/drivers/nvme/host/core.c @@ -1177,8 +1177,10 @@ static void nvme_alloc_ns(struct nvme_ctrl *ctrl, unsigned nsid) } if (ctrl->stripe_size) blk_queue_chunk_sectors(ns->queue, ctrl->stripe_size >> 9); - if (ctrl->vwc & NVME_CTRL_VWC_PRESENT) - blk_queue_flush(ns->queue, REQ_FLUSH | REQ_FUA); + if (ctrl->vwc & NVME_CTRL_VWC_PRESENT) { + queue_flag_set_unlocked(QUEUE_FLAG_FLUSH, ns->queue); + queue_flag_set_unlocked(QUEUE_FLAG_FUA, ns->queue); + } blk_queue_virt_boundary(ns->queue, ctrl->page_size - 1); disk->major = nvme_major; diff --git a/drivers/scsi/sd.c b/drivers/scsi/sd.c index 6882ab7..7aedac3 100644 --- a/drivers/scsi/sd.c +++ b/drivers/scsi/sd.c @@ -137,15 +137,18 @@ static const char *sd_cache_types[] = { static void sd_set_flush_flag(struct scsi_disk *sdkp) { - unsigned flush = 0; + struct request_queue *q = sdkp->disk->queue; if (sdkp->WCE) { - flush |= REQ_FLUSH; + queue_flag_set_unlocked(QUEUE_FLAG_FLUSH, q); if (sdkp->DPOFUA) - flush |= REQ_FUA; + queue_flag_set_unlocked(QUEUE_FLAG_FUA, q); + else + queue_flag_clear_unlocked(QUEUE_FLAG_FUA, q); + } else { + queue_flag_clear_unlocked(QUEUE_FLAG_FUA, q); + queue_flag_clear_unlocked(QUEUE_FLAG_FLUSH, q); } - - blk_queue_flush(sdkp->disk->queue, flush); } static ssize_t diff --git a/drivers/target/target_core_iblock.c b/drivers/target/target_core_iblock.c index 8d3d197..c9c07e3 100644 --- a/drivers/target/target_core_iblock.c +++ b/drivers/target/target_core_iblock.c @@ -659,11 +659,11 @@ iblock_execute_rw(struct se_cmd *cmd, struct scatterlist *sgl, u32 sgl_nents, * Force writethrough using WRITE_FUA if a volatile write cache * is not enabled, or if initiator set the Force Unit Access bit. */ - if (q->flush_flags & REQ_FUA) { + if (blk_queue_fua(q)) { if (cmd->se_cmd_flags & SCF_FUA) { op = REQ_OP_WRITE; op_flags = WRITE_FUA; - } else if (!(q->flush_flags & REQ_FLUSH)) { + } else if (!blk_queue_flush(q)) { op = REQ_OP_WRITE; op_flags = WRITE_FUA; } else { @@ -812,7 +812,7 @@ static bool iblock_get_write_cache(struct se_device *dev) struct block_device *bd = ib_dev->ibd_bd; struct request_queue *q = bdev_get_queue(bd); - return q->flush_flags & REQ_FLUSH; + return blk_queue_flush(q); } static const struct target_backend_ops iblock_ops = { diff --git a/include/linux/blkdev.h b/include/linux/blkdev.h index 9c36ffc..663e3aa 100644 --- a/include/linux/blkdev.h +++ b/include/linux/blkdev.h @@ -434,7 +434,6 @@ struct request_queue { /* * for flush operations */ - unsigned int flush_flags; unsigned int flush_not_queueable:1; struct blk_flush_queue *fq; @@ -492,6 +491,8 @@ struct request_queue { #define QUEUE_FLAG_INIT_DONE 20 /* queue is initialized */ #define QUEUE_FLAG_NO_SG_MERGE 21 /* don't attempt to merge SG segments*/ #define QUEUE_FLAG_POLL 22 /* IO polling enabled if set */ +#define QUEUE_FLAG_FLUSH 23 /* supports FLUSH/PREFLUSH */ +#define QUEUE_FLAG_FUA 24 /* supports FUA */ #define QUEUE_FLAG_DEFAULT ((1 << QUEUE_FLAG_IO_STAT) | \ (1 << QUEUE_FLAG_STACKABLE) | \ @@ -580,6 +581,8 @@ static inline void queue_flag_clear(unsigned int flag, struct request_queue *q) #define blk_queue_discard(q) test_bit(QUEUE_FLAG_DISCARD, &(q)->queue_flags) #define blk_queue_secdiscard(q) (blk_queue_discard(q) && \ test_bit(QUEUE_FLAG_SECDISCARD, &(q)->queue_flags)) +#define blk_queue_flush(q) test_bit(QUEUE_FLAG_FLUSH, &(q)->queue_flags) +#define blk_queue_fua(q) test_bit(QUEUE_FLAG_FUA, &(q)->queue_flags) #define blk_noretry_request(rq) \ ((rq)->cmd_flags & (REQ_FAILFAST_DEV|REQ_FAILFAST_TRANSPORT| \ @@ -1010,7 +1013,6 @@ extern void blk_queue_update_dma_alignment(struct request_queue *, int); extern void blk_queue_softirq_done(struct request_queue *, softirq_done_fn *); extern void blk_queue_rq_timed_out(struct request_queue *, rq_timed_out_fn *); extern void blk_queue_rq_timeout(struct request_queue *, unsigned int); -extern void blk_queue_flush(struct request_queue *q, unsigned int flush); extern void blk_queue_flush_queueable(struct request_queue *q, bool queueable); extern struct backing_dev_info *blk_get_backing_dev_info(struct block_device *bdev); -- 1.8.3.1 From mchristi@redhat.com Wed Feb 24 13:50:08 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=ham version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay3.corp.sgi.com [198.149.34.15]) by oss.sgi.com (Postfix) with ESMTP id EE3927CB9 for ; Wed, 24 Feb 2016 13:50:07 -0600 (CST) Received: from cuda.sgi.com (cuda2.sgi.com [192.48.176.25]) by relay3.corp.sgi.com (Postfix) with ESMTP id 2D88AAC001 for ; Wed, 24 Feb 2016 11:50:01 -0800 (PST) X-ASG-Debug-ID: 1456343397-04cbb06ae0fd440001-NocioJ Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by cuda.sgi.com with ESMTP id olKtj9htGDltrKyG (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO) for ; Wed, 24 Feb 2016 11:49:57 -0800 (PST) X-Barracuda-Envelope-From: mchristi@redhat.com X-Barracuda-Apparent-Source-IP: 209.132.183.28 X-ASG-Whitelist: Client Received: from int-mx09.intmail.prod.int.phx2.redhat.com (int-mx09.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by mx1.redhat.com (Postfix) with ESMTPS id 1C3AF63162; Wed, 24 Feb 2016 19:49:57 +0000 (UTC) Received: from rh2.redhat.com (vpn-54-14.rdu2.redhat.com [10.10.54.14]) by int-mx09.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id u1OJmJEe006684; Wed, 24 Feb 2016 14:49:54 -0500 From: mchristi@redhat.com To: linux-f2fs-devel@lists.sourceforge.net, linux-ext4@vger.kernel.org, konrad.wilk@oracle.com, drbd-dev@lists.linbit.com, philipp.reisner@linbit.com, lars.ellenberg@linbit.com, linux-raid@vger.kernel.org, dm-devel@redhat.com, linux-fsdevel@vger.kernel.org, linux-bcache@vger.kernel.org, linux-block@vger.kernel.org, linux-kernel@vger.kernel.org, linux-scsi@vger.kernel.org, linux-mtd@lists.infradead.org, target-devel@vger.kernel.org, linux-btrfs@vger.kernel.org, osd-dev@open-osd.org, xfs@oss.sgi.com, ocfs2-devel@oss.oracle.com Cc: Mike Christie Subject: [PATCH 35/35] block, drivers, fs: rename REQ_FLUSH to REQ_PREFLUSH Date: Wed, 24 Feb 2016 13:48:12 -0600 X-ASG-Orig-Subj: [PATCH 35/35] block, drivers, fs: rename REQ_FLUSH to REQ_PREFLUSH Message-Id: <1456343292-14535-36-git-send-email-mchristi@redhat.com> In-Reply-To: <1456343292-14535-1-git-send-email-mchristi@redhat.com> References: <1456343292-14535-1-git-send-email-mchristi@redhat.com> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.22 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.38]); Wed, 24 Feb 2016 19:49:57 +0000 (UTC) X-Barracuda-Connect: mx1.redhat.com[209.132.183.28] X-Barracuda-Start-Time: 1456343397 X-Barracuda-Encrypted: ECDHE-RSA-AES256-GCM-SHA384 X-Barracuda-URL: https://192.48.176.25:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-BRTS-Status: 1 From: Mike Christie To avoid confusion between REQ_OP_FLUSH, which is handled by request_fn drivers, and upper layers requesting the block layer perform a flush sequence along with possibly a WRITE, this patch renames REQ_FLUSH to REQ_PREFLUSH. Signed-off-by: Mike Christie --- Documentation/block/writeback_cache_control.txt | 31 +++++++++++++------------ Documentation/device-mapper/log-writes.txt | 10 ++++---- block/blk-core.c | 12 +++++----- block/blk-flush.c | 16 ++++++------- block/blk-mq.c | 4 ++-- drivers/block/drbd/drbd_actlog.c | 4 ++-- drivers/block/drbd/drbd_main.c | 2 +- drivers/block/drbd/drbd_protocol.h | 2 +- drivers/block/drbd/drbd_receiver.c | 2 +- drivers/block/drbd/drbd_req.c | 2 +- drivers/md/bcache/journal.c | 2 +- drivers/md/bcache/request.c | 8 +++---- drivers/md/dm-cache-target.c | 12 +++++----- drivers/md/dm-crypt.c | 7 +++--- drivers/md/dm-era-target.c | 4 ++-- drivers/md/dm-io.c | 2 +- drivers/md/dm-log-writes.c | 2 +- drivers/md/dm-raid1.c | 5 ++-- drivers/md/dm-region-hash.c | 4 ++-- drivers/md/dm-snap.c | 6 ++--- drivers/md/dm-stripe.c | 2 +- drivers/md/dm-thin.c | 8 +++---- drivers/md/dm.c | 12 +++++----- drivers/md/linear.c | 2 +- drivers/md/md.c | 2 +- drivers/md/md.h | 2 +- drivers/md/multipath.c | 2 +- drivers/md/raid0.c | 2 +- drivers/md/raid1.c | 3 ++- drivers/md/raid10.c | 2 +- drivers/md/raid5-cache.c | 2 +- drivers/md/raid5.c | 2 +- fs/btrfs/check-integrity.c | 8 +++---- fs/jbd2/journal.c | 2 +- fs/xfs/xfs_buf.c | 2 +- include/linux/blk_types.h | 8 +++---- include/linux/fs.h | 4 ++-- include/trace/events/f2fs.h | 2 +- kernel/trace/blktrace.c | 5 ++-- 39 files changed, 107 insertions(+), 102 deletions(-) diff --git a/Documentation/block/writeback_cache_control.txt b/Documentation/block/writeback_cache_control.txt index ea5550f..9869f18 100644 --- a/Documentation/block/writeback_cache_control.txt +++ b/Documentation/block/writeback_cache_control.txt @@ -20,11 +20,11 @@ a forced cache flush, and the Force Unit Access (FUA) flag for requests. Explicit cache flushes ---------------------- -The REQ_FLUSH flag can be OR ed into the r/w flags of a bio submitted from +The REQ_PREFLUSH flag can be OR ed into the r/w flags of a bio submitted from the filesystem and will make sure the volatile cache of the storage device has been flushed before the actual I/O operation is started. This explicitly guarantees that previously completed write requests are on non-volatile -storage before the flagged bio starts. In addition the REQ_FLUSH flag can be +storage before the flagged bio starts. In addition the REQ_PREFLUSH flag can be set on an otherwise empty bio structure, which causes only an explicit cache flush without any dependent I/O. It is recommend to use the blkdev_issue_flush() helper for a pure cache flush. @@ -41,21 +41,21 @@ signaled after the data has been committed to non-volatile storage. Implementation details for filesystems -------------------------------------- -Filesystems can simply set the REQ_FLUSH and REQ_FUA bits and do not have to +Filesystems can simply set the REQ_PREFLUSH and REQ_FUA bits and do not have to worry if the underlying devices need any explicit cache flushing and how -the Forced Unit Access is implemented. The REQ_FLUSH and REQ_FUA flags +the Forced Unit Access is implemented. The REQ_PREFLUSH and REQ_FUA flags may both be set on a single bio. Implementation details for make_request_fn based block drivers -------------------------------------------------------------- -These drivers will always see the REQ_FLUSH and REQ_FUA bits as they sit +These drivers will always see the REQ_PREFLUSH and REQ_FUA bits as they sit directly below the submit_bio interface. For remapping drivers the REQ_FUA bits need to be propagated to underlying devices, and a global flush needs -to be implemented for bios with the REQ_FLUSH bit set. For real device -drivers that do not have a volatile cache the REQ_FLUSH and REQ_FUA bits -on non-empty bios can simply be ignored, and REQ_FLUSH requests without +to be implemented for bios with the REQ_PREFLUSH bit set. For real device +drivers that do not have a volatile cache the REQ_PREFLUSH and REQ_FUA bits +on non-empty bios can simply be ignored, and REQ_PREFLUSH requests without data can be completed successfully without doing any work. Drivers for devices with volatile caches need to implement the support for these flags themselves without any help from the block layer. @@ -65,21 +65,22 @@ Implementation details for request_fn based block drivers -------------------------------------------------------------- For devices that do not support volatile write caches there is no driver -support required, the block layer completes empty REQ_FLUSH requests before -entering the driver and strips off the REQ_FLUSH and REQ_FUA bits from -requests that have a payload. For devices with volatile write caches the -driver needs to tell the block layer that it supports flushing caches by +support required, the block layer completes empty REQ_PREFLUSH requests +before entering the driver and strips off the REQ_PREFLUSH and REQ_FUA bits +from requests that have a payload. For devices with volatile write caches +the driver needs to tell the block layer that it supports flushing caches by doing: - blk_queue_flush(sdkp->disk->queue, REQ_FLUSH); + queue_flag_set_unlocked(QUEUE_FLAG_FLUSH, sdkp->disk->queue); and handle empty REQ_OP_FLUSH requests in its prep_fn/request_fn. Note that -REQ_FLUSH requests with a payload are automatically turned into a sequence +REQ_PREFLUSH requests with a payload are automatically turned into a sequence of an empty REQ_OP_FLUSH request followed by the actual write by the block layer. For devices that also support the FUA bit the block layer needs to be told to pass through the REQ_FUA bit using: - blk_queue_flush(sdkp->disk->queue, REQ_FLUSH | REQ_FUA); + queue_flag_set_unlocked(QUEUE_FLAG_FLUSH, sdkp->disk->queue); + queue_flag_set_unlocked(QUEUE_FLAG_FUA, sdkp->disk->queue); and the driver must handle write requests that have the REQ_FUA bit set in prep_fn/request_fn. If the FUA bit is not natively supported the block diff --git a/Documentation/device-mapper/log-writes.txt b/Documentation/device-mapper/log-writes.txt index c10f30c..f4ebcba 100644 --- a/Documentation/device-mapper/log-writes.txt +++ b/Documentation/device-mapper/log-writes.txt @@ -14,14 +14,14 @@ Log Ordering We log things in order of completion once we are sure the write is no longer in cache. This means that normal WRITE requests are not actually logged until the -next REQ_FLUSH request. This is to make it easier for userspace to replay the -log in a way that correlates to what is on disk and not what is in cache, to -make it easier to detect improper waiting/flushing. +next REQ_PREFLUSH request. This is to make it easier for userspace to replay +the log in a way that correlates to what is on disk and not what is in cache, +to make it easier to detect improper waiting/flushing. This works by attaching all WRITE requests to a list once the write completes. -Once we see a REQ_FLUSH request we splice this list onto the request and once +Once we see a REQ_PREFLUSH request we splice this list onto the request and once the FLUSH request completes we log all of the WRITEs and then the FLUSH. Only -completed WRITEs, at the time the REQ_FLUSH is issued, are added in order to +completed WRITEs, at the time the REQ_PREFLUSH is issued, are added in order to simulate the worst case scenario with regard to power failures. Consider the following example (W means write, C means complete): diff --git a/block/blk-core.c b/block/blk-core.c index 8640b35..cda8da5 100644 --- a/block/blk-core.c +++ b/block/blk-core.c @@ -1029,7 +1029,7 @@ static bool blk_rq_should_init_elevator(struct bio *bio) * Flush requests do not use the elevator so skip initialization. * This allows a request to share the flush and elevator data. */ - if (bio->bi_rw & (REQ_FLUSH | REQ_FUA)) + if (bio->bi_rw & (REQ_PREFLUSH | REQ_FUA)) return false; return true; @@ -1736,7 +1736,7 @@ static blk_qc_t blk_queue_bio(struct request_queue *q, struct bio *bio) return BLK_QC_T_NONE; } - if (bio->bi_rw & (REQ_FLUSH | REQ_FUA)) { + if (bio->bi_rw & (REQ_PREFLUSH | REQ_FUA)) { spin_lock_irq(q->queue_lock); where = ELEVATOR_INSERT_FLUSH; goto get_rq; @@ -1968,9 +1968,9 @@ generic_make_request_checks(struct bio *bio) * drivers without flush support don't have to worry * about them. */ - if ((bio->bi_rw & (REQ_FLUSH | REQ_FUA)) && + if ((bio->bi_rw & (REQ_PREFLUSH | REQ_FUA)) && !(blk_queue_flush(q) || blk_queue_fua(q))) { - bio->bi_rw &= ~(REQ_FLUSH | REQ_FUA); + bio->bi_rw &= ~(REQ_PREFLUSH | REQ_FUA); if (!nr_sectors) { err = 0; goto end_io; @@ -2217,7 +2217,7 @@ int blk_insert_cloned_request(struct request_queue *q, struct request *rq) */ BUG_ON(blk_queued_rq(rq)); - if (rq->cmd_flags & (REQ_FLUSH|REQ_FUA)) + if (rq->cmd_flags & (REQ_PREFLUSH | REQ_FUA)) where = ELEVATOR_INSERT_FLUSH; add_acct_request(q, rq, where); @@ -3311,7 +3311,7 @@ void blk_flush_plug_list(struct blk_plug *plug, bool from_schedule) /* * rq is already accounted, so use raw insert */ - if (rq->cmd_flags & (REQ_FLUSH | REQ_FUA)) + if (rq->cmd_flags & (REQ_PREFLUSH | REQ_FUA)) __elv_add_request(q, rq, ELEVATOR_INSERT_FLUSH); else __elv_add_request(q, rq, ELEVATOR_INSERT_SORT_MERGE); diff --git a/block/blk-flush.c b/block/blk-flush.c index e07ca6c..e784cd1 100644 --- a/block/blk-flush.c +++ b/block/blk-flush.c @@ -10,8 +10,8 @@ * optional steps - PREFLUSH, DATA and POSTFLUSH - according to the request * properties and hardware capability. * - * If a request doesn't have data, only REQ_FLUSH makes sense, which - * indicates a simple flush request. If there is data, REQ_FLUSH indicates + * If a request doesn't have data, only REQ_PREFLUSH makes sense, which + * indicates a simple flush request. If there is data, REQ_PREFLUSH indicates * that the device cache should be flushed before the data is executed, and * REQ_FUA means that the data must be on non-volatile media on request * completion. @@ -20,11 +20,11 @@ * difference. The requests are either completed immediately if there's no * data or executed as normal requests otherwise. * - * If the device has writeback cache and supports FUA, REQ_FLUSH is + * If the device has writeback cache and supports FUA, REQ_PREFLUSH is * translated to PREFLUSH but REQ_FUA is passed down directly with DATA. * - * If the device has writeback cache and doesn't support FUA, REQ_FLUSH is - * translated to PREFLUSH and REQ_FUA to POSTFLUSH. + * If the device has writeback cache and doesn't support FUA, REQ_PREFLUSH + * is translated to PREFLUSH and REQ_FUA to POSTFLUSH. * * The actual execution of flush is double buffered. Whenever a request * needs to execute PRE or POSTFLUSH, it queues at @@ -104,7 +104,7 @@ static unsigned int blk_flush_policy(struct request *rq) policy |= REQ_FSEQ_DATA; if (blk_queue_flush(q)) { - if (rq->cmd_flags & REQ_FLUSH) + if (rq->cmd_flags & REQ_PREFLUSH) policy |= REQ_FSEQ_PREFLUSH; if (!blk_queue_fua(q) && (rq->cmd_flags & REQ_FUA)) policy |= REQ_FSEQ_POSTFLUSH; @@ -391,9 +391,9 @@ void blk_insert_flush(struct request *rq) /* * @policy now records what operations need to be done. Adjust - * REQ_FLUSH and FUA for the driver. + * REQ_PREFLUSH and FUA for the driver. */ - rq->cmd_flags &= ~REQ_FLUSH; + rq->cmd_flags &= ~REQ_PREFLUSH; if (!blk_queue_fua(q)) rq->cmd_flags &= ~REQ_FUA; diff --git a/block/blk-mq.c b/block/blk-mq.c index c3ac92e..121e600 100644 --- a/block/blk-mq.c +++ b/block/blk-mq.c @@ -1246,7 +1246,7 @@ static int blk_mq_direct_issue_request(struct request *rq, blk_qc_t *cookie) static blk_qc_t blk_mq_make_request(struct request_queue *q, struct bio *bio) { const int is_sync = rw_is_sync(bio->bi_op, bio->bi_rw); - const int is_flush_fua = bio->bi_rw & (REQ_FLUSH | REQ_FUA); + const int is_flush_fua = bio->bi_rw & (REQ_PREFLUSH | REQ_FUA); struct blk_map_ctx data; struct request *rq; unsigned int request_count = 0; @@ -1343,7 +1343,7 @@ done: static blk_qc_t blk_sq_make_request(struct request_queue *q, struct bio *bio) { const int is_sync = rw_is_sync(bio->bi_op, bio->bi_rw); - const int is_flush_fua = bio->bi_rw & (REQ_FLUSH | REQ_FUA); + const int is_flush_fua = bio->bi_rw & (REQ_PREFLUSH | REQ_FUA); struct blk_plug *plug; unsigned int request_count = 0; struct blk_map_ctx data; diff --git a/drivers/block/drbd/drbd_actlog.c b/drivers/block/drbd/drbd_actlog.c index 2fa8534..b12ff76 100644 --- a/drivers/block/drbd/drbd_actlog.c +++ b/drivers/block/drbd/drbd_actlog.c @@ -148,7 +148,7 @@ static int _drbd_md_sync_page_io(struct drbd_device *device, device->md_io.error = -ENODEV; if ((op == REQ_OP_WRITE) && !test_bit(MD_NO_FUA, &device->flags)) - op_flags |= REQ_FUA | REQ_FLUSH; + op_flags |= REQ_FUA | REQ_PREFLUSH; op_flags |= REQ_SYNC | REQ_NOIDLE; bio = bio_alloc_drbd(GFP_NOIO); @@ -848,7 +848,7 @@ int __drbd_change_sync(struct drbd_device *device, sector_t sector, int size, unsigned long count = 0; sector_t esector, nr_sectors; - /* This would be an empty REQ_FLUSH, be silent. */ + /* This would be an empty REQ_PREFLUSH, be silent. */ if ((mode == SET_OUT_OF_SYNC) && size == 0) return 0; diff --git a/drivers/block/drbd/drbd_main.c b/drivers/block/drbd/drbd_main.c index 5dd30a5..07cd0fc 100644 --- a/drivers/block/drbd/drbd_main.c +++ b/drivers/block/drbd/drbd_main.c @@ -1609,7 +1609,7 @@ static u32 bio_flags_to_wire(struct drbd_connection *connection, if (connection->agreed_pro_version >= 95) return (bio->bi_rw & REQ_SYNC ? DP_RW_SYNC : 0) | (bio->bi_rw & REQ_FUA ? DP_FUA : 0) | - (bio->bi_rw & REQ_FLUSH ? DP_FLUSH : 0) | + (bio->bi_rw & REQ_PREFLUSH ? DP_FLUSH : 0) | (bio->bi_op == REQ_OP_DISCARD ? DP_DISCARD : 0); else return bio->bi_rw & REQ_SYNC ? DP_RW_SYNC : 0; diff --git a/drivers/block/drbd/drbd_protocol.h b/drivers/block/drbd/drbd_protocol.h index ef92453..129f8c7 100644 --- a/drivers/block/drbd/drbd_protocol.h +++ b/drivers/block/drbd/drbd_protocol.h @@ -112,7 +112,7 @@ struct p_header100 { #define DP_MAY_SET_IN_SYNC 4 #define DP_UNPLUG 8 /* not used anymore */ #define DP_FUA 16 /* equals REQ_FUA */ -#define DP_FLUSH 32 /* equals REQ_FLUSH */ +#define DP_FLUSH 32 /* equals REQ_PREFLUSH */ #define DP_DISCARD 64 /* equals REQ_DISCARD */ #define DP_SEND_RECEIVE_ACK 128 /* This is a proto B write request */ #define DP_SEND_WRITE_ACK 256 /* This is a proto C write request */ diff --git a/drivers/block/drbd/drbd_receiver.c b/drivers/block/drbd/drbd_receiver.c index a0b95da..4303731 100644 --- a/drivers/block/drbd/drbd_receiver.c +++ b/drivers/block/drbd/drbd_receiver.c @@ -2159,7 +2159,7 @@ static unsigned long wire_flags_to_bio_flags(u32 dpf) { return (dpf & DP_RW_SYNC ? REQ_SYNC : 0) | (dpf & DP_FUA ? REQ_FUA : 0) | - (dpf & DP_FLUSH ? REQ_FLUSH : 0); + (dpf & DP_FLUSH ? REQ_PREFLUSH : 0); } static unsigned long wire_flags_to_bio_op(u32 dpf) diff --git a/drivers/block/drbd/drbd_req.c b/drivers/block/drbd/drbd_req.c index 2255dcf..eef6e95 100644 --- a/drivers/block/drbd/drbd_req.c +++ b/drivers/block/drbd/drbd_req.c @@ -1132,7 +1132,7 @@ static int drbd_process_write_request(struct drbd_request *req) * replicating, in which case there is no point. */ if (unlikely(req->i.size == 0)) { /* The only size==0 bios we expect are empty flushes. */ - D_ASSERT(device, req->master_bio->bi_rw & REQ_FLUSH); + D_ASSERT(device, req->master_bio->bi_rw & REQ_PREFLUSH); if (remote) _req_mod(req, QUEUE_AS_DRBD_BARRIER); return remote; diff --git a/drivers/md/bcache/journal.c b/drivers/md/bcache/journal.c index 68fa0f0..6e0a330 100644 --- a/drivers/md/bcache/journal.c +++ b/drivers/md/bcache/journal.c @@ -627,7 +627,7 @@ static void journal_write_unlocked(struct closure *cl) bio->bi_iter.bi_sector = PTR_OFFSET(k, i); bio->bi_bdev = ca->bdev; bio->bi_op = REQ_OP_WRITE; - bio->bi_rw = REQ_SYNC|REQ_META|REQ_FLUSH|REQ_FUA; + bio->bi_rw = REQ_SYNC|REQ_META|REQ_PREFLUSH|REQ_FUA; bio->bi_iter.bi_size = sectors << 9; bio->bi_end_io = journal_write_endio; diff --git a/drivers/md/bcache/request.c b/drivers/md/bcache/request.c index be8cd63f..3947114 100644 --- a/drivers/md/bcache/request.c +++ b/drivers/md/bcache/request.c @@ -205,10 +205,10 @@ static void bch_data_insert_start(struct closure *cl) return bch_data_invalidate(cl); /* - * Journal writes are marked REQ_FLUSH; if the original write was a + * Journal writes are marked REQ_PREFLUSH; if the original write was a * flush, it'll wait on the journal write. */ - bio->bi_rw &= ~(REQ_FLUSH|REQ_FUA); + bio->bi_rw &= ~(REQ_PREFLUSH|REQ_FUA); do { unsigned i; @@ -668,7 +668,7 @@ static inline struct search *search_alloc(struct bio *bio, s->iop.write_prio = 0; s->iop.error = 0; s->iop.flags = 0; - s->iop.flush_journal = (bio->bi_rw & (REQ_FLUSH|REQ_FUA)) != 0; + s->iop.flush_journal = (bio->bi_rw & (REQ_PREFLUSH|REQ_FUA)) != 0; s->iop.wq = bcache_wq; return s; @@ -920,7 +920,7 @@ static void cached_dev_write(struct cached_dev *dc, struct search *s) bch_writeback_add(dc); s->iop.bio = bio; - if (bio->bi_rw & REQ_FLUSH) { + if (bio->bi_rw & REQ_PREFLUSH) { /* Also need to send a flush to the backing device */ struct bio *flush = bio_alloc_bioset(GFP_NOIO, 0, dc->disk.bio_split); diff --git a/drivers/md/dm-cache-target.c b/drivers/md/dm-cache-target.c index 95edbaa..201bfbf 100644 --- a/drivers/md/dm-cache-target.c +++ b/drivers/md/dm-cache-target.c @@ -788,7 +788,7 @@ static void check_if_tick_bio_needed(struct cache *cache, struct bio *bio) spin_lock_irqsave(&cache->lock, flags); if (cache->need_tick_bio && - !(bio->bi_rw & (REQ_FUA | REQ_FLUSH)) && + !(bio->bi_rw & (REQ_FUA | REQ_PREFLUSH)) && bio->bi_op != REQ_OP_DISCARD) { pb->tick = true; cache->need_tick_bio = false; @@ -830,7 +830,7 @@ static dm_oblock_t get_bio_block(struct cache *cache, struct bio *bio) static int bio_triggers_commit(struct cache *cache, struct bio *bio) { - return bio->bi_rw & (REQ_FLUSH | REQ_FUA); + return bio->bi_rw & (REQ_PREFLUSH | REQ_FUA); } /* @@ -1064,7 +1064,7 @@ static void dec_io_migrations(struct cache *cache) static bool discard_or_flush(struct bio *bio) { return bio->bi_op == REQ_OP_DISCARD || - bio->bi_rw & (REQ_FLUSH | REQ_FUA); + bio->bi_rw & (REQ_PREFLUSH | REQ_FUA); } static void __cell_defer(struct cache *cache, struct dm_bio_prison_cell *cell) @@ -1609,8 +1609,8 @@ static void process_flush_bio(struct cache *cache, struct bio *bio) remap_to_cache(cache, bio, 0); /* - * REQ_FLUSH is not directed at any particular block so we don't - * need to inc_ds(). REQ_FUA's are split into a write + REQ_FLUSH + * REQ_PREFLUSH is not directed at any particular block so we don't + * need to inc_ds(). REQ_FUA's are split into a write + REQ_PREFLUSH * by dm-core. */ issue(cache, bio); @@ -1975,7 +1975,7 @@ static void process_deferred_bios(struct cache *cache) bio = bio_list_pop(&bios); - if (bio->bi_rw & REQ_FLUSH) + if (bio->bi_rw & REQ_PREFLUSH) process_flush_bio(cache, bio); else if (bio->bi_op == REQ_OP_DISCARD) process_discard_bio(cache, &structs, bio); diff --git a/drivers/md/dm-crypt.c b/drivers/md/dm-crypt.c index 3a4ddad..9481dbc 100644 --- a/drivers/md/dm-crypt.c +++ b/drivers/md/dm-crypt.c @@ -1912,11 +1912,12 @@ static int crypt_map(struct dm_target *ti, struct bio *bio) struct crypt_config *cc = ti->private; /* - * If bio is REQ_FLUSH or REQ_DISCARD, just bypass crypt queues. - * - for REQ_FLUSH device-mapper core ensures that no IO is in-flight + * If bio is REQ_PREFLUSH or REQ_DISCARD, just bypass crypt queues. + * - for REQ_PREFLUSH device-mapper core ensures that no IO is in-flight * - for REQ_DISCARD caller must use flush if IO ordering matters */ - if (unlikely(bio->bi_rw & REQ_FLUSH || bio->bi_op == REQ_OP_DISCARD)) { + if (unlikely(bio->bi_rw & REQ_PREFLUSH || + bio->bi_op == REQ_OP_DISCARD)) { bio->bi_bdev = cc->dev->bdev; if (bio_sectors(bio)) bio->bi_iter.bi_sector = cc->start + diff --git a/drivers/md/dm-era-target.c b/drivers/md/dm-era-target.c index 665bf32..2faf49d8 100644 --- a/drivers/md/dm-era-target.c +++ b/drivers/md/dm-era-target.c @@ -1540,9 +1540,9 @@ static int era_map(struct dm_target *ti, struct bio *bio) remap_to_origin(era, bio); /* - * REQ_FLUSH bios carry no data, so we're not interested in them. + * REQ_PREFLUSH bios carry no data, so we're not interested in them. */ - if (!(bio->bi_rw & REQ_FLUSH) && + if (!(bio->bi_rw & REQ_PREFLUSH) && (bio_data_dir(bio) == WRITE) && !metadata_current_marked(era->md, block)) { defer_bio(era, bio); diff --git a/drivers/md/dm-io.c b/drivers/md/dm-io.c index 0f723ca..f96ba41 100644 --- a/drivers/md/dm-io.c +++ b/drivers/md/dm-io.c @@ -381,7 +381,7 @@ static void dispatch_io(int op, int op_flags, unsigned int num_regions, */ for (i = 0; i < num_regions; i++) { *dp = old_pages; - if (where[i].count || (op_flags & REQ_FLUSH)) + if (where[i].count || (op_flags & REQ_PREFLUSH)) do_region(op, op_flags, i, where + i, dp, io); } diff --git a/drivers/md/dm-log-writes.c b/drivers/md/dm-log-writes.c index e991405..73793bd 100644 --- a/drivers/md/dm-log-writes.c +++ b/drivers/md/dm-log-writes.c @@ -555,7 +555,7 @@ static int log_writes_map(struct dm_target *ti, struct bio *bio) struct bio_vec bv; size_t alloc_size; int i = 0; - bool flush_bio = (bio->bi_rw & REQ_FLUSH); + bool flush_bio = (bio->bi_rw & REQ_PREFLUSH); bool fua_bio = (bio->bi_rw & REQ_FUA); bool discard_bio = (bio->bi_op == REQ_OP_DISCARD); diff --git a/drivers/md/dm-raid1.c b/drivers/md/dm-raid1.c index c4d23da..bd1ba80 100644 --- a/drivers/md/dm-raid1.c +++ b/drivers/md/dm-raid1.c @@ -704,7 +704,7 @@ static void do_writes(struct mirror_set *ms, struct bio_list *writes) bio_list_init(&requeue); while ((bio = bio_list_pop(writes))) { - if ((bio->bi_rw & REQ_FLUSH) || + if ((bio->bi_rw & REQ_PREFLUSH) || (bio->bi_op == REQ_OP_DISCARD)) { bio_list_add(&sync, bio); continue; @@ -1253,7 +1253,8 @@ static int mirror_end_io(struct dm_target *ti, struct bio *bio, int error) * We need to dec pending if this was a write. */ if (rw == WRITE) { - if (!(bio->bi_rw & REQ_FLUSH) && bio->bi_op != REQ_OP_DISCARD) + if (!(bio->bi_rw & REQ_PREFLUSH) && + bio->bi_op != REQ_OP_DISCARD) dm_rh_dec(ms->rh, bio_record->write_region); return error; } diff --git a/drivers/md/dm-region-hash.c b/drivers/md/dm-region-hash.c index ce4af57..d257428 100644 --- a/drivers/md/dm-region-hash.c +++ b/drivers/md/dm-region-hash.c @@ -398,7 +398,7 @@ void dm_rh_mark_nosync(struct dm_region_hash *rh, struct bio *bio) region_t region = dm_rh_bio_to_region(rh, bio); int recovering = 0; - if (bio->bi_rw & REQ_FLUSH) { + if (bio->bi_rw & REQ_PREFLUSH) { rh->flush_failure = 1; return; } @@ -526,7 +526,7 @@ void dm_rh_inc_pending(struct dm_region_hash *rh, struct bio_list *bios) struct bio *bio; for (bio = bios->head; bio; bio = bio->bi_next) { - if (bio->bi_rw & REQ_FLUSH || bio->bi_op == REQ_OP_DISCARD) + if (bio->bi_rw & REQ_PREFLUSH || bio->bi_op == REQ_OP_DISCARD) continue; rh_inc(rh, dm_rh_bio_to_region(rh, bio)); } diff --git a/drivers/md/dm-snap.c b/drivers/md/dm-snap.c index 62479ac..f02a6bb8 100644 --- a/drivers/md/dm-snap.c +++ b/drivers/md/dm-snap.c @@ -1671,7 +1671,7 @@ static int snapshot_map(struct dm_target *ti, struct bio *bio) init_tracked_chunk(bio); - if (bio->bi_rw & REQ_FLUSH) { + if (bio->bi_rw & REQ_PREFLUSH) { bio->bi_bdev = s->cow->bdev; return DM_MAPIO_REMAPPED; } @@ -1790,7 +1790,7 @@ static int snapshot_merge_map(struct dm_target *ti, struct bio *bio) init_tracked_chunk(bio); - if (bio->bi_rw & REQ_FLUSH) { + if (bio->bi_rw & REQ_PREFLUSH) { if (!dm_bio_get_target_bio_nr(bio)) bio->bi_bdev = s->origin->bdev; else @@ -2276,7 +2276,7 @@ static int origin_map(struct dm_target *ti, struct bio *bio) bio->bi_bdev = o->dev->bdev; - if (unlikely(bio->bi_rw & REQ_FLUSH)) + if (unlikely(bio->bi_rw & REQ_PREFLUSH)) return DM_MAPIO_REMAPPED; if (bio_rw(bio) != WRITE) diff --git a/drivers/md/dm-stripe.c b/drivers/md/dm-stripe.c index 12b1630..e6f330c 100644 --- a/drivers/md/dm-stripe.c +++ b/drivers/md/dm-stripe.c @@ -286,7 +286,7 @@ static int stripe_map(struct dm_target *ti, struct bio *bio) uint32_t stripe; unsigned target_bio_nr; - if (bio->bi_rw & REQ_FLUSH) { + if (bio->bi_rw & REQ_PREFLUSH) { target_bio_nr = dm_bio_get_target_bio_nr(bio); BUG_ON(target_bio_nr >= sc->stripes); bio->bi_bdev = sc->stripe[target_bio_nr].dev->bdev; diff --git a/drivers/md/dm-thin.c b/drivers/md/dm-thin.c index 7f76e8c..15beb41 100644 --- a/drivers/md/dm-thin.c +++ b/drivers/md/dm-thin.c @@ -697,7 +697,7 @@ static void remap_to_origin(struct thin_c *tc, struct bio *bio) static int bio_triggers_commit(struct thin_c *tc, struct bio *bio) { - return (bio->bi_rw & (REQ_FLUSH | REQ_FUA)) && + return (bio->bi_rw & (REQ_PREFLUSH | REQ_FUA)) && dm_thin_changed_this_transaction(tc->td); } @@ -868,7 +868,7 @@ static void __inc_remap_and_issue_cell(void *context, struct bio *bio; while ((bio = bio_list_pop(&cell->bios))) { - if (bio->bi_rw & (REQ_FLUSH | REQ_FUA) || + if (bio->bi_rw & (REQ_PREFLUSH | REQ_FUA) || bio->bi_op == REQ_OP_DISCARD) bio_list_add(&info->defer_bios, bio); else { @@ -1647,7 +1647,7 @@ static void __remap_and_issue_shared_cell(void *context, while ((bio = bio_list_pop(&cell->bios))) { if ((bio_data_dir(bio) == WRITE) || - (bio->bi_rw & (REQ_FLUSH | REQ_FUA) || + (bio->bi_rw & (REQ_PREFLUSH | REQ_FUA) || bio->bi_op == REQ_OP_DISCARD)) bio_list_add(&info->defer_bios, bio); else { @@ -2560,7 +2560,7 @@ static int thin_bio_map(struct dm_target *ti, struct bio *bio) return DM_MAPIO_SUBMITTED; } - if (bio->bi_rw & (REQ_FLUSH | REQ_FUA) || + if (bio->bi_rw & (REQ_PREFLUSH | REQ_FUA) || bio->bi_op == REQ_OP_DISCARD) { thin_defer_bio_with_throttle(tc, bio); return DM_MAPIO_SUBMITTED; diff --git a/drivers/md/dm.c b/drivers/md/dm.c index d54e056..eda1e70 100644 --- a/drivers/md/dm.c +++ b/drivers/md/dm.c @@ -1003,12 +1003,12 @@ static void dec_pending(struct dm_io *io, int error) if (io_error == DM_ENDIO_REQUEUE) return; - if ((bio->bi_rw & REQ_FLUSH) && bio->bi_iter.bi_size) { + if ((bio->bi_rw & REQ_PREFLUSH) && bio->bi_iter.bi_size) { /* * Preflush done for flush with data, reissue - * without REQ_FLUSH. + * without REQ_PREFLUSH. */ - bio->bi_rw &= ~REQ_FLUSH; + bio->bi_rw &= ~REQ_PREFLUSH; queue_io(md, bio); } else { /* done with normal IO or empty flush */ @@ -1477,7 +1477,7 @@ EXPORT_SYMBOL_GPL(dm_set_target_max_io_len); /* * A target may call dm_accept_partial_bio only from the map routine. It is - * allowed for all bio types except REQ_FLUSH. + * allowed for all bio types except REQ_PREFLUSH. * * dm_accept_partial_bio informs the dm that the target only wants to process * additional n_sectors sectors of the bio and the rest of the data should be @@ -1507,7 +1507,7 @@ void dm_accept_partial_bio(struct bio *bio, unsigned n_sectors) { struct dm_target_io *tio = container_of(bio, struct dm_target_io, clone); unsigned bi_size = bio->bi_iter.bi_size >> SECTOR_SHIFT; - BUG_ON(bio->bi_rw & REQ_FLUSH); + BUG_ON(bio->bi_rw & REQ_PREFLUSH); BUG_ON(bi_size > *tio->len_ptr); BUG_ON(n_sectors > bi_size); *tio->len_ptr -= bi_size - n_sectors; @@ -1782,7 +1782,7 @@ static void __split_and_process_bio(struct mapped_device *md, start_io_acct(ci.io); - if (bio->bi_rw & REQ_FLUSH) { + if (bio->bi_rw & REQ_PREFLUSH) { ci.bio = &ci.md->flush_bio; ci.sector_count = 0; error = __send_empty_flush(&ci); diff --git a/drivers/md/linear.c b/drivers/md/linear.c index aad82c7..657053e 100644 --- a/drivers/md/linear.c +++ b/drivers/md/linear.c @@ -221,7 +221,7 @@ static void linear_make_request(struct mddev *mddev, struct bio *bio) struct bio *split; sector_t start_sector, end_sector, data_offset; - if (unlikely(bio->bi_rw & REQ_FLUSH)) { + if (unlikely(bio->bi_rw & REQ_PREFLUSH)) { md_flush_request(mddev, bio); return; } diff --git a/drivers/md/md.c b/drivers/md/md.c index f0604a0..a158211 100644 --- a/drivers/md/md.c +++ b/drivers/md/md.c @@ -412,7 +412,7 @@ static void md_submit_flush_data(struct work_struct *ws) /* an empty barrier - all done */ bio_endio(bio); else { - bio->bi_rw &= ~REQ_FLUSH; + bio->bi_rw &= ~REQ_PREFLUSH; mddev->pers->make_request(mddev, bio); } diff --git a/drivers/md/md.h b/drivers/md/md.h index 2e0918f..b4f3352 100644 --- a/drivers/md/md.h +++ b/drivers/md/md.h @@ -424,7 +424,7 @@ struct mddev { /* Generic flush handling. * The last to finish preflush schedules a worker to submit - * the rest of the request (without the REQ_FLUSH flag). + * the rest of the request (without the REQ_PREFLUSH flag). */ struct bio *flush_bio; atomic_t flush_pending; diff --git a/drivers/md/multipath.c b/drivers/md/multipath.c index 0a72ab6..f763efc 100644 --- a/drivers/md/multipath.c +++ b/drivers/md/multipath.c @@ -111,7 +111,7 @@ static void multipath_make_request(struct mddev *mddev, struct bio * bio) struct multipath_bh * mp_bh; struct multipath_info *multipath; - if (unlikely(bio->bi_rw & REQ_FLUSH)) { + if (unlikely(bio->bi_rw & REQ_PREFLUSH)) { md_flush_request(mddev, bio); return; } diff --git a/drivers/md/raid0.c b/drivers/md/raid0.c index e0d1b8c..f95463d 100644 --- a/drivers/md/raid0.c +++ b/drivers/md/raid0.c @@ -458,7 +458,7 @@ static void raid0_make_request(struct mddev *mddev, struct bio *bio) struct md_rdev *tmp_dev; struct bio *split; - if (unlikely(bio->bi_rw & REQ_FLUSH)) { + if (unlikely(bio->bi_rw & REQ_PREFLUSH)) { md_flush_request(mddev, bio); return; } diff --git a/drivers/md/raid1.c b/drivers/md/raid1.c index 150df76..2646e9d 100644 --- a/drivers/md/raid1.c +++ b/drivers/md/raid1.c @@ -1056,7 +1056,8 @@ static void raid1_make_request(struct mddev *mddev, struct bio * bio) const int op = bio->bi_op; const int rw = bio_data_dir(bio); const unsigned long do_sync = (bio->bi_rw & REQ_SYNC); - const unsigned long do_flush_fua = (bio->bi_rw & (REQ_FLUSH | REQ_FUA)); + const unsigned long do_flush_fua = (bio->bi_rw & + (REQ_PREFLUSH | REQ_FUA)); const unsigned long do_sec = (bio->bi_rw & REQ_SECURE); struct md_rdev *blocked_rdev; struct blk_plug_cb *cb; diff --git a/drivers/md/raid10.c b/drivers/md/raid10.c index 871edf6..e7091f4 100644 --- a/drivers/md/raid10.c +++ b/drivers/md/raid10.c @@ -1452,7 +1452,7 @@ static void raid10_make_request(struct mddev *mddev, struct bio *bio) struct bio *split; - if (unlikely(bio->bi_rw & REQ_FLUSH)) { + if (unlikely(bio->bi_rw & REQ_PREFLUSH)) { md_flush_request(mddev, bio); return; } diff --git a/drivers/md/raid5-cache.c b/drivers/md/raid5-cache.c index 3d88b55..72f787a 100644 --- a/drivers/md/raid5-cache.c +++ b/drivers/md/raid5-cache.c @@ -536,7 +536,7 @@ int r5l_handle_flush_request(struct r5l_log *log, struct bio *bio) bio_endio(bio); return 0; } - bio->bi_rw &= ~REQ_FLUSH; + bio->bi_rw &= ~REQ_PREFLUSH; return -EAGAIN; } diff --git a/drivers/md/raid5.c b/drivers/md/raid5.c index e9bc323..52c0a3a 100644 --- a/drivers/md/raid5.c +++ b/drivers/md/raid5.c @@ -5154,7 +5154,7 @@ static void raid5_make_request(struct mddev *mddev, struct bio * bi) DEFINE_WAIT(w); bool do_prepare; - if (unlikely(bi->bi_rw & REQ_FLUSH)) { + if (unlikely(bi->bi_rw & REQ_PREFLUSH)) { int ret = r5l_handle_flush_request(conf->log, bi); if (ret == 0) diff --git a/fs/btrfs/check-integrity.c b/fs/btrfs/check-integrity.c index 9dc4394..c84379c 100644 --- a/fs/btrfs/check-integrity.c +++ b/fs/btrfs/check-integrity.c @@ -2205,7 +2205,7 @@ static void btrfsic_bio_end_io(struct bio *bp) block->dev_bytenr, block->mirror_num); next_block = block->next_in_same_bio; block->iodone_w_error = iodone_w_error; - if (block->submit_bio_bh_rw & REQ_FLUSH) { + if (block->submit_bio_bh_rw & REQ_PREFLUSH) { dev_state->last_flush_gen++; if ((dev_state->state->print_mask & BTRFSIC_PRINT_MASK_END_IO_BIO_BH)) @@ -2241,7 +2241,7 @@ static void btrfsic_bh_end_io(struct buffer_head *bh, int uptodate) block->dev_bytenr, block->mirror_num); block->iodone_w_error = iodone_w_error; - if (block->submit_bio_bh_rw & REQ_FLUSH) { + if (block->submit_bio_bh_rw & REQ_PREFLUSH) { dev_state->last_flush_gen++; if ((dev_state->state->print_mask & BTRFSIC_PRINT_MASK_END_IO_BIO_BH)) @@ -2882,7 +2882,7 @@ int btrfsic_submit_bh(int op, int op_flags, struct buffer_head *bh) btrfsic_process_written_block(dev_state, dev_bytenr, &bh->b_data, 1, NULL, NULL, bh, op_flags); - } else if (NULL != dev_state && (op_flags & REQ_FLUSH)) { + } else if (NULL != dev_state && (op_flags & REQ_PREFLUSH)) { if (dev_state->state->print_mask & BTRFSIC_PRINT_MASK_SUBMIT_BIO_BH) printk(KERN_INFO @@ -2980,7 +2980,7 @@ static void __btrfsic_submit_bio(struct bio *bio) kunmap(bio->bi_io_vec[i].bv_page); } kfree(mapped_datav); - } else if (NULL != dev_state && (bio->bi_rw & REQ_FLUSH)) { + } else if (NULL != dev_state && (bio->bi_rw & REQ_PREFLUSH)) { if (dev_state->state->print_mask & BTRFSIC_PRINT_MASK_SUBMIT_BIO_BH) printk(KERN_INFO diff --git a/fs/jbd2/journal.c b/fs/jbd2/journal.c index 8855f6b..815c9a8 100644 --- a/fs/jbd2/journal.c +++ b/fs/jbd2/journal.c @@ -1353,7 +1353,7 @@ static int jbd2_write_superblock(journal_t *journal, int write_flags) trace_jbd2_write_superblock(journal, write_flags); if (!(journal->j_flags & JBD2_BARRIER)) - write_flags &= ~(REQ_FUA | REQ_FLUSH); + write_flags &= ~(REQ_FUA | REQ_PREFLUSH); lock_buffer(bh); if (buffer_write_io_error(bh)) { /* diff --git a/fs/xfs/xfs_buf.c b/fs/xfs/xfs_buf.c index 917774e..0caffba 100644 --- a/fs/xfs/xfs_buf.c +++ b/fs/xfs/xfs_buf.c @@ -1242,7 +1242,7 @@ _xfs_buf_ioapply( if (bp->b_flags & XBF_FUA) op_flags |= REQ_FUA; if (bp->b_flags & XBF_FLUSH) - op_flags |= REQ_FLUSH; + op_flags |= REQ_PREFLUSH; /* * Run the write verifier callback function if it exists. If diff --git a/include/linux/blk_types.h b/include/linux/blk_types.h index f9e53ca..2b6583a 100644 --- a/include/linux/blk_types.h +++ b/include/linux/blk_types.h @@ -158,7 +158,7 @@ enum rq_flag_bits { __REQ_NOIDLE, /* don't anticipate more IO after this one */ __REQ_INTEGRITY, /* I/O includes block integrity payload */ __REQ_FUA, /* forced unit access */ - __REQ_FLUSH, /* request for cache flush */ + __REQ_PREFLUSH, /* request for cache flush */ /* bio only flags */ __REQ_RAHEAD, /* read ahead, can fail anytime */ @@ -202,12 +202,12 @@ enum rq_flag_bits { (REQ_FAILFAST_DEV | REQ_FAILFAST_TRANSPORT | REQ_FAILFAST_DRIVER) #define REQ_COMMON_MASK \ (REQ_FAILFAST_MASK | REQ_SYNC | REQ_META | REQ_PRIO | REQ_NOIDLE | \ - REQ_FLUSH | REQ_FUA | REQ_SECURE | REQ_INTEGRITY) + REQ_PREFLUSH | REQ_FUA | REQ_SECURE | REQ_INTEGRITY) #define REQ_CLONE_MASK REQ_COMMON_MASK /* This mask is used for both bio and request merge checking */ #define REQ_NOMERGE_FLAGS \ - (REQ_NOMERGE | REQ_STARTED | REQ_SOFTBARRIER | REQ_FLUSH | REQ_FUA | REQ_FLUSH_SEQ) + (REQ_NOMERGE | REQ_STARTED | REQ_SOFTBARRIER | REQ_PREFLUSH | REQ_FUA | REQ_FLUSH_SEQ) #define REQ_RAHEAD (1ULL << __REQ_RAHEAD) #define REQ_THROTTLED (1ULL << __REQ_THROTTLED) @@ -225,7 +225,7 @@ enum rq_flag_bits { #define REQ_PREEMPT (1ULL << __REQ_PREEMPT) #define REQ_ALLOCED (1ULL << __REQ_ALLOCED) #define REQ_COPY_USER (1ULL << __REQ_COPY_USER) -#define REQ_FLUSH (1ULL << __REQ_FLUSH) +#define REQ_PREFLUSH (1ULL << __REQ_PREFLUSH) #define REQ_FLUSH_SEQ (1ULL << __REQ_FLUSH_SEQ) #define REQ_IO_STAT (1ULL << __REQ_IO_STAT) #define REQ_MIXED_MERGE (1ULL << __REQ_MIXED_MERGE) diff --git a/include/linux/fs.h b/include/linux/fs.h index 7b57bb3..8f8881c 100644 --- a/include/linux/fs.h +++ b/include/linux/fs.h @@ -205,9 +205,9 @@ typedef void (dax_iodone_t)(struct buffer_head *bh_map, int uptodate); #define READ_SYNC REQ_SYNC #define WRITE_SYNC (REQ_SYNC | REQ_NOIDLE) #define WRITE_ODIRECT REQ_SYNC -#define WRITE_FLUSH (REQ_SYNC | REQ_NOIDLE | REQ_FLUSH) +#define WRITE_FLUSH (REQ_SYNC | REQ_NOIDLE | REQ_PREFLUSH) #define WRITE_FUA (REQ_SYNC | REQ_NOIDLE | REQ_FUA) -#define WRITE_FLUSH_FUA (REQ_SYNC | REQ_NOIDLE | REQ_FLUSH | REQ_FUA) +#define WRITE_FLUSH_FUA (REQ_SYNC | REQ_NOIDLE | REQ_PREFLUSH | REQ_FUA) /* * Attribute flags. These should be or-ed together to figure out what diff --git a/include/trace/events/f2fs.h b/include/trace/events/f2fs.h index 20f708e..1e5ab0c 100644 --- a/include/trace/events/f2fs.h +++ b/include/trace/events/f2fs.h @@ -33,7 +33,7 @@ TRACE_DEFINE_ENUM(SSR); TRACE_DEFINE_ENUM(__REQ_RAHEAD); TRACE_DEFINE_ENUM(__REQ_SYNC); TRACE_DEFINE_ENUM(__REQ_NOIDLE); -TRACE_DEFINE_ENUM(__REQ_FLUSH); +TRACE_DEFINE_ENUM(__REQ_PREFLUSH); TRACE_DEFINE_ENUM(__REQ_FUA); TRACE_DEFINE_ENUM(__REQ_PRIO); TRACE_DEFINE_ENUM(__REQ_META); diff --git a/kernel/trace/blktrace.c b/kernel/trace/blktrace.c index 3a54c83..c94dec7 100644 --- a/kernel/trace/blktrace.c +++ b/kernel/trace/blktrace.c @@ -189,6 +189,7 @@ static const u32 ddir_act[2] = { BLK_TC_ACT(BLK_TC_READ), BLK_TC_ACT(BLK_TC_WRITE) }; #define BLK_TC_RAHEAD BLK_TC_AHEAD +#define BLK_TC_PREFLUSH BLK_TC_FLUSH /* The ilog2() calls fall out because they're constant */ #define MASK_TC_BIT(rw, __name) ((rw & REQ_ ## __name) << \ @@ -219,7 +220,7 @@ static void __blk_add_trace(struct blk_trace *bt, sector_t sector, int bytes, what |= MASK_TC_BIT(op_flags, SYNC); what |= MASK_TC_BIT(op_flags, RAHEAD); what |= MASK_TC_BIT(op_flags, META); - what |= MASK_TC_BIT(op_flags, FLUSH); + what |= MASK_TC_BIT(op_flags, PREFLUSH); what |= MASK_TC_BIT(op_flags, FUA); if (op == REQ_OP_DISCARD) what |= BLK_TC_ACT(BLK_TC_DISCARD); @@ -1777,7 +1778,7 @@ void blk_fill_rwbs(char *rwbs, int op, u32 rw, int bytes) { int i = 0; - if (rw & REQ_FLUSH || + if (rw & REQ_PREFLUSH || op == REQ_OP_FLUSH) rwbs[i++] = 'F'; -- 1.8.3.1 From mchristi@redhat.com Wed Feb 24 14:27:41 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=ham version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay2.corp.sgi.com [137.38.102.29]) by oss.sgi.com (Postfix) with ESMTP id 1B2DA7FA8 for ; Wed, 24 Feb 2016 14:27:41 -0600 (CST) Received: from cuda.sgi.com (cuda3.sgi.com [192.48.176.15]) by relay2.corp.sgi.com (Postfix) with ESMTP id E0489304062 for ; Wed, 24 Feb 2016 12:27:34 -0800 (PST) X-ASG-Debug-ID: 1456343304-04cb6c455ad58c0001-NocioJ Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by cuda.sgi.com with ESMTP id GanitvLhBjgpmGBb (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO) for ; Wed, 24 Feb 2016 11:48:25 -0800 (PST) X-Barracuda-Envelope-From: mchristi@redhat.com X-Barracuda-Apparent-Source-IP: 209.132.183.28 X-ASG-Whitelist: Client Received: from int-mx09.intmail.prod.int.phx2.redhat.com (int-mx09.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by mx1.redhat.com (Postfix) with ESMTPS id 74021804F0; Wed, 24 Feb 2016 19:48:23 +0000 (UTC) Received: from rh2.redhat.com (vpn-54-14.rdu2.redhat.com [10.10.54.14]) by int-mx09.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id u1OJmJE5006684; Wed, 24 Feb 2016 14:48:19 -0500 From: mchristi@redhat.com To: linux-f2fs-devel@lists.sourceforge.net, linux-ext4@vger.kernel.org, konrad.wilk@oracle.com, drbd-dev@lists.linbit.com, philipp.reisner@linbit.com, lars.ellenberg@linbit.com, linux-raid@vger.kernel.org, dm-devel@redhat.com, linux-fsdevel@vger.kernel.org, linux-bcache@vger.kernel.org, linux-block@vger.kernel.org, linux-kernel@vger.kernel.org, linux-scsi@vger.kernel.org, linux-mtd@lists.infradead.org, target-devel@vger.kernel.org, linux-btrfs@vger.kernel.org, osd-dev@open-osd.org, xfs@oss.sgi.com, ocfs2-devel@oss.oracle.com Subject: [PATCH 00/35 v4] separate operations from flags in the bio/request structs Date: Wed, 24 Feb 2016 13:47:37 -0600 X-ASG-Orig-Subj: [PATCH 00/35 v4] separate operations from flags in the bio/request structs Message-Id: <1456343292-14535-1-git-send-email-mchristi@redhat.com> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.22 X-Barracuda-Connect: mx1.redhat.com[209.132.183.28] X-Barracuda-Start-Time: 1456343305 X-Barracuda-Encrypted: ECDHE-RSA-AES256-GCM-SHA384 X-Barracuda-URL: https://192.48.176.15:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-BRTS-Status: 1 The following patches begin to cleanup the request->cmd_flags and bio->bi_rw mess. We currently use cmd_flags to specify the operation, attributes and state of the request. For bi_rw we use it for similar info and also the priority but then also have another bi_flags field for state. At some point, we abused them so much we just made cmd_flags 64 bits, so we could add more. The following patches seperate the operation (read, write discard, flush, etc) from cmd_flags/bi_rw. This patchset was made against linux-next from today Feb 24 2016 (git tag next-20160224). I put a git tree here: https://github.com/mikechristie/linux-kernel.git v4: 1. Rebased to current linux-next tree. v3: 1. Used "=" instead of "|=" to setup bio bi_rw. 2. Removed __get_request cmd_flags compat code. 3. Merged initial dm related changes requested by Mike Snitzer. 4. Fixed ubd kbuild errors in flush related patches. 5. Fix 80 char col issues in several patches. 6. Fix issue with one of the btrfs patches where it looks like I reverted a patch when trying to fix a merge error. v2 1. Dropped arguments from submit_bio, and had callers setup bio. 2. Add REQ_OP_FLUSH for request_fn users and renamed REQ_FLUSH to REQ_PREFLUSH for make_request_fn users. 3. Dropped bio/rq_data_dir functions, and added a op_is_write function instead. From david@fromorbit.com Wed Feb 24 15:31:19 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=ham version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay2.corp.sgi.com [137.38.102.29]) by oss.sgi.com (Postfix) with ESMTP id 487997F5F for ; Wed, 24 Feb 2016 15:31:19 -0600 (CST) Received: from cuda.sgi.com (cuda2.sgi.com [192.48.176.25]) by relay2.corp.sgi.com (Postfix) with ESMTP id 1E8B9304032 for ; Wed, 24 Feb 2016 13:31:15 -0800 (PST) X-ASG-Debug-ID: 1456349472-04cbb06add103fa0001-NocioJ Received: from ipmail07.adl2.internode.on.net (ipmail07.adl2.internode.on.net [150.101.137.131]) by cuda.sgi.com with ESMTP id CE59RvcUbOYpB6mc for ; Wed, 24 Feb 2016 13:31:13 -0800 (PST) X-Barracuda-Envelope-From: david@fromorbit.com X-Barracuda-Apparent-Source-IP: 150.101.137.131 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: A2C/BwBwIM5W/z0ILHlegzqBP4JppCwBAQEBAQEGi3OJTYYIAgIBAQKBSE0BAQEBAQFlJ4RBAQEBAwEnExwjBQsIAxgJJQ8FJQMhE4gXB71uAQEBBwIBHRiFMoUChB+EUAWXB41Wjn2OSWKCAxmBXCguhieBOQEBAQ Received: from ppp121-44-8-61.lns20.syd4.internode.on.net (HELO dastard) ([121.44.8.61]) by ipmail07.adl2.internode.on.net with ESMTP; 25 Feb 2016 08:00:51 +1030 Received: from dave by dastard with local (Exim 4.80) (envelope-from ) id 1aYh14-0007EH-B6; Thu, 25 Feb 2016 08:30:38 +1100 Date: Thu, 25 Feb 2016 08:30:38 +1100 From: Dave Chinner To: Jean-Tiare Le Bigot Cc: xfs@oss.sgi.com Subject: Re: backport 7a29ac474a47eb8cf212b45917683ae89d6fa13b to stable ? Message-ID: <20160224213038.GK14668@dastard> X-ASG-Orig-Subj: Re: backport 7a29ac474a47eb8cf212b45917683ae89d6fa13b to stable ? References: <56CC852F.7010507@corp.ovh.com> <20160223224555.GM25832@dastard> <56CDE801.2030402@corp.ovh.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <56CDE801.2030402@corp.ovh.com> User-Agent: Mutt/1.5.21 (2010-09-15) X-Barracuda-Connect: ipmail07.adl2.internode.on.net[150.101.137.131] X-Barracuda-Start-Time: 1456349472 X-Barracuda-URL: https://192.48.176.25:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-BRTS-Status: 1 X-Barracuda-Spam-Score: 0.00 X-Barracuda-Spam-Status: No, SCORE=0.00 using per-user scores of TAG_LEVEL=1000.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.7 tests=BSF_SC0_MISMATCH_TO X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.3.27313 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 0.00 BSF_SC0_MISMATCH_TO Envelope rcpt doesn't match header On Wed, Feb 24, 2016 at 06:27:29PM +0100, Jean-Tiare Le Bigot wrote: > Hi, > > Thanks for having a look. > > On 02/23/2016 11:45 PM, Dave Chinner wrote: > > On Tue, Feb 23, 2016 at 05:13:35PM +0100, Jean-Tiare Le Bigot wrote: > >> Hi, > >> > >> We've hit kernel hang related to XFS reclaim under heavy I/O load on a > >> couple of storage servers using XFS over flashcache over a 3.13.y kernel. > >> > >> On the crash dumps, kthreadd is blocked, waiting for XFS to reclaim some > >> memory but the related reclaim job is queued on a worker_pool stuck > >> waiting for some I/O, itself depending on other jobs on other queues > >> which would require additional threads to go forward. Unfortunately > >> kthreadd is blocked. > >> The host has plenty of memory (~128GB), about 80% of which being used > >> for the page cache. > >> > >> It looks like this is fixed by commit > >> 7a29ac474a47eb8cf212b45917683ae89d6fa13b. > > > > That commit fixed a regression introduced, IIRC, in 3.19. The > > problem it fixed didn't exist before then, so I doubt you are seeing > > the problem that the above commit fixed. Perhaps you'd like to > > describe your problem along with the stack traces, etc so we have > > some idea of what you are trying to to fix? > > On the dump we investigated, kthreadd is stuck, waiting for some memory > > crash> bt 2 > PID: 2 TASK: ffff881fd2a39800 CPU: 0 COMMAND: "kthreadd" > #0 [ffff881fd2ab37c8] __schedule at ffffffff81724e19 > #1 [ffff881fd2ab3830] io_schedule at ffffffff817255fd > #2 [ffff881fd2ab3848] __xfs_iunpin_wait at ffffffffa06cf269 [xfs] > #3 [ffff881fd2ab38c0] xfs_iunpin_wait at ffffffffa06d2629 [xfs] > #4 [ffff881fd2ab38d0] xfs_reclaim_inode at ffffffffa068ed4c [xfs] > #5 [ffff881fd2ab3910] xfs_reclaim_inodes_ag at ffffffffa068f267 [xfs] > #6 [ffff881fd2ab3aa0] xfs_reclaim_inodes_nr at ffffffffa068fd73 [xfs] > #7 [ffff881fd2ab3ac0] xfs_fs_free_cached_objects at ffffffffa069a3a5 [xfs] > #8 [ffff881fd2ab3ad0] super_cache_scan at ffffffff811c13e9 > #9 [ffff881fd2ab3b18] shrink_slab at ffffffff81160f27 > #10 [ffff881fd2ab3bc0] do_try_to_free_pages at ffffffff8116405d > #11 [ffff881fd2ab3c38] try_to_free_pages at ffffffff8116429c > #12 [ffff881fd2ab3cd8] __alloc_pages_nodemask at ffffffff81158f15 > #13 [ffff881fd2ab3e10] copy_process at ffffffff810652b3 > #14 [ffff881fd2ab3e90] do_fork at ffffffff810669f5 > #15 [ffff881fd2ab3ef8] kernel_thread at ffffffff81066c86 > #16 [ffff881fd2ab3f08] kthreadd at ffffffff8108beea > #17 [ffff881fd2ab3f50] ret_from_fork at ffffffff817318bc So, it's waiting for a log force to complete because it needs to reclaim a dirty inode... > This triggered the insertion of a xfs-reclaim job for device dm-46 on > the workerpool bound to cpu #0 > > This xfs_reclaim job is the first *pending* job on the workerpool. The > workerpool has 2 active workers stuck in "xfs_log_worker" both blocked > in "xlog_state_get_iclog_space". My guess is they are waiting for some > underlying flashcache I/O (which won't happen, see below) > > > --> busy_hash aka busy workers: > crash> struct worker_pool.busy_hash 0xffff88207fc12d40 | grep -o 0xf.* > 0xffff8806dd3b5780 --> 132626 > --> in xfs_log_worker > --> in xlog_state_get_iclog_space > --> dm-40 > 0xffff88142d06ae80 --> 129142 > --> in xfs_log_worker > --> in xlog_state_get_iclog_space > --> dm-63 These are both waiting on IO completion of log IO. And the IO completion is blocked behind metadata buffer completion that is blocked waiting on locks. Yes, this can happen when we are running low on memory, but it can also occur when we hit maximum workqueue concurrency limits. The problem is not solved by adding a rescuer thread to the workqueue because it ends up blocking, too. > --> pending jobs: > crash> list -o work_struct.entry -s work_struct.func -H ffff88207fc12d58 > -x | awk 'BEGIN{w="";c=0} {if($1=="func") printf("%2d %s --> %s\n", c, > w, $4); else {w=$1;c++}}' > WORK FUNC DEVICE > 1 ffff881fceda6ca8 --> dm-46 > 2 ffff881fcd51bc28 --> dm-46 > 3 ffff88207fc0f3a0 --> N/A > ... > > To progress this queue needs either: > - the I/O to complete > - a new thread to handle the xfs_reclaim > (which does not trigger I/O in this context, If I got the code right) The reclaim worker runs background inode reclaim - it doesn't guarantee forwards progress. Running it won't make the log IO completion the kthreadd is waiting on complete any faster, because that's not what is preventing IO completion from running. > The I/O is stuck so we need a new thread. The pool manager requested > this thread BUT the request is pending in kthreadd queue. It is #5 in > the line Actually, we needed a different workqueue that is marked as a high priority workqueue so log IO completion doesn't get held up by metadata buffer IO completion waiting on locks and stalling. This is the problem that commit b29c70f59870 ("xfs: split metadata and log buffer completion to separate workqueues") addressed in 3.18 addressed. Remember how I said commit 7a29ac474 ("xfs: give all workqueues rescuer threads") fixed a regression we'd introduced, not the problem you are reporting? Yeah, in commit b29c70f59870 I forgot to add the WQ_MEM_RECLAIM to the m_log_workqueue when we moved all the log IO completions to it and that introduced the problem seen in subsequent kernels. Cheers, Dave. -- Dave Chinner david@fromorbit.com From fengguang.wu@intel.com Wed Feb 24 16:11:28 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.7 required=5.0 tests=FAKE_REPLY_C autolearn=no version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay2.corp.sgi.com [137.38.102.29]) by oss.sgi.com (Postfix) with ESMTP id 4457E7F77 for ; Wed, 24 Feb 2016 16:11:28 -0600 (CST) Received: from cuda.sgi.com (cuda1.sgi.com [192.48.157.11]) by relay2.corp.sgi.com (Postfix) with ESMTP id C874530405F for ; Wed, 24 Feb 2016 14:11:27 -0800 (PST) X-ASG-Debug-ID: 1456351886-04bdf07ab5140f40001-NocioJ Received: from mga11.intel.com ([192.55.52.93]) by cuda.sgi.com with ESMTP id r1VtvMO3GoazNxaa for ; Wed, 24 Feb 2016 14:11:26 -0800 (PST) X-Barracuda-Envelope-From: fengguang.wu@intel.com X-Barracuda-Apparent-Source-IP: 192.55.52.93 X-ASG-Whitelist: Client Received: from orsmga001.jf.intel.com ([10.7.209.18]) by fmsmga102.fm.intel.com with ESMTP; 24 Feb 2016 14:11:26 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.22,495,1449561600"; d="gz'50?scan'50,208,50";a="894012819" Received: from bee.sh.intel.com (HELO bee) ([10.239.97.14]) by orsmga001.jf.intel.com with ESMTP; 24 Feb 2016 14:11:21 -0800 Received: from kbuild by bee with local (Exim 4.83) (envelope-from ) id 1aYheL-000MCl-JX; Thu, 25 Feb 2016 06:11:13 +0800 Date: Thu, 25 Feb 2016 06:10:33 +0800 From: kbuild test robot To: mchristi@redhat.com Cc: kbuild-all@01.org, linux-f2fs-devel@lists.sourceforge.net, linux-ext4@vger.kernel.org, konrad.wilk@oracle.com, drbd-dev@lists.linbit.com, philipp.reisner@linbit.com, lars.ellenberg@linbit.com, linux-raid@vger.kernel.org, dm-devel@redhat.com, linux-fsdevel@vger.kernel.org, linux-bcache@vger.kernel.org, linux-block@vger.kernel.org, linux-kernel@vger.kernel.org, linux-scsi@vger.kernel.org, linux-mtd@lists.infradead.org, target-devel@vger.kernel.org, linux-btrfs@vger.kernel.org, osd-dev@open-osd.org, xfs@oss.sgi.com, ocfs2-devel@oss.oracle.com, Mike Christie Subject: Re: [PATCH 26/35] block: set op to REQ_OP Message-ID: <201602250636.ppkpGx7r%fengguang.wu@intel.com> X-ASG-Orig-Subj: Re: [PATCH 26/35] block: set op to REQ_OP MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="gBBFr7Ir9EOA20Yy" Content-Disposition: inline In-Reply-To: <1456343292-14535-27-git-send-email-mchristi@redhat.com> User-Agent: Mutt/1.5.23 (2014-03-12) X-SA-Exim-Connect-IP: X-SA-Exim-Mail-From: fengguang.wu@intel.com X-SA-Exim-Scanned: No (on bee); SAEximRunCond expanded to false X-Barracuda-Connect: UNKNOWN[192.55.52.93] X-Barracuda-Start-Time: 1456351886 X-Barracuda-URL: https://192.48.157.11:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-BRTS-Status: 1 --gBBFr7Ir9EOA20Yy Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Hi Mike, [auto build test WARNING on next-20160224] [cannot apply to dm/for-next v4.5-rc5 v4.5-rc4 v4.5-rc3 v4.5-rc5] [if your patch is applied to the wrong git tree, please drop us a note to help improving the system] url: https://github.com/0day-ci/linux/commits/mchristi-redhat-com/separate-operations-from-flags-in-the-bio-request-structs/20160225-041726 reproduce: make htmldocs All warnings (new ones prefixed by >>): lib/crc32.c:148: warning: No description found for parameter 'tab)[256]' lib/crc32.c:148: warning: Excess function parameter 'tab' description in 'crc32_le_generic' lib/crc32.c:293: warning: No description found for parameter 'tab)[256]' lib/crc32.c:293: warning: Excess function parameter 'tab' description in 'crc32_be_generic' lib/crc32.c:1: warning: no structured comments found >> block/blk-core.c:1248: warning: No description found for parameter 'op' >> block/blk-core.c:1248: warning: No description found for parameter 'op' vim +/op +1248 block/blk-core.c da8303c6 block/blk-core.c Tejun Heo 2011-10-19 1232 * @q: request_queue to allocate request from 3cbf3506 block/blk-core.c Mike Christie 2016-02-24 1233 * op: REQ_OP_READ/REQ_OP_WRITE 3cbf3506 block/blk-core.c Mike Christie 2016-02-24 1234 * @op_flags: rq_flag_bits da8303c6 block/blk-core.c Tejun Heo 2011-10-19 1235 * @bio: bio to allocate request for (can be %NULL) a06e05e6 block/blk-core.c Tejun Heo 2012-06-04 1236 * @gfp_mask: allocation mask da8303c6 block/blk-core.c Tejun Heo 2011-10-19 1237 * d0164adc block/blk-core.c Mel Gorman 2015-11-06 1238 * Get a free request from @q. If %__GFP_DIRECT_RECLAIM is set in @gfp_mask, d0164adc block/blk-core.c Mel Gorman 2015-11-06 1239 * this function keeps retrying under memory pressure and fails iff @q is dead. d6344532 drivers/block/ll_rw_blk.c Nick Piggin 2005-06-28 1240 * da3dae54 block/blk-core.c Masanari Iida 2014-09-09 1241 * Must be called with @q->queue_lock held and, a492f075 block/blk-core.c Joe Lawrence 2014-08-28 1242 * Returns ERR_PTR on failure, with @q->queue_lock held. a492f075 block/blk-core.c Joe Lawrence 2014-08-28 1243 * Returns request pointer on success, with @q->queue_lock *not held*. ^1da177e drivers/block/ll_rw_blk.c Linus Torvalds 2005-04-16 1244 */ 3cbf3506 block/blk-core.c Mike Christie 2016-02-24 1245 static struct request *get_request(struct request_queue *q, int op, 3cbf3506 block/blk-core.c Mike Christie 2016-02-24 1246 int op_flags, struct bio *bio, 3cbf3506 block/blk-core.c Mike Christie 2016-02-24 1247 gfp_t gfp_mask) ^1da177e drivers/block/ll_rw_blk.c Linus Torvalds 2005-04-16 @1248 { 3cbf3506 block/blk-core.c Mike Christie 2016-02-24 1249 const bool is_sync = rw_is_sync(op, op_flags) != 0; 450991bc drivers/block/ll_rw_blk.c Nick Piggin 2005-06-28 1250 DEFINE_WAIT(wait); a051661c block/blk-core.c Tejun Heo 2012-06-26 1251 struct request_list *rl; a06e05e6 block/blk-core.c Tejun Heo 2012-06-04 1252 struct request *rq; a051661c block/blk-core.c Tejun Heo 2012-06-26 1253 a051661c block/blk-core.c Tejun Heo 2012-06-26 1254 rl = blk_get_rl(q, bio); /* transferred to @rq on success */ a06e05e6 block/blk-core.c Tejun Heo 2012-06-04 1255 retry: 3cbf3506 block/blk-core.c Mike Christie 2016-02-24 1256 rq = __get_request(rl, op, op_flags, bio, gfp_mask); :::::: The code at line 1248 was first introduced by commit :::::: 1da177e4c3f41524e886b7f1b8a0c1fc7321cac2 Linux-2.6.12-rc2 :::::: TO: Linus Torvalds :::::: CC: Linus Torvalds --- 0-DAY kernel test infrastructure Open Source Technology Center https://lists.01.org/pipermail/kbuild-all Intel Corporation --gBBFr7Ir9EOA20Yy Content-Type: application/octet-stream Content-Disposition: attachment; filename=".config.gz" Content-Transfer-Encoding: base64 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 --gBBFr7Ir9EOA20Yy-- From sandeen@sandeen.net Wed Feb 24 16:24:07 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=ham version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay3.corp.sgi.com [198.149.34.15]) by oss.sgi.com (Postfix) with ESMTP id 491717FB4 for ; Wed, 24 Feb 2016 16:24:07 -0600 (CST) Received: from cuda.sgi.com (cuda2.sgi.com [192.48.176.25]) by relay3.corp.sgi.com (Postfix) with ESMTP id B0499AC002 for ; Wed, 24 Feb 2016 14:24:03 -0800 (PST) X-ASG-Debug-ID: 1456352640-04cbb06ade106310001-NocioJ Received: from sandeen.net (sandeen.net [63.231.237.45]) by cuda.sgi.com with ESMTP id xxtWzCxDQhoYZru5 for ; Wed, 24 Feb 2016 14:24:00 -0800 (PST) X-Barracuda-Envelope-From: sandeen@sandeen.net X-Barracuda-Apparent-Source-IP: 63.231.237.45 Received: from Liberator.example.com (74-95-67-117-Minnesota.hfc.comcastbusiness.net [74.95.67.117]) (using TLSv1.2 with cipher DHE-RSA-AES128-SHA (128/128 bits)) (No client certificate requested) by sandeen.net (Postfix) with ESMTPSA id 6B51463CE6BA for ; Wed, 24 Feb 2016 16:23:59 -0600 (CST) Subject: Re: XFS Corruption To: xfs@oss.sgi.com X-ASG-Orig-Subj: Re: XFS Corruption References: From: Eric Sandeen Message-ID: <56CE2D7D.20800@sandeen.net> Date: Wed, 24 Feb 2016 16:23:57 -0600 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.11; rv:38.0) Gecko/20100101 Thunderbird/38.6.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit X-Barracuda-Connect: sandeen.net[63.231.237.45] X-Barracuda-Start-Time: 1456352640 X-Barracuda-URL: https://192.48.176.25:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-BRTS-Status: 1 X-Barracuda-Spam-Score: 0.00 X-Barracuda-Spam-Status: No, SCORE=0.00 using per-user scores of TAG_LEVEL=1000.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.7 tests= X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.3.27314 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- On 2/24/16 12:12 AM, fangchen sun wrote: > Dear all: > > I have a ceph object storage cluster, and choose XFS as the underlying file system. > I recently ran into a problem that sometimes the function "setxattr()" failed, > I can only umount the disk and repair it with "xfs_repair". > > os: centos 6.5 > kernel version: 2.6.32 Problems with distribution kernels generally need to be reported and handled through your distribution. And when you do, providing the full unedited dmesg - which should include an actual description of the error from xfs, rather than just the backtrace below - and the results of the xfs_repair, will be necessary. Thanks, -Eric > the log for dmesg command: > [41796028.532225] Pid: 1438740, comm: ceph-osd Not tainted 2.6.32-925.431.23.3.letv.el6.x86_64 #1 > [41796028.532227] Call Trace: > [41796028.532255] [] ? xfs_error_report+0x3f/0x50 [xfs] > [41796028.532276] [] ? xfs_da_read_buf+0x2a/0x30 [xfs] > [41796028.532296] [] ? xfs_corruption_error+0x5e/0x90 [xfs] > [41796028.532316] [] ? xfs_da_do_buf+0x6cc/0x770 [xfs] > [41796028.532335] [] ? xfs_da_read_buf+0x2a/0x30 [xfs] > [41796028.532359] [] ? kmem_zone_alloc+0x77/0xf0 [xfs] > [41796028.532380] [] ? xfs_da_read_buf+0x2a/0x30 [xfs] > [41796028.532399] [] ? xfs_attr_leaf_addname+0x61/0x3d0 [xfs] > [41796028.532426] [] ? xfs_attr_leaf_addname+0x61/0x3d0 [xfs] > [41796028.532455] [] ? xfs_trans_add_item+0x57/0x70 [xfs] > [41796028.532476] [] ? xfs_bmbt_get_all+0x18/0x20 [xfs] > [41796028.532495] [] ? xfs_attr_set_int+0x3c4/0x510 [xfs] > [41796028.532517] [] ? xfs_da_do_buf+0x6db/0x770 [xfs] > [41796028.532536] [] ? xfs_attr_set+0x81/0x90 [xfs] > [41796028.532560] [] ? __xfs_xattr_set+0x43/0x60 [xfs] > [41796028.532584] [] ? xfs_xattr_user_set+0x11/0x20 [xfs] > [41796028.532592] [] ? generic_setxattr+0xa2/0xb0 > [41796028.532596] [] ? __vfs_setxattr_noperm+0x4e/0x160 > [41796028.532600] [] ? inode_permission+0xa7/0x100 > [41796028.532604] [] ? vfs_setxattr+0xbc/0xc0 > [41796028.532607] [] ? setxattr+0xd0/0x150 > [41796028.532612] [] ? __dequeue_entity+0x30/0x50 > [41796028.532617] [] ? __switch_to+0x26e/0x320 > [41796028.532621] [] ? __sb_start_write+0x80/0x120 > [41796028.532626] [] ? thread_return+0x4e/0x760 > [41796028.532630] [] ? sys_fsetxattr+0xad/0xd0 > [41796028.532633] [] ? system_call_fastpath+0x16/0x1b > [41796028.532636] XFS (sdi1): Corruption detected. Unmount and run xfs_repair > > Any comments will be much appreciated! > > Best Regards! > sunspot > > > _______________________________________________ > xfs mailing list > xfs@oss.sgi.com > http://oss.sgi.com/mailman/listinfo/xfs > From fengguang.wu@intel.com Wed Feb 24 19:47:06 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.7 required=5.0 tests=FAKE_REPLY_C autolearn=no version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay3.corp.sgi.com [198.149.34.15]) by oss.sgi.com (Postfix) with ESMTP id 9F7807CB5 for ; Wed, 24 Feb 2016 19:47:05 -0600 (CST) Received: from cuda.sgi.com (cuda2.sgi.com [192.48.176.25]) by relay3.corp.sgi.com (Postfix) with ESMTP id CDAD0AC005 for ; Wed, 24 Feb 2016 17:47:01 -0800 (PST) X-ASG-Debug-ID: 1456364820-04cbb06add10d2f0001-NocioJ Received: from mga04.intel.com ([192.55.52.120]) by cuda.sgi.com with ESMTP id 5H6oDRLAc5WYFoDr for ; Wed, 24 Feb 2016 17:47:00 -0800 (PST) X-Barracuda-Envelope-From: fengguang.wu@intel.com X-Barracuda-Apparent-Source-IP: 192.55.52.120 X-ASG-Whitelist: Client Received: from orsmga003.jf.intel.com ([10.7.209.27]) by fmsmga104.fm.intel.com with ESMTP; 24 Feb 2016 16:54:46 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.22,496,1449561600"; d="gz'50?scan'50,208,50";a="752758863" Received: from bee.sh.intel.com (HELO bee) ([10.239.97.14]) by orsmga003.jf.intel.com with ESMTP; 24 Feb 2016 16:54:40 -0800 Received: from kbuild by bee with local (Exim 4.83) (envelope-from ) id 1aYkCO-000UrH-HO; Thu, 25 Feb 2016 08:54:32 +0800 Date: Thu, 25 Feb 2016 08:54:08 +0800 From: kbuild test robot To: mchristi@redhat.com Cc: kbuild-all@01.org, linux-f2fs-devel@lists.sourceforge.net, linux-ext4@vger.kernel.org, konrad.wilk@oracle.com, drbd-dev@lists.linbit.com, philipp.reisner@linbit.com, lars.ellenberg@linbit.com, linux-raid@vger.kernel.org, dm-devel@redhat.com, linux-fsdevel@vger.kernel.org, linux-bcache@vger.kernel.org, linux-block@vger.kernel.org, linux-kernel@vger.kernel.org, linux-scsi@vger.kernel.org, linux-mtd@lists.infradead.org, target-devel@vger.kernel.org, linux-btrfs@vger.kernel.org, osd-dev@open-osd.org, xfs@oss.sgi.com, ocfs2-devel@oss.oracle.com, Mike Christie Subject: Re: [PATCH 31/35] block, fs: remove old REQ definitions. Message-ID: <201602250839.tv8OqUSP%fengguang.wu@intel.com> X-ASG-Orig-Subj: Re: [PATCH 31/35] block, fs: remove old REQ definitions. MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="mYCpIKhGyMATD0i+" Content-Disposition: inline In-Reply-To: <1456343292-14535-32-git-send-email-mchristi@redhat.com> User-Agent: Mutt/1.5.23 (2014-03-12) X-SA-Exim-Connect-IP: X-SA-Exim-Mail-From: fengguang.wu@intel.com X-SA-Exim-Scanned: No (on bee); SAEximRunCond expanded to false X-Barracuda-Connect: UNKNOWN[192.55.52.120] X-Barracuda-Start-Time: 1456364820 X-Barracuda-URL: https://192.48.176.25:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-BRTS-Status: 1 --mYCpIKhGyMATD0i+ Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Hi Mike, [auto build test WARNING on next-20160224] [cannot apply to dm/for-next v4.5-rc5 v4.5-rc4 v4.5-rc3 v4.5-rc5] [if your patch is applied to the wrong git tree, please drop us a note to help improving the system] url: https://github.com/0day-ci/linux/commits/mchristi-redhat-com/separate-operations-from-flags-in-the-bio-request-structs/20160225-041726 config: i386-allmodconfig (attached as .config) reproduce: # save the attached .config to linux build tree make ARCH=i386 All warnings (new ones prefixed by >>): In file included from include/linux/pagemap.h:8:0, from fs/crypto/crypto.c:24: fs/crypto/crypto.c: In function 'fscrypt_zeroout_range': >> include/linux/fs.h:198:19: warning: passing argument 1 of 'submit_bio_wait' makes pointer from integer without a cast [-Wint-conversion] #define RW_MASK REQ_OP_WRITE ^ include/linux/fs.h:202:17: note: in expansion of macro 'RW_MASK' #define WRITE RW_MASK ^ fs/crypto/crypto.c:325:25: note: in expansion of macro 'WRITE' err = submit_bio_wait(WRITE, bio); ^ In file included from fs/crypto/crypto.c:29:0: include/linux/bio.h:449:12: note: expected 'struct bio *' but argument is of type 'int' extern int submit_bio_wait(struct bio *bio); ^ fs/crypto/crypto.c:325:9: error: too many arguments to function 'submit_bio_wait' err = submit_bio_wait(WRITE, bio); ^ In file included from fs/crypto/crypto.c:29:0: include/linux/bio.h:449:12: note: declared here extern int submit_bio_wait(struct bio *bio); ^ vim +/submit_bio_wait +198 include/linux/fs.h 182 * READA Used for read-ahead operations. Lower priority, and the 183 * block layer could (in theory) choose to ignore this 184 * request if it runs into resource problems. 185 * WRITE A normal async write. Device will be plugged. 186 * WRITE_SYNC Synchronous write. Identical to WRITE, but passes down 187 * the hint that someone will be waiting on this IO 188 * shortly. The write equivalent of READ_SYNC. 189 * WRITE_ODIRECT Special case write for O_DIRECT only. 190 * WRITE_FLUSH Like WRITE_SYNC but with preceding cache flush. 191 * WRITE_FUA Like WRITE_SYNC but data is guaranteed to be on 192 * non-volatile media on completion. 193 * WRITE_FLUSH_FUA Combination of WRITE_FLUSH and FUA. The IO is preceded 194 * by a cache flush and data is guaranteed to be on 195 * non-volatile media on completion. 196 * 197 */ > 198 #define RW_MASK REQ_OP_WRITE 199 #define RWA_MASK REQ_RAHEAD 200 201 #define READ REQ_OP_READ 202 #define WRITE RW_MASK 203 #define READA RWA_MASK 204 205 #define READ_SYNC REQ_SYNC 206 #define WRITE_SYNC (REQ_SYNC | REQ_NOIDLE) --- 0-DAY kernel test infrastructure Open Source Technology Center https://lists.01.org/pipermail/kbuild-all Intel Corporation --mYCpIKhGyMATD0i+ Content-Type: application/octet-stream Content-Disposition: attachment; filename=".config.gz" Content-Transfer-Encoding: base64 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 NAZaGJYqr4ThAerqMPpK/T9QRzO8OVADAA== --mYCpIKhGyMATD0i+-- From OU6@kezbaLa.com Wed Feb 24 20:44:04 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: **** X-Spam-Status: No, score=4.8 required=5.0 tests=HTML_MESSAGE,INVALID_MSGID, MIME_HTML_ONLY autolearn=no version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay1.corp.sgi.com [137.38.102.111]) by oss.sgi.com (Postfix) with ESMTP id E243B7FA4 for ; Wed, 24 Feb 2016 20:44:04 -0600 (CST) Received: from cuda.sgi.com (cuda3.sgi.com [192.48.176.15]) by relay1.corp.sgi.com (Postfix) with ESMTP id B3F638F8035 for ; Wed, 24 Feb 2016 18:44:01 -0800 (PST) X-ASG-Debug-ID: 1456368237-04cb6c455be3b30001-NocioJ Received: from mail.kezbaLa.com ([104.223.139.14]) by cuda.sgi.com with ESMTP id 92G5ApztxozHcNUe for ; Wed, 24 Feb 2016 18:43:57 -0800 (PST) X-Barracuda-Envelope-From: OU6@kezbaLa.com X-Barracuda-Apparent-Source-IP: 104.223.139.14 Received: from cdghklops (unknown [116.21.136.132]) by mail.kezbaLa.com (Postfix) with ESMTP id A1F461BED6A for ; Thu, 25 Feb 2016 10:48:11 +0800 (CST) Date: Thu, 25 Feb 2016 10:43:50 +0800 From: "OU6" Reply-To: 2838481319@qq.com To: "xfs" Subject: =?GB2312?B?1bm74c2218q98LTzyrG85LbMo6zO3rn6zeK2qbWlxNHS1LvYsb6joQ==?= Message-ID: <201602251043509909257@kezbaLa.com > X-ASG-Orig-Subj: =?GB2312?B?1bm74c2218q98LTzyrG85LbMo6zO3rn6zeK2qbWlxNHS1LvYsb6joQ==?= X-Mailer: Foxmail 6, 10, 201, 20 [cn] MIME-Version: 1.0 Content-Type: text/html; charset="GB2312" Content-Transfer-Encoding: base64 X-Barracuda-Connect: UNKNOWN[104.223.139.14] X-Barracuda-Start-Time: 1456368237 X-Barracuda-URL: https://192.48.176.15:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-BRTS-Status: 1 X-Barracuda-Spam-Score: 2.11 X-Barracuda-Spam-Status: No, SCORE=2.11 using per-user scores of TAG_LEVEL=1000.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.7 tests=BSF_SC0_MV0141, HTML_MESSAGE, INVALID_MSGID, MIME_HTML_ONLY, RDNS_NONE X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.3.27324 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 0.00 MIME_HTML_ONLY BODY: Message only has text/html MIME parts 0.00 HTML_MESSAGE BODY: HTML included in message 0.01 INVALID_MSGID Message-Id is not valid, according to RFC 2822 0.10 RDNS_NONE Delivered to trusted network by a host with no rDNS 2.00 BSF_SC0_MV0141 Custom rule MV0141 PGh0bWw+DQogIDxoZWFkPg0KICAgIDx0aXRsZT48L3RpdGxlPg0KICAgIDxtZXRhIGNvbnRlbnQ9 InRleHQvaHRtbDsgY2hhcnNldD1nYjIzMTIiIGh0dHAtZXF1aXY9IkNvbnRlbnQtVHlwZSIgLz4N CiAgPC9oZWFkPg0KICA8Ym9keT4NCiAgICA8ZGl2PiYjMjQ3NDQ7JiMyMjkwOTshPC9kaXY+DQog ICAgPGRpdj4mbmJzcDs8L2Rpdj4NCiAgICA8ZGl2PiYjMjQ3NDQ7JiMzNjgyNDsmIzIyMzEyOyYj MjIzNTI7JiMzMTU2MTsmIzIyMjY5OyYjMjI4MDY7JiMyMzQ1ODsmIzI1MTQzOyYjMTk5Nzg7JiMz ODM3NjsmIzIxNTI3OyYjNjUzMTE7ICYjMjAwMjc7JiMyMTE2MDsmIzIwOTg2OyYjMjA5ODc7JiMy NTE2NTsmIzMzMDIxOyYjMjUyNTA7JiMyMTM0NDsmIzIzNDU4OyYjMjUxNDM7JiM2NTI5MjsmIzI1 MjUwOyYjMjEzNDQ7JiMzNTc0NjsmIzIxMzMzOyYjMTIyOTA7PC9kaXY+DQogICAgPGRpdj4mbmJz cDs8L2Rpdj4NCiAgICA8ZGl2PiYjMjA4NTE7JiMzODE5MDsmIzM1Nzg5OyYjMjU2Mjg7JiMzMjAz NDsmbmJzcDsmbmJzcDsgJiMyNjIzNDsmIzMzMDIxOyYjMzI2NzY7JiMyMTQ1NzsmbmJzcDsgJiMy NzU5OTsmIzIyODI1OyYjMTk5Nzg7JiMxOTk3NTsmIzM3MDM4OyYjMjAyMTQ7ICYjMjEzMTM7JiMy MDk2MDsmIzIwMDEwOyYjMzU4MTA7JiMzMDQyNDsgJiMzNTc0NjsmIzIxMzMzOyYjMzY3MzE7JiMy NjQ5NDsmIzI1MzQzOyYjNjUyODE7PC9kaXY+DQogICAgPGRpdj4mbmJzcDs8L2Rpdj4NCiAgICA8 ZGl2PiYjMjA4NDA7JiMyOTY5OTsmIzM2ODkwOyYjMjk5OTI7JiMyNTYyODsmIzMyMDM0OygxNCYj MjAwMTA7JiMxOTk5MDsmIzMwMDI4OyYjMjAwMjc7JiMyNzk2OTsmIzI0MzQxOyYjMjU4MDY7KSsm IzIwODQwOyYjMjk2OTk7ODAwJiMyMjgxMDsmIzIwMDEwOyYjMjIyNjk7JiMyMzQ3ODsmIzI1NjI4 OyYjMzIwMzQ7JiMyNDM0MTsmIzI1ODA2OyZuYnNwOyA8YnIgLz4xODgwJiMyMDgwMzsvJiMyMzM5 NTsmIzM2MjE1OyZuYnNwOyZuYnNwOyAyODgwJiMyMDgwMzsvJiMyNDE4MDsmIzM2MjE1OzwvZGl2 Pg0KICAgIDxkaXY+Jm5ic3A7PC9kaXY+DQogICAgPGRpdj4NCiAgICAgIDxkaXY+Ml44MzheNDgx XjMxOTwvZGl2PiYjMjc0NDI7JiMyMDEwMjsmIzM1Mjk5OyYjMjYzNTY7JiMyMjgxMDsmIzM1ODE0 OyYjMjQ3NzM7LCYjMzU4MzE7JiMzMTQzNTsmIzIxMzYzOyYjMjgxNTU7JiMyMTE1MjsmIzE5OTc4 OyYjMzg3NTQ7JiMzMDM0MDsmIzIxNjcyOyYjMzU4MTA7UVEmIzY1MjgxOyYjMjEzNjM7JiMyMTA1 MTsmIzIxMDMzOyYjMjk5OTI7JiMzNjE0OTsmIzIxNDk2OyYjMjQxMjA7JiMyOTk5MjsmIzIwMTM1 OyYjMjE2OTc7JiMzMzUyMTsmIzI1OTkxOyYjMjA4NTE7JiMzODE5MDsmIzM1Nzg5OyYjMzI0NzM7 JiMyNDc0NDsmIzI4NDM2OyYjMzEwMzQ7JiMzNjcxOTsmIzIwMjE0OyYjMjExNTE7JiMzMzAyMTsm IzIxNjQ0OyYjMjU5Mjg7JiMyNjUyNDsmIzMwMzQwOyYjNjUyODE7IA0KICAgIDwvZGl2Pg0KICA8 L2JvZHk+DQo8L2h0bWw+ From luisbg@osg.samsung.com Thu Feb 25 06:44:10 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=ham version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay2.corp.sgi.com [137.38.102.29]) by oss.sgi.com (Postfix) with ESMTP id 5672C7F92 for ; Thu, 25 Feb 2016 06:44:10 -0600 (CST) Received: from cuda.sgi.com (cuda1.sgi.com [192.48.157.11]) by relay2.corp.sgi.com (Postfix) with ESMTP id 0A888304043 for ; Thu, 25 Feb 2016 04:44:09 -0800 (PST) X-ASG-Debug-ID: 1456404247-04bdf07ab515d730001-NocioJ Received: from lists.s-osg.org (lists.s-osg.org [54.187.51.154]) by cuda.sgi.com with ESMTP id xiPFcaEAKHRAjhM4 for ; Thu, 25 Feb 2016 04:44:07 -0800 (PST) X-Barracuda-Envelope-From: luisbg@osg.samsung.com X-Barracuda-Apparent-Source-IP: 54.187.51.154 Received: from snow.seri.co.uk (cpc9-slam5-2-0-cust824.2-4.cable.virginm.net [81.108.163.57]) by lists.s-osg.org (Postfix) with ESMTPSA id 02225462C1; Thu, 25 Feb 2016 04:44:04 -0800 (PST) From: Luis de Bethencourt To: linux-kernel@vger.kernel.org Cc: xfs@oss.sgi.com, david@fromorbit.com, bfoster@redhat.com, sandeen@sandeen.net, namjae.jeon@samsung.com, cmaiolino@redhat.com, darrick.wong@oracle.com, billodo@redhat.com, Luis de Bethencourt Subject: [PATCH] xfs: remove impossible condition Date: Thu, 25 Feb 2016 12:43:57 +0000 X-ASG-Orig-Subj: [PATCH] xfs: remove impossible condition Message-Id: <1456404237-18169-1-git-send-email-luisbg@osg.samsung.com> X-Mailer: git-send-email 2.5.1 X-Barracuda-Connect: lists.s-osg.org[54.187.51.154] X-Barracuda-Start-Time: 1456404247 X-Barracuda-URL: https://192.48.157.11:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-BRTS-Status: 1 X-Barracuda-Spam-Score: 0.00 X-Barracuda-Spam-Status: No, SCORE=0.00 using per-user scores of TAG_LEVEL=1000.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.7 tests=BSF_SC0_MISMATCH_TO X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.3.27334 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 0.00 BSF_SC0_MISMATCH_TO Envelope rcpt doesn't match header bp_release is set to 0 just before the breakpoint of the for loop before the conditional check (in line 458). The other breakpoint is a goto that skips the dead code. Addresses-Coverity-Id: 102338 Signed-off-by: Luis de Bethencourt --- Hi, Thanks for reviewing this :) Luis fs/xfs/libxfs/xfs_bmap.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/fs/xfs/libxfs/xfs_bmap.c b/fs/xfs/libxfs/xfs_bmap.c index 6a05166..1171795 100644 --- a/fs/xfs/libxfs/xfs_bmap.c +++ b/fs/xfs/libxfs/xfs_bmap.c @@ -477,10 +477,7 @@ xfs_bmap_check_leaf_extents( } block = XFS_BUF_TO_BLOCK(bp); } - if (bp_release) { - bp_release = 0; - xfs_trans_brelse(NULL, bp); - } + return; error0: -- 2.5.1 From rjevskiy@gmail.com Thu Feb 25 09:21:04 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=FREEMAIL_FROM,T_DKIM_INVALID autolearn=ham version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay3.corp.sgi.com [198.149.34.15]) by oss.sgi.com (Postfix) with ESMTP id EEF267F91 for ; Thu, 25 Feb 2016 09:21:03 -0600 (CST) Received: from cuda.sgi.com (cuda1.sgi.com [192.48.157.11]) by relay3.corp.sgi.com (Postfix) with ESMTP id 80E9AAC005 for ; Thu, 25 Feb 2016 07:21:00 -0800 (PST) X-ASG-Debug-ID: 1456413655-04bdf07ab4161fb0001-NocioJ Received: from mail-lb0-f178.google.com (mail-lb0-f178.google.com [209.85.217.178]) by cuda.sgi.com with ESMTP id J0rWsD8emdtFAfg2 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128 verify=NO) for ; Thu, 25 Feb 2016 07:20:56 -0800 (PST) X-Barracuda-Envelope-From: rjevskiy@gmail.com X-Barracuda-Apparent-Source-IP: 209.85.217.178 Received: by mail-lb0-f178.google.com with SMTP id x1so30717680lbj.3 for ; Thu, 25 Feb 2016 07:20:56 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:from:to:subject:user-agent:date:message-id:mime-version :content-type; bh=zXu0cSDzNLPSQrmX1PI/TbHovlphFxRyS++29u1I6dE=; b=ciHFBjNwLzxHAHo7obfwI0G44tPEXDMAtElKH9c7asF+9uQUfQ15n6KA6Ohp9g3JRY 73DcFypGi5KoSxYzXtNRpp5+zUSHNioFUwYrtEZgfoKeQvUZq7jljkHdo8iyxkAw94tR JH6B1iOplKJ5/ekzdtSyF2htjB3n0fKMb2/bn6osg4BUEUfQXa9cYHUoMcw12O00g3ZD +dVfspc36EEbI1j7Zx6KbJXx/WfR17h4oSRHAUmgmwkAYf+o1xq3M5XJkyy/5bAaifoE 03Rgl9CCOtqVs1zVWr+7tEoRJiVeWG1uaJo8L155yEsxaPlsxQemqw12YaJMhrKQFKoL IpyQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:sender:from:to:subject:user-agent:date :message-id:mime-version:content-type; bh=zXu0cSDzNLPSQrmX1PI/TbHovlphFxRyS++29u1I6dE=; b=B+eKGid/hPuCknYQiLsyQ9n4JktOY3w3SSgwSQBJBIOhrKvLaxj76Kvsulc8twWwwg SUMh7T36tbxTu+Vxojr0BvaVda/7M8rZ+XBnS3S5pU8MuSrhWA46aB5x0Xb7QKYVTZY+ o1OxnoBN45nRO1NsEup0ftPR6YtYteT7FfYKG24cxnei8ASnZxMyngP5iuZAAXITdwvn 7a8ah5rClaHPqqBohRhu64LZHDt66HgdTF7clTnQ+DMNLW5+bR1JztJutIobIW9MA3vx Hu491gxahnNJ/S4J+MJYhGo3ADz8ZfzTcCaS6Ij7SSkc3Nl7iyX3n1SIzmhg9Jw1/xhy AfDg== X-Gm-Message-State: AG10YOSFThSTpr2i11uVKN02JXR2mZ5KRz6OJvcYbNx9AK9mHPG/wDIof6dLSEXYcCoz0g== X-Received: by 10.112.161.68 with SMTP id xq4mr7341813lbb.29.1456413655179; Thu, 25 Feb 2016 07:20:55 -0800 (PST) Received: from smtp.gmail.com ([195.214.234.4]) by smtp.gmail.com with ESMTPSA id rk1sm1248525lbb.0.2016.02.25.07.20.54 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 25 Feb 2016 07:20:54 -0800 (PST) Sender: Dmitry Monakhov From: Dmitry Monakhov To: xfs@oss.sgi.com Subject: [PATCH] xfs_io: Prevent devide by zero from {pread,pwrite}_random User-Agent: Notmuch/0.18.1 (http://notmuchmail.org) Emacs/24.3.1 (x86_64-redhat-linux-gnu) X-ASG-Orig-Subj: [PATCH] xfs_io: Prevent devide by zero from {pread,pwrite}_random Date: Thu, 25 Feb 2016 19:20:53 +0400 Message-ID: <8760xc3jfu.fsf@openvz.org> MIME-Version: 1.0 Content-Type: text/plain X-Barracuda-Connect: mail-lb0-f178.google.com[209.85.217.178] X-Barracuda-Start-Time: 1456413656 X-Barracuda-Encrypted: ECDHE-RSA-AES128-GCM-SHA256 X-Barracuda-URL: https://192.48.157.11:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-BRTS-Status: 1 X-Barracuda-Spam-Score: 0.00 X-Barracuda-Spam-Status: No, SCORE=0.00 using per-user scores of TAG_LEVEL=1000.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.7 tests=DKIM_SIGNED, DKIM_VERIFIED X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.3.27337 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- -0.00 DKIM_VERIFIED Domain Keys Identified Mail: signature passes verification 0.00 DKIM_SIGNED Domain Keys Identified Mail: message has a signature Math is wrong if range requested is less or equals to block size xfs_io -c 'pwrite -b 4k 8k 4k -R' \ -c 'pread -b 4k 4k 4k -R' -f file Signed-off-by: Dmitry Monakhov --- io/pread.c | 6 +++++- io/pwrite.c | 6 +++++- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/io/pread.c b/io/pread.c index f16c86c..b98355f 100644 --- a/io/pread.c +++ b/io/pread.c @@ -245,7 +245,11 @@ read_random( *total = 0; while (count > 0) { - off = ((offset + (random() % range)) / buffersize) * buffersize; + if (range) + off = ((offset + (random() % range)) / buffersize) * + buffersize; + else + off = offset; bytes = do_pread(fd, off, buffersize, buffersize); if (bytes == 0) break; diff --git a/io/pwrite.c b/io/pwrite.c index 4fc8de6..67631ce 100644 --- a/io/pwrite.c +++ b/io/pwrite.c @@ -128,7 +128,11 @@ write_random( *total = 0; while (count > 0) { - off = ((offset + (random() % range)) / buffersize) * buffersize; + if (range) + off = ((offset + (random() % range)) / buffersize) * + buffersize; + else + off = offset; bytes = do_pwrite(file->fd, off, buffersize, buffersize); if (bytes == 0) break; -- 1.8.3.1 From jean-tiare.le-bigot@corp.ovh.com Thu Feb 25 10:45:38 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=ham version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay1.corp.sgi.com [137.38.102.111]) by oss.sgi.com (Postfix) with ESMTP id 54FDF7F91 for ; Thu, 25 Feb 2016 10:45:38 -0600 (CST) Received: from cuda.sgi.com (cuda2.sgi.com [192.48.176.25]) by relay1.corp.sgi.com (Postfix) with ESMTP id 248C18F8035 for ; Thu, 25 Feb 2016 08:45:34 -0800 (PST) X-ASG-Debug-ID: 1456418731-04cbb06ade132200001-NocioJ Received: from 6.mo175.mail-out.ovh.net (6.mo175.mail-out.ovh.net [46.105.47.107]) by cuda.sgi.com with ESMTP id vLnBapJbbd6GIesC (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO) for ; Thu, 25 Feb 2016 08:45:31 -0800 (PST) X-Barracuda-Envelope-From: jean-tiare.le-bigot@corp.ovh.com X-Barracuda-Apparent-Source-IP: 46.105.47.107 Received: from ex2.OVH.local (corp.ovh.com [5.196.251.137]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits)) (No client certificate requested) by mo175.mail-out.ovh.net (Postfix) with ESMTPS id BC69CFF8099; Thu, 25 Feb 2016 17:45:30 +0100 (CET) Received: from [10.42.109.126] (109.190.254.34) by ex2.OVH.local (172.16.7.2) with Microsoft SMTP Server (TLS) id 15.1.225.42; Thu, 25 Feb 2016 17:45:30 +0100 Message-ID: <56CF2FC1.10506@corp.ovh.com> Date: Thu, 25 Feb 2016 17:45:53 +0100 From: Jean-Tiare Le Bigot User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20131118 Thunderbird/17.0.11 MIME-Version: 1.0 To: Dave Chinner CC: Subject: Re: backport 7a29ac474a47eb8cf212b45917683ae89d6fa13b to stable ? References: <56CC852F.7010507@corp.ovh.com> <20160223224555.GM25832@dastard> <56CDE801.2030402@corp.ovh.com> <20160224213038.GK14668@dastard> X-ASG-Orig-Subj: Re: backport 7a29ac474a47eb8cf212b45917683ae89d6fa13b to stable ? In-Reply-To: <20160224213038.GK14668@dastard> X-Enigmail-Version: 1.6 Content-Type: text/plain; charset="ISO-8859-1" Content-Transfer-Encoding: 7bit X-Originating-IP: [109.190.254.34] X-ClientProxiedBy: cas02.OVH.local (172.16.1.2) To ex2.OVH.local (172.16.7.2) X-Ovh-Tracer-Id: 3434557667438615913 X-VR-SPAMSTATE: OK X-VR-SPAMSCORE: 0 X-VR-SPAMCAUSE: gggruggvucftvghtrhhoucdtuddrfeekjedriedugdehgecutefuodetggdotffvucfrrhhofhhilhgvmecuqfggjfenuceurghilhhouhhtmecufedttdenuc X-Barracuda-Connect: 6.mo175.mail-out.ovh.net[46.105.47.107] X-Barracuda-Start-Time: 1456418731 X-Barracuda-Encrypted: ECDHE-RSA-AES256-GCM-SHA384 X-Barracuda-URL: https://192.48.176.25:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-BRTS-Status: 1 X-Barracuda-Spam-Score: 0.00 X-Barracuda-Spam-Status: No, SCORE=0.00 using per-user scores of TAG_LEVEL=1000.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.7 tests=BSF_SC0_MISMATCH_TO X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.3.27338 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 0.00 BSF_SC0_MISMATCH_TO Envelope rcpt doesn't match header Thanks for these in depth explanations. I understood my mistake. "xfs_reclaim_inodes_nr" ensures the background job on queue #0 is scheduled but also run a synchronous reclaim which is blocked by the I/O. For some reason, I focused on the job and completely forgot the synchronous part. Hence the only way to fix this hang is to fix flashcache to use a dedicated queue with a rescuer thread. Which has nothing to do with XFS. Regards, On 02/24/2016 10:30 PM, Dave Chinner wrote: > On Wed, Feb 24, 2016 at 06:27:29PM +0100, Jean-Tiare Le Bigot wrote: >> Hi, >> >> Thanks for having a look. >> >> On 02/23/2016 11:45 PM, Dave Chinner wrote: >>> On Tue, Feb 23, 2016 at 05:13:35PM +0100, Jean-Tiare Le Bigot wrote: >>>> Hi, >>>> >>>> We've hit kernel hang related to XFS reclaim under heavy I/O load on a >>>> couple of storage servers using XFS over flashcache over a 3.13.y kernel. >>>> >>>> On the crash dumps, kthreadd is blocked, waiting for XFS to reclaim some >>>> memory but the related reclaim job is queued on a worker_pool stuck >>>> waiting for some I/O, itself depending on other jobs on other queues >>>> which would require additional threads to go forward. Unfortunately >>>> kthreadd is blocked. >>>> The host has plenty of memory (~128GB), about 80% of which being used >>>> for the page cache. >>>> >>>> It looks like this is fixed by commit >>>> 7a29ac474a47eb8cf212b45917683ae89d6fa13b. >>> >>> That commit fixed a regression introduced, IIRC, in 3.19. The >>> problem it fixed didn't exist before then, so I doubt you are seeing >>> the problem that the above commit fixed. Perhaps you'd like to >>> describe your problem along with the stack traces, etc so we have >>> some idea of what you are trying to to fix? >> >> On the dump we investigated, kthreadd is stuck, waiting for some memory >> >> crash> bt 2 >> PID: 2 TASK: ffff881fd2a39800 CPU: 0 COMMAND: "kthreadd" >> #0 [ffff881fd2ab37c8] __schedule at ffffffff81724e19 >> #1 [ffff881fd2ab3830] io_schedule at ffffffff817255fd >> #2 [ffff881fd2ab3848] __xfs_iunpin_wait at ffffffffa06cf269 [xfs] >> #3 [ffff881fd2ab38c0] xfs_iunpin_wait at ffffffffa06d2629 [xfs] >> #4 [ffff881fd2ab38d0] xfs_reclaim_inode at ffffffffa068ed4c [xfs] >> #5 [ffff881fd2ab3910] xfs_reclaim_inodes_ag at ffffffffa068f267 [xfs] >> #6 [ffff881fd2ab3aa0] xfs_reclaim_inodes_nr at ffffffffa068fd73 [xfs] >> #7 [ffff881fd2ab3ac0] xfs_fs_free_cached_objects at ffffffffa069a3a5 [xfs] >> #8 [ffff881fd2ab3ad0] super_cache_scan at ffffffff811c13e9 >> #9 [ffff881fd2ab3b18] shrink_slab at ffffffff81160f27 >> #10 [ffff881fd2ab3bc0] do_try_to_free_pages at ffffffff8116405d >> #11 [ffff881fd2ab3c38] try_to_free_pages at ffffffff8116429c >> #12 [ffff881fd2ab3cd8] __alloc_pages_nodemask at ffffffff81158f15 >> #13 [ffff881fd2ab3e10] copy_process at ffffffff810652b3 >> #14 [ffff881fd2ab3e90] do_fork at ffffffff810669f5 >> #15 [ffff881fd2ab3ef8] kernel_thread at ffffffff81066c86 >> #16 [ffff881fd2ab3f08] kthreadd at ffffffff8108beea >> #17 [ffff881fd2ab3f50] ret_from_fork at ffffffff817318bc > > So, it's waiting for a log force to complete because it needs to > reclaim a dirty inode... > >> This triggered the insertion of a xfs-reclaim job for device dm-46 on >> the workerpool bound to cpu #0 >> >> This xfs_reclaim job is the first *pending* job on the workerpool. The >> workerpool has 2 active workers stuck in "xfs_log_worker" both blocked >> in "xlog_state_get_iclog_space". My guess is they are waiting for some >> underlying flashcache I/O (which won't happen, see below) >> >> >> --> busy_hash aka busy workers: >> crash> struct worker_pool.busy_hash 0xffff88207fc12d40 | grep -o 0xf.* >> 0xffff8806dd3b5780 --> 132626 >> --> in xfs_log_worker >> --> in xlog_state_get_iclog_space >> --> dm-40 >> 0xffff88142d06ae80 --> 129142 >> --> in xfs_log_worker >> --> in xlog_state_get_iclog_space >> --> dm-63 > > These are both waiting on IO completion of log IO. And the IO > completion is blocked behind metadata buffer completion that is > blocked waiting on locks. Yes, this can happen when we are running > low on memory, but it can also occur when we hit maximum workqueue > concurrency limits. The problem is not solved by adding a rescuer > thread to the workqueue because it ends up blocking, too. > >> --> pending jobs: >> crash> list -o work_struct.entry -s work_struct.func -H ffff88207fc12d58 >> -x | awk 'BEGIN{w="";c=0} {if($1=="func") printf("%2d %s --> %s\n", c, >> w, $4); else {w=$1;c++}}' >> WORK FUNC DEVICE >> 1 ffff881fceda6ca8 --> dm-46 >> 2 ffff881fcd51bc28 --> dm-46 >> 3 ffff88207fc0f3a0 --> N/A >> ... >> >> To progress this queue needs either: >> - the I/O to complete >> - a new thread to handle the xfs_reclaim >> (which does not trigger I/O in this context, If I got the code right) > > The reclaim worker runs background inode reclaim - it doesn't > guarantee forwards progress. Running it won't make the log IO > completion the kthreadd is waiting on complete any faster, because > that's not what is preventing IO completion from running. > >> The I/O is stuck so we need a new thread. The pool manager requested >> this thread BUT the request is pending in kthreadd queue. It is #5 in >> the line > > Actually, we needed a different workqueue that is marked as a high > priority workqueue so log IO completion doesn't get held up by > metadata buffer IO completion waiting on locks and stalling. This > is the problem that commit b29c70f59870 ("xfs: split metadata and > log buffer completion to separate workqueues") addressed in 3.18 > addressed. > > Remember how I said commit 7a29ac474 ("xfs: give all workqueues > rescuer threads") fixed a regression we'd introduced, not the > problem you are reporting? Yeah, in commit b29c70f59870 I forgot to > add the WQ_MEM_RECLAIM to the m_log_workqueue when we moved all the > log IO completions to it and that introduced the problem seen in > subsequent kernels. > > Cheers, > > Dave. > -- Jean-Tiare Le Bigot, OVH From paul.cannon3128@gmail.com Thu Feb 25 14:57:25 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.3 required=5.0 tests=FREEMAIL_ENVFROM_END_DIGIT, FREEMAIL_FROM,HTML_MESSAGE,T_DKIM_INVALID autolearn=no version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay1.corp.sgi.com [137.38.102.111]) by oss.sgi.com (Postfix) with ESMTP id 69CCD7F92 for ; Thu, 25 Feb 2016 14:57:25 -0600 (CST) Received: from cuda.sgi.com (cuda1.sgi.com [192.48.157.11]) by relay1.corp.sgi.com (Postfix) with ESMTP id 0F9908F8033 for ; Thu, 25 Feb 2016 12:57:25 -0800 (PST) X-ASG-Debug-ID: 1456433842-04bdf002ec09f50001-NocioJ Received: from mail-yw0-f171.google.com (mail-yw0-f171.google.com [209.85.161.171]) by cuda.sgi.com with ESMTP id dle4fYuT2rj9R5cr (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128 verify=NO) for ; Thu, 25 Feb 2016 12:57:22 -0800 (PST) X-Barracuda-Envelope-From: paul.cannon3128@gmail.com X-Barracuda-Apparent-Source-IP: 209.85.161.171 Received: by mail-yw0-f171.google.com with SMTP id h129so53225535ywb.1 for ; Thu, 25 Feb 2016 12:57:22 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; bh=7BDSMfUECBuJQhJ7OWZuYH2JE9eKUVhpk495lW5blmA=; b=Ma+8Fu4JNTYh3AmfYb8ukovlZUg6C8tGBIgLgSKv9qt1LrL/GlFuNCynAle0Y2yR8a DzmKuA+f8N3b7xYrXDhAQF8/GAWjlMxWNP+c7PrFTTb3fWqKpWs3bRdwdTtwItx+OAnP aura72R6wK8LqLcm1QDTZvf4f0PQcEqXrOa8uJxVhZorCfKUIWN+JcYtUxiWw5BEQ5T7 BoDUzAmP59SvxlneZ/hU1Jx+5ZHRhJBGYea7t3IDGCxfn4N+NhD226EdrJNjbrdyd94m w75oruBpk/4Yj1EEBHHNN9Reo/nJDxQkTKGu1V1LcegYl/kXkVjxOkqi7PQ+uy2UsY9E 64pA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:date :message-id:subject:from:to:content-type; bh=7BDSMfUECBuJQhJ7OWZuYH2JE9eKUVhpk495lW5blmA=; b=QBr00aGmMXMEJde9eRog84qpwd+3fpibZu5PmKos3pW9Tbxn6QIjxYyIyShbMWiwtg ApcyXT1lj2Qj2DFcpJkdzAOfNGu9UP/6yeWPfiV4GN3Y+IvLdCQocSz8vQXuVKvN6oxC Gv+tZGEXD6G3z2ockfSpFQN63gP2+ZpemlonXJrIWD13v/WS1LDTioN9aWNgZ8cTL+pC kVIGu7pa3dB0wGOhmJExMu6VyxyzbXHVlBZb1XIhtOlSVpIaF75V8ANItDi4PfkmfCDs zYVAjZEXzILIwWmvC/zp7cuBpPUKV56M5DN5OHznYL7aY6xuiOnEe+zrXLfLGHPecWwm n0vA== X-Gm-Message-State: AG10YORKgKc19NjBOjHF38FWfm3+6RP+PoZfQxWgbZLkAxpPgKqhzf+SdLVtKcF+JJmfdSZl9mfhG88/ZJ9gzQ== MIME-Version: 1.0 X-Received: by 10.129.32.136 with SMTP id g130mr23551446ywg.112.1456433842058; Thu, 25 Feb 2016 12:57:22 -0800 (PST) Received: by 10.37.36.195 with HTTP; Thu, 25 Feb 2016 12:57:22 -0800 (PST) In-Reply-To: <20160224061258.GA19107@birch.djwong.org> References: <20160224061258.GA19107@birch.djwong.org> Date: Thu, 25 Feb 2016 15:57:22 -0500 Message-ID: Subject: Re: Accidental FS corruption: Mapping files to blocks From: Paul Cannon X-ASG-Orig-Subj: Re: Accidental FS corruption: Mapping files to blocks To: xfs@oss.sgi.com Content-Type: multipart/alternative; boundary=001a1141f788cb7d69052c9e6d85 X-Barracuda-Connect: mail-yw0-f171.google.com[209.85.161.171] X-Barracuda-Start-Time: 1456433842 X-Barracuda-Encrypted: ECDHE-RSA-AES128-GCM-SHA256 X-Barracuda-URL: https://192.48.157.11:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-BRTS-Status: 1 X-Barracuda-Spam-Score: 0.00 X-Barracuda-Spam-Status: No, SCORE=0.00 using per-user scores of TAG_LEVEL=1000.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.7 tests=DKIM_SIGNED, DKIM_VERIFIED, HTML_MESSAGE X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.3.27344 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- -0.00 DKIM_VERIFIED Domain Keys Identified Mail: signature passes verification 0.00 DKIM_SIGNED Domain Keys Identified Mail: message has a signature 0.00 HTML_MESSAGE BODY: HTML included in message --001a1141f788cb7d69052c9e6d85 Content-Type: text/plain; charset=UTF-8 Darrick, A million thanks! The xfs_db commands you sent worked. Here is the surgery I did. First rsync with -c was taking too long (more than a day with no reports as the data is 30+ TBs) and also --ignore-times did not give any information. So I used the xfs_db commands you had mentioned. It gave me a list of files in affected space. When I do a "diff -rq" with original data and the data in the corrupted space -- BAM! I see files are indeed different! Now I am going to delete the corrupted directory and copy from the old data archive. Thanks! Paul On Wed, Feb 24, 2016 at 1:12 AM, Darrick J. Wong wrote: > On Tue, Feb 23, 2016 at 10:37:36PM -0500, Paul Cannon wrote: > > I have accidentally damaged my XFS, and need help (and a little prayer). > > The way it happened will provide your daily amusement dose (and > hopefully a > > lesson). > > > > * What happened? > > I have two file systems xfsA (18 TBs on /dev/sdc1) and xfsB (36 TBs on > > /dev/sdd1). They were mounted and working fine. I accidentally executed > an > > old script that effectively ran the following command: > > >ddrescue /dev/sdc /dev/sdd sdc_sdd.log > > For those unfamiliar with the ddrescue command, it claims to rescue/image > > data from a drive A to B. It does multiple passes to rescue data with > > maximum efficiency. > > > > * Why did I do it? > > I am careless or dumb or may be a combination of both. But the fact that > > drives got remapped (sdc/sdd became sde/sdf and otherway around) might > also > > be part of it. > > > > * What happened to XFS on sdd (xfsB)? > > Luckily, the imaging started with an offset of about 2.7 TBs. Why? > Because > > this was a restart of ddrescue and it started from past point. IT WROTE a > > total of 6.1 GBs of data on sdd/xfsB > > > > So I quickly stopped as I realized my mistake. I ran xfs_repair on xfsB. > > Due to the offset of 2.7 TBs, metadata seemed fine. The xfs_repair shows > > everything is fine. But if I extract out data using (dd skip=2.7TB) into > a > > file -- I can see things are different! I recognize the abrupt change in > a > > text file, exactly where the data overwritten. > > > > * Luckily I have old copy of the original data! > > Good for you! Seriously. :D > > > So I did a rsync -rvn /olddata/ /xfsB > > Nothing! No difference in any data files. I even tried mirrordir, same > > thing -- nothing, no difference! > > rsync -c to force it to checksum the data blocks? > > By default I think it only compares file size and timestamps. > > > * Here is what I think is going on, and I need help. > > I suspect that the access time of the file/files stored at this location > > are perhaps in another location in inode (does this sound correct? I am a > > newbie to XFS). But the data itself has changed at the location. > > Quite possible. > > > * QUESTION: How do I find what files were stored at the location? I have > an > > EXACT location of the range affected. Once I find the affected files, I > can > > perhaps do further surgery. > > Sounds like something that the reverse-mapping btree and associated > GETFSMAP > ioctl could help solve ... too bad it only exists as experimental patches > to > the on-disk format. :( > > In the meantime, I guess you could umount the filesystem and run xfs_db on > it > to find out what was in the areas that got overwritten, assuming rsync -c > also > shows no difference. Something along the lines of: > > # xfs_db /dev/sdXX > xfs_db> blockget -n > xfs_db> fsblock > xfs_db> blockuse -n -c > > Have a look at the xfs_db manpage for more info on what those commands do. > > --D > > > > > Any help (and prayers) will be highly appreciated. > > > _______________________________________________ > > xfs mailing list > > xfs@oss.sgi.com > > http://oss.sgi.com/mailman/listinfo/xfs > > --001a1141f788cb7d69052c9e6d85 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
    Darrick,=C2=A0

    A million t= hanks! The xfs_db commands you sent worked.

    Here is the surgery I did. Firs= t rsync with -c was taking too long (more than a day with no reports as the= data is 30+ TBs) and also --ignore-times did not give any information.=C2= =A0

    So I used the xfs_db commands you had mentioned. It gave me a list of f= iles in affected space. When I do a "diff -rq" with original data= and the data in the corrupted space -- BAM! I see files are indeed differe= nt! Now I am going to delete the corrupted directory and copy from the old = data archive.

    Thanks!

    Paul

    On Wed, Feb 24, 2016 at 1:12 AM, Darrick J. Wong <darrick.wong@oracle.com> wrote:
    On Tue, Feb 23, 2016 at 10:= 37:36PM -0500, Paul Cannon wrote:
    > I have accidentally damaged my XFS, and need help (and a little prayer= ).
    > The way it happened will provide your daily amusement dose (and hopefu= lly a
    > lesson).
    >
    > * What happened?
    > I have two file systems xfsA (18 TBs on /dev/sdc1) and xfsB (36 TBs on=
    > /dev/sdd1). They were mounted and working fine. I accidentally execute= d an
    > old script that effectively ran the following command:
    > >ddrescue /dev/sdc /dev/sdd sdc_sdd.log
    > For those unfamiliar with the ddrescue command, it claims to rescue/im= age
    > data from a drive A to B. It does multiple passes to rescue data with<= br> > maximum efficiency.
    >
    > * Why did I do it?
    > I am careless or dumb or may be a combination of both. But the fact th= at
    > drives got remapped (sdc/sdd became sde/sdf and otherway around) might= also
    > be part of it.
    >
    > * What happened to XFS on sdd (xfsB)?
    > Luckily, the imaging started with an offset of about 2.7 TBs. Why? Bec= ause
    > this was a restart of ddrescue and it started from past point. IT WROT= E a
    > total of 6.1 GBs of data on sdd/xfsB
    >
    > So I quickly stopped as I realized my mistake. I ran xfs_repair on xfs= B.
    > Due to the offset of 2.7 TBs, metadata seemed fine. The xfs_repair sho= ws
    > everything is fine. But if I extract out data using (dd skip=3D2.7TB) = into a
    > file -- I can see things are different! I recognize the abrupt change = in a
    > text file, exactly where the data overwritten.
    >
    > * Luckily I have old copy of the original data!

    Good for you!=C2=A0 Seriously. :D

    > So I did a rsync -rvn /olddata/ /xfsB
    > Nothing! No difference in any data files. I even tried mirrordir, same=
    > thing -- nothing, no difference!

    rsync -c to force it to checksum the data blocks?

    By default I think it only compares file size and timestamps.

    > * Here is what I think is going on, and I need help.
    > I suspect that the access time of the file/files stored at this locati= on
    > are perhaps in another location in inode (does this sound correct? I a= m a
    > newbie to XFS). But the data itself has changed at the location.

    Quite possible.

    > * QUESTION: How do I find what files were stored at the location? I ha= ve an
    > EXACT location of the range affected. Once I find the affected files, = I can
    > perhaps do further surgery.

    Sounds like something that the reverse-mapping btree and associated = GETFSMAP
    ioctl could help solve ... too bad it only exists as experimental patches t= o
    the on-disk format. :(

    In the meantime, I guess you could umount the filesystem and run xfs_db on = it
    to find out what was in the areas that got overwritten, assuming rsync -c a= lso
    shows no difference.=C2=A0 Something along the lines of:

    # xfs_db /dev/sdXX
    xfs_db> blockget -n
    xfs_db> fsblock <block number of where the overwritten area starts>= ;
    xfs_db> blockuse -n -c <number of blocks you think got overwritten>= ;

    Have a look at the xfs_db manpage for more info on what those commands do.<= br>
    --D

    >
    > Any help (and prayers) will be highly appreciated.

    > _______________________________________________
    > xfs mailing list
    > xfs@oss.sgi.com
    > http://oss.sgi.com/mailman/listinfo/xfs


    --001a1141f788cb7d69052c9e6d85-- From pkalever@redhat.com Fri Feb 26 00:38:04 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=ham version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay3.corp.sgi.com [198.149.34.15]) by oss.sgi.com (Postfix) with ESMTP id 66BC37CA1 for ; Fri, 26 Feb 2016 00:38:04 -0600 (CST) Received: from cuda.sgi.com (cuda2.sgi.com [192.48.176.25]) by relay3.corp.sgi.com (Postfix) with ESMTP id CE66DAC001 for ; Thu, 25 Feb 2016 22:38:00 -0800 (PST) X-ASG-Debug-ID: 1456468677-04cbb00b7227a00001-NocioJ Received: from mx4-phx2.redhat.com (mx4-phx2.redhat.com [209.132.183.25]) by cuda.sgi.com with ESMTP id 6l1Z4FqJIPh1YW7u (version=TLSv1 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Thu, 25 Feb 2016 22:37:58 -0800 (PST) X-Barracuda-Envelope-From: pkalever@redhat.com X-Barracuda-Apparent-Source-IP: 209.132.183.25 Received: from zmail26.collab.prod.int.phx2.redhat.com (zmail26.collab.prod.int.phx2.redhat.com [10.5.83.33]) by mx4-phx2.redhat.com (8.13.8/8.13.8) with ESMTP id u1Q6bvst023374; Fri, 26 Feb 2016 01:37:57 -0500 Date: Fri, 26 Feb 2016 01:37:57 -0500 (EST) From: Prasanna Kumar Kalever To: xfs@oss.sgi.com Cc: Brian Foster , Dave Chinner Message-ID: <957291997.53773945.1456468677495.JavaMail.zimbra@redhat.com> In-Reply-To: <1112951359.53758727.1456466113255.JavaMail.zimbra@redhat.com> Subject: How to copy files with preserving reflinks ? MIME-Version: 1.0 X-ASG-Orig-Subj: How to copy files with preserving reflinks ? Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Originating-IP: [10.70.1.86] X-Mailer: Zimbra 8.0.6_GA_5922 (ZimbraWebClient - FF42 (Linux)/8.0.6_GA_5922) Thread-Topic: How to copy files with preserving reflinks ? Thread-Index: 5ens2e3ynh2AwTpa+0zLCF2xrhtXAQ== X-Barracuda-Connect: mx4-phx2.redhat.com[209.132.183.25] X-Barracuda-Start-Time: 1456468678 X-Barracuda-Encrypted: DHE-RSA-AES256-SHA X-Barracuda-URL: https://192.48.176.25:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-BRTS-Status: 1 X-Barracuda-Spam-Score: 0.02 X-Barracuda-Spam-Status: No, SCORE=0.02 using per-user scores of TAG_LEVEL=1000.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.7 tests=THREAD_INDEX, THREAD_TOPIC X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.3.27357 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 0.01 THREAD_INDEX thread-index: AcO7Y8iR61tzADqsRmmc5wNiFHEOig== 0.01 THREAD_TOPIC Thread-Topic: ...(Japanese Subject)... Hi, I have a VM file with reflinks to it, the reflinks were taken every night. My question is how to copy/migrate all these file to a different xfs partit= ion (which also have reflink enabled) without loosing the reflinks property= , else may lead to copy all the shared blocks per file which will cost larg= e disk space. I have tried to copy them using rsync as below: On Partition 1: ActualFile.img -- [1] Actaul Size 10GB + [2] Append 2GB + [3] Append 1GB ReflinkCopy1 -- [1] Actual Size 0 -- Shared blocks 10GB ReflinkCopy2 -- [2] Actual Size 0 -- Shared blocks 12GB I have first rsync the files into Partition 2 as below: # cd PARTITION2 # rsync /PARTITION1/ReflinkCopy1 ActualFile.img # du -sh ActualFile.img 10GB # cp --reflink=3Dalways ActualFile.img # rsync /PARTITION1/ReflinkCopy2 ActualFile.img # du -sh ActualFile.img 12GB # cp --reflink=3Dalways ActualFile.img # rsync /PARTITION1/ActualFile.img ActualFile.img But the size used by partition was 35GB (verified using df -h) instead of 1= 3GB=20 Also, where can I find reflink related tools ? Thanks, -Prasanna =E2=80=8B=20 From pkalever@redhat.com Fri Feb 26 01:31:38 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=ham version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay2.corp.sgi.com [137.38.102.29]) by oss.sgi.com (Postfix) with ESMTP id 97F557CB9 for ; Fri, 26 Feb 2016 01:31:38 -0600 (CST) Received: from cuda.sgi.com (cuda2.sgi.com [192.48.176.25]) by relay2.corp.sgi.com (Postfix) with ESMTP id 660B6304039 for ; Thu, 25 Feb 2016 23:31:38 -0800 (PST) X-ASG-Debug-ID: 1456471895-04cbb00b7128d90001-NocioJ Received: from mx6-phx2.redhat.com (mx6-phx2.redhat.com [209.132.183.39]) by cuda.sgi.com with ESMTP id WZpAyUGM8m9saeWa (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO) for ; Thu, 25 Feb 2016 23:31:35 -0800 (PST) X-Barracuda-Envelope-From: pkalever@redhat.com X-Barracuda-Apparent-Source-IP: 209.132.183.39 Received: from zmail26.collab.prod.int.phx2.redhat.com (zmail26.collab.prod.int.phx2.redhat.com [10.5.83.33]) by mx6-phx2.redhat.com (8.14.4/8.14.4) with ESMTP id u1Q7VYZH026254; Fri, 26 Feb 2016 02:31:34 -0500 Date: Fri, 26 Feb 2016 02:31:34 -0500 (EST) From: Prasanna Kumar Kalever To: xfs@oss.sgi.com Cc: Brian Foster , Dave Chinner Message-ID: <805263868.53795563.1456471894885.JavaMail.zimbra@redhat.com> In-Reply-To: <957291997.53773945.1456468677495.JavaMail.zimbra@redhat.com> References: <957291997.53773945.1456468677495.JavaMail.zimbra@redhat.com> Subject: Re: How to copy files with preserving reflinks ? MIME-Version: 1.0 X-ASG-Orig-Subj: Re: How to copy files with preserving reflinks ? Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Originating-IP: [10.70.1.86] X-Mailer: Zimbra 8.0.6_GA_5922 (ZimbraWebClient - FF42 (Linux)/8.0.6_GA_5922) Thread-Topic: How to copy files with preserving reflinks ? Thread-Index: 5ens2e3ynh2AwTpa+0zLCF2xrhtXAeQq870V X-Barracuda-Connect: mx6-phx2.redhat.com[209.132.183.39] X-Barracuda-Start-Time: 1456471895 X-Barracuda-Encrypted: ECDHE-RSA-AES256-GCM-SHA384 X-Barracuda-URL: https://192.48.176.25:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-BRTS-Status: 1 X-Barracuda-Spam-Score: 0.02 X-Barracuda-Spam-Status: No, SCORE=0.02 using per-user scores of TAG_LEVEL=1000.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.7 tests=THREAD_INDEX, THREAD_TOPIC X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.3.27358 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 0.01 THREAD_INDEX thread-index: AcO7Y8iR61tzADqsRmmc5wNiFHEOig== 0.01 THREAD_TOPIC Thread-Topic: ...(Japanese Subject)... On Friday, February 26, 2016 12:07:57 PM, Prasanna Kumar Kalever wrote: > Hi, >=20 > I have a VM file with reflinks to it, the reflinks were taken every night= . >=20 > My question is how to copy/migrate all these file to a different xfs > partition (which also have reflink enabled) without loosing the reflinks > property, else may lead to copy all the shared blocks per file which will > cost large disk space. >=20 > I have tried to copy them using rsync as below: >=20 > On Partition 1: >=20 > ActualFile.img -- [1] Actaul Size 10GB + [2] Append 2GB + [3] Append 1GB > ReflinkCopy1 -- [1] Actual Size 0 -- Shared blocks 10GB > ReflinkCopy2 -- [2] Actual Size 0 -- Shared blocks 12GB >=20 >=20 > I have first rsync the files into Partition 2 as below: >=20 > # cd PARTITION2 >=20 > # rsync /PARTITION1/ReflinkCopy1 ActualFile.img > # du -sh ActualFile.img > 10GB > # cp --reflink=3Dalways ActualFile.img >=20 > # rsync /PARTITION1/ReflinkCopy2 ActualFile.img > # du -sh ActualFile.img > 12GB > # cp --reflink=3Dalways ActualFile.img >=20 > # rsync /PARTITION1/ActualFile.img ActualFile.img >=20 > But the size used by partition was 35GB (verified using df -h) instead of > 13GB Hurreyyy!!!!.... err.. While experimenting with rsync found "--no-whole-file" && "--inplace" , wit= h these options it seems to be working #rsync --no-whole-file --inplace --human-readable --stats reflinks/file ..= /mount2/reflinks/file=20 Number of files: 1 (reg: 1) Number of created files: 0 Number of deleted files: 0 Number of regular files transferred: 1 Total file size: 69.63M bytes Total transferred file size: 69.63M bytes Literal data: 8.20M bytes Matched data: 61.43M bytes File list size: 0 File list generation time: 0.001 seconds File list transfer time: 0.000 seconds Total bytes sent: 8.23M Total bytes received: 54.95K But I still need to repeat the process of taking reflinks multiple times on= new partition (per file). Did not had luck to figure-out reflink related tools (du, ls ...) -Prasanna >=20 >=20 >=20 > Also, where can I find reflink related tools ? >=20 >=20 > Thanks, > -Prasanna =E2=80=8B >=20 >=20 >=20 From bfoster@redhat.com Fri Feb 26 12:02:35 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=ham version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay2.corp.sgi.com [137.38.102.29]) by oss.sgi.com (Postfix) with ESMTP id 8E8747CA3 for ; Fri, 26 Feb 2016 12:02:35 -0600 (CST) Received: from cuda.sgi.com (cuda2.sgi.com [192.48.176.25]) by relay2.corp.sgi.com (Postfix) with ESMTP id 6268D304043 for ; Fri, 26 Feb 2016 10:02:32 -0800 (PST) X-ASG-Debug-ID: 1456509750-04cbb00b6f3a490001-NocioJ Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by cuda.sgi.com with ESMTP id 3rHbZlyoBSp5IuqY (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO) for ; Fri, 26 Feb 2016 10:02:31 -0800 (PST) X-Barracuda-Envelope-From: bfoster@redhat.com X-Barracuda-Apparent-Source-IP: 209.132.183.28 X-ASG-Whitelist: Client Received: from int-mx11.intmail.prod.int.phx2.redhat.com (int-mx11.intmail.prod.int.phx2.redhat.com [10.5.11.24]) by mx1.redhat.com (Postfix) with ESMTPS id 77DBDC0A9CD9; Fri, 26 Feb 2016 18:02:30 +0000 (UTC) Received: from bfoster.bfoster (dhcp-41-22.bos.redhat.com [10.18.41.22]) by int-mx11.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id u1QI2U2f020794; Fri, 26 Feb 2016 13:02:30 -0500 Received: by bfoster.bfoster (Postfix, from userid 1000) id E152012596E; Fri, 26 Feb 2016 13:02:28 -0500 (EST) Date: Fri, 26 Feb 2016 13:02:28 -0500 From: Brian Foster To: Dave Chinner Cc: xfs@oss.sgi.com Subject: Re: [PATCH 09/15] xfs: remove timestamps from incore inode Message-ID: <20160226180228.GB26924@bfoster.bfoster> X-ASG-Orig-Subj: Re: [PATCH 09/15] xfs: remove timestamps from incore inode References: <1455693652-3899-1-git-send-email-david@fromorbit.com> <1455693652-3899-10-git-send-email-david@fromorbit.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1455693652-3899-10-git-send-email-david@fromorbit.com> User-Agent: Mutt/1.5.24 (2015-08-30) X-Scanned-By: MIMEDefang 2.68 on 10.5.11.24 X-Barracuda-Connect: mx1.redhat.com[209.132.183.28] X-Barracuda-Start-Time: 1456509751 X-Barracuda-Encrypted: ECDHE-RSA-AES256-GCM-SHA384 X-Barracuda-URL: https://192.48.176.25:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-BRTS-Status: 1 On Wed, Feb 17, 2016 at 06:20:46PM +1100, Dave Chinner wrote: > From: Dave Chinner > > Source kernel commit 3987848c7c2be112e03c82d03821b044f1c0edec > > The struct xfs_inode has two copies of the current timestamps in it, > one in the vfs inode and one in the struct xfs_icdinode. Now that we > no longer log the struct xfs_icdinode directly, we don't need to > keep the timestamps in this structure. instead we can copy them > straight out of the VFS inode when formatting the inode log item or > the on-disk inode. > > This reduces the struct xfs_inode in size by 24 bytes. > > Signed-off-by: Dave Chinner > Reviewed-by: Brian Foster > Reviewed-by: Christoph Hellwig > Signed-off-by: Dave Chinner > --- > db/check.c | 106 +++++++++++++++++++++++------------------------ > include/xfs_inode.h | 16 ++++++- > libxfs/libxfs_api_defs.h | 4 +- > libxfs/util.c | 17 ++++---- > libxfs/xfs_inode_buf.c | 91 ++++++++++++++++++++++++++++++++++------ > libxfs/xfs_inode_buf.h | 9 ++-- > libxfs/xfs_rtbitmap.c | 2 +- > mkfs/proto.c | 2 +- > 8 files changed, 162 insertions(+), 85 deletions(-) > ... > diff --git a/mkfs/proto.c b/mkfs/proto.c > index 21960d5..72a1576 100644 > --- a/mkfs/proto.c > +++ b/mkfs/proto.c > @@ -653,7 +653,7 @@ rtinit( > mp->m_sb.sb_rbmino = rbmip->i_ino; > rbmip->i_d.di_size = mp->m_sb.sb_rbmblocks * mp->m_sb.sb_blocksize; > rbmip->i_d.di_flags = XFS_DIFLAG_NEWRTBM; > - *(__uint64_t *)&rbmip->i_d.di_atime = 0; > + *(__uint64_t *)&VFS_I(mp->m_rbmip)->i_atime = 0; FYI, this bit causes a NULL dereference because we've switched to using mp->m_rbmip instead of rbmip, and mp->m_rbmip is not initialized until just below. I assume this can be fixed in-tree... Brian > libxfs_trans_log_inode(tp, rbmip, XFS_ILOG_CORE); > libxfs_log_sb(tp); > mp->m_rbmip = rbmip; > -- > 2.7.0 > > _______________________________________________ > xfs mailing list > xfs@oss.sgi.com > http://oss.sgi.com/mailman/listinfo/xfs From darrick.wong@oracle.com Fri Feb 26 13:35:11 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay1.corp.sgi.com [137.38.102.111]) by oss.sgi.com (Postfix) with ESMTP id 367BA7CA4 for ; Fri, 26 Feb 2016 13:35:11 -0600 (CST) Received: from cuda.sgi.com (cuda2.sgi.com [192.48.176.25]) by relay1.corp.sgi.com (Postfix) with ESMTP id F408E8F8039 for ; Fri, 26 Feb 2016 11:35:10 -0800 (PST) X-ASG-Debug-ID: 1456515306-04cbb00b713cca0001-NocioJ Received: from userp1040.oracle.com (userp1040.oracle.com [156.151.31.81]) by cuda.sgi.com with ESMTP id LHEL4OY0x671dBZE (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO) for ; Fri, 26 Feb 2016 11:35:06 -0800 (PST) X-Barracuda-Envelope-From: darrick.wong@oracle.com X-Barracuda-Apparent-Source-IP: 156.151.31.81 Received: from userv0022.oracle.com (userv0022.oracle.com [156.151.31.74]) by userp1040.oracle.com (Sentrion-MTA-4.3.2/Sentrion-MTA-4.3.2) with ESMTP id u1QJZ1sc028644 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 26 Feb 2016 19:35:01 GMT Received: from aserv0121.oracle.com (aserv0121.oracle.com [141.146.126.235]) by userv0022.oracle.com (8.14.4/8.13.8) with ESMTP id u1QJYxgV022499 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=FAIL); Fri, 26 Feb 2016 19:35:00 GMT Received: from abhmp0011.oracle.com (abhmp0011.oracle.com [141.146.116.17]) by aserv0121.oracle.com (8.13.8/8.13.8) with ESMTP id u1QJYwE7025924; Fri, 26 Feb 2016 19:34:58 GMT Received: from localhost (/10.145.179.157) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Fri, 26 Feb 2016 11:34:58 -0800 Date: Fri, 26 Feb 2016 11:34:56 -0800 From: "Darrick J. Wong" To: Brian Foster Cc: Dave Chinner , xfs@oss.sgi.com Subject: [PATCH] mkfs: fix crash when initializing rbmip Message-ID: <20160226193456.GA27973@birch.djwong.org> X-ASG-Orig-Subj: [PATCH] mkfs: fix crash when initializing rbmip MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.5.21 (2010-09-15) X-Source-IP: userv0022.oracle.com [156.151.31.74] X-Barracuda-Connect: userp1040.oracle.com[156.151.31.81] X-Barracuda-Start-Time: 1456515306 X-Barracuda-Encrypted: ECDHE-RSA-AES256-GCM-SHA384 X-Barracuda-URL: https://192.48.176.25:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-BRTS-Status: 1 X-Barracuda-Spam-Score: 0.00 X-Barracuda-Spam-Status: No, SCORE=0.00 using per-user scores of TAG_LEVEL=1000.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.7 tests=BSF_SC0_MISMATCH_TO, UNPARSEABLE_RELAY X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.3.27371 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 0.00 BSF_SC0_MISMATCH_TO Envelope rcpt doesn't match header 0.00 UNPARSEABLE_RELAY Informational: message has unparseable relay lines Initialize rbmip, log the inode, /then/ assign it to the xfs_mount. Don't try to access rbmip in the xfs_mount before that, or it'll crash. Signed-off-by: Darrick J. Wong --- mkfs/proto.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mkfs/proto.c b/mkfs/proto.c index 933924e..d99e965 100644 --- a/mkfs/proto.c +++ b/mkfs/proto.c @@ -653,7 +653,7 @@ rtinit( mp->m_sb.sb_rbmino = rbmip->i_ino; rbmip->i_d.di_size = mp->m_sb.sb_rbmblocks * mp->m_sb.sb_blocksize; rbmip->i_d.di_flags = XFS_DIFLAG_NEWRTBM; - *(__uint64_t *)&VFS_I(mp->m_rbmip)->i_atime = 0; + *(__uint64_t *)&VFS_I(rbmip)->i_atime = 0; libxfs_trans_log_inode(tp, rbmip, XFS_ILOG_CORE); libxfs_log_sb(tp); mp->m_rbmip = rbmip; From darrick.wong@oracle.com Fri Feb 26 13:36:07 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay3.corp.sgi.com [198.149.34.15]) by oss.sgi.com (Postfix) with ESMTP id 8ED717CA4 for ; Fri, 26 Feb 2016 13:36:07 -0600 (CST) Received: from cuda.sgi.com (cuda1.sgi.com [192.48.157.11]) by relay3.corp.sgi.com (Postfix) with ESMTP id 0C2BCAC002 for ; Fri, 26 Feb 2016 11:36:03 -0800 (PST) X-ASG-Debug-ID: 1456515359-04bdf002ec3dde0001-NocioJ Received: from aserp1040.oracle.com (aserp1040.oracle.com [141.146.126.69]) by cuda.sgi.com with ESMTP id nr9CbjFOJF5az75X (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO) for ; Fri, 26 Feb 2016 11:36:00 -0800 (PST) X-Barracuda-Envelope-From: darrick.wong@oracle.com X-Barracuda-Apparent-Source-IP: 141.146.126.69 Received: from userv0022.oracle.com (userv0022.oracle.com [156.151.31.74]) by aserp1040.oracle.com (Sentrion-MTA-4.3.2/Sentrion-MTA-4.3.2) with ESMTP id u1QJZwpu026442 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 26 Feb 2016 19:35:58 GMT Received: from userv0121.oracle.com (userv0121.oracle.com [156.151.31.72]) by userv0022.oracle.com (8.14.4/8.13.8) with ESMTP id u1QJZwZJ025581 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=FAIL); Fri, 26 Feb 2016 19:35:58 GMT Received: from abhmp0006.oracle.com (abhmp0006.oracle.com [141.146.116.12]) by userv0121.oracle.com (8.13.8/8.13.8) with ESMTP id u1QJZvDG000962; Fri, 26 Feb 2016 19:35:57 GMT Received: from localhost (/10.145.179.157) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Fri, 26 Feb 2016 11:35:57 -0800 Date: Fri, 26 Feb 2016 11:35:55 -0800 From: "Darrick J. Wong" To: Brian Foster Cc: Dave Chinner , xfs@oss.sgi.com Subject: Re: [PATCH 09/15] xfs: remove timestamps from incore inode Message-ID: <20160226193555.GB27973@birch.djwong.org> X-ASG-Orig-Subj: Re: [PATCH 09/15] xfs: remove timestamps from incore inode References: <1455693652-3899-1-git-send-email-david@fromorbit.com> <1455693652-3899-10-git-send-email-david@fromorbit.com> <20160226180228.GB26924@bfoster.bfoster> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20160226180228.GB26924@bfoster.bfoster> User-Agent: Mutt/1.5.21 (2010-09-15) X-Source-IP: userv0022.oracle.com [156.151.31.74] X-Barracuda-Connect: aserp1040.oracle.com[141.146.126.69] X-Barracuda-Start-Time: 1456515360 X-Barracuda-Encrypted: ECDHE-RSA-AES256-GCM-SHA384 X-Barracuda-URL: https://192.48.157.11:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-BRTS-Status: 1 X-Barracuda-Spam-Score: 0.00 X-Barracuda-Spam-Status: No, SCORE=0.00 using per-user scores of TAG_LEVEL=1000.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.7 tests=BSF_SC0_MISMATCH_TO, UNPARSEABLE_RELAY X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.3.27371 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 0.00 BSF_SC0_MISMATCH_TO Envelope rcpt doesn't match header 0.00 UNPARSEABLE_RELAY Informational: message has unparseable relay lines On Fri, Feb 26, 2016 at 01:02:28PM -0500, Brian Foster wrote: > On Wed, Feb 17, 2016 at 06:20:46PM +1100, Dave Chinner wrote: > > From: Dave Chinner > > > > Source kernel commit 3987848c7c2be112e03c82d03821b044f1c0edec > > > > The struct xfs_inode has two copies of the current timestamps in it, > > one in the vfs inode and one in the struct xfs_icdinode. Now that we > > no longer log the struct xfs_icdinode directly, we don't need to > > keep the timestamps in this structure. instead we can copy them > > straight out of the VFS inode when formatting the inode log item or > > the on-disk inode. > > > > This reduces the struct xfs_inode in size by 24 bytes. > > > > Signed-off-by: Dave Chinner > > Reviewed-by: Brian Foster > > Reviewed-by: Christoph Hellwig > > Signed-off-by: Dave Chinner > > --- > > db/check.c | 106 +++++++++++++++++++++++------------------------ > > include/xfs_inode.h | 16 ++++++- > > libxfs/libxfs_api_defs.h | 4 +- > > libxfs/util.c | 17 ++++---- > > libxfs/xfs_inode_buf.c | 91 ++++++++++++++++++++++++++++++++++------ > > libxfs/xfs_inode_buf.h | 9 ++-- > > libxfs/xfs_rtbitmap.c | 2 +- > > mkfs/proto.c | 2 +- > > 8 files changed, 162 insertions(+), 85 deletions(-) > > > ... > > diff --git a/mkfs/proto.c b/mkfs/proto.c > > index 21960d5..72a1576 100644 > > --- a/mkfs/proto.c > > +++ b/mkfs/proto.c > > @@ -653,7 +653,7 @@ rtinit( > > mp->m_sb.sb_rbmino = rbmip->i_ino; > > rbmip->i_d.di_size = mp->m_sb.sb_rbmblocks * mp->m_sb.sb_blocksize; > > rbmip->i_d.di_flags = XFS_DIFLAG_NEWRTBM; > > - *(__uint64_t *)&rbmip->i_d.di_atime = 0; > > + *(__uint64_t *)&VFS_I(mp->m_rbmip)->i_atime = 0; > > FYI, this bit causes a NULL dereference because we've switched to using > mp->m_rbmip instead of rbmip, and mp->m_rbmip is not initialized until > just below. I assume this can be fixed in-tree... I fixed it in the xfsprogs reflink tree that Dave is poking with, so I'll send the patch to the mailing list. --D > > Brian > > > libxfs_trans_log_inode(tp, rbmip, XFS_ILOG_CORE); > > libxfs_log_sb(tp); > > mp->m_rbmip = rbmip; > > -- > > 2.7.0 > > > > _______________________________________________ > > xfs mailing list > > xfs@oss.sgi.com > > http://oss.sgi.com/mailman/listinfo/xfs > > _______________________________________________ > xfs mailing list > xfs@oss.sgi.com > http://oss.sgi.com/mailman/listinfo/xfs From BATV+0b17a3f994a136f88c4a+4569+infradead.org+hch@bombadil.srs.infradead.org Fri Feb 26 13:42:25 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=ham version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay3.corp.sgi.com [198.149.34.15]) by oss.sgi.com (Postfix) with ESMTP id 4BD547CA7 for ; Fri, 26 Feb 2016 13:42:25 -0600 (CST) Received: from cuda.sgi.com (cuda2.sgi.com [192.48.176.25]) by relay3.corp.sgi.com (Postfix) with ESMTP id A558AAC003 for ; Fri, 26 Feb 2016 11:42:24 -0800 (PST) X-ASG-Debug-ID: 1456515741-04cbb00b703ce70001-NocioJ Received: from bombadil.infradead.org ([198.137.202.9]) by cuda.sgi.com with ESMTP id wxhTcCM0nlD5bVfp (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128 verify=NO) for ; Fri, 26 Feb 2016 11:42:21 -0800 (PST) X-Barracuda-Envelope-From: BATV+0b17a3f994a136f88c4a+4569+infradead.org+hch@bombadil.srs.infradead.org X-Barracuda-Apparent-Source-IP: 198.137.202.9 Received: from hch by bombadil.infradead.org with local (Exim 4.80.1 #2 (Red Hat Linux)) id 1aZOHL-0006Zt-VO; Fri, 26 Feb 2016 19:42:19 +0000 Date: Fri, 26 Feb 2016 11:42:19 -0800 From: Christoph Hellwig To: "Darrick J. Wong" Cc: Brian Foster , xfs@oss.sgi.com Subject: Re: [PATCH] mkfs: fix crash when initializing rbmip Message-ID: <20160226194219.GA24979@infradead.org> X-ASG-Orig-Subj: Re: [PATCH] mkfs: fix crash when initializing rbmip References: <20160226193456.GA27973@birch.djwong.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20160226193456.GA27973@birch.djwong.org> User-Agent: Mutt/1.5.24 (2015-08-30) X-SRS-Rewrite: SMTP reverse-path rewritten from by bombadil.infradead.org. See http://www.infradead.org/rpr.html X-Barracuda-Connect: UNKNOWN[198.137.202.9] X-Barracuda-Start-Time: 1456515741 X-Barracuda-Encrypted: ECDHE-RSA-AES128-GCM-SHA256 X-Barracuda-URL: https://192.48.176.25:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-BRTS-Status: 1 X-Barracuda-Spam-Score: 0.10 X-Barracuda-Spam-Status: No, SCORE=0.10 using per-user scores of TAG_LEVEL=1000.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.7 tests=BSF_SC0_MISMATCH_TO, RDNS_NONE X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.3.27371 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 0.00 BSF_SC0_MISMATCH_TO Envelope rcpt doesn't match header 0.10 RDNS_NONE Delivered to trusted network by a host with no rDNS Oops, should have cought that when reviewing. Reviewed-by: Christoph Hellwig From gkcapital@mail.com Fri Feb 26 17:43:25 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=FREEMAIL_FROM,HTML_MESSAGE, T_REMOTE_IMAGE autolearn=ham version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay3.corp.sgi.com [198.149.34.15]) by oss.sgi.com (Postfix) with ESMTP id B31377CA7 for ; Fri, 26 Feb 2016 17:43:24 -0600 (CST) Received: from cuda.sgi.com (cuda2.sgi.com [192.48.176.25]) by relay3.corp.sgi.com (Postfix) with ESMTP id 09F6AAC001 for ; Fri, 26 Feb 2016 15:43:23 -0800 (PST) X-ASG-Debug-ID: 1456530195-04cbb00b7141d00001-NocioJ Received: from 440198.s.dedikuoti.lt (440198.s.dedikuoti.lt [194.135.93.20]) by cuda.sgi.com with ESMTP id iUWSNMdaVDnJycis (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO) for ; Fri, 26 Feb 2016 15:43:15 -0800 (PST) X-Barracuda-Envelope-From: gkcapital@mail.com X-Barracuda-Apparent-Source-IP: 194.135.93.20 Received: from 440198.s.dedikuoti.lt ([194.135.93.20] helo=saugida.lt) by 440198.s.dedikuoti.lt with esmtpa (Exim 4.72) (envelope-from ) id 1aZS2U-0007rp-Ij for xfs@oss.sgi.com; Sat, 27 Feb 2016 01:43:14 +0200 Date: Fri, 26 Feb 2016 23:43:14 +0000 To: xfs@oss.sgi.com From: Aktuali informacija Reply-To: gkcapital@mail.com Subject: Aktuali informacija Message-ID: <071c22ef6924c6ed73506f43b4d11166@saugida.lt> X-ASG-Orig-Subj: Aktuali informacija X-Priority: 3 X-Mailer: MyMail 2.0.25 (5.2.7) by revaxarts X-MyMail: 4270f17ed2c398dc80227da2b694faa9 X-MyMail-Campaign: 3918 X-MyMail-ID: 664b90e6f904636e7cc207c9c80f4771 List-Unsubscribe: MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="b1_071c22ef6924c6ed73506f43b4d11166" Content-Transfer-Encoding: 8bit X-Barracuda-Connect: 440198.s.dedikuoti.lt[194.135.93.20] X-Barracuda-Start-Time: 1456530195 X-Barracuda-Encrypted: ECDHE-RSA-AES256-GCM-SHA384 X-Barracuda-URL: https://192.48.176.25:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-BRTS-Status: 1 X-Barracuda-Spam-Score: 0.00 X-Barracuda-Spam-Status: No, SCORE=0.00 using per-user scores of TAG_LEVEL=1000.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.7 tests=FUZZY_VPILL, HTML_MESSAGE X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.3.27376 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 0.00 FUZZY_VPILL BODY: Attempt to obfuscate words in spam 0.00 HTML_MESSAGE BODY: HTML included in message --b1_071c22ef6924c6ed73506f43b4d11166 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ATSISAKYTI! [http://saugida.lt/mymail/3918/4270f17ed2c398dc80227da2b694faa9/aHR0cDovL3NhdWdpZGEubHQvYXRzaXNha3l0aQ]   [http://saugida.lt/mymail/3918/4270f17ed2c398dc80227da2b694faa9/aHR0cDovL3NhdWdpZGEubHQ]     KOMERCINIS PASIŪLYMAS ATLIKTI OBJEKTO (DARBO VIETOS) INSPEKTAVIMUS   Objekto (darbo vietos) inspektavimo metu, yra fiksojami darbuotojų saugos ir sveikatos, aplinkosaugos, elektrosaugos, gaisrinės saugos pažeidimai: * Profesionaliu alkotesteriu tikrinamas darbuotojų blaivumas. Alkotesteris turi metrologijos tarnybos išduotą patikros dokumentą apie jo naudojimo tinkamumą. Tokius alkotesterius naudoja ir kelių policijos pareigūnai; * Objektai filmuojami skraidyklėmis (Dronais); * Apžiūrime darbuotojų darbo vietas; * Apžiūrime darbuotojų naudojamas asmens apsaugos priemones bei tinkamą jų dėvėjimą; * Apžiūrime įrengimus, jų izoliacijas, apsaugas bei įžeminimus; * Patikriname kėlimo įrenginius; * Patikriname transporto priemones (gesintuvą, vaistinėlę bei vairuotojo blaivumą); * Patikriname įmonėje esančius gaisrinės saugos stendus, hidrantus, gesintuvus, evakuacijos planus, gaisrinės saugos dokumentus; * Tikrinami suaugusiųjų asmenų profesinio mokymo pažymėjimų galiojimus dirbantiems darbuotojams (autokrautuvai, aukštalipiai ir pan.). Reikalui esant apmokome ir išduodame Švietimos ir mokslo ministerijos patvirtintus pažymėjimus. * Pažeidėjai bei pažeidimai fotografuojami arba filmuojami. * Kas 6 mėn. yra atliekamas pilnas darbuotojų saugos ir sveikatos, aplinkosaugos, elektrosaugos, gaisrinės saugos auditas. Atlikus objekto (darbo vietos) inspektavimą, įmonės vadovui, ar jo įgaliotam asmeniui yra pareikiamas Oblekto (darbo vietos) inspektavimo aktas, kuriame nurodomas pažeidimo pobūdis bei pažeistas teisės aktas. Paslaugos suma 100,00 eurų/1 mėn. (Inspektavimas vyksta vieną kartą per savaitę skirtingomis savaitės dienomis bei valandomis).   UAB „SAUGIDA“ Tel. 8 610 31131 El. paštas: info@saugida.lt Intern. puslapis: www.saugida.lt           [http://saugida.lt/mymail/3918/4270f17ed2c398dc80227da2b694faa9/aHR0cDovL3NhdWdpZGEubHQvcHJvZHVrdG8ta2F0ZWdvcmlqYS9zcGVjaWFseWJlcy1rdXJpdS1tb2tvbWUv] SPECIALYBĖS, KURIŲ MOKOME [http://saugida.lt/mymail/3918/4270f17ed2c398dc80227da2b694faa9/aHR0cDovL3NhdWdpZGEubHQvcHJvZHVrdG8ta2F0ZWdvcmlqYS9zcGVjaWFseWJlcy1rdXJpdS1tb2tvbWUv/1]     [http://saugida.lt/mymail/3918/4270f17ed2c398dc80227da2b694faa9/aHR0cDovL3NhdWdpZGEubHQv] DARBUOTOJŲ SAUGA IR SVEIKATA [http://saugida.lt/mymail/3918/4270f17ed2c398dc80227da2b694faa9/aHR0cDovL3NhdWdpZGEubHQv/1]     [http://saugida.lt/mymail/3918/4270f17ed2c398dc80227da2b694faa9/aHR0cDovL3NhdWdpZGEubHQv/2] GAISRINĖ SAUGA [http://saugida.lt/mymail/3918/4270f17ed2c398dc80227da2b694faa9/aHR0cDovL3NhdWdpZGEubHQ/1]     Jūs gavote šį laišką, nes esate užsisakę saugida.lt [http://saugida.lt/mymail/3918/4270f17ed2c398dc80227da2b694faa9/aHR0cDovL3NhdWdpZGEubHQ/2] naujienlaiškį. Jei nebenorite gauti naujienlaiškio, prašome ATSISAKYTI! [http://saugida.lt/mymail/3918/4270f17ed2c398dc80227da2b694faa9/aHR0cDovL3NhdWdpZGEubHQvYXRzaXNha3l0aQ/1] © 2016 saugida.lt, Visos teisės saugomos   --b1_071c22ef6924c6ed73506f43b4d11166 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: 8bit Aktuali informacija
    boschi =E2=80=94 Num= ero cliente: 123122517
     
    Logotipas
     
     

    KOMERCINIS PASIŪLYMAS ATLIKTI
    OBJEKTO (DARBO VIETOS) INSPEKTAVIMUS

     

    Objekto (darbo vietos) inspektavimo metu, yra fiksojami darbuotojų saugos ir sveikatos, aplinkosaugos, elektrosaugos, gaisrinės saugos pažeidimai:

    * Profesionaliu alkotesteriu tikrinamas darbuotojų blaivumas. Alkotesteris turi metrologijos tarnybos išduotą patikros dokumentą apie jo naudojimo tinkamumą. Tokius alkotesterius naudoja ir kelių policijos pareigūnai;
    * Objektai filmuojami skraidyklėmis (Dronais);
    * Apžiūrime darbuotojų darbo vietas;
    * Apžiūrime darbuotojų naudojamas asmens apsaugos priemones bei tinkamą jų dėvėjimą;
    * Apžiūrime įrengimus, jų izoliacijas, apsaugas bei įžeminimus;
    * Patikriname k ėlimo įrenginius;
    * Patikriname transporto priemones (gesintuvą, vaistinėlę bei vairuotojo blaivumą);
    * Patikriname įmonėje esančius gaisrinės saugos stendus, hidrantus, gesintuvus, evakuacijos planus, gaisrinės saugos dokumentus;
    * Tikrinami suaugusiųjų asmenų profesinio mokymo pažymėjimų galiojimus dirbantiems darbuotojams (autokrautuvai, aukštalipiai ir pan.). Reikalui esant apmokome ir išduodame Švietimos ir mokslo ministerijos patvirtintus pažymėjimus.
    * Pažeidėjai bei pažeidimai fotografuojami arba filmuojami.
    * Kas 6 mėn. yra atliekamas pilnas darbuotojų saugos ir sveikatos, aplinkosaugos, elektrosaugos, gaisrinės saugos auditas.

    Atlikus objekto (darbo vietos) inspektavimą, įmonės vadovui, ar jo įgaliotam asmeniui yra pareikiamas Oblekto (darbo vietos) inspektavimo aktas, kuriame nurodomas pažeidimo pobūdis bei pažeistas teisės aktas.

    Paslaugos suma 100,00 eurų/1 mėn. (Inspektavimas vyksta vieną kartą per savaitę skirtingomis savaitės dienomis bei valandomis).

     

    UAB „SAUGIDA“
    Tel. 8 610 31131
    El. paštas: info@saugida.lt
    Intern. puslapis: www.saugida.lt

     
     
     
     
     

    SPECIALYBĖS, KURIŲ MOKOME

     
     
    most-dangerous-jobs

    DARBUOTOJŲ SAUGA IR SVEIKATA

     
     
    firefighter-job-interview

    GAISRINĖ SAUGA

     
    --b1_071c22ef6924c6ed73506f43b4d11166-- From eguan@redhat.com Sat Feb 27 07:03:08 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=ham version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay3.corp.sgi.com [198.149.34.15]) by oss.sgi.com (Postfix) with ESMTP id EB8497CA2 for ; Sat, 27 Feb 2016 07:03:07 -0600 (CST) Received: from cuda.sgi.com (cuda3.sgi.com [192.48.176.15]) by relay3.corp.sgi.com (Postfix) with ESMTP id E1246AC002 for ; Sat, 27 Feb 2016 05:03:02 -0800 (PST) X-ASG-Debug-ID: 1456578181-04cb6c583345b90001-NocioJ Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by cuda.sgi.com with ESMTP id tVzVBDXVCiFSuwun (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO) for ; Sat, 27 Feb 2016 05:03:01 -0800 (PST) X-Barracuda-Envelope-From: eguan@redhat.com X-Barracuda-Apparent-Source-IP: 209.132.183.28 X-ASG-Whitelist: Client Received: from int-mx14.intmail.prod.int.phx2.redhat.com (int-mx14.intmail.prod.int.phx2.redhat.com [10.5.11.27]) by mx1.redhat.com (Postfix) with ESMTPS id 049FE8E3C0; Sat, 27 Feb 2016 13:03:01 +0000 (UTC) Received: from localhost (ovpn-12-19.pek2.redhat.com [10.72.12.19]) by int-mx14.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id u1RD2vBf030007; Sat, 27 Feb 2016 08:02:59 -0500 Date: Sat, 27 Feb 2016 21:02:56 +0800 From: Eryu Guan To: xfs@oss.sgi.com Cc: Dan Williams , Ross Zwisler Subject: generic/320 triggers "list_add attempted on force-poisoned entry" warning on XFS Message-ID: <20160227130256.GJ11419@eguan.usersys.redhat.com> X-ASG-Orig-Subj: generic/320 triggers "list_add attempted on force-poisoned entry" warning on XFS MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.5.24 (2015-08-30) X-Scanned-By: MIMEDefang 2.68 on 10.5.11.27 X-Barracuda-Connect: mx1.redhat.com[209.132.183.28] X-Barracuda-Start-Time: 1456578181 X-Barracuda-Encrypted: ECDHE-RSA-AES256-GCM-SHA384 X-Barracuda-URL: https://192.48.176.15:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-BRTS-Status: 1 Hi, Starting from 4.5-rc1 kernel, I sometimes see generic/320 triggers "list_add attempted on force-poisoned entry" warnings on XFS, test hosts are arm64/ppc64/ppc64le, haven't seen it on x86_64 hosts. [ 2441.772340] run fstests generic/320 at 2016-02-27 05:52:05 [ 2441.916302] XFS (sda5): Unmounting Filesystem [ 2442.180551] XFS (sda5): Mounting V5 Filesystem [ 2442.231940] XFS (sda5): Ending clean mount [ 2460.142155] list_add attempted on force-poisoned entry [ 2460.142278] ------------[ cut here ]------------ [ 2460.142326] WARNING: at lib/list_debug.c:34 [ 2460.142362] Modules linked in: rpcrdma ib_isert iscsi_target_mod ib_iser libiscsi scsi_transport_iscsi ib_srpt target_core_mod ib_srp scsi_transport_srp ib_ipoib rdma_ucm ib_ ucm ib_uverbs ib_umad rdma_cm ib_cm iw_cm ses enclosure scsi_transport_sas sg shpchp powernv_rng rtc_opal nfsd auth_rpcgss nfs_acl lockd grace sunrpc ip_tables xfs libcrc32c sr_ mod sd_mod cdrom mlx4_ib ib_sa ib_mad mlx4_en ib_core vxlan ip6_udp_tunnel ib_addr udp_tunnel mlx4_core ipr libata tg3 ptp pps_core [ 2460.143083] CPU: 21 PID: 134288 Comm: cp Not tainted 4.5.0-rc5 #25 [ 2460.143141] task: c000000f550adb00 ti: c000000fb5fc0000 task.ti: c000000fb5fc0000 [ 2460.143209] NIP: c00000000043c390 LR: c00000000043c38c CTR: 0000000030041bec [ 2460.143278] REGS: c000000fb5fc30a0 TRAP: 0700 Not tainted (4.5.0-rc5) [ 2460.143334] MSR: 900000010282b033 CR: 22028422 XER: 00000000 [ 2460.143575] CFAR: c0000000008259d8 SOFTE: 0 GPR00: c00000000043c38c c000000fb5fc3320 c00000000108bc00 000000000000002a GPR04: c000000ff8d49c50 c000000ff8d5b4a0 900000010280b033 0000000000000065 GPR08: 0000000000000000 c000000000bcb284 0000000ff8180000 000000000000076b GPR12: 0000000000008800 c00000000fb8bd00 0000000000000000 0000000000000000 GPR16: 0000000000000000 00003ffffa430978 0000000000000000 0000000000000001 GPR20: c000000fb08ab880 0000000000008180 d00000002024bae0 0000000000000000 GPR24: 0000000000000000 c000000fc73c9e40 c000000fe914a740 0000000000000002 GPR28: 0000000000000001 c000000fc812ab38 c000000fc812ab38 c000000fb5fc33c0 [ 2460.144450] NIP [c00000000043c390] __list_add+0xb0/0x150 [ 2460.144497] LR [c00000000043c38c] __list_add+0xac/0x150 [ 2460.144542] Call Trace: [ 2460.144566] [c000000fb5fc3320] [c00000000043c38c] __list_add+0xac/0x150 (unreliable) [ 2460.144648] [c000000fb5fc33a0] [c00000000081b454] __down+0x4c/0xf8 [ 2460.144718] [c000000fb5fc3410] [c00000000010b6f8] down+0x68/0x70 [ 2460.144809] [c000000fb5fc3450] [d0000000201ebf4c] xfs_buf_lock+0x4c/0x150 [xfs] [ 2460.144902] [c000000fb5fc3490] [d0000000201ec2f0] _xfs_buf_find+0x2a0/0x4d0 [xfs] [ 2460.144995] [c000000fb5fc3530] [d0000000201ec70c] xfs_buf_get_map+0x4c/0x250 [xfs] [ 2460.145088] [c000000fb5fc35d0] [d0000000201ed740] xfs_buf_read_map+0x50/0x1f0 [xfs] [ 2460.145244] [c000000fb5fc3630] [d0000000202280d8] xfs_trans_read_buf_map+0x1d8/0x390 [xfs] [ 2460.145412] [c000000fb5fc36a0] [d0000000201d849c] xfs_read_agi+0x9c/0x130 [xfs] [ 2460.145580] [c000000fb5fc3700] [d0000000201d8580] xfs_ialloc_read_agi+0x50/0x160 [xfs] [ 2460.145748] [c000000fb5fc3750] [d0000000201d92f0] xfs_dialloc+0x130/0x2f0 [xfs] [ 2460.145918] [c000000fb5fc37e0] [d000000020203274] xfs_ialloc+0x84/0x550 [xfs] [ 2460.146068] [c000000fb5fc3860] [d0000000202037d8] xfs_dir_ialloc+0x98/0x270 [xfs] [ 2460.146240] [c000000fb5fc3960] [d000000020203f24] xfs_create+0x4f4/0x750 [xfs] [ 2460.146412] [c000000fb5fc3a60] [d0000000201ff0a8] xfs_generic_create+0x208/0x3d0 [xfs] [ 2460.146572] [c000000fb5fc3af0] [c0000000002af0f8] vfs_create+0x158/0x1f0 [ 2460.146708] [c000000fb5fc3b40] [c0000000002b0cd8] do_last+0x698/0xf40 [ 2460.146845] [c000000fb5fc3c10] [c0000000002b1624] path_openat+0xa4/0x3c0 [ 2460.146982] [c000000fb5fc3c90] [c0000000002b2ec4] do_filp_open+0x74/0xf0 [ 2460.147120] [c000000fb5fc3dc0] [c00000000029c654] do_sys_open+0x1b4/0x2d0 [ 2460.147257] [c000000fb5fc3e30] [c000000000009204] system_call+0x38/0xb4 [ 2460.147392] Instruction dump: [ 2460.147459] fbfe0000 38210080 e8010010 eba1ffe8 ebc1fff0 ebe1fff8 7c0803a6 4e800020 [ 2460.147680] 3c62ff9e 38631a78 483e95f9 60000000 <0fe00000> 4bffff98 60000000 60420000 [ 2460.147902] ---[ end trace aa6c4f990634a77c ]--- The warning itself is introduced by commit 5c2c2587b132 ("mm, dax, pmem: introduce {get|put}_dev_pagemap() for dax-gup") in 4.5-rc1, and git bisect points to the same commit. But I'm not sure if it's a regression or just exposes an old issue. If more infomation is needed please let me know. Thanks, Eryu From dan.j.williams@intel.com Sat Feb 27 14:11:00 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=T_DKIM_INVALID autolearn=ham version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay1.corp.sgi.com [137.38.102.111]) by oss.sgi.com (Postfix) with ESMTP id 5286D7C8C for ; Sat, 27 Feb 2016 14:11:00 -0600 (CST) Received: from cuda.sgi.com (cuda2.sgi.com [192.48.176.25]) by relay1.corp.sgi.com (Postfix) with ESMTP id 2AF2F8F8033 for ; Sat, 27 Feb 2016 12:10:56 -0800 (PST) X-ASG-Debug-ID: 1456603851-04cbb00b71622e0001-NocioJ Received: from mail-oi0-f42.google.com (mail-oi0-f42.google.com [209.85.218.42]) by cuda.sgi.com with ESMTP id JJ2dz3tukFUwHvkV (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128 verify=NO) for ; Sat, 27 Feb 2016 12:10:51 -0800 (PST) X-Barracuda-Envelope-From: dan.j.williams@intel.com X-Barracuda-Apparent-Source-IP: 209.85.218.42 Received: by mail-oi0-f42.google.com with SMTP id k67so25747567oia.3 for ; Sat, 27 Feb 2016 12:10:51 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=intel-com.20150623.gappssmtp.com; s=20150623; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc; bh=UqztYv1MwX6hVe/7z3r8u7btSif3BpcLMN8yyXOowaI=; b=YSgcnrI+smTZQfnUQQjqks6HIcpg8J134DnTdMhnVgEJeS9zZhVaPFplPm5nvz0ubu dvpp8ah6U2OCePn9PZNGngywLVksAJcgqyvCgRmeb1Cs4iESP6D0r/NpMSEB+bzjU5/z VggA5RicGxDxi1LJjqbc1vD8QS33lRQAT26CIjspH1eAUVhY7w8vn8wQyGuQhKLsxG4R yoXOmZ6DnG9gXltMFi4zuD64kkb9XcLyRZX6qAQvCK318Shk/uKC2m+lt5vY1cEBJIR1 U7DTMcD7fwDqsNd2LGwbdRGPifg+UjlIptTwgIVwL8aS11GGUS4fWhysDzG0MXwLqWq2 xrmg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:date :message-id:subject:from:to:cc; bh=UqztYv1MwX6hVe/7z3r8u7btSif3BpcLMN8yyXOowaI=; b=LlDvTwLGstU12FiyBP0XKSzlQihRcqC3qUrYXmDSygEypyKXGC8LLkJJMNnVRC6f39 bJsHvr9CFL/YBO/cQ+BP9Ntjjmxgp03Kd5TuxHEwoIyK9LXammQ9ODs1fOwktdtbWcBB ATZd7wbNXOlUF1FKGrmFVV7nudv7Ezd8jbHH8GGAOh0WQaTGlqo4vLsjnoeUBhPGoUv0 /d6jKbP0spdcu0BqBWEY7Q8Pz3IPN4Pn6LwbpbiG8xlkEOLziQz1sTHvaB+Uu694BZ4t vbJjcL3iQbagN0FkxCjLPv2+L7rHGPD9fFT7ITzKhFUKikU9Pr/kZDzM9f4UdMiNBPPo S9KQ== X-Gm-Message-State: AD7BkJKpHmRfuggwOznVkC27RWDYmwwedrs5yPVVN9pVdzmY7mprqWbybVb0UYP0ROBgyPLaF/nxQWH1d1krb1H4 MIME-Version: 1.0 X-Received: by 10.202.71.87 with SMTP id u84mr6017068oia.75.1456603851284; Sat, 27 Feb 2016 12:10:51 -0800 (PST) Received: by 10.157.31.107 with HTTP; Sat, 27 Feb 2016 12:10:51 -0800 (PST) In-Reply-To: <20160227130256.GJ11419@eguan.usersys.redhat.com> References: <20160227130256.GJ11419@eguan.usersys.redhat.com> Date: Sat, 27 Feb 2016 12:10:51 -0800 Message-ID: Subject: Re: generic/320 triggers "list_add attempted on force-poisoned entry" warning on XFS From: Dan Williams X-ASG-Orig-Subj: Re: generic/320 triggers "list_add attempted on force-poisoned entry" warning on XFS To: Eryu Guan Cc: XFS Developers , Ross Zwisler Content-Type: text/plain; charset=UTF-8 X-Barracuda-Connect: mail-oi0-f42.google.com[209.85.218.42] X-Barracuda-Start-Time: 1456603851 X-Barracuda-Encrypted: ECDHE-RSA-AES128-GCM-SHA256 X-Barracuda-URL: https://192.48.176.25:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-BRTS-Status: 1 X-Barracuda-Spam-Score: 0.60 X-Barracuda-Spam-Status: No, SCORE=0.60 using per-user scores of TAG_LEVEL=1000.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.7 tests=BSF_SC0_MISMATCH_TO, DKIM_SIGNED, DKIM_VERIFIED, MARKETING_SUBJECT X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.3.27399 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 0.60 MARKETING_SUBJECT Subject contains popular marketing words 0.00 BSF_SC0_MISMATCH_TO Envelope rcpt doesn't match header -0.00 DKIM_VERIFIED Domain Keys Identified Mail: signature passes verification 0.00 DKIM_SIGNED Domain Keys Identified Mail: message has a signature On Sat, Feb 27, 2016 at 5:02 AM, Eryu Guan wrote: > Hi, > > Starting from 4.5-rc1 kernel, I sometimes see generic/320 triggers > "list_add attempted on force-poisoned entry" warnings on XFS, test hosts > are arm64/ppc64/ppc64le, haven't seen it on x86_64 hosts. Hmm, this triggers when a list_head has ->next or ->prev pointing at the address of force_poison which is only defined in lib/list_debug.c. The only call site that uses list_force_poison() is in devm_memremap_pages(). That currently depends on CONFIG_ZONE_DEVICE which in turn depends on X86_64. So, this appears to be a false positive and the address of force_poison is somehow ending up on the stack by accident as that is the random value being passed in from __down_common: struct semaphore_waiter waiter; list_add_tail(&waiter.list, &sem->wait_list); So, I think we need a more unique poison value that should never appear on the stack: diff --git a/include/linux/poison.h b/include/linux/poison.h index 4a27153574e2..0604806c2f52 100644 --- a/include/linux/poison.h +++ b/include/linux/poison.h @@ -21,6 +21,7 @@ */ #define LIST_POISON1 ((void *) 0x100 + POISON_POINTER_DELTA) #define LIST_POISON2 ((void *) 0x200 + POISON_POINTER_DELTA) +#define LIST_POISON3 ((void *) 0x500 + POISON_POINTER_DELTA) /********** include/linux/timer.h **********/ /* diff --git a/lib/list_debug.c b/lib/list_debug.c index 3345a089ef7b..318bf1c181b2 100644 --- a/lib/list_debug.c +++ b/lib/list_debug.c @@ -12,11 +12,10 @@ #include #include -static struct list_head force_poison; void list_force_poison(struct list_head *entry) { - entry->next = &force_poison; - entry->prev = &force_poison; + entry->next = LIST_POISON3; + entry->prev = LIST_POISON3; } /* @@ -30,7 +29,7 @@ void __list_add(struct list_head *new, struct list_head *prev, struct list_head *next) { - WARN(new->next == &force_poison || new->prev == &force_poison, + WARN(new->next == LIST_POISON3 || new->prev == LIST_POISON3, "list_add attempted on force-poisoned entry\n"); WARN(next->prev != prev, "list_add corruption. next->prev should be " From eguan@redhat.com Sat Feb 27 23:32:05 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=ham version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay2.corp.sgi.com [137.38.102.29]) by oss.sgi.com (Postfix) with ESMTP id D4BE87C8C for ; Sat, 27 Feb 2016 23:32:05 -0600 (CST) Received: from cuda.sgi.com (cuda3.sgi.com [192.48.176.15]) by relay2.corp.sgi.com (Postfix) with ESMTP id A0434304043 for ; Sat, 27 Feb 2016 21:32:02 -0800 (PST) X-ASG-Debug-ID: 1456637521-04cb6c58325c630001-NocioJ Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by cuda.sgi.com with ESMTP id R6tsHgN5HZ7guoZ9 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO) for ; Sat, 27 Feb 2016 21:32:01 -0800 (PST) X-Barracuda-Envelope-From: eguan@redhat.com X-Barracuda-Apparent-Source-IP: 209.132.183.28 X-ASG-Whitelist: Client Received: from int-mx10.intmail.prod.int.phx2.redhat.com (int-mx10.intmail.prod.int.phx2.redhat.com [10.5.11.23]) by mx1.redhat.com (Postfix) with ESMTPS id 0221FC0E7FE7; Sun, 28 Feb 2016 05:32:00 +0000 (UTC) Received: from localhost (ovpn-12-19.pek2.redhat.com [10.72.12.19]) by int-mx10.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id u1S5Vxq8026434; Sun, 28 Feb 2016 00:32:00 -0500 Date: Sun, 28 Feb 2016 13:31:58 +0800 From: Eryu Guan To: Dan Williams Cc: XFS Developers , Ross Zwisler Subject: Re: generic/320 triggers "list_add attempted on force-poisoned entry" warning on XFS Message-ID: <20160228053158.GK11419@eguan.usersys.redhat.com> X-ASG-Orig-Subj: Re: generic/320 triggers "list_add attempted on force-poisoned entry" warning on XFS References: <20160227130256.GJ11419@eguan.usersys.redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.24 (2015-08-30) X-Scanned-By: MIMEDefang 2.68 on 10.5.11.23 X-Barracuda-Connect: mx1.redhat.com[209.132.183.28] X-Barracuda-Start-Time: 1456637521 X-Barracuda-Encrypted: ECDHE-RSA-AES256-GCM-SHA384 X-Barracuda-URL: https://192.48.176.15:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-BRTS-Status: 1 On Sat, Feb 27, 2016 at 12:10:51PM -0800, Dan Williams wrote: > On Sat, Feb 27, 2016 at 5:02 AM, Eryu Guan wrote: > > Hi, > > > > Starting from 4.5-rc1 kernel, I sometimes see generic/320 triggers > > "list_add attempted on force-poisoned entry" warnings on XFS, test hosts > > are arm64/ppc64/ppc64le, haven't seen it on x86_64 hosts. > > Hmm, this triggers when a list_head has ->next or ->prev pointing at > the address of force_poison which is only defined in lib/list_debug.c. > The only call site that uses list_force_poison() is in > devm_memremap_pages(). That currently depends on CONFIG_ZONE_DEVICE > which in turn depends on X86_64. > > So, this appears to be a false positive and the address of > force_poison is somehow ending up on the stack by accident as that is > the random value being passed in from __down_common: > > struct semaphore_waiter waiter; > > list_add_tail(&waiter.list, &sem->wait_list); > > So, I think we need a more unique poison value that should never > appear on the stack: Unfortunately I can still see the warning after applying this test patch. Then I added debug code to print the pointer value and re-ran the test. All five failures printed the same pointer value, failed in the same pattern: list_add attempted on force-poisoned entry(0000000000000500), new->next = c00000000136bc00, new->prev = 0000000000000500 Thanks, Eryu > > diff --git a/include/linux/poison.h b/include/linux/poison.h > index 4a27153574e2..0604806c2f52 100644 > --- a/include/linux/poison.h > +++ b/include/linux/poison.h > @@ -21,6 +21,7 @@ > */ > #define LIST_POISON1 ((void *) 0x100 + POISON_POINTER_DELTA) > #define LIST_POISON2 ((void *) 0x200 + POISON_POINTER_DELTA) > +#define LIST_POISON3 ((void *) 0x500 + POISON_POINTER_DELTA) > > /********** include/linux/timer.h **********/ > /* > diff --git a/lib/list_debug.c b/lib/list_debug.c > index 3345a089ef7b..318bf1c181b2 100644 > --- a/lib/list_debug.c > +++ b/lib/list_debug.c > @@ -12,11 +12,10 @@ > #include > #include > > -static struct list_head force_poison; > void list_force_poison(struct list_head *entry) > { > - entry->next = &force_poison; > - entry->prev = &force_poison; > + entry->next = LIST_POISON3; > + entry->prev = LIST_POISON3; > } > > /* > @@ -30,7 +29,7 @@ void __list_add(struct list_head *new, > struct list_head *prev, > struct list_head *next) > { > - WARN(new->next == &force_poison || new->prev == &force_poison, > + WARN(new->next == LIST_POISON3 || new->prev == LIST_POISON3, > "list_add attempted on force-poisoned entry\n"); > WARN(next->prev != prev, > "list_add corruption. next->prev should be " From saldes@diba.cat Sun Feb 28 02:37:26 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=ham version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay3.corp.sgi.com [198.149.34.15]) by oss.sgi.com (Postfix) with ESMTP id F1F4629E05 for ; Sun, 28 Feb 2016 02:37:25 -0600 (CST) Received: from cuda.sgi.com (cuda1.sgi.com [192.48.157.11]) by relay3.corp.sgi.com (Postfix) with ESMTP id 6FB52AC001 for ; Sun, 28 Feb 2016 00:37:25 -0800 (PST) X-ASG-Debug-ID: 1456648637-04bdf002eb6c3e0001-NocioJ Received: from SWCS496.diba.cat (mx6.diba.cat [195.76.107.98]) by cuda.sgi.com with ESMTP id UGBiXOMW6v55n7ai (version=TLSv1 cipher=AES128-SHA bits=128 verify=NO) for ; Sun, 28 Feb 2016 00:37:18 -0800 (PST) X-Barracuda-Envelope-From: saldes@diba.cat X-Barracuda-Apparent-Source-IP: 195.76.107.98 Received: from SWCS494.diba.cat (195.76.107.100) by mx6.diba.cat (195.76.107.98) with Microsoft SMTP Server id 14.3.181.6; Sun, 28 Feb 2016 09:37:16 +0100 Received: from SWCS500.corpo.ad.diba.es (192.168.57.224) by mx8.diba.cat (195.76.107.100) with Microsoft SMTP Server (TLS) id 14.3.181.6; Sun, 28 Feb 2016 09:37:13 +0100 Received: from [169.254.123.171] (192.168.32.58) by SWCS500.corpo.ad.diba.es (192.168.57.3) with Microsoft SMTP Server (TLS) id 14.3.266.1; Sun, 28 Feb 2016 09:37:01 +0100 Content-Type: multipart/mixed; boundary="===============1929421832==" MIME-Version: 1.0 Subject: Delivery To: Recipients X-ASG-Orig-Subj: Delivery From: FedEx Express Delivery Service Date: Sun, 28 Feb 2016 09:36:10 +0100 Reply-To: Message-ID: <3383d6e9-e459-4fc3-b305-e50e282acf82@SWCS500.corpo.ad.diba.es> X-Originating-IP: [192.168.32.58] X-Barracuda-Connect: mx6.diba.cat[195.76.107.98] X-Barracuda-Start-Time: 1456648638 X-Barracuda-Encrypted: AES128-SHA X-Barracuda-URL: https://192.48.157.11:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-BRTS-Status: 1 X-Barracuda-Spam-Score: 0.50 X-Barracuda-Spam-Status: No, SCORE=0.50 using per-user scores of TAG_LEVEL=1000.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.7 tests=BSF_SC0_MISMATCH_TO, BSF_SC3_TG321 X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.3.27411 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 0.00 BSF_SC0_MISMATCH_TO Envelope rcpt doesn't match header 0.50 BSF_SC3_TG321 Custom Rule TG321 --===============1929421832== Content-Type: text/plain; charset="iso-8859-1" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Description: Mail message body See Attached File --===============1929421832== Content-Type: application/pdf; name="DELIVERY DETAILS.pdf" MIME-Version: 1.0 Content-Transfer-Encoding: base64 Content-Disposition: attachment; filename="DELIVERY DETAILS.pdf" Content-Description: DELIVERY DETAILS.pdf JVBERi0xLjUNCiW1tbW1DQoxIDAgb2JqDQo8PC9UeXBlL0NhdGFsb2cvUGFnZXMgMiAwIFIvTGFu Zyhlbi1VUykgL1N0cnVjdFRyZWVSb290IDIwIDAgUi9NYXJrSW5mbzw8L01hcmtlZCB0cnVlPj4+ Pg0KZW5kb2JqDQoyIDAgb2JqDQo8PC9UeXBlL1BhZ2VzL0NvdW50IDIvS2lkc1sgMyAwIFIgMTIg MCBSXSA+Pg0KZW5kb2JqDQozIDAgb2JqDQo8PC9UeXBlL1BhZ2UvUGFyZW50IDIgMCBSL1Jlc291 cmNlczw8L0ZvbnQ8PC9GMSA1IDAgUi9GMiA3IDAgUj4+L1hPYmplY3Q8PC9JbWFnZTkgOSAwIFI+ Pi9FeHRHU3RhdGU8PC9HUzEwIDEwIDAgUi9HUzExIDExIDAgUj4+L1Byb2NTZXRbL1BERi9UZXh0 L0ltYWdlQi9JbWFnZUMvSW1hZ2VJXSA+Pi9NZWRpYUJveFsgMCAwIDU5NS4zMiA4NDEuOTJdIC9D b250ZW50cyA0IDAgUi9Hcm91cDw8L1R5cGUvR3JvdXAvUy9UcmFuc3BhcmVuY3kvQ1MvRGV2aWNl UkdCPj4vVGFicy9TL1N0cnVjdFBhcmVudHMgMD4+DQplbmRvYmoNCjQgMCBvYmoNCjw8L0ZpbHRl ci9GbGF0ZURlY29kZS9MZW5ndGggNDYzOD4+DQpzdHJlYW0NCnicrVxtb9tGEv5uwP9hPxQ9urAZ Lpevh+IAx3baNKmTq+3mg3MfGHFl8cyQKklFEQ73329mlpSWznIZA9cCrUJRw92ZnWeeeWHYi/fs 559f/H7x+pJ5//gHe3l5wTw3DVL2cHx05sduxILUTXwWcd/lLE7xv408Plr+dHzErn6/YEyTwHsJ L2+Pj1684gx+EyTsdnl8xJkH/3ImBHfjkMU8df2I3X4+PvLgQ4xPUx9+OT66d9jJv9jtb8dHV7eG h/ijh/j4kDQaPQRWHCUsSkPX8+kZY4kcn9bfE4UuDxgXkZuEjIfTWxPaU588J4rdVG2FtoFbAB16 np/A3hf3zqXMGuuOAoPsOHVjL9CEw1UU9ucJ95ysPDlLnE32qZRWwaFBMAcLcH3V984FSWu7+vPJ WezI5tQmMzLJTCI3FCOZ1nXF08oMPTcOZowm4B64Hw5nYLVZMv0YIdwgOhiNnaHBeBCQjj9Itsq+ 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 gXGq2fdCentRFzPTU+HGkWUklE/XswEGWHUzwow5l8rfnq5qXav+dYHvLtJAiRowZ4VKgCGvBGKm 3odBkzVoQcpUIBxXVJKF4DvdZ0liN/bpLYaZSiy3TCOnHr23OmqzhHE0vMFXgPvk2YnAUjv52ZLh cRCOamrRVExMUzGnEDUF4Pn+7Z1GLiWyb+Hsq/Nq0B6lqVIs7u0lTndBhChavJMu2y1ghDUOeKnt pT+5F/Xn/VRP0bbouZgRfJDl0j61GHtuiHlYgrVuu2qnoS+m0Q6dc7X9SweUcZAuaCYzdYYco6e1 jexU2QE4bI4qUY1Qu16mimRRqq1k1uumsSiM8JxZQ4aIXA4nEod+ZrRmafwliJua1nqY198jU+9/ gfZkSXSC5p1yuc7UcEpK1Ozj4b0nrdEP6Pi+bmfeWzTOY8YBdav3y5tT5cS8No2061LeUcd1WSwU H6JCm12wMYUMID6O5H48OfDYoUGmCL1qjkzlcdi0jWI3nBl/5OZR774kgcik2fABtF8BBpYEe9u/ 2/eno1X/2vuTd+shK8AS5uE5s8YYUOOv4yOKofgP5Fbg6bHLIxamIc1hceGqps6Hn1h1fOTju+mh eqjHXR/ns3GcGV/qFzFbwJNfvP4Mjpyyy5r90/jkASBe/HLDQR0tUjje/60DYUjv+MQgm8fs8+FK BKwLaF55fBTh+9WGC/1v4MIKrglPXQt6Of2FCN92pJtAcKwEP73S/0gJgouRkuTjbZ8PV/DvGOD9 AhIl6cmF/jf/Z0FgddQc7zUnPL/XXK+WGH8L6R38zD0cV8G2eDf+7Q44GcTZb8z6m5vedP8DyF+l xg0KZW5kc3RyZWFtDQplbmRvYmoNCjUgMCBvYmoNCjw8L1R5cGUvRm9udC9TdWJ0eXBlL1RydWVU eXBlL05hbWUvRjEvQmFzZUZvbnQvVGltZXMjMjBOZXcjMjBSb21hbixJdGFsaWMvRW5jb2Rpbmcv V2luQW5zaUVuY29kaW5nL0ZvbnREZXNjcmlwdG9yIDYgMCBSL0ZpcnN0Q2hhciAzMi9MYXN0Q2hh ciAzMi9XaWR0aHMgMzcgMCBSPj4NCmVuZG9iag0KNiAwIG9iag0KPDwvVHlwZS9Gb250RGVzY3Jp cHRvci9Gb250TmFtZS9UaW1lcyMyME5ldyMyMFJvbWFuLEl0YWxpYy9GbGFncyAzMi9JdGFsaWNB bmdsZSAtMTYuNC9Bc2NlbnQgODkxL0Rlc2NlbnQgLTIxNi9DYXBIZWlnaHQgNjk0L0F2Z1dpZHRo IDQwMi9NYXhXaWR0aCAxODMxL0ZvbnRXZWlnaHQgNDAwL1hIZWlnaHQgMjUwL0xlYWRpbmcgNDIv U3RlbVYgNDAvRm9udEJCb3hbIC00OTggLTIxNiAxMzMzIDY5NF0gPj4NCmVuZG9iag0KNyAwIG9i ag0KPDwvVHlwZS9Gb250L1N1YnR5cGUvVHJ1ZVR5cGUvTmFtZS9GMi9CYXNlRm9udC9UaW1lcyMy ME5ldyMyMFJvbWFuLEJvbGRJdGFsaWMvRW5jb2RpbmcvV2luQW5zaUVuY29kaW5nL0ZvbnREZXNj cmlwdG9yIDggMCBSL0ZpcnN0Q2hhciAzMi9MYXN0Q2hhciAxMjUvV2lkdGhzIDM4IDAgUj4+DQpl bmRvYmoNCjggMCBvYmoNCjw8L1R5cGUvRm9udERlc2NyaXB0b3IvRm9udE5hbWUvVGltZXMjMjBO ZXcjMjBSb21hbixCb2xkSXRhbGljL0ZsYWdzIDMyL0l0YWxpY0FuZ2xlIC0xNi40L0FzY2VudCA4 OTEvRGVzY2VudCAtMjE2L0NhcEhlaWdodCA2NzcvQXZnV2lkdGggNDEyL01heFdpZHRoIDE5NDgv Rm9udFdlaWdodCA3MDAvWEhlaWdodCAyNTAvTGVhZGluZyA0Mi9TdGVtViA0MS9Gb250QkJveFsg LTU0NyAtMjE2IDE0MDEgNjc3XSA+Pg0KZW5kb2JqDQo5IDAgb2JqDQo8PC9UeXBlL1hPYmplY3Qv U3VidHlwZS9JbWFnZS9XaWR0aCAzNzMvSGVpZ2h0IDEzNS9Db2xvclNwYWNlL0RldmljZVJHQi9C aXRzUGVyQ29tcG9uZW50IDgvRmlsdGVyL0RDVERlY29kZS9JbnRlcnBvbGF0ZSB0cnVlL0xlbmd0 aCA3NTE2Pj4NCnN0cmVhbQ0K/9j/4AAQSkZJRgABAQEAYABgAAD/2wBDAAgGBgcGBQgHBwcJCQgK DBQNDAsLDBkSEw8UHRofHh0aHBwgJC4nICIsIxwcKDcpLDAxNDQ0Hyc5PTgyPC4zNDL/2wBDAQkJ CQwLDBgNDRgyIRwhMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIy MjIyMjL/wAARCACHAXUDASIAAhEBAxEB/8QAHwAAAQUBAQEBAQEAAAAAAAAAAAECAwQFBgcICQoL /8QAtRAAAgEDAwIEAwUFBAQAAAF9AQIDAAQRBRIhMUEGE1FhByJxFDKBkaEII0KxwRVS0fAkM2Jy ggkKFhcYGRolJicoKSo0NTY3ODk6Q0RFRkdISUpTVFVWV1hZWmNkZWZnaGlqc3R1dnd4eXqDhIWG h4iJipKTlJWWl5iZmqKjpKWmp6ipqrKztLW2t7i5usLDxMXGx8jJytLT1NXW19jZ2uHi4+Tl5ufo 6erx8vP09fb3+Pn6/8QAHwEAAwEBAQEBAQEBAQAAAAAAAAECAwQFBgcICQoL/8QAtREAAgECBAQD BAcFBAQAAQJ3AAECAxEEBSExBhJBUQdhcRMiMoEIFEKRobHBCSMzUvAVYnLRChYkNOEl8RcYGRom JygpKjU2Nzg5OkNERUZHSElKU1RVVldYWVpjZGVmZ2hpanN0dXZ3eHl6goOEhYaHiImKkpOUlZaX mJmaoqOkpaanqKmqsrO0tba3uLm6wsPExcbHyMnK0tPU1dbX2Nna4uPk5ebn6Onq8vP09fb3+Pn6 /9oADAMBAAIRAxEAPwDpvslH2Stv7NR9moAxPslH2SoLrxZoVldTW008qzQsVYeUx+YcHnFRf8Jr 4d/5+pf+/Lf4Vr7Cq9VFjsXPslH2Sqf/AAmvh3/n6l/78t/hR/wmvh3/AJ+pf+/Lf4U/q9X+V/cF i59ko+yVT/4TXw7/AM/Uv/flv8KP+E18O/8AP1L/AN+W/wAKPq9X+V/cFi59ko+yVT/4TXw7/wA/ Uv8A35b/AArR0nXNL1uaSKwlaSSJNzZQrxnHepdGpFXcWFiL7JR9krb+zUfZqzEYn2Sj7JW39mo+ zUAYn2Sj7JW39mo+zUAYn2Sj7JW39mo+zUAYn2Sj7JW39mo+zUAYn2Sj7JW39mo+zUAYn2Sj7JW3 9mqO4VLS1knk+WOJSzHGeAMmgDI+yUfZKp/8Jt4d/wCfqX/vw3+FH/Ca+Hf+fqX/AL8t/hW31er/ ACv7h2Ln2Sj7JVeDxhoFxNHBHPK0jnCr5TDn8q1Pt9j/AH2/75Nc9acaDUar5X56GtOhVqK8ItlP 7JR9kq59vsf77f8AfJo+32P99v8Avk1j9bofzr7y/qeI/kf3FP7JR9kq59vsf77f98mj7fY/32/7 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 +00UUAH2mj7TRRQAfaaPtNFFAB9po+00UUAH2mj7TRRQAfaaQ3NFFAETXNQPcUUUAVZJ6pyzUUUA UZZPnooooA//2Q0KZW5kc3RyZWFtDQplbmRvYmoNCjEwIDAgb2JqDQo8PC9UeXBlL0V4dEdTdGF0 ZS9CTS9Ob3JtYWwvY2EgMC41MDE5Nj4+DQplbmRvYmoNCjExIDAgb2JqDQo8PC9UeXBlL0V4dEdT dGF0ZS9CTS9Ob3JtYWwvY2EgMT4+DQplbmRvYmoNCjEyIDAgb2JqDQo8PC9UeXBlL1BhZ2UvUGFy ZW50IDIgMCBSL1Jlc291cmNlczw8L0ZvbnQ8PC9GMiA3IDAgUi9GMyAxNCAwIFIvRjEgNSAwIFI+ Pi9Qcm9jU2V0Wy9QREYvVGV4dC9JbWFnZUIvSW1hZ2VDL0ltYWdlSV0gPj4vTWVkaWFCb3hbIDAg MCA1OTUuMzIgODQxLjkyXSAvQ29udGVudHMgMTMgMCBSL0dyb3VwPDwvVHlwZS9Hcm91cC9TL1Ry YW5zcGFyZW5jeS9DUy9EZXZpY2VSR0I+Pi9UYWJzL1MvU3RydWN0UGFyZW50cyAxPj4NCmVuZG9i ag0KMTMgMCBvYmoNCjw8L0ZpbHRlci9GbGF0ZURlY29kZS9MZW5ndGggMjc0NT4+DQpzdHJlYW0N Cnic5VpLb+M4Er4HyH/gYQ/SzpgRKZKSGo1g8uztnU7S6CTYHXj2oNiKI7QjBbaS7vz7rSrJNmWL kgd73BnErQdZLH714Fek2NFX9vHj0dXZ53MWHB+z0/MzFvBEJWx2eDCSETdMJTyWzAjJBYsS/F1k hwePfz88YBdXZ4xZEkQjQWBv6GdiFgeGy5jJRPAgYkJx5e4um+6nd4cHR5eSwZAqZnePhweCBfC/ YCuZMU8ku3s+PAi4NBGOVl98OjwYe5e+8rLpha+9n8wfJd55Ns/fMn+kvAW8eWdfy2UFL2LvzB9p ryyqdFKxr3idLXzjLaFRWXzA9tT9yq87cub/h9398/Dg4q5D99DSfaWtNDEXoa3u2DttpOUoevZU sX/l86WPavRJVx3SQxXwSLel2ypaRohisKFiMtA8HDKC7hiqkZLU9rBhH3ufYTLX5/4ooqsT+GM3 j4+IZj7JeiEzHSMJGfLY2EPBpOC/PjlRl5zQ8FDZcuo3i9nq6hv5yp0/Cr1s/qFPftwlX0dcyi09 +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 BoE6CwIt4N/keKThXkv408cKL4PjUYJNFFxHTVN8LY5HEp6fmuNRiO0MNQ/C9SW2otsTulVxfavM cUjyark4LLXCP133UmbdQ8V166hubcs7axQ6rRWhV3SP7+pntlKreZzR43qazThnx3vteEMawQp6 gyHkr8LpXYLKi1brfkoWygjPZ/bf+nf5B4wMZBAKNqr0oRI3Ww4CswPfMV0OAuu8cOkwhgICXDSb Ae0CMrJ0H5Zg7W+JcqoqE4PHV5ifZZeqbeVkkqzTbodyVwsgFZx9wlSS+ZBUykWdTZ3HkbgcWUKb +aV4RvKMoVrgVfG6TYq6z28EMuq2uP7D13j3MxcZS/puIeJhUOMR93xjIZLtL10cVpV4fmWcwNWI FZBqhfbSORbeV2mR4inRDB72zEF2fkMAvD1pDeq2v4nr0iLmRmzZf3ewrk8NGjmRQLLkmuAlue0U feICL38yNOwNTruY0wkY2Dqjh3fAKIBFkvnZlS+A8hfpDN8gQ24cq6h6Qen6lAEPX4FAW4oOuIcM O9xD0yYMnqNjNTEAV9c3DCs5ERbqLrgeseT5+bKoKx9gCEKK33xhvNk6MlKEDD2Fzgxli4HtatL1 HYTAk1tlqzIEiNnvYwWpwu6d3F2Jzs8f+j4bk/g5m9n7yPPoUrhFCcF11175uuPOVwh1R5GYjb9v NmZ2Zvtfq1wKUg0KZW5kc3RyZWFtDQplbmRvYmoNCjE0IDAgb2JqDQo8PC9UeXBlL0ZvbnQvU3Vi dHlwZS9UeXBlMC9CYXNlRm9udC9UaW1lcyMyME5ldyMyMFJvbWFuLEJvbGRJdGFsaWMvRW5jb2Rp bmcvSWRlbnRpdHktSC9EZXNjZW5kYW50Rm9udHMgMTUgMCBSL1RvVW5pY29kZSAzOSAwIFI+Pg0K ZW5kb2JqDQoxNSAwIG9iag0KWyAxNiAwIFJdIA0KZW5kb2JqDQoxNiAwIG9iag0KPDwvQmFzZUZv bnQvVGltZXMjMjBOZXcjMjBSb21hbixCb2xkSXRhbGljL1N1YnR5cGUvQ0lERm9udFR5cGUyL1R5 cGUvRm9udC9DSURUb0dJRE1hcC9JZGVudGl0eS9EVyAxMDAwL0NJRFN5c3RlbUluZm8gMTcgMCBS L0ZvbnREZXNjcmlwdG9yIDE4IDAgUi9XIDQxIDAgUj4+DQplbmRvYmoNCjE3IDAgb2JqDQo8PC9P cmRlcmluZyhJZGVudGl0eSkgL1JlZ2lzdHJ5KEFkb2JlKSAvU3VwcGxlbWVudCAwPj4NCmVuZG9i ag0KMTggMCBvYmoNCjw8L1R5cGUvRm9udERlc2NyaXB0b3IvRm9udE5hbWUvVGltZXMjMjBOZXcj MjBSb21hbixCb2xkSXRhbGljL0ZsYWdzIDMyL0l0YWxpY0FuZ2xlIC0xNi40L0FzY2VudCA4OTEv RGVzY2VudCAtMjE2L0NhcEhlaWdodCA2NzcvQXZnV2lkdGggNDEyL01heFdpZHRoIDE5NDgvRm9u dFdlaWdodCA3MDAvWEhlaWdodCAyNTAvTGVhZGluZyA0Mi9TdGVtViA0MS9Gb250QkJveFsgLTU0 NyAtMjE2IDE0MDEgNjc3XSAvRm9udEZpbGUyIDQwIDAgUj4+DQplbmRvYmoNCjE5IDAgb2JqDQo8 PC9BdXRob3IoZGVsbCkvQ3JlYXRvcij+/wBNAGkAYwByAG8AcwBvAGYAdACuACAATwBmAGYAaQBj AGUAIABXAG8AcgBkACAAMgAwADAANykvQ3JlYXRpb25EYXRlKEQ6MjAxNjAyMjMxNTQ4MzIpIC9N b2REYXRlKEQ6MjAxNjAyMjMxNTQ4MzIpIC9Qcm9kdWNlcij+/wBNAGkAYwByAG8AcwBvAGYAdACu ACAATwBmAGYAaQBjAGUAIABXAG8AcgBkACAAMgAwADAANyk+Pg0KZW5kb2JqDQoyNSAwIG9iag0K PDwvVHlwZS9PYmpTdG0vTiAxNi9GaXJzdCAxMTMvRmlsdGVyL0ZsYXRlRGVjb2RlL0xlbmd0aCA1 ODA+Pg0Kc3RyZWFtDQp4nO2UP2sbQRDFe4O/wyuTJrcz+x+MIU0agRGWO+HCOBeRkNhCOYH97fNm 7yQQjo2KkMYqjsdJMzszv7c36uGgCT5CM6JP0IJYArQiBYUXpFzgFTkKvEcufAsoPltOKQ7MqZKh ihqZ5yAuFqhAhIEaqIkFWEadw8VFN7dYh+tu0S3Wdw/dfAXf3mdwl5fnZ4ch8262hICtICAiIaOg sgjPhSjEQ1gjQhLYhhRItS7YAM9Qbx1otBk5IIfjYOyFc3EmzsMWOQdnsIE4WkVwCALOHlgxIESE hJARCkJFdCCIqGQFjhsjYkIkOmIjModEYorkiQ+J/SYCRCpIFdkhCzJZkmMgUWSOk8kUuYIoi6Ao 2YIGFNJNKJy2oFRUR8qohOxRA1GjkntGJQyjYdjJwxGIIxEXzAY+hOJIxRGLY1zDZtao2cPH7Ilm ER/GGT7yE7PRLCRCIUMxG0lRiFHIUQhSSFKIUshSvBnBOOIU8hQCFRIVIhUyFUIVUhVilWCOhVvs jX9p+pfvq+2m7z7/HD58bP6HdGz8t/5r/6SffqxXU2Z8M3N3A0X/yRUca42HvXZQPibo4BofkbC7 6MeEHtOlvtKl23Hr74epLn+wz6tJHqWMUpvwfjTRUcYEXpQmcZSWfoupzs3zuu8Ww2Z7P9xs+v76 8XHo5neb/qG9GpPm1XLq2Trd/3vVPw2z/hk6nXW1/fV7aUtuLCj29e9rvej/JCc5yTuQaUO1fXWL tgkOt9V/k8O1+JaEv8nhAj0/+wOPeuiTDQplbmRzdHJlYW0NCmVuZG9iag0KMzcgMCBvYmoNClsg MjUwXSANCmVuZG9iag0KMzggMCBvYmoNClsgMjUwIDAgMCAwIDUwMCAwIDc3OCAyNzggMzMzIDMz MyAwIDU3MCAyNTAgMzMzIDI1MCAyNzggNTAwIDUwMCA1MDAgNTAwIDUwMCA1MDAgNTAwIDUwMCA1 MDAgNTAwIDMzMyAwIDAgMCAwIDAgODMyIDY2NyA2NjcgNjY3IDcyMiA2NjcgNjY3IDcyMiA3Nzgg Mzg5IDAgNjY3IDYxMSA4ODkgNzIyIDcyMiA2MTEgMCA2NjcgNTU2IDYxMSA3MjIgNjY3IDg4OSA2 NjcgNjExIDAgMCAwIDAgMCAwIDAgNTAwIDUwMCA0NDQgNTAwIDQ0NCAzMzMgNTAwIDU1NiAyNzgg Mjc4IDUwMCAyNzggNzc4IDU1NiA1MDAgNTAwIDUwMCAzODkgMzg5IDI3OCA1NTYgNDQ0IDY2NyA1 MDAgNDQ0IDAgMzQ4IDAgMzQ4XSANCmVuZG9iag0KMzkgMCBvYmoNCjw8L0ZpbHRlci9GbGF0ZURl Y29kZS9MZW5ndGggMjkxPj4NCnN0cmVhbQ0KeJx1UU1vhCAQvfMrOG4PG9HVtZsYk103TTz0I7X9 AQqjJalIEA/++8Jgt02TkgB5b95jhpmoqq+1kpZGL2biDVjaSyUMzNNiONAOBqlInFAhud0Qnnxs NYmcuVlnC2Ot+okUBY1eXXC2ZqW7s5g6uCPRsxFgpBro7r1qHG4WrT9hBGUpI2VJBfTuocdWP7Uj 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 DWsEDT6gqT+ED4Hn8Q0oqVqKXqis1Fb4JpQMbRWs7o7q9xElU1vjm5TNHZv0QnmZtkLPtR2jtG2A 0UMdW0CfYvQZViqb2r+yUduAkZWpbYK0Q+6lqH2zO1kftJ3t2N5VK2XChlsxEvcFa4FtD7iGu8y2 CedUVzP0VhzVd+hH2yTtU9sUG79LqZ5tV11Xulqp7+0SbZucBV022zU1uUuTt9ARHdLSUMfOLh9t XdchWWOj+xJrNby9b5l4jfpV+SqTmY1ZWeyA/7fdpK2WDnTc1nPtF6hs9kusr1Xa1xgp1GMEPV4j tWqF77gLDW/WtviuWrPdpZ3nla3adt81JU/b6bup7NIKfLeV3dpe312lSCvp5JVS9rRKq+yMV/Zp NZ1LlTqttjNZadTM0P8BrbkzFflbO1cqBzWxM0OxaLbOTItR0zrXKw7Np/crHu1Q50bFr/V2blYO a8c6typHtYHOPOW4NqSPKye0U527lJPamc7dymntrM+njGpDnUXKeW2is1S5oE12VimXtKnOfcq0 drWzTpnRrnU2Kte1m50HlFva7c6Dyrx2t9Oi3HPznQ6rwR3f6bFPd/igh1TMVtXKLneqrlgF98pO vzXJndF5GHkyddW63L2+86gy797Yedya5t7cecKa7t7aeVLxuPM6T1tXu3f5iHjWVQgvjbmsc9S6 1r1bH7FmuYv0EfuMl+/MsF/3xgdG7be8SwPn7fPe5MAF+z1vauCSw+BdGZh2CN6MwIwjyZsZuK4c 9q4P3HIs924MzDvSvJsD9xzp3q3dBszXU7rXsdqb50t0rPXu8q0IriIsV5zXfFscWXS8O7K9u31b YGPper0jxzXuF9jKoY3OzsiTi1HWZlnuLQK9w1XYdRteNLtbsKjeUv2iI99bFbjgKPTug1TF3jpI VU55SjPUtzuqvY3dSQ6j90D38mgvKrfSuSloS45670HY2xilpVJq20ins+0481cGr0UfdDRRO4e9 wc4dLYzuozTmF+oN7gRtj9GUj9HRxjyzwLzxVUo7FEo7VOYBkpin1Rh9mdk/1kLdaUq8mtGd7vB6 HfqsNcfr6V4NGeD3HAGvXx9z9HgPd6919HmPdmc5+r3Hu7PFs94T3Tm2Vc6p7lzHIG0RPCoduWbX cOAwNDzVvcO+mY4O2yST0EFHk32996SPWHPcVZ0XrLnufbB8i7vOd826g44CpDd2XrLmuw90TlsL 3Qc7Z6zFbkvndYwjR+ctZdrt6Zy3lrv9utda7T7cec9qdB/1G6z17uN+wdrkPuFPsra4T/qXW664 T/uXW9vco/40q+I+70+3qu4L/tVWr/uSf601QNdp9OrPsva4p/3Z1j73jD/H2u++7s+1Drpv+Xco o5FrvnXYPQ/LHHHfw4jG1V8oJXsMuKZ6BN8pevUXWxVPkr/cOuZZ7q+2jnvS/EbrRU96Z7z1sme1 v956xbPW36Ts9mT5W5Az299mnfXk+BVrNrvmeHL9qvWGZ4ffa53z5PsDyF/o77HeUVf6+2zEU+zv D13jPOX+QaWU0Ymeav+wEu8x+hVl2lPvH0GpJv+YNdfT4h+3LfO0+S9CBsV/2ZbiUfVBcPb6r1iG nVP+WdsKXG+IU54A6FXsusbT45+zrfP0+e/YNnj6u4g13zPYFUd9KXpwi2e4K9G23TPStcy20zPW lYJWjHetsBV4LkL+XM/lrlW2vZ4rXWtsJZ7ZrnW2Ss8N/5wln3Gr8cx1bbDVeu50bbKZQW+xNXeQ ru221o64rp02sSOxq8Bm61jWtdemdaR0ldh8HSu6Km2HOlbBi+7uWIPxWII5opfOEV3HbLc79uo7 bHfZaryyo6RrwM47J7qGGH2KpnedscfTtZB9KV0v2ZMxF5y1zDpbuybonqJrEiv21q4pRl9l6dcY fZOl3xaxNui6a0+lWqJzUIC3r8QKqtUe31HpS7FndNT4FXtmR62eb19P1wnSPjpG7Bvp2kCs6TAH 4iHDzcBS+2aWvrWjOZTOQ86bXc2U1ttoHqw3sDYIJMvX6JwlHaT+x54HPoNYCVR2menaIJBK6cBK +y6UnaLrz0CGclzlA5n23R2g7UUdYiCTpa8X7yJ9I6W/sVy+BnqzdAIzeIu9tMMW2CoVMbqK0nSX FMiDDc8Fdtn3Ub9kr6N+ia46umxSaofm20npwG5KB4oYXUpp/Ya9saMVK3a62p+FTkCzUT9rYT6H ranm0Be+LjPd0QSqKB3Yx+g6+4GOQ7piP9jRi5XJsY5jgUbbCnVl4IC8qmMA6ZaOIbqWZrSD0nZP x6HAQZofebbT/Zrd33FKv0P9la/SfljNCFgoHXDYj4L2sD3dCKM3YyVjC/ilzR10Zqf0YUbvZPRR SvuL7fs6zqKW45B/DDYwEDhOd1tYh+ymaxj7iY4J7KqwKwyckLZ2TPoqsR6Y0gP2k+q0X0BZSp9W /X5BFumaAesErBnsjWzNf0c93jlKZzesvYfpGobSgZOM1piFnEZbrup37KMd19h6A2sMesWser7j pl9xjCvT3eXWJu8l/aJtjfd054xj2Dvane8Y8Z7vLnSMeS90FyuWjnX+eltvx4auGsdF73R3teOy d6bb6Ljivd5d75j13upush/2zne3BHfHjhvee91tdI/ZrdA5t1t1zOmGbm9obxvc1bL97Nv2qrPB /anjji4s2qWyudtJ9KTugDNOX97d40zU07r7nMv09O5+Z4q+Wh93rtDXYrZifJyr9KyuFOcaPbub 1jXRdYzVOxK9j6a7Zt8WuhLuZpJ0jwRXv/cl6R6jMnTdDnpFtkeepbtjlII8vi10z47VxYSa6iNB j8R26yN07ui6TecO/1qa0j1OV4zdw851zsnui0FubN894tyg53RftvYp04HN9C++2PcoSNT3KHj2 PQpDbFVsM4ll36BIY9+geI59g2JVrC/2EHk+9tux3ycb2PclPsq+L7Er/pPxu0lB/G/jf0eK2Ncw XgH395NV5CVCyFbyOZJKSsnXSRZpRyggNmInnyYB0k32kB6Ez5A+cpzsJa+RIZQ8Q14nf0umyVvk S+TfyHXSQG6TBfJVjufWkG9xImchxzmNe538gPsld5X8jr/B/5b8MWZ1zPvIQkxOzDYuJmZXzB7u sZiamC9yT8Y0xnyL+y8xvTFHuHfFHI+5wr07Zibm37jCmN/E/IbbG3Mj5vfcZ2P+tyGTqzA8b3iJ cxk+atjKHTZ8zPBtrifu23F9fGzc9+IG+cfjfhR3in8q7sdxE/wzca/H3eTfF/eHJYT/2JKYJWn8 J5c8tySb/3x8VvyL/DfiN8a/xH8zfib+33npMfLYWt6VYE+w8yOEQ8ur6V/vE/pX78SYBWQDOUAu STVmG3OMucYdxnxjobHYWG6sNhqN9cYmY4uxzagYVcReY8DYY+wz9hsHjcPGEWMb/RYE6zcS+/nY zxM+1hhrJPT/3CzjM/lM9OxGfiPh+Gw+m/D8R/iPkBh+C/9RYuC389tJHP8y/zJZwn+a/zSJ5/fw e8lj/Cv8K+RxvpQvo29c8lUkiX+Vf5U8yX+Z/zJ4NvCN5B3svPYpaLSXpMT8Pub39J0aMkmmWMuW 0S8u1GqktFar9dUequ2tPVY7UDtUe6r2TO3Z2onaydqp2qu112pvArdr75p4U7xpqSnZlGpaacow ZZrWmzaaNpu2mvJMu0y7TUWmUlOVaZ+pztRoOmA6aLKYHCaPyW86bDpqOm46YTppOo0y98PWUCgK hQORcDgURkGPotx54ILpEis1bZoBrptumeZN9+oMpgN1Ql1S3fK6NPq39oaf0v/o8oAl0y8VZxEj 7DKbfAVWvYVZ8idgwcfJy7Dh18hOWPDr5JPkGsIupqNPGT5u+ATJN7xseJl82vApw6fIbsPfGArI HsNuw27yGUORoYjsNZQYSshnDaWGUlJkeNWwj3zO8HVDC3nF0GpoxYjgiA9jhWo5ncRCy6eBUeA8 cAG4RDbVjtWO116svVx7pXa29kbtXO0dEzHFmRJNy0wpphWmVaY1pnWmDaZNpi2m7aadpgLTXtAl pkpTjanWZDY1m1pNoslm0kw+0yFTr+mYacA0ZDplOmM6a5owTZqmTFdN10w3TbdNd+v4uvi6pXXJ dal1K+syoCMu1h2rs6+OCA9o6ysIWeRnCC+SXyNswLh+i3yQzCJsNNQb6smHDPsN+0m2QTSI5MOE S1QTj4JLIllDlhDirARqCFeHUeKsBcyM5rTamFRnibaXoVIrcdZolZF7SlPUajVOs1bLnjdrWENo zQ/kDcei1sqeh+9pPhrTNAr6nILyCsc2TYykU5oinE75hJ+FoWk2hnC5sFw0pqDPfKjTF2oPrf8Q 4l7w6n0Iv2iZFiMsTxiPKvswHNM0Jj+VIZwWlovKcUrzReSmugk/i8YA9B6NcBsWg8pGedD4TEhH Q7incViH9J7WFe6nsC5o34b1GpbnUCim6eH80eXOaocifUzz+ULxUEgGKsuE1sviSe0Y40fLhuNw 3bRcuL9oHJY93JahEJ9w/t6otkS3cUobcF7VhpzXtFMROQ8tastiWcPxYt41Ufdnou6pnqhM4Xgg 6v6mdiZiL9G2GG5H2AZua2edd7WJCM9wXPKQ9lOeD5Mp+j48DsN9i7pcLcG0xXEkD8qqvDapFrnX q6XujRF9+f6M+Myf+Xxxvofp/U/Errao+4FFel+siz8Vn3nwnrb7kXHN/Tiaj0sJ6uk/ilmfhcdA dBzWQ7gdi+RU47Wp8FhTl2pX1WTtGqNDMeu7sE1RGVO1m5E8K7XbtP/UDO1u2A+rmW5eXe+Oj+gs XBb36kb3UnWzO5mmqVvdqSx/nnulusudoe52Zz4wzmGHapV7s7rPvfUB/4JYrXPnqY3uXeoB9271 oLuIPaP5Le5SClfAU+jq8RSrDneVq89T7ur3VLsGPUbqE13DnnrXiKfJNeZpcY172lwXPYrrskel MrquwGeG55XovsQYZjaxuG9m3aURu79xv47I8zmP13XHE4j4nYfZrPkhtvaIvnqbv1r8PKQjjXh6 tDhPX9gGtURPv7bMM6ileIbDuorIULLID4XsRvW49z10foq6V/3uOvWwu1E96j6gHncfVE+4LdHz lHrS7VBPuz3qqNv/AK/QfKaedx+Ont/UC+6jkTk/au5VL7mPs3jafUKdcZ9Ur7tPR+bhKKi33KMM 8+7z6j33BZrmMrgvMQjuaRpHz6WuJPeMa7n7evQc7kpz34rwDLXZle6eD4PpBbK5Vrvv0fbSNrrW egzhdYMryyMw3uEy2Z4kV45nuSvXk+ba4Ul35XtWuwo9a13FnixXuSfbVe3JcRk9ua56z463+cLF c194Llnshx8VL7avkkVxtM9TH2Jvj5qLFs9JsFdWPjxOwmM+en0Rmk9ZvqixHJkzqE5DMZtXaBwe N5WPiP+Er33keKP9WrJoHC2e/8LrEdy7vA/GkXnf9vZ2ROJH9cdieRf1S2SuDM+ri/sv2reH5+no ODy2Ku+vn5i+o9ePUbGryZNPoa3wjND5OLIGD/uSMF9AW+UZe2D8Rq+NQ2Mvsi4OyaKt8Yxr6zwX tQ2ey5GxTtM3ea7QsRcur23xzGrbPTceuu4O17/TM/fAGnuRbwr7oQgPqk863sO+C2l0lx37g9gf EhK/h30ldC6efpmNJ8/9Pz7h+BZZYCcZr7CTjL+NmYn5DaeyMwwPO8M4xM4wJtgZxq/YGcav4769 JJvfwk4mJtnJxCV2MjHNTiau0ZOJGLp/P0yO3t+/V8yS7RWzpZdLr5TOlt4onSu9U0bK4soSy5aV pZStKFtVtqZsHbChbFPZlrLtZTvLCsr2lpWUVVbcKKstM5c1l7WWiWW2irmKOxV3ynorSdlA2VDZ qcq4srNlE2WTZVNlV8uuld0su112t5wvO8XCVYQ1LGxngd6dYqA0QPfisV9j37R8cHfZCJ1/lXwN +8pjCB9iO81s8nMygb3kBYSXuH/mxsjmmIKYPSSHngmhJEcKSXFUe9NJekV6xeqKtRVZFdkVORW5 FTsq8isKK4oryhFXVxgR6iuaKlqAtgqlQq3wgqoG6LW6IoBc+RVNTEZqLU+xtwwJyUDgyGoEHrvZ NSSGZCIYyFryPHbwL5D12OG+SDaSxyDTVvI4yUVYSrYjPEHyEJLYf7V5kv3Pm2XkUySfJMOqCsly 9k3pVFKP8AxpRkgjBxCeJWcRVqDtvyDv5JZyS2GhXFxu3I77bW0fjXm6fbT9fPuF9kvt0+0z7dfb b7XPt9/D5lsQk8TlYpqYLq4W14pZ5nQx+1tpYo6YK+4Q88VCsRihUCzfr4rVolGsF5tw1yK2iYpY /tUMURW94FKPJwGxR+wT+8VB1DMqDrdPM67ZyH0/jInloVAfCkokpRw8gmFcHEHJi2K5VMt4peF+ Fpx34G6aYRqys4BnaawWGii3FjEL8uRDikviZbSgX7xiDrRfF6vb5/dniTfaL4jFFOIc+BaKdySC fHPtl6Q4KRESl0MbLREsBz+KNKSvFb0M4L4/SVoGLdWjRiMDaqOQUqQV0irKN1wL5RgBlQGQ1iC+ JRqldeiNebE+DGmDtAmSN0HvhWKWtMWcJW1vPy/tlApY/YC0t+E0rf+BugGpRKpEf/XQ1ko1jAqD tp+WRq72Uek2k+1teFi6dFu6a057QP4osGfzYouFt8RblprTwhJG42HpNM2SbEmNlj4MpK9smKe9 HASVQ05CS9Pky6yV5vZ5qVlqFftwFaXmhhmm4UuSDT3UJ2nfSpN80qH261IvNNgC6QxIPSYWSuvE 5dKAmCYNSafEy1/NkM6Y0+VqMV862zhjTpcmpMn2C9IU8l5F2rWmOOkmuM6Il+U5+Y5ClDglUVmm pCgrlFXKGjlJWSfOtl9XNtCeRA2FyiYpkaIpriFTbAqWoM+ULcp2ajsRjYa1F+rtiFbCdhXSgrLT HFAKLPHUQpS9kiinKSVyErPV5ZYqVoL2crNYaLknNcsGqbm9UeyTBTlJXs5CmpxuuWC5IKc1YpS3 idDrblhyvbwaumjZnyavlfbKWTJqknPkXMgzKhrkHXI+QqFcjHLlcrVslOv3C/vV/Wr7jNwkoxRy t6E2RVbFcdkrB6D94/uz5B45H1qHfUKKGdTct39cKoBcZ8UWuV8elIflEcm2v1oek8elVvmifFm+ 0j5qyRDnxGJmCZn7cyzrLRsxAgstSy2bLVsteZZdiHc3DYT11ZS4P9tSZCmlrW+fgUTXg6On/ZYl NRijhfsa5i11lkamV/SJmAseBywHLRZzFoPD4mlKtPjh59oiQN9I2xtOWg7vH7YcbWh8mwWnw7dR oG8sxy0nGA5YTrLxtzY4DsM0HY8N86jntGV0f3XjLct59MAlyzTqnAn3KzxqAC3m6ai0XIed58JX UlBrp/4jRxy03LLM729DG3qQVgh/C1+rVCo1Sq1ilmflG7KqNMP7XVBaRcGc3hQnr5WrYQlZ+1UF /QxZvXI588WDik3R9vcrPnm12AKLb5Zz92dJvcoheJ9epVc5Jge+mrG/SRlAHxul3v3VyhDCKeWM gjGhTDTsQ55JZUoJzr4SZrGV/7+veNCSKmJk58v0f6+TPbsJt+cCSd6Tv2d8TyFCMUI5QjWCEaEe oQmhBaENQUFQ91zc40UI7Lm8pwehD6EfYRBhGGFkD/21h4/9ZuxB1BFLtpGPQWcfJ5/ACuBlzONx 5G+gmQTo8HPkHYRLbEt0MInY70JfPka4plLEA4irYlK/3NtU9OVjwAAwBJwCzgBngQlgEpgCrgLX gJvAbeBuU1E9D8QDS4FkIBVYCWQAmcB6YCOwGdgK5AG7gN1AEVAKVAH7gDqgETgAHAQsgAPwAH7g MHAUOA6cAE4Cp4FR4HyIvgBcAqZD7TkVJSuVayYkB8V14FaIpjLNh2S611TUYAAEIAlYDqQFZWlI D8njiSp/8kE0rAbWAllANpAD5AI7gPygLOx5YUhm6KehOChrQ3lIZkpXA8ZgPawP7t4Ha0sIDfVA E9AS7IOGtqC+adyghOSkdaiAN6hL2rdU75Qv67fjQX01BEJxD9AH9Af10zAYjKl9NAwH+VIZqb7C slLbaBgBxoDx0P3FoP6p7mjccBm4AswGbabhRiieC8l+J2hDZhKK40LtPBmMzYnBtpmXhWwK/W1O AVYAq4I2al4TbIN5XTCmfUtlNG8IxZuiZA/rYXEMuzdvCcbUNs3bgZ1AAbAXKAEqg/1jrgmOD3Nt sH5mvweC7ad2HG6/2Qw0/x/2vgesquvKd+99/nBFYgwlxvKMwxBriGMJIuLlgojARUQCV+I4VhnE C6UGhaGOZeDCUOs4jmGsMY4hhFLqWMdSSo211PFZY61jbGKJcaj1WeKjjnVSx2b8jJ9jrbX61vqd A/dc1DQhmWm/9/Xb3157n7XWXnutvddee59zz73Xmj/oyOV6e+10WfbXNVPeYvu30+6W4HVdu42f avu+2/YjvwM3vLR56nZQv7Te6zjvturw/36rrONxozmuO2xfH7OvaVzq+hx45iPfqRuwr9n+Cw4+ G+/0ER5HjH+TXV6y8bdDr7n9IL6OYk3dddtP19i+32qPnb0WWL8QvH1dr4L4Ibt/S+kcc4y1PU6/ rRyaA0dZT3GxYbU1dw0094FGS5+GJkt+w3pbT57/PMvf68kH6rmMsXD1FEfraQ7rE601V++24kZ9 uuU79TTG9XlWvK4nP6+nuFpfbPsdjVm9v3EontaTX9dX2/54wu6bxrSeYm79Wmu+6omvgdZRA/ln PcXf+q22L7JOrY1D8b2eYkg9xeP6ruA6rKcYUr/P8osGWnv1NH4NtOYaaL010FpqoDXUQGuogdZQ A62hBlpDDbSGGmj9NIy3Y6LnHmuR/KqhedgcT7H643jSsMXug8e5Pdiugea0oTO4/hp2WzY29AR9 s8He73gsG/j6mDVuDb3D+rviWKeD5TBfwdiQ/Q3kvw1nrNgRoH2jgdZCA9twKThWDVeGrQ+7L/hP tbX/DO1TPC9HGof2zXpaz/U0f/Wn7JLWbj3td/W0t9W/Y8f8bMvmetqf6mlfq79tx7Emax3xnhHQ Lb8YzCwvEG7nsVb7wDjLBtYtQHtfIM46K3AsDMRbJcaCcoD2uwDNX4D2uwDtd7ynYC+kHMi3yyJr jALkw4ESWy7teQHaPwI11prnPQT7eLWVA7XW3sXrB/vTLbsP2u8CtMcF2F7y4QDz0P4W2O5oQ/tY gPaxAO1jAdrDArR3BUh+gPaowElrn+I4HzgdjIVsH2LVbmsNDpU9dsw5YM3Dby2de07ysFg4uG/G WWuXY7dz70H/jjJw9h74wZhIZeC8tU4CF4N70FA5uA9RGbgceo2SfXHTPUrHvn3P0hFr0e8t204b j7PhCbvsuMf6oTJwrTFk/8PZzlEGblplg3Dgo609YXC93VUOX5eOssE+TzTwOYJia0OkVSJmD98z E239B8vB2J5uxavBtTxU0pw0TLTbHrHXoN9aa7wucebl+Hrd0pPXJOcGGq9GGqNGl+VjjWPsuYm2 7SXZjVGWDzZGWzIbY6x9AuNqr73Gybb9p6x5aJxqzQvHd17rrAfPW2OivfbybJ1Ynrvx7nO3LXtw HcOmE5Z8Xt+cORY1plvnII5DjWRzY54Vr7D2L1rjwn3zOzz4nyjx/9OTbVkhj+Pp51WRQrdgt4Uo PCJEHt1n5YVTHkt5HOUJlGMpx1GOp5xkX3soZ1DOoZxv44ooL3bkEsrlNm8l5RobX0u5kfI6yhsp b6a+T1A+Nazst8v7ZdLZR/r6wq0Mudvsso1wg7rHQveUeQcKzs87PO/YvN55ffPOzBuYd2HepXlX 5l2n61vzbuWpPFfemLwopOi8mLzJeVPzEqnuzkvPy87Ly/PNW18oCm4WCirNecmU1lMtEnAK4RMK E/IW5RWTFH9hQWFuYWZhGvnL2LvfJMV/mun4N7OH8a9l4/CvZR/H/5VNwD+VPYp3SGPwDukn8e9k 0/C/ZEn4R7IZ+EeyZPwXmft/pA8pTVkEb9krniBviaE82c5TKSfapTO7bbrbwZvuqA/P2ZTzKPts vuG8jF9k91VM2U95BeXqYbxWf0/knsg9ldufey737dx37HQV8Ablt3NvD2HfmafPC583lspxdEX4 eWPnTSBM7Lxwan0uyMdPIvAWsMD/0Vn/RGfgLeBwvAX8AP6Jbjz+fW4C/nfuUfzjXAz+WS4W/yk3 Gf8jF/fRypJ1whDFFJly/5D/B7MShpqqEmjlJapEqiepTwkTv9cwNXxneJ/4JM3MWJqZzN+5pr8v WQkdv98h5Lvyl0KTv1IPivDwvwn/Ku2rSncJQ4rfuY5/yH/If8i/u6xEgbDO2H6xgs7YfK7+YzpL vywewy8JPU5n6VO0652jNFOcp+QWFyil0Ln658KDXxVKFb+glEZn7Osk6Yb4lUgXv6aUIX5DaQ5+ cygTvzmURScbU2RLlxwlvHK0HC3m4leIcvErRPPkQ/IhkSc/Jj8m5suH5cMiXz4iHxFP4deJCvDr RIXyUfmo8OE3ihbgN4qK5GPyMfG0/IT8hFgoH5ePiz+VT8gnxCI65zeLP8PvFS2WrbJVfEq2yTax RLbLdrFUdsgOUSy3y+3iz+UOuUOUyJ1yp1gmd8ldolR2yk6xXHbJLuGX3bJblMndcrcol3vkHvFp uVfuFRWyR/aIz8h9cp9Ygd9DekZ+V35XVMpX5Ctipfye/J5YJb8vvy+q8DtJ1fJV+ar4C/xaUo18 Xb4uPit/KH8oVss35BviL+Wb8k2xBr+i9Dn8ilItfkXpr+QZeUbUyX7ZL+rxi0oB/KJSA35RqRG/ qPTXo3486seiKVyGzxOfD58fvk68RqfHRD5JDr5vkbVWPFgVWFFUtbZqQ9Umynuqtla1VvqrOqp2 VnU9k/Dpbv5sTbXyP6Sqr6mv0S77TfVNwrysXhZK7VV7haa+o74jdHVMHROG60nXk8J0/cB1QoQR 12vqgtCpL35vRFT5hKo6R5nKrChcS7qWQ6VF0xyZcb6qCVU5VY1Vx1f0VeVXJVXtr4qt6q66WHWt Km5FRdX56gQbf7Eqvmpv1eXqZPBcq04ewnuIwrgMyper00jaoaqb1Zko91fn2lJvVhVZ/VQVkdxD 1QVVi6uOVovqhdTueLVJcuOq4qsjqpdUlRDX/uqElWJly8rVmTG43ltdunJ11cnqyOqKqvKq/Orx 1auo19PVE6snVVVWnWVNV5pVJXSVVFVDLViXWqun4eUzRyz9Vo639RzUb7Ac7N+Wd7/y3uOW2X/f cWusOk/9JQ+N1zprvAb1uXu87HGi8UE7e3yGj8v7Hg9bjyF9B/sblGPbMzReG1f0raioXk3XNdVT SNJmqpWTjdt4JqsjWD5sKqIytno8t6NaflXbZw5VbSfO7StN6ivjvv5k68XnJfVF9QL5/ovqRTEK /78djn/YfoBoYWq7eoVoR9RxMVG9oX4uHtde1l4WmVgLWVgL2aOvjv4vkY/feZNYeXH47994fncv RDZLDcdqe0m9JIT5efPzQprrzfVCmc+azwrN3GJuE7r5osncv3b9mjT5jes3/J9VkM13u0WiCNKf tHF8n5MuVofgovDOV7mN++i04GixDXArwR7aKYZizcpO4XvG/czUeyVPzb3xSG4nn8W5shP5ntLu J2tlMyebarf0bLdpu0HtgeYtI5rVhZSXYDwTbEwmdtHcEFw8lR5KSSHY8RQlJyFNtPGWHgy3B+cB 96rWP8srY5Wxiubh82a70DEDsZiBx/Cv7pMsuXRXpFSySoPMaTZuAuFi+XuXDpyL5n+MmqImObHy Kt053VC5IbgBul+4oIRKCsG+xv+4FILZR3xn5EF5JAS7ne48jlDaJbtD8BvpnqMLabPcFkKpJjlb 5BrasZ3YxSQnIEsorwnBZxDeTylHFofg40h+HqV4ytkhlDFESUCKklOcFHFNmHIcJ3GT4NgQ2hkq b4oBGR+C5f9bvkB77AU5PgTP/8/Mbz7ukSIEv5XuSnsotVK+GELhJwltSE3iRAilRJh4l3Itrd21 oieExv5WLjpCcOxvPkoh4wd/8yANjl+ovymKBi8KgThgremfjcgLuWUf4BtWzxrFJy1TW4deE21c nNC03Vq8Vh2CjRS61kppvLbYiVc3iVtoPdqBECydM7RKdUnr0HaG4HuFoRVpRapP26BtCqHsJSv3 h2qiOkj2JLUzVBO1kWSP0caozcM0qaFVU6tN0XJCsEtotzinSrUoLSEEnykMOg+9pnLVLW18CIXs V/HqvKaHYMl+1arGq1512YmXN0nOWkpC9ajTIZRztFbeVhVqcgj2OMnxyZPKp8aG4PeSHLdyy/2U b4RQWmkVdaiJqkiF2CvXUgtTblCm8qiMEEoFrZV3KK2S76iYYf3nkVbcf3QINon6OCA98oAKsVpO oPVIp24ZS/mdEIoiiktupJhygeoOCq0dk+LEZVlNbY7bK2mQ1ivCZJEsEn0EN9BJvTeEupvWQY9M kivk+hB8C/U1QbTLCaT5qhBKI/XF9y3rCCbLohBaKUmrEG/LaJkWgs+l1XyCdoIT1GZSCCWeVjNH gCSOADJ8iCYpuvA5QdiYwV0pHKtOmF8w/4b24781N9Ae3Gw2C9PcZG4SYeZz5nPCZb5gviBGma3m SyLcbKeVGYHVyGeVcPWPQ7vao7SrnRaT1Rl1XiSoC7TDpWrdWreYjX0uA/vcHOxzmdjn8kYcAe4d Ud6w40owRvwT4JeE1PuNKLp/iBCV4hEhy2qRhV0Oz6Zd6mVnqTwtNKor1BlfY7c7jbph4wbbLiib VHrdv59yXOluSrdKB/zdlGOXeZZ5Sm8Vh5d0FYcXh9tXtcsTKUdbV6XXl/q5nX3VV3qdct/gVUlX ad9gu2Gc79UOtMEeimuX1RbXlnTx1YyjJV3+7pL+5dHlqiyy9Nbytf79lLdbnMujlvqXRy0fc0+t cbVc2T0cJvsO+ycM9udvc2pGtKHeS3uX1Zb2Bq31bwvh3HVfi0KulmeXrafcwlfF8f4k/zbK3dZY l3QtbSWrdlmc73UVOi7Oq7KEoXFxlUeHXg23j/RoLukq60G7ZNZsqb+spXyMTdtyP9p/h4f4N9I4 bPRvLN39EfrEPbzgvvP+XjP9oee2LK2sYPmYssOlvaVNxLmlbGFZS9lCGsGm0s6yiWVLlnaUHSu7 VDZpeczyPKK1l/WWXaGV2MkWkbzasuuWRaFesDx6aWtZn3//4j3Wlb+EMdas+JPKdlDvQ5xlnZRb 7LFOWp4+SJtxlPC7l9X691s9+OP8Jf64pa1D7XqWRy9Pt9vFlXWWnbF6WH6Q1zPZnkRXnWWZZaX+ 7rLSpVeXb1i6qCy3rMK/v2zAti+3bJX/ctmqslulO5Z5/J6y1WUHyi78+cTyqGUeioOj1JcowgnE TmmupTiuKI7/HUXwZordoyh2t4gHEbsfMr9EMfVjiKMPI/a+jzsS123XbZGPeP0UfmklSkRjB7J2 kukjur+hu0PSdC3tOy2knSS9vsQ4yLxC2To9JNmYAbpriBJvh+CO0xmAEX0hWDq9yokhmB0k94yM CMFtpvIopdBe6rDvOzEV1LZdnA7BFVG5kdKRECzvzntDMFOobanYHoIbRyV/v2mTjZU0U2vNDz52 I9sz2xm6fgp4DicCPnHxSbMA+swAbqrg53n8G/JrHdhxlCfgXqDSxg6e7gct+HDngHvv6extlynx Gc7ytmT+ZXu6w+qnJKXLgdVpNm9gVqW46sAr0S3O0VW/UwKd2VpxbjsWImEfpXWUpdgTIqFS8PcB WkMkNItF4iRdrw+RwN9Sy8ATiuoQCXGik64WheCi6F6M77AGcR/MC2jEzM387UAaMfIFxIAH4BFj 4BEPwiPGkkd8WTwEj0iAR0zD2CaOfnf0u2I6vCPpnt6hYa4rHXbPhIUFYiF5Pz+ZWOfAG6R/mqih xCuh0kExyW9iyXJOsYT1DdFGEjc+SqtpDky3mU4S6TxuWk8P3Gy5GWueNuMIt4hyyxBemeEm3e9Q C2UeM5sc/LuNqwbFEpPuUsyKIbzOsc3oN8j7zDGUCxwtGo3DxjEhjWskq9FMcrTxm35jl0HaGP1E 85vRwVZGs5lubCHKIaLkGLcdraYaNeYkg06gBt2rGheGKIYZaUYai8xwoxjf1JTG8WAr47rhMS4b FAWMaoog143dwXakd78x0egzKHYYRUTtN7YGR8IgwYRPotoV43pQQ/2i0a7TejUoVhhnjIFgC/2E forw/L3iZuOQcdRhVY3eo9OK0S9Sm51Gl0O/RcYivU2nGKqfIFoz2z7UyqM36XSHpe/lulFtrHG0 m2hM1P36CqK2EHWiUWQsduiYrd/QKeLodUQTRpLhCbbUL+hx+lk9nqjF1ON4Y2JwRPTXKEXoh/VI omaQRbcM5WjZpV3Wd2jXiBZLfXTpA7pjFvRN+ibtpL5eo71E14m+ieQcC46OtkejqKNdIKnb9X0O fKvWQfhewm/UdwZt0NbqSdoGovQQpUbf4KBU6NEa+bPWRpRF+mqHrHyN7i21tdS7S0/TixxtLmuJ mptotN/psbo7aJV2itJ4jUZBy+fP8fWJjlb71S2NRkBL4Lr2ju4YDa1da1fnFO3YWhRR27WT2ttB TWil89O960Rp0vZqJxwyy1WnIi9UZ2F7j0NinpanNvNzYHWEaE1am6NVvFqtaPdWu7iu+bUmR7tI LVItUuT9qpmokVqO5g+2VG71jqIIoGjvVNe0OC092JJ2rwnqpKKYpXzUY4QW66AdxLMSWgOK1oC6 opkO2nZ5QbXKS0QbT1K3q1P4Dtag7evUOjxx0ai2T/UGdZHdqlTutZ65qBWqXe11yMyXW1S2pFgk j5KMtSoYlQyVoBLkGhUnA0TtJGq5CjhaRspFKpyfXUqyX0WqHFUc1Ea6JVnMzyNUnkOTWHlaUvyT i2BfkDucn1lSCyWPqQkO/t2041L8kxT/7Gcv6Bufh/bz7ks7trSfvVgtGsVhwf5P8U82yj5HG7/0 i12iGzu2oqv9wVaimfrmGEDxT+bIdkerqaJGThIU/wStErkuODoyUkaKRTJcsNUU/+SKYCtxXXjo dJGB3VqJ6zI/2A4nDP5e+SSc+ZTolwk2dWTn3d/tcxY6p6lW9aWP+HmL80nLG/zMXR7Bt/rw2ewn 6oQobEYpuT48F2UO8UgHr8+XUZBcuLbwROFrhfsWHCvcV3jKd963Oe944R7fadQzfNcKN9DV5gWr 5icX3njaU3jDd+3posJTTy8uPJjnyTvu2/xU5dMl85OpdUdebGEHUTPmJz9V6Tv/VGVh/4Lep8sX FDxdQlKu+i4uWDiUSR7nwiOFNzhze+Zz5vvplnf86crhekEO6TSoz6Au99SD7SO5aEc8vgzShXR6 OmdBhe9iUfWCJbiOJP4aKicVJD9d+3T+gi0LSov8IbqQLNwR3v0Z28ahz9gMfMYWbraZbWI05jsC 8z3yTx6tM0oKvOwlkiThK8/fxeEZ4mBv2sqfDsKb9Ls4U0M4N6st9ueIfC/Cn2zwGwCZpLF4jNrY WXPUB7MaRmf+MRPTizIW+ArXWeX8FVaZu8gq864E6RPXLPB5bf57lUzP9cXGTlxTEDW/Iza2KMdZ DvLd51PP+80Iz0XEe35CzM+MHd+fjR2DLO38yKPbfLveT/bV+Db6an2bOT8V69vma3xqI3It5XWE b/S1EW0754KmpzZyG/tz3S+SXs/z57FqG+3Jmn0iH9IW1obD2tGwNgKf8T4Aa8fA2o/B86Jg7cOw axxmNw33RFYWdMU43rHj7TyIW2j7SrSNG4zKI/t8+QjgvxCsoR2ERzadsojpuW+W98BFFHZQ2lk4 ZijzVUehi6CLrsbYddDmHyjsGJG+I/skf/Dz+jr7/msWdtRVdBe3ka7LHVi+M+XnFgVDuJGO6hd5 FZOft93nbQDmeemD3wEisiiyhE8Je20t04Erx+/FdoTgfHQHy3u/E5eGTy9rQ3BxohG+5sRFiWrH SKSPeCS2Do0EX/2DCL7T8ALgiwxpTCx91zv0nW3r2+TQd7atb41DXwvnx1OsgiHcSPXdHKLvc4Bb 3nMWgxEcb2bQqYr2ofc48zxHZx5+Mjkap50HcNp5ECeOsYhvfBcUIRbxJ1aPxt8/5699b7ojR+bW 5Jv5Yn5lvplbM7+SrtLyM+dXzqeSYKVF+xBaj7wlxzM+n+6g3InRmwMcvyfBTztyxTYHNhGrWKMy UTQ58BwJ+fPCaKQKm/LRPSF6HvCb6CkWs4Pfk8idhCy9e7Bnf1l1wJef5PdCFH/yGEH7/mghvBRX Oc9dgpKvZQ5JHiwpK7vuyzmTkzYn0Xvau9d7yNs4d3LO+hyRVZFxzMac9O7ybqOyOyfSwuQMEO6Q t83b7d2Wkev1eGtz0rxHvd0ZyRnJs1blXGBpOReyKrxHcy7NnTo3kTg3z3XnCO/JnOacK9RTd0ZP ZmzObtR35VzPSZib7r3m3Ts3OzuRU86tnIGsCiqveDd6jxNsy5jI8kIg+rUh+oWu3ZZ8q+3d8P1Y Oicx41jOKsvGuepeNlIvsI7tIk7Y5bTovW2xx9MaSci0xwG6WdbNdXlPs6Xe43Pz5o6h8trcKB5X lsNjS3IamTPnytzojIVzY+bGZLNVd1uEHu/7dtgH2glC/SsrWyjO2TdR8rXMOkV5sDwFPJe+7CvZ t7JqZx3KXp+9Jbsua2NWXPbhOX1zTAuTVZl1NquEyqKsHJvnelYlwSbClKRHZjVmjaP227KKwF3k VSzNq+b0ZW2btdebnt1HnDVeX/ZhanXJ68qqzSpKXzj7iHcR6mezW7zZ3uLsnuz1Xv+sa5y8Y7x5 c/q8UUTfnt3udWU3EY7kOaHVr907+rV7h3yr7d3w/ViaVTvHzJ5i2eiNvp+NbB3bRZywK8Si97TF 6sXWATLtVpZusM4bM+sQW0otVngnU9njncrjCjk0tiSnjjm9Lm9iep3XTSmKJN5lkdXjR+Nfoe8a ZqUJX1ZBZPzvcxrRs4lhdmYuFL7ZF2afuVd6aMK98UgXnHwWZ+ZC5HtKu5+szGRONtVu+VC+TVsC aukI7ZyKvdO2c84qETGn7p5p9ZD8UWqH2kHy/0nRuVJ9XX2d/OpltYfuzd5UbwpT9akfkQ4/Vj8m zn7VL8Kpr6t8hpLFcjXuI6L5ZBS1CllS9mWKzPGZ5gfIEZkTPxD/YI58D3n3k/lBdBupXsPbDu/z t8i9z2fHH9QX9ovDwTPM7FLKLcI3yzMr1l3gPkDlOEoelB73Ac/lWUdnLSZKwSwd2LGAnDam13ku c+Iru9xoJ4e09F6HrMW2nLFBGbO3zm6d3TG7FRJKZpWk19l5FefZO2d3zd4ze58Y2SfGUiTY39CA temrKXeKCI9IPjm7Lflk8kl+bdOqe8Ts7Y5eRuz/oTElPVn4UgeSr6a5Ui+lDjxUkVadOsBl8tXU M4xJHUjLZtzMErq6lHom+SrVzqQpopzhlHyVOIkysyRNWQl0W1rqYacsyCbeoIzZ7tnplLIh7VKa Stk6a0LqQMpWlpKmZufN9s1eNHuRGPxs8UPETg/50NimsU2Jexh6Ot0HrZKhlTydnt3Bq/eXBqVx y6CsDyonfY1VjtDOcn6yTnbmiQeFSNktxIPtVvlBMrWJmNmcctrKnFJOp0ZxPXXTR/CMfOTeGhIN 3CeRfZ6TnvOexZ7NnvMpgeRznvOpmZ6jM3I9RSm+6a3TW5MyPEc9m2d2exbP7HYPpKxICaRGes56 2lJ7Oc3InZGb4kvxEf2snRzSPJWpmWlXB2WxHJYSlEEc5z1F1PZkam/ajdRez0XPRs/Z6a10dTvV tKR42hzPSD9E7Jt5HtmXcjaxK/WdlMuJXSnlbj/Bbrc/aYk7kHwo5WzK5elF7k0p3SnXUipTrs28 ktiVNi71FEeNxHOckpYkLUk+RJzXPPZL4E5pKTUOWZchh6QEZaSUJ3a5AyT7bOI5z4BnkucKlZCd NsFzyZLiER+NtcnXkH0pV1Ii3XtTRErkjJPu2pRILqevmnZw2sGUK+7uxPLUpJTcaQfdje7LM5W7 LdWTcitlysxWgpSmr7I4iXeKnZzSbgZlubvpKpelBGXMOJkSSZTL1IZkpWakTPK8nXLF4/KMSc3x KEvKzNYRW3tORsFaPL9MNoUYfc0qh+d74H2e1Z46T5NnvafZs2VaGsHVnpZpB1IyPO2JxZ7mhDbP Dk9nSsb0y57dMzkedU7b7ekhygFO0yglVSRVEHePnRzSqKUtK6mCrkkOS3HI2OKpo5a7ieuA5zDl Y5R7KPd6+jxnLCnT1o/weemH2CvD9yJHTC9/8tzdKemM4wnnSJ60hfaVgxyRuOLJjmBKKbfKxBUf ZV+j+pEj3Dee7A+mhEqrdN/4kH3dkInB53fJ6iPJvnhX4oTphxMnzChK6p9+eEbRjCK+SjoR74p3 BXEWhmsziuLTKbucienJSzg7pSWdCMrimiUlKMNd5F7sLqFUTvQSSvlWTk7j7K4kao275kM9O/wQ pw7XGOHTtv9+J/sJ4ge0806+cYhafhKwR+fPov9OJ//SNoXxp9dfD0vguikZGucJ/saCYQ8RPGrG Mg9T9e8D32DGCGlEM9R2MEb9m76A4NcYatEWNL7AGI161IBXzcD3on5Fn8FUYxngZvRC0sQm/p6e 3M7PwNV4MZ/gRXwmtfXOUsL33s4lztH4Jl7pHZZzCt/WvMIYYwLXtSSGqpM/eVHPMr/4FUuTS++Q nvIB5tRimEd+lr9jqW4ATrzDb+i1cO+qF/2+JJ4nnhnc9o7b6CFo8jtVd7bizao0Hj2xBO/4tFgY 7RbBHGDKLagNgNMEjAd+OloxZh34BZ2eGM/vYCQC36Lz818f5ihNu4q2/JaXD/zl+lxgLCq/g5ao nWI5YXRXfGcNQ5EG2GLwXU6Pwd8fu2JuBob5txs/JHjI+CbgWwRfM14F9f+AH3WTP605CwnVgIfM H/HsmI+B+gxkfoZgl/Ei2lqt2oDhd3EOhU0AZj+oVwC5r00Mb7VhVNfYMI79E3ANzw7BRB5n1PN5 Xu64wbkL0ATMF1HgyQEk/lsZt2uonskzfvs4wztuwLGA0YCTbl9FPQZwB3gIc/sqWg3Y/CxnDTDd 8J+Pq2Pk+e3GSvKxRH5XzugzyvlXrflNLaPOoPVlnLUh4c3nuK7tZKj/b4Pfi5wIzOsMw04zNNcZ BZBwhGAcZEbhLbwevHv4FfA8Z2QTfJAhteL6TIbGW4BfYKi9qn5DcA+dxKW2nvxa6k1GHdUDXNfe ZX30aI0s0i5qEeTPt/n9OJWCt+R+pG3mz9CY3xyjkc/rcQy14/ytNu0E3mQ7wzxaMd54U2i7kjH6 dOB30GqjMWGoP8ZQa0W/o5hqHOC6moy+lmpTCH4Z2i4FnAX4MOA/Av6E9VT/C700MzQ+ZfdFdb0e 2m7muojDZyNR+ORvImAcYCK/66UuyJ8R/Abfu2h/qcgztbm4j/kx4KvAxwCfxHX5MvAH1Xf427Ya QfkWeE4BLlXfIvgE+Kczleq0grQHua6+xXj1VXDWq33AMM8NSPslJP8D3jc7Jum+jxyG36u6AXhU XuO6ohUtS/hbv/K6eoLgEX0Kv6ktOarclp+j+gaNLJLZ6gf83UtJ61Ql2vDfATsgjXk+yXh5mPEk 4R1Qz6Bfhj8DjOLftVNC/RHxbEM9UX4ddr2Ftl8D/ito9W3S4Y7kUfp7xW997ZSvI2JQTNbX8IrQ XtVK4F1J8C7yE/VleOBx9p87eINZPXLnBI/YnXd5FhijzeW6/FNQv8dUtRz1b6D+M4sT9XLUH0IM P4FWxwDbb/MnfZeA38acRGXYzlRxA/hicD7I9dv7rBge9icET/Bbd3faAffgDbwWowXRlWNvHaDA 57AtRg7ibTTi9iRAppazNIpvq0EtRdwDBjtsNeAhcwv2jhbsHS3YO1oQt38JeBH7xST0a8E/YvmI 8+tAFeok8BsR569id9iFHrFHgKecdxayyAWLXLDIBT3b0cthwAFIOI62HJfGGmdpFtIB9wGuBywC rGCoJqOeBLgZMMBQj0f9OOrR4OwHJgZwALAV1HbUFXg8ehPvy8ZNmpFrqPu5riagXgDYD+puwF5Q L6C+n6FWA54OixPwJGAtQ9kLeI59Tx3kuhYDzG3wuBjq+WE0MrqbodYaNoP9FvVTwDdZ+jNejwZ1 H+pNqAfAGcN11Q94EnAt49UMcOaD82eA3YC3AI8DHrba8mmBbGfYYUM+BTUDrgVmsmUd1+U1YJoB 14JngvEy4VcDHrFhOcZ2GcaNOY8BXrDr3CrbnMQzDskJwJw0MwguZh6tBqe4G8yjn8A4TMcY1rB1 Mpk9U26xZoStkHi/XBuH+hH0kgC42LyACMajXQp7O8F5EfVVkLDN4oQmzdbMoscpNg9GIGwyYXLh OZchIQawAj3eRj0d/BPAf5k55TX+foD6JmN0E2NehNmJBI+LrTZ6cIK9yN8MIB9eyf5gvsJexFTy DW5VwRhtB+rrIWExqJmY5UnA1JoP8M4IPfdBpjJ+wrOJEduNHmshuRk6/6utA+vZBv3X2yN5E3PN 8M94nLWraHUQs3+E/ZlsYd+7yHj9gKUVJHwLI1CLtosxkqcwkn+Pk3wEZjwJuk3B/B4E/ClgJ6ij wDlgLsM62oiVTlQ9BjzNgNmsFfkGc66xRo/5aQyt+iToeRMRgzF7mVN9F/hehioBfV0F9RRkLoal F3FP0QTJRcBY/daCfxzXZSPffdCIPcJzDXy3fQ/CrR7newfyMfaTr2Jse+Gr56CzC3AyNLmG+mbo s41bkZfCq4F/CPVLgOOBOQjJeagn6GGAXJ8B+FXIbDSWE5yKVhnMI49Awxrc0RSD828tu/QHAbme YI8qy1RouwLwCCRswbp4FfLHsI207mA7pC02vs/eZcU6cC6GRc3gP2dGYF54HHZC2mm02sYzS3K+ gVZhWC9snYtbGXHst0YOYBpD7Vm9F3H+J+x7qG8BPgkwF7AIVnhYvt5urTWsu1Ksjsu8XrQIKwZi dhKg7TZEnk74rQf4ZuCzwZ8OP0+HJ8cAFtvrF3XwR4L/j60Ib77FsRrrpcDqkTEUw6ED1ylKT8Zs soQAc1KU2MKr2457XYjzzL8XEgLQeQow2Vbs5bsYGuf9iHguSOhFZK6DbnXw/GXQ2Yrkf41V+dcY MZafBE1qIW0VbL8BW7bBw69jRp7nkXRhvwhDtKdIRTAMq8x8lqHrPxiGrQJmHM+mAYu0OkSnSZA8 Gb10Ii7twMhcZrzrPJ9VqG0U7lMI6gtg6U5EjBlYiUshYRtgB6hJqLtgxSnUL2N1H4T8b2MNzgGM 4XU65dcYN0QetRVevYG9V46B50/DLOAkoI81H+eRB4xhqL7Id5o0Djy/Zfx8QH5bfx4r6OPE/xXT S5gurpP/syaf47pq45VF65dbaYwRLXxPrVfyvBg+3N3Eot4CuA6wz7rrAdyC82oNIu0aUO+gfp5h 2DHwrAZeAHYBJoJnD6j7AfMYusahngyeK5B8i0+P2ps85toO1Ncz1PMhoQmYi0ylkwBOL4D9kDMe nNEWD+om6kkMKe7xPMZz3WgBdRLqcbwPGnWA5fjO3GpAE/AIQ/Ix1vA1ruvvgjMN8Cww0xlSfGbM v6HVftT/xaLy+ZO0YpjPUHsTMEl/kbT6D4b6p0GNB6wHXMoxx+izbWHMDnyTro6/qaVv0W/Q6Clr 3GDFT7Cbf5afb+g/hz6f51bG29DnU9DkdciR/FzCrALPYcj/T3D6wPMXkFmHNVWH+svgXA+dPwG7 llozBepjwHSBpxhrUMOIWaOaA7gMmM9grzzOu4BxCvzX0G85ZrZA/zVp9Yo1YizHvMlPS/Q1bClF S+Y5iFZhOsv5OGKpm/U3M6BPMcZhA7fSpuhfYG9E73hGZKZC8mSjH75EJxnzDDBnIEEz+GlAOvdl dBj8L1xv4hnFn+C5xJs85sYPmCesg3dzo13/EbWKZ06zBdAFbb8H6OJvdJmf4LqxAE9CTnM97Di3 DcvkulnIfakB7BpjgVnAK1p/GXviOqaGvQj8C5BZqT3LVrAOrgrmNPp4ro2fQkMvNH+F9QzbBasF RuMAt1U/MOYQvM1jYjwPafnYv16G/H+Gnq0s00yBnmXwvY9jfudjbF9ni7RLDPV0+Fg666MdAv7f gf9XbmX+Ffa77wFzHtQOwDXAbAIcx1CtZTlmOvh/ifWYxzL1/6sdJLgPvTzDUH1D/yHBhVzXFFO1 J4wsXonW7GMczkJCJqx+ABISuBfjkHaU5w71KB4frQESfgE/WYX6GUg+DFgMu/ZrFLGNUZDjxUm1 k0eeonQydk+OJHug4RbwuNF2CjD/BX2Efo4wb0H+f0K3T0PnOQy1V5mqL0CrAe5LuwgNX+CzB0mm VuqfdboD1W5jBK4yjzmPR5juIrPYati+E5I3wOq1mNMU7ReEl+wPei2oa0AthD8/Bm/ZYGv+/3g7 H3gdqrXvr7Xumdn3vfa2Q2ybkH8J+U9sjiRJkiRJkiQkRDmo5DiShORIkiRJkpAkSUJ/jiRJEpsk SZJSTkfyL7H3e63vjG3Pec/znHOe5/28n/ms31z7+q1Zs+Za61pzrXXPnhFM24lvfowv4NdBd7AH vahEiPSET8jTjvFkJDgjHJMZK2rhm5PQt4jGOnf2HeSZCdsQ/Uw03wdz3RjlVgzMr8RCS7iileEZ GRlKoHmQY5kj+N9Qwh+D20XuSn2WoAnj9stdbODd4FownTE8tdSxaT85TM3jDnU/13KpQ9uae1A3 9AHIiO2/EdYTvDsaq6X8dO5TqWtcrdL6gtsorQs+3o/6VKfm41xvSYyht9/NaJZJnkHMoQ74E4lY nB16cBYiYTMO3/8bUWhjF0mank723yUO2YQ9+/vvS2mXOfTq+hdyh3Xyw6wvvUaeeonnRH7aE9t6 97j/dPV/Ce+YTjazXDzgzXay95zzDum9bi3oCGtHxcEJYBewKtielaKTrBF1R9PTYcIgzwpzuhVg vZ08G8Ga4BpwMDgWnAFOpsz6HDUZXIxmtsP8mU5jWpFzLriYPG1ZZx5Nzi1hyeSc4NaiE30izSA3 86VW7dA8gJxEHsUvI8+hGRNeUVhzjqoJHnEr3lLOHK5rDjV0//mwhWNf56hnOe/PoWVgZzs0rcjf Anwsqrl7yr43pTWNSnMy/zOi53L2PPLsD/NggU3o7+Ast1LOCOqMVc35aD4BP0BzGTgIzXzkFSBr ifpJsA6ledR5IfJ36I8gP4x+F0dVQqZFNK1gkA39RA8kfyk0+dTzMzTXwJZFznK/Q6mXaa9+4DLY 52Dv4dhrwayoX/UXbIncEWwGdgB7cpaXkS8B24LUQSuwL3WuQc5scD96ftHQN4b5ke+jPrSj+gh8 C9wYInloa2lHh+9wbFjnN8O6heUgdwWbU6YCb0EzLewnIN4kfcCxV3FsDhr6oZ4Chva5H+zEuZqE q7JRH3NH1eHXvSC8LrAF7CnYMP914Cvg1NA+YV8i549O9gJn7cSTyL4r04R1TtA6O/FurtGw/myq 0ToTKGcgffgIfX4/OATsje98CXr4Ql3kRuAMjh0LjiB/PnmSebn4oMM95MxE3wVNC4figxWQK+Ap bfDTNpzL4RryV+TYCyl5GvK56JtSzqPoW6Nf4zTirQ6rcY0DwtEP9jeOas9RbcHfaLVq6C/mqBsi 1pX5IkcNRK6MPJk806h5K46qChannEPIF5FzBeU0AqvQOoNcnrTpTg6OOpt7px36eEriKNe7ymHA ar+3gxFpNCWv51rwX7WdnN2dxdRd4DI0X4H8aqAXggsYeT6mTbtzFX3JYygzn9JewD6MNiYT9kj+ PO4U82hZd+xG5JrutwYpx2E25TcmP/XXN1HbIchbwtE+HOfDUT26F7g3JxRD7gW7zrdudYJ75ca0 zWKN6uBa8FlwELgePOkw+M5hYrVDL9T/hvyYw7SPyfNn9O+CVcF3wHLkfBn5UXIOAxs5THrI58FS vn8X59oGvgeOoIRbkB9GPgesBAYOza3gbWgozYynNOrmpXHsGhBNYjeYQ06u0YwkZxX0Ezi2PZpi aGqh+QBsieYrcB+4k5yZyOPAVykT1tQEV4B7yGnADKwXWmYzuIpjv4HV4Gn088G3wT+B+2FT5Mfm hrN7TyNj58RN5FyITFt4W5A3IBcH3yDP18i/0xYJ8lyD/nr09SjzR+Si5FHI28n5IBi2Tg9yovFu BkNr9+NK+6MZQsldkbF/4nEwHzyMfjryQUo7jqYimhrgERAbmvCMXFFQBz35E2GPbce5aBHvSvLQ l4I3qQ89zW8O0l5e2Mr3gtNA6uD1obRf0LyC/CV4AvyMOtAHEj+Qfwxy2JpcqX8Z+nvAZ9Bg4TQs 7F9HrUrCdkbGL7wXyTMZDd4RNAUvpmTqn9bFYXIs5dC+Pvb0/o7cl7rh6YmtaJZRwrkg/u7Rl3yf nGGdaTt/AfK1yBa5FPnfR36I/LSLNxTNT8gN0E/kqENg6MXhiHE7mhDpFQl6ReIBjqI3Juix3lNo rgL/gKYuOJA8od2y0VyC5i8gfTURjkXYzfsEzVEQH/HxxIArCvDHIJ2cS2GngPS0AP/yXgDD0npS Tmvky5GpZyKseUeQEry2YBM0c0HGk0R39KGmNshVJGijdFo2RX9IYxRKMT6kteKoGQ4to26yGjXM BcOxImwdSvAuAu+nZKyXpK+mYZ+0cBwLrUR9/LDHfgRyLzD0DfMW5fwV/Q3kxEN9PNcLfYTxzSuL HPbtRdQKD028DhuOJPSuAMuYPNg70FfmqLD/h2NLkjyfOlS93T1L9fOWuJgQfRc3uxecB7YEV8pR 37q5sN8Z/NChWcjs+C8OvSEOAzSegm0CWw7Nt+75Jb8z+KHDtHJhCU6WUctpwnJ46snbDXsAfJKS KdPT4Cz0TanJFM7yJfor0DwGXo1mBcdeQh7kxDHYF9BnorkPmWMTJxym9SFPX/Aa2CSl3QL+lbNX gv0IvBv9s2AWeD15plHmI2jeRr4QPB/NHcjvgkfBT8GXOLYqee4Ez+EsvcB5aGgF8zX5J4Hb0XDV xiNPdfQ/gT7YFhwEm41cnqvLALuBFvZPsFjep6V86uaRxysDok98gdw2bH3XdjJWDHAWc2iaoCkH LiV/MfLXdmibOn1yn5OTtG+wCHYwmv20Ba0Z0JfSKEd6+wB3LJqp5Kc3eocpvyK1bY3mO/A6Sggt gMZ0Qf6AnDOQD6LHht4q5M8c6sk8wfJ3F+kleoJbeUZlOXHj00SADzj00JgM2Ctgqzv0Qwxz/gh7 FHyeo8hvioAL0bfmLLMo4Xv016F5BrwRzVqOvYo8yMbAvoq+DPqHkDnWeNRhMHmGgjfBloDtB37C 2WvDbgP/hH4BWAm8lTxzKP9JNB8hNwAvQjME+WNkjfwl+DrH1kd/H3geZ7kbXIoGC6ufyD8D3IuG q1ZFyXMx+uNgMbAzOAK2CnINri4b7AtmwY6DxfIJ2iVB3Qx5ZO7jEL3+Djks+R2wHJqmDpO0UXAI pAW9FbAj0RzG2rSXR0/wZ8PSc0wepdXi7B3R/ALeQv7witDILLUb6xUu5zzkE+ixifkQ+Stwmeul Xg+ewhoELmcWVgP5FKs3R5BzmYvtRbOYvs17Qr124VEO/YVoqqBpE66MoRnp5lweT38lskBWpRK5 IUtpq9HPATPQtAKbgrNY++rG2dvyLFZ9ZpctOG81jhpOzqnMs6iJroRmH2wFjrornPnmt3NndHLQ Irwi9Lz1xON9IO47hW72ioZnUzXPlCY6UtoPecMlz3yHieUOZV4/3D3lxWrDFEoYxVUvoQSeSvU2 hfUn536O/RvsJWBOaFVaczxnachZ9pH/aq73CurwHjm7hJYMc4LToxLctYRvNVlGi28O1yjCo5hZ s0bh9Qfb5edQW9dPOpHnZ3oOK4pqWLjCEFmsG5Ys4cbh6FrmsBLl1vTuBdc5lFqVd/cX8Eb3XG4i g7WCE3ljWJ0YQ50d2ydaQ8ilH07DU9w1VsjbwPi2gfnyGDRzsPMGfHyD643uKW7x/VxwDrbKZYbu Vie6Uk5D2Pa0xcz8Y6xOzGFt0Onrkj87KsFZaW501AZstYH1nEHYkPVM8m939TEDsMAeLFY2XOdE rgqGb5rpyvVmo9lJHRiLpP+4sywKS4Ytjv03Ii9ljaIDHsrT73pG6Beu/iZ8N0012A7kfx+cTy/i zbd6RJg/XO9F7oN+O/7SzLWmt9KxfjOOCsIeSK3a0Na87SZhoj7Tjdp2Y83ncYl+GTGSFVzOoBPI s5d+ibDvOUzjuvyToeXxtUaRhw6ibsNdHEWtMvOepGXDNeo5rk+yKnKA/ANor2nYf3XY33gmP1zl ruDeJSSRaJjTnb2LaSKa8qFN8oty33R1WIs1nkNuF66lg8vBQbB7+G+C8uSZQissBNfznDkjlW7E /yBwRuk5k5wv0yKHwJPou4csz64fpCY+murgFyA+q14Mn2VF5g3LGtvqc8G/o+edwPpBkBHShGUW De1Jnl1RCe75h3CMqgxLnb2LkN/gKo6Rkx4VvWe5Mchbm/NXIjO25DMKhe+DNs3C8ROsCPsRSK/L /9phXptIljqoVWiorXqMcmgRdRr5KWTuBfk3g4zzeYyH+fQlRb89/TPyNeiPouGM7t0kKnqjtPkG ZMw3H6N/B/kWZN7NlVgf2dk9ecXYlcgHu9JL05AfJw8jZz4tkvcDJaxyR+Vxj9N3UvIQ8r8NjgXx 8cRLYBNszmiQ2B3VTUrw6DPelyC+4H+LPJAz7gC5dySORFZyluQtYnmLKOdK2GupVWjP+hzFfVlG TyfzPmwZ00+635joz9X47wlsJWN3aM/y9K71LlICFzk0pcDrwQl8hZB7qwpHCfq5v8O9ncqntl5J 6oOVvIfAX0DGKI++5DWIejvP8XKuLyh/Kl8e/NjVxCTQjAJnc6VvUrLJP+xmK1zRzAinMaY59CI7 nOTaT+IpJ/mvkJPEACeJw9dzlDtvHjWpyXUpNQ6vGYevjcMXxuGh4/C1cZSJzH2wNbV6jit6mrqF 8cl7IOOqOU59vocNY4lhUW9xvW4r1qMdE7cjfxL1HNc3biT/ZvT0ebn3OCTmycNP84iLTvPO9dP0 0tP46WnuNaepT14FyuwF4kEGP03guQk83YTe0QEMf0f7IyxeZvCyRHjHYURKMDJ4r4CMYD5X7V3K GQeBzTn258jvTnLvWE/7rnd+QTtORW4S2V/a/RSRZB5xYB7nyi+DDZX0sZXiWV6v+wcPUGXuGHz7 nSqn7+09B6suA24bepfq697QqFS+e/9MEZVUxVRJVUZKrKQuFHWtAjZdZaqUKi5/Z6nz1PmqMv8h VruAT8jxvqrqenSnjle7/wRz2gxpkXR1rgpUKVVWVVBVVHVl1EWqDmwRVVRyuO/eZKvSqpyMhheo GlJSTVVX1etVf0gvXQ2sDzYDW/fqNXCQ7gB2BSeAU3sP6HeHngXOAxeDy8DVve+6e6BeC24AN4Pb +wy+rZfeBe4HD4EnB9x1z0DjgRYsCmYNuLvXAFNWxMGmElgNrA02vNvlaQq2BNuCHQc57Ar2APuA AwZL3czgIQN7DTLDwNHgRHDakPuG9DWzwXlDXf5F4DJwNbhWjO/eFOyr4N+QXH9wcUiWtPB50h7l pJ3Pl1apKK1dWdrmAmm/C6XlqksrXCStUEvat07syLOSkVYtUWjvvrD2z7Ql/ym63pLu/gP8X0hn vgj1f+OZL1b8MzTSs875b/Yyj/0vsDRnTxM/SP1LSUufPoNGvKPYf7lvqu5VI9VYNUnGwVlqnlqs lst9dZ3apLar3RLz/KyOqTwd6Eydpcvrqrq2bqSb69a6k56qZ+q5epFeplfrtXqjztW79D59UB/R p0x909S0NNJzzCgz08w1i8wys9qsNRtNrtklc7VAK2YvjO3mZLhPhu/d0zaI9hnRfli03xTui8wL 95nFo/2gcF+sLX1JF+sQ/T002k+O9oui/fpovy/cF1fRvmxYj+I50X5kpJ8U7ReGLVt8nfBa6VLN o3175WrslepRanCpsaVm8Fe57PrZbbJ7ZA/LnpI9L3t19pbsH0ub0mVLNyzdvnTP0sNKTy49v/Q7 pbeXPlTGlqlQJqdMhzJ9y4wuM7PMijLhG731ebPD0s+bF+1XRvv94b5sNufR5TaHf5evGu2jWtVq E+1PhPs6g6P9bIeyX8Lx2XWW19lQZ0+dE3WL161Wt0XdrnXvrTuh7uy6K+puqftD3bx6WfVq12tT r2e9kfVm1Ftcb229HeFZ6y8LS6u/k79L1D/cwDao0CCnQfsGfRqMaDC1wcIGaxrsaHCoYdCwfMOG Dds17NlweMPJDeeHR188NTy6UVX+Tm/Uv9HoRjMaLWm0rtGuRocbJxuXb9ywcVu5K4sdcrqH9sgZ HtY7Z1q0nxnt54Rl5cyP9uukZ7v99nDfpG+4b5pV6D2b1SizLt/NaefiTv26fl0Zr4fMTt27QIua E+aEuEieyXOrGYlSyvh9/WHK80f6I1VJf7Y/R2X5L/ovqdL+An+BKuu/4r+qyvnL/TWqQlAyyFa1 ktcmr1P1kp2TnVXD5K/JX9XFqU6pG1Sj1I2pG93bBPz+MvYV1ZVMw0Rrr4uMeE1VS9VWdVRdVU/V Xw1Ww3m/7GQ1XWaH8yUGLuyX+9RBdUSd0p7O8HaphLfF2+p9xT7X281+m/c1++3eHtlvFekb9lu9 vexzvW/Zb/P2sd/ufSfXv1Wiv4RwW7zv2W/1fmCf6x1gv837kf127yfJnesdlL+2Se6/sd/q/cw+ 1/s7+23eIfbbJV40sj8sf22X3L+y3+odYZ/rHWW/zTvGfrt3XHJv/weL9FWDJMYf9W9Z5ARXvsX7 LbLMycgyv0eWORVZ5rScZ4uXF9knP7SLTOGwi69Du7jvbjiL+InQIr4XWsT3Q4v4QWgRmV2IRfxk aBE/FVpE5qxYxE8PLeJnhBbxiziL+JmhRfxzQov4RUOL+MVCi/jFQ4v45/4Li/yzsbuQRfwSoUX8 kqFF/KzQIn6p0CJ+dmgRv7SziF8mtIh/Xthj/LKRZcpFlikfWeZ812P8CpF9Kkb2qRTZpXJklyqR RS6ILFI1ssiFkUWqRRapjkVqRBa5KLJIzcgitSKL1I4sUuc/sMhatVHlyixgn/pR5s4ntdHWrxtZ pF5kkfqRRRpEFmkYWeRiLNIoskjjyCI5kUWaRBZpGlnkD1ikWWSRSyKLNI96zKWRZVpElrmMHtMy ss/lkX1aRfa5IrLL1e5K/daRXa6M7NImsstVkV3ahnb5jy1ysMAi7SKLXBNZpH1kkWsji3SILHId FukYWeT6yCKdIovcEFmkc2SRG7FIl8giN0UW6RpZ5ObIIt0ii9yCRbpHFrk1skiPyCK3RT2mZ2SZ XvSY3pFlbo8s0yeyzB2hZdzo7+rtxn49hXee3uVe/CH3gbISU9YVe7VS7VWXVC8Z3fv59yWyUr0j qVTqdqRhousTSaVSd4h0J/n6RlKpVD8kl69/JJXi/YVVJErNkfZopzqrHjKqD5VYa3zqzoIzDSg4 08CCM91VcKa7C840qOBMfyw40+AzZ0r9SaSBfj/RjYikUqk/I90pupGR9N/VaEhBjYYW1Oieghrd W1Cj+wpqNKygRvcX1Gh4QY0eKKjRqIIaPVhQo9EFNZKxVSLK2nKnLeO+SGsqm8q8jzCpdOp37u/t eDN5HTvXvmjn2ZfsfLvALrQv20X2FbvYvmqX2NfsUvu6XWbfsMvtm3aFfcuutKvsavu2fce+a9+z f7Vr7Pt2rf3ArrMf2vX2I7vBfmw32k/sJvup3Ww/s1v4UkJNc5PUY7wZz3fg26iK9mE7wT5ln7Ez 7bN2ln3OPm9n24fsGDvWjrPj7SP2UTvR/sVOso/ZyfZxO8U+YafaJ+00O90+bWfYOfYFru8iXUu6 3i/6uMi/mXPcu1R1Uj1ov7faGpuwnvVtYNNs0qastek2wxaxmfYcW9QWs8XtubaELWmzbCmbbUvb MraqvdBWszVsPdvINrXn2fK2kr3AXmzL2j/ZKvYiW9nWtNVtbVvH1rW1bAPb0Na3ObaJbWzL2f72 AVvB/sGeb6+2N9h+9lLbwl5im9vLbSvbxl5lb7I32272Fnur7WV72z72DjvA3mWH2KH2z3ak7Wyb 2ctsS3uFbW2vtO3stfYa2952sNfZjvZ628neaLvYrra77WFvsz3t7bavvdsOsn+0g+099l473I6y D9rRdpi9z95vR9g7bUXlvseeYr5SRV2iNOPVeTJSPS5zvkXqVdGulK2a3NFyZd63R7YctVe2JjJu 7RO//V62P6gDsjVTP8l2icxVjqnm6oT6TV2qfpftMnVatpZ8I/hyuRN6qpXMZQJ1hU7qlGqt03W6 aqOL6CLqKn2OPke11cV0MXW1Plefq9rpkrqkukaX0qVUe11al1bX6vP0eaqDLqfLqev0+fp81VFX 1BXV9bqyrqw66Qv0BeoGfaG+UHXW1XV1daOeoCeoLnzL5yY9XU9XXfUMPUPdLDOnmaqbnqVnqVv0 bD1bdXdfWVa3ynxqruqh5+l56jY9X89XPd1X2FUvmWUtUr31Yr1Y3a6X6CWqj16ql6o7ZO61TPXV y/Vy1U+/pd9S/fUqvUrdqd/Wb6sB+l39rhqo/6r/KiPe+/p9dbf+QH+gBukP9Yfqj/oj/ZEarD/W H6sh+hP9iRqqP9Wfqnv0Z/ozda/eqreq+/R2vV0N0zv0DnW/3ql3quH6K/2V+pP+Wn+tRuhv9Dfq z/pb/a0a6dXyaqkHUttS2+RuE3rs/9Yr/zuPDz22qxknHvuIeQSPbasqiXc633ReeNZvx4gfO2+d 8A/+6ry1kK9G/u2+DeLJmNRASi5qzlWBKWkuUtZMNBNVRfcdJzX6f+i5lcVTq4j/XhB5cHXx1pri qbXw1Xriq/XFWxuJL+eItzYR766IfzvPTv2D94a+2yry3v//vntDId9tpW4R3+2nHhTffUS2hhKd P68ulvh8iWqs3pItR22TrYn6Rram6lvZ/qC+k62Z+kG2SyQq+1G89qBsl6rjsrVQJ2W7TJ2SraXK U/niuwmdEK/1tS9em6bT1JVaGkF8N0NniO9m6kzx3aK6qPiu+2pVO11ClxDfzdJZ4rvZOlt8t4wu I75bVpcV3y2vy4vvVtAVxHcr6Uriu1V0FfHdqrqq+G41XU18t4auIb77qH5UfPcp/ZT47tP6afHd Z/Qz4rvP6mfFd5/Tz4nvPq+fF999Ad99Sb8kXrtALxCvfVm/LF77in5FvPZV/ap47Wv6NfFaN9fs q9/Qb4jXvqnfFK9dqVeK167Wq8Vr39HviNe+p98Tr12j14jXrtVrxWvX6XXitev1evHaDXqDeO1G vVG8dpPeJF67WW8Wr92it4jX5upc8drP9efitV/oL8Rrv9Rfitfu1rvFa/foPeK1e/VeNVLv0/vU A15tr7Yalfpd7rgPhvdetYp7b3G+jeDmy5Wi9dp63J1Xud997Fd2P+ttWp2ryrKeVEZZu9Xm2m12 u/3c7rBf2J32S7vrH/Okvk/9kDqQ+jH1U+pg6m+pn1N/Tx36xzys0ZVUWaoU66/hmqDkkWMP/aty Ur+kThbk+SV1OPVr6kjqaOpY6njqROo34f7dc/0b5UT1Cb83kVRpqqiU4VaYa4sfNE2dFgtepdql 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 b6/f5oiqJgfbXTQ4LTN76ur97zCX19nHGlwkF2SdpD0SGvzq1iwVQrnLjTA2vWD7T22yHAjuiy49 IuDlOGHC+qnsTiObMyvV0t6/SdolZDmxp+bYitPcVpu/HOdmdFFUgu32pBnWb34pUmG3LnJnmXry PpG09syYzOyg2JQ7cqu+d9VPx+kdi+3p8vnrG6YYbpSs6RH77XnUTq49XXmeWVXNgz3XL0/2wxQZ 0w4PuRRGduTpmMjn8KBqJ9yjF8za7fN7anv4zerzHZob2m29/bPUW9qkrkQ71W+4803L5POBJ9W9 jgmChTEV6vM2VuSwMFWChSn+6CMuOgubBEwT4ajc/rdFAb/OSHCMySWEOOeQ5P+RWUHBLx87QqVP gBfdDOgEXZ/BIHQX/cOInC7VoINNWPChru6pDV+G5Az5Jx/MftJrcqzsrzgb3xzVbYetOfbmtcx7 0X2f7pXwyko1XneZKegbZPpQ+OXVvbvzjD/eyI/Jzko2PzIQZxXcW78AYa7c+iRze8RQ46vNqfX2 m23jkn5fWlx07bPhLHkB3yPta9cqsK/KFPovCosRE1ssv5T3jGlileGyvtNc3B0vahjS/fjq2p6g XbySBbvF1e5SU8QPPM7p25R6s19Y8P3VdWK0a2rqj3rnsyp01s9Z/+E3nmudF33mP2ie6vZ+Yv7z SSLdu9S+LvdwNG9SxH2FekOU13PdXNS2rylDIGyAx87ER5j6vKqfOzFbwUZP6TWmRJQ5289IChVu ze6bMbW986rMrq2OwiyvXJaW5AQL5H8AnAHPTA0KZW5kc3RyZWFtDQplbmRvYmoNCjQxIDAgb2Jq DQpbIDNbIDI1MCAzODldICA2OFsgNTAwXSAgNzBbIDQ0NCA1MDAgNDQ0IDMzM10gIDc1WyA1NTYg Mjc4XSAgODBbIDc3OCA1NTYgNTAwIDUwMF0gIDg1WyAzODkgMzg5IDI3OF0gIDkwWyA2NjddICAx ODJbIDMzM10gXSANCmVuZG9iag0KNDIgMCBvYmoNCjw8L1R5cGUvWFJlZi9TaXplIDQyL1dbIDEg NCAyXSAvUm9vdCAxIDAgUi9JbmZvIDE5IDAgUi9JRFs8REZFQ0QyRDlDRjBBQkE0RDlBMUYwOTI5 RDgwMkU3REI+PERGRUNEMkQ5Q0YwQUJBNEQ5QTFGMDkyOUQ4MDJFN0RCPl0gL0ZpbHRlci9GbGF0 ZURlY29kZS9MZW5ndGggMTUwPj4NCnN0cmVhbQ0KeJw1zs0NAWEQxvF5166PtYjER9TgjISL+Eg2 qwKduGhAGRJNCHcFKEABDuLqsN59/sxhfpnMZGbMfOS587ltVrCHi3Av0dmKbiJ6EVxF/yxGNzEO YSomM7GYwx3eYnmEp1h9zAJ/dmAJNKAOv17TT64f/8pBACUIoQURlKECVahB7HemBz2RnkQWi82u wGVDsy8ynhVxDQplbmRzdHJlYW0NCmVuZG9iag0KeHJlZg0KMCA0Mw0KMDAwMDAwMDAyMCA2NTUz NSBmDQowMDAwMDAwMDE3IDAwMDAwIG4NCjAwMDAwMDAxMjUgMDAwMDAgbg0KMDAwMDAwMDE4OCAw MDAwMCBuDQowMDAwMDAwNDk2IDAwMDAwIG4NCjAwMDAwMDUyMDkgMDAwMDAgbg0KMDAwMDAwNTM4 OCAwMDAwMCBuDQowMDAwMDA1NjM3IDAwMDAwIG4NCjAwMDAwMDU4MjEgMDAwMDAgbg0KMDAwMDAw NjA3NCAwMDAwMCBuDQowMDAwMDEzNzY4IDAwMDAwIG4NCjAwMDAwMTM4MjggMDAwMDAgbg0KMDAw MDAxMzg4MiAwMDAwMCBuDQowMDAwMDE0MTM5IDAwMDAwIG4NCjAwMDAwMTY5NjAgMDAwMDAgbg0K MDAwMDAxNzEwOCAwMDAwMCBuDQowMDAwMDE3MTM4IDAwMDAwIG4NCjAwMDAwMTczMTQgMDAwMDAg bg0KMDAwMDAxNzM4OCAwMDAwMCBuDQowMDAwMDE3NjU5IDAwMDAwIG4NCjAwMDAwMDAwMjEgNjU1 MzUgZg0KMDAwMDAwMDAyMiA2NTUzNSBmDQowMDAwMDAwMDIzIDY1NTM1IGYNCjAwMDAwMDAwMjQg NjU1MzUgZg0KMDAwMDAwMDAyNSA2NTUzNSBmDQowMDAwMDAwMDI2IDY1NTM1IGYNCjAwMDAwMDAw MjcgNjU1MzUgZg0KMDAwMDAwMDAyOCA2NTUzNSBmDQowMDAwMDAwMDI5IDY1NTM1IGYNCjAwMDAw MDAwMzAgNjU1MzUgZg0KMDAwMDAwMDAzMSA2NTUzNSBmDQowMDAwMDAwMDMyIDY1NTM1IGYNCjAw MDAwMDAwMzMgNjU1MzUgZg0KMDAwMDAwMDAzNCA2NTUzNSBmDQowMDAwMDAwMDM1IDY1NTM1IGYN CjAwMDAwMDAwMzYgNjU1MzUgZg0KMDAwMDAwMDAwMCA2NTUzNSBmDQowMDAwMDE4NTcwIDAwMDAw IG4NCjAwMDAwMTg1OTcgMDAwMDAgbg0KMDAwMDAxODk1NCAwMDAwMCBuDQowMDAwMDE5MzIwIDAw MDAwIG4NCjAwMDAwODQ1MjMgMDAwMDAgbg0KMDAwMDA4NDY2NiAwMDAwMCBuDQp0cmFpbGVyDQo8 PC9TaXplIDQzL1Jvb3QgMSAwIFIvSW5mbyAxOSAwIFIvSURbPERGRUNEMkQ5Q0YwQUJBNEQ5QTFG MDkyOUQ4MDJFN0RCPjxERkVDRDJEOUNGMEFCQTREOUExRjA5MjlEODAyRTdEQj5dID4+DQpzdGFy dHhyZWYNCjg1MDE3DQolJUVPRg0KeHJlZg0KMCAwDQp0cmFpbGVyDQo8PC9TaXplIDQzL1Jvb3Qg MSAwIFIvSW5mbyAxOSAwIFIvSURbPERGRUNEMkQ5Q0YwQUJBNEQ5QTFGMDkyOUQ4MDJFN0RCPjxE RkVDRDJEOUNGMEFCQTREOUExRjA5MjlEODAyRTdEQj5dIC9QcmV2IDg1MDE3L1hSZWZTdG0gODQ2 NjY+Pg0Kc3RhcnR4cmVmDQo4NjAzNA0KJSVFT0Y= --===============1929421832==-- From bounce@e-siuntimai.lt Sun Feb 28 16:01:57 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: * X-Spam-Status: No, score=1.7 required=5.0 tests=DATE_IN_PAST_06_12, HTML_IMAGE_RATIO_08,HTML_MESSAGE autolearn=no version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay3.corp.sgi.com [198.149.34.15]) by oss.sgi.com (Postfix) with ESMTP id 21F657C8C for ; Sun, 28 Feb 2016 16:01:57 -0600 (CST) Received: from cuda.sgi.com (cuda1.sgi.com [192.48.157.11]) by relay3.corp.sgi.com (Postfix) with ESMTP id 96CD8AC002 for ; Sun, 28 Feb 2016 14:01:53 -0800 (PST) X-ASG-Debug-ID: 1456696909-04bdf002ed7d5b0001-NocioJ Received: from server.e-siuntimai.lt (server.e-siuntimai.lt [92.61.36.66]) by cuda.sgi.com with ESMTP id NSO8FTtOCJNkaJhI (version=TLSv1 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Sun, 28 Feb 2016 14:01:51 -0800 (PST) X-Barracuda-Envelope-From: bounce@e-siuntimai.lt X-Barracuda-Apparent-Source-IP: 92.61.36.66 Received: from www.e-siuntimai.lt (e-siuntimai.lt [31.193.197.153]) by server.e-siuntimai.lt (Postfix) with ESMTPA id DC0F5CC4D36 for ; Sun, 28 Feb 2016 23:45:25 +0200 (EET) To: xfs@oss.sgi.com Subject: Find out about the unexpected arrival of the vehicle Message-ID: <3a52a6f40ea145b53c97f3250d0d7061@www.e-siuntimai.lt> X-ASG-Orig-Subj: Find out about the unexpected arrival of the vehicle Date: Sun, 28 Feb 2016 13:25:46 +0200 From: "info@videoanalitika.lt" Reply-To: info@videoanalitika.lt MIME-Version: 1.0 X-Mailer-LID: 123 List-Unsubscribe: X-Mailer-RecptId: 4918628 X-Mailer-SID: 1733 X-Mailer-Sent-By: 20 Content-Type: multipart/alternative; charset="UTF-8"; boundary="b1_ea9cafa744d1b6863ec67e850db1830b" Content-Transfer-Encoding: 8bit X-Barracuda-Connect: server.e-siuntimai.lt[92.61.36.66] X-Barracuda-Start-Time: 1456696910 X-Barracuda-Encrypted: DHE-RSA-AES256-SHA X-Barracuda-URL: https://192.48.157.11:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-BRTS-Status: 1 X-Barracuda-Spam-Score: 1.92 X-Barracuda-Spam-Status: No, SCORE=1.92 using per-user scores of TAG_LEVEL=1000.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.7 tests=BSF_SC7_SA_HREF_WWW_MISMATCH, DATE_IN_PAST_06_12, DATE_IN_PAST_06_12_2, HTML_IMAGE_RATIO_08, HTML_MESSAGE X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.3.27425 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 0.80 BSF_SC7_SA_HREF_WWW_MISMATCH BODY: Custom Phishing Mismatch 0.01 DATE_IN_PAST_06_12 Date: is 6 to 12 hours before Received: date 0.00 HTML_IMAGE_RATIO_08 BODY: HTML has a low ratio of text to image area 0.00 HTML_MESSAGE BODY: HTML included in message 1.10 DATE_IN_PAST_06_12_2 DATE_IN_PAST_06_12_2 --b1_ea9cafa744d1b6863ec67e850db1830b Content-Type: text/plain; format=flowed; charset="UTF-8" Content-Transfer-Encoding: 8bit Your e-mail program can not read this letter. In order to view it within your browser, click here: http://www.e-siuntimai.lt/display.php?M=4918628&C=2c386061808fbc93095951ba9c04cc63&S=1733&L=123&N=1360 If you do not want to receive our newsletter, click here:http://www.e-siuntimai.lt/unsubscribe.php?M=4918628&C=2c386061808fbc93095951ba9c04cc63&L=123&N=1733 --b1_ea9cafa744d1b6863ec67e850db1830b Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: 8bit

    Having trouble reading this email? View it in your browser.

    Find out about the unexpected arrival of the vehicle !!!

    www.videoanalitika.lt
    Hello, 

    Do you ever wondered how you can effectively use your video surveillance system in search of "uninvited guests", "unpaid client", "person damaged the vehicle or simply to get information about the guest arriving in real time? Or maybe your company needs the number recognition systems? Or maybe you have some thoughts that no one has not realized due to high prices and expensive solutions?

    pranesimas_en.jpg

    If you are relevant to these issues, we suggest that you familiarize yourself with the automatic number plate recognition system capabilities by visiting our website - www.videoanalitika.lt or ask a question by email.

    This message was intended for 'xfs@oss.sgi.com' You have received this message because you are subscribed to 'Anglu_01_15'

    Unsubscribe | To contact us please email youremail@emailaddress.com


    --b1_ea9cafa744d1b6863ec67e850db1830b-- From agruenba@redhat.com Sun Feb 28 16:12:00 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=ham version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay3.corp.sgi.com [198.149.34.15]) by oss.sgi.com (Postfix) with ESMTP id EF8A17C8C for ; Sun, 28 Feb 2016 16:11:59 -0600 (CST) Received: from cuda.sgi.com (cuda2.sgi.com [192.48.176.25]) by relay3.corp.sgi.com (Postfix) with ESMTP id 535CFAC004 for ; Sun, 28 Feb 2016 14:11:59 -0800 (PST) X-ASG-Debug-ID: 1456697517-04cbb00b7280a60001-NocioJ Received: from mail-vk0-f53.google.com (mail-vk0-f53.google.com [209.85.213.53]) by cuda.sgi.com with ESMTP id N2f0Og2tpvAcIrgd (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128 verify=NO) for ; Sun, 28 Feb 2016 14:11:57 -0800 (PST) X-Barracuda-Envelope-From: agruenba@redhat.com X-Barracuda-Apparent-Source-IP: 209.85.213.53 Received: by mail-vk0-f53.google.com with SMTP id c3so118100919vkb.3 for ; Sun, 28 Feb 2016 14:11:57 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:date :message-id:subject:from:to:cc; bh=Dn85svhKqcJ9QsghjnxRbSkpkqOE6F6Vjie+CTzhZMI=; b=OxOirv3B5ENF3zWV5b6kAMd0xEtBoY4lMQUweKYq4cBOumfpqkcT91yz4bNSWjnp+U 8s1lw/hAbNFLtpxzmHcWDuSi/Peuloc+3rZ56/zaDVfLdCO/NkrDveTx8RfWLn856mJ+ bGKFDjCG/Soxqq3+8lauIIInm3DHBjFPHPCnAT1jVHQQQh19RMfy2t1LQyTQAcyLAjTJ PMfVs3BR9F61dD0ts8eQb2M0kZJfq2EgrkEjSgeSD6JwcrpnnE38MjgXcoeQ7ZYp30G8 QkNzW5j/z8WY/H583kbtiAJve1E6mx1qxYGOAtZh7UyTDrggrGxVA5B/mJWAjwAcqrDw N+Ig== X-Gm-Message-State: AD7BkJIY/fZqyCDOoYltCNClNAs+PuclLz9yv193MTPpRDwQKPcM6vARpjvepw88vKSSq7BMJnphtFulmZVo6T5S MIME-Version: 1.0 X-Received: by 10.31.162.20 with SMTP id l20mr7953435vke.137.1456697517383; Sun, 28 Feb 2016 14:11:57 -0800 (PST) Received: by 10.176.64.130 with HTTP; Sun, 28 Feb 2016 14:11:57 -0800 (PST) In-Reply-To: <56CC3174.2060207@gmail.com> References: <56B770B6.7040803@gmail.com> <56B77262.7090107@gmail.com> <56C0F23C.7030902@gmail.com> <56CA2EEB.9080504@gmail.com> <56CC3174.2060207@gmail.com> Date: Sun, 28 Feb 2016 23:11:57 +0100 Message-ID: Subject: Re: richacl(7) man page review comments From: Andreas Gruenbacher X-ASG-Orig-Subj: Re: richacl(7) man page review comments To: "Michael Kerrisk (man-pages)" Cc: "J. Bruce Fields" , linux-ext4 , XFS Developers , lkml , linux-fsdevel , Linux NFS Mailing List , linux-cifs@vger.kernel.org, Linux API , Dave Chinner , Christoph Hellwig , Anna Schumaker , Trond Myklebust , Jeff Layton , Andreas Dilger Content-Type: text/plain; charset=UTF-8 X-Barracuda-Connect: mail-vk0-f53.google.com[209.85.213.53] X-Barracuda-Start-Time: 1456697517 X-Barracuda-Encrypted: ECDHE-RSA-AES128-GCM-SHA256 X-Barracuda-URL: https://192.48.176.25:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-BRTS-Status: 1 X-Barracuda-Spam-Score: 0.00 X-Barracuda-Spam-Status: No, SCORE=0.00 using per-user scores of TAG_LEVEL=1000.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.7 tests=BSF_SC0_MISMATCH_TO X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.3.27425 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 0.00 BSF_SC0_MISMATCH_TO Envelope rcpt doesn't match header On Tue, Feb 23, 2016 at 11:16 AM, Michael Kerrisk (man-pages) wrote: > On 02/22/2016 03:46 PM, Andreas Gruenbacher wrote: >> On Sun, Feb 21, 2016 at 10:40 PM, Michael Kerrisk (man-pages) wrote: >>> I've once more pulled from the latest git; here's some more comments. >> >> thanks again. I've updated the repo with your changes. > > Thanks! > > [...] > >>> I'm going to play the broken record :-) >>> >>> Could we start with just a few simple examples already, and build up >>> over future iterations of this page? >> >> Yes, as soon as I'll get to it :) > > Sure. But, to press the point home, I'm interested to do further > review, but I feel like the lack of examples is limiting my ability to > understand what's going on and deepen the feedback that I provide in > future iterations. So, start please, even if only starting small :-). I've added a richaclex(7) examples man page now. What did I miss to explain? Thanks, Andreas From david@fromorbit.com Sun Feb 28 22:58:48 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=ham version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay3.corp.sgi.com [198.149.34.15]) by oss.sgi.com (Postfix) with ESMTP id 637407C8C for ; Sun, 28 Feb 2016 22:58:48 -0600 (CST) Received: from cuda.sgi.com (cuda3.sgi.com [192.48.176.15]) by relay3.corp.sgi.com (Postfix) with ESMTP id BD481AC002 for ; Sun, 28 Feb 2016 20:58:47 -0800 (PST) X-ASG-Debug-ID: 1456721923-04cb6c583373fe0001-NocioJ Received: from ipmail04.adl6.internode.on.net (ipmail04.adl6.internode.on.net [150.101.137.141]) by cuda.sgi.com with ESMTP id mF3ZDKVeddLRwdkm for ; Sun, 28 Feb 2016 20:58:44 -0800 (PST) X-Barracuda-Envelope-From: david@fromorbit.com X-Barracuda-Apparent-Source-IP: 150.101.137.141 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: A2D9DwD3ztNWOT0ILHleKAECgw8iMG2GZKAGAgoMAQEBAQEBBoEPimaFR4QHFwKFdASBKE0BAQEBAQEHAQEBAUABQIUeOyQ0BSUDBy2IHqAUnjEIGIUyiRxngXwLQBiBDwWHV4sehBeFWYd/jnwCjkqCGAwBgjUoLocJgToBAQE Received: from ppp121-44-8-61.lns20.syd4.internode.on.net (HELO dastard) ([121.44.8.61]) by ipmail04.adl6.internode.on.net with ESMTP; 29 Feb 2016 15:28:43 +1030 Received: from dave by dastard with local (Exim 4.80) (envelope-from ) id 1aaFur-0000CG-Rp for xfs@oss.sgi.com; Mon, 29 Feb 2016 15:58:41 +1100 Date: Mon, 29 Feb 2016 15:58:41 +1100 From: Dave Chinner To: xfs@oss.sgi.com Subject: [ANNOUNCE] xfsprogs: master branch updated to 2ab8ecb Message-ID: <20160229045841.GF29057@dastard> X-ASG-Orig-Subj: [ANNOUNCE] xfsprogs: master branch updated to 2ab8ecb MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="MGYHOYXEY6WxJCY8" Content-Disposition: inline User-Agent: Mutt/1.5.21 (2010-09-15) X-Barracuda-Connect: ipmail04.adl6.internode.on.net[150.101.137.141] X-Barracuda-Start-Time: 1456721924 X-Barracuda-URL: https://192.48.176.15:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-BRTS-Status: 1 X-Barracuda-Spam-Score: 0.00 X-Barracuda-Spam-Status: No, SCORE=0.00 using per-user scores of TAG_LEVEL=1000.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.7 tests= X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.3.27432 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- --MGYHOYXEY6WxJCY8 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Hi Folks, The xfsprogs repository at: git://git.kernel.org/pub/scm/fs/xfs/xfsprogs-dev.git has just been updated. The new head of the master branch is commit: 2ab8ecb xfs_io: Prevent devide by zero from {pread,pwrite}_random New Commits: Dmitry Monakhov (1): [2ab8ecb] xfs_io: Prevent devide by zero from {pread,pwrite}_random Eric Sandeen (1): [fa247a5] xfs_db: Fix dquot command docs Zorro Lang (1): [c614d3b] xfs_quota: modify commands which can't handle multiple types Code Diffstat: db/dquot.c | 8 +++++--- io/pread.c | 6 +++++- io/pwrite.c | 6 +++++- man/man8/xfs_db.8 | 4 ++-- man/man8/xfs_quota.8 | 14 ++++++------- quota/edit.c | 60 ++++++++++++++++++++++++++++++++++++------------= ------ quota/quot.c | 15 +++++++++----- quota/quota.c | 15 +++++++++----- quota/report.c | 20 ++++++++++++------ 9 files changed, 98 insertions(+), 50 deletions(-) --=20 Dave Chinner david@fromorbit.com --MGYHOYXEY6WxJCY8 Content-Type: application/pgp-signature; name="signature.asc" Content-Description: Digital signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iQIcBAEBAgAGBQJW09ABAAoJEK3oKUf0dfodgL0P/3/CpVA/oJm8joQKMR0VrLhR q29YS8+9XoEJtrCY9buQ2beEV2p6rj5wKE1KPxh4Z3HlseNkrs7JiDYUe+wcTaYm qJZByrwhkNOqUPVGU5UWbHoNIeE86zgP+G6Fr3IyuGQVw413zLVLcUtQ2vXIbKtC ezd1dVsO6VYqWWnK/yGGPY8noGQKDGK8o/ivH3VaI8TvutfRPl7zEwFiDhWeLcvV 1GJlmX4c8UGTbbigmLQPUDCEDcxsRBfFtq2iq4fKwH9ACmp/TMSvPVNZeGWEEgt5 8qHz5XM6wfZq/QNaDQZJa8SV6aCZmzgxl5YuSvI5zfP22xXKAoEvp7cz3XRU72qH 0Ke3Kf+tCYBZqm94tY2NfcQGW9AkCQ6iqrjQ4M6sVpMwMQhuXC4pSWdlbUmDOUxv YHr5Ff6ffhE1LMV/gt9r+UnhXC6Wx5f4p9q3/7Y9glr0EYSN0qk9Vgbb8EeIEx+U Lv/LWUweyitN8DyQ2InL2O1yrvVNq5wvuA6zmd8C9fFo1IoUQudZyRnUBAR3NUmJ hAR7Uet35z/DioqN6G1uoazTHxHlB0zd4AkMVWBaDTPs8cb/igNMuGjYKQ8HICOJ qFM4GfKlOv0TqE386p7VSdfEURctSzxiWSP9C6fWVE3Di48QfvoBoBbd7syIyiSg MVCztrE8vwu56R6LoFv4 =CVs1 -----END PGP SIGNATURE----- --MGYHOYXEY6WxJCY8-- From david@fromorbit.com Mon Feb 29 00:24:06 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=ham version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay3.corp.sgi.com [198.149.34.15]) by oss.sgi.com (Postfix) with ESMTP id 7D0477C8C for ; Mon, 29 Feb 2016 00:24:06 -0600 (CST) Received: from cuda.sgi.com (cuda3.sgi.com [192.48.176.15]) by relay3.corp.sgi.com (Postfix) with ESMTP id E5E55AC003 for ; Sun, 28 Feb 2016 22:24:02 -0800 (PST) X-ASG-Debug-ID: 1456727039-04cb6c583275730001-NocioJ Received: from ipmail04.adl6.internode.on.net (ipmail04.adl6.internode.on.net [150.101.137.141]) by cuda.sgi.com with ESMTP id jrBxj5tZrdWUjbn0 for ; Sun, 28 Feb 2016 22:24:00 -0800 (PST) X-Barracuda-Envelope-From: david@fromorbit.com X-Barracuda-Apparent-Source-IP: 150.101.137.141 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: A2D9DwAM49NWOT0ILHleKAECgw8iMG2GZKAGAgoMAQEBAQEBBoEPimaFR4QHFwKFdASBKk0BAQEBAQEHAQEBAUABQIUeOyQ0BSUDBy2IHqAQnjIIGIUyiRxngXwLQIEnBZcMhVmHf458Ao5KghgMAYI1KC6HCYE6AQEB Received: from ppp121-44-8-61.lns20.syd4.internode.on.net (HELO dastard) ([121.44.8.61]) by ipmail04.adl6.internode.on.net with ESMTP; 29 Feb 2016 16:53:57 +1030 Received: from dave by dastard with local (Exim 4.80) (envelope-from ) id 1aaHFM-0000LA-9u for xfs@oss.sgi.com; Mon, 29 Feb 2016 17:23:56 +1100 Date: Mon, 29 Feb 2016 17:23:56 +1100 From: Dave Chinner To: xfs@oss.sgi.com Subject: [ANNOUNCE] xfsprogs: for-next branch updated to c062cfe Message-ID: <20160229062356.GG29057@dastard> X-ASG-Orig-Subj: [ANNOUNCE] xfsprogs: for-next branch updated to c062cfe MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="hHWLQfXTYDoKhP50" Content-Disposition: inline User-Agent: Mutt/1.5.21 (2010-09-15) X-Barracuda-Connect: ipmail04.adl6.internode.on.net[150.101.137.141] X-Barracuda-Start-Time: 1456727039 X-Barracuda-URL: https://192.48.176.15:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-BRTS-Status: 1 X-Barracuda-Spam-Score: 0.00 X-Barracuda-Spam-Status: No, SCORE=0.00 using per-user scores of TAG_LEVEL=1000.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.7 tests= X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.3.27433 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- --hHWLQfXTYDoKhP50 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Hi Folks, The for-next branch of the xfsprogs repository at: git://git.kernel.org/pub/scm/fs/xfs/xfsprogs-dev.git has just been updated, bringing it back in line with the current master branch, fixing bugs in the libxfs sync branch, and adding Carlos' new inode command. The new head of the master branch is commit: c062cfe Merge branch 'progs-misc-fixes-for-4.6' into for-next New Commits: Carlos Maiolino (1): [ef25c9e] xfs_io: implement 'inode' command Darrick J. Wong (1): [71893d8] mkfs: fix crash when initializing rbmip Dave Chinner (2): [3efa0bd] Merge branch 'libxfs-4.6-sync' into for-next [c062cfe] Merge branch 'progs-misc-fixes-for-4.6' into for-next Dmitry Monakhov (1): [2ab8ecb] xfs_io: Prevent devide by zero from {pread,pwrite}_random Eric Sandeen (2): [fa247a5] xfs_db: Fix dquot command docs [ff0f39e] libxfs: fix up mismerge in libxfs_iflush_int Zorro Lang (1): [c614d3b] xfs_quota: modify commands which can't handle multiple types Code Diffstat: db/dquot.c | 8 +-- io/open.c | 150 +++++++++++++++++++++++++++++++++++++++++++++++= ++++++ io/pread.c | 6 ++- io/pwrite.c | 6 ++- libxfs/util.c | 2 +- man/man8/xfs_db.8 | 4 +- man/man8/xfs_quota.8 | 14 ++--- mkfs/proto.c | 2 +- quota/edit.c | 60 ++++++++++++++------- quota/quot.c | 15 ++++-- quota/quota.c | 15 ++++-- quota/report.c | 20 ++++--- 12 files changed, 250 insertions(+), 52 deletions(-) --=20 Dave Chinner david@fromorbit.com --hHWLQfXTYDoKhP50 Content-Type: application/pgp-signature; name="signature.asc" Content-Description: Digital signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iQIcBAEBAgAGBQJW0+P7AAoJEK3oKUf0dfodSAoQALqXHt2LVzdu229iYNdCtBUQ 9eAXxAVkm2I6ZDr0sNg2PxSFgCwpMo6cIFXCOzIsXA41o/r9DC7o1drbG0x2Fj87 Ce2wP4Ngb3pyA0bM+4wgbeSwPe2LEJyUzfmXL1UE+mpO6L5FpmIOgax+joYO5i+W 3Xia7gK+/v4FOCyPMaWwyjlVRdnKNBnsK27qDLIw8hAgt12tixX+taONZUovH1iR gJK1RzVi91OfMvQ/COvXfAgXJ8TC6fD1iO7SgfUSaWtMtXE+xN+42zOlvfjrvLoq wBQ2iOaBT/vvvvuyDDfP2Uu9jlXEiV9U90d/oUkQah6EgFOR8IpXkOnYZlLsJMV0 7l/Y4Sur94JN/GlGuMCNhKU+VGFtbjgFAfShpbHgt5e8eUhYvD+VpKjKcM86p4XX qNyN+onmB0bIIvYKoWM8v4us4z8QBf3PbEUIm6GpiLhT8Fajn2FkCOFcz4eZ3p7+ bDbxrAsRmiDPBejUKOM5EvKJTyf+wdJpGPL/xamzWpYAkaCartZQSXt3UbvXPhAs Dh9vuB0YfLdT6yTjaTlCp5Mx/1+tcexIVeWyAfJ6XjS5zo47g7kDqwiaNmmWNW1H NAhei3V4cAZSC2wJKVCorA5QySzDzyzFTmfWjzsEiZ9L3SkSvkDN8sD4vz4xOOPi fkZ44s2zHrKNihXwvHO7 =DTca -----END PGP SIGNATURE----- --hHWLQfXTYDoKhP50-- From david@fromorbit.com Mon Feb 29 01:01:55 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=ham version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay3.corp.sgi.com [198.149.34.15]) by oss.sgi.com (Postfix) with ESMTP id 20BBB29E05 for ; Mon, 29 Feb 2016 01:01:55 -0600 (CST) Received: from cuda.sgi.com (cuda3.sgi.com [192.48.176.15]) by relay3.corp.sgi.com (Postfix) with ESMTP id 89957AC006 for ; Sun, 28 Feb 2016 23:01:51 -0800 (PST) X-ASG-Debug-ID: 1456729308-04cb6c583176130001-NocioJ Received: from ipmail04.adl6.internode.on.net (ipmail04.adl6.internode.on.net [150.101.137.141]) by cuda.sgi.com with ESMTP id UDcn3uRe2qKc1KOH for ; Sun, 28 Feb 2016 23:01:49 -0800 (PST) X-Barracuda-Envelope-From: david@fromorbit.com X-Barracuda-Apparent-Source-IP: 150.101.137.141 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: A2A9DgB37NNWOT0ILHleKAECgw8iMG2Ca4N5oAYCCgwBAQEBAQEGgQ+KZoVHhAcXAoV0BIEsTQEBAQEBAQcBAQEBQAFAhR47JDQFJQMHLYgeoBCeMwgYhTKKA4F8C0CBJwWHVAOHBYgwhVmHf458Ao5KghgMAYI1KC6IQwEBAQ Received: from ppp121-44-8-61.lns20.syd4.internode.on.net (HELO dastard) ([121.44.8.61]) by ipmail04.adl6.internode.on.net with ESMTP; 29 Feb 2016 17:31:14 +1030 Received: from dave by dastard with local (Exim 4.80) (envelope-from ) id 1aaHpR-0000PX-10 for xfs@oss.sgi.com; Mon, 29 Feb 2016 18:01:13 +1100 Date: Mon, 29 Feb 2016 18:01:12 +1100 From: Dave Chinner To: xfs@oss.sgi.com Subject: [ANNOUNCE] xfs: for-next branch updated to f012de6 Message-ID: <20160229070112.GJ29057@dastard> X-ASG-Orig-Subj: [ANNOUNCE] xfs: for-next branch updated to f012de6 MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="5p8PegU4iirBW1oA" Content-Disposition: inline User-Agent: Mutt/1.5.21 (2010-09-15) X-Barracuda-Connect: ipmail04.adl6.internode.on.net[150.101.137.141] X-Barracuda-Start-Time: 1456729308 X-Barracuda-URL: https://192.48.176.15:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-BRTS-Status: 1 X-Barracuda-Spam-Score: 0.00 X-Barracuda-Spam-Status: No, SCORE=0.00 using per-user scores of TAG_LEVEL=1000.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.7 tests= X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.3.27434 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- --5p8PegU4iirBW1oA Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Hi folks, The for-next branch of the xfs kernel repository at git://git.kernel.org/pub/scm/linux/kernel/git/dgc/linux-xfs.git has just been updated. This is to pick up a bug fix for ext4 unwritten extent conversion in the xfs-dio-fix-4.6 branch. -Dave. The new head of the for-next branch is commit: f012de6 Merge branch 'xfs-dio-fix-4.6' into for-next New Commits: Dave Chinner (1): [f012de6] Merge branch 'xfs-dio-fix-4.6' into for-next Jan Kara (1): [74c66bc] ext4: Fix data exposure after failed AIO DIO Code Diffstat: fs/ext4/ext4.h | 30 +++++++++++++++++++++--------- fs/ext4/inode.c | 21 ++++++++------------- fs/ext4/page-io.c | 10 ---------- 3 files changed, 29 insertions(+), 32 deletions(-) --=20 Dave Chinner david@fromorbit.com --5p8PegU4iirBW1oA Content-Type: application/pgp-signature; name="signature.asc" Content-Description: Digital signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iQIcBAEBAgAGBQJW0+y4AAoJEK3oKUf0dfod/7gQAK9XQ6C7gdkzcKhU0cXMFAkg q8Sct/WRbwGujW90YUwgYlBV89rOUT7/hLDT86lIsbQOTnB/ITn9jx2zIq8+w35M HgwLWjUFXsILyLWZQmA/Ex1weV7HqH3esn8B9xuMvgNVQwuIVaIU/SEOBg6k6SXz 4toogCPCtxs9njflUWgqrK40L84wDeSVJppN2/1Pb1qJff83PniGnhf2hGINTzDU CkEOenC4gHTiqXuRZ/4c0IAKq2WwyRO/9KQoggMZBCuG7kp3oqGExqPIpG38KT3L xtLgP8G/rLB63SoC9Qa1JuQEIZZZ2YwvaUlb0BqEvrZAXUlepOppDdhr+kZaXw8q rpqZouvkvmq8x4xqeaCwWE+T1OGtxn+FclcUirkitOg2qwwRr3peeqx4es6EgPeu xT3IUncSyprahjPpNxAUe/7iugKS70N9mzsQfHxZklp923PTdt/dI8wvDz37VYmx YDfaeX5V8LDKr/APYu38EWdNNku1AvkLhHaBsQpdY9BTCFjGcty/CfF3fONMU9JT 3sgm4Swffa5RQeiMUDxFXOlVd5eiHgQE6K7CQwIwlYbuSFRi7qqEtHHvsRf481qL jwYrpGq/EyUZUFk0AEKWL4lQRigazhavznvXWvqcpdonXUmAKlkVu5OSSkV76b11 kYC/O++3HlEJNgTBtQrZ =MLS+ -----END PGP SIGNATURE----- --5p8PegU4iirBW1oA-- From agruenba@redhat.com Mon Feb 29 02:17:38 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=ham version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay2.corp.sgi.com [137.38.102.29]) by oss.sgi.com (Postfix) with ESMTP id E65857CA0 for ; Mon, 29 Feb 2016 02:17:38 -0600 (CST) Received: from cuda.sgi.com (cuda3.sgi.com [192.48.176.15]) by relay2.corp.sgi.com (Postfix) with ESMTP id BBB9C304043 for ; Mon, 29 Feb 2016 00:17:35 -0800 (PST) X-ASG-Debug-ID: 1456733853-04cb6c583078280001-NocioJ Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by cuda.sgi.com with ESMTP id Oxpd1A95fyvoLNJX (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO) for ; Mon, 29 Feb 2016 00:17:34 -0800 (PST) X-Barracuda-Envelope-From: agruenba@redhat.com X-Barracuda-Apparent-Source-IP: 209.132.183.28 X-ASG-Whitelist: Client Received: from int-mx09.intmail.prod.int.phx2.redhat.com (int-mx09.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by mx1.redhat.com (Postfix) with ESMTPS id 8428613A523; Mon, 29 Feb 2016 08:17:32 +0000 (UTC) Received: from schleppi.home.com (vpn1-4-25.ams2.redhat.com [10.36.4.25]) by int-mx09.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id u1T8HS65028000; Mon, 29 Feb 2016 03:17:29 -0500 From: Andreas Gruenbacher To: Alexander Viro Cc: "J. Bruce Fields" , linux-nfs@vger.kernel.org, "Theodore Ts'o" , linux-cifs@vger.kernel.org, linux-api@vger.kernel.org, Trond Myklebust , linux-kernel@vger.kernel.org, xfs@oss.sgi.com, Christoph Hellwig , Andreas Dilger , linux-fsdevel@vger.kernel.org, Jeff Layton , linux-ext4@vger.kernel.org, Anna Schumaker Subject: [PATCH v18 00/22] Richacls (Core and Ext4) Date: Mon, 29 Feb 2016 09:17:05 +0100 X-ASG-Orig-Subj: [PATCH v18 00/22] Richacls (Core and Ext4) Message-Id: <1456733847-17982-1-git-send-email-agruenba@redhat.com> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.22 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.39]); Mon, 29 Feb 2016 08:17:33 +0000 (UTC) X-Barracuda-Connect: mx1.redhat.com[209.132.183.28] X-Barracuda-Start-Time: 1456733853 X-Barracuda-Encrypted: ECDHE-RSA-AES256-GCM-SHA384 X-Barracuda-URL: https://192.48.176.15:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-BRTS-Status: 1 Al, could you please make sure you are happy with the current version of the richacl patch queue for the next merge window? Changes since the last posting (https://lwn.net/Articles/671398/): * Some combinations of ACL entry flags were not computed correctly when ACL entries were inherited from a directory to files and directories created inside that directory. This is fixed now, with a test case covering all the flag combinations in the richacl package. * Rebases on top of v4.5-rc5. The complete patch queue is available here: git://git.kernel.org/pub/scm/linux/kernel/git/agruen/linux-richacl.git \ richacl-2016-02-22 The richacl user-space utilitites, man pages, and test suite are available here: https://github.com/andreas-gruenbacher/richacl Changes to other user-space packages for richacl: https://github.com/andreas-gruenbacher/coreutils https://github.com/andreas-gruenbacher/e2fsprogs https://github.com/andreas-gruenbacher/xfsprogs-dev https://github.com/andreas-gruenbacher/nfs-utils Please see the richacl homepage for more information: http://www.bestbits.at/richacl/ Thanks, Andreas Andreas Gruenbacher (20): vfs: Add IS_ACL() and IS_RICHACL() tests vfs: Add MAY_CREATE_FILE and MAY_CREATE_DIR permission flags vfs: Add MAY_DELETE_SELF and MAY_DELETE_CHILD permission flags vfs: Make the inode passed to inode_change_ok non-const vfs: Add permission flags for setting file attributes richacl: In-memory representation and helper functions richacl: Permission mapping functions richacl: Compute maximum file masks from an acl richacl: Permission check algorithm posix_acl: Unexport acl_by_type and make it static vfs: Cache base_acl objects in inodes vfs: Add get_richacl and set_richacl inode operations vfs: Cache richacl in struct inode richacl: Update the file masks in chmod() richacl: Check if an acl is equivalent to a file mode richacl: Create-time inheritance richacl: Automatic Inheritance richacl: xattr mapping functions richacl: Add richacl xattr handler vfs: Add richacl permission checking Aneesh Kumar K.V (2): ext4: Add richacl support ext4: Add richacl feature flag drivers/staging/lustre/lustre/llite/llite_lib.c | 2 +- fs/Kconfig | 3 + fs/Makefile | 2 + fs/attr.c | 81 +++- fs/ext4/Kconfig | 11 + fs/ext4/Makefile | 1 + fs/ext4/ext4.h | 6 +- fs/ext4/file.c | 3 + fs/ext4/ialloc.c | 11 +- fs/ext4/inode.c | 12 +- fs/ext4/namei.c | 5 + fs/ext4/richacl.c | 142 ++++++ fs/ext4/richacl.h | 40 ++ fs/ext4/super.c | 49 +- fs/ext4/xattr.c | 7 + fs/f2fs/acl.c | 4 +- fs/inode.c | 15 +- fs/jffs2/acl.c | 10 +- fs/namei.c | 118 ++++- fs/posix_acl.c | 50 +- fs/richacl_base.c | 580 ++++++++++++++++++++++++ fs/richacl_inode.c | 333 ++++++++++++++ fs/richacl_xattr.c | 235 ++++++++++ fs/xattr.c | 29 +- include/linux/fs.h | 60 ++- include/linux/posix_acl.h | 13 +- include/linux/richacl.h | 208 +++++++++ include/linux/richacl_xattr.h | 31 ++ include/uapi/linux/Kbuild | 2 + include/uapi/linux/fs.h | 3 +- include/uapi/linux/richacl.h | 152 +++++++ include/uapi/linux/richacl_xattr.h | 44 ++ include/uapi/linux/xattr.h | 2 + 33 files changed, 2157 insertions(+), 107 deletions(-) create mode 100644 fs/ext4/richacl.c create mode 100644 fs/ext4/richacl.h create mode 100644 fs/richacl_base.c create mode 100644 fs/richacl_inode.c create mode 100644 fs/richacl_xattr.c create mode 100644 include/linux/richacl.h create mode 100644 include/linux/richacl_xattr.h create mode 100644 include/uapi/linux/richacl.h create mode 100644 include/uapi/linux/richacl_xattr.h -- 2.4.3 From agruenba@redhat.com Mon Feb 29 02:17:41 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=ham version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay1.corp.sgi.com [137.38.102.111]) by oss.sgi.com (Postfix) with ESMTP id 6666C7CA0 for ; Mon, 29 Feb 2016 02:17:41 -0600 (CST) Received: from cuda.sgi.com (cuda2.sgi.com [192.48.176.25]) by relay1.corp.sgi.com (Postfix) with ESMTP id 2D7E08F8033 for ; Mon, 29 Feb 2016 00:17:37 -0800 (PST) X-ASG-Debug-ID: 1456733856-04cbb00b708c7f0001-NocioJ Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by cuda.sgi.com with ESMTP id f857Ve4FKWwidf1a (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO) for ; Mon, 29 Feb 2016 00:17:36 -0800 (PST) X-Barracuda-Envelope-From: agruenba@redhat.com X-Barracuda-Apparent-Source-IP: 209.132.183.28 X-ASG-Whitelist: Client Received: from int-mx09.intmail.prod.int.phx2.redhat.com (int-mx09.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by mx1.redhat.com (Postfix) with ESMTPS id 0592268E0C; Mon, 29 Feb 2016 08:17:35 +0000 (UTC) Received: from schleppi.home.com (vpn1-4-25.ams2.redhat.com [10.36.4.25]) by int-mx09.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id u1T8HS66028000; Mon, 29 Feb 2016 03:17:32 -0500 From: Andreas Gruenbacher To: Alexander Viro Cc: "J. Bruce Fields" , linux-nfs@vger.kernel.org, "Theodore Ts'o" , linux-cifs@vger.kernel.org, linux-api@vger.kernel.org, Trond Myklebust , linux-kernel@vger.kernel.org, xfs@oss.sgi.com, Christoph Hellwig , Andreas Dilger , linux-fsdevel@vger.kernel.org, Jeff Layton , linux-ext4@vger.kernel.org, Anna Schumaker Subject: [PATCH v18 01/22] vfs: Add IS_ACL() and IS_RICHACL() tests Date: Mon, 29 Feb 2016 09:17:06 +0100 X-ASG-Orig-Subj: [PATCH v18 01/22] vfs: Add IS_ACL() and IS_RICHACL() tests Message-Id: <1456733847-17982-2-git-send-email-agruenba@redhat.com> In-Reply-To: <1456733847-17982-1-git-send-email-agruenba@redhat.com> References: <1456733847-17982-1-git-send-email-agruenba@redhat.com> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.22 X-Barracuda-Connect: mx1.redhat.com[209.132.183.28] X-Barracuda-Start-Time: 1456733856 X-Barracuda-Encrypted: ECDHE-RSA-AES256-GCM-SHA384 X-Barracuda-URL: https://192.48.176.25:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-BRTS-Status: 1 The vfs does not apply the umask for file systems that support acls. The test used for this used to be called IS_POSIXACL(). Switch to a new IS_ACL() test to check for either posix acls or richacls instead. Add a new MS_RICHACL flag and IS_RICHACL() test for richacls alone. The IS_POSIXACL() test is still needed by nfsd. Signed-off-by: Andreas Gruenbacher Reviewed-by: J. Bruce Fields Reviewed-by: Andreas Dilger --- fs/Kconfig | 3 +++ fs/namei.c | 8 ++++---- include/linux/fs.h | 12 ++++++++++++ include/uapi/linux/fs.h | 3 ++- 4 files changed, 21 insertions(+), 5 deletions(-) diff --git a/fs/Kconfig b/fs/Kconfig index 9adee0d..f7b26f3 100644 --- a/fs/Kconfig +++ b/fs/Kconfig @@ -63,6 +63,9 @@ endif # BLOCK config FS_POSIX_ACL def_bool n +config FS_RICHACL + def_bool n + config EXPORTFS tristate diff --git a/fs/namei.c b/fs/namei.c index f624d13..5756c1a 100644 --- a/fs/namei.c +++ b/fs/namei.c @@ -2856,7 +2856,7 @@ static int atomic_open(struct nameidata *nd, struct dentry *dentry, } mode = op->mode; - if ((open_flag & O_CREAT) && !IS_POSIXACL(dir)) + if ((open_flag & O_CREAT) && !IS_ACL(dir)) mode &= ~current_umask(); excl = (open_flag & (O_EXCL | O_CREAT)) == (O_EXCL | O_CREAT); @@ -3040,7 +3040,7 @@ static int lookup_open(struct nameidata *nd, struct path *path, /* Negative dentry, just create the file */ if (!dentry->d_inode && (op->open_flag & O_CREAT)) { umode_t mode = op->mode; - if (!IS_POSIXACL(dir->d_inode)) + if (!IS_ACL(dir->d_inode)) mode &= ~current_umask(); /* * This write is needed to ensure that a @@ -3612,7 +3612,7 @@ retry: if (IS_ERR(dentry)) return PTR_ERR(dentry); - if (!IS_POSIXACL(path.dentry->d_inode)) + if (!IS_ACL(path.dentry->d_inode)) mode &= ~current_umask(); error = security_path_mknod(&path, dentry, mode, dev); if (error) @@ -3681,7 +3681,7 @@ retry: if (IS_ERR(dentry)) return PTR_ERR(dentry); - if (!IS_POSIXACL(path.dentry->d_inode)) + if (!IS_ACL(path.dentry->d_inode)) mode &= ~current_umask(); error = security_path_mkdir(&path, dentry, mode); if (!error) diff --git a/include/linux/fs.h b/include/linux/fs.h index ae68100..f9d2b59 100644 --- a/include/linux/fs.h +++ b/include/linux/fs.h @@ -1804,6 +1804,12 @@ struct super_operations { #define IS_IMMUTABLE(inode) ((inode)->i_flags & S_IMMUTABLE) #define IS_POSIXACL(inode) __IS_FLG(inode, MS_POSIXACL) +#ifdef CONFIG_FS_RICHACL +#define IS_RICHACL(inode) __IS_FLG(inode, MS_RICHACL) +#else +#define IS_RICHACL(inode) 0 +#endif + #define IS_DEADDIR(inode) ((inode)->i_flags & S_DEAD) #define IS_NOCMTIME(inode) ((inode)->i_flags & S_NOCMTIME) #define IS_SWAPFILE(inode) ((inode)->i_flags & S_SWAPFILE) @@ -1817,6 +1823,12 @@ struct super_operations { (inode)->i_rdev == WHITEOUT_DEV) /* + * IS_ACL() tells the VFS to not apply the umask + * and use check_acl for acl permission checks when defined. + */ +#define IS_ACL(inode) __IS_FLG(inode, MS_POSIXACL | MS_RICHACL) + +/* * Inode state bits. Protected by inode->i_lock * * Three bits determine the dirty state of the inode, I_DIRTY_SYNC, diff --git a/include/uapi/linux/fs.h b/include/uapi/linux/fs.h index 149bec8..540dbef 100644 --- a/include/uapi/linux/fs.h +++ b/include/uapi/linux/fs.h @@ -120,7 +120,7 @@ struct inodes_stat_t { #define MS_VERBOSE 32768 /* War is peace. Verbosity is silence. MS_VERBOSE is deprecated. */ #define MS_SILENT 32768 -#define MS_POSIXACL (1<<16) /* VFS does not apply the umask */ +#define MS_POSIXACL (1<<16) /* Supports POSIX ACLs */ #define MS_UNBINDABLE (1<<17) /* change to unbindable */ #define MS_PRIVATE (1<<18) /* change to private */ #define MS_SLAVE (1<<19) /* change to slave */ @@ -130,6 +130,7 @@ struct inodes_stat_t { #define MS_I_VERSION (1<<23) /* Update inode I_version field */ #define MS_STRICTATIME (1<<24) /* Always perform atime updates */ #define MS_LAZYTIME (1<<25) /* Update the on-disk [acm]times lazily */ +#define MS_RICHACL (1<<26) /* Supports richacls */ /* These sb flags are internal to the kernel */ #define MS_NOSEC (1<<28) -- 2.4.3 From agruenba@redhat.com Mon Feb 29 02:17:41 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=ham version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay2.corp.sgi.com [137.38.102.29]) by oss.sgi.com (Postfix) with ESMTP id 71BF97CA3 for ; Mon, 29 Feb 2016 02:17:41 -0600 (CST) Received: from cuda.sgi.com (cuda2.sgi.com [192.48.176.25]) by relay2.corp.sgi.com (Postfix) with ESMTP id 41301304043 for ; Mon, 29 Feb 2016 00:17:41 -0800 (PST) X-ASG-Debug-ID: 1456733859-04cbb00b6f8c7f0001-NocioJ Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by cuda.sgi.com with ESMTP id 5huC0alt42X8pRQP (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO) for ; Mon, 29 Feb 2016 00:17:39 -0800 (PST) X-Barracuda-Envelope-From: agruenba@redhat.com X-Barracuda-Apparent-Source-IP: 209.132.183.28 X-ASG-Whitelist: Client Received: from int-mx09.intmail.prod.int.phx2.redhat.com (int-mx09.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by mx1.redhat.com (Postfix) with ESMTPS id 59E7B1E5C; Mon, 29 Feb 2016 08:17:39 +0000 (UTC) Received: from schleppi.home.com (vpn1-4-25.ams2.redhat.com [10.36.4.25]) by int-mx09.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id u1T8HS67028000; Mon, 29 Feb 2016 03:17:36 -0500 From: Andreas Gruenbacher To: Alexander Viro Cc: "J. Bruce Fields" , linux-nfs@vger.kernel.org, "Theodore Ts'o" , linux-cifs@vger.kernel.org, linux-api@vger.kernel.org, Trond Myklebust , linux-kernel@vger.kernel.org, xfs@oss.sgi.com, Christoph Hellwig , Andreas Dilger , linux-fsdevel@vger.kernel.org, Jeff Layton , linux-ext4@vger.kernel.org, Anna Schumaker Subject: [PATCH v18 02/22] vfs: Add MAY_CREATE_FILE and MAY_CREATE_DIR permission flags Date: Mon, 29 Feb 2016 09:17:07 +0100 X-ASG-Orig-Subj: [PATCH v18 02/22] vfs: Add MAY_CREATE_FILE and MAY_CREATE_DIR permission flags Message-Id: <1456733847-17982-3-git-send-email-agruenba@redhat.com> In-Reply-To: <1456733847-17982-1-git-send-email-agruenba@redhat.com> References: <1456733847-17982-1-git-send-email-agruenba@redhat.com> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.22 X-Barracuda-Connect: mx1.redhat.com[209.132.183.28] X-Barracuda-Start-Time: 1456733859 X-Barracuda-Encrypted: ECDHE-RSA-AES256-GCM-SHA384 X-Barracuda-URL: https://192.48.176.25:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-BRTS-Status: 1 Richacls distinguish between creating non-directories and directories. To support that, add an isdir parameter to may_create(). When checking inode_permission() for create permission, pass in an additional MAY_CREATE_FILE or MAY_CREATE_DIR mask flag. Add may_replace() to allow checking for delete and create access when replacing an existing file in vfs_rename(). Signed-off-by: Andreas Gruenbacher Reviewed-by: J. Bruce Fields Reviewed-by: Andreas Dilger --- fs/namei.c | 49 +++++++++++++++++++++++++++++++++---------------- include/linux/fs.h | 2 ++ 2 files changed, 35 insertions(+), 16 deletions(-) diff --git a/fs/namei.c b/fs/namei.c index 5756c1a..ae30626 100644 --- a/fs/namei.c +++ b/fs/namei.c @@ -453,7 +453,9 @@ static int sb_permission(struct super_block *sb, struct inode *inode, int mask) * this, letting us set arbitrary permissions for filesystem access without * changing the "normal" UIDs which are used for other things. * - * When checking for MAY_APPEND, MAY_WRITE must also be set in @mask. + * MAY_WRITE must be set in @mask whenever MAY_APPEND, MAY_CREATE_FILE, or + * MAY_CREATE_DIR are set. That way, file systems that don't support these + * permissions will check for MAY_WRITE instead. */ int inode_permission(struct inode *inode, int mask) { @@ -2611,7 +2613,8 @@ EXPORT_SYMBOL(__check_sticky); * 10. We don't allow removal of NFS sillyrenamed files; it's handled by * nfs_async_unlink(). */ -static int may_delete(struct inode *dir, struct dentry *victim, bool isdir) +static int may_delete_or_replace(struct inode *dir, struct dentry *victim, + bool isdir, int mask) { struct inode *inode = d_backing_inode(victim); int error; @@ -2623,7 +2626,7 @@ static int may_delete(struct inode *dir, struct dentry *victim, bool isdir) BUG_ON(victim->d_parent->d_inode != dir); audit_inode_child(dir, victim, AUDIT_TYPE_CHILD_DELETE); - error = inode_permission(dir, MAY_WRITE | MAY_EXEC); + error = inode_permission(dir, mask); if (error) return error; if (IS_APPEND(dir)) @@ -2646,6 +2649,18 @@ static int may_delete(struct inode *dir, struct dentry *victim, bool isdir) return 0; } +static int may_delete(struct inode *dir, struct dentry *victim, bool isdir) +{ + return may_delete_or_replace(dir, victim, isdir, MAY_WRITE | MAY_EXEC); +} + +static int may_replace(struct inode *dir, struct dentry *victim, bool isdir) +{ + int mask = isdir ? MAY_CREATE_DIR : MAY_CREATE_FILE; + + return may_delete_or_replace(dir, victim, isdir, mask | MAY_WRITE | MAY_EXEC); +} + /* Check whether we can create an object with dentry child in directory * dir. * 1. We can't do it if child already exists (open has special treatment for @@ -2654,14 +2669,16 @@ static int may_delete(struct inode *dir, struct dentry *victim, bool isdir) * 3. We should have write and exec permissions on dir * 4. We can't do it if dir is immutable (done in permission()) */ -static inline int may_create(struct inode *dir, struct dentry *child) +static inline int may_create(struct inode *dir, struct dentry *child, bool isdir) { + int mask = isdir ? MAY_CREATE_DIR : MAY_CREATE_FILE; + audit_inode_child(dir, child, AUDIT_TYPE_CHILD_CREATE); if (child->d_inode) return -EEXIST; if (IS_DEADDIR(dir)) return -ENOENT; - return inode_permission(dir, MAY_WRITE | MAY_EXEC); + return inode_permission(dir, MAY_WRITE | MAY_EXEC | mask); } /* @@ -2711,7 +2728,7 @@ EXPORT_SYMBOL(unlock_rename); int vfs_create(struct inode *dir, struct dentry *dentry, umode_t mode, bool want_excl) { - int error = may_create(dir, dentry); + int error = may_create(dir, dentry, false); if (error) return error; @@ -3553,7 +3570,7 @@ EXPORT_SYMBOL(user_path_create); int vfs_mknod(struct inode *dir, struct dentry *dentry, umode_t mode, dev_t dev) { - int error = may_create(dir, dentry); + int error = may_create(dir, dentry, false); if (error) return error; @@ -3645,7 +3662,7 @@ SYSCALL_DEFINE3(mknod, const char __user *, filename, umode_t, mode, unsigned, d int vfs_mkdir(struct inode *dir, struct dentry *dentry, umode_t mode) { - int error = may_create(dir, dentry); + int error = may_create(dir, dentry, true); unsigned max_links = dir->i_sb->s_max_links; if (error) @@ -3726,7 +3743,7 @@ EXPORT_SYMBOL(dentry_unhash); int vfs_rmdir(struct inode *dir, struct dentry *dentry) { - int error = may_delete(dir, dentry, 1); + int error = may_delete(dir, dentry, true); if (error) return error; @@ -3848,7 +3865,7 @@ SYSCALL_DEFINE1(rmdir, const char __user *, pathname) int vfs_unlink(struct inode *dir, struct dentry *dentry, struct inode **delegated_inode) { struct inode *target = dentry->d_inode; - int error = may_delete(dir, dentry, 0); + int error = may_delete(dir, dentry, false); if (error) return error; @@ -3982,7 +3999,7 @@ SYSCALL_DEFINE1(unlink, const char __user *, pathname) int vfs_symlink(struct inode *dir, struct dentry *dentry, const char *oldname) { - int error = may_create(dir, dentry); + int error = may_create(dir, dentry, false); if (error) return error; @@ -4065,7 +4082,7 @@ int vfs_link(struct dentry *old_dentry, struct inode *dir, struct dentry *new_de if (!inode) return -ENOENT; - error = may_create(dir, new_dentry); + error = may_create(dir, new_dentry, false); if (error) return error; @@ -4258,14 +4275,14 @@ int vfs_rename(struct inode *old_dir, struct dentry *old_dentry, return error; if (!target) { - error = may_create(new_dir, new_dentry); + error = may_create(new_dir, new_dentry, is_dir); } else { new_is_dir = d_is_dir(new_dentry); if (!(flags & RENAME_EXCHANGE)) - error = may_delete(new_dir, new_dentry, is_dir); + error = may_replace(new_dir, new_dentry, is_dir); else - error = may_delete(new_dir, new_dentry, new_is_dir); + error = may_replace(new_dir, new_dentry, new_is_dir); } if (error) return error; @@ -4528,7 +4545,7 @@ SYSCALL_DEFINE2(rename, const char __user *, oldname, const char __user *, newna int vfs_whiteout(struct inode *dir, struct dentry *dentry) { - int error = may_create(dir, dentry); + int error = may_create(dir, dentry, false); if (error) return error; diff --git a/include/linux/fs.h b/include/linux/fs.h index f9d2b59..02e99d7 100644 --- a/include/linux/fs.h +++ b/include/linux/fs.h @@ -83,6 +83,8 @@ typedef void (dax_iodone_t)(struct buffer_head *bh_map, int uptodate); #define MAY_CHDIR 0x00000040 /* called from RCU mode, don't block */ #define MAY_NOT_BLOCK 0x00000080 +#define MAY_CREATE_FILE 0x00000100 +#define MAY_CREATE_DIR 0x00000200 /* * flags in file.f_mode. Note that FMODE_READ and FMODE_WRITE must correspond -- 2.4.3 From agruenba@redhat.com Mon Feb 29 02:17:48 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=ham version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay3.corp.sgi.com [198.149.34.15]) by oss.sgi.com (Postfix) with ESMTP id 61F0C7CA1 for ; Mon, 29 Feb 2016 02:17:48 -0600 (CST) Received: from cuda.sgi.com (cuda3.sgi.com [192.48.176.15]) by relay3.corp.sgi.com (Postfix) with ESMTP id BCB25AC004 for ; Mon, 29 Feb 2016 00:17:44 -0800 (PST) X-ASG-Debug-ID: 1456733863-04cb6c5832782a0001-NocioJ Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by cuda.sgi.com with ESMTP id PJCChER3o8YYj9oU (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO) for ; Mon, 29 Feb 2016 00:17:43 -0800 (PST) X-Barracuda-Envelope-From: agruenba@redhat.com X-Barracuda-Apparent-Source-IP: 209.132.183.28 X-ASG-Whitelist: Client Received: from int-mx09.intmail.prod.int.phx2.redhat.com (int-mx09.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by mx1.redhat.com (Postfix) with ESMTPS id B48C91F564; Mon, 29 Feb 2016 08:17:42 +0000 (UTC) Received: from schleppi.home.com (vpn1-4-25.ams2.redhat.com [10.36.4.25]) by int-mx09.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id u1T8HS68028000; Mon, 29 Feb 2016 03:17:39 -0500 From: Andreas Gruenbacher To: Alexander Viro Cc: "J. Bruce Fields" , linux-nfs@vger.kernel.org, "Theodore Ts'o" , linux-cifs@vger.kernel.org, linux-api@vger.kernel.org, Trond Myklebust , linux-kernel@vger.kernel.org, xfs@oss.sgi.com, Christoph Hellwig , Andreas Dilger , linux-fsdevel@vger.kernel.org, Jeff Layton , linux-ext4@vger.kernel.org, Anna Schumaker Subject: [PATCH v18 03/22] vfs: Add MAY_DELETE_SELF and MAY_DELETE_CHILD permission flags Date: Mon, 29 Feb 2016 09:17:08 +0100 X-ASG-Orig-Subj: [PATCH v18 03/22] vfs: Add MAY_DELETE_SELF and MAY_DELETE_CHILD permission flags Message-Id: <1456733847-17982-4-git-send-email-agruenba@redhat.com> In-Reply-To: <1456733847-17982-1-git-send-email-agruenba@redhat.com> References: <1456733847-17982-1-git-send-email-agruenba@redhat.com> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.22 X-Barracuda-Connect: mx1.redhat.com[209.132.183.28] X-Barracuda-Start-Time: 1456733863 X-Barracuda-Encrypted: ECDHE-RSA-AES256-GCM-SHA384 X-Barracuda-URL: https://192.48.176.15:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-BRTS-Status: 1 Normally, deleting a file requires MAY_WRITE access to the parent directory. With richacls, a file may be deleted with MAY_DELETE_CHILD access to the parent directory or with MAY_DELETE_SELF access to the file. To support that, pass the MAY_DELETE_CHILD mask flag to inode_permission() when checking for delete access inside a directory, and MAY_DELETE_SELF when checking for delete access to a file itelf. The MAY_DELETE_SELF permission overrides the sticky directory check. Signed-off-by: Andreas Gruenbacher Reviewed-by: J. Bruce Fields --- fs/namei.c | 20 ++++++++++++-------- include/linux/fs.h | 2 ++ 2 files changed, 14 insertions(+), 8 deletions(-) diff --git a/fs/namei.c b/fs/namei.c index ae30626..59b1da0 100644 --- a/fs/namei.c +++ b/fs/namei.c @@ -453,9 +453,9 @@ static int sb_permission(struct super_block *sb, struct inode *inode, int mask) * this, letting us set arbitrary permissions for filesystem access without * changing the "normal" UIDs which are used for other things. * - * MAY_WRITE must be set in @mask whenever MAY_APPEND, MAY_CREATE_FILE, or - * MAY_CREATE_DIR are set. That way, file systems that don't support these - * permissions will check for MAY_WRITE instead. + * MAY_WRITE must be set in @mask whenever MAY_APPEND, MAY_CREATE_FILE, + * MAY_CREATE_DIR, or MAY_DELETE_CHILD are set. That way, file systems that + * don't support these permissions will check for MAY_WRITE instead. */ int inode_permission(struct inode *inode, int mask) { @@ -2626,14 +2626,18 @@ static int may_delete_or_replace(struct inode *dir, struct dentry *victim, BUG_ON(victim->d_parent->d_inode != dir); audit_inode_child(dir, victim, AUDIT_TYPE_CHILD_DELETE); - error = inode_permission(dir, mask); + error = inode_permission(dir, mask | MAY_WRITE | MAY_DELETE_CHILD); + if (!error && check_sticky(dir, inode)) + error = -EPERM; + if (error && IS_RICHACL(inode) && + inode_permission(inode, MAY_DELETE_SELF) == 0 && + inode_permission(dir, mask) == 0) + error = 0; if (error) return error; if (IS_APPEND(dir)) return -EPERM; - - if (check_sticky(dir, inode) || IS_APPEND(inode) || - IS_IMMUTABLE(inode) || IS_SWAPFILE(inode)) + if (IS_APPEND(inode) || IS_IMMUTABLE(inode) || IS_SWAPFILE(inode)) return -EPERM; if (isdir) { if (!d_is_dir(victim)) @@ -2651,7 +2655,7 @@ static int may_delete_or_replace(struct inode *dir, struct dentry *victim, static int may_delete(struct inode *dir, struct dentry *victim, bool isdir) { - return may_delete_or_replace(dir, victim, isdir, MAY_WRITE | MAY_EXEC); + return may_delete_or_replace(dir, victim, isdir, MAY_EXEC); } static int may_replace(struct inode *dir, struct dentry *victim, bool isdir) diff --git a/include/linux/fs.h b/include/linux/fs.h index 02e99d7..97e34ba 100644 --- a/include/linux/fs.h +++ b/include/linux/fs.h @@ -85,6 +85,8 @@ typedef void (dax_iodone_t)(struct buffer_head *bh_map, int uptodate); #define MAY_NOT_BLOCK 0x00000080 #define MAY_CREATE_FILE 0x00000100 #define MAY_CREATE_DIR 0x00000200 +#define MAY_DELETE_CHILD 0x00000400 +#define MAY_DELETE_SELF 0x00000800 /* * flags in file.f_mode. Note that FMODE_READ and FMODE_WRITE must correspond -- 2.4.3 From agruenba@redhat.com Mon Feb 29 02:17:48 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=ham version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay3.corp.sgi.com [198.149.34.15]) by oss.sgi.com (Postfix) with ESMTP id BAF2F7CB3 for ; Mon, 29 Feb 2016 02:17:48 -0600 (CST) Received: from cuda.sgi.com (cuda3.sgi.com [192.48.176.15]) by relay3.corp.sgi.com (Postfix) with ESMTP id 258FAAC003 for ; Mon, 29 Feb 2016 00:17:48 -0800 (PST) X-ASG-Debug-ID: 1456733866-04cb6c5832782b0001-NocioJ Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by cuda.sgi.com with ESMTP id mRfd83d4BEhXWtI0 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO) for ; Mon, 29 Feb 2016 00:17:47 -0800 (PST) X-Barracuda-Envelope-From: agruenba@redhat.com X-Barracuda-Apparent-Source-IP: 209.132.183.28 X-ASG-Whitelist: Client Received: from int-mx09.intmail.prod.int.phx2.redhat.com (int-mx09.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by mx1.redhat.com (Postfix) with ESMTPS id 734AF65415; Mon, 29 Feb 2016 08:17:46 +0000 (UTC) Received: from schleppi.home.com (vpn1-4-25.ams2.redhat.com [10.36.4.25]) by int-mx09.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id u1T8HS69028000; Mon, 29 Feb 2016 03:17:42 -0500 From: Andreas Gruenbacher To: Alexander Viro Cc: "J. Bruce Fields" , linux-nfs@vger.kernel.org, "Theodore Ts'o" , linux-cifs@vger.kernel.org, linux-api@vger.kernel.org, Trond Myklebust , linux-kernel@vger.kernel.org, xfs@oss.sgi.com, Christoph Hellwig , Andreas Dilger , linux-fsdevel@vger.kernel.org, Jeff Layton , linux-ext4@vger.kernel.org, Anna Schumaker Subject: [PATCH v18 04/22] vfs: Make the inode passed to inode_change_ok non-const Date: Mon, 29 Feb 2016 09:17:09 +0100 X-ASG-Orig-Subj: [PATCH v18 04/22] vfs: Make the inode passed to inode_change_ok non-const Message-Id: <1456733847-17982-5-git-send-email-agruenba@redhat.com> In-Reply-To: <1456733847-17982-1-git-send-email-agruenba@redhat.com> References: <1456733847-17982-1-git-send-email-agruenba@redhat.com> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.22 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.39]); Mon, 29 Feb 2016 08:17:46 +0000 (UTC) X-Barracuda-Connect: mx1.redhat.com[209.132.183.28] X-Barracuda-Start-Time: 1456733866 X-Barracuda-Encrypted: ECDHE-RSA-AES256-GCM-SHA384 X-Barracuda-URL: https://192.48.176.15:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-BRTS-Status: 1 We will need to call iop->permission and iop->get_acl from inode_change_ok() for additional permission checks, and both take a non-const inode. Signed-off-by: Andreas Gruenbacher Reviewed-by: J. Bruce Fields Reviewed-by: Andreas Dilger --- fs/attr.c | 2 +- include/linux/fs.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/fs/attr.c b/fs/attr.c index 25b24d0..7ca7fa0 100644 --- a/fs/attr.c +++ b/fs/attr.c @@ -28,7 +28,7 @@ * Should be called as the first thing in ->setattr implementations, * possibly after taking additional locks. */ -int inode_change_ok(const struct inode *inode, struct iattr *attr) +int inode_change_ok(struct inode *inode, struct iattr *attr) { unsigned int ia_valid = attr->ia_valid; diff --git a/include/linux/fs.h b/include/linux/fs.h index 97e34ba..efff04f 100644 --- a/include/linux/fs.h +++ b/include/linux/fs.h @@ -2908,7 +2908,7 @@ extern int buffer_migrate_page(struct address_space *, #define buffer_migrate_page NULL #endif -extern int inode_change_ok(const struct inode *, struct iattr *); +extern int inode_change_ok(struct inode *, struct iattr *); extern int inode_newsize_ok(const struct inode *, loff_t offset); extern void setattr_copy(struct inode *inode, const struct iattr *attr); -- 2.4.3 From agruenba@redhat.com Mon Feb 29 02:17:52 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=ham version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay1.corp.sgi.com [137.38.102.111]) by oss.sgi.com (Postfix) with ESMTP id 9794B7CB5 for ; Mon, 29 Feb 2016 02:17:52 -0600 (CST) Received: from cuda.sgi.com (cuda1.sgi.com [192.48.157.11]) by relay1.corp.sgi.com (Postfix) with ESMTP id 427B88F8037 for ; Mon, 29 Feb 2016 00:17:52 -0800 (PST) X-ASG-Debug-ID: 1456733870-04bdf002ec8aa90001-NocioJ Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by cuda.sgi.com with ESMTP id NVr5d7IBTaZjP8IP (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO) for ; Mon, 29 Feb 2016 00:17:50 -0800 (PST) X-Barracuda-Envelope-From: agruenba@redhat.com X-Barracuda-Apparent-Source-IP: 209.132.183.28 X-ASG-Whitelist: Client Received: from int-mx09.intmail.prod.int.phx2.redhat.com (int-mx09.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by mx1.redhat.com (Postfix) with ESMTPS id 2EBDA13A522; Mon, 29 Feb 2016 08:17:50 +0000 (UTC) Received: from schleppi.home.com (vpn1-4-25.ams2.redhat.com [10.36.4.25]) by int-mx09.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id u1T8HS6A028000; Mon, 29 Feb 2016 03:17:46 -0500 From: Andreas Gruenbacher To: Alexander Viro Cc: "J. Bruce Fields" , linux-nfs@vger.kernel.org, "Theodore Ts'o" , linux-cifs@vger.kernel.org, linux-api@vger.kernel.org, Trond Myklebust , linux-kernel@vger.kernel.org, xfs@oss.sgi.com, Christoph Hellwig , Andreas Dilger , linux-fsdevel@vger.kernel.org, Jeff Layton , linux-ext4@vger.kernel.org, Anna Schumaker Subject: [PATCH v18 05/22] vfs: Add permission flags for setting file attributes Date: Mon, 29 Feb 2016 09:17:10 +0100 X-ASG-Orig-Subj: [PATCH v18 05/22] vfs: Add permission flags for setting file attributes Message-Id: <1456733847-17982-6-git-send-email-agruenba@redhat.com> In-Reply-To: <1456733847-17982-1-git-send-email-agruenba@redhat.com> References: <1456733847-17982-1-git-send-email-agruenba@redhat.com> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.22 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.39]); Mon, 29 Feb 2016 08:17:50 +0000 (UTC) X-Barracuda-Connect: mx1.redhat.com[209.132.183.28] X-Barracuda-Start-Time: 1456733870 X-Barracuda-Encrypted: ECDHE-RSA-AES256-GCM-SHA384 X-Barracuda-URL: https://192.48.157.11:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-BRTS-Status: 1 Richacls support permissions that allow to take ownership of a file, change the file permissions, and set the file timestamps. Support that by introducing new permission mask flags and by checking for those mask flags in inode_change_ok(). Signed-off-by: Andreas Gruenbacher Reviewed-by: J. Bruce Fields --- fs/attr.c | 79 +++++++++++++++++++++++++++++++++++++++++++++--------- include/linux/fs.h | 3 +++ 2 files changed, 70 insertions(+), 12 deletions(-) diff --git a/fs/attr.c b/fs/attr.c index 7ca7fa0..2a8c49c 100644 --- a/fs/attr.c +++ b/fs/attr.c @@ -17,6 +17,65 @@ #include /** + * inode_extended_permission - permissions beyond read/write/execute + * + * Check for permissions that only richacls can currently grant. + */ +static int inode_extended_permission(struct inode *inode, int mask) +{ + if (!IS_RICHACL(inode)) + return -EPERM; + return inode_permission(inode, mask); +} + +static bool inode_uid_change_ok(struct inode *inode, kuid_t ia_uid) +{ + if (uid_eq(current_fsuid(), inode->i_uid) && + uid_eq(ia_uid, inode->i_uid)) + return true; + if (uid_eq(current_fsuid(), ia_uid) && + inode_extended_permission(inode, MAY_TAKE_OWNERSHIP) == 0) + return true; + if (capable_wrt_inode_uidgid(inode, CAP_CHOWN)) + return true; + return false; +} + +static bool inode_gid_change_ok(struct inode *inode, kgid_t ia_gid) +{ + int in_group = in_group_p(ia_gid); + if (uid_eq(current_fsuid(), inode->i_uid) && + (in_group || gid_eq(ia_gid, inode->i_gid))) + return true; + if (in_group && inode_extended_permission(inode, MAY_TAKE_OWNERSHIP) == 0) + return true; + if (capable_wrt_inode_uidgid(inode, CAP_CHOWN)) + return true; + return false; +} + +/** + * inode_owner_permitted_or_capable + * + * Check for permissions implicitly granted to the owner, like MAY_CHMOD or + * MAY_SET_TIMES. Equivalent to inode_owner_or_capable for file systems + * without support for those permissions. + */ +static bool inode_owner_permitted_or_capable(struct inode *inode, int mask) +{ + struct user_namespace *ns; + + if (uid_eq(current_fsuid(), inode->i_uid)) + return true; + if (inode_extended_permission(inode, mask) == 0) + return true; + ns = current_user_ns(); + if (ns_capable(ns, CAP_FOWNER) && kuid_has_mapping(ns, inode->i_uid)) + return true; + return false; +} + +/** * inode_change_ok - check if attribute changes to an inode are allowed * @inode: inode to check * @attr: attributes to change @@ -47,22 +106,18 @@ int inode_change_ok(struct inode *inode, struct iattr *attr) return 0; /* Make sure a caller can chown. */ - if ((ia_valid & ATTR_UID) && - (!uid_eq(current_fsuid(), inode->i_uid) || - !uid_eq(attr->ia_uid, inode->i_uid)) && - !capable_wrt_inode_uidgid(inode, CAP_CHOWN)) - return -EPERM; + if (ia_valid & ATTR_UID) + if (!inode_uid_change_ok(inode, attr->ia_uid)) + return -EPERM; /* Make sure caller can chgrp. */ - if ((ia_valid & ATTR_GID) && - (!uid_eq(current_fsuid(), inode->i_uid) || - (!in_group_p(attr->ia_gid) && !gid_eq(attr->ia_gid, inode->i_gid))) && - !capable_wrt_inode_uidgid(inode, CAP_CHOWN)) - return -EPERM; + if (ia_valid & ATTR_GID) + if (!inode_gid_change_ok(inode, attr->ia_gid)) + return -EPERM; /* Make sure a caller can chmod. */ if (ia_valid & ATTR_MODE) { - if (!inode_owner_or_capable(inode)) + if (!inode_owner_permitted_or_capable(inode, MAY_CHMOD)) return -EPERM; /* Also check the setgid bit! */ if (!in_group_p((ia_valid & ATTR_GID) ? attr->ia_gid : @@ -73,7 +128,7 @@ int inode_change_ok(struct inode *inode, struct iattr *attr) /* Check for setting the inode time. */ if (ia_valid & (ATTR_MTIME_SET | ATTR_ATIME_SET | ATTR_TIMES_SET)) { - if (!inode_owner_or_capable(inode)) + if (!inode_owner_permitted_or_capable(inode, MAY_SET_TIMES)) return -EPERM; } diff --git a/include/linux/fs.h b/include/linux/fs.h index efff04f..0f560b7 100644 --- a/include/linux/fs.h +++ b/include/linux/fs.h @@ -87,6 +87,9 @@ typedef void (dax_iodone_t)(struct buffer_head *bh_map, int uptodate); #define MAY_CREATE_DIR 0x00000200 #define MAY_DELETE_CHILD 0x00000400 #define MAY_DELETE_SELF 0x00000800 +#define MAY_TAKE_OWNERSHIP 0x00001000 +#define MAY_CHMOD 0x00002000 +#define MAY_SET_TIMES 0x00004000 /* * flags in file.f_mode. Note that FMODE_READ and FMODE_WRITE must correspond -- 2.4.3 From agruenba@redhat.com Mon Feb 29 02:17:56 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=ham version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay2.corp.sgi.com [137.38.102.29]) by oss.sgi.com (Postfix) with ESMTP id D375E7CBD for ; Mon, 29 Feb 2016 02:17:56 -0600 (CST) Received: from cuda.sgi.com (cuda1.sgi.com [192.48.157.11]) by relay2.corp.sgi.com (Postfix) with ESMTP id 764DE304048 for ; Mon, 29 Feb 2016 00:17:56 -0800 (PST) X-ASG-Debug-ID: 1456733873-04bdf002ed8aaa0001-NocioJ Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by cuda.sgi.com with ESMTP id Ri4o5k1h9DCkAPiM (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO) for ; Mon, 29 Feb 2016 00:17:53 -0800 (PST) X-Barracuda-Envelope-From: agruenba@redhat.com X-Barracuda-Apparent-Source-IP: 209.132.183.28 X-ASG-Whitelist: Client Received: from int-mx09.intmail.prod.int.phx2.redhat.com (int-mx09.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by mx1.redhat.com (Postfix) with ESMTPS id 777707F093; Mon, 29 Feb 2016 08:17:53 +0000 (UTC) Received: from schleppi.home.com (vpn1-4-25.ams2.redhat.com [10.36.4.25]) by int-mx09.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id u1T8HS6B028000; Mon, 29 Feb 2016 03:17:50 -0500 From: Andreas Gruenbacher To: Alexander Viro Cc: "J. Bruce Fields" , linux-nfs@vger.kernel.org, "Theodore Ts'o" , linux-cifs@vger.kernel.org, linux-api@vger.kernel.org, Trond Myklebust , linux-kernel@vger.kernel.org, xfs@oss.sgi.com, Christoph Hellwig , Andreas Dilger , linux-fsdevel@vger.kernel.org, Jeff Layton , linux-ext4@vger.kernel.org, Anna Schumaker Subject: [PATCH v18 06/22] richacl: In-memory representation and helper functions Date: Mon, 29 Feb 2016 09:17:11 +0100 X-ASG-Orig-Subj: [PATCH v18 06/22] richacl: In-memory representation and helper functions Message-Id: <1456733847-17982-7-git-send-email-agruenba@redhat.com> In-Reply-To: <1456733847-17982-1-git-send-email-agruenba@redhat.com> References: <1456733847-17982-1-git-send-email-agruenba@redhat.com> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.22 X-Barracuda-Connect: mx1.redhat.com[209.132.183.28] X-Barracuda-Start-Time: 1456733873 X-Barracuda-Encrypted: ECDHE-RSA-AES256-GCM-SHA384 X-Barracuda-URL: https://192.48.157.11:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-BRTS-Status: 1 A richacl consists of an NFSv4 acl and an owner, group, and other mask. These three masks correspond to the owner, group, and other file permission bits, but they contain NFSv4 permissions instead of POSIX permissions. Each entry in the NFSv4 acl applies to the file owner (OWNER@), the owning group (GROUP@), everyone (EVERYONE@), or to a specific uid or gid. As in the standard POSIX file permission model, each process is the owner, group, or other file class. A richacl grants a requested access only if the NFSv4 acl in the richacl grants the access (according to the NFSv4 permission check algorithm), and the file mask that applies to the process includes the requested permissions. Signed-off-by: Andreas Gruenbacher Reviewed-by: J. Bruce Fields --- fs/Makefile | 2 + fs/richacl_base.c | 67 ++++++++++++++++ include/linux/richacl.h | 179 +++++++++++++++++++++++++++++++++++++++++++ include/uapi/linux/Kbuild | 1 + include/uapi/linux/richacl.h | 99 ++++++++++++++++++++++++ 5 files changed, 348 insertions(+) create mode 100644 fs/richacl_base.c create mode 100644 include/linux/richacl.h create mode 100644 include/uapi/linux/richacl.h diff --git a/fs/Makefile b/fs/Makefile index 79f5225..e5994c4 100644 --- a/fs/Makefile +++ b/fs/Makefile @@ -48,6 +48,8 @@ obj-$(CONFIG_COREDUMP) += coredump.o obj-$(CONFIG_SYSCTL) += drop_caches.o obj-$(CONFIG_FHANDLE) += fhandle.o +obj-$(CONFIG_FS_RICHACL) += richacl.o +richacl-y := richacl_base.o obj-y += quota/ diff --git a/fs/richacl_base.c b/fs/richacl_base.c new file mode 100644 index 0000000..c3ec928 --- /dev/null +++ b/fs/richacl_base.c @@ -0,0 +1,67 @@ +/* + * Copyright (C) 2006, 2010 Novell, Inc. + * Copyright (C) 2015 Red Hat, Inc. + * Written by Andreas Gruenbacher + * + * This program is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License as published by the + * Free Software Foundation; either version 2, or (at your option) any + * later version. + * + * This program is distributed in the hope that it will be useful, but + * WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * General Public License for more details. + */ + +#include +#include +#include +#include +#include + +MODULE_LICENSE("GPL"); + +/** + * richacl_alloc - allocate a richacl + * @count: number of entries + */ +struct richacl * +richacl_alloc(int count, gfp_t gfp) +{ + size_t size = sizeof(struct richacl) + count * sizeof(struct richace); + struct richacl *acl = kzalloc(size, gfp); + + if (acl) { + atomic_set(&acl->a_refcount, 1); + acl->a_count = count; + } + return acl; +} +EXPORT_SYMBOL_GPL(richacl_alloc); + +/** + * richacl_clone - create a copy of a richacl + */ +struct richacl * +richacl_clone(const struct richacl *acl, gfp_t gfp) +{ + int count = acl->a_count; + size_t size = sizeof(struct richacl) + count * sizeof(struct richace); + struct richacl *dup = kmalloc(size, gfp); + + if (dup) { + memcpy(dup, acl, size); + atomic_set(&dup->a_refcount, 1); + } + return dup; +} + +/** + * richace_copy - copy an acl entry + */ +void +richace_copy(struct richace *to, const struct richace *from) +{ + memcpy(to, from, sizeof(struct richace)); +} diff --git a/include/linux/richacl.h b/include/linux/richacl.h new file mode 100644 index 0000000..edb8480 --- /dev/null +++ b/include/linux/richacl.h @@ -0,0 +1,179 @@ +/* + * Copyright (C) 2006, 2010 Novell, Inc. + * Copyright (C) 2015 Red Hat, Inc. + * Written by Andreas Gruenbacher + * + * This program is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License as published by the + * Free Software Foundation; either version 2, or (at your option) any + * later version. + * + * This program is distributed in the hope that it will be useful, but + * WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * General Public License for more details. + */ + +#ifndef __RICHACL_H +#define __RICHACL_H + +#include + +struct richace { + unsigned short e_type; + unsigned short e_flags; + unsigned int e_mask; + union { + kuid_t uid; + kgid_t gid; + unsigned int special; + } e_id; +}; + +struct richacl { + atomic_t a_refcount; + unsigned int a_owner_mask; + unsigned int a_group_mask; + unsigned int a_other_mask; + unsigned short a_count; + unsigned short a_flags; + struct richace a_entries[0]; +}; + +#define richacl_for_each_entry(_ace, _acl) \ + for (_ace = (_acl)->a_entries; \ + _ace != (_acl)->a_entries + (_acl)->a_count; \ + _ace++) + +#define richacl_for_each_entry_reverse(_ace, _acl) \ + for (_ace = (_acl)->a_entries + (_acl)->a_count - 1; \ + _ace != (_acl)->a_entries - 1; \ + _ace--) + +/** + * richacl_get - grab another reference to a richacl handle + */ +static inline struct richacl * +richacl_get(struct richacl *acl) +{ + if (acl) + atomic_inc(&acl->a_refcount); + return acl; +} + +/** + * richacl_put - free a richacl handle + */ +static inline void +richacl_put(struct richacl *acl) +{ + if (acl && atomic_dec_and_test(&acl->a_refcount)) + kfree(acl); +} + +/** + * richace_is_owner - check if @ace is an OWNER@ entry + */ +static inline bool +richace_is_owner(const struct richace *ace) +{ + return (ace->e_flags & RICHACE_SPECIAL_WHO) && + ace->e_id.special == RICHACE_OWNER_SPECIAL_ID; +} + +/** + * richace_is_group - check if @ace is a GROUP@ entry + */ +static inline bool +richace_is_group(const struct richace *ace) +{ + return (ace->e_flags & RICHACE_SPECIAL_WHO) && + ace->e_id.special == RICHACE_GROUP_SPECIAL_ID; +} + +/** + * richace_is_everyone - check if @ace is an EVERYONE@ entry + */ +static inline bool +richace_is_everyone(const struct richace *ace) +{ + return (ace->e_flags & RICHACE_SPECIAL_WHO) && + ace->e_id.special == RICHACE_EVERYONE_SPECIAL_ID; +} + +/** + * richace_is_unix_user - check if @ace applies to a specific user + */ +static inline bool +richace_is_unix_user(const struct richace *ace) +{ + return !(ace->e_flags & RICHACE_SPECIAL_WHO) && + !(ace->e_flags & RICHACE_IDENTIFIER_GROUP); +} + +/** + * richace_is_unix_group - check if @ace applies to a specific group + */ +static inline bool +richace_is_unix_group(const struct richace *ace) +{ + return !(ace->e_flags & RICHACE_SPECIAL_WHO) && + (ace->e_flags & RICHACE_IDENTIFIER_GROUP); +} + +/** + * richace_is_inherit_only - check if @ace is for inheritance only + * + * ACEs with the %RICHACE_INHERIT_ONLY_ACE flag set have no effect during + * permission checking. + */ +static inline bool +richace_is_inherit_only(const struct richace *ace) +{ + return ace->e_flags & RICHACE_INHERIT_ONLY_ACE; +} + +/** + * richace_is_inheritable - check if @ace is inheritable + */ +static inline bool +richace_is_inheritable(const struct richace *ace) +{ + return ace->e_flags & (RICHACE_FILE_INHERIT_ACE | + RICHACE_DIRECTORY_INHERIT_ACE); +} + +/** + * richace_is_allow - check if @ace is an %ALLOW type entry + */ +static inline bool +richace_is_allow(const struct richace *ace) +{ + return ace->e_type == RICHACE_ACCESS_ALLOWED_ACE_TYPE; +} + +/** + * richace_is_deny - check if @ace is a %DENY type entry + */ +static inline bool +richace_is_deny(const struct richace *ace) +{ + return ace->e_type == RICHACE_ACCESS_DENIED_ACE_TYPE; +} + +/** + * richace_is_same_identifier - are both identifiers the same? + */ +static inline bool +richace_is_same_identifier(const struct richace *a, const struct richace *b) +{ + return !((a->e_flags ^ b->e_flags) & + (RICHACE_SPECIAL_WHO | RICHACE_IDENTIFIER_GROUP)) && + !memcmp(&a->e_id, &b->e_id, sizeof(a->e_id)); +} + +extern struct richacl *richacl_alloc(int, gfp_t); +extern struct richacl *richacl_clone(const struct richacl *, gfp_t); +extern void richace_copy(struct richace *, const struct richace *); + +#endif /* __RICHACL_H */ diff --git a/include/uapi/linux/Kbuild b/include/uapi/linux/Kbuild index ebd10e6..6e05dc8 100644 --- a/include/uapi/linux/Kbuild +++ b/include/uapi/linux/Kbuild @@ -351,6 +351,7 @@ header-y += reboot.h header-y += reiserfs_fs.h header-y += reiserfs_xattr.h header-y += resource.h +header-y += richacl.h header-y += rfkill.h header-y += romfs_fs.h header-y += rose.h diff --git a/include/uapi/linux/richacl.h b/include/uapi/linux/richacl.h new file mode 100644 index 0000000..08856f8 --- /dev/null +++ b/include/uapi/linux/richacl.h @@ -0,0 +1,99 @@ +/* + * Copyright (C) 2006, 2010 Novell, Inc. + * Copyright (C) 2015 Red Hat, Inc. + * Written by Andreas Gruenbacher + * + * This file is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This file is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + */ + +#ifndef __UAPI_RICHACL_H +#define __UAPI_RICHACL_H + +/* a_flags values */ +#define RICHACL_WRITE_THROUGH 0x40 +#define RICHACL_MASKED 0x80 + +/* e_type values */ +#define RICHACE_ACCESS_ALLOWED_ACE_TYPE 0x0000 +#define RICHACE_ACCESS_DENIED_ACE_TYPE 0x0001 + +/* e_flags bitflags */ +#define RICHACE_FILE_INHERIT_ACE 0x0001 +#define RICHACE_DIRECTORY_INHERIT_ACE 0x0002 +#define RICHACE_NO_PROPAGATE_INHERIT_ACE 0x0004 +#define RICHACE_INHERIT_ONLY_ACE 0x0008 +#define RICHACE_IDENTIFIER_GROUP 0x0040 +#define RICHACE_SPECIAL_WHO 0x4000 + +/* e_mask bitflags */ +#define RICHACE_READ_DATA 0x00000001 +#define RICHACE_LIST_DIRECTORY 0x00000001 +#define RICHACE_WRITE_DATA 0x00000002 +#define RICHACE_ADD_FILE 0x00000002 +#define RICHACE_APPEND_DATA 0x00000004 +#define RICHACE_ADD_SUBDIRECTORY 0x00000004 +#define RICHACE_READ_NAMED_ATTRS 0x00000008 +#define RICHACE_WRITE_NAMED_ATTRS 0x00000010 +#define RICHACE_EXECUTE 0x00000020 +#define RICHACE_DELETE_CHILD 0x00000040 +#define RICHACE_READ_ATTRIBUTES 0x00000080 +#define RICHACE_WRITE_ATTRIBUTES 0x00000100 +#define RICHACE_WRITE_RETENTION 0x00000200 +#define RICHACE_WRITE_RETENTION_HOLD 0x00000400 +#define RICHACE_DELETE 0x00010000 +#define RICHACE_READ_ACL 0x00020000 +#define RICHACE_WRITE_ACL 0x00040000 +#define RICHACE_WRITE_OWNER 0x00080000 +#define RICHACE_SYNCHRONIZE 0x00100000 + +/* e_id values */ +#define RICHACE_OWNER_SPECIAL_ID 0 +#define RICHACE_GROUP_SPECIAL_ID 1 +#define RICHACE_EVERYONE_SPECIAL_ID 2 + +#define RICHACL_VALID_FLAGS ( \ + RICHACL_WRITE_THROUGH | \ + RICHACL_MASKED ) + +#define RICHACE_VALID_FLAGS ( \ + RICHACE_FILE_INHERIT_ACE | \ + RICHACE_DIRECTORY_INHERIT_ACE | \ + RICHACE_NO_PROPAGATE_INHERIT_ACE | \ + RICHACE_INHERIT_ONLY_ACE | \ + RICHACE_IDENTIFIER_GROUP | \ + RICHACE_SPECIAL_WHO ) + +#define RICHACE_INHERITANCE_FLAGS ( \ + RICHACE_FILE_INHERIT_ACE | \ + RICHACE_DIRECTORY_INHERIT_ACE | \ + RICHACE_NO_PROPAGATE_INHERIT_ACE | \ + RICHACE_INHERIT_ONLY_ACE ) + +/* Valid RICHACE_* flags for directories and non-directories */ +#define RICHACE_VALID_MASK ( \ + RICHACE_READ_DATA | RICHACE_LIST_DIRECTORY | \ + RICHACE_WRITE_DATA | RICHACE_ADD_FILE | \ + RICHACE_APPEND_DATA | RICHACE_ADD_SUBDIRECTORY | \ + RICHACE_READ_NAMED_ATTRS | \ + RICHACE_WRITE_NAMED_ATTRS | \ + RICHACE_EXECUTE | \ + RICHACE_DELETE_CHILD | \ + RICHACE_READ_ATTRIBUTES | \ + RICHACE_WRITE_ATTRIBUTES | \ + RICHACE_WRITE_RETENTION | \ + RICHACE_WRITE_RETENTION_HOLD | \ + RICHACE_DELETE | \ + RICHACE_READ_ACL | \ + RICHACE_WRITE_ACL | \ + RICHACE_WRITE_OWNER | \ + RICHACE_SYNCHRONIZE ) + +#endif /* __UAPI_RICHACL_H */ -- 2.4.3 From agruenba@redhat.com Mon Feb 29 02:18:00 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=ham version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay3.corp.sgi.com [198.149.34.15]) by oss.sgi.com (Postfix) with ESMTP id 36B187CBA for ; Mon, 29 Feb 2016 02:18:00 -0600 (CST) Received: from cuda.sgi.com (cuda2.sgi.com [192.48.176.25]) by relay3.corp.sgi.com (Postfix) with ESMTP id 912AFAC002 for ; Mon, 29 Feb 2016 00:17:59 -0800 (PST) X-ASG-Debug-ID: 1456733877-04cbb00b728c820001-NocioJ Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by cuda.sgi.com with ESMTP id jZAtYPs1lezm6Q8O (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO) for ; Mon, 29 Feb 2016 00:17:57 -0800 (PST) X-Barracuda-Envelope-From: agruenba@redhat.com X-Barracuda-Apparent-Source-IP: 209.132.183.28 X-ASG-Whitelist: Client Received: from int-mx09.intmail.prod.int.phx2.redhat.com (int-mx09.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by mx1.redhat.com (Postfix) with ESMTPS id 3FA21627C3; Mon, 29 Feb 2016 08:17:57 +0000 (UTC) Received: from schleppi.home.com (vpn1-4-25.ams2.redhat.com [10.36.4.25]) by int-mx09.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id u1T8HS6C028000; Mon, 29 Feb 2016 03:17:53 -0500 From: Andreas Gruenbacher To: Alexander Viro Cc: "J. Bruce Fields" , linux-nfs@vger.kernel.org, "Theodore Ts'o" , linux-cifs@vger.kernel.org, linux-api@vger.kernel.org, Trond Myklebust , linux-kernel@vger.kernel.org, xfs@oss.sgi.com, Christoph Hellwig , Andreas Dilger , linux-fsdevel@vger.kernel.org, Jeff Layton , linux-ext4@vger.kernel.org, Anna Schumaker Subject: [PATCH v18 07/22] richacl: Permission mapping functions Date: Mon, 29 Feb 2016 09:17:12 +0100 X-ASG-Orig-Subj: [PATCH v18 07/22] richacl: Permission mapping functions Message-Id: <1456733847-17982-8-git-send-email-agruenba@redhat.com> In-Reply-To: <1456733847-17982-1-git-send-email-agruenba@redhat.com> References: <1456733847-17982-1-git-send-email-agruenba@redhat.com> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.22 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.38]); Mon, 29 Feb 2016 08:17:57 +0000 (UTC) X-Barracuda-Connect: mx1.redhat.com[209.132.183.28] X-Barracuda-Start-Time: 1456733877 X-Barracuda-Encrypted: ECDHE-RSA-AES256-GCM-SHA384 X-Barracuda-URL: https://192.48.176.25:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-BRTS-Status: 1 We need to map from POSIX permissions to NFSv4 permissions when a chmod() is done, from NFSv4 permissions to POSIX permissions when an acl is set (which implicitly sets the file permission bits), and from the MAY_READ/MAY_WRITE/MAY_EXEC/MAY_APPEND flags to NFSv4 permissions when doing an access check in a richacl. Signed-off-by: Andreas Gruenbacher Reviewed-by: J. Bruce Fields --- fs/richacl_base.c | 118 +++++++++++++++++++++++++++++++++++++++++++ include/linux/richacl.h | 3 ++ include/uapi/linux/richacl.h | 44 ++++++++++++++++ 3 files changed, 165 insertions(+) diff --git a/fs/richacl_base.c b/fs/richacl_base.c index c3ec928..a393001 100644 --- a/fs/richacl_base.c +++ b/fs/richacl_base.c @@ -65,3 +65,121 @@ richace_copy(struct richace *to, const struct richace *from) { memcpy(to, from, sizeof(struct richace)); } + +/* + * richacl_mask_to_mode - compute the file permission bits from mask + * @mask: %RICHACE_* permission mask + * + * Compute the file permission bits corresponding to a particular set of + * richacl permissions. + * + * See richacl_masks_to_mode(). + */ +static int +richacl_mask_to_mode(unsigned int mask) +{ + int mode = 0; + + if (mask & RICHACE_POSIX_MODE_READ) + mode |= S_IROTH; + if (mask & RICHACE_POSIX_MODE_WRITE) + mode |= S_IWOTH; + if (mask & RICHACE_POSIX_MODE_EXEC) + mode |= S_IXOTH; + + return mode; +} + +/** + * richacl_masks_to_mode - compute file permission bits from file masks + * + * When setting a richacl, we set the file permission bits to indicate maximum + * permissions: for example, we set the Write permission when a mask contains + * RICHACE_APPEND_DATA even if it does not also contain RICHACE_WRITE_DATA. + * + * Permissions which are not in RICHACE_POSIX_MODE_READ, + * RICHACE_POSIX_MODE_WRITE, or RICHACE_POSIX_MODE_EXEC cannot be represented + * in the file permission bits. Such permissions can still be effective, but + * not for new files or after a chmod(); they must be explicitly enabled in the + * richacl. + */ +int +richacl_masks_to_mode(const struct richacl *acl) +{ + return richacl_mask_to_mode(acl->a_owner_mask) << 6 | + richacl_mask_to_mode(acl->a_group_mask) << 3 | + richacl_mask_to_mode(acl->a_other_mask); +} +EXPORT_SYMBOL_GPL(richacl_masks_to_mode); + +/** + * richacl_mode_to_mask - compute a file mask from the lowest three mode bits + * @mode: mode to convert to richacl permissions + * + * When the file permission bits of a file are set with chmod(), this specifies + * the maximum permissions that processes will get. All permissions beyond + * that will be removed from the file masks, and become ineffective. + */ +unsigned int +richacl_mode_to_mask(umode_t mode) +{ + unsigned int mask = 0; + + if (mode & S_IROTH) + mask |= RICHACE_POSIX_MODE_READ; + if (mode & S_IWOTH) + mask |= RICHACE_POSIX_MODE_WRITE; + if (mode & S_IXOTH) + mask |= RICHACE_POSIX_MODE_EXEC; + + return mask; +} + +/** + * richacl_want_to_mask - convert the iop->permission want argument to a mask + * @want: @want argument of the permission inode operation + * + * When checking for append, @want is (MAY_WRITE | MAY_APPEND). + * + * Richacls use the iop->may_create and iop->may_delete hooks which are used + * for checking if creating and deleting files is allowed. These hooks do not + * use richacl_want_to_mask(), so we do not have to deal with mapping MAY_WRITE + * to RICHACE_ADD_FILE, RICHACE_ADD_SUBDIRECTORY, and RICHACE_DELETE_CHILD + * here. + */ +unsigned int +richacl_want_to_mask(unsigned int want) +{ + unsigned int mask = 0; + + if (want & MAY_READ) + mask |= RICHACE_READ_DATA; + if (want & MAY_DELETE_SELF) + mask |= RICHACE_DELETE; + if (want & MAY_TAKE_OWNERSHIP) + mask |= RICHACE_WRITE_OWNER; + if (want & MAY_CHMOD) + mask |= RICHACE_WRITE_ACL; + if (want & MAY_SET_TIMES) + mask |= RICHACE_WRITE_ATTRIBUTES; + if (want & MAY_EXEC) + mask |= RICHACE_EXECUTE; + /* + * differentiate MAY_WRITE from these request + */ + if (want & (MAY_APPEND | + MAY_CREATE_FILE | MAY_CREATE_DIR | + MAY_DELETE_CHILD)) { + if (want & MAY_APPEND) + mask |= RICHACE_APPEND_DATA; + if (want & MAY_CREATE_FILE) + mask |= RICHACE_ADD_FILE; + if (want & MAY_CREATE_DIR) + mask |= RICHACE_ADD_SUBDIRECTORY; + if (want & MAY_DELETE_CHILD) + mask |= RICHACE_DELETE_CHILD; + } else if (want & MAY_WRITE) + mask |= RICHACE_WRITE_DATA; + return mask; +} +EXPORT_SYMBOL_GPL(richacl_want_to_mask); diff --git a/include/linux/richacl.h b/include/linux/richacl.h index edb8480..9102ef0 100644 --- a/include/linux/richacl.h +++ b/include/linux/richacl.h @@ -175,5 +175,8 @@ richace_is_same_identifier(const struct richace *a, const struct richace *b) extern struct richacl *richacl_alloc(int, gfp_t); extern struct richacl *richacl_clone(const struct richacl *, gfp_t); extern void richace_copy(struct richace *, const struct richace *); +extern int richacl_masks_to_mode(const struct richacl *); +extern unsigned int richacl_mode_to_mask(umode_t); +extern unsigned int richacl_want_to_mask(unsigned int); #endif /* __RICHACL_H */ diff --git a/include/uapi/linux/richacl.h b/include/uapi/linux/richacl.h index 08856f8..1ed48ac 100644 --- a/include/uapi/linux/richacl.h +++ b/include/uapi/linux/richacl.h @@ -96,4 +96,48 @@ RICHACE_WRITE_OWNER | \ RICHACE_SYNCHRONIZE ) +/* + * The POSIX permissions are supersets of the following richacl permissions: + * + * - MAY_READ maps to READ_DATA or LIST_DIRECTORY, depending on the type + * of the file system object. + * + * - MAY_WRITE maps to WRITE_DATA or RICHACE_APPEND_DATA for files, and to + * ADD_FILE, RICHACE_ADD_SUBDIRECTORY, or RICHACE_DELETE_CHILD for directories. + * + * - MAY_EXECUTE maps to RICHACE_EXECUTE. + * + * (Some of these richacl permissions have the same bit values.) + */ +#define RICHACE_POSIX_MODE_READ ( \ + RICHACE_READ_DATA | \ + RICHACE_LIST_DIRECTORY) +#define RICHACE_POSIX_MODE_WRITE ( \ + RICHACE_WRITE_DATA | \ + RICHACE_ADD_FILE | \ + RICHACE_APPEND_DATA | \ + RICHACE_ADD_SUBDIRECTORY | \ + RICHACE_DELETE_CHILD) +#define RICHACE_POSIX_MODE_EXEC RICHACE_EXECUTE +#define RICHACE_POSIX_MODE_ALL ( \ + RICHACE_POSIX_MODE_READ | \ + RICHACE_POSIX_MODE_WRITE | \ + RICHACE_POSIX_MODE_EXEC) + +/* + * These permissions are always allowed no matter what the acl says. + */ +#define RICHACE_POSIX_ALWAYS_ALLOWED ( \ + RICHACE_SYNCHRONIZE | \ + RICHACE_READ_ATTRIBUTES | \ + RICHACE_READ_ACL) + +/* + * The owner is implicitly granted these permissions under POSIX. + */ +#define RICHACE_POSIX_OWNER_ALLOWED ( \ + RICHACE_WRITE_ATTRIBUTES | \ + RICHACE_WRITE_OWNER | \ + RICHACE_WRITE_ACL) + #endif /* __UAPI_RICHACL_H */ -- 2.4.3 From agruenba@redhat.com Mon Feb 29 02:18:03 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=ham version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay2.corp.sgi.com [137.38.102.29]) by oss.sgi.com (Postfix) with ESMTP id 55FF07F51 for ; Mon, 29 Feb 2016 02:18:03 -0600 (CST) Received: from cuda.sgi.com (cuda2.sgi.com [192.48.176.25]) by relay2.corp.sgi.com (Postfix) with ESMTP id 1E17F304032 for ; Mon, 29 Feb 2016 00:18:03 -0800 (PST) X-ASG-Debug-ID: 1456733881-04cbb00b708c820001-NocioJ Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by cuda.sgi.com with ESMTP id WUS46JLUP2lSkPp8 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO) for ; Mon, 29 Feb 2016 00:18:01 -0800 (PST) X-Barracuda-Envelope-From: agruenba@redhat.com X-Barracuda-Apparent-Source-IP: 209.132.183.28 X-ASG-Whitelist: Client Received: from int-mx09.intmail.prod.int.phx2.redhat.com (int-mx09.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by mx1.redhat.com (Postfix) with ESMTPS id 183A4C0005CF; Mon, 29 Feb 2016 08:18:01 +0000 (UTC) Received: from schleppi.home.com (vpn1-4-25.ams2.redhat.com [10.36.4.25]) by int-mx09.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id u1T8HS6D028000; Mon, 29 Feb 2016 03:17:57 -0500 From: Andreas Gruenbacher To: Alexander Viro Cc: "J. Bruce Fields" , linux-nfs@vger.kernel.org, "Theodore Ts'o" , linux-cifs@vger.kernel.org, linux-api@vger.kernel.org, Trond Myklebust , linux-kernel@vger.kernel.org, xfs@oss.sgi.com, Christoph Hellwig , Andreas Dilger , linux-fsdevel@vger.kernel.org, Jeff Layton , linux-ext4@vger.kernel.org, Anna Schumaker Subject: [PATCH v18 08/22] richacl: Compute maximum file masks from an acl Date: Mon, 29 Feb 2016 09:17:13 +0100 X-ASG-Orig-Subj: [PATCH v18 08/22] richacl: Compute maximum file masks from an acl Message-Id: <1456733847-17982-9-git-send-email-agruenba@redhat.com> In-Reply-To: <1456733847-17982-1-git-send-email-agruenba@redhat.com> References: <1456733847-17982-1-git-send-email-agruenba@redhat.com> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.22 X-Barracuda-Connect: mx1.redhat.com[209.132.183.28] X-Barracuda-Start-Time: 1456733881 X-Barracuda-Encrypted: ECDHE-RSA-AES256-GCM-SHA384 X-Barracuda-URL: https://192.48.176.25:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-BRTS-Status: 1 Compute upper bound owner, group, and other file masks with as few permissions as possible without denying any permissions that the NFSv4 acl in a richacl grants. This algorithm is used when a file inherits an acl at create time and when an acl is set via a mechanism that does not provide file masks (such as setting an acl via nfsd). When user-space sets an acl via setxattr, the extended attribute already includes the file masks. Setting an acl also sets the file mode permission bits: they are determined by the file masks; see richacl_masks_to_mode(). Signed-off-by: Andreas Gruenbacher Reviewed-by: J. Bruce Fields --- fs/richacl_base.c | 157 ++++++++++++++++++++++++++++++++++++++++++++++++ include/linux/richacl.h | 1 + 2 files changed, 158 insertions(+) diff --git a/fs/richacl_base.c b/fs/richacl_base.c index a393001..69b806c 100644 --- a/fs/richacl_base.c +++ b/fs/richacl_base.c @@ -183,3 +183,160 @@ richacl_want_to_mask(unsigned int want) return mask; } EXPORT_SYMBOL_GPL(richacl_want_to_mask); + +/* + * Note: functions like richacl_allowed_to_who(), richacl_group_class_allowed(), + * and richacl_compute_max_masks() iterate through the entire acl in reverse + * order as an optimization. + * + * In the standard algorithm, aces are considered in forward order. When a + * process matches an ace, the permissions in the ace are either allowed or + * denied depending on the ace type. Once a permission has been allowed or + * denied, it is no longer considered in further aces. + * + * By iterating through the acl in reverse order, we can compute the same + * result without having to keep track of which permissions have been allowed + * and denied already. + */ + +/** + * richacl_allowed_to_who - permissions allowed to a specific who value + * + * Compute the maximum mask values allowed to a specific who value, taking + * everyone@ aces into account. + */ +static unsigned int richacl_allowed_to_who(struct richacl *acl, + struct richace *who) +{ + struct richace *ace; + unsigned int allowed = 0; + + richacl_for_each_entry_reverse(ace, acl) { + if (richace_is_inherit_only(ace)) + continue; + if (richace_is_same_identifier(ace, who) || + richace_is_everyone(ace)) { + if (richace_is_allow(ace)) + allowed |= ace->e_mask; + else if (richace_is_deny(ace)) + allowed &= ~ace->e_mask; + } + } + return allowed; +} + +/** + * richacl_group_class_allowed - maximum permissions of the group class + * + * Compute the maximum mask values allowed to a process in the group class + * (i.e., a process which is not the owner but is in the owning group or + * matches a user or group acl entry). This includes permissions granted or + * denied by everyone@ aces. + * + * See richacl_compute_max_masks(). + */ +static unsigned int richacl_group_class_allowed(struct richacl *acl) +{ + struct richace *ace; + unsigned int everyone_allowed = 0, group_class_allowed = 0; + int had_group_ace = 0; + + richacl_for_each_entry_reverse(ace, acl) { + if (richace_is_inherit_only(ace) || + richace_is_owner(ace)) + continue; + + if (richace_is_everyone(ace)) { + if (richace_is_allow(ace)) + everyone_allowed |= ace->e_mask; + else if (richace_is_deny(ace)) + everyone_allowed &= ~ace->e_mask; + } else { + group_class_allowed |= + richacl_allowed_to_who(acl, ace); + + if (richace_is_group(ace)) + had_group_ace = 1; + } + } + /* + * If the acl doesn't contain any group@ aces, richacl_allowed_to_who() + * wasn't called for the owning group. We could make that call now, but + * we already know the result (everyone_allowed). + */ + if (!had_group_ace) + group_class_allowed |= everyone_allowed; + return group_class_allowed; +} + +/** + * richacl_compute_max_masks - compute upper bound masks + * + * Computes upper bound owner, group, and other masks so that none of the + * permissions allowed by the acl are disabled. + * + * We don't make assumptions about who the owner is so that the owner can + * change with no effect on the file masks or file mode permission bits; this + * means that we must assume that all entries can match the owner. + */ +void richacl_compute_max_masks(struct richacl *acl) +{ + unsigned int gmask = ~0; + struct richace *ace; + + /* + * @gmask contains all permissions which the group class is ever + * allowed. We use it to avoid adding permissions to the group mask + * from everyone@ allow aces which the group class is always denied + * through other aces. For example, the following acl would otherwise + * result in a group mask of rw: + * + * group@:w::deny + * everyone@:rw::allow + * + * Avoid computing @gmask for acls which do not include any group class + * deny aces: in such acls, the group class is never denied any + * permissions from everyone@ allow aces, and the group class cannot + * have fewer permissions than the other class. + */ + +restart: + acl->a_owner_mask = 0; + acl->a_group_mask = 0; + acl->a_other_mask = 0; + + richacl_for_each_entry_reverse(ace, acl) { + if (richace_is_inherit_only(ace)) + continue; + + if (richace_is_owner(ace)) { + if (richace_is_allow(ace)) + acl->a_owner_mask |= ace->e_mask; + else if (richace_is_deny(ace)) + acl->a_owner_mask &= ~ace->e_mask; + } else if (richace_is_everyone(ace)) { + if (richace_is_allow(ace)) { + acl->a_owner_mask |= ace->e_mask; + acl->a_group_mask |= ace->e_mask & gmask; + acl->a_other_mask |= ace->e_mask; + } else if (richace_is_deny(ace)) { + acl->a_owner_mask &= ~ace->e_mask; + acl->a_group_mask &= ~ace->e_mask; + acl->a_other_mask &= ~ace->e_mask; + } + } else { + if (richace_is_allow(ace)) { + acl->a_owner_mask |= ace->e_mask & gmask; + acl->a_group_mask |= ace->e_mask & gmask; + } else if (richace_is_deny(ace) && gmask == ~0) { + gmask = richacl_group_class_allowed(acl); + if (likely(gmask != ~0)) + /* should always be true */ + goto restart; + } + } + } + + acl->a_flags &= ~(RICHACL_WRITE_THROUGH | RICHACL_MASKED); +} +EXPORT_SYMBOL_GPL(richacl_compute_max_masks); diff --git a/include/linux/richacl.h b/include/linux/richacl.h index 9102ef0..3559b2c 100644 --- a/include/linux/richacl.h +++ b/include/linux/richacl.h @@ -178,5 +178,6 @@ extern void richace_copy(struct richace *, const struct richace *); extern int richacl_masks_to_mode(const struct richacl *); extern unsigned int richacl_mode_to_mask(umode_t); extern unsigned int richacl_want_to_mask(unsigned int); +extern void richacl_compute_max_masks(struct richacl *); #endif /* __RICHACL_H */ -- 2.4.3 From agruenba@redhat.com Mon Feb 29 02:18:07 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=ham version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay3.corp.sgi.com [198.149.34.15]) by oss.sgi.com (Postfix) with ESMTP id 5B2107CA0 for ; Mon, 29 Feb 2016 02:18:07 -0600 (CST) Received: from cuda.sgi.com (cuda2.sgi.com [192.48.176.25]) by relay3.corp.sgi.com (Postfix) with ESMTP id B80DBAC002 for ; Mon, 29 Feb 2016 00:18:06 -0800 (PST) X-ASG-Debug-ID: 1456733884-04cbb00b6f8c820001-NocioJ Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by cuda.sgi.com with ESMTP id b6IPqp5xBNy5UimM (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO) for ; Mon, 29 Feb 2016 00:18:05 -0800 (PST) X-Barracuda-Envelope-From: agruenba@redhat.com X-Barracuda-Apparent-Source-IP: 209.132.183.28 X-ASG-Whitelist: Client Received: from int-mx09.intmail.prod.int.phx2.redhat.com (int-mx09.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by mx1.redhat.com (Postfix) with ESMTPS id 9306C7F099; Mon, 29 Feb 2016 08:18:04 +0000 (UTC) Received: from schleppi.home.com (vpn1-4-25.ams2.redhat.com [10.36.4.25]) by int-mx09.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id u1T8HS6E028000; Mon, 29 Feb 2016 03:18:01 -0500 From: Andreas Gruenbacher To: Alexander Viro Cc: "J. Bruce Fields" , linux-nfs@vger.kernel.org, "Theodore Ts'o" , linux-cifs@vger.kernel.org, linux-api@vger.kernel.org, Trond Myklebust , linux-kernel@vger.kernel.org, xfs@oss.sgi.com, Christoph Hellwig , Andreas Dilger , linux-fsdevel@vger.kernel.org, Jeff Layton , linux-ext4@vger.kernel.org, Anna Schumaker Subject: [PATCH v18 09/22] richacl: Permission check algorithm Date: Mon, 29 Feb 2016 09:17:14 +0100 X-ASG-Orig-Subj: [PATCH v18 09/22] richacl: Permission check algorithm Message-Id: <1456733847-17982-10-git-send-email-agruenba@redhat.com> In-Reply-To: <1456733847-17982-1-git-send-email-agruenba@redhat.com> References: <1456733847-17982-1-git-send-email-agruenba@redhat.com> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.22 X-Barracuda-Connect: mx1.redhat.com[209.132.183.28] X-Barracuda-Start-Time: 1456733885 X-Barracuda-Encrypted: ECDHE-RSA-AES256-GCM-SHA384 X-Barracuda-URL: https://192.48.176.25:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-BRTS-Status: 1 A richacl roughly grants a requested access if the NFSv4 acl in the richacl grants the requested permissions according to the NFSv4 permission check algorithm and the file mask that applies to the process includes the requested permissions. Signed-off-by: Andreas Gruenbacher Reviewed-by: "J. Bruce Fields" --- fs/Makefile | 2 +- fs/richacl_inode.c | 149 ++++++++++++++++++++++++++++++++++++++++++++++++ include/linux/richacl.h | 3 + 3 files changed, 153 insertions(+), 1 deletion(-) create mode 100644 fs/richacl_inode.c diff --git a/fs/Makefile b/fs/Makefile index e5994c4..d5b45ca 100644 --- a/fs/Makefile +++ b/fs/Makefile @@ -49,7 +49,7 @@ obj-$(CONFIG_SYSCTL) += drop_caches.o obj-$(CONFIG_FHANDLE) += fhandle.o obj-$(CONFIG_FS_RICHACL) += richacl.o -richacl-y := richacl_base.o +richacl-y := richacl_base.o richacl_inode.o obj-y += quota/ diff --git a/fs/richacl_inode.c b/fs/richacl_inode.c new file mode 100644 index 0000000..99b3c93 --- /dev/null +++ b/fs/richacl_inode.c @@ -0,0 +1,149 @@ +/* + * Copyright (C) 2010 Novell, Inc. + * Copyright (C) 2015 Red Hat, Inc. + * Written by Andreas Gruenbacher + * + * This program is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License as published by the + * Free Software Foundation; either version 2, or (at your option) any + * later version. + * + * This program is distributed in the hope that it will be useful, but + * WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * General Public License for more details. + */ + +#include +#include +#include +#include +#include + +/** + * richacl_permission - richacl permission check algorithm + * @inode: inode to check + * @acl: rich acl of the inode + * @want: requested access (MAY_* flags) + * + * Checks if the current process is granted @mask flags in @acl. + */ +int +richacl_permission(struct inode *inode, const struct richacl *acl, + int want) +{ + const struct richace *ace; + unsigned int mask = richacl_want_to_mask(want); + unsigned int requested = mask, denied = 0; + int in_owning_group = in_group_p(inode->i_gid); + int in_owner_or_group_class = in_owning_group; + + /* + * A process is + * - in the owner file class if it owns the file, + * - in the group file class if it is in the file's owning group or + * it matches any of the user or group entries, and + * - in the other file class otherwise. + * The file class is only relevant for determining which file mask to + * apply, which only happens for masked acls. + */ + if (acl->a_flags & RICHACL_MASKED) { + if ((acl->a_flags & RICHACL_WRITE_THROUGH) && + uid_eq(current_fsuid(), inode->i_uid)) { + denied = requested & ~acl->a_owner_mask; + goto out; + } + } else { + /* + * When the acl is not masked, there is no need to determine if + * the process is in the group class and we can break out + * earlier of the loop below. + */ + in_owner_or_group_class = 1; + } + + /* + * Check if the acl grants the requested access and determine which + * file class the process is in. + */ + richacl_for_each_entry(ace, acl) { + unsigned int ace_mask = ace->e_mask; + + if (richace_is_inherit_only(ace)) + continue; + if (richace_is_owner(ace)) { + if (!uid_eq(current_fsuid(), inode->i_uid)) + continue; + goto entry_matches_owner; + } else if (richace_is_group(ace)) { + if (!in_owning_group) + continue; + } else if (richace_is_unix_user(ace)) { + if (!uid_eq(current_fsuid(), ace->e_id.uid)) + continue; + if (uid_eq(current_fsuid(), inode->i_uid)) + goto entry_matches_owner; + } else if (richace_is_unix_group(ace)) { + if (!in_group_p(ace->e_id.gid)) + continue; + } else + goto entry_matches_everyone; + + /* + * Apply the group file mask to entries other than owner@ and + * everyone@ or user entries matching the owner. This ensures + * that we grant the same permissions as the acl computed by + * richacl_apply_masks(). + * + * Without this restriction, the following richacl would grant + * rw access to processes which are both the owner and in the + * owning group, but not to other users in the owning group, + * which could not be represented without masks: + * + * owner:rw::mask + * group@:rw::allow + */ + if ((acl->a_flags & RICHACL_MASKED) && richace_is_allow(ace)) + ace_mask &= acl->a_group_mask; + +entry_matches_owner: + /* The process is in the owner or group file class. */ + in_owner_or_group_class = 1; + +entry_matches_everyone: + /* Check which mask flags the ACE allows or denies. */ + if (richace_is_deny(ace)) + denied |= ace_mask & mask; + mask &= ~ace_mask; + + /* + * Keep going until we know which file class + * the process is in. + */ + if (!mask && in_owner_or_group_class) + break; + } + denied |= mask; + + if (acl->a_flags & RICHACL_MASKED) { + /* + * The file class a process is in determines which file mask + * applies. Check if that file mask also grants the requested + * access. + */ + if (uid_eq(current_fsuid(), inode->i_uid)) + denied |= requested & ~acl->a_owner_mask; + else if (in_owner_or_group_class) + denied |= requested & ~acl->a_group_mask; + else { + if (acl->a_flags & RICHACL_WRITE_THROUGH) + denied = requested & ~acl->a_other_mask; + else + denied |= requested & ~acl->a_other_mask; + } + } + +out: + return denied ? -EACCES : 0; +} +EXPORT_SYMBOL_GPL(richacl_permission); diff --git a/include/linux/richacl.h b/include/linux/richacl.h index 3559b2c..1d9f5f7 100644 --- a/include/linux/richacl.h +++ b/include/linux/richacl.h @@ -180,4 +180,7 @@ extern unsigned int richacl_mode_to_mask(umode_t); extern unsigned int richacl_want_to_mask(unsigned int); extern void richacl_compute_max_masks(struct richacl *); +/* richacl_inode.c */ +extern int richacl_permission(struct inode *, const struct richacl *, int); + #endif /* __RICHACL_H */ -- 2.4.3 From agruenba@redhat.com Mon Feb 29 02:18:09 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=ham version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay1.corp.sgi.com [137.38.102.111]) by oss.sgi.com (Postfix) with ESMTP id EF8D87F5A for ; Mon, 29 Feb 2016 02:18:09 -0600 (CST) Received: from cuda.sgi.com (cuda3.sgi.com [192.48.176.15]) by relay1.corp.sgi.com (Postfix) with ESMTP id C55668F8037 for ; Mon, 29 Feb 2016 00:18:09 -0800 (PST) X-ASG-Debug-ID: 1456733888-04cb6c5833782e0001-NocioJ Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by cuda.sgi.com with ESMTP id bksSGSdGsd3Vlc1Q (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO) for ; Mon, 29 Feb 2016 00:18:08 -0800 (PST) X-Barracuda-Envelope-From: agruenba@redhat.com X-Barracuda-Apparent-Source-IP: 209.132.183.28 X-ASG-Whitelist: Client Received: from int-mx09.intmail.prod.int.phx2.redhat.com (int-mx09.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by mx1.redhat.com (Postfix) with ESMTPS id 14ED88EA39; Mon, 29 Feb 2016 08:18:08 +0000 (UTC) Received: from schleppi.home.com (vpn1-4-25.ams2.redhat.com [10.36.4.25]) by int-mx09.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id u1T8HS6F028000; Mon, 29 Feb 2016 03:18:04 -0500 From: Andreas Gruenbacher To: Alexander Viro Cc: "J. Bruce Fields" , linux-nfs@vger.kernel.org, "Theodore Ts'o" , linux-cifs@vger.kernel.org, linux-api@vger.kernel.org, Trond Myklebust , linux-kernel@vger.kernel.org, xfs@oss.sgi.com, Christoph Hellwig , Andreas Dilger , linux-fsdevel@vger.kernel.org, Jeff Layton , linux-ext4@vger.kernel.org, Anna Schumaker Subject: [PATCH v18 10/22] posix_acl: Unexport acl_by_type and make it static Date: Mon, 29 Feb 2016 09:17:15 +0100 X-ASG-Orig-Subj: [PATCH v18 10/22] posix_acl: Unexport acl_by_type and make it static Message-Id: <1456733847-17982-11-git-send-email-agruenba@redhat.com> In-Reply-To: <1456733847-17982-1-git-send-email-agruenba@redhat.com> References: <1456733847-17982-1-git-send-email-agruenba@redhat.com> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.22 X-Barracuda-Connect: mx1.redhat.com[209.132.183.28] X-Barracuda-Start-Time: 1456733888 X-Barracuda-Encrypted: ECDHE-RSA-AES256-GCM-SHA384 X-Barracuda-URL: https://192.48.176.15:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-BRTS-Status: 1 acl_by_type(inode, type) returns a pointer to either inode->i_acl or inode->i_default_acl depending on type. This is useful in fs/posix_acl.c, but should never have been visible outside that file. Signed-off-by: Andreas Gruenbacher --- fs/posix_acl.c | 3 +-- include/linux/posix_acl.h | 1 - 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/fs/posix_acl.c b/fs/posix_acl.c index 711dd51..55f2445 100644 --- a/fs/posix_acl.c +++ b/fs/posix_acl.c @@ -21,7 +21,7 @@ #include #include -struct posix_acl **acl_by_type(struct inode *inode, int type) +static struct posix_acl **acl_by_type(struct inode *inode, int type) { switch (type) { case ACL_TYPE_ACCESS: @@ -32,7 +32,6 @@ struct posix_acl **acl_by_type(struct inode *inode, int type) BUG(); } } -EXPORT_SYMBOL(acl_by_type); struct posix_acl *get_cached_acl(struct inode *inode, int type) { diff --git a/include/linux/posix_acl.h b/include/linux/posix_acl.h index 3e96a6a..5b5a80c 100644 --- a/include/linux/posix_acl.h +++ b/include/linux/posix_acl.h @@ -99,7 +99,6 @@ extern int posix_acl_create(struct inode *, umode_t *, struct posix_acl **, extern int simple_set_acl(struct inode *, struct posix_acl *, int); extern int simple_acl_create(struct inode *, struct inode *); -struct posix_acl **acl_by_type(struct inode *inode, int type); struct posix_acl *get_cached_acl(struct inode *inode, int type); struct posix_acl *get_cached_acl_rcu(struct inode *inode, int type); void set_cached_acl(struct inode *inode, int type, struct posix_acl *acl); -- 2.4.3 From agruenba@redhat.com Mon Feb 29 02:18:14 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=ham version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay3.corp.sgi.com [198.149.34.15]) by oss.sgi.com (Postfix) with ESMTP id A306B7CA0 for ; Mon, 29 Feb 2016 02:18:14 -0600 (CST) Received: from cuda.sgi.com (cuda1.sgi.com [192.48.157.11]) by relay3.corp.sgi.com (Postfix) with ESMTP id 324FEAC002 for ; Mon, 29 Feb 2016 00:18:14 -0800 (PST) X-ASG-Debug-ID: 1456733892-04bdf002ee8aae0001-NocioJ Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by cuda.sgi.com with ESMTP id UHTtTpWi27CsqGEy (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO) for ; Mon, 29 Feb 2016 00:18:12 -0800 (PST) X-Barracuda-Envelope-From: agruenba@redhat.com X-Barracuda-Apparent-Source-IP: 209.132.183.28 X-ASG-Whitelist: Client Received: from int-mx09.intmail.prod.int.phx2.redhat.com (int-mx09.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by mx1.redhat.com (Postfix) with ESMTPS id 38F7319CBAA; Mon, 29 Feb 2016 08:18:12 +0000 (UTC) Received: from schleppi.home.com (vpn1-4-25.ams2.redhat.com [10.36.4.25]) by int-mx09.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id u1T8HS6G028000; Mon, 29 Feb 2016 03:18:08 -0500 From: Andreas Gruenbacher To: Alexander Viro Cc: "J. Bruce Fields" , linux-nfs@vger.kernel.org, "Theodore Ts'o" , linux-cifs@vger.kernel.org, linux-api@vger.kernel.org, Trond Myklebust , linux-kernel@vger.kernel.org, xfs@oss.sgi.com, Christoph Hellwig , Andreas Dilger , linux-fsdevel@vger.kernel.org, Jeff Layton , linux-ext4@vger.kernel.org, Anna Schumaker Subject: [PATCH v18 11/22] vfs: Cache base_acl objects in inodes Date: Mon, 29 Feb 2016 09:17:16 +0100 X-ASG-Orig-Subj: [PATCH v18 11/22] vfs: Cache base_acl objects in inodes Message-Id: <1456733847-17982-12-git-send-email-agruenba@redhat.com> In-Reply-To: <1456733847-17982-1-git-send-email-agruenba@redhat.com> References: <1456733847-17982-1-git-send-email-agruenba@redhat.com> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.22 X-Barracuda-Connect: mx1.redhat.com[209.132.183.28] X-Barracuda-Start-Time: 1456733892 X-Barracuda-Encrypted: ECDHE-RSA-AES256-GCM-SHA384 X-Barracuda-URL: https://192.48.157.11:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-BRTS-Status: 1 POSIX ACLs and richacls are both objects allocated by kmalloc() with a reference count which are freed by kfree_rcu(). An inode can either cache an access and a default POSIX ACL, or a richacl (richacls do not have default acls). To allow an inode to cache either of the two kinds of acls, introduce a new base_acl type and convert i_acl and i_default_acl to that type. In most cases, the vfs then doesn't care which kind of acl an inode caches (if any). Signed-off-by: Andreas Gruenbacher Reviewed-by: Andreas Dilger --- drivers/staging/lustre/lustre/llite/llite_lib.c | 2 +- fs/f2fs/acl.c | 4 +-- fs/inode.c | 4 +-- fs/jffs2/acl.c | 10 ++++-- fs/posix_acl.c | 41 +++++++++++++------------ fs/richacl_base.c | 4 +-- include/linux/fs.h | 34 ++++++++++++++++++-- include/linux/posix_acl.h | 12 +++----- include/linux/richacl.h | 9 +++--- 9 files changed, 75 insertions(+), 45 deletions(-) diff --git a/drivers/staging/lustre/lustre/llite/llite_lib.c b/drivers/staging/lustre/lustre/llite/llite_lib.c index b2fc5b3..b587944 100644 --- a/drivers/staging/lustre/lustre/llite/llite_lib.c +++ b/drivers/staging/lustre/lustre/llite/llite_lib.c @@ -1073,7 +1073,7 @@ void ll_clear_inode(struct inode *inode) } #ifdef CONFIG_FS_POSIX_ACL else if (lli->lli_posix_acl) { - LASSERT(atomic_read(&lli->lli_posix_acl->a_refcount) == 1); + LASSERT(base_acl_refcount(&lli->lli_posix_acl->a_base) == 1); LASSERT(lli->lli_remote_perms == NULL); posix_acl_release(lli->lli_posix_acl); lli->lli_posix_acl = NULL; diff --git a/fs/f2fs/acl.c b/fs/f2fs/acl.c index c8f25f7..9646197 100644 --- a/fs/f2fs/acl.c +++ b/fs/f2fs/acl.c @@ -270,7 +270,7 @@ static struct posix_acl *f2fs_acl_clone(const struct posix_acl *acl, sizeof(struct posix_acl_entry); clone = kmemdup(acl, size, flags); if (clone) - atomic_set(&clone->a_refcount, 1); + base_acl_init(&clone->a_base); } return clone; } @@ -282,7 +282,7 @@ static int f2fs_acl_create_masq(struct posix_acl *acl, umode_t *mode_p) umode_t mode = *mode_p; int not_equiv = 0; - /* assert(atomic_read(acl->a_refcount) == 1); */ + /* assert(base_acl_refcount(&acl->a_base) == 1); */ FOREACH_ACL_ENTRY(pa, acl, pe) { switch(pa->e_tag) { diff --git a/fs/inode.c b/fs/inode.c index 69b8b52..101d806 100644 --- a/fs/inode.c +++ b/fs/inode.c @@ -239,9 +239,9 @@ void __destroy_inode(struct inode *inode) #ifdef CONFIG_FS_POSIX_ACL if (inode->i_acl && inode->i_acl != ACL_NOT_CACHED) - posix_acl_release(inode->i_acl); + base_acl_put(inode->i_acl); if (inode->i_default_acl && inode->i_default_acl != ACL_NOT_CACHED) - posix_acl_release(inode->i_default_acl); + base_acl_put(inode->i_default_acl); #endif this_cpu_dec(nr_inodes); } diff --git a/fs/jffs2/acl.c b/fs/jffs2/acl.c index 2f7a3c0..569cb1b 100644 --- a/fs/jffs2/acl.c +++ b/fs/jffs2/acl.c @@ -294,13 +294,19 @@ int jffs2_init_acl_post(struct inode *inode) int rc; if (inode->i_default_acl) { - rc = __jffs2_set_acl(inode, JFFS2_XPREFIX_ACL_DEFAULT, inode->i_default_acl); + struct posix_acl *default_acl = container_of( + inode->i_default_acl, struct posix_acl, a_base); + + rc = __jffs2_set_acl(inode, JFFS2_XPREFIX_ACL_DEFAULT, default_acl); if (rc) return rc; } if (inode->i_acl) { - rc = __jffs2_set_acl(inode, JFFS2_XPREFIX_ACL_ACCESS, inode->i_acl); + struct posix_acl *acl = container_of( + inode->i_acl, struct posix_acl, a_base); + + rc = __jffs2_set_acl(inode, JFFS2_XPREFIX_ACL_ACCESS, acl); if (rc) return rc; } diff --git a/fs/posix_acl.c b/fs/posix_acl.c index 55f2445..743b6dc 100644 --- a/fs/posix_acl.c +++ b/fs/posix_acl.c @@ -21,7 +21,7 @@ #include #include -static struct posix_acl **acl_by_type(struct inode *inode, int type) +static struct base_acl **acl_by_type(struct inode *inode, int type) { switch (type) { case ACL_TYPE_ACCESS: @@ -35,63 +35,64 @@ static struct posix_acl **acl_by_type(struct inode *inode, int type) struct posix_acl *get_cached_acl(struct inode *inode, int type) { - struct posix_acl **p = acl_by_type(inode, type); - struct posix_acl *acl = ACCESS_ONCE(*p); + struct base_acl **p = acl_by_type(inode, type); + struct base_acl *acl = ACCESS_ONCE(*p); if (acl) { spin_lock(&inode->i_lock); acl = *p; if (acl != ACL_NOT_CACHED) - acl = posix_acl_dup(acl); + base_acl_get(acl); spin_unlock(&inode->i_lock); } - return acl; + return container_of(acl, struct posix_acl, a_base); } EXPORT_SYMBOL(get_cached_acl); struct posix_acl *get_cached_acl_rcu(struct inode *inode, int type) { - return rcu_dereference(*acl_by_type(inode, type)); + struct base_acl *acl = rcu_dereference(*acl_by_type(inode, type)); + return container_of(acl, struct posix_acl, a_base); } EXPORT_SYMBOL(get_cached_acl_rcu); void set_cached_acl(struct inode *inode, int type, struct posix_acl *acl) { - struct posix_acl **p = acl_by_type(inode, type); - struct posix_acl *old; + struct base_acl **p = acl_by_type(inode, type); + struct base_acl *old; spin_lock(&inode->i_lock); old = *p; - rcu_assign_pointer(*p, posix_acl_dup(acl)); + rcu_assign_pointer(*p, &posix_acl_dup(acl)->a_base); spin_unlock(&inode->i_lock); if (old != ACL_NOT_CACHED) - posix_acl_release(old); + base_acl_put(old); } EXPORT_SYMBOL(set_cached_acl); void forget_cached_acl(struct inode *inode, int type) { - struct posix_acl **p = acl_by_type(inode, type); - struct posix_acl *old; + struct base_acl **p = acl_by_type(inode, type); + struct base_acl *old; spin_lock(&inode->i_lock); old = *p; *p = ACL_NOT_CACHED; spin_unlock(&inode->i_lock); if (old != ACL_NOT_CACHED) - posix_acl_release(old); + base_acl_put(old); } EXPORT_SYMBOL(forget_cached_acl); void forget_all_cached_acls(struct inode *inode) { - struct posix_acl *old_access, *old_default; + struct base_acl *old_access, *old_default; spin_lock(&inode->i_lock); old_access = inode->i_acl; old_default = inode->i_default_acl; inode->i_acl = inode->i_default_acl = ACL_NOT_CACHED; spin_unlock(&inode->i_lock); if (old_access != ACL_NOT_CACHED) - posix_acl_release(old_access); + base_acl_put(old_access); if (old_default != ACL_NOT_CACHED) - posix_acl_release(old_default); + base_acl_put(old_default); } EXPORT_SYMBOL(forget_all_cached_acls); @@ -128,7 +129,7 @@ EXPORT_SYMBOL(get_acl); void posix_acl_init(struct posix_acl *acl, int count) { - atomic_set(&acl->a_refcount, 1); + base_acl_init(&acl->a_base); acl->a_count = count; } EXPORT_SYMBOL(posix_acl_init); @@ -161,7 +162,7 @@ posix_acl_clone(const struct posix_acl *acl, gfp_t flags) sizeof(struct posix_acl_entry); clone = kmemdup(acl, size, flags); if (clone) - atomic_set(&clone->a_refcount, 1); + base_acl_init(&clone->a_base); } return clone; } @@ -383,7 +384,7 @@ static int posix_acl_create_masq(struct posix_acl *acl, umode_t *mode_p) umode_t mode = *mode_p; int not_equiv = 0; - /* assert(atomic_read(acl->a_refcount) == 1); */ + /* assert(base_acl_refcount(&acl->a_base) == 1); */ FOREACH_ACL_ENTRY(pa, acl, pe) { switch(pa->e_tag) { @@ -438,7 +439,7 @@ static int __posix_acl_chmod_masq(struct posix_acl *acl, umode_t mode) struct posix_acl_entry *group_obj = NULL, *mask_obj = NULL; struct posix_acl_entry *pa, *pe; - /* assert(atomic_read(acl->a_refcount) == 1); */ + /* assert(base_acl_refcount(&acl->a_base) == 1); */ FOREACH_ACL_ENTRY(pa, acl, pe) { switch(pa->e_tag) { diff --git a/fs/richacl_base.c b/fs/richacl_base.c index 69b806c..5826842 100644 --- a/fs/richacl_base.c +++ b/fs/richacl_base.c @@ -33,7 +33,7 @@ richacl_alloc(int count, gfp_t gfp) struct richacl *acl = kzalloc(size, gfp); if (acl) { - atomic_set(&acl->a_refcount, 1); + base_acl_init(&acl->a_base); acl->a_count = count; } return acl; @@ -52,7 +52,7 @@ richacl_clone(const struct richacl *acl, gfp_t gfp) if (dup) { memcpy(dup, acl, size); - atomic_set(&dup->a_refcount, 1); + base_acl_init(&dup->a_base); } return dup; } diff --git a/include/linux/fs.h b/include/linux/fs.h index 0f560b7..3db7729 100644 --- a/include/linux/fs.h +++ b/include/linux/fs.h @@ -578,6 +578,12 @@ static inline void mapping_allow_writable(struct address_space *mapping) #define i_size_ordered_init(inode) do { } while (0) #endif +struct base_acl { + union { + atomic_t ba_refcount; + struct rcu_head ba_rcu; + }; +}; struct posix_acl; #define ACL_NOT_CACHED ((void *)(-1)) @@ -597,9 +603,9 @@ struct inode { kgid_t i_gid; unsigned int i_flags; -#ifdef CONFIG_FS_POSIX_ACL - struct posix_acl *i_acl; - struct posix_acl *i_default_acl; +#if defined(CONFIG_FS_POSIX_ACL) + struct base_acl *i_acl; + struct base_acl *i_default_acl; #endif const struct inode_operations *i_op; @@ -3097,4 +3103,26 @@ static inline bool dir_relax(struct inode *inode) extern bool path_noexec(const struct path *path); extern void inode_nohighmem(struct inode *inode); +static inline void base_acl_get(struct base_acl *acl) +{ + if (acl) + atomic_inc(&acl->ba_refcount); +} + +static inline void base_acl_put(struct base_acl *acl) +{ + if (acl && atomic_dec_and_test(&acl->ba_refcount)) + kfree_rcu(acl, ba_rcu); +} + +static inline void base_acl_init(struct base_acl *acl) +{ + atomic_set(&acl->ba_refcount, 1); +} + +static inline int base_acl_refcount(struct base_acl *acl) +{ + return atomic_read(&acl->ba_refcount); +} + #endif /* _LINUX_FS_H */ diff --git a/include/linux/posix_acl.h b/include/linux/posix_acl.h index 5b5a80c..cef5428 100644 --- a/include/linux/posix_acl.h +++ b/include/linux/posix_acl.h @@ -43,10 +43,7 @@ struct posix_acl_entry { }; struct posix_acl { - union { - atomic_t a_refcount; - struct rcu_head a_rcu; - }; + struct base_acl a_base; /* must be first, see posix_acl_release() */ unsigned int a_count; struct posix_acl_entry a_entries[0]; }; @@ -61,8 +58,7 @@ struct posix_acl { static inline struct posix_acl * posix_acl_dup(struct posix_acl *acl) { - if (acl) - atomic_inc(&acl->a_refcount); + base_acl_get(&acl->a_base); return acl; } @@ -72,8 +68,8 @@ posix_acl_dup(struct posix_acl *acl) static inline void posix_acl_release(struct posix_acl *acl) { - if (acl && atomic_dec_and_test(&acl->a_refcount)) - kfree_rcu(acl, a_rcu); + BUILD_BUG_ON(offsetof(struct posix_acl, a_base) != 0); + base_acl_put(&acl->a_base); } diff --git a/include/linux/richacl.h b/include/linux/richacl.h index 1d9f5f7..7628fad 100644 --- a/include/linux/richacl.h +++ b/include/linux/richacl.h @@ -31,7 +31,7 @@ struct richace { }; struct richacl { - atomic_t a_refcount; + struct base_acl a_base; /* must be first, see richacl_put() */ unsigned int a_owner_mask; unsigned int a_group_mask; unsigned int a_other_mask; @@ -56,8 +56,7 @@ struct richacl { static inline struct richacl * richacl_get(struct richacl *acl) { - if (acl) - atomic_inc(&acl->a_refcount); + base_acl_get(&acl->a_base); return acl; } @@ -67,8 +66,8 @@ richacl_get(struct richacl *acl) static inline void richacl_put(struct richacl *acl) { - if (acl && atomic_dec_and_test(&acl->a_refcount)) - kfree(acl); + BUILD_BUG_ON(offsetof(struct richacl, a_base) != 0); + base_acl_put(&acl->a_base); } /** -- 2.4.3 From agruenba@redhat.com Mon Feb 29 02:18:17 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=ham version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay2.corp.sgi.com [137.38.102.29]) by oss.sgi.com (Postfix) with ESMTP id 24A077CBD for ; Mon, 29 Feb 2016 02:18:17 -0600 (CST) Received: from cuda.sgi.com (cuda2.sgi.com [192.48.176.25]) by relay2.corp.sgi.com (Postfix) with ESMTP id E0485304032 for ; Mon, 29 Feb 2016 00:18:16 -0800 (PST) X-ASG-Debug-ID: 1456733895-04cbb00b6f8c830001-NocioJ Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by cuda.sgi.com with ESMTP id RgKZqe2NGzFtjnzS (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO) for ; Mon, 29 Feb 2016 00:18:16 -0800 (PST) X-Barracuda-Envelope-From: agruenba@redhat.com X-Barracuda-Apparent-Source-IP: 209.132.183.28 X-ASG-Whitelist: Client Received: from int-mx09.intmail.prod.int.phx2.redhat.com (int-mx09.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by mx1.redhat.com (Postfix) with ESMTPS id 93EBD65415; Mon, 29 Feb 2016 08:18:15 +0000 (UTC) Received: from schleppi.home.com (vpn1-4-25.ams2.redhat.com [10.36.4.25]) by int-mx09.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id u1T8HS6H028000; Mon, 29 Feb 2016 03:18:12 -0500 From: Andreas Gruenbacher To: Alexander Viro Cc: "J. Bruce Fields" , linux-nfs@vger.kernel.org, "Theodore Ts'o" , linux-cifs@vger.kernel.org, linux-api@vger.kernel.org, Trond Myklebust , linux-kernel@vger.kernel.org, xfs@oss.sgi.com, Christoph Hellwig , Andreas Dilger , linux-fsdevel@vger.kernel.org, Jeff Layton , linux-ext4@vger.kernel.org, Anna Schumaker Subject: [PATCH v18 12/22] vfs: Add get_richacl and set_richacl inode operations Date: Mon, 29 Feb 2016 09:17:17 +0100 X-ASG-Orig-Subj: [PATCH v18 12/22] vfs: Add get_richacl and set_richacl inode operations Message-Id: <1456733847-17982-13-git-send-email-agruenba@redhat.com> In-Reply-To: <1456733847-17982-1-git-send-email-agruenba@redhat.com> References: <1456733847-17982-1-git-send-email-agruenba@redhat.com> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.22 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.39]); Mon, 29 Feb 2016 08:18:15 +0000 (UTC) X-Barracuda-Connect: mx1.redhat.com[209.132.183.28] X-Barracuda-Start-Time: 1456733896 X-Barracuda-Encrypted: ECDHE-RSA-AES256-GCM-SHA384 X-Barracuda-URL: https://192.48.176.25:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-BRTS-Status: 1 These operations are similar to the get_acl and set_acl operations for POSIX ACLs. The distinction between access and default ACLs doesn't exist for richacls. Signed-off-by: Andreas Gruenbacher --- include/linux/fs.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/include/linux/fs.h b/include/linux/fs.h index 3db7729..e04dbb4 100644 --- a/include/linux/fs.h +++ b/include/linux/fs.h @@ -1682,6 +1682,7 @@ struct inode_operations { const char * (*get_link) (struct dentry *, struct inode *, struct delayed_call *); int (*permission) (struct inode *, int); struct posix_acl * (*get_acl)(struct inode *, int); + struct richacl * (*get_richacl)(struct inode *); int (*readlink) (struct dentry *, char __user *,int); @@ -1710,6 +1711,7 @@ struct inode_operations { umode_t create_mode, int *opened); int (*tmpfile) (struct inode *, struct dentry *, umode_t); int (*set_acl)(struct inode *, struct posix_acl *, int); + int (*set_richacl)(struct inode *, struct richacl *); } ____cacheline_aligned; ssize_t rw_copy_check_uvector(int type, const struct iovec __user * uvector, -- 2.4.3 From agruenba@redhat.com Mon Feb 29 02:18:23 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=ham version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay3.corp.sgi.com [198.149.34.15]) by oss.sgi.com (Postfix) with ESMTP id A5C6B7CA0 for ; Mon, 29 Feb 2016 02:18:23 -0600 (CST) Received: from cuda.sgi.com (cuda3.sgi.com [192.48.176.15]) by relay3.corp.sgi.com (Postfix) with ESMTP id 0C016AC006 for ; Mon, 29 Feb 2016 00:18:22 -0800 (PST) X-ASG-Debug-ID: 1456733900-04cb6c5831782f0001-NocioJ Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by cuda.sgi.com with ESMTP id kciDeDWF7LDrJoGu (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO) for ; Mon, 29 Feb 2016 00:18:21 -0800 (PST) X-Barracuda-Envelope-From: agruenba@redhat.com X-Barracuda-Apparent-Source-IP: 209.132.183.28 X-ASG-Whitelist: Client Received: from int-mx09.intmail.prod.int.phx2.redhat.com (int-mx09.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by mx1.redhat.com (Postfix) with ESMTPS id 7E2DF67C50; Mon, 29 Feb 2016 08:18:20 +0000 (UTC) Received: from schleppi.home.com (vpn1-4-25.ams2.redhat.com [10.36.4.25]) by int-mx09.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id u1T8HS6I028000; Mon, 29 Feb 2016 03:18:15 -0500 From: Andreas Gruenbacher To: Alexander Viro Cc: "J. Bruce Fields" , linux-nfs@vger.kernel.org, "Theodore Ts'o" , linux-cifs@vger.kernel.org, linux-api@vger.kernel.org, Trond Myklebust , linux-kernel@vger.kernel.org, xfs@oss.sgi.com, Christoph Hellwig , Andreas Dilger , linux-fsdevel@vger.kernel.org, Jeff Layton , linux-ext4@vger.kernel.org, Anna Schumaker Subject: [PATCH v18 13/22] vfs: Cache richacl in struct inode Date: Mon, 29 Feb 2016 09:17:18 +0100 X-ASG-Orig-Subj: [PATCH v18 13/22] vfs: Cache richacl in struct inode Message-Id: <1456733847-17982-14-git-send-email-agruenba@redhat.com> In-Reply-To: <1456733847-17982-1-git-send-email-agruenba@redhat.com> References: <1456733847-17982-1-git-send-email-agruenba@redhat.com> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.22 X-Barracuda-Connect: mx1.redhat.com[209.132.183.28] X-Barracuda-Start-Time: 1456733901 X-Barracuda-Encrypted: ECDHE-RSA-AES256-GCM-SHA384 X-Barracuda-URL: https://192.48.176.15:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-BRTS-Status: 1 Cache richacls in struct inode so that this doesn't have to be done individually in each filesystem. This is similar to POSIX ACLs. Signed-off-by: Andreas Gruenbacher --- fs/inode.c | 11 +++++-- fs/posix_acl.c | 2 +- fs/richacl_inode.c | 77 +++++++++++++++++++++++++++++++++++++++++++++++++ include/linux/fs.h | 5 +++- include/linux/richacl.h | 6 ++++ 5 files changed, 96 insertions(+), 5 deletions(-) diff --git a/fs/inode.c b/fs/inode.c index 101d806..de80116 100644 --- a/fs/inode.c +++ b/fs/inode.c @@ -180,8 +180,11 @@ int inode_init_always(struct super_block *sb, struct inode *inode) inode->i_private = NULL; inode->i_mapping = mapping; INIT_HLIST_HEAD(&inode->i_dentry); /* buggered by rcu freeing */ -#ifdef CONFIG_FS_POSIX_ACL - inode->i_acl = inode->i_default_acl = ACL_NOT_CACHED; +#if defined(CONFIG_FS_POSIX_ACL) || defined(CONFIG_FS_RICHACL) + inode->i_acl = ACL_NOT_CACHED; +# if defined(CONFIG_FS_POSIX_ACL) + inode->i_default_acl = ACL_NOT_CACHED; +# endif #endif #ifdef CONFIG_FSNOTIFY @@ -237,11 +240,13 @@ void __destroy_inode(struct inode *inode) atomic_long_dec(&inode->i_sb->s_remove_count); } -#ifdef CONFIG_FS_POSIX_ACL +#if defined(CONFIG_FS_POSIX_ACL) || defined(CONFIG_FS_RICHACL) if (inode->i_acl && inode->i_acl != ACL_NOT_CACHED) base_acl_put(inode->i_acl); +# if defined(CONFIG_FS_POSIX_ACL) if (inode->i_default_acl && inode->i_default_acl != ACL_NOT_CACHED) base_acl_put(inode->i_default_acl); +# endif #endif this_cpu_dec(nr_inodes); } diff --git a/fs/posix_acl.c b/fs/posix_acl.c index 743b6dc..f24646e 100644 --- a/fs/posix_acl.c +++ b/fs/posix_acl.c @@ -37,7 +37,7 @@ struct posix_acl *get_cached_acl(struct inode *inode, int type) { struct base_acl **p = acl_by_type(inode, type); struct base_acl *acl = ACCESS_ONCE(*p); - if (acl) { + if (acl && IS_POSIXACL(inode)) { spin_lock(&inode->i_lock); acl = *p; if (acl != ACL_NOT_CACHED) diff --git a/fs/richacl_inode.c b/fs/richacl_inode.c index 99b3c93..52c1595 100644 --- a/fs/richacl_inode.c +++ b/fs/richacl_inode.c @@ -20,6 +20,83 @@ #include #include +struct richacl *get_cached_richacl(struct inode *inode) +{ + struct base_acl *acl; + + acl = ACCESS_ONCE(inode->i_acl); + if (acl && IS_RICHACL(inode)) { + spin_lock(&inode->i_lock); + acl = inode->i_acl; + if (acl != ACL_NOT_CACHED) + base_acl_get(acl); + spin_unlock(&inode->i_lock); + } + return container_of(acl, struct richacl, a_base); +} +EXPORT_SYMBOL_GPL(get_cached_richacl); + +struct richacl *get_cached_richacl_rcu(struct inode *inode) +{ + struct base_acl *acl = rcu_dereference(inode->i_acl); + + return container_of(acl, struct richacl, a_base); +} +EXPORT_SYMBOL_GPL(get_cached_richacl_rcu); + +void set_cached_richacl(struct inode *inode, struct richacl *acl) +{ + struct base_acl *old = NULL; + + spin_lock(&inode->i_lock); + old = inode->i_acl; + rcu_assign_pointer(inode->i_acl, &richacl_get(acl)->a_base); + spin_unlock(&inode->i_lock); + if (old != ACL_NOT_CACHED) + base_acl_put(old); +} +EXPORT_SYMBOL_GPL(set_cached_richacl); + +void forget_cached_richacl(struct inode *inode) +{ + struct base_acl *old = NULL; + + spin_lock(&inode->i_lock); + old = inode->i_acl; + inode->i_acl = ACL_NOT_CACHED; + spin_unlock(&inode->i_lock); + if (old != ACL_NOT_CACHED) + base_acl_put(old); +} +EXPORT_SYMBOL_GPL(forget_cached_richacl); + +struct richacl *get_richacl(struct inode *inode) +{ + struct richacl *acl; + + acl = get_cached_richacl(inode); + if (acl != ACL_NOT_CACHED) + return acl; + + if (!IS_RICHACL(inode)) + return NULL; + + /* + * A filesystem can force a ACL callback by just never filling the + * ACL cache. But normally you'd fill the cache either at inode + * instantiation time, or on the first ->get_richacl call. + * + * If the filesystem doesn't have a get_richacl() function at all, + * we'll just create the negative cache entry. + */ + if (!inode->i_op->get_richacl) { + set_cached_richacl(inode, NULL); + return NULL; + } + return inode->i_op->get_richacl(inode); +} +EXPORT_SYMBOL_GPL(get_richacl); + /** * richacl_permission - richacl permission check algorithm * @inode: inode to check diff --git a/include/linux/fs.h b/include/linux/fs.h index e04dbb4..560f4e0 100644 --- a/include/linux/fs.h +++ b/include/linux/fs.h @@ -585,6 +585,7 @@ struct base_acl { }; }; struct posix_acl; +struct richacl; #define ACL_NOT_CACHED ((void *)(-1)) #define IOP_FASTPERM 0x0001 @@ -603,9 +604,11 @@ struct inode { kgid_t i_gid; unsigned int i_flags; -#if defined(CONFIG_FS_POSIX_ACL) +#if defined(CONFIG_FS_POSIX_ACL) || defined(CONFIG_FS_RICHACL) struct base_acl *i_acl; +# if defined(CONFIG_FS_POSIX_ACL) struct base_acl *i_default_acl; +# endif #endif const struct inode_operations *i_op; diff --git a/include/linux/richacl.h b/include/linux/richacl.h index 7628fad..7bf912b6 100644 --- a/include/linux/richacl.h +++ b/include/linux/richacl.h @@ -70,6 +70,12 @@ richacl_put(struct richacl *acl) base_acl_put(&acl->a_base); } +extern struct richacl *get_cached_richacl(struct inode *); +extern struct richacl *get_cached_richacl_rcu(struct inode *); +extern void set_cached_richacl(struct inode *, struct richacl *); +extern void forget_cached_richacl(struct inode *); +extern struct richacl *get_richacl(struct inode *); + /** * richace_is_owner - check if @ace is an OWNER@ entry */ -- 2.4.3 From agruenba@redhat.com Mon Feb 29 02:18:26 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=ham version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay3.corp.sgi.com [198.149.34.15]) by oss.sgi.com (Postfix) with ESMTP id 701E77F6C for ; Mon, 29 Feb 2016 02:18:26 -0600 (CST) Received: from cuda.sgi.com (cuda1.sgi.com [192.48.157.11]) by relay3.corp.sgi.com (Postfix) with ESMTP id 02A4EAC001 for ; Mon, 29 Feb 2016 00:18:25 -0800 (PST) X-ASG-Debug-ID: 1456733904-04bdf002ec8ab00001-NocioJ Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by cuda.sgi.com with ESMTP id H6IZBE0gAkKeRsU5 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO) for ; Mon, 29 Feb 2016 00:18:24 -0800 (PST) X-Barracuda-Envelope-From: agruenba@redhat.com X-Barracuda-Apparent-Source-IP: 209.132.183.28 X-ASG-Whitelist: Client Received: from int-mx09.intmail.prod.int.phx2.redhat.com (int-mx09.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by mx1.redhat.com (Postfix) with ESMTPS id 2076F6541F; Mon, 29 Feb 2016 08:18:24 +0000 (UTC) Received: from schleppi.home.com (vpn1-4-25.ams2.redhat.com [10.36.4.25]) by int-mx09.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id u1T8HS6J028000; Mon, 29 Feb 2016 03:18:20 -0500 From: Andreas Gruenbacher To: Alexander Viro Cc: "J. Bruce Fields" , linux-nfs@vger.kernel.org, "Theodore Ts'o" , linux-cifs@vger.kernel.org, linux-api@vger.kernel.org, Trond Myklebust , linux-kernel@vger.kernel.org, xfs@oss.sgi.com, Christoph Hellwig , Andreas Dilger , linux-fsdevel@vger.kernel.org, Jeff Layton , linux-ext4@vger.kernel.org, Anna Schumaker Subject: [PATCH v18 14/22] richacl: Update the file masks in chmod() Date: Mon, 29 Feb 2016 09:17:19 +0100 X-ASG-Orig-Subj: [PATCH v18 14/22] richacl: Update the file masks in chmod() Message-Id: <1456733847-17982-15-git-send-email-agruenba@redhat.com> In-Reply-To: <1456733847-17982-1-git-send-email-agruenba@redhat.com> References: <1456733847-17982-1-git-send-email-agruenba@redhat.com> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.22 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.39]); Mon, 29 Feb 2016 08:18:24 +0000 (UTC) X-Barracuda-Connect: mx1.redhat.com[209.132.183.28] X-Barracuda-Start-Time: 1456733904 X-Barracuda-Encrypted: ECDHE-RSA-AES256-GCM-SHA384 X-Barracuda-URL: https://192.48.157.11:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-BRTS-Status: 1 Doing a chmod() sets the file mode, which includes the file permission bits. When a file has a richacl, the permissions that the richacl grants need to be limited to what the new file permission bits allow. This is done by setting the file masks in the richacl to what the file permission bits map to. The richacl access check algorithm takes the file masks into account, which ensures that the richacl cannot grant too many permissions. It is possible to explicitly add permissions to the file masks which go beyond what the file permission bits can grant (like the RICHACE_WRITE_ACL permission). The POSIX.1 standard calls this an alternate file access control mechanism. A subsequent chmod() would ensure that those permissions are disabled again. Signed-off-by: Andreas Gruenbacher Reviewed-by: J. Bruce Fields --- fs/richacl_base.c | 42 ++++++++++++++++++++++++++++++++++++++++++ fs/richacl_inode.c | 30 ++++++++++++++++++++++++++++++ include/linux/richacl.h | 2 ++ 3 files changed, 74 insertions(+) diff --git a/fs/richacl_base.c b/fs/richacl_base.c index 5826842..e4dd779 100644 --- a/fs/richacl_base.c +++ b/fs/richacl_base.c @@ -340,3 +340,45 @@ restart: acl->a_flags &= ~(RICHACL_WRITE_THROUGH | RICHACL_MASKED); } EXPORT_SYMBOL_GPL(richacl_compute_max_masks); + +/** + * __richacl_chmod - update the file masks to reflect the new mode + * @acl: access control list + * @mode: new file permission bits including the file type + * + * Return a copy of @acl where the file masks have been replaced by the file + * masks corresponding to the file permission bits in @mode, or returns @acl + * itself if the file masks are already up to date. Takes over a reference + * to @acl. + */ +struct richacl * +__richacl_chmod(struct richacl *acl, umode_t mode) +{ + unsigned int x = S_ISDIR(mode) ? 0 : RICHACE_DELETE_CHILD; + unsigned int owner_mask, group_mask, other_mask; + struct richacl *clone; + + owner_mask = richacl_mode_to_mask(mode >> 6) & ~x; + group_mask = richacl_mode_to_mask(mode >> 3) & ~x; + other_mask = richacl_mode_to_mask(mode) & ~x; + + if (acl->a_owner_mask == owner_mask && + acl->a_group_mask == group_mask && + acl->a_other_mask == other_mask && + (acl->a_flags & RICHACL_MASKED) && + (acl->a_flags & RICHACL_WRITE_THROUGH)) + return acl; + + clone = richacl_clone(acl, GFP_KERNEL); + richacl_put(acl); + if (!clone) + return ERR_PTR(-ENOMEM); + + clone->a_flags |= (RICHACL_WRITE_THROUGH | RICHACL_MASKED); + clone->a_owner_mask = owner_mask; + clone->a_group_mask = group_mask; + clone->a_other_mask = other_mask; + + return clone; +} +EXPORT_SYMBOL_GPL(__richacl_chmod); diff --git a/fs/richacl_inode.c b/fs/richacl_inode.c index 52c1595..e329826 100644 --- a/fs/richacl_inode.c +++ b/fs/richacl_inode.c @@ -224,3 +224,33 @@ out: return denied ? -EACCES : 0; } EXPORT_SYMBOL_GPL(richacl_permission); + +/** + * richacl_chmod - filesystem chmod helper + * @inode: inode whose file permission bits to change + * @mode: new file permission bits including the file type + * + * Helper for filesystems to use to perform a chmod on the richacl of an inode. + */ +int +richacl_chmod(struct inode *inode, umode_t mode) +{ + struct richacl *acl; + int retval; + + if (S_ISLNK(mode)) + return -EOPNOTSUPP; + if (!inode->i_op->set_richacl) + return -EOPNOTSUPP; + acl = get_richacl(inode); + if (IS_ERR_OR_NULL(acl)) + return PTR_ERR(acl); + acl = __richacl_chmod(acl, mode); + if (IS_ERR(acl)) + return PTR_ERR(acl); + retval = inode->i_op->set_richacl(inode, acl); + richacl_put(acl); + + return retval; +} +EXPORT_SYMBOL(richacl_chmod); diff --git a/include/linux/richacl.h b/include/linux/richacl.h index 7bf912b6..a2d5600 100644 --- a/include/linux/richacl.h +++ b/include/linux/richacl.h @@ -184,8 +184,10 @@ extern int richacl_masks_to_mode(const struct richacl *); extern unsigned int richacl_mode_to_mask(umode_t); extern unsigned int richacl_want_to_mask(unsigned int); extern void richacl_compute_max_masks(struct richacl *); +extern struct richacl *__richacl_chmod(struct richacl *, umode_t); /* richacl_inode.c */ extern int richacl_permission(struct inode *, const struct richacl *, int); +extern int richacl_chmod(struct inode *, umode_t); #endif /* __RICHACL_H */ -- 2.4.3 From agruenba@redhat.com Mon Feb 29 02:18:29 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=ham version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay1.corp.sgi.com [137.38.102.111]) by oss.sgi.com (Postfix) with ESMTP id 548C77CB8 for ; Mon, 29 Feb 2016 02:18:29 -0600 (CST) Received: from cuda.sgi.com (cuda2.sgi.com [192.48.176.25]) by relay1.corp.sgi.com (Postfix) with ESMTP id 1DD378F8037 for ; Mon, 29 Feb 2016 00:18:29 -0800 (PST) X-ASG-Debug-ID: 1456733907-04cbb00b6f8c850001-NocioJ Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by cuda.sgi.com with ESMTP id 42zyBldBtH6b5ffi (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO) for ; Mon, 29 Feb 2016 00:18:28 -0800 (PST) X-Barracuda-Envelope-From: agruenba@redhat.com X-Barracuda-Apparent-Source-IP: 209.132.183.28 X-ASG-Whitelist: Client Received: from int-mx09.intmail.prod.int.phx2.redhat.com (int-mx09.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by mx1.redhat.com (Postfix) with ESMTPS id 7E0E2C0B8D50; Mon, 29 Feb 2016 08:18:27 +0000 (UTC) Received: from schleppi.home.com (vpn1-4-25.ams2.redhat.com [10.36.4.25]) by int-mx09.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id u1T8HS6K028000; Mon, 29 Feb 2016 03:18:24 -0500 From: Andreas Gruenbacher To: Alexander Viro Cc: "J. Bruce Fields" , linux-nfs@vger.kernel.org, "Theodore Ts'o" , linux-cifs@vger.kernel.org, linux-api@vger.kernel.org, Trond Myklebust , linux-kernel@vger.kernel.org, xfs@oss.sgi.com, Christoph Hellwig , Andreas Dilger , linux-fsdevel@vger.kernel.org, Jeff Layton , linux-ext4@vger.kernel.org, Anna Schumaker Subject: [PATCH v18 15/22] richacl: Check if an acl is equivalent to a file mode Date: Mon, 29 Feb 2016 09:17:20 +0100 X-ASG-Orig-Subj: [PATCH v18 15/22] richacl: Check if an acl is equivalent to a file mode Message-Id: <1456733847-17982-16-git-send-email-agruenba@redhat.com> In-Reply-To: <1456733847-17982-1-git-send-email-agruenba@redhat.com> References: <1456733847-17982-1-git-send-email-agruenba@redhat.com> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.22 X-Barracuda-Connect: mx1.redhat.com[209.132.183.28] X-Barracuda-Start-Time: 1456733907 X-Barracuda-Encrypted: ECDHE-RSA-AES256-GCM-SHA384 X-Barracuda-URL: https://192.48.176.25:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-BRTS-Status: 1 ACLs are considered equivalent to file modes if they only consist of owner@, group@, and everyone@ entries, the owner@ permissions do not depend on whether the owner is a member in the owning group, and no inheritance flags are set. This test is used to avoid storing richacls if the acl can be computed from the file permission bits. Signed-off-by: Andreas Gruenbacher Reviewed-by: J. Bruce Fields --- fs/richacl_base.c | 104 ++++++++++++++++++++++++++++++++++++++++++++++++ include/linux/richacl.h | 1 + 2 files changed, 105 insertions(+) diff --git a/fs/richacl_base.c b/fs/richacl_base.c index e4dd779..74e5cb5 100644 --- a/fs/richacl_base.c +++ b/fs/richacl_base.c @@ -382,3 +382,107 @@ __richacl_chmod(struct richacl *acl, umode_t mode) return clone; } EXPORT_SYMBOL_GPL(__richacl_chmod); + +/** + * richacl_equiv_mode - compute the mode equivalent of @acl + * + * An acl is considered equivalent to a file mode if it only consists of + * owner@, group@, and everyone@ entries and the owner@ permissions do not + * depend on whether the owner is a member in the owning group. + */ +int +richacl_equiv_mode(const struct richacl *acl, umode_t *mode_p) +{ + umode_t mode = *mode_p; + + /* + * The RICHACE_DELETE_CHILD flag is meaningless for non-directories, so + * we ignore it. + */ + unsigned int x = S_ISDIR(mode) ? 0 : RICHACE_DELETE_CHILD; + struct { + unsigned int allowed; + unsigned int defined; /* allowed or denied */ + } owner = { + .defined = RICHACE_POSIX_ALWAYS_ALLOWED | + RICHACE_POSIX_OWNER_ALLOWED | x, + }, group = { + .defined = RICHACE_POSIX_ALWAYS_ALLOWED | x, + }, everyone = { + .defined = RICHACE_POSIX_ALWAYS_ALLOWED | x, + }; + const struct richace *ace; + + if (acl->a_flags & ~(RICHACL_WRITE_THROUGH | RICHACL_MASKED)) + return -1; + + richacl_for_each_entry(ace, acl) { + if (ace->e_flags & ~RICHACE_SPECIAL_WHO) + return -1; + + if (richace_is_owner(ace) || richace_is_everyone(ace)) { + x = ace->e_mask & ~owner.defined; + if (richace_is_allow(ace)) { + unsigned int group_denied = + group.defined & ~group.allowed; + + if (x & group_denied) + return -1; + owner.allowed |= x; + } else /* if (richace_is_deny(ace)) */ { + if (x & group.allowed) + return -1; + } + owner.defined |= x; + + if (richace_is_everyone(ace)) { + x = ace->e_mask; + if (richace_is_allow(ace)) { + group.allowed |= + x & ~group.defined; + everyone.allowed |= + x & ~everyone.defined; + } + group.defined |= x; + everyone.defined |= x; + } + } else if (richace_is_group(ace)) { + x = ace->e_mask & ~group.defined; + if (richace_is_allow(ace)) + group.allowed |= x; + group.defined |= x; + } else + return -1; + } + + if (group.allowed & ~owner.defined) + return -1; + + if (acl->a_flags & RICHACL_MASKED) { + if (acl->a_flags & RICHACL_WRITE_THROUGH) { + owner.allowed = acl->a_owner_mask; + everyone.allowed = acl->a_other_mask; + } else { + owner.allowed &= acl->a_owner_mask; + everyone.allowed &= acl->a_other_mask; + } + group.allowed &= acl->a_group_mask; + } + + mode = (mode & ~S_IRWXUGO) | + (richacl_mask_to_mode(owner.allowed) << 6) | + (richacl_mask_to_mode(group.allowed) << 3) | + richacl_mask_to_mode(everyone.allowed); + + /* Mask flags we can ignore */ + x = S_ISDIR(mode) ? 0 : RICHACE_DELETE_CHILD; + + if (((richacl_mode_to_mask(mode >> 6) ^ owner.allowed) & ~x) || + ((richacl_mode_to_mask(mode >> 3) ^ group.allowed) & ~x) || + ((richacl_mode_to_mask(mode) ^ everyone.allowed) & ~x)) + return -1; + + *mode_p = mode; + return 0; +} +EXPORT_SYMBOL_GPL(richacl_equiv_mode); diff --git a/include/linux/richacl.h b/include/linux/richacl.h index a2d5600..b7128bf 100644 --- a/include/linux/richacl.h +++ b/include/linux/richacl.h @@ -185,6 +185,7 @@ extern unsigned int richacl_mode_to_mask(umode_t); extern unsigned int richacl_want_to_mask(unsigned int); extern void richacl_compute_max_masks(struct richacl *); extern struct richacl *__richacl_chmod(struct richacl *, umode_t); +extern int richacl_equiv_mode(const struct richacl *, umode_t *); /* richacl_inode.c */ extern int richacl_permission(struct inode *, const struct richacl *, int); -- 2.4.3 From agruenba@redhat.com Mon Feb 29 02:18:33 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=ham version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay1.corp.sgi.com [137.38.102.111]) by oss.sgi.com (Postfix) with ESMTP id C92267F6C for ; Mon, 29 Feb 2016 02:18:33 -0600 (CST) Received: from cuda.sgi.com (cuda3.sgi.com [192.48.176.15]) by relay1.corp.sgi.com (Postfix) with ESMTP id 9D5B58F8039 for ; Mon, 29 Feb 2016 00:18:33 -0800 (PST) X-ASG-Debug-ID: 1456733911-04cb6c583278310001-NocioJ Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by cuda.sgi.com with ESMTP id sKlN9Z39ldZRnqdl (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO) for ; Mon, 29 Feb 2016 00:18:31 -0800 (PST) X-Barracuda-Envelope-From: agruenba@redhat.com X-Barracuda-Apparent-Source-IP: 209.132.183.28 X-ASG-Whitelist: Client Received: from int-mx09.intmail.prod.int.phx2.redhat.com (int-mx09.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by mx1.redhat.com (Postfix) with ESMTPS id E894768E0C; Mon, 29 Feb 2016 08:18:30 +0000 (UTC) Received: from schleppi.home.com (vpn1-4-25.ams2.redhat.com [10.36.4.25]) by int-mx09.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id u1T8HS6L028000; Mon, 29 Feb 2016 03:18:27 -0500 From: Andreas Gruenbacher To: Alexander Viro Cc: "J. Bruce Fields" , linux-nfs@vger.kernel.org, "Theodore Ts'o" , linux-cifs@vger.kernel.org, linux-api@vger.kernel.org, Trond Myklebust , linux-kernel@vger.kernel.org, xfs@oss.sgi.com, Christoph Hellwig , Andreas Dilger , linux-fsdevel@vger.kernel.org, Jeff Layton , linux-ext4@vger.kernel.org, Anna Schumaker Subject: [PATCH v18 16/22] richacl: Create-time inheritance Date: Mon, 29 Feb 2016 09:17:21 +0100 X-ASG-Orig-Subj: [PATCH v18 16/22] richacl: Create-time inheritance Message-Id: <1456733847-17982-17-git-send-email-agruenba@redhat.com> In-Reply-To: <1456733847-17982-1-git-send-email-agruenba@redhat.com> References: <1456733847-17982-1-git-send-email-agruenba@redhat.com> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.22 X-Barracuda-Connect: mx1.redhat.com[209.132.183.28] X-Barracuda-Start-Time: 1456733911 X-Barracuda-Encrypted: ECDHE-RSA-AES256-GCM-SHA384 X-Barracuda-URL: https://192.48.176.15:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-BRTS-Status: 1 When a new file is created, it can inherit an acl from its parent directory; this is similar to how default acls work in POSIX ACLs. As with POSIX ACLs, if a file inherits an acl from its parent directory, the intersection between the create mode and the permissions granted by the inherited acl determines the file masks and file permission bits, and the umask is ignored. Signed-off-by: Andreas Gruenbacher --- fs/richacl_base.c | 81 +++++++++++++++++++++++++++++++++++++++++++++++++ fs/richacl_inode.c | 70 ++++++++++++++++++++++++++++++++++++++++++ include/linux/richacl.h | 2 ++ 3 files changed, 153 insertions(+) diff --git a/fs/richacl_base.c b/fs/richacl_base.c index 74e5cb5..58dffca 100644 --- a/fs/richacl_base.c +++ b/fs/richacl_base.c @@ -486,3 +486,84 @@ richacl_equiv_mode(const struct richacl *acl, umode_t *mode_p) return 0; } EXPORT_SYMBOL_GPL(richacl_equiv_mode); + +static inline bool +ace_inherits_to_directory(const struct richace *ace) +{ + if (ace->e_flags & RICHACE_DIRECTORY_INHERIT_ACE) + return true; + if ((ace->e_flags & RICHACE_FILE_INHERIT_ACE) && + !(ace->e_flags & RICHACE_NO_PROPAGATE_INHERIT_ACE)) + return true; + return false; +} + +/** + * richacl_inherit - compute the inherited acl of a new file + * @dir_acl: acl of the containing directory + * @isdir: inherit by a directory or non-directory? + * + * A directory can have acl entries which files and/or directories created + * inside the directory will inherit. This function computes the acl for such + * a new file. If there is no inheritable acl, it will return %NULL. + */ +struct richacl * +richacl_inherit(const struct richacl *dir_acl, int isdir) +{ + const struct richace *dir_ace; + struct richacl *acl = NULL; + struct richace *ace; + int count = 0; + + if (isdir) { + richacl_for_each_entry(dir_ace, dir_acl) { + if (!ace_inherits_to_directory(dir_ace)) + continue; + count++; + } + if (!count) + return NULL; + acl = richacl_alloc(count, GFP_KERNEL); + if (!acl) + return ERR_PTR(-ENOMEM); + ace = acl->a_entries; + richacl_for_each_entry(dir_ace, dir_acl) { + if (!ace_inherits_to_directory(dir_ace)) + continue; + richace_copy(ace, dir_ace); + if (dir_ace->e_flags & RICHACE_NO_PROPAGATE_INHERIT_ACE) + ace->e_flags &= ~RICHACE_INHERITANCE_FLAGS; + else if (dir_ace->e_flags & RICHACE_DIRECTORY_INHERIT_ACE) + ace->e_flags &= ~RICHACE_INHERIT_ONLY_ACE; + else + ace->e_flags |= RICHACE_INHERIT_ONLY_ACE; + ace++; + } + } else { + richacl_for_each_entry(dir_ace, dir_acl) { + if (!(dir_ace->e_flags & RICHACE_FILE_INHERIT_ACE)) + continue; + count++; + } + if (!count) + return NULL; + acl = richacl_alloc(count, GFP_KERNEL); + if (!acl) + return ERR_PTR(-ENOMEM); + ace = acl->a_entries; + richacl_for_each_entry(dir_ace, dir_acl) { + if (!(dir_ace->e_flags & RICHACE_FILE_INHERIT_ACE)) + continue; + richace_copy(ace, dir_ace); + ace->e_flags &= ~RICHACE_INHERITANCE_FLAGS; + /* + * RICHACE_DELETE_CHILD is meaningless for + * non-directories, so clear it. + */ + ace->e_mask &= ~RICHACE_DELETE_CHILD; + ace++; + } + } + + return acl; +} diff --git a/fs/richacl_inode.c b/fs/richacl_inode.c index e329826..ec3d2c8 100644 --- a/fs/richacl_inode.c +++ b/fs/richacl_inode.c @@ -254,3 +254,73 @@ richacl_chmod(struct inode *inode, umode_t mode) return retval; } EXPORT_SYMBOL(richacl_chmod); + +/* + * richacl_inherit_inode - compute inherited acl and file mode + * @dir_acl: acl of the containing directory + * @mode_p: mode of the new inode + * + * The file permission bits in @mode_p must be set to the create mode by the + * caller. + * + * If there is an inheritable acl, the maximum permissions that the acl grants + * are computed and the file masks of the new acl are set accordingly. + */ +static struct richacl * +richacl_inherit_inode(const struct richacl *dir_acl, umode_t *mode_p) +{ + struct richacl *acl; + umode_t mode = *mode_p; + + acl = richacl_inherit(dir_acl, S_ISDIR(mode)); + if (acl) { + if (richacl_equiv_mode(acl, &mode) == 0) { + *mode_p &= mode; + richacl_put(acl); + acl = NULL; + } else { + richacl_compute_max_masks(acl); + /* + * Ensure that the acl will not grant any permissions + * beyond the create mode. + */ + acl->a_flags |= RICHACL_MASKED; + acl->a_owner_mask &= + richacl_mode_to_mask(mode >> 6); + acl->a_group_mask &= + richacl_mode_to_mask(mode >> 3); + acl->a_other_mask &= + richacl_mode_to_mask(mode); + } + } else + *mode_p &= ~current_umask(); + + return acl; +} + +/** + * richacl_create - filesystem create helper + * @mode_p: mode of the new inode + * @dir: containing directory + * + * Compute the inherited acl for a new inode. If there is no acl to inherit, + * apply the umask. Use when creating a new inode on a richacl enabled file + * system. + */ +struct richacl *richacl_create(umode_t *mode_p, struct inode *dir) +{ + struct richacl *dir_acl, *acl = NULL; + + if (S_ISLNK(*mode_p)) + return NULL; + dir_acl = get_richacl(dir); + if (dir_acl) { + if (IS_ERR(dir_acl)) + return dir_acl; + acl = richacl_inherit_inode(dir_acl, mode_p); + richacl_put(dir_acl); + } else + *mode_p &= ~current_umask(); + return acl; +} +EXPORT_SYMBOL_GPL(richacl_create); diff --git a/include/linux/richacl.h b/include/linux/richacl.h index b7128bf..c8fae91a 100644 --- a/include/linux/richacl.h +++ b/include/linux/richacl.h @@ -186,9 +186,11 @@ extern unsigned int richacl_want_to_mask(unsigned int); extern void richacl_compute_max_masks(struct richacl *); extern struct richacl *__richacl_chmod(struct richacl *, umode_t); extern int richacl_equiv_mode(const struct richacl *, umode_t *); +extern struct richacl *richacl_inherit(const struct richacl *, int); /* richacl_inode.c */ extern int richacl_permission(struct inode *, const struct richacl *, int); extern int richacl_chmod(struct inode *, umode_t); +extern struct richacl *richacl_create(umode_t *, struct inode *); #endif /* __RICHACL_H */ -- 2.4.3 From agruenba@redhat.com Mon Feb 29 02:18:36 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=ham version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay2.corp.sgi.com [137.38.102.29]) by oss.sgi.com (Postfix) with ESMTP id 825177F7E for ; Mon, 29 Feb 2016 02:18:36 -0600 (CST) Received: from cuda.sgi.com (cuda2.sgi.com [192.48.176.25]) by relay2.corp.sgi.com (Postfix) with ESMTP id 48E4B304032 for ; Mon, 29 Feb 2016 00:18:36 -0800 (PST) X-ASG-Debug-ID: 1456733914-04cbb00b708c860001-NocioJ Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by cuda.sgi.com with ESMTP id Gtrz2ZyKOzOpHVXb (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO) for ; Mon, 29 Feb 2016 00:18:34 -0800 (PST) X-Barracuda-Envelope-From: agruenba@redhat.com X-Barracuda-Apparent-Source-IP: 209.132.183.28 X-ASG-Whitelist: Client Received: from int-mx09.intmail.prod.int.phx2.redhat.com (int-mx09.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by mx1.redhat.com (Postfix) with ESMTPS id 57A73BBB3F; Mon, 29 Feb 2016 08:18:34 +0000 (UTC) Received: from schleppi.home.com (vpn1-4-25.ams2.redhat.com [10.36.4.25]) by int-mx09.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id u1T8HS6M028000; Mon, 29 Feb 2016 03:18:31 -0500 From: Andreas Gruenbacher To: Alexander Viro Cc: "J. Bruce Fields" , linux-nfs@vger.kernel.org, "Theodore Ts'o" , linux-cifs@vger.kernel.org, linux-api@vger.kernel.org, Trond Myklebust , linux-kernel@vger.kernel.org, xfs@oss.sgi.com, Christoph Hellwig , Andreas Dilger , linux-fsdevel@vger.kernel.org, Jeff Layton , linux-ext4@vger.kernel.org, Anna Schumaker Subject: [PATCH v18 17/22] richacl: Automatic Inheritance Date: Mon, 29 Feb 2016 09:17:22 +0100 X-ASG-Orig-Subj: [PATCH v18 17/22] richacl: Automatic Inheritance Message-Id: <1456733847-17982-18-git-send-email-agruenba@redhat.com> In-Reply-To: <1456733847-17982-1-git-send-email-agruenba@redhat.com> References: <1456733847-17982-1-git-send-email-agruenba@redhat.com> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.22 X-Barracuda-Connect: mx1.redhat.com[209.132.183.28] X-Barracuda-Start-Time: 1456733914 X-Barracuda-Encrypted: ECDHE-RSA-AES256-GCM-SHA384 X-Barracuda-URL: https://192.48.176.25:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-BRTS-Status: 1 Automatic Inheritance (AI) allows changes to the acl of a directory to propagate down to children. This is mostly implemented in user space: when a process changes the permissions of a directory and Automatic Inheritance is enabled for that directory, the process must propagate those changes to all children, recursively. The kernel enables this by keeping track of which permissions have been inherited at create time. In addition, it makes sure that permission propagation is turned off when the permissions are set explicitly (for example, upon create or chmod). Automatic Inheritance works as follows: - When the RICHACL_AUTO_INHERIT flag in the acl of a file or directory is not set, the file or directory is not affected by AI. - When the RICHACL_AUTO_INHERIT flag in the acl of a directory is set and a file or subdirectory is created in that directory, the inherited acl will have the RICHACL_AUTO_INHERIT flag set, and all inherited aces will have the RICHACE_INHERITED_ACE flag set. This allows user space to distinguish between aces which have been inherited and aces which have been explicitly added. - When the RICHACL_PROTECTED acl flag in the acl of a file or directory is set, AI will not modify the acl. This does not affect propagation of permissions from the file to its children (if the file is a directory). Linux does not have a way of creating files or directories without setting the file permission bits, so all files created inside a directory with RICHACL_AUTO_INHERIT set will have the RICHACL_PROTECTED flag set. This effectively disables Automatic Inheritance. Protocols which support creating files without specifying permissions can explicitly clear the RICHACL_PROTECTED flag after creating a file and reset the file masks to "undo" applying the create mode; see richacl_compute_max_masks(). They should set the RICHACL_DEFAULTED flag. (A mechanism that would allow to indicate to the kernel to ignore the create mode in the first place when there are inherited permissions would be nice to have.) Signed-off-by: Andreas Gruenbacher --- fs/richacl_base.c | 13 ++++++++++++- fs/richacl_inode.c | 7 +++++++ include/linux/richacl.h | 12 ++++++++++++ include/uapi/linux/richacl.h | 11 ++++++++++- 4 files changed, 41 insertions(+), 2 deletions(-) diff --git a/fs/richacl_base.c b/fs/richacl_base.c index 58dffca..cad6171 100644 --- a/fs/richacl_base.c +++ b/fs/richacl_base.c @@ -366,7 +366,8 @@ __richacl_chmod(struct richacl *acl, umode_t mode) acl->a_group_mask == group_mask && acl->a_other_mask == other_mask && (acl->a_flags & RICHACL_MASKED) && - (acl->a_flags & RICHACL_WRITE_THROUGH)) + (acl->a_flags & RICHACL_WRITE_THROUGH) && + (!richacl_is_auto_inherit(acl) || richacl_is_protected(acl))) return acl; clone = richacl_clone(acl, GFP_KERNEL); @@ -378,6 +379,8 @@ __richacl_chmod(struct richacl *acl, umode_t mode) clone->a_owner_mask = owner_mask; clone->a_group_mask = group_mask; clone->a_other_mask = other_mask; + if (richacl_is_auto_inherit(clone)) + clone->a_flags |= RICHACL_PROTECTED; return clone; } @@ -564,6 +567,14 @@ richacl_inherit(const struct richacl *dir_acl, int isdir) ace++; } } + if (richacl_is_auto_inherit(dir_acl)) { + acl->a_flags = RICHACL_AUTO_INHERIT; + richacl_for_each_entry(ace, acl) + ace->e_flags |= RICHACE_INHERITED_ACE; + } else { + richacl_for_each_entry(ace, acl) + ace->e_flags &= ~RICHACE_INHERITED_ACE; + } return acl; } diff --git a/fs/richacl_inode.c b/fs/richacl_inode.c index ec3d2c8..99a1ab6 100644 --- a/fs/richacl_inode.c +++ b/fs/richacl_inode.c @@ -279,6 +279,13 @@ richacl_inherit_inode(const struct richacl *dir_acl, umode_t *mode_p) richacl_put(acl); acl = NULL; } else { + /* + * We need to set RICHACL_PROTECTED because we are + * doing an implicit chmod + */ + if (richacl_is_auto_inherit(acl)) + acl->a_flags |= RICHACL_PROTECTED; + richacl_compute_max_masks(acl); /* * Ensure that the acl will not grant any permissions diff --git a/include/linux/richacl.h b/include/linux/richacl.h index c8fae91a..c524a4b 100644 --- a/include/linux/richacl.h +++ b/include/linux/richacl.h @@ -76,6 +76,18 @@ extern void set_cached_richacl(struct inode *, struct richacl *); extern void forget_cached_richacl(struct inode *); extern struct richacl *get_richacl(struct inode *); +static inline int +richacl_is_auto_inherit(const struct richacl *acl) +{ + return acl->a_flags & RICHACL_AUTO_INHERIT; +} + +static inline int +richacl_is_protected(const struct richacl *acl) +{ + return acl->a_flags & RICHACL_PROTECTED; +} + /** * richace_is_owner - check if @ace is an OWNER@ entry */ diff --git a/include/uapi/linux/richacl.h b/include/uapi/linux/richacl.h index 1ed48ac..8849a53 100644 --- a/include/uapi/linux/richacl.h +++ b/include/uapi/linux/richacl.h @@ -18,6 +18,9 @@ #define __UAPI_RICHACL_H /* a_flags values */ +#define RICHACL_AUTO_INHERIT 0x01 +#define RICHACL_PROTECTED 0x02 +#define RICHACL_DEFAULTED 0x04 #define RICHACL_WRITE_THROUGH 0x40 #define RICHACL_MASKED 0x80 @@ -31,6 +34,7 @@ #define RICHACE_NO_PROPAGATE_INHERIT_ACE 0x0004 #define RICHACE_INHERIT_ONLY_ACE 0x0008 #define RICHACE_IDENTIFIER_GROUP 0x0040 +#define RICHACE_INHERITED_ACE 0x0080 #define RICHACE_SPECIAL_WHO 0x4000 /* e_mask bitflags */ @@ -60,6 +64,9 @@ #define RICHACE_EVERYONE_SPECIAL_ID 2 #define RICHACL_VALID_FLAGS ( \ + RICHACL_AUTO_INHERIT | \ + RICHACL_PROTECTED | \ + RICHACL_DEFAULTED | \ RICHACL_WRITE_THROUGH | \ RICHACL_MASKED ) @@ -69,13 +76,15 @@ RICHACE_NO_PROPAGATE_INHERIT_ACE | \ RICHACE_INHERIT_ONLY_ACE | \ RICHACE_IDENTIFIER_GROUP | \ + RICHACE_INHERITED_ACE | \ RICHACE_SPECIAL_WHO ) #define RICHACE_INHERITANCE_FLAGS ( \ RICHACE_FILE_INHERIT_ACE | \ RICHACE_DIRECTORY_INHERIT_ACE | \ RICHACE_NO_PROPAGATE_INHERIT_ACE | \ - RICHACE_INHERIT_ONLY_ACE ) + RICHACE_INHERIT_ONLY_ACE | \ + RICHACE_INHERITED_ACE ) /* Valid RICHACE_* flags for directories and non-directories */ #define RICHACE_VALID_MASK ( \ -- 2.4.3 From agruenba@redhat.com Mon Feb 29 02:18:40 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=ham version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay2.corp.sgi.com [137.38.102.29]) by oss.sgi.com (Postfix) with ESMTP id 7DFDA7CA3 for ; Mon, 29 Feb 2016 02:18:40 -0600 (CST) Received: from cuda.sgi.com (cuda2.sgi.com [192.48.176.25]) by relay2.corp.sgi.com (Postfix) with ESMTP id 53679304032 for ; Mon, 29 Feb 2016 00:18:40 -0800 (PST) X-ASG-Debug-ID: 1456733918-04cbb00b6f8c860001-NocioJ Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by cuda.sgi.com with ESMTP id FRKpHvTbt42U71QM (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO) for ; Mon, 29 Feb 2016 00:18:38 -0800 (PST) X-Barracuda-Envelope-From: agruenba@redhat.com X-Barracuda-Apparent-Source-IP: 209.132.183.28 X-ASG-Whitelist: Client Received: from int-mx09.intmail.prod.int.phx2.redhat.com (int-mx09.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by mx1.redhat.com (Postfix) with ESMTPS id D435E8051B; Mon, 29 Feb 2016 08:18:37 +0000 (UTC) Received: from schleppi.home.com (vpn1-4-25.ams2.redhat.com [10.36.4.25]) by int-mx09.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id u1T8HS6N028000; Mon, 29 Feb 2016 03:18:34 -0500 From: Andreas Gruenbacher To: Alexander Viro Cc: "J. Bruce Fields" , linux-nfs@vger.kernel.org, "Theodore Ts'o" , linux-cifs@vger.kernel.org, linux-api@vger.kernel.org, Trond Myklebust , linux-kernel@vger.kernel.org, xfs@oss.sgi.com, Christoph Hellwig , Andreas Dilger , linux-fsdevel@vger.kernel.org, Jeff Layton , linux-ext4@vger.kernel.org, Anna Schumaker Subject: [PATCH v18 18/22] richacl: xattr mapping functions Date: Mon, 29 Feb 2016 09:17:23 +0100 X-ASG-Orig-Subj: [PATCH v18 18/22] richacl: xattr mapping functions Message-Id: <1456733847-17982-19-git-send-email-agruenba@redhat.com> In-Reply-To: <1456733847-17982-1-git-send-email-agruenba@redhat.com> References: <1456733847-17982-1-git-send-email-agruenba@redhat.com> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.22 X-Barracuda-Connect: mx1.redhat.com[209.132.183.28] X-Barracuda-Start-Time: 1456733918 X-Barracuda-Encrypted: ECDHE-RSA-AES256-GCM-SHA384 X-Barracuda-URL: https://192.48.176.25:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-BRTS-Status: 1 Map between "system.richacl" xattrs and the in-kernel representation. Signed-off-by: Andreas Gruenbacher --- fs/Makefile | 2 +- fs/richacl_xattr.c | 162 +++++++++++++++++++++++++++++++++++++ fs/xattr.c | 29 +++++-- include/linux/richacl_xattr.h | 29 +++++++ include/uapi/linux/Kbuild | 1 + include/uapi/linux/richacl_xattr.h | 44 ++++++++++ include/uapi/linux/xattr.h | 2 + 7 files changed, 262 insertions(+), 7 deletions(-) create mode 100644 fs/richacl_xattr.c create mode 100644 include/linux/richacl_xattr.h create mode 100644 include/uapi/linux/richacl_xattr.h diff --git a/fs/Makefile b/fs/Makefile index d5b45ca..2d6d224 100644 --- a/fs/Makefile +++ b/fs/Makefile @@ -49,7 +49,7 @@ obj-$(CONFIG_SYSCTL) += drop_caches.o obj-$(CONFIG_FHANDLE) += fhandle.o obj-$(CONFIG_FS_RICHACL) += richacl.o -richacl-y := richacl_base.o richacl_inode.o +richacl-y := richacl_base.o richacl_inode.o richacl_xattr.o obj-y += quota/ diff --git a/fs/richacl_xattr.c b/fs/richacl_xattr.c new file mode 100644 index 0000000..a273139 --- /dev/null +++ b/fs/richacl_xattr.c @@ -0,0 +1,162 @@ +/* + * Copyright (C) 2006, 2010 Novell, Inc. + * Copyright (C) 2015 Red Hat, Inc. + * Written by Andreas Gruenbacher + * + * This program is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License as published by the + * Free Software Foundation; either version 2, or (at your option) any + * later version. + * + * This program is distributed in the hope that it will be useful, but + * WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * General Public License for more details. + */ + +#include +#include +#include +#include +#include + +MODULE_LICENSE("GPL"); + +/** + * richacl_from_xattr - convert a richacl xattr into the in-memory representation + */ +struct richacl * +richacl_from_xattr(struct user_namespace *user_ns, + const void *value, size_t size) +{ + const struct richacl_xattr *xattr_acl = value; + const struct richace_xattr *xattr_ace = (void *)(xattr_acl + 1); + struct richacl *acl; + struct richace *ace; + int count; + + if (size < sizeof(*xattr_acl) || + xattr_acl->a_version != RICHACL_XATTR_VERSION || + (xattr_acl->a_flags & ~RICHACL_VALID_FLAGS)) + return ERR_PTR(-EINVAL); + size -= sizeof(*xattr_acl); + count = le16_to_cpu(xattr_acl->a_count); + if (count > RICHACL_XATTR_MAX_COUNT) + return ERR_PTR(-EINVAL); + if (size != count * sizeof(*xattr_ace)) + return ERR_PTR(-EINVAL); + + acl = richacl_alloc(count, GFP_NOFS); + if (!acl) + return ERR_PTR(-ENOMEM); + + acl->a_flags = xattr_acl->a_flags; + acl->a_owner_mask = le32_to_cpu(xattr_acl->a_owner_mask); + if (acl->a_owner_mask & ~RICHACE_VALID_MASK) + goto fail_einval; + acl->a_group_mask = le32_to_cpu(xattr_acl->a_group_mask); + if (acl->a_group_mask & ~RICHACE_VALID_MASK) + goto fail_einval; + acl->a_other_mask = le32_to_cpu(xattr_acl->a_other_mask); + if (acl->a_other_mask & ~RICHACE_VALID_MASK) + goto fail_einval; + + richacl_for_each_entry(ace, acl) { + ace->e_type = le16_to_cpu(xattr_ace->e_type); + ace->e_flags = le16_to_cpu(xattr_ace->e_flags); + ace->e_mask = le32_to_cpu(xattr_ace->e_mask); + + if (ace->e_flags & ~RICHACE_VALID_FLAGS) + goto fail_einval; + if (ace->e_flags & RICHACE_SPECIAL_WHO) { + ace->e_id.special = le32_to_cpu(xattr_ace->e_id); + if (ace->e_id.special > RICHACE_EVERYONE_SPECIAL_ID) + goto fail_einval; + } else if (ace->e_flags & RICHACE_IDENTIFIER_GROUP) { + u32 id = le32_to_cpu(xattr_ace->e_id); + + ace->e_id.gid = make_kgid(user_ns, id); + if (!gid_valid(ace->e_id.gid)) + goto fail_einval; + } else { + u32 id = le32_to_cpu(xattr_ace->e_id); + + ace->e_id.uid = make_kuid(user_ns, id); + if (!uid_valid(ace->e_id.uid)) + goto fail_einval; + } + if (ace->e_type > RICHACE_ACCESS_DENIED_ACE_TYPE || + (ace->e_mask & ~RICHACE_VALID_MASK)) + goto fail_einval; + + xattr_ace++; + } + + return acl; + +fail_einval: + richacl_put(acl); + return ERR_PTR(-EINVAL); +} +EXPORT_SYMBOL_GPL(richacl_from_xattr); + +/** + * richacl_xattr_size - compute the size of the xattr representation of @acl + */ +size_t +richacl_xattr_size(const struct richacl *acl) +{ + size_t size = sizeof(struct richacl_xattr); + + size += sizeof(struct richace_xattr) * acl->a_count; + return size; +} +EXPORT_SYMBOL_GPL(richacl_xattr_size); + +/** + * richacl_to_xattr - convert @acl into its xattr representation + * @acl: the richacl to convert + * @buffer: buffer for the result + * @size: size of @buffer + */ +int +richacl_to_xattr(struct user_namespace *user_ns, + const struct richacl *acl, void *buffer, size_t size) +{ + struct richacl_xattr *xattr_acl = buffer; + struct richace_xattr *xattr_ace; + const struct richace *ace; + size_t real_size; + + real_size = richacl_xattr_size(acl); + if (!buffer) + return real_size; + if (real_size > size) + return -ERANGE; + + xattr_acl->a_version = RICHACL_XATTR_VERSION; + xattr_acl->a_flags = acl->a_flags; + xattr_acl->a_count = cpu_to_le16(acl->a_count); + + xattr_acl->a_owner_mask = cpu_to_le32(acl->a_owner_mask); + xattr_acl->a_group_mask = cpu_to_le32(acl->a_group_mask); + xattr_acl->a_other_mask = cpu_to_le32(acl->a_other_mask); + + xattr_ace = (void *)(xattr_acl + 1); + richacl_for_each_entry(ace, acl) { + xattr_ace->e_type = cpu_to_le16(ace->e_type); + xattr_ace->e_flags = cpu_to_le16(ace->e_flags); + xattr_ace->e_mask = cpu_to_le32(ace->e_mask); + if (ace->e_flags & RICHACE_SPECIAL_WHO) + xattr_ace->e_id = cpu_to_le32(ace->e_id.special); + else if (ace->e_flags & RICHACE_IDENTIFIER_GROUP) + xattr_ace->e_id = + cpu_to_le32(from_kgid(user_ns, ace->e_id.gid)); + else + xattr_ace->e_id = + cpu_to_le32(from_kuid(user_ns, ace->e_id.uid)); + xattr_ace++; + } + return real_size; +} +EXPORT_SYMBOL_GPL(richacl_to_xattr); diff --git a/fs/xattr.c b/fs/xattr.c index 07d0e47..d29e067 100644 --- a/fs/xattr.c +++ b/fs/xattr.c @@ -295,6 +295,16 @@ out: } EXPORT_SYMBOL_GPL(vfs_removexattr); +static void +fix_xattr_from_user(const char *kname, void *kvalue, size_t size) +{ + if (strncmp(kname, XATTR_SYSTEM_PREFIX, XATTR_SYSTEM_PREFIX_LEN)) + return; + kname += XATTR_SYSTEM_PREFIX_LEN; + if (!strcmp(kname, XATTR_POSIX_ACL_ACCESS) || + !strcmp(kname, XATTR_POSIX_ACL_DEFAULT)) + posix_acl_fix_xattr_from_user(kvalue, size); +} /* * Extended attribute SET operations @@ -329,9 +339,7 @@ setxattr(struct dentry *d, const char __user *name, const void __user *value, error = -EFAULT; goto out; } - if ((strcmp(kname, XATTR_NAME_POSIX_ACL_ACCESS) == 0) || - (strcmp(kname, XATTR_NAME_POSIX_ACL_DEFAULT) == 0)) - posix_acl_fix_xattr_from_user(kvalue, size); + fix_xattr_from_user(kname, kvalue, size); } error = vfs_setxattr(d, kname, kvalue, size, flags); @@ -396,6 +404,17 @@ SYSCALL_DEFINE5(fsetxattr, int, fd, const char __user *, name, return error; } +static void +fix_xattr_to_user(const char *kname, void *kvalue, size_t size) +{ + if (strncmp(kname, XATTR_SYSTEM_PREFIX, XATTR_SYSTEM_PREFIX_LEN)) + return; + kname += XATTR_SYSTEM_PREFIX_LEN; + if (!strcmp(kname, XATTR_POSIX_ACL_ACCESS) || + !strcmp(kname, XATTR_POSIX_ACL_DEFAULT)) + posix_acl_fix_xattr_to_user(kvalue, size); +} + /* * Extended attribute GET operations */ @@ -426,9 +445,7 @@ getxattr(struct dentry *d, const char __user *name, void __user *value, error = vfs_getxattr(d, kname, kvalue, size); if (error > 0) { - if ((strcmp(kname, XATTR_NAME_POSIX_ACL_ACCESS) == 0) || - (strcmp(kname, XATTR_NAME_POSIX_ACL_DEFAULT) == 0)) - posix_acl_fix_xattr_to_user(kvalue, size); + fix_xattr_to_user(kname, kvalue, size); if (size && copy_to_user(value, kvalue, error)) error = -EFAULT; } else if (error == -ERANGE && size >= XATTR_SIZE_MAX) { diff --git a/include/linux/richacl_xattr.h b/include/linux/richacl_xattr.h new file mode 100644 index 0000000..ab67af2 --- /dev/null +++ b/include/linux/richacl_xattr.h @@ -0,0 +1,29 @@ +/* + * Copyright (C) 2006, 2010 Novell, Inc. + * Copyright (C) 2015 Red Hat, Inc. + * Written by Andreas Gruenbacher + * + * This program is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License as published by the + * Free Software Foundation; either version 2, or (at your option) any + * later version. + * + * This program is distributed in the hope that it will be useful, but + * WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * General Public License for more details. + */ + +#ifndef __RICHACL_XATTR_H +#define __RICHACL_XATTR_H + +#include +#include + +extern struct richacl *richacl_from_xattr(struct user_namespace *, const void *, + size_t); +extern size_t richacl_xattr_size(const struct richacl *); +extern int richacl_to_xattr(struct user_namespace *, const struct richacl *, + void *, size_t); + +#endif /* __RICHACL_XATTR_H */ diff --git a/include/uapi/linux/Kbuild b/include/uapi/linux/Kbuild index 6e05dc8..14b8a06 100644 --- a/include/uapi/linux/Kbuild +++ b/include/uapi/linux/Kbuild @@ -352,6 +352,7 @@ header-y += reiserfs_fs.h header-y += reiserfs_xattr.h header-y += resource.h header-y += richacl.h +header-y += richacl_xattr.h header-y += rfkill.h header-y += romfs_fs.h header-y += rose.h diff --git a/include/uapi/linux/richacl_xattr.h b/include/uapi/linux/richacl_xattr.h new file mode 100644 index 0000000..5178ca6 --- /dev/null +++ b/include/uapi/linux/richacl_xattr.h @@ -0,0 +1,44 @@ +/* + * Copyright (C) 2006, 2010 Novell, Inc. + * Copyright (C) 2015 Red Hat, Inc. + * Written by Andreas Gruenbacher + * + * This file is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This file is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + */ + +#ifndef __UAPI_RICHACL_XATTR_H +#define __UAPI_RICHACL_XATTR_H + +#include +#include + +struct richace_xattr { + __le16 e_type; + __le16 e_flags; + __le32 e_mask; + __le32 e_id; +}; + +struct richacl_xattr { + unsigned char a_version; + unsigned char a_flags; + __le16 a_count; + __le32 a_owner_mask; + __le32 a_group_mask; + __le32 a_other_mask; +}; + +#define RICHACL_XATTR_VERSION 0 +#define RICHACL_XATTR_MAX_COUNT \ + ((XATTR_SIZE_MAX - sizeof(struct richacl_xattr)) / \ + sizeof(struct richace_xattr)) + +#endif /* __UAPI_RICHACL_XATTR_H */ diff --git a/include/uapi/linux/xattr.h b/include/uapi/linux/xattr.h index 1590c49..1996903 100644 --- a/include/uapi/linux/xattr.h +++ b/include/uapi/linux/xattr.h @@ -73,5 +73,7 @@ #define XATTR_POSIX_ACL_DEFAULT "posix_acl_default" #define XATTR_NAME_POSIX_ACL_DEFAULT XATTR_SYSTEM_PREFIX XATTR_POSIX_ACL_DEFAULT +#define XATTR_RICHACL "richacl" +#define XATTR_NAME_RICHACL XATTR_SYSTEM_PREFIX XATTR_RICHACL #endif /* _UAPI_LINUX_XATTR_H */ -- 2.4.3 From agruenba@redhat.com Mon Feb 29 02:18:43 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=ham version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay2.corp.sgi.com [137.38.102.29]) by oss.sgi.com (Postfix) with ESMTP id B56567CA0 for ; Mon, 29 Feb 2016 02:18:43 -0600 (CST) Received: from cuda.sgi.com (cuda1.sgi.com [192.48.157.11]) by relay2.corp.sgi.com (Postfix) with ESMTP id 67578304032 for ; Mon, 29 Feb 2016 00:18:43 -0800 (PST) X-ASG-Debug-ID: 1456733921-04bdf002eb8ab20001-NocioJ Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by cuda.sgi.com with ESMTP id 3uFUdPXBgQomYL7o (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO) for ; Mon, 29 Feb 2016 00:18:41 -0800 (PST) X-Barracuda-Envelope-From: agruenba@redhat.com X-Barracuda-Apparent-Source-IP: 209.132.183.28 X-ASG-Whitelist: Client Received: from int-mx09.intmail.prod.int.phx2.redhat.com (int-mx09.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by mx1.redhat.com (Postfix) with ESMTPS id 44F95BBB3D; Mon, 29 Feb 2016 08:18:41 +0000 (UTC) Received: from schleppi.home.com (vpn1-4-25.ams2.redhat.com [10.36.4.25]) by int-mx09.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id u1T8HS6O028000; Mon, 29 Feb 2016 03:18:38 -0500 From: Andreas Gruenbacher To: Alexander Viro Cc: "J. Bruce Fields" , linux-nfs@vger.kernel.org, "Theodore Ts'o" , linux-cifs@vger.kernel.org, linux-api@vger.kernel.org, Trond Myklebust , linux-kernel@vger.kernel.org, xfs@oss.sgi.com, Christoph Hellwig , Andreas Dilger , linux-fsdevel@vger.kernel.org, Jeff Layton , linux-ext4@vger.kernel.org, Anna Schumaker Subject: [PATCH v18 19/22] richacl: Add richacl xattr handler Date: Mon, 29 Feb 2016 09:17:24 +0100 X-ASG-Orig-Subj: [PATCH v18 19/22] richacl: Add richacl xattr handler Message-Id: <1456733847-17982-20-git-send-email-agruenba@redhat.com> In-Reply-To: <1456733847-17982-1-git-send-email-agruenba@redhat.com> References: <1456733847-17982-1-git-send-email-agruenba@redhat.com> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.22 X-Barracuda-Connect: mx1.redhat.com[209.132.183.28] X-Barracuda-Start-Time: 1456733921 X-Barracuda-Encrypted: ECDHE-RSA-AES256-GCM-SHA384 X-Barracuda-URL: https://192.48.157.11:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-BRTS-Status: 1 Add richacl xattr handler implementing the xattr operations based on the get_richacl and set_richacl inode operations. Signed-off-by: Andreas Gruenbacher --- fs/richacl_xattr.c | 73 +++++++++++++++++++++++++++++++++++++++++++ include/linux/richacl_xattr.h | 2 ++ 2 files changed, 75 insertions(+) diff --git a/fs/richacl_xattr.c b/fs/richacl_xattr.c index a273139..afa2859 100644 --- a/fs/richacl_xattr.c +++ b/fs/richacl_xattr.c @@ -18,7 +18,9 @@ #include #include #include +#include #include +#include MODULE_LICENSE("GPL"); @@ -160,3 +162,74 @@ richacl_to_xattr(struct user_namespace *user_ns, return real_size; } EXPORT_SYMBOL_GPL(richacl_to_xattr); + +static bool +richacl_xattr_list(struct dentry *dentry) +{ + return IS_RICHACL(d_backing_inode(dentry)); +} + +static int +richacl_xattr_get(const struct xattr_handler *handler, + struct dentry *dentry, const char *name, void *buffer, + size_t buffer_size) +{ + struct inode *inode = d_backing_inode(dentry); + struct richacl *acl; + int error; + + if (*name) + return -EINVAL; + if (!IS_RICHACL(inode)) + return -EOPNOTSUPP; + if (S_ISLNK(inode->i_mode)) + return -EOPNOTSUPP; + acl = get_richacl(inode); + if (IS_ERR(acl)) + return PTR_ERR(acl); + if (acl == NULL) + return -ENODATA; + error = richacl_to_xattr(current_user_ns(), acl, buffer, buffer_size); + richacl_put(acl); + return error; +} + +static int +richacl_xattr_set(const struct xattr_handler *handler, + struct dentry *dentry, const char *name, + const void *value, size_t size, int flags) +{ + struct inode *inode = d_backing_inode(dentry); + struct richacl *acl = NULL; + int ret; + + if (*name) + return -EINVAL; + if (!IS_RICHACL(inode)) + return -EOPNOTSUPP; + if (!inode->i_op->set_richacl) + return -EOPNOTSUPP; + + if (!uid_eq(current_fsuid(), inode->i_uid) && + inode_permission(inode, MAY_CHMOD) && + !capable(CAP_FOWNER)) + return -EPERM; + + if (value) { + acl = richacl_from_xattr(current_user_ns(), value, size); + if (IS_ERR(acl)) + return PTR_ERR(acl); + } + + ret = inode->i_op->set_richacl(inode, acl); + richacl_put(acl); + return ret; +} + +struct xattr_handler richacl_xattr_handler = { + .name = XATTR_NAME_RICHACL, + .list = richacl_xattr_list, + .get = richacl_xattr_get, + .set = richacl_xattr_set, +}; +EXPORT_SYMBOL(richacl_xattr_handler); diff --git a/include/linux/richacl_xattr.h b/include/linux/richacl_xattr.h index ab67af2..ad4a56e 100644 --- a/include/linux/richacl_xattr.h +++ b/include/linux/richacl_xattr.h @@ -26,4 +26,6 @@ extern size_t richacl_xattr_size(const struct richacl *); extern int richacl_to_xattr(struct user_namespace *, const struct richacl *, void *, size_t); +extern struct xattr_handler richacl_xattr_handler; + #endif /* __RICHACL_XATTR_H */ -- 2.4.3 From agruenba@redhat.com Mon Feb 29 02:18:46 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=ham version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay1.corp.sgi.com [137.38.102.111]) by oss.sgi.com (Postfix) with ESMTP id A4A447CA4 for ; Mon, 29 Feb 2016 02:18:46 -0600 (CST) Received: from cuda.sgi.com (cuda3.sgi.com [192.48.176.15]) by relay1.corp.sgi.com (Postfix) with ESMTP id 6C62B8F8033 for ; Mon, 29 Feb 2016 00:18:46 -0800 (PST) X-ASG-Debug-ID: 1456733924-04cb6c583078330001-NocioJ Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by cuda.sgi.com with ESMTP id fjeftJTDaoTR7dTe (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO) for ; Mon, 29 Feb 2016 00:18:45 -0800 (PST) X-Barracuda-Envelope-From: agruenba@redhat.com X-Barracuda-Apparent-Source-IP: 209.132.183.28 X-ASG-Whitelist: Client Received: from int-mx09.intmail.prod.int.phx2.redhat.com (int-mx09.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by mx1.redhat.com (Postfix) with ESMTPS id 9E3A4AA7; Mon, 29 Feb 2016 08:18:44 +0000 (UTC) Received: from schleppi.home.com (vpn1-4-25.ams2.redhat.com [10.36.4.25]) by int-mx09.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id u1T8HS6P028000; Mon, 29 Feb 2016 03:18:41 -0500 From: Andreas Gruenbacher To: Alexander Viro Cc: "J. Bruce Fields" , linux-nfs@vger.kernel.org, "Theodore Ts'o" , linux-cifs@vger.kernel.org, linux-api@vger.kernel.org, Trond Myklebust , linux-kernel@vger.kernel.org, xfs@oss.sgi.com, Christoph Hellwig , Andreas Dilger , linux-fsdevel@vger.kernel.org, Jeff Layton , linux-ext4@vger.kernel.org, Anna Schumaker Subject: [PATCH v18 20/22] vfs: Add richacl permission checking Date: Mon, 29 Feb 2016 09:17:25 +0100 X-ASG-Orig-Subj: [PATCH v18 20/22] vfs: Add richacl permission checking Message-Id: <1456733847-17982-21-git-send-email-agruenba@redhat.com> In-Reply-To: <1456733847-17982-1-git-send-email-agruenba@redhat.com> References: <1456733847-17982-1-git-send-email-agruenba@redhat.com> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.22 X-Barracuda-Connect: mx1.redhat.com[209.132.183.28] X-Barracuda-Start-Time: 1456733925 X-Barracuda-Encrypted: ECDHE-RSA-AES256-GCM-SHA384 X-Barracuda-URL: https://192.48.176.15:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-BRTS-Status: 1 Hook the richacl permission checking function into the vfs. Signed-off-by: Andreas Gruenbacher --- fs/namei.c | 51 +++++++++++++++++++++++++++++++++++++++++++++++++-- fs/posix_acl.c | 6 +++--- 2 files changed, 52 insertions(+), 5 deletions(-) diff --git a/fs/namei.c b/fs/namei.c index 59b1da0..716c01d 100644 --- a/fs/namei.c +++ b/fs/namei.c @@ -35,6 +35,7 @@ #include #include #include +#include #include #include "internal.h" @@ -255,7 +256,40 @@ void putname(struct filename *name) __putname(name); } -static int check_acl(struct inode *inode, int mask) +static int check_richacl(struct inode *inode, int mask) +{ +#ifdef CONFIG_FS_RICHACL + struct richacl *acl; + + if (mask & MAY_NOT_BLOCK) { + acl = get_cached_richacl_rcu(inode); + if (!acl) + goto no_acl; + /* no ->get_richacl() calls in RCU mode... */ + if (acl == ACL_NOT_CACHED) + return -ECHILD; + return richacl_permission(inode, acl, mask & ~MAY_NOT_BLOCK); + } + + acl = get_richacl(inode); + if (IS_ERR(acl)) + return PTR_ERR(acl); + if (acl) { + int error = richacl_permission(inode, acl, mask); + richacl_put(acl); + return error; + } +no_acl: +#endif + if (mask & (MAY_DELETE_SELF | MAY_TAKE_OWNERSHIP | + MAY_CHMOD | MAY_SET_TIMES)) { + /* File permission bits cannot grant this. */ + return -EACCES; + } + return -EAGAIN; +} + +static int check_posix_acl(struct inode *inode, int mask) { #ifdef CONFIG_FS_POSIX_ACL struct posix_acl *acl; @@ -290,11 +324,24 @@ static int acl_permission_check(struct inode *inode, int mask) { unsigned int mode = inode->i_mode; + /* + * With POSIX ACLs, the (mode & S_IRWXU) bits exactly match the owner + * permissions, and we can skip checking posix acls for the owner. + * With richacls, the owner may be granted fewer permissions than the + * mode bits seem to suggest (for example, append but not write), and + * we always need to check the richacl. + */ + + if (IS_RICHACL(inode)) { + int error = check_richacl(inode, mask); + if (error != -EAGAIN) + return error; + } if (likely(uid_eq(current_fsuid(), inode->i_uid))) mode >>= 6; else { if (IS_POSIXACL(inode) && (mode & S_IRWXG)) { - int error = check_acl(inode, mask); + int error = check_posix_acl(inode, mask); if (error != -EAGAIN) return error; } diff --git a/fs/posix_acl.c b/fs/posix_acl.c index f24646e..7810c6f 100644 --- a/fs/posix_acl.c +++ b/fs/posix_acl.c @@ -100,13 +100,13 @@ struct posix_acl *get_acl(struct inode *inode, int type) { struct posix_acl *acl; + if (!IS_POSIXACL(inode)) + return NULL; + acl = get_cached_acl(inode, type); if (acl != ACL_NOT_CACHED) return acl; - if (!IS_POSIXACL(inode)) - return NULL; - /* * A filesystem can force a ACL callback by just never filling the * ACL cache. But normally you'd fill the cache either at inode -- 2.4.3 From agruenba@redhat.com Mon Feb 29 02:18:51 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=ham version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay3.corp.sgi.com [198.149.34.15]) by oss.sgi.com (Postfix) with ESMTP id 806097CA0 for ; Mon, 29 Feb 2016 02:18:51 -0600 (CST) Received: from cuda.sgi.com (cuda3.sgi.com [192.48.176.15]) by relay3.corp.sgi.com (Postfix) with ESMTP id EA2D1AC002 for ; Mon, 29 Feb 2016 00:18:50 -0800 (PST) X-ASG-Debug-ID: 1456733928-04cb6c583278340001-NocioJ Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by cuda.sgi.com with ESMTP id rXYA3gQAvjeMzCv7 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO) for ; Mon, 29 Feb 2016 00:18:48 -0800 (PST) X-Barracuda-Envelope-From: agruenba@redhat.com X-Barracuda-Apparent-Source-IP: 209.132.183.28 X-ASG-Whitelist: Client Received: from int-mx09.intmail.prod.int.phx2.redhat.com (int-mx09.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by mx1.redhat.com (Postfix) with ESMTPS id 3812AC00F6E2; Mon, 29 Feb 2016 08:18:48 +0000 (UTC) Received: from schleppi.home.com (vpn1-4-25.ams2.redhat.com [10.36.4.25]) by int-mx09.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id u1T8HS6Q028000; Mon, 29 Feb 2016 03:18:44 -0500 From: Andreas Gruenbacher To: Alexander Viro Cc: "Aneesh Kumar K.V" , "J. Bruce Fields" , linux-nfs@vger.kernel.org, "Theodore Ts'o" , linux-cifs@vger.kernel.org, linux-api@vger.kernel.org, Trond Myklebust , linux-kernel@vger.kernel.org, xfs@oss.sgi.com, Christoph Hellwig , Andreas Dilger , linux-fsdevel@vger.kernel.org, Jeff Layton , linux-ext4@vger.kernel.org, Anna Schumaker Subject: [PATCH v18 21/22] ext4: Add richacl support Date: Mon, 29 Feb 2016 09:17:26 +0100 X-ASG-Orig-Subj: [PATCH v18 21/22] ext4: Add richacl support Message-Id: <1456733847-17982-22-git-send-email-agruenba@redhat.com> In-Reply-To: <1456733847-17982-1-git-send-email-agruenba@redhat.com> References: <1456733847-17982-1-git-send-email-agruenba@redhat.com> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.22 X-Barracuda-Connect: mx1.redhat.com[209.132.183.28] X-Barracuda-Start-Time: 1456733928 X-Barracuda-Encrypted: ECDHE-RSA-AES256-GCM-SHA384 X-Barracuda-URL: https://192.48.176.15:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-BRTS-Status: 1 From: "Aneesh Kumar K.V" Support the richacl permission model in ext4. The richacls are stored in "system.richacl" xattrs. Richacls need to be enabled by tune2fs or at file system create time. Signed-off-by: Aneesh Kumar K.V Signed-off-by: Andreas Gruenbacher Reviewed-by: Andreas Dilger --- fs/ext4/Kconfig | 11 +++++ fs/ext4/Makefile | 1 + fs/ext4/file.c | 3 ++ fs/ext4/ialloc.c | 11 ++++- fs/ext4/inode.c | 12 ++++- fs/ext4/namei.c | 5 ++ fs/ext4/richacl.c | 142 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ fs/ext4/richacl.h | 40 +++++++++++++++ fs/ext4/xattr.c | 7 +++ 9 files changed, 229 insertions(+), 3 deletions(-) create mode 100644 fs/ext4/richacl.c create mode 100644 fs/ext4/richacl.h diff --git a/fs/ext4/Kconfig b/fs/ext4/Kconfig index b46e9fc..4e21c18 100644 --- a/fs/ext4/Kconfig +++ b/fs/ext4/Kconfig @@ -22,6 +22,17 @@ config EXT3_FS_POSIX_ACL This config option is here only for backward compatibility. ext3 filesystem is now handled by the ext4 driver. +config EXT4_FS_RICHACL + bool "Ext4 Rich Access Control Lists" + depends on EXT4_FS + select FS_RICHACL + help + Richacls are an implementation of NFSv4 ACLs, extended by file masks + to cleanly integrate into the POSIX file permission model. To learn + more about them, see http://www.bestbits.at/richacl/. + + If you don't know what Richacls are, say N. + config EXT3_FS_SECURITY bool "Ext3 Security Labels" depends on EXT3_FS diff --git a/fs/ext4/Makefile b/fs/ext4/Makefile index f52cf54..1fb7f11 100644 --- a/fs/ext4/Makefile +++ b/fs/ext4/Makefile @@ -14,3 +14,4 @@ ext4-$(CONFIG_EXT4_FS_POSIX_ACL) += acl.o ext4-$(CONFIG_EXT4_FS_SECURITY) += xattr_security.o ext4-$(CONFIG_EXT4_FS_ENCRYPTION) += crypto_policy.o crypto.o \ crypto_key.o crypto_fname.o +ext4-$(CONFIG_EXT4_FS_RICHACL) += richacl.o diff --git a/fs/ext4/file.c b/fs/ext4/file.c index 474f1a4..30bfc50 100644 --- a/fs/ext4/file.c +++ b/fs/ext4/file.c @@ -30,6 +30,7 @@ #include "ext4_jbd2.h" #include "xattr.h" #include "acl.h" +#include "richacl.h" /* * Called when an inode is released. Note that this is different @@ -764,6 +765,8 @@ const struct inode_operations ext4_file_inode_operations = { .removexattr = generic_removexattr, .get_acl = ext4_get_acl, .set_acl = ext4_set_acl, + .get_richacl = ext4_get_richacl, + .set_richacl = ext4_set_richacl, .fiemap = ext4_fiemap, }; diff --git a/fs/ext4/ialloc.c b/fs/ext4/ialloc.c index acc0ad5..f2d31c2 100644 --- a/fs/ext4/ialloc.c +++ b/fs/ext4/ialloc.c @@ -27,6 +27,7 @@ #include "ext4_jbd2.h" #include "xattr.h" #include "acl.h" +#include "richacl.h" #include @@ -729,6 +730,14 @@ out: return ret; } +static inline int +ext4_new_acl(handle_t *handle, struct inode *inode, struct inode *dir) +{ + if (IS_RICHACL(dir)) + return ext4_init_richacl(handle, inode, dir); + return ext4_init_acl(handle, inode, dir); +} + /* * There are two policies for allocating an inode. If the new inode is * a directory, then a forward search is made for a block group with both @@ -1093,7 +1102,7 @@ got: if (err) goto fail_drop; - err = ext4_init_acl(handle, inode, dir); + err = ext4_new_acl(handle, inode, dir); if (err) goto fail_free_drop; diff --git a/fs/ext4/inode.c b/fs/ext4/inode.c index 9cc57c3..ef6fb86 100644 --- a/fs/ext4/inode.c +++ b/fs/ext4/inode.c @@ -42,6 +42,7 @@ #include "xattr.h" #include "acl.h" #include "truncate.h" +#include "richacl.h" #include @@ -4851,6 +4852,14 @@ static void ext4_wait_for_tail_page_commit(struct inode *inode) } } +static inline int +ext4_acl_chmod(struct inode *inode, umode_t mode) +{ + if (IS_RICHACL(inode)) + return richacl_chmod(inode, inode->i_mode); + return posix_acl_chmod(inode, inode->i_mode); +} + /* * ext4_setattr() * @@ -5021,8 +5030,7 @@ int ext4_setattr(struct dentry *dentry, struct iattr *attr) ext4_orphan_del(NULL, inode); if (!rc && (ia_valid & ATTR_MODE)) - rc = posix_acl_chmod(inode, inode->i_mode); - + rc = ext4_acl_chmod(inode, inode->i_mode); err_out: ext4_std_error(inode->i_sb, error); if (!error) diff --git a/fs/ext4/namei.c b/fs/ext4/namei.c index 48e4b89..d86c5f2 100644 --- a/fs/ext4/namei.c +++ b/fs/ext4/namei.c @@ -38,6 +38,7 @@ #include "xattr.h" #include "acl.h" +#include "richacl.h" #include /* @@ -3888,6 +3889,8 @@ const struct inode_operations ext4_dir_inode_operations = { .removexattr = generic_removexattr, .get_acl = ext4_get_acl, .set_acl = ext4_set_acl, + .get_richacl = ext4_get_richacl, + .set_richacl = ext4_set_richacl, .fiemap = ext4_fiemap, }; @@ -3899,4 +3902,6 @@ const struct inode_operations ext4_special_inode_operations = { .removexattr = generic_removexattr, .get_acl = ext4_get_acl, .set_acl = ext4_set_acl, + .get_richacl = ext4_get_richacl, + .set_richacl = ext4_set_richacl, }; diff --git a/fs/ext4/richacl.c b/fs/ext4/richacl.c new file mode 100644 index 0000000..d581be4 --- /dev/null +++ b/fs/ext4/richacl.c @@ -0,0 +1,142 @@ +/* + * Copyright IBM Corporation, 2010 + * Copyright (C) 2015 Red Hat, Inc. + * Author: Aneesh Kumar K.V , + * Andreas Gruenbacher + * + * This program is free software; you can redistribute it and/or modify it + * under the terms of version 2.1 of the GNU Lesser General Public License + * as published by the Free Software Foundation. + * + * This program is distributed in the hope that it would be useful, but + * WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * + */ + +#include +#include +#include + +#include "ext4.h" +#include "ext4_jbd2.h" +#include "xattr.h" +#include "acl.h" +#include "richacl.h" + +struct richacl * +ext4_get_richacl(struct inode *inode) +{ + const int name_index = EXT4_XATTR_INDEX_RICHACL; + void *value = NULL; + struct richacl *acl = NULL; + int retval; + + retval = ext4_xattr_get(inode, name_index, "", NULL, 0); + if (retval > 0) { + value = kmalloc(retval, GFP_NOFS); + if (!value) + return ERR_PTR(-ENOMEM); + retval = ext4_xattr_get(inode, name_index, "", value, retval); + } + if (retval > 0) { + acl = richacl_from_xattr(&init_user_ns, value, retval); + if (acl == ERR_PTR(-EINVAL)) + acl = ERR_PTR(-EIO); + } else if (retval != -ENODATA && retval != -ENOSYS) { + acl = ERR_PTR(retval); + } + kfree(value); + + if (!IS_ERR(acl)) + set_cached_richacl(inode, acl); + + return acl; +} + +static int +__ext4_remove_richacl(handle_t *handle, struct inode *inode) +{ + const int name_index = EXT4_XATTR_INDEX_RICHACL; + int retval; + + retval = ext4_xattr_set_handle(handle, inode, name_index, "", + NULL, 0, 0); + if (!retval) + set_cached_richacl(inode, NULL); + return retval; +} + +static int +__ext4_set_richacl(handle_t *handle, struct inode *inode, struct richacl *acl) +{ + const int name_index = EXT4_XATTR_INDEX_RICHACL; + umode_t mode = inode->i_mode; + int retval, size; + void *value; + + if (richacl_equiv_mode(acl, &mode) == 0) { + inode->i_ctime = ext4_current_time(inode); + inode->i_mode = mode; + ext4_mark_inode_dirty(handle, inode); + return __ext4_remove_richacl(handle, inode); + } + + mode &= ~S_IRWXUGO; + mode |= richacl_masks_to_mode(acl); + + size = richacl_xattr_size(acl); + value = kmalloc(size, GFP_NOFS); + if (!value) + return -ENOMEM; + richacl_to_xattr(&init_user_ns, acl, value, size); + inode->i_mode = mode; + retval = ext4_xattr_set_handle(handle, inode, name_index, "", + value, size, 0); + kfree(value); + if (retval) + return retval; + + set_cached_richacl(inode, acl); + + return 0; +} + +int +ext4_set_richacl(struct inode *inode, struct richacl *acl) +{ + handle_t *handle; + int retval, retries = 0; + +retry: + handle = ext4_journal_start(inode, EXT4_HT_XATTR, + ext4_jbd2_credits_xattr(inode)); + if (IS_ERR(handle)) + return PTR_ERR(handle); + + if (acl) + retval = __ext4_set_richacl(handle, inode, acl); + else + retval = __ext4_remove_richacl(handle, inode); + + ext4_journal_stop(handle); + if (retval == -ENOSPC && ext4_should_retry_alloc(inode->i_sb, &retries)) + goto retry; + return retval; +} + +int +ext4_init_richacl(handle_t *handle, struct inode *inode, struct inode *dir) +{ + struct richacl *acl = richacl_create(&inode->i_mode, dir); + int error; + + error = PTR_ERR(acl); + if (IS_ERR(acl)) + return error; + if (acl) { + error = __ext4_set_richacl(handle, inode, acl); + richacl_put(acl); + } + return error; +} diff --git a/fs/ext4/richacl.h b/fs/ext4/richacl.h new file mode 100644 index 0000000..6fe9a92 --- /dev/null +++ b/fs/ext4/richacl.h @@ -0,0 +1,40 @@ +/* + * Copyright IBM Corporation, 2010 + * Copyright (C) 2015 Red Hat, Inc. + * Author Aneesh Kumar K.V + * + * This program is free software; you can redistribute it and/or modify it + * under the terms of version 2.1 of the GNU Lesser General Public License + * as published by the Free Software Foundation. + * + * This program is distributed in the hope that it would be useful, but + * WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * + */ + +#ifndef __FS_EXT4_RICHACL_H +#define __FS_EXT4_RICHACL_H + +#include + +#ifdef CONFIG_EXT4_FS_RICHACL + +extern struct richacl *ext4_get_richacl(struct inode *); +extern int ext4_set_richacl(struct inode *, struct richacl *); + +extern int ext4_init_richacl(handle_t *, struct inode *, struct inode *); + +#else /* CONFIG_EXT4_FS_RICHACL */ + +#define ext4_get_richacl NULL +#define ext4_set_richacl NULL + +static inline int +ext4_init_richacl(handle_t *handle, struct inode *inode, struct inode *dir) +{ + return 0; +} + +#endif /* CONFIG_EXT4_FS_RICHACL */ +#endif /* __FS_EXT4_RICHACL_H */ diff --git a/fs/ext4/xattr.c b/fs/ext4/xattr.c index a95151e..ef76630 100644 --- a/fs/ext4/xattr.c +++ b/fs/ext4/xattr.c @@ -55,6 +55,7 @@ #include #include #include +#include #include "ext4_jbd2.h" #include "ext4.h" #include "xattr.h" @@ -97,6 +98,9 @@ static const struct xattr_handler *ext4_xattr_handler_map[] = { #ifdef CONFIG_EXT4_FS_SECURITY [EXT4_XATTR_INDEX_SECURITY] = &ext4_xattr_security_handler, #endif +#ifdef CONFIG_EXT4_FS_RICHACL + [EXT4_XATTR_INDEX_RICHACL] = &richacl_xattr_handler, +#endif }; const struct xattr_handler *ext4_xattr_handlers[] = { @@ -109,6 +113,9 @@ const struct xattr_handler *ext4_xattr_handlers[] = { #ifdef CONFIG_EXT4_FS_SECURITY &ext4_xattr_security_handler, #endif +#ifdef CONFIG_EXT4_FS_RICHACL + &richacl_xattr_handler, +#endif NULL }; -- 2.4.3 From agruenba@redhat.com Mon Feb 29 02:18:54 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=ham version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay2.corp.sgi.com [137.38.102.29]) by oss.sgi.com (Postfix) with ESMTP id 09A187F95 for ; Mon, 29 Feb 2016 02:18:54 -0600 (CST) Received: from cuda.sgi.com (cuda3.sgi.com [192.48.176.15]) by relay2.corp.sgi.com (Postfix) with ESMTP id D3661304039 for ; Mon, 29 Feb 2016 00:18:53 -0800 (PST) X-ASG-Debug-ID: 1456733932-04cb6c583178340001-NocioJ Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by cuda.sgi.com with ESMTP id PWGAVvBDajKdMWkN (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO) for ; Mon, 29 Feb 2016 00:18:52 -0800 (PST) X-Barracuda-Envelope-From: agruenba@redhat.com X-Barracuda-Apparent-Source-IP: 209.132.183.28 X-ASG-Whitelist: Client Received: from int-mx09.intmail.prod.int.phx2.redhat.com (int-mx09.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by mx1.redhat.com (Postfix) with ESMTPS id D1DD085A02; Mon, 29 Feb 2016 08:18:51 +0000 (UTC) Received: from schleppi.home.com (vpn1-4-25.ams2.redhat.com [10.36.4.25]) by int-mx09.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id u1T8HS6R028000; Mon, 29 Feb 2016 03:18:48 -0500 From: Andreas Gruenbacher To: Alexander Viro Cc: "Aneesh Kumar K.V" , "J. Bruce Fields" , linux-nfs@vger.kernel.org, "Theodore Ts'o" , linux-cifs@vger.kernel.org, linux-api@vger.kernel.org, Trond Myklebust , linux-kernel@vger.kernel.org, xfs@oss.sgi.com, Christoph Hellwig , Andreas Dilger , linux-fsdevel@vger.kernel.org, Jeff Layton , linux-ext4@vger.kernel.org, Anna Schumaker Subject: [PATCH v18 22/22] ext4: Add richacl feature flag Date: Mon, 29 Feb 2016 09:17:27 +0100 X-ASG-Orig-Subj: [PATCH v18 22/22] ext4: Add richacl feature flag Message-Id: <1456733847-17982-23-git-send-email-agruenba@redhat.com> In-Reply-To: <1456733847-17982-1-git-send-email-agruenba@redhat.com> References: <1456733847-17982-1-git-send-email-agruenba@redhat.com> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.22 X-Barracuda-Connect: mx1.redhat.com[209.132.183.28] X-Barracuda-Start-Time: 1456733932 X-Barracuda-Encrypted: ECDHE-RSA-AES256-GCM-SHA384 X-Barracuda-URL: https://192.48.176.15:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-BRTS-Status: 1 From: "Aneesh Kumar K.V" This feature flag selects richacl instead of POSIX ACL support on the filesystem. When this feature is off, the "acl" and "noacl" mount options control whether POSIX ACLs are enabled. When it is on, richacls are automatically enabled and using the "noacl" mount option leads to an error. Signed-off-by: Aneesh Kumar K.V Signed-off-by: Andreas Gruenbacher Reviewed-by: Andreas Dilger --- fs/ext4/ext4.h | 6 ++++-- fs/ext4/super.c | 49 ++++++++++++++++++++++++++++++++++++++++--------- 2 files changed, 44 insertions(+), 11 deletions(-) diff --git a/fs/ext4/ext4.h b/fs/ext4/ext4.h index 157b458..44277f9 100644 --- a/fs/ext4/ext4.h +++ b/fs/ext4/ext4.h @@ -1092,7 +1092,7 @@ struct ext4_inode_info { #define EXT4_MOUNT_UPDATE_JOURNAL 0x01000 /* Update the journal format */ #define EXT4_MOUNT_NO_UID32 0x02000 /* Disable 32-bit UIDs */ #define EXT4_MOUNT_XATTR_USER 0x04000 /* Extended user attributes */ -#define EXT4_MOUNT_POSIX_ACL 0x08000 /* POSIX Access Control Lists */ +#define EXT4_MOUNT_ACL 0x08000 /* Access Control Lists */ #define EXT4_MOUNT_NO_AUTO_DA_ALLOC 0x10000 /* No auto delalloc mapping */ #define EXT4_MOUNT_BARRIER 0x20000 /* Use block barriers */ #define EXT4_MOUNT_QUOTA 0x80000 /* Some quota option set */ @@ -1690,6 +1690,7 @@ static inline int ext4_encrypted_inode(struct inode *inode) #define EXT4_FEATURE_INCOMPAT_LARGEDIR 0x4000 /* >2GB or 3-lvl htree */ #define EXT4_FEATURE_INCOMPAT_INLINE_DATA 0x8000 /* data in inode */ #define EXT4_FEATURE_INCOMPAT_ENCRYPT 0x10000 +#define EXT4_FEATURE_INCOMPAT_RICHACL 0x20000 #define EXT4_FEATURE_COMPAT_FUNCS(name, flagname) \ static inline bool ext4_has_feature_##name(struct super_block *sb) \ @@ -1804,7 +1805,8 @@ EXT4_FEATURE_INCOMPAT_FUNCS(encrypt, ENCRYPT) EXT4_FEATURE_INCOMPAT_MMP | \ EXT4_FEATURE_INCOMPAT_INLINE_DATA | \ EXT4_FEATURE_INCOMPAT_ENCRYPT | \ - EXT4_FEATURE_INCOMPAT_CSUM_SEED) + EXT4_FEATURE_INCOMPAT_CSUM_SEED | \ + EXT4_FEATURE_INCOMPAT_RICHACL) #define EXT4_FEATURE_RO_COMPAT_SUPP (EXT4_FEATURE_RO_COMPAT_SPARSE_SUPER| \ EXT4_FEATURE_RO_COMPAT_LARGE_FILE| \ EXT4_FEATURE_RO_COMPAT_GDT_CSUM| \ diff --git a/fs/ext4/super.c b/fs/ext4/super.c index 3ed01ec..2ed8485 100644 --- a/fs/ext4/super.c +++ b/fs/ext4/super.c @@ -1305,6 +1305,28 @@ static ext4_fsblk_t get_sb_block(void **data) return sb_block; } +static int enable_acl(struct super_block *sb) +{ + sb->s_flags &= ~(MS_POSIXACL | MS_RICHACL); + if (test_opt(sb, ACL)) { + if (EXT4_HAS_INCOMPAT_FEATURE(sb, + EXT4_FEATURE_INCOMPAT_RICHACL)) { +#ifdef CONFIG_EXT4_FS_RICHACL + sb->s_flags |= MS_RICHACL; +#else + return -EOPNOTSUPP; +#endif + } else { +#ifdef CONFIG_EXT4_FS_POSIX_ACL + sb->s_flags |= MS_POSIXACL; +#else + return -EOPNOTSUPP; +#endif + } + } + return 0; +} + #define DEFAULT_JOURNAL_IOPRIO (IOPRIO_PRIO_VALUE(IOPRIO_CLASS_BE, 3)) static char deprecated_msg[] = "Mount option \"%s\" will be removed by %s\n" "Contact linux-ext4@vger.kernel.org if you think we should keep it.\n"; @@ -1451,9 +1473,9 @@ static const struct mount_opts { MOPT_NO_EXT2 | MOPT_DATAJ}, {Opt_user_xattr, EXT4_MOUNT_XATTR_USER, MOPT_SET}, {Opt_nouser_xattr, EXT4_MOUNT_XATTR_USER, MOPT_CLEAR}, -#ifdef CONFIG_EXT4_FS_POSIX_ACL - {Opt_acl, EXT4_MOUNT_POSIX_ACL, MOPT_SET}, - {Opt_noacl, EXT4_MOUNT_POSIX_ACL, MOPT_CLEAR}, +#if defined(CONFIG_EXT4_FS_POSIX_ACL) || defined(CONFIG_EXT4_FS_RICHACL) + {Opt_acl, EXT4_MOUNT_ACL, MOPT_SET}, + {Opt_noacl, EXT4_MOUNT_ACL, MOPT_CLEAR}, #else {Opt_acl, 0, MOPT_NOSUPPORT}, {Opt_noacl, 0, MOPT_NOSUPPORT}, @@ -1501,6 +1523,13 @@ static int handle_mount_opt(struct super_block *sb, char *opt, int token, #endif switch (token) { case Opt_noacl: +#ifdef CONFIG_EXT4_FS_RICHACL + if (EXT4_HAS_INCOMPAT_FEATURE(sb, EXT4_FEATURE_INCOMPAT_RICHACL)) { + ext4_msg(sb, KERN_ERR, "Mount option \"%s\" incompatible " + "with richacl feature", opt); + return -1; + } +#endif case Opt_nouser_xattr: ext4_msg(sb, KERN_WARNING, deprecated_msg, opt, "3.5"); break; @@ -3267,8 +3296,8 @@ static int ext4_fill_super(struct super_block *sb, void *data, int silent) set_opt(sb, NO_UID32); /* xattr user namespace & acls are now defaulted on */ set_opt(sb, XATTR_USER); -#ifdef CONFIG_EXT4_FS_POSIX_ACL - set_opt(sb, POSIX_ACL); +#if defined(CONFIG_EXT4_FS_POSIX_ACL) || defined(CONFIG_EXT4_FS_RICHACL) + set_opt(sb, ACL); #endif /* don't forget to enable journal_csum when metadata_csum is enabled. */ if (ext4_has_metadata_csum(sb)) @@ -3351,8 +3380,9 @@ static int ext4_fill_super(struct super_block *sb, void *data, int silent) sb->s_iflags |= SB_I_CGROUPWB; } - sb->s_flags = (sb->s_flags & ~MS_POSIXACL) | - (test_opt(sb, POSIX_ACL) ? MS_POSIXACL : 0); + err = enable_acl(sb); + if (err) + goto failed_mount; if (le32_to_cpu(es->s_rev_level) == EXT4_GOOD_OLD_REV && (ext4_has_compat_features(sb) || @@ -4668,8 +4698,9 @@ static int ext4_remount(struct super_block *sb, int *flags, char *data) if (sbi->s_mount_flags & EXT4_MF_FS_ABORTED) ext4_abort(sb, "Abort forced by user"); - sb->s_flags = (sb->s_flags & ~MS_POSIXACL) | - (test_opt(sb, POSIX_ACL) ? MS_POSIXACL : 0); + err = enable_acl(sb); + if (err) + goto restore_opts; es = sbi->s_es; -- 2.4.3 From alex@zadarastorage.com Mon Feb 29 03:48:01 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: * X-Spam-Status: No, score=1.9 required=5.0 tests=STOX_REPLY_TYPE,T_DKIM_INVALID, T_FRT_PROFILE2 autolearn=no version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay3.corp.sgi.com [198.149.34.15]) by oss.sgi.com (Postfix) with ESMTP id 6FB2D7CA0 for ; Mon, 29 Feb 2016 03:48:01 -0600 (CST) Received: from cuda.sgi.com (cuda2.sgi.com [192.48.176.25]) by relay3.corp.sgi.com (Postfix) with ESMTP id C8118AC001 for ; Mon, 29 Feb 2016 01:48:00 -0800 (PST) X-ASG-Debug-ID: 1456739275-04cbb00b718e630001-NocioJ Received: from mail-wm0-f53.google.com (mail-wm0-f53.google.com [74.125.82.53]) by cuda.sgi.com with ESMTP id NkjzBzlJvIlUY3Ox (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128 verify=NO) for ; Mon, 29 Feb 2016 01:47:56 -0800 (PST) X-Barracuda-Envelope-From: alex@zadarastorage.com X-Barracuda-Apparent-Source-IP: 74.125.82.53 Received: by mail-wm0-f53.google.com with SMTP id p65so60339530wmp.1 for ; Mon, 29 Feb 2016 01:47:56 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=zadarastorage-com.20150623.gappssmtp.com; s=20150623; h=message-id:from:to:cc:references:in-reply-to:subject:date :mime-version:content-transfer-encoding:importance; bh=B5mOtasdKxcDFba9wKrAOEZWi3LbhMGdXJvsA/xU3ps=; b=m9lCF/B1Z2ITUyA3xoY+VkG5/9OLnNxx0HZYbuRPcK5RlXGcIIKcFSLoCu8q8JQAMR sIjNKhiptk4QQKwlHsGH25tFtuoWTBXNu2BhruBxM9jSV6fMLnmanMppV8Y04an8aohb 2KDi2l6FjdbbPjFNmYBBtg9PeEWL0fXbAHJjPrksDEPAhrhhtb2GTwKkDuuOjfCarF69 sxpw++vU/gBQNy49WEdcH5W+o9TMg/8UPIIUyYdJolIDT3M4jUmLxv4q+iph2+7AIJG1 nH4oJBODMlvYnTLjTPoqeXhaoL6D9F57TGqzd4g0F9bzyuu23Nh6owQGXcX+tBKBQgqX tcag== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:message-id:from:to:cc:references:in-reply-to :subject:date:mime-version:content-transfer-encoding:importance; bh=B5mOtasdKxcDFba9wKrAOEZWi3LbhMGdXJvsA/xU3ps=; b=gbJHBeXkMz1Sq2BKFylTMlSrD0MRMZc8xfJEIyX12ExWV4F/3neTtmzIHH9yTEFIFU w7hkrArX9cItw8OHqnpQAvYc8su4m8Eq8yU5bC0EcF1xYeZyK0koBt3HhtbJtaYzkKIc 0Y8xwoTFUWvctQu7R2X0G6W5araPV0a3tFG4q/89Ko/An3JLG7rswRa3e8QaVKVYDaxq c1PqG7WTAle9JUnLxLnmPP+wUO8LixUHpn1WxFckVxc/YZh4cM7cYcFlVgKvmdS8+EBz ne3FNTTXv55a0r5eH6UCihLWWyhHQE169E5QM/p/CPkvAC9VZCDPNihokCjVnIeDJRqf w2iQ== X-Gm-Message-State: AD7BkJLNRLtZNFCby8/dTahrLeWe1fn5v2KT8UF5nYbxd0NuH5GmGBepB2FUUx11LGs/mA== X-Received: by 10.28.97.135 with SMTP id v129mr10879079wmb.90.1456739275602; Mon, 29 Feb 2016 01:47:55 -0800 (PST) Received: from alyakaslap (bzq-169-168-31-234.red.bezeqint.net. [31.168.169.234]) by smtp.gmail.com with ESMTPSA id hx10sm17369160wjb.25.2016.02.29.01.47.53 (version=TLSv1/SSLv3 cipher=OTHER); Mon, 29 Feb 2016 01:47:55 -0800 (PST) Message-ID: From: "Alex Lyakas" To: "Dave Chinner" Cc: , "Christoph Hellwig" , "Danny Shavit" , "Yair Hershko" , "Shyam Kaushik" References: <3685DFAD20214109878873CF81232704@alyakaslap> <20160222212019.GI25832@dastard> <20160222235628.GK25832@dastard> <20160223225926.GN25832@dastard> In-Reply-To: <20160223225926.GN25832@dastard> Subject: Re: xfs resize: primary superblock is not updated immediately Date: Mon, 29 Feb 2016 11:47:54 +0200 X-ASG-Orig-Subj: Re: xfs resize: primary superblock is not updated immediately MIME-Version: 1.0 Content-Type: text/plain; format=flowed; charset="iso-8859-1"; reply-type=original Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal Importance: Normal X-Mailer: Microsoft Windows Live Mail 15.4.3555.308 X-MimeOLE: Produced By Microsoft MimeOLE V15.4.3555.308 X-Barracuda-Connect: mail-wm0-f53.google.com[74.125.82.53] X-Barracuda-Start-Time: 1456739276 X-Barracuda-Encrypted: ECDHE-RSA-AES128-GCM-SHA256 X-Barracuda-URL: https://192.48.176.25:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-BRTS-Status: 1 X-Barracuda-Spam-Score: 0.00 X-Barracuda-Spam-Status: No, SCORE=0.00 using per-user scores of TAG_LEVEL=1000.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.7 tests=BSF_SC0_MISMATCH_TO, DKIM_SIGNED, DKIM_VERIFIED, STOX_REPLY_TYPE X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.3.27436 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 0.00 STOX_REPLY_TYPE STOX_REPLY_TYPE 0.00 BSF_SC0_MISMATCH_TO Envelope rcpt doesn't match header -0.00 DKIM_VERIFIED Domain Keys Identified Mail: signature passes verification 0.00 DKIM_SIGNED Domain Keys Identified Mail: message has a signature Hello Dave, I have tried the same scenario with the 4.5 kernel from about a week ago, latest commit being [1]. The same crash is happening, stack trace being [2]. I am not proficient with xfstests, unfortunately. I tried running them several times, but I am not sure I was doing that properly. As for your question why the "block beyond end of the filesystem fails". I tried to debug it further and added a print into _xfs_buf_find. What happens is that at some point, the sb_dblocks value is updated to the new value, but the in-memory pag object is not created. So the test: eofs = XFS_FSB_TO_BB(btp->bt_mount, btp->bt_mount->m_sb.sb_dblocks); if (blkno < 0 || blkno >= eofs) { ... still holds, but the needed pag does not exist. Here are the results of the prints that I added: Feb 29 11:47:09 vc-00-00-350-dev kernel: [ 91.546542] SGI XFS with ACLs, security attributes, realtime, no debug enabled Feb 29 11:47:09 vc-00-00-350-dev kernel: [ 91.551243] XFS (dm-0): Mounting V4 Filesystem Feb 29 11:47:09 vc-00-00-350-dev kernel: [ 91.576677] XFS (dm-0): Starting recovery (logdev: internal) Feb 29 11:47:09 vc-00-00-350-dev kernel: [ 91.577866] _xfs_buf_find: blkno=0 eofs=200704 >m_sb.sb_dblocks=25088 Feb 29 11:47:09 vc-00-00-350-dev kernel: [ 91.577872] _xfs_buf_find: blkno=0 eofs=200704 >m_sb.sb_dblocks=25088 Feb 29 11:47:09 vc-00-00-350-dev kernel: [ 91.577882] _xfs_buf_find: blkno=0 eofs=200704 >m_sb.sb_dblocks=25088 ===> Here we start seeing the new value of "sb_dblocks" and hence the new value of "eofs": Feb 29 11:47:09 vc-00-00-350-dev kernel: [ 91.606796] _xfs_buf_find: blkno=1 eofs=204800 >m_sb.sb_dblocks=25600 Feb 29 11:47:09 vc-00-00-350-dev kernel: [ 91.606804] _xfs_buf_find: blkno=1 eofs=204800 >m_sb.sb_dblocks=25600 Feb 29 11:47:09 vc-00-00-350-dev kernel: [ 91.606988] _xfs_buf_find: blkno=2 eofs=204800 >m_sb.sb_dblocks=25600 Feb 29 11:47:09 vc-00-00-350-dev kernel: [ 91.606991] _xfs_buf_find: blkno=2 eofs=204800 >m_sb.sb_dblocks=25600 Feb 29 11:47:09 vc-00-00-350-dev kernel: [ 91.607205] _xfs_buf_find: blkno=50177 eofs=204800 >m_sb.sb_dblocks=25600 Feb 29 11:47:09 vc-00-00-350-dev kernel: [ 91.607210] _xfs_buf_find: blkno=50177 eofs=204800 >m_sb.sb_dblocks=25600 Feb 29 11:47:09 vc-00-00-350-dev kernel: [ 91.607375] _xfs_buf_find: blkno=50178 eofs=204800 >m_sb.sb_dblocks=25600 Feb 29 11:47:09 vc-00-00-350-dev kernel: [ 91.607378] _xfs_buf_find: blkno=50178 eofs=204800 >m_sb.sb_dblocks=25600 Feb 29 11:47:09 vc-00-00-350-dev kernel: [ 91.607512] _xfs_buf_find: blkno=100353 eofs=204800 >m_sb.sb_dblocks=25600 Feb 29 11:47:09 vc-00-00-350-dev kernel: [ 91.607515] _xfs_buf_find: blkno=100353 eofs=204800 >m_sb.sb_dblocks=25600 Feb 29 11:47:09 vc-00-00-350-dev kernel: [ 91.607652] _xfs_buf_find: blkno=100354 eofs=204800 >m_sb.sb_dblocks=25600 Feb 29 11:47:09 vc-00-00-350-dev kernel: [ 91.607655] _xfs_buf_find: blkno=100354 eofs=204800 >m_sb.sb_dblocks=25600 Feb 29 11:47:09 vc-00-00-350-dev kernel: [ 91.607829] _xfs_buf_find: blkno=150529 eofs=204800 >m_sb.sb_dblocks=25600 Feb 29 11:47:09 vc-00-00-350-dev kernel: [ 91.607832] _xfs_buf_find: blkno=150529 eofs=204800 >m_sb.sb_dblocks=25600 Feb 29 11:47:09 vc-00-00-350-dev kernel: [ 91.607980] _xfs_buf_find: blkno=150530 eofs=204800 >m_sb.sb_dblocks=25600 Feb 29 11:47:09 vc-00-00-350-dev kernel: [ 91.607982] _xfs_buf_find: blkno=150530 eofs=204800 >m_sb.sb_dblocks=25600 Feb 29 11:47:09 vc-00-00-350-dev kernel: [ 91.608073] _xfs_buf_find: blkno=200705 eofs=204800 >m_sb.sb_dblocks=25600 ===> and here we crash, but as you see, blkno is valid WRT eofs value. Feb 29 11:47:09 vc-00-00-350-dev kernel: [ 91.608120] BUG: unable to handle kernel NULL pointer dereference at 0000000000000098 Just for reference, immediately after the resize, the relevant superblock values are: root@vc-00-00-350-dev:~# xfs_db -r -c "sb 0" -c "p" /dev/mapper/xfs_base | egrep "agc|blocks" blocksize = 4096 dblocks = 25088 rblocks = 0 agblocks = 6272 agcount = 4 rbmblocks = 0 logblocks = 2560 fdblocks = 22508 These values are identical to the values before the resize. Thanks, Alex. [1] commit 84e54c46b2f440a365a5224f1e5f173a462b7cca Merge: 0ecdcd3 4328daa Author: Linus Torvalds Date: Tue Feb 23 19:03:43 2016 -0800 Merge tag 'dm-4.5-fix' of git://git.kernel.org/pub/scm/linux/kernel/git/device-mapper/linux-dm Pull device mapper fix from Mike Snitzer: "Fix a 112 byte leak for each IO request that is requeued while DM multipath is handling faults due to path failures. This leak does not happen if blk-mq DM multipath is used. It only occurs if .request_fn DM multipath is stacked ontop of blk-mq paths (e.g. scsi-mq devices)" * tag 'dm-4.5-fix' of git://git.kernel.org/pub/scm/linux/kernel/git/device-mapper/linux-dm: dm: fix dm_rq_target_io leak on faults with .request_fn DM w/ blk-mq paths [2] Feb 29 11:26:05 vc-00-00-350-dev kernel: [ 100.333515] SGI XFS with ACLs, security attributes, realtime, no debug enabled Feb 29 11:26:05 vc-00-00-350-dev kernel: [ 100.339593] XFS (dm-0): Mounting V4 Filesystem Feb 29 11:26:05 vc-00-00-350-dev kernel: [ 100.355170] XFS (dm-0): Starting recovery (logdev: internal) Feb 29 11:26:05 vc-00-00-350-dev kernel: [ 100.356997] BUG: unable to handle kernel NULL pointer dereference at 0000000000000098 Feb 29 11:26:05 vc-00-00-350-dev kernel: [ 100.357761] IP: [] _raw_spin_lock+0xc/0x30 Feb 29 11:26:05 vc-00-00-350-dev kernel: [ 100.358289] PGD 36675067 PUD 7a47a067 PMD 0 Feb 29 11:26:05 vc-00-00-350-dev kernel: [ 100.358721] Oops: 0002 [#1] SMP Feb 29 11:26:05 vc-00-00-350-dev kernel: [ 100.359050] Modules linked in: xfs libcrc32c nf_conntrack_ipv4 nf_defrag_ipv4 xt_conntrack nf_conntrack ipt_REJECT nf_reject_ipv4 xt_CHECKSUM iptable_mangle xt_tcpudp bridge stp llc ip6table_filter ip6_tables iptable_filter ip_tables x_tables deflate ctr twofish_generic twofish_x86_64_3way xts twofish_x86_64 twofish_common camellia_generic serpent_generic blowfish_generic blowfish_x86_64 blowfish_common cast5_generic cast_common des_generic nfsd cmac auth_rpcgss oid_registry nfs_acl nfs xcbc lockd grace sunrpc fscache rmd160 sha512_generic af_key xfrm_algo ppdev dm_multipath kvm irqbypass ghash_clmulni_intel aesni_intel aes_x86_64 ablk_helper cryptd lrw gf128mul glue_helper mac_hid i2c_piix4 parport_pc serio_raw tpm_tis i6300esb lp parport psmouse floppy Feb 29 11:26:05 vc-00-00-350-dev kernel: [ 100.360932] CPU: 0 PID: 3067 Comm: mount Not tainted 4.5.0-555-generic #1456324867 Feb 29 11:26:05 vc-00-00-350-dev kernel: [ 100.360932] Hardware name: Bochs Bochs, BIOS Bochs 01/01/2007 Feb 29 11:26:05 vc-00-00-350-dev kernel: [ 100.360932] task: ffff88007bc9d580 ti: ffff880079530000 task.ti: ffff880079530000 Feb 29 11:26:05 vc-00-00-350-dev kernel: [ 100.360932] RIP: 0010:[] [] _raw_spin_lock+0xc/0x30 Feb 29 11:26:05 vc-00-00-350-dev kernel: [ 100.360932] RSP: 0018:ffff880079533ac0 EFLAGS: 00010246 Feb 29 11:26:05 vc-00-00-350-dev kernel: [ 100.360932] RAX: 0000000000000000 RBX: ffff880079533bf0 RCX: 0000000000000000 Feb 29 11:26:05 vc-00-00-350-dev kernel: [ 100.360932] RDX: 0000000000000001 RSI: 0000000000000004 RDI: 0000000000000098 Feb 29 11:26:05 vc-00-00-350-dev kernel: [ 100.360932] RBP: ffff880079533b00 R08: 0000000000000001 R09: ffff880079fa56d0 Feb 29 11:26:05 vc-00-00-350-dev kernel: [ 100.360932] R10: ffff880079fa5718 R11: 0000000000000000 R12: 0000000000000001 Feb 29 11:26:05 vc-00-00-350-dev kernel: [ 100.360932] R13: ffff8800365d93c0 R14: 0000000000000001 R15: 0000000000031001 Feb 29 11:26:05 vc-00-00-350-dev kernel: [ 100.360932] FS: 00007fc7b2fd2880(0000) GS:ffff88007fc00000(0000) knlGS:0000000000000000 Feb 29 11:26:05 vc-00-00-350-dev kernel: [ 100.360932] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 Feb 29 11:26:05 vc-00-00-350-dev kernel: [ 100.360932] CR2: 0000000000000098 CR3: 00000000360ed000 CR4: 00000000000406f0 Feb 29 11:26:05 vc-00-00-350-dev kernel: [ 100.360932] Stack: Feb 29 11:26:05 vc-00-00-350-dev kernel: [ 100.360932] ffffffffa03e2656 0000000000000000 0000000000000000 ffff880079533bf0 Feb 29 11:26:05 vc-00-00-350-dev kernel: [ 100.360932] ffff88007a6a6000 0000000000000001 ffff8800365d93c0 0000000000000001 Feb 29 11:26:05 vc-00-00-350-dev kernel: [ 100.360932] ffff880079533b40 ffffffffa03e291a ffff880079533bf8 0000000000000001 Feb 29 11:26:05 vc-00-00-350-dev kernel: [ 100.360932] Call Trace: Feb 29 11:26:05 vc-00-00-350-dev kernel: [ 100.360932] [] ? _xfs_buf_find+0x96/0x330 [xfs] Feb 29 11:26:05 vc-00-00-350-dev kernel: [ 100.360932] [] xfs_buf_get_map+0x2a/0x270 [xfs] Feb 29 11:26:05 vc-00-00-350-dev kernel: [ 100.360932] [] xfs_buf_read_map+0x2d/0x180 [xfs] Feb 29 11:26:05 vc-00-00-350-dev kernel: [ 100.360932] [] xfs_trans_read_buf_map+0xf1/0x300 [xfs] Feb 29 11:26:05 vc-00-00-350-dev kernel: [ 100.360932] [] xfs_read_agf+0x87/0x100 [xfs] Feb 29 11:26:05 vc-00-00-350-dev kernel: [ 100.360932] [] xfs_alloc_read_agf+0x4b/0x130 [xfs] Feb 29 11:26:05 vc-00-00-350-dev kernel: [ 100.360932] [] xfs_alloc_pagf_init+0x1a/0x40 [xfs] Feb 29 11:26:05 vc-00-00-350-dev kernel: [ 100.360932] [] xfs_initialize_perag_data+0x99/0x110 [xfs] Feb 29 11:26:05 vc-00-00-350-dev kernel: [ 100.360932] [] xfs_mountfs+0x608/0x820 [xfs] Feb 29 11:26:05 vc-00-00-350-dev kernel: [ 100.360932] [] xfs_fs_fill_super+0x3be/0x4d0 [xfs] Feb 29 11:26:05 vc-00-00-350-dev kernel: [ 100.360932] [] mount_bdev+0x187/0x1c0 Feb 29 11:26:05 vc-00-00-350-dev kernel: [ 100.360932] [] ? xfs_parseargs+0xa70/0xa70 [xfs] Feb 29 11:26:05 vc-00-00-350-dev kernel: [ 100.360932] [] xfs_fs_mount+0x15/0x20 [xfs] Feb 29 11:26:05 vc-00-00-350-dev kernel: [ 100.360932] [] mount_fs+0x39/0x160 Feb 29 11:26:05 vc-00-00-350-dev kernel: [ 100.360932] [] ? __alloc_percpu+0x15/0x20 Feb 29 11:26:05 vc-00-00-350-dev kernel: [ 100.360932] [] vfs_kern_mount+0x67/0x110 Feb 29 11:26:05 vc-00-00-350-dev kernel: [ 100.360932] [] do_mount+0x225/0xdb0 Feb 29 11:26:05 vc-00-00-350-dev kernel: [ 100.360932] [] ? __fput+0x17d/0x1e0 Feb 29 11:26:05 vc-00-00-350-dev kernel: [ 100.360932] [] ? __kmalloc_track_caller+0x54/0x190 Feb 29 11:26:05 vc-00-00-350-dev kernel: [ 100.360932] [] ? strndup_user+0x41/0xa0 Feb 29 11:26:05 vc-00-00-350-dev kernel: [ 100.360932] [] ? memdup_user+0x42/0x70 Feb 29 11:26:05 vc-00-00-350-dev kernel: [ 100.360932] [] SyS_mount+0x83/0xd0 Feb 29 11:26:05 vc-00-00-350-dev kernel: [ 100.360932] [] entry_SYSCALL_64_fastpath+0x12/0x6a Feb 29 11:26:05 vc-00-00-350-dev kernel: [ 100.360932] Code: 5d c3 ba 01 00 00 00 f0 0f b1 17 85 c0 75 ef b0 01 5d c3 66 66 66 2e 0f 1f 84 00 00 00 00 00 66 66 66 66 90 31 c0 ba 01 00 00 00 0f b1 17 85 c0 75 01 c3 55 89 c6 48 89 e5 e8 10 f7 9a ff 5d Feb 29 11:26:05 vc-00-00-350-dev kernel: [ 100.360932] RIP [] _raw_spin_lock+0xc/0x30 -----Original Message----- From: Dave Chinner Sent: 24 February, 2016 12:59 AM To: Alex Lyakas Cc: xfs@oss.sgi.com ; Christoph Hellwig ; Danny Shavit ; Yair Hershko ; Shyam Kaushik Subject: Re: xfs resize: primary superblock is not updated immediately On Tue, Feb 23, 2016 at 02:25:38PM +0200, Alex Lyakas wrote: > Hi Dave, > > Below is a detailed reproduction scenario of the problem. Can you package this for xfstests and send to fstests@vger.kernel.org, please? > No > snapshots involved, only XFS. The scenario is performed on a VM, > running kernel 3.18.19. And a current kernel (e.g. 4.5-rc5) behaves how? > 9) mount > # mount -o sync /dev/mapper/xfs_base /mnt/xfs/ > > Kernel panics with [2]. It tried to read a buffer beyond the current end of filesystem that log recoery knows about. Given the on-disk superblock had not been updated by the growfs operation, this should have been detected by _xfs_buf_find() and errored out, not tried to look up a per-ag structure that is beyond the current end of filesystem. i.e. the code I pointed out in my previous email failed to detect the situation is it supposed to be protecting against. Why did that "block beyond the end of the filesystem" detection fail? Cheers, Dave. -- Dave Chinner david@fromorbit.com From bfoster@redhat.com Mon Feb 29 08:29:34 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=ham version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay3.corp.sgi.com [198.149.34.15]) by oss.sgi.com (Postfix) with ESMTP id C989C29E05 for ; Mon, 29 Feb 2016 08:29:34 -0600 (CST) Received: from cuda.sgi.com (cuda2.sgi.com [192.48.176.25]) by relay3.corp.sgi.com (Postfix) with ESMTP id 3164DAC007 for ; Mon, 29 Feb 2016 06:29:33 -0800 (PST) X-ASG-Debug-ID: 1456756172-04cbb00b70bf610001-NocioJ Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by cuda.sgi.com with ESMTP id H2p3cAeybv7lMtXa (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO) for ; Mon, 29 Feb 2016 06:29:32 -0800 (PST) X-Barracuda-Envelope-From: bfoster@redhat.com X-Barracuda-Apparent-Source-IP: 209.132.183.28 X-ASG-Whitelist: Client Received: from int-mx10.intmail.prod.int.phx2.redhat.com (int-mx10.intmail.prod.int.phx2.redhat.com [10.5.11.23]) by mx1.redhat.com (Postfix) with ESMTPS id 1F024C0B78A5 for ; Mon, 29 Feb 2016 14:29:32 +0000 (UTC) Received: from bfoster.bfoster (dhcp-41-22.bos.redhat.com [10.18.41.22]) by int-mx10.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id u1TETVEq019294 for ; Mon, 29 Feb 2016 09:29:31 -0500 Received: by bfoster.bfoster (Postfix, from userid 1000) id 888AB125970; Mon, 29 Feb 2016 09:29:30 -0500 (EST) From: Brian Foster To: xfs@oss.sgi.com Subject: [PATCH 3/3] xfs: borrow indirect blocks from freed extent when available Date: Mon, 29 Feb 2016 09:29:30 -0500 X-ASG-Orig-Subj: [PATCH 3/3] xfs: borrow indirect blocks from freed extent when available Message-Id: <1456756170-51248-4-git-send-email-bfoster@redhat.com> In-Reply-To: <1456756170-51248-1-git-send-email-bfoster@redhat.com> References: <1456756170-51248-1-git-send-email-bfoster@redhat.com> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.23 X-Barracuda-Connect: mx1.redhat.com[209.132.183.28] X-Barracuda-Start-Time: 1456756172 X-Barracuda-Encrypted: ECDHE-RSA-AES256-GCM-SHA384 X-Barracuda-URL: https://192.48.176.25:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-BRTS-Status: 1 xfs_bmap_del_extent() handles extent removal from the in-core and on-disk extent lists. When removing a delalloc range, it updates the indirect block reservation appropriately based on the removal. It currently enforces that the new indirect block reservation is less than or equal to the original. This is normally the case in all situations except for in certain cases when the removed range creates a hole in a single delalloc extent, thus splitting a single delalloc extent in two. It is possible with small enough extents to split an indlen==1 extent into two such slightly smaller extents. This leaves one extent with 0 indirect blocks and leads to assert failures in other areas (e.g., xfs_bunmapi() if the extent happens to be removed). Refactor the indirect reservation code into a new helper function invoked by xfs_bunmapi(). Allow the helper to steal blocks from the deleted extent if necessary to satisfy the worst case indirect reservation of the new extents. This is safe now that the caller does not update icsb counters until the extent is removed (such stolen blocks simply remain accounted as allocated). Fall back to the original reservation using the existing algorithm and warn if we end up with extents without any reservation at all to detect this more easily in the future. This allows generic/033 to run on XFS without assert failures. Signed-off-by: Brian Foster --- fs/xfs/libxfs/xfs_bmap.c | 100 ++++++++++++++++++++++++++++++++++++++--------- 1 file changed, 81 insertions(+), 19 deletions(-) diff --git a/fs/xfs/libxfs/xfs_bmap.c b/fs/xfs/libxfs/xfs_bmap.c index 7180104..79688a6 100644 --- a/fs/xfs/libxfs/xfs_bmap.c +++ b/fs/xfs/libxfs/xfs_bmap.c @@ -4721,6 +4721,68 @@ error0: } /* + * When a delalloc extent is split (e.g., due to a hole punch), the original + * indlen reservation must be shared across the two new extents that are left + * behind. + * + * Provided the worst case indlen for two extents, limit the total reservation + * against that of the original extent. We may want to steal blocks from any + * extra that might be available according to the caller to make up a deficiency + * (e.g., if the original reservation consists of one block). The number of such + * stolen blocks is returned. The availability and accounting of stealable + * blocks is the responsibility of the caller. + */ +static xfs_filblks_t +xfs_bmap_limit_indlen( + xfs_filblks_t ores, /* original res. */ + xfs_filblks_t *indlen1, /* ext1 worst indlen */ + xfs_filblks_t *indlen2, /* ext2 worst indlen */ + xfs_filblks_t avail) /* stealable blocks */ +{ + xfs_filblks_t nres; /* new total res. */ + xfs_filblks_t temp; + xfs_filblks_t temp2; + xfs_filblks_t stolen = 0; + + temp = *indlen1; + temp2 = *indlen2; + nres = temp + temp2; + + /* + * Steal as many blocks as we can to try and satisfy the worst case + * indlen of both new extents. + */ + while (nres > ores && avail) { + nres--; + avail--; + stolen++; + } + + /* + * If we've exhausted stealable blocks and still haven't satisfied the + * worst case reservation, we have no choice but to pare back until + * covered by the original reservation. + */ + while (nres > ores) { + if (temp) { + temp--; + nres--; + } + if (nres == ores) + break; + if (temp2) { + temp2--; + nres--; + } + } + + *indlen1 = temp; + *indlen2 = temp2; + + return stolen; +} + +/* * Called by xfs_bmapi to update file extent records and the btree * after removing space (or undoing a delayed allocation). */ @@ -4984,28 +5046,28 @@ xfs_bmap_del_extent( XFS_IFORK_NEXT_SET(ip, whichfork, XFS_IFORK_NEXTENTS(ip, whichfork) + 1); } else { + xfs_filblks_t stolen; ASSERT(whichfork == XFS_DATA_FORK); - temp = xfs_bmap_worst_indlen(ip, temp); + + /* + * Fix up the indlen reservations. We can safely steal + * blocks from the deleted extent as this simply fudges + * the icsb fdblocks accounting in xfs_bunmapi(). + */ + temp = xfs_bmap_worst_indlen(ip, got.br_blockcount); + temp2 = xfs_bmap_worst_indlen(ip, new.br_blockcount); + stolen = xfs_bmap_limit_indlen(da_old, &temp, &temp2, + del->br_blockcount); + da_new = temp + temp2 - stolen; + del->br_blockcount -= stolen; + + /* + * Set the reservation for each extent. Warn if either + * is zero as this can lead to delalloc problems. + */ + WARN_ON_ONCE(!temp || !temp2); xfs_bmbt_set_startblock(ep, nullstartblock((int)temp)); - temp2 = xfs_bmap_worst_indlen(ip, temp2); new.br_startblock = nullstartblock((int)temp2); - da_new = temp + temp2; - while (da_new > da_old) { - if (temp) { - temp--; - da_new--; - xfs_bmbt_set_startblock(ep, - nullstartblock((int)temp)); - } - if (da_new == da_old) - break; - if (temp2) { - temp2--; - da_new--; - new.br_startblock = - nullstartblock((int)temp2); - } - } } trace_xfs_bmap_post_update(ip, *idx, state, _THIS_IP_); xfs_iext_insert(ip, *idx + 1, 1, &new, state); -- 2.4.3 From bfoster@redhat.com Mon Feb 29 08:29:37 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=ham version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay2.corp.sgi.com [137.38.102.29]) by oss.sgi.com (Postfix) with ESMTP id 096D229E05 for ; Mon, 29 Feb 2016 08:29:37 -0600 (CST) Received: from cuda.sgi.com (cuda3.sgi.com [192.48.176.15]) by relay2.corp.sgi.com (Postfix) with ESMTP id CFD06304043 for ; Mon, 29 Feb 2016 06:29:36 -0800 (PST) X-ASG-Debug-ID: 1456756172-04cb6c5830801f0001-NocioJ Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by cuda.sgi.com with ESMTP id VYFz5MDD9AlNtx6i (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO) for ; Mon, 29 Feb 2016 06:29:32 -0800 (PST) X-Barracuda-Envelope-From: bfoster@redhat.com X-Barracuda-Apparent-Source-IP: 209.132.183.28 X-ASG-Whitelist: Client Received: from int-mx14.intmail.prod.int.phx2.redhat.com (int-mx14.intmail.prod.int.phx2.redhat.com [10.5.11.27]) by mx1.redhat.com (Postfix) with ESMTPS id 1AE91804E2 for ; Mon, 29 Feb 2016 14:29:32 +0000 (UTC) Received: from bfoster.bfoster (dhcp-41-22.bos.redhat.com [10.18.41.22]) by int-mx14.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id u1TETVdK001951 for ; Mon, 29 Feb 2016 09:29:31 -0500 Received: by bfoster.bfoster (Postfix, from userid 1000) id 7C18D12596F; Mon, 29 Feb 2016 09:29:30 -0500 (EST) From: Brian Foster To: xfs@oss.sgi.com Subject: [PATCH 2/3] xfs: update icsb freeblocks counter after extent deletion Date: Mon, 29 Feb 2016 09:29:29 -0500 X-ASG-Orig-Subj: [PATCH 2/3] xfs: update icsb freeblocks counter after extent deletion Message-Id: <1456756170-51248-3-git-send-email-bfoster@redhat.com> In-Reply-To: <1456756170-51248-1-git-send-email-bfoster@redhat.com> References: <1456756170-51248-1-git-send-email-bfoster@redhat.com> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.27 X-Barracuda-Connect: mx1.redhat.com[209.132.183.28] X-Barracuda-Start-Time: 1456756172 X-Barracuda-Encrypted: ECDHE-RSA-AES256-GCM-SHA384 X-Barracuda-URL: https://192.48.176.15:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-BRTS-Status: 1 xfs_bunmapi() currently updates the icsb fdblocks counter, unreserves quota, etc. before the extent is deleted by xfs_bmap_del_extent(). The function has problems dividing up the indirect reserved blocks for scenarios where a single delalloc extent is split in two. Particularly, there aren't always enough blocks reserved for multiple extents in a single extent reservation. The solution to this problem is to allow the extent removal code to steal from the deleted extent to meet indirect reservation requirements. Move the block of code in xfs_bmapi() that updates the icsb fdblocks counter to after the call to xfs_bmap_del_extent() to allow the codepath to update the extent record before the free blocks are accounted. Also, reshuffle the code slightly so the delalloc accounting occurs near the xfs_bmap_del_extent() call to provide context for the comments. Signed-off-by: Brian Foster --- fs/xfs/libxfs/xfs_bmap.c | 58 ++++++++++++++++++++++++++++-------------------- 1 file changed, 34 insertions(+), 24 deletions(-) diff --git a/fs/xfs/libxfs/xfs_bmap.c b/fs/xfs/libxfs/xfs_bmap.c index 6a05166..7180104 100644 --- a/fs/xfs/libxfs/xfs_bmap.c +++ b/fs/xfs/libxfs/xfs_bmap.c @@ -5296,31 +5296,7 @@ xfs_bunmapi( goto nodelete; } } - if (wasdel) { - ASSERT(startblockval(del.br_startblock) > 0); - /* Update realtime/data freespace, unreserve quota */ - if (isrt) { - xfs_filblks_t rtexts; - rtexts = XFS_FSB_TO_B(mp, del.br_blockcount); - do_div(rtexts, mp->m_sb.sb_rextsize); - xfs_mod_frextents(mp, (int64_t)rtexts); - (void)xfs_trans_reserve_quota_nblks(NULL, - ip, -((long)del.br_blockcount), 0, - XFS_QMOPT_RES_RTBLKS); - } else { - xfs_mod_fdblocks(mp, (int64_t)del.br_blockcount, - false); - (void)xfs_trans_reserve_quota_nblks(NULL, - ip, -((long)del.br_blockcount), 0, - XFS_QMOPT_RES_REGBLKS); - } - ip->i_delayed_blks -= del.br_blockcount; - if (cur) - cur->bc_private.b.flags |= - XFS_BTCUR_BPRV_WASDEL; - } else if (cur) - cur->bc_private.b.flags &= ~XFS_BTCUR_BPRV_WASDEL; /* * If it's the case where the directory code is running * with no block reservation, and the deleted block is in @@ -5342,11 +5318,45 @@ xfs_bunmapi( error = -ENOSPC; goto error0; } + + /* + * Unreserve quota and update realtime free space, if + * appropriate. If delayed allocation, update the inode delalloc + * counter now and wait to update the sb counters as + * xfs_bmap_del_extent() might need to borrow some blocks. + */ + if (wasdel) { + ASSERT(startblockval(del.br_startblock) > 0); + if (isrt) { + xfs_filblks_t rtexts; + + rtexts = XFS_FSB_TO_B(mp, del.br_blockcount); + do_div(rtexts, mp->m_sb.sb_rextsize); + xfs_mod_frextents(mp, (int64_t)rtexts); + (void)xfs_trans_reserve_quota_nblks(NULL, + ip, -((long)del.br_blockcount), 0, + XFS_QMOPT_RES_RTBLKS); + } else { + (void)xfs_trans_reserve_quota_nblks(NULL, + ip, -((long)del.br_blockcount), 0, + XFS_QMOPT_RES_REGBLKS); + } + ip->i_delayed_blks -= del.br_blockcount; + if (cur) + cur->bc_private.b.flags |= + XFS_BTCUR_BPRV_WASDEL; + } else if (cur) + cur->bc_private.b.flags &= ~XFS_BTCUR_BPRV_WASDEL; + error = xfs_bmap_del_extent(ip, tp, &lastx, flist, cur, &del, &tmp_logflags, whichfork); logflags |= tmp_logflags; if (error) goto error0; + + if (!isrt && wasdel) + xfs_mod_fdblocks(mp, (int64_t)del.br_blockcount, false); + bno = del.br_startoff - 1; nodelete: /* -- 2.4.3 From bfoster@redhat.com Mon Feb 29 08:29:37 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=ham version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay2.corp.sgi.com [137.38.102.29]) by oss.sgi.com (Postfix) with ESMTP id 5816729E06 for ; Mon, 29 Feb 2016 08:29:37 -0600 (CST) Received: from cuda.sgi.com (cuda3.sgi.com [192.48.176.15]) by relay2.corp.sgi.com (Postfix) with ESMTP id 2A9AA304043 for ; Mon, 29 Feb 2016 06:29:37 -0800 (PST) X-ASG-Debug-ID: 1456756172-04cb6c583380200001-NocioJ Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by cuda.sgi.com with ESMTP id cleKFu2O7Dy3IqrR (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO) for ; Mon, 29 Feb 2016 06:29:32 -0800 (PST) X-Barracuda-Envelope-From: bfoster@redhat.com X-Barracuda-Apparent-Source-IP: 209.132.183.28 X-ASG-Whitelist: Client Received: from int-mx14.intmail.prod.int.phx2.redhat.com (int-mx14.intmail.prod.int.phx2.redhat.com [10.5.11.27]) by mx1.redhat.com (Postfix) with ESMTPS id 22326C00B8F3 for ; Mon, 29 Feb 2016 14:29:32 +0000 (UTC) Received: from bfoster.bfoster (dhcp-41-22.bos.redhat.com [10.18.41.22]) by int-mx14.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id u1TETVO3001949 for ; Mon, 29 Feb 2016 09:29:31 -0500 Received: by bfoster.bfoster (Postfix, from userid 1000) id 73E63123DC7; Mon, 29 Feb 2016 09:29:30 -0500 (EST) From: Brian Foster To: xfs@oss.sgi.com Subject: [PATCH RFC 1/3] xfs: debug mode forced buffered write failure Date: Mon, 29 Feb 2016 09:29:28 -0500 X-ASG-Orig-Subj: [PATCH RFC 1/3] xfs: debug mode forced buffered write failure Message-Id: <1456756170-51248-2-git-send-email-bfoster@redhat.com> In-Reply-To: <1456756170-51248-1-git-send-email-bfoster@redhat.com> References: <1456756170-51248-1-git-send-email-bfoster@redhat.com> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.27 X-Barracuda-Connect: mx1.redhat.com[209.132.183.28] X-Barracuda-Start-Time: 1456756172 X-Barracuda-Encrypted: ECDHE-RSA-AES256-GCM-SHA384 X-Barracuda-URL: https://192.48.176.15:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-BRTS-Status: 1 Add a DEBUG mode-only sysfs knob to enable forced buffered write failure. An additional side effect of this mode is brute force killing of delayed allocation blocks in the range of the write. The latter is the prime motiviation behind this patch, as userspace test infrastructure requires a reliable mechanism to create and split delalloc extents without causing extent conversion. Certain fallocate operations (i.e., zero range) were used for this in the past, but the implementations have changed such that delalloc extents are flushed and converted to real blocks, rendering the test useless. Signed-off-by: Brian Foster --- fs/xfs/xfs_aops.c | 9 ++++++- fs/xfs/xfs_mount.h | 9 +++++++ fs/xfs/xfs_sysfs.c | 78 +++++++++++++++++++++++++++++++++++++++++++++++------- 3 files changed, 85 insertions(+), 11 deletions(-) diff --git a/fs/xfs/xfs_aops.c b/fs/xfs/xfs_aops.c index 7a467b3..39968f1 100644 --- a/fs/xfs/xfs_aops.c +++ b/fs/xfs/xfs_aops.c @@ -1473,6 +1473,7 @@ xfs_vm_write_failed( loff_t from = pos & (PAGE_CACHE_SIZE - 1); loff_t to = from + len; struct buffer_head *bh, *head; + struct xfs_mount *mp = XFS_I(inode)->i_mount; /* * The request pos offset might be 32 or 64 bit, this is all fine @@ -1514,7 +1515,8 @@ xfs_vm_write_failed( if (!buffer_delay(bh) && !buffer_unwritten(bh)) continue; - if (!buffer_new(bh) && block_offset < i_size_read(inode)) + if (!mp->m_fail_writes && !buffer_new(bh) && + block_offset < i_size_read(inode)) continue; if (buffer_delay(bh)) @@ -1554,6 +1556,7 @@ xfs_vm_write_begin( pgoff_t index = pos >> PAGE_CACHE_SHIFT; struct page *page; int status; + struct xfs_mount *mp = XFS_I(mapping->host)->i_mount; ASSERT(len <= PAGE_CACHE_SIZE); @@ -1562,6 +1565,8 @@ xfs_vm_write_begin( return -ENOMEM; status = __block_write_begin(page, pos, len, xfs_get_blocks); + if (mp->m_fail_writes) + status = -EIO; if (unlikely(status)) { struct inode *inode = mapping->host; size_t isize = i_size_read(inode); @@ -1574,6 +1579,8 @@ xfs_vm_write_begin( * allocated in this write, not blocks that were previously * written successfully. */ + if (mp->m_fail_writes) + isize = 0; if (pos + len > isize) { ssize_t start = max_t(ssize_t, pos, isize); diff --git a/fs/xfs/xfs_mount.h b/fs/xfs/xfs_mount.h index a4e03ab..083a32a 100644 --- a/fs/xfs/xfs_mount.h +++ b/fs/xfs/xfs_mount.h @@ -147,6 +147,15 @@ typedef struct xfs_mount { * to various other kinds of pain inflicted on the pNFS server. */ __uint32_t m_generation; + + /* + * DEBUG mode instrumentation to test and/or trigger delayed allocation + * block killing in the event of failed writes. When enabled, all + * buffered writes are forced to fail. All delalloc blocks in the range + * of the write (including pre-existing delalloc blocks!) are tossed as + * part of the write failure error handling sequence. + */ + bool m_fail_writes; } xfs_mount_t; /* diff --git a/fs/xfs/xfs_sysfs.c b/fs/xfs/xfs_sysfs.c index 641d625..5f2d28d 100644 --- a/fs/xfs/xfs_sysfs.c +++ b/fs/xfs/xfs_sysfs.c @@ -22,6 +22,9 @@ #include "xfs_log.h" #include "xfs_log_priv.h" #include "xfs_stats.h" +#include "libxfs/xfs_trans_resv.h" +#include "libxfs/xfs_format.h" +#include "xfs_mount.h" struct xfs_sysfs_attr { struct attribute attr; @@ -45,16 +48,6 @@ to_attr(struct attribute *attr) #define ATTR_LIST(name) &xfs_sysfs_attr_##name.attr -/* - * xfs_mount kobject. This currently has no attributes and thus no need for show - * and store helpers. The mp kobject serves as the per-mount parent object that - * is identified by the fsname under sysfs. - */ - -struct kobj_type xfs_mp_ktype = { - .release = xfs_sysfs_release, -}; - STATIC ssize_t xfs_sysfs_object_show( struct kobject *kobject, @@ -83,6 +76,71 @@ static const struct sysfs_ops xfs_sysfs_ops = { .store = xfs_sysfs_object_store, }; +/* + * xfs_mount kobject. The mp kobject also serves as the per-mount parent object + * that is identified by the fsname under sysfs. + */ + +static inline struct xfs_mount * +to_mp(struct kobject *kobject) +{ + struct xfs_kobj *kobj = to_kobj(kobject); + + return container_of(kobj, struct xfs_mount, m_kobj); +} + +#ifdef DEBUG + +STATIC ssize_t +fail_writes_store( + struct kobject *kobject, + const char *buf, + size_t count) +{ + struct xfs_mount *mp = to_mp(kobject); + int ret; + int val; + + ret = kstrtoint(buf, 0, &val); + if (ret) + return ret; + + if (val == 1) + mp->m_fail_writes = true; + else if (val == 0) + mp->m_fail_writes = false; + else + return -EINVAL; + + return count; +} + +STATIC ssize_t +fail_writes_show( + struct kobject *kobject, + char *buf) +{ + struct xfs_mount *mp = to_mp(kobject); + + return snprintf(buf, PAGE_SIZE, "%d\n", mp->m_fail_writes ? 1 : 0); +} +XFS_SYSFS_ATTR_RW(fail_writes); + +#endif /* DEBUG */ + +static struct attribute *xfs_mp_attrs[] = { +#ifdef DEBUG + ATTR_LIST(fail_writes), +#endif + NULL, +}; + +struct kobj_type xfs_mp_ktype = { + .release = xfs_sysfs_release, + .sysfs_ops = &xfs_sysfs_ops, + .default_attrs = xfs_mp_attrs, +}; + #ifdef DEBUG /* debug */ -- 2.4.3 From bfoster@redhat.com Mon Feb 29 08:29:39 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=ham version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay2.corp.sgi.com [137.38.102.29]) by oss.sgi.com (Postfix) with ESMTP id B97E529E12 for ; Mon, 29 Feb 2016 08:29:39 -0600 (CST) Received: from cuda.sgi.com (cuda3.sgi.com [192.48.176.15]) by relay2.corp.sgi.com (Postfix) with ESMTP id 8AF9830404E for ; Mon, 29 Feb 2016 06:29:36 -0800 (PST) X-ASG-Debug-ID: 1456756171-04cb6c5831801f0001-NocioJ Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by cuda.sgi.com with ESMTP id 7DInGj3TSQhwxaeE (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO) for ; Mon, 29 Feb 2016 06:29:32 -0800 (PST) X-Barracuda-Envelope-From: bfoster@redhat.com X-Barracuda-Apparent-Source-IP: 209.132.183.28 X-ASG-Whitelist: Client Received: from int-mx13.intmail.prod.int.phx2.redhat.com (int-mx13.intmail.prod.int.phx2.redhat.com [10.5.11.26]) by mx1.redhat.com (Postfix) with ESMTPS id B6CA3C0B78A0 for ; Mon, 29 Feb 2016 14:29:31 +0000 (UTC) Received: from bfoster.bfoster (dhcp-41-22.bos.redhat.com [10.18.41.22]) by int-mx13.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id u1TETVG9005216 for ; Mon, 29 Feb 2016 09:29:31 -0500 Received: by bfoster.bfoster (Postfix, from userid 1000) id 6747712596E; Mon, 29 Feb 2016 09:29:30 -0500 (EST) From: Brian Foster To: xfs@oss.sgi.com Subject: [PATCH v2 0/3] fix up indlen reservations on extent split Date: Mon, 29 Feb 2016 09:29:27 -0500 X-ASG-Orig-Subj: [PATCH v2 0/3] fix up indlen reservations on extent split Message-Id: <1456756170-51248-1-git-send-email-bfoster@redhat.com> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.26 X-Barracuda-Connect: mx1.redhat.com[209.132.183.28] X-Barracuda-Start-Time: 1456756172 X-Barracuda-Encrypted: ECDHE-RSA-AES256-GCM-SHA384 X-Barracuda-URL: https://192.48.176.15:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-BRTS-Status: 1 Hi all, This is a resurrection of an old fix for the indirect delalloc reservation split problem. The last version apparently fell through the cracks. The core problem and fix is the same and is described in patch 3. The original problem is not as reproducible as it was since the last version of this patch. The original zero range reproducer doesn't work because zero range has since been updated to flush and invalidate the affected range rather than kill any delayed allocation blocks in the in core extent tree. The side effect of this is that the problem does not currently have a clear reproducer, but the indirect reservation management code is still incorrect nonetheless. As a result, I've prepended an RFC test instrumentation patch that can help induce the problem[1]. I've marked the patch RFC simply because it is hacky and probably up in the air as to whether it is merge worthy. I wanted to have _something_ to help reproduce the problem and verify the fix, however, hence it is included here. I'm fine with either merging it or using it as a one-off verification and dropping it. Also, any other ideas for a more simple/elegant reproducer are welcome. Thoughts, reviews, flames appreciated. Brian [1] An update to the original xfstests test is also required. I'll send that update in a reply to this cover letter shortly. v2: - Rebase to latest for-next branch. - Include RFC test instrumentation patch. v1: http://oss.sgi.com/archives/xfs/2014-10/msg00294.html - xfs_bunmapi() code into independent patch. - Refactor fix into separate helper function. rfc: http://oss.sgi.com/archives/xfs/2014-09/msg00337.html Brian Foster (3): xfs: debug mode forced buffered write failure xfs: update icsb freeblocks counter after extent deletion xfs: borrow indirect blocks from freed extent when available fs/xfs/libxfs/xfs_bmap.c | 158 ++++++++++++++++++++++++++++++++++------------- fs/xfs/xfs_aops.c | 9 ++- fs/xfs/xfs_mount.h | 9 +++ fs/xfs/xfs_sysfs.c | 78 ++++++++++++++++++++--- 4 files changed, 200 insertions(+), 54 deletions(-) -- 2.4.3 From bfoster@redhat.com Mon Feb 29 08:36:26 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=LOTS_OF_MONEY autolearn=ham version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay2.corp.sgi.com [137.38.102.29]) by oss.sgi.com (Postfix) with ESMTP id B5DF329E06 for ; Mon, 29 Feb 2016 08:36:26 -0600 (CST) Received: from cuda.sgi.com (cuda1.sgi.com [192.48.157.11]) by relay2.corp.sgi.com (Postfix) with ESMTP id 4D685304039 for ; Mon, 29 Feb 2016 06:36:26 -0800 (PST) X-ASG-Debug-ID: 1456756584-04bdf002ec96b20001-NocioJ Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by cuda.sgi.com with ESMTP id h7eEUmoz1mCBdia8 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO) for ; Mon, 29 Feb 2016 06:36:25 -0800 (PST) X-Barracuda-Envelope-From: bfoster@redhat.com X-Barracuda-Apparent-Source-IP: 209.132.183.28 X-ASG-Whitelist: Client Received: from int-mx09.intmail.prod.int.phx2.redhat.com (int-mx09.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by mx1.redhat.com (Postfix) with ESMTPS id C0CCF486D7 for ; Mon, 29 Feb 2016 14:36:24 +0000 (UTC) Received: from bfoster.bfoster (dhcp-41-22.bos.redhat.com [10.18.41.22]) by int-mx09.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id u1TEaOc8001438 for ; Mon, 29 Feb 2016 09:36:24 -0500 Received: by bfoster.bfoster (Postfix, from userid 1000) id 5861112596E; Mon, 29 Feb 2016 09:36:23 -0500 (EST) Date: Mon, 29 Feb 2016 09:36:23 -0500 From: Brian Foster To: xfs@oss.sgi.com Subject: Re: [PATCH v2 0/3] fix up indlen reservations on extent split Message-ID: <20160229143621.GA47880@bfoster.bfoster> X-ASG-Orig-Subj: Re: [PATCH v2 0/3] fix up indlen reservations on extent split References: <1456756170-51248-1-git-send-email-bfoster@redhat.com> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="5/uDoXvLw7AC5HRs" Content-Disposition: inline In-Reply-To: <1456756170-51248-1-git-send-email-bfoster@redhat.com> User-Agent: Mutt/1.5.24 (2015-08-30) X-Scanned-By: MIMEDefang 2.68 on 10.5.11.22 X-Barracuda-Connect: mx1.redhat.com[209.132.183.28] X-Barracuda-Start-Time: 1456756585 X-Barracuda-Encrypted: ECDHE-RSA-AES256-GCM-SHA384 X-Barracuda-URL: https://192.48.157.11:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-BRTS-Status: 1 --5/uDoXvLw7AC5HRs Content-Type: text/plain; charset=us-ascii Content-Disposition: inline On Mon, Feb 29, 2016 at 09:29:27AM -0500, Brian Foster wrote: > Hi all, > > This is a resurrection of an old fix for the indirect delalloc > reservation split problem. The last version apparently fell through the > cracks. The core problem and fix is the same and is described in patch > 3. > > The original problem is not as reproducible as it was since the last > version of this patch. The original zero range reproducer doesn't work > because zero range has since been updated to flush and invalidate the > affected range rather than kill any delayed allocation blocks in the in > core extent tree. The side effect of this is that the problem does not > currently have a clear reproducer, but the indirect reservation > management code is still incorrect nonetheless. > > As a result, I've prepended an RFC test instrumentation patch that can > help induce the problem[1]. I've marked the patch RFC simply because it > is hacky and probably up in the air as to whether it is merge worthy. I > wanted to have _something_ to help reproduce the problem and verify the > fix, however, hence it is included here. I'm fine with either merging it > or using it as a one-off verification and dropping it. Also, any other > ideas for a more simple/elegant reproducer are welcome. > > Thoughts, reviews, flames appreciated. > > Brian > > [1] An update to the original xfstests test is also required. I'll send > that update in a reply to this cover letter shortly. > Attached are a couple patches to update the test as described here. I'm sending them as attachments because they aren't worth reviewing unless patch 1/3 is merged as is. I'll send the test updates separately (properly) depending on what results on the kernel side of things. In the meantime, these are useful to demonstrate the problem on a current kernel and test the fix. Brian > v2: > - Rebase to latest for-next branch. > - Include RFC test instrumentation patch. > v1: http://oss.sgi.com/archives/xfs/2014-10/msg00294.html > - xfs_bunmapi() code into independent patch. > - Refactor fix into separate helper function. > rfc: http://oss.sgi.com/archives/xfs/2014-09/msg00337.html > > Brian Foster (3): > xfs: debug mode forced buffered write failure > xfs: update icsb freeblocks counter after extent deletion > xfs: borrow indirect blocks from freed extent when available > > fs/xfs/libxfs/xfs_bmap.c | 158 ++++++++++++++++++++++++++++++++++------------- > fs/xfs/xfs_aops.c | 9 ++- > fs/xfs/xfs_mount.h | 9 +++ > fs/xfs/xfs_sysfs.c | 78 ++++++++++++++++++++--- > 4 files changed, 200 insertions(+), 54 deletions(-) > > -- > 2.4.3 > > _______________________________________________ > xfs mailing list > xfs@oss.sgi.com > http://oss.sgi.com/mailman/listinfo/xfs --5/uDoXvLw7AC5HRs Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename="0001-xfstests-move-generic-indlen-reservation-test-to-xfs.patch" >From ecb696160da6b38288ca7a339c2c386bf4955fba Mon Sep 17 00:00:00 2001 From: Brian Foster Date: Mon, 29 Feb 2016 09:00:36 -0500 Subject: [PATCH 1/2] xfstests: move generic indlen reservation test to xfs dir This test was originally designed to reproduce the split indlen reservation depletion problem in XFS. It was included as a generic test simply because it had no hard dependencies on XFS or associated tools. This test is no longer effective in its current form. Fixing it requires use of XFS specific mechanisms. Therefore, move the test to the XFS specific test directory. No other changes are made in this patch. Signed-off-by: Brian Foster --- tests/generic/033 | 84 --------------------------------------------------- tests/generic/033.out | 4 --- tests/generic/group | 1 - tests/xfs/289 | 84 +++++++++++++++++++++++++++++++++++++++++++++++++++ tests/xfs/289.out | 4 +++ tests/xfs/group | 1 + 6 files changed, 89 insertions(+), 89 deletions(-) delete mode 100755 tests/generic/033 delete mode 100644 tests/generic/033.out create mode 100755 tests/xfs/289 create mode 100644 tests/xfs/289.out diff --git a/tests/generic/033 b/tests/generic/033 deleted file mode 100755 index 4f8bb92..0000000 --- a/tests/generic/033 +++ /dev/null @@ -1,84 +0,0 @@ -#! /bin/bash -# FS QA Test No. 033 -# -# This test stresses indirect block reservation for delayed allocation extents. -# XFS reserves extra blocks for deferred allocation of delalloc extents. These -# reserved blocks can be divided among more extents than anticipated if the -# original extent for which the blocks were reserved is split into multiple -# delalloc extents. If this scenario repeats, eventually some extents are left -# without any indirect block reservation whatsoever. This leads to assert -# failures and possibly other problems in XFS. -# -#----------------------------------------------------------------------- -# Copyright (c) 2014 Red Hat, Inc. All Rights Reserved. -# -# This program is free software; you can redistribute it and/or -# modify it under the terms of the GNU General Public License as -# published by the Free Software Foundation. -# -# This program is distributed in the hope that it would be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write the Free Software Foundation, -# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -#----------------------------------------------------------------------- -# - -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" - -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 - -_cleanup() -{ - cd / - rm -f $tmp.* -} - -# get standard environment, filters and checks -. ./common/rc - -# real QA test starts here -rm -f $seqres.full - -# Modify as appropriate. -_supported_fs generic -_supported_os Linux -_require_scratch -_require_xfs_io_command "fzero" - -_scratch_mkfs >/dev/null 2>&1 -_scratch_mount - -file=$SCRATCH_MNT/file.$seq -bytes=$((64 * 1024)) - -# create sequential delayed allocation -$XFS_IO_PROG -f -c "pwrite 0 $bytes" $file >> $seqres.full 2>&1 - -# Zero every other 4k range to split the larger delalloc extent into many more -# smaller extents. Use zero instead of hole punch because the former does not -# force writeback (and hence delalloc conversion). It can simply discard -# delalloc blocks and convert the ranges to unwritten. -endoff=$((bytes - 4096)) -for i in $(seq 0 8192 $endoff); do - $XFS_IO_PROG -c "fzero -k $i 4k" $file >> $seqres.full 2>&1 -done - -# now zero the opposite set to remove remaining delalloc extents -for i in $(seq 4096 8192 $endoff); do - $XFS_IO_PROG -c "fzero -k $i 4k" $file >> $seqres.full 2>&1 -done - -_scratch_cycle_mount -hexdump $file - -status=0 -exit diff --git a/tests/generic/033.out b/tests/generic/033.out deleted file mode 100644 index 419d831..0000000 --- a/tests/generic/033.out +++ /dev/null @@ -1,4 +0,0 @@ -QA output created by 033 -0000000 0000 0000 0000 0000 0000 0000 0000 0000 -* -0010000 diff --git a/tests/generic/group b/tests/generic/group index 727648c..47638c3 100644 --- a/tests/generic/group +++ b/tests/generic/group @@ -35,7 +35,6 @@ 030 auto quick rw 031 auto quick prealloc rw 032 auto quick rw -033 auto quick rw 034 auto quick metadata log 035 auto quick 036 auto aio rw stress diff --git a/tests/xfs/289 b/tests/xfs/289 new file mode 100755 index 0000000..33cf060 --- /dev/null +++ b/tests/xfs/289 @@ -0,0 +1,84 @@ +#! /bin/bash +# FS QA Test No. 289 +# +# This test stresses indirect block reservation for delayed allocation extents. +# XFS reserves extra blocks for deferred allocation of delalloc extents. These +# reserved blocks can be divided among more extents than anticipated if the +# original extent for which the blocks were reserved is split into multiple +# delalloc extents. If this scenario repeats, eventually some extents are left +# without any indirect block reservation whatsoever. This leads to assert +# failures and possibly other problems in XFS. +# +#----------------------------------------------------------------------- +# Copyright (c) 2014 Red Hat, Inc. All Rights Reserved. +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License as +# published by the Free Software Foundation. +# +# This program is distributed in the hope that it would be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write the Free Software Foundation, +# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA +#----------------------------------------------------------------------- +# + +seq=`basename $0` +seqres=$RESULT_DIR/$seq +echo "QA output created by $seq" + +here=`pwd` +tmp=/tmp/$$ +status=1 # failure is the default! +trap "_cleanup; exit \$status" 0 1 2 3 15 + +_cleanup() +{ + cd / + rm -f $tmp.* +} + +# get standard environment, filters and checks +. ./common/rc + +# real QA test starts here +rm -f $seqres.full + +# Modify as appropriate. +_supported_fs generic +_supported_os Linux +_require_scratch +_require_xfs_io_command "fzero" + +_scratch_mkfs >/dev/null 2>&1 +_scratch_mount + +file=$SCRATCH_MNT/file.$seq +bytes=$((64 * 1024)) + +# create sequential delayed allocation +$XFS_IO_PROG -f -c "pwrite 0 $bytes" $file >> $seqres.full 2>&1 + +# Zero every other 4k range to split the larger delalloc extent into many more +# smaller extents. Use zero instead of hole punch because the former does not +# force writeback (and hence delalloc conversion). It can simply discard +# delalloc blocks and convert the ranges to unwritten. +endoff=$((bytes - 4096)) +for i in $(seq 0 8192 $endoff); do + $XFS_IO_PROG -c "fzero -k $i 4k" $file >> $seqres.full 2>&1 +done + +# now zero the opposite set to remove remaining delalloc extents +for i in $(seq 4096 8192 $endoff); do + $XFS_IO_PROG -c "fzero -k $i 4k" $file >> $seqres.full 2>&1 +done + +_scratch_cycle_mount +hexdump $file + +status=0 +exit diff --git a/tests/xfs/289.out b/tests/xfs/289.out new file mode 100644 index 0000000..bdcf195 --- /dev/null +++ b/tests/xfs/289.out @@ -0,0 +1,4 @@ +QA output created by 289 +0000000 0000 0000 0000 0000 0000 0000 0000 0000 +* +0010000 diff --git a/tests/xfs/group b/tests/xfs/group index e0c4553..b4cc1c0 100644 --- a/tests/xfs/group +++ b/tests/xfs/group @@ -269,6 +269,7 @@ 282 dump ioctl auto quick 283 dump ioctl auto quick 287 auto dump quota quick +289 auto quick rw 290 auto rw prealloc quick ioctl 291 auto repair 292 auto mkfs quick -- 2.4.3 --5/uDoXvLw7AC5HRs Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename="0002-tests-xfs-update-indlen-res.-test-to-use-fail-writes.patch" >From 82ca2acf976736b5dc638d6a5ab31a82a76364ae Mon Sep 17 00:00:00 2001 From: Brian Foster Date: Mon, 29 Feb 2016 09:04:25 -0500 Subject: [PATCH 2/2] tests/xfs: update indlen res. test to use fail writes mechanism This test originally used zero range operations to reproduce problematic indirect delalloc reservations on XFS. Zero range has since been updated such that it cannot be used to reproduce the problem. Instead, a buffered write failure mechanism has been added to XFS to facilitate reproducing this problem. Update the test to use the buffered write failure mechanism to split delalloc extents and reproduce the original indlen reservation problem. Signed-off-by: Brian Foster --- tests/xfs/289 | 28 +++++++++++++++++++--------- tests/xfs/289.out | 4 +--- 2 files changed, 20 insertions(+), 12 deletions(-) diff --git a/tests/xfs/289 b/tests/xfs/289 index 33cf060..5da332b 100755 --- a/tests/xfs/289 +++ b/tests/xfs/289 @@ -44,6 +44,7 @@ _cleanup() # get standard environment, filters and checks . ./common/rc +. ./common/punch # real QA test starts here rm -f $seqres.full @@ -52,33 +53,42 @@ rm -f $seqres.full _supported_fs generic _supported_os Linux _require_scratch -_require_xfs_io_command "fzero" +_require_xfs_sysfs $(_short_dev $TEST_DEV)/fail_writes _scratch_mkfs >/dev/null 2>&1 _scratch_mount +sdev=$(_short_dev $SCRATCH_DEV) file=$SCRATCH_MNT/file.$seq bytes=$((64 * 1024)) # create sequential delayed allocation $XFS_IO_PROG -f -c "pwrite 0 $bytes" $file >> $seqres.full 2>&1 -# Zero every other 4k range to split the larger delalloc extent into many more -# smaller extents. Use zero instead of hole punch because the former does not -# force writeback (and hence delalloc conversion). It can simply discard -# delalloc blocks and convert the ranges to unwritten. +# Enable write failures. All buffered writes fail from this point on. +echo 1 > /sys/fs/xfs/$sdev/fail_writes + +# Write every other 4k range to split the larger delalloc extent into many more +# smaller extents. Use pwrite because with write failures enabled, all +# preexisting delalloc blocks in the range of the I/O are tossed without +# discretion. This allows manipulation of the delalloc extent without conversion +# to real blocks (and thus releasing the indirect reservation). endoff=$((bytes - 4096)) for i in $(seq 0 8192 $endoff); do - $XFS_IO_PROG -c "fzero -k $i 4k" $file >> $seqres.full 2>&1 + $XFS_IO_PROG -c "pwrite $i 4k" $file >> $seqres.full 2>&1 done -# now zero the opposite set to remove remaining delalloc extents +# now pwrite the opposite set to remove remaining delalloc extents for i in $(seq 4096 8192 $endoff); do - $XFS_IO_PROG -c "fzero -k $i 4k" $file >> $seqres.full 2>&1 + $XFS_IO_PROG -c "pwrite $i 4k" $file >> $seqres.full 2>&1 done +echo 0 > /sys/fs/xfs/$sdev/fail_writes + +echo "Silence is golden." + _scratch_cycle_mount -hexdump $file +$XFS_IO_PROG -c 'bmap -vp' $file | _filter_bmap status=0 exit diff --git a/tests/xfs/289.out b/tests/xfs/289.out index bdcf195..72e60f9 100644 --- a/tests/xfs/289.out +++ b/tests/xfs/289.out @@ -1,4 +1,2 @@ QA output created by 289 -0000000 0000 0000 0000 0000 0000 0000 0000 0000 -* -0010000 +Silence is golden. -- 2.4.3 --5/uDoXvLw7AC5HRs-- From JBeulich@suse.com Mon Feb 29 09:29:29 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=ham version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay3.corp.sgi.com [198.149.34.15]) by oss.sgi.com (Postfix) with ESMTP id DD2A229E05 for ; Mon, 29 Feb 2016 09:29:29 -0600 (CST) Received: from cuda.sgi.com (cuda3.sgi.com [192.48.176.15]) by relay3.corp.sgi.com (Postfix) with ESMTP id 4FCF6AC001 for ; Mon, 29 Feb 2016 07:29:26 -0800 (PST) X-ASG-Debug-ID: 1456759764-04cb6c5832816c0001-NocioJ Received: from prv-mh.provo.novell.com (prv-mh.provo.novell.com [137.65.248.74]) by cuda.sgi.com with ESMTP id 1eZ9vxOLGCLVpBok (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO) for ; Mon, 29 Feb 2016 07:29:24 -0800 (PST) X-Barracuda-Envelope-From: JBeulich@suse.com X-Barracuda-Apparent-Source-IP: 137.65.248.74 Received: from INET-PRV-MTA by prv-mh.provo.novell.com with Novell_GroupWise; Mon, 29 Feb 2016 08:29:23 -0700 Message-Id: <56D471E002000078000D76C2@prv-mh.provo.novell.com> X-Mailer: Novell GroupWise Internet Agent 14.2.0 Date: Mon, 29 Feb 2016 08:29:20 -0700 From: "Jan Beulich" To: Cc: , Subject: XFS: false "torn write" errors (preventing mount) Mime-Version: 1.0 X-ASG-Orig-Subj: XFS: false "torn write" errors (preventing mount) Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: quoted-printable Content-Disposition: inline X-Barracuda-Connect: prv-mh.provo.novell.com[137.65.248.74] X-Barracuda-Start-Time: 1456759764 X-Barracuda-Encrypted: ECDHE-RSA-AES256-GCM-SHA384 X-Barracuda-URL: https://192.48.176.15:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-BRTS-Status: 1 X-Barracuda-Spam-Score: 0.00 X-Barracuda-Spam-Status: No, SCORE=0.00 using per-user scores of TAG_LEVEL=1000.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.7 tests=BSF_SC0_MISMATCH_TO X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.3.27442 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 0.00 BSF_SC0_MISMATCH_TO Envelope rcpt doesn't match header Brian, on a system where I routinely run both a 32-bit and a 64-bit x86 kernel (underneath the same 32-bit distro) I'm observing the newly added message being issued, along with the mounts subsequently failing when running the 32-bit kernel. Without doing anything to the FS, running an older 32-bit kernel or a 4.5-rc6 64-bit one have everything work fine (and silently), so I can only assume the detection logic doesn't work right in a 32-bit kernel. I've looked over commits 6528250b71 and 7088c4136f without being able to spot any obvious word size dependency, but then again I know nothing about the inner workings of the XFS code. I'm now hoping that you have an idea what's going on here. Thanks, Jan From bfoster@redhat.com Mon Feb 29 09:58:00 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=ham version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay3.corp.sgi.com [198.149.34.15]) by oss.sgi.com (Postfix) with ESMTP id AA6DA29E05 for ; Mon, 29 Feb 2016 09:58:00 -0600 (CST) Received: from cuda.sgi.com (cuda2.sgi.com [192.48.176.25]) by relay3.corp.sgi.com (Postfix) with ESMTP id 2A4B4AC002 for ; Mon, 29 Feb 2016 07:57:58 -0800 (PST) X-ASG-Debug-ID: 1456761474-04cbb00b71c1c80001-NocioJ Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by cuda.sgi.com with ESMTP id 2oQ3wRV1dhFwCm5K (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO) for ; Mon, 29 Feb 2016 07:57:54 -0800 (PST) X-Barracuda-Envelope-From: bfoster@redhat.com X-Barracuda-Apparent-Source-IP: 209.132.183.28 X-ASG-Whitelist: Client Received: from int-mx11.intmail.prod.int.phx2.redhat.com (int-mx11.intmail.prod.int.phx2.redhat.com [10.5.11.24]) by mx1.redhat.com (Postfix) with ESMTPS id 2649D8F4F7; Mon, 29 Feb 2016 15:57:54 +0000 (UTC) Received: from bfoster.bfoster (dhcp-41-22.bos.redhat.com [10.18.41.22]) by int-mx11.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id u1TFvrIX007551; Mon, 29 Feb 2016 10:57:54 -0500 Received: by bfoster.bfoster (Postfix, from userid 1000) id BDA3112596E; Mon, 29 Feb 2016 10:57:52 -0500 (EST) Date: Mon, 29 Feb 2016 10:57:52 -0500 From: Brian Foster To: Jan Beulich Cc: xfs@oss.sgi.com Subject: Re: XFS: false "torn write" errors (preventing mount) Message-ID: <20160229155752.GB47880@bfoster.bfoster> X-ASG-Orig-Subj: Re: XFS: false "torn write" errors (preventing mount) References: <56D471E002000078000D76C2@prv-mh.provo.novell.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <56D471E002000078000D76C2@prv-mh.provo.novell.com> User-Agent: Mutt/1.5.24 (2015-08-30) X-Scanned-By: MIMEDefang 2.68 on 10.5.11.24 X-Barracuda-Connect: mx1.redhat.com[209.132.183.28] X-Barracuda-Start-Time: 1456761474 X-Barracuda-Encrypted: ECDHE-RSA-AES256-GCM-SHA384 X-Barracuda-URL: https://192.48.176.25:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-BRTS-Status: 1 On Mon, Feb 29, 2016 at 08:29:20AM -0700, Jan Beulich wrote: > Brian, > > on a system where I routinely run both a 32-bit and a 64-bit x86 > kernel (underneath the same 32-bit distro) I'm observing the > newly added message being issued, along with the mounts > subsequently failing when running the 32-bit kernel. Without > doing anything to the FS, running an older 32-bit kernel or a > 4.5-rc6 64-bit one have everything work fine (and silently), so > I can only assume the detection logic doesn't work right in a > 32-bit kernel. I've looked over commits 6528250b71 and > 7088c4136f without being able to spot any obvious word size > dependency, but then again I know nothing about the inner > workings of the XFS code. > > I'm now hoping that you have an idea what's going on here. > There was one follow on fix related to byte order: 8e0bd4925bf6 ("xfs: fix endianness error when checking log block crc on big endian platforms"), but I don't think that would have any effect on an x86 kernel. Is the 32-bit kernel problematic on its own, or must the 64-bit kernel be involved somehow before the 32-bit kernel reproduces a problem? For example, can you mkfs, mount and remount (perhaps multiple times) on the 32-bit kernel without a problem? If so, what happens if you transition to the 64-bit kernel, remount a few times, and then go back to 32-bit? In general, anything that narrows down the reproducer is helpful. I don't appear to have a 32-bit env. handy so I'll kick off an install in the meantime and take a closer look from there... Brian > Thanks, Jan > > _______________________________________________ > xfs mailing list > xfs@oss.sgi.com > http://oss.sgi.com/mailman/listinfo/xfs From BATV+8bed3f455c6e4e509871+4572+infradead.org+hch@bombadil.srs.infradead.org Mon Feb 29 11:13:59 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=ham version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay3.corp.sgi.com [198.149.34.15]) by oss.sgi.com (Postfix) with ESMTP id DF26429E05 for ; Mon, 29 Feb 2016 11:13:59 -0600 (CST) Received: from cuda.sgi.com (cuda3.sgi.com [192.48.176.15]) by relay3.corp.sgi.com (Postfix) with ESMTP id 51F2CAC002 for ; Mon, 29 Feb 2016 09:13:56 -0800 (PST) X-ASG-Debug-ID: 1456766033-04cb6c583384190001-NocioJ Received: from bombadil.infradead.org ([198.137.202.9]) by cuda.sgi.com with ESMTP id EcQ1IuH4BpKAa7F6 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128 verify=NO) for ; Mon, 29 Feb 2016 09:13:54 -0800 (PST) X-Barracuda-Envelope-From: BATV+8bed3f455c6e4e509871+4572+infradead.org+hch@bombadil.srs.infradead.org X-Barracuda-Apparent-Source-IP: 198.137.202.9 Received: from hch by bombadil.infradead.org with local (Exim 4.80.1 #2 (Red Hat Linux)) id 1aaRO7-00055t-VV; Mon, 29 Feb 2016 17:13:39 +0000 Date: Mon, 29 Feb 2016 09:13:39 -0800 From: Christoph Hellwig To: mchristi@redhat.com Cc: linux-f2fs-devel@lists.sourceforge.net, linux-ext4@vger.kernel.org, konrad.wilk@oracle.com, drbd-dev@lists.linbit.com, philipp.reisner@linbit.com, lars.ellenberg@linbit.com, linux-raid@vger.kernel.org, dm-devel@redhat.com, linux-fsdevel@vger.kernel.org, linux-bcache@vger.kernel.org, linux-block@vger.kernel.org, linux-kernel@vger.kernel.org, linux-scsi@vger.kernel.org, linux-mtd@lists.infradead.org, target-devel@vger.kernel.org, linux-btrfs@vger.kernel.org, osd-dev@open-osd.org, xfs@oss.sgi.com, ocfs2-devel@oss.oracle.com Subject: Re: [PATCH 00/35 v4] separate operations from flags in the bio/request structs Message-ID: <20160229171339.GA17755@infradead.org> X-ASG-Orig-Subj: Re: [PATCH 00/35 v4] separate operations from flags in the bio/request structs References: <1456343292-14535-1-git-send-email-mchristi@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1456343292-14535-1-git-send-email-mchristi@redhat.com> User-Agent: Mutt/1.5.24 (2015-08-30) X-SRS-Rewrite: SMTP reverse-path rewritten from by bombadil.infradead.org. See http://www.infradead.org/rpr.html X-Barracuda-Connect: UNKNOWN[198.137.202.9] X-Barracuda-Start-Time: 1456766033 X-Barracuda-Encrypted: ECDHE-RSA-AES128-GCM-SHA256 X-Barracuda-URL: https://192.48.176.15:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-BRTS-Status: 1 X-Barracuda-Spam-Score: 0.60 X-Barracuda-Spam-Status: No, SCORE=0.60 using per-user scores of TAG_LEVEL=1000.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.7 tests=BSF_SC0_MISMATCH_TO, BSF_SC5_MJ1963, RDNS_NONE X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.3.27444 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 0.00 BSF_SC0_MISMATCH_TO Envelope rcpt doesn't match header 0.10 RDNS_NONE Delivered to trusted network by a host with no rDNS 0.50 BSF_SC5_MJ1963 Custom Rule MJ1963 Any reason you've dropped my ACK for the previous version? Jens, is this something you're fine with? Would be great to figure out a way to get this into 4.6. There's probably going to be plenty of conflicts, so having some sort of stable base tree would be nice.. (Talking about conflicts, seems like the block for-linus and for-next trees already conflict quite a bit..) From michaelc@cs.wisc.edu Mon Feb 29 11:31:41 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=ham version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay3.corp.sgi.com [198.149.34.15]) by oss.sgi.com (Postfix) with ESMTP id F3A4529E05 for ; Mon, 29 Feb 2016 11:31:40 -0600 (CST) Received: from cuda.sgi.com (cuda2.sgi.com [192.48.176.25]) by relay3.corp.sgi.com (Postfix) with ESMTP id 61B62AC002 for ; Mon, 29 Feb 2016 09:31:40 -0800 (PST) X-ASG-Debug-ID: 1456767098-04cbb00b70c4b80001-NocioJ Received: from sabe.cs.wisc.edu (sabe.cs.wisc.edu [128.105.6.20]) by cuda.sgi.com with ESMTP id DCFSMBFDWui5ju1U (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128 verify=NO) for ; Mon, 29 Feb 2016 09:31:38 -0800 (PST) X-Barracuda-Envelope-From: michaelc@cs.wisc.edu X-Barracuda-Apparent-Source-IP: 128.105.6.20 Received: from [20.15.0.202] (c-73-242-60-185.hsd1.mn.comcast.net [73.242.60.185]) (authenticated bits=0) by sabe.cs.wisc.edu (8.14.7/8.14.1) with ESMTP id u1THURn6007826 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES128-SHA bits=128 verify=NO); Mon, 29 Feb 2016 11:30:27 -0600 Subject: Re: [PATCH 00/35 v4] separate operations from flags in the bio/request structs To: Christoph Hellwig , mchristi@redhat.com X-ASG-Orig-Subj: Re: [PATCH 00/35 v4] separate operations from flags in the bio/request structs References: <1456343292-14535-1-git-send-email-mchristi@redhat.com> <20160229171339.GA17755@infradead.org> Cc: linux-f2fs-devel@lists.sourceforge.net, linux-ext4@vger.kernel.org, konrad.wilk@oracle.com, drbd-dev@lists.linbit.com, philipp.reisner@linbit.com, lars.ellenberg@linbit.com, linux-raid@vger.kernel.org, dm-devel@redhat.com, linux-fsdevel@vger.kernel.org, linux-bcache@vger.kernel.org, linux-block@vger.kernel.org, linux-kernel@vger.kernel.org, linux-scsi@vger.kernel.org, linux-mtd@lists.infradead.org, target-devel@vger.kernel.org, linux-btrfs@vger.kernel.org, osd-dev@open-osd.org, xfs@oss.sgi.com, ocfs2-devel@oss.oracle.com From: Mike Christie Message-ID: <56D4802E.3090507@cs.wisc.edu> Date: Mon, 29 Feb 2016 11:30:22 -0600 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.6.0 MIME-Version: 1.0 In-Reply-To: <20160229171339.GA17755@infradead.org> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit X-Barracuda-Connect: sabe.cs.wisc.edu[128.105.6.20] X-Barracuda-Start-Time: 1456767098 X-Barracuda-Encrypted: ECDHE-RSA-AES128-GCM-SHA256 X-Barracuda-URL: https://192.48.176.25:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-BRTS-Status: 1 X-Barracuda-Spam-Score: 0.00 X-Barracuda-Spam-Status: No, SCORE=0.00 using per-user scores of TAG_LEVEL=1000.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.7 tests=BSF_SC0_MISMATCH_TO X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.3.27444 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 0.00 BSF_SC0_MISMATCH_TO Envelope rcpt doesn't match header On 02/29/2016 11:13 AM, Christoph Hellwig wrote: > Any reason you've dropped my ACK for the previous version? Sorry. I think I accidentally dropped it when I rebased back over to linux-next. It looks like it only got stuck on the first patch. I will fix that up on the resend for those kbuild errors. From bfoster@redhat.com Mon Feb 29 12:08:09 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=ham version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay1.corp.sgi.com [137.38.102.111]) by oss.sgi.com (Postfix) with ESMTP id F03007CA0 for ; Mon, 29 Feb 2016 12:08:09 -0600 (CST) Received: from cuda.sgi.com (cuda3.sgi.com [192.48.176.15]) by relay1.corp.sgi.com (Postfix) with ESMTP id C2C588F8033 for ; Mon, 29 Feb 2016 10:08:06 -0800 (PST) X-ASG-Debug-ID: 1456769285-04cb6c583185810001-NocioJ Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by cuda.sgi.com with ESMTP id VeA3tawdcLXs2B1q (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO) for ; Mon, 29 Feb 2016 10:08:05 -0800 (PST) X-Barracuda-Envelope-From: bfoster@redhat.com X-Barracuda-Apparent-Source-IP: 209.132.183.28 X-ASG-Whitelist: Client Received: from int-mx10.intmail.prod.int.phx2.redhat.com (int-mx10.intmail.prod.int.phx2.redhat.com [10.5.11.23]) by mx1.redhat.com (Postfix) with ESMTPS id 11E6F7F085; Mon, 29 Feb 2016 18:08:05 +0000 (UTC) Received: from bfoster.bfoster (dhcp-41-22.bos.redhat.com [10.18.41.22]) by int-mx10.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id u1TI842J003581; Mon, 29 Feb 2016 13:08:04 -0500 Received: by bfoster.bfoster (Postfix, from userid 1000) id 7A93E12596E; Mon, 29 Feb 2016 13:08:03 -0500 (EST) Date: Mon, 29 Feb 2016 13:08:03 -0500 From: Brian Foster To: Jan Beulich Cc: xfs@oss.sgi.com Subject: Re: XFS: false "torn write" errors (preventing mount) Message-ID: <20160229180803.GC47880@bfoster.bfoster> X-ASG-Orig-Subj: Re: XFS: false "torn write" errors (preventing mount) References: <56D471E002000078000D76C2@prv-mh.provo.novell.com> <20160229155752.GB47880@bfoster.bfoster> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20160229155752.GB47880@bfoster.bfoster> User-Agent: Mutt/1.5.24 (2015-08-30) X-Scanned-By: MIMEDefang 2.68 on 10.5.11.23 X-Barracuda-Connect: mx1.redhat.com[209.132.183.28] X-Barracuda-Start-Time: 1456769285 X-Barracuda-Encrypted: ECDHE-RSA-AES256-GCM-SHA384 X-Barracuda-URL: https://192.48.176.15:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-BRTS-Status: 1 On Mon, Feb 29, 2016 at 10:57:52AM -0500, Brian Foster wrote: > On Mon, Feb 29, 2016 at 08:29:20AM -0700, Jan Beulich wrote: > > Brian, > > > > on a system where I routinely run both a 32-bit and a 64-bit x86 > > kernel (underneath the same 32-bit distro) I'm observing the > > newly added message being issued, along with the mounts > > subsequently failing when running the 32-bit kernel. Without > > doing anything to the FS, running an older 32-bit kernel or a > > 4.5-rc6 64-bit one have everything work fine (and silently), so > > I can only assume the detection logic doesn't work right in a > > 32-bit kernel. I've looked over commits 6528250b71 and > > 7088c4136f without being able to spot any obvious word size > > dependency, but then again I know nothing about the inner > > workings of the XFS code. > > > > I'm now hoping that you have an idea what's going on here. > > > > There was one follow on fix related to byte order: 8e0bd4925bf6 ("xfs: > fix endianness error when checking log block crc on big endian > platforms"), but I don't think that would have any effect on an x86 > kernel. > > Is the 32-bit kernel problematic on its own, or must the 64-bit kernel > be involved somehow before the 32-bit kernel reproduces a problem? For > example, can you mkfs, mount and remount (perhaps multiple times) on the > 32-bit kernel without a problem? If so, what happens if you transition > to the 64-bit kernel, remount a few times, and then go back to 32-bit? > In general, anything that narrows down the reproducer is helpful. > > I don't appear to have a 32-bit env. handy so I'll kick off an install > in the meantime and take a closer look from there... > Just a heads up that I've been able to reproduce. What I think might be going on is that the log is clean, but the log recovery pass looks back behind the latest unmount record, runs into some records/data written by the alternate architecture from that which is running, and then fails due to crc mismatch. The problem doesn't seem to manifest right away, however, so I could still be missing something here. Anyways, I'll dig into it and try to come up with a fix. Thanks for the report! Brian > Brian > > > Thanks, Jan > > > > _______________________________________________ > > xfs mailing list > > xfs@oss.sgi.com > > http://oss.sgi.com/mailman/listinfo/xfs > > _______________________________________________ > xfs mailing list > xfs@oss.sgi.com > http://oss.sgi.com/mailman/listinfo/xfs From dan.j.williams@intel.com Mon Feb 29 12:22:09 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=T_DKIM_INVALID autolearn=ham version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay1.corp.sgi.com [137.38.102.111]) by oss.sgi.com (Postfix) with ESMTP id 598DF7CA0 for ; Mon, 29 Feb 2016 12:22:09 -0600 (CST) Received: from cuda.sgi.com (cuda1.sgi.com [192.48.157.11]) by relay1.corp.sgi.com (Postfix) with ESMTP id 182588F8040 for ; Mon, 29 Feb 2016 10:22:08 -0800 (PST) X-ASG-Debug-ID: 1456770126-04bdf002eba0ef0001-NocioJ Received: from mail-ob0-f170.google.com (mail-ob0-f170.google.com [209.85.214.170]) by cuda.sgi.com with ESMTP id AXubrLICZcVaErJg (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128 verify=NO) for ; Mon, 29 Feb 2016 10:22:07 -0800 (PST) X-Barracuda-Envelope-From: dan.j.williams@intel.com X-Barracuda-Apparent-Source-IP: 209.85.214.170 Received: by mail-ob0-f170.google.com with SMTP id fz5so10886579obc.0 for ; Mon, 29 Feb 2016 10:22:07 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=intel-com.20150623.gappssmtp.com; s=20150623; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc; bh=VQz11pZIz+b63m2QNek1qMQKPReE83X5UPRvbLku9oI=; b=g+pQ+z+3Be8wta2R1elkG6wuSS+8gd8lZEMRRJd/eP+1RT7bfuTQ7M8Vz2X26YwCVw 1DNfidgAVtb/w67iUd6pqBkm+0OTlZyZekMz43ECeFUX//KqcuVN/CUdWhRG1mN0s5IS acwnN9+1PoKZWA/RikcgD/fG9yzhgM9PTY9/UF2AMQMZp9LKyHdDe7oc/kKUxuKFH+fR UBkEvCrevxU7HgohFSkBopp7UoMLQCXNGAlEiRZw5t3bB8I1D8d+PS3fcVh8/DUVkSj7 Lo8SsIgL8eqiC1t3T9zdN2+EEdq+HO64+/WhU9JZ05OtoxDRw7MG3zEc28euK8nbd3e3 ZMfA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:date :message-id:subject:from:to:cc; bh=VQz11pZIz+b63m2QNek1qMQKPReE83X5UPRvbLku9oI=; b=ABuWxuyFdV2p078i49KrQ1ErRt0BXes3qP+wbD7+T3uI7VqHt/5UjtBd/6B6QOXA2m 4vPb6EKuEZoK4F5tmY2XUkXfElKXqZgKoZIJntZIPXgOJtyahOHxWkerTQaD1CKF/QCc 5f6LGVwt9AYVEW+PaCBWCRFpVhaHNQ6uii2mOgl4PTKnh4+Spi7NxzBpBJPH7b4fEUlr jGZgLhqcecpy5dvmfL+/NWDbBP0aYqu3d+eR0FucHNcT6FiH+A8jfemkXBN6OaGDCsTX y47S7fo2zRFMR1aHoISR9xDmrjvW1P4x9aJr0ykP94s7bCzx9UU5d98EwJquo/pY+DZt aLyA== X-Gm-Message-State: AD7BkJLEz71VNmv8DPzWcIGbRYd1X7iwRnNUnaKrscUcvtEnQIYrQ2HyNw8odoV4qO4yVI2zHcIEMApYeOpAMgZH MIME-Version: 1.0 X-Received: by 10.182.226.165 with SMTP id rt5mr12537334obc.51.1456770126438; Mon, 29 Feb 2016 10:22:06 -0800 (PST) Received: by 10.157.31.107 with HTTP; Mon, 29 Feb 2016 10:22:06 -0800 (PST) In-Reply-To: <20160228053158.GK11419@eguan.usersys.redhat.com> References: <20160227130256.GJ11419@eguan.usersys.redhat.com> <20160228053158.GK11419@eguan.usersys.redhat.com> Date: Mon, 29 Feb 2016 10:22:06 -0800 Message-ID: Subject: Re: generic/320 triggers "list_add attempted on force-poisoned entry" warning on XFS From: Dan Williams X-ASG-Orig-Subj: Re: generic/320 triggers "list_add attempted on force-poisoned entry" warning on XFS To: Eryu Guan Cc: XFS Developers , Ross Zwisler Content-Type: text/plain; charset=UTF-8 X-Barracuda-Connect: mail-ob0-f170.google.com[209.85.214.170] X-Barracuda-Start-Time: 1456770126 X-Barracuda-Encrypted: ECDHE-RSA-AES128-GCM-SHA256 X-Barracuda-URL: https://192.48.157.11:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-BRTS-Status: 1 X-Barracuda-Spam-Score: 0.60 X-Barracuda-Spam-Status: No, SCORE=0.60 using per-user scores of TAG_LEVEL=1000.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.7 tests=BSF_SC0_MISMATCH_TO, DKIM_SIGNED, DKIM_VERIFIED, MARKETING_SUBJECT X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.3.27448 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 0.60 MARKETING_SUBJECT Subject contains popular marketing words 0.00 BSF_SC0_MISMATCH_TO Envelope rcpt doesn't match header -0.00 DKIM_VERIFIED Domain Keys Identified Mail: signature passes verification 0.00 DKIM_SIGNED Domain Keys Identified Mail: message has a signature On Sat, Feb 27, 2016 at 9:31 PM, Eryu Guan wrote: > On Sat, Feb 27, 2016 at 12:10:51PM -0800, Dan Williams wrote: >> On Sat, Feb 27, 2016 at 5:02 AM, Eryu Guan wrote: >> > Hi, >> > >> > Starting from 4.5-rc1 kernel, I sometimes see generic/320 triggers >> > "list_add attempted on force-poisoned entry" warnings on XFS, test hosts >> > are arm64/ppc64/ppc64le, haven't seen it on x86_64 hosts. >> >> Hmm, this triggers when a list_head has ->next or ->prev pointing at >> the address of force_poison which is only defined in lib/list_debug.c. >> The only call site that uses list_force_poison() is in >> devm_memremap_pages(). That currently depends on CONFIG_ZONE_DEVICE >> which in turn depends on X86_64. >> >> So, this appears to be a false positive and the address of >> force_poison is somehow ending up on the stack by accident as that is >> the random value being passed in from __down_common: >> >> struct semaphore_waiter waiter; >> >> list_add_tail(&waiter.list, &sem->wait_list); >> >> So, I think we need a more unique poison value that should never >> appear on the stack: > > Unfortunately I can still see the warning after applying this test patch. > > Then I added debug code to print the pointer value and re-ran the test. > All five failures printed the same pointer value, failed in the same > pattern: > > list_add attempted on force-poisoned entry(0000000000000500), new->next = c00000000136bc00, new->prev = 0000000000000500 > I think this means that no matter what we do the stack will pick up these poison values unless the list_head is explicitly initialized. Something like the following: diff --git a/kernel/locking/semaphore.c b/kernel/locking/semaphore.c index b8120abe594b..39929b4e6fbb 100644 --- a/kernel/locking/semaphore.c +++ b/kernel/locking/semaphore.c @@ -205,7 +205,9 @@ static inline int __sched __down_common(struct semaphore *sem, long state, long timeout) { struct task_struct *task = current; - struct semaphore_waiter waiter; + struct semaphore_waiter waiter = { + .list = LIST_HEAD_INIT(waiter.list), + }; list_add_tail(&waiter.list, &sem->wait_list); waiter.task = task; From david@fromorbit.com Mon Feb 29 15:16:38 2016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=T_FRT_PROFILE2 autolearn=ham version=3.3.1 X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay1.corp.sgi.com [137.38.102.111]) by oss.sgi.com (Postfix) with ESMTP id 47D5B7CA0 for ; Mon, 29 Feb 2016 15:16:38 -0600 (CST) Received: from cuda.sgi.com (cuda3.sgi.com [192.48.176.15]) by relay1.corp.sgi.com (Postfix) with ESMTP id 1A7758F8033 for ; Mon, 29 Feb 2016 13:16:35 -0800 (PST) X-ASG-Debug-ID: 1456780591-04cb6c58328afd0001-NocioJ Received: from ipmail06.adl6.internode.on.net (ipmail06.adl6.internode.on.net [150.101.137.145]) by cuda.sgi.com with ESMTP id eejH755o6TuWe2dp for ; Mon, 29 Feb 2016 13:16:31 -0800 (PST) X-Barracuda-Envelope-From: david@fromorbit.com X-Barracuda-Apparent-Source-IP: 150.101.137.145 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: A2A7DgDps9RWOT0ILHleKAECgw+BP4Jrg3mgLQEBAQEBAQaLdYlPhg0EAgKBOU0BAQEBAQEHAQEBAUABQIRBAQEBAwEnExwjBQsIAxgJJQ8FJQMHGhOIFwe/eAEBAQcCHhiFMoUCiG8FknWEF41YgWiHaYUtjkqCZRmBXCguiEMBAQE Received: from ppp121-44-8-61.lns20.syd4.internode.on.net (HELO dastard) ([121.44.8.61]) by ipmail06.adl6.internode.on.net with ESMTP; 01 Mar 2016 07:46:29 +1030 Received: from dave by dastard with local (Exim 4.80) (envelope-from ) id 1aaVB6-0002Cj-Vy; Tue, 01 Mar 2016 08:16:29 +1100 Date: Tue, 1 Mar 2016 08:16:28 +1100 From: Dave Chinner To: Alex Lyakas Cc: xfs@oss.sgi.com, Christoph Hellwig , Danny Shavit , Yair Hershko , Shyam Kaushik Subject: Re: xfs resize: primary superblock is not updated immediately Message-ID: <20160229211628.GK29057@dastard> X-ASG-Orig-Subj: Re: xfs resize: primary superblock is not updated immediately References: <3685DFAD20214109878873CF81232704@alyakaslap> <20160222212019.GI25832@dastard> <20160222235628.GK25832@dastard> <20160223225926.GN25832@dastard> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.21 (2010-09-15) X-Barracuda-Connect: ipmail06.adl6.internode.on.net[150.101.137.145] X-Barracuda-Start-Time: 1456780591 X-Barracuda-URL: https://192.48.176.15:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-BRTS-Status: 1 X-Barracuda-Spam-Score: 0.00 X-Barracuda-Spam-Status: No, SCORE=0.00 using per-user scores of TAG_LEVEL=1000.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.7 tests=BSF_SC0_MISMATCH_TO X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.3.27451 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 0.00 BSF_SC0_MISMATCH_TO Envelope rcpt doesn't match header On Mon, Feb 29, 2016 at 11:47:54AM +0200, Alex Lyakas wrote: > Hello Dave, > I have tried the same scenario with the 4.5 kernel from about a week > ago, latest commit being [1]. > The same crash is happening, stack trace being [2]. > > I am not proficient with xfstests, unfortunately. I tried running > them several times, but I am not sure I was doing that properly. > > As for your question why the "block beyond end of the filesystem > fails". I tried to debug it further and added a print into > _xfs_buf_find. What happens is that at some point, the sb_dblocks > value is updated to the new value, but the in-memory pag object is > not created. So the test: > > eofs = XFS_FSB_TO_BB(btp->bt_mount, btp->bt_mount->m_sb.sb_dblocks); > if (blkno < 0 || blkno >= eofs) { > ... > > still holds, but the needed pag does not exist. > > Here are the results of the prints that I added: > Feb 29 11:47:09 vc-00-00-350-dev kernel: [ 91.546542] SGI XFS with > ACLs, security attributes, realtime, no debug enabled > Feb 29 11:47:09 vc-00-00-350-dev kernel: [ 91.551243] XFS (dm-0): > Mounting V4 Filesystem > Feb 29 11:47:09 vc-00-00-350-dev kernel: [ 91.576677] XFS (dm-0): > Starting recovery (logdev: internal) > Feb 29 11:47:09 vc-00-00-350-dev kernel: [ 91.577866] > _xfs_buf_find: blkno=0 eofs=200704 >m_sb.sb_dblocks=25088 > Feb 29 11:47:09 vc-00-00-350-dev kernel: [ 91.577872] > _xfs_buf_find: blkno=0 eofs=200704 >m_sb.sb_dblocks=25088 > Feb 29 11:47:09 vc-00-00-350-dev kernel: [ 91.577882] > _xfs_buf_find: blkno=0 eofs=200704 >m_sb.sb_dblocks=25088 > ===> Here we start seeing the new value of "sb_dblocks" and hence > the new value of "eofs": We shouldn't see sb_dblocks change until log recovery completes the first phase of log recovery and the in-core superblock is re-read from disk in xlog_do_recover(). > Feb 29 11:47:09 vc-00-00-350-dev kernel: [ 91.606796] > _xfs_buf_find: blkno=1 eofs=204800 >m_sb.sb_dblocks=25600 > Feb 29 11:47:09 vc-00-00-350-dev kernel: [ 91.606804] > _xfs_buf_find: blkno=1 eofs=204800 >m_sb.sb_dblocks=25600 looking up AGF 0. > Feb 29 11:47:09 vc-00-00-350-dev kernel: [ 91.606988] > _xfs_buf_find: blkno=2 eofs=204800 >m_sb.sb_dblocks=25600 > Feb 29 11:47:09 vc-00-00-350-dev kernel: [ 91.606991] > _xfs_buf_find: blkno=2 eofs=204800 >m_sb.sb_dblocks=25600 Now AGI 0. > Feb 29 11:47:09 vc-00-00-350-dev kernel: [ 91.607205] > _xfs_buf_find: blkno=50177 eofs=204800 >m_sb.sb_dblocks=25600 > Feb 29 11:47:09 vc-00-00-350-dev kernel: [ 91.607210] > _xfs_buf_find: blkno=50177 eofs=204800 >m_sb.sb_dblocks=25600 > Feb 29 11:47:09 vc-00-00-350-dev kernel: [ 91.607375] > _xfs_buf_find: blkno=50178 eofs=204800 >m_sb.sb_dblocks=25600 > Feb 29 11:47:09 vc-00-00-350-dev kernel: [ 91.607378] > _xfs_buf_find: blkno=50178 eofs=204800 >m_sb.sb_dblocks=25600 AGF/AGI 1. > Feb 29 11:47:09 vc-00-00-350-dev kernel: [ 91.607512] > _xfs_buf_find: blkno=100353 eofs=204800 >m_sb.sb_dblocks=25600 > Feb 29 11:47:09 vc-00-00-350-dev kernel: [ 91.607515] > _xfs_buf_find: blkno=100353 eofs=204800 >m_sb.sb_dblocks=25600 > Feb 29 11:47:09 vc-00-00-350-dev kernel: [ 91.607652] > _xfs_buf_find: blkno=100354 eofs=204800 >m_sb.sb_dblocks=25600 > Feb 29 11:47:09 vc-00-00-350-dev kernel: [ 91.607655] > _xfs_buf_find: blkno=100354 eofs=204800 >m_sb.sb_dblocks=25600 AGF/AGI 2. > Feb 29 11:47:09 vc-00-00-350-dev kernel: [ 91.607829] > _xfs_buf_find: blkno=150529 eofs=204800 >m_sb.sb_dblocks=25600 > Feb 29 11:47:09 vc-00-00-350-dev kernel: [ 91.607832] > _xfs_buf_find: blkno=150529 eofs=204800 >m_sb.sb_dblocks=25600 > Feb 29 11:47:09 vc-00-00-350-dev kernel: [ 91.607980] > _xfs_buf_find: blkno=150530 eofs=204800 >m_sb.sb_dblocks=25600 > Feb 29 11:47:09 vc-00-00-350-dev kernel: [ 91.607982] > _xfs_buf_find: blkno=150530 eofs=204800 >m_sb.sb_dblocks=25600 > Feb 29 11:47:09 vc-00-00-350-dev kernel: [ 91.608073] AGF/AGI 4. > _xfs_buf_find: blkno=200705 eofs=204800 >m_sb.sb_dblocks=25600 > ===> and here we crash, but as you see, blkno is valid WRT eofs value. > Feb 29 11:47:09 vc-00-00-350-dev kernel: [ 91.608120] BUG: unable > to handle kernel NULL pointer dereference at 0000000000000098 AGF 5 goes splat. Which means it's through the first phase of log recovery and it's not failing in log recovery. i.e. we are now running xfs_initialize_perag_data() after log recovery. So, as I said a couple of posts back up this thread: | If log recovery succeeds, then yes, I can see that there is a | problem here because the per-ag tree is not reinitialised after | the superblock is re-read. That's a pretty easy fix, though (3-4 | lines of code in xlog_do_recover() to detect a change in | filesystem block count and call xfs_initialize_perag() again.. Cheers, Dave. -- Dave Chinner david@fromorbit.com