Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1374769
| From | James Simmons <jsimmons@infradead.org> |
|---|---|
| Newsgroups | linux.kernel |
| Subject | [PATCH 14/17] staging: lustre: lov: return minimal FIEMAP for released files |
| Date | 2016-04-10 15:20 +0200 |
| Message-ID | <rmnru-5Be-49@gated-at.bofh.it> (permalink) |
| References | <rmnrr-5Be-3@gated-at.bofh.it> |
| Organization | linux.* mail to news gateway |
From: Bruno Faccini <bruno.faccini@intel.com>
Since st_blocks = NULL is returned for released files, FIEMAP
should at least return a minimal mapping to make users aware
that file contains data but it is not immediately available.
This will make coreutils and tools such tar happy and have
them presume file is sparse.
Also, add a new test_228 in sanity-hsm to verify it works
for "[cp,tar] --sparse" commands.
Also fix a LBUG ("lov_fiemap()) ASSERTION( fm_local ) failed")
likely to occur when no-object/ENOMEM conditions and also now
when released.
Signed-off-by: Bruno Faccini <bruno.faccini@intel.com>
Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-3864
Reviewed-on: http://review.whamcloud.com/7584
Reviewed-by: Andreas Dilger <andreas.dilger@intel.com>
Reviewed-by: Aurelien Degremont <aurelien.degremont@cea.fr>
Signed-off-by: James Simmons <jsimmons@infradead.org>
---
drivers/staging/lustre/lustre/lov/lov_obd.c | 21 +++++++++++++++++++++
1 files changed, 21 insertions(+), 0 deletions(-)
diff --git a/drivers/staging/lustre/lustre/lov/lov_obd.c b/drivers/staging/lustre/lustre/lov/lov_obd.c
index 1a9e3e8..9b72671 100644
--- a/drivers/staging/lustre/lustre/lov/lov_obd.c
+++ b/drivers/staging/lustre/lustre/lov/lov_obd.c
@@ -1733,6 +1733,27 @@ static int lov_fiemap(struct lov_obd *lov, __u32 keylen, void *key,
unsigned int buffer_size = FIEMAP_BUFFER_SIZE;
if (!lsm_has_objects(lsm)) {
+ if (lsm && lsm_is_released(lsm) && (fm_key->fiemap.fm_start <
+ fm_key->oa.o_size)) {
+ /*
+ * released file, return a minimal FIEMAP if
+ * request fits in file-size.
+ */
+ fiemap->fm_mapped_extents = 1;
+ fiemap->fm_extents[0].fe_logical =
+ fm_key->fiemap.fm_start;
+ if (fm_key->fiemap.fm_start + fm_key->fiemap.fm_length <
+ fm_key->oa.o_size) {
+ fiemap->fm_extents[0].fe_length =
+ fm_key->fiemap.fm_length;
+ } else {
+ fiemap->fm_extents[0].fe_length =
+ fm_key->oa.o_size - fm_key->fiemap.fm_start;
+ fiemap->fm_extents[0].fe_flags |=
+ (FIEMAP_EXTENT_UNKNOWN |
+ FIEMAP_EXTENT_LAST);
+ }
+ }
rc = 0;
goto out;
}
--
1.7.1
Back to linux.kernel | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
[PATCH 00/17] staging : lustre : rest of missing patches from 2.5.0 release James Simmons <jsimmons@infradead.org> - 2016-04-10 15:20 +0200 [PATCH 11/17] staging: lustre: osc: osc_extent_wait() shouldn't be interruptible James Simmons <jsimmons@infradead.org> - 2016-04-10 15:20 +0200 [PATCH 15/17] staging: lustre: lov: Don't wait for active target with OBD_STATFS_NODELAY James Simmons <jsimmons@infradead.org> - 2016-04-10 15:20 +0200 [PATCH 03/17] staging: lustre: ldlm: Fix a race during FLock handling James Simmons <jsimmons@infradead.org> - 2016-04-10 15:20 +0200 [PATCH 10/17] staging: lustre: llite: Truncate to restore file James Simmons <jsimmons@infradead.org> - 2016-04-10 15:20 +0200 [PATCH 02/17] staging: lustre: clio: incorrect assertions in 'enable-invariants' James Simmons <jsimmons@infradead.org> - 2016-04-10 15:20 +0200 [PATCH 17/17] staging: lustre: hsm: don't use real suppgid James Simmons <jsimmons@infradead.org> - 2016-04-10 15:20 +0200 [PATCH 09/17] staging: lustre: ptlrpc: return a meaningful status from ptlrpcd_init() James Simmons <jsimmons@infradead.org> - 2016-04-10 15:20 +0200 [PATCH 06/17] staging: lustre: llite: speedup in unlink/rmdir James Simmons <jsimmons@infradead.org> - 2016-04-10 15:20 +0200 [PATCH 08/17] staging: lustre: obd: MDT mount fails on MDS w/o MGS on it James Simmons <jsimmons@infradead.org> - 2016-04-10 15:20 +0200 [PATCH 04/17] staging: lustre: ldlm: refine LU-2665 patch for POSIX compliance James Simmons <jsimmons@infradead.org> - 2016-04-10 15:20 +0200 [PATCH 14/17] staging: lustre: lov: return minimal FIEMAP for released files James Simmons <jsimmons@infradead.org> - 2016-04-10 15:20 +0200 [PATCH 12/17] staging: lustre: lprocfs: implement log2 using bitops James Simmons <jsimmons@infradead.org> - 2016-04-10 15:20 +0200
csiph-web