[LU-3181] open by FID for write with O_LOV_DELAY_CREATE fails for files on MDT1 Created: 16/Apr/13  Updated: 11/Feb/15  Resolved: 11/Feb/15

Status: Resolved
Project: Lustre
Component/s: None
Affects Version/s: Lustre 2.4.0
Fix Version/s: Lustre 2.7.0

Type: Bug Priority: Minor
Reporter: John Hammond Assignee: John Hammond
Resolution: Fixed Votes: 0
Labels: mdt, patch

Issue Links:
Related
is related to LU-3272 block rename for FID_SEQ_DOT_LUSTRE, ... Open
Severity: 3
Rank (Obsolete): 7750

 Description   

mdt_cross_open() uses a slightly different test than is used elsewhere to detect nefarious attempts at creating striping by opening files for write using their FIDs.

For files on MDT0 this is handled "correctly":

# MDSCOUNT=2 llmount.sh
# cd /mnt/lustre
# multiop f0 m
# lfs path2fid f0
[0x280000400:0x1:0x0]
# multiop .lustre/fid/[0x280000400:0x1:0x0] oO_WRONLY:O_LOV_DELAY_CREATE
# lfs setstripe -c2 .lustre/fid/[0x280000400:0x1:0x0]
# lfs getstripe .lustre/fid/[0x280000400:0x1:0x0]

Now for a file on MDT1:

# lfs mkdir -i1 d1
# multiop d1/f1 m
# lfs path2fid d1/f1
[0x2c0000400:0x2:0x0]
# multiop .lustre/fid/[0x2c0000400:0x2:0x0] oO_WRONLY:O_LOV_DELAY_CREATE
open: Operation not permitted
# lfs setstripe -c2 .lustre/fid/[0x2c0000400:0x2:0x0]
unable to open '.lustre/fid/[0x2c0000400:0x2:0x0]': Operation not permitted (1)
error: setstripe: create stripe file '.lustre/fid/[0x2c0000400:0x2:0x0]' failed
# lfs getstripe .lustre/fid/[0x2c0000400:0x2:0x0]
.lustre/fid/[0x2c0000400:0x2:0x0] has no stripe info

I think that all these checks for fid_is_obf() are somewhat silly and that users of .lustre/fid should just be expected to use O_LOV_DELAY_CREATE.



 Comments   
Comment by Swapnil Pimpale (Inactive) [ 06/Jan/14 ]

mdt_cross_open() should allow opening by FIDs in .lustre/fid
Removed the fid_is_obf() check from this function

Patch: http://review.whamcloud.com/#/c/8738/

Comment by Jodi Levi (Inactive) [ 11/Feb/15 ]

Patch landed to Master.

Generated at Sat Feb 10 01:31:40 UTC 2024 using Jira 9.4.14#940014-sha1:734e6822bbf0d45eff9af51f82432957f73aa32c.