Re: [PATCH 2/2] smb/client: mark file sparse before emulating insert range
Namjae Jeon <[email protected]>
| Newsgroups | org.kernel.vger.linux-cifs |
|---|---|
| Message-ID | <CAKYAXd9=LsiPNG3=+-x44fvowpT0oXWtHwL0eYy8zEtLGR4POQ@mail.gmail.com> |
> diff --git a/fs/smb/client/smb2ops.c b/fs/smb/client/smb2ops.c > index bc7dda6d825a..430b6a1a2d92 100644 > --- a/fs/smb/client/smb2ops.c > +++ b/fs/smb/client/smb2ops.c > @@ -4006,6 +4006,12 @@ static long smb3_insert_range(struct file *file, struct cifs_tcon *tcon, > > count = old_eof - off; > > + /* > + * SET_ZERO_DATA creates a hole only in a sparse file. Try to mark the file > + * sparse, but continue the emulation regardless of the result. > + */ > + smb2_set_sparse(xid, tcon, cfile, inode, true); Shouldn't this error be propagated? Unlike ordinary file extension, FALLOC_FL_INSERT_RANGE is required to create an unallocated hole. If SET_SPARSE fails, SET_ZERO_DATA only writes allocated zeroes, but the operation still returns success...